From 86312ffd93e54bc8993740479c9de3df69935185 Mon Sep 17 00:00:00 2001 From: Shakthi Kannan Date: Wed, 30 Dec 2015 19:59:12 +0200 Subject: 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. --- lisp/emacs-lisp/lisp-mode.el | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lisp/emacs-lisp/lisp-mode.el') 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))) -- cgit v1.2.1 From 0e963201d03d9229bb8ac4323291d2b0119526ed Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 1 Jan 2016 01:16:19 -0800 Subject: Update copyright year to 2016 Run admin/update-copyright. --- lisp/emacs-lisp/lisp-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/emacs-lisp/lisp-mode.el') diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index e99f8a55ab1..4bb1466c930 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 -- cgit v1.2.1 From 723b8bf19de21c0a2c25dc91df5ab22a3a9e2717 Mon Sep 17 00:00:00 2001 From: Leo Liu Date: Sat, 2 Jan 2016 15:48:44 +0800 Subject: Fix regression in font-locking cl-assert and cl-check-type * lisp/emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-2): Fix el-errs-re. --- lisp/emacs-lisp/lisp-mode.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lisp/emacs-lisp/lisp-mode.el') diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 4bb1466c930..574ecef0cde 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -383,7 +383,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 +404,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)) -- cgit v1.2.1 From ce4a052415b70030ee591af3cb5bed0fb79ef3aa Mon Sep 17 00:00:00 2001 From: Leo Liu Date: Thu, 7 Jan 2016 11:00:52 +0800 Subject: Add defvar-local to lisp-imenu-generic-expression * lisp/emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression): Add defvar-local. --- lisp/emacs-lisp/lisp-mode.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lisp/emacs-lisp/lisp-mode.el') diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 574ecef0cde..cb8abde52ed 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -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") -- cgit v1.2.1