nnimap.el (nnimap-open-connection): Look for the "imaps" entry in the .authinfo if...
[bpt/emacs.git] / lisp / mh-e / mh-letter.el
index 615736a..03ef7b6 100644 (file)
@@ -1,7 +1,8 @@
 ;;; mh-letter.el --- MH-Letter mode
 
 ;; Copyright (C) 1993, 1995, 1997,
-;;  2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+;;   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+;;   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 2, 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
@@ -21,9 +22,7 @@
 ;; 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:
 
@@ -278,7 +277,7 @@ searching for `mh-mail-header-separator' in the buffer."
 ;; Shush compiler.
 (defvar font-lock-defaults)             ; XEmacs
 
-;; 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-letter-mode 'mode-class 'special)
 
 ;;;###mh-autoload
@@ -312,7 +311,8 @@ order).
   (mh-do-in-gnu-emacs
     (unless mh-letter-tool-bar-map
       (mh-tool-bar-letter-buttons-init))
-    (set (make-local-variable 'tool-bar-map) mh-letter-tool-bar-map))
+    (if (boundp 'tool-bar-map)
+        (set (make-local-variable 'tool-bar-map) mh-letter-tool-bar-map)))
   (mh-do-in-xemacs
     (mh-tool-bar-init :letter))
   ;; Set the local value of mh-mail-header-separator according to what is
@@ -618,7 +618,7 @@ a copy of the draft."
                                   mh-default-folder-for-message-function)))
                           "")
                       t)))
-  (let ((last-input-char ?\C-f))
+  (let ((last-input-event ?\C-f))
     (expand-abbrev)
     (save-excursion
       (mh-to-field)
@@ -648,10 +648,10 @@ Create the field if it does not exist.
 Set the mark to point before moving."
   (interactive)
   (expand-abbrev)
-  (let ((target (cdr (or (assoc (char-to-string (logior last-input-char ?`))
+  (let ((target (cdr (or (assoc (char-to-string (logior last-input-event ?`))
                                 mh-to-field-choices)
                          ;; also look for a char for version 4 compat
-                         (assoc (logior last-input-char ?`)
+                         (assoc (logior last-input-event ?`)
                                 mh-to-field-choices))))
         (case-fold-search t))
     (push-mark)
@@ -659,7 +659,7 @@ Set the mark to point before moving."
            (let ((eol (point)))
              (skip-chars-backward " \t")
              (delete-region (point) eol))
-           (if (and (not (eq (logior last-input-char ?`) ?s))
+           (if (and (not (eq (logior last-input-event ?`) ?s))
                     (save-excursion
                       (backward-char 1)
                       (not (looking-at "[:,]"))))
@@ -706,9 +706,9 @@ the supercite flavors, the hook `mail-citation-hook' is ignored
 and `mh-ins-buf-prefix' is not inserted."
   (interactive)
   (if (and mh-sent-from-folder
-           (save-excursion (set-buffer mh-sent-from-folder) mh-show-buffer)
-           (save-excursion (set-buffer mh-sent-from-folder)
-                           (get-buffer mh-show-buffer))
+           (with-current-buffer mh-sent-from-folder mh-show-buffer)
+           (with-current-buffer mh-sent-from-folder
+             (get-buffer mh-show-buffer))
            mh-sent-from-msg)
       (let ((to-point (point))
             (to-buffer (current-buffer)))
@@ -844,7 +844,7 @@ body."
 (defun mh-position-on-field (field &optional ignored)
   "Move to the end of the FIELD in the header.
 Move to end of entire header if FIELD not found.
-Returns non-nil iff FIELD was found.
+Returns non-nil if FIELD was found.
 The optional second arg is for pre-version 4 compatibility and is
 IGNORED."
   (cond ((mh-goto-header-field field)
@@ -876,7 +876,7 @@ downcasing the field name."
 
 ;;;###mh-autoload
 (defun mh-complete-word (word choices begin end)
-  "Complete WORD at from CHOICES.
+  "Complete WORD from CHOICES.
 Any match found replaces the text from BEGIN to END."
   (let ((completion (try-completion word choices))
         (completions-buffer "*Completions*"))