changeset 94905:c3aeab0459b2

(ibuffer-buffer-file-name): New function. (define-ibuffer-column filename): Use it.
author John Paul Wallington <jpw@pobox.com>
date Tue, 13 May 2008 21:07:21 +0000
parents c71ea3609cd7
children 4584a4064fe3
files lisp/ibuffer.el
diffstat 1 files changed, 12 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ibuffer.el	Tue May 13 20:50:32 2008 +0000
+++ b/lisp/ibuffer.el	Tue May 13 21:07:21 2008 +0000
@@ -1233,6 +1233,17 @@
 (defsubst ibuffer-map-deletion-lines (func)
   (ibuffer-map-on-mark ibuffer-deletion-char func))
 
+(defun ibuffer-buffer-file-name ()
+  (or buffer-file-name
+      (let ((dirname (or (and (boundp 'dired-directory)
+			      (if (stringp dired-directory)
+				  dired-directory
+				(car dired-directory)))
+			 (and (memq major-mode '(cvs-mode vc-dir-mode))
+			      (bound-and-true-p default-directory)))))
+	(and dirname (expand-file-name dirname)))
+      ""))
+
 (define-ibuffer-op ibuffer-do-save ()
   "Save marked buffers as with `save-buffer'."
   (:complex t
@@ -1753,14 +1764,7 @@
 	     (t (format "%d files" total))))))
   (let ((directory-abbrev-alist ibuffer-directory-abbrev-alist))
     (abbreviate-file-name
-     (or buffer-file-name
-	 (and (boundp 'dired-directory)
-	      (if (stringp dired-directory)
-		  dired-directory
-		(car dired-directory)))
-	 (and (eq major-mode 'vc-dir-mode)
-	      (bound-and-true-p default-directory))
-	 ""))))
+     (ibuffer-buffer-file-name))))
 
 (define-ibuffer-column filename-and-process
   (:name "Filename/Process"