all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: <emacs-devel@gnu.org>
Subject: breadcrumbs for Info . . . . . .
Date: Tue, 10 Jun 2008 16:52:43 -0700	[thread overview]
Message-ID: <009d01c8cb55$13d53e20$0200a8c0@us.oracle.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1132 bytes --]

Breadcrumbs are an orientation and navigation aid for hypertext. They tell you
where you are in the node hierarchy and let you go directly to any ancestor
node. The orientation aid alone is very helpful, particularly when you are
following cross-reference links - it lets you know exactly where in the document
structure you have arrived.

Attached is a patch for adding breadcrumbs to Info.

There is currently no option for turning this off. That could be added if you
think this is something some people won't want sometimes.

I chose not to put any breadcrumbs at the top level (Top) of a manual, and there
is no entry for the manuals directory (dir) in a breadcrumbs chain. These could
be added, if people think it is worth it.

Breadcrumbs look like this (this is for Emacs manual node Numbered Backups),
where each step is a link to the given ancestor node:

  Top > Files > Saving > Backup

Breadcrumbs are on a single line, directly under the node navigation line (which
is just under the header line).

Change log entry:

2008-06-10 Drew Adams  <drew.adams@oracle.com>
	* info.el:
	(Info-fontify-node): Added breadcrumbs.

[-- Attachment #2: info-el-2008-06-10.patch --]
[-- Type: application/octet-stream, Size: 2577 bytes --]

diff -u -w info.el info-patched-2008-06-10.el
--- info.el	2008-06-10 16:24:28.000000000 -0700
+++ info-patched-2008-06-10.el	2008-06-10 16:27:08.000000000 -0700
@@ -3756,6 +3756,30 @@
 		((string-equal (downcase tag) "prev") Info-prev-link-keymap)
 		((string-equal (downcase tag) "next") Info-next-link-keymap)
 		((string-equal (downcase tag) "up"  ) Info-up-link-keymap))))))
+        
+        ;; Add breadcrumbs
+        (unless (string= "Top" Info-current-node)
+          (let ((nod Info-current-node)
+                (onode Info-current-node)
+                (crumbs nil)
+                (done nil))
+            (while (not done)
+              (let ((up (Info-extract-pointer "up")))
+                (cond ((string= "Top" up)
+                       (setq crumbs (if crumbs
+                                        (concat "*Note Top:: > " crumbs)
+                                      "*Note Top::"))
+                       (setq done t))
+                      (t
+                       (Info-goto-node up)
+                       (setq nod Info-current-node)
+                       (when crumbs (setq crumbs (concat " > " crumbs)))
+                       (setq crumbs (concat "*Note " nod ":: " crumbs))))))
+            (Info-goto-node onode)
+            (forward-line 1)
+            (insert (concat crumbs "\n\n"))))
+        
+        ;; Treat header line
         (when Info-use-header-line
           (goto-char (point-min))
           (let* ((header-end (line-end-position))
@@ -3817,13 +3841,15 @@
       ;; Fontify cross references
       (goto-char (point-min))
       (when (or not-fontified-p fontify-visited-p)
-        (while (re-search-forward "\\(\\*Note[ \n\t]+\\)\\([^:]*\\)\\(:[ \t]*\\([^.,:(]*\\)\\(\\(([^)]*)\\)[^.,:]*\\)?[,:]?\n?\\)" nil t)
+        (while (re-search-forward "\\(\\*Note[ \n\t]+\\)\\([^:]*\\)\\(:[ \t]*\
+\\([^.,:(]*\\)\\(\\(([^)]*)\\)[^.,:]*\\)?[,:]?\n?\\)" nil t)
           (let ((start (match-beginning 0))
                 (next (point))
                 other-tag)
             (when not-fontified-p
               (when Info-hide-note-references
-                (when (not (eq Info-hide-note-references 'hide))
+                (when (and (not (eq Info-hide-note-references 'hide))
+                           (> (line-number-at-pos) 4)) ; Skip breadcrumbs
                   ;; *Note is often used where *note should have been
                   (goto-char start)
                   (skip-syntax-backward " ")

Diff finished.  Tue Jun 10 16:27:37 2008

             reply	other threads:[~2008-06-10 23:52 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-10 23:52 Drew Adams [this message]
2008-06-11  0:04 ` breadcrumbs for Info . . . . . Juri Linkov
2008-06-11  3:18   ` Drew Adams
2008-06-11  9:34     ` Juri Linkov
2008-06-11 13:46       ` Drew Adams
2008-06-11 18:59         ` Eli Zaretskii
2008-06-11 22:40         ` Juri Linkov
2008-06-12  2:01           ` Miles Bader
2008-06-12 22:42           ` Drew Adams
2008-06-13  3:27             ` Stefan Monnier
2008-06-13  6:34               ` Drew Adams
2008-06-13  8:43                 ` Thien-Thi Nguyen
2008-06-13 13:55                   ` Drew Adams
2008-06-13 17:17                     ` Thien-Thi Nguyen
2008-06-13 17:52                       ` Drew Adams
2008-06-13 19:55                         ` Thien-Thi Nguyen
2008-06-13 20:10                           ` Drew Adams
2008-06-15 18:19                           ` Juri Linkov
2008-06-13 14:05                   ` Stefan Monnier
2008-06-13 15:12                     ` Drew Adams
2008-06-13 17:16                       ` Stefan Monnier
2008-06-13 18:32                     ` Thien-Thi Nguyen
2008-06-14  9:47                       ` Eli Zaretskii
2008-06-14 10:01                         ` Thien-Thi Nguyen
2008-06-13 13:58                 ` Stefan Monnier
2008-06-13 15:11                   ` Drew Adams
2008-06-13 20:34                     ` Stefan Monnier
2008-06-13 22:11                       ` Drew Adams
2008-06-13 22:44                         ` Stefan Monnier
2008-06-14  9:45                           ` Drew Adams
2008-06-14 16:16                             ` Stefan Monnier
2008-06-14 17:24                               ` Drew Adams
2008-06-14 18:04                                 ` Stefan Monnier
2008-06-15  0:27                                 ` Juri Linkov
2008-06-15  7:33                                   ` Drew Adams
2008-06-15 18:23                                     ` Juri Linkov
2008-06-15 19:46                                       ` Drew Adams
2008-06-15  0:28                       ` Juri Linkov
2008-06-15  2:04                         ` Stefan Monnier
2008-06-15 18:18                           ` Juri Linkov
2008-06-15  7:55                         ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='009d01c8cb55$13d53e20$0200a8c0@us.oracle.com' \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.