-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpel-help.el
63 lines (49 loc) · 2.13 KB
/
pel-help.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
;;; pel-help.el --- PEL extra help utilities -*- lexical-binding: t; -*-
;; Copyright (C) 2020, 2023, 2024 Pierre Rouleau
;; Author: Pierre Rouleau (concat "prouleau" "001" "@" "gmail" ".com")
;; This file is part of the PEL package
;; This file is not part of GNU Emacs.
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;; -----------------------------------------------------------------------------
;;; Commentary:
;;
;; Contains a small set of help providing utility commands.
;;
;; -----------------------------------------------------------------------------
;;; Dependency
(require 'which-func) ; use: `which-function' -- part of Emacs.
;;; Code:
;;-pel-autoload
(defun pel-show-kill-ring ()
"Display content of `kill-ring' in *Help* buffer.
Simple shortcut to invoke `describe-variable' on the `kill-ring' variable."
(interactive)
(describe-variable 'kill-ring))
;;-pel-autoload
(defun pel-show-major-mode ()
"Display the symbol of the current major mode."
(interactive)
(message "Major mode: %S" major-mode))
;;-pel-autoload
(defun pel-show-function (&optional insert-it)
"Display the name of the current function at point in mini-buffer.
Also insert it at point when optional INSERT-IT argument is non-nil."
(interactive "P")
(let ((fct-name (which-function)))
(when (and fct-name insert-it)
(insert fct-name))
(message "%s" (or fct-name "Point is not inside a function definition."))))
;; -----------------------------------------------------------------------------
(provide 'pel-help)
;;; pel-help.el ends here