annotate lisp/behavior-defs.el @ 1314:15a91d7ae2d1

[xemacs-hg @ 2003-02-20 08:16:21 by ben] check in makefile fixes et al Makefile.in.in: Major surgery. Move all stuff related to building anything in the src/ directory into src/. Simplify the dependencies -- everything in src/ is dependent on the single entry `src' in MAKE_SUBDIRS. Remove weirdo targets like `all-elc[s]', dump-elc[s], etc. mule/mule-msw-init.el: Removed. Delete this file. mule/mule-win32-init.el: New file, with stuff from mule-msw-init.el -- not just for MS Windows native, boys and girls! bytecomp.el: Change code inserted to catch trying to load a Mule-only .elc file in a non-Mule XEmacs. Formerly you got the rather cryptic "The required feature `mule' cannot be provided". Now you get "Loading this file requires Mule support". finder.el: Remove dependency on which directory this function is invoked from. update-elc.el: Don't mess around with ../src/BYTECOMPILE_CHANGE. Now that Makefile.in.in and xemacs.mak are in sync, both of them use NEEDTODUMP and the other one isn't used. dumped-lisp.el: Rewrite in terms of `list' and `nconc' instead of assemble-list, so we can have arbitrary forms, not just `when-feature'. very-early-lisp.el: Nuke this file. finder-inf.el, packages.el, update-elc.el, update-elc-2.el, loadup.el, make-docfile.el: Eliminate references to very-early-lisp. msw-glyphs.el: Comment clarification. xemacs.mak: Add macros DO_TEMACS, DO_XEMACS, and a few others; this macro section is now completely in sync with src/Makefile.in.in. Copy check-features, load-shadows, and rebuilding finder-inf.el from src/Makefile.in.in. The main build/dump/recompile process is now synchronized with src/Makefile.in.in. Change `WARNING' to `NOTE' and `error checking' to `error-checking' TO avoid tripping faux warnings and errors in the VC++ IDE. Makefile.in.in: Major surgery. Move all stuff related to building anything in the src/ directory from top-level Makefile.in.in to here. Simplify the dependencies. Rearrange into logical subsections. Synchronize the main compile/dump/build-elcs section with xemacs.mak, which is already clean and in good working order. Remove weirdo targets like `all-elc[s]', dump-elc[s], etc. Add additional levels of macros \(e.g. DO_TEMACS, DO_XEMACS, TEMACS_BATCH, XEMACS_BATCH, XEMACS_BATCH_PACKAGES) to factor out duplicated stuff. Clean up handling of "HEAP_IN_DATA" (Cygwin) so it doesn't need to ignore the return value from dumping. Add .NO_PARALLEL since various aspects of building and dumping must be serialized but do not always have dependencies between them (this is impossible in some cases). Everything related to src/ now gets built in one pass in this directory by just running `make' (except the Makefiles themselves and config.h, paths.h, Emacs.ad.h, and other generated .h files). console.c: Update list of possibly valid console types. emacs.c: Rationalize the specifying and handling of the type of the first frame. This was originally prompted by a workspace in which I got GTK to compile under C++ and in the process fixed it so it could coexist with X in the same build -- hence, a combined TTY/X/MS-Windows/GTK build is now possible under Cygwin. (However, you can't simultaneously *display* more than one kind of device connection -- but getting that to work is not that difficult. Perhaps a project for a bored grad student. I (ben) would do it but don't see the use.) To make sense of this, I added new switches that can be used to specifically indicate the window system: -x [aka --use-x], -tty \[aka --use-tty], -msw [aka --use-ms-windows], -gtk [aka --use-gtk], and -gnome [aka --use-gnome, same as --use-gtk]. -nw continues as an alias for -tty. When none have been given, XEmacs checks for other parameters implying particular device types (-t -> tty, -display -> x [or should it have same treatment as DISPLAY below?]), and has ad-hoc logic afterwards: if env var DISPLAY is set, use x (or gtk? perhaps should check whether gnome is running), else MS Windows if it exsits, else TTY if it exists, else stream, and you must be running in batch mode. This also fixes an existing bug whereby compiling with no x, no mswin, no tty, when running non- interactively (e.g. to dump) I get "sorry, must have TTY support". emacs.c: Turn on Vstack_trace_on_error so that errors are debuggable even when occurring extremely early in reinitialization. emacs.c: Try to make sure that the user can see message output under Windows (i.e. it doesn't just disappear right away) regardless of when it occurs, e.g. in the middle of creating the first frame. emacs.c: Define new function `emacs-run-status', indicating whether XEmacs is noninteractive or interactive, whether raw, post-dump/pdump-load or run-temacs, whether we are dumping, whether pdump is in effect. event-stream.c: It's "mommas are fat", not "momas are fat". Fix other typo. event-stream.c: Conditionalize in_menu_callback check on HAVE_MENUBARS, because it won't exist on w/o menubar support, lisp.h: More hackery on RETURN_NOT_REACHED. Cygwin v3.2 DOES complain here if RETURN_NOT_REACHED() is blank, as it is for GCC 2.5+. So make it blank only for GCC 2.5 through 2.999999999999999. Declare Vstack_trace_on_error. profile.c: Need to include "profile.h" to fix warnings. sheap.c: Don't fatal() when need to rerun Make, just stderr_out() and exit(0). That way we can distinguish between a dumping failing expectedly (due to lack of stack space, triggering another dump) and unexpectedly, in which case, we want to stop building. (or go on, if -K is given) syntax.c, syntax.h: Use ints where they belong, and enum syntaxcode's where they belong, and fix warnings thereby. syntax.h: Fix crash caused by an edge condition in the syntax-cache macros. text.h: Spacing fixes. xmotif.h: New file, to get around shadowing warnings. EmacsManager.c, event-Xt.c, glyphs-x.c, gui-x.c, input-method-motif.c, xmmanagerp.h, xmprimitivep.h: Include xmotif.h. alloc.c: Conditionalize in_malloc on ERROR_CHECK_MALLOC. config.h.in, file-coding.h, fileio.c, getloadavg.c, select-x.c, signal.c, sysdep.c, sysfile.h, systime.h, text.c, unicode.c: Eliminate HAVE_WIN32_CODING_SYSTEMS, use WIN32_ANY instead. Replace defined (WIN32_NATIVE) || defined (CYGWIN) with WIN32_ANY. lisp.h: More futile attempts to walk and chew gum at the same time when dealing with subr's that don't return.
author ben
date Thu, 20 Feb 2003 08:16:21 +0000
parents 79940b592197
children 5d1743698fb3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
502
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
1 ;;; behavior-defs.el --- definitions of specific behaviors
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
2
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 558
diff changeset
3 ;; Copyright (C) 2000, 2001, 2002 Ben Wing.
502
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
4
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
5 ;; Author: Ben Wing
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
6 ;; Maintainer: XEmacs Development Team
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
7 ;; Keywords: internal, dumped
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
8
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
9 ;; This file is part of XEmacs.
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
10
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
11 ;; XEmacs is free software; you can redistribute it and/or modify it
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
12 ;; under the terms of the GNU General Public License as published by
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
13 ;; the Free Software Foundation; either version 2, or (at your option)
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
14 ;; any later version.
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
15
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
16 ;; XEmacs is distributed in the hope that it will be useful, but
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
19 ;; General Public License for more details.
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
20
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
21 ;; You should have received a copy of the GNU General Public License
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
22 ;; along with XEmacs; see the file COPYING. If not, write to the
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
23 ;; Free Software Foundation, 59 Temple Place - Suite 330,
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
24 ;; Boston, MA 02111-1307, USA.
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
25
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
26 ;;; Synched up with: Not in FSF.
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
27
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
28 ;;; Authorship:
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
29
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
30 ;; Created July 2000 by Ben Wing.
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
31
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
32 ;;; Commentary:
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
33
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
34 ;; This file will be dumped with XEmacs.
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
35
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
36 ;;; Code:
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
37
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
38 (require 'behavior)
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
39
558
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
40 (define-behavior 'scroll-in-place
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
41 "This package provides improved vertical scrolling commands for XEmacs.
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
42 These new commands offer the following features:
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
43
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
44 + When a scrolling command is executed, XEmacs tries to keep point as
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
45 close as possible to its original window position (window line and
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
46 column). This is what \"scroll in place\" means: point stays \"in place\"
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
47 within the window. (There are times when point must be moved from its
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
48 original window position in order to execute the scroll; see below.)
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
49
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
50 The variable `scroll-in-place', which is true by default, determines
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
51 whether or not the standard XEmacs scrolling commands (`scroll-down',
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
52 `scroll-up', `scroll-other-window-down', and `scroll-other-window') use
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
53 the \"in place\" features listed here. When `scroll-in-place' is `nil'
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
54 the standard XEmacs scrolling commands essentially just call the
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
55 original versions of themselves. (Note that even when `scroll-in-place'
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
56 is `nil' the new versions of `scroll-down' and `scroll-up' have slightly
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
57 different behavior when a minibuffer window is the selected window. See
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
58 below.)
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
59
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
60 It is possible to turn off (or turn on) \"in place\" scrolling for certain
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
61 buffers by making buffer-local bindings of the variable `scroll-in-
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
62 place' for those buffers. The variable `scroll-in-place' is not usually
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
63 buffer-local, but you can make it so if you desire.
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
64
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
65 + Because the improved scrolling commands keep point at its original
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
66 window position, these scrolling commands are \"reversible.\" The
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
67 `scroll-up' command undoes the effect of the immediately previous
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
68 `scroll-down' command (if any) and vice versa. In other words, if you
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
69 scroll up and then immediately scroll back down, the window config-
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
70 uration is restored to its exact original state. This allows you to
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
71 browse through a buffer more easily, as you can always get back to the
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
72 original configuration.
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
73
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
74 Note, however, that the improved scrolling commands are guaranteed to be
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
75 reversible only if there are no intervening non-scrolling commands.
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
76 Also, if you give a prefix argument to a scrolling command (in order to
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
77 specify the number of lines to scroll by), previous scrolling commands
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
78 may no longer be reversible. More specifically, if the new prefix
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
79 argument has a different magnitude than the previous scrolling distance,
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
80 then any previous scrolling commands are not reversible. The new prefix
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
81 argument takes precedence.
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
82
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
83 You might find it useful to think of the scrolling commands as forming
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
84 \"chains.\" A scrolling command either starts or continues a chain. By
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
85 issuing a non-scrolling command or by changing the number of lines to be
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
86 scrolled, you break the chain. (Note that simply changing the scrolling
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
87 direction won't break the chain; changing the absolute number of lines
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
88 to be scrolled is what breaks the chain.) Scrolling commands are
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
89 guaranteed to be reversible only within the current chain. Hopefully
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
90 that's clear enough.
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
91
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
92 + When a scrolling command is given a prefix argument (which specifies the
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
93 number of lines to scroll by), then that argument becomes the default
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
94 scrolling distance for all immediately subsequent scrolling commands.
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
95 This means that you can easily set the scrolling distance for a chain
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
96 of scrolling commands. Note that a new prefix argument or any non-
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
97 scrolling command breaks the chain (as described above), and any further
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
98 scrolling commands will use the usual defaults (or the prefix argument
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
99 you specify at that time, of course).
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
100
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
101 However, there are cases in which one doesn't want the current scrolling
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
102 command to use the default scrolling distance that was set by the
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
103 previous scrolling command. For example, suppose that you had special
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
104 commands that scrolled one line up and one line down. When you invoke
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
105 one of these commands, the \"in place\" scrolling routines set the default
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
106 scrolling distance to be just one line. Now suppose that you use one of
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
107 your special commands and then immediately invoke `scroll-up' (`C-v'),
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
108 expecting it to scroll by a near windowful of text. You would be
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
109 disappointed --- because the previous command set the default scrolling
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
110 distance to be just one line, `scroll-up' just scrolls by one line.
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
111
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
112 To solve this problem, \"scroll-in-place\" allows you to divide scrolling
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
113 commands into separate \"groups.\" Commands in a group can only form
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
114 chains with (and therefore, inherit defaults from) commands in the same
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
115 group. (Note that no command can be in more than one group.) If you
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
116 invoke a scrolling command that is not in the same group as that of the
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
117 immediately previous scrolling command, then the previous chain is
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
118 broken and you start a new chain --- with a new set of defaults.
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
119
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
120 So to solve the problem described above, you could put your one-line
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
121 scrolling commands in their own group. Once that is done, the standard
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
122 scrolling commands will not form chains with your one-line scrolling
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
123 commands, and therefore will not use the default scrolling distance set
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
124 by those commands. Problem solved!
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
125
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
126 By default, all \"in place\" scrolling commands are in a single group. If
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
127 you want to partition some commands into separate groups, you must do
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
128 that yourself *before* any \"in place\" commands are invoked. For more
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
129 information about grouping commands, see the documentation for the
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
130 variables `scroll-command-groups' and `scroll-default-command-group'.
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
131
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
132 + The improved scrolling commands will avoid displaying empty lines past
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
133 the end of the buffer when possible. In other words, just as you can't
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
134 see \"dead space\" before the beginning of the buffer text, the new
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
135 scrolling commands try to avoid displaying \"dead space\" past the end of
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
136 the buffer text. This behavior is somewhat configurable; see the
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
137 documentation for the variable `scroll-allow-blank-lines-past-eob'.
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
138
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
139 Dead space will be displayed if it is necessary in order to make a
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
140 previous scrolling action reversible, however.
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
141
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
142 + If the scrolling commands cannot keep point at its initial window
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
143 position (because a buffer boundary is on screen and the window can't be
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
144 scrolled as far as necessary to keep point at the right place), point is
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
145 allowed to temporarily stray from its initial window position. That is,
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
146 point moves the correct number of window lines, even if it means that it
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
147 has to stray from its desired window position. This straying is undone
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
148 when (and if) the scrolling action is reversed.
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
149
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
150 + If a scrolling command tries to move point past a buffer boundary, point
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
151 is instead moved to the boundary (the beginning or the end of the buffer
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
152 as appropriate) and an appropriate message is displayed. This motion is
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
153 reversible, of course.
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
154
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
155 However, if point was already at the buffer boundary when the scrolling
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
156 command was invoked, the command signals an appropriate error instead.
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
157
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
158 + When a minibuffer window is the selected window, the new versions of
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
159 `scroll-up' and `scroll-down' either scroll the window in the variable
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
160 `minibuffer-scroll-window' (which is usually the window of completions)
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
161 or the `next-window' if there is no `minibuffer-scroll-window'. This is
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
162 usually much more useful than scrolling the minibuffer itself. (Note
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
163 that this feature is available even when the variable `scroll-in-place'
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
164 is `nil'.)
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
165
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
166 + When a scrolling command is scrolling a window other than the selected
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
167 window, it will signal an appropriate buffer boundary error if the
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
168 window cannot be scrolled (because the appropriate buffer boundary is
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
169 already visible). This means that an error is signalled even in cases
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
170 that would be allowed (by \"straying\" point or by moving it to the buffer
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
171 boundary) if the window were selected.
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
172
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
173 (If an error were not signalled in these cases, then there would be many
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
174 cases in which the last scroll in a particular direction would appear to
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
175 do nothing because only the point position would change --- the
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
176 displayed text would stay the same! To avoid these cases the scrolling
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
177 commands signal boundary errors \"prematurely\" when the window to be
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
178 scrolled is not selected.)"
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
179 :short-doc "Keep cursor on same line when scrolling"
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
180 :require 'scroll-in-place
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
181 :enable #'turn-on-scroll-in-place
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
182 :disable #'turn-off-scroll-in-place)
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
183
502
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
184 (define-behavior 'mouse-avoidance
558
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
185 "For those who are annoyed by the mouse pointer obscuring text,
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
186 this mode moves the mouse pointer - either just a little out of
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
187 the way, or all the way to the corner of the frame.
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
188
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
189 Customize `mouse-avoidance-mode' to one of the symbols `banish',
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
190 `exile', `jump', `animate', `cat-and-mouse', `proteus', or `none'.
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
191
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
192 Effects of the different modes:
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
193 * banish: Move the mouse to the upper-right corner on any keypress.
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
194 * exile: Move the mouse to the corner only if the cursor gets too close,
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
195 and allow it to return once the cursor is out of the way.
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
196 * jump: If the cursor gets too close to the mouse, displace the mouse
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
197 a random distance & direction.
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
198 * animate: As `jump', but shows steps along the way for illusion of motion.
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
199 * cat-and-mouse: Same as `animate'.
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
200 * proteus: As `animate', but changes the shape of the mouse pointer too.
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
201
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
202 Whenever the mouse is moved, the frame is also raised.
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
203
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
204 \(see `mouse-avoidance-threshold' for definition of \"too close\",
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
205 and `mouse-avoidance-nudge-dist' and `mouse-avoidance-nudge-var' for
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
206 definition of \"random distance\".)"
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
207 :short-doc "Keep mouse away from cursor"
502
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
208 :enable #'(lambda ()
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
209 (mouse-avoidance-mode 'animate))
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
210 :disable #'(lambda ()
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
211 (mouse-avoidance-mode 'none)))
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
212
558
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
213 (define-behavior 'jka-compr
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
214 "This package implements low-level support for reading, writing,
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
215 and loading compressed files. It hooks into the low-level file
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
216 I/O functions (including write-region and insert-file-contents) so
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
217 that they automatically compress or uncompress a file if the file
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
218 appears to need it (based on the extension of the file name).
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
219 Packages like Rmail, VM, GNUS, and Info should be able to work
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
220 with compressed files without modification."
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
221 :short-doc "Transparently handle compressed files"
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
222 :enable #'jka-compr-install
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
223 :disable #'jka-compr-uninstall)
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
224
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
225 (define-behavior 'efs
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
226 "EFS is a system for transparent file-transfer between remote VMS, CMS,
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
227 MTS, MVS, Twenex, Explorer (the last two are Lisp machines), TOPS-20,
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
228 DOS (running the Distinct, Novell, FTP software, NCSA, Microsoft in both
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
229 unix and DOS mode, Super TCP, and Hellsoft FTP servers), Windows NT
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
230 \(running the Microsoft or Hummingbird ftp servers), Unix descriptive
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
231 listings (dl), KA9Q, OS/2 hosts using FTP. This means that you can edit,
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
232 copy and otherwise manipulate files on any machine you have access to
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
233 from within Emacs as if it were a local file. EFS works by introducing
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
234 an extended filename syntax, and overloading functions such as
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
235 `insert-file-contents' so that accessing a remote file causes
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
236 appropriate commands to be sent to an FTP process.
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
237
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
238 The syntax to use is like this:
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
239
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
240 \(for anonymous:) /ftp.xemacs.org:/pub/xemacs/
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
241 \(for non-anonymous:) /ben@gwyn.tux.org:/etc/mail/xemacs/aliases-xemacs
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
242
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
243 You can specify either a file or a directory (in the latter case,
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
244 Dired will be brought up). All operations in XEmacs on such files
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
245 should work exactly as on any other files, modulo the additional
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
246 slowness."
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
247 :short-doc "Transparent file access over FTP"
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
248 :require 'efs-auto
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
249 :enable #'ignore
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
250 ;; can't :disable
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
251 )
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
252
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
253
502
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
254 (define-behavior 'resize-minibuffer
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
255 "When this behavior is enabled, the minibuffer is dynamically resized to
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
256 contain the entire region of text put in it as you type.
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
257
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
258 The maximum height to which the minibuffer can grow is controlled by the
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
259 variable `resize-minibuffer-window-max-height'.
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
260
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
261 The variable `resize-minibuffer-window-exactly' determines whether the
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
262 minibuffer window should ever be shrunk to make it no larger than needed to
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
263 display its contents.
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
264
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
265 When using a window system, it is possible for a minibuffer to be the sole
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
266 window in a frame. Since that window is already its maximum size, the only
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
267 way to make more text visible at once is to increase the size of the frame.
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
268 The variable `resize-minibuffer-frame' controls whether this should be
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
269 done. The variables `resize-minibuffer-frame-max-height' and
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
270 `resize-minibuffer-frame-exactly' are analogous to their window
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
271 counterparts."
558
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
272 :short-doc "Resize minibuffer automatically"
502
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
273 :enable #'(lambda ()
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
274 (resize-minibuffer-mode 1))
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
275 :disable #'(lambda ()
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
276 (resize-minibuffer-mode -1)))
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
277
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
278 (define-behavior 'func-menu
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
279 "Suppose you have a file with a lot of functions in it. Well, this
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
280 package makes it easy to jump to any of those functions. The names of
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
281 the functions in the current buffer are automatically put into menubar
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
282 menu, you select one of the function-names and the point is moved to
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
283 that very function. The mark is pushed on the mark-ring, so you can
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
284 easily go back to where you were. Alternatively, you can use enter the
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
285 name of the desired function via the minibuffer which offers
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
286 completing read input. In addition, the name of the function before
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
287 point is optionally displayed in the modeline."
558
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
288 :short-doc "Add a menu of defined functions"
502
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
289 :require 'func-menu
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
290 :enable #'(lambda ()
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
291 (add-hook 'find-file-hooks 'fume-add-menubar-entry)
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
292 (mapc #'(lambda (buffer)
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
293 (with-current-buffer buffer
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
294 (setq fume-display-in-modeline-p t)
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
295 (fume-add-menubar-entry)))
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
296 (buffer-list)))
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
297 :disable #'(lambda ()
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
298 (remove-hook 'find-file-hooks 'fume-add-menubar-entry)
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
299 (fset 'widen (symbol-function 'fume-widen))
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
300 (fset 'narrow-to-region (symbol-function 'narrow-to-region))
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
301 (mapc #'(lambda (buffer)
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
302 (with-current-buffer buffer
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
303 (fume-remove-menubar-entry)
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
304 (setq fume-display-in-modeline-p nil)
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
305 (fume-remove-post-command-hook
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
306 'fume-tickle-modeline)
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
307 (fume-remove-post-command-hook
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
308 'fume-maybe-install-modeline-feature)
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
309 (fume-remove-post-command-hook
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
310 'fume-rescan-buffer-trigger)))
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
311 (buffer-list))))
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
312
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
313 (define-behavior 'mwheel
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
314 "This code enables the use of the infamous 'wheel' on the new
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
315 crop of mice. Under XFree86 and the XSuSE X Servers, the wheel
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
316 events are sent as button4/button5 events, which are automatically
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
317 set up to do scrolling in the expected way. The actual way that the
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
318 scrolling works can be controlled by `mwheel-scroll-amount' and
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
319 `mwheel-follow-mouse'."
558
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
320 :short-doc "Mouse wheel support for X Windows"
502
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
321 :enable 'mwheel-install)
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
322
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
323 (define-behavior 'recent-files
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
324 "Recent-files adds the menu \"Recent Files\" (or whatever name you
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
325 choose, see \"Customization:\" below) to Emacs's menubar. Its
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
326 entries are the files (and directories) that have recently been
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
327 opened by Emacs. You can open one of these files again by
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
328 selecting its entry in the \"Recent Files\" menu. The list of file
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
329 entries in this menu is preserved from one Emacs session to
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
330 another. You can prevent Emacs from saving this list by selecting
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
331 \"Don't save recent-files list on exit\" from the menu. If you have
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
332 disabled saving, you can re-enable it by selecting \"Save
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
333 recent-files list on exit\".
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
334
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
335 The menu has permanent and non-permanent entries. Permanent
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
336 entries are marked with an asterisk in front of the filename. The
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
337 non-permanent entries are hidden in a submenu.
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
338
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
339 Each time you open a file in Emacs, it is added as a non-permanent
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
340 entry to the menu. The value of `recent-files-number-of-entries'
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
341 determines how many non-permanent entries are held in the
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
342 menu. When the number of non-permanent entries reaches this value,
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
343 the least recently added non-permanent entry is removed from the
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
344 menu when another non-permanent entry is added. It is not removed
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
345 from the list, though; it may reappear when entries are deleted
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
346 from the list. The number of entries saved to disk is the value of
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
347 the variable `recent-files-number-of-saved-entries'.
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
348
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
349 Permanent entries are not removed from the menu. You can make a
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
350 file entry permanent by selecting \"Make <buffer> permanent\" (where
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
351 <buffer> is the name of the current buffer) when the current
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
352 buffer holds this file. \"Make <buffer> non-permanent\" makes the
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
353 file entry of the current buffer non-permanent.
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
354
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
355 The command \"Kill buffer <buffer> and delete entry\" is handy when
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
356 you have accidently opened a file but want to keep neither the
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
357 buffer nor the entry.
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
358
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
359 You can erase the list of non-permanent entries by selecting
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
360 \"Erase non-permanent entries\" from the menu.
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
361
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
362 Customization:
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
363
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
364 There are lots of variables to control the behaviour of
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
365 recent-files. You do not have to change any of them if you like it
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
366 as it comes out of the box. However, you may want to look at these
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
367 options to make it behave different.
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
368
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
369 `recent-files-number-of-entries'
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
370 Controls how many non-permanent entries are shown in the
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
371 recent-files list. The default is 15.
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
372
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
373 `recent-files-number-of-saved-entries'
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
374 Controls how many non-permanent entries are saved to disk when
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
375 Emacs exits or recent-files-save-the-list is called. The
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
376 default is 50.
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
377
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
378 `recent-files-save-file'
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
379 The name of the file where the recent-files list is saved
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
380 between Emacs session. You probably don't need to change this.
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
381 The default is \".recent-files.el\" in your home directory.
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
382
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
383 `recent-files-dont-include'
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
384 A list of regular expressions for files that should not be
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
385 included into the recent-files list. This list is empty by
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
386 default. For instance, a list to exclude all .newsrc
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
387 files, all auto-save-files, and all files in the /tmp
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
388 directory (but not the /tmp directory itself) would look
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
389 like this:
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
390 (setq recent-files-dont-include
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
391 '(\"/\\.newsrc\" \"~$\" \"^/tmp/.\"))
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
392 The default is empty.
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
393
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
394 `recent-files-use-full-names'
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
395 If the value of this variable is non-nil, the full pathnames of
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
396 the files are shown in the recent-files menu. Otherwise only
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
397 the filename part (or the last name component if it is a
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
398 directory) is shown in the menu. The default it t, i.e. show
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
399 full names.
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
400
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
401 `recent-files-filename-replacements'
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
402 This is a list of pairs of regular expressions and replacement
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
403 strings. If a filename matches one of the regular expressions,
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
404 the matching part is replaced by the replacement string for
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
405 display in the recent-files menu.
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
406 Example: My home directory is \"/users/mmc/nickel/\". I want to
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
407 replace it with \"~/\". I also want to replace the directory
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
408 \"/imports/teleservices/mmc/avc2/\", where I work a lot, with
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
409 \".../avc2/\". The list then looks like
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
410 (setq recent-files-filename-replacements
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
411 '((\"/users/mmc/nickel/\" . \"~/\")
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
412 (\"/imports/teleservices/mmc/avc2/\" . \".../avc2/\")))
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
413 Only the first match is replaced. So, if you have several
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
414 entries in this list that may match a filename simultaneously,
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
415 put the one you want to match (usually the most special) in
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
416 front of the others. The default is to replace the home
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
417 directory with \"~\".
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
418
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
419 `recent-files-sort-function'
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
420 Contains a function symbol to sort the display of filenames in
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
421 the recent-files menu. Supplied are two functions,
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
422 'recent-files-dont-sort and 'recent-files-sort-alphabetically.
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
423 The first, which is the default, preserves the order of \"most
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
424 recent on top\".
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
425
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
426 `recent-files-permanent-submenu'
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
427 If this variable is non-nil, the permanent entries are put into
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
428 a separate submenu of the recent-files menu. The default is
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
429 nil.
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
430
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
431 `recent-files-non-permanent-submenu'
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
432 If this variable is non-nil, the non-permanent entries are put
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
433 into a separate submenu of the recent-files menu. The default
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
434 is nil. (You can set both `recent-files-permanent-submenu' and
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
435 `recent-files-non-permanent-submenu' to t to have both lists in
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
436 separate submenus.)
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
437
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
438 `recent-files-commands-submenu'
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
439 If this variable is non-nil, the commands if recent-files are
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
440 placed in a submenu of the recent-files menu. The default is
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
441 nil.
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
442
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
443 `recent-files-commands-submenu-title'
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
444 If the commands are placed in a submenu, this string is used as
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
445 the title of the submenu. The default is \"Commands...\".
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
446
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
447 `recent-files-actions-on-top'
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
448 If this variable is non-nil, the \"action\" menu entries (\"Make
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
449 <buffer> permanent\" etc.) are put on top of the menu. Otherwise
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
450 they appear below the file entries or submenus. The default is
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
451 nil.
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
452
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
453 `recent-files-permanent-first'
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
454 If this variable is t, the permanent entries are put first in
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
455 the recent-files menu, i.e. above the non-permanent entries. If
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
456 the value is nil, non-permanent entries appear first. If the
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
457 value is neither t nor nil, the entries are sorted according to
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
458 recent-files-sort-function. The default is 'sort.
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
459
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
460 `recent-files-find-file-command'
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
461 This variable contains to commandto execute when a file entry
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
462 is selected from the menu. Usually this will be `find-file',
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
463 which is the default.
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
464
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
465 KNOWN BUG:
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
466 - recent-files overwrites the recent-files-save-file
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
467 unconditionally when Emacs exits. If you have two Emacs
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
468 processes running, the one exiting later will overwrite the
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
469 file without merging in the new entries from the other Emacs
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
470 process. This can be avoided by disabling the save on exit from
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
471 the menu."
558
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
472 :short-doc "`Recent Files' menu"
502
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
473 :enable 'recent-files-initialize)
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
474
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
475 (define-behavior 'filladapt
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
476 "These functions enhance the default behavior of Emacs' Auto Fill
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
477 mode and the commands `fill-paragraph', `lisp-fill-paragraph',
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
478 `fill-region-as-paragraph' and `fill-region'.
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
479
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
480 The chief improvement is that the beginning of a line to be
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
481 filled is examined and, based on information gathered, an
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
482 appropriate value for fill-prefix is constructed. Also the
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
483 boundaries of the current paragraph are located. This occurs
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
484 only if the fill prefix is not already non-nil.
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
485
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
486 The net result of this is that blurbs of text that are offset
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
487 from left margin by asterisks, dashes, and/or spaces, numbered
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
488 examples, included text from USENET news articles, etc. are
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
489 generally filled correctly with no fuss."
558
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 502
diff changeset
490 :short-doc "Adaptive (smart) filling"
502
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
491 :require 'filladapt
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
492 :enable #'(lambda ()
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
493 (setq-default filladapt-mode t)
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
494 (mapc #'(lambda (buffer)
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
495 (with-current-buffer buffer
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
496 (unless filladapt-mode
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
497 (filladapt-mode 1))))
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
498 (buffer-list)))
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
499 :disable #'(lambda ()
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
500 (setq-default filladapt-mode nil)
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
501 (mapc #'(lambda (buffer)
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
502 (with-current-buffer buffer
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
503 (when filladapt-mode
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
504 (filladapt-mode -1))))
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
505 (buffer-list))))