comparison lisp/apropos.el @ 412:697ef44129c6 r21-2-14

Import from CVS: tag r21-2-14
author cvs
date Mon, 13 Aug 2007 11:20:41 +0200
parents de805c49cfc1
children
comparison
equal deleted inserted replaced
411:12e008d41344 412:697ef44129c6
2 2
3 ;; Copyright (C) 1989, 1994, 1995 Free Software Foundation, Inc. 3 ;; Copyright (C) 1989, 1994, 1995 Free Software Foundation, Inc.
4 4
5 ;; Author: Joe Wells <jbw@bigbird.bu.edu> 5 ;; Author: Joe Wells <jbw@bigbird.bu.edu>
6 ;; Rewritten: Daniel.Pfeiffer@Informatik.START.dbp.de, fax (+49 69) 7588-2389 6 ;; Rewritten: Daniel.Pfeiffer@Informatik.START.dbp.de, fax (+49 69) 7588-2389
7 ;; Maintainer: SL Baur <steve@xemacs.org> 7 ;; Maintainer: SL Baur <steve@altair.xemacs.org>
8 ;; Keywords: help 8 ;; Keywords: help
9 9
10 ;; This file is part of XEmacs. 10 ;; This file is part of XEmacs.
11 11
12 ;; XEmacs is free software; you can redistribute it and/or modify it 12 ;; XEmacs is free software; you can redistribute it and/or modify it
105 105
106 106
107 (defvar apropos-mode-map 107 (defvar apropos-mode-map
108 (let ((map (make-sparse-keymap))) 108 (let ((map (make-sparse-keymap)))
109 (define-key map [(control m)] 'apropos-follow) 109 (define-key map [(control m)] 'apropos-follow)
110 (define-key map [return] 'apropos-follow)
111 (define-key map [(button2up)] 'apropos-mouse-follow) 110 (define-key map [(button2up)] 'apropos-mouse-follow)
112 (define-key map [(button2)] 'undefined) 111 (define-key map [(button2)] 'undefined)
113 map) 112 map)
114 "Keymap used in Apropos mode.") 113 "Keymap used in Apropos mode.")
115 114
375 374
376 375
377 ;; Finds all documentation related to APROPOS-REGEXP in internal-doc-file-name. 376 ;; Finds all documentation related to APROPOS-REGEXP in internal-doc-file-name.
378 377
379 (defun apropos-documentation-check-doc-file () 378 (defun apropos-documentation-check-doc-file ()
380 (let (type symbol (sepa 2) sepb beg end doc) 379 (let (type symbol (sepa 2) sepb beg end)
381 (insert ?\^_) 380 (princ ?\^_)
382 (backward-char) 381 (backward-char)
383 (insert-file-contents (concat doc-directory internal-doc-file-name)) 382 (insert-file-contents (concat doc-directory internal-doc-file-name))
384 (forward-char) 383 (forward-char)
385 (while (save-excursion 384 (while (save-excursion
386 (setq sepb (search-forward "\^_")) 385 (setq sepb (search-forward "\^_"))
507 (with-current-buffer standard-output 506 (with-current-buffer standard-output
508 (run-hooks 'apropos-mode-hook) 507 (run-hooks 'apropos-mode-hook)
509 (let ((p apropos-accumulator) 508 (let ((p apropos-accumulator)
510 (old-buffer (current-buffer)) 509 (old-buffer (current-buffer))
511 symbol item point1 point2) 510 symbol item point1 point2)
512 ;; Mostly useless but to provide better keymap
513 ;; explanation. help-mode-map will be used instead.
514 (use-local-map apropos-mode-map)
515 ;; XEmacs change from (if window-system 511 ;; XEmacs change from (if window-system
516 (if (device-on-window-system-p) 512 (if (device-on-window-system-p)
517 (progn 513 (progn
518 (princ "If you move the mouse over text that changes color,\n") 514 (princ "If you move the mouse over text that changes color,\n")
519 (princ (substitute-command-keys 515 (princ (substitute-command-keys
577 (if (eval `(or ,@(cdr apropos-item))) 573 (if (eval `(or ,@(cdr apropos-item)))
578 (car apropos-item) 574 (car apropos-item)
579 apropos-item)) 575 apropos-item))
580 (if apropos-symbol-face 576 (if apropos-symbol-face
581 (put-text-property point1 point2 'face apropos-symbol-face)) 577 (put-text-property point1 point2 'face apropos-symbol-face))
582 ;; Add text-property on symbol, too.
583 (put-text-property point1 point2 'keymap apropos-mode-map)
584 (apropos-print-doc 'describe-function 1 578 (apropos-print-doc 'describe-function 1
585 (if (commandp symbol) 579 (if (commandp symbol)
586 "Command" 580 "Command"
587 (if (apropos-macrop symbol) 581 (if (apropos-macrop symbol)
588 "Macro" 582 "Macro"