aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Kangas2021-10-09 03:09:20 +0200
committerStefan Kangas2021-10-09 03:09:20 +0200
commit5c0a512ef4b4cf8a6dcb36284860a6bf4618334a (patch)
treedf0fa59222b0b89f69d0fb30d1048d147c6c34d5
parent9a934c4c0f841915b2f99228b5365587892c13fe (diff)
downloademacs-5c0a512ef4b4cf8a6dcb36284860a6bf4618334a.tar.gz
emacs-5c0a512ef4b4cf8a6dcb36284860a6bf4618334a.zip
Remove some unnecessary calls to mh-funcall-if-exists
* lisp/mh-e/mh-acros.el (mh-do-at-event-location): * lisp/mh-e/mh-mime.el (mh-mime-cleanup, mh-display-smileys) (mh-insert-mime-security-button, mh-insert-mime-button): * lisp/mh-e/mh-show.el (mh-defun-show-buffer): * lisp/mh-e/mh-xface.el (mh-x-image-url-fetch-image) (mh-x-image-display, mh-picon-image-types): Remove unnecessary calls to mh-funcall-if-exists; these functions always exist as they are autoloaded.
-rw-r--r--lisp/mh-e/mh-acros.el8
-rw-r--r--lisp/mh-e/mh-folder.el4
-rw-r--r--lisp/mh-e/mh-mime.el17
-rw-r--r--lisp/mh-e/mh-search.el3
-rw-r--r--lisp/mh-e/mh-seq.el3
-rw-r--r--lisp/mh-e/mh-show.el7
-rw-r--r--lisp/mh-e/mh-tool-bar.el3
-rw-r--r--lisp/mh-e/mh-utils.el3
-rw-r--r--lisp/mh-e/mh-xface.el7
9 files changed, 13 insertions, 42 deletions
diff --git a/lisp/mh-e/mh-acros.el b/lisp/mh-e/mh-acros.el
index f3447aa80b1..6a0342407dd 100644
--- a/lisp/mh-e/mh-acros.el
+++ b/lisp/mh-e/mh-acros.el
@@ -162,12 +162,8 @@ preserved."
162 (original-position (make-symbol "original-position")) 162 (original-position (make-symbol "original-position"))
163 (modified-flag (make-symbol "modified-flag"))) 163 (modified-flag (make-symbol "modified-flag")))
164 `(save-excursion 164 `(save-excursion
165 (let* ((,event-window 165 (let* ((,event-window (posn-window (event-start ,event)))
166 (or (mh-funcall-if-exists posn-window (event-start ,event)) 166 (,event-position (posn-point (event-start ,event)))
167 (mh-funcall-if-exists event-window ,event)))
168 (,event-position
169 (or (mh-funcall-if-exists posn-point (event-start ,event))
170 (mh-funcall-if-exists event-closest-point ,event)))
171 (,original-window (selected-window)) 167 (,original-window (selected-window))
172 (,original-position (progn 168 (,original-position (progn
173 (set-buffer (window-buffer ,event-window)) 169 (set-buffer (window-buffer ,event-window))
diff --git a/lisp/mh-e/mh-folder.el b/lisp/mh-e/mh-folder.el
index 289b430d669..ed65395c944 100644
--- a/lisp/mh-e/mh-folder.el
+++ b/lisp/mh-e/mh-folder.el
@@ -516,10 +516,6 @@ font-lock is done highlighting.")
516(when (and (boundp 'which-func-modes) (listp which-func-modes)) 516(when (and (boundp 'which-func-modes) (listp which-func-modes))
517 (add-to-list 'which-func-modes 'mh-folder-mode)) 517 (add-to-list 'which-func-modes 'mh-folder-mode))
518 518
519;; Shush compiler.
520(defvar desktop-save-buffer)
521(defvar font-lock-auto-fontify)
522
523;; Ensure new buffers won't get this mode if default major-mode is nil. 519;; Ensure new buffers won't get this mode if default major-mode is nil.
524(put 'mh-folder-mode 'mode-class 'special) 520(put 'mh-folder-mode 'mode-class 'special)
525 521
diff --git a/lisp/mh-e/mh-mime.el b/lisp/mh-e/mh-mime.el
index 6b109715cc4..0dbf8f0da19 100644
--- a/lisp/mh-e/mh-mime.el
+++ b/lisp/mh-e/mh-mime.el
@@ -859,12 +859,8 @@ by commands like \"K v\" which operate on individual MIME parts."
859 :button-keymap mh-mime-button-map 859 :button-keymap mh-mime-button-map
860 :help-echo 860 :help-echo
861 "Mouse-2 click or press RET (in show buffer) to toggle display") 861 "Mouse-2 click or press RET (in show buffer) to toggle display")
862 (dolist (ov (mh-funcall-if-exists overlays-in begin end)) 862 (dolist (ov (overlays-in begin end))
863 (mh-funcall-if-exists overlay-put ov 'evaporate t)))) 863 (overlay-put ov 'evaporate t))))
864
865;; Shush compiler.
866(defvar mm-verify-function-alist) ; < Emacs 22
867(defvar mm-decrypt-function-alist) ; < Emacs 22
868 864
869(defun mh-insert-mime-security-button (handle) 865(defun mh-insert-mime-security-button (handle)
870 "Display buttons for PGP message, HANDLE." 866 "Display buttons for PGP message, HANDLE."
@@ -905,8 +901,8 @@ by commands like \"K v\" which operate on individual MIME parts."
905 :button-keymap mh-mime-security-button-map 901 :button-keymap mh-mime-security-button-map
906 :button-face face 902 :button-face face
907 :help-echo "Mouse-2 click or press RET (in show buffer) to see security details.") 903 :help-echo "Mouse-2 click or press RET (in show buffer) to see security details.")
908 (dolist (ov (mh-funcall-if-exists overlays-in begin end)) 904 (dolist (ov (overlays-in begin end))
909 (mh-funcall-if-exists overlay-put ov 'evaporate t)) 905 (overlay-put ov 'evaporate t))
910 (when (equal info "Failed") 906 (when (equal info "Failed")
911 (let* ((type (if (equal (car handle) "multipart/signed") 907 (let* ((type (if (equal (car handle) "multipart/signed")
912 "verification" "decryption")) 908 "verification" "decryption"))
@@ -1140,7 +1136,7 @@ this ;-)"
1140(defun mh-display-smileys () 1136(defun mh-display-smileys ()
1141 "Display smileys." 1137 "Display smileys."
1142 (when (and mh-graphical-smileys-flag (mh-small-show-buffer-p)) 1138 (when (and mh-graphical-smileys-flag (mh-small-show-buffer-p))
1143 (mh-funcall-if-exists smiley-region (point-min) (point-max)))) 1139 (smiley-region (point-min) (point-max))))
1144 1140
1145;;;###mh-autoload 1141;;;###mh-autoload
1146(defun mh-display-emphasis () 1142(defun mh-display-emphasis ()
@@ -1796,8 +1792,7 @@ initialized. Always use the command `mh-have-file-command'.")
1796(defun mh-mime-cleanup () 1792(defun mh-mime-cleanup ()
1797 "Free the decoded MIME parts." 1793 "Free the decoded MIME parts."
1798 (let ((mime-data (gethash (current-buffer) mh-globals-hash))) 1794 (let ((mime-data (gethash (current-buffer) mh-globals-hash)))
1799 ;; This is for Emacs, what about XEmacs? 1795 (remove-images (point-min) (point-max))
1800 (mh-funcall-if-exists remove-images (point-min) (point-max))
1801 (when mime-data 1796 (when mime-data
1802 (mm-destroy-parts (mh-mime-handles mime-data)) 1797 (mm-destroy-parts (mh-mime-handles mime-data))
1803 (remhash (current-buffer) mh-globals-hash)))) 1798 (remhash (current-buffer) mh-globals-hash))))
diff --git a/lisp/mh-e/mh-search.el b/lisp/mh-e/mh-search.el
index e3cd688c59f..23f0f5a7c25 100644
--- a/lisp/mh-e/mh-search.el
+++ b/lisp/mh-e/mh-search.el
@@ -1413,9 +1413,6 @@ being the list of messages originally from that folder."
1413 1413
1414(eval-and-compile (require 'which-func nil t)) 1414(eval-and-compile (require 'which-func nil t))
1415 1415
1416;; Shush compiler.
1417(defvar which-func-mode) ; < Emacs 22, XEmacs
1418
1419;;;###mh-autoload 1416;;;###mh-autoload
1420(defun mh-index-create-imenu-index () 1417(defun mh-index-create-imenu-index ()
1421 "Create alist of folder names and positions in index folder buffers." 1418 "Create alist of folder names and positions in index folder buffers."
diff --git a/lisp/mh-e/mh-seq.el b/lisp/mh-e/mh-seq.el
index a7a395acbc5..c8df75dbc71 100644
--- a/lisp/mh-e/mh-seq.el
+++ b/lisp/mh-e/mh-seq.el
@@ -193,9 +193,6 @@ MESSAGE appears."
193 (mh-list-to-string (mh-seq-containing-msg message t)) 193 (mh-list-to-string (mh-seq-containing-msg message t))
194 " ")))) 194 " "))))
195 195
196;; Shush compiler.
197(defvar tool-bar-map)
198
199;;;###mh-autoload 196;;;###mh-autoload
200(defun mh-narrow-to-seq (sequence) 197(defun mh-narrow-to-seq (sequence)
201 "Restrict display to messages in SEQUENCE. 198 "Restrict display to messages in SEQUENCE.
diff --git a/lisp/mh-e/mh-show.el b/lisp/mh-e/mh-show.el
index 781f63e5065..25b83b2ff88 100644
--- a/lisp/mh-e/mh-show.el
+++ b/lisp/mh-e/mh-show.el
@@ -363,11 +363,11 @@ still visible.\n")
363 folder-buffer) 363 folder-buffer)
364 (delete-other-windows)) 364 (delete-other-windows))
365 (mh-goto-cur-msg t) 365 (mh-goto-cur-msg t)
366 (mh-funcall-if-exists deactivate-mark) 366 (deactivate-mark)
367 (unwind-protect 367 (unwind-protect
368 (prog1 (call-interactively (function ,original-function)) 368 (prog1 (call-interactively (function ,original-function))
369 (setq normal-exit t)) 369 (setq normal-exit t))
370 (mh-funcall-if-exists deactivate-mark) 370 (deactivate-mark)
371 (when (eq major-mode 'mh-folder-mode) 371 (when (eq major-mode 'mh-folder-mode)
372 (mh-funcall-if-exists hl-line-highlight)) 372 (mh-funcall-if-exists hl-line-highlight))
373 (cond ((not normal-exit) 373 (cond ((not normal-exit)
@@ -817,9 +817,6 @@ operation."
817;; Ensure new buffers won't get this mode if default major-mode is nil. 817;; Ensure new buffers won't get this mode if default major-mode is nil.
818(put 'mh-show-mode 'mode-class 'special) 818(put 'mh-show-mode 'mode-class 'special)
819 819
820;; Shush compiler.
821(defvar font-lock-auto-fontify)
822
823;;;###mh-autoload 820;;;###mh-autoload
824(define-derived-mode mh-show-mode text-mode "MH-Show" 821(define-derived-mode mh-show-mode text-mode "MH-Show"
825 "Major mode for showing messages in MH-E.\\<mh-show-mode-map> 822 "Major mode for showing messages in MH-E.\\<mh-show-mode-map>
diff --git a/lisp/mh-e/mh-tool-bar.el b/lisp/mh-e/mh-tool-bar.el
index e4cd01c2229..805408cfc78 100644
--- a/lisp/mh-e/mh-tool-bar.el
+++ b/lisp/mh-e/mh-tool-bar.el
@@ -77,9 +77,6 @@ When INCLUDE-FLAG is non-nil, include message body being replied to."
77 77
78;;; Tool Bar Creation 78;;; Tool Bar Creation
79 79
80;; Shush compiler.
81(defvar image-load-path)
82
83(defmacro mh-tool-bar-define (defaults &rest buttons) 80(defmacro mh-tool-bar-define (defaults &rest buttons)
84 "Define a tool bar for MH-E. 81 "Define a tool bar for MH-E.
85DEFAULTS is the list of buttons that are present by default. It 82DEFAULTS is the list of buttons that are present by default. It
diff --git a/lisp/mh-e/mh-utils.el b/lisp/mh-e/mh-utils.el
index 65286bdcccd..93bc7f8d390 100644
--- a/lisp/mh-e/mh-utils.el
+++ b/lisp/mh-e/mh-utils.el
@@ -121,9 +121,6 @@ Ignores case when searching for OLD."
121 121
122(defvar mh-logo-cache nil) 122(defvar mh-logo-cache nil)
123 123
124;; Shush compiler.
125(defvar image-load-path)
126
127;;;###mh-autoload 124;;;###mh-autoload
128(defun mh-logo-display () 125(defun mh-logo-display ()
129 "Modify mode line to display MH-E logo." 126 "Modify mode line to display MH-E logo."
diff --git a/lisp/mh-e/mh-xface.el b/lisp/mh-e/mh-xface.el
index d4c5481976a..5983353b3d7 100644
--- a/lisp/mh-e/mh-xface.el
+++ b/lisp/mh-e/mh-xface.el
@@ -145,7 +145,7 @@ The directories are searched for in the order they appear in the list.")
145 (cl-loop for type in '(xpm xbm gif) 145 (cl-loop for type in '(xpm xbm gif)
146 when (or (mh-do-in-gnu-emacs 146 when (or (mh-do-in-gnu-emacs
147 (ignore-errors 147 (ignore-errors
148 (mh-funcall-if-exists image-type-available-p type)))) 148 (image-type-available-p type))))
149 collect type)) 149 collect type))
150 150
151(autoload 'message-tokenize-header "sendmail") 151(autoload 'message-tokenize-header "sendmail")
@@ -371,7 +371,7 @@ filenames. In addition, replaces * with %2a. See URL
371 (eq marker mh-x-image-marker)) 371 (eq marker mh-x-image-marker))
372 (goto-char marker) 372 (goto-char marker)
373 (mh-do-in-gnu-emacs 373 (mh-do-in-gnu-emacs
374 (mh-funcall-if-exists insert-image (create-image image 'png)))) 374 (insert-image (create-image image 'png))))
375 (set-buffer-modified-p buffer-modified-flag))))) 375 (set-buffer-modified-p buffer-modified-flag)))))
376 376
377(defun mh-x-image-url-fetch-image (url cache-file marker sentinel) 377(defun mh-x-image-url-fetch-image (url cache-file marker sentinel)
@@ -381,8 +381,7 @@ be displayed in a buffer and position specified by MARKER. The
381actual display is carried out by the SENTINEL function." 381actual display is carried out by the SENTINEL function."
382 (if mh-wget-executable 382 (if mh-wget-executable
383 (let ((buffer (generate-new-buffer mh-temp-fetch-buffer)) 383 (let ((buffer (generate-new-buffer mh-temp-fetch-buffer))
384 (filename (or (mh-funcall-if-exists make-temp-file "mhe-fetch") 384 (filename (make-temp-file "mhe-fetch")))
385 (expand-file-name (make-temp-name "~/mhe-fetch")))))
386 (with-current-buffer buffer 385 (with-current-buffer buffer
387 (set (make-local-variable 'mh-x-image-url-cache-file) cache-file) 386 (set (make-local-variable 'mh-x-image-url-cache-file) cache-file)
388 (set (make-local-variable 'mh-x-image-marker) marker) 387 (set (make-local-variable 'mh-x-image-marker) marker)