From: Chong Yidong Date: Thu, 25 Aug 2011 00:45:23 +0000 (-0400) Subject: Delete record-buffer, and rename unrecord-buffer to bury-buffer-internal. X-Git-Tag: emacs-pretest-24.0.90~104^2~152^2~69^2~9 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e4ed06f12b052a3c80d5c572889cb670a41f3c7d;p=emacs.git Delete record-buffer, and rename unrecord-buffer to bury-buffer-internal. * lisp/window.el (bury-buffer, quit-window): Use bury-buffer-internal. * src/buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer. Change return value to nil. (Frecord_buffer): Delete unused function. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 643ed72124e..91078ce3246 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2011-08-25 Chong Yidong + + * window.el (bury-buffer, quit-window): Use bury-buffer-internal. + 2011-08-25 Glenn Morris * mail/smtpmail.el (smtpmail-smtp-user): Add version: tag. diff --git a/lisp/window.el b/lisp/window.el index fb9d38c6503..e68af18ab8e 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -2795,7 +2795,7 @@ displayed there." (let* ((buffer (window-normalize-buffer buffer-or-name))) ;; If `buffer-or-name' is not on the selected frame we unrecord it ;; although it's not "here" (call it a feature). - (unrecord-buffer buffer) + (bury-buffer-internal buffer) ;; Handle case where `buffer-or-name' is nil and the current buffer ;; is shown in the selected window. (cond @@ -2928,12 +2928,9 @@ one. If non-nil, reset `quit-restore' parameter to nil." (eq (window-buffer window) (nth 1 quit-restore))) (window-dedicated-p window)) (setq deletable (window-deletable-p window))) - ;; WINDOW can be deleted. - (unrecord-buffer buffer) + ;; Check if WINDOW's frame can be deleted. (if (eq deletable 'frame) - ;; WINDOW's frame can be deleted. (delete-frame (window-frame window)) - ;; Just delete WINDOW. (delete-window window)) ;; If the previously selected window is still alive, select it. (when (window-live-p (nth 2 quit-restore)) @@ -2944,17 +2941,17 @@ one. If non-nil, reset `quit-restore' parameter to nil." ;; in the first place. (eq (window-buffer window) (nth 3 quit-restore))) (setq resize (with-current-buffer buffer temp-buffer-resize-mode)) - ;; Unrecord buffer. - (unrecord-buffer buffer) (unrecord-window-buffer window buffer) ;; Display buffer stored in the quit-restore parameter. (set-window-dedicated-p window nil) (set-window-buffer window (nth 0 quit-restore)) (set-window-start window (nth 1 quit-restore)) (set-window-point window (nth 2 quit-restore)) - (when (and resize (/= (nth 4 quit-restore) (window-total-size window))) - (window-resize - window (- (nth 4 quit-restore) (window-total-size window)))) + (and resize + (/= (nth 4 quit-restore) (window-total-size window)) + (window-resize window + (- (nth 4 quit-restore) + (window-total-size window)))) ;; Reset the quit-restore parameter. (set-window-parameter window 'quit-restore nil) (when (window-live-p (nth 5 quit-restore)) @@ -2963,11 +2960,12 @@ one. If non-nil, reset `quit-restore' parameter to nil." ;; Otherwise, show another buffer in WINDOW and reset the ;; quit-restore parameter. (set-window-parameter window 'quit-restore nil) - (unrecord-buffer buffer) (switch-to-prev-buffer window 'bury-or-kill))) ;; Kill WINDOW's old-buffer if requested - (if kill (kill-buffer buffer)))) + (if kill + (kill-buffer buffer) + (bury-buffer-internal buffer)))) ;;; Splitting windows. (defsubst window-split-min-size (&optional horizontal) diff --git a/src/ChangeLog b/src/ChangeLog index b9c627bf160..431a515def5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2011-08-25 Chong Yidong + + * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer. + Change return value to nil. + (Frecord_buffer): Delete unused function. + 2011-08-24 Eli Zaretskii * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte diff --git a/src/buffer.c b/src/buffer.c index 45d6fa36d04..832044ae6f4 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -1698,27 +1698,16 @@ record_buffer (Lisp_Object buffer) call1 (Vrun_hooks, Qbuffer_list_update_hook); } -DEFUN ("record-buffer", Frecord_buffer, Srecord_buffer, 1, 1, 0, - doc: /* Move BUFFER to the front of the buffer list. -Return BUFFER. */) - (Lisp_Object buffer) -{ - CHECK_BUFFER (buffer); - - record_buffer (buffer); - - return buffer; -} - /* Move BUFFER to the end of the buffer (a)lists. Do nothing if the - buffer is killed. For the selected frame's buffer list this moves - BUFFER to its end even if it was never shown in that frame. If - this happens we have a feature, hence `unrecord-buffer' should be - called only when BUFFER was shown in the selected frame. */ +/* Move BUFFER to the end of the buffer (a)lists. Do nothing if the + buffer is killed. For the selected frame's buffer list this moves + BUFFER to its end even if it was never shown in that frame. If + this happens we have a feature, hence `unrecord-buffer' should be + called only when BUFFER was shown in the selected frame. */ -DEFUN ("unrecord-buffer", Funrecord_buffer, Sunrecord_buffer, 1, 1, 0, - doc: /* Move BUFFER to the end of the buffer list. -Return BUFFER. */) +DEFUN ("bury-buffer-internal", Fbury_buffer_internal, Sbury_buffer_internal, + 1, 1, 0, + doc: /* Move BUFFER to the end of the buffer list. */) (Lisp_Object buffer) { Lisp_Object aelt, aelt_cons, tem; @@ -1746,7 +1735,7 @@ Return BUFFER. */) if (!NILP (Vrun_hooks)) call1 (Vrun_hooks, Qbuffer_list_update_hook); - return buffer; + return Qnil; } DEFUN ("set-buffer-major-mode", Fset_buffer_major_mode, Sset_buffer_major_mode, 1, 1, 0, @@ -6034,8 +6023,7 @@ Functions running this hook are `get-buffer-create', defsubr (&Sother_buffer); defsubr (&Sbuffer_enable_undo); defsubr (&Skill_buffer); - defsubr (&Srecord_buffer); - defsubr (&Sunrecord_buffer); + defsubr (&Sbury_buffer_internal); defsubr (&Sset_buffer_major_mode); defsubr (&Scurrent_buffer); defsubr (&Sset_buffer);