diff options
author | Shakthi Kannan <shakthimaan@gmail.com> | 2015-12-30 19:59:12 +0200 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2015-12-30 19:59:12 +0200 |
commit | 86312ffd93e54bc8993740479c9de3df69935185 (patch) | |
tree | edae251bc62365419b63db2d6eaa1e6afe669e44 /lisp/emacs-lisp/lisp-mode.el | |
parent | c930e75bfae40c914ad5d5d1996db4af53a3f340 (diff) | |
download | emacs-86312ffd93e54bc8993740479c9de3df69935185.tar.gz |
Document support for ':documentation' in Lisp mode
* lisp/emacs-lisp/lisp-mode.el (lisp-string-in-doc-position-p)
(lisp-string-after-doc-keyword-p)
(lisp-font-lock-syntactic-face-function): Add doc strings.
Diffstat (limited to 'lisp/emacs-lisp/lisp-mode.el')
-rw-r--r-- | lisp/emacs-lisp/lisp-mode.el | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 3448b72c3f1..e99f8a55ab1 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -488,6 +488,9 @@ This will generate compile-time constants from BINDINGS." "Default expressions to highlight in Lisp modes.") (defun lisp-string-in-doc-position-p (listbeg startpos) + "Return true if a doc string may occur at STARTPOS inside a list. +LISTBEG is the position of the start of the innermost list +containing STARTPOS." (let* ((firstsym (and listbeg (save-excursion (goto-char listbeg) @@ -518,6 +521,9 @@ This will generate compile-time constants from BINDINGS." (= (point) startpos)))))) (defun lisp-string-after-doc-keyword-p (listbeg startpos) + "Return true if `:documentation' symbol ends at STARTPOS inside a list. +LISTBEG is the position of the start of the innermost list +containing STARTPOS." (and listbeg ; We are inside a Lisp form. (save-excursion (goto-char startpos) @@ -526,6 +532,9 @@ This will generate compile-time constants from BINDINGS." (looking-at ":documentation\\_>")))))) (defun lisp-font-lock-syntactic-face-function (state) + "Return syntactic face function for the position represented by STATE. +STATE is a `parse-partial-sexp' state, and the returned function is the +Lisp font lock syntactic face function." (if (nth 3 state) ;; This might be a (doc)string or a |...| symbol. (let ((startpos (nth 8 state))) |