changeset 105196:d991506f9286

* menu-bar.el (list-buffers-directory): Add docstring. Make automatically buffer-local. * dired.el (dired-mode): * files.el (cd-absolute): * pcvs.el (cvs-temp-buffer): * pcvs-util.el (cvs-get-buffer-create): * shell.el (shell-mode): * vc-dir.el (vc-dir-mode): Don't make `list-buffers-directory' buffer local.
author Juanma Barranquero <lekktu@gmail.com>
date Fri, 25 Sep 2009 04:35:14 +0000
parents 5b4bbf79ac2a
children 3ed1736067e6
files lisp/ChangeLog lisp/dired.el lisp/files.el lisp/menu-bar.el lisp/pcvs-util.el lisp/pcvs.el lisp/shell.el lisp/vc-dir.el
diffstat 8 files changed, 28 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri Sep 25 03:42:22 2009 +0000
+++ b/lisp/ChangeLog	Fri Sep 25 04:35:14 2009 +0000
@@ -1,3 +1,16 @@
+2009-09-25  Juanma Barranquero  <lekktu@gmail.com>
+
+	* menu-bar.el (list-buffers-directory): Add docstring.
+	Make automatically buffer-local.
+
+	* dired.el (dired-mode):
+	* files.el (cd-absolute):
+	* pcvs.el (cvs-temp-buffer):
+	* pcvs-util.el (cvs-get-buffer-create):
+	* shell.el (shell-mode):
+	* vc-dir.el (vc-dir-mode):
+	Don't make `list-buffers-directory' buffer local.
+
 2009-09-25  Devon Sean McCullough  <emacs-hacker@Jovi.Net>
 
 	* comint.el (comint-exec, comint-run, make-comint): Doc
--- a/lisp/dired.el	Fri Sep 25 03:42:22 2009 +0000
+++ b/lisp/dired.el	Fri Sep 25 04:35:14 2009 +0000
@@ -1750,10 +1750,10 @@
   (set (make-local-variable 'dired-directory)
        (or dirname default-directory))
   ;; list-buffers uses this to display the dir being edited in this buffer.
-  (set (make-local-variable 'list-buffers-directory)
-       (expand-file-name (if (listp dired-directory)
-			     (car dired-directory)
-			   dired-directory)))
+  (setq list-buffers-directory
+	(expand-file-name (if (listp dired-directory)
+			      (car dired-directory)
+			    dired-directory)))
   (set (make-local-variable 'dired-actual-switches)
        (or switches dired-listing-switches))
   (set (make-local-variable 'font-lock-defaults)
--- a/lisp/files.el	Fri Sep 25 03:42:22 2009 +0000
+++ b/lisp/files.el	Fri Sep 25 04:35:14 2009 +0000
@@ -656,7 +656,7 @@
     (unless (file-executable-p dir)
       (error "Cannot cd to %s:  Permission denied" dir))
     (setq default-directory dir)
-    (set (make-local-variable 'list-buffers-directory) dir)))
+    (setq list-buffers-directory dir)))
 
 (defun cd (dir)
   "Make DIR become the current buffer's default directory.
--- a/lisp/menu-bar.el	Fri Sep 25 03:42:22 2009 +0000
+++ b/lisp/menu-bar.el	Fri Sep 25 04:35:14 2009 +0000
@@ -1687,7 +1687,10 @@
   :type 'boolean
   :group 'menu)
 
-(defvar list-buffers-directory nil)
+(defvar list-buffers-directory nil
+  "String to display in buffer listings for buffers not visiting a file.
+Dired, shell and other modes use this variable.")
+(make-variable-buffer-local 'list-buffers-directory)
 
 (defun menu-bar-select-buffer ()
   (interactive)
--- a/lisp/pcvs-util.el	Fri Sep 25 03:42:22 2009 +0000
+++ b/lisp/pcvs-util.el	Fri Sep 25 04:35:14 2009 +0000
@@ -135,7 +135,7 @@
 	    (when (equal name list-buffers-directory)
 	      (return buf)))))
       (with-current-buffer (create-file-buffer name)
-	(set (make-local-variable 'list-buffers-directory) name)
+	(setq list-buffers-directory name)
 	(current-buffer))))
 
 ;;;;
--- a/lisp/pcvs.el	Fri Sep 25 03:42:22 2009 +0000
+++ b/lisp/pcvs.el	Fri Sep 25 04:35:14 2009 +0000
@@ -399,7 +399,7 @@
       ;;(cvs-minor-mode 1)
       (let ((lbd list-buffers-directory))
 	(if (fboundp mode) (funcall mode) (fundamental-mode))
-	(when lbd (set (make-local-variable 'list-buffers-directory) lbd)))
+	(when lbd (setq list-buffers-directory lbd)))
       (cvs-minor-mode 1)
       ;;(set (make-local-variable 'cvs-buffer) cvs-buf)
       (if normal
@@ -1456,7 +1456,7 @@
   (let ((buf (cvs-temp-buffer "message" 'normal 'nosetup))
 	(setupfun (or (nth 2 (cdr (assoc "message" cvs-buffer-name-alist)))
 		      'log-edit)))
-    (funcall setupfun 'cvs-do-commit setup 
+    (funcall setupfun 'cvs-do-commit setup
 	     '((log-edit-listfun . cvs-commit-filelist)
 	       (log-edit-diff-function . cvs-mode-diff)) buf)
     (set (make-local-variable 'cvs-minor-wrap-function) 'cvs-commit-minor-wrap)
@@ -1521,7 +1521,7 @@
       ;; Set the filename before, so log-edit can correctly setup its
       ;; log-edit-initial-files variable.
       (set (make-local-variable 'cvs-edit-log-files) (list file)))
-    (funcall setupfun 'cvs-do-edit-log nil 
+    (funcall setupfun 'cvs-do-edit-log nil
 	     '((log-edit-listfun . cvs-edit-log-filelist)
 	       (log-edit-diff-function . cvs-mode-diff))
 	     buf)
--- a/lisp/shell.el	Fri Sep 25 03:42:22 2009 +0000
+++ b/lisp/shell.el	Fri Sep 25 04:35:14 2009 +0000
@@ -440,10 +440,9 @@
   (make-local-variable 'shell-last-dir)
   (setq shell-last-dir nil)
   (setq comint-input-autoexpand shell-input-autoexpand)
+  (shell-dirtrack-mode 1)
   ;; This is not really correct, since the shell buffer does not really
   ;; edit this directory.  But it is useful in the buffer list and menus.
-  (make-local-variable 'list-buffers-directory)
-  (shell-dirtrack-mode 1)
   (setq list-buffers-directory (expand-file-name default-directory))
   ;; shell-dependent assignments.
   (when (ring-empty-p comint-input-ring)
--- a/lisp/vc-dir.el	Fri Sep 25 03:42:22 2009 +0000
+++ b/lisp/vc-dir.el	Fri Sep 25 04:35:14 2009 +0000
@@ -928,8 +928,7 @@
     (set (make-local-variable 'vc-ewoc) (ewoc-create #'vc-dir-printer))
     (set (make-local-variable 'revert-buffer-function)
 	 'vc-dir-revert-buffer-function)
-    (set (make-local-variable 'list-buffers-directory)
-         (expand-file-name default-directory))
+    (setq list-buffers-directory (expand-file-name default-directory))
     (add-hook 'after-save-hook 'vc-dir-resynch-file)
     ;; Make sure that if the directory buffer is killed, the update
     ;; process running in the background is also killed.