From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.bugs Subject: bug#5809: 23.1.94; cross-reference by anchor yields in accurate position Date: Mon, 5 Apr 2010 16:17:04 -0700 Message-ID: References: <837hoszubi.fsf@gnu.org> <87hbnwy2un.fsf@mail.jurta.org><83y6h8xz8a.fsf@gnu.org> <8739zf5bif.fsf@mail.jurta.org><83y6h7vy6p.fsf@gnu.org> <87y6h7uitd.fsf@mail.jurta.org><83wrwqx6r2.fsf@gnu.org> <83vdcax5hu.fsf@gnu.org> <83sk7ewcvz.fsf@gnu.org><422BAD8C75BE4F5BAE608BD47A355EFF@us.oracle.com><83d3yhx6jr.fsf@gnu.org><83C1972058E043DB8B80FEFB5A317A98@us.oracle.com><83eiivymf6.fsf@gnu.org><4173056BC32F4835955C1B5A781D37EE@us.oracle.com><87wrwmvjfe.fsf@mail.jurta.org><87hbnqoza2.fsf@mail.jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0052_01CAD4DB.6F2013E0" X-Trace: dough.gmane.org 1270510072 16666 80.91.229.12 (5 Apr 2010 23:27:52 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 5 Apr 2010 23:27:52 +0000 (UTC) Cc: 5809@debbugs.gnu.org To: "'Stefan Monnier'" , "'Juri Linkov'" , "'Eli Zaretskii'" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Apr 06 01:27:50 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Nyvhp-0005Kc-PW for geb-bug-gnu-emacs@m.gmane.org; Tue, 06 Apr 2010 01:27:47 +0200 Original-Received: from localhost ([127.0.0.1]:38141 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nyvhp-0004Y7-8b for geb-bug-gnu-emacs@m.gmane.org; Mon, 05 Apr 2010 19:27:45 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NyvgC-0004CU-Ov for bug-gnu-emacs@gnu.org; Mon, 05 Apr 2010 19:26:04 -0400 Original-Received: from [140.186.70.92] (port=46186 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NyvgA-0004CM-Fw for bug-gnu-emacs@gnu.org; Mon, 05 Apr 2010 19:26:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nyvg9-0001oi-2Z for bug-gnu-emacs@gnu.org; Mon, 05 Apr 2010 19:26:02 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:40188) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nyvg8-0001od-Us for bug-gnu-emacs@gnu.org; Mon, 05 Apr 2010 19:26:00 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1NyvaN-0003MW-EN; Mon, 05 Apr 2010 19:20:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Drew Adams" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 05 Apr 2010 23:20:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 5809 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 5809-submit@debbugs.gnu.org id=B5809.127050954212914 (code B ref 5809); Mon, 05 Apr 2010 23:20:03 +0000 Original-Received: (at 5809) by debbugs.gnu.org; 5 Apr 2010 23:19:02 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NyvZO-0003MF-HK for submit@debbugs.gnu.org; Mon, 05 Apr 2010 19:19:02 -0400 Original-Received: from rcsinet11.oracle.com ([148.87.113.123]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NyvZM-0003Lu-0k for 5809@debbugs.gnu.org; Mon, 05 Apr 2010 19:19:00 -0400 Original-Received: from rcsinet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by rcsinet11.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id o35NIr1A009746 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 5 Apr 2010 23:18:55 GMT Original-Received: from acsmt355.oracle.com (acsmt355.oracle.com [141.146.40.155]) by rcsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o35NIpJE023896; Mon, 5 Apr 2010 23:18:52 GMT Original-Received: from abhmt009.oracle.com by acsmt353.oracle.com with ESMTP id 148453101270509428; Mon, 05 Apr 2010 16:17:08 -0700 Original-Received: from dradamslap1 (/141.144.225.69) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 05 Apr 2010 16:17:08 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: AcrU/Cfq3mVF/uNxRmmdVQpx6tWcJQAEtM4g X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Message-Flag: Follow up X-Source-IP: acsmt355.oracle.com [141.146.40.155] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090208.4BBA6FDD.015F:SCFMA4539814,ss=1,fgs=0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Mon, 05 Apr 2010 19:20:03 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:35962 Archived-At: This is a multi-part message in MIME format. ------=_NextPart_000_0052_01CAD4DB.6F2013E0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit OK, FWIW, here's another idea. This doesn't respond to a general need for multi-line headers or multiple headers or any of the other things discussed so far. This is just an alternative breadcrumbs approach for Info. The idea is to use the mode line, not a header line, for breadcrumbs. Please try the attached patch, which is against info.el from today (it also works fine against the 95 pretest). It will take you only a moment to try. By default (in this patch at least) breadcrumbs are turned off. You can turn them on using `Info-breadcrumbs-mode', which is in the Info menu as `Toggle Breadcrumbs'. (That menu is of course also on the `Info' minor-mode lighter in the mode line.) When breadcrumbs are shown, they are all that is shown in the mode line. Mouse-2 on a node of the breadcrumbs path takes you to that node. Mouse-1 anywhere on the breadcrumbs brings up a `Breadcrumbs' menu, with these items: Set Breadcrumbs Depth Toggle Breadcrumbs Previous Node Next Node The previous and next items are there only when there is really a previous or next node. Setting the depth here (first menu item) does not change the value of option `Info-breadcrumbs-depth'. It's pretty simple - give it a try; you might like it. The mode line, like the header line, is always handy - no need to scroll. A possible change: Add a menu item `Customize Breadcrumbs Depth' for customizing `Info-breadcrumbs-depth', the default depth. Another possible change: Put back the size indication mode when breadcrumbs are shown. I don't miss it (the scroll bar is enough), but you might want it. There is probably room for it, even for manuals that have several levels and long node names. Another possible change: put back the read-only/writable indicator. Or perhaps just turn off breadcrumbs mode whenever someone edits an Info node. I don't think you'll miss any of the other stuff that is normally in the mode line. I don't. ------=_NextPart_000_0052_01CAD4DB.6F2013E0 Content-Type: application/octet-stream; name="info-2010-04-05.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="info-2010-04-05.patch" diff -cw info-BZR-2010-04-05.el info-patched-2010-04-05.el=0A= *** info-BZR-2010-04-05.el Mon Apr 5 07:48:52 2010=0A= --- info-patched-2010-04-05.el Mon Apr 5 15:41:04 2010=0A= ***************=0A= *** 240,245 ****=0A= --- 240,248 ----=0A= 0 means do not display breadcrumbs."=0A= :type 'integer)=0A= =0A= + (defvar Info-breadcrumbs-depth-internal Info-breadcrumbs-depth=0A= + "Current breadcrumbs depth for Info.")=0A= + =0A= (defcustom Info-search-whitespace-regexp "\\s-+"=0A= "If non-nil, regular expression to match a sequence of whitespace = chars.=0A= This applies to Info search for regular expressions.=0A= ***************=0A= *** 1053,1061 ****=0A= (Info-select-node)=0A= (goto-char (point-min))=0A= (forward-line 1) ; skip header line=0A= - (when (> Info-breadcrumbs-depth 0) ; skip breadcrumbs line=0A= - (forward-line 1))=0A= - =0A= (cond (anchorpos=0A= (let ((new-history (list Info-current-file=0A= (substring-no-properties = nodename))))=0A= --- 1056,1061 ----=0A= ***************=0A= *** 1076,1082 ****=0A= (let ((hist (car Info-history)))=0A= (setq Info-history (cdr Info-history))=0A= (Info-find-node (nth 0 hist) (nth 1 hist) t)=0A= ! (goto-char (nth 2 hist))))))=0A= =0A= ;; Cache the contents of the (virtual) dir file, once we have merged=0A= ;; it for the first time, so we can save time subsequently.=0A= --- 1076,1083 ----=0A= (let ((hist (car Info-history)))=0A= (setq Info-history (cdr Info-history))=0A= (Info-find-node (nth 0 hist) (nth 1 hist) t)=0A= ! (goto-char (nth 2 hist)))))=0A= ! (if Info-breadcrumbs-mode (Info-insert-breadcrumbs) = (Info-set-mode-line)))=0A= =0A= ;; Cache the contents of the (virtual) dir file, once we have merged=0A= ;; it for the first time, so we can save time subsequently.=0A= ***************=0A= *** 3690,3695 ****=0A= --- 3691,3698 ----=0A= :help "Go to final node in this file"]=0A= ("Menu Item" ["You should never see this" report-emacs-bug t])=0A= ("Reference" ["You should never see this" report-emacs-bug t])=0A= + ["Toggle Breadcrumbs" Info-breadcrumbs-mode=0A= + :help "Toggle showing breadcrumbs in the mode line"]=0A= ["Search..." Info-search=0A= :help "Search for regular expression in this Info file"]=0A= ["Search Next" Info-search-next=0A= ***************=0A= *** 4196,4237 ****=0A= (let ((nodes (Info-toc-nodes Info-current-file))=0A= (node Info-current-node)=0A= (crumbs ())=0A= ! (depth Info-breadcrumbs-depth))=0A= ! =0A= ;; Get ancestors from the cached parent-children node info=0A= (while (and (not (equal "Top" node)) (> depth 0))=0A= (setq node (nth 1 (assoc node nodes)))=0A= ! (if node (push node crumbs))=0A= (setq depth (1- depth)))=0A= - =0A= ;; Add bottom node.=0A= ! (when Info-use-header-line=0A= ! ;; Let it disappear if crumbs is nil.=0A= ! (nconc crumbs (list Info-current-node)))=0A= ! (when (or Info-use-header-line crumbs)=0A= ;; Add top node (and continuation if needed).=0A= ! (setq crumbs=0A= ! (cons "Top" (if (member (pop crumbs) '(nil "Top"))=0A= ! crumbs (cons nil crumbs))))=0A= ! ;; Eliminate duplicate.=0A= ! (forward-line 1)=0A= (dolist (node crumbs)=0A= ! (let ((text=0A= ! (if (not (equal node "Top")) node=0A= ! (format "(%s)Top"=0A= (if (stringp Info-current-file)=0A= (file-name-nondirectory Info-current-file)=0A= ;; Some legacy code can still use a symbol.=0A= ! Info-current-file)))))=0A= ! (insert (if (bolp) "" " > ")=0A= ! (cond=0A= ! ((null node) "...")=0A= ! ((equal node Info-current-node)=0A= ! ;; No point linking to ourselves.=0A= ! (propertize text 'font-lock-face 'info-header-node))=0A= ! (t=0A= ! (concat "*Note " text "::"))))))=0A= ! (insert "\n"))))=0A= =0A= (defun Info-fontify-node ()=0A= "Fontify the node."=0A= --- 4199,4275 ----=0A= (let ((nodes (Info-toc-nodes Info-current-file))=0A= (node Info-current-node)=0A= (crumbs ())=0A= ! (depth Info-breadcrumbs-depth-internal)=0A= ! (text ""))=0A= ;; Get ancestors from the cached parent-children node info=0A= (while (and (not (equal "Top" node)) (> depth 0))=0A= (setq node (nth 1 (assoc node nodes)))=0A= ! (when node (push node crumbs))=0A= (setq depth (1- depth)))=0A= ;; Add bottom node.=0A= ! (setq crumbs (nconc crumbs (list Info-current-node)))=0A= ! (when crumbs=0A= ;; Add top node (and continuation if needed).=0A= ! (setq crumbs (cons "Top" (if (member (pop crumbs) '(nil "Top"))=0A= ! crumbs=0A= ! (cons nil crumbs))))=0A= (dolist (node crumbs)=0A= ! (when node=0A= ! (setq node ; Breadcrumbs map=0A= ! (propertize node=0A= ! 'local-map (let ((map = (make-sparse-keymap))=0A= ! (menu-map = (make-sparse-keymap "Breadcrumbs")))=0A= ! (define-key menu-map = [Info-prev]=0A= ! `(menu-item "Previous Node" = Info-prev=0A= ! :visible = ,(Info-check-pointer "prev[ious]*")=0A= ! :help "Go to = the previous node"))=0A= ! (define-key menu-map = [Info-next]=0A= ! `(menu-item "Next Node" = Info-next=0A= ! :visible = ,(Info-check-pointer "next")=0A= ! :help "Go to = the next node"))=0A= ! (define-key menu-map = [separator] '("--"))=0A= ! (define-key menu-map = [Info-breadcrumbs-mode]=0A= ! `(menu-item "Toggle = Breadcrumbs" Info-breadcrumbs-mode=0A= ! :help "Toggle = displaying breadcrumbs in the Info mode-line"=0A= ! :button = (:toggle . Info-breadcrumbs-mode)))=0A= ! (define-key menu-map = [Info-set-breadcrumbs-depth]=0A= ! `(menu-item "Set = Breadcrumbs Depth" Info-set-breadcrumbs-depth=0A= ! :help "Set = depth of breadcrumbs to show in the mode-line"))=0A= ! (define-key map [mode-line = down-mouse-1] menu-map)=0A= ! (define-key map [mode-line = down-mouse-2]=0A= ! `(lambda () (interactive) = (Info-goto-node ,node)))=0A= ! map)=0A= ! 'help-echo (concat "mouse-1: Menu"=0A= ! (if (equal node = Info-current-node)"" ", mouse-2: Go to this node")))))=0A= ! (let ((nodetext (if (not (equal node "Top"))=0A= ! node=0A= ! (format "(%s)%s"=0A= (if (stringp Info-current-file)=0A= (file-name-nondirectory = Info-current-file)=0A= ;; Some legacy code can still use = a symbol.=0A= ! Info-current-file)=0A= ! node))))=0A= ! (setq text (concat text (if (equal node "Top") "" " > ")=0A= ! (if node nodetext "...")))))=0A= ! (make-local-variable 'mode-line-format) ; Needed for Emacs 21+.=0A= ! (setq mode-line-format text))))=0A= ! =0A= ! (define-minor-mode Info-breadcrumbs-mode=0A= ! "Toggle the use of breadcrumbs in Info mode line.=0A= ! With arg, show breadcrumbs iff arg is positive."=0A= ! :group 'mode-line :group 'info=0A= ! (if (not Info-breadcrumbs-mode)=0A= ! (setq Info-breadcrumbs-depth-internal 0=0A= ! mode-line-format default-mode-line-format)=0A= ! (setq Info-breadcrumbs-depth-internal Info-breadcrumbs-depth)=0A= ! (Info-insert-breadcrumbs)))=0A= ! =0A= ! (defun Info-set-breadcrumbs-depth ()=0A= ! "Set current breadcrumbs depth to a value read from user."=0A= ! (interactive)=0A= ! (setq Info-breadcrumbs-depth-internal (read-number "New breadcrumbs = depth: "=0A= ! = Info-breadcrumbs-depth-internal))=0A= ! (Info-insert-breadcrumbs))=0A= =0A= (defun Info-fontify-node ()=0A= "Fontify the node."=0A= ***************=0A= *** 4278,4286 ****=0A= ((string-equal (downcase tag) "next") Info-next-link-keymap)=0A= ((string-equal (downcase tag) "up" ) Info-up-link-keymap))))))=0A= =0A= - (when (> Info-breadcrumbs-depth 0)=0A= - (Info-insert-breadcrumbs))=0A= - =0A= ;; Treat header line.=0A= (when Info-use-header-line=0A= (goto-char (point-min))=0A= --- 4316,4321 ----=0A= ***************=0A= *** 4307,4321 ****=0A= "%"=0A= ;; Preserve text properties on duplicated `%'.=0A= (lambda (s) (concat s s)) header))=0A= ! ;; Hide the part of the first line=0A= ! ;; that is in the header, if it is just part.=0A= ! (cond=0A= ! ((> Info-breadcrumbs-depth 0)=0A= ! (put-text-property (point-min) (1+ header-end) = 'invisible t))=0A= ! ((not (bobp))=0A= ;; Hide the punctuation at the end, too.=0A= (skip-chars-backward " \t,")=0A= ! (put-text-property (point) header-end 'invisible t))))))=0A= =0A= ;; Fontify titles=0A= (goto-char (point-min))=0A= --- 4342,4352 ----=0A= "%"=0A= ;; Preserve text properties on duplicated `%'.=0A= (lambda (s) (concat s s)) header))=0A= ! ;; Hide the part of the first line that is in the header, = if it is just part.=0A= ;; Hide the punctuation at the end, too.=0A= + (unless (bobp)=0A= (skip-chars-backward " \t,")=0A= ! (put-text-property (point) header-end 'invisible t)))))=0A= =0A= ;; Fontify titles=0A= (goto-char (point-min))=0A= =0A= Diff finished. Mon Apr 05 15:41:59 2010=0A= ------=_NextPart_000_0052_01CAD4DB.6F2013E0--