From a8049a30d55310baa45f5fd0dfd0d3937dd31b00 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Thu, 14 Feb 2008 14:37:00 +0000 Subject: [PATCH] (uniquify-managed): Don't defvar. (desktop-buffer-info): Use `uniquify-buffer-base-name', not `uniquify-managed'. Return also the buffer's base name. (desktop-save): When saving the buffer info, filter out the base name, and save it as buffer name if the buffer is managed by uniquify. (uniquify-item-base): Don't declare; not called anymore. --- lisp/ChangeLog | 27 +++++++++++++++++++-------- lisp/desktop.el | 39 +++++++++++++++++++-------------------- 2 files changed, 38 insertions(+), 28 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ad72539dede..339ebb67ceb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,15 @@ +2008-02-14 Juanma Barranquero + + * uniquify.el (uniquify-buffer-base-name): New function. + Suggested by Stefan Monnier . + + * desktop.el (uniquify-managed): Don't defvar. + (desktop-buffer-info): Use `uniquify-buffer-base-name', not + `uniquify-managed'. Return also the buffer's base name. + (desktop-save): When saving the buffer info, filter out the base name, + and save it as buffer name if the buffer is managed by uniquify. + (uniquify-item-base): Don't declare; not called anymore. + 2008-02-14 Dan Nicolaescu * vc.el (vc-annotate-find-revision-at-line): New function. @@ -13,7 +25,7 @@ * Makefile.in (custom-deps, finder-data, autoloads, recompile): Remove `LC_ALL=C', since it's included in $(emacs) now. -2008-02-14 Zhang Wei +2008-02-14 Zhang Wei * textmodes/org-publish.el (org-publish-timestamp-filename): Replace colon characters in filename too. @@ -31,19 +43,18 @@ 2008-02-14 Mark A. Hershberger - * progmodes/flymake.el (flymake-allowed-file-name-masks): Add - support for .pm files and .php files. + * progmodes/flymake.el (flymake-allowed-file-name-masks): + Add support for .pm files and .php files. (flymake-err-line-patterns): Add pattern for PHP errors. (flymake-php-init): New function. PHP support for flymake. - * progmodes/compile.el (compilation-error-regexp-alist-alist): Add - regular expression for PHP errors. - + * progmodes/compile.el (compilation-error-regexp-alist-alist): + Add regular expression for PHP errors. 2008-02-13 Michael Albinus - * net/ange-ftp.el (ange-ftp-quote-string): Use - `shell-quote-argument'. This DTRT even on w32 machines. + * net/ange-ftp.el (ange-ftp-quote-string): Use `shell-quote-argument'. + This DTRT even on w32 machines. (ange-ftp-cf1): Quote FILENAME. 2008-02-13 Stefan Monnier diff --git a/lisp/desktop.el b/lisp/desktop.el index 19d066a8008..f65c68ec4e6 100644 --- a/lisp/desktop.el +++ b/lisp/desktop.el @@ -135,8 +135,6 @@ ;;; Code: -(defvar uniquify-managed) - (defvar desktop-file-version "206" "Version number of desktop file format. Written into the desktop file and used at desktop read to provide @@ -651,16 +649,14 @@ is nil, ask the user where to save the desktop." value))) ;; ---------------------------------------------------------------------------- -(declare-function uniquify-item-base "uniquify" (cl-x) t) ; defstruct - (defun desktop-buffer-info (buffer) (set-buffer buffer) (list + ;; base name of the buffer; replaces the buffer name if managed by uniquify + (and (fboundp 'uniquify-buffer-base-name) (uniquify-buffer-base-name)) ;; basic information (desktop-file-name (buffer-file-name) desktop-dirname) - (if (bound-and-true-p uniquify-managed) - (uniquify-item-base (car uniquify-managed)) - (buffer-name)) + (buffer-name) major-mode ;; minor modes (let (ret) @@ -890,19 +886,22 @@ See also `desktop-base-file-name'." (insert "\n;; Buffer section -- buffers listed in same order as in buffer list:\n") (dolist (l (mapcar 'desktop-buffer-info (buffer-list))) - (when (apply 'desktop-save-buffer-p l) - (insert "(" - (if (or (not (integerp eager)) - (if (zerop eager) - nil - (setq eager (1- eager)))) - "desktop-create-buffer" - "desktop-append-buffer-args") - " " - desktop-file-version) - (dolist (e l) - (insert "\n " (desktop-value-to-string e))) - (insert ")\n\n"))) + (let ((base (pop l))) + (when (apply 'desktop-save-buffer-p l) + (insert "(" + (if (or (not (integerp eager)) + (if (zerop eager) + nil + (setq eager (1- eager)))) + "desktop-create-buffer" + "desktop-append-buffer-args") + " " + desktop-file-version) + ;; If the base name is non-nil, we save it instead of the buffer name + (when base (setcar (nthcdr 1 l) base)) + (dolist (e l) + (insert "\n " (desktop-value-to-string e))) + (insert ")\n\n")))) (setq default-directory desktop-dirname) (let ((coding-system-for-write 'emacs-mule)) -- 2.39.5