From 9b9473ad755da13cb74bf33c99c081f39eec6e08 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Tue, 11 Aug 2020 16:02:11 +0200 Subject: Fix (end-of-defun N) for N >= 2 * lisp/emacs-lisp/lisp.el (end-of-defun): Only skip to next line when after end of defun when ARG is 1 or less. * test/lisp/emacs-lisp/lisp-tests.el (end-of-defun-twice): New test (bug#24427). --- lisp/emacs-lisp/lisp.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el index 043cf01d2e9..8c18557c79a 100644 --- a/lisp/emacs-lisp/lisp.el +++ b/lisp/emacs-lisp/lisp.el @@ -482,7 +482,8 @@ is called as a function to find the defun's end." (if (looking-at "\\s<\\|\n") (forward-line 1)))))) (funcall end-of-defun-function) - (funcall skip) + (when (<= arg 1) + (funcall skip)) (cond ((> arg 0) ;; Moving forward. -- cgit v1.2.1 From db3a7dfccceb9498227ab06e981706199e1e0f1b Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Tue, 11 Aug 2020 21:21:13 +0200 Subject: Remove compat code from autoload.el * lisp/emacs-lisp/autoload.el (autoload--make-defs-autoload): register-definition-prefixes is in subr.el, so it shouldn't be necessary to check whether it's defined. --- lisp/emacs-lisp/autoload.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el index c76de43be91..c263aa0907b 100644 --- a/lisp/emacs-lisp/autoload.el +++ b/lisp/emacs-lisp/autoload.el @@ -604,9 +604,8 @@ Don't try to split prefixes that are already longer than that.") prefix file dropped) nil)))) prefixes))) - `(if (fboundp 'register-definition-prefixes) - (register-definition-prefixes ,file ',(sort (delq nil strings) - 'string<))))))) + `(register-definition-prefixes ,file ',(sort (delq nil strings) + 'string<)))))) (defun autoload--setup-output (otherbuf outbuf absfile load-name) (let ((outbuf -- cgit v1.2.1 From a5a0a9c9ca0f0485db2c324a30109f655522800d Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 12 Aug 2020 15:43:23 +0200 Subject: Remove Emacs 23 compat code from checkdoc.el * lisp/emacs-lisp/checkdoc.el (checkdoc-run-hooks): Redefine as obsolete function alias for 'run-hook-with-args-until-success'. (checkdoc-this-string-valid-engine) (checkdoc-file-comments-engine): Adjust callers. --- lisp/emacs-lisp/checkdoc.el | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index e4b800786cc..1029b52220d 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -1249,13 +1249,8 @@ checking of documentation strings. ;;; Subst utils ;; -(defsubst checkdoc-run-hooks (hookvar &rest args) - "Run hooks in HOOKVAR with ARGS." - (if (fboundp 'run-hook-with-args-until-success) - (apply #'run-hook-with-args-until-success hookvar args) - ;; This method was similar to above. We ignore the warning - ;; since we will use the above for future Emacs versions - (apply #'run-hook-with-args hookvar args))) +(define-obsolete-function-alias 'checkdoc-run-hooks + #'run-hook-with-args-until-success "28.1") (defsubst checkdoc-create-common-verbs-regexp () "Rebuild the contents of `checkdoc-common-verbs-regexp'." @@ -1873,7 +1868,7 @@ Replace with \"%s\"? " original replace) ;; and reliance on the Ispell program. (checkdoc-ispell-docstring-engine e take-notes) ;; User supplied checks - (save-excursion (checkdoc-run-hooks 'checkdoc-style-functions fp e)) + (save-excursion (run-hook-with-args-until-success 'checkdoc-style-functions fp e)) ;; Done! ))) @@ -2384,7 +2379,7 @@ Code:, and others referenced in the style guide." err (or ;; Generic Full-file checks (should be comment related) - (checkdoc-run-hooks 'checkdoc-comment-style-functions) + (run-hook-with-args-until-success 'checkdoc-comment-style-functions) err)) ;; Done with full file comment checks err))) -- cgit v1.2.1 From 0bc9e7b8f5658c3f4f2d881de3aed158c6f49021 Mon Sep 17 00:00:00 2001 From: Jonas Bernoulli Date: Mon, 20 Apr 2020 23:30:41 +0200 Subject: Merge two conditions and fix indentation The motivation behind this change is that the indentation of some lines was outright wrong. If we address that issue, then we might as well also address the issue that some code is needlessly nested an additional level. That we can fix by merging the conditions. By doing these two changes in on commit we have to change the fewest lines. Even though we are moving to using just spaces for indentation of the modified lines, other lines in the same function are left alone and continue to us tabs+spaces for indentation. That is not "wrong", but just the style we are slowly migrating away from when touching lines for other reasons. Discussed in bug#42397. * lisp/emacs-lisp/eldoc.el (eldoc-minibuffer-message): Merge two conditions and fix indentation. --- lisp/emacs-lisp/eldoc.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el index 19b3bd78aea..4825b5c5e6c 100644 --- a/lisp/emacs-lisp/eldoc.el +++ b/lisp/emacs-lisp/eldoc.el @@ -289,13 +289,13 @@ Otherwise work like `message'." (or (window-in-direction 'above (minibuffer-window)) (minibuffer-selected-window) (get-largest-window))) - (when mode-line-format - (unless (and (listp mode-line-format) - (assq 'eldoc-mode-line-string mode-line-format)) + (when (and mode-line-format + (not (and (listp mode-line-format) + (assq 'eldoc-mode-line-string mode-line-format)))) (setq mode-line-format (list "" '(eldoc-mode-line-string (" " eldoc-mode-line-string " ")) - mode-line-format)))) + mode-line-format))) (setq eldoc-mode-line-string (when (stringp format-string) (apply #'format-message format-string args))) -- cgit v1.2.1 From 7cb029d4d32b0f43c37e6129420db8ea8ed5e900 Mon Sep 17 00:00:00 2001 From: Jonas Bernoulli Date: Mon, 27 Jul 2020 22:48:08 +0200 Subject: ; * lisp/emacs-lisp/autoload.el: Begin summary line with three semicolons. --- lisp/emacs-lisp/autoload.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el index c263aa0907b..2eef4512009 100644 --- a/lisp/emacs-lisp/autoload.el +++ b/lisp/emacs-lisp/autoload.el @@ -1,4 +1,4 @@ -;; autoload.el --- maintain autoloads in loaddefs.el -*- lexical-binding: t -*- +;;; autoload.el --- maintain autoloads in loaddefs.el -*- lexical-binding: t -*- ;; Copyright (C) 1991-1997, 2001-2020 Free Software Foundation, Inc. -- cgit v1.2.1