changeset 107543:c56cc351f300

Close bug#5755. * desktop.el (desktop-save-buffer-p): Don't mistakenly include all dired buffers, even tramp ones.
author Glenn Morris <rgm@gnu.org>
date Wed, 24 Mar 2010 23:18:17 -0700
parents 0e139e55fc1b
children afbf4ad814c7
files lisp/ChangeLog lisp/desktop.el
diffstat 2 files changed, 14 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Wed Mar 24 20:14:42 2010 -0500
+++ b/lisp/ChangeLog	Wed Mar 24 23:18:17 2010 -0700
@@ -1,3 +1,8 @@
+2010-03-25  Glenn Morris  <rgm@gnu.org>
+
+	* desktop.el (desktop-save-buffer-p): Don't mistakenly include
+	all dired buffers, even tramp ones.  (Bug#5755)
+
 2010-03-25  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	Add "union tags" in mpc.el.
--- a/lisp/desktop.el	Wed Mar 24 20:14:42 2010 -0500
+++ b/lisp/desktop.el	Wed Mar 24 23:18:17 2010 -0700
@@ -1,7 +1,8 @@
 ;;; desktop.el --- save partial status of Emacs when killed
 
 ;; Copyright (C) 1993, 1994, 1995, 1997, 2000, 2001, 2002, 2003,
-;;   2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+;;   2004, 2005, 2006, 2007, 2008, 2009, 2010
+;;   Free Software Foundation, Inc.
 
 ;; Author: Morten Welinder <terra@diku.dk>
 ;; Keywords: convenience
@@ -811,19 +812,23 @@
 FILENAME is the visited file name, BUFNAME is the buffer name, and
 MODE is the major mode.
 \n\(fn FILENAME BUFNAME MODE)"
-  (let ((case-fold-search nil))
+  (let ((case-fold-search nil)
+        dired-skip)
     (and (not (and (stringp desktop-buffers-not-to-save)
 		   (not filename)
 		   (string-match desktop-buffers-not-to-save bufname)))
          (not (memq mode desktop-modes-not-to-save))
+         ;; FIXME this is broken if desktop-files-not-to-save is nil.
          (or (and filename
 		  (stringp desktop-files-not-to-save)
                   (not (string-match desktop-files-not-to-save filename)))
              (and (eq mode 'dired-mode)
                   (with-current-buffer bufname
-                    (not (string-match desktop-files-not-to-save
-                                       default-directory))))
+                    (not (setq dired-skip
+                               (string-match desktop-files-not-to-save
+                                             default-directory)))))
              (and (null filename)
+                  (null dired-skip)     ; bug#5755
 		  (with-current-buffer bufname desktop-save-buffer))))))
 
 ;; ----------------------------------------------------------------------------