emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r100151: Add `slow' and `history' tag


From: Juri Linkov
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r100151: Add `slow' and `history' tags to the desktop data.
Date: Thu, 06 May 2010 00:56:15 +0300
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 100151
committer: Juri Linkov <address@hidden>
branch nick: trunk
timestamp: Thu 2010-05-06 00:56:15 +0300
message:
  Add `slow' and `history' tags to the desktop data.
  
  * info.el (Info-virtual-nodes) [*Index*]: Add `slow' tag.
  (Info-virtual-files) [*Apropos*]: Add `slow' tag.
  (Info-finder-find-node): Require `finder.el' to be able
  to restore node from the desktop.
  (Info-desktop-buffer-misc-data): Save all nodes.  Save additional
  data `Info-history' and `slow' tag in the assoc list.
  (Info-restore-desktop-buffer): Don't restore nodes with the
  `slow' tag.  Restore `Info-history'.
modified:
  lisp/ChangeLog
  lisp/info.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2010-05-05 10:20:23 +0000
+++ b/lisp/ChangeLog    2010-05-05 21:56:15 +0000
@@ -1,3 +1,16 @@
+2010-05-05  Juri Linkov  <address@hidden>
+
+       Add `slow' and `history' tags to the desktop data.
+
+       * info.el (Info-virtual-nodes) [*Index*]: Add `slow' tag.
+       (Info-virtual-files) [*Apropos*]: Add `slow' tag.
+       (Info-finder-find-node): Require `finder.el' to be able
+       to restore node from the desktop.
+       (Info-desktop-buffer-misc-data): Save all nodes.  Save additional
+       data `Info-history' and `slow' tag in the assoc list.
+       (Info-restore-desktop-buffer): Don't restore nodes with the
+       `slow' tag.  Restore `Info-history'.
+
 2010-05-05  Michael Albinus  <address@hidden>
 
        Add FORCE argument to `delete-file'.

=== modified file 'lisp/info.el'
--- a/lisp/info.el      2010-04-20 18:52:07 +0000
+++ b/lisp/info.el      2010-05-05 21:56:15 +0000
@@ -3104,6 +3104,7 @@
 (add-to-list 'Info-virtual-nodes
             '("\\`\\*Index.*\\*\\'"
               (find-node . Info-virtual-index-find-node)
+              (slow . t)
               ))
 
 (defvar Info-virtual-index-nodes nil
@@ -3193,6 +3194,7 @@
               (toc-nodes . Info-apropos-toc-nodes)
               (find-file . Info-apropos-find-file)
               (find-node . Info-apropos-find-node)
+              (slow . t)
               ))
 
 (defvar Info-apropos-file "*Apropos*"
@@ -3348,6 +3350,7 @@
 
 (defun Info-finder-find-node (filename nodename &optional no-going-back)
   "Finder-specific implementation of Info-find-node-2."
+  (require 'finder)
   (cond
    ((equal nodename "Top")
     ;; Display Top menu with descriptions of the keywords
@@ -4836,21 +4839,35 @@
 
 (defun Info-desktop-buffer-misc-data (desktop-dirname)
   "Auxiliary information to be saved in desktop file."
-  (unless (Info-virtual-file-p Info-current-file)
-    (list Info-current-file Info-current-node)))
+  (list Info-current-file
+       Info-current-node
+       ;; Additional data as an association list.
+       (delq nil (list
+                  (and Info-history
+                       (cons 'history Info-history))
+                  (and (Info-virtual-fun
+                        'slow Info-current-file Info-current-node)
+                       (cons 'slow t))))))
 
 (defun Info-restore-desktop-buffer (desktop-buffer-file-name
                                     desktop-buffer-name
                                     desktop-buffer-misc)
   "Restore an Info buffer specified in a desktop file."
-  (let ((first (nth 0 desktop-buffer-misc))
-        (second (nth 1 desktop-buffer-misc)))
-  (when (and first second)
-    (when desktop-buffer-name
-      (set-buffer (get-buffer-create desktop-buffer-name))
-      (Info-mode))
-    (Info-find-node first second)
-    (current-buffer))))
+  (let* ((file (nth 0 desktop-buffer-misc))
+        (node (nth 1 desktop-buffer-misc))
+        (data (nth 2 desktop-buffer-misc))
+        (hist (assq 'history data))
+        (slow (assq 'slow data)))
+    ;; Don't restore nodes slow to regenerate.
+    (unless slow
+      (when (and file node)
+       (when desktop-buffer-name
+         (set-buffer (get-buffer-create desktop-buffer-name))
+         (Info-mode))
+       (Info-find-node file node)
+       (when hist
+         (setq Info-history (cdr hist)))
+       (current-buffer)))))
 
 (add-to-list 'desktop-buffer-mode-handlers
             '(Info-mode . Info-restore-desktop-buffer))


reply via email to

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