org-tempo.el: Enhance a few docstrings
* lisp/org-tempo.el (org-tempo, org-tempo-keywords-alist) (org-tempo-setup, org-tempo-add-templates) (org-tempo--include-file): Enhance docstrings.
This commit is contained in:
parent
b08245a74e
commit
4e97d8621e
|
@ -46,12 +46,12 @@
|
||||||
|
|
||||||
|
|
||||||
(defgroup org-tempo nil
|
(defgroup org-tempo nil
|
||||||
"Options for template expansion of Org structures"
|
"Template expansion of Org structures."
|
||||||
:tag "Org structure"
|
:tag "Org structure"
|
||||||
:group 'org)
|
:group 'org)
|
||||||
|
|
||||||
(defvar org-tempo-tags nil
|
(defvar org-tempo-tags nil
|
||||||
"Tempo tags for Org mode")
|
"Tempo tags for Org mode.")
|
||||||
|
|
||||||
(defcustom org-tempo-keywords-alist
|
(defcustom org-tempo-keywords-alist
|
||||||
'(("L" . "latex")
|
'(("L" . "latex")
|
||||||
|
@ -60,14 +60,13 @@
|
||||||
("i" . "index"))
|
("i" . "index"))
|
||||||
"Keyword completion elements.
|
"Keyword completion elements.
|
||||||
|
|
||||||
Like `org-structure-template-alist' this alist of KEY characters
|
This is an alist of KEY characters and corresponding KEYWORDS,
|
||||||
and KEYWORD. The tempo snippet \"<KEY\" is expand to the KEYWORD
|
just like `org-structure-template-alist'. The tempo snippet
|
||||||
value.
|
\"<KEY\" will be expanded using the KEYWORD value. For example
|
||||||
|
\"<l\" at the beginning of a line is expanded to \"#+latex:\".
|
||||||
|
|
||||||
For example \"<l\" at the beginning of a line is expanded to
|
Do not use \"I\" as a KEY, as it it reserved for expanding
|
||||||
\"#+latex:\".
|
\"#+include\"."
|
||||||
|
|
||||||
Note: the tempo function for \"#+include\" is defined elsewhere."
|
|
||||||
:group 'org-tempo
|
:group 'org-tempo
|
||||||
:type '(repeat (cons (string :tag "Key")
|
:type '(repeat (cons (string :tag "Key")
|
||||||
(string :tag "Keyword")))
|
(string :tag "Keyword")))
|
||||||
|
@ -78,6 +77,7 @@ Note: the tempo function for \"#+include\" is defined elsewhere."
|
||||||
;;; Org Tempo functions and setup.
|
;;; Org Tempo functions and setup.
|
||||||
|
|
||||||
(defun org-tempo-setup ()
|
(defun org-tempo-setup ()
|
||||||
|
"Setup tempo tags and match finder for the current buffer."
|
||||||
(org-tempo--update-maybe)
|
(org-tempo--update-maybe)
|
||||||
(tempo-use-tag-list 'org-tempo-tags)
|
(tempo-use-tag-list 'org-tempo-tags)
|
||||||
(setq-local tempo-match-finder "^ *\\(<[[:word:]]+\\)\\="))
|
(setq-local tempo-match-finder "^ *\\(<[[:word:]]+\\)\\="))
|
||||||
|
@ -100,8 +100,8 @@ Tempo templates will be added."
|
||||||
(defun org-tempo-add-templates ()
|
(defun org-tempo-add-templates ()
|
||||||
"Update all Org Tempo templates.
|
"Update all Org Tempo templates.
|
||||||
|
|
||||||
Goes through `org-structure-template-alist' and
|
Go through `org-structure-template-alist' and
|
||||||
`org-tempo-keywords-alist'."
|
`org-tempo-keywords-alist' and update tempo templates."
|
||||||
(let ((keys (org-tempo--keys)))
|
(let ((keys (org-tempo--keys)))
|
||||||
;; Check for duplicated snippet keys and warn if any are found.
|
;; Check for duplicated snippet keys and warn if any are found.
|
||||||
(when (> (length keys) (length (delete-dups keys)))
|
(when (> (length keys) (length (delete-dups keys)))
|
||||||
|
@ -151,7 +151,7 @@ didn't succeed."
|
||||||
;;; Additional keywords
|
;;; Additional keywords
|
||||||
|
|
||||||
(defun org-tempo--include-file ()
|
(defun org-tempo--include-file ()
|
||||||
"Ask for file name and take care of quit"
|
"Add #+include: and a file name."
|
||||||
(let ((inhibit-quit t))
|
(let ((inhibit-quit t))
|
||||||
(unless (with-local-quit
|
(unless (with-local-quit
|
||||||
(prog1 t
|
(prog1 t
|
||||||
|
@ -168,7 +168,6 @@ didn't succeed."
|
||||||
"<I"
|
"<I"
|
||||||
"Include keyword"
|
"Include keyword"
|
||||||
'org-tempo-tags)
|
'org-tempo-tags)
|
||||||
|
|
||||||
|
|
||||||
;;; Setup of Org Tempo
|
;;; Setup of Org Tempo
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Reference in New Issue