aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Wohler2012-11-24 20:13:04 -0800
committerBill Wohler2012-11-24 20:13:04 -0800
commitfb9958d7bc8239666dbb115182be607d7c0a0c77 (patch)
tree27b8f8a740266b2871ed47ddf0b78f32b7666d6b
parent5244bc019bf7376caff3bb198ff674e0ad9fb0e6 (diff)
downloademacs-fb9958d7bc8239666dbb115182be607d7c0a0c77.tar.gz
emacs-fb9958d7bc8239666dbb115182be607d7c0a0c77.zip
* mh-compat.el (mh-define-obsolete-variable-alias)
(mh-make-obsolete-variable): New macros to fix XEmacs compiler warnings. * mh-letter.el (mh-yank-hooks): Use new mh-make-obsolete-variable macro. * mh-e.el (mh-kill-folder-suppress-prompt-hooks): Use new mh-define-obsolete-variable-alias macro. * mh-compat.el (mh-cl-flet): New alias for cl-flet on Emacs 24 and flet elsewhere. * mh-thread.el (mh-thread-set-tables): Replace flet with new alias mh-cl-flet. * mh-show.el (mh-gnus-article-highlight-citation): Replace flet with new alias mh-cl-flet. * mh-mime.el (mh-display-with-external-viewer, mh-mime-display) (mh-press-button, mh-push-button, mh-display-emphasis): Replace flet with new alias mh-cl-flet. * mh-e.el (mh-invisible-header-fields-internal): Remove trailing whitespace.
-rw-r--r--lisp/mh-e/ChangeLog30
-rw-r--r--lisp/mh-e/mh-comp.el4
-rw-r--r--lisp/mh-e/mh-compat.el40
-rw-r--r--lisp/mh-e/mh-e.el4
-rw-r--r--lisp/mh-e/mh-letter.el2
-rw-r--r--lisp/mh-e/mh-mime.el125
-rw-r--r--lisp/mh-e/mh-show.el15
-rw-r--r--lisp/mh-e/mh-thread.el27
8 files changed, 161 insertions, 86 deletions
diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog
index 94ecfa138fe..75a06d39697 100644
--- a/lisp/mh-e/ChangeLog
+++ b/lisp/mh-e/ChangeLog
@@ -1,3 +1,30 @@
12012-11-25 Bill Wohler <wohler@newt.com>
2
3 * mh-compat.el (mh-define-obsolete-variable-alias)
4 (mh-make-obsolete-variable): New macros to fix XEmacs compiler
5 warnings.
6
7 * mh-letter.el (mh-yank-hooks): Use new mh-make-obsolete-variable
8 macro.
9
10 * mh-e.el (mh-kill-folder-suppress-prompt-hooks): Use
11 new mh-define-obsolete-variable-alias macro.
12
13 * mh-compat.el (mh-cl-flet): New alias for cl-flet on Emacs 24 and
14 flet elsewhere.
15
16 * mh-thread.el (mh-thread-set-tables): Replace flet with new alias
17 mh-cl-flet.
18
19 * mh-show.el (mh-gnus-article-highlight-citation): Replace flet with new alias
20 mh-cl-flet.
21
22 * mh-mime.el (mh-display-with-external-viewer, mh-mime-display)
23 (mh-press-button, mh-push-button, mh-display-emphasis): Replace
24 flet with new alias mh-cl-flet.
25
26 * mh-e.el (mh-invisible-header-fields-internal): Remove trailing whitespace.
27
12012-11-25 Jeffrey C Honig <jch@honig.net> 282012-11-25 Jeffrey C Honig <jch@honig.net>
2 29
3 * mh-comp.el: (mh-edit-again): Use the components file to specify 30 * mh-comp.el: (mh-edit-again): Use the components file to specify
@@ -10,8 +37,7 @@
10 (mh-find-components, mh-send-sub): Move code to locate components 37 (mh-find-components, mh-send-sub): Move code to locate components
11 file into a new function. 38 file into a new function.
12 (mh-insert-auto-fields, mh-modify-header-field): New syntax for 39 (mh-insert-auto-fields, mh-modify-header-field): New syntax for
13 calling mh-regexp-in-field-p. 40 calling mh-regexp-in-field-p (closes SF #1708292).
14 (closes SF #1708292)
15 41
162012-10-23 Stefan Monnier <monnier@iro.umontreal.ca> 422012-10-23 Stefan Monnier <monnier@iro.umontreal.ca>
17 43
diff --git a/lisp/mh-e/mh-comp.el b/lisp/mh-e/mh-comp.el
index d34de619268..3b24afd89ce 100644
--- a/lisp/mh-e/mh-comp.el
+++ b/lisp/mh-e/mh-comp.el
@@ -888,7 +888,7 @@ Optional argument BUFFER can be used to specify the buffer."
888 (t 888 (t
889 (error "Can't find %s in %s or %s" 889 (error "Can't find %s in %s or %s"
890 mh-comp-formfile mh-user-path mh-lib))))) 890 mh-comp-formfile mh-user-path mh-lib)))))
891 891
892(defun mh-send-sub (to cc subject config) 892(defun mh-send-sub (to cc subject config)
893 "Do the real work of composing and sending a letter. 893 "Do the real work of composing and sending a letter.
894Expects the TO, CC, and SUBJECT fields as arguments. 894Expects the TO, CC, and SUBJECT fields as arguments.
@@ -1204,7 +1204,7 @@ discarded."
1204 (setq syntax-table mh-fcc-syntax-table)) 1204 (setq syntax-table mh-fcc-syntax-table))
1205 (t 1205 (t
1206 (setq syntax-table (syntax-table))) 1206 (setq syntax-table (syntax-table)))
1207 ))) 1207 )))
1208 (if (and (mh-goto-header-field field) 1208 (if (and (mh-goto-header-field field)
1209 (set-syntax-table syntax-table) 1209 (set-syntax-table syntax-table)
1210 (re-search-forward 1210 (re-search-forward
diff --git a/lisp/mh-e/mh-compat.el b/lisp/mh-e/mh-compat.el
index 4a93109e7a4..973a5ca5833 100644
--- a/lisp/mh-e/mh-compat.el
+++ b/lisp/mh-e/mh-compat.el
@@ -75,6 +75,12 @@ introduced in Emacs 22."
75 'cancel-timer 75 'cancel-timer
76 'delete-itimer)) 76 'delete-itimer))
77 77
78;; Emacs 24 renamed flet to cl-flet.
79(defalias 'mh-cl-flet
80 (if (fboundp 'cl-flet)
81 'cl-flet
82 'flet))
83
78(defun mh-display-color-cells (&optional display) 84(defun mh-display-color-cells (&optional display)
79 "Return the number of color cells supported by DISPLAY. 85 "Return the number of color cells supported by DISPLAY.
80This function is used by XEmacs to return 2 when `device-color-cells' 86This function is used by XEmacs to return 2 when `device-color-cells'
@@ -242,6 +248,40 @@ This function returns nil on those systems."
242This function returns nil on those systems." 248This function returns nil on those systems."
243 nil) 249 nil)
244 250
251(defmacro mh-define-obsolete-variable-alias
252 (obsolete-name current-name &optional when docstring)
253 "Make OBSOLETE-NAME a variable alias for CURRENT-NAME and mark it obsolete.
254See documentation for `define-obsolete-variable-alias' for a description
255of the arguments OBSOLETE-NAME, CURRENT-NAME, and perhaps WHEN
256and DOCSTRING. This macro is used by XEmacs that lacks WHEN and
257DOCSTRING arguments."
258 (if (featurep 'xemacs)
259 `(define-obsolete-variable-alias ,obsolete-name ,current-name)
260 `(define-obsolete-variable-alias ,obsolete-name ,current-name ,when ,docstring)))
261
262(defmacro mh-make-obsolete-variable (obsolete-name current-name &optional when access-type)
263 "Make the byte-compiler warn that OBSOLETE-NAME is obsolete.
264See documentation for `make-obsolete-variable' for a description
265of the arguments OBSOLETE-NAME, CURRENT-NAME, and perhaps WHEN
266and ACCESS-TYPE. This macro is used by XEmacs that lacks WHEN and
267ACCESS-TYPE arguments."
268 (if (featurep 'xemacs)
269 `(make-obsolete-variable ,obsolete-name ,current-name)
270 `(make-obsolete-variable ,obsolete-name ,current-name ,when ,access-type)))
271
272(defmacro mh-make-obsolete-variable (obsolete-name current-name &optional when access-type)
273 "Make the byte-compiler warn that OBSOLETE-NAME is obsolete.
274See documentation for `make-obsolete-variable' for a description
275of the arguments OBSOLETE-NAME, CURRENT-NAME, and perhaps WHEN
276and ACCESS-TYPE. This macro is used by XEmacs that lacks WHEN and
277ACCESS-TYPE arguments and by Emacs versions that lack ACCESS-TYPE,
278introduced in Emacs 24."
279 (if (featurep 'xemacs)
280 `(make-obsolete-variable ,obsolete-name ,current-name)
281 (if (< emacs-major-version 24)
282 `(make-obsolete-variable ,obsolete-name ,current-name ,when)
283 `(make-obsolete-variable ,obsolete-name ,current-name ,when ,access-type))))
284
245(defun-mh mh-match-string-no-properties 285(defun-mh mh-match-string-no-properties
246 match-string-no-properties (num &optional string) 286 match-string-no-properties (num &optional string)
247 "Return string of text matched by last search, without text properties. 287 "Return string of text matched by last search, without text properties.
diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el
index 94905e7984f..20739ca9d82 100644
--- a/lisp/mh-e/mh-e.el
+++ b/lisp/mh-e/mh-e.el
@@ -2671,7 +2671,7 @@ of citations entirely, choose \"None\"."
2671 "X-MailScanner" ; ListProc(tm) by CREN 2671 "X-MailScanner" ; ListProc(tm) by CREN
2672 "X-Mailutils-Message-Id" ; GNU Mailutils 2672 "X-Mailutils-Message-Id" ; GNU Mailutils
2673 "X-Majordomo:" ; Majordomo mailing list manager 2673 "X-Majordomo:" ; Majordomo mailing list manager
2674 "X-Match:" 2674 "X-Match:"
2675 "X-MaxCode-Template:" ; Paypal http://www.paypal.com 2675 "X-MaxCode-Template:" ; Paypal http://www.paypal.com
2676 "X-MB-Message-" ; AOL WebMail 2676 "X-MB-Message-" ; AOL WebMail
2677 "X-MDaemon-Deliver-To:" 2677 "X-MDaemon-Deliver-To:"
@@ -3276,7 +3276,7 @@ function used to insert the signature with
3276 :group 'mh-letter 3276 :group 'mh-letter
3277 :package-version '(MH-E . "8.0")) 3277 :package-version '(MH-E . "8.0"))
3278 3278
3279(define-obsolete-variable-alias 'mh-kill-folder-suppress-prompt-hooks 3279(mh-define-obsolete-variable-alias 'mh-kill-folder-suppress-prompt-hooks
3280 'mh-kill-folder-suppress-prompt-functions "24.3") 3280 'mh-kill-folder-suppress-prompt-functions "24.3")
3281(defcustom-mh mh-kill-folder-suppress-prompt-functions '(mh-search-p) 3281(defcustom-mh mh-kill-folder-suppress-prompt-functions '(mh-search-p)
3282 "Abnormal hook run at the beginning of \\<mh-folder-mode-map>\\[mh-kill-folder]. 3282 "Abnormal hook run at the beginning of \\<mh-folder-mode-map>\\[mh-kill-folder].
diff --git a/lisp/mh-e/mh-letter.el b/lisp/mh-e/mh-letter.el
index 47554ce66a3..8965439a275 100644
--- a/lisp/mh-e/mh-letter.el
+++ b/lisp/mh-e/mh-letter.el
@@ -68,7 +68,7 @@ citation text as modified.
68 68
69This is a normal hook, misnamed for historical reasons. 69This is a normal hook, misnamed for historical reasons.
70It is obsolete and is only used if `mail-citation-hook' is nil.") 70It is obsolete and is only used if `mail-citation-hook' is nil.")
71(make-obsolete-variable 'mh-yank-hooks 'mail-citation-hook "19.34") 71(mh-make-obsolete-variable 'mh-yank-hooks 'mail-citation-hook "19.34")
72 72
73 73
74 74
diff --git a/lisp/mh-e/mh-mime.el b/lisp/mh-e/mh-mime.el
index 66e1ba5ec69..5ce6159e2d5 100644
--- a/lisp/mh-e/mh-mime.el
+++ b/lisp/mh-e/mh-mime.el
@@ -268,10 +268,12 @@ usually reads the file \"/etc/mailcap\"."
268 (buffer-read-only nil)) 268 (buffer-read-only nil))
269 (when (string-match "^[^% \t]+$" method) 269 (when (string-match "^[^% \t]+$" method)
270 (setq method (concat method " %s"))) 270 (setq method (concat method " %s")))
271 (flet ((mm-handle-set-external-undisplayer (handle function) 271 (mh-cl-flet
272 (mh-handle-set-external-undisplayer folder handle function))) 272 ((mm-handle-set-external-undisplayer
273 (unwind-protect (mm-display-external part method) 273 (handle function)
274 (set-buffer-modified-p nil))))) 274 (mh-handle-set-external-undisplayer folder handle function)))
275 (unwind-protect (mm-display-external part method)
276 (set-buffer-modified-p nil)))))
275 nil)) 277 nil))
276 278
277;;;###mh-autoload 279;;;###mh-autoload
@@ -523,47 +525,48 @@ parsed and then displayed."
523 (let ((handles ()) 525 (let ((handles ())
524 (folder mh-show-folder-buffer) 526 (folder mh-show-folder-buffer)
525 (raw-message-data (buffer-string))) 527 (raw-message-data (buffer-string)))
526 (flet ((mm-handle-set-external-undisplayer 528 (mh-cl-flet
527 (handle function) 529 ((mm-handle-set-external-undisplayer
528 (mh-handle-set-external-undisplayer folder handle function))) 530 (handle function)
529 (goto-char (point-min)) 531 (mh-handle-set-external-undisplayer folder handle function)))
530 (unless (search-forward "\n\n" nil t) 532 (goto-char (point-min))
531 (goto-char (point-max)) 533 (unless (search-forward "\n\n" nil t)
532 (insert "\n\n")) 534 (goto-char (point-max))
533 535 (insert "\n\n"))
534 (condition-case err 536
535 (progn 537 (condition-case err
536 ;; If needed dissect the current buffer 538 (progn
537 (if pre-dissected-handles 539 ;; If needed dissect the current buffer
538 (setq handles pre-dissected-handles) 540 (if pre-dissected-handles
539 (if (setq handles (mm-dissect-buffer nil)) 541 (setq handles pre-dissected-handles)
540 (mh-mm-uu-dissect-text-parts handles) 542 (if (setq handles (mm-dissect-buffer nil))
541 (setq handles (mm-uu-dissect))) 543 (mh-mm-uu-dissect-text-parts handles)
542 (setf (mh-mime-handles (mh-buffer-data)) 544 (setq handles (mm-uu-dissect)))
543 (mh-mm-merge-handles handles 545 (setf (mh-mime-handles (mh-buffer-data))
544 (mh-mime-handles (mh-buffer-data)))) 546 (mh-mm-merge-handles handles
545 (unless handles 547 (mh-mime-handles (mh-buffer-data))))
546 (mh-decode-message-body))) 548 (unless handles
547 549 (mh-decode-message-body)))
548 (cond ((and handles 550
549 (or (not (stringp (car handles))) 551 (cond ((and handles
550 (cdr handles))) 552 (or (not (stringp (car handles)))
551 ;; Go to start of message body 553 (cdr handles)))
552 (goto-char (point-min)) 554 ;; Go to start of message body
553 (or (search-forward "\n\n" nil t) 555 (goto-char (point-min))
554 (goto-char (point-max))) 556 (or (search-forward "\n\n" nil t)
555 557 (goto-char (point-max)))
556 ;; Delete the body 558
557 (delete-region (point) (point-max)) 559 ;; Delete the body
558 560 (delete-region (point) (point-max))
559 ;; Display the MIME handles 561
560 (mh-mime-display-part handles)) 562 ;; Display the MIME handles
561 (t 563 (mh-mime-display-part handles))
562 (mh-signature-highlight)))) 564 (t
563 (error 565 (mh-signature-highlight))))
564 (message "Could not display body: %s" (error-message-string err)) 566 (error
565 (delete-region (point-min) (point-max)) 567 (message "Could not display body: %s" (error-message-string err))
566 (insert raw-message-data)))))) 568 (delete-region (point-min) (point-max))
569 (insert raw-message-data))))))
567 570
568(defun mh-decode-message-body () 571(defun mh-decode-message-body ()
569 "Decode message based on charset. 572 "Decode message based on charset.
@@ -1046,13 +1049,14 @@ attachment, the attachment is hidden."
1046 (function (get-text-property (point) 'mh-callback)) 1049 (function (get-text-property (point) 'mh-callback))
1047 (buffer-read-only nil) 1050 (buffer-read-only nil)
1048 (folder mh-show-folder-buffer)) 1051 (folder mh-show-folder-buffer))
1049 (flet ((mm-handle-set-external-undisplayer 1052 (mh-cl-flet
1050 (handle function) 1053 ((mm-handle-set-external-undisplayer
1051 (mh-handle-set-external-undisplayer folder handle function))) 1054 (handle function)
1052 (when (and function (eolp)) 1055 (mh-handle-set-external-undisplayer folder handle function)))
1053 (backward-char)) 1056 (when (and function (eolp))
1054 (unwind-protect (and function (funcall function data)) 1057 (backward-char))
1055 (set-buffer-modified-p nil))))) 1058 (unwind-protect (and function (funcall function data))
1059 (set-buffer-modified-p nil)))))
1056 1060
1057(defun mh-push-button (event) 1061(defun mh-push-button (event)
1058 "Click MIME button for EVENT. 1062 "Click MIME button for EVENT.
@@ -1066,9 +1070,11 @@ to click the MIME button."
1066 (mm-inline-media-tests mh-mm-inline-media-tests) 1070 (mm-inline-media-tests mh-mm-inline-media-tests)
1067 (data (get-text-property (point) 'mh-data)) 1071 (data (get-text-property (point) 'mh-data))
1068 (function (get-text-property (point) 'mh-callback))) 1072 (function (get-text-property (point) 'mh-callback)))
1069 (flet ((mm-handle-set-external-undisplayer (handle func) 1073 (mh-cl-flet
1070 (mh-handle-set-external-undisplayer folder handle func))) 1074 ((mm-handle-set-external-undisplayer
1071 (and function (funcall function data)))))) 1075 (handle func)
1076 (mh-handle-set-external-undisplayer folder handle func)))
1077 (and function (funcall function data))))))
1072 1078
1073(defun mh-handle-set-external-undisplayer (folder handle function) 1079(defun mh-handle-set-external-undisplayer (folder handle function)
1074 "Replacement for `mm-handle-set-external-undisplayer'. 1080 "Replacement for `mm-handle-set-external-undisplayer'.
@@ -1160,10 +1166,11 @@ this ;-)"
1160(defun mh-display-emphasis () 1166(defun mh-display-emphasis ()
1161 "Display graphical emphasis." 1167 "Display graphical emphasis."
1162 (when (and mh-graphical-emphasis-flag (mh-small-show-buffer-p)) 1168 (when (and mh-graphical-emphasis-flag (mh-small-show-buffer-p))
1163 (flet ((article-goto-body ())) ; shadow this function to do nothing 1169 (mh-cl-flet
1164 (save-excursion 1170 ((article-goto-body ())) ; shadow this function to do nothing
1165 (goto-char (point-min)) 1171 (save-excursion
1166 (article-emphasize))))) 1172 (goto-char (point-min))
1173 (article-emphasize)))))
1167 1174
1168(defun mh-small-show-buffer-p () 1175(defun mh-small-show-buffer-p ()
1169 "Check if show buffer is small. 1176 "Check if show buffer is small.
diff --git a/lisp/mh-e/mh-show.el b/lisp/mh-e/mh-show.el
index ee516f8ede8..4fb9fad0919 100644
--- a/lisp/mh-e/mh-show.el
+++ b/lisp/mh-e/mh-show.el
@@ -899,13 +899,14 @@ See also `mh-folder-mode'.
899 (interactive) 899 (interactive)
900 ;; Don't allow Gnus to create buttons while highlighting, maybe this is bad 900 ;; Don't allow Gnus to create buttons while highlighting, maybe this is bad
901 ;; style? 901 ;; style?
902 (flet ((gnus-article-add-button (&rest args) nil)) 902 (mh-cl-flet
903 (let* ((modified (buffer-modified-p)) 903 ((gnus-article-add-button (&rest args) nil))
904 (gnus-article-buffer (buffer-name)) 904 (let* ((modified (buffer-modified-p))
905 (gnus-cite-face-list `(,@(cdr gnus-cite-face-list) 905 (gnus-article-buffer (buffer-name))
906 ,(car gnus-cite-face-list)))) 906 (gnus-cite-face-list `(,@(cdr gnus-cite-face-list)
907 (gnus-article-highlight-citation t) 907 ,(car gnus-cite-face-list))))
908 (set-buffer-modified-p modified)))) 908 (gnus-article-highlight-citation t)
909 (set-buffer-modified-p modified))))
909 910
910(provide 'mh-show) 911(provide 'mh-show)
911 912
diff --git a/lisp/mh-e/mh-thread.el b/lisp/mh-e/mh-thread.el
index 48c06c3df87..ba2c61f1708 100644
--- a/lisp/mh-e/mh-thread.el
+++ b/lisp/mh-e/mh-thread.el
@@ -645,19 +645,20 @@ Only information about messages in MSG-LIST are added to the tree."
645 645
646(defun mh-thread-set-tables (folder) 646(defun mh-thread-set-tables (folder)
647 "Use the tables of FOLDER in current buffer." 647 "Use the tables of FOLDER in current buffer."
648 (flet ((mh-get-table (symbol) 648 (mh-cl-flet
649 (with-current-buffer folder 649 ((mh-get-table (symbol)
650 (symbol-value symbol)))) 650 (with-current-buffer folder
651 (setq mh-thread-id-hash (mh-get-table 'mh-thread-id-hash)) 651 (symbol-value symbol))))
652 (setq mh-thread-subject-hash (mh-get-table 'mh-thread-subject-hash)) 652 (setq mh-thread-id-hash (mh-get-table 'mh-thread-id-hash))
653 (setq mh-thread-id-table (mh-get-table 'mh-thread-id-table)) 653 (setq mh-thread-subject-hash (mh-get-table 'mh-thread-subject-hash))
654 (setq mh-thread-id-index-map (mh-get-table 'mh-thread-id-index-map)) 654 (setq mh-thread-id-table (mh-get-table 'mh-thread-id-table))
655 (setq mh-thread-index-id-map (mh-get-table 'mh-thread-index-id-map)) 655 (setq mh-thread-id-index-map (mh-get-table 'mh-thread-id-index-map))
656 (setq mh-thread-scan-line-map (mh-get-table 'mh-thread-scan-line-map)) 656 (setq mh-thread-index-id-map (mh-get-table 'mh-thread-index-id-map))
657 (setq mh-thread-subject-container-hash 657 (setq mh-thread-scan-line-map (mh-get-table 'mh-thread-scan-line-map))
658 (mh-get-table 'mh-thread-subject-container-hash)) 658 (setq mh-thread-subject-container-hash
659 (setq mh-thread-duplicates (mh-get-table 'mh-thread-duplicates)) 659 (mh-get-table 'mh-thread-subject-container-hash))
660 (setq mh-thread-history (mh-get-table 'mh-thread-history)))) 660 (setq mh-thread-duplicates (mh-get-table 'mh-thread-duplicates))
661 (setq mh-thread-history (mh-get-table 'mh-thread-history))))
661 662
662(defun mh-thread-process-in-reply-to (reply-to-header) 663(defun mh-thread-process-in-reply-to (reply-to-header)
663 "Extract message id's from REPLY-TO-HEADER. 664 "Extract message id's from REPLY-TO-HEADER.