emacs-devel
[Top][All Lists]
Advanced

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

info-lookup populates Info-history


From: martin rudalics
Subject: info-lookup populates Info-history
Date: Tue, 11 Dec 2007 08:31:16 +0100
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

`info-lookup' populates the `Info-history' stack with all index nodes it
visits when searching for an appropriate entry.  This gives annoyance in
`Info-history-back' because I usually never want to visit such nodes.

The attached patch should avoid this and also that such nodes enter
`Info-history-list'.  If there are no objections I'd like to apply in
a couple of days.
*** info-look.el.~1.58.~        Mon Aug 13 16:41:02 2007
--- info-look.el        Sun Dec  2 18:17:10 2007
***************
*** 328,333 ****
--- 328,341 ----
                      (error "Not documented as a %s: %s" topic (or item ""))))
           (modes (info-lookup->all-modes topic mode))
           (window (selected-window))
+        (new-Info-history
+         ;; Avoid clobbering Info-history with nodes searched during
+         ;; lookup.  If lookup succeeds set `Info-history' to
+         ;; `new-Info-history'.
+         (when (get-buffer "*info*")
+           (with-current-buffer "*info*"
+             (cons (list Info-current-file Info-current-node (point))
+                   Info-history))))
           found doc-spec node prefix suffix doc-found)
      (if (not (eq major-mode 'Info-mode))
        (if (not info-lookup-other-window-flag)
***************
*** 355,361 ****
                  (progn
                    ;; Don't need Index menu fontifications here, and
                    ;; they slow down the lookup.
!                   (let (Info-fontify-maximum-menu-size)
                      (Info-goto-node node)
                      (setq doc-found t)))
                (error
--- 363,370 ----
                  (progn
                    ;; Don't need Index menu fontifications here, and
                    ;; they slow down the lookup.
!                   (let (Info-fontify-maximum-menu-size
!                         Info-history-list)
                      (Info-goto-node node)
                      (setq doc-found t)))
                (error
***************
*** 400,405 ****
--- 409,416 ----
      (unless (or ignore-case
                  (string-equal item (car entry)))
        (message "Found in different case: %s" (car entry)))
+     (when found
+       (setq Info-history new-Info-history))
      (or doc-found
        (error "Info documentation for lookup was not found"))
      ;; Don't leave the Info buffer if the help item couldn't be looked up.
***************
*** 409,415 ****
  (defun info-lookup-setup-mode (topic mode)
    "Initialize the internal data structure."
    (or (info-lookup->initialized topic mode)
!       (let (cell data (initialized 0) completions refer-modes)
        (if (not (info-lookup->mode-value topic mode))
            (message "No %s help available for `%s'" topic mode)
          ;; Recursively setup cross references.
--- 420,427 ----
  (defun info-lookup-setup-mode (topic mode)
    "Initialize the internal data structure."
    (or (info-lookup->initialized topic mode)
!       (let ((initialized 0)
!           cell data completions refer-modes Info-history-list)
        (if (not (info-lookup->mode-value topic mode))
            (message "No %s help available for `%s'" topic mode)
          ;; Recursively setup cross references.
***************
*** 444,450 ****
    (let ((doc-spec (info-lookup->doc-spec topic mode))
        (regexp (concat "^\\(" (info-lookup->regexp topic mode)
                        "\\)\\([ \t].*\\)?$"))
!       Info-fontify-maximum-menu-size
        node trans entry item prefix result doc-found
        (buffer (get-buffer-create " temp-info-look")))
      (with-current-buffer buffer
--- 456,462 ----
    (let ((doc-spec (info-lookup->doc-spec topic mode))
        (regexp (concat "^\\(" (info-lookup->regexp topic mode)
                        "\\)\\([ \t].*\\)?$"))
!       Info-history-list Info-fontify-maximum-menu-size
        node trans entry item prefix result doc-found
        (buffer (get-buffer-create " temp-info-look")))
      (with-current-buffer buffer

reply via email to

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