From: Bill Wohler Date: Mon, 4 Jul 2011 00:09:44 +0000 (-0700) Subject: * mh-letter.el (mh-letter-mode-map, mh-letter-complete) X-Git-Tag: emacs-pretest-24.0.90~104^2~152^2~211 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=24f75b10464f777a81427237b8f9400139a346c3;p=emacs.git * mh-letter.el (mh-letter-mode-map, mh-letter-complete) (mh-complete-word): Remove FIXME comments since these functions are still needed in other Emacsen. However, they can probably stand to be generalized like completion-at-point. (mh-letter-complete-or-space): Remove unused variable. --- diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog index 8d1ec19415a..3b6214b579a 100644 --- a/lisp/mh-e/ChangeLog +++ b/lisp/mh-e/ChangeLog @@ -1,3 +1,11 @@ +2011-07-04 Bill Wohler + + * mh-letter.el (mh-letter-mode-map, mh-letter-complete) + (mh-complete-word): Remove FIXME comments since these functions + are still needed in other Emacsen. However, they can probably + stand to be generalized like completion-at-point. + (mh-letter-complete-or-space): Remove unused variable. + 2011-07-03 Bill Wohler * mh-compat.el (mh-test-completion): Add compatibility function diff --git a/lisp/mh-e/mh-letter.el b/lisp/mh-e/mh-letter.el index 2ced886c05e..494030ecc84 100644 --- a/lisp/mh-e/mh-letter.el +++ b/lisp/mh-e/mh-letter.el @@ -185,7 +185,7 @@ semi-obsolete and is only used if `mail-citation-hook' is nil.") "\C-c\C-w" mh-check-whom "\C-c\C-y" mh-yank-cur-msg "\C-c\M-d" mh-insert-auto-fields - "\M-\t" mh-letter-complete ;; FIXME: completion-at-point + "\M-\t" mh-letter-complete "\t" mh-letter-next-header-field-or-indent [backtab] mh-letter-previous-header-field) @@ -502,10 +502,13 @@ This provides alias and folder completion in header fields according to (or (funcall func) #'ignore) mh-letter-complete-function))) -(defalias 'mh-letter-complete - (if (fboundp 'completion-at-point) #'completion-at-point - (lambda () - "Perform completion on header field or word preceding point. +;; TODO Now that completion-at-point performs the task of +;; mh-letter-complete, perhaps mh-letter-complete along with +;; mh-complete-word should be rewritten as a more general function for +;; XEmacs, renamed to mh-completion-at-point, and moved to +;; mh-compat.el. +(defun-mh mh-letter-complete completion-at-point () + "Perform completion on header field or word preceding point. If the field contains addresses (for example, \"To:\" or \"Cc:\") or folders (for example, \"Fcc:\") then this command will provide @@ -521,7 +524,7 @@ alias completion. In the body of the message, this command runs (end (nth 1 data)) (table (nth 2 data))) (mh-complete-word (buffer-substring-no-properties start end) - table start end)))))))) + table start end)))))) (defun mh-letter-complete-or-space (arg) "Perform completion or insert space. @@ -531,8 +534,7 @@ this command to perform completion in the header. Otherwise, a space is inserted; use a prefix argument ARG to specify more than one space." (interactive "p") - (let ((func nil) - (end-of-prev (save-excursion + (let ((end-of-prev (save-excursion (goto-char (mh-beginning-of-word)) (mh-beginning-of-word -1)))) (cond ((not mh-compose-space-does-completion-flag) @@ -889,7 +891,6 @@ downcasing the field name." ;;;###mh-autoload (defun mh-complete-word (word choices begin end) - ;; FIXME: Only needed when completion-at-point doesn't exist. "Complete WORD from CHOICES. Any match found replaces the text from BEGIN to END." (let ((completion (try-completion word choices))