Mercurial > hg > xemacs-beta
comparison lisp/info.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 | e7ef97881643 |
children | 0f4bdbb07414 |
comparison
equal
deleted
inserted
replaced
501:0a255b32b157 | 502:7039e6323819 |
---|---|
4 ;; Copyright (C) 1985, 1986, 1993, 1997 Free Software Foundation, Inc. | 4 ;; Copyright (C) 1985, 1986, 1993, 1997 Free Software Foundation, Inc. |
5 | 5 |
6 ;; Author: Dave Gillespie <daveg@synaptics.com> | 6 ;; Author: Dave Gillespie <daveg@synaptics.com> |
7 ;; Richard Stallman <rms@gnu.ai.mit.edu> | 7 ;; Richard Stallman <rms@gnu.ai.mit.edu> |
8 ;; Maintainer: Dave Gillespie <daveg@synaptics.com> | 8 ;; Maintainer: Dave Gillespie <daveg@synaptics.com> |
9 ;; Version: 1.07 of 7/22/93 | 9 ;; Version: diverged at version 1.07 of 7/22/93 |
10 ;; Keywords: docs, help | 10 ;; Keywords: docs, help |
11 | 11 |
12 ;; This file is part of XEmacs. | 12 ;; This file is part of XEmacs. |
13 | 13 |
14 ;; XEmacs is free software; you can redistribute it and/or modify it | 14 ;; XEmacs is free software; you can redistribute it and/or modify it |
24 ;; You should have received a copy of the GNU General Public License | 24 ;; You should have received a copy of the GNU General Public License |
25 ;; along with XEmacs; see the file COPYING. If not, write to the | 25 ;; along with XEmacs; see the file COPYING. If not, write to the |
26 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 26 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
27 ;; Boston, MA 02111-1307, USA. | 27 ;; Boston, MA 02111-1307, USA. |
28 | 28 |
29 ;;; Synched up with: Not synched with FSF. | 29 ;;; Synched up with: Not synched with FSF. Highly divergent, and with |
30 ;;; many new features added for XEmacs. | |
30 | 31 |
31 ;; Commentary: | 32 ;; Commentary: |
32 | 33 |
33 ;; This is based on an early Emacs 19 info.el file. | 34 ;; This is based on an early Emacs 19 info.el file. |
34 ;; | 35 ;; |
35 ;; Note that Info-directory has been replaced by Info-directory-list, | 36 ;; Note that Info-directory has been replaced by Info-directory-list, |
36 ;; a search path of directories in which to find Info files. | 37 ;; a search path of directories in which to find Info files. |
37 ;; Also, Info tries adding ".info" to a file name if the name itself | 38 ;; Also, Info tries adding ".info" to a file name if the name itself |
38 ;; is not found. | 39 ;; is not found. |
39 ;; | 40 ;; |
40 ;; See the change log below for further details. | 41 ;; See the partial change log below for further details, and look into |
42 ;; ChangeLog for the rest. | |
41 | 43 |
42 | 44 |
43 ;; LCD Archive Entry: | 45 ;; LCD Archive Entry: |
44 ;; info-dg|Dave Gillespie|daveg@synaptics.com | 46 ;; info-dg|Dave Gillespie|daveg@synaptics.com |
45 ;; |Info reader with many enhancements; replaces standard info.el. | 47 ;; |Info reader with many enhancements; replaces standard info.el. |
1793 (widen) | 1795 (widen) |
1794 (goto-char found) | 1796 (goto-char found) |
1795 (Info-select-node) | 1797 (Info-select-node) |
1796 (or (and (equal onode Info-current-node) | 1798 (or (and (equal onode Info-current-node) |
1797 (equal ofile Info-current-file)) | 1799 (equal ofile Info-current-file)) |
1798 (Info-history-add ofile onode opoint))))) | 1800 (Info-history-add ofile onode opoint)))) |
1801 (message "Found \"%s\" in %s. Press `z' to continue search." | |
1802 regexp Info-current-node) | |
1803 ) | |
1804 | |
1805 (defun Info-search-next () | |
1806 "Repeat search starting from point with last regexp used in `Info-search'." | |
1807 (interactive) | |
1808 (Info-search Info-last-search)) | |
1809 | |
1799 | 1810 |
1800 ;; Extract the value of the node-pointer named NAME. | 1811 ;; Extract the value of the node-pointer named NAME. |
1801 ;; If there is none, use ERRORNAME in the error message; | 1812 ;; If there is none, use ERRORNAME in the error message; |
1802 ;; if ERRORNAME is nil, just return nil. | 1813 ;; if ERRORNAME is nil, just return nil. |
1803 (defun Info-extract-pointer (name &optional errorname) | 1814 (defun Info-extract-pointer (name &optional errorname) |
2253 "mouse button" | 2264 "mouse button" |
2254 (key-description (event-key last-command-event)))) | 2265 (key-description (event-key last-command-event)))) |
2255 (Info-page-prev) | 2266 (Info-page-prev) |
2256 (setq this-command 'Info)) | 2267 (setq this-command 'Info)) |
2257 (scroll-down arg))) | 2268 (scroll-down arg))) |
2269 | |
2258 | 2270 |
2259 (defun Info-index (topic) | 2271 (defun Info-find-index-alternatives (topic) |
2260 "Look up a string in the index for this file. | |
2261 The index is defined as the first node in the top-level menu whose | |
2262 name contains the word \"Index\", plus any immediately following | |
2263 nodes whose names also contain the word \"Index\". | |
2264 If there are no exact matches to the specified topic, this chooses | |
2265 the first match which is a case-insensitive substring of a topic. | |
2266 Use the `,' command to see the other matches. | |
2267 Give a blank topic name to go to the Index node itself." | |
2268 (interactive "sIndex topic: ") | |
2269 (let ((pattern (format "\n\\* \\([^\n:]*%s[^\n:]*\\):[ \t]*%s" | 2272 (let ((pattern (format "\n\\* \\([^\n:]*%s[^\n:]*\\):[ \t]*%s" |
2270 (regexp-quote topic) | 2273 (regexp-quote topic) |
2271 "\\(.*\\)\\.[ t]*\\([0-9]*\\)$")) | 2274 "\\(.*\\)\\.[ t]*\\([0-9]*\\)$")) |
2272 node) | 2275 node) |
2273 (message "Searching index for `%s'..." topic) | 2276 (message "Searching index for `%s'..." topic) |
2281 (let ((Info-keeping-history nil) | 2284 (let ((Info-keeping-history nil) |
2282 (Info-fontify (and Info-fontify (equal topic "")))) | 2285 (Info-fontify (and Info-fontify (equal topic "")))) |
2283 (Info-goto-node (Info-extract-menu-node-name))) | 2286 (Info-goto-node (Info-extract-menu-node-name))) |
2284 (or (equal topic "") | 2287 (or (equal topic "") |
2285 (let ((matches nil) | 2288 (let ((matches nil) |
2286 (exact nil) | 2289 (Info-keeping-history nil)) |
2287 (Info-keeping-history nil) | |
2288 found) | |
2289 (while | 2290 (while |
2290 (progn | 2291 (progn |
2291 (goto-char (point-min)) | 2292 (goto-char (point-min)) |
2292 (while (re-search-forward pattern nil t) | 2293 (while (re-search-forward pattern nil t) |
2293 (setq matches | 2294 (setq matches |
2303 matches))) | 2304 matches))) |
2304 (and (setq node (Info-extract-pointer "next" t)) | 2305 (and (setq node (Info-extract-pointer "next" t)) |
2305 (string-match "\\<Index\\>" node))) | 2306 (string-match "\\<Index\\>" node))) |
2306 (let ((Info-fontify nil)) | 2307 (let ((Info-fontify nil)) |
2307 (Info-goto-node node))) | 2308 (Info-goto-node node))) |
2308 (or matches | 2309 (nreverse matches))))) |
2309 (progn | 2310 |
2310 (Info-last) | 2311 (defun Info-index (topic &optional starting-nodes) |
2311 (error "No \"%s\" in index" topic))) | 2312 "Look up a string in the index for this file. |
2312 ;; Here it is a feature that assoc is case-sensitive. | 2313 The index is defined as the first node in the top-level menu whose |
2313 (while (setq found (assoc topic matches)) | 2314 name contains the word \"Index\", plus any immediately following |
2314 (setq exact (cons found exact) | 2315 nodes whose names also contain the word \"Index\". |
2315 matches (delq found matches))) | 2316 If there are no exact matches to the specified topic, this chooses |
2316 (setq Info-index-alternatives (nconc exact (nreverse matches)) | 2317 the first match which is a case-insensitive substring of a topic. |
2317 Info-index-first-alternative (car Info-index-alternatives)) | 2318 Use the `,' command to see the other matches. |
2318 (Info-index-next 0))))) | 2319 Give a blank topic name to go to the Index node itself. |
2320 | |
2321 If STARTING-NODES is given, it should be a list of nodes specifying | |
2322 files in which the indices will be searched. The results will be | |
2323 combined together." | |
2324 (interactive "sIndex topic: ") | |
2325 (let ((matches (if starting-nodes | |
2326 (mapcan #'(lambda (node) | |
2327 (Info-goto-node node) | |
2328 (Info-find-index-alternatives topic)) | |
2329 starting-nodes) | |
2330 (Info-find-index-alternatives topic))) | |
2331 exact found) | |
2332 (or matches | |
2333 (progn | |
2334 (if (or (not starting-nodes) (< (length starting-nodes) 2)) | |
2335 (Info-last)) | |
2336 (error "No \"%s\" in index" topic))) | |
2337 ;; Here it is a feature that assoc is case-sensitive. | |
2338 (while (setq found (assoc topic matches)) | |
2339 (setq exact (cons found exact) | |
2340 matches (delq found matches))) | |
2341 (setq Info-index-alternatives (nconc exact matches) | |
2342 Info-index-first-alternative (car Info-index-alternatives)) | |
2343 (Info-index-next 0))) | |
2319 | 2344 |
2320 (defun Info-index-next (num) | 2345 (defun Info-index-next (num) |
2321 "Go to the next matching index item from the last `i' command." | 2346 "Go to the next matching index item from the last `i' command." |
2322 (interactive "p") | 2347 (interactive "p") |
2323 (or Info-index-alternatives | 2348 (or Info-index-alternatives |
2439 (condition-case nil | 2464 (condition-case nil |
2440 (Info-find-node "lispref" "Top") | 2465 (Info-find-node "lispref" "Top") |
2441 (error (Info-find-node "elisp" "Top"))) | 2466 (error (Info-find-node "elisp" "Top"))) |
2442 (Info-index (symbol-name func))) | 2467 (Info-index (symbol-name func))) |
2443 (pop-to-buffer "*info*")) | 2468 (pop-to-buffer "*info*")) |
2469 | |
2470 (defun Info-read-search-text-regexp () | |
2471 (read-from-minibuffer | |
2472 (if (and (boundp 'Info-last-search) Info-last-search) | |
2473 (format "Search (regexp, default %s): " | |
2474 Info-last-search) | |
2475 "Search (regexp): ") | |
2476 nil nil nil nil nil (and (boundp 'Info-last-search) Info-last-search))) | |
2477 | |
2478 ;;;###autoload | |
2479 (defun Info-search-text-in-lispref (regexp) | |
2480 "Search for REGEXP in Lispref text and select node it's found in." | |
2481 (interactive (list (Info-read-search-text-regexp))) | |
2482 (Info-goto-node "(Lispref)") | |
2483 (Info-search regexp)) | |
2484 | |
2485 ;;;###autoload | |
2486 (defun Info-search-text-in-xemacs (regexp) | |
2487 "Search for REGEXP in User's Manual text and select node it's found in." | |
2488 (interactive (list (Info-read-search-text-regexp))) | |
2489 (Info-goto-node "(XEmacs)") | |
2490 (Info-search regexp)) | |
2491 | |
2492 ;;;###autoload | |
2493 (defun Info-search-index-in-lispref (regexp) | |
2494 "Search for REGEXP in Lispref index and select node it's found in." | |
2495 (interactive "sIndex topic: ") | |
2496 (Info-goto-node "(Lispref)") | |
2497 (Info-index regexp)) | |
2498 | |
2499 ;;;###autoload | |
2500 (defun Info-search-index-in-xemacs-and-lispref (regexp) | |
2501 "Search for REGEXP in both User's Manual and Lispref indices. | |
2502 Select node it's found in." | |
2503 (interactive "sIndex topic: ") | |
2504 (Info-index regexp '("(XEmacs)" "(Lispref)"))) | |
2505 | |
2444 | 2506 |
2445 (defun Info-reannotate-node () | 2507 (defun Info-reannotate-node () |
2446 (let ((bufs (delq nil (mapcar 'get-file-buffer Info-annotations-path)))) | 2508 (let ((bufs (delq nil (mapcar 'get-file-buffer Info-annotations-path)))) |
2447 (if bufs | 2509 (if bufs |
2448 (let ((ibuf (current-buffer)) | 2510 (let ((ibuf (current-buffer)) |
2850 (define-key Info-mode-map "s" 'Info-search) | 2912 (define-key Info-mode-map "s" 'Info-search) |
2851 (define-key Info-mode-map "t" 'Info-top) | 2913 (define-key Info-mode-map "t" 'Info-top) |
2852 (define-key Info-mode-map "u" 'Info-up) | 2914 (define-key Info-mode-map "u" 'Info-up) |
2853 (define-key Info-mode-map "v" 'Info-visit-file) | 2915 (define-key Info-mode-map "v" 'Info-visit-file) |
2854 (define-key Info-mode-map "x" 'Info-bookmark) | 2916 (define-key Info-mode-map "x" 'Info-bookmark) |
2917 (define-key Info-mode-map "z" 'Info-search-next) | |
2855 (define-key Info-mode-map "<" 'Info-top) | 2918 (define-key Info-mode-map "<" 'Info-top) |
2856 (define-key Info-mode-map ">" 'Info-end) | 2919 (define-key Info-mode-map ">" 'Info-end) |
2857 (define-key Info-mode-map "[" 'Info-global-prev) | 2920 (define-key Info-mode-map "[" 'Info-global-prev) |
2858 (define-key Info-mode-map "]" 'Info-global-next) | 2921 (define-key Info-mode-map "]" 'Info-global-next) |
2859 (define-key Info-mode-map "{" 'Info-page-prev) | 2922 (define-key Info-mode-map "{" 'Info-page-prev) |