diff options
Diffstat (limited to 'lisp/mh-e')
| -rw-r--r-- | lisp/mh-e/ChangeLog | 39 | ||||
| -rw-r--r-- | lisp/mh-e/mh-comp.el | 26 | ||||
| -rw-r--r-- | lisp/mh-e/mh-compat.el | 80 | ||||
| -rw-r--r-- | lisp/mh-e/mh-e.el | 31 | ||||
| -rw-r--r-- | lisp/mh-e/mh-folder.el | 5 | ||||
| -rw-r--r-- | lisp/mh-e/mh-letter.el | 8 | ||||
| -rw-r--r-- | lisp/mh-e/mh-utils.el | 7 |
7 files changed, 130 insertions, 66 deletions
diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog index ecdf207d252..7a6cf778bbe 100644 --- a/lisp/mh-e/ChangeLog +++ b/lisp/mh-e/ChangeLog | |||
| @@ -1,3 +1,42 @@ | |||
| 1 | 2006-03-19 Bill Wohler <wohler@newt.com> | ||
| 2 | |||
| 3 | * mh-comp.el (mh-reply): Sync docstring with manual. | ||
| 4 | |||
| 5 | * mh-compat.el (mh-image-load-path-for-library): Shorten first line in | ||
| 6 | docstring. | ||
| 7 | |||
| 8 | 2006-03-17 Bill Wohler <wohler@newt.com> | ||
| 9 | |||
| 10 | * mh-compat.el (mh-image-load-path-for-library): Minor docstring | ||
| 11 | fix. | ||
| 12 | |||
| 13 | 2006-03-16 Bill Wohler <wohler@newt.com> | ||
| 14 | |||
| 15 | * mh-comp.el (mh-send-letter): Use split-string to break up | ||
| 16 | mh-send-args (closes SF #1448604). | ||
| 17 | (mh-compose-and-send-mail): Use run-hook-with-args for | ||
| 18 | mh-compose-letter-function. | ||
| 19 | |||
| 20 | * mh-e.el (mh-list-to-string-1): Use dolist. | ||
| 21 | |||
| 22 | * mh-compat.el (mh-image-load-path-for-library): Prefer user's | ||
| 23 | images. | ||
| 24 | |||
| 25 | 2006-03-15 Bill Wohler <wohler@newt.com> | ||
| 26 | |||
| 27 | * mh-compat.el (mh-image-load-path-for-library): Fix example by | ||
| 28 | not recommending that one binds image-load-path. Just defvar it to | ||
| 29 | placate compiler and only use it if previously defined. | ||
| 30 | |||
| 31 | * mh-e.el (image-load-path): Don't bind! | ||
| 32 | |||
| 33 | * mh-folder.el (mh-folder-mode): Only use image-load-path if | ||
| 34 | previously defined. | ||
| 35 | |||
| 36 | * mh-letter.el (mh-letter-mode): Ditto. | ||
| 37 | |||
| 38 | * mh-utils.el (mh-logo-display): Ditto. | ||
| 39 | |||
| 1 | 2006-03-14 Bill Wohler <wohler@newt.com> | 40 | 2006-03-14 Bill Wohler <wohler@newt.com> |
| 2 | 41 | ||
| 3 | * mh-compat.el (mh-image-load-path-for-library): Incorporate | 42 | * mh-compat.el (mh-image-load-path-for-library): Incorporate |
diff --git a/lisp/mh-e/mh-comp.el b/lisp/mh-e/mh-comp.el index 0cedc83719c..27806dc9ab9 100644 --- a/lisp/mh-e/mh-comp.el +++ b/lisp/mh-e/mh-comp.el | |||
| @@ -287,7 +287,7 @@ use `mh-send-prog' to tell MH-E the name." | |||
| 287 | (set-buffer draft-buffer)) ; for annotation below | 287 | (set-buffer draft-buffer)) ; for annotation below |
| 288 | (t | 288 | (t |
| 289 | (mh-exec-cmd-daemon mh-send-prog nil "-nodraftfolder" "-noverbose" | 289 | (mh-exec-cmd-daemon mh-send-prog nil "-nodraftfolder" "-noverbose" |
| 290 | mh-send-args file-name))) | 290 | (split-string mh-send-args) file-name))) |
| 291 | (if mh-annotate-char | 291 | (if mh-annotate-char |
| 292 | (mh-annotate-msg mh-sent-from-msg | 292 | (mh-annotate-msg mh-sent-from-msg |
| 293 | mh-sent-from-folder | 293 | mh-sent-from-folder |
| @@ -580,14 +580,16 @@ You have several choices here. | |||
| 580 | 580 | ||
| 581 | Response Reply Goes To | 581 | Response Reply Goes To |
| 582 | 582 | ||
| 583 | from The person who sent the message. This is the | 583 | from The person who sent the message. This is the |
| 584 | default, so <RET> is sufficient. | 584 | default, so <RET> is sufficient. |
| 585 | 585 | ||
| 586 | to Replies to the sender, plus all recipients in the | 586 | to Replies to the sender, plus all recipients in the |
| 587 | \"To:\" header field. | 587 | \"To:\" header field. |
| 588 | 588 | ||
| 589 | all | 589 | all cc Forms a reply to the addresses in the |
| 590 | cc Forms a reply to the sender, plus all recipients. | 590 | \"Mail-Followup-To:\" header field if one |
| 591 | exists; otherwise forms a reply to the sender, | ||
| 592 | plus all recipients. | ||
| 591 | 593 | ||
| 592 | Depending on your answer, \"repl\" is given a different argument | 594 | Depending on your answer, \"repl\" is given a different argument |
| 593 | to form your reply. Specifically, a choice of \"from\" or none at | 595 | to form your reply. Specifically, a choice of \"from\" or none at |
| @@ -597,7 +599,11 @@ all runs \"repl -nocc all\", and a choice of \"to\" runs \"repl | |||
| 597 | 599 | ||
| 598 | Two windows are then created. One window contains the message to | 600 | Two windows are then created. One window contains the message to |
| 599 | which you are replying in an MH-Show buffer. Your draft, in | 601 | which you are replying in an MH-Show buffer. Your draft, in |
| 600 | MH-Letter mode (see `mh-letter-mode'), is in the other window. | 602 | MH-Letter mode (*note `mh-letter-mode'), is in the other window. |
| 603 | If the reply draft was not one that you expected, check the | ||
| 604 | things that affect the behavior of \"repl\" which include the | ||
| 605 | \"repl:\" profile component and the \"replcomps\" and | ||
| 606 | \"replgroupcomps\" files. | ||
| 601 | 607 | ||
| 602 | If you supply a prefix argument INCLUDEP, the message you are | 608 | If you supply a prefix argument INCLUDEP, the message you are |
| 603 | replying to is inserted in your reply after having first been run | 609 | replying to is inserted in your reply after having first been run |
| @@ -895,15 +901,7 @@ letter." | |||
| 895 | (mh-logo-display) | 901 | (mh-logo-display) |
| 896 | (mh-make-local-hook 'kill-buffer-hook) | 902 | (mh-make-local-hook 'kill-buffer-hook) |
| 897 | (add-hook 'kill-buffer-hook 'mh-tidy-draft-buffer nil t) | 903 | (add-hook 'kill-buffer-hook 'mh-tidy-draft-buffer nil t) |
| 898 | (if (and (boundp 'mh-compose-letter-function) | 904 | (run-hook-with-args 'mh-compose-letter-function to subject cc)) |
| 899 | mh-compose-letter-function) | ||
| 900 | ;; run-hooks will not pass arguments. | ||
| 901 | (let ((value mh-compose-letter-function)) | ||
| 902 | (if (and (listp value) (not (eq (car value) 'lambda))) | ||
| 903 | (while value | ||
| 904 | (funcall (car value) to subject cc) | ||
| 905 | (setq value (cdr value))) | ||
| 906 | (funcall mh-compose-letter-function to subject cc))))) | ||
| 907 | 905 | ||
| 908 | (defun mh-insert-x-mailer () | 906 | (defun mh-insert-x-mailer () |
| 909 | "Append an X-Mailer field to the header. | 907 | "Append an X-Mailer field to the header. |
diff --git a/lisp/mh-e/mh-compat.el b/lisp/mh-e/mh-compat.el index 50542d67f4e..256a8cfe831 100644 --- a/lisp/mh-e/mh-compat.el +++ b/lisp/mh-e/mh-compat.el | |||
| @@ -117,12 +117,13 @@ introduced in Emacs 22." | |||
| 117 | 117 | ||
| 118 | (mh-defun-compat mh-image-load-path-for-library | 118 | (mh-defun-compat mh-image-load-path-for-library |
| 119 | image-load-path-for-library (library image &optional path no-error) | 119 | image-load-path-for-library (library image &optional path no-error) |
| 120 | "Return a suitable search path for images relative to LIBRARY. | 120 | "Return a suitable search path for images used by LIBRARY. |
| 121 | 121 | ||
| 122 | First it searches for IMAGE in a path suitable for LIBRARY, which | 122 | It searches for IMAGE in `image-load-path' (excluding |
| 123 | includes \"../../etc/images\" and \"../etc/images\" relative to | 123 | \"`data-directory'/images\") and `load-path', followed by a path |
| 124 | the library file itself, followed by `image-load-path' and | 124 | suitable for LIBRARY, which includes \"../../etc/images\" and |
| 125 | `load-path'. | 125 | \"../etc/images\" relative to the library file itself, and then |
| 126 | in \"`data-directory'/images\". | ||
| 126 | 127 | ||
| 127 | Then this function returns a list of directories which contains | 128 | Then this function returns a list of directories which contains |
| 128 | first the directory in which IMAGE was found, followed by the | 129 | first the directory in which IMAGE was found, followed by the |
| @@ -137,16 +138,46 @@ Here is an example that uses a common idiom to provide | |||
| 137 | compatibility with versions of Emacs that lack the variable | 138 | compatibility with versions of Emacs that lack the variable |
| 138 | `image-load-path': | 139 | `image-load-path': |
| 139 | 140 | ||
| 140 | ;; Avoid errors on Emacsen without `image-load-path'. | 141 | ;; Shush compiler. |
| 141 | (if (not (boundp 'image-load-path)) (defvar image-load-path nil)) | 142 | (defvar image-load-path) |
| 142 | 143 | ||
| 143 | (let* ((load-path (image-load-path-for-library \"mh-e\" \"mh-logo.xpm\")) | 144 | (let* ((load-path (image-load-path-for-library \"mh-e\" \"mh-logo.xpm\")) |
| 144 | (image-load-path (cons (car load-path) image-load-path))) | 145 | (image-load-path (cons (car load-path) |
| 146 | (when (boundp 'image-load-path) | ||
| 147 | image-load-path)))) | ||
| 145 | (mh-tool-bar-folder-buttons-init))" | 148 | (mh-tool-bar-folder-buttons-init))" |
| 146 | (unless library (error "No library specified")) | 149 | (unless library (error "No library specified")) |
| 147 | (unless image (error "No image specified")) | 150 | (unless image (error "No image specified")) |
| 148 | (let ((image-directory)) | 151 | (let (image-directory image-directory-load-path) |
| 152 | ;; Check for images in image-load-path or load-path. | ||
| 153 | (let ((img image) | ||
| 154 | (dir (or | ||
| 155 | ;; Images in image-load-path. | ||
| 156 | (mh-image-search-load-path image) | ||
| 157 | ;; Images in load-path. | ||
| 158 | (locate-library image))) | ||
| 159 | parent) | ||
| 160 | ;; Since the image might be in a nested directory (for | ||
| 161 | ;; example, mail/attach.pbm), adjust `image-directory' | ||
| 162 | ;; accordingly. | ||
| 163 | (when dir | ||
| 164 | (setq dir (file-name-directory dir)) | ||
| 165 | (while (setq parent (file-name-directory img)) | ||
| 166 | (setq img (directory-file-name parent) | ||
| 167 | dir (expand-file-name "../" dir)))) | ||
| 168 | (setq image-directory-load-path dir)) | ||
| 169 | |||
| 170 | ;; If `image-directory-load-path' isn't Emacs' image directory, | ||
| 171 | ;; it's probably a user preference, so use it. Then use a | ||
| 172 | ;; relative setting if possible; otherwise, use | ||
| 173 | ;; `image-directory-load-path'. | ||
| 149 | (cond | 174 | (cond |
| 175 | ;; User-modified image-load-path? | ||
| 176 | ((and image-directory-load-path | ||
| 177 | (not (equal image-directory-load-path | ||
| 178 | (file-name-as-directory | ||
| 179 | (expand-file-name "images" data-directory))))) | ||
| 180 | (setq image-directory image-directory-load-path)) | ||
| 150 | ;; Try relative setting. | 181 | ;; Try relative setting. |
| 151 | ((let (library-name d1ei d2ei) | 182 | ((let (library-name d1ei d2ei) |
| 152 | ;; First, find library in the load-path. | 183 | ;; First, find library in the load-path. |
| @@ -156,33 +187,20 @@ compatibility with versions of Emacs that lack the variable | |||
| 156 | ;; And then set image-directory relative to that. | 187 | ;; And then set image-directory relative to that. |
| 157 | (setq | 188 | (setq |
| 158 | ;; Go down 2 levels. | 189 | ;; Go down 2 levels. |
| 159 | d2ei (expand-file-name | 190 | d2ei (file-name-as-directory |
| 160 | (concat (file-name-directory library-name) "../../etc/images")) | 191 | (expand-file-name |
| 192 | (concat (file-name-directory library-name) "../../etc/images"))) | ||
| 161 | ;; Go down 1 level. | 193 | ;; Go down 1 level. |
| 162 | d1ei (expand-file-name | 194 | d1ei (file-name-as-directory |
| 163 | (concat (file-name-directory library-name) "../etc/images"))) | 195 | (expand-file-name |
| 196 | (concat (file-name-directory library-name) "../etc/images")))) | ||
| 164 | (setq image-directory | 197 | (setq image-directory |
| 165 | ;; Set it to nil if image is not found. | 198 | ;; Set it to nil if image is not found. |
| 166 | (cond ((file-exists-p (expand-file-name image d2ei)) d2ei) | 199 | (cond ((file-exists-p (expand-file-name image d2ei)) d2ei) |
| 167 | ((file-exists-p (expand-file-name image d1ei)) d1ei))))) | 200 | ((file-exists-p (expand-file-name image d1ei)) d1ei))))) |
| 168 | ;; Check for images in image-load-path or load-path. | 201 | ;; Use Emacs' image directory. |
| 169 | ((let ((img image) | 202 | (image-directory-load-path |
| 170 | (dir (or | 203 | (setq image-directory image-directory-load-path)) |
| 171 | ;; Images in image-load-path. | ||
| 172 | (mh-image-search-load-path image) | ||
| 173 | ;; Images in load-path. | ||
| 174 | (locate-library image))) | ||
| 175 | parent) | ||
| 176 | ;; Since the image might be in a nested directory (for | ||
| 177 | ;; example, mail/attach.pbm), adjust `image-directory' | ||
| 178 | ;; accordingly. | ||
| 179 | (and dir | ||
| 180 | (setq dir (file-name-directory dir)) | ||
| 181 | (progn | ||
| 182 | (while (setq parent (file-name-directory img)) | ||
| 183 | (setq img (directory-file-name parent) | ||
| 184 | dir (expand-file-name "../" dir))) | ||
| 185 | (setq image-directory dir))))) | ||
| 186 | (no-error | 204 | (no-error |
| 187 | (message "Could not find image %s for library %s" image library)) | 205 | (message "Could not find image %s for library %s" image library)) |
| 188 | (t | 206 | (t |
diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el index 2f29a678f13..84e569bab81 100644 --- a/lisp/mh-e/mh-e.el +++ b/lisp/mh-e/mh-e.el | |||
| @@ -325,9 +325,6 @@ Name of the Previous sequence.") | |||
| 325 | 325 | ||
| 326 | ;; Etc. (alphabetical) | 326 | ;; Etc. (alphabetical) |
| 327 | 327 | ||
| 328 | ;; Avoid errors on Emacsen without image-load-path. | ||
| 329 | (if (not (boundp 'image-load-path)) (defvar image-load-path nil)) | ||
| 330 | |||
| 331 | (defvar mh-flists-present-flag nil | 328 | (defvar mh-flists-present-flag nil |
| 332 | "Non-nil means that we have \"flists\".") | 329 | "Non-nil means that we have \"flists\".") |
| 333 | 330 | ||
| @@ -430,20 +427,20 @@ gnus-version) | |||
| 430 | 427 | ||
| 431 | (defun mh-list-to-string-1 (l) | 428 | (defun mh-list-to-string-1 (l) |
| 432 | "Flatten the list L and make every element of the new list into a string." | 429 | "Flatten the list L and make every element of the new list into a string." |
| 433 | (let ((new-list nil)) | 430 | (let (new-list) |
| 434 | (while l | 431 | (dolist (element l) |
| 435 | (cond ((null (car l))) | 432 | (cond ((null element)) |
| 436 | ((symbolp (car l)) | 433 | ((symbolp element) |
| 437 | (setq new-list (cons (symbol-name (car l)) new-list))) | 434 | (push (symbol-name element) new-list)) |
| 438 | ((numberp (car l)) | 435 | ((numberp element) |
| 439 | (setq new-list (cons (int-to-string (car l)) new-list))) | 436 | (push (int-to-string element) new-list)) |
| 440 | ((equal (car l) "")) | 437 | ((equal element "")) |
| 441 | ((stringp (car l)) (setq new-list (cons (car l) new-list))) | 438 | ((stringp element) |
| 442 | ((listp (car l)) | 439 | (push element new-list)) |
| 443 | (setq new-list (nconc (mh-list-to-string-1 (car l)) | 440 | ((listp element) |
| 444 | new-list))) | 441 | (setq new-list (nconc (mh-list-to-string-1 element) new-list))) |
| 445 | (t (error "Bad element in `mh-list-to-string': %s" (car l)))) | 442 | (t |
| 446 | (setq l (cdr l))) | 443 | (error "Bad element: %s" element)))) |
| 447 | new-list)) | 444 | new-list)) |
| 448 | 445 | ||
| 449 | 446 | ||
diff --git a/lisp/mh-e/mh-folder.el b/lisp/mh-e/mh-folder.el index 2c32d1433f1..b1b8c7d859c 100644 --- a/lisp/mh-e/mh-folder.el +++ b/lisp/mh-e/mh-folder.el | |||
| @@ -525,6 +525,7 @@ font-lock is done highlighting.") | |||
| 525 | (eval-when-compile | 525 | (eval-when-compile |
| 526 | (defvar desktop-save-buffer) | 526 | (defvar desktop-save-buffer) |
| 527 | (defvar font-lock-auto-fontify) | 527 | (defvar font-lock-auto-fontify) |
| 528 | (defvar image-load-path) | ||
| 528 | (mh-do-in-xemacs (defvar font-lock-defaults))) | 529 | (mh-do-in-xemacs (defvar font-lock-defaults))) |
| 529 | 530 | ||
| 530 | (defvar mh-folder-buttons-init-flag nil) | 531 | (defvar mh-folder-buttons-init-flag nil) |
| @@ -592,7 +593,9 @@ perform the operation on all messages in that region. | |||
| 592 | (mh-do-in-gnu-emacs | 593 | (mh-do-in-gnu-emacs |
| 593 | (unless mh-folder-buttons-init-flag | 594 | (unless mh-folder-buttons-init-flag |
| 594 | (let* ((load-path (mh-image-load-path-for-library "mh-e" "mh-logo.xpm")) | 595 | (let* ((load-path (mh-image-load-path-for-library "mh-e" "mh-logo.xpm")) |
| 595 | (image-load-path (cons (car load-path) image-load-path))) | 596 | (image-load-path (cons (car load-path) |
| 597 | (when (boundp 'image-load-path) | ||
| 598 | image-load-path)))) | ||
| 596 | (mh-tool-bar-folder-buttons-init) | 599 | (mh-tool-bar-folder-buttons-init) |
| 597 | (setq mh-folder-buttons-init-flag t))) | 600 | (setq mh-folder-buttons-init-flag t))) |
| 598 | (set (make-local-variable 'tool-bar-map) mh-folder-tool-bar-map)) | 601 | (set (make-local-variable 'tool-bar-map) mh-folder-tool-bar-map)) |
diff --git a/lisp/mh-e/mh-letter.el b/lisp/mh-e/mh-letter.el index a7290cf5ae9..024c1875eac 100644 --- a/lisp/mh-e/mh-letter.el +++ b/lisp/mh-e/mh-letter.el | |||
| @@ -278,7 +278,9 @@ searching for `mh-mail-header-separator' in the buffer." | |||
| 278 | (defvar mh-letter-buttons-init-flag nil) | 278 | (defvar mh-letter-buttons-init-flag nil) |
| 279 | 279 | ||
| 280 | ;; Shush compiler. | 280 | ;; Shush compiler. |
| 281 | (eval-when-compile (mh-do-in-xemacs (defvar font-lock-defaults))) | 281 | (eval-when-compile |
| 282 | (defvar image-load-path) | ||
| 283 | (mh-do-in-xemacs (defvar font-lock-defaults))) | ||
| 282 | 284 | ||
| 283 | ;; Ensure new buffers won't get this mode if default-major-mode is nil. | 285 | ;; Ensure new buffers won't get this mode if default-major-mode is nil. |
| 284 | (put 'mh-letter-mode 'mode-class 'special) | 286 | (put 'mh-letter-mode 'mode-class 'special) |
| @@ -314,7 +316,9 @@ order). | |||
| 314 | (mh-do-in-gnu-emacs | 316 | (mh-do-in-gnu-emacs |
| 315 | (unless mh-letter-buttons-init-flag | 317 | (unless mh-letter-buttons-init-flag |
| 316 | (let* ((load-path (mh-image-load-path-for-library "mh-e" "mh-logo.xpm")) | 318 | (let* ((load-path (mh-image-load-path-for-library "mh-e" "mh-logo.xpm")) |
| 317 | (image-load-path (cons (car load-path) image-load-path))) | 319 | (image-load-path (cons (car load-path) |
| 320 | (when (boundp 'image-load-path) | ||
| 321 | image-load-path)))) | ||
| 318 | (mh-tool-bar-letter-buttons-init) | 322 | (mh-tool-bar-letter-buttons-init) |
| 319 | (setq mh-letter-buttons-init-flag t))) | 323 | (setq mh-letter-buttons-init-flag t))) |
| 320 | (set (make-local-variable 'tool-bar-map) mh-letter-tool-bar-map)) | 324 | (set (make-local-variable 'tool-bar-map) mh-letter-tool-bar-map)) |
diff --git a/lisp/mh-e/mh-utils.el b/lisp/mh-e/mh-utils.el index 44e15f3cb19..e41ee0bcc4f 100644 --- a/lisp/mh-e/mh-utils.el +++ b/lisp/mh-e/mh-utils.el | |||
| @@ -127,12 +127,17 @@ Ignores case when searching for OLD." | |||
| 127 | 127 | ||
| 128 | (defvar mh-logo-cache nil) | 128 | (defvar mh-logo-cache nil) |
| 129 | 129 | ||
| 130 | ;; Shush compiler. | ||
| 131 | (defvar image-load-path) | ||
| 132 | |||
| 130 | ;;;###mh-autoload | 133 | ;;;###mh-autoload |
| 131 | (defun mh-logo-display () | 134 | (defun mh-logo-display () |
| 132 | "Modify mode line to display MH-E logo." | 135 | "Modify mode line to display MH-E logo." |
| 133 | (mh-do-in-gnu-emacs | 136 | (mh-do-in-gnu-emacs |
| 134 | (let* ((load-path (mh-image-load-path-for-library "mh-e" "mh-logo.xpm")) | 137 | (let* ((load-path (mh-image-load-path-for-library "mh-e" "mh-logo.xpm")) |
| 135 | (image-load-path (cons (car load-path) image-load-path))) | 138 | (image-load-path (cons (car load-path) |
| 139 | (when (boundp 'image-load-path) | ||
| 140 | image-load-path)))) | ||
| 136 | (add-text-properties | 141 | (add-text-properties |
| 137 | 0 2 | 142 | 0 2 |
| 138 | `(display ,(or mh-logo-cache | 143 | `(display ,(or mh-logo-cache |