diff options
Diffstat (limited to 'lisp/gnus')
-rw-r--r-- | lisp/gnus/ChangeLog | 10 | ||||
-rw-r--r-- | lisp/gnus/ecomplete.el | 32 | ||||
-rw-r--r-- | lisp/gnus/gnus-win.el | 11 |
3 files changed, 41 insertions, 12 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index b2d907b7a86..69041ccbbd0 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,13 @@ +2011-09-22 Kan-Ru Chen <kanru@kanru.info> + + * ecomplete.el (ecomplete-display-matches): Use a local keymap to + handle bindings. + +2011-10-06 Lars Magne Ingebrigtsen <larsi@gnus.org> + + * gnus-win.el (gnus-configure-windows): Protect against reading + ephemeral groups outside of Gnus. + 2011-10-06 Katsumi Yamaoka <yamaoka@jpl.org> * shr.el (shr-tag-img): Don't get images displayed in tables. diff --git a/lisp/gnus/ecomplete.el b/lisp/gnus/ecomplete.el index 6a47b119f10..5d1c46bc2f6 100644 --- a/lisp/gnus/ecomplete.el +++ b/lisp/gnus/ecomplete.el @@ -27,6 +27,11 @@ (eval-when-compile (require 'cl)) +(eval-when-compile + (when (featurep 'xemacs) + ;; The `kbd' macro requires that the `read-kbd-macro' macro is available. + (require 'edmacro))) + (defgroup ecomplete nil "Electric completion of email addresses and the like." :group 'mail) @@ -123,15 +128,24 @@ (message "%s" matches) nil) (setq highlight (ecomplete-highlight-match-line matches line)) - (while (not (memq (setq command (read-event highlight)) '(? return))) - (cond - ((eq command ?\M-n) - (setq line (min (1+ line) max-lines))) - ((eq command ?\M-p) - (setq line (max (1- line) 0)))) - (setq highlight (ecomplete-highlight-match-line matches line))) - (when (eq command 'return) - (nth line (split-string matches "\n"))))))) + (let ((local-map (make-sparse-keymap)) + selected) + (define-key local-map (kbd "RET") + (lambda () (setq selected (nth line (split-string matches "\n"))))) + (define-key local-map (kbd "M-n") + (lambda () (setq line (min (1+ line) max-lines)))) + (define-key local-map (kbd "M-p") + (lambda () (setq line (max (1- line) 0)))) + (let ((overriding-local-map local-map)) + (while (and (null selected) + (setq command (read-key-sequence highlight)) + (lookup-key local-map command)) + (apply (key-binding command) nil) + (setq highlight (ecomplete-highlight-match-line matches line)))) + (if selected + (message selected) + (message "Abort")) + selected))))) (defun ecomplete-highlight-match-line (matches line) (with-temp-buffer diff --git a/lisp/gnus/gnus-win.el b/lisp/gnus/gnus-win.el index c38f57d96cb..a1a8abc3086 100644 --- a/lisp/gnus/gnus-win.el +++ b/lisp/gnus/gnus-win.el @@ -358,8 +358,13 @@ See the Gnus manual for an explanation of the syntax used.") (defvar gnus-frame-split-p nil) (defun gnus-configure-windows (setting &optional force) - (if (window-configuration-p setting) - (set-window-configuration setting) + (cond + ((null setting) + ;; Do nothing. + ) + ((window-configuration-p setting) + (set-window-configuration setting)) + (t (setq gnus-current-window-configuration setting) (setq force (or force gnus-always-force-window-configuration)) (let ((split (if (symbolp setting) @@ -410,7 +415,7 @@ See the Gnus manual for an explanation of the syntax used.") (run-hooks 'gnus-configure-windows-hook) (when gnus-window-frame-focus (gnus-select-frame-set-input-focus - (window-frame gnus-window-frame-focus)))))))) + (window-frame gnus-window-frame-focus))))))))) (defun gnus-delete-windows-in-gnusey-frames () "Do a `delete-other-windows' in all frames that have Gnus windows." |