From: Juri Linkov <juri@jurta.org>
Subject: Info enhancements
Date: Mon, 01 Dec 2003 12:38:15 +0200 [thread overview]
Message-ID: <87smk4zuvv.fsf@mail.jurta.org> (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/
next prev reply other threads:[~2003-12-01 10:38 UTC|newest]
Thread overview: 245+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-10-28 1:26 terminal escapes in Info files? Karl Berry
2003-10-28 10:51 ` Alper Ersoy
2003-10-28 13:48 ` Oliver Scholz
2003-10-30 10:42 ` Alper Ersoy
2003-11-10 13:01 ` HTML as info format (was: terminal escapes in Info files?) Oliver Scholz
2003-11-17 13:29 ` HTML as info format Juri Linkov
2003-11-18 7:01 ` Richard Stallman
2003-11-18 14:54 ` Changes to Texinfo DTD [Was: Re: HTML as info format] Robert J. Chassell
2003-11-18 15:59 ` Changes to Texinfo DTD Oliver Scholz
2003-11-18 21:03 ` Robert J. Chassell
2003-11-18 21:18 ` Nic Ferrier
2003-11-19 12:38 ` Robert J. Chassell
2003-11-19 13:18 ` Nic Ferrier
2003-11-20 10:37 ` Oliver Scholz
2003-11-20 16:55 ` Robert J. Chassell
2003-11-20 18:19 ` Oliver Scholz
2003-11-20 20:32 ` Nic Ferrier
2003-11-20 22:05 ` Oliver Scholz
2003-11-20 22:51 ` Nic Ferrier
2003-11-21 2:13 ` Robert J. Chassell
2003-11-21 8:49 ` Nic Ferrier
2003-11-21 2:10 ` Robert J. Chassell
2003-11-21 7:57 ` Nic Ferrier
2003-11-24 7:57 ` Juri Linkov
2003-11-24 9:32 ` Nic Ferrier
2003-11-22 21:19 ` Richard Stallman
2003-11-22 21:41 ` Nic Ferrier
2003-11-22 21:42 ` Miles Bader
2003-11-22 21:56 ` Nic Ferrier
2003-11-24 7:55 ` Juri Linkov
2003-11-24 9:25 ` Why XSLT in Emacs Lisp? (was Re: Changes to Texinfo DTD) Nic Ferrier
2003-11-24 13:04 ` Why XSLT in Emacs Lisp? Alex Schroeder
2003-11-23 17:14 ` Changes to Texinfo DTD Robert J. Chassell
2003-11-24 7:54 ` Juri Linkov
2003-11-24 16:19 ` Luc Teirlinck
2003-11-24 22:32 ` Robert J. Chassell
2003-11-24 22:31 ` Miles Bader
2003-11-25 5:22 ` Juri Linkov
2003-11-25 16:48 ` Luc Teirlinck
2003-11-25 21:59 ` Juri Linkov
2003-11-25 23:32 ` Luc Teirlinck
2003-11-25 19:54 ` Luc Teirlinck
2003-11-25 21:48 ` Juri Linkov
2003-11-26 1:08 ` Luc Teirlinck
2003-12-02 6:42 ` Eli Zaretskii
2003-12-03 1:47 ` Luc Teirlinck
2003-12-03 16:18 ` Eli Zaretskii
2003-12-04 2:53 ` Luc Teirlinck
2003-12-04 7:58 ` Eli Zaretskii
2003-12-04 2:54 ` Luc Teirlinck
2003-12-04 8:04 ` Eli Zaretskii
2003-12-04 9:39 ` Oliver Scholz
2003-12-04 11:48 ` Oliver Scholz
2003-12-04 15:35 ` Eli Zaretskii
2003-12-04 8:19 ` Oliver Scholz
2003-12-04 13:49 ` Robert J. Chassell
2003-12-05 0:11 ` Richard Stallman
2003-12-05 9:49 ` Kim F. Storm
2003-12-06 16:11 ` Alfred M. Szmidt
2003-12-06 17:11 ` Eli Zaretskii
2003-12-09 16:47 ` Alfred M. Szmidt
2003-12-10 7:25 ` Eli Zaretskii
2003-12-04 3:35 ` Luc Teirlinck
2003-12-04 8:12 ` Eli Zaretskii
2003-11-22 23:59 ` Stefan Monnier
2003-11-23 0:05 ` Nic Ferrier
2003-11-23 14:16 ` Oliver Scholz
2003-11-23 15:11 ` Nic Ferrier
2003-11-24 16:22 ` Richard Stallman
2003-11-20 18:24 ` Karl Eichwalder
2003-11-24 16:23 ` Richard Stallman
2003-12-02 7:08 ` HTML as info format Eli Zaretskii
2003-12-01 10:38 ` Juri Linkov [this message]
2003-12-02 3:34 ` Info enhancements Luc Teirlinck
2003-12-02 10:54 ` Juri Linkov
2003-12-02 4:43 ` Luc Teirlinck
2003-12-02 10:18 ` Info enhancements (was: Re: HTML as info format) Juri Linkov
2003-12-02 17:27 ` 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-03 17:16 ` Info enhancements (was: Re: HTML as info format) Richard Stallman
2003-12-02 21:22 ` Info enhancements Reiner Steib
2003-12-03 3:54 ` `s' (regex) search [was Re: Info enhancements] Harry Putnam
2003-12-03 5:47 ` Eli Zaretskii
2003-12-03 9:42 ` Harry Putnam
2003-12-03 11:31 ` Eli Zaretskii
2003-12-03 11:56 ` Harry Putnam
2003-12-03 16:27 ` Eli Zaretskii
2003-12-03 19:13 ` Harry Putnam
2003-12-04 8:34 ` Eli Zaretskii
2003-12-03 5:04 ` Info enhancements 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
2004-07-01 21:07 ` non-blocking socket io: data limit on read? Nic Ferrier
2003-10-28 16:19 ` terminal escapes in Info files? Stefan Monnier
2003-10-29 19:02 ` Richard Stallman
2003-10-29 19:47 ` David Kastrup
2003-10-29 21:43 ` Eli Zaretskii
2003-10-29 22:39 ` David Kastrup
2003-10-30 6:03 ` Eli Zaretskii
2003-10-30 18:00 ` Richard Stallman
2003-10-29 19:01 ` Richard Stallman
2003-10-29 19:45 ` Alper Ersoy
2003-10-29 19:42 ` Eli Zaretskii
2003-10-30 18:00 ` Richard Stallman
2003-10-29 19:02 ` Richard Stallman
-- strict thread matches above, loose matches on Subject: below --
2003-12-03 19:42 Info enhancements 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-04 22:55 Karl Berry
2003-12-06 14:49 Karl Berry
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-07 0:53 Karl Berry
2003-12-07 5:46 ` Eli Zaretskii
2003-12-07 0:56 Karl Berry
2003-12-07 0:59 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
2003-12-07 1:20 Karl Berry
2003-12-07 5:50 ` Eli Zaretskii
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87smk4zuvv.fsf@mail.jurta.org \
--to=juri@jurta.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 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).