diff options
| author | Gnus developers | 2011-10-06 22:11:15 +0000 |
|---|---|---|
| committer | Katsumi Yamaoka | 2011-10-06 22:11:15 +0000 |
| commit | 465d0300d4ffdaf2d816f79f76716ba3406ac869 (patch) | |
| tree | 5810cfd93a08bc315391ffb9eda6a12c20fc462f /lisp | |
| parent | 0181e1939ea39ceaf54e4cfd95858a5fcfb4f0c7 (diff) | |
| download | emacs-465d0300d4ffdaf2d816f79f76716ba3406ac869.tar.gz emacs-465d0300d4ffdaf2d816f79f76716ba3406ac869.zip | |
Merge changes made in Gnus trunk.
gnus.texi (Gnus Utility Functions): Add more references and explanations (bug#9683).
ecomplete.el (ecomplete-display-matches): Use a local keymap to handle bindings.
gnus-win.el (gnus-configure-windows): Protect against reading ephemeral groups outside of Gnus.
Diffstat (limited to 'lisp')
| -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 @@ | |||
| 1 | 2011-09-22 Kan-Ru Chen <kanru@kanru.info> | ||
| 2 | |||
| 3 | * ecomplete.el (ecomplete-display-matches): Use a local keymap to | ||
| 4 | handle bindings. | ||
| 5 | |||
| 6 | 2011-10-06 Lars Magne Ingebrigtsen <larsi@gnus.org> | ||
| 7 | |||
| 8 | * gnus-win.el (gnus-configure-windows): Protect against reading | ||
| 9 | ephemeral groups outside of Gnus. | ||
| 10 | |||
| 1 | 2011-10-06 Katsumi Yamaoka <yamaoka@jpl.org> | 11 | 2011-10-06 Katsumi Yamaoka <yamaoka@jpl.org> |
| 2 | 12 | ||
| 3 | * shr.el (shr-tag-img): Don't get images displayed in tables. | 13 | * 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 @@ | |||
| 27 | (eval-when-compile | 27 | (eval-when-compile |
| 28 | (require 'cl)) | 28 | (require 'cl)) |
| 29 | 29 | ||
| 30 | (eval-when-compile | ||
| 31 | (when (featurep 'xemacs) | ||
| 32 | ;; The `kbd' macro requires that the `read-kbd-macro' macro is available. | ||
| 33 | (require 'edmacro))) | ||
| 34 | |||
| 30 | (defgroup ecomplete nil | 35 | (defgroup ecomplete nil |
| 31 | "Electric completion of email addresses and the like." | 36 | "Electric completion of email addresses and the like." |
| 32 | :group 'mail) | 37 | :group 'mail) |
| @@ -123,15 +128,24 @@ | |||
| 123 | (message "%s" matches) | 128 | (message "%s" matches) |
| 124 | nil) | 129 | nil) |
| 125 | (setq highlight (ecomplete-highlight-match-line matches line)) | 130 | (setq highlight (ecomplete-highlight-match-line matches line)) |
| 126 | (while (not (memq (setq command (read-event highlight)) '(? return))) | 131 | (let ((local-map (make-sparse-keymap)) |
| 127 | (cond | 132 | selected) |
| 128 | ((eq command ?\M-n) | 133 | (define-key local-map (kbd "RET") |
| 129 | (setq line (min (1+ line) max-lines))) | 134 | (lambda () (setq selected (nth line (split-string matches "\n"))))) |
| 130 | ((eq command ?\M-p) | 135 | (define-key local-map (kbd "M-n") |
| 131 | (setq line (max (1- line) 0)))) | 136 | (lambda () (setq line (min (1+ line) max-lines)))) |
| 132 | (setq highlight (ecomplete-highlight-match-line matches line))) | 137 | (define-key local-map (kbd "M-p") |
| 133 | (when (eq command 'return) | 138 | (lambda () (setq line (max (1- line) 0)))) |
| 134 | (nth line (split-string matches "\n"))))))) | 139 | (let ((overriding-local-map local-map)) |
| 140 | (while (and (null selected) | ||
| 141 | (setq command (read-key-sequence highlight)) | ||
| 142 | (lookup-key local-map command)) | ||
| 143 | (apply (key-binding command) nil) | ||
| 144 | (setq highlight (ecomplete-highlight-match-line matches line)))) | ||
| 145 | (if selected | ||
| 146 | (message selected) | ||
| 147 | (message "Abort")) | ||
| 148 | selected))))) | ||
| 135 | 149 | ||
| 136 | (defun ecomplete-highlight-match-line (matches line) | 150 | (defun ecomplete-highlight-match-line (matches line) |
| 137 | (with-temp-buffer | 151 | (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.") | |||
| 358 | (defvar gnus-frame-split-p nil) | 358 | (defvar gnus-frame-split-p nil) |
| 359 | 359 | ||
| 360 | (defun gnus-configure-windows (setting &optional force) | 360 | (defun gnus-configure-windows (setting &optional force) |
| 361 | (if (window-configuration-p setting) | 361 | (cond |
| 362 | (set-window-configuration setting) | 362 | ((null setting) |
| 363 | ;; Do nothing. | ||
| 364 | ) | ||
| 365 | ((window-configuration-p setting) | ||
| 366 | (set-window-configuration setting)) | ||
| 367 | (t | ||
| 363 | (setq gnus-current-window-configuration setting) | 368 | (setq gnus-current-window-configuration setting) |
| 364 | (setq force (or force gnus-always-force-window-configuration)) | 369 | (setq force (or force gnus-always-force-window-configuration)) |
| 365 | (let ((split (if (symbolp setting) | 370 | (let ((split (if (symbolp setting) |
| @@ -410,7 +415,7 @@ See the Gnus manual for an explanation of the syntax used.") | |||
| 410 | (run-hooks 'gnus-configure-windows-hook) | 415 | (run-hooks 'gnus-configure-windows-hook) |
| 411 | (when gnus-window-frame-focus | 416 | (when gnus-window-frame-focus |
| 412 | (gnus-select-frame-set-input-focus | 417 | (gnus-select-frame-set-input-focus |
| 413 | (window-frame gnus-window-frame-focus)))))))) | 418 | (window-frame gnus-window-frame-focus))))))))) |
| 414 | 419 | ||
| 415 | (defun gnus-delete-windows-in-gnusey-frames () | 420 | (defun gnus-delete-windows-in-gnusey-frames () |
| 416 | "Do a `delete-other-windows' in all frames that have Gnus windows." | 421 | "Do a `delete-other-windows' in all frames that have Gnus windows." |