/[emacs]/emacs/lisp/bindings.el
ViewVC logotype

Diff of /emacs/lisp/bindings.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.101 by rms, Sat Jul 6 09:42:31 2002 UTC revision 1.102 by rms, Thu Jul 18 14:58:53 2002 UTC
# Line 275  Keymap for what is displayed by `mode-li Line 275  Keymap for what is displayed by `mode-li
275    
276  (defun last-buffer () "\  (defun last-buffer () "\
277  Return the last non-hidden buffer in the buffer list."  Return the last non-hidden buffer in the buffer list."
278    (let ((list (reverse (buffer-list))))    ;; This logic is more or less copied from bury-buffer,
279      (while (eq (aref (buffer-name (car list)) 0) ? )    ;; except that we reverse the buffer list.
280        (setq list (cdr list)))    (let ((fbl  (frame-parameter 'buffer-list))
281      (car list)))          (list (buffer-list))
282            (pred (frame-parameter nil 'buffer-predicate))
283            found notsogood)
284        ;; Merge the frame buffer list with the whole buffer list,
285        ;; and reverse it.
286        (dolist (buffer fbl)
287          (setq list (delq buffer list)))
288        (setq list (nreverse (append fbl list)))
289        (while (not found)
290          (unless (or (eq (aref (buffer-name (car list)) 0) ? )
291                      ;; If the selected frame has a buffer_predicate,
292                      ;; disregard buffers that don't fit the predicate.
293                      (and pred (not (funcall pred (car list)))))
294            (if (get-buffer-window (car list) 'visible)
295                (unless notsogood (setq notsogood (car list)))
296              (setq found (car list)))))
297        (or found notsogood)))
298    
299  (defun unbury-buffer () "\  (defun unbury-buffer () "\
300  Switch to the last buffer in the buffer list."  Switch to the last buffer in the buffer list."

Legend:
Removed from v.1.101  
changed lines
  Added in v.1.102

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26