Changes committed gnus/lisp (ChangeLog message.el)
"Katsumi Yamaoka" <[email protected]> Wed, 02 Dec 2009 12:50:30 +0100
| Newsgroups | gmane.emacs.gnus.commits |
|---|---|
| Message-ID | <[email protected]> |
Modified: ChangeLog message.el 2009-12-02 Stefan Monnier <[email protected]> * message.el (message-completion-in-region): New compatibility function. (message-expand-group): Use it. Index: ChangeLog diff -u gnus/lisp/ChangeLog:7.2040 gnus/lisp/ChangeLog:7.2041 --- ChangeLog:7.2040 Wed Dec 2 01:49:30 2009 +++ ChangeLog Wed Dec 2 12:50:30 2009 @@ -1,3 +1,8 @@ +2009-12-02 Stefan Monnier <[email protected]> + + * message.el (message-completion-in-region): New compatibility function. + (message-expand-group): Use it. + 2009-12-02 Katsumi Yamaoka <[email protected]> * gnus-group.el (gnus-group-prepare-flat): Check also whether groups Index: message.el diff -u gnus/lisp/message.el:7.283 gnus/lisp/message.el:7.284 --- message.el:7.283 Mon Sep 28 14:10:56 2009 +++ message.el Wed Dec 2 12:50:30 2009 @@ -7674,37 +7674,44 @@ (point)) (skip-chars-backward "^, \t\n") (point)))) (completion-ignore-case t) - (string (buffer-substring b (progn (skip-chars-forward "^,\t\n ") - (point)))) - (hashtb (and (boundp 'gnus-active-hashtb) gnus-active-hashtb)) - (completions (all-completions string hashtb)) - comp) - (delete-region b (point)) - (cond - ((= (length completions) 1) - (if (string= (car completions) string) - (progn - (insert string) - (message "Only matching group")) - (insert (car completions)))) - ((and (setq comp (try-completion string hashtb)) - (not (string= comp string))) - (insert comp)) - (t - (insert string) - (if (not comp) - (message "No matching groups") - (save-selected-window - (pop-to-buffer "*Completions*") - (buffer-disable-undo) - (let ((buffer-read-only nil)) - (erase-buffer) - (let ((standard-output (current-buffer))) - (message-display-completion-list (sort completions 'string<) - string)) - (setq buffer-read-only nil) - (goto-char (point-min)) - (delete-region (point) (progn (forward-line 3) (point)))))))))) + (e (progn (skip-chars-forward "^,\t\n ") (point))) + (hashtb (and (boundp 'gnus-active-hashtb) gnus-active-hashtb))) + (message-completion-in-region e b hashtb))) + +(defalias 'message-completion-in-region + (if (fboundp 'completion-in-region) + 'completion-in-region + (lambda (e b hashtb) + (let* ((string (buffer-substring b e)) + (completions (all-completions string hashtb)) + comp) + (delete-region b (point)) + (cond + ((= (length completions) 1) + (if (string= (car completions) string) + (progn + (insert string) + (message "Only matching group")) + (insert (car completions)))) + ((and (setq comp (try-completion string hashtb)) + (not (string= comp string))) + (insert comp)) + (t + (insert string) + (if (not comp) + (message "No matching groups") + (save-selected-window + (pop-to-buffer "*Completions*") + (buffer-disable-undo) + (let ((buffer-read-only nil)) + (erase-buffer) + (let ((standard-output (current-buffer))) + (message-display-completion-list (sort completions 'string<) + string)) + (setq buffer-read-only nil) + (goto-char (point-min)) + (delete-region (point) + (progn (forward-line 3) (point)))))))))))) (defun message-expand-name () (cond ((and (memq 'eudc message-expand-name-databases)