GNU bug report logs - #12456
24.2.50; Completion in `Info-goto-node' (cross-manual jump)

Previous Next

Package: emacs;

Reported by: Dani Moncayo <dmoncayo <at> gmail.com>

Date: Sun, 16 Sep 2012 18:01:02 UTC

Severity: normal

Found in version 24.2.50

Fixed in version 24.3.50

Done: Juri Linkov <juri <at> jurta.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> jurta.org>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: 12456 <at> debbugs.gnu.org, Dani Moncayo <dmoncayo <at> gmail.com>
Subject: bug#12456: 24.2.50; Completion in `Info-goto-node' (cross-manual jump)
Date: Tue, 18 Sep 2012 23:03:21 +0300
>> * "(elisp)<TAB>" completes to all nodes in the elisp manual.
>
> Yes, that's the part that's not yet implemented.  Patch welcome,

This can be implemented by this patch.  The remaining problem is
that it's too slow because it doesn't cache completions of non-current
manuals.  Perhaps `Info-build-node-completions' should use `Info-toc-nodes'
that caches node names from all visited manuals.

=== modified file 'lisp/info.el'
--- lisp/info.el	2012-09-13 22:01:45 +0000
+++ lisp/info.el	2012-09-18 20:02:43 +0000
@@ -1778,12 +1778,23 @@ (defun Info-read-node-name-1 (string pre
      (substring string 1)
      predicate
      code))
-   ;; If a file name was given, then any node is fair game.
-   ((string-match "\\`(" string)
-    (cond
-     ((eq code nil) string)
-     ((eq code t) nil)
-     (t t)))
+   ;; If a file name was given, complete nodes in the file.
+   ((string-match "\\`([^)]+)" string)
+    (let ((file (match-string 0 string))
+          (node (substring string (match-end 0))))
+      (completion-table-with-context
+       file
+       (apply-partially
+        (lambda (string pred action)
+          (complete-with-action
+           action
+           (with-temp-buffer
+             (Info-mode)
+             (Info-goto-node (concat file "Top"))
+             (Info-build-node-completions)
+             Info-current-file-completions)
+           string pred)))
+       node predicate code)))
    ;; Otherwise use Info-read-node-completion-table.
    (t (complete-with-action
        code Info-read-node-completion-table string predicate))))





This bug report was last modified 12 years and 140 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.