emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r116523: lisp/desktop.el: Do not fail when desktop-f


From: Juanma Barranquero
Subject: [Emacs-diffs] trunk r116523: lisp/desktop.el: Do not fail when desktop-files-not-to-save is nil.
Date: Sat, 22 Feb 2014 02:11:01 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 116523
revision-id: address@hidden
parent: address@hidden
committer: Juanma Barranquero <address@hidden>
branch nick: trunk
timestamp: Sat 2014-02-22 03:10:49 +0100
message:
  lisp/desktop.el: Do not fail when desktop-files-not-to-save is nil.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/desktop.el                desktop.el-20091113204419-o5vbwnq5f7feedwu-591
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-02-22 00:47:42 +0000
+++ b/lisp/ChangeLog    2014-02-22 02:10:49 +0000
@@ -1,3 +1,9 @@
+2014-02-22  Juanma Barranquero  <address@hidden>
+
+       * desktop.el (desktop-save-buffer-p): Do not fail when
+       desktop-files-not-to-save is nil.  Return t for true result
+       as the doc says.
+
 2014-02-22  Daniel Colascione  <address@hidden>
 
        * net/secrets.el (secrets-create-item,secrets-search-items): Check

=== modified file 'lisp/desktop.el'
--- a/lisp/desktop.el   2014-02-18 01:33:30 +0000
+++ b/lisp/desktop.el   2014-02-22 02:10:49 +0000
@@ -878,23 +878,25 @@
 MODE is the major mode.
 \n\(fn FILENAME BUFNAME MODE)"
   (let ((case-fold-search nil)
-        dired-skip)
-    (and (not (and (stringp desktop-buffers-not-to-save)
-                  (not filename)
-                  (string-match-p 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-p desktop-files-not-to-save filename)))
-             (and (memq mode '(dired-mode vc-dir-mode))
-                  (with-current-buffer bufname
-                    (not (setq dired-skip
-                               (string-match-p desktop-files-not-to-save
-                                               default-directory)))))
-             (and (null filename)
-                  (null dired-skip)     ; bug#5755
-                 (with-current-buffer bufname desktop-save-buffer))))))
+       (no-regexp-to-check (not (stringp desktop-files-not-to-save)))
+       dired-skip)
+    (and (or filename
+            (not (stringp desktop-buffers-not-to-save))
+            (not (string-match-p desktop-buffers-not-to-save bufname)))
+        (not (memq mode desktop-modes-not-to-save))
+        (or (and filename
+                 (or no-regexp-to-check
+                     (not (string-match-p desktop-files-not-to-save 
filename))))
+            (and (memq mode '(dired-mode vc-dir-mode))
+                 (or no-regexp-to-check
+                     (not (setq dired-skip
+                                (with-current-buffer bufname
+                                  (string-match-p desktop-files-not-to-save
+                                                  default-directory))))))
+            (and (null filename)
+                 (null dired-skip)  ; bug#5755
+                 (with-current-buffer bufname desktop-save-buffer)))
+        t)))
 
 ;; ----------------------------------------------------------------------------
 (defun desktop-file-name (filename dirname)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]