]> code.delx.au - gnu-emacs/blobdiff - lisp/mail/mailabbrev.el
(mail-yank-original): Set buffer-file-coding-system from the one used
[gnu-emacs] / lisp / mail / mailabbrev.el
index 4eb4d9eb93607a970288fbbe3dfb1204ad83dba8..b0d77217dcbea67e206f214f0049ed84a8d00ae3 100644 (file)
@@ -1,7 +1,8 @@
 ;;; mailabbrev.el --- abbrev-expansion of mail aliases
 
 ;; Copyright (C) 1985, 1986, 1987, 1992, 1993, 1996, 1997, 2000, 2001,
-;;   2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+;;   2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+;;   Free Software Foundation, Inc.
 
 ;; Author: Jamie Zawinski <jwz@lucid.com; now jwz@jwz.org>
 ;; Maintainer: FSF
@@ -500,12 +501,12 @@ of a mail alias.  The value is set up, buffer-local, when first needed.")
             ;; when the user types -.)  Check the character's syntax in
             ;; the usual syntax table.
 
-            (or (and (integerp last-command-char)
+            (or (and (integerp last-command-event)
                      ;; Some commands such as M-> may want to expand first.
                      (equal this-command 'self-insert-command)
-                     (or (eq (char-syntax last-command-char) ?_)
+                     (or (eq (char-syntax last-command-event) ?_)
                          ;; Don't expand on @.
-                         (memq last-command-char '(?@ ?. ?% ?! ?_ ?-))))
+                         (memq last-command-event '(?@ ?. ?% ?! ?_ ?-))))
                 ;; Use this table so that abbrevs can have hyphens in them.
                 (with-syntax-table mail-abbrev-syntax-table
                   (funcall expand))))
@@ -591,39 +592,26 @@ of a mail alias.  The value is set up, buffer-local, when first needed.")
                alias))))))
 
 (defun mail-abbrev-next-line (&optional arg)
-  "Expand any mail abbrev, then move cursor vertically down ARG lines.
-If there is no character in the target line exactly under the current column,
-the cursor is positioned after the character in that line which spans this
-column, or at the end of the line if it is not long enough.
-If there is no line in the buffer after this one,
-a newline character is inserted to create a line
-and the cursor moves to that line.
-
-The command \\[set-goal-column] can be used to create
-a semipermanent goal column to which this command always moves.
-Then it does not try to move vertically.  This goal column is stored
-in `goal-column', which is nil when there is none.
-
-If you are thinking of using this in a Lisp program, consider
-using `forward-line' instead.  It is usually easier to use
-and more reliable (no dependence on goal column, etc.)."
+  "Expand a mail abbrev before point, then move vertically down ARG lines.
+This only expands an abbrev (if one is present) if called with
+point at the end of a line, or on whitespace before the end of a line.
+
+In terms of line motion, this behaves like `next-line', which see."
   (interactive "p")
   (if (looking-at "[ \t]*\n") (expand-abbrev))
   (setq this-command 'next-line)
   (with-no-warnings (next-line arg)))
 
 (defun mail-abbrev-end-of-buffer (&optional arg)
-  "Expand any mail abbrev, then move point to end of buffer.
-Leave mark at previous position.
-With arg N, put point N/10 of the way from the true end.
+  "Expand a mail abbrev before point, then move to the end of the buffer.
+This only expands an abbrev (if one is present) if called with
+point at the end of a line, or on whitespace before the end of a line.
 
-Don't use this command in Lisp programs!
-\(goto-char (point-max)) is faster and avoids clobbering the mark."
+In other respects, this behaves like `end-of-buffer', which see."
   (interactive "P")
   (if (looking-at "[ \t]*\n") (expand-abbrev))
   (setq this-command 'end-of-buffer)
-  (with-no-warnings
-   (end-of-buffer arg)))
+  (with-no-warnings (end-of-buffer arg)))
 
 (eval-after-load "sendmail"
   '(progn