[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 5065698: Move the ‘declare’ form before the interactive spec in
From: |
Juri Linkov |
Subject: |
master 5065698: Move the ‘declare’ form before the interactive spec in 10 functions. |
Date: |
Wed, 20 Jan 2021 14:19:36 -0500 (EST) |
branch: master
commit 5065698c81dcf241fc234c78bffea54af4203892
Author: Juri Linkov <juri@linkov.net>
Commit: Juri Linkov <juri@linkov.net>
Move the ‘declare’ form before the interactive spec in 10 functions.
* lisp/emacs-lisp/package.el (package-menu-hide-package):
* lisp/font-lock.el (font-lock-debug-fontify):
* lisp/image.el (image-jpeg-p):
* lisp/mail/flow-fill.el (fill-flowed-test):
* lisp/mh-e/mh-speed.el (mh-speed-toggle, mh-speed-view):
* lisp/progmodes/project.el (project-async-shell-command)
(project-shell-command, project-compile):
* lisp/progmodes/sh-script.el (sh-assignment):
Fix special forms to follow in this order: docstring, declare, interactive.
---
lisp/emacs-lisp/package.el | 2 +-
lisp/font-lock.el | 2 +-
lisp/image.el | 2 +-
lisp/mail/flow-fill.el | 2 +-
lisp/mh-e/mh-speed.el | 4 ++--
lisp/progmodes/project.el | 6 +++---
lisp/progmodes/sh-script.el | 2 +-
7 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 453e86c..90b7b88 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -3260,9 +3260,9 @@ To unhide a package, type
`\\[customize-variable] RET package-hidden-regexps'.
Type \\[package-menu-toggle-hiding] to toggle package hiding."
+ (declare (interactive-only "change `package-hidden-regexps' instead."))
(interactive)
(package--ensure-package-menu-mode)
- (declare (interactive-only "change `package-hidden-regexps' instead."))
(let* ((name (when (derived-mode-p 'package-menu-mode)
(concat "\\`" (regexp-quote (symbol-name (package-desc-name
(tabulated-list-get-id))))
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index a51434c..a9fc69d 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -1104,8 +1104,8 @@ Called with two arguments BEG and END.")
"Reinitialize the font-lock machinery and (re-)fontify the buffer.
This functions is a convenience functions when developing font
locking for a mode, and is not meant to be called from lisp functions."
- (interactive)
(declare (interactive-only t))
+ (interactive)
;; Make font-lock recalculate all the mode-specific data.
(setq font-lock-major-mode nil)
;; Make the syntax machinery discard all information.
diff --git a/lisp/image.el b/lisp/image.el
index 8140355..6955a90 100644
--- a/lisp/image.el
+++ b/lisp/image.el
@@ -264,9 +264,9 @@ compatibility with versions of Emacs that lack the variable
;; Used to be in image-type-header-regexps, but now not used anywhere
;; (since 2009-08-28).
(defun image-jpeg-p (data)
- (declare (obsolete "It is unused inside Emacs and will be removed." "27.1"))
"Value is non-nil if DATA, a string, consists of JFIF image data.
We accept the tag Exif because that is the same format."
+ (declare (obsolete "It is unused inside Emacs and will be removed." "27.1"))
(setq data (ignore-errors (string-to-unibyte data)))
(when (and data (string-match-p "\\`\xff\xd8" data))
(catch 'jfif
diff --git a/lisp/mail/flow-fill.el b/lisp/mail/flow-fill.el
index e93ba54..0fab1b2 100644
--- a/lisp/mail/flow-fill.el
+++ b/lisp/mail/flow-fill.el
@@ -174,8 +174,8 @@ lines."
(defvar fill-flowed-encode-tests)
(defun fill-flowed-test ()
- (interactive "")
(declare (obsolete nil "27.1"))
+ (interactive "")
(user-error (concat "This function is obsolete. Please see "
"test/lisp/mail/flow-fill-tests.el "
"in the Emacs source tree")))
diff --git a/lisp/mh-e/mh-speed.el b/lisp/mh-e/mh-speed.el
index 35d5884..00b9680 100644
--- a/lisp/mh-e/mh-speed.el
+++ b/lisp/mh-e/mh-speed.el
@@ -128,8 +128,8 @@ With non-nil FORCE, the update is always carried out."
(defun mh-speed-toggle (&rest ignored)
"Toggle the display of child folders in the speedbar.
The optional arguments from speedbar are IGNORED."
- (interactive)
(declare (ignore args))
+ (interactive)
(beginning-of-line)
(let ((parent (get-text-property (point) 'mh-folder))
(kids-p (get-text-property (point) 'mh-children-p))
@@ -167,8 +167,8 @@ The optional arguments from speedbar are IGNORED."
(defun mh-speed-view (&rest ignored)
"Visits the selected folder just as if you had used
\\<mh-folder-mode-map>\\[mh-visit-folder].
The optional arguments from speedbar are IGNORED."
- (interactive)
(declare (ignore args))
+ (interactive)
(let* ((folder (get-text-property (mh-line-beginning-position) 'mh-folder))
(range (and (stringp folder)
(mh-read-range "Scan" folder t nil nil
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 1812422..768cd58 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -928,16 +928,16 @@ if one already exists."
;;;###autoload
(defun project-async-shell-command ()
"Run `async-shell-command' in the current project's root directory."
- (interactive)
(declare (interactive-only async-shell-command))
+ (interactive)
(let ((default-directory (project-root (project-current t))))
(call-interactively #'async-shell-command)))
;;;###autoload
(defun project-shell-command ()
"Run `shell-command' in the current project's root directory."
- (interactive)
(declare (interactive-only shell-command))
+ (interactive)
(let ((default-directory (project-root (project-current t))))
(call-interactively #'shell-command)))
@@ -974,8 +974,8 @@ loop using the command \\[fileloop-continue]."
;;;###autoload
(defun project-compile ()
"Run `compile' in the project root."
- (interactive)
(declare (interactive-only compile))
+ (interactive)
(let ((default-directory (project-root (project-current t))))
(call-interactively #'compile)))
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index d3692d4..cc045a1 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -2927,8 +2927,8 @@ option followed by a colon `:' if the option accepts an
argument."
(put 'sh-assignment 'delete-selection t)
(defun sh-assignment (arg)
"Remember preceding identifier for future completion and do self-insert."
- (interactive "p")
(declare (obsolete nil "27.1"))
+ (interactive "p")
(self-insert-command arg)
(sh--assignment-collect))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 5065698: Move the ‘declare’ form before the interactive spec in 10 functions.,
Juri Linkov <=