Now on revision 105644. ------------------------------------------------------------ revno: 105644 committer: martin rudalics branch nick: trunk timestamp: Sat 2011-09-03 12:55:37 +0200 message: Don't delete frame when there's a previous buffer to show (Bug#9419). * window.el (window-deletable-p): Don't return a non-nil value when there's a buffer that was shown in the window before. (Bug#9419) (display-buffer-pop-up-frame, display-buffer-pop-up-window): Set window's previous buffers to nil. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-09-03 08:44:16 +0000 +++ lisp/ChangeLog 2011-09-03 10:55:37 +0000 @@ -1,3 +1,11 @@ +2011-09-03 Martin Rudalics + + * window.el (window-deletable-p): Don't return a non-nil value + when there's a buffer that was shown in the window before. + (Bug#9419) + (display-buffer-pop-up-frame, display-buffer-pop-up-window): Set + window's previous buffers to nil. + 2011-09-03 Eli Zaretskii * mail/rmailmm.el (rmail-mime-insert-tagline): Insert an extra === modified file 'lisp/window.el' --- lisp/window.el 2011-09-02 16:38:40 +0000 +++ lisp/window.el 2011-09-03 10:55:37 +0000 @@ -2291,29 +2291,45 @@ (setq window (window-atom-root window)))) (let ((parent (window-parent window)) (frame (window-frame window)) + (buffer (window-buffer window)) (dedicated (and (window-buffer window) (window-dedicated-p window))) (quit-restore (window-parameter window 'quit-restore))) (cond ((frame-root-window-p window) + ;; Don't delete FRAME if `frame-auto-delete' is nil. (when (and (or (eq frame-auto-delete t) (and (eq frame-auto-delete 'automatic) + ;; Delete FRAME only if it's either dedicated + ;; or quit-restore's car is `new-frame' and + ;; WINDOW still displays the same buffer (or dedicated (and (eq (car-safe quit-restore) 'new-frame) (eq (nth 1 quit-restore) (window-buffer window)))))) + ;; Don't delete FRAME if we have another buffer in + ;; WINDOW's previous buffers. Bug#9419. + (or (not (window-prev-buffers window)) + (eq (caar (window-prev-buffers window)) buffer)) + ;; Don't try to delete FRAME when there are no other + ;; visible frames left. (other-visible-frames-p frame)) - ;; WINDOW is the root window of its frame. Return `frame' but - ;; only if WINDOW is (1) either dedicated or quit-restore's car - ;; is `new-frame' and the window still displays the same buffer - ;; and (2) there are other frames left. 'frame)) - ((and (not ignore-window-parameters) - (eq (window-parameter window 'window-side) 'none) - (or (not parent) - (not (eq (window-parameter parent 'window-side) 'none)))) - ;; Can't delete last main window. - nil) - (t)))) + ;; Don't delete WINDOW if we find another buffer in WINDOW's + ;; previous buffers. + ((and (or (not (window-prev-buffers window)) + (eq (caar (window-prev-buffers window)) buffer)) + ;; Delete WINDOW only if it's dedicated or quit-restore's car + ;; is `new-frame' or `new-window' and it still displays the + ;; same buffer. + (or dedicated + (and (memq (car-safe quit-restore) '(new-window new-frame)) + (eq (nth 1 quit-restore) (window-buffer window)))) + ;; Don't delete the last main window. + (or ignore-window-parameters + (not (eq (window-parameter window 'window-side) 'none)) + (and parent + (eq (window-parameter parent 'window-side) 'none)))) + t)))) (defun window-or-subwindow-p (subwindow window) "Return t if SUBWINDOW is either WINDOW or a subwindow of WINDOW." @@ -4714,7 +4730,10 @@ (setq frame (funcall fun)) (setq window (frame-selected-window frame))) (display-buffer-record-window 'pop-up-frame window buffer) - (window--display-buffer-2 buffer window)))) + (window--display-buffer-2 buffer window) + ;; Reset list of WINDOW's previous buffers to nil. + (set-window-prev-buffers window nil) + window))) (defun display-buffer-pop-up-window (buffer alist) "Display BUFFER by popping up a new window. @@ -4737,7 +4756,10 @@ (window--try-to-split-window (get-lru-window frame t))))) (display-buffer-record-window 'pop-up-window window buffer) - (window--display-buffer-2 buffer window)))) + (window--display-buffer-2 buffer window) + ;; Reset list of WINDOW's previous buffers to nil. + (set-window-prev-buffers window nil) + window))) ;; This display action function groups together some lower-level ones: (defun display-buffer-reuse-or-pop-window (buffer alist) ------------------------------------------------------------ revno: 105643 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2011-09-03 11:44:16 +0300 message: Fix display by Rmail of bidirectional text in MIME email messages. lisp/mail/rmailmm.el (rmail-mime-insert-tagline): Insert an extra newline before and after the tag line, so it doesn't interfere with determining the paragraph direction of bidirectional text. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-09-03 01:41:27 +0000 +++ lisp/ChangeLog 2011-09-03 08:44:16 +0000 @@ -1,3 +1,9 @@ +2011-09-03 Eli Zaretskii + + * mail/rmailmm.el (rmail-mime-insert-tagline): Insert an extra + newline before and after the tag line, so it doesn't interfere + with determining the paragraph direction of bidirectional text. + 2011-09-03 Leo Liu * files.el (find-file-not-true-dirname-list): Remove. (Bug#9422) === modified file 'lisp/mail/rmail.el' --- lisp/mail/rmail.el 2011-08-31 20:49:24 +0000 +++ lisp/mail/rmail.el 2011-09-03 08:44:16 +0000 @@ -4482,7 +4482,7 @@ ;;;*** -;;;### (autoloads (rmail-mime) "rmailmm" "rmailmm.el" "a7d3e7205efa4e20ca9038c9b260ce83") +;;;### (autoloads (rmail-mime) "rmailmm" "rmailmm.el" "2c8675d7c069c68bc36a4003b15448d1") ;;; Generated autoloads from rmailmm.el (autoload 'rmail-mime "rmailmm" "\ === modified file 'lisp/mail/rmailmm.el' --- lisp/mail/rmailmm.el 2011-07-06 22:43:46 +0000 +++ lisp/mail/rmailmm.el 2011-09-03 08:44:16 +0000 @@ -426,7 +426,7 @@ "Insert a tag line for MIME-entity ENTITY. ITEM-LIST is a list of strings or button-elements (list) to be added to the tag line." - (insert "[") + (insert "\n[") (let ((tag (aref (rmail-mime-entity-tagline entity) 0))) (if (> (length tag) 0) (insert (substring tag 1) ":"))) (insert (car (rmail-mime-entity-type entity)) " ") @@ -439,7 +439,7 @@ (if (stringp item) (insert item) (apply 'insert-button item)))) - (insert "]\n")) + (insert "]\n\n")) (defun rmail-mime-update-tagline (entity) "Update the current tag line for MIME-entity ENTITY." ------------------------------------------------------------ revno: 105642 committer: Leo Liu branch nick: trunk timestamp: Sat 2011-09-03 09:41:27 +0800 message: Remove unused variable find-file-not-true-dirname-list See http://debbugs.gnu.org/9422. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-09-02 16:38:40 +0000 +++ lisp/ChangeLog 2011-09-03 01:41:27 +0000 @@ -1,3 +1,7 @@ +2011-09-03 Leo Liu + + * files.el (find-file-not-true-dirname-list): Remove. (Bug#9422) + 2011-09-02 Chong Yidong * window.el (pop-to-buffer-1, pop-to-buffer-same-window): Deleted. === modified file 'lisp/files.el' --- lisp/files.el 2011-09-02 16:38:40 +0000 +++ lisp/files.el 2011-09-03 01:41:27 +0000 @@ -1639,11 +1639,6 @@ (substring filename (match-end 0))))) filename))) -(defcustom find-file-not-true-dirname-list nil - "List of logical names for which visiting shouldn't save the true dirname." - :type '(repeat (string :tag "Name")) - :group 'find-file) - (defun find-buffer-visiting (filename &optional predicate) "Return the buffer visiting file FILENAME (a string). This is like `get-file-buffer', except that it checks for any buffer ------------------------------------------------------------ revno: 105641 fixes bug(s): http://debbugs.gnu.org/9392 committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2011-09-02 20:57:45 +0300 message: lisp/gnus/message.el (message-setup-1): Return t (Bug#9392). diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2011-09-01 13:25:09 +0000 +++ lisp/gnus/ChangeLog 2011-09-02 17:57:45 +0000 @@ -1,3 +1,7 @@ +2011-09-02 Eli Zaretskii + + * message.el (message-setup-1): Return t (Bug#9392). + 2011-09-01 Andrew Cohen * gnus-sum.el: When adding article headers to a summary buffer also === modified file 'lisp/gnus/message.el' --- lisp/gnus/message.el 2011-08-20 00:20:39 +0000 +++ lisp/gnus/message.el 2011-09-02 17:57:45 +0000 @@ -6530,7 +6530,9 @@ (message-position-point) ;; Allow correct handling of `message-checksum' in `message-yank-original': (set-buffer-modified-p nil) - (undo-boundary)) + (undo-boundary) + ;; rmail-start-mail expects message-mail to return t (Bug#9392) + t) (defun message-set-auto-save-file-name () "Associate the message buffer with a file in the drafts directory." ------------------------------------------------------------ revno: 105640 committer: Chong Yidong branch nick: trunk timestamp: Fri 2011-09-02 12:38:40 -0400 message: 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. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-09-02 02:23:43 +0000 +++ lisp/ChangeLog 2011-09-02 16:38:40 +0000 @@ -1,5 +1,22 @@ 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. (display-buffer): Add docstring. Don't treat display-buffer-default specially. === modified file 'lisp/abbrev.el' --- lisp/abbrev.el 2011-07-08 14:42:36 +0000 +++ lisp/abbrev.el 2011-09-02 16:38:40 +0000 @@ -159,7 +159,7 @@ USECOUNT is an integer, and HOOK is any valid function or may be omitted (it is usually omitted)." (interactive) - (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." === modified file 'lisp/arc-mode.el' --- lisp/arc-mode.el 2011-07-08 00:08:53 +0000 +++ lisp/arc-mode.el 2011-09-02 16:38:40 +0000 @@ -1083,7 +1083,7 @@ (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)) === modified file 'lisp/autoinsert.el' --- lisp/autoinsert.el 2011-07-05 15:31:22 +0000 +++ lisp/autoinsert.el 2011-09-02 16:38:40 +0000 @@ -360,7 +360,7 @@ (save-window-excursion ;; 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) === modified file 'lisp/bookmark.el' --- lisp/bookmark.el 2011-07-14 01:40:30 +0000 +++ lisp/bookmark.el 2011-09-02 16:38:40 +0000 @@ -1539,7 +1539,7 @@ (bookmark-maybe-load-default-file) (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)) (erase-buffer) === modified file 'lisp/files.el' --- lisp/files.el 2011-08-20 22:26:52 +0000 +++ lisp/files.el 2011-09-02 16:38:40 +0000 @@ -1342,8 +1342,8 @@ (confirm-nonexistent-file-or-buffer))) (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. === modified file 'lisp/org/ChangeLog' --- lisp/org/ChangeLog 2011-08-31 09:27:49 +0000 +++ lisp/org/ChangeLog 2011-09-02 16:38:40 +0000 @@ -1,3 +1,29 @@ +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-goto-marker-or-bmk): + * org-agenda.el (org-prepare-agenda, org-agenda-switch-to): + * org-capture.el (org-capture-goto-target) + (org-capture-fill-template): + * 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 === modified file 'lisp/org/ob-ref.el' --- lisp/org/ob-ref.el 2011-08-18 20:57:10 +0000 +++ lisp/org/ob-ref.el 2011-09-02 16:38:40 +0000 @@ -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 @@ (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) (org-show-context) === modified file 'lisp/org/org-agenda.el' --- lisp/org/org-agenda.el 2011-08-18 20:41:06 +0000 +++ lisp/org/org-agenda.el 2011-09-02 16:38:40 +0000 @@ -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 @@ (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 @@ ;; 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)) (org-agenda-mode) @@ -6972,7 +6970,7 @@ (org-agenda-error))) (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)) (widen) (goto-char pos) === modified file 'lisp/org/org-capture.el' --- lisp/org/org-capture.el 2011-08-18 20:41:06 +0000 +++ lisp/org/org-capture.el 2011-09-02 16:38:40 +0000 @@ -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 @@ (error "No capture template selected")) (org-capture-set-plist entry) (org-capture-set-target-location) - (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 @@ (sit-for 1)) (save-window-excursion (delete-other-windows) - (org-pop-to-buffer-same-window (get-buffer-create "*Capture*")) + (switch-to-buffer (get-buffer-create "*Capture*")) (erase-buffer) (insert template) (goto-char (point-min)) === modified file 'lisp/org/org-clock.el' --- lisp/org/org-clock.el 2011-08-18 20:41:06 +0000 +++ lisp/org/org-clock.el 2011-09-02 16:38:40 +0000 @@ -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 @@ (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) (org-show-entry) === modified file 'lisp/org/org-compat.el' --- lisp/org/org-compat.el 2011-08-31 09:27:49 +0000 +++ lisp/org/org-compat.el 2011-09-02 16:38:40 +0000 @@ -432,15 +432,6 @@ (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) - (funcall - 'pop-to-buffer-same-window buffer-or-name norecord) - (funcall 'switch-to-buffer buffer-or-name norecord))) - (provide 'org-compat) === modified file 'lisp/org/org-ctags.el' --- lisp/org/org-ctags.el 2011-08-18 20:41:06 +0000 +++ lisp/org/org-ctags.el 2011-09-02 16:38:40 +0000 @@ -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 @@ (cond ((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'..." === modified file 'lisp/org/org-exp.el' --- lisp/org/org-exp.el 2011-08-18 20:41:06 +0000 +++ lisp/org/org-exp.el 2011-09-02 16:38:40 +0000 @@ -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 @@ (region (buffer-string)) str-ret) (save-excursion - (org-pop-to-buffer-same-window buffer) + (switch-to-buffer buffer) (erase-buffer) (insert region) (let ((org-inhibit-startup t)) (org-mode)) === modified file 'lisp/org/org-feed.el' --- lisp/org/org-feed.el 2011-08-18 20:41:06 +0000 +++ lisp/org/org-feed.el 2011-09-02 16:38:40 +0000 @@ -436,7 +436,7 @@ (if (stringp feed) (setq feed (assoc feed org-feed-alist))) (unless feed (error "No such feed in `org-feed-alist")) - (org-pop-to-buffer-same-window + (switch-to-buffer (org-feed-update feed 'retrieve-only)) (goto-char (point-min))) === modified file 'lisp/org/org-html.el' --- lisp/org/org-html.el 2011-08-18 20:41:06 +0000 +++ lisp/org/org-html.el 2011-09-02 16:38:40 +0000 @@ -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 @@ (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 " marker (point-max)) (< marker (point-min))) (widen)) (goto-char marker) === modified file 'lisp/progmodes/compile.el' --- lisp/progmodes/compile.el 2011-08-22 12:46:45 +0000 +++ lisp/progmodes/compile.el 2011-09-02 16:38:40 +0000 @@ -2413,7 +2413,7 @@ ;; display the source in another window. (let ((pop-up-windows t)) (pop-to-buffer (marker-buffer mk) 'other-window)) - (pop-to-buffer-same-window (marker-buffer mk))) + (switch-to-buffer (marker-buffer mk))) (unless (eq (goto-char mk) (point)) ;; If narrowing gets in the way of going to the right place, widen. (widen) === modified file 'lisp/textmodes/bibtex.el' --- lisp/textmodes/bibtex.el 2011-07-12 13:37:38 +0000 +++ lisp/textmodes/bibtex.el 2011-09-02 16:38:40 +0000 @@ -3060,7 +3060,7 @@ ;; select BibTeX buffer (if select (if buffer-list - (pop-to-buffer-same-window + (switch-to-buffer (completing-read "Switch to BibTeX buffer: " (mapcar 'buffer-name buffer-list) nil t === modified file 'lisp/view.el' --- lisp/view.el 2011-09-01 17:04:30 +0000 +++ lisp/view.el 2011-09-02 16:38:40 +0000 @@ -318,7 +318,7 @@ (progn (switch-to-buffer buffer) (message "Not using View mode because the major mode is special")) - (pop-to-buffer-same-window buffer) + (switch-to-buffer buffer) (view-mode-enter nil exit-action))) ;;;###autoload === modified file 'lisp/window.el' --- lisp/window.el 2011-09-02 02:38:56 +0000 +++ lisp/window.el 2011-09-02 16:38:40 +0000 @@ -4584,7 +4584,8 @@ case check all visible or iconified frames. Otherwise, FRAME can be a specific frame, `visible' (all visible frames), 0 (all frames on the current terminal), or t (all frames)." - (interactive "BDisplay buffer:\nP") + (interactive (list (read-buffer "Display buffer: " (other-buffer)) + (if current-prefix-arg t))) (let ((buffer (window-normalize-buffer-to-display buffer-or-name)) ;; Handle the old form of the first argument. (inhibit-same-window (and action (not (listp action))))) @@ -4609,7 +4610,7 @@ (functions (apply 'append (mapcar (lambda (x) (setq x (car x)) - (if (listp x) x (list x))) + (if (functionp x) (list x) x)) actions))) (alist (apply 'append (mapcar 'cdr actions))) window) @@ -4822,70 +4823,42 @@ ;;; Display + selection commands: -(defun pop-to-buffer (buffer-or-name &optional other-window norecord) - "Select buffer BUFFER-OR-NAME in some window, preferably a different one. -BUFFER-OR-NAME may be a buffer, a string \(a buffer name), or -nil. If BUFFER-OR-NAME is a string not naming an existent -buffer, create a buffer with that name. If BUFFER-OR-NAME is -nil, choose some other buffer. - -If `pop-up-windows' is non-nil, windows can be split to display -the buffer. If optional second arg OTHER-WINDOW is non-nil, -insist on finding another window even if the specified buffer is -already visible in the selected window, and ignore -`same-window-regexps' and `same-window-buffer-names'. - -If the window to show BUFFER-OR-NAME is not on the selected +(defun pop-to-buffer (buffer &optional action norecord) + "Select buffer BUFFER in some window, preferably a different one. +BUFFER may be a buffer, a string (a buffer name), or nil. If it +is a string not naming an existent buffer, create a buffer with +that name. If BUFFER is nil, choose some other buffer. Return +the buffer. + +This uses `display-buffer' as a subroutine. The optional ACTION +argument is passed to `display-buffer' as its ACTION argument. +See `display-buffer' for more information. ACTION is t if called +interactively with a prefix argument, which means to pop to a +window other than the selected one even if the buffer is already +displayed in the selected window. + +If the window to show BUFFER is not on the selected frame, raise that window's frame and give it input focus. -This function returns the buffer it switched to. This uses the -function `display-buffer' as a subroutine; see the documentation -of `display-buffer' for additional customization information. - Optional third arg NORECORD non-nil means do not put this buffer at the front of the list of recently selected ones." - (interactive "BPop to buffer:\nP") - (pop-to-buffer-1 buffer-or-name (if other-window t nil) norecord)) - -(defun pop-to-buffer-same-window (&optional buffer-or-name norecord) - "Pop to buffer specified by BUFFER-OR-NAME in the selected window. -Another window will be used only if the buffer can't be shown in -the selected window, usually because it is dedicated to another -buffer. Optional arguments BUFFER-OR-NAME and NORECORD are as -for `pop-to-buffer'." - (interactive "BPop to buffer in selected window:\nP") - (pop-to-buffer-1 buffer-or-name 'same-window norecord)) - -(defun pop-to-buffer-1 (buffer-or-name window-choice norecord) - (set-buffer (window-normalize-buffer-to-display - ;; BUFFER-OR-NAME nil means another buffer. - (or buffer-or-name - (other-buffer (current-buffer))))) - (let ((old-window (selected-window)) - (old-frame (selected-frame)) - (same-window-buffer-names same-window-buffer-names) - (same-window-regexps same-window-regexps)) - (if (eq window-choice t) - (setq same-window-buffer-names nil - same-window-regexps nil)) - (let* ((action - ;; Based on the WINDOW-CHOICE argument, choose an action - ;; argument to pass to `display-buffer'. - (cond - ((eq window-choice 'same-window) - '((display-buffer-reuse-selected-window - display-buffer-same-window))) - (window-choice - '(nil (inhibit-same-window . t))))) - (window (display-buffer (current-buffer) action)) - (frame (window-frame window))) - (if (eq frame old-frame) - ;; Make sure new window gets selected (Bug#8615), (Bug#6954). - (select-window window norecord) - ;; If `display-buffer' has chosen another frame, make sure it - ;; gets input focus. - (select-frame-set-input-focus frame norecord)) - (current-buffer)))) + (interactive (list (read-buffer "Pop to buffer: " (other-buffer)) + (if current-prefix-arg t))) + (setq buffer (window-normalize-buffer-to-display + ;; BUFFER nil means another buffer. + (or buffer (other-buffer)))) + (set-buffer buffer) + (let* ((old-window (selected-window)) + (old-frame (selected-frame)) + (window (display-buffer (current-buffer) action)) + (frame (window-frame window))) + (if (eq frame old-frame) + ;; Make sure new window is selected (Bug#8615), (Bug#6954). + (select-window window norecord) + ;; If `display-buffer' has chosen another frame, make sure it + ;; gets input focus. + (select-frame-set-input-focus frame norecord)) + buffer)) (defun read-buffer-to-switch (prompt) "Read the name of a buffer to switch to, prompting with PROMPT. ------------------------------------------------------------ revno: 105639 fixes bug(s): http://debbugs.gnu.org/9391 author: Thierry Volpiatto committer: Glenn Morris branch nick: trunk timestamp: Fri 2011-09-02 00:54:34 -0700 message: Add missing piece of earlier commit. * lisp/vc/vc-rcs.el (vc-rcs-responsible-p): Handle directories. diff: === modified file 'lisp/vc/vc-rcs.el' --- lisp/vc/vc-rcs.el 2011-03-03 07:52:10 +0000 +++ lisp/vc/vc-rcs.el 2011-09-02 07:54:34 +0000 @@ -314,7 +314,10 @@ (defun vc-rcs-responsible-p (file) "Return non-nil if RCS thinks it would be responsible for registering FILE." ;; TODO: check for all the patterns in vc-rcs-master-templates - (file-directory-p (expand-file-name "RCS" (file-name-directory file)))) + (file-directory-p (expand-file-name "RCS" + (if (file-directory-p file) + file + (file-name-directory file))))) (defun vc-rcs-receive-file (file rev) "Implementation of receive-file for RCS."