X-Git-Url: http://git.chise.org/gitweb/?p=chise%2Fxemacs-chise.git.1;a=blobdiff_plain;f=lisp%2Fapropos.el;h=a96221cb4dc94e45d236c0eb86da15e49c4a35dc;hp=58391944695fe19e26598ff9e91e699fef85fa1d;hb=ee38d21b330f5001b47a577cefb5ba7b82a3b7d3;hpb=77dcef404dc78635f6ffa8f71a803d2bc7cc8921 diff --git a/lisp/apropos.el b/lisp/apropos.el index 5839194..a96221c 100644 --- a/lisp/apropos.el +++ b/lisp/apropos.el @@ -4,7 +4,7 @@ ;; Author: Joe Wells ;; Rewritten: Daniel.Pfeiffer@Informatik.START.dbp.de, fax (+49 69) 7588-2389 -;; Maintainer: SL Baur +;; Maintainer: SL Baur ;; Keywords: help ;; This file is part of XEmacs. @@ -107,6 +107,7 @@ This looks good, but slows down the commands several times.") (defvar apropos-mode-map (let ((map (make-sparse-keymap))) (define-key map [(control m)] 'apropos-follow) + (define-key map [return] 'apropos-follow) (define-key map [(button2up)] 'apropos-mouse-follow) (define-key map [(button2)] 'undefined) map) @@ -174,7 +175,10 @@ variables." ;; XEmacs change: if obsolete, ;; only mention that. (or (function-obsoleteness-doc symbol) - (documentation symbol t))) + (condition-case nil + (documentation symbol t) + (void-function "(aliased to undefined function)") + (error "(unexpected error from `documention')")))) (substring doc 0 (string-match "\n" doc)) "(not documented)")) (and do-all @@ -224,7 +228,10 @@ Returns list of symbols and documentation found." ;; XEmacs change: if obsolete, ;; only mention that. (or (function-obsoleteness-doc symbol) - (documentation symbol t))) + (condition-case nil + (documentation symbol t) + (void-function "(aliased to undefined function)") + (error "(unexpected error from `documention')")))) (substring doc 0 (string-match "\n" doc)) "(not documented)")) (if (boundp symbol) @@ -376,8 +383,8 @@ Returns list of symbols and documentation found." ;; Finds all documentation related to APROPOS-REGEXP in internal-doc-file-name. (defun apropos-documentation-check-doc-file () - (let (type symbol (sepa 2) sepb beg end) - (princ ?\^_) + (let (type symbol (sepa 2) sepb start end doc) + (insert ?\^_) (backward-char) (insert-file-contents (concat doc-directory internal-doc-file-name)) (forward-char) @@ -389,14 +396,14 @@ Returns list of symbols and documentation found." (narrow-to-region (point) (1- sepb)) (re-search-forward apropos-regexp nil t)) (progn - (setq beg (match-beginning 0) + (setq start (match-beginning 0) end (point)) (goto-char (1+ sepa)) (or (setq type (if (eq ?F (preceding-char)) 1 ; function documentation 2) ; variable documentation symbol (read) - beg (- beg (point) 1) + start (- start (point) 1) end (- end (point) 1) doc (buffer-substring (1+ (point)) (1- sepb)) apropos-item (assq symbol apropos-accumulator)) @@ -404,32 +411,32 @@ Returns list of symbols and documentation found." apropos-accumulator (cons apropos-item apropos-accumulator))) (if apropos-match-face - (put-text-property beg end 'face apropos-match-face doc)) + (put-text-property start end 'face apropos-match-face doc)) (setcar (nthcdr type apropos-item) doc))) (setq sepa (goto-char sepb))))) (defun apropos-documentation-check-elc-file (file) (if (member file apropos-files-scanned) nil - (let (symbol doc beg end this-is-a-variable) + (let (symbol doc start end this-is-a-variable) (setq apropos-files-scanned (cons file apropos-files-scanned)) (erase-buffer) (insert-file-contents file) (while (search-forward "\n#@" nil t) ;; Read the comment length, and advance over it. (setq end (read) - beg (1+ (point)) + start (1+ (point)) end (+ (point) end -1)) (forward-char) (if (save-restriction ;; match ^ and $ relative to doc string - (narrow-to-region beg end) + (narrow-to-region start end) (re-search-forward apropos-regexp nil t)) (progn (goto-char (+ end 2)) - (setq doc (buffer-substring beg end) - end (- (match-end 0) beg) - beg (- (match-beginning 0) beg) + (setq doc (buffer-substring start end) + end (- (match-end 0) start) + start (- (match-beginning 0) start) this-is-a-variable (looking-at "(def\\(var\\|const\\) ") symbol (progn (skip-chars-forward "(a-z") @@ -447,7 +454,7 @@ Returns list of symbols and documentation found." apropos-accumulator (cons apropos-item apropos-accumulator))) (if apropos-match-face - (put-text-property beg end 'face apropos-match-face + (put-text-property start end 'face apropos-match-face doc)) (setcar (nthcdr (if this-is-a-variable 2 1) apropos-item) @@ -508,6 +515,9 @@ found." (let ((p apropos-accumulator) (old-buffer (current-buffer)) symbol item point1 point2) + ;; Mostly useless but to provide better keymap + ;; explanation. help-mode-map will be used instead. + (use-local-map apropos-mode-map) ;; XEmacs change from (if window-system (if (device-on-window-system-p) (progn @@ -575,6 +585,8 @@ found." apropos-item)) (if apropos-symbol-face (put-text-property point1 point2 'face apropos-symbol-face)) + ;; Add text-property on symbol, too. + (put-text-property point1 point2 'keymap apropos-mode-map) (apropos-print-doc 'describe-function 1 (if (commandp symbol) "Command"