[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 5c0a512 2/2: Remove some unnecessary calls to mh-funcall-if-exist
From: |
Stefan Kangas |
Subject: |
master 5c0a512 2/2: Remove some unnecessary calls to mh-funcall-if-exists |
Date: |
Fri, 8 Oct 2021 21:13:06 -0400 (EDT) |
branch: master
commit 5c0a512ef4b4cf8a6dcb36284860a6bf4618334a
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>
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.
---
lisp/mh-e/mh-acros.el | 8 ++------
lisp/mh-e/mh-folder.el | 4 ----
lisp/mh-e/mh-mime.el | 17 ++++++-----------
lisp/mh-e/mh-search.el | 3 ---
lisp/mh-e/mh-seq.el | 3 ---
lisp/mh-e/mh-show.el | 7 ++-----
lisp/mh-e/mh-tool-bar.el | 3 ---
lisp/mh-e/mh-utils.el | 3 ---
lisp/mh-e/mh-xface.el | 7 +++----
9 files changed, 13 insertions(+), 42 deletions(-)
diff --git a/lisp/mh-e/mh-acros.el b/lisp/mh-e/mh-acros.el
index f3447aa..6a03424 100644
--- a/lisp/mh-e/mh-acros.el
+++ b/lisp/mh-e/mh-acros.el
@@ -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))
diff --git a/lisp/mh-e/mh-folder.el b/lisp/mh-e/mh-folder.el
index 289b430..ed65395 100644
--- a/lisp/mh-e/mh-folder.el
+++ b/lisp/mh-e/mh-folder.el
@@ -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)
diff --git a/lisp/mh-e/mh-mime.el b/lisp/mh-e/mh-mime.el
index 6b10971..0dbf8f0 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."
: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))))
diff --git a/lisp/mh-e/mh-search.el b/lisp/mh-e/mh-search.el
index e3cd688..23f0f5a 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."
(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."
diff --git a/lisp/mh-e/mh-seq.el b/lisp/mh-e/mh-seq.el
index a7a395a..c8df75d 100644
--- a/lisp/mh-e/mh-seq.el
+++ b/lisp/mh-e/mh-seq.el
@@ -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.
diff --git a/lisp/mh-e/mh-show.el b/lisp/mh-e/mh-show.el
index 781f63e..25b83b2 100644
--- a/lisp/mh-e/mh-show.el
+++ b/lisp/mh-e/mh-show.el
@@ -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>
diff --git a/lisp/mh-e/mh-tool-bar.el b/lisp/mh-e/mh-tool-bar.el
index e4cd01c..805408c 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."
;;; 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
diff --git a/lisp/mh-e/mh-utils.el b/lisp/mh-e/mh-utils.el
index 65286bd..93bc7f8 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."
(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."
diff --git a/lisp/mh-e/mh-xface.el b/lisp/mh-e/mh-xface.el
index d4c5481..5983353 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.")
(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)