Mercurial > hg > xemacs-beta
comparison lisp/prim/buffer.el @ 4:b82b59fe008d r19-15b3
Import from CVS: tag r19-15b3
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:46:56 +0200 |
parents | 376386a54a3c |
children | 0293115a14e9 |
comparison
equal
deleted
inserted
replaced
3:30df88044ec6 | 4:b82b59fe008d |
---|---|
63 If BUFNAME is nil, then some other buffer is chosen. | 63 If BUFNAME is nil, then some other buffer is chosen. |
64 If `pop-up-windows' is non-nil, windows can be split to do this. | 64 If `pop-up-windows' is non-nil, windows can be split to do this. |
65 If optional second arg NOT-THIS-WINDOW-P is non-nil, insist on finding | 65 If optional second arg NOT-THIS-WINDOW-P is non-nil, insist on finding |
66 another window even if BUFNAME is already visible in the selected window. | 66 another window even if BUFNAME is already visible in the selected window. |
67 If optional third arg is non-nil, it is the frame to pop to this | 67 If optional third arg is non-nil, it is the frame to pop to this |
68 buffer on." | 68 buffer on. |
69 If `focus-follows-mouse' is non-nil, keyboard focus is left unchanged." | |
69 ;; #ifdef I18N3 | 70 ;; #ifdef I18N3 |
70 ;; #### Doc string should indicate that the buffer name will get | 71 ;; #### Doc string should indicate that the buffer name will get |
71 ;; translated. | 72 ;; translated. |
72 ;; #endif | 73 ;; #endif |
73 (let (buf window frame) | 74 ;; This is twisted. It is evil to throw the keyboard focus around |
75 ;; willy-nilly if the user wants focus-follows-mouse. | |
76 (let ((oldbuf (current-buffer)) | |
77 buf window frame) | |
74 (if (null bufname) | 78 (if (null bufname) |
75 (setq buf (other-buffer (current-buffer))) | 79 (setq buf (other-buffer (current-buffer))) |
76 (setq buf (get-buffer bufname)) | 80 (setq buf (get-buffer bufname)) |
77 (if (null buf) | 81 (if (null buf) |
78 (progn | 82 (progn |
81 (push-window-configuration) | 85 (push-window-configuration) |
82 (set-buffer buf) | 86 (set-buffer buf) |
83 (setq window (display-buffer buf not-this-window-p on-frame)) | 87 (setq window (display-buffer buf not-this-window-p on-frame)) |
84 (setq frame (window-frame window)) | 88 (setq frame (window-frame window)) |
85 ;; if the display-buffer hook decided to show this buffer in another | 89 ;; if the display-buffer hook decided to show this buffer in another |
86 ;; frame, then select that frame. | 90 ;; frame, then select that frame, (unless obeying focus-follows-mouse -sb). |
87 (if (not (eq frame (selected-frame))) | 91 (if (and (not focus-follows-mouse) |
92 (not (eq frame (selected-frame)))) | |
88 (select-frame frame)) | 93 (select-frame frame)) |
89 (record-buffer buf) | 94 (record-buffer buf) |
90 (select-window window) | 95 (if (and focus-follows-mouse |
96 on-frame | |
97 (not (eq on-frame (selected-frame)))) | |
98 (set-buffer oldbuf) | |
99 ;; select-window will modify the internal keyboard focus of XEmacs | |
100 (select-window window)) | |
91 buf)) | 101 buf)) |