X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/5ed99d3685cc8d13f8e4c63ad449a6e4d63c8eb0..4df043c55892b20418c763df48e313f1c44f442e:/lisp/mail/mailalias.el diff --git a/lisp/mail/mailalias.el b/lisp/mail/mailalias.el index fc8a07acd4..59670a7dcb 100644 --- a/lisp/mail/mailalias.el +++ b/lisp/mail/mailalias.el @@ -1,9 +1,9 @@ ;;; mailalias.el --- expand and complete mailing address aliases -*- lexical-binding: t -*- -;; Copyright (C) 1985, 1987, 1995-1997, 2001-2011 -;; Free Software Foundation, Inc. +;; Copyright (C) 1985, 1987, 1995-1997, 2001-2016 Free Software +;; Foundation, Inc. -;; Maintainer: FSF +;; Maintainer: emacs-devel@gnu.org ;; Keywords: mail ;; This file is part of GNU Emacs. @@ -77,7 +77,7 @@ If not on matching header, `mail-complete-function' gets called instead." ;;;###autoload (defcustom mail-complete-style 'angles "Specifies how \\[mail-complete] formats the full name when it completes. -If `nil', they contain just the return address like: +If nil, they contain just the return address like: king@grassland.com If `parens', they look like: king@grassland.com (Elvis Parsley) @@ -119,18 +119,23 @@ completed. `pattern' is nil when `mail-directory-requery' is nil. The value might look like this: - '(remote-shell-program \"HOST\" \"-nl\" \"USER\" \"COMMAND\") + (remote-shell-program \"HOST\" \"-nl\" \"USER\" \"COMMAND\") or like this: - '(remote-shell-program \"HOST\" \"-n\" \"COMMAND '^\" pattern \"'\")" + (remote-shell-program \"HOST\" \"-n\" \"COMMAND \\='^\" pattern \"\\='\")" :type 'sexp :group 'mailalias) (put 'mail-directory-process 'risky-local-variable t) (defcustom mail-directory-stream nil "List of (HOST SERVICE) for stream connection to mail directory." - :type 'sexp + :type '(choice (const nil) + (list (string :tag "Host name or ip address") + (choice (integer :tag "Service port number") + (string :tag "Service name")) + (plist :inline t + :tag "Additional open-network-stream parameters"))) :group 'mailalias) (put 'mail-directory-stream 'risky-local-variable t) @@ -209,7 +214,9 @@ removed from alias expansions." (if (re-search-forward "[ \t]*[\n,][ \t]*" end1 t) (setq epos (match-beginning 0) seplen (- (point) epos)) - (setq epos (marker-position end1) seplen 0)) + ;; Handle the last name in this header field. + ;; We already moved END1 back across whitespace after it. + (setq epos (marker-position end1) seplen 0)) (let ((string (buffer-substring-no-properties pos epos)) translation) (if (and (not (assoc string disabled-aliases)) @@ -427,6 +434,7 @@ For use on `completion-at-point-functions'." "Perform completion on header field or word preceding point. Completable headers are according to `mail-complete-alist'. If none matches current header, calls `mail-complete-function' and passes prefix ARG if any." + (declare (obsolete mail-completion-at-point-function "24.1")) (interactive "P") ;; Read the defaults first, if we have not done so. (sendmail-sync-aliases) @@ -439,7 +447,6 @@ current header, calls `mail-complete-function' and passes prefix ARG if any." (if data (apply #'completion-in-region data) (funcall mail-complete-function arg)))) -(make-obsolete 'mail-complete 'mail-completion-at-point-function "24.1") (defun mail-completion-expand (table) "Build new completion table that expands aliases. @@ -510,7 +517,7 @@ PREFIX is the string we want to complete." mail-aliases)) (if (consp mail-local-names) mail-local-names) - (or directory + (or directory (when (consp mail-directory-names) mail-directory-names))) (lambda (a b)