[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs/lisp ChangeLog simple.el
From: |
Martin Rudalics |
Subject: |
[Emacs-diffs] emacs/lisp ChangeLog simple.el |
Date: |
Wed, 31 Dec 2008 15:44:30 +0000 |
CVSROOT: /sources/emacs
Module name: emacs
Changes by: Martin Rudalics <m061211> 08/12/31 15:44:29
Modified files:
lisp : ChangeLog simple.el
Log message:
(last-buffer): Don't set major mode of *scratch* if
that buffer exists already. Rewrite doc-string.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/ChangeLog?cvsroot=emacs&r1=1.15018&r2=1.15019
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/simple.el?cvsroot=emacs&r1=1.959&r2=1.960
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.15018
retrieving revision 1.15019
diff -u -b -r1.15018 -r1.15019
--- ChangeLog 31 Dec 2008 09:58:49 -0000 1.15018
+++ ChangeLog 31 Dec 2008 15:44:25 -0000 1.15019
@@ -1,3 +1,8 @@
+2008-12-31 Martin Rudalics <address@hidden>
+
+ * simple.el (last-buffer): Don't set major mode of *scratch* if
+ that buffer exists already. Rewrite doc-string.
+
2008-12-31 Andreas Schwab <address@hidden>
* tar-mode.el (tar-mode): Set write-contents-functions instead of
Index: simple.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/simple.el,v
retrieving revision 1.959
retrieving revision 1.960
diff -u -b -r1.959 -r1.960
--- simple.el 21 Dec 2008 05:20:17 -0000 1.959
+++ simple.el 31 Dec 2008 15:44:29 -0000 1.960
@@ -78,19 +78,22 @@
(car list)))
(defun last-buffer (&optional buffer visible-ok frame)
- "Return the last non-hidden displayable buffer in the buffer list.
-If BUFFER is non-nil, last-buffer will ignore that buffer.
+ "Return the last buffer in FRAME's buffer list.
+If BUFFER is the last buffer, return the preceding buffer instead.
Buffers not visible in windows are preferred to visible buffers,
unless optional argument VISIBLE-OK is non-nil.
-If the optional third argument FRAME is non-nil, use that frame's
-buffer list instead of the selected frame's buffer list.
-If no other buffer exists, the buffer `*scratch*' is returned."
+Optional third argument FRAME nil or omitted means use the
+selected frame's buffer list.
+If no such buffer exists, return the buffer `*scratch*', creating
+it if necessary."
(setq frame (or frame (selected-frame)))
(or (get-next-valid-buffer (nreverse (buffer-list frame))
buffer visible-ok frame)
- (progn
- (set-buffer-major-mode (get-buffer-create "*scratch*"))
- (get-buffer "*scratch*"))))
+ (get-buffer "*scratch*")
+ (let ((scratch (get-buffer-create "*scratch*")))
+ (set-buffer-major-mode scratch)
+ scratch)))
+
(defun next-buffer ()
"Switch to the next buffer in cyclic order."
(interactive)