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: Tue, 6 Apr 2010 10:46:01 -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_00C4_01CAD576.59D21D80" X-Trace: dough.gmane.org 1270576585 1442 80.91.229.12 (6 Apr 2010 17:56:25 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 6 Apr 2010 17:56:25 +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 19:56:23 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 1NzD0f-00048s-QN for geb-bug-gnu-emacs@m.gmane.org; Tue, 06 Apr 2010 19:56:23 +0200 Original-Received: from localhost ([127.0.0.1]:58899 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NzD0e-0000mi-Oq for geb-bug-gnu-emacs@m.gmane.org; Tue, 06 Apr 2010 13:56:20 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NzD0Z-0000lO-KL for bug-gnu-emacs@gnu.org; Tue, 06 Apr 2010 13:56:15 -0400 Original-Received: from [140.186.70.92] (port=45257 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NzD0Y-0000kb-6z for bug-gnu-emacs@gnu.org; Tue, 06 Apr 2010 13:56:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NzD0N-0003zW-Sw for bug-gnu-emacs@gnu.org; Tue, 06 Apr 2010 13:56:14 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:52321) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NzD0N-0003zO-QY for bug-gnu-emacs@gnu.org; Tue, 06 Apr 2010 13:56:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1NzCre-0003xN-5Z; Tue, 06 Apr 2010 13:47:02 -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: Tue, 06 Apr 2010 17:47:02 +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.127057598415198 (code B ref 5809); Tue, 06 Apr 2010 17:47:02 +0000 Original-Received: (at 5809) by debbugs.gnu.org; 6 Apr 2010 17:46:24 +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 1NzCr1-0003x5-Lk for submit@debbugs.gnu.org; Tue, 06 Apr 2010 13:46:23 -0400 Original-Received: from rcsinet12.oracle.com ([148.87.113.124]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NzCqz-0003x0-ND for 5809@debbugs.gnu.org; Tue, 06 Apr 2010 13:46:22 -0400 Original-Received: from rcsinet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by rcsinet12.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id o36Hk9vH027502 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 6 Apr 2010 17:46:12 GMT Original-Received: from acsmt354.oracle.com (acsmt354.oracle.com [141.146.40.154]) by rcsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o36DBLEd019745; Tue, 6 Apr 2010 17:46:08 GMT Original-Received: from abhmt020.oracle.com by acsmt355.oracle.com with ESMTP id 151114301270575963; Tue, 06 Apr 2010 10:46:03 -0700 Original-Received: from dradamslap1 (/141.144.225.69) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 06 Apr 2010 10:46:03 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: AcrU/Cfq3mVF/uNxRmmdVQpx6tWcJQAEtM4gAA6qsbAAFogZwA== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Source-IP: acsmt354.oracle.com [141.146.40.154] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090207.4BBB7361.00E0:SCFMA4539814,ss=1,fgs=0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Tue, 06 Apr 2010 13:47:02 -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:35999 Archived-At: This is a multi-part message in MIME format. ------=_NextPart_000_00C4_01CAD576.59D21D80 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit I hope you will take a minute to try the patch. > Another possible change: Put `Info-scroll-up'/`down' on > mouse-1/mouse-3 for the current node name (similar to what > is the case now). I did that. Attached is a better patch: . mouse-2: the breadcrumbs menu . mouse-1/3: Info-scroll-* for the current node go-to-clicked-node for ancestor nodes And it does the usual mouseover highlighting on a node name to show it is mouse-active (which I had forgotten in the previous patch). ---- Better yet would be the following (I did not do this in the patch): Swap mouse-2 and mouse-3, and swap the scroll directions. For the current node: . mouse-1: Info-mouse-scroll-down . mouse-2: Info-mouse-scroll-up . mouse-3: breadcrumbs menu For ancestor nodes: . mouse-1: go to clicked node . mouse-2: go to clicked node . mouse-3: breadcrumbs menu That would be better for these reasons: 1. mouse-1 and mouse-2 both go to the clicked ancestor node, just as they both follow links (by default). 2. mouse-1 is to the left of mouse-2, so mouse-1 should move left and mouse-2 right. It is perverse to cross these directions. See bug #5841. 3. mouse-3 as a menu is very common outside Emacs and not unexpected for lots of users. mouse-2 (in Emacs and outside it) is rarely used for a menu. ------=_NextPart_000_00C4_01CAD576.59D21D80 Content-Type: application/octet-stream; name="info-2010-04-06.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="info-2010-04-06.patch" diff -cw info-BZR-2010-04-05.el info-patched-2010-04-06.el=0A= *** info-BZR-2010-04-05.el Mon Apr 5 07:48:52 2010=0A= --- info-patched-2010-04-06.el Tue Apr 6 09:04:46 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,4286 ----=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= ! (let ((crumbs-map (make-sparse-keymap))=0A= ! (menu-map (make-sparse-keymap "Breadcrumbs")))=0A= ! (define-key crumbs-map [mode-line mouse-2] menu-map)=0A= ! (when node=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= ! (setq node (if (equal node Info-current-node)=0A= ! (propertize (replace-regexp-in-string "%" = "%%" Info-current-node)=0A= ! 'face 'mode-line-buffer-id=0A= ! 'help-echo "mouse-1: scroll = forward, mouse-2: menu, mouse-3: scroll back"=0A= ! 'mouse-face = 'mode-line-highlight=0A= ! 'local-map=0A= ! (progn=0A= ! (define-key crumbs-map = [mode-line mouse-1] 'Info-mouse-scroll-up)=0A= ! (define-key crumbs-map = [mode-line mouse-3] 'Info-mouse-scroll-down)=0A= ! crumbs-map))=0A= ! (propertize node=0A= ! 'local-map (progn=0A= ! (define-key = crumbs-map [mode-line mouse-1]=0A= ! `(lambda () = (interactive) (Info-goto-node ,node)))=0A= ! (define-key = crumbs-map [mode-line mouse-3]=0A= ! `(lambda () = (interactive) (Info-goto-node ,node)))=0A= ! crumbs-map)=0A= ! 'mouse-face 'mode-line-highlight=0A= ! 'help-echo "mouse-1, mouse-3: Go = to this node; mouse-2: Menu")))))=0A= ! (let ((nodetext (if (not (equal node "Top"))=0A= ! node=0A= ! (concat (format "(%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") "" " > ") = (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= --- 4327,4332 ----=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= --- 4353,4363 ----=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. Tue Apr 06 09:10:17 2010=0A= ------=_NextPart_000_00C4_01CAD576.59D21D80--