Commit c3313451 authored by Chong Yidong's avatar Chong Yidong
Browse files

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)
* lisp/org/org-agenda.el (org-prepare-agenda, org-agenda-switch-to):
* lisp/org/org-capture.el (org-capture-goto-target)
* 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.
parent 81ec0c88
2011-09-02 Chong Yidong <>
* 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.
* abbrev.el (edit-abbrevs):
* arc-mode.el (archive-extract):
* autoinsert.el (auto-insert):
* bookmark.el (bookmark-bmenu-list):
* files.el (find-file):
* view.el (view-buffer):
* progmodes/compile.el (compilation-goto-locus):
* textmodes/bibtex.el (bibtex-initialize): Use switch-to-buffer.
2011-09-02 Chong Yidong <>
* window.el (display-buffer-alist): Doc fix.
......@@ -159,7 +159,7 @@ where NAME and EXPANSION are strings with quotes,
USECOUNT is an integer, and HOOK is any valid function
or may be omitted (it is usually omitted)."
(pop-to-buffer-same-window (prepare-abbrev-list-buffer)))
(switch-to-buffer (prepare-abbrev-list-buffer)))
(defun edit-abbrevs-redefine ()
"Redefine abbrevs according to current buffer contents."
......@@ -1083,7 +1083,7 @@ using `make-temp-file', and the generated name is returned."
(view-buffer buffer (and just-created 'kill-buffer-if-not-modified)))
((eq other-window-p 'display) (display-buffer buffer))
(other-window-p (switch-to-buffer-other-window buffer))
(t (pop-to-buffer-same-window buffer))))))
(t (switch-to-buffer buffer))))))
(defun archive-*-extract (archive name command)
(let* ((default-directory (file-name-as-directory archive-tmpdir))
......@@ -360,7 +360,7 @@ Matches the visited file name against the elements of `auto-insert-alist'."
;; make buffer visible before skeleton or function
;; which might ask the user for something
(pop-to-buffer-same-window (current-buffer))
(switch-to-buffer (current-buffer))
(if (and (consp action)
(not (eq (car action) 'lambda)))
(skeleton-insert action)
......@@ -1539,7 +1539,7 @@ deletion, or > if it is flagged for displaying."
(let ((buf (get-buffer-create "*Bookmark List*")))
(if (called-interactively-p 'interactive)
(pop-to-buffer-same-window buf)
(switch-to-buffer buf)
(set-buffer buf)))
(let ((inhibit-read-only t))
......@@ -1342,8 +1342,8 @@ automatically choosing a major mode, use \\[find-file-literally]."
(let ((value (find-file-noselect filename nil nil wildcards)))
(if (listp value)
(mapcar #'pop-to-buffer-same-window (nreverse value))
(pop-to-buffer-same-window value))))
(mapcar 'switch-to-buffer (nreverse value))
(switch-to-buffer value))))
(defun find-file-other-window (filename &optional wildcards)
"Edit file FILENAME, in another window.
2011-09-02 Chong Yidong <>
* org-compat.el (org-pop-to-buffer-same-window): Deleted.
* ob-ref.el (org-babel-ref-goto-headline-id):
* 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-agenda.el (org-prepare-agenda, org-agenda-switch-to):
* org-capture.el (org-capture-goto-target)
* org-clock.el (org-clock-goto):
* org-ctags.el (org-ctags-visit-buffer-or-file):
* org-exp.el (org-export-as-org):
* org-feed.el (org-feed-show-raw-feed):
* org-html.el (org-export-htmlize-generate-css):
* org-id.el (org-id-goto):
* org-irc.el (org-irc-visit-erc):
* org-mobile.el (org-mobile-apply):
* org-publish.el (org-publish-org-to, org-publish-find-date):
* org-remember.el (org-go-to-remember-target):
* org-src.el (org-src-switch-to-buffer)
(org-edit-fixed-width-region): Use switch-to-buffer.
2011-08-31 Martin Rudalics <>
* org-compat.el (org-pop-to-buffer-same-window): Remove LABEL
......@@ -61,8 +61,6 @@
(declare-function org-narrow-to-subtree "org" ())
(declare-function org-id-find-id-in-file "org-id" (id file &optional markerp))
(declare-function org-show-context "org" (&optional key))
(declare-function org-pop-to-buffer-same-window
"org-compat" (&optional buffer-or-name norecord label))
(defvar org-babel-ref-split-regexp
"[ \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."
(m (when file (org-id-find-id-in-file id file 'marker))))
(when (and file m)
(message "file:%S" file)
(org-pop-to-buffer-same-window (marker-buffer m))
(switch-to-buffer (marker-buffer m))
(goto-char m)
(move-marker m nil)
......@@ -60,8 +60,6 @@
(declare-function org-is-habit-p "org-habit" (&optional pom))
(declare-function org-habit-parse-todo "org-habit" (&optional pom))
(declare-function org-habit-get-priority "org-habit" (habit &optional moment))
(declare-function org-pop-to-buffer-same-window "org-compat"
(&optional buffer-or-name norecord label))
(defvar calendar-mode-map)
(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.")
(awin (select-window awin))
((not (setq org-pre-agenda-window-conf (current-window-configuration))))
((equal org-agenda-window-setup 'current-window)
(org-pop-to-buffer-same-window abuf))
(switch-to-buffer abuf))
((equal org-agenda-window-setup 'other-window)
(org-switch-to-buffer-other-window abuf))
((equal org-agenda-window-setup 'other-frame)
......@@ -3078,7 +3076,7 @@ the global options and expect it to be applied to the entire view.")
;; additional test in case agenda is invoked from within agenda
;; buffer via elisp link
(unless (equal (current-buffer) abuf)
(org-pop-to-buffer-same-window abuf)))
(switch-to-buffer abuf)))
(setq buffer-read-only nil)
(let ((inhibit-read-only t)) (erase-buffer))
......@@ -6972,7 +6970,7 @@ at the text of the entry itself."
(buffer (marker-buffer marker))
(pos (marker-position marker)))
(org-pop-to-buffer-same-window buffer)
(switch-to-buffer buffer)
(and delete-other-windows (delete-other-windows))
(goto-char pos)
......@@ -57,8 +57,6 @@
(date &optional keep-restriction))
(declare-function org-table-get-specials "org-table" ())
(declare-function org-table-goto-line "org-table" (N))
(declare-function org-pop-to-buffer-same-window "org-compat"
(&optional buffer-or-name norecord label))
(defvar org-remember-default-headline)
(defvar org-remember-templates)
......@@ -1201,7 +1199,7 @@ The user is queried for the template."
(error "No capture template selected"))
(org-capture-set-plist entry)
(org-pop-to-buffer-same-window (org-capture-get :buffer))
(switch-to-buffer (org-capture-get :buffer))
(goto-char (org-capture-get :pos))))
(defun org-capture-get-indirect-buffer (&optional buffer prefix)
......@@ -1311,7 +1309,7 @@ The template may still contain \"%?\" for cursor positioning."
(sit-for 1))
(org-pop-to-buffer-same-window (get-buffer-create "*Capture*"))
(switch-to-buffer (get-buffer-create "*Capture*"))
(insert template)
(goto-char (point-min))
......@@ -36,7 +36,6 @@
(declare-function calendar-absolute-from-iso "cal-iso" (&optional date))
(declare-function notifications-notify "notifications" (&rest params))
(declare-function org-pop-to-buffer-same-window "org-compat" (&optional buffer-or-name norecord label))
(defvar org-time-stamp-formats)
(defvar org-ts-what)
......@@ -1498,7 +1497,7 @@ With prefix arg SELECT, offer recently clocked tasks for selection."
(setq recent t)
(car org-clock-history))
(t (error "No active or recent clock task")))))
(org-pop-to-buffer-same-window (marker-buffer m))
(switch-to-buffer (marker-buffer m))
(if (or (< m (point-min)) (> m (point-max))) (widen))
(goto-char m)
......@@ -432,15 +432,6 @@ With two arguments, return floor and remainder of their quotient."
(let ((q (floor x y)))
(list q (- x (if y (* y q) q)))))
;; `pop-to-buffer-same-window' has been introduced with Emacs 24.1.
(defun org-pop-to-buffer-same-window
(&optional buffer-or-name norecord label)
"Pop to buffer specified by BUFFER-OR-NAME in the selected window."
(if (fboundp 'pop-to-buffer-same-window)
'pop-to-buffer-same-window buffer-or-name norecord)
(funcall 'switch-to-buffer buffer-or-name norecord)))
(provide 'org-compat)
......@@ -140,8 +140,6 @@
(require 'org)
(declare-function org-pop-to-buffer-same-window "org-compat" (&optional buffer-or-name norecord label))
(defgroup org-ctags nil
"Options concerning use of ctags within org mode."
:tag "Org-Ctags"
......@@ -387,7 +385,7 @@ the new file."
((get-buffer (concat name ".org"))
;; Buffer is already open
(org-pop-to-buffer-same-window (get-buffer (concat name ".org"))))
(switch-to-buffer (get-buffer (concat name ".org"))))
((file-exists-p filename)
;; File exists but is not open --> open it
(message "Opening existing org file `%S'..."
......@@ -47,8 +47,6 @@
(declare-function org-inlinetask-remove-END-maybe "org-inlinetask" ())
(declare-function org-table-cookie-line-p "org-table" (line))
(declare-function org-table-colgroup-line-p "org-table" (line))
(declare-function org-pop-to-buffer-same-window "org-compat"
(&optional buffer-or-name norecord label))
(autoload 'org-export-generic "org-export-generic" "Export using the generic exporter" t)
......@@ -2974,7 +2972,7 @@ directory."
(region (buffer-string))
(org-pop-to-buffer-same-window buffer)
(switch-to-buffer buffer)
(insert region)
(let ((org-inhibit-startup t)) (org-mode))
......@@ -436,7 +436,7 @@ it can be a list structured like an entry in `org-feed-alist'."
(if (stringp feed) (setq feed (assoc feed org-feed-alist)))
(unless feed
(error "No such feed in `org-feed-alist"))
(org-feed-update feed 'retrieve-only))
(goto-char (point-min)))
......@@ -34,8 +34,6 @@
(declare-function org-id-find-id-file "org-id" (id))
(declare-function htmlize-region "ext:htmlize" (beg end))
(declare-function org-pop-to-buffer-same-window
"org-compat" (&optional buffer-or-name norecord label))
(defgroup org-export-html nil
"Options specific for HTML export of Org-mode files."
......@@ -2265,7 +2263,7 @@ that uses these same face definitions."
(when (and (symbolp f) (or (not i) (not (listp i))))
(insert (org-add-props (copy-sequence "1") nil 'face f))))
(htmlize-region (point-min) (point-max))))
(org-pop-to-buffer-same-window "*html*")
(switch-to-buffer "*html*")
(goto-char (point-min))
(if (re-search-forward "<style" nil t)
(delete-region (point-min) (match-beginning 0)))
......@@ -74,8 +74,6 @@
(require 'org)
(declare-function message-make-fqdn "message" ())
(declare-function org-pop-to-buffer-same-window
"org-compat" (&optional buffer-or-name norecord label))
;;; Customization
......@@ -255,7 +253,7 @@ Move the cursor to that entry in that buffer."
(let ((m (org-id-find id 'marker)))
(unless m
(error "Cannot find entry with ID \"%s\"" id))
(org-pop-to-buffer-same-window (marker-buffer m))
(switch-to-buffer (marker-buffer m))
(goto-char m)
(move-marker m nil)
......@@ -60,8 +60,6 @@
(declare-function erc-server-buffer "erc" ())
(declare-function erc-get-server-nickname-list "erc" ())
(declare-function erc-cmd-JOIN "erc" (channel &optional key))
(declare-function org-pop-to-buffer-same-window
"org-compat" (&optional buffer-or-name norecord label))
(defvar org-irc-client 'erc
"The IRC client to act on.")
......@@ -234,7 +232,7 @@ default."
(throw 'found x))))))
(if chan-buf
(org-pop-to-buffer-same-window chan-buf)
(switch-to-buffer chan-buf)
;; if we got a nick, and they're in the chan,
;; then start a chat with them
(let ((nick (pop link)))
......@@ -245,9 +243,9 @@ default."
(insert (concat nick ": ")))
(error "%s not found in %s" nick chan-name)))))
(org-pop-to-buffer-same-window server-buffer)
(switch-to-buffer server-buffer)
(erc-cmd-JOIN chan-name))))
(org-pop-to-buffer-same-window server-buffer)))
(switch-to-buffer server-buffer)))
;; no server match, make new connection
(erc-select :server server :port port))))
......@@ -38,9 +38,6 @@
(eval-when-compile (require 'cl))
(declare-function org-pop-to-buffer-same-window
"org-compat" (&optional buffer-or-name norecord label))
(defgroup org-mobile nil
"Options concerning support for a viewer/editor on a mobile device."
:tag "Org Mobile"
......@@ -912,7 +909,7 @@ If BEG and END are given, only do this in that region."
(buffer-file-name (current-buffer))))))
(error (setq org-mobile-error msg))))
(when org-mobile-error
(org-pop-to-buffer-same-window (marker-buffer marker))
(switch-to-buffer (marker-buffer marker))
(goto-char marker)
(incf cnt-error)
(insert (if (stringp (nth 1 org-mobile-error))
......@@ -369,8 +369,6 @@ This is a compatibility function for Emacsen without `delete-dups'."
(declare-function org-publish-delete-dups "org-publish" (list))
(declare-function find-lisp-find-files "find-lisp" (directory regexp))
(declare-function org-pop-to-buffer-same-window
"org-compat" (&optional buffer-or-name norecord label))
;;; Getting project information out of org-publish-project-alist
......@@ -561,7 +559,7 @@ PUB-DIR is the publishing directory."
(make-directory pub-dir t))
(let ((visiting (find-buffer-visiting filename)))
(org-pop-to-buffer-same-window (or visiting (find-file filename)))
(switch-to-buffer (or visiting (find-file filename)))
(let* ((plist (cons :buffer-will-be-killed (cons t plist)))
(init-buf (current-buffer))
(init-point (point))
......@@ -862,7 +860,7 @@ system's modification time.
It returns time in `current-time' format."
(let ((visiting (find-buffer-visiting file)))
(org-pop-to-buffer-same-window (or visiting (find-file-noselect file nil t)))
(switch-to-buffer (or visiting (find-file-noselect file nil t)))
(let* ((plist (org-infile-export-plist))
(date (plist-get plist :date)))
(unless visiting
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment