diff options
| author | Martin Rudalics | 2008-11-23 17:40:27 +0000 |
|---|---|---|
| committer | Martin Rudalics | 2008-11-23 17:40:27 +0000 |
| commit | 2faede351aec0a9eb680dcc89bdd66e70df848ab (patch) | |
| tree | 06e0b322a3f9d5f0b0937b5a278d7b957f38b610 | |
| parent | b0857706e4bc6d09dc04f46766f6bde39a836f80 (diff) | |
| download | emacs-2faede351aec0a9eb680dcc89bdd66e70df848ab.tar.gz emacs-2faede351aec0a9eb680dcc89bdd66e70df848ab.zip | |
(info-lookup): When Info buffer is visible on
another frame, raise that frame.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/info-look.el | 33 |
2 files changed, 22 insertions, 16 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 090df75024f..6b40ec39f2b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2008-11-23 Martin Rudalics <rudalics@gmx.at> | ||
| 2 | |||
| 3 | * info-look.el (info-lookup): When Info buffer is visible on | ||
| 4 | another frame, raise that frame. | ||
| 5 | |||
| 1 | 2008-11-23 Juanma Barranquero <lekktu@gmail.com> | 6 | 2008-11-23 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 7 | ||
| 3 | * allout.el (allout-mode): Fix typo in docstring. | 8 | * allout.el (allout-mode): Fix typo in docstring. |
diff --git a/lisp/info-look.el b/lisp/info-look.el index fc8ff1e578b..1373de9e24a 100644 --- a/lisp/info-look.el +++ b/lisp/info-look.el | |||
| @@ -335,22 +335,23 @@ If optional argument QUERY is non-nil, query for the help mode." | |||
| 335 | (cons (list Info-current-file Info-current-node (point)) | 335 | (cons (list Info-current-file Info-current-node (point)) |
| 336 | Info-history)))) | 336 | Info-history)))) |
| 337 | found doc-spec node prefix suffix doc-found) | 337 | found doc-spec node prefix suffix doc-found) |
| 338 | (if (not (eq major-mode 'Info-mode)) | 338 | (unless (eq major-mode 'Info-mode) |
| 339 | (if (not info-lookup-other-window-flag) | 339 | (if (not info-lookup-other-window-flag) |
| 340 | (info) | 340 | (info) |
| 341 | (progn | 341 | (save-window-excursion (info)) |
| 342 | (save-window-excursion (info)) | 342 | (let* ((info-window (get-buffer-window "*info*" t)) |
| 343 | ;; Determine whether or not the Info buffer is visible in | 343 | (info-frame (and info-window (window-frame info-window)))) |
| 344 | ;; another frame on the same display. If it is, simply raise | 344 | (if (and info-frame |
| 345 | ;; that frame. Otherwise, display it in another window. | 345 | (not (eq info-frame (selected-frame))) |
| 346 | (let* ((window (get-buffer-window "*info*" t)) | 346 | (display-multi-frame-p) |
| 347 | (info-frame (and window (window-frame window)))) | 347 | (memq info-frame (frames-on-display-list))) |
| 348 | (if (and info-frame | 348 | ;; *info* is visible in another frame on same display. |
| 349 | (display-multi-frame-p) | 349 | ;; Raise that frame and select the window. |
| 350 | (memq info-frame (frames-on-display-list)) | 350 | (progn |
| 351 | (not (eq info-frame (selected-frame)))) | 351 | (select-window info-window) |
| 352 | (select-frame info-frame) | 352 | (raise-frame info-frame)) |
| 353 | (switch-to-buffer-other-window "*info*")))))) | 353 | ;; In any other case, switch to *info* in another window. |
| 354 | (switch-to-buffer-other-window "*info*"))))) | ||
| 354 | (while (and (not found) modes) | 355 | (while (and (not found) modes) |
| 355 | (setq doc-spec (info-lookup->doc-spec topic (car modes))) | 356 | (setq doc-spec (info-lookup->doc-spec topic (car modes))) |
| 356 | (while (and (not found) doc-spec) | 357 | (while (and (not found) doc-spec) |