summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/autoload.el9
-rw-r--r--lisp/emacs-lisp/derived.el13
-rw-r--r--lisp/emacs-lisp/easy-mmode.el4
-rw-r--r--lisp/emacs-lisp/edebug.el3
-rw-r--r--lisp/emacs-lisp/find-func.el11
-rw-r--r--lisp/emacs-lisp/lisp-mode.el12
6 files changed, 34 insertions, 18 deletions
diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el
index 2356483b233..a6bc4dd9514 100644
--- a/lisp/emacs-lisp/autoload.el
+++ b/lisp/emacs-lisp/autoload.el
@@ -86,10 +86,10 @@ or macro definition or a defcustom)."
;; For special function-like operators, use the `autoload' function.
((memq car '(defun define-skeleton defmacro define-derived-mode
- define-compilation-mode
- define-generic-mode easy-mmode-define-minor-mode
- easy-mmode-define-global-mode
- define-minor-mode defun* defmacro*))
+ define-compilation-mode define-generic-mode
+ easy-mmode-define-global-mode define-global-minor-mode
+ easy-mmode-define-minor-mode define-minor-mode
+ defun* defmacro*))
(let* ((macrop (memq car '(defmacro defmacro*)))
(name (nth 1 form))
(args (case car
@@ -109,6 +109,7 @@ or macro definition or a defcustom)."
(or (and (memq car '(define-skeleton define-derived-mode
define-generic-mode
easy-mmode-define-global-mode
+ define-global-minor-mode
easy-mmode-define-minor-mode
define-minor-mode)) t)
(eq (car-safe (car body)) 'interactive))
diff --git a/lisp/emacs-lisp/derived.el b/lisp/emacs-lisp/derived.el
index e595ff92a39..899c40456e7 100644
--- a/lisp/emacs-lisp/derived.el
+++ b/lisp/emacs-lisp/derived.el
@@ -200,12 +200,19 @@ See Info node `(elisp)Derived Modes' for more details."
No problems result if this variable is not bound.
`add-hook' automatically binds it. (This is true for all hook variables.)"
name)))
+ (unless (boundp ',map)
+ (put ',map 'definition-name ',child))
(defvar ,map (make-sparse-keymap))
,(if declare-syntax
- `(defvar ,syntax (make-syntax-table)))
+ `(progn
+ (unless (boundp ',syntax)
+ (put ',syntax 'definition-name ',child))
+ (defvar ,syntax (make-syntax-table))))
,(if declare-abbrev
- `(defvar ,abbrev
- (progn (define-abbrev-table ',abbrev nil) ,abbrev)))
+ `(progn
+ (put ',abbrev 'definition-name ',child)
+ (defvar ,abbrev
+ (progn (define-abbrev-table ',abbrev nil) ,abbrev))))
(put ',child 'derived-mode-parent ',parent)
,(if group `(put ',child 'custom-mode-group ,group))
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el
index 710c26e0c6c..9d118cd5351 100644
--- a/lisp/emacs-lisp/easy-mmode.el
+++ b/lisp/emacs-lisp/easy-mmode.el
@@ -515,6 +515,7 @@ found, do widen first and then call NARROWFUN with no args after moving."
(unless (pos-visible-in-window-p endpt nil t)
(recenter '(0))))))
,re-narrow-maybe)))
+ (put ',next-sym 'definition-name ',base)
(defun ,prev-sym (&optional count)
,(format "Go to the previous COUNT'th %s" (or name base-name))
(interactive)
@@ -524,7 +525,8 @@ found, do widen first and then call NARROWFUN with no args after moving."
,check-narrow-maybe
(unless (re-search-backward ,re nil t count)
(error "No previous %s" ,name))
- ,re-narrow-maybe))))))
+ ,re-narrow-maybe)))
+ (put ',prev-sym 'definition-name ',base))))
(provide 'easy-mmode)
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el
index 765548083b5..01f1d760109 100644
--- a/lisp/emacs-lisp/edebug.el
+++ b/lisp/emacs-lisp/edebug.el
@@ -733,8 +733,7 @@ already is one.)"
;; Leave point before the next token, skipping white space and comments.
(skip-chars-forward " \t\r\n\f")
(while (= (following-char) ?\;)
- ;; \r is counted as a comment terminator to support selective display.
- (skip-chars-forward "^\n\r") ; skip the comment
+ (skip-chars-forward "^\n") ; skip the comment
(skip-chars-forward " \t\r\n\f")))
diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el
index 2f394c2c470..5ac5d70626d 100644
--- a/lisp/emacs-lisp/find-func.el
+++ b/lisp/emacs-lisp/find-func.el
@@ -63,8 +63,9 @@
;; (define-derived-mode foo ...), (define-minor-mode foo)
(concat
"^\\s-*(\\(def\\(ine-skeleton\\|ine-generic-mode\\|ine-derived-mode\\|\
-ine-minor-mode\\|ine-compilation-mode\\|un-cvs-mode\\|foo\\|[^cfgv]\\w+\\*?\\)\
-\\|easy-mmode-define-global-mode\\|menu-bar-make-toggle\\)"
+ine\\(?:-global\\)?-minor-mode\\|ine-compilation-mode\\|un-cvs-mode\\|\
+foo\\|[^cfgv]\\w+\\*?\\)\\|easy-mmode-define-[a-z-]+\\|easy-menu-define\\|\
+menu-bar-make-toggle\\)"
find-function-space-re
"\\('\\|\(quote \\)?%s\\(\\s-\\|$\\|\(\\|\)\\)")
"The regexp used by `find-function' to search for a function definition.
@@ -78,7 +79,11 @@ Please send improvements and fixes to the maintainer."
:version "21.1")
(defcustom find-variable-regexp
- (concat"^\\s-*(def[^fumag]\\(\\w\\|\\s_\\)+\\*?" find-function-space-re "%s\\(\\s-\\|$\\)")
+ (concat
+ "^\\s-*(\\(def[^fumag]\\(\\w\\|\\s_\\)+\\*?\\|\
+easy-mmode-def\\(map\\|syntax\\)\\|easy-menu-define\\)"
+ find-function-space-re
+ "%s\\(\\s-\\|$\\)")
"The regexp used by `find-variable' to search for a variable definition.
Note it must contain a `%s' at the place where `format'
should insert the variable name. The default value
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 6dd5ffa217f..f9b77c58eed 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -96,13 +96,13 @@
(regexp-opt
'("defun" "defun*" "defsubst" "defmacro"
"defadvice" "define-skeleton"
- "define-minor-mode" "define-derived-mode"
- "define-generic-mode"
+ "define-minor-mode" "define-global-minor-mode"
+ "define-derived-mode" "define-generic-mode"
"define-compiler-macro" "define-modify-macro"
"defsetf" "define-setf-expander"
"define-method-combination"
"defgeneric" "defmethod") t))
- "\\s-+\\(\\sw\\(\\sw\\|\\s_\\)+\\)"))
+ "\\s-+\\(\\(\\sw\\|\\s_\\)+\\)"))
2)
(list (purecopy "Variables")
(purecopy (concat "^\\s-*("
@@ -110,7 +110,7 @@
(regexp-opt
'("defvar" "defconst" "defconstant" "defcustom"
"defparameter" "define-symbol-macro") t))
- "\\s-+\\(\\sw\\(\\sw\\|\\s_\\)+\\)"))
+ "\\s-+\\(\\(\\sw\\|\\s_\\)+\\)"))
2)
(list (purecopy "Types")
(purecopy (concat "^\\s-*("
@@ -119,7 +119,7 @@
'("defgroup" "deftheme" "deftype" "defstruct"
"defclass" "define-condition" "define-widget"
"defface" "defpackage") t))
- "\\s-+'?\\(\\sw\\(\\sw\\|\\s_\\)+\\)"))
+ "\\s-+'?\\(\\(\\sw\\|\\s_\\)+\\)"))
2))
"Imenu generic expression for Lisp mode. See `imenu-generic-expression'.")
@@ -141,6 +141,8 @@
(put 'define-compilation-mode 'doc-string-elt 3)
(put 'easy-mmode-define-minor-mode 'doc-string-elt 2)
(put 'define-minor-mode 'doc-string-elt 2)
+(put 'easy-mmode-define-global-mode 'doc-string-elt 2)
+(put 'define-global-minor-mode 'doc-string-elt 2)
(put 'define-generic-mode 'doc-string-elt 7)
(put 'define-ibuffer-filter 'doc-string-elt 2)
(put 'define-ibuffer-op 'doc-string-elt 3)