]> git.eshelyaron.com Git - emacs.git/commitdiff
(uniquify-managed): Don't defvar.
authorJuanma Barranquero <lekktu@gmail.com>
Thu, 14 Feb 2008 14:37:00 +0000 (14:37 +0000)
committerJuanma Barranquero <lekktu@gmail.com>
Thu, 14 Feb 2008 14:37:00 +0000 (14:37 +0000)
(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
lisp/desktop.el

index ad72539dede2088cdbe5104dc4e8e6b116434f27..339ebb67cebda82dd96e955f6943320ff09cb75c 100644 (file)
@@ -1,3 +1,15 @@
+2008-02-14  Juanma Barranquero  <lekktu@gmail.com>
+
+       * uniquify.el (uniquify-buffer-base-name): New function.
+       Suggested by Stefan Monnier <monnier@iro.umontreal.ca>.
+
+       * 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  <dann@ics.uci.edu>
 
        * 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 <id.brep@gmail.com>
+2008-02-14  Zhang Wei  <id.brep@gmail.com>
 
        * textmodes/org-publish.el (org-publish-timestamp-filename):
        Replace colon characters in filename too.
 
 2008-02-14  Mark A. Hershberger  <mah@everybody.org>
 
-       * 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  <michael.albinus@gmx.de>
 
-       * 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  <monnier@iro.umontreal.ca>
index 19d066a80087b447434665a328025893aa345dc1..f65c68ec4e6af8dd7f08101734060ad8c36a3d0e 100644 (file)
 
 ;;; 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))