Dave Gillespie added `Info-annotate' function to info.el
that he wrote about 10 years ago for Emacs 18. His version
of info.el has been included with XEmacs for many years. I
quote a few lines from XEmacs-21.5.0/lisp/info.el below.
This is for FYI only. I'm sure that after 10 years, there
are much better ways to implement "annotation" solution such
as <http://www.emacslisp.org/manuals/elisp_annotated>.
Jean-Philippe Theberge posted taelm.el to gnu.emacs.sources
a few months ago with which you could annotate emacs-lisp
manual within Emacs.
(defun Info-annotate-mode ()
"Major mode for adding an annotation to an Info node.
Like text mode with the addition of Info-cease-annotate
which returns to Info mode for browsing.
\\{Info-annotate-map}")
(defun Info-annotate (arg)
"Add a personal annotation to the current Info node.
Only you will be able to see this annotation. Annotations are stored
in the file \"~/.xemacs/info.notes\" by default. If point is inside
an existing annotation, edit that annotation. A prefix argument
specifies which annotations file (from `Info-annotations-path') is to
be edited; default is 1."
(interactive "p")
(setq arg (1- arg))
(if (or (< arg 0) (not (nth arg Info-annotations-path)))
(if (= arg 0)
(setq Info-annotations-path
(list (read-file-name
"Annotations file: " "~/" "~/.infonotes")))
(error "File number must be in the range from 1 to %d"
(length Info-annotations-path))))
(let ((which nil)
(file (file-name-nondirectory Info-current-file))
(d Info-directory-list)
where pt)
(while (and d (not (equal (expand-file-name file (car d))
Info-current-file)))
(setq d (cdr d)))
(or d (setq file Info-current-file))
(if (and (save-excursion
(goto-char (min (point-max) (+ (point) 13)))
(and (search-backward "------ NOTE:\n" nil t)
(setq pt (match-end 0))
(search-forward "\n------\n" nil t)))
(< (point) (match-end 0)))
(setq which (format "File: *%s *Node: *%s *Line:.*\n%s"
(regexp-quote file)
(regexp-quote Info-current-node)
(regexp-quote
(buffer-substring pt (match-beginning 0))))
where (max (- (point) pt) 0)))
(let ((node Info-current-node)
(line (if (looking-at "[ \n]*\\'") 0
(count-lines (point-min) (point)))))
(or which
(let ((buffer-read-only nil)
(bufmod (buffer-modified-p)))
(beginning-of-line)
(if (bobp) (goto-char (point-max)))
(insert "------ NOTE:\n------\n")
(backward-char 20)
(set-buffer-modified-p bufmod)))
;; (setq Info-window-start (window-start))
(setq Info-window-configuration (current-window-configuration))
(pop-to-buffer (find-file-noselect (nth arg Info-annotations-path)))
(use-local-map Info-annotate-map)
(setq major-mode 'Info-annotate-mode)
(setq mode-name "Info Annotate")
(if which
(if (save-excursion
(goto-char (point-min))
(re-search-forward which nil t))
(progn
(goto-char (match-beginning 0))
(forward-line 1)
(forward-char where)))
(let ((bufmod (buffer-modified-p)))
(goto-char (point-max))
(insert (format "\n------ File: %s Node: %s Line: %d\n"
file node line))
(setq pt (point))
(insert "\n------\n"
"\nPress C-c C-c to save and return to Info.\n")
(goto-char pt)
(set-buffer-modified-p bufmod))))))
>>>>> "P" == Pavel Jan,Bm(Bk <[EMAIL PROTECTED]> writes:
P>
P> From: Richard Stallman <[EMAIL PROTECTED]>
P> Date: Mon, 24 Dec 2001 12:14:26 -0700 (MST)
P>
>> Users can and do send bug reports for the manuals--it is not hard. I
>> don't see why a special feature would help. We do get a substantial
>> number of bug reports for the manuals.
P>
P> Yes, I of course know that. I read and even send some of them (I prefer not
P> to fix them myself even if I can, because I'm not native English speaker).
P>
>> The notes feature could be more generally useful. How would it work?
P>
P> It was inspired by the way I read printed manuals. Very often, I make notes
P> on the borders, create annotated bookmarks etc. I miss this feature in
P> info. I'd like to share my notes with other users. Very nice example of
P> this is Annotated PHP manual which can be found at http://www.php.net
P> (people now try to make GNU Emacs anotated manual as you could seen this
P> month in emacs-devel). PHP manual is a big document, it is available in
P> printed form, but the on-line form provides the possibility to add
P> annotations. Users who would like to add examples of described functions
P> can do that in annotations. Other readers can read them too. In the next
P> revision of the manual, best examples are added directly to the manual
P> (this is a form of collaborative effort and taking feedback from users).
P>
P> How can it work in info? You are e.g. reading the node (elisp)
P> Something. The function x-y-z is described there. You have something what
P> you'd like to try and discuss later somewhere with someone who is not here
P> right now. You will press `a' (chosen arbitrary, not bound in info) and add
P> small note which will be saved somewhere somehow
P> (e.g. ~/.info-annotations/$file/$node). After that, info page will contain
P> something like ,A9(B or other (unused) symbol. In GNU Emacs' info mode there
P> can be some visual notification of this (tool-tip when you are over the
P> region or something similar). As Eli pointed out, very similar concept is
P> used in GNU Emacs' bookmarks (where it can be used for something similar,
P> but is not finished and can be made better with info integration). But
P> I think this feature should be present in info itself (this is the reason
P> I have chosen [EMAIL PROTECTED] e-mail) and Info-mode should only use
P> that feature.
P>
P> Footnotes:
P> ,A9(B Like footnote mode in GNU Emacs.
P> --
P> Pavel Jan,Am(Bk
P>
P> Use data arrays to avoid repetitive control sequences.
P> -- The Elements of Programming Style (Kernighan & Plaugher)
P>
P> _______________________________________________
P> Bug-texinfo mailing list
P> [EMAIL PROTECTED]
P> http://mail.gnu.org/mailman/listinfo/bug-texinfo
P>
_______________________________________________
Bug-texinfo mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-texinfo