aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Love1999-08-17 14:31:13 +0000
committerDave Love1999-08-17 14:31:13 +0000
commite35ccb9e60009b9b083e0ff200317bf21026ce4b (patch)
treea04600861e150734bff3c6e738d5ec6a5e2e3499
parent04799cf56dc07f2e91dac5046772863a2d901cdc (diff)
downloademacs-e35ccb9e60009b9b083e0ff200317bf21026ce4b.tar.gz
emacs-e35ccb9e60009b9b083e0ff200317bf21026ce4b.zip
Remove compatibility code.
(info-lookup-guess-default*): DTRT for point st start of symbol. (info-complete): Don't lose with point not at end of symbol.
-rw-r--r--lisp/info-look.el34
1 files changed, 17 insertions, 17 deletions
diff --git a/lisp/info-look.el b/lisp/info-look.el
index 9440097cf87..df4cfad4455 100644
--- a/lisp/info-look.el
+++ b/lisp/info-look.el
@@ -1,7 +1,7 @@
1;;; info-look.el --- major-mode-sensitive Info index lookup facility. 1;;; info-look.el --- major-mode-sensitive Info index lookup facility.
2;; An older version of this was known as libc.el. 2;; An older version of this was known as libc.el.
3 3
4;; Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. 4;; Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
5 5
6;; Author: Ralph Schleicher <rs@purple.UL.BaWue.DE> 6;; Author: Ralph Schleicher <rs@purple.UL.BaWue.DE>
7;; Maintainers: FSF (unless Schleicher can be found) 7;; Maintainers: FSF (unless Schleicher can be found)
@@ -27,14 +27,6 @@
27;;; Code: 27;;; Code:
28 28
29(require 'info) 29(require 'info)
30(eval-and-compile
31 (condition-case nil
32 (require 'custom)
33 (error
34 (defmacro defgroup (&rest arg)
35 nil)
36 (defmacro defcustom (symbol value doc &rest arg)
37 `(defvar ,symbol ,value ,doc ,@arg)))))
38 30
39(defgroup info-lookup nil 31(defgroup info-lookup nil
40 "Major mode sensitive help agent." 32 "Major mode sensitive help agent."
@@ -350,10 +342,10 @@ If optional argument QUERY is non-nil, query for the help mode."
350 prefix (nth 2 (car doc-spec)) 342 prefix (nth 2 (car doc-spec))
351 suffix (nth 3 (car doc-spec))) 343 suffix (nth 3 (car doc-spec)))
352 (when (condition-case error-data 344 (when (condition-case error-data
353 (progn 345 (progn
354 (Info-goto-node node) 346 (Info-goto-node node)
355 (setq doc-found t)) 347 (setq doc-found t))
356 (error 348 (error
357 (message "Cannot access Info node %s" node) 349 (message "Cannot access Info node %s" node)
358 (sit-for 1) 350 (sit-for 1)
359 nil)) 351 nil))
@@ -449,10 +441,10 @@ If optional argument QUERY is non-nil, query for the help mode."
449 (with-current-buffer buffer 441 (with-current-buffer buffer
450 (message "Processing Info node `%s'..." node) 442 (message "Processing Info node `%s'..." node)
451 (when (condition-case error-data 443 (when (condition-case error-data
452 (progn 444 (progn
453 (Info-goto-node node) 445 (Info-goto-node node)
454 (setq doc-found t)) 446 (setq doc-found t))
455 (error 447 (error
456 (message "Cannot access Info node `%s'" node) 448 (message "Cannot access Info node `%s'" node)
457 (sit-for 1) 449 (sit-for 1)
458 nil)) 450 nil))
@@ -466,7 +458,7 @@ If optional argument QUERY is non-nil, query for the help mode."
466 ;; `trans' can return nil if the regexp doesn't match. 458 ;; `trans' can return nil if the regexp doesn't match.
467 (when (and item 459 (when (and item
468 ;; Sometimes there's more than one Menu: 460 ;; Sometimes there's more than one Menu:
469 (not (string= entry "Menu"))) 461 (not (string= entry "Menu")))
470 (and (info-lookup->ignore-case topic mode) 462 (and (info-lookup->ignore-case topic mode)
471 (setq item (downcase item))) 463 (setq item (downcase item)))
472 (and (string-equal entry item) 464 (and (string-equal entry item)
@@ -511,7 +503,11 @@ Return nil if there is nothing appropriate in the buffer near point."
511 subexp (cdr rule)) 503 subexp (cdr rule))
512 (setq regexp rule 504 (setq regexp rule
513 subexp 0)) 505 subexp 0))
514 (skip-chars-backward " \t\n") (setq end (point)) 506 ;; If at start of symbol, don't go back to end of previous one.
507 (if (save-match-data
508 (looking-at "[ \t\n]"))
509 (skip-chars-backward " \t\n"))
510 (setq end (point))
515 (while (and (re-search-backward regexp nil t) 511 (while (and (re-search-backward regexp nil t)
516 (looking-at regexp) 512 (looking-at regexp)
517 (>= (match-end 0) end)) 513 (>= (match-end 0) end))
@@ -602,7 +598,11 @@ Return nil if there is nothing appropriate in the buffer near point."
602 (format "Complete %S: " topic) 598 (format "Complete %S: " topic)
603 completions nil t completion 599 completions nil t completion
604 info-lookup-history))) 600 info-lookup-history)))
605 (delete-region (- start (length try)) start) 601 ;; Find the original symbol and zap it.
602 (end-of-line)
603 (while (and (search-backward try nil t)
604 (< start (point))))
605 (replace-match "")
606 (insert completion)) 606 (insert completion))
607 (t 607 (t
608 (message "%s is complete" 608 (message "%s is complete"
@@ -764,7 +764,7 @@ Return nil if there is nothing appropriate in the buffer near point."
764 :doc-spec '(("(octave)Function Index" nil "^ - [^:]+:[ ]+" nil) 764 :doc-spec '(("(octave)Function Index" nil "^ - [^:]+:[ ]+" nil)
765 ("(octave)Variable Index" nil "^ - [^:]+:[ ]+" nil) 765 ("(octave)Variable Index" nil "^ - [^:]+:[ ]+" nil)
766 ;; Catch lines of the form "xyz statement" 766 ;; Catch lines of the form "xyz statement"
767 ("(octave)Concept Index" 767 ("(octave)Concept Index"
768 (lambda (item) 768 (lambda (item)
769 (cond 769 (cond
770 ((string-match "^\\([A-Z]+\\) statement\\b" item) 770 ((string-match "^\\([A-Z]+\\) statement\\b" item)