;;; mh-folder.el --- MH-Folder mode
-;; Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2003, 2005-2012 Free Software Foundation, Inc.
;; Author: Bill Wohler <wohler@newt.com>
;; Maintainer: Bill Wohler <wohler@newt.com>
;; This file is part of GNU Emacs.
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;; Desktop Integration
;; desktop-buffer-mode-handlers appeared in Emacs 22.
-(if (fboundp 'desktop-buffer-mode-handlers)
+(if (boundp 'desktop-buffer-mode-handlers)
(add-to-list 'desktop-buffer-mode-handlers
'(mh-folder-mode . mh-restore-desktop-buffer)))
(?/ "Limit to [c]c, ran[g]e, fro[m], [s]ubject, [t]o; [w]iden")
(?X "un[s]har, [u]udecode message")
(?D "[b]urst digest")
- (?K "[v]iew, [i]nline, [o]utput/save MIME part; save [a]ll parts; \n"
- "[TAB] next; [SHIFT-TAB] previous")
+ (?K "[v]iew, [i]nline, with [e]xternal viewer; \n"
+ "[o]utput/save MIME part; save [a]ll parts; \n"
+ "[t]oggle buttons; [TAB] next; [SHIFT-TAB] previous")
(?J "[b]lacklist, [w]hitelist message"))
"Key binding cheat sheet.
See `mh-set-help'.")
;; Shush compiler.
(defvar desktop-save-buffer)
(defvar font-lock-auto-fontify)
-(defvar font-lock-defaults) ; XEmacs
+(mh-do-in-xemacs
+ (defvar font-lock-defaults))
-;; Ensure new buffers won't get this mode if default-major-mode is nil.
+;; Ensure new buffers won't get this mode if default major-mode is nil.
(put 'mh-folder-mode 'mode-class 'special)
;; Autoload cookie needed by desktop.el
(mh-do-in-gnu-emacs
(unless mh-folder-tool-bar-map
(mh-tool-bar-folder-buttons-init))
- (set (make-local-variable 'tool-bar-map) mh-folder-tool-bar-map))
+ (if (boundp 'tool-bar-map)
+ (set (make-local-variable 'tool-bar-map) mh-folder-tool-bar-map)))
(mh-do-in-xemacs
(mh-tool-bar-init :folder))
(make-local-variable 'font-lock-defaults)
;; Invalidate the show buffer if it is showing the same message that is
;; to be edited.
(when (and (buffer-live-p (get-buffer mh-show-buffer))
- (equal (save-excursion (set-buffer mh-show-buffer)
- buffer-file-name)
+ (equal (with-current-buffer mh-show-buffer
+ buffer-file-name)
msg-filename))
(mh-invalidate-show-buffer))
(current-buffer (current-buffer))
(threaded-view-flag mh-show-threads-flag))
(delete-other-windows)
- (save-excursion
- (when (get-buffer folder)
- (set-buffer folder)
+ (when (get-buffer folder)
+ (with-current-buffer folder
(setq threaded-view-flag (memq 'unthread mh-view-ops))))
(when index-data
(mh-make-folder folder)
(output-file (mh-expand-file-name file)))
(setq mh-last-destination (list 'write file (if no-header 'no-header))
mh-last-destination-write mh-last-destination)
- (save-excursion
- (set-buffer (get-buffer-create mh-temp-buffer))
+ (with-current-buffer (get-buffer-create mh-temp-buffer)
(erase-buffer)
(insert-file-contents msg-file-to-output)
(goto-char (point-min))
(goto-char scan-start)
(cond ((looking-at "scan: no messages in")
(keep-lines mh-scan-valid-regexp)) ; Flush random scan lines
- ((looking-at (if (mh-variant-p 'mu-mh)
+ ((looking-at (if (mh-variant-p 'gnu-mh)
"scan: message set .* does not exist"
"scan: bad message list "))
(keep-lines mh-scan-valid-regexp))
"Destination"
(let ((refile-file (ignore-errors (mh-msg-filename (mh-get-msg-num t)))))
(if (null refile-file) ""
- (save-excursion
- (set-buffer (get-buffer-create mh-temp-buffer))
+ (with-current-buffer (get-buffer-create mh-temp-buffer)
(erase-buffer)
(insert-file-contents refile-file)
(or (and mh-default-folder-for-message-function
;; sentence-end-double-space: nil
;; End:
-;; arch-tag: aa97b758-d4f6-4c86-bc5a-1950921da1e7
;;; mh-folder.el ends here