comparison lisp/files.el @ 99793:e8c67eb9dcf1

(switch-to-buffer-other-window, switch-to-buffer-other-frame): Rename buffer argument to buffer-or-name. Reword and mention new option confirm-nonexistent-file-or-buffer in doc-string.
author Martin Rudalics <rudalics@gmx.at>
date Sat, 22 Nov 2008 11:41:31 +0000
parents f0e4d86dd0da
children 8b9f58a19020
comparison
equal deleted inserted replaced
99792:806c4d7db55d 99793:e8c67eb9dcf1
1118 (minibuffer-with-setup-hook 1118 (minibuffer-with-setup-hook
1119 (lambda () (setq minibuffer-completion-table rbts-completion-table)) 1119 (lambda () (setq minibuffer-completion-table rbts-completion-table))
1120 (read-buffer prompt (other-buffer (current-buffer)) 1120 (read-buffer prompt (other-buffer (current-buffer))
1121 (if confirm-nonexistent-file-or-buffer 'confirm-only))))) 1121 (if confirm-nonexistent-file-or-buffer 'confirm-only)))))
1122 1122
1123 (defun switch-to-buffer-other-window (buffer &optional norecord) 1123 (defun switch-to-buffer-other-window (buffer-or-name &optional norecord)
1124 "Select buffer BUFFER in another window. 1124 "Select the buffer specified by BUFFER-OR-NAME in another window.
1125 If BUFFER does not identify an existing buffer, then this function 1125 BUFFER-OR-NAME may be a buffer, a string \(a buffer name), or
1126 creates a buffer with that name. 1126 nil. Return the buffer switched to.
1127 1127
1128 When called from Lisp, BUFFER can be a buffer, a string \(a buffer name), 1128 If BUFFER-OR-NAME is a string and does not identify an existing
1129 or nil. If BUFFER is nil, then this function chooses a buffer 1129 buffer, create a new buffer with that name. Interactively, if
1130 using `other-buffer'. 1130 `confirm-nonexistent-file-or-buffer' is non-nil, request
1131 Optional second arg NORECORD non-nil means do not put this 1131 confirmation before creating a new buffer. If BUFFER-OR-NAME is
1132 nil, switch to buffer returned by `other-buffer'.
1133
1134 Optional second argument NORECORD non-nil means do not put this
1132 buffer at the front of the list of recently selected ones. 1135 buffer at the front of the list of recently selected ones.
1133 This function returns the buffer it switched to.
1134 1136
1135 This uses the function `display-buffer' as a subroutine; see its 1137 This uses the function `display-buffer' as a subroutine; see its
1136 documentation for additional customization information." 1138 documentation for additional customization information."
1137 (interactive 1139 (interactive
1138 (list (read-buffer-to-switch "Switch to buffer in other window: "))) 1140 (list (read-buffer-to-switch "Switch to buffer in other window: ")))
1139 (let ((pop-up-windows t) 1141 (let ((pop-up-windows t)
1140 ;; Don't let these interfere.
1141 same-window-buffer-names same-window-regexps) 1142 same-window-buffer-names same-window-regexps)
1142 (pop-to-buffer buffer t norecord))) 1143 (pop-to-buffer buffer-or-name t norecord)))
1143 1144
1144 (defun switch-to-buffer-other-frame (buffer &optional norecord) 1145 (defun switch-to-buffer-other-frame (buffer-or-name &optional norecord)
1145 "Switch to buffer BUFFER in another frame. 1146 "Switch to buffer BUFFER-OR-NAME in another frame.
1147 BUFFER-OR-NAME may be a buffer, a string \(a buffer name), or
1148 nil. Return the buffer switched to.
1149
1150 If BUFFER-OR-NAME is a string and does not identify an existing
1151 buffer, create a new buffer with that name. Interactively, if
1152 `confirm-nonexistent-file-or-buffer' is non-nil, request
1153 confirmation before creating a new buffer. If BUFFER-OR-NAME is
1154 nil, switch to buffer returned by `other-buffer'.
1155
1146 Optional second arg NORECORD non-nil means do not put this 1156 Optional second arg NORECORD non-nil means do not put this
1147 buffer at the front of the list of recently selected ones. 1157 buffer at the front of the list of recently selected ones.
1148 This function returns the buffer it switched to. 1158
1149 1159 This uses the function `display-buffer' as a subroutine; see its
1150 This uses the function `display-buffer' as a subroutine; see 1160 documentation for additional customization information."
1151 its documentation for additional customization information."
1152 (interactive 1161 (interactive
1153 (list (read-buffer-to-switch "Switch to buffer in other frame: "))) 1162 (list (read-buffer-to-switch "Switch to buffer in other frame: ")))
1154 (let ((pop-up-frames t) 1163 (let ((pop-up-frames t)
1155 same-window-buffer-names same-window-regexps) 1164 same-window-buffer-names same-window-regexps)
1156 (pop-to-buffer buffer t norecord))) 1165 (pop-to-buffer buffer-or-name t norecord)))
1157 1166
1158 (defun display-buffer-other-frame (buffer) 1167 (defun display-buffer-other-frame (buffer)
1159 "Display buffer BUFFER in another frame. 1168 "Display buffer BUFFER in another frame.
1160 This uses the function `display-buffer' as a subroutine; see 1169 This uses the function `display-buffer' as a subroutine; see
1161 its documentation for additional customization information." 1170 its documentation for additional customization information."