[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: generate 1) virtual index
From: |
Juri Linkov |
Subject: |
Re: generate 1) virtual index |
Date: |
Sun, 23 Sep 2007 23:42:14 +0300 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/23.0.50 (gnu/linux) |
>> Since it was proposed in
>>
>> http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00454.html
>>
>> instead of implementing `Info-index-occur' I arrived to a different
>> command name: `info-apropos-current-file'. I don't know if this is
>> a better name, but by its functionality this command is very similar
>> to `info-apropos' that works only on the current Info file.
>
> I'm not sure, but I think we are saying the same or similar things.
> Is that right? I had forgotten your proposal cited in the link above,
> but it seems about the same. Is there a difference or something
> additional that you are saying?
Below is a simple patch that implements this:
Index: lisp/info.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/info.el,v
retrieving revision 1.505
diff -c -w -b -r1.505 info.el
*** lisp/info.el 28 Aug 2007 10:15:23 -0000 1.505
--- lisp/info.el 23 Sep 2007 20:40:07 -0000
***************
*** 2931,2940 ****
(progn (beginning-of-line) t) ;; non-nil for recursive call
(goto-char (point-min)))))
;;;###autoload
! (defun info-apropos (string)
"Grovel indices of all known Info files on your system for STRING.
! Build a menu of the possible matches."
(interactive "sIndex apropos: ")
(unless (string= string "")
(let ((pattern (format "\n\\* +\\([^\n]*%s[^\n]*\\):[
\t]+\\([^\n]+\\)\\.\\(?:[ \t\n]*(line +\\([0-9]+\\))\\)?"
--- 2931,2947 ----
(progn (beginning-of-line) t) ;; non-nil for recursive call
(goto-char (point-min)))))
+ (defun info-apropos-current-file (string)
+ "Search indices of the current Info file for STRING.
+ Build a menu of the possible matches."
+ (interactive "sIndex apropos current Info file: ")
+ (info-apropos string t))
+
;;;###autoload
! (defun info-apropos (string &optional current)
"Grovel indices of all known Info files on your system for STRING.
! Build a menu of the possible matches.
! If CURRENT is non-nil, search indices only in the current Info file."
(interactive "sIndex apropos: ")
(unless (string= string "")
(let ((pattern (format "\n\\* +\\([^\n]*%s[^\n]*\\):[
\t]+\\([^\n]+\\)\\.\\(?:[ \t\n]*(line +\\([0-9]+\\))\\)?"
***************
*** 2943,2950 ****
--- 2950,2960 ----
(ohist-list Info-history-list)
(current-node Info-current-node)
(current-file Info-current-file)
+ (supports-index-cookies Info-file-supports-index-cookies)
manuals matches node nodes)
(let ((Info-fontify-maximum-menu-size nil))
+ (if current
+ (setq manuals (list Info-current-file))
(Info-directory)
;; current-node and current-file are nil when they invoke info-apropos
;; as the first Info command, i.e. info-apropos loads info.el. In
that
***************
*** 2959,2965 ****
(while (re-search-forward "\\*.*: *(\\([^)]+\\))" nil t)
;; add-to-list makes sure we don't have duplicates in `manuals',
;; so that the following dolist loop runs faster.
! (add-to-list 'manuals (match-string 1)))
(dolist (manual (nreverse manuals))
(message "Searching %s" manual)
(condition-case err
--- 2969,2975 ----
(while (re-search-forward "\\*.*: *(\\([^)]+\\))" nil t)
;; add-to-list makes sure we don't have duplicates in `manuals',
;; so that the following dolist loop runs faster.
! (add-to-list 'manuals (match-string 1))))
(dolist (manual (nreverse manuals))
(message "Searching %s" manual)
(condition-case err
***************
*** 2991,2996 ****
--- 3001,3009 ----
(with-current-buffer (get-buffer-create " *info-apropos*")
(erase-buffer)
(insert "\n\^_\nFile: apropos, Node: Index, Up: (dir)\n")
+ (when supports-index-cookies
+ (insert "\0\b[index\0\b]\n")
+ (set (make-local-variable 'Info-file-supports-index-cookies)
supports-index-cookies))
(insert "* Menu: \nNodes whose indices contain `" string "':\n\n")
(dolist (entry (nreverse matches))
(insert
***************
*** 3177,3182 ****
--- 3190,3196 ----
(define-key Info-mode-map "g" 'Info-goto-node)
(define-key Info-mode-map "h" 'Info-help)
(define-key Info-mode-map "i" 'Info-index)
+ (define-key Info-mode-map "I" 'info-apropos-current-file)
(define-key Info-mode-map "l" 'Info-history-back)
(define-key Info-mode-map "L" 'Info-history)
(define-key Info-mode-map "m" 'Info-menu)
--
Juri Linkov
http://www.jurta.org/emacs/
Re: generate 1) virtual index, Juri Linkov, 2007/09/23
Re: generate 3) S-mouse-2: follow link in new window, Juri Linkov, 2007/09/23
- RE: generate 3) S-mouse-2: follow link in new window, Drew Adams, 2007/09/23
- Re: generate 3) S-mouse-2: follow link in new window, Lennart Borgman (gmail), 2007/09/23
- RE: generate 3) S-mouse-2: follow link in new window, Drew Adams, 2007/09/23
- Re: generate 3) S-mouse-2: follow link in new window, Johan Bockgård, 2007/09/23
- Re: generate 3) S-mouse-2: follow link in new window, Stefan Monnier, 2007/09/23
- RE: generate 3) S-mouse-2: follow link in new window, Drew Adams, 2007/09/23
- Re: generate 3) S-mouse-2: follow link in new window, Richard Stallman, 2007/09/24
- RE: generate 3) S-mouse-2: follow link in new window, Drew Adams, 2007/09/27