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

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

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

revision 1.211 by miles, Wed Apr 24 00:07:40 2002 UTC revision 1.212 by miles, Wed Apr 24 05:34:33 2002 UTC
# Line 1244  key (or menu-item)")) Line 1244  key (or menu-item)"))
1244    (interactive "*")    (interactive "*")
1245    (push-mark (point))    (push-mark (point))
1246    (insert last-command-event))    (insert last-command-event))
1247    
1248    
1249    (defcustom buffers-menu-show-directories 'unless-uniquify
1250      "If non-nil, show directories in the Buffers menu for buffers that have them.
1251    The special value `unless-uniquify' means that directories will be shown
1252    unless `uniquify-buffer-name-style' is non-nil (in which case, buffer
1253    names should include enough of a buffer's directory to distinguish it
1254    from other buffers).
1255    
1256    Setting this variable directly does not take effect until next time the
1257    Buffers menu is regenerated."
1258      :set (lambda (symbol value)
1259             (set symbol value)
1260             (menu-bar-update-buffers t))
1261      :initialize 'custom-initialize-default
1262      :type '(choice (const :tag "Never" nil)
1263                     (const :tag "Unless uniquify is enabled" unless-uniquify)
1264                     (const :tag "Always" t))
1265      :group 'menu)
1266    
1267    (defcustom buffers-menu-show-status t
1268      "If non-nil, show modified/read-only status of buffers in the Buffers menu.
1269    Setting this variable directly does not take effect until next time the
1270    Buffers menu is regenerated."
1271      :set (lambda (symbol value)
1272             (set symbol value)
1273             (menu-bar-update-buffers t))
1274      :initialize 'custom-initialize-default
1275      :type 'boolean
1276      :group 'menu)
1277    
1278  (defvar list-buffers-directory nil)  (defvar list-buffers-directory nil)
1279    
1280  (defvar menu-bar-update-buffers-maxbuf)  (defvar menu-bar-update-buffers-maxbuf)
# Line 1264  key (or menu-item)")) Line 1294  key (or menu-item)"))
1294    (select-frame frame)))    (select-frame frame)))
1295    
1296  (defun menu-bar-update-buffers-1 (elt)  (defun menu-bar-update-buffers-1 (elt)
   ;; (format "%%%ds  %%s%%s  %%s" menu-bar-update-buffers-maxbuf)  
1297    (let* ((buf (car elt))    (let* ((buf (car elt))
1298           (file           (file
1299            (and (or (not (boundp 'uniquify-buffer-name-style))            (and (if (eq buffers-menu-show-directories 'unless-uniquify)
1300                     (null uniquify-buffer-name-style))                     (or (not (boundp 'uniquify-buffer-name-style))
1301                           (null uniquify-buffer-name-style))
1302                     buffers-menu-show-directories)
1303                 (or (buffer-file-name buf)                 (or (buffer-file-name buf)
1304                     (buffer-local-value 'list-buffers-directory buf))))                     (buffer-local-value 'list-buffers-directory buf)))))
          (mod (if (buffer-modified-p buf) "*" ""))  
          (ro (if (buffer-local-value 'buffer-read-only buf) "%" "")))  
1305      (when file      (when file
1306        (setq file (file-name-directory file)))        (setq file (file-name-directory file)))
1307      (when (and file (> (length file) 20))      (when (and file (> (length file) 20))
1308        (setq file (concat "..." (substring file -17))))        (setq file (concat "..." (substring file -17))))
1309      (cons (if file      (cons (if buffers-menu-show-status
1310                (format "%s  %s%s  --  %s" (cdr elt) mod ro file)                (let ((mod (if (buffer-modified-p buf) "*" ""))
1311              (format "%s  %s%s" (cdr elt) mod ro))                      (ro (if (buffer-local-value 'buffer-read-only buf) "%" "")))
1312                    (if file
1313                        (format "%s  %s%s  --  %s" (cdr elt) mod ro file)
1314                      (format "%s  %s%s" (cdr elt) mod ro)))
1315                (if file
1316                    (format "%s  --  %s"  (cdr elt) file)
1317                  (cdr elt)))
1318            buf)))            buf)))
1319    
   
1320  ;; Used to cache the menu entries for commands in the Buffers menu  ;; Used to cache the menu entries for commands in the Buffers menu
1321  (defvar menu-bar-buffers-menu-command-entries nil)  (defvar menu-bar-buffers-menu-command-entries nil)
1322    

Legend:
Removed from v.1.211  
changed lines
  Added in v.1.212

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