/[emacs]/emacs/lisp/buff-menu.el
ViewVC logotype

Diff of /emacs/lisp/buff-menu.el

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

revision 1.72 by rms, Tue Nov 16 17:12:53 2004 UTC revision 1.73 by monnier, Wed Nov 17 17:12:57 2004 UTC
# Line 1  Line 1 
1  ;;; buff-menu.el --- buffer menu main function and support functions  ;;; buff-menu.el --- buffer menu main function and support functions
2    
3  ;; Copyright (C) 1985, 86, 87, 93, 94, 95, 2000, 2001, 2002, 03, 2004  ;; Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 2000, 2001, 2002, 2003,
4  ;;   Free Software Foundation, Inc.  ;;   2004  Free Software Foundation, Inc.
5    
6  ;; Maintainer: FSF  ;; Maintainer: FSF
7  ;; Keywords: convenience  ;; Keywords: convenience
# Line 652  For more information, see the function ` Line 652  For more information, see the function `
652                           "  "                           "  "
653                           (Buffer-menu-make-sort-button "Mode" 4) mode-end                           (Buffer-menu-make-sort-button "Mode" 4) mode-end
654                           (Buffer-menu-make-sort-button "File" 5) "\n"))                           (Buffer-menu-make-sort-button "File" 5) "\n"))
655           list desired-point name mode file)           list desired-point)
656      (when Buffer-menu-use-header-line      (when Buffer-menu-use-header-line
657        (let ((pos 0))        (let ((pos 0))
658          ;; Turn spaces in the header into stretch specs so they work          ;; Turn spaces in the header into stretch specs so they work
# Line 672  For more information, see the function ` Line 672  For more information, see the function `
672          (insert (Buffer-menu-buffer+size "------" "----"))          (insert (Buffer-menu-buffer+size "------" "----"))
673          (insert "  ----" mode-end "----\n")          (insert "  ----" mode-end "----\n")
674          (put-text-property 1 (point) 'intangible t))          (put-text-property 1 (point) 'intangible t))
675        (setq list        (if buffer-list
676              (or buffer-list            (setq list buffer-list)
677                  (delq t          ;; Collect info for every buffer we're interested in.
678                        (mapcar          (dolist (buffer (buffer-list))
679                         (lambda (buffer)            (with-current-buffer buffer
680                           (with-current-buffer buffer              (let ((name (buffer-name))
681                             (setq name (buffer-name)                    (file buffer-file-name))
682                                   mode (concat (format-mode-line mode-name nil nil buffer)                (cond
683                                                (if mode-line-process                 ;; Don't mention internal buffers.
684                                                    (format-mode-line mode-line-process nil nil buffer)))                 ((and (string= (substring name 0 1) " ") (null file)))
685                                   file (buffer-file-name))                 ;; Maybe don't mention buffers without files.
686                             (cond                 ((and files-only (not file)))
687                              ;; Don't mention internal buffers.                 ((string= name "*Buffer List*"))
688                              ((and (string= (substring name 0 1) " ") (null file)))                 ;; Otherwise output info.
689                              ;; Maybe don't mention buffers without files.                 (t
690                              ((and files-only (not file)))                  (let ((mode (concat (format-mode-line mode-name nil nil buffer)
691                              ((string= name "*Buffer List*"))                                      (if mode-line-process
692                              ;; Otherwise output info.                                          (format-mode-line mode-line-process
693                              (t                                                            nil nil buffer))))
694                               (unless file                        (bits (string
695                                 ;; No visited file.  Check local value of                               (if (eq buffer old-buffer) ?. ?\ )
696                                 ;; list-buffers-directory.                               ;; Handle readonly status.  The output buffer
697                                 (when (and (boundp 'list-buffers-directory)                               ;; is special cased to appear readonly; it is
698                                            list-buffers-directory)                               ;; actually made so at a later date.
699                                   (setq file list-buffers-directory)))                               (if (or (eq buffer standard-output)
700                               (list buffer                                       buffer-read-only)
701                                     (format "%c%c%c "                                   ?% ?\ )
702                                             (if (eq buffer old-buffer) ?. ? )                               ;; Identify modified buffers.
703                                             ;; Handle readonly status.  The output buffer is special                               (if (buffer-modified-p) ?* ?\ )
704                                             ;; cased to appear readonly; it is actually made so at a                               ;; Space separator.
705                                             ;; later date.                               ?\ )))
706                                             (if (or (eq buffer standard-output)                    (unless file
707                                                     buffer-read-only)                      ;; No visited file.  Check local value of
708                                                 ?% ? )                      ;; list-buffers-directory.
709                                             ;; Identify modified buffers.                      (when (and (boundp 'list-buffers-directory)
710                                             (if (buffer-modified-p) ?* ? ))                                 list-buffers-directory)
711                                     name (buffer-size) mode file)))))                        (setq file list-buffers-directory)))
712                         (buffer-list)))))                    (push (list buffer bits name (buffer-size) mode file)
713                            list)))))))
714            ;; Preserve the original buffer-list ordering, just in case.
715            (setq list (nreverse list)))
716          ;; Place the buffers's info in the output buffer, sorted if necessary.
717        (dolist (buffer        (dolist (buffer
718                 (if Buffer-menu-sort-column                 (if Buffer-menu-sort-column
719                     (sort list                     (sort list
# Line 754  For more information, see the function ` Line 758  For more information, see the function `
758        (set-buffer-modified-p nil)        (set-buffer-modified-p nil)
759        (current-buffer))))        (current-buffer))))
760    
761  ;;; arch-tag: e7dfcfc9-6cb2-46e4-bf55-8ef1936d83c6  ;; arch-tag: e7dfcfc9-6cb2-46e4-bf55-8ef1936d83c6
762  ;;; buff-menu.el ends here  ;;; buff-menu.el ends here

Legend:
Removed from v.1.72  
changed lines
  Added in v.1.73

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