diff options
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/advice.el | 12 | ||||
-rw-r--r-- | lisp/emacs-lisp/copyright.el | 17 | ||||
-rw-r--r-- | lisp/emacs-lisp/lisp-mode.el | 2 |
3 files changed, 22 insertions, 9 deletions
diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el index c6e80453d72..dbebf314798 100644 --- a/lisp/emacs-lisp/advice.el +++ b/lisp/emacs-lisp/advice.el @@ -2586,13 +2586,21 @@ that property, or otherwise use `(&rest ad-subr-args)'." (natnump docstring)) docstring))) +(defun ad-interactive-form (definition) + "Return the interactive form of DEFINITION. +Like `interactive-form', but also works on pieces of advice." + (interactive-form + (if (ad-advice-p definition) + (ad-lambda-expression definition) + definition))) + (defun ad-body-forms (definition) "Return the list of body forms of DEFINITION." (cond ((ad-compiled-p definition) nil) ((consp definition) (nthcdr (+ (if (ad-docstring definition) 1 0) - (if (interactive-form definition) 1 0)) + (if (ad-interactive-form definition) 1 0)) (cdr (cdr (ad-lambda-expression definition))))))) ;; Matches the docstring of an advised definition. @@ -3024,7 +3032,7 @@ in any of these classes." (ad-get-enabled-advices function 'around) (ad-get-enabled-advices function 'after))) (let ((interactive-form - (interactive-form (ad-advice-definition advice)))) + (ad-interactive-form (ad-advice-definition advice)))) (if interactive-form ;; We found the first one, use it: (ad-do-return interactive-form))))) diff --git a/lisp/emacs-lisp/copyright.el b/lisp/emacs-lisp/copyright.el index 0931ba8635c..7538439d76c 100644 --- a/lisp/emacs-lisp/copyright.el +++ b/lisp/emacs-lisp/copyright.el @@ -44,9 +44,9 @@ A value of nil means to search whole buffer." (const :tag "No limit"))) (defcustom copyright-regexp - "\\(©\|@copyright{}\\|[Cc]opyright\\s *:?\\s *\\(?:(C)\\)?\ + "\\(©\\|@copyright{}\\|[Cc]opyright\\s *:?\\s *\\(?:(C)\\)?\ \\|[Cc]opyright\\s *:?\\s *©\\)\ -\\s *\\([1-9]\\([-0-9, ';\n\t]\\|\\s<\\|\\s>\\)*[0-9]+\\)" +\\s *\\([1-9]\\([-0-9, ';/*%#\n\t]\\|\\s<\\|\\s>\\)*[0-9]+\\)" "What your copyright notice looks like. The second \\( \\) construct must match the years." :group 'copyright @@ -93,7 +93,8 @@ When this is `function', only ask when called non-interactively." (re-search-forward (concat "\\(" copyright-regexp "\\)\\([ \t]*\n\\)?.*\\(?:" copyright-names-regexp "\\)") - (+ (point) copyright-limit) t) + (if copyright-limit (+ (point) copyright-limit)) + t) ;; In case the regexp is rejected. This is useful because ;; copyright-update is typically called from before-save-hook where ;; such an error is very inconvenient for the user. @@ -174,10 +175,11 @@ interactively." (and copyright-current-gpl-version ;; match the GPL version comment in .el files, including the ;; bilingual Esperanto one in two-column, and in texinfo.tex - (re-search-forward "\\(the Free Software Foundation;\ + (re-search-forward + "\\(the Free Software Foundation;\ either \\|; a\\^u eldono \\([0-9]+\\)a, ? a\\^u (la\\^u via \\)\ version \\([0-9]+\\), or (at" - (+ (point) copyright-limit) t) + (if copyright-limit (+ (point) copyright-limit)) t) (not (string= (match-string 3) copyright-current-gpl-version)) (or noquery (y-or-n-p (concat "Replace GPL version by " @@ -199,7 +201,8 @@ Uses heuristic: year >= 50 means 19xx, < 50 means 20xx." (interactive) (widen) (goto-char (point-min)) - (if (re-search-forward copyright-regexp (+ (point) copyright-limit) t) + (if (re-search-forward copyright-regexp + (if copyright-limit (+ (point) copyright-limit)) t) (let ((s (match-beginning 2)) (e (copy-marker (1+ (match-end 2)))) (p (make-marker)) @@ -239,7 +242,7 @@ Uses heuristic: year >= 50 means 19xx, < 50 means 20xx." "Copyright (C) " `(substring (current-time-string) -4) " by " (or (getenv "ORGANIZATION") str) - '(if (> (point) (+ (point-min) copyright-limit)) + '(if (and copyright-limit (> (point) (+ (point-min) copyright-limit))) (message "Copyright extends beyond `copyright-limit' and won't be updated automatically.")) comment-end \n) diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index d41c0af3d73..655677998e0 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -56,6 +56,8 @@ (modify-syntax-entry i "_ " table) (setq i (1+ i))) (modify-syntax-entry ?\s " " table) + ;; Non-break space acts as whitespace. + (modify-syntax-entry ?\x8a0 " " table) (modify-syntax-entry ?\t " " table) (modify-syntax-entry ?\f " " table) (modify-syntax-entry ?\n "> " table) |