diff lisp/help.el @ 502:7039e6323819

[xemacs-hg @ 2001-05-04 22:41:46 by ben] ----------------------- byte-comp warning fixes ----------------- New functions for cleanly eliminating byte-compiler warnings. Their definitions require no changes at all in bytecomp.el, meaning that any package that wants to use them and be compatible with older versions of XEmacs need only copy the code and rename the functions (i.e. prefix them with the package name). Eliminate byte-compiler warnings using the new functions in bytecomp-runtime.el. Move coding-system-put,get,category, since they're not Mule-specific and are used in prefer-coding-system. font.el was incredibly ugly. Clean it up. Avoid using defsubst for any exported functions, to avoid possible compatibility problems if we later change the internal interface. (It happened before, with face accessors, between 19.8 and 19.9). Fix tons of warnings. Clean up (new function gpm-is-supported-p eliminates duplicate code in gpm-create/delete-device-hook) and eliminate warnings. ---------- make byte-recompile-directory work in the --------- core `lisp' dir, even in the absence of a Mule XEmacs (i.e. make it skip the Mule files rather than trying to compile them). now you should be able to do `touch *.el' in the `lisp' dir, then M-x byte-recompile-directory, and get no warnings. Avoid trying to compile Mule files in byte-recompile-directory when we're not in a Mule XEmacs, since we're highly likely to get syntax errors. Add a coding-system cookie to all Mule files so that byte-recompile-directory ignores them. Magic cookie function moved to files.el from code-files.el (for use by bytecomp even in a non-coding-system XEmacs), and changed names and semantics for use by bytecomp. NOTE: IMO this is an internal function that we can change as we like (and there is absolutely no code anywhere else using the function). ---------------- GUI improvements: menus, help ------------------- Rearrange order of keymap declarations to be alphabetical. Improve help on help to include all bindings, and group by category. Add bindings for new Info commands. Remove warnings. Use command-hyper-apropos in place of command-apropos. Add a function to do the equivalent of command-apropos. Evals its help-text argument so you can put expressions there. Used now by help-for-help. Add binding to continue text searches. Expand index searches to work over multiple info documents. Add commands to search text/index in User and Lispref. Add new entry, "Uncomment Region" (parallels "Comment Out Region"). Redo Help menu; add bindings for new Info commands to search the index or text of the User and Lispref manuals. Add command for mark-paragraph, activate-region. Make Edit->R accelerator be rectangle, not register (more commonly used), and put rectangle first. Fix the Edit Init File entry to never load the .elc file. Simplify the default-popup-menu. Add Cmds->Tabs menu. Use kp-left not kp_left, etc. ---------------- Miscellaneous bug fixes/cleanup ------------------- byte-compiler-options: Correct doc string. easy-menu-do-define: fix extra quote. fill-paragraph-or-region:Rewrite to be more correct -- use call-interactively so that we always get exactly the same behavior as if the functions were called directly. No need to fiddle with zmacs-region-stays, now that bogus clearing of it (2001-04-28 src/ChangeLog) is removed. Put dialog titles back in -- this time correctly. Fix various other problems with leaks and such. key-sequence-list-description: Clean up fun to always correctly canonicalize. Clean up Kinsoku comments, synch comment-region with FSF 20.7. * simple.el (region-exists-p): * simple.el (region-active-p): Add comment about which one is correct to use in menu specs. * sound.el (load-sound-file): Minor code clean up. * startup.el: * startup.el (command-line-early): * startup.el (initial-scratch-message): Comment changes. Add info about sample.init.el to splash screen. Improve initial-scratch-message and clarify purpose of Scratch buffer. Fix byte-compile warning. ------------------------ Added features ------------------------- Add new variable to control whether etags checks all parent directories for tag files. (On by default.) * hash-table.el: New file, useful utility functions. * dumped-lisp.el (preloaded-file-list): Dump hash-table.el. ------------ notable bug fix: Windows event code -------------- Get critical quit working. ------------ notable bug fix and new feature: regex code -------------- Shy groups were implemented in a horrible, half-assed way that would cause them to screw up regex searching in most cases. Fixed to work correctly. Also extended back-reference syntax past 9. Only is recognized as such if there are at least that many non-shy groups; and optionally will warn about such uses, to catch old code that might be using them differently. (Added variable to control this in search.c -- `warn-about-possibly-incompatible-back- references', on by default for the moment. Declared in lisp.h. ---------------- process/SIGIO improvements ------------------- define USE_GETADDRINFO to replace more complex conditional, and use it. the code conditionalized on this in unix_open_network_stream had *serious* problems handling errors. it's now fixed, and major amounts of duplicate code between the two versions were combined. don't disable SIGIO and other interrupts unless CONNECT_NEEDS_SLOWED_INTERRUPTS is defined -- don't penalize OS's without bugs. similarly for a freebsd bug that was affecting all OS's. * s\ultrix.h: define CONNECT_NEEDS_SLOWED_INTERRUPTS, since that's the OS mentioned as having a kernel bug. * sysdep.c (request_sigio_on_device): * sysdep.c (unrequest_sigio_on_device): fix SIGIO problems on Linux. add check for O_ASYNC in case it's defined and FASYNC isn't. add comment about other ways to do SIGIO on Linux. * callproc.c (Fold_call_process_internal): * process.c (Fstart_process_internal): Deal with the possibility that `default-directory' doesn't have terminating slash. Correct comments about vfork. ---------------- Miscellaneous bug fixes/cleanup ------------------- * callint.c (Finteractive): Add lots of documentation -- exactly what the Lisp equivalents of all the interactive specs are. * console.h (struct console): change type of quit_char to Emchar. * event-msw.c (lstream_type_create_mswindows_selectable): spacing change. Eliminate events-mod.h and combine into events.h. * emacs.c: * emacs.c (make_arg_list_1): * emacs.c (main_1): A couple of char->Extbyte changes, add a comment. * glyphs-msw.c: Correct indentation of function defns to not exceed 80 cols. Try (sort of) to fix some code that sets the colors of the progress gauge. (Commented out) * keymap.c (syms_of_keymap): use DEFSYMBOL. * process.c (read_process_output): No need to fiddle with zmacs_region_stays, now that bogus clearing of it (see below) is removed. * search.c (Freplace_match): warning fix.
author ben
date Fri, 04 May 2001 22:42:35 +0000
parents 5aa1854ad537
children 11502791fc1c
line wrap: on
line diff
--- a/lisp/help.el	Thu May 03 21:08:39 2001 +0000
+++ b/lisp/help.el	Fri May 04 22:42:35 2001 +0000
@@ -64,118 +64,77 @@
 (define-key help-map 'help 'help-for-help)
 (define-key help-map '(f1) 'help-for-help)
 
-(define-key help-map "\C-l" 'describe-copying) ; on \C-c in FSFmacs
-(define-key help-map "\C-d" 'describe-distribution)
-(define-key help-map "\C-w" 'describe-no-warranty)
 (define-key help-map "a" 'hyper-apropos) ; 'command-apropos in FSFmacs
-(define-key help-map "A" 'command-apropos)
+(define-key help-map "A" 'command-hyper-apropos)
+;; #### should be hyper-apropos-documentation, once that's written.
+(define-key help-map "\C-a" 'apropos-documentation)
 
 (define-key help-map "b" 'describe-bindings)
 (define-key help-map "B" 'describe-beta)
-(define-key help-map "\C-p" 'describe-pointer)
 
+(define-key help-map "c" 'describe-key-briefly)
 (define-key help-map "C" 'customize)
-(define-key help-map "c" 'describe-key-briefly)
-(define-key help-map "k" 'describe-key)
+;; FSFmacs has Info-goto-emacs-command-node on C-f, no binding
+;; for Info-elisp-ref
+(define-key help-map "\C-c" 'Info-goto-emacs-command-node)
 
 (define-key help-map "d" 'describe-function)
-(define-key help-map "e" 'describe-last-error)
+(define-key help-map "\C-d" 'describe-distribution)
+
+(define-key help-map "e" (if (fboundp 'view-last-error) 'view-last-error
+			   'describe-last-error))
+
 (define-key help-map "f" 'describe-function)
-
+;; #### not a good interface.  no way to specify that C-h is preferred
+;; as a prefix and not BS.  should instead be specified as part of
+;; `define-key'.
+;; (put 'describe-function 'preferred-key-sequence "\C-hf")
 (define-key help-map "F" 'xemacs-local-faq)
+(define-key help-map "\C-f" 'Info-elisp-ref)
 
 (define-key help-map "i" 'info)
-(define-key help-map '(control i) 'Info-query)
-;; FSFmacs has Info-goto-emacs-command-node on C-f, no binding
-;; for Info-elisp-ref
-(define-key help-map '(control c) 'Info-goto-emacs-command-node)
-(define-key help-map '(control k) 'Info-goto-emacs-key-command-node)
-(define-key help-map '(control f) 'Info-elisp-ref)
+(define-key help-map "I" 'Info-search-index-in-xemacs-and-lispref)
+(define-key help-map "\C-i" 'Info-query)
+
+(define-key help-map "k" 'describe-key)
+(define-key help-map "\C-k" 'Info-goto-emacs-key-command-node)
 
 (define-key help-map "l" 'view-lossage)
+(define-key help-map "\C-l" 'describe-copying) ; on \C-c in FSFmacs
 
 (define-key help-map "m" 'describe-mode)
 
+(define-key help-map "n" 'view-emacs-news)
 (define-key help-map "\C-n" 'view-emacs-news)
-(define-key help-map "n" 'view-emacs-news)
 
 (define-key help-map "p" 'finder-by-keyword)
+(define-key help-map "\C-p" 'describe-pointer)
+
+(define-key help-map "q" 'help-quit)
 
 ;; Do this right with an autoload cookie in finder.el.
 ;;(autoload 'finder-by-keyword "finder"
 ;;  "Find packages matching a given keyword." t)
 
 (define-key help-map "s" 'describe-syntax)
+(define-key help-map "S" 'view-sample-init-el)
 
 (define-key help-map "t" 'help-with-tutorial)
 
-(define-key help-map "w" 'where-is)
-
 (define-key help-map "v" 'describe-variable)
 
-(if (fboundp 'view-last-error)
-    (define-key help-map "e" 'view-last-error))
-
-
-(define-key help-map "q" 'help-quit)
-
-;#### This stuff was an attempt to have font locking and hyperlinks in the
-;help buffer, but it doesn't really work.  Some of this stuff comes from
-;FSF Emacs; but the FSF Emacs implementation is rather broken, as usual.
-;What needs to happen is this:
-;
-; -- we probably need a "hyperlink mode" from which help-mode is derived.
-; -- this means we probably need multiple inheritance of modes!
-;    Thankfully this is not hard to implement; we already have the
-;    ability for a keymap to have multiple parents.  However, we'd
-;    have to define any multiply-inherited-from modes using a standard
-;    `define-mode' construction instead of manually doing it, because
-;    we don't want each guy calling `kill-all-local-variables' and
-;    messing up the previous one.
-; -- we need to scan the buffer ourselves (not from font-lock, because
-;    the user might not have font-lock enabled) and highlight only
-;    those words that are *documented* functions and variables (and
-;    probably excluding words without dashes in them unless enclosed
-;    in quotes, so that common words like "list" and "point" don't
-;    become hyperlinks.
-; -- we should *not* use font-lock keywords like below.  Instead we
-;    should add the font-lock stuff ourselves during the scanning phase,
-;    if font-lock is enabled in this buffer.
+(define-key help-map "w" 'where-is)
+(define-key help-map "\C-w" 'describe-no-warranty)
 
-;(defun help-follow-reference (event extent user-data)
-;  (let ((symbol (intern-soft (extent-string extent))))
-;    (cond ((and symbol (fboundp symbol))
-;	   (describe-function symbol))
-;	  ((and symbol (boundp symbol))
-;	   (describe-variable symbol))
-;	  (t nil))))
-
-;(defvar help-font-lock-keywords
-;  (let ((name-char "[-+a-zA-Z0-9_*]") (sym-char "[-+a-zA-Z0-9_:*]"))
-;    (list
-;     ;;
-;     ;; The symbol itself.
-;     (list (concat "\\`\\(" name-char "+\\)\\(:\\)?")
-;	   '(1 (if (match-beginning 2)
-;		   'font-lock-function-name-face
-;		 'font-lock-variable-name-face)
-;	       nil t))
-;     ;;
-;     ;; Words inside `' which tend to be symbol names.
-;     (list (concat "`\\(" sym-char sym-char "+\\)'")
-;	   1 '(prog1
-;		  'font-lock-reference-face
-;		(add-list-mode-item (match-beginning 1)
-;			       (match-end 1)
-;			       nil
-;			       'help-follow-reference))
-;	   t)
-;     ;;
-;     ;; CLisp `:' keywords as references.
-;     (list (concat "\\<:" sym-char "+\\>") 0 'font-lock-reference-face t)))
-;  "Default expressions to highlight in Help mode.")
-
-;(put 'help-mode 'font-lock-defaults '(help-font-lock-keywords))
+;; #### It would be nice if the code below to add hyperlinks was
+;; generalized.  We would probably need a "hyperlink mode" from which
+;; help-mode is derived.  This means we probably need multiple
+;; inheritance of modes!  Thankfully this is not hard to implement; we
+;; already have the ability for a keymap to have multiple parents.
+;; However, we'd have to define any multiply-inherited-from modes using
+;; a standard `define-mode' construction instead of manually doing it,
+;; because we don't want each guy calling `kill-all-local-variables' and
+;; messing up the previous one.
 
 (define-derived-mode help-mode view-major-mode "Help"
   "Major mode for viewing help text.
@@ -819,41 +778,68 @@
 
 (make-help-screen help-for-help
   "A B C F I K L M N P S T V W C-c C-d C-f C-i C-k C-n C-w;  ? for more help:"
-  "Type a Help option:
+  (concat
+   "Type a Help option:
 \(Use SPC or DEL to scroll through this text.  Type \\<help-map>\\[help-quit] to exit the Help command.)
 
+Help on key bindings:
+
+\\[describe-bindings]	Table of all key bindings.
+\\[describe-key-briefly]	Type a key sequence or select a menu item;
+        it displays the corresponding command name.
+\\[describe-key]	Type a key sequence or select a menu item;
+        it displays the documentation for the command bound to that key.
+	(Terser but more up-to-date than what's in the manual.)
+\\[Info-goto-emacs-key-command-node]	Type a key sequence or select a menu item;
+	it jumps to the full documentation in the XEmacs User's Manual
+	for the corresponding command.
+\\[view-lossage]	Recent input keystrokes and minibuffer messages.
+\\[describe-mode]	Documentation of current major and minor modes.
+\\[describe-pointer]	Table of all mouse-button bindings.
+\\[where-is]	Type a command name; it displays which keystrokes invoke that command.
+
+Help on functions and variables:
+
 \\[hyper-apropos]	Type a substring; it shows a hypertext list of
         functions and variables that contain that substring.
-	See also the `apropos' command.
-\\[command-apropos]	Type a substring; it shows a list of commands
-        (interactively callable functions) that contain that substring.
-\\[describe-bindings]	Table of all key bindings.
-\\[describe-key-briefly]	Type a command key sequence;
-        it displays the function name that sequence runs.
+\\[command-apropos]	Older version of apropos; superseded by previous command.
+\\[apropos-documentation]	Type a substring; it shows a hypertext list of
+        functions and variables containing that substring anywhere
+        in their documentation.
+\\[Info-goto-emacs-command-node]	Type a command name; it jumps to the full documentation
+	in the XEmacs User's Manual.
+\\[describe-function]	Type a command or function name; it shows its documentation.
+	(Terser but more up-to-date than what's in the manual.)
+\\[Info-elisp-ref]	Type a function name; it jumps to the full documentation
+	in the XEmacs Lisp Reference Manual.
+\\[Info-search-index-in-xemacs-and-lispref]	Type a substring; it looks it up in the indices of both
+	the XEmacs User's Manual and the XEmacs Lisp Reference Manual.
+	It jumps to the first match (preferring an exact match); you
+	can use `\\<Info-mode-map>\\[Info-index-next]\\<help-map>' to successively visit other matches.
+\\[describe-variable]	Type a variable name; it displays its documentation and value.
+
+Miscellaneous:
+
+"
+   (if (string-match "beta" emacs-version)
+"\\[describe-beta]	Special considerations about running a beta version of XEmacs.
+"
+"")
+"
 \\[customize]	Customize Emacs options.
-\\[Info-goto-emacs-command-node]	Type a function name; it displays the Info node for that command.
-\\[describe-function]	Type a function name; it shows its documentation.
-\\[Info-elisp-ref]	Type a function name; it jumps to the full documentation
-	in the XEmacs Lisp Programmer's Manual.
+\\[describe-distribution]	How to obtain XEmacs.
+\\[describe-last-error]	Information about the most recent error.
 \\[xemacs-local-faq]	Local copy of the XEmacs FAQ.
 \\[info]	Info documentation reader.
 \\[Info-query]	Type an Info file name; it displays it in Info reader.
-\\[describe-key]	Type a command key sequence;
-        it displays the documentation for the command bound to that key.
-\\[Info-goto-emacs-key-command-node]	Type a command key sequence;
-        it displays the Info node for the command bound to that key.
-\\[view-lossage]	Recent input keystrokes and minibuffer messages.
-\\[describe-mode]	Documentation of current major and minor modes.
+\\[describe-copying]	XEmacs copying permission (General Public License).
 \\[view-emacs-news]	News of recent XEmacs changes.
 \\[finder-by-keyword]	Type a topic keyword; it finds matching packages.
-\\[describe-pointer]	Table of all mouse-button bindings.
 \\[describe-syntax]	Contents of syntax table with explanations.
+\\[view-sample-init-el]	View the sample init.el that comes with XEmacs.
 \\[help-with-tutorial]	XEmacs learn-by-doing tutorial.
-\\[describe-variable]	Type a variable name; it displays its documentation and value.
-\\[where-is]	Type a command name; it displays which keystrokes invoke that command.
-\\[describe-distribution]	XEmacs ordering information.
-\\[describe-no-warranty]	Information on absence of warranty for XEmacs.
-\\[describe-copying]	XEmacs copying permission (General Public License)."
+\\[describe-no-warranty]	Information on absence of warranty for XEmacs."
+)
   help-map)
 
 (defmacro with-syntax-table (syntab &rest body)
@@ -1222,12 +1208,13 @@
       (setq def (symbol-function def)))
     (if (and (fboundp 'compiled-function-annotation)
 	     (compiled-function-p def))
-	(setq file-name (compiled-function-annotation def)))
+	(setq file-name (declare-fboundp (compiled-function-annotation def))))
     (if (eq 'macro (car-safe def))
 	(setq fndef (cdr def)
 	      file-name (and (compiled-function-p (cdr def))
 			     (fboundp 'compiled-function-annotation)
-			     (compiled-function-annotation (cdr def)))
+			     (declare-fboundp
+			      (compiled-function-annotation (cdr def))))
 	      macrop t)
       (setq fndef def))
     (if aliases (princ aliases))
@@ -1413,7 +1400,7 @@
        (let ((print-escape-newlines t))
 	 (princ "`")
 	 ;; (Help-princ-face (symbol-name variable)
-	 ;;		  'font-lock-variable-name-face) overkill
+	 ;;               'font-lock-variable-name-face) overkill
 	 (princ (symbol-name variable))
 	 (princ "' is ")
 	 (while (variable-alias variable)