diff options
author | Joakim Verona <joakim@verona.se> | 2016-01-15 20:06:45 +0100 |
---|---|---|
committer | Joakim Verona <joakim@verona.se> | 2016-01-15 20:06:45 +0100 |
commit | 4b73dac2885aa7eb23b66c299065e19bd118a4fb (patch) | |
tree | 18452b36b890faf52d40f555ebe4dc3c6e020bc6 /lisp/emacs-lisp/lisp-mode.el | |
parent | 0d824cc5e79e7d29a01929a51dfd673a117c77e8 (diff) | |
parent | 984a14904658da42ca9dea50a811a901ddc56e60 (diff) | |
download | emacs-xwidget_mvp.tar.gz |
merge masterxwidget_mvp
Diffstat (limited to 'lisp/emacs-lisp/lisp-mode.el')
-rw-r--r-- | lisp/emacs-lisp/lisp-mode.el | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 3448b72c3f1..cb8abde52ed 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -1,6 +1,6 @@ ;;; lisp-mode.el --- Lisp mode, and its idiosyncratic commands -*- lexical-binding:t -*- -;; Copyright (C) 1985-1986, 1999-2015 Free Software Foundation, Inc. +;; Copyright (C) 1985-1986, 1999-2016 Free Software Foundation, Inc. ;; Maintainer: emacs-devel@gnu.org ;; Keywords: lisp, languages @@ -131,9 +131,10 @@ t)) "\\s-+\\(" lisp-mode-symbol-regexp "\\)")) 2) - ;; For `defvar', we ignore (defvar FOO) constructs. + ;; For `defvar'/`defvar-local', we ignore (defvar FOO) constructs. (list (purecopy "Variables") - (purecopy (concat "^\\s-*(defvar\\s-+\\(" lisp-mode-symbol-regexp "\\)" + (purecopy (concat "^\\s-*(defvar\\(?:-local\\)?\\s-+\\(" + lisp-mode-symbol-regexp "\\)" "[[:space:]\n]+[^)]")) 1) (list (purecopy "Types") @@ -383,7 +384,8 @@ This will generate compile-time constants from BINDINGS." ((eq type 'type) font-lock-type-face) ((or (not (match-string 2)) ;; Normal defun. (and (match-string 2) ;; Setf function. - (match-string 4))) font-lock-function-name-face))) + (match-string 4))) + font-lock-function-name-face))) nil t))) "Subdued level highlighting for Lisp modes.") @@ -403,7 +405,7 @@ This will generate compile-time constants from BINDINGS." (2 font-lock-constant-face nil t)) ;; Erroneous structures. (,(concat "(" el-errs-re "\\_>") - (1 font-lock-warning-face)) + (1 font-lock-warning-face prepend)) ;; Words inside \\[] tend to be for `substitute-command-keys'. (,(concat "\\\\\\\\\\[\\(" lisp-mode-symbol-regexp "\\)\\]") (1 font-lock-constant-face prepend)) @@ -488,6 +490,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 +523,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 +534,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))) |