aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2011-09-02 12:38:40 -0400
committerChong Yidong2011-09-02 12:38:40 -0400
commitc33134511b466d746312becbc0e4ef59bb9258ac (patch)
tree17693629f53ccd288c4c13cdd9f2a65ed5a1941a
parent81ec0c88f2f27c090c5928f78a9c6afb8c1b2f72 (diff)
downloademacs-c33134511b466d746312becbc0e4ef59bb9258ac.tar.gz
emacs-c33134511b466d746312becbc0e4ef59bb9258ac.zip
Remove pop-to-buffer-same-window.
* lisp/window.el (pop-to-buffer-1, pop-to-buffer-same-window): Deleted. (pop-to-buffer): Change interactive spec. Pass second argument directly to display-buffer. (display-buffer): Fix interactive spec. Use functionp to distinguish between a function and a list of functions. * lisp/abbrev.el (edit-abbrevs): * lisp/arc-mode.el (archive-extract): * lisp/autoinsert.el (auto-insert): * lisp/bookmark.el (bookmark-bmenu-list): * lisp/files.el (find-file): * lisp/view.el (view-buffer): * lisp/progmodes/compile.el (compilation-goto-locus): * lisp/textmodes/bibtex.el (bibtex-initialize): Use switch-to-buffer. * lisp/org/ob-ref.el (org-babel-ref-goto-headline-id): * lisp/org/org.el (org-get-location, org-tree-to-indirect-buffer) (org-mark-ring-goto, org-refile, org-add-log-note) (org-revert-all-org-buffers, org-switchb) (org-cycle-agenda-files, org-submit-bug-report) (org-goto-marker-or-bmk): * lisp/org/org-agenda.el (org-prepare-agenda, org-agenda-switch-to): * lisp/org/org-capture.el (org-capture-goto-target) (org-capture-fill-template): * lisp/org/org-clock.el (org-clock-goto): * lisp/org/org-ctags.el (org-ctags-visit-buffer-or-file): * lisp/org/org-exp.el (org-export-as-org): * lisp/org/org-feed.el (org-feed-show-raw-feed): * lisp/org/org-html.el (org-export-htmlize-generate-css): * lisp/org/org-id.el (org-id-goto): * lisp/org/org-irc.el (org-irc-visit-erc): * lisp/org/org-mobile.el (org-mobile-apply): * lisp/org/org-publish.el (org-publish-org-to, org-publish-find-date): * lisp/org/org-remember.el (org-go-to-remember-target): * lisp/org/org-src.el (org-src-switch-to-buffer) (org-edit-fixed-width-region): Use switch-to-buffer. * lisp/org/org-compat.el (org-pop-to-buffer-same-window): Deleted.
-rw-r--r--lisp/ChangeLog17
-rw-r--r--lisp/abbrev.el2
-rw-r--r--lisp/arc-mode.el2
-rw-r--r--lisp/autoinsert.el2
-rw-r--r--lisp/bookmark.el2
-rw-r--r--lisp/files.el4
-rw-r--r--lisp/org/ChangeLog26
-rw-r--r--lisp/org/ob-ref.el4
-rw-r--r--lisp/org/org-agenda.el8
-rw-r--r--lisp/org/org-capture.el6
-rw-r--r--lisp/org/org-clock.el3
-rw-r--r--lisp/org/org-compat.el9
-rw-r--r--lisp/org/org-ctags.el4
-rw-r--r--lisp/org/org-exp.el4
-rw-r--r--lisp/org/org-feed.el2
-rw-r--r--lisp/org/org-html.el4
-rw-r--r--lisp/org/org-id.el4
-rw-r--r--lisp/org/org-irc.el8
-rw-r--r--lisp/org/org-mobile.el5
-rw-r--r--lisp/org/org-publish.el6
-rw-r--r--lisp/org/org-remember.el4
-rw-r--r--lisp/org/org-src.el12
-rw-r--r--lisp/org/org.el25
-rw-r--r--lisp/progmodes/compile.el2
-rw-r--r--lisp/textmodes/bibtex.el2
-rw-r--r--lisp/view.el2
-rw-r--r--lisp/window.el97
27 files changed, 123 insertions, 143 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 7ea1dffe1c2..ea320e51e1c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,22 @@
12011-09-02 Chong Yidong <cyd@stupidchicken.com> 12011-09-02 Chong Yidong <cyd@stupidchicken.com>
2 2
3 * window.el (pop-to-buffer-1, pop-to-buffer-same-window): Deleted.
4 (pop-to-buffer): Change interactive spec. Pass second argument
5 directly to display-buffer.
6 (display-buffer): Fix interactive spec. Use functionp to
7 distinguish between a function and a list of functions.
8
9 * abbrev.el (edit-abbrevs):
10 * arc-mode.el (archive-extract):
11 * autoinsert.el (auto-insert):
12 * bookmark.el (bookmark-bmenu-list):
13 * files.el (find-file):
14 * view.el (view-buffer):
15 * progmodes/compile.el (compilation-goto-locus):
16 * textmodes/bibtex.el (bibtex-initialize): Use switch-to-buffer.
17
182011-09-02 Chong Yidong <cyd@stupidchicken.com>
19
3 * window.el (display-buffer-alist): Doc fix. 20 * window.el (display-buffer-alist): Doc fix.
4 (display-buffer): Add docstring. Don't treat 21 (display-buffer): Add docstring. Don't treat
5 display-buffer-default specially. 22 display-buffer-default specially.
diff --git a/lisp/abbrev.el b/lisp/abbrev.el
index 3795dd46010..5a7a741a3a6 100644
--- a/lisp/abbrev.el
+++ b/lisp/abbrev.el
@@ -159,7 +159,7 @@ where NAME and EXPANSION are strings with quotes,
159USECOUNT is an integer, and HOOK is any valid function 159USECOUNT is an integer, and HOOK is any valid function
160or may be omitted (it is usually omitted)." 160or may be omitted (it is usually omitted)."
161 (interactive) 161 (interactive)
162 (pop-to-buffer-same-window (prepare-abbrev-list-buffer))) 162 (switch-to-buffer (prepare-abbrev-list-buffer)))
163 163
164(defun edit-abbrevs-redefine () 164(defun edit-abbrevs-redefine ()
165 "Redefine abbrevs according to current buffer contents." 165 "Redefine abbrevs according to current buffer contents."
diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el
index ea875b9989d..e3d1955ded5 100644
--- a/lisp/arc-mode.el
+++ b/lisp/arc-mode.el
@@ -1083,7 +1083,7 @@ using `make-temp-file', and the generated name is returned."
1083 (view-buffer buffer (and just-created 'kill-buffer-if-not-modified))) 1083 (view-buffer buffer (and just-created 'kill-buffer-if-not-modified)))
1084 ((eq other-window-p 'display) (display-buffer buffer)) 1084 ((eq other-window-p 'display) (display-buffer buffer))
1085 (other-window-p (switch-to-buffer-other-window buffer)) 1085 (other-window-p (switch-to-buffer-other-window buffer))
1086 (t (pop-to-buffer-same-window buffer)))))) 1086 (t (switch-to-buffer buffer))))))
1087 1087
1088(defun archive-*-extract (archive name command) 1088(defun archive-*-extract (archive name command)
1089 (let* ((default-directory (file-name-as-directory archive-tmpdir)) 1089 (let* ((default-directory (file-name-as-directory archive-tmpdir))
diff --git a/lisp/autoinsert.el b/lisp/autoinsert.el
index 3b849cece22..5793c3180be 100644
--- a/lisp/autoinsert.el
+++ b/lisp/autoinsert.el
@@ -360,7 +360,7 @@ Matches the visited file name against the elements of `auto-insert-alist'."
360 (save-window-excursion 360 (save-window-excursion
361 ;; make buffer visible before skeleton or function 361 ;; make buffer visible before skeleton or function
362 ;; which might ask the user for something 362 ;; which might ask the user for something
363 (pop-to-buffer-same-window (current-buffer)) 363 (switch-to-buffer (current-buffer))
364 (if (and (consp action) 364 (if (and (consp action)
365 (not (eq (car action) 'lambda))) 365 (not (eq (car action) 'lambda)))
366 (skeleton-insert action) 366 (skeleton-insert action)
diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index bb7ad153e8b..51e869e3a21 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -1539,7 +1539,7 @@ deletion, or > if it is flagged for displaying."
1539 (bookmark-maybe-load-default-file) 1539 (bookmark-maybe-load-default-file)
1540 (let ((buf (get-buffer-create "*Bookmark List*"))) 1540 (let ((buf (get-buffer-create "*Bookmark List*")))
1541 (if (called-interactively-p 'interactive) 1541 (if (called-interactively-p 'interactive)
1542 (pop-to-buffer-same-window buf) 1542 (switch-to-buffer buf)
1543 (set-buffer buf))) 1543 (set-buffer buf)))
1544 (let ((inhibit-read-only t)) 1544 (let ((inhibit-read-only t))
1545 (erase-buffer) 1545 (erase-buffer)
diff --git a/lisp/files.el b/lisp/files.el
index 07188e152b3..5bdb26f4e92 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -1342,8 +1342,8 @@ automatically choosing a major mode, use \\[find-file-literally]."
1342 (confirm-nonexistent-file-or-buffer))) 1342 (confirm-nonexistent-file-or-buffer)))
1343 (let ((value (find-file-noselect filename nil nil wildcards))) 1343 (let ((value (find-file-noselect filename nil nil wildcards)))
1344 (if (listp value) 1344 (if (listp value)
1345 (mapcar #'pop-to-buffer-same-window (nreverse value)) 1345 (mapcar 'switch-to-buffer (nreverse value))
1346 (pop-to-buffer-same-window value)))) 1346 (switch-to-buffer value))))
1347 1347
1348(defun find-file-other-window (filename &optional wildcards) 1348(defun find-file-other-window (filename &optional wildcards)
1349 "Edit file FILENAME, in another window. 1349 "Edit file FILENAME, in another window.
diff --git a/lisp/org/ChangeLog b/lisp/org/ChangeLog
index 625e0926c52..d63929d794e 100644
--- a/lisp/org/ChangeLog
+++ b/lisp/org/ChangeLog
@@ -1,3 +1,29 @@
12011-09-02 Chong Yidong <cyd@stupidchicken.com>
2
3 * org-compat.el (org-pop-to-buffer-same-window): Deleted.
4
5 * ob-ref.el (org-babel-ref-goto-headline-id):
6 * org.el (org-get-location, org-tree-to-indirect-buffer)
7 (org-mark-ring-goto, org-refile, org-add-log-note)
8 (org-revert-all-org-buffers, org-switchb)
9 (org-cycle-agenda-files, org-submit-bug-report)
10 (org-goto-marker-or-bmk):
11 * org-agenda.el (org-prepare-agenda, org-agenda-switch-to):
12 * org-capture.el (org-capture-goto-target)
13 (org-capture-fill-template):
14 * org-clock.el (org-clock-goto):
15 * org-ctags.el (org-ctags-visit-buffer-or-file):
16 * org-exp.el (org-export-as-org):
17 * org-feed.el (org-feed-show-raw-feed):
18 * org-html.el (org-export-htmlize-generate-css):
19 * org-id.el (org-id-goto):
20 * org-irc.el (org-irc-visit-erc):
21 * org-mobile.el (org-mobile-apply):
22 * org-publish.el (org-publish-org-to, org-publish-find-date):
23 * org-remember.el (org-go-to-remember-target):
24 * org-src.el (org-src-switch-to-buffer)
25 (org-edit-fixed-width-region): Use switch-to-buffer.
26
12011-08-31 Martin Rudalics <rudalics@gmx.at> 272011-08-31 Martin Rudalics <rudalics@gmx.at>
2 28
3 * org-compat.el (org-pop-to-buffer-same-window): Remove LABEL 29 * org-compat.el (org-pop-to-buffer-same-window): Remove LABEL
diff --git a/lisp/org/ob-ref.el b/lisp/org/ob-ref.el
index b27bd20db40..d0a2c14bee9 100644
--- a/lisp/org/ob-ref.el
+++ b/lisp/org/ob-ref.el
@@ -61,8 +61,6 @@
61(declare-function org-narrow-to-subtree "org" ()) 61(declare-function org-narrow-to-subtree "org" ())
62(declare-function org-id-find-id-in-file "org-id" (id file &optional markerp)) 62(declare-function org-id-find-id-in-file "org-id" (id file &optional markerp))
63(declare-function org-show-context "org" (&optional key)) 63(declare-function org-show-context "org" (&optional key))
64(declare-function org-pop-to-buffer-same-window
65 "org-compat" (&optional buffer-or-name norecord label))
66 64
67(defvar org-babel-ref-split-regexp 65(defvar org-babel-ref-split-regexp
68 "[ \f\t\n\r\v]*\\(.+?\\)[ \f\t\n\r\v]*=[ \f\t\n\r\v]*\\(.+\\)[ \f\t\n\r\v]*") 66 "[ \f\t\n\r\v]*\\(.+?\\)[ \f\t\n\r\v]*=[ \f\t\n\r\v]*\\(.+\\)[ \f\t\n\r\v]*")
@@ -96,7 +94,7 @@ the variable."
96 (m (when file (org-id-find-id-in-file id file 'marker)))) 94 (m (when file (org-id-find-id-in-file id file 'marker))))
97 (when (and file m) 95 (when (and file m)
98 (message "file:%S" file) 96 (message "file:%S" file)
99 (org-pop-to-buffer-same-window (marker-buffer m)) 97 (switch-to-buffer (marker-buffer m))
100 (goto-char m) 98 (goto-char m)
101 (move-marker m nil) 99 (move-marker m nil)
102 (org-show-context) 100 (org-show-context)
diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el
index 9f23c4011d1..aea284fe72c 100644
--- a/lisp/org/org-agenda.el
+++ b/lisp/org/org-agenda.el
@@ -60,8 +60,6 @@
60(declare-function org-is-habit-p "org-habit" (&optional pom)) 60(declare-function org-is-habit-p "org-habit" (&optional pom))
61(declare-function org-habit-parse-todo "org-habit" (&optional pom)) 61(declare-function org-habit-parse-todo "org-habit" (&optional pom))
62(declare-function org-habit-get-priority "org-habit" (habit &optional moment)) 62(declare-function org-habit-get-priority "org-habit" (habit &optional moment))
63(declare-function org-pop-to-buffer-same-window "org-compat"
64 (&optional buffer-or-name norecord label))
65 63
66(defvar calendar-mode-map) 64(defvar calendar-mode-map)
67(defvar org-clock-current-task) ; defined in org-clock.el 65(defvar org-clock-current-task) ; defined in org-clock.el
@@ -3067,7 +3065,7 @@ the global options and expect it to be applied to the entire view.")
3067 (awin (select-window awin)) 3065 (awin (select-window awin))
3068 ((not (setq org-pre-agenda-window-conf (current-window-configuration)))) 3066 ((not (setq org-pre-agenda-window-conf (current-window-configuration))))
3069 ((equal org-agenda-window-setup 'current-window) 3067 ((equal org-agenda-window-setup 'current-window)
3070 (org-pop-to-buffer-same-window abuf)) 3068 (switch-to-buffer abuf))
3071 ((equal org-agenda-window-setup 'other-window) 3069 ((equal org-agenda-window-setup 'other-window)
3072 (org-switch-to-buffer-other-window abuf)) 3070 (org-switch-to-buffer-other-window abuf))
3073 ((equal org-agenda-window-setup 'other-frame) 3071 ((equal org-agenda-window-setup 'other-frame)
@@ -3078,7 +3076,7 @@ the global options and expect it to be applied to the entire view.")
3078 ;; additional test in case agenda is invoked from within agenda 3076 ;; additional test in case agenda is invoked from within agenda
3079 ;; buffer via elisp link 3077 ;; buffer via elisp link
3080 (unless (equal (current-buffer) abuf) 3078 (unless (equal (current-buffer) abuf)
3081 (org-pop-to-buffer-same-window abuf))) 3079 (switch-to-buffer abuf)))
3082 (setq buffer-read-only nil) 3080 (setq buffer-read-only nil)
3083 (let ((inhibit-read-only t)) (erase-buffer)) 3081 (let ((inhibit-read-only t)) (erase-buffer))
3084 (org-agenda-mode) 3082 (org-agenda-mode)
@@ -6972,7 +6970,7 @@ at the text of the entry itself."
6972 (org-agenda-error))) 6970 (org-agenda-error)))
6973 (buffer (marker-buffer marker)) 6971 (buffer (marker-buffer marker))
6974 (pos (marker-position marker))) 6972 (pos (marker-position marker)))
6975 (org-pop-to-buffer-same-window buffer) 6973 (switch-to-buffer buffer)
6976 (and delete-other-windows (delete-other-windows)) 6974 (and delete-other-windows (delete-other-windows))
6977 (widen) 6975 (widen)
6978 (goto-char pos) 6976 (goto-char pos)
diff --git a/lisp/org/org-capture.el b/lisp/org/org-capture.el
index 133460b49ec..05cca0e311e 100644
--- a/lisp/org/org-capture.el
+++ b/lisp/org/org-capture.el
@@ -57,8 +57,6 @@
57 (date &optional keep-restriction)) 57 (date &optional keep-restriction))
58(declare-function org-table-get-specials "org-table" ()) 58(declare-function org-table-get-specials "org-table" ())
59(declare-function org-table-goto-line "org-table" (N)) 59(declare-function org-table-goto-line "org-table" (N))
60(declare-function org-pop-to-buffer-same-window "org-compat"
61 (&optional buffer-or-name norecord label))
62 60
63(defvar org-remember-default-headline) 61(defvar org-remember-default-headline)
64(defvar org-remember-templates) 62(defvar org-remember-templates)
@@ -1201,7 +1199,7 @@ The user is queried for the template."
1201 (error "No capture template selected")) 1199 (error "No capture template selected"))
1202 (org-capture-set-plist entry) 1200 (org-capture-set-plist entry)
1203 (org-capture-set-target-location) 1201 (org-capture-set-target-location)
1204 (org-pop-to-buffer-same-window (org-capture-get :buffer)) 1202 (switch-to-buffer (org-capture-get :buffer))
1205 (goto-char (org-capture-get :pos)))) 1203 (goto-char (org-capture-get :pos))))
1206 1204
1207(defun org-capture-get-indirect-buffer (&optional buffer prefix) 1205(defun org-capture-get-indirect-buffer (&optional buffer prefix)
@@ -1311,7 +1309,7 @@ The template may still contain \"%?\" for cursor positioning."
1311 (sit-for 1)) 1309 (sit-for 1))
1312 (save-window-excursion 1310 (save-window-excursion
1313 (delete-other-windows) 1311 (delete-other-windows)
1314 (org-pop-to-buffer-same-window (get-buffer-create "*Capture*")) 1312 (switch-to-buffer (get-buffer-create "*Capture*"))
1315 (erase-buffer) 1313 (erase-buffer)
1316 (insert template) 1314 (insert template)
1317 (goto-char (point-min)) 1315 (goto-char (point-min))
diff --git a/lisp/org/org-clock.el b/lisp/org/org-clock.el
index 4cf26e359f1..de5087e163c 100644
--- a/lisp/org/org-clock.el
+++ b/lisp/org/org-clock.el
@@ -36,7 +36,6 @@
36 36
37(declare-function calendar-absolute-from-iso "cal-iso" (&optional date)) 37(declare-function calendar-absolute-from-iso "cal-iso" (&optional date))
38(declare-function notifications-notify "notifications" (&rest params)) 38(declare-function notifications-notify "notifications" (&rest params))
39(declare-function org-pop-to-buffer-same-window "org-compat" (&optional buffer-or-name norecord label))
40(defvar org-time-stamp-formats) 39(defvar org-time-stamp-formats)
41(defvar org-ts-what) 40(defvar org-ts-what)
42 41
@@ -1498,7 +1497,7 @@ With prefix arg SELECT, offer recently clocked tasks for selection."
1498 (setq recent t) 1497 (setq recent t)
1499 (car org-clock-history)) 1498 (car org-clock-history))
1500 (t (error "No active or recent clock task"))))) 1499 (t (error "No active or recent clock task")))))
1501 (org-pop-to-buffer-same-window (marker-buffer m)) 1500 (switch-to-buffer (marker-buffer m))
1502 (if (or (< m (point-min)) (> m (point-max))) (widen)) 1501 (if (or (< m (point-min)) (> m (point-max))) (widen))
1503 (goto-char m) 1502 (goto-char m)
1504 (org-show-entry) 1503 (org-show-entry)
diff --git a/lisp/org/org-compat.el b/lisp/org/org-compat.el
index 9b0a935a515..896acc5aeae 100644
--- a/lisp/org/org-compat.el
+++ b/lisp/org/org-compat.el
@@ -432,15 +432,6 @@ With two arguments, return floor and remainder of their quotient."
432 (let ((q (floor x y))) 432 (let ((q (floor x y)))
433 (list q (- x (if y (* y q) q))))) 433 (list q (- x (if y (* y q) q)))))
434 434
435;; `pop-to-buffer-same-window' has been introduced with Emacs 24.1.
436(defun org-pop-to-buffer-same-window
437 (&optional buffer-or-name norecord label)
438 "Pop to buffer specified by BUFFER-OR-NAME in the selected window."
439 (if (fboundp 'pop-to-buffer-same-window)
440 (funcall
441 'pop-to-buffer-same-window buffer-or-name norecord)
442 (funcall 'switch-to-buffer buffer-or-name norecord)))
443
444(provide 'org-compat) 435(provide 'org-compat)
445 436
446 437
diff --git a/lisp/org/org-ctags.el b/lisp/org/org-ctags.el
index 9ba5024d58b..48eced9ea08 100644
--- a/lisp/org/org-ctags.el
+++ b/lisp/org/org-ctags.el
@@ -140,8 +140,6 @@
140 140
141(require 'org) 141(require 'org)
142 142
143(declare-function org-pop-to-buffer-same-window "org-compat" (&optional buffer-or-name norecord label))
144
145(defgroup org-ctags nil 143(defgroup org-ctags nil
146 "Options concerning use of ctags within org mode." 144 "Options concerning use of ctags within org mode."
147 :tag "Org-Ctags" 145 :tag "Org-Ctags"
@@ -387,7 +385,7 @@ the new file."
387 (cond 385 (cond
388 ((get-buffer (concat name ".org")) 386 ((get-buffer (concat name ".org"))
389 ;; Buffer is already open 387 ;; Buffer is already open
390 (org-pop-to-buffer-same-window (get-buffer (concat name ".org")))) 388 (switch-to-buffer (get-buffer (concat name ".org"))))
391 ((file-exists-p filename) 389 ((file-exists-p filename)
392 ;; File exists but is not open --> open it 390 ;; File exists but is not open --> open it
393 (message "Opening existing org file `%S'..." 391 (message "Opening existing org file `%S'..."
diff --git a/lisp/org/org-exp.el b/lisp/org/org-exp.el
index 59459b0d578..ee8e6027706 100644
--- a/lisp/org/org-exp.el
+++ b/lisp/org/org-exp.el
@@ -47,8 +47,6 @@
47(declare-function org-inlinetask-remove-END-maybe "org-inlinetask" ()) 47(declare-function org-inlinetask-remove-END-maybe "org-inlinetask" ())
48(declare-function org-table-cookie-line-p "org-table" (line)) 48(declare-function org-table-cookie-line-p "org-table" (line))
49(declare-function org-table-colgroup-line-p "org-table" (line)) 49(declare-function org-table-colgroup-line-p "org-table" (line))
50(declare-function org-pop-to-buffer-same-window "org-compat"
51 (&optional buffer-or-name norecord label))
52 50
53(autoload 'org-export-generic "org-export-generic" "Export using the generic exporter" t) 51(autoload 'org-export-generic "org-export-generic" "Export using the generic exporter" t)
54 52
@@ -2974,7 +2972,7 @@ directory."
2974 (region (buffer-string)) 2972 (region (buffer-string))
2975 str-ret) 2973 str-ret)
2976 (save-excursion 2974 (save-excursion
2977 (org-pop-to-buffer-same-window buffer) 2975 (switch-to-buffer buffer)
2978 (erase-buffer) 2976 (erase-buffer)
2979 (insert region) 2977 (insert region)
2980 (let ((org-inhibit-startup t)) (org-mode)) 2978 (let ((org-inhibit-startup t)) (org-mode))
diff --git a/lisp/org/org-feed.el b/lisp/org/org-feed.el
index a07ecc619e5..d1b31f11b4a 100644
--- a/lisp/org/org-feed.el
+++ b/lisp/org/org-feed.el
@@ -436,7 +436,7 @@ it can be a list structured like an entry in `org-feed-alist'."
436 (if (stringp feed) (setq feed (assoc feed org-feed-alist))) 436 (if (stringp feed) (setq feed (assoc feed org-feed-alist)))
437 (unless feed 437 (unless feed
438 (error "No such feed in `org-feed-alist")) 438 (error "No such feed in `org-feed-alist"))
439 (org-pop-to-buffer-same-window 439 (switch-to-buffer
440 (org-feed-update feed 'retrieve-only)) 440 (org-feed-update feed 'retrieve-only))
441 (goto-char (point-min))) 441 (goto-char (point-min)))
442 442
diff --git a/lisp/org/org-html.el b/lisp/org/org-html.el
index 54f6cb44dab..46126ce2573 100644
--- a/lisp/org/org-html.el
+++ b/lisp/org/org-html.el
@@ -34,8 +34,6 @@
34 34
35(declare-function org-id-find-id-file "org-id" (id)) 35(declare-function org-id-find-id-file "org-id" (id))
36(declare-function htmlize-region "ext:htmlize" (beg end)) 36(declare-function htmlize-region "ext:htmlize" (beg end))
37(declare-function org-pop-to-buffer-same-window
38 "org-compat" (&optional buffer-or-name norecord label))
39 37
40(defgroup org-export-html nil 38(defgroup org-export-html nil
41 "Options specific for HTML export of Org-mode files." 39 "Options specific for HTML export of Org-mode files."
@@ -2265,7 +2263,7 @@ that uses these same face definitions."
2265 (when (and (symbolp f) (or (not i) (not (listp i)))) 2263 (when (and (symbolp f) (or (not i) (not (listp i))))
2266 (insert (org-add-props (copy-sequence "1") nil 'face f)))) 2264 (insert (org-add-props (copy-sequence "1") nil 'face f))))
2267 (htmlize-region (point-min) (point-max)))) 2265 (htmlize-region (point-min) (point-max))))
2268 (org-pop-to-buffer-same-window "*html*") 2266 (switch-to-buffer "*html*")
2269 (goto-char (point-min)) 2267 (goto-char (point-min))
2270 (if (re-search-forward "<style" nil t) 2268 (if (re-search-forward "<style" nil t)
2271 (delete-region (point-min) (match-beginning 0))) 2269 (delete-region (point-min) (match-beginning 0)))
diff --git a/lisp/org/org-id.el b/lisp/org/org-id.el
index c840d5aeb75..c2d5cf0f25b 100644
--- a/lisp/org/org-id.el
+++ b/lisp/org/org-id.el
@@ -74,8 +74,6 @@
74(require 'org) 74(require 'org)
75 75
76(declare-function message-make-fqdn "message" ()) 76(declare-function message-make-fqdn "message" ())
77(declare-function org-pop-to-buffer-same-window
78 "org-compat" (&optional buffer-or-name norecord label))
79 77
80;;; Customization 78;;; Customization
81 79
@@ -255,7 +253,7 @@ Move the cursor to that entry in that buffer."
255 (let ((m (org-id-find id 'marker))) 253 (let ((m (org-id-find id 'marker)))
256 (unless m 254 (unless m
257 (error "Cannot find entry with ID \"%s\"" id)) 255 (error "Cannot find entry with ID \"%s\"" id))
258 (org-pop-to-buffer-same-window (marker-buffer m)) 256 (switch-to-buffer (marker-buffer m))
259 (goto-char m) 257 (goto-char m)
260 (move-marker m nil) 258 (move-marker m nil)
261 (org-show-context))) 259 (org-show-context)))
diff --git a/lisp/org/org-irc.el b/lisp/org/org-irc.el
index c604858b28c..7a84d2053ad 100644
--- a/lisp/org/org-irc.el
+++ b/lisp/org/org-irc.el
@@ -60,8 +60,6 @@
60(declare-function erc-server-buffer "erc" ()) 60(declare-function erc-server-buffer "erc" ())
61(declare-function erc-get-server-nickname-list "erc" ()) 61(declare-function erc-get-server-nickname-list "erc" ())
62(declare-function erc-cmd-JOIN "erc" (channel &optional key)) 62(declare-function erc-cmd-JOIN "erc" (channel &optional key))
63(declare-function org-pop-to-buffer-same-window
64 "org-compat" (&optional buffer-or-name norecord label))
65 63
66(defvar org-irc-client 'erc 64(defvar org-irc-client 'erc
67 "The IRC client to act on.") 65 "The IRC client to act on.")
@@ -234,7 +232,7 @@ default."
234 (throw 'found x)))))) 232 (throw 'found x))))))
235 (if chan-buf 233 (if chan-buf
236 (progn 234 (progn
237 (org-pop-to-buffer-same-window chan-buf) 235 (switch-to-buffer chan-buf)
238 ;; if we got a nick, and they're in the chan, 236 ;; if we got a nick, and they're in the chan,
239 ;; then start a chat with them 237 ;; then start a chat with them
240 (let ((nick (pop link))) 238 (let ((nick (pop link)))
@@ -245,9 +243,9 @@ default."
245 (insert (concat nick ": "))) 243 (insert (concat nick ": ")))
246 (error "%s not found in %s" nick chan-name))))) 244 (error "%s not found in %s" nick chan-name)))))
247 (progn 245 (progn
248 (org-pop-to-buffer-same-window server-buffer) 246 (switch-to-buffer server-buffer)
249 (erc-cmd-JOIN chan-name)))) 247 (erc-cmd-JOIN chan-name))))
250 (org-pop-to-buffer-same-window server-buffer))) 248 (switch-to-buffer server-buffer)))
251 ;; no server match, make new connection 249 ;; no server match, make new connection
252 (erc-select :server server :port port)))) 250 (erc-select :server server :port port))))
253 251
diff --git a/lisp/org/org-mobile.el b/lisp/org/org-mobile.el
index df01ee44f7d..f270419877e 100644
--- a/lisp/org/org-mobile.el
+++ b/lisp/org/org-mobile.el
@@ -38,9 +38,6 @@
38 38
39(eval-when-compile (require 'cl)) 39(eval-when-compile (require 'cl))
40 40
41(declare-function org-pop-to-buffer-same-window
42 "org-compat" (&optional buffer-or-name norecord label))
43
44(defgroup org-mobile nil 41(defgroup org-mobile nil
45 "Options concerning support for a viewer/editor on a mobile device." 42 "Options concerning support for a viewer/editor on a mobile device."
46 :tag "Org Mobile" 43 :tag "Org Mobile"
@@ -912,7 +909,7 @@ If BEG and END are given, only do this in that region."
912 (buffer-file-name (current-buffer)))))) 909 (buffer-file-name (current-buffer))))))
913 (error (setq org-mobile-error msg)))) 910 (error (setq org-mobile-error msg))))
914 (when org-mobile-error 911 (when org-mobile-error
915 (org-pop-to-buffer-same-window (marker-buffer marker)) 912 (switch-to-buffer (marker-buffer marker))
916 (goto-char marker) 913 (goto-char marker)
917 (incf cnt-error) 914 (incf cnt-error)
918 (insert (if (stringp (nth 1 org-mobile-error)) 915 (insert (if (stringp (nth 1 org-mobile-error))
diff --git a/lisp/org/org-publish.el b/lisp/org/org-publish.el
index 05f82c154e5..ddb3cf7b63a 100644
--- a/lisp/org/org-publish.el
+++ b/lisp/org/org-publish.el
@@ -369,8 +369,6 @@ This is a compatibility function for Emacsen without `delete-dups'."
369 369
370(declare-function org-publish-delete-dups "org-publish" (list)) 370(declare-function org-publish-delete-dups "org-publish" (list))
371(declare-function find-lisp-find-files "find-lisp" (directory regexp)) 371(declare-function find-lisp-find-files "find-lisp" (directory regexp))
372(declare-function org-pop-to-buffer-same-window
373 "org-compat" (&optional buffer-or-name norecord label))
374 372
375;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 373;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
376;;; Getting project information out of org-publish-project-alist 374;;; Getting project information out of org-publish-project-alist
@@ -561,7 +559,7 @@ PUB-DIR is the publishing directory."
561 (make-directory pub-dir t)) 559 (make-directory pub-dir t))
562 (let ((visiting (find-buffer-visiting filename))) 560 (let ((visiting (find-buffer-visiting filename)))
563 (save-excursion 561 (save-excursion
564 (org-pop-to-buffer-same-window (or visiting (find-file filename))) 562 (switch-to-buffer (or visiting (find-file filename)))
565 (let* ((plist (cons :buffer-will-be-killed (cons t plist))) 563 (let* ((plist (cons :buffer-will-be-killed (cons t plist)))
566 (init-buf (current-buffer)) 564 (init-buf (current-buffer))
567 (init-point (point)) 565 (init-point (point))
@@ -862,7 +860,7 @@ system's modification time.
862It returns time in `current-time' format." 860It returns time in `current-time' format."
863 (let ((visiting (find-buffer-visiting file))) 861 (let ((visiting (find-buffer-visiting file)))
864 (save-excursion 862 (save-excursion
865 (org-pop-to-buffer-same-window (or visiting (find-file-noselect file nil t))) 863 (switch-to-buffer (or visiting (find-file-noselect file nil t)))
866 (let* ((plist (org-infile-export-plist)) 864 (let* ((plist (org-infile-export-plist))
867 (date (plist-get plist :date))) 865 (date (plist-get plist :date)))
868 (unless visiting 866 (unless visiting
diff --git a/lisp/org/org-remember.el b/lisp/org/org-remember.el
index 0eb4f899e14..2bc5ef92ae7 100644
--- a/lisp/org/org-remember.el
+++ b/lisp/org/org-remember.el
@@ -40,8 +40,6 @@
40(declare-function remember "remember" (&optional initial)) 40(declare-function remember "remember" (&optional initial))
41(declare-function remember-buffer-desc "remember" ()) 41(declare-function remember-buffer-desc "remember" ())
42(declare-function remember-finalize "remember" ()) 42(declare-function remember-finalize "remember" ())
43(declare-function org-pop-to-buffer-same-window
44 "org-compat" (&optional buffer-or-name norecord label))
45 43
46(defvar remember-save-after-remembering) 44(defvar remember-save-after-remembering)
47(defvar remember-register) 45(defvar remember-register)
@@ -788,7 +786,7 @@ The user is queried for the template."
788 (setq heading org-remember-default-headline)) 786 (setq heading org-remember-default-headline))
789 (setq visiting (org-find-base-buffer-visiting file)) 787 (setq visiting (org-find-base-buffer-visiting file))
790 (if (not visiting) (find-file-noselect file)) 788 (if (not visiting) (find-file-noselect file))
791 (org-pop-to-buffer-same-window (or visiting (get-file-buffer file))) 789 (switch-to-buffer (or visiting (get-file-buffer file)))
792 (widen) 790 (widen)
793 (goto-char (point-min)) 791 (goto-char (point-min))
794 (if (re-search-forward 792 (if (re-search-forward
diff --git a/lisp/org/org-src.el b/lisp/org/org-src.el
index dd56b120219..5de55fa455f 100644
--- a/lisp/org/org-src.el
+++ b/lisp/org/org-src.el
@@ -42,8 +42,6 @@
42(declare-function org-at-table.el-p "org" ()) 42(declare-function org-at-table.el-p "org" ())
43(declare-function org-get-indentation "org" (&optional line)) 43(declare-function org-get-indentation "org" (&optional line))
44(declare-function org-switch-to-buffer-other-window "org" (&rest args)) 44(declare-function org-switch-to-buffer-other-window "org" (&rest args))
45(declare-function org-pop-to-buffer-same-window
46 "org-compat" (&optional buffer-or-name norecord label))
47 45
48(defcustom org-edit-src-region-extra nil 46(defcustom org-edit-src-region-extra nil
49 "Additional regexps to identify regions for editing with `org-edit-src-code'. 47 "Additional regexps to identify regions for editing with `org-edit-src-code'.
@@ -341,7 +339,7 @@ buffer."
341(defun org-src-switch-to-buffer (buffer context) 339(defun org-src-switch-to-buffer (buffer context)
342 (case org-src-window-setup 340 (case org-src-window-setup
343 ('current-window 341 ('current-window
344 (org-pop-to-buffer-same-window buffer)) 342 (switch-to-buffer buffer))
345 ('other-window 343 ('other-window
346 (switch-to-buffer-other-window buffer)) 344 (switch-to-buffer-other-window buffer))
347 ('other-frame 345 ('other-frame
@@ -352,7 +350,7 @@ buffer."
352 (delete-frame frame))) 350 (delete-frame frame)))
353 ('save 351 ('save
354 (kill-buffer (current-buffer)) 352 (kill-buffer (current-buffer))
355 (org-pop-to-buffer-same-window buffer)) 353 (switch-to-buffer buffer))
356 (t 354 (t
357 (switch-to-buffer-other-frame buffer)))) 355 (switch-to-buffer-other-frame buffer))))
358 ('reorganize-frame 356 ('reorganize-frame
@@ -364,7 +362,7 @@ buffer."
364 (t 362 (t
365 (message "Invalid value %s for org-src-window-setup" 363 (message "Invalid value %s for org-src-window-setup"
366 (symbol-name org-src-window-setup)) 364 (symbol-name org-src-window-setup))
367 (org-pop-to-buffer-same-window buffer)))) 365 (switch-to-buffer buffer))))
368 366
369(defun org-src-construct-edit-buffer-name (org-buffer-name lang) 367(defun org-src-construct-edit-buffer-name (org-buffer-name lang)
370 "Construct the buffer name for a source editing buffer." 368 "Construct the buffer name for a source editing buffer."
@@ -424,7 +422,7 @@ the fragment in the Org-mode buffer."
424 begline (save-excursion (goto-char beg) (org-current-line))) 422 begline (save-excursion (goto-char beg) (org-current-line)))
425 (if (and (setq buffer (org-edit-src-find-buffer beg end)) 423 (if (and (setq buffer (org-edit-src-find-buffer beg end))
426 (y-or-n-p "Return to existing edit buffer? [n] will revert changes: ")) 424 (y-or-n-p "Return to existing edit buffer? [n] will revert changes: "))
427 (org-pop-to-buffer-same-window buffer) 425 (switch-to-buffer buffer)
428 (when buffer 426 (when buffer
429 (with-current-buffer buffer 427 (with-current-buffer buffer
430 (if (boundp 'org-edit-src-overlay) 428 (if (boundp 'org-edit-src-overlay)
@@ -444,7 +442,7 @@ the fragment in the Org-mode buffer."
444 (define-key map [mouse-1] 'org-edit-src-continue) 442 (define-key map [mouse-1] 'org-edit-src-continue)
445 map)) 443 map))
446 (overlay-put ovl :read-only "Leave me alone") 444 (overlay-put ovl :read-only "Leave me alone")
447 (org-pop-to-buffer-same-window buffer) 445 (switch-to-buffer buffer)
448 (insert code) 446 (insert code)
449 (remove-text-properties (point-min) (point-max) 447 (remove-text-properties (point-min) (point-max)
450 '(display nil invisible nil intangible nil)) 448 '(display nil invisible nil intangible nil))
diff --git a/lisp/org/org.el b/lisp/org/org.el
index 341525537bb..d494bdb28fa 100644
--- a/lisp/org/org.el
+++ b/lisp/org/org.el
@@ -105,7 +105,6 @@
105(declare-function org-inlinetask-at-task-p "org-inlinetask" ()) 105(declare-function org-inlinetask-at-task-p "org-inlinetask" ())
106(declare-function org-inlinetask-outline-regexp "org-inlinetask" ()) 106(declare-function org-inlinetask-outline-regexp "org-inlinetask" ())
107(declare-function org-inlinetask-toggle-visibility "org-inlinetask" ()) 107(declare-function org-inlinetask-toggle-visibility "org-inlinetask" ())
108(declare-function org-pop-to-buffer-same-window "org-compat" (&optional buffer-or-name norecord label))
109(declare-function org-at-clock-log-p "org-clock" ()) 108(declare-function org-at-clock-log-p "org-clock" ())
110(declare-function org-clock-timestamps-up "org-clock" ()) 109(declare-function org-clock-timestamps-up "org-clock" ())
111(declare-function org-clock-timestamps-down "org-clock" ()) 110(declare-function org-clock-timestamps-down "org-clock" ())
@@ -6651,7 +6650,7 @@ or nil."
6651 (save-window-excursion 6650 (save-window-excursion
6652 (delete-other-windows) 6651 (delete-other-windows)
6653 (and (get-buffer "*org-goto*") (kill-buffer "*org-goto*")) 6652 (and (get-buffer "*org-goto*") (kill-buffer "*org-goto*"))
6654 (org-pop-to-buffer-same-window 6653 (switch-to-buffer
6655 (condition-case nil 6654 (condition-case nil
6656 (make-indirect-buffer (current-buffer) "*org-goto*") 6655 (make-indirect-buffer (current-buffer) "*org-goto*")
6657 (error (make-indirect-buffer (current-buffer) "*org-goto*")))) 6656 (error (make-indirect-buffer (current-buffer) "*org-goto*"))))
@@ -6789,7 +6788,7 @@ frame is not changed."
6789 (and arg (eq org-indirect-buffer-display 'dedicated-frame))) 6788 (and arg (eq org-indirect-buffer-display 'dedicated-frame)))
6790 (select-frame (make-frame)) 6789 (select-frame (make-frame))
6791 (delete-other-windows) 6790 (delete-other-windows)
6792 (org-pop-to-buffer-same-window ibuf) 6791 (switch-to-buffer ibuf)
6793 (org-set-frame-title heading)) 6792 (org-set-frame-title heading))
6794 ((eq org-indirect-buffer-display 'dedicated-frame) 6793 ((eq org-indirect-buffer-display 'dedicated-frame)
6795 (raise-frame 6794 (raise-frame
@@ -6798,10 +6797,10 @@ frame is not changed."
6798 org-indirect-dedicated-frame) 6797 org-indirect-dedicated-frame)
6799 (setq org-indirect-dedicated-frame (make-frame))))) 6798 (setq org-indirect-dedicated-frame (make-frame)))))
6800 (delete-other-windows) 6799 (delete-other-windows)
6801 (org-pop-to-buffer-same-window ibuf) 6800 (switch-to-buffer ibuf)
6802 (org-set-frame-title (concat "Indirect: " heading))) 6801 (org-set-frame-title (concat "Indirect: " heading)))
6803 ((eq org-indirect-buffer-display 'current-window) 6802 ((eq org-indirect-buffer-display 'current-window)
6804 (org-pop-to-buffer-same-window ibuf)) 6803 (switch-to-buffer ibuf))
6805 ((eq org-indirect-buffer-display 'other-window) 6804 ((eq org-indirect-buffer-display 'other-window)
6806 (pop-to-buffer ibuf)) 6805 (pop-to-buffer ibuf))
6807 (t (error "Invalid value"))) 6806 (t (error "Invalid value")))
@@ -9833,7 +9832,7 @@ onto the ring."
9833 (setq p org-mark-ring)) 9832 (setq p org-mark-ring))
9834 (setq org-mark-ring-last-goto p) 9833 (setq org-mark-ring-last-goto p)
9835 (setq m (car p)) 9834 (setq m (car p))
9836 (org-pop-to-buffer-same-window (marker-buffer m)) 9835 (switch-to-buffer (marker-buffer m))
9837 (goto-char m) 9836 (goto-char m)
9838 (if (or (outline-invisible-p) (org-invisible-p2)) (org-show-context 'mark-goto)))) 9837 (if (or (outline-invisible-p) (org-invisible-p2)) (org-show-context 'mark-goto))))
9839 9838
@@ -10429,7 +10428,7 @@ prefix argument (`C-u C-u C-u C-c C-w')."
10429 (find-file-noselect file))) 10428 (find-file-noselect file)))
10430 (if goto 10429 (if goto
10431 (progn 10430 (progn
10432 (org-pop-to-buffer-same-window nbuf) 10431 (switch-to-buffer nbuf)
10433 (goto-char pos) 10432 (goto-char pos)
10434 (org-show-context 'org-goto)) 10433 (org-show-context 'org-goto))
10435 (if regionp 10434 (if regionp
@@ -12041,7 +12040,7 @@ EXTRA is additional text that will be inserted into the notes buffer."
12041 (setq org-log-note-window-configuration (current-window-configuration)) 12040 (setq org-log-note-window-configuration (current-window-configuration))
12042 (delete-other-windows) 12041 (delete-other-windows)
12043 (move-marker org-log-note-return-to (point)) 12042 (move-marker org-log-note-return-to (point))
12044 (org-pop-to-buffer-same-window (marker-buffer org-log-note-marker)) 12043 (switch-to-buffer (marker-buffer org-log-note-marker))
12045 (goto-char org-log-note-marker) 12044 (goto-char org-log-note-marker)
12046 (org-switch-to-buffer-other-window "*Org Note*") 12045 (org-switch-to-buffer-other-window "*Org Note*")
12047 (erase-buffer) 12046 (erase-buffer)
@@ -15883,7 +15882,7 @@ changes from another. I believe the procedure must be like this:
15883 (lambda (b) 15882 (lambda (b)
15884 (when (and (with-current-buffer b (org-mode-p)) 15883 (when (and (with-current-buffer b (org-mode-p))
15885 (with-current-buffer b buffer-file-name)) 15884 (with-current-buffer b buffer-file-name))
15886 (org-pop-to-buffer-same-window b) 15885 (switch-to-buffer b)
15887 (revert-buffer t 'no-confirm))) 15886 (revert-buffer t 'no-confirm)))
15888 (buffer-list)) 15887 (buffer-list))
15889 (when (and (featurep 'org-id) org-id-track-globally) 15888 (when (and (featurep 'org-id) org-id-track-globally)
@@ -15907,7 +15906,7 @@ Set `org-completion-use-ido' to make it use ido instead."
15907 (org-completion-use-ido org-completion-use-ido)) 15906 (org-completion-use-ido org-completion-use-ido))
15908 (unless (or org-completion-use-ido org-completion-use-iswitchb) 15907 (unless (or org-completion-use-ido org-completion-use-iswitchb)
15909 (setq org-completion-use-iswitchb t)) 15908 (setq org-completion-use-iswitchb t))
15910 (org-pop-to-buffer-same-window 15909 (switch-to-buffer
15911 (org-icompleting-read "Org buffer: " 15910 (org-icompleting-read "Org buffer: "
15912 (mapcar 'list (mapcar 'buffer-name blist)) 15911 (mapcar 'list (mapcar 'buffer-name blist))
15913 nil t)))) 15912 nil t))))
@@ -16074,7 +16073,7 @@ If the current buffer does not, find the first agenda file."
16074 (find-file (car files)) 16073 (find-file (car files))
16075 (throw 'exit t)))) 16074 (throw 'exit t))))
16076 (find-file (car fs))) 16075 (find-file (car fs)))
16077 (if (buffer-base-buffer) (org-pop-to-buffer-same-window (buffer-base-buffer))))) 16076 (if (buffer-base-buffer) (switch-to-buffer (buffer-base-buffer)))))
16078 16077
16079(defun org-agenda-file-to-front (&optional to-end) 16078(defun org-agenda-file-to-front (&optional to-end)
16080 "Move/add the current file to the top of the agenda file list. 16079 "Move/add the current file to the top of the agenda file list.
@@ -18511,7 +18510,7 @@ information about your Org-mode version and configuration."
18511 (org-version) 18510 (org-version)
18512 (let (list) 18511 (let (list)
18513 (save-window-excursion 18512 (save-window-excursion
18514 (org-pop-to-buffer-same-window (get-buffer-create "*Warn about privacy*")) 18513 (switch-to-buffer (get-buffer-create "*Warn about privacy*"))
18515 (delete-other-windows) 18514 (delete-other-windows)
18516 (erase-buffer) 18515 (erase-buffer)
18517 (insert "You are about to submit a bug report to the Org-mode mailing list. 18516 (insert "You are about to submit a bug report to the Org-mode mailing list.
@@ -18708,7 +18707,7 @@ With prefix arg UNCOMPILED, load the uncompiled versions."
18708 (if (and marker (marker-buffer marker) 18707 (if (and marker (marker-buffer marker)
18709 (buffer-live-p (marker-buffer marker))) 18708 (buffer-live-p (marker-buffer marker)))
18710 (progn 18709 (progn
18711 (org-pop-to-buffer-same-window (marker-buffer marker)) 18710 (switch-to-buffer (marker-buffer marker))
18712 (if (or (> marker (point-max)) (< marker (point-min))) 18711 (if (or (> marker (point-max)) (< marker (point-min)))
18713 (widen)) 18712 (widen))
18714 (goto-char marker) 18713 (goto-char marker)
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 79fec080d57..5f99cfe0028 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -2413,7 +2413,7 @@ and overlay is highlighted between MK and END-MK."
2413 ;; display the source in another window. 2413 ;; display the source in another window.
2414 (let ((pop-up-windows t)) 2414 (let ((pop-up-windows t))
2415 (pop-to-buffer (marker-buffer mk) 'other-window)) 2415 (pop-to-buffer (marker-buffer mk) 'other-window))
2416 (pop-to-buffer-same-window (marker-buffer mk))) 2416 (switch-to-buffer (marker-buffer mk)))
2417 (unless (eq (goto-char mk) (point)) 2417 (unless (eq (goto-char mk) (point))
2418 ;; If narrowing gets in the way of going to the right place, widen. 2418 ;; If narrowing gets in the way of going to the right place, widen.
2419 (widen) 2419 (widen)
diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el
index a660bdb6488..0383251523f 100644
--- a/lisp/textmodes/bibtex.el
+++ b/lisp/textmodes/bibtex.el
@@ -3060,7 +3060,7 @@ When called interactively, FORCE is t, CURRENT is t if current buffer uses
3060 ;; select BibTeX buffer 3060 ;; select BibTeX buffer
3061 (if select 3061 (if select
3062 (if buffer-list 3062 (if buffer-list
3063 (pop-to-buffer-same-window 3063 (switch-to-buffer
3064 (completing-read "Switch to BibTeX buffer: " 3064 (completing-read "Switch to BibTeX buffer: "
3065 (mapcar 'buffer-name buffer-list) 3065 (mapcar 'buffer-name buffer-list)
3066 nil t 3066 nil t
diff --git a/lisp/view.el b/lisp/view.el
index 96fecd9df1c..11cbc79449f 100644
--- a/lisp/view.el
+++ b/lisp/view.el
@@ -318,7 +318,7 @@ EXIT-ACTION to `kill-buffer-if-not-modified' avoids this."
318 (progn 318 (progn
319 (switch-to-buffer buffer) 319 (switch-to-buffer buffer)
320 (message "Not using View mode because the major mode is special")) 320 (message "Not using View mode because the major mode is special"))
321 (pop-to-buffer-same-window buffer) 321 (switch-to-buffer buffer)
322 (view-mode-enter nil exit-action))) 322 (view-mode-enter nil exit-action)))
323 323
324;;;###autoload 324;;;###autoload
diff --git a/lisp/window.el b/lisp/window.el
index 8bdf4131c51..d078fbec35d 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -4584,7 +4584,8 @@ frame (actually the last non-minibuffer frame), except if
4584case check all visible or iconified frames. Otherwise, FRAME can 4584case check all visible or iconified frames. Otherwise, FRAME can
4585be a specific frame, `visible' (all visible frames), 0 (all 4585be a specific frame, `visible' (all visible frames), 0 (all
4586frames on the current terminal), or t (all frames)." 4586frames on the current terminal), or t (all frames)."
4587 (interactive "BDisplay buffer:\nP") 4587 (interactive (list (read-buffer "Display buffer: " (other-buffer))
4588 (if current-prefix-arg t)))
4588 (let ((buffer (window-normalize-buffer-to-display buffer-or-name)) 4589 (let ((buffer (window-normalize-buffer-to-display buffer-or-name))
4589 ;; Handle the old form of the first argument. 4590 ;; Handle the old form of the first argument.
4590 (inhibit-same-window (and action (not (listp action))))) 4591 (inhibit-same-window (and action (not (listp action)))))
@@ -4609,7 +4610,7 @@ frames on the current terminal), or t (all frames)."
4609 (functions (apply 'append 4610 (functions (apply 'append
4610 (mapcar (lambda (x) 4611 (mapcar (lambda (x)
4611 (setq x (car x)) 4612 (setq x (car x))
4612 (if (listp x) x (list x))) 4613 (if (functionp x) (list x) x))
4613 actions))) 4614 actions)))
4614 (alist (apply 'append (mapcar 'cdr actions))) 4615 (alist (apply 'append (mapcar 'cdr actions)))
4615 window) 4616 window)
@@ -4822,70 +4823,42 @@ return the window. If no suitable window is found, return nil."
4822 4823
4823;;; Display + selection commands: 4824;;; Display + selection commands:
4824 4825
4825(defun pop-to-buffer (buffer-or-name &optional other-window norecord) 4826(defun pop-to-buffer (buffer &optional action norecord)
4826 "Select buffer BUFFER-OR-NAME in some window, preferably a different one. 4827 "Select buffer BUFFER in some window, preferably a different one.
4827BUFFER-OR-NAME may be a buffer, a string \(a buffer name), or 4828BUFFER may be a buffer, a string (a buffer name), or nil. If it
4828nil. If BUFFER-OR-NAME is a string not naming an existent 4829is a string not naming an existent buffer, create a buffer with
4829buffer, create a buffer with that name. If BUFFER-OR-NAME is 4830that name. If BUFFER is nil, choose some other buffer. Return
4830nil, choose some other buffer. 4831the buffer.
4831 4832
4832If `pop-up-windows' is non-nil, windows can be split to display 4833This uses `display-buffer' as a subroutine. The optional ACTION
4833the buffer. If optional second arg OTHER-WINDOW is non-nil, 4834argument is passed to `display-buffer' as its ACTION argument.
4834insist on finding another window even if the specified buffer is 4835See `display-buffer' for more information. ACTION is t if called
4835already visible in the selected window, and ignore 4836interactively with a prefix argument, which means to pop to a
4836`same-window-regexps' and `same-window-buffer-names'. 4837window other than the selected one even if the buffer is already
4837 4838displayed in the selected window.
4838If the window to show BUFFER-OR-NAME is not on the selected 4839
4840If the window to show BUFFER is not on the selected
4839frame, raise that window's frame and give it input focus. 4841frame, raise that window's frame and give it input focus.
4840 4842
4841This function returns the buffer it switched to. This uses the
4842function `display-buffer' as a subroutine; see the documentation
4843of `display-buffer' for additional customization information.
4844
4845Optional third arg NORECORD non-nil means do not put this buffer 4843Optional third arg NORECORD non-nil means do not put this buffer
4846at the front of the list of recently selected ones." 4844at the front of the list of recently selected ones."
4847 (interactive "BPop to buffer:\nP") 4845 (interactive (list (read-buffer "Pop to buffer: " (other-buffer))
4848 (pop-to-buffer-1 buffer-or-name (if other-window t nil) norecord)) 4846 (if current-prefix-arg t)))
4849 4847 (setq buffer (window-normalize-buffer-to-display
4850(defun pop-to-buffer-same-window (&optional buffer-or-name norecord) 4848 ;; BUFFER nil means another buffer.
4851 "Pop to buffer specified by BUFFER-OR-NAME in the selected window. 4849 (or buffer (other-buffer))))
4852Another window will be used only if the buffer can't be shown in 4850 (set-buffer buffer)
4853the selected window, usually because it is dedicated to another 4851 (let* ((old-window (selected-window))
4854buffer. Optional arguments BUFFER-OR-NAME and NORECORD are as 4852 (old-frame (selected-frame))
4855for `pop-to-buffer'." 4853 (window (display-buffer (current-buffer) action))
4856 (interactive "BPop to buffer in selected window:\nP") 4854 (frame (window-frame window)))
4857 (pop-to-buffer-1 buffer-or-name 'same-window norecord)) 4855 (if (eq frame old-frame)
4858 4856 ;; Make sure new window is selected (Bug#8615), (Bug#6954).
4859(defun pop-to-buffer-1 (buffer-or-name window-choice norecord) 4857 (select-window window norecord)
4860 (set-buffer (window-normalize-buffer-to-display 4858 ;; If `display-buffer' has chosen another frame, make sure it
4861 ;; BUFFER-OR-NAME nil means another buffer. 4859 ;; gets input focus.
4862 (or buffer-or-name 4860 (select-frame-set-input-focus frame norecord))
4863 (other-buffer (current-buffer))))) 4861 buffer))
4864 (let ((old-window (selected-window))
4865 (old-frame (selected-frame))
4866 (same-window-buffer-names same-window-buffer-names)
4867 (same-window-regexps same-window-regexps))
4868 (if (eq window-choice t)
4869 (setq same-window-buffer-names nil
4870 same-window-regexps nil))
4871 (let* ((action
4872 ;; Based on the WINDOW-CHOICE argument, choose an action
4873 ;; argument to pass to `display-buffer'.
4874 (cond
4875 ((eq window-choice 'same-window)
4876 '((display-buffer-reuse-selected-window
4877 display-buffer-same-window)))
4878 (window-choice
4879 '(nil (inhibit-same-window . t)))))
4880 (window (display-buffer (current-buffer) action))
4881 (frame (window-frame window)))
4882 (if (eq frame old-frame)
4883 ;; Make sure new window gets selected (Bug#8615), (Bug#6954).
4884 (select-window window norecord)
4885 ;; If `display-buffer' has chosen another frame, make sure it
4886 ;; gets input focus.
4887 (select-frame-set-input-focus frame norecord))
4888 (current-buffer))))
4889 4862
4890(defun read-buffer-to-switch (prompt) 4863(defun read-buffer-to-switch (prompt)
4891 "Read the name of a buffer to switch to, prompting with PROMPT. 4864 "Read the name of a buffer to switch to, prompting with PROMPT.