Make mh-funcall-if-exists obsolete
* lisp/mh-e/mh-acros.el (mh-funcall-if-exists): Make obsolete. * lisp/mh-e/mh-alias.el (mh-read-address): * lisp/mh-e/mh-folder.el (mh-folder-mode): * lisp/mh-e/mh-mime.el (mh-mm-display-part): * lisp/mh-e/mh-show.el (mh-defun-show-buffer): * lisp/mh-e/mh-speed.el (mh-speedbar-change-expand-button-char): * lisp/mh-e/mh-tool-bar.el (mh-tool-bar-define): * lisp/mh-e/mh-utils.el (mh-logo-display): * lisp/mh-e/mh-xface.el (mh-face-display-function): Don't use above obsolete macro.
This commit is contained in:
parent
0fd79ee039
commit
3be2a6b8b4
9 changed files with 12 additions and 22 deletions
|
@ -59,7 +59,8 @@
|
|||
;;;###mh-autoload
|
||||
(defmacro mh-funcall-if-exists (function &rest args)
|
||||
"Call FUNCTION with ARGS as parameters if it exists."
|
||||
(declare (debug (symbolp body)))
|
||||
(declare (obsolete "use `(when (fboundp 'foo) (foo))' instead." "29.1")
|
||||
(debug (symbolp body)))
|
||||
;; FIXME: Not clear when this should be used. If the function happens
|
||||
;; not to exist at compile-time (e.g. because the corresponding package
|
||||
;; wasn't loaded), then it won't ever be used :-(
|
||||
|
|
|
@ -258,15 +258,7 @@ Blind aliases or users from /etc/passwd are not expanded."
|
|||
(read-string prompt)
|
||||
(let* ((minibuffer-local-completion-map mh-alias-read-address-map)
|
||||
(completion-ignore-case mh-alias-completion-ignore-case-flag)
|
||||
(the-answer
|
||||
(cond ((fboundp 'completing-read-multiple)
|
||||
(mh-funcall-if-exists
|
||||
completing-read-multiple prompt mh-alias-alist nil nil))
|
||||
((featurep 'multi-prompt)
|
||||
(mh-funcall-if-exists
|
||||
multi-prompt "," nil prompt mh-alias-alist nil nil))
|
||||
(t (split-string
|
||||
(completing-read prompt mh-alias-alist nil nil) ",")))))
|
||||
(the-answer (completing-read-multiple prompt mh-alias-alist nil nil)))
|
||||
(if (not mh-alias-expand-aliases-flag)
|
||||
(mapconcat #'identity the-answer ", ")
|
||||
;; Loop over all elements, checking if in passwd alias or blind first
|
||||
|
|
|
@ -631,7 +631,7 @@ perform the operation on all messages in that region.
|
|||
(add-hook 'write-file-functions #'mh-execute-commands nil t)
|
||||
(make-local-variable 'revert-buffer-function)
|
||||
(make-local-variable 'hl-line-mode) ; avoid pollution
|
||||
(mh-funcall-if-exists hl-line-mode 1)
|
||||
(hl-line-mode 1)
|
||||
(setq revert-buffer-function #'mh-undo-folder)
|
||||
(add-to-list 'minor-mode-alist '(mh-showing-mode " Show"))
|
||||
(mh-inc-spool-make)
|
||||
|
|
|
@ -700,8 +700,7 @@ buttons for alternative parts that are usually suppressed."
|
|||
;; Delete the button and displayed part (if any)
|
||||
(let ((region (get-text-property point 'mh-region)))
|
||||
(when region
|
||||
(mh-funcall-if-exists
|
||||
remove-images (car region) (cdr region)))
|
||||
(remove-images (car region) (cdr region)))
|
||||
(mm-display-part handle)
|
||||
(when region
|
||||
(delete-region (car region) (cdr region))))
|
||||
|
|
|
@ -367,7 +367,8 @@ still visible.\n")
|
|||
(setq normal-exit t))
|
||||
(deactivate-mark)
|
||||
(when (eq major-mode 'mh-folder-mode)
|
||||
(mh-funcall-if-exists hl-line-highlight))
|
||||
(when (fboundp 'hl-line-highlight)
|
||||
(hl-line-highlight)))
|
||||
(cond ((not normal-exit)
|
||||
(set-window-configuration config))
|
||||
,(if dont-return
|
||||
|
|
|
@ -535,8 +535,8 @@ be handled next."
|
|||
(insert-char char 1 t)
|
||||
(put-text-property (point) (1- (point)) 'invisible nil)
|
||||
;; make sure we fix the image on the text here.
|
||||
(mh-funcall-if-exists
|
||||
speedbar-insert-image-button-maybe (- (point) 2) 3)))))
|
||||
(when (fboundp 'speedbar-insert-image-button-maybe)
|
||||
(speedbar-insert-image-button-maybe (- (point) 2) 3))))))
|
||||
|
||||
;;;###mh-autoload
|
||||
(defun mh-speed-add-folder (folder)
|
||||
|
|
|
@ -182,8 +182,7 @@ where,
|
|||
(add-to-list vector-list `(vector nil ',function t ,full-doc))
|
||||
(add-to-list
|
||||
setter `(when (member ',name ,list)
|
||||
(mh-funcall-if-exists
|
||||
tool-bar-add-item ,icon ',function ',key
|
||||
(tool-bar-add-item ,icon ',function ',key
|
||||
:help ,doc :enable ',enable-expr)))
|
||||
(add-to-list mbuttons name)
|
||||
(if docs (add-to-list docs doc))))))
|
||||
|
|
|
@ -139,8 +139,7 @@ Ignores case when searching for OLD."
|
|||
0 2
|
||||
`(display ,(or mh-logo-cache
|
||||
(setq mh-logo-cache
|
||||
(mh-funcall-if-exists
|
||||
find-image '(( :type xpm :ascent center
|
||||
(find-image '(( :type xpm :ascent center
|
||||
:file "mh-logo.xpm" ))))))
|
||||
(car mode-line-buffer-identification))))
|
||||
|
||||
|
|
|
@ -73,8 +73,7 @@ in this order is used."
|
|||
(when (re-search-forward "^from:" (point-max) t)
|
||||
(if (eq type 'url)
|
||||
(mh-x-image-url-display url)
|
||||
(mh-funcall-if-exists
|
||||
insert-image (create-image
|
||||
(insert-image (create-image
|
||||
raw type t
|
||||
:foreground
|
||||
(face-foreground 'mh-show-xface nil t)
|
||||
|
|
Loading…
Add table
Reference in a new issue