aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2009-07-18 11:59:04 +0000
committerEli Zaretskii2009-07-18 11:59:04 +0000
commita6c2c80cdd8abfb59abcb6c08b42115c50a4aa0b (patch)
treecb04ce3df0fe9658d3468fbfdb40e4e6021272b9
parentf22693fc454b156005fdf786bb26036b1a543df0 (diff)
downloademacs-a6c2c80cdd8abfb59abcb6c08b42115c50a4aa0b.tar.gz
emacs-a6c2c80cdd8abfb59abcb6c08b42115c50a4aa0b.zip
(desktop-buffers-not-to-save): Default value is nil. Accept nil in
addition to a regexp. (desktop-files-not-to-save): Add "(ftp)$" to the default regexp. Accept nil in addition to a regexp. (desktop-save-buffer-p): Don't use desktop-buffers-not-to-save for buffers that have an associated file. Handle nil values of desktop-buffers-not-to-save and desktop-files-not-to-save. (Bug#3833)
-rw-r--r--lisp/ChangeLog9
-rw-r--r--lisp/desktop.el18
2 files changed, 19 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 2849d3639ac..00e8e0bf598 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,14 @@
12009-07-18 Eli Zaretskii <eliz@gnu.org> 12009-07-18 Eli Zaretskii <eliz@gnu.org>
2 2
3 * desktop.el (desktop-buffers-not-to-save): Default value is nil.
4 Accept nil in addition to a regexp.
5 (desktop-files-not-to-save): Add "(ftp)$" to the default regexp.
6 Accept nil in addition to a regexp.
7 (desktop-save-buffer-p): Don't use desktop-buffers-not-to-save for
8 buffers that have an associated file. Handle nil values of
9 desktop-buffers-not-to-save and desktop-files-not-to-save.
10 (Bug#3833)
11
3 * term/pc-win.el (x-selection-owner-p, x-own-selection-internal) 12 * term/pc-win.el (x-selection-owner-p, x-own-selection-internal)
4 (x-disown-selection-internal): New functions. 13 (x-disown-selection-internal): New functions.
5 14
diff --git a/lisp/desktop.el b/lisp/desktop.el
index aae6b971202..b2c04e26ea9 100644
--- a/lisp/desktop.el
+++ b/lisp/desktop.el
@@ -333,19 +333,18 @@ modes are restored automatically; they should not be listed here."
333 :type '(repeat symbol) 333 :type '(repeat symbol)
334 :group 'desktop) 334 :group 'desktop)
335 335
336;; We skip .log files because they are normally temporary. 336(defcustom desktop-buffers-not-to-save nil
337;; (ftp) files because they require passwords and whatnot.
338(defcustom desktop-buffers-not-to-save
339 "\\(^nn\\.a[0-9]+\\|(ftp)\\)$"
340 "Regexp identifying buffers that are to be excluded from saving." 337 "Regexp identifying buffers that are to be excluded from saving."
341 :type 'regexp 338 :type '(choice (const :tag "None" nil)
339 regexp)
342 :group 'desktop) 340 :group 'desktop)
343 341
344;; Skip tramp and ange-ftp files 342;; Skip tramp and ange-ftp files
345(defcustom desktop-files-not-to-save 343(defcustom desktop-files-not-to-save
346 "^/[^/:]*:" 344 "\\(^/[^/:]*:\\|(ftp)$\\)"
347 "Regexp identifying files whose buffers are to be excluded from saving." 345 "Regexp identifying files whose buffers are to be excluded from saving."
348 :type 'regexp 346 :type '(choice (const :tag "None" nil)
347 regexp)
349 :group 'desktop) 348 :group 'desktop)
350 349
351;; We skip TAGS files to save time (tags-file-name is saved instead). 350;; We skip TAGS files to save time (tags-file-name is saved instead).
@@ -812,9 +811,12 @@ FILENAME is the visited file name, BUFNAME is the buffer name, and
812MODE is the major mode. 811MODE is the major mode.
813\n\(fn FILENAME BUFNAME MODE)" 812\n\(fn FILENAME BUFNAME MODE)"
814 (let ((case-fold-search nil)) 813 (let ((case-fold-search nil))
815 (and (not (string-match desktop-buffers-not-to-save bufname)) 814 (and (not (and (stringp desktop-buffers-not-to-save)
815 (not filename)
816 (string-match desktop-buffers-not-to-save bufname)))
816 (not (memq mode desktop-modes-not-to-save)) 817 (not (memq mode desktop-modes-not-to-save))
817 (or (and filename 818 (or (and filename
819 (stringp desktop-files-not-to-save)
818 (not (string-match desktop-files-not-to-save filename))) 820 (not (string-match desktop-files-not-to-save filename)))
819 (and (eq mode 'dired-mode) 821 (and (eq mode 'dired-mode)
820 (with-current-buffer bufname 822 (with-current-buffer bufname