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.
This commit is contained in:
Stefan Kangas 2021-10-09 03:09:20 +02:00
parent 9a934c4c0f
commit 5c0a512ef4
9 changed files with 13 additions and 42 deletions

View file

@ -162,12 +162,8 @@ preserved."
(original-position (make-symbol "original-position"))
(modified-flag (make-symbol "modified-flag")))
`(save-excursion
(let* ((,event-window
(or (mh-funcall-if-exists posn-window (event-start ,event))
(mh-funcall-if-exists event-window ,event)))
(,event-position
(or (mh-funcall-if-exists posn-point (event-start ,event))
(mh-funcall-if-exists event-closest-point ,event)))
(let* ((,event-window (posn-window (event-start ,event)))
(,event-position (posn-point (event-start ,event)))
(,original-window (selected-window))
(,original-position (progn
(set-buffer (window-buffer ,event-window))

View file

@ -516,10 +516,6 @@ font-lock is done highlighting.")
(when (and (boundp 'which-func-modes) (listp which-func-modes))
(add-to-list 'which-func-modes 'mh-folder-mode))
;; Shush compiler.
(defvar desktop-save-buffer)
(defvar font-lock-auto-fontify)
;; Ensure new buffers won't get this mode if default major-mode is nil.
(put 'mh-folder-mode 'mode-class 'special)

View file

@ -859,12 +859,8 @@ by commands like \"K v\" which operate on individual MIME parts."
:button-keymap mh-mime-button-map
:help-echo
"Mouse-2 click or press RET (in show buffer) to toggle display")
(dolist (ov (mh-funcall-if-exists overlays-in begin end))
(mh-funcall-if-exists overlay-put ov 'evaporate t))))
;; Shush compiler.
(defvar mm-verify-function-alist) ; < Emacs 22
(defvar mm-decrypt-function-alist) ; < Emacs 22
(dolist (ov (overlays-in begin end))
(overlay-put ov 'evaporate t))))
(defun mh-insert-mime-security-button (handle)
"Display buttons for PGP message, HANDLE."
@ -905,8 +901,8 @@ by commands like \"K v\" which operate on individual MIME parts."
:button-keymap mh-mime-security-button-map
:button-face face
:help-echo "Mouse-2 click or press RET (in show buffer) to see security details.")
(dolist (ov (mh-funcall-if-exists overlays-in begin end))
(mh-funcall-if-exists overlay-put ov 'evaporate t))
(dolist (ov (overlays-in begin end))
(overlay-put ov 'evaporate t))
(when (equal info "Failed")
(let* ((type (if (equal (car handle) "multipart/signed")
"verification" "decryption"))
@ -1140,7 +1136,7 @@ this ;-)"
(defun mh-display-smileys ()
"Display smileys."
(when (and mh-graphical-smileys-flag (mh-small-show-buffer-p))
(mh-funcall-if-exists smiley-region (point-min) (point-max))))
(smiley-region (point-min) (point-max))))
;;;###mh-autoload
(defun mh-display-emphasis ()
@ -1796,8 +1792,7 @@ initialized. Always use the command `mh-have-file-command'.")
(defun mh-mime-cleanup ()
"Free the decoded MIME parts."
(let ((mime-data (gethash (current-buffer) mh-globals-hash)))
;; This is for Emacs, what about XEmacs?
(mh-funcall-if-exists remove-images (point-min) (point-max))
(remove-images (point-min) (point-max))
(when mime-data
(mm-destroy-parts (mh-mime-handles mime-data))
(remhash (current-buffer) mh-globals-hash))))

View file

@ -1413,9 +1413,6 @@ being the list of messages originally from that folder."
(eval-and-compile (require 'which-func nil t))
;; Shush compiler.
(defvar which-func-mode) ; < Emacs 22, XEmacs
;;;###mh-autoload
(defun mh-index-create-imenu-index ()
"Create alist of folder names and positions in index folder buffers."

View file

@ -193,9 +193,6 @@ MESSAGE appears."
(mh-list-to-string (mh-seq-containing-msg message t))
" "))))
;; Shush compiler.
(defvar tool-bar-map)
;;;###mh-autoload
(defun mh-narrow-to-seq (sequence)
"Restrict display to messages in SEQUENCE.

View file

@ -363,11 +363,11 @@ still visible.\n")
folder-buffer)
(delete-other-windows))
(mh-goto-cur-msg t)
(mh-funcall-if-exists deactivate-mark)
(deactivate-mark)
(unwind-protect
(prog1 (call-interactively (function ,original-function))
(setq normal-exit t))
(mh-funcall-if-exists deactivate-mark)
(deactivate-mark)
(when (eq major-mode 'mh-folder-mode)
(mh-funcall-if-exists hl-line-highlight))
(cond ((not normal-exit)
@ -817,9 +817,6 @@ operation."
;; Ensure new buffers won't get this mode if default major-mode is nil.
(put 'mh-show-mode 'mode-class 'special)
;; Shush compiler.
(defvar font-lock-auto-fontify)
;;;###mh-autoload
(define-derived-mode mh-show-mode text-mode "MH-Show"
"Major mode for showing messages in MH-E.\\<mh-show-mode-map>

View file

@ -77,9 +77,6 @@ When INCLUDE-FLAG is non-nil, include message body being replied to."
;;; Tool Bar Creation
;; Shush compiler.
(defvar image-load-path)
(defmacro mh-tool-bar-define (defaults &rest buttons)
"Define a tool bar for MH-E.
DEFAULTS is the list of buttons that are present by default. It

View file

@ -121,9 +121,6 @@ Ignores case when searching for OLD."
(defvar mh-logo-cache nil)
;; Shush compiler.
(defvar image-load-path)
;;;###mh-autoload
(defun mh-logo-display ()
"Modify mode line to display MH-E logo."

View file

@ -145,7 +145,7 @@ The directories are searched for in the order they appear in the list.")
(cl-loop for type in '(xpm xbm gif)
when (or (mh-do-in-gnu-emacs
(ignore-errors
(mh-funcall-if-exists image-type-available-p type))))
(image-type-available-p type))))
collect type))
(autoload 'message-tokenize-header "sendmail")
@ -371,7 +371,7 @@ filenames. In addition, replaces * with %2a. See URL
(eq marker mh-x-image-marker))
(goto-char marker)
(mh-do-in-gnu-emacs
(mh-funcall-if-exists insert-image (create-image image 'png))))
(insert-image (create-image image 'png))))
(set-buffer-modified-p buffer-modified-flag)))))
(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
actual display is carried out by the SENTINEL function."
(if mh-wget-executable
(let ((buffer (generate-new-buffer mh-temp-fetch-buffer))
(filename (or (mh-funcall-if-exists make-temp-file "mhe-fetch")
(expand-file-name (make-temp-name "~/mhe-fetch")))))
(filename (make-temp-file "mhe-fetch")))
(with-current-buffer buffer
(set (make-local-variable 'mh-x-image-url-cache-file) cache-file)
(set (make-local-variable 'mh-x-image-marker) marker)