unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: Info enhancements
@ 2003-12-07  0:59 Karl Berry
  2003-12-07  5:47 ` Eli Zaretskii
  0 siblings, 1 reply; 148+ messages in thread
From: Karl Berry @ 2003-12-07  0:59 UTC (permalink / raw)


Responding now to Juri's original email, which I did not see before.
(Thanks for forwarding, Luc.)

All the changes look fine to me, except for the one we've been discussing:
    - - use reference names to move point to the place within the current
      node where reference name is defined.  


My only other comment is that the spate of changes around
Info-hide-note-references makes me question whether that is truly a
desirable new feature or not.  It seems like it has potential to cause
endless trouble for relatively little gain.  I hope at least that
Info-hide-note-references=t will not be the default for its first release.

^ permalink raw reply	[flat|nested] 148+ messages in thread
* Re: Info enhancements
@ 2003-12-07  1:20 Karl Berry
  2003-12-07  5:50 ` Eli Zaretskii
  0 siblings, 1 reply; 148+ messages in thread
From: Karl Berry @ 2003-12-07  1:20 UTC (permalink / raw)


Responding now to Luc's mail about @anchor in general.

    If anchors are actually preferred over node names, 

I would not say that anchors are "preferred" over names.  Ultimately,
there is a bias in Texinfo toward reasonably short nodes.  When the
nodes are short, subnode positioning does not matter.  Thus, @anchor was
not available in Texinfo for many years -- and thus was not used in most
existing manuals, which predate the feature.

On the other hand, anchors are there to be used, there's no reason to
hesitate about it at this point.

    Or one might give some guidelines on _when_ to use @anchor.

I agree.  From this discussion, the answer forming in my mind is "when
you have a long node, and want to go to an exact location within it".

And I would also say "consider splitting such a long node into several
subnodes" -- but I realize there are cases where that is not desirable.

    A reference would lead in a random way either to the top of the node
    or to the "correct place".

If there were more anchors, users would simply get to the "correct"
place more often.  That's all to the good.

You're right that naming conventions could distinguish, but I'm not sure
that's completely the way to go either.  An xref label like
"file-coding-system-alist" seems perfectly reasonable to me; it is
not apparent whether it is a node or an anchor, but as long as the user
ends up at the description of file-coding-system-alist when they follow
a reference, I don't think it matters.

A couple of sentences in Help-Xref couldn't hurt.

Thanks,
k

^ permalink raw reply	[flat|nested] 148+ messages in thread
* Re: Info enhancements
@ 2003-12-07  0:56 Karl Berry
  0 siblings, 0 replies; 148+ messages in thread
From: Karl Berry @ 2003-12-07  0:56 UTC (permalink / raw)
  Cc: juri, eliz, emacs-devel

    *on a completely unrelated note*, the
    strange place the stand-alone info goes to, once again seems to say:
    do not try to guess positions if you are not completely sure.
    @end unrelated

It is a judgement call.  In the case you cited, it goes to the wrong
position.  In most cases, Eli tells me, "amazingly" it goes to the right
place.

If I had written the code (Brian Fox did, it's been part of standalone
Info since early days), I probably would not have done this magic
searching, since, as we all know by now, it is a band-aid on the real
problem of subnode positioning.

If Emacs Info and standalone Info differ in this regard, I think that's
ok.  I'm not sure if I want to remove the code from sa-Info, since it's
been there so long.

^ permalink raw reply	[flat|nested] 148+ messages in thread
* Re: Info enhancements
@ 2003-12-07  0:53 Karl Berry
  2003-12-07  5:46 ` Eli Zaretskii
  0 siblings, 1 reply; 148+ messages in thread
From: Karl Berry @ 2003-12-07  0:53 UTC (permalink / raw)
  Cc: juri, eliz, emacs-devel

Luc, thank you for the clear mail with examples.

    @xref{(elisp)Top}. @xref{(elisp)Top, Top}.

Hmm.  The documentation is not explicit about any assigned meaning for the
second arg to an xref, beyond being the "name of the Info reference",
which is to say, the thing before the first colon.
http://www.gnu.org/software/texinfo/manual/texinfo/html_node/Two-Arguments.html
(and preceding and following nodes).

I had always thought of it as an arbitrary string.

    the reference produced by `@xref{(elisp)Top, Top}.' leads to
    (experiment)Top in Emacs Info.  Is this a bug?

My opinion is yes, it is a bug.  This very example shows it is a
reasonable thing to do -- have references to Top nodes of different
manuals within one node.  In fact, I myself have written nodes that do that.

Thanks,
k

^ permalink raw reply	[flat|nested] 148+ messages in thread
* Re: Info enhancements
@ 2003-12-06 19:36 Karl Berry
  2003-12-06 19:53 ` Luc Teirlinck
  2003-12-06 20:30 ` Luc Teirlinck
  0 siblings, 2 replies; 148+ messages in thread
From: Karl Berry @ 2003-12-06 19:36 UTC (permalink / raw)
  Cc: juri, eliz, emacs-devel

    Right now, we are trying to deal with an apparent problem that the
    Elisp info reader has with similarly named references

Exactly what is the bug and what is the proposed solution?  Sample files?

I had no idea there was an actual patch being applied.
What other changes are being made?  While savannah is down, it's
impossible to know what is being done.

As we know, the standalone Info reader searches for the second arg to
xref in the node.  This is not perfect, as you yourself noted, but I
guess it only hurts occasionally.  So if you want to implement that in
the Emacs reader, fine.  Consistency is nice, anyway.

Other than that, the only practical solution to subnode positioning is
anchors, as far as I can see.

^ permalink raw reply	[flat|nested] 148+ messages in thread
* Re: Info enhancements
@ 2003-12-06 14:49 Karl Berry
  0 siblings, 0 replies; 148+ messages in thread
From: Karl Berry @ 2003-12-06 14:49 UTC (permalink / raw)
  Cc: bob, teirllm, emacs-devel

    What do you think about writing a variable name in a third argument

No.  The third arg to xref is for the printed manual.

All the existing args to xref have a meaning (obviously).  It doesn't
make sense to replace one of them willy-nilly with index entries.

^ permalink raw reply	[flat|nested] 148+ messages in thread
* Re: Info enhancements
@ 2003-12-04 22:55 Karl Berry
  0 siblings, 0 replies; 148+ messages in thread
From: Karl Berry @ 2003-12-04 22:55 UTC (permalink / raw)
  Cc: emacs-devel

My preference is either (a) maximal alignment:

    * histogram:                    Manipulating Vectors.   (line   78)
    * hms:                          Conversions.            (line   63)

Or my original proposal (b), with no attempt at any alignment:

    * histogram:                    Manipulating Vectors.  (line 78)
    * hms:                          Conversions.  (line 63)

I prefer the parenthetical forms to the "Line N" forms, with or without
period.


Ok, since you prefer alignment, and I guess I rather agree, it will be
nicer in the common case of relatively short node names, I will do (a)
for the next release, barring objections.

Thanks,
k

^ permalink raw reply	[flat|nested] 148+ messages in thread
* Re: Info enhancements
@ 2003-12-03 19:42 Karl Berry
  2003-12-03 19:58 ` Robert J. Chassell
  0 siblings, 1 reply; 148+ messages in thread
From: Karl Berry @ 2003-12-03 19:42 UTC (permalink / raw)
  Cc: emacs-devel

    As far as I can see, a better format would have the line number before
    the description rather than after it, with the description indented 6

But then it would not follow the standard format for menus, i.e.,
<term>:<node name>.

^ permalink raw reply	[flat|nested] 148+ messages in thread
* Re: Info enhancements (was: Re: HTML as info format)
@ 2003-12-02 17:27 Eli Zaretskii
  2003-12-02 19:26 ` Karl Berry
  0 siblings, 1 reply; 148+ messages in thread
From: Eli Zaretskii @ 2003-12-02 17:27 UTC (permalink / raw)
  Cc: karl, emacs-devel

> From: Juri Linkov <juri@jurta.org>
> Date: Tue, 02 Dec 2003 12:18:09 +0200
> 
> Yes, using anchors might be a more clean solution, but it has one
> drawback: it will generate too many excessive references in the tag
> table for its Info file.  And these references will be mixed up with
> node names, e.g. in the completion list of `Info-goto-node'.

Perhaps there should be a way to tell Info-goto-node to complete on
node names only, or maybe we should have two distinct commands, one
which considers only nodes, the other which considers all entries in
the tag tables.

^ permalink raw reply	[flat|nested] 148+ messages in thread
* Info enhancements
@ 2003-12-01 10:38 Juri Linkov
  2003-12-02  3:34 ` Luc Teirlinck
                   ` (4 more replies)
  0 siblings, 5 replies; 148+ messages in thread
From: Juri Linkov @ 2003-12-01 10:38 UTC (permalink / raw)


I would like to submit a patch that fixes some problems in the Emacs
Info reader and adds features most web browsers already have.
This patch don't change the existing Info file format.  It improves
usability of the Emacs Info reader with the current Info file format.
Any comments are welcome.

New features:

- distinguish visited nodes from unvisited by displaying their
  references in a different color.  Standard colors of web browsers
  are used: blue - for unvisited links, magenta - for visited links.

- show full history list or tree of visited Info nodes.  This list is
  displayed in the Info buffer using "*Note" references, so standard
  Info functions can be used for navigation to visited nodes from the
  history buffer.

- http links are fontified and available for navigation by calling the
  `browse-url' function.

- a new argument `fork' is added to Info-follow-reference,
  Info-follow-nearest-node and Info-try-follow-nearest-node functions,
  so if these functions are called interactively with a prefix arg,
  they show the node in a new info buffer.  This feature is copied
  from the `Info-menu' which works only for menu items.  But this is
  useful for references too, especially for references that carry out
  of the current manual.

- use reference names to move point to the place within the current
  node where reference name is defined.  For example, by following the
  reference "*Note file-coding-system-alist: Default Coding Systems,"
  Info finds a node with the name "Default Coding Systems" and moves
  point to the line where reference name "file-coding-system-alist" is
  defined.  This feature uses the function `Info-find-index-name' that
  currently works only for the function `Info-index'.  Now it works
  also for index items and cross references.  This feature solves
  problems in the Glossary node of the Emacs manual, where links to
  the same node are marked by the "(q.v.)" or "See `text'".  Such text
  can be replaced in references to the same node with this text as a
  reference name.  For example, the text "is shared by an indirect
  buffer (q.v.@:)" can be replaced with "is shared by an
  @ref{Glossary,indirect buffer}", and text "See `filling.'" can be
  replaced with "@xref{Glossary,filling}.".  Following such a
  reference will move point to the place in the same node where this
  glossary term is defined.

- rebind `M-s' key to a new function `Info-search-next' that searches
  for another occurrence of regular expression from a previous
  `Info-search' command (key `s').  Pressing only one key to repeat
  a search is more convenient than pressing two keys (`s RET').

Fixed problems:

- don't hide the newline (with following whitespace) in references when
  Info-hide-note-references is t.  This fixes the problem where hidden
  newlines cause too long (and truncated) lines.

- don't hide the name of external Info file in references in case
  when Info-hide-note-references is t and references lead outside
  the current Info file.  It's important for user to know about
  such situation.

- don't insert the text "See" instead of "Note" because inserting a
  new text in Info buffer breaks the stored point positions. This bug
  can be observed by calling `Info-last', `Info-search' where point is
  moved with some offset to its correct position (the offset is the sum
  of lengths of strings "See" inserted in the buffer above the point).

- add a character ` to the list of prefix characters used to escape
  the literal meaning of the text "*Note".  The wrong fontification
  caused by this bug can be observed in (info "(info)Cross-refs").

Index: emacs/lisp/info.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/info.el,v
retrieving revision 1.374
diff -c -r1.374 info.el
*** emacs/lisp/info.el	 7 Oct 2003 00:04:45 -0000	1.374
--- emacs/lisp/info.el	 1 Dec 2003 11:48:03 -0000
***************
*** 48,53 ****
--- 48,60 ----
    "List of info nodes user has visited.
  Each element of list is a list (FILENAME NODENAME BUFFERPOS).")
  
+ (defvar Info-history-tree nil
+   "Tree of info nodes user has visited.
+ Each element of list is a list (FILENAME NODENAME PARENT-INDEX).")
+ 
+ (defvar Info-history-node -1
+   "Position of the current node on the info nodes tree user has visited.")
+ 
  (defcustom Info-enable-edit nil
    "*Non-nil means the \\<Info-mode-map>\\[Info-edit] command in Info can edit the current node.
  This is convenient if you want to write info files by hand.
***************
*** 76,87 ****
    :group 'info)
  
  (defface info-xref
!   '((((class color) (background light)) (:foreground "magenta4" :weight bold))
!     (((class color) (background dark)) (:foreground "cyan" :weight bold))
!     (t (:weight bold)))
    "Face for Info cross-references."
    :group 'info)
  
  (defcustom Info-fontify-maximum-menu-size 100000
    "*Maximum size of menu to fontify if `font-lock-mode' is non-nil."
    :type 'integer
--- 83,107 ----
    :group 'info)
  
  (defface info-xref
!   '((((class color) (background light)) (:foreground "blue"))
!     (((class color) (background dark)) (:foreground "cyan"))
!     (t (:underline t)))
    "Face for Info cross-references."
    :group 'info)
  
+ (defface info-xref-visited
+   '((((class color) (background light)) (:foreground "magenta4"))
+     (((class color) (background dark)) (:foreground "magenta4"))
+     (t (:underline t)))
+   "Face for visited Info cross-references."
+   :group 'info)
+ 
+ (defcustom Info-visited-nodes t
+   "*Non-nil means to fontify visited nodes in a different color."
+   :version "21.4"
+   :type 'boolean
+   :group 'info)
+ 
  (defcustom Info-fontify-maximum-menu-size 100000
    "*Maximum size of menu to fontify if `font-lock-mode' is non-nil."
    :type 'integer
***************
*** 155,161 ****
  
  (defcustom Info-hide-note-references t
    "*If non-nil, hide the tag and section reference in *note and * menu items.
- Also replaces the \"*note\" text with \"see\".
  If value is non-nil but not t, the reference section is still shown."
    :version "21.4"
    :type '(choice (const :tag "No reformatting" nil)
--- 175,180 ----
***************
*** 205,210 ****
--- 224,232 ----
  (defvar Info-index-alternatives nil
    "List of possible matches for last `Info-index' command.")
  
+ (defvar Info-reference-name nil
+   "Name of the current reference.")
+ 
  (defvar Info-standalone nil
    "Non-nil if Emacs was started solely as an Info browser.")
  \f
***************
*** 787,793 ****
  		       nodename)))
  
  	    (Info-select-node)
! 	    (goto-char (or anchorpos (point-min))))))
      ;; If we did not finish finding the specified node,
      ;; go back to the previous one.
      (or Info-current-node no-going-back (null Info-history)
--- 809,820 ----
  		       nodename)))
  
  	    (Info-select-node)
! 	    (goto-char (or anchorpos (point-min)))
! 
!             ;; Move point to the place where the referer name points to
!             (when Info-reference-name
!               (Info-find-index-name Info-reference-name)
!               (setq Info-reference-name nil)))))
      ;; If we did not finish finding the specified node,
      ;; go back to the previous one.
      (or Info-current-node no-going-back (null Info-history)
***************
*** 1176,1181 ****
--- 1203,1225 ----
  	(if Info-enable-active-nodes (eval active-expression))
  	(Info-fontify-node)
  	(Info-display-images-node)
+ 
+         ;; Add a new history node or use old node from the history tree
+         (let ((tree Info-history-tree)
+               (i 0) res)
+           (while tree
+             (if (and (equal (nth 0 (car tree)) Info-current-file)
+                      (equal (nth 1 (car tree)) Info-current-node))
+                 (setq res i tree nil))
+             (setq tree (cdr tree) i (1+ i)))
+           (if res
+               (setq Info-history-node res)
+             (setq Info-history-tree
+                   (nconc Info-history-tree
+                          (list (list Info-current-file Info-current-node
+                                      Info-history-node)))
+                   Info-history-node (1- (length Info-history-tree)))))
+ 
  	(run-hooks 'Info-selection-hook)))))
  
  (defun Info-set-mode-line ()
***************
*** 1207,1212 ****
--- 1251,1258 ----
    (if fork
        (set-buffer
         (clone-buffer (concat "*info-" (if (stringp fork) fork nodename) "*") t)))
+   (if (equal (buffer-name) "*info-history*")
+       (switch-to-buffer "*info*"))
    (let (filename)
      (string-match "\\s *\\((\\s *\\([^\t)]*\\)\\s *)\\s *\\|\\)\\(.*\\)"
  		  nodename)
***************
*** 1409,1414 ****
--- 1455,1468 ----
  	       (equal ofile Info-current-file))
  	  (setq Info-history (cons (list ofile onode opoint)
  				   Info-history))))))
+ 
+ (defun Info-search-next ()
+   "Search for next regexp from a previous `Info-search' command."
+   (interactive)
+   (if Info-search-history
+       (Info-search (car Info-search-history))
+     ;; If no history then read search string in Info-search
+     (call-interactively 'Info-search)))
  \f
  (defun Info-extract-pointer (name &optional errorname)
    "Extract the value of the node-pointer named NAME.
***************
*** 1481,1495 ****
      (setq Info-history (cdr Info-history))
      (goto-char opoint)))
  
  ;;;###autoload
  (defun Info-directory ()
    "Go to the Info directory node."
    (interactive)
    (Info-find-node "dir" "top"))
  \f
! (defun Info-follow-reference (footnotename)
    "Follow cross reference named FOOTNOTENAME to the node it refers to.
! FOOTNOTENAME may be an abbreviation of the reference name."
    (interactive
     (let ((completion-ignore-case t)
  	 (case-fold-search t)
--- 1535,1594 ----
      (setq Info-history (cdr Info-history))
      (goto-char opoint)))
  
+ ;;;###autoload (add-hook 'same-window-buffer-names "*info-history*")
+ 
+ (defun Info-history-buffer (&optional tree-p)
+   "Create the buffer *info-history* with references to visited nodes.
+ Optional argument TREE-P creates a tree of nodes; the default
+ creates the plain list of nodes."
+   (interactive "P")
+   (let ((curr-node Info-history-node)
+         p)
+     (pop-to-buffer
+      (with-current-buffer (get-buffer-create "*info-history*")
+        (let ((Info-hide-note-references t)
+              (Info-visited-nodes t)
+              (inhibit-read-only t))
+          (erase-buffer)
+          (goto-char (point-min))
+          (setq p (Info-insert-history-tree -1 0 (or curr-node 0) tree-p))
+          (if (not (bobp)) (Info-fontify-node))
+          (or (eq major-mode 'Info-mode) (Info-mode))
+          (let ((Info-current-file "history")
+                (Info-current-node "History"))
+            (Info-set-mode-line))
+          (current-buffer))))
+     (goto-char (or p (point-min)))))
+ 
+ (defun Info-insert-history-tree (index indent curr-node tree-p)
+   "Insert the tree or list of references to visited nodes.
+ Return the position of the current node on the generated tree."
+   (let ((tree Info-history-tree)
+         (i 0) p)
+     (while tree
+       (when (or (null tree-p) (eq (nth 2 (car tree)) index))
+         (if tree-p (insert (make-string indent ?\040)))
+         (if (eq i curr-node) (setq p (point)))
+         (insert  "*Note " (nth 1 (car tree)) ": ("
+                  (file-name-nondirectory (nth 0 (car tree)))
+                  ")" (nth 1 (car tree)) ".\n")
+         (if tree-p (setq p (or (Info-insert-history-tree
+                                 i (1+ indent) curr-node tree-p) p))))
+       (setq tree (cdr tree) i (1+ i)))
+     p))
+ 
  ;;;###autoload
  (defun Info-directory ()
    "Go to the Info directory node."
    (interactive)
    (Info-find-node "dir" "top"))
  \f
! (defun Info-follow-reference (footnotename &optional fork)
    "Follow cross reference named FOOTNOTENAME to the node it refers to.
! FOOTNOTENAME may be an abbreviation of the reference name.
! If FORK is non-nil (interactively with a prefix arg), show the node in
! a new info buffer.  If FORK is a string, it is the name to use for the
! new buffer."
    (interactive
     (let ((completion-ignore-case t)
  	 (case-fold-search t)
***************
*** 1539,1545 ****
  					 "Follow reference named: ")
  				       completions nil t)))
  	   (list (if (equal input "")
! 		     default input)))
         (error "No cross-references in this node"))))
  
    (unless footnotename
--- 1638,1644 ----
  					 "Follow reference named: ")
  				       completions nil t)))
  	   (list (if (equal input "")
! 		     default input) current-prefix-arg))
         (error "No cross-references in this node"))))
  
    (unless footnotename
***************
*** 1561,1567 ****
        (setq target (concat (substring target 0 i) " "
  			   (substring target (match-end 0))))
        (setq i (+ i 1)))
!     (Info-goto-node target)))
  
  (defconst Info-menu-entry-name-re "\\(?:[^:]\\|:[^:,.;() \t\n]\\)*"
    ;; We allow newline because this is also used in Info-follow-reference,
--- 1660,1666 ----
        (setq target (concat (substring target 0 i) " "
  			   (substring target (match-end 0))))
        (setq i (+ i 1)))
!     (Info-goto-node target fork)))
  
  (defconst Info-menu-entry-name-re "\\(?:[^:]\\|:[^:,.;() \t\n]\\)*"
    ;; We allow newline because this is also used in Info-follow-reference,
***************
*** 1968,1974 ****
  (defun Info-next-reference (&optional recur)
    "Move cursor to the next cross-reference or menu item in the node."
    (interactive)
!   (let ((pat "\\*note[ \n\t]*\\([^:]*\\):\\|^\\* .*:")
  	(old-pt (point))
  	(case-fold-search t))
      (or (eobp) (forward-char 1))
--- 2067,2073 ----
  (defun Info-next-reference (&optional recur)
    "Move cursor to the next cross-reference or menu item in the node."
    (interactive)
!   (let ((pat "\\*note[ \n\t]*\\([^:]*\\):\\|^\\* .*:\\|http://")
  	(old-pt (point))
  	(case-fold-search t))
      (or (eobp) (forward-char 1))
***************
*** 1988,1994 ****
  (defun Info-prev-reference (&optional recur)
    "Move cursor to the previous cross-reference or menu item in the node."
    (interactive)
!   (let ((pat "\\*note[ \n\t]*\\([^:]*\\):\\|^\\* .*:")
  	(old-pt (point))
  	(case-fold-search t))
      (or (re-search-backward pat nil t)
--- 2087,2093 ----
  (defun Info-prev-reference (&optional recur)
    "Move cursor to the previous cross-reference or menu item in the node."
    (interactive)
!   (let ((pat "\\*note[ \n\t]*\\([^:]*\\):\\|^\\* .*:\\|http://")
  	(old-pt (point))
  	(case-fold-search t))
      (or (re-search-backward pat nil t)
***************
*** 2209,2220 ****
         (save-excursion (forward-line 1) (eobp))
         (Info-next-preorder)))
  
! (defun Info-follow-nearest-node ()
    "Follow a node reference near point.
  If point is on a reference, follow that reference.  Otherwise,
  if point is in a menu item description, follow that menu item."
!   (interactive)
!   (or (Info-try-follow-nearest-node)
        (when (save-excursion
  	      (search-backward "\n* menu:" nil t))
  	(save-excursion
--- 2308,2319 ----
         (save-excursion (forward-line 1) (eobp))
         (Info-next-preorder)))
  
! (defun Info-follow-nearest-node (&optional fork)
    "Follow a node reference near point.
  If point is on a reference, follow that reference.  Otherwise,
  if point is in a menu item description, follow that menu item."
!   (interactive "P")
!   (or (Info-try-follow-nearest-node fork)
        (when (save-excursion
  	      (search-backward "\n* menu:" nil t))
  	(save-excursion
***************
*** 2223,2257 ****
  	    (beginning-of-line 0))
  	  (when (looking-at "\\* +\\([^\t\n]*\\):")
  	    (Info-goto-node
! 	     (Info-extract-menu-item (match-string-no-properties 1)))
  	    t)))
        (error "Point neither on reference nor in menu item description")))
  
  ;; Common subroutine.
! (defun Info-try-follow-nearest-node ()
    "Follow a node reference near point.  Return non-nil if successful."
    (let (node)
      (cond
       ((setq node (Info-get-token (point) "\\*note[ \n]"
  				 "\\*note[ \n]\\([^:]*\\):"))
!       (Info-follow-reference node))
       ;; menu item: node name
       ((setq node (Info-get-token (point) "\\* +" "\\* +\\([^:]*\\)::"))
!       (Info-goto-node node))
       ;; menu item: index entry
       ((Info-get-token (point) "\\* +" "\\* +\\(.*\\): ")
        (beginning-of-line)
        (forward-char 2)
        (setq node (Info-extract-menu-node-name))
!       (Info-goto-node node))
       ((setq node (Info-get-token (point) "Up: " "Up: \\([^,\n\t]*\\)"))
!       (Info-goto-node node))
       ((setq node (Info-get-token (point) "Next: " "Next: \\([^,\n\t]*\\)"))
!       (Info-goto-node node))
       ((setq node (Info-get-token (point) "File: " "File: \\([^,\n\t]*\\)"))
!       (Info-goto-node "Top"))
       ((setq node (Info-get-token (point) "Prev: " "Prev: \\([^,\n\t]*\\)"))
!       (Info-goto-node node)))
      node))
  \f
  (defvar Info-mode-map nil
--- 2322,2363 ----
  	    (beginning-of-line 0))
  	  (when (looking-at "\\* +\\([^\t\n]*\\):")
  	    (Info-goto-node
! 	     (Info-extract-menu-item (match-string-no-properties 1)) fork)
  	    t)))
        (error "Point neither on reference nor in menu item description")))
  
  ;; Common subroutine.
! (defun Info-try-follow-nearest-node (&optional fork)
    "Follow a node reference near point.  Return non-nil if successful."
    (let (node)
      (cond
+      ((and (Info-get-token (point) "http://" "\\(http://\\)")
+            (or (featurep 'browse-url) (require 'browse-url nil t)))
+       (setq node t)
+       (browse-url (browse-url-url-at-point)))
       ((setq node (Info-get-token (point) "\\*note[ \n]"
  				 "\\*note[ \n]\\([^:]*\\):"))
!       (setq Info-reference-name (replace-regexp-in-string
!                                  "[ \t\n]+" " " (match-string-no-properties 1)))
!       (Info-follow-reference node fork))
       ;; menu item: node name
       ((setq node (Info-get-token (point) "\\* +" "\\* +\\([^:]*\\)::"))
!       (Info-goto-node node fork))
       ;; menu item: index entry
       ((Info-get-token (point) "\\* +" "\\* +\\(.*\\): ")
+       (setq Info-reference-name (match-string-no-properties 1))
        (beginning-of-line)
        (forward-char 2)
        (setq node (Info-extract-menu-node-name))
!       (Info-goto-node node fork))
       ((setq node (Info-get-token (point) "Up: " "Up: \\([^,\n\t]*\\)"))
!       (Info-goto-node node fork))
       ((setq node (Info-get-token (point) "Next: " "Next: \\([^,\n\t]*\\)"))
!       (Info-goto-node node fork))
       ((setq node (Info-get-token (point) "File: " "File: \\([^,\n\t]*\\)"))
!       (Info-goto-node "Top" fork))
       ((setq node (Info-get-token (point) "Prev: " "Prev: \\([^,\n\t]*\\)"))
!       (Info-goto-node node fork)))
      node))
  \f
  (defvar Info-mode-map nil
***************
*** 2295,2306 ****
    (define-key Info-mode-map "p" 'Info-prev)
    (define-key Info-mode-map "q" 'Info-exit)
    (define-key Info-mode-map "s" 'Info-search)
!   ;; For consistency with Rmail.
!   (define-key Info-mode-map "\M-s" 'Info-search)
    (define-key Info-mode-map "\M-n" 'clone-buffer)
    (define-key Info-mode-map "t" 'Info-top-node)
    (define-key Info-mode-map "u" 'Info-up)
    (define-key Info-mode-map "," 'Info-index-next)
    (define-key Info-mode-map "\177" 'Info-scroll-down)
    (define-key Info-mode-map [mouse-2] 'Info-mouse-follow-nearest-node)
    )
--- 2401,2412 ----
    (define-key Info-mode-map "p" 'Info-prev)
    (define-key Info-mode-map "q" 'Info-exit)
    (define-key Info-mode-map "s" 'Info-search)
!   (define-key Info-mode-map "\M-s" 'Info-search-next)
    (define-key Info-mode-map "\M-n" 'clone-buffer)
    (define-key Info-mode-map "t" 'Info-top-node)
    (define-key Info-mode-map "u" 'Info-up)
    (define-key Info-mode-map "," 'Info-index-next)
+   (define-key Info-mode-map "\\" 'Info-history-buffer)
    (define-key Info-mode-map "\177" 'Info-scroll-down)
    (define-key Info-mode-map [mouse-2] 'Info-mouse-follow-nearest-node)
    )
***************
*** 2335,2344 ****
     ("Reference" ["You should never see this" report-emacs-bug t])
     ["Search..." Info-search
      :help "Search for regular expression in this Info file"]
     ["Go to Node..." Info-goto-node
      :help "Go to a named node"]
!    ["Last" Info-last :active Info-history
      :help "Go to the last node you were at"]
     ("Index..."
      ["Lookup a String" Info-index
       :help "Look for a string in the index items"]
--- 2441,2454 ----
     ("Reference" ["You should never see this" report-emacs-bug t])
     ["Search..." Info-search
      :help "Search for regular expression in this Info file"]
+    ["Search Next" Info-search-next
+     :help "Search for another occurrence of regular expression"]
     ["Go to Node..." Info-goto-node
      :help "Go to a named node"]
!    ["Last (Back)" Info-last :active Info-history
      :help "Go to the last node you were at"]
+    ["History" Info-history-buffer :active Info-history-tree
+     :help "Go to the history buffer"]
     ("Index..."
      ["Lookup a String" Info-index
       :help "Look for a string in the index items"]
***************
*** 2476,2481 ****
--- 2586,2592 ----
  \\[Info-directory]	Go to the Info directory node.
  \\[Info-follow-reference]	Follow a cross reference.  Reads name of reference.
  \\[Info-last]	Move to the last node you were at.
+ \\[Info-history-buffer]	Go to the history buffer.
  \\[Info-index]	Look up a topic in this file's Index and move to that node.
  \\[Info-index-next]	(comma) Move to the next match from a previous `i' command.
  \\[Info-top-node]	Go to the Top node of this file.
***************
*** 2504,2509 ****
--- 2615,2622 ----
  \\[universal-argument] \\[info]	Move to new Info file with completion.
  \\[Info-search]	Search through this Info file for specified regexp,
  	  and select the node in which the next occurrence is found.
+ \\[Info-search-next]	Search for another occurrence of regexp
+ 	  from a previous `Info-search' command.
  \\[Info-next-reference]	Move cursor to next cross-reference or menu item.
  \\[Info-prev-reference]	Move cursor to previous cross-reference or menu item."
    (kill-all-local-variables)
***************
*** 2524,2529 ****
--- 2637,2643 ----
    (make-local-variable 'Info-tag-table-buffer)
    (setq Info-tag-table-buffer nil)
    (make-local-variable 'Info-history)
+   (make-local-variable 'Info-history-node)
    (make-local-variable 'Info-index-alternatives)
    (setq header-line-format
  	(if Info-use-header-line
***************
*** 2833,2841 ****
    "Keymap to put on the Up link in the text or the header line.")
  
  (defun Info-fontify-node ()
!   ;; Only fontify the node if it hasn't already been done.
!   (unless (let ((where (next-property-change (point-min))))
!             (and where (not (= where (point-max)))))
      (save-excursion
        (let ((inhibit-read-only t)
  	    (case-fold-search t)
--- 2947,2957 ----
    "Keymap to put on the Up link in the text or the header line.")
  
  (defun Info-fontify-node ()
!   ;; Only fontify the node if it hasn't already been done
!   ;; or always fontify visited nodes (because of their dynamic nature).
!   (when (or Info-visited-nodes
!             (not (let ((where (next-property-change (point-min))))
!                    (and where (not (= where (point-max)))))))
      (save-excursion
        (let ((inhibit-read-only t)
  	    (case-fold-search t)
***************
*** 2911,2961 ****
  	    (add-text-properties (1- (match-beginning 2)) (match-end 2)
  				 '(invisible t front-sticky nil rear-nonsticky t))))
  	(goto-char (point-min))
! 	(while (re-search-forward "\\(\\*Note[ \t]*\\)\n?[ \t]*\\([^:]*\\)\\(:[^.,:(]*\\(([^)]*)[^.,:]*\\)?[,:]?\n?\\)" nil t)
! 	  (unless (= (char-after (1- (match-beginning 0))) ?\") ; hack
  	    (let ((start (match-beginning 0))
! 		  (next (point))
! 		  (hide-tag Info-hide-note-references)
! 		  other-tag)
! 	      (when hide-tag
! 		;; *Note is often used where *note should have been
! 		(goto-char start)
! 		(skip-syntax-backward " ")
! 		(setq other-tag
! 		      (cond ((memq (char-before) '(nil ?\. ?! ??))
! 			     "See ")
! 			    ((memq (char-before) '(?\, ?\; ?\: ?-))
! 			     "see ")
! 			    ((memq (char-before) '(?\( ?\[ ?\{))
! 			     ;; Check whether the paren is preceded by
! 			     ;; an end of sentence
! 			     (skip-syntax-backward " (")
! 			     (if (memq (char-before) '(nil ?\. ?! ??))
! 				 "See "
! 			       "see "))
! 			    ((save-match-data (looking-at "\n\n"))
! 			     "See ")))
! 		(goto-char next))
! 	      (if hide-tag
! 		  (add-text-properties (match-beginning 1) (match-end 1)
! 				       '(invisible t front-sticky nil rear-nonsticky t)))
  	      (add-text-properties
  	       (match-beginning 2) (match-end 2)
! 	       (cons 'help-echo
! 		     (cons (if (match-end 4)
! 			       (concat "mouse-2: go to " (match-string 4))
! 			     "mouse-2: go to this node")
! 			   '(font-lock-face info-xref
! 			     mouse-face highlight))))
  	      (when (eq Info-hide-note-references t)
  		(add-text-properties (match-beginning 3) (match-end 3)
! 				     '(invisible t front-sticky nil rear-nonsticky t)))
! 	      (when other-tag
! 		(save-excursion
! 		  (goto-char (match-beginning 1))
! 		  (insert other-tag)))
! 	      (when (and Info-refill-paragraphs
! 			 (or hide-tag (eq Info-hide-note-references t)))
  		(push (set-marker (make-marker) start)
  		      paragraph-markers)))))
  
--- 3027,3101 ----
  	    (add-text-properties (1- (match-beginning 2)) (match-end 2)
  				 '(invisible t front-sticky nil rear-nonsticky t))))
  	(goto-char (point-min))
! 	(while (re-search-forward "\\(\\*Note[ \t]*\\)\n?[ \t]*\\([^:]*\\)\\(:[^.,:(]*\\((\\([^)]*\\))\\([^.,:]*\\)\\)?[,:]?\n?\\)" nil t)
! 	  (unless (memq (char-after (1- (match-beginning 0))) '(?\" ?\`)) ; hack
  	    (let ((start (match-beginning 0))
! ;; 		  (next (point))
! ;; 		  other-tag
!                   )
! 	      (when Info-hide-note-references
! ;; 		;; *Note is often used where *note should have been
! ;; 		(goto-char start)
! ;; 		(skip-syntax-backward " ")
! ;; 		(setq other-tag
! ;;                       (cond ((memq (char-before) '(nil ?\. ?! ??))
! ;;                              "See ")
! ;;                             ((memq (char-before) '(?\, ?\; ?\: ?-))
! ;;                              "see ")
! ;;                             ((memq (char-before) '(?\( ?\[ ?\{))
! ;;                              ;; Check whether the paren is preceded by
! ;;                              ;; an end of sentence
! ;;                              (skip-syntax-backward " (")
! ;;                              (if (memq (char-before) '(nil ?\. ?! ??))
! ;;                                  "See "
! ;;                                "see "))
! ;;                             ((save-match-data (looking-at "\n\n"))
! ;;                              "See ")))
! ;; 		(goto-char next)
!                 (add-text-properties (match-beginning 1) (match-end 1)
!                                      '(invisible t front-sticky nil rear-nonsticky t)))
  	      (add-text-properties
  	       (match-beginning 2) (match-end 2)
!                (list
!                 'help-echo (if (match-end 4)
!                                (concat "mouse-2: go to " (match-string 4))
!                              "mouse-2: go to this node")
!                 'font-lock-face
!                 ;; Display visited nodes in a different face
!                 (if (and Info-visited-nodes
!                          (save-match-data
!                            (let* ((file (concat (or (match-string 5) Info-current-file) "$"))
!                                   (node (replace-regexp-in-string
!                                          "[ \t\n]+" " "
!                                          (or (match-string 6) (match-string 2))))
!                                   (l Info-history-tree)
!                                   res)
!                              (while l
!                                (if (and (equal (cadr (car l)) node)
!                                         (string-match file (caar l)))
!                                    (setq res (car l) l nil))
!                                (setq l (cdr l)))
!                              res))) 'info-xref-visited 'info-xref)
!                 'mouse-face 'highlight))
  	      (when (eq Info-hide-note-references t)
  		(add-text-properties (match-beginning 3) (match-end 3)
! 				     '(invisible t front-sticky nil rear-nonsticky t))
!                 ;; Unhide the file name of the reference in parens
!                 (if (match-string 5)
!                     (remove-text-properties (1- (match-beginning 5)) (1+ (match-end 5))
!                                             '(invisible t front-sticky nil rear-nonsticky t)))
!                 ;; Unhide newline because hidden newlines cause too long lines
!                 (save-match-data
!                   (let ((start3 (match-beginning 3)))
!                     (if (string-match "\n[ \t]*" (match-string 3))
!                         (remove-text-properties (+ start3 (match-beginning 0)) (+ start3 (match-end 0))
!                                                 '(invisible t front-sticky nil rear-nonsticky t)))))
!                 )
! ;; 	      (when other-tag
! ;; 		(save-excursion
! ;; 		  (goto-char (match-beginning 1))
! ;; 		  (insert other-tag)))
! 	      (when (and Info-refill-paragraphs Info-hide-note-references)
  		(push (set-marker (make-marker) start)
  		      paragraph-markers)))))
  
***************
*** 2997,3009 ****
  				     'font-lock-face 'info-menu-5))
  	      (add-text-properties
  	       (match-beginning 1) (match-end 1)
! 	       (cons 'help-echo
! 		     (cons
! 		      (if (match-end 3)
! 			  (concat "mouse-2: go to " (match-string 3))
! 			"mouse-2: go to this node")
! 		      '(font-lock-face info-xref
! 			mouse-face highlight))))
  	      (when (eq Info-hide-note-references t)
  		(put-text-property (match-beginning 2) (1- (match-end 6))
  				   'invisible t)
--- 3137,3161 ----
  				     'font-lock-face 'info-menu-5))
  	      (add-text-properties
  	       (match-beginning 1) (match-end 1)
!                (list
!                 'help-echo (if (match-end 3)
!                                (concat "mouse-2: go to " (match-string 3))
!                              "mouse-2: go to this node")
!                 'font-lock-face
!                 ;; Display visited nodes in a different face
!                 (if (and Info-visited-nodes
!                          (let ((node (if (equal (match-string 3) "")
!                                          (match-string 1)
!                                        (match-string 3)))
!                                (l Info-history-tree)
!                                res)
!                            (while l
!                              (if (and (equal (cadr (car l)) node)
!                                       (equal Info-current-file (caar l)))
!                                  (setq res (car l) l nil))
!                              (setq l (cdr l)))
!                            res)) 'info-xref-visited 'info-xref)
!                 'mouse-face 'highlight))
  	      (when (eq Info-hide-note-references t)
  		(put-text-property (match-beginning 2) (1- (match-end 6))
  				   'invisible t)
***************
*** 3026,3031 ****
--- 3178,3190 ----
  				       '(space :align-to 24)))
  		  (setq cont t))))))
  
+ 	(goto-char (point-min))
+ 	(while (re-search-forward "http://[-~/[:alnum:]_.${}#%,:?=&]+" nil t)
+           (add-text-properties (match-beginning 0) (match-end 0)
+                                '(font-lock-face info-xref
+                                  mouse-face highlight
+                                  help-echo "mouse-2: go to this URL")))
+ 
  	(Info-fontify-menu-headers)
  	(set-buffer-modified-p nil)))))
  \f
===================================================================

-- 
http://www.jurta.org/emacs/

^ permalink raw reply	[flat|nested] 148+ messages in thread

end of thread, other threads:[~2004-09-02 19:02 UTC | newest]

Thread overview: 148+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-07  0:59 Info enhancements Karl Berry
2003-12-07  5:47 ` Eli Zaretskii
2003-12-07 13:42   ` Luc Teirlinck
2003-12-08  0:01     ` Kim F. Storm
2003-12-08 10:28       ` Juri Linkov
2003-12-09 21:48         ` Richard Stallman
2003-12-10  7:37           ` Eli Zaretskii
2003-12-11 14:45             ` Richard Stallman
  -- strict thread matches above, loose matches on Subject: below --
2003-12-07  1:20 Karl Berry
2003-12-07  5:50 ` Eli Zaretskii
2003-12-07  0:56 Karl Berry
2003-12-07  0:53 Karl Berry
2003-12-07  5:46 ` Eli Zaretskii
2003-12-06 19:36 Karl Berry
2003-12-06 19:53 ` Luc Teirlinck
2003-12-06 20:38   ` Luc Teirlinck
2003-12-06 20:30 ` Luc Teirlinck
2003-12-06 14:49 Karl Berry
2003-12-04 22:55 Karl Berry
2003-12-03 19:42 Karl Berry
2003-12-03 19:58 ` Robert J. Chassell
2003-12-04  7:07   ` Juri Linkov
2003-12-04 13:12     ` Robert J. Chassell
2003-12-04 15:29       ` Eli Zaretskii
2003-12-04 16:44       ` Karl Berry
2003-12-04 20:13         ` Robert J. Chassell
2003-12-06 21:01           ` Kai Grossjohann
2003-12-07  5:41             ` Eli Zaretskii
2003-12-07 14:49               ` Kai Grossjohann
2003-12-07 15:25                 ` Eli Zaretskii
2003-12-07 16:42                   ` Kai Grossjohann
2003-12-07 18:35                     ` Eli Zaretskii
2003-12-08 19:28                       ` Richard Stallman
2003-12-08 19:43                         ` Stefan Monnier
2003-12-05 14:09         ` Juri Linkov
2003-12-05 14:26           ` Karl Berry
2003-12-05 15:57             ` Juri Linkov
2003-12-05 17:44               ` Eli Zaretskii
2003-12-06  0:15                 ` Juri Linkov
2003-12-06  9:46                   ` Eli Zaretskii
2003-12-05 18:02               ` Luc Teirlinck
2003-12-05 22:33                 ` Luc Teirlinck
2003-12-05 22:36                   ` Luc Teirlinck
2003-12-05 23:52                   ` Juri Linkov
2003-12-06  9:43                     ` Eli Zaretskii
2003-12-06 16:45                       ` Luc Teirlinck
2003-12-06 17:15                         ` Eli Zaretskii
2003-12-06 18:25                           ` Luc Teirlinck
2003-12-07 17:19                             ` Richard Stallman
2003-12-06 17:50                         ` Luc Teirlinck
2003-12-07  0:23                       ` Luc Teirlinck
2003-12-07  2:19                     ` Luc Teirlinck
2003-12-07  2:31                       ` Luc Teirlinck
2003-12-07 17:31                         ` Juri Linkov
2003-12-07 17:44                           ` Luc Teirlinck
2003-12-07 18:00                           ` Luc Teirlinck
2003-12-07 18:32                           ` Eli Zaretskii
2003-12-07 18:57                             ` Luc Teirlinck
2003-12-07 19:27                               ` Juri Linkov
2003-12-08  6:48                                 ` Eli Zaretskii
2003-12-08  6:45                               ` Eli Zaretskii
2003-12-08  9:51                                 ` Juri Linkov
2003-12-09  3:34                                 ` Luc Teirlinck
2003-12-09 10:06                                   ` Eli Zaretskii
2003-12-10  2:56                                     ` Luc Teirlinck
2003-12-10  8:06                                       ` Eli Zaretskii
2003-12-10  3:03                                     ` Luc Teirlinck
2003-12-06  0:27                 ` Juri Linkov
2003-12-07 17:19                   ` Richard Stallman
2003-12-07 21:21                     ` Juri Linkov
2003-12-08  6:58                       ` Eli Zaretskii
2003-12-08 10:12                         ` Juri Linkov
2003-12-08 10:29                           ` Miles Bader
2003-12-08 10:46                             ` Juri Linkov
2003-12-08 11:40                               ` Eli Zaretskii
2003-12-08 14:09                                 ` Juri Linkov
2003-12-09 11:53                                   ` Kim F. Storm
2003-12-08 17:05                                 ` Luc Teirlinck
2003-12-09 10:08                                   ` Eli Zaretskii
2003-12-08 10:35                           ` Eli Zaretskii
2003-12-05 18:27           ` Karl Berry
2003-12-05 20:44             ` Luc Teirlinck
2003-12-05 21:00               ` Luc Teirlinck
2003-12-06  9:11               ` Eli Zaretskii
2003-12-07 17:59               ` Juri Linkov
2003-12-06  1:27             ` Juri Linkov
2003-12-06  9:38               ` Eli Zaretskii
2003-12-07 15:43                 ` Juri Linkov
2003-12-06 14:49               ` Karl Berry
2003-12-06 15:31                 ` Eli Zaretskii
2003-12-06 21:40                 ` Luc Teirlinck
2003-12-06 22:38                   ` Luc Teirlinck
2003-12-07  5:45                   ` Eli Zaretskii
2003-12-07 20:00                 ` Juri Linkov
2003-12-08  6:56                   ` Eli Zaretskii
2003-12-09 21:48                     ` Richard Stallman
2003-12-07 17:19               ` Richard Stallman
2003-12-07 18:44                 ` Luc Teirlinck
2003-12-07 19:00                   ` Luc Teirlinck
2003-12-07 21:54                   ` Juri Linkov
2003-12-07 22:01                     ` Luc Teirlinck
2003-12-09 21:49                     ` Richard Stallman
2003-12-08 19:28                   ` Richard Stallman
2003-12-10  3:29                     ` Luc Teirlinck
2003-12-10 15:48                       ` Richard Stallman
2003-12-08  5:46                 ` Luc Teirlinck
2003-12-08 17:34                   ` Luc Teirlinck
2003-12-09 21:48                   ` Richard Stallman
2003-12-04 15:50     ` Stefan Monnier
2003-12-05  0:11     ` Richard Stallman
2003-12-02 17:27 Info enhancements (was: Re: HTML as info format) Eli Zaretskii
2003-12-02 19:26 ` Karl Berry
2003-12-03  5:38   ` Info enhancements Juri Linkov
2003-12-03 13:27     ` Karl Berry
2003-12-03 15:46       ` Robert J. Chassell
2003-12-20  5:34       ` Juri Linkov
2003-12-20 14:57         ` Karl Berry
2003-12-01 10:38 Juri Linkov
2003-12-02  3:34 ` Luc Teirlinck
2003-12-02 10:54   ` Juri Linkov
2003-12-02  4:43 ` Luc Teirlinck
2003-12-02 21:22 ` Reiner Steib
2003-12-03  5:04   ` Juri Linkov
2004-09-01 16:42     ` Reiner Steib
2004-09-01 20:55       ` Juri Linkov
2004-09-02 19:02         ` Richard Stallman
2003-12-03  0:33 ` Kim F. Storm
2003-12-03  6:43   ` Juri Linkov
2003-12-12  2:08 ` Juri Linkov
2003-12-12 14:24   ` Karl Berry
2003-12-12 17:14     ` Eli Zaretskii
2003-12-12 19:23       ` Stefan Monnier
2003-12-13 10:12         ` Eli Zaretskii
2003-12-13 23:15           ` Richard Stallman
2003-12-12 21:38     ` Juri Linkov
2003-12-13 15:17       ` Richard Stallman
2003-12-16  2:14         ` Juri Linkov
2003-12-17  3:28           ` Richard Stallman
2003-12-18  3:03             ` Juri Linkov
2003-12-18 16:59               ` Richard Stallman
2003-12-19 14:03               ` Luc Teirlinck
2003-12-20  5:27                 ` Juri Linkov
2003-12-13 15:48       ` Eli Zaretskii
2003-12-15  2:35   ` Richard Stallman
2003-12-15  6:01     ` Eli Zaretskii
2003-12-15 20:06       ` Richard Stallman
2003-12-16  3:00       ` Juri Linkov
2003-12-16 12:12         ` Kim F. Storm
2003-12-17  3:28           ` Richard Stallman
2003-12-17  3:28         ` Richard Stallman

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).