diff options
author | Miles Bader <miles@gnu.org> | 2007-10-11 16:24:58 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 2007-10-11 16:24:58 +0000 |
commit | c73bd236f75b742ad4642ec94798987ae6e3e1e8 (patch) | |
tree | ef5edc8db557fc1d25a17c379e4ae63a38b3ba5c | |
parent | ecb21060d5c1752d41d7a742be565c59b5fcb855 (diff) | |
parent | 58ade22bf16a9ec2ff0aee6c59d8db4d1703e94f (diff) | |
download | emacs-c73bd236f75b742ad4642ec94798987ae6e3e1e8.tar.gz |
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 866-879)
- Merge multi-tty branch
- Update from CVS
- Merge from emacs--rel--22
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-257
416 files changed, 80208 insertions, 99218 deletions
diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE index 22e3b653973..bdd02523ceb 100644 --- a/admin/FOR-RELEASE +++ b/admin/FOR-RELEASE @@ -5,22 +5,20 @@ Tasks needed before the next release. ** Check for widow and orphan lines in manuals; make sure all the pages really look ok in the manual as formatted. -** Regenerate the postscript files of the reference cards in etc. +** Regenerate the pdf versions of the reference cards in etc/refcards/. ** Ask maintainers of refcard translations to update them. -Requests to have been sent out on 2006-05-23 (Reiner Steib). +Emacs 22 translators: LANG Translator Status -cs Pavel JanÃk Can't work on it now. -de Sven Joachim Done -fr Eric Jacoboni Done -pl WÅ‚odek Bzyl Done -pt-br Rodrigo Real Done -ru Alex Ott Done -sk Miroslav VaÅ¡ko No response - -Reminders sent out on 2006-06-08. +cs Pavel JanÃk +de Sven Joachim +fr Eric Jacoboni +pl WÅ‚odek Bzyl +pt-br Rodrigo Real +ru Alex Ott +sk Miroslav VaÅ¡ko ** Remove temporary +++/--- lines in NEWS. @@ -47,20 +45,45 @@ GNU/Linux system. * BUGS -NB the definitive copy of this file for Emacs 22 is on the -EMACS_22_BASE branch. Any entries below are automatically copied from -that branch. Do not make manual changes to this file on the trunk. +** Document the changes introduced by multi-tty +http://lists.gnu.org/archive/html/emacs-devel/2007-08/msg01639.html +http://lists.gnu.org/archive/html/emacs-devel/2007-08/msg01602.html + +** Does deleting frames run Lisp code? If so, can we get rid of that? +It is a dangerous design. +http://lists.gnu.org/archive/html/emacs-devel/2007-09/msg01330.html + +** Why were the calls to x_fully_uncatch_errors commented out in eval.c? +http://lists.gnu.org/archive/html/emacs-devel/2007-09/msg01987.html + +** raman@users.sf.net, sep 7: Emacs 23.0.50: Segfaults in alloc.c (batch process) +http://lists.gnu.org/archive/html/emacs-devel/2007-09/msg00690.html + +** grep et al should use font-lock to do highlighting, so that they respect font-lock-mode. +"can't turn off font-lock" +http://lists.gnu.org/archive/html/emacs-devel/2007-08/msg00548.html + +** mah@everybody.org, Sep 18: erc causes emacs to hang with multi-tty +http://lists.gnu.org/archive/html/emacs-devel/2007-09/msg01765.html + +** jbw@macs.hw.ac.uk, Sep 18: before-string property has no effect if display property is empty +http://lists.gnu.org/archive/html/bug-gnu-emacs/2007-09/msg00094.html +http://lists.gnu.org/archive/html/emacs-devel/2007-09/msg01816.html + +** sdl.web@gmail.com, Sep 24: TLS infinite loop. +http://lists.gnu.org/archive/html/emacs-devel/2007-09/msg01720.html -** ams@gnu.org, 9 July: eshell and external commands -http://lists.gnu.org/archive/html/emacs-devel/2007-08/msg00385.html +** herring@lanl.gov: find-func: can no longer find adviced subrs +This ought to work. -** Check all non-file-scope static vars to make sure they -won't lose on USG or HPUX systems. +** \\{...} produces duplicate entries +http://lists.gnu.org/archive/html/emacs-devel/2007-05/msg00209.html -* FIXES FOR EMACS 22.3 +** menu indications of key bindings for remapped commands +http://lists.gnu.org/archive/html/emacs-devel/2007-05/msg01339.html -Here we list any small fixes that arrived too late for Emacs 22.2, but -that should be installed on the release branch after 22.2 is released. +** tromey@redhat.com: two View-mode "quit" bugs +http://lists.gnu.org/archive/html/emacs-devel/2007-07/msg00103.html * DOCUMENTATION @@ -68,8 +91,8 @@ that should be installed on the release branch after 22.2 is released. The first line of every tutorial must begin with text ending in a period (".", ASCII 0x2E) saying "Emacs Tutorial" in the respective -language. This should be followed by "See end for copying -conditions", likewise in the respective language. +language. This should be followed by "See end for copying conditions", +likewise in the respective language. After each file name, on the same line or the following line, come the names of the people who have checked it. diff --git a/admin/make-tarball.txt b/admin/make-tarball.txt index 2c6ccf95c40..9a202d62f85 100644 --- a/admin/make-tarball.txt +++ b/admin/make-tarball.txt @@ -10,7 +10,7 @@ For each step, check for possible errors. make sure that the later tagged version will bootstrap, should it be necessary to check it out. -3. Regenerate Emacs' AUTHORS file (M-x load-file RET +3. Regenerate Emacs' etc/AUTHORS file (M-x load-file RET lisp/emacs-lisp/authors.el RET, then M-x authors RET, then save the *Authors* buffer). This may require fixing syntactically incorrect ChangeLog entries beforehand. @@ -21,7 +21,7 @@ For each step, check for possible errors. 5. rm configure; make bootstrap -6. Commit configure, README, AUTHORS, lisp/finder-inf.el, +6. Commit configure, README, etc/AUTHORS, lisp/finder-inf.el, lisp/version.el, man/emacs.texi, lispref/elisp.texi, mac/Emacs.app/Contents/Resources/English.lproj/InfoPlist.strings, mac/src/Emacs.r, nt/emacs.rc. Copy lisp/loaddefs.el to diff --git a/admin/notes/changelogs b/admin/notes/changelogs new file mode 100644 index 00000000000..03fb353eb02 --- /dev/null +++ b/admin/notes/changelogs @@ -0,0 +1,5 @@ +http://lists.gnu.org/archive/html/emacs-devel/2007-09/msg00793.html + There is no need to make change log entries for files such as NEWS, + MAINTAINERS, and FOR-RELEASE. + +The same applies for regenerating files like configure. diff --git a/admin/notes/multi-tty b/admin/notes/multi-tty new file mode 100644 index 00000000000..5895f59bddc --- /dev/null +++ b/admin/notes/multi-tty @@ -0,0 +1,1362 @@ +-*- coding: utf-8; mode: text; -*- + +From README.multi-tty in the multi-tty branch. +Some of this information may be out of date. + + +THANKS +------ + +The following is a (sadly incomplete) list of people who have +contributed to the project by testing, submitting patches, bug +reports, and suggestions. Thanks! + +Bernard Adrian <bernadrian@free.fr> +ARISAWA Akihiro <ari@mbf.ocn.ne.jp> +Vincent Bernat <bernat@luffy.cx> +Han Boetes <han@mijncomputer.nl> +Francisco Borges <borges@let.rug.nl> +Damien Cassou <damien.cassou@laposte.net> +Robert J. Chassell <bob@rattlesnake.com> +Romain Francoise <romain@orebokech.com> +Ami Fischman <ami@fischman.org> +Noah Friedman <friedman@splode.com> +Friedrich Delgado Friedrichs <friedel@nomaden.org> +Samium Gromoff <_deepfire@mail.ru> +Mikhail Gusarov <dottedmag@dottedmag.net> +Eric Hanchrow <offby1@blarg.net> +IRIE Tetsuya <irie@t.email.ne.jp> +Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> +Bas Kok <nekkobassu@yahoo.com> +Jurej Kubelka <Juraj.Kubelka@email.cz> +David Lichteblau <david@lichteblau.com> +Richard Lewis <rtf@jabble.com> +mace <mace@kirjakaapeli.lib.hel.fi> +Suresh Madhu <madhu@cs.unm.edu> +Xavier Mallard <zedek@gnu-rox.org> +Istvan Marko <mi-mtty@kismala.com> +Ted Morse <morse@ciholas.com> +Gergely Nagy <algernon@debian.org> +Dan Nicolaescu <dann@ics.uci.edu> +Kalle Olavi Niemitalo <kon@iki.fi> +Mark Plaksin <happy@mcplaksin.org> +Frank Ruell <stoerte@dreamwarrior.net> +Tom Schutzer-Weissmann <trmsw@yahoo.co.uk> +Joakim Verona <joakim@verona.se> +Dan Waber <dwaber@logolalia.com> +and many others. + +Richard Stallman was kind enough to review an earlier version of my +patches. + + +STATUS +------ + +It still needs to be ported to Windows/Mac/DOS. Both multiple +tty device support and simultaneous X and tty frame support works +fine. Emacsclient has been extended to support opening new tty and X +frames. It has been changed to open new Emacs frames by default. + +Tested on GNU/Linux, Solaris 8, FreeBSD and OpenBSD. + +Known problems: + + * GTK support. If you compile your Emacs with the GTK + toolkit, some functionality of multi-tty may be lost. In + particular, you may get crashes while working on multiple X + displays at once. Previous releases of GTK had limitations + and bugs that prevented full-blown multi-display support in + Emacs. (GTK crashed when Emacs tries to disconnect from an + X server.) Things are much improved in the current GTK + version, but if you do experience crashes in libgtk, try + compiling Emacs with the Lucid toolkit instead. + + * The single-kboard mode. + + If your multi-tty Emacs session seems to be frozen, you + probably have a recursive editing session or a pending + minibuffer prompt (which is a kind of recursive editing) on + another display. To unfreeze your session, switch to that + display and complete the recursive edit, for example by + pressing C-] (`abort-recursive-edit'). + + I am sorry to say that currently there is no way to break + out of this "single-kboard mode" from a frozen display. If + you are unable to switch to the display that locks the + others (for example because it is on a remote computer), + then you can use emacsclient to break out of all recursive + editing sessions: + + emacsclient -e '(top-level)' + + Note that this (perhaps) unintuitive behaviour is by design. + Single-kboard mode is required because of an intrinsic Emacs + limitation that is very hard to eliminate. (This limitation + is related to the single-threaded nature of Emacs.) + + I plan to implement better user notification and support for + breaking out of single-kboard mode from locked displays. + + * Mac and DOS support is broken, doesn't even + compile. Multiple display support will probably not provide + new Emacs features on these systems, but the multi-tty + branch changed a few low-level interfaces, and the + system-dependent source files need to be adapted + accordingly. The changes are mostly trivial, so almost + anyone can help, if only by compiling the branch and + reporting the compiler errors. + + +TESTING +------- + +To test the multi-tty feature, start up the Emacs server with the +following commands: + + emacs + M-x server-start + +and then (from a shell prompt on another terminal) start emacsclient +with + emacsclient -t /optional/file/names... (for a tty frame) + emacsclient /optional/file/names... (for an X frame) + +(Make sure both emacs and emacsclient are multi-tty versions.) +You'll hopefully have two fully working, independent frames on +separate terminals. The new frame is closed automatically when you +finish editing the specified files (C-x #), but delete-frame (C-x 5 0) +also works. Of course, you can create frames on more than two tty +devices. + +Creating new frames on the same tty with C-x 5 2 (make-frame-command) +works, and behaves the same way as in previous Emacs versions. If you +exit emacs, all terminals should be restored to their previous states. + +TIPS & TRICKS +------------- + +I think the best way to use the new Emacs is to have it running inside +a disconnected GNU screen session, and always use emacsclient for +normal work. One advantage of this is that not a single keystroke of +your work will be lost if the display device that you are using +crashes, or the network connection times out, or whatever. (I had an +extremely unstable X server for some time while I was developing these +patches, and running Emacs this way has saved me a number of M-x +recover-session invocations.) + +I use the following two bash scripts to handle my Emacs sessions: + +-------------------------------------------------------connect-emacs-- +#!/bin/bash +# Usage: connect-emacs <name> <args>... +# +# Connects to the Emacs instance called NAME. Starts up the instance +# if it is not already running. The rest of the arguments are passed +# to emacsclient. + +name="$1" +shift + +if [ -z "$name" ]; then + echo "Usage: connect_emacs <name> <args>..." >&2 + exit 1 +fi +preload-emacs "$name" wait +/usr/bin/emacsclient.emacs-multi-tty -s "$name" "$@" +---------------------------------------------------------------------- + +-------------------------------------------------------preload-emacs-- +#!/bin/bash +# Usage: preload-emacs <name> [<waitp>] +# +# Preloads the Emacs instance called NAME in a detached screen +# session. Does nothing if the instance is already running. If WAITP +# is non-empty, the function waits until the server starts up and +# creates its socket; otherwise it returns immediately. + +name="$1" +waitp="$2" +screendir="/var/run/screen/S-$USER" +serverdir="/tmp/emacs$UID" +emacs=/usr/bin/emacs-multi-tty # Or wherever you installed your multi-tty Emacs + +if [ -z "$name" ]; then + echo "Usage: preload_emacs <name> [<waitp>]" >&2 + exit 1 +fi + +if [ ! -e "$screendir"/*."$name" ]; then + if [ -e "$serverdir/$name" ]; then + # Delete leftover socket (for the wait option) + rm "$serverdir/$name" + fi + screen -dmS "$name" "$emacs" -nw --eval "(setq server-name \"$name\")" -f server-start +fi +if [ ! -z "$waitp" ]; then + while [ ! -e "$serverdir/$name" ]; do sleep 0.1; done +fi +---------------------------------------------------------------------- + +I have the following in my profile to have two instances automatically +preloaded for editing and email: + + preload-emacs editor + preload-emacs gnus + +It is useful to set up short aliases for connect-emacs. I use the +following: + + alias edit="connect-emacs editor" + alias e=edit + alias et="connect-emacs editor -t" + alias gnus="connect-emacs gnus" + + +THINGS TO DO +------------ + +** See if `tty-defined-color-alist' needs to be terminal-local. + Update: Dan says it should be, so convert it. + +** Mikhail Gusarov suggest to add a hook akin to + `after-make-frame-functions' that is called whenever Emacs connects + to a new terminal. Good idea! + +** emacsclient -t on the console does not work after su. You have to + use non-root accounts or start as root to see this. + + Login: root + Password: + # su lorentey + $ emacsclient -t + *ERROR*: Could not open file: /dev/tty1 + + The tty can be opened as /dev/tty by emacsclient, but not by Emacs. + This seems to be a serious problem. Currently my only idea is to + bring back the ugly pty proxy hack from the initial versions of + multi-tty. Suggestions would be appreciated. + + Update: we could change emacsclient to pass its open file + descriptor to the Emacs process. Unfortunately, this requires a + new Lisp-level Emacs API, and as file descriptors are not otherwise + exported to Lisp, this approach seems at least as ugly as the pty + proxy idea. + +** lisp/vc.el depends on the terminal type during load time. + `vc-annotate-color-map' is one example that needs to be fixed. + +** Understand how `quit_throw_to_read_char' works, and fix any bugs + that come to light. + +** See if getcjmp can be eliminated somehow. Why does Emacs allow + asynchronous input processing while it's reading input anyway? + +** `delete-frame' events are handled by `special-event-map' + immediately when read by `read_char'. This is fine but it prevents + higher-level keymaps from binding that event to get notified of the + deleted frame. + + Sometimes it would be useful for Lisp code to be notified of frame + deletions after they have happened, usually because they want to + clean up after the deleted frame. Not all frame-local states can + be stored as a frame parameter. For example, + `display-splash-screen' uses `recursive-edit' with a special keymap + override to create its buffer---and it leads to all kinds of + nastiness if Emacs stays in this recursive edit mode after the + frame containing the splash screen is deleted. Basically, the + splash-screen implementation wants to throw out of the recursive + edit when the frame is deleted; however, it is not legal to throw + from `delete-frame-functions' because `delete-frame' must not fail. + (Introducing `delete-frame-after-functions' would not help either + because `delete-frame' may not fail at that time either.) + + Currently `fancy-splash-screens' installs a + `delete-frame-functions' hook that sets up a timer to exit the + recursive edit. This is an adequate solution, but it would perhaps + be better to have something like a `frame-deleted' event that could + be bound in the normal way. + +** Trouble: `setenv' doesn't actually set environment variables in the + Emacs process. This defeats the purpose of the elaborate + `server-with-environment' magic around the `tgetent' call in + `init_tty'. D'oh. + +** (Possibly) create hooks in struct device for creating frames on a + specific terminal, and eliminate the hackish terminal-related frame + parameters (display, tty, tty-type). + + make_terminal_frame + create_tty_output + +** Decide whether to keep the C implementation of terminal parameters, + or revert to the previous, purely Lisp code. It turned out that + local environments do not need terminal parameters after all. + +** Move Fsend_string_to_terminal to term.c, and declare get_named_tty + as static, removing it from dispextern.h. + Move fatal to emacs.c and declare it somewhere. + +** Search for `suspend-emacs' references and replace them with + `suspend-frame', if necessary. Ditto for `save-buffers-kill-emacs' + vs. `save-buffers-kill-display'. + +** Emacs crashes when a tty frame is resized so that there is no space + for all its windows. (Tom Schutzer-Weissmann) + +** Report GTK multi-display problems to GTK maintainers. For extra + credit, fix them. + + Currently you can not connect to new X displays when you compile + Emacs with GTK support. If you want to play around with GTK + multidisplay (and don't mind core dumps), you can edit src/config.h + and define HAVE_GTK_MULTIDISPLAY there by hand. + + http://bugzilla.gnome.org/show_bug.cgi?id=85715 + + Update: Han reports that GTK+ version 2.8.9 almost gets display + disconnects right. GTK will probably be fully fixed by the time + multi-tty gets into the trunk. + + Update: I am still having problems with GTK+ 2.8.10. I have the + impression that the various multidisplay fixes will only get + released in GTK+ 2.10. + +** Audit `face-valid-attribute-values' usage in customize and + elsewhere. Its return value depends on the current window system. + Replace static initializers using it with runtime functions. For + example, custom's buttons are broken on non-initial device types. + +** Possibly turn off the double C-g feature when there is an X frame. + C.f. (emacs)Emergency Escape. + +** frames-on-display-list should also accept frames. + +** Consider the `tty-type' frame parameter and the `display-tty-type' + function. They serve the exact same purpose. I think it may be + a good idea to eliminate one of them, preferably `tty-type'. + +** The handling of lisp/term/*.el, and frame creation in general, is a + big, big mess. How come the terminal-specific file is loaded by + tty-create-frame-with-faces? I don't think it is necessary to load + these files for each frame; once per terminal should be enough. + Update: lisp/term/*.el is not loaded repeatedly anymore, but + faces.el still needs to be cleaned up. + +** Fix frame-set-background-mode in this branch. It was recently + changed in CVS, and frame.el in multi-tty has not yet been adapted + for the changes. (It needs to look at + default-frame-background-mode.) (Update: maybe it is fixed now; + needs testing.) (Note that the byte compiler has this to say about + term/rxvt.el:) + + term/rxvt.el:309:17:Warning: assignment to free variable + `default-frame-background-mode' + +** I think `(set-)terminal-local-value' and the terminal parameter + mechanism should be integrated into a single framework. + + (Update: `(set-)terminal-local-value' is now eliminated, but the + terminal-local variables should still be accessible as terminal + parameters. This also applies to `display-name' and similar + functions.) + +** Add the following hooks: after-delete-frame-hook (for server.el, + instead of delete-frame-functions), + after-delete-terminal-functions, after-create-terminal-functions. + +** BULK RENAME: The `display-' prefix of new Lisp-level functions + conflicts with stuff like `display-time-mode'. Use `device-' + or `terminal-' instead. I think I prefer `terminal-'. + + It turns out that most of the offending Lisp functions were defined + in the trunk. Therefore, compatibility aliases should be defined + for the following names: + + display-color-cells terminal-color-cells + display-color-p terminal-color-p + display-graphic-p terminal-graphic-p + display-grayscale-p terminal-grayscale-p + display-images-p terminal-images-p + display-mm-height terminal-mm-height + display-mm-width terminal-mm-width + display-mouse-p terminal-mouse-p + display-multi-font-p terminal-multi-font-p + display-multi-frame-p terminal-multi-frame-p + display-pixel-height terminal-pixel-height + display-pixel-width terminal-pixel-width + display-pixels-per-inch terminal-pixels-per-inch + display-planes terminal-planes + display-popup-menus-p terminal-popup-menus-p + display-save-under terminal-save-under + display-screens terminal-screens + display-supports-face-attributes-p terminal-supports-face-attributes-p + display-visual-class terminal-visual-class + framep-on-display framep-on-terminal + frames-on-display-list frames-on-terminal-list + + The following functions were introduced in the multi-tty branch, and + were renamed without aliases: + + delete-display delete-terminal + display-controlling-tty-p controlling-tty-p + display-list terminal-list + display-live-p terminal-live-p + display-name terminal-name + display-tty-type tty-type + frame-display frame-terminal + selected-display selected-terminal + +** The single-keyboard mode of MULTI_KBOARD is extremely confusing + sometimes; Emacs does not respond to stimuli from other keyboards. + At least a beep or a message would be important, if the single-mode + is still required to prevent interference. (Reported by Dan + Nicolaescu.) + + Update: selecting a region with the mouse enables single_kboard + under X. This is very confusing. + + Update: After discussions with Richard Stallman, this will be + resolved by having locked displays warn the user to wait, and + introducing a complex protocol to remotely bail out of + single-kboard mode by pressing C-g. + + Update: Warning the user is not trivial to implement, as Emacs has + only one echo area, shared by all frames. Ideally the warning + should not be displayed on the display that is locking the others. + Perhaps the high probability of user confusion caused by + single_kboard mode deserves a special case in the display code. + Alternatively, it might be good enough to signal single_kboard mode + by changing the modelines or some other frame-local display element + on the locked out displays. + + Update: In fact struct kboard does have an echo_string slot. + +** The session management module is prone to crashes when the X + connection is closed and then later I try to connect to a new X + session: + + #0 0xb7ebc806 in SmcGetIceConnection () from /usr/X11R6/lib/libSM.so.6 + #1 0x080e6641 in x_session_check_input (bufp=0xbf86c9c0) at xsmfns.c:144 + #2 0x080d3bbc in XTread_socket (device=0xa722ff8, expected=1, hold_quit=0xbf86ca90) at xterm.c:7037 + #3 0x080fa404 in read_avail_input (expected=1) at keyboard.c:6696 + #4 0x080fa4ca in handle_async_input () at keyboard.c:6900 + #5 0x080d51fa in x_term_init (display_name=162628899, xrm_option=0x0, resource_name=0x857068c "emacs") at xterm.c:10622 + #6 0x080d920e in x_display_info_for_name (name=162628899) at xfns.c:3975 + #7 0x080d92f9 in check_x_display_info (object=1) at xfns.c:274 + #8 0x080d97b8 in Fx_create_frame (parms=151221485) at xfns.c:3016 + #9 0x0815bf72 in Ffuncall (nargs=2, args=0xbf86ceec) at eval.c:2851 + + I installed a workaround to prevent this. The X session manager is + only contacted when the very first display in the Emacs session is + an X display. Also, x_delete_display() on this display aborts + session management, and XTread_socket only calls + x_session_check_input when it is called for the display that the + session was opened on. While this does not really fix the bug, it + makes it much less frequent, because session manager support will + not normally be enabled when Emacs can survive the shutdown of the + X server. + + See if xsmfns.c should be updated. + +** Hunt down display-related functions in frame.el and extend them all + to accept display ids. + +** rif->flush_display_optional (NULL) calls should be replaced by a + new global function. + +** The set-locale-environment hack (adding the DISPLAY option) should + be replaced with a clean design. + +** standard-display-table should be display-local. + standard-display-european should be display-local. + +** With iswitchb-default-method set to 'always-frame, only frames on + the current display should be considered. This might involve + extending `get-buffer-window'. + +** Have a look at Vlocale_coding_system. Seems like it would be a + tedious job to localize it, although most references use it for + interfacing with libc and are therefore OK with the global + definition. + + Exceptions found so far: x-select-text and + x-cut-buffer-or-selection-value. + +** Have a look at fatal_error_hook. + +** Have a look at set_frame_matrix_frame. + +** Check if we got term-setup-hook right. + +** I think tip_frame should be display-local. + +** Check display reference count handling in x_create_tip_frame. + +** make-frame does not correctly handle extra parameters in its + argument: + + (frame-parameter (make-frame (list (cons 'foobar 42))) 'foobar) + => nil + + (This is likely an error in the CVS trunk.) + +** Dan Nicolaescu suggests that -nw should be added as an alias for -t + in emacsclient. Good idea. (Alas, implementing this is not + trivial, getopt_long does not seem to support two-letter ``short'' + options. Patches are welcome.) + +** Mark Plaksin suggests that emacsclient should accept the same + X-related command-line arguments as Emacs. Most of the X-related + argument-handling is done in Lisp, so this should be quite easy to + implement. (For example, Samium Gromoff wants emacsclient to + support --geometry; implementing this would add that support.) + +** Gergely Nagy suggests that C-x # should only kill the current + frame, not any other emacsclient frame that may have the same file + opened for editing. I think I agree with him. + +** Very strange bug: visible-bell does not work on secondary + terminals in xterm and konsole. The screen does flicker a bit, + but it's so quick it isn't noticable. + + (Update: This is probably some problem with padding or whatnot on + the secondary terminals.) + +** Move baud_rate to struct display. + +** Implement support for starting an interactive Emacs session without + an initial frame. (The user would connect to it and open frames + later, with emacsclient.) + +** Fix Mac support (I can't do this entirely myself). Note that the + current state of Mac-specific source files in the multi-tty tree + are not useful; before starting work on Mac support, revert to + pristine, pre-multi-tty versions. + +** Fix DOS support (I can't do this entirely myself). Note that the + current state of DOS-specific source files in the multi-tty tree + are not useful; before starting work on DOS support, revert to + pristine, pre-multi-tty versions. + +** Fix Windows support. Currently bootstraping works on w32, but Emacs + crashes on startup and none of the multi-tty features are + implemented. Many XXX comments mark things that probably need + updating, ChangeLogs will help in spotting changes to X specific + files that may need porting. + +** Do a grep on XXX and ?? for more issues. + +** flow-ctrl.el must be updated. + +** Fix stuff_char for multi-tty. Doesn't seem to be of high priority. + +DIARY OF CHANGES +---------------- + +(ex-TODO items with explanations.) + +-- Introduce a new struct for terminal devices. + + (Done, see struct tty_output. The list of members is not yet + complete.) + +-- Change the bootstrap procedure to initialize tty_list. + + (Done, but needs review.) + +-- Change make-terminal-frame to support specifying another tty. + + (Done, new frame parameters: `tty' and `tty-type'.) + +-- Implement support for reading from multiple terminals. + + (Done, read_avail_input tries to read from each terminal, until one + succeeds. MULTI_KBOARD is not used. Secondary terminals don't send + SIGIO!) + + (Update: They do, now.) + + (Update2: After enabling X, they don't.) + +-- other-frame should cycle through the frames on the `current' + terminal only. + + (Done, by trivially modifiying next_frame and prev_frame.) + +-- Support different terminal sizes. + + (Done, no problem.) + +-- Make sure terminal resizes are handled gracefully. (Could be + problematic.) + + (Done. We don't get automatic SIGWINCH for additional ttys, + though.) + +-- Extend emacsclient to automatically open a new tty when it connects + to Emacs. + + (Done. It's an ugly hack, needs more work.) + +-- Redisplay must refresh the topmost frame on *all* terminals, not + just the initial terminal. + + (Done, but introduced an ugly redisplay problems. Ugh.) + +-- Fix redisplay problems. + + (Done; it turned out that the entire Wcm structure must be moved + inside tty_output. Why didn't I catch this earlier?) + +-- Provide a way for emacsclient to tell Emacs that the tty has been + resized. + + (Done, simply forward the SIGWINCH signal.) + +-- Each keypress should automatically select the frame corresponding + to the terminal that it was coming from. This means that Emacs + must know from which terminal the last keyboard event came from. + + (Done, it was quite simple, the input event system already + supported multiple frames.) + +-- Fix SIGIO issue with secondary terminals. + + (Done, emacsclient signals Emacs after writing to the proxy pseudo + terminal. Note that this means that multi-tty does not work with + raw ttys!) + + (Update: This is bullshit. There is a read_input_waiting function, + extend that somehow.) + + (Update of update: The first update was not right either, extending + read_input_waiting was not necessary. Secondary ttys do seem to + send signals on input.) + + (Update^3: Not any more.) + +-- Make make-terminal-frame look up the `tty' and `tty-type' frame + parameters from the currently selected terminal before the global + default. + + (Done.) + +-- Put all cached terminal escape sequences into struct tty_output. + Currently, they are still stored in global variables, so we don't + really support multiple terminal types. + + (Done. It was not fun.) + +-- Implement sane error handling after initialization. (Currently + emacs exits if you specify a bad terminal type.) The helpful error + messages must still be provided when Emacs starts. + + (Done.) + +-- Implement terminal deletion, i.e., deleting local frames, closing + the tty device and restoring its previous state without exiting + Emacs. + + (Done, but at the moment only called when an error happens during + initialization. There is a memory corruption error around this + somewhere.) (Update: now it is fully enabled.) + +-- Implement automatic deletion of terminals when the last frame on + that terminal is closed. + + (Done.) + +-- Restore tty screen after closing the terminal. + + (Done, we do the same as Emacs 21.2 for all terminals.) + +-- 'TERM=dumb src/emacs' does not restore the terminal state. + + (Done.) + +-- C-g should work on secondary terminals. + + (Done, but the binding is not configurable.) + +-- Deal with SIGHUP in Emacs and in emacsclient. (After this, the + server-frames may be removed from server.el.) + + (Done, nothing to do. It seems that Emacs does not receive SIGHUP + from secondary ttys, which is actually a good thing.) (Update: I + think it would be a bad idea to remove server-frames.) + +-- Change emacsclient/server.el to support the -t argument better, + i.e. automatically close the socket when the frame is closed. + + (Seems to be working OK.) + +-- Fix mysterious memory corruption error with tty deletion. To + trigger it, try the following shell command: + + while true; do TERM=no-such-terminal-definition emacsclient -h; done + + Emacs usually dumps core after a few dozen iterations. (The bug + seems to be related to the xfreeing or bzeroing of + tty_output.Wcm. Maybe there are outside references to struct Wcm? + Why were these vars collected into a struct before multi-tty + support?) + + (Done. Whew. It turned out that the problem had nothing to do + with hypothetical external references to Wcm, or any other + tty_output component; it was simply that delete_tty closed the + filehandles of secondary ttys twice, resulting in fclose doubly + freeing memory. Utterly trivial matter. I love the C's memory + management, it puts hair on your chest.) + +-- Support raw secondary terminals. (Note that SIGIO works only on + the controlling terminal.) Hint: extend read_input_waiting for + multiple ttys and hopefully this will be fixed. + + (Done, it seems to have been working already for some time. It + seems F_SETOWN does work, after all. Not sure what made it fail + earlier, but it seems to be fixed (there were several changes + around request_sigio, maybe one of them did it). + read_input_waiting is only used in sys_select, don't change + it.) (Update: After adding X support, it's broken again.) + (Update^2: No it isn't.) :-) + +-- Find out why does Emacs abort when it wants to close its + controlling tty. Hint: chan_process[] array. Hey, maybe + noninterrupt-IO would work, too? Update: no, there is no process + for stdin/out. + + (Done. Added add/delete_keyboard_wait_descriptor to + term_init/delete_tty. The hint was right, in a way.) + +-- Issue with SIGIO: it needs to be disabled during redisplay. See if + fcntl kernel behaviour could be emulated by emacsclient. + + (Done. Simply disabled the SIGIO emulation hack in emacsclient.) + (Update: it was added back.) (Update^2: and removed again.) + +-- server.el: There are issues with saving files in buffers of closed + clients. Try editing a file with emacsclient -f, and (without + saving it) do a delete-frame. The frame is closed without + question, and a surprising confirmation prompt appears in another + frame. + + (Done. delete-frame now asks for confirmation if it still has + pending buffers, and modified buffers don't seem to be deleted.) + +-- emacsclient.el, server.el: Handle eval or file open errors when + doing -t. + + (Done.) + +-- Make parts of struct tty_output accessible from Lisp. The device + name and the type is sufficient. + + (Done, see frame-tty-name and frame-tty-type.) + +-- Export delete_tty to the Lisp environment, for emacsclient. + + (Done, see delete-tty.) + +-- Get rid of the accessor macros in termchar.h, or define macros for + all members. + + (Done.) + +-- Move device-specific parameters (like costs) commonly used by + device backends to a common, device-dependent structure. + + (Done. See struct display_method in termhooks.h.) + +-- Fix X support. + + (Done. Well, it seems to be working.) + +-- Allow simultaneous X and tty frames. (Handling input could be + tricky. Or maybe not.) + + (Done. Allowed, that is. It is currently extremely unstable, to + the point of being unusable. The rif variable causes constant + core dumps. Handling input is indeed tricky.) + +-- Rewrite multi-tty input in terms of MULTI_KBOARD. + + (Done. In fact, there was no need to rewrite anything, I just + added a kboard member to tty_display_info, and initialized the + frame's kboard from there.) + +-- Fix rif issue with X-tty combo sessions. IMHO the best thing to do + is to get rid of that global variable (and use the value value in + display_method, which is guaranteed to be correct). + + (Done, did exactly that. Core dumps during combo sessions became + much rarer. In fact, I have not yet met a single one.) + +-- Add multi-tty support to talk.el. + + (Done.) + +-- Clean up the source of emacsclient. It is a mess. + + (Done, eliminated stupid proxy-pty kludge.) + +-- Fix faces on tty frames during X-tty combo sessions. There is an + init_frame_faces call in init_sys_modes, see if there is a problem + with it. + + (Done, there was a stupid mistake in + Ftty_supports_face_attributes_p. Colors are broken, though.) + +-- C-x 5 2, C-x 5 o, C-x 5 0 on an emacsclient frame unexpectedly + exits emacsclient. This is a result of trying to be clever with + delete-frame-functions. + + (Fixed, added delete-tty-after-functions, and changed server.el to + use it.) + +-- Something with (maybe) multi-keyboard support broke function keys + and arrows on ttys during X+tty combo sessions. Debug this. + + (I can't reproduce it, maybe the terminal type was wrong.) + +-- Fix input from raw ttys (again). + + (Now it seems to work all right.) + +-- During an X-tty combo session, a (message "Hello") from a tty frame + goes to the X frame. Fix this. + + (Done. There was a safeguard against writing to the initial + terminal frame during bootstrap which prevented echo_area_display + from working correctly on a tty frame during a combo session.) + +-- If there are no frames on its controlling terminal, Emacs should + exit if the user presses C-c there. + + (Done, as far as possible. See the SIGTERM comment in + interrupt_signal on why this seems to be impossible to solve this + in general.) + +-- During an X session, Emacs seems to read from stdin. Also, Emacs + fails to start without a controlling tty. + + (Fixed by replacing the troublesome termcap display with a dummy + bootstrap display during bootstrap. + +-- Do tty output through struct display, like graphical display + backends. + + (Done.) + +-- Define an output_initial value for output_method for the initial + frame that is dumped with Emacs. Checking for this frame (e.g. in + cmd_error_internal) is ugly. + + (Done, breaking interactive temacs.) + +-- The command `emacsclient -t -e '(delete-frame)'' fails to exit. + + (Fixed.) + +-- frame-creation-function should always create a frame that is on the + same display as the selected frame. Maybe frame-creation-function + should simply be removed and make-frame changed to do the right + thing. + + (Done, with a nice hack. frame-creation-function is now frame-local.) + +-- Fix C-g on raw ttys. + + (Done. I disabled the interrupt/quit keys on all secondary + terminals, so Emacs sees C-g as normal input. This looks like an + overkill, because emacsclient has extra code to pass SIGINT to + Emacs, so C-g should remain the interrupt/quit key on emacsclient + frames. See the next entry why implementing this distinction would + be a bad idea.) + +-- Make sure C-g goes to the right frame with ttys. This is hard, as + SIGINT doesn't have a tty parameter. :-( + + (Done, the previous change fixes this as a pleasant side effect.) + +-- I have seen a case when Emacs with multiple ttys fell into a loop + eating 100% of CPU time. Strace showed this loop: + + getpid() = 30284 + kill(30284, SIGIO) = 0 + --- SIGIO (I/O possible) @ 0 (0) --- + ioctl(6, FIONREAD, [0]) = -1 EIO (Input/output error) + ioctl(5, FIONREAD, [0]) = -1 EIO (Input/output error) + ioctl(0, FIONREAD, [0]) = 0 + sigreturn() = ? (mask now []) + gettimeofday({1072842297, 747760}, NULL) = 0 + gettimeofday({1072842297, 747806}, NULL) = 0 + select(9, [0 3 5 6], NULL, NULL, {0, 0}) = 2 (in [5 6], left {0, 0}) + select(9, [0 3 5 6], NULL, NULL, {0, 0}) = 2 (in [5 6], left {0, 0}) + gettimeofday({1072842297, 748245}, NULL) = 0 + + I have seen something similar with a single X frame, but have not + been able to reproduce it for debugging. + + Update: This may have been caused by checking for nread != 0 + instead of nread > 0 after calling read_socket_hook in + read_avail_input. + + (Fixed. This was caused by unconditionally including stdin in + input_wait_mask in init_process. The select call in + wait_reading_process_input always returned immediately, indicating + that there is pending input from stdin, which nobody read. + + Note that the above strace output seems to be an unrelated but + similar bug. I think that is now fixed.) + +-- Exiting Emacs while there are emacsclient frames doesn't restore the + ttys to their default states. + + (This seems to be fixed by some previous change.) + +-- Allow opening an X session after -nw. + + (Done.) + +-- Fix color handling during tty+X combo sessions. (It seems that tty + sessions automatically convert the face colors to terminal colors + when the face is loaded. This conversion must happen instead on + the fly in write_glyphs, which might be problematic, as color + approximation is currently done in lisp (term/tty-colors.el).) + (Update: hm, colors seem to work fine if I start emacs with -nw and + then create an X frame. Maybe it's just a small buglet somewhere.) + + (Seems to be fixed. The problem was in startup.el, it did not + initialize tty colors when the initial window system was + graphical.) + +-- emacs -nw --eval '(y-or-n-p "Foobar")' segfaults. (Reported by + Romain Francoise) + + (Fixed, there was a keyboard initialization problem.) + +-- Fix interactive use of temacs. There are face-related SEGVs, most + likely because of changes in realize_default_face, realize_face. + + (Fixed.) + +-- Don't exit Emacs when the last X connection fails during a + multi-display session. + + (Fixed.) + +-- Dan Nicolaescu noticed that starting emacsclient on the same + terminal device that is the controlling tty of the Emacs process + gives unexpected results. + + (Fixed.) + +-- Istvan Marko reported that Emacs hang on ttys if it was started + from a shell script. + + (Fixed. There was a bug in the multi-tty version of + narrow_foreground_group. tcsetpgrp blocks if it is called from a + process that is not in the same process group as the tty.) + +-- emacsclient -t from an Emacs term buffer does not work, complains + about face problems. This can even lock up Emacs (if the recursive + frame sets single_kboard). Update: the face problems are caused by + bugs in term.el, not in multi-tty. The lockup is caused by + single_kboard mode, and is not easily resolvable. The best thing to + do is to simply refuse to create a tty frame of type `eterm'. + + (Fixed, changed emacsclient to check for TERM=eterm. The face + complaints seem to be caused by bugs in term.el; they are not + related to multi-tty.) + +-- Find out the best way to support suspending Emacs with multiple + ttys. My guess: disable it on the controlling tty, but from other + ttys pass it on to emacsclient somehow. (It is (I hope) trivial to + extend emacsclient to handle suspend/resume. A `kill -STOP' almost + works right now.) + + (Done. I needed to play with signal handling and the server + protocol a bit to make emacsclient behave as a normal UNIX program + wrt foreground/background process groups.) + +-- There is a flicker during the startup of `emacs -nw'; it's as if + the terminal is initialized, reset and then initialialized again. + Debug this. (Hint: narrow_foreground_group is called twice during + startup.) + + (This is gone.) + +-- Robert Chassell has found serious copy-paste bugs with the + multi-tty branch. There seem to be redisplay bugs while copying + from X to a terminal frame. Copying accented characters do not + work for me. + + (Patch-124 should fix this, by changing the interprogram-*-function + variables to be frame-local, as suggested by Mark Plaksin + (thanks!). I think that the redisplay bugs are in fact not bugs, + but delays caused by single_kboard --> perhaps MULTI_KBOARD should + be removed.) + +-- frame-creation-function was removed, which might be a bad idea. + Think up a compatible solution. + + (It was an internal interface that may be changed when necessary.) + +-- Change Lisp code not to (getenv "TERM"); use the `tty-type' frame + parameter or the frame-tty-type function instead. (M-x tags-search + "TERM" helps with this.) Update: Actually, all getenv invocations + should be checked for multi-tty compatibility, and an interface + must be implemented to get the remote client's environment. + + (Done. Only getenv calls in lisp/term/*.el were changed; other + calls should be mostly left as they are.) + +-- Add an elaborate mechanism for display-local variables. (There are + already a few of these; search for `terminal-local' in the Elisp + manual.) + + (Not needed. Display-local variables could be emulated by + frame-local variables.) + +-- Emacs assumes that all terminal frames have the same locale + settings as Emacs itself. This may lead to bogus results in a + multi-locale setup. (E.g., while logging in from a remote client + with a different locale.) + (Update after new bugreport by Friedrich Delgado Friedrichs: + (at least) the structs terminal_coding and keyboard_coding in + coding.c must be moved to struct display, and the Lisp interface + [set-]keyboard-coding-system must be adapted for the change.) + + (Fixed. Emacs now uses the locale settings as seen by the + emacsclient process for server tty frames.) + (Update: Not really; Vlocale_coding_system is still global.) + +-- Make `struct display' accessible to Lisp programs. Accessor functions: + + (displayp OBJECT): Returns t if OBJECT is a display. + => Implemented as display-live-p. + + (display-list): Returns list of currently active displays. + => Implemented. + + (selected-display): Returns the display object of the selected frame. + => Not strictly necessary, but implemented anyway. + + (frame-display FRAME): Returns the display object of FRAME. + => Implemented. + + (display-frames DISPLAY): Returns a list of frames on DISPLAY. + => Already implemented, see frames-on-display-list. + + (display-type DISPLAY): Returns the type of DISPLAY, as a + symbol. (See `framep'.) + => Implemented as display-live-p. + + (display-device DISPLAY): Returns the name of the device that + DISPLAY uses, as a string. (E.g: "/dev/pts/16", or + ":0.0") + => Implemented as display-name. + + etc. + + See next issue why this is necessary. + + (Update: The consensus on emacs-devel seems to be to do this via + integer identifiers. That's fine by me.) + + (Done.) + +-- The following needs to be supported: + + $ emacsclient -t + C-z + $ emacsclient -t + (This fails now.) + + The cleanest way to solve this is to allow multiple displays on the + same terminal device; each new emacsclient process should create + its own display. As displays are currently identified by their + device names, this is not possible until struct display becomes + accessible as a Lisp-level object. + + (Done.) + +-- Miles Bader suggests that C-x C-c on an emacsclient frame should + only close the frame, not exit the entire Emacs session. Update: + see above for a function that does this. Maybe this should be the + new default? + + (Done. This is the new default. No complaints so far.) + +-- Clean up the frame-local variable system. I think it's ugly and + error-prone. But maybe I just haven't yet fully understood it. + + (Nothing to do. It doesn't seem ugly any more. It's rather clever.) + +-- Support multiple character locales. A version of + `set-locale-environment' needs to be written for setting up + display-local settings on ttys. I think calling + set-display-table-and-terminal-coding-system and + set-keyboard-coding-system would be enough. The language + environment itself should remain a global setting. + + (Done, by an ugly hack.) + +-- The terminal customization files in term/*.el tend to change global + parameters, which may confuse Emacs with multiple displays. Change + them to tweak only frame-local settings, if possible. (They tend + to call define-key to set function key sequences a lot.) + + (Done, by making `function-key-map' terminal-local (i.e., part of + struct kboard). This has probably covered all the remaining problems.) + +-- Make `function-key-map' and `key-translation-map' terminal-local. + + (Done.) + +-- Implement `terminal-local-value' and `set-terminal-local-value' to + allow deterministic access to terminal local bindings. The + encode-kb package can not set up `key-translation-map' without + these. The terminal-local bindings seem to be independent of what + frame is selected. + + (Done.) + +-- xt-mouse.el needs to be adapted for multi-tty. It currently + signals an error on kill-emacs under X, which prevents the user + from exiting Emacs. (Reported by Mnemonikk on freenode.) + + (Done, I hope.) + + +-- Having {reset,init}_all_sys_modes in set-input-mode breaks arrow + keys on non-selected terminals under screen, and sometimes on other + terminal types as well. The other function keys continue to work + fine. Sometimes faces on these screens become garbled. + + This only seems to affect displays that are of the same terminfo + type as the selected one. Interestingly, in screen Emacs normally + reports the up arrow key as `M-o A', but after the above SNAFU, it + complains about `M-[ a'. UNIX ttys are a complete mystery to me, + but it seems the reset-reinitialize cycle somehow leaves the + non-selected terminals in a different state than usual. I have no + idea how this could happen. + + Currently set-input-mode resets only the currently selected + terminal, which seems to somehow work around the problem. + + Update: + + Dan Nicolaescu <dann@ics.uci.edu> writes: + > Some terminals have 2 modes for cursor keys: Application Mode where + > the cursor keys transmit the codes defined in the terminfo entry, and + > Cursor mode. Applications have to send the smkx and rmkx terminfo + > strings to switch between the 2 modes. So Emacs (and emacsclient) have + > to send smkx when initializing and rmkx when quitting (or on + > suspend). + + (I think patch-370 fixed this.) + +-- This long-standing bug (first reported by Han Boetes) seems to come + and go all the time. It is time to track it down and fix it. + + emacs + M-x server-start + + # From another xterm: + emacsclient -e '(y-or-n-p "Do you want me to crash? ")' + # Notice how the answer ends up in the *scratch* buffer + M-x garbage-collect + SIGSEGV + + (Fixed in patch-414 after detailed analysis by Kalle Olavi Niemitalo.) + +-- normal-erase-is-backspace-mode in simple.el needs to be updated for + multi-tty (rep. by Dan Waber). (The Delete key is broken on X + because of this.) + + (Fixed in patch-427.) + +-- I think keyboard-translate-table should be made terminal-local. + + (Done in patch-431.) + +-- The semantics of terminal-local variables are confusing; it is not + clear what binding is in effect in any given time. See if + current_kboard (or at least the terminal-local bindings exported to + Lisp) might be changed to be tied to the selected frame instead. + Currently, `function-key-map' and `key-translation-map' may be + accessed reliably only using the hackish + `(set-)terminal-local-value' functions. + + Perhaps there should be a difference between `last-command' &co. + and these more conventional configuration variables. + (E.g. `symbol-value' would use current_kboard to access + `last-command', but SELECTED_FRAME()->display->kboard to get the + value of `function-key-map'. + + (Fixed in patch-434.) + +-- If the first key pressed on a new tty terminal is a function key, + it is not recognized correctly. May be related to the bug below. + + (Seems to have been fixed as a side effect of patch-434. "The bug + below" was the set-input-mode madness.) + + (Update: this bug was fixed for good in patch-449. It was tracked + down to a bug in `read_key_sequence': it failed to reinitialize its + local function-key-map/key-translation-map references when it + switched keyboards. I don't understand why did this bug only + appear on brand new frames, though!) + +-- Disable connecting to a new X display when we use the GTK toolkit. + + (Disabled in patch-450.) + +-- Implement automatic forwarding of client environment variables to + forked processes, as discussed on the multi-tty list. Terminal + parameters are now accessible in C code, so the biggest obstacle is + gone. The `getenv_internal' and `child_setup' functions in + callproc.c must be changed to support the following variable: + + terminal-local-environment-variables is a variable defined in ... + + Enable or disable terminal-local environment variables. + + If set to t, `getenv', `setenv' and subprocess creation + functions use the environment variables of the emacsclient + process that created the selected frame, ignoring + `process-environment'. + + If set to nil, Emacs uses `process-environment' and ignores + the client environment. + + Otherwise, `terminal-local-environment-variables' should be a + list of variable names (represented by Lisp strings) to look + up in the client environment. The rest will come from + `process-environment'. + + (Implemented in patch-461; `terminal-getenv', `terminal-setenv' and + `with-terminal-environment' are now replaced by extensions to + `getenv' and `setenv', and the new `local-environment-variables' + facility. Yay!) + + (Updated in patch-465 to fix the semantics of let-binding + `process-environment'. `process-environment' was changed to + override all local/global environment variables, and a new variable + `global-environment' was introduced to have `process-environment's + old meaning.) + + (Updated in patch-466 to fix the case when two emacsclient sessions + share the same terminal, but have different environment. The local + environment lists are now stored as frame parameters, so the + C-level terminal parameters are not strictly necessary any more.) + +-- `Fdelete_frame' is called from various critical places where it is + not acceptable for the frame deletion to fail, e.g. from + x_connection_closed after an X error. `Fdelete_frame' now protects + against `delete-frame-functions' throwing an error and preventing a + frame delete. (patch-475) + +-- Fix set-input-mode for multi-tty. It's a truly horrible interface; + what if we'd blow it up into several separate functions (with a + compatibility definition)? + + (Done. See `set-input-interrupt-mode', `set-output-flow-control', + `set-input-meta-mode' and `set-quit-char'.) (patch-457) + +-- Let-binding `overriding-terminal-local-map' on a brand new frame + does not seem to work correctly. (See `fancy-splash-screens'.) + The keymap seems to be set up right, but events go to another + terminal. Or is it `unread-command-events' that gets Emacs + confused? Investigate. + + (Emacs was confused because a process filter entered + `recursive-edit' while Emacs was reading input. I added support + for this in the input system.) (patch-489) + +-- I smell something funny around pop_kboard's "deleted kboard" case. + Determine what are the circumstances of this case, and fix any + bug that comes to light. + + (It happens simply because single_kboard's terminal is sometimes + deleted while executing a command on it, for example the one that + kills the terminal. There was no bug here, but I rewrote the whole + single_kboard mess anyway.) (patch-489) + +-- Understand Emacs's low-level input system (it's black magic) :-) + What exactly does interrupt_input do? I tried to disable it for + raw secondary tty support, but it does not seem to do anything + useful. (Update: Look again. X unconditionally enables this, maybe + that's why raw terminal support is broken again. I really do need + to understand input.) + (Update: I am starting to understand the read_key_sequence->read-char + ->kbd_buffer_get_event->read_avail_input->read_socket_hook path. Yay!) + + (Update: OK, it all seems so easy now (NOT). Input could be done + synchronously (with wait_reading_process_input), or asynchronously + by SIGIO or polling (SIGALRM). C-g either sets the Vquit_flag, + signals a 'quit condition (when immediate_quit), or throws to + `getcjmp' when Emacs was waiting for input when the C-g event + arrived.) + +-- Replace wrong_kboard_jmpbuf with a special return value of + read_char. It is absurd that we use setjmp/longjmp just to return + to the immediate caller. + + (Done in patch-500.) + +-- `tool-bar-mode', `scroll-bar-mode', `menu-bar-mode' and + 'fringe-mode' are modes global to the entire Emacs session, not + just a single frame or a single terminal. This means that their + status sometimes differs from what's actually displayed on the + screen. As a consequence, the Options | Show/Hide menu sometimes + shows incorrect status, and you have to select an option twice for + it to have any visible effect on the current frame. + + Change Emacs so that the status of the items in the Options | + Show/Hide menu correspond to the current frame. + + (Done in patch-537.) + +-- The `default-directory' variable should somehow be set to the + cwd of the emacsclient process when the user runs emacsclient + without file arguments. Perhaps it is OK to just override the + directory of the *scratch* buffer. + + (Done in patch-539.) + +-- The borders on tooltip frames on X are messed up. More + specifically, the frame's internal border (internal-border-width + frame parameter) is not filled with the correct background color. + + It seems the border contents are drawn onto by the + update_single_window call in `x-show-tip'. After some debugging, I + think the window's background color is not set up + correctly---calling `x_clear_area' fills the specified area with + black, not light yellow. + + (Done in patch-544. A background_pixel field was defined both in + struct frame and struct x_output, and Emacs got confused between + them.) + + +This file is part of GNU Emacs. + +GNU Emacs is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3, or (at your option) +any later version. + +GNU Emacs is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Emacs; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. + +;;; arch-tag: 8da1619e-2e79-41a8-9ac9-a0485daad17d diff --git a/admin/nt/README-ftp-server b/admin/nt/README-ftp-server index 470c78fd41d..e04201a7b7b 100644 --- a/admin/nt/README-ftp-server +++ b/admin/nt/README-ftp-server @@ -60,9 +60,12 @@ file, plus temacs.exe and dump.bat, which are required if you want to redump emacs without recompiling it. - + libxpm-src.zip - Source code for libXpm-X11R7.2-3.5.6 modified to compile on Windows. - This corresponds to the libXpm.dll in emacs-22.2-bin-i386.zip + + libxpm-3.5.7-w32-src.zip + Source code required to compile libXpm-3.5.7 on Windows. Contains + a basic Makefile for compiling with mingw32 and a .def file for + generating a DLL with the appropriate exports in addition to the + source code to provide the subset of functionality Emacs uses from + libXpm. This corresponds to the libXpm.dll in emacs-22.2-bin-i386.zip and emacs-22.2-barebin-i386.zip. @@ -93,7 +96,7 @@ the black and white versions of the toolbar icons. XPM: a Windows port of the XPM library corresponding to the x.org - release of X11R7.2 is included with the binary distribution, but + release of X11R7.3 is included with the binary distribution, but can be replaced by other versions with the name xpm4.dll, libxpm-nox4.dll or libxpm.dll. diff --git a/doc/lispintro/.gitignore b/doc/lispintro/.gitignore new file mode 100644 index 00000000000..e1af5a918b0 --- /dev/null +++ b/doc/lispintro/.gitignore @@ -0,0 +1,21 @@ +*.aux +*.fn +*.fns +*.cps +*.cp +*.kys +*.ky +*.toc +*.pgs +*.pg +*.log +*.vrs +*.vr +*.dvi +*.ps +*.tp +*.tps +*.tmp +*.txt +Makefile +makefile diff --git a/doc/lispintro/ChangeLog b/doc/lispintro/ChangeLog new file mode 100644 index 00000000000..b198f14add2 --- /dev/null +++ b/doc/lispintro/ChangeLog @@ -0,0 +1,287 @@ +2007-09-12 Robert J. Chassell <bob@rattlesnake.com> + + * emacs-lisp-intro.texi: Add email address to Thank You correctly + +2007-09-06 Romain Francoise <romain@orebokech.com> + + * Makefile.in (maintainer-clean): Delete info files. + +2007-09-06 Glenn Morris <rgm@gnu.org> + + * Move from lispintro/ to doc/lispintro/. + * Makefile.in (infodir): Go up one more level. + (usermanualdir): Change from ../man to ../emacs. + * makefile.w32-in (infodir, ENVADD): Go up one more level. + * emacs-lisp-intro.texi (setfilename): Go up one more level. + +2007-07-30 Robert J. Chassell <bob@rattlesnake.com> + + * emacs-lisp-intro.texi: Fix typo on line 5173, change `thee' to + `these'. + +2007-07-25 Glenn Morris <rgm@gnu.org> + + * Relicense all FSF files to GPLv3 or later. + +2007-06-02 Chong Yidong <cyd@stupidchicken.com> + + * Version 22.1 released. + +2007-01-30 Robert J. Chassell <bob@rattlesnake.com> + + * emacs-lisp-intro.texi (else): Rephrase message of first + if-then-else example so it is right both in itself and in the + "true" case of the expression, which asks whether 4 is greater + than 5. + +2006-11-27 Andreas Schwab <schwab@suse.de> + + * Makefile.in (usermanualdir): Define. + (emacs-lisp-intro.dvi): Pass -I options to texi2dvi instead of + using TEXINPUTS. + + * emacs-lisp-intro.texi: Input texinfo instead of ../man/texinfo + to fix building outside source directory. + +2006-11-09 Robert J. Chassell <bob@rattlesnake.com> + + * emacs-lisp-intro.texi: Copy descriptions from detailed master + menu to menus within body. + + * emacs-lisp-intro.texi (at the beginning): Add `other shell + commands' to produce additional output formats; total is now ten. + (A Loop with an Incrementing Counter, and others): Ensure Info + menus will appear in short windows. + (Disentangle beginning-of-buffer): Replace `version 21' with `more + recent versions'. + (Simple Extension): Show how to handle multiple versions by adding + an alternative with a test of `>= 21' + + +2006-11-06 Robert J. Chassell <bob@rattlesnake.com> + + * emacs-lisp-intro.texi: Finish minor changes seen from DVI output. + Replace 22.1.100 with 22.1.1. + (current-kill): Mention functions that directly or indirectly call + `kill-new', which sets `kill-ring-yank-pointer'. + (Understanding current-kill): Change `lasted' to `last'. Remove + extraneous parenthesis. Reword item about returning `car' of list. + (yank): Remove mention of `rotate-yank-pointer'. + (Y Axis Element): Add comment regarding replacement of blank space. + (print-Y-axis Penultimate): Explain that `print-graph' will pass + `height-of-top-line' so `print-Y-axis' does not have a bug. + +2006-11-05 Robert J. Chassell <bob@rattlesnake.com> + + * emacs-lisp-intro.texi: Yet more minor changes: + (defcustom): Said that `:options' is usually for a hook. Remove + extraneous space in parenthetical remark concerning + `text-mode-hook-identify'. At end, mention other defines, too. + (Beginning a .emacs File): Reverse words about comments so they + parallel numbers of listed semi-colons. + (Text and Auto-fill): Remove extraneous blank line in example. + (Mail Aliases): Remove extraneous blank line in example. + (Keybindings): Reformat as needed with `key' rather than `kbd'. + (Keybindings, Miscellaneous, Mode Line): For small book format, start + section name on top of new page. + (Simple Extension): Replace longer expression with + `emacs-major-version'. Remove comment about `number-to-string' + function. + (Miscellaneous): Add filename option, `-H', to `grep' example + (debug, debug-on-entry): Replace `GNU Emacs 22' with `a recent + GNU Emacs'. + (edebug): More properly state where to place point for 'M-x + edebug-defun'. + + * emacs-lisp-intro.texi: More minor changes. + Center images for TeX output. + (kill-new function): Remove indentation for sentence talking about + momentarily skipping code. + (cons & search-fwd Review): Document @code{funcall}. Document + @code{re-search-forward} with existing @code{search-forward}. + Reference chapter on regular expression searches. + (Recursion with list): Specify a more recent version as being Emacs. + (Recursion with list, Every, recursive-graph-body-print): Change + `if ... progn' expression to `when'. + (Recursive triangle function): For printing in small book, ensure + section name is not last on bottom of preceding page. + (Keep): Remove extraneous space in function definition example. + (sentence-end): Specify `in English' for glyphs that end a sentence. + Note that in GNU Emacs 22, the name refers to both a variable and a + function. + (fwd-sentence while loops): Write a function as one, not as a form + (fwd-para let): Add `which' to sentence with `parstart' and `parsep'. + (etags): Move sentences involving `find-tag' and sources. State + location of Emacs `src' directory. + (Design count-words-region): Better explain two backslashes in a row. + (Find a File): Fix grammar; add a `to' and write `to visit'. Change + `named' to `selected'. + (lengths-list-file): Remove extraneous parenthesis from reference. + (lengths-list-many-files): Explain `expand-file-name' better. + (Files List): Rephrase sentence regarding Lisp sources directory + +2006-11-04 Robert J. Chassell <bob@rattlesnake.com> + + * emacs-lisp-intro.texi: Replace 22.0.100 with 22.1.100. + (defcustom): Note that the value set by defconst is a variable. + (Buffer Size & Locations): Parenthetical remark about evaluation. + (Finding More): Change text to include C sources by inference. + + * emacs-lisp-intro.texi: Minor fixes. + Replace all tabs with eight spaces each so printed text looks correct. + Remove extraneous comma in a printed node name produced by `ref'. + (insert-buffer): Add a missing beginning parenthesis. + (beginning-of-buffer): Add `beginning of' to note about accessible + portion. + (narrow Exercise): Write closing parenthesis at end of correct + paragraph. + (zap-to-char): Remove extraneous `a' from first sentence. + (Complete zap-to-char): Remove two extraneous sentences. + (zap-to-char body): Move sentences on documentation two nodes earlier. + (Lisp macro): Add definition of `unless' macro. + (last-command & this-command): Remove comment that `we have not yet + seen' the @code{eq} function. + (kill-append function): Reformat `kill-append' function definition so + it prints well. + (kill-new function): Indent the sentence beginning `notice'. Replace + `the same as' with `similar to'. Repair typo. Remove obsolete + references to `yank' and `yank-pop. End section with a note that `we + will digress into C.' + +2006-11-02 Robert J. Chassell <bob@rattlesnake.com> + + * emacs-lisp-intro.texi (kill-ring-yank-pointer): Revert addition + of extraneous quotation mark to rotate-yank-pointer. + +2006-11-01 Juri Linkov <juri@jurta.org> + + * emacs-lisp-intro.texi: Fix unbalanced quotes. + +2006-10-31 Robert J. Chassell <bob@rattlesnake.com> + + * emacs-lisp-intro.texi: Revised text for kill-region, + copy-region-as-kill, kill-append, kill-new, forward-sentence, + forward-paragraph, find-file, current-kill, yank, and yank-pop. + Removed INSTALL MANIFEST from the directory since those files are + now irrelevant. Updated Info file in ../info. Changed numbering + so is now Revised Third Edition and this instance's edition-number + is 3.00. Did not update ISBN number. + + * emacs-lisp-intro.texi: Remove version reference for X colors. + Document `='. Remove mention that :eval was new in 21. Updated + instance's edition-number to 3.01. + +2006-10-30 Robert J. Chassell <bob@rattlesnake.com> + + * emacs-lisp-intro.texi: Many changes since it turned out that + many `simple' functions were rewritten. Changes to the text + regarding zap-to-char, mark-whole-buffer, append-to-buffer, + copy-to-buffer, beginning-of-buffer, what-line, and possibly + others. (I have not reviewed all yet.) This instance does build + for Info and TeX. + +2006-10-29 Chong Yidong <cyd@stupidchicken.com> + + * Makefile.in: Use relative paths to avoid advertising filesystem + contents during compilation. + +2006-08-21 Robert J. Chassell <bob@rattlesnake.com> + + * emacs-lisp-intro.texi: deleted in directory copy of texinfo.tex + and pointed towards ../man/texinfo.tex so only one file + needs updating. Added comment of what to do when building on own. + + * texinfo.tex: changed to version 2006-02-13.16 + to enable a DVI build using the more recent versions of TeX. + +2006-05-25 David Kastrup <dak@gnu.org> + + * emacs-lisp-intro.texi (setcar): replace an antelope rather than + a giraffe with a hippopotamus. + +2006-05-19 Thien-Thi Nguyen <ttn@gnu.org> + + * emacs-lisp-intro.texi (Digression concerning error): Fix typo. + +2005-09-16 Romain Francoise <romain@orebokech.com> + + * emacs-lisp-intro.texi (GNU Free Documentation License): + Specify GFDL version 1.2. + +2005-07-30 Eli Zaretskii <eliz@gnu.org> + + * makefile.w32-in (info): Don't run install-info. + ($(infodir)/dir): New target, produced by running install-info. + +2005-07-04 Lute Kamstra <lute@gnu.org> + + Update FSF's address in GPL notices. + + * emacs-lisp-intro.texi: Update FSF's address. + +2004-04-23 Juanma Barranquero <lektu@terra.es> + + * makefile.w32-in: Add "-*- makefile -*-" mode tag. + +2004-02-29 Juanma Barranquero <lektu@terra.es> + + * makefile.w32-in (mostlyclean, clean, maintainer-clean): Use + $(DEL) instead of rm, and ignore exit code. + +2003-11-16 Kevin Ryde <user42@zip.com.au> + + * emacs-lisp-intro.texi: [CVS commitment by <bob@rattlesnake.com>] + Corrections to cross references, + (Interactive Options): elisp "interactive" -> "Using Interactive". + (defvar and asterisk): Remove emacs "Edit Options" reference, + edit-options is no longer described in the emacs manual. + (Lists diagrammed): elisp "List Type" -> "Cons Cell Type". + +2003-09-03 Peter Runestig <peter@runestig.com> + + * makefile.w32-in: New file. + +2001-11-29 Eli Zaretskii <eliz@is.elta.co.il> + + * emacs-lisp-intro.texi (Index): @ignore extraneous text. + Use @dircategory and @direntry to define the DIR entry. + +2001-11-25 Robert J. Chassell <bob@rattlesnake.com> + + * emacs-lisp-intro.texi: Move @contents to the beginning of the + file. Set the size to @smallbook. + +2001-11-24 Eli Zaretskii <eliz@is.elta.co.il> + + * Makefile.in: New file. + + * README: Update. + + * *.eps: Rename to avoid clashes in DOS 8+3 namespace. + +;; Local Variables: +;; coding: iso-2022-7bit +;; add-log-time-zone-rule: t +;; End: + + Copyright (C) 2001, 2002, 2003, 2004, 2005, + 2006, 2007 Free Software Foundation, Inc. + + This file is part of GNU Emacs. + + GNU Emacs is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + GNU Emacs is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Emacs; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. + +;;; arch-tag: ee4f8e1f-e14c-4d2e-86de-4dd697e6f1c3 diff --git a/doc/lispintro/Makefile.am b/doc/lispintro/Makefile.am new file mode 100644 index 00000000000..1b89c55528b --- /dev/null +++ b/doc/lispintro/Makefile.am @@ -0,0 +1,7 @@ +AUTOMAKE_OPTIONS = foreign 1.2 +info_TEXINFOS = emacs-lisp-intro.texi +EXTRA_DIST = INSTALL MANIFEST README drawers.eps \ + cons-1.eps cons-2.eps cons-2a.eps cons-3.eps \ + cons-4.eps cons-5.eps lambda-1.eps lambda-2.eps lambda-3.eps + +# arch-tag: 6a3e6d99-7aa2-479f-939c-5531165c5747 diff --git a/doc/lispintro/Makefile.in b/doc/lispintro/Makefile.in new file mode 100644 index 00000000000..5ace5337971 --- /dev/null +++ b/doc/lispintro/Makefile.in @@ -0,0 +1,73 @@ +#### Makefile for the Emacs Lisp Introduction manual + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. + +# This file is part of GNU Emacs. + +# GNU Emacs is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. + +# GNU Emacs is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with GNU Emacs; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. + +SHELL = @SHELL@ + +srcdir = @srcdir@ +VPATH = @srcdir@ + +infodir = ../../info +usermanualdir = $(srcdir)/../emacs + +INFO_SOURCES = ${srcdir}/emacs-lisp-intro.texi +# The file name eintr must fit within 5 characters, to allow for +# -NN extensions to fit into DOS 8+3 limits without clashing +INFO_TARGETS = ${infodir}/eintr +DVI_TARGETS = emacs-lisp-intro.dvi + +MAKEINFO = makeinfo +TEXI2DVI = texi2dvi +DVIPS = dvips + +.SUFFIXES: .dvi .ps .texi + +info: $(INFO_TARGETS) + +dvi: $(DVI_TARGETS) + +${infodir}/eintr: ${INFO_SOURCES} + cd $(srcdir); $(MAKEINFO) emacs-lisp-intro.texi -o $(infodir)/eintr + +emacs-lisp-intro.dvi: ${INFO_SOURCES} + $(TEXI2DVI) -I $(srcdir) -I $(usermanualdir) $(srcdir)/emacs-lisp-intro.texi + +emacs-lisp-intro.html: $(INFO_SOURCES) + $(MAKEINFO) --html -o $@ $(srcdir)/emacs-lisp-intro.texi + +.dvi.ps: + $(DVIPS) $< -o $@ + +mostlyclean: + rm -f *.log *.cp *.fn *.ky *.pg *.vr *.tp + +clean: mostlyclean + rm -f *.dvi + +distclean: clean + +maintainer-clean: distclean + rm -f *.aux *.cps *.fns *.kys *.pgs *.vrs *.toc + cd $(infodir); rm -f eintr eintr-[1-9] + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/doc/lispintro/Makefile.old b/doc/lispintro/Makefile.old new file mode 100644 index 00000000000..0b4e1a82df7 --- /dev/null +++ b/doc/lispintro/Makefile.old @@ -0,0 +1,344 @@ +# Makefile.in generated automatically by automake 1.4-p4 from Makefile.am + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003, +# 2004, 2005, 2006, 2007 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +MAKEINFO = @MAKEINFO@ +PACKAGE = @PACKAGE@ +VERSION = @VERSION@ + +AUTOMAKE_OPTIONS = foreign 1.2 +info_TEXINFOS = emacs-lisp-intro.texi +EXTRA_DIST = INSTALL MANIFEST README chest-of-drawers-diagram.eps cons-cell-diagram1.eps cons-cell-diagram2.eps cons-cell-diagram2a.eps cons-cell-diagram3.eps cons-cell-diagram4.eps cons-cell-diagram5.eps lambda-diagram1.eps lambda-diagram2.eps lambda-diagram3.eps + +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_CLEAN_FILES = +TEXI2DVI = texi2dvi +INFO_DEPS = emacs-lisp-intro.info +DVIS = emacs-lisp-intro.dvi +TEXINFOS = emacs-lisp-intro.texi +DIST_COMMON = README INSTALL Makefile.am Makefile.in aclocal.m4 \ +configure configure.in install-sh missing mkinstalldirs texinfo.tex + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +all: all-redirect +.SUFFIXES: +.SUFFIXES: .dvi .info .ps .texi .texinfo .txi +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(ACLOCAL_M4): configure.in + cd $(srcdir) && $(ACLOCAL) + +config.status: $(srcdir)/configure.in $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +emacs-lisp-intro.info: emacs-lisp-intro.texi +emacs-lisp-intro.dvi: emacs-lisp-intro.texi + + +DVIPS = dvips + +.texi.info: + @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] + cd $(srcdir) \ + && $(MAKEINFO) `echo $< | sed 's,.*/,,'` + +.texi.dvi: + TEXINPUTS=.:$$TEXINPUTS \ + MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< + +.texi: + @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] + cd $(srcdir) \ + && $(MAKEINFO) `echo $< | sed 's,.*/,,'` + +.texinfo.info: + @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] + cd $(srcdir) \ + && $(MAKEINFO) `echo $< | sed 's,.*/,,'` + +.texinfo: + @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] + cd $(srcdir) \ + && $(MAKEINFO) `echo $< | sed 's,.*/,,'` + +.texinfo.dvi: + TEXINPUTS=.:$$TEXINPUTS \ + MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< + +.txi.info: + @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] + cd $(srcdir) \ + && $(MAKEINFO) `echo $< | sed 's,.*/,,'` + +.txi.dvi: + TEXINPUTS=.:$$TEXINPUTS \ + MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< + +.txi: + @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] + cd $(srcdir) \ + && $(MAKEINFO) `echo $< | sed 's,.*/,,'` +.dvi.ps: + $(DVIPS) $< -o $@ + +install-info-am: $(INFO_DEPS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(infodir) + @list='$(INFO_DEPS)'; \ + for file in $$list; do \ + d=$(srcdir); \ + for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \ + if test -f $$d/$$ifile; then \ + echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \ + $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \ + else : ; fi; \ + done; \ + done + @$(POST_INSTALL) + @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \ + list='$(INFO_DEPS)'; \ + for file in $$list; do \ + echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\ + install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\ + done; \ + else : ; fi + +uninstall-info: + $(PRE_UNINSTALL) + @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \ + ii=yes; \ + else ii=; fi; \ + list='$(INFO_DEPS)'; \ + for file in $$list; do \ + test -z "$$ii" \ + || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \ + done + @$(NORMAL_UNINSTALL) + list='$(INFO_DEPS)'; \ + for file in $$list; do \ + (cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \ + done + +dist-info: $(INFO_DEPS) + list='$(INFO_DEPS)'; \ + for base in $$list; do \ + d=$(srcdir); \ + for file in `cd $$d && eval echo $$base*`; do \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file; \ + done; \ + done + +mostlyclean-aminfo: + -rm -f emacs-lisp-intro.aux emacs-lisp-intro.cp emacs-lisp-intro.cps \ + emacs-lisp-intro.dvi emacs-lisp-intro.fn emacs-lisp-intro.fns \ + emacs-lisp-intro.ky emacs-lisp-intro.kys emacs-lisp-intro.ps \ + emacs-lisp-intro.log emacs-lisp-intro.pg emacs-lisp-intro.toc \ + emacs-lisp-intro.tp emacs-lisp-intro.tps emacs-lisp-intro.vr \ + emacs-lisp-intro.vrs emacs-lisp-intro.op emacs-lisp-intro.tr \ + emacs-lisp-intro.cv emacs-lisp-intro.cn + +clean-aminfo: + +distclean-aminfo: + +maintainer-clean-aminfo: + cd $(srcdir) && for i in $(INFO_DEPS); do \ + rm -f $$i; \ + if test "`echo $$i-[0-9]*`" != "$$i-[0-9]*"; then \ + rm -f $$i-[0-9]*; \ + fi; \ + done +tags: TAGS +TAGS: + + +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -rm -rf $(distdir) + GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \ + cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @banner="$(distdir).tar.gz is ready for distribution"; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + echo "$$dashes" +dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done + $(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info +info-am: $(INFO_DEPS) +info: info-am +dvi-am: $(DVIS) +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: install-info-am +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: uninstall-info +uninstall: uninstall-am +all-am: Makefile $(INFO_DEPS) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + $(mkinstalldirs) $(DESTDIR)$(infodir) + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-aminfo mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-aminfo clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-aminfo distclean-generic clean-am + +distclean: distclean-am + -rm -f config.status + +maintainer-clean-am: maintainer-clean-aminfo maintainer-clean-generic \ + distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + -rm -f config.status + +.PHONY: install-info-am uninstall-info mostlyclean-aminfo \ +distclean-aminfo clean-aminfo maintainer-clean-aminfo tags distdir \ +info-am info dvi-am dvi check check-am installcheck-am installcheck \ +install-exec-am install-exec install-data-am install-data install-am \ +install uninstall-am uninstall all-redirect all-am all installdirs \ +mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: + +# arch-tag: f1a44ea0-b792-4ac7-be28-9626b972c216 diff --git a/doc/lispintro/README b/doc/lispintro/README new file mode 100644 index 00000000000..5edd38af3ee --- /dev/null +++ b/doc/lispintro/README @@ -0,0 +1,84 @@ +Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 + Free Software Foundation, Inc. +See the end of the file for license conditions. + + +This directory contains the source of the "Introduction to Programming +in Emacs Lisp" written by Robert J. Chassell, bob@gnu.org. This +manual is an elementary introduction to programming in Emacs Lisp for +people who are not programmers, and who are not necessarily interested +in programming, but who do want to customize or extend their computing +environment. + +This third edition of 2006 Oct 31 updates the previous editions to GNU +Emacs 22. + +The Texinfo source file `emacs-lisp-intro.texi', formats without +reported error using `pdfeTeXk', Version 3.141592-1.21a-2.2 (Web2C +7.5.4) and texinfo.tex version 2006-08-26.17 started by `texi2dvi' +version 4.8, and with `makeinfo' version 4.8. + +Also, this tar file contains the following optional Encapsulated Post +Script figures. + + drawers.eps 7129 bytes + cons-1.eps 12136 + cons-2.eps 12523 + cons-2a.eps 12420 + cons-3.eps 12984 + cons-4.eps 13866 + cons-5.eps 12986 + lambda-1.eps 10252 + lambda-2.eps 10278 + lambda-3.eps 10275 + +See the beginning of the `emacs-lisp-intro.texi' file for appropriate +settings. These figures are not necessary; they are merely nice to +look at --- without them you get the same figures printed with ASCII +characters. + +Whether and how you print PostScript depends on your site. You not +only need to set 'print-postscript-figures' before creating the .dvi +file, but then must convert the .dvi file to .ps with a 'dvips' or +equivalent command. + +On some systems you will see an error message when `psfig.tex' is +loaded for the last two .eps files: + + ! No room for a new \write . + +If this happens, try `epsf.tex' instead of `psfig.tex', or try typing +RET at the error; the formatting may continue successfully. + +Or else find the section that says: + + @c !!! Clear print-postscript-figures if the computer formatting this + @c document is too small and cannot handle all the diagrams and figures. + @c clear print-postscript-figures + +and change the file so it reads: @clear print-postscript-figures +This will prevent TeX from attempting to load the last few .eps files. + +You will find additional instructions on formatting in the beginning +of the Texinfo file 'emacs-lisp-intro.texi'. Best Wishes! + +2006 Oct 31 +Robert J. Chassell, bob@gnu.org + + +This file is part of GNU Emacs. + +GNU Emacs is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3, or (at your option) +any later version. + +GNU Emacs is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Emacs; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. diff --git a/doc/lispintro/aclocal.m4 b/doc/lispintro/aclocal.m4 new file mode 100644 index 00000000000..fdc191af0d1 --- /dev/null +++ b/doc/lispintro/aclocal.m4 @@ -0,0 +1,105 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4-p4 + +dnl Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003, +dnl 2004, 2005, 2006, 2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN(AM_INIT_AUTOMAKE, +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN(AM_SANITY_CHECK, +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN(AM_MISSING_PROG, +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + diff --git a/doc/lispintro/configure b/doc/lispintro/configure new file mode 100755 index 00000000000..626083be946 --- /dev/null +++ b/doc/lispintro/configure @@ -0,0 +1,1044 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 2001, 2002, 2003, 2004, +# 2005, 2006, 2007 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=emacs-lisp-intro.texi + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + +ac_aux_dir= +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:556: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:609: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:666: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + + +PACKAGE=emacs-lisp-intro + +VERSION=2.00 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <<EOF +#define PACKAGE "$PACKAGE" +EOF + +cat >> confdefs.h <<EOF +#define VERSION "$VERSION" +EOF + + + +missing_dir=`cd $ac_aux_dir && pwd` +echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 +echo "configure:712: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:725: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:738: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:751: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:764: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS <<EOF +#! /bin/sh +# Generated automatically by configure. +# Run this file to recreate the current configuration. +# This directory was configured as follows, +# on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS <<EOF + +# Protect against being on the right side of a sed subst in config.status. +sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g; + s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <<EOF + +CONFIG_FILES=\${CONFIG_FILES-"Makefile"} +EOF +cat >> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <<EOF + +EOF +cat >> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/doc/lispintro/configure.in b/doc/lispintro/configure.in new file mode 100644 index 00000000000..7d60c898d01 --- /dev/null +++ b/doc/lispintro/configure.in @@ -0,0 +1,9 @@ +dnl autoconf input file for the emacs lisp intro + +AC_INIT(emacs-lisp-intro.texi) +AM_INIT_AUTOMAKE(emacs-lisp-intro, 2.00) +AC_OUTPUT(Makefile) + +m4_if(dnl Do not change this comment + arch-tag: 8d676bd8-8677-4ae0-8aa0-99bfd595b373 +)dnl diff --git a/doc/lispintro/cons-1.eps b/doc/lispintro/cons-1.eps new file mode 100644 index 00000000000..95a74dcf298 --- /dev/null +++ b/doc/lispintro/cons-1.eps @@ -0,0 +1,584 @@ +%! +%%BoundingBox: 35 711 289 757 +%%Title: cons-cell-diagram1 +%%CreationDate: Wed Mar 8 14:26:58 1995 +%%Creator: Tgif-2.16-p4 by William Chia-Wei Cheng (william@cs.UCLA.edu) +% +% Due to bugs in Transcript, the 'PS-Adobe-' stuff is omitted from line 1 +% + +% Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007 +% Free Software Foundation, Inc. +% +% This file is part of GNU Emacs. +% +% GNU Emacs is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 3, or (at your option) +% any later version. +% +% GNU Emacs is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with GNU Emacs; see the file COPYING. If not, write to +% the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +% Boston, MA 02110-1301, USA. + +/tgifdict 132 dict def +tgifdict begin + +% +% Using a zero value radius for an ellipse or an arc would result +% in a non-invertible CTM matrix which causes problem when this +% when this PostScript is wrapped inside other routines, such as +% the multi.ps package from +% ftp.ucc.su.oz.au:/pub/ps_printing/multi. You can overcome such +% error by uncommenting the sole line of the procedure below: +% +/tgif_min_radius + { +% dup 0.01 lt { pop 0.01 } if + } bind def + +/tgifellipsedict 6 dict def +tgifellipsedict /mtrx matrix put + +/tgifellipse + { tgifellipsedict begin + /yrad exch def + /xrad exch def + /y exch def + /x exch def + /savematrix mtrx currentmatrix def + x y translate + xrad yrad scale + 0 0 1 0 360 arc + savematrix setmatrix + end + } def + +/tgifarrowtipdict 8 dict def +tgifarrowtipdict /mtrx matrix put + +/tgifarrowtip + { tgifarrowtipdict begin + /dy exch def + /dx exch def + /h exch def + /w exch def + /y exch def + /x exch def + /savematrix mtrx currentmatrix def + x y translate + dy dx atan rotate + 0 0 moveto + w neg h lineto + w neg h neg lineto + savematrix setmatrix + end + } def + +/tgifarcdict 8 dict def +tgifarcdict /mtrx matrix put + +/tgifarcn + { tgifarcdict begin + /endangle exch def + /startangle exch def + /yrad exch def + /xrad exch def + /y exch def + /x exch def + /savematrix mtrx currentmatrix def + x y translate + xrad yrad scale + 0 0 1 startangle endangle arc + savematrix setmatrix + end + } def + +/tgifarc + { tgifarcdict begin + /endangle exch def + /startangle exch def + /yrad exch def + /xrad exch def + /y exch def + /x exch def + /savematrix mtrx currentmatrix def + x y translate + xrad yrad scale + 0 0 1 startangle endangle arcn + savematrix setmatrix + end + } def + +/tgifsetuserscreendict 22 dict def +tgifsetuserscreendict begin + /tempctm matrix def + /temprot matrix def + /tempscale matrix def + + /concatprocs + { /proc2 exch cvlit def + /proc1 exch cvlit def + /newproc proc1 length proc2 length add array def + newproc 0 proc1 putinterval + newproc proc1 length proc2 putinterval + newproc cvx + } def + /resmatrix matrix def + /findresolution + { 72 0 resmatrix defaultmatrix dtransform + /yres exch def /xres exch def + xres dup mul yres dup mul add sqrt + } def +end + +/tgifsetuserscreen + { tgifsetuserscreendict begin + /spotfunction exch def + /screenangle exch def + /cellsize exch def + + /m tempctm currentmatrix def + /rm screenangle temprot rotate def + /sm cellsize dup tempscale scale def + + sm rm m m concatmatrix m concatmatrix pop + + 1 0 m dtransform /y1 exch def /x1 exch def + + /veclength x1 dup mul y1 dup mul add sqrt def + /frequency findresolution veclength div def + + /newscreenangle y1 x1 atan def + + m 2 get m 1 get mul m 0 get m 3 get mul sub 0 gt + + {{neg} /spotfunction load concatprocs + /spotfunction exch def + } if + + frequency newscreenangle /spotfunction load setscreen + end + } def + +/tgifsetpatterndict 18 dict def +tgifsetpatterndict begin + /bitison + { /ybit exch def /xbit exch def + /bytevalue bstring ybit bwidth mul xbit 8 idiv add get def + + /mask 1 7 xbit 8 mod sub bitshift def + bytevalue mask and 0 ne + } def +end + +/tgifbitpatternspotfunction + { tgifsetpatterndict begin + /y exch def /x exch def + + /xindex x 1 add 2 div bpside mul cvi def + /yindex y 1 add 2 div bpside mul cvi def + + xindex yindex bitison + { /onbits onbits 1 add def 1 } + { /offbits offbits 1 add def 0 } + ifelse + end + } def + +/tgifsetpattern + { tgifsetpatterndict begin + /cellsz exch def + /angle exch def + /bwidth exch def + /bpside exch def + /bstring exch def + + /onbits 0 def /offbits 0 def + cellsz angle /tgifbitpatternspotfunction load tgifsetuserscreen + {} settransfer + offbits offbits onbits add div setgray + end + } def + +/tgifxpmdict 4 dict def +/tgifbwpicstr 1 string def +/tgifcolorpicstr 3 string def + +/tgifsetpixels { tgifxpmdict begin /pixels exch def end } def + +/tgifsetpix { tgifxpmdict begin pixels 3 1 roll putinterval end } def + +/tgifbwspot + { tgifxpmdict begin + /index exch def + tgifbwpicstr 0 + pixels index 3 mul 3 getinterval aload pop + 255 mul .114 mul exch 255 mul .587 mul add exch 255 mul .299 mul add + cvi put + tgifbwpicstr + end + } def + +/tgifcolorspot + { tgifxpmdict begin + /index exch def + pixels index 3 mul 3 getinterval aload pop + 255 mul cvi tgifcolorpicstr 2 3 -1 roll put + 255 mul cvi tgifcolorpicstr 1 3 -1 roll put + 255 mul cvi tgifcolorpicstr 0 3 -1 roll put + tgifcolorpicstr + end + } def + +/tgifnewcolorspot + { tgifxpmdict begin + /index exch def + pixels index 3 mul 3 getinterval aload pop setrgbcolor + end + } def + +/tgifcolordict 4 dict def + +/colorimage where + { pop } + { /colorimage + { tgifcolordict begin + pop pop pop pop pop + /ih exch def + /iw exch def + /x 0 def + /y 0 def + 1 1 ih + { pop 1 1 iw + { pop currentfile + tgifbwpicstr readhexstring pop 0 get tgifnewcolorspot + x y moveto 1 0 rlineto 0 1 rlineto -1 0 rlineto + closepath fill + /x x 1 add def + } for + /y y 1 add def + /x 0 def + } for + end + } def + } ifelse + +/tgifpatdict 10 dict def + +/tgifpatbyte + { currentdict /retstr get exch + pat i cellsz mod get put + } def + +/tgifpatproc + { 0 1 widthlim {tgifpatbyte} for retstr + /i i 1 add def + } def + +/tgifpatfill + { tgifpatdict begin + /h exch def + /w exch def + /lty exch def + /ltx exch def + /cellsz exch def + /pat exch def + + /widthlim w cellsz div cvi 1 sub def + /retstr widthlim 1 add string def + /i 0 def + + ltx lty translate + w h true [1 0 0 1 0 0] {tgifpatproc} imagemask + ltx neg lty neg translate + end + } def + +/pat1 <ffffffffffffffff> def +/pat2 <0000000000000000> def +/pat3 <8000000008000000> def +/pat4 <8800000022000000> def +/pat5 <8800220088002200> def +/pat6 <8822882288228822> def +/pat7 <aa55aa55aa55aa55> def +/pat8 <77dd77dd77dd77dd> def +/pat9 <77ffddff77ffddff> def +/pat10 <77ffffff77ffffff> def +/pat11 <7fffffff7fffffff> def +/pat12 <8040200002040800> def +/pat13 <40a00000040a0000> def +/pat14 <ff888888ff888888> def +/pat15 <ff808080ff080808> def +/pat16 <f87422478f172271> def +/pat17 <038448300c020101> def +/pat18 <081c22c180010204> def +/pat19 <8080413e080814e3> def +/pat20 <8040201008040201> def +/pat21 <8844221188442211> def +/pat22 <77bbddee77bbddee> def +/pat23 <c1e070381c0e0783> def +/pat24 <7fbfdfeff7fbfdfe> def +/pat25 <3e1f8fc7e3f1f87c> def +/pat26 <0102040810204080> def +/pat27 <1122448811224488> def +/pat28 <eeddbb77eeddbb77> def +/pat29 <83070e1c3870e0c1> def +/pat30 <fefdfbf7efdfbf7f> def +/pat31 <7cf8f1e3c78f1f3e> def + +/tgifcentertext { dup stringwidth pop 2 div neg 0 rmoveto } def + +/tgifrighttext { dup stringwidth pop neg 0 rmoveto } def + +/tgifreencsmalldict 12 dict def +/tgifReEncodeSmall + { tgifreencsmalldict begin + /newcodesandnames exch def + /newfontname exch def + /basefontname exch def + + /basefontdict basefontname findfont def + /newfont basefontdict maxlength dict def + + basefontdict + { exch dup /FID ne + { dup /Encoding eq + { exch dup length array copy newfont 3 1 roll put } + { exch newfont 3 1 roll put } + ifelse + } + { pop pop } + ifelse + } + forall + + newfont /FontName newfontname put + newcodesandnames aload pop + + newcodesandnames length 2 idiv + { newfont /Encoding get 3 1 roll put} + repeat + + newfontname newfont definefont pop + end + } def + +/tgifgray { 8 1 0 72 300 32 div div tgifsetpattern } bind def + +/tgifboxdict 6 dict def +/tgifboxstroke + { tgifboxdict begin + /pat def /w def /y2 exch def /x2 exch def /y1 exch def /x1 exch def + 1.415 setmiterlimit + w 1 eq { w setlinewidth } if + pat pat1 ne pat pat2 ne and { gsave pat tgifgray } if + newpath x1 y1 moveto x2 y1 lineto x2 y2 lineto x1 y2 lineto closepath + pat pat2 eq { 1 setgray stroke 0 setgray } { stroke } ifelse + pat pat1 ne pat pat2 ne and { grestore } if + w 1 eq { 1 setlinewidth } if + 1 setmiterlimit + end + } def +/tgifboxfill + { tgifboxdict begin + /pat def /y2 exch def /x2 exch def /y1 exch def /x1 exch def + pat pat1 ne pat pat2 ne and { gsave pat tgifgray } if + newpath x1 y1 moveto x2 y1 lineto x2 y2 lineto x1 y2 lineto closepath + pat pat2 eq { 1 setgray fill 0 setgray } { fill } ifelse + pat pat1 ne pat pat2 ne and { grestore } if + end + } def + +end + +%%PageBoundingBox: 35 711 289 757 +tgifdict begin +/tgifsavedpage save def + +1 setmiterlimit +1 setlinewidth + +0 setgray + +72 0 mul 72 11.00 mul translate +72 128 div 100 mul 100 div dup neg scale + +gsave + +% BOX +gsave + 1.415 setmiterlimit + newpath + 66 66 moveto 130 66 lineto 130 98 lineto 66 98 lineto + closepath stroke + 1 setmiterlimit +grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 98 66 moveto + 98 98 lineto + stroke +grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 114 82 moveto + 0 80 atan dup cos 8 mul 194 exch sub + exch sin 8 mul 82 exch sub lineto + stroke +grestore +gsave + newpath + 194 82 8 3 80 0 tgifarrowtip + closepath fill +grestore + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 146 136 moveto (rose) show + grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 82 82 moveto + 82 131 lineto + 0 48 atan dup cos 8 mul 130 exch sub + exch sin 8 mul 131 exch sub lineto + stroke +grestore +gsave + newpath + 130 131 8 3 48 0 tgifarrowtip + closepath fill +grestore + +% BOX +gsave + 1.415 setmiterlimit + newpath + 199 66 moveto 263 66 lineto 263 98 lineto 199 98 lineto + closepath stroke + 1 setmiterlimit +grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 231 66 moveto + 231 98 lineto + stroke +grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 247 82 moveto + 0 93 atan dup cos 8 mul 340 exch sub + exch sin 8 mul 82 exch sub lineto + stroke +grestore +gsave + newpath + 340 82 8 3 93 0 tgifarrowtip + closepath fill +grestore + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 279 136 moveto (violet) show + grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 215 82 moveto + 215 131 lineto + 0 48 atan dup cos 8 mul 263 exch sub + exch sin 8 mul 131 exch sub lineto + stroke +grestore +gsave + newpath + 263 131 8 3 48 0 tgifarrowtip + closepath fill +grestore + +% BOX +gsave + 1.415 setmiterlimit + newpath + 342 64 moveto 406 64 lineto 406 96 lineto 342 96 lineto + closepath stroke + 1 setmiterlimit +grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 373 64 moveto + 373 96 lineto + stroke +grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 389 81 moveto + 0 48 atan dup cos 8 mul 437 exch sub + exch sin 8 mul 81 exch sub lineto + stroke +grestore +gsave + newpath + 437 81 8 3 48 0 tgifarrowtip + closepath fill +grestore + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 421 135 moveto (buttercup) show + grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 357 81 moveto + 357 130 lineto + 0 48 atan dup cos 8 mul 405 exch sub + exch sin 8 mul 130 exch sub lineto + stroke +grestore +gsave + newpath + 405 130 8 3 48 0 tgifarrowtip + closepath fill +grestore + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 449 87 moveto (nil) show + grestore + +grestore +tgifsavedpage restore +end +%MatchingCreationDate: Wed Mar 8 14:26:58 1995 diff --git a/doc/lispintro/cons-2.eps b/doc/lispintro/cons-2.eps new file mode 100644 index 00000000000..b8537d28ea8 --- /dev/null +++ b/doc/lispintro/cons-2.eps @@ -0,0 +1,606 @@ +%! +%%BoundingBox: 15 712 321 775 +%%Title: cons-cell-diagram2 +%%CreationDate: Wed Mar 8 14:26:39 1995 +%%Creator: Tgif-2.16-p4 by William Chia-Wei Cheng (william@cs.UCLA.edu) +% +% Due to bugs in Transcript, the 'PS-Adobe-' stuff is omitted from line 1 +% + +% Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007 +% Free Software Foundation, Inc. +% +% This file is part of GNU Emacs. +% +% GNU Emacs is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 3, or (at your option) +% any later version. +% +% GNU Emacs is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with GNU Emacs; see the file COPYING. If not, write to +% the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +% Boston, MA 02110-1301, USA. + +/tgifdict 132 dict def +tgifdict begin + +% +% Using a zero value radius for an ellipse or an arc would result +% in a non-invertible CTM matrix which causes problem when this +% when this PostScript is wrapped inside other routines, such as +% the multi.ps package from +% ftp.ucc.su.oz.au:/pub/ps_printing/multi. You can overcome such +% error by uncommenting the sole line of the procedure below: +% +/tgif_min_radius + { +% dup 0.01 lt { pop 0.01 } if + } bind def + +/tgifellipsedict 6 dict def +tgifellipsedict /mtrx matrix put + +/tgifellipse + { tgifellipsedict begin + /yrad exch def + /xrad exch def + /y exch def + /x exch def + /savematrix mtrx currentmatrix def + x y translate + xrad yrad scale + 0 0 1 0 360 arc + savematrix setmatrix + end + } def + +/tgifarrowtipdict 8 dict def +tgifarrowtipdict /mtrx matrix put + +/tgifarrowtip + { tgifarrowtipdict begin + /dy exch def + /dx exch def + /h exch def + /w exch def + /y exch def + /x exch def + /savematrix mtrx currentmatrix def + x y translate + dy dx atan rotate + 0 0 moveto + w neg h lineto + w neg h neg lineto + savematrix setmatrix + end + } def + +/tgifarcdict 8 dict def +tgifarcdict /mtrx matrix put + +/tgifarcn + { tgifarcdict begin + /endangle exch def + /startangle exch def + /yrad exch def + /xrad exch def + /y exch def + /x exch def + /savematrix mtrx currentmatrix def + x y translate + xrad yrad scale + 0 0 1 startangle endangle arc + savematrix setmatrix + end + } def + +/tgifarc + { tgifarcdict begin + /endangle exch def + /startangle exch def + /yrad exch def + /xrad exch def + /y exch def + /x exch def + /savematrix mtrx currentmatrix def + x y translate + xrad yrad scale + 0 0 1 startangle endangle arcn + savematrix setmatrix + end + } def + +/tgifsetuserscreendict 22 dict def +tgifsetuserscreendict begin + /tempctm matrix def + /temprot matrix def + /tempscale matrix def + + /concatprocs + { /proc2 exch cvlit def + /proc1 exch cvlit def + /newproc proc1 length proc2 length add array def + newproc 0 proc1 putinterval + newproc proc1 length proc2 putinterval + newproc cvx + } def + /resmatrix matrix def + /findresolution + { 72 0 resmatrix defaultmatrix dtransform + /yres exch def /xres exch def + xres dup mul yres dup mul add sqrt + } def +end + +/tgifsetuserscreen + { tgifsetuserscreendict begin + /spotfunction exch def + /screenangle exch def + /cellsize exch def + + /m tempctm currentmatrix def + /rm screenangle temprot rotate def + /sm cellsize dup tempscale scale def + + sm rm m m concatmatrix m concatmatrix pop + + 1 0 m dtransform /y1 exch def /x1 exch def + + /veclength x1 dup mul y1 dup mul add sqrt def + /frequency findresolution veclength div def + + /newscreenangle y1 x1 atan def + + m 2 get m 1 get mul m 0 get m 3 get mul sub 0 gt + + {{neg} /spotfunction load concatprocs + /spotfunction exch def + } if + + frequency newscreenangle /spotfunction load setscreen + end + } def + +/tgifsetpatterndict 18 dict def +tgifsetpatterndict begin + /bitison + { /ybit exch def /xbit exch def + /bytevalue bstring ybit bwidth mul xbit 8 idiv add get def + + /mask 1 7 xbit 8 mod sub bitshift def + bytevalue mask and 0 ne + } def +end + +/tgifbitpatternspotfunction + { tgifsetpatterndict begin + /y exch def /x exch def + + /xindex x 1 add 2 div bpside mul cvi def + /yindex y 1 add 2 div bpside mul cvi def + + xindex yindex bitison + { /onbits onbits 1 add def 1 } + { /offbits offbits 1 add def 0 } + ifelse + end + } def + +/tgifsetpattern + { tgifsetpatterndict begin + /cellsz exch def + /angle exch def + /bwidth exch def + /bpside exch def + /bstring exch def + + /onbits 0 def /offbits 0 def + cellsz angle /tgifbitpatternspotfunction load tgifsetuserscreen + {} settransfer + offbits offbits onbits add div setgray + end + } def + +/tgifxpmdict 4 dict def +/tgifbwpicstr 1 string def +/tgifcolorpicstr 3 string def + +/tgifsetpixels { tgifxpmdict begin /pixels exch def end } def + +/tgifsetpix { tgifxpmdict begin pixels 3 1 roll putinterval end } def + +/tgifbwspot + { tgifxpmdict begin + /index exch def + tgifbwpicstr 0 + pixels index 3 mul 3 getinterval aload pop + 255 mul .114 mul exch 255 mul .587 mul add exch 255 mul .299 mul add + cvi put + tgifbwpicstr + end + } def + +/tgifcolorspot + { tgifxpmdict begin + /index exch def + pixels index 3 mul 3 getinterval aload pop + 255 mul cvi tgifcolorpicstr 2 3 -1 roll put + 255 mul cvi tgifcolorpicstr 1 3 -1 roll put + 255 mul cvi tgifcolorpicstr 0 3 -1 roll put + tgifcolorpicstr + end + } def + +/tgifnewcolorspot + { tgifxpmdict begin + /index exch def + pixels index 3 mul 3 getinterval aload pop setrgbcolor + end + } def + +/tgifcolordict 4 dict def + +/colorimage where + { pop } + { /colorimage + { tgifcolordict begin + pop pop pop pop pop + /ih exch def + /iw exch def + /x 0 def + /y 0 def + 1 1 ih + { pop 1 1 iw + { pop currentfile + tgifbwpicstr readhexstring pop 0 get tgifnewcolorspot + x y moveto 1 0 rlineto 0 1 rlineto -1 0 rlineto + closepath fill + /x x 1 add def + } for + /y y 1 add def + /x 0 def + } for + end + } def + } ifelse + +/tgifpatdict 10 dict def + +/tgifpatbyte + { currentdict /retstr get exch + pat i cellsz mod get put + } def + +/tgifpatproc + { 0 1 widthlim {tgifpatbyte} for retstr + /i i 1 add def + } def + +/tgifpatfill + { tgifpatdict begin + /h exch def + /w exch def + /lty exch def + /ltx exch def + /cellsz exch def + /pat exch def + + /widthlim w cellsz div cvi 1 sub def + /retstr widthlim 1 add string def + /i 0 def + + ltx lty translate + w h true [1 0 0 1 0 0] {tgifpatproc} imagemask + ltx neg lty neg translate + end + } def + +/pat1 <ffffffffffffffff> def +/pat2 <0000000000000000> def +/pat3 <8000000008000000> def +/pat4 <8800000022000000> def +/pat5 <8800220088002200> def +/pat6 <8822882288228822> def +/pat7 <aa55aa55aa55aa55> def +/pat8 <77dd77dd77dd77dd> def +/pat9 <77ffddff77ffddff> def +/pat10 <77ffffff77ffffff> def +/pat11 <7fffffff7fffffff> def +/pat12 <8040200002040800> def +/pat13 <40a00000040a0000> def +/pat14 <ff888888ff888888> def +/pat15 <ff808080ff080808> def +/pat16 <f87422478f172271> def +/pat17 <038448300c020101> def +/pat18 <081c22c180010204> def +/pat19 <8080413e080814e3> def +/pat20 <8040201008040201> def +/pat21 <8844221188442211> def +/pat22 <77bbddee77bbddee> def +/pat23 <c1e070381c0e0783> def +/pat24 <7fbfdfeff7fbfdfe> def +/pat25 <3e1f8fc7e3f1f87c> def +/pat26 <0102040810204080> def +/pat27 <1122448811224488> def +/pat28 <eeddbb77eeddbb77> def +/pat29 <83070e1c3870e0c1> def +/pat30 <fefdfbf7efdfbf7f> def +/pat31 <7cf8f1e3c78f1f3e> def + +/tgifcentertext { dup stringwidth pop 2 div neg 0 rmoveto } def + +/tgifrighttext { dup stringwidth pop neg 0 rmoveto } def + +/tgifreencsmalldict 12 dict def +/tgifReEncodeSmall + { tgifreencsmalldict begin + /newcodesandnames exch def + /newfontname exch def + /basefontname exch def + + /basefontdict basefontname findfont def + /newfont basefontdict maxlength dict def + + basefontdict + { exch dup /FID ne + { dup /Encoding eq + { exch dup length array copy newfont 3 1 roll put } + { exch newfont 3 1 roll put } + ifelse + } + { pop pop } + ifelse + } + forall + + newfont /FontName newfontname put + newcodesandnames aload pop + + newcodesandnames length 2 idiv + { newfont /Encoding get 3 1 roll put} + repeat + + newfontname newfont definefont pop + end + } def + +/tgifgray { 8 1 0 72 300 32 div div tgifsetpattern } bind def + +/tgifboxdict 6 dict def +/tgifboxstroke + { tgifboxdict begin + /pat def /w def /y2 exch def /x2 exch def /y1 exch def /x1 exch def + 1.415 setmiterlimit + w 1 eq { w setlinewidth } if + pat pat1 ne pat pat2 ne and { gsave pat tgifgray } if + newpath x1 y1 moveto x2 y1 lineto x2 y2 lineto x1 y2 lineto closepath + pat pat2 eq { 1 setgray stroke 0 setgray } { stroke } ifelse + pat pat1 ne pat pat2 ne and { grestore } if + w 1 eq { 1 setlinewidth } if + 1 setmiterlimit + end + } def +/tgifboxfill + { tgifboxdict begin + /pat def /y2 exch def /x2 exch def /y1 exch def /x1 exch def + pat pat1 ne pat pat2 ne and { gsave pat tgifgray } if + newpath x1 y1 moveto x2 y1 lineto x2 y2 lineto x1 y2 lineto closepath + pat pat2 eq { 1 setgray fill 0 setgray } { fill } ifelse + pat pat1 ne pat pat2 ne and { grestore } if + end + } def + +end + +%%PageBoundingBox: 15 712 321 775 +tgifdict begin +/tgifsavedpage save def + +1 setmiterlimit +1 setlinewidth + +0 setgray + +72 0 mul 72 11.00 mul translate +72 128 div 100 mul 100 div dup neg scale + +gsave + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 32 47 moveto (bouquet) show + grestore + +% BOX +gsave + 1.415 setmiterlimit + newpath + 122 65 moveto 186 65 lineto 186 97 lineto 122 97 lineto + closepath stroke + 1 setmiterlimit +grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 154 65 moveto + 154 97 lineto + stroke +grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 170 81 moveto + 0 80 atan dup cos 8 mul 250 exch sub + exch sin 8 mul 81 exch sub lineto + stroke +grestore +gsave + newpath + 250 81 8 3 80 0 tgifarrowtip + closepath fill +grestore + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 202 135 moveto (rose) show + grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 138 81 moveto + 138 130 lineto + 0 48 atan dup cos 8 mul 186 exch sub + exch sin 8 mul 130 exch sub lineto + stroke +grestore +gsave + newpath + 186 130 8 3 48 0 tgifarrowtip + closepath fill +grestore + +% BOX +gsave + 1.415 setmiterlimit + newpath + 255 65 moveto 319 65 lineto 319 97 lineto 255 97 lineto + closepath stroke + 1 setmiterlimit +grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 287 65 moveto + 287 97 lineto + stroke +grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 303 81 moveto + 0 93 atan dup cos 8 mul 396 exch sub + exch sin 8 mul 81 exch sub lineto + stroke +grestore +gsave + newpath + 396 81 8 3 93 0 tgifarrowtip + closepath fill +grestore + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 335 135 moveto (violet) show + grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 271 81 moveto + 271 130 lineto + 0 48 atan dup cos 8 mul 319 exch sub + exch sin 8 mul 130 exch sub lineto + stroke +grestore +gsave + newpath + 319 130 8 3 48 0 tgifarrowtip + closepath fill +grestore + +% BOX +gsave + 1.415 setmiterlimit + newpath + 398 63 moveto 462 63 lineto 462 95 lineto 398 95 lineto + closepath stroke + 1 setmiterlimit +grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 429 63 moveto + 429 95 lineto + stroke +grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 445 80 moveto + 0 48 atan dup cos 8 mul 493 exch sub + exch sin 8 mul 80 exch sub lineto + stroke +grestore +gsave + newpath + 493 80 8 3 48 0 tgifarrowtip + closepath fill +grestore + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 477 134 moveto (buttercup) show + grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 413 80 moveto + 413 129 lineto + 0 48 atan dup cos 8 mul 461 exch sub + exch sin 8 mul 129 exch sub lineto + stroke +grestore +gsave + newpath + 461 129 8 3 48 0 tgifarrowtip + closepath fill +grestore + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 505 86 moveto (nil) show + grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 66 53 moveto + 66 81 lineto + 0 46 atan dup cos 8 mul 112 exch sub + exch sin 8 mul 81 exch sub lineto + stroke +grestore +gsave + newpath + 112 81 8 3 46 0 tgifarrowtip + closepath fill +grestore + +grestore +tgifsavedpage restore +end +%MatchingCreationDate: Wed Mar 8 14:26:39 1995 diff --git a/doc/lispintro/cons-2a.eps b/doc/lispintro/cons-2a.eps new file mode 100644 index 00000000000..1ec78c46f0b --- /dev/null +++ b/doc/lispintro/cons-2a.eps @@ -0,0 +1,600 @@ +%! +%%BoundingBox: 15 702 300 767 +%%Title: cons-cell-diagram2a +%%CreationDate: Tue Mar 14 15:09:30 1995 +%%Creator: Tgif-2.16-p4 by William Chia-Wei Cheng (william@cs.UCLA.edu) +% +% Due to bugs in Transcript, the 'PS-Adobe-' stuff is omitted from line 1 +% + +% Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007 +% Free Software Foundation, Inc. +% +% This file is part of GNU Emacs. +% +% GNU Emacs is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 3, or (at your option) +% any later version. +% +% GNU Emacs is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with GNU Emacs; see the file COPYING. If not, write to +% the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +% Boston, MA 02110-1301, USA. + +/tgifdict 132 dict def +tgifdict begin + +% +% Using a zero value radius for an ellipse or an arc would result +% in a non-invertible CTM matrix which causes problem when this +% when this PostScript is wrapped inside other routines, such as +% the multi.ps package from +% ftp.ucc.su.oz.au:/pub/ps_printing/multi. You can overcome such +% error by uncommenting the sole line of the procedure below: +% +/tgif_min_radius + { +% dup 0.01 lt { pop 0.01 } if + } bind def + +/tgifellipsedict 6 dict def +tgifellipsedict /mtrx matrix put + +/tgifellipse + { tgifellipsedict begin + /yrad exch def + /xrad exch def + /y exch def + /x exch def + /savematrix mtrx currentmatrix def + x y translate + xrad yrad scale + 0 0 1 0 360 arc + savematrix setmatrix + end + } def + +/tgifarrowtipdict 8 dict def +tgifarrowtipdict /mtrx matrix put + +/tgifarrowtip + { tgifarrowtipdict begin + /dy exch def + /dx exch def + /h exch def + /w exch def + /y exch def + /x exch def + /savematrix mtrx currentmatrix def + x y translate + dy dx atan rotate + 0 0 moveto + w neg h lineto + w neg h neg lineto + savematrix setmatrix + end + } def + +/tgifarcdict 8 dict def +tgifarcdict /mtrx matrix put + +/tgifarcn + { tgifarcdict begin + /endangle exch def + /startangle exch def + /yrad exch def + /xrad exch def + /y exch def + /x exch def + /savematrix mtrx currentmatrix def + x y translate + xrad yrad scale + 0 0 1 startangle endangle arc + savematrix setmatrix + end + } def + +/tgifarc + { tgifarcdict begin + /endangle exch def + /startangle exch def + /yrad exch def + /xrad exch def + /y exch def + /x exch def + /savematrix mtrx currentmatrix def + x y translate + xrad yrad scale + 0 0 1 startangle endangle arcn + savematrix setmatrix + end + } def + +/tgifsetuserscreendict 22 dict def +tgifsetuserscreendict begin + /tempctm matrix def + /temprot matrix def + /tempscale matrix def + + /concatprocs + { /proc2 exch cvlit def + /proc1 exch cvlit def + /newproc proc1 length proc2 length add array def + newproc 0 proc1 putinterval + newproc proc1 length proc2 putinterval + newproc cvx + } def + /resmatrix matrix def + /findresolution + { 72 0 resmatrix defaultmatrix dtransform + /yres exch def /xres exch def + xres dup mul yres dup mul add sqrt + } def +end + +/tgifsetuserscreen + { tgifsetuserscreendict begin + /spotfunction exch def + /screenangle exch def + /cellsize exch def + + /m tempctm currentmatrix def + /rm screenangle temprot rotate def + /sm cellsize dup tempscale scale def + + sm rm m m concatmatrix m concatmatrix pop + + 1 0 m dtransform /y1 exch def /x1 exch def + + /veclength x1 dup mul y1 dup mul add sqrt def + /frequency findresolution veclength div def + + /newscreenangle y1 x1 atan def + + m 2 get m 1 get mul m 0 get m 3 get mul sub 0 gt + + {{neg} /spotfunction load concatprocs + /spotfunction exch def + } if + + frequency newscreenangle /spotfunction load setscreen + end + } def + +/tgifsetpatterndict 18 dict def +tgifsetpatterndict begin + /bitison + { /ybit exch def /xbit exch def + /bytevalue bstring ybit bwidth mul xbit 8 idiv add get def + + /mask 1 7 xbit 8 mod sub bitshift def + bytevalue mask and 0 ne + } def +end + +/tgifbitpatternspotfunction + { tgifsetpatterndict begin + /y exch def /x exch def + + /xindex x 1 add 2 div bpside mul cvi def + /yindex y 1 add 2 div bpside mul cvi def + + xindex yindex bitison + { /onbits onbits 1 add def 1 } + { /offbits offbits 1 add def 0 } + ifelse + end + } def + +/tgifsetpattern + { tgifsetpatterndict begin + /cellsz exch def + /angle exch def + /bwidth exch def + /bpside exch def + /bstring exch def + + /onbits 0 def /offbits 0 def + cellsz angle /tgifbitpatternspotfunction load tgifsetuserscreen + {} settransfer + offbits offbits onbits add div setgray + end + } def + +/tgifxpmdict 4 dict def +/tgifbwpicstr 1 string def +/tgifcolorpicstr 3 string def + +/tgifsetpixels { tgifxpmdict begin /pixels exch def end } def + +/tgifsetpix { tgifxpmdict begin pixels 3 1 roll putinterval end } def + +/tgifbwspot + { tgifxpmdict begin + /index exch def + tgifbwpicstr 0 + pixels index 3 mul 3 getinterval aload pop + 255 mul .114 mul exch 255 mul .587 mul add exch 255 mul .299 mul add + cvi put + tgifbwpicstr + end + } def + +/tgifcolorspot + { tgifxpmdict begin + /index exch def + pixels index 3 mul 3 getinterval aload pop + 255 mul cvi tgifcolorpicstr 2 3 -1 roll put + 255 mul cvi tgifcolorpicstr 1 3 -1 roll put + 255 mul cvi tgifcolorpicstr 0 3 -1 roll put + tgifcolorpicstr + end + } def + +/tgifnewcolorspot + { tgifxpmdict begin + /index exch def + pixels index 3 mul 3 getinterval aload pop setrgbcolor + end + } def + +/tgifcolordict 4 dict def + +/colorimage where + { pop } + { /colorimage + { tgifcolordict begin + pop pop pop pop pop + /ih exch def + /iw exch def + /x 0 def + /y 0 def + 1 1 ih + { pop 1 1 iw + { pop currentfile + tgifbwpicstr readhexstring pop 0 get tgifnewcolorspot + x y moveto 1 0 rlineto 0 1 rlineto -1 0 rlineto + closepath fill + /x x 1 add def + } for + /y y 1 add def + /x 0 def + } for + end + } def + } ifelse + +/tgifpatdict 10 dict def + +/tgifpatbyte + { currentdict /retstr get exch + pat i cellsz mod get put + } def + +/tgifpatproc + { 0 1 widthlim {tgifpatbyte} for retstr + /i i 1 add def + } def + +/tgifpatfill + { tgifpatdict begin + /h exch def + /w exch def + /lty exch def + /ltx exch def + /cellsz exch def + /pat exch def + + /widthlim w cellsz div cvi 1 sub def + /retstr widthlim 1 add string def + /i 0 def + + ltx lty translate + w h true [1 0 0 1 0 0] {tgifpatproc} imagemask + ltx neg lty neg translate + end + } def + +/pat1 <ffffffffffffffff> def +/pat2 <0000000000000000> def +/pat3 <8000000008000000> def +/pat4 <8800000022000000> def +/pat5 <8800220088002200> def +/pat6 <8822882288228822> def +/pat7 <aa55aa55aa55aa55> def +/pat8 <77dd77dd77dd77dd> def +/pat9 <77ffddff77ffddff> def +/pat10 <77ffffff77ffffff> def +/pat11 <7fffffff7fffffff> def +/pat12 <8040200002040800> def +/pat13 <40a00000040a0000> def +/pat14 <ff888888ff888888> def +/pat15 <ff808080ff080808> def +/pat16 <f87422478f172271> def +/pat17 <038448300c020101> def +/pat18 <081c22c180010204> def +/pat19 <8080413e080814e3> def +/pat20 <8040201008040201> def +/pat21 <8844221188442211> def +/pat22 <77bbddee77bbddee> def +/pat23 <c1e070381c0e0783> def +/pat24 <7fbfdfeff7fbfdfe> def +/pat25 <3e1f8fc7e3f1f87c> def +/pat26 <0102040810204080> def +/pat27 <1122448811224488> def +/pat28 <eeddbb77eeddbb77> def +/pat29 <83070e1c3870e0c1> def +/pat30 <fefdfbf7efdfbf7f> def +/pat31 <7cf8f1e3c78f1f3e> def + +/tgifcentertext { dup stringwidth pop 2 div neg 0 rmoveto } def + +/tgifrighttext { dup stringwidth pop neg 0 rmoveto } def + +/tgifreencsmalldict 12 dict def +/tgifReEncodeSmall + { tgifreencsmalldict begin + /newcodesandnames exch def + /newfontname exch def + /basefontname exch def + + /basefontdict basefontname findfont def + /newfont basefontdict maxlength dict def + + basefontdict + { exch dup /FID ne + { dup /Encoding eq + { exch dup length array copy newfont 3 1 roll put } + { exch newfont 3 1 roll put } + ifelse + } + { pop pop } + ifelse + } + forall + + newfont /FontName newfontname put + newcodesandnames aload pop + + newcodesandnames length 2 idiv + { newfont /Encoding get 3 1 roll put} + repeat + + newfontname newfont definefont pop + end + } def + +/tgifgray { 8 1 0 72 300 32 div div tgifsetpattern } bind def + +/tgifboxdict 6 dict def +/tgifboxstroke + { tgifboxdict begin + /pat def /w def /y2 exch def /x2 exch def /y1 exch def /x1 exch def + 1.415 setmiterlimit + w 1 eq { w setlinewidth } if + pat pat1 ne pat pat2 ne and { gsave pat tgifgray } if + newpath x1 y1 moveto x2 y1 lineto x2 y2 lineto x1 y2 lineto closepath + pat pat2 eq { 1 setgray stroke 0 setgray } { stroke } ifelse + pat pat1 ne pat pat2 ne and { grestore } if + w 1 eq { 1 setlinewidth } if + 1 setmiterlimit + end + } def +/tgifboxfill + { tgifboxdict begin + /pat def /y2 exch def /x2 exch def /y1 exch def /x1 exch def + pat pat1 ne pat pat2 ne and { gsave pat tgifgray } if + newpath x1 y1 moveto x2 y1 lineto x2 y2 lineto x1 y2 lineto closepath + pat pat2 eq { 1 setgray fill 0 setgray } { fill } ifelse + pat pat1 ne pat pat2 ne and { grestore } if + end + } def + +end + +%%PageBoundingBox: 15 702 300 767 +tgifdict begin +/tgifsavedpage save def + +1 setmiterlimit +1 setlinewidth + +0 setgray + +72 0 mul 72 11.00 mul translate +72 128 div 100 mul 100 div dup neg scale + +gsave + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 32 62 moveto (bouquet) show + grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 64 80 moveto + 64 120 lineto + 0 49 atan dup cos 8 mul 113 exch sub + exch sin 8 mul 120 exch sub lineto + stroke +grestore +gsave + newpath + 113 120 8 3 49 0 tgifarrowtip + closepath fill +grestore + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 128 110 moveto (car) show + grestore + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 128 142 moveto (rose) show + grestore + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 192 110 moveto (cdr) show + grestore + +% OVAL +gsave + newpath 207 124 4 4 tgifellipse stroke +grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 217 123 moveto + 0 38 atan dup cos 8 mul 255 exch sub + exch sin 8 mul 123 exch sub lineto + stroke +grestore +gsave + newpath + 255 123 8 3 38 0 tgifarrowtip + closepath fill +grestore + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 268 111 moveto (car) show + grestore + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 264 143 moveto (violet) show + grestore + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 332 111 moveto (cdr) show + grestore + +% OVAL +gsave + newpath 347 125 4 4 tgifellipse stroke +grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 357 124 moveto + 0 38 atan dup cos 8 mul 395 exch sub + exch sin 8 mul 124 exch sub lineto + stroke +grestore +gsave + newpath + 395 124 8 3 38 0 tgifarrowtip + closepath fill +grestore + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 408 112 moveto (car) show + grestore + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 408 136 moveto (butter-) show + 408 153 moveto (cup) show + grestore + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 496 113 moveto (cdr) show + grestore + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 495 137 moveto (nil) show + grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 178 86 moveto + 178 157 lineto + stroke +grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 485 84 moveto + 485 157 lineto + stroke +grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 327 85 moveto + 327 157 lineto + stroke +grestore + +% BOX +gsave + 1.415 setmiterlimit + newpath + 120 86 moveto 234 86 lineto 234 157 lineto 120 157 lineto + closepath stroke + 1 setmiterlimit +grestore + +% BOX +gsave + 1.415 setmiterlimit + newpath + 257 85 moveto 371 85 lineto 371 157 lineto 257 157 lineto + closepath stroke + 1 setmiterlimit +grestore + +% BOX +gsave + 1.415 setmiterlimit + newpath + 397 84 moveto 531 84 lineto 531 157 lineto 397 157 lineto + closepath stroke + 1 setmiterlimit +grestore + +grestore +tgifsavedpage restore +end +%MatchingCreationDate: Tue Mar 14 15:09:30 1995 diff --git a/doc/lispintro/cons-3.eps b/doc/lispintro/cons-3.eps new file mode 100644 index 00000000000..795fa2b18f4 --- /dev/null +++ b/doc/lispintro/cons-3.eps @@ -0,0 +1,630 @@ +%! +%%BoundingBox: -1 691 324 757 +%%Title: cons-cell-diagram3 +%%CreationDate: Wed Mar 8 14:25:41 1995 +%%Creator: Tgif-2.16-p4 by William Chia-Wei Cheng (william@cs.UCLA.edu) +% +% Due to bugs in Transcript, the 'PS-Adobe-' stuff is omitted from line 1 +% + +% Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007 +% Free Software Foundation, Inc. +% +% This file is part of GNU Emacs. +% +% GNU Emacs is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 3, or (at your option) +% any later version. +% +% GNU Emacs is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with GNU Emacs; see the file COPYING. If not, write to +% the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +% Boston, MA 02110-1301, USA. + +/tgifdict 132 dict def +tgifdict begin + +% +% Using a zero value radius for an ellipse or an arc would result +% in a non-invertible CTM matrix which causes problem when this +% when this PostScript is wrapped inside other routines, such as +% the multi.ps package from +% ftp.ucc.su.oz.au:/pub/ps_printing/multi. You can overcome such +% error by uncommenting the sole line of the procedure below: +% +/tgif_min_radius + { +% dup 0.01 lt { pop 0.01 } if + } bind def + +/tgifellipsedict 6 dict def +tgifellipsedict /mtrx matrix put + +/tgifellipse + { tgifellipsedict begin + /yrad exch def + /xrad exch def + /y exch def + /x exch def + /savematrix mtrx currentmatrix def + x y translate + xrad yrad scale + 0 0 1 0 360 arc + savematrix setmatrix + end + } def + +/tgifarrowtipdict 8 dict def +tgifarrowtipdict /mtrx matrix put + +/tgifarrowtip + { tgifarrowtipdict begin + /dy exch def + /dx exch def + /h exch def + /w exch def + /y exch def + /x exch def + /savematrix mtrx currentmatrix def + x y translate + dy dx atan rotate + 0 0 moveto + w neg h lineto + w neg h neg lineto + savematrix setmatrix + end + } def + +/tgifarcdict 8 dict def +tgifarcdict /mtrx matrix put + +/tgifarcn + { tgifarcdict begin + /endangle exch def + /startangle exch def + /yrad exch def + /xrad exch def + /y exch def + /x exch def + /savematrix mtrx currentmatrix def + x y translate + xrad yrad scale + 0 0 1 startangle endangle arc + savematrix setmatrix + end + } def + +/tgifarc + { tgifarcdict begin + /endangle exch def + /startangle exch def + /yrad exch def + /xrad exch def + /y exch def + /x exch def + /savematrix mtrx currentmatrix def + x y translate + xrad yrad scale + 0 0 1 startangle endangle arcn + savematrix setmatrix + end + } def + +/tgifsetuserscreendict 22 dict def +tgifsetuserscreendict begin + /tempctm matrix def + /temprot matrix def + /tempscale matrix def + + /concatprocs + { /proc2 exch cvlit def + /proc1 exch cvlit def + /newproc proc1 length proc2 length add array def + newproc 0 proc1 putinterval + newproc proc1 length proc2 putinterval + newproc cvx + } def + /resmatrix matrix def + /findresolution + { 72 0 resmatrix defaultmatrix dtransform + /yres exch def /xres exch def + xres dup mul yres dup mul add sqrt + } def +end + +/tgifsetuserscreen + { tgifsetuserscreendict begin + /spotfunction exch def + /screenangle exch def + /cellsize exch def + + /m tempctm currentmatrix def + /rm screenangle temprot rotate def + /sm cellsize dup tempscale scale def + + sm rm m m concatmatrix m concatmatrix pop + + 1 0 m dtransform /y1 exch def /x1 exch def + + /veclength x1 dup mul y1 dup mul add sqrt def + /frequency findresolution veclength div def + + /newscreenangle y1 x1 atan def + + m 2 get m 1 get mul m 0 get m 3 get mul sub 0 gt + + {{neg} /spotfunction load concatprocs + /spotfunction exch def + } if + + frequency newscreenangle /spotfunction load setscreen + end + } def + +/tgifsetpatterndict 18 dict def +tgifsetpatterndict begin + /bitison + { /ybit exch def /xbit exch def + /bytevalue bstring ybit bwidth mul xbit 8 idiv add get def + + /mask 1 7 xbit 8 mod sub bitshift def + bytevalue mask and 0 ne + } def +end + +/tgifbitpatternspotfunction + { tgifsetpatterndict begin + /y exch def /x exch def + + /xindex x 1 add 2 div bpside mul cvi def + /yindex y 1 add 2 div bpside mul cvi def + + xindex yindex bitison + { /onbits onbits 1 add def 1 } + { /offbits offbits 1 add def 0 } + ifelse + end + } def + +/tgifsetpattern + { tgifsetpatterndict begin + /cellsz exch def + /angle exch def + /bwidth exch def + /bpside exch def + /bstring exch def + + /onbits 0 def /offbits 0 def + cellsz angle /tgifbitpatternspotfunction load tgifsetuserscreen + {} settransfer + offbits offbits onbits add div setgray + end + } def + +/tgifxpmdict 4 dict def +/tgifbwpicstr 1 string def +/tgifcolorpicstr 3 string def + +/tgifsetpixels { tgifxpmdict begin /pixels exch def end } def + +/tgifsetpix { tgifxpmdict begin pixels 3 1 roll putinterval end } def + +/tgifbwspot + { tgifxpmdict begin + /index exch def + tgifbwpicstr 0 + pixels index 3 mul 3 getinterval aload pop + 255 mul .114 mul exch 255 mul .587 mul add exch 255 mul .299 mul add + cvi put + tgifbwpicstr + end + } def + +/tgifcolorspot + { tgifxpmdict begin + /index exch def + pixels index 3 mul 3 getinterval aload pop + 255 mul cvi tgifcolorpicstr 2 3 -1 roll put + 255 mul cvi tgifcolorpicstr 1 3 -1 roll put + 255 mul cvi tgifcolorpicstr 0 3 -1 roll put + tgifcolorpicstr + end + } def + +/tgifnewcolorspot + { tgifxpmdict begin + /index exch def + pixels index 3 mul 3 getinterval aload pop setrgbcolor + end + } def + +/tgifcolordict 4 dict def + +/colorimage where + { pop } + { /colorimage + { tgifcolordict begin + pop pop pop pop pop + /ih exch def + /iw exch def + /x 0 def + /y 0 def + 1 1 ih + { pop 1 1 iw + { pop currentfile + tgifbwpicstr readhexstring pop 0 get tgifnewcolorspot + x y moveto 1 0 rlineto 0 1 rlineto -1 0 rlineto + closepath fill + /x x 1 add def + } for + /y y 1 add def + /x 0 def + } for + end + } def + } ifelse + +/tgifpatdict 10 dict def + +/tgifpatbyte + { currentdict /retstr get exch + pat i cellsz mod get put + } def + +/tgifpatproc + { 0 1 widthlim {tgifpatbyte} for retstr + /i i 1 add def + } def + +/tgifpatfill + { tgifpatdict begin + /h exch def + /w exch def + /lty exch def + /ltx exch def + /cellsz exch def + /pat exch def + + /widthlim w cellsz div cvi 1 sub def + /retstr widthlim 1 add string def + /i 0 def + + ltx lty translate + w h true [1 0 0 1 0 0] {tgifpatproc} imagemask + ltx neg lty neg translate + end + } def + +/pat1 <ffffffffffffffff> def +/pat2 <0000000000000000> def +/pat3 <8000000008000000> def +/pat4 <8800000022000000> def +/pat5 <8800220088002200> def +/pat6 <8822882288228822> def +/pat7 <aa55aa55aa55aa55> def +/pat8 <77dd77dd77dd77dd> def +/pat9 <77ffddff77ffddff> def +/pat10 <77ffffff77ffffff> def +/pat11 <7fffffff7fffffff> def +/pat12 <8040200002040800> def +/pat13 <40a00000040a0000> def +/pat14 <ff888888ff888888> def +/pat15 <ff808080ff080808> def +/pat16 <f87422478f172271> def +/pat17 <038448300c020101> def +/pat18 <081c22c180010204> def +/pat19 <8080413e080814e3> def +/pat20 <8040201008040201> def +/pat21 <8844221188442211> def +/pat22 <77bbddee77bbddee> def +/pat23 <c1e070381c0e0783> def +/pat24 <7fbfdfeff7fbfdfe> def +/pat25 <3e1f8fc7e3f1f87c> def +/pat26 <0102040810204080> def +/pat27 <1122448811224488> def +/pat28 <eeddbb77eeddbb77> def +/pat29 <83070e1c3870e0c1> def +/pat30 <fefdfbf7efdfbf7f> def +/pat31 <7cf8f1e3c78f1f3e> def + +/tgifcentertext { dup stringwidth pop 2 div neg 0 rmoveto } def + +/tgifrighttext { dup stringwidth pop neg 0 rmoveto } def + +/tgifreencsmalldict 12 dict def +/tgifReEncodeSmall + { tgifreencsmalldict begin + /newcodesandnames exch def + /newfontname exch def + /basefontname exch def + + /basefontdict basefontname findfont def + /newfont basefontdict maxlength dict def + + basefontdict + { exch dup /FID ne + { dup /Encoding eq + { exch dup length array copy newfont 3 1 roll put } + { exch newfont 3 1 roll put } + ifelse + } + { pop pop } + ifelse + } + forall + + newfont /FontName newfontname put + newcodesandnames aload pop + + newcodesandnames length 2 idiv + { newfont /Encoding get 3 1 roll put} + repeat + + newfontname newfont definefont pop + end + } def + +/tgifgray { 8 1 0 72 300 32 div div tgifsetpattern } bind def + +/tgifboxdict 6 dict def +/tgifboxstroke + { tgifboxdict begin + /pat def /w def /y2 exch def /x2 exch def /y1 exch def /x1 exch def + 1.415 setmiterlimit + w 1 eq { w setlinewidth } if + pat pat1 ne pat pat2 ne and { gsave pat tgifgray } if + newpath x1 y1 moveto x2 y1 lineto x2 y2 lineto x1 y2 lineto closepath + pat pat2 eq { 1 setgray stroke 0 setgray } { stroke } ifelse + pat pat1 ne pat pat2 ne and { grestore } if + w 1 eq { 1 setlinewidth } if + 1 setmiterlimit + end + } def +/tgifboxfill + { tgifboxdict begin + /pat def /y2 exch def /x2 exch def /y1 exch def /x1 exch def + pat pat1 ne pat pat2 ne and { gsave pat tgifgray } if + newpath x1 y1 moveto x2 y1 lineto x2 y2 lineto x1 y2 lineto closepath + pat pat2 eq { 1 setgray fill 0 setgray } { fill } ifelse + pat pat1 ne pat pat2 ne and { grestore } if + end + } def + +end + +%%PageBoundingBox: -1 691 324 757 +tgifdict begin +/tgifsavedpage save def + +1 setmiterlimit +1 setlinewidth + +0 setgray + +72 0 mul 72 11.00 mul translate +72 128 div 100 mul 100 div dup neg scale + +gsave + +% BOX +gsave + 1.415 setmiterlimit + newpath + 128 102 moveto 192 102 lineto 192 134 lineto 128 134 lineto + closepath stroke + 1 setmiterlimit +grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 160 102 moveto + 160 134 lineto + stroke +grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 176 124 moveto + 0 80 atan dup cos 8 mul 256 exch sub + exch sin 8 mul 124 exch sub lineto + stroke +grestore +gsave + newpath + 256 124 8 3 80 0 tgifarrowtip + closepath fill +grestore + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 208 172 moveto (rose) show + grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 144 118 moveto + 144 167 lineto + 0 48 atan dup cos 8 mul 192 exch sub + exch sin 8 mul 167 exch sub lineto + stroke +grestore +gsave + newpath + 192 167 8 3 48 0 tgifarrowtip + closepath fill +grestore + +% BOX +gsave + 1.415 setmiterlimit + newpath + 261 102 moveto 325 102 lineto 325 134 lineto 261 134 lineto + closepath stroke + 1 setmiterlimit +grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 293 102 moveto + 293 134 lineto + stroke +grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 309 118 moveto + 0 93 atan dup cos 8 mul 402 exch sub + exch sin 8 mul 118 exch sub lineto + stroke +grestore +gsave + newpath + 402 118 8 3 93 0 tgifarrowtip + closepath fill +grestore + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 341 172 moveto (violet) show + grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 277 118 moveto + 277 167 lineto + 0 48 atan dup cos 8 mul 325 exch sub + exch sin 8 mul 167 exch sub lineto + stroke +grestore +gsave + newpath + 325 167 8 3 48 0 tgifarrowtip + closepath fill +grestore + +% BOX +gsave + 1.415 setmiterlimit + newpath + 404 100 moveto 468 100 lineto 468 132 lineto 404 132 lineto + closepath stroke + 1 setmiterlimit +grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 435 100 moveto + 435 132 lineto + stroke +grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 451 117 moveto + 0 48 atan dup cos 8 mul 499 exch sub + exch sin 8 mul 117 exch sub lineto + stroke +grestore +gsave + newpath + 499 117 8 3 48 0 tgifarrowtip + closepath fill +grestore + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 483 171 moveto (buttercup) show + grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 419 117 moveto + 419 166 lineto + 0 48 atan dup cos 8 mul 467 exch sub + exch sin 8 mul 166 exch sub lineto + stroke +grestore +gsave + newpath + 467 166 8 3 48 0 tgifarrowtip + closepath fill +grestore + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 511 123 moveto (nil) show + grestore + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 131 80 moveto (flowers) show + grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 210 75 moveto + 237 75 lineto + 237 113 lineto + 0 18 atan dup cos 8 mul 255 exch sub + exch sin 8 mul 113 exch sub lineto + stroke +grestore +gsave + newpath + 255 113 8 3 18 0 tgifarrowtip + closepath fill +grestore + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 2 80 moveto (bouquet) show + grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 81 77 moveto + 108 77 lineto + 108 115 lineto + 0 18 atan dup cos 8 mul 126 exch sub + exch sin 8 mul 115 exch sub lineto + stroke +grestore +gsave + newpath + 126 115 8 3 18 0 tgifarrowtip + closepath fill +grestore + +grestore +tgifsavedpage restore +end +%MatchingCreationDate: Wed Mar 8 14:25:41 1995 diff --git a/doc/lispintro/cons-4.eps b/doc/lispintro/cons-4.eps new file mode 100644 index 00000000000..68b0a296c36 --- /dev/null +++ b/doc/lispintro/cons-4.eps @@ -0,0 +1,683 @@ +%! +%%BoundingBox: 6 681 355 758 +%%Title: cons-cell-diagram4 +%%CreationDate: Wed Mar 8 14:25:06 1995 +%%Creator: Tgif-2.16-p4 by William Chia-Wei Cheng (william@cs.UCLA.edu) +% +% Due to bugs in Transcript, the 'PS-Adobe-' stuff is omitted from line 1 +% + +% Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007 +% Free Software Foundation, Inc. +% +% This file is part of GNU Emacs. +% +% GNU Emacs is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 3, or (at your option) +% any later version. +% +% GNU Emacs is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with GNU Emacs; see the file COPYING. If not, write to +% the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +% Boston, MA 02110-1301, USA. + +/tgifdict 132 dict def +tgifdict begin + +% +% Using a zero value radius for an ellipse or an arc would result +% in a non-invertible CTM matrix which causes problem when this +% when this PostScript is wrapped inside other routines, such as +% the multi.ps package from +% ftp.ucc.su.oz.au:/pub/ps_printing/multi. You can overcome such +% error by uncommenting the sole line of the procedure below: +% +/tgif_min_radius + { +% dup 0.01 lt { pop 0.01 } if + } bind def + +/tgifellipsedict 6 dict def +tgifellipsedict /mtrx matrix put + +/tgifellipse + { tgifellipsedict begin + /yrad exch def + /xrad exch def + /y exch def + /x exch def + /savematrix mtrx currentmatrix def + x y translate + xrad yrad scale + 0 0 1 0 360 arc + savematrix setmatrix + end + } def + +/tgifarrowtipdict 8 dict def +tgifarrowtipdict /mtrx matrix put + +/tgifarrowtip + { tgifarrowtipdict begin + /dy exch def + /dx exch def + /h exch def + /w exch def + /y exch def + /x exch def + /savematrix mtrx currentmatrix def + x y translate + dy dx atan rotate + 0 0 moveto + w neg h lineto + w neg h neg lineto + savematrix setmatrix + end + } def + +/tgifarcdict 8 dict def +tgifarcdict /mtrx matrix put + +/tgifarcn + { tgifarcdict begin + /endangle exch def + /startangle exch def + /yrad exch def + /xrad exch def + /y exch def + /x exch def + /savematrix mtrx currentmatrix def + x y translate + xrad yrad scale + 0 0 1 startangle endangle arc + savematrix setmatrix + end + } def + +/tgifarc + { tgifarcdict begin + /endangle exch def + /startangle exch def + /yrad exch def + /xrad exch def + /y exch def + /x exch def + /savematrix mtrx currentmatrix def + x y translate + xrad yrad scale + 0 0 1 startangle endangle arcn + savematrix setmatrix + end + } def + +/tgifsetuserscreendict 22 dict def +tgifsetuserscreendict begin + /tempctm matrix def + /temprot matrix def + /tempscale matrix def + + /concatprocs + { /proc2 exch cvlit def + /proc1 exch cvlit def + /newproc proc1 length proc2 length add array def + newproc 0 proc1 putinterval + newproc proc1 length proc2 putinterval + newproc cvx + } def + /resmatrix matrix def + /findresolution + { 72 0 resmatrix defaultmatrix dtransform + /yres exch def /xres exch def + xres dup mul yres dup mul add sqrt + } def +end + +/tgifsetuserscreen + { tgifsetuserscreendict begin + /spotfunction exch def + /screenangle exch def + /cellsize exch def + + /m tempctm currentmatrix def + /rm screenangle temprot rotate def + /sm cellsize dup tempscale scale def + + sm rm m m concatmatrix m concatmatrix pop + + 1 0 m dtransform /y1 exch def /x1 exch def + + /veclength x1 dup mul y1 dup mul add sqrt def + /frequency findresolution veclength div def + + /newscreenangle y1 x1 atan def + + m 2 get m 1 get mul m 0 get m 3 get mul sub 0 gt + + {{neg} /spotfunction load concatprocs + /spotfunction exch def + } if + + frequency newscreenangle /spotfunction load setscreen + end + } def + +/tgifsetpatterndict 18 dict def +tgifsetpatterndict begin + /bitison + { /ybit exch def /xbit exch def + /bytevalue bstring ybit bwidth mul xbit 8 idiv add get def + + /mask 1 7 xbit 8 mod sub bitshift def + bytevalue mask and 0 ne + } def +end + +/tgifbitpatternspotfunction + { tgifsetpatterndict begin + /y exch def /x exch def + + /xindex x 1 add 2 div bpside mul cvi def + /yindex y 1 add 2 div bpside mul cvi def + + xindex yindex bitison + { /onbits onbits 1 add def 1 } + { /offbits offbits 1 add def 0 } + ifelse + end + } def + +/tgifsetpattern + { tgifsetpatterndict begin + /cellsz exch def + /angle exch def + /bwidth exch def + /bpside exch def + /bstring exch def + + /onbits 0 def /offbits 0 def + cellsz angle /tgifbitpatternspotfunction load tgifsetuserscreen + {} settransfer + offbits offbits onbits add div setgray + end + } def + +/tgifxpmdict 4 dict def +/tgifbwpicstr 1 string def +/tgifcolorpicstr 3 string def + +/tgifsetpixels { tgifxpmdict begin /pixels exch def end } def + +/tgifsetpix { tgifxpmdict begin pixels 3 1 roll putinterval end } def + +/tgifbwspot + { tgifxpmdict begin + /index exch def + tgifbwpicstr 0 + pixels index 3 mul 3 getinterval aload pop + 255 mul .114 mul exch 255 mul .587 mul add exch 255 mul .299 mul add + cvi put + tgifbwpicstr + end + } def + +/tgifcolorspot + { tgifxpmdict begin + /index exch def + pixels index 3 mul 3 getinterval aload pop + 255 mul cvi tgifcolorpicstr 2 3 -1 roll put + 255 mul cvi tgifcolorpicstr 1 3 -1 roll put + 255 mul cvi tgifcolorpicstr 0 3 -1 roll put + tgifcolorpicstr + end + } def + +/tgifnewcolorspot + { tgifxpmdict begin + /index exch def + pixels index 3 mul 3 getinterval aload pop setrgbcolor + end + } def + +/tgifcolordict 4 dict def + +/colorimage where + { pop } + { /colorimage + { tgifcolordict begin + pop pop pop pop pop + /ih exch def + /iw exch def + /x 0 def + /y 0 def + 1 1 ih + { pop 1 1 iw + { pop currentfile + tgifbwpicstr readhexstring pop 0 get tgifnewcolorspot + x y moveto 1 0 rlineto 0 1 rlineto -1 0 rlineto + closepath fill + /x x 1 add def + } for + /y y 1 add def + /x 0 def + } for + end + } def + } ifelse + +/tgifpatdict 10 dict def + +/tgifpatbyte + { currentdict /retstr get exch + pat i cellsz mod get put + } def + +/tgifpatproc + { 0 1 widthlim {tgifpatbyte} for retstr + /i i 1 add def + } def + +/tgifpatfill + { tgifpatdict begin + /h exch def + /w exch def + /lty exch def + /ltx exch def + /cellsz exch def + /pat exch def + + /widthlim w cellsz div cvi 1 sub def + /retstr widthlim 1 add string def + /i 0 def + + ltx lty translate + w h true [1 0 0 1 0 0] {tgifpatproc} imagemask + ltx neg lty neg translate + end + } def + +/pat1 <ffffffffffffffff> def +/pat2 <0000000000000000> def +/pat3 <8000000008000000> def +/pat4 <8800000022000000> def +/pat5 <8800220088002200> def +/pat6 <8822882288228822> def +/pat7 <aa55aa55aa55aa55> def +/pat8 <77dd77dd77dd77dd> def +/pat9 <77ffddff77ffddff> def +/pat10 <77ffffff77ffffff> def +/pat11 <7fffffff7fffffff> def +/pat12 <8040200002040800> def +/pat13 <40a00000040a0000> def +/pat14 <ff888888ff888888> def +/pat15 <ff808080ff080808> def +/pat16 <f87422478f172271> def +/pat17 <038448300c020101> def +/pat18 <081c22c180010204> def +/pat19 <8080413e080814e3> def +/pat20 <8040201008040201> def +/pat21 <8844221188442211> def +/pat22 <77bbddee77bbddee> def +/pat23 <c1e070381c0e0783> def +/pat24 <7fbfdfeff7fbfdfe> def +/pat25 <3e1f8fc7e3f1f87c> def +/pat26 <0102040810204080> def +/pat27 <1122448811224488> def +/pat28 <eeddbb77eeddbb77> def +/pat29 <83070e1c3870e0c1> def +/pat30 <fefdfbf7efdfbf7f> def +/pat31 <7cf8f1e3c78f1f3e> def + +/tgifcentertext { dup stringwidth pop 2 div neg 0 rmoveto } def + +/tgifrighttext { dup stringwidth pop neg 0 rmoveto } def + +/tgifreencsmalldict 12 dict def +/tgifReEncodeSmall + { tgifreencsmalldict begin + /newcodesandnames exch def + /newfontname exch def + /basefontname exch def + + /basefontdict basefontname findfont def + /newfont basefontdict maxlength dict def + + basefontdict + { exch dup /FID ne + { dup /Encoding eq + { exch dup length array copy newfont 3 1 roll put } + { exch newfont 3 1 roll put } + ifelse + } + { pop pop } + ifelse + } + forall + + newfont /FontName newfontname put + newcodesandnames aload pop + + newcodesandnames length 2 idiv + { newfont /Encoding get 3 1 roll put} + repeat + + newfontname newfont definefont pop + end + } def + +/tgifgray { 8 1 0 72 300 32 div div tgifsetpattern } bind def + +/tgifboxdict 6 dict def +/tgifboxstroke + { tgifboxdict begin + /pat def /w def /y2 exch def /x2 exch def /y1 exch def /x1 exch def + 1.415 setmiterlimit + w 1 eq { w setlinewidth } if + pat pat1 ne pat pat2 ne and { gsave pat tgifgray } if + newpath x1 y1 moveto x2 y1 lineto x2 y2 lineto x1 y2 lineto closepath + pat pat2 eq { 1 setgray stroke 0 setgray } { stroke } ifelse + pat pat1 ne pat pat2 ne and { grestore } if + w 1 eq { 1 setlinewidth } if + 1 setmiterlimit + end + } def +/tgifboxfill + { tgifboxdict begin + /pat def /y2 exch def /x2 exch def /y1 exch def /x1 exch def + pat pat1 ne pat pat2 ne and { gsave pat tgifgray } if + newpath x1 y1 moveto x2 y1 lineto x2 y2 lineto x1 y2 lineto closepath + pat pat2 eq { 1 setgray fill 0 setgray } { fill } ifelse + pat pat1 ne pat pat2 ne and { grestore } if + end + } def + +end + +%%PageBoundingBox: 6 681 355 758 +tgifdict begin +/tgifsavedpage save def + +1 setmiterlimit +1 setlinewidth + +0 setgray + +72 0 mul 72 11.00 mul translate +72 128 div 100 mul 100 div dup neg scale + +gsave + +% POLY/OPEN-SPLINE +gsave + newpath + 274 102 moveto + 274 134 lineto + stroke +grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 289 122 moveto + 0 56 atan dup cos 8 mul 345 exch sub + exch sin 8 mul 122 exch sub lineto + stroke +grestore +gsave + newpath + 345 122 8 3 56 0 tgifarrowtip + closepath fill +grestore + +% BOX +gsave + 1.415 setmiterlimit + newpath + 350 100 moveto 414 100 lineto 414 132 lineto 350 132 lineto + closepath stroke + 1 setmiterlimit +grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 382 100 moveto + 382 132 lineto + stroke +grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 397 114 moveto + 0 59 atan dup cos 8 mul 456 exch sub + exch sin 8 mul 114 exch sub lineto + stroke +grestore +gsave + newpath + 456 114 8 3 59 0 tgifarrowtip + closepath fill +grestore + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 430 170 moveto (violet) show + grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 366 116 moveto + 366 165 lineto + 0 48 atan dup cos 8 mul 414 exch sub + exch sin 8 mul 165 exch sub lineto + stroke +grestore +gsave + newpath + 414 165 8 3 48 0 tgifarrowtip + closepath fill +grestore + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 219 78 moveto (flowers) show + grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 298 73 moveto + 325 73 lineto + 325 111 lineto + 0 18 atan dup cos 8 mul 343 exch sub + exch sin 8 mul 111 exch sub lineto + stroke +grestore +gsave + newpath + 343 111 8 3 18 0 tgifarrowtip + closepath fill +grestore + +% BOX +gsave + 1.415 setmiterlimit + newpath + 459 95 moveto 523 95 lineto 523 127 lineto 459 127 lineto + closepath stroke + 1 setmiterlimit +grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 490 95 moveto + 490 127 lineto + stroke +grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 506 112 moveto + 0 48 atan dup cos 8 mul 554 exch sub + exch sin 8 mul 112 exch sub lineto + stroke +grestore +gsave + newpath + 554 112 8 3 48 0 tgifarrowtip + closepath fill +grestore + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 566 118 moveto (nil) show + grestore + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 538 151 moveto (buttercup) show + grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 474 109 moveto + 474 146 lineto + 0 48 atan dup cos 8 mul 522 exch sub + exch sin 8 mul 146 exch sub lineto + stroke +grestore +gsave + newpath + 522 146 8 3 48 0 tgifarrowtip + closepath fill +grestore + +% BOX +gsave + 1.415 setmiterlimit + newpath + 244 102 moveto 308 102 lineto 308 134 lineto 244 134 lineto + closepath stroke + 1 setmiterlimit +grestore + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 324 189 moveto (rose) show + grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 260 117 moveto + 260 184 lineto + 0 48 atan dup cos 8 mul 308 exch sub + exch sin 8 mul 184 exch sub lineto + stroke +grestore +gsave + newpath + 308 184 8 3 48 0 tgifarrowtip + closepath fill +grestore + +% BOX +gsave + 1.415 setmiterlimit + newpath + 146 101 moveto 210 101 lineto 210 133 lineto 146 133 lineto + closepath stroke + 1 setmiterlimit +grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 177 101 moveto + 177 133 lineto + stroke +grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 193 118 moveto + 0 48 atan dup cos 8 mul 241 exch sub + exch sin 8 mul 118 exch sub lineto + stroke +grestore +gsave + newpath + 241 118 8 3 48 0 tgifarrowtip + closepath fill +grestore + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 187 178 moveto (lily) show + grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 163 118 moveto + 163 171 lineto + 0 18 atan dup cos 8 mul 181 exch sub + exch sin 8 mul 171 exch sub lineto + stroke +grestore +gsave + newpath + 181 171 8 3 18 0 tgifarrowtip + closepath fill +grestore + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 16 78 moveto (bouquet) show + grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 95 73 moveto + 122 73 lineto + 122 111 lineto + 0 18 atan dup cos 8 mul 140 exch sub + exch sin 8 mul 111 exch sub lineto + stroke +grestore +gsave + newpath + 140 111 8 3 18 0 tgifarrowtip + closepath fill +grestore + +grestore +tgifsavedpage restore +end +%MatchingCreationDate: Wed Mar 8 14:25:06 1995 diff --git a/doc/lispintro/cons-5.eps b/doc/lispintro/cons-5.eps new file mode 100644 index 00000000000..e03815a4403 --- /dev/null +++ b/doc/lispintro/cons-5.eps @@ -0,0 +1,628 @@ +%! +%%BoundingBox: 15 680 305 764 +%%Title: cons-cell-diagram5 +%%CreationDate: Wed Mar 8 14:27:28 1995 +%%Creator: Tgif-2.16-p4 by William Chia-Wei Cheng (william@cs.UCLA.edu) +% +% Due to bugs in Transcript, the 'PS-Adobe-' stuff is omitted from line 1 +% + +% Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007 +% Free Software Foundation, Inc. +% +% This file is part of GNU Emacs. +% +% GNU Emacs is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 3, or (at your option) +% any later version. +% +% GNU Emacs is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with GNU Emacs; see the file COPYING. If not, write to +% the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +% Boston, MA 02110-1301, USA. + +/tgifdict 132 dict def +tgifdict begin + +% +% Using a zero value radius for an ellipse or an arc would result +% in a non-invertible CTM matrix which causes problem when this +% when this PostScript is wrapped inside other routines, such as +% the multi.ps package from +% ftp.ucc.su.oz.au:/pub/ps_printing/multi. You can overcome such +% error by uncommenting the sole line of the procedure below: +% +/tgif_min_radius + { +% dup 0.01 lt { pop 0.01 } if + } bind def + +/tgifellipsedict 6 dict def +tgifellipsedict /mtrx matrix put + +/tgifellipse + { tgifellipsedict begin + /yrad exch def + /xrad exch def + /y exch def + /x exch def + /savematrix mtrx currentmatrix def + x y translate + xrad yrad scale + 0 0 1 0 360 arc + savematrix setmatrix + end + } def + +/tgifarrowtipdict 8 dict def +tgifarrowtipdict /mtrx matrix put + +/tgifarrowtip + { tgifarrowtipdict begin + /dy exch def + /dx exch def + /h exch def + /w exch def + /y exch def + /x exch def + /savematrix mtrx currentmatrix def + x y translate + dy dx atan rotate + 0 0 moveto + w neg h lineto + w neg h neg lineto + savematrix setmatrix + end + } def + +/tgifarcdict 8 dict def +tgifarcdict /mtrx matrix put + +/tgifarcn + { tgifarcdict begin + /endangle exch def + /startangle exch def + /yrad exch def + /xrad exch def + /y exch def + /x exch def + /savematrix mtrx currentmatrix def + x y translate + xrad yrad scale + 0 0 1 startangle endangle arc + savematrix setmatrix + end + } def + +/tgifarc + { tgifarcdict begin + /endangle exch def + /startangle exch def + /yrad exch def + /xrad exch def + /y exch def + /x exch def + /savematrix mtrx currentmatrix def + x y translate + xrad yrad scale + 0 0 1 startangle endangle arcn + savematrix setmatrix + end + } def + +/tgifsetuserscreendict 22 dict def +tgifsetuserscreendict begin + /tempctm matrix def + /temprot matrix def + /tempscale matrix def + + /concatprocs + { /proc2 exch cvlit def + /proc1 exch cvlit def + /newproc proc1 length proc2 length add array def + newproc 0 proc1 putinterval + newproc proc1 length proc2 putinterval + newproc cvx + } def + /resmatrix matrix def + /findresolution + { 72 0 resmatrix defaultmatrix dtransform + /yres exch def /xres exch def + xres dup mul yres dup mul add sqrt + } def +end + +/tgifsetuserscreen + { tgifsetuserscreendict begin + /spotfunction exch def + /screenangle exch def + /cellsize exch def + + /m tempctm currentmatrix def + /rm screenangle temprot rotate def + /sm cellsize dup tempscale scale def + + sm rm m m concatmatrix m concatmatrix pop + + 1 0 m dtransform /y1 exch def /x1 exch def + + /veclength x1 dup mul y1 dup mul add sqrt def + /frequency findresolution veclength div def + + /newscreenangle y1 x1 atan def + + m 2 get m 1 get mul m 0 get m 3 get mul sub 0 gt + + {{neg} /spotfunction load concatprocs + /spotfunction exch def + } if + + frequency newscreenangle /spotfunction load setscreen + end + } def + +/tgifsetpatterndict 18 dict def +tgifsetpatterndict begin + /bitison + { /ybit exch def /xbit exch def + /bytevalue bstring ybit bwidth mul xbit 8 idiv add get def + + /mask 1 7 xbit 8 mod sub bitshift def + bytevalue mask and 0 ne + } def +end + +/tgifbitpatternspotfunction + { tgifsetpatterndict begin + /y exch def /x exch def + + /xindex x 1 add 2 div bpside mul cvi def + /yindex y 1 add 2 div bpside mul cvi def + + xindex yindex bitison + { /onbits onbits 1 add def 1 } + { /offbits offbits 1 add def 0 } + ifelse + end + } def + +/tgifsetpattern + { tgifsetpatterndict begin + /cellsz exch def + /angle exch def + /bwidth exch def + /bpside exch def + /bstring exch def + + /onbits 0 def /offbits 0 def + cellsz angle /tgifbitpatternspotfunction load tgifsetuserscreen + {} settransfer + offbits offbits onbits add div setgray + end + } def + +/tgifxpmdict 4 dict def +/tgifbwpicstr 1 string def +/tgifcolorpicstr 3 string def + +/tgifsetpixels { tgifxpmdict begin /pixels exch def end } def + +/tgifsetpix { tgifxpmdict begin pixels 3 1 roll putinterval end } def + +/tgifbwspot + { tgifxpmdict begin + /index exch def + tgifbwpicstr 0 + pixels index 3 mul 3 getinterval aload pop + 255 mul .114 mul exch 255 mul .587 mul add exch 255 mul .299 mul add + cvi put + tgifbwpicstr + end + } def + +/tgifcolorspot + { tgifxpmdict begin + /index exch def + pixels index 3 mul 3 getinterval aload pop + 255 mul cvi tgifcolorpicstr 2 3 -1 roll put + 255 mul cvi tgifcolorpicstr 1 3 -1 roll put + 255 mul cvi tgifcolorpicstr 0 3 -1 roll put + tgifcolorpicstr + end + } def + +/tgifnewcolorspot + { tgifxpmdict begin + /index exch def + pixels index 3 mul 3 getinterval aload pop setrgbcolor + end + } def + +/tgifcolordict 4 dict def + +/colorimage where + { pop } + { /colorimage + { tgifcolordict begin + pop pop pop pop pop + /ih exch def + /iw exch def + /x 0 def + /y 0 def + 1 1 ih + { pop 1 1 iw + { pop currentfile + tgifbwpicstr readhexstring pop 0 get tgifnewcolorspot + x y moveto 1 0 rlineto 0 1 rlineto -1 0 rlineto + closepath fill + /x x 1 add def + } for + /y y 1 add def + /x 0 def + } for + end + } def + } ifelse + +/tgifpatdict 10 dict def + +/tgifpatbyte + { currentdict /retstr get exch + pat i cellsz mod get put + } def + +/tgifpatproc + { 0 1 widthlim {tgifpatbyte} for retstr + /i i 1 add def + } def + +/tgifpatfill + { tgifpatdict begin + /h exch def + /w exch def + /lty exch def + /ltx exch def + /cellsz exch def + /pat exch def + + /widthlim w cellsz div cvi 1 sub def + /retstr widthlim 1 add string def + /i 0 def + + ltx lty translate + w h true [1 0 0 1 0 0] {tgifpatproc} imagemask + ltx neg lty neg translate + end + } def + +/pat1 <ffffffffffffffff> def +/pat2 <0000000000000000> def +/pat3 <8000000008000000> def +/pat4 <8800000022000000> def +/pat5 <8800220088002200> def +/pat6 <8822882288228822> def +/pat7 <aa55aa55aa55aa55> def +/pat8 <77dd77dd77dd77dd> def +/pat9 <77ffddff77ffddff> def +/pat10 <77ffffff77ffffff> def +/pat11 <7fffffff7fffffff> def +/pat12 <8040200002040800> def +/pat13 <40a00000040a0000> def +/pat14 <ff888888ff888888> def +/pat15 <ff808080ff080808> def +/pat16 <f87422478f172271> def +/pat17 <038448300c020101> def +/pat18 <081c22c180010204> def +/pat19 <8080413e080814e3> def +/pat20 <8040201008040201> def +/pat21 <8844221188442211> def +/pat22 <77bbddee77bbddee> def +/pat23 <c1e070381c0e0783> def +/pat24 <7fbfdfeff7fbfdfe> def +/pat25 <3e1f8fc7e3f1f87c> def +/pat26 <0102040810204080> def +/pat27 <1122448811224488> def +/pat28 <eeddbb77eeddbb77> def +/pat29 <83070e1c3870e0c1> def +/pat30 <fefdfbf7efdfbf7f> def +/pat31 <7cf8f1e3c78f1f3e> def + +/tgifcentertext { dup stringwidth pop 2 div neg 0 rmoveto } def + +/tgifrighttext { dup stringwidth pop neg 0 rmoveto } def + +/tgifreencsmalldict 12 dict def +/tgifReEncodeSmall + { tgifreencsmalldict begin + /newcodesandnames exch def + /newfontname exch def + /basefontname exch def + + /basefontdict basefontname findfont def + /newfont basefontdict maxlength dict def + + basefontdict + { exch dup /FID ne + { dup /Encoding eq + { exch dup length array copy newfont 3 1 roll put } + { exch newfont 3 1 roll put } + ifelse + } + { pop pop } + ifelse + } + forall + + newfont /FontName newfontname put + newcodesandnames aload pop + + newcodesandnames length 2 idiv + { newfont /Encoding get 3 1 roll put} + repeat + + newfontname newfont definefont pop + end + } def + +/tgifgray { 8 1 0 72 300 32 div div tgifsetpattern } bind def + +/tgifboxdict 6 dict def +/tgifboxstroke + { tgifboxdict begin + /pat def /w def /y2 exch def /x2 exch def /y1 exch def /x1 exch def + 1.415 setmiterlimit + w 1 eq { w setlinewidth } if + pat pat1 ne pat pat2 ne and { gsave pat tgifgray } if + newpath x1 y1 moveto x2 y1 lineto x2 y2 lineto x1 y2 lineto closepath + pat pat2 eq { 1 setgray stroke 0 setgray } { stroke } ifelse + pat pat1 ne pat pat2 ne and { grestore } if + w 1 eq { 1 setlinewidth } if + 1 setmiterlimit + end + } def +/tgifboxfill + { tgifboxdict begin + /pat def /y2 exch def /x2 exch def /y1 exch def /x1 exch def + pat pat1 ne pat pat2 ne and { gsave pat tgifgray } if + newpath x1 y1 moveto x2 y1 lineto x2 y2 lineto x1 y2 lineto closepath + pat pat2 eq { 1 setgray fill 0 setgray } { fill } ifelse + pat pat1 ne pat pat2 ne and { grestore } if + end + } def + +end + +%%PageBoundingBox: 15 680 305 764 +tgifdict begin +/tgifsavedpage save def + +1 setmiterlimit +1 setlinewidth + +0 setgray + +72 0 mul 72 11.00 mul translate +72 128 div 100 mul 100 div dup neg scale + +gsave + +% POLY/OPEN-SPLINE +gsave + newpath + 156 105 moveto + 156 137 lineto + stroke +grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 171 125 moveto + 0 56 atan dup cos 8 mul 227 exch sub + exch sin 8 mul 125 exch sub lineto + stroke +grestore +gsave + newpath + 227 125 8 3 56 0 tgifarrowtip + closepath fill +grestore + +% BOX +gsave + 1.415 setmiterlimit + newpath + 232 103 moveto 296 103 lineto 296 135 lineto 232 135 lineto + closepath stroke + 1 setmiterlimit +grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 264 103 moveto + 264 135 lineto + stroke +grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 279 117 moveto + 0 59 atan dup cos 8 mul 338 exch sub + exch sin 8 mul 117 exch sub lineto + stroke +grestore +gsave + newpath + 338 117 8 3 59 0 tgifarrowtip + closepath fill +grestore + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 289 172 moveto (a different piece of text) show + grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 248 119 moveto + 248 168 lineto + 0 29 atan dup cos 8 mul 277 exch sub + exch sin 8 mul 168 exch sub lineto + stroke +grestore +gsave + newpath + 277 168 8 3 29 0 tgifarrowtip + closepath fill +grestore + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 147 66 moveto (kill-ring-yank-pointer) show + grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 207 76 moveto + 207 114 lineto + 0 18 atan dup cos 8 mul 225 exch sub + exch sin 8 mul 114 exch sub lineto + stroke +grestore +gsave + newpath + 225 114 8 3 18 0 tgifarrowtip + closepath fill +grestore + +% BOX +gsave + 1.415 setmiterlimit + newpath + 341 98 moveto 405 98 lineto 405 130 lineto 341 130 lineto + closepath stroke + 1 setmiterlimit +grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 372 98 moveto + 372 130 lineto + stroke +grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 388 115 moveto + 0 48 atan dup cos 8 mul 436 exch sub + exch sin 8 mul 115 exch sub lineto + stroke +grestore +gsave + newpath + 436 115 8 3 48 0 tgifarrowtip + closepath fill +grestore + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 448 121 moveto (nil) show + grestore + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 397 154 moveto (yet more text) show + grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 356 112 moveto + 356 149 lineto + 0 35 atan dup cos 8 mul 391 exch sub + exch sin 8 mul 149 exch sub lineto + stroke +grestore +gsave + newpath + 391 149 8 3 35 0 tgifarrowtip + closepath fill +grestore + +% BOX +gsave + 1.415 setmiterlimit + newpath + 126 105 moveto 190 105 lineto 190 137 lineto 126 137 lineto + closepath stroke + 1 setmiterlimit +grestore + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 206 192 moveto (some text) show + grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 142 120 moveto + 142 187 lineto + 0 48 atan dup cos 8 mul 190 exch sub + exch sin 8 mul 187 exch sub lineto + stroke +grestore +gsave + newpath + 190 187 8 3 48 0 tgifarrowtip + closepath fill +grestore + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 32 66 moveto (kill-ring) show + grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 65 81 moveto + 65 121 lineto + 0 51 atan dup cos 8 mul 116 exch sub + exch sin 8 mul 121 exch sub lineto + stroke +grestore +gsave + newpath + 116 121 8 3 51 0 tgifarrowtip + closepath fill +grestore + +grestore +tgifsavedpage restore +end +%MatchingCreationDate: Wed Mar 8 14:27:28 1995 diff --git a/doc/lispintro/drawers.eps b/doc/lispintro/drawers.eps new file mode 100644 index 00000000000..0e5a222ae45 --- /dev/null +++ b/doc/lispintro/drawers.eps @@ -0,0 +1,513 @@ +%!PS-Adobe-3.0 EPSF-3.0 +%%BoundingBox: 34 577 324 778 +%%Title: chest-of-drawers-diagram-new +%%CreationDate: Fri Sep 14 17:40:57 2001 +%%Creator: Tgif-4.1.35 by William Chia-Wei Cheng (william@cs.UCLA.edu) +%%ProducedBy: (unknown) +%%Pages: 1 +%%DocumentFonts: (atend) +%%EndComments +%%BeginProlog + +% Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 +% Free Software Foundation, Inc. +% +% This file is part of GNU Emacs. +% +% GNU Emacs is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 3, or (at your option) +% any later version. +% +% GNU Emacs is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with GNU Emacs; see the file COPYING. If not, write to +% the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +% Boston, MA 02110-1301, USA. + +/tgifdict 53 dict def +tgifdict begin + +/tgifellipsedict 6 dict def +tgifellipsedict /mtrx matrix put + +/TGEL % tgifellipse + { tgifellipsedict begin + /yrad exch def + /xrad exch def + /y exch def + /x exch def + /savematrix mtrx currentmatrix def + x y translate + xrad yrad scale + 0 0 1 0 360 arc + savematrix setmatrix + end + } def + +/TGMAX + { exch dup 3 1 roll exch dup 3 1 roll gt { pop } { exch pop } ifelse + } def +/TGMIN + { exch dup 3 1 roll exch dup 3 1 roll lt { pop } { exch pop } ifelse + } def +/TGSW { stringwidth pop } def + +/bd { bind def } bind def + +/GS { gsave } bd +/GR { grestore } bd +/NP { newpath } bd +/CP { closepath } bd +/CHP { charpath } bd +/CT { curveto } bd +/L { lineto } bd +/RL { rlineto } bd +/M { moveto } bd +/RM { rmoveto } bd +/S { stroke } bd +/F { fill } bd +/TR { translate } bd +/RO { rotate } bd +/SC { scale } bd +/MU { mul } bd +/DI { div } bd +/DU { dup } bd +/NE { neg } bd +/AD { add } bd +/SU { sub } bd +/PO { pop } bd +/EX { exch } bd +/CO { concat } bd +/CL { clip } bd +/EC { eoclip } bd +/EF { eofill } bd +/IM { image } bd +/IMM { imagemask } bd +/ARY { array } bd +/SG { setgray } bd +/RG { setrgbcolor } bd +/SD { setdash } bd +/W { setlinewidth } bd +/SM { setmiterlimit } bd +/SLC { setlinecap } bd +/SLJ { setlinejoin } bd +/SH { show } bd +/FF { findfont } bd +/MS { makefont setfont } bd +/AR { arcto 4 {pop} repeat } bd +/CURP { currentpoint } bd +/FLAT { flattenpath strokepath clip newpath } bd +/TGSM { tgiforigctm setmatrix } def +/TGRM { savematrix setmatrix } def + +end + +%%EndProlog +%%Page: 1 1 + +%%PageBoundingBox: 34 577 324 778 +tgifdict begin +/tgifsavedpage save def + +1 SM +1 W + +0 SG + +72 0 MU 72 11 MU TR +72 128 DI 100.000 MU 100 DI DU NE SC + +GS + +/tgiforigctm matrix currentmatrix def + +% BOX +0 SG +GS + 10 SM + GS + NP 64 104 M 255 104 L 255 360 L 64 360 L CP + S + GR +GR + +% POLY/OPEN-SPLINE +0 SG +GS + NP + 65 296 M + 254 296 L + TGSM + 1 W + S +GR + +% POLY/OPEN-SPLINE +0 SG +GS + NP + 63 233 M + 255 233 L + TGSM + 1 W + S +GR + +% POLY/OPEN-SPLINE +0 SG +GS + NP + 63 169 M + 255 169 L + TGSM + 1 W + S +GR + +% POLY/OPEN-SPLINE +0 SG +GS + NP + 251 362 M + 251 361 L + 251 379 L + 244 379 L + 229 361 L + TGSM + 1 W + S +GR + +% OVAL +0 SG +GS + GS + NP 160 72 10 6 TGEL + S + GR +GR + +% POLY/OPEN-SPLINE +0 SG +GS + NP + 63 104 M + 128 64 L + 138 69 L + TGSM + 1 W + S +GR + +% POLY/OPEN-SPLINE +0 SG +GS + NP + 255 103 M + 190 63 L + 180 68 L + TGSM + 1 W + S +GR + +% TEXT +NP +0 SG + GS + 1 W + 160 152 M + GS + GS + 0 + /Courier FF [17 0 0 -17 0 0] MS + (symbol name) TGSW + AD + GR + 2 DI NE 0 RM + 0 SG + /Courier FF [17 0 0 -17 0 0] MS + (symbol name) SH + GR + GR + +% TEXT +NP +0 SG + GS + 1 W + 160 41 M + GS + GS + 0 + /Courier FF [17 0 0 -17 0 0] MS + (Chest of Drawers) TGSW + AD + GR + 2 DI NE 0 RM + 0 SG + /Courier FF [17 0 0 -17 0 0] MS + (Chest of Drawers) SH + GR + GR + +% TEXT +NP +0 SG + GS + 1 W + 344 41 M + GS + 0 SG + /Courier FF [17 0 0 -17 0 0] MS + (Contents of Drawers) SH + GR + GR + +% TEXT +NP +0 SG + GS + 1 W + 344 160 M + GS + 0 SG + /Courier FF [17 0 0 -17 0 0] MS + (bouquet) SH + GR + GR + +% TEXT +NP +0 SG + GS + 1 W + 344 220 M + GS + 0 SG + /Courier FF [17 0 0 -17 0 0] MS + ([none]) SH + GR + GR + +% TEXT +NP +0 SG + GS + 1 W + 344 279 M + GS + 0 SG + /Courier FF [17 0 0 -17 0 0] MS + (\(rose violet buttercup\)) SH + GR + GR + +% TEXT +NP +0 SG + GS + 1 W + 344 337 M + GS + 0 SG + /Courier FF [17 0 0 -17 0 0] MS + ([not described here]) SH + GR + GR + +% POLY/OPEN-SPLINE +0 SG +GS + NP + 68 362 M + 68 361 L + 68 379 L + 75 379 L + 90 361 L + TGSM + 1 W + S +GR + +% TEXT +NP +0 SG + GS + 1 W + 158 132 M + GS + GS + 0 + /NewCenturySchlbk-Roman FF [17 0 0 -17 0 0] MS + (directions to) TGSW + AD + GR + 2 DI NE 0 RM + 0 SG + /NewCenturySchlbk-Roman FF [17 0 0 -17 0 0] MS + (directions to) SH + GR + GR + +% TEXT +NP +0 SG + GS + 1 W + 345 139 M + GS + 0 SG + /NewCenturySchlbk-Roman FF [17 0 0 -17 0 0] MS + (map to) SH + GR + GR + +% TEXT +NP +0 SG + GS + 1 W + 350 259 M + GS + 0 SG + /NewCenturySchlbk-Roman FF [17 0 0 -17 0 0] MS + (map to) SH + GR + GR + +% TEXT +NP +0 SG + GS + 1 W + 159 213 M + GS + GS + 0 + /Courier FF [17 0 0 -17 0 0] MS + (symbol definition) TGSW + AD + GR + 2 DI NE 0 RM + 0 SG + /Courier FF [17 0 0 -17 0 0] MS + (symbol definition) SH + GR + GR + +% TEXT +NP +0 SG + GS + 1 W + 159 195 M + GS + GS + 0 + /NewCenturySchlbk-Roman FF [17 0 0 -17 0 0] MS + (directions to) TGSW + AD + GR + 2 DI NE 0 RM + 0 SG + /NewCenturySchlbk-Roman FF [17 0 0 -17 0 0] MS + (directions to) SH + GR + GR + +% TEXT +NP +0 SG + GS + 1 W + 160 276 M + GS + GS + 0 + /Courier FF [17 0 0 -17 0 0] MS + (variable name) TGSW + AD + GR + 2 DI NE 0 RM + 0 SG + /Courier FF [17 0 0 -17 0 0] MS + (variable name) SH + GR + GR + +% TEXT +NP +0 SG + GS + 1 W + 158 260 M + GS + GS + 0 + /NewCenturySchlbk-Roman FF [17 0 0 -17 0 0] MS + (directions to) TGSW + AD + GR + 2 DI NE 0 RM + 0 SG + /NewCenturySchlbk-Roman FF [17 0 0 -17 0 0] MS + (directions to) SH + GR + GR + +% TEXT +NP +0 SG + GS + 1 W + 160 339 M + GS + GS + 0 + /Courier FF [17 0 0 -17 0 0] MS + (property list) TGSW + AD + GR + 2 DI NE 0 RM + 0 SG + /Courier FF [17 0 0 -17 0 0] MS + (property list) SH + GR + GR + +% TEXT +NP +0 SG + GS + 1 W + 158 323 M + GS + GS + 0 + /NewCenturySchlbk-Roman FF [17 0 0 -17 0 0] MS + (directions to) TGSW + AD + GR + 2 DI NE 0 RM + 0 SG + /NewCenturySchlbk-Roman FF [17 0 0 -17 0 0] MS + (directions to) SH + GR + GR + +GR +tgifsavedpage restore +end +showpage + +%%Trailer +%MatchingCreationDate: Fri Sep 14 17:40:57 2001 +%%DocumentFonts: NewCenturySchlbk-Roman +%%+ Courier +%%EOF diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi new file mode 100644 index 00000000000..e632b3d6788 --- /dev/null +++ b/doc/lispintro/emacs-lisp-intro.texi @@ -0,0 +1,22721 @@ +\input texinfo @c -*-texinfo-*- +@comment %**start of header +@setfilename ../../info/eintr +@c setfilename emacs-lisp-intro.info +@c sethtmlfilename emacs-lisp-intro.html +@settitle Programming in Emacs Lisp +@syncodeindex vr cp +@syncodeindex fn cp +@setchapternewpage odd +@finalout + +@c --------- +@c <<<< For hard copy printing, this file is now +@c set for smallbook, which works for all sizes +@c of paper, and with Postscript figures >>>> +@smallbook +@clear largebook +@set print-postscript-figures +@c set largebook +@c clear print-postscript-figures +@c --------- + +@comment %**end of header + +@set edition-number 3.08 +@set update-date 12 September 2007 +@ignore + ## Summary of shell commands to create various output formats: + + pushd /usr/local/src/emacs/lispintro/ + ## pushd /u/intro/ + + ## Info output + makeinfo --paragraph-indent=0 --verbose emacs-lisp-intro.texi + + ## ;; (progn (when (bufferp (get-buffer "*info*")) (kill-buffer "*info*")) (info "/usr/local/src/emacs/info/eintr")) + + ## DVI output + texi2dvi emacs-lisp-intro.texi + + ## xdvi -margins 24pt -topmargin 4pt -offsets 24pt -geometry 760x1140 -s 5 -useTeXpages -mousemode 1 emacs-lisp-intro.dvi & + + ## HTML output + makeinfo --html --no-split --verbose emacs-lisp-intro.texi + + ## galeon emacs-lisp-intro.html + + ## Plain text output + makeinfo --fill-column=70 --no-split --paragraph-indent=0 \ + --verbose --no-headers --output=emacs-lisp-intro.txt emacs-lisp-intro.texi + + popd + +# as user `root' +# insert thumbdrive + mtusb # mount -v -t ext3 /dev/sda /mnt + cp -v /u/intro/emacs-lisp-intro.texi /mnt/backup/intro/emacs-lisp-intro.texi + umtusb # umount -v /mnt +# remove thumbdrive + + ## Other shell commands + + pushd /usr/local/src/emacs/lispintro/ + ## pushd /u/intro/ + + ## PDF + texi2dvi --pdf emacs-lisp-intro.texi + # xpdf emacs-lisp-intro.pdf & + + ## DocBook -- note file extension + makeinfo --docbook --no-split --paragraph-indent=0 \ + --verbose --output=emacs-lisp-intro.docbook emacs-lisp-intro.texi + + ## XML with a Texinfo DTD -- note file extension + makeinfo --xml --no-split --paragraph-indent=0 \ + --verbose --output=emacs-lisp-intro.texinfoxml emacs-lisp-intro.texi + + ## PostScript (needs DVI) + # gv emacs-lisp-intro.ps & + # Create DVI if we lack it + # texi2dvi emacs-lisp-intro.texi + dvips emacs-lisp-intro.dvi -o emacs-lisp-intro.ps + + ## RTF (needs HTML) + # Use OpenOffice to view RTF + # Create HTML if we lack it + # makeinfo --no-split --html emacs-lisp-intro.texi + /usr/local/src/html2rtf.pl emacs-lisp-intro.html + + ## LaTeX (needs RTF) + /usr/bin/rtf2latex emacs-lisp-intro.rtf + + popd + +@end ignore + +@c ================ Included Figures ================ + +@c Set print-postscript-figures if you print PostScript figures. +@c If you clear this, the ten figures will be printed as ASCII diagrams. +@c (This is not relevant to Info, since Info only handles ASCII.) +@c Your site may require editing changes to print PostScript; in this +@c case, search for `print-postscript-figures' and make appropriate changes. + +@c ================ How to Create an Info file ================ + +@c If you have `makeinfo' installed, run the following command + +@c makeinfo emacs-lisp-intro.texi + +@c or, if you want a single, large Info file, and no paragraph indents: +@c makeinfo --no-split --paragraph-indent=0 --verbose emacs-lisp-intro.texi + +@c After creating the Info file, edit your Info `dir' file, if the +@c `dircategory' section below does not enable your system to +@c install the manual automatically. +@c (The `dir' file is often in the `/usr/local/share/info/' directory.) + +@c ================ How to Create an HTML file ================ + +@c To convert to HTML format +@c makeinfo --html --no-split --verbose emacs-lisp-intro.texi + +@c ================ How to Print a Book in Various Sizes ================ + +@c This book can be printed in any of three different sizes. +@c In the above header, set @-commands appropriately. + +@c 7 by 9.25 inches: +@c @smallbook +@c @clear largebook + +@c 8.5 by 11 inches: +@c @c smallbook +@c @set largebook + +@c European A4 size paper: +@c @c smallbook +@c @afourpaper +@c @set largebook + +@c ================ How to Typeset and Print ================ + +@c If you do not include PostScript figures, run either of the +@c following command sequences, or similar commands suited to your +@c system: + +@c texi2dvi emacs-lisp-intro.texi +@c lpr -d emacs-lisp-intro.dvi + +@c or else: + +@c tex emacs-lisp-intro.texi +@c texindex emacs-lisp-intro.?? +@c tex emacs-lisp-intro.texi +@c lpr -d emacs-lisp-intro.dvi + +@c If you include the PostScript figures, and you have old software, +@c you may need to convert the .dvi file to a .ps file before +@c printing. Run either of the following command sequences, or one +@c similar: +@c +@c dvips -f < emacs-lisp-intro.dvi > emacs-lisp-intro.ps +@c +@c or else: +@c +@c postscript -p < emacs-lisp-intro.dvi > emacs-lisp-intro.ps +@c + +@c (Note: if you edit the book so as to change the length of the +@c table of contents, you may have to change the value of `pageno' below.) + +@c ================ End of Formatting Sections ================ + +@c For next or subsequent edition: +@c create function using with-output-to-temp-buffer +@c create a major mode, with keymaps +@c run an asynchronous process, like grep or diff + +@c For 8.5 by 11 inch format: do not use such a small amount of +@c whitespace between paragraphs as smallbook format +@ifset largebook +@tex +\global\parskip 6pt plus 1pt +@end tex +@end ifset + +@c For all sized formats: print within-book cross +@c reference with ``...'' rather than [...] + +@c This works with the texinfo.tex file, version 2003-05-04.08, +@c in the Texinfo version 4.6 of the 2003 Jun 13 distribution. + +@tex +\if \xrefprintnodename + \global\def\xrefprintnodename#1{\unskip, ``#1''} + \else + \global\def\xrefprintnodename#1{ ``#1''} +\fi +% \global\def\xrefprintnodename#1{, ``#1''} +@end tex + +@c ---------------------------------------------------- + +@dircategory Emacs +@direntry +* Emacs Lisp Intro: (eintr). + A simple introduction to Emacs Lisp programming. +@end direntry + +@copying +This is an @cite{Introduction to Programming in Emacs Lisp}, for +people who are not programmers. +@sp 1 +Edition @value{edition-number}, @value{update-date} +@sp 1 +Copyright @copyright{} 1990, 1991, 1992, 1993, 1994, 1995, 1997, 2001, + 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. +@sp 1 + +@iftex +Published by the:@* + +GNU Press, @hfill @uref{http://www.gnupress.org}@* +a division of the @hfill General: @email{press@@gnu.org}@* +Free Software Foundation, Inc. @hfill Orders:@w{ } @email{sales@@gnu.org}@* +51 Franklin Street, Fifth Floor @hfill Tel: +1 (617) 542-5942@* +Boston, MA 02110-1301 USA @hfill Fax: +1 (617) 542-2652@* +@end iftex + +@ifnottex +Published by the: + +@example +GNU Press, Website: http://www.gnupress.org +a division of the General: press@@gnu.org +Free Software Foundation, Inc. Orders: sales@@gnu.org +51 Franklin Street, Fifth Floor Tel: +1 (617) 542-5942 +Boston, MA 02110-1301 USA Fax: +1 (617) 542-2652 +@end example +@end ifnottex + +@sp 1 +@c Printed copies are available for $30 each.@* +ISBN 1-882114-43-4 + +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; there +being no Invariant Section, with the Front-Cover Texts being ``A GNU +Manual'', and with the Back-Cover Texts as in (a) below. A copy of +the license is included in the section entitled ``GNU Free +Documentation License''. + +(a) The FSF's Back-Cover Text is: ``You have freedom to copy and +modify this GNU Manual, like GNU software. Copies published by the +Free Software Foundation raise funds for GNU development.'' +@end copying + +@c half title; two lines here, so do not use `shorttitlepage' +@tex +{\begingroup% + \hbox{}\vskip 1.5in \chaprm \centerline{An Introduction to}% + \endgroup}% +{\begingroup\hbox{}\vskip 0.25in \chaprm% + \centerline{Programming in Emacs Lisp}% + \endgroup\page\hbox{}\page} +@end tex + +@titlepage +@sp 6 +@center @titlefont{An Introduction to} +@sp 2 +@center @titlefont{Programming in Emacs Lisp} +@sp 2 +@center Revised Third Edition +@sp 4 +@center by Robert J. Chassell + +@page +@vskip 0pt plus 1filll +@insertcopying +@end titlepage + +@iftex +@headings off +@evenheading @thispage @| @| @thischapter +@oddheading @thissection @| @| @thispage +@end iftex + +@ifnothtml +@c Keep T.O.C. short by tightening up for largebook +@ifset largebook +@tex +\global\parskip 2pt plus 1pt +\global\advance\baselineskip by -1pt +@end tex +@end ifset +@end ifnothtml + +@shortcontents +@contents + +@ifnottex +@node Top, Preface, (dir), (dir) +@top An Introduction to Programming in Emacs Lisp + +@insertcopying + +This master menu first lists each chapter and index; then it lists +every node in every chapter. +@end ifnottex + +@c >>>> Set pageno appropriately <<<< + +@c The first page of the Preface is a roman numeral; it is the first +@c right handed page after the Table of Contents; hence the following +@c setting must be for an odd negative number. + +@iftex +@global@pageno = -11 +@end iftex + +@menu +* Preface:: What to look for. +* List Processing:: What is Lisp? +* Practicing Evaluation:: Running several programs. +* Writing Defuns:: How to write function definitions. +* Buffer Walk Through:: Exploring a few buffer-related functions. +* More Complex:: A few, even more complex functions. +* Narrowing & Widening:: Restricting your and Emacs attention to + a region. +* car cdr & cons:: Fundamental functions in Lisp. +* Cutting & Storing Text:: Removing text and saving it. +* List Implementation:: How lists are implemented in the computer. +* Yanking:: Pasting stored text. +* Loops & Recursion:: How to repeat a process. +* Regexp Search:: Regular expression searches. +* Counting Words:: A review of repetition and regexps. +* Words in a defun:: Counting words in a @code{defun}. +* Readying a Graph:: A prototype graph printing function. +* Emacs Initialization:: How to write a @file{.emacs} file. +* Debugging:: How to run the Emacs Lisp debuggers. +* Conclusion:: Now you have the basics. +* the-the:: An appendix: how to find reduplicated words. +* Kill Ring:: An appendix: how the kill ring works. +* Full Graph:: How to create a graph with labelled axes. +* Free Software and Free Manuals:: +* GNU Free Documentation License:: +* Index:: +* About the Author:: + +@detailmenu + --- The Detailed Node Listing --- + +Preface + +* Why:: Why learn Emacs Lisp? +* On Reading this Text:: Read, gain familiarity, pick up habits.... +* Who You Are:: For whom this is written. +* Lisp History:: +* Note for Novices:: You can read this as a novice. +* Thank You:: + +List Processing + +* Lisp Lists:: What are lists? +* Run a Program:: Any list in Lisp is a program ready to run. +* Making Errors:: Generating an error message. +* Names & Definitions:: Names of symbols and function definitions. +* Lisp Interpreter:: What the Lisp interpreter does. +* Evaluation:: Running a program. +* Variables:: Returning a value from a variable. +* Arguments:: Passing information to a function. +* set & setq:: Setting the value of a variable. +* Summary:: The major points. +* Error Message Exercises:: + +Lisp Lists + +* Numbers Lists:: List have numbers, other lists, in them. +* Lisp Atoms:: Elemental entities. +* Whitespace in Lists:: Formatting lists to be readable. +* Typing Lists:: How GNU Emacs helps you type lists. + +The Lisp Interpreter + +* Complications:: Variables, Special forms, Lists within. +* Byte Compiling:: Specially processing code for speed. + +Evaluation + +* How the Interpreter Acts:: Returns and Side Effects... +* Evaluating Inner Lists:: Lists within lists... + +Variables + +* fill-column Example:: +* Void Function:: The error message for a symbol + without a function. +* Void Variable:: The error message for a symbol without a value. + +Arguments + +* Data types:: Types of data passed to a function. +* Args as Variable or List:: An argument can be the value + of a variable or list. +* Variable Number of Arguments:: Some functions may take a + variable number of arguments. +* Wrong Type of Argument:: Passing an argument of the wrong type + to a function. +* message:: A useful function for sending messages. + +Setting the Value of a Variable + +* Using set:: Setting values. +* Using setq:: Setting a quoted value. +* Counting:: Using @code{setq} to count. + +Practicing Evaluation + +* How to Evaluate:: Typing editing commands or @kbd{C-x C-e} + causes evaluation. +* Buffer Names:: Buffers and files are different. +* Getting Buffers:: Getting a buffer itself, not merely its name. +* Switching Buffers:: How to change to another buffer. +* Buffer Size & Locations:: Where point is located and the size of + the buffer. +* Evaluation Exercise:: + +How To Write Function Definitions + +* Primitive Functions:: +* defun:: The @code{defun} special form. +* Install:: Install a function definition. +* Interactive:: Making a function interactive. +* Interactive Options:: Different options for @code{interactive}. +* Permanent Installation:: Installing code permanently. +* let:: Creating and initializing local variables. +* if:: What if? +* else:: If--then--else expressions. +* Truth & Falsehood:: What Lisp considers false and true. +* save-excursion:: Keeping track of point, mark, and buffer. +* Review:: +* defun Exercises:: + +Install a Function Definition + +* Effect of installation:: +* Change a defun:: How to change a function definition. + +Make a Function Interactive + +* Interactive multiply-by-seven:: An overview. +* multiply-by-seven in detail:: The interactive version. + +@code{let} + +* Prevent confusion:: +* Parts of let Expression:: +* Sample let Expression:: +* Uninitialized let Variables:: + +The @code{if} Special Form + +* if in more detail:: +* type-of-animal in detail:: An example of an @code{if} expression. + +Truth and Falsehood in Emacs Lisp + +* nil explained:: @code{nil} has two meanings. + +@code{save-excursion} + +* Point and mark:: A review of various locations. +* Template for save-excursion:: + +A Few Buffer--Related Functions + +* Finding More:: How to find more information. +* simplified-beginning-of-buffer:: Shows @code{goto-char}, + @code{point-min}, and @code{push-mark}. +* mark-whole-buffer:: Almost the same as @code{beginning-of-buffer}. +* append-to-buffer:: Uses @code{save-excursion} and + @code{insert-buffer-substring}. +* Buffer Related Review:: Review. +* Buffer Exercises:: + +The Definition of @code{mark-whole-buffer} + +* mark-whole-buffer overview:: +* Body of mark-whole-buffer:: Only three lines of code. + +The Definition of @code{append-to-buffer} + +* append-to-buffer overview:: +* append interactive:: A two part interactive expression. +* append-to-buffer body:: Incorporates a @code{let} expression. +* append save-excursion:: How the @code{save-excursion} works. + +A Few More Complex Functions + +* copy-to-buffer:: With @code{set-buffer}, @code{get-buffer-create}. +* insert-buffer:: Read-only, and with @code{or}. +* beginning-of-buffer:: Shows @code{goto-char}, + @code{point-min}, and @code{push-mark}. +* Second Buffer Related Review:: +* optional Exercise:: + +The Definition of @code{insert-buffer} + +* insert-buffer code:: +* insert-buffer interactive:: When you can read, but not write. +* insert-buffer body:: The body has an @code{or} and a @code{let}. +* if & or:: Using an @code{if} instead of an @code{or}. +* Insert or:: How the @code{or} expression works. +* Insert let:: Two @code{save-excursion} expressions. +* New insert-buffer:: + +The Interactive Expression in @code{insert-buffer} + +* Read-only buffer:: When a buffer cannot be modified. +* b for interactive:: An existing buffer or else its name. + +Complete Definition of @code{beginning-of-buffer} + +* Optional Arguments:: +* beginning-of-buffer opt arg:: Example with optional argument. +* beginning-of-buffer complete:: + +@code{beginning-of-buffer} with an Argument + +* Disentangle beginning-of-buffer:: +* Large buffer case:: +* Small buffer case:: + +Narrowing and Widening + +* Narrowing advantages:: The advantages of narrowing +* save-restriction:: The @code{save-restriction} special form. +* what-line:: The number of the line that point is on. +* narrow Exercise:: + +@code{car}, @code{cdr}, @code{cons}: Fundamental Functions + +* Strange Names:: An historical aside: why the strange names? +* car & cdr:: Functions for extracting part of a list. +* cons:: Constructing a list. +* nthcdr:: Calling @code{cdr} repeatedly. +* nth:: +* setcar:: Changing the first element of a list. +* setcdr:: Changing the rest of a list. +* cons Exercise:: + +@code{cons} + +* Build a list:: +* length:: How to find the length of a list. + +Cutting and Storing Text + +* Storing Text:: Text is stored in a list. +* zap-to-char:: Cutting out text up to a character. +* kill-region:: Cutting text out of a region. +* copy-region-as-kill:: A definition for copying text. +* Digression into C:: Minor note on C programming language macros. +* defvar:: How to give a variable an initial value. +* cons & search-fwd Review:: +* search Exercises:: + +@code{zap-to-char} + +* Complete zap-to-char:: The complete implementation. +* zap-to-char interactive:: A three part interactive expression. +* zap-to-char body:: A short overview. +* search-forward:: How to search for a string. +* progn:: The @code{progn} special form. +* Summing up zap-to-char:: Using @code{point} and @code{search-forward}. + +@code{kill-region} + +* Complete kill-region:: The function definition. +* condition-case:: Dealing with a problem. +* Lisp macro:: + +@code{copy-region-as-kill} + +* Complete copy-region-as-kill:: The complete function definition. +* copy-region-as-kill body:: The body of @code{copy-region-as-kill}. + +The Body of @code{copy-region-as-kill} + +* last-command & this-command:: +* kill-append function:: +* kill-new function:: + +Initializing a Variable with @code{defvar} + +* See variable current value:: +* defvar and asterisk:: + +How Lists are Implemented + +* Lists diagrammed:: +* Symbols as Chest:: Exploring a powerful metaphor. +* List Exercise:: + +Yanking Text Back + +* Kill Ring Overview:: +* kill-ring-yank-pointer:: The kill ring is a list. +* yank nthcdr Exercises:: The @code{kill-ring-yank-pointer} variable. + +Loops and Recursion + +* while:: Causing a stretch of code to repeat. +* dolist dotimes:: +* Recursion:: Causing a function to call itself. +* Looping exercise:: + +@code{while} + +* Looping with while:: Repeat so long as test returns true. +* Loop Example:: A @code{while} loop that uses a list. +* print-elements-of-list:: Uses @code{while}, @code{car}, @code{cdr}. +* Incrementing Loop:: A loop with an incrementing counter. +* Incrementing Loop Details:: +* Decrementing Loop:: A loop with a decrementing counter. + +Details of an Incrementing Loop + +* Incrementing Example:: Counting pebbles in a triangle. +* Inc Example parts:: The parts of the function definition. +* Inc Example altogether:: Putting the function definition together. + +Loop with a Decrementing Counter + +* Decrementing Example:: More pebbles on the beach. +* Dec Example parts:: The parts of the function definition. +* Dec Example altogether:: Putting the function definition together. + +Save your time: @code{dolist} and @code{dotimes} + +* dolist:: +* dotimes:: + +Recursion + +* Building Robots:: Same model, different serial number ... +* Recursive Definition Parts:: Walk until you stop ... +* Recursion with list:: Using a list as the test whether to recurse. +* Recursive triangle function:: +* Recursion with cond:: +* Recursive Patterns:: Often used templates. +* No Deferment:: Don't store up work ... +* No deferment solution:: + +Recursion in Place of a Counter + +* Recursive Example arg of 1 or 2:: +* Recursive Example arg of 3 or 4:: + +Recursive Patterns + +* Every:: +* Accumulate:: +* Keep:: + +Regular Expression Searches + +* sentence-end:: The regular expression for @code{sentence-end}. +* re-search-forward:: Very similar to @code{search-forward}. +* forward-sentence:: A straightforward example of regexp search. +* forward-paragraph:: A somewhat complex example. +* etags:: How to create your own @file{TAGS} table. +* Regexp Review:: +* re-search Exercises:: + +@code{forward-sentence} + +* Complete forward-sentence:: +* fwd-sentence while loops:: Two @code{while} loops. +* fwd-sentence re-search:: A regular expression search. + +@code{forward-paragraph}: a Goldmine of Functions + +* forward-paragraph in brief:: Key parts of the function definition. +* fwd-para let:: The @code{let*} expression. +* fwd-para while:: The forward motion @code{while} loop. + +Counting: Repetition and Regexps + +* Why Count Words:: +* count-words-region:: Use a regexp, but find a problem. +* recursive-count-words:: Start with case of no words in region. +* Counting Exercise:: + +The @code{count-words-region} Function + +* Design count-words-region:: The definition using a @code{while} loop. +* Whitespace Bug:: The Whitespace Bug in @code{count-words-region}. + +Counting Words in a @code{defun} + +* Divide and Conquer:: +* Words and Symbols:: What to count? +* Syntax:: What constitutes a word or symbol? +* count-words-in-defun:: Very like @code{count-words}. +* Several defuns:: Counting several defuns in a file. +* Find a File:: Do you want to look at a file? +* lengths-list-file:: A list of the lengths of many definitions. +* Several files:: Counting in definitions in different files. +* Several files recursively:: Recursively counting in different files. +* Prepare the data:: Prepare the data for display in a graph. + +Count Words in @code{defuns} in Different Files + +* lengths-list-many-files:: Return a list of the lengths of defuns. +* append:: Attach one list to another. + +Prepare the Data for Display in a Graph + +* Data for Display in Detail:: +* Sorting:: Sorting lists. +* Files List:: Making a list of files. +* Counting function definitions:: + +Readying a Graph + +* Columns of a graph:: +* graph-body-print:: How to print the body of a graph. +* recursive-graph-body-print:: +* Printed Axes:: +* Line Graph Exercise:: + +Your @file{.emacs} File + +* Default Configuration:: +* Site-wide Init:: You can write site-wide init files. +* defcustom:: Emacs will write code for you. +* Beginning a .emacs File:: How to write a @code{.emacs file}. +* Text and Auto-fill:: Automatically wrap lines. +* Mail Aliases:: Use abbreviations for email addresses. +* Indent Tabs Mode:: Don't use tabs with @TeX{} +* Keybindings:: Create some personal keybindings. +* Keymaps:: More about key binding. +* Loading Files:: Load (i.e., evaluate) files automatically. +* Autoload:: Make functions available. +* Simple Extension:: Define a function; bind it to a key. +* X11 Colors:: Colors in X. +* Miscellaneous:: +* Mode Line:: How to customize your mode line. + +Debugging + +* debug:: How to use the built-in debugger. +* debug-on-entry:: Start debugging when you call a function. +* debug-on-quit:: Start debugging when you quit with @kbd{C-g}. +* edebug:: How to use Edebug, a source level debugger. +* Debugging Exercises:: + +Handling the Kill Ring + +* What the Kill Ring Does:: +* current-kill:: +* yank:: Paste a copy of a clipped element. +* yank-pop:: Insert element pointed to. +* ring file:: + +The @code{current-kill} Function + +* Understanding current-kill:: + +@code{current-kill} in Outline + +* Body of current-kill:: +* Digression concerning error:: How to mislead humans, but not computers. +* Determining the Element:: + +A Graph with Labelled Axes + +* Labelled Example:: +* print-graph Varlist:: @code{let} expression in @code{print-graph}. +* print-Y-axis:: Print a label for the vertical axis. +* print-X-axis:: Print a horizontal label. +* Print Whole Graph:: The function to print a complete graph. + +The @code{print-Y-axis} Function + +* print-Y-axis in Detail:: +* Height of label:: What height for the Y axis? +* Compute a Remainder:: How to compute the remainder of a division. +* Y Axis Element:: Construct a line for the Y axis. +* Y-axis-column:: Generate a list of Y axis labels. +* print-Y-axis Penultimate:: A not quite final version. + +The @code{print-X-axis} Function + +* Similarities differences:: Much like @code{print-Y-axis}, but not exactly. +* X Axis Tic Marks:: Create tic marks for the horizontal axis. + +Printing the Whole Graph + +* The final version:: A few changes. +* Test print-graph:: Run a short test. +* Graphing words in defuns:: Executing the final code. +* lambda:: How to write an anonymous function. +* mapcar:: Apply a function to elements of a list. +* Another Bug:: Yet another bug @dots{} most insidious. +* Final printed graph:: The graph itself! + +@end detailmenu +@end menu + +@node Preface, List Processing, Top, Top +@comment node-name, next, previous, up +@unnumbered Preface + +Most of the GNU Emacs integrated environment is written in the programming +language called Emacs Lisp. The code written in this programming +language is the software---the sets of instructions---that tell the +computer what to do when you give it commands. Emacs is designed so +that you can write new code in Emacs Lisp and easily install it as an +extension to the editor. + +(GNU Emacs is sometimes called an ``extensible editor'', but it does +much more than provide editing capabilities. It is better to refer to +Emacs as an ``extensible computing environment''. However, that +phrase is quite a mouthful. It is easier to refer to Emacs simply as +an editor. Moreover, everything you do in Emacs---find the Mayan date +and phases of the moon, simplify polynomials, debug code, manage +files, read letters, write books---all these activities are kinds of +editing in the most general sense of the word.) + +@menu +* Why:: Why learn Emacs Lisp? +* On Reading this Text:: Read, gain familiarity, pick up habits.... +* Who You Are:: For whom this is written. +* Lisp History:: +* Note for Novices:: You can read this as a novice. +* Thank You:: +@end menu + +@node Why, On Reading this Text, Preface, Preface +@ifnottex +@unnumberedsec Why Study Emacs Lisp? +@end ifnottex + +Although Emacs Lisp is usually thought of in association only with Emacs, +it is a full computer programming language. You can use Emacs Lisp as +you would any other programming language. + +Perhaps you want to understand programming; perhaps you want to extend +Emacs; or perhaps you want to become a programmer. This introduction to +Emacs Lisp is designed to get you started: to guide you in learning the +fundamentals of programming, and more importantly, to show you how you +can teach yourself to go further. + +@node On Reading this Text, Who You Are, Why, Preface +@comment node-name, next, previous, up +@unnumberedsec On Reading this Text + +All through this document, you will see little sample programs you can +run inside of Emacs. If you read this document in Info inside of GNU +Emacs, you can run the programs as they appear. (This is easy to do and +is explained when the examples are presented.) Alternatively, you can +read this introduction as a printed book while sitting beside a computer +running Emacs. (This is what I like to do; I like printed books.) If +you don't have a running Emacs beside you, you can still read this book, +but in this case, it is best to treat it as a novel or as a travel guide +to a country not yet visited: interesting, but not the same as being +there. + +Much of this introduction is dedicated to walk-throughs or guided tours +of code used in GNU Emacs. These tours are designed for two purposes: +first, to give you familiarity with real, working code (code you use +every day); and, second, to give you familiarity with the way Emacs +works. It is interesting to see how a working environment is +implemented. +Also, I +hope that you will pick up the habit of browsing through source code. +You can learn from it and mine it for ideas. Having GNU Emacs is like +having a dragon's cave of treasures. + +In addition to learning about Emacs as an editor and Emacs Lisp as a +programming language, the examples and guided tours will give you an +opportunity to get acquainted with Emacs as a Lisp programming +environment. GNU Emacs supports programming and provides tools that +you will want to become comfortable using, such as @kbd{M-.} (the key +which invokes the @code{find-tag} command). You will also learn about +buffers and other objects that are part of the environment. +Learning about these features of Emacs is like learning new routes +around your home town. + +@ignore +In addition, I have written several programs as extended examples. +Although these are examples, the programs are real. I use them. +Other people use them. You may use them. Beyond the fragments of +programs used for illustrations, there is very little in here that is +`just for teaching purposes'; what you see is used. This is a great +advantage of Emacs Lisp: it is easy to learn to use it for work. +@end ignore + +Finally, I hope to convey some of the skills for using Emacs to +learn aspects of programming that you don't know. You can often use +Emacs to help you understand what puzzles you or to find out how to do +something new. This self-reliance is not only a pleasure, but an +advantage. + +@node Who You Are, Lisp History, On Reading this Text, Preface +@comment node-name, next, previous, up +@unnumberedsec For Whom This is Written + +This text is written as an elementary introduction for people who are +not programmers. If you are a programmer, you may not be satisfied with +this primer. The reason is that you may have become expert at reading +reference manuals and be put off by the way this text is organized. + +An expert programmer who reviewed this text said to me: + +@quotation +@i{I prefer to learn from reference manuals. I ``dive into'' each +paragraph, and ``come up for air'' between paragraphs.} + +@i{When I get to the end of a paragraph, I assume that that subject is +done, finished, that I know everything I need (with the +possible exception of the case when the next paragraph starts talking +about it in more detail). I expect that a well written reference manual +will not have a lot of redundancy, and that it will have excellent +pointers to the (one) place where the information I want is.} +@end quotation + +This introduction is not written for this person! + +Firstly, I try to say everything at least three times: first, to +introduce it; second, to show it in context; and third, to show it in a +different context, or to review it. + +Secondly, I hardly ever put all the information about a subject in one +place, much less in one paragraph. To my way of thinking, that imposes +too heavy a burden on the reader. Instead I try to explain only what +you need to know at the time. (Sometimes I include a little extra +information so you won't be surprised later when the additional +information is formally introduced.) + +When you read this text, you are not expected to learn everything the +first time. Frequently, you need only make, as it were, a `nodding +acquaintance' with some of the items mentioned. My hope is that I have +structured the text and given you enough hints that you will be alert to +what is important, and concentrate on it. + +You will need to ``dive into'' some paragraphs; there is no other way +to read them. But I have tried to keep down the number of such +paragraphs. This book is intended as an approachable hill, rather than +as a daunting mountain. + +This introduction to @cite{Programming in Emacs Lisp} has a companion +document, +@iftex +@cite{The GNU Emacs Lisp Reference Manual}. +@end iftex +@ifnottex +@ref{Top, , The GNU Emacs Lisp Reference Manual, elisp, The GNU +Emacs Lisp Reference Manual}. +@end ifnottex +The reference manual has more detail than this introduction. In the +reference manual, all the information about one topic is concentrated +in one place. You should turn to it if you are like the programmer +quoted above. And, of course, after you have read this +@cite{Introduction}, you will find the @cite{Reference Manual} useful +when you are writing your own programs. + +@node Lisp History, Note for Novices, Who You Are, Preface +@unnumberedsec Lisp History +@cindex Lisp history + +Lisp was first developed in the late 1950s at the Massachusetts +Institute of Technology for research in artificial intelligence. The +great power of the Lisp language makes it superior for other purposes as +well, such as writing editor commands and integrated environments. + +@cindex Maclisp +@cindex Common Lisp +GNU Emacs Lisp is largely inspired by Maclisp, which was written at MIT +in the 1960s. It is somewhat inspired by Common Lisp, which became a +standard in the 1980s. However, Emacs Lisp is much simpler than Common +Lisp. (The standard Emacs distribution contains an optional extensions +file, @file{cl.el}, that adds many Common Lisp features to Emacs Lisp.) + +@node Note for Novices, Thank You, Lisp History, Preface +@comment node-name, next, previous, up +@unnumberedsec A Note for Novices + +If you don't know GNU Emacs, you can still read this document +profitably. However, I recommend you learn Emacs, if only to learn to +move around your computer screen. You can teach yourself how to use +Emacs with the on-line tutorial. To use it, type @kbd{C-h t}. (This +means you press and release the @key{CTRL} key and the @kbd{h} at the +same time, and then press and release @kbd{t}.) + +Also, I often refer to one of Emacs' standard commands by listing the +keys which you press to invoke the command and then giving the name of +the command in parentheses, like this: @kbd{M-C-\} +(@code{indent-region}). What this means is that the +@code{indent-region} command is customarily invoked by typing +@kbd{M-C-\}. (You can, if you wish, change the keys that are typed to +invoke the command; this is called @dfn{rebinding}. @xref{Keymaps, , +Keymaps}.) The abbreviation @kbd{M-C-\} means that you type your +@key{META} key, @key{CTRL} key and @key{\} key all at the same time. +(On many modern keyboards the @key{META} key is labelled +@key{ALT}.) +Sometimes a combination like this is called a keychord, since it is +similar to the way you play a chord on a piano. If your keyboard does +not have a @key{META} key, the @key{ESC} key prefix is used in place +of it. In this case, @kbd{M-C-\} means that you press and release your +@key{ESC} key and then type the @key{CTRL} key and the @key{\} key at +the same time. But usually @kbd{M-C-\} means press the @key{CTRL} key +along with the key that is labelled @key{ALT} and, at the same time, +press the @key{\} key. + +In addition to typing a lone keychord, you can prefix what you type +with @kbd{C-u}, which is called the `universal argument'. The +@kbd{C-u} keychord passes an argument to the subsequent command. +Thus, to indent a region of plain text by 6 spaces, mark the region, +and then type @w{@kbd{C-u 6 M-C-\}}. (If you do not specify a number, +Emacs either passes the number 4 to the command or otherwise runs the +command differently than it would otherwise.) @xref{Arguments, , +Numeric Arguments, emacs, The GNU Emacs Manual}. + +If you are reading this in Info using GNU Emacs, you can read through +this whole document just by pressing the space bar, @key{SPC}. +(To learn about Info, type @kbd{C-h i} and then select Info.) + +A note on terminology: when I use the word Lisp alone, I often am +referring to the various dialects of Lisp in general, but when I speak +of Emacs Lisp, I am referring to GNU Emacs Lisp in particular. + +@node Thank You, , Note for Novices, Preface +@comment node-name, next, previous, up +@unnumberedsec Thank You + +My thanks to all who helped me with this book. My especial thanks to +@r{Jim Blandy}, @r{Noah Friedman}, @w{Jim Kingdon}, @r{Roland +McGrath}, @w{Frank Ritter}, @w{Randy Smith}, @w{Richard M.@: +Stallman}, and @w{Melissa Weisshaus}. My thanks also go to both +@w{Philip Johnson} and @w{David Stampe} for their patient +encouragement. My mistakes are my own. + +@flushright +Robert J. Chassell +@email{bob@@gnu.org} +@end flushright + +@c ================ Beginning of main text ================ + +@c Start main text on right-hand (verso) page + +@tex +\par\vfill\supereject +\headings off +\ifodd\pageno + \par\vfill\supereject +\else + \par\vfill\supereject + \page\hbox{}\page + \par\vfill\supereject +\fi +@end tex + +@iftex +@headings off +@evenheading @thispage @| @| @thischapter +@oddheading @thissection @| @| @thispage +@global@pageno = 1 +@end iftex + +@node List Processing, Practicing Evaluation, Preface, Top +@comment node-name, next, previous, up +@chapter List Processing + +To the untutored eye, Lisp is a strange programming language. In Lisp +code there are parentheses everywhere. Some people even claim that +the name stands for `Lots of Isolated Silly Parentheses'. But the +claim is unwarranted. Lisp stands for LISt Processing, and the +programming language handles @emph{lists} (and lists of lists) by +putting them between parentheses. The parentheses mark the boundaries +of the list. Sometimes a list is preceded by a single apostrophe or +quotation mark, @samp{'}@footnote{The single apostrophe or quotation +mark is an abbreviation for the function @code{quote}; you need not +think about functions now; functions are defined in @ref{Making +Errors, , Generate an Error Message}.} Lists are the basis of Lisp. + +@menu +* Lisp Lists:: What are lists? +* Run a Program:: Any list in Lisp is a program ready to run. +* Making Errors:: Generating an error message. +* Names & Definitions:: Names of symbols and function definitions. +* Lisp Interpreter:: What the Lisp interpreter does. +* Evaluation:: Running a program. +* Variables:: Returning a value from a variable. +* Arguments:: Passing information to a function. +* set & setq:: Setting the value of a variable. +* Summary:: The major points. +* Error Message Exercises:: +@end menu + +@node Lisp Lists, Run a Program, List Processing, List Processing +@comment node-name, next, previous, up +@section Lisp Lists +@cindex Lisp Lists + +In Lisp, a list looks like this: @code{'(rose violet daisy buttercup)}. +This list is preceded by a single apostrophe. It could just as well be +written as follows, which looks more like the kind of list you are likely +to be familiar with: + +@smallexample +@group +'(rose + violet + daisy + buttercup) +@end group +@end smallexample + +@noindent +The elements of this list are the names of the four different flowers, +separated from each other by whitespace and surrounded by parentheses, +like flowers in a field with a stone wall around them. +@cindex Flowers in a field + +@menu +* Numbers Lists:: List have numbers, other lists, in them. +* Lisp Atoms:: Elemental entities. +* Whitespace in Lists:: Formatting lists to be readable. +* Typing Lists:: How GNU Emacs helps you type lists. +@end menu + +@node Numbers Lists, Lisp Atoms, Lisp Lists, Lisp Lists +@ifnottex +@unnumberedsubsec Numbers, Lists inside of Lists +@end ifnottex + +Lists can also have numbers in them, as in this list: @code{(+ 2 2)}. +This list has a plus-sign, @samp{+}, followed by two @samp{2}s, each +separated by whitespace. + +In Lisp, both data and programs are represented the same way; that is, +they are both lists of words, numbers, or other lists, separated by +whitespace and surrounded by parentheses. (Since a program looks like +data, one program may easily serve as data for another; this is a very +powerful feature of Lisp.) (Incidentally, these two parenthetical +remarks are @emph{not} Lisp lists, because they contain @samp{;} and +@samp{.} as punctuation marks.) + +@need 1200 +Here is another list, this time with a list inside of it: + +@smallexample +'(this list has (a list inside of it)) +@end smallexample + +The components of this list are the words @samp{this}, @samp{list}, +@samp{has}, and the list @samp{(a list inside of it)}. The interior +list is made up of the words @samp{a}, @samp{list}, @samp{inside}, +@samp{of}, @samp{it}. + +@node Lisp Atoms, Whitespace in Lists, Numbers Lists, Lisp Lists +@comment node-name, next, previous, up +@subsection Lisp Atoms +@cindex Lisp Atoms + +In Lisp, what we have been calling words are called @dfn{atoms}. This +term comes from the historical meaning of the word atom, which means +`indivisible'. As far as Lisp is concerned, the words we have been +using in the lists cannot be divided into any smaller parts and still +mean the same thing as part of a program; likewise with numbers and +single character symbols like @samp{+}. On the other hand, unlike an +ancient atom, a list can be split into parts. (@xref{car cdr & cons, +, @code{car} @code{cdr} & @code{cons} Fundamental Functions}.) + +In a list, atoms are separated from each other by whitespace. They can be +right next to a parenthesis. + +@cindex @samp{empty list} defined +Technically speaking, a list in Lisp consists of parentheses surrounding +atoms separated by whitespace or surrounding other lists or surrounding +both atoms and other lists. A list can have just one atom in it or +have nothing in it at all. A list with nothing in it looks like this: +@code{()}, and is called the @dfn{empty list}. Unlike anything else, an +empty list is considered both an atom and a list at the same time. + +@cindex Symbolic expressions, introduced +@cindex @samp{expression} defined +@cindex @samp{form} defined +The printed representation of both atoms and lists are called +@dfn{symbolic expressions} or, more concisely, @dfn{s-expressions}. +The word @dfn{expression} by itself can refer to either the printed +representation, or to the atom or list as it is held internally in the +computer. Often, people use the term @dfn{expression} +indiscriminately. (Also, in many texts, the word @dfn{form} is used +as a synonym for expression.) + +Incidentally, the atoms that make up our universe were named such when +they were thought to be indivisible; but it has been found that physical +atoms are not indivisible. Parts can split off an atom or it can +fission into two parts of roughly equal size. Physical atoms were named +prematurely, before their truer nature was found. In Lisp, certain +kinds of atom, such as an array, can be separated into parts; but the +mechanism for doing this is different from the mechanism for splitting a +list. As far as list operations are concerned, the atoms of a list are +unsplittable. + +As in English, the meanings of the component letters of a Lisp atom +are different from the meaning the letters make as a word. For +example, the word for the South American sloth, the @samp{ai}, is +completely different from the two words, @samp{a}, and @samp{i}. + +There are many kinds of atom in nature but only a few in Lisp: for +example, @dfn{numbers}, such as 37, 511, or 1729, and @dfn{symbols}, such +as @samp{+}, @samp{foo}, or @samp{forward-line}. The words we have +listed in the examples above are all symbols. In everyday Lisp +conversation, the word ``atom'' is not often used, because programmers +usually try to be more specific about what kind of atom they are dealing +with. Lisp programming is mostly about symbols (and sometimes numbers) +within lists. (Incidentally, the preceding three word parenthetical +remark is a proper list in Lisp, since it consists of atoms, which in +this case are symbols, separated by whitespace and enclosed by +parentheses, without any non-Lisp punctuation.) + +@need 1250 +In addition, text between double quotation marks---even sentences or +paragraphs---is an atom. Here is an example: +@cindex Text between double quotation marks + +@smallexample +'(this list includes "text between quotation marks.") +@end smallexample + +@cindex @samp{string} defined +@noindent +In Lisp, all of the quoted text including the punctuation mark and the +blank spaces is a single atom. This kind of atom is called a +@dfn{string} (for `string of characters') and is the sort of thing that +is used for messages that a computer can print for a human to read. +Strings are a different kind of atom than numbers or symbols and are +used differently. + +@node Whitespace in Lists, Typing Lists, Lisp Atoms, Lisp Lists +@comment node-name, next, previous, up +@subsection Whitespace in Lists +@cindex Whitespace in lists + +@need 1200 +The amount of whitespace in a list does not matter. From the point of view +of the Lisp language, + +@smallexample +@group +'(this list + looks like this) +@end group +@end smallexample + +@need 800 +@noindent +is exactly the same as this: + +@smallexample +'(this list looks like this) +@end smallexample + +Both examples show what to Lisp is the same list, the list made up of +the symbols @samp{this}, @samp{list}, @samp{looks}, @samp{like}, and +@samp{this} in that order. + +Extra whitespace and newlines are designed to make a list more readable +by humans. When Lisp reads the expression, it gets rid of all the extra +whitespace (but it needs to have at least one space between atoms in +order to tell them apart.) + +Odd as it seems, the examples we have seen cover almost all of what Lisp +lists look like! Every other list in Lisp looks more or less like one +of these examples, except that the list may be longer and more complex. +In brief, a list is between parentheses, a string is between quotation +marks, a symbol looks like a word, and a number looks like a number. +(For certain situations, square brackets, dots and a few other special +characters may be used; however, we will go quite far without them.) + +@node Typing Lists, , Whitespace in Lists, Lisp Lists +@comment node-name, next, previous, up +@subsection GNU Emacs Helps You Type Lists +@cindex Help typing lists +@cindex Formatting help + +When you type a Lisp expression in GNU Emacs using either Lisp +Interaction mode or Emacs Lisp mode, you have available to you several +commands to format the Lisp expression so it is easy to read. For +example, pressing the @key{TAB} key automatically indents the line the +cursor is on by the right amount. A command to properly indent the +code in a region is customarily bound to @kbd{M-C-\}. Indentation is +designed so that you can see which elements of a list belong to which +list---elements of a sub-list are indented more than the elements of +the enclosing list. + +In addition, when you type a closing parenthesis, Emacs momentarily +jumps the cursor back to the matching opening parenthesis, so you can +see which one it is. This is very useful, since every list you type +in Lisp must have its closing parenthesis match its opening +parenthesis. (@xref{Major Modes, , Major Modes, emacs, The GNU Emacs +Manual}, for more information about Emacs' modes.) + +@node Run a Program, Making Errors, Lisp Lists, List Processing +@comment node-name, next, previous, up +@section Run a Program +@cindex Run a program +@cindex Program, running one + +@cindex @samp{evaluate} defined +A list in Lisp---any list---is a program ready to run. If you run it +(for which the Lisp jargon is @dfn{evaluate}), the computer will do one +of three things: do nothing except return to you the list itself; send +you an error message; or, treat the first symbol in the list as a +command to do something. (Usually, of course, it is the last of these +three things that you really want!) + +@c use code for the single apostrophe, not samp. +The single apostrophe, @code{'}, that I put in front of some of the +example lists in preceding sections is called a @dfn{quote}; when it +precedes a list, it tells Lisp to do nothing with the list, other than +take it as it is written. But if there is no quote preceding a list, +the first item of the list is special: it is a command for the computer +to obey. (In Lisp, these commands are called @emph{functions}.) The list +@code{(+ 2 2)} shown above did not have a quote in front of it, so Lisp +understands that the @code{+} is an instruction to do something with the +rest of the list: add the numbers that follow. + +@need 1250 +If you are reading this inside of GNU Emacs in Info, here is how you can +evaluate such a list: place your cursor immediately after the right +hand parenthesis of the following list and then type @kbd{C-x C-e}: + +@smallexample +(+ 2 2) +@end smallexample + +@c use code for the number four, not samp. +@noindent +You will see the number @code{4} appear in the echo area. (In the +jargon, what you have just done is ``evaluate the list.'' The echo area +is the line at the bottom of the screen that displays or ``echoes'' +text.) Now try the same thing with a quoted list: place the cursor +right after the following list and type @kbd{C-x C-e}: + +@smallexample +'(this is a quoted list) +@end smallexample + +@noindent +You will see @code{(this is a quoted list)} appear in the echo area. + +@cindex Lisp interpreter, explained +@cindex Interpreter, Lisp, explained +In both cases, what you are doing is giving a command to the program +inside of GNU Emacs called the @dfn{Lisp interpreter}---giving the +interpreter a command to evaluate the expression. The name of the Lisp +interpreter comes from the word for the task done by a human who comes +up with the meaning of an expression---who ``interprets'' it. + +You can also evaluate an atom that is not part of a list---one that is +not surrounded by parentheses; again, the Lisp interpreter translates +from the humanly readable expression to the language of the computer. +But before discussing this (@pxref{Variables}), we will discuss what the +Lisp interpreter does when you make an error. + +@node Making Errors, Names & Definitions, Run a Program, List Processing +@comment node-name, next, previous, up +@section Generate an Error Message +@cindex Generate an error message +@cindex Error message generation + +Partly so you won't worry if you do it accidentally, we will now give +a command to the Lisp interpreter that generates an error message. +This is a harmless activity; and indeed, we will often try to generate +error messages intentionally. Once you understand the jargon, error +messages can be informative. Instead of being called ``error'' +messages, they should be called ``help'' messages. They are like +signposts to a traveller in a strange country; deciphering them can be +hard, but once understood, they can point the way. + +The error message is generated by a built-in GNU Emacs debugger. We +will `enter the debugger'. You get out of the debugger by typing @code{q}. + +What we will do is evaluate a list that is not quoted and does not +have a meaningful command as its first element. Here is a list almost +exactly the same as the one we just used, but without the single-quote +in front of it. Position the cursor right after it and type @kbd{C-x +C-e}: + +@smallexample +(this is an unquoted list) +@end smallexample + +@noindent +What you see depends on which version of Emacs you are running. GNU +Emacs version 22 provides more information than version 20 and before. +First, the more recent result of generating an error; then the +earlier, version 20 result. + +@need 1250 +@noindent +In GNU Emacs version 22, a @file{*Backtrace*} window will open up and +you will see the following in it: + +@smallexample +@group +---------- Buffer: *Backtrace* ---------- +Debugger entered--Lisp error: (void-function this) + (this is an unquoted list) + eval((this is an unquoted list)) + eval-last-sexp-1(nil) + eval-last-sexp(nil) + call-interactively(eval-last-sexp) +---------- Buffer: *Backtrace* ---------- +@end group +@end smallexample + +@need 1200 +@noindent +Your cursor will be in this window (you may have to wait a few seconds +before it becomes visible). To quit the debugger and make the +debugger window go away, type: + +@smallexample +q +@end smallexample + +@noindent +Please type @kbd{q} right now, so you become confident that you can +get out of the debugger. Then, type @kbd{C-x C-e} again to re-enter +it. + +@cindex @samp{function} defined +Based on what we already know, we can almost read this error message. + +You read the @file{*Backtrace*} buffer from the bottom up; it tells +you what Emacs did. When you typed @kbd{C-x C-e}, you made an +interactive call to the command @code{eval-last-sexp}. @code{eval} is +an abbreviation for `evaluate' and @code{sexp} is an abbreviation for +`symbolic expression'. The command means `evaluate last symbolic +expression', which is the expression just before your cursor. + +Each line above tells you what the Lisp interpreter evaluated next. +The most recent action is at the top. The buffer is called the +@file{*Backtrace*} buffer because it enables you to track Emacs +backwards. + +@need 800 +At the top of the @file{*Backtrace*} buffer, you see the line: + +@smallexample +Debugger entered--Lisp error: (void-function this) +@end smallexample + +@noindent +The Lisp interpreter tried to evaluate the first atom of the list, the +word @samp{this}. It is this action that generated the error message +@samp{void-function this}. + +The message contains the words @samp{void-function} and @samp{this}. + +@cindex @samp{function} defined +The word @samp{function} was mentioned once before. It is a very +important word. For our purposes, we can define it by saying that a +@dfn{function} is a set of instructions to the computer that tell the +computer to do something. + +Now we can begin to understand the error message: @samp{void-function +this}. The function (that is, the word @samp{this}) does not have a +definition of any set of instructions for the computer to carry out. + +The slightly odd word, @samp{void-function}, is designed to cover the +way Emacs Lisp is implemented, which is that when a symbol does not +have a function definition attached to it, the place that should +contain the instructions is `void'. + +On the other hand, since we were able to add 2 plus 2 successfully, by +evaluating @code{(+ 2 2)}, we can infer that the symbol @code{+} must +have a set of instructions for the computer to obey and those +instructions must be to add the numbers that follow the @code{+}. + +@need 1250 +In GNU Emacs version 20, and in earlier versions, you will see only +one line of error message; it will appear in the echo area and look +like this: + +@smallexample +Symbol's function definition is void:@: this +@end smallexample + +@noindent +(Also, your terminal may beep at you---some do, some don't; and others +blink. This is just a device to get your attention.) The message goes +away as soon as you type another key, even just to move the cursor. + +We know the meaning of the word @samp{Symbol}. It refers to the first +atom of the list, the word @samp{this}. The word @samp{function} +refers to the instructions that tell the computer what to do. +(Technically, the symbol tells the computer where to find the +instructions, but this is a complication we can ignore for the +moment.) + +The error message can be understood: @samp{Symbol's function +definition is void:@: this}. The symbol (that is, the word +@samp{this}) lacks instructions for the computer to carry out. + +@node Names & Definitions, Lisp Interpreter, Making Errors, List Processing +@comment node-name, next, previous, up +@section Symbol Names and Function Definitions +@cindex Symbol names + +We can articulate another characteristic of Lisp based on what we have +discussed so far---an important characteristic: a symbol, like +@code{+}, is not itself the set of instructions for the computer to +carry out. Instead, the symbol is used, perhaps temporarily, as a way +of locating the definition or set of instructions. What we see is the +name through which the instructions can be found. Names of people +work the same way. I can be referred to as @samp{Bob}; however, I am +not the letters @samp{B}, @samp{o}, @samp{b} but am, or was, the +consciousness consistently associated with a particular life-form. +The name is not me, but it can be used to refer to me. + +In Lisp, one set of instructions can be attached to several names. +For example, the computer instructions for adding numbers can be +linked to the symbol @code{plus} as well as to the symbol @code{+} +(and are in some dialects of Lisp). Among humans, I can be referred +to as @samp{Robert} as well as @samp{Bob} and by other words as well. + +On the other hand, a symbol can have only one function definition +attached to it at a time. Otherwise, the computer would be confused as +to which definition to use. If this were the case among people, only +one person in the world could be named @samp{Bob}. However, the function +definition to which the name refers can be changed readily. +(@xref{Install, , Install a Function Definition}.) + +Since Emacs Lisp is large, it is customary to name symbols in a way +that identifies the part of Emacs to which the function belongs. +Thus, all the names for functions that deal with Texinfo start with +@samp{texinfo-} and those for functions that deal with reading mail +start with @samp{rmail-}. + +@node Lisp Interpreter, Evaluation, Names & Definitions, List Processing +@comment node-name, next, previous, up +@section The Lisp Interpreter +@cindex Lisp interpreter, what it does +@cindex Interpreter, what it does + +Based on what we have seen, we can now start to figure out what the +Lisp interpreter does when we command it to evaluate a list. +First, it looks to see whether there is a quote before the list; if +there is, the interpreter just gives us the list. On the other +hand, if there is no quote, the interpreter looks at the first element +in the list and sees whether it has a function definition. If it does, +the interpreter carries out the instructions in the function definition. +Otherwise, the interpreter prints an error message. + +This is how Lisp works. Simple. There are added complications which we +will get to in a minute, but these are the fundamentals. Of course, to +write Lisp programs, you need to know how to write function definitions +and attach them to names, and how to do this without confusing either +yourself or the computer. + +@menu +* Complications:: Variables, Special forms, Lists within. +* Byte Compiling:: Specially processing code for speed. +@end menu + +@node Complications, Byte Compiling, Lisp Interpreter, Lisp Interpreter +@ifnottex +@unnumberedsubsec Complications +@end ifnottex + +Now, for the first complication. In addition to lists, the Lisp +interpreter can evaluate a symbol that is not quoted and does not have +parentheses around it. The Lisp interpreter will attempt to determine +the symbol's value as a @dfn{variable}. This situation is described +in the section on variables. (@xref{Variables}.) + +@cindex Special form +The second complication occurs because some functions are unusual and do +not work in the usual manner. Those that don't are called @dfn{special +forms}. They are used for special jobs, like defining a function, and +there are not many of them. In the next few chapters, you will be +introduced to several of the more important special forms. + +The third and final complication is this: if the function that the +Lisp interpreter is looking at is not a special form, and if it is part +of a list, the Lisp interpreter looks to see whether the list has a list +inside of it. If there is an inner list, the Lisp interpreter first +figures out what it should do with the inside list, and then it works on +the outside list. If there is yet another list embedded inside the +inner list, it works on that one first, and so on. It always works on +the innermost list first. The interpreter works on the innermost list +first, to evaluate the result of that list. The result may be +used by the enclosing expression. + +Otherwise, the interpreter works left to right, from one expression to +the next. + +@node Byte Compiling, , Complications, Lisp Interpreter +@subsection Byte Compiling +@cindex Byte compiling + +One other aspect of interpreting: the Lisp interpreter is able to +interpret two kinds of entity: humanly readable code, on which we will +focus exclusively, and specially processed code, called @dfn{byte +compiled} code, which is not humanly readable. Byte compiled code +runs faster than humanly readable code. + +You can transform humanly readable code into byte compiled code by +running one of the compile commands such as @code{byte-compile-file}. +Byte compiled code is usually stored in a file that ends with a +@file{.elc} extension rather than a @file{.el} extension. You will +see both kinds of file in the @file{emacs/lisp} directory; the files +to read are those with @file{.el} extensions. + +As a practical matter, for most things you might do to customize or +extend Emacs, you do not need to byte compile; and I will not discuss +the topic here. @xref{Byte Compilation, , Byte Compilation, elisp, +The GNU Emacs Lisp Reference Manual}, for a full description of byte +compilation. + +@node Evaluation, Variables, Lisp Interpreter, List Processing +@comment node-name, next, previous, up +@section Evaluation +@cindex Evaluation + +When the Lisp interpreter works on an expression, the term for the +activity is called @dfn{evaluation}. We say that the interpreter +`evaluates the expression'. I've used this term several times before. +The word comes from its use in everyday language, `to ascertain the +value or amount of; to appraise', according to @cite{Webster's New +Collegiate Dictionary}. + +@menu +* How the Interpreter Acts:: Returns and Side Effects... +* Evaluating Inner Lists:: Lists within lists... +@end menu + +@node How the Interpreter Acts, Evaluating Inner Lists, Evaluation, Evaluation +@ifnottex +@unnumberedsubsec How the Lisp Interpreter Acts +@end ifnottex + +@cindex @samp{returned value} explained +After evaluating an expression, the Lisp interpreter will most likely +@dfn{return} the value that the computer produces by carrying out the +instructions it found in the function definition, or perhaps it will +give up on that function and produce an error message. (The interpreter +may also find itself tossed, so to speak, to a different function or it +may attempt to repeat continually what it is doing for ever and ever in +what is called an `infinite loop'. These actions are less common; and +we can ignore them.) Most frequently, the interpreter returns a value. + +@cindex @samp{side effect} defined +At the same time the interpreter returns a value, it may do something +else as well, such as move a cursor or copy a file; this other kind of +action is called a @dfn{side effect}. Actions that we humans think are +important, such as printing results, are often ``side effects'' to the +Lisp interpreter. The jargon can sound peculiar, but it turns out that +it is fairly easy to learn to use side effects. + +In summary, evaluating a symbolic expression most commonly causes the +Lisp interpreter to return a value and perhaps carry out a side effect; +or else produce an error. + +@node Evaluating Inner Lists, , How the Interpreter Acts, Evaluation +@comment node-name, next, previous, up +@subsection Evaluating Inner Lists +@cindex Inner list evaluation +@cindex Evaluating inner lists + +If evaluation applies to a list that is inside another list, the outer +list may use the value returned by the first evaluation as information +when the outer list is evaluated. This explains why inner expressions +are evaluated first: the values they return are used by the outer +expressions. + +@need 1250 +We can investigate this process by evaluating another addition example. +Place your cursor after the following expression and type @kbd{C-x C-e}: + +@smallexample +(+ 2 (+ 3 3)) +@end smallexample + +@noindent +The number 8 will appear in the echo area. + +What happens is that the Lisp interpreter first evaluates the inner +expression, @code{(+ 3 3)}, for which the value 6 is returned; then it +evaluates the outer expression as if it were written @code{(+ 2 6)}, which +returns the value 8. Since there are no more enclosing expressions to +evaluate, the interpreter prints that value in the echo area. + +Now it is easy to understand the name of the command invoked by the +keystrokes @kbd{C-x C-e}: the name is @code{eval-last-sexp}. The +letters @code{sexp} are an abbreviation for `symbolic expression', and +@code{eval} is an abbreviation for `evaluate'. The command means +`evaluate last symbolic expression'. + +As an experiment, you can try evaluating the expression by putting the +cursor at the beginning of the next line immediately following the +expression, or inside the expression. + +@need 800 +Here is another copy of the expression: + +@smallexample +(+ 2 (+ 3 3)) +@end smallexample + +@noindent +If you place the cursor at the beginning of the blank line that +immediately follows the expression and type @kbd{C-x C-e}, you will +still get the value 8 printed in the echo area. Now try putting the +cursor inside the expression. If you put it right after the next to +last parenthesis (so it appears to sit on top of the last parenthesis), +you will get a 6 printed in the echo area! This is because the command +evaluates the expression @code{(+ 3 3)}. + +Now put the cursor immediately after a number. Type @kbd{C-x C-e} and +you will get the number itself. In Lisp, if you evaluate a number, you +get the number itself---this is how numbers differ from symbols. If you +evaluate a list starting with a symbol like @code{+}, you will get a +value returned that is the result of the computer carrying out the +instructions in the function definition attached to that name. If a +symbol by itself is evaluated, something different happens, as we will +see in the next section. + +@node Variables, Arguments, Evaluation, List Processing +@comment node-name, next, previous, up +@section Variables +@cindex Variables + +In Emacs Lisp, a symbol can have a value attached to it just as it can +have a function definition attached to it. The two are different. +The function definition is a set of instructions that a computer will +obey. A value, on the other hand, is something, such as number or a +name, that can vary (which is why such a symbol is called a variable). +The value of a symbol can be any expression in Lisp, such as a symbol, +number, list, or string. A symbol that has a value is often called a +@dfn{variable}. + +A symbol can have both a function definition and a value attached to +it at the same time. Or it can have just one or the other. +The two are separate. This is somewhat similar +to the way the name Cambridge can refer to the city in Massachusetts +and have some information attached to the name as well, such as +``great programming center''. + +@ignore +(Incidentally, in Emacs Lisp, a symbol can have two +other things attached to it, too: a property list and a documentation +string; these are discussed later.) +@end ignore + +Another way to think about this is to imagine a symbol as being a chest +of drawers. The function definition is put in one drawer, the value in +another, and so on. What is put in the drawer holding the value can be +changed without affecting the contents of the drawer holding the +function definition, and vice-verse. + +@menu +* fill-column Example:: +* Void Function:: The error message for a symbol + without a function. +* Void Variable:: The error message for a symbol without a value. +@end menu + +@node fill-column Example, Void Function, Variables, Variables +@ifnottex +@unnumberedsubsec @code{fill-column}, an Example Variable +@end ifnottex + +@findex fill-column, @r{an example variable} +@cindex Example variable, @code{fill-column} +@cindex Variable, example of, @code{fill-column} +The variable @code{fill-column} illustrates a symbol with a value +attached to it: in every GNU Emacs buffer, this symbol is set to some +value, usually 72 or 70, but sometimes to some other value. To find the +value of this symbol, evaluate it by itself. If you are reading this in +Info inside of GNU Emacs, you can do this by putting the cursor after +the symbol and typing @kbd{C-x C-e}: + +@smallexample +fill-column +@end smallexample + +@noindent +After I typed @kbd{C-x C-e}, Emacs printed the number 72 in my echo +area. This is the value for which @code{fill-column} is set for me as I +write this. It may be different for you in your Info buffer. Notice +that the value returned as a variable is printed in exactly the same way +as the value returned by a function carrying out its instructions. From +the point of view of the Lisp interpreter, a value returned is a value +returned. What kind of expression it came from ceases to matter once +the value is known. + +A symbol can have any value attached to it or, to use the jargon, we can +@dfn{bind} the variable to a value: to a number, such as 72; to a +string, @code{"such as this"}; to a list, such as @code{(spruce pine +oak)}; we can even bind a variable to a function definition. + +A symbol can be bound to a value in several ways. @xref{set & setq, , +Setting the Value of a Variable}, for information about one way to do +this. + +@node Void Function, Void Variable, fill-column Example, Variables +@comment node-name, next, previous, up +@subsection Error Message for a Symbol Without a Function +@cindex Symbol without function error +@cindex Error for symbol without function + +When we evaluated @code{fill-column} to find its value as a variable, +we did not place parentheses around the word. This is because we did +not intend to use it as a function name. + +If @code{fill-column} were the first or only element of a list, the +Lisp interpreter would attempt to find the function definition +attached to it. But @code{fill-column} has no function definition. +Try evaluating this: + +@smallexample +(fill-column) +@end smallexample + +@need 1250 +@noindent +In GNU Emacs version 22, you will create a @file{*Backtrace*} buffer +that says: + +@smallexample +@group +---------- Buffer: *Backtrace* ---------- +Debugger entered--Lisp error: (void-function fill-column) + (fill-column) + eval((fill-column)) + eval-last-sexp-1(nil) + eval-last-sexp(nil) + call-interactively(eval-last-sexp) +---------- Buffer: *Backtrace* ---------- +@end group +@end smallexample + +@noindent +(Remember, to quit the debugger and make the debugger window go away, +type @kbd{q} in the @file{*Backtrace*} buffer.) + +@ignore +@need 800 +In GNU Emacs 20 and before, you will produce an error message that says: + +@smallexample +Symbol's function definition is void:@: fill-column +@end smallexample + +@noindent +(The message will go away as soon as you move the cursor or type +another key.) +@end ignore + +@node Void Variable, , Void Function, Variables +@comment node-name, next, previous, up +@subsection Error Message for a Symbol Without a Value +@cindex Symbol without value error +@cindex Error for symbol without value + +If you attempt to evaluate a symbol that does not have a value bound to +it, you will receive an error message. You can see this by +experimenting with our 2 plus 2 addition. In the following expression, +put your cursor right after the @code{+}, before the first number 2, +type @kbd{C-x C-e}: + +@smallexample +(+ 2 2) +@end smallexample + +@need 1500 +@noindent +In GNU Emacs 22, you will create a @file{*Backtrace*} buffer that +says: + +@smallexample +@group +---------- Buffer: *Backtrace* ---------- +Debugger entered--Lisp error: (void-variable +) + eval(+) + eval-last-sexp-1(nil) + eval-last-sexp(nil) + call-interactively(eval-last-sexp) +---------- Buffer: *Backtrace* ---------- +@end group +@end smallexample + +@noindent +(As with the other times we entered the debugger, you can quit by +typing @kbd{q} in the @file{*Backtrace*} buffer.) + +This backtrace is different from the very first error message we saw, +which said, @samp{Debugger entered--Lisp error: (void-function this)}. +In this case, the function does not have a value as a variable; while +in the other error message, the function (the word `this') did not +have a definition. + +In this experiment with the @code{+}, what we did was cause the Lisp +interpreter to evaluate the @code{+} and look for the value of the +variable instead of the function definition. We did this by placing the +cursor right after the symbol rather than after the parenthesis of the +enclosing list as we did before. As a consequence, the Lisp interpreter +evaluated the preceding s-expression, which in this case was the +@code{+} by itself. + +Since @code{+} does not have a value bound to it, just the function +definition, the error message reported that the symbol's value as a +variable was void. + +@ignore +@need 800 +In GNU Emacs version 20 and before, your error message will say: + +@example +Symbol's value as variable is void:@: + +@end example + +@noindent +The meaning is the same as in GNU Emacs 22. +@end ignore + +@node Arguments, set & setq, Variables, List Processing +@comment node-name, next, previous, up +@section Arguments +@cindex Arguments +@cindex Passing information to functions + +To see how information is passed to functions, let's look again at +our old standby, the addition of two plus two. In Lisp, this is written +as follows: + +@smallexample +(+ 2 2) +@end smallexample + +If you evaluate this expression, the number 4 will appear in your echo +area. What the Lisp interpreter does is add the numbers that follow +the @code{+}. + +@cindex @samp{argument} defined +The numbers added by @code{+} are called the @dfn{arguments} of the +function @code{+}. These numbers are the information that is given to +or @dfn{passed} to the function. + +The word `argument' comes from the way it is used in mathematics and +does not refer to a disputation between two people; instead it refers to +the information presented to the function, in this case, to the +@code{+}. In Lisp, the arguments to a function are the atoms or lists +that follow the function. The values returned by the evaluation of +these atoms or lists are passed to the function. Different functions +require different numbers of arguments; some functions require none at +all.@footnote{It is curious to track the path by which the word `argument' +came to have two different meanings, one in mathematics and the other in +everyday English. According to the @cite{Oxford English Dictionary}, +the word derives from the Latin for @samp{to make clear, prove}; thus it +came to mean, by one thread of derivation, `the evidence offered as +proof', which is to say, `the information offered', which led to its +meaning in Lisp. But in the other thread of derivation, it came to mean +`to assert in a manner against which others may make counter +assertions', which led to the meaning of the word as a disputation. +(Note here that the English word has two different definitions attached +to it at the same time. By contrast, in Emacs Lisp, a symbol cannot +have two different function definitions at the same time.)} + +@menu +* Data types:: Types of data passed to a function. +* Args as Variable or List:: An argument can be the value + of a variable or list. +* Variable Number of Arguments:: Some functions may take a + variable number of arguments. +* Wrong Type of Argument:: Passing an argument of the wrong type + to a function. +* message:: A useful function for sending messages. +@end menu + +@node Data types, Args as Variable or List, Arguments, Arguments +@comment node-name, next, previous, up +@subsection Arguments' Data Types +@cindex Data types +@cindex Types of data +@cindex Arguments' data types + +The type of data that should be passed to a function depends on what +kind of information it uses. The arguments to a function such as +@code{+} must have values that are numbers, since @code{+} adds numbers. +Other functions use different kinds of data for their arguments. + +@need 1250 +@findex concat +For example, the @code{concat} function links together or unites two or +more strings of text to produce a string. The arguments are strings. +Concatenating the two character strings @code{abc}, @code{def} produces +the single string @code{abcdef}. This can be seen by evaluating the +following: + +@smallexample +(concat "abc" "def") +@end smallexample + +@noindent +The value produced by evaluating this expression is @code{"abcdef"}. + +A function such as @code{substring} uses both a string and numbers as +arguments. The function returns a part of the string, a substring of +the first argument. This function takes three arguments. Its first +argument is the string of characters, the second and third arguments are +numbers that indicate the beginning and end of the substring. The +numbers are a count of the number of characters (including spaces and +punctuations) from the beginning of the string. + +@need 800 +For example, if you evaluate the following: + +@smallexample +(substring "The quick brown fox jumped." 16 19) +@end smallexample + +@noindent +you will see @code{"fox"} appear in the echo area. The arguments are the +string and the two numbers. + +Note that the string passed to @code{substring} is a single atom even +though it is made up of several words separated by spaces. Lisp counts +everything between the two quotation marks as part of the string, +including the spaces. You can think of the @code{substring} function as +a kind of `atom smasher' since it takes an otherwise indivisible atom +and extracts a part. However, @code{substring} is only able to extract +a substring from an argument that is a string, not from another type of +atom such as a number or symbol. + +@node Args as Variable or List, Variable Number of Arguments, Data types, Arguments +@comment node-name, next, previous, up +@subsection An Argument as the Value of a Variable or List + +An argument can be a symbol that returns a value when it is evaluated. +For example, when the symbol @code{fill-column} by itself is evaluated, +it returns a number. This number can be used in an addition. + +@need 1250 +Position the cursor after the following expression and type @kbd{C-x +C-e}: + +@smallexample +(+ 2 fill-column) +@end smallexample + +@noindent +The value will be a number two more than what you get by evaluating +@code{fill-column} alone. For me, this is 74, because my value of +@code{fill-column} is 72. + +As we have just seen, an argument can be a symbol that returns a value +when evaluated. In addition, an argument can be a list that returns a +value when it is evaluated. For example, in the following expression, +the arguments to the function @code{concat} are the strings +@w{@code{"The "}} and @w{@code{" red foxes."}} and the list +@code{(number-to-string (+ 2 fill-column))}. + +@c For GNU Emacs 22, need number-to-string +@smallexample +(concat "The " (number-to-string (+ 2 fill-column)) " red foxes.") +@end smallexample + +@noindent +If you evaluate this expression---and if, as with my Emacs, +@code{fill-column} evaluates to 72---@code{"The 74 red foxes."} will +appear in the echo area. (Note that you must put spaces after the +word @samp{The} and before the word @samp{red} so they will appear in +the final string. The function @code{number-to-string} converts the +integer that the addition function returns to a string. +@code{number-to-string} is also known as @code{int-to-string}.) + +@node Variable Number of Arguments, Wrong Type of Argument, Args as Variable or List, Arguments +@comment node-name, next, previous, up +@subsection Variable Number of Arguments +@cindex Variable number of arguments +@cindex Arguments, variable number of + +Some functions, such as @code{concat}, @code{+} or @code{*}, take any +number of arguments. (The @code{*} is the symbol for multiplication.) +This can be seen by evaluating each of the following expressions in +the usual way. What you will see in the echo area is printed in this +text after @samp{@result{}}, which you may read as `evaluates to'. + +@need 1250 +In the first set, the functions have no arguments: + +@smallexample +@group +(+) @result{} 0 + +(*) @result{} 1 +@end group +@end smallexample + +@need 1250 +In this set, the functions have one argument each: + +@smallexample +@group +(+ 3) @result{} 3 + +(* 3) @result{} 3 +@end group +@end smallexample + +@need 1250 +In this set, the functions have three arguments each: + +@smallexample +@group +(+ 3 4 5) @result{} 12 + +(* 3 4 5) @result{} 60 +@end group +@end smallexample + +@node Wrong Type of Argument, message, Variable Number of Arguments, Arguments +@comment node-name, next, previous, up +@subsection Using the Wrong Type Object as an Argument +@cindex Wrong type of argument +@cindex Argument, wrong type of + +When a function is passed an argument of the wrong type, the Lisp +interpreter produces an error message. For example, the @code{+} +function expects the values of its arguments to be numbers. As an +experiment we can pass it the quoted symbol @code{hello} instead of a +number. Position the cursor after the following expression and type +@kbd{C-x C-e}: + +@smallexample +(+ 2 'hello) +@end smallexample + +@noindent +When you do this you will generate an error message. What has happened +is that @code{+} has tried to add the 2 to the value returned by +@code{'hello}, but the value returned by @code{'hello} is the symbol +@code{hello}, not a number. Only numbers can be added. So @code{+} +could not carry out its addition. + +@need 1250 +In GNU Emacs version 22, you will create and enter a +@file{*Backtrace*} buffer that says: + +@noindent +@smallexample +@group +---------- Buffer: *Backtrace* ---------- +Debugger entered--Lisp error: + (wrong-type-argument number-or-marker-p hello) + +(2 hello) + eval((+ 2 (quote hello))) + eval-last-sexp-1(nil) + eval-last-sexp(nil) + call-interactively(eval-last-sexp) +---------- Buffer: *Backtrace* ---------- +@end group +@end smallexample + +@need 1250 +As usual, the error message tries to be helpful and makes sense after you +learn how to read it.@footnote{@code{(quote hello)} is an expansion of +the abbreviation @code{'hello}.} + +The first part of the error message is straightforward; it says +@samp{wrong type argument}. Next comes the mysterious jargon word +@w{@samp{number-or-marker-p}}. This word is trying to tell you what +kind of argument the @code{+} expected. + +The symbol @code{number-or-marker-p} says that the Lisp interpreter is +trying to determine whether the information presented it (the value of +the argument) is a number or a marker (a special object representing a +buffer position). What it does is test to see whether the @code{+} is +being given numbers to add. It also tests to see whether the +argument is something called a marker, which is a specific feature of +Emacs Lisp. (In Emacs, locations in a buffer are recorded as markers. +When the mark is set with the @kbd{C-@@} or @kbd{C-@key{SPC}} command, +its position is kept as a marker. The mark can be considered a +number---the number of characters the location is from the beginning +of the buffer.) In Emacs Lisp, @code{+} can be used to add the +numeric value of marker positions as numbers. + +The @samp{p} of @code{number-or-marker-p} is the embodiment of a +practice started in the early days of Lisp programming. The @samp{p} +stands for `predicate'. In the jargon used by the early Lisp +researchers, a predicate refers to a function to determine whether some +property is true or false. So the @samp{p} tells us that +@code{number-or-marker-p} is the name of a function that determines +whether it is true or false that the argument supplied is a number or +a marker. Other Lisp symbols that end in @samp{p} include @code{zerop}, +a function that tests whether its argument has the value of zero, and +@code{listp}, a function that tests whether its argument is a list. + +Finally, the last part of the error message is the symbol @code{hello}. +This is the value of the argument that was passed to @code{+}. If the +addition had been passed the correct type of object, the value passed +would have been a number, such as 37, rather than a symbol like +@code{hello}. But then you would not have got the error message. + +@ignore +@need 1250 +In GNU Emacs version 20 and before, the echo area displays an error +message that says: + +@smallexample +Wrong type argument:@: number-or-marker-p, hello +@end smallexample + +This says, in different words, the same as the top line of the +@file{*Backtrace*} buffer. +@end ignore + +@node message, , Wrong Type of Argument, Arguments +@comment node-name, next, previous, up +@subsection The @code{message} Function +@findex message + +Like @code{+}, the @code{message} function takes a variable number of +arguments. It is used to send messages to the user and is so useful +that we will describe it here. + +@need 1250 +A message is printed in the echo area. For example, you can print a +message in your echo area by evaluating the following list: + +@smallexample +(message "This message appears in the echo area!") +@end smallexample + +The whole string between double quotation marks is a single argument +and is printed @i{in toto}. (Note that in this example, the message +itself will appear in the echo area within double quotes; that is +because you see the value returned by the @code{message} function. In +most uses of @code{message} in programs that you write, the text will +be printed in the echo area as a side-effect, without the quotes. +@xref{multiply-by-seven in detail, , @code{multiply-by-seven} in +detail}, for an example of this.) + +However, if there is a @samp{%s} in the quoted string of characters, the +@code{message} function does not print the @samp{%s} as such, but looks +to the argument that follows the string. It evaluates the second +argument and prints the value at the location in the string where the +@samp{%s} is. + +@need 1250 +You can see this by positioning the cursor after the following +expression and typing @kbd{C-x C-e}: + +@smallexample +(message "The name of this buffer is: %s." (buffer-name)) +@end smallexample + +@noindent +In Info, @code{"The name of this buffer is: *info*."} will appear in the +echo area. The function @code{buffer-name} returns the name of the +buffer as a string, which the @code{message} function inserts in place +of @code{%s}. + +To print a value as an integer, use @samp{%d} in the same way as +@samp{%s}. For example, to print a message in the echo area that +states the value of the @code{fill-column}, evaluate the following: + +@smallexample +(message "The value of fill-column is %d." fill-column) +@end smallexample + +@noindent +On my system, when I evaluate this list, @code{"The value of +fill-column is 72."} appears in my echo area@footnote{Actually, you +can use @code{%s} to print a number. It is non-specific. @code{%d} +prints only the part of a number left of a decimal point, and not +anything that is not a number.}. + +If there is more than one @samp{%s} in the quoted string, the value of +the first argument following the quoted string is printed at the +location of the first @samp{%s} and the value of the second argument is +printed at the location of the second @samp{%s}, and so on. + +@need 1250 +For example, if you evaluate the following, + +@smallexample +@group +(message "There are %d %s in the office!" + (- fill-column 14) "pink elephants") +@end group +@end smallexample + +@noindent +a rather whimsical message will appear in your echo area. On my system +it says, @code{"There are 58 pink elephants in the office!"}. + +The expression @code{(- fill-column 14)} is evaluated and the resulting +number is inserted in place of the @samp{%d}; and the string in double +quotes, @code{"pink elephants"}, is treated as a single argument and +inserted in place of the @samp{%s}. (That is to say, a string between +double quotes evaluates to itself, like a number.) + +Finally, here is a somewhat complex example that not only illustrates +the computation of a number, but also shows how you can use an +expression within an expression to generate the text that is substituted +for @samp{%s}: + +@smallexample +@group +(message "He saw %d %s" + (- fill-column 32) + (concat "red " + (substring + "The quick brown foxes jumped." 16 21) + " leaping.")) +@end group +@end smallexample + +In this example, @code{message} has three arguments: the string, +@code{"He saw %d %s"}, the expression, @code{(- fill-column 32)}, and +the expression beginning with the function @code{concat}. The value +resulting from the evaluation of @code{(- fill-column 32)} is inserted +in place of the @samp{%d}; and the value returned by the expression +beginning with @code{concat} is inserted in place of the @samp{%s}. + +When your fill column is 70 and you evaluate the expression, the +message @code{"He saw 38 red foxes leaping."} appears in your echo +area. + +@node set & setq, Summary, Arguments, List Processing +@comment node-name, next, previous, up +@section Setting the Value of a Variable +@cindex Variable, setting value +@cindex Setting value of variable + +@cindex @samp{bind} defined +There are several ways by which a variable can be given a value. One of +the ways is to use either the function @code{set} or the function +@code{setq}. Another way is to use @code{let} (@pxref{let}). (The +jargon for this process is to @dfn{bind} a variable to a value.) + +The following sections not only describe how @code{set} and @code{setq} +work but also illustrate how arguments are passed. + +@menu +* Using set:: Setting values. +* Using setq:: Setting a quoted value. +* Counting:: Using @code{setq} to count. +@end menu + +@node Using set, Using setq, set & setq, set & setq +@comment node-name, next, previous, up +@subsection Using @code{set} +@findex set + +To set the value of the symbol @code{flowers} to the list @code{'(rose +violet daisy buttercup)}, evaluate the following expression by +positioning the cursor after the expression and typing @kbd{C-x C-e}. + +@smallexample +(set 'flowers '(rose violet daisy buttercup)) +@end smallexample + +@noindent +The list @code{(rose violet daisy buttercup)} will appear in the echo +area. This is what is @emph{returned} by the @code{set} function. As a +side effect, the symbol @code{flowers} is bound to the list; that is, +the symbol @code{flowers}, which can be viewed as a variable, is given +the list as its value. (This process, by the way, illustrates how a +side effect to the Lisp interpreter, setting the value, can be the +primary effect that we humans are interested in. This is because every +Lisp function must return a value if it does not get an error, but it +will only have a side effect if it is designed to have one.) + +After evaluating the @code{set} expression, you can evaluate the symbol +@code{flowers} and it will return the value you just set. Here is the +symbol. Place your cursor after it and type @kbd{C-x C-e}. + +@smallexample +flowers +@end smallexample + +@noindent +When you evaluate @code{flowers}, the list +@code{(rose violet daisy buttercup)} appears in the echo area. + +Incidentally, if you evaluate @code{'flowers}, the variable with a quote +in front of it, what you will see in the echo area is the symbol itself, +@code{flowers}. Here is the quoted symbol, so you can try this: + +@smallexample +'flowers +@end smallexample + +Note also, that when you use @code{set}, you need to quote both +arguments to @code{set}, unless you want them evaluated. Since we do +not want either argument evaluated, neither the variable +@code{flowers} nor the list @code{(rose violet daisy buttercup)}, both +are quoted. (When you use @code{set} without quoting its first +argument, the first argument is evaluated before anything else is +done. If you did this and @code{flowers} did not have a value +already, you would get an error message that the @samp{Symbol's value +as variable is void}; on the other hand, if @code{flowers} did return +a value after it was evaluated, the @code{set} would attempt to set +the value that was returned. There are situations where this is the +right thing for the function to do; but such situations are rare.) + +@node Using setq, Counting, Using set, set & setq +@comment node-name, next, previous, up +@subsection Using @code{setq} +@findex setq + +As a practical matter, you almost always quote the first argument to +@code{set}. The combination of @code{set} and a quoted first argument +is so common that it has its own name: the special form @code{setq}. +This special form is just like @code{set} except that the first argument +is quoted automatically, so you don't need to type the quote mark +yourself. Also, as an added convenience, @code{setq} permits you to set +several different variables to different values, all in one expression. + +To set the value of the variable @code{carnivores} to the list +@code{'(lion tiger leopard)} using @code{setq}, the following expression +is used: + +@smallexample +(setq carnivores '(lion tiger leopard)) +@end smallexample + +@noindent +This is exactly the same as using @code{set} except the first argument +is automatically quoted by @code{setq}. (The @samp{q} in @code{setq} +means @code{quote}.) + +@need 1250 +With @code{set}, the expression would look like this: + +@smallexample +(set 'carnivores '(lion tiger leopard)) +@end smallexample + +Also, @code{setq} can be used to assign different values to +different variables. The first argument is bound to the value +of the second argument, the third argument is bound to the value of the +fourth argument, and so on. For example, you could use the following to +assign a list of trees to the symbol @code{trees} and a list of herbivores +to the symbol @code{herbivores}: + +@smallexample +@group +(setq trees '(pine fir oak maple) + herbivores '(gazelle antelope zebra)) +@end group +@end smallexample + +@noindent +(The expression could just as well have been on one line, but it might +not have fit on a page; and humans find it easier to read nicely +formatted lists.) + +Although I have been using the term `assign', there is another way of +thinking about the workings of @code{set} and @code{setq}; and that is to +say that @code{set} and @code{setq} make the symbol @emph{point} to the +list. This latter way of thinking is very common and in forthcoming +chapters we shall come upon at least one symbol that has `pointer' as +part of its name. The name is chosen because the symbol has a value, +specifically a list, attached to it; or, expressed another way, +the symbol is set to ``point'' to the list. + +@node Counting, , Using setq, set & setq +@comment node-name, next, previous, up +@subsection Counting +@cindex Counting + +Here is an example that shows how to use @code{setq} in a counter. You +might use this to count how many times a part of your program repeats +itself. First set a variable to zero; then add one to the number each +time the program repeats itself. To do this, you need a variable that +serves as a counter, and two expressions: an initial @code{setq} +expression that sets the counter variable to zero; and a second +@code{setq} expression that increments the counter each time it is +evaluated. + +@smallexample +@group +(setq counter 0) ; @r{Let's call this the initializer.} + +(setq counter (+ counter 1)) ; @r{This is the incrementer.} + +counter ; @r{This is the counter.} +@end group +@end smallexample + +@noindent +(The text following the @samp{;} are comments. @xref{Change a +defun, , Change a Function Definition}.) + +If you evaluate the first of these expressions, the initializer, +@code{(setq counter 0)}, and then evaluate the third expression, +@code{counter}, the number @code{0} will appear in the echo area. If +you then evaluate the second expression, the incrementer, @code{(setq +counter (+ counter 1))}, the counter will get the value 1. So if you +again evaluate @code{counter}, the number @code{1} will appear in the +echo area. Each time you evaluate the second expression, the value of +the counter will be incremented. + +When you evaluate the incrementer, @code{(setq counter (+ counter 1))}, +the Lisp interpreter first evaluates the innermost list; this is the +addition. In order to evaluate this list, it must evaluate the variable +@code{counter} and the number @code{1}. When it evaluates the variable +@code{counter}, it receives its current value. It passes this value and +the number @code{1} to the @code{+} which adds them together. The sum +is then returned as the value of the inner list and passed to the +@code{setq} which sets the variable @code{counter} to this new value. +Thus, the value of the variable, @code{counter}, is changed. + +@node Summary, Error Message Exercises, set & setq, List Processing +@comment node-name, next, previous, up +@section Summary + +Learning Lisp is like climbing a hill in which the first part is the +steepest. You have now climbed the most difficult part; what remains +becomes easier as you progress onwards. + +@need 1000 +In summary, + +@itemize @bullet + +@item +Lisp programs are made up of expressions, which are lists or single atoms. + +@item +Lists are made up of zero or more atoms or inner lists, separated by whitespace and +surrounded by parentheses. A list can be empty. + +@item +Atoms are multi-character symbols, like @code{forward-paragraph}, single +character symbols like @code{+}, strings of characters between double +quotation marks, or numbers. + +@item +A number evaluates to itself. + +@item +A string between double quotes also evaluates to itself. + +@item +When you evaluate a symbol by itself, its value is returned. + +@item +When you evaluate a list, the Lisp interpreter looks at the first symbol +in the list and then at the function definition bound to that symbol. +Then the instructions in the function definition are carried out. + +@item +A single quotation mark, +@ifinfo +' +@end ifinfo +@ifnotinfo +@code{'} +@end ifnotinfo +, tells the Lisp interpreter that it should +return the following expression as written, and not evaluate it as it +would if the quote were not there. + +@item +Arguments are the information passed to a function. The arguments to a +function are computed by evaluating the rest of the elements of the list +of which the function is the first element. + +@item +A function always returns a value when it is evaluated (unless it gets +an error); in addition, it may also carry out some action called a +``side effect''. In many cases, a function's primary purpose is to +create a side effect. +@end itemize + +@node Error Message Exercises, , Summary, List Processing +@comment node-name, next, previous, up +@section Exercises + +A few simple exercises: + +@itemize @bullet +@item +Generate an error message by evaluating an appropriate symbol that is +not within parentheses. + +@item +Generate an error message by evaluating an appropriate symbol that is +between parentheses. + +@item +Create a counter that increments by two rather than one. + +@item +Write an expression that prints a message in the echo area when +evaluated. +@end itemize + +@node Practicing Evaluation, Writing Defuns, List Processing, Top +@comment node-name, next, previous, up +@chapter Practicing Evaluation +@cindex Practicing evaluation +@cindex Evaluation practice + +Before learning how to write a function definition in Emacs Lisp, it is +useful to spend a little time evaluating various expressions that have +already been written. These expressions will be lists with the +functions as their first (and often only) element. Since some of the +functions associated with buffers are both simple and interesting, we +will start with those. In this section, we will evaluate a few of +these. In another section, we will study the code of several other +buffer-related functions, to see how they were written. + +@menu +* How to Evaluate:: Typing editing commands or @kbd{C-x C-e} + causes evaluation. +* Buffer Names:: Buffers and files are different. +* Getting Buffers:: Getting a buffer itself, not merely its name. +* Switching Buffers:: How to change to another buffer. +* Buffer Size & Locations:: Where point is located and the size of + the buffer. +* Evaluation Exercise:: +@end menu + +@node How to Evaluate, Buffer Names, Practicing Evaluation, Practicing Evaluation +@ifnottex +@unnumberedsec How to Evaluate +@end ifnottex + +@i{Whenever you give an editing command} to Emacs Lisp, such as the +command to move the cursor or to scroll the screen, @i{you are evaluating +an expression,} the first element of which is a function. @i{This is +how Emacs works.} + +@cindex @samp{interactive function} defined +@cindex @samp{command} defined +When you type keys, you cause the Lisp interpreter to evaluate an +expression and that is how you get your results. Even typing plain text +involves evaluating an Emacs Lisp function, in this case, one that uses +@code{self-insert-command}, which simply inserts the character you +typed. The functions you evaluate by typing keystrokes are called +@dfn{interactive} functions, or @dfn{commands}; how you make a function +interactive will be illustrated in the chapter on how to write function +definitions. @xref{Interactive, , Making a Function Interactive}. + +In addition to typing keyboard commands, we have seen a second way to +evaluate an expression: by positioning the cursor after a list and +typing @kbd{C-x C-e}. This is what we will do in the rest of this +section. There are other ways to evaluate an expression as well; these +will be described as we come to them. + +Besides being used for practicing evaluation, the functions shown in the +next few sections are important in their own right. A study of these +functions makes clear the distinction between buffers and files, how to +switch to a buffer, and how to determine a location within it. + +@node Buffer Names, Getting Buffers, How to Evaluate, Practicing Evaluation +@comment node-name, next, previous, up +@section Buffer Names +@findex buffer-name +@findex buffer-file-name + +The two functions, @code{buffer-name} and @code{buffer-file-name}, show +the difference between a file and a buffer. When you evaluate the +following expression, @code{(buffer-name)}, the name of the buffer +appears in the echo area. When you evaluate @code{(buffer-file-name)}, +the name of the file to which the buffer refers appears in the echo +area. Usually, the name returned by @code{(buffer-name)} is the same as +the name of the file to which it refers, and the name returned by +@code{(buffer-file-name)} is the full path-name of the file. + +A file and a buffer are two different entities. A file is information +recorded permanently in the computer (unless you delete it). A buffer, +on the other hand, is information inside of Emacs that will vanish at +the end of the editing session (or when you kill the buffer). Usually, +a buffer contains information that you have copied from a file; we say +the buffer is @dfn{visiting} that file. This copy is what you work on +and modify. Changes to the buffer do not change the file, until you +save the buffer. When you save the buffer, the buffer is copied to the file +and is thus saved permanently. + +@need 1250 +If you are reading this in Info inside of GNU Emacs, you can evaluate +each of the following expressions by positioning the cursor after it and +typing @kbd{C-x C-e}. + +@example +@group +(buffer-name) + +(buffer-file-name) +@end group +@end example + +@noindent +When I do this in Info, the value returned by evaluating +@code{(buffer-name)} is @file{"*info*"}, and the value returned by +evaluating @code{(buffer-file-name)} is @file{nil}. + +On the other hand, while I am writing this Introduction, the value +returned by evaluating @code{(buffer-name)} is +@file{"introduction.texinfo"}, and the value returned by evaluating +@code{(buffer-file-name)} is +@file{"/gnu/work/intro/introduction.texinfo"}. + +@cindex @code{nil}, history of word +The former is the name of the buffer and the latter is the name of the +file. In Info, the buffer name is @file{"*info*"}. Info does not +point to any file, so the result of evaluating +@code{(buffer-file-name)} is @file{nil}. The symbol @code{nil} is +from the Latin word for `nothing'; in this case, it means that the +buffer is not associated with any file. (In Lisp, @code{nil} is also +used to mean `false' and is a synonym for the empty list, @code{()}.) + +When I am writing, the name of my buffer is +@file{"introduction.texinfo"}. The name of the file to which it +points is @file{"/gnu/work/intro/introduction.texinfo"}. + +(In the expressions, the parentheses tell the Lisp interpreter to +treat @w{@code{buffer-name}} and @w{@code{buffer-file-name}} as +functions; without the parentheses, the interpreter would attempt to +evaluate the symbols as variables. @xref{Variables}.) + +In spite of the distinction between files and buffers, you will often +find that people refer to a file when they mean a buffer and vice-verse. +Indeed, most people say, ``I am editing a file,'' rather than saying, +``I am editing a buffer which I will soon save to a file.'' It is +almost always clear from context what people mean. When dealing with +computer programs, however, it is important to keep the distinction in mind, +since the computer is not as smart as a person. + +@cindex Buffer, history of word +The word `buffer', by the way, comes from the meaning of the word as a +cushion that deadens the force of a collision. In early computers, a +buffer cushioned the interaction between files and the computer's +central processing unit. The drums or tapes that held a file and the +central processing unit were pieces of equipment that were very +different from each other, working at their own speeds, in spurts. The +buffer made it possible for them to work together effectively. +Eventually, the buffer grew from being an intermediary, a temporary +holding place, to being the place where work is done. This +transformation is rather like that of a small seaport that grew into a +great city: once it was merely the place where cargo was warehoused +temporarily before being loaded onto ships; then it became a business +and cultural center in its own right. + +Not all buffers are associated with files. For example, a +@file{*scratch*} buffer does not visit any file. Similarly, a +@file{*Help*} buffer is not associated with any file. + +In the old days, when you lacked a @file{~/.emacs} file and started an +Emacs session by typing the command @code{emacs} alone, without naming +any files, Emacs started with the @file{*scratch*} buffer visible. +Nowadays, you will see a splash screen. You can follow one of the +commands suggested on the splash screen, visit a file, or press the +spacebar to reach the @file{*scratch*} buffer. + +If you switch to the @file{*scratch*} buffer, type +@code{(buffer-name)}, position the cursor after it, and then type +@kbd{C-x C-e} to evaluate the expression. The name @code{"*scratch*"} +will be returned and will appear in the echo area. @code{"*scratch*"} +is the name of the buffer. When you type @code{(buffer-file-name)} in +the @file{*scratch*} buffer and evaluate that, @code{nil} will appear +in the echo area, just as it does when you evaluate +@code{(buffer-file-name)} in Info. + +Incidentally, if you are in the @file{*scratch*} buffer and want the +value returned by an expression to appear in the @file{*scratch*} +buffer itself rather than in the echo area, type @kbd{C-u C-x C-e} +instead of @kbd{C-x C-e}. This causes the value returned to appear +after the expression. The buffer will look like this: + +@smallexample +(buffer-name)"*scratch*" +@end smallexample + +@noindent +You cannot do this in Info since Info is read-only and it will not allow +you to change the contents of the buffer. But you can do this in any +buffer you can edit; and when you write code or documentation (such as +this book), this feature is very useful. + +@node Getting Buffers, Switching Buffers, Buffer Names, Practicing Evaluation +@comment node-name, next, previous, up +@section Getting Buffers +@findex current-buffer +@findex other-buffer +@cindex Getting a buffer + +The @code{buffer-name} function returns the @emph{name} of the buffer; +to get the buffer @emph{itself}, a different function is needed: the +@code{current-buffer} function. If you use this function in code, what +you get is the buffer itself. + +A name and the object or entity to which the name refers are different +from each other. You are not your name. You are a person to whom +others refer by name. If you ask to speak to George and someone hands you +a card with the letters @samp{G}, @samp{e}, @samp{o}, @samp{r}, +@samp{g}, and @samp{e} written on it, you might be amused, but you would +not be satisfied. You do not want to speak to the name, but to the +person to whom the name refers. A buffer is similar: the name of the +scratch buffer is @file{*scratch*}, but the name is not the buffer. To +get a buffer itself, you need to use a function such as +@code{current-buffer}. + +However, there is a slight complication: if you evaluate +@code{current-buffer} in an expression on its own, as we will do here, +what you see is a printed representation of the name of the buffer +without the contents of the buffer. Emacs works this way for two +reasons: the buffer may be thousands of lines long---too long to be +conveniently displayed; and, another buffer may have the same contents +but a different name, and it is important to distinguish between them. + +@need 800 +Here is an expression containing the function: + +@smallexample +(current-buffer) +@end smallexample + +@noindent +If you evaluate this expression in Info in Emacs in the usual way, +@file{#<buffer *info*>} will appear in the echo area. The special +format indicates that the buffer itself is being returned, rather than +just its name. + +Incidentally, while you can type a number or symbol into a program, you +cannot do that with the printed representation of a buffer: the only way +to get a buffer itself is with a function such as @code{current-buffer}. + +A related function is @code{other-buffer}. This returns the most +recently selected buffer other than the one you are in currently, not +a printed representation of its name. If you have recently switched +back and forth from the @file{*scratch*} buffer, @code{other-buffer} +will return that buffer. + +@need 800 +You can see this by evaluating the expression: + +@smallexample +(other-buffer) +@end smallexample + +@noindent +You should see @file{#<buffer *scratch*>} appear in the echo area, or +the name of whatever other buffer you switched back from most +recently@footnote{Actually, by default, if the buffer from which you +just switched is visible to you in another window, @code{other-buffer} +will choose the most recent buffer that you cannot see; this is a +subtlety that I often forget.}. + +@node Switching Buffers, Buffer Size & Locations, Getting Buffers, Practicing Evaluation +@comment node-name, next, previous, up +@section Switching Buffers +@findex switch-to-buffer +@findex set-buffer +@cindex Switching to a buffer + +The @code{other-buffer} function actually provides a buffer when it is +used as an argument to a function that requires one. We can see this +by using @code{other-buffer} and @code{switch-to-buffer} to switch to a +different buffer. + +But first, a brief introduction to the @code{switch-to-buffer} +function. When you switched back and forth from Info to the +@file{*scratch*} buffer to evaluate @code{(buffer-name)}, you most +likely typed @kbd{C-x b} and then typed @file{*scratch*}@footnote{Or +rather, to save typing, you probably only typed @kbd{RET} if the +default buffer was @file{*scratch*}, or if it was different, then you +typed just part of the name, such as @code{*sc}, pressed your +@kbd{TAB} key to cause it to expand to the full name, and then typed +your @kbd{RET} key.} when prompted in the minibuffer for the name of +the buffer to which you wanted to switch. The keystrokes, @kbd{C-x +b}, cause the Lisp interpreter to evaluate the interactive function +@code{switch-to-buffer}. As we said before, this is how Emacs works: +different keystrokes call or run different functions. For example, +@kbd{C-f} calls @code{forward-char}, @kbd{M-e} calls +@code{forward-sentence}, and so on. + +By writing @code{switch-to-buffer} in an expression, and giving it a +buffer to switch to, we can switch buffers just the way @kbd{C-x b} +does. + +@need 1000 +Here is the Lisp expression: + +@smallexample +(switch-to-buffer (other-buffer)) +@end smallexample + +@noindent +The symbol @code{switch-to-buffer} is the first element of the list, +so the Lisp interpreter will treat it as a function and carry out the +instructions that are attached to it. But before doing that, the +interpreter will note that @code{other-buffer} is inside parentheses +and work on that symbol first. @code{other-buffer} is the first (and +in this case, the only) element of this list, so the Lisp interpreter +calls or runs the function. It returns another buffer. Next, the +interpreter runs @code{switch-to-buffer}, passing to it, as an +argument, the other buffer, which is what Emacs will switch to. If +you are reading this in Info, try this now. Evaluate the expression. +(To get back, type @kbd{C-x b @key{RET}}.)@footnote{Remember, this +expression will move you to your most recent other buffer that you +cannot see. If you really want to go to your most recently selected +buffer, even if you can still see it, you need to evaluate the +following more complex expression: + +@smallexample +(switch-to-buffer (other-buffer (current-buffer) t)) +@end smallexample + +@c noindent +In this case, the first argument to @code{other-buffer} tells it which +buffer to skip---the current one---and the second argument tells +@code{other-buffer} it is OK to switch to a visible buffer. +In regular use, @code{switch-to-buffer} takes you to an invisible +window since you would most likely use @kbd{C-x o} (@code{other-window}) +to go to another visible buffer.} + +In the programming examples in later sections of this document, you will +see the function @code{set-buffer} more often than +@code{switch-to-buffer}. This is because of a difference between +computer programs and humans: humans have eyes and expect to see the +buffer on which they are working on their computer terminals. This is +so obvious, it almost goes without saying. However, programs do not +have eyes. When a computer program works on a buffer, that buffer does +not need to be visible on the screen. + +@code{switch-to-buffer} is designed for humans and does two different +things: it switches the buffer to which Emacs' attention is directed; and +it switches the buffer displayed in the window to the new buffer. +@code{set-buffer}, on the other hand, does only one thing: it switches +the attention of the computer program to a different buffer. The buffer +on the screen remains unchanged (of course, normally nothing happens +there until the command finishes running). + +@cindex @samp{call} defined +Also, we have just introduced another jargon term, the word @dfn{call}. +When you evaluate a list in which the first symbol is a function, you +are calling that function. The use of the term comes from the notion of +the function as an entity that can do something for you if you `call' +it---just as a plumber is an entity who can fix a leak if you call him +or her. + +@node Buffer Size & Locations, Evaluation Exercise, Switching Buffers, Practicing Evaluation +@comment node-name, next, previous, up +@section Buffer Size and the Location of Point +@cindex Size of buffer +@cindex Buffer size +@cindex Point location +@cindex Location of point + +Finally, let's look at several rather simple functions, +@code{buffer-size}, @code{point}, @code{point-min}, and +@code{point-max}. These give information about the size of a buffer and +the location of point within it. + +The function @code{buffer-size} tells you the size of the current +buffer; that is, the function returns a count of the number of +characters in the buffer. + +@smallexample +(buffer-size) +@end smallexample + +@noindent +You can evaluate this in the usual way, by positioning the +cursor after the expression and typing @kbd{C-x C-e}. + +@cindex @samp{point} defined +In Emacs, the current position of the cursor is called @dfn{point}. +The expression @code{(point)} returns a number that tells you where the +cursor is located as a count of the number of characters from the +beginning of the buffer up to point. + +@need 1250 +You can see the character count for point in this buffer by evaluating +the following expression in the usual way: + +@smallexample +(point) +@end smallexample + +@noindent +As I write this, the value of @code{point} is 65724. The @code{point} +function is frequently used in some of the examples later in this +book. + +@need 1250 +The value of point depends, of course, on its location within the +buffer. If you evaluate point in this spot, the number will be larger: + +@smallexample +(point) +@end smallexample + +@noindent +For me, the value of point in this location is 66043, which means that +there are 319 characters (including spaces) between the two +expressions. (Doubtless, you will see different numbers, since I will +have edited this since I first evaluated point.) + +@cindex @samp{narrowing} defined +The function @code{point-min} is somewhat similar to @code{point}, but +it returns the value of the minimum permissible value of point in the +current buffer. This is the number 1 unless @dfn{narrowing} is in +effect. (Narrowing is a mechanism whereby you can restrict yourself, +or a program, to operations on just a part of a buffer. +@xref{Narrowing & Widening, , Narrowing and Widening}.) Likewise, the +function @code{point-max} returns the value of the maximum permissible +value of point in the current buffer. + +@node Evaluation Exercise, , Buffer Size & Locations, Practicing Evaluation +@section Exercise + +Find a file with which you are working and move towards its middle. +Find its buffer name, file name, length, and your position in the file. + +@node Writing Defuns, Buffer Walk Through, Practicing Evaluation, Top +@comment node-name, next, previous, up +@chapter How To Write Function Definitions +@cindex Definition writing +@cindex Function definition writing +@cindex Writing a function definition + +When the Lisp interpreter evaluates a list, it looks to see whether the +first symbol on the list has a function definition attached to it; or, +put another way, whether the symbol points to a function definition. If +it does, the computer carries out the instructions in the definition. A +symbol that has a function definition is called, simply, a function +(although, properly speaking, the definition is the function and the +symbol refers to it.) + +@menu +* Primitive Functions:: +* defun:: The @code{defun} special form. +* Install:: Install a function definition. +* Interactive:: Making a function interactive. +* Interactive Options:: Different options for @code{interactive}. +* Permanent Installation:: Installing code permanently. +* let:: Creating and initializing local variables. +* if:: What if? +* else:: If--then--else expressions. +* Truth & Falsehood:: What Lisp considers false and true. +* save-excursion:: Keeping track of point, mark, and buffer. +* Review:: +* defun Exercises:: +@end menu + +@node Primitive Functions, defun, Writing Defuns, Writing Defuns +@ifnottex +@unnumberedsec An Aside about Primitive Functions +@end ifnottex +@cindex Primitive functions +@cindex Functions, primitive + +@cindex C language primitives +@cindex Primitives written in C +All functions are defined in terms of other functions, except for a few +@dfn{primitive} functions that are written in the C programming +language. When you write functions' definitions, you will write them in +Emacs Lisp and use other functions as your building blocks. Some of the +functions you will use will themselves be written in Emacs Lisp (perhaps +by you) and some will be primitives written in C. The primitive +functions are used exactly like those written in Emacs Lisp and behave +like them. They are written in C so we can easily run GNU Emacs on any +computer that has sufficient power and can run C. + +Let me re-emphasize this: when you write code in Emacs Lisp, you do not +distinguish between the use of functions written in C and the use of +functions written in Emacs Lisp. The difference is irrelevant. I +mention the distinction only because it is interesting to know. Indeed, +unless you investigate, you won't know whether an already-written +function is written in Emacs Lisp or C. + +@node defun, Install, Primitive Functions, Writing Defuns +@comment node-name, next, previous, up +@section The @code{defun} Special Form +@findex defun +@cindex Special form of @code{defun} + +@cindex @samp{function definition} defined +In Lisp, a symbol such as @code{mark-whole-buffer} has code attached to +it that tells the computer what to do when the function is called. +This code is called the @dfn{function definition} and is created by +evaluating a Lisp expression that starts with the symbol @code{defun} +(which is an abbreviation for @emph{define function}). Because +@code{defun} does not evaluate its arguments in the usual way, it is +called a @dfn{special form}. + +In subsequent sections, we will look at function definitions from the +Emacs source code, such as @code{mark-whole-buffer}. In this section, +we will describe a simple function definition so you can see how it +looks. This function definition uses arithmetic because it makes for a +simple example. Some people dislike examples using arithmetic; however, +if you are such a person, do not despair. Hardly any of the code we +will study in the remainder of this introduction involves arithmetic or +mathematics. The examples mostly involve text in one way or another. + +A function definition has up to five parts following the word +@code{defun}: + +@enumerate +@item +The name of the symbol to which the function definition should be +attached. + +@item +A list of the arguments that will be passed to the function. If no +arguments will be passed to the function, this is an empty list, +@code{()}. + +@item +Documentation describing the function. (Technically optional, but +strongly recommended.) + +@item +Optionally, an expression to make the function interactive so you can +use it by typing @kbd{M-x} and then the name of the function; or by +typing an appropriate key or keychord. + +@cindex @samp{body} defined +@item +The code that instructs the computer what to do: the @dfn{body} of the +function definition. +@end enumerate + +It is helpful to think of the five parts of a function definition as +being organized in a template, with slots for each part: + +@smallexample +@group +(defun @var{function-name} (@var{arguments}@dots{}) + "@var{optional-documentation}@dots{}" + (interactive @var{argument-passing-info}) ; @r{optional} + @var{body}@dots{}) +@end group +@end smallexample + +As an example, here is the code for a function that multiplies its +argument by 7. (This example is not interactive. @xref{Interactive, +, Making a Function Interactive}, for that information.) + +@smallexample +@group +(defun multiply-by-seven (number) + "Multiply NUMBER by seven." + (* 7 number)) +@end group +@end smallexample + +This definition begins with a parenthesis and the symbol @code{defun}, +followed by the name of the function. + +@cindex @samp{argument list} defined +The name of the function is followed by a list that contains the +arguments that will be passed to the function. This list is called +the @dfn{argument list}. In this example, the list has only one +element, the symbol, @code{number}. When the function is used, the +symbol will be bound to the value that is used as the argument to the +function. + +Instead of choosing the word @code{number} for the name of the argument, +I could have picked any other name. For example, I could have chosen +the word @code{multiplicand}. I picked the word `number' because it +tells what kind of value is intended for this slot; but I could just as +well have chosen the word `multiplicand' to indicate the role that the +value placed in this slot will play in the workings of the function. I +could have called it @code{foogle}, but that would have been a bad +choice because it would not tell humans what it means. The choice of +name is up to the programmer and should be chosen to make the meaning of +the function clear. + +Indeed, you can choose any name you wish for a symbol in an argument +list, even the name of a symbol used in some other function: the name +you use in an argument list is private to that particular definition. +In that definition, the name refers to a different entity than any use +of the same name outside the function definition. Suppose you have a +nick-name `Shorty' in your family; when your family members refer to +`Shorty', they mean you. But outside your family, in a movie, for +example, the name `Shorty' refers to someone else. Because a name in an +argument list is private to the function definition, you can change the +value of such a symbol inside the body of a function without changing +its value outside the function. The effect is similar to that produced +by a @code{let} expression. (@xref{let, , @code{let}}.) + +@ignore +Note also that we discuss the word `number' in two different ways: as a +symbol that appears in the code, and as the name of something that will +be replaced by a something else during the evaluation of the function. +In the first case, @code{number} is a symbol, not a number; it happens +that within the function, it is a variable who value is the number in +question, but our primary interest in it is as a symbol. On the other +hand, when we are talking about the function, our interest is that we +will substitute a number for the word @var{number}. To keep this +distinction clear, we use different typography for the two +circumstances. When we talk about this function, or about how it works, +we refer to this number by writing @var{number}. In the function +itself, we refer to it by writing @code{number}. +@end ignore + +The argument list is followed by the documentation string that +describes the function. This is what you see when you type +@w{@kbd{C-h f}} and the name of a function. Incidentally, when you +write a documentation string like this, you should make the first line +a complete sentence since some commands, such as @code{apropos}, print +only the first line of a multi-line documentation string. Also, you +should not indent the second line of a documentation string, if you +have one, because that looks odd when you use @kbd{C-h f} +(@code{describe-function}). The documentation string is optional, but +it is so useful, it should be included in almost every function you +write. + +@findex * @r{(multiplication)} +The third line of the example consists of the body of the function +definition. (Most functions' definitions, of course, are longer than +this.) In this function, the body is the list, @code{(* 7 number)}, which +says to multiply the value of @var{number} by 7. (In Emacs Lisp, +@code{*} is the function for multiplication, just as @code{+} is the +function for addition.) + +When you use the @code{multiply-by-seven} function, the argument +@code{number} evaluates to the actual number you want used. Here is an +example that shows how @code{multiply-by-seven} is used; but don't try +to evaluate this yet! + +@smallexample +(multiply-by-seven 3) +@end smallexample + +@noindent +The symbol @code{number}, specified in the function definition in the +next section, is given or ``bound to'' the value 3 in the actual use of +the function. Note that although @code{number} was inside parentheses +in the function definition, the argument passed to the +@code{multiply-by-seven} function is not in parentheses. The +parentheses are written in the function definition so the computer can +figure out where the argument list ends and the rest of the function +definition begins. + +If you evaluate this example, you are likely to get an error message. +(Go ahead, try it!) This is because we have written the function +definition, but not yet told the computer about the definition---we have +not yet installed (or `loaded') the function definition in Emacs. +Installing a function is the process that tells the Lisp interpreter the +definition of the function. Installation is described in the next +section. + +@node Install, Interactive, defun, Writing Defuns +@comment node-name, next, previous, up +@section Install a Function Definition +@cindex Install a Function Definition +@cindex Definition installation +@cindex Function definition installation + +If you are reading this inside of Info in Emacs, you can try out the +@code{multiply-by-seven} function by first evaluating the function +definition and then evaluating @code{(multiply-by-seven 3)}. A copy of +the function definition follows. Place the cursor after the last +parenthesis of the function definition and type @kbd{C-x C-e}. When you +do this, @code{multiply-by-seven} will appear in the echo area. (What +this means is that when a function definition is evaluated, the value it +returns is the name of the defined function.) At the same time, this +action installs the function definition. + +@smallexample +@group +(defun multiply-by-seven (number) + "Multiply NUMBER by seven." + (* 7 number)) +@end group +@end smallexample + +@noindent +By evaluating this @code{defun}, you have just installed +@code{multiply-by-seven} in Emacs. The function is now just as much a +part of Emacs as @code{forward-word} or any other editing function you +use. (@code{multiply-by-seven} will stay installed until you quit +Emacs. To reload code automatically whenever you start Emacs, see +@ref{Permanent Installation, , Installing Code Permanently}.) + +@menu +* Effect of installation:: +* Change a defun:: How to change a function definition. +@end menu + +@node Effect of installation, Change a defun, Install, Install +@ifnottex +@unnumberedsubsec The effect of installation +@end ifnottex + +You can see the effect of installing @code{multiply-by-seven} by +evaluating the following sample. Place the cursor after the following +expression and type @kbd{C-x C-e}. The number 21 will appear in the +echo area. + +@smallexample +(multiply-by-seven 3) +@end smallexample + +If you wish, you can read the documentation for the function by typing +@kbd{C-h f} (@code{describe-function}) and then the name of the +function, @code{multiply-by-seven}. When you do this, a +@file{*Help*} window will appear on your screen that says: + +@smallexample +@group +multiply-by-seven is a Lisp function. +(multiply-by-seven NUMBER) + +Multiply NUMBER by seven. +@end group +@end smallexample + +@noindent +(To return to a single window on your screen, type @kbd{C-x 1}.) + +@node Change a defun, , Effect of installation, Install +@comment node-name, next, previous, up +@subsection Change a Function Definition +@cindex Changing a function definition +@cindex Function definition, how to change +@cindex Definition, how to change + +If you want to change the code in @code{multiply-by-seven}, just rewrite +it. To install the new version in place of the old one, evaluate the +function definition again. This is how you modify code in Emacs. It is +very simple. + +As an example, you can change the @code{multiply-by-seven} function to +add the number to itself seven times instead of multiplying the number +by seven. It produces the same answer, but by a different path. At +the same time, we will add a comment to the code; a comment is text +that the Lisp interpreter ignores, but that a human reader may find +useful or enlightening. The comment is that this is the ``second +version''. + +@smallexample +@group +(defun multiply-by-seven (number) ; @r{Second version.} + "Multiply NUMBER by seven." + (+ number number number number number number number)) +@end group +@end smallexample + +@cindex Comments in Lisp code +The comment follows a semicolon, @samp{;}. In Lisp, everything on a +line that follows a semicolon is a comment. The end of the line is the +end of the comment. To stretch a comment over two or more lines, begin +each line with a semicolon. + +@xref{Beginning a .emacs File, , Beginning a @file{.emacs} +File}, and @ref{Comments, , Comments, elisp, The GNU Emacs Lisp +Reference Manual}, for more about comments. + +You can install this version of the @code{multiply-by-seven} function by +evaluating it in the same way you evaluated the first function: place +the cursor after the last parenthesis and type @kbd{C-x C-e}. + +In summary, this is how you write code in Emacs Lisp: you write a +function; install it; test it; and then make fixes or enhancements and +install it again. + +@node Interactive, Interactive Options, Install, Writing Defuns +@comment node-name, next, previous, up +@section Make a Function Interactive +@cindex Interactive functions +@findex interactive + +You make a function interactive by placing a list that begins with +the special form @code{interactive} immediately after the +documentation. A user can invoke an interactive function by typing +@kbd{M-x} and then the name of the function; or by typing the keys to +which it is bound, for example, by typing @kbd{C-n} for +@code{next-line} or @kbd{C-x h} for @code{mark-whole-buffer}. + +Interestingly, when you call an interactive function interactively, +the value returned is not automatically displayed in the echo area. +This is because you often call an interactive function for its side +effects, such as moving forward by a word or line, and not for the +value returned. If the returned value were displayed in the echo area +each time you typed a key, it would be very distracting. + +@menu +* Interactive multiply-by-seven:: An overview. +* multiply-by-seven in detail:: The interactive version. +@end menu + +@node Interactive multiply-by-seven, multiply-by-seven in detail, Interactive, Interactive +@ifnottex +@unnumberedsubsec An Interactive @code{multiply-by-seven}, An Overview +@end ifnottex + +Both the use of the special form @code{interactive} and one way to +display a value in the echo area can be illustrated by creating an +interactive version of @code{multiply-by-seven}. + +@need 1250 +Here is the code: + +@smallexample +@group +(defun multiply-by-seven (number) ; @r{Interactive version.} + "Multiply NUMBER by seven." + (interactive "p") + (message "The result is %d" (* 7 number))) +@end group +@end smallexample + +@noindent +You can install this code by placing your cursor after it and typing +@kbd{C-x C-e}. The name of the function will appear in your echo area. +Then, you can use this code by typing @kbd{C-u} and a number and then +typing @kbd{M-x multiply-by-seven} and pressing @key{RET}. The phrase +@samp{The result is @dots{}} followed by the product will appear in the +echo area. + +Speaking more generally, you invoke a function like this in either of two +ways: + +@enumerate +@item +By typing a prefix argument that contains the number to be passed, and +then typing @kbd{M-x} and the name of the function, as with +@kbd{C-u 3 M-x forward-sentence}; or, + +@item +By typing whatever key or keychord the function is bound to, as with +@kbd{C-u 3 M-e}. +@end enumerate + +@noindent +Both the examples just mentioned work identically to move point forward +three sentences. (Since @code{multiply-by-seven} is not bound to a key, +it could not be used as an example of key binding.) + +(@xref{Keybindings, , Some Keybindings}, to learn how to bind a command +to a key.) + +A prefix argument is passed to an interactive function by typing the +@key{META} key followed by a number, for example, @kbd{M-3 M-e}, or by +typing @kbd{C-u} and then a number, for example, @kbd{C-u 3 M-e} (if you +type @kbd{C-u} without a number, it defaults to 4). + +@node multiply-by-seven in detail, , Interactive multiply-by-seven, Interactive +@comment node-name, next, previous, up +@subsection An Interactive @code{multiply-by-seven} + +Let's look at the use of the special form @code{interactive} and then at +the function @code{message} in the interactive version of +@code{multiply-by-seven}. You will recall that the function definition +looks like this: + +@smallexample +@group +(defun multiply-by-seven (number) ; @r{Interactive version.} + "Multiply NUMBER by seven." + (interactive "p") + (message "The result is %d" (* 7 number))) +@end group +@end smallexample + +In this function, the expression, @code{(interactive "p")}, is a list of +two elements. The @code{"p"} tells Emacs to pass the prefix argument to +the function and use its value for the argument of the function. + +@need 1000 +The argument will be a number. This means that the symbol +@code{number} will be bound to a number in the line: + +@smallexample +(message "The result is %d" (* 7 number)) +@end smallexample + +@need 1250 +@noindent +For example, if your prefix argument is 5, the Lisp interpreter will +evaluate the line as if it were: + +@smallexample +(message "The result is %d" (* 7 5)) +@end smallexample + +@noindent +(If you are reading this in GNU Emacs, you can evaluate this expression +yourself.) First, the interpreter will evaluate the inner list, which +is @code{(* 7 5)}. This returns a value of 35. Next, it +will evaluate the outer list, passing the values of the second and +subsequent elements of the list to the function @code{message}. + +As we have seen, @code{message} is an Emacs Lisp function especially +designed for sending a one line message to a user. (@xref{message, , +The @code{message} function}.) In summary, the @code{message} +function prints its first argument in the echo area as is, except for +occurrences of @samp{%d} or @samp{%s} (and various other %-sequences +which we have not mentioned). When it sees a control sequence, the +function looks to the second or subsequent arguments and prints the +value of the argument in the location in the string where the control +sequence is located. + +In the interactive @code{multiply-by-seven} function, the control string +is @samp{%d}, which requires a number, and the value returned by +evaluating @code{(* 7 5)} is the number 35. Consequently, the number 35 +is printed in place of the @samp{%d} and the message is @samp{The result +is 35}. + +(Note that when you call the function @code{multiply-by-seven}, the +message is printed without quotes, but when you call @code{message}, the +text is printed in double quotes. This is because the value returned by +@code{message} is what appears in the echo area when you evaluate an +expression whose first element is @code{message}; but when embedded in a +function, @code{message} prints the text as a side effect without +quotes.) + +@node Interactive Options, Permanent Installation, Interactive, Writing Defuns +@comment node-name, next, previous, up +@section Different Options for @code{interactive} +@cindex Options for @code{interactive} +@cindex Interactive options + +In the example, @code{multiply-by-seven} used @code{"p"} as the +argument to @code{interactive}. This argument told Emacs to interpret +your typing either @kbd{C-u} followed by a number or @key{META} +followed by a number as a command to pass that number to the function +as its argument. Emacs has more than twenty characters predefined for +use with @code{interactive}. In almost every case, one of these +options will enable you to pass the right information interactively to +a function. (@xref{Interactive Codes, , Code Characters for +@code{interactive}, elisp, The GNU Emacs Lisp Reference Manual}.) + +@need 1250 +Consider the function @code{zap-to-char}. Its interactive expression +is + +@smallexample +(interactive "p\ncZap to char: ") +@end smallexample + +The first part of the argument to @code{interactive} is @samp{p}, with +which you are already familiar. This argument tells Emacs to +interpret a `prefix', as a number to be passed to the function. You +can specify a prefix either by typing @kbd{C-u} followed by a number +or by typing @key{META} followed by a number. The prefix is the +number of specified characters. Thus, if your prefix is three and the +specified character is @samp{x}, then you will delete all the text up +to and including the third next @samp{x}. If you do not set a prefix, +then you delete all the text up to and including the specified +character, but no more. + +The @samp{c} tells the function the name of the character to which to delete. + +More formally, a function with two or more arguments can have +information passed to each argument by adding parts to the string that +follows @code{interactive}. When you do this, the information is +passed to each argument in the same order it is specified in the +@code{interactive} list. In the string, each part is separated from +the next part by a @samp{\n}, which is a newline. For example, you +can follow @samp{p} with a @samp{\n} and an @samp{cZap to char:@: }. +This causes Emacs to pass the value of the prefix argument (if there +is one) and the character. + +In this case, the function definition looks like the following, where +@code{arg} and @code{char} are the symbols to which @code{interactive} +binds the prefix argument and the specified character: + +@smallexample +@group +(defun @var{name-of-function} (arg char) + "@var{documentation}@dots{}" + (interactive "p\ncZap to char: ") + @var{body-of-function}@dots{}) +@end group +@end smallexample + +@noindent +(The space after the colon in the prompt makes it look better when you +are prompted. @xref{copy-to-buffer, , The Definition of +@code{copy-to-buffer}}, for an example.) + +When a function does not take arguments, @code{interactive} does not +require any. Such a function contains the simple expression +@code{(interactive)}. The @code{mark-whole-buffer} function is like +this. + +Alternatively, if the special letter-codes are not right for your +application, you can pass your own arguments to @code{interactive} as +a list. + +@xref{append-to-buffer, , The Definition of @code{append-to-buffer}}, +for an example. @xref{Using Interactive, , Using @code{Interactive}, +elisp, The GNU Emacs Lisp Reference Manual}, for a more complete +explanation about this technique. + +@node Permanent Installation, let, Interactive Options, Writing Defuns +@comment node-name, next, previous, up +@section Install Code Permanently +@cindex Install code permanently +@cindex Permanent code installation +@cindex Code installation + +When you install a function definition by evaluating it, it will stay +installed until you quit Emacs. The next time you start a new session +of Emacs, the function will not be installed unless you evaluate the +function definition again. + +At some point, you may want to have code installed automatically +whenever you start a new session of Emacs. There are several ways of +doing this: + +@itemize @bullet +@item +If you have code that is just for yourself, you can put the code for the +function definition in your @file{.emacs} initialization file. When you +start Emacs, your @file{.emacs} file is automatically evaluated and all +the function definitions within it are installed. +@xref{Emacs Initialization, , Your @file{.emacs} File}. + +@item +Alternatively, you can put the function definitions that you want +installed in one or more files of their own and use the @code{load} +function to cause Emacs to evaluate and thereby install each of the +functions in the files. +@xref{Loading Files, , Loading Files}. + +@item +Thirdly, if you have code that your whole site will use, it is usual +to put it in a file called @file{site-init.el} that is loaded when +Emacs is built. This makes the code available to everyone who uses +your machine. (See the @file{INSTALL} file that is part of the Emacs +distribution.) +@end itemize + +Finally, if you have code that everyone who uses Emacs may want, you +can post it on a computer network or send a copy to the Free Software +Foundation. (When you do this, please license the code and its +documentation under a license that permits other people to run, copy, +study, modify, and redistribute the code and which protects you from +having your work taken from you.) If you send a copy of your code to +the Free Software Foundation, and properly protect yourself and +others, it may be included in the next release of Emacs. In large +part, this is how Emacs has grown over the past years, by donations. + +@node let, if, Permanent Installation, Writing Defuns +@comment node-name, next, previous, up +@section @code{let} +@findex let + +The @code{let} expression is a special form in Lisp that you will need +to use in most function definitions. + +@code{let} is used to attach or bind a symbol to a value in such a way +that the Lisp interpreter will not confuse the variable with a +variable of the same name that is not part of the function. + +To understand why the @code{let} special form is necessary, consider +the situation in which you own a home that you generally refer to as +`the house', as in the sentence, ``The house needs painting.'' If you +are visiting a friend and your host refers to `the house', he is +likely to be referring to @emph{his} house, not yours, that is, to a +different house. + +If your friend is referring to his house and you think he is referring +to your house, you may be in for some confusion. The same thing could +happen in Lisp if a variable that is used inside of one function has +the same name as a variable that is used inside of another function, +and the two are not intended to refer to the same value. The +@code{let} special form prevents this kind of confusion. + +@menu +* Prevent confusion:: +* Parts of let Expression:: +* Sample let Expression:: +* Uninitialized let Variables:: +@end menu + +@node Prevent confusion, Parts of let Expression, let, let +@ifnottex +@unnumberedsubsec @code{let} Prevents Confusion +@end ifnottex + +@cindex @samp{local variable} defined +@cindex @samp{variable, local}, defined +The @code{let} special form prevents confusion. @code{let} creates a +name for a @dfn{local variable} that overshadows any use of the same +name outside the @code{let} expression. This is like understanding +that whenever your host refers to `the house', he means his house, not +yours. (Symbols used in argument lists work the same way. +@xref{defun, , The @code{defun} Special Form}.) + +Local variables created by a @code{let} expression retain their value +@emph{only} within the @code{let} expression itself (and within +expressions called within the @code{let} expression); the local +variables have no effect outside the @code{let} expression. + +Another way to think about @code{let} is that it is like a @code{setq} +that is temporary and local. The values set by @code{let} are +automatically undone when the @code{let} is finished. The setting +only affects expressions that are inside the bounds of the @code{let} +expression. In computer science jargon, we would say ``the binding of +a symbol is visible only in functions called in the @code{let} form; +in Emacs Lisp, scoping is dynamic, not lexical.'' + +@code{let} can create more than one variable at once. Also, +@code{let} gives each variable it creates an initial value, either a +value specified by you, or @code{nil}. (In the jargon, this is called +`binding the variable to the value'.) After @code{let} has created +and bound the variables, it executes the code in the body of the +@code{let}, and returns the value of the last expression in the body, +as the value of the whole @code{let} expression. (`Execute' is a jargon +term that means to evaluate a list; it comes from the use of the word +meaning `to give practical effect to' (@cite{Oxford English +Dictionary}). Since you evaluate an expression to perform an action, +`execute' has evolved as a synonym to `evaluate'.) + +@node Parts of let Expression, Sample let Expression, Prevent confusion, let +@comment node-name, next, previous, up +@subsection The Parts of a @code{let} Expression +@cindex @code{let} expression, parts of +@cindex Parts of @code{let} expression + +@cindex @samp{varlist} defined +A @code{let} expression is a list of three parts. The first part is +the symbol @code{let}. The second part is a list, called a +@dfn{varlist}, each element of which is either a symbol by itself or a +two-element list, the first element of which is a symbol. The third +part of the @code{let} expression is the body of the @code{let}. The +body usually consists of one or more lists. + +@need 800 +A template for a @code{let} expression looks like this: + +@smallexample +(let @var{varlist} @var{body}@dots{}) +@end smallexample + +@noindent +The symbols in the varlist are the variables that are given initial +values by the @code{let} special form. Symbols by themselves are given +the initial value of @code{nil}; and each symbol that is the first +element of a two-element list is bound to the value that is returned +when the Lisp interpreter evaluates the second element. + +Thus, a varlist might look like this: @code{(thread (needles 3))}. In +this case, in a @code{let} expression, Emacs binds the symbol +@code{thread} to an initial value of @code{nil}, and binds the symbol +@code{needles} to an initial value of 3. + +When you write a @code{let} expression, what you do is put the +appropriate expressions in the slots of the @code{let} expression +template. + +If the varlist is composed of two-element lists, as is often the case, +the template for the @code{let} expression looks like this: + +@smallexample +@group +(let ((@var{variable} @var{value}) + (@var{variable} @var{value}) + @dots{}) + @var{body}@dots{}) +@end group +@end smallexample + +@node Sample let Expression, Uninitialized let Variables, Parts of let Expression, let +@comment node-name, next, previous, up +@subsection Sample @code{let} Expression +@cindex Sample @code{let} expression +@cindex @code{let} expression sample + +The following expression creates and gives initial values +to the two variables @code{zebra} and @code{tiger}. The body of the +@code{let} expression is a list which calls the @code{message} function. + +@smallexample +@group +(let ((zebra 'stripes) + (tiger 'fierce)) + (message "One kind of animal has %s and another is %s." + zebra tiger)) +@end group +@end smallexample + +Here, the varlist is @code{((zebra 'stripes) (tiger 'fierce))}. + +The two variables are @code{zebra} and @code{tiger}. Each variable is +the first element of a two-element list and each value is the second +element of its two-element list. In the varlist, Emacs binds the +variable @code{zebra} to the value @code{stripes}@footnote{According +to Jared Diamond in @cite{Guns, Germs, and Steel}, ``@dots{} zebras +become impossibly dangerous as they grow older'' but the claim here is +that they do not become fierce like a tiger. (1997, W. W. Norton and +Co., ISBN 0-393-03894-2, page 171)}, and binds the +variable @code{tiger} to the value @code{fierce}. In this example, +both values are symbols preceded by a quote. The values could just as +well have been another list or a string. The body of the @code{let} +follows after the list holding the variables. In this example, the +body is a list that uses the @code{message} function to print a string +in the echo area. + +@need 1500 +You may evaluate the example in the usual fashion, by placing the +cursor after the last parenthesis and typing @kbd{C-x C-e}. When you do +this, the following will appear in the echo area: + +@smallexample +"One kind of animal has stripes and another is fierce." +@end smallexample + +As we have seen before, the @code{message} function prints its first +argument, except for @samp{%s}. In this example, the value of the variable +@code{zebra} is printed at the location of the first @samp{%s} and the +value of the variable @code{tiger} is printed at the location of the +second @samp{%s}. + +@node Uninitialized let Variables, , Sample let Expression, let +@comment node-name, next, previous, up +@subsection Uninitialized Variables in a @code{let} Statement +@cindex Uninitialized @code{let} variables +@cindex @code{let} variables uninitialized + +If you do not bind the variables in a @code{let} statement to specific +initial values, they will automatically be bound to an initial value of +@code{nil}, as in the following expression: + +@smallexample +@group +(let ((birch 3) + pine + fir + (oak 'some)) + (message + "Here are %d variables with %s, %s, and %s value." + birch pine fir oak)) +@end group +@end smallexample + +@noindent +Here, the varlist is @code{((birch 3) pine fir (oak 'some))}. + +@need 1250 +If you evaluate this expression in the usual way, the following will +appear in your echo area: + +@smallexample +"Here are 3 variables with nil, nil, and some value." +@end smallexample + +@noindent +In this example, Emacs binds the symbol @code{birch} to the number 3, +binds the symbols @code{pine} and @code{fir} to @code{nil}, and binds +the symbol @code{oak} to the value @code{some}. + +Note that in the first part of the @code{let}, the variables @code{pine} +and @code{fir} stand alone as atoms that are not surrounded by +parentheses; this is because they are being bound to @code{nil}, the +empty list. But @code{oak} is bound to @code{some} and so is a part of +the list @code{(oak 'some)}. Similarly, @code{birch} is bound to the +number 3 and so is in a list with that number. (Since a number +evaluates to itself, the number does not need to be quoted. Also, the +number is printed in the message using a @samp{%d} rather than a +@samp{%s}.) The four variables as a group are put into a list to +delimit them from the body of the @code{let}. + +@node if, else, let, Writing Defuns +@comment node-name, next, previous, up +@section The @code{if} Special Form +@findex if +@cindex Conditional with @code{if} + +A third special form, in addition to @code{defun} and @code{let}, is the +conditional @code{if}. This form is used to instruct the computer to +make decisions. You can write function definitions without using +@code{if}, but it is used often enough, and is important enough, to be +included here. It is used, for example, in the code for the +function @code{beginning-of-buffer}. + +The basic idea behind an @code{if}, is that ``@emph{if} a test is true, +@emph{then} an expression is evaluated.'' If the test is not true, the +expression is not evaluated. For example, you might make a decision +such as, ``if it is warm and sunny, then go to the beach!'' + +@menu +* if in more detail:: +* type-of-animal in detail:: An example of an @code{if} expression. +@end menu + +@node if in more detail, type-of-animal in detail, if, if +@ifnottex +@unnumberedsubsec @code{if} in more detail +@end ifnottex + +@cindex @samp{if-part} defined +@cindex @samp{then-part} defined +An @code{if} expression written in Lisp does not use the word `then'; +the test and the action are the second and third elements of the list +whose first element is @code{if}. Nonetheless, the test part of an +@code{if} expression is often called the @dfn{if-part} and the second +argument is often called the @dfn{then-part}. + +Also, when an @code{if} expression is written, the true-or-false-test +is usually written on the same line as the symbol @code{if}, but the +action to carry out if the test is true, the ``then-part'', is written +on the second and subsequent lines. This makes the @code{if} +expression easier to read. + +@smallexample +@group +(if @var{true-or-false-test} + @var{action-to-carry-out-if-test-is-true}) +@end group +@end smallexample + +@noindent +The true-or-false-test will be an expression that +is evaluated by the Lisp interpreter. + +Here is an example that you can evaluate in the usual manner. The test +is whether the number 5 is greater than the number 4. Since it is, the +message @samp{5 is greater than 4!} will be printed. + +@smallexample +@group +(if (> 5 4) ; @r{if-part} + (message "5 is greater than 4!")) ; @r{then-part} +@end group +@end smallexample + +@noindent +(The function @code{>} tests whether its first argument is greater than +its second argument and returns true if it is.) +@findex > (greater than) + +Of course, in actual use, the test in an @code{if} expression will not +be fixed for all time as it is by the expression @code{(> 5 4)}. +Instead, at least one of the variables used in the test will be bound to +a value that is not known ahead of time. (If the value were known ahead +of time, we would not need to run the test!) + +For example, the value may be bound to an argument of a function +definition. In the following function definition, the character of the +animal is a value that is passed to the function. If the value bound to +@code{characteristic} is @code{fierce}, then the message, @samp{It's a +tiger!} will be printed; otherwise, @code{nil} will be returned. + +@smallexample +@group +(defun type-of-animal (characteristic) + "Print message in echo area depending on CHARACTERISTIC. +If the CHARACTERISTIC is the symbol `fierce', +then warn of a tiger." + (if (equal characteristic 'fierce) + (message "It's a tiger!"))) +@end group +@end smallexample + +@need 1500 +@noindent +If you are reading this inside of GNU Emacs, you can evaluate the +function definition in the usual way to install it in Emacs, and then you +can evaluate the following two expressions to see the results: + +@smallexample +@group +(type-of-animal 'fierce) + +(type-of-animal 'zebra) + +@end group +@end smallexample + +@c Following sentences rewritten to prevent overfull hbox. +@noindent +When you evaluate @code{(type-of-animal 'fierce)}, you will see the +following message printed in the echo area: @code{"It's a tiger!"}; and +when you evaluate @code{(type-of-animal 'zebra)} you will see @code{nil} +printed in the echo area. + +@node type-of-animal in detail, , if in more detail, if +@comment node-name, next, previous, up +@subsection The @code{type-of-animal} Function in Detail + +Let's look at the @code{type-of-animal} function in detail. + +The function definition for @code{type-of-animal} was written by filling +the slots of two templates, one for a function definition as a whole, and +a second for an @code{if} expression. + +@need 1250 +The template for every function that is not interactive is: + +@smallexample +@group +(defun @var{name-of-function} (@var{argument-list}) + "@var{documentation}@dots{}" + @var{body}@dots{}) +@end group +@end smallexample + +@need 800 +The parts of the function that match this template look like this: + +@smallexample +@group +(defun type-of-animal (characteristic) + "Print message in echo area depending on CHARACTERISTIC. +If the CHARACTERISTIC is the symbol `fierce', +then warn of a tiger." + @var{body: the} @code{if} @var{expression}) +@end group +@end smallexample + +The name of function is @code{type-of-animal}; it is passed the value +of one argument. The argument list is followed by a multi-line +documentation string. The documentation string is included in the +example because it is a good habit to write documentation string for +every function definition. The body of the function definition +consists of the @code{if} expression. + +@need 800 +The template for an @code{if} expression looks like this: + +@smallexample +@group +(if @var{true-or-false-test} + @var{action-to-carry-out-if-the-test-returns-true}) +@end group +@end smallexample + +@need 1250 +In the @code{type-of-animal} function, the code for the @code{if} +looks like this: + +@smallexample +@group +(if (equal characteristic 'fierce) + (message "It's a tiger!"))) +@end group +@end smallexample + +@need 800 +Here, the true-or-false-test is the expression: + +@smallexample +(equal characteristic 'fierce) +@end smallexample + +@noindent +In Lisp, @code{equal} is a function that determines whether its first +argument is equal to its second argument. The second argument is the +quoted symbol @code{'fierce} and the first argument is the value of the +symbol @code{characteristic}---in other words, the argument passed to +this function. + +In the first exercise of @code{type-of-animal}, the argument +@code{fierce} is passed to @code{type-of-animal}. Since @code{fierce} +is equal to @code{fierce}, the expression, @code{(equal characteristic +'fierce)}, returns a value of true. When this happens, the @code{if} +evaluates the second argument or then-part of the @code{if}: +@code{(message "It's tiger!")}. + +On the other hand, in the second exercise of @code{type-of-animal}, the +argument @code{zebra} is passed to @code{type-of-animal}. @code{zebra} +is not equal to @code{fierce}, so the then-part is not evaluated and +@code{nil} is returned by the @code{if} expression. + +@node else, Truth & Falsehood, if, Writing Defuns +@comment node-name, next, previous, up +@section If--then--else Expressions +@cindex Else + +An @code{if} expression may have an optional third argument, called +the @dfn{else-part}, for the case when the true-or-false-test returns +false. When this happens, the second argument or then-part of the +overall @code{if} expression is @emph{not} evaluated, but the third or +else-part @emph{is} evaluated. You might think of this as the cloudy +day alternative for the decision ``if it is warm and sunny, then go to +the beach, else read a book!''. + +The word ``else'' is not written in the Lisp code; the else-part of an +@code{if} expression comes after the then-part. In the written Lisp, the +else-part is usually written to start on a line of its own and is +indented less than the then-part: + +@smallexample +@group +(if @var{true-or-false-test} + @var{action-to-carry-out-if-the-test-returns-true} + @var{action-to-carry-out-if-the-test-returns-false}) +@end group +@end smallexample + +For example, the following @code{if} expression prints the message @samp{4 +is not greater than 5!} when you evaluate it in the usual way: + +@smallexample +@group +(if (> 4 5) ; @r{if-part} + (message "4 falsely greater than 5!") ; @r{then-part} + (message "4 is not greater than 5!")) ; @r{else-part} +@end group +@end smallexample + +@noindent +Note that the different levels of indentation make it easy to +distinguish the then-part from the else-part. (GNU Emacs has several +commands that automatically indent @code{if} expressions correctly. +@xref{Typing Lists, , GNU Emacs Helps You Type Lists}.) + +We can extend the @code{type-of-animal} function to include an +else-part by simply incorporating an additional part to the @code{if} +expression. + +@need 1500 +You can see the consequences of doing this if you evaluate the following +version of the @code{type-of-animal} function definition to install it +and then evaluate the two subsequent expressions to pass different +arguments to the function. + +@smallexample +@group +(defun type-of-animal (characteristic) ; @r{Second version.} + "Print message in echo area depending on CHARACTERISTIC. +If the CHARACTERISTIC is the symbol `fierce', +then warn of a tiger; +else say it's not fierce." + (if (equal characteristic 'fierce) + (message "It's a tiger!") + (message "It's not fierce!"))) +@end group +@end smallexample +@sp 1 + +@smallexample +@group +(type-of-animal 'fierce) + +(type-of-animal 'zebra) + +@end group +@end smallexample + +@c Following sentence rewritten to prevent overfull hbox. +@noindent +When you evaluate @code{(type-of-animal 'fierce)}, you will see the +following message printed in the echo area: @code{"It's a tiger!"}; but +when you evaluate @code{(type-of-animal 'zebra)}, you will see +@code{"It's not fierce!"}. + +(Of course, if the @var{characteristic} were @code{ferocious}, the +message @code{"It's not fierce!"} would be printed; and it would be +misleading! When you write code, you need to take into account the +possibility that some such argument will be tested by the @code{if} +and write your program accordingly.) + +@node Truth & Falsehood, save-excursion, else, Writing Defuns +@comment node-name, next, previous, up +@section Truth and Falsehood in Emacs Lisp +@cindex Truth and falsehood in Emacs Lisp +@cindex Falsehood and truth in Emacs Lisp +@findex nil + +There is an important aspect to the truth test in an @code{if} +expression. So far, we have spoken of `true' and `false' as values of +predicates as if they were new kinds of Emacs Lisp objects. In fact, +`false' is just our old friend @code{nil}. Anything else---anything +at all---is `true'. + +The expression that tests for truth is interpreted as @dfn{true} +if the result of evaluating it is a value that is not @code{nil}. In +other words, the result of the test is considered true if the value +returned is a number such as 47, a string such as @code{"hello"}, or a +symbol (other than @code{nil}) such as @code{flowers}, or a list (so +long as it is not empty), or even a buffer! + +@menu +* nil explained:: @code{nil} has two meanings. +@end menu + +@node nil explained, , Truth & Falsehood, Truth & Falsehood +@ifnottex +@unnumberedsubsec An explanation of @code{nil} +@end ifnottex + +Before illustrating a test for truth, we need an explanation of @code{nil}. + +In Emacs Lisp, the symbol @code{nil} has two meanings. First, it means the +empty list. Second, it means false and is the value returned when a +true-or-false-test tests false. @code{nil} can be written as an empty +list, @code{()}, or as @code{nil}. As far as the Lisp interpreter is +concerned, @code{()} and @code{nil} are the same. Humans, however, tend +to use @code{nil} for false and @code{()} for the empty list. + +In Emacs Lisp, any value that is not @code{nil}---is not the empty +list---is considered true. This means that if an evaluation returns +something that is not an empty list, an @code{if} expression will test +true. For example, if a number is put in the slot for the test, it +will be evaluated and will return itself, since that is what numbers +do when evaluated. In this conditional, the @code{if} expression will +test true. The expression tests false only when @code{nil}, an empty +list, is returned by evaluating the expression. + +You can see this by evaluating the two expressions in the following examples. + +In the first example, the number 4 is evaluated as the test in the +@code{if} expression and returns itself; consequently, the then-part +of the expression is evaluated and returned: @samp{true} appears in +the echo area. In the second example, the @code{nil} indicates false; +consequently, the else-part of the expression is evaluated and +returned: @samp{false} appears in the echo area. + +@smallexample +@group +(if 4 + 'true + 'false) +@end group + +@group +(if nil + 'true + 'false) +@end group +@end smallexample + +@need 1250 +Incidentally, if some other useful value is not available for a test that +returns true, then the Lisp interpreter will return the symbol @code{t} +for true. For example, the expression @code{(> 5 4)} returns @code{t} +when evaluated, as you can see by evaluating it in the usual way: + +@smallexample +(> 5 4) +@end smallexample + +@need 1250 +@noindent +On the other hand, this function returns @code{nil} if the test is false. + +@smallexample +(> 4 5) +@end smallexample + +@node save-excursion, Review, Truth & Falsehood, Writing Defuns +@comment node-name, next, previous, up +@section @code{save-excursion} +@findex save-excursion +@cindex Region, what it is +@cindex Preserving point, mark, and buffer +@cindex Point, mark, buffer preservation +@findex point +@findex mark + +The @code{save-excursion} function is the fourth and final special form +that we will discuss in this chapter. + +In Emacs Lisp programs used for editing, the @code{save-excursion} +function is very common. It saves the location of point and mark, +executes the body of the function, and then restores point and mark to +their previous positions if their locations were changed. Its primary +purpose is to keep the user from being surprised and disturbed by +unexpected movement of point or mark. + +@menu +* Point and mark:: A review of various locations. +* Template for save-excursion:: +@end menu + +@node Point and mark, Template for save-excursion, save-excursion, save-excursion +@ifnottex +@unnumberedsubsec Point and Mark +@end ifnottex + +Before discussing @code{save-excursion}, however, it may be useful +first to review what point and mark are in GNU Emacs. @dfn{Point} is +the current location of the cursor. Wherever the cursor +is, that is point. More precisely, on terminals where the cursor +appears to be on top of a character, point is immediately before the +character. In Emacs Lisp, point is an integer. The first character in +a buffer is number one, the second is number two, and so on. The +function @code{point} returns the current position of the cursor as a +number. Each buffer has its own value for point. + +The @dfn{mark} is another position in the buffer; its value can be set +with a command such as @kbd{C-@key{SPC}} (@code{set-mark-command}). If +a mark has been set, you can use the command @kbd{C-x C-x} +(@code{exchange-point-and-mark}) to cause the cursor to jump to the mark +and set the mark to be the previous position of point. In addition, if +you set another mark, the position of the previous mark is saved in the +mark ring. Many mark positions can be saved this way. You can jump the +cursor to a saved mark by typing @kbd{C-u C-@key{SPC}} one or more +times. + +The part of the buffer between point and mark is called @dfn{the +region}. Numerous commands work on the region, including +@code{center-region}, @code{count-lines-region}, @code{kill-region}, and +@code{print-region}. + +The @code{save-excursion} special form saves the locations of point and +mark and restores those positions after the code within the body of the +special form is evaluated by the Lisp interpreter. Thus, if point were +in the beginning of a piece of text and some code moved point to the end +of the buffer, the @code{save-excursion} would put point back to where +it was before, after the expressions in the body of the function were +evaluated. + +In Emacs, a function frequently moves point as part of its internal +workings even though a user would not expect this. For example, +@code{count-lines-region} moves point. To prevent the user from being +bothered by jumps that are both unexpected and (from the user's point of +view) unnecessary, @code{save-excursion} is often used to keep point and +mark in the location expected by the user. The use of +@code{save-excursion} is good housekeeping. + +To make sure the house stays clean, @code{save-excursion} restores the +values of point and mark even if something goes wrong in the code inside +of it (or, to be more precise and to use the proper jargon, ``in case of +abnormal exit''). This feature is very helpful. + +In addition to recording the values of point and mark, +@code{save-excursion} keeps track of the current buffer, and restores +it, too. This means you can write code that will change the buffer and +have @code{save-excursion} switch you back to the original buffer. +This is how @code{save-excursion} is used in @code{append-to-buffer}. +(@xref{append-to-buffer, , The Definition of @code{append-to-buffer}}.) + +@node Template for save-excursion, , Point and mark, save-excursion +@comment node-name, next, previous, up +@subsection Template for a @code{save-excursion} Expression + +@need 800 +The template for code using @code{save-excursion} is simple: + +@smallexample +@group +(save-excursion + @var{body}@dots{}) +@end group +@end smallexample + +@noindent +The body of the function is one or more expressions that will be +evaluated in sequence by the Lisp interpreter. If there is more than +one expression in the body, the value of the last one will be returned +as the value of the @code{save-excursion} function. The other +expressions in the body are evaluated only for their side effects; and +@code{save-excursion} itself is used only for its side effect (which +is restoring the positions of point and mark). + +@need 1250 +In more detail, the template for a @code{save-excursion} expression +looks like this: + +@smallexample +@group +(save-excursion + @var{first-expression-in-body} + @var{second-expression-in-body} + @var{third-expression-in-body} + @dots{} + @var{last-expression-in-body}) +@end group +@end smallexample + +@noindent +An expression, of course, may be a symbol on its own or a list. + +In Emacs Lisp code, a @code{save-excursion} expression often occurs +within the body of a @code{let} expression. It looks like this: + +@smallexample +@group +(let @var{varlist} + (save-excursion + @var{body}@dots{})) +@end group +@end smallexample + +@node Review, defun Exercises, save-excursion, Writing Defuns +@comment node-name, next, previous, up +@section Review + +In the last few chapters we have introduced a fair number of functions +and special forms. Here they are described in brief, along with a few +similar functions that have not been mentioned yet. + +@table @code +@item eval-last-sexp +Evaluate the last symbolic expression before the current location of +point. The value is printed in the echo area unless the function is +invoked with an argument; in that case, the output is printed in the +current buffer. This command is normally bound to @kbd{C-x C-e}. + +@item defun +Define function. This special form has up to five parts: the name, +a template for the arguments that will be passed to the function, +documentation, an optional interactive declaration, and the body of the +definition. + +@need 1250 +For example, in an early version of Emacs, the function definition was +as follows. (It is slightly more complex now that it seeks the first +non-whitespace character rather than the first visible character.) + +@smallexample +@group +(defun back-to-indentation () + "Move point to first visible character on line." + (interactive) + (beginning-of-line 1) + (skip-chars-forward " \t")) +@end group +@end smallexample + +@ignore +In GNU Emacs 22, + +(defun backward-to-indentation (&optional arg) + "Move backward ARG lines and position at first nonblank character." + (interactive "p") + (forward-line (- (or arg 1))) + (skip-chars-forward " \t")) + +(defun back-to-indentation () + "Move point to the first non-whitespace character on this line." + (interactive) + (beginning-of-line 1) + (skip-syntax-forward " " (line-end-position)) + ;; Move back over chars that have whitespace syntax but have the p flag. + (backward-prefix-chars)) +@end ignore + +@item interactive +Declare to the interpreter that the function can be used +interactively. This special form may be followed by a string with one +or more parts that pass the information to the arguments of the +function, in sequence. These parts may also tell the interpreter to +prompt for information. Parts of the string are separated by +newlines, @samp{\n}. + +@need 1000 +Common code characters are: + +@table @code +@item b +The name of an existing buffer. + +@item f +The name of an existing file. + +@item p +The numeric prefix argument. (Note that this `p' is lower case.) + +@item r +Point and the mark, as two numeric arguments, smallest first. This +is the only code letter that specifies two successive arguments +rather than one. +@end table + +@xref{Interactive Codes, , Code Characters for @samp{interactive}, +elisp, The GNU Emacs Lisp Reference Manual}, for a complete list of +code characters. + +@item let +Declare that a list of variables is for use within the body of the +@code{let} and give them an initial value, either @code{nil} or a +specified value; then evaluate the rest of the expressions in the body +of the @code{let} and return the value of the last one. Inside the +body of the @code{let}, the Lisp interpreter does not see the values of +the variables of the same names that are bound outside of the +@code{let}. + +@need 1250 +For example, + +@smallexample +@group +(let ((foo (buffer-name)) + (bar (buffer-size))) + (message + "This buffer is %s and has %d characters." + foo bar)) +@end group +@end smallexample + +@item save-excursion +Record the values of point and mark and the current buffer before +evaluating the body of this special form. Restore the values of point +and mark and buffer afterward. + +@need 1250 +For example, + +@smallexample +@group +(message "We are %d characters into this buffer." + (- (point) + (save-excursion + (goto-char (point-min)) (point)))) +@end group +@end smallexample + +@item if +Evaluate the first argument to the function; if it is true, evaluate +the second argument; else evaluate the third argument, if there is one. + +The @code{if} special form is called a @dfn{conditional}. There are +other conditionals in Emacs Lisp, but @code{if} is perhaps the most +commonly used. + +@need 1250 +For example, + +@smallexample +@group +(if (= 22 emacs-major-version) + (message "This is version 22 Emacs") + (message "This is not version 22 Emacs")) +@end group +@end smallexample + +@need 1250 +@item < +@itemx > +@itemx <= +@itemx >= +The @code{<} function tests whether its first argument is smaller than +its second argument. A corresponding function, @code{>}, tests whether +the first argument is greater than the second. Likewise, @code{<=} +tests whether the first argument is less than or equal to the second and +@code{>=} tests whether the first argument is greater than or equal to +the second. In all cases, both arguments must be numbers or markers +(markers indicate positions in buffers). + +@need 800 +@item = +The @code{=} function tests whether two arguments, both numbers or +markers, are equal. + +@need 1250 +@item equal +@itemx eq +Test whether two objects are the same. @code{equal} uses one meaning +of the word `same' and @code{eq} uses another: @code{equal} returns +true if the two objects have a similar structure and contents, such as +two copies of the same book. On the other hand, @code{eq}, returns +true if both arguments are actually the same object. +@findex equal +@findex eq + +@need 1250 +@item string< +@itemx string-lessp +@itemx string= +@itemx string-equal +The @code{string-lessp} function tests whether its first argument is +smaller than the second argument. A shorter, alternative name for the +same function (a @code{defalias}) is @code{string<}. + +The arguments to @code{string-lessp} must be strings or symbols; the +ordering is lexicographic, so case is significant. The print names of +symbols are used instead of the symbols themselves. + +@cindex @samp{empty string} defined +An empty string, @samp{""}, a string with no characters in it, is +smaller than any string of characters. + +@code{string-equal} provides the corresponding test for equality. Its +shorter, alternative name is @code{string=}. There are no string test +functions that correspond to @var{>}, @code{>=}, or @code{<=}. + +@item message +Print a message in the echo area. The first argument is a string that +can contain @samp{%s}, @samp{%d}, or @samp{%c} to print the value of +arguments that follow the string. The argument used by @samp{%s} must +be a string or a symbol; the argument used by @samp{%d} must be a +number. The argument used by @samp{%c} must be an @sc{ascii} code +number; it will be printed as the character with that @sc{ascii} code. +(Various other %-sequences have not been mentioned.) + +@item setq +@itemx set +The @code{setq} function sets the value of its first argument to the +value of the second argument. The first argument is automatically +quoted by @code{setq}. It does the same for succeeding pairs of +arguments. Another function, @code{set}, takes only two arguments and +evaluates both of them before setting the value returned by its first +argument to the value returned by its second argument. + +@item buffer-name +Without an argument, return the name of the buffer, as a string. + +@itemx buffer-file-name +Without an argument, return the name of the file the buffer is +visiting. + +@item current-buffer +Return the buffer in which Emacs is active; it may not be +the buffer that is visible on the screen. + +@item other-buffer +Return the most recently selected buffer (other than the buffer passed +to @code{other-buffer} as an argument and other than the current +buffer). + +@item switch-to-buffer +Select a buffer for Emacs to be active in and display it in the current +window so users can look at it. Usually bound to @kbd{C-x b}. + +@item set-buffer +Switch Emacs' attention to a buffer on which programs will run. Don't +alter what the window is showing. + +@item buffer-size +Return the number of characters in the current buffer. + +@item point +Return the value of the current position of the cursor, as an +integer counting the number of characters from the beginning of the +buffer. + +@item point-min +Return the minimum permissible value of point in +the current buffer. This is 1, unless narrowing is in effect. + +@item point-max +Return the value of the maximum permissible value of point in the +current buffer. This is the end of the buffer, unless narrowing is in +effect. +@end table + +@need 1500 +@node defun Exercises, , Review, Writing Defuns +@section Exercises + +@itemize @bullet +@item +Write a non-interactive function that doubles the value of its +argument, a number. Make that function interactive. + +@item +Write a function that tests whether the current value of +@code{fill-column} is greater than the argument passed to the function, +and if so, prints an appropriate message. +@end itemize + +@node Buffer Walk Through, More Complex, Writing Defuns, Top +@comment node-name, next, previous, up +@chapter A Few Buffer--Related Functions + +In this chapter we study in detail several of the functions used in GNU +Emacs. This is called a ``walk-through''. These functions are used as +examples of Lisp code, but are not imaginary examples; with the +exception of the first, simplified function definition, these functions +show the actual code used in GNU Emacs. You can learn a great deal from +these definitions. The functions described here are all related to +buffers. Later, we will study other functions. + +@menu +* Finding More:: How to find more information. +* simplified-beginning-of-buffer:: Shows @code{goto-char}, + @code{point-min}, and @code{push-mark}. +* mark-whole-buffer:: Almost the same as @code{beginning-of-buffer}. +* append-to-buffer:: Uses @code{save-excursion} and + @code{insert-buffer-substring}. +* Buffer Related Review:: Review. +* Buffer Exercises:: +@end menu + +@node Finding More, simplified-beginning-of-buffer, Buffer Walk Through, Buffer Walk Through +@section Finding More Information + +@findex describe-function, @r{introduced} +@cindex Find function documentation +In this walk-through, I will describe each new function as we come to +it, sometimes in detail and sometimes briefly. If you are interested, +you can get the full documentation of any Emacs Lisp function at any +time by typing @kbd{C-h f} and then the name of the function (and then +@key{RET}). Similarly, you can get the full documentation for a +variable by typing @kbd{C-h v} and then the name of the variable (and +then @key{RET}). + +@cindex Find source of function +@c In version 22, tells location both of C and of Emacs Lisp +Also, @code{describe-function} will tell you the location of the +function definition. + +Put point into the name of the file that contains the function and +press the @key{RET} key. In this case, @key{RET} means +@code{push-button} rather than `return' or `enter'. Emacs will take +you directly to the function definition. + +@ignore +Not In version 22 + +If you move point over the file name and press +the @key{RET} key, which in this case means @code{help-follow} rather +than `return' or `enter', Emacs will take you directly to the function +definition. +@end ignore + +More generally, if you want to see a function in its original source +file, you can use the @code{find-tags} function to jump to it. +@code{find-tags} works with a wide variety of languages, not just +Lisp, and C, and it works with non-programming text as well. For +example, @code{find-tags} will jump to the various nodes in the +Texinfo source file of this document. +The @code{find-tags} function depends on `tags tables' that record +the locations of the functions, variables, and other items to which +@code{find-tags} jumps. + +To use the @code{find-tags} command, type @kbd{M-.} (i.e., press the +period key while holding down the @key{META} key, or else type the +@key{ESC} key and then type the period key), and then, at the prompt, +type in the name of the function whose source code you want to see, +such as @code{mark-whole-buffer}, and then type @key{RET}. Emacs will +switch buffers and display the source code for the function on your +screen. To switch back to your current buffer, type @kbd{C-x b +@key{RET}}. (On some keyboards, the @key{META} key is labelled +@key{ALT}.) + +@c !!! 22.1.1 tags table location in this paragraph +@cindex TAGS table, specifying +@findex find-tags +Depending on how the initial default values of your copy of Emacs are +set, you may also need to specify the location of your `tags table', +which is a file called @file{TAGS}. For example, if you are +interested in Emacs sources, the tags table you will most likely want, +if it has already been created for you, will be in a subdirectory of +the @file{/usr/local/share/emacs/} directory; thus you would use the +@code{M-x visit-tags-table} command and specify a pathname such as +@file{/usr/local/share/emacs/22.1.1/lisp/TAGS}. If the tags table +has not already been created, you will have to create it yourself. It +will in a file such as @file{/usr/local/src/emacs/src/TAGS}. + +@need 1250 +To create a @file{TAGS} file in a specific directory, switch to that +directory in Emacs using @kbd{M-x cd} command, or list the directory +with @kbd{C-x d} (@code{dired}). Then run the compile command, with +@w{@code{etags *.el}} as the command to execute: + +@smallexample +M-x compile RET etags *.el RET +@end smallexample + +For more information, see @ref{etags, , Create Your Own @file{TAGS} File}. + +After you become more familiar with Emacs Lisp, you will find that you will +frequently use @code{find-tags} to navigate your way around source code; +and you will create your own @file{TAGS} tables. + +@cindex Library, as term for `file' +Incidentally, the files that contain Lisp code are conventionally +called @dfn{libraries}. The metaphor is derived from that of a +specialized library, such as a law library or an engineering library, +rather than a general library. Each library, or file, contains +functions that relate to a particular topic or activity, such as +@file{abbrev.el} for handling abbreviations and other typing +shortcuts, and @file{help.el} for on-line help. (Sometimes several +libraries provide code for a single activity, as the various +@file{rmail@dots{}} files provide code for reading electronic mail.) +In @cite{The GNU Emacs Manual}, you will see sentences such as ``The +@kbd{C-h p} command lets you search the standard Emacs Lisp libraries +by topic keywords.'' + +@node simplified-beginning-of-buffer, mark-whole-buffer, Finding More, Buffer Walk Through +@comment node-name, next, previous, up +@section A Simplified @code{beginning-of-buffer} Definition +@findex simplified-beginning-of-buffer + +The @code{beginning-of-buffer} command is a good function to start with +since you are likely to be familiar with it and it is easy to +understand. Used as an interactive command, @code{beginning-of-buffer} +moves the cursor to the beginning of the buffer, leaving the mark at the +previous position. It is generally bound to @kbd{M-<}. + +In this section, we will discuss a shortened version of the function +that shows how it is most frequently used. This shortened function +works as written, but it does not contain the code for a complex option. +In another section, we will describe the entire function. +(@xref{beginning-of-buffer, , Complete Definition of +@code{beginning-of-buffer}}.) + +Before looking at the code, let's consider what the function +definition has to contain: it must include an expression that makes +the function interactive so it can be called by typing @kbd{M-x +beginning-of-buffer} or by typing a keychord such as @kbd{M-<}; it +must include code to leave a mark at the original position in the +buffer; and it must include code to move the cursor to the beginning +of the buffer. + +@need 1250 +Here is the complete text of the shortened version of the function: + +@smallexample +@group +(defun simplified-beginning-of-buffer () + "Move point to the beginning of the buffer; +leave mark at previous position." + (interactive) + (push-mark) + (goto-char (point-min))) +@end group +@end smallexample + +Like all function definitions, this definition has five parts following +the special form @code{defun}: + +@enumerate +@item +The name: in this example, @code{simplified-beginning-of-buffer}. + +@item +A list of the arguments: in this example, an empty list, @code{()}, + +@item +The documentation string. + +@item +The interactive expression. + +@item +The body. +@end enumerate + +@noindent +In this function definition, the argument list is empty; this means that +this function does not require any arguments. (When we look at the +definition for the complete function, we will see that it may be passed +an optional argument.) + +The interactive expression tells Emacs that the function is intended to +be used interactively. In this example, @code{interactive} does not have +an argument because @code{simplified-beginning-of-buffer} does not +require one. + +@need 800 +The body of the function consists of the two lines: + +@smallexample +@group +(push-mark) +(goto-char (point-min)) +@end group +@end smallexample + +The first of these lines is the expression, @code{(push-mark)}. When +this expression is evaluated by the Lisp interpreter, it sets a mark at +the current position of the cursor, wherever that may be. The position +of this mark is saved in the mark ring. + +The next line is @code{(goto-char (point-min))}. This expression +jumps the cursor to the minimum point in the buffer, that is, to the +beginning of the buffer (or to the beginning of the accessible portion +of the buffer if it is narrowed. @xref{Narrowing & Widening, , +Narrowing and Widening}.) + +The @code{push-mark} command sets a mark at the place where the cursor +was located before it was moved to the beginning of the buffer by the +@code{(goto-char (point-min))} expression. Consequently, you can, if +you wish, go back to where you were originally by typing @kbd{C-x C-x}. + +That is all there is to the function definition! + +@findex describe-function +When you are reading code such as this and come upon an unfamiliar +function, such as @code{goto-char}, you can find out what it does by +using the @code{describe-function} command. To use this command, type +@kbd{C-h f} and then type in the name of the function and press +@key{RET}. The @code{describe-function} command will print the +function's documentation string in a @file{*Help*} window. For +example, the documentation for @code{goto-char} is: + +@smallexample +@group +Set point to POSITION, a number or marker. +Beginning of buffer is position (point-min), end is (point-max). +@end group +@end smallexample + +@noindent +The function's one argument is the desired position. + +@noindent +(The prompt for @code{describe-function} will offer you the symbol +under or preceding the cursor, so you can save typing by positioning +the cursor right over or after the function and then typing @kbd{C-h f +@key{RET}}.) + +The @code{end-of-buffer} function definition is written in the same way as +the @code{beginning-of-buffer} definition except that the body of the +function contains the expression @code{(goto-char (point-max))} in place +of @code{(goto-char (point-min))}. + +@node mark-whole-buffer, append-to-buffer, simplified-beginning-of-buffer, Buffer Walk Through +@comment node-name, next, previous, up +@section The Definition of @code{mark-whole-buffer} +@findex mark-whole-buffer + +The @code{mark-whole-buffer} function is no harder to understand than the +@code{simplified-beginning-of-buffer} function. In this case, however, +we will look at the complete function, not a shortened version. + +The @code{mark-whole-buffer} function is not as commonly used as the +@code{beginning-of-buffer} function, but is useful nonetheless: it +marks a whole buffer as a region by putting point at the beginning and +a mark at the end of the buffer. It is generally bound to @kbd{C-x +h}. + +@menu +* mark-whole-buffer overview:: +* Body of mark-whole-buffer:: Only three lines of code. +@end menu + +@node mark-whole-buffer overview, Body of mark-whole-buffer, mark-whole-buffer, mark-whole-buffer +@ifnottex +@unnumberedsubsec An overview of @code{mark-whole-buffer} +@end ifnottex + +@need 1250 +In GNU Emacs 22, the code for the complete function looks like this: + +@smallexample +@group +(defun mark-whole-buffer () + "Put point at beginning and mark at end of buffer. +You probably should not use this function in Lisp programs; +it is usually a mistake for a Lisp function to use any subroutine +that uses or sets the mark." + (interactive) + (push-mark (point)) + (push-mark (point-max) nil t) + (goto-char (point-min))) +@end group +@end smallexample + +@need 1250 +Like all other functions, the @code{mark-whole-buffer} function fits +into the template for a function definition. The template looks like +this: + +@smallexample +@group +(defun @var{name-of-function} (@var{argument-list}) + "@var{documentation}@dots{}" + (@var{interactive-expression}@dots{}) + @var{body}@dots{}) +@end group +@end smallexample + +Here is how the function works: the name of the function is +@code{mark-whole-buffer}; it is followed by an empty argument list, +@samp{()}, which means that the function does not require arguments. +The documentation comes next. + +The next line is an @code{(interactive)} expression that tells Emacs +that the function will be used interactively. These details are similar +to the @code{simplified-beginning-of-buffer} function described in the +previous section. + +@need 1250 +@node Body of mark-whole-buffer, , mark-whole-buffer overview, mark-whole-buffer +@comment node-name, next, previous, up +@subsection Body of @code{mark-whole-buffer} + +The body of the @code{mark-whole-buffer} function consists of three +lines of code: + +@c GNU Emacs 22 +@smallexample +@group +(push-mark (point)) +(push-mark (point-max) nil t) +(goto-char (point-min)) +@end group +@end smallexample + +The first of these lines is the expression, @code{(push-mark (point))}. + +This line does exactly the same job as the first line of the body of +the @code{simplified-beginning-of-buffer} function, which is written +@code{(push-mark)}. In both cases, the Lisp interpreter sets a mark +at the current position of the cursor. + +I don't know why the expression in @code{mark-whole-buffer} is written +@code{(push-mark (point))} and the expression in +@code{beginning-of-buffer} is written @code{(push-mark)}. Perhaps +whoever wrote the code did not know that the arguments for +@code{push-mark} are optional and that if @code{push-mark} is not +passed an argument, the function automatically sets mark at the +location of point by default. Or perhaps the expression was written +so as to parallel the structure of the next line. In any case, the +line causes Emacs to determine the position of point and set a mark +there. + +In earlier versions of GNU Emacs, the next line of +@code{mark-whole-buffer} was @code{(push-mark (point-max))}. This +expression sets a mark at the point in the buffer that has the highest +number. This will be the end of the buffer (or, if the buffer is +narrowed, the end of the accessible portion of the buffer. +@xref{Narrowing & Widening, , Narrowing and Widening}, for more about +narrowing.) After this mark has been set, the previous mark, the one +set at point, is no longer set, but Emacs remembers its position, just +as all other recent marks are always remembered. This means that you +can, if you wish, go back to that position by typing @kbd{C-u +C-@key{SPC}} twice. + +@need 1250 +In GNU Emacs 22, the @code{(point-max)} is slightly more complicated. +The line reads + +@smallexample +(push-mark (point-max) nil t) +@end smallexample + +@noindent +The expression works nearly the same as before. It sets a mark at the +highest numbered place in the buffer that it can. However, in this +version, @code{push-mark} has two additional arguments. The second +argument to @code{push-mark} is @code{nil}. This tells the function +it @emph{should} display a message that says `Mark set' when it pushes +the mark. The third argument is @code{t}. This tells +@code{push-mark} to activate the mark when Transient Mark mode is +turned on. Transient Mark mode highlights the currently active +region. It is often turned off. + +Finally, the last line of the function is @code{(goto-char +(point-min)))}. This is written exactly the same way as it is written +in @code{beginning-of-buffer}. The expression moves the cursor to +the minimum point in the buffer, that is, to the beginning of the buffer +(or to the beginning of the accessible portion of the buffer). As a +result of this, point is placed at the beginning of the buffer and mark +is set at the end of the buffer. The whole buffer is, therefore, the +region. + +@node append-to-buffer, Buffer Related Review, mark-whole-buffer, Buffer Walk Through +@comment node-name, next, previous, up +@section The Definition of @code{append-to-buffer} +@findex append-to-buffer + +The @code{append-to-buffer} command is more complex than the +@code{mark-whole-buffer} command. What it does is copy the region +(that is, the part of the buffer between point and mark) from the +current buffer to a specified buffer. + +@menu +* append-to-buffer overview:: +* append interactive:: A two part interactive expression. +* append-to-buffer body:: Incorporates a @code{let} expression. +* append save-excursion:: How the @code{save-excursion} works. +@end menu + +@node append-to-buffer overview, append interactive, append-to-buffer, append-to-buffer +@ifnottex +@unnumberedsubsec An Overview of @code{append-to-buffer} +@end ifnottex + +@findex insert-buffer-substring +The @code{append-to-buffer} command uses the +@code{insert-buffer-substring} function to copy the region. +@code{insert-buffer-substring} is described by its name: it takes a +string of characters from part of a buffer, a ``substring'', and +inserts them into another buffer. + +Most of @code{append-to-buffer} is +concerned with setting up the conditions for +@code{insert-buffer-substring} to work: the code must specify both the +buffer to which the text will go, the window it comes from and goes +to, and the region that will be copied. + +@need 1250 +Here is the complete text of the function: + +@smallexample +@group +(defun append-to-buffer (buffer start end) + "Append to specified buffer the text of the region. +It is inserted into that buffer before its point. +@end group + +@group +When calling from a program, give three arguments: +BUFFER (or buffer name), START and END. +START and END specify the portion of the current buffer to be copied." + (interactive + (list (read-buffer "Append to buffer: " (other-buffer + (current-buffer) t)) + (region-beginning) (region-end))) +@end group +@group + (let ((oldbuf (current-buffer))) + (save-excursion + (let* ((append-to (get-buffer-create buffer)) + (windows (get-buffer-window-list append-to t t)) + point) + (set-buffer append-to) + (setq point (point)) + (barf-if-buffer-read-only) + (insert-buffer-substring oldbuf start end) + (dolist (window windows) + (when (= (window-point window) point) + (set-window-point window (point)))))))) +@end group +@end smallexample + +The function can be understood by looking at it as a series of +filled-in templates. + +The outermost template is for the function definition. In this +function, it looks like this (with several slots filled in): + +@smallexample +@group +(defun append-to-buffer (buffer start end) + "@var{documentation}@dots{}" + (interactive @dots{}) + @var{body}@dots{}) +@end group +@end smallexample + +The first line of the function includes its name and three arguments. +The arguments are the @code{buffer} to which the text will be copied, and +the @code{start} and @code{end} of the region in the current buffer that +will be copied. + +The next part of the function is the documentation, which is clear and +complete. As is conventional, the three arguments are written in +upper case so you will notice them easily. Even better, they are +described in the same order as in the argument list. + +Note that the documentation distinguishes between a buffer and its +name. (The function can handle either.) + +@node append interactive, append-to-buffer body, append-to-buffer overview, append-to-buffer +@comment node-name, next, previous, up +@subsection The @code{append-to-buffer} Interactive Expression + +Since the @code{append-to-buffer} function will be used interactively, +the function must have an @code{interactive} expression. (For a +review of @code{interactive}, see @ref{Interactive, , Making a +Function Interactive}.) The expression reads as follows: + +@smallexample +@group +(interactive + (list (read-buffer + "Append to buffer: " + (other-buffer (current-buffer) t)) + (region-beginning) + (region-end))) +@end group +@end smallexample + +@noindent +This expression is not one with letters standing for parts, as +described earlier. Instead, it starts a list with these parts: + +The first part of the list is an expression to read the name of a +buffer and return it as a string. That is @code{read-buffer}. The +function requires a prompt as its first argument, @samp{"Append to +buffer: "}. Its second argument tells the command what value to +provide if you don't specify anything. + +In this case that second argument is an expression containing the +function @code{other-buffer}, an exception, and a @samp{t}, standing +for true. + +The first argument to @code{other-buffer}, the exception, is yet +another function, @code{current-buffer}. That is not going to be +returned. The second argument is the symbol for true, @code{t}. that +tells @code{other-buffer} that it may show visible buffers (except in +this case, it will not show the current buffer, which makes sense). + +@need 1250 +The expression looks like this: + +@smallexample +(other-buffer (current-buffer) t) +@end smallexample + +The second and third arguments to the @code{list} expression are +@code{(region-beginning)} and @code{(region-end)}. These two +functions specify the beginning and end of the text to be appended. + +@need 1250 +Originally, the command used the letters @samp{B} and @samp{r}. +The whole @code{interactive} expression looked like this: + +@smallexample +(interactive "BAppend to buffer:@: \nr") +@end smallexample + +@noindent +But when that was done, the default value of the buffer switched to +was invisible. That was not wanted. + +(The prompt was separated from the second argument with a newline, +@samp{\n}. It was followed by an @samp{r} that told Emacs to bind the +two arguments that follow the symbol @code{buffer} in the function's +argument list (that is, @code{start} and @code{end}) to the values of +point and mark. That argument worked fine.) + +@node append-to-buffer body, append save-excursion, append interactive, append-to-buffer +@comment node-name, next, previous, up +@subsection The Body of @code{append-to-buffer} + +@ignore +in GNU Emacs 22 in /usr/local/src/emacs/lisp/simple.el + +(defun append-to-buffer (buffer start end) + "Append to specified buffer the text of the region. +It is inserted into that buffer before its point. + +When calling from a program, give three arguments: +BUFFER (or buffer name), START and END. +START and END specify the portion of the current buffer to be copied." + (interactive + (list (read-buffer "Append to buffer: " (other-buffer (current-buffer) t)) + (region-beginning) (region-end))) + (let ((oldbuf (current-buffer))) + (save-excursion + (let* ((append-to (get-buffer-create buffer)) + (windows (get-buffer-window-list append-to t t)) + point) + (set-buffer append-to) + (setq point (point)) + (barf-if-buffer-read-only) + (insert-buffer-substring oldbuf start end) + (dolist (window windows) + (when (= (window-point window) point) + (set-window-point window (point)))))))) +@end ignore + +The body of the @code{append-to-buffer} function begins with @code{let}. + +As we have seen before (@pxref{let, , @code{let}}), the purpose of a +@code{let} expression is to create and give initial values to one or +more variables that will only be used within the body of the +@code{let}. This means that such a variable will not be confused with +any variable of the same name outside the @code{let} expression. + +We can see how the @code{let} expression fits into the function as a +whole by showing a template for @code{append-to-buffer} with the +@code{let} expression in outline: + +@smallexample +@group +(defun append-to-buffer (buffer start end) + "@var{documentation}@dots{}" + (interactive @dots{}) + (let ((@var{variable} @var{value})) + @var{body}@dots{}) +@end group +@end smallexample + +The @code{let} expression has three elements: + +@enumerate +@item +The symbol @code{let}; + +@item +A varlist containing, in this case, a single two-element list, +@code{(@var{variable} @var{value})}; + +@item +The body of the @code{let} expression. +@end enumerate + +@need 800 +In the @code{append-to-buffer} function, the varlist looks like this: + +@smallexample +(oldbuf (current-buffer)) +@end smallexample + +@noindent +In this part of the @code{let} expression, the one variable, +@code{oldbuf}, is bound to the value returned by the +@code{(current-buffer)} expression. The variable, @code{oldbuf}, is +used to keep track of the buffer in which you are working and from +which you will copy. + +The element or elements of a varlist are surrounded by a set of +parentheses so the Lisp interpreter can distinguish the varlist from +the body of the @code{let}. As a consequence, the two-element list +within the varlist is surrounded by a circumscribing set of parentheses. +The line looks like this: + +@smallexample +@group +(let ((oldbuf (current-buffer))) + @dots{} ) +@end group +@end smallexample + +@noindent +The two parentheses before @code{oldbuf} might surprise you if you did +not realize that the first parenthesis before @code{oldbuf} marks the +boundary of the varlist and the second parenthesis marks the beginning +of the two-element list, @code{(oldbuf (current-buffer))}. + +@node append save-excursion, , append-to-buffer body, append-to-buffer +@comment node-name, next, previous, up +@subsection @code{save-excursion} in @code{append-to-buffer} + +The body of the @code{let} expression in @code{append-to-buffer} +consists of a @code{save-excursion} expression. + +The @code{save-excursion} function saves the locations of point and +mark, and restores them to those positions after the expressions in the +body of the @code{save-excursion} complete execution. In addition, +@code{save-excursion} keeps track of the original buffer, and +restores it. This is how @code{save-excursion} is used in +@code{append-to-buffer}. + +@need 1500 +@cindex Indentation for formatting +@cindex Formatting convention +Incidentally, it is worth noting here that a Lisp function is normally +formatted so that everything that is enclosed in a multi-line spread is +indented more to the right than the first symbol. In this function +definition, the @code{let} is indented more than the @code{defun}, and +the @code{save-excursion} is indented more than the @code{let}, like +this: + +@smallexample +@group +(defun @dots{} + @dots{} + @dots{} + (let@dots{} + (save-excursion + @dots{} +@end group +@end smallexample + +@need 1500 +@noindent +This formatting convention makes it easy to see that the lines in +the body of the @code{save-excursion} are enclosed by the parentheses +associated with @code{save-excursion}, just as the +@code{save-excursion} itself is enclosed by the parentheses associated +with the @code{let}: + +@smallexample +@group +(let ((oldbuf (current-buffer))) + (save-excursion + @dots{} + (set-buffer @dots{}) + (insert-buffer-substring oldbuf start end) + @dots{})) +@end group +@end smallexample + +@need 1200 +The use of the @code{save-excursion} function can be viewed as a process +of filling in the slots of a template: + +@smallexample +@group +(save-excursion + @var{first-expression-in-body} + @var{second-expression-in-body} + @dots{} + @var{last-expression-in-body}) +@end group +@end smallexample + +@need 1200 +@noindent +In this function, the body of the @code{save-excursion} contains only +one expression, the @code{let*} expression. You know about a +@code{let} function. The @code{let*} function is different. It has a +@samp{*} in its name. It enables Emacs to set each variable in its +varlist in sequence, one after another. + +Its critical feature is that variables later in the varlist can make +use of the values to which Emacs set variables earlier in the varlist. +@xref{fwd-para let, , The @code{let*} expression}. + +We will skip functions like @code{let*} and focus on two: the +@code{set-buffer} function and the @code{insert-buffer-substring} +function. + +@need 1250 +In the old days, the @code{set-buffer} expression was simply + +@smallexample +(set-buffer (get-buffer-create buffer)) +@end smallexample + +@need 1250 +@noindent +but now it is + +@smallexample +(set-buffer append-to) +@end smallexample + +@noindent +@code{append-to} is bound to @code{(get-buffer-create buffer)} earlier +on in the @code{let*} expression. That extra binding would not be +necessary except for that @code{append-to} is used later in the +varlist as an argument to @code{get-buffer-window-list}. + +@ignore +in GNU Emacs 22 + + (let ((oldbuf (current-buffer))) + (save-excursion + (let* ((append-to (get-buffer-create buffer)) + (windows (get-buffer-window-list append-to t t)) + point) + (set-buffer append-to) + (setq point (point)) + (barf-if-buffer-read-only) + (insert-buffer-substring oldbuf start end) + (dolist (window windows) + (when (= (window-point window) point) + (set-window-point window (point)))))))) +@end ignore + +The @code{append-to-buffer} function definition inserts text from the +buffer in which you are currently to a named buffer. It happens that +@code{insert-buffer-substring} copies text from another buffer to the +current buffer, just the reverse---that is why the +@code{append-to-buffer} definition starts out with a @code{let} that +binds the local symbol @code{oldbuf} to the value returned by +@code{current-buffer}. + +@need 1250 +The @code{insert-buffer-substring} expression looks like this: + +@smallexample +(insert-buffer-substring oldbuf start end) +@end smallexample + +@noindent +The @code{insert-buffer-substring} function copies a string +@emph{from} the buffer specified as its first argument and inserts the +string into the present buffer. In this case, the argument to +@code{insert-buffer-substring} is the value of the variable created +and bound by the @code{let}, namely the value of @code{oldbuf}, which +was the current buffer when you gave the @code{append-to-buffer} +command. + +After @code{insert-buffer-substring} has done its work, +@code{save-excursion} will restore the action to the original buffer +and @code{append-to-buffer} will have done its job. + +@need 800 +Written in skeletal form, the workings of the body look like this: + +@smallexample +@group +(let (@var{bind-}@code{oldbuf}@var{-to-value-of-}@code{current-buffer}) + (save-excursion ; @r{Keep track of buffer.} + @var{change-buffer} + @var{insert-substring-from-}@code{oldbuf}@var{-into-buffer}) + + @var{change-back-to-original-buffer-when-finished} +@var{let-the-local-meaning-of-}@code{oldbuf}@var{-disappear-when-finished} +@end group +@end smallexample + +In summary, @code{append-to-buffer} works as follows: it saves the +value of the current buffer in the variable called @code{oldbuf}. It +gets the new buffer (creating one if need be) and switches Emacs' +attention to it. Using the value of @code{oldbuf}, it inserts the +region of text from the old buffer into the new buffer; and then using +@code{save-excursion}, it brings you back to your original buffer. + +In looking at @code{append-to-buffer}, you have explored a fairly +complex function. It shows how to use @code{let} and +@code{save-excursion}, and how to change to and come back from another +buffer. Many function definitions use @code{let}, +@code{save-excursion}, and @code{set-buffer} this way. + +@node Buffer Related Review, Buffer Exercises, append-to-buffer, Buffer Walk Through +@comment node-name, next, previous, up +@section Review + +Here is a brief summary of the various functions discussed in this chapter. + +@table @code +@item describe-function +@itemx describe-variable +Print the documentation for a function or variable. +Conventionally bound to @kbd{C-h f} and @kbd{C-h v}. + +@item find-tag +Find the file containing the source for a function or variable and +switch buffers to it, positioning point at the beginning of the item. +Conventionally bound to @kbd{M-.} (that's a period following the +@key{META} key). + +@item save-excursion +Save the location of point and mark and restore their values after the +arguments to @code{save-excursion} have been evaluated. Also, remember +the current buffer and return to it. + +@item push-mark +Set mark at a location and record the value of the previous mark on the +mark ring. The mark is a location in the buffer that will keep its +relative position even if text is added to or removed from the buffer. + +@item goto-char +Set point to the location specified by the value of the argument, which +can be a number, a marker, or an expression that returns the number of +a position, such as @code{(point-min)}. + +@item insert-buffer-substring +Copy a region of text from a buffer that is passed to the function as +an argument and insert the region into the current buffer. + +@item mark-whole-buffer +Mark the whole buffer as a region. Normally bound to @kbd{C-x h}. + +@item set-buffer +Switch the attention of Emacs to another buffer, but do not change the +window being displayed. Used when the program rather than a human is +to work on a different buffer. + +@item get-buffer-create +@itemx get-buffer +Find a named buffer or create one if a buffer of that name does not +exist. The @code{get-buffer} function returns @code{nil} if the named +buffer does not exist. +@end table + +@need 1500 +@node Buffer Exercises, , Buffer Related Review, Buffer Walk Through +@section Exercises + +@itemize @bullet +@item +Write your own @code{simplified-end-of-buffer} function definition; +then test it to see whether it works. + +@item +Use @code{if} and @code{get-buffer} to write a function that prints a +message telling you whether a buffer exists. + +@item +Using @code{find-tag}, find the source for the @code{copy-to-buffer} +function. +@end itemize + +@node More Complex, Narrowing & Widening, Buffer Walk Through, Top +@comment node-name, next, previous, up +@chapter A Few More Complex Functions + +In this chapter, we build on what we have learned in previous chapters +by looking at more complex functions. The @code{copy-to-buffer} +function illustrates use of two @code{save-excursion} expressions in +one definition, while the @code{insert-buffer} function illustrates +use of an asterisk in an @code{interactive} expression, use of +@code{or}, and the important distinction between a name and the object +to which the name refers. + +@menu +* copy-to-buffer:: With @code{set-buffer}, @code{get-buffer-create}. +* insert-buffer:: Read-only, and with @code{or}. +* beginning-of-buffer:: Shows @code{goto-char}, + @code{point-min}, and @code{push-mark}. +* Second Buffer Related Review:: +* optional Exercise:: +@end menu + +@node copy-to-buffer, insert-buffer, More Complex, More Complex +@comment node-name, next, previous, up +@section The Definition of @code{copy-to-buffer} +@findex copy-to-buffer + +After understanding how @code{append-to-buffer} works, it is easy to +understand @code{copy-to-buffer}. This function copies text into a +buffer, but instead of adding to the second buffer, it replaces all the +previous text in the second buffer. + +@need 800 +The body of @code{copy-to-buffer} looks like this, + +@smallexample +@group +@dots{} +(interactive "BCopy to buffer: \nr") +(let ((oldbuf (current-buffer))) + (with-current-buffer (get-buffer-create buffer) + (barf-if-buffer-read-only) + (erase-buffer) + (save-excursion + (insert-buffer-substring oldbuf start end))))) +@end group +@end smallexample + +The @code{copy-to-buffer} function has a simpler @code{interactive} +expression than @code{append-to-buffer}. + +@need 800 +The definition then says + +@smallexample +(with-current-buffer (get-buffer-create buffer) @dots{} +@end smallexample + +First, look at the earliest inner expression; that is evaluated first. +That expression starts with @code{get-buffer-create buffer}. The +function tells the computer to use the buffer with the name specified +as the one to which you are copying, or if such a buffer does not +exist, to create it. Then, the @code{with-current-buffer} function +evaluates its body with that buffer temporarily current. + +(This demonstrates another way to shift the computer's attention but +not the user's. The @code{append-to-buffer} function showed how to do +the same with @code{save-excursion} and @code{set-buffer}. +@code{with-current-buffer} is a newer, and arguably easier, +mechanism.) + +The @code{barf-if-buffer-read-only} function sends you an error +message saying the buffer is read-only if you cannot modify it. + +The next line has the @code{erase-buffer} function as its sole +contents. That function erases the buffer. + +Finally, the last two lines contain the @code{save-excursion} +expression with @code{insert-buffer-substring} as its body. +The @code{insert-buffer-substring} expression copies the text from +the buffer you are in (and you have not seen the computer shift its +attention, so you don't know that that buffer is now called +@code{oldbuf}). + +Incidentally, this is what is meant by `replacement'. To replace text, +Emacs erases the previous text and then inserts new text. + +@need 1250 +In outline, the body of @code{copy-to-buffer} looks like this: + +@smallexample +@group +(let (@var{bind-}@code{oldbuf}@var{-to-value-of-}@code{current-buffer}) + (@var{with-the-buffer-you-are-copying-to} + (@var{but-do-not-erase-or-copy-to-a-read-only-buffer}) + (erase-buffer) + (save-excursion + @var{insert-substring-from-}@code{oldbuf}@var{-into-buffer}))) +@end group +@end smallexample + +@node insert-buffer, beginning-of-buffer, copy-to-buffer, More Complex +@comment node-name, next, previous, up +@section The Definition of @code{insert-buffer} +@findex insert-buffer + +@code{insert-buffer} is yet another buffer-related function. This +command copies another buffer @emph{into} the current buffer. It is the +reverse of @code{append-to-buffer} or @code{copy-to-buffer}, since they +copy a region of text @emph{from} the current buffer to another buffer. + +Here is a discussion based on the original code. The code was +simplified in 2003 and is harder to understand. + +(@xref{New insert-buffer, , New Body for @code{insert-buffer}}, to see +a discussion of the new body.) + +In addition, this code illustrates the use of @code{interactive} with a +buffer that might be @dfn{read-only} and the important distinction +between the name of an object and the object actually referred to. + +@menu +* insert-buffer code:: +* insert-buffer interactive:: When you can read, but not write. +* insert-buffer body:: The body has an @code{or} and a @code{let}. +* if & or:: Using an @code{if} instead of an @code{or}. +* Insert or:: How the @code{or} expression works. +* Insert let:: Two @code{save-excursion} expressions. +* New insert-buffer:: +@end menu + +@node insert-buffer code, insert-buffer interactive, insert-buffer, insert-buffer +@ifnottex +@unnumberedsubsec The Code for @code{insert-buffer} +@end ifnottex + +@need 800 +Here is the earlier code: + +@smallexample +@group +(defun insert-buffer (buffer) + "Insert after point the contents of BUFFER. +Puts mark after the inserted text. +BUFFER may be a buffer or a buffer name." + (interactive "*bInsert buffer:@: ") +@end group +@group + (or (bufferp buffer) + (setq buffer (get-buffer buffer))) + (let (start end newmark) + (save-excursion + (save-excursion + (set-buffer buffer) + (setq start (point-min) end (point-max))) +@end group +@group + (insert-buffer-substring buffer start end) + (setq newmark (point))) + (push-mark newmark))) +@end group +@end smallexample + +@need 1200 +As with other function definitions, you can use a template to see an +outline of the function: + +@smallexample +@group +(defun insert-buffer (buffer) + "@var{documentation}@dots{}" + (interactive "*bInsert buffer:@: ") + @var{body}@dots{}) +@end group +@end smallexample + +@node insert-buffer interactive, insert-buffer body, insert-buffer code, insert-buffer +@comment node-name, next, previous, up +@subsection The Interactive Expression in @code{insert-buffer} +@findex interactive, @r{example use of} + +In @code{insert-buffer}, the argument to the @code{interactive} +declaration has two parts, an asterisk, @samp{*}, and @samp{bInsert +buffer:@: }. + +@menu +* Read-only buffer:: When a buffer cannot be modified. +* b for interactive:: An existing buffer or else its name. +@end menu + +@node Read-only buffer, b for interactive, insert-buffer interactive, insert-buffer interactive +@comment node-name, next, previous, up +@unnumberedsubsubsec A Read-only Buffer +@cindex Read-only buffer +@cindex Asterisk for read-only buffer +@findex * @r{for read-only buffer} + +The asterisk is for the situation when the current buffer is a +read-only buffer---a buffer that cannot be modified. If +@code{insert-buffer} is called when the current buffer is read-only, a +message to this effect is printed in the echo area and the terminal +may beep or blink at you; you will not be permitted to insert anything +into current buffer. The asterisk does not need to be followed by a +newline to separate it from the next argument. + +@node b for interactive, , Read-only buffer, insert-buffer interactive +@comment node-name, next, previous, up +@unnumberedsubsubsec @samp{b} in an Interactive Expression + +The next argument in the interactive expression starts with a lower +case @samp{b}. (This is different from the code for +@code{append-to-buffer}, which uses an upper-case @samp{B}. +@xref{append-to-buffer, , The Definition of @code{append-to-buffer}}.) +The lower-case @samp{b} tells the Lisp interpreter that the argument +for @code{insert-buffer} should be an existing buffer or else its +name. (The upper-case @samp{B} option provides for the possibility +that the buffer does not exist.) Emacs will prompt you for the name +of the buffer, offering you a default buffer, with name completion +enabled. If the buffer does not exist, you receive a message that +says ``No match''; your terminal may beep at you as well. + +The new and simplified code generates a list for @code{interactive}. +It uses the @code{barf-if-buffer-read-only} and @code{read-buffer} +functions with which we are already familiar and the @code{progn} +special form with which we are not. (It will be described later.) + +@node insert-buffer body, if & or, insert-buffer interactive, insert-buffer +@comment node-name, next, previous, up +@subsection The Body of the @code{insert-buffer} Function + +The body of the @code{insert-buffer} function has two major parts: an +@code{or} expression and a @code{let} expression. The purpose of the +@code{or} expression is to ensure that the argument @code{buffer} is +bound to a buffer and not just the name of a buffer. The body of the +@code{let} expression contains the code which copies the other buffer +into the current buffer. + +@need 1250 +In outline, the two expressions fit into the @code{insert-buffer} +function like this: + +@smallexample +@group +(defun insert-buffer (buffer) + "@var{documentation}@dots{}" + (interactive "*bInsert buffer:@: ") + (or @dots{} + @dots{} +@end group +@group + (let (@var{varlist}) + @var{body-of-}@code{let}@dots{} ) +@end group +@end smallexample + +To understand how the @code{or} expression ensures that the argument +@code{buffer} is bound to a buffer and not to the name of a buffer, it +is first necessary to understand the @code{or} function. + +Before doing this, let me rewrite this part of the function using +@code{if} so that you can see what is done in a manner that will be familiar. + +@node if & or, Insert or, insert-buffer body, insert-buffer +@comment node-name, next, previous, up +@subsection @code{insert-buffer} With an @code{if} Instead of an @code{or} + +The job to be done is to make sure the value of @code{buffer} is a +buffer itself and not the name of a buffer. If the value is the name, +then the buffer itself must be got. + +You can imagine yourself at a conference where an usher is wandering +around holding a list with your name on it and looking for you: the +usher is ``bound'' to your name, not to you; but when the usher finds +you and takes your arm, the usher becomes ``bound'' to you. + +@need 800 +In Lisp, you might describe this situation like this: + +@smallexample +@group +(if (not (holding-on-to-guest)) + (find-and-take-arm-of-guest)) +@end group +@end smallexample + +We want to do the same thing with a buffer---if we do not have the +buffer itself, we want to get it. + +@need 1200 +Using a predicate called @code{bufferp} that tells us whether we have a +buffer (rather than its name), we can write the code like this: + +@smallexample +@group +(if (not (bufferp buffer)) ; @r{if-part} + (setq buffer (get-buffer buffer))) ; @r{then-part} +@end group +@end smallexample + +@noindent +Here, the true-or-false-test of the @code{if} expression is +@w{@code{(not (bufferp buffer))}}; and the then-part is the expression +@w{@code{(setq buffer (get-buffer buffer))}}. + +In the test, the function @code{bufferp} returns true if its argument is +a buffer---but false if its argument is the name of the buffer. (The +last character of the function name @code{bufferp} is the character +@samp{p}; as we saw earlier, such use of @samp{p} is a convention that +indicates that the function is a predicate, which is a term that means +that the function will determine whether some property is true or false. +@xref{Wrong Type of Argument, , Using the Wrong Type Object as an +Argument}.) + +@need 1200 +The function @code{not} precedes the expression @code{(bufferp buffer)}, +so the true-or-false-test looks like this: + +@smallexample +(not (bufferp buffer)) +@end smallexample + +@noindent +@code{not} is a function that returns true if its argument is false +and false if its argument is true. So if @code{(bufferp buffer)} +returns true, the @code{not} expression returns false and vice-verse: +what is ``not true'' is false and what is ``not false'' is true. + +Using this test, the @code{if} expression works as follows: when the +value of the variable @code{buffer} is actually a buffer rather than +its name, the true-or-false-test returns false and the @code{if} +expression does not evaluate the then-part. This is fine, since we do +not need to do anything to the variable @code{buffer} if it really is +a buffer. + +On the other hand, when the value of @code{buffer} is not a buffer +itself, but the name of a buffer, the true-or-false-test returns true +and the then-part of the expression is evaluated. In this case, the +then-part is @code{(setq buffer (get-buffer buffer))}. This +expression uses the @code{get-buffer} function to return an actual +buffer itself, given its name. The @code{setq} then sets the variable +@code{buffer} to the value of the buffer itself, replacing its previous +value (which was the name of the buffer). + +@node Insert or, Insert let, if & or, insert-buffer +@comment node-name, next, previous, up +@subsection The @code{or} in the Body + +The purpose of the @code{or} expression in the @code{insert-buffer} +function is to ensure that the argument @code{buffer} is bound to a +buffer and not just to the name of a buffer. The previous section shows +how the job could have been done using an @code{if} expression. +However, the @code{insert-buffer} function actually uses @code{or}. +To understand this, it is necessary to understand how @code{or} works. + +@findex or +An @code{or} function can have any number of arguments. It evaluates +each argument in turn and returns the value of the first of its +arguments that is not @code{nil}. Also, and this is a crucial feature +of @code{or}, it does not evaluate any subsequent arguments after +returning the first non-@code{nil} value. + +@need 800 +The @code{or} expression looks like this: + +@smallexample +@group +(or (bufferp buffer) + (setq buffer (get-buffer buffer))) +@end group +@end smallexample + +@noindent +The first argument to @code{or} is the expression @code{(bufferp buffer)}. +This expression returns true (a non-@code{nil} value) if the buffer is +actually a buffer, and not just the name of a buffer. In the @code{or} +expression, if this is the case, the @code{or} expression returns this +true value and does not evaluate the next expression---and this is fine +with us, since we do not want to do anything to the value of +@code{buffer} if it really is a buffer. + +On the other hand, if the value of @code{(bufferp buffer)} is @code{nil}, +which it will be if the value of @code{buffer} is the name of a buffer, +the Lisp interpreter evaluates the next element of the @code{or} +expression. This is the expression @code{(setq buffer (get-buffer +buffer))}. This expression returns a non-@code{nil} value, which +is the value to which it sets the variable @code{buffer}---and this +value is a buffer itself, not the name of a buffer. + +The result of all this is that the symbol @code{buffer} is always +bound to a buffer itself rather than to the name of a buffer. All +this is necessary because the @code{set-buffer} function in a +following line only works with a buffer itself, not with the name to a +buffer. + +@need 1250 +Incidentally, using @code{or}, the situation with the usher would be +written like this: + +@smallexample +(or (holding-on-to-guest) (find-and-take-arm-of-guest)) +@end smallexample + +@node Insert let, New insert-buffer, Insert or, insert-buffer +@comment node-name, next, previous, up +@subsection The @code{let} Expression in @code{insert-buffer} + +After ensuring that the variable @code{buffer} refers to a buffer itself +and not just to the name of a buffer, the @code{insert-buffer function} +continues with a @code{let} expression. This specifies three local +variables, @code{start}, @code{end}, and @code{newmark} and binds them +to the initial value @code{nil}. These variables are used inside the +remainder of the @code{let} and temporarily hide any other occurrence of +variables of the same name in Emacs until the end of the @code{let}. + +@need 1200 +The body of the @code{let} contains two @code{save-excursion} +expressions. First, we will look at the inner @code{save-excursion} +expression in detail. The expression looks like this: + +@smallexample +@group +(save-excursion + (set-buffer buffer) + (setq start (point-min) end (point-max))) +@end group +@end smallexample + +@noindent +The expression @code{(set-buffer buffer)} changes Emacs' attention +from the current buffer to the one from which the text will copied. +In that buffer, the variables @code{start} and @code{end} are set to +the beginning and end of the buffer, using the commands +@code{point-min} and @code{point-max}. Note that we have here an +illustration of how @code{setq} is able to set two variables in the +same expression. The first argument of @code{setq} is set to the +value of its second, and its third argument is set to the value of its +fourth. + +After the body of the inner @code{save-excursion} is evaluated, the +@code{save-excursion} restores the original buffer, but @code{start} and +@code{end} remain set to the values of the beginning and end of the +buffer from which the text will be copied. + +@need 1250 +The outer @code{save-excursion} expression looks like this: + +@smallexample +@group +(save-excursion + (@var{inner-}@code{save-excursion}@var{-expression} + (@var{go-to-new-buffer-and-set-}@code{start}@var{-and-}@code{end}) + (insert-buffer-substring buffer start end) + (setq newmark (point))) +@end group +@end smallexample + +@noindent +The @code{insert-buffer-substring} function copies the text +@emph{into} the current buffer @emph{from} the region indicated by +@code{start} and @code{end} in @code{buffer}. Since the whole of the +second buffer lies between @code{start} and @code{end}, the whole of +the second buffer is copied into the buffer you are editing. Next, +the value of point, which will be at the end of the inserted text, is +recorded in the variable @code{newmark}. + +After the body of the outer @code{save-excursion} is evaluated, point +and mark are relocated to their original places. + +However, it is convenient to locate a mark at the end of the newly +inserted text and locate point at its beginning. The @code{newmark} +variable records the end of the inserted text. In the last line of +the @code{let} expression, the @code{(push-mark newmark)} expression +function sets a mark to this location. (The previous location of the +mark is still accessible; it is recorded on the mark ring and you can +go back to it with @kbd{C-u C-@key{SPC}}.) Meanwhile, point is +located at the beginning of the inserted text, which is where it was +before you called the insert function, the position of which was saved +by the first @code{save-excursion}. + +@need 1250 +The whole @code{let} expression looks like this: + +@smallexample +@group +(let (start end newmark) + (save-excursion + (save-excursion + (set-buffer buffer) + (setq start (point-min) end (point-max))) + (insert-buffer-substring buffer start end) + (setq newmark (point))) + (push-mark newmark)) +@end group +@end smallexample + +Like the @code{append-to-buffer} function, the @code{insert-buffer} +function uses @code{let}, @code{save-excursion}, and +@code{set-buffer}. In addition, the function illustrates one way to +use @code{or}. All these functions are building blocks that we will +find and use again and again. + +@node New insert-buffer, , Insert let, insert-buffer +@comment node-name, next, previous, up +@subsection New Body for @code{insert-buffer} +@findex insert-buffer, new version body +@findex new version body for insert-buffer + +The body in the GNU Emacs 22 version is more confusing than the original. + +@need 1250 +It consists of two expressions, + +@smallexample +@group + (push-mark + (save-excursion + (insert-buffer-substring (get-buffer buffer)) + (point))) + + nil +@end group +@end smallexample + +@noindent +except, and this is what confuses novices, very important work is done +inside the @code{push-mark} expression. + +The @code{get-buffer} function returns a buffer with the name +provided. You will note that the function is @emph{not} called +@code{get-buffer-create}; it does not create a buffer if one does not +already exist. The buffer returned by @code{get-buffer}, an existing +buffer, is passed to @code{insert-buffer-substring}, which inserts the +whole of the buffer (since you did not specify anything else). + +The location into which the buffer is inserted is recorded by +@code{push-mark}. Then the function returns @code{nil}, the value of +its last command. Put another way, the @code{insert-buffer} function +exists only to produce a side effect, inserting another buffer, not to +return any value. + +@node beginning-of-buffer, Second Buffer Related Review, insert-buffer, More Complex +@comment node-name, next, previous, up +@section Complete Definition of @code{beginning-of-buffer} +@findex beginning-of-buffer + +The basic structure of the @code{beginning-of-buffer} function has +already been discussed. (@xref{simplified-beginning-of-buffer, , A +Simplified @code{beginning-of-buffer} Definition}.) +This section describes the complex part of the definition. + +As previously described, when invoked without an argument, +@code{beginning-of-buffer} moves the cursor to the beginning of the +buffer (in truth, the beginning of the accessible portion of the +buffer), leaving the mark at the previous position. However, when the +command is invoked with a number between one and ten, the function +considers that number to be a fraction of the length of the buffer, +measured in tenths, and Emacs moves the cursor that fraction of the +way from the beginning of the buffer. Thus, you can either call this +function with the key command @kbd{M-<}, which will move the cursor to +the beginning of the buffer, or with a key command such as @kbd{C-u 7 +M-<} which will move the cursor to a point 70% of the way through the +buffer. If a number bigger than ten is used for the argument, it +moves to the end of the buffer. + +The @code{beginning-of-buffer} function can be called with or without an +argument. The use of the argument is optional. + +@menu +* Optional Arguments:: +* beginning-of-buffer opt arg:: Example with optional argument. +* beginning-of-buffer complete:: +@end menu + +@node Optional Arguments, beginning-of-buffer opt arg, beginning-of-buffer, beginning-of-buffer +@subsection Optional Arguments + +Unless told otherwise, Lisp expects that a function with an argument in +its function definition will be called with a value for that argument. +If that does not happen, you get an error and a message that says +@samp{Wrong number of arguments}. + +@cindex Optional arguments +@cindex Keyword +@findex optional +However, optional arguments are a feature of Lisp: a particular +@dfn{keyword} is used to tell the Lisp interpreter that an argument is +optional. The keyword is @code{&optional}. (The @samp{&} in front of +@samp{optional} is part of the keyword.) In a function definition, if +an argument follows the keyword @code{&optional}, no value need be +passed to that argument when the function is called. + +@need 1200 +The first line of the function definition of @code{beginning-of-buffer} +therefore looks like this: + +@smallexample +(defun beginning-of-buffer (&optional arg) +@end smallexample + +@need 1250 +In outline, the whole function looks like this: + +@smallexample +@group +(defun beginning-of-buffer (&optional arg) + "@var{documentation}@dots{}" + (interactive "P") + (or (@var{is-the-argument-a-cons-cell} arg) + (and @var{are-both-transient-mark-mode-and-mark-active-true}) + (push-mark)) + (let (@var{determine-size-and-set-it}) + (goto-char + (@var{if-there-is-an-argument} + @var{figure-out-where-to-go} + @var{else-go-to} + (point-min)))) + @var{do-nicety} +@end group +@end smallexample + +The function is similar to the @code{simplified-beginning-of-buffer} +function except that the @code{interactive} expression has @code{"P"} +as an argument and the @code{goto-char} function is followed by an +if-then-else expression that figures out where to put the cursor if +there is an argument that is not a cons cell. + +(Since I do not explain a cons cell for many more chapters, please +consider ignoring the function @code{consp}. @xref{List +Implementation, , How Lists are Implemented}, and @ref{Cons Cell Type, +, Cons Cell and List Types, elisp, The GNU Emacs Lisp Reference +Manual}.) + +The @code{"P"} in the @code{interactive} expression tells Emacs to +pass a prefix argument, if there is one, to the function in raw form. +A prefix argument is made by typing the @key{META} key followed by a +number, or by typing @kbd{C-u} and then a number. (If you don't type +a number, @kbd{C-u} defaults to a cons cell with a 4. A lowercase +@code{"p"} in the @code{interactive} expression causes the function to +convert a prefix arg to a number.) + +The true-or-false-test of the @code{if} expression looks complex, but +it is not: it checks whether @code{arg} has a value that is not +@code{nil} and whether it is a cons cell. (That is what @code{consp} +does; it checks whether its argument is a cons cell.) If @code{arg} +has a value that is not @code{nil} (and is not a cons cell), which +will be the case if @code{beginning-of-buffer} is called with a +numeric argument, then this true-or-false-test will return true and +the then-part of the @code{if} expression will be evaluated. On the +other hand, if @code{beginning-of-buffer} is not called with an +argument, the value of @code{arg} will be @code{nil} and the else-part +of the @code{if} expression will be evaluated. The else-part is +simply @code{point-min}, and when this is the outcome, the whole +@code{goto-char} expression is @code{(goto-char (point-min))}, which +is how we saw the @code{beginning-of-buffer} function in its +simplified form. + +@node beginning-of-buffer opt arg, beginning-of-buffer complete, Optional Arguments, beginning-of-buffer +@subsection @code{beginning-of-buffer} with an Argument + +When @code{beginning-of-buffer} is called with an argument, an +expression is evaluated which calculates what value to pass to +@code{goto-char}. This expression is rather complicated at first sight. +It includes an inner @code{if} expression and much arithmetic. It looks +like this: + +@smallexample +@group +(if (> (buffer-size) 10000) + ;; @r{Avoid overflow for large buffer sizes!} + (* (prefix-numeric-value arg) + (/ size 10)) + (/ + (+ 10 + (* + size (prefix-numeric-value arg))) 10))) +@end group +@end smallexample + +@menu +* Disentangle beginning-of-buffer:: +* Large buffer case:: +* Small buffer case:: +@end menu + +@node Disentangle beginning-of-buffer, Large buffer case, beginning-of-buffer opt arg, beginning-of-buffer opt arg +@ifnottex +@unnumberedsubsubsec Disentangle @code{beginning-of-buffer} +@end ifnottex + +Like other complex-looking expressions, the conditional expression +within @code{beginning-of-buffer} can be disentangled by looking at it +as parts of a template, in this case, the template for an if-then-else +expression. In skeletal form, the expression looks like this: + +@smallexample +@group +(if (@var{buffer-is-large} + @var{divide-buffer-size-by-10-and-multiply-by-arg} + @var{else-use-alternate-calculation} +@end group +@end smallexample + +The true-or-false-test of this inner @code{if} expression checks the +size of the buffer. The reason for this is that the old version 18 +Emacs used numbers that are no bigger than eight million or so and in +the computation that followed, the programmer feared that Emacs might +try to use over-large numbers if the buffer were large. The term +`overflow', mentioned in the comment, means numbers that are over +large. More recent versions of Emacs use larger numbers, but this +code has not been touched, if only because people now look at buffers +that are far, far larger than ever before. + +There are two cases: if the buffer is large and if it is not. + +@node Large buffer case, Small buffer case, Disentangle beginning-of-buffer, beginning-of-buffer opt arg +@comment node-name, next, previous, up +@unnumberedsubsubsec What happens in a large buffer + +In @code{beginning-of-buffer}, the inner @code{if} expression tests +whether the size of the buffer is greater than 10,000 characters. To do +this, it uses the @code{>} function and the computation of @code{size} +that comes from the let expression. + +In the old days, the function @code{buffer-size} was used. Not only +was that function called several times, it gave the size of the whole +buffer, not the accessible part. The computation makes much more +sense when it handles just the accessible part. (@xref{Narrowing & +Widening, , Narrowing and Widening}, for more information on focusing +attention to an `accessible' part.) + +@need 800 +The line looks like this: + +@smallexample +(if (> size 10000) +@end smallexample + +@need 1200 +@noindent +When the buffer is large, the then-part of the @code{if} expression is +evaluated. It reads like this (after formatting for easy reading): + +@smallexample +@group +(* + (prefix-numeric-value arg) + (/ size 10)) +@end group +@end smallexample + +@noindent +This expression is a multiplication, with two arguments to the function +@code{*}. + +The first argument is @code{(prefix-numeric-value arg)}. When +@code{"P"} is used as the argument for @code{interactive}, the value +passed to the function as its argument is passed a ``raw prefix +argument'', and not a number. (It is a number in a list.) To perform +the arithmetic, a conversion is necessary, and +@code{prefix-numeric-value} does the job. + +@findex / @r{(division)} +@cindex Division +The second argument is @code{(/ size 10)}. This expression divides +the numeric value by ten --- the numeric value of the size of the +accessible portion of the buffer. This produces a number that tells +how many characters make up one tenth of the buffer size. (In Lisp, +@code{/} is used for division, just as @code{*} is used for +multiplication.) + +@need 1200 +In the multiplication expression as a whole, this amount is multiplied +by the value of the prefix argument---the multiplication looks like this: + +@smallexample +@group +(* @var{numeric-value-of-prefix-arg} + @var{number-of-characters-in-one-tenth-of-the-accessible-buffer}) +@end group +@end smallexample + +@noindent +If, for example, the prefix argument is @samp{7}, the one-tenth value +will be multiplied by 7 to give a position 70% of the way through. + +@need 1200 +The result of all this is that if the accessible portion of the buffer +is large, the @code{goto-char} expression reads like this: + +@smallexample +@group +(goto-char (* (prefix-numeric-value arg) + (/ size 10))) +@end group +@end smallexample + +This puts the cursor where we want it. + +@node Small buffer case, , Large buffer case, beginning-of-buffer opt arg +@comment node-name, next, previous, up +@unnumberedsubsubsec What happens in a small buffer + +If the buffer contains fewer than 10,000 characters, a slightly +different computation is performed. You might think this is not +necessary, since the first computation could do the job. However, in +a small buffer, the first method may not put the cursor on exactly the +desired line; the second method does a better job. + +@need 800 +The code looks like this: + +@c Keep this on one line. +@smallexample +(/ (+ 10 (* size (prefix-numeric-value arg))) 10)) +@end smallexample + +@need 1200 +@noindent +This is code in which you figure out what happens by discovering how the +functions are embedded in parentheses. It is easier to read if you +reformat it with each expression indented more deeply than its +enclosing expression: + +@smallexample +@group + (/ + (+ 10 + (* + size + (prefix-numeric-value arg))) + 10)) +@end group +@end smallexample + +@need 1200 +@noindent +Looking at parentheses, we see that the innermost operation is +@code{(prefix-numeric-value arg)}, which converts the raw argument to +a number. In the following expression, this number is multiplied by +the size of the accessible portion of the buffer: + +@smallexample +(* size (prefix-numeric-value arg)) +@end smallexample + +@noindent +This multiplication creates a number that may be larger than the size of +the buffer---seven times larger if the argument is 7, for example. Ten +is then added to this number and finally the large number is divided by +ten to provide a value that is one character larger than the percentage +position in the buffer. + +The number that results from all this is passed to @code{goto-char} and +the cursor is moved to that point. + +@need 1500 +@node beginning-of-buffer complete, , beginning-of-buffer opt arg, beginning-of-buffer +@comment node-name, next, previous, up +@subsection The Complete @code{beginning-of-buffer} + +@need 1000 +Here is the complete text of the @code{beginning-of-buffer} function: +@sp 1 + +@c In GNU Emacs 22 +@smallexample +@group +(defun beginning-of-buffer (&optional arg) + "Move point to the beginning of the buffer; +leave mark at previous position. +With \\[universal-argument] prefix, +do not set mark at previous position. +With numeric arg N, +put point N/10 of the way from the beginning. + +If the buffer is narrowed, +this command uses the beginning and size +of the accessible part of the buffer. +@end group + +@group +Don't use this command in Lisp programs! +\(goto-char (point-min)) is faster +and avoids clobbering the mark." + (interactive "P") + (or (consp arg) + (and transient-mark-mode mark-active) + (push-mark)) +@end group +@group + (let ((size (- (point-max) (point-min)))) + (goto-char (if (and arg (not (consp arg))) + (+ (point-min) + (if (> size 10000) + ;; Avoid overflow for large buffer sizes! + (* (prefix-numeric-value arg) + (/ size 10)) + (/ (+ 10 (* size (prefix-numeric-value arg))) 10))) + (point-min)))) + (if arg (forward-line 1))) +@end group +@end smallexample + +@ignore +From before GNU Emacs 22 +@smallexample +@group +(defun beginning-of-buffer (&optional arg) + "Move point to the beginning of the buffer; +leave mark at previous position. +With arg N, put point N/10 of the way +from the true beginning. +@end group +@group +Don't use this in Lisp programs! +\(goto-char (point-min)) is faster +and does not set the mark." + (interactive "P") + (push-mark) +@end group +@group + (goto-char + (if arg + (if (> (buffer-size) 10000) + ;; @r{Avoid overflow for large buffer sizes!} + (* (prefix-numeric-value arg) + (/ (buffer-size) 10)) +@end group +@group + (/ (+ 10 (* (buffer-size) + (prefix-numeric-value arg))) + 10)) + (point-min))) + (if arg (forward-line 1))) +@end group +@end smallexample +@end ignore + +@noindent +Except for two small points, the previous discussion shows how this +function works. The first point deals with a detail in the +documentation string, and the second point concerns the last line of +the function. + +@need 800 +In the documentation string, there is reference to an expression: + +@smallexample +\\[universal-argument] +@end smallexample + +@noindent +A @samp{\\} is used before the first square bracket of this +expression. This @samp{\\} tells the Lisp interpreter to substitute +whatever key is currently bound to the @samp{[@dots{}]}. In the case +of @code{universal-argument}, that is usually @kbd{C-u}, but it might +be different. (@xref{Documentation Tips, , Tips for Documentation +Strings, elisp, The GNU Emacs Lisp Reference Manual}, for more +information.) + +@need 1200 +Finally, the last line of the @code{beginning-of-buffer} command says +to move point to the beginning of the next line if the command is +invoked with an argument: + +@smallexample +(if arg (forward-line 1))) +@end smallexample + +@noindent +This puts the cursor at the beginning of the first line after the +appropriate tenths position in the buffer. This is a flourish that +means that the cursor is always located @emph{at least} the requested +tenths of the way through the buffer, which is a nicety that is, +perhaps, not necessary, but which, if it did not occur, would be sure +to draw complaints. + +On the other hand, it also means that if you specify the command with +a @kbd{C-u}, but without a number, that is to say, if the `raw prefix +argument' is simply a cons cell, then the command puts you at the +beginning of the second line @dots{} I don't know whether this is +intended or whether no one has dealt with the code to avoid this +happening. + +@node Second Buffer Related Review, optional Exercise, beginning-of-buffer, More Complex +@comment node-name, next, previous, up +@section Review + +Here is a brief summary of some of the topics covered in this chapter. + +@table @code +@item or +Evaluate each argument in sequence, and return the value of the first +argument that is not @code{nil}; if none return a value that is not +@code{nil}, return @code{nil}. In brief, return the first true value +of the arguments; return a true value if one @emph{or} any of the +others are true. + +@item and +Evaluate each argument in sequence, and if any are @code{nil}, return +@code{nil}; if none are @code{nil}, return the value of the last +argument. In brief, return a true value only if all the arguments are +true; return a true value if one @emph{and} each of the others is +true. + +@item &optional +A keyword used to indicate that an argument to a function definition +is optional; this means that the function can be evaluated without the +argument, if desired. + +@item prefix-numeric-value +Convert the `raw prefix argument' produced by @code{(interactive +"P")} to a numeric value. + +@item forward-line +Move point forward to the beginning of the next line, or if the argument +is greater than one, forward that many lines. If it can't move as far +forward as it is supposed to, @code{forward-line} goes forward as far as +it can and then returns a count of the number of additional lines it was +supposed to move but couldn't. + +@item erase-buffer +Delete the entire contents of the current buffer. + +@item bufferp +Return @code{t} if its argument is a buffer; otherwise return @code{nil}. +@end table + +@node optional Exercise, , Second Buffer Related Review, More Complex +@section @code{optional} Argument Exercise + +Write an interactive function with an optional argument that tests +whether its argument, a number, is greater than or equal to, or else, +less than the value of @code{fill-column}, and tells you which, in a +message. However, if you do not pass an argument to the function, use +56 as a default value. + +@node Narrowing & Widening, car cdr & cons, More Complex, Top +@comment node-name, next, previous, up +@chapter Narrowing and Widening +@cindex Focusing attention (narrowing) +@cindex Narrowing +@cindex Widening + +Narrowing is a feature of Emacs that makes it possible for you to focus +on a specific part of a buffer, and work without accidentally changing +other parts. Narrowing is normally disabled since it can confuse +novices. + +@menu +* Narrowing advantages:: The advantages of narrowing +* save-restriction:: The @code{save-restriction} special form. +* what-line:: The number of the line that point is on. +* narrow Exercise:: +@end menu + +@node Narrowing advantages, save-restriction, Narrowing & Widening, Narrowing & Widening +@ifnottex +@unnumberedsec The Advantages of Narrowing +@end ifnottex + +With narrowing, the rest of a buffer is made invisible, as if it weren't +there. This is an advantage if, for example, you want to replace a word +in one part of a buffer but not in another: you narrow to the part you want +and the replacement is carried out only in that section, not in the rest +of the buffer. Searches will only work within a narrowed region, not +outside of one, so if you are fixing a part of a document, you can keep +yourself from accidentally finding parts you do not need to fix by +narrowing just to the region you want. +(The key binding for @code{narrow-to-region} is @kbd{C-x n n}.) + +However, narrowing does make the rest of the buffer invisible, which +can scare people who inadvertently invoke narrowing and think they +have deleted a part of their file. Moreover, the @code{undo} command +(which is usually bound to @kbd{C-x u}) does not turn off narrowing +(nor should it), so people can become quite desperate if they do not +know that they can return the rest of a buffer to visibility with the +@code{widen} command. +(The key binding for @code{widen} is @kbd{C-x n w}.) + +Narrowing is just as useful to the Lisp interpreter as to a human. +Often, an Emacs Lisp function is designed to work on just part of a +buffer; or conversely, an Emacs Lisp function needs to work on all of a +buffer that has been narrowed. The @code{what-line} function, for +example, removes the narrowing from a buffer, if it has any narrowing +and when it has finished its job, restores the narrowing to what it was. +On the other hand, the @code{count-lines} function, which is called by +@code{what-line}, uses narrowing to restrict itself to just that portion +of the buffer in which it is interested and then restores the previous +situation. + +@node save-restriction, what-line, Narrowing advantages, Narrowing & Widening +@comment node-name, next, previous, up +@section The @code{save-restriction} Special Form +@findex save-restriction + +In Emacs Lisp, you can use the @code{save-restriction} special form to +keep track of whatever narrowing is in effect, if any. When the Lisp +interpreter meets with @code{save-restriction}, it executes the code +in the body of the @code{save-restriction} expression, and then undoes +any changes to narrowing that the code caused. If, for example, the +buffer is narrowed and the code that follows @code{save-restriction} +gets rid of the narrowing, @code{save-restriction} returns the buffer +to its narrowed region afterwards. In the @code{what-line} command, +any narrowing the buffer may have is undone by the @code{widen} +command that immediately follows the @code{save-restriction} command. +Any original narrowing is restored just before the completion of the +function. + +@need 1250 +The template for a @code{save-restriction} expression is simple: + +@smallexample +@group +(save-restriction + @var{body}@dots{} ) +@end group +@end smallexample + +@noindent +The body of the @code{save-restriction} is one or more expressions that +will be evaluated in sequence by the Lisp interpreter. + +Finally, a point to note: when you use both @code{save-excursion} and +@code{save-restriction}, one right after the other, you should use +@code{save-excursion} outermost. If you write them in reverse order, +you may fail to record narrowing in the buffer to which Emacs switches +after calling @code{save-excursion}. Thus, when written together, +@code{save-excursion} and @code{save-restriction} should be written +like this: + +@smallexample +@group +(save-excursion + (save-restriction + @var{body}@dots{})) +@end group +@end smallexample + +In other circumstances, when not written together, the +@code{save-excursion} and @code{save-restriction} special forms must +be written in the order appropriate to the function. + +@need 1250 +For example, + +@smallexample +@group + (save-restriction + (widen) + (save-excursion + @var{body}@dots{})) +@end group +@end smallexample + +@ignore +Emacs 22 +/usr/local/src/emacs/lisp/simple.el + +(defun what-line () + "Print the current buffer line number and narrowed line number of point." + (interactive) + (let ((start (point-min)) + (n (line-number-at-pos))) + (if (= start 1) + (message "Line %d" n) + (save-excursion + (save-restriction + (widen) + (message "line %d (narrowed line %d)" + (+ n (line-number-at-pos start) -1) n)))))) + +(defun line-number-at-pos (&optional pos) + "Return (narrowed) buffer line number at position POS. +If POS is nil, use current buffer location. +Counting starts at (point-min), so the value refers +to the contents of the accessible portion of the buffer." + (let ((opoint (or pos (point))) start) + (save-excursion + (goto-char (point-min)) + (setq start (point)) + (goto-char opoint) + (forward-line 0) + (1+ (count-lines start (point)))))) + +(defun count-lines (start end) + "Return number of lines between START and END. +This is usually the number of newlines between them, +but can be one more if START is not equal to END +and the greater of them is not at the start of a line." + (save-excursion + (save-restriction + (narrow-to-region start end) + (goto-char (point-min)) + (if (eq selective-display t) + (save-match-data + (let ((done 0)) + (while (re-search-forward "[\n\C-m]" nil t 40) + (setq done (+ 40 done))) + (while (re-search-forward "[\n\C-m]" nil t 1) + (setq done (+ 1 done))) + (goto-char (point-max)) + (if (and (/= start end) + (not (bolp))) + (1+ done) + done))) + (- (buffer-size) (forward-line (buffer-size))))))) +@end ignore + +@node what-line, narrow Exercise, save-restriction, Narrowing & Widening +@comment node-name, next, previous, up +@section @code{what-line} +@findex what-line +@cindex Widening, example of + +The @code{what-line} command tells you the number of the line in which +the cursor is located. The function illustrates the use of the +@code{save-restriction} and @code{save-excursion} commands. Here is the +original text of the function: + +@smallexample +@group +(defun what-line () + "Print the current line number (in the buffer) of point." + (interactive) + (save-restriction + (widen) + (save-excursion + (beginning-of-line) + (message "Line %d" + (1+ (count-lines 1 (point))))))) +@end group +@end smallexample + +(In recent versions of GNU Emacs, the @code{what-line} function has +been expanded to tell you your line number in a narrowed buffer as +well as your line number in a widened buffer. The recent version is +more complex than the version shown here. If you feel adventurous, +you might want to look at it after figuring out how this version +works. You will probably need to use @kbd{C-h f} +(@code{describe-function}). The newer version uses a conditional to +determine whether the buffer has been narrowed. + +(Also, it uses @code{line-number-at-pos}, which among other simple +expressions, such as @code{(goto-char (point-min))}, moves point to +the beginning of the current line with @code{(forward-line 0)} rather +than @code{beginning-of-line}.) + +The @code{what-line} function as shown here has a documentation line +and is interactive, as you would expect. The next two lines use the +functions @code{save-restriction} and @code{widen}. + +The @code{save-restriction} special form notes whatever narrowing is in +effect, if any, in the current buffer and restores that narrowing after +the code in the body of the @code{save-restriction} has been evaluated. + +The @code{save-restriction} special form is followed by @code{widen}. +This function undoes any narrowing the current buffer may have had +when @code{what-line} was called. (The narrowing that was there is +the narrowing that @code{save-restriction} remembers.) This widening +makes it possible for the line counting commands to count from the +beginning of the buffer. Otherwise, they would have been limited to +counting within the accessible region. Any original narrowing is +restored just before the completion of the function by the +@code{save-restriction} special form. + +The call to @code{widen} is followed by @code{save-excursion}, which +saves the location of the cursor (i.e., of point) and of the mark, and +restores them after the code in the body of the @code{save-excursion} +uses the @code{beginning-of-line} function to move point. + +(Note that the @code{(widen)} expression comes between the +@code{save-restriction} and @code{save-excursion} special forms. When +you write the two @code{save- @dots{}} expressions in sequence, write +@code{save-excursion} outermost.) + +@need 1200 +The last two lines of the @code{what-line} function are functions to +count the number of lines in the buffer and then print the number in the +echo area. + +@smallexample +@group +(message "Line %d" + (1+ (count-lines 1 (point))))))) +@end group +@end smallexample + +The @code{message} function prints a one-line message at the bottom of +the Emacs screen. The first argument is inside of quotation marks and +is printed as a string of characters. However, it may contain a +@samp{%d} expression to print a following argument. @samp{%d} prints +the argument as a decimal, so the message will say something such as +@samp{Line 243}. + +@need 1200 +The number that is printed in place of the @samp{%d} is computed by the +last line of the function: + +@smallexample +(1+ (count-lines 1 (point))) +@end smallexample + +@ignore +GNU Emacs 22 + +(defun count-lines (start end) + "Return number of lines between START and END. +This is usually the number of newlines between them, +but can be one more if START is not equal to END +and the greater of them is not at the start of a line." + (save-excursion + (save-restriction + (narrow-to-region start end) + (goto-char (point-min)) + (if (eq selective-display t) + (save-match-data + (let ((done 0)) + (while (re-search-forward "[\n\C-m]" nil t 40) + (setq done (+ 40 done))) + (while (re-search-forward "[\n\C-m]" nil t 1) + (setq done (+ 1 done))) + (goto-char (point-max)) + (if (and (/= start end) + (not (bolp))) + (1+ done) + done))) + (- (buffer-size) (forward-line (buffer-size))))))) +@end ignore + +@noindent +What this does is count the lines from the first position of the +buffer, indicated by the @code{1}, up to @code{(point)}, and then add +one to that number. (The @code{1+} function adds one to its +argument.) We add one to it because line 2 has only one line before +it, and @code{count-lines} counts only the lines @emph{before} the +current line. + +After @code{count-lines} has done its job, and the message has been +printed in the echo area, the @code{save-excursion} restores point and +mark to their original positions; and @code{save-restriction} restores +the original narrowing, if any. + +@node narrow Exercise, , what-line, Narrowing & Widening +@section Exercise with Narrowing + +Write a function that will display the first 60 characters of the +current buffer, even if you have narrowed the buffer to its latter +half so that the first line is inaccessible. Restore point, mark, and +narrowing. For this exercise, you need to use a whole potpourri of +functions, including @code{save-restriction}, @code{widen}, +@code{goto-char}, @code{point-min}, @code{message}, and +@code{buffer-substring}. + +@cindex Properties, mention of @code{buffer-substring-no-properties} +(@code{buffer-substring} is a previously unmentioned function you will +have to investigate yourself; or perhaps you will have to use +@code{buffer-substring-no-properties} or +@code{filter-buffer-substring} @dots{}, yet other functions. Text +properties are a feature otherwise not discussed here. @xref{Text +Properties, , Text Properties, elisp, The GNU Emacs Lisp Reference +Manual}.) + +Additionally, do you really need @code{goto-char} or @code{point-min}? +Or can you write the function without them? + +@node car cdr & cons, Cutting & Storing Text, Narrowing & Widening, Top +@comment node-name, next, previous, up +@chapter @code{car}, @code{cdr}, @code{cons}: Fundamental Functions +@findex car, @r{introduced} +@findex cdr, @r{introduced} + +In Lisp, @code{car}, @code{cdr}, and @code{cons} are fundamental +functions. The @code{cons} function is used to construct lists, and +the @code{car} and @code{cdr} functions are used to take them apart. + +In the walk through of the @code{copy-region-as-kill} function, we +will see @code{cons} as well as two variants on @code{cdr}, +namely, @code{setcdr} and @code{nthcdr}. (@xref{copy-region-as-kill}.) + +@menu +* Strange Names:: An historical aside: why the strange names? +* car & cdr:: Functions for extracting part of a list. +* cons:: Constructing a list. +* nthcdr:: Calling @code{cdr} repeatedly. +* nth:: +* setcar:: Changing the first element of a list. +* setcdr:: Changing the rest of a list. +* cons Exercise:: +@end menu + +@node Strange Names, car & cdr, car cdr & cons, car cdr & cons +@ifnottex +@unnumberedsec Strange Names +@end ifnottex + +The name of the @code{cons} function is not unreasonable: it is an +abbreviation of the word `construct'. The origins of the names for +@code{car} and @code{cdr}, on the other hand, are esoteric: @code{car} +is an acronym from the phrase `Contents of the Address part of the +Register'; and @code{cdr} (pronounced `could-er') is an acronym from +the phrase `Contents of the Decrement part of the Register'. These +phrases refer to specific pieces of hardware on the very early +computer on which the original Lisp was developed. Besides being +obsolete, the phrases have been completely irrelevant for more than 25 +years to anyone thinking about Lisp. Nonetheless, although a few +brave scholars have begun to use more reasonable names for these +functions, the old terms are still in use. In particular, since the +terms are used in the Emacs Lisp source code, we will use them in this +introduction. + +@node car & cdr, cons, Strange Names, car cdr & cons +@comment node-name, next, previous, up +@section @code{car} and @code{cdr} + +The @sc{car} of a list is, quite simply, the first item in the list. +Thus the @sc{car} of the list @code{(rose violet daisy buttercup)} is +@code{rose}. + +@need 1200 +If you are reading this in Info in GNU Emacs, you can see this by +evaluating the following: + +@smallexample +(car '(rose violet daisy buttercup)) +@end smallexample + +@noindent +After evaluating the expression, @code{rose} will appear in the echo +area. + +Clearly, a more reasonable name for the @code{car} function would be +@code{first} and this is often suggested. + +@code{car} does not remove the first item from the list; it only reports +what it is. After @code{car} has been applied to a list, the list is +still the same as it was. In the jargon, @code{car} is +`non-destructive'. This feature turns out to be important. + +The @sc{cdr} of a list is the rest of the list, that is, the +@code{cdr} function returns the part of the list that follows the +first item. Thus, while the @sc{car} of the list @code{'(rose violet +daisy buttercup)} is @code{rose}, the rest of the list, the value +returned by the @code{cdr} function, is @code{(violet daisy +buttercup)}. + +@need 800 +You can see this by evaluating the following in the usual way: + +@smallexample +(cdr '(rose violet daisy buttercup)) +@end smallexample + +@noindent +When you evaluate this, @code{(violet daisy buttercup)} will appear in +the echo area. + +Like @code{car}, @code{cdr} does not remove any elements from the +list---it just returns a report of what the second and subsequent +elements are. + +Incidentally, in the example, the list of flowers is quoted. If it were +not, the Lisp interpreter would try to evaluate the list by calling +@code{rose} as a function. In this example, we do not want to do that. + +Clearly, a more reasonable name for @code{cdr} would be @code{rest}. + +(There is a lesson here: when you name new functions, consider very +carefully what you are doing, since you may be stuck with the names +for far longer than you expect. The reason this document perpetuates +these names is that the Emacs Lisp source code uses them, and if I did +not use them, you would have a hard time reading the code; but do, +please, try to avoid using these terms yourself. The people who come +after you will be grateful to you.) + +When @code{car} and @code{cdr} are applied to a list made up of symbols, +such as the list @code{(pine fir oak maple)}, the element of the list +returned by the function @code{car} is the symbol @code{pine} without +any parentheses around it. @code{pine} is the first element in the +list. However, the @sc{cdr} of the list is a list itself, @code{(fir +oak maple)}, as you can see by evaluating the following expressions in +the usual way: + +@smallexample +@group +(car '(pine fir oak maple)) + +(cdr '(pine fir oak maple)) +@end group +@end smallexample + +On the other hand, in a list of lists, the first element is itself a +list. @code{car} returns this first element as a list. For example, +the following list contains three sub-lists, a list of carnivores, a +list of herbivores and a list of sea mammals: + +@smallexample +@group +(car '((lion tiger cheetah) + (gazelle antelope zebra) + (whale dolphin seal))) +@end group +@end smallexample + +@noindent +In this example, the first element or @sc{car} of the list is the list of +carnivores, @code{(lion tiger cheetah)}, and the rest of the list is +@code{((gazelle antelope zebra) (whale dolphin seal))}. + +@smallexample +@group +(cdr '((lion tiger cheetah) + (gazelle antelope zebra) + (whale dolphin seal))) +@end group +@end smallexample + +It is worth saying again that @code{car} and @code{cdr} are +non-destructive---that is, they do not modify or change lists to which +they are applied. This is very important for how they are used. + +Also, in the first chapter, in the discussion about atoms, I said that +in Lisp, ``certain kinds of atom, such as an array, can be separated +into parts; but the mechanism for doing this is different from the +mechanism for splitting a list. As far as Lisp is concerned, the +atoms of a list are unsplittable.'' (@xref{Lisp Atoms}.) The +@code{car} and @code{cdr} functions are used for splitting lists and +are considered fundamental to Lisp. Since they cannot split or gain +access to the parts of an array, an array is considered an atom. +Conversely, the other fundamental function, @code{cons}, can put +together or construct a list, but not an array. (Arrays are handled +by array-specific functions. @xref{Arrays, , Arrays, elisp, The GNU +Emacs Lisp Reference Manual}.) + +@node cons, nthcdr, car & cdr, car cdr & cons +@comment node-name, next, previous, up +@section @code{cons} +@findex cons, @r{introduced} + +The @code{cons} function constructs lists; it is the inverse of +@code{car} and @code{cdr}. For example, @code{cons} can be used to make +a four element list from the three element list, @code{(fir oak maple)}: + +@smallexample +(cons 'pine '(fir oak maple)) +@end smallexample + +@need 800 +@noindent +After evaluating this list, you will see + +@smallexample +(pine fir oak maple) +@end smallexample + +@noindent +appear in the echo area. @code{cons} causes the creation of a new +list in which the element is followed by the elements of the original +list. + +We often say that `@code{cons} puts a new element at the beginning of +a list; it attaches or pushes elements onto the list', but this +phrasing can be misleading, since @code{cons} does not change an +existing list, but creates a new one. + +Like @code{car} and @code{cdr}, @code{cons} is non-destructive. + +@menu +* Build a list:: +* length:: How to find the length of a list. +@end menu + +@node Build a list, length, cons, cons +@ifnottex +@unnumberedsubsec Build a list +@end ifnottex + +@code{cons} must have a list to attach to.@footnote{Actually, you can +@code{cons} an element to an atom to produce a dotted pair. Dotted +pairs are not discussed here; see @ref{Dotted Pair Notation, , Dotted +Pair Notation, elisp, The GNU Emacs Lisp Reference Manual}.} You +cannot start from absolutely nothing. If you are building a list, you +need to provide at least an empty list at the beginning. Here is a +series of @code{cons} expressions that build up a list of flowers. If +you are reading this in Info in GNU Emacs, you can evaluate each of +the expressions in the usual way; the value is printed in this text +after @samp{@result{}}, which you may read as `evaluates to'. + +@smallexample +@group +(cons 'buttercup ()) + @result{} (buttercup) +@end group + +@group +(cons 'daisy '(buttercup)) + @result{} (daisy buttercup) +@end group + +@group +(cons 'violet '(daisy buttercup)) + @result{} (violet daisy buttercup) +@end group + +@group +(cons 'rose '(violet daisy buttercup)) + @result{} (rose violet daisy buttercup) +@end group +@end smallexample + +@noindent +In the first example, the empty list is shown as @code{()} and a list +made up of @code{buttercup} followed by the empty list is constructed. +As you can see, the empty list is not shown in the list that was +constructed. All that you see is @code{(buttercup)}. The empty list is +not counted as an element of a list because there is nothing in an empty +list. Generally speaking, an empty list is invisible. + +The second example, @code{(cons 'daisy '(buttercup))} constructs a new, +two element list by putting @code{daisy} in front of @code{buttercup}; +and the third example constructs a three element list by putting +@code{violet} in front of @code{daisy} and @code{buttercup}. + +@node length, , Build a list, cons +@comment node-name, next, previous, up +@subsection Find the Length of a List: @code{length} +@findex length + +You can find out how many elements there are in a list by using the Lisp +function @code{length}, as in the following examples: + +@smallexample +@group +(length '(buttercup)) + @result{} 1 +@end group + +@group +(length '(daisy buttercup)) + @result{} 2 +@end group + +@group +(length (cons 'violet '(daisy buttercup))) + @result{} 3 +@end group +@end smallexample + +@noindent +In the third example, the @code{cons} function is used to construct a +three element list which is then passed to the @code{length} function as +its argument. + +@need 1200 +We can also use @code{length} to count the number of elements in an +empty list: + +@smallexample +@group +(length ()) + @result{} 0 +@end group +@end smallexample + +@noindent +As you would expect, the number of elements in an empty list is zero. + +An interesting experiment is to find out what happens if you try to find +the length of no list at all; that is, if you try to call @code{length} +without giving it an argument, not even an empty list: + +@smallexample +(length ) +@end smallexample + +@need 800 +@noindent +What you see, if you evaluate this, is the error message + +@smallexample +Lisp error: (wrong-number-of-arguments length 0) +@end smallexample + +@noindent +This means that the function receives the wrong number of +arguments, zero, when it expects some other number of arguments. In +this case, one argument is expected, the argument being a list whose +length the function is measuring. (Note that @emph{one} list is +@emph{one} argument, even if the list has many elements inside it.) + +The part of the error message that says @samp{length} is the name of +the function. + +@ignore +@code{length} is still a subroutine, but you need C-h f to discover that. + +In an earlier version: + This is written with a special notation, @samp{#<subr}, + that indicates that the function @code{length} is one of the primitive + functions written in C rather than in Emacs Lisp. (@samp{subr} is an + abbreviation for `subroutine'.) @xref{What Is a Function, , What Is a + Function?, elisp , The GNU Emacs Lisp Reference Manual}, for more + about subroutines. +@end ignore + +@node nthcdr, nth, cons, car cdr & cons +@comment node-name, next, previous, up +@section @code{nthcdr} +@findex nthcdr + +The @code{nthcdr} function is associated with the @code{cdr} function. +What it does is take the @sc{cdr} of a list repeatedly. + +If you take the @sc{cdr} of the list @code{(pine fir +oak maple)}, you will be returned the list @code{(fir oak maple)}. If you +repeat this on what was returned, you will be returned the list +@code{(oak maple)}. (Of course, repeated @sc{cdr}ing on the original +list will just give you the original @sc{cdr} since the function does +not change the list. You need to evaluate the @sc{cdr} of the +@sc{cdr} and so on.) If you continue this, eventually you will be +returned an empty list, which in this case, instead of being shown as +@code{()} is shown as @code{nil}. + +@need 1200 +For review, here is a series of repeated @sc{cdr}s, the text following +the @samp{@result{}} shows what is returned. + +@smallexample +@group +(cdr '(pine fir oak maple)) + @result{}(fir oak maple) +@end group + +@group +(cdr '(fir oak maple)) + @result{} (oak maple) +@end group + +@group +(cdr '(oak maple)) + @result{}(maple) +@end group + +@group +(cdr '(maple)) + @result{} nil +@end group + +@group +(cdr 'nil) + @result{} nil +@end group + +@group +(cdr ()) + @result{} nil +@end group +@end smallexample + +@need 1200 +You can also do several @sc{cdr}s without printing the values in +between, like this: + +@smallexample +@group +(cdr (cdr '(pine fir oak maple))) + @result{} (oak maple) +@end group +@end smallexample + +@noindent +In this example, the Lisp interpreter evaluates the innermost list first. +The innermost list is quoted, so it just passes the list as it is to the +innermost @code{cdr}. This @code{cdr} passes a list made up of the +second and subsequent elements of the list to the outermost @code{cdr}, +which produces a list composed of the third and subsequent elements of +the original list. In this example, the @code{cdr} function is repeated +and returns a list that consists of the original list without its +first two elements. + +The @code{nthcdr} function does the same as repeating the call to +@code{cdr}. In the following example, the argument 2 is passed to the +function @code{nthcdr}, along with the list, and the value returned is +the list without its first two items, which is exactly the same +as repeating @code{cdr} twice on the list: + +@smallexample +@group +(nthcdr 2 '(pine fir oak maple)) + @result{} (oak maple) +@end group +@end smallexample + +@need 1200 +Using the original four element list, we can see what happens when +various numeric arguments are passed to @code{nthcdr}, including 0, 1, +and 5: + +@smallexample +@group +;; @r{Leave the list as it was.} +(nthcdr 0 '(pine fir oak maple)) + @result{} (pine fir oak maple) +@end group + +@group +;; @r{Return a copy without the first element.} +(nthcdr 1 '(pine fir oak maple)) + @result{} (fir oak maple) +@end group + +@group +;; @r{Return a copy of the list without three elements.} +(nthcdr 3 '(pine fir oak maple)) + @result{} (maple) +@end group + +@group +;; @r{Return a copy lacking all four elements.} +(nthcdr 4 '(pine fir oak maple)) + @result{} nil +@end group + +@group +;; @r{Return a copy lacking all elements.} +(nthcdr 5 '(pine fir oak maple)) + @result{} nil +@end group +@end smallexample + +@node nth, setcar, nthcdr, car cdr & cons +@comment node-name, next, previous, up +@section @code{nth} +@findex nth + +The @code{nthcdr} function takes the @sc{cdr} of a list repeatedly. +The @code{nth} function takes the @sc{car} of the result returned by +@code{nthcdr}. It returns the Nth element of the list. + +@need 1500 +Thus, if it were not defined in C for speed, the definition of +@code{nth} would be: + +@smallexample +@group +(defun nth (n list) + "Returns the Nth element of LIST. +N counts from zero. If LIST is not that long, nil is returned." + (car (nthcdr n list))) +@end group +@end smallexample + +@noindent +(Originally, @code{nth} was defined in Emacs Lisp in @file{subr.el}, +but its definition was redone in C in the 1980s.) + +The @code{nth} function returns a single element of a list. +This can be very convenient. + +Note that the elements are numbered from zero, not one. That is to +say, the first element of a list, its @sc{car} is the zeroth element. +This is called `zero-based' counting and often bothers people who +are accustomed to the first element in a list being number one, which +is `one-based'. + +@need 1250 +For example: + +@smallexample +@group +(nth 0 '("one" "two" "three")) + @result{} "one" + +(nth 1 '("one" "two" "three")) + @result{} "two" +@end group +@end smallexample + +It is worth mentioning that @code{nth}, like @code{nthcdr} and +@code{cdr}, does not change the original list---the function is +non-destructive. This is in sharp contrast to the @code{setcar} and +@code{setcdr} functions. + +@node setcar, setcdr, nth, car cdr & cons +@comment node-name, next, previous, up +@section @code{setcar} +@findex setcar + +As you might guess from their names, the @code{setcar} and @code{setcdr} +functions set the @sc{car} or the @sc{cdr} of a list to a new value. +They actually change the original list, unlike @code{car} and @code{cdr} +which leave the original list as it was. One way to find out how this +works is to experiment. We will start with the @code{setcar} function. + +@need 1200 +First, we can make a list and then set the value of a variable to the +list, using the @code{setq} function. Here is a list of animals: + +@smallexample +(setq animals '(antelope giraffe lion tiger)) +@end smallexample + +@noindent +If you are reading this in Info inside of GNU Emacs, you can evaluate +this expression in the usual fashion, by positioning the cursor after +the expression and typing @kbd{C-x C-e}. (I'm doing this right here +as I write this. This is one of the advantages of having the +interpreter built into the computing environment. Incidentally, when +there is nothing on the line after the final parentheses, such as a +comment, point can be on the next line. Thus, if your cursor is in +the first column of the next line, you do not need to move it. +Indeed, Emacs permits any amount of white space after the final +parenthesis.) + +@need 1200 +When we evaluate the variable @code{animals}, we see that it is bound to +the list @code{(antelope giraffe lion tiger)}: + +@smallexample +@group +animals + @result{} (antelope giraffe lion tiger) +@end group +@end smallexample + +@noindent +Put another way, the variable @code{animals} points to the list +@code{(antelope giraffe lion tiger)}. + +Next, evaluate the function @code{setcar} while passing it two +arguments, the variable @code{animals} and the quoted symbol +@code{hippopotamus}; this is done by writing the three element list +@code{(setcar animals 'hippopotamus)} and then evaluating it in the +usual fashion: + +@smallexample +(setcar animals 'hippopotamus) +@end smallexample + +@need 1200 +@noindent +After evaluating this expression, evaluate the variable @code{animals} +again. You will see that the list of animals has changed: + +@smallexample +@group +animals + @result{} (hippopotamus giraffe lion tiger) +@end group +@end smallexample + +@noindent +The first element on the list, @code{antelope} is replaced by +@code{hippopotamus}. + +So we can see that @code{setcar} did not add a new element to the list +as @code{cons} would have; it replaced @code{antelope} with +@code{hippopotamus}; it @emph{changed} the list. + +@node setcdr, cons Exercise, setcar, car cdr & cons +@comment node-name, next, previous, up +@section @code{setcdr} +@findex setcdr + +The @code{setcdr} function is similar to the @code{setcar} function, +except that the function replaces the second and subsequent elements of +a list rather than the first element. + +(To see how to change the last element of a list, look ahead to +@ref{kill-new function, , The @code{kill-new} function}, which uses +the @code{nthcdr} and @code{setcdr} functions.) + +@need 1200 +To see how this works, set the value of the variable to a list of +domesticated animals by evaluating the following expression: + +@smallexample +(setq domesticated-animals '(horse cow sheep goat)) +@end smallexample + +@need 1200 +@noindent +If you now evaluate the list, you will be returned the list +@code{(horse cow sheep goat)}: + +@smallexample +@group +domesticated-animals + @result{} (horse cow sheep goat) +@end group +@end smallexample + +@need 1200 +Next, evaluate @code{setcdr} with two arguments, the name of the +variable which has a list as its value, and the list to which the +@sc{cdr} of the first list will be set; + +@smallexample +(setcdr domesticated-animals '(cat dog)) +@end smallexample + +@noindent +If you evaluate this expression, the list @code{(cat dog)} will appear +in the echo area. This is the value returned by the function. The +result we are interested in is the ``side effect'', which we can see by +evaluating the variable @code{domesticated-animals}: + +@smallexample +@group +domesticated-animals + @result{} (horse cat dog) +@end group +@end smallexample + +@noindent +Indeed, the list is changed from @code{(horse cow sheep goat)} to +@code{(horse cat dog)}. The @sc{cdr} of the list is changed from +@code{(cow sheep goat)} to @code{(cat dog)}. + +@node cons Exercise, , setcdr, car cdr & cons +@section Exercise + +Construct a list of four birds by evaluating several expressions with +@code{cons}. Find out what happens when you @code{cons} a list onto +itself. Replace the first element of the list of four birds with a +fish. Replace the rest of that list with a list of other fish. + +@node Cutting & Storing Text, List Implementation, car cdr & cons, Top +@comment node-name, next, previous, up +@chapter Cutting and Storing Text +@cindex Cutting and storing text +@cindex Storing and cutting text +@cindex Killing text +@cindex Clipping text +@cindex Erasing text +@cindex Deleting text + +Whenever you cut or clip text out of a buffer with a `kill' command in +GNU Emacs, it is stored in a list and you can bring it back with a +`yank' command. + +(The use of the word `kill' in Emacs for processes which specifically +@emph{do not} destroy the values of the entities is an unfortunate +historical accident. A much more appropriate word would be `clip' since +that is what the kill commands do; they clip text out of a buffer and +put it into storage from which it can be brought back. I have often +been tempted to replace globally all occurrences of `kill' in the Emacs +sources with `clip' and all occurrences of `killed' with `clipped'.) + +@menu +* Storing Text:: Text is stored in a list. +* zap-to-char:: Cutting out text up to a character. +* kill-region:: Cutting text out of a region. +* copy-region-as-kill:: A definition for copying text. +* Digression into C:: Minor note on C programming language macros. +* defvar:: How to give a variable an initial value. +* cons & search-fwd Review:: +* search Exercises:: +@end menu + +@node Storing Text, zap-to-char, Cutting & Storing Text, Cutting & Storing Text +@ifnottex +@unnumberedsec Storing Text in a List +@end ifnottex + +When text is cut out of a buffer, it is stored on a list. Successive +pieces of text are stored on the list successively, so the list might +look like this: + +@smallexample +("a piece of text" "previous piece") +@end smallexample + +@need 1200 +@noindent +The function @code{cons} can be used to create a new list from a piece +of text (an `atom', to use the jargon) and an existing list, like +this: + +@smallexample +@group +(cons "another piece" + '("a piece of text" "previous piece")) +@end group +@end smallexample + +@need 1200 +@noindent +If you evaluate this expression, a list of three elements will appear in +the echo area: + +@smallexample +("another piece" "a piece of text" "previous piece") +@end smallexample + +With the @code{car} and @code{nthcdr} functions, you can retrieve +whichever piece of text you want. For example, in the following code, +@code{nthcdr 1 @dots{}} returns the list with the first item removed; +and the @code{car} returns the first element of that remainder---the +second element of the original list: + +@smallexample +@group +(car (nthcdr 1 '("another piece" + "a piece of text" + "previous piece"))) + @result{} "a piece of text" +@end group +@end smallexample + +The actual functions in Emacs are more complex than this, of course. +The code for cutting and retrieving text has to be written so that +Emacs can figure out which element in the list you want---the first, +second, third, or whatever. In addition, when you get to the end of +the list, Emacs should give you the first element of the list, rather +than nothing at all. + +The list that holds the pieces of text is called the @dfn{kill ring}. +This chapter leads up to a description of the kill ring and how it is +used by first tracing how the @code{zap-to-char} function works. This +function uses (or `calls') a function that invokes a function that +manipulates the kill ring. Thus, before reaching the mountains, we +climb the foothills. + +A subsequent chapter describes how text that is cut from the buffer is +retrieved. @xref{Yanking, , Yanking Text Back}. + +@node zap-to-char, kill-region, Storing Text, Cutting & Storing Text +@comment node-name, next, previous, up +@section @code{zap-to-char} +@findex zap-to-char + +The @code{zap-to-char} function changed little between GNU Emacs +version 19 and GNU Emacs version 22. However, @code{zap-to-char} +calls another function, @code{kill-region}, which enjoyed a major +rewrite. + +The @code{kill-region} function in Emacs 19 is complex, but does not +use code that is important at this time. We will skip it. + +The @code{kill-region} function in Emacs 22 is easier to read than the +same function in Emacs 19 and introduces a very important concept, +that of error handling. We will walk through the function. + +But first, let us look at the interactive @code{zap-to-char} function. + +@menu +* Complete zap-to-char:: The complete implementation. +* zap-to-char interactive:: A three part interactive expression. +* zap-to-char body:: A short overview. +* search-forward:: How to search for a string. +* progn:: The @code{progn} special form. +* Summing up zap-to-char:: Using @code{point} and @code{search-forward}. +@end menu + +@node Complete zap-to-char, zap-to-char interactive, zap-to-char, zap-to-char +@ifnottex +@unnumberedsubsec The Complete @code{zap-to-char} Implementation +@end ifnottex + +The @code{zap-to-char} function removes the text in the region between +the location of the cursor (i.e., of point) up to and including the +next occurrence of a specified character. The text that +@code{zap-to-char} removes is put in the kill ring; and it can be +retrieved from the kill ring by typing @kbd{C-y} (@code{yank}). If +the command is given an argument, it removes text through that number +of occurrences. Thus, if the cursor were at the beginning of this +sentence and the character were @samp{s}, @samp{Thus} would be +removed. If the argument were two, @samp{Thus, if the curs} would be +removed, up to and including the @samp{s} in @samp{cursor}. + +If the specified character is not found, @code{zap-to-char} will say +``Search failed'', tell you the character you typed, and not remove +any text. + +In order to determine how much text to remove, @code{zap-to-char} uses +a search function. Searches are used extensively in code that +manipulates text, and we will focus attention on them as well as on the +deletion command. + +@ignore +@c GNU Emacs version 19 +(defun zap-to-char (arg char) ; version 19 implementation + "Kill up to and including ARG'th occurrence of CHAR. +Goes backward if ARG is negative; error if CHAR not found." + (interactive "*p\ncZap to char: ") + (kill-region (point) + (progn + (search-forward + (char-to-string char) nil nil arg) + (point)))) +@end ignore + +@need 1250 +Here is the complete text of the version 22 implementation of the function: + +@c GNU Emacs 22 +@smallexample +@group +(defun zap-to-char (arg char) + "Kill up to and including ARG'th occurrence of CHAR. +Case is ignored if `case-fold-search' is non-nil in the current buffer. +Goes backward if ARG is negative; error if CHAR not found." + (interactive "p\ncZap to char: ") + (if (char-table-p translation-table-for-input) + (setq char (or (aref translation-table-for-input char) char))) + (kill-region (point) (progn + (search-forward (char-to-string char) nil nil arg) + (point)))) +@end group +@end smallexample + +The documentation is thorough. You do need to know the jargon meaning +of the word `kill'. + +@node zap-to-char interactive, zap-to-char body, Complete zap-to-char, zap-to-char +@comment node-name, next, previous, up +@subsection The @code{interactive} Expression + +@need 800 +The interactive expression in the @code{zap-to-char} command looks like +this: + +@smallexample +(interactive "p\ncZap to char: ") +@end smallexample + +The part within quotation marks, @code{"p\ncZap to char:@: "}, specifies +two different things. First, and most simply, is the @samp{p}. +This part is separated from the next part by a newline, @samp{\n}. +The @samp{p} means that the first argument to the function will be +passed the value of a `processed prefix'. The prefix argument is +passed by typing @kbd{C-u} and a number, or @kbd{M-} and a number. If +the function is called interactively without a prefix, 1 is passed to +this argument. + +The second part of @code{"p\ncZap to char:@: "} is +@samp{cZap to char:@: }. In this part, the lower case @samp{c} +indicates that @code{interactive} expects a prompt and that the +argument will be a character. The prompt follows the @samp{c} and is +the string @samp{Zap to char:@: } (with a space after the colon to +make it look good). + +What all this does is prepare the arguments to @code{zap-to-char} so they +are of the right type, and give the user a prompt. + +In a read-only buffer, the @code{zap-to-char} function copies the text +to the kill ring, but does not remove it. The echo area displays a +message saying that the buffer is read-only. Also, the terminal may +beep or blink at you. + +@node zap-to-char body, search-forward, zap-to-char interactive, zap-to-char +@comment node-name, next, previous, up +@subsection The Body of @code{zap-to-char} + +The body of the @code{zap-to-char} function contains the code that +kills (that is, removes) the text in the region from the current +position of the cursor up to and including the specified character. + +The first part of the code looks like this: + +@smallexample +(if (char-table-p translation-table-for-input) + (setq char (or (aref translation-table-for-input char) char))) +(kill-region (point) (progn + (search-forward (char-to-string char) nil nil arg) + (point))) +@end smallexample + +@noindent +@code{char-table-p} is an hitherto unseen function. It determines +whether its argument is a character table. When it is, it sets the +character passed to @code{zap-to-char} to one of them, if that +character exists, or to the character itself. (This becomes important +for certain characters in non-European languages. The @code{aref} +function extracts an element from an array. It is an array-specific +function that is not described in this document. @xref{Arrays, , +Arrays, elisp, The GNU Emacs Lisp Reference Manual}.) + +@noindent +@code{(point)} is the current position of the cursor. + +The next part of the code is an expression using @code{progn}. The body +of the @code{progn} consists of calls to @code{search-forward} and +@code{point}. + +It is easier to understand how @code{progn} works after learning about +@code{search-forward}, so we will look at @code{search-forward} and +then at @code{progn}. + +@node search-forward, progn, zap-to-char body, zap-to-char +@comment node-name, next, previous, up +@subsection The @code{search-forward} Function +@findex search-forward + +The @code{search-forward} function is used to locate the +zapped-for-character in @code{zap-to-char}. If the search is +successful, @code{search-forward} leaves point immediately after the +last character in the target string. (In @code{zap-to-char}, the +target string is just one character long. @code{zap-to-char} uses the +function @code{char-to-string} to ensure that the computer treats that +character as a string.) If the search is backwards, +@code{search-forward} leaves point just before the first character in +the target. Also, @code{search-forward} returns @code{t} for true. +(Moving point is therefore a `side effect'.) + +@need 1250 +In @code{zap-to-char}, the @code{search-forward} function looks like this: + +@smallexample +(search-forward (char-to-string char) nil nil arg) +@end smallexample + +The @code{search-forward} function takes four arguments: + +@enumerate +@item +The first argument is the target, what is searched for. This must be a +string, such as @samp{"z"}. + +As it happens, the argument passed to @code{zap-to-char} is a single +character. Because of the way computers are built, the Lisp +interpreter may treat a single character as being different from a +string of characters. Inside the computer, a single character has a +different electronic format than a string of one character. (A single +character can often be recorded in the computer using exactly one +byte; but a string may be longer, and the computer needs to be ready +for this.) Since the @code{search-forward} function searches for a +string, the character that the @code{zap-to-char} function receives as +its argument must be converted inside the computer from one format to +the other; otherwise the @code{search-forward} function will fail. +The @code{char-to-string} function is used to make this conversion. + +@item +The second argument bounds the search; it is specified as a position in +the buffer. In this case, the search can go to the end of the buffer, +so no bound is set and the second argument is @code{nil}. + +@item +The third argument tells the function what it should do if the search +fails---it can signal an error (and print a message) or it can return +@code{nil}. A @code{nil} as the third argument causes the function to +signal an error when the search fails. + +@item +The fourth argument to @code{search-forward} is the repeat count---how +many occurrences of the string to look for. This argument is optional +and if the function is called without a repeat count, this argument is +passed the value 1. If this argument is negative, the search goes +backwards. +@end enumerate + +@need 800 +In template form, a @code{search-forward} expression looks like this: + +@smallexample +@group +(search-forward "@var{target-string}" + @var{limit-of-search} + @var{what-to-do-if-search-fails} + @var{repeat-count}) +@end group +@end smallexample + +We will look at @code{progn} next. + +@node progn, Summing up zap-to-char, search-forward, zap-to-char +@comment node-name, next, previous, up +@subsection The @code{progn} Special Form +@findex progn + +@code{progn} is a special form that causes each of its arguments to be +evaluated in sequence and then returns the value of the last one. The +preceding expressions are evaluated only for the side effects they +perform. The values produced by them are discarded. + +@need 800 +The template for a @code{progn} expression is very simple: + +@smallexample +@group +(progn + @var{body}@dots{}) +@end group +@end smallexample + +In @code{zap-to-char}, the @code{progn} expression has to do two things: +put point in exactly the right position; and return the location of +point so that @code{kill-region} will know how far to kill to. + +The first argument to the @code{progn} is @code{search-forward}. When +@code{search-forward} finds the string, the function leaves point +immediately after the last character in the target string. (In this +case the target string is just one character long.) If the search is +backwards, @code{search-forward} leaves point just before the first +character in the target. The movement of point is a side effect. + +The second and last argument to @code{progn} is the expression +@code{(point)}. This expression returns the value of point, which in +this case will be the location to which it has been moved by +@code{search-forward}. (In the source, a line that tells the function +to go to the previous character, if it is going forward, was commented +out in 1999; I don't remember whether that feature or mis-feature was +ever a part of the distributed source.) The value of @code{point} is +returned by the @code{progn} expression and is passed to +@code{kill-region} as @code{kill-region}'s second argument. + +@node Summing up zap-to-char, , progn, zap-to-char +@comment node-name, next, previous, up +@subsection Summing up @code{zap-to-char} + +Now that we have seen how @code{search-forward} and @code{progn} work, +we can see how the @code{zap-to-char} function works as a whole. + +The first argument to @code{kill-region} is the position of the cursor +when the @code{zap-to-char} command is given---the value of point at +that time. Within the @code{progn}, the search function then moves +point to just after the zapped-to-character and @code{point} returns the +value of this location. The @code{kill-region} function puts together +these two values of point, the first one as the beginning of the region +and the second one as the end of the region, and removes the region. + +The @code{progn} special form is necessary because the +@code{kill-region} command takes two arguments; and it would fail if +@code{search-forward} and @code{point} expressions were written in +sequence as two additional arguments. The @code{progn} expression is +a single argument to @code{kill-region} and returns the one value that +@code{kill-region} needs for its second argument. + +@node kill-region, copy-region-as-kill, zap-to-char, Cutting & Storing Text +@comment node-name, next, previous, up +@section @code{kill-region} +@findex kill-region + +The @code{zap-to-char} function uses the @code{kill-region} function. +This function clips text from a region and copies that text to +the kill ring, from which it may be retrieved. + +@ignore +GNU Emacs 22: + +(defun kill-region (beg end &optional yank-handler) + "Kill (\"cut\") text between point and mark. +This deletes the text from the buffer and saves it in the kill ring. +The command \\[yank] can retrieve it from there. +\(If you want to kill and then yank immediately, use \\[kill-ring-save].) + +If you want to append the killed region to the last killed text, +use \\[append-next-kill] before \\[kill-region]. + +If the buffer is read-only, Emacs will beep and refrain from deleting +the text, but put the text in the kill ring anyway. This means that +you can use the killing commands to copy text from a read-only buffer. + +This is the primitive for programs to kill text (as opposed to deleting it). +Supply two arguments, character positions indicating the stretch of text + to be killed. +Any command that calls this function is a \"kill command\". +If the previous command was also a kill command, +the text killed this time appends to the text killed last time +to make one entry in the kill ring. + +In Lisp code, optional third arg YANK-HANDLER, if non-nil, +specifies the yank-handler text property to be set on the killed +text. See `insert-for-yank'." + ;; Pass point first, then mark, because the order matters + ;; when calling kill-append. + (interactive (list (point) (mark))) + (unless (and beg end) + (error "The mark is not set now, so there is no region")) + (condition-case nil + (let ((string (filter-buffer-substring beg end t))) + (when string ;STRING is nil if BEG = END + ;; Add that string to the kill ring, one way or another. + (if (eq last-command 'kill-region) + (kill-append string (< end beg) yank-handler) + (kill-new string nil yank-handler))) + (when (or string (eq last-command 'kill-region)) + (setq this-command 'kill-region)) + nil) + ((buffer-read-only text-read-only) + ;; The code above failed because the buffer, or some of the characters + ;; in the region, are read-only. + ;; We should beep, in case the user just isn't aware of this. + ;; However, there's no harm in putting + ;; the region's text in the kill ring, anyway. + (copy-region-as-kill beg end) + ;; Set this-command now, so it will be set even if we get an error. + (setq this-command 'kill-region) + ;; This should barf, if appropriate, and give us the correct error. + (if kill-read-only-ok + (progn (message "Read only text copied to kill ring") nil) + ;; Signal an error if the buffer is read-only. + (barf-if-buffer-read-only) + ;; If the buffer isn't read-only, the text is. + (signal 'text-read-only (list (current-buffer))))))) +@end ignore + +The Emacs 22 version of that function uses @code{condition-case} and +@code{copy-region-as-kill}, both of which we will explain. +@code{condition-case} is an important special form. + +In essence, the @code{kill-region} function calls +@code{condition-case}, which takes three arguments. In this function, +the first argument does nothing. The second argument contains the +code that does the work when all goes well. The third argument +contains the code that is called in the event of an error. + +@menu +* Complete kill-region:: The function definition. +* condition-case:: Dealing with a problem. +* Lisp macro:: +@end menu + +@node Complete kill-region, condition-case, kill-region, kill-region +@ifnottex +@unnumberedsubsec The Complete @code{kill-region} Definition +@end ifnottex + +@need 1200 +We will go through the @code{condition-case} code in a moment. First, +let us look at the definition of @code{kill-region}, with comments +added: + +@c GNU Emacs 22: +@smallexample +@group +(defun kill-region (beg end) + "Kill (\"cut\") text between point and mark. +This deletes the text from the buffer and saves it in the kill ring. +The command \\[yank] can retrieve it from there. @dots{} " +@end group + +@group + ;; @bullet{} Since order matters, pass point first. + (interactive (list (point) (mark))) + ;; @bullet{} And tell us if we cannot cut the text. + ;; `unless' is an `if' without a then-part. + (unless (and beg end) + (error "The mark is not set now, so there is no region")) +@end group + +@group + ;; @bullet{} `condition-case' takes three arguments. + ;; If the first argument is nil, as it is here, + ;; information about the error signal is not + ;; stored for use by another function. + (condition-case nil +@end group + +@group + ;; @bullet{} The second argument to `condition-case' tells the + ;; Lisp interpreter what to do when all goes well. +@end group + +@group + ;; It starts with a `let' function that extracts the string + ;; and tests whether it exists. If so (that is what the + ;; `when' checks), it calls an `if' function that determines + ;; whether the previous command was another call to + ;; `kill-region'; if it was, then the new text is appended to + ;; the previous text; if not, then a different function, + ;; `kill-new', is called. +@end group + +@group + ;; The `kill-append' function concatenates the new string and + ;; the old. The `kill-new' function inserts text into a new + ;; item in the kill ring. +@end group + +@group + ;; `when' is an `if' without an else-part. The second `when' + ;; again checks whether the current string exists; in + ;; addition, it checks whether the previous command was + ;; another call to `kill-region'. If one or the other + ;; condition is true, then it sets the current command to + ;; be `kill-region'. +@end group +@group + (let ((string (filter-buffer-substring beg end t))) + (when string ;STRING is nil if BEG = END + ;; Add that string to the kill ring, one way or another. + (if (eq last-command 'kill-region) +@end group +@group + ;; @minus{} `yank-handler' is an optional argument to + ;; `kill-region' that tells the `kill-append' and + ;; `kill-new' functions how deal with properties + ;; added to the text, such as `bold' or `italics'. + (kill-append string (< end beg) yank-handler) + (kill-new string nil yank-handler))) + (when (or string (eq last-command 'kill-region)) + (setq this-command 'kill-region)) + nil) +@end group + +@group + ;; @bullet{} The third argument to `condition-case' tells the interpreter + ;; what to do with an error. +@end group +@group + ;; The third argument has a conditions part and a body part. + ;; If the conditions are met (in this case, + ;; if text or buffer are read-only) + ;; then the body is executed. +@end group +@group + ;; The first part of the third argument is the following: + ((buffer-read-only text-read-only) ;; the if-part + ;; @dots{} the then-part + (copy-region-as-kill beg end) +@end group +@group + ;; Next, also as part of the then-part, set this-command, so + ;; it will be set in an error + (setq this-command 'kill-region) + ;; Finally, in the then-part, send a message if you may copy + ;; the text to the kill ring without signally an error, but + ;; don't if you may not. +@end group +@group + (if kill-read-only-ok + (progn (message "Read only text copied to kill ring") nil) + (barf-if-buffer-read-only) + ;; If the buffer isn't read-only, the text is. + (signal 'text-read-only (list (current-buffer))))) +@end group +@end smallexample + +@ignore +@c v 21 +@smallexample +@group +(defun kill-region (beg end) + "Kill between point and mark. +The text is deleted but saved in the kill ring." + (interactive "r") +@end group + +@group + ;; 1. `condition-case' takes three arguments. + ;; If the first argument is nil, as it is here, + ;; information about the error signal is not + ;; stored for use by another function. + (condition-case nil +@end group + +@group + ;; 2. The second argument to `condition-case' + ;; tells the Lisp interpreter what to do when all goes well. +@end group + +@group + ;; The `delete-and-extract-region' function usually does the + ;; work. If the beginning and ending of the region are both + ;; the same, then the variable `string' will be empty, or nil + (let ((string (delete-and-extract-region beg end))) +@end group + +@group + ;; `when' is an `if' clause that cannot take an `else-part'. + ;; Emacs normally sets the value of `last-command' to the + ;; previous command. +@end group +@group + ;; `kill-append' concatenates the new string and the old. + ;; `kill-new' inserts text into a new item in the kill ring. + (when string + (if (eq last-command 'kill-region) + ;; if true, prepend string + (kill-append string (< end beg)) + (kill-new string))) + (setq this-command 'kill-region)) +@end group + +@group + ;; 3. The third argument to `condition-case' tells the interpreter + ;; what to do with an error. +@end group +@group + ;; The third argument has a conditions part and a body part. + ;; If the conditions are met (in this case, + ;; if text or buffer are read-only) + ;; then the body is executed. +@end group +@group + ((buffer-read-only text-read-only) ;; this is the if-part + ;; then... + (copy-region-as-kill beg end) +@end group +@group + (if kill-read-only-ok ;; usually this variable is nil + (message "Read only text copied to kill ring") + ;; or else, signal an error if the buffer is read-only; + (barf-if-buffer-read-only) + ;; and, in any case, signal that the text is read-only. + (signal 'text-read-only (list (current-buffer))))))) +@end group +@end smallexample +@end ignore + +@node condition-case, Lisp macro, Complete kill-region, kill-region +@comment node-name, next, previous, up +@subsection @code{condition-case} +@findex condition-case + +As we have seen earlier (@pxref{Making Errors, , Generate an Error +Message}), when the Emacs Lisp interpreter has trouble evaluating an +expression, it provides you with help; in the jargon, this is called +``signaling an error''. Usually, the computer stops the program and +shows you a message. + +However, some programs undertake complicated actions. They should not +simply stop on an error. In the @code{kill-region} function, the most +likely error is that you will try to kill text that is read-only and +cannot be removed. So the @code{kill-region} function contains code +to handle this circumstance. This code, which makes up the body of +the @code{kill-region} function, is inside of a @code{condition-case} +special form. + +@need 800 +The template for @code{condition-case} looks like this: + +@smallexample +@group +(condition-case + @var{var} + @var{bodyform} + @var{error-handler}@dots{}) +@end group +@end smallexample + +The second argument, @var{bodyform}, is straightforward. The +@code{condition-case} special form causes the Lisp interpreter to +evaluate the code in @var{bodyform}. If no error occurs, the special +form returns the code's value and produces the side-effects, if any. + +In short, the @var{bodyform} part of a @code{condition-case} +expression determines what should happen when everything works +correctly. + +However, if an error occurs, among its other actions, the function +generating the error signal will define one or more error condition +names. + +An error handler is the third argument to @code{condition case}. +An error handler has two parts, a @var{condition-name} and a +@var{body}. If the @var{condition-name} part of an error handler +matches a condition name generated by an error, then the @var{body} +part of the error handler is run. + +As you will expect, the @var{condition-name} part of an error handler +may be either a single condition name or a list of condition names. + +Also, a complete @code{condition-case} expression may contain more +than one error handler. When an error occurs, the first applicable +handler is run. + +Lastly, the first argument to the @code{condition-case} expression, +the @var{var} argument, is sometimes bound to a variable that +contains information about the error. However, if that argument is +nil, as is the case in @code{kill-region}, that information is +discarded. + +@need 1200 +In brief, in the @code{kill-region} function, the code +@code{condition-case} works like this: + +@smallexample +@group +@var{If no errors}, @var{run only this code} + @var{but}, @var{if errors}, @var{run this other code}. +@end group +@end smallexample + +@ignore +2006 Oct 24 +In Emacs 22, +copy-region-as-kill is short, 12 lines, and uses +filter-buffer-substring, which is longer, 39 lines +and has delete-and-extract-region in it. +delete-and-extract-region is written in C. + +see Initializing a Variable with @code{defvar} +this is line 8054 +Initializing a Variable with @code{defvar} includes line 8350 +@end ignore + +@node Lisp macro, , condition-case, kill-region +@comment node-name, next, previous, up +@subsection Lisp macro +@cindex Macro, lisp +@cindex Lisp macro + +The part of the @code{condition-case} expression that is evaluated in +the expectation that all goes well has a @code{when}. The code uses +@code{when} to determine whether the @code{string} variable points to +text that exists. + +A @code{when} expression is simply a programmers' convenience. It is +an @code{if} without the possibility of an else clause. In your mind, +you can replace @code{when} with @code{if} and understand what goes +on. That is what the Lisp interpreter does. + +Technically speaking, @code{when} is a Lisp macro. A Lisp @dfn{macro} +enables you to define new control constructs and other language +features. It tells the interpreter how to compute another Lisp +expression which will in turn compute the value. In this case, the +`other expression' is an @code{if} expression. + +The @code{kill-region} function definition also has an @code{unless} +macro; it is the converse of @code{when}. The @code{unless} macro is +an @code{if} without a then clause + +For more about Lisp macros, see @ref{Macros, , Macros, elisp, The GNU +Emacs Lisp Reference Manual}. The C programming language also +provides macros. These are different, but also useful. + +@ignore +We will briefly look at C macros in +@ref{Digression into C}. +@end ignore + +@need 1200 +Regarding the @code{when} macro, in the @code{condition-case} +expression, when the string has content, then another conditional +expression is executed. This is an @code{if} with both a then-part +and an else-part. + +@smallexample +@group +(if (eq last-command 'kill-region) + (kill-append string (< end beg) yank-handler) + (kill-new string nil yank-handler)) +@end group +@end smallexample + +The then-part is evaluated if the previous command was another call to +@code{kill-region}; if not, the else-part is evaluated. + +@code{yank-handler} is an optional argument to @code{kill-region} that +tells the @code{kill-append} and @code{kill-new} functions how deal +with properties added to the text, such as `bold' or `italics'. + +@code{last-command} is a variable that comes with Emacs that we have +not seen before. Normally, whenever a function is executed, Emacs +sets the value of @code{last-command} to the previous command. + +@need 1200 +In this segment of the definition, the @code{if} expression checks +whether the previous command was @code{kill-region}. If it was, + +@smallexample +(kill-append string (< end beg) yank-handler) +@end smallexample + +@noindent +concatenates a copy of the newly clipped text to the just previously +clipped text in the kill ring. + +@node copy-region-as-kill, Digression into C, kill-region, Cutting & Storing Text +@comment node-name, next, previous, up +@section @code{copy-region-as-kill} +@findex copy-region-as-kill +@findex nthcdr + +The @code{copy-region-as-kill} function copies a region of text from a +buffer and (via either @code{kill-append} or @code{kill-new}) saves it +in the @code{kill-ring}. + +If you call @code{copy-region-as-kill} immediately after a +@code{kill-region} command, Emacs appends the newly copied text to the +previously copied text. This means that if you yank back the text, you +get it all, from both this and the previous operation. On the other +hand, if some other command precedes the @code{copy-region-as-kill}, +the function copies the text into a separate entry in the kill ring. + +@menu +* Complete copy-region-as-kill:: The complete function definition. +* copy-region-as-kill body:: The body of @code{copy-region-as-kill}. +@end menu + +@node Complete copy-region-as-kill, copy-region-as-kill body, copy-region-as-kill, copy-region-as-kill +@ifnottex +@unnumberedsubsec The complete @code{copy-region-as-kill} function definition +@end ifnottex + +@need 1200 +Here is the complete text of the version 22 @code{copy-region-as-kill} +function: + +@smallexample +@group +(defun copy-region-as-kill (beg end) + "Save the region as if killed, but don't kill it. +In Transient Mark mode, deactivate the mark. +If `interprogram-cut-function' is non-nil, also save the text for a window +system cut and paste." + (interactive "r") +@end group +@group + (if (eq last-command 'kill-region) + (kill-append (filter-buffer-substring beg end) (< end beg)) + (kill-new (filter-buffer-substring beg end))) +@end group +@group + (if transient-mark-mode + (setq deactivate-mark t)) + nil) +@end group +@end smallexample + +@need 800 +As usual, this function can be divided into its component parts: + +@smallexample +@group +(defun copy-region-as-kill (@var{argument-list}) + "@var{documentation}@dots{}" + (interactive "r") + @var{body}@dots{}) +@end group +@end smallexample + +The arguments are @code{beg} and @code{end} and the function is +interactive with @code{"r"}, so the two arguments must refer to the +beginning and end of the region. If you have been reading though this +document from the beginning, understanding these parts of a function is +almost becoming routine. + +The documentation is somewhat confusing unless you remember that the +word `kill' has a meaning different from usual. The `Transient Mark' +and @code{interprogram-cut-function} comments explain certain +side-effects. + +After you once set a mark, a buffer always contains a region. If you +wish, you can use Transient Mark mode to highlight the region +temporarily. (No one wants to highlight the region all the time, so +Transient Mark mode highlights it only at appropriate times. Many +people turn off Transient Mark mode, so the region is never +highlighted.) + +Also, a windowing system allows you to copy, cut, and paste among +different programs. In the X windowing system, for example, the +@code{interprogram-cut-function} function is @code{x-select-text}, +which works with the windowing system's equivalent of the Emacs kill +ring. + +The body of the @code{copy-region-as-kill} function starts with an +@code{if} clause. What this clause does is distinguish between two +different situations: whether or not this command is executed +immediately after a previous @code{kill-region} command. In the first +case, the new region is appended to the previously copied text. +Otherwise, it is inserted into the beginning of the kill ring as a +separate piece of text from the previous piece. + +The last two lines of the function prevent the region from lighting up +if Transient Mark mode is turned on. + +The body of @code{copy-region-as-kill} merits discussion in detail. + +@node copy-region-as-kill body, , Complete copy-region-as-kill, copy-region-as-kill +@comment node-name, next, previous, up +@subsection The Body of @code{copy-region-as-kill} + +The @code{copy-region-as-kill} function works in much the same way as +the @code{kill-region} function. Both are written so that two or more +kills in a row combine their text into a single entry. If you yank +back the text from the kill ring, you get it all in one piece. +Moreover, kills that kill forward from the current position of the +cursor are added to the end of the previously copied text and commands +that copy text backwards add it to the beginning of the previously +copied text. This way, the words in the text stay in the proper +order. + +Like @code{kill-region}, the @code{copy-region-as-kill} function makes +use of the @code{last-command} variable that keeps track of the +previous Emacs command. + +@menu +* last-command & this-command:: +* kill-append function:: +* kill-new function:: +@end menu + +@node last-command & this-command, kill-append function, copy-region-as-kill body, copy-region-as-kill body +@ifnottex +@unnumberedsubsubsec @code{last-command} and @code{this-command} +@end ifnottex + +Normally, whenever a function is executed, Emacs sets the value of +@code{this-command} to the function being executed (which in this case +would be @code{copy-region-as-kill}). At the same time, Emacs sets +the value of @code{last-command} to the previous value of +@code{this-command}. + +In the first part of the body of the @code{copy-region-as-kill} +function, an @code{if} expression determines whether the value of +@code{last-command} is @code{kill-region}. If so, the then-part of +the @code{if} expression is evaluated; it uses the @code{kill-append} +function to concatenate the text copied at this call to the function +with the text already in the first element (the @sc{car}) of the kill +ring. On the other hand, if the value of @code{last-command} is not +@code{kill-region}, then the @code{copy-region-as-kill} function +attaches a new element to the kill ring using the @code{kill-new} +function. + +@need 1250 +The @code{if} expression reads as follows; it uses @code{eq}: + +@smallexample +@group + (if (eq last-command 'kill-region) + ;; @r{then-part} + (kill-append (filter-buffer-substring beg end) (< end beg)) + ;; @r{else-part} + (kill-new (filter-buffer-substring beg end))) +@end group +@end smallexample + +@findex filter-buffer-substring +(The @code{filter-buffer-substring} function returns a filtered +substring of the buffer, if any. Optionally---the arguments are not +here, so neither is done---the function may delete the initial text or +return the text without its properties; this function is a replacement +for the older @code{buffer-substring} function, which came before text +properties were implemented.) + +@findex eq @r{(example of use)} +@noindent +The @code{eq} function tests whether its first argument is the same Lisp +object as its second argument. The @code{eq} function is similar to the +@code{equal} function in that it is used to test for equality, but +differs in that it determines whether two representations are actually +the same object inside the computer, but with different names. +@code{equal} determines whether the structure and contents of two +expressions are the same. + +If the previous command was @code{kill-region}, then the Emacs Lisp +interpreter calls the @code{kill-append} function + +@node kill-append function, kill-new function, last-command & this-command, copy-region-as-kill body +@unnumberedsubsubsec The @code{kill-append} function +@findex kill-append + +@need 800 +The @code{kill-append} function looks like this: + +@c in GNU Emacs 22 +@smallexample +@group +(defun kill-append (string before-p &optional yank-handler) + "Append STRING to the end of the latest kill in the kill ring. +If BEFORE-P is non-nil, prepend STRING to the kill. +@dots{} " + (let* ((cur (car kill-ring))) + (kill-new (if before-p (concat string cur) (concat cur string)) + (or (= (length cur) 0) + (equal yank-handler + (get-text-property 0 'yank-handler cur))) + yank-handler))) +@end group +@end smallexample + +@ignore +was: +(defun kill-append (string before-p) + "Append STRING to the end of the latest kill in the kill ring. +If BEFORE-P is non-nil, prepend STRING to the kill. +If `interprogram-cut-function' is set, pass the resulting kill to +it." + (kill-new (if before-p + (concat string (car kill-ring)) + (concat (car kill-ring) string)) + t)) +@end ignore + +@noindent +The @code{kill-append} function is fairly straightforward. It uses +the @code{kill-new} function, which we will discuss in more detail in +a moment. + +(Also, the function provides an optional argument called +@code{yank-handler}; when invoked, this argument tells the function +how to deal with properties added to the text, such as `bold' or +`italics'.) + +@c !!! bug in GNU Emacs 22 version of kill-append ? +It has a @code{let*} function to set the value of the first element of +the kill ring to @code{cur}. (I do not know why the function does not +use @code{let} instead; only one value is set in the expression. +Perhaps this is a bug that produces no problems?) + +Consider the conditional that is one of the two arguments to +@code{kill-new}. It uses @code{concat} to concatenate the new text to +the @sc{car} of the kill ring. Whether it prepends or appends the +text depends on the results of an @code{if} expression: + +@smallexample +@group +(if before-p ; @r{if-part} + (concat string cur) ; @r{then-part} + (concat cur string)) ; @r{else-part} +@end group +@end smallexample + +@noindent +If the region being killed is before the region that was killed in the +last command, then it should be prepended before the material that was +saved in the previous kill; and conversely, if the killed text follows +what was just killed, it should be appended after the previous text. +The @code{if} expression depends on the predicate @code{before-p} to +decide whether the newly saved text should be put before or after the +previously saved text. + +The symbol @code{before-p} is the name of one of the arguments to +@code{kill-append}. When the @code{kill-append} function is +evaluated, it is bound to the value returned by evaluating the actual +argument. In this case, this is the expression @code{(< end beg)}. +This expression does not directly determine whether the killed text in +this command is located before or after the kill text of the last +command; what it does is determine whether the value of the variable +@code{end} is less than the value of the variable @code{beg}. If it +is, it means that the user is most likely heading towards the +beginning of the buffer. Also, the result of evaluating the predicate +expression, @code{(< end beg)}, will be true and the text will be +prepended before the previous text. On the other hand, if the value of +the variable @code{end} is greater than the value of the variable +@code{beg}, the text will be appended after the previous text. + +@need 800 +When the newly saved text will be prepended, then the string with the new +text will be concatenated before the old text: + +@smallexample +(concat string cur) +@end smallexample + +@need 1200 +@noindent +But if the text will be appended, it will be concatenated +after the old text: + +@smallexample +(concat cur string)) +@end smallexample + +To understand how this works, we first need to review the +@code{concat} function. The @code{concat} function links together or +unites two strings of text. The result is a string. For example: + +@smallexample +@group +(concat "abc" "def") + @result{} "abcdef" +@end group + +@group +(concat "new " + (car '("first element" "second element"))) + @result{} "new first element" + +(concat (car + '("first element" "second element")) " modified") + @result{} "first element modified" +@end group +@end smallexample + +We can now make sense of @code{kill-append}: it modifies the contents +of the kill ring. The kill ring is a list, each element of which is +saved text. The @code{kill-append} function uses the @code{kill-new} +function which in turn uses the @code{setcar} function. + +@node kill-new function, , kill-append function, copy-region-as-kill body +@unnumberedsubsubsec The @code{kill-new} function +@findex kill-new + +@c in GNU Emacs 22, additional documentation to kill-new: +@ignore +Optional third arguments YANK-HANDLER controls how the STRING is later +inserted into a buffer; see `insert-for-yank' for details. +When a yank handler is specified, STRING must be non-empty (the yank +handler, if non-nil, is stored as a `yank-handler' text property on STRING). + +When the yank handler has a non-nil PARAM element, the original STRING +argument is not used by `insert-for-yank'. However, since Lisp code +may access and use elements from the kill ring directly, the STRING +argument should still be a \"useful\" string for such uses." +@end ignore +@need 1200 +The @code{kill-new} function looks like this: + +@smallexample +@group +(defun kill-new (string &optional replace yank-handler) + "Make STRING the latest kill in the kill ring. +Set `kill-ring-yank-pointer' to point to it. + +If `interprogram-cut-function' is non-nil, apply it to STRING. +Optional second argument REPLACE non-nil means that STRING will replace +the front of the kill ring, rather than being added to the list. +@dots{}" +@end group +@group + (if (> (length string) 0) + (if yank-handler + (put-text-property 0 (length string) + 'yank-handler yank-handler string)) + (if yank-handler + (signal 'args-out-of-range + (list string "yank-handler specified for empty string")))) +@end group +@group + (if (fboundp 'menu-bar-update-yank-menu) + (menu-bar-update-yank-menu string (and replace (car kill-ring)))) +@end group +@group + (if (and replace kill-ring) + (setcar kill-ring string) + (push string kill-ring) + (if (> (length kill-ring) kill-ring-max) + (setcdr (nthcdr (1- kill-ring-max) kill-ring) nil))) +@end group +@group + (setq kill-ring-yank-pointer kill-ring) + (if interprogram-cut-function + (funcall interprogram-cut-function string (not replace)))) +@end group +@end smallexample +@ignore +was: +(defun kill-new (string &optional replace) + "Make STRING the latest kill in the kill ring. +Set the kill-ring-yank pointer to point to it. +If `interprogram-cut-function' is non-nil, apply it to STRING. +Optional second argument REPLACE non-nil means that STRING will replace +the front of the kill ring, rather than being added to the list." + (and (fboundp 'menu-bar-update-yank-menu) + (menu-bar-update-yank-menu string (and replace (car kill-ring)))) + (if (and replace kill-ring) + (setcar kill-ring string) + (setq kill-ring (cons string kill-ring)) + (if (> (length kill-ring) kill-ring-max) + (setcdr (nthcdr (1- kill-ring-max) kill-ring) nil))) + (setq kill-ring-yank-pointer kill-ring) + (if interprogram-cut-function + (funcall interprogram-cut-function string (not replace)))) +@end ignore + +(Notice that the function is not interactive.) + +As usual, we can look at this function in parts. + +The function definition has an optional @code{yank-handler} argument, +which when invoked tells the function how to deal with properties +added to the text, such as `bold' or `italics'. We will skip that. + +@need 1200 +The first line of the documentation makes sense: + +@smallexample +Make STRING the latest kill in the kill ring. +@end smallexample + +@noindent +Let's skip over the rest of the documentation for the moment. + +@noindent +Also, let's skip over the initial @code{if} expression and those lines +of code involving @code{menu-bar-update-yank-menu}. We will explain +them below. + +@need 1200 +The critical lines are these: + +@smallexample +@group + (if (and replace kill-ring) + ;; @r{then} + (setcar kill-ring string) +@end group +@group + ;; @r{else} + (push string kill-ring) +@end group +@group + (setq kill-ring (cons string kill-ring)) + (if (> (length kill-ring) kill-ring-max) + ;; @r{avoid overly long kill ring} + (setcdr (nthcdr (1- kill-ring-max) kill-ring) nil))) +@end group +@group + (setq kill-ring-yank-pointer kill-ring) + (if interprogram-cut-function + (funcall interprogram-cut-function string (not replace)))) +@end group +@end smallexample + +The conditional test is @w{@code{(and replace kill-ring)}}. +This will be true when two conditions are met: the kill ring has +something in it, and the @code{replace} variable is true. + +@need 1250 +When the @code{kill-append} function sets @code{replace} to be true +and when the kill ring has at least one item in it, the @code{setcar} +expression is executed: + +@smallexample +(setcar kill-ring string) +@end smallexample + +The @code{setcar} function actually changes the first element of the +@code{kill-ring} list to the value of @code{string}. It replaces the +first element. + +@need 1250 +On the other hand, if the kill ring is empty, or replace is false, the +else-part of the condition is executed: + +@smallexample +(push string kill-ring) +@end smallexample + +@noindent +@need 1250 +@code{push} puts its first argument onto the second. It is similar to +the older + +@smallexample +(setq kill-ring (cons string kill-ring)) +@end smallexample + +@noindent +@need 1250 +or the newer + +@smallexample +(add-to-list kill-ring string) +@end smallexample + +@noindent +When it is false, the expression first constructs a new version of the +kill ring by prepending @code{string} to the existing kill ring as a +new element (that is what the @code{push} does). Then it executes a +second @code{if} clause. This second @code{if} clause keeps the kill +ring from growing too long. + +Let's look at these two expressions in order. + +The @code{push} line of the else-part sets the new value of the kill +ring to what results from adding the string being killed to the old +kill ring. + +We can see how this works with an example. + +@need 800 +First, + +@smallexample +(setq example-list '("here is a clause" "another clause")) +@end smallexample + +@need 1200 +@noindent +After evaluating this expression with @kbd{C-x C-e}, you can evaluate +@code{example-list} and see what it returns: + +@smallexample +@group +example-list + @result{} ("here is a clause" "another clause") +@end group +@end smallexample + +@need 1200 +@noindent +Now, we can add a new element on to this list by evaluating the +following expression: +@findex push, @r{example} + +@smallexample +(push "a third clause" example-list) +@end smallexample + +@need 800 +@noindent +When we evaluate @code{example-list}, we find its value is: + +@smallexample +@group +example-list + @result{} ("a third clause" "here is a clause" "another clause") +@end group +@end smallexample + +@noindent +Thus, the third clause is added to the list by @code{push}. + +@need 1200 +Now for the second part of the @code{if} clause. This expression +keeps the kill ring from growing too long. It looks like this: + +@smallexample +@group +(if (> (length kill-ring) kill-ring-max) + (setcdr (nthcdr (1- kill-ring-max) kill-ring) nil)) +@end group +@end smallexample + +The code checks whether the length of the kill ring is greater than +the maximum permitted length. This is the value of +@code{kill-ring-max} (which is 60, by default). If the length of the +kill ring is too long, then this code sets the last element of the +kill ring to @code{nil}. It does this by using two functions, +@code{nthcdr} and @code{setcdr}. + +We looked at @code{setcdr} earlier (@pxref{setcdr, , @code{setcdr}}). +It sets the @sc{cdr} of a list, just as @code{setcar} sets the +@sc{car} of a list. In this case, however, @code{setcdr} will not be +setting the @sc{cdr} of the whole kill ring; the @code{nthcdr} +function is used to cause it to set the @sc{cdr} of the next to last +element of the kill ring---this means that since the @sc{cdr} of the +next to last element is the last element of the kill ring, it will set +the last element of the kill ring. + +@findex nthcdr, @r{example} +The @code{nthcdr} function works by repeatedly taking the @sc{cdr} of a +list---it takes the @sc{cdr} of the @sc{cdr} of the @sc{cdr} +@dots{} It does this @var{N} times and returns the results. +(@xref{nthcdr, , @code{nthcdr}}.) + +@findex setcdr, @r{example} +Thus, if we had a four element list that was supposed to be three +elements long, we could set the @sc{cdr} of the next to last element +to @code{nil}, and thereby shorten the list. (If you set the last +element to some other value than @code{nil}, which you could do, then +you would not have shortened the list. @xref{setcdr, , +@code{setcdr}}.) + +You can see shortening by evaluating the following three expressions +in turn. First set the value of @code{trees} to @code{(maple oak pine +birch)}, then set the @sc{cdr} of its second @sc{cdr} to @code{nil} +and then find the value of @code{trees}: + +@smallexample +@group +(setq trees '(maple oak pine birch)) + @result{} (maple oak pine birch) +@end group + +@group +(setcdr (nthcdr 2 trees) nil) + @result{} nil + +trees + @result{} (maple oak pine) +@end group +@end smallexample + +@noindent +(The value returned by the @code{setcdr} expression is @code{nil} since +that is what the @sc{cdr} is set to.) + +To repeat, in @code{kill-new}, the @code{nthcdr} function takes the +@sc{cdr} a number of times that is one less than the maximum permitted +size of the kill ring and @code{setcdr} sets the @sc{cdr} of that +element (which will be the rest of the elements in the kill ring) to +@code{nil}. This prevents the kill ring from growing too long. + +@need 800 +The next to last expression in the @code{kill-new} function is + +@smallexample +(setq kill-ring-yank-pointer kill-ring) +@end smallexample + +The @code{kill-ring-yank-pointer} is a global variable that is set to be +the @code{kill-ring}. + +Even though the @code{kill-ring-yank-pointer} is called a +@samp{pointer}, it is a variable just like the kill ring. However, the +name has been chosen to help humans understand how the variable is used. + +@need 1200 +Now, to return to an early expression in the body of the function: + +@smallexample +@group + (if (fboundp 'menu-bar-update-yank-menu) + (menu-bar-update-yank-menu string (and replace (car kill-ring)))) +@end group +@end smallexample + +@noindent +It starts with an @code{if} expression + +In this case, the expression tests first to see whether +@code{menu-bar-update-yank-menu} exists as a function, and if so, +calls it. The @code{fboundp} function returns true if the symbol it +is testing has a function definition that `is not void'. If the +symbol's function definition were void, we would receive an error +message, as we did when we created errors intentionally (@pxref{Making +Errors, , Generate an Error Message}). + +@noindent +The then-part contains an expression whose first element is the +function @code{and}. + +@findex and +The @code{and} special form evaluates each of its arguments until one +of the arguments returns a value of @code{nil}, in which case the +@code{and} expression returns @code{nil}; however, if none of the +arguments returns a value of @code{nil}, the value resulting from +evaluating the last argument is returned. (Since such a value is not +@code{nil}, it is considered true in Emacs Lisp.) In other words, an +@code{and} expression returns a true value only if all its arguments +are true. (@xref{Second Buffer Related Review}.) + +The expression determines whether the second argument to +@code{menu-bar-update-yank-menu} is true or not. +@ignore + ;; If we're supposed to be extending an existing string, and that + ;; string really is at the front of the menu, then update it in place. +@end ignore + +@code{menu-bar-update-yank-menu} is one of the functions that make it +possible to use the `Select and Paste' menu in the Edit item of a menu +bar; using a mouse, you can look at the various pieces of text you +have saved and select one piece to paste. + +The last expression in the @code{kill-new} function adds the newly +copied string to whatever facility exists for copying and pasting +among different programs running in a windowing system. In the X +Windowing system, for example, the @code{x-select-text} function takes +the string and stores it in memory operated by X. You can paste the +string in another program, such as an Xterm. + +@need 1200 +The expression looks like this: + +@smallexample +@group + (if interprogram-cut-function + (funcall interprogram-cut-function string (not replace)))) +@end group +@end smallexample + +If an @code{interprogram-cut-function} exists, then Emacs executes +@code{funcall}, which in turn calls its first argument as a function +and passes the remaining arguments to it. (Incidentally, as far as I +can see, this @code{if} expression could be replaced by an @code{and} +expression similar to the one in the first part of the function.) + +We are not going to discuss windowing systems and other programs +further, but merely note that this is a mechanism that enables GNU +Emacs to work easily and well with other programs. + +This code for placing text in the kill ring, either concatenated with +an existing element or as a new element, leads us to the code for +bringing back text that has been cut out of the buffer---the yank +commands. However, before discussing the yank commands, it is better +to learn how lists are implemented in a computer. This will make +clear such mysteries as the use of the term `pointer'. But before +that, we will digress into C. + +@ignore +@c is this true in Emacs 22? Does not seems to be + + (If the @w{@code{(< end beg))}} +expression is true, @code{kill-append} prepends the string to the just +previously clipped text. For a detailed discussion, see +@ref{kill-append function, , The @code{kill-append} function}.) + +If you then yank back the text, i.e., `paste' it, you get both +pieces of text at once. That way, if you delete two words in a row, +and then yank them back, you get both words, in their proper order, +with one yank. (The @w{@code{(< end beg))}} expression makes sure the +order is correct.) + +On the other hand, if the previous command is not @code{kill-region}, +then the @code{kill-new} function is called, which adds the text to +the kill ring as the latest item, and sets the +@code{kill-ring-yank-pointer} variable to point to it. +@end ignore +@ignore + +@c Evidently, changed for Emacs 22. The zap-to-char command does not +@c use the delete-and-extract-region function + +2006 Oct 26, the Digression into C is now OK but should come after +copy-region-as-kill and filter-buffer-substring + +2006 Oct 24 +In Emacs 22, +copy-region-as-kill is short, 12 lines, and uses +filter-buffer-substring, which is longer, 39 lines +and has delete-and-extract-region in it. +delete-and-extract-region is written in C. + +see Initializing a Variable with @code{defvar} +@end ignore + +@node Digression into C, defvar, copy-region-as-kill, Cutting & Storing Text +@comment node-name, next, previous, up +@section Digression into C +@findex delete-and-extract-region +@cindex C, a digression into +@cindex Digression into C + +The @code{copy-region-as-kill} function (@pxref{copy-region-as-kill, , +@code{copy-region-as-kill}}) uses the @code{filter-buffer-substring} +function, which in turn uses the @code{delete-and-extract-region} +function. It removes the contents of a region and you cannot get them +back. + +Unlike the other code discussed here, the +@code{delete-and-extract-region} function is not written in Emacs +Lisp; it is written in C and is one of the primitives of the GNU Emacs +system. Since it is very simple, I will digress briefly from Lisp and +describe it here. + +@c GNU Emacs 22 in /usr/local/src/emacs/src/editfns.c +@c the DEFUN for buffer-substring-no-properties + +@need 1500 +Like many of the other Emacs primitives, +@code{delete-and-extract-region} is written as an instance of a C +macro, a macro being a template for code. The complete macro looks +like this: + +@smallexample +@group +DEFUN ("buffer-substring-no-properties", Fbuffer_substring_no_properties, + Sbuffer_substring_no_properties, 2, 2, 0, + doc: /* Return the characters of part of the buffer, +without the text properties. +The two arguments START and END are character positions; +they can be in either order. */) + (start, end) + Lisp_Object start, end; +@{ + register int b, e; + + validate_region (&start, &end); + b = XINT (start); + e = XINT (end); + + return make_buffer_string (b, e, 0); +@} +@end group +@end smallexample + +Without going into the details of the macro writing process, let me +point out that this macro starts with the word @code{DEFUN}. The word +@code{DEFUN} was chosen since the code serves the same purpose as +@code{defun} does in Lisp. (The @code{DEFUN} C macro is defined in +@file{emacs/src/lisp.h}.) + +The word @code{DEFUN} is followed by seven parts inside of +parentheses: + +@itemize @bullet +@item +The first part is the name given to the function in Lisp, +@code{delete-and-extract-region}. + +@item +The second part is the name of the function in C, +@code{Fdelete_and_extract_region}. By convention, it starts with +@samp{F}. Since C does not use hyphens in names, underscores are used +instead. + +@item +The third part is the name for the C constant structure that records +information on this function for internal use. It is the name of the +function in C but begins with an @samp{S} instead of an @samp{F}. + +@item +The fourth and fifth parts specify the minimum and maximum number of +arguments the function can have. This function demands exactly 2 +arguments. + +@item +The sixth part is nearly like the argument that follows the +@code{interactive} declaration in a function written in Lisp: a letter +followed, perhaps, by a prompt. The only difference from the Lisp is +when the macro is called with no arguments. Then you write a @code{0} +(which is a `null string'), as in this macro. + +If you were to specify arguments, you would place them between +quotation marks. The C macro for @code{goto-char} includes +@code{"NGoto char: "} in this position to indicate that the function +expects a raw prefix, in this case, a numerical location in a buffer, +and provides a prompt. + +@item +The seventh part is a documentation string, just like the one for a +function written in Emacs Lisp, except that every newline must be +written explicitly as @samp{\n} followed by a backslash and carriage +return. + +@need 1000 +Thus, the first two lines of documentation for @code{goto-char} are +written like this: + +@smallexample +@group + "Set point to POSITION, a number or marker.\n\ +Beginning of buffer is position (point-min), end is (point-max)." +@end group +@end smallexample +@end itemize + +@need 1200 +In a C macro, the formal parameters come next, with a statement of +what kind of object they are, followed by what might be called the `body' +of the macro. For @code{delete-and-extract-region} the `body' +consists of the following four lines: + +@smallexample +@group +validate_region (&start, &end); +if (XINT (start) == XINT (end)) + return build_string (""); +return del_range_1 (XINT (start), XINT (end), 1, 1); +@end group +@end smallexample + +The @code{validate_region} function checks whether the values +passed as the beginning and end of the region are the proper type and +are within range. If the beginning and end positions are the same, +then return and empty string. + +The @code{del_range_1} function actually deletes the text. It is a +complex function we will not look into. It updates the buffer and +does other things. However, it is worth looking at the two arguments +passed to @code{del_range}. These are @w{@code{XINT (start)}} and +@w{@code{XINT (end)}}. + +As far as the C language is concerned, @code{start} and @code{end} are +two integers that mark the beginning and end of the region to be +deleted@footnote{More precisely, and requiring more expert knowledge +to understand, the two integers are of type `Lisp_Object', which can +also be a C union instead of an integer type.}. + +In early versions of Emacs, these two numbers were thirty-two bits +long, but the code is slowly being generalized to handle other +lengths. Three of the available bits are used to specify the type of +information; the remaining bits are used as `content'. + +@samp{XINT} is a C macro that extracts the relevant number from the +longer collection of bits; the three other bits are discarded. + +@need 800 +The command in @code{delete-and-extract-region} looks like this: + +@smallexample +del_range_1 (XINT (start), XINT (end), 1, 1); +@end smallexample + +@noindent +It deletes the region between the beginning position, @code{start}, +and the ending position, @code{end}. + +From the point of view of the person writing Lisp, Emacs is all very +simple; but hidden underneath is a great deal of complexity to make it +all work. + +@node defvar, cons & search-fwd Review, Digression into C, Cutting & Storing Text +@comment node-name, next, previous, up +@section Initializing a Variable with @code{defvar} +@findex defvar +@cindex Initializing a variable +@cindex Variable initialization + +@ignore +2006 Oct 24 +In Emacs 22, +copy-region-as-kill is short, 12 lines, and uses +filter-buffer-substring, which is longer, 39 lines +and has delete-and-extract-region in it. +delete-and-extract-region is written in C. + +see Initializing a Variable with @code{defvar} + +@end ignore + +The @code{copy-region-as-kill} function is written in Emacs Lisp. Two +functions within it, @code{kill-append} and @code{kill-new}, copy a +region in a buffer and save it in a variable called the +@code{kill-ring}. This section describes how the @code{kill-ring} +variable is created and initialized using the @code{defvar} special +form. + +(Again we note that the term @code{kill-ring} is a misnomer. The text +that is clipped out of the buffer can be brought back; it is not a ring +of corpses, but a ring of resurrectable text.) + +In Emacs Lisp, a variable such as the @code{kill-ring} is created and +given an initial value by using the @code{defvar} special form. The +name comes from ``define variable''. + +The @code{defvar} special form is similar to @code{setq} in that it sets +the value of a variable. It is unlike @code{setq} in two ways: first, +it only sets the value of the variable if the variable does not already +have a value. If the variable already has a value, @code{defvar} does +not override the existing value. Second, @code{defvar} has a +documentation string. + +(Another special form, @code{defcustom}, is designed for variables +that people customize. It has more features than @code{defvar}. +(@xref{defcustom, , Setting Variables with @code{defcustom}}.) + +@menu +* See variable current value:: +* defvar and asterisk:: +@end menu + +@node See variable current value, defvar and asterisk, defvar, defvar +@ifnottex +@unnumberedsubsec Seeing the Current Value of a Variable +@end ifnottex + +You can see the current value of a variable, any variable, by using +the @code{describe-variable} function, which is usually invoked by +typing @kbd{C-h v}. If you type @kbd{C-h v} and then @code{kill-ring} +(followed by @key{RET}) when prompted, you will see what is in your +current kill ring---this may be quite a lot! Conversely, if you have +been doing nothing this Emacs session except read this document, you +may have nothing in it. Also, you will see the documentation for +@code{kill-ring}: + +@smallexample +@group +Documentation: +List of killed text sequences. +Since the kill ring is supposed to interact nicely with cut-and-paste +facilities offered by window systems, use of this variable should +@end group +@group +interact nicely with `interprogram-cut-function' and +`interprogram-paste-function'. The functions `kill-new', +`kill-append', and `current-kill' are supposed to implement this +interaction; you may want to use them instead of manipulating the kill +ring directly. +@end group +@end smallexample + +@need 800 +The kill ring is defined by a @code{defvar} in the following way: + +@smallexample +@group +(defvar kill-ring nil + "List of killed text sequences. +@dots{}") +@end group +@end smallexample + +@noindent +In this variable definition, the variable is given an initial value of +@code{nil}, which makes sense, since if you have saved nothing, you want +nothing back if you give a @code{yank} command. The documentation +string is written just like the documentation string of a @code{defun}. +As with the documentation string of the @code{defun}, the first line of +the documentation should be a complete sentence, since some commands, +like @code{apropos}, print only the first line of documentation. +Succeeding lines should not be indented; otherwise they look odd when +you use @kbd{C-h v} (@code{describe-variable}). + +@node defvar and asterisk, , See variable current value, defvar +@subsection @code{defvar} and an asterisk +@findex defvar @r{for a user customizable variable} +@findex defvar @r{with an asterisk} + +In the past, Emacs used the @code{defvar} special form both for +internal variables that you would not expect a user to change and for +variables that you do expect a user to change. Although you can still +use @code{defvar} for user customizable variables, please use +@code{defcustom} instead, since that special form provides a path into +the Customization commands. (@xref{defcustom, , Specifying Variables +using @code{defcustom}}.) + +When you specified a variable using the @code{defvar} special form, +you could distinguish a readily settable variable from others by +typing an asterisk, @samp{*}, in the first column of its documentation +string. For example: + +@smallexample +@group +(defvar shell-command-default-error-buffer nil + "*Buffer name for `shell-command' @dots{} error output. +@dots{} ") +@end group +@end smallexample + +@findex set-variable +@noindent +You could (and still can) use the @code{set-variable} command to +change the value of @code{shell-command-default-error-buffer} +temporarily. However, options set using @code{set-variable} are set +only for the duration of your editing session. The new values are not +saved between sessions. Each time Emacs starts, it reads the original +value, unless you change the value within your @file{.emacs} file, +either by setting it manually or by using @code{customize}. +@xref{Emacs Initialization, , Your @file{.emacs} File}. + +For me, the major use of the @code{set-variable} command is to suggest +variables that I might want to set in my @file{.emacs} file. There +are now more than 700 such variables --- far too many to remember +readily. Fortunately, you can press @key{TAB} after calling the +@code{M-x set-variable} command to see the list of variables. +(@xref{Examining, , Examining and Setting Variables, emacs, +The GNU Emacs Manual}.) + +@need 1250 +@node cons & search-fwd Review, search Exercises, defvar, Cutting & Storing Text +@comment node-name, next, previous, up +@section Review + +Here is a brief summary of some recently introduced functions. + +@table @code +@item car +@itemx cdr +@code{car} returns the first element of a list; @code{cdr} returns the +second and subsequent elements of a list. + +@need 1250 +For example: + +@smallexample +@group +(car '(1 2 3 4 5 6 7)) + @result{} 1 +(cdr '(1 2 3 4 5 6 7)) + @result{} (2 3 4 5 6 7) +@end group +@end smallexample + +@item cons +@code{cons} constructs a list by prepending its first argument to its +second argument. + +@need 1250 +For example: + +@smallexample +@group +(cons 1 '(2 3 4)) + @result{} (1 2 3 4) +@end group +@end smallexample + +@item funcall +@code{funcall} evaluates its first argument as a function. It passes +its remaining arguments to its first argument. + +@item nthcdr +Return the result of taking @sc{cdr} `n' times on a list. +@iftex +The +@tex +$n^{th}$ +@end tex +@code{cdr}. +@end iftex +The `rest of the rest', as it were. + +@need 1250 +For example: + +@smallexample +@group +(nthcdr 3 '(1 2 3 4 5 6 7)) + @result{} (4 5 6 7) +@end group +@end smallexample + +@item setcar +@itemx setcdr +@code{setcar} changes the first element of a list; @code{setcdr} +changes the second and subsequent elements of a list. + +@need 1250 +For example: + +@smallexample +@group +(setq triple '(1 2 3)) + +(setcar triple '37) + +triple + @result{} (37 2 3) + +(setcdr triple '("foo" "bar")) + +triple + @result{} (37 "foo" "bar") +@end group +@end smallexample + +@item progn +Evaluate each argument in sequence and then return the value of the +last. + +@need 1250 +For example: + +@smallexample +@group +(progn 1 2 3 4) + @result{} 4 +@end group +@end smallexample + +@item save-restriction +Record whatever narrowing is in effect in the current buffer, if any, +and restore that narrowing after evaluating the arguments. + +@item search-forward +Search for a string, and if the string is found, move point. With a +regular expression, use the similar @code{re-search-forward}. +(@xref{Regexp Search, , Regular Expression Searches}, for an +explanation of regular expression patterns and searches.) + +@need 1250 +@noindent +@code{search-forward} and @code{re-search-forward} take four +arguments: + +@enumerate +@item +The string or regular expression to search for. + +@item +Optionally, the limit of the search. + +@item +Optionally, what to do if the search fails, return @code{nil} or an +error message. + +@item +Optionally, how many times to repeat the search; if negative, the +search goes backwards. +@end enumerate + +@item kill-region +@itemx delete-and-extract-region +@itemx copy-region-as-kill + +@code{kill-region} cuts the text between point and mark from the +buffer and stores that text in the kill ring, so you can get it back +by yanking. + +@code{copy-region-as-kill} copies the text between point and mark into +the kill ring, from which you can get it by yanking. The function +does not cut or remove the text from the buffer. +@end table + +@code{delete-and-extract-region} removes the text between point and +mark from the buffer and throws it away. You cannot get it back. +(This is not an interactive command.) + +@need 1500 +@node search Exercises, , cons & search-fwd Review, Cutting & Storing Text +@section Searching Exercises + +@itemize @bullet +@item +Write an interactive function that searches for a string. If the +search finds the string, leave point after it and display a message +that says ``Found!''. (Do not use @code{search-forward} for the name +of this function; if you do, you will overwrite the existing version of +@code{search-forward} that comes with Emacs. Use a name such as +@code{test-search} instead.) + +@item +Write a function that prints the third element of the kill ring in the +echo area, if any; if the kill ring does not contain a third element, +print an appropriate message. +@end itemize + +@node List Implementation, Yanking, Cutting & Storing Text, Top +@comment node-name, next, previous, up +@chapter How Lists are Implemented +@cindex Lists in a computer + +In Lisp, atoms are recorded in a straightforward fashion; if the +implementation is not straightforward in practice, it is, nonetheless, +straightforward in theory. The atom @samp{rose}, for example, is +recorded as the four contiguous letters @samp{r}, @samp{o}, @samp{s}, +@samp{e}. A list, on the other hand, is kept differently. The mechanism +is equally simple, but it takes a moment to get used to the idea. A +list is kept using a series of pairs of pointers. In the series, the +first pointer in each pair points to an atom or to another list, and the +second pointer in each pair points to the next pair, or to the symbol +@code{nil}, which marks the end of the list. + +A pointer itself is quite simply the electronic address of what is +pointed to. Hence, a list is kept as a series of electronic addresses. + +@menu +* Lists diagrammed:: +* Symbols as Chest:: Exploring a powerful metaphor. +* List Exercise:: +@end menu + +@node Lists diagrammed, Symbols as Chest, List Implementation, List Implementation +@ifnottex +@unnumberedsec Lists diagrammed +@end ifnottex + +For example, the list @code{(rose violet buttercup)} has three elements, +@samp{rose}, @samp{violet}, and @samp{buttercup}. In the computer, the +electronic address of @samp{rose} is recorded in a segment of computer +memory along with the address that gives the electronic address of where +the atom @samp{violet} is located; and that address (the one that tells +where @samp{violet} is located) is kept along with an address that tells +where the address for the atom @samp{buttercup} is located. + +@need 1200 +This sounds more complicated than it is and is easier seen in a diagram: + +@c clear print-postscript-figures +@c !!! cons-cell-diagram #1 +@ifnottex +@smallexample +@group + ___ ___ ___ ___ ___ ___ + |___|___|--> |___|___|--> |___|___|--> nil + | | | + | | | + --> rose --> violet --> buttercup +@end group +@end smallexample +@end ifnottex +@ifset print-postscript-figures +@sp 1 +@tex +@center @image{cons-1} +%%%% old method of including an image +% \input /usr/local/lib/tex/inputs/psfig.tex +% \centerline{\psfig{figure=/usr/local/lib/emacs/man/cons-1.eps}} +% \catcode`\@=0 % +@end tex +@sp 1 +@end ifset +@ifclear print-postscript-figures +@iftex +@smallexample +@group + ___ ___ ___ ___ ___ ___ + |___|___|--> |___|___|--> |___|___|--> nil + | | | + | | | + --> rose --> violet --> buttercup +@end group +@end smallexample +@end iftex +@end ifclear + +@noindent +In the diagram, each box represents a word of computer memory that +holds a Lisp object, usually in the form of a memory address. The boxes, +i.e.@: the addresses, are in pairs. Each arrow points to what the address +is the address of, either an atom or another pair of addresses. The +first box is the electronic address of @samp{rose} and the arrow points +to @samp{rose}; the second box is the address of the next pair of boxes, +the first part of which is the address of @samp{violet} and the second +part of which is the address of the next pair. The very last box +points to the symbol @code{nil}, which marks the end of the list. + +@need 1200 +When a variable is set to a list with a function such as @code{setq}, +it stores the address of the first box in the variable. Thus, +evaluation of the expression + +@smallexample +(setq bouquet '(rose violet buttercup)) +@end smallexample + +@need 1250 +@noindent +creates a situation like this: + +@c cons-cell-diagram #2 +@ifnottex +@smallexample +@group +bouquet + | + | ___ ___ ___ ___ ___ ___ + --> |___|___|--> |___|___|--> |___|___|--> nil + | | | + | | | + --> rose --> violet --> buttercup +@end group +@end smallexample +@end ifnottex +@ifset print-postscript-figures +@sp 1 +@tex +@center @image{cons-2} +%%%% old method of including an image +% \input /usr/local/lib/tex/inputs/psfig.tex +% \centerline{\psfig{figure=/usr/local/lib/emacs/man/cons-2.eps}} +% \catcode`\@=0 % +@end tex +@sp 1 +@end ifset +@ifclear print-postscript-figures +@iftex +@smallexample +@group +bouquet + | + | ___ ___ ___ ___ ___ ___ + --> |___|___|--> |___|___|--> |___|___|--> nil + | | | + | | | + --> rose --> violet --> buttercup +@end group +@end smallexample +@end iftex +@end ifclear + +@noindent +In this example, the symbol @code{bouquet} holds the address of the first +pair of boxes. + +@need 1200 +This same list can be illustrated in a different sort of box notation +like this: + +@c cons-cell-diagram #2a +@ifnottex +@smallexample +@group +bouquet + | + | -------------- --------------- ---------------- + | | car | cdr | | car | cdr | | car | cdr | + -->| rose | o------->| violet | o------->| butter- | nil | + | | | | | | | cup | | + -------------- --------------- ---------------- +@end group +@end smallexample +@end ifnottex +@ifset print-postscript-figures +@sp 1 +@tex +@center @image{cons-2a} +%%%% old method of including an image +% \input /usr/local/lib/tex/inputs/psfig.tex +% \centerline{\psfig{figure=/usr/local/lib/emacs/man/cons-2a.eps}} +% \catcode`\@=0 % +@end tex +@sp 1 +@end ifset +@ifclear print-postscript-figures +@iftex +@smallexample +@group +bouquet + | + | -------------- --------------- ---------------- + | | car | cdr | | car | cdr | | car | cdr | + -->| rose | o------->| violet | o------->| butter- | nil | + | | | | | | | cup | | + -------------- --------------- ---------------- +@end group +@end smallexample +@end iftex +@end ifclear + +(Symbols consist of more than pairs of addresses, but the structure of +a symbol is made up of addresses. Indeed, the symbol @code{bouquet} +consists of a group of address-boxes, one of which is the address of +the printed word @samp{bouquet}, a second of which is the address of a +function definition attached to the symbol, if any, a third of which +is the address of the first pair of address-boxes for the list +@code{(rose violet buttercup)}, and so on. Here we are showing that +the symbol's third address-box points to the first pair of +address-boxes for the list.) + +If a symbol is set to the @sc{cdr} of a list, the list itself is not +changed; the symbol simply has an address further down the list. (In +the jargon, @sc{car} and @sc{cdr} are `non-destructive'.) Thus, +evaluation of the following expression + +@smallexample +(setq flowers (cdr bouquet)) +@end smallexample + +@need 800 +@noindent +produces this: + +@c cons-cell-diagram #3 +@ifnottex +@sp 1 +@smallexample +@group +bouquet flowers + | | + | ___ ___ | ___ ___ ___ ___ + --> | | | --> | | | | | | + |___|___|----> |___|___|--> |___|___|--> nil + | | | + | | | + --> rose --> violet --> buttercup +@end group +@end smallexample +@sp 1 +@end ifnottex +@ifset print-postscript-figures +@sp 1 +@tex +@center @image{cons-3} +%%%% old method of including an image +% \input /usr/local/lib/tex/inputs/psfig.tex +% \centerline{\psfig{figure=/usr/local/lib/emacs/man/cons-3.eps}} +% \catcode`\@=0 % +@end tex +@sp 1 +@end ifset +@ifclear print-postscript-figures +@iftex +@sp 1 +@smallexample +@group +bouquet flowers + | | + | ___ ___ | ___ ___ ___ ___ + --> | | | --> | | | | | | + |___|___|----> |___|___|--> |___|___|--> nil + | | | + | | | + --> rose --> violet --> buttercup +@end group +@end smallexample +@sp 1 +@end iftex +@end ifclear + +@noindent +The value of @code{flowers} is @code{(violet buttercup)}, which is +to say, the symbol @code{flowers} holds the address of the pair of +address-boxes, the first of which holds the address of @code{violet}, +and the second of which holds the address of @code{buttercup}. + +A pair of address-boxes is called a @dfn{cons cell} or @dfn{dotted +pair}. @xref{Cons Cell Type, , Cons Cell and List Types, elisp, The GNU Emacs Lisp +Reference Manual}, and @ref{Dotted Pair Notation, , Dotted Pair +Notation, elisp, The GNU Emacs Lisp Reference Manual}, for more +information about cons cells and dotted pairs. + +@need 1200 +The function @code{cons} adds a new pair of addresses to the front of +a series of addresses like that shown above. For example, evaluating +the expression + +@smallexample +(setq bouquet (cons 'lily bouquet)) +@end smallexample + +@need 1500 +@noindent +produces: + +@c cons-cell-diagram #4 +@ifnottex +@sp 1 +@smallexample +@group +bouquet flowers + | | + | ___ ___ ___ ___ | ___ ___ ___ ___ + --> | | | | | | --> | | | | | | + |___|___|----> |___|___|----> |___|___|---->|___|___|--> nil + | | | | + | | | | + --> lily --> rose --> violet --> buttercup +@end group +@end smallexample +@sp 1 +@end ifnottex +@ifset print-postscript-figures +@sp 1 +@tex +@center @image{cons-4} +%%%% old method of including an image +% \input /usr/local/lib/tex/inputs/psfig.tex +% \centerline{\psfig{figure=/usr/local/lib/emacs/man/cons-4.eps}} +% \catcode`\@=0 % +@end tex +@sp 1 +@end ifset +@ifclear print-postscript-figures +@iftex +@sp 1 +@smallexample +@group +bouquet flowers + | | + | ___ ___ ___ ___ | ___ ___ ___ ___ + --> | | | | | | --> | | | | | | + |___|___|----> |___|___|----> |___|___|---->|___|___|--> nil + | | | | + | | | | + --> lily --> rose --> violet --> buttercup +@end group +@end smallexample +@sp 1 +@end iftex +@end ifclear + +@need 1200 +@noindent +However, this does not change the value of the symbol +@code{flowers}, as you can see by evaluating the following, + +@smallexample +(eq (cdr (cdr bouquet)) flowers) +@end smallexample + +@noindent +which returns @code{t} for true. + +Until it is reset, @code{flowers} still has the value +@code{(violet buttercup)}; that is, it has the address of the cons +cell whose first address is of @code{violet}. Also, this does not +alter any of the pre-existing cons cells; they are all still there. + +Thus, in Lisp, to get the @sc{cdr} of a list, you just get the address +of the next cons cell in the series; to get the @sc{car} of a list, +you get the address of the first element of the list; to @code{cons} a +new element on a list, you add a new cons cell to the front of the list. +That is all there is to it! The underlying structure of Lisp is +brilliantly simple! + +And what does the last address in a series of cons cells refer to? It +is the address of the empty list, of @code{nil}. + +In summary, when a Lisp variable is set to a value, it is provided with +the address of the list to which the variable refers. + +@node Symbols as Chest, List Exercise, Lists diagrammed, List Implementation +@section Symbols as a Chest of Drawers +@cindex Symbols as a Chest of Drawers +@cindex Chest of Drawers, metaphor for a symbol +@cindex Drawers, Chest of, metaphor for a symbol + +In an earlier section, I suggested that you might imagine a symbol as +being a chest of drawers. The function definition is put in one +drawer, the value in another, and so on. What is put in the drawer +holding the value can be changed without affecting the contents of the +drawer holding the function definition, and vice-verse. + +Actually, what is put in each drawer is the address of the value or +function definition. It is as if you found an old chest in the attic, +and in one of its drawers you found a map giving you directions to +where the buried treasure lies. + +(In addition to its name, symbol definition, and variable value, a +symbol has a `drawer' for a @dfn{property list} which can be used to +record other information. Property lists are not discussed here; see +@ref{Property Lists, , Property Lists, elisp, The GNU Emacs Lisp +Reference Manual}.) + +@need 1500 +Here is a fanciful representation: + +@c chest-of-drawers diagram +@ifnottex +@sp 1 +@smallexample +@group + Chest of Drawers Contents of Drawers + + __ o0O0o __ + / \ + --------------------- + | directions to | [map to] + | symbol name | bouquet + | | + +---------------------+ + | directions to | + | symbol definition | [none] + | | + +---------------------+ + | directions to | [map to] + | variable value | (rose violet buttercup) + | | + +---------------------+ + | directions to | + | property list | [not described here] + | | + +---------------------+ + |/ \| +@end group +@end smallexample +@sp 1 +@end ifnottex +@ifset print-postscript-figures +@sp 1 +@tex +@center @image{drawers} +%%%% old method of including an image +% \input /usr/local/lib/tex/inputs/psfig.tex +% \centerline{\psfig{figure=/usr/local/lib/emacs/man/drawers.eps}} +% \catcode`\@=0 % +@end tex +@sp 1 +@end ifset +@ifclear print-postscript-figures +@iftex +@sp 1 +@smallexample +@group + Chest of Drawers Contents of Drawers + + __ o0O0o __ + / \ + --------------------- + | directions to | [map to] + | symbol name | bouquet + | | + +---------------------+ + | directions to | + | symbol definition | [none] + | | + +---------------------+ + | directions to | [map to] + | variable value | (rose violet buttercup) + | | + +---------------------+ + | directions to | + | property list | [not described here] + | | + +---------------------+ + |/ \| +@end group +@end smallexample +@sp 1 +@end iftex +@end ifclear + +@node List Exercise, , Symbols as Chest, List Implementation +@section Exercise + +Set @code{flowers} to @code{violet} and @code{buttercup}. Cons two +more flowers on to this list and set this new list to +@code{more-flowers}. Set the @sc{car} of @code{flowers} to a fish. +What does the @code{more-flowers} list now contain? + +@node Yanking, Loops & Recursion, List Implementation, Top +@comment node-name, next, previous, up +@chapter Yanking Text Back +@findex yank +@cindex Text retrieval +@cindex Retrieving text +@cindex Pasting text + +Whenever you cut text out of a buffer with a `kill' command in GNU Emacs, +you can bring it back with a `yank' command. The text that is cut out of +the buffer is put in the kill ring and the yank commands insert the +appropriate contents of the kill ring back into a buffer (not necessarily +the original buffer). + +A simple @kbd{C-y} (@code{yank}) command inserts the first item from +the kill ring into the current buffer. If the @kbd{C-y} command is +followed immediately by @kbd{M-y}, the first element is replaced by +the second element. Successive @kbd{M-y} commands replace the second +element with the third, fourth, or fifth element, and so on. When the +last element in the kill ring is reached, it is replaced by the first +element and the cycle is repeated. (Thus the kill ring is called a +`ring' rather than just a `list'. However, the actual data structure +that holds the text is a list. +@xref{Kill Ring, , Handling the Kill Ring}, for the details of how the +list is handled as a ring.) + +@menu +* Kill Ring Overview:: +* kill-ring-yank-pointer:: The kill ring is a list. +* yank nthcdr Exercises:: The @code{kill-ring-yank-pointer} variable. +@end menu + +@node Kill Ring Overview, kill-ring-yank-pointer, Yanking, Yanking +@comment node-name, next, previous, up +@section Kill Ring Overview +@cindex Kill ring overview + +The kill ring is a list of textual strings. This is what it looks like: + +@smallexample +("some text" "a different piece of text" "yet more text") +@end smallexample + +If this were the contents of my kill ring and I pressed @kbd{C-y}, the +string of characters saying @samp{some text} would be inserted in this +buffer where my cursor is located. + +The @code{yank} command is also used for duplicating text by copying it. +The copied text is not cut from the buffer, but a copy of it is put on the +kill ring and is inserted by yanking it back. + +Three functions are used for bringing text back from the kill ring: +@code{yank}, which is usually bound to @kbd{C-y}; @code{yank-pop}, +which is usually bound to @kbd{M-y}; and @code{rotate-yank-pointer}, +which is used by the two other functions. + +These functions refer to the kill ring through a variable called the +@code{kill-ring-yank-pointer}. Indeed, the insertion code for both the +@code{yank} and @code{yank-pop} functions is: + +@smallexample +(insert (car kill-ring-yank-pointer)) +@end smallexample + +@noindent +(Well, no more. In GNU Emacs 22, the function has been replaced by +@code{insert-for-yank} which calls @code{insert-for-yank-1} +repetitively for each @code{yank-handler} segment. In turn, +@code{insert-for-yank-1} strips text properties from the inserted text +according to @code{yank-excluded-properties}. Otherwise, it is just +like @code{insert}. We will stick with plain @code{insert} since it +is easier to understand.) + +To begin to understand how @code{yank} and @code{yank-pop} work, it is +first necessary to look at the @code{kill-ring-yank-pointer} variable. + +@node kill-ring-yank-pointer, yank nthcdr Exercises, Kill Ring Overview, Yanking +@comment node-name, next, previous, up +@section The @code{kill-ring-yank-pointer} Variable + +@code{kill-ring-yank-pointer} is a variable, just as @code{kill-ring} is +a variable. It points to something by being bound to the value of what +it points to, like any other Lisp variable. + +@need 1000 +Thus, if the value of the kill ring is: + +@smallexample +("some text" "a different piece of text" "yet more text") +@end smallexample + +@need 1250 +@noindent +and the @code{kill-ring-yank-pointer} points to the second clause, the +value of @code{kill-ring-yank-pointer} is: + +@smallexample +("a different piece of text" "yet more text") +@end smallexample + +As explained in the previous chapter (@pxref{List Implementation}), the +computer does not keep two different copies of the text being pointed to +by both the @code{kill-ring} and the @code{kill-ring-yank-pointer}. The +words ``a different piece of text'' and ``yet more text'' are not +duplicated. Instead, the two Lisp variables point to the same pieces of +text. Here is a diagram: + +@c cons-cell-diagram #5 +@ifnottex +@smallexample +@group +kill-ring kill-ring-yank-pointer + | | + | ___ ___ | ___ ___ ___ ___ + ---> | | | --> | | | | | | + |___|___|----> |___|___|--> |___|___|--> nil + | | | + | | | + | | --> "yet more text" + | | + | --> "a different piece of text" + | + --> "some text" +@end group +@end smallexample +@sp 1 +@end ifnottex +@ifset print-postscript-figures +@sp 1 +@tex +@center @image{cons-5} +%%%% old method of including an image +% \input /usr/local/lib/tex/inputs/psfig.tex +% \centerline{\psfig{figure=/usr/local/lib/emacs/man/cons-5.eps}} +% \catcode`\@=0 % +@end tex +@sp 1 +@end ifset +@ifclear print-postscript-figures +@iftex +@smallexample +@group +kill-ring kill-ring-yank-pointer + | | + | ___ ___ | ___ ___ ___ ___ + ---> | | | --> | | | | | | + |___|___|----> |___|___|--> |___|___|--> nil + | | | + | | | + | | --> "yet more text" + | | + | --> "a different piece of text + | + --> "some text" +@end group +@end smallexample +@sp 1 +@end iftex +@end ifclear + +Both the variable @code{kill-ring} and the variable +@code{kill-ring-yank-pointer} are pointers. But the kill ring itself is +usually described as if it were actually what it is composed of. The +@code{kill-ring} is spoken of as if it were the list rather than that it +points to the list. Conversely, the @code{kill-ring-yank-pointer} is +spoken of as pointing to a list. + +These two ways of talking about the same thing sound confusing at first but +make sense on reflection. The kill ring is generally thought of as the +complete structure of data that holds the information of what has recently +been cut out of the Emacs buffers. The @code{kill-ring-yank-pointer} +on the other hand, serves to indicate---that is, to `point to'---that part +of the kill ring of which the first element (the @sc{car}) will be +inserted. + +@ignore +In GNU Emacs 22, the @code{kill-new} function calls + +@code{(setq kill-ring-yank-pointer kill-ring)} + +(defun rotate-yank-pointer (arg) + "Rotate the yanking point in the kill ring. +With argument, rotate that many kills forward (or backward, if negative)." + (interactive "p") + (current-kill arg)) + +(defun current-kill (n &optional do-not-move) + "Rotate the yanking point by N places, and then return that kill. +If N is zero, `interprogram-paste-function' is set, and calling it +returns a string, then that string is added to the front of the +kill ring and returned as the latest kill. +If optional arg DO-NOT-MOVE is non-nil, then don't actually move the +yanking point; just return the Nth kill forward." + (let ((interprogram-paste (and (= n 0) + interprogram-paste-function + (funcall interprogram-paste-function)))) + (if interprogram-paste + (progn + ;; Disable the interprogram cut function when we add the new + ;; text to the kill ring, so Emacs doesn't try to own the + ;; selection, with identical text. + (let ((interprogram-cut-function nil)) + (kill-new interprogram-paste)) + interprogram-paste) + (or kill-ring (error "Kill ring is empty")) + (let ((ARGth-kill-element + (nthcdr (mod (- n (length kill-ring-yank-pointer)) + (length kill-ring)) + kill-ring))) + (or do-not-move + (setq kill-ring-yank-pointer ARGth-kill-element)) + (car ARGth-kill-element))))) + +@end ignore + +@need 1500 +@node yank nthcdr Exercises, , kill-ring-yank-pointer, Yanking +@section Exercises with @code{yank} and @code{nthcdr} + +@itemize @bullet +@item +Using @kbd{C-h v} (@code{describe-variable}), look at the value of +your kill ring. Add several items to your kill ring; look at its +value again. Using @kbd{M-y} (@code{yank-pop)}, move all the way +around the kill ring. How many items were in your kill ring? Find +the value of @code{kill-ring-max}. Was your kill ring full, or could +you have kept more blocks of text within it? + +@item +Using @code{nthcdr} and @code{car}, construct a series of expressions +to return the first, second, third, and fourth elements of a list. +@end itemize + +@node Loops & Recursion, Regexp Search, Yanking, Top +@comment node-name, next, previous, up +@chapter Loops and Recursion +@cindex Loops and recursion +@cindex Recursion and loops +@cindex Repetition (loops) + +Emacs Lisp has two primary ways to cause an expression, or a series of +expressions, to be evaluated repeatedly: one uses a @code{while} +loop, and the other uses @dfn{recursion}. + +Repetition can be very valuable. For example, to move forward four +sentences, you need only write a program that will move forward one +sentence and then repeat the process four times. Since a computer does +not get bored or tired, such repetitive action does not have the +deleterious effects that excessive or the wrong kinds of repetition can +have on humans. + +People mostly write Emacs Lisp functions using @code{while} loops and +their kin; but you can use recursion, which provides a very powerful +way to think about and then to solve problems@footnote{You can write +recursive functions to be frugal or wasteful of mental or computer +resources; as it happens, methods that people find easy---that are +frugal of `mental resources'---sometimes use considerable computer +resources. Emacs was designed to run on machines that we now consider +limited and its default settings are conservative. You may want to +increase the values of @code{max-specpdl-size} and +@code{max-lisp-eval-depth}. In my @file{.emacs} file, I set them to +15 and 30 times their default value.}. + +@menu +* while:: Causing a stretch of code to repeat. +* dolist dotimes:: +* Recursion:: Causing a function to call itself. +* Looping exercise:: +@end menu + +@node while, dolist dotimes, Loops & Recursion, Loops & Recursion +@comment node-name, next, previous, up +@section @code{while} +@cindex Loops +@findex while + +The @code{while} special form tests whether the value returned by +evaluating its first argument is true or false. This is similar to what +the Lisp interpreter does with an @code{if}; what the interpreter does +next, however, is different. + +In a @code{while} expression, if the value returned by evaluating the +first argument is false, the Lisp interpreter skips the rest of the +expression (the @dfn{body} of the expression) and does not evaluate it. +However, if the value is true, the Lisp interpreter evaluates the body +of the expression and then again tests whether the first argument to +@code{while} is true or false. If the value returned by evaluating the +first argument is again true, the Lisp interpreter again evaluates the +body of the expression. + +@need 1200 +The template for a @code{while} expression looks like this: + +@smallexample +@group +(while @var{true-or-false-test} + @var{body}@dots{}) +@end group +@end smallexample + +@menu +* Looping with while:: Repeat so long as test returns true. +* Loop Example:: A @code{while} loop that uses a list. +* print-elements-of-list:: Uses @code{while}, @code{car}, @code{cdr}. +* Incrementing Loop:: A loop with an incrementing counter. +* Incrementing Loop Details:: +* Decrementing Loop:: A loop with a decrementing counter. +@end menu + +@node Looping with while, Loop Example, while, while +@ifnottex +@unnumberedsubsec Looping with @code{while} +@end ifnottex + +So long as the true-or-false-test of the @code{while} expression +returns a true value when it is evaluated, the body is repeatedly +evaluated. This process is called a loop since the Lisp interpreter +repeats the same thing again and again, like an airplane doing a loop. +When the result of evaluating the true-or-false-test is false, the +Lisp interpreter does not evaluate the rest of the @code{while} +expression and `exits the loop'. + +Clearly, if the value returned by evaluating the first argument to +@code{while} is always true, the body following will be evaluated +again and again @dots{} and again @dots{} forever. Conversely, if the +value returned is never true, the expressions in the body will never +be evaluated. The craft of writing a @code{while} loop consists of +choosing a mechanism such that the true-or-false-test returns true +just the number of times that you want the subsequent expressions to +be evaluated, and then have the test return false. + +The value returned by evaluating a @code{while} is the value of the +true-or-false-test. An interesting consequence of this is that a +@code{while} loop that evaluates without error will return @code{nil} +or false regardless of whether it has looped 1 or 100 times or none at +all. A @code{while} expression that evaluates successfully never +returns a true value! What this means is that @code{while} is always +evaluated for its side effects, which is to say, the consequences of +evaluating the expressions within the body of the @code{while} loop. +This makes sense. It is not the mere act of looping that is desired, +but the consequences of what happens when the expressions in the loop +are repeatedly evaluated. + +@node Loop Example, print-elements-of-list, Looping with while, while +@comment node-name, next, previous, up +@subsection A @code{while} Loop and a List + +A common way to control a @code{while} loop is to test whether a list +has any elements. If it does, the loop is repeated; but if it does not, +the repetition is ended. Since this is an important technique, we will +create a short example to illustrate it. + +A simple way to test whether a list has elements is to evaluate the +list: if it has no elements, it is an empty list and will return the +empty list, @code{()}, which is a synonym for @code{nil} or false. On +the other hand, a list with elements will return those elements when it +is evaluated. Since Emacs Lisp considers as true any value that is not +@code{nil}, a list that returns elements will test true in a +@code{while} loop. + +@need 1200 +For example, you can set the variable @code{empty-list} to @code{nil} by +evaluating the following @code{setq} expression: + +@smallexample +(setq empty-list ()) +@end smallexample + +@noindent +After evaluating the @code{setq} expression, you can evaluate the +variable @code{empty-list} in the usual way, by placing the cursor after +the symbol and typing @kbd{C-x C-e}; @code{nil} will appear in your +echo area: + +@smallexample +empty-list +@end smallexample + +On the other hand, if you set a variable to be a list with elements, the +list will appear when you evaluate the variable, as you can see by +evaluating the following two expressions: + +@smallexample +@group +(setq animals '(gazelle giraffe lion tiger)) + +animals +@end group +@end smallexample + +Thus, to create a @code{while} loop that tests whether there are any +items in the list @code{animals}, the first part of the loop will be +written like this: + +@smallexample +@group +(while animals + @dots{} +@end group +@end smallexample + +@noindent +When the @code{while} tests its first argument, the variable +@code{animals} is evaluated. It returns a list. So long as the list +has elements, the @code{while} considers the results of the test to be +true; but when the list is empty, it considers the results of the test +to be false. + +To prevent the @code{while} loop from running forever, some mechanism +needs to be provided to empty the list eventually. An oft-used +technique is to have one of the subsequent forms in the @code{while} +expression set the value of the list to be the @sc{cdr} of the list. +Each time the @code{cdr} function is evaluated, the list will be made +shorter, until eventually only the empty list will be left. At this +point, the test of the @code{while} loop will return false, and the +arguments to the @code{while} will no longer be evaluated. + +For example, the list of animals bound to the variable @code{animals} +can be set to be the @sc{cdr} of the original list with the +following expression: + +@smallexample +(setq animals (cdr animals)) +@end smallexample + +@noindent +If you have evaluated the previous expressions and then evaluate this +expression, you will see @code{(giraffe lion tiger)} appear in the echo +area. If you evaluate the expression again, @code{(lion tiger)} will +appear in the echo area. If you evaluate it again and yet again, +@code{(tiger)} appears and then the empty list, shown by @code{nil}. + +A template for a @code{while} loop that uses the @code{cdr} function +repeatedly to cause the true-or-false-test eventually to test false +looks like this: + +@smallexample +@group +(while @var{test-whether-list-is-empty} + @var{body}@dots{} + @var{set-list-to-cdr-of-list}) +@end group +@end smallexample + +This test and use of @code{cdr} can be put together in a function that +goes through a list and prints each element of the list on a line of its +own. + +@node print-elements-of-list, Incrementing Loop, Loop Example, while +@subsection An Example: @code{print-elements-of-list} +@findex print-elements-of-list + +The @code{print-elements-of-list} function illustrates a @code{while} +loop with a list. + +@cindex @file{*scratch*} buffer +The function requires several lines for its output. If you are +reading this in a recent instance of GNU Emacs, +@c GNU Emacs 21, GNU Emacs 22, or a later version, +you can evaluate the following expression inside of Info, as usual. + +If you are using an earlier version of Emacs, you need to copy the +necessary expressions to your @file{*scratch*} buffer and evaluate +them there. This is because the echo area had only one line in the +earlier versions. + +You can copy the expressions by marking the beginning of the region +with @kbd{C-@key{SPC}} (@code{set-mark-command}), moving the cursor to +the end of the region and then copying the region using @kbd{M-w} +(@code{kill-ring-save}, which calls @code{copy-region-as-kill} and +then provides visual feedback). In the @file{*scratch*} +buffer, you can yank the expressions back by typing @kbd{C-y} +(@code{yank}). + +After you have copied the expressions to the @file{*scratch*} buffer, +evaluate each expression in turn. Be sure to evaluate the last +expression, @code{(print-elements-of-list animals)}, by typing +@kbd{C-u C-x C-e}, that is, by giving an argument to +@code{eval-last-sexp}. This will cause the result of the evaluation +to be printed in the @file{*scratch*} buffer instead of being printed +in the echo area. (Otherwise you will see something like this in your +echo area: @code{^Jgazelle^J^Jgiraffe^J^Jlion^J^Jtiger^Jnil}, in which +each @samp{^J} stands for a `newline'.) + +@need 1500 +In a recent instance of GNU Emacs, you can evaluate these expressions +directly in the Info buffer, and the echo area will grow to show the +results. + +@smallexample +@group +(setq animals '(gazelle giraffe lion tiger)) + +(defun print-elements-of-list (list) + "Print each element of LIST on a line of its own." + (while list + (print (car list)) + (setq list (cdr list)))) + +(print-elements-of-list animals) +@end group +@end smallexample + +@need 1200 +@noindent +When you evaluate the three expressions in sequence, you will see +this: + +@smallexample +@group +gazelle + +giraffe + +lion + +tiger +nil +@end group +@end smallexample + +Each element of the list is printed on a line of its own (that is what +the function @code{print} does) and then the value returned by the +function is printed. Since the last expression in the function is the +@code{while} loop, and since @code{while} loops always return +@code{nil}, a @code{nil} is printed after the last element of the list. + +@node Incrementing Loop, Incrementing Loop Details, print-elements-of-list, while +@comment node-name, next, previous, up +@subsection A Loop with an Incrementing Counter + +A loop is not useful unless it stops when it ought. Besides +controlling a loop with a list, a common way of stopping a loop is to +write the first argument as a test that returns false when the correct +number of repetitions are complete. This means that the loop must +have a counter---an expression that counts how many times the loop +repeats itself. + +@node Incrementing Loop Details, Decrementing Loop, Incrementing Loop, while +@ifnottex +@unnumberedsubsec Details of an Incrementing Loop +@end ifnottex + +The test for a loop with an incrementing counter can be an expression +such as @code{(< count desired-number)} which returns @code{t} for +true if the value of @code{count} is less than the +@code{desired-number} of repetitions and @code{nil} for false if the +value of @code{count} is equal to or is greater than the +@code{desired-number}. The expression that increments the count can +be a simple @code{setq} such as @code{(setq count (1+ count))}, where +@code{1+} is a built-in function in Emacs Lisp that adds 1 to its +argument. (The expression @w{@code{(1+ count)}} has the same result +as @w{@code{(+ count 1)}}, but is easier for a human to read.) + +@need 1250 +The template for a @code{while} loop controlled by an incrementing +counter looks like this: + +@smallexample +@group +@var{set-count-to-initial-value} +(while (< count desired-number) ; @r{true-or-false-test} + @var{body}@dots{} + (setq count (1+ count))) ; @r{incrementer} +@end group +@end smallexample + +@noindent +Note that you need to set the initial value of @code{count}; usually it +is set to 1. + +@menu +* Incrementing Example:: Counting pebbles in a triangle. +* Inc Example parts:: The parts of the function definition. +* Inc Example altogether:: Putting the function definition together. +@end menu + +@node Incrementing Example, Inc Example parts, Incrementing Loop Details, Incrementing Loop Details +@unnumberedsubsubsec Example with incrementing counter + +Suppose you are playing on the beach and decide to make a triangle of +pebbles, putting one pebble in the first row, two in the second row, +three in the third row and so on, like this: + +@sp 1 +@c pebble diagram +@ifnottex +@smallexample +@group + * + * * + * * * + * * * * +@end group +@end smallexample +@end ifnottex +@iftex +@smallexample +@group + @bullet{} + @bullet{} @bullet{} + @bullet{} @bullet{} @bullet{} + @bullet{} @bullet{} @bullet{} @bullet{} +@end group +@end smallexample +@end iftex +@sp 1 + +@noindent +(About 2500 years ago, Pythagoras and others developed the beginnings of +number theory by considering questions such as this.) + +Suppose you want to know how many pebbles you will need to make a +triangle with 7 rows? + +Clearly, what you need to do is add up the numbers from 1 to 7. There +are two ways to do this; start with the smallest number, one, and add up +the list in sequence, 1, 2, 3, 4 and so on; or start with the largest +number and add the list going down: 7, 6, 5, 4 and so on. Because both +mechanisms illustrate common ways of writing @code{while} loops, we will +create two examples, one counting up and the other counting down. In +this first example, we will start with 1 and add 2, 3, 4 and so on. + +If you are just adding up a short list of numbers, the easiest way to do +it is to add up all the numbers at once. However, if you do not know +ahead of time how many numbers your list will have, or if you want to be +prepared for a very long list, then you need to design your addition so +that what you do is repeat a simple process many times instead of doing +a more complex process once. + +For example, instead of adding up all the pebbles all at once, what you +can do is add the number of pebbles in the first row, 1, to the number +in the second row, 2, and then add the total of those two rows to the +third row, 3. Then you can add the number in the fourth row, 4, to the +total of the first three rows; and so on. + +The critical characteristic of the process is that each repetitive +action is simple. In this case, at each step we add only two numbers, +the number of pebbles in the row and the total already found. This +process of adding two numbers is repeated again and again until the last +row has been added to the total of all the preceding rows. In a more +complex loop the repetitive action might not be so simple, but it will +be simpler than doing everything all at once. + +@node Inc Example parts, Inc Example altogether, Incrementing Example, Incrementing Loop Details +@unnumberedsubsubsec The parts of the function definition + +The preceding analysis gives us the bones of our function definition: +first, we will need a variable that we can call @code{total} that will +be the total number of pebbles. This will be the value returned by +the function. + +Second, we know that the function will require an argument: this +argument will be the total number of rows in the triangle. It can be +called @code{number-of-rows}. + +Finally, we need a variable to use as a counter. We could call this +variable @code{counter}, but a better name is @code{row-number}. That +is because what the counter does in this function is count rows, and a +program should be written to be as understandable as possible. + +When the Lisp interpreter first starts evaluating the expressions in the +function, the value of @code{total} should be set to zero, since we have +not added anything to it. Then the function should add the number of +pebbles in the first row to the total, and then add the number of +pebbles in the second to the total, and then add the number of +pebbles in the third row to the total, and so on, until there are no +more rows left to add. + +Both @code{total} and @code{row-number} are used only inside the +function, so they can be declared as local variables with @code{let} +and given initial values. Clearly, the initial value for @code{total} +should be 0. The initial value of @code{row-number} should be 1, +since we start with the first row. This means that the @code{let} +statement will look like this: + +@smallexample +@group + (let ((total 0) + (row-number 1)) + @var{body}@dots{}) +@end group +@end smallexample + +After the internal variables are declared and bound to their initial +values, we can begin the @code{while} loop. The expression that serves +as the test should return a value of @code{t} for true so long as the +@code{row-number} is less than or equal to the @code{number-of-rows}. +(If the expression tests true only so long as the row number is less +than the number of rows in the triangle, the last row will never be +added to the total; hence the row number has to be either less than or +equal to the number of rows.) + +@need 1500 +@findex <= @r{(less than or equal)} +Lisp provides the @code{<=} function that returns true if the value of +its first argument is less than or equal to the value of its second +argument and false otherwise. So the expression that the @code{while} +will evaluate as its test should look like this: + +@smallexample +(<= row-number number-of-rows) +@end smallexample + +The total number of pebbles can be found by repeatedly adding the number +of pebbles in a row to the total already found. Since the number of +pebbles in the row is equal to the row number, the total can be found by +adding the row number to the total. (Clearly, in a more complex +situation, the number of pebbles in the row might be related to the row +number in a more complicated way; if this were the case, the row number +would be replaced by the appropriate expression.) + +@smallexample +(setq total (+ total row-number)) +@end smallexample + +@noindent +What this does is set the new value of @code{total} to be equal to the +sum of adding the number of pebbles in the row to the previous total. + +After setting the value of @code{total}, the conditions need to be +established for the next repetition of the loop, if there is one. This +is done by incrementing the value of the @code{row-number} variable, +which serves as a counter. After the @code{row-number} variable has +been incremented, the true-or-false-test at the beginning of the +@code{while} loop tests whether its value is still less than or equal to +the value of the @code{number-of-rows} and if it is, adds the new value +of the @code{row-number} variable to the @code{total} of the previous +repetition of the loop. + +@need 1200 +The built-in Emacs Lisp function @code{1+} adds 1 to a number, so the +@code{row-number} variable can be incremented with this expression: + +@smallexample +(setq row-number (1+ row-number)) +@end smallexample + +@node Inc Example altogether, , Inc Example parts, Incrementing Loop Details +@unnumberedsubsubsec Putting the function definition together + +We have created the parts for the function definition; now we need to +put them together. + +@need 800 +First, the contents of the @code{while} expression: + +@smallexample +@group +(while (<= row-number number-of-rows) ; @r{true-or-false-test} + (setq total (+ total row-number)) + (setq row-number (1+ row-number))) ; @r{incrementer} +@end group +@end smallexample + +Along with the @code{let} expression varlist, this very nearly +completes the body of the function definition. However, it requires +one final element, the need for which is somewhat subtle. + +The final touch is to place the variable @code{total} on a line by +itself after the @code{while} expression. Otherwise, the value returned +by the whole function is the value of the last expression that is +evaluated in the body of the @code{let}, and this is the value +returned by the @code{while}, which is always @code{nil}. + +This may not be evident at first sight. It almost looks as if the +incrementing expression is the last expression of the whole function. +But that expression is part of the body of the @code{while}; it is the +last element of the list that starts with the symbol @code{while}. +Moreover, the whole of the @code{while} loop is a list within the body +of the @code{let}. + +@need 1250 +In outline, the function will look like this: + +@smallexample +@group +(defun @var{name-of-function} (@var{argument-list}) + "@var{documentation}@dots{}" + (let (@var{varlist}) + (while (@var{true-or-false-test}) + @var{body-of-while}@dots{} ) + @dots{} )) ; @r{Need final expression here.} +@end group +@end smallexample + +The result of evaluating the @code{let} is what is going to be returned +by the @code{defun} since the @code{let} is not embedded within any +containing list, except for the @code{defun} as a whole. However, if +the @code{while} is the last element of the @code{let} expression, the +function will always return @code{nil}. This is not what we want! +Instead, what we want is the value of the variable @code{total}. This +is returned by simply placing the symbol as the last element of the list +starting with @code{let}. It gets evaluated after the preceding +elements of the list are evaluated, which means it gets evaluated after +it has been assigned the correct value for the total. + +It may be easier to see this by printing the list starting with +@code{let} all on one line. This format makes it evident that the +@var{varlist} and @code{while} expressions are the second and third +elements of the list starting with @code{let}, and the @code{total} is +the last element: + +@smallexample +@group +(let (@var{varlist}) (while (@var{true-or-false-test}) @var{body-of-while}@dots{} ) total) +@end group +@end smallexample + +@need 1200 +Putting everything together, the @code{triangle} function definition +looks like this: + +@smallexample +@group +(defun triangle (number-of-rows) ; @r{Version with} + ; @r{ incrementing counter.} + "Add up the number of pebbles in a triangle. +The first row has one pebble, the second row two pebbles, +the third row three pebbles, and so on. +The argument is NUMBER-OF-ROWS." +@end group +@group + (let ((total 0) + (row-number 1)) + (while (<= row-number number-of-rows) + (setq total (+ total row-number)) + (setq row-number (1+ row-number))) + total)) +@end group +@end smallexample + +@need 1200 +After you have installed @code{triangle} by evaluating the function, you +can try it out. Here are two examples: + +@smallexample +@group +(triangle 4) + +(triangle 7) +@end group +@end smallexample + +@noindent +The sum of the first four numbers is 10 and the sum of the first seven +numbers is 28. + +@node Decrementing Loop, , Incrementing Loop Details, while +@comment node-name, next, previous, up +@subsection Loop with a Decrementing Counter + +Another common way to write a @code{while} loop is to write the test +so that it determines whether a counter is greater than zero. So long +as the counter is greater than zero, the loop is repeated. But when +the counter is equal to or less than zero, the loop is stopped. For +this to work, the counter has to start out greater than zero and then +be made smaller and smaller by a form that is evaluated +repeatedly. + +The test will be an expression such as @code{(> counter 0)} which +returns @code{t} for true if the value of @code{counter} is greater +than zero, and @code{nil} for false if the value of @code{counter} is +equal to or less than zero. The expression that makes the number +smaller and smaller can be a simple @code{setq} such as @code{(setq +counter (1- counter))}, where @code{1-} is a built-in function in +Emacs Lisp that subtracts 1 from its argument. + +@need 1250 +The template for a decrementing @code{while} loop looks like this: + +@smallexample +@group +(while (> counter 0) ; @r{true-or-false-test} + @var{body}@dots{} + (setq counter (1- counter))) ; @r{decrementer} +@end group +@end smallexample + +@menu +* Decrementing Example:: More pebbles on the beach. +* Dec Example parts:: The parts of the function definition. +* Dec Example altogether:: Putting the function definition together. +@end menu + +@node Decrementing Example, Dec Example parts, Decrementing Loop, Decrementing Loop +@unnumberedsubsubsec Example with decrementing counter + +To illustrate a loop with a decrementing counter, we will rewrite the +@code{triangle} function so the counter decreases to zero. + +This is the reverse of the earlier version of the function. In this +case, to find out how many pebbles are needed to make a triangle with +3 rows, add the number of pebbles in the third row, 3, to the number +in the preceding row, 2, and then add the total of those two rows to +the row that precedes them, which is 1. + +Likewise, to find the number of pebbles in a triangle with 7 rows, add +the number of pebbles in the seventh row, 7, to the number in the +preceding row, which is 6, and then add the total of those two rows to +the row that precedes them, which is 5, and so on. As in the previous +example, each addition only involves adding two numbers, the total of +the rows already added up and the number of pebbles in the row that is +being added to the total. This process of adding two numbers is +repeated again and again until there are no more pebbles to add. + +We know how many pebbles to start with: the number of pebbles in the +last row is equal to the number of rows. If the triangle has seven +rows, the number of pebbles in the last row is 7. Likewise, we know how +many pebbles are in the preceding row: it is one less than the number in +the row. + +@node Dec Example parts, Dec Example altogether, Decrementing Example, Decrementing Loop +@unnumberedsubsubsec The parts of the function definition + +We start with three variables: the total number of rows in the +triangle; the number of pebbles in a row; and the total number of +pebbles, which is what we want to calculate. These variables can be +named @code{number-of-rows}, @code{number-of-pebbles-in-row}, and +@code{total}, respectively. + +Both @code{total} and @code{number-of-pebbles-in-row} are used only +inside the function and are declared with @code{let}. The initial +value of @code{total} should, of course, be zero. However, the +initial value of @code{number-of-pebbles-in-row} should be equal to +the number of rows in the triangle, since the addition will start with +the longest row. + +@need 1250 +This means that the beginning of the @code{let} expression will look +like this: + +@smallexample +@group +(let ((total 0) + (number-of-pebbles-in-row number-of-rows)) + @var{body}@dots{}) +@end group +@end smallexample + +The total number of pebbles can be found by repeatedly adding the number +of pebbles in a row to the total already found, that is, by repeatedly +evaluating the following expression: + +@smallexample +(setq total (+ total number-of-pebbles-in-row)) +@end smallexample + +@noindent +After the @code{number-of-pebbles-in-row} is added to the @code{total}, +the @code{number-of-pebbles-in-row} should be decremented by one, since +the next time the loop repeats, the preceding row will be +added to the total. + +The number of pebbles in a preceding row is one less than the number of +pebbles in a row, so the built-in Emacs Lisp function @code{1-} can be +used to compute the number of pebbles in the preceding row. This can be +done with the following expression: + +@smallexample +@group +(setq number-of-pebbles-in-row + (1- number-of-pebbles-in-row)) +@end group +@end smallexample + +Finally, we know that the @code{while} loop should stop making repeated +additions when there are no pebbles in a row. So the test for +the @code{while} loop is simply: + +@smallexample +(while (> number-of-pebbles-in-row 0) +@end smallexample + +@node Dec Example altogether, , Dec Example parts, Decrementing Loop +@unnumberedsubsubsec Putting the function definition together + +We can put these expressions together to create a function definition +that works. However, on examination, we find that one of the local +variables is unneeded! + +@need 1250 +The function definition looks like this: + +@smallexample +@group +;;; @r{First subtractive version.} +(defun triangle (number-of-rows) + "Add up the number of pebbles in a triangle." + (let ((total 0) + (number-of-pebbles-in-row number-of-rows)) + (while (> number-of-pebbles-in-row 0) + (setq total (+ total number-of-pebbles-in-row)) + (setq number-of-pebbles-in-row + (1- number-of-pebbles-in-row))) + total)) +@end group +@end smallexample + +As written, this function works. + +However, we do not need @code{number-of-pebbles-in-row}. + +@cindex Argument as local variable +When the @code{triangle} function is evaluated, the symbol +@code{number-of-rows} will be bound to a number, giving it an initial +value. That number can be changed in the body of the function as if +it were a local variable, without any fear that such a change will +effect the value of the variable outside of the function. This is a +very useful characteristic of Lisp; it means that the variable +@code{number-of-rows} can be used anywhere in the function where +@code{number-of-pebbles-in-row} is used. + +@need 800 +Here is a second version of the function written a bit more cleanly: + +@smallexample +@group +(defun triangle (number) ; @r{Second version.} + "Return sum of numbers 1 through NUMBER inclusive." + (let ((total 0)) + (while (> number 0) + (setq total (+ total number)) + (setq number (1- number))) + total)) +@end group +@end smallexample + +In brief, a properly written @code{while} loop will consist of three parts: + +@enumerate +@item +A test that will return false after the loop has repeated itself the +correct number of times. + +@item +An expression the evaluation of which will return the value desired +after being repeatedly evaluated. + +@item +An expression to change the value passed to the true-or-false-test so +that the test returns false after the loop has repeated itself the right +number of times. +@end enumerate + +@node dolist dotimes, Recursion, while, Loops & Recursion +@comment node-name, next, previous, up +@section Save your time: @code{dolist} and @code{dotimes} + +In addition to @code{while}, both @code{dolist} and @code{dotimes} +provide for looping. Sometimes these are quicker to write than the +equivalent @code{while} loop. Both are Lisp macros. (@xref{Macros, , +Macros, elisp, The GNU Emacs Lisp Reference Manual}. ) + +@code{dolist} works like a @code{while} loop that `@sc{cdr}s down a +list': @code{dolist} automatically shortens the list each time it +loops---takes the @sc{cdr} of the list---and binds the @sc{car} of +each shorter version of the list to the first of its arguments. + +@code{dotimes} loops a specific number of times: you specify the number. + +@menu +* dolist:: +* dotimes:: +@end menu + +@node dolist, dotimes, dolist dotimes, dolist dotimes +@unnumberedsubsubsec The @code{dolist} Macro +@findex dolist + +Suppose, for example, you want to reverse a list, so that +``first'' ``second'' ``third'' becomes ``third'' ``second'' ``first''. + +@need 1250 +In practice, you would use the @code{reverse} function, like this: + +@smallexample +@group +(setq animals '(gazelle giraffe lion tiger)) + +(reverse animals) +@end group +@end smallexample + +@need 800 +@noindent +Here is how you could reverse the list using a @code{while} loop: + +@smallexample +@group +(setq animals '(gazelle giraffe lion tiger)) + +(defun reverse-list-with-while (list) + "Using while, reverse the order of LIST." + (let (value) ; make sure list starts empty + (while list + (setq value (cons (car list) value)) + (setq list (cdr list))) + value)) + +(reverse-list-with-while animals) +@end group +@end smallexample + +@need 800 +@noindent +And here is how you could use the @code{dolist} macro: + +@smallexample +@group +(setq animals '(gazelle giraffe lion tiger)) + +(defun reverse-list-with-dolist (list) + "Using dolist, reverse the order of LIST." + (let (value) ; make sure list starts empty + (dolist (element list value) + (setq value (cons element value))))) + +(reverse-list-with-dolist animals) +@end group +@end smallexample + +@need 1250 +@noindent +In Info, you can place your cursor after the closing parenthesis of +each expression and type @kbd{C-x C-e}; in each case, you should see + +@smallexample +(tiger lion giraffe gazelle) +@end smallexample + +@noindent +in the echo area. + +For this example, the existing @code{reverse} function is obviously best. +The @code{while} loop is just like our first example (@pxref{Loop +Example, , A @code{while} Loop and a List}). The @code{while} first +checks whether the list has elements; if so, it constructs a new list +by adding the first element of the list to the existing list (which in +the first iteration of the loop is @code{nil}). Since the second +element is prepended in front of the first element, and the third +element is prepended in front of the second element, the list is reversed. + +In the expression using a @code{while} loop, +the @w{@code{(setq list (cdr list))}} +expression shortens the list, so the @code{while} loop eventually +stops. In addition, it provides the @code{cons} expression with a new +first element by creating a new and shorter list at each repetition of +the loop. + +The @code{dolist} expression does very much the same as the +@code{while} expression, except that the @code{dolist} macro does some +of the work you have to do when writing a @code{while} expression. + +Like a @code{while} loop, a @code{dolist} loops. What is different is +that it automatically shortens the list each time it loops --- it +`@sc{cdr}s down the list' on its own --- and it automatically binds +the @sc{car} of each shorter version of the list to the first of its +arguments. + +In the example, the @sc{car} of each shorter version of the list is +referred to using the symbol @samp{element}, the list itself is called +@samp{list}, and the value returned is called @samp{value}. The +remainder of the @code{dolist} expression is the body. + +The @code{dolist} expression binds the @sc{car} of each shorter +version of the list to @code{element} and then evaluates the body of +the expression; and repeats the loop. The result is returned in +@code{value}. + +@node dotimes, , dolist, dolist dotimes +@unnumberedsubsubsec The @code{dotimes} Macro +@findex dotimes + +The @code{dotimes} macro is similar to @code{dolist}, except that it +loops a specific number of times. + +The first argument to @code{dotimes} is assigned the numbers 0, 1, 2 +and so forth each time around the loop, and the value of the third +argument is returned. You need to provide the value of the second +argument, which is how many times the macro loops. + +@need 1250 +For example, the following binds the numbers from 0 up to, but not +including, the number 3 to the first argument, @var{number}, and then +constructs a list of the three numbers. (The first number is 0, the +second number is 1, and the third number is 2; this makes a total of +three numbers in all, starting with zero as the first number.) + +@smallexample +@group +(let (value) ; otherwise a value is a void variable + (dotimes (number 3 value) + (setq value (cons number value)))) + +@result{} (2 1 0) +@end group +@end smallexample + +@noindent +@code{dotimes} returns @code{value}, so the way to use +@code{dotimes} is to operate on some expression @var{number} number of +times and then return the result, either as a list or an atom. + +@need 1250 +Here is an example of a @code{defun} that uses @code{dotimes} to add +up the number of pebbles in a triangle. + +@smallexample +@group +(defun triangle-using-dotimes (number-of-rows) + "Using dotimes, add up the number of pebbles in a triangle." +(let ((total 0)) ; otherwise a total is a void variable + (dotimes (number number-of-rows total) + (setq total (+ total (1+ number)))))) + +(triangle-using-dotimes 4) +@end group +@end smallexample + +@node Recursion, Looping exercise, dolist dotimes, Loops & Recursion +@comment node-name, next, previous, up +@section Recursion +@cindex Recursion + +A recursive function contains code that tells the Lisp interpreter to +call a program that runs exactly like itself, but with slightly +different arguments. The code runs exactly the same because it has +the same name. However, even though the program has the same name, it +is not the same entity. It is different. In the jargon, it is a +different `instance'. + +Eventually, if the program is written correctly, the `slightly +different arguments' will become sufficiently different from the first +arguments that the final instance will stop. + +@menu +* Building Robots:: Same model, different serial number ... +* Recursive Definition Parts:: Walk until you stop ... +* Recursion with list:: Using a list as the test whether to recurse. +* Recursive triangle function:: +* Recursion with cond:: +* Recursive Patterns:: Often used templates. +* No Deferment:: Don't store up work ... +* No deferment solution:: +@end menu + +@node Building Robots, Recursive Definition Parts, Recursion, Recursion +@comment node-name, next, previous, up +@subsection Building Robots: Extending the Metaphor +@cindex Building robots +@cindex Robots, building + +It is sometimes helpful to think of a running program as a robot that +does a job. In doing its job, a recursive function calls on a second +robot to help it. The second robot is identical to the first in every +way, except that the second robot helps the first and has been +passed different arguments than the first. + +In a recursive function, the second robot may call a third; and the +third may call a fourth, and so on. Each of these is a different +entity; but all are clones. + +Since each robot has slightly different instructions---the arguments +will differ from one robot to the next---the last robot should know +when to stop. + +Let's expand on the metaphor in which a computer program is a robot. + +A function definition provides the blueprints for a robot. When you +install a function definition, that is, when you evaluate a +@code{defun} special form, you install the necessary equipment to +build robots. It is as if you were in a factory, setting up an +assembly line. Robots with the same name are built according to the +same blueprints. So they have, as it were, the same `model number', +but a different `serial number'. + +We often say that a recursive function `calls itself'. What we mean +is that the instructions in a recursive function cause the Lisp +interpreter to run a different function that has the same name and +does the same job as the first, but with different arguments. + +It is important that the arguments differ from one instance to the +next; otherwise, the process will never stop. + +@node Recursive Definition Parts, Recursion with list, Building Robots, Recursion +@comment node-name, next, previous, up +@subsection The Parts of a Recursive Definition +@cindex Parts of a Recursive Definition +@cindex Recursive Definition Parts + +A recursive function typically contains a conditional expression which +has three parts: + +@enumerate +@item +A true-or-false-test that determines whether the function is called +again, here called the @dfn{do-again-test}. + +@item +The name of the function. When this name is called, a new instance of +the function---a new robot, as it were---is created and told what to do. + +@item +An expression that returns a different value each time the function is +called, here called the @dfn{next-step-expression}. Consequently, the +argument (or arguments) passed to the new instance of the function +will be different from that passed to the previous instance. This +causes the conditional expression, the @dfn{do-again-test}, to test +false after the correct number of repetitions. +@end enumerate + +Recursive functions can be much simpler than any other kind of +function. Indeed, when people first start to use them, they often look +so mysteriously simple as to be incomprehensible. Like riding a +bicycle, reading a recursive function definition takes a certain knack +which is hard at first but then seems simple. + +@need 1200 +There are several different common recursive patterns. A very simple +pattern looks like this: + +@smallexample +@group +(defun @var{name-of-recursive-function} (@var{argument-list}) + "@var{documentation}@dots{}" + (if @var{do-again-test} + @var{body}@dots{} + (@var{name-of-recursive-function} + @var{next-step-expression}))) +@end group +@end smallexample + +Each time a recursive function is evaluated, a new instance of it is +created and told what to do. The arguments tell the instance what to do. + +An argument is bound to the value of the next-step-expression. Each +instance runs with a different value of the next-step-expression. + +The value in the next-step-expression is used in the do-again-test. + +The value returned by the next-step-expression is passed to the new +instance of the function, which evaluates it (or some +transmogrification of it) to determine whether to continue or stop. +The next-step-expression is designed so that the do-again-test returns +false when the function should no longer be repeated. + +The do-again-test is sometimes called the @dfn{stop condition}, +since it stops the repetitions when it tests false. + +@node Recursion with list, Recursive triangle function, Recursive Definition Parts, Recursion +@comment node-name, next, previous, up +@subsection Recursion with a List + +The example of a @code{while} loop that printed the elements of a list +of numbers can be written recursively. Here is the code, including +an expression to set the value of the variable @code{animals} to a list. + +If you are using GNU Emacs 20 or before, this example must be copied +to the @file{*scratch*} buffer and each expression must be evaluated +there. Use @kbd{C-u C-x C-e} to evaluate the +@code{(print-elements-recursively animals)} expression so that the +results are printed in the buffer; otherwise the Lisp interpreter will +try to squeeze the results into the one line of the echo area. + +Also, place your cursor immediately after the last closing parenthesis +of the @code{print-elements-recursively} function, before the comment. +Otherwise, the Lisp interpreter will try to evaluate the comment. + +If you are using a more recent version of Emacs, you can evaluate this +expression directly in Info. + +@findex print-elements-recursively +@smallexample +@group +(setq animals '(gazelle giraffe lion tiger)) + +(defun print-elements-recursively (list) + "Print each element of LIST on a line of its own. +Uses recursion." + (when list ; @r{do-again-test} + (print (car list)) ; @r{body} + (print-elements-recursively ; @r{recursive call} + (cdr list)))) ; @r{next-step-expression} + +(print-elements-recursively animals) +@end group +@end smallexample + +The @code{print-elements-recursively} function first tests whether +there is any content in the list; if there is, the function prints the +first element of the list, the @sc{car} of the list. Then the +function `invokes itself', but gives itself as its argument, not the +whole list, but the second and subsequent elements of the list, the +@sc{cdr} of the list. + +Put another way, if the list is not empty, the function invokes +another instance of code that is similar to the initial code, but is a +different thread of execution, with different arguments than the first +instance. + +Put in yet another way, if the list is not empty, the first robot +assemblies a second robot and tells it what to do; the second robot is +a different individual from the first, but is the same model. + +When the second evaluation occurs, the @code{when} expression is +evaluated and if true, prints the first element of the list it +receives as its argument (which is the second element of the original +list). Then the function `calls itself' with the @sc{cdr} of the list +it is invoked with, which (the second time around) is the @sc{cdr} of +the @sc{cdr} of the original list. + +Note that although we say that the function `calls itself', what we +mean is that the Lisp interpreter assembles and instructs a new +instance of the program. The new instance is a clone of the first, +but is a separate individual. + +Each time the function `invokes itself', it invokes itself on a +shorter version of the original list. It creates a new instance that +works on a shorter list. + +Eventually, the function invokes itself on an empty list. It creates +a new instance whose argument is @code{nil}. The conditional expression +tests the value of @code{list}. Since the value of @code{list} is +@code{nil}, the @code{when} expression tests false so the then-part is +not evaluated. The function as a whole then returns @code{nil}. + +@need 1200 +When you evaluate @code{(print-elements-recursively animals)} in the +@file{*scratch*} buffer, you see this result: + +@smallexample +@group +gazelle + +giraffe + +lion + +tiger +nil +@end group +@end smallexample + +@need 2000 +@node Recursive triangle function, Recursion with cond, Recursion with list, Recursion +@comment node-name, next, previous, up +@subsection Recursion in Place of a Counter +@findex triangle-recursively + +@need 1200 +The @code{triangle} function described in a previous section can also +be written recursively. It looks like this: + +@smallexample +@group +(defun triangle-recursively (number) + "Return the sum of the numbers 1 through NUMBER inclusive. +Uses recursion." + (if (= number 1) ; @r{do-again-test} + 1 ; @r{then-part} + (+ number ; @r{else-part} + (triangle-recursively ; @r{recursive call} + (1- number))))) ; @r{next-step-expression} + +(triangle-recursively 7) +@end group +@end smallexample + +@noindent +You can install this function by evaluating it and then try it by +evaluating @code{(triangle-recursively 7)}. (Remember to put your +cursor immediately after the last parenthesis of the function +definition, before the comment.) The function evaluates to 28. + +To understand how this function works, let's consider what happens in the +various cases when the function is passed 1, 2, 3, or 4 as the value of +its argument. + +@menu +* Recursive Example arg of 1 or 2:: +* Recursive Example arg of 3 or 4:: +@end menu + +@node Recursive Example arg of 1 or 2, Recursive Example arg of 3 or 4, Recursive triangle function, Recursive triangle function +@ifnottex +@unnumberedsubsubsec An argument of 1 or 2 +@end ifnottex + +First, what happens if the value of the argument is 1? + +The function has an @code{if} expression after the documentation +string. It tests whether the value of @code{number} is equal to 1; if +so, Emacs evaluates the then-part of the @code{if} expression, which +returns the number 1 as the value of the function. (A triangle with +one row has one pebble in it.) + +Suppose, however, that the value of the argument is 2. In this case, +Emacs evaluates the else-part of the @code{if} expression. + +@need 1200 +The else-part consists of an addition, the recursive call to +@code{triangle-recursively} and a decrementing action; and it looks like +this: + +@smallexample +(+ number (triangle-recursively (1- number))) +@end smallexample + +When Emacs evaluates this expression, the innermost expression is +evaluated first; then the other parts in sequence. Here are the steps +in detail: + +@table @i +@item Step 1 @w{ } Evaluate the innermost expression. + +The innermost expression is @code{(1- number)} so Emacs decrements the +value of @code{number} from 2 to 1. + +@item Step 2 @w{ } Evaluate the @code{triangle-recursively} function. + +The Lisp interpreter creates an individual instance of +@code{triangle-recursively}. It does not matter that this function is +contained within itself. Emacs passes the result Step 1 as the +argument used by this instance of the @code{triangle-recursively} +function + +In this case, Emacs evaluates @code{triangle-recursively} with an +argument of 1. This means that this evaluation of +@code{triangle-recursively} returns 1. + +@item Step 3 @w{ } Evaluate the value of @code{number}. + +The variable @code{number} is the second element of the list that +starts with @code{+}; its value is 2. + +@item Step 4 @w{ } Evaluate the @code{+} expression. + +The @code{+} expression receives two arguments, the first +from the evaluation of @code{number} (Step 3) and the second from the +evaluation of @code{triangle-recursively} (Step 2). + +The result of the addition is the sum of 2 plus 1, and the number 3 is +returned, which is correct. A triangle with two rows has three +pebbles in it. +@end table + +@node Recursive Example arg of 3 or 4, , Recursive Example arg of 1 or 2, Recursive triangle function +@unnumberedsubsubsec An argument of 3 or 4 + +Suppose that @code{triangle-recursively} is called with an argument of +3. + +@table @i +@item Step 1 @w{ } Evaluate the do-again-test. + +The @code{if} expression is evaluated first. This is the do-again +test and returns false, so the else-part of the @code{if} expression +is evaluated. (Note that in this example, the do-again-test causes +the function to call itself when it tests false, not when it tests +true.) + +@item Step 2 @w{ } Evaluate the innermost expression of the else-part. + +The innermost expression of the else-part is evaluated, which decrements +3 to 2. This is the next-step-expression. + +@item Step 3 @w{ } Evaluate the @code{triangle-recursively} function. + +The number 2 is passed to the @code{triangle-recursively} function. + +We know what happens when Emacs evaluates @code{triangle-recursively} with +an argument of 2. After going through the sequence of actions described +earlier, it returns a value of 3. So that is what will happen here. + +@item Step 4 @w{ } Evaluate the addition. + +3 will be passed as an argument to the addition and will be added to the +number with which the function was called, which is 3. +@end table + +@noindent +The value returned by the function as a whole will be 6. + +Now that we know what will happen when @code{triangle-recursively} is +called with an argument of 3, it is evident what will happen if it is +called with an argument of 4: + +@quotation +@need 800 +In the recursive call, the evaluation of + +@smallexample +(triangle-recursively (1- 4)) +@end smallexample + +@need 800 +@noindent +will return the value of evaluating + +@smallexample +(triangle-recursively 3) +@end smallexample + +@noindent +which is 6 and this value will be added to 4 by the addition in the +third line. +@end quotation + +@noindent +The value returned by the function as a whole will be 10. + +Each time @code{triangle-recursively} is evaluated, it evaluates a +version of itself---a different instance of itself---with a smaller +argument, until the argument is small enough so that it does not +evaluate itself. + +Note that this particular design for a recursive function +requires that operations be deferred. + +Before @code{(triangle-recursively 7)} can calculate its answer, it +must call @code{(triangle-recursively 6)}; and before +@code{(triangle-recursively 6)} can calculate its answer, it must call +@code{(triangle-recursively 5)}; and so on. That is to say, the +calculation that @code{(triangle-recursively 7)} makes must be +deferred until @code{(triangle-recursively 6)} makes its calculation; +and @code{(triangle-recursively 6)} must defer until +@code{(triangle-recursively 5)} completes; and so on. + +If each of these instances of @code{triangle-recursively} are thought +of as different robots, the first robot must wait for the second to +complete its job, which must wait until the third completes, and so +on. + +There is a way around this kind of waiting, which we will discuss in +@ref{No Deferment, , Recursion without Deferments}. + +@node Recursion with cond, Recursive Patterns, Recursive triangle function, Recursion +@comment node-name, next, previous, up +@subsection Recursion Example Using @code{cond} +@findex cond + +The version of @code{triangle-recursively} described earlier is written +with the @code{if} special form. It can also be written using another +special form called @code{cond}. The name of the special form +@code{cond} is an abbreviation of the word @samp{conditional}. + +Although the @code{cond} special form is not used as often in the +Emacs Lisp sources as @code{if}, it is used often enough to justify +explaining it. + +@need 800 +The template for a @code{cond} expression looks like this: + +@smallexample +@group +(cond + @var{body}@dots{}) +@end group +@end smallexample + +@noindent +where the @var{body} is a series of lists. + +@need 800 +Written out more fully, the template looks like this: + +@smallexample +@group +(cond + (@var{first-true-or-false-test} @var{first-consequent}) + (@var{second-true-or-false-test} @var{second-consequent}) + (@var{third-true-or-false-test} @var{third-consequent}) + @dots{}) +@end group +@end smallexample + +When the Lisp interpreter evaluates the @code{cond} expression, it +evaluates the first element (the @sc{car} or true-or-false-test) of +the first expression in a series of expressions within the body of the +@code{cond}. + +If the true-or-false-test returns @code{nil} the rest of that +expression, the consequent, is skipped and the true-or-false-test of the +next expression is evaluated. When an expression is found whose +true-or-false-test returns a value that is not @code{nil}, the +consequent of that expression is evaluated. The consequent can be one +or more expressions. If the consequent consists of more than one +expression, the expressions are evaluated in sequence and the value of +the last one is returned. If the expression does not have a consequent, +the value of the true-or-false-test is returned. + +If none of the true-or-false-tests test true, the @code{cond} expression +returns @code{nil}. + +@need 1250 +Written using @code{cond}, the @code{triangle} function looks like this: + +@smallexample +@group +(defun triangle-using-cond (number) + (cond ((<= number 0) 0) + ((= number 1) 1) + ((> number 1) + (+ number (triangle-using-cond (1- number)))))) +@end group +@end smallexample + +@noindent +In this example, the @code{cond} returns 0 if the number is less than or +equal to 0, it returns 1 if the number is 1 and it evaluates @code{(+ +number (triangle-using-cond (1- number)))} if the number is greater than +1. + +@node Recursive Patterns, No Deferment, Recursion with cond, Recursion +@comment node-name, next, previous, up +@subsection Recursive Patterns +@cindex Recursive Patterns + +Here are three common recursive patterns. Each involves a list. +Recursion does not need to involve lists, but Lisp is designed for lists +and this provides a sense of its primal capabilities. + +@menu +* Every:: +* Accumulate:: +* Keep:: +@end menu + +@node Every, Accumulate, Recursive Patterns, Recursive Patterns +@comment node-name, next, previous, up +@unnumberedsubsubsec Recursive Pattern: @emph{every} +@cindex Every, type of recursive pattern +@cindex Recursive pattern: every + +In the @code{every} recursive pattern, an action is performed on every +element of a list. + +@need 1500 +The basic pattern is: + +@itemize @bullet +@item +If a list be empty, return @code{nil}. +@item +Else, act on the beginning of the list (the @sc{car} of the list) + @itemize @minus + @item + through a recursive call by the function on the rest (the + @sc{cdr}) of the list, + @item + and, optionally, combine the acted-on element, using @code{cons}, + with the results of acting on the rest. + @end itemize +@end itemize + +@need 1500 +Here is example: + +@smallexample +@group +(defun square-each (numbers-list) + "Square each of a NUMBERS LIST, recursively." + (if (not numbers-list) ; do-again-test + nil + (cons + (* (car numbers-list) (car numbers-list)) + (square-each (cdr numbers-list))))) ; next-step-expression +@end group + +@group +(square-each '(1 2 3)) + @result{} (1 4 9) +@end group +@end smallexample + +@need 1200 +@noindent +If @code{numbers-list} is empty, do nothing. But if it has content, +construct a list combining the square of the first number in the list +with the result of the recursive call. + +(The example follows the pattern exactly: @code{nil} is returned if +the numbers' list is empty. In practice, you would write the +conditional so it carries out the action when the numbers' list is not +empty.) + +The @code{print-elements-recursively} function (@pxref{Recursion with +list, , Recursion with a List}) is another example of an @code{every} +pattern, except in this case, rather than bring the results together +using @code{cons}, we print each element of output. + +@need 1250 +The @code{print-elements-recursively} function looks like this: + +@smallexample +@group +(setq animals '(gazelle giraffe lion tiger)) +@end group + +@group +(defun print-elements-recursively (list) + "Print each element of LIST on a line of its own. +Uses recursion." + (when list ; @r{do-again-test} + (print (car list)) ; @r{body} + (print-elements-recursively ; @r{recursive call} + (cdr list)))) ; @r{next-step-expression} + +(print-elements-recursively animals) +@end group +@end smallexample + +@need 1500 +The pattern for @code{print-elements-recursively} is: + +@itemize @bullet +@item +When the list is empty, do nothing. +@item +But when the list has at least one element, + @itemize @minus + @item + act on the beginning of the list (the @sc{car} of the list), + @item + and make a recursive call on the rest (the @sc{cdr}) of the list. + @end itemize +@end itemize + +@node Accumulate, Keep, Every, Recursive Patterns +@comment node-name, next, previous, up +@unnumberedsubsubsec Recursive Pattern: @emph{accumulate} +@cindex Accumulate, type of recursive pattern +@cindex Recursive pattern: accumulate + +Another recursive pattern is called the @code{accumulate} pattern. In +the @code{accumulate} recursive pattern, an action is performed on +every element of a list and the result of that action is accumulated +with the results of performing the action on the other elements. + +This is very like the `every' pattern using @code{cons}, except that +@code{cons} is not used, but some other combiner. + +@need 1500 +The pattern is: + +@itemize @bullet +@item +If a list be empty, return zero or some other constant. +@item +Else, act on the beginning of the list (the @sc{car} of the list), + @itemize @minus + @item + and combine that acted-on element, using @code{+} or + some other combining function, with + @item + a recursive call by the function on the rest (the @sc{cdr}) of the list. + @end itemize +@end itemize + +@need 1500 +Here is an example: + +@smallexample +@group +(defun add-elements (numbers-list) + "Add the elements of NUMBERS-LIST together." + (if (not numbers-list) + 0 + (+ (car numbers-list) (add-elements (cdr numbers-list))))) +@end group + +@group +(add-elements '(1 2 3 4)) + @result{} 10 +@end group +@end smallexample + +@xref{Files List, , Making a List of Files}, for an example of the +accumulate pattern. + +@node Keep, , Accumulate, Recursive Patterns +@comment node-name, next, previous, up +@unnumberedsubsubsec Recursive Pattern: @emph{keep} +@cindex Keep, type of recursive pattern +@cindex Recursive pattern: keep + +A third recursive pattern is called the @code{keep} pattern. +In the @code{keep} recursive pattern, each element of a list is tested; +the element is acted on and the results are kept only if the element +meets a criterion. + +Again, this is very like the `every' pattern, except the element is +skipped unless it meets a criterion. + +@need 1500 +The pattern has three parts: + +@itemize @bullet +@item +If a list be empty, return @code{nil}. +@item +Else, if the beginning of the list (the @sc{car} of the list) passes + a test + @itemize @minus + @item + act on that element and combine it, using @code{cons} with + @item + a recursive call by the function on the rest (the @sc{cdr}) of the list. + @end itemize +@item +Otherwise, if the beginning of the list (the @sc{car} of the list) fails +the test + @itemize @minus + @item + skip on that element, + @item + and, recursively call the function on the rest (the @sc{cdr}) of the list. + @end itemize +@end itemize + +@need 1500 +Here is an example that uses @code{cond}: + +@smallexample +@group +(defun keep-three-letter-words (word-list) + "Keep three letter words in WORD-LIST." + (cond + ;; First do-again-test: stop-condition + ((not word-list) nil) + + ;; Second do-again-test: when to act + ((eq 3 (length (symbol-name (car word-list)))) + ;; combine acted-on element with recursive call on shorter list + (cons (car word-list) (keep-three-letter-words (cdr word-list)))) + + ;; Third do-again-test: when to skip element; + ;; recursively call shorter list with next-step expression + (t (keep-three-letter-words (cdr word-list))))) +@end group + +@group +(keep-three-letter-words '(one two three four five six)) + @result{} (one two six) +@end group +@end smallexample + +It goes without saying that you need not use @code{nil} as the test for +when to stop; and you can, of course, combine these patterns. + +@node No Deferment, No deferment solution, Recursive Patterns, Recursion +@subsection Recursion without Deferments +@cindex Deferment in recursion +@cindex Recursion without Deferments + +Let's consider again what happens with the @code{triangle-recursively} +function. We will find that the intermediate calculations are +deferred until all can be done. + +@need 800 +Here is the function definition: + +@smallexample +@group +(defun triangle-recursively (number) + "Return the sum of the numbers 1 through NUMBER inclusive. +Uses recursion." + (if (= number 1) ; @r{do-again-test} + 1 ; @r{then-part} + (+ number ; @r{else-part} + (triangle-recursively ; @r{recursive call} + (1- number))))) ; @r{next-step-expression} +@end group +@end smallexample + +What happens when we call this function with a argument of 7? + +The first instance of the @code{triangle-recursively} function adds +the number 7 to the value returned by a second instance of +@code{triangle-recursively}, an instance that has been passed an +argument of 6. That is to say, the first calculation is: + +@smallexample +(+ 7 (triangle-recursively 6)) +@end smallexample + +@noindent +The first instance of @code{triangle-recursively}---you may want to +think of it as a little robot---cannot complete its job. It must hand +off the calculation for @code{(triangle-recursively 6)} to a second +instance of the program, to a second robot. This second individual is +completely different from the first one; it is, in the jargon, a +`different instantiation'. Or, put another way, it is a different +robot. It is the same model as the first; it calculates triangle +numbers recursively; but it has a different serial number. + +And what does @code{(triangle-recursively 6)} return? It returns the +number 6 added to the value returned by evaluating +@code{triangle-recursively} with an argument of 5. Using the robot +metaphor, it asks yet another robot to help it. + +@need 800 +Now the total is: + +@smallexample +(+ 7 6 (triangle-recursively 5)) +@end smallexample + +@need 800 +And what happens next? + +@smallexample +(+ 7 6 5 (triangle-recursively 4)) +@end smallexample + +Each time @code{triangle-recursively} is called, except for the last +time, it creates another instance of the program---another robot---and +asks it to make a calculation. + +@need 800 +Eventually, the full addition is set up and performed: + +@smallexample +(+ 7 6 5 4 3 2 1) +@end smallexample + +This design for the function defers the calculation of the first step +until the second can be done, and defers that until the third can be +done, and so on. Each deferment means the computer must remember what +is being waited on. This is not a problem when there are only a few +steps, as in this example. But it can be a problem when there are +more steps. + +@node No deferment solution, , No Deferment, Recursion +@subsection No Deferment Solution +@cindex No deferment solution +@cindex Defermentless solution +@cindex Solution without deferment + +The solution to the problem of deferred operations is to write in a +manner that does not defer operations@footnote{The phrase @dfn{tail +recursive} is used to describe such a process, one that uses +`constant space'.}. This requires +writing to a different pattern, often one that involves writing two +function definitions, an `initialization' function and a `helper' +function. + +The `initialization' function sets up the job; the `helper' function +does the work. + +@need 1200 +Here are the two function definitions for adding up numbers. They are +so simple, I find them hard to understand. + +@smallexample +@group +(defun triangle-initialization (number) + "Return the sum of the numbers 1 through NUMBER inclusive. +This is the `initialization' component of a two function +duo that uses recursion." + (triangle-recursive-helper 0 0 number)) +@end group +@end smallexample + +@smallexample +@group +(defun triangle-recursive-helper (sum counter number) + "Return SUM, using COUNTER, through NUMBER inclusive. +This is the `helper' component of a two function duo +that uses recursion." + (if (> counter number) + sum + (triangle-recursive-helper (+ sum counter) ; @r{sum} + (1+ counter) ; @r{counter} + number))) ; @r{number} +@end group +@end smallexample + +@need 1250 +Install both function definitions by evaluating them, then call +@code{triangle-initialization} with 2 rows: + +@smallexample +@group +(triangle-initialization 2) + @result{} 3 +@end group +@end smallexample + +The `initialization' function calls the first instance of the `helper' +function with three arguments: zero, zero, and a number which is the +number of rows in the triangle. + +The first two arguments passed to the `helper' function are +initialization values. These values are changed when +@code{triangle-recursive-helper} invokes new instances.@footnote{The +jargon is mildly confusing: @code{triangle-recursive-helper} uses a +process that is iterative in a procedure that is recursive. The +process is called iterative because the computer need only record the +three values, @code{sum}, @code{counter}, and @code{number}; the +procedure is recursive because the function `calls itself'. On the +other hand, both the process and the procedure used by +@code{triangle-recursively} are called recursive. The word +`recursive' has different meanings in the two contexts.} + +Let's see what happens when we have a triangle that has one row. (This +triangle will have one pebble in it!) + +@need 1200 +@code{triangle-initialization} will call its helper with +the arguments @w{@code{0 0 1}}. That function will run the conditional +test whether @code{(> counter number)}: + +@smallexample +(> 0 1) +@end smallexample + +@need 1200 +@noindent +and find that the result is false, so it will invoke +the else-part of the @code{if} clause: + +@smallexample +@group + (triangle-recursive-helper + (+ sum counter) ; @r{sum plus counter} @result{} @r{sum} + (1+ counter) ; @r{increment counter} @result{} @r{counter} + number) ; @r{number stays the same} +@end group +@end smallexample + +@need 800 +@noindent +which will first compute: + +@smallexample +@group +(triangle-recursive-helper (+ 0 0) ; @r{sum} + (1+ 0) ; @r{counter} + 1) ; @r{number} +@exdent which is: + +(triangle-recursive-helper 0 1 1) +@end group +@end smallexample + +Again, @code{(> counter number)} will be false, so again, the Lisp +interpreter will evaluate @code{triangle-recursive-helper}, creating a +new instance with new arguments. + +@need 800 +This new instance will be; + +@smallexample +@group + (triangle-recursive-helper + (+ sum counter) ; @r{sum plus counter} @result{} @r{sum} + (1+ counter) ; @r{increment counter} @result{} @r{counter} + number) ; @r{number stays the same} + +@exdent which is: + +(triangle-recursive-helper 1 2 1) +@end group +@end smallexample + +In this case, the @code{(> counter number)} test will be true! So the +instance will return the value of the sum, which will be 1, as +expected. + +Now, let's pass @code{triangle-initialization} an argument +of 2, to find out how many pebbles there are in a triangle with two rows. + +That function calls @code{(triangle-recursive-helper 0 0 2)}. + +@need 800 +In stages, the instances called will be: + +@smallexample +@group + @r{sum counter number} +(triangle-recursive-helper 0 1 2) + +(triangle-recursive-helper 1 2 2) + +(triangle-recursive-helper 3 3 2) +@end group +@end smallexample + +When the last instance is called, the @code{(> counter number)} test +will be true, so the instance will return the value of @code{sum}, +which will be 3. + +This kind of pattern helps when you are writing functions that can use +many resources in a computer. + +@need 1500 +@node Looping exercise, , Recursion, Loops & Recursion +@section Looping Exercise + +@itemize @bullet +@item +Write a function similar to @code{triangle} in which each row has a +value which is the square of the row number. Use a @code{while} loop. + +@item +Write a function similar to @code{triangle} that multiplies instead of +adds the values. + +@item +Rewrite these two functions recursively. Rewrite these functions +using @code{cond}. + +@c comma in printed title causes problem in Info cross reference +@item +Write a function for Texinfo mode that creates an index entry at the +beginning of a paragraph for every @samp{@@dfn} within the paragraph. +(In a Texinfo file, @samp{@@dfn} marks a definition. This book is +written in Texinfo.) + +Many of the functions you will need are described in two of the +previous chapters, @ref{Cutting & Storing Text, , Cutting and Storing +Text}, and @ref{Yanking, , Yanking Text Back}. If you use +@code{forward-paragraph} to put the index entry at the beginning of +the paragraph, you will have to use @w{@kbd{C-h f}} +(@code{describe-function}) to find out how to make the command go +backwards. + +For more information, see +@ifinfo +@ref{Indicating, , Indicating Definitions, texinfo}. +@end ifinfo +@ifhtml +@ref{Indicating, , Indicating, texinfo, Texinfo Manual}, which goes to +a Texinfo manual in the current directory. Or, if you are on the +Internet, see +@uref{http://www.gnu.org/software/texinfo/manual/texinfo/} +@end ifhtml +@iftex +``Indicating Definitions, Commands, etc.'' in @cite{Texinfo, The GNU +Documentation Format}. +@end iftex +@end itemize + +@node Regexp Search, Counting Words, Loops & Recursion, Top +@comment node-name, next, previous, up +@chapter Regular Expression Searches +@cindex Searches, illustrating +@cindex Regular expression searches +@cindex Patterns, searching for +@cindex Motion by sentence and paragraph +@cindex Sentences, movement by +@cindex Paragraphs, movement by + +Regular expression searches are used extensively in GNU Emacs. The +two functions, @code{forward-sentence} and @code{forward-paragraph}, +illustrate these searches well. They use regular expressions to find +where to move point. The phrase `regular expression' is often written +as `regexp'. + +Regular expression searches are described in @ref{Regexp Search, , +Regular Expression Search, emacs, The GNU Emacs Manual}, as well as in +@ref{Regular Expressions, , , elisp, The GNU Emacs Lisp Reference +Manual}. In writing this chapter, I am presuming that you have at +least a mild acquaintance with them. The major point to remember is +that regular expressions permit you to search for patterns as well as +for literal strings of characters. For example, the code in +@code{forward-sentence} searches for the pattern of possible +characters that could mark the end of a sentence, and moves point to +that spot. + +Before looking at the code for the @code{forward-sentence} function, it +is worth considering what the pattern that marks the end of a sentence +must be. The pattern is discussed in the next section; following that +is a description of the regular expression search function, +@code{re-search-forward}. The @code{forward-sentence} function +is described in the section following. Finally, the +@code{forward-paragraph} function is described in the last section of +this chapter. @code{forward-paragraph} is a complex function that +introduces several new features. + +@menu +* sentence-end:: The regular expression for @code{sentence-end}. +* re-search-forward:: Very similar to @code{search-forward}. +* forward-sentence:: A straightforward example of regexp search. +* forward-paragraph:: A somewhat complex example. +* etags:: How to create your own @file{TAGS} table. +* Regexp Review:: +* re-search Exercises:: +@end menu + +@node sentence-end, re-search-forward, Regexp Search, Regexp Search +@comment node-name, next, previous, up +@section The Regular Expression for @code{sentence-end} +@findex sentence-end + +The symbol @code{sentence-end} is bound to the pattern that marks the +end of a sentence. What should this regular expression be? + +Clearly, a sentence may be ended by a period, a question mark, or an +exclamation mark. Indeed, in English, only clauses that end with one +of those three characters should be considered the end of a sentence. +This means that the pattern should include the character set: + +@smallexample +[.?!] +@end smallexample + +However, we do not want @code{forward-sentence} merely to jump to a +period, a question mark, or an exclamation mark, because such a character +might be used in the middle of a sentence. A period, for example, is +used after abbreviations. So other information is needed. + +According to convention, you type two spaces after every sentence, but +only one space after a period, a question mark, or an exclamation mark in +the body of a sentence. So a period, a question mark, or an exclamation +mark followed by two spaces is a good indicator of an end of sentence. +However, in a file, the two spaces may instead be a tab or the end of a +line. This means that the regular expression should include these three +items as alternatives. + +@need 800 +This group of alternatives will look like this: + +@smallexample +@group +\\($\\| \\| \\) + ^ ^^ + TAB SPC +@end group +@end smallexample + +@noindent +Here, @samp{$} indicates the end of the line, and I have pointed out +where the tab and two spaces are inserted in the expression. Both are +inserted by putting the actual characters into the expression. + +Two backslashes, @samp{\\}, are required before the parentheses and +vertical bars: the first backslash quotes the following backslash in +Emacs; and the second indicates that the following character, the +parenthesis or the vertical bar, is special. + +@need 1000 +Also, a sentence may be followed by one or more carriage returns, like +this: + +@smallexample +@group +[ +]* +@end group +@end smallexample + +@noindent +Like tabs and spaces, a carriage return is inserted into a regular +expression by inserting it literally. The asterisk indicates that the +@key{RET} is repeated zero or more times. + +But a sentence end does not consist only of a period, a question mark or +an exclamation mark followed by appropriate space: a closing quotation +mark or a closing brace of some kind may precede the space. Indeed more +than one such mark or brace may precede the space. These require a +expression that looks like this: + +@smallexample +[]\"')@}]* +@end smallexample + +In this expression, the first @samp{]} is the first character in the +expression; the second character is @samp{"}, which is preceded by a +@samp{\} to tell Emacs the @samp{"} is @emph{not} special. The last +three characters are @samp{'}, @samp{)}, and @samp{@}}. + +All this suggests what the regular expression pattern for matching the +end of a sentence should be; and, indeed, if we evaluate +@code{sentence-end} we find that it returns the following value: + +@smallexample +@group +sentence-end + @result{} "[.?!][]\"')@}]*\\($\\| \\| \\)[ +]*" +@end group +@end smallexample + +@noindent +(Well, not in GNU Emacs 22; that is because of an effort to make the +process simpler and to handle more glyphs and languages. When the +value of @code{sentence-end} is @code{nil}, then use the value defined +by the function @code{sentence-end}. (Here is a use of the difference +between a value and a function in Emacs Lisp.) The function returns a +value constructed from the variables @code{sentence-end-base}, +@code{sentence-end-double-space}, @code{sentence-end-without-period}, +and @code{sentence-end-without-space}. The critical variable is +@code{sentence-end-base}; its global value is similar to the one +described above but it also contains two additional quotation marks. +These have differing degrees of curliness. The +@code{sentence-end-without-period} variable, when true, tells Emacs +that a sentence may end without a period, such as text in Thai.) + +@ignore +@noindent +(Note that here the @key{TAB}, two spaces, and @key{RET} are shown +literally in the pattern.) + +This regular expression can be deciphered as follows: + +@table @code +@item [.?!] +The first part of the pattern is the three characters, a period, a question +mark and an exclamation mark, within square brackets. The pattern must +begin with one or other of these characters. + +@item []\"')@}]* +The second part of the pattern is the group of closing braces and +quotation marks, which can appear zero or more times. These may follow +the period, question mark or exclamation mark. In a regular expression, +the backslash, @samp{\}, followed by the double quotation mark, +@samp{"}, indicates the class of string-quote characters. Usually, the +double quotation mark is the only character in this class. The +asterisk, @samp{*}, indicates that the items in the previous group (the +group surrounded by square brackets, @samp{[]}) may be repeated zero or +more times. + +@item \\($\\| \\| \\) +The third part of the pattern is one or other of: either the end of a +line, or two blank spaces, or a tab. The double back-slashes are used +to prevent Emacs from reading the parentheses and vertical bars as part +of the search pattern; the parentheses are used to mark the group and +the vertical bars are used to indicated that the patterns to either side +of them are alternatives. The dollar sign is used to indicate the end +of a line and both the two spaces and the tab are each inserted as is to +indicate what they are. + +@item [@key{RET}]* +Finally, the last part of the pattern indicates that the end of the line +or the whitespace following the period, question mark or exclamation +mark may, but need not, be followed by one or more carriage returns. In +the pattern, the carriage return is inserted as an actual carriage +return between square brackets but here it is shown as @key{RET}. +@end table +@end ignore + +@node re-search-forward, forward-sentence, sentence-end, Regexp Search +@comment node-name, next, previous, up +@section The @code{re-search-forward} Function +@findex re-search-forward + +The @code{re-search-forward} function is very like the +@code{search-forward} function. (@xref{search-forward, , The +@code{search-forward} Function}.) + +@code{re-search-forward} searches for a regular expression. If the +search is successful, it leaves point immediately after the last +character in the target. If the search is backwards, it leaves point +just before the first character in the target. You may tell +@code{re-search-forward} to return @code{t} for true. (Moving point +is therefore a `side effect'.) + +Like @code{search-forward}, the @code{re-search-forward} function takes +four arguments: + +@enumerate +@item +The first argument is the regular expression that the function searches +for. The regular expression will be a string between quotations marks. + +@item +The optional second argument limits how far the function will search; it is a +bound, which is specified as a position in the buffer. + +@item +The optional third argument specifies how the function responds to +failure: @code{nil} as the third argument causes the function to +signal an error (and print a message) when the search fails; any other +value causes it to return @code{nil} if the search fails and @code{t} +if the search succeeds. + +@item +The optional fourth argument is the repeat count. A negative repeat +count causes @code{re-search-forward} to search backwards. +@end enumerate + +@need 800 +The template for @code{re-search-forward} looks like this: + +@smallexample +@group +(re-search-forward "@var{regular-expression}" + @var{limit-of-search} + @var{what-to-do-if-search-fails} + @var{repeat-count}) +@end group +@end smallexample + +The second, third, and fourth arguments are optional. However, if you +want to pass a value to either or both of the last two arguments, you +must also pass a value to all the preceding arguments. Otherwise, the +Lisp interpreter will mistake which argument you are passing the value +to. + +@need 1200 +In the @code{forward-sentence} function, the regular expression will be +the value of the variable @code{sentence-end}. In simple form, that is: + +@smallexample +@group +"[.?!][]\"')@}]*\\($\\| \\| \\)[ +]*" +@end group +@end smallexample + +@noindent +The limit of the search will be the end of the paragraph (since a +sentence cannot go beyond a paragraph). If the search fails, the +function will return @code{nil}; and the repeat count will be provided +by the argument to the @code{forward-sentence} function. + +@node forward-sentence, forward-paragraph, re-search-forward, Regexp Search +@comment node-name, next, previous, up +@section @code{forward-sentence} +@findex forward-sentence + +The command to move the cursor forward a sentence is a straightforward +illustration of how to use regular expression searches in Emacs Lisp. +Indeed, the function looks longer and more complicated than it is; this +is because the function is designed to go backwards as well as forwards; +and, optionally, over more than one sentence. The function is usually +bound to the key command @kbd{M-e}. + +@menu +* Complete forward-sentence:: +* fwd-sentence while loops:: Two @code{while} loops. +* fwd-sentence re-search:: A regular expression search. +@end menu + +@node Complete forward-sentence, fwd-sentence while loops, forward-sentence, forward-sentence +@ifnottex +@unnumberedsubsec Complete @code{forward-sentence} function definition +@end ifnottex + +@need 1250 +Here is the code for @code{forward-sentence}: + +@c in GNU Emacs 22 +@smallexample +@group +(defun forward-sentence (&optional arg) + "Move forward to next `sentence-end'. With argument, repeat. +With negative argument, move backward repeatedly to `sentence-beginning'. + +The variable `sentence-end' is a regular expression that matches ends of +sentences. Also, every paragraph boundary terminates sentences as well." +@end group +@group + (interactive "p") + (or arg (setq arg 1)) + (let ((opoint (point)) + (sentence-end (sentence-end))) + (while (< arg 0) + (let ((pos (point)) + (par-beg (save-excursion (start-of-paragraph-text) (point)))) + (if (and (re-search-backward sentence-end par-beg t) + (or (< (match-end 0) pos) + (re-search-backward sentence-end par-beg t))) + (goto-char (match-end 0)) + (goto-char par-beg))) + (setq arg (1+ arg))) +@end group +@group + (while (> arg 0) + (let ((par-end (save-excursion (end-of-paragraph-text) (point)))) + (if (re-search-forward sentence-end par-end t) + (skip-chars-backward " \t\n") + (goto-char par-end))) + (setq arg (1- arg))) + (constrain-to-field nil opoint t))) +@end group +@end smallexample + +@ignore +GNU Emacs 21 +@smallexample +@group +(defun forward-sentence (&optional arg) + "Move forward to next sentence-end. With argument, repeat. +With negative argument, move backward repeatedly to sentence-beginning. +Sentence ends are identified by the value of sentence-end +treated as a regular expression. Also, every paragraph boundary +terminates sentences as well." +@end group +@group + (interactive "p") + (or arg (setq arg 1)) + (while (< arg 0) + (let ((par-beg + (save-excursion (start-of-paragraph-text) (point)))) + (if (re-search-backward + (concat sentence-end "[^ \t\n]") par-beg t) + (goto-char (1- (match-end 0))) + (goto-char par-beg))) + (setq arg (1+ arg))) + (while (> arg 0) + (let ((par-end + (save-excursion (end-of-paragraph-text) (point)))) + (if (re-search-forward sentence-end par-end t) + (skip-chars-backward " \t\n") + (goto-char par-end))) + (setq arg (1- arg)))) +@end group +@end smallexample +@end ignore + +The function looks long at first sight and it is best to look at its +skeleton first, and then its muscle. The way to see the skeleton is to +look at the expressions that start in the left-most columns: + +@smallexample +@group +(defun forward-sentence (&optional arg) + "@var{documentation}@dots{}" + (interactive "p") + (or arg (setq arg 1)) + (let ((opoint (point)) (sentence-end (sentence-end))) + (while (< arg 0) + (let ((pos (point)) + (par-beg (save-excursion (start-of-paragraph-text) (point)))) + @var{rest-of-body-of-while-loop-when-going-backwards} + (while (> arg 0) + (let ((par-end (save-excursion (end-of-paragraph-text) (point)))) + @var{rest-of-body-of-while-loop-when-going-forwards} + @var{handle-forms-and-equivalent} +@end group +@end smallexample + +This looks much simpler! The function definition consists of +documentation, an @code{interactive} expression, an @code{or} +expression, a @code{let} expression, and @code{while} loops. + +Let's look at each of these parts in turn. + +We note that the documentation is thorough and understandable. + +The function has an @code{interactive "p"} declaration. This means +that the processed prefix argument, if any, is passed to the +function as its argument. (This will be a number.) If the function +is not passed an argument (it is optional) then the argument +@code{arg} will be bound to 1. + +When @code{forward-sentence} is called non-interactively without an +argument, @code{arg} is bound to @code{nil}. The @code{or} expression +handles this. What it does is either leave the value of @code{arg} as +it is, but only if @code{arg} is bound to a value; or it sets the +value of @code{arg} to 1, in the case when @code{arg} is bound to +@code{nil}. + +Next is a @code{let}. That specifies the values of two local +variables, @code{point} and @code{sentence-end}. The local value of +point, from before the search, is used in the +@code{constrain-to-field} function which handles forms and +equivalents. The @code{sentence-end} variable is set by the +@code{sentence-end} function. + +@node fwd-sentence while loops, fwd-sentence re-search, Complete forward-sentence, forward-sentence +@unnumberedsubsec The @code{while} loops + +Two @code{while} loops follow. The first @code{while} has a +true-or-false-test that tests true if the prefix argument for +@code{forward-sentence} is a negative number. This is for going +backwards. The body of this loop is similar to the body of the second +@code{while} clause, but it is not exactly the same. We will skip +this @code{while} loop and concentrate on the second @code{while} +loop. + +@need 1500 +The second @code{while} loop is for moving point forward. Its skeleton +looks like this: + +@smallexample +@group +(while (> arg 0) ; @r{true-or-false-test} + (let @var{varlist} + (if (@var{true-or-false-test}) + @var{then-part} + @var{else-part} + (setq arg (1- arg)))) ; @code{while} @r{loop decrementer} +@end group +@end smallexample + +The @code{while} loop is of the decrementing kind. +(@xref{Decrementing Loop, , A Loop with a Decrementing Counter}.) It +has a true-or-false-test that tests true so long as the counter (in +this case, the variable @code{arg}) is greater than zero; and it has a +decrementer that subtracts 1 from the value of the counter every time +the loop repeats. + +If no prefix argument is given to @code{forward-sentence}, which is +the most common way the command is used, this @code{while} loop will +run once, since the value of @code{arg} will be 1. + +The body of the @code{while} loop consists of a @code{let} expression, +which creates and binds a local variable, and has, as its body, an +@code{if} expression. + +@need 1250 +The body of the @code{while} loop looks like this: + +@smallexample +@group +(let ((par-end + (save-excursion (end-of-paragraph-text) (point)))) + (if (re-search-forward sentence-end par-end t) + (skip-chars-backward " \t\n") + (goto-char par-end))) +@end group +@end smallexample + +The @code{let} expression creates and binds the local variable +@code{par-end}. As we shall see, this local variable is designed to +provide a bound or limit to the regular expression search. If the +search fails to find a proper sentence ending in the paragraph, it will +stop on reaching the end of the paragraph. + +But first, let us examine how @code{par-end} is bound to the value of +the end of the paragraph. What happens is that the @code{let} sets the +value of @code{par-end} to the value returned when the Lisp interpreter +evaluates the expression + +@smallexample +@group +(save-excursion (end-of-paragraph-text) (point)) +@end group +@end smallexample + +@noindent +In this expression, @code{(end-of-paragraph-text)} moves point to the +end of the paragraph, @code{(point)} returns the value of point, and then +@code{save-excursion} restores point to its original position. Thus, +the @code{let} binds @code{par-end} to the value returned by the +@code{save-excursion} expression, which is the position of the end of +the paragraph. (The @code{end-of-paragraph-text} function uses +@code{forward-paragraph}, which we will discuss shortly.) + +@need 1200 +Emacs next evaluates the body of the @code{let}, which is an @code{if} +expression that looks like this: + +@smallexample +@group +(if (re-search-forward sentence-end par-end t) ; @r{if-part} + (skip-chars-backward " \t\n") ; @r{then-part} + (goto-char par-end))) ; @r{else-part} +@end group +@end smallexample + +The @code{if} tests whether its first argument is true and if so, +evaluates its then-part; otherwise, the Emacs Lisp interpreter +evaluates the else-part. The true-or-false-test of the @code{if} +expression is the regular expression search. + +It may seem odd to have what looks like the `real work' of +the @code{forward-sentence} function buried here, but this is a common +way this kind of operation is carried out in Lisp. + +@node fwd-sentence re-search, , fwd-sentence while loops, forward-sentence +@unnumberedsubsec The regular expression search + +The @code{re-search-forward} function searches for the end of the +sentence, that is, for the pattern defined by the @code{sentence-end} +regular expression. If the pattern is found---if the end of the sentence is +found---then the @code{re-search-forward} function does two things: + +@enumerate +@item +The @code{re-search-forward} function carries out a side effect, which +is to move point to the end of the occurrence found. + +@item +The @code{re-search-forward} function returns a value of true. This is +the value received by the @code{if}, and means that the search was +successful. +@end enumerate + +@noindent +The side effect, the movement of point, is completed before the +@code{if} function is handed the value returned by the successful +conclusion of the search. + +When the @code{if} function receives the value of true from a successful +call to @code{re-search-forward}, the @code{if} evaluates the then-part, +which is the expression @code{(skip-chars-backward " \t\n")}. This +expression moves backwards over any blank spaces, tabs or carriage +returns until a printed character is found and then leaves point after +the character. Since point has already been moved to the end of the +pattern that marks the end of the sentence, this action leaves point +right after the closing printed character of the sentence, which is +usually a period. + +On the other hand, if the @code{re-search-forward} function fails to +find a pattern marking the end of the sentence, the function returns +false. The false then causes the @code{if} to evaluate its third +argument, which is @code{(goto-char par-end)}: it moves point to the +end of the paragraph. + +(And if the text is in a form or equivalent, and point may not move +fully, then the @code{constrain-to-field} function comes into play.) + +Regular expression searches are exceptionally useful and the pattern +illustrated by @code{re-search-forward}, in which the search is the +test of an @code{if} expression, is handy. You will see or write code +incorporating this pattern often. + +@node forward-paragraph, etags, forward-sentence, Regexp Search +@comment node-name, next, previous, up +@section @code{forward-paragraph}: a Goldmine of Functions +@findex forward-paragraph + +@ignore +@c in GNU Emacs 22 +(defun forward-paragraph (&optional arg) + "Move forward to end of paragraph. +With argument ARG, do it ARG times; +a negative argument ARG = -N means move backward N paragraphs. + +A line which `paragraph-start' matches either separates paragraphs +\(if `paragraph-separate' matches it also) or is the first line of a paragraph. +A paragraph end is the beginning of a line which is not part of the paragraph +to which the end of the previous line belongs, or the end of the buffer. +Returns the count of paragraphs left to move." + (interactive "p") + (or arg (setq arg 1)) + (let* ((opoint (point)) + (fill-prefix-regexp + (and fill-prefix (not (equal fill-prefix "")) + (not paragraph-ignore-fill-prefix) + (regexp-quote fill-prefix))) + ;; Remove ^ from paragraph-start and paragraph-sep if they are there. + ;; These regexps shouldn't be anchored, because we look for them + ;; starting at the left-margin. This allows paragraph commands to + ;; work normally with indented text. + ;; This hack will not find problem cases like "whatever\\|^something". + (parstart (if (and (not (equal "" paragraph-start)) + (equal ?^ (aref paragraph-start 0))) + (substring paragraph-start 1) + paragraph-start)) + (parsep (if (and (not (equal "" paragraph-separate)) + (equal ?^ (aref paragraph-separate 0))) + (substring paragraph-separate 1) + paragraph-separate)) + (parsep + (if fill-prefix-regexp + (concat parsep "\\|" + fill-prefix-regexp "[ \t]*$") + parsep)) + ;; This is used for searching. + (sp-parstart (concat "^[ \t]*\\(?:" parstart "\\|" parsep "\\)")) + start found-start) + (while (and (< arg 0) (not (bobp))) + (if (and (not (looking-at parsep)) + (re-search-backward "^\n" (max (1- (point)) (point-min)) t) + (looking-at parsep)) + (setq arg (1+ arg)) + (setq start (point)) + ;; Move back over paragraph-separating lines. + (forward-char -1) (beginning-of-line) + (while (and (not (bobp)) + (progn (move-to-left-margin) + (looking-at parsep))) + (forward-line -1)) + (if (bobp) + nil + (setq arg (1+ arg)) + ;; Go to end of the previous (non-separating) line. + (end-of-line) + ;; Search back for line that starts or separates paragraphs. + (if (if fill-prefix-regexp + ;; There is a fill prefix; it overrides parstart. + (let (multiple-lines) + (while (and (progn (beginning-of-line) (not (bobp))) + (progn (move-to-left-margin) + (not (looking-at parsep))) + (looking-at fill-prefix-regexp)) + (unless (= (point) start) + (setq multiple-lines t)) + (forward-line -1)) + (move-to-left-margin) + ;; This deleted code caused a long hanging-indent line + ;; not to be filled together with the following lines. + ;; ;; Don't move back over a line before the paragraph + ;; ;; which doesn't start with fill-prefix + ;; ;; unless that is the only line we've moved over. + ;; (and (not (looking-at fill-prefix-regexp)) + ;; multiple-lines + ;; (forward-line 1)) + (not (bobp))) + (while (and (re-search-backward sp-parstart nil 1) + (setq found-start t) + ;; Found a candidate, but need to check if it is a + ;; REAL parstart. + (progn (setq start (point)) + (move-to-left-margin) + (not (looking-at parsep))) + (not (and (looking-at parstart) + (or (not use-hard-newlines) + (bobp) + (get-text-property + (1- start) 'hard))))) + (setq found-start nil) + (goto-char start)) + found-start) + ;; Found one. + (progn + ;; Move forward over paragraph separators. + ;; We know this cannot reach the place we started + ;; because we know we moved back over a non-separator. + (while (and (not (eobp)) + (progn (move-to-left-margin) + (looking-at parsep))) + (forward-line 1)) + ;; If line before paragraph is just margin, back up to there. + (end-of-line 0) + (if (> (current-column) (current-left-margin)) + (forward-char 1) + (skip-chars-backward " \t") + (if (not (bolp)) + (forward-line 1)))) + ;; No starter or separator line => use buffer beg. + (goto-char (point-min)))))) + + (while (and (> arg 0) (not (eobp))) + ;; Move forward over separator lines... + (while (and (not (eobp)) + (progn (move-to-left-margin) (not (eobp))) + (looking-at parsep)) + (forward-line 1)) + (unless (eobp) (setq arg (1- arg))) + ;; ... and one more line. + (forward-line 1) + (if fill-prefix-regexp + ;; There is a fill prefix; it overrides parstart. + (while (and (not (eobp)) + (progn (move-to-left-margin) (not (eobp))) + (not (looking-at parsep)) + (looking-at fill-prefix-regexp)) + (forward-line 1)) + (while (and (re-search-forward sp-parstart nil 1) + (progn (setq start (match-beginning 0)) + (goto-char start) + (not (eobp))) + (progn (move-to-left-margin) + (not (looking-at parsep))) + (or (not (looking-at parstart)) + (and use-hard-newlines + (not (get-text-property (1- start) 'hard))))) + (forward-char 1)) + (if (< (point) (point-max)) + (goto-char start)))) + (constrain-to-field nil opoint t) + ;; Return the number of steps that could not be done. + arg)) +@end ignore + +The @code{forward-paragraph} function moves point forward to the end +of the paragraph. It is usually bound to @kbd{M-@}} and makes use of a +number of functions that are important in themselves, including +@code{let*}, @code{match-beginning}, and @code{looking-at}. + +The function definition for @code{forward-paragraph} is considerably +longer than the function definition for @code{forward-sentence} +because it works with a paragraph, each line of which may begin with a +fill prefix. + +A fill prefix consists of a string of characters that are repeated at +the beginning of each line. For example, in Lisp code, it is a +convention to start each line of a paragraph-long comment with +@samp{;;; }. In Text mode, four blank spaces make up another common +fill prefix, creating an indented paragraph. (@xref{Fill Prefix, , , +emacs, The GNU Emacs Manual}, for more information about fill +prefixes.) + +The existence of a fill prefix means that in addition to being able to +find the end of a paragraph whose lines begin on the left-most +column, the @code{forward-paragraph} function must be able to find the +end of a paragraph when all or many of the lines in the buffer begin +with the fill prefix. + +Moreover, it is sometimes practical to ignore a fill prefix that +exists, especially when blank lines separate paragraphs. +This is an added complication. + +@menu +* forward-paragraph in brief:: Key parts of the function definition. +* fwd-para let:: The @code{let*} expression. +* fwd-para while:: The forward motion @code{while} loop. +@end menu + +@node forward-paragraph in brief, fwd-para let, forward-paragraph, forward-paragraph +@ifnottex +@unnumberedsubsec Shortened @code{forward-paragraph} function definition +@end ifnottex + +Rather than print all of the @code{forward-paragraph} function, we +will only print parts of it. Read without preparation, the function +can be daunting! + +@need 800 +In outline, the function looks like this: + +@smallexample +@group +(defun forward-paragraph (&optional arg) + "@var{documentation}@dots{}" + (interactive "p") + (or arg (setq arg 1)) + (let* + @var{varlist} + (while (and (< arg 0) (not (bobp))) ; @r{backward-moving-code} + @dots{} + (while (and (> arg 0) (not (eobp))) ; @r{forward-moving-code} + @dots{} +@end group +@end smallexample + +The first parts of the function are routine: the function's argument +list consists of one optional argument. Documentation follows. + +The lower case @samp{p} in the @code{interactive} declaration means +that the processed prefix argument, if any, is passed to the function. +This will be a number, and is the repeat count of how many paragraphs +point will move. The @code{or} expression in the next line handles +the common case when no argument is passed to the function, which occurs +if the function is called from other code rather than interactively. +This case was described earlier. (@xref{forward-sentence, The +@code{forward-sentence} function}.) Now we reach the end of the +familiar part of this function. + +@node fwd-para let, fwd-para while, forward-paragraph in brief, forward-paragraph +@unnumberedsubsec The @code{let*} expression + +The next line of the @code{forward-paragraph} function begins a +@code{let*} expression. This is a different than @code{let}. The +symbol is @code{let*} not @code{let}. + +The @code{let*} special form is like @code{let} except that Emacs sets +each variable in sequence, one after another, and variables in the +latter part of the varlist can make use of the values to which Emacs +set variables in the earlier part of the varlist. + +@ignore +( refappend save-excursion, , code save-excursion in code append-to-buffer .) +@end ignore + +(@ref{append save-excursion, , @code{save-excursion} in @code{append-to-buffer}}.) + +In the @code{let*} expression in this function, Emacs binds a total of +seven variables: @code{opoint}, @code{fill-prefix-regexp}, +@code{parstart}, @code{parsep}, @code{sp-parstart}, @code{start}, and +@code{found-start}. + +The variable @code{parsep} appears twice, first, to remove instances +of @samp{^}, and second, to handle fill prefixes. + +The variable @code{opoint} is just the value of @code{point}. As you +can guess, it is used in a @code{constrain-to-field} expression, just +as in @code{forward-sentence}. + +The variable @code{fill-prefix-regexp} is set to the value returned by +evaluating the following list: + +@smallexample +@group +(and fill-prefix + (not (equal fill-prefix "")) + (not paragraph-ignore-fill-prefix) + (regexp-quote fill-prefix)) +@end group +@end smallexample + +@noindent +This is an expression whose first element is the @code{and} special form. + +As we learned earlier (@pxref{kill-new function, , The @code{kill-new} +function}), the @code{and} special form evaluates each of its +arguments until one of the arguments returns a value of @code{nil}, in +which case the @code{and} expression returns @code{nil}; however, if +none of the arguments returns a value of @code{nil}, the value +resulting from evaluating the last argument is returned. (Since such +a value is not @code{nil}, it is considered true in Lisp.) In other +words, an @code{and} expression returns a true value only if all its +arguments are true. +@findex and + +In this case, the variable @code{fill-prefix-regexp} is bound to a +non-@code{nil} value only if the following four expressions produce a +true (i.e., a non-@code{nil}) value when they are evaluated; otherwise, +@code{fill-prefix-regexp} is bound to @code{nil}. + +@table @code +@item fill-prefix +When this variable is evaluated, the value of the fill prefix, if any, +is returned. If there is no fill prefix, this variable returns +@code{nil}. + +@item (not (equal fill-prefix "") +This expression checks whether an existing fill prefix is an empty +string, that is, a string with no characters in it. An empty string is +not a useful fill prefix. + +@item (not paragraph-ignore-fill-prefix) +This expression returns @code{nil} if the variable +@code{paragraph-ignore-fill-prefix} has been turned on by being set to a +true value such as @code{t}. + +@item (regexp-quote fill-prefix) +This is the last argument to the @code{and} special form. If all the +arguments to the @code{and} are true, the value resulting from +evaluating this expression will be returned by the @code{and} expression +and bound to the variable @code{fill-prefix-regexp}, +@end table + +@findex regexp-quote +@noindent +The result of evaluating this @code{and} expression successfully is that +@code{fill-prefix-regexp} will be bound to the value of +@code{fill-prefix} as modified by the @code{regexp-quote} function. +What @code{regexp-quote} does is read a string and return a regular +expression that will exactly match the string and match nothing else. +This means that @code{fill-prefix-regexp} will be set to a value that +will exactly match the fill prefix if the fill prefix exists. +Otherwise, the variable will be set to @code{nil}. + +The next two local variables in the @code{let*} expression are +designed to remove instances of @samp{^} from @code{parstart} and +@code{parsep}, the local variables which indicate the paragraph start +and the paragraph separator. The next expression sets @code{parsep} +again. That is to handle fill prefixes. + +This is the setting that requires the definition call @code{let*} +rather than @code{let}. The true-or-false-test for the @code{if} +depends on whether the variable @code{fill-prefix-regexp} evaluates to +@code{nil} or some other value. + +If @code{fill-prefix-regexp} does not have a value, Emacs evaluates +the else-part of the @code{if} expression and binds @code{parsep} to +its local value. (@code{parsep} is a regular expression that matches +what separates paragraphs.) + +But if @code{fill-prefix-regexp} does have a value, Emacs evaluates +the then-part of the @code{if} expression and binds @code{parsep} to a +regular expression that includes the @code{fill-prefix-regexp} as part +of the pattern. + +Specifically, @code{parsep} is set to the original value of the +paragraph separate regular expression concatenated with an alternative +expression that consists of the @code{fill-prefix-regexp} followed by +optional whitespace to the end of the line. The whitespace is defined +by @w{@code{"[ \t]*$"}}.) The @samp{\\|} defines this portion of the +regexp as an alternative to @code{parsep}. + +According to a comment in the code, the next local variable, +@code{sp-parstart}, is used for searching, and then the final two, +@code{start} and @code{found-start}, are set to @code{nil}. + +Now we get into the body of the @code{let*}. The first part of the body +of the @code{let*} deals with the case when the function is given a +negative argument and is therefore moving backwards. We will skip this +section. + +@node fwd-para while, , fwd-para let, forward-paragraph +@unnumberedsubsec The forward motion @code{while} loop + +The second part of the body of the @code{let*} deals with forward +motion. It is a @code{while} loop that repeats itself so long as the +value of @code{arg} is greater than zero. In the most common use of +the function, the value of the argument is 1, so the body of the +@code{while} loop is evaluated exactly once, and the cursor moves +forward one paragraph. + +@ignore +(while (and (> arg 0) (not (eobp))) + + ;; Move forward over separator lines... + (while (and (not (eobp)) + (progn (move-to-left-margin) (not (eobp))) + (looking-at parsep)) + (forward-line 1)) + (unless (eobp) (setq arg (1- arg))) + ;; ... and one more line. + (forward-line 1) + + (if fill-prefix-regexp + ;; There is a fill prefix; it overrides parstart. + (while (and (not (eobp)) + (progn (move-to-left-margin) (not (eobp))) + (not (looking-at parsep)) + (looking-at fill-prefix-regexp)) + (forward-line 1)) + + (while (and (re-search-forward sp-parstart nil 1) + (progn (setq start (match-beginning 0)) + (goto-char start) + (not (eobp))) + (progn (move-to-left-margin) + (not (looking-at parsep))) + (or (not (looking-at parstart)) + (and use-hard-newlines + (not (get-text-property (1- start) 'hard))))) + (forward-char 1)) + + (if (< (point) (point-max)) + (goto-char start)))) +@end ignore + +This part handles three situations: when point is between paragraphs, +when there is a fill prefix and when there is no fill prefix. + +@need 800 +The @code{while} loop looks like this: + +@smallexample +@group +;; @r{going forwards and not at the end of the buffer} +(while (and (> arg 0) (not (eobp))) + + ;; @r{between paragraphs} + ;; Move forward over separator lines... + (while (and (not (eobp)) + (progn (move-to-left-margin) (not (eobp))) + (looking-at parsep)) + (forward-line 1)) + ;; @r{This decrements the loop} + (unless (eobp) (setq arg (1- arg))) + ;; ... and one more line. + (forward-line 1) +@end group + +@group + (if fill-prefix-regexp + ;; There is a fill prefix; it overrides parstart; + ;; we go forward line by line + (while (and (not (eobp)) + (progn (move-to-left-margin) (not (eobp))) + (not (looking-at parsep)) + (looking-at fill-prefix-regexp)) + (forward-line 1)) +@end group + +@group + ;; There is no fill prefix; + ;; we go forward character by character + (while (and (re-search-forward sp-parstart nil 1) + (progn (setq start (match-beginning 0)) + (goto-char start) + (not (eobp))) + (progn (move-to-left-margin) + (not (looking-at parsep))) + (or (not (looking-at parstart)) + (and use-hard-newlines + (not (get-text-property (1- start) 'hard))))) + (forward-char 1)) +@end group + +@group + ;; and if there is no fill prefix and if we are not at the end, + ;; go to whatever was found in the regular expression search + ;; for sp-parstart + (if (< (point) (point-max)) + (goto-char start)))) +@end group +@end smallexample + +@findex eobp +We can see that this is a decrementing counter @code{while} loop, +using the expression @code{(setq arg (1- arg))} as the decrementer. +That expression is not far from the @code{while}, but is hidden in +another Lisp macro, an @code{unless} macro. Unless we are at the end +of the buffer --- that is what the @code{eobp} function determines; it +is an abbreviation of @samp{End Of Buffer P} --- we decrease the value +of @code{arg} by one. + +(If we are at the end of the buffer, we cannot go forward any more and +the next loop of the @code{while} expression will test false since the +test is an @code{and} with @code{(not (eobp))}. The @code{not} +function means exactly as you expect; it is another name for +@code{null}, a function that returns true when its argument is false.) + +Interestingly, the loop count is not decremented until we leave the +space between paragraphs, unless we come to the end of buffer or stop +seeing the local value of the paragraph separator. + +That second @code{while} also has a @code{(move-to-left-margin)} +expression. The function is self-explanatory. It is inside a +@code{progn} expression and not the last element of its body, so it is +only invoked for its side effect, which is to move point to the left +margin of the current line. + +@findex looking-at +The @code{looking-at} function is also self-explanatory; it returns +true if the text after point matches the regular expression given as +its argument. + +The rest of the body of the loop looks difficult at first, but makes +sense as you come to understand it. + +@need 800 +First consider what happens if there is a fill prefix: + +@smallexample +@group + (if fill-prefix-regexp + ;; There is a fill prefix; it overrides parstart; + ;; we go forward line by line + (while (and (not (eobp)) + (progn (move-to-left-margin) (not (eobp))) + (not (looking-at parsep)) + (looking-at fill-prefix-regexp)) + (forward-line 1)) +@end group +@end smallexample + +@noindent +This expression moves point forward line by line so long +as four conditions are true: + +@enumerate +@item +Point is not at the end of the buffer. + +@item +We can move to the left margin of the text and are +not at the end of the buffer. + +@item +The text following point does not separate paragraphs. + +@item +The pattern following point is the fill prefix regular expression. +@end enumerate + +The last condition may be puzzling, until you remember that point was +moved to the beginning of the line early in the @code{forward-paragraph} +function. This means that if the text has a fill prefix, the +@code{looking-at} function will see it. + +@need 1250 +Consider what happens when there is no fill prefix. + +@smallexample +@group + (while (and (re-search-forward sp-parstart nil 1) + (progn (setq start (match-beginning 0)) + (goto-char start) + (not (eobp))) + (progn (move-to-left-margin) + (not (looking-at parsep))) + (or (not (looking-at parstart)) + (and use-hard-newlines + (not (get-text-property (1- start) 'hard))))) + (forward-char 1)) +@end group +@end smallexample + +@noindent +This @code{while} loop has us searching forward for +@code{sp-parstart}, which is the combination of possible whitespace +with a the local value of the start of a paragraph or of a paragraph +separator. (The latter two are within an expression starting +@code{\(?:} so that they are not referenced by the +@code{match-beginning} function.) + +@need 800 +The two expressions, + +@smallexample +@group +(setq start (match-beginning 0)) +(goto-char start) +@end group +@end smallexample + +@noindent +mean go to the start of the text matched by the regular expression +search. + +The @code{(match-beginning 0)} expression is new. It returns a number +specifying the location of the start of the text that was matched by +the last search. + +The @code{match-beginning} function is used here because of a +characteristic of a forward search: a successful forward search, +regardless of whether it is a plain search or a regular expression +search, moves point to the end of the text that is found. In this +case, a successful search moves point to the end of the pattern for +@code{sp-parstart}. + +However, we want to put point at the end of the current paragraph, not +somewhere else. Indeed, since the search possibly includes the +paragraph separator, point may end up at the beginning of the next one +unless we use an expression that includes @code{match-beginning}. + +@findex match-beginning +When given an argument of 0, @code{match-beginning} returns the +position that is the start of the text matched by the most recent +search. In this case, the most recent search looks for +@code{sp-parstart}. The @code{(match-beginning 0)} expression returns +the beginning position of that pattern, rather than the end position +of that pattern. + +(Incidentally, when passed a positive number as an argument, the +@code{match-beginning} function returns the location of point at that +parenthesized expression in the last search unless that parenthesized +expression begins with @code{\(?:}. I don't know why @code{\(?:} +appears here since the argument is 0.) + +@need 1250 +The last expression when there is no fill prefix is + +@smallexample +@group +(if (< (point) (point-max)) + (goto-char start)))) +@end group +@end smallexample + +@noindent +This says that if there is no fill prefix and if we are not at the +end, point should move to the beginning of whatever was found by the +regular expression search for @code{sp-parstart}. + +The full definition for the @code{forward-paragraph} function not only +includes code for going forwards, but also code for going backwards. + +If you are reading this inside of GNU Emacs and you want to see the +whole function, you can type @kbd{C-h f} (@code{describe-function}) +and the name of the function. This gives you the function +documentation and the name of the library containing the function's +source. Place point over the name of the library and press the RET +key; you will be taken directly to the source. (Be sure to install +your sources! Without them, you are like a person who tries to drive +a car with his eyes shut!) + +@node etags, Regexp Review, forward-paragraph, Regexp Search +@section Create Your Own @file{TAGS} File +@findex etags +@cindex @file{TAGS} file, create own + +Besides @kbd{C-h f} (@code{describe-function}), another way to see the +source of a function is to type @kbd{M-.} (@code{find-tag}) and the +name of the function when prompted for it. This is a good habit to +get into. The @kbd{M-.} (@code{find-tag}) command takes you directly +to the source for a function, variable, or node. The function depends +on tags tables to tell it where to go. + +If the @code{find-tag} function first asks you for the name of a +@file{TAGS} table, give it the name of a @file{TAGS} file such as +@file{/usr/local/src/emacs/src/TAGS}. (The exact path to your +@file{TAGS} file depends on how your copy of Emacs was installed. I +just told you the location that provides both my C and my Emacs Lisp +sources.) + +You can also create your own @file{TAGS} file for directories that +lack one. + +You often need to build and install tags tables yourself. They are +not built automatically. A tags table is called a @file{TAGS} file; +the name is in upper case letters. + +You can create a @file{TAGS} file by calling the @code{etags} program +that comes as a part of the Emacs distribution. Usually, @code{etags} +is compiled and installed when Emacs is built. (@code{etags} is not +an Emacs Lisp function or a part of Emacs; it is a C program.) + +@need 1250 +To create a @file{TAGS} file, first switch to the directory in which +you want to create the file. In Emacs you can do this with the +@kbd{M-x cd} command, or by visiting a file in the directory, or by +listing the directory with @kbd{C-x d} (@code{dired}). Then run the +compile command, with @w{@code{etags *.el}} as the command to execute + +@smallexample +M-x compile RET etags *.el RET +@end smallexample + +@noindent +to create a @file{TAGS} file for Emacs Lisp. + +For example, if you have a large number of files in your +@file{~/emacs} directory, as I do---I have 137 @file{.el} files in it, +of which I load 12---you can create a @file{TAGS} file for the Emacs +Lisp files in that directory. + +@need 1250 +The @code{etags} program takes all the usual shell `wildcards'. For +example, if you have two directories for which you want a single +@file{TAGS} file, type @w{@code{etags *.el ../elisp/*.el}}, where +@file{../elisp/} is the second directory: + +@smallexample +M-x compile RET etags *.el ../elisp/*.el RET +@end smallexample + +@need 1250 +Type + +@smallexample +M-x compile RET etags --help RET +@end smallexample + +@noindent +to see a list of the options accepted by @code{etags} as well as a +list of supported languages. + +The @code{etags} program handles more than 20 languages, including +Emacs Lisp, Common Lisp, Scheme, C, C++, Ada, Fortran, HTML, Java, +LaTeX, Pascal, Perl, Postscript, Python, TeX, Texinfo, makefiles, and +most assemblers. The program has no switches for specifying the +language; it recognizes the language in an input file according to its +file name and contents. + +@file{etags} is very helpful when you are writing code yourself and +want to refer back to functions you have already written. Just run +@code{etags} again at intervals as you write new functions, so they +become part of the @file{TAGS} file. + +If you think an appropriate @file{TAGS} file already exists for what +you want, but do not know where it is, you can use the @code{locate} +program to attempt to find it. + +Type @w{@kbd{M-x locate @key{RET} TAGS @key{RET}}} and Emacs will list +for you the full path names of all your @file{TAGS} files. On my +system, this command lists 34 @file{TAGS} files. On the other hand, a +`plain vanilla' system I recently installed did not contain any +@file{TAGS} files. + +If the tags table you want has been created, you can use the @code{M-x +visit-tags-table} command to specify it. Otherwise, you will need to +create the tag table yourself and then use @code{M-x +visit-tags-table}. + +@subsubheading Building Tags in the Emacs sources +@cindex Building Tags in the Emacs sources +@cindex Tags in the Emacs sources +@findex make tags + +The GNU Emacs sources come with a @file{Makefile} that contains a +sophisticated @code{etags} command that creates, collects, and merges +tags tables from all over the Emacs sources and puts the information +into one @file{TAGS} file in the @file{src/} directory. (The +@file{src/} directory is below the top level of your Emacs directory.) + +@need 1250 +To build this @file{TAGS} file, go to the top level of your Emacs +source directory and run the compile command @code{make tags}: + +@smallexample +M-x compile RET make tags RET +@end smallexample + +@noindent +(The @code{make tags} command works well with the GNU Emacs sources, +as well as with some other source packages.) + +For more information, see @ref{Tags, , Tag Tables, emacs, The GNU Emacs +Manual}. + +@node Regexp Review, re-search Exercises, etags, Regexp Search +@comment node-name, next, previous, up +@section Review + +Here is a brief summary of some recently introduced functions. + +@table @code +@item while +Repeatedly evaluate the body of the expression so long as the first +element of the body tests true. Then return @code{nil}. (The +expression is evaluated only for its side effects.) + +@need 1250 +For example: + +@smallexample +@group +(let ((foo 2)) + (while (> foo 0) + (insert (format "foo is %d.\n" foo)) + (setq foo (1- foo)))) + + @result{} foo is 2. + foo is 1. + nil +@end group +@end smallexample + +@noindent +(The @code{insert} function inserts its arguments at point; the +@code{format} function returns a string formatted from its arguments +the way @code{message} formats its arguments; @code{\n} produces a new +line.) + +@item re-search-forward +Search for a pattern, and if the pattern is found, move point to rest +just after it. + +@noindent +Takes four arguments, like @code{search-forward}: + +@enumerate +@item +A regular expression that specifies the pattern to search for. +(Remember to put quotation marks around this argument!) + +@item +Optionally, the limit of the search. + +@item +Optionally, what to do if the search fails, return @code{nil} or an +error message. + +@item +Optionally, how many times to repeat the search; if negative, the +search goes backwards. +@end enumerate + +@item let* +Bind some variables locally to particular values, +and then evaluate the remaining arguments, returning the value of the +last one. While binding the local variables, use the local values of +variables bound earlier, if any. + +@need 1250 +For example: + +@smallexample +@group +(let* ((foo 7) + (bar (* 3 foo))) + (message "`bar' is %d." bar)) + @result{} `bar' is 21. +@end group +@end smallexample + +@item match-beginning +Return the position of the start of the text found by the last regular +expression search. + +@item looking-at +Return @code{t} for true if the text after point matches the argument, +which should be a regular expression. + +@item eobp +Return @code{t} for true if point is at the end of the accessible part +of a buffer. The end of the accessible part is the end of the buffer +if the buffer is not narrowed; it is the end of the narrowed part if +the buffer is narrowed. +@end table + +@need 1500 +@node re-search Exercises, , Regexp Review, Regexp Search +@section Exercises with @code{re-search-forward} + +@itemize @bullet +@item +Write a function to search for a regular expression that matches two +or more blank lines in sequence. + +@item +Write a function to search for duplicated words, such as `the the'. +@xref{Regexps, , Syntax of Regular Expressions, emacs, The GNU Emacs +Manual}, for information on how to write a regexp (a regular +expression) to match a string that is composed of two identical +halves. You can devise several regexps; some are better than others. +The function I use is described in an appendix, along with several +regexps. @xref{the-the, , @code{the-the} Duplicated Words Function}. +@end itemize + +@node Counting Words, Words in a defun, Regexp Search, Top +@chapter Counting: Repetition and Regexps +@cindex Repetition for word counting +@cindex Regular expressions for word counting + +Repetition and regular expression searches are powerful tools that you +often use when you write code in Emacs Lisp. This chapter illustrates +the use of regular expression searches through the construction of +word count commands using @code{while} loops and recursion. + +@menu +* Why Count Words:: +* count-words-region:: Use a regexp, but find a problem. +* recursive-count-words:: Start with case of no words in region. +* Counting Exercise:: +@end menu + +@node Why Count Words, count-words-region, Counting Words, Counting Words +@ifnottex +@unnumberedsec Counting words +@end ifnottex + +The standard Emacs distribution contains a function for counting the +number of lines within a region. However, there is no corresponding +function for counting words. + +Certain types of writing ask you to count words. Thus, if you write +an essay, you may be limited to 800 words; if you write a novel, you +may discipline yourself to write 1000 words a day. It seems odd to me +that Emacs lacks a word count command. Perhaps people use Emacs +mostly for code or types of documentation that do not require word +counts; or perhaps they restrict themselves to the operating system +word count command, @code{wc}. Alternatively, people may follow +the publishers' convention and compute a word count by dividing the +number of characters in a document by five. In any event, here are +commands to count words. + +@node count-words-region, recursive-count-words, Why Count Words, Counting Words +@comment node-name, next, previous, up +@section The @code{count-words-region} Function +@findex count-words-region + +A word count command could count words in a line, paragraph, region, +or buffer. What should the command cover? You could design the +command to count the number of words in a complete buffer. However, +the Emacs tradition encourages flexibility---you may want to count +words in just a section, rather than all of a buffer. So it makes +more sense to design the command to count the number of words in a +region. Once you have a @code{count-words-region} command, you can, +if you wish, count words in a whole buffer by marking it with +@w{@kbd{C-x h}} (@code{mark-whole-buffer}). + +Clearly, counting words is a repetitive act: starting from the +beginning of the region, you count the first word, then the second +word, then the third word, and so on, until you reach the end of the +region. This means that word counting is ideally suited to recursion +or to a @code{while} loop. + +@menu +* Design count-words-region:: The definition using a @code{while} loop. +* Whitespace Bug:: The Whitespace Bug in @code{count-words-region}. +@end menu + +@node Design count-words-region, Whitespace Bug, count-words-region, count-words-region +@ifnottex +@unnumberedsubsec Designing @code{count-words-region} +@end ifnottex + +First, we will implement the word count command with a @code{while} +loop, then with recursion. The command will, of course, be +interactive. + +@need 800 +The template for an interactive function definition is, as always: + +@smallexample +@group +(defun @var{name-of-function} (@var{argument-list}) + "@var{documentation}@dots{}" + (@var{interactive-expression}@dots{}) + @var{body}@dots{}) +@end group +@end smallexample + +What we need to do is fill in the slots. + +The name of the function should be self-explanatory and similar to the +existing @code{count-lines-region} name. This makes the name easier +to remember. @code{count-words-region} is a good choice. + +The function counts words within a region. This means that the +argument list must contain symbols that are bound to the two +positions, the beginning and end of the region. These two positions +can be called @samp{beginning} and @samp{end} respectively. The first +line of the documentation should be a single sentence, since that is +all that is printed as documentation by a command such as +@code{apropos}. The interactive expression will be of the form +@samp{(interactive "r")}, since that will cause Emacs to pass the +beginning and end of the region to the function's argument list. All +this is routine. + +The body of the function needs to be written to do three tasks: +first, to set up conditions under which the @code{while} loop can +count words, second, to run the @code{while} loop, and third, to send +a message to the user. + +When a user calls @code{count-words-region}, point may be at the +beginning or the end of the region. However, the counting process +must start at the beginning of the region. This means we will want +to put point there if it is not already there. Executing +@code{(goto-char beginning)} ensures this. Of course, we will want to +return point to its expected position when the function finishes its +work. For this reason, the body must be enclosed in a +@code{save-excursion} expression. + +The central part of the body of the function consists of a +@code{while} loop in which one expression jumps point forward word by +word, and another expression counts those jumps. The true-or-false-test +of the @code{while} loop should test true so long as point should jump +forward, and false when point is at the end of the region. + +We could use @code{(forward-word 1)} as the expression for moving point +forward word by word, but it is easier to see what Emacs identifies as a +`word' if we use a regular expression search. + +A regular expression search that finds the pattern for which it is +searching leaves point after the last character matched. This means +that a succession of successful word searches will move point forward +word by word. + +As a practical matter, we want the regular expression search to jump +over whitespace and punctuation between words as well as over the +words themselves. A regexp that refuses to jump over interword +whitespace would never jump more than one word! This means that +the regexp should include the whitespace and punctuation that follows +a word, if any, as well as the word itself. (A word may end a buffer +and not have any following whitespace or punctuation, so that part of +the regexp must be optional.) + +Thus, what we want for the regexp is a pattern defining one or more +word constituent characters followed, optionally, by one or more +characters that are not word constituents. The regular expression for +this is: + +@smallexample +\w+\W* +@end smallexample + +@noindent +The buffer's syntax table determines which characters are and are not +word constituents. (@xref{Syntax, , What Constitutes a Word or +Symbol?}, for more about syntax. Also, see @ref{Syntax, Syntax, The +Syntax Table, emacs, The GNU Emacs Manual}, and @ref{Syntax Tables, , +Syntax Tables, elisp, The GNU Emacs Lisp Reference Manual}.) + +@need 800 +The search expression looks like this: + +@smallexample +(re-search-forward "\\w+\\W*") +@end smallexample + +@noindent +(Note that paired backslashes precede the @samp{w} and @samp{W}. A +single backslash has special meaning to the Emacs Lisp interpreter. +It indicates that the following character is interpreted differently +than usual. For example, the two characters, @samp{\n}, stand for +@samp{newline}, rather than for a backslash followed by @samp{n}. Two +backslashes in a row stand for an ordinary, `unspecial' backslash, so +Emacs Lisp interpreter ends of seeing a single backslash followed by a +letter. So it discovers the letter is special.) + +We need a counter to count how many words there are; this variable +must first be set to 0 and then incremented each time Emacs goes +around the @code{while} loop. The incrementing expression is simply: + +@smallexample +(setq count (1+ count)) +@end smallexample + +Finally, we want to tell the user how many words there are in the +region. The @code{message} function is intended for presenting this +kind of information to the user. The message has to be phrased so +that it reads properly regardless of how many words there are in the +region: we don't want to say that ``there are 1 words in the region''. +The conflict between singular and plural is ungrammatical. We can +solve this problem by using a conditional expression that evaluates +different messages depending on the number of words in the region. +There are three possibilities: no words in the region, one word in the +region, and more than one word. This means that the @code{cond} +special form is appropriate. + +@need 1500 +All this leads to the following function definition: + +@smallexample +@group +;;; @r{First version; has bugs!} +(defun count-words-region (beginning end) + "Print number of words in the region. +Words are defined as at least one word-constituent +character followed by at least one character that +is not a word-constituent. The buffer's syntax +table determines which characters these are." + (interactive "r") + (message "Counting words in region ... ") +@end group + +@group +;;; @r{1. Set up appropriate conditions.} + (save-excursion + (goto-char beginning) + (let ((count 0)) +@end group + +@group +;;; @r{2. Run the} while @r{loop.} + (while (< (point) end) + (re-search-forward "\\w+\\W*") + (setq count (1+ count))) +@end group + +@group +;;; @r{3. Send a message to the user.} + (cond ((zerop count) + (message + "The region does NOT have any words.")) + ((= 1 count) + (message + "The region has 1 word.")) + (t + (message + "The region has %d words." count)))))) +@end group +@end smallexample + +@noindent +As written, the function works, but not in all circumstances. + +@node Whitespace Bug, , Design count-words-region, count-words-region +@comment node-name, next, previous, up +@subsection The Whitespace Bug in @code{count-words-region} + +The @code{count-words-region} command described in the preceding +section has two bugs, or rather, one bug with two manifestations. +First, if you mark a region containing only whitespace in the middle +of some text, the @code{count-words-region} command tells you that the +region contains one word! Second, if you mark a region containing +only whitespace at the end of the buffer or the accessible portion of +a narrowed buffer, the command displays an error message that looks +like this: + +@smallexample +Search failed: "\\w+\\W*" +@end smallexample + +If you are reading this in Info in GNU Emacs, you can test for these +bugs yourself. + +First, evaluate the function in the usual manner to install it. +@ifinfo +Here is a copy of the definition. Place your cursor after the closing +parenthesis and type @kbd{C-x C-e} to install it. + +@smallexample +@group +;; @r{First version; has bugs!} +(defun count-words-region (beginning end) + "Print number of words in the region. +Words are defined as at least one word-constituent character followed +by at least one character that is not a word-constituent. The buffer's +syntax table determines which characters these are." +@end group +@group + (interactive "r") + (message "Counting words in region ... ") +@end group + +@group +;;; @r{1. Set up appropriate conditions.} + (save-excursion + (goto-char beginning) + (let ((count 0)) +@end group + +@group +;;; @r{2. Run the} while @r{loop.} + (while (< (point) end) + (re-search-forward "\\w+\\W*") + (setq count (1+ count))) +@end group + +@group +;;; @r{3. Send a message to the user.} + (cond ((zerop count) + (message "The region does NOT have any words.")) + ((= 1 count) (message "The region has 1 word.")) + (t (message "The region has %d words." count)))))) +@end group +@end smallexample +@end ifinfo + +@need 1000 +If you wish, you can also install this keybinding by evaluating it: + +@smallexample +(global-set-key "\C-c=" 'count-words-region) +@end smallexample + +To conduct the first test, set mark and point to the beginning and end +of the following line and then type @kbd{C-c =} (or @kbd{M-x +count-words-region} if you have not bound @kbd{C-c =}): + +@smallexample + one two three +@end smallexample + +@noindent +Emacs will tell you, correctly, that the region has three words. + +Repeat the test, but place mark at the beginning of the line and place +point just @emph{before} the word @samp{one}. Again type the command +@kbd{C-c =} (or @kbd{M-x count-words-region}). Emacs should tell you +that the region has no words, since it is composed only of the +whitespace at the beginning of the line. But instead Emacs tells you +that the region has one word! + +For the third test, copy the sample line to the end of the +@file{*scratch*} buffer and then type several spaces at the end of the +line. Place mark right after the word @samp{three} and point at the +end of line. (The end of the line will be the end of the buffer.) +Type @kbd{C-c =} (or @kbd{M-x count-words-region}) as you did before. +Again, Emacs should tell you that the region has no words, since it is +composed only of the whitespace at the end of the line. Instead, +Emacs displays an error message saying @samp{Search failed}. + +The two bugs stem from the same problem. + +Consider the first manifestation of the bug, in which the command +tells you that the whitespace at the beginning of the line contains +one word. What happens is this: The @code{M-x count-words-region} +command moves point to the beginning of the region. The @code{while} +tests whether the value of point is smaller than the value of +@code{end}, which it is. Consequently, the regular expression search +looks for and finds the first word. It leaves point after the word. +@code{count} is set to one. The @code{while} loop repeats; but this +time the value of point is larger than the value of @code{end}, the +loop is exited; and the function displays a message saying the number +of words in the region is one. In brief, the regular expression +search looks for and finds the word even though it is outside +the marked region. + +In the second manifestation of the bug, the region is whitespace at +the end of the buffer. Emacs says @samp{Search failed}. What happens +is that the true-or-false-test in the @code{while} loop tests true, so +the search expression is executed. But since there are no more words +in the buffer, the search fails. + +In both manifestations of the bug, the search extends or attempts to +extend outside of the region. + +The solution is to limit the search to the region---this is a fairly +simple action, but as you may have come to expect, it is not quite as +simple as you might think. + +As we have seen, the @code{re-search-forward} function takes a search +pattern as its first argument. But in addition to this first, +mandatory argument, it accepts three optional arguments. The optional +second argument bounds the search. The optional third argument, if +@code{t}, causes the function to return @code{nil} rather than signal +an error if the search fails. The optional fourth argument is a +repeat count. (In Emacs, you can see a function's documentation by +typing @kbd{C-h f}, the name of the function, and then @key{RET}.) + +In the @code{count-words-region} definition, the value of the end of +the region is held by the variable @code{end} which is passed as an +argument to the function. Thus, we can add @code{end} as an argument +to the regular expression search expression: + +@smallexample +(re-search-forward "\\w+\\W*" end) +@end smallexample + +However, if you make only this change to the @code{count-words-region} +definition and then test the new version of the definition on a +stretch of whitespace, you will receive an error message saying +@samp{Search failed}. + +What happens is this: the search is limited to the region, and fails +as you expect because there are no word-constituent characters in the +region. Since it fails, we receive an error message. But we do not +want to receive an error message in this case; we want to receive the +message that "The region does NOT have any words." + +The solution to this problem is to provide @code{re-search-forward} +with a third argument of @code{t}, which causes the function to return +@code{nil} rather than signal an error if the search fails. + +However, if you make this change and try it, you will see the message +``Counting words in region ... '' and @dots{} you will keep on seeing +that message @dots{}, until you type @kbd{C-g} (@code{keyboard-quit}). + +Here is what happens: the search is limited to the region, as before, +and it fails because there are no word-constituent characters in the +region, as expected. Consequently, the @code{re-search-forward} +expression returns @code{nil}. It does nothing else. In particular, +it does not move point, which it does as a side effect if it finds the +search target. After the @code{re-search-forward} expression returns +@code{nil}, the next expression in the @code{while} loop is evaluated. +This expression increments the count. Then the loop repeats. The +true-or-false-test tests true because the value of point is still less +than the value of end, since the @code{re-search-forward} expression +did not move point. @dots{} and the cycle repeats @dots{} + +The @code{count-words-region} definition requires yet another +modification, to cause the true-or-false-test of the @code{while} loop +to test false if the search fails. Put another way, there are two +conditions that must be satisfied in the true-or-false-test before the +word count variable is incremented: point must still be within the +region and the search expression must have found a word to count. + +Since both the first condition and the second condition must be true +together, the two expressions, the region test and the search +expression, can be joined with an @code{and} special form and embedded in +the @code{while} loop as the true-or-false-test, like this: + +@smallexample +(and (< (point) end) (re-search-forward "\\w+\\W*" end t)) +@end smallexample + +@c colon in printed section title causes problem in Info cross reference +@c also trouble with an overfull hbox +@iftex +@noindent +(For information about @code{and}, see +@ref{kill-new function, , The @code{kill-new} function}.) +@end iftex +@ifinfo +@noindent +(@xref{kill-new function, , The @code{kill-new} function}, for +information about @code{and}.) +@end ifinfo + +The @code{re-search-forward} expression returns @code{t} if the search +succeeds and as a side effect moves point. Consequently, as words are +found, point is moved through the region. When the search expression +fails to find another word, or when point reaches the end of the +region, the true-or-false-test tests false, the @code{while} loop +exits, and the @code{count-words-region} function displays one or +other of its messages. + +After incorporating these final changes, the @code{count-words-region} +works without bugs (or at least, without bugs that I have found!). +Here is what it looks like: + +@smallexample +@group +;;; @r{Final version:} @code{while} +(defun count-words-region (beginning end) + "Print number of words in the region." + (interactive "r") + (message "Counting words in region ... ") +@end group + +@group +;;; @r{1. Set up appropriate conditions.} + (save-excursion + (let ((count 0)) + (goto-char beginning) +@end group + +@group +;;; @r{2. Run the} while @r{loop.} + (while (and (< (point) end) + (re-search-forward "\\w+\\W*" end t)) + (setq count (1+ count))) +@end group + +@group +;;; @r{3. Send a message to the user.} + (cond ((zerop count) + (message + "The region does NOT have any words.")) + ((= 1 count) + (message + "The region has 1 word.")) + (t + (message + "The region has %d words." count)))))) +@end group +@end smallexample + +@node recursive-count-words, Counting Exercise, count-words-region, Counting Words +@comment node-name, next, previous, up +@section Count Words Recursively +@cindex Count words recursively +@cindex Recursively counting words +@cindex Words, counted recursively + +You can write the function for counting words recursively as well as +with a @code{while} loop. Let's see how this is done. + +First, we need to recognize that the @code{count-words-region} +function has three jobs: it sets up the appropriate conditions for +counting to occur; it counts the words in the region; and it sends a +message to the user telling how many words there are. + +If we write a single recursive function to do everything, we will +receive a message for every recursive call. If the region contains 13 +words, we will receive thirteen messages, one right after the other. +We don't want this! Instead, we must write two functions to do the +job, one of which (the recursive function) will be used inside of the +other. One function will set up the conditions and display the +message; the other will return the word count. + +Let us start with the function that causes the message to be displayed. +We can continue to call this @code{count-words-region}. + +This is the function that the user will call. It will be interactive. +Indeed, it will be similar to our previous versions of this +function, except that it will call @code{recursive-count-words} to +determine how many words are in the region. + +@need 1250 +We can readily construct a template for this function, based on our +previous versions: + +@smallexample +@group +;; @r{Recursive version; uses regular expression search} +(defun count-words-region (beginning end) + "@var{documentation}@dots{}" + (@var{interactive-expression}@dots{}) +@end group +@group + +;;; @r{1. Set up appropriate conditions.} + (@var{explanatory message}) + (@var{set-up functions}@dots{} +@end group +@group + +;;; @r{2. Count the words.} + @var{recursive call} +@end group +@group + +;;; @r{3. Send a message to the user.} + @var{message providing word count})) +@end group +@end smallexample + +The definition looks straightforward, except that somehow the count +returned by the recursive call must be passed to the message +displaying the word count. A little thought suggests that this can be +done by making use of a @code{let} expression: we can bind a variable +in the varlist of a @code{let} expression to the number of words in +the region, as returned by the recursive call; and then the +@code{cond} expression, using binding, can display the value to the +user. + +Often, one thinks of the binding within a @code{let} expression as +somehow secondary to the `primary' work of a function. But in this +case, what you might consider the `primary' job of the function, +counting words, is done within the @code{let} expression. + +@need 1250 +Using @code{let}, the function definition looks like this: + +@smallexample +@group +(defun count-words-region (beginning end) + "Print number of words in the region." + (interactive "r") +@end group + +@group +;;; @r{1. Set up appropriate conditions.} + (message "Counting words in region ... ") + (save-excursion + (goto-char beginning) +@end group + +@group +;;; @r{2. Count the words.} + (let ((count (recursive-count-words end))) +@end group + +@group +;;; @r{3. Send a message to the user.} + (cond ((zerop count) + (message + "The region does NOT have any words.")) + ((= 1 count) + (message + "The region has 1 word.")) + (t + (message + "The region has %d words." count)))))) +@end group +@end smallexample + +Next, we need to write the recursive counting function. + +A recursive function has at least three parts: the `do-again-test', the +`next-step-expression', and the recursive call. + +The do-again-test determines whether the function will or will not be +called again. Since we are counting words in a region and can use a +function that moves point forward for every word, the do-again-test +can check whether point is still within the region. The do-again-test +should find the value of point and determine whether point is before, +at, or after the value of the end of the region. We can use the +@code{point} function to locate point. Clearly, we must pass the +value of the end of the region to the recursive counting function as an +argument. + +In addition, the do-again-test should also test whether the search finds a +word. If it does not, the function should not call itself again. + +The next-step-expression changes a value so that when the recursive +function is supposed to stop calling itself, it stops. More +precisely, the next-step-expression changes a value so that at the +right time, the do-again-test stops the recursive function from +calling itself again. In this case, the next-step-expression can be +the expression that moves point forward, word by word. + +The third part of a recursive function is the recursive call. + +Somewhere, also, we also need a part that does the `work' of the +function, a part that does the counting. A vital part! + +@need 1250 +But already, we have an outline of the recursive counting function: + +@smallexample +@group +(defun recursive-count-words (region-end) + "@var{documentation}@dots{}" + @var{do-again-test} + @var{next-step-expression} + @var{recursive call}) +@end group +@end smallexample + +Now we need to fill in the slots. Let's start with the simplest cases +first: if point is at or beyond the end of the region, there cannot +be any words in the region, so the function should return zero. +Likewise, if the search fails, there are no words to count, so the +function should return zero. + +On the other hand, if point is within the region and the search +succeeds, the function should call itself again. + +@need 800 +Thus, the do-again-test should look like this: + +@smallexample +@group +(and (< (point) region-end) + (re-search-forward "\\w+\\W*" region-end t)) +@end group +@end smallexample + +Note that the search expression is part of the do-again-test---the +function returns @code{t} if its search succeeds and @code{nil} if it +fails. (@xref{Whitespace Bug, , The Whitespace Bug in +@code{count-words-region}}, for an explanation of how +@code{re-search-forward} works.) + +The do-again-test is the true-or-false test of an @code{if} clause. +Clearly, if the do-again-test succeeds, the then-part of the @code{if} +clause should call the function again; but if it fails, the else-part +should return zero since either point is outside the region or the +search failed because there were no words to find. + +But before considering the recursive call, we need to consider the +next-step-expression. What is it? Interestingly, it is the search +part of the do-again-test. + +In addition to returning @code{t} or @code{nil} for the +do-again-test, @code{re-search-forward} moves point forward as a side +effect of a successful search. This is the action that changes the +value of point so that the recursive function stops calling itself +when point completes its movement through the region. Consequently, +the @code{re-search-forward} expression is the next-step-expression. + +@need 1200 +In outline, then, the body of the @code{recursive-count-words} +function looks like this: + +@smallexample +@group +(if @var{do-again-test-and-next-step-combined} + ;; @r{then} + @var{recursive-call-returning-count} + ;; @r{else} + @var{return-zero}) +@end group +@end smallexample + +How to incorporate the mechanism that counts? + +If you are not used to writing recursive functions, a question like +this can be troublesome. But it can and should be approached +systematically. + +We know that the counting mechanism should be associated in some way +with the recursive call. Indeed, since the next-step-expression moves +point forward by one word, and since a recursive call is made for +each word, the counting mechanism must be an expression that adds one +to the value returned by a call to @code{recursive-count-words}. + +@need 800 +Consider several cases: + +@itemize @bullet +@item +If there are two words in the region, the function should return +a value resulting from adding one to the value returned when it counts +the first word, plus the number returned when it counts the remaining +words in the region, which in this case is one. + +@item +If there is one word in the region, the function should return +a value resulting from adding one to the value returned when it counts +that word, plus the number returned when it counts the remaining +words in the region, which in this case is zero. + +@item +If there are no words in the region, the function should return zero. +@end itemize + +From the sketch we can see that the else-part of the @code{if} returns +zero for the case of no words. This means that the then-part of the +@code{if} must return a value resulting from adding one to the value +returned from a count of the remaining words. + +@need 1200 +The expression will look like this, where @code{1+} is a function that +adds one to its argument. + +@smallexample +(1+ (recursive-count-words region-end)) +@end smallexample + +@need 1200 +The whole @code{recursive-count-words} function will then look like +this: + +@smallexample +@group +(defun recursive-count-words (region-end) + "@var{documentation}@dots{}" + +;;; @r{1. do-again-test} + (if (and (< (point) region-end) + (re-search-forward "\\w+\\W*" region-end t)) +@end group + +@group +;;; @r{2. then-part: the recursive call} + (1+ (recursive-count-words region-end)) + +;;; @r{3. else-part} + 0)) +@end group +@end smallexample + +@need 1250 +Let's examine how this works: + +If there are no words in the region, the else part of the @code{if} +expression is evaluated and consequently the function returns zero. + +If there is one word in the region, the value of point is less than +the value of @code{region-end} and the search succeeds. In this case, +the true-or-false-test of the @code{if} expression tests true, and the +then-part of the @code{if} expression is evaluated. The counting +expression is evaluated. This expression returns a value (which will +be the value returned by the whole function) that is the sum of one +added to the value returned by a recursive call. + +Meanwhile, the next-step-expression has caused point to jump over the +first (and in this case only) word in the region. This means that +when @code{(recursive-count-words region-end)} is evaluated a second +time, as a result of the recursive call, the value of point will be +equal to or greater than the value of region end. So this time, +@code{recursive-count-words} will return zero. The zero will be added +to one, and the original evaluation of @code{recursive-count-words} +will return one plus zero, which is one, which is the correct amount. + +Clearly, if there are two words in the region, the first call to +@code{recursive-count-words} returns one added to the value returned +by calling @code{recursive-count-words} on a region containing the +remaining word---that is, it adds one to one, producing two, which is +the correct amount. + +Similarly, if there are three words in the region, the first call to +@code{recursive-count-words} returns one added to the value returned +by calling @code{recursive-count-words} on a region containing the +remaining two words---and so on and so on. + +@need 1250 +@noindent +With full documentation the two functions look like this: + +@need 1250 +@noindent +The recursive function: + +@findex recursive-count-words +@smallexample +@group +(defun recursive-count-words (region-end) + "Number of words between point and REGION-END." +@end group + +@group +;;; @r{1. do-again-test} + (if (and (< (point) region-end) + (re-search-forward "\\w+\\W*" region-end t)) +@end group + +@group +;;; @r{2. then-part: the recursive call} + (1+ (recursive-count-words region-end)) + +;;; @r{3. else-part} + 0)) +@end group +@end smallexample + +@need 800 +@noindent +The wrapper: + +@smallexample +@group +;;; @r{Recursive version} +(defun count-words-region (beginning end) + "Print number of words in the region. +@end group + +@group +Words are defined as at least one word-constituent +character followed by at least one character that is +not a word-constituent. The buffer's syntax table +determines which characters these are." +@end group +@group + (interactive "r") + (message "Counting words in region ... ") + (save-excursion + (goto-char beginning) + (let ((count (recursive-count-words end))) +@end group +@group + (cond ((zerop count) + (message + "The region does NOT have any words.")) +@end group +@group + ((= 1 count) + (message "The region has 1 word.")) + (t + (message + "The region has %d words." count)))))) +@end group +@end smallexample + +@node Counting Exercise, , recursive-count-words, Counting Words +@section Exercise: Counting Punctuation + +Using a @code{while} loop, write a function to count the number of +punctuation marks in a region---period, comma, semicolon, colon, +exclamation mark, and question mark. Do the same using recursion. + +@node Words in a defun, Readying a Graph, Counting Words, Top +@chapter Counting Words in a @code{defun} +@cindex Counting words in a @code{defun} +@cindex Word counting in a @code{defun} + +Our next project is to count the number of words in a function +definition. Clearly, this can be done using some variant of +@code{count-word-region}. @xref{Counting Words, , Counting Words: +Repetition and Regexps}. If we are just going to count the words in +one definition, it is easy enough to mark the definition with the +@kbd{C-M-h} (@code{mark-defun}) command, and then call +@code{count-word-region}. + +However, I am more ambitious: I want to count the words and symbols in +every definition in the Emacs sources and then print a graph that +shows how many functions there are of each length: how many contain 40 +to 49 words or symbols, how many contain 50 to 59 words or symbols, +and so on. I have often been curious how long a typical function is, +and this will tell. + +@menu +* Divide and Conquer:: +* Words and Symbols:: What to count? +* Syntax:: What constitutes a word or symbol? +* count-words-in-defun:: Very like @code{count-words}. +* Several defuns:: Counting several defuns in a file. +* Find a File:: Do you want to look at a file? +* lengths-list-file:: A list of the lengths of many definitions. +* Several files:: Counting in definitions in different files. +* Several files recursively:: Recursively counting in different files. +* Prepare the data:: Prepare the data for display in a graph. +@end menu + +@node Divide and Conquer, Words and Symbols, Words in a defun, Words in a defun +@ifnottex +@unnumberedsec Divide and Conquer +@end ifnottex + +Described in one phrase, the histogram project is daunting; but +divided into numerous small steps, each of which we can take one at a +time, the project becomes less fearsome. Let us consider what the +steps must be: + +@itemize @bullet +@item +First, write a function to count the words in one definition. This +includes the problem of handling symbols as well as words. + +@item +Second, write a function to list the numbers of words in each function +in a file. This function can use the @code{count-words-in-defun} +function. + +@item +Third, write a function to list the numbers of words in each function +in each of several files. This entails automatically finding the +various files, switching to them, and counting the words in the +definitions within them. + +@item +Fourth, write a function to convert the list of numbers that we +created in step three to a form that will be suitable for printing as +a graph. + +@item +Fifth, write a function to print the results as a graph. +@end itemize + +This is quite a project! But if we take each step slowly, it will not +be difficult. + +@node Words and Symbols, Syntax, Divide and Conquer, Words in a defun +@section What to Count? +@cindex Words and symbols in defun + +When we first start thinking about how to count the words in a +function definition, the first question is (or ought to be) what are +we going to count? When we speak of `words' with respect to a Lisp +function definition, we are actually speaking, in large part, of +`symbols'. For example, the following @code{multiply-by-seven} +function contains the five symbols @code{defun}, +@code{multiply-by-seven}, @code{number}, @code{*}, and @code{7}. In +addition, in the documentation string, it contains the four words +@samp{Multiply}, @samp{NUMBER}, @samp{by}, and @samp{seven}. The +symbol @samp{number} is repeated, so the definition contains a total +of ten words and symbols. + +@smallexample +@group +(defun multiply-by-seven (number) + "Multiply NUMBER by seven." + (* 7 number)) +@end group +@end smallexample + +@noindent +However, if we mark the @code{multiply-by-seven} definition with +@kbd{C-M-h} (@code{mark-defun}), and then call +@code{count-words-region} on it, we will find that +@code{count-words-region} claims the definition has eleven words, not +ten! Something is wrong! + +The problem is twofold: @code{count-words-region} does not count the +@samp{*} as a word, and it counts the single symbol, +@code{multiply-by-seven}, as containing three words. The hyphens are +treated as if they were interword spaces rather than intraword +connectors: @samp{multiply-by-seven} is counted as if it were written +@samp{multiply by seven}. + +The cause of this confusion is the regular expression search within +the @code{count-words-region} definition that moves point forward word +by word. In the canonical version of @code{count-words-region}, the +regexp is: + +@smallexample +"\\w+\\W*" +@end smallexample + +@noindent +This regular expression is a pattern defining one or more word +constituent characters possibly followed by one or more characters +that are not word constituents. What is meant by `word constituent +characters' brings us to the issue of syntax, which is worth a section +of its own. + +@node Syntax, count-words-in-defun, Words and Symbols, Words in a defun +@section What Constitutes a Word or Symbol? +@cindex Syntax categories and tables + +Emacs treats different characters as belonging to different +@dfn{syntax categories}. For example, the regular expression, +@samp{\\w+}, is a pattern specifying one or more @emph{word +constituent} characters. Word constituent characters are members of +one syntax category. Other syntax categories include the class of +punctuation characters, such as the period and the comma, and the +class of whitespace characters, such as the blank space and the tab +character. (For more information, see @ref{Syntax, Syntax, The Syntax +Table, emacs, The GNU Emacs Manual}, and @ref{Syntax Tables, , Syntax +Tables, elisp, The GNU Emacs Lisp Reference Manual}.) + +Syntax tables specify which characters belong to which categories. +Usually, a hyphen is not specified as a `word constituent character'. +Instead, it is specified as being in the `class of characters that are +part of symbol names but not words.' This means that the +@code{count-words-region} function treats it in the same way it treats +an interword white space, which is why @code{count-words-region} +counts @samp{multiply-by-seven} as three words. + +There are two ways to cause Emacs to count @samp{multiply-by-seven} as +one symbol: modify the syntax table or modify the regular expression. + +We could redefine a hyphen as a word constituent character by +modifying the syntax table that Emacs keeps for each mode. This +action would serve our purpose, except that a hyphen is merely the +most common character within symbols that is not typically a word +constituent character; there are others, too. + +Alternatively, we can redefine the regular expression used in the +@code{count-words} definition so as to include symbols. This +procedure has the merit of clarity, but the task is a little tricky. + +@need 1200 +The first part is simple enough: the pattern must match ``at least one +character that is a word or symbol constituent''. Thus: + +@smallexample +"\\(\\w\\|\\s_\\)+" +@end smallexample + +@noindent +The @samp{\\(} is the first part of the grouping construct that +includes the @samp{\\w} and the @samp{\\s_} as alternatives, separated +by the @samp{\\|}. The @samp{\\w} matches any word-constituent +character and the @samp{\\s_} matches any character that is part of a +symbol name but not a word-constituent character. The @samp{+} +following the group indicates that the word or symbol constituent +characters must be matched at least once. + +However, the second part of the regexp is more difficult to design. +What we want is to follow the first part with ``optionally one or more +characters that are not constituents of a word or symbol''. At first, +I thought I could define this with the following: + +@smallexample +"\\(\\W\\|\\S_\\)*" +@end smallexample + +@noindent +The upper case @samp{W} and @samp{S} match characters that are +@emph{not} word or symbol constituents. Unfortunately, this +expression matches any character that is either not a word constituent +or not a symbol constituent. This matches any character! + +I then noticed that every word or symbol in my test region was +followed by white space (blank space, tab, or newline). So I tried +placing a pattern to match one or more blank spaces after the pattern +for one or more word or symbol constituents. This failed, too. Words +and symbols are often separated by whitespace, but in actual code +parentheses may follow symbols and punctuation may follow words. So +finally, I designed a pattern in which the word or symbol constituents +are followed optionally by characters that are not white space and +then followed optionally by white space. + +@need 800 +Here is the full regular expression: + +@smallexample +"\\(\\w\\|\\s_\\)+[^ \t\n]*[ \t\n]*" +@end smallexample + +@node count-words-in-defun, Several defuns, Syntax, Words in a defun +@section The @code{count-words-in-defun} Function +@cindex Counting words in a @code{defun} + +We have seen that there are several ways to write a +@code{count-word-region} function. To write a +@code{count-words-in-defun}, we need merely adapt one of these +versions. + +The version that uses a @code{while} loop is easy to understand, so I +am going to adapt that. Because @code{count-words-in-defun} will be +part of a more complex program, it need not be interactive and it need +not display a message but just return the count. These considerations +simplify the definition a little. + +On the other hand, @code{count-words-in-defun} will be used within a +buffer that contains function definitions. Consequently, it is +reasonable to ask that the function determine whether it is called +when point is within a function definition, and if it is, to return +the count for that definition. This adds complexity to the +definition, but saves us from needing to pass arguments to the +function. + +@need 1250 +These considerations lead us to prepare the following template: + +@smallexample +@group +(defun count-words-in-defun () + "@var{documentation}@dots{}" + (@var{set up}@dots{} + (@var{while loop}@dots{}) + @var{return count}) +@end group +@end smallexample + +@noindent +As usual, our job is to fill in the slots. + +First, the set up. + +We are presuming that this function will be called within a buffer +containing function definitions. Point will either be within a +function definition or not. For @code{count-words-in-defun} to work, +point must move to the beginning of the definition, a counter must +start at zero, and the counting loop must stop when point reaches the +end of the definition. + +The @code{beginning-of-defun} function searches backwards for an +opening delimiter such as a @samp{(} at the beginning of a line, and +moves point to that position, or else to the limit of the search. In +practice, this means that @code{beginning-of-defun} moves point to the +beginning of an enclosing or preceding function definition, or else to +the beginning of the buffer. We can use @code{beginning-of-defun} to +place point where we wish to start. + +The @code{while} loop requires a counter to keep track of the words or +symbols being counted. A @code{let} expression can be used to create +a local variable for this purpose, and bind it to an initial value of zero. + +The @code{end-of-defun} function works like @code{beginning-of-defun} +except that it moves point to the end of the definition. +@code{end-of-defun} can be used as part of an expression that +determines the position of the end of the definition. + +The set up for @code{count-words-in-defun} takes shape rapidly: first +we move point to the beginning of the definition, then we create a +local variable to hold the count, and finally, we record the position +of the end of the definition so the @code{while} loop will know when to stop +looping. + +@need 1250 +The code looks like this: + +@smallexample +@group +(beginning-of-defun) +(let ((count 0) + (end (save-excursion (end-of-defun) (point)))) +@end group +@end smallexample + +@noindent +The code is simple. The only slight complication is likely to concern +@code{end}: it is bound to the position of the end of the definition +by a @code{save-excursion} expression that returns the value of point +after @code{end-of-defun} temporarily moves it to the end of the +definition. + +The second part of the @code{count-words-in-defun}, after the set up, +is the @code{while} loop. + +The loop must contain an expression that jumps point forward word by +word and symbol by symbol, and another expression that counts the +jumps. The true-or-false-test for the @code{while} loop should test +true so long as point should jump forward, and false when point is at +the end of the definition. We have already redefined the regular +expression for this (@pxref{Syntax}), so the loop is straightforward: + +@smallexample +@group +(while (and (< (point) end) + (re-search-forward + "\\(\\w\\|\\s_\\)+[^ \t\n]*[ \t\n]*" end t) + (setq count (1+ count))) +@end group +@end smallexample + +The third part of the function definition returns the count of words +and symbols. This part is the last expression within the body of the +@code{let} expression, and can be, very simply, the local variable +@code{count}, which when evaluated returns the count. + +@need 1250 +Put together, the @code{count-words-in-defun} definition looks like this: + +@findex count-words-in-defun +@smallexample +@group +(defun count-words-in-defun () + "Return the number of words and symbols in a defun." + (beginning-of-defun) + (let ((count 0) + (end (save-excursion (end-of-defun) (point)))) +@end group +@group + (while + (and (< (point) end) + (re-search-forward + "\\(\\w\\|\\s_\\)+[^ \t\n]*[ \t\n]*" + end t)) + (setq count (1+ count))) + count)) +@end group +@end smallexample + +How to test this? The function is not interactive, but it is easy to +put a wrapper around the function to make it interactive; we can use +almost the same code as for the recursive version of +@code{count-words-region}: + +@smallexample +@group +;;; @r{Interactive version.} +(defun count-words-defun () + "Number of words and symbols in a function definition." + (interactive) + (message + "Counting words and symbols in function definition ... ") +@end group +@group + (let ((count (count-words-in-defun))) + (cond + ((zerop count) + (message + "The definition does NOT have any words or symbols.")) +@end group +@group + ((= 1 count) + (message + "The definition has 1 word or symbol.")) + (t + (message + "The definition has %d words or symbols." count))))) +@end group +@end smallexample + +@need 800 +@noindent +Let's re-use @kbd{C-c =} as a convenient keybinding: + +@smallexample +(global-set-key "\C-c=" 'count-words-defun) +@end smallexample + +Now we can try out @code{count-words-defun}: install both +@code{count-words-in-defun} and @code{count-words-defun}, and set the +keybinding, and then place the cursor within the following definition: + +@smallexample +@group +(defun multiply-by-seven (number) + "Multiply NUMBER by seven." + (* 7 number)) + @result{} 10 +@end group +@end smallexample + +@noindent +Success! The definition has 10 words and symbols. + +The next problem is to count the numbers of words and symbols in +several definitions within a single file. + +@node Several defuns, Find a File, count-words-in-defun, Words in a defun +@section Count Several @code{defuns} Within a File + +A file such as @file{simple.el} may have a hundred or more function +definitions within it. Our long term goal is to collect statistics on +many files, but as a first step, our immediate goal is to collect +statistics on one file. + +The information will be a series of numbers, each number being the +length of a function definition. We can store the numbers in a list. + +We know that we will want to incorporate the information regarding one +file with information about many other files; this means that the +function for counting definition lengths within one file need only +return the list of lengths. It need not and should not display any +messages. + +The word count commands contain one expression to jump point forward +word by word and another expression to count the jumps. The function +to return the lengths of definitions can be designed to work the same +way, with one expression to jump point forward definition by +definition and another expression to construct the lengths' list. + +This statement of the problem makes it elementary to write the +function definition. Clearly, we will start the count at the +beginning of the file, so the first command will be @code{(goto-char +(point-min))}. Next, we start the @code{while} loop; and the +true-or-false test of the loop can be a regular expression search for +the next function definition---so long as the search succeeds, point +is moved forward and then the body of the loop is evaluated. The body +needs an expression that constructs the lengths' list. @code{cons}, +the list construction command, can be used to create the list. That +is almost all there is to it. + +@need 800 +Here is what this fragment of code looks like: + +@smallexample +@group +(goto-char (point-min)) +(while (re-search-forward "^(defun" nil t) + (setq lengths-list + (cons (count-words-in-defun) lengths-list))) +@end group +@end smallexample + +What we have left out is the mechanism for finding the file that +contains the function definitions. + +In previous examples, we either used this, the Info file, or we +switched back and forth to some other buffer, such as the +@file{*scratch*} buffer. + +Finding a file is a new process that we have not yet discussed. + +@node Find a File, lengths-list-file, Several defuns, Words in a defun +@comment node-name, next, previous, up +@section Find a File +@cindex Find a File + +To find a file in Emacs, you use the @kbd{C-x C-f} (@code{find-file}) +command. This command is almost, but not quite right for the lengths +problem. + +@need 1200 +Let's look at the source for @code{find-file}: + +@smallexample +@group +(defun find-file (filename) + "Edit file FILENAME. +Switch to a buffer visiting file FILENAME, +creating one if none already exists." + (interactive "FFind file: ") + (switch-to-buffer (find-file-noselect filename))) +@end group +@end smallexample + +@noindent +(The most recent version of the @code{find-file} function definition +permits you to specify optional wildcards to visit multiple files; that +makes the definition more complex and we will not discuss it here, +since it is not relevant. You can see its source using either +@kbd{M-.} (@code{find-tag}) or @kbd{C-h f} (@code{describe-function}).) + +@ignore +In Emacs 22 +(defun find-file (filename &optional wildcards) + "Edit file FILENAME. +Switch to a buffer visiting file FILENAME, +creating one if none already exists. +Interactively, the default if you just type RET is the current directory, +but the visited file name is available through the minibuffer history: +type M-n to pull it into the minibuffer. + +Interactively, or if WILDCARDS is non-nil in a call from Lisp, +expand wildcards (if any) and visit multiple files. You can +suppress wildcard expansion by setting `find-file-wildcards' to nil. + +To visit a file without any kind of conversion and without +automatically choosing a major mode, use \\[find-file-literally]." + (interactive (find-file-read-args "Find file: " nil)) + (let ((value (find-file-noselect filename nil nil wildcards))) + (if (listp value) + (mapcar 'switch-to-buffer (nreverse value)) + (switch-to-buffer value)))) +@end ignore + +The definition I am showing possesses short but complete documentation +and an interactive specification that prompts you for a file name when +you use the command interactively. The body of the definition +contains two functions, @code{find-file-noselect} and +@code{switch-to-buffer}. + +According to its documentation as shown by @kbd{C-h f} (the +@code{describe-function} command), the @code{find-file-noselect} +function reads the named file into a buffer and returns the buffer. +(Its most recent version includes an optional wildcards argument, +too, as well as another to read a file literally and an other you +suppress warning messages. These optional arguments are irrelevant.) + +However, the @code{find-file-noselect} function does not select the +buffer in which it puts the file. Emacs does not switch its attention +(or yours if you are using @code{find-file-noselect}) to the selected +buffer. That is what @code{switch-to-buffer} does: it switches the +buffer to which Emacs attention is directed; and it switches the +buffer displayed in the window to the new buffer. We have discussed +buffer switching elsewhere. (@xref{Switching Buffers}.) + +In this histogram project, we do not need to display each file on the +screen as the program determines the length of each definition within +it. Instead of employing @code{switch-to-buffer}, we can work with +@code{set-buffer}, which redirects the attention of the computer +program to a different buffer but does not redisplay it on the screen. +So instead of calling on @code{find-file} to do the job, we must write +our own expression. + +The task is easy: use @code{find-file-noselect} and @code{set-buffer}. + +@node lengths-list-file, Several files, Find a File, Words in a defun +@section @code{lengths-list-file} in Detail + +The core of the @code{lengths-list-file} function is a @code{while} +loop containing a function to move point forward `defun by defun' and +a function to count the number of words and symbols in each defun. +This core must be surrounded by functions that do various other tasks, +including finding the file, and ensuring that point starts out at the +beginning of the file. The function definition looks like this: +@findex lengths-list-file + +@smallexample +@group +(defun lengths-list-file (filename) + "Return list of definitions' lengths within FILE. +The returned list is a list of numbers. +Each number is the number of words or +symbols in one function definition." +@end group +@group + (message "Working on `%s' ... " filename) + (save-excursion + (let ((buffer (find-file-noselect filename)) + (lengths-list)) + (set-buffer buffer) + (setq buffer-read-only t) + (widen) + (goto-char (point-min)) + (while (re-search-forward "^(defun" nil t) + (setq lengths-list + (cons (count-words-in-defun) lengths-list))) + (kill-buffer buffer) + lengths-list))) +@end group +@end smallexample + +@noindent +The function is passed one argument, the name of the file on which it +will work. It has four lines of documentation, but no interactive +specification. Since people worry that a computer is broken if they +don't see anything going on, the first line of the body is a +message. + +The next line contains a @code{save-excursion} that returns Emacs' +attention to the current buffer when the function completes. This is +useful in case you embed this function in another function that +presumes point is restored to the original buffer. + +In the varlist of the @code{let} expression, Emacs finds the file and +binds the local variable @code{buffer} to the buffer containing the +file. At the same time, Emacs creates @code{lengths-list} as a local +variable. + +Next, Emacs switches its attention to the buffer. + +In the following line, Emacs makes the buffer read-only. Ideally, +this line is not necessary. None of the functions for counting words +and symbols in a function definition should change the buffer. +Besides, the buffer is not going to be saved, even if it were changed. +This line is entirely the consequence of great, perhaps excessive, +caution. The reason for the caution is that this function and those +it calls work on the sources for Emacs and it is inconvenient if they +are inadvertently modified. It goes without saying that I did not +realize a need for this line until an experiment went awry and started +to modify my Emacs source files @dots{} + +Next comes a call to widen the buffer if it is narrowed. This +function is usually not needed---Emacs creates a fresh buffer if none +already exists; but if a buffer visiting the file already exists Emacs +returns that one. In this case, the buffer may be narrowed and must +be widened. If we wanted to be fully `user-friendly', we would +arrange to save the restriction and the location of point, but we +won't. + +The @code{(goto-char (point-min))} expression moves point to the +beginning of the buffer. + +Then comes a @code{while} loop in which the `work' of the function is +carried out. In the loop, Emacs determines the length of each +definition and constructs a lengths' list containing the information. + +Emacs kills the buffer after working through it. This is to save +space inside of Emacs. My version of GNU Emacs 19 contained over 300 +source files of interest; GNU Emacs 22 contains over a thousand source +files. Another function will apply @code{lengths-list-file} to each +of the files. + +Finally, the last expression within the @code{let} expression is the +@code{lengths-list} variable; its value is returned as the value of +the whole function. + +You can try this function by installing it in the usual fashion. Then +place your cursor after the following expression and type @kbd{C-x +C-e} (@code{eval-last-sexp}). + +@c !!! 22.1.1 lisp sources location here +@smallexample +(lengths-list-file + "/usr/local/share/emacs/22.1.1/lisp/emacs-lisp/debug.el") +@end smallexample + +@noindent +(You may need to change the pathname of the file; the one here is for +GNU Emacs version 22.1.1. To change the expression, copy it to +the @file{*scratch*} buffer and edit it. + +@need 1200 +@noindent +(Also, to see the full length of the list, rather than a truncated +version, you may have to evaluate the following: + +@smallexample +(custom-set-variables '(eval-expression-print-length nil)) +@end smallexample + +@noindent +(@xref{defcustom, , Specifying Variables using @code{defcustom}}. +Then evaluate the @code{lengths-list-file} expression.) + +@need 1200 +The lengths' list for @file{debug.el} takes less than a second to +produce and looks like this in GNU Emacs 22: + +@smallexample +(83 113 105 144 289 22 30 97 48 89 25 52 52 88 28 29 77 49 43 290 232 587) +@end smallexample + +@need 1500 +(Using my old machine, the version 19 lengths' list for @file{debug.el} +took seven seconds to produce and looked like this: + +@smallexample +(75 41 80 62 20 45 44 68 45 12 34 235) +@end smallexample + +(The newer version of @file{debug.el} contains more defuns than the +earlier one; and my new machine is much faster than the old one.) + +Note that the length of the last definition in the file is first in +the list. + +@node Several files, Several files recursively, lengths-list-file, Words in a defun +@section Count Words in @code{defuns} in Different Files + +In the previous section, we created a function that returns a list of +the lengths of each definition in a file. Now, we want to define a +function to return a master list of the lengths of the definitions in +a list of files. + +Working on each of a list of files is a repetitious act, so we can use +either a @code{while} loop or recursion. + +@menu +* lengths-list-many-files:: Return a list of the lengths of defuns. +* append:: Attach one list to another. +@end menu + +@node lengths-list-many-files, append, Several files, Several files +@ifnottex +@unnumberedsubsec Determine the lengths of @code{defuns} +@end ifnottex + +The design using a @code{while} loop is routine. The argument passed +the function is a list of files. As we saw earlier (@pxref{Loop +Example}), you can write a @code{while} loop so that the body of the +loop is evaluated if such a list contains elements, but to exit the +loop if the list is empty. For this design to work, the body of the +loop must contain an expression that shortens the list each time the +body is evaluated, so that eventually the list is empty. The usual +technique is to set the value of the list to the value of the @sc{cdr} +of the list each time the body is evaluated. + +@need 800 +The template looks like this: + +@smallexample +@group +(while @var{test-whether-list-is-empty} + @var{body}@dots{} + @var{set-list-to-cdr-of-list}) +@end group +@end smallexample + +Also, we remember that a @code{while} loop returns @code{nil} (the +result of evaluating the true-or-false-test), not the result of any +evaluation within its body. (The evaluations within the body of the +loop are done for their side effects.) However, the expression that +sets the lengths' list is part of the body---and that is the value +that we want returned by the function as a whole. To do this, we +enclose the @code{while} loop within a @code{let} expression, and +arrange that the last element of the @code{let} expression contains +the value of the lengths' list. (@xref{Incrementing Example, , Loop +Example with an Incrementing Counter}.) + +@findex lengths-list-many-files +@need 1250 +These considerations lead us directly to the function itself: + +@smallexample +@group +;;; @r{Use @code{while} loop.} +(defun lengths-list-many-files (list-of-files) + "Return list of lengths of defuns in LIST-OF-FILES." +@end group +@group + (let (lengths-list) + +;;; @r{true-or-false-test} + (while list-of-files + (setq lengths-list + (append + lengths-list + +;;; @r{Generate a lengths' list.} + (lengths-list-file + (expand-file-name (car list-of-files))))) +@end group + +@group +;;; @r{Make files' list shorter.} + (setq list-of-files (cdr list-of-files))) + +;;; @r{Return final value of lengths' list.} + lengths-list)) +@end group +@end smallexample + +@code{expand-file-name} is a built-in function that converts a file +name to the absolute, long, path name form. The function employs the +name of the directory in which the function is called. + +@c !!! 22.1.1 lisp sources location here +@need 1500 +Thus, if @code{expand-file-name} is called on @code{debug.el} when +Emacs is visiting the +@file{/usr/local/share/emacs/22.1.1/lisp/emacs-lisp/} directory, + +@smallexample +debug.el +@end smallexample + +@need 800 +@noindent +becomes + +@c !!! 22.1.1 lisp sources location here +@smallexample +/usr/local/share/emacs/22.1.1/lisp/emacs-lisp/debug.el +@end smallexample + +The only other new element of this function definition is the as yet +unstudied function @code{append}, which merits a short section for +itself. + +@node append, , lengths-list-many-files, Several files +@subsection The @code{append} Function + +@need 800 +The @code{append} function attaches one list to another. Thus, + +@smallexample +(append '(1 2 3 4) '(5 6 7 8)) +@end smallexample + +@need 800 +@noindent +produces the list + +@smallexample +(1 2 3 4 5 6 7 8) +@end smallexample + +This is exactly how we want to attach two lengths' lists produced by +@code{lengths-list-file} to each other. The results contrast with +@code{cons}, + +@smallexample +(cons '(1 2 3 4) '(5 6 7 8)) +@end smallexample + +@need 1250 +@noindent +which constructs a new list in which the first argument to @code{cons} +becomes the first element of the new list: + +@smallexample +((1 2 3 4) 5 6 7 8) +@end smallexample + +@node Several files recursively, Prepare the data, Several files, Words in a defun +@section Recursively Count Words in Different Files + +Besides a @code{while} loop, you can work on each of a list of files +with recursion. A recursive version of @code{lengths-list-many-files} +is short and simple. + +The recursive function has the usual parts: the `do-again-test', the +`next-step-expression', and the recursive call. The `do-again-test' +determines whether the function should call itself again, which it +will do if the @code{list-of-files} contains any remaining elements; +the `next-step-expression' resets the @code{list-of-files} to the +@sc{cdr} of itself, so eventually the list will be empty; and the +recursive call calls itself on the shorter list. The complete +function is shorter than this description! +@findex recursive-lengths-list-many-files + +@smallexample +@group +(defun recursive-lengths-list-many-files (list-of-files) + "Return list of lengths of each defun in LIST-OF-FILES." + (if list-of-files ; @r{do-again-test} + (append + (lengths-list-file + (expand-file-name (car list-of-files))) + (recursive-lengths-list-many-files + (cdr list-of-files))))) +@end group +@end smallexample + +@noindent +In a sentence, the function returns the lengths' list for the first of +the @code{list-of-files} appended to the result of calling itself on +the rest of the @code{list-of-files}. + +Here is a test of @code{recursive-lengths-list-many-files}, along with +the results of running @code{lengths-list-file} on each of the files +individually. + +Install @code{recursive-lengths-list-many-files} and +@code{lengths-list-file}, if necessary, and then evaluate the +following expressions. You may need to change the files' pathnames; +those here work when this Info file and the Emacs sources are located +in their customary places. To change the expressions, copy them to +the @file{*scratch*} buffer, edit them, and then evaluate them. + +The results are shown after the @samp{@result{}}. (These results are +for files from Emacs version 22.1.1; files from other versions of +Emacs may produce different results.) + +@c !!! 22.1.1 lisp sources location here +@smallexample +@group +(cd "/usr/local/share/emacs/22.1.1/") + +(lengths-list-file "./lisp/macros.el") + @result{} (283 263 480 90) +@end group + +@group +(lengths-list-file "./lisp/mail/mailalias.el") + @result{} (38 32 29 95 178 180 321 218 324) +@end group + +@group +(lengths-list-file "./lisp/makesum.el") + @result{} (85 181) +@end group + +@group + (recursive-lengths-list-many-files + '("./lisp/macros.el" + "./lisp/mail/mailalias.el" + "./lisp/makesum.el")) + @result{} (283 263 480 90 38 32 29 95 178 180 321 218 324 85 181) +@end group +@end smallexample + +The @code{recursive-lengths-list-many-files} function produces the +output we want. + +The next step is to prepare the data in the list for display in a graph. + +@node Prepare the data, , Several files recursively, Words in a defun +@section Prepare the Data for Display in a Graph + +The @code{recursive-lengths-list-many-files} function returns a list +of numbers. Each number records the length of a function definition. +What we need to do now is transform this data into a list of numbers +suitable for generating a graph. The new list will tell how many +functions definitions contain less than 10 words and +symbols, how many contain between 10 and 19 words and symbols, how +many contain between 20 and 29 words and symbols, and so on. + +In brief, we need to go through the lengths' list produced by the +@code{recursive-lengths-list-many-files} function and count the number +of defuns within each range of lengths, and produce a list of those +numbers. + +@menu +* Data for Display in Detail:: +* Sorting:: Sorting lists. +* Files List:: Making a list of files. +* Counting function definitions:: +@end menu + +@node Data for Display in Detail, Sorting, Prepare the data, Prepare the data +@ifnottex +@unnumberedsubsec The Data for Display in Detail +@end ifnottex + +Based on what we have done before, we can readily foresee that it +should not be too hard to write a function that `@sc{cdr}s' down the +lengths' list, looks at each element, determines which length range it +is in, and increments a counter for that range. + +However, before beginning to write such a function, we should consider +the advantages of sorting the lengths' list first, so the numbers are +ordered from smallest to largest. First, sorting will make it easier +to count the numbers in each range, since two adjacent numbers will +either be in the same length range or in adjacent ranges. Second, by +inspecting a sorted list, we can discover the highest and lowest +number, and thereby determine the largest and smallest length range +that we will need. + +@node Sorting, Files List, Data for Display in Detail, Prepare the data +@subsection Sorting Lists +@findex sort + +Emacs contains a function to sort lists, called (as you might guess) +@code{sort}. The @code{sort} function takes two arguments, the list +to be sorted, and a predicate that determines whether the first of +two list elements is ``less'' than the second. + +As we saw earlier (@pxref{Wrong Type of Argument, , Using the Wrong +Type Object as an Argument}), a predicate is a function that +determines whether some property is true or false. The @code{sort} +function will reorder a list according to whatever property the +predicate uses; this means that @code{sort} can be used to sort +non-numeric lists by non-numeric criteria---it can, for example, +alphabetize a list. + +@need 1250 +The @code{<} function is used when sorting a numeric list. For example, + +@smallexample +(sort '(4 8 21 17 33 7 21 7) '<) +@end smallexample + +@need 800 +@noindent +produces this: + +@smallexample +(4 7 7 8 17 21 21 33) +@end smallexample + +@noindent +(Note that in this example, both the arguments are quoted so that the +symbols are not evaluated before being passed to @code{sort} as +arguments.) + +Sorting the list returned by the +@code{recursive-lengths-list-many-files} function is straightforward; +it uses the @code{<} function: + +@ignore +2006 Oct 29 +In GNU Emacs 22, eval +(progn + (cd "/usr/local/share/emacs/22.0.50/") + (sort + (recursive-lengths-list-many-files + '("./lisp/macros.el" + "./lisp/mail/mailalias.el" + "./lisp/makesum.el")) + '<)) + +@end ignore + +@smallexample +@group +(sort + (recursive-lengths-list-many-files + '("./lisp/macros.el" + "./lisp/mailalias.el" + "./lisp/makesum.el")) + '<) +@end group +@end smallexample + +@need 800 +@noindent +which produces: + +@smallexample +(29 32 38 85 90 95 178 180 181 218 263 283 321 324 480) +@end smallexample + +@noindent +(Note that in this example, the first argument to @code{sort} is not +quoted, since the expression must be evaluated so as to produce the +list that is passed to @code{sort}.) + +@node Files List, Counting function definitions, Sorting, Prepare the data +@subsection Making a List of Files + +The @code{recursive-lengths-list-many-files} function requires a list +of files as its argument. For our test examples, we constructed such +a list by hand; but the Emacs Lisp source directory is too large for +us to do for that. Instead, we will write a function to do the job +for us. In this function, we will use both a @code{while} loop and a +recursive call. + +@findex directory-files +We did not have to write a function like this for older versions of +GNU Emacs, since they placed all the @samp{.el} files in one +directory. Instead, we were able to use the @code{directory-files} +function, which lists the names of files that match a specified +pattern within a single directory. + +However, recent versions of Emacs place Emacs Lisp files in +sub-directories of the top level @file{lisp} directory. This +re-arrangement eases navigation. For example, all the mail related +files are in a @file{lisp} sub-directory called @file{mail}. But at +the same time, this arrangement forces us to create a file listing +function that descends into the sub-directories. + +@findex files-in-below-directory +We can create this function, called @code{files-in-below-directory}, +using familiar functions such as @code{car}, @code{nthcdr}, and +@code{substring} in conjunction with an existing function called +@code{directory-files-and-attributes}. This latter function not only +lists all the filenames in a directory, including the names +of sub-directories, but also their attributes. + +To restate our goal: to create a function that will enable us +to feed filenames to @code{recursive-lengths-list-many-files} +as a list that looks like this (but with more elements): + +@smallexample +@group +("./lisp/macros.el" + "./lisp/mail/rmail.el" + "./lisp/makesum.el") +@end group +@end smallexample + +The @code{directory-files-and-attributes} function returns a list of +lists. Each of the lists within the main list consists of 13 +elements. The first element is a string that contains the name of the +file -- which, in GNU/Linux, may be a `directory file', that is to +say, a file with the special attributes of a directory. The second +element of the list is @code{t} for a directory, a string +for symbolic link (the string is the name linked to), or @code{nil}. + +For example, the first @samp{.el} file in the @file{lisp/} directory +is @file{abbrev.el}. Its name is +@file{/usr/local/share/emacs/22.1.1/lisp/abbrev.el} and it is not a +directory or a symbolic link. + +@need 1000 +This is how @code{directory-files-and-attributes} lists that file and +its attributes: + +@smallexample +@group +("abbrev.el" +nil +1 +1000 +100 +@end group +@group +(17733 259) +(17491 28834) +(17596 62124) +13157 +"-rw-rw-r--" +@end group +@group +nil +2971624 +773) +@end group +@end smallexample + +@need 1200 +On the other hand, @file{mail/} is a directory within the @file{lisp/} +directory. The beginning of its listing looks like this: + +@smallexample +@group +("mail" +t +@dots{} +) +@end group +@end smallexample + +(To learn about the different attributes, look at the documentation of +@code{file-attributes}. Bear in mind that the @code{file-attributes} +function does not list the filename, so its first element is +@code{directory-files-and-attributes}'s second element.) + +We will want our new function, @code{files-in-below-directory}, to +list the @samp{.el} files in the directory it is told to check, and in +any directories below that directory. + +This gives us a hint on how to construct +@code{files-in-below-directory}: within a directory, the function +should add @samp{.el} filenames to a list; and if, within a directory, +the function comes upon a sub-directory, it should go into that +sub-directory and repeat its actions. + +However, we should note that every directory contains a name that +refers to itself, called @file{.}, (``dot'') and a name that refers to +its parent directory, called @file{..} (``double dot''). (In +@file{/}, the root directory, @file{..} refers to itself, since +@file{/} has no parent.) Clearly, we do not want our +@code{files-in-below-directory} function to enter those directories, +since they always lead us, directly or indirectly, to the current +directory. + +Consequently, our @code{files-in-below-directory} function must do +several tasks: + +@itemize @bullet +@item +Check to see whether it is looking at a filename that ends in +@samp{.el}; and if so, add its name to a list. + +@item +Check to see whether it is looking at a filename that is the name of a +directory; and if so, + +@itemize @minus +@item +Check to see whether it is looking at @file{.} or @file{..}; and if +so skip it. + +@item +Or else, go into that directory and repeat the process. +@end itemize +@end itemize + +Let's write a function definition to do these tasks. We will use a +@code{while} loop to move from one filename to another within a +directory, checking what needs to be done; and we will use a recursive +call to repeat the actions on each sub-directory. The recursive +pattern is `accumulate' +(@pxref{Accumulate, , Recursive Pattern: @emph{accumulate}}), +using @code{append} as the combiner. + +@ignore +(directory-files "/usr/local/src/emacs/lisp/" t "\\.el$") +(shell-command "find /usr/local/src/emacs/lisp/ -name '*.el'") + +(directory-files "/usr/local/share/emacs/22.1.1/lisp/" t "\\.el$") +(shell-command "find /usr/local/share/emacs/22.1.1/lisp/ -name '*.el'") +@end ignore + +@c /usr/local/share/emacs/22.1.1/lisp/ + +@need 800 +Here is the function: + +@smallexample +@group +(defun files-in-below-directory (directory) + "List the .el files in DIRECTORY and in its sub-directories." + ;; Although the function will be used non-interactively, + ;; it will be easier to test if we make it interactive. + ;; The directory will have a name such as + ;; "/usr/local/share/emacs/22.1.1/lisp/" + (interactive "DDirectory name: ") +@end group +@group + (let (el-files-list + (current-directory-list + (directory-files-and-attributes directory t))) + ;; while we are in the current directory + (while current-directory-list +@end group +@group + (cond + ;; check to see whether filename ends in `.el' + ;; and if so, append its name to a list. + ((equal ".el" (substring (car (car current-directory-list)) -3)) + (setq el-files-list + (cons (car (car current-directory-list)) el-files-list))) +@end group +@group + ;; check whether filename is that of a directory + ((eq t (car (cdr (car current-directory-list)))) + ;; decide whether to skip or recurse + (if + (equal "." + (substring (car (car current-directory-list)) -1)) + ;; then do nothing since filename is that of + ;; current directory or parent, "." or ".." + () +@end group +@group + ;; else descend into the directory and repeat the process + (setq el-files-list + (append + (files-in-below-directory + (car (car current-directory-list))) + el-files-list))))) + ;; move to the next filename in the list; this also + ;; shortens the list so the while loop eventually comes to an end + (setq current-directory-list (cdr current-directory-list))) + ;; return the filenames + el-files-list)) +@end group +@end smallexample + +@c (files-in-below-directory "/usr/local/src/emacs/lisp/") +@c (files-in-below-directory "/usr/local/share/emacs/22.1.1/lisp/") + +The @code{files-in-below-directory} @code{directory-files} function +takes one argument, the name of a directory. + +@need 1250 +Thus, on my system, + +@c (length (files-in-below-directory "/usr/local/src/emacs/lisp/")) + +@c !!! 22.1.1 lisp sources location here +@smallexample +@group +(length + (files-in-below-directory "/usr/local/share/emacs/22.1.1/lisp/")) +@end group +@end smallexample + +@noindent +tells me that in and below my Lisp sources directory are 1031 +@samp{.el} files. + +@code{files-in-below-directory} returns a list in reverse alphabetical +order. An expression to sort the list in alphabetical order looks +like this: + +@smallexample +@group +(sort + (files-in-below-directory "/usr/local/share/emacs/22.1.1/lisp/") + 'string-lessp) +@end group +@end smallexample + +@ignore +(defun test () + "Test how long it takes to find lengths of all sorted elisp defuns." + (insert "\n" (current-time-string) "\n") + (sit-for 0) + (sort + (recursive-lengths-list-many-files + (files-in-below-directory "/usr/local/src/emacs/lisp/")) + '<) + (insert (format "%s" (current-time-string)))) +@end ignore + +@node Counting function definitions, , Files List, Prepare the data +@subsection Counting function definitions + +Our immediate goal is to generate a list that tells us how many +function definitions contain fewer than 10 words and symbols, how many +contain between 10 and 19 words and symbols, how many contain between +20 and 29 words and symbols, and so on. + +With a sorted list of numbers, this is easy: count how many elements +of the list are smaller than 10, then, after moving past the numbers +just counted, count how many are smaller than 20, then, after moving +past the numbers just counted, count how many are smaller than 30, and +so on. Each of the numbers, 10, 20, 30, 40, and the like, is one +larger than the top of that range. We can call the list of such +numbers the @code{top-of-ranges} list. + +@need 1200 +If we wished, we could generate this list automatically, but it is +simpler to write a list manually. Here it is: +@vindex top-of-ranges + +@smallexample +@group +(defvar top-of-ranges + '(10 20 30 40 50 + 60 70 80 90 100 + 110 120 130 140 150 + 160 170 180 190 200 + 210 220 230 240 250 + 260 270 280 290 300) + "List specifying ranges for `defuns-per-range'.") +@end group +@end smallexample + +To change the ranges, we edit this list. + +Next, we need to write the function that creates the list of the +number of definitions within each range. Clearly, this function must +take the @code{sorted-lengths} and the @code{top-of-ranges} lists +as arguments. + +The @code{defuns-per-range} function must do two things again and +again: it must count the number of definitions within a range +specified by the current top-of-range value; and it must shift to the +next higher value in the @code{top-of-ranges} list after counting the +number of definitions in the current range. Since each of these +actions is repetitive, we can use @code{while} loops for the job. +One loop counts the number of definitions in the range defined by the +current top-of-range value, and the other loop selects each of the +top-of-range values in turn. + +Several entries of the @code{sorted-lengths} list are counted for each +range; this means that the loop for the @code{sorted-lengths} list +will be inside the loop for the @code{top-of-ranges} list, like a +small gear inside a big gear. + +The inner loop counts the number of definitions within the range. It +is a simple counting loop of the type we have seen before. +(@xref{Incrementing Loop, , A loop with an incrementing counter}.) +The true-or-false test of the loop tests whether the value from the +@code{sorted-lengths} list is smaller than the current value of the +top of the range. If it is, the function increments the counter and +tests the next value from the @code{sorted-lengths} list. + +@need 1250 +The inner loop looks like this: + +@smallexample +@group +(while @var{length-element-smaller-than-top-of-range} + (setq number-within-range (1+ number-within-range)) + (setq sorted-lengths (cdr sorted-lengths))) +@end group +@end smallexample + +The outer loop must start with the lowest value of the +@code{top-of-ranges} list, and then be set to each of the succeeding +higher values in turn. This can be done with a loop like this: + +@smallexample +@group +(while top-of-ranges + @var{body-of-loop}@dots{} + (setq top-of-ranges (cdr top-of-ranges))) +@end group +@end smallexample + +@need 1200 +Put together, the two loops look like this: + +@smallexample +@group +(while top-of-ranges + + ;; @r{Count the number of elements within the current range.} + (while @var{length-element-smaller-than-top-of-range} + (setq number-within-range (1+ number-within-range)) + (setq sorted-lengths (cdr sorted-lengths))) + + ;; @r{Move to next range.} + (setq top-of-ranges (cdr top-of-ranges))) +@end group +@end smallexample + +In addition, in each circuit of the outer loop, Emacs should record +the number of definitions within that range (the value of +@code{number-within-range}) in a list. We can use @code{cons} for +this purpose. (@xref{cons, , @code{cons}}.) + +The @code{cons} function works fine, except that the list it +constructs will contain the number of definitions for the highest +range at its beginning and the number of definitions for the lowest +range at its end. This is because @code{cons} attaches new elements +of the list to the beginning of the list, and since the two loops are +working their way through the lengths' list from the lower end first, +the @code{defuns-per-range-list} will end up largest number first. +But we will want to print our graph with smallest values first and the +larger later. The solution is to reverse the order of the +@code{defuns-per-range-list}. We can do this using the +@code{nreverse} function, which reverses the order of a list. +@findex nreverse + +@need 800 +For example, + +@smallexample +(nreverse '(1 2 3 4)) +@end smallexample + +@need 800 +@noindent +produces: + +@smallexample +(4 3 2 1) +@end smallexample + +Note that the @code{nreverse} function is ``destructive''---that is, +it changes the list to which it is applied; this contrasts with the +@code{car} and @code{cdr} functions, which are non-destructive. In +this case, we do not want the original @code{defuns-per-range-list}, +so it does not matter that it is destroyed. (The @code{reverse} +function provides a reversed copy of a list, leaving the original list +as is.) +@findex reverse + +@need 1250 +Put all together, the @code{defuns-per-range} looks like this: + +@smallexample +@group +(defun defuns-per-range (sorted-lengths top-of-ranges) + "SORTED-LENGTHS defuns in each TOP-OF-RANGES range." + (let ((top-of-range (car top-of-ranges)) + (number-within-range 0) + defuns-per-range-list) +@end group + +@group + ;; @r{Outer loop.} + (while top-of-ranges +@end group + +@group + ;; @r{Inner loop.} + (while (and + ;; @r{Need number for numeric test.} + (car sorted-lengths) + (< (car sorted-lengths) top-of-range)) +@end group + +@group + ;; @r{Count number of definitions within current range.} + (setq number-within-range (1+ number-within-range)) + (setq sorted-lengths (cdr sorted-lengths))) + + ;; @r{Exit inner loop but remain within outer loop.} +@end group + +@group + (setq defuns-per-range-list + (cons number-within-range defuns-per-range-list)) + (setq number-within-range 0) ; @r{Reset count to zero.} +@end group + +@group + ;; @r{Move to next range.} + (setq top-of-ranges (cdr top-of-ranges)) + ;; @r{Specify next top of range value.} + (setq top-of-range (car top-of-ranges))) +@end group + +@group + ;; @r{Exit outer loop and count the number of defuns larger than} + ;; @r{ the largest top-of-range value.} + (setq defuns-per-range-list + (cons + (length sorted-lengths) + defuns-per-range-list)) +@end group + +@group + ;; @r{Return a list of the number of definitions within each range,} + ;; @r{ smallest to largest.} + (nreverse defuns-per-range-list))) +@end group +@end smallexample + +@need 1200 +@noindent +The function is straightforward except for one subtle feature. The +true-or-false test of the inner loop looks like this: + +@smallexample +@group +(and (car sorted-lengths) + (< (car sorted-lengths) top-of-range)) +@end group +@end smallexample + +@need 800 +@noindent +instead of like this: + +@smallexample +(< (car sorted-lengths) top-of-range) +@end smallexample + +The purpose of the test is to determine whether the first item in the +@code{sorted-lengths} list is less than the value of the top of the +range. + +The simple version of the test works fine unless the +@code{sorted-lengths} list has a @code{nil} value. In that case, the +@code{(car sorted-lengths)} expression function returns +@code{nil}. The @code{<} function cannot compare a number to +@code{nil}, which is an empty list, so Emacs signals an error and +stops the function from attempting to continue to execute. + +The @code{sorted-lengths} list always becomes @code{nil} when the +counter reaches the end of the list. This means that any attempt to +use the @code{defuns-per-range} function with the simple version of +the test will fail. + +We solve the problem by using the @code{(car sorted-lengths)} +expression in conjunction with the @code{and} expression. The +@code{(car sorted-lengths)} expression returns a non-@code{nil} +value so long as the list has at least one number within it, but +returns @code{nil} if the list is empty. The @code{and} expression +first evaluates the @code{(car sorted-lengths)} expression, and +if it is @code{nil}, returns false @emph{without} evaluating the +@code{<} expression. But if the @code{(car sorted-lengths)} +expression returns a non-@code{nil} value, the @code{and} expression +evaluates the @code{<} expression, and returns that value as the value +of the @code{and} expression. + +@c colon in printed section title causes problem in Info cross reference +This way, we avoid an error. +@iftex +@noindent +(For information about @code{and}, see +@ref{kill-new function, , The @code{kill-new} function}.) +@end iftex +@ifinfo +@noindent +(@xref{kill-new function, , The @code{kill-new} function}, for +information about @code{and}.) +@end ifinfo + +Here is a short test of the @code{defuns-per-range} function. First, +evaluate the expression that binds (a shortened) +@code{top-of-ranges} list to the list of values, then evaluate the +expression for binding the @code{sorted-lengths} list, and then +evaluate the @code{defuns-per-range} function. + +@smallexample +@group +;; @r{(Shorter list than we will use later.)} +(setq top-of-ranges + '(110 120 130 140 150 + 160 170 180 190 200)) + +(setq sorted-lengths + '(85 86 110 116 122 129 154 176 179 200 265 300 300)) + +(defuns-per-range sorted-lengths top-of-ranges) +@end group +@end smallexample + +@need 800 +@noindent +The list returned looks like this: + +@smallexample +(2 2 2 0 0 1 0 2 0 0 4) +@end smallexample + +@noindent +Indeed, there are two elements of the @code{sorted-lengths} list +smaller than 110, two elements between 110 and 119, two elements +between 120 and 129, and so on. There are four elements with a value +of 200 or larger. + +@c The next step is to turn this numbers' list into a graph. +@node Readying a Graph, Emacs Initialization, Words in a defun, Top +@chapter Readying a Graph +@cindex Readying a graph +@cindex Graph prototype +@cindex Prototype graph +@cindex Body of graph + +Our goal is to construct a graph showing the numbers of function +definitions of various lengths in the Emacs lisp sources. + +As a practical matter, if you were creating a graph, you would +probably use a program such as @code{gnuplot} to do the job. +(@code{gnuplot} is nicely integrated into GNU Emacs.) In this case, +however, we create one from scratch, and in the process we will +re-acquaint ourselves with some of what we learned before and learn +more. + +In this chapter, we will first write a simple graph printing function. +This first definition will be a @dfn{prototype}, a rapidly written +function that enables us to reconnoiter this unknown graph-making +territory. We will discover dragons, or find that they are myth. +After scouting the terrain, we will feel more confident and enhance +the function to label the axes automatically. + +@menu +* Columns of a graph:: +* graph-body-print:: How to print the body of a graph. +* recursive-graph-body-print:: +* Printed Axes:: +* Line Graph Exercise:: +@end menu + +@node Columns of a graph, graph-body-print, Readying a Graph, Readying a Graph +@ifnottex +@unnumberedsec Printing the Columns of a Graph +@end ifnottex + +Since Emacs is designed to be flexible and work with all kinds of +terminals, including character-only terminals, the graph will need to +be made from one of the `typewriter' symbols. An asterisk will do; as +we enhance the graph-printing function, we can make the choice of +symbol a user option. + +We can call this function @code{graph-body-print}; it will take a +@code{numbers-list} as its only argument. At this stage, we will not +label the graph, but only print its body. + +The @code{graph-body-print} function inserts a vertical column of +asterisks for each element in the @code{numbers-list}. The height of +each line is determined by the value of that element of the +@code{numbers-list}. + +Inserting columns is a repetitive act; that means that this function can +be written either with a @code{while} loop or recursively. + +Our first challenge is to discover how to print a column of asterisks. +Usually, in Emacs, we print characters onto a screen horizontally, +line by line, by typing. We have two routes we can follow: write our +own column-insertion function or discover whether one exists in Emacs. + +To see whether there is one in Emacs, we can use the @kbd{M-x apropos} +command. This command is like the @kbd{C-h a} (@code{command-apropos}) +command, except that the latter finds only those functions that are +commands. The @kbd{M-x apropos} command lists all symbols that match +a regular expression, including functions that are not interactive. +@findex apropos + +What we want to look for is some command that prints or inserts +columns. Very likely, the name of the function will contain either +the word `print' or the word `insert' or the word `column'. +Therefore, we can simply type @kbd{M-x apropos RET +print\|insert\|column RET} and look at the result. On my system, this +command once too takes quite some time, and then produced a list of 79 +functions and variables. Now it does not take much time at all and +produces a list of 211 functions and variables. Scanning down the +list, the only function that looks as if it might do the job is +@code{insert-rectangle}. + +@need 1200 +Indeed, this is the function we want; its documentation says: + +@smallexample +@group +insert-rectangle: +Insert text of RECTANGLE with upper left corner at point. +RECTANGLE's first line is inserted at point, +its second line is inserted at a point vertically under point, etc. +RECTANGLE should be a list of strings. +After this command, the mark is at the upper left corner +and point is at the lower right corner. +@end group +@end smallexample + +We can run a quick test, to make sure it does what we expect of it. + +Here is the result of placing the cursor after the +@code{insert-rectangle} expression and typing @kbd{C-u C-x C-e} +(@code{eval-last-sexp}). The function inserts the strings +@samp{"first"}, @samp{"second"}, and @samp{"third"} at and below +point. Also the function returns @code{nil}. + +@smallexample +@group +(insert-rectangle '("first" "second" "third"))first + second + thirdnil +@end group +@end smallexample + +@noindent +Of course, we won't be inserting the text of the +@code{insert-rectangle} expression itself into the buffer in which we +are making the graph, but will call the function from our program. We +shall, however, have to make sure that point is in the buffer at the +place where the @code{insert-rectangle} function will insert its +column of strings. + +If you are reading this in Info, you can see how this works by +switching to another buffer, such as the @file{*scratch*} buffer, +placing point somewhere in the buffer, typing @kbd{M-:}, typing the +@code{insert-rectangle} expression into the minibuffer at the prompt, +and then typing @key{RET}. This causes Emacs to evaluate the +expression in the minibuffer, but to use as the value of point the +position of point in the @file{*scratch*} buffer. (@kbd{M-:} is the +keybinding for @code{eval-expression}. Also, @code{nil} does not +appear in the @file{*scratch*} buffer since the expression is +evaluated in the minibuffer.) + +We find when we do this that point ends up at the end of the last +inserted line---that is to say, this function moves point as a +side-effect. If we were to repeat the command, with point at this +position, the next insertion would be below and to the right of the +previous insertion. We don't want this! If we are going to make a +bar graph, the columns need to be beside each other. + +So we discover that each cycle of the column-inserting @code{while} +loop must reposition point to the place we want it, and that place +will be at the top, not the bottom, of the column. Moreover, we +remember that when we print a graph, we do not expect all the columns +to be the same height. This means that the top of each column may be +at a different height from the previous one. We cannot simply +reposition point to the same line each time, but moved over to the +right---or perhaps we can@dots{} + +We are planning to make the columns of the bar graph out of asterisks. +The number of asterisks in the column is the number specified by the +current element of the @code{numbers-list}. We need to construct a +list of asterisks of the right length for each call to +@code{insert-rectangle}. If this list consists solely of the requisite +number of asterisks, then we will have position point the right number +of lines above the base for the graph to print correctly. This could +be difficult. + +Alternatively, if we can figure out some way to pass +@code{insert-rectangle} a list of the same length each time, then we +can place point on the same line each time, but move it over one +column to the right for each new column. If we do this, however, some +of the entries in the list passed to @code{insert-rectangle} must be +blanks rather than asterisks. For example, if the maximum height of +the graph is 5, but the height of the column is 3, then +@code{insert-rectangle} requires an argument that looks like this: + +@smallexample +(" " " " "*" "*" "*") +@end smallexample + +This last proposal is not so difficult, so long as we can determine +the column height. There are two ways for us to specify the column +height: we can arbitrarily state what it will be, which would work +fine for graphs of that height; or we can search through the list of +numbers and use the maximum height of the list as the maximum height +of the graph. If the latter operation were difficult, then the former +procedure would be easiest, but there is a function built into Emacs +that determines the maximum of its arguments. We can use that +function. The function is called @code{max} and it returns the +largest of all its arguments, which must be numbers. Thus, for +example, + +@smallexample +(max 3 4 6 5 7 3) +@end smallexample + +@noindent +returns 7. (A corresponding function called @code{min} returns the +smallest of all its arguments.) +@findex max +@findex min + +However, we cannot simply call @code{max} on the @code{numbers-list}; +the @code{max} function expects numbers as its argument, not a list of +numbers. Thus, the following expression, + +@smallexample +(max '(3 4 6 5 7 3)) +@end smallexample + +@need 800 +@noindent +produces the following error message; + +@smallexample +Wrong type of argument: number-or-marker-p, (3 4 6 5 7 3) +@end smallexample + +@findex apply +We need a function that passes a list of arguments to a function. +This function is @code{apply}. This function `applies' its first +argument (a function) to its remaining arguments, the last of which +may be a list. + +@need 1250 +For example, + +@smallexample +(apply 'max 3 4 7 3 '(4 8 5)) +@end smallexample + +@noindent +returns 8. + +(Incidentally, I don't know how you would learn of this function +without a book such as this. It is possible to discover other +functions, like @code{search-forward} or @code{insert-rectangle}, by +guessing at a part of their names and then using @code{apropos}. Even +though its base in metaphor is clear---`apply' its first argument to +the rest---I doubt a novice would come up with that particular word +when using @code{apropos} or other aid. Of course, I could be wrong; +after all, the function was first named by someone who had to invent +it.) + +The second and subsequent arguments to @code{apply} are optional, so +we can use @code{apply} to call a function and pass the elements of a +list to it, like this, which also returns 8: + +@smallexample +(apply 'max '(4 8 5)) +@end smallexample + +This latter way is how we will use @code{apply}. The +@code{recursive-lengths-list-many-files} function returns a numbers' +list to which we can apply @code{max} (we could also apply @code{max} to +the sorted numbers' list; it does not matter whether the list is +sorted or not.) + +@need 800 +Hence, the operation for finding the maximum height of the graph is this: + +@smallexample +(setq max-graph-height (apply 'max numbers-list)) +@end smallexample + +Now we can return to the question of how to create a list of strings +for a column of the graph. Told the maximum height of the graph +and the number of asterisks that should appear in the column, the +function should return a list of strings for the +@code{insert-rectangle} command to insert. + +Each column is made up of asterisks or blanks. Since the function is +passed the value of the height of the column and the number of +asterisks in the column, the number of blanks can be found by +subtracting the number of asterisks from the height of the column. +Given the number of blanks and the number of asterisks, two +@code{while} loops can be used to construct the list: + +@smallexample +@group +;;; @r{First version.} +(defun column-of-graph (max-graph-height actual-height) + "Return list of strings that is one column of a graph." + (let ((insert-list nil) + (number-of-top-blanks + (- max-graph-height actual-height))) +@end group + +@group + ;; @r{Fill in asterisks.} + (while (> actual-height 0) + (setq insert-list (cons "*" insert-list)) + (setq actual-height (1- actual-height))) +@end group + +@group + ;; @r{Fill in blanks.} + (while (> number-of-top-blanks 0) + (setq insert-list (cons " " insert-list)) + (setq number-of-top-blanks + (1- number-of-top-blanks))) +@end group + +@group + ;; @r{Return whole list.} + insert-list)) +@end group +@end smallexample + +If you install this function and then evaluate the following +expression you will see that it returns the list as desired: + +@smallexample +(column-of-graph 5 3) +@end smallexample + +@need 800 +@noindent +returns + +@smallexample +(" " " " "*" "*" "*") +@end smallexample + +As written, @code{column-of-graph} contains a major flaw: the symbols +used for the blank and for the marked entries in the column are +`hard-coded' as a space and asterisk. This is fine for a prototype, +but you, or another user, may wish to use other symbols. For example, +in testing the graph function, you many want to use a period in place +of the space, to make sure the point is being repositioned properly +each time the @code{insert-rectangle} function is called; or you might +want to substitute a @samp{+} sign or other symbol for the asterisk. +You might even want to make a graph-column that is more than one +display column wide. The program should be more flexible. The way to +do that is to replace the blank and the asterisk with two variables +that we can call @code{graph-blank} and @code{graph-symbol} and define +those variables separately. + +Also, the documentation is not well written. These considerations +lead us to the second version of the function: + +@smallexample +@group +(defvar graph-symbol "*" + "String used as symbol in graph, usually an asterisk.") +@end group + +@group +(defvar graph-blank " " + "String used as blank in graph, usually a blank space. +graph-blank must be the same number of columns wide +as graph-symbol.") +@end group +@end smallexample + +@noindent +(For an explanation of @code{defvar}, see +@ref{defvar, , Initializing a Variable with @code{defvar}}.) + +@smallexample +@group +;;; @r{Second version.} +(defun column-of-graph (max-graph-height actual-height) + "Return MAX-GRAPH-HEIGHT strings; ACTUAL-HEIGHT are graph-symbols. + +@end group +@group +The graph-symbols are contiguous entries at the end +of the list. +The list will be inserted as one column of a graph. +The strings are either graph-blank or graph-symbol." +@end group + +@group + (let ((insert-list nil) + (number-of-top-blanks + (- max-graph-height actual-height))) +@end group + +@group + ;; @r{Fill in @code{graph-symbols}.} + (while (> actual-height 0) + (setq insert-list (cons graph-symbol insert-list)) + (setq actual-height (1- actual-height))) +@end group + +@group + ;; @r{Fill in @code{graph-blanks}.} + (while (> number-of-top-blanks 0) + (setq insert-list (cons graph-blank insert-list)) + (setq number-of-top-blanks + (1- number-of-top-blanks))) + + ;; @r{Return whole list.} + insert-list)) +@end group +@end smallexample + +If we wished, we could rewrite @code{column-of-graph} a third time to +provide optionally for a line graph as well as for a bar graph. This +would not be hard to do. One way to think of a line graph is that it +is no more than a bar graph in which the part of each bar that is +below the top is blank. To construct a column for a line graph, the +function first constructs a list of blanks that is one shorter than +the value, then it uses @code{cons} to attach a graph symbol to the +list; then it uses @code{cons} again to attach the `top blanks' to +the list. + +It is easy to see how to write such a function, but since we don't +need it, we will not do it. But the job could be done, and if it were +done, it would be done with @code{column-of-graph}. Even more +important, it is worth noting that few changes would have to be made +anywhere else. The enhancement, if we ever wish to make it, is +simple. + +Now, finally, we come to our first actual graph printing function. +This prints the body of a graph, not the labels for the vertical and +horizontal axes, so we can call this @code{graph-body-print}. + +@node graph-body-print, recursive-graph-body-print, Columns of a graph, Readying a Graph +@section The @code{graph-body-print} Function +@findex graph-body-print + +After our preparation in the preceding section, the +@code{graph-body-print} function is straightforward. The function +will print column after column of asterisks and blanks, using the +elements of a numbers' list to specify the number of asterisks in each +column. This is a repetitive act, which means we can use a +decrementing @code{while} loop or recursive function for the job. In +this section, we will write the definition using a @code{while} loop. + +The @code{column-of-graph} function requires the height of the graph +as an argument, so we should determine and record that as a local variable. + +This leads us to the following template for the @code{while} loop +version of this function: + +@smallexample +@group +(defun graph-body-print (numbers-list) + "@var{documentation}@dots{}" + (let ((height @dots{} + @dots{})) +@end group + +@group + (while numbers-list + @var{insert-columns-and-reposition-point} + (setq numbers-list (cdr numbers-list))))) +@end group +@end smallexample + +@noindent +We need to fill in the slots of the template. + +Clearly, we can use the @code{(apply 'max numbers-list)} expression to +determine the height of the graph. + +The @code{while} loop will cycle through the @code{numbers-list} one +element at a time. As it is shortened by the @code{(setq numbers-list +(cdr numbers-list))} expression, the @sc{car} of each instance of the +list is the value of the argument for @code{column-of-graph}. + +At each cycle of the @code{while} loop, the @code{insert-rectangle} +function inserts the list returned by @code{column-of-graph}. Since +the @code{insert-rectangle} function moves point to the lower right of +the inserted rectangle, we need to save the location of point at the +time the rectangle is inserted, move back to that position after the +rectangle is inserted, and then move horizontally to the next place +from which @code{insert-rectangle} is called. + +If the inserted columns are one character wide, as they will be if +single blanks and asterisks are used, the repositioning command is +simply @code{(forward-char 1)}; however, the width of a column may be +greater than one. This means that the repositioning command should be +written @code{(forward-char symbol-width)}. The @code{symbol-width} +itself is the length of a @code{graph-blank} and can be found using +the expression @code{(length graph-blank)}. The best place to bind +the @code{symbol-width} variable to the value of the width of graph +column is in the varlist of the @code{let} expression. + +@need 1250 +These considerations lead to the following function definition: + +@smallexample +@group +(defun graph-body-print (numbers-list) + "Print a bar graph of the NUMBERS-LIST. +The numbers-list consists of the Y-axis values." + + (let ((height (apply 'max numbers-list)) + (symbol-width (length graph-blank)) + from-position) +@end group + +@group + (while numbers-list + (setq from-position (point)) + (insert-rectangle + (column-of-graph height (car numbers-list))) + (goto-char from-position) + (forward-char symbol-width) +@end group +@group + ;; @r{Draw graph column by column.} + (sit-for 0) + (setq numbers-list (cdr numbers-list))) +@end group +@group + ;; @r{Place point for X axis labels.} + (forward-line height) + (insert "\n") +)) +@end group +@end smallexample + +@noindent +The one unexpected expression in this function is the +@w{@code{(sit-for 0)}} expression in the @code{while} loop. This +expression makes the graph printing operation more interesting to +watch than it would be otherwise. The expression causes Emacs to +`sit' or do nothing for a zero length of time and then redraw the +screen. Placed here, it causes Emacs to redraw the screen column by +column. Without it, Emacs would not redraw the screen until the +function exits. + +We can test @code{graph-body-print} with a short list of numbers. + +@enumerate +@item +Install @code{graph-symbol}, @code{graph-blank}, +@code{column-of-graph}, which are in +@iftex +@ref{Readying a Graph, , Readying a Graph}, +@end iftex +@ifinfo +@ref{Columns of a graph}, +@end ifinfo +and @code{graph-body-print}. + +@need 800 +@item +Copy the following expression: + +@smallexample +(graph-body-print '(1 2 3 4 6 4 3 5 7 6 5 2 3)) +@end smallexample + +@item +Switch to the @file{*scratch*} buffer and place the cursor where you +want the graph to start. + +@item +Type @kbd{M-:} (@code{eval-expression}). + +@item +Yank the @code{graph-body-print} expression into the minibuffer +with @kbd{C-y} (@code{yank)}. + +@item +Press @key{RET} to evaluate the @code{graph-body-print} expression. +@end enumerate + +@need 800 +Emacs will print a graph like this: + +@smallexample +@group + * + * ** + * **** + *** **** + ********* * + ************ + ************* +@end group +@end smallexample + +@node recursive-graph-body-print, Printed Axes, graph-body-print, Readying a Graph +@section The @code{recursive-graph-body-print} Function +@findex recursive-graph-body-print + +The @code{graph-body-print} function may also be written recursively. +The recursive solution is divided into two parts: an outside `wrapper' +that uses a @code{let} expression to determine the values of several +variables that need only be found once, such as the maximum height of +the graph, and an inside function that is called recursively to print +the graph. + +@need 1250 +The `wrapper' is uncomplicated: + +@smallexample +@group +(defun recursive-graph-body-print (numbers-list) + "Print a bar graph of the NUMBERS-LIST. +The numbers-list consists of the Y-axis values." + (let ((height (apply 'max numbers-list)) + (symbol-width (length graph-blank)) + from-position) + (recursive-graph-body-print-internal + numbers-list + height + symbol-width))) +@end group +@end smallexample + +The recursive function is a little more difficult. It has four parts: +the `do-again-test', the printing code, the recursive call, and the +`next-step-expression'. The `do-again-test' is a @code{when} +expression that determines whether the @code{numbers-list} contains +any remaining elements; if it does, the function prints one column of +the graph using the printing code and calls itself again. The +function calls itself again according to the value produced by the +`next-step-expression' which causes the call to act on a shorter +version of the @code{numbers-list}. + +@smallexample +@group +(defun recursive-graph-body-print-internal + (numbers-list height symbol-width) + "Print a bar graph. +Used within recursive-graph-body-print function." +@end group + +@group + (when numbers-list + (setq from-position (point)) + (insert-rectangle + (column-of-graph height (car numbers-list))) +@end group +@group + (goto-char from-position) + (forward-char symbol-width) + (sit-for 0) ; @r{Draw graph column by column.} + (recursive-graph-body-print-internal + (cdr numbers-list) height symbol-width))) +@end group +@end smallexample + +@need 1250 +After installation, this expression can be tested; here is a sample: + +@smallexample +(recursive-graph-body-print '(3 2 5 6 7 5 3 4 6 4 3 2 1)) +@end smallexample + +@need 800 +Here is what @code{recursive-graph-body-print} produces: + +@smallexample +@group + * + ** * + **** * + **** *** + * ********* + ************ + ************* +@end group +@end smallexample + +Either of these two functions, @code{graph-body-print} or +@code{recursive-graph-body-print}, create the body of a graph. + +@node Printed Axes, Line Graph Exercise, recursive-graph-body-print, Readying a Graph +@section Need for Printed Axes + +A graph needs printed axes, so you can orient yourself. For a do-once +project, it may be reasonable to draw the axes by hand using Emacs' +Picture mode; but a graph drawing function may be used more than once. + +For this reason, I have written enhancements to the basic +@code{print-graph-body} function that automatically print labels for +the horizontal and vertical axes. Since the label printing functions +do not contain much new material, I have placed their description in +an appendix. @xref{Full Graph, , A Graph with Labelled Axes}. + +@node Line Graph Exercise, , Printed Axes, Readying a Graph +@section Exercise + +Write a line graph version of the graph printing functions. + +@node Emacs Initialization, Debugging, Readying a Graph, Top +@chapter Your @file{.emacs} File +@cindex @file{.emacs} file +@cindex Customizing your @file{.emacs} file +@cindex Initialization file + +``You don't have to like Emacs to like it'' -- this seemingly +paradoxical statement is the secret of GNU Emacs. The plain, `out of +the box' Emacs is a generic tool. Most people who use it, customize +it to suit themselves. + +GNU Emacs is mostly written in Emacs Lisp; this means that by writing +expressions in Emacs Lisp you can change or extend Emacs. + +@menu +* Default Configuration:: +* Site-wide Init:: You can write site-wide init files. +* defcustom:: Emacs will write code for you. +* Beginning a .emacs File:: How to write a @code{.emacs file}. +* Text and Auto-fill:: Automatically wrap lines. +* Mail Aliases:: Use abbreviations for email addresses. +* Indent Tabs Mode:: Don't use tabs with @TeX{} +* Keybindings:: Create some personal keybindings. +* Keymaps:: More about key binding. +* Loading Files:: Load (i.e., evaluate) files automatically. +* Autoload:: Make functions available. +* Simple Extension:: Define a function; bind it to a key. +* X11 Colors:: Colors in X. +* Miscellaneous:: +* Mode Line:: How to customize your mode line. +@end menu + +@node Default Configuration, Site-wide Init, Emacs Initialization, Emacs Initialization +@ifnottex +@unnumberedsec Emacs' Default Configuration +@end ifnottex + +There are those who appreciate Emacs' default configuration. After +all, Emacs starts you in C mode when you edit a C file, starts you in +Fortran mode when you edit a Fortran file, and starts you in +Fundamental mode when you edit an unadorned file. This all makes +sense, if you do not know who is going to use Emacs. Who knows what a +person hopes to do with an unadorned file? Fundamental mode is the +right default for such a file, just as C mode is the right default for +editing C code. (Enough programming languages have syntaxes +that enable them to share or nearly share features, so C mode is +now provided by by CC mode, the `C Collection'.) + +But when you do know who is going to use Emacs---you, +yourself---then it makes sense to customize Emacs. + +For example, I seldom want Fundamental mode when I edit an +otherwise undistinguished file; I want Text mode. This is why I +customize Emacs: so it suits me. + +You can customize and extend Emacs by writing or adapting a +@file{~/.emacs} file. This is your personal initialization file; its +contents, written in Emacs Lisp, tell Emacs what to do.@footnote{You +may also add @file{.el} to @file{~/.emacs} and call it a +@file{~/.emacs.el} file. In the past, you were forbidden to type the +extra keystrokes that the name @file{~/.emacs.el} requires, but now +you may. The new format is consistent with the Emacs Lisp file +naming conventions; the old format saves typing.} + +A @file{~/.emacs} file contains Emacs Lisp code. You can write this +code yourself; or you can use Emacs' @code{customize} feature to write +the code for you. You can combine your own expressions and +auto-written Customize expressions in your @file{.emacs} file. + +(I myself prefer to write my own expressions, except for those, +particularly fonts, that I find easier to manipulate using the +@code{customize} command. I combine the two methods.) + +Most of this chapter is about writing expressions yourself. It +describes a simple @file{.emacs} file; for more information, see +@ref{Init File, , The Init File, emacs, The GNU Emacs Manual}, and +@ref{Init File, , The Init File, elisp, The GNU Emacs Lisp Reference +Manual}. + +@node Site-wide Init, defcustom, Default Configuration, Emacs Initialization +@section Site-wide Initialization Files + +@cindex @file{default.el} init file +@cindex @file{site-init.el} init file +@cindex @file{site-load.el} init file +In addition to your personal initialization file, Emacs automatically +loads various site-wide initialization files, if they exist. These +have the same form as your @file{.emacs} file, but are loaded by +everyone. + +Two site-wide initialization files, @file{site-load.el} and +@file{site-init.el}, are loaded into Emacs and then `dumped' if a +`dumped' version of Emacs is created, as is most common. (Dumped +copies of Emacs load more quickly. However, once a file is loaded and +dumped, a change to it does not lead to a change in Emacs unless you +load it yourself or re-dump Emacs. @xref{Building Emacs, , Building +Emacs, elisp, The GNU Emacs Lisp Reference Manual}, and the +@file{INSTALL} file.) + +Three other site-wide initialization files are loaded automatically +each time you start Emacs, if they exist. These are +@file{site-start.el}, which is loaded @emph{before} your @file{.emacs} +file, and @file{default.el}, and the terminal type file, which are both +loaded @emph{after} your @file{.emacs} file. + +Settings and definitions in your @file{.emacs} file will overwrite +conflicting settings and definitions in a @file{site-start.el} file, +if it exists; but the settings and definitions in a @file{default.el} +or terminal type file will overwrite those in your @file{.emacs} file. +(You can prevent interference from a terminal type file by setting +@code{term-file-prefix} to @code{nil}. @xref{Simple Extension, , A +Simple Extension}.) + +@c Rewritten to avoid overfull hbox. +The @file{INSTALL} file that comes in the distribution contains +descriptions of the @file{site-init.el} and @file{site-load.el} files. + +The @file{loadup.el}, @file{startup.el}, and @file{loaddefs.el} files +control loading. These files are in the @file{lisp} directory of the +Emacs distribution and are worth perusing. + +The @file{loaddefs.el} file contains a good many suggestions as to +what to put into your own @file{.emacs} file, or into a site-wide +initialization file. + +@node defcustom, Beginning a .emacs File, Site-wide Init, Emacs Initialization +@section Specifying Variables using @code{defcustom} +@findex defcustom + +You can specify variables using @code{defcustom} so that you and +others can then use Emacs' @code{customize} feature to set their +values. (You cannot use @code{customize} to write function +definitions; but you can write @code{defuns} in your @file{.emacs} +file. Indeed, you can write any Lisp expression in your @file{.emacs} +file.) + +The @code{customize} feature depends on the @code{defcustom} special +form. Although you can use @code{defvar} or @code{setq} for variables +that users set, the @code{defcustom} special form is designed for the +job. + +You can use your knowledge of @code{defvar} for writing the +first three arguments for @code{defcustom}. The first argument to +@code{defcustom} is the name of the variable. The second argument is +the variable's initial value, if any; and this value is set only if +the value has not already been set. The third argument is the +documentation. + +The fourth and subsequent arguments to @code{defcustom} specify types +and options; these are not featured in @code{defvar}. (These +arguments are optional.) + +Each of these arguments consists of a keyword followed by a value. +Each keyword starts with the colon character @samp{:}. + +@need 1250 +For example, the customizable user option variable +@code{text-mode-hook} looks like this: + +@smallexample +@group +(defcustom text-mode-hook nil + "Normal hook run when entering Text mode and many related modes." + :type 'hook + :options '(turn-on-auto-fill flyspell-mode) + :group 'data) +@end group +@end smallexample + +@noindent +The name of the variable is @code{text-mode-hook}; it has no default +value; and its documentation string tells you what it does. + +The @code{:type} keyword tells Emacs the kind of data to which +@code{text-mode-hook} should be set and how to display the value in a +Customization buffer. + +The @code{:options} keyword specifies a suggested list of values for +the variable. Usually, @code{:options} applies to a hook. +The list is only a suggestion; it is not exclusive; a person who sets +the variable may set it to other values; the list shown following the +@code{:options} keyword is intended to offer convenient choices to a +user. + +Finally, the @code{:group} keyword tells the Emacs Customization +command in which group the variable is located. This tells where to +find it. + +The @code{defcustom} function recognizes more than a dozen keywords. +For more information, see @ref{Customization, , Writing Customization +Definitions, elisp, The GNU Emacs Lisp Reference Manual}. + +Consider @code{text-mode-hook} as an example. + +There are two ways to customize this variable. You can use the +customization command or write the appropriate expressions yourself. + +@need 800 +Using the customization command, you can type: + +@smallexample +M-x customize +@end smallexample + +@noindent +and find that the group for editing files of data is called `data'. +Enter that group. Text Mode Hook is the first member. You can click +on its various options, such as @code{turn-on-auto-fill}, to set the +values. After you click on the button to + +@smallexample +Save for Future Sessions +@end smallexample + +@noindent +Emacs will write an expression into your @file{.emacs} file. +It will look like this: + +@smallexample +@group +(custom-set-variables + ;; custom-set-variables was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + '(text-mode-hook (quote (turn-on-auto-fill text-mode-hook-identify)))) +@end group +@end smallexample + +@noindent +(The @code{text-mode-hook-identify} function tells +@code{toggle-text-mode-auto-fill} which buffers are in Text mode. +It comes on automatically.) + +The @code{custom-set-variables} function works somewhat differently +than a @code{setq}. While I have never learned the differences, I +modify the @code{custom-set-variables} expressions in my @file{.emacs} +file by hand: I make the changes in what appears to me to be a +reasonable manner and have not had any problems. Others prefer to use +the Customization command and let Emacs do the work for them. + +Another @code{custom-set-@dots{}} function is @code{custom-set-faces}. +This function sets the various font faces. Over time, I have set a +considerable number of faces. Some of the time, I re-set them using +@code{customize}; other times, I simply edit the +@code{custom-set-faces} expression in my @file{.emacs} file itself. + +The second way to customize your @code{text-mode-hook} is to set it +yourself in your @file{.emacs} file using code that has nothing to do +with the @code{custom-set-@dots{}} functions. + +@need 800 +When you do this, and later use @code{customize}, you will see a +message that says + +@smallexample +CHANGED outside Customize; operating on it here may be unreliable. +@end smallexample + +@need 800 +This message is only a warning. If you click on the button to + +@smallexample +Save for Future Sessions +@end smallexample + +@noindent +Emacs will write a @code{custom-set-@dots{}} expression near the end +of your @file{.emacs} file that will be evaluated after your +hand-written expression. It will, therefore, overrule your +hand-written expression. No harm will be done. When you do this, +however, be careful to remember which expression is active; if you +forget, you may confuse yourself. + +So long as you remember where the values are set, you will have no +trouble. In any event, the values are always set in your +initialization file, which is usually called @file{.emacs}. + +I myself use @code{customize} for hardly anything. Mostly, I write +expressions myself. + +@findex defsubst +@findex defconst +Incidentally, to be more complete concerning defines: @code{defsubst} +defines an inline function. The syntax is just like that of +@code{defun}. @code{defconst} defines a symbol as a constant. The +intent is that neither programs nor users should ever change a value +set by @code{defconst}. (You can change it; the value set is a +variable; but please do not.) + +@node Beginning a .emacs File, Text and Auto-fill, defcustom, Emacs Initialization +@section Beginning a @file{.emacs} File +@cindex @file{.emacs} file, beginning of + +When you start Emacs, it loads your @file{.emacs} file unless you tell +it not to by specifying @samp{-q} on the command line. (The +@code{emacs -q} command gives you a plain, out-of-the-box Emacs.) + +A @file{.emacs} file contains Lisp expressions. Often, these are no +more than expressions to set values; sometimes they are function +definitions. + +@xref{Init File, , The Init File @file{~/.emacs}, emacs, The GNU Emacs +Manual}, for a short description of initialization files. + +This chapter goes over some of the same ground, but is a walk among +extracts from a complete, long-used @file{.emacs} file---my own. + +The first part of the file consists of comments: reminders to myself. +By now, of course, I remember these things, but when I started, I did +not. + +@need 1200 +@smallexample +@group +;;;; Bob's .emacs file +; Robert J. Chassell +; 26 September 1985 +@end group +@end smallexample + +@noindent +Look at that date! I started this file a long time ago. I have been +adding to it ever since. + +@smallexample +@group +; Each section in this file is introduced by a +; line beginning with four semicolons; and each +; entry is introduced by a line beginning with +; three semicolons. +@end group +@end smallexample + +@noindent +This describes the usual conventions for comments in Emacs Lisp. +Everything on a line that follows a semicolon is a comment. Two, +three, and four semicolons are used as subsection and section markers. +(@xref{Comments, ,, elisp, The GNU Emacs Lisp Reference Manual}, for +more about comments.) + +@smallexample +@group +;;;; The Help Key +; Control-h is the help key; +; after typing control-h, type a letter to +; indicate the subject about which you want help. +; For an explanation of the help facility, +; type control-h two times in a row. +@end group +@end smallexample + +@noindent +Just remember: type @kbd{C-h} two times for help. + +@smallexample +@group +; To find out about any mode, type control-h m +; while in that mode. For example, to find out +; about mail mode, enter mail mode and then type +; control-h m. +@end group +@end smallexample + +@noindent +`Mode help', as I call this, is very helpful. Usually, it tells you +all you need to know. + +Of course, you don't need to include comments like these in your +@file{.emacs} file. I included them in mine because I kept forgetting +about Mode help or the conventions for comments---but I was able to +remember to look here to remind myself. + +@node Text and Auto-fill, Mail Aliases, Beginning a .emacs File, Emacs Initialization +@section Text and Auto Fill Mode + +Now we come to the part that `turns on' Text mode and +Auto Fill mode. + +@smallexample +@group +;;; Text mode and Auto Fill mode +; The next two lines put Emacs into Text mode +; and Auto Fill mode, and are for writers who +; want to start writing prose rather than code. +(setq default-major-mode 'text-mode) +(add-hook 'text-mode-hook 'turn-on-auto-fill) +@end group +@end smallexample + +Here is the first part of this @file{.emacs} file that does something +besides remind a forgetful human! + +The first of the two lines in parentheses tells Emacs to turn on Text +mode when you find a file, @emph{unless} that file should go into some +other mode, such as C mode. + +@cindex Per-buffer, local variables list +@cindex Local variables list, per-buffer, +@cindex Automatic mode selection +@cindex Mode selection, automatic +When Emacs reads a file, it looks at the extension to the file name, +if any. (The extension is the part that comes after a @samp{.}.) If +the file ends with a @samp{.c} or @samp{.h} extension then Emacs turns +on C mode. Also, Emacs looks at first nonblank line of the file; if +the line says @w{@samp{-*- C -*-}}, Emacs turns on C mode. Emacs +possesses a list of extensions and specifications that it uses +automatically. In addition, Emacs looks near the last page for a +per-buffer, ``local variables list'', if any. + +@ifinfo +@xref{Choosing Modes, , How Major Modes are Chosen, emacs, The GNU +Emacs Manual}. + +@xref{File Variables, , Local Variables in Files, emacs, The GNU Emacs +Manual}. +@end ifinfo +@iftex +See sections ``How Major Modes are Chosen'' and ``Local Variables in +Files'' in @cite{The GNU Emacs Manual}. +@end iftex + +Now, back to the @file{.emacs} file. + +@need 800 +Here is the line again; how does it work? + +@cindex Text Mode turned on +@smallexample +(setq default-major-mode 'text-mode) +@end smallexample + +@noindent +This line is a short, but complete Emacs Lisp expression. + +We are already familiar with @code{setq}. It sets the following variable, +@code{default-major-mode}, to the subsequent value, which is +@code{text-mode}. The single quote mark before @code{text-mode} tells +Emacs to deal directly with the @code{text-mode} variable, not with +whatever it might stand for. @xref{set & setq, , Setting the Value of +a Variable}, for a reminder of how @code{setq} works. The main point +is that there is no difference between the procedure you use to set +a value in your @file{.emacs} file and the procedure you use anywhere +else in Emacs. + +@need 800 +Here is the next line: + +@cindex Auto Fill mode turned on +@findex add-hook +@smallexample +(add-hook 'text-mode-hook 'turn-on-auto-fill) +@end smallexample + +@noindent +In this line, the @code{add-hook} command adds +@code{turn-on-auto-fill} to the variable. + +@code{turn-on-auto-fill} is the name of a program, that, you guessed +it!, turns on Auto Fill mode. + +Every time Emacs turns on Text mode, Emacs runs the commands `hooked' +onto Text mode. So every time Emacs turns on Text mode, Emacs also +turns on Auto Fill mode. + +In brief, the first line causes Emacs to enter Text mode when you edit a +file, unless the file name extension, a first non-blank line, or local +variables to tell Emacs otherwise. + +Text mode among other actions, sets the syntax table to work +conveniently for writers. In Text mode, Emacs considers an apostrophe +as part of a word like a letter; but Emacs does not consider a period +or a space as part of a word. Thus, @kbd{M-f} moves you over +@samp{it's}. On the other hand, in C mode, @kbd{M-f} stops just after +the @samp{t} of @samp{it's}. + +The second line causes Emacs to turn on Auto Fill mode when it turns +on Text mode. In Auto Fill mode, Emacs automatically breaks a line +that is too wide and brings the excessively wide part of the line down +to the next line. Emacs breaks lines between words, not within them. + +When Auto Fill mode is turned off, lines continue to the right as you +type them. Depending on how you set the value of +@code{truncate-lines}, the words you type either disappear off the +right side of the screen, or else are shown, in a rather ugly and +unreadable manner, as a continuation line on the screen. + +@need 1250 +In addition, in this part of my @file{.emacs} file, I tell the Emacs +fill commands to insert two spaces after a colon: + +@smallexample +(setq colon-double-space t) +@end smallexample + +@node Mail Aliases, Indent Tabs Mode, Text and Auto-fill, Emacs Initialization +@section Mail Aliases + +Here is a @code{setq} that `turns on' mail aliases, along with more +reminders. + +@smallexample +@group +;;; Mail mode +; To enter mail mode, type `C-x m' +; To enter RMAIL (for reading mail), +; type `M-x rmail' +(setq mail-aliases t) +@end group +@end smallexample + +@cindex Mail aliases +@noindent +This @code{setq} command sets the value of the variable +@code{mail-aliases} to @code{t}. Since @code{t} means true, the line +says, in effect, ``Yes, use mail aliases.'' + +Mail aliases are convenient short names for long email addresses or +for lists of email addresses. The file where you keep your `aliases' +is @file{~/.mailrc}. You write an alias like this: + +@smallexample +alias geo george@@foobar.wiz.edu +@end smallexample + +@noindent +When you write a message to George, address it to @samp{geo}; the +mailer will automatically expand @samp{geo} to the full address. + +@node Indent Tabs Mode, Keybindings, Mail Aliases, Emacs Initialization +@section Indent Tabs Mode +@cindex Tabs, preventing +@findex indent-tabs-mode + +By default, Emacs inserts tabs in place of multiple spaces when it +formats a region. (For example, you might indent many lines of text +all at once with the @code{indent-region} command.) Tabs look fine on +a terminal or with ordinary printing, but they produce badly indented +output when you use @TeX{} or Texinfo since @TeX{} ignores tabs. + +@need 1250 +The following turns off Indent Tabs mode: + +@smallexample +@group +;;; Prevent Extraneous Tabs +(setq-default indent-tabs-mode nil) +@end group +@end smallexample + +Note that this line uses @code{setq-default} rather than the +@code{setq} command that we have seen before. The @code{setq-default} +command sets values only in buffers that do not have their own local +values for the variable. + +@ifinfo +@xref{Just Spaces, , Tabs vs. Spaces, emacs, The GNU Emacs Manual}. + +@xref{File Variables, , Local Variables in Files, emacs, The GNU Emacs +Manual}. +@end ifinfo +@iftex +See sections ``Tabs vs.@: Spaces'' and ``Local Variables in +Files'' in @cite{The GNU Emacs Manual}. +@end iftex + +@need 1700 +@node Keybindings, Keymaps, Indent Tabs Mode, Emacs Initialization +@section Some Keybindings + +Now for some personal keybindings: + +@smallexample +@group +;;; Compare windows +(global-set-key "\C-cw" 'compare-windows) +@end group +@end smallexample + +@findex compare-windows +@code{compare-windows} is a nifty command that compares the text in +your current window with text in the next window. It makes the +comparison by starting at point in each window, moving over text in +each window as far as they match. I use this command all the time. + +This also shows how to set a key globally, for all modes. + +@cindex Setting a key globally +@cindex Global set key +@cindex Key setting globally +@findex global-set-key +The command is @code{global-set-key}. It is followed by the +keybinding. In a @file{.emacs} file, the keybinding is written as +shown: @code{\C-c} stands for `control-c', which means `press the +control key and the @key{c} key at the same time'. The @code{w} means +`press the @key{w} key'. The keybinding is surrounded by double +quotation marks. In documentation, you would write this as +@w{@kbd{C-c w}}. (If you were binding a @key{META} key, such as +@kbd{M-c}, rather than a @key{CTRL} key, you would write +@w{@code{\M-c}} in your @file{.emacs} file. @xref{Init Rebinding, , +Rebinding Keys in Your Init File, emacs, The GNU Emacs Manual}, for +details.) + +The command invoked by the keys is @code{compare-windows}. Note that +@code{compare-windows} is preceded by a single quote; otherwise, Emacs +would first try to evaluate the symbol to determine its value. + +These three things, the double quotation marks, the backslash before +the @samp{C}, and the single quote mark are necessary parts of +keybinding that I tend to forget. Fortunately, I have come to +remember that I should look at my existing @file{.emacs} file, and +adapt what is there. + +As for the keybinding itself: @kbd{C-c w}. This combines the prefix +key, @kbd{C-c}, with a single character, in this case, @kbd{w}. This +set of keys, @kbd{C-c} followed by a single character, is strictly +reserved for individuals' own use. (I call these `own' keys, since +these are for my own use.) You should always be able to create such a +keybinding for your own use without stomping on someone else's +keybinding. If you ever write an extension to Emacs, please avoid +taking any of these keys for public use. Create a key like @kbd{C-c +C-w} instead. Otherwise, we will run out of `own' keys. + +@need 1250 +Here is another keybinding, with a comment: + +@smallexample +@group +;;; Keybinding for `occur' +; I use occur a lot, so let's bind it to a key: +(global-set-key "\C-co" 'occur) +@end group +@end smallexample + +@findex occur +The @code{occur} command shows all the lines in the current buffer +that contain a match for a regular expression. Matching lines are +shown in a buffer called @file{*Occur*}. That buffer serves as a menu +to jump to occurrences. + +@findex global-unset-key +@cindex Unbinding key +@cindex Key unbinding +@need 1250 +Here is how to unbind a key, so it does not +work: + +@smallexample +@group +;;; Unbind `C-x f' +(global-unset-key "\C-xf") +@end group +@end smallexample + +There is a reason for this unbinding: I found I inadvertently typed +@w{@kbd{C-x f}} when I meant to type @kbd{C-x C-f}. Rather than find a +file, as I intended, I accidentally set the width for filled text, +almost always to a width I did not want. Since I hardly ever reset my +default width, I simply unbound the key. + +@findex list-buffers, @r{rebound} +@findex buffer-menu, @r{bound to key} +@need 1250 +The following rebinds an existing key: + +@smallexample +@group +;;; Rebind `C-x C-b' for `buffer-menu' +(global-set-key "\C-x\C-b" 'buffer-menu) +@end group +@end smallexample + +By default, @kbd{C-x C-b} runs the +@code{list-buffers} command. This command lists +your buffers in @emph{another} window. Since I +almost always want to do something in that +window, I prefer the @code{buffer-menu} +command, which not only lists the buffers, +but moves point into that window. + +@node Keymaps, Loading Files, Keybindings, Emacs Initialization +@section Keymaps +@cindex Keymaps +@cindex Rebinding keys + +Emacs uses @dfn{keymaps} to record which keys call which commands. +When you use @code{global-set-key} to set the keybinding for a single +command in all parts of Emacs, you are specifying the keybinding in +@code{current-global-map}. + +Specific modes, such as C mode or Text mode, have their own keymaps; +the mode-specific keymaps override the global map that is shared by +all buffers. + +The @code{global-set-key} function binds, or rebinds, the global +keymap. For example, the following binds the key @kbd{C-x C-b} to the +function @code{buffer-menu}: + +@smallexample +(global-set-key "\C-x\C-b" 'buffer-menu) +@end smallexample + +Mode-specific keymaps are bound using the @code{define-key} function, +which takes a specific keymap as an argument, as well as the key and +the command. For example, my @file{.emacs} file contains the +following expression to bind the @code{texinfo-insert-@@group} command +to @kbd{C-c C-c g}: + +@smallexample +@group +(define-key texinfo-mode-map "\C-c\C-cg" 'texinfo-insert-@@group) +@end group +@end smallexample + +@noindent +The @code{texinfo-insert-@@group} function itself is a little extension +to Texinfo mode that inserts @samp{@@group} into a Texinfo file. I +use this command all the time and prefer to type the three strokes +@kbd{C-c C-c g} rather than the six strokes @kbd{@@ g r o u p}. +(@samp{@@group} and its matching @samp{@@end group} are commands that +keep all enclosed text together on one page; many multi-line examples +in this book are surrounded by @samp{@@group @dots{} @@end group}.) + +@need 1250 +Here is the @code{texinfo-insert-@@group} function definition: + +@smallexample +@group +(defun texinfo-insert-@@group () + "Insert the string @@group in a Texinfo buffer." + (interactive) + (beginning-of-line) + (insert "@@group\n")) +@end group +@end smallexample + +(Of course, I could have used Abbrev mode to save typing, rather than +write a function to insert a word; but I prefer key strokes consistent +with other Texinfo mode key bindings.) + +You will see numerous @code{define-key} expressions in +@file{loaddefs.el} as well as in the various mode libraries, such as +@file{cc-mode.el} and @file{lisp-mode.el}. + +@xref{Key Bindings, , Customizing Key Bindings, emacs, The GNU Emacs +Manual}, and @ref{Keymaps, , Keymaps, elisp, The GNU Emacs Lisp +Reference Manual}, for more information about keymaps. + +@node Loading Files, Autoload, Keymaps, Emacs Initialization +@section Loading Files +@cindex Loading files +@c findex load + +Many people in the GNU Emacs community have written extensions to +Emacs. As time goes by, these extensions are often included in new +releases. For example, the Calendar and Diary packages are now part +of the standard GNU Emacs, as is Calc. + +You can use a @code{load} command to evaluate a complete file and +thereby install all the functions and variables in the file into Emacs. +For example: + +@c (auto-compression-mode t) + +@smallexample +(load "~/emacs/slowsplit") +@end smallexample + +This evaluates, i.e.@: loads, the @file{slowsplit.el} file or if it +exists, the faster, byte compiled @file{slowsplit.elc} file from the +@file{emacs} sub-directory of your home directory. The file contains +the function @code{split-window-quietly}, which John Robinson wrote in +1989. + +The @code{split-window-quietly} function splits a window with the +minimum of redisplay. I installed it in 1989 because it worked well +with the slow 1200 baud terminals I was then using. Nowadays, I only +occasionally come across such a slow connection, but I continue to use +the function because I like the way it leaves the bottom half of a +buffer in the lower of the new windows and the top half in the upper +window. + +@need 1250 +To replace the key binding for the default +@code{split-window-vertically}, you must also unset that key and bind +the keys to @code{split-window-quietly}, like this: + +@smallexample +@group +(global-unset-key "\C-x2") +(global-set-key "\C-x2" 'split-window-quietly) +@end group +@end smallexample + +@vindex load-path +If you load many extensions, as I do, then instead of specifying the +exact location of the extension file, as shown above, you can specify +that directory as part of Emacs' @code{load-path}. Then, when Emacs +loads a file, it will search that directory as well as its default +list of directories. (The default list is specified in @file{paths.h} +when Emacs is built.) + +@need 1250 +The following command adds your @file{~/emacs} directory to the +existing load path: + +@smallexample +@group +;;; Emacs Load Path +(setq load-path (cons "~/emacs" load-path)) +@end group +@end smallexample + +Incidentally, @code{load-library} is an interactive interface to the +@code{load} function. The complete function looks like this: + +@findex load-library +@smallexample +@group +(defun load-library (library) + "Load the library named LIBRARY. +This is an interface to the function `load'." + (interactive + (list (completing-read "Load library: " + 'locate-file-completion + (cons load-path (get-load-suffixes))))) + (load library)) +@end group +@end smallexample + +The name of the function, @code{load-library}, comes from the use of +`library' as a conventional synonym for `file'. The source for the +@code{load-library} command is in the @file{files.el} library. + +Another interactive command that does a slightly different job is +@code{load-file}. @xref{Lisp Libraries, , Libraries of Lisp Code for +Emacs, emacs, The GNU Emacs Manual}, for information on the +distinction between @code{load-library} and this command. + +@node Autoload, Simple Extension, Loading Files, Emacs Initialization +@section Autoloading +@findex autoload + +Instead of installing a function by loading the file that contains it, +or by evaluating the function definition, you can make the function +available but not actually install it until it is first called. This +is called @dfn{autoloading}. + +When you execute an autoloaded function, Emacs automatically evaluates +the file that contains the definition, and then calls the function. + +Emacs starts quicker with autoloaded functions, since their libraries +are not loaded right away; but you need to wait a moment when you +first use such a function, while its containing file is evaluated. + +Rarely used functions are frequently autoloaded. The +@file{loaddefs.el} library contains hundreds of autoloaded functions, +from @code{bookmark-set} to @code{wordstar-mode}. Of course, you may +come to use a `rare' function frequently. When you do, you should +load that function's file with a @code{load} expression in your +@file{.emacs} file. + +In my @file{.emacs} file, I load 14 libraries that contain functions +that would otherwise be autoloaded. (Actually, it would have been +better to include these files in my `dumped' Emacs, but I forgot. +@xref{Building Emacs, , Building Emacs, elisp, The GNU Emacs Lisp +Reference Manual}, and the @file{INSTALL} file for more about +dumping.) + +You may also want to include autoloaded expressions in your @file{.emacs} +file. @code{autoload} is a built-in function that takes up to five +arguments, the final three of which are optional. The first argument +is the name of the function to be autoloaded; the second is the name +of the file to be loaded. The third argument is documentation for the +function, and the fourth tells whether the function can be called +interactively. The fifth argument tells what type of +object---@code{autoload} can handle a keymap or macro as well as a +function (the default is a function). + +@need 800 +Here is a typical example: + +@smallexample +@group +(autoload 'html-helper-mode + "html-helper-mode" "Edit HTML documents" t) +@end group +@end smallexample + +@noindent +(@code{html-helper-mode} is an older alternative to @code{html-mode}, +which is a standard part of the distribution.) + +@noindent +This expression autoloads the @code{html-helper-mode} function. It +takes it from the @file{html-helper-mode.el} file (or from the byte +compiled file @file{html-helper-mode.elc}, if it exists.) The file +must be located in a directory specified by @code{load-path}. The +documentation says that this is a mode to help you edit documents +written in the HyperText Markup Language. You can call this mode +interactively by typing @kbd{M-x html-helper-mode}. (You need to +duplicate the function's regular documentation in the autoload +expression because the regular function is not yet loaded, so its +documentation is not available.) + +@xref{Autoload, , Autoload, elisp, The GNU Emacs Lisp Reference +Manual}, for more information. + +@node Simple Extension, X11 Colors, Autoload, Emacs Initialization +@section A Simple Extension: @code{line-to-top-of-window} +@findex line-to-top-of-window +@cindex Simple extension in @file{.emacs} file + +Here is a simple extension to Emacs that moves the line point is on to +the top of the window. I use this all the time, to make text easier +to read. + +You can put the following code into a separate file and then load it +from your @file{.emacs} file, or you can include it within your +@file{.emacs} file. + +@need 1250 +Here is the definition: + +@smallexample +@group +;;; Line to top of window; +;;; replace three keystroke sequence C-u 0 C-l +(defun line-to-top-of-window () + "Move the line point is on to top of window." + (interactive) + (recenter 0)) +@end group +@end smallexample + +@need 1250 +Now for the keybinding. + +Nowadays, function keys as well as mouse button events and +non-@sc{ascii} characters are written within square brackets, without +quotation marks. (In Emacs version 18 and before, you had to write +different function key bindings for each different make of terminal.) + +I bind @code{line-to-top-of-window} to my @key{F6} function key like +this: + +@smallexample +(global-set-key [f6] 'line-to-top-of-window) +@end smallexample + +For more information, see @ref{Init Rebinding, , Rebinding Keys in +Your Init File, emacs, The GNU Emacs Manual}. + +@cindex Conditional 'twixt two versions of Emacs +@cindex Version of Emacs, choosing +@cindex Emacs version, choosing +If you run two versions of GNU Emacs, such as versions 21 and 22, and +use one @file{.emacs} file, you can select which code to evaluate with +the following conditional: + +@smallexample +@group +(cond + (= 21 emacs-major-version) + ;; evaluate version 21 code + ( @dots{} )) + (= 22 emacs-major-version) + ;; evaluate version 22 code + ( @dots{} ))) +@end group +@end smallexample + +For example, in contrast to version 20, more recent versions blink +their cursors by default. I hate such blinking, as well as other +features, so I placed the following in my @file{.emacs} +file@footnote{When I start instances of Emacs that do not load my +@file{.emacs} file or any site file, I also turn off blinking: + +@smallexample +emacs -q --no-site-file -eval '(blink-cursor-mode nil)' + +@exdent Or nowadays, using an even more sophisticated set of options, + +emacs -Q - D +@end smallexample +}: + +@smallexample +@group +(when (or (= 21 emacs-major-version) + (= 22 emacs-major-version)) + (blink-cursor-mode 0) + ;; Insert newline when you press `C-n' (next-line) + ;; at the end of the buffer + (setq next-line-add-newlines t) +@end group +@group + ;; Turn on image viewing + (auto-image-file-mode t) +@end group +@group + ;; Turn on menu bar (this bar has text) + ;; (Use numeric argument to turn on) + (menu-bar-mode 1) +@end group +@group + ;; Turn off tool bar (this bar has icons) + ;; (Use numeric argument to turn on) + (tool-bar-mode nil) +@end group +@group + ;; Turn off tooltip mode for tool bar + ;; (This mode causes icon explanations to pop up) + ;; (Use numeric argument to turn on) + (tooltip-mode nil) + ;; If tooltips turned on, make tips appear promptly + (setq tooltip-delay 0.1) ; default is 0.7 second + ) +@end group +@end smallexample + +@need 1250 +Alternatively, since @code{blink-cursor-mode} has existed since Emacs +version 21 and is likely to continue, you could write + +@smallexample +@group +(when (>= emacs-major-version 21) + (blink-cursor-mode 0) +@end group +@end smallexample + +@noindent +and add other expressions, too. + + +@node X11 Colors, Miscellaneous, Simple Extension, Emacs Initialization +@section X11 Colors + +You can specify colors when you use Emacs with the MIT X Windowing +system. + +I dislike the default colors and specify my own. + +@need 1250 +Here are the expressions in my @file{.emacs} +file that set values: + +@smallexample +@group +;; Set cursor color +(set-cursor-color "white") + +;; Set mouse color +(set-mouse-color "white") + +;; Set foreground and background +(set-foreground-color "white") +(set-background-color "darkblue") +@end group + +@group +;;; Set highlighting colors for isearch and drag +(set-face-foreground 'highlight "white") +(set-face-background 'highlight "blue") +@end group + +@group +(set-face-foreground 'region "cyan") +(set-face-background 'region "blue") +@end group + +@group +(set-face-foreground 'secondary-selection "skyblue") +(set-face-background 'secondary-selection "darkblue") +@end group + +@group +;; Set calendar highlighting colors +(setq calendar-load-hook + '(lambda () + (set-face-foreground 'diary-face "skyblue") + (set-face-background 'holiday-face "slate blue") + (set-face-foreground 'holiday-face "white"))) +@end group +@end smallexample + +The various shades of blue soothe my eye and prevent me from seeing +the screen flicker. + +Alternatively, I could have set my specifications in various X +initialization files. For example, I could set the foreground, +background, cursor, and pointer (i.e., mouse) colors in my +@file{~/.Xresources} file like this: + +@smallexample +@group +Emacs*foreground: white +Emacs*background: darkblue +Emacs*cursorColor: white +Emacs*pointerColor: white +@end group +@end smallexample + +In any event, since it is not part of Emacs, I set the root color of +my X window in my @file{~/.xinitrc} file, like this@footnote{I also +run more modern window managers, such as Enlightenment, Gnome, or KDE; +in those cases, I often specify an image rather than a plain color.}: + +@smallexample +xsetroot -solid Navy -fg white & +@end smallexample + +@need 1700 +@node Miscellaneous, Mode Line, X11 Colors, Emacs Initialization +@section Miscellaneous Settings for a @file{.emacs} File + +@need 1250 +Here are a few miscellaneous settings: +@sp 1 + +@itemize @minus +@item +Set the shape and color of the mouse cursor: + +@smallexample +@group +; Cursor shapes are defined in +; `/usr/include/X11/cursorfont.h'; +; for example, the `target' cursor is number 128; +; the `top_left_arrow' cursor is number 132. +@end group + +@group +(let ((mpointer (x-get-resource "*mpointer" + "*emacs*mpointer"))) + ;; If you have not set your mouse pointer + ;; then set it, otherwise leave as is: + (if (eq mpointer nil) + (setq mpointer "132")) ; top_left_arrow +@end group +@group + (setq x-pointer-shape (string-to-int mpointer)) + (set-mouse-color "white")) +@end group +@end smallexample + +@item +Or you can set the values of a variety of features in an alist, like +this: + +@smallexample +@group +(setq-default + default-frame-alist + '((cursor-color . "white") + (mouse-color . "white") + (foreground-color . "white") + (background-color . "DodgerBlue4") + ;; (cursor-type . bar) + (cursor-type . box) +@end group +@group + (tool-bar-lines . 0) + (menu-bar-lines . 1) + (width . 80) + (height . 58) + (font . + "-Misc-Fixed-Medium-R-Normal--20-200-75-75-C-100-ISO8859-1") + )) +@end group +@end smallexample + +@item +Convert @kbd{@key{CTRL}-h} into @key{DEL} and @key{DEL} +into @kbd{@key{CTRL}-h}.@* +(Some older keyboards needed this, although I have not seen the +problem recently.) + +@smallexample +@group +;; Translate `C-h' to <DEL>. +; (keyboard-translate ?\C-h ?\C-?) + +;; Translate <DEL> to `C-h'. +(keyboard-translate ?\C-? ?\C-h) +@end group +@end smallexample + +@item Turn off a blinking cursor! + +@smallexample +@group +(if (fboundp 'blink-cursor-mode) + (blink-cursor-mode -1)) +@end group +@end smallexample + +@noindent +or start GNU Emacs with the command @code{emacs -nbc}. + +@need 1250 +@item When using `grep'@* +@samp{-i}@w{ } Ignore case distinctions@* +@samp{-n}@w{ } Prefix each line of output with line number@* +@samp{-H}@w{ } Print the filename for each match.@* +@samp{-e}@w{ } Protect patterns beginning with a hyphen character, @samp{-} + +@smallexample +(setq grep-command "grep -i -nH -e ") +@end smallexample + +@ignore +@c Evidently, no longer needed in GNU Emacs 22 + +item Automatically uncompress compressed files when visiting them + +smallexample +(load "uncompress") +end smallexample + +@end ignore + +@item Find an existing buffer, even if it has a different name@* +This avoids problems with symbolic links. + +@smallexample +(setq find-file-existing-other-name t) +@end smallexample + +@item Set your language environment and default input method + +@smallexample +@group +(set-language-environment "latin-1") +;; Remember you can enable or disable multilingual text input +;; with the @code{toggle-input-method'} (@kbd{C-\}) command +(setq default-input-method "latin-1-prefix") +@end group +@end smallexample + +If you want to write with Chinese `GB' characters, set this instead: + +@smallexample +@group +(set-language-environment "Chinese-GB") +(setq default-input-method "chinese-tonepy") +@end group +@end smallexample +@end itemize + +@subsubheading Fixing Unpleasant Key Bindings +@cindex Key bindings, fixing +@cindex Bindings, key, fixing unpleasant + +Some systems bind keys unpleasantly. Sometimes, for example, the +@key{CTRL} key appears in an awkward spot rather than at the far left +of the home row. + +Usually, when people fix these sorts of keybindings, they do not +change their @file{~/.emacs} file. Instead, they bind the proper keys +on their consoles with the @code{loadkeys} or @code{install-keymap} +commands in their boot script and then include @code{xmodmap} commands +in their @file{.xinitrc} or @file{.Xsession} file for X Windows. + +@need 1250 +@noindent +For a boot script: + +@smallexample +@group +loadkeys /usr/share/keymaps/i386/qwerty/emacs2.kmap.gz +@exdent or +install-keymap emacs2 +@end group +@end smallexample + +@need 1250 +@noindent +For a @file{.xinitrc} or @file{.Xsession} file when the @key{Caps +Lock} key is at the far left of the home row: + +@smallexample +@group +# Bind the key labeled `Caps Lock' to `Control' +# (Such a broken user interface suggests that keyboard manufacturers +# think that computers are typewriters from 1885.) + +xmodmap -e "clear Lock" +xmodmap -e "add Control = Caps_Lock" +@end group +@end smallexample + +@need 1250 +@noindent +In a @file{.xinitrc} or @file{.Xsession} file, to convert an @key{ALT} +key to a @key{META} key: + +@smallexample +@group +# Some ill designed keyboards have a key labeled ALT and no Meta +xmodmap -e "keysym Alt_L = Meta_L Alt_L" +@end group +@end smallexample + +@need 1700 +@node Mode Line, , Miscellaneous, Emacs Initialization +@section A Modified Mode Line +@vindex default-mode-line-format +@cindex Mode line format + +Finally, a feature I really like: a modified mode line. + +When I work over a network, I forget which machine I am using. Also, +I tend to I lose track of where I am, and which line point is on. + +So I reset my mode line to look like this: + +@smallexample +-:-- foo.texi rattlesnake:/home/bob/ Line 1 (Texinfo Fill) Top +@end smallexample + +I am visiting a file called @file{foo.texi}, on my machine +@file{rattlesnake} in my @file{/home/bob} buffer. I am on line 1, in +Texinfo mode, and am at the top of the buffer. + +@need 1200 +My @file{.emacs} file has a section that looks like this: + +@smallexample +@group +;; Set a Mode Line that tells me which machine, which directory, +;; and which line I am on, plus the other customary information. +(setq default-mode-line-format + (quote + (#("-" 0 1 + (help-echo + "mouse-1: select window, mouse-2: delete others ...")) + mode-line-mule-info + mode-line-modified + mode-line-frame-identification + " " +@end group +@group + mode-line-buffer-identification + " " + (:eval (substring + (system-name) 0 (string-match "\\..+" (system-name)))) + ":" + default-directory + #(" " 0 1 + (help-echo + "mouse-1: select window, mouse-2: delete others ...")) + (line-number-mode " Line %l ") + global-mode-string +@end group +@group + #(" %[(" 0 6 + (help-echo + "mouse-1: select window, mouse-2: delete others ...")) + (:eval (mode-line-mode-name)) + mode-line-process + minor-mode-alist + #("%n" 0 2 (help-echo "mouse-2: widen" local-map (keymap ...))) + ")%] " + (-3 . "%P") + ;; "-%-" + ))) +@end group +@end smallexample + +@noindent +Here, I redefine the default mode line. Most of the parts are from +the original; but I make a few changes. I set the @emph{default} mode +line format so as to permit various modes, such as Info, to override +it. + +Many elements in the list are self-explanatory: +@code{mode-line-modified} is a variable that tells whether the buffer +has been modified, @code{mode-name} tells the name of the mode, and so +on. However, the format looks complicated because of two features we +have not discussed. + +@cindex Properties, in mode line example +The first string in the mode line is a dash or hyphen, @samp{-}. In +the old days, it would have been specified simply as @code{"-"}. But +nowadays, Emacs can add properties to a string, such as highlighting +or, as in this case, a help feature. If you place your mouse cursor +over the hyphen, some help information appears (By default, you must +wait seven-tenths of a second before the information appears. You can +change that timing by changing the value of @code{tooltip-delay}.) + +@need 1000 +The new string format has a special syntax: + +@smallexample +#("-" 0 1 (help-echo "mouse-1: select window, ...")) +@end smallexample + +@noindent +The @code{#(} begins a list. The first element of the list is the +string itself, just one @samp{-}. The second and third +elements specify the range over which the fourth element applies. A +range starts @emph{after} a character, so a zero means the range +starts just before the first character; a 1 means that the range ends +just after the first character. The third element is the property for +the range. It consists of a property list, a +property name, in this case, @samp{help-echo}, followed by a value, in this +case, a string. The second, third, and fourth elements of this new +string format can be repeated. + +@xref{Text Properties, , Text Properties, elisp, The GNU Emacs Lisp +Reference Manual}, and see @ref{Mode Line Format, , Mode Line Format, +elisp, The GNU Emacs Lisp Reference Manual}, for more information. + +@code{mode-line-buffer-identification} +displays the current buffer name. It is a list +beginning @code{(#("%12b" 0 4 @dots{}}. +The @code{#(} begins the list. + +The @samp{"%12b"} displays the current buffer name, using the +@code{buffer-name} function with which we are familiar; the `12' +specifies the maximum number of characters that will be displayed. +When a name has fewer characters, whitespace is added to fill out to +this number. (Buffer names can and often should be longer than 12 +characters; this length works well in a typical 80 column wide +window.) + +@code{:eval} says to evaluate the following form and use the result as +a string to display. In this case, the expression displays the first +component of the full system name. The end of the first component is +a @samp{.} (`period'), so I use the @code{string-match} function to +tell me the length of the first component. The substring from the +zeroth character to that length is the name of the machine. + +@need 1250 +This is the expression: + +@smallexample +@group +(:eval (substring + (system-name) 0 (string-match "\\..+" (system-name)))) +@end group +@end smallexample + +@samp{%[} and @samp{%]} cause a pair of square brackets +to appear for each recursive editing level. @samp{%n} says `Narrow' +when narrowing is in effect. @samp{%P} tells you the percentage of +the buffer that is above the bottom of the window, or `Top', `Bottom', +or `All'. (A lower case @samp{p} tell you the percentage above the +@emph{top} of the window.) @samp{%-} inserts enough dashes to fill +out the line. + +Remember, ``You don't have to like Emacs to like it'' --- your own +Emacs can have different colors, different commands, and different +keys than a default Emacs. + +On the other hand, if you want to bring up a plain `out of the box' +Emacs, with no customization, type: + +@smallexample +emacs -q +@end smallexample + +@noindent +This will start an Emacs that does @emph{not} load your +@file{~/.emacs} initialization file. A plain, default Emacs. Nothing +more. + +@node Debugging, Conclusion, Emacs Initialization, Top +@chapter Debugging +@cindex debugging + +GNU Emacs has two debuggers, @code{debug} and @code{edebug}. The +first is built into the internals of Emacs and is always with you; +the second requires that you instrument a function before you can use it. + +Both debuggers are described extensively in @ref{Debugging, , +Debugging Lisp Programs, elisp, The GNU Emacs Lisp Reference Manual}. +In this chapter, I will walk through a short example of each. + +@menu +* debug:: How to use the built-in debugger. +* debug-on-entry:: Start debugging when you call a function. +* debug-on-quit:: Start debugging when you quit with @kbd{C-g}. +* edebug:: How to use Edebug, a source level debugger. +* Debugging Exercises:: +@end menu + +@node debug, debug-on-entry, Debugging, Debugging +@section @code{debug} +@findex debug + +Suppose you have written a function definition that is intended to +return the sum of the numbers 1 through a given number. (This is the +@code{triangle} function discussed earlier. @xref{Decrementing +Example, , Example with Decrementing Counter}, for a discussion.) +@c xref{Decrementing Loop,, Loop with a Decrementing Counter}, for a discussion.) + +However, your function definition has a bug. You have mistyped +@samp{1=} for @samp{1-}. Here is the broken definition: + +@findex triangle-bugged +@smallexample +@group +(defun triangle-bugged (number) + "Return sum of numbers 1 through NUMBER inclusive." + (let ((total 0)) + (while (> number 0) + (setq total (+ total number)) + (setq number (1= number))) ; @r{Error here.} + total)) +@end group +@end smallexample + +If you are reading this in Info, you can evaluate this definition in +the normal fashion. You will see @code{triangle-bugged} appear in the +echo area. + +@need 1250 +Now evaluate the @code{triangle-bugged} function with an +argument of 4: + +@smallexample +(triangle-bugged 4) +@end smallexample + +@noindent +In a recent GNU Emacs, you will create and enter a @file{*Backtrace*} +buffer that says: + +@noindent +@smallexample +@group +---------- Buffer: *Backtrace* ---------- +Debugger entered--Lisp error: (void-function 1=) + (1= number) + (setq number (1= number)) + (while (> number 0) (setq total (+ total number)) + (setq number (1= number))) + (let ((total 0)) (while (> number 0) (setq total ...) + (setq number ...)) total) + triangle-bugged(4) +@end group +@group + eval((triangle-bugged 4)) + eval-last-sexp-1(nil) + eval-last-sexp(nil) + call-interactively(eval-last-sexp) +---------- Buffer: *Backtrace* ---------- +@end group +@end smallexample + +@noindent +(I have reformatted this example slightly; the debugger does not fold +long lines. As usual, you can quit the debugger by typing @kbd{q} in +the @file{*Backtrace*} buffer.) + +In practice, for a bug as simple as this, the `Lisp error' line will +tell you what you need to know to correct the definition. The +function @code{1=} is `void'. + +@ignore +@need 800 +In GNU Emacs 20 and before, you will see: + +@smallexample +Symbol's function definition is void:@: 1= +@end smallexample + +@noindent +which has the same meaning as the @file{*Backtrace*} buffer line in +version 21. +@end ignore + +However, suppose you are not quite certain what is going on? +You can read the complete backtrace. + +In this case, you need to run a recent GNU Emacs, which automatically +starts the debugger that puts you in the @file{*Backtrace*} buffer; or +else, you need to start the debugger manually as described below. + +Read the @file{*Backtrace*} buffer from the bottom up; it tells you +what Emacs did that led to the error. Emacs made an interactive call +to @kbd{C-x C-e} (@code{eval-last-sexp}), which led to the evaluation +of the @code{triangle-bugged} expression. Each line above tells you +what the Lisp interpreter evaluated next. + +@need 1250 +The third line from the top of the buffer is + +@smallexample +(setq number (1= number)) +@end smallexample + +@noindent +Emacs tried to evaluate this expression; in order to do so, it tried +to evaluate the inner expression shown on the second line from the +top: + +@smallexample +(1= number) +@end smallexample + +@need 1250 +@noindent +This is where the error occurred; as the top line says: + +@smallexample +Debugger entered--Lisp error: (void-function 1=) +@end smallexample + +@noindent +You can correct the mistake, re-evaluate the function definition, and +then run your test again. + +@node debug-on-entry, debug-on-quit, debug, Debugging +@section @code{debug-on-entry} +@findex debug-on-entry + +A recent GNU Emacs starts the debugger automatically when your +function has an error. + +@ignore +GNU Emacs version 20 and before did not; it simply +presented you with an error message. You had to start the debugger +manually. +@end ignore + +Incidentally, you can start the debugger manually for all versions of +Emacs; the advantage is that the debugger runs even if you do not have +a bug in your code. Sometimes your code will be free of bugs! + +You can enter the debugger when you call the function by calling +@code{debug-on-entry}. + +@need 1250 +@noindent +Type: + +@smallexample +M-x debug-on-entry RET triangle-bugged RET +@end smallexample + +@need 1250 +@noindent +Now, evaluate the following: + +@smallexample +(triangle-bugged 5) +@end smallexample + +@noindent +All versions of Emacs will create a @file{*Backtrace*} buffer and tell +you that it is beginning to evaluate the @code{triangle-bugged} +function: + +@smallexample +@group +---------- Buffer: *Backtrace* ---------- +Debugger entered--entering a function: +* triangle-bugged(5) + eval((triangle-bugged 5)) +@end group +@group + eval-last-sexp-1(nil) + eval-last-sexp(nil) + call-interactively(eval-last-sexp) +---------- Buffer: *Backtrace* ---------- +@end group +@end smallexample + +In the @file{*Backtrace*} buffer, type @kbd{d}. Emacs will evaluate +the first expression in @code{triangle-bugged}; the buffer will look +like this: + +@smallexample +@group +---------- Buffer: *Backtrace* ---------- +Debugger entered--beginning evaluation of function call form: +* (let ((total 0)) (while (> number 0) (setq total ...) + (setq number ...)) total) +* triangle-bugged(5) + eval((triangle-bugged 5)) +@end group +@group + eval-last-sexp-1(nil) + eval-last-sexp(nil) + call-interactively(eval-last-sexp) +---------- Buffer: *Backtrace* ---------- +@end group +@end smallexample + +@noindent +Now, type @kbd{d} again, eight times, slowly. Each time you type +@kbd{d}, Emacs will evaluate another expression in the function +definition. + +@need 1750 +Eventually, the buffer will look like this: + +@smallexample +@group +---------- Buffer: *Backtrace* ---------- +Debugger entered--beginning evaluation of function call form: +* (setq number (1= number)) +* (while (> number 0) (setq total (+ total number)) + (setq number (1= number))) +@group +@end group +* (let ((total 0)) (while (> number 0) (setq total ...) + (setq number ...)) total) +* triangle-bugged(5) + eval((triangle-bugged 5)) +@group +@end group + eval-last-sexp-1(nil) + eval-last-sexp(nil) + call-interactively(eval-last-sexp) +---------- Buffer: *Backtrace* ---------- +@end group +@end smallexample + +@need 1500 +@noindent +Finally, after you type @kbd{d} two more times, Emacs will reach the +error, and the top two lines of the @file{*Backtrace*} buffer will look +like this: + +@smallexample +@group +---------- Buffer: *Backtrace* ---------- +Debugger entered--Lisp error: (void-function 1=) +* (1= number) +@dots{} +---------- Buffer: *Backtrace* ---------- +@end group +@end smallexample + +By typing @kbd{d}, you were able to step through the function. + +You can quit a @file{*Backtrace*} buffer by typing @kbd{q} in it; this +quits the trace, but does not cancel @code{debug-on-entry}. + +@findex cancel-debug-on-entry +To cancel the effect of @code{debug-on-entry}, call +@code{cancel-debug-on-entry} and the name of the function, like this: + +@smallexample +M-x cancel-debug-on-entry RET triangle-bugged RET +@end smallexample + +@noindent +(If you are reading this in Info, cancel @code{debug-on-entry} now.) + +@node debug-on-quit, edebug, debug-on-entry, Debugging +@section @code{debug-on-quit} and @code{(debug)} + +In addition to setting @code{debug-on-error} or calling @code{debug-on-entry}, +there are two other ways to start @code{debug}. + +@findex debug-on-quit +You can start @code{debug} whenever you type @kbd{C-g} +(@code{keyboard-quit}) by setting the variable @code{debug-on-quit} to +@code{t}. This is useful for debugging infinite loops. + +@need 1500 +@cindex @code{(debug)} in code +Or, you can insert a line that says @code{(debug)} into your code +where you want the debugger to start, like this: + +@smallexample +@group +(defun triangle-bugged (number) + "Return sum of numbers 1 through NUMBER inclusive." + (let ((total 0)) + (while (> number 0) + (setq total (+ total number)) + (debug) ; @r{Start debugger.} + (setq number (1= number))) ; @r{Error here.} + total)) +@end group +@end smallexample + +The @code{debug} function is described in detail in @ref{Debugger, , +The Lisp Debugger, elisp, The GNU Emacs Lisp Reference Manual}. + +@node edebug, Debugging Exercises, debug-on-quit, Debugging +@section The @code{edebug} Source Level Debugger +@cindex Source level debugger +@findex edebug + +Edebug is a source level debugger. Edebug normally displays the +source of the code you are debugging, with an arrow at the left that +shows which line you are currently executing. + +You can walk through the execution of a function, line by line, or run +quickly until reaching a @dfn{breakpoint} where execution stops. + +Edebug is described in @ref{edebug, , Edebug, elisp, The GNU Emacs +Lisp Reference Manual}. + +@need 1250 +Here is a bugged function definition for @code{triangle-recursively}. +@xref{Recursive triangle function, , Recursion in place of a counter}, +for a review of it. + +@smallexample +@group +(defun triangle-recursively-bugged (number) + "Return sum of numbers 1 through NUMBER inclusive. +Uses recursion." + (if (= number 1) + 1 + (+ number + (triangle-recursively-bugged + (1= number))))) ; @r{Error here.} +@end group +@end smallexample + +@noindent +Normally, you would install this definition by positioning your cursor +after the function's closing parenthesis and typing @kbd{C-x C-e} +(@code{eval-last-sexp}) or else by positioning your cursor within the +definition and typing @kbd{C-M-x} (@code{eval-defun}). (By default, +the @code{eval-defun} command works only in Emacs Lisp mode or in Lisp +Interactive mode.) + +@need 1500 +However, to prepare this function definition for Edebug, you must +first @dfn{instrument} the code using a different command. You can do +this by positioning your cursor within or just after the definition +and typing + +@smallexample +M-x edebug-defun RET +@end smallexample + +@noindent +This will cause Emacs to load Edebug automatically if it is not +already loaded, and properly instrument the function. + +After instrumenting the function, place your cursor after the +following expression and type @kbd{C-x C-e} (@code{eval-last-sexp}): + +@smallexample +(triangle-recursively-bugged 3) +@end smallexample + +@noindent +You will be jumped back to the source for +@code{triangle-recursively-bugged} and the cursor positioned at the +beginning of the @code{if} line of the function. Also, you will see +an arrowhead at the left hand side of that line. The arrowhead marks +the line where the function is executing. (In the following examples, +we show the arrowhead with @samp{=>}; in a windowing system, you may +see the arrowhead as a solid triangle in the window `fringe'.) + +@smallexample +=>@point{}(if (= number 1) +@end smallexample + +@noindent +@iftex +In the example, the location of point is displayed with a star, +@samp{@point{}} (in Info, it is displayed as @samp{-!-}). +@end iftex +@ifnottex +In the example, the location of point is displayed as @samp{@point{}} +(in a printed book, it is displayed with a five pointed star). +@end ifnottex + +If you now press @key{SPC}, point will move to the next expression to +be executed; the line will look like this: + +@smallexample +=>(if @point{}(= number 1) +@end smallexample + +@noindent +As you continue to press @key{SPC}, point will move from expression to +expression. At the same time, whenever an expression returns a value, +that value will be displayed in the echo area. For example, after you +move point past @code{number}, you will see the following: + +@smallexample +Result: 3 (#o3, #x3, ?\C-c) +@end smallexample + +@noindent +This means the value of @code{number} is 3, which is octal three, +hexadecimal three, and @sc{ascii} `control-c' (the third letter of the +alphabet, in case you need to know this information). + +You can continue moving through the code until you reach the line with +the error. Before evaluation, that line looks like this: + +@smallexample +=> @point{}(1= number))))) ; @r{Error here.} +@end smallexample + +@need 1250 +@noindent +When you press @key{SPC} once again, you will produce an error message +that says: + +@smallexample +Symbol's function definition is void:@: 1= +@end smallexample + +@noindent +This is the bug. + +Press @kbd{q} to quit Edebug. + +To remove instrumentation from a function definition, simply +re-evaluate it with a command that does not instrument it. +For example, you could place your cursor after the definition's +closing parenthesis and type @kbd{C-x C-e}. + +Edebug does a great deal more than walk with you through a function. +You can set it so it races through on its own, stopping only at an +error or at specified stopping points; you can cause it to display the +changing values of various expressions; you can find out how many +times a function is called, and more. + +Edebug is described in @ref{edebug, , Edebug, elisp, The GNU Emacs +Lisp Reference Manual}. + +@need 1500 +@node Debugging Exercises, , edebug, Debugging +@section Debugging Exercises + +@itemize @bullet +@item +Install the @code{count-words-region} function and then cause it to +enter the built-in debugger when you call it. Run the command on a +region containing two words. You will need to press @kbd{d} a +remarkable number of times. On your system, is a `hook' called after +the command finishes? (For information on hooks, see @ref{Command +Overview, , Command Loop Overview, elisp, The GNU Emacs Lisp Reference +Manual}.) + +@item +Copy @code{count-words-region} into the @file{*scratch*} buffer, +instrument the function for Edebug, and walk through its execution. +The function does not need to have a bug, although you can introduce +one if you wish. If the function lacks a bug, the walk-through +completes without problems. + +@item +While running Edebug, type @kbd{?} to see a list of all the Edebug commands. +(The @code{global-edebug-prefix} is usually @kbd{C-x X}, i.e.@: +@kbd{@key{CTRL}-x} followed by an upper case @kbd{X}; use this prefix +for commands made outside of the Edebug debugging buffer.) + +@item +In the Edebug debugging buffer, use the @kbd{p} +(@code{edebug-bounce-point}) command to see where in the region the +@code{count-words-region} is working. + +@item +Move point to some spot further down the function and then type the +@kbd{h} (@code{edebug-goto-here}) command to jump to that location. + +@item +Use the @kbd{t} (@code{edebug-trace-mode}) command to cause Edebug to +walk through the function on its own; use an upper case @kbd{T} for +@code{edebug-Trace-fast-mode}. + +@item +Set a breakpoint, then run Edebug in Trace mode until it reaches the +stopping point. +@end itemize + +@node Conclusion, the-the, Debugging, Top +@chapter Conclusion + +We have now reached the end of this Introduction. You have now +learned enough about programming in Emacs Lisp to set values, to write +simple @file{.emacs} files for yourself and your friends, and write +simple customizations and extensions to Emacs. + +This is a place to stop. Or, if you wish, you can now go onward, and +teach yourself. + +You have learned some of the basic nuts and bolts of programming. But +only some. There are a great many more brackets and hinges that are +easy to use that we have not touched. + +A path you can follow right now lies among the sources to GNU Emacs +and in +@ifnotinfo +@cite{The GNU Emacs Lisp Reference Manual}. +@end ifnotinfo +@ifinfo +@ref{Top, , The GNU Emacs Lisp Reference Manual, elisp, The GNU +Emacs Lisp Reference Manual}. +@end ifinfo + +The Emacs Lisp sources are an adventure. When you read the sources and +come across a function or expression that is unfamiliar, you need to +figure out or find out what it does. + +Go to the Reference Manual. It is a thorough, complete, and fairly +easy-to-read description of Emacs Lisp. It is written not only for +experts, but for people who know what you know. (The @cite{Reference +Manual} comes with the standard GNU Emacs distribution. Like this +introduction, it comes as a Texinfo source file, so you can read it +on-line and as a typeset, printed book.) + +Go to the other on-line help that is part of GNU Emacs: the on-line +documentation for all functions and variables, and @code{find-tags}, +the program that takes you to sources. + +Here is an example of how I explore the sources. Because of its name, +@file{simple.el} is the file I looked at first, a long time ago. As +it happens some of the functions in @file{simple.el} are complicated, +or at least look complicated at first sight. The @code{open-line} +function, for example, looks complicated. + +You may want to walk through this function slowly, as we did with the +@code{forward-sentence} function. (@xref{forward-sentence, The +@code{forward-sentence} function}.) Or you may want to skip that +function and look at another, such as @code{split-line}. You don't +need to read all the functions. According to +@code{count-words-in-defun}, the @code{split-line} function contains +102 words and symbols. + +Even though it is short, @code{split-line} contains expressions +we have not studied: @code{skip-chars-forward}, @code{indent-to}, +@code{current-column} and @code{insert-and-inherit}. + +Consider the @code{skip-chars-forward} function. (It is part of the +function definition for @code{back-to-indentation}, which is shown in +@ref{Review, , Review}.) + +In GNU Emacs, you can find out more about @code{skip-chars-forward} by +typing @kbd{C-h f} (@code{describe-function}) and the name of the +function. This gives you the function documentation. + +You may be able to guess what is done by a well named function such as +@code{indent-to}; or you can look it up, too. Incidentally, the +@code{describe-function} function itself is in @file{help.el}; it is +one of those long, but decipherable functions. You can look up +@code{describe-function} using the @kbd{C-h f} command! + +In this instance, since the code is Lisp, the @file{*Help*} buffer +contains the name of the library containing the function's source. +You can put point over the name of the library and press the RET key, +which in this situation is bound to @code{help-follow}, and be taken +directly to the source, in the same way as @kbd{M-.} +(@code{find-tag}). + +The definition for @code{describe-function} illustrates how to +customize the @code{interactive} expression without using the standard +character codes; and it shows how to create a temporary buffer. + +(The @code{indent-to} function is written in C rather than Emacs Lisp; +it is a `built-in' function. @code{help-follow} takes you to its +source as does @code{find-tag}, when properly set up.) + +You can look at a function's source using @code{find-tag}, which is +bound to @kbd{M-.} Finally, you can find out what the Reference +Manual has to say by visiting the manual in Info, and typing @kbd{i} +(@code{Info-index}) and the name of the function, or by looking up the +function in the index to a printed copy of the manual. + +Similarly, you can find out what is meant by +@code{insert-and-inherit}. + +Other interesting source files include @file{paragraphs.el}, +@file{loaddefs.el}, and @file{loadup.el}. The @file{paragraphs.el} +file includes short, easily understood functions as well as longer +ones. The @file{loaddefs.el} file contains the many standard +autoloads and many keymaps. I have never looked at it all; only at +parts. @file{loadup.el} is the file that loads the standard parts of +Emacs; it tells you a great deal about how Emacs is built. +(@xref{Building Emacs, , Building Emacs, elisp, The GNU Emacs Lisp +Reference Manual}, for more about building.) + +As I said, you have learned some nuts and bolts; however, and very +importantly, we have hardly touched major aspects of programming; I +have said nothing about how to sort information, except to use the +predefined @code{sort} function; I have said nothing about how to store +information, except to use variables and lists; I have said nothing +about how to write programs that write programs. These are topics for +another, and different kind of book, a different kind of learning. + +What you have done is learn enough for much practical work with GNU +Emacs. What you have done is get started. This is the end of a +beginning. + +@c ================ Appendix ================ + +@node the-the, Kill Ring, Conclusion, Top +@appendix The @code{the-the} Function +@findex the-the +@cindex Duplicated words function +@cindex Words, duplicated + +Sometimes when you you write text, you duplicate words---as with ``you +you'' near the beginning of this sentence. I find that most +frequently, I duplicate ``the''; hence, I call the function for +detecting duplicated words, @code{the-the}. + +@need 1250 +As a first step, you could use the following regular expression to +search for duplicates: + +@smallexample +\\(\\w+[ \t\n]+\\)\\1 +@end smallexample + +@noindent +This regexp matches one or more word-constituent characters followed +by one or more spaces, tabs, or newlines. However, it does not detect +duplicated words on different lines, since the ending of the first +word, the end of the line, is different from the ending of the second +word, a space. (For more information about regular expressions, see +@ref{Regexp Search, , Regular Expression Searches}, as well as +@ref{Regexps, , Syntax of Regular Expressions, emacs, The GNU Emacs +Manual}, and @ref{Regular Expressions, , Regular Expressions, elisp, +The GNU Emacs Lisp Reference Manual}.) + +You might try searching just for duplicated word-constituent +characters but that does not work since the pattern detects doubles +such as the two occurrences of `th' in `with the'. + +Another possible regexp searches for word-constituent characters +followed by non-word-constituent characters, reduplicated. Here, +@w{@samp{\\w+}} matches one or more word-constituent characters and +@w{@samp{\\W*}} matches zero or more non-word-constituent characters. + +@smallexample +\\(\\(\\w+\\)\\W*\\)\\1 +@end smallexample + +@noindent +Again, not useful. + +Here is the pattern that I use. It is not perfect, but good enough. +@w{@samp{\\b}} matches the empty string, provided it is at the beginning +or end of a word; @w{@samp{[^@@ \n\t]+}} matches one or more occurrences of +any characters that are @emph{not} an @@-sign, space, newline, or tab. + +@smallexample +\\b\\([^@@ \n\t]+\\)[ \n\t]+\\1\\b +@end smallexample + +One can write more complicated expressions, but I found that this +expression is good enough, so I use it. + +Here is the @code{the-the} function, as I include it in my +@file{.emacs} file, along with a handy global key binding: + +@smallexample +@group +(defun the-the () + "Search forward for for a duplicated word." + (interactive) + (message "Searching for for duplicated words ...") + (push-mark) +@end group +@group + ;; This regexp is not perfect + ;; but is fairly good over all: + (if (re-search-forward + "\\b\\([^@@ \n\t]+\\)[ \n\t]+\\1\\b" nil 'move) + (message "Found duplicated word.") + (message "End of buffer"))) +@end group + +@group +;; Bind `the-the' to C-c \ +(global-set-key "\C-c\\" 'the-the) +@end group +@end smallexample + +@sp 1 +Here is test text: + +@smallexample +@group +one two two three four five +five six seven +@end group +@end smallexample + +You can substitute the other regular expressions shown above in the +function definition and try each of them on this list. + +@node Kill Ring, Full Graph, the-the, Top +@appendix Handling the Kill Ring +@cindex Kill ring handling +@cindex Handling the kill ring +@cindex Ring, making a list like a + +The kill ring is a list that is transformed into a ring by the +workings of the @code{current-kill} function. The @code{yank} and +@code{yank-pop} commands use the @code{current-kill} function. + +This appendix describes the @code{current-kill} function as well as +both the @code{yank} and the @code{yank-pop} commands, but first, +consider the workings of the kill ring. + +@menu +* What the Kill Ring Does:: +* current-kill:: +* yank:: Paste a copy of a clipped element. +* yank-pop:: Insert element pointed to. +* ring file:: +@end menu + +@node What the Kill Ring Does, current-kill, Kill Ring, Kill Ring +@ifnottex +@unnumberedsec What the Kill Ring Does +@end ifnottex + +@need 1250 +The kill ring has a default maximum length of sixty items; this number +is too large for an explanation. Instead, set it to four. Please +evaluate the following: + +@smallexample +@group +(setq old-kill-ring-max kill-ring-max) +(setq kill-ring-max 4) +@end group +@end smallexample + +@noindent +Then, please copy each line of the following indented example into the +kill ring. You may kill each line with @kbd{C-k} or mark it and copy +it with @kbd{M-w}. + +@noindent +(In a read-only buffer, such as the @file{*info*} buffer, the kill +command, @kbd{C-k} (@code{kill-line}), will not remove the text, +merely copy it to the kill ring. However, your machine may beep at +you. Alternatively, for silence, you may copy the region of each line +with the @kbd{M-w} (@code{kill-ring-save}) command. You must mark +each line for this command to succeed, but it does not matter at which +end you put point or mark.) + +@need 1250 +@noindent +Please invoke the calls in order, so that five elements attempt to +fill the kill ring: + +@smallexample +@group +first some text +second piece of text +third line +fourth line of text +fifth bit of text +@end group +@end smallexample + +@need 1250 +@noindent +Then find the value of @code{kill-ring} by evaluating + +@smallexample +kill-ring +@end smallexample + +@need 800 +@noindent +It is: + +@smallexample +@group +("fifth bit of text" "fourth line of text" +"third line" "second piece of text") +@end group +@end smallexample + +@noindent +The first element, @samp{first some text}, was dropped. + +@need 1250 +To return to the old value for the length of the kill ring, evaluate: + +@smallexample +(setq kill-ring-max old-kill-ring-max) +@end smallexample + +@node current-kill, yank, What the Kill Ring Does, Kill Ring +@comment node-name, next, previous, up +@appendixsec The @code{current-kill} Function +@findex current-kill + +The @code{current-kill} function changes the element in the kill ring +to which @code{kill-ring-yank-pointer} points. (Also, the +@code{kill-new} function sets @code{kill-ring-yank-pointer} to point +to the latest element of the the kill ring. The @code{kill-new} +function is used directly or indirectly by @code{kill-append}, +@code{copy-region-as-kill}, @code{kill-ring-save}, @code{kill-line}, +and @code{kill-region}.) + +@menu +* Code for current-kill:: +* Understanding current-kill:: +@end menu + +@node Code for current-kill, Understanding current-kill, current-kill, current-kill +@ifnottex +@unnumberedsubsec The code for @code{current-kill} +@end ifnottex + + +@need 1500 +The @code{current-kill} function is used by @code{yank} and by +@code{yank-pop}. Here is the code for @code{current-kill}: + +@smallexample +@group +(defun current-kill (n &optional do-not-move) + "Rotate the yanking point by N places, and then return that kill. +If N is zero, `interprogram-paste-function' is set, and calling it +returns a string, then that string is added to the front of the +kill ring and returned as the latest kill. +@end group +@group +If optional arg DO-NOT-MOVE is non-nil, then don't actually move the +yanking point; just return the Nth kill forward." + (let ((interprogram-paste (and (= n 0) + interprogram-paste-function + (funcall interprogram-paste-function)))) +@end group +@group + (if interprogram-paste + (progn + ;; Disable the interprogram cut function when we add the new + ;; text to the kill ring, so Emacs doesn't try to own the + ;; selection, with identical text. + (let ((interprogram-cut-function nil)) + (kill-new interprogram-paste)) + interprogram-paste) +@end group +@group + (or kill-ring (error "Kill ring is empty")) + (let ((ARGth-kill-element + (nthcdr (mod (- n (length kill-ring-yank-pointer)) + (length kill-ring)) + kill-ring))) + (or do-not-move + (setq kill-ring-yank-pointer ARGth-kill-element)) + (car ARGth-kill-element))))) +@end group +@end smallexample + +Remember also that the @code{kill-new} function sets +@code{kill-ring-yank-pointer} to the latest element of the the kill +ring, which means that all the functions that call it set the value +indirectly: @code{kill-append}, @code{copy-region-as-kill}, +@code{kill-ring-save}, @code{kill-line}, and @code{kill-region}. + +@need 1500 +Here is the line in @code{kill-new}, which is explained in +@ref{kill-new function, , The @code{kill-new} function}. + +@smallexample +(setq kill-ring-yank-pointer kill-ring) +@end smallexample + +@node Understanding current-kill, , Code for current-kill, current-kill +@ifnottex +@unnumberedsubsec @code{current-kill} in Outline +@end ifnottex + +The @code{current-kill} function looks complex, but as usual, it can +be understood by taking it apart piece by piece. First look at it in +skeletal form: + +@smallexample +@group +(defun current-kill (n &optional do-not-move) + "Rotate the yanking point by N places, and then return that kill." + (let @var{varlist} + @var{body}@dots{}) +@end group +@end smallexample + +This function takes two arguments, one of which is optional. It has a +documentation string. It is @emph{not} interactive. + +@menu +* Body of current-kill:: +* Digression concerning error:: How to mislead humans, but not computers. +* Determining the Element:: +@end menu + +@node Body of current-kill, Digression concerning error, Understanding current-kill, Understanding current-kill +@ifnottex +@unnumberedsubsubsec The Body of @code{current-kill} +@end ifnottex + +The body of the function definition is a @code{let} expression, which +itself has a body as well as a @var{varlist}. + +The @code{let} expression declares a variable that will be only usable +within the bounds of this function. This variable is called +@code{interprogram-paste} and is for copying to another program. It +is not for copying within this instance of GNU Emacs. Most window +systems provide a facility for interprogram pasting. Sadly, that +facility usually provides only for the last element. Most windowing +systems have not adopted a ring of many possibilities, even though +Emacs has provided it for decades. + +The @code{if} expression has two parts, one if there exists +@code{interprogram-paste} and one if not. + +@need 2000 +Let us consider the `if not' or else-part of the @code{current-kill} +function. (The then-part uses the the @code{kill-new} function, which +we have already described. @xref{kill-new function, , The +@code{kill-new} function}.) + +@smallexample +@group +(or kill-ring (error "Kill ring is empty")) +(let ((ARGth-kill-element + (nthcdr (mod (- n (length kill-ring-yank-pointer)) + (length kill-ring)) + kill-ring))) + (or do-not-move + (setq kill-ring-yank-pointer ARGth-kill-element)) + (car ARGth-kill-element)) +@end group +@end smallexample + +@noindent +The code first checks whether the kill ring has content; otherwise it +signals an error. + +@need 1000 +Note that the @code{or} expression is very similar to testing length +with an @code{if}: + +@findex zerop +@findex error +@smallexample +@group +(if (zerop (length kill-ring)) ; @r{if-part} + (error "Kill ring is empty")) ; @r{then-part} + ;; No else-part +@end group +@end smallexample + +@noindent +If there is not anything in the kill ring, its length must be zero and +an error message sent to the user: @samp{Kill ring is empty}. The +@code{current-kill} function uses an @code{or} expression which is +simpler. But an @code{if} expression reminds us what goes on. + +This @code{if} expression uses the function @code{zerop} which returns +true if the value it is testing is zero. When @code{zerop} tests +true, the then-part of the @code{if} is evaluated. The then-part is a +list starting with the function @code{error}, which is a function that +is similar to the @code{message} function +(@pxref{message, , The @code{message} Function}) in that +it prints a one-line message in the echo area. However, in addition +to printing a message, @code{error} also stops evaluation of the +function within which it is embedded. This means that the rest of the +function will not be evaluated if the length of the kill ring is zero. + +Then the @code{current-kill} function selects the element to return. +The selection depends on the number of places that @code{current-kill} +rotates and on where @code{kill-ring-yank-pointer} points. + +Next, either the optional @code{do-not-move} argument is true or the +current value of @code{kill-ring-yank-pointer} is set to point to the +list. Finally, another expression returns the first element of the +list even if the @code{do-not-move} argument is true. + +@node Digression concerning error, Determining the Element, Body of current-kill, Understanding current-kill +@ifnottex +@unnumberedsubsubsec Digression about the word `error' +@end ifnottex + +In my opinion, it is slightly misleading, at least to humans, to use +the term `error' as the name of the @code{error} function. A better +term would be `cancel'. Strictly speaking, of course, you cannot +point to, much less rotate a pointer to a list that has no length, so +from the point of view of the computer, the word `error' is correct. +But a human expects to attempt this sort of thing, if only to find out +whether the kill ring is full or empty. This is an act of +exploration. + +From the human point of view, the act of exploration and discovery is +not necessarily an error, and therefore should not be labelled as one, +even in the bowels of a computer. As it is, the code in Emacs implies +that a human who is acting virtuously, by exploring his or her +environment, is making an error. This is bad. Even though the computer +takes the same steps as it does when there is an `error', a term such as +`cancel' would have a clearer connotation. + +@node Determining the Element, , Digression concerning error, Understanding current-kill +@ifnottex +@unnumberedsubsubsec Determining the Element +@end ifnottex + +Among other actions, the else-part of the @code{if} expression sets +the value of @code{kill-ring-yank-pointer} to +@code{ARGth-kill-element} when the kill ring has something in it and +the value of @code{do-not-move} is @code{nil}. + +@need 800 +The code looks like this: + +@smallexample +@group +(nthcdr (mod (- n (length kill-ring-yank-pointer)) + (length kill-ring)) + kill-ring))) +@end group +@end smallexample + +This needs some examination. Unless it is not supposed to move the +pointer, the @code{current-kill} function changes where +@code{kill-ring-yank-pointer} points. +That is what the +@w{@code{(setq kill-ring-yank-pointer ARGth-kill-element))}} +expression does. Also, clearly, @code{ARGth-kill-element} is being +set to be equal to some @sc{cdr} of the kill ring, using the +@code{nthcdr} function that is described in an earlier section. +(@xref{copy-region-as-kill}.) How does it do this? + +As we have seen before (@pxref{nthcdr}), the @code{nthcdr} function +works by repeatedly taking the @sc{cdr} of a list---it takes the +@sc{cdr} of the @sc{cdr} of the @sc{cdr} @dots{} + +@need 800 +The two following expressions produce the same result: + +@smallexample +@group +(setq kill-ring-yank-pointer (cdr kill-ring)) + +(setq kill-ring-yank-pointer (nthcdr 1 kill-ring)) +@end group +@end smallexample + +However, the @code{nthcdr} expression is more complicated. It uses +the @code{mod} function to determine which @sc{cdr} to select. + +(You will remember to look at inner functions first; indeed, we will +have to go inside the @code{mod}.) + +The @code{mod} function returns the value of its first argument modulo +the second; that is to say, it returns the remainder after dividing +the first argument by the second. The value returned has the same +sign as the second argument. + +@need 800 +Thus, + +@smallexample +@group +(mod 12 4) + @result{} 0 ;; @r{because there is no remainder} +(mod 13 4) + @result{} 1 +@end group +@end smallexample + +@need 1250 +In this case, the first argument is often smaller than the second. +That is fine. + +@smallexample +@group +(mod 0 4) + @result{} 0 +(mod 1 4) + @result{} 1 +@end group +@end smallexample + +We can guess what the @code{-} function does. It is like @code{+} but +subtracts instead of adds; the @code{-} function subtracts its second +argument from its first. Also, we already know what the @code{length} +function does (@pxref{length}). It returns the length of a list. + +And @code{n} is the name of the required argument to the +@code{current-kill} function. + +@need 1250 +So when the first argument to @code{nthcdr} is zero, the @code{nthcdr} +expression returns the whole list, as you can see by evaluating the +following: + +@smallexample +@group +;; kill-ring-yank-pointer @r{and} kill-ring @r{have a length of four} +;; @r{and} (mod (- 0 4) 4) @result{} 0 +(nthcdr (mod (- 0 4) 4) + '("fourth line of text" + "third line" + "second piece of text" + "first some text")) +@end group +@end smallexample + +@need 1250 +When the first argument to the @code{current-kill} function is one, +the @code{nthcdr} expression returns the list without its first +element. + +@smallexample +@group +(nthcdr (mod (- 1 4) 4) + '("fourth line of text" + "third line" + "second piece of text" + "first some text")) +@end group +@end smallexample + +@cindex @samp{global variable} defined +@cindex @samp{variable, global}, defined +Incidentally, both @code{kill-ring} and @code{kill-ring-yank-pointer} +are @dfn{global variables}. That means that any expression in Emacs +Lisp can access them. They are not like the local variables set by +@code{let} or like the symbols in an argument list. +Local variables can only be accessed +within the @code{let} that defines them or the function that specifies +them in an argument list (and within expressions called by them). + +@ignore +@c texi2dvi fails when the name of the section is within ifnottex ... +(@xref{Prevent confusion, , @code{let} Prevents Confusion}, and +@ref{defun, , The @code{defun} Special Form}.) +@end ignore + +@node yank, yank-pop, current-kill, Kill Ring +@comment node-name, next, previous, up +@appendixsec @code{yank} +@findex yank + +After learning about @code{current-kill}, the code for the +@code{yank} function is almost easy. + +The @code{yank} function does not use the +@code{kill-ring-yank-pointer} variable directly. It calls +@code{insert-for-yank} which calls @code{current-kill} which sets the +@code{kill-ring-yank-pointer} variable. + +@need 1250 +The code looks like this: + +@c in GNU Emacs 22 +@smallexample +@group +(defun yank (&optional arg) + "Reinsert (\"paste\") the last stretch of killed text. +More precisely, reinsert the stretch of killed text most recently +killed OR yanked. Put point at end, and set mark at beginning. +With just \\[universal-argument] as argument, same but put point at +beginning (and mark at end). With argument N, reinsert the Nth most +recently killed stretch of killed text. + +When this command inserts killed text into the buffer, it honors +`yank-excluded-properties' and `yank-handler' as described in the +doc string for `insert-for-yank-1', which see. + +See also the command \\[yank-pop]." +@end group +@group + (interactive "*P") + (setq yank-window-start (window-start)) + ;; If we don't get all the way thru, make last-command indicate that + ;; for the following command. + (setq this-command t) + (push-mark (point)) +@end group +@group + (insert-for-yank (current-kill (cond + ((listp arg) 0) + ((eq arg '-) -2) + (t (1- arg))))) + (if (consp arg) + ;; This is like exchange-point-and-mark, + ;; but doesn't activate the mark. + ;; It is cleaner to avoid activation, even though the command + ;; loop would deactivate the mark because we inserted text. + (goto-char (prog1 (mark t) + (set-marker (mark-marker) (point) (current-buffer))))) +@end group +@group + ;; If we do get all the way thru, make this-command indicate that. + (if (eq this-command t) + (setq this-command 'yank)) + nil) +@end group +@end smallexample + +The key expression is @code{insert-for-yank}, which inserts the string +returned by @code{current-kill}, but removes some text properties from +it. + +However, before getting to that expression, the function sets the value +of @code{yank-window-start} to the position returned by the +@code{(window-start)} expression, the position at which the display +currently starts. The @code{yank} function also sets +@code{this-command} and pushes the mark. + +After it yanks the appropriate element, if the optional argument is a +@sc{cons} rather than a number or nothing, it puts point at beginning +of the yanked text and mark at its end. + +(The @code{prog1} function is like @code{progn} but returns the value +of its first argument rather than the value of its last argument. Its +first argument is forced to return the buffer's mark as an integer. +You can see the documentation for these functions by placing point +over them in this buffer and then typing @kbd{C-h f} +(@code{describe-function}) followed by a @kbd{RET}; the default is the +function.) + +The last part of the function tells what to do when it succeeds. + +@node yank-pop, ring file, yank, Kill Ring +@comment node-name, next, previous, up +@appendixsec @code{yank-pop} +@findex yank-pop + +After understanding @code{yank} and @code{current-kill}, you know how +to approach the @code{yank-pop} function. Leaving out the +documentation to save space, it looks like this: + +@c GNU Emacs 22 +@smallexample +@group +(defun yank-pop (&optional arg) + "@dots{}" + (interactive "*p") + (if (not (eq last-command 'yank)) + (error "Previous command was not a yank")) +@end group +@group + (setq this-command 'yank) + (unless arg (setq arg 1)) + (let ((inhibit-read-only t) + (before (< (point) (mark t)))) +@end group +@group + (if before + (funcall (or yank-undo-function 'delete-region) (point) (mark t)) + (funcall (or yank-undo-function 'delete-region) (mark t) (point))) + (setq yank-undo-function nil) +@end group +@group + (set-marker (mark-marker) (point) (current-buffer)) + (insert-for-yank (current-kill arg)) + ;; Set the window start back where it was in the yank command, + ;; if possible. + (set-window-start (selected-window) yank-window-start t) +@end group +@group + (if before + ;; This is like exchange-point-and-mark, + ;; but doesn't activate the mark. + ;; It is cleaner to avoid activation, even though the command + ;; loop would deactivate the mark because we inserted text. + (goto-char (prog1 (mark t) + (set-marker (mark-marker) + (point) + (current-buffer)))))) + nil) +@end group +@end smallexample + +The function is interactive with a small @samp{p} so the prefix +argument is processed and passed to the function. The command can +only be used after a previous yank; otherwise an error message is +sent. This check uses the variable @code{last-command} which is set +by @code{yank} and is discussed elsewhere. +(@xref{copy-region-as-kill}.) + +The @code{let} clause sets the variable @code{before} to true or false +depending whether point is before or after mark and then the region +between point and mark is deleted. This is the region that was just +inserted by the previous yank and it is this text that will be +replaced. + +@code{funcall} calls its first argument as a function, passing +remaining arguments to it. The first argument is whatever the +@code{or} expression returns. The two remaining arguments are the +positions of point and mark set by the preceding @code{yank} command. + +There is more, but that is the hardest part. + +@node ring file, , yank-pop, Kill Ring +@comment node-name, next, previous, up +@appendixsec The @file{ring.el} File +@cindex @file{ring.el} file + +Interestingly, GNU Emacs posses a file called @file{ring.el} that +provides many of the features we just discussed. But functions such +as @code{kill-ring-yank-pointer} do not use this library, possibly +because they were written earlier. + +@node Full Graph, Free Software and Free Manuals, Kill Ring, Top +@appendix A Graph with Labelled Axes + +Printed axes help you understand a graph. They convey scale. In an +earlier chapter (@pxref{Readying a Graph, , Readying a Graph}), we +wrote the code to print the body of a graph. Here we write the code +for printing and labelling vertical and horizontal axes, along with the +body itself. + +@menu +* Labelled Example:: +* print-graph Varlist:: @code{let} expression in @code{print-graph}. +* print-Y-axis:: Print a label for the vertical axis. +* print-X-axis:: Print a horizontal label. +* Print Whole Graph:: The function to print a complete graph. +@end menu + +@node Labelled Example, print-graph Varlist, Full Graph, Full Graph +@ifnottex +@unnumberedsec Labelled Example Graph +@end ifnottex + +Since insertions fill a buffer to the right and below point, the new +graph printing function should first print the Y or vertical axis, +then the body of the graph, and finally the X or horizontal axis. +This sequence lays out for us the contents of the function: + +@enumerate +@item +Set up code. + +@item +Print Y axis. + +@item +Print body of graph. + +@item +Print X axis. +@end enumerate + +@need 800 +Here is an example of how a finished graph should look: + +@smallexample +@group + 10 - + * + * * + * ** + * *** + 5 - * ******* + * *** ******* + ************* + *************** + 1 - **************** + | | | | + 1 5 10 15 +@end group +@end smallexample + +@noindent +In this graph, both the vertical and the horizontal axes are labelled +with numbers. However, in some graphs, the horizontal axis is time +and would be better labelled with months, like this: + +@smallexample +@group + 5 - * + * ** * + ******* + ********** ** + 1 - ************** + | ^ | + Jan June Jan +@end group +@end smallexample + +Indeed, with a little thought, we can easily come up with a variety of +vertical and horizontal labelling schemes. Our task could become +complicated. But complications breed confusion. Rather than permit +this, it is better choose a simple labelling scheme for our first +effort, and to modify or replace it later. + +@need 1200 +These considerations suggest the following outline for the +@code{print-graph} function: + +@smallexample +@group +(defun print-graph (numbers-list) + "@var{documentation}@dots{}" + (let ((height @dots{} + @dots{})) +@end group +@group + (print-Y-axis height @dots{} ) + (graph-body-print numbers-list) + (print-X-axis @dots{} ))) +@end group +@end smallexample + +We can work on each part of the @code{print-graph} function definition +in turn. + +@node print-graph Varlist, print-Y-axis, Labelled Example, Full Graph +@comment node-name, next, previous, up +@appendixsec The @code{print-graph} Varlist +@cindex @code{print-graph} varlist + +In writing the @code{print-graph} function, the first task is to write +the varlist in the @code{let} expression. (We will leave aside for the +moment any thoughts about making the function interactive or about the +contents of its documentation string.) + +The varlist should set several values. Clearly, the top of the label +for the vertical axis must be at least the height of the graph, which +means that we must obtain this information here. Note that the +@code{print-graph-body} function also requires this information. There +is no reason to calculate the height of the graph in two different +places, so we should change @code{print-graph-body} from the way we +defined it earlier to take advantage of the calculation. + +Similarly, both the function for printing the X axis labels and the +@code{print-graph-body} function need to learn the value of the width of +each symbol. We can perform the calculation here and change the +definition for @code{print-graph-body} from the way we defined it in the +previous chapter. + +The length of the label for the horizontal axis must be at least as long +as the graph. However, this information is used only in the function +that prints the horizontal axis, so it does not need to be calculated here. + +These thoughts lead us directly to the following form for the varlist +in the @code{let} for @code{print-graph}: + +@smallexample +@group +(let ((height (apply 'max numbers-list)) ; @r{First version.} + (symbol-width (length graph-blank))) +@end group +@end smallexample + +@noindent +As we shall see, this expression is not quite right. + +@need 2000 +@node print-Y-axis, print-X-axis, print-graph Varlist, Full Graph +@comment node-name, next, previous, up +@appendixsec The @code{print-Y-axis} Function +@cindex Axis, print vertical +@cindex Y axis printing +@cindex Vertical axis printing +@cindex Print vertical axis + +The job of the @code{print-Y-axis} function is to print a label for +the vertical axis that looks like this: + +@smallexample +@group + 10 - + + + + + 5 - + + + + 1 - +@end group +@end smallexample + +@noindent +The function should be passed the height of the graph, and then should +construct and insert the appropriate numbers and marks. + +@menu +* print-Y-axis in Detail:: +* Height of label:: What height for the Y axis? +* Compute a Remainder:: How to compute the remainder of a division. +* Y Axis Element:: Construct a line for the Y axis. +* Y-axis-column:: Generate a list of Y axis labels. +* print-Y-axis Penultimate:: A not quite final version. +@end menu + +@node print-Y-axis in Detail, Height of label, print-Y-axis, print-Y-axis +@ifnottex +@unnumberedsubsec The @code{print-Y-axis} Function in Detail +@end ifnottex + +It is easy enough to see in the figure what the Y axis label should +look like; but to say in words, and then to write a function +definition to do the job is another matter. It is not quite true to +say that we want a number and a tic every five lines: there are only +three lines between the @samp{1} and the @samp{5} (lines 2, 3, and 4), +but four lines between the @samp{5} and the @samp{10} (lines 6, 7, 8, +and 9). It is better to say that we want a number and a tic mark on +the base line (number 1) and then that we want a number and a tic on +the fifth line from the bottom and on every line that is a multiple of +five. + +@node Height of label, Compute a Remainder, print-Y-axis in Detail, print-Y-axis +@ifnottex +@unnumberedsubsec What height should the label be? +@end ifnottex + +The next issue is what height the label should be? Suppose the maximum +height of tallest column of the graph is seven. Should the highest +label on the Y axis be @samp{5 -}, and should the graph stick up above +the label? Or should the highest label be @samp{7 -}, and mark the peak +of the graph? Or should the highest label be @code{10 -}, which is a +multiple of five, and be higher than the topmost value of the graph? + +The latter form is preferred. Most graphs are drawn within rectangles +whose sides are an integral number of steps long---5, 10, 15, and so +on for a step distance of five. But as soon as we decide to use a +step height for the vertical axis, we discover that the simple +expression in the varlist for computing the height is wrong. The +expression is @code{(apply 'max numbers-list)}. This returns the +precise height, not the maximum height plus whatever is necessary to +round up to the nearest multiple of five. A more complex expression +is required. + +As usual in cases like this, a complex problem becomes simpler if it is +divided into several smaller problems. + +First, consider the case when the highest value of the graph is an +integral multiple of five---when it is 5, 10, 15, or some higher +multiple of five. We can use this value as the Y axis height. + +A fairly simply way to determine whether a number is a multiple of +five is to divide it by five and see if the division results in a +remainder. If there is no remainder, the number is a multiple of +five. Thus, seven divided by five has a remainder of two, and seven +is not an integral multiple of five. Put in slightly different +language, more reminiscent of the classroom, five goes into seven +once, with a remainder of two. However, five goes into ten twice, +with no remainder: ten is an integral multiple of five. + +@node Compute a Remainder, Y Axis Element, Height of label, print-Y-axis +@appendixsubsec Side Trip: Compute a Remainder + +@findex % @r{(remainder function)} +@cindex Remainder function, @code{%} +In Lisp, the function for computing a remainder is @code{%}. The +function returns the remainder of its first argument divided by its +second argument. As it happens, @code{%} is a function in Emacs Lisp +that you cannot discover using @code{apropos}: you find nothing if you +type @kbd{M-x apropos @key{RET} remainder @key{RET}}. The only way to +learn of the existence of @code{%} is to read about it in a book such +as this or in the Emacs Lisp sources. + +You can try the @code{%} function by evaluating the following two +expressions: + +@smallexample +@group +(% 7 5) + +(% 10 5) +@end group +@end smallexample + +@noindent +The first expression returns 2 and the second expression returns 0. + +To test whether the returned value is zero or some other number, we +can use the @code{zerop} function. This function returns @code{t} if +its argument, which must be a number, is zero. + +@smallexample +@group +(zerop (% 7 5)) + @result{} nil + +(zerop (% 10 5)) + @result{} t +@end group +@end smallexample + +Thus, the following expression will return @code{t} if the height +of the graph is evenly divisible by five: + +@smallexample +(zerop (% height 5)) +@end smallexample + +@noindent +(The value of @code{height}, of course, can be found from @code{(apply +'max numbers-list)}.) + +On the other hand, if the value of @code{height} is not a multiple of +five, we want to reset the value to the next higher multiple of five. +This is straightforward arithmetic using functions with which we are +already familiar. First, we divide the value of @code{height} by five +to determine how many times five goes into the number. Thus, five +goes into twelve twice. If we add one to this quotient and multiply by +five, we will obtain the value of the next multiple of five that is +larger than the height. Five goes into twelve twice. Add one to two, +and multiply by five; the result is fifteen, which is the next multiple +of five that is higher than twelve. The Lisp expression for this is: + +@smallexample +(* (1+ (/ height 5)) 5) +@end smallexample + +@noindent +For example, if you evaluate the following, the result is 15: + +@smallexample +(* (1+ (/ 12 5)) 5) +@end smallexample + +All through this discussion, we have been using `five' as the value +for spacing labels on the Y axis; but we may want to use some other +value. For generality, we should replace `five' with a variable to +which we can assign a value. The best name I can think of for this +variable is @code{Y-axis-label-spacing}. + +@need 1250 +Using this term, and an @code{if} expression, we produce the +following: + +@smallexample +@group +(if (zerop (% height Y-axis-label-spacing)) + height + ;; @r{else} + (* (1+ (/ height Y-axis-label-spacing)) + Y-axis-label-spacing)) +@end group +@end smallexample + +@noindent +This expression returns the value of @code{height} itself if the height +is an even multiple of the value of the @code{Y-axis-label-spacing} or +else it computes and returns a value of @code{height} that is equal to +the next higher multiple of the value of the @code{Y-axis-label-spacing}. + +We can now include this expression in the @code{let} expression of the +@code{print-graph} function (after first setting the value of +@code{Y-axis-label-spacing}): +@vindex Y-axis-label-spacing + +@smallexample +@group +(defvar Y-axis-label-spacing 5 + "Number of lines from one Y axis label to next.") +@end group + +@group +@dots{} +(let* ((height (apply 'max numbers-list)) + (height-of-top-line + (if (zerop (% height Y-axis-label-spacing)) + height +@end group +@group + ;; @r{else} + (* (1+ (/ height Y-axis-label-spacing)) + Y-axis-label-spacing))) + (symbol-width (length graph-blank)))) +@dots{} +@end group +@end smallexample + +@noindent +(Note use of the @code{let*} function: the initial value of height is +computed once by the @code{(apply 'max numbers-list)} expression and +then the resulting value of @code{height} is used to compute its +final value. @xref{fwd-para let, , The @code{let*} expression}, for +more about @code{let*}.) + +@node Y Axis Element, Y-axis-column, Compute a Remainder, print-Y-axis +@appendixsubsec Construct a Y Axis Element + +When we print the vertical axis, we want to insert strings such as +@w{@samp{5 -}} and @w{@samp{10 - }} every five lines. +Moreover, we want the numbers and dashes to line up, so shorter +numbers must be padded with leading spaces. If some of the strings +use two digit numbers, the strings with single digit numbers must +include a leading blank space before the number. + +@findex number-to-string +To figure out the length of the number, the @code{length} function is +used. But the @code{length} function works only with a string, not with +a number. So the number has to be converted from being a number to +being a string. This is done with the @code{number-to-string} function. +For example, + +@smallexample +@group +(length (number-to-string 35)) + @result{} 2 + +(length (number-to-string 100)) + @result{} 3 +@end group +@end smallexample + +@noindent +(@code{number-to-string} is also called @code{int-to-string}; you will +see this alternative name in various sources.) + +In addition, in each label, each number is followed by a string such +as @w{@samp{ - }}, which we will call the @code{Y-axis-tic} marker. +This variable is defined with @code{defvar}: + +@vindex Y-axis-tic +@smallexample +@group +(defvar Y-axis-tic " - " + "String that follows number in a Y axis label.") +@end group +@end smallexample + +The length of the Y label is the sum of the length of the Y axis tic +mark and the length of the number of the top of the graph. + +@smallexample +(length (concat (number-to-string height) Y-axis-tic))) +@end smallexample + +This value will be calculated by the @code{print-graph} function in +its varlist as @code{full-Y-label-width} and passed on. (Note that we +did not think to include this in the varlist when we first proposed it.) + +To make a complete vertical axis label, a tic mark is concatenated +with a number; and the two together may be preceded by one or more +spaces depending on how long the number is. The label consists of +three parts: the (optional) leading spaces, the number, and the tic +mark. The function is passed the value of the number for the specific +row, and the value of the width of the top line, which is calculated +(just once) by @code{print-graph}. + +@smallexample +@group +(defun Y-axis-element (number full-Y-label-width) + "Construct a NUMBERed label element. +A numbered element looks like this ` 5 - ', +and is padded as needed so all line up with +the element for the largest number." +@end group +@group + (let* ((leading-spaces + (- full-Y-label-width + (length + (concat (number-to-string number) + Y-axis-tic))))) +@end group +@group + (concat + (make-string leading-spaces ? ) + (number-to-string number) + Y-axis-tic))) +@end group +@end smallexample + +The @code{Y-axis-element} function concatenates together the leading +spaces, if any; the number, as a string; and the tic mark. + +To figure out how many leading spaces the label will need, the +function subtracts the actual length of the label---the length of the +number plus the length of the tic mark---from the desired label width. + +@findex make-string +Blank spaces are inserted using the @code{make-string} function. This +function takes two arguments: the first tells it how long the string +will be and the second is a symbol for the character to insert, in a +special format. The format is a question mark followed by a blank +space, like this, @samp{? }. @xref{Character Type, , Character Type, +elisp, The GNU Emacs Lisp Reference Manual}, for a description of the +syntax for characters. (Of course, you might want to replace the +blank space by some other character @dots{} You know what to do.) + +The @code{number-to-string} function is used in the concatenation +expression, to convert the number to a string that is concatenated +with the leading spaces and the tic mark. + +@node Y-axis-column, print-Y-axis Penultimate, Y Axis Element, print-Y-axis +@appendixsubsec Create a Y Axis Column + +The preceding functions provide all the tools needed to construct a +function that generates a list of numbered and blank strings to insert +as the label for the vertical axis: + +@findex Y-axis-column +@smallexample +@group +(defun Y-axis-column (height width-of-label) + "Construct list of Y axis labels and blank strings. +For HEIGHT of line above base and WIDTH-OF-LABEL." + (let (Y-axis) +@group +@end group + (while (> height 1) + (if (zerop (% height Y-axis-label-spacing)) + ;; @r{Insert label.} + (setq Y-axis + (cons + (Y-axis-element height width-of-label) + Y-axis)) +@group +@end group + ;; @r{Else, insert blanks.} + (setq Y-axis + (cons + (make-string width-of-label ? ) + Y-axis))) + (setq height (1- height))) + ;; @r{Insert base line.} + (setq Y-axis + (cons (Y-axis-element 1 width-of-label) Y-axis)) + (nreverse Y-axis))) +@end group +@end smallexample + +In this function, we start with the value of @code{height} and +repetitively subtract one from its value. After each subtraction, we +test to see whether the value is an integral multiple of the +@code{Y-axis-label-spacing}. If it is, we construct a numbered label +using the @code{Y-axis-element} function; if not, we construct a +blank label using the @code{make-string} function. The base line +consists of the number one followed by a tic mark. + +@need 2000 +@node print-Y-axis Penultimate, , Y-axis-column, print-Y-axis +@appendixsubsec The Not Quite Final Version of @code{print-Y-axis} + +The list constructed by the @code{Y-axis-column} function is passed to +the @code{print-Y-axis} function, which inserts the list as a column. + +@findex print-Y-axis +@smallexample +@group +(defun print-Y-axis (height full-Y-label-width) + "Insert Y axis using HEIGHT and FULL-Y-LABEL-WIDTH. +Height must be the maximum height of the graph. +Full width is the width of the highest label element." +;; Value of height and full-Y-label-width +;; are passed by `print-graph'. +@end group +@group + (let ((start (point))) + (insert-rectangle + (Y-axis-column height full-Y-label-width)) + ;; @r{Place point ready for inserting graph.} + (goto-char start) + ;; @r{Move point forward by value of} full-Y-label-width + (forward-char full-Y-label-width))) +@end group +@end smallexample + +The @code{print-Y-axis} uses the @code{insert-rectangle} function to +insert the Y axis labels created by the @code{Y-axis-column} function. +In addition, it places point at the correct position for printing the body of +the graph. + +You can test @code{print-Y-axis}: + +@enumerate +@item +Install + +@smallexample +@group +Y-axis-label-spacing +Y-axis-tic +Y-axis-element +Y-axis-column +print-Y-axis +@end group +@end smallexample + +@item +Copy the following expression: + +@smallexample +(print-Y-axis 12 5) +@end smallexample + +@item +Switch to the @file{*scratch*} buffer and place the cursor where you +want the axis labels to start. + +@item +Type @kbd{M-:} (@code{eval-expression}). + +@item +Yank the @code{graph-body-print} expression into the minibuffer +with @kbd{C-y} (@code{yank)}. + +@item +Press @key{RET} to evaluate the expression. +@end enumerate + +Emacs will print labels vertically, the top one being @w{@samp{10 -@w{ +}}}. (The @code{print-graph} function will pass the value of +@code{height-of-top-line}, which in this case will end up as 15, +thereby getting rid of what might appear as a bug.) + +@need 2000 +@node print-X-axis, Print Whole Graph, print-Y-axis, Full Graph +@appendixsec The @code{print-X-axis} Function +@cindex Axis, print horizontal +@cindex X axis printing +@cindex Print horizontal axis +@cindex Horizontal axis printing + +X axis labels are much like Y axis labels, except that the ticks are on a +line above the numbers. Labels should look like this: + +@smallexample +@group + | | | | + 1 5 10 15 +@end group +@end smallexample + +The first tic is under the first column of the graph and is preceded by +several blank spaces. These spaces provide room in rows above for the Y +axis labels. The second, third, fourth, and subsequent ticks are all +spaced equally, according to the value of @code{X-axis-label-spacing}. + +The second row of the X axis consists of numbers, preceded by several +blank spaces and also separated according to the value of the variable +@code{X-axis-label-spacing}. + +The value of the variable @code{X-axis-label-spacing} should itself be +measured in units of @code{symbol-width}, since you may want to change +the width of the symbols that you are using to print the body of the +graph without changing the ways the graph is labelled. + +@menu +* Similarities differences:: Much like @code{print-Y-axis}, but not exactly. +* X Axis Tic Marks:: Create tic marks for the horizontal axis. +@end menu + +@node Similarities differences, X Axis Tic Marks, print-X-axis, print-X-axis +@ifnottex +@unnumberedsubsec Similarities and differences +@end ifnottex + +The @code{print-X-axis} function is constructed in more or less the +same fashion as the @code{print-Y-axis} function except that it has +two lines: the line of tic marks and the numbers. We will write a +separate function to print each line and then combine them within the +@code{print-X-axis} function. + +This is a three step process: + +@enumerate +@item +Write a function to print the X axis tic marks, @code{print-X-axis-tic-line}. + +@item +Write a function to print the X numbers, @code{print-X-axis-numbered-line}. + +@item +Write a function to print both lines, the @code{print-X-axis} function, +using @code{print-X-axis-tic-line} and +@code{print-X-axis-numbered-line}. +@end enumerate + +@node X Axis Tic Marks, , Similarities differences, print-X-axis +@appendixsubsec X Axis Tic Marks + +The first function should print the X axis tic marks. We must specify +the tic marks themselves and their spacing: + +@smallexample +@group +(defvar X-axis-label-spacing + (if (boundp 'graph-blank) + (* 5 (length graph-blank)) 5) + "Number of units from one X axis label to next.") +@end group +@end smallexample + +@noindent +(Note that the value of @code{graph-blank} is set by another +@code{defvar}. The @code{boundp} predicate checks whether it has +already been set; @code{boundp} returns @code{nil} if it has not. If +@code{graph-blank} were unbound and we did not use this conditional +construction, in a recent GNU Emacs, we would enter the debugger and +see an error message saying @samp{@w{Debugger entered--Lisp error:} +@w{(void-variable graph-blank)}}.) + +@need 1200 +Here is the @code{defvar} for @code{X-axis-tic-symbol}: + +@smallexample +@group +(defvar X-axis-tic-symbol "|" + "String to insert to point to a column in X axis.") +@end group +@end smallexample + +@need 1250 +The goal is to make a line that looks like this: + +@smallexample + | | | | +@end smallexample + +The first tic is indented so that it is under the first column, which is +indented to provide space for the Y axis labels. + +A tic element consists of the blank spaces that stretch from one tic to +the next plus a tic symbol. The number of blanks is determined by the +width of the tic symbol and the @code{X-axis-label-spacing}. + +@need 1250 +The code looks like this: + +@smallexample +@group +;;; X-axis-tic-element +@dots{} +(concat + (make-string + ;; @r{Make a string of blanks.} + (- (* symbol-width X-axis-label-spacing) + (length X-axis-tic-symbol)) + ? ) + ;; @r{Concatenate blanks with tic symbol.} + X-axis-tic-symbol) +@dots{} +@end group +@end smallexample + +Next, we determine how many blanks are needed to indent the first tic +mark to the first column of the graph. This uses the value of +@code{full-Y-label-width} passed it by the @code{print-graph} function. + +@need 1250 +The code to make @code{X-axis-leading-spaces} +looks like this: + +@smallexample +@group +;; X-axis-leading-spaces +@dots{} +(make-string full-Y-label-width ? ) +@dots{} +@end group +@end smallexample + +We also need to determine the length of the horizontal axis, which is +the length of the numbers list, and the number of ticks in the horizontal +axis: + +@smallexample +@group +;; X-length +@dots{} +(length numbers-list) +@end group + +@group +;; tic-width +@dots{} +(* symbol-width X-axis-label-spacing) +@end group + +@group +;; number-of-X-ticks +(if (zerop (% (X-length tic-width))) + (/ (X-length tic-width)) + (1+ (/ (X-length tic-width)))) +@end group +@end smallexample + +@need 1250 +All this leads us directly to the function for printing the X axis tic line: + +@findex print-X-axis-tic-line +@smallexample +@group +(defun print-X-axis-tic-line + (number-of-X-tics X-axis-leading-spaces X-axis-tic-element) + "Print ticks for X axis." + (insert X-axis-leading-spaces) + (insert X-axis-tic-symbol) ; @r{Under first column.} +@end group +@group + ;; @r{Insert second tic in the right spot.} + (insert (concat + (make-string + (- (* symbol-width X-axis-label-spacing) + ;; @r{Insert white space up to second tic symbol.} + (* 2 (length X-axis-tic-symbol))) + ? ) + X-axis-tic-symbol)) +@end group +@group + ;; @r{Insert remaining ticks.} + (while (> number-of-X-tics 1) + (insert X-axis-tic-element) + (setq number-of-X-tics (1- number-of-X-tics)))) +@end group +@end smallexample + +The line of numbers is equally straightforward: + +@need 1250 +First, we create a numbered element with blank spaces before each number: + +@findex X-axis-element +@smallexample +@group +(defun X-axis-element (number) + "Construct a numbered X axis element." + (let ((leading-spaces + (- (* symbol-width X-axis-label-spacing) + (length (number-to-string number))))) + (concat (make-string leading-spaces ? ) + (number-to-string number)))) +@end group +@end smallexample + +Next, we create the function to print the numbered line, starting with +the number ``1'' under the first column: + +@findex print-X-axis-numbered-line +@smallexample +@group +(defun print-X-axis-numbered-line + (number-of-X-tics X-axis-leading-spaces) + "Print line of X-axis numbers" + (let ((number X-axis-label-spacing)) + (insert X-axis-leading-spaces) + (insert "1") +@end group +@group + (insert (concat + (make-string + ;; @r{Insert white space up to next number.} + (- (* symbol-width X-axis-label-spacing) 2) + ? ) + (number-to-string number))) +@end group +@group + ;; @r{Insert remaining numbers.} + (setq number (+ number X-axis-label-spacing)) + (while (> number-of-X-tics 1) + (insert (X-axis-element number)) + (setq number (+ number X-axis-label-spacing)) + (setq number-of-X-tics (1- number-of-X-tics))))) +@end group +@end smallexample + +Finally, we need to write the @code{print-X-axis} that uses +@code{print-X-axis-tic-line} and +@code{print-X-axis-numbered-line}. + +The function must determine the local values of the variables used by both +@code{print-X-axis-tic-line} and @code{print-X-axis-numbered-line}, and +then it must call them. Also, it must print the carriage return that +separates the two lines. + +The function consists of a varlist that specifies five local variables, +and calls to each of the two line printing functions: + +@findex print-X-axis +@smallexample +@group +(defun print-X-axis (numbers-list) + "Print X axis labels to length of NUMBERS-LIST." + (let* ((leading-spaces + (make-string full-Y-label-width ? )) +@end group +@group + ;; symbol-width @r{is provided by} graph-body-print + (tic-width (* symbol-width X-axis-label-spacing)) + (X-length (length numbers-list)) +@end group +@group + (X-tic + (concat + (make-string +@end group +@group + ;; @r{Make a string of blanks.} + (- (* symbol-width X-axis-label-spacing) + (length X-axis-tic-symbol)) + ? ) +@end group +@group + ;; @r{Concatenate blanks with tic symbol.} + X-axis-tic-symbol)) +@end group +@group + (tic-number + (if (zerop (% X-length tic-width)) + (/ X-length tic-width) + (1+ (/ X-length tic-width))))) +@end group +@group + (print-X-axis-tic-line tic-number leading-spaces X-tic) + (insert "\n") + (print-X-axis-numbered-line tic-number leading-spaces))) +@end group +@end smallexample + +@need 1250 +You can test @code{print-X-axis}: + +@enumerate +@item +Install @code{X-axis-tic-symbol}, @code{X-axis-label-spacing}, +@code{print-X-axis-tic-line}, as well as @code{X-axis-element}, +@code{print-X-axis-numbered-line}, and @code{print-X-axis}. + +@item +Copy the following expression: + +@smallexample +@group +(progn + (let ((full-Y-label-width 5) + (symbol-width 1)) + (print-X-axis + '(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16)))) +@end group +@end smallexample + +@item +Switch to the @file{*scratch*} buffer and place the cursor where you +want the axis labels to start. + +@item +Type @kbd{M-:} (@code{eval-expression}). + +@item +Yank the test expression into the minibuffer +with @kbd{C-y} (@code{yank)}. + +@item +Press @key{RET} to evaluate the expression. +@end enumerate + +@need 1250 +Emacs will print the horizontal axis like this: +@sp 1 + +@smallexample +@group + | | | | | + 1 5 10 15 20 +@end group +@end smallexample + +@node Print Whole Graph, , print-X-axis, Full Graph +@appendixsec Printing the Whole Graph +@cindex Printing the whole graph +@cindex Whole graph printing +@cindex Graph, printing all + +Now we are nearly ready to print the whole graph. + +The function to print the graph with the proper labels follows the +outline we created earlier (@pxref{Full Graph, , A Graph with Labelled +Axes}), but with additions. + +@need 1250 +Here is the outline: + +@smallexample +@group +(defun print-graph (numbers-list) + "@var{documentation}@dots{}" + (let ((height @dots{} + @dots{})) +@end group +@group + (print-Y-axis height @dots{} ) + (graph-body-print numbers-list) + (print-X-axis @dots{} ))) +@end group +@end smallexample + +@menu +* The final version:: A few changes. +* Test print-graph:: Run a short test. +* Graphing words in defuns:: Executing the final code. +* lambda:: How to write an anonymous function. +* mapcar:: Apply a function to elements of a list. +* Another Bug:: Yet another bug @dots{} most insidious. +* Final printed graph:: The graph itself! +@end menu + +@node The final version, Test print-graph, Print Whole Graph, Print Whole Graph +@ifnottex +@unnumberedsubsec Changes for the Final Version +@end ifnottex + +The final version is different from what we planned in two ways: +first, it contains additional values calculated once in the varlist; +second, it carries an option to specify the labels' increment per row. +This latter feature turns out to be essential; otherwise, a graph may +have more rows than fit on a display or on a sheet of paper. + +@need 1500 +This new feature requires a change to the @code{Y-axis-column} +function, to add @code{vertical-step} to it. The function looks like +this: + +@findex Y-axis-column @r{Final version.} +@smallexample +@group +;;; @r{Final version.} +(defun Y-axis-column + (height width-of-label &optional vertical-step) + "Construct list of labels for Y axis. +HEIGHT is maximum height of graph. +WIDTH-OF-LABEL is maximum width of label. +VERTICAL-STEP, an option, is a positive integer +that specifies how much a Y axis label increments +for each line. For example, a step of 5 means +that each line is five units of the graph." +@end group +@group + (let (Y-axis + (number-per-line (or vertical-step 1))) + (while (> height 1) + (if (zerop (% height Y-axis-label-spacing)) +@end group +@group + ;; @r{Insert label.} + (setq Y-axis + (cons + (Y-axis-element + (* height number-per-line) + width-of-label) + Y-axis)) +@end group +@group + ;; @r{Else, insert blanks.} + (setq Y-axis + (cons + (make-string width-of-label ? ) + Y-axis))) + (setq height (1- height))) +@end group +@group + ;; @r{Insert base line.} + (setq Y-axis (cons (Y-axis-element + (or vertical-step 1) + width-of-label) + Y-axis)) + (nreverse Y-axis))) +@end group +@end smallexample + +The values for the maximum height of graph and the width of a symbol +are computed by @code{print-graph} in its @code{let} expression; so +@code{graph-body-print} must be changed to accept them. + +@findex graph-body-print @r{Final version.} +@smallexample +@group +;;; @r{Final version.} +(defun graph-body-print (numbers-list height symbol-width) + "Print a bar graph of the NUMBERS-LIST. +The numbers-list consists of the Y-axis values. +HEIGHT is maximum height of graph. +SYMBOL-WIDTH is number of each column." +@end group +@group + (let (from-position) + (while numbers-list + (setq from-position (point)) + (insert-rectangle + (column-of-graph height (car numbers-list))) + (goto-char from-position) + (forward-char symbol-width) +@end group +@group + ;; @r{Draw graph column by column.} + (sit-for 0) + (setq numbers-list (cdr numbers-list))) + ;; @r{Place point for X axis labels.} + (forward-line height) + (insert "\n"))) +@end group +@end smallexample + +@need 1250 +Finally, the code for the @code{print-graph} function: + +@findex print-graph @r{Final version.} +@smallexample +@group +;;; @r{Final version.} +(defun print-graph + (numbers-list &optional vertical-step) + "Print labelled bar graph of the NUMBERS-LIST. +The numbers-list consists of the Y-axis values. +@end group + +@group +Optionally, VERTICAL-STEP, a positive integer, +specifies how much a Y axis label increments for +each line. For example, a step of 5 means that +each row is five units." +@end group +@group + (let* ((symbol-width (length graph-blank)) + ;; @code{height} @r{is both the largest number} + ;; @r{and the number with the most digits.} + (height (apply 'max numbers-list)) +@end group +@group + (height-of-top-line + (if (zerop (% height Y-axis-label-spacing)) + height + ;; @r{else} + (* (1+ (/ height Y-axis-label-spacing)) + Y-axis-label-spacing))) +@end group +@group + (vertical-step (or vertical-step 1)) + (full-Y-label-width + (length +@end group +@group + (concat + (number-to-string + (* height-of-top-line vertical-step)) + Y-axis-tic)))) +@end group + +@group + (print-Y-axis + height-of-top-line full-Y-label-width vertical-step) +@end group +@group + (graph-body-print + numbers-list height-of-top-line symbol-width) + (print-X-axis numbers-list))) +@end group +@end smallexample + +@node Test print-graph, Graphing words in defuns, The final version, Print Whole Graph +@appendixsubsec Testing @code{print-graph} + +@need 1250 +We can test the @code{print-graph} function with a short list of numbers: + +@enumerate +@item +Install the final versions of @code{Y-axis-column}, +@code{graph-body-print}, and @code{print-graph} (in addition to the +rest of the code.) + +@item +Copy the following expression: + +@smallexample +(print-graph '(3 2 5 6 7 5 3 4 6 4 3 2 1)) +@end smallexample + +@item +Switch to the @file{*scratch*} buffer and place the cursor where you +want the axis labels to start. + +@item +Type @kbd{M-:} (@code{eval-expression}). + +@item +Yank the test expression into the minibuffer +with @kbd{C-y} (@code{yank)}. + +@item +Press @key{RET} to evaluate the expression. +@end enumerate + +@need 1250 +Emacs will print a graph that looks like this: + +@smallexample +@group +10 - + + + * + ** * + 5 - **** * + **** *** + * ********* + ************ + 1 - ************* + + | | | | + 1 5 10 15 +@end group +@end smallexample + +@need 1200 +On the other hand, if you pass @code{print-graph} a +@code{vertical-step} value of 2, by evaluating this expression: + +@smallexample +(print-graph '(3 2 5 6 7 5 3 4 6 4 3 2 1) 2) +@end smallexample + +@need 1250 +@noindent +The graph looks like this: + +@smallexample +@group +20 - + + + * + ** * +10 - **** * + **** *** + * ********* + ************ + 2 - ************* + + | | | | + 1 5 10 15 +@end group +@end smallexample + +@noindent +(A question: is the `2' on the bottom of the vertical axis a bug or a +feature? If you think it is a bug, and should be a `1' instead, (or +even a `0'), you can modify the sources.) + +@node Graphing words in defuns, lambda, Test print-graph, Print Whole Graph +@appendixsubsec Graphing Numbers of Words and Symbols + +Now for the graph for which all this code was written: a graph that +shows how many function definitions contain fewer than 10 words and +symbols, how many contain between 10 and 19 words and symbols, how +many contain between 20 and 29 words and symbols, and so on. + +This is a multi-step process. First make sure you have loaded all the +requisite code. + +@need 1500 +It is a good idea to reset the value of @code{top-of-ranges} in case +you have set it to some different value. You can evaluate the +following: + +@smallexample +@group +(setq top-of-ranges + '(10 20 30 40 50 + 60 70 80 90 100 + 110 120 130 140 150 + 160 170 180 190 200 + 210 220 230 240 250 + 260 270 280 290 300) +@end group +@end smallexample + +@noindent +Next create a list of the number of words and symbols in each range. + +@need 1500 +@noindent +Evaluate the following: + +@smallexample +@group +(setq list-for-graph + (defuns-per-range + (sort + (recursive-lengths-list-many-files + (directory-files "/usr/local/emacs/lisp" + t ".+el$")) + '<) + top-of-ranges)) +@end group +@end smallexample + +@noindent +On my old machine, this took about an hour. It looked though 303 Lisp +files in my copy of Emacs version 19.23. After all that computing, +the @code{list-for-graph} had this value: + +@smallexample +@group +(537 1027 955 785 594 483 349 292 224 199 166 120 116 99 +90 80 67 48 52 45 41 33 28 26 25 20 12 28 11 13 220) +@end group +@end smallexample + +@noindent +This means that my copy of Emacs had 537 function definitions with +fewer than 10 words or symbols in them, 1,027 function definitions +with 10 to 19 words or symbols in them, 955 function definitions with +20 to 29 words or symbols in them, and so on. + +Clearly, just by looking at this list we can see that most function +definitions contain ten to thirty words and symbols. + +Now for printing. We do @emph{not} want to print a graph that is +1,030 lines high @dots{} Instead, we should print a graph that is +fewer than twenty-five lines high. A graph that height can be +displayed on almost any monitor, and easily printed on a sheet of paper. + +This means that each value in @code{list-for-graph} must be reduced to +one-fiftieth its present value. + +Here is a short function to do just that, using two functions we have +not yet seen, @code{mapcar} and @code{lambda}. + +@smallexample +@group +(defun one-fiftieth (full-range) + "Return list, each number one-fiftieth of previous." + (mapcar '(lambda (arg) (/ arg 50)) full-range)) +@end group +@end smallexample + +@node lambda, mapcar, Graphing words in defuns, Print Whole Graph +@appendixsubsec A @code{lambda} Expression: Useful Anonymity +@cindex Anonymous function +@findex lambda + +@code{lambda} is the symbol for an anonymous function, a function +without a name. Every time you use an anonymous function, you need to +include its whole body. + +@need 1250 +@noindent +Thus, + +@smallexample +(lambda (arg) (/ arg 50)) +@end smallexample + +@noindent +is a function definition that says `return the value resulting from +dividing whatever is passed to me as @code{arg} by 50'. + +@need 1200 +Earlier, for example, we had a function @code{multiply-by-seven}; it +multiplied its argument by 7. This function is similar, except it +divides its argument by 50; and, it has no name. The anonymous +equivalent of @code{multiply-by-seven} is: + +@smallexample +(lambda (number) (* 7 number)) +@end smallexample + +@noindent +(@xref{defun, , The @code{defun} Special Form}.) + +@need 1250 +@noindent +If we want to multiply 3 by 7, we can write: + +@c !!! Clear print-postscript-figures if the computer formatting this +@c document is too small and cannot handle all the diagrams and figures. +@c clear print-postscript-figures +@c set print-postscript-figures +@c lambda example diagram #1 +@ifnottex +@smallexample +@group +(multiply-by-seven 3) + \_______________/ ^ + | | + function argument +@end group +@end smallexample +@end ifnottex +@ifset print-postscript-figures +@sp 1 +@tex +@center @image{lambda-1} +%%%% old method of including an image +% \input /usr/local/lib/tex/inputs/psfig.tex +% \centerline{\psfig{figure=/usr/local/lib/emacs/man/lambda-1.eps}} +% \catcode`\@=0 % +@end tex +@sp 1 +@end ifset +@ifclear print-postscript-figures +@iftex +@smallexample +@group +(multiply-by-seven 3) + \_______________/ ^ + | | + function argument +@end group +@end smallexample +@end iftex +@end ifclear + +@noindent +This expression returns 21. + +@need 1250 +@noindent +Similarly, we can write: + +@c lambda example diagram #2 +@ifnottex +@smallexample +@group +((lambda (number) (* 7 number)) 3) + \____________________________/ ^ + | | + anonymous function argument +@end group +@end smallexample +@end ifnottex +@ifset print-postscript-figures +@sp 1 +@tex +@center @image{lambda-2} +%%%% old method of including an image +% \input /usr/local/lib/tex/inputs/psfig.tex +% \centerline{\psfig{figure=/usr/local/lib/emacs/man/lambda-2.eps}} +% \catcode`\@=0 % +@end tex +@sp 1 +@end ifset +@ifclear print-postscript-figures +@iftex +@smallexample +@group +((lambda (number) (* 7 number)) 3) + \____________________________/ ^ + | | + anonymous function argument +@end group +@end smallexample +@end iftex +@end ifclear + +@need 1250 +@noindent +If we want to divide 100 by 50, we can write: + +@c lambda example diagram #3 +@ifnottex +@smallexample +@group +((lambda (arg) (/ arg 50)) 100) + \______________________/ \_/ + | | + anonymous function argument +@end group +@end smallexample +@end ifnottex +@ifset print-postscript-figures +@sp 1 +@tex +@center @image{lambda-3} +%%%% old method of including an image +% \input /usr/local/lib/tex/inputs/psfig.tex +% \centerline{\psfig{figure=/usr/local/lib/emacs/man/lambda-3.eps}} +% \catcode`\@=0 % +@end tex +@sp 1 +@end ifset +@ifclear print-postscript-figures +@iftex +@smallexample +@group +((lambda (arg) (/ arg 50)) 100) + \______________________/ \_/ + | | + anonymous function argument +@end group +@end smallexample +@end iftex +@end ifclear + +@noindent +This expression returns 2. The 100 is passed to the function, which +divides that number by 50. + +@xref{Lambda Expressions, , Lambda Expressions, elisp, The GNU Emacs +Lisp Reference Manual}, for more about @code{lambda}. Lisp and lambda +expressions derive from the Lambda Calculus. + +@node mapcar, Another Bug, lambda, Print Whole Graph +@appendixsubsec The @code{mapcar} Function +@findex mapcar + +@code{mapcar} is a function that calls its first argument with each +element of its second argument, in turn. The second argument must be +a sequence. + +The @samp{map} part of the name comes from the mathematical phrase, +`mapping over a domain', meaning to apply a function to each of the +elements in a domain. The mathematical phrase is based on the +metaphor of a surveyor walking, one step at a time, over an area he is +mapping. And @samp{car}, of course, comes from the Lisp notion of the +first of a list. + +@need 1250 +@noindent +For example, + +@smallexample +@group +(mapcar '1+ '(2 4 6)) + @result{} (3 5 7) +@end group +@end smallexample + +@noindent +The function @code{1+} which adds one to its argument, is executed on +@emph{each} element of the list, and a new list is returned. + +Contrast this with @code{apply}, which applies its first argument to +all the remaining. +(@xref{Readying a Graph, , Readying a Graph}, for a explanation of +@code{apply}.) + +@need 1250 +In the definition of @code{one-fiftieth}, the first argument is the +anonymous function: + +@smallexample +(lambda (arg) (/ arg 50)) +@end smallexample + +@noindent +and the second argument is @code{full-range}, which will be bound to +@code{list-for-graph}. + +@need 1250 +The whole expression looks like this: + +@smallexample +(mapcar '(lambda (arg) (/ arg 50)) full-range)) +@end smallexample + +@xref{Mapping Functions, , Mapping Functions, elisp, The GNU Emacs +Lisp Reference Manual}, for more about @code{mapcar}. + +Using the @code{one-fiftieth} function, we can generate a list in +which each element is one-fiftieth the size of the corresponding +element in @code{list-for-graph}. + +@smallexample +@group +(setq fiftieth-list-for-graph + (one-fiftieth list-for-graph)) +@end group +@end smallexample + +@need 1250 +The resulting list looks like this: + +@smallexample +@group +(10 20 19 15 11 9 6 5 4 3 3 2 2 +1 1 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 4) +@end group +@end smallexample + +@noindent +This, we are almost ready to print! (We also notice the loss of +information: many of the higher ranges are 0, meaning that fewer than +50 defuns had that many words or symbols---but not necessarily meaning +that none had that many words or symbols.) + +@node Another Bug, Final printed graph, mapcar, Print Whole Graph +@appendixsubsec Another Bug @dots{} Most Insidious +@cindex Bug, most insidious type +@cindex Insidious type of bug + +I said `almost ready to print'! Of course, there is a bug in the +@code{print-graph} function @dots{} It has a @code{vertical-step} +option, but not a @code{horizontal-step} option. The +@code{top-of-range} scale goes from 10 to 300 by tens. But the +@code{print-graph} function will print only by ones. + +This is a classic example of what some consider the most insidious +type of bug, the bug of omission. This is not the kind of bug you can +find by studying the code, for it is not in the code; it is an omitted +feature. Your best actions are to try your program early and often; +and try to arrange, as much as you can, to write code that is easy to +understand and easy to change. Try to be aware, whenever you can, +that whatever you have written, @emph{will} be rewritten, if not soon, +eventually. A hard maxim to follow. + +It is the @code{print-X-axis-numbered-line} function that needs the +work; and then the @code{print-X-axis} and the @code{print-graph} +functions need to be adapted. Not much needs to be done; there is one +nicety: the numbers ought to line up under the tic marks. This takes +a little thought. + +@need 1250 +Here is the corrected @code{print-X-axis-numbered-line}: + +@smallexample +@group +(defun print-X-axis-numbered-line + (number-of-X-tics X-axis-leading-spaces + &optional horizontal-step) + "Print line of X-axis numbers" + (let ((number X-axis-label-spacing) + (horizontal-step (or horizontal-step 1))) +@end group +@group + (insert X-axis-leading-spaces) + ;; @r{Delete extra leading spaces.} + (delete-char + (- (1- + (length (number-to-string horizontal-step))))) + (insert (concat + (make-string +@end group +@group + ;; @r{Insert white space.} + (- (* symbol-width + X-axis-label-spacing) + (1- + (length + (number-to-string horizontal-step))) + 2) + ? ) + (number-to-string + (* number horizontal-step)))) +@end group +@group + ;; @r{Insert remaining numbers.} + (setq number (+ number X-axis-label-spacing)) + (while (> number-of-X-tics 1) + (insert (X-axis-element + (* number horizontal-step))) + (setq number (+ number X-axis-label-spacing)) + (setq number-of-X-tics (1- number-of-X-tics))))) +@end group +@end smallexample + +@need 1500 +If you are reading this in Info, you can see the new versions of +@code{print-X-axis} @code{print-graph} and evaluate them. If you are +reading this in a printed book, you can see the changed lines here +(the full text is too much to print). + +@iftex +@smallexample +@group +(defun print-X-axis (numbers-list horizontal-step) + @dots{} + (print-X-axis-numbered-line + tic-number leading-spaces horizontal-step)) +@end group +@end smallexample + +@smallexample +@group +(defun print-graph + (numbers-list + &optional vertical-step horizontal-step) + @dots{} + (print-X-axis numbers-list horizontal-step)) +@end group +@end smallexample +@end iftex + +@ifnottex +@smallexample +@group +(defun print-X-axis (numbers-list horizontal-step) + "Print X axis labels to length of NUMBERS-LIST. +Optionally, HORIZONTAL-STEP, a positive integer, +specifies how much an X axis label increments for +each column." +@end group +@group +;; Value of symbol-width and full-Y-label-width +;; are passed by `print-graph'. + (let* ((leading-spaces + (make-string full-Y-label-width ? )) + ;; symbol-width @r{is provided by} graph-body-print + (tic-width (* symbol-width X-axis-label-spacing)) + (X-length (length numbers-list)) +@end group +@group + (X-tic + (concat + (make-string + ;; @r{Make a string of blanks.} + (- (* symbol-width X-axis-label-spacing) + (length X-axis-tic-symbol)) + ? ) +@end group +@group + ;; @r{Concatenate blanks with tic symbol.} + X-axis-tic-symbol)) + (tic-number + (if (zerop (% X-length tic-width)) + (/ X-length tic-width) + (1+ (/ X-length tic-width))))) +@end group + +@group + (print-X-axis-tic-line + tic-number leading-spaces X-tic) + (insert "\n") + (print-X-axis-numbered-line + tic-number leading-spaces horizontal-step))) +@end group +@end smallexample + +@smallexample +@group +(defun print-graph + (numbers-list &optional vertical-step horizontal-step) + "Print labelled bar graph of the NUMBERS-LIST. +The numbers-list consists of the Y-axis values. +@end group + +@group +Optionally, VERTICAL-STEP, a positive integer, +specifies how much a Y axis label increments for +each line. For example, a step of 5 means that +each row is five units. +@end group + +@group +Optionally, HORIZONTAL-STEP, a positive integer, +specifies how much an X axis label increments for +each column." + (let* ((symbol-width (length graph-blank)) + ;; @code{height} @r{is both the largest number} + ;; @r{and the number with the most digits.} + (height (apply 'max numbers-list)) +@end group +@group + (height-of-top-line + (if (zerop (% height Y-axis-label-spacing)) + height + ;; @r{else} + (* (1+ (/ height Y-axis-label-spacing)) + Y-axis-label-spacing))) +@end group +@group + (vertical-step (or vertical-step 1)) + (full-Y-label-width + (length + (concat + (number-to-string + (* height-of-top-line vertical-step)) + Y-axis-tic)))) +@end group +@group + (print-Y-axis + height-of-top-line full-Y-label-width vertical-step) + (graph-body-print + numbers-list height-of-top-line symbol-width) + (print-X-axis numbers-list horizontal-step))) +@end group +@end smallexample +@end ifnottex + +@c qqq +@ignore +Graphing Definitions Re-listed + +@need 1250 +Here are all the graphing definitions in their final form: + +@smallexample +@group +(defvar top-of-ranges + '(10 20 30 40 50 + 60 70 80 90 100 + 110 120 130 140 150 + 160 170 180 190 200 + 210 220 230 240 250) + "List specifying ranges for `defuns-per-range'.") +@end group + +@group +(defvar graph-symbol "*" + "String used as symbol in graph, usually an asterisk.") +@end group + +@group +(defvar graph-blank " " + "String used as blank in graph, usually a blank space. +graph-blank must be the same number of columns wide +as graph-symbol.") +@end group + +@group +(defvar Y-axis-tic " - " + "String that follows number in a Y axis label.") +@end group + +@group +(defvar Y-axis-label-spacing 5 + "Number of lines from one Y axis label to next.") +@end group + +@group +(defvar X-axis-tic-symbol "|" + "String to insert to point to a column in X axis.") +@end group + +@group +(defvar X-axis-label-spacing + (if (boundp 'graph-blank) + (* 5 (length graph-blank)) 5) + "Number of units from one X axis label to next.") +@end group +@end smallexample + +@smallexample +@group +(defun count-words-in-defun () + "Return the number of words and symbols in a defun." + (beginning-of-defun) + (let ((count 0) + (end (save-excursion (end-of-defun) (point)))) +@end group + +@group + (while + (and (< (point) end) + (re-search-forward + "\\(\\w\\|\\s_\\)+[^ \t\n]*[ \t\n]*" + end t)) + (setq count (1+ count))) + count)) +@end group +@end smallexample + +@smallexample +@group +(defun lengths-list-file (filename) + "Return list of definitions' lengths within FILE. +The returned list is a list of numbers. +Each number is the number of words or +symbols in one function definition." +@end group + +@group + (message "Working on `%s' ... " filename) + (save-excursion + (let ((buffer (find-file-noselect filename)) + (lengths-list)) + (set-buffer buffer) + (setq buffer-read-only t) + (widen) + (goto-char (point-min)) +@end group + +@group + (while (re-search-forward "^(defun" nil t) + (setq lengths-list + (cons (count-words-in-defun) lengths-list))) + (kill-buffer buffer) + lengths-list))) +@end group +@end smallexample + +@smallexample +@group +(defun lengths-list-many-files (list-of-files) + "Return list of lengths of defuns in LIST-OF-FILES." + (let (lengths-list) +;;; @r{true-or-false-test} + (while list-of-files + (setq lengths-list + (append + lengths-list +@end group +@group +;;; @r{Generate a lengths' list.} + (lengths-list-file + (expand-file-name (car list-of-files))))) +;;; @r{Make files' list shorter.} + (setq list-of-files (cdr list-of-files))) +;;; @r{Return final value of lengths' list.} + lengths-list)) +@end group +@end smallexample + +@smallexample +@group +(defun defuns-per-range (sorted-lengths top-of-ranges) + "SORTED-LENGTHS defuns in each TOP-OF-RANGES range." + (let ((top-of-range (car top-of-ranges)) + (number-within-range 0) + defuns-per-range-list) +@end group + +@group + ;; @r{Outer loop.} + (while top-of-ranges + + ;; @r{Inner loop.} + (while (and + ;; @r{Need number for numeric test.} + (car sorted-lengths) + (< (car sorted-lengths) top-of-range)) + + ;; @r{Count number of definitions within current range.} + (setq number-within-range (1+ number-within-range)) + (setq sorted-lengths (cdr sorted-lengths))) +@end group + +@group + ;; @r{Exit inner loop but remain within outer loop.} + + (setq defuns-per-range-list + (cons number-within-range defuns-per-range-list)) + (setq number-within-range 0) ; @r{Reset count to zero.} + + ;; @r{Move to next range.} + (setq top-of-ranges (cdr top-of-ranges)) + ;; @r{Specify next top of range value.} + (setq top-of-range (car top-of-ranges))) +@end group + +@group + ;; @r{Exit outer loop and count the number of defuns larger than} + ;; @r{ the largest top-of-range value.} + (setq defuns-per-range-list + (cons + (length sorted-lengths) + defuns-per-range-list)) + + ;; @r{Return a list of the number of definitions within each range,} + ;; @r{ smallest to largest.} + (nreverse defuns-per-range-list))) +@end group +@end smallexample + +@smallexample +@group +(defun column-of-graph (max-graph-height actual-height) + "Return list of MAX-GRAPH-HEIGHT strings; +ACTUAL-HEIGHT are graph-symbols. +The graph-symbols are contiguous entries at the end +of the list. +The list will be inserted as one column of a graph. +The strings are either graph-blank or graph-symbol." +@end group + +@group + (let ((insert-list nil) + (number-of-top-blanks + (- max-graph-height actual-height))) + + ;; @r{Fill in @code{graph-symbols}.} + (while (> actual-height 0) + (setq insert-list (cons graph-symbol insert-list)) + (setq actual-height (1- actual-height))) +@end group + +@group + ;; @r{Fill in @code{graph-blanks}.} + (while (> number-of-top-blanks 0) + (setq insert-list (cons graph-blank insert-list)) + (setq number-of-top-blanks + (1- number-of-top-blanks))) + + ;; @r{Return whole list.} + insert-list)) +@end group +@end smallexample + +@smallexample +@group +(defun Y-axis-element (number full-Y-label-width) + "Construct a NUMBERed label element. +A numbered element looks like this ` 5 - ', +and is padded as needed so all line up with +the element for the largest number." +@end group +@group + (let* ((leading-spaces + (- full-Y-label-width + (length + (concat (number-to-string number) + Y-axis-tic))))) +@end group +@group + (concat + (make-string leading-spaces ? ) + (number-to-string number) + Y-axis-tic))) +@end group +@end smallexample + +@smallexample +@group +(defun print-Y-axis + (height full-Y-label-width &optional vertical-step) + "Insert Y axis by HEIGHT and FULL-Y-LABEL-WIDTH. +Height must be the maximum height of the graph. +Full width is the width of the highest label element. +Optionally, print according to VERTICAL-STEP." +@end group +@group +;; Value of height and full-Y-label-width +;; are passed by `print-graph'. + (let ((start (point))) + (insert-rectangle + (Y-axis-column height full-Y-label-width vertical-step)) +@end group +@group + ;; @r{Place point ready for inserting graph.} + (goto-char start) + ;; @r{Move point forward by value of} full-Y-label-width + (forward-char full-Y-label-width))) +@end group +@end smallexample + +@smallexample +@group +(defun print-X-axis-tic-line + (number-of-X-tics X-axis-leading-spaces X-axis-tic-element) + "Print ticks for X axis." + (insert X-axis-leading-spaces) + (insert X-axis-tic-symbol) ; @r{Under first column.} +@end group +@group + ;; @r{Insert second tic in the right spot.} + (insert (concat + (make-string + (- (* symbol-width X-axis-label-spacing) + ;; @r{Insert white space up to second tic symbol.} + (* 2 (length X-axis-tic-symbol))) + ? ) + X-axis-tic-symbol)) +@end group +@group + ;; @r{Insert remaining ticks.} + (while (> number-of-X-tics 1) + (insert X-axis-tic-element) + (setq number-of-X-tics (1- number-of-X-tics)))) +@end group +@end smallexample + +@smallexample +@group +(defun X-axis-element (number) + "Construct a numbered X axis element." + (let ((leading-spaces + (- (* symbol-width X-axis-label-spacing) + (length (number-to-string number))))) + (concat (make-string leading-spaces ? ) + (number-to-string number)))) +@end group +@end smallexample + +@smallexample +@group +(defun graph-body-print (numbers-list height symbol-width) + "Print a bar graph of the NUMBERS-LIST. +The numbers-list consists of the Y-axis values. +HEIGHT is maximum height of graph. +SYMBOL-WIDTH is number of each column." +@end group +@group + (let (from-position) + (while numbers-list + (setq from-position (point)) + (insert-rectangle + (column-of-graph height (car numbers-list))) + (goto-char from-position) + (forward-char symbol-width) +@end group +@group + ;; @r{Draw graph column by column.} + (sit-for 0) + (setq numbers-list (cdr numbers-list))) + ;; @r{Place point for X axis labels.} + (forward-line height) + (insert "\n"))) +@end group +@end smallexample + +@smallexample +@group +(defun Y-axis-column + (height width-of-label &optional vertical-step) + "Construct list of labels for Y axis. +HEIGHT is maximum height of graph. +WIDTH-OF-LABEL is maximum width of label. +@end group +@group +VERTICAL-STEP, an option, is a positive integer +that specifies how much a Y axis label increments +for each line. For example, a step of 5 means +that each line is five units of the graph." + (let (Y-axis + (number-per-line (or vertical-step 1))) +@end group +@group + (while (> height 1) + (if (zerop (% height Y-axis-label-spacing)) + ;; @r{Insert label.} + (setq Y-axis + (cons + (Y-axis-element + (* height number-per-line) + width-of-label) + Y-axis)) +@end group +@group + ;; @r{Else, insert blanks.} + (setq Y-axis + (cons + (make-string width-of-label ? ) + Y-axis))) + (setq height (1- height))) +@end group +@group + ;; @r{Insert base line.} + (setq Y-axis (cons (Y-axis-element + (or vertical-step 1) + width-of-label) + Y-axis)) + (nreverse Y-axis))) +@end group +@end smallexample + +@smallexample +@group +(defun print-X-axis-numbered-line + (number-of-X-tics X-axis-leading-spaces + &optional horizontal-step) + "Print line of X-axis numbers" + (let ((number X-axis-label-spacing) + (horizontal-step (or horizontal-step 1))) +@end group +@group + (insert X-axis-leading-spaces) + ;; line up number + (delete-char (- (1- (length (number-to-string horizontal-step))))) + (insert (concat + (make-string + ;; @r{Insert white space up to next number.} + (- (* symbol-width X-axis-label-spacing) + (1- (length (number-to-string horizontal-step))) + 2) + ? ) + (number-to-string (* number horizontal-step)))) +@end group +@group + ;; @r{Insert remaining numbers.} + (setq number (+ number X-axis-label-spacing)) + (while (> number-of-X-tics 1) + (insert (X-axis-element (* number horizontal-step))) + (setq number (+ number X-axis-label-spacing)) + (setq number-of-X-tics (1- number-of-X-tics))))) +@end group +@end smallexample + +@smallexample +@group +(defun print-X-axis (numbers-list horizontal-step) + "Print X axis labels to length of NUMBERS-LIST. +Optionally, HORIZONTAL-STEP, a positive integer, +specifies how much an X axis label increments for +each column." +@end group +@group +;; Value of symbol-width and full-Y-label-width +;; are passed by `print-graph'. + (let* ((leading-spaces + (make-string full-Y-label-width ? )) + ;; symbol-width @r{is provided by} graph-body-print + (tic-width (* symbol-width X-axis-label-spacing)) + (X-length (length numbers-list)) +@end group +@group + (X-tic + (concat + (make-string + ;; @r{Make a string of blanks.} + (- (* symbol-width X-axis-label-spacing) + (length X-axis-tic-symbol)) + ? ) +@end group +@group + ;; @r{Concatenate blanks with tic symbol.} + X-axis-tic-symbol)) + (tic-number + (if (zerop (% X-length tic-width)) + (/ X-length tic-width) + (1+ (/ X-length tic-width))))) +@end group + +@group + (print-X-axis-tic-line + tic-number leading-spaces X-tic) + (insert "\n") + (print-X-axis-numbered-line + tic-number leading-spaces horizontal-step))) +@end group +@end smallexample + +@smallexample +@group +(defun one-fiftieth (full-range) + "Return list, each number of which is 1/50th previous." + (mapcar '(lambda (arg) (/ arg 50)) full-range)) +@end group +@end smallexample + +@smallexample +@group +(defun print-graph + (numbers-list &optional vertical-step horizontal-step) + "Print labelled bar graph of the NUMBERS-LIST. +The numbers-list consists of the Y-axis values. +@end group + +@group +Optionally, VERTICAL-STEP, a positive integer, +specifies how much a Y axis label increments for +each line. For example, a step of 5 means that +each row is five units. +@end group + +@group +Optionally, HORIZONTAL-STEP, a positive integer, +specifies how much an X axis label increments for +each column." + (let* ((symbol-width (length graph-blank)) + ;; @code{height} @r{is both the largest number} + ;; @r{and the number with the most digits.} + (height (apply 'max numbers-list)) +@end group +@group + (height-of-top-line + (if (zerop (% height Y-axis-label-spacing)) + height + ;; @r{else} + (* (1+ (/ height Y-axis-label-spacing)) + Y-axis-label-spacing))) +@end group +@group + (vertical-step (or vertical-step 1)) + (full-Y-label-width + (length + (concat + (number-to-string + (* height-of-top-line vertical-step)) + Y-axis-tic)))) +@end group +@group + + (print-Y-axis + height-of-top-line full-Y-label-width vertical-step) + (graph-body-print + numbers-list height-of-top-line symbol-width) + (print-X-axis numbers-list horizontal-step))) +@end group +@end smallexample +@c qqq +@end ignore + +@page +@node Final printed graph, , Another Bug, Print Whole Graph +@appendixsubsec The Printed Graph + +When made and installed, you can call the @code{print-graph} command +like this: +@sp 1 + +@smallexample +@group +(print-graph fiftieth-list-for-graph 50 10) +@end group +@end smallexample +@sp 1 + +@noindent +Here is the graph: +@sp 2 + +@smallexample +@group +1000 - * + ** + ** + ** + ** + 750 - *** + *** + *** + *** + **** + 500 - ***** + ****** + ****** + ****** + ******* + 250 - ******** + ********* * + *********** * + ************* * + 50 - ***************** * * + | | | | | | | | + 10 50 100 150 200 250 300 350 +@end group +@end smallexample + +@sp 2 + +@noindent +The largest group of functions contain 10 -- 19 words and symbols each. + +@node Free Software and Free Manuals, GNU Free Documentation License, Full Graph, Top +@appendix Free Software and Free Manuals + +@strong{by Richard M. Stallman} +@sp 1 + +The biggest deficiency in free operating systems is not in the +software---it is the lack of good free manuals that we can include in +these systems. Many of our most important programs do not come with +full manuals. Documentation is an essential part of any software +package; when an important free software package does not come with a +free manual, that is a major gap. We have many such gaps today. + +Once upon a time, many years ago, I thought I would learn Perl. I got +a copy of a free manual, but I found it hard to read. When I asked +Perl users about alternatives, they told me that there were better +introductory manuals---but those were not free. + +Why was this? The authors of the good manuals had written them for +O'Reilly Associates, which published them with restrictive terms---no +copying, no modification, source files not available---which exclude +them from the free software community. + +That wasn't the first time this sort of thing has happened, and (to +our community's great loss) it was far from the last. Proprietary +manual publishers have enticed a great many authors to restrict their +manuals since then. Many times I have heard a GNU user eagerly tell me +about a manual that he is writing, with which he expects to help the +GNU project---and then had my hopes dashed, as he proceeded to explain +that he had signed a contract with a publisher that would restrict it +so that we cannot use it. + +Given that writing good English is a rare skill among programmers, we +can ill afford to lose manuals this way. + +@c (texinfo)uref +(The Free Software Foundation +@uref{http://www.gnu.org/doc/doc.html#DescriptionsOfGNUDocumentation, , +sells printed copies} of free @uref{http://www.gnu.org/doc/doc.html, +GNU manuals}, too.) + +Free documentation, like free software, is a matter of freedom, not +price. The problem with these manuals was not that O'Reilly Associates +charged a price for printed copies---that in itself is fine. (The Free +Software Foundation sells printed copies of free GNU manuals, too.) +But GNU manuals are available in source code form, while these manuals +are available only on paper. GNU manuals come with permission to copy +and modify; the Perl manuals do not. These restrictions are the +problems. + +The criterion for a free manual is pretty much the same as for free +software: it is a matter of giving all users certain +freedoms. Redistribution (including commercial redistribution) must be +permitted, so that the manual can accompany every copy of the program, +on-line or on paper. Permission for modification is crucial too. + +As a general rule, I don't believe that it is essential for people to +have permission to modify all sorts of articles and books. The issues +for writings are not necessarily the same as those for software. For +example, I don't think you or I are obliged to give permission to +modify articles like this one, which describe our actions and our +views. + +But there is a particular reason why the freedom to modify is crucial +for documentation for free software. When people exercise their right +to modify the software, and add or change its features, if they are +conscientious they will change the manual too---so they can provide +accurate and usable documentation with the modified program. A manual +which forbids programmers to be conscientious and finish the job, or +more precisely requires them to write a new manual from scratch if +they change the program, does not fill our community's needs. + +While a blanket prohibition on modification is unacceptable, some +kinds of limits on the method of modification pose no problem. For +example, requirements to preserve the original author's copyright +notice, the distribution terms, or the list of authors, are ok. It is +also no problem to require modified versions to include notice that +they were modified, even to have entire sections that may not be +deleted or changed, as long as these sections deal with nontechnical +topics. (Some GNU manuals have them.) + +These kinds of restrictions are not a problem because, as a practical +matter, they don't stop the conscientious programmer from adapting the +manual to fit the modified program. In other words, they don't block +the free software community from making full use of the manual. + +However, it must be possible to modify all the technical content of +the manual, and then distribute the result in all the usual media, +through all the usual channels; otherwise, the restrictions do block +the community, the manual is not free, and so we need another manual. + +Unfortunately, it is often hard to find someone to write another +manual when a proprietary manual exists. The obstacle is that many +users think that a proprietary manual is good enough---so they don't +see the need to write a free manual. They do not see that the free +operating system has a gap that needs filling. + +Why do users think that proprietary manuals are good enough? Some have +not considered the issue. I hope this article will do something to +change that. + +Other users consider proprietary manuals acceptable for the same +reason so many people consider proprietary software acceptable: they +judge in purely practical terms, not using freedom as a +criterion. These people are entitled to their opinions, but since +those opinions spring from values which do not include freedom, they +are no guide for those of us who do value freedom. + +Please spread the word about this issue. We continue to lose manuals +to proprietary publishing. If we spread the word that proprietary +manuals are not sufficient, perhaps the next person who wants to help +GNU by writing documentation will realize, before it is too late, that +he must above all make it free. + +We can also encourage commercial publishers to sell free, copylefted +manuals instead of proprietary ones. One way you can help this is to +check the distribution terms of a manual before you buy it, and prefer +copylefted manuals to non-copylefted ones. + +@sp 2 +@noindent +Note: The Free Software Foundation maintains a page on its Web site +that lists free books available from other publishers:@* +@uref{http://www.gnu.org/doc/other-free-books.html} + +@node GNU Free Documentation License, Index, Free Software and Free Manuals, Top +@appendix GNU Free Documentation License + +@cindex FDL, GNU Free Documentation License +@center Version 1.2, November 2002 + +@display +Copyright @copyright{} 2000,2001,2002 Free Software Foundation, Inc. +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. +@end display + +@enumerate 0 +@item +PREAMBLE + +The purpose of this License is to make a manual, textbook, or other +functional and useful document @dfn{free} in the sense of freedom: to +assure everyone the effective freedom to copy and redistribute it, +with or without modifying it, either commercially or noncommercially. +Secondarily, this License preserves for the author and publisher a way +to get credit for their work, while not being considered responsible +for modifications made by others. + +This License is a kind of ``copyleft'', which means that derivative +works of the document must themselves be free in the same sense. It +complements the GNU General Public License, which is a copyleft +license designed for free software. + +We have designed this License in order to use it for manuals for free +software, because free software needs free documentation: a free +program should come with manuals providing the same freedoms that the +software does. But this License is not limited to software manuals; +it can be used for any textual work, regardless of subject matter or +whether it is published as a printed book. We recommend this License +principally for works whose purpose is instruction or reference. + +@item +APPLICABILITY AND DEFINITIONS + +This License applies to any manual or other work, in any medium, that +contains a notice placed by the copyright holder saying it can be +distributed under the terms of this License. Such a notice grants a +world-wide, royalty-free license, unlimited in duration, to use that +work under the conditions stated herein. The ``Document'', below, +refers to any such manual or work. Any member of the public is a +licensee, and is addressed as ``you''. You accept the license if you +copy, modify or distribute the work in a way requiring permission +under copyright law. + +A ``Modified Version'' of the Document means any work containing the +Document or a portion of it, either copied verbatim, or with +modifications and/or translated into another language. + +A ``Secondary Section'' is a named appendix or a front-matter section +of the Document that deals exclusively with the relationship of the +publishers or authors of the Document to the Document's overall +subject (or to related matters) and contains nothing that could fall +directly within that overall subject. (Thus, if the Document is in +part a textbook of mathematics, a Secondary Section may not explain +any mathematics.) The relationship could be a matter of historical +connection with the subject or with related matters, or of legal, +commercial, philosophical, ethical or political position regarding +them. + +The ``Invariant Sections'' are certain Secondary Sections whose titles +are designated, as being those of Invariant Sections, in the notice +that says that the Document is released under this License. If a +section does not fit the above definition of Secondary then it is not +allowed to be designated as Invariant. The Document may contain zero +Invariant Sections. If the Document does not identify any Invariant +Sections then there are none. + +The ``Cover Texts'' are certain short passages of text that are listed, +as Front-Cover Texts or Back-Cover Texts, in the notice that says that +the Document is released under this License. A Front-Cover Text may +be at most 5 words, and a Back-Cover Text may be at most 25 words. + +A ``Transparent'' copy of the Document means a machine-readable copy, +represented in a format whose specification is available to the +general public, that is suitable for revising the document +straightforwardly with generic text editors or (for images composed of +pixels) generic paint programs or (for drawings) some widely available +drawing editor, and that is suitable for input to text formatters or +for automatic translation to a variety of formats suitable for input +to text formatters. A copy made in an otherwise Transparent file +format whose markup, or absence of markup, has been arranged to thwart +or discourage subsequent modification by readers is not Transparent. +An image format is not Transparent if used for any substantial amount +of text. A copy that is not ``Transparent'' is called ``Opaque''. + +Examples of suitable formats for Transparent copies include plain +@sc{ascii} without markup, Texinfo input format, La@TeX{} input +format, @acronym{SGML} or @acronym{XML} using a publicly available +@acronym{DTD}, and standard-conforming simple @acronym{HTML}, +PostScript or @acronym{PDF} designed for human modification. Examples +of transparent image formats include @acronym{PNG}, @acronym{XCF} and +@acronym{JPG}. Opaque formats include proprietary formats that can be +read and edited only by proprietary word processors, @acronym{SGML} or +@acronym{XML} for which the @acronym{DTD} and/or processing tools are +not generally available, and the machine-generated @acronym{HTML}, +PostScript or @acronym{PDF} produced by some word processors for +output purposes only. + +The ``Title Page'' means, for a printed book, the title page itself, +plus such following pages as are needed to hold, legibly, the material +this License requires to appear in the title page. For works in +formats which do not have any title page as such, ``Title Page'' means +the text near the most prominent appearance of the work's title, +preceding the beginning of the body of the text. + +A section ``Entitled XYZ'' means a named subunit of the Document whose +title either is precisely XYZ or contains XYZ in parentheses following +text that translates XYZ in another language. (Here XYZ stands for a +specific section name mentioned below, such as ``Acknowledgements'', +``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title'' +of such a section when you modify the Document means that it remains a +section ``Entitled XYZ'' according to this definition. + +The Document may include Warranty Disclaimers next to the notice which +states that this License applies to the Document. These Warranty +Disclaimers are considered to be included by reference in this +License, but only as regards disclaiming warranties: any other +implication that these Warranty Disclaimers may have is void and has +no effect on the meaning of this License. + +@item +VERBATIM COPYING + +You may copy and distribute the Document in any medium, either +commercially or noncommercially, provided that this License, the +copyright notices, and the license notice saying this License applies +to the Document are reproduced in all copies, and that you add no other +conditions whatsoever to those of this License. You may not use +technical measures to obstruct or control the reading or further +copying of the copies you make or distribute. However, you may accept +compensation in exchange for copies. If you distribute a large enough +number of copies you must also follow the conditions in section 3. + +You may also lend copies, under the same conditions stated above, and +you may publicly display copies. + +@item +COPYING IN QUANTITY + +If you publish printed copies (or copies in media that commonly have +printed covers) of the Document, numbering more than 100, and the +Document's license notice requires Cover Texts, you must enclose the +copies in covers that carry, clearly and legibly, all these Cover +Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on +the back cover. Both covers must also clearly and legibly identify +you as the publisher of these copies. The front cover must present +the full title with all words of the title equally prominent and +visible. You may add other material on the covers in addition. +Copying with changes limited to the covers, as long as they preserve +the title of the Document and satisfy these conditions, can be treated +as verbatim copying in other respects. + +If the required texts for either cover are too voluminous to fit +legibly, you should put the first ones listed (as many as fit +reasonably) on the actual cover, and continue the rest onto adjacent +pages. + +If you publish or distribute Opaque copies of the Document numbering +more than 100, you must either include a machine-readable Transparent +copy along with each Opaque copy, or state in or with each Opaque copy +a computer-network location from which the general network-using +public has access to download using public-standard network protocols +a complete Transparent copy of the Document, free of added material. +If you use the latter option, you must take reasonably prudent steps, +when you begin distribution of Opaque copies in quantity, to ensure +that this Transparent copy will remain thus accessible at the stated +location until at least one year after the last time you distribute an +Opaque copy (directly or through your agents or retailers) of that +edition to the public. + +It is requested, but not required, that you contact the authors of the +Document well before redistributing any large number of copies, to give +them a chance to provide you with an updated version of the Document. + +@item +MODIFICATIONS + +You may copy and distribute a Modified Version of the Document under +the conditions of sections 2 and 3 above, provided that you release +the Modified Version under precisely this License, with the Modified +Version filling the role of the Document, thus licensing distribution +and modification of the Modified Version to whoever possesses a copy +of it. In addition, you must do these things in the Modified Version: + +@enumerate A +@item +Use in the Title Page (and on the covers, if any) a title distinct +from that of the Document, and from those of previous versions +(which should, if there were any, be listed in the History section +of the Document). You may use the same title as a previous version +if the original publisher of that version gives permission. + +@item +List on the Title Page, as authors, one or more persons or entities +responsible for authorship of the modifications in the Modified +Version, together with at least five of the principal authors of the +Document (all of its principal authors, if it has fewer than five), +unless they release you from this requirement. + +@item +State on the Title page the name of the publisher of the +Modified Version, as the publisher. + +@item +Preserve all the copyright notices of the Document. + +@item +Add an appropriate copyright notice for your modifications +adjacent to the other copyright notices. + +@item +Include, immediately after the copyright notices, a license notice +giving the public permission to use the Modified Version under the +terms of this License, in the form shown in the Addendum below. + +@item +Preserve in that license notice the full lists of Invariant Sections +and required Cover Texts given in the Document's license notice. + +@item +Include an unaltered copy of this License. + +@item +Preserve the section Entitled ``History'', Preserve its Title, and add +to it an item stating at least the title, year, new authors, and +publisher of the Modified Version as given on the Title Page. If +there is no section Entitled ``History'' in the Document, create one +stating the title, year, authors, and publisher of the Document as +given on its Title Page, then add an item describing the Modified +Version as stated in the previous sentence. + +@item +Preserve the network location, if any, given in the Document for +public access to a Transparent copy of the Document, and likewise +the network locations given in the Document for previous versions +it was based on. These may be placed in the ``History'' section. +You may omit a network location for a work that was published at +least four years before the Document itself, or if the original +publisher of the version it refers to gives permission. + +@item +For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve +the Title of the section, and preserve in the section all the +substance and tone of each of the contributor acknowledgements and/or +dedications given therein. + +@item +Preserve all the Invariant Sections of the Document, +unaltered in their text and in their titles. Section numbers +or the equivalent are not considered part of the section titles. + +@item +Delete any section Entitled ``Endorsements''. Such a section +may not be included in the Modified Version. + +@item +Do not retitle any existing section to be Entitled ``Endorsements'' or +to conflict in title with any Invariant Section. + +@item +Preserve any Warranty Disclaimers. +@end enumerate + +If the Modified Version includes new front-matter sections or +appendices that qualify as Secondary Sections and contain no material +copied from the Document, you may at your option designate some or all +of these sections as invariant. To do this, add their titles to the +list of Invariant Sections in the Modified Version's license notice. +These titles must be distinct from any other section titles. + +You may add a section Entitled ``Endorsements'', provided it contains +nothing but endorsements of your Modified Version by various +parties---for example, statements of peer review or that the text has +been approved by an organization as the authoritative definition of a +standard. + +You may add a passage of up to five words as a Front-Cover Text, and a +passage of up to 25 words as a Back-Cover Text, to the end of the list +of Cover Texts in the Modified Version. Only one passage of +Front-Cover Text and one of Back-Cover Text may be added by (or +through arrangements made by) any one entity. If the Document already +includes a cover text for the same cover, previously added by you or +by arrangement made by the same entity you are acting on behalf of, +you may not add another; but you may replace the old one, on explicit +permission from the previous publisher that added the old one. + +The author(s) and publisher(s) of the Document do not by this License +give permission to use their names for publicity for or to assert or +imply endorsement of any Modified Version. + +@item +COMBINING DOCUMENTS + +You may combine the Document with other documents released under this +License, under the terms defined in section 4 above for modified +versions, provided that you include in the combination all of the +Invariant Sections of all of the original documents, unmodified, and +list them all as Invariant Sections of your combined work in its +license notice, and that you preserve all their Warranty Disclaimers. + +The combined work need only contain one copy of this License, and +multiple identical Invariant Sections may be replaced with a single +copy. If there are multiple Invariant Sections with the same name but +different contents, make the title of each such section unique by +adding at the end of it, in parentheses, the name of the original +author or publisher of that section if known, or else a unique number. +Make the same adjustment to the section titles in the list of +Invariant Sections in the license notice of the combined work. + +In the combination, you must combine any sections Entitled ``History'' +in the various original documents, forming one section Entitled +``History''; likewise combine any sections Entitled ``Acknowledgements'', +and any sections Entitled ``Dedications''. You must delete all +sections Entitled ``Endorsements.'' + +@item +COLLECTIONS OF DOCUMENTS + +You may make a collection consisting of the Document and other documents +released under this License, and replace the individual copies of this +License in the various documents with a single copy that is included in +the collection, provided that you follow the rules of this License for +verbatim copying of each of the documents in all other respects. + +You may extract a single document from such a collection, and distribute +it individually under this License, provided you insert a copy of this +License into the extracted document, and follow this License in all +other respects regarding verbatim copying of that document. + +@item +AGGREGATION WITH INDEPENDENT WORKS + +A compilation of the Document or its derivatives with other separate +and independent documents or works, in or on a volume of a storage or +distribution medium, is called an ``aggregate'' if the copyright +resulting from the compilation is not used to limit the legal rights +of the compilation's users beyond what the individual works permit. +When the Document is included in an aggregate, this License does not +apply to the other works in the aggregate which are not themselves +derivative works of the Document. + +If the Cover Text requirement of section 3 is applicable to these +copies of the Document, then if the Document is less than one half of +the entire aggregate, the Document's Cover Texts may be placed on +covers that bracket the Document within the aggregate, or the +electronic equivalent of covers if the Document is in electronic form. +Otherwise they must appear on printed covers that bracket the whole +aggregate. + +@item +TRANSLATION + +Translation is considered a kind of modification, so you may +distribute translations of the Document under the terms of section 4. +Replacing Invariant Sections with translations requires special +permission from their copyright holders, but you may include +translations of some or all Invariant Sections in addition to the +original versions of these Invariant Sections. You may include a +translation of this License, and all the license notices in the +Document, and any Warranty Disclaimers, provided that you also include +the original English version of this License and the original versions +of those notices and disclaimers. In case of a disagreement between +the translation and the original version of this License or a notice +or disclaimer, the original version will prevail. + +If a section in the Document is Entitled ``Acknowledgements'', +``Dedications'', or ``History'', the requirement (section 4) to Preserve +its Title (section 1) will typically require changing the actual +title. + +@item +TERMINATION + +You may not copy, modify, sublicense, or distribute the Document except +as expressly provided for under this License. Any other attempt to +copy, modify, sublicense or distribute the Document is void, and will +automatically terminate your rights under this License. However, +parties who have received copies, or rights, from you under this +License will not have their licenses terminated so long as such +parties remain in full compliance. + +@item +FUTURE REVISIONS OF THIS LICENSE + +The Free Software Foundation may publish new, revised versions +of the GNU Free Documentation License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. See +@uref{http://www.gnu.org/copyleft/}. + +Each version of the License is given a distinguishing version number. +If the Document specifies that a particular numbered version of this +License ``or any later version'' applies to it, you have the option of +following the terms and conditions either of that specified version or +of any later version that has been published (not as a draft) by the +Free Software Foundation. If the Document does not specify a version +number of this License, you may choose any version ever published (not +as a draft) by the Free Software Foundation. +@end enumerate + +@page +@appendixsubsec ADDENDUM: How to use this License for your documents + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and +license notices just after the title page: + +@smallexample +@group +Copyright (C) @var{year} @var{your name}. +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.2 +or any later version published by the Free Software Foundation; +with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. +A copy of the license is included in the section entitled ``GNU +Free Documentation License''. +@end group +@end smallexample + +If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, +replace the ``with...Texts.'' line with this: + +@smallexample +@group +with the Invariant Sections being @var{list their titles}, with +the Front-Cover Texts being @var{list}, and with the Back-Cover Texts +being @var{list}. +@end group +@end smallexample + +If you have Invariant Sections without Cover Texts, or some other +combination of the three, merge those two alternatives to suit the +situation. + +If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of +free software license, such as the GNU General Public License, +to permit their use in free software. + +@node Index, About the Author, GNU Free Documentation License, Top +@comment node-name, next, previous, up +@unnumbered Index + +@ignore +MENU ENTRY: NODE NAME. +@end ignore + +@printindex cp + +@iftex +@c Place biographical information on right-hand (verso) page + +@tex +\ifodd\pageno + \par\vfill\supereject + \global\evenheadline={\hfil} \global\evenfootline={\hfil} + \global\oddheadline={\hfil} \global\oddfootline={\hfil} + \page\hbox{}\page +\else + \par\vfill\supereject + \par\vfill\supereject + \global\evenheadline={\hfil} \global\evenfootline={\hfil} + \global\oddheadline={\hfil} \global\oddfootline={\hfil} + \page\hbox{}\page + \page\hbox{}\page +\fi +@end tex + +@page +@w{ } + +@c ================ Biographical information ================ + +@w{ } +@sp 8 +@center About the Author +@sp 1 +@end iftex + +@ifnottex +@node About the Author, , Index, Top +@unnumbered About the Author +@end ifnottex + +@quotation +Robert J. Chassell has worked with GNU Emacs since 1985. He writes +and edits, teaches Emacs and Emacs Lisp, and speaks throughout the +world on software freedom. Chassell was a founding Director and +Treasurer of the Free Software Foundation, Inc. He is co-author of +the @cite{Texinfo} manual, and has edited more than a dozen other +books. He graduated from Cambridge University, in England. He has an +abiding interest in social and economic history and flies his own +airplane. +@end quotation + +@page +@w{ } + +@c Prevent page number on blank verso, so eject it first. +@tex +\par\vfill\supereject +@end tex + +@iftex +@headings off +@evenheading @thispage @| @| @thistitle +@oddheading @| @| @thispage +@end iftex + +@bye + +@ignore + arch-tag: da1a2154-531f-43a8-8e33-fc7faad10acf +@end ignore diff --git a/doc/lispintro/install-sh b/doc/lispintro/install-sh new file mode 100755 index 00000000000..2df3e3b423d --- /dev/null +++ b/doc/lispintro/install-sh @@ -0,0 +1,250 @@ +#!/bin/sh +# +# install - install a program, script, or datafile +# This comes from X11R5 (mit/util/scripts/install.sh). +# +# Copyright 1991 by the Massachusetts Institute of Technology +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation, and that the name of M.I.T. not be used in advertising or +# publicity pertaining to distribution of the software without specific, +# written prior permission. M.I.T. makes no representations about the +# suitability of this software for any purpose. It is provided "as is" +# without express or implied warranty. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. It can only install one file at a time, a restriction +# shared with many OS's install programs. + + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" + + +# put in absolute paths if you don't have them in your path; or use env. vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +transformbasename="" +transform_arg="" +instcmd="$mvprog" +chmodcmd="$chmodprog 0755" +chowncmd="" +chgrpcmd="" +stripcmd="" +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src="" +dst="" +dir_arg="" + +while [ x"$1" != x ]; do + case $1 in + -c) instcmd="$cpprog" + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + -s) stripcmd="$stripprog" + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + *) if [ x"$src" = x ] + then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac +done + +if [ x"$src" = x ] +then + echo "install: no input file specified" + exit 1 +else + true +fi + +if [ x"$dir_arg" != x ]; then + dst=$src + src="" + + if [ -d $dst ]; then + instcmd=: + else + instcmd=mkdir + fi +else + +# Waiting for this to be detected by the "$instcmd $src $dsttmp" command +# might cause directories to be created, which would be especially bad +# if $src (and thus $dsttmp) contains '*'. + + if [ -f $src -o -d $src ] + then + true + else + echo "install: $src does not exist" + exit 1 + fi + + if [ x"$dst" = x ] + then + echo "install: no destination specified" + exit 1 + else + true + fi + +# If destination is a directory, append the input filename; if your system +# does not like double slashes in filenames, you may need to add some logic + + if [ -d $dst ] + then + dst="$dst"/`basename $src` + else + true + fi +fi + +## this sed command emulates the dirname command +dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + +# Make sure that the destination directory exists. +# this part is taken from Noah Friedman's mkinstalldirs script + +# Skip lots of stat calls in the usual case. +if [ ! -d "$dstdir" ]; then +defaultIFS=' +' +IFS="${IFS-${defaultIFS}}" + +oIFS="${IFS}" +# Some sh's can't handle IFS=/ for some reason. +IFS='%' +set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` +IFS="${oIFS}" + +pathcomp='' + +while [ $# -ne 0 ] ; do + pathcomp="${pathcomp}${1}" + shift + + if [ ! -d "${pathcomp}" ] ; + then + $mkdirprog "${pathcomp}" + else + true + fi + + pathcomp="${pathcomp}/" +done +fi + +if [ x"$dir_arg" != x ] +then + $doit $instcmd $dst && + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi +else + +# If we're going to rename the final executable, determine the name now. + + if [ x"$transformarg" = x ] + then + dstfile=`basename $dst` + else + dstfile=`basename $dst $transformbasename | + sed $transformarg`$transformbasename + fi + +# don't allow the sed command to completely eliminate the filename + + if [ x"$dstfile" = x ] + then + dstfile=`basename $dst` + else + true + fi + +# Make a temp file name in the proper directory. + + dsttmp=$dstdir/#inst.$$# + +# Move or copy the file name to the temp name + + $doit $instcmd $src $dsttmp && + + trap "rm -f ${dsttmp}" 0 && + +# and set any options; do chmod last to preserve setuid bits + +# If any of these fail, we abort the whole thing. If we want to +# ignore errors from any of these, just make sure not to ignore +# errors from the above "$doit $instcmd $src $dsttmp" command. + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && + +# Now rename the file to the real destination. + + $doit $rmcmd -f $dstdir/$dstfile && + $doit $mvcmd $dsttmp $dstdir/$dstfile + +fi && + + +exit 0 diff --git a/doc/lispintro/lambda-1.eps b/doc/lispintro/lambda-1.eps new file mode 100644 index 00000000000..5b1b5d04299 --- /dev/null +++ b/doc/lispintro/lambda-1.eps @@ -0,0 +1,471 @@ +%! +%%BoundingBox: 33 710 173 759 +%%Title: lambda-diagram1 +%%CreationDate: Wed Mar 8 14:31:53 1995 +%%Creator: Tgif-2.16-p4 by William Chia-Wei Cheng (william@cs.UCLA.edu) +% +% Due to bugs in Transcript, the 'PS-Adobe-' stuff is omitted from line 1 +% + +% Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007 +% Free Software Foundation, Inc. +% +% This file is part of GNU Emacs. +% +% GNU Emacs is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 3, or (at your option) +% any later version. +% +% GNU Emacs is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with GNU Emacs; see the file COPYING. If not, write to +% the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +% Boston, MA 02110-1301, USA. + +/tgifdict 132 dict def +tgifdict begin + +% +% Using a zero value radius for an ellipse or an arc would result +% in a non-invertible CTM matrix which causes problem when this +% when this PostScript is wrapped inside other routines, such as +% the multi.ps package from +% ftp.ucc.su.oz.au:/pub/ps_printing/multi. You can overcome such +% error by uncommenting the sole line of the procedure below: +% +/tgif_min_radius + { +% dup 0.01 lt { pop 0.01 } if + } bind def + +/tgifellipsedict 6 dict def +tgifellipsedict /mtrx matrix put + +/tgifellipse + { tgifellipsedict begin + /yrad exch def + /xrad exch def + /y exch def + /x exch def + /savematrix mtrx currentmatrix def + x y translate + xrad yrad scale + 0 0 1 0 360 arc + savematrix setmatrix + end + } def + +/tgifarrowtipdict 8 dict def +tgifarrowtipdict /mtrx matrix put + +/tgifarrowtip + { tgifarrowtipdict begin + /dy exch def + /dx exch def + /h exch def + /w exch def + /y exch def + /x exch def + /savematrix mtrx currentmatrix def + x y translate + dy dx atan rotate + 0 0 moveto + w neg h lineto + w neg h neg lineto + savematrix setmatrix + end + } def + +/tgifarcdict 8 dict def +tgifarcdict /mtrx matrix put + +/tgifarcn + { tgifarcdict begin + /endangle exch def + /startangle exch def + /yrad exch def + /xrad exch def + /y exch def + /x exch def + /savematrix mtrx currentmatrix def + x y translate + xrad yrad scale + 0 0 1 startangle endangle arc + savematrix setmatrix + end + } def + +/tgifarc + { tgifarcdict begin + /endangle exch def + /startangle exch def + /yrad exch def + /xrad exch def + /y exch def + /x exch def + /savematrix mtrx currentmatrix def + x y translate + xrad yrad scale + 0 0 1 startangle endangle arcn + savematrix setmatrix + end + } def + +/tgifsetuserscreendict 22 dict def +tgifsetuserscreendict begin + /tempctm matrix def + /temprot matrix def + /tempscale matrix def + + /concatprocs + { /proc2 exch cvlit def + /proc1 exch cvlit def + /newproc proc1 length proc2 length add array def + newproc 0 proc1 putinterval + newproc proc1 length proc2 putinterval + newproc cvx + } def + /resmatrix matrix def + /findresolution + { 72 0 resmatrix defaultmatrix dtransform + /yres exch def /xres exch def + xres dup mul yres dup mul add sqrt + } def +end + +/tgifsetuserscreen + { tgifsetuserscreendict begin + /spotfunction exch def + /screenangle exch def + /cellsize exch def + + /m tempctm currentmatrix def + /rm screenangle temprot rotate def + /sm cellsize dup tempscale scale def + + sm rm m m concatmatrix m concatmatrix pop + + 1 0 m dtransform /y1 exch def /x1 exch def + + /veclength x1 dup mul y1 dup mul add sqrt def + /frequency findresolution veclength div def + + /newscreenangle y1 x1 atan def + + m 2 get m 1 get mul m 0 get m 3 get mul sub 0 gt + + {{neg} /spotfunction load concatprocs + /spotfunction exch def + } if + + frequency newscreenangle /spotfunction load setscreen + end + } def + +/tgifsetpatterndict 18 dict def +tgifsetpatterndict begin + /bitison + { /ybit exch def /xbit exch def + /bytevalue bstring ybit bwidth mul xbit 8 idiv add get def + + /mask 1 7 xbit 8 mod sub bitshift def + bytevalue mask and 0 ne + } def +end + +/tgifbitpatternspotfunction + { tgifsetpatterndict begin + /y exch def /x exch def + + /xindex x 1 add 2 div bpside mul cvi def + /yindex y 1 add 2 div bpside mul cvi def + + xindex yindex bitison + { /onbits onbits 1 add def 1 } + { /offbits offbits 1 add def 0 } + ifelse + end + } def + +/tgifsetpattern + { tgifsetpatterndict begin + /cellsz exch def + /angle exch def + /bwidth exch def + /bpside exch def + /bstring exch def + + /onbits 0 def /offbits 0 def + cellsz angle /tgifbitpatternspotfunction load tgifsetuserscreen + {} settransfer + offbits offbits onbits add div setgray + end + } def + +/tgifxpmdict 4 dict def +/tgifbwpicstr 1 string def +/tgifcolorpicstr 3 string def + +/tgifsetpixels { tgifxpmdict begin /pixels exch def end } def + +/tgifsetpix { tgifxpmdict begin pixels 3 1 roll putinterval end } def + +/tgifbwspot + { tgifxpmdict begin + /index exch def + tgifbwpicstr 0 + pixels index 3 mul 3 getinterval aload pop + 255 mul .114 mul exch 255 mul .587 mul add exch 255 mul .299 mul add + cvi put + tgifbwpicstr + end + } def + +/tgifcolorspot + { tgifxpmdict begin + /index exch def + pixels index 3 mul 3 getinterval aload pop + 255 mul cvi tgifcolorpicstr 2 3 -1 roll put + 255 mul cvi tgifcolorpicstr 1 3 -1 roll put + 255 mul cvi tgifcolorpicstr 0 3 -1 roll put + tgifcolorpicstr + end + } def + +/tgifnewcolorspot + { tgifxpmdict begin + /index exch def + pixels index 3 mul 3 getinterval aload pop setrgbcolor + end + } def + +/tgifcolordict 4 dict def + +/colorimage where + { pop } + { /colorimage + { tgifcolordict begin + pop pop pop pop pop + /ih exch def + /iw exch def + /x 0 def + /y 0 def + 1 1 ih + { pop 1 1 iw + { pop currentfile + tgifbwpicstr readhexstring pop 0 get tgifnewcolorspot + x y moveto 1 0 rlineto 0 1 rlineto -1 0 rlineto + closepath fill + /x x 1 add def + } for + /y y 1 add def + /x 0 def + } for + end + } def + } ifelse + +/tgifpatdict 10 dict def + +/tgifpatbyte + { currentdict /retstr get exch + pat i cellsz mod get put + } def + +/tgifpatproc + { 0 1 widthlim {tgifpatbyte} for retstr + /i i 1 add def + } def + +/tgifpatfill + { tgifpatdict begin + /h exch def + /w exch def + /lty exch def + /ltx exch def + /cellsz exch def + /pat exch def + + /widthlim w cellsz div cvi 1 sub def + /retstr widthlim 1 add string def + /i 0 def + + ltx lty translate + w h true [1 0 0 1 0 0] {tgifpatproc} imagemask + ltx neg lty neg translate + end + } def + +/pat1 <ffffffffffffffff> def +/pat2 <0000000000000000> def +/pat3 <8000000008000000> def +/pat4 <8800000022000000> def +/pat5 <8800220088002200> def +/pat6 <8822882288228822> def +/pat7 <aa55aa55aa55aa55> def +/pat8 <77dd77dd77dd77dd> def +/pat9 <77ffddff77ffddff> def +/pat10 <77ffffff77ffffff> def +/pat11 <7fffffff7fffffff> def +/pat12 <8040200002040800> def +/pat13 <40a00000040a0000> def +/pat14 <ff888888ff888888> def +/pat15 <ff808080ff080808> def +/pat16 <f87422478f172271> def +/pat17 <038448300c020101> def +/pat18 <081c22c180010204> def +/pat19 <8080413e080814e3> def +/pat20 <8040201008040201> def +/pat21 <8844221188442211> def +/pat22 <77bbddee77bbddee> def +/pat23 <c1e070381c0e0783> def +/pat24 <7fbfdfeff7fbfdfe> def +/pat25 <3e1f8fc7e3f1f87c> def +/pat26 <0102040810204080> def +/pat27 <1122448811224488> def +/pat28 <eeddbb77eeddbb77> def +/pat29 <83070e1c3870e0c1> def +/pat30 <fefdfbf7efdfbf7f> def +/pat31 <7cf8f1e3c78f1f3e> def + +/tgifcentertext { dup stringwidth pop 2 div neg 0 rmoveto } def + +/tgifrighttext { dup stringwidth pop neg 0 rmoveto } def + +/tgifreencsmalldict 12 dict def +/tgifReEncodeSmall + { tgifreencsmalldict begin + /newcodesandnames exch def + /newfontname exch def + /basefontname exch def + + /basefontdict basefontname findfont def + /newfont basefontdict maxlength dict def + + basefontdict + { exch dup /FID ne + { dup /Encoding eq + { exch dup length array copy newfont 3 1 roll put } + { exch newfont 3 1 roll put } + ifelse + } + { pop pop } + ifelse + } + forall + + newfont /FontName newfontname put + newcodesandnames aload pop + + newcodesandnames length 2 idiv + { newfont /Encoding get 3 1 roll put} + repeat + + newfontname newfont definefont pop + end + } def + +/tgifgray { 8 1 0 72 300 32 div div tgifsetpattern } bind def + +/tgifboxdict 6 dict def +/tgifboxstroke + { tgifboxdict begin + /pat def /w def /y2 exch def /x2 exch def /y1 exch def /x1 exch def + 1.415 setmiterlimit + w 1 eq { w setlinewidth } if + pat pat1 ne pat pat2 ne and { gsave pat tgifgray } if + newpath x1 y1 moveto x2 y1 lineto x2 y2 lineto x1 y2 lineto closepath + pat pat2 eq { 1 setgray stroke 0 setgray } { stroke } ifelse + pat pat1 ne pat pat2 ne and { grestore } if + w 1 eq { 1 setlinewidth } if + 1 setmiterlimit + end + } def +/tgifboxfill + { tgifboxdict begin + /pat def /y2 exch def /x2 exch def /y1 exch def /x1 exch def + pat pat1 ne pat pat2 ne and { gsave pat tgifgray } if + newpath x1 y1 moveto x2 y1 lineto x2 y2 lineto x1 y2 lineto closepath + pat pat2 eq { 1 setgray fill 0 setgray } { fill } ifelse + pat pat1 ne pat pat2 ne and { grestore } if + end + } def + +end + +%%PageBoundingBox: 33 710 173 759 +tgifdict begin +/tgifsavedpage save def + +1 setmiterlimit +1 setlinewidth + +0 setgray + +72 0 mul 72 11.00 mul translate +72 128 div 100 mul 100 div dup neg scale + +gsave + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 63 75 moveto (\(multiply-by-seven 3\)) show + grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 80 80 moveto + 96 96 lineto + 224 96 lineto + 240 80 lineto + stroke +grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 264 119 moveto + -22 0 atan dup cos 8 mul 264 exch sub + exch sin 8 mul 97 exch sub lineto + stroke +grestore +gsave + newpath + 264 97 8 3 0 -22 tgifarrowtip + closepath fill +grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 160 103 moveto + 160 119 lineto + stroke +grestore + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 112 139 moveto (function) show + grestore + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 224 139 moveto (argument) show + grestore + +grestore +tgifsavedpage restore +end +%MatchingCreationDate: Wed Mar 8 14:31:53 1995 diff --git a/doc/lispintro/lambda-2.eps b/doc/lispintro/lambda-2.eps new file mode 100644 index 00000000000..6288283abce --- /dev/null +++ b/doc/lispintro/lambda-2.eps @@ -0,0 +1,471 @@ +%! +%%BoundingBox: 33 730 240 777 +%%Title: lambda-diagram2 +%%CreationDate: Wed Mar 8 14:33:09 1995 +%%Creator: Tgif-2.16-p4 by William Chia-Wei Cheng (william@cs.UCLA.edu) +% +% Due to bugs in Transcript, the 'PS-Adobe-' stuff is omitted from line 1 +% + +% Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007 +% Free Software Foundation, Inc. +% +% This file is part of GNU Emacs. +% +% GNU Emacs is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 3, or (at your option) +% any later version. +% +% GNU Emacs is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with GNU Emacs; see the file COPYING. If not, write to +% the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +% Boston, MA 02110-1301, USA. + +/tgifdict 132 dict def +tgifdict begin + +% +% Using a zero value radius for an ellipse or an arc would result +% in a non-invertible CTM matrix which causes problem when this +% when this PostScript is wrapped inside other routines, such as +% the multi.ps package from +% ftp.ucc.su.oz.au:/pub/ps_printing/multi. You can overcome such +% error by uncommenting the sole line of the procedure below: +% +/tgif_min_radius + { +% dup 0.01 lt { pop 0.01 } if + } bind def + +/tgifellipsedict 6 dict def +tgifellipsedict /mtrx matrix put + +/tgifellipse + { tgifellipsedict begin + /yrad exch def + /xrad exch def + /y exch def + /x exch def + /savematrix mtrx currentmatrix def + x y translate + xrad yrad scale + 0 0 1 0 360 arc + savematrix setmatrix + end + } def + +/tgifarrowtipdict 8 dict def +tgifarrowtipdict /mtrx matrix put + +/tgifarrowtip + { tgifarrowtipdict begin + /dy exch def + /dx exch def + /h exch def + /w exch def + /y exch def + /x exch def + /savematrix mtrx currentmatrix def + x y translate + dy dx atan rotate + 0 0 moveto + w neg h lineto + w neg h neg lineto + savematrix setmatrix + end + } def + +/tgifarcdict 8 dict def +tgifarcdict /mtrx matrix put + +/tgifarcn + { tgifarcdict begin + /endangle exch def + /startangle exch def + /yrad exch def + /xrad exch def + /y exch def + /x exch def + /savematrix mtrx currentmatrix def + x y translate + xrad yrad scale + 0 0 1 startangle endangle arc + savematrix setmatrix + end + } def + +/tgifarc + { tgifarcdict begin + /endangle exch def + /startangle exch def + /yrad exch def + /xrad exch def + /y exch def + /x exch def + /savematrix mtrx currentmatrix def + x y translate + xrad yrad scale + 0 0 1 startangle endangle arcn + savematrix setmatrix + end + } def + +/tgifsetuserscreendict 22 dict def +tgifsetuserscreendict begin + /tempctm matrix def + /temprot matrix def + /tempscale matrix def + + /concatprocs + { /proc2 exch cvlit def + /proc1 exch cvlit def + /newproc proc1 length proc2 length add array def + newproc 0 proc1 putinterval + newproc proc1 length proc2 putinterval + newproc cvx + } def + /resmatrix matrix def + /findresolution + { 72 0 resmatrix defaultmatrix dtransform + /yres exch def /xres exch def + xres dup mul yres dup mul add sqrt + } def +end + +/tgifsetuserscreen + { tgifsetuserscreendict begin + /spotfunction exch def + /screenangle exch def + /cellsize exch def + + /m tempctm currentmatrix def + /rm screenangle temprot rotate def + /sm cellsize dup tempscale scale def + + sm rm m m concatmatrix m concatmatrix pop + + 1 0 m dtransform /y1 exch def /x1 exch def + + /veclength x1 dup mul y1 dup mul add sqrt def + /frequency findresolution veclength div def + + /newscreenangle y1 x1 atan def + + m 2 get m 1 get mul m 0 get m 3 get mul sub 0 gt + + {{neg} /spotfunction load concatprocs + /spotfunction exch def + } if + + frequency newscreenangle /spotfunction load setscreen + end + } def + +/tgifsetpatterndict 18 dict def +tgifsetpatterndict begin + /bitison + { /ybit exch def /xbit exch def + /bytevalue bstring ybit bwidth mul xbit 8 idiv add get def + + /mask 1 7 xbit 8 mod sub bitshift def + bytevalue mask and 0 ne + } def +end + +/tgifbitpatternspotfunction + { tgifsetpatterndict begin + /y exch def /x exch def + + /xindex x 1 add 2 div bpside mul cvi def + /yindex y 1 add 2 div bpside mul cvi def + + xindex yindex bitison + { /onbits onbits 1 add def 1 } + { /offbits offbits 1 add def 0 } + ifelse + end + } def + +/tgifsetpattern + { tgifsetpatterndict begin + /cellsz exch def + /angle exch def + /bwidth exch def + /bpside exch def + /bstring exch def + + /onbits 0 def /offbits 0 def + cellsz angle /tgifbitpatternspotfunction load tgifsetuserscreen + {} settransfer + offbits offbits onbits add div setgray + end + } def + +/tgifxpmdict 4 dict def +/tgifbwpicstr 1 string def +/tgifcolorpicstr 3 string def + +/tgifsetpixels { tgifxpmdict begin /pixels exch def end } def + +/tgifsetpix { tgifxpmdict begin pixels 3 1 roll putinterval end } def + +/tgifbwspot + { tgifxpmdict begin + /index exch def + tgifbwpicstr 0 + pixels index 3 mul 3 getinterval aload pop + 255 mul .114 mul exch 255 mul .587 mul add exch 255 mul .299 mul add + cvi put + tgifbwpicstr + end + } def + +/tgifcolorspot + { tgifxpmdict begin + /index exch def + pixels index 3 mul 3 getinterval aload pop + 255 mul cvi tgifcolorpicstr 2 3 -1 roll put + 255 mul cvi tgifcolorpicstr 1 3 -1 roll put + 255 mul cvi tgifcolorpicstr 0 3 -1 roll put + tgifcolorpicstr + end + } def + +/tgifnewcolorspot + { tgifxpmdict begin + /index exch def + pixels index 3 mul 3 getinterval aload pop setrgbcolor + end + } def + +/tgifcolordict 4 dict def + +/colorimage where + { pop } + { /colorimage + { tgifcolordict begin + pop pop pop pop pop + /ih exch def + /iw exch def + /x 0 def + /y 0 def + 1 1 ih + { pop 1 1 iw + { pop currentfile + tgifbwpicstr readhexstring pop 0 get tgifnewcolorspot + x y moveto 1 0 rlineto 0 1 rlineto -1 0 rlineto + closepath fill + /x x 1 add def + } for + /y y 1 add def + /x 0 def + } for + end + } def + } ifelse + +/tgifpatdict 10 dict def + +/tgifpatbyte + { currentdict /retstr get exch + pat i cellsz mod get put + } def + +/tgifpatproc + { 0 1 widthlim {tgifpatbyte} for retstr + /i i 1 add def + } def + +/tgifpatfill + { tgifpatdict begin + /h exch def + /w exch def + /lty exch def + /ltx exch def + /cellsz exch def + /pat exch def + + /widthlim w cellsz div cvi 1 sub def + /retstr widthlim 1 add string def + /i 0 def + + ltx lty translate + w h true [1 0 0 1 0 0] {tgifpatproc} imagemask + ltx neg lty neg translate + end + } def + +/pat1 <ffffffffffffffff> def +/pat2 <0000000000000000> def +/pat3 <8000000008000000> def +/pat4 <8800000022000000> def +/pat5 <8800220088002200> def +/pat6 <8822882288228822> def +/pat7 <aa55aa55aa55aa55> def +/pat8 <77dd77dd77dd77dd> def +/pat9 <77ffddff77ffddff> def +/pat10 <77ffffff77ffffff> def +/pat11 <7fffffff7fffffff> def +/pat12 <8040200002040800> def +/pat13 <40a00000040a0000> def +/pat14 <ff888888ff888888> def +/pat15 <ff808080ff080808> def +/pat16 <f87422478f172271> def +/pat17 <038448300c020101> def +/pat18 <081c22c180010204> def +/pat19 <8080413e080814e3> def +/pat20 <8040201008040201> def +/pat21 <8844221188442211> def +/pat22 <77bbddee77bbddee> def +/pat23 <c1e070381c0e0783> def +/pat24 <7fbfdfeff7fbfdfe> def +/pat25 <3e1f8fc7e3f1f87c> def +/pat26 <0102040810204080> def +/pat27 <1122448811224488> def +/pat28 <eeddbb77eeddbb77> def +/pat29 <83070e1c3870e0c1> def +/pat30 <fefdfbf7efdfbf7f> def +/pat31 <7cf8f1e3c78f1f3e> def + +/tgifcentertext { dup stringwidth pop 2 div neg 0 rmoveto } def + +/tgifrighttext { dup stringwidth pop neg 0 rmoveto } def + +/tgifreencsmalldict 12 dict def +/tgifReEncodeSmall + { tgifreencsmalldict begin + /newcodesandnames exch def + /newfontname exch def + /basefontname exch def + + /basefontdict basefontname findfont def + /newfont basefontdict maxlength dict def + + basefontdict + { exch dup /FID ne + { dup /Encoding eq + { exch dup length array copy newfont 3 1 roll put } + { exch newfont 3 1 roll put } + ifelse + } + { pop pop } + ifelse + } + forall + + newfont /FontName newfontname put + newcodesandnames aload pop + + newcodesandnames length 2 idiv + { newfont /Encoding get 3 1 roll put} + repeat + + newfontname newfont definefont pop + end + } def + +/tgifgray { 8 1 0 72 300 32 div div tgifsetpattern } bind def + +/tgifboxdict 6 dict def +/tgifboxstroke + { tgifboxdict begin + /pat def /w def /y2 exch def /x2 exch def /y1 exch def /x1 exch def + 1.415 setmiterlimit + w 1 eq { w setlinewidth } if + pat pat1 ne pat pat2 ne and { gsave pat tgifgray } if + newpath x1 y1 moveto x2 y1 lineto x2 y2 lineto x1 y2 lineto closepath + pat pat2 eq { 1 setgray stroke 0 setgray } { stroke } ifelse + pat pat1 ne pat pat2 ne and { grestore } if + w 1 eq { 1 setlinewidth } if + 1 setmiterlimit + end + } def +/tgifboxfill + { tgifboxdict begin + /pat def /y2 exch def /x2 exch def /y1 exch def /x1 exch def + pat pat1 ne pat pat2 ne and { gsave pat tgifgray } if + newpath x1 y1 moveto x2 y1 lineto x2 y2 lineto x1 y2 lineto closepath + pat pat2 eq { 1 setgray fill 0 setgray } { fill } ifelse + pat pat1 ne pat pat2 ne and { grestore } if + end + } def + +end + +%%PageBoundingBox: 33 730 240 777 +tgifdict begin +/tgifsavedpage save def + +1 setmiterlimit +1 setlinewidth + +0 setgray + +72 0 mul 72 11.00 mul translate +72 128 div 100 mul 100 div dup neg scale + +gsave + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 63 43 moveto (\(\(lambda \(number\) \(* 7 number\)\) 3\)) show + grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 80 48 moveto + 96 64 lineto + 336 64 lineto + 353 49 lineto + stroke +grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 395 85 moveto + -21 0 atan dup cos 8 mul 395 exch sub + exch sin 8 mul 64 exch sub lineto + stroke +grestore +gsave + newpath + 395 64 8 3 0 -21 tgifarrowtip + closepath fill +grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 208 69 moveto + 208 85 lineto + stroke +grestore + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 112 102 moveto (anonymous function) show + grestore + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 344 102 moveto (argument) show + grestore + +grestore +tgifsavedpage restore +end +%MatchingCreationDate: Wed Mar 8 14:33:09 1995 diff --git a/doc/lispintro/lambda-3.eps b/doc/lispintro/lambda-3.eps new file mode 100644 index 00000000000..26f7d5d9644 --- /dev/null +++ b/doc/lispintro/lambda-3.eps @@ -0,0 +1,471 @@ +%! +%%BoundingBox: 33 728 211 777 +%%Title: lambda-diagram3 +%%CreationDate: Wed Mar 8 14:33:49 1995 +%%Creator: Tgif-2.16-p4 by William Chia-Wei Cheng (william@cs.UCLA.edu) +% +% Due to bugs in Transcript, the 'PS-Adobe-' stuff is omitted from line 1 +% + +% Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007 +% Free Software Foundation, Inc. +% +% This file is part of GNU Emacs. +% +% GNU Emacs is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 3, or (at your option) +% any later version. +% +% GNU Emacs is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with GNU Emacs; see the file COPYING. If not, write to +% the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +% Boston, MA 02110-1301, USA. + +/tgifdict 132 dict def +tgifdict begin + +% +% Using a zero value radius for an ellipse or an arc would result +% in a non-invertible CTM matrix which causes problem when this +% when this PostScript is wrapped inside other routines, such as +% the multi.ps package from +% ftp.ucc.su.oz.au:/pub/ps_printing/multi. You can overcome such +% error by uncommenting the sole line of the procedure below: +% +/tgif_min_radius + { +% dup 0.01 lt { pop 0.01 } if + } bind def + +/tgifellipsedict 6 dict def +tgifellipsedict /mtrx matrix put + +/tgifellipse + { tgifellipsedict begin + /yrad exch def + /xrad exch def + /y exch def + /x exch def + /savematrix mtrx currentmatrix def + x y translate + xrad yrad scale + 0 0 1 0 360 arc + savematrix setmatrix + end + } def + +/tgifarrowtipdict 8 dict def +tgifarrowtipdict /mtrx matrix put + +/tgifarrowtip + { tgifarrowtipdict begin + /dy exch def + /dx exch def + /h exch def + /w exch def + /y exch def + /x exch def + /savematrix mtrx currentmatrix def + x y translate + dy dx atan rotate + 0 0 moveto + w neg h lineto + w neg h neg lineto + savematrix setmatrix + end + } def + +/tgifarcdict 8 dict def +tgifarcdict /mtrx matrix put + +/tgifarcn + { tgifarcdict begin + /endangle exch def + /startangle exch def + /yrad exch def + /xrad exch def + /y exch def + /x exch def + /savematrix mtrx currentmatrix def + x y translate + xrad yrad scale + 0 0 1 startangle endangle arc + savematrix setmatrix + end + } def + +/tgifarc + { tgifarcdict begin + /endangle exch def + /startangle exch def + /yrad exch def + /xrad exch def + /y exch def + /x exch def + /savematrix mtrx currentmatrix def + x y translate + xrad yrad scale + 0 0 1 startangle endangle arcn + savematrix setmatrix + end + } def + +/tgifsetuserscreendict 22 dict def +tgifsetuserscreendict begin + /tempctm matrix def + /temprot matrix def + /tempscale matrix def + + /concatprocs + { /proc2 exch cvlit def + /proc1 exch cvlit def + /newproc proc1 length proc2 length add array def + newproc 0 proc1 putinterval + newproc proc1 length proc2 putinterval + newproc cvx + } def + /resmatrix matrix def + /findresolution + { 72 0 resmatrix defaultmatrix dtransform + /yres exch def /xres exch def + xres dup mul yres dup mul add sqrt + } def +end + +/tgifsetuserscreen + { tgifsetuserscreendict begin + /spotfunction exch def + /screenangle exch def + /cellsize exch def + + /m tempctm currentmatrix def + /rm screenangle temprot rotate def + /sm cellsize dup tempscale scale def + + sm rm m m concatmatrix m concatmatrix pop + + 1 0 m dtransform /y1 exch def /x1 exch def + + /veclength x1 dup mul y1 dup mul add sqrt def + /frequency findresolution veclength div def + + /newscreenangle y1 x1 atan def + + m 2 get m 1 get mul m 0 get m 3 get mul sub 0 gt + + {{neg} /spotfunction load concatprocs + /spotfunction exch def + } if + + frequency newscreenangle /spotfunction load setscreen + end + } def + +/tgifsetpatterndict 18 dict def +tgifsetpatterndict begin + /bitison + { /ybit exch def /xbit exch def + /bytevalue bstring ybit bwidth mul xbit 8 idiv add get def + + /mask 1 7 xbit 8 mod sub bitshift def + bytevalue mask and 0 ne + } def +end + +/tgifbitpatternspotfunction + { tgifsetpatterndict begin + /y exch def /x exch def + + /xindex x 1 add 2 div bpside mul cvi def + /yindex y 1 add 2 div bpside mul cvi def + + xindex yindex bitison + { /onbits onbits 1 add def 1 } + { /offbits offbits 1 add def 0 } + ifelse + end + } def + +/tgifsetpattern + { tgifsetpatterndict begin + /cellsz exch def + /angle exch def + /bwidth exch def + /bpside exch def + /bstring exch def + + /onbits 0 def /offbits 0 def + cellsz angle /tgifbitpatternspotfunction load tgifsetuserscreen + {} settransfer + offbits offbits onbits add div setgray + end + } def + +/tgifxpmdict 4 dict def +/tgifbwpicstr 1 string def +/tgifcolorpicstr 3 string def + +/tgifsetpixels { tgifxpmdict begin /pixels exch def end } def + +/tgifsetpix { tgifxpmdict begin pixels 3 1 roll putinterval end } def + +/tgifbwspot + { tgifxpmdict begin + /index exch def + tgifbwpicstr 0 + pixels index 3 mul 3 getinterval aload pop + 255 mul .114 mul exch 255 mul .587 mul add exch 255 mul .299 mul add + cvi put + tgifbwpicstr + end + } def + +/tgifcolorspot + { tgifxpmdict begin + /index exch def + pixels index 3 mul 3 getinterval aload pop + 255 mul cvi tgifcolorpicstr 2 3 -1 roll put + 255 mul cvi tgifcolorpicstr 1 3 -1 roll put + 255 mul cvi tgifcolorpicstr 0 3 -1 roll put + tgifcolorpicstr + end + } def + +/tgifnewcolorspot + { tgifxpmdict begin + /index exch def + pixels index 3 mul 3 getinterval aload pop setrgbcolor + end + } def + +/tgifcolordict 4 dict def + +/colorimage where + { pop } + { /colorimage + { tgifcolordict begin + pop pop pop pop pop + /ih exch def + /iw exch def + /x 0 def + /y 0 def + 1 1 ih + { pop 1 1 iw + { pop currentfile + tgifbwpicstr readhexstring pop 0 get tgifnewcolorspot + x y moveto 1 0 rlineto 0 1 rlineto -1 0 rlineto + closepath fill + /x x 1 add def + } for + /y y 1 add def + /x 0 def + } for + end + } def + } ifelse + +/tgifpatdict 10 dict def + +/tgifpatbyte + { currentdict /retstr get exch + pat i cellsz mod get put + } def + +/tgifpatproc + { 0 1 widthlim {tgifpatbyte} for retstr + /i i 1 add def + } def + +/tgifpatfill + { tgifpatdict begin + /h exch def + /w exch def + /lty exch def + /ltx exch def + /cellsz exch def + /pat exch def + + /widthlim w cellsz div cvi 1 sub def + /retstr widthlim 1 add string def + /i 0 def + + ltx lty translate + w h true [1 0 0 1 0 0] {tgifpatproc} imagemask + ltx neg lty neg translate + end + } def + +/pat1 <ffffffffffffffff> def +/pat2 <0000000000000000> def +/pat3 <8000000008000000> def +/pat4 <8800000022000000> def +/pat5 <8800220088002200> def +/pat6 <8822882288228822> def +/pat7 <aa55aa55aa55aa55> def +/pat8 <77dd77dd77dd77dd> def +/pat9 <77ffddff77ffddff> def +/pat10 <77ffffff77ffffff> def +/pat11 <7fffffff7fffffff> def +/pat12 <8040200002040800> def +/pat13 <40a00000040a0000> def +/pat14 <ff888888ff888888> def +/pat15 <ff808080ff080808> def +/pat16 <f87422478f172271> def +/pat17 <038448300c020101> def +/pat18 <081c22c180010204> def +/pat19 <8080413e080814e3> def +/pat20 <8040201008040201> def +/pat21 <8844221188442211> def +/pat22 <77bbddee77bbddee> def +/pat23 <c1e070381c0e0783> def +/pat24 <7fbfdfeff7fbfdfe> def +/pat25 <3e1f8fc7e3f1f87c> def +/pat26 <0102040810204080> def +/pat27 <1122448811224488> def +/pat28 <eeddbb77eeddbb77> def +/pat29 <83070e1c3870e0c1> def +/pat30 <fefdfbf7efdfbf7f> def +/pat31 <7cf8f1e3c78f1f3e> def + +/tgifcentertext { dup stringwidth pop 2 div neg 0 rmoveto } def + +/tgifrighttext { dup stringwidth pop neg 0 rmoveto } def + +/tgifreencsmalldict 12 dict def +/tgifReEncodeSmall + { tgifreencsmalldict begin + /newcodesandnames exch def + /newfontname exch def + /basefontname exch def + + /basefontdict basefontname findfont def + /newfont basefontdict maxlength dict def + + basefontdict + { exch dup /FID ne + { dup /Encoding eq + { exch dup length array copy newfont 3 1 roll put } + { exch newfont 3 1 roll put } + ifelse + } + { pop pop } + ifelse + } + forall + + newfont /FontName newfontname put + newcodesandnames aload pop + + newcodesandnames length 2 idiv + { newfont /Encoding get 3 1 roll put} + repeat + + newfontname newfont definefont pop + end + } def + +/tgifgray { 8 1 0 72 300 32 div div tgifsetpattern } bind def + +/tgifboxdict 6 dict def +/tgifboxstroke + { tgifboxdict begin + /pat def /w def /y2 exch def /x2 exch def /y1 exch def /x1 exch def + 1.415 setmiterlimit + w 1 eq { w setlinewidth } if + pat pat1 ne pat pat2 ne and { gsave pat tgifgray } if + newpath x1 y1 moveto x2 y1 lineto x2 y2 lineto x1 y2 lineto closepath + pat pat2 eq { 1 setgray stroke 0 setgray } { stroke } ifelse + pat pat1 ne pat pat2 ne and { grestore } if + w 1 eq { 1 setlinewidth } if + 1 setmiterlimit + end + } def +/tgifboxfill + { tgifboxdict begin + /pat def /y2 exch def /x2 exch def /y1 exch def /x1 exch def + pat pat1 ne pat pat2 ne and { gsave pat tgifgray } if + newpath x1 y1 moveto x2 y1 lineto x2 y2 lineto x1 y2 lineto closepath + pat pat2 eq { 1 setgray fill 0 setgray } { fill } ifelse + pat pat1 ne pat pat2 ne and { grestore } if + end + } def + +end + +%%PageBoundingBox: 33 728 211 777 +tgifdict begin +/tgifsavedpage save def + +1 setmiterlimit +1 setlinewidth + +0 setgray + +72 0 mul 72 11.00 mul translate +72 128 div 100 mul 100 div dup neg scale + +gsave + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 63 43 moveto (\(\(lambda \(arg\) \(/ arg 50\)\) 100\)) show + grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 80 48 moveto + 96 64 lineto + 284 64 lineto + 299 48 lineto + stroke +grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 354 86 moveto + -25 0 atan dup cos 8 mul 354 exch sub + exch sin 8 mul 61 exch sub lineto + stroke +grestore +gsave + newpath + 354 61 8 3 0 -25 tgifarrowtip + closepath fill +grestore + +% POLY/OPEN-SPLINE +gsave + newpath + 199 70 moveto + 199 86 lineto + stroke +grestore + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 101 106 moveto (anonymous function) show + grestore + +% TEXT +0 setgray +/Courier findfont [17 0 0 -17 0 0] makefont setfont + gsave + 293 106 moveto (argument) show + grestore + +grestore +tgifsavedpage restore +end +%MatchingCreationDate: Wed Mar 8 14:33:49 1995 diff --git a/doc/lispintro/makefile.w32-in b/doc/lispintro/makefile.w32-in new file mode 100644 index 00000000000..ea0f790f212 --- /dev/null +++ b/doc/lispintro/makefile.w32-in @@ -0,0 +1,73 @@ +#### -*- Makefile -*- for the Emacs Lisp Introduction manual. + +# Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. + +# This file is part of GNU Emacs. + +# GNU Emacs is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. + +# GNU Emacs is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with GNU Emacs; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. + +srcdir = . + +infodir = $(srcdir)/../../info + +INFO_SOURCES = $(srcdir)/emacs-lisp-intro.texi +# The file name eintr must fit within 5 characters, to allow for +# -NN extensions to fit into DOS 8+3 limits without clashing +INFO_TARGETS = $(infodir)/eintr +DVI_TARGETS = emacs-lisp-intro.dvi + +MAKEINFO = makeinfo +INSTALL_INFO = install-info +TEXI2DVI = texi2dvi +DVIPS = dvips +ENVADD = $(srcdir)\..\..\nt\envadd.bat "TEXINPUTS=$(srcdir);$(TEXINPUTS)" \ + "MAKEINFO=$(MAKEINFO) -I$(srcdir)" /C + +.SUFFIXES: .dvi .ps .texi + +info: $(INFO_TARGETS) + +$(infodir)/dir: + $(INSTALL_INFO) --info-dir=$(infodir) $(INFO_TARGETS) + +dvi: $(DVI_TARGETS) + +$(infodir)/eintr: $(INFO_SOURCES) + $(MAKEINFO) -o $@ $(srcdir)/emacs-lisp-intro.texi + +emacs-lisp-intro.dvi: $(INFO_SOURCES) + $(ENVADD) $(TEXI2DVI) $(srcdir)/emacs-lisp-intro.texi + +emacs-lisp-intro.html: $(INFO_SOURCES) + $(MAKEINFO) --html -o $@ $(srcdir)/emacs-lisp-intro.texi + +.dvi.ps: + $(DVIPS) $< -o $@ + +mostlyclean: + - $(DEL) *.log *.cp *.fn *.ky *.pg *.vr *.tp + +clean: mostlyclean + - $(DEL) *.dvi $(infodir)/eintr* + +distclean: clean + +maintainer-clean: distclean + - $(DEL) *.aux *.cps *.fns *.kys *.pgs *.vrs *.toc + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/doc/lispintro/missing b/doc/lispintro/missing new file mode 100755 index 00000000000..5b73d25789b --- /dev/null +++ b/doc/lispintro/missing @@ -0,0 +1,135 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. +# Copyright (C) 1996, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007 +# Free Software Foundation, Inc. +# Franc,ois Pinard <pinard@iro.umontreal.ca>, 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1301, USA. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +case "$1" in + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + automake touch all \`Makefile.in' files + bison touch file \`y.tab.c' + makeinfo touch the output file + yacc touch file \`y.tab.c'" + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing - GNU libit 0.0" + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + + aclocal) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`acinclude.m4' or \`configure.in'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`configure.in'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`acconfig.h' or \`configure.in'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + touch config.h.in + ;; + + automake) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print \ + | sed 's/^\(.*\).am$/touch \1.in/' \ + | sh + ;; + + bison|yacc) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + touch y.tab.c + ;; + + makeinfo) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` + fi + touch $file + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and you do not seem to have it handy on your + system. You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequirements for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 diff --git a/lispref/mkinstalldirs b/doc/lispintro/mkinstalldirs index f945dbf2bce..f945dbf2bce 100755 --- a/lispref/mkinstalldirs +++ b/doc/lispintro/mkinstalldirs diff --git a/lispref/.arch-inventory b/doc/lispref/.arch-inventory index 2f5e6b9eea0..2f5e6b9eea0 100644 --- a/lispref/.arch-inventory +++ b/doc/lispref/.arch-inventory diff --git a/doc/lispref/.gitignore b/doc/lispref/.gitignore new file mode 100644 index 00000000000..a149258f6dd --- /dev/null +++ b/doc/lispref/.gitignore @@ -0,0 +1,17 @@ +texput.log +elisp.?? +elisp.??? +configure +config.log +config.cache +config.status +Makefile +makefile +index.texi +elisp +elisp-? +elisp-?? +vol1.* +vol2.* +elisp1* +elisp2* diff --git a/lispref/ChangeLog b/doc/lispref/ChangeLog index 7816c993e2e..5c4f9159066 100644 --- a/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,69 @@ +2007-10-06 Juri Linkov <juri@jurta.org> + + * text.texi (Filling): Document fill-paragraph-or-region. + +2007-10-05 Juanma Barranquero <lekktu@gmail.com> + + * display.texi (Auto Faces): Fix typo. + +2007-10-02 Richard Stallman <rms@gnu.org> + + * display.texi (Display Property): Explain some display specs + don't let you move point in. + + * frames.texi (Cursor Parameters): Describe + cursor-in-non-selected-windows here. Explain more values. + + * windows.texi (Basic Windows): Don't describe + cursor-in-non-selected-windows here. + +2007-10-01 Eli Zaretskii <eliz@gnu.org> + + * processes.texi (Misc Network): Note that these functions are + supported only on some systems. + +2007-10-01 Richard Stallman <rms@gnu.org> + + * display.texi (Overlay Properties): Explain nil as priority. + Explain that conflicts are unpredictable if not resolved by + priorities. + +2007-09-23 Richard Stallman <rms@gnu.org> + + * macros.texi (Backquote): Minor clarification. + +2007-09-19 Richard Stallman <rms@gnu.org> + + * display.texi (Display Property): Explain multiple display specs. + Clarify when they work in parallel and when one overrides. + Fix error in example. + +2007-09-06 Glenn Morris <rgm@gnu.org> + + * Move from lispref/ to doc/lispref/. Change all setfilename + commands to use ../../info. + * Makefile.in (infodir): Go up one more level. + (usermanualdir): Change from ../man to ../emacs. + (miscmanualdir): New. + (dist): Use new variable miscmanualdir. + * makefile.w32-in (infodir, texinputdir): Go up one more level. + (usermanualdir): Change from ../man to ../emacs. + +2007-08-30 Martin Rudalics <rudalics@gmx.at> + + * commands.texi (Command Loop Info): Advise against changing + most variables described here. Explain new variable + last-repeatable-command. + +2007-08-29 Glenn Morris <rgm@gnu.org> + + * elisp.texi (EMACSVER): Increase to 23.0.50. + +2007-08-29 Dan Nicolaescu <dann@ics.uci.edu> + + * frames.texi (Basic Parameters): Add display-environment-variable + and term-environment-variable. + 2007-08-28 Juri Linkov <juri@jurta.org> * display.texi (Image Formats, Other Image Types): Add SVG. @@ -8,6 +74,11 @@ "Image Formats". (Image Formats): New node. +2007-08-27 Richard Stallman <rms@gnu.org> + + * windows.texi (Window Configurations): Clarify what + a window configuration saves. + 2007-08-25 Richard Stallman <rms@gnu.org> * display.texi (Images): Delete redundant @findex. @@ -43,8 +114,8 @@ 2007-07-24 Michael Albinus <michael.albinus@gmx.de> - * processes.texi (Synchronous Processes): Add - `process-file-shell-command', + * processes.texi (Synchronous Processes): + Add `process-file-shell-command'. (Asynchronous Processes): Mention restricted use of `process-filter' and `process-sentinel' in `start-file-process'. Add `start-file-process-shell-command'. @@ -87,13 +158,13 @@ 2007-06-27 Michael Albinus <michael.albinus@gmx.de> - * files.texi (Magic File Names): Remove `dired-call-process'. Add - `process-file'. + * files.texi (Magic File Names): Remove `dired-call-process'. + Add `process-file'. 2007-06-27 Kenichi Handa <handa@m17n.org> * text.texi (Special Properties): Fix description about - `compostion' property. + `composition' property. 2007-06-26 Kenichi Handa <handa@m17n.org> @@ -107,7 +178,7 @@ 2007-06-24 Karl Berry <karl@gnu.org> - * elisp.texi, vol1.texi, vol2.texi: new Back-Cover Text. + * elisp.texi, vol1.texi, vol2.texi: New Back-Cover Text. 2007-06-15 Juanma Barranquero <lekktu@gmail.com> diff --git a/lispref/Makefile.in b/doc/lispref/Makefile.in index 1a34d60a0d8..12dd1c86632 100644 --- a/lispref/Makefile.in +++ b/doc/lispref/Makefile.in @@ -26,8 +26,9 @@ srcdir = @srcdir@ # Tell make where to find source files; this is needed for the makefiles. VPATH=@srcdir@ -infodir = ../info -usermanualdir = $(srcdir)/../man +infodir = ../../info +usermanualdir = $(srcdir)/../emacs +miscmanualdir = $(srcdir)/../misc TEXI2DVI = texi2dvi SHELL = /bin/sh @@ -133,7 +134,7 @@ dist: $(infodir)/elisp elisp.dvi -mkdir temp/$(manual) -ln $(srcdir)/README $(srcdir)/configure.in $(srcdir)/configure \ $(srcdir)/Makefile.in $(srcs) \ - $(srcdir)/../man/texinfo.tex \ + $(miscmanualdir)/texinfo.tex \ elisp.dvi elisp.aux elisp.??s \ $(infodir)/elisp $(infodir)/elisp-[1-9] $(infodir)/elisp-[1-9][0-9] \ temp/$(manual) diff --git a/lispref/README b/doc/lispref/README index c5d4c8acc77..c5d4c8acc77 100644 --- a/lispref/README +++ b/doc/lispref/README diff --git a/lispref/abbrevs.texi b/doc/lispref/abbrevs.texi index 46e7c3739c4..a52ba2c6c86 100644 --- a/lispref/abbrevs.texi +++ b/doc/lispref/abbrevs.texi @@ -3,7 +3,7 @@ @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1999, 2001, 2002, 2003, @c 2004, 2005, 2006, 2007 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. -@setfilename ../info/abbrevs +@setfilename ../../info/abbrevs @node Abbrevs, Processes, Syntax Tables, Top @chapter Abbrevs and Abbrev Expansion @cindex abbrev diff --git a/lispref/advice.texi b/doc/lispref/advice.texi index 4d580f9846d..7eb89d7bd41 100644 --- a/lispref/advice.texi +++ b/doc/lispref/advice.texi @@ -3,7 +3,7 @@ @c Copyright (C) 1998, 1999, 2001, 2002, 2003, 2004, @c 2005, 2006, 2007 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. -@setfilename ../info/advising +@setfilename ../../info/advising @node Advising Functions, Debugging, Byte Compilation, Top @chapter Advising Emacs Lisp Functions @cindex advising functions diff --git a/lispref/anti.texi b/doc/lispref/anti.texi index 1ec0c5ef327..1ec0c5ef327 100644 --- a/lispref/anti.texi +++ b/doc/lispref/anti.texi diff --git a/lispref/back.texi b/doc/lispref/back.texi index 19559eab9c1..19559eab9c1 100644 --- a/lispref/back.texi +++ b/doc/lispref/back.texi diff --git a/lispref/backups.texi b/doc/lispref/backups.texi index 44795557f15..7268d01e9ee 100644 --- a/lispref/backups.texi +++ b/doc/lispref/backups.texi @@ -3,7 +3,7 @@ @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1999, 2001, 2002, 2003, @c 2004, 2005, 2006, 2007 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. -@setfilename ../info/backups +@setfilename ../../info/backups @node Backups and Auto-Saving, Buffers, Files, Top @chapter Backups and Auto-Saving @cindex backups and auto-saving diff --git a/lispref/book-spine.texinfo b/doc/lispref/book-spine.texinfo index 7355c4530ae..7355c4530ae 100644 --- a/lispref/book-spine.texinfo +++ b/doc/lispref/book-spine.texinfo diff --git a/lispref/buffers.texi b/doc/lispref/buffers.texi index e9cafb69fb5..2d7faccf241 100644 --- a/lispref/buffers.texi +++ b/doc/lispref/buffers.texi @@ -3,7 +3,7 @@ @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001, 2002, @c 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. -@setfilename ../info/buffers +@setfilename ../../info/buffers @node Buffers, Windows, Backups and Auto-Saving, Top @chapter Buffers @cindex buffer diff --git a/lispref/commands.texi b/doc/lispref/commands.texi index fabe38f9428..aaad7ca82a7 100644 --- a/lispref/commands.texi +++ b/doc/lispref/commands.texi @@ -3,7 +3,7 @@ @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001, 2002, @c 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. -@setfilename ../info/commands +@setfilename ../../info/commands @node Command Loop, Keymaps, Minibuffers, Top @chapter Command Loop @cindex editor command loop @@ -716,7 +716,9 @@ caller to ``pretend'' that the function was called interactively. @section Information from the Command Loop The editor command loop sets several Lisp variables to keep status -records for itself and for commands that are run. +records for itself and for commands that are run. With the exception of +@code{this-command} and @code{last-command} it's generally a bad idea to +change any of these variables in a Lisp program. @defvar last-command This variable records the name of the previous command executed by the @@ -736,6 +738,12 @@ This variable is set up by Emacs just like @code{last-command}, but never altered by Lisp programs. @end defvar +@defvar last-repeatable-command +This variable stores the most recently executed command that was not +part of an input event. This is the command @code{repeat} will try to +repeat, @xref{Repeating,,, emacs, The GNU Emacs Manual}. +@end defvar + @defvar this-command @cindex current command This variable records the name of the command now being executed by diff --git a/lispref/compile.texi b/doc/lispref/compile.texi index 8f5c047fd6b..aeaa9f79eb8 100644 --- a/lispref/compile.texi +++ b/doc/lispref/compile.texi @@ -3,7 +3,7 @@ @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 2001, 2002, 2003, 2004, @c 2005, 2006, 2007 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. -@setfilename ../info/compile +@setfilename ../../info/compile @node Byte Compilation, Advising Functions, Loading, Top @chapter Byte Compilation @cindex byte compilation diff --git a/lispref/configure b/doc/lispref/configure index 7f67f08dfa3..7f67f08dfa3 100755 --- a/lispref/configure +++ b/doc/lispref/configure diff --git a/lispref/configure.in b/doc/lispref/configure.in index 7db2f8cab5e..7db2f8cab5e 100644 --- a/lispref/configure.in +++ b/doc/lispref/configure.in diff --git a/lispref/control.texi b/doc/lispref/control.texi index e99a6329f3e..db88a74487d 100644 --- a/lispref/control.texi +++ b/doc/lispref/control.texi @@ -3,7 +3,7 @@ @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001, 2002, @c 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. -@setfilename ../info/control +@setfilename ../../info/control @node Control Structures, Variables, Evaluation, Top @chapter Control Structures @cindex special forms for control structures diff --git a/lispref/customize.texi b/doc/lispref/customize.texi index 8b1b1a9b91f..c375706e6f9 100644 --- a/lispref/customize.texi +++ b/doc/lispref/customize.texi @@ -3,7 +3,7 @@ @c Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, @c 2005, 2006, 2007 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. -@setfilename ../info/customize +@setfilename ../../info/customize @node Customization, Loading, Macros, Top @chapter Writing Customization Definitions diff --git a/lispref/debugging.texi b/doc/lispref/debugging.texi index a427e746b27..4c4cb92914d 100644 --- a/lispref/debugging.texi +++ b/doc/lispref/debugging.texi @@ -3,7 +3,7 @@ @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1998, 1999, 2001, 2002, 2003, @c 2004, 2005, 2006, 2007 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. -@setfilename ../info/debugging +@setfilename ../../info/debugging @node Debugging, Read and Print, Advising Functions, Top @chapter Debugging Lisp Programs diff --git a/lispref/display.texi b/doc/lispref/display.texi index db630ba2c51..90d94dbe6b3 100644 --- a/lispref/display.texi +++ b/doc/lispref/display.texi @@ -3,7 +3,7 @@ @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001, @c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. -@setfilename ../info/display +@setfilename ../../info/display @node Display, System Interface, Processes, Top @chapter Emacs Display @@ -1291,6 +1291,11 @@ while moving an overlay or changing its properties does not. Unlike text property changes, overlay property changes are not recorded in the buffer's undo list. + Since more than one overlay can specify a property value for the +same character, Emacs lets you specify a priority value of each +overlay. You should not make assumptions about which overlay will +prevail when there is a conflict and they have the same priority. + These functions read and set the properties of an overlay: @defun overlay-get overlay prop @@ -1321,13 +1326,16 @@ of them: @item priority @kindex priority @r{(overlay property)} This property's value (which should be a nonnegative integer number) -determines the priority of the overlay. The priority matters when two -or more overlays cover the same character and both specify the same -property; the one whose @code{priority} value is larger takes priority -over the other. For the @code{face} property, the higher priority -value does not completely replace the other; instead, its face -attributes override the face attributes of the lower priority -@code{face} property. +determines the priority of the overlay. No priority, or @code{nil}, +means zero. + +The priority matters when two or more overlays cover the same +character and both specify the same property; the one whose +@code{priority} value is larger overrides the other. For the +@code{face} property, the higher priority overlay's value does not +completely override the other value; instead, its face attributes +override the face attributes of the lower priority @code{face} +property. Currently, all overlays take priority over text properties. Please avoid using negative priority values, as we have not yet decided just @@ -2510,7 +2518,7 @@ makes @code{modeline} an alias for the @code{mode-line} face. @cindex automatic face assignment @cindex faces, automatic choice - This hook is used for automatically assigning facesto text in the + This hook is used for automatically assigning faces to text in the buffer. It is part of the implementation of Jit-Lock mode, used by Font-Lock. @@ -3237,15 +3245,21 @@ to use the value specified by the frame. insert images into text, and also control other aspects of how text displays. The value of the @code{display} property should be a display specification, or a list or vector containing several display -specifications. - - Some kinds of @code{display} properties specify something to display -instead of the text that has the property. In this case, ``the text'' -means all the consecutive characters that have the same Lisp object as -their @code{display} property; these characters are replaced as a -single unit. By contrast, characters that have similar but distinct -Lisp objects as their @code{display} properties are handled -separately. Here's a function that illustrates this point: +specifications. Display specifications generally apply in parallel to +the text they cover. + + Some kinds of @code{display} specifications specify something to +display instead of the text that has the property. If a list of +display specifications includes more than one of this kind, the first +is effective and the rest are ignored. You cannot interactively move +point into the middle of the text that is thus replaced. + + For these specifications, ``the text that has the property'' means +all the consecutive characters that have the same Lisp object as their +@code{display} property; these characters are replaced as a single +unit. By contrast, characters that have similar but distinct Lisp +objects as their @code{display} properties are handled separately. +Here's a function that illustrates this point: @smallexample (defun foo () @@ -3273,7 +3287,7 @@ results: (goto-char (point-min)) (dotimes (i 5) (let ((string (concat "A"))) - (put-text-property (point) (2+ (point)) 'display string) + (put-text-property (point) (+ 2 (point)) 'display string) (put-text-property (point) (1+ (point)) 'display string) (forward-char 2)))) @end smallexample diff --git a/lispref/doclicense.texi b/doc/lispref/doclicense.texi index f2f32aaa968..f2f32aaa968 100644 --- a/lispref/doclicense.texi +++ b/doc/lispref/doclicense.texi diff --git a/lispref/edebug.texi b/doc/lispref/edebug.texi index 4be030896c5..4be030896c5 100644 --- a/lispref/edebug.texi +++ b/doc/lispref/edebug.texi diff --git a/lispref/elisp.texi b/doc/lispref/elisp.texi index 7b57b8a61af..613bdbace38 100644 --- a/lispref/elisp.texi +++ b/doc/lispref/elisp.texi @@ -7,7 +7,7 @@ @c Version of the manual and of Emacs. @c Please remember to update the edition number in README as well. @set VERSION 2.9 -@set EMACSVER 22.1.50 +@set EMACSVER 23.0.50 @dircategory Emacs @direntry diff --git a/lispref/errors.texi b/doc/lispref/errors.texi index af2df791c39..0be31ce3846 100644 --- a/lispref/errors.texi +++ b/doc/lispref/errors.texi @@ -3,7 +3,7 @@ @c Copyright (C) 1990, 1991, 1992, 1993, 1999, 2001, 2002, 2003, 2004, @c 2005, 2006, 2007 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. -@setfilename ../info/errors +@setfilename ../../info/errors @node Standard Errors, Standard Buffer-Local Variables, GNU Emacs Internals, Top @appendix Standard Errors @cindex standard errors diff --git a/lispref/eval.texi b/doc/lispref/eval.texi index 772f502553c..f4d164ec3a2 100644 --- a/lispref/eval.texi +++ b/doc/lispref/eval.texi @@ -3,7 +3,7 @@ @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1998, 2001, 2002, 2003, @c 2004, 2005, 2006, 2007 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. -@setfilename ../info/eval +@setfilename ../../info/eval @node Evaluation, Control Structures, Symbols, Top @chapter Evaluation @cindex evaluation diff --git a/lispref/files.texi b/doc/lispref/files.texi index bfcbe476f95..419f109e0a8 100644 --- a/lispref/files.texi +++ b/doc/lispref/files.texi @@ -3,7 +3,7 @@ @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001, @c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. -@setfilename ../info/files +@setfilename ../../info/files @node Files, Backups and Auto-Saving, Documentation, Top @comment node-name, next, previous, up @chapter Files diff --git a/lispref/frames.texi b/doc/lispref/frames.texi index b8a0d4749e2..ee07302d76b 100644 --- a/lispref/frames.texi +++ b/doc/lispref/frames.texi @@ -3,7 +3,7 @@ @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001, @c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. -@setfilename ../info/frames +@setfilename ../../info/frames @node Frames, Positions, Windows, Top @chapter Frames @cindex frame @@ -378,6 +378,14 @@ you don't specify a name, Emacs sets the frame name automatically If you specify the frame name explicitly when you create the frame, the name is also used (instead of the name of the Emacs executable) when looking up X resources for the frame. + +@item display-environment-variable +The value of the @code{DISPLAY} environment variable for the frame. It +is passed to child processes. + +@item term-environment-variable +The value of the @code{TERM} environment variable for the frame. It +is passed to child processes. @end table @node Position Parameters @@ -655,8 +663,17 @@ should be suitable values for the @code{cursor-type} frame parameter. There are various defaults for how to blink each type of cursor, if the type is not mentioned as an @var{on-state} here. Changes in this -variable do not take effect immediately, because the variable is -examined only when you specify the @code{cursor-type} parameter. +variable do not take effect immediately, only when you specify the +@code{cursor-type} frame parameter. +@end defvar + +@defvar cursor-in-non-selected-windows +This variable controls how the cursor looks in a window that is not +selected. It supports the same values as the @code{cursor-type} frame +parameter; also, @code{nil} means don't display a cursor in +nonselected windows, and @code{t} (the default) means use a standard +modificatoin of the usual cursor type (solid box becomes hollow box, +and bar becomes a narrower bar). @end defvar @node Color Parameters diff --git a/lispref/front-cover-1.texi b/doc/lispref/front-cover-1.texi index 5c9f4351f42..5c9f4351f42 100644 --- a/lispref/front-cover-1.texi +++ b/doc/lispref/front-cover-1.texi diff --git a/lispref/functions.texi b/doc/lispref/functions.texi index eedfa8c124f..111edb7afc0 100644 --- a/lispref/functions.texi +++ b/doc/lispref/functions.texi @@ -3,7 +3,7 @@ @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001, @c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. -@setfilename ../info/functions +@setfilename ../../info/functions @node Functions, Macros, Variables, Top @chapter Functions diff --git a/lispref/gpl.texi b/doc/lispref/gpl.texi index e9f7218ede9..163af4627bb 100644 --- a/lispref/gpl.texi +++ b/doc/lispref/gpl.texi @@ -1,5 +1,5 @@ @c -*-texinfo-*- -@setfilename ../info/gpl +@setfilename ../../info/gpl @node GPL, Tips, GNU Free Documentation License, Top @comment node-name, next, previous, up diff --git a/lispref/hash.texi b/doc/lispref/hash.texi index c5b68e26d91..3f0297e28ca 100644 --- a/lispref/hash.texi +++ b/doc/lispref/hash.texi @@ -3,7 +3,7 @@ @c Copyright (C) 1999, 2001, 2002, 2003, 2004, 2005, @c 2006, 2007 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. -@setfilename ../info/hash +@setfilename ../../info/hash @node Hash Tables, Symbols, Sequences Arrays Vectors, Top @chapter Hash Tables @cindex hash tables diff --git a/lispref/help.texi b/doc/lispref/help.texi index dd56aa872b7..64b6a6ecfa2 100644 --- a/lispref/help.texi +++ b/doc/lispref/help.texi @@ -3,7 +3,7 @@ @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001, @c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. -@setfilename ../info/help +@setfilename ../../info/help @node Documentation, Files, Modes, Top @chapter Documentation @cindex documentation strings diff --git a/lispref/hooks.texi b/doc/lispref/hooks.texi index 572d3b79d93..d0bb2de8675 100644 --- a/lispref/hooks.texi +++ b/doc/lispref/hooks.texi @@ -3,7 +3,7 @@ @c Copyright (C) 1990, 1991, 1992, 1993, 1998, 2001, 2002, 2003, 2004, @c 2005, 2006, 2007 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. -@setfilename ../info/hooks +@setfilename ../../info/hooks @node Standard Hooks, Index, Standard Keymaps, Top @appendix Standard Hooks @cindex standard hooks diff --git a/lispref/index.texi b/doc/lispref/index.texi index cfa8f25e126..6cdadf94491 100644 --- a/lispref/index.texi +++ b/doc/lispref/index.texi @@ -1,5 +1,5 @@ @c -*-texinfo-*- -@setfilename ../info/index +@setfilename ../../info/index @c Indexing guidelines diff --git a/lispref/internals.texi b/doc/lispref/internals.texi index 3cd42ed69ff..d0b03fb5305 100644 --- a/lispref/internals.texi +++ b/doc/lispref/internals.texi @@ -3,7 +3,7 @@ @c Copyright (C) 1990, 1991, 1992, 1993, 1998, 1999, 2001, 2002, 2003, @c 2004, 2005, 2006, 2007 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. -@setfilename ../info/internals +@setfilename ../../info/internals @node GNU Emacs Internals, Standard Errors, Tips, Top @comment node-name, next, previous, up @appendix GNU Emacs Internals diff --git a/lispref/intro.texi b/doc/lispref/intro.texi index ed0fd1c0699..c759fba03f9 100644 --- a/lispref/intro.texi +++ b/doc/lispref/intro.texi @@ -3,7 +3,7 @@ @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 2001, 2002, 2003, 2004, @c 2005, 2006, 2007 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. -@setfilename ../info/intro +@setfilename ../../info/intro @node Introduction, Lisp Data Types, Top, Top @comment node-name, next, previous, up diff --git a/lispref/keymaps.texi b/doc/lispref/keymaps.texi index bf20680dd81..2bd0de60f58 100644 --- a/lispref/keymaps.texi +++ b/doc/lispref/keymaps.texi @@ -3,7 +3,7 @@ @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1998, 1999, 2000, 2001, @c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. -@setfilename ../info/keymaps +@setfilename ../../info/keymaps @node Keymaps, Modes, Command Loop, Top @chapter Keymaps @cindex keymap @@ -1512,17 +1512,18 @@ specifies a list of keymaps to search in. This argument is ignored if This section describes keymaps that are used during reading a key sequence, to translate certain event sequences into others. @code{read-key-sequence} checks every subsequence of the key sequence -being read, as it is read, against @code{function-key-map} and then -against @code{key-translation-map}. +being read, as it is read, against @code{input-decode-map}, then +@code{function-key-map}, and then against @code{key-translation-map}. + +@defvar input-decode-map -@defvar function-key-map This variable holds a keymap that describes the character sequences sent by function keys on an ordinary character terminal. This keymap has the same structure as other keymaps, but is used differently: it specifies translations to make while reading key sequences, rather than bindings for key sequences. -If @code{function-key-map} ``binds'' a key sequence @var{k} to a vector +If @code{input-decode-map} ``binds'' a key sequence @var{k} to a vector @var{v}, then when @var{k} appears as a subsequence @emph{anywhere} in a key sequence, it is replaced with the events in @var{v}. @@ -1530,50 +1531,49 @@ For example, VT100 terminals send @kbd{@key{ESC} O P} when the keypad @key{PF1} key is pressed. Therefore, we want Emacs to translate that sequence of events into the single event @code{pf1}. We accomplish this by ``binding'' @kbd{@key{ESC} O P} to @code{[pf1]} in -@code{function-key-map}, when using a VT100. +@code{input-decode-map}, when using a VT100. Thus, typing @kbd{C-c @key{PF1}} sends the character sequence @kbd{C-c @key{ESC} O P}; later the function @code{read-key-sequence} translates this back into @kbd{C-c @key{PF1}}, which it returns as the vector @code{[?\C-c pf1]}. -Entries in @code{function-key-map} are ignored if they conflict with -bindings made in the minor mode, local, or global keymaps. The intent -is that the character sequences that function keys send should not have -command bindings in their own right---but if they do, the ordinary -bindings take priority. - -The value of @code{function-key-map} is usually set up automatically +The value of @code{input-decode-map} is usually set up automatically according to the terminal's Terminfo or Termcap entry, but sometimes those need help from terminal-specific Lisp files. Emacs comes with terminal-specific files for many common terminals; their main purpose is -to make entries in @code{function-key-map} beyond those that can be +to make entries in @code{input-decode-map} beyond those that can be deduced from Termcap and Terminfo. @xref{Terminal-Specific}. @end defvar -@defvar key-translation-map -This variable is another keymap used just like @code{function-key-map} -to translate input events into other events. It differs from -@code{function-key-map} in two ways: +@defvar function-key-map -@itemize @bullet -@item -@code{key-translation-map} goes to work after @code{function-key-map} is -finished; it receives the results of translation by -@code{function-key-map}. +This variable holds a keymap similar to @code{input-decode-map} except +that it describes key sequences which should be translated to +alternative interpretations that are usually preferred. It applies +after @code{input-decode-map} and before @code{key-translation-map}. -@item -Non-prefix bindings in @code{key-translation-map} override actual key -bindings. For example, if @kbd{C-x f} has a non-prefix binding in -@code{key-translation-map}, that translation takes effect even though -@kbd{C-x f} also has a key binding in the global map. -@end itemize +Entries in @code{function-key-map} are ignored if they conflict with +bindings made in the minor mode, local, or global keymaps. I.e. +the remapping only applies if the original key sequence would +otherwise not have any binding. +@end defvar -Note however that actual key bindings can have an effect on -@code{key-translation-map}, even though they are overridden by it. -Indeed, actual key bindings override @code{function-key-map} and thus -may alter the key sequence that @code{key-translation-map} receives. -Clearly, it is better to avoid this type of situation. +@defvar key-translation-map +This variable is another keymap used just like @code{input-decode-map} +to translate input events into other events. It differs from +@code{input-decode-map} in that it goes to work after +@code{function-key-map} is finished rather than before; it receives +the results of translation by @code{function-key-map}. + +Just like @code{input-decode-map}, but unlike @code{function-key-map}, +this keymap is applied regardless of whether the input key-sequence +has a normal binding. Note however that actual key bindings can have +an effect on @code{key-translation-map}, even though they are +overridden by it. Indeed, actual key bindings override +@code{function-key-map} and thus may alter the key sequence that +@code{key-translation-map} receives. Clearly, it is better to avoid +this type of situation. The intent of @code{key-translation-map} is for users to map one character set to another, including ordinary characters normally bound @@ -1581,7 +1581,8 @@ to @code{self-insert-command}. @end defvar @cindex key translation function -You can use @code{function-key-map} or @code{key-translation-map} for +You can use @code{input-decode-map}, @code{function-key-map}, or +@code{key-translation-map} for more than simple aliases, by using a function, instead of a key sequence, as the ``translation'' of a key. Then this function is called to compute the translation of that key. diff --git a/lispref/lay-flat.texi b/doc/lispref/lay-flat.texi index 1677058d7ca..1677058d7ca 100644 --- a/lispref/lay-flat.texi +++ b/doc/lispref/lay-flat.texi diff --git a/lispref/lists.texi b/doc/lispref/lists.texi index ffe4df2413d..5c8b552991b 100644 --- a/lispref/lists.texi +++ b/doc/lispref/lists.texi @@ -3,7 +3,7 @@ @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001, @c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. -@setfilename ../info/lists +@setfilename ../../info/lists @node Lists, Sequences Arrays Vectors, Strings and Characters, Top @chapter Lists @cindex lists diff --git a/lispref/loading.texi b/doc/lispref/loading.texi index 058ed9c8984..9b582fe5cf8 100644 --- a/lispref/loading.texi +++ b/doc/lispref/loading.texi @@ -3,7 +3,7 @@ @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001, @c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. -@setfilename ../info/loading +@setfilename ../../info/loading @node Loading, Byte Compilation, Customization, Top @chapter Loading @cindex loading diff --git a/lispref/locals.texi b/doc/lispref/locals.texi index 4edbc2a815f..5248e7b1497 100644 --- a/lispref/locals.texi +++ b/doc/lispref/locals.texi @@ -3,7 +3,7 @@ @c Copyright (C) 1990, 1991, 1992, 1993, 1999, 2001, 2002, 2003, 2004, @c 2005, 2006, 2007 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. -@setfilename ../info/locals +@setfilename ../../info/locals @node Standard Buffer-Local Variables, Standard Keymaps, Standard Errors, Top @appendix Buffer-Local Variables @c The title "Standard Buffer-Local Variables" is too long for diff --git a/lispref/macros.texi b/doc/lispref/macros.texi index b62c8b99d74..152b7b652b6 100644 --- a/lispref/macros.texi +++ b/doc/lispref/macros.texi @@ -3,7 +3,7 @@ @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 2001, 2002, @c 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. -@setfilename ../info/macros +@setfilename ../../info/macros @node Macros, Customization, Functions, Top @chapter Macros @cindex macros @@ -365,7 +365,7 @@ whitespace between the @samp{`}, @samp{,} or @samp{,@@} and the following expression. This syntax is still accepted, for compatibility with old Emacs -versions, but support for it will soon disappear. +versions, but support for it will be removed in the future. @node Problems with Macros @section Common Problems Using Macros diff --git a/lispref/makefile.w32-in b/doc/lispref/makefile.w32-in index 7e35339d17f..720f91c10a3 100644 --- a/lispref/makefile.w32-in +++ b/doc/lispref/makefile.w32-in @@ -22,8 +22,8 @@ # Standard configure variables. srcdir = . -infodir = $(srcdir)/../info -usermanualdir = $(srcdir)/../man +infodir = $(srcdir)/../../info +usermanualdir = $(srcdir)/../emacs # Redefine `TEX' if `tex' does not invoke plain TeX. For example: # TEX=platex @@ -33,7 +33,7 @@ MAKEINFO = makeinfo --force # The environment variable and its value to add $(srcdir) to the path # searched for TeX input files. -texinputdir = $(srcdir)\..\nt\envadd.bat "TEXINPUTS=$(srcdir);$(TEXINPUTS)" /C +texinputdir = $(srcdir)\..\..\nt\envadd.bat "TEXINPUTS=$(srcdir);$(TEXINPUTS)" /C # The name of the manual: VERSION=2.9 diff --git a/lispref/maps.texi b/doc/lispref/maps.texi index 724091970c3..2e370f91238 100644 --- a/lispref/maps.texi +++ b/doc/lispref/maps.texi @@ -3,7 +3,7 @@ @c Copyright (C) 1990, 1991, 1992, 1993, 1999, 2001, 2002, 2003, 2004, @c 2005, 2006, 2007 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. -@setfilename ../info/maps +@setfilename ../../info/maps @node Standard Keymaps, Standard Hooks, Standard Buffer-Local Variables, Top @appendix Standard Keymaps @cindex standard keymaps @@ -113,7 +113,7 @@ The sparse keymap that displays the Special Props submenu of the Text Properties menu. @item function-key-map -The keymap for translating keypad and function keys.@* +The keymap for translating key sequences to preferred alternatives.@* If there are none, then it contains an empty sparse keymap. @xref{Translation Keymaps}. @@ -151,6 +151,11 @@ A sparse keymap used by the @kbd{e} command of Info. @vindex Info-mode-map A sparse keymap containing Info commands. +@item input-decode-map +The keymap for translating keypad and function keys.@* +If there are none, then it contains an empty sparse keymap. +@xref{Translation Keymaps}. + @item isearch-mode-map @vindex isearch-mode-map A keymap that defines the characters you can type within incremental diff --git a/lispref/markers.texi b/doc/lispref/markers.texi index 519b8a1316a..6efc0b893d1 100644 --- a/lispref/markers.texi +++ b/doc/lispref/markers.texi @@ -3,7 +3,7 @@ @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001, @c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. -@setfilename ../info/markers +@setfilename ../../info/markers @node Markers, Text, Positions, Top @chapter Markers @cindex markers diff --git a/lispref/minibuf.texi b/doc/lispref/minibuf.texi index 98901df87f8..8252b42ca94 100644 --- a/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi @@ -3,7 +3,7 @@ @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001, 2002, @c 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. -@setfilename ../info/minibuf +@setfilename ../../info/minibuf @node Minibuffers, Command Loop, Read and Print, Top @chapter Minibuffers @cindex arguments, reading diff --git a/doc/lispref/mkinstalldirs b/doc/lispref/mkinstalldirs new file mode 100755 index 00000000000..f945dbf2bce --- /dev/null +++ b/doc/lispref/mkinstalldirs @@ -0,0 +1,38 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy +# Author: Noah Friedman <friedman@prep.ai.mit.edu> +# Created: 1993-05-16 +# Public domain + +errstatus=0 + +for file +do + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + shift + + pathcomp= + for d + do + pathcomp="$pathcomp$d" + case "$pathcomp" in + -* ) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" 1>&2 + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + fi + fi + + pathcomp="$pathcomp/" + done +done + +exit $errstatus + +# mkinstalldirs ends here diff --git a/lispref/modes.texi b/doc/lispref/modes.texi index 3d60756a901..efaccc2556d 100644 --- a/lispref/modes.texi +++ b/doc/lispref/modes.texi @@ -3,7 +3,7 @@ @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001, @c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. -@setfilename ../info/modes +@setfilename ../../info/modes @node Modes, Documentation, Keymaps, Top @chapter Major and Minor Modes @cindex mode diff --git a/lispref/nonascii.texi b/doc/lispref/nonascii.texi index a8f45e9dd20..7c504aef2cd 100644 --- a/lispref/nonascii.texi +++ b/doc/lispref/nonascii.texi @@ -3,7 +3,7 @@ @c Copyright (C) 1998, 1999, 2001, 2002, 2003, 2004, @c 2005, 2006, 2007 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. -@setfilename ../info/characters +@setfilename ../../info/characters @node Non-ASCII Characters, Searching and Matching, Text, Top @chapter Non-@acronym{ASCII} Characters @cindex multibyte characters diff --git a/lispref/numbers.texi b/doc/lispref/numbers.texi index 4d7f3e7578a..91945967f22 100644 --- a/lispref/numbers.texi +++ b/doc/lispref/numbers.texi @@ -3,7 +3,7 @@ @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001, @c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. -@setfilename ../info/numbers +@setfilename ../../info/numbers @node Numbers, Strings and Characters, Lisp Data Types, Top @chapter Numbers @cindex integers diff --git a/lispref/objects.texi b/doc/lispref/objects.texi index e75cde70202..b4114a97d5d 100644 --- a/lispref/objects.texi +++ b/doc/lispref/objects.texi @@ -3,7 +3,7 @@ @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001, @c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. -@setfilename ../info/objects +@setfilename ../../info/objects @node Lisp Data Types, Numbers, Introduction, Top @chapter Lisp Data Types @cindex object diff --git a/lispref/os.texi b/doc/lispref/os.texi index 08f94b427eb..68fba8d9774 100644 --- a/lispref/os.texi +++ b/doc/lispref/os.texi @@ -3,7 +3,7 @@ @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001, @c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. -@setfilename ../info/os +@setfilename ../../info/os @node System Interface, Antinews, Display, Top @chapter Operating System Interface @@ -279,7 +279,7 @@ trying the @samp{.elc} and @samp{.el} suffixes. @cindex Termcap The usual function of a terminal-specific library is to enable special keys to send sequences that Emacs can recognize. It may also -need to set or add to @code{function-key-map} if the Termcap or +need to set or add to @code{input-decode-map} if the Termcap or Terminfo entry does not specify all the terminal's function keys. @xref{Terminal Input}. diff --git a/lispref/positions.texi b/doc/lispref/positions.texi index 939b3f75fc1..3e1d79acad8 100644 --- a/lispref/positions.texi +++ b/doc/lispref/positions.texi @@ -3,7 +3,7 @@ @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001, @c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. -@setfilename ../info/positions +@setfilename ../../info/positions @node Positions, Markers, Frames, Top @chapter Positions @cindex position (in buffer) diff --git a/lispref/processes.texi b/doc/lispref/processes.texi index f7be990b85e..28e41a09973 100644 --- a/lispref/processes.texi +++ b/doc/lispref/processes.texi @@ -3,7 +3,7 @@ @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001, @c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. -@setfilename ../info/processes +@setfilename ../../info/processes @node Processes, Display, Abbrevs, Top @chapter Processes @cindex child process @@ -2062,7 +2062,8 @@ That particular network option is supported by @section Misc Network Facilities These additional functions are useful for creating and operating -on network connections. +on network connections. Note that they are supported only on some +systems. @defun network-interface-list This function returns a list describing the network interfaces diff --git a/lispref/searching.texi b/doc/lispref/searching.texi index 70926478ea7..91b57ea4e4f 100644 --- a/lispref/searching.texi +++ b/doc/lispref/searching.texi @@ -3,7 +3,7 @@ @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001, @c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. -@setfilename ../info/searching +@setfilename ../../info/searching @node Searching and Matching, Syntax Tables, Non-ASCII Characters, Top @chapter Searching and Matching @cindex searching diff --git a/lispref/sequences.texi b/doc/lispref/sequences.texi index 7e66549412b..8b25350d869 100644 --- a/lispref/sequences.texi +++ b/doc/lispref/sequences.texi @@ -3,7 +3,7 @@ @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001, @c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. -@setfilename ../info/sequences +@setfilename ../../info/sequences @node Sequences Arrays Vectors, Hash Tables, Lists, Top @chapter Sequences, Arrays, and Vectors @cindex sequence diff --git a/lispref/spellfile b/doc/lispref/spellfile index b373d00bebf..b373d00bebf 100644 --- a/lispref/spellfile +++ b/doc/lispref/spellfile diff --git a/lispref/streams.texi b/doc/lispref/streams.texi index 7356c119a1e..ada6376305f 100644 --- a/lispref/streams.texi +++ b/doc/lispref/streams.texi @@ -3,7 +3,7 @@ @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1998, 1999, 2001, 2002, @c 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. -@setfilename ../info/streams +@setfilename ../../info/streams @node Read and Print, Minibuffers, Debugging, Top @comment node-name, next, previous, up @chapter Reading and Printing Lisp Objects diff --git a/lispref/strings.texi b/doc/lispref/strings.texi index af5a2fa14d3..b2f32ad02d6 100644 --- a/lispref/strings.texi +++ b/doc/lispref/strings.texi @@ -3,7 +3,7 @@ @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001, @c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. -@setfilename ../info/strings +@setfilename ../../info/strings @node Strings and Characters, Lists, Numbers, Top @comment node-name, next, previous, up @chapter Strings and Characters diff --git a/lispref/symbols.texi b/doc/lispref/symbols.texi index 7234a75bd59..08f7d7f1ca1 100644 --- a/lispref/symbols.texi +++ b/doc/lispref/symbols.texi @@ -3,7 +3,7 @@ @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001, @c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. -@setfilename ../info/symbols +@setfilename ../../info/symbols @node Symbols, Evaluation, Hash Tables, Top @chapter Symbols @cindex symbol diff --git a/lispref/syntax.texi b/doc/lispref/syntax.texi index 340f74632bd..83f6856c65b 100644 --- a/lispref/syntax.texi +++ b/doc/lispref/syntax.texi @@ -3,7 +3,7 @@ @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001, @c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. -@setfilename ../info/syntax +@setfilename ../../info/syntax @node Syntax Tables, Abbrevs, Searching and Matching, Top @chapter Syntax Tables @cindex parsing buffer text diff --git a/lispref/text.texi b/doc/lispref/text.texi index 430c48133ee..c6da06b4a13 100644 --- a/lispref/text.texi +++ b/doc/lispref/text.texi @@ -3,7 +3,7 @@ @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001, @c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. -@setfilename ../info/text +@setfilename ../../info/text @node Text, Non-ASCII Characters, Markers, Top @chapter Text @cindex text @@ -1453,6 +1453,12 @@ The variable @code{paragraph-separate} controls how to distinguish paragraphs. @xref{Standard Regexps}. @end deffn +@deffn Command fill-paragraph-or-region justify +In Transient Mark mode, when the mark is active, this command calls +@code{fill-region} on the active region. Otherwise, it calls +@code{fill-paragraph}. +@end deffn + @deffn Command fill-individual-paragraphs start end &optional justify citation-regexp This command fills each paragraph in the region according to its individual fill prefix. Thus, if the lines of a paragraph were indented diff --git a/lispref/tindex.pl b/doc/lispref/tindex.pl index 89bbe5f5f6f..89bbe5f5f6f 100755 --- a/lispref/tindex.pl +++ b/doc/lispref/tindex.pl diff --git a/lispref/tips.texi b/doc/lispref/tips.texi index f3070f4659b..f16749a214d 100644 --- a/lispref/tips.texi +++ b/doc/lispref/tips.texi @@ -3,7 +3,7 @@ @c Copyright (C) 1990, 1991, 1992, 1993, 1995, 1998, 1999, 2001, 2002, @c 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. -@setfilename ../info/tips +@setfilename ../../info/tips @node Tips, GNU Emacs Internals, GPL, Top @appendix Tips and Conventions @cindex tips for writing Lisp diff --git a/lispref/two-volume-cross-refs.txt b/doc/lispref/two-volume-cross-refs.txt index 6e40920cf66..6e40920cf66 100644 --- a/lispref/two-volume-cross-refs.txt +++ b/doc/lispref/two-volume-cross-refs.txt diff --git a/lispref/two-volume.make b/doc/lispref/two-volume.make index b2550576825..b2550576825 100644 --- a/lispref/two-volume.make +++ b/doc/lispref/two-volume.make diff --git a/lispref/two.el b/doc/lispref/two.el index baade844463..baade844463 100644 --- a/lispref/two.el +++ b/doc/lispref/two.el diff --git a/lispref/variables.texi b/doc/lispref/variables.texi index 9d9dc8260bb..d5f1035c169 100644 --- a/lispref/variables.texi +++ b/doc/lispref/variables.texi @@ -3,7 +3,7 @@ @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, @c 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. -@setfilename ../info/variables +@setfilename ../../info/variables @node Variables, Functions, Control Structures, Top @chapter Variables @cindex variable diff --git a/lispref/vol1.texi b/doc/lispref/vol1.texi index d41b2f076df..d41b2f076df 100644 --- a/lispref/vol1.texi +++ b/doc/lispref/vol1.texi diff --git a/lispref/vol2.texi b/doc/lispref/vol2.texi index 515973c6281..515973c6281 100644 --- a/lispref/vol2.texi +++ b/doc/lispref/vol2.texi diff --git a/lispref/windows.texi b/doc/lispref/windows.texi index bd8f7bc2d36..9a49401485e 100644 --- a/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -3,7 +3,7 @@ @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001, @c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. -@setfilename ../info/windows +@setfilename ../../info/windows @node Windows, Frames, Buffers, Top @chapter Windows @@ -55,15 +55,11 @@ multiple nonoverlapping Emacs windows. In each frame, at any time, one and only one window is designated as @dfn{selected within the frame}. The frame's cursor appears in that window, but the other windows have ``non-selected'' cursors, normally -less visible. At any time, one frame is the selected frame; and the -window selected within that frame is @dfn{the selected window}. The -selected window's buffer is usually the current buffer (except when -@code{set-buffer} has been used). @xref{Current Buffer}. - -@defvar cursor-in-non-selected-windows -If this variable is @code{nil}, Emacs displays only one cursor, -in the selected window. Other windows have no cursor at all. -@end defvar +less visible. (@pxref{Cursor Parameters}, for customization of this.) +At any time, one frame is the selected frame; and the window selected +within that frame is @dfn{the selected window}. The selected window's +buffer is usually the current buffer (except when @code{set-buffer} +has been used). @xref{Current Buffer}. For practical purposes, a window exists only while it is displayed in a frame. Once removed from the frame, the window is effectively deleted @@ -2246,13 +2242,13 @@ similar to the value returned by @code{window-edges}. @cindex saving window information A @dfn{window configuration} records the entire layout of one -frame---all windows, their sizes, which buffers they contain, what -part of each buffer is displayed, and the values of point and the -mark; also their fringes, margins, and scroll bar settings. It also +frame---all windows, their sizes, which buffers they contain, how +those buffers are scrolled, and their values of point and the mark; +also their fringes, margins, and scroll bar settings. It also includes the values of @code{window-min-height}, -@code{window-min-width} and @code{minibuffer-scroll-window}. An -exception is made for point in the selected window for the current -buffer; its value is not saved in the window configuration. +@code{window-min-width} and @code{minibuffer-scroll-window}. As a +special exception, the window configuration does not record the value +of point in the selected window for the current buffer. You can bring back an entire previous layout by restoring a window configuration previously saved. If you want to record all frames diff --git a/doc/man/ChangeLog b/doc/man/ChangeLog new file mode 100644 index 00000000000..24cae258db5 --- /dev/null +++ b/doc/man/ChangeLog @@ -0,0 +1,31 @@ +2007-09-06 Glenn Morris <rgm@gnu.org> + + * ctags.1, emacs.1, emacsclient.1, etags.1: Move from etc/ to + doc/man/. + +;; Local Variables: +;; coding: iso-2022-7bit +;; fill-column: 79 +;; add-log-time-zone-rule: t +;; End: + + Copyright (C) 2007 Free Software Foundation, Inc. + + This file is part of GNU Emacs. + + GNU Emacs is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + GNU Emacs is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Emacs; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. + +;; arch-tag: 2bd1112e-157f-4884-b0ca-0fb1057972d7 diff --git a/etc/ctags.1 b/doc/man/ctags.1 index 9a6505b020e..9a6505b020e 100644 --- a/etc/ctags.1 +++ b/doc/man/ctags.1 diff --git a/etc/emacs.1 b/doc/man/emacs.1 index 87a382272c5..87a382272c5 100644 --- a/etc/emacs.1 +++ b/doc/man/emacs.1 diff --git a/etc/emacsclient.1 b/doc/man/emacsclient.1 index 8852372dd75..8852372dd75 100644 --- a/etc/emacsclient.1 +++ b/doc/man/emacsclient.1 diff --git a/etc/etags.1 b/doc/man/etags.1 index 04b67f389f4..04b67f389f4 100644 --- a/etc/etags.1 +++ b/doc/man/etags.1 diff --git a/etc/AUTHORS b/etc/AUTHORS new file mode 100644 index 00000000000..b88c0b69bda --- /dev/null +++ b/etc/AUTHORS @@ -0,0 +1,2766 @@ +Many people have contributed code included in the Free Software +Foundation's distribution of GNU Emacs. To show our appreciation for +their public spirit, we list here in alphabetical order a condensed +list of their contributions. + +Aaron Larson: changed bibtex.el + +Aaron S. Hawley: changed files.texi files.el isearch.el misc.texi + +Abraham Nahum: changed configure.in dgux4.h sysdep.c + +Abramo Bagnara: changed term.c + +Adrian Aichner: changed erc-log.el erc.el erc-autojoin.el erc-backend.el + erc-dcc.el erc-members.el erc-nets.el erc-sound.el etags.c + gnus-score.el + +Adrian Colley: changed aix3-2.h + +Adrian Lanz: changed mail-source.el spam.el + +Agust,Am(Bn Mart,Am(Bn: changed flyspell.el ispell.el + +Aidan Kehoe: changed lread.c mm-util.el erc.el objects.texi + +Ake Stenhoff: wrote imenu.el +and changed cc-mode.el perl-mode.el + +Aki Vehtari: changed bibtex.el gnus-art.el gnus-score.el gnus-sum.el + nnmail.el tar-mode.el + +Alakazam Petrofsky: changed hanoi.el + +Alan Mackenzie: wrote cc-awk.el +and changed cc-cmds.el cc-mode.el cc-engine.el cc-defs.el cc-vars.el + cc-langs.el cc-mode.texi cc-styles.el cc-align.el cc-fonts.el lread.c + programs.texi cc-subword.el isearch.el lisp.el search.texi startup.el + subr.el text.texi buffers.texi cc-fix.el and 18 other files + +Alan Shutko: changed diary-lib.el calendar.el bindings.el cal-hebrew.el + easy-mmode.el gnus-sum.el ibuf-ext.el ibuffer.el lunar.el macros.el + solar.el + +Alastair Burt: changed gnus-art.el smiley.el + +Albert L. Ting: changed gnus-group.el mail-hist.el + +Alex Coventry: changed files.el + +Alex Ott: changed TUTORIAL.ru ru-refcard.tex ispell.el ru-refcard.ps + +Alex Rezinsky: wrote which-func.el + +Alex Schroeder: wrote ansi-color.el cus-theme.el erc-compat.el + erc-hecomplete.el erc-join.el erc-lang.el erc-ring.el master.el + spam-stat.el sql.el +and changed erc.el erc-track.el erc-button.el erc-stamp.el erc-match.el + erc-autoaway.el erc-nickserv.el Makefile erc-autojoin.el erc-fill.el + erc-pcomplete.el erc-complete.el erc-ibuffer.el erc-members.el + rcirc.texi comint.el custom.el erc-bbdb.el erc-chess.el erc-ezbounce.el + erc-imenu.el and 26 other files + +Alexander Klimov: changed man.el + +Alexander Kreuzer: changed nnrss.el + +Alexander L. Belikoff: wrote erc.el + +Alexander Pohoyda: changed rmailsum.el man.el rmail.el sendmail.el + +Alexander Shopov: changed code-pages.el + +Alexander Zhuckov: changed ebrowse.c + +Alexandre Oliva: wrote gnus-mlspl.el +and changed unexelf.c format.el iris4d.h iris5d.h unexsgi.c + +Alexandre Veyrenc: changed fr-refcard.tex + +Alfred Correira: changed generic-x.el + +Alfred M. Szmidt: changed compile.el html2text.el openbsd.h + +Alfredo Finelli: changed TUTORIAL.it + +Alin C. Soare: changed lisp-mode.el hexl.el + +Ami Fischman: changed calendar.el diary-lib.el + +Anders Holst: wrote hippie-exp.el + +Anders Lindgren: wrote autorevert.el cwarn.el follow.el +and changed font-lock.el etags.c compile.el + +Andre Spiegel: changed vc.el vc-hooks.el vc-cvs.el vc-rcs.el vc-sccs.el + files.el dired.el files.texi cperl-mode.el ediff-util.el log-view.el + parse-time.el startup.el tramp-vc.el vc-arch.el vc-mcvs.el vc-svn.el + vcdiff viper-util.el + +Andre Srinivasan: changed gnus-group.el gnus-sum.el gnus.texi message.el + mm-decode.el mml.el nnmail.el + +Andrea Russo: changed erc-dcc.el info-look.el + +Andreas B,A|(Bsching: changed emacsclient.c + +Andreas Fuchs: wrote erc-ezbounce.el erc-fill.el erc-match.el + erc-replace.el erc-truncate.el +and changed erc.el erc-bbdb.el erc-button.el erc-log.el erc-stamp.el + erc-autoaway.el erc-autojoin.el erc-dcc.el erc-imenu.el erc-list.el + erc-members.el erc-menu.el erc-netsplit.el erc-notify.el erc-ring.el + erc-speedbar.el erc-track.el erc-xdcc.el gnus-registry.el mml-sec.el + mml2015.el + +Andreas Jaeger: changed gnus-msg.el gnus-start.el gnus-xmas.el + nnfolder.el nnml.el + +Andreas Leue: changed artist.el + +Andreas Luik: changed xfns.c xterm.c + +Andreas Schwab: changed Makefile.in files.el lisp.h xdisp.c configure.in + alloc.c fns.c print.c coding.c editfns.c dired.el info.el eval.c + fileio.c simple.el buffer.c minibuf.c process.c xterm.c emacs.c + keyboard.c and 449 other files + +Andreas Seltenreich: changed nnweb.el gnus.texi nnslashdot.el + gnus-util.el mm-uu.el url-http.el battery.el comint.el easy-mmode.el + gmm-utils.el gnus-art.el gnus-ml.el gnus-msg.el gnus-srvr.el + gnus-start.el gnus-sum.el gnus.el message.el mm-url.el url-cookie.el + xterm.c + +Andrew Choi: wrote mac-win.el +and changed macterm.c mac.c macfns.c INSTALL macmenu.c darwin.h macterm.h + sysdep.c emacs.c fontset.c frame.c keyboard.c macgui.h xfaces.c Emacs.r + README cw5-mcp.xml cw6-mcp.xml dispextern.h make-package makefile.MPW + and 61 other files + +Andrew Cohen: changed dns.el + +Andrew Csillag: wrote m4-mode.el + +Andrew Hall: changed paren.el + +Andrew Innes: changed makefile.w32-in w32fns.c w32term.c w32.c w32proc.c + fileio.c gmake.defs dos-w32.el ms-w32.h nmake.defs w32-fns.el w32term.h + unexw32.c w32menu.c w32xfns.c addpm.c cmdproxy.c emacs.c w32-win.el + w32inevt.c configure.bat and 135 other files + +Andrew Oram: changed man/calendar.texi + miscellaneous changes to files in man/ + +Andrey Slusar: changed gnus.el + +Andrey Zhdanov: changed gud.el + +Andy Norman: wrote ange-ftp.el + +Andy Petrusenco: changed w32term.c + +Anna M. Bigatti: wrote cal-html.el + +Ari Roponen: changed atimer.c startup.el + +Arisawa Akihiro: changed mm-decode.el mm-view.el ps-print.el time.el + utf-8.el + +Arne Georg Gleditsch: changed gnus-sum.el + +Arne J,Ax(Brgensen: wrote latexenc.el +and changed smime.el gnus-art.el gnus-sieve.el ldap.el message.el + mm-decode.el mule-conf.el nnimap.el nnrss.el wid-edit.el + +Artem Chuprina: changed message.el + +Ashwin Ram: wrote refer.el + +Aubrey Jaffer: changed info.el unexelf.c + +Axel Boldt: changed ehelp.el electric.el + +B. Anyos: changed w32term.c + +Barry A. Warsaw: wrote assoc.el elp.el man.el regi.el reporter.el + supercite.el +and changed cc-mode.el cc-cmds.el cc-engine.el cc-langs.el cc-styles.el + cc-vars.el c++-mode.el cc-menus.el cc-align.el cc-defs.el cplus-md1.el + syntax.c syntax.h + +Barry Fishman: changed gnu-linux.h + +Ben A. Mesander: wrote erc-dcc.el + +Ben Harris: changed configure.in + +Ben Key: changed w32.c w32fns.c w32menu.c makefile.w32-in w32.h w32term.c + emacs.c gmake.defs ms-w32.h nmake.defs sound.c + +Ben North: changed outline.el fill.el isearch.el lisp-mode.el paren.el + w32term.c xfaces.c + +Benjamin Drieu: wrote pong.el + +Benjamin Riefenstahl: changed emacs.c mac-win.el macterm.c ms-w32.h + mule-cmds.el runemacs.c tcl.el w32.c w32.h w32select.c + +Benjamin Rutt: changed vc.el gnus-msg.el message.el diff-mode.el ffap.el + gnus-dired.el nnimap.el nnmbox.el simple.el vc-cvs.el + +Bill Atkins: changed wdired.el + +Bill Burton: changed ptx.h sequent-ptx.h + +Bill Carpenter: wrote feedmail.el (public domain) + +Bill Mann: changed configure.in unexaix.c ibmrs6000.h usg5-4-3.h + +Bill Pringlemeir: changed messcompat.el + +Bill Richter: changed fill.el quail.el ccl.el encoded-kb.el fontset.el + kinsoku.el kkc.el mule-cmds.el mule-conf.el mule-util.el mule.el + +Bill Rosenblatt: wrote float.el + +Bill Rozas: wrote scheme.el +and changed xscheme.el + +Bill White: changed gnus-start.el + +Bill Wohler: wrote mh-buffers.el mh-comp.el mh-compat.el mh-e.el + mh-folder.el mh-funcs.el mh-letter.el mh-loaddefs.el mh-mime.el + mh-scan.el mh-seq.el mh-show.el mh-utils.el mh-xface.el +and changed mh-customize.el mh-index.el MH-E-NEWS mh-alias.el Makefile + mh-identity.el mh-pick.el README mh-speed.el mh-init.el mh-junk.el + mh-e.texi mh-acros.el mh-gnus.el mh-search.el mh-unit.el mh-inc.el + mh-xemacs-compat.el mh-print.el Makefile.in image.el and 88 other files + +Bjorn Solberg: changed nnimap.el + +Bj,Av(Brn Lindstr,Av(Bm: changed rcirc.texi + +Bj,Av(Brn Torkelsson: changed gnus-art.el gnus-group.el gnus-srvr.el + gnus-sum.el gnus-mlspl.el gnus-msg.el message.el dgnushack.el + gnus-agent.el gnus-cus.el gnus-gl.el gnus-nocem.el gnus-score.el + gnus-topic.el gnus.el mail-source.el nnmail.el + +Bj,Ax(Brn Mork: changed gnus-agent.el message.el mml2015.el + +Blitz Product Development Corporation: wrote ispell.el + +Boaz Ben-Zvi: wrote profile.el + +Bob Glickstein: wrote sregex.el +and changed isearch.el sendmail.el + +Bob Halley: changed esh-io.el + +Bob Rogers: changed ffap.el thingatpt.el + +Bob Weiner: changed info.el quail.el + +Boris Goldowsky: wrote avoid.el descr-text.el enriched.el facemenu.el + format.el shadowfile.el +and changed fill.el simple.el indent.el paragraphs.el cmds.c intervals.c + intervals.h add-log.el cc-mode.el enriched.doc fileio.c make-mode.el + text-mode.el textprop.c ada.el allout.el awk-mode.el bibtex.el buffer.c + buffer.h c-mode.el and 38 other files + +Boris Samorodov: changed imap.el + +Boyd Lynn Gerber: changed configure.in + +Brad Howes: changed gnus-demon.el + +Brad Miller: wrote gnus-gl.el + +Brendan Kehoe: changed hpux9.h + +Brian D. Carlstrom: changed gud.el smtpmail.el + +Brian Fox: changed Makefile.in configure.in minibuf.c dired.el files.el + rmail.el search.c simple.el sysdep.c Makefile compile.el forms.texi + frame.c info.texi keyboard.c make-dist subr.el systty.h xterm.c INSTALL + alloc.c and 44 other files + +Brian Marick: wrote hideif.el + +Brian P Templeton: changed erc.el erc-compat.el erc-fill.el + erc-nickserv.el erc-pcomplete.el erc-stamp.el erc-track.el + +Brian Palmer: changed erc.el erc-list.el + +Brian Preble: changed abbrev.el apropos.el asm-mode.el doctex.el + abbrevlist.el ada.el add-log.el appt.el array.el autoload.el + awk-mode.el bg-mouse.el bib-mode.el blackbox.el buff-menu.el + bug-screen.el bytecomp.el c++-mode.el c-comment.el c-fill.el c-mode.el + and 92 other files + +Bruno Haible: changed INSTALL emacs.1 epaths.in info.el paths.el + +Bryan D. O'connor: changed make-package + +Bryan Henderson: changed Makefile term.el + +Bryan O'sullivan: changed ange-ftp.el + +Caleb Deupree: changed winnt.el + +Carl D. Roth: changed gnus-nocem.el + +Carsten Bormann: changed ibmrs6000.h + +Carsten Dominik: wrote idlw-complete-structtag.el idlw-toolbar.el org.el + reftex-auc.el reftex-cite.el reftex-dcr.el reftex-global.el + reftex-index.el reftex-parse.el reftex-ref.el reftex-sel.el + reftex-toc.el reftex-vars.el reftex.el +and changed org.texi orgcard.tex idlw-shell.el idlwave.el idlw-rinfo.el + reftex.texi reftex-vcr.el diary-lib.el bibtex.el bookmark.el files.el + idlwave-rinfo.el idlwave-shell.el idlwave-toolbar.el + +Caveh Jalali: changed configure.in intel386.h sol2-4.h + +Changwoo Ryu: changed files.el + +Chao-Hong Liu: changed TUTORIAL.cn TUTORIAL.zh + +Charles Hannum: changed aix3-1.h aix3-2.h configure ibmrs6000.h + keyboard.c netbsd.h pop.c sysdep.c systime.h systty.h xrdb.c + +Charlie Martin: wrote autoinsert.el + +Cheng Gao: changed MORE.STUFF flymake.el tips.texi url-dired.el + url-file.el url-handlers.el url-http.el url-nfs.el + +Chong Yidong: changed cus-edit.el simple.el files.el custom.el + display.texi xdisp.c longlines.el files.texi info.el keyboard.c + compile.el custom.texi text.texi xterm.c frames.texi image-mode.el + mouse.el misc.texi startup.el wid-edit.el cus-theme.el + and 297 other files + +Chris Hanson: changed xscheme.el scheme.el xterm.c hpux.h x11term.c + hp9000s300.h keyboard.c process.c texinfmt.el emacsclient.c sort.el + syntax.c texnfo-upd.el x11fns.c xfns.c dired.el fileio.c hp9000s800.h + indent.c info.el man.el and 17 other files + +Chris Moore: changed dired.el hexl.el replace.el Makefile.in gnus-sum.el + isearch.el jka-cmpr-hook.el pgg-gpg.el pgg-pgp.el pgg-pgp5.el + tutorial.el wdired.el + +Chris Prince: changed w32term.c + +Chris Smith: wrote icon.el +and changed icon-mode.el + +Christian Limpach: changed configure.in + +Christian Lynbech: changed appt.el emacsserver.c + +Christian Neukirchen: changed mm-util.el + +Christian Plaunt: wrote soundex.el + +Christian Von Roques: changed gnus-start.el + +Christoph Bauer: changed configure.in + +Christoph Conrad: changed gnus-agent.el gnus-score.el makefile.w32-in + qp.el + +Christoph Wedler: wrote antlr-mode.el +and changed format.el gnus-art.el gnus-picon.el message.el register.el + smiley.el texinfmt.el + +Christopher Allan Webber: changed gamegrid.el tetris.el + +Christopher J. Madsen: wrote decipher.el +and changed files.el ispell.el replace.el time.el + +Chunyu Wang: changed gnus-art.el pcl-cvs.texi + +Claudio Fontana: changed Makefile.in + +Colin Marquardt: changed gnus.el message.el + +Colin Rafferty: changed message.el + +Colin Walters: wrote ibuf-ext.el ibuf-macs.el ibuffer.el +and changed calc.el replace.el update-game-score.c calc-ext.el + calc-misc.el Makefile.in calc-macs.el calc-mode.el calc-graph.el + gamegrid.el calc-aent.el calc-bin.el calc-embed.el calc-keypd.el + calc-math.el calc-prog.el calc-units.el calcalg2.el font-core.el + info.el calc-alg.el and 78 other files + +Craig Mcdaniel: changed sheap.c + +Daiki Ueno: wrote pgg-def.el pgg-gpg.el pgg-parse.el pgg-pgp.el + pgg-pgp5.el pgg.el starttls.el +and changed gnus-sum.el mml2015.el gnus-agent.el gnus-srvr.el + message.texi mml1991.el pgg.texi + +Dale Gulledge: changed TUTORIAL.eo + +Dale Hagglund: changed unexelf.c + +Dale R. Worley: wrote emerge.el (public domain) +and changed mail-extr.el + +Damien Elmes: changed erc.el erc-dcc.el erc-track.el erc-log.el + erc-pcomplete.el README erc-button.el erc-nets.el erc-ring.el Makefile + erc-fill.el erc-match.el erc-members.el erc-nickserv.el + +Damon Anton Permezel: wrote hanoi.el (public domain) + +Dan Christensen: changed gnus-sum.el nnfolder.el gnus-art.el + gnus-group.el gnus-registry.el gnus-score.el nndoc.el nnmail.el + +Dan Nicolaescu: wrote iris-ansi.el romanian.el +and changed term.el xterm.el hideshow.el isearch.el icon.el lisp.h + cus-edit.el faces.el font-lock.el grep.el sh-script.el eterm-color.ti + ibuffer.el rxvt.el vhdl-mode.el xterm.c bindings.el compile.el + dabbrev.el imenu.el outline.el and 166 other files + +Daniel Brockman: changed cus-start.el format-spec.el ibuffer.el rcirc.el + +Daniel Laliberte: wrote cl-specs.el cust-print.el edebug.el hideif.el + isearch.el +and changed mlconvert.el eval-region.el + +Daniel M Coffman: changed arc-mode.el + +Daniel N,Ai(Bri: changed message.el + +Daniel Ortmann: changed paragraphs.el + +Daniel Pfeiffer: wrote conf-mode.el copyright.el executable.el + sh-script.el skeleton.el two-column.el wyse50.el +and changed compile.el files.el make-mode.el apropos.el buff-menu.el + font-lock.el grep.el mpuz.el sgml-mode.el autoinsert.el cperl-mode.el + facemenu.el gomoku.el help.el imenu.el autoload.el autorevert.el + bindings.el button.el cc-fonts.el cc-mode.el and 12 other files + +Daniel Pittman: wrote tramp-vc.el +and changed gnus-spec.el gnus-sum.el nnimap.el + +Daniel Quinlan: changed dired.el info.el + +Danny Roozendaal: wrote handwrite.el + +Danny Siu: changed gnus-picon.el gnus-sum.el nndoc.el nnimap.el smiley.el + +Darren Stalder: changed gnus-util.el + +Darrin B. Jewell: changed etags.c lisp.h + +Dave Lambert: changed sol2-5.h xfns.c xterm.c xterm.h + +Dave Love: wrote autoarg.el autoconf.el benchmark.el cfengine.el + code-pages.el elide-head.el georgian.el hl-line.el latin-8.el + latin-9.el latin1-disp.el python.el refill.el rfc1345.el sgml-input.el + smiley.el subst-big5.el subst-gb2312.el subst-jis.el subst-ksc.el + tool-bar.el ucs-tables.el uni-input.el utf-16.el utf-7.el utf-8-lang.el + welsh.el +and changed configure.in Makefile.in help.el fortran.el browse-url.el + mule-cmds.el simple.el xterm.c cus-edit.el files.el info.el mule.el + wid-edit.el fns.c vc.el rfc2047.el bindings.el cus-start.el buffer.c + byte-opt.el bytecomp.el and 727 other files + +Dave Pearson: wrote 5x5.el quickurl.el + +David A. Capello: changed etags.c + +David Abrahams: changed coding.c + +David Bakhash: wrote strokes.el + +David Byers: changed minibuf.c + +David Casperson: changed menu-bar.el tex-mode.el + +David Edmondson: changed message.el gnus-cite.el imap.el mm-view.el + nnfolder.el nnml.el + +David Gillespie: wrote calc-aent.el calc-alg.el calc-arith.el calc-bin.el + calc-comb.el calc-cplx.el calc-embed.el calc-ext.el calc-fin.el + calc-forms.el calc-frac.el calc-funcs.el calc-graph.el calc-help.el + calc-incom.el calc-keypd.el calc-lang.el calc-macs.el calc-map.el + calc-math.el calc-misc.el calc-mode.el calc-mtx.el calc-poly.el + calc-prog.el calc-rewr.el calc-rules.el calc-sel.el calc-stat.el + calc-store.el calc-stuff.el calc-trail.el calc-undo.el calc-units.el + calc-vec.el calc-yank.el calc.el calcalg2.el calcalg3.el calccomp.el + calcsel2.el cl-compat.el cl-extra.el cl-macs.el cl-seq.el cl.el + cl.texinfo complete.el edmacro.el +and changed info.el bytecomp.el + +David Hansen: changed nnrss.el cc-cmds.el lisp.el pcomplete.el tempo.el + +David Hedbor: changed gnus-art.el mm-decode.el mm-view.el gnus-agent.el + gnus-cite.el gnus-cus.el gnus-eform.el gnus-group.el gnus-msg.el + gnus-score.el gnus-spec.el gnus-util.el gnus.el mail-source.el + message.el mm-encode.el mm-util.el nndoc.el nnmail.el score-mode.el + webmail.el + +David Hunter: changed config.nt flymake.el ms-w32.h process.c + +David J. Mackenzie: changed configure.in etags.c fakemail.c movemail.c + wakeup.c Makefile cvtmail.c qsort.c termcap.c yow.c Makefile.in + avoid.el b2m.c digest-doc.c emacsclient.c emacsserver.c emacstool.c + etags-vmslib.c fortran.el hexl.c isearch.el and 12 other files + +David Kastrup: changed greek.el replace.el faq.texi search.c ange-ftp.el + help.el mouse.el Makefile.in calc.el desktop.el keymaps.texi + meta-mode.el process.c search.texi subr.el woman.el DEBUG DEVEL.HUMOR + MAILINGLISTS autoload.el browse-url.el and 37 other files + +David K,Ae(Bgedal: wrote tempo.el +and changed sendmail.el xmenu.c + +David Lawrence: changed loaddefs.el comint.el simple.el files.el + c++-mode.el compile.el inf-lisp.el shell.el tex-mode.el MACHINES + Makefile c-mode.el cl.el dired.el emacs.1 emacsserver.c emerge.el + gnus.el history.el lisp-mode.el lisp.el and 78 other files + +David M. Brown: wrote array.el + +David M. Koppelman: changed hi-lock.el display.texi + +David M. Koppelman, Koppel@Ece.Lsu.Edu: wrote hi-lock.el + +David M. Smith: wrote ielm.el +and changed imenu.el + +David Mccabe: changed lisp-mode.el + +David Megginson: wrote derived.el +and changed mode-clone.el + +David Moore: wrote nnvirtual.el +and changed gnus-xmas.el + +David Mosberger-Tang: changed alpha.h unexelf.c cm.h config.in + configure.in cvtmail.c data.c dispnew.c emacsserver.c etags.c + fakemail.c keyboard.c mem-limits.h process.c profile.c sorted-doc.c + sysdep.c terminfo.c unexelf1.c yow.c + +David Ponce: wrote recentf.el ruler-mode.el tree-widget.el +and changed w32menu.c w32term.c close.png close.xpm empty.png empty.xpm + end-guide.png end-guide.xpm files.el guide.png guide.xpm handle.png + handle.xpm keyboard.c leaf.png leaf.xpm no-guide.png no-guide.xpm + no-handle.png no-handle.xpm open.png and 21 other files + +David Reitter: wrote mailclient.el +and changed commands.h cus-edit.el easy-mmode.el emacsbug.el + emacsclient.c keymap.c macterm.c menu-bar.el minibuf.c python.el + sendmail.el url-http.el + +David Robinson: changed menu-bar.el x-win.el + +David S. Goldberg: changed gnus-art.el message.el + +David Vazquez: changed m4-mode.el + +David Z. Maze: changed nnml.el nnrss.el + +Davis Herring: changed timeclock.el + +Deanna Phillips: changed configure.in + +Decklin Foster: changed nngateway.el + +Deepak Goel: changed README ada-mode.el ada-xref.el appt.el apropos.el + artist.el bibtex.el bookmark.el calc-forms.el calc-mode.el + calc-units.el calc.el cmacexp.el decipher.el desktop.el diary-lib.el + dired-aux.el dnd.el doctor.el ebnf2ps.el echistory.el + and 50 other files + +Denis Bueno: changed autorevert.el + +Denis Howe: wrote browse-url.el + +Denis St,A|(Bnkel: changed ibuf-ext.el + +Derek Atkins: changed imap.el pgg-pgp.el + +Derek L. Davies: changed gud.el + +Detlev Zundel: wrote re-builder.el + +Dhruva Krishnamurthy: changed makefile.w32-in + +Diane Murray: changed erc.el erc-menu.el erc-backend.el erc-button.el + erc-track.el erc-match.el erc-nets.el erc-list.el erc-autoaway.el + erc-capab.el erc-nickserv.el erc-stamp.el erc-compat.el erc-fill.el + erc-goodies.el erc-ibuffer.el erc-log.el Makefile erc-dcc.el + erc-networks.el erc-nicklist.el and 32 other files + +Dick King: wrote uniquify.el + +Didier Verna: wrote gnus-diary.el nndiary.el +and changed nntp.el gnus-art.el gnus-msg.el gnus-group.el gnus-start.el + gnus-sum.el gnus-xmas.el gnus-picon.el gnus-salt.el cus-edit.el rect.el + dgnushack.el gnus-agent.el gnus-ems.el gnus-fun.el gnus-topic.el + gnus.texi message.el nnmail.el nnmbox.el smiley.el + +Dirk Herrmann: changed bibtex.el + +Dmitry Antipov: changed keyboard.c + +Dominique De Waleffe: changed pcvs-info.el + +Don Morrison: wrote dabbrev.el + +Don Woods: changed replace.el + +Doug Cutting: wrote disass.el + +Doug Maxey: changed mouse.el + +Drew Adams: changed speedbar.el + +E. Jay Berkenbilt: changed flyspell.el ispell.el window.h + +Ed L. Cashin: changed gnus-sum.el imap.el + +Ed Swarthout: changed hexl.el + +Eduardo Mu,Aq(Boz: changed dired.el ls-lisp.el + +Edward M. Reingold: wrote cal-china.el cal-coptic.el cal-french.el + cal-islam.el cal-iso.el cal-julian.el cal-menu.el cal-move.el + cal-persia.el calendar.el diary-lib.el holidays.el lunar.el solar.el +and changed diary.el tex-mode.el cal-tex.el cal-mayan.el holiday.el + cal-x.el cal-hebrew.el cal-chinese.el cal-dst.el diary-ins.el + diary-insert.el cal-persian.el cal-islamic.el calendar.texi + list-holidays.el + +Edward O'connor: changed erc.el erc-viper.el erc-log.el erc-track.el + viper.el erc-backend.el erc-chess.el erc-dcc.el erc-ezbounce.el + erc-goodies.el erc-list.el erc-macs.el erc-match.el erc-ring.el + erc-stamp.el goto-addr.el python.el + +Edwin Steiner: changed gnus-nocem.el + +Ehud Karni: changed rmail.el aviion-intel.h compile.el complete.el + configure.in frame.el rmailsum.el sort.el xdisp.c + +Eirik Fuller: changed ralloc.c xterm.c + +Eli Barzilay: wrote calculator.el + +Eli Tziperman: wrote rmail-spam-filter.el + +Eli Zaretskii: wrote codepage.el rxvt.el tty-colors.el +and changed msdos.c Makefile.in makefile.w32-in files.el info.el fileio.c + startup.el mainmake.v2 config.bat rmail.el menu-bar.el pc-win.el + simple.el msdos.h internal.el xfaces.c emacs.c frame.c INSTALL dosfns.c + faces.el and 532 other files + +Emanuele Giaquinta: changed rxvt.el configure.in etags.c frame.el + sh-script.el text.texi + +Emilio C. Lopes: changed woman.el cmuscheme.el help.el vc.el advice.el + animate.el apropos.el artist.el bookmark.el cal-menu.el calc-prog.el + calc-store.el calcalg3.el calendar.el calendar.texi checkdoc.el + code-pages.el codepage.el compile.el completion.el cus-edit.el + and 53 other files + +Emmanuel Briot: wrote ada-prj.el xml.el +and changed ada-mode.el ada-stmt.el ada-xref.el + +Enami Tsugutomo: changed frame.c keyboard.c dispnew.c fileio.c process.c + xdisp.c add-log.el bytecomp.el configure.in editfns.c emacs.c frame.h + gnus-group.el perl-mode.el rmailsum.el simple.el sysdep.c vc.el + window.c window.el + +Era Eriksson: changed dired.el shell.el + +Eric Decker: changed hp9000s800.h hpux.h sysdep.c + +Eric Ding: wrote goto-addr.el +and changed mh-utils.el mh-e.el mh-comp.el mh-mime.el + +Eric Eide: changed gnus-xmas.el + +Eric Hanchrow: changed TUTORIAL.es abbrev.el autorevert.el cperl-mode.el + delphi.el dired.el emacsclient.c erc.el ispell.el make-dist + +,AI(Bric Jacoboni: changed fr-refcard.tex + +Eric Knauel: changed gnus.el spam-report.el spam.el + +Eric M. Ludlam: wrote checkdoc.el dframe.el ezimage.el sb-image.el + speedbar.el +and changed info.el rmail.el speedbspec.el gud.el Makefile.in comint.el + dir lisp-mnt.el rmailout.el sb-*.xpm sb-dir+.xpm sb-dir-.xpm + sb-dir-minus.xpm sb-dir-plus.xpm sb-dir.xpm sb-file+.xpm sb-file-.xpm + sb-file.xpm sb-mail.xpm sb-pg-minus.xpm sb-pg-plus.xpm + and 10 other files + +Eric Marsden: changed gnus-cache.el url-util.el + +Eric S. Raymond: wrote AT386.el asm-mode.el cookie1.el finder.el gud.el + keyswap.el lisp-mnt.el loadhist.el +and changed vc.el Makefile.in files.el comint.el loaddefs.el simple.el + vc-hooks.el cust-print.el dired.el emacsbug.el help.el isearch.el + makefile.el tex-mode.el x-win.el bibtex.el buff-menu.el bytecomp.el + c-mode.el cmulisp.el cmuscheme.el and 217 other files + +Eric Youngdale: changed etags-vmslib.c + +Erik Naggum: wrote disp-table.el latin-4.el latin-5.el mailheader.el + parse-time.el +and changed simple.el emacs.c files.el lread.c rmail.el alloc.c editfns.c + keyboard.c apropos.el configure.in dispnew.c filelock.c fns.c keymap.c + lisp.h print.c process.c add-log.el buffer.c casetab.c cl-macs.el + and 112 other files + +Erik Toubro Nielsen: changed gnus-sum.el gnus-topic.el + +Espen Skoglund: wrote pascal.el + +Ethan Bradford: changed ispell.el ange-ftp.el gnus.el gnuspost.el lpr.el + mailalias.el vt-control.el + +Eugene Exarevsky: changed sql.el + +Evgeni Dobrev: changed man.el + +Evgeny Roubinchtein: changed mail-source.el pc-select.el + +F. Thomas May: wrote blackbox.el + +Fabrice Bauzac: changed dired-aux.el + +Fabrice Popineau: changed etags.c gnus-cache.el + +Faried Nawaz: changed message.el + +Felix Lee: changed flyspell.el outline.el compile.el data.c gud.el + nntp.el process.c vc.el xdisp.c + +Ferenc Wagner: changed nnweb.el + +Flemming Hoejstrup Hansen: changed forms.el + +Florian Weimer: changed message.el gnus.el coding.c gnus.texi mm-util.el + +Francesc Rocher: changed cus-start.el macterm.c w32term.c xdisp.c xterm.c + +Francesco Potort,Al(B: wrote cmacexp.el +and changed etags.c man.el delta.h undigest.el etags.1 comint.el + configure.in uniquify.el latin-post.el maintaining.texi rmail.el + Makefile.in etags.el latin-alt.el sgml-mode.el data.c european.el + filelock.c files.el generic-x.el gud.el and 43 other files + +Francis J. Wright: wrote woman.el +and changed dired.el comint.el files.el + +Francis Litterio: changed erc.el erc-list.el erc-dcc.el erc-notify.el + erc-button.el erc-goodies.el erc-nets.el erc-ring.el Makefile + erc-pcomplete.el erc-backend.el erc-ibuffer.el erc-match.el + erc-nickserv.el erc-page.el erc-speedbar.el gnus-util.el keymaps.texi + message.el os.texi saveplace.el and 4 other files + +Francois Felix Ingrand: changed gnus-salt.el + +Frank Bennett: changed nnmail.el + +Frank Bresz: wrote diff.el + +Frank Schmitt: changed gnus-sum.el gnus-util.el + +Frank Weinberg: changed gnus-art.el + +Fran,Ag(Bois Pinard: changed nndoc.el allout.el bytecomp.el gnus-sum.el + gnus-util.el gnus-uu.el make-mode.el nnmail.el rmailsum.el timezone.el + +Fran,Ag(Bois-David Collin: changed message.el mm-decode.el + +Fred Fish: changed linux.h unexec.c + +Fred Oberhauser: changed nnmail.el + +Frederic Han: changed iso-cvt.el + +Frederic Lepied: wrote expand.el +and changed gnus.el + +Frederic Pierresteguy: wrote widget.c +and changed xmenu.c xterm.c xfns.c dpx2.h lwlib.c rmailsum.el rmail.el + xlwmenu.c xterm.h lwlib-Xaw.c lwlib-Xlw.c Makefile.in configure.in + lwlib-Xaw.h lwlib-int.h xdisp.c compile.el editfns.c fns.c frame.h + hilit19.el and 9 other files + +Frederik Fouvry: changed sendmail.el TUTORIAL.nl emacs.bash faces.el + filecache.el mailalias.el rmail.el thumbs.el + +Fritz Knabe: changed mh-mime.el + +Fr,Ai(Bd,Ai(Bric Bothamy: changed TUTORIAL.fr + +G Dinesh Dutt: changed etags.el + +Gareth Jones: changed fns.c gnus-score.el + +Garrett Wollman: changed sendmail.el + +Gary Byers: changed xenix.h + +Gary D. Foster: wrote crisp.el scroll-all.el +and changed gnus-group.el gnus-topic.el + +Gary Delp: wrote mailpost.el (public domain) + +Gary Howell: changed server.el + +Gary Oberbrunner: changed gud.el + +Gary Wong: changed termcap.c tparam.c + +Gaute B Strokkenes: changed imap.el gnus-fun.el mail-source.el process.c + +Geoff Greene: changed message.el + +Geoff Voelker: wrote lisp/makefile.nt nt.c nt.h ntheap.c ntheap.h + ntinevt.c ntproc.c ntterm.c src/makefile.nt w32-fns.el windowsnt.h + winnt.el +and changed w32.c w32fns.c fileio.c w32heap.c w32term.c w32inevt.c + callproc.c s/ms-w32.h w32proc.c unexw32.c w32term.h dos-w32.el + emacs.bat loadup.el w32-win.el emacs.c keyboard.c process.c + w32console.c addpm.c cmdproxy.c and 106 other files + +Georg C. F. Greve: changed pgg-gpg.el + +George V. Reilly: changed emacs.ico + +Georges Brun-Cottan: wrote easy-mmode.el + +Gerd M,Av(Bllmann: wrote authors.el ebrowse.el jit-lock.el rx.el tooltip.el +and changed xdisp.c xterm.c dispnew.c dispextern.h xfns.c xfaces.c + window.c keyboard.c lisp.h Makefile.in faces.el alloc.c buffer.c + startup.el xterm.h fns.c simple.el term.c configure.in frame.c xmenu.c + and 620 other files + +Gergely Nagy: changed erc.el + +Germano Caronni: changed ralloc.c + +Gernot Heiser: changed refer.el + +Giorgos Keramidas: changed configure.in MACHINES amdx86-64.h apropos.el + display.texi fringe.c fringe.el lisp.h windows.texi xmenu.c + +Giuseppe Scrivano: changed buffer.c configure.in sysdep.c xsmfns.c + +Glenn Morris: changed f90.el diary-lib.el calendar.el fortran.el + calendar.texi appt.el sh-script.el Makefile.in timeclock.el cal-menu.el + files.el complete.el configure.in programs.texi startup.el MACHINES + abbrevs.texi cal-hebrew.el cal-islam.el emacs.texi faq.texi + and 151 other files + +Glynn Clements: wrote gamegrid.el snake.el tetris.el + +Gordon Matzigkeit: changed gnus-uu.el + +Greg Hill: changed bytecomp.el + +Greg Hudson: changed configure.in indent.c + +Greg Klanderman: changed messagexmas.el + +Greg Mcgary: changed tar-mode.el + +Greg Stark: changed gnus-ems.el timezone.el + +Gregor Schmid: wrote tcl-mode.el +and changed intervals.c intervals.h textprop.c dispnew.c indent.c xdisp.c + +Gregorio Gervasio, Jr.: changed gnus-sum.el + +Gregory Chernov: changed nnslashdot.el + +Gregory Neil Shapiro: changed mailabbrev.el + +Guanpeng Xu: changed add-log.el TUTORIAL.cn display.texi mouse.el + type-break.el + +Guillermo J. Rozas: wrote fakemail.c + +Gunnar Horrigmo: changed gnus-sum.el + +Gustav H,Ae(Bllberg: changed compile.el rect.el + +Guy Geens: changed gnus-score.el + +G,Av(Bran Uddeborg: changed isc4-1.h + +Hallvard B. Furuseth: changed gnus-util.el editfns.c gnus-cache.el + gnus-sum.el lread.c messcompat.el nntp.el print.c process.c search.c + +Han Boetes: changed netbsd.h + +Han-Wen Nienhuys: changed emacsclient.c server.el + +Hans Chalupsky: wrote advice.el trace.el +and changed bytecomp.el + +Hans De Graaff: changed mml.el + +Hans Henrik Eriksen: wrote simula.el + +Harald Maier: changed w32heap.c + +Harald Meland: changed gnus-art.el gnus-salt.el gnus-score.el + gnus-util.el gnus-win.el + +Heiko Muenkel: changed b2m.c + +Helmut Waitzmann: changed gnus-sum.el gnus.texi + +Henrik Enberg: changed gnus-art.el gnus-msg.el lread.c rmailout.el + xfaces.c + +Henry Guillaume: wrote find-file.el + +Henry Kautz: wrote bib-mode.el refbib.el + +Hewlett-Packard: changed emacsclient.c emacsserver.c keyboard.c server.el + +Hideki Iwamoto: changed etags.c + +Hiroshi Fujishima: changed faq.texi mail-source.el spam-stat.el + +Hiroshi Nakano: changed ralloc.c unexelf.c + +Hoan Ton-That: changed erc-log.el + +Holger Schauer: wrote fortune.el +and changed message-utils.el + +Hovav Shacham: wrote windmove.el + +Howard Gayle: wrote case-table.el casetab.c disp-table.el iso-ascii.el + iso-insert.el iso-swed.el iso-syntax.el iso-transl.el latin-1.el + rot13.el swedish.el vt100-led.el + +Howard Melman: changed imenu.el picture.el + +Howie Kaye: wrote sort.el + +Hrvoje Nik,B9(Bi,Bf(B: wrote croatian.el savehist.el +and changed gnus-xmas.el message.el nnmail.el fileio.c fns.c gnus-art.el + gnus-salt.el gnus-spec.el mm-decode.el add-log.el appt.el arc-mode.el + avoid.el bookmark.el cal-china.el cal-tex.el calendar.el cl-indent.el + cmacexp.el comint.el compile.el and 83 other files + +H,Ae(Bkan Granath: changed dired.el + +H,Ae(Bkon Malmedal: changed calendar.el holidays.el + +Ian Lance Taylor: changed sco4.h + +Ian T Zimmerman: wrote gametree.el +and changed ange-ftp.el desktop.el tex-mode.el + +Ilja Weis: wrote gnus-topic.el + +Ilya N. Golubev: changed mm-util.el shell.el + +Ilya Zakharevich: wrote tmm.el +and changed cperl-mode.el syntax.c syntax.h textprop.c dired.c + font-lock.el interval.c intervals.c intervals.h regex.c regex.h + search.c + +Ilya Zakharevich And Bob Olson: wrote cperl-mode.el + +Indiana University Foundation: changed buffer.c buffer.h indent.c + region-cache.c region-cache.h search.c xdisp.c + +Inge Frick: changed easymenu.el keyboard.c view.el compile.el + dired-aux.el arc-mode.el dired.el files.el gnus-sum.el keyboard.h + keymap.c tar-mode.el window.el xmenu.c + +Inoue Seiichiro: changed xterm.c xfns.c xterm.h + +International Business Machines: changed emacs.c fileio.c ibmrt-aix.h + ibmrt.h process.c sysdep.c unexec.c + +Ishikawa Chiaki: changed aviion.h dgux.h + +Istvan Marko: changed gnus-agent.el xfns.c + +Ivan Boldyrev: changed mml1991.el + +Ivan Zakharyaschev: changed codepage.el lread.c + +Ivar Rummelhoff: wrote winner.el + +Iwamuro Motonori: changed gnus-kill.el + +J.D. Smith: changed idlwave.el idlw-shell.el idlw-help.el idlw-rinfo.el + idlw-toolbar.el comint.el idlwave.texi vc.el bibtex.el files.texi + hideshow.el idlw-complete-structtag.el misc.texi mouse.el + +Jaap-Henk Hoepman: changed mm-decode.el + +Jack Repenning: changed unexelfsgi.c + +Jack Twilley: changed message.el + +Jacob Morzinski: changed mh-comp.el + +Jacques Duthen: changed ps-print.el + +Jaeyoun Chung: changed hangul3.el hanja3.el gnus-mule.el hangul.el + +James Clark: wrote sgml-mode.el +and changed fns.c window.c xselect.c + +James Cloos: changed url-history.el + +James R. Larus: wrote mh-e.el + +James R. Van Zandt: changed sh-script.el + +James Troup: changed gnus-sum.el + +James Van Artsdalen: changed unexec.c usg5-4.h + +Jamie Zawinski: wrote byte-opt.el byte-run.el bytecomp.el disass.el + mailabbrev.el tar-mode.el +and changed bytecode.c mail-extr.el subr.el + +Jan Dj,Ad(Brv: wrote dnd.el x-dnd.el +and changed gtkutil.c xterm.c xfns.c xmenu.c xterm.h configure.in + gtkutil.h x-win.el Makefile.in keyboard.c frames.texi config.in + xselect.c emacs.c alloc.c xlwmenu.c xresources.texi frame.c startup.el + xdisp.c cus-start.el and 176 other files + +Jan Nieuwenhuizen: changed info.el TUTORIAL.nl emacs.c emacsclient.c + gnus-start.el gud.el nnmh.el server.el startup.el + +Jan Rychter: changed gnus-msg.el + +Jan Schormann: wrote solitaire.el + +Jan Vroonhof: changed gnus-cite.el gnus-msg.el nntp.el + +Jan-Hein Buhrman: changed ange-ftp.el env.el + +Jari Aalto: changed add-log.el filecache.el gnus-art.el lisp-mnt.el + nnmail.el apropos.el autorevert.el compile.el cperl-mode.el debug.el + executable.el files.el finder.el font-lock.el gnus.el gnus.texi grep.el + ls-lisp.el man.el sendmail.el terminal.el + +Jason Merrill: changed gnus-sum.el gnus-salt.el imap.el nnfolder.el + +Jason Rumney: wrote w32-vars.el +and changed w32fns.c w32term.c w32menu.c w32-win.el w32term.h + makefile.w32-in w32.c w32bdf.c w32-fns.el w32select.c w32console.c + w32gui.h w32proc.c keyboard.c mule-cmds.el emacs.c fileio.c w32bdf.h + w32inevt.c config.nt configure.bat and 84 other files + +Jay Belanger: changed calc.texi calc.el calc-ext.el calc-embed.el + calc-aent.el calc-prog.el calc-arith.el calc-help.el calc-lang.el + calcalg2.el COPYING calc-graph.el calc-store.el calc-units.el + calc-misc.el calc-yank.el calc-alg.el calc-poly.el calccomp.el + calc-mode.el calc-forms.el and 35 other files + +Jay K. Adams: wrote jka-cmpr-hook.el jka-compr.el + +Jay Sachs: changed gnus-score.el gnus-win.el + +Jean-Philippe Theberge: wrote thumbs.el + +Jeff Dwork: changed ehelp.el facemenu.el + +Jeff Miller: changed appt.el + +Jeff Morgenthaler: changed flow-ctrl.el vt200.el vt201.el vt220.el + vt240.el + +Jeff Norden: wrote kermit.el + +Jeff Peck: wrote sun-curs.el sun-fns.el sun-mouse.el sun.el + +Jeffrey C Honig: wrote mh-print.el +and changed mh-comp.el mh-e.el mh-utils.el mh-customize.el mh-funcs.el + mh-mime.el mh-seq.el Makefile bsdos4.h mh-alias.el mh-junk.el + mh-loaddefs.el + +Jens Krinke: changed smime.el + +Jens Lautenbacher: changed gnus.el + +Jens Petersen: wrote find-func.el +and changed ffap.el mule-cmds.el + +Jens Toivo Berger Thielemann: changed word-help.el + +Jens-Ulrik Holger Petersen: changed cus-edit.el find-func.el gnus.el + +Jeramey Crawford: changed amdx86-64.h configure.in + +Jeremy Bertram Maitin-Shepard: changed erc.el erc-backend.el + erc-button.el mml.el + +Jerry Frain: changed systime.h usg5-4.h + +Jerry James: changed format.el dns.el gnus-util.el gnus-xmas.el + +Jesper Harder: wrote yenc.el +and changed gnus-art.el gnus-sum.el message.el gnus-msg.el gnus.el + gnus-group.el mm-bodies.el gnus-util.el mm-util.el mm-decode.el mml.el + rfc2047.el mailcap.el mm-uu.el mml1991.el pgg-gpg.el smtpmail.el + gnus-srvr.el info.el nnmail.el pgg.el and 178 other files + +Jhair Tocancipa Triana: changed gnus-audio.el + +Jim Blandy: wrote tvi970.el +and changed keyboard.c xterm.c xfns.c Makefile.in window.c process.c + dispnew.c xdisp.c sysdep.c configure.in lisp.h keymap.c configure + make-dist buffer.c frame.c screen.c x-win.el simple.el alloc.c emacs.c + and 389 other files + +Jim Kingdon: changed MACHINES SERVICE emacsclient.c emacs.tex hp300bsd.h + rmail.el + +Jim Meyering: changed Makefile.in grep-changelog + +Jim Radford: changed gnus-start.el + +Jim Salem: wrote completion.el + +Jim Thompson: wrote ps-print.el + +Jim Wilson: changed Makefile.in alloca.c + +Jindrich Makovicka: changed eval.c fns.c + +Jirka Kosek: changed mule.el + +Joakim Hove: wrote html2text.el + +Joakim Verona: changed nnrss.el + +Joanna Pluta: changed TUTORIAL.pl + +Jochen Hein: changed gnus-art.el + +Jochen K,A|(Bpper: changed calc-units.el gnus.texi + +Joe Buehler: changed Makefile.in configure.in cygwin.h MACHINES + browse-url.el comint.el configure dired-aux.el dired.el dirtrack.el + dos-w32.el fast-lock.el filecache.el fileio.c files.el gmalloc.c + gnus-util.el hippie-exp.el keyboard.c lastfile.c loadup.el + and 12 other files + +Joe Casadonte: changed gnus-srvr.el + +Joe Corneli: changed subr.el + +Joe Edmonds: changed lisp-mode.el + +Joe Kelsey: changed skeleton.el + +Joe Ramey: changed filelock.c rmailsum.el + +Joe Reiss: changed gnus-art.el + +Joe Wells: wrote apropos.el mail-extr.el resume.el +and changed arc-mode.el + +Joel N. Weber Ii: changed comint.el make-dist + +Joel Ray Holveck: changed gnus-sum.el info.el + +Joev Dubach: changed nntp.el + +Johan Bockg,Ae(Brd: changed erc.el erc-backend.el cl-macs.el erc-match.el + custom.el erc-nickserv.el erc-ring.el erc-speak.el erc-track.el + simple.el align.el bytecomp.el calendar.el cl.texi dired-aux.el + dired-x.el display.texi erc-bbdb.el erc-button.el erc-compat.el + erc-dcc.el and 16 other files + +Johan Vromans: wrote forms-d2.el forms.el iso-acc.el +and changed complete.el + +John Basrai: changed man.el + +John F. Carr: changed dired.c + +John F. Whitehead: changed mule-cmds.el mule-diag.el + +John Fremlin: changed gnus-msg.el message.el + +John Grabowski: changed xfaces.c xfns.c + +John H. Palmieri: changed gnus-fun.el + +John Heidemann: wrote mouse-copy.el mouse-drag.el + +John Hughes: changed term.c + +John J Foerch: changed erc-stamp.el + +John Mongan: changed f90.el + +John Paul Wallington: changed ibuffer.el ibuf-ext.el subr.el files.el + help-fns.el rmail.el thumbs.el fns.c bindings.el bytecomp.el + cus-theme.el info.el re-builder.el simple.el startup.el xfns.c + apropos.el arc-mode.el browse-url.el comint.el cus-start.el + and 117 other files + +John Robinson: wrote bg-mouse.el + +John Sullivan: changed window.c + +John Tobey: changed gud.el + +John W. Eaton: wrote octave-hlp.el octave-inf.el octave-mod.el + +John Wiegley: wrote align.el cal-bahai.el em-alias.el em-banner.el + em-basic.el em-cmpl.el em-dirs.el em-glob.el em-hist.el em-ls.el + em-pred.el em-prompt.el em-rebind.el em-script.el em-smart.el + em-term.el em-unix.el em-xtra.el erc-identd.el esh-arg.el esh-cmd.el + esh-ext.el esh-io.el esh-maint.el esh-mode.el esh-module.el esh-opt.el + esh-proc.el esh-test.el esh-util.el esh-var.el eshell.el eudcb-mab.el + isearchb.el pcmpl-cvs.el pcomplete.el timeclock.el +and changed erc-chess.el erc.el iswitchb.el Makefile.in allout.el + cal-menu.el calendar.el compile.el desktop.el diary-lib.el erc-bbdb.el + erc-button.el erc-complete.el erc-fill.el erc-ibuffer.el erc-list.el + erc-match.el erc-menu.el erc-nets.el erc-replace.el erc-speak.el + and 11 other files + +John Williams: changed etags.el + +Jon Ericson: changed gnus.el spam-report.el + +Jon K Hellan: wrote utf7.el + +Jonathan I. Kamens: changed pop.c movemail.c rmail.el configure.in + Makefile.in b2m.pl config.in files.el pop.h terminal.el vc.el + gnus-sum.el jka-compr.el rmailout.el rnewspost.el sendmail.el simple.el + timezone.el vc-hooks.el + +Jonathan Stigelman: wrote hilit19.el + +Jonathan Vail: changed vc.el + +Jonathan Yavner: wrote ses.el tcover-ses.el tcover-unsafep.el + testcover.el unsafep.el +and changed ses.texi Makefile.in edebug.el editfns.c files.el + functions.texi ses-example.ses subr.el variables.texi + +Jorgen Schaefer: wrote erc-autoaway.el erc-goodies.el erc-spelling.el +and changed erc.el erc-track.el erc-backend.el erc-match.el erc-stamp.el + erc-button.el erc-fill.el erc-truncate.el erc-compat.el erc-members.el + Makefile erc-dcc.el erc-ibuffer.el erc-page.el erc-pcomplete.el + erc-sound.el erc-bbdb.el erc-imenu.el erc-lang.el erc-list.el + erc-macs.el and 9 other files + +Jose E. Marchesi: changed smtpmail.el + +Joseph Arceneaux: wrote xrdb.c +and changed xterm.c xfns.c keyboard.c screen.c dispnew.c xdisp.c window.c + x-win.el fileio.c buffer.c xterm.h minibuf.c editfns.c lread.c + process.c alloc.c buffer.h screen.el files.el insdel.c emacs.c + and 105 other files + +Joseph M. Kelsey: changed dir.h fileio.c uaf.h vms-pwd.h vmsfns.c + +Josh Huber: changed mml-sec.el gnus-msg.el message.el mml.el mml2015.el + nnmail.el ChangeLog ChangeLog.1 gnus-cite.el gnus-delay.el gnus-spec.el + mml1991.el nnultimate.el nnwfm.el gnus-cus.el gnus-smiley.el + gnus-start.el gnus-topic.el gnus.el nnbabyl.el nndiary.el + and 8 other files + +Joshua Varner: changed intro.texi + +Jouni K. Sepp,Ad(Bnen: changed gnus.texi nnimap.el mm-url.el + +Juan Le,As(Bn Lahoz Garc,Am(Ba: wrote wdired.el +and changed files.el perl-mode.el + +Juanma Barranquero: changed makefile.w32-in subr.el faces.el help-fns.el + files.el simple.el buffer.c w32fns.c emacsclient.c replace.el + vhdl-mode.el bs.el cperl-mode.el eval.c org.el process.c xdisp.c + idlwave.el sh-script.el window.c ada-mode.el and 629 other files + +Juergen Hoetzel: changed url-handlers.el + +Juergen Nickelsen: wrote ws-mode.el + +Julien Avarre: changed gnus-fun.el + +Julien Gilles: wrote gnus-ml.el + +Junio Hamano: changed window.el + +Jure Cuhalev: changed ispell.el + +Juri Linkov: changed info.el simple.el replace.el isearch.el compile.el + faces.el display.texi grep.el descr-text.el cus-edit.el dired.el + dired-aux.el edebug.el compare-w.el files.el lisp-mode.el lisp.el + modes.texi mule.el desktop.el files.texi and 221 other files + +Justin Sheehy: changed gnus-sum.el nntp.el + +J,Ai(Br,At(Bme Marant: changed Makefile.in make-dist bindings.el configure.in + emacsclient.c misc.texi + +K. Shane Hartman: wrote chistory.el echistory.el electric.el emacsbug.el + helper.el picture.el view.el +and changed rmail.el loaddefs.el ebuff-menu.el dired.el simple.el + add-log.el lisp-mode.el shell.el buff-menu.el buffer.c c-mode.el + mail-utils.el mim-mode.el more-mode.el aton.el c++-mode.el cmds.c + compile.el files.el gud.el indent.el and 14 other files + +Kahlil Hodgson: changed timeclock.el + +Kai Gro,A_(Bjohann: wrote gnus-delay.el tramp-util.el tramp-uu.el tramp.el + trampver.el +and changed gnus-agent.el message.el gnus-sum.el files.el nnmail.el + tramp.texi gnus.el simple.el ange-ftp.el Makefile.in dired.el + paragraphs.el bindings.el files.texi gnus-art.el gnus-group.el man.el + nntp.el INSTALL crisp.el fileio.c and 44 other files + +Kailash C. Chowksey: changed HELLO Makefile.in ind-util.el kannada.el + knd-util.el loadup.el makefile.w32-in + +Kanematsu Daiji: changed nnimap.el + +Karl Berry: changed emacs.texi info.texi elisp.texi anti.texi + display.texi emacs-xtra.texi filelock.c gnu.texi mule.texi texinfo.tex + text.texi building.texi cmdargs.texi control.texi copyright.el + custom.texi customize.texi dired.c dired.texi faq.texi frames.texi + and 72 other files + +Karl Chen: changed files.el align.el cc-vars.el gnus-art.el help-mode.el + jka-cmpr-hook.el make-mode.el perl-mode.el python.el tex-mode.el + vc-svn.el + +Karl Eichwalder: changed Makefile.in add-log.el bookmark.el dired-aux.el + dired.el info.el menu-bar.el midnight.el po.el + +Karl Fogel: wrote bookmark.el mail-hist.el saveplace.el +and changed isearch.el menu-bar.el simple.el autogen.sh editfns.c + nnmail.el vc-svn.el window.c + +Karl Heuer: changed keyboard.c lisp.h xdisp.c buffer.c xfns.c xterm.c + alloc.c files.el frame.c configure.in window.c data.c minibuf.c + editfns.c fns.c process.c fileio.c simple.el keymap.c indent.c sysdep.c + and 444 other files + +Karl Kleinpaste: changed gnus-sum.el gnus-art.el gnus-picon.el + gnus-score.el gnus-uu.el gnus-xmas.el gnus.el mm-uu.el mml.el nnmail.el + smiley.el + +Karl M. Hegbloom: changed gnus.el + +Karl Pfl,Ad(Bsterer: changed gnus-art.el gnus-score.el spam-stat.el + +Katsuhiro Hermit Endo: changed gnus-group.el gnus-spec.el + +Katsumi Yamaoka: wrote canlock.el +and changed gnus-art.el message.el gnus-sum.el gnus.texi mm-decode.el + mm-view.el gnus-util.el gnus-msg.el mm-util.el gnus.el lpath.el + gnus-group.el gnus-start.el rfc2047.el dgnushack.el mm-uu.el nntp.el + gnus-agent.el mml.el nnrss.el message.texi and 72 other files + +Kaveh R. Ghazi: changed delta88k.h xterm.c + +Kawabata, Taichi: wrote indian.el +and changed devanagari.el ind-util.el Makefile.in devan-util.el + characters.el fontset.el malayalam.el mlm-util.el mule-conf.el tamil.el + tml-util.el + +Kayvan Sylvan: changed sc.el + +Kazushi Marukawa: changed filelock.c hexl.c profile.c unexalpha.c + +Keiichi Suzuki: changed nntp.el + +Keisuke Nishida: changed print.c alloc.c bytecomp.el data.c keymap.c + +Keith Gabryelski: wrote hexl.c hexl.el + +Ken Brush: changed emacsclient.c + +Ken Laprade: changed simple.el + +Ken Manheimer: wrote allout.el icomplete.el +and changed pgg-gpg.el pgg.el pgg-pgp.el pgg-pgp5.el edebug.el pgg.texi + tips.texi + +Ken Raeburn: changed lisp.h buffer.c alloc.c keyboard.c lread.c minibuf.c + coding.c Makefile.in editfns.c fileio.c fns.c keymap.c undo.c xdisp.c + xfns.c xterm.c charset.h fontset.c search.c window.c charset.c + and 84 other files + +Ken Stevens: wrote ispell.el + +Kenichi Handa: wrote cyrillic.el isearch-x.el py-punct.el pypunct-b5.el + quail.el thai-word.el +and changed coding.c mule-cmds.el mule.el charset.c fileio.c xterm.c + fns.c ccl.c Makefile.in mule-conf.el fontset.c charset.h coding.h + fontset.el mule-diag.el xdisp.c editfns.c process.c insdel.c + japanese.el characters.el and 286 other files + +Kenneth Stailey: changed alpha.h configure.in ns32000.h openbsd.h pmax.h + sparc.h unexalpha.c unexelf.c + +Kevin Blake: changed font-lock.el ring.el + +Kevin Broadey: wrote foldout.el + +Kevin Christian: changed gnus-score.el + +Kevin Gallagher: wrote edt-lk201.el edt-mapper.el edt-pc.el edt-vt100.el + edt.el flow-ctrl.el +and changed edt-user.doc + +Kevin Gallo: wrote w32-win.el +and changed dispnew.c addpm.c config.nt dispextern.h emacs.c facemenu.el + faces.el fns.c frame.c frame.h keyboard.c mouse.el ntterm.c process.c + s/ms-w32.h scroll.c startup.el sysdep.c term.c unexw32.c w32.c + and 16 other files + +Kevin Greiner: wrote legacy-gnus-agent.el +and changed gnus-agent.el gnus-start.el gnus-sum.el gnus-int.el gnus.el + nntp.el gnus-util.el gnus-group.el gnus-cus.el gnus-range.el + gnus-art.el gnus-cache.el gnus-srvr.el nnagent.el nnheader.el + dgnushack.el gnus-async.el gnus-draft.el gnus-registry.el gnus-salt.el + gnus-uu.el and 3 other files + +Kevin Layer: changed w32proc.c + +Kevin Rodgers: changed compile.el mailabbrev.el dired-x.el files.el + ange-ftp.el byte-opt.el desktop.el diff-mode.el dired-x.texi ffap.el + files.texi flyspell.el isearch.el killing.texi lisp.el loadhist.el + mailalias.el menu-bar.el print.c replace.el sendmail.el + and 5 other files + +Kevin Ryde: wrote info-xref.el +and changed info-look.el info.el arc-mode.el cl.texi gnus-art.el + gnus-sum.el mailcap.el mule.el os.texi text.texi MORE.STUFF cal-dst.el + calendar.texi cc-align.el cmdargs.texi compile.texi display.texi + em-alias.el em-dirs.el em-hist.el em-unix.el and 19 other files + +Kim F. Storm: wrote bindat.el cua-base.el cua-gmrk.el cua-rect.el ido.el + keypad.el kmacro.el +and changed xdisp.c dispextern.h process.c simple.el window.c keyboard.c + xterm.c subr.el w32term.c dispnew.c lisp.h fringe.c macterm.c + display.texi fns.c alloc.c xfaces.c keymap.c xfns.c xterm.h .gdbinit + and 255 other files + +Kim-Minh Kaplan: changed gnus-picon.el gnus-sum.el gnus-start.el + gnus-win.el gnus-xmas.el gnus.texi message.el nndraft.el nnml.el + +Kishore Kumar: changed terminal.el + +Klaus Straubinger: changed url-http.el url-history.el url-cookie.el + url.el + +Klaus Zeitler: changed configure.in files.el sh-script.el vcursor.el + +Koaunghi Un: wrote hanja3.el +and changed hanja.el hangul.el hangul3.el hanja-jis.el symbol-ksc.el + +Kobayashi Yasuhiro: changed w32fns.c configure.bat indent.c info.el + w32term.c w32term.h window.c xfns.c + +Kohtala Marko: changed info.el + +Koseki Yoshinori: wrote iimage.el +and changed nnmail.el + +Kurt B. Kaiser: changed message.el + +Kurt Hornik: wrote octave-hlp.el octave-inf.el octave-mod.el +and changed battery.el ielm.el term.el + +Kurt Swanson: changed gnus-art.el gnus-salt.el gnus-sum.el gnus-ems.el + gnus-group.el gnus-msg.el gnus-score.el gnus-util.el nnmail.el window.c + +Kyle Jones: wrote life.el mldrag.el +and changed saveconf.el buffer.c mail-utils.el sendmail.el + +Kyotaro Horiguchi: changed coding.c indent.c + +K,Aa(Broly L$,1 q(Brentey: changed xfns.c bindings.el keyboard.c HELLO authors.el + buff-menu.el buffer.c buffers.texi cmds.c coding.c editfns.c frame.el + menu-bar.el print.c simple.el xdisp.c xterm.c xterm.h + +Larry Kolodney: wrote cvtmail.c + +Lars Balker Rasmussen: changed gnus-art.el gnus-agent.el message.el + +Lars Brinkhoff: changed building.texi config.in configure.in editfns.c + fns.c os.texi + +Lars Hansen: changed desktop.el tramp.el info.el mh-e.el dired-x.el + dired-x.texi dired.el ls-lisp.el rmail.el dired.c files.texi grp.h + hilit-chg.el misc.texi url-auth.el url-cache.el url-dired.el url-ftp.el + url-irc.el url-misc.el url-news.el and 39 other files + +Lars Lindberg: wrote imenu.el msb.el +and changed dabbrev.el + +Lars Magne Ingebrigtsen: wrote compface.el dns.el format-spec.el + gnus-agent.el gnus-art.el gnus-async.el gnus-bcklg.el gnus-cache.el + gnus-demon.el gnus-draft.el gnus-dup.el gnus-eform.el gnus-ems.el + gnus-fun.el gnus-group.el gnus-int.el gnus-logic.el gnus-move.el + gnus-nocem.el gnus-picon.el gnus-range.el gnus-salt.el gnus-spec.el + gnus-srvr.el gnus-start.el gnus-sum.el gnus-undo.el gnus-util.el + gnus-uu.el gnus-win.el ietf-drums.el mail-parse.el mail-prsvr.el + mail-source.el message.el messcompat.el mm-bodies.el mm-decode.el + mm-encode.el mm-util.el mm-view.el mml.el netrc.el nnagent.el + nnbabyl.el nndir.el nndoc.el nndraft.el nneething.el nngateway.el + nnkiboze.el nnlistserv.el nnmail.el nnmbox.el nnmh.el nnoo.el + nnslashdot.el nnsoup.el nntp.el nnultimate.el nnweb.el nnwfm.el qp.el + rfc2045.el rfc2047.el rfc2231.el score-mode.el spam.el time-date.el +and changed gnus.el gnus-msg.el gnus-score.el gnus-topic.el gnus-xmas.el + nnfolder.el gnus-cite.el nnheader.el nnml.el lpath.el nnvirtual.el + dgnushack.el gnus-cus.el smiley-ems.el editfns.c gnus-mh.el + gnus-soup.el gnus.texi nnrss.el pop3.el fns.c and 46 other files + +Lasse Rasinen: changed gnus-start.el + +Laurent Martelli: changed mm-decode.el + +Lawrence Mitchell: wrote erc-backend.el erc-log.el erc-nicklist.el +and changed erc.el erc-match.el erc-nets.el erc-nickserv.el erc-button.el + erc-compat.el erc-dcc.el erc-fill.el erc-list.el erc-track.el Makefile + erc-autoaway.el erc-autojoin.el erc-bbdb.el erc-ezbounce.el erc-menu.el + erc-netsplit.el erc-notify.el erc-sound.el subr.el tempo.el + +Lawrence R. Dodd: wrote dired-x.el +and changed fortran.el ispell.el sendmail.el cmuscheme.el comint.el + compile.el dired.el find-dired.el gnus.el gud.el inf-lisp.el info.el + lisp.el loaddefs.el man.el minibuf.c rcs2log rmail.el simple.el + terminal.el text-mode.el and 4 other files + +Leigh Stoller: changed emacsclient.c emacsserver.c server.el + +Lennart Borgman: changed tutorial.el window.el ada-xref.el emacsclient.c + filesets.el flymake.el help-fns.el isearch.el mouse.el recentf.el + replace.el shell.el texinfmt.el w32term.c w32term.h + +Lennart Staflin: changed dired.el diary-ins.el diary-lib.el tq.el xdisp.c + +Leonard H. Tower Jr.: changed rnews.el rnewspost.el emacsbug.el + rmailout.el + +Levin Du: changed parse-time.el + +Liam Healy: changed outline.el + +Lloyd Zusman: changed mml.el pgg-gpg.el + +Luc Teirlinck: wrote help-at-pt.el +and changed files.el autorevert.el cus-edit.el subr.el simple.el + frames.texi startup.el display.texi files.texi Makefile.in dired.el + comint.el custom.texi emacs.texi fns.c frame.el ielm.el minibuf.texi + modes.texi variables.texi buffers.texi and 215 other files + +Lucid, Inc.: changed byte-opt.el byte-run.el bytecode.c bytecomp.el + delsel.el disass.el faces.el font-lock.el lmenu.el lselect.el + mailabbrev.el select.el xfaces.c xselect.c + +$,1 a(Bukasz Demianiuk: changed erc.el + +Lute Kamstra: changed modes.texi generic.el debug.el generic-x.el + font-lock.el subr.el Makefile.in debugging.texi easy-mmode.el + elisp.texi hl-line.el simple.el battery.el bindings.el calc.el + cmdargs.texi edebug.texi emacs.texi info.el make-tarball.txt + octave-inf.el and 216 other files + +Lynn Slater: wrote help-macro.el + +L,Bu(Brentey K,Ba(Broly: changed spam.el gnus-sum.el + +MCC: wrote xmenu.c +and changed emacsclient.c emacsserver.c etags.c lisp.h movemail.c + rmail.el rmailedit.el rmailkwd.el rmailmsc.el rmailout.el rmailsum.el + scribe.el server.el sysdep.c unexec.c + +Maciek Pasternacki: changed nnrss.el + +Magnus Henoch: changed url-http.el ispell.el url.el url-gw.el + url-parse.el url-proxy.el autoinsert.el rcirc.el url-https.el + +Manuel Serrano: wrote flyspell.el + +Marc Fleischeuers: changed files.el + +Marc Girod: changed informat.el rmail.el rmailsum.el sendmail.el + +Marc Lefranc: changed gnus-art.el + +Marc Shapiro: changed bibtex.el + +Marcelo Toledo: changed TUTORIAL.pt_BR TUTORIAL.cn TUTORIAL.cs + TUTORIAL.de TUTORIAL.es TUTORIAL.fr TUTORIAL.it TUTORIAL.ja TUTORIAL.ko + TUTORIAL.pl TUTORIAL.ro TUTORIAL.ru TUTORIAL.sk TUTORIAL.sl TUTORIAL.th + TUTORIAL.translators TUTORIAL.zh add-log.el european.el + +Marco Melgazzi: changed term.el + +Marco Walther: changed mips-siemens.h unexelfsni.c unexsni.c + +Marcus G. Daniels: changed xterm.c configure.in lwlib-Xm.c lwlib.c + Makefile.in xdisp.c xfns.c xmenu.c alloc.c config.in dispnew.c + editfns.c emacs.c irix5-0.h linux.h lwlib-Xm.h lwlib.h ptx4.h + sequent-ptx.h unexelf.c + +Marek Martin: changed nnfolder.el + +Marien Zwart: changed python.el + +Mario Lang: wrote erc-button.el erc-ibuffer.el erc-imenu.el erc-menu.el + erc-netsplit.el erc-networks.el erc-notify.el erc-speedbar.el + erc-stamp.el erc-track.el erc-xdcc.el +and changed erc.el erc-dcc.el erc-speak.el Makefile erc-bbdb.el + erc-complete.el erc-pcomplete.el erc-chess.el erc-fill.el erc-list.el + battery.el erc-match.el erc-autojoin.el erc-nets.el erc-nickserv.el + erc-ring.el diff.el erc-ezbounce.el erc-identd.el erc-lang.el + erc-log.el and 6 other files + +Mark A. Hershberger: changed xml.el nnrss.el mm-url.el cperl-mode.el + esh-mode.el gnus-group.el + +Mark D. Baushke: changed mh-e.el mh-utils.el mh-mime.el mh-comp.el + mh-customize.el mh-index.el mh-loaddefs.el Makefile mh-identity.el + mh-seq.el mh-speed.el mh-funcs.el mh-alias.el MH-E-NEWS etags.c + mh-junk.el mh-pick.el mh-tool-bar.el mh-xemacs-compat.el + +Mark Davies: changed Makefile.in amdx86-64.h configure configure.in + hp800.h netbsd.h ralloc.c sh3el.h sort.el + +Mark Diekhans: changed compile.el + +Mark H. Weaver: changed comint.el + +Mark Hood: changed gnus-uu.el + +Mark Lambert: changed process.c process.h + +Mark Mitchell: changed font-lock.el + +Mark Neale: changed fortran.el + +Mark Osbourne: changed hexl-mode.el + +Mark Plaksin: changed nnrss.el term.el + +Mark Thomas: changed flow-fill.el gnus-sum.el gnus-util.el nnmail.el + +Mark W Maimone: changed mpuz.el + +Mark W. Eichin: changed keyboard.c xterm.c + +Marko Kohtala: changed info.el + +Marko Rahamaa: wrote latin-3.el + +Markus Armbruster: changed avoid.el + +Markus Heritsch: wrote ada-xref.el + +Markus Holmberg: changed thingatpt.el + +Markus Rost: wrote cus-test.el +and changed cus-edit.el Makefile.in files.el compile.el rmail.el + tex-mode.el find-func.el rmailsum.el simple.el cus-dep.el dired.el + mule-cmds.el rmailout.el checkdoc.el configure.in custom.el emacsbug.el + gnus.el help-fns.el ls-lisp.el mwheel.el and 122 other files + +Markus Triska: changed byte-opt.el bytecomp.el doctor.el expand.el + flymake.el flymake.texi handwrite.el internals.texi speedbar.el subr.el + tumme.el widget.texi + +Marshall T. Vandegrift: changed gnus-fun.el + +Martin Boyer: changed bibtex.el menu-bar.el + +Martin Buchholz: changed etags.c + +Martin J. Reed: changed ldap.el + +Martin Kretzschmar: changed gnus-spec.el gnus-sum.el + +Martin Larose: changed message.el + +Martin Lorentzon: changed vc.el vc-cvs.el vc-hooks.el vc-rcs.el + vc-sccs.el + +Martin Neitzel: changed sc.el + +Martin Rudalics: changed cus-edit.el wid-edit.el cus-start.el files.el + flyspell.el font-lock.el complete.el insdel.c ispell.el macmenu.c + syntax.c table.el w32menu.c wdired.el whitespace.el window.el xdisp.c + xmenu.c backups.texi buffer.c buffer.h and 36 other files + +Martin Stjernholm: wrote cc-bytecomp.el +and changed cc-engine.el cc-cmds.el cc-langs.el cc-defs.el cc-mode.el + cc-vars.el cc-fonts.el cc-align.el cc-styles.el cc-menus.el cc-fix.el + cc-mode.texi Makefile.in cc-guess.el cc-mode-19.el ack.texi awk-mode.el + cc-awk.el cc-lobotomy.el cc-make.el cc-style.el and 5 other files + +Martin Thornquist: changed gnus-group.el gnus-topic.el + +Masahiko Sato: wrote vip.el + +Masanobu Umeda: wrote gnus-kill.el gnus-mh.el gnus-msg.el gnus.el + metamail.el nndb.el nnheader.el nnspool.el prolog.el rmailsort.el + timezone.el +and changed gnuspost.el + +Masatake Yamato: wrote cc-subword.el ld-script.el +and changed etags.el asm-mode.el hexl.el xdisp.c bindings.el man.el + simple.el wid-edit.el add-log.el compile.el faces.el pcvs.el + register.el ruler-mode.el buffer.c cus-face.el dired-x.el display.texi + etags.c font-lock.el gdb-ui.el and 59 other files + +Masayuki Ataka: changed texinfmt.el texinfo.el characters.el cmuscheme.el + make-mode.el + +Masayuki Fujii: changed dnd.el w32-win.el + +Mathias Dahl: wrote image-dired.el +and changed tumme.el dired.el dired.texi + +Mathias Megyei: changed Makefile.in + +Mats Lidell: changed TUTORIAL.sv european.el gnus-art.el + +Matt Hodges: changed table.el faces.el iswitchb.el simple.el tmm.el + cal-menu.el calendar.el calendar.texi diary-lib.el easymenu.el + edebug.texi eldoc.el em-hist.el em-pred.el fixit.texi icon.el ido.el + locate.el paragraphs.el pcomplete.el repeat.el and 3 other files + +Matt Pharr: changed message.el + +Matt Simmons: changed message.el + +Matt Swift: changed compile.el dired.el editfns.c lisp-mode.el + mm-decode.el outline.el rx.el simple.el startup.el + +Matthew Mundell: changed calendar.texi diary-lib.el files.texi + type-break.el debugging.texi display.texi edebug.texi editfns.c eval.c + fileio.c frames.texi help.texi internals.texi modes.texi nonascii.texi + objects.texi os.texi positions.texi searching.texi subr.el text.texi + tips.texi + +Matthias F,Av(Brste: changed files.el + +Matthias Wiehl: changed gnus.el + +Matthieu Devin: wrote delsel.el + +Matthieu Moy: changed gnus-msg.el message.el + +Max Froumentin: changed gnus-art.el mml.el + +Michael Albinus: wrote tramp-ftp.el tramp-smb.el +and changed tramp.el tramp.texi tramp-vc.el ange-ftp.el files.el + tramp-util.el files.texi nnml.el tramp-uu.el vc.el dired-x.el dired.el + faq.texi find-dired.el locate.el mini.texi rcompile.el tramp*.el + trampver.el trampver.texi woman.el + +Michael Ben-Gershon: changed acorn.h configure.in riscix1-1.h riscix1-2.h + unexec.c + +Michael Cook: changed gnus-sum.el + +Michael D. Ernst: wrote reposition.el +and changed dired-x.el uniquify.el ispell.el bibtex.el rmail.el dired.el + simple.el dired-aux.el gud.el rmailsum.el bytecomp.el compare-w.el + complete.el fill.el shadow.el texnfo-upd.el vc.el allout.el comint.el + cust-print.el edebug.el and 29 other files + +Michael D. Prange: wrote fortran.el +and changed tex-mode.el + +Michael Downes: changed gnus-sum.el + +Michael Gschwind: wrote iso-cvt.el latin-2.el + +Michael Hotchin: changed compile.el + +Michael I. Bushnell: changed rmail.el simple.el callproc.c gnu.h gnus.el + lread.c process.c screen.el search.c sendmail.el startup.el timer.c + +Michael K. Johnson: changed configure.in emacs.c intel386.h linux.h + mem-limits.h process.c sysdep.c syssignal.h systty.h template.h + unexec.c ymakefile + +Michael Kifer: wrote cal-x.el ediff-diff.el ediff-help.el ediff-hook.el + ediff-init.el ediff-merg.el ediff-mult.el ediff-ptch.el ediff-util.el + ediff-vers.el ediff-wind.el ediff.el viper-cmd.el viper-ex.el + viper-init.el viper-keym.el viper-macs.el viper-mous.el viper-util.el + viper.el +and changed ediff-merge.el ediff*.el viper*.el ediff-hooks.el menu-bar.el + viper-utils.el appt.el desktop.el ediff-meta.el ediff-nult.el + ediff.texi viper-mouse.el viper.texi + +Michael Olson: changed erc.el erc-backend.el erc.texi Makefile + erc-autoaway.el erc-log.el erc-stamp.el erc-identd.el erc-list.el + erc-track.el erc-match.el erc-bbdb.el erc-dcc.el erc-notify.el + erc-ibuffer.el erc-pcomplete.el erc-spelling.el erc-compat.el + erc-goodies.el erc-nicklist.el ERC-NEWS and 44 other files + +Michael Piotrowski: changed gnus-sum.el ps-print.el + +Michael R. Cook: changed gnus-topic.el gnus-art.el gnus-sum.el + +Michael R. Mauger: changed sql.el emacsclient.c cua-base.el custom.el + facemenu.el recentf.el replace.el tramp.el w32fns.c + +Michael R. Wolf: changed ange-ftp.el + +Michael Schierl: changed pgg-pgp.el + +Michael Schmidt: wrote modula2.el (public domain) + +Michael Shields: changed spam.el gnus-art.el gnus-sum.el gnus-cite.el + gnus-group.el gnus.el intel386.h nndraft.el pgg-def.el + +Michael Sperber [Mr. Preprocessor]: changed aix3-1.h aix4-2.h + +Michael Staats: wrote pc-select.el + +Michael Welsh Duggan: changed lisp.h sh-script.el w32term.c buffer.c + gnus-spec.el keyboard.c nnmail.el termhooks.h url-http.el w32-win.el + w32fns.c w32menu.c w32term.h xdisp.c xterm.c + +Michal Jankowski: changed insdel.c keyboard.c + +Michal Nazarewicz: changed ispell.el + +Micha,Ak(Bl Cadilhac: changed ido.el fill.el ispell.el Makefile anti.texi + battery.el blackbox.el bs.el cmuscheme.el complete.el cus-edit.el + dispnew.c faq.texi flyspell.el footnote.el fr-refcard.ps fr-refcard.tex + glasses.el info.el life.el lpr.el and 12 other files + +Michelangelo Grigni: wrote ffap.el +and changed gnus-score.el + +Mikael Djurfeldt: changed xdisp.c + +Mike Haertel: changed 7300.h + +Mike Kupfer: changed mh-e.el mh-utils.el + +Mike Long: changed b2m.c make-dist make-mode.el netbsd.h view.el vms.h + +Mike Mcewan: changed gnus-agent.el gnus-sum.el gnus-score.el + +Mike Newton: changed bibtex.el + +Mike Rowan: changed process.c alloc.c dispnew.c keyboard.c process.h + sysdep.c xdisp.c + +Mike Williams: wrote mouse-sel.el thingatpt.el +and changed sgml-mode.el xml-lite.el + +Mike Woolley: changed gnus-sum.el + +Mikio Nakajima: changed ring.el viper-util.el + +Milan Zamazal: wrote czech.el glasses.el tildify.el +and changed slovak.el abbrev.el compile.el filecache.el files.el + +Miles Bader: wrote button.el image-file.el macroexp.el minibuf-eldef.el + rfn-eshadow.el +and changed comint.el faces.el simple.el editfns.c xfaces.c info.el + xdisp.c minibuf.c wid-edit.el xterm.c subr.el window.el cus-edit.el + diff-mode.el dispextern.h quick-install-emacs xfns.c help.el lisp.h + textprop.c bytecomp.el and 242 other files + +Miyashita Hisashi: changed ccl.c coding.c coding.h mule-cmds.el + mule-conf.el mule.el pop3.el + +Miyoshi Masanori: changed mouse.el smtpmail.el xdisp.c + +Morioka Tomohiko: changed rmail.el rmailout.el rmailsum.el fns.c + message.el nnheader.el nnmail.el rmailkwd.el smiley.el + +Morten Welinder: wrote [many MSDOS files] arc-mode.el desktop.el dosfns.c + internal.el msdos.h pc-win.el s-region.el +and changed msdos.c config.bat keyboard.c sed1.inp sed2.inp fileio.c + sed3.inp dos-fns.el callproc.c add-log.el alpha.h data.c editfns.c + emacs.c etags.c files.el info.el lread.c mainmake osf1.h tar-mode.el + and 73 other files + +Mosur Mohan: changed etags.c + +Motorola: changed buff-menu.el + +Mukesh Prasad: wrote vmsproc.el + +Murata Shuuichirou: changed coding.c + +N. Raghavendra: changed timezone.el + +Nachum Dershowitz: wrote cal-hebrew.el + +Nagy Andras: wrote gnus-sieve.el +and changed imap.el gnus.el + +Nakaji Hiroyuki: changed amdx86-64.h configure.in mm-util.el + +Nakamura Toshikazu: changed w32fns.c + +NeXT, Inc.: wrote unexnext.c + +Neal Ziring: wrote vi.el (public domain) + +Neil Mager: wrote appt.el + +Neil W. Van Dyke: wrote webjump.el + +Nelson H. F. Beebe: changed configure.in + +Nelson Jose Dos Santos Ferreira: changed nnsoup.el + +Nevin Kapur: changed nnmail.el gnus-sum.el nnimap.el gnus-group.el + gnus.el nnbabyl.el nnfolder.el nnmbox.el nnmh.el nnml.el + +Niall Mansfield: changed etags.c + +Nick Roberts: wrote gdb-ui.el +and changed gud.el building.texi tooltip.el speedbar.el bindings.el + thumbs.el xt-mouse.el .gdbinit DEBUG cc-mode.el t-mouse.el frames.texi + subr.el comint.el display.texi help-mode.el compile.el descr-text.el + dired.el gud-display.pbm speedbar.texi and 116 other files + +Nico Francois: changed w32fns.c w32inevt.c w32menu.c + +Niimi Satoshi: changed pp.el search.c + +Niklas Morberg: changed nnweb.el gnus-art.el nnimap.el spam.el + +Nikolaj Schumacher: changed compile.el rx.el + +Noah Friedman: wrote eldoc.el rlogin.el rsz-mini.el type-break.el +and changed comint.el emacs-buffer.gdb files.el mailabbrev.el sendmail.el + subr.el timer.el yow.el battery.el complete.el config.in configure.in + copyright.h fns.c gnu-linux.h hpux7.h irix3-3.h lisp-mnt.el loaddefs.el + mailalias.el menu-bar.el and 14 other files + +Nobuyuki Hikichi: changed news-risc.h + +Noel Cragg: changed mh-junk.el + +Norbert Koch: changed gnus-score.el + +Nozomu Ando: changed unexmacosx.c alloc.c buffer.c mips.h pmax.h + smtpmail.el sysselect.h unexelf.c + +Nuutti Kotivuori: changed gnus-sum.el flow-fill.el gnus-cache.el + +Odd Gripenstam: wrote dcl-mode.el + +Ognyan Kulev: changed TUTORIAL.bg cyrillic.el + +Olaf Sylvester: wrote bs.el + +Ole Aamot: changed compile.el + +Oleg S. Tihonov: changed cyrillic.el ispell.el map-ynp.el subr.el + +Olin Shivers: wrote cmuscheme.el comint.el inf-lisp.el shell.el + +Olive Lin: changed tex-mode.el + +Oliver Scholz: changed gamegrid.el nonascii.texi rx.el startup.el + update-game-score.c + +Oliver Seidel: wrote todo-mode.el + +Olivier Laurens: changed forms.el + +Olivier Lecarme: changed make-mode.el ange-ftp.el apropos.el bibtex.el + cpp.el facemenu.el forms.el hscroll.el indent.el nroff-mode.el + paragraphs.el server.el sort.el + +Olli Savia: changed etags.c syssignal.h + +Osamu Yamane: changed smtpmail.el + +Oscar Figueiredo: wrote eudc-bob.el eudc-export.el eudc-hotlist.el + eudc-vars.el eudc.el eudcb-bbdb.el eudcb-ldap.el eudcb-ph.el ldap.el +and changed ph.el + +,bS(Bscar Fuentes: changed emacsclient.c + +Oystein Viggen: changed dgnushack.el + +P. E. Jareth Hein: changed gnus-util.el + +Pace Willisson: wrote ispell.el + +Pascal Dupuis: changed octave-inf.el + +Pascal Rigaux: changed rfc2231.el + +Paul Curry: changed cc-subword.el + +Paul D. Smith: wrote snmp-mode.el +and changed imenu.el make-mode.el + +Paul Eggert: wrote cal-dst.el rcs2log vcdiff +and changed editfns.c vc.el Makefile.in configure.in vc-hooks.el data.c + emacs.c gnus.el calendar.el config.in floatfns.c process.c sysdep.c + dired.el xterm.c callproc.c fileio.c filelock.c lread.c print.c + rmail.el and 290 other files + +Paul Fisher: changed fns.c + +Paul Franklin: changed nnmail.el message.el + +Paul Hilfinger: changed fill.el + +Paul Jarc: wrote nnmaildir.el nnnil.el +and changed message.el gnus-util.el gnus-int.el gnus.el gnus-agent.el + gnus-start.el gnus-sum.el lpath.el nnmail.el + +Paul Pogonyshev: changed subr.el align.el dabbrev.el display.texi + etags.el info.el ses.el tar-mode.el url-http.el which-func.el window.el + +Paul Reilly: wrote dgux5-4r3.h gux5-4r2.h +and changed dgux.h lwlib-Xm.c lwlib.c xlwmenu.c configure.in process.c + xfns.c Makefile.in dgux5-4R2.h dgux5-4R3.h files.el keyboard.c + lwlib-Xaw.c lwlib-Xm.h lwlib-int.h lwlib.h widget.c widget.h xlwmenu.h + xmenu.c xterm.c + +Paul Rubin: changed config.h sun2.h texinfmt.el window.c + +Paul Stevenson: changed nnvirtual.el + +Paul Stodghill: changed gnus-agent.el + +Pavel Jan,Bm(Bk: changed COPYING keyboard.c xterm.c xdisp.c Makefile.in + process.c emacs.c lisp.h menu-bar.el ldap.el make-dist xfns.c buffer.c + coding.c eval.c fileio.c flyspell.el fns.c indent.c callint.c + cus-start.el and 703 other files + +Pavel Kobiakov: changed flymake.el flymake.texi + +Pavel Kobyakov: wrote flymake.el + +Per Abrahamsen: wrote cpp.el cus-dep.el cus-edit.el cus-face.el + cus-start.el custom.el double.el gnus-cite.el gnus-cus.el gnus-score.el + gnus-soup.el wid-browse.el wid-edit.el widget.el xt-mouse.el +and changed message.el menu-bar.el gnus.el gnus-art.el gnus-msg.el + gnus-group.el frame.el gnus-draft.el gnus-sum.el tool-bar.el + widget.texi apropos.el easymenu.el facemenu.el faces.el gnus-srvr.el + gnus-uu.el ispell.el lisp-mode.el makefile.el mouse.el + and 27 other files + +Per Bothner: wrote term.el +and changed iso-acc.el process.c sysdep.c + +Per Cederqvist: wrote ewoc.el +and changed vc.el vc-hooks.el diff-mode.el etags.c etags.el forms.el + hexl.el process.c + +Per Persson: wrote gnus-vm.el + +Per Starback: changed ispell.el gnus-start.el apropos.el bytecomp.el + characters.el charset.h coding.c dired.el doctor.el emacs.c european.el + iso-transl.el replace.el startup.el vc.el xdisp.c + +Pete Kazmier: changed gnus-art.el + +Pete Ware: wrote auto-show.el (public domain) +and changed message.el + +Pete-Temp: changed gnus-art.el + +Peter Breton: wrote dirtrack.el filecache.el find-lisp.el generic-x.el + generic.el locate.el net-utils.el + +Peter Doornbosch: changed vc-svn.el + +Peter Heslin: changed flyspell.el outline.el + +Peter Kleiweg: wrote ps-mode.el + +Peter Liljenberg: wrote elint.el + +Peter Runestig: changed makefile.w32-in configure.bat dos-w32.el emacs.rc + envadd.bat gmake.defs multi-install-info.bat nmake.defs w32fns.c + zone-mode.el + +Peter S. Galbraith: wrote mh-alias.el mh-identity.el mh-inc.el + mh-limit.el +and changed mh-comp.el mh-e.el mh-utils.el mh-mime.el mh-customize.el + mh-seq.el Makefile mh-init.el mh-loaddefs.el mh-pick.el + mh-xemacs-compat.el mh-xemacs-toolbar.el README info-look.el + mh-compat.el mh-funcs.el .cvsignore MH-E-NEWS alias.pbm alias.xpm + cabinet.xpm and 14 other files + +Peter Seibel: changed cl-indent.el lisp-mode.el + +Peter Stephenson: wrote vcursor.el + +Peter Von Der Ahe: changed gnus-ems.el + +Peter Whaite: changed data.c + +Petri Kaurinkoski: changed configure.in iris4d.h irix6-0.h irix6-5.h + usg5-4.h + +Philippe Schnoebelen: wrote gomoku.el mpuz.el + +Philippe Waroquiers: changed etags.el + +Piet Van Oostrum: changed data.c fileio.c flyspell.el make-package + smtpmail.el + +Pieter E.J. Pareit: wrote mixal-mode.el + +Pinku Surana: changed sql.el + +Pmr-Sav: changed mail-utils.el rmail.el + +Primoz Peterlin: changed TUTORIAL.sl + +R. Bernstein: changed gud.el + +Rafael Sep,Az(Blveda: changed TUTORIAL.es + +Rainer Schoepf: wrote alpha.h unexalpha.c +and changed osf1.h alloc.c buffer.c callint.c data.c dispextern.h doc.c + editfns.c floatfns.c frame.h lisp.h lread.c marker.c mem-limits.h + print.c puresize.h window.h xdisp.c xterm.h + +Raja R Harinath: changed nnml.el + +Raja R. Harinath: changed gnus-salt.el + +Rajappa Iyer: changed gnus-salt.el + +Rajesh Vaidheeswarran: wrote whitespace.el +and changed ffap.el + +Ralf Angeli: wrote scroll-lock.el +and changed w32fns.c tex-mode.el comint.el flow-fill.el frame.el + gnus-art.el killing.texi mm-view.el pcl-cvs.texi reftex-auc.el + reftex-cite.el reftex-dcr.el reftex-global.el reftex-index.el + reftex-parse.el reftex-ref.el reftex-sel.el reftex-toc.el + reftex-vars.el reftex.el reftex.texi and 4 other files + +Ralf Fassel: changed dabbrev.el files.el fill.el iso-acc.el tar-mode.el + +Ralph Schleicher: wrote battery.el info-look.el +and changed libc.el fileio.c mm-decode.el nnultimate.el + +Ramakrishnan M: changed mlm-util.el + +Randal Schwartz: wrote pp.el + +Randall Smith: changed dired.el + +Raul Acevedo: changed info.el options.el + +Ray Blaak: wrote delphi.el + +Raymond Scholz: wrote deuglify.el +and changed gnus-art.el gnus-msg.el gnus.texi message.el nnmail.el + pgg-gpg.el + +Reiner Steib: wrote gmm-utils.el +and changed gnus-art.el gnus.texi message.el gnus-sum.el gnus.el + gnus-group.el gnus-faq.texi gnus-util.el mml.el gnus-score.el + gnus-start.el message.texi mm-util.el gnus-agent.el gnus-msg.el spam.el + files.el spam-report.el mm-decode.el nnmail.el nnweb.el + and 166 other files + +Remek Trzaska: changed gnus-ems.el + +Remi Letot: changed nnmaildir.el + +Renaud Rioboo: changed nnmail.el + +Ren,Ai(B Kyllingstad: changed pcomplete.el + +Reto Zimmermann: changed vhdl-mode.el + +Richard Bielawski: changed modes.texi + +Richard Dawe: changed Makefile.in config.in + +Richard G Bielawski: changed paren.el + +Richard Hoskins: changed message.el + +Richard King: wrote backquote.el filelock.c userlock.el + +Richard L. Pieri: wrote pop3.el + +Richard M. Heiberger: changed tex-mode.el + +Richard M. Stallman: wrote [The original GNU Emacs and numerous files] + easymenu.el font-lock.el image-mode.el menu-bar.el paren.el +and changed keyboard.c files.el simple.el xterm.c xdisp.c rmail.el + fileio.c process.c sysdep.c xfns.c buffer.c Makefile.in window.c + configure.in subr.el startup.el emacs.c editfns.c sendmail.el info.el + dispnew.c and 1334 other files + +Richard Mlynarik: wrote cl-indent.el ebuff-menu.el ehelp.el env.c + rfc822.el terminal.el yow.el +and changed files.el sysdep.c rmail.el info.el keyboard.c fileio.c + loaddefs.el simple.el process.c window.c editfns.c startup.el unexec.c + xfns.c bytecomp.el keymap.c minibuf.c sendmail.el buffer.c dispnew.c + emacs.c and 123 other files + +Richard Sharman: wrote hilit-chg.el +and changed sh-script.el ediff-init.el regexp-opt.el simple.el + +Rick Farnbach: wrote morse.el + +Rick Sladkey: wrote backquote.el +and changed gud.el intervals.c intervals.h simple.el + +Rob Browning: changed configure.in + +Rob Kaut: changed vhdl-mode.el + +Rob Riepel: wrote tpu-edt.el tpu-extras.el tpu-mapper.el vt-control.el +and changed tpu-doc.el + +Robert Bihlmeyer: changed gnus-score.el gnus-util.el message.el + +Robert Fenk: changed desktop.el + +Robert J. Chassell: wrote makeinfo.el texinfo.el texnfo-upd.el +and changed texinfmt.el emacs-lisp-intro.texi page-ext.el emacs.tex + info.el loaddefs.el texinfo-update.el texinfo.tex INSTALL case-table.el + cl.texinfo history.el informat.el latin-1.el latin-2.el latin-3.el + latin-4.el page.el tex-mode.el texinfo.texinfo vip.texinfo + +Robert Thorpe: changed cus-start.el indent.el + +Roberto Rodr,Am(Bguez: changed ada-mode.texi glossary.texi widget.texi + +Roderick Schertler: changed dgux.h dgux4.h gud.el sysdep.c + +Rodrigo Real: changed pt-br-refcard.tex pt-br-refcard.ps + +Roger Breitenstein: changed smtpmail.el + +Roland B. Roberts: wrote logout.com mailemacs.com vms-pmail.el +and changed buffer.h build.com callproc.c compile.com dired.c files.el + gnus-group.el gnus-sum.el kepteditor.com precomp.com process.c sort.el + sysdep.c systty.h vmspaths.h vmsproc.el + +Roland Mcgrath: wrote autoload.el etags.el find-dired.el grep.el + map-ynp.el +and changed compile.el add-log.el configure.in files.el vc.el Makefile.in + simple.el mailabbrev.el buffer.c comint.el upd-copyr.el etags.c + menu-bar.el loaddefs.el mem-limits.h ralloc.c fileio.c data.c process.c + rlogin.el rmail.el and 137 other files + +Roland Winkler: changed bibtex.el appt.el artist.el conf-mode.el + flyspell.el ispell.el make-mode.el sgml-mode.el sh-script.el + skeleton.el + +Rolf Ebert: wrote ada-mode.el +and changed files.el find-file.el + +Romain Francoise: changed faq.texi dired-x.el ibuf-ext.el Makefile.in + comint.el compile.el message.el puresize.h replace.el subr.el + files.texi gnus-fun.el gnus.texi help-fns.el make-dist rcirc.el + antlr-mode.el bookmark.el buffer.c diary-lib.el dired.el + and 130 other files + +Roman Belenov: changed which-func.el + +Ron Schnell: wrote dunnet.el + +Ronan Waide: changed smtpmail.el + +Rui-Tao Dong: changed nnweb.el + +Rune Kleveland: changed xfns.c + +Russ Allbery: changed message.el + +Ryan Yeske: wrote rcirc.el +and changed ffap.el ispell.el rmailsum.el simple.el testcover.el + +Ryszard Kubiak: changed ogonek.el + +Sacha Chua: wrote erc-pcomplete.el +and changed erc.el erc-button.el + +Saito Takuya: changed compile.el mule.el + +Sam Dooley: changed keyboard.c + +Sam Falkner: changed nntp.el + +Sam Kendall: changed etags.c etags.el + +Sam Steingold: wrote gulp.el midnight.el +and changed cl-indent.el font-lock.el ange-ftp.el mouse.el tex-mode.el + vc-cvs.el add-log.el bindings.el bookmark.el debug.el diary-lib.el + dired.el pcvs.el sgml-mode.el simple.el browse-url.el buff-menu.el + bytecomp.el cc-mode.el compile.el etags.el and 96 other files + +Samuel Tardieu: changed smime.el + +Sanghyuk Suh: changed mac-win.el macterm.c + +Sascha L,A|(Bdecke: wrote mml1991.el +and changed gnus-win.el + +Sascha Wilde: changed pgg-gpg.el pgg.el pgg.texi configure.in + +Satyaki Das: wrote mh-acros.el mh-gnus.el mh-junk.el mh-search.el + mh-speed.el mh-thread.el mh-tool-bar.el +and changed mh-e.el mh-utils.el mh-seq.el mh-index.el mh-comp.el + mh-mime.el mh-customize.el mh-loaddefs.el mh-funcs.el Makefile + mh-alias.el mh-pick.el mh-unit.el mh-init.el mh-identity.el mh-make.el + mh-xemacs-toolbar.el mh-xemacs-compat.el pgg-gpg.el mh-inc.el + highlight.xpm and 7 other files + +Schlumberger Technology Corporation: changed gud.el + +Scott A Crosby: changed gnus-logic.el + +Scott Byer: changed gnus-sum.el + +Scott Draves: wrote tq.el + +Scott M. Meyers: changed cmacexp.el + +Sean Neakums: changed gnus-msg.el gnus-uu.el + +Sean O'rourke: changed ibuf-ext.el + +Sebastian Kremer: wrote dired-aux.el dired-x.el dired.el ls-lisp.el +and changed add-log.el + +Sebastian Tennant: changed desktop.el + +Sebastien Kirche: changed mail-extr.el + +Sen Nagata: wrote crm.el rfc2368.el + +Seokchan Lee: changed message.el + +Sergey Poznyakoff: changed rmail.el mh-mime.el rmail.texi smtpmail.el + +Sergio Pokrovskij: changed TUTORIAL.eo + +Shawn M. Carey: wrote freebsd.h + +Shenghuo Zhu: wrote binhex.el mm-extern.el mm-partial.el mm-url.el + mm-uu.el mml2015.el nnrss.el nnwarchive.el rfc1843.el uudecode.el + webmail.el +and changed gnus-art.el message.el gnus-sum.el gnus-msg.el gnus.el + gnus-agent.el mm-decode.el mm-util.el gnus-group.el mml.el + gnus-start.el gnus-util.el nnfolder.el mm-view.el nnslashdot.el + nnmail.el nntp.el gnus-topic.el gnus-xmas.el rfc2047.el dgnushack.el + and 101 other files + +Shinichirou Sugou: changed etags.c + +Shuhei Kobayashi: wrote hex-util.el sha1.el +and changed gnus-group.el message.el nnmail.el + +Shun-Ichi Goto: changed url-http.el + +Sidney Markowitz: changed doctor.el + +Sigbjorn Finne: changed gnus-srvr.el + +Simon Josefsson: wrote dig.el dns-mode.el flow-fill.el fringe.el imap.el + mml-sec.el mml-smime.el nnfolder.el nnimap.el nnml.el rfc2104.el + sieve-manage.el sieve-mode.el sieve.el smime.el starttls.el tls.el + url-imap.el +and changed message.el gnus-sum.el gnus-art.el smtpmail.el pgg.el + mml2015.el pgg-gpg.el gnus-agent.el mml.el mm-decode.el mml1991.el + gnus-group.el gnus-msg.el pgg-pgp5.el gnus-sieve.el browse-url.el + gnus-int.el gnus.el pgg-parse.el gnus-cache.el mail-source.el + and 89 other files + +Simon Leinen: changed smtpmail.el Makefile Makefile.in cm.c cm.h hpux9.h + indent.c process.c sc.texinfo sgml-mode.el term.c xfns.c xmenu.c + xterm.c + +Simon Marshall: wrote fast-lock.el lazy-lock.el regexp-opt.el +and changed comint.el font-lock.el shell.el rmail.el fortran.el + sendmail.el subr.el dired.el sh-script.el texinfo.el add-log.el + compile.el outline.el help.el menu-bar.el perl-mode.el ps-print.el + rmailsum.el bytecomp.el cc-fonts.el data.c and 57 other files + +Skip Collins: changed w32fns.c w32term.c w32term.h + +Slawomir Nowaczyk: changed emacs.py python.el TUTORIAL.pl flyspell.el + ls-lisp.el w32proc.c + +Spencer Thomas: changed dabbrev.el emacsclient.c emacsserver.c gnus.texi + server.el tcp.c unexec.c + +Sriram Karra: changed message.el + +Stanislav Shalunov: wrote uce.el + +Stefan Monnier: wrote bibtex.el cvs-status.el diff-mode.el log-edit.el + log-view.el pcvs-defs.el pcvs-info.el pcvs-parse.el pcvs-util.el + reveal.el smerge-mode.el +and changed vc.el font-lock.el pcvs.el newcomment.el subr.el lisp.h + keyboard.c fill.el keymap.c tex-mode.el alloc.c compile.el files.el + regex.c simple.el easy-mmode.el syntax.c vc-hooks.el info.el xdisp.c + sh-script.el and 519 other files + +Steinar Bang: changed imap.el + +Stephan Stahl: changed which-func.el buff-menu.el buffer.c dired-x.texi + ediff-mult.el + +Stephen A. Wood: changed fortran.el + +Stephen Berman: changed allout.el find-dired.el recentf.el + +Stephen C. Gilardi: changed configure.in + +Stephen Compall: changed saveplace.el texinfo.el + +Stephen Eglen: wrote iswitchb.el mspools.el +and changed diary-lib.el locate.el octave-inf.el replace.el hexl.el + info-look.el sendmail.el spell.el uce.el MORE.STUFF add-log.el + advice.el allout.el autoinsert.el avoid.el backquote.el battery.el + bib-mode.el bruce.el c-mode.el ccl.el and 71 other files + +Stephen Gildea: wrote mh-funcs.el mh-pick.el refcard.tex +and changed time-stamp.el mh-e.el mh-comp.el mh-utils.el mh-customize.el + mh-junk.el fileio.c files.el fortran.el mh-e.texi mh-mime.el mwheel.el + tex-mode.el + +Stephen J. Turnbull: changed ediff-init.el strings.texi subr.el + +Stephen Leake: changed ada-mode.el ada-xref.el ada-stmt.el ada-mode.texi + ada-prj.el align.el + +Steve Fisk: wrote cal-tex.el + +Steve Nygard: changed unexnext.c + +Steve Strassman: wrote spook.el + +Steve Youngs: changed mh-utils.el mh-xemacs-compat.el dgnushack.el + mh-customize.el mh-e.el mh-comp.el mh-mime.el Makefile Makefile.in + browse-url.el gnus-art.el gnus-sum.el gnus-xmas.el lpath.el mh-seq.el + .cvsignore dns.el em-unix.el gnus-async.el gnus-util.el mail-source.el + and 15 other files + +Steven E. Harris: changed nnheader.el + +Steven Huwig: changed emacs.py python.el + +Steven L. Baur: wrote earcon.el footnote.el gnus-audio.el gnus-setup.el +and changed gnus-xmas.el gnus-msg.el add-log.el dgnushack.el edebug.el + gnus-ems.el gnus-start.el gnus-topic.el message.el nnbabyl.el nntp.el + webjump.el + +Steven Suhr: changed dispnew.c scroll.c term.c termchar.h + +Steven Tamm: changed macterm.c make-package mac.c macfns.c configure.in + unexmacosx.c INSTALL mac-win.el Makefile.in README darwin.h editfns.c + lread.c macmenu.c scroll-bar.el MACHINES config.h config.in dispnew.c + eval.c fileio.c and 7 other files + +Stewart M. Clamen: wrote cal-mayan.el + +Stuart D. Herring: changed keymap.c minibuf.c widget.texi + +Stuart Herring: changed files.el isearch.el align.el allout.el comint.el + edebug.el find-lisp.el sregex.el + +Sudish Joseph: changed mac-win.el + +Sun Microsystems, Inc: wrote emacs.icon emacstool.1 emacstool.c + sun-curs.el sun-fns.el sun-mouse.el sun.el sunfns.c +and changed emacsclient.c emacsserver.c server.el + +Sun Yijiang: changed TUTORIAL.cn + +Sundar Narasimhan: changed rnews.el rnewspost.el + +Sven Joachim: changed arc-mode.el de-refcard.tex files.el files.texi + help.el mule.texi sed3v2.inp sh-script.el simple.el + +Svend Tollak Munkejord: changed deuglify.el + +Takaaki Ota: wrote table.el +and changed appt.el compile.el dired.c etags.c ldap.el makefile.w32-in + recentf.el subr.el w32bdf.c + +Takahashi Kaoru: changed texinfmt.el + +Takahashi Naoto: wrote cyrillic.el ethio-util.el ethiopic.el latin-alt.el + latin-ltx.el latin-post.el utf-8.el +and changed fontset.el mule-conf.el quail.el + +Takai Kousuke: changed ccl.el + +Takeshi Yamada: changed fns.c + +Taro Kawagishi: changed arc-mode.el + +Tatsuya Ichikawa: changed gnus-agent.el gnus-cache.el + +Ted Lemon: changed emacs.c lastfile.c puresize.h + +Ted Phelps: changed mh-search.el mh-tool-bar.el + +Teodor Zlatanov: wrote gnus-registry.el spam-report.el +and changed spam.el gnus.el gnus-sum.el nnmail.el gnus-start.el + spam-stat.el gnus.texi lpath.el nnbabyl.el nnfolder.el nnimap.el + nnmbox.el nnmh.el nnml.el replace.el simple.el basic.texi building.texi + commands.texi compile.el dig.el and 12 other files + +Terje Rosten: changed xfns.c version.el xterm.c xterm.h + +Terrence Brannon: wrote landmark.el + +Terry Jones: wrote shadow.el + +Tetsurou Okazaki: changed log-edit.el xterm.c + +Theodore Jump: changed w32-win.el w32faces.c + +Thien-Thi Nguyen: wrote hideshow.el make-mms-derivative.el +and changed ewoc.el info.el processes.texi zone.el Makefile.in vc.el + fileio.c lisp-mode.el scheme.el text.texi TUTORIAL.it bindat.el + dcl-mode.el display.texi files.el gnus.texi pcvs.el startup.el sysdep.c + vc-rcs.el MORE.STUFF and 129 other files + +Thierry Emery: changed kinsoku.el timezone.el url-http.el wid-edit.el + +Thomas Deweese: changed x-win.el + +Thomas Dorner: changed ange-ftp.el + +Thomas Horsley: wrote cxux.h cxux7.h +and changed cxux-crt0.s emacs.c nh3000.h nh4000.h sysdep.c xterm.c + +Thomas Link: wrote filesets.el + +Thomas Morgan: changed forms.el + +Thomas Neumann: wrote make-mode.el +and changed makefile.el + +Thomas W Murphy: changed outline.el + +Thomas Wurgler: changed emacs-lock.el + +Thor Kristoffersen: changed nntp.el + +Thorsten Ohl: changed lread.c next.h + +Tijs Van Bakel: changed erc.el + +Tim Fleehart: wrote makefile.nt + +Tim Van Holder: changed emacsclient.c Makefile.in compile.el configure.in + which-func.el + +Tobias C. Rittweiler: changed font-lock.el + +Toby Allsopp: changed ldap.el eudc.el + +Toby Speight: changed window.el + +Tom Breton: changed autoinsert.el gnus-agent.el lread.c + +Tom Hageman: changed etags.c + +Tom Houlder: wrote mantemp.el + +Tom Tromey: wrote tcl.el +and changed makefile.el buffer.c make-mode.el add-log.el blackbox.el + buff-menu.el doc.c emacsclient.c info.el man.el replace.el xfns.c + xterm.c xterm.h + +Tom Wurgler: wrote emacs-lock.el +and changed subr.el + +Tomas Abrahamsson: wrote artist.el + +Tommi Vainikainen: changed gnus-sum.el message.el + +Tomohiko Morioka: changed gnus-sum.el nnfolder.el nnmail.el nnmh.el + nnml.el coding.c gnus-art.el gnus-ems.el gnus-mule.el nnheader.el + nnspool.el nntp.el + +Tomoji Kagatani: wrote smtpmail.el + +Torbj,Av(Brn Axelsson: changed options.el + +Torbj,Av(Brn Einarsson: wrote f90.el + +Torsten Bronger: changed latin-ltx.el + +Toru Tomabechi: wrote tibet-util.el tibetan.el + +Toshiaki Nomura: changed uxpds.h + +Trent Buck: changed rcirc.el + +Trey Jackson: changed spam-stat.el + +Triet Hoai Lai: changed vntelex.el viet-util.el vietnamese.el + +Trung Tran-Duc: changed nntp.el + +Tsuchiya Masatoshi: changed gnus-art.el gnus-sum.el nneething.el + mm-view.el gnus-group.el nnheader.el nnml.el gnus-agent.el + gnus-cache.el gnus-msg.el lpath.el nndiary.el nnfolder.el nnimap.el + nnmaildir.el pgg.el rfc2047.el + +Tsugutomo Enami: changed nnheader.el regex.c regex.h simple.el + +Tsuyoshi Akiho: changed gnus-sum.el nnrss.el + +Tudor Hulubei: changed iso-acc.el latin-pre.el + +Ulf Jasper: wrote icalendar.el newsticker.el +and changed calendar.texi newsticker.texi Makefile.in + +Ulrich Leodolter: changed w32proc.c + +Ulrich Mueller: changed gud.el Makefile.in XMakeAssoc.c case-table.el + fortran.el iso-acc.el sysdep.c + +Ulrik Vieth: wrote meta-mode.el +and changed files.el + +Vadim Nasardinov: changed allout.el + +Vagn Johansen: changed gnus-cache.el + +Valery Alexeev: changed cyril-util.el cyrillic.el + +Vasily Korytov: changed cperl-mode.el gnus-art.el gnus-dired.el + gnus-msg.el gnus-util.el mail-source.el message.el smiley.el + +Victor Zandy: wrote zone.el + +Viktor Dukhovni: wrote unexsunos4.c + +Ville Skytt,Ad(B: changed mh-comp.el pgg.el tcl.el + +Vincent Del Vecchio: changed info.el mh-utils.el + +Vinicius Jose Latorre: wrote delim-col.el ebnf-abn.el ebnf-bnf.el + ebnf-dtd.el ebnf-ebx.el ebnf-iso.el ebnf-otz.el ebnf-yac.el ebnf2ps.el + printing.el ps-mule.el +and changed ps-print.el ps-prin1.ps ps-bdf.el ps-prin0.ps ps-prin3.ps + ps-prin2.ps lpr.el ps-print.ps subr.el TUTORIAL.pt_BR easymenu.el + loading.texi ps-print-def.el ps-print0.ps ps-vars.el + +Vivek Dasmohapatra: changed emacs.c erc-backend.el erc.el sh-script.el + xterm.c xterm.h + +Vladimir Alexiev: changed arc-mode.el nnvirtual.el tmm.el + +Vladimir Volovich: changed smime.el + +Walter C. Pelissero: changed browse-url.el url-methods.el + +Wayne Mesard: wrote hscroll.el + +Werner Benger: changed keyboard.c + +Werner Lemberg: wrote sisheng.el vntelex.el +and changed TUTORIAL.de Makefile.in calc.texi chinese.el czech.el + european.el idlwave.el reftex-vars.el reftex.el reftex.texi slovak.el + supercite.el .cvsignore advice.el calc-forms.el calc-sel.el calendar.el + china-util.el cl-macs.el cl.texi complete.el and 44 other files + +Wes Hardaker: changed gnus-score.el gnus-art.el gnus-sum.el gnus-win.el + +Will Mengarini: wrote repeat.el + +William F. Mann: wrote perl-mode.el + +William F. Schelter: wrote telnet.el + +William M. Perry: wrote mailcap.el url-dav.el url-gw.el url-http.el + url-util.el url.el vc-dav.el +and changed url-handlers.el url-file.el url-methods.el url-vars.el + url-https.el aclocal.m4 mule-sysdp.el url-imap.el url-news.el + url-nfs.el configure.in image.el mwheel.el url-about.el url-auth.el + url-cid.el url-dired.el url-expand.el url-ftp.el url-history.el + url-irc.el and 6 other files + +William Smith: changed strftime.c + +William Sommerfeld: wrote emacsclient.c emacsserver.c scribe.el server.el + +Wilson H. Tien: changed unexelf.c + +Wim Nieuwenhuizen: changed TUTORIAL.nl + +Wlodzimierz Bzyl: wrote ogonek.el +and changed latin-pre.el pl-refcard.ps pl-refcard.tex refcard-pl.ps + refcard-pl.tex survival.tex + +Wolfgang Glas: changed unexsgi.c + +Wolfgang Jenkner: changed conf-mode.el gnus-sum.el pcvs.el + +Wolfgang Rupprecht: wrote float-sup.el floatfns.c sup-mouse.el +and changed process.c alloc.c callint.c config.h.in config.in + configure.in crt0.c data.c fns.c lisp-mode.el lisp.h loadup.el lread.c + net-utils.el nntp.el print.c sort.el sun3.h ymakefile + +Wolfgang Scherer: changed vc-cvs.el + +Wolfram Fenske: changed nnimap.el + +Wolfram Gloger: changed emacs.c + +Xavier Maillard: changed gnus-faq.texi gnus-score.el spam.el + +Yagi Tatsuya: changed gnus-art.el gnus-start.el + +Yamamoto Mitsuharu: changed macterm.c macfns.c mac-win.el mac.c macterm.h + macmenu.c macgui.h image.c macselect.c keyboard.c xdisp.c makefile.MPW + config.h emacs.c INSTALL Makefile.in macos.texi darwin.h xfaces.c + dispnew.c alloc.c and 77 other files + +Yann Dirson: changed imenu.el + +Yavor Doganov: changed emacs.1 etags.1 + +Yoichi Nakayama: changed browse-url.el finder.el man.el rfc2368.el + +Yoni Rabkin Katzenell: changed faces.el whitespace.el + +Yoshiki Hayashi: changed texinfmt.el nnheader.el + +Yoshinori Koseki: changed fontset.el + +Yutaka Niibe: changed indent.c xdisp.c configure.in Makefile.in dispnew.c + sysdep.c config.in dired.el emacs.c fill.el fns.c gmalloc.c gnu-linux.h + indent.h process.c simple.el term.c window.c + +Zhang Wei: changed xfns.c erc.el x-win.el + +Zoltan Kemenczy: changed gud.el + +Zoran Milojevic: changed avoid.el + +Local Variables: +coding: iso-2022-7bit +End: diff --git a/etc/CONTRIBUTE b/etc/CONTRIBUTE new file mode 100644 index 00000000000..8daf73ffa1a --- /dev/null +++ b/etc/CONTRIBUTE @@ -0,0 +1,207 @@ +Copyright (C) 2006, 2007 Free Software Foundation, Inc. +See end for license conditions. + + + Contributing to Emacs + +Emacs is a collaborative project and we encourage contributions from +anyone and everyone. If you want to contribute in the way that will +help us most, we recommend (1) fixing reported bugs and (2) +implementing the feature ideas in etc/TODO. However, if you think of +new features to add, please suggest them too -- we might like your +idea. Porting to new platforms is also useful, when there is a new +platform, but that is not common nowadays. + +For documentation on how to develop Emacs changes, refer to the Emacs +Manual and the Emacs Lisp Reference Manual (both included in the Emacs +distribution). The web pages in http://www.gnu.org/software/emacs +contain additional information. + +You may also want to submit your change so that can be considered for +inclusion in a future version of Emacs (see below). + +If you don't feel up to hacking Emacs, there are many other ways to +help. You can answer questions on the mailing lists, write +documentation, find and report bugs, contribute to the Emacs web +pages, or develop a package that works with Emacs. + +Here are some style and legal conventions for contributors to Emacs: + + +* Coding Standards + +Contributed code should follow the GNU Coding Standard. + +If it doesn't, we'll need to find someone to fix the code before we +can use it. + +Emacs has certain additional style and coding conventions. + +Ref: http://www.gnu.org/prep/standards_toc.html +Ref: GNU Coding Standards Info Manual +Ref: The "Tips" Appendix in the Emacs Lisp Reference. + + +* Copyright Assignment + +We can accept small changes without legal papers, and for medium-size +changes a copyright disclaimer is ok too. To accept substantial +contributions from you, we need a copyright assignment form filled out +and filed with the FSF. + +Contact us at emacs-devel@gnu.org to obtain the relevant forms. + + +* Getting the Source Code + +The latest version of Emacs can be downloaded using CVS or Arch from +the Savannah web site. It is important to write your patch based on +this version; if you start from an older version, your patch may be +outdated when you write it, and maintainers will have a hard time +applying it. + +After you have downloaded the CVS source, you should read the file +INSTALL.CVS for build instructions (they differ to some extent from a +normal build). + +Ref: http://savannah.gnu.org/projects/emacs + + +* Submitting Patches + +Every patch must have several pieces of information before we +can properly evaluate it. + +When you have all these pieces, bundle them up in a mail message and +send it to emacs-pretest-bug@gnu.org or emacs-devel@gnu.org. + +All subsequent discussion should also be sent to the mailing list. + +** Description + +For bug fixes, a description of the bug and how your patch fixes this +bug. + +For new features, a description of the feature and your implementation. + +** ChangeLog + +A ChangeLog entry as plaintext (separate from the patch). + +See the various ChangeLog files for format and content. Note that, +unlike some other projects, we do require ChangeLogs also for +documentation, i.e. Texinfo files. + +Ref: "Change Log Concepts" node of the GNU Coding Standards Info +Manual, for how to write good log entries. + +** The patch itself. + +Please use "Context Diff" format. + +If you are accessing the CVS repository use + cvs update; cvs diff -cp +else, use + diff -cp OLD NEW + +If your version of diff does not support these options, then get the +latest version of GNU Diff. + +** Mail format. + +We prefer to get the patches as inline plain text. + +Please be aware of line wrapping which will make the patch unreadable +and useless for us. To avoid that, you can use MIME attachments or, +as a last resort, uuencoded gzipped text. + +** Please reread your patch before submitting it. + +** Do not mix changes. + +If you send several unrelated changes together, we will ask you to +separate them so we can consider each of the changes by itself. + + +* Coding style and conventions. + +** Mandatory reading: + +The "Tips and Conventions" Appendix of the Emacs Lisp Reference. + +** Avoid using `defadvice' or `eval-after-load' for Lisp code to be +included in Emacs. + +** Remove all trailing whitespace in all source and text files. + +** Use ?\s instead of ? in Lisp code for a space character. + + +* Supplemental information for Emacs Developers. + +** Write access to Emacs' CVS repository. + +Once you become a frequent contributor to Emacs, we can consider +giving you write access to the CVS repository. + + +** Emacs Mailing lists. + +Discussion about Emacs development takes place on emacs-devel@gnu.org. + +Bug reports for released versions are sent to bug-gnu-emacs@gnu.org. + +Bug reports for development versions are sent to emacs-pretest-bug@gnu.org. + +You can subscribe to the mailing lists at savannah.gnu.org/projects/emacs. + +You can find the mailing lists archives at lists.gnu.org or gmane.org. + + +** Document your changes. + +Think carefully about whether your change requires updating the +documentation. If it does, you can either do this yourself or add an +item to the NEWS file. + +If you document your change in NEWS, please mark the NEWS entry with +the documentation status of the change: if you submit the changes for +the manuals, mark it with "+++"; if it doesn't need to be documented, +mark it with "---"; if it needs to be documented, but you didn't +submit documentation changes, leave the NEWS entry unmarked. (These +marks are checked by the Emacs maintainers to make sure every change +was reflected in the manuals.) + + +** Understanding Emacs Internals. + +The best way to understand Emacs Internals is to read the code, +but the nodes "Tips" and "GNU Emacs Internals" in the Appendix +of the Emacs Lisp Reference Manual may also help. + +The file etc/DEBUG describes how to debug Emacs bugs. + + + +This file is part of GNU Emacs. + +GNU Emacs is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3, or (at your option) +any later version. + +GNU Emacs is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Emacs; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. + +Local variables: +mode: outline +paragraph-separate: "[ ]*$" +end: + diff --git a/etc/ChangeLog b/etc/ChangeLog index 4a961dfd028..ffdba84db2d 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,68 @@ +2007-09-28 Glenn Morris <rgm@gnu.org> + + * PROBLEMS: Mention Tex superscript font issue. + +2007-09-25 Johannes Weiner <hannes@saeurebad.de> + + * NEWS: Fix typo. + +2007-09-24 Glenn Morris <rgm@gnu.org> + + * CONTRIBUTE: Remove information on maintaining copyright years; + it does not belong here and is in admin/notes anyway. + +2007-09-24 Adam Hupp <adam@hupp.org> + + * emacs.py: Split for python 2 and python 3 compatibility. + * emacs2.py: New file, split off from emacs.py. + * emacs3.py: New file, python 3 version of emacs2.py. + +2007-09-21 Glenn Morris <rgm@gnu.org> + + * emacstool.1: Remove file. + * emacs.bash: Adapt for removal of emacstool. + * emacs.csh: Remove emacstool-related code. + +2007-09-16 Glenn Morris <rgm@gnu.org> + + * gfdl.1: Remove unused file. + +2007-09-12 Glenn Morris <rgm@gnu.org> + + * Makefile (SOURCES, unlock, relock): Delete. + +2007-09-10 Micha,Ak(Bl Cadilhac <michael@cadilhac.name> + + * NEWS: Document the interactive specification for C functions. + Say that `set-file-modes' is now interactive. + +2007-09-10 Michael Olson <mwolson@gnu.org> + + * ERC-NEWS: Improve description of erc-tls and erc-ssl change. + +2007-09-09 Juri Linkov <juri@jurta.org> + + * AUTHORS, CONTRIBUTE: New files, moved here from the root dir. + +2007-09-08 Michael Olson <mwolson@gnu.org> + + * ERC-NEWS: Update for changes to the development version of ERC 5.3. + +2007-09-06 Glenn Morris <rgm@gnu.org> + + * ctags.1, emacs.1, emacsclient.1, etags.1: Move from etc/ to + doc/man/. + + * refcards/README: Also mention gnus-logo.pdf license. + +2007-08-30 Carsten Dominik <dominik@science.uva.nl> + + * NEWS.22 (Note): Lower-case for orgtbl-mode. + +2007-08-29 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * NEWS: Say that Gtk+ build uses stock icons. + 2007-08-28 Werner LEMBERG <wl@gnu.org> * refcards/de-refcard.tex, refcards/de-refcard.pdf: Use `C-M-%' @@ -60,13 +125,17 @@ * e/README: New file, with most information formerly in Makefile. +2007-09-05 Jason Rumney <jasonr@gnu.org> + + * NEWS.22: Mention focus-follows-mouse change. + 2007-08-22 Karl Berry <karl@gnu.org> - * refcard.tex: updates for printing. - (\versionyear): update to 2007. - (\copyrightnotice): modified or unmodified ok. - (Simple Customization): don't use goto-line, since now it's bound. -^ Also, use now-preferred (kbd ...) syntax. + * refcard.tex: Updates for printing. + (\versionyear): Update to 2007. + (\copyrightnotice): Modified or unmodified ok. + (Simple Customization): Don't use goto-line, since now it's bound. + Also, use now-preferred (kbd ...) syntax. 2007-08-22 Michael Albinus <michael.albinus@gmx.de> @@ -87,7 +156,7 @@ * README: Move information about tex files from here... * refcards/README: ...to here. - * tutorials/: New directory. Move TUTORIAL* here. + * tutorials/: New directory. Move TUTORIAL* here. * gnus.pbm, letter.pbm, letter.xpm: * splash.pbm, splash.xpm, splash8.xpm: Move from etc/ to etc/images/. @@ -109,7 +178,7 @@ 2007-07-25 Glenn Morris <rgm@gnu.org> - * Relicense all FSF files to GPLv3 or later. + * Relicense all FSF files to GPLv3 or later. * COPYING: Switch to GPLv3. diff --git a/etc/ERC-NEWS b/etc/ERC-NEWS index f5bf1e89dde..53b595a753f 100644 --- a/etc/ERC-NEWS +++ b/etc/ERC-NEWS @@ -3,6 +3,23 @@ ERC NEWS -*- outline -*- Copyright (C) 2006, 2007 Free Software Foundation, Inc. See the end of the file for license conditions. +* Changes in ERC 5.3 + +** New function `erc-tls' is to be used for connecting to a server via TLS. +It requires the tls.el library. + +** The function `erc-ssl' will now always use ssl.el, even in the version +of ERC that comes with Emacs. + +** Changes and additions to modules + +*** Channel tracking (erc-track.el) + +If erc-track-position-in-mode-line is set to nil, the tracking +information won't be shown in the mode line, which is a change +from the previous behavior of showing it "After all other +information". + * Changes in ERC 5.2 ** M-x erc RET now starts ERC. diff --git a/etc/Makefile b/etc/Makefile deleted file mode 100644 index 406c4b51222..00000000000 --- a/etc/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -### Makefile for Emacs etc/ directory. - -.PHONY: unlock relock - -## All non-directory files, if that matters. -SOURCES = [A-Z]* *.* *-* e/* refcards/* tutorials/* \ - images/README images/*.* images/*/README images/*/*.* \ - images/*/*/README images/*/*/*.* - -unlock: - chmod u+w $(SOURCES) - -relock: - chmod u-w $(SOURCES) - -## See e/README. -TIC=tic -e/eterm-color: e/eterm-color.ti - TERMINFO=`pwd`; export TERMINFO; $(TIC) e/eterm-color.ti - -## arch-tag: 4261f003-cf77-4478-a10a-5284e9d8f797 -### Makefile ends here @@ -31,9 +31,39 @@ so we will look at it and add it to the manual. ** configure now checks for libgif before libungif when searching for a GIF library. +** Support for systems without alloca has been removed. + +** The `emacstool' utility has been removed. + * Changes in Emacs 23.1 +** Emacs now supports using both X displays and ttys in one session. +You can also use any number of different ttys. + +You can test for the presence of this feature in your Lisp code by +testing for the `multi-tty' feature. + +** Emacs comes with a new set of icons for Mac OS X. +OS-X-style icons (an application icon and a relevant document icon) +were contributed by Kentaro Ohkouchi. +Source files for these icons can be found in Emacs.app/Contents/Resources. + +** Built-in functions (subr) can now have an interactive specification +that is not a prompt string. If the `intspec' parameter of a `DEFUN' +starts with a `(', the string is evaluated as a Lisp form. + +** set-file-modes is now interactive and can take the mode value in +symbolic notation thanks to auxiliary functions. + +** split-window-preferred-function specifies whether display-buffer should +split windows vertically or horizontally. + +** Emacsclient has been extended to support opening a new terminal +frame. Its behavior has been changed to open a new Emacs frame by +default. Use the -c option to get the old behavior of opening files in +the currently selected Emacs frame. + ** The refcards are now shipped as PDF files. ** Emacs now supports the SVG image format through librsvg2. @@ -50,10 +80,10 @@ highlighting, and help echoing in the minibuffer. recenter the visited source file. Its value can be a number (for example, 0 for top line, -1 for bottom line), or nil for no recentering. -** The mode-line display a `@' if the default-directory for the current buffer +** The mode-line displays a `@' if the default-directory for the current buffer is on a remote machine, or a hyphen otherwise. -** The new command balance-window-area balances windows both vertically +** The new command balance-windows-area balances windows both vertically and horizontally. ** The new command close-display-connection can be used to close a connection @@ -61,7 +91,7 @@ to a remote display, e.g. because the display is about to become unreachable. ** The command shell prompts for the default directory, when it is called with a prefix, and the default directory is a remote file name. -This is because some file name handler (like ange-ftp) are not able to +This is because some file name handlers (like ange-ftp) are not able to run processes remotely. ** The new command `display-time-world' starts an updating time display @@ -73,12 +103,27 @@ using several time zones, in a buffer. after starting Emacs: startup screen, *scratch* buffer, visiting a file or directory. +** New alias `argv' for `command-line-args-left' +This is a convenience alias, so that one can write `(pop argv)' +inside of --eval command line arguments in order to access +following arguments. * Incompatible Editing Changes in Emacs 23.1 * Editing Changes in Emacs 23.1 ++++ +** M-q now fills the region if the region is active and +`transient-mark-mode' is turned on. Otherwise, it fills the current +paragraph. The new command bound to M-q is `fill-paragraph-or-region'. + +** TAB now indents the region if the region is active and +`transient-mark-mode' is turned on. + +** C-z now invokes `suspend-frame', C-x C-c now invokes +`save-buffers-kill-terminal'. + ** New command kill-matching-buffers kills buffers whose name matches a regexp. ** Minibuffer changes: @@ -94,13 +139,23 @@ history element containing the search string becomes the current. * New Modes and Packages in Emacs 23.1 -** A new game called `bubble' has been added +** The package doc-view.el has been added. It supports viewing of PDF, +PostScript and DVI documents inside an Emacs buffer by converting the +document to a set of PNG images first. One can also search for a +regular expression in the document. The commentary of the file explains +its usage. + +** A new game called `bubbles' has been added. ** minibuffer-indicate-depth-mode shows the minibuffer depth in the prompt. * Changes in Specialized Modes and Packages in Emacs 23.1 +** diff-fine-highlight highlights char-level details of changes in a diff hunk. +** archive-mode has basic support to browse Rar archives. +** talk.el has been extended for multiple tty support. + ** compilation-auto-jump-to-first-error tells `compile' to jump to the first error encountered during compilations. @@ -114,13 +169,17 @@ with the face `eldoc-highlight-function-argument'. ** VC *** Clicking on the VC mode-line entry now pops the VC menu. -*** The VC mode-line entry now has a tooltip. +*** The VC mode-line entry now has a tooltip that explains the VC file status. -*** VC backends can provide extra menu entries to be added to the "Version Control" menu. -This can be used to add menu entries for backend specific functions. +*** VC now supports applying VC operations to a set of files at a time. ** sgml-electric-tag-pair-mode lets you simultaneously edit matched tag pairs. +** The appearance of superscript and subscript in TeX is more customizable. +See the documentation of the variables: tex-fontify-script, +tex-font-script-display, tex-suscript-height-ratio, and +tex-suscript-height-minimum. + ** BibTeX mode: *** New `bibtex-entry-format' options `whitespace', `braces', and @@ -162,6 +221,9 @@ file copy is checked via the file's checksum. ** Miscellaneous programming mode changes +*** The file etc/emacs.py now supports both Python 2 and 3, meaning +that either version can be used as inferior Python by python.el. + *** The variable `fortran-line-length' can change the fixed-form line-length. ** Miscellaneous @@ -174,6 +236,8 @@ on the corresponding remote system. and C-x C-q in wdired-mode exits it with asking a question about saving changes. +*** The new command `eshell/info' runs info in an eshell buffer. + * Changes in Emacs 23.1 on non-free operating systems @@ -193,9 +257,61 @@ supported on other platforms, but not on Windows due to using the winsock * Lisp Changes in Emacs 23.1 -** The function invisible-p returns non-nil if the character - after a specified position is invisible, or if its argument - as an `invisible' property would make a character invisible. +** New keymap `input-decode-map' overrides like key-translation-map, but +applies before function-key-map. Also it is terminal-local contrary to +key-translation-map. Terminal-specific key-sequences are generally added to +this map rather than to function-key-map now. + +** Changes related to multiple tty support. + +*** $TERM is now set to `dumb' for subprocesses. If you want to know the +$TERM inherited by Emacs you will have to look inside initial-environment. + +*** $DISPLAY is now dynamically inherited from the frame's `display'. + +*** The `window-system' variable has been made frame-local. The new +`initial-window-system' variable contains the `window-system' value +for the first frame. + +*** You can specify a terminal device (`tty' parameter) and a terminal +type (`tty-type' parameter) to `make-terminal-frame'. + +*** The new function `make-frame-on-tty' allows you to create a new +frame on another tty device interactively. + +*** The function `make-frame-on-display' now works during a tty +session, and `make-frame-on-tty' works during a graphical session. + +*** New functions: `delete-tty', `suspend-tty', `resume-tty'. + +*** A new data type for terminals with functions: `get-device-terminal', +`terminal-parameters', `terminal-parameter', `set-terminal-parameter'. + +*** New hooks: `suspend-tty-functions' and `resume-tty-functions' +are called after a tty frame has been suspended or resumed, +respectively. The functions are called with the terminal id of the frame +being suspended/resumed as a parameter. + +*** New functions: `environment', `let-environment'. + +*** New variable: `local-function-key-map'. +This in addition to the global function-key-map variable that already existed. + +*** `initial-environment' holds the environment inherited from Emacs's parent. + +*** The `keyboard-translate-table' variable and the terminal and +keyboard coding systems have been made terminal-local. + +*** In addition to the global function-key-map, Emacs has terminal-local +local-function-key-map variables, and uses them instead of the +global keymaps to set up translations and function key sequences +relevant to a specific terminal device. + + +** You can now also pass the value of the `invisible' property to invisible-p +to check whether it would cause the text to be invisible. Convenient when +checking invisibility of text which has no buffer position +(e.g. in before/after-strings). ** Non-breaking space now acts as whitespace. diff --git a/etc/NEWS.22 b/etc/NEWS.22 index 6009fea7551..2b7c82dd7b6 100644 --- a/etc/NEWS.22 +++ b/etc/NEWS.22 @@ -59,6 +59,17 @@ Windows XP introduced themed scrollbars, but applications have to take special steps to use them. Emacs now has the appropriate resources linked in to make it use the scrollbars from the system theme. +** focus-follows-mouse defaults to nil on MS Windows +Previously this variable was incorrectly documented as having no effect +on MS Windows, and the default was inappropriate for the majority of +Windows installations. Users of software which modifies the behaviour of +Windows to cause focus to follow the mouse will now need to explicitly set +this variable. + +** The command gdba has been removed as gdb works now for those cases where it +was needed. In text command mode, if you have problems before execution has +started, use M-x gud-gdb. + * New Modes and Packages in Emacs 22.2 ** bibtex-style-mode helps you write BibTeX's *.bst files. @@ -73,7 +84,12 @@ in to make it use the scrollbars from the system theme. *** VC backends can provide completion of revision names. -*** VC has some support for Mercurial (hg). +*** VC backends can provide extra menu entries to be added to the "Version Control" menu. +This can be used to add menu entries for backend specific functions. + +*** VC has some support for Mercurial (Hg). + +*** VC has some support for Monotone (Mtn). *** VC has some support for Bazaar (Bzr). @@ -81,6 +97,9 @@ in to make it use the scrollbars from the system theme. * Lisp Changes in Emacs 22.2. +** The command `repeat' will no more attempt to repeat a command bound +to an input event. + ** The function invisible-p returns non-nil if the character after a specified position is invisible. @@ -1649,7 +1668,7 @@ It also contains a plain-text table editor with spreadsheet-like capabilities. The Org mode table editor can be integrated into any major mode by -activating the minor Orgtbl-mode. +activating the minor mode, Orgtbl mode. The documentation for org-mode is in a separate manual; within Emacs, type "C-h i m org RET" to read that manual. A reference card is diff --git a/etc/PROBLEMS b/etc/PROBLEMS index 9a89f72fec3..7ebf7ae8edd 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -540,6 +540,12 @@ This can happen with CVS versions 1.12.8 and 1.12.9. Upgrade to CVS ** Miscellaneous problems +*** Emacs uses 100% of CPU time + +This is a known problem with some versions of the Semantic package. +The solution is to upgrade Semantic to version 2.0pre4 (distributed +with CEDET 1.0pre4) or later. + *** Self-documentation messages are garbled. This means that the file `etc/DOC-...' doesn't properly correspond @@ -862,6 +868,18 @@ gives the appearance of "double spacing". To prevent this, turn off the Exceed's "automatic font substitution" feature (in the font part of the configuration window). +** Subscript/superscript text in TeX is hard to read. + +If `tex-fontify-script' is non-nil, tex-mode displays +subscript/superscript text in the faces subscript/superscript, which +are smaller than the normal font and lowered/raised. With some fonts, +nested superscripts (say) can be hard to read. Switching to a +different font, or changing your antialiasing setting (on an LCD +screen), can both make the problem disappear. Alternatively, customize +the following variables: tex-font-script-display (how much to +lower/raise); tex-suscript-height-ratio (how much smaller than +normal); tex-suscript-height-minimum (minimum height). + * Internationalization problems ** M-{ does not work on a Spanish PC keyboard. @@ -2809,6 +2827,11 @@ build (from -O2 to -O1). It is possible this is an OpenBSD GCC problem specific to the macppc architecture, possibly only occurring with older versions of GCC (e.g. 3.3.5). +*** openSUSE 10.3: Segfault in bcopy during dumping. + +This is due to a bug in the bcopy implementation in openSUSE 10.3. +It is/will be fixed in an openSUSE update. + ** Installation *** Installing Emacs gets an error running `install-info'. diff --git a/etc/THE-GNU-PROJECT b/etc/THE-GNU-PROJECT index d089d76ef2d..80dde864901 100644 --- a/etc/THE-GNU-PROJECT +++ b/etc/THE-GNU-PROJECT @@ -306,7 +306,7 @@ care whether these users had freedom, only that they should be numerous. - This lead to a paradoxical situation where two different ways of + This led to a paradoxical situation where two different ways of counting the amount of freedom gave different answers to the question, "Is this program free?" If you judged based on the freedom provided by the distribution terms of the MIT release, you would say that X was @@ -14,6 +14,12 @@ to the FSF. * Small but important fixes needed in existing features: +** Make "emacs --daemon" start emacs without showing any frame. +Use emacsclient later to open frames. + +** Make it possible to reliably turn on minor modes using "mode:" in the local +variables section. + ** "Options -> Save Options" should save the font set via "Set Font/Fontset" I.e. mouse-set-font should use customize-face. @@ -99,6 +105,14 @@ http://lists.gnu.org/archive/html/emacs-devel/2007-04/msg00782.html ** Find a proper fix for rcirc multiline nick adding. http://lists.gnu.org/archive/html/emacs-devel/2007-04/msg00684.html +** Implement `network-interface-list' and `network-interface-info' +on MS-Windows. Hint: the information is present in the Registry, +under the keys +HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Linkage\ +and +HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\<device>\ +where <device> is the network device found under the first key. + * Important features: ** Provide user-friendly ways to list all available font families, @@ -306,8 +320,15 @@ typically due to pilot errors and should thus be in debug-ignored-errors. the whole menu bar. In the mean time, it should process other messages. ** Get some major packages installed: W3 (development version needs - significant work), PSGML. Check the assignments file for other - packages which might go in and have been missed. + significant work), PSGML, nXML [Mark Hershberger is looking at this + http://lists.gnu.org/archive/html/emacs-devel/2007-09/msg01699.html], + _possibly_ Cedet and ECB. + http://lists.gnu.org/archive/html/emacs-devel/2007-05/msg01493.html + Check the assignments file for other packages which might go in and + have been missed. + +** Install ruby-mode (needs assignment)? + http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00051.html ** Make keymaps a first-class Lisp object (this means a rewrite of keymap.c). What should it do apart from being opaque ? @@ -327,9 +348,6 @@ typically due to pilot errors and should thus be in debug-ignored-errors. ** Highlight rectangles (`mouse-track-rectangle-p' in XEmacs). Already in CUA, but it's a valuable feature worth making more general. -** Support simultaneous tty and X frames. [See the multi-tty branch of Emacs - at http://lorentey.hu/project/emacs.] - ** Provide MIME support for Rmail using the Gnus MIME library. [Maybe not now feasible, given Gnus maintenance decisions. fx looked at this and can say where some of the problems are.] @@ -352,6 +370,7 @@ typically due to pilot errors and should thus be in debug-ignored-errors. ** Add a --pristine startup flag which does -q --no-site-file plus ignoring X resources (Doze equivalents?) and most of the environment. What should not be ignored needs consideration. + [Do the existing -Q and -D cover this, or is more needed?] ** Improve the GC (generational, incremental). (We may be able to use the Boehm collector.) [See the Boehm-GC branch in CVS for work on @@ -366,11 +385,9 @@ typically due to pilot errors and should thus be in debug-ignored-errors. ** Provide an optional feature which computes a scroll bar slider's size and its position from lines instead of characters. -** Add support for SVG (Scalable Vector Graphics) rendering to - Emacs. - ** Allow unknown image types to be rendered via an external program - converting them to, say, PBM (in the same way as PostScript?). + converting them to, say, PBM (in the same way as PostScript?). [does + doc-view.el do this, or could it be extended to do this?] ** Allow displaying an X window from an external program in a buffer, e.g. to render graphics from Java applets. [gerd and/or wmperry @@ -530,6 +547,18 @@ but which can also be used as a modifier). See thread <http://lists.gnu.org/archive/html/emacs-pretest-bug/2006-11/msg00060.html> +** Possibly add a "close" button to the modeline. + The idea is to add an "X" of some kind, that when clicked deletes + the window associated with that modeline. + http://lists.gnu.org/archive/html/emacs-devel/2007-09/msg02416.html + +** When running isearch in a ChangeLog file, if the search fails, + then after another C-s try searching the previous ChangeLog, if + there is one. (e.g. go from ChangeLog to ChangeLog.12). + http://lists.gnu.org/archive/html/emacs-devel/2007-09/msg02237.html + Juri Linkov has a patch for this: + http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg00265.html + * Internal changes ** Cleanup all the GC_ mark bit stuff -- there is no longer any distinction diff --git a/etc/e/README b/etc/e/README index a5188d2fbea..c547fc68fda 100644 --- a/etc/e/README +++ b/etc/e/README @@ -2,7 +2,10 @@ eterm-color.ti is a terminfo source file. eterm-color is a compiled version produced by the terminfo compiler (tic). The compiled files are binary, and depend on the version of tic, but they seem to be system-independent and backwardly compatible. So there should be no -need to recompile (see etc/Makefile) the distributed binary version. +need to recompile the distributed binary version. If it is +necessary, use: + +tic -o ../ ./eterm-color.ti The compiled file is used by lisp/term.el, so if it is moved term.el needs to be changed. terminfo requires it to be stored in an `e' diff --git a/etc/emacs.bash b/etc/emacs.bash index c207e5ffe9e..79ce7840d93 100644 --- a/etc/emacs.bash +++ b/etc/emacs.bash @@ -55,7 +55,7 @@ function edit () case "${windowsys}" in x ) (emacs "$@" &) ;; - sun ) (emacstool "$@" &) ;; + sun ) echo "unsupported window system"; return 1 ;; esac else if jobs %emacs 2> /dev/null ; then diff --git a/etc/emacs.csh b/etc/emacs.csh index 8afea6bd35c..880aad08f01 100644 --- a/etc/emacs.csh +++ b/etc/emacs.csh @@ -16,14 +16,9 @@ ## 2 = resume emacs ## 3 = new emacs under X (-i is so that you get a reasonable icon) ## 4 = resume emacs under X -## 5 = new emacs under suntools -## 6 = resume emacs under suntools -## 7 = new emacs under X and suntools - doesn't make any sense, so use X -## 8 = resume emacs under X and suntools - doesn't make any sense, so use X set EMACS_PATTERN="^\[[0-9]\] . Stopped ............ $EMACS" alias edit 'set emacs_command=("emacs -nw \!*" "fg %emacs" "emacs -i \!* &"\ - "emacsclient \!* &" "emacstool \!* &" "emacsclient \!* &" "emacs -i \!* &"\ "emacsclient \!* &") ; \ jobs >! $HOME/.jobs; grep "$EMACS_PATTERN" < $HOME/.jobs >& /dev/null; \ @ isjob = ! $status; \ diff --git a/etc/emacs.py b/etc/emacs.py index f11913cd7b5..964c1f17f40 100644 --- a/etc/emacs.py +++ b/etc/emacs.py @@ -1,232 +1,11 @@ -"""Definitions used by commands sent to inferior Python in python.el.""" +"""Wrapper for version-specific implementations of python.el helper +functions """ -# Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. -# Author: Dave Love <fx@gnu.org> +import sys -# This file is part of GNU Emacs. +if sys.version_info[0] == 3: + from emacs3 import * +else: + from emacs2 import * -# GNU Emacs is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. - -# GNU Emacs is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with GNU Emacs; see the file COPYING. If not, write to the -# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -# Boston, MA 02110-1301, USA. - -import os, sys, traceback, inspect, __main__ -from sets import Set - -__all__ = ["eexecfile", "eargs", "complete", "ehelp", "eimport", "modpath"] - -def format_exception (filename, should_remove_self): - type, value, tb = sys.exc_info () - sys.last_type = type - sys.last_value = value - sys.last_traceback = tb - if type is SyntaxError: - try: # parse the error message - msg, (dummy_filename, lineno, offset, line) = value - except: - pass # Not the format we expect; leave it alone - else: - # Stuff in the right filename - value = SyntaxError(msg, (filename, lineno, offset, line)) - sys.last_value = value - res = traceback.format_exception_only (type, value) - # There are some compilation errors which do not provide traceback so we - # should not massage it. - if should_remove_self: - tblist = traceback.extract_tb (tb) - del tblist[:1] - res = traceback.format_list (tblist) - if res: - res.insert(0, "Traceback (most recent call last):\n") - res[len(res):] = traceback.format_exception_only (type, value) - # traceback.print_exception(type, value, tb) - for line in res: print line, - -def eexecfile (file): - """Execute FILE and then remove it. - Execute the file within the __main__ namespace. - If we get an exception, print a traceback with the top frame - (ourselves) excluded.""" - # We cannot use real execfile since it has a bug where the file stays - # locked forever (under w32) if SyntaxError occurs. - # --- code based on code.py and PyShell.py. - try: - try: - source = open (file, "r").read() - code = compile (source, file, "exec") - # Other exceptions (shouldn't be any...) will (correctly) fall - # through to "final". - except (OverflowError, SyntaxError, ValueError): - # FIXME: When can compile() raise anything else than - # SyntaxError ???? - format_exception (file, False) - return - try: - exec code in __main__.__dict__ - except: - format_exception (file, True) - finally: - os.remove (file) - -def eargs (name, imports): - "Get arglist of NAME for Eldoc &c." - try: - if imports: exec imports - parts = name.split ('.') - if len (parts) > 1: - exec 'import ' + parts[0] # might fail - func = eval (name) - if inspect.isbuiltin (func) or type(func) is type: - doc = func.__doc__ - if doc.find (' ->') != -1: - print '_emacs_out', doc.split (' ->')[0] - else: - print '_emacs_out', doc.split ('\n')[0] - return - if inspect.ismethod (func): - func = func.im_func - if not inspect.isfunction (func): - print '_emacs_out ' - return - (args, varargs, varkw, defaults) = inspect.getargspec (func) - # No space between name and arglist for consistency with builtins. - print '_emacs_out', \ - func.__name__ + inspect.formatargspec (args, varargs, varkw, - defaults) - except: - print "_emacs_out " - -def all_names (object): - """Return (an approximation to) a list of all possible attribute - names reachable via the attributes of OBJECT, i.e. roughly the - leaves of the dictionary tree under it.""" - - def do_object (object, names): - if inspect.ismodule (object): - do_module (object, names) - elif inspect.isclass (object): - do_class (object, names) - # Might have an object without its class in scope. - elif hasattr (object, '__class__'): - names.add ('__class__') - do_class (object.__class__, names) - # Probably not a good idea to try to enumerate arbitrary - # dictionaries... - return names - - def do_module (module, names): - if hasattr (module, '__all__'): # limited export list - names.union_update (module.__all__) - for i in module.__all__: - do_object (getattr (module, i), names) - else: # use all names - names.union_update (dir (module)) - for i in dir (module): - do_object (getattr (module, i), names) - return names - - def do_class (object, names): - ns = dir (object) - names.union_update (ns) - if hasattr (object, '__bases__'): # superclasses - for i in object.__bases__: do_object (i, names) - return names - - return do_object (object, Set ([])) - -def complete (name, imports): - """Complete TEXT in NAMESPACE and print a Lisp list of completions. - Exec IMPORTS first.""" - import __main__, keyword - - def class_members(object): - names = dir (object) - if hasattr (object, '__bases__'): - for super in object.__bases__: - names = class_members (super) - return names - - names = Set ([]) - base = None - try: - dict = __main__.__dict__.copy() - if imports: exec imports in dict - l = len (name) - if not "." in name: - for list in [dir (__builtins__), keyword.kwlist, dict.keys()]: - for elt in list: - if elt[:l] == name: names.add(elt) - else: - base = name[:name.rfind ('.')] - name = name[name.rfind('.')+1:] - try: - object = eval (base, dict) - names = Set (dir (object)) - if hasattr (object, '__class__'): - names.add('__class__') - names.union_update (class_members (object)) - except: names = all_names (dict) - except: return [] - l = len(name) - print '_emacs_out (', - for n in names: - if name == n[:l]: - if base: print '"%s.%s"' % (base, n), - else: print '"%s"' % n, - print ')' - -def ehelp (name, imports): - """Get help on string NAME. - First try to eval name for, e.g. user definitions where we need - the object. Otherwise try the string form.""" - locls = {} - if imports: - try: exec imports in locls - except: pass - try: help (eval (name, globals(), locls)) - except: help (name) - -def eimport (mod, dir): - """Import module MOD with directory DIR at the head of the search path. - NB doesn't load from DIR if MOD shadows a system module.""" - from __main__ import __dict__ - - path0 = sys.path[0] - sys.path[0] = dir - try: - try: - if __dict__.has_key(mod) and inspect.ismodule (__dict__[mod]): - reload (__dict__[mod]) - else: - __dict__[mod] = __import__ (mod) - except: - (type, value, tb) = sys.exc_info () - print "Traceback (most recent call last):" - traceback.print_exception (type, value, tb.tb_next) - finally: - sys.path[0] = path0 - -def modpath (module): - """Return the source file for the given MODULE (or None). -Assumes that MODULE.py and MODULE.pyc are in the same directory.""" - try: - path = __import__ (module).__file__ - if path[-4:] == '.pyc' and os.path.exists (path[0:-1]): - path = path[:-1] - print "_emacs_out", path - except: - print "_emacs_out ()" - -# print '_emacs_ok' # ready for input and can call continuation - -# arch-tag: d90408f3-90e2-4de4-99c2-6eb9c7b9ca46 +# arch-tag: 894b5227-638f-45fd-8567-0417d5c35900 diff --git a/etc/emacs2.py b/etc/emacs2.py new file mode 100644 index 00000000000..b48689508e6 --- /dev/null +++ b/etc/emacs2.py @@ -0,0 +1,239 @@ +"""Definitions used by commands sent to inferior Python in python.el.""" + +# Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. +# Author: Dave Love <fx@gnu.org> + +# This file is part of GNU Emacs. + +# GNU Emacs is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. + +# GNU Emacs is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with GNU Emacs; see the file COPYING. If not, write to the +# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. + +import os, sys, traceback, inspect, __main__ + +try: + set +except: + from sets import Set as set + +__all__ = ["eexecfile", "eargs", "complete", "ehelp", "eimport", "modpath"] + +def format_exception (filename, should_remove_self): + type, value, tb = sys.exc_info () + sys.last_type = type + sys.last_value = value + sys.last_traceback = tb + if type is SyntaxError: + try: # parse the error message + msg, (dummy_filename, lineno, offset, line) = value + except: + pass # Not the format we expect; leave it alone + else: + # Stuff in the right filename + value = SyntaxError(msg, (filename, lineno, offset, line)) + sys.last_value = value + res = traceback.format_exception_only (type, value) + # There are some compilation errors which do not provide traceback so we + # should not massage it. + if should_remove_self: + tblist = traceback.extract_tb (tb) + del tblist[:1] + res = traceback.format_list (tblist) + if res: + res.insert(0, "Traceback (most recent call last):\n") + res[len(res):] = traceback.format_exception_only (type, value) + # traceback.print_exception(type, value, tb) + for line in res: print line, + +def eexecfile (file): + """Execute FILE and then remove it. + Execute the file within the __main__ namespace. + If we get an exception, print a traceback with the top frame + (ourselves) excluded.""" + # We cannot use real execfile since it has a bug where the file stays + # locked forever (under w32) if SyntaxError occurs. + # --- code based on code.py and PyShell.py. + try: + try: + source = open (file, "r").read() + code = compile (source, file, "exec") + # Other exceptions (shouldn't be any...) will (correctly) fall + # through to "final". + except (OverflowError, SyntaxError, ValueError): + # FIXME: When can compile() raise anything else than + # SyntaxError ???? + format_exception (file, False) + return + try: + exec code in __main__.__dict__ + except: + format_exception (file, True) + finally: + os.remove (file) + +def eargs (name, imports): + "Get arglist of NAME for Eldoc &c." + try: + if imports: exec imports + parts = name.split ('.') + if len (parts) > 1: + exec 'import ' + parts[0] # might fail + func = eval (name) + if inspect.isbuiltin (func) or type(func) is type: + doc = func.__doc__ + if doc.find (' ->') != -1: + print '_emacs_out', doc.split (' ->')[0] + else: + print '_emacs_out', doc.split ('\n')[0] + return + if inspect.ismethod (func): + func = func.im_func + if not inspect.isfunction (func): + print '_emacs_out ' + return + (args, varargs, varkw, defaults) = inspect.getargspec (func) + # No space between name and arglist for consistency with builtins. + print '_emacs_out', \ + func.__name__ + inspect.formatargspec (args, varargs, varkw, + defaults) + except: + print "_emacs_out " + +def all_names (object): + """Return (an approximation to) a list of all possible attribute + names reachable via the attributes of OBJECT, i.e. roughly the + leaves of the dictionary tree under it.""" + + def do_object (object, names): + if inspect.ismodule (object): + do_module (object, names) + elif inspect.isclass (object): + do_class (object, names) + # Might have an object without its class in scope. + elif hasattr (object, '__class__'): + names.add ('__class__') + do_class (object.__class__, names) + # Probably not a good idea to try to enumerate arbitrary + # dictionaries... + return names + + def do_module (module, names): + if hasattr (module, '__all__'): # limited export list + names.update(module.__all__) + for i in module.__all__: + do_object (getattr (module, i), names) + else: # use all names + names.update(dir (module)) + for i in dir (module): + do_object (getattr (module, i), names) + return names + + def do_class (object, names): + ns = dir (object) + names.update(ns) + if hasattr (object, '__bases__'): # superclasses + for i in object.__bases__: do_object (i, names) + return names + + return do_object (object, set([])) + +def complete (name, imports): + """Complete TEXT in NAMESPACE and print a Lisp list of completions. + Exec IMPORTS first.""" + import __main__, keyword + + def class_members(object): + names = dir (object) + if hasattr (object, '__bases__'): + for super in object.__bases__: + names = class_members (super) + return names + + names = set([]) + base = None + try: + dict = __main__.__dict__.copy() + if imports: exec imports in dict + l = len (name) + if not "." in name: + for src in [dir (__builtins__), keyword.kwlist, dict.keys()]: + for elt in src: + if elt[:l] == name: names.add(elt) + else: + base = name[:name.rfind ('.')] + name = name[name.rfind('.')+1:] + try: + object = eval (base, dict) + names = set(dir (object)) + if hasattr (object, '__class__'): + names.add('__class__') + names.update(class_members (object)) + except: names = all_names (dict) + except: + print sys.exc_info() + names = [] + + l = len(name) + print '_emacs_out (', + for n in names: + if name == n[:l]: + if base: print '"%s.%s"' % (base, n), + else: print '"%s"' % n, + print ')' + +def ehelp (name, imports): + """Get help on string NAME. + First try to eval name for, e.g. user definitions where we need + the object. Otherwise try the string form.""" + locls = {} + if imports: + try: exec imports in locls + except: pass + try: help (eval (name, globals(), locls)) + except: help (name) + +def eimport (mod, dir): + """Import module MOD with directory DIR at the head of the search path. + NB doesn't load from DIR if MOD shadows a system module.""" + from __main__ import __dict__ + + path0 = sys.path[0] + sys.path[0] = dir + try: + try: + if __dict__.has_key(mod) and inspect.ismodule (__dict__[mod]): + reload (__dict__[mod]) + else: + __dict__[mod] = __import__ (mod) + except: + (type, value, tb) = sys.exc_info () + print "Traceback (most recent call last):" + traceback.print_exception (type, value, tb.tb_next) + finally: + sys.path[0] = path0 + +def modpath (module): + """Return the source file for the given MODULE (or None). +Assumes that MODULE.py and MODULE.pyc are in the same directory.""" + try: + path = __import__ (module).__file__ + if path[-4:] == '.pyc' and os.path.exists (path[0:-1]): + path = path[:-1] + print "_emacs_out", path + except: + print "_emacs_out ()" + +# print '_emacs_ok' # ready for input and can call continuation + +# arch-tag: d90408f3-90e2-4de4-99c2-6eb9c7b9ca46 diff --git a/etc/emacs3.py b/etc/emacs3.py new file mode 100644 index 00000000000..96e8ebbfb8b --- /dev/null +++ b/etc/emacs3.py @@ -0,0 +1,244 @@ +""" +Warning: This file is automatically generated from emacs2.py with the +2to3 script. Do not hand edit. +""" + +"""Definitions used by commands sent to inferior Python in python.el.""" + +# Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. +# Author: Dave Love <fx@gnu.org> + +# This file is part of GNU Emacs. + +# GNU Emacs is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. + +# GNU Emacs is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with GNU Emacs; see the file COPYING. If not, write to the +# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. + +import os, sys, traceback, inspect, __main__ + +try: + set +except: + from sets import Set as set + +__all__ = ["eexecfile", "eargs", "complete", "ehelp", "eimport", "modpath"] + +def format_exception (filename, should_remove_self): + type, value, tb = sys.exc_info () + sys.last_type = type + sys.last_value = value + sys.last_traceback = tb + if type is SyntaxError: + try: # parse the error message + msg, (dummy_filename, lineno, offset, line) = value + except: + pass # Not the format we expect; leave it alone + else: + # Stuff in the right filename + value = SyntaxError(msg, (filename, lineno, offset, line)) + sys.last_value = value + res = traceback.format_exception_only (type, value) + # There are some compilation errors which do not provide traceback so we + # should not massage it. + if should_remove_self: + tblist = traceback.extract_tb (tb) + del tblist[:1] + res = traceback.format_list (tblist) + if res: + res.insert(0, "Traceback (most recent call last):\n") + res[len(res):] = traceback.format_exception_only (type, value) + # traceback.print_exception(type, value, tb) + for line in res: print(line, end=' ') + +def eexecfile (file): + """Execute FILE and then remove it. + Execute the file within the __main__ namespace. + If we get an exception, print a traceback with the top frame + (ourselves) excluded.""" + # We cannot use real execfile since it has a bug where the file stays + # locked forever (under w32) if SyntaxError occurs. + # --- code based on code.py and PyShell.py. + try: + try: + source = open (file, "r").read() + code = compile (source, file, "exec") + # Other exceptions (shouldn't be any...) will (correctly) fall + # through to "final". + except (OverflowError, SyntaxError, ValueError): + # FIXME: When can compile() raise anything else than + # SyntaxError ???? + format_exception (file, False) + return + try: + exec(code, __main__.__dict__) + except: + format_exception (file, True) + finally: + os.remove (file) + +def eargs (name, imports): + "Get arglist of NAME for Eldoc &c." + try: + if imports: exec(imports) + parts = name.split ('.') + if len (parts) > 1: + exec('import ' + parts[0]) # might fail + func = eval (name) + if inspect.isbuiltin (func) or type(func) is type: + doc = func.__doc__ + if doc.find (' ->') != -1: + print('_emacs_out', doc.split (' ->')[0]) + else: + print('_emacs_out', doc.split ('\n')[0]) + return + if inspect.ismethod (func): + func = func.im_func + if not inspect.isfunction (func): + print('_emacs_out ') + return + (args, varargs, varkw, defaults) = inspect.getargspec (func) + # No space between name and arglist for consistency with builtins. + print('_emacs_out', \ + func.__name__ + inspect.formatargspec (args, varargs, varkw, + defaults)) + except: + print("_emacs_out ") + +def all_names (object): + """Return (an approximation to) a list of all possible attribute + names reachable via the attributes of OBJECT, i.e. roughly the + leaves of the dictionary tree under it.""" + + def do_object (object, names): + if inspect.ismodule (object): + do_module (object, names) + elif inspect.isclass (object): + do_class (object, names) + # Might have an object without its class in scope. + elif hasattr (object, '__class__'): + names.add ('__class__') + do_class (object.__class__, names) + # Probably not a good idea to try to enumerate arbitrary + # dictionaries... + return names + + def do_module (module, names): + if hasattr (module, '__all__'): # limited export list + names.update(module.__all__) + for i in module.__all__: + do_object (getattr (module, i), names) + else: # use all names + names.update(dir (module)) + for i in dir (module): + do_object (getattr (module, i), names) + return names + + def do_class (object, names): + ns = dir (object) + names.update(ns) + if hasattr (object, '__bases__'): # superclasses + for i in object.__bases__: do_object (i, names) + return names + + return do_object (object, set([])) + +def complete (name, imports): + """Complete TEXT in NAMESPACE and print a Lisp list of completions. + Exec IMPORTS first.""" + import __main__, keyword + + def class_members(object): + names = dir (object) + if hasattr (object, '__bases__'): + for super in object.__bases__: + names = class_members (super) + return names + + names = set([]) + base = None + try: + dict = __main__.__dict__.copy() + if imports: exec(imports, dict) + l = len (name) + if not "." in name: + for src in [dir (__builtins__), keyword.kwlist, list(dict.keys())]: + for elt in src: + if elt[:l] == name: names.add(elt) + else: + base = name[:name.rfind ('.')] + name = name[name.rfind('.')+1:] + try: + object = eval (base, dict) + names = set(dir (object)) + if hasattr (object, '__class__'): + names.add('__class__') + names.update(class_members (object)) + except: names = all_names (dict) + except: + print(sys.exc_info()) + names = [] + + l = len(name) + print('_emacs_out (', end=' ') + for n in names: + if name == n[:l]: + if base: print('"%s.%s"' % (base, n), end=' ') + else: print('"%s"' % n, end=' ') + print(')') + +def ehelp (name, imports): + """Get help on string NAME. + First try to eval name for, e.g. user definitions where we need + the object. Otherwise try the string form.""" + locls = {} + if imports: + try: exec(imports, locls) + except: pass + try: help (eval (name, globals(), locls)) + except: help (name) + +def eimport (mod, dir): + """Import module MOD with directory DIR at the head of the search path. + NB doesn't load from DIR if MOD shadows a system module.""" + from __main__ import __dict__ + + path0 = sys.path[0] + sys.path[0] = dir + try: + try: + if mod in __dict__ and inspect.ismodule (__dict__[mod]): + reload (__dict__[mod]) + else: + __dict__[mod] = __import__ (mod) + except: + (type, value, tb) = sys.exc_info () + print("Traceback (most recent call last):") + traceback.print_exception (type, value, tb.tb_next) + finally: + sys.path[0] = path0 + +def modpath (module): + """Return the source file for the given MODULE (or None). +Assumes that MODULE.py and MODULE.pyc are in the same directory.""" + try: + path = __import__ (module).__file__ + if path[-4:] == '.pyc' and os.path.exists (path[0:-1]): + path = path[:-1] + print("_emacs_out", path) + except: + print("_emacs_out ()") + +# print '_emacs_ok' # ready for input and can call continuation + +# arch-tag: 37bfed38-5f4a-4027-a2bf-d5f41819dd89 diff --git a/etc/emacstool.1 b/etc/emacstool.1 deleted file mode 100644 index ef1941111fd..00000000000 --- a/etc/emacstool.1 +++ /dev/null @@ -1,155 +0,0 @@ -.TH EMACSTOOL 1 -.SH NAME -.I emacstool -\- run emacs under Sun windows with function-key and mouse support. -.SH SYNOPSIS -.I emacstool -[{window_args} {-rc run_command_path} args ... ] -.SH TYPICAL USAGE -In ~/.suntools or ~/.rootmenu include a line like this: -.br -"Emacstool" emacstool -WI emacs.icon -f emacstool-init -.SH DESCRIPTION -.B Emacstool -creates a SunView frame and a tty subwindow within which mouse events -and function keys are translated to ASCII sequences which Emacs can -parse. The translated input events are sent to the process running in -the tty subwindow, which is typically GNU Emacs. Emacstool thereby -allows GNU Emacs users to make full use of the mouse and function keys. -GNU Emacs can be loaded with functions to interpret the mouse and -function-key events to make a truly fine screen oriented editor for -the Sun Workstation. -.PP -(Note that GNU Emacs has a special interface to the X window system as -well. The X window system has many technical advantages, it is an -industry standard, and it is also free software. The Free Software -Foundation urges you to try X windows, and distributes a free copy of -X on Emacs distribution tapes.) -.PP -Function keys are translated to a sequence of the form -`^X*[a-o][lrt]'. The last character is `l', `r', or `t' corresponding -to whether the key is among the Left, Right, or Top function keys. -The third character indicates which button of the group -was pressed. Thus, the function key in the lower right corner will -transmit the sequence `^X*or'. In addition, the [lrt] is affected by -the Control, Meta, and Shift keys. Unshifted Control keys will be -non-alphabetic: C-l is [,], C-r is [2], C-t is [4]. -.PP -Mouse buttons are encoded as `^X^@([124] x y)\\n'. ^X^@ is the -standard GNU Emacs mouse event prefix, it is followed by a list -indicating the button pressed and the character row and column of the -point in the window where the mouse cursor is, and followed by a -newline character. In GNU Emacs, the ^X^@ dispatches to a -mouse event handler which then reads the following list. -.SH OPTIONS -.B Emacstool -supports all the standard window arguments, including font and icon -specifiers. -.PP -By default, Emacstool runs the program -.I emacs -in the created subwindow. -The value of the environment variable -.I EMACSTOOL -can be used to override this if your version of -.B Emacs -is not accessible on your search path by the name -.I Emacs. -In addition, the run command can be set by the -.I pathname -following the last occurrence of the -.I \-rc -flag. -This is convenient for using Emacstool to run on remote machines. -.PP -All other command line arguments not used by the window system are passed -as arguments to the program that runs in the Emacstool window. -.PP -For example: -.PP -local% (emacstool -rc rlogin remote -8 &)& -.PP -will create an Emacstool window logged in to a machine named -.I remote. -If Emacs is run from this window, -Emacstool will encode mouse and function keys, and send them to rlogin. -If Emacs is run from this shell on the remote machine, it will see -the mouse and function keys properly. -However, since the remote host does not have access to the screen, -the cursor cannot be changed, menus will not appear, and the selection -buffer (STUFF) is limited. -.SH Using With GNU Emacs: -The GNU Emacs files -lisp/term/sun.el, -lisp/sun-mouse.el, -lisp/sun-fns.el, -and -src/sunfns.c -provide emacs support for the Emacstool and function keys. -Emacstool will automatically set the TERM environment variable to be "sun" -and unset the environment variable TERMCAP. That is, these variables will -not be inherited from the shell that starts Emacstool. -Since the terminal type is -.I SUN -(that is, the environment variable TERM is set to -.I SUN), -Emacs will automatically load the file lisp/term/sun. -This, in turn, will ensure that sun-mouse.el is autoloaded when any mouse -events are detected. It is suggested that -.I sun-mouse -and -.I sun-fns -be loaded in your site-init.el file, so that they will always be loaded -when running on a Sun workstation. -.PP -In addition, Emacstool sets the environment variable IN_EMACSTOOL = "t". -Lisp code in your ~/.emacs can use (getenv "IN_EMACSTOOL") -to determine whether to do Emacstool specific initialization. -Sun.el uses this to automatically call emacstool-init (getenv "IN_EMACSTOOL") -is defined. -.PP -The file src/sunfns.c defines several useful functions for emacs on -the Sun. Among these are procedures to pop-up SunView -.I menus, -put and get from the SunView -.I STUFF -buffer, and a procedure for changing the cursor -.I icon. -If you want to define or edit cursor icons, -there is a rudimentary mouse driven icon editor in the file -lisp/sun-cursors.el. Try invoking (sc:edit-cursor) -.SH BUGS -It takes a few milliseconds to create a menu before it pops up. -.SH ENVIRONMENT VARIABLES -EMACSTOOL -IN_EMACSTOOL -TERM -TERMCAP -.SH FILES -.DT -emacs -.SH "SEE ALSO" -emacs(1) - .../etc/SUN-SUPPORT - .../lisp/term/sun.el -.SH COPYING -Copyright -.if t \(co -.if n (c) -2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. -.PP -Permission is granted to make and distribute verbatim copies of this -document provided the copyright notice and this permission notice are -preserved on all copies. -.PP -Permission is granted to copy and distribute modified versions of -this document under the conditions for verbatim copying, provided that -the entire resulting derived work is distributed under the terms of -a permission notice identical to this one. -.PP -Permission is granted to copy and distribute translations of this -document into another language, under the above conditions for -modified versions, except that this permission notice may be stated -in a translation approved by the Free Software Foundation. - -.\" arch-tag: a1f44815-5163-4026-89c1-4404e4b81d37 diff --git a/etc/gfdl.1 b/etc/gfdl.1 deleted file mode 100644 index af660f67787..00000000000 --- a/etc/gfdl.1 +++ /dev/null @@ -1,440 +0,0 @@ -.TH GFDL 1 "2005 September 17" -.SH NAME -GFDL \- The GNU Free Documentation License - -.ce -Version 1.2, November 2002 - -.hy 0 -.na -Copyright -.if t \(co -.if n (c) -2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. -51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -Everyone is permitted to copy and distribute verbatim copies -of this license document, but changing it is not allowed. -.hy 1 -.ad - -.br -.SH 0. PREAMBLE - -The purpose of this License is to make a manual, textbook, or other -functional and useful document "free" in the sense of freedom: to -assure everyone the effective freedom to copy and redistribute it, -with or without modifying it, either commercially or noncommercially. -Secondarily, this License preserves for the author and publisher a way -to get credit for their work, while not being considered responsible -for modifications made by others. - -This License is a kind of "copyleft", which means that derivative -works of the document must themselves be free in the same sense. It -complements the GNU General Public License, which is a copyleft -license designed for free software. - -We have designed this License in order to use it for manuals for free -software, because free software needs free documentation: a free -program should come with manuals providing the same freedoms that the -software does. But this License is not limited to software manuals; -it can be used for any textual work, regardless of subject matter or -whether it is published as a printed book. We recommend this License -principally for works whose purpose is instruction or reference. - -.SH 1. APPLICABILITY AND DEFINITIONS - -This License applies to any manual or other work, in any medium, that -contains a notice placed by the copyright holder saying it can be -distributed under the terms of this License. Such a notice grants a -world-wide, royalty-free license, unlimited in duration, to use that -work under the conditions stated herein. The "Document", below, -refers to any such manual or work. Any member of the public is a -licensee, and is addressed as "you". You accept the license if you -copy, modify or distribute the work in a way requiring permission -under copyright law. - -A "Modified Version" of the Document means any work containing the -Document or a portion of it, either copied verbatim, or with -modifications and/or translated into another language. - -A "Secondary Section" is a named appendix or a front-matter section of -the Document that deals exclusively with the relationship of the -publishers or authors of the Document to the Document's overall subject -(or to related matters) and contains nothing that could fall directly -within that overall subject. (Thus, if the Document is in part a -textbook of mathematics, a Secondary Section may not explain any -mathematics.) The relationship could be a matter of historical -connection with the subject or with related matters, or of legal, -commercial, philosophical, ethical or political position regarding -them. - -The "Invariant Sections" are certain Secondary Sections whose titles -are designated, as being those of Invariant Sections, in the notice -that says that the Document is released under this License. If a -section does not fit the above definition of Secondary then it is not -allowed to be designated as Invariant. The Document may contain zero -Invariant Sections. If the Document does not identify any Invariant -Sections then there are none. - -The "Cover Texts" are certain short passages of text that are listed, -as Front-Cover Texts or Back-Cover Texts, in the notice that says that -the Document is released under this License. A Front-Cover Text may -be at most 5 words, and a Back-Cover Text may be at most 25 words. - -A "Transparent" copy of the Document means a machine-readable copy, -represented in a format whose specification is available to the -general public, that is suitable for revising the document -straightforwardly with generic text editors or (for images composed of -pixels) generic paint programs or (for drawings) some widely available -drawing editor, and that is suitable for input to text formatters or -for automatic translation to a variety of formats suitable for input -to text formatters. A copy made in an otherwise Transparent file -format whose markup, or absence of markup, has been arranged to thwart -or discourage subsequent modification by readers is not Transparent. -An image format is not Transparent if used for any substantial amount -of text. A copy that is not "Transparent" is called "Opaque". - -Examples of suitable formats for Transparent copies include plain -ASCII without markup, Texinfo input format, LaTeX input format, SGML -or XML using a publicly available DTD, and standard-conforming simple -HTML, PostScript or PDF designed for human modification. Examples of -transparent image formats include PNG, XCF and JPG. Opaque formats -include proprietary formats that can be read and edited only by -proprietary word processors, SGML or XML for which the DTD and/or -processing tools are not generally available, and the -machine-generated HTML, PostScript or PDF produced by some word -processors for output purposes only. - -The "Title Page" means, for a printed book, the title page itself, -plus such following pages as are needed to hold, legibly, the material -this License requires to appear in the title page. For works in -formats which do not have any title page as such, "Title Page" means -the text near the most prominent appearance of the work's title, -preceding the beginning of the body of the text. - -A section "Entitled XYZ" means a named subunit of the Document whose -title either is precisely XYZ or contains XYZ in parentheses following -text that translates XYZ in another language. (Here XYZ stands for a -specific section name mentioned below, such as "Acknowledgements", -"Dedications", "Endorsements", or "History".) To "Preserve the Title" -of such a section when you modify the Document means that it remains a -section "Entitled XYZ" according to this definition. - -The Document may include Warranty Disclaimers next to the notice which -states that this License applies to the Document. These Warranty -Disclaimers are considered to be included by reference in this -License, but only as regards disclaiming warranties: any other -implication that these Warranty Disclaimers may have is void and has -no effect on the meaning of this License. - -.SH 2. VERBATIM COPYING - -You may copy and distribute the Document in any medium, either -commercially or noncommercially, provided that this License, the -copyright notices, and the license notice saying this License applies -to the Document are reproduced in all copies, and that you add no other -conditions whatsoever to those of this License. You may not use -technical measures to obstruct or control the reading or further -copying of the copies you make or distribute. However, you may accept -compensation in exchange for copies. If you distribute a large enough -number of copies you must also follow the conditions in section 3. - -You may also lend copies, under the same conditions stated above, and -you may publicly display copies. - -.SH 3. COPYING IN QUANTITY - -If you publish printed copies (or copies in media that commonly have -printed covers) of the Document, numbering more than 100, and the -Document's license notice requires Cover Texts, you must enclose the -copies in covers that carry, clearly and legibly, all these Cover -Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on -the back cover. Both covers must also clearly and legibly identify -you as the publisher of these copies. The front cover must present -the full title with all words of the title equally prominent and -visible. You may add other material on the covers in addition. -Copying with changes limited to the covers, as long as they preserve -the title of the Document and satisfy these conditions, can be treated -as verbatim copying in other respects. - -If the required texts for either cover are too voluminous to fit -legibly, you should put the first ones listed (as many as fit -reasonably) on the actual cover, and continue the rest onto adjacent -pages. - -If you publish or distribute Opaque copies of the Document numbering -more than 100, you must either include a machine-readable Transparent -copy along with each Opaque copy, or state in or with each Opaque copy -a computer-network location from which the general network-using -public has access to download using public-standard network protocols -a complete Transparent copy of the Document, free of added material. -If you use the latter option, you must take reasonably prudent steps, -when you begin distribution of Opaque copies in quantity, to ensure -that this Transparent copy will remain thus accessible at the stated -location until at least one year after the last time you distribute an -Opaque copy (directly or through your agents or retailers) of that -edition to the public. - -It is requested, but not required, that you contact the authors of the -Document well before redistributing any large number of copies, to give -them a chance to provide you with an updated version of the Document. - -.SH 4. MODIFICATIONS - -You may copy and distribute a Modified Version of the Document under -the conditions of sections 2 and 3 above, provided that you release -the Modified Version under precisely this License, with the Modified -Version filling the role of the Document, thus licensing distribution -and modification of the Modified Version to whoever possesses a copy -of it. In addition, you must do these things in the Modified Version: -.TP -A. -Use in the Title Page (and on the covers, if any) a title distinct from -that of the Document, and from those of previous versions (which should, -if there were any, be listed in the History section of the Document). -You may use the same title as a previous version if the original -publisher of that version gives permission. -.TP -B. -List on the Title Page, as authors, one or more persons or entities -responsible for authorship of the modifications in the Modified Version, -together with at least five of the principal authors of the Document -(all of its principal authors, if it has fewer than five), unless they -release you from this requirement. -.TP -C. -State on the Title page the name of the publisher of the -Modified Version, as the publisher. -.TP -D. -Preserve all the copyright notices of the Document. -.TP -E. -Add an appropriate copyright notice for your modifications -adjacent to the other copyright notices. -.TP -F. -Include, immediately after the copyright notices, a license notice -giving the public permission to use the Modified Version under the terms -of this License, in the form shown in the Addendum below. -.TP -G. -Preserve in that license notice the full lists of Invariant Sections -and required Cover Texts given in the Document's license notice. -.TP -H. -Include an unaltered copy of this License. -.TP -I. -Preserve the section Entitled "History", Preserve its Title, and add to -it an item stating at least the title, year, new authors, and publisher -of the Modified Version as given on the Title Page. If there is no -section Entitled "History" in the Document, create one stating the -title, year, authors, and publisher of the Document as given on its -Title Page, then add an item describing the Modified Version as stated -in the previous sentence. -.TP -J. -Preserve the network location, if any, given in the Document for public -access to a Transparent copy of the Document, and likewise the network -locations given in the Document for previous versions it was based on. -These may be placed in the "History" section. You may omit a network -location for a work that was published at least four years before the -Document itself, or if the original publisher of the version it refers -to gives permission. -.TP -K. -For any section Entitled "Acknowledgements" or "Dedications", Preserve -the Title of the section, and preserve in the section all the substance -and tone of each of the contributor acknowledgements and/or dedications -given therein. -.TP -L. -Preserve all the Invariant Sections of the Document, unaltered in their -text and in their titles. Section numbers or the equivalent are not -considered part of the section titles. -.TP -M. -Delete any section Entitled "Endorsements". Such a section may not be -included in the Modified Version. -.TP -N. -Do not retitle any existing section to be Entitled "Endorsements" or to -conflict in title with any Invariant Section. -.TP -O. -Preserve any Warranty Disclaimers. -.PP -If the Modified Version includes new front-matter sections or -appendices that qualify as Secondary Sections and contain no material -copied from the Document, you may at your option designate some or all -of these sections as invariant. To do this, add their titles to the -list of Invariant Sections in the Modified Version's license notice. -These titles must be distinct from any other section titles. - -You may add a section Entitled "Endorsements", provided it contains -nothing but endorsements of your Modified Version by various -parties--for example, statements of peer review or that the text has -been approved by an organization as the authoritative definition of a -standard. - -You may add a passage of up to five words as a Front-Cover Text, and a -passage of up to 25 words as a Back-Cover Text, to the end of the list -of Cover Texts in the Modified Version. Only one passage of -Front-Cover Text and one of Back-Cover Text may be added by (or -through arrangements made by) any one entity. If the Document already -includes a cover text for the same cover, previously added by you or -by arrangement made by the same entity you are acting on behalf of, -you may not add another; but you may replace the old one, on explicit -permission from the previous publisher that added the old one. - -The author(s) and publisher(s) of the Document do not by this License -give permission to use their names for publicity for or to assert or -imply endorsement of any Modified Version. - -.SH 5. COMBINING DOCUMENTS - -You may combine the Document with other documents released under this -License, under the terms defined in section 4 above for modified -versions, provided that you include in the combination all of the -Invariant Sections of all of the original documents, unmodified, and -list them all as Invariant Sections of your combined work in its -license notice, and that you preserve all their Warranty Disclaimers. - -The combined work need only contain one copy of this License, and -multiple identical Invariant Sections may be replaced with a single -copy. If there are multiple Invariant Sections with the same name but -different contents, make the title of each such section unique by -adding at the end of it, in parentheses, the name of the original -author or publisher of that section if known, or else a unique number. -Make the same adjustment to the section titles in the list of -Invariant Sections in the license notice of the combined work. - -In the combination, you must combine any sections Entitled "History" -in the various original documents, forming one section Entitled -"History"; likewise combine any sections Entitled "Acknowledgements", -and any sections Entitled "Dedications". You must delete all sections -Entitled "Endorsements". - -.SH 6. COLLECTIONS OF DOCUMENTS - -You may make a collection consisting of the Document and other documents -released under this License, and replace the individual copies of this -License in the various documents with a single copy that is included in -the collection, provided that you follow the rules of this License for -verbatim copying of each of the documents in all other respects. - -You may extract a single document from such a collection, and distribute -it individually under this License, provided you insert a copy of this -License into the extracted document, and follow this License in all -other respects regarding verbatim copying of that document. - -.SH 7. AGGREGATION WITH INDEPENDENT WORKS - -A compilation of the Document or its derivatives with other separate -and independent documents or works, in or on a volume of a storage or -distribution medium, is called an "aggregate" if the copyright -resulting from the compilation is not used to limit the legal rights -of the compilation's users beyond what the individual works permit. -When the Document is included in an aggregate, this License does not -apply to the other works in the aggregate which are not themselves -derivative works of the Document. - -If the Cover Text requirement of section 3 is applicable to these -copies of the Document, then if the Document is less than one half of -the entire aggregate, the Document's Cover Texts may be placed on -covers that bracket the Document within the aggregate, or the -electronic equivalent of covers if the Document is in electronic form. -Otherwise they must appear on printed covers that bracket the whole -aggregate. - -.SH 8. TRANSLATION - -Translation is considered a kind of modification, so you may -distribute translations of the Document under the terms of section 4. -Replacing Invariant Sections with translations requires special -permission from their copyright holders, but you may include -translations of some or all Invariant Sections in addition to the -original versions of these Invariant Sections. You may include a -translation of this License, and all the license notices in the -Document, and any Warranty Disclaimers, provided that you also include -the original English version of this License and the original versions -of those notices and disclaimers. In case of a disagreement between -the translation and the original version of this License or a notice -or disclaimer, the original version will prevail. - -If a section in the Document is Entitled "Acknowledgements", -"Dedications", or "History", the requirement (section 4) to Preserve -its Title (section 1) will typically require changing the actual -title. - -.SH 9. TERMINATION - -You may not copy, modify, sublicense, or distribute the Document except -as expressly provided for under this License. Any other attempt to -copy, modify, sublicense or distribute the Document is void, and will -automatically terminate your rights under this License. However, -parties who have received copies, or rights, from you under this -License will not have their licenses terminated so long as such -parties remain in full compliance. - -.SH 10. FUTURE REVISIONS OF THIS LICENSE - -The Free Software Foundation may publish new, revised versions -of the GNU Free Documentation License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. See -\fBhttp://www.gnu.org/copyleft/\fP. - -Each version of the License is given a distinguishing version number. -If the Document specifies that a particular numbered version of this -License "or any later version" applies to it, you have the option of -following the terms and conditions either of that specified version or -of any later version that has been published (not as a draft) by the -Free Software Foundation. If the Document does not specify a version -number of this License, you may choose any version ever published (not -as a draft) by the Free Software Foundation. - -.SH ADDENDUM: How to use this License for your documents - -To use this License in a document you have written, include a copy of -the License in the document and put the following copyright and -license notices just after the title page: - -.hy 0 -.na -Copyright -.if t \(co -.if n (c) -[\fIyear\fP] [\fIyour name\fP]. -Permission is granted to copy, distribute and/or modify this document -under the terms of the GNU Free Documentation License, Version 1.2 -or any later version published by the Free Software Foundation; -with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. -A copy of the license is included in the section entitled "GNU -Free Documentation License." -.ad -.hy 1 - -If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, -replace the "with...Texts." line with this: - -.hy 0 -.na - with the Invariant Sections being [\fILIST THEIR TITLES\fP], with the - Front-Cover Texts being [\fILIST\fP], and with the Back-Cover Texts being - [\fILIST\fP]. -.ad -.hy 1 - -If you have Invariant Sections without Cover Texts, or some other -combination of the three, merge those two alternatives to suit the -situation. - -If your document contains nontrivial examples of program code, we -recommend releasing these examples in parallel under your choice of -free software license, such as the GNU General Public License, -to permit their use in free software. - -.\" arch-tag: 3a15de89-40c2-46b8-a9a2-0710357a9baa diff --git a/etc/refcards/README b/etc/refcards/README index 6788061bcc9..c9ae93a276a 100644 --- a/etc/refcards/README +++ b/etc/refcards/README @@ -10,7 +10,7 @@ COPYRIGHT AND LICENSE INFORMATION FOR IMAGE FILES The file gnus-logo.eps contains copyright and license information, but it is reproduced here for convenience. -File: gnus-logo.eps +File: gnus-logo.eps, gnus-logo.pdf Author: Luis Fernandes <elf@ee.ryerson.ca> Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 9d7d076ca46..6ea05fb9e9a 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,3 +1,103 @@ +2007-10-09 Juanma Barranquero <lekktu@gmail.com> + + * emacsclient.c (print_help_and_exit): Fix space to improve + alignment in output messages. + +2007-09-27 Jason Rumney <jasonr@gnu.org> + + * makefile.w32-in (emacsclient, emacsclientw): Link to COMCTL32. + + * emacsclient.c (w32_window_app): Init common controls when windowed. + +2007-09-21 Glenn Morris <rgm@gnu.org> + + * emacstool.c: Remove file. + * Makefile.in (emacstool, nemacstool, xvetool, xveterm): + Delete targets built from emacstool. + +2007-09-21 Stefan Monnier <monnier@iro.umontreal.ca> + + * emacsclient.c (decode_options): -t implies -c. + +2007-09-20 Stefan Monnier <monnier@iro.umontreal.ca> + + * emacsclient.c (DIRECTORY_SEP, IS_DIRECTORY_SEP, IS_DEVICE_SEP) + (IS_ANY_SEP): Only define if !defined(HAVE_GET_CURRENT_DIR_NAME). + (main_argc): Remove. + (strprefix): Use strncmp. + +2007-09-20 Jason Rumney <jasonr@gnu.org> + + * emacsclient.c (main) [SIGSTOP]: Change conditional from WINDOWSNT. + +2007-09-20 Stefan Monnier <monnier@iro.umontreal.ca> + + * emacsclient.c (current_frame): Change the default. + (longopts): Replace --current-frame by --create-frame. + (decode_options): Reverse the meaning of -c. + (print_help_and_exit): Update help text accordingly. + (main): Remove the -version and -good-version messages. + +2007-09-12 Glenn Morris <rgm@gnu.org> + + * Makefile.in (SOURCES, unlock, relock): Delete. + +2007-08-29 Glenn Morris <rgm@gnu.org> + + * makefile.w32-in (VERSION): Increase to 23.0.50. + +2007-08-29 Dan Nicolaescu <dann@ics.uci.edu> + + * emacsclient.c (w32_execvp): Move definition before use. + (decode_options): Don't use a tty on mac carbon or windows. + +2007-08-29 Jason Rumney <jasonr@gnu.org> + + * emacsclient.c (SEND_STRING, SEND_QUOTED): Remove obfuscation macros. + (quote_argument, set_tcp_socket, handle_sigcont, handle_sigtstp): + (main): Expand removed macros inline. + (main) [WINDOWSNT]: Don't call ttyname. Don't recognize -suspend + option. + (main) [NO_SOCKETS_IN_FILE_SYSTEM]: Don't call init_signals. + +2007-08-29 Karoly Lorentey <lorentey@elte.hu> + + * emacsclient.c (signal.h): New include. + (sys/stat.h, errno.h): Always include, even on WINDOWSNT. + (DIRECTORY_SEP, IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP): + Copy definitions here from src/lisp.h. + (main_argc, main_argv, current_frame, window_system, tty): New vars. + (longopts): Add tty, current-frame. + (xmalloc, xstrdup): New functions. + (get_current_dir_name): New function, copied from src/sysdep.c. + (decode_options): Set display from environment. Add tty and + current_frame options. Make --no-wait imply --current-frame, + except when it is the only option given. Make sure no frame is + opened when --current-frame is set. + (print_help_and_exit): Document tty and current-frame options. + (fail): Change arguments to void. + (main): When sockets are not defined, set main_argc, main_argv, + and call fail() with no arguments. + (emacs_socket): New variable (moved out from main `s'). + (quote_file_name): Rename to quote_argument. + (quote_argument): New name for old quote_file_name. + (unquote_argument, strprefix, pass_signal_to_emacs) + (handle_sigcont, handle_sigtstp, init_signals): New functions. + (set_local_socket): Initialize saved_errno to 0. If socket-name + is too long, call `fail' rather than `exit'. + (main): Doc update. Set main_argc, main_argv. New var `str'. + Don't need a filename or argument if tty or window_system set. + Call fail with no arguments. Use get_current_dir_name to send + over the current directory. Send version number to Emacs for + verification. If tty is set, check TERM, and pass name and type + to Emacs. Pass window_system to Emacs. Move sending of eval to + optind loop. Send -position, -file to Emacs. Call fsync after + fflush. Check for a client/server version match. + Handle -emacs-pid, -window-system-unsupported, -print, -error, and + -suspend commands. Don't exit prematurely on --no-wait, let Emacs + close the connection for us. When creating a new frame, send + environment and pwd to Emacs. Send current-frame to Emacs. + 2007-08-25 Eli Zaretskii <eliz@gnu.org> * Makefile.in (rcs2log, rcs-checkin, grep-changelog, vcdiff): @@ -316,8 +416,7 @@ suggest using options to make them explicit. (AUTH_KEY_LENGTH, SEND_BUFFER_SIZE): New constants. (send_buffer, sblen): New variables. - (send_to_emacs): New function to buffer output and send it with - send(). + (send_to_emacs): New function to buffer output and send it with `send'. (quote_file_name): Use SEND_STRING. (close_winsock, initialize_sockets): New functions to load and unload Winsock. @@ -423,8 +522,8 @@ 2006-05-23 Francesco Potort,Al(B <pot@gnu.org> - * pop.c (pop_open, socket_connection, KPOP_SERVICE): Added - comments explaining why the "kpop" service is never used. + * pop.c (pop_open, socket_connection, KPOP_SERVICE): + Add comments explaining why the "kpop" service is never used. 2006-05-13 Eli Zaretskii <eliz@gnu.org> @@ -532,7 +631,7 @@ * makefile.w32-in (../src/config.h): Don't overwrite. Print a message instead. - (../src/paths.h): Removed. + (../src/paths.h): Remove. 2005-07-27 Juanma Barranquero <lekktu@gmail.com> @@ -910,7 +1009,7 @@ 2003-01-06 Kim F. Storm <storm@cua.dk> - * pop.c (__P): Renamed from _P to avoid problems on Cygwin. + * pop.c (__P): Rename from _P to avoid problems on Cygwin. All uses changed. 2002-12-18 Andrew Innes <andrewi@gnu.org> diff --git a/lib-src/Makefile.in b/lib-src/Makefile.in index 5d8da71dbdd..91074d3ccb1 100644 --- a/lib-src/Makefile.in +++ b/lib-src/Makefile.in @@ -122,9 +122,6 @@ SCRIPTS= rcs2log vcdiff EXECUTABLES= ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS} -SOURCES = COPYING ChangeLog Makefile.in README emacs.csh \ - makedoc.com *.[chy] rcs2log vcdiff - # Additional -D flags for movemail (add to MOVE_FLAGS if desired): # MAIL_USE_POP Support mail retrieval from a POP mailbox. # MAIL_USE_MMDF Support MMDF mailboxes. @@ -368,12 +365,6 @@ maintainer-clean: distclean extraclean: maintainer-clean -rm -f *~ \#* -unlock: - chmod u+w $(SOURCES) - -relock: - chmod u-w $(SOURCES) - /* Test the contents of the directory. */ check: @echo "We don't have any tests for GNU Emacs yet." @@ -471,24 +462,3 @@ update-game-score${EXEEXT}: update-game-score.o $(GETOPTDEPS) update-game-score.o: ${srcdir}/update-game-score.c ../src/config.h $(GETOPT_H) $(CC) -c ${CPP_CFLAGS} ${srcdir}/update-game-score.c \ -DHAVE_SHARED_GAME_DIR="\"$(gamedir)\"" - -/* These are NOT included in INSTALLABLES or UTILITIES. - See ../src/Makefile.in. */ -emacstool${EXEEXT}: ${srcdir}/emacstool.c - $(CC) ${srcdir}/emacstool.c -o emacstool ${ALL_CFLAGS} \ - -lsuntool -lsunwindow -lpixrect $(LOADLIBES) - -/* For SUN Japanese Language Environment. */ -nemacstool${EXEEXT}: ${srcdir}/emacstool.c - $(CC) -o nemacstool -DJLE ${ALL_CFLAGS} ${srcdir}/emacstool.c \ - -lsuntool -lmle -lsunwindow -lpixrect $(LOADLIBES) - -xvetool${EXEEXT}: ${srcdir}/emacstool.c - $(CC) -o xvetool -DXVIEW ${ALL_CFLAGS} ${srcdir}/emacstool.c \ - -lxview -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \ - $(LOADLIBES) - -xveterm${EXEEXT}: ${srcdir}/emacstool.c - $(CC) -o xveterm -DXVIEW -DTTERM ${ALL_CFLAGS} ${srcdir}/emacstool.c \ - -lxview -lolgx -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \ - $(LOADLIBES) diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index 9edba132134..bfa4f9c01d7 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c @@ -35,6 +35,7 @@ Boston, MA 02110-1301, USA. */ # include <malloc.h> # include <stdlib.h> # include <windows.h> +# include <commctrl.h> # define NO_SOCKETS_IN_FILE_SYSTEM @@ -76,7 +77,12 @@ Boston, MA 02110-1301, USA. */ # include <pwd.h> #endif /* not WINDOWSNT */ #endif /* not VMS */ +#include <sys/stat.h> +#include <signal.h> +#include <errno.h> + + char *getenv (), *getwd (); char *(getcwd) (); @@ -84,8 +90,6 @@ char *(getcwd) (); #define VERSION "unspecified" #endif -#define SEND_STRING(data) (send_to_emacs (s, (data))) -#define SEND_QUOTED(data) (quote_file_name (s, (data))) #ifndef EXIT_SUCCESS #define EXIT_SUCCESS 0 @@ -110,15 +114,27 @@ char *(getcwd) (); /* Name used to invoke this program. */ char *progname; +/* The second argument to main. */ +char **main_argv; + /* Nonzero means don't wait for a response from Emacs. --no-wait. */ int nowait = 0; /* Nonzero means args are expressions to be evaluated. --eval. */ int eval = 0; +/* Nonzero means don't open a new frame. Inverse of --create-frame. */ +int current_frame = 1; + +/* Nonzero means open a new graphical frame. */ +int window_system = 0; + /* The display on which Emacs should work. --display. */ char *display = NULL; +/* Nonzero means open a new Emacs frame on the current terminal. */ +int tty = 0; + /* If non-NULL, the name of an editor to fallback to if the server is not running. --alternate-editor. */ const char *alternate_editor = NULL; @@ -140,6 +156,8 @@ struct option longopts[] = { "eval", no_argument, NULL, 'e' }, { "help", no_argument, NULL, 'H' }, { "version", no_argument, NULL, 'V' }, + { "tty", no_argument, NULL, 't' }, + { "create-frame", no_argument, NULL, 'c' }, { "alternate-editor", required_argument, NULL, 'a' }, #ifndef NO_SOCKETS_IN_FILE_SYSTEM { "socket-name", required_argument, NULL, 's' }, @@ -149,6 +167,130 @@ struct option longopts[] = { 0, 0, 0, 0 } }; + +/* Like malloc but get fatal error if memory is exhausted. */ + +long * +xmalloc (size) + unsigned int size; +{ + long *result = (long *) malloc (size); + if (result == NULL) + { + perror ("malloc"); + exit (EXIT_FAILURE); + } + return result; +} + +/* Like strdup but get a fatal error if memory is exhausted. */ + +char * +xstrdup (const char *s) +{ + char *result = strdup (s); + if (result == NULL) + { + perror ("strdup"); + exit (EXIT_FAILURE); + } + return result; +} + +/* From sysdep.c */ +#if !defined (HAVE_GET_CURRENT_DIR_NAME) || defined (BROKEN_GET_CURRENT_DIR_NAME) + +/* From lisp.h */ +#ifndef DIRECTORY_SEP +#define DIRECTORY_SEP '/' +#endif +#ifndef IS_DIRECTORY_SEP +#define IS_DIRECTORY_SEP(_c_) ((_c_) == DIRECTORY_SEP) +#endif +#ifndef IS_DEVICE_SEP +#ifndef DEVICE_SEP +#define IS_DEVICE_SEP(_c_) 0 +#else +#define IS_DEVICE_SEP(_c_) ((_c_) == DEVICE_SEP) +#endif +#endif +#ifndef IS_ANY_SEP +#define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_)) +#endif + + +/* Return the current working directory. Returns NULL on errors. + Any other returned value must be freed with free. This is used + only when get_current_dir_name is not defined on the system. */ +char* +get_current_dir_name () +{ + char *buf; + char *pwd; + struct stat dotstat, pwdstat; + /* If PWD is accurate, use it instead of calling getwd. PWD is + sometimes a nicer name, and using it may avoid a fatal error if a + parent directory is searchable but not readable. */ + if ((pwd = getenv ("PWD")) != 0 + && (IS_DIRECTORY_SEP (*pwd) || (*pwd && IS_DEVICE_SEP (pwd[1]))) + && stat (pwd, &pwdstat) == 0 + && stat (".", &dotstat) == 0 + && dotstat.st_ino == pwdstat.st_ino + && dotstat.st_dev == pwdstat.st_dev +#ifdef MAXPATHLEN + && strlen (pwd) < MAXPATHLEN +#endif + ) + { + buf = (char *) xmalloc (strlen (pwd) + 1); + if (!buf) + return NULL; + strcpy (buf, pwd); + } +#ifdef HAVE_GETCWD + else + { + size_t buf_size = 1024; + buf = (char *) xmalloc (buf_size); + if (!buf) + return NULL; + for (;;) + { + if (getcwd (buf, buf_size) == buf) + break; + if (errno != ERANGE) + { + int tmp_errno = errno; + free (buf); + errno = tmp_errno; + return NULL; + } + buf_size *= 2; + buf = (char *) realloc (buf, buf_size); + if (!buf) + return NULL; + } + } +#else + else + { + /* We need MAXPATHLEN here. */ + buf = (char *) xmalloc (MAXPATHLEN + 1); + if (!buf) + return NULL; + if (getwd (buf) == NULL) + { + int tmp_errno = errno; + free (buf); + errno = tmp_errno; + return NULL; + } + } +#endif + return buf; +} +#endif + /* Message functions. */ #ifdef WINDOWSNT @@ -159,13 +301,51 @@ w32_window_app () char szTitle[MAX_PATH]; if (window_app < 0) - /* Checking for STDOUT does not work; it's a valid handle also in - nonconsole apps. Testing for the console title seems to work. */ - window_app = (GetConsoleTitleA (szTitle, MAX_PATH) == 0); + { + /* Checking for STDOUT does not work; it's a valid handle also in + nonconsole apps. Testing for the console title seems to work. */ + window_app = (GetConsoleTitleA (szTitle, MAX_PATH) == 0); + if (window_app) + InitCommonControls(); + } return window_app; } -#endif + +/* + execvp wrapper for Windows. Quotes arguments with embedded spaces. + + This is necessary due to the broken implementation of exec* routines in + the Microsoft libraries: they concatenate the arguments together without + quoting special characters, and pass the result to CreateProcess, with + predictably bad results. By contrast, Posix execvp passes the arguments + directly into the argv array of the child process. +*/ +int +w32_execvp (path, argv) + char *path; + char **argv; +{ + int i; + + /* Required to allow a .BAT script as alternate editor. */ + argv[0] = (char *) alternate_editor; + + for (i = 0; argv[i]; i++) + if (strchr (argv[i], ' ')) + { + char *quoted = alloca (strlen (argv[i]) + 3); + sprintf (quoted, "\"%s\"", argv[i]); + argv[i] = quoted; + } + + return execvp (path, argv); +} + +#undef execvp +#define execvp w32_execvp + +#endif /* WINDOWSNT */ void message (int is_error, char *message, ...) @@ -204,16 +384,19 @@ decode_options (argc, argv) char **argv; { alternate_editor = getenv ("ALTERNATE_EDITOR"); + display = getenv ("DISPLAY"); + if (display && strlen (display) == 0) + display = NULL; while (1) { int opt = getopt_long (argc, argv, #ifndef NO_SOCKETS_IN_FILE_SYSTEM - "VHnea:s:f:d:", + "VHnea:s:f:d:tc", #else - "VHnea:f:d:", + "VHnea:f:d:tc", #endif - longopts, 0); + longopts, 0); if (opt == EOF) break; @@ -256,6 +439,15 @@ decode_options (argc, argv) exit (EXIT_SUCCESS); break; + case 't': + tty = 1; + current_frame = 0; + break; + + case 'c': + current_frame = 0; + break; + case 'H': print_help_and_exit (); break; @@ -266,21 +458,49 @@ decode_options (argc, argv) break; } } + + if (!tty && display) + window_system = 1; +#if !defined (WINDOWSNT) && !defined (HAVE_CARBON) + else + tty = 1; +#endif + + /* --no-wait implies --current-frame on ttys when there are file + arguments or expressions given. */ + if (nowait && tty && argc - optind > 0) + current_frame = 1; + + if (current_frame) + { + tty = 0; + window_system = 0; + } + + if (tty) + window_system = 0; } + void print_help_and_exit () { + /* Spaces and tabs are significant in this message; they're chosen so the + message aligns properly both in a tty and in a Windows message box. + Please try to preserve them; otherwise the output is very hard to read + when using emacsclientw. */ message (FALSE, - "Usage: %s [OPTIONS] FILE...\n\ + "Usage: %s [OPTIONS] FILE...\n\ Tell the Emacs server to visit the specified files.\n\ Every FILE can be either just a FILENAME or [+LINE[:COLUMN]] FILENAME.\n\ \n\ The following OPTIONS are accepted:\n\ -\n\ -V, --version Just print version info and return\n\ --H, --help Print this usage information message\n\ --e, --eval Evaluate FILE arguments as Lisp expressions\n\ +-H, --help Print this usage information message\n\ +-t, --tty Open a new Emacs frame on the current terminal\n\ +-c, --create-frame Create a new frame instead of trying to\n\ + use the current Emacs frame\n\ +-e, --eval Evaluate the FILE arguments as ELisp expressions\n\ -n, --no-wait Don't wait for the server to return\n\ -d, --display=DISPLAY Visit the file in the given display\n" #ifndef NO_SOCKETS_IN_FILE_SYSTEM @@ -290,66 +510,27 @@ The following OPTIONS are accepted:\n\ "-f, --server-file=FILENAME\n\ Set filename of the TCP authentication file\n\ -a, --alternate-editor=EDITOR\n\ - Editor to fallback to if server is not running\n\ + Editor to fallback to if the server is not running\n\ \n\ Report bugs to bug-gnu-emacs@gnu.org.\n", progname); exit (EXIT_SUCCESS); } - -#ifdef WINDOWSNT - -/* - execvp wrapper for Windows. Quotes arguments with embedded spaces. - - This is necessary due to the broken implementation of exec* routines in - the Microsoft libraries: they concatenate the arguments together without - quoting special characters, and pass the result to CreateProcess, with - predictably bad results. By contrast, Posix execvp passes the arguments - directly into the argv array of the child process. -*/ -int -w32_execvp (path, argv) - char *path; - char **argv; -{ - int i; - - /* Required to allow a .BAT script as alternate editor. */ - argv[0] = (char *) alternate_editor; - - for (i = 0; argv[i]; i++) - if (strchr (argv[i], ' ')) - { - char *quoted = alloca (strlen (argv[i]) + 3); - sprintf (quoted, "\"%s\"", argv[i]); - argv[i] = quoted; - } - - return execvp (path, argv); -} - -#undef execvp -#define execvp w32_execvp - -#endif /* WINDOWSNT */ - /* Try to run a different command, or --if no alternate editor is defined-- exit with an errorcode. + Uses argv, but gets it from the global variable main_argv. */ void -fail (argc, argv) - int argc; - char **argv; +fail (void) { if (alternate_editor) { int i = optind - 1; - execvp (alternate_editor, argv + i); + execvp (alternate_editor, main_argv + i); message (TRUE, "%s: error executing alternate editor \"%s\"\n", - progname, alternate_editor); + progname, alternate_editor); } exit (EXIT_FAILURE); } @@ -362,10 +543,12 @@ main (argc, argv) int argc; char **argv; { - message (TRUE, "%s: Sorry, the Emacs server is supported only\non systems with Berkely sockets.\n", + main_argv = argv; + progname = argv[0]; + message (TRUE, "%s: Sorry, the Emacs server is supported only\n" + "on systems with Berkeley sockets.\n", argv[0]); - - fail (argc, argv); + fail (); } #else /* HAVE_SOCKETS && HAVE_INET_SOCKETS */ @@ -376,8 +559,6 @@ main (argc, argv) # include <sys/types.h> # include <sys/socket.h> # include <sys/un.h> -# include <sys/stat.h> -# include <errno.h> #endif #define AUTH_KEY_LENGTH 64 @@ -389,6 +570,8 @@ extern int errno; /* Buffer to accumulate data to send in TCP connections. */ char send_buffer[SEND_BUFFER_SIZE + 1]; int sblen = 0; /* Fill pointer for the send buffer. */ +/* Socket used to communicate with the Emacs server process. */ +HSOCKET emacs_socket = 0; /* Let's send the data to Emacs when either - the data ends in "\n", or @@ -429,18 +612,21 @@ send_to_emacs (s, data) } } -/* In NAME, insert a & before each &, each space, each newline, and + +/* In STR, insert a & before each &, each space, each newline, and any initial -. Change spaces to underscores, too, so that the - return value never contains a space. */ + return value never contains a space. + + Does not change the string. Outputs the result to STREAM. */ void -quote_file_name (s, name) +quote_argument (s, str) HSOCKET s; - char *name; + char *str; { - char *copy = (char *) malloc (strlen (name) * 2 + 1); + char *copy = (char *) xmalloc (strlen (str) * 2 + 1); char *p, *q; - p = name; + p = str; q = copy; while (*p) { @@ -458,18 +644,54 @@ quote_file_name (s, name) } else { - if (*p == '&' || (*p == '-' && p == name)) + if (*p == '&' || (*p == '-' && p == str)) *q++ = '&'; *q++ = *p++; } } *q++ = 0; - SEND_STRING (copy); + send_to_emacs (s, copy); free (copy); } + +/* The inverse of quote_argument. Removes quoting in string STR by + modifying the string in place. Returns STR. */ + +char * +unquote_argument (str) + char *str; +{ + char *p, *q; + + if (! str) + return str; + + p = str; + q = str; + while (*p) + { + if (*p == '&') + { + p++; + if (*p == '&') + *p = '&'; + else if (*p == '_') + *p = ' '; + else if (*p == 'n') + *p = '\n'; + else if (*p == '-') + *p = '-'; + } + *q++ = *p++; + } + *q = 0; + return str; +} + + int file_name_absolute_p (filename) const unsigned char *filename; @@ -551,6 +773,7 @@ initialize_sockets () atexit (close_winsock); } #endif /* WINDOWSNT */ + /* * Read the information needed to set up a TCP comm channel with @@ -661,13 +884,22 @@ set_tcp_socket () */ auth_string[AUTH_KEY_LENGTH] = '\0'; - SEND_STRING ("-auth "); - SEND_STRING (auth_string); - SEND_STRING ("\n"); + send_to_emacs (s, "-auth "); + send_to_emacs (s, auth_string); + send_to_emacs (s, "\n"); return s; } + +/* Returns 1 if PREFIX is a prefix of STRING. */ +static int +strprefix (char *prefix, char *string) +{ + return !strncmp (prefix, string, strlen (prefix)); +} + + #if !defined (NO_SOCKETS_IN_FILE_SYSTEM) /* Three possibilities: @@ -690,6 +922,93 @@ socket_status (socket_name) return 0; } + +/* A signal handler that passes the signal to the Emacs process. + Useful for SIGWINCH. */ + +SIGTYPE +pass_signal_to_emacs (int signalnum) +{ + int old_errno = errno; + + if (emacs_pid) + kill (emacs_pid, signalnum); + + signal (signalnum, pass_signal_to_emacs); + errno = old_errno; +} + +/* Signal handler for SIGCONT; notify the Emacs process that it can + now resume our tty frame. */ + +SIGTYPE +handle_sigcont (int signalnum) +{ + int old_errno = errno; + + if (tcgetpgrp (1) == getpgrp ()) + { + /* We are in the foreground. */ + send_to_emacs (emacs_socket, "-resume \n"); + } + else + { + /* We are in the background; cancel the continue. */ + kill (getpid (), SIGSTOP); + } + + signal (signalnum, handle_sigcont); + errno = old_errno; +} + +/* Signal handler for SIGTSTP; notify the Emacs process that we are + going to sleep. Normally the suspend is initiated by Emacs via + server-handle-suspend-tty, but if the server gets out of sync with + reality, we may get a SIGTSTP on C-z. Handling this signal and + notifying Emacs about it should get things under control again. */ + +SIGTYPE +handle_sigtstp (int signalnum) +{ + int old_errno = errno; + sigset_t set; + + if (emacs_socket) + send_to_emacs (emacs_socket, "-suspend \n"); + + /* Unblock this signal and call the default handler by temprarily + changing the handler and resignalling. */ + sigprocmask (SIG_BLOCK, NULL, &set); + sigdelset (&set, signalnum); + signal (signalnum, SIG_DFL); + kill (getpid (), signalnum); + sigprocmask (SIG_SETMASK, &set, NULL); /* Let's the above signal through. */ + signal (signalnum, handle_sigtstp); + + errno = old_errno; +} +/* Set up signal handlers before opening a frame on the current tty. */ + +void +init_signals (void) +{ + /* Set up signal handlers. */ + signal (SIGWINCH, pass_signal_to_emacs); + + /* Don't pass SIGINT and SIGQUIT to Emacs, because it has no way of + deciding which terminal the signal came from. C-g is now a + normal input event on secondary terminals. */ +#if 0 + signal (SIGINT, pass_signal_to_emacs); + signal (SIGQUIT, pass_signal_to_emacs); +#endif + + signal (SIGCONT, handle_sigcont); + signal (SIGTSTP, handle_sigtstp); + signal (SIGTTOU, handle_sigtstp); +} + + HSOCKET set_local_socket () { @@ -711,30 +1030,30 @@ set_local_socket () { int sock_status = 0; int default_sock = !socket_name; - int saved_errno; + int saved_errno = 0; char *server_name = "server"; if (socket_name && !index (socket_name, '/') && !index (socket_name, '\\')) { /* socket_name is a file name component. */ - server_name = socket_name; - socket_name = NULL; - default_sock = 1; /* Try both UIDs. */ + server_name = socket_name; + socket_name = NULL; + default_sock = 1; /* Try both UIDs. */ } if (default_sock) { - socket_name = alloca (100 + strlen (server_name)); - sprintf (socket_name, "/tmp/emacs%d/%s", - (int) geteuid (), server_name); + socket_name = alloca (100 + strlen (server_name)); + sprintf (socket_name, "/tmp/emacs%d/%s", + (int) geteuid (), server_name); } if (strlen (socket_name) < sizeof (server.sun_path)) strcpy (server.sun_path, socket_name); else { - message (TRUE, "%s: socket-name %s too long", - progname, socket_name); - exit (EXIT_FAILURE); + message (TRUE, "%s: socket-name %s too long", + progname, socket_name); + fail (); } /* See if the socket exists, and if it's owned by us. */ @@ -773,7 +1092,7 @@ set_local_socket () } sock_status = socket_status (server.sun_path); - saved_errno = errno; + saved_errno = errno; } else errno = saved_errno; @@ -783,26 +1102,26 @@ set_local_socket () switch (sock_status) { case 1: - /* There's a socket, but it isn't owned by us. This is OK if - we are root. */ - if (0 != geteuid ()) - { - message (TRUE, "%s: Invalid socket owner\n", progname); + /* There's a socket, but it isn't owned by us. This is OK if + we are root. */ + if (0 != geteuid ()) + { + message (TRUE, "%s: Invalid socket owner\n", progname); return INVALID_SOCKET; - } - break; + } + break; case 2: - /* `stat' failed */ - if (saved_errno == ENOENT) - message (TRUE, - "%s: can't find socket; have you started the server?\n\ + /* `stat' failed */ + if (saved_errno == ENOENT) + message (TRUE, + "%s: can't find socket; have you started the server?\n\ To start the server in Emacs, type \"M-x server-start\".\n", progname); - else - message (TRUE, "%s: can't stat %s: %s\n", + else + message (TRUE, "%s: can't stat %s: %s\n", progname, server.sun_path, strerror (saved_errno)); - return INVALID_SOCKET; + return INVALID_SOCKET; } } @@ -830,10 +1149,9 @@ set_socket () { s = set_local_socket (); if ((s != INVALID_SOCKET) || alternate_editor) - return s; - + return s; message (TRUE, "%s: error accessing socket \"%s\"", - progname, socket_name); + progname, socket_name); exit (EXIT_FAILURE); } #endif @@ -846,10 +1164,10 @@ set_socket () { s = set_tcp_socket (); if ((s != INVALID_SOCKET) || alternate_editor) - return s; + return s; message (TRUE, "%s: error accessing server file \"%s\"", - progname, server_file); + progname, server_file); exit (EXIT_FAILURE); } @@ -938,129 +1256,264 @@ main (argc, argv) int argc; char **argv; { - HSOCKET s; int i, rl, needlf = 0; - char *cwd; + char *cwd, *str; char string[BUFSIZ+1]; + main_argv = argv; progname = argv[0]; /* Process options. */ decode_options (argc, argv); - if ((argc - optind < 1) && !eval) + if ((argc - optind < 1) && !eval && !tty && !window_system) { - message (TRUE, "%s: file name or argument required\nTry `%s --help' for more information\n", - progname, progname); + message (TRUE, "%s: file name or argument required\n" + "Try `%s --help' for more information\n", + progname, progname); exit (EXIT_FAILURE); } - if ((s = set_socket ()) == INVALID_SOCKET) - fail (argc, argv); + if ((emacs_socket = set_socket ()) == INVALID_SOCKET) + fail (); -#ifdef HAVE_GETCWD - cwd = getcwd (string, sizeof string); -#else - cwd = getwd (string); -#endif + + cwd = get_current_dir_name (); if (cwd == 0) { /* getwd puts message in STRING if it fails. */ - message (TRUE, "%s: %s (%s)\n", progname, -#ifdef HAVE_GETCWD - "Cannot get current working directory", -#else - string, -#endif - strerror (errno)); - fail (argc, argv); + message (TRUE, "%s: %s\n", progname, + "Cannot get current working directory"); + fail (); } #ifdef WINDOWSNT w32_give_focus (); #endif + /* Send over our environment. */ + if (!current_frame) + { + extern char **environ; + int i; + for (i = 0; environ[i]; i++) + { + char *name = xstrdup (environ[i]); + char *value = strchr (name, '='); + send_to_emacs (emacs_socket, "-env "); + quote_argument (emacs_socket, environ[i]); + send_to_emacs (emacs_socket, " "); + } + } + + /* Send over our current directory. */ + if (!current_frame) + { + send_to_emacs (emacs_socket, "-dir "); + quote_argument (emacs_socket, cwd); + send_to_emacs (emacs_socket, "/"); + send_to_emacs (emacs_socket, " "); + } + + retry: if (nowait) - SEND_STRING ("-nowait "); + send_to_emacs (emacs_socket, "-nowait "); - if (eval) - SEND_STRING ("-eval "); + if (current_frame) + send_to_emacs (emacs_socket, "-current-frame "); if (display) { - SEND_STRING ("-display "); - SEND_QUOTED (display); - SEND_STRING (" "); + send_to_emacs (emacs_socket, "-display "); + quote_argument (emacs_socket, display); + send_to_emacs (emacs_socket, " "); } + if (tty) + { + char *type = getenv ("TERM"); + char *tty_name = NULL; +#ifndef WINDOWSNT + tty_name = ttyname (fileno (stdin)); +#endif + + if (! tty_name) + { + message (TRUE, "%s: could not get terminal name\n", progname); + fail (); + } + + if (! type) + { + message (TRUE, "%s: please set the TERM variable to your terminal type\n", + progname); + fail (); + } + + if (! strcmp (type, "eterm")) + { + /* This causes nasty, MULTI_KBOARD-related input lockouts. */ + message (TRUE, "%s: opening a frame in an Emacs term buffer" + " is not supported\n", progname); + fail (); + } +#if !defined (NO_SOCKETS_IN_FILE_SYSTEM) + init_signals (); +#endif + + send_to_emacs (emacs_socket, "-tty "); + quote_argument (emacs_socket, tty_name); + send_to_emacs (emacs_socket, " "); + quote_argument (emacs_socket, type); + send_to_emacs (emacs_socket, " "); + } + + if (window_system) + send_to_emacs (emacs_socket, "-window-system "); + if ((argc - optind > 0)) { for (i = optind; i < argc; i++) { + int relative = 0; + if (eval) - ; /* Don't prepend any cwd or anything like that. */ - else if (*argv[i] == '+') - { + { + /* Don't prepend cwd or anything like that. */ + send_to_emacs (emacs_socket, "-eval "); + quote_argument (emacs_socket, argv[i]); + send_to_emacs (emacs_socket, " "); + continue; + } + + if (*argv[i] == '+') + { char *p = argv[i] + 1; while (isdigit ((unsigned char) *p) || *p == ':') p++; - if (*p != 0) - { - SEND_QUOTED (cwd); - SEND_STRING ("/"); - } - } + if (*p == 0) + { + send_to_emacs (emacs_socket, "-position "); + quote_argument (emacs_socket, argv[i]); + send_to_emacs (emacs_socket, " "); + continue; + } + else + relative = 1; + } else if (! file_name_absolute_p (argv[i])) - { - SEND_QUOTED (cwd); - SEND_STRING ("/"); - } - - SEND_QUOTED (argv[i]); - SEND_STRING (" "); - } + relative = 1; + + send_to_emacs (emacs_socket, "-file "); + if (relative) + { + quote_argument (emacs_socket, cwd); + send_to_emacs (emacs_socket, "/"); + } + quote_argument (emacs_socket, argv[i]); + send_to_emacs (emacs_socket, " "); + } } else { - while (fgets (string, BUFSIZ, stdin)) - { - SEND_QUOTED (string); - } - SEND_STRING (" "); + if (!tty && !window_system) + { + while ((str = fgets (string, BUFSIZ, stdin))) + { + if (eval) + send_to_emacs (emacs_socket, "-eval "); + else + send_to_emacs (emacs_socket, "-file "); + quote_argument (emacs_socket, str); + } + send_to_emacs (emacs_socket, " "); + } } - SEND_STRING ("\n"); + send_to_emacs (emacs_socket, "\n"); + + /* Wait for an answer. */ + if (!eval && !tty && !nowait) + { + printf ("Waiting for Emacs..."); + needlf = 2; + } + fflush (stdout); + fsync (1); - /* Maybe wait for an answer. */ - if (!nowait) + /* Now, wait for an answer and print any messages. */ + while ((rl = recv (emacs_socket, string, BUFSIZ, 0)) > 0) { - if (!eval) + char *p; + string[rl] = '\0'; + + p = string + strlen (string) - 1; + while (p > string && *p == '\n') + *p-- = 0; + + if (strprefix ("-emacs-pid ", string)) { - printf ("Waiting for Emacs..."); - needlf = 2; + /* -emacs-pid PID: The process id of the Emacs process. */ + emacs_pid = strtol (string + strlen ("-emacs-pid"), NULL, 10); } - fflush (stdout); - - /* Now, wait for an answer and print any messages. */ - while ((rl = recv (s, string, BUFSIZ, 0)) > 0) + else if (strprefix ("-window-system-unsupported ", string)) { - string[rl] = '\0'; - if (needlf == 2) + /* -window-system-unsupported: Emacs was compiled without X + support. Try again on the terminal. */ + window_system = 0; + nowait = 0; + tty = 1; + goto retry; + } + else if (strprefix ("-print ", string)) + { + /* -print STRING: Print STRING on the terminal. */ + str = unquote_argument (string + strlen ("-print ")); + if (needlf) printf ("\n"); - printf ("%s", string); - needlf = string[0] == '\0' ? needlf : string[strlen (string) - 1] != '\n'; + printf ("%s", str); + needlf = str[0] == '\0' ? needlf : str[strlen (str) - 1] != '\n'; + } + else if (strprefix ("-error ", string)) + { + /* -error DESCRIPTION: Signal an error on the terminal. */ + str = unquote_argument (string + strlen ("-error ")); + if (needlf) + printf ("\n"); + fprintf (stderr, "*ERROR*: %s", str); + needlf = str[0] == '\0' ? needlf : str[strlen (str) - 1] != '\n'; + } +#ifdef SIGSTOP + else if (strprefix ("-suspend ", string)) + { + /* -suspend: Suspend this terminal, i.e., stop the process. */ + if (needlf) + printf ("\n"); + needlf = 0; + kill (0, SIGSTOP); + } +#endif + else + { + /* Unknown command. */ + if (needlf) + printf ("\n"); + printf ("*ERROR*: Unknown message: %s", string); + needlf = string[0] == '\0' ? needlf : string[strlen (string) - 1] != '\n'; } - - if (needlf) - printf ("\n"); - fflush (stdout); } - CLOSE_SOCKET (s); + if (needlf) + printf ("\n"); + fflush (stdout); + fsync (1); + + CLOSE_SOCKET (emacs_socket); return EXIT_SUCCESS; } #endif /* HAVE_SOCKETS && HAVE_INET_SOCKETS */ + #ifndef HAVE_STRERROR char * strerror (errnum) diff --git a/lib-src/emacstool.c b/lib-src/emacstool.c deleted file mode 100644 index 7b39d2ed8fd..00000000000 --- a/lib-src/emacstool.c +++ /dev/null @@ -1,504 +0,0 @@ -/* - Copyright (C) 1986, 1988, 1990, 1991, 2001, 2002, 2003, 2004, - 2005, 2006, 2007 Free Software Foundation, Inc. - -This file is part of GNU Emacs. - -GNU Emacs is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3, or (at your option) -any later version. - -GNU Emacs is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Emacs; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ - -/* - * For Emacs in SunView/Sun-Windows: (supported by Sun Unix v3.2 or greater) - * Insert a notifier filter-function to convert all useful input - * to "key" sequences that emacs can understand. See: Emacstool(1). - * - * Author: Jeff Peck, Sun Microsystems, Inc. <peck@eng.sun.com> - * - * Original Idea: Ian Batten - * Updated 15-Mar-88, Jeff Peck: set IN_EMACSTOOL, TERM, TERMCAP - * Updated 10-Sep-88, Jeff Peck: add XVIEW and JLE support - * Updated 8-Oct-90, Jeff Peck: add Meta-bit for Xview - * Updated 6-Mar-91, Jeff Peck: Hack to detect -Wt invocation - * [note, TTYSW limitation means you must Click-To-Type in Openwin] - * [fixed in OW3 or use local/tty.o] - * for better results, this should move to using TERMSW. - * Updated 10-Mar-91, Jeff Peck, et al: support for TERMSW (TTERM) - * allows point-to-type even in OW2 - * - * [note: xvetool should be started with the "-nw" flag for emacs!] - */ - -#ifdef XVIEW -#include <xview/xview.h> -#include <xview/panel.h> -#include <xview/attr.h> -#include <xview/tty.h> -#include <xview/ttysw.h> /* private defines */ -#include <xview/termsw.h> /* -DTTERM */ -#include <xview/font.h> /* for testing */ -#else -#include <suntool/sunview.h> -#include <suntool/tty.h> -#include <suntool/ttysw.h> -#endif XVIEW - -#ifdef JLE -# include <locale.h> -#endif JLE - -#include <stdio.h> -#include <sys/file.h> - -#define BUFFER_SIZE 128 /* Size of all the buffers */ - -/* define WANT_CAPS_LOCK to make f-key T1 (aka F1) behave as CapsLock */ -#define WANT_CAPS_LOCK -#ifdef WANT_CAPS_LOCK -int caps_lock; /* toggle indicator for f-key T1 caps lock */ -static char *Caps = "[CAPS] "; /* Caps Lock prefix string */ -#define CAPS_LEN 7 /* strlen (Caps) */ -#endif - -static char *mouse_prefix = "\030\000"; /* C-x C-@ */ -static int m_prefix_length = 2; /* mouse_prefix length */ - -static char *key_prefix = "\030*"; /* C-x * */ -static int k_prefix_length = 2; /* key_prefix length */ - -#ifdef JLE -static char *emacs_name = "nemacs"; /* default run command */ -static char *title = "NEmacstool - "; /* initial title */ -#else -static char *emacs_name = "emacs"; /* default run command */ -static char *title = "Emacstool - "; /* initial title */ -#endif JLE - -static char buffer[BUFFER_SIZE]; /* send to ttysw_input */ -static char *bold_name = 0; /* for -bold option */ - -Frame frame; /* Base frame for system */ - -#ifndef TTERM -#define SWTYPE TTY -Tty tty_win; /* Where emacs is reading */ -#else -#define SWTYPE TERMSW -Termsw tty_win; /* Termsw does follow-mouse */ -#endif TTERM - -#ifdef XVIEW -Xv_Window tty_view; /* Where the events are in Xview*/ -#else -Tty tty_view; /* SunView place filler */ -#endif XVIEW - -int font_width, font_height; /* For translating pixels to chars */ -int left_margin = 0; /* default window -- frame offset */ - -int console_fd = 0; /* for debugging: setenv DEBUGEMACSTOOL */ -FILE *console; /* for debugging: setenv DEBUGEMACSTOOL */ - -Icon frame_icon; -/* make an icon_image for the default frame_icon */ -static short default_image[258] = -{ -#include <images/terminal.icon> -}; -mpr_static(icon_image, 64, 64, 1, default_image); - -/* - * Assign a value to a set of keys - */ -int -button_value (event) - Event *event; -{ - int retval = 0; - /* - * Code up the current situation: - * - * 1 = MS_LEFT; - * 2 = MS_MIDDLE; - * 4 = MS_RIGHT; - * 8 = SHIFT; - * 16 = CONTROL; - * 32 = META; - * 64 = DOUBLE; - * 128 = UP; - */ - - if (MS_LEFT == (event_id (event))) retval = 1; - if (MS_MIDDLE == (event_id (event))) retval = 2; - if (MS_RIGHT == (event_id (event))) retval = 4; - - if (event_shift_is_down (event)) retval += 8; - if (event_ctrl_is_down (event)) retval += 16; - if (event_meta_is_down (event)) retval += 32; - if (event_is_up (event)) retval += 128; - return retval; -} - -/* - * Variables to store the time of the previous mouse event that was - * sent to emacs. - * - * The theory is that to time double clicks while ignoring UP buttons, - * we must keep track of the accumulated time. - * - * If someone writes a SUN-SET-INPUT-MASK for emacstool, - * That could be used to selectively disable UP events, - * and then this cruft wouldn't be necessary. - */ -static long prev_event_sec = 0; -static long prev_event_usec = 0; - -/* - * Give the time difference in milliseconds, where one second - * is considered infinite. - */ -int -time_delta (now_sec, now_usec, prev_sec, prev_usec) - long now_sec, now_usec, prev_sec, prev_usec; -{ - long sec_delta = now_sec - prev_sec; - long usec_delta = now_usec - prev_usec; - - if (usec_delta < 0) { /* "borrow" a second */ - usec_delta += 1000000; - --sec_delta; - } - - if (sec_delta >= 10) - return (9999); /* Infinity */ - else - return ((sec_delta * 1000) + (usec_delta / 1000)); -} - - -/* - * Filter function to translate selected input events for emacs - * Mouse button events become ^X^@(button x-col y-line time-delta) . - * Function keys: ESC-*{c}{lrt} l,r,t for Left, Right, Top; - * {c} encodes the keynumber as a character [a-o] - */ -static Notify_value -input_event_filter_function (window, event, arg, type) -#ifdef XVIEW - Xv_Window window; -#else - Window window; -#endif XVIEW - Event *event; - Notify_arg arg; - Notify_event_type type; -{ - struct timeval time_stamp; - - if (console_fd) fprintf(console, "Event: %d\n", event_id(event)); - - /* UP L1 is the STOP key */ - if (event_id(event) == WIN_STOP) { - ttysw_input(tty_win, "\007\007\007\007\007\007\007", 7); - return NOTIFY_IGNORED; - } - - /* UP L5 & L7 is Expose & Open, let them pass to sunview */ - if (event_id(event) == KEY_LEFT(5) || event_id(event) == KEY_LEFT(7)) - if(event_is_up (event)) - return notify_next_event_func (window, event, arg, type); - else return NOTIFY_IGNORED; - - if (event_is_button (event)) { /* do Mouse Button events */ -/* Commented out so that we send mouse up events too. - if (event_is_up (event)) - return notify_next_event_func (window, event, arg, type); -*/ - time_stamp = event_time (event); - ttysw_input (tty_win, mouse_prefix, m_prefix_length); - sprintf (buffer, "(%d %d %d %d)\015", - button_value (event), - (event_x (event) - left_margin) / font_width, - event_y (event) / font_height, - time_delta (time_stamp.tv_sec, time_stamp.tv_usec, - prev_event_sec, prev_event_usec) - ); - ttysw_input (tty_win, buffer, strlen(buffer)); - prev_event_sec = time_stamp.tv_sec; - prev_event_usec = time_stamp.tv_usec; - return NOTIFY_IGNORED; - } - - { /* Do the function key events */ - int d; - char c = (char) 0; - if ((event_is_key_left (event)) ? - ((d = event_id(event) - KEY_LEFT(1) + 'a'), c='l') : - ((event_is_key_right (event)) ? - ((d = event_id(event) - KEY_RIGHT(1) + 'a'), c='r') : - ((event_is_key_top (event)) ? - ((d = event_id(event) - KEY_TOP(1) + 'a'), c='t') : 0))) - { - if (event_is_up(event)) return NOTIFY_IGNORED; - if (event_shift_is_down (event)) c = c - 32; - /* this will give a non-{lrt} for unshifted keys */ - if (event_ctrl_is_down (event)) c = c - 64; - if (event_meta_is_down (event)) c = c + 128; -#ifdef WANT_CAPS_LOCK -/* set a toggle and relabel window so T1 can act like caps-lock */ - if (event_id(event) == KEY_TOP(1)) - { - /* make a frame label with and without CAPS */ - strcpy (buffer, Caps); - title = &buffer[CAPS_LEN]; - strncpy (title, (char *)window_get (frame, FRAME_LABEL), - BUFFER_SIZE - CAPS_LEN); - buffer[BUFFER_SIZE] = (char) 0; - if (strncmp (title, Caps, CAPS_LEN) == 0) - title += CAPS_LEN; /* already Caps */ - caps_lock = (caps_lock ? 0 : CAPS_LEN); - window_set(frame, FRAME_LABEL, (title -= caps_lock), 0); - return NOTIFY_IGNORED; - } -#endif - ttysw_input (tty_win, key_prefix, k_prefix_length); - sprintf (buffer, "%c%c", d, c); - ttysw_input(tty_win, buffer, strlen(buffer)); - - return NOTIFY_IGNORED; - } - } - if ((event_is_ascii(event) || event_is_meta(event)) - && event_is_up(event)) return NOTIFY_IGNORED; -#ifdef WANT_CAPS_LOCK -/* shift alpha chars to upper case if toggle is set */ - if ((caps_lock) && event_is_ascii(event) - && (event_id(event) >= 'a') && (event_id(event) <= 'z')) - event_set_id(event, (event_id(event) - 32)); -/* crufty, but it works for now. is there an UPCASE(event)? */ -#endif -#ifndef NO_META_BIT -/* under Openwindows/X, the meta bit is not set in the key event, - * emacs expects this so we add it in here: - */ - if (event_is_ascii(event) && event_meta_is_down(event)) - event_set_id(event, 128 | event_id(event)); -#endif - return notify_next_event_func (window, event, arg, type); -} - -main (argc, argv) - int argc; - char **argv; -{ - int error_code; /* Error codes */ - -#ifdef JLE - setlocale(LC_ALL, ""); -#endif JLE - - if(getenv("DEBUGEMACSTOOL")) - console = fdopen (console_fd = open("/dev/console",O_WRONLY), "w"); - - putenv("IN_EMACSTOOL=t"); /* notify subprocess that it is in emacstool */ - - if (putenv("TERM=sun") != 0) /* TTY_WIN will be a TERM=sun window */ - {fprintf (stderr, "%s: Could not set TERM=sun, using `%s'\n", - argv[0], (char *)getenv("TERM")) ;}; - /* - * If TERMCAP starts with a slash, it is the pathname of the - * termcap file, not an entry extracted from it, so KEEP it! - * Otherwise, it may not relate to the new TERM, so Nuke-It. - * If there is no TERMCAP environment variable, don't make one. - */ - { - char *termcap ; /* Current TERMCAP value */ - termcap = (char *)getenv("TERMCAP") ; - if (termcap && (*termcap != '/')) - { - if (putenv("TERMCAP=") != 0) - {fprintf (stderr, "%s: Could not clear TERMCAP\n", argv[0]) ;} ; - } ; - } ; - - /* find command to run as subprocess in window */ - if (!(argv[0] = (char *)getenv("EMACSTOOL"))) /* Set emacs command name */ - argv[0] = emacs_name; - /* Emacstool recognizes two special args: -rc <file> and -bold <bold-name> */ - for (argc = 1; argv[argc]; argc++) /* Use last one on line */ - { - if(!(strcmp ("-rc", argv[argc]))) /* Override if -rc given */ - {int i = argc; - argv[argc--]=0; /* kill the -rc argument */ - if (argv[i+1]) { /* move to argv[0] and squeeze the rest */ - argv[0]=argv[i+1]; - for (; argv[i+2]; (argv[i]=argv[i+2],argv[++i]=0)); - } - } - - if (!(strcmp ("-bold", argv[argc]))) - {int i = argc; - argv[argc--]=0; /* kill the -bold argument */ - if (argv[i+1]) { /* move to bold_name and squeeze the rest */ - bold_name = argv[i+1]; - for (; argv[i+2]; (argv[i]=argv[i+2],argv[++i]=0)); - } - } - }; - - strcpy (buffer, title); - strncat (buffer, argv[0], /* append run command name */ - (BUFFER_SIZE - (strlen (buffer)) - (strlen (argv[0]))) - 1); - - error_code = interpose_on_window(argc,argv); - if (error_code != 0) { /* Barf */ - fprintf (stderr, "notify_interpose_event_func returns %d.\n", error_code); - exit (1); - } - -#ifdef XVIEW - xv_main_loop (frame); /* And away we go */ -#else - window_main_loop (frame); -#endif XVIEW -} - -#ifdef XVIEW -int interpose_on_window(argc,argv) - int argc; - char **argv; -{ -#ifndef TTERM - int i, font_width_adjust = 1; /* hackery, and heuristics */ - /* if -Wt is not supplied, then font comes out as lucida-14 (width=8) - * rather than the screen.r.12 (width=7) typically used - * this hack attempts to workaround it. - * could use a env var EMACSTOOL_DEFAULT_FONT_WIDTH instead */ - for (i = 1; argv[i]; i++) { - if (!(strcmp ("-Wt", argv[i]))) - {font_width_adjust = 0; - if (console_fd) fprintf(console, "-Wt = %d\n", font_width_adjust); - break;} - } -#endif TTERM - /* initialize Xview, and strip window args */ - xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv, 0); - - /* do this first, so arglist can override it */ - frame_icon = icon_create (ICON_LABEL, "Emacstool", - ICON_IMAGE, &icon_image, - 0); - - /* Build a frame to run in */ - frame = xv_create ((Xv_Window)NULL, FRAME, - FRAME_LABEL, buffer, - FRAME_ICON, frame_icon, - 0); - - /* Create a tty with emacs in it */ - tty_win = xv_create (frame, SWTYPE, WIN_IS_CLIENT_PANE, - TTY_QUIT_ON_CHILD_DEATH, TRUE, - TTY_BOLDSTYLE, TTYSW_BOLD_INVERT, - TTY_ARGV, argv, - 0); - - if (bold_name) { - (void)xv_set(tty_win, TTY_BOLDSTYLE_NAME, bold_name, 0); - } - - { - Xv_font font; /* declare temp font variable */ - font = (Xv_font)xv_get (tty_win, XV_FONT); - font_height = (int)xv_get (font, FONT_DEFAULT_CHAR_HEIGHT); - font_width = (int)xv_get (font, FONT_DEFAULT_CHAR_WIDTH); - } - if (console_fd) fprintf(console, "Width = %d\n", font_width); - -#ifndef TTERM - font_width -= font_width_adjust; /* A guess! font bug in ttysw*/ -#else - /* make the termsw act as a tty */ - xv_set(tty_win, TERMSW_MODE, TTYSW_MODE_TYPE, 0); - /* termsw has variable offset depending on scrollbar size/location */ - left_margin = (int)xv_get (tty_win, TEXTSW_LEFT_MARGIN); -#endif TTERM - - tty_view = (Xv_Window) xv_get (tty_win, OPENWIN_NTH_VIEW, 0); - xv_set(tty_view, - WIN_CONSUME_EVENTS, - WIN_MOUSE_BUTTONS, WIN_UP_EVENTS, - ACTION_ADJUST, ACTION_MENU, - WIN_ASCII_EVENTS, - WIN_LEFT_KEYS, WIN_TOP_KEYS, WIN_RIGHT_KEYS, - 0, - 0); - /* Interpose my event function */ - return (int) notify_interpose_event_func - (tty_view, input_event_filter_function, NOTIFY_SAFE); -} -#else -int interpose_on_window (argc, argv) - int argc; - char **argv; -{ - /* do this first, so arglist can override it */ - frame_icon = icon_create (ICON_LABEL, "Emacstool", - ICON_IMAGE, &icon_image, - 0); - - /* Build a frame to run in */ - frame = window_create ((Window)NULL, FRAME, - FRAME_LABEL, buffer, - FRAME_ICON, frame_icon, - FRAME_ARGC_PTR_ARGV, &argc, argv, - 0); - - /* Create a tty with emacs in it */ - tty_win = window_create (frame, TTY, - TTY_QUIT_ON_CHILD_DEATH, TRUE, - TTY_BOLDSTYLE, TTYSW_BOLD_INVERT, - TTY_ARGV, argv, - 0); - - if (bold_name) { - (void)window_set(tty_win, TTY_BOLDSTYLE_NAME, bold_name, 0); - } - - /* ttysw uses pf_default, one must set WIN_FONT explicitly */ - window_set (tty_win, WIN_FONT, pf_default(), 0); - font_height = (int)window_get (tty_win, WIN_ROW_HEIGHT); - font_width = (int)window_get (tty_win, WIN_COLUMN_WIDTH); - - tty_view = tty_win; - window_set(tty_view, - WIN_CONSUME_PICK_EVENTS, - WIN_STOP, - WIN_MOUSE_BUTTONS, WIN_UP_EVENTS, - /* LOC_WINENTER, LOC_WINEXIT, LOC_MOVE, */ - 0, - WIN_CONSUME_KBD_EVENTS, - WIN_STOP, - WIN_ASCII_EVENTS, - WIN_LEFT_KEYS, WIN_TOP_KEYS, WIN_RIGHT_KEYS, - /* WIN_UP_ASCII_EVENTS, */ - 0, - 0); - /* Interpose my event function */ - return (int) notify_interpose_event_func - (tty_view, input_event_filter_function, NOTIFY_SAFE); -} -#endif XVIEW - -/* arch-tag: 7a2e7105-c059-418a-b3d9-5b5de96abb4e - (do not change this comment) */ diff --git a/lib-src/makefile.w32-in b/lib-src/makefile.w32-in index 03ef92f023d..65ad9b08011 100644 --- a/lib-src/makefile.w32-in +++ b/lib-src/makefile.w32-in @@ -24,7 +24,7 @@ ALL = make-docfile hexl ctags etags movemail ebrowse sorted-doc digest-doc emacs .PHONY: $(ALL) -VERSION = 22.1.50 +VERSION = 23.0.50 LOCAL_FLAGS = -DWINDOWSNT -DDOS_NT -DSTDC_HEADERS=1 -DNO_LDAV=1 \ -DNO_ARCHIVES=1 -DHAVE_CONFIG_H=1 -I../nt/inc \ @@ -82,11 +82,11 @@ $(TRES): ../nt/emacs.rc $(BLD)/emacsclient.exe: $(ECLIENTOBJS) # put wsock32.lib before $(LIBS) to ensure we don't link to ws2_32.lib - $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(ECLIENTOBJS) $(WSOCK32) $(USER32) $(LIBS) + $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(ECLIENTOBJS) $(WSOCK32) $(USER32) $(COMCTL32) $(LIBS) $(BLD)/emacsclientw.exe: $(ECLIENTOBJS) $(TRES) # put wsock32.lib before $(LIBS) to ensure we don't link to ws2_32.lib - $(LINK) $(LINK_OUT)$@ $(TRES) -mwindows $(LINK_FLAGS) $(ECLIENTOBJS) $(WSOCK32) $(USER32) $(LIBS) + $(LINK) $(LINK_OUT)$@ $(TRES) -mwindows $(LINK_FLAGS) $(ECLIENTOBJS) $(WSOCK32) $(USER32) $(COMCTL32) $(LIBS) # emacsclient.$(O) depends on makefile.w32-in because makefile.w32-in # can be edited to define VERSION string, which is part of ECLIENT_CFLAGS. diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el index ab8f743eb34..0aa053702b8 100644 --- a/lisp/calc/calc-ext.el +++ b/lisp/calc/calc-ext.el @@ -618,15 +618,15 @@ (calc-init-prefixes) - (mapcar (function - (lambda (x) - (define-key calc-mode-map (format "c%c" x) 'calc-clean-num) - (define-key calc-mode-map (format "j%c" x) 'calc-select-part) - (define-key calc-mode-map (format "r%c" x) 'calc-recall-quick) - (define-key calc-mode-map (format "s%c" x) 'calc-store-quick) - (define-key calc-mode-map (format "t%c" x) 'calc-store-into-quick) - (define-key calc-mode-map (format "u%c" x) 'calc-quick-units))) - "0123456789") + (mapc (function + (lambda (x) + (define-key calc-mode-map (format "c%c" x) 'calc-clean-num) + (define-key calc-mode-map (format "j%c" x) 'calc-select-part) + (define-key calc-mode-map (format "r%c" x) 'calc-recall-quick) + (define-key calc-mode-map (format "s%c" x) 'calc-store-quick) + (define-key calc-mode-map (format "t%c" x) 'calc-store-into-quick) + (define-key calc-mode-map (format "u%c" x) 'calc-quick-units))) + "0123456789") (let ((i ?A)) (while (<= i ?z) @@ -635,7 +635,7 @@ (cons 'keymap (cons (cons ?\e (aref (nth 1 calc-mode-map) i)) (cdr (aref (nth 1 calc-mode-map) i)))))) (setq i (1+ i)))) - + (setq calc-alg-map (copy-keymap calc-mode-map) calc-alg-esc-map (copy-keymap esc-map)) (let ((i 32)) @@ -651,7 +651,7 @@ (define-key calc-alg-map "\e\177" 'calc-pop-above) ;;;; (Autoloads here) - (mapcar (function (lambda (x) + (mapc (function (lambda (x) (mapcar (function (lambda (func) (autoload func (car x)))) (cdr x)))) '( @@ -1021,7 +1021,7 @@ calc-arctan calc-arctan2 calc-arctanh calc-conj calc-cos calc-cosh calc-cot calc-coth calc-csc calc-csch calc-degrees-mode calc-exp calc-expm1 calc-hypot calc-ilog calc-imaginary calc-isqrt calc-ln calc-lnp1 calc-log calc-log10 -calc-pi calc-radians-mode calc-sec calc-sech +calc-pi calc-radians-mode calc-sec calc-sech calc-sin calc-sincos calc-sinh calc-sqrt calc-tan calc-tanh calc-to-degrees calc-to-radians) @@ -1277,7 +1277,7 @@ calc-kill calc-kill-region calc-yank)))) calc-redo-list nil) (let (calc-stack calc-user-parse-tables calc-standard-date-formats calc-invocation-macro) - (mapcar (function (lambda (v) (set v nil))) calc-local-var-list) + (mapc (function (lambda (v) (set v nil))) calc-local-var-list) (if (and arg (<= arg 0)) (calc-mode-var-list-restore-default-values) (calc-mode-var-list-restore-saved-values))) @@ -1357,7 +1357,7 @@ calc-kill calc-kill-region calc-yank)))) (with-current-buffer calc-main-buffer calc-hyperbolic-flag) calc-hyperbolic-flag)) - (msg (if hyp-flag + (msg (if hyp-flag "Inverse Hyperbolic..." "Inverse..."))) (calc-fancy-prefix 'calc-inverse-flag msg n))) @@ -1438,7 +1438,7 @@ calc-kill calc-kill-region calc-yank)))) (with-current-buffer calc-main-buffer calc-inverse-flag) calc-inverse-flag)) - (msg (if inv-flag + (msg (if inv-flag "Inverse Hyperbolic..." "Hyperbolic..."))) (calc-fancy-prefix 'calc-hyperbolic-flag msg n))) @@ -1849,7 +1849,7 @@ calc-kill calc-kill-region calc-yank)))) (setq calc-z-prefix-buf (concat (if (= flags 1) "SHIFT + " "") desc)) (if (> (+ (length calc-z-prefix-buf) (length desc)) 58) - (setq calc-z-prefix-msgs + (setq calc-z-prefix-msgs (cons calc-z-prefix-buf calc-z-prefix-msgs) calc-z-prefix-buf (concat (if (= flags 1) "SHIFT + " "") desc)) @@ -1879,14 +1879,14 @@ calc-kill calc-kill-region calc-yank)))) (last-val (intern (concat (symbol-name name) "-last")))) (list 'progn ; (list 'defvar cache-prec (if init (math-numdigs (nth 1 init)) -100)) - (list 'defvar cache-prec + (list 'defvar cache-prec `(cond ((consp ,init) (math-numdigs (nth 1 ,init))) - (,init + (,init (nth 1 (math-numdigs (eval ,init)))) (t -100))) - (list 'defvar cache-val + (list 'defvar cache-val `(cond ((consp ,init) ,init) (,init (eval ,init)) @@ -1963,7 +1963,7 @@ calc-kill calc-kill-region calc-yank)))) (defconst math-approx-sqrt-e (math-read-number-simple "1.648721270700128146849") "An approximation for sqrt(3).") - + (math-defcache math-sqrt-e math-approx-sqrt-e (math-add-float '(float 1 0) (math-exp-minus-1-raw '(float 5 -1)))) @@ -1975,11 +1975,11 @@ calc-kill calc-kill-region calc-yank)))) '(float 5 -1))) (defconst math-approx-gamma-const - (math-read-number-simple + (math-read-number-simple "0.5772156649015328606065120900824024310421593359399235988057672348848677267776646709369470632917467495") "An approximation for gamma.") -(math-defcache math-gamma-const nil +(math-defcache math-gamma-const nil math-approx-gamma-const) (defun math-half-circle (symb) @@ -2148,12 +2148,12 @@ calc-kill calc-kill-region calc-yank)))) (unless a (setq a 1)) (and - (not (memq nil (mapcar + (not (memq nil (mapcar (lambda (x) (eq x 0)) (nthcdr (1+ n) row)))) - (not (memq nil (mapcar + (not (memq nil (mapcar (lambda (x) (eq x 0)) - (butlast + (butlast (cdr row) (- (length row) n))))) (eq (elt row n) a))) @@ -2218,7 +2218,7 @@ If X is not an error form, return X." (if (eq (car-safe x) 'sdev) (nth 1 x) x)) - + (defun math-get-sdev (x &optional one) "Get the standard deviation of the error form X. If X is not an error form, return 1." @@ -2331,15 +2331,15 @@ If X is not an error form, return 1." (and (symbolp (car math-normalize-a)) (or (eq calc-simplify-mode 'none) (and (eq calc-simplify-mode 'num) - (let ((aptr (setq math-normalize-a + (let ((aptr (setq math-normalize-a (cons (car math-normalize-a) - (mapcar 'math-normalize + (mapcar 'math-normalize (cdr math-normalize-a)))))) (while (and aptr (math-constp (car aptr))) (setq aptr (cdr aptr))) aptr))) - (cons (car math-normalize-a) + (cons (car math-normalize-a) (mapcar 'math-normalize (cdr math-normalize-a)))))) @@ -2720,8 +2720,8 @@ If X is not an error form, return 1." (setq mmt-nextval (funcall math-mt-func mmt-expr)) (not (equal mmt-expr mmt-nextval))) (setq mmt-expr mmt-nextval - math-mt-many (if (> math-mt-many 0) - (1- math-mt-many) + math-mt-many (if (> math-mt-many 0) + (1- math-mt-many) (1+ math-mt-many)))) (if (or (Math-primp mmt-expr) (<= math-mt-many 0)) @@ -3046,10 +3046,10 @@ If X is not an error form, return 1." math-read-big-baseline math-read-big-h2 new-pos p) (while (setq new-pos (string-match "\n" str pos)) - (setq math-read-big-lines + (setq math-read-big-lines (cons (substring str pos new-pos) math-read-big-lines) pos (1+ new-pos))) - (setq math-read-big-lines + (setq math-read-big-lines (nreverse (cons (substring str pos) math-read-big-lines)) p math-read-big-lines) (while p diff --git a/lisp/calc/calc-help.el b/lisp/calc/calc-help.el index 871f281aa5e..ed1c93e8694 100644 --- a/lisp/calc/calc-help.el +++ b/lisp/calc/calc-help.el @@ -321,11 +321,11 @@ C-w Describe how there is no warranty for Calc." (defun calc-describe-function (&optional func) (interactive) (unless calc-help-function-list - (setq calc-help-function-list + (setq calc-help-function-list (calc-help-index-entries "Function" "Command"))) (or func (setq func (completing-read "Describe function: " - calc-help-function-list + calc-help-function-list nil t))) (if (string-match "\\`calc-." func) (calc-describe-thing func "Command Index") @@ -334,7 +334,7 @@ C-w Describe how there is no warranty for Calc." (defun calc-describe-variable (&optional var) (interactive) (unless calc-help-variable-list - (setq calc-help-variable-list + (setq calc-help-variable-list (calc-help-index-entries "Variable"))) (or var (setq var (completing-read "Describe variable: " @@ -419,49 +419,49 @@ C-w Describe how there is no warranty for Calc." (princ "Or type `h i' to read the full Calc manual on-line.\n\n") (princ "Basic keys:\n") (let* ((calc-full-help-flag t)) - (mapcar (function (lambda (x) (princ (format " %s\n" x)))) - (nreverse (cdr (reverse (cdr (calc-help)))))) - (mapcar (function (lambda (prefix) - (let ((msgs (condition-case err - (funcall prefix) - (error nil)))) - (if (car msgs) - (princ - (if (eq (nth 2 msgs) ?v) - "\n`v' or `V' prefix (vector/matrix) keys: \n" - (if (nth 2 msgs) - (format - "\n`%c' prefix (%s) keys:\n" - (nth 2 msgs) - (or (cdr (assq (nth 2 msgs) - calc-help-long-names)) - (nth 1 msgs))) - (format "\n%s-modified keys:\n" - (capitalize (nth 1 msgs))))))) - (mapcar (function (lambda (x) - (princ (format " %s\n" x)))) - (car msgs))))) - '(calc-inverse-prefix-help - calc-hyperbolic-prefix-help - calc-inv-hyp-prefix-help - calc-a-prefix-help - calc-b-prefix-help - calc-c-prefix-help - calc-d-prefix-help - calc-f-prefix-help - calc-g-prefix-help - calc-h-prefix-help - calc-j-prefix-help - calc-k-prefix-help - calc-m-prefix-help - calc-r-prefix-help - calc-s-prefix-help - calc-t-prefix-help - calc-u-prefix-help - calc-v-prefix-help - calc-shift-Y-prefix-help - calc-shift-Z-prefix-help - calc-z-prefix-help))) + (mapc (function (lambda (x) (princ (format " %s\n" x)))) + (nreverse (cdr (reverse (cdr (calc-help)))))) + (mapc (function (lambda (prefix) + (let ((msgs (condition-case err + (funcall prefix) + (error nil)))) + (if (car msgs) + (princ + (if (eq (nth 2 msgs) ?v) + "\n`v' or `V' prefix (vector/matrix) keys: \n" + (if (nth 2 msgs) + (format + "\n`%c' prefix (%s) keys:\n" + (nth 2 msgs) + (or (cdr (assq (nth 2 msgs) + calc-help-long-names)) + (nth 1 msgs))) + (format "\n%s-modified keys:\n" + (capitalize (nth 1 msgs))))))) + (mapcar (function (lambda (x) + (princ (format " %s\n" x)))) + (car msgs))))) + '(calc-inverse-prefix-help + calc-hyperbolic-prefix-help + calc-inv-hyp-prefix-help + calc-a-prefix-help + calc-b-prefix-help + calc-c-prefix-help + calc-d-prefix-help + calc-f-prefix-help + calc-g-prefix-help + calc-h-prefix-help + calc-j-prefix-help + calc-k-prefix-help + calc-m-prefix-help + calc-r-prefix-help + calc-s-prefix-help + calc-t-prefix-help + calc-u-prefix-help + calc-v-prefix-help + calc-shift-Y-prefix-help + calc-shift-Z-prefix-help + calc-z-prefix-help))) (print-help-return-message))) (defun calc-h-prefix-help () diff --git a/lisp/calc/calc-math.el b/lisp/calc/calc-math.el index 3e4743d58ae..3a2319e9a2c 100644 --- a/lisp/calc/calc-math.el +++ b/lisp/calc/calc-math.el @@ -53,28 +53,41 @@ ;;; is an Emacs float, for acceptable d.dddd.... (defvar math-largest-emacs-expt - (let ((x 1)) - (while (condition-case nil - (expt 10.0 x) - (error nil)) - (setq x (* 2 x))) - (setq x (/ x 2)) - (while (condition-case nil - (expt 10.0 x) - (error nil)) - (setq x (1+ x))) - (- x 2)) + (let ((x 1) + (pow 1e2)) + ;; The following loop is for efficiency; it should stop when + ;; 10^(2x) is too large. This could be indicated by a range + ;; error when computing 10^(2x) or an infinite value for 10^(2x). + (while (and + pow + (< pow 1.0e+INF)) + (setq x (* 2 x)) + (setq pow (condition-case nil + (expt 10.0 (* 2 x)) + (error nil)))) + ;; The following loop should stop when 10^(x+1) is too large. + (setq pow (condition-case nil + (expt 10.0 (1+ x)) + (error nil))) + (while (and + pow + (< pow 1.0e+INF)) + (setq x (1+ x)) + (setq pow (condition-case nil + (expt 10.0 (1+ x)) + (error nil)))) + (1- x)) "The largest exponent which Calc will convert to an Emacs float.") (defvar math-smallest-emacs-expt (let ((x -1)) (while (condition-case nil - (expt 10.0 x) + (> (expt 10.0 x) 0.0) (error nil)) (setq x (* 2 x))) (setq x (/ x 2)) (while (condition-case nil - (expt 10.0 x) + (> (expt 10.0 x) 0.0) (error nil)) (setq x (1- x))) (+ x 2)) diff --git a/lisp/calc/calc-misc.el b/lisp/calc/calc-misc.el index 10222fc1625..b660e046a21 100644 --- a/lisp/calc/calc-misc.el +++ b/lisp/calc/calc-misc.el @@ -145,9 +145,9 @@ Calc user interface as before (either C-x * C or C-x * K; initially C-x * C). "Create another, independent Calculator buffer." (interactive) (if (eq major-mode 'calc-mode) - (mapcar (function - (lambda (v) - (set-default v (symbol-value v)))) calc-local-var-list)) + (mapc (function + (lambda (v) + (set-default v (symbol-value v)))) calc-local-var-list)) (set-buffer (generate-new-buffer "*Calculator*")) (pop-to-buffer (current-buffer)) (calc-mode)) diff --git a/lisp/calc/calc-store.el b/lisp/calc/calc-store.el index 75a17661746..e439150814a 100644 --- a/lisp/calc/calc-store.el +++ b/lisp/calc/calc-store.el @@ -127,7 +127,7 @@ (cond ((and (memq var '(var-e var-i var-pi var-phi var-gamma)) (eq (car-safe old) 'special-const)) - (setq msg (format " (Note: Built-in definition of %s has been lost)" + (setq msg (format " (Note: Built-in definition of %s has been lost)" (calc-var-name var)))) ((and (memq var '(var-inf var-uinf var-nan)) (null old)) @@ -172,28 +172,28 @@ () (setq calc-var-name-map (copy-keymap minibuffer-local-completion-map)) (define-key calc-var-name-map " " 'self-insert-command) - (mapcar (function - (lambda (x) - (define-key calc-var-name-map (char-to-string x) - 'calcVar-digit))) - "0123456789") - (mapcar (function - (lambda (x) - (define-key calc-var-name-map (char-to-string x) - 'calcVar-oper))) - "+-*/^|")) + (mapc (function + (lambda (x) + (define-key calc-var-name-map (char-to-string x) + 'calcVar-digit))) + "0123456789") + (mapc (function + (lambda (x) + (define-key calc-var-name-map (char-to-string x) + 'calcVar-oper))) + "+-*/^|")) (defvar calc-store-opers) (defun calc-read-var-name (prompt &optional calc-store-opers) (setq calc-given-value nil calc-aborted-prefix nil) - (let ((var (concat + (let ((var (concat "var-" (let ((minibuffer-completion-table - (mapcar (lambda (x) (substring x 4)) + (mapcar (lambda (x) (substring x 4)) (all-completions "var-" obarray))) - (minibuffer-completion-predicate + (minibuffer-completion-predicate (lambda (x) (boundp (intern (concat "var-" x))))) (minibuffer-completion-confirm t)) (read-from-minibuffer prompt nil calc-var-name-map nil))))) @@ -401,7 +401,7 @@ (unless (string= sconst "") (let ((value (cdr (assoc sconst sc)))) (or var (setq var (calc-read-var-name - (format "Copy special constant %s, to: " + (format "Copy special constant %s, to: " sconst)))) (if var (let ((msg (calc-store-value var value ""))) @@ -417,7 +417,7 @@ (or value (error "No such variable: \"%s\"" (calc-var-name var1))) (or var2 (setq var2 (calc-read-var-name - (format "Copy variable: %s, to: " + (format "Copy variable: %s, to: " (calc-var-name var1))))) (if var2 (let ((msg (calc-store-value var2 value ""))) diff --git a/lisp/calc/calc-stuff.el b/lisp/calc/calc-stuff.el index a1f50816519..5dcc5365d10 100644 --- a/lisp/calc/calc-stuff.el +++ b/lisp/calc/calc-stuff.el @@ -191,7 +191,7 @@ With a prefix, push that prefix as a number onto the stack." math-eval-rules-cache-tag t math-format-date-cache nil math-holidays-cache-tag t) - (mapcar (function (lambda (x) (set x -100))) math-cache-list) + (mapc (function (lambda (x) (set x -100))) math-cache-list) (unless inhibit-msg (message "All internal calculator caches have been reset")))) diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el index 3724490169a..839bac77581 100644 --- a/lisp/calc/calc-units.el +++ b/lisp/calc/calc-units.el @@ -54,7 +54,7 @@ ( ft "12 in" "Foot" ) ( yd "3 ft" "Yard" ) ( mi "5280 ft" "Mile" ) - ( au "149597870691. m" "Astronomical Unit" ) + ( au "149597870691. m" "Astronomical Unit" ) ;; (approx) NASA JPL (http://neo.jpl.nasa.gov/glossary/au.html) ( lyr "c yr" "Light Year" ) ( pc "3.0856775854e16 m" "Parsec" ) ;; (approx) ESUWM @@ -91,7 +91,7 @@ ( tbsp "3 tsp" "Tablespoon" ) ;; ESUWM defines a US gallon as 231 in^3. ;; That gives the following exact value for tsp. - ( tsp "492892159375*10^(-11) ml" "Teaspoon" ) + ( tsp "492892159375*10^(-11) ml" "Teaspoon" ) ( vol "tsp+tbsp+ozfl+cup+pt+qt+gal" "Gallons + ... + teaspoons" ) ( galC "galUK" "Canadian Gallon" ) ( galUK "454609*10^(-5) L" "UK Gallon" ) ;; NIST @@ -342,13 +342,13 @@ Entries are (SYMBOL EXPR DOC-STRING TEMP-TYPE BASE-UNITS).") If EXPR is nil, return nil." (if expr (let ((cexpr (math-compose-expr expr 0))) - (replace-regexp-in-string + (replace-regexp-in-string " / " "/" (if (stringp cexpr) cexpr (math-composition-to-string cexpr)))))) -(defvar math-default-units-table +(defvar math-default-units-table (make-hash-table :test 'equal) "A table storing previously converted units.") @@ -356,7 +356,7 @@ If EXPR is nil, return nil." "Get default units to use when converting the units in EXPR." (let* ((units (math-get-units expr)) (standard-units (math-get-standard-units expr)) - (default-units (gethash + (default-units (gethash standard-units math-default-units-table))) (if (equal units (car default-units)) @@ -403,7 +403,7 @@ If EXPR is nil, return nil." (setq expr (math-mul expr uold)))) (unless new-units (setq defunits (math-get-default-units expr)) - (setq new-units + (setq new-units (read-string (concat (if uoldname (concat "Old units: " @@ -412,11 +412,11 @@ If EXPR is nil, return nil." "New units") (if defunits (concat - " (default: " + " (default " defunits "): ") ": ")))) - + (if (and (string= new-units "") defunits) @@ -476,7 +476,7 @@ If EXPR is nil, return nil." (setq defunits (math-get-default-units expr)) (setq unew (or new-units (math-read-expr - (read-string + (read-string (concat (if uoldname (concat "Old temperature units: " @@ -484,7 +484,7 @@ If EXPR is nil, return nil." ", new units") "New temperature units") (if defunits - (concat " (default: " + (concat " (default " defunits "): ") ": ")))))) @@ -507,7 +507,7 @@ If EXPR is nil, return nil." (calc-enter-result 1 "rmun" (math-simplify-units (math-extract-units (calc-top-n 1)))))) -;; The variables calc-num-units and calc-den-units are local to +;; The variables calc-num-units and calc-den-units are local to ;; calc-explain-units, but are used by calc-explain-units-rec, ;; which is called by calc-explain-units. (defvar calc-num-units) @@ -752,7 +752,7 @@ If EXPR is nil, return nil." (list (cons (car x) 1)))))) combined-units)) (let ((math-units-table tab)) - (mapcar 'math-find-base-units tab)) + (mapc 'math-find-base-units tab)) (message "Building units table...done") (setq math-units-table tab)))) @@ -794,7 +794,7 @@ If EXPR is nil, return nil." (old (assq (car (car ulist)) math-fbu-base))) (if old (setcdr old (+ (cdr old) p)) - (setq math-fbu-base + (setq math-fbu-base (cons (cons (car (car ulist)) p) math-fbu-base)))) (setq ulist (cdr ulist))))) ((math-scalarp expr)) @@ -988,8 +988,8 @@ If EXPR is nil, return nil." (if (equal (nth 4 math-fcu-u) (nth 4 u2)) (cons expr pow)))))) -;; The variables math-cu-new-units and math-cu-pure are local to -;; math-convert-units, but are used by math-convert-units-rec, +;; The variables math-cu-new-units and math-cu-pure are local to +;; math-convert-units, but are used by math-convert-units-rec, ;; which is called by math-convert-units. (defvar math-cu-new-units) (defvar math-cu-pure) @@ -1001,7 +1001,7 @@ If EXPR is nil, return nil." (if (eq (car-safe (nth 1 unew)) '+) (setq math-cu-new-units (nth 1 unew))))) (math-with-extra-prec 2 - (let ((compat (and (not math-cu-pure) + (let ((compat (and (not math-cu-pure) (math-find-compatible-unit expr math-cu-new-units))) (math-cu-unit-list nil) (math-combining-units nil)) @@ -1028,7 +1028,7 @@ If EXPR is nil, return nil." (defun math-convert-units-rec (expr) (if (math-units-in-expr-p expr nil) - (math-apply-units (math-to-standard-units + (math-apply-units (math-to-standard-units (list '/ expr math-cu-new-units) nil) math-cu-new-units math-cu-unit-list math-cu-pure) (if (Math-primp expr) @@ -1093,7 +1093,7 @@ If EXPR is nil, return nil." (calc-record-why "*Inconsistent units" math-simplify-expr) math-simplify-expr) (list '* (math-add (math-remove-units (nth 1 math-simplify-expr)) - (if (eq (car math-simplify-expr) '-) + (if (eq (car math-simplify-expr) '-) (math-neg ratio) ratio)) units))))) @@ -1187,7 +1187,7 @@ If EXPR is nil, return nil." (math-simplify-units-divisor np (cdr (cdr math-simplify-expr))) (if (eq math-try-cancel-units 0) (let* ((math-simplifying-units nil) - (base (math-simplify + (base (math-simplify (math-to-standard-units math-simplify-expr nil)))) (if (Math-numberp base) (setq math-simplify-expr base)))) @@ -1243,11 +1243,11 @@ If EXPR is nil, return nil." (math-realp (nth 2 math-simplify-expr)) (if (memq (car-safe (nth 1 math-simplify-expr)) '(* /)) (list (car (nth 1 math-simplify-expr)) - (list '^ (nth 1 (nth 1 math-simplify-expr)) + (list '^ (nth 1 (nth 1 math-simplify-expr)) (nth 2 math-simplify-expr)) - (list '^ (nth 2 (nth 1 math-simplify-expr)) + (list '^ (nth 2 (nth 1 math-simplify-expr)) (nth 2 math-simplify-expr))) - (math-simplify-units-pow (nth 1 math-simplify-expr) + (math-simplify-units-pow (nth 1 math-simplify-expr) (nth 2 math-simplify-expr))))) (math-defsimplify calcFunc-sqrt diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index 8e416293a45..913b02e003f 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -213,7 +213,7 @@ :group 'applications) ;;;###autoload -(defcustom calc-settings-file +(defcustom calc-settings-file (convert-standard-filename "~/.calc.el") "*File in which to record permanent settings." :group 'calc @@ -233,10 +233,10 @@ (texinfo-mode . calc-normal-language)) "*Alist of major modes with appropriate Calc languages." :group 'calc - :type '(alist :key-type (symbol :tag "Major mode") + :type '(alist :key-type (symbol :tag "Major mode") :value-type (symbol :tag "Calc language"))) -(defcustom calc-embedded-announce-formula +(defcustom calc-embedded-announce-formula "%Embed\n\\(% .*\n\\)*" "*A regular expression which is sure to be followed by a calc-embedded formula." :group 'calc @@ -259,13 +259,13 @@ :type '(alist :key-type (symbol :tag "Major mode") :value-type (regexp :tag "Regexp to announce formula"))) -(defcustom calc-embedded-open-formula +(defcustom calc-embedded-open-formula "\\`\\|^\n\\|\\$\\$?\\|\\\\\\[\\|^\\\\begin[^{].*\n\\|^\\\\begin{.*[^x]}.*\n\\|^@.*\n\\|^\\.EQ.*\n\\|\\\\(\\|^%\n\\|^\\.\\\\\"\n" "*A regular expression for the opening delimiter of a formula used by calc-embedded." :group 'calc :type '(regexp)) -(defcustom calc-embedded-close-formula +(defcustom calc-embedded-close-formula "\\'\\|\n$\\|\\$\\$?\\|\\\\]\\|^\\\\end[^{].*\n\\|^\\\\end{.*[^x]}.*\n\\|^@.*\n\\|^\\.EN.*\n\\|\\\\)\\|\n%\n\\|^\\.\\\\\"\n" "*A regular expression for the closing delimiter of a formula used by calc-embedded." :group 'calc @@ -279,13 +279,13 @@ :value-type (list (regexp :tag "Opening formula delimiter") (regexp :tag "Closing formula delimiter")))) -(defcustom calc-embedded-open-word +(defcustom calc-embedded-open-word "^\\|[^-+0-9.eE]" "*A regular expression for the opening delimiter of a formula used by calc-embedded-word." :group 'calc :type '(regexp)) -(defcustom calc-embedded-close-word +(defcustom calc-embedded-close-word "$\\|[^-+0-9.eE]" "*A regular expression for the closing delimiter of a formula used by calc-embedded-word." :group 'calc @@ -299,7 +299,7 @@ :value-type (list (regexp :tag "Opening word delimiter") (regexp :tag "Closing word delimiter")))) -(defcustom calc-embedded-open-plain +(defcustom calc-embedded-open-plain "%%% " "*A string which is the opening delimiter for a \"plain\" formula. If calc-show-plain mode is enabled, this is inserted at the front of @@ -307,7 +307,7 @@ each formula." :group 'calc :type '(string)) -(defcustom calc-embedded-close-plain +(defcustom calc-embedded-close-plain " %%%\n" "*A string which is the closing delimiter for a \"plain\" formula. See calc-embedded-open-plain." @@ -332,13 +332,13 @@ See calc-embedded-open-plain." :value-type (list (string :tag "Opening \"plain\" delimiter") (string :tag "Closing \"plain\" delimiter")))) -(defcustom calc-embedded-open-new-formula +(defcustom calc-embedded-open-new-formula "\n\n" "*A string which is inserted at front of formula by calc-embedded-new-formula." :group 'calc :type '(string)) -(defcustom calc-embedded-close-new-formula +(defcustom calc-embedded-close-new-formula "\n\n" "*A string which is inserted at end of formula by calc-embedded-new-formula." :group 'calc @@ -352,14 +352,14 @@ See calc-embedded-open-plain." :value-type (list (string :tag "Opening new formula delimiter") (string :tag "Closing new formula delimiter")))) -(defcustom calc-embedded-open-mode +(defcustom calc-embedded-open-mode "% " "*A string which should precede calc-embedded mode annotations. This is not required to be present for user-written mode annotations." :group 'calc :type '(string)) -(defcustom calc-embedded-close-mode +(defcustom calc-embedded-close-mode "\n" "*A string which should follow calc-embedded mode annotations. This is not required to be present for user-written mode annotations." @@ -384,19 +384,19 @@ This is not required to be present for user-written mode annotations." :value-type (list (string :tag "Opening annotation delimiter") (string :tag "Closing annotation delimiter")))) -(defcustom calc-gnuplot-name +(defcustom calc-gnuplot-name "gnuplot" "*Name of GNUPLOT program, for calc-graph features." :group 'calc :type '(string)) -(defcustom calc-gnuplot-plot-command +(defcustom calc-gnuplot-plot-command nil "*Name of command for displaying GNUPLOT output; %s = file name to print." :group 'calc :type '(choice (string) (sexp))) -(defcustom calc-gnuplot-print-command +(defcustom calc-gnuplot-print-command "lp %s" "*Name of command for printing GNUPLOT output; %s = file name to print." :group 'calc @@ -520,7 +520,7 @@ This is used only when calc-group-digits mode is on.") (defcalcmodevar calc-point-char "." "The character (in the form of a string) to be used as a decimal point.") - + (defcalcmodevar calc-frac-format '(":" nil) "Format of displayed fractions; a string of one or two of \":\" or \"/\".") @@ -710,9 +710,9 @@ If nil, selections displayed but ignored.") "YYddd< hh:mm:ss>")) (defcalcmodevar calc-autorange-units nil) - + (defcalcmodevar calc-was-keypad-mode nil) - + (defcalcmodevar calc-full-mode nil) (defcalcmodevar calc-user-parse-tables nil) @@ -722,7 +722,7 @@ If nil, selections displayed but ignored.") (defcalcmodevar calc-gnuplot-default-output "STDOUT") (defcalcmodevar calc-gnuplot-print-device "postscript") - + (defcalcmodevar calc-gnuplot-print-output "auto") (defcalcmodevar calc-gnuplot-geometry nil) @@ -730,7 +730,7 @@ If nil, selections displayed but ignored.") (defcalcmodevar calc-graph-default-resolution 15) (defcalcmodevar calc-graph-default-resolution-3d 5) - + (defcalcmodevar calc-invocation-macro nil) (defcalcmodevar calc-show-banner t @@ -926,8 +926,8 @@ If nil, selections displayed but ignored.") (defvar var-gamma '(special-const (math-gamma-const))) (defvar var-Modes '(special-const (math-get-modes-vec))) -(mapcar (lambda (v) (or (boundp v) (set v nil))) - calc-local-var-list) +(mapc (lambda (v) (or (boundp v) (set v nil))) + calc-local-var-list) (defvar calc-mode-map (let ((map (make-keymap))) @@ -983,89 +983,89 @@ If nil, selections displayed but ignored.") (if (eq (aref cmap i) 'undefined) 'undefined 'calcDigit-nondigit)) (setq i (1+ i))))) - (mapcar (lambda (x) (define-key map (char-to-string x) 'calcDigit-key)) - "_0123456789.e+-:n#@oh'\"mspM") - (mapcar (lambda (x) (define-key map (char-to-string x) 'calcDigit-letter)) + (mapc (lambda (x) (define-key map (char-to-string x) 'calcDigit-key)) + "_0123456789.e+-:n#@oh'\"mspM") + (mapc (lambda (x) (define-key map (char-to-string x) 'calcDigit-letter)) "abcdfgijklqrtuvwxyzABCDEFGHIJKLNOPQRSTUVWXYZ") (define-key map "'" 'calcDigit-algebraic) (define-key map "`" 'calcDigit-edit) (define-key map "\C-g" 'abort-recursive-edit) map)) -(mapcar (lambda (x) - (condition-case err - (progn - (define-key calc-digit-map x 'calcDigit-backspace) - (define-key calc-mode-map x 'calc-pop) - (define-key calc-mode-map - (if (vectorp x) - (if calc-emacs-type-lucid - (if (= (length x) 1) - (vector (if (consp (aref x 0)) - (cons 'meta (aref x 0)) - (list 'meta (aref x 0)))) - "\e\C-d") - (vconcat "\e" x)) - (concat "\e" x)) - 'calc-pop-above)) - (error nil))) - (if calc-scan-for-dels - (append (where-is-internal 'delete-backward-char global-map) - (where-is-internal 'backward-delete-char global-map) - '("\C-d")) - '("\177" "\C-d"))) +(mapc (lambda (x) + (condition-case err + (progn + (define-key calc-digit-map x 'calcDigit-backspace) + (define-key calc-mode-map x 'calc-pop) + (define-key calc-mode-map + (if (vectorp x) + (if calc-emacs-type-lucid + (if (= (length x) 1) + (vector (if (consp (aref x 0)) + (cons 'meta (aref x 0)) + (list 'meta (aref x 0)))) + "\e\C-d") + (vconcat "\e" x)) + (concat "\e" x)) + 'calc-pop-above)) + (error nil))) + (if calc-scan-for-dels + (append (where-is-internal 'delete-backward-char global-map) + (where-is-internal 'backward-delete-char global-map) + '("\C-d")) + '("\177" "\C-d"))) (defvar calc-dispatch-map (let ((map (make-keymap))) - (mapcar (lambda (x) - (define-key map (char-to-string (car x)) (cdr x)) - (when (string-match "abcdefhijklnopqrstuwxyz" - (char-to-string (car x))) - (define-key map (char-to-string (- (car x) ?a -1)) (cdr x))) - (define-key map (format "\e%c" (car x)) (cdr x))) - '( ( ?a . calc-embedded-activate ) - ( ?b . calc-big-or-small ) - ( ?c . calc ) - ( ?d . calc-embedded-duplicate ) - ( ?e . calc-embedded ) - ( ?f . calc-embedded-new-formula ) - ( ?g . calc-grab-region ) - ( ?h . calc-dispatch-help ) - ( ?i . calc-info ) - ( ?j . calc-embedded-select ) - ( ?k . calc-keypad ) - ( ?l . calc-load-everything ) - ( ?m . read-kbd-macro ) - ( ?n . calc-embedded-next ) - ( ?o . calc-other-window ) - ( ?p . calc-embedded-previous ) - ( ?q . quick-calc ) - ( ?r . calc-grab-rectangle ) - ( ?s . calc-info-summary ) - ( ?t . calc-tutorial ) - ( ?u . calc-embedded-update-formula ) - ( ?w . calc-embedded-word ) - ( ?x . calc-quit ) - ( ?y . calc-copy-to-buffer ) - ( ?z . calc-user-invocation ) - ( ?\' . calc-embedded-new-formula ) - ( ?\` . calc-embedded-edit ) - ( ?: . calc-grab-sum-down ) - ( ?_ . calc-grab-sum-across ) - ( ?0 . calc-reset ) - ( ?? . calc-dispatch-help ) - ( ?# . calc-same-interface ) - ( ?& . calc-same-interface ) - ( ?\\ . calc-same-interface ) - ( ?= . calc-same-interface ) - ( ?* . calc-same-interface ) - ( ?/ . calc-same-interface ) - ( ?+ . calc-same-interface ) - ( ?- . calc-same-interface ) )) + (mapc (lambda (x) + (define-key map (char-to-string (car x)) (cdr x)) + (when (string-match "abcdefhijklnopqrstuwxyz" + (char-to-string (car x))) + (define-key map (char-to-string (- (car x) ?a -1)) (cdr x))) + (define-key map (format "\e%c" (car x)) (cdr x))) + '( ( ?a . calc-embedded-activate ) + ( ?b . calc-big-or-small ) + ( ?c . calc ) + ( ?d . calc-embedded-duplicate ) + ( ?e . calc-embedded ) + ( ?f . calc-embedded-new-formula ) + ( ?g . calc-grab-region ) + ( ?h . calc-dispatch-help ) + ( ?i . calc-info ) + ( ?j . calc-embedded-select ) + ( ?k . calc-keypad ) + ( ?l . calc-load-everything ) + ( ?m . read-kbd-macro ) + ( ?n . calc-embedded-next ) + ( ?o . calc-other-window ) + ( ?p . calc-embedded-previous ) + ( ?q . quick-calc ) + ( ?r . calc-grab-rectangle ) + ( ?s . calc-info-summary ) + ( ?t . calc-tutorial ) + ( ?u . calc-embedded-update-formula ) + ( ?w . calc-embedded-word ) + ( ?x . calc-quit ) + ( ?y . calc-copy-to-buffer ) + ( ?z . calc-user-invocation ) + ( ?\' . calc-embedded-new-formula ) + ( ?\` . calc-embedded-edit ) + ( ?: . calc-grab-sum-down ) + ( ?_ . calc-grab-sum-across ) + ( ?0 . calc-reset ) + ( ?? . calc-dispatch-help ) + ( ?# . calc-same-interface ) + ( ?& . calc-same-interface ) + ( ?\\ . calc-same-interface ) + ( ?= . calc-same-interface ) + ( ?* . calc-same-interface ) + ( ?/ . calc-same-interface ) + ( ?+ . calc-same-interface ) + ( ?- . calc-same-interface ) )) map)) ;;;; (Autoloads here) -(mapcar +(mapc (lambda (x) (dolist (func (cdr x)) (autoload func (car x)))) '( @@ -1077,7 +1077,7 @@ If nil, selections displayed but ignored.") ("calc-embed" calc-do-embedded-activate) - ("calc-misc" + ("calc-misc" calc-do-handle-whys calc-do-refresh calc-num-prefix-name calc-record-list calc-record-why calc-report-bug calc-roll-down-stack calc-roll-up-stack calc-temp-minibuffer-message calcFunc-floor @@ -1087,7 +1087,7 @@ If nil, selections displayed but ignored.") math-negp math-posp math-pow math-read-radix-digit math-reject-arg math-trunc math-zerop))) -(mapcar +(mapc (lambda (x) (dolist (cmd (cdr x)) (autoload cmd (car x) nil t))) '( @@ -1095,7 +1095,7 @@ If nil, selections displayed but ignored.") calcDigit-algebraic calcDigit-edit) ("calc-misc" another-calc calc-big-or-small calc-dispatch-help - calc-help calc-info calc-info-goto-node calc-info-summary calc-inv + calc-help calc-info calc-info-goto-node calc-info-summary calc-inv calc-last-args-stub calc-missing-key calc-mod calc-other-window calc-over calc-percent calc-pop-above calc-power calc-roll-down calc-roll-up @@ -1193,12 +1193,12 @@ Notations: 3.14e6 3.14 * 10^6 \\{calc-mode-map} " (interactive) - (mapcar (function - (lambda (v) (set-default v (symbol-value v)))) calc-local-var-list) + (mapc (function + (lambda (v) (set-default v (symbol-value v)))) calc-local-var-list) (kill-all-local-variables) (use-local-map (if (eq calc-algebraic-mode 'total) (progn (require 'calc-ext) calc-alg-map) calc-mode-map)) - (mapcar (function (lambda (v) (make-local-variable v))) calc-local-var-list) + (mapc (function (lambda (v) (make-local-variable v))) calc-local-var-list) (make-local-variable 'overlay-arrow-position) (make-local-variable 'overlay-arrow-string) (add-hook 'change-major-mode-hook 'font-lock-defontify nil t) @@ -1375,8 +1375,8 @@ commands given here will actually operate on the *Calculator* stack." (calc-create-buffer)) (run-hooks 'calc-end-hook) (setq calc-undo-list nil calc-redo-list nil) - (mapcar (function (lambda (v) (set-default v (symbol-value v)))) - calc-local-var-list) + (mapc (function (lambda (v) (set-default v (symbol-value v)))) + calc-local-var-list) (let ((buf (current-buffer)) (win (get-buffer-window (current-buffer))) (kbuf (get-buffer "*Calc Keypad*"))) @@ -2284,7 +2284,7 @@ See calc-keypad for details." -(defconst math-bignum-digit-length +(defconst math-bignum-digit-length (truncate (/ (log10 (/ most-positive-fixnum 2)) 2)) "The length of a \"digit\" in Calc bignums. If a big integer is of the form (bigpos N0 N1 ...), this is the @@ -2292,11 +2292,11 @@ length of the allowable Emacs integers N0, N1,... The value of 2*10^(2*MATH-BIGNUM-DIGIT-LENGTH) must be less than the largest Emacs integer.") -(defconst math-bignum-digit-size +(defconst math-bignum-digit-size (expt 10 math-bignum-digit-length) "An upper bound for the size of the \"digit\"s in Calc bignums.") -(defconst math-small-integer-size +(defconst math-small-integer-size (expt math-bignum-digit-size 2) "An upper bound for the size of \"small integer\"s in Calc.") @@ -2307,16 +2307,16 @@ largest Emacs integer.") ;;; following forms: ;;; ;;; integer An integer. For normalized numbers, this format -;;; is used only for +;;; is used only for ;;; negative math-small-integer-size + 1 to ;;; math-small-integer-size - 1 ;;; -;;; (bigpos N0 N1 N2 ...) A big positive integer, -;;; N0 + N1*math-bignum-digit-size +;;; (bigpos N0 N1 N2 ...) A big positive integer, +;;; N0 + N1*math-bignum-digit-size ;;; + N2*(math-bignum-digit-size)^2 ... -;;; (bigneg N0 N1 N2 ...) A big negative integer, +;;; (bigneg N0 N1 N2 ...) A big negative integer, ;;; - N0 - N1*math-bignum-digit-size ... -;;; Each digit N is in the range +;;; Each digit N is in the range ;;; 0 ... math-bignum-digit-size -1. ;;; Normalized, always at least three N present, ;;; and the most significant N is nonzero. @@ -2407,14 +2407,14 @@ largest Emacs integer.") (cond ((not (consp math-normalize-a)) (if (integerp math-normalize-a) - (if (or (>= math-normalize-a math-small-integer-size) + (if (or (>= math-normalize-a math-small-integer-size) (<= math-normalize-a (- math-small-integer-size))) (math-bignum math-normalize-a) math-normalize-a) math-normalize-a)) ((eq (car math-normalize-a) 'bigpos) (if (eq (nth (1- (length math-normalize-a)) math-normalize-a) 0) - (let* ((last (setq math-normalize-a + (let* ((last (setq math-normalize-a (copy-sequence math-normalize-a))) (digs math-normalize-a)) (while (setq digs (cdr digs)) (or (eq (car digs) 0) (setq last digs))) @@ -2422,14 +2422,14 @@ largest Emacs integer.") (if (cdr (cdr (cdr math-normalize-a))) math-normalize-a (cond - ((cdr (cdr math-normalize-a)) (+ (nth 1 math-normalize-a) - (* (nth 2 math-normalize-a) + ((cdr (cdr math-normalize-a)) (+ (nth 1 math-normalize-a) + (* (nth 2 math-normalize-a) math-bignum-digit-size))) ((cdr math-normalize-a) (nth 1 math-normalize-a)) (t 0)))) ((eq (car math-normalize-a) 'bigneg) (if (eq (nth (1- (length math-normalize-a)) math-normalize-a) 0) - (let* ((last (setq math-normalize-a (copy-sequence math-normalize-a))) + (let* ((last (setq math-normalize-a (copy-sequence math-normalize-a))) (digs math-normalize-a)) (while (setq digs (cdr digs)) (or (eq (car digs) 0) (setq last digs))) @@ -2437,21 +2437,21 @@ largest Emacs integer.") (if (cdr (cdr (cdr math-normalize-a))) math-normalize-a (cond - ((cdr (cdr math-normalize-a)) (- (+ (nth 1 math-normalize-a) - (* (nth 2 math-normalize-a) + ((cdr (cdr math-normalize-a)) (- (+ (nth 1 math-normalize-a) + (* (nth 2 math-normalize-a) math-bignum-digit-size)))) ((cdr math-normalize-a) (- (nth 1 math-normalize-a))) (t 0)))) ((eq (car math-normalize-a) 'float) - (math-make-float (math-normalize (nth 1 math-normalize-a)) + (math-make-float (math-normalize (nth 1 math-normalize-a)) (nth 2 math-normalize-a))) - ((or (memq (car math-normalize-a) + ((or (memq (car math-normalize-a) '(frac cplx polar hms date mod sdev intv vec var quote special-const calcFunc-if calcFunc-lambda calcFunc-quote calcFunc-condition calcFunc-evalto)) (integerp (car math-normalize-a)) - (and (consp (car math-normalize-a)) + (and (consp (car math-normalize-a)) (not (eq (car (car math-normalize-a)) 'lambda)))) (require 'calc-ext) (math-normalize-fancy math-normalize-a)) @@ -2461,7 +2461,7 @@ largest Emacs integer.") (math-normalize-nonstandard)) (let ((args (mapcar 'math-normalize (cdr math-normalize-a)))) (or (condition-case err - (let ((func + (let ((func (assq (car math-normalize-a) '( ( + . math-add ) ( - . math-sub ) ( * . math-mul ) @@ -2477,7 +2477,7 @@ largest Emacs integer.") (require 'calc-ext) (math-recompile-eval-rules))) (and (or math-eval-rules-cache-other - (assq (car math-normalize-a) + (assq (car math-normalize-a) math-eval-rules-cache)) (math-apply-rewrites (cons (car math-normalize-a) args) @@ -2496,12 +2496,12 @@ largest Emacs integer.") (cons (car math-normalize-a) args)) nil) (wrong-type-argument - (or calc-next-why + (or calc-next-why (calc-record-why "Wrong type of argument" (cons (car math-normalize-a) args))) nil) (args-out-of-range - (calc-record-why "*Argument out of range" + (calc-record-why "*Argument out of range" (cons (car math-normalize-a) args)) nil) (inexact-result @@ -2559,7 +2559,7 @@ largest Emacs integer.") (defun math-bignum-big (a) ; [L s] (if (= a 0) nil - (cons (% a math-bignum-digit-size) + (cons (% a math-bignum-digit-size) (math-bignum-big (/ a math-bignum-digit-size))))) @@ -2595,7 +2595,7 @@ largest Emacs integer.") (defun math-div10-bignum (a) ; [l l] (if (cdr a) - (cons (+ (/ (car a) 10) (* (% (nth 1 a) 10) + (cons (+ (/ (car a) 10) (* (% (nth 1 a) 10) (expt 10 (1- math-bignum-digit-length)))) (math-div10-bignum (cdr a))) (list (/ (car a) 10)))) @@ -2649,10 +2649,10 @@ largest Emacs integer.") (if (consp a) (cons (car a) (math-scale-left-bignum (cdr a) n)) (if (>= n math-bignum-digit-length) - (if (or (>= a math-bignum-digit-size) + (if (or (>= a math-bignum-digit-size) (<= a (- math-bignum-digit-size))) (math-scale-left (math-bignum a) n) - (math-scale-left (* a math-bignum-digit-size) + (math-scale-left (* a math-bignum-digit-size) (- n math-bignum-digit-length))) (let ((sz (expt 10 (- (* 2 math-bignum-digit-length) n)))) (if (or (>= a sz) (<= a (- sz))) @@ -2662,7 +2662,7 @@ largest Emacs integer.") (defun math-scale-left-bignum (a n) (if (>= n math-bignum-digit-length) (while (>= (setq a (cons 0 a) - n (- n math-bignum-digit-length)) + n (- n math-bignum-digit-length)) math-bignum-digit-length))) (if (> n 0) (math-mul-bignum-digit a (expt 10 n) 0) @@ -2679,7 +2679,7 @@ largest Emacs integer.") (- (math-scale-right (- a) n))) (if (>= n math-bignum-digit-length) (while (and (> (setq a (/ a math-bignum-digit-size)) 0) - (>= (setq n (- n math-bignum-digit-length)) + (>= (setq n (- n math-bignum-digit-length)) math-bignum-digit-length)))) (if (> n 0) (/ a (expt 10 n)) @@ -2701,12 +2701,12 @@ largest Emacs integer.") (math-normalize (cons (car a) (let ((val (if (< n (- math-bignum-digit-length)) - (math-scale-right-bignum - (cdr a) + (math-scale-right-bignum + (cdr a) (- (- math-bignum-digit-length) n)) (if (< n 0) - (math-mul-bignum-digit - (cdr a) + (math-mul-bignum-digit + (cdr a) (expt 10 (+ math-bignum-digit-length n)) 0) (cdr a))))) ; n = -math-bignum-digit-length (if (and val (>= (car val) (/ math-bignum-digit-size 2))) @@ -2779,7 +2779,7 @@ largest Emacs integer.") (let* ((a (copy-sequence a)) (aa a) (carry nil) sum) (while (and aa b) (if carry - (if (< (setq sum (+ (car aa) (car b))) + (if (< (setq sum (+ (car aa) (car b))) (1- math-bignum-digit-size)) (progn (setcar aa (1+ sum)) @@ -2895,7 +2895,7 @@ largest Emacs integer.") (defun math-mul (a b) (or (and (not (consp a)) (not (consp b)) - (< a math-bignum-digit-size) (> a (- math-bignum-digit-size)) + (< a math-bignum-digit-size) (> a (- math-bignum-digit-size)) (< b math-bignum-digit-size) (> b (- math-bignum-digit-size)) (* a b)) (and (Math-zerop a) (not (eq (car-safe b) 'mod)) @@ -2982,8 +2982,8 @@ largest Emacs integer.") (and (= d 1) a) (let* ((a (copy-sequence a)) (aa a) prod) (while (progn - (setcar aa - (% (setq prod (+ (* (car aa) d) c)) + (setcar aa + (% (setq prod (+ (* (car aa) d) c)) math-bignum-digit-size)) (cdr aa)) (setq aa (cdr aa) @@ -3076,7 +3076,7 @@ largest Emacs integer.") (cdr res2))))) (defun math-div-bignum-part (a b blen) ; a < b*math-bignum-digit-size [D.l l L] - (let* ((num (+ (* (or (nth blen a) 0) math-bignum-digit-size) + (let* ((num (+ (* (or (nth blen a) 0) math-bignum-digit-size) (or (nth (1- blen) a) 0))) (den (nth (1- blen) b)) (guess (min (/ num den) (1- math-bignum-digit-size)))) @@ -3390,14 +3390,14 @@ largest Emacs integer.") (if a (let ((s "")) (while (cdr (cdr a)) - (setq s (concat - (format - (concat "%0" - (number-to-string (* 2 math-bignum-digit-length)) + (setq s (concat + (format + (concat "%0" + (number-to-string (* 2 math-bignum-digit-length)) "d") (+ (* (nth 1 a) math-bignum-digit-size) (car a))) s) a (cdr (cdr a)))) - (concat (int-to-string + (concat (int-to-string (+ (* (or (nth 1 a) 0) math-bignum-digit-size) (car a))) s)) "0")) diff --git a/lisp/calendar/cal-bahai.el b/lisp/calendar/cal-bahai.el index e0d1c64875e..dae539b3436 100644 --- a/lisp/calendar/cal-bahai.el +++ b/lisp/calendar/cal-bahai.el @@ -143,19 +143,19 @@ Defaults to today's date if DATE is not given." (year (int-to-string y))) (mapconcat 'eval calendar-date-display-form "")))) -(defun calendar-print-bahai-date () +(defun calendar-bahai-print-date () "Show the Bahá'à calendar equivalent of the selected date." (interactive) (message "Bahá'à date: %s" (calendar-bahai-date-string (calendar-cursor-to-date t)))) -(defun calendar-goto-bahai-date (date &optional noecho) +(defun calendar-bahai-goto-date (date &optional noecho) "Move cursor to Bahá'à date DATE. Echo Bahá'à date unless NOECHO is t." (interactive (calendar-bahai-prompt-for-date)) (calendar-goto-date (calendar-gregorian-from-absolute (calendar-absolute-from-bahai date))) - (or noecho (calendar-print-bahai-date))) + (or noecho (calendar-bahai-print-date))) (defun calendar-bahai-prompt-for-date () "Ask for a Bahá'à date." @@ -204,7 +204,7 @@ nil if it is not visible in the current calendar window." (if (calendar-date-is-visible-p date) (list (list date string)))))))) -(defun diary-list-bahai-entries () +(defun diary-bahai-list-entries () "Add any Bahá'à date entries from the diary file to `diary-entries-list'. Bahá'à date diary entries must be prefaced by an `bahai-diary-entry-symbol' (normally a `B'). The same diary date @@ -458,7 +458,7 @@ A value of 0 in any position is a wildcard." (mark-visible-calendar-date (calendar-gregorian-from-absolute date))))))))) -(defun diary-insert-bahai-entry (arg) +(defun diary-bahai-insert-entry (arg) "Insert a diary entry. For the Bahá'à date corresponding to the date indicated by point. Prefix arg will make the entry nonmarking." @@ -512,17 +512,21 @@ Prefix arg will make the entry nonmarking." ;; Backward compatibility. (define-obsolete-function-alias - 'list-bahai-diary-entries 'diary-list-bahai-entries "23.1") + 'list-bahai-diary-entries 'diary-bahai-list-entries "23.1") (define-obsolete-function-alias - 'mark-bahai-diary-entries 'diary-mark-bahai-entries "23.1") + 'mark-bahai-diary-entries 'diary-bahai-mark-entries "23.1") (define-obsolete-function-alias - 'insert-bahai-diary-entry 'diary-insert-bahai-entry "23.1") + 'insert-bahai-diary-entry 'diary-bahai-insert-entry "23.1") (define-obsolete-function-alias - 'insert-monthly-bahai-diary-entry 'diary-insert-bahai-monthly-entry "23.1") + 'insert-monthly-bahai-diary-entry 'diary-bahai-insert-monthly-entry "23.1") (define-obsolete-function-alias - 'insert-yearly-bahai-diary-entry 'diary-insert-bahai-yearly-entry "23.1") + 'insert-yearly-bahai-diary-entry 'diary-bahai-insert-yearly-entry "23.1") (define-obsolete-function-alias 'mark-bahai-calendar-date-pattern 'calendar-bahai-mark-date-pattern "23.1") +(define-obsolete-function-alias + 'calendar-goto-bahai-date 'calendar-bahai-goto-date "23.1") +(define-obsolete-function-alias + 'calendar-print-bahai-date 'calendar-bahai-print-date "23.1") (provide 'cal-bahai) diff --git a/lisp/calendar/cal-hebrew.el b/lisp/calendar/cal-hebrew.el index f48d3b25e32..02cc9bfabb2 100644 --- a/lisp/calendar/cal-hebrew.el +++ b/lisp/calendar/cal-hebrew.el @@ -352,11 +352,11 @@ nil if it is not visible in the current calendar window." (list (calendar-gregorian-from-absolute (+ abs-r-h 20)) "Hoshanah Rabbah"))) (output-list - (filter-visible-calendar-holidays mandatory))) + (holiday-filter-visible-calendar mandatory))) (if all-hebrew-calendar-holidays (setq output-list (append - (filter-visible-calendar-holidays optional) + (holiday-filter-visible-calendar optional) output-list))) output-list))) @@ -372,7 +372,7 @@ nil if it is not visible in the current calendar window." (calendar-absolute-from-gregorian (list m (calendar-last-day-of-month m y) y))))) (abs-h (calendar-absolute-from-hebrew (list 9 25 h-y)))) - (filter-visible-calendar-holidays + (holiday-filter-visible-calendar (list (list (calendar-gregorian-from-absolute (1- abs-h)) "Erev Hanukkah") @@ -469,11 +469,11 @@ nil if it is not visible in the current calendar window." (list (calendar-gregorian-from-absolute (+ abs-p 51)) "Shavuot (second day)"))) (output-list - (filter-visible-calendar-holidays mandatory))) + (holiday-filter-visible-calendar mandatory))) (if all-hebrew-calendar-holidays (setq output-list (append - (filter-visible-calendar-holidays optional) + (holiday-filter-visible-calendar optional) output-list))) output-list))) @@ -485,7 +485,7 @@ nil if it is not visible in the current calendar window." (let* ((abs-t-a (calendar-absolute-from-hebrew (list 5 9 (+ displayed-year 3760))))) - (filter-visible-calendar-holidays + (holiday-filter-visible-calendar (list (list (calendar-gregorian-from-absolute (if (= (% abs-t-a 7) 6) (- abs-t-a 20) (- abs-t-a 21))) diff --git a/lisp/calendar/cal-menu.el b/lisp/calendar/cal-menu.el index 1f4e4df736f..47fd4fc4c2a 100644 --- a/lisp/calendar/cal-menu.el +++ b/lisp/calendar/cal-menu.el @@ -54,9 +54,9 @@ ["Insert Cyclic" insert-cyclic-diary-entry] ("Insert Baha'i" [" " nil :suffix (calendar-bahai-date-string (calendar-cursor-to-date))] - ["One time" insert-bahai-diary-entry] - ["Monthly" insert-monthly-bahai-diary-entry] - ["Yearly" insert-yearly-bahai-diary-entry]) + ["One time" diary-bahai-insert-entry] + ["Monthly" diary-bahai-insert-monthly-entry] + ["Yearly" diary-bahai-insert-yearly-entry]) ("Insert Islamic" [" " nil :suffix (calendar-islamic-date-string (calendar-cursor-to-date))] ["One time" insert-islamic-diary-entry] @@ -87,7 +87,7 @@ ["For Cursor Date -" calendar-cursor-holidays :suffix (calendar-date-string (calendar-cursor-to-date) t t) :visible (calendar-cursor-to-date)] - ["For Window -" list-calendar-holidays + ["For Window -" calendar-list-holidays :suffix (cal-menu-holiday-window-suffix)] ["For Today -" cal-menu-today-holidays :suffix (calendar-date-string (calendar-current-date) t t)] @@ -98,7 +98,7 @@ (push (vector "For Year" `(lambda () (interactive) - (list-holidays (+ displayed-year ,(- i 5)))) + (holiday-list (+ displayed-year ,(- i 5)))) :suffix `(number-to-string (+ displayed-year ,(- i 5)))) l)) (nreverse l)) @@ -122,7 +122,7 @@ ["Astronomical Date" calendar-goto-astro-day-number] ["Hebrew Date" calendar-goto-hebrew-date] ["Persian Date" calendar-goto-persian-date] - ["Baha'i Date" calendar-goto-bahai-date] + ["Baha'i Date" calendar-bahai-goto-date] ["Islamic Date" calendar-goto-islamic-date] ["Julian Date" calendar-goto-julian-date] ["Chinese Date" calendar-goto-chinese-date] @@ -157,19 +157,19 @@ not available." "Display a list of the holidays of the selected date's year." (interactive) (let ((year (extract-calendar-year (calendar-cursor-to-date)))) - (list-holidays year year))) + (holiday-list year year))) (defun cal-menu-list-holidays-following-year () "Display a list of the holidays of the following year." (interactive) (let ((year (1+ (extract-calendar-year (calendar-cursor-to-date))))) - (list-holidays year year))) + (holiday-list year year))) (defun cal-menu-list-holidays-previous-year () "Display a list of the holidays of the previous year." (interactive) (let ((year (1- (extract-calendar-year (calendar-cursor-to-date))))) - (list-holidays year year))) + (holiday-list year year))) (defun calendar-event-to-date (&optional error) "Date of last event. @@ -194,14 +194,14 @@ ERROR is t, otherwise just returns nil." (calendar-cursor-to-date (calendar-current-date)) (calendar-cursor-holidays))) -(autoload 'check-calendar-holidays "holidays") +(autoload 'calendar-check-holidays "holidays") (autoload 'diary-list-entries "diary-lib") (defun calendar-mouse-holidays (&optional event) "Pop up menu of holidays for mouse selected date." (interactive "e") (let* ((date (calendar-event-to-date)) - (l (mapcar 'list (check-calendar-holidays date))) + (l (mapcar 'list (calendar-check-holidays date))) (selection (cal-menu-x-popup-menu event @@ -226,7 +226,7 @@ Any holidays are shown if `holidays-in-diary-buffer' is t." (mapcar (lambda (x) (split-string (cadr x) "\n")) (diary-list-entries date 1 'list-only))) (holidays (if holidays-in-diary-buffer - (check-calendar-holidays date))) + (calendar-check-holidays date))) (title (concat "Diary entries " (if diary (format "from %s " diary) "") "for " @@ -461,8 +461,8 @@ The output is in landscape format, one month to a page." ["Scroll forward" calendar-scroll-left-three-months] ["Scroll backward" calendar-scroll-right-three-months] ["Mark diary entries" mark-diary-entries] - ["List holidays" list-calendar-holidays] - ["Mark holidays" mark-calendar-holidays] + ["List holidays" calendar-list-holidays] + ["Mark holidays" calendar-mark-holidays] ["Unmark" calendar-unmark] ["Lunar phases" calendar-phases-of-moon] ["Show diary" diary-show-all-entries] diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el index ea495777f19..c252341526a 100644 --- a/lisp/calendar/calendar.el +++ b/lisp/calendar/calendar.el @@ -823,7 +823,7 @@ describes the style of such diary entries." :type 'hook :options '(list-hebrew-diary-entries list-islamic-diary-entries - list-bahai-diary-entries) + diary-bahai-list-entries) :group 'diary) ;;;###autoload @@ -855,7 +855,7 @@ describes the style of such diary entries." :type 'hook :options '(mark-hebrew-diary-entries mark-islamic-diary-entries - mark-bahai-diary-entries) + diary-bahai-mark-entries) :group 'diary) ;;;###autoload @@ -1212,11 +1212,11 @@ of `general-holidays', `local-holidays' `christian-holidays', you can eliminate unwanted categories of holidays. The aforementioned variables control the holiday choices offered -by the function `list-holidays' when it is called interactively. +by the function `holiday-list' when it is called interactively. They also initialize the default value of `calendar-holidays', which is the default list of holidays used by the function -`list-holidays' in the non-interactive case. Note that these +`holiday-list' in the non-interactive case. Note that these variables have no effect on `calendar-holidays' after it has been set (e.g. after the calendar is loaded). In that case, customize `calendar-holidays' directly. @@ -1616,7 +1616,7 @@ the date indicated by the cursor position in the displayed three-month calendar." t) -(autoload 'list-calendar-holidays "holidays" +(autoload 'calendar-list-holidays "holidays" "Create a buffer containing the holidays for the current calendar window. The holidays are those in the list `calendar-notable-days'. Returns t if any holidays are found, nil if not." @@ -1688,7 +1688,7 @@ to be replaced by asterisks to highlight it whenever it is in the window." (diary-window (if diary-buffer (get-buffer-window diary-buffer))) (split-height-threshold (if diary-window 2 1000))) (if view-calendar-holidays-initially - (list-calendar-holidays))) + (calendar-list-holidays))) (run-hooks 'initial-calendar-window-hook)) (autoload 'view-other-diary-entries "diary-lib" @@ -1825,7 +1825,7 @@ Driven by the variable `calendar-date-display-form'.") (autoload 'calendar-islamic-date-string "cal-islam" "String of Islamic date of Gregorian date.") -(autoload 'calendar-goto-bahai-date "cal-bahai" +(autoload 'calendar-bahai-goto-date "cal-bahai" "Move cursor to Baha'i date DATE. Echo Baha'i date unless NOECHO is t." t) @@ -1955,17 +1955,17 @@ to the date indicated by point." to the date indicated by point." t) -(autoload 'insert-bahai-diary-entry "cal-bahai" +(autoload 'diary-bahai-insert-entry "cal-bahai" "Insert a diary entry for the Baha'i date corresponding to the date indicated by point." t) -(autoload 'insert-monthly-bahai-diary-entry "cal-bahai" +(autoload 'diary-bahai-insert-monthly-entry "cal-bahai" "Insert a monthly diary entry for the day of the Baha'i month corresponding to the date indicated by point." t) -(autoload 'insert-yearly-bahai-diary-entry "cal-bahai" +(autoload 'diary-bahai-insert-yearly-entry "cal-bahai" "Insert an annual diary entry for the day of the Baha'i year corresponding to the date indicated by point." t) @@ -2259,7 +2259,7 @@ movement commands will not work correctly." (define-key map "ga" 'calendar-goto-astro-day-number) (define-key map "gh" 'calendar-goto-hebrew-date) (define-key map "gi" 'calendar-goto-islamic-date) - (define-key map "gb" 'calendar-goto-bahai-date) + (define-key map "gb" 'calendar-bahai-goto-date) (define-key map "gC" 'calendar-goto-chinese-date) (define-key map "gk" 'calendar-goto-coptic-date) (define-key map "ge" 'calendar-goto-ethiopic-date) @@ -2284,7 +2284,7 @@ movement commands will not work correctly." (define-key map "." 'calendar-goto-today) (define-key map "o" 'calendar-other-month) (define-key map "q" 'exit-calendar) - (define-key map "a" 'list-calendar-holidays) + (define-key map "a" 'calendar-list-holidays) (define-key map "h" 'calendar-cursor-holidays) (define-key map "x" 'mark-calendar-holidays) (define-key map "u" 'calendar-unmark) @@ -2302,7 +2302,7 @@ movement commands will not work correctly." (define-key map "pa" 'calendar-print-astro-day-number) (define-key map "ph" 'calendar-print-hebrew-date) (define-key map "pi" 'calendar-print-islamic-date) - (define-key map "pb" 'calendar-print-bahai-date) + (define-key map "pb" 'calendar-bahai-print-date) (define-key map "pf" 'calendar-print-french-date) (define-key map "pm" 'calendar-print-mayan-date) (define-key map "po" 'calendar-print-other-dates) @@ -2319,9 +2319,9 @@ movement commands will not work correctly." (define-key map "iid" 'insert-islamic-diary-entry) (define-key map "iim" 'insert-monthly-islamic-diary-entry) (define-key map "iiy" 'insert-yearly-islamic-diary-entry) - (define-key map "iBd" 'insert-bahai-diary-entry) - (define-key map "iBm" 'insert-monthly-bahai-diary-entry) - (define-key map "iBy" 'insert-yearly-bahai-diary-entry) + (define-key map "iBd" 'diary-bahai-insert-entry) + (define-key map "iBm" 'diary-bahai-insert-monthly-entry) + (define-key map "iBy" 'diary-bahai-insert-yearly-entry) (define-key map "?" 'calendar-goto-info-node) (define-key map "Hm" 'cal-html-cursor-month) (define-key map "Hy" 'cal-html-cursor-year) diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el index 09034ab3a8d..df16595f3c5 100644 --- a/lisp/calendar/diary-lib.el +++ b/lisp/calendar/diary-lib.el @@ -75,7 +75,7 @@ D-FILE specifies the file to use as the diary file." (let ((diary-file d-file)) (diary-view-entries arg))) -(autoload 'check-calendar-holidays "holidays" +(autoload 'calendar-check-holidays "holidays" "Check the list of holidays for any that occur on DATE. The value returned is a list of strings of relevant holiday descriptions. The holidays are those in the list `calendar-holidays'.") @@ -117,13 +117,13 @@ The holidays are those in the list `calendar-holidays'.") (autoload 'diary-bahai-date "cal-bahai" "Baha'i calendar equivalent of date diary entry.") -(autoload 'list-bahai-diary-entries "cal-bahai" +(autoload 'diary-bahai-list-entries "cal-bahai" "Add any Baha'i date entries from the diary file to `diary-entries-list'.") -(autoload 'mark-bahai-diary-entries "cal-bahai" +(autoload 'diary-bahai-mark-entries "cal-bahai" "Mark days in the calendar window that have Baha'i date diary entries.") -(autoload 'mark-bahai-calendar-date-pattern "cal-bahai" +(autoload 'calendar-bahai-mark-date-pattern "cal-bahai" "Mark dates in calendar window that conform to Baha'i date MONTH/DAY/YEAR.") (autoload 'diary-hebrew-date "cal-hebrew" @@ -598,7 +598,7 @@ changing the variable `diary-include-string'." (defun simple-diary-display () "Display the diary buffer if there are any relevant entries or holidays." (let* ((holiday-list (if holidays-in-diary-buffer - (check-calendar-holidays original-date))) + (calendar-check-holidays original-date))) (hol-string (format "%s%s%s" date-string (if holiday-list ": " "") @@ -676,7 +676,7 @@ This function is provided for optional use as the `diary-display-hook'." (and (not (cdr diary-entries-list)) (string-equal (car (cdr (car diary-entries-list))) ""))) (let* ((holiday-list (if holidays-in-diary-buffer - (check-calendar-holidays original-date))) + (calendar-check-holidays original-date))) (msg (format "No diary entries for %s %s" (concat date-string (if holiday-list ":" "")) (mapconcat 'identity holiday-list "; ")))) diff --git a/lisp/calendar/holidays.el b/lisp/calendar/holidays.el index a3a12aab2e3..f6134940169 100644 --- a/lisp/calendar/holidays.el +++ b/lisp/calendar/holidays.el @@ -107,8 +107,10 @@ This function is suitable for execution in a .emacs file." (calendar-current-date))) (displayed-month (extract-calendar-month date)) (displayed-year (extract-calendar-year date))) - (list-calendar-holidays)))) + (calendar-list-holidays)))) +;; rms: "Emacs commands to display a list of something generally start +;; with `list-'. Please make `list-holidays' the principal name." ;;;###autoload (defun list-holidays (y1 y2 &optional l label) "Display holidays for years Y1 to Y2 (inclusive). @@ -206,19 +208,18 @@ The optional LABEL is used to label the buffer created." (display-buffer holiday-buffer) (message "Computing holidays...done")))) +(defalias 'holiday-list 'list-holidays) -(defun check-calendar-holidays (date) +(defun calendar-check-holidays (date) "Check the list of holidays for any that occur on DATE. The value returned is a list of strings of relevant holiday descriptions. -The holidays are those in the list calendar-holidays." - (let* ((displayed-month (extract-calendar-month date)) - (displayed-year (extract-calendar-year date)) - (h (calendar-holiday-list)) - (holiday-list)) - (while h - (if (calendar-date-equal date (car (car h))) - (setq holiday-list (append holiday-list (cdr (car h))))) - (setq h (cdr h))) +The holidays are those in the list `calendar-holidays'." + (let ((displayed-month (extract-calendar-month date)) + (displayed-year (extract-calendar-year date)) + (holiday-list)) + (dolist (h (calendar-holiday-list)) + (if (calendar-date-equal date (car h)) + (setq holiday-list (append holiday-list (cdr h))))) holiday-list)) (defun calendar-cursor-holidays () @@ -227,7 +228,7 @@ The holidays are those in the list calendar-holidays." (message "Checking holidays...") (let* ((date (calendar-cursor-to-date t)) (date-string (calendar-date-string date)) - (holiday-list (check-calendar-holidays date)) + (holiday-list (calendar-check-holidays date)) (holiday-string (mapconcat 'identity holiday-list "; ")) (msg (format "%s: %s" date-string holiday-string))) (if (not holiday-list) @@ -245,21 +246,19 @@ The holidays are those in the list calendar-holidays." (display-buffer holiday-buffer) (message "Checking holidays...done"))))) -(defun mark-calendar-holidays () +(defun calendar-mark-holidays () "Mark notable days in the calendar window." (interactive) (setq mark-holidays-in-calendar t) (message "Marking holidays...") - (let ((holiday-list (calendar-holiday-list))) - (while holiday-list - (mark-visible-calendar-date - (car (car holiday-list)) calendar-holiday-marker) - (setq holiday-list (cdr holiday-list)))) + (dolist (holiday (calendar-holiday-list)) + (mark-visible-calendar-date + (car holiday) calendar-holiday-marker)) (message "Marking holidays...done")) -(defun list-calendar-holidays () +(defun calendar-list-holidays () "Create a buffer containing the holidays for the current calendar window. -The holidays are those in the list calendar-notable-days. Returns t if any +The holidays are those in the list `calendar-notable-days'. Returns t if any holidays are found, nil if not." (interactive) (message "Looking up holidays...") @@ -297,22 +296,20 @@ holidays are found, nil if not." (defun calendar-holiday-list () "Form the list of holidays that occur on dates in the calendar window. -The holidays are those in the list calendar-holidays." - (let ((p calendar-holidays) - (holiday-list)) - (while p +The holidays are those in the list `calendar-holidays'." + (let ((holiday-list ())) + (dolist (p calendar-holidays) (let* ((holidays (if calendar-debug-sexp (let ((stack-trace-on-error t)) - (eval (car p))) + (eval p)) (condition-case nil - (eval (car p)) + (eval p) (error (beep) - (message "Bad holiday list item: %s" (car p)) + (message "Bad holiday list item: %s" p) (sleep-for 2)))))) (if holidays - (setq holiday-list (append holidays holiday-list)))) - (setq p (cdr p))) + (setq holiday-list (append holidays holiday-list))))) (setq holiday-list (sort holiday-list 'calendar-date-compare)))) ;; Below are the functions that calculate the dates of holidays; these @@ -396,16 +393,16 @@ date. If date is nil, or if the date is not visible, there is no holiday." (let ((m displayed-month) (y displayed-year)) (increment-calendar-month m y -1) - (filter-visible-calendar-holidays - (append + (holiday-filter-visible-calendar + (list (let* ((year y) (date (eval sexp)) (string (if date (eval string)))) - (list (list date string))) + (list date string)) (let* ((year (1+ y)) (date (eval sexp)) (string (if date (eval string)))) - (list (list date string))))))) + (list date string)))))) (defun holiday-advent (&optional n string) "Date of Nth day after advent (named STRING), if visible in calendar window. @@ -486,7 +483,7 @@ is non-nil)." (- (calendar-absolute-from-gregorian (list 4 19 displayed-year)) adjusted-epact)) (abs-easter (calendar-dayname-on-or-before 0 (+ paschal-moon 7)))) - (filter-visible-calendar-holidays + (holiday-filter-visible-calendar (list (list (calendar-gregorian-from-absolute (+ abs-easter n)) string)))))) @@ -513,18 +510,26 @@ is non-nil)." (if (calendar-date-is-visible-p nicaean-easter) (list (list nicaean-easter "Pascha (Greek Orthodox Easter)")))))) -(defun filter-visible-calendar-holidays (l) +(defun holiday-filter-visible-calendar (l) "Return a list of all visible holidays of those on L." - (let ((visible) - (p l)) - (while p - (and (car (car p)) - (calendar-date-is-visible-p (car (car p))) - (setq visible (append (list (car p)) visible))) - (setq p (cdr p))) + (let ((visible ())) + (dolist (p l) + (and (car p) + (calendar-date-is-visible-p (car p)) + (push p visible))) visible)) +;; Backward compatibility. +(define-obsolete-function-alias + 'filter-visible-calendar-holidays 'holiday-filter-visible-calendar "23.1") +(define-obsolete-function-alias + 'list-calendar-holidays 'calendar-list-holidays "23.1") +(define-obsolete-function-alias + 'mark-calendar-holidays 'calendar-mark-holidays "23.1") +(define-obsolete-function-alias + 'check-calendar-holidays 'calendar-check-holidays "23.1") + (provide 'holidays) -;;; arch-tag: 48eb3117-75a7-4dbe-8fd9-873c3cbb0d37 +;; arch-tag: 48eb3117-75a7-4dbe-8fd9-873c3cbb0d37 ;;; holidays.el ends here diff --git a/lisp/calendar/icalendar.el b/lisp/calendar/icalendar.el index 101aaf96e43..881e7490665 100644 --- a/lisp/calendar/icalendar.el +++ b/lisp/calendar/icalendar.el @@ -1531,24 +1531,24 @@ buffer `*icalendar-errors*'." ("%t" STATUS icalendar-import-format-status) ("%u" URL icalendar-import-format-url)))) ;; convert the specifiers in the format string - (mapcar (lambda (i) - (let* ((spec (car i)) - (prop (cadr i)) - (format (car (cddr i))) - (contents (icalendar--get-event-property event prop)) - (formatted-contents "")) - (when (and contents (> (length contents) 0)) - (setq formatted-contents - (icalendar--rris "%s" - (icalendar--convert-string-for-import - contents) - (symbol-value format) - t t))) - (setq string (icalendar--rris spec - formatted-contents - string - t t)))) - conversion-list) + (mapc (lambda (i) + (let* ((spec (car i)) + (prop (cadr i)) + (format (car (cddr i))) + (contents (icalendar--get-event-property event prop)) + (formatted-contents "")) + (when (and contents (> (length contents) 0)) + (setq formatted-contents + (icalendar--rris "%s" + (icalendar--convert-string-for-import + contents) + (symbol-value format) + t t))) + (setq string (icalendar--rris spec + formatted-contents + string + t t)))) + conversion-list) string)) (defun icalendar--convert-ical-to-diary (ical-list diary-file @@ -1637,11 +1637,11 @@ written into the buffer `*icalendar-errors*'." (rdate (icalendar--dmsg "rdate event") (setq diary-string "") - (mapcar (lambda (datestring) - (setq diary-string - (concat diary-string - (format "......")))) - (icalendar--split-value rdate))) + (mapc (lambda (datestring) + (setq diary-string + (concat diary-string + (format "......")))) + (icalendar--split-value rdate))) ;; non-recurring event ;; all-day event ((not (string= start-d end-d)) diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el index dbebf314798..d04550c187d 100644 --- a/lisp/emacs-lisp/advice.el +++ b/lisp/emacs-lisp/advice.el @@ -2996,7 +2996,9 @@ in any of these classes." (setq usage (if (null usage) t (setq origdoc (cdr usage)) (car usage))) (if origdoc (setq paragraphs (list origdoc))) (unless (eq style 'plain) - (push (concat "This " origtype " is advised.") paragraphs)) + (push (propertize (concat "This " origtype " is advised.") + 'face 'font-lock-warning-face) + paragraphs)) (ad-dolist (class ad-advice-classes) (ad-dolist (advice (ad-get-enabled-advices function class)) (setq advice-docstring diff --git a/lisp/emacs-lisp/authors.el b/lisp/emacs-lisp/authors.el index 0c08e74d70b..4b490621f51 100644 --- a/lisp/emacs-lisp/authors.el +++ b/lisp/emacs-lisp/authors.el @@ -72,7 +72,7 @@ files.") ("Geoff Voelker" "voelker") ("Gerd M,Av(Bllmann" "Gerd Moellmann") ("Hallvard B. Furuseth" "Hallvard B Furuseth") - ("Hrvoje Nik,B9(Bi,Bf(B" "Hrvoje Niksic") + ("Hrvoje Nik$,1!!(Bi$,1 '(B" "Hrvoje Niksic") (nil "(afs@hplb.hpl.hp.com)") (nil "<Use-Author-Address-Header@\\[127.1\\]>") (nil "Code Extracted") @@ -81,7 +81,7 @@ files.") ("Jaeyoun Chung" "Jae-youn Chung" "Jae-you Chung" "Chung Jae-youn") ("Jan Dj,Ad(Brv" "Jan D." "Jan Djarv") ("Jay K. Adams" "jka@ece.cmu.edu" "Jay Adams") - ("J,Ai(Br,At(Bme Marant" "J,bi(Br,bt(Bme Marant" "Jerome Marant") + ("J,Ai(Br,At(Bme Marant" "J,Ai(Br,At(Bme Marant" "Jerome Marant") ("Jens-Ulrik Holger Petersen" "Jens-Ulrik Petersen") ("Jeremy Bertram Maitin-Shepard" "Jeremy Maitin-Shepard") ("Johan Bockg,Ae(Brd" "Johan Bockgard") @@ -90,11 +90,11 @@ files.") ("Joseph Arceneaux" "Joe Arceneaux") ("Juan Le,As(Bn Lahoz Garc,Am(Ba" "Juan-Leon Lahoz Garcia") ("K. Shane Hartman" "Shane Hartman") - ("Kai Gro,A_(Bjohann" "Kai Grossjohann" "Kai Gro,b_(Bjohann" + ("Kai Gro,A_(Bjohann" "Kai Grossjohann" "Kai Gro,A_(Bjohann" "Kai.Grossjohann@Cs.Uni-Dortmund.De" "Kai.Grossjohann@Gmx.Net") ("Karl Berry" "K. Berry") - ("K,Aa(Broly L$,1 q(Brentey" "K,Aa(Broly L,Bu(Brentey" "L$,1 q(Brentey K,Aa(Broly") + ("K,Aa(Broly L$,1 q(Brentey" "K,Aa(Broly L$,1 q(Brentey" "L$,1 q(Brentey K,Aa(Broly") ("Kazushi Marukawa" "Kazushi") ("Ken Manheimer" "Kenneth Manheimer") ("Kenichi Handa" "Ken'ichi Handa" "Kenichi HANDA") @@ -113,7 +113,7 @@ files.") ("Mikio Nakajima" "Nakajima Mikio") ("Paul Eggert" "eggert") ("Paul Reilly" "(pmr@legacy.pajato.com)") - ("Pavel Jan,Bm(Bk" "Pavel Jan,Am(Bk Ml." "Pavel Jan,Am(Bk" "Pavel@Janik.Cz") + ("Pavel Jan,Am(Bk" "Pavel Jan,Am(Bk Ml." "Pavel Jan,Am(Bk" "Pavel@Janik.Cz") ("Per Abrahamsen" "Per Abhiddenware") ("Peter S. Galbraith" "Peter Galbraith") ("Peter Runestig" "Peter 'luna' Runestig") @@ -666,8 +666,8 @@ list of their contributions.\n") (erase-buffer) (set-buffer-file-coding-system authors-coding-system) (insert "Unrecognized file entries found:\n\n") - (mapcar (lambda (f) (if (not (string-match "^[A-Za-z]+$" f)) (insert f "\n"))) - (sort authors-invalid-file-names 'string-lessp)) + (mapc (lambda (f) (if (not (string-match "^[A-Za-z]+$" f)) (insert f "\n"))) + (sort authors-invalid-file-names 'string-lessp)) (goto-char (point-min)) (compilation-mode) (message "Errors were found. See buffer %s" (buffer-name)))) diff --git a/lisp/emacs-lisp/avl-tree.el b/lisp/emacs-lisp/avl-tree.el index ffac825acac..b8cf8362386 100644 --- a/lisp/emacs-lisp/avl-tree.el +++ b/lisp/emacs-lisp/avl-tree.el @@ -28,345 +28,306 @@ ;;; Commentary: -;; An AVL tree is a nearly-perfect balanced binary tree. A tree -;; consists of two cons cells, the first one holding the tag -;; 'AVL-TREE in the car cell, and the second one having the tree -;; in the car and the compare function in the cdr cell. The tree has -;; a dummy node as its root with the real tree in the left pointer. +;; An AVL tree is a nearly-perfect balanced binary tree. A tree consists of +;; two elements, the root node and the compare function. The actual tree +;; has a dummy node as its root with the real root in the left pointer. ;; ;; Each node of the tree consists of one data element, one left ;; sub-tree and one right sub-tree. Each node also has a balance ;; count, which is the difference in depth of the left and right ;; sub-trees. ;; -;; The "public" functions (prefixed with "avl-tree") are: -;; -create, -p, -compare-function, -empty, -enter, -delete, -;; -member, -map, -first, -last, -copy, -flatten, -size, -clear. +;; The functions with names of the form "avl-tree--" are intended for +;; internal use only. ;;; Code: -;;; ================================================================ -;;; Functions and macros handling an AVL tree node. - -(defmacro avl-tree-node-create (left right data balance) - ;; Create and return an avl-tree node. - `(vector ,left ,right ,data ,balance)) - -(defmacro avl-tree-node-left (node) - ;; Return the left pointer of NODE. - `(aref ,node 0)) - -(defmacro avl-tree-node-right (node) - ;; Return the right pointer of NODE. - `(aref ,node 1)) - -(defmacro avl-tree-node-data (node) - ;; Return the data of NODE. - `(aref ,node 2)) - -(defmacro avl-tree-node-set-left (node newleft) - ;; Set the left pointer of NODE to NEWLEFT. - `(aset ,node 0 ,newleft)) - -(defmacro avl-tree-node-set-right (node newright) - ;; Set the right pointer of NODE to NEWRIGHT. - `(aset ,node 1 ,newright)) - -(defmacro avl-tree-node-set-data (node newdata) - ;; Set the data of NODE to NEWDATA. - `(aset ,node 2 ,newdata)) - -(defmacro avl-tree-node-branch (node branch) +(eval-when-compile (require 'cl)) + +;; ================================================================ +;;; Functions and macros handling an AVL tree node. + +(defstruct (avl-tree--node + ;; We force a representation without tag so it matches the + ;; pre-defstruct representation. Also we use the underlying + ;; representation in the implementation of avl-tree--node-branch. + (:type vector) + (:constructor nil) + (:constructor avl-tree--node-create (left right data balance)) + (:copier nil)) + left right data balance) + +(defalias 'avl-tree--node-branch 'aref + ;; This implementation is efficient but breaks the defstruct abstraction. + ;; An alternative could be + ;; (funcall (aref [avl-tree-left avl-tree-right avl-tree-data] branch) node) "Get value of a branch of a node. NODE is the node, and BRANCH is the branch. -0 for left pointer, 1 for right pointer and 2 for the data.\"" - `(aref ,node ,branch)) - -(defmacro avl-tree-node-set-branch (node branch newval) - "Set value of a branch of a node. - -NODE is the node, and BRANCH is the branch. -0 for left pointer, 1 for the right pointer and 2 for the data. -NEWVAL is new value of the branch.\"" - `(aset ,node ,branch ,newval)) - -(defmacro avl-tree-node-balance (node) - ;; Return the balance field of a node. - `(aref ,node 3)) - -(defmacro avl-tree-node-set-balance (node newbal) - ;; Set the balance field of a node. - `(aset ,node 3 ,newbal)) +0 for left pointer, 1 for right pointer and 2 for the data.\" +\(fn node branch)") +;; The funcall/aref trick doesn't work for the setf method, unless we try +;; and access the underlying setter function, but this wouldn't be +;; portable either. +(defsetf avl-tree--node-branch aset) -;;; ================================================================ -;;; Internal functions for use in the AVL tree package - -(defmacro avl-tree-root (tree) +;; ================================================================ +;;; Internal functions for use in the AVL tree package + +(defstruct (avl-tree- + ;; A tagged list is the pre-defstruct representation. + ;; (:type list) + :named + (:constructor nil) + (:constructor avl-tree-create (cmpfun)) + (:predicate avl-tree-p) + (:copier nil)) + (dummyroot (avl-tree--node-create nil nil nil 0)) + cmpfun) + +(defmacro avl-tree--root (tree) ;; Return the root node for an avl-tree. INTERNAL USE ONLY. - `(avl-tree-node-left (car (cdr ,tree)))) - -(defmacro avl-tree-dummyroot (tree) - ;; Return the dummy node of an avl-tree. INTERNAL USE ONLY. - `(car (cdr ,tree))) - -(defmacro avl-tree-cmpfun (tree) - ;; Return the compare function of AVL tree TREE. INTERNAL USE ONLY. - `(cdr (cdr ,tree))) + `(avl-tree--node-left (avl-tree--dummyroot tree))) +(defsetf avl-tree--root (tree) (node) + `(setf (avl-tree--node-left (avl-tree--dummyroot ,tree)) ,node)) ;; ---------------------------------------------------------------- ;; Deleting data -(defun avl-tree-del-balance1 (node branch) +(defun avl-tree--del-balance1 (node branch) ;; Rebalance a tree and return t if the height of the tree has shrunk. - (let ((br (avl-tree-node-branch node branch)) + (let ((br (avl-tree--node-branch node branch)) p1 b1 p2 b2 result) (cond - ((< (avl-tree-node-balance br) 0) - (avl-tree-node-set-balance br 0) + ((< (avl-tree--node-balance br) 0) + (setf (avl-tree--node-balance br) 0) t) - ((= (avl-tree-node-balance br) 0) - (avl-tree-node-set-balance br +1) + ((= (avl-tree--node-balance br) 0) + (setf (avl-tree--node-balance br) +1) nil) (t ;; Rebalance. - (setq p1 (avl-tree-node-right br) - b1 (avl-tree-node-balance p1)) + (setq p1 (avl-tree--node-right br) + b1 (avl-tree--node-balance p1)) (if (>= b1 0) ;; Single RR rotation. (progn - (avl-tree-node-set-right br (avl-tree-node-left p1)) - (avl-tree-node-set-left p1 br) + (setf (avl-tree--node-right br) (avl-tree--node-left p1)) + (setf (avl-tree--node-left p1) br) (if (= 0 b1) (progn - (avl-tree-node-set-balance br +1) - (avl-tree-node-set-balance p1 -1) + (setf (avl-tree--node-balance br) +1) + (setf (avl-tree--node-balance p1) -1) (setq result nil)) - (avl-tree-node-set-balance br 0) - (avl-tree-node-set-balance p1 0) + (setf (avl-tree--node-balance br) 0) + (setf (avl-tree--node-balance p1) 0) (setq result t)) - (avl-tree-node-set-branch node branch p1) + (setf (avl-tree--node-branch node branch) p1) result) ;; Double RL rotation. - (setq p2 (avl-tree-node-left p1) - b2 (avl-tree-node-balance p2)) - (avl-tree-node-set-left p1 (avl-tree-node-right p2)) - (avl-tree-node-set-right p2 p1) - (avl-tree-node-set-right br (avl-tree-node-left p2)) - (avl-tree-node-set-left p2 br) - (if (> b2 0) - (avl-tree-node-set-balance br -1) - (avl-tree-node-set-balance br 0)) - (if (< b2 0) - (avl-tree-node-set-balance p1 +1) - (avl-tree-node-set-balance p1 0)) - (avl-tree-node-set-branch node branch p2) - (avl-tree-node-set-balance p2 0) + (setq p2 (avl-tree--node-left p1) + b2 (avl-tree--node-balance p2)) + (setf (avl-tree--node-left p1) (avl-tree--node-right p2)) + (setf (avl-tree--node-right p2) p1) + (setf (avl-tree--node-right br) (avl-tree--node-left p2)) + (setf (avl-tree--node-left p2) br) + (setf (avl-tree--node-balance br) (if (> b2 0) -1 0)) + (setf (avl-tree--node-balance p1) (if (< b2 0) +1 0)) + (setf (avl-tree--node-branch node branch) p2) + (setf (avl-tree--node-balance p2) 0) t))))) -(defun avl-tree-del-balance2 (node branch) - (let ((br (avl-tree-node-branch node branch)) +(defun avl-tree--del-balance2 (node branch) + (let ((br (avl-tree--node-branch node branch)) p1 b1 p2 b2 result) (cond - ((> (avl-tree-node-balance br) 0) - (avl-tree-node-set-balance br 0) + ((> (avl-tree--node-balance br) 0) + (setf (avl-tree--node-balance br) 0) t) - ((= (avl-tree-node-balance br) 0) - (avl-tree-node-set-balance br -1) + ((= (avl-tree--node-balance br) 0) + (setf (avl-tree--node-balance br) -1) nil) (t ;; Rebalance. - (setq p1 (avl-tree-node-left br) - b1 (avl-tree-node-balance p1)) + (setq p1 (avl-tree--node-left br) + b1 (avl-tree--node-balance p1)) (if (<= b1 0) ;; Single LL rotation. (progn - (avl-tree-node-set-left br (avl-tree-node-right p1)) - (avl-tree-node-set-right p1 br) + (setf (avl-tree--node-left br) (avl-tree--node-right p1)) + (setf (avl-tree--node-right p1) br) (if (= 0 b1) (progn - (avl-tree-node-set-balance br -1) - (avl-tree-node-set-balance p1 +1) + (setf (avl-tree--node-balance br) -1) + (setf (avl-tree--node-balance p1) +1) (setq result nil)) - (avl-tree-node-set-balance br 0) - (avl-tree-node-set-balance p1 0) + (setf (avl-tree--node-balance br) 0) + (setf (avl-tree--node-balance p1) 0) (setq result t)) - (avl-tree-node-set-branch node branch p1) + (setf (avl-tree--node-branch node branch) p1) result) ;; Double LR rotation. - (setq p2 (avl-tree-node-right p1) - b2 (avl-tree-node-balance p2)) - (avl-tree-node-set-right p1 (avl-tree-node-left p2)) - (avl-tree-node-set-left p2 p1) - (avl-tree-node-set-left br (avl-tree-node-right p2)) - (avl-tree-node-set-right p2 br) - (if (< b2 0) - (avl-tree-node-set-balance br +1) - (avl-tree-node-set-balance br 0)) - (if (> b2 0) - (avl-tree-node-set-balance p1 -1) - (avl-tree-node-set-balance p1 0)) - (avl-tree-node-set-branch node branch p2) - (avl-tree-node-set-balance p2 0) + (setq p2 (avl-tree--node-right p1) + b2 (avl-tree--node-balance p2)) + (setf (avl-tree--node-right p1) (avl-tree--node-left p2)) + (setf (avl-tree--node-left p2) p1) + (setf (avl-tree--node-left br) (avl-tree--node-right p2)) + (setf (avl-tree--node-right p2) br) + (setf (avl-tree--node-balance br) (if (< b2 0) +1 0)) + (setf (avl-tree--node-balance p1) (if (> b2 0) -1 0)) + (setf (avl-tree--node-branch node branch) p2) + (setf (avl-tree--node-balance p2) 0) t))))) -(defun avl-tree-do-del-internal (node branch q) - (let ((br (avl-tree-node-branch node branch))) - (if (avl-tree-node-right br) - (if (avl-tree-do-del-internal br +1 q) - (avl-tree-del-balance2 node branch)) - (avl-tree-node-set-data q (avl-tree-node-data br)) - (avl-tree-node-set-branch node branch - (avl-tree-node-left br)) +(defun avl-tree--do-del-internal (node branch q) + (let ((br (avl-tree--node-branch node branch))) + (if (avl-tree--node-right br) + (if (avl-tree--do-del-internal br +1 q) + (avl-tree--del-balance2 node branch)) + (setf (avl-tree--node-data q) (avl-tree--node-data br)) + (setf (avl-tree--node-branch node branch) + (avl-tree--node-left br)) t))) -(defun avl-tree-do-delete (cmpfun root branch data) +(defun avl-tree--do-delete (cmpfun root branch data) ;; Return t if the height of the tree has shrunk. - (let ((br (avl-tree-node-branch root branch))) + (let ((br (avl-tree--node-branch root branch))) (cond ((null br) nil) - ((funcall cmpfun data (avl-tree-node-data br)) - (if (avl-tree-do-delete cmpfun br 0 data) - (avl-tree-del-balance1 root branch))) + ((funcall cmpfun data (avl-tree--node-data br)) + (if (avl-tree--do-delete cmpfun br 0 data) + (avl-tree--del-balance1 root branch))) - ((funcall cmpfun (avl-tree-node-data br) data) - (if (avl-tree-do-delete cmpfun br 1 data) - (avl-tree-del-balance2 root branch))) + ((funcall cmpfun (avl-tree--node-data br) data) + (if (avl-tree--do-delete cmpfun br 1 data) + (avl-tree--del-balance2 root branch))) (t ;; Found it. Let's delete it. (cond - ((null (avl-tree-node-right br)) - (avl-tree-node-set-branch root branch (avl-tree-node-left br)) + ((null (avl-tree--node-right br)) + (setf (avl-tree--node-branch root branch) (avl-tree--node-left br)) t) - ((null (avl-tree-node-left br)) - (avl-tree-node-set-branch root branch (avl-tree-node-right br)) + ((null (avl-tree--node-left br)) + (setf (avl-tree--node-branch root branch) (avl-tree--node-right br)) t) (t - (if (avl-tree-do-del-internal br 0 br) - (avl-tree-del-balance1 root branch)))))))) + (if (avl-tree--do-del-internal br 0 br) + (avl-tree--del-balance1 root branch)))))))) ;; ---------------------------------------------------------------- ;; Entering data -(defun avl-tree-enter-balance1 (node branch) +(defun avl-tree--enter-balance1 (node branch) ;; Rebalance a tree and return t if the height of the tree has grown. - (let ((br (avl-tree-node-branch node branch)) + (let ((br (avl-tree--node-branch node branch)) p1 p2 b2 result) (cond - ((< (avl-tree-node-balance br) 0) - (avl-tree-node-set-balance br 0) + ((< (avl-tree--node-balance br) 0) + (setf (avl-tree--node-balance br) 0) nil) - ((= (avl-tree-node-balance br) 0) - (avl-tree-node-set-balance br +1) + ((= (avl-tree--node-balance br) 0) + (setf (avl-tree--node-balance br) +1) t) (t ;; Tree has grown => Rebalance. - (setq p1 (avl-tree-node-right br)) - (if (> (avl-tree-node-balance p1) 0) + (setq p1 (avl-tree--node-right br)) + (if (> (avl-tree--node-balance p1) 0) ;; Single RR rotation. (progn - (avl-tree-node-set-right br (avl-tree-node-left p1)) - (avl-tree-node-set-left p1 br) - (avl-tree-node-set-balance br 0) - (avl-tree-node-set-branch node branch p1)) + (setf (avl-tree--node-right br) (avl-tree--node-left p1)) + (setf (avl-tree--node-left p1) br) + (setf (avl-tree--node-balance br) 0) + (setf (avl-tree--node-branch node branch) p1)) ;; Double RL rotation. - (setq p2 (avl-tree-node-left p1) - b2 (avl-tree-node-balance p2)) - (avl-tree-node-set-left p1 (avl-tree-node-right p2)) - (avl-tree-node-set-right p2 p1) - (avl-tree-node-set-right br (avl-tree-node-left p2)) - (avl-tree-node-set-left p2 br) - (if (> b2 0) - (avl-tree-node-set-balance br -1) - (avl-tree-node-set-balance br 0)) - (if (< b2 0) - (avl-tree-node-set-balance p1 +1) - (avl-tree-node-set-balance p1 0)) - (avl-tree-node-set-branch node branch p2)) - (avl-tree-node-set-balance (avl-tree-node-branch node branch) 0) + (setq p2 (avl-tree--node-left p1) + b2 (avl-tree--node-balance p2)) + (setf (avl-tree--node-left p1) (avl-tree--node-right p2)) + (setf (avl-tree--node-right p2) p1) + (setf (avl-tree--node-right br) (avl-tree--node-left p2)) + (setf (avl-tree--node-left p2) br) + (setf (avl-tree--node-balance br) (if (> b2 0) -1 0)) + (setf (avl-tree--node-balance p1) (if (< b2 0) +1 0)) + (setf (avl-tree--node-branch node branch) p2)) + (setf (avl-tree--node-balance (avl-tree--node-branch node branch)) 0) nil)))) -(defun avl-tree-enter-balance2 (node branch) +(defun avl-tree--enter-balance2 (node branch) ;; Return t if the tree has grown. - (let ((br (avl-tree-node-branch node branch)) + (let ((br (avl-tree--node-branch node branch)) p1 p2 b2) (cond - ((> (avl-tree-node-balance br) 0) - (avl-tree-node-set-balance br 0) + ((> (avl-tree--node-balance br) 0) + (setf (avl-tree--node-balance br) 0) nil) - ((= (avl-tree-node-balance br) 0) - (avl-tree-node-set-balance br -1) + ((= (avl-tree--node-balance br) 0) + (setf (avl-tree--node-balance br) -1) t) (t ;; Balance was -1 => Rebalance. - (setq p1 (avl-tree-node-left br)) - (if (< (avl-tree-node-balance p1) 0) + (setq p1 (avl-tree--node-left br)) + (if (< (avl-tree--node-balance p1) 0) ;; Single LL rotation. (progn - (avl-tree-node-set-left br (avl-tree-node-right p1)) - (avl-tree-node-set-right p1 br) - (avl-tree-node-set-balance br 0) - (avl-tree-node-set-branch node branch p1)) + (setf (avl-tree--node-left br) (avl-tree--node-right p1)) + (setf (avl-tree--node-right p1) br) + (setf (avl-tree--node-balance br) 0) + (setf (avl-tree--node-branch node branch) p1)) ;; Double LR rotation. - (setq p2 (avl-tree-node-right p1) - b2 (avl-tree-node-balance p2)) - (avl-tree-node-set-right p1 (avl-tree-node-left p2)) - (avl-tree-node-set-left p2 p1) - (avl-tree-node-set-left br (avl-tree-node-right p2)) - (avl-tree-node-set-right p2 br) - (if (< b2 0) - (avl-tree-node-set-balance br +1) - (avl-tree-node-set-balance br 0)) - (if (> b2 0) - (avl-tree-node-set-balance p1 -1) - (avl-tree-node-set-balance p1 0)) - (avl-tree-node-set-branch node branch p2)) - (avl-tree-node-set-balance (avl-tree-node-branch node branch) 0) + (setq p2 (avl-tree--node-right p1) + b2 (avl-tree--node-balance p2)) + (setf (avl-tree--node-right p1) (avl-tree--node-left p2)) + (setf (avl-tree--node-left p2) p1) + (setf (avl-tree--node-left br) (avl-tree--node-right p2)) + (setf (avl-tree--node-right p2) br) + (setf (avl-tree--node-balance br) (if (< b2 0) +1 0)) + (setf (avl-tree--node-balance p1) (if (> b2 0) -1 0)) + (setf (avl-tree--node-branch node branch) p2)) + (setf (avl-tree--node-balance (avl-tree--node-branch node branch)) 0) nil)))) -(defun avl-tree-do-enter (cmpfun root branch data) +(defun avl-tree--do-enter (cmpfun root branch data) ;; Return t if height of tree ROOT has grown. INTERNAL USE ONLY. - (let ((br (avl-tree-node-branch root branch))) + (let ((br (avl-tree--node-branch root branch))) (cond ((null br) ;; Data not in tree, insert it. - (avl-tree-node-set-branch - root branch (avl-tree-node-create nil nil data 0)) + (setf (avl-tree--node-branch root branch) + (avl-tree--node-create nil nil data 0)) t) - ((funcall cmpfun data (avl-tree-node-data br)) - (and (avl-tree-do-enter cmpfun br 0 data) - (avl-tree-enter-balance2 root branch))) + ((funcall cmpfun data (avl-tree--node-data br)) + (and (avl-tree--do-enter cmpfun br 0 data) + (avl-tree--enter-balance2 root branch))) - ((funcall cmpfun (avl-tree-node-data br) data) - (and (avl-tree-do-enter cmpfun br 1 data) - (avl-tree-enter-balance1 root branch))) + ((funcall cmpfun (avl-tree--node-data br) data) + (and (avl-tree--do-enter cmpfun br 1 data) + (avl-tree--enter-balance1 root branch))) (t - (avl-tree-node-set-data br data) + (setf (avl-tree--node-data br) data) nil)))) ;; ---------------------------------------------------------------- -(defun avl-tree-mapc (map-function root) +(defun avl-tree--mapc (map-function root) ;; Apply MAP-FUNCTION to all nodes in the tree starting with ROOT. ;; The function is applied in-order. ;; @@ -378,72 +339,59 @@ NEWVAL is new value of the branch.\"" (push nil stack) (while node (if (and go-left - (avl-tree-node-left node)) + (avl-tree--node-left node)) ;; Do the left subtree first. (progn (push node stack) - (setq node (avl-tree-node-left node))) + (setq node (avl-tree--node-left node))) ;; Apply the function... (funcall map-function node) ;; and do the right subtree. - (if (avl-tree-node-right node) - (setq node (avl-tree-node-right node) - go-left t) - (setq node (pop stack) - go-left nil)))))) + (setq node (if (setq go-left (avl-tree--node-right node)) + (avl-tree--node-right node) + (pop stack))))))) -(defun avl-tree-do-copy (root) +(defun avl-tree--do-copy (root) ;; Copy the avl tree with ROOT as root. ;; Highly recursive. INTERNAL USE ONLY. (if (null root) nil - (avl-tree-node-create - (avl-tree-do-copy (avl-tree-node-left root)) - (avl-tree-do-copy (avl-tree-node-right root)) - (avl-tree-node-data root) - (avl-tree-node-balance root)))) + (avl-tree--node-create + (avl-tree--do-copy (avl-tree--node-left root)) + (avl-tree--do-copy (avl-tree--node-right root)) + (avl-tree--node-data root) + (avl-tree--node-balance root)))) -;;; ================================================================ -;;; The public functions which operate on AVL trees. - -(defun avl-tree-create (compare-function) - "Create a new empty avl tree and return it. -COMPARE-FUNCTION is a function which takes two arguments, A and B, -and returns non-nil if A is less than B, and nil otherwise." - (cons 'AVL-TREE - (cons (avl-tree-node-create nil nil nil 0) - compare-function))) +;; ================================================================ +;;; The public functions which operate on AVL trees. -(defun avl-tree-p (obj) - "Return t if OBJ is an avl tree, nil otherwise." - (eq (car-safe obj) 'AVL-TREE)) +(defalias 'avl-tree-compare-function 'avl-tree--cmpfun + "Return the comparison function for the avl tree TREE. -(defun avl-tree-compare-function (tree) - "Return the comparison function for the avl tree TREE." - (avl-tree-cmpfun tree)) +\(fn TREE)") (defun avl-tree-empty (tree) "Return t if avl tree TREE is emtpy, otherwise return nil." - (null (avl-tree-root tree))) + (null (avl-tree--root tree))) (defun avl-tree-enter (tree data) "In the avl tree TREE insert DATA. Return DATA." - (avl-tree-do-enter (avl-tree-cmpfun tree) - (avl-tree-dummyroot tree) - 0 - data) + (avl-tree--do-enter (avl-tree--cmpfun tree) + (avl-tree--dummyroot tree) + 0 + data) data) (defun avl-tree-delete (tree data) "From the avl tree TREE, delete DATA. Return the element in TREE which matched DATA, nil if no element matched." - (avl-tree-do-delete (avl-tree-cmpfun tree) - (avl-tree-dummyroot tree) - 0 - data)) + (avl-tree--do-delete (avl-tree--cmpfun tree) + (avl-tree--dummyroot tree) + 0 + data)) (defun avl-tree-member (tree data) "Return the element in the avl tree TREE which matches DATA. @@ -451,82 +399,72 @@ Matching uses the compare function previously specified in `avl-tree-create' when TREE was created. If there is no such element in the tree, the value is nil." - (let ((node (avl-tree-root tree)) - (compare-function (avl-tree-cmpfun tree)) + (let ((node (avl-tree--root tree)) + (compare-function (avl-tree--cmpfun tree)) found) (while (and node (not found)) (cond - ((funcall compare-function data (avl-tree-node-data node)) - (setq node (avl-tree-node-left node))) - ((funcall compare-function (avl-tree-node-data node) data) - (setq node (avl-tree-node-right node))) + ((funcall compare-function data (avl-tree--node-data node)) + (setq node (avl-tree--node-left node))) + ((funcall compare-function (avl-tree--node-data node) data) + (setq node (avl-tree--node-right node))) (t (setq found t)))) (if node - (avl-tree-node-data node) + (avl-tree--node-data node) nil))) (defun avl-tree-map (__map-function__ tree) "Apply __MAP-FUNCTION__ to all elements in the avl tree TREE." - (avl-tree-mapc - (function (lambda (node) - (avl-tree-node-set-data - node (funcall __map-function__ - (avl-tree-node-data node))))) - (avl-tree-root tree))) + (avl-tree--mapc + (lambda (node) + (setf (avl-tree--node-data node) + (funcall __map-function__ (avl-tree--node-data node)))) + (avl-tree--root tree))) (defun avl-tree-first (tree) "Return the first element in TREE, or nil if TREE is empty." - (let ((node (avl-tree-root tree))) - (if node - (progn - (while (avl-tree-node-left node) - (setq node (avl-tree-node-left node))) - (avl-tree-node-data node)) - nil))) + (let ((node (avl-tree--root tree))) + (when node + (while (avl-tree--node-left node) + (setq node (avl-tree--node-left node))) + (avl-tree--node-data node)))) (defun avl-tree-last (tree) "Return the last element in TREE, or nil if TREE is empty." - (let ((node (avl-tree-root tree))) - (if node - (progn - (while (avl-tree-node-right node) - (setq node (avl-tree-node-right node))) - (avl-tree-node-data node)) - nil))) + (let ((node (avl-tree--root tree))) + (when node + (while (avl-tree--node-right node) + (setq node (avl-tree--node-right node))) + (avl-tree--node-data node)))) (defun avl-tree-copy (tree) "Return a copy of the avl tree TREE." - (let ((new-tree (avl-tree-create (avl-tree-cmpfun tree)))) - (avl-tree-node-set-left (avl-tree-dummyroot new-tree) - (avl-tree-do-copy (avl-tree-root tree))) + (let ((new-tree (avl-tree-create (avl-tree--cmpfun tree)))) + (setf (avl-tree--root new-tree) (avl-tree--do-copy (avl-tree--root tree))) new-tree)) (defun avl-tree-flatten (tree) "Return a sorted list containing all elements of TREE." (nreverse (let ((treelist nil)) - (avl-tree-mapc - (function (lambda (node) - (setq treelist (cons (avl-tree-node-data node) - treelist)))) - (avl-tree-root tree)) + (avl-tree--mapc + (lambda (node) (push (avl-tree--node-data node) treelist)) + (avl-tree--root tree)) treelist))) (defun avl-tree-size (tree) "Return the number of elements in TREE." (let ((treesize 0)) - (avl-tree-mapc - (function (lambda (data) - (setq treesize (1+ treesize)) - data)) - (avl-tree-root tree)) + (avl-tree--mapc + (lambda (data) (setq treesize (1+ treesize))) + (avl-tree--root tree)) treesize)) (defun avl-tree-clear (tree) "Clear the avl tree TREE." - (avl-tree-node-set-left (avl-tree-dummyroot tree) nil)) + (setf (avl-tree--root tree) nil)) (provide 'avl-tree) diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index f56f1c7c943..ccffdb1a164 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -103,6 +103,7 @@ ;; not good to call from Lisp) ;; `make-local' (dubious calls to ;; `make-variable-buffer-local') +;; `mapcar' (mapcar called for effect) ;; byte-compile-compatibility Whether the compiler should ;; generate .elc files which can be loaded into ;; generic emacs 18. @@ -340,7 +341,8 @@ If it is 'byte, then only byte-level optimizations will be logged." (defconst byte-compile-warning-types '(redefine callargs free-vars unresolved - obsolete noruntime cl-functions interactive-only) + obsolete noruntime cl-functions interactive-only + make-local mapcar) "The list of warning types used when `byte-compile-warnings' is t.") (defcustom byte-compile-warnings t "*List of warnings that the byte-compiler should issue (t for all). @@ -359,7 +361,8 @@ Elements of the list may be: distinguished from macros and aliases). interactive-only commands that normally shouldn't be called from Lisp code. - make-local calls to make-variable-buffer-local that may be incorrect." + make-local calls to make-variable-buffer-local that may be incorrect. + mapcar mapcar called for effect." :group 'bytecomp :type `(choice (const :tag "All" t) (set :menu-tag "Some" @@ -367,7 +370,7 @@ Elements of the list may be: (const callargs) (const redefine) (const obsolete) (const noruntime) (const cl-functions) (const interactive-only) - (const make-local)))) + (const make-local) (const mapcar)))) (put 'byte-compile-warnings 'safe-local-variable 'byte-compile-warnings-safe-p) ;;;###autoload (defun byte-compile-warnings-safe-p (x) @@ -378,7 +381,8 @@ Elements of the list may be: (when (memq e '(free-vars unresolved callargs redefine obsolete noruntime - cl-functions interactive-only make-local)) + cl-functions interactive-only + make-local mapcar)) e)) x) x)))) @@ -975,7 +979,7 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'." (pos (if (and byte-compile-current-file (integerp byte-compile-read-position)) (with-current-buffer byte-compile-current-buffer - (format "%d:%d:" + (format "%d:%d:" (save-excursion (goto-char byte-compile-last-position) (1+ (count-lines (point-min) (point-at-bol)))) @@ -1037,8 +1041,7 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'." (setq byte-compile-last-logged-file byte-compile-current-file byte-compile-last-warned-form nil) ;; Do this after setting default-directory. - (unless (eq major-mode 'compilation-mode) - (compilation-mode)) + (unless (derived-mode-p 'compilation-mode) (compilation-mode)) (compilation-forget-errors) pt)))) @@ -1552,7 +1555,7 @@ recompile every `.el' file that already has a `.elc' file." ;; compilation-mode copies value of default-directory. (unless (eq major-mode 'compilation-mode) (compilation-mode)) - (let ((directories (list (expand-file-name directory))) + (let ((directories (list default-directory)) (default-directory default-directory) (skip-count 0) (fail-count 0) @@ -1659,7 +1662,7 @@ The value is non-nil if there were no errors, nil if errors." byte-compile-dest-file) (setq target-file (byte-compile-dest-file filename)) (setq byte-compile-dest-file target-file) - (with-current-buffer + (with-current-buffer (setq input-buffer (get-buffer-create " *Compiler Input*")) (erase-buffer) (setq buffer-file-coding-system nil) @@ -2832,6 +2835,11 @@ That command is designed for interactive use only" fn)) (defun byte-compile-normal-call (form) (if byte-compile-generate-call-tree (byte-compile-annotate-call-tree form)) + (when (and for-effect (eq (car form) 'mapcar) + (memq 'mapcar byte-compile-warnings)) + (byte-compile-set-symbol-position 'mapcar) + (byte-compile-warn + "`mapcar' called for effect; use `mapc' or `dolist' instead")) (byte-compile-push-constant (car form)) (mapc 'byte-compile-form (cdr form)) ; wasteful, but faster. (byte-compile-out 'byte-call (length (cdr form)))) @@ -4237,18 +4245,18 @@ and corresponding effects." (assq 'byte-code (symbol-function 'byte-compile-form)) (let ((byte-optimize nil) ; do it fast (byte-compile-warnings nil)) - (mapcar (lambda (x) - (or noninteractive (message "compiling %s..." x)) - (byte-compile x) - (or noninteractive (message "compiling %s...done" x))) - '(byte-compile-normal-call - byte-compile-form - byte-compile-body - ;; Inserted some more than necessary, to speed it up. - byte-compile-top-level - byte-compile-out-toplevel - byte-compile-constant - byte-compile-variable-ref)))) + (mapc (lambda (x) + (or noninteractive (message "compiling %s..." x)) + (byte-compile x) + (or noninteractive (message "compiling %s...done" x))) + '(byte-compile-normal-call + byte-compile-form + byte-compile-body + ;; Inserted some more than necessary, to speed it up. + byte-compile-top-level + byte-compile-out-toplevel + byte-compile-constant + byte-compile-variable-ref)))) nil) (run-hooks 'bytecomp-load-hook) diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index e1835d75fcb..edbf382f39e 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -199,6 +199,12 @@ :group 'lisp :version "20.3") +(defcustom checkdoc-minor-mode-string " CDoc" + "*String to display in mode line when Checkdoc mode is enabled; nil for none." + :type '(choice string (const :tag "None" nil)) + :group 'checkdoc + :version "23.1") + (defcustom checkdoc-autofix-flag 'semiautomatic "Non-nil means attempt auto-fixing of doc strings. If this value is the symbol `query', then the user is queried before @@ -227,7 +233,7 @@ and that it's good but not required practice to make non user visible items have doc strings." :group 'checkdoc :type 'boolean) -(put 'checkdoc-force-docstrings-flag 'safe-local-variable 'booleanp) +;;;###autoload(put 'checkdoc-force-docstrings-flag 'safe-local-variable 'booleanp) (defcustom checkdoc-force-history-flag t "Non-nil means that files should have a History section or ChangeLog file. @@ -243,7 +249,7 @@ should be used when the first part could stand alone as a sentence, but it indicates that a modifying clause follows." :group 'checkdoc :type 'boolean) -(put 'checkdoc-permit-comma-termination-flag 'safe-local-variable 'booleanp) +;;;###autoload(put 'checkdoc-permit-comma-termination-flag 'safe-local-variable 'booleanp) (defcustom checkdoc-spellcheck-documentation-flag nil "Non-nil means run Ispell on text based on value. @@ -1251,7 +1257,7 @@ bound to \\<checkdoc-minor-mode-map>\\[checkdoc-eval-defun] and `checkdoc-eval-c checking of documentation strings. \\{checkdoc-minor-mode-map}" - nil " CDoc" nil + nil checkdoc-minor-mode-string nil :group 'checkdoc) ;;; Subst utils diff --git a/lisp/emacs-lisp/copyright.el b/lisp/emacs-lisp/copyright.el index b7e8c84cf27..77781ec390e 100644 --- a/lisp/emacs-lisp/copyright.el +++ b/lisp/emacs-lisp/copyright.el @@ -55,7 +55,7 @@ The second \\( \\) construct must match the years." (defcustom copyright-names-regexp "" "Regexp matching the names which correspond to the user. Only copyright lines where the name matches this regexp will be updated. -This allows you to avoid adding yars to a copyright notice belonging to +This allows you to avoid adding years to a copyright notice belonging to someone else or to a group for which you do not work." :group 'copyright :type 'regexp) @@ -184,10 +184,13 @@ interactively." either \\|; a\\^u eldono \\([0-9]+\\)a, ? a\\^u (la\\^u via \\)\ version \\([0-9]+\\), or (at" (copyright-limit) t) - (not (string= (match-string 3) copyright-current-gpl-version)) + ;; Don't update if the file is already using a more recent + ;; version than the "current" one. + (< (string-to-number (match-string 3)) + (string-to-number copyright-current-gpl-version)) (or noquery - (y-or-n-p (concat "Replace GPL version by " - copyright-current-gpl-version "? "))) + (y-or-n-p (format "Replace GPL version by %s? " + copyright-current-gpl-version))) (progn (if (match-end 2) ;; Esperanto bilingual comment in two-column.el diff --git a/lisp/emacs-lisp/cust-print.el b/lisp/emacs-lisp/cust-print.el index 54ead36e725..fdfb4f11113 100644 --- a/lisp/emacs-lisp/cust-print.el +++ b/lisp/emacs-lisp/cust-print.el @@ -244,14 +244,14 @@ Any pair that has the same PREDICATE is first removed." ;; Save emacs routines. (if (not (fboundp 'cust-print-original-prin1)) - (mapcar 'cust-print-set-function-cell - '((cust-print-original-prin1 prin1) - (cust-print-original-princ princ) - (cust-print-original-print print) - (cust-print-original-prin1-to-string prin1-to-string) - (cust-print-original-format format) - (cust-print-original-message message) - (cust-print-original-error error)))) + (mapc 'cust-print-set-function-cell + '((cust-print-original-prin1 prin1) + (cust-print-original-princ princ) + (cust-print-original-print print) + (cust-print-original-prin1-to-string prin1-to-string) + (cust-print-original-format format) + (cust-print-original-message message) + (cust-print-original-error error)))) (defun custom-print-install () @@ -259,29 +259,29 @@ Any pair that has the same PREDICATE is first removed." The Emacs subroutines are saved away, and you can reinstall them by running `custom-print-uninstall'." (interactive) - (mapcar 'cust-print-set-function-cell - '((prin1 custom-prin1) - (princ custom-princ) - (print custom-print) - (prin1-to-string custom-prin1-to-string) - (format custom-format) - (message custom-message) - (error custom-error) - )) + (mapc 'cust-print-set-function-cell + '((prin1 custom-prin1) + (princ custom-princ) + (print custom-print) + (prin1-to-string custom-prin1-to-string) + (format custom-format) + (message custom-message) + (error custom-error) + )) t) (defun custom-print-uninstall () "Reset print functions to their Emacs subroutines." (interactive) - (mapcar 'cust-print-set-function-cell - '((prin1 cust-print-original-prin1) - (princ cust-print-original-princ) - (print cust-print-original-print) - (prin1-to-string cust-print-original-prin1-to-string) - (format cust-print-original-format) - (message cust-print-original-message) - (error cust-print-original-error) - )) + (mapc 'cust-print-set-function-cell + '((prin1 cust-print-original-prin1) + (princ cust-print-original-princ) + (print cust-print-original-print) + (prin1-to-string cust-print-original-prin1-to-string) + (format cust-print-original-format) + (message cust-print-original-message) + (error cust-print-original-error) + )) t) (defalias 'custom-print-funcs-installed-p 'custom-print-installed-p) diff --git a/lisp/emacs-lisp/disass.el b/lisp/emacs-lisp/disass.el index 01378a7f8d6..60b29bdb949 100644 --- a/lisp/emacs-lisp/disass.el +++ b/lisp/emacs-lisp/disass.el @@ -250,7 +250,7 @@ OBJ should be a call to BYTE-CODE generated by the byte compiler." (+ indent disassemble-recursive-indent))) ((eq (car-safe (car-safe arg)) 'byte-code) (insert "(<byte code>...)\n") - (mapcar ;recurse on list of byte-code objects + (mapc ;recurse on list of byte-code objects '(lambda (obj) (disassemble-1 obj diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index 80d1625ec9b..da0b76808d5 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el @@ -139,8 +139,8 @@ For example, you could write (setq body (list* lighter keymap body) lighter nil keymap nil)) ((keywordp keymap) (push keymap body) (setq keymap nil))) - (let* ((last-message (current-message)) - (mode-name (symbol-name mode)) + (let* ((last-message (make-symbol "last-message")) + (mode-name (symbol-name mode)) (pretty-name (easy-mmode-pretty-mode-name mode lighter)) (globalp nil) (set nil) @@ -222,28 +222,30 @@ With zero or negative ARG turn mode off. ;; Use `toggle' rather than (if ,mode 0 1) so that using ;; repeat-command still does the toggling correctly. (interactive (list (or current-prefix-arg 'toggle))) - (setq ,mode - (cond - ((eq arg 'toggle) (not ,mode)) - (arg (> (prefix-numeric-value arg) 0)) - (t - (if (null ,mode) t - (message - "Toggling %s off; better pass an explicit argument." - ',mode) - nil)))) - ,@body - ;; The on/off hooks are here for backward compatibility only. - (run-hooks ',hook (if ,mode ',hook-on ',hook-off)) - (if (called-interactively-p) - (progn - ,(if globalp `(customize-mark-as-set ',mode)) - ;; Avoid overwriting a message shown by the body, - ;; but do overwrite previous messages. - (unless ,(and (current-message) - (not (equal last-message (current-message)))) - (message ,(format "%s %%sabled" pretty-name) - (if ,mode "en" "dis"))))) + (let ((,last-message (current-message))) + (setq ,mode + (cond + ((eq arg 'toggle) (not ,mode)) + (arg (> (prefix-numeric-value arg) 0)) + (t + (if (null ,mode) t + (message + "Toggling %s off; better pass an explicit argument." + ',mode) + nil)))) + ,@body + ;; The on/off hooks are here for backward compatibility only. + (run-hooks ',hook (if ,mode ',hook-on ',hook-off)) + (if (called-interactively-p) + (progn + ,(if globalp `(customize-mark-as-set ',mode)) + ;; Avoid overwriting a message shown by the body, + ;; but do overwrite previous messages. + (unless (and (current-message) + (not (equal ,last-message + (current-message)))) + (message ,(format "%s %%sabled" pretty-name) + (if ,mode "en" "dis")))))) (force-mode-line-update) ;; Return the new setting. ,mode) @@ -456,7 +458,7 @@ ARGS is a list of additional keyword arguments." (let ((char (car cs)) (syntax (cdr cs))) (if (sequencep char) - (mapcar (lambda (c) (modify-syntax-entry c syntax st)) char) + (mapc (lambda (c) (modify-syntax-entry c syntax st)) char) (modify-syntax-entry char syntax st)))) (if parent (set-char-table-parent st (if (symbolp parent) (symbol-value parent) parent))) @@ -539,5 +541,5 @@ found, do `widen' first and then call NARROWFUN with no args after moving." (provide 'easy-mmode) -;;; arch-tag: d48a5250-6961-4528-9cb0-3c9ea042a66a +;; arch-tag: d48a5250-6961-4528-9cb0-3c9ea042a66a ;;; easy-mmode.el ends here diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index 964688894af..01d883d63be 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -4421,7 +4421,7 @@ With prefix argument, make it a temporary breakpoint." (defun byte-compile-resolve-functions (funcs) "Say it is OK for the named functions to be unresolved." - (mapcar + (mapc (function (lambda (func) (setq byte-compile-unresolved-functions diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el index 1d2441f884a..7807fc763a4 100644 --- a/lisp/emacs-lisp/eldoc.el +++ b/lisp/emacs-lisp/eldoc.el @@ -109,7 +109,7 @@ truncated to make more of the arglist or documentation string visible." ;;; No user options below here. (defvar eldoc-message-commands-table-size 31 - "This is used by eldoc-add-command to initialize eldoc-message-commands + "This is used by `eldoc-add-command' to initialize `eldoc-message-commands' as an obarray. It should probably never be necessary to do so, but if you choose to increase the number of buckets, you must do so before loading @@ -121,7 +121,7 @@ Remember to keep it a prime number to improve hash performance.") "Commands after which it is appropriate to print in the echo area. Eldoc does not try to print function arglists, etc. after just any command, because some commands print their own messages in the echo area and these -functions would instantly overwrite them. But self-insert-command as well +functions would instantly overwrite them. But `self-insert-command' as well as most motion commands are good candidates. This variable contains an obarray of symbols; do not manipulate it directly. Instead, use `eldoc-add-command' and `eldoc-remove-command'.") @@ -137,7 +137,7 @@ directly. Instead, use `eldoc-add-command' and `eldoc-remove-command'.") (defvar eldoc-timer nil "eldoc's timer object.") (defvar eldoc-current-idle-delay eldoc-idle-delay - "idle time delay currently in use by timer. + "Idle time delay currently in use by timer. This is used to determine if `eldoc-idle-delay' is changed by the user.") @@ -474,13 +474,14 @@ ARGLIST is either a string, or a list of strings or symbols." (format "(%s)" arglist))) (defun eldoc-function-argstring-format (argstring) - "Apply `eldoc-argument-case' to each word in argstring. + "Apply `eldoc-argument-case' to each word in ARGSTRING. The words \"&rest\", \"&optional\" are returned unchanged." (mapconcat (lambda (s) (if (member s '("&optional" "&rest")) s (funcall eldoc-argument-case s))) - (split-string argstring) " ")) + (split-string argstring "[][ ()]+" t) " ")) + ;; When point is in a sexp, the function args are not reprinted in the echo ;; area after every possible interactive command because some of them print diff --git a/lisp/emacs-lisp/elint.el b/lisp/emacs-lisp/elint.el index f9bff300293..0501fbf171e 100644 --- a/lisp/emacs-lisp/elint.el +++ b/lisp/emacs-lisp/elint.el @@ -218,7 +218,7 @@ This environment can be passed to `macroexpand'." (buffer-file-name) (buffer-name)))) (elint-display-log) - (mapcar 'elint-top-form (elint-update-env)) + (mapc 'elint-top-form (elint-update-env)) ;; Tell the user we're finished. This is terribly klugy: we set ;; elint-top-form-logged so elint-log-message doesn't print the @@ -542,11 +542,11 @@ CODE can be a lambda expression, a macro, or byte-compiled code." (defun elint-check-defun-form (form env) "Lint a defun/defmacro/lambda FORM in ENV." (setq form (if (eq (car form) 'lambda) (cdr form) (cdr (cdr form)))) - (mapcar (function (lambda (p) - (or (memq p '(&optional &rest)) - (setq env (elint-env-add-var env p))) - )) - (car form)) + (mapc (function (lambda (p) + (or (memq p '(&optional &rest)) + (setq env (elint-env-add-var env p))) + )) + (car form)) (elint-forms (cdr form) env)) (defun elint-check-let-form (form env) @@ -566,21 +566,21 @@ CODE can be a lambda expression, a macro, or byte-compiled code." ;; Add variables to environment, and check the init values (let ((newenv env)) - (mapcar (function (lambda (s) - (cond - ((symbolp s) - (setq newenv (elint-env-add-var newenv s))) - ((and (consp s) (<= (length s) 2)) - (elint-form (car (cdr s)) - (if (eq (car form) 'let) - env - newenv)) - (setq newenv - (elint-env-add-var newenv (car s)))) - (t (elint-error - "Malformed `let' declaration: %s" s)) - ))) - varlist) + (mapc (function (lambda (s) + (cond + ((symbolp s) + (setq newenv (elint-env-add-var newenv s))) + ((and (consp s) (<= (length s) 2)) + (elint-form (car (cdr s)) + (if (eq (car form) 'let) + env + newenv)) + (setq newenv + (elint-env-add-var newenv (car s)))) + (t (elint-error + "Malformed `let' declaration: %s" s)) + ))) + varlist) ;; Lint the body forms (elint-forms (cdr (cdr form)) newenv) @@ -665,18 +665,18 @@ CODE can be a lambda expression, a macro, or byte-compiled code." errlist) (while errforms (setq errlist (car (car errforms))) - (mapcar (function (lambda (s) - (or (get s 'error-conditions) - (get s 'error-message) - (elint-warning - "Not an error symbol in error handler: %s" s)))) - (cond - ((symbolp errlist) (list errlist)) - ((listp errlist) errlist) - (t (elint-error "Bad error list in error handler: %s" - errlist) - nil)) - ) + (mapc (function (lambda (s) + (or (get s 'error-conditions) + (get s 'error-message) + (elint-warning + "Not an error symbol in error handler: %s" s)))) + (cond + ((symbolp errlist) (list errlist)) + ((listp errlist) errlist) + (t (elint-error "Bad error list in error handler: %s" + errlist) + nil)) + ) (elint-forms (cdr (car errforms)) newenv) (setq errforms (cdr errforms)) ))) @@ -767,11 +767,11 @@ Insert HEADER followed by a blank line if non-nil." (defun elint-initialize () "Initialize elint." (interactive) - (mapcar (function (lambda (x) - (or (not (symbolp (car x))) - (eq (cdr x) 'unknown) - (put (car x) 'elint-args (cdr x))))) - (elint-find-builtin-args)) + (mapc (function (lambda (x) + (or (not (symbolp (car x))) + (eq (cdr x) 'unknown) + (put (car x) 'elint-args (cdr x))))) + (elint-find-builtin-args)) (mapcar (function (lambda (x) (put (car x) 'elint-args (cdr x)))) elint-unknown-builtin-args)) diff --git a/lisp/emacs-lisp/elp.el b/lisp/emacs-lisp/elp.el index ed09599f4dd..ade2a23608d 100644 --- a/lisp/emacs-lisp/elp.el +++ b/lisp/emacs-lisp/elp.el @@ -615,7 +615,7 @@ displayed." ;; buffer (if elp-sort-by-function (setq resvec (sort resvec elp-sort-by-function))) - (mapcar 'elp-output-result resvec)) + (mapc 'elp-output-result resvec)) ;; now pop up results buffer (set-buffer curbuf) (pop-to-buffer resultsbuf) diff --git a/lisp/emacs-lisp/generic.el b/lisp/emacs-lisp/generic.el index f041de2b1dc..99016d7c43a 100644 --- a/lisp/emacs-lisp/generic.el +++ b/lisp/emacs-lisp/generic.el @@ -205,7 +205,7 @@ See the file generic-x.el for some examples of `define-generic-mode'." (setq font-lock-defaults '(generic-font-lock-keywords)) ;; Call a list of functions - (mapcar 'funcall function-list) + (mapc 'funcall function-list) (run-mode-hooks mode-hook))) diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index b6f6a450791..7eeefd349a9 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -261,7 +261,6 @@ (defvar lisp-mode-shared-map (let ((map (make-sparse-keymap))) - (define-key map "\t" 'lisp-indent-line) (define-key map "\e\C-q" 'indent-sexp) (define-key map "\177" 'backward-delete-char-untabify) ;; This gets in the way when viewing a Lisp file in view-mode. As @@ -785,8 +784,13 @@ which see." (let ((comment-start nil) (comment-start-skip nil)) (do-auto-fill)))))) -(defvar lisp-indent-offset nil - "If non-nil, indent second line of expressions that many more columns.") +(defcustom lisp-indent-offset nil + "If non-nil, indent second line of expressions that many more columns." + :group 'lisp + :type '(choice nil integer)) +(put 'lisp-body-indent 'safe-local-variable + (lambda (x) (or (null x) (integerp x)))) + (defvar lisp-indent-function 'lisp-indent-function) (defun lisp-indent-line (&optional whole-exp) @@ -1026,8 +1030,11 @@ This function also returns nil meaning don't specify the indentation." (method (funcall method indent-point state))))))) -(defvar lisp-body-indent 2 - "Number of columns to indent the second line of a `(def...)' form.") +(defcustom lisp-body-indent 2 + "Number of columns to indent the second line of a `(def...)' form." + :group 'lisp + :type 'integer) +(put 'lisp-body-indent 'safe-local-variable 'integerp) (defun lisp-indent-specform (count state indent-point normal-indent) (let ((containing-form-start (elt state 1)) diff --git a/lisp/emacs-lisp/re-builder.el b/lisp/emacs-lisp/re-builder.el index d859066c452..a0004be2394 100644 --- a/lisp/emacs-lisp/re-builder.el +++ b/lisp/emacs-lisp/re-builder.el @@ -515,7 +515,7 @@ optional fourth argument FORCE is non-nil." "Delete all RE Builder overlays in the `reb-target-buffer' buffer." (if (buffer-live-p reb-target-buffer) (with-current-buffer reb-target-buffer - (mapcar 'delete-overlay reb-overlays) + (mapc 'delete-overlay reb-overlays) (setq reb-overlays nil)))) (defun reb-assert-buffer-in-window () diff --git a/lisp/emacs-lisp/regi.el b/lisp/emacs-lisp/regi.el index ed3f846bf0e..267d7731435 100644 --- a/lisp/emacs-lisp/regi.el +++ b/lisp/emacs-lisp/regi.el @@ -166,7 +166,7 @@ useful information: ;; lets find the special tags and remove them from the working ;; frame. note that only the last special tag is used. - (mapcar + (mapc (function (lambda (entry) (let ((pred (car entry)) diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el index ae150078785..f46aea8540a 100644 --- a/lisp/emacs-lisp/rx.el +++ b/lisp/emacs-lisp/rx.el @@ -679,7 +679,7 @@ CHAR `not-newline', `nonl' matches any character except a newline. - . + `anything' matches any character diff --git a/lisp/emacs-lisp/sregex.el b/lisp/emacs-lisp/sregex.el index 901156cefc3..d4deb0f9101 100644 --- a/lisp/emacs-lisp/sregex.el +++ b/lisp/emacs-lisp/sregex.el @@ -565,7 +565,7 @@ has one of the following forms: (let ((chars (make-bool-vector 256 nil))) ; Yeah, right! (dolist (arg args) (cond ((integerp arg) (aset chars arg t)) - ((stringp arg) (mapcar (lambda (c) (aset chars c t)) arg)) + ((stringp arg) (mapc (lambda (c) (aset chars c t)) arg)) ((consp arg) (let ((start (car arg)) (end (cdr arg))) diff --git a/lisp/emulation/cua-base.el b/lisp/emulation/cua-base.el index 98a9b4d6361..fbb39ee66d3 100644 --- a/lisp/emulation/cua-base.el +++ b/lisp/emulation/cua-base.el @@ -911,6 +911,7 @@ If global mark is active, copy from register or one character." ;; That would make yank a no-op. (if (and (string= (filter-buffer-substring (point) (mark)) (car kill-ring)) + (fboundp 'mouse-region-match) (mouse-region-match)) (current-kill 1)) (cua-delete-region))) @@ -1233,9 +1234,9 @@ If ARG is the atom `-', scroll upward by nearly full screen." (memq 'shift (event-modifiers (aref (this-single-command-keys) 0))) ;; See if raw escape sequence maps to a shifted event, e.g. S-up or C-S-home. - (and (boundp 'function-key-map) - function-key-map - (let ((ev (lookup-key function-key-map + (and (boundp 'local-function-key-map) + local-function-key-map + (let ((ev (lookup-key local-function-key-map (this-single-command-raw-keys)))) (and (vector ev) (symbolp (setq ev (aref ev 0))) diff --git a/lisp/emulation/cua-rect.el b/lisp/emulation/cua-rect.el index 226f696dad2..5c4bc011464 100644 --- a/lisp/emulation/cua-rect.el +++ b/lisp/emulation/cua-rect.el @@ -731,7 +731,7 @@ If command is repeated at same position, delete the rectangle." (defun cua--deactivate-rectangle () ;; This is used to clean up after `cua--activate-rectangle'. - (mapcar (function delete-overlay) cua--rectangle-overlays) + (mapc (function delete-overlay) cua--rectangle-overlays) (setq cua--last-rectangle (cons (current-buffer) (cons (point) ;; cua-save-point cua--rectangle)) @@ -837,7 +837,7 @@ If command is repeated at same position, delete the rectangle." (overlay-put overlay 'window (selected-window)) (setq new (cons overlay new)))))) ;; Trim old trailing overlays. - (mapcar (function delete-overlay) old) + (mapc (function delete-overlay) old) (setq cua--rectangle-overlays (nreverse new)))) (defun cua--indent-rectangle (&optional ch to-col clear) @@ -1401,7 +1401,7 @@ With prefix arg, indent to that column." (cua--deactivate-rectangle)) (when cua--rectangle-overlays ;; clean-up after revert-buffer - (mapcar (function delete-overlay) cua--rectangle-overlays) + (mapc (function delete-overlay) cua--rectangle-overlays) (setq cua--rectangle-overlays nil) (setq deactivate-mark t))) (when cua--rect-undo-set-point diff --git a/lisp/emulation/viper-keym.el b/lisp/emulation/viper-keym.el index ac7231a3cac..0e502720f5e 100644 --- a/lisp/emulation/viper-keym.el +++ b/lisp/emulation/viper-keym.el @@ -170,7 +170,7 @@ Enter as a sexp. Examples: \"\\C-z\", [(control ?z)]." (let ((old-value (if (boundp 'viper-toggle-key) viper-toggle-key [(control ?z)]))) - (mapcar + (mapc (lambda (buf) (save-excursion (set-buffer buf) @@ -210,7 +210,7 @@ If running in a terminal, [(escape)] is not understood, so must use \"\\e\"." (let ((old-value (if (boundp 'viper-ESC-key) viper-ESC-key [(escape)]))) - (mapcar + (mapc (lambda (buf) (save-excursion (set-buffer buf) diff --git a/lisp/emulation/viper-macs.el b/lisp/emulation/viper-macs.el index ff046601a1b..bf3f0eefb39 100644 --- a/lisp/emulation/viper-macs.el +++ b/lisp/emulation/viper-macs.el @@ -466,7 +466,7 @@ If SCOPE is nil, the user is asked to specify the scope." (viper-array-to-string macro-name))) (setq lis2 (cons (car lis) lis2)) (setq lis (cdr lis))) - + (setq lis2 (reverse lis2)) (set macro-alist-var (append lis2 (cons new-elt lis))) (setq old-elt new-elt))) @@ -658,9 +658,9 @@ name from there." (interactive) (with-output-to-temp-buffer " *viper-info*" (princ "Macros in Vi state:\n===================\n") - (mapcar 'viper-describe-one-macro viper-vi-kbd-macro-alist) + (mapc 'viper-describe-one-macro viper-vi-kbd-macro-alist) (princ "\n\nMacros in Insert and Replace states:\n====================================\n") - (mapcar 'viper-describe-one-macro viper-insert-kbd-macro-alist) + (mapc 'viper-describe-one-macro viper-insert-kbd-macro-alist) (princ "\n\nMacros in Emacs state:\n======================\n") (mapcar 'viper-describe-one-macro viper-emacs-kbd-macro-alist) )) @@ -670,11 +670,11 @@ name from there." (viper-display-macro (car macro)))) (princ " ** Buffer-specific:") (if (viper-kbd-buf-alist macro) - (mapcar 'viper-describe-one-macro-elt (viper-kbd-buf-alist macro)) + (mapc 'viper-describe-one-macro-elt (viper-kbd-buf-alist macro)) (princ " none\n")) (princ "\n ** Mode-specific:") (if (viper-kbd-mode-alist macro) - (mapcar 'viper-describe-one-macro-elt (viper-kbd-mode-alist macro)) + (mapc 'viper-describe-one-macro-elt (viper-kbd-mode-alist macro)) (princ " none\n")) (princ "\n ** Global:") (if (viper-kbd-global-definition macro) diff --git a/lisp/emulation/viper-util.el b/lisp/emulation/viper-util.el index eebf09aed22..7073cd019dd 100644 --- a/lisp/emulation/viper-util.el +++ b/lisp/emulation/viper-util.el @@ -1260,9 +1260,9 @@ Arguments become related buffers. This function should normally be used in the `Local variables' section of a file." (setq viper-related-files-and-buffers-ring (make-ring (1+ (length other-files-or-buffers)))) - (mapcar '(lambda (elt) - (viper-ring-insert viper-related-files-and-buffers-ring elt)) - other-files-or-buffers) + (mapc '(lambda (elt) + (viper-ring-insert viper-related-files-and-buffers-ring elt)) + other-files-or-buffers) (viper-ring-insert viper-related-files-and-buffers-ring (buffer-name)) ) diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el index ff3217ac144..c0118250167 100644 --- a/lisp/emulation/viper.el +++ b/lisp/emulation/viper.el @@ -799,7 +799,7 @@ It also can't undo some Viper settings." ;; set appropriate Viper state in buffers that changed major mode (defun set-viper-state-in-major-mode () - (mapcar + (mapc (lambda (buf) (if (viper-buffer-live-p buf) (with-current-buffer buf diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index 43f4c230d14..f262a6324fb 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog @@ -1,26 +1,346 @@ +2007-09-18 Exal de Jesus Garcia Carrillo <exal@gmx.de> (tiny change) + + * erc.texi (Special-Features): Fix small typo. + +2007-09-16 Michael Olson <mwolson@gnu.org> + + * erc-track.el (erc-track-switch-direction): Mention + erc-track-faces-priority-list. Thanks to Leo for the suggestion. + +2007-09-11 Exal de Jesus Garcia Carrillo <exal@gnu.org> (tiny change) + + * erc-sound.el: Fix typo in setting up instructions. + +2007-09-10 Michael Olson <mwolson@gnu.org> + + * Makefile (elpa): Copy dir template rather than echoing a few + lines. The reason for this is that the ELPA package for ERC was + getting a corrupt dir entry. + + * dir-template: Template for the ELPA dir file. + +2007-09-08 Michael Olson <mwolson@gnu.org> + + * erc-log.el (erc-log-filter-function): New option that specifies + the function to call for filtering text before writing it to a log + file. Thanks to David O'Toole for the suggestion. + (erc-save-buffer-in-logs): Use erc-log-filter-function. Make sure + we carry along the value of coding-system-for-write, because this + could potentially be shadowed by the temporary buffer. + + * erc.el (erc-version-string): Update to 5.3, development version. + +2007-09-07 Glenn Morris <rgm@gnu.org> + + * erc.el (erc-toggle-debug-irc-protocol): Fix call to + erc-view-mode-enter. + 2007-08-08 Glenn Morris <rgm@gnu.org> * erc-log.el, erc.el: Replace `iff' in doc-strings and comments. +2007-09-03 Michael Olson <mwolson@gnu.org> + + * erc.el (erc-default-port): Make this an integer value rather + than a string. Thanks to Luca Capello for the report. + +2007-08-27 Michael Olson <mwolson@gnu.org> + + * erc.el (erc-cmd-GQUIT): If erc-kill-queries-on-quit is non-nil, + kill all query buffers after 4 seconds. + +2007-08-16 Michael Olson <mwolson@gnu.org> + + * NEWS: Add ERC 5.3 changes section, and mention jbms' erc-track + compatibility note. + + * erc-track.el (erc-track-list-changed-hook): Turn this into a + customizable option. + (erc-track-switch-direction): Add 'importance option. + (erc-modified-channels-display): If erc-track-switch-direction is + 'importance, call erc-track-sort-by-importance. + (erc-track-face-priority): New function that returns a number + indicating the position of a face in + erc-track-faces-priority-list. + (erc-track-sort-by-importance): New function that sorts + erc-modified-channels-list according to erc-track-face-priority. + (erc-track-get-active-buffer): Make 'oldest a rough opposite of + 'importance. + +2007-08-14 Jeremy Maitin-Shepard <jbms@cmu.edu> + + * erc-track.el (erc-track-remove-disconnected-buffers): New + variable which controls whether buffers associated with a server + that is disconnected should be removed from + `erc-modified-channels-alist'. Existing behavior is to + unconditionally remove such buffers, which is achieved by setting + `erc-track-removed-disconnected-buffers' to t. When set to t, + which is the new default value, such buffers remain in the list, + which I think is often the desired behavior, since the user may + likely wish to find out about activity that occurred in a channel + prior to it being disconnected. + (erc-track-list-changed-hook): New hook that is run whenever the + contents of `erc-modified-channels-alist' changes; it is useful + for users such as myself that don't use the default mode-line + notification but instead use a separate mechanism (which is tied + to my window manager) to provide notification of channel activity. + (erc-track-get-buffer-window): New function that acts as a wrapper + around `get-buffer-window' that handles the `selected-visible' + option of `erc-track-visibility'; previously, the value of + `erc-track-visibility' was passed directly to `get-buffer-window', + which does not support `selected-visible'; consequently, + `selected-visible' was not properly supported. + (erc-track-modified-channels): Fix a bug in the logic for removing + buffers from the list in certain cases. + (erc-track-position-in-mode-line): Add a supported value that + specifies that the tracking information should not be added to the + mode line at all. The value of nil is used to indicate that the + information should not be added at all to the mode line. + (erc-track-add-to-mode-line): Check for position eq to t, rather + than non-nil. + (erc-buffer-visible): Use erc-track-get-buffer-window. + (erc-modified-channels-update): Take + erc-track-remove-disconnected-buffers into account. + (erc-modified-channels-display): Run + `erc-track-list-changed-hook'. + + * erc.el (erc-reuse-frames): New option that determines whether + new frames are always created. Defaults to t. This only has an + effect when erc-join-buffer is set to 'frame. + (erc-setup-buffer): Use it. + +2007-08-14 Michael Olson <mwolson@gnu.org> + + * erc-backend.el (erc-server-reconnect): If the server buffer has + been killed, use the current buffer instead. If the current + buffer is not an ERC buffer, give an error. This fixes a bug when + /reconnect is run from a channel buffer whose server buffer has + been deleted. Thanks to jbms for the report. + (erc-process-sentinel-1): Take server buffer as an argument, so + that we can make sure that it is current. + (erc-process-sentinel): Pass buffer to erc-process-sentinel-1. + (erc-process-sentinel-2): New function split from + erc-process-sentinel-1. If server buffer is deleted during a + reconnect attempt, stop trying to reconnect. Fix bug where + reconnect was not happening when erc-server-reconnect-attempts was + t. Call erc-server-reconnect-p only once each time. If we are + instructed to try connecting indefinitely, tell the user that they + can stop this by killing the server buffer. Call the process + sentinel by means of run-at-time, so that there is time to kill + the buffer if need be; this also removes the need for a while + loop. Refuse to reconnect again if erc-server-reconnect-timeout + is not an number. + + * erc.el (erc-command-no-process-p): Fix bug: the return value of + erc-extract-command-from-line is a list rather than a single + symbol. Thanks to jbms for the report. + (erc-cmd-RECONNECT): Use simpler logic, and use buffer-live-p + rather than bufferp. + (erc-send-current-line, erc-display-command, erc-display-msg): + Handle case where erc-server-process is nil, so that /reconnect + works. + +2007-08-12 Michael Olson <mwolson@gnu.org> + + * erc-identd.el (erc-identd-filter): Instead of sending an EOF + character, which now confuses freenode, stop the server process, + so that no new connections are accepted, and kill the current + client process. + 2007-07-30 Michael Olson <mwolson@gnu.org> * erc-nicklist.el: Remove from the Emacs source tree. This file is not release quality, and relies heavily on a module which cannot be distributed with ERC due to licensing reasons. +2007-07-29 Michael Olson <mwolson@gnu.org> + + * erc-list.el: Relicense to GPLv3. Since the file was already + licensed under version 2 or later, it turns out that we do not + need the permission of all of the authors in order to proceed. + 2007-07-25 Glenn Morris <rgm@gnu.org> * Relicense all FSF files to GPLv3 or later. +2007-07-13 Michael Olson <mwolson@gnu.org> + + * erc-goodies.el (erc-get-bg-color-face, erc-get-fg-color-face): + Use erc-error rather than message and beep. + + * erc-sound.el: Indentation fix. + + * erc.el (erc-command-no-process-p): New function that determines + if its argument is an ERC command that can be run when the server + process is not alive. + (erc-cmd-SET, erc-cmd-CLEAR, erc-cmd-COUNTRY, erc-cmd-HELP) + (erc-cmd-LASTLOG, erc-cmd-QUIT, erc-cmd-GQUIT) + (erc-cmd-RECONNECT, erc-cmd-SERVER): Denote that these commands + can be run even when the server process is not alive. + (erc-send-current-line): Call erc-command-no-process-p if the + server process is not alive, to determine if we have a command + that can be run anyway. Thanks to Tom Tromey for the bug report. + (erc-error): New function that either displays a message or throws + an error, depending on whether debug-on-error is non-nil. + (erc-cmd-SERVER, erc-send-current-line): Use it. + +2007-07-10 Michael Olson <mwolson@gnu.org> + + * Relicense all FSF-assigned code to GPLv3. + +2007-06-25 Michael Olson <mwolson@gnu.org> + + * erc.texi (Options): Fix typo. + (Getting Help and Reporting Bugs): Update webpage URL. Make Gmane + part more readable. + +2007-06-20 Michael Olson <mwolson@gnu.org> + + * erc-stamp.el (erc-timestamp-format-left): New option that + specifies the left timestamp to use for + erc-insert-timestamp-left-and-right. + (erc-timestamp-format-right): New option that specifies the right + timestamp to use for erc-insert-timestamp-left-and-right. + (erc-insert-timestamp-function): Change default to + erc-insert-timestamp-left-and-right. + (erc-insert-away-timestamp-function): Ditto. + (erc-timestamp-last-inserted-left) + (erc-timestamp-last-inserted-right): New variables to keep track + of data for erc-insert-timestamp-left-and-right. + (erc-insert-timestamp-left-and-right): New function that places + timestamps on both the left and right sides of the screen, but + only if each timestamp has changed since it was last computed. + Thanks to offby1 for urging me to merge this. + + * erc.el (erc-open-ssl-stream): Display informative error when + ssl.el not found. + (erc-tls): New function to connect using tls.el. + (erc-open-tls-stream): New function to initiate tls connection. + Display informative error when tls.el not found. + +2007-06-19 Michael Olson <mwolson@gnu.org> + + * erc-log.el: Update header with accurate instructions. + +2007-06-17 Michael Olson <mwolson@gnu.org> + + * erc-pkg.el: Update description to match what is currently in + ELPA. + 2007-06-14 Juanma Barranquero <lekktu@gmail.com> * erc-goodies.el (erc-scroll-to-bottom): Remove redundant check. +2007-06-13 Michael Olson <mwolson@gnu.org> + + * erc-compat.el (erc-with-selected-window): New compatibility + macro that implements `with-selected-window'. + + * erc-goodies.el (erc-scroll-to-bottom): Use it. This fixes a bug + with buffer ordering where ERC buffers would move to the top. + Thanks to Ivan Kanis for the patch. + +2007-06-10 Michael Olson <mwolson@gnu.org> + + * erc-log.el (erc-logging-enabled): Fix a bug that occurred when + `erc-log-channels-directory' had the name of a function. + 2007-06-06 Juanma Barranquero <lekktu@gmail.com> * erc.el (erc-show-channel-key-p, erc-startup-file-list): Fix typo in docstring. +2007-06-03 Michael Olson <mwolson@gnu.org> + + * erc-compat.el (erc-view-mode-enter): Make this its own function, + in order to document what we do, and provide sane fallback + behavior. + + * erc.el (erc-toggle-debug-irc-protocol): Don't pass any arguments + to erc-view-mode-enter, since we don't do anything special with + the exit function. This fixes a bug with Emacs 21 and Emacs 22. + Thanks to Leo for noticing. + +2007-05-30 Michael Olson <mwolson@gnu.org> + + * erc-compat.el (erc-user-emacs-directory): New variable that + determines where to find user-specific Emacs settings. For Emacs, + this is usually ~/.emacs.d, and for XEmacs this is usually + ~/.xemacs. + + * erc.el (erc-startup-file-list): Use erc-user-emacs-directory. + +2007-05-28 Michael Olson <mwolson@gnu.org> + + * erc-button.el (erc-button-url-regexp): Recognize parentheses as + part of URLs. Thanks to Lawrence Mitchell for the fix. + +2007-05-26 Michael Olson <mwolson@gnu.org> + + * erc.texi (Modules): Fix references to completion modules. + +2007-05-21 Michael Olson <mwolson@gnu.org> + + * Makefile (SOURCE): Remove erc-pkg.el. + (debclean): New rule to clean old Debian packages of ERC. + (debprepare): Don't modify the released tarball, but copy it as + the .orig.tar.gz file. + (debrelease. debrevision): Remove. + (debinstall): New target that copies the generated Debian file to + a distro-specific location. + (deb): New rule that chains together the stages in building a + Debian package. + (EXTRAS): Add erc-nicklist.el, since it is not release-quality. + (extras): Copy images directory. + + * erc-nicklist.el (erc-nicklist-icons-directory): Use + locate-library to find the "images" directory. This should be + more failsafe. Thanks to Tom Tromey for the idea. + +2007-05-19 Michael Olson <mwolson@gnu.org> + + * Makefile (ELPA): New variable that contains the location of my + local ELPA repository. + (elpa): New rule that makes an ELPA package for ERC. + +2007-04-19 Michael Olson <mwolson@gnu.org> + + * erc.el (erc-parse-prefix): New function that retrieves the + PREFIX server parameter from the current server and returns an + alist of prefix type to prefix character. + (erc-channel-receive-names): Use `erc-parse-prefix' to determine + whether the first character of a nick is a prefix character or + not. This should fix a bug reported by bromine about needing to + type "%" first to complete nicks of people who are "hops" on + Slashnet. This should also support for very exotic IRC server + setups, if any exist. + (erc-update-current-channel-member): Indentation. + +2007-04-15 Michael Olson <mwolson@gnu.org> + + * erc-log.el (erc-generate-log-file-name-function): Docfix. + Mention how to deal with the case for putting log files in + different directories. Change a customization type from `symbol' + to `function'. + (erc-log-channels-directory): Allow this to contain a function + name, which is called with the same args as in + `erc-generate-log-file-name-function'. Thanks to andrewy for the + report and use case. + (erc-current-logfile): Detect if `erc-log-channels-directory' is a + function and call it with arguments if so. + +2007-04-12 Michael Olson <mwolson@gnu.org> + + * erc-backend.el (define-erc-response-handler): Mention that hook + processing stops when the function returns non-nil. This should + help avoid a nasty "gotcha" when making custom functions. Thanks + to John Sullivan for the report. + +2007-04-08 Diane Murray <disumu@x3y2z1.net> + + * erc-nicklist.el (erc-nicklist-voiced-position): Fixed + customization mismatch. + 2007-04-01 Michael Olson <mwolson@gnu.org> * erc.el (erc-version-string): Release ERC 5.2. @@ -49,6 +369,10 @@ tarball. (upload-extras): New rule to upload the extras tarball. It's yucky to replicate upload, but oh well. + (DISTRIBUTOR): New variable used to differentiate between building + packages for Ubuntu and Debian. + (debrelease, debrevision): Use it. + (debbuild): Run linda in addition to lintian. * NEWS: Mention extras tarball. Note which files have been renamed. Note that erc-list is enabled by default, except in diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index 349f9137066..4e250490e9c 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el @@ -550,11 +550,12 @@ We will store server variables in the buffer given by BUFFER." (defun erc-server-reconnect () "Reestablish the current IRC connection. Make sure you are in an ERC buffer when running this." - (let ((server (erc-server-buffer))) - (unless (and server - (buffer-live-p server)) - (error "Couldn't switch to server buffer")) - (with-current-buffer server + (let ((buffer (erc-server-buffer))) + (unless (buffer-live-p buffer) + (if (eq major-mode 'erc-mode) + (setq buffer (current-buffer)) + (error "Reconnect must be run from an ERC buffer"))) + (with-current-buffer buffer (erc-update-mode-line) (erc-set-active-buffer (current-buffer)) (setq erc-server-last-sent-time 0) @@ -609,39 +610,61 @@ EVENT is the message received from the closed connection process." ;; open-network-stream-nowait error for connection refused (not (string-match "^failed with code 111" event))))) -(defun erc-process-sentinel-1 (event) +(defun erc-process-sentinel-2 (event buffer) + "Called when `erc-process-sentinel-1' has detected an unexpected disconnect." + (if (not (buffer-live-p buffer)) + (erc-update-mode-line) + (with-current-buffer buffer + (let ((reconnect-p (erc-server-reconnect-p event))) + (erc-display-message nil 'error (current-buffer) + (if reconnect-p 'disconnected + 'disconnected-noreconnect)) + (if (not reconnect-p) + ;; terminate, do not reconnect + (progn + (erc-display-message nil 'error (current-buffer) + 'terminated ?e event) + ;; Update mode line indicators + (erc-update-mode-line) + (set-buffer-modified-p nil)) + ;; reconnect + (condition-case err + (progn + (setq erc-server-reconnecting nil) + (erc-server-reconnect) + (setq erc-server-reconnect-count 0)) + (error (when (buffer-live-p buffer) + (set-buffer buffer) + (if (integerp erc-server-reconnect-attempts) + (setq erc-server-reconnect-count + (1+ erc-server-reconnect-count)) + (message "%s ... %s" + "Reconnecting until we succeed" + "kill the ERC server buffer to stop")) + (if (numberp erc-server-reconnect-timeout) + (run-at-time erc-server-reconnect-timeout nil + #'erc-process-sentinel-2 + event buffer) + (error (concat "`erc-server-reconnect-timeout`" + " must be a number"))))))))))) + +(defun erc-process-sentinel-1 (event buffer) "Called when `erc-process-sentinel' has decided that we're disconnecting. Determine whether user has quit or whether erc has been terminated. Conditionally try to reconnect and take appropriate action." - (if erc-server-quitting - ;; normal quit - (progn - (erc-display-message nil 'error (current-buffer) 'finished) - (when erc-kill-server-buffer-on-quit + (with-current-buffer buffer + (if erc-server-quitting + ;; normal quit + (progn + (erc-display-message nil 'error (current-buffer) 'finished) + ;; Update mode line indicators + (erc-update-mode-line) + ;; Kill server buffer if user wants it (set-buffer-modified-p nil) - (kill-buffer (current-buffer)))) - ;; unexpected disconnect - (let ((again t)) - (while again - (setq again nil) - (erc-display-message nil 'error (current-buffer) - (if (erc-server-reconnect-p event) - 'disconnected - 'disconnected-noreconnect)) - (if (erc-server-reconnect-p event) - (condition-case err - (progn - (setq erc-server-reconnecting nil) - (erc-server-reconnect) - (setq erc-server-reconnect-count 0)) - (error (when (integerp erc-server-reconnect-attempts) - (setq erc-server-reconnect-count - (1+ erc-server-reconnect-count)) - (sit-for erc-server-reconnect-timeout) - (setq again t)))) - ;; terminate, do not reconnect - (erc-display-message nil 'error (current-buffer) - 'terminated ?e event)))))) + (when erc-kill-server-buffer-on-quit + (kill-buffer (current-buffer)))) + ;; unexpected disconnect + (erc-process-sentinel-2 event buffer)))) (defun erc-process-sentinel (cproc event) "Sentinel function for ERC process." @@ -668,12 +691,7 @@ Conditionally try to reconnect and take appropriate action." (delete-region (point) (point-max)) ;; Decide what to do with the buffer ;; Restart if disconnected - (erc-process-sentinel-1 event) - ;; Make sure we don't write to the buffer if it has been - ;; killed - (when (buffer-live-p buf) - (erc-update-mode-line) - (set-buffer-modified-p nil)))))) + (erc-process-sentinel-1 event buf))))) ;;;; Sending messages @@ -1054,8 +1072,11 @@ Would expand to: \"Some non-generic variable documentation. Hook called upon receiving a WHOIS server response. + Each function is called with two arguments, the process associated - with the response and the parsed response. + with the response and the parsed response. If the function returns + non-nil, stop processing the hook. Otherwise, continue. + See also `erc-server-311'.\") (defalias 'erc-server-WI 'erc-server-311) @@ -1064,7 +1085,9 @@ Would expand to: Hook called upon receiving a WI server response. Each function is called with two arguments, the process associated - with the response and the parsed response. + with the response and the parsed response. If the function returns + non-nil, stop processing the hook. Otherwise, continue. + See also `erc-server-311'.\")) \(fn (NAME &rest ALIASES) &optional EXTRA-FN-DOC EXTRA-VAR-DOC &rest FN-BODY)" @@ -1078,7 +1101,9 @@ Would expand to: (fn-name (intern (format "erc-server-%s" name))) (hook-doc (format "%sHook called upon receiving a %%s server response. Each function is called with two arguments, the process associated -with the response and the parsed response. +with the response and the parsed response. If the function returns +non-nil, stop processing the hook. Otherwise, continue. + See also `%s'." (if extra-var-doc (concat extra-var-doc "\n\n") diff --git a/lisp/erc/erc-button.el b/lisp/erc/erc-button.el index 35a20d5279f..81c604d0538 100644 --- a/lisp/erc/erc-button.el +++ b/lisp/erc/erc-button.el @@ -99,7 +99,7 @@ above them." (concat "\\(www\\.\\|\\(s?https?\\|" "ftp\\|file\\|gopher\\|news\\|telnet\\|wais\\|mailto\\):\\)" "\\(//[-a-zA-Z0-9_.]+:[0-9]*\\)?" - "[-a-zA-Z0-9_=!?#$@~`%&*+\\/:;.,]+[-a-zA-Z0-9_=#$@~`%&*+\\/]") + "[-a-zA-Z0-9_=!?#$@~`%&*+\\/:;.,()]+[-a-zA-Z0-9_=#$@~`%&*+\\/()]") "Regular expression that matches URLs." :group 'erc-button :type 'regexp) diff --git a/lisp/erc/erc-compat.el b/lisp/erc/erc-compat.el index 8be3bed1a78..47bdd94ade2 100644 --- a/lisp/erc/erc-compat.el +++ b/lisp/erc/erc-compat.el @@ -56,6 +56,18 @@ See `erc-encoding-coding-alist'." (format-time-string "%Y-%m-%d" emacs-build-time)) "Time at which Emacs was dumped out.") +;; Emacs 21 and XEmacs do not have user-emacs-directory, but XEmacs +;; has user-init-directory. +(defvar erc-user-emacs-directory + (cond ((boundp 'user-emacs-directory) + user-emacs-directory) + ((boundp 'user-init-directory) + user-init-directory) + (t "~/.emacs.d/")) + "Directory beneath which additional per-user Emacs-specific files +are placed. +Note that this should end with a directory separator.") + ;; XEmacs' `replace-match' does not replace matching subexpressions in strings. (defun erc-replace-match-subexpression-in-string (newtext string match subexp start &optional fixedcase literal) @@ -68,6 +80,7 @@ See `replace-match' for explanations of FIXEDCASE and LITERAL." (replace-match newtext fixedcase literal string)) (t (replace-match newtext fixedcase literal string subexp)))) +(defalias 'erc-with-selected-window 'with-selected-window) (defalias 'erc-cancel-timer 'cancel-timer) (defalias 'erc-make-obsolete 'make-obsolete) (defalias 'erc-make-obsolete-variable 'make-obsolete-variable) diff --git a/lisp/erc/erc-goodies.el b/lisp/erc/erc-goodies.el index 49a04513733..9131ce68282 100644 --- a/lisp/erc/erc-goodies.el +++ b/lisp/erc/erc-goodies.el @@ -84,8 +84,7 @@ DISPLAY-START is ignored." ;; works, but it solves the problem, and has no negative side effects. ;; (Fran Litterio, 2003/01/07) (let ((resize-mini-windows nil)) - (save-selected-window - (select-window window) + (erc-with-selected-window window (save-restriction (widen) (when (and erc-insert-marker @@ -282,10 +281,8 @@ The value `erc-interpret-controls-p' must also be t for this to work." "Fetches the right face for background color N (0-15)." (if (stringp n) (setq n (string-to-number n))) (if (not (numberp n)) - (progn - (message "erc-get-bg-color-face: n is NaN: %S" n) - (beep) - 'default) + (prog1 'default + (erc-error "erc-get-bg-color-face: n is NaN: %S" n)) (when (> n 16) (erc-log (format " Wrong color: %s" n)) (setq n (mod n 16))) @@ -298,10 +295,8 @@ The value `erc-interpret-controls-p' must also be t for this to work." "Fetches the right face for foreground color N (0-15)." (if (stringp n) (setq n (string-to-number n))) (if (not (numberp n)) - (progn - (message "erc-get-fg-color-face: n is NaN: %S" n) - (beep) - 'default) + (prog1 'default + (erc-error "erc-get-fg-color-face: n is NaN: %S" n)) (when (> n 16) (erc-log (format " Wrong color: %s" n)) (setq n (mod n 16))) diff --git a/lisp/erc/erc-identd.el b/lisp/erc/erc-identd.el index 4b72ee171b3..db933094e19 100644 --- a/lisp/erc/erc-identd.el +++ b/lisp/erc/erc-identd.el @@ -74,7 +74,8 @@ This can be either a string or a number." (format "%s, %s : USERID : %s : %s\n" port-on-server port-on-client system-type (user-login-name))) - (process-send-eof erc-identd-process))))) + (stop-process erc-identd-process) + (delete-process proc))))) ;;;###autoload (defun erc-identd-start (&optional port) diff --git a/lisp/erc/erc-log.el b/lisp/erc/erc-log.el index 88132afae0c..1733b3d1b00 100644 --- a/lisp/erc/erc-log.el +++ b/lisp/erc/erc-log.el @@ -31,17 +31,26 @@ ;; Quick start: ;; -;; (setq erc-enable-logging t) +;; (require 'erc-log) ;; (setq erc-log-channels-directory "/path/to/logfiles") ; must be writable +;; (erc-log-enable) ;; -;; There are two ways to setup logging. The first will write to the log files -;; on each incoming or outgoing line - this may not be optimal on a laptop -;; HDD. To do this, M-x customize-variable erc-modules, and add "log". +;; Or: ;; -;; The second method will save buffers on /part, /quit, or killing the -;; channel buffer. To do this, add the following to your .emacs: +;; M-x customize-variable erc-modules, and add "log". ;; -;; (require 'erc-log) +;; There are two ways to setup logging. The first (default) method +;; will save buffers on /part, /quit, or killing the channel +;; buffer. +;; +;; The second will write to the log files on each incoming or outgoing +;; line - this may not be optimal on a laptop HDD. To use this +;; method, add the following to the above instructions. +;; +;; (setq erc-save-buffer-on-part nil +;; erc-save-queries-on-quit nil +;; erc-log-write-after-send t +;; erc-log-write-after-insert t) ;; ;; If you only want to save logs for some buffers, customise the ;; variable `erc-enable-logging'. @@ -99,15 +108,19 @@ The function must take five arguments: BUFFER, TARGET, NICK, SERVER and PORT. BUFFER is the buffer to be saved, TARGET is the name of the channel, or the target of the query, NICK is the current nick, -SERVER and PORT are the parameters used to connect BUFFERs -`erc-server-process'." +SERVER and PORT are the parameters that were used to connect to BUFFERs +`erc-server-process'. + +If you want to write logs into different directories, make a +custom function which returns the directory part and set +`erc-log-channels-directory' to its name." :group 'erc-log :type '(choice (const :tag "Long style" erc-generate-log-file-name-long) (const :tag "Long, but with network name rather than server" erc-generate-log-file-name-network) (const :tag "Short" erc-generate-log-file-name-short) (const :tag "With date" erc-generate-log-file-name-with-date) - (symbol :tag "Other function"))) + (function :tag "Other function"))) (defcustom erc-truncate-buffer-on-save nil "Truncate any ERC (channel, query, server) buffer when it is saved." @@ -134,10 +147,16 @@ Log files are stored in `erc-log-channels-directory'." "The directory to place log files for channels. Leave blank to disable logging. If not nil, all the channel buffers are logged in separate files in that directory. The -directory should not end with a trailing slash." +directory should not end with a trailing slash. + +If this is the name of a function, the function will be called +with the buffer, target, nick, server, and port arguments. See +`erc-generate-log-file-name-function' for a description of these +arguments." :group 'erc-log :type '(choice directory - (const nil))) + (function "Function") + (const :tag "Disable logging" nil))) (defcustom erc-log-insert-log-on-open nil "*Insert log file contents into the buffer if a log file exists." @@ -186,6 +205,16 @@ This should ideally, be a \"catch-all\" coding system, like `emacs-mule', or `iso-2022-7bit'." :group 'erc-log) +(defcustom erc-log-filter-function nil + "*If non-nil, pass text through the given function before writing it to +a log file. + +The function should take one argument, which is the text to filter." + :group 'erc-log + :type '(choice (function "Function") + (const :tag "No filtering" nil))) + + ;;;###autoload (autoload 'erc-log-mode "erc-log" nil t) (define-erc-module log nil "Automatically logs things you receive on IRC into files. @@ -297,7 +326,8 @@ Logging is enabled if `erc-log-channels-directory' is non-nil, the directory is writeable (it will be created as necessary) and `erc-enable-logging' returns a non-nil value." (and erc-log-channels-directory - (erc-directory-writable-p erc-log-channels-directory) + (or (functionp erc-log-channels-directory) + (erc-directory-writable-p erc-log-channels-directory)) (if (functionp erc-enable-logging) (funcall erc-enable-logging (or buffer (current-buffer))) erc-enable-logging))) @@ -316,14 +346,19 @@ filename is downcased." If BUFFER is nil, the value of `current-buffer' is used. This is determined by `erc-generate-log-file-name-function'. The result is converted to lowercase, as IRC is case-insensitive" - (expand-file-name - (erc-log-standardize-name - (funcall erc-generate-log-file-name-function - (or buffer (current-buffer)) - (or (buffer-name buffer) (erc-default-target)) - (erc-current-nick) - erc-session-server erc-session-port)) - erc-log-channels-directory)) + (unless buffer (setq buffer (current-buffer))) + (let ((target (or (buffer-name buffer) (erc-default-target))) + (nick (erc-current-nick)) + (server erc-session-server) + (port erc-session-port)) + (expand-file-name + (erc-log-standardize-name + (funcall erc-generate-log-file-name-function + buffer target nick server port)) + (if (functionp erc-log-channels-directory) + (funcall erc-log-channels-directory + buffer target nick server port) + erc-log-channels-directory)))) (defun erc-generate-log-file-name-with-date (buffer &rest ignore) "This function computes a short log file name. @@ -380,17 +415,25 @@ You can save every individual message by putting this function on (or buffer (setq buffer (current-buffer))) (when (erc-logging-enabled buffer) (let ((file (erc-current-logfile buffer)) - (coding-system-for-write erc-log-file-coding-system)) + (coding-system erc-log-file-coding-system)) (save-excursion (with-current-buffer buffer (save-restriction (widen) - ;; early on in the initalisation, don't try and write the log out + ;; early on in the initialization, don't try and write the log out (when (and (markerp erc-last-saved-position) (> erc-insert-marker (1+ erc-last-saved-position))) - (write-region (1+ (marker-position erc-last-saved-position)) - (marker-position erc-insert-marker) - file t 'nomessage) + (let ((start (1+ (marker-position erc-last-saved-position))) + (end (marker-position erc-insert-marker))) + (if (functionp erc-log-filter-function) + (let ((text (buffer-substring start end))) + (with-temp-buffer + (insert (funcall erc-log-filter-function text)) + (let ((coding-system-for-write coding-system)) + (write-region (point-min) (point-max) + file t 'nomessage)))) + (let ((coding-system-for-write coding-system)) + (write-region start end file t 'nomessage)))) (if (and erc-truncate-buffer-on-save (interactive-p)) (progn (let ((inhibit-read-only t)) (erase-buffer)) diff --git a/lisp/erc/erc-sound.el b/lisp/erc/erc-sound.el index 4d3d792b1b8..7a1a28198bf 100644 --- a/lisp/erc/erc-sound.el +++ b/lisp/erc/erc-sound.el @@ -30,7 +30,7 @@ ;; Add the following to your .emacs if you want to play sounds. ;; -;; (require 'erc-soud) +;; (require 'erc-sound) ;; (erc-sound-enable) ;; ;; To send requests to other users from within query buffers, type the @@ -125,7 +125,7 @@ See also `play-sound-file'." (if (and (not filepath) erc-default-sound) (setq filepath erc-default-sound)) (cond ((and filepath (file-exists-p filepath)) - (play-sound-file filepath)) + (play-sound-file filepath)) (t (beep))) (erc-log (format "Playing sound file %S" filepath)))) @@ -142,5 +142,11 @@ See also `play-sound-file'." (provide 'erc-sound) -;; arch-tag: 53657d1d-007f-4a20-91c1-588e71cf0cee ;;; erc-sound.el ends here +;; +;; Local Variables: +;; indent-tabs-mode: t +;; tab-width: 8 +;; End: + +;; arch-tag: 53657d1d-007f-4a20-91c1-588e71cf0cee diff --git a/lisp/erc/erc-stamp.el b/lisp/erc/erc-stamp.el index d67dffeaede..3b7f5ba18f2 100644 --- a/lisp/erc/erc-stamp.el +++ b/lisp/erc/erc-stamp.el @@ -58,16 +58,48 @@ If nil, timestamping is turned off." :type '(choice (const nil) (string))) -(defcustom erc-insert-timestamp-function 'erc-insert-timestamp-right +(defcustom erc-timestamp-format-left "\n[%a %b %e %Y]\n" + "*If set to a string, messages will be timestamped. +This string is processed using `format-time-string'. +Good examples are \"%T\" and \"%H:%M\". + +This timestamp is used for timestamps on the left side of the +screen when `erc-insert-timestamp-function' is set to +`erc-insert-timestamp-left-and-right'. + +If nil, timestamping is turned off." + :group 'erc-stamp + :type '(choice (const nil) + (string))) + +(defcustom erc-timestamp-format-right " [%H:%M]" + "*If set to a string, messages will be timestamped. +This string is processed using `format-time-string'. +Good examples are \"%T\" and \"%H:%M\". + +This timestamp is used for timestamps on the right side of the +screen when `erc-insert-timestamp-function' is set to +`erc-insert-timestamp-left-and-right'. + +If nil, timestamping is turned off." + :group 'erc-stamp + :type '(choice (const nil) + (string))) + +(defcustom erc-insert-timestamp-function 'erc-insert-timestamp-left-and-right "*Function to use to insert timestamps. It takes a single argument STRING which is the final string which all text-properties already appended. This function only cares about inserting this string at the right position. Narrowing is in effect while it is called, so (point-min) and (point-max) determine the region to -operate on." +operate on. + +You will probably want to set +`erc-insert-away-timestamp-function' to the same value." :group 'erc-stamp - :type '(choice (const :tag "Right" erc-insert-timestamp-right) + :type '(choice (const :tag "Both sides" erc-insert-timestamp-left-and-right) + (const :tag "Right" erc-insert-timestamp-right) (const :tag "Left" erc-insert-timestamp-left) function)) @@ -82,12 +114,14 @@ If `erc-timestamp-format' is set, this will not be used." :type '(choice (const nil) (string))) -(defcustom erc-insert-away-timestamp-function 'erc-insert-timestamp-right +(defcustom erc-insert-away-timestamp-function + 'erc-insert-timestamp-left-and-right "*Function to use to insert the away timestamp. See `erc-insert-timestamp-function' for details." :group 'erc-stamp - :type '(choice (const :tag "Right" erc-insert-timestamp-right) + :type '(choice (const :tag "Both sides" erc-insert-timestamp-left-and-right) + (const :tag "Right" erc-insert-timestamp-right) (const :tag "Left" erc-insert-timestamp-left) function)) @@ -160,6 +194,18 @@ or `erc-send-modify-hook'." "Last timestamp inserted into the buffer.") (make-variable-buffer-local 'erc-timestamp-last-inserted) +(defvar erc-timestamp-last-inserted-left nil + "Last timestamp inserted into the left side of the buffer. +This is used when `erc-insert-timestamp-function' is set to +`erc-timestamp-left-and-right'") +(make-variable-buffer-local 'erc-timestamp-last-inserted-left) + +(defvar erc-timestamp-last-inserted-right nil + "Last timestamp inserted into the right side of the buffer. +This is used when `erc-insert-timestamp-function' is set to +`erc-timestamp-left-and-right'") +(make-variable-buffer-local 'erc-timestamp-last-inserted-right) + (defcustom erc-timestamp-only-if-changed-flag t "*Insert timestamp only if its value changed since last insertion. If `erc-insert-timestamp-function' is `erc-insert-timestamp-left', a @@ -272,6 +318,26 @@ be printed just before the window-width." (when erc-timestamp-intangible (erc-put-text-property from (1+ (point)) 'intangible t))))) +(defun erc-insert-timestamp-left-and-right (string) + "This is another function that can be assigned to +`erc-insert-timestamp-function'. If the date is changed, it will +print a blank line, the date, and another blank line. If the time is +changed, it will then print it off to the right." + (let* ((ct (current-time)) + (ts-left (erc-format-timestamp ct erc-timestamp-format-left)) + (ts-right (erc-format-timestamp ct erc-timestamp-format-right))) + ;; insert left timestamp + (unless (string-equal ts-left erc-timestamp-last-inserted-left) + (goto-char (point-min)) + (erc-put-text-property 0 (length ts-left) 'field 'erc-timestamp ts-left) + (insert ts-left) + (setq erc-timestamp-last-inserted-left ts-left)) + ;; insert right timestamp + (let ((erc-timestamp-only-if-changed-flag t) + (erc-timestamp-last-inserted erc-timestamp-last-inserted-right)) + (erc-insert-timestamp-right ts-right) + (setq erc-timestamp-last-inserted-right ts-right)))) + ;; for testing: (setq erc-timestamp-only-if-changed-flag nil) (defun erc-format-timestamp (time format) diff --git a/lisp/erc/erc-track.el b/lisp/erc/erc-track.el index f72a5be1de1..1408adcd942 100644 --- a/lisp/erc/erc-track.el +++ b/lisp/erc/erc-track.el @@ -95,6 +95,12 @@ Activity means that there was no user input in the last 10 seconds." :group 'erc-track :type '(repeat string)) +(defcustom erc-track-remove-disconnected-buffers nil + "*If true, remove buffers associated with a server that is +disconnected from `erc-modified-channels-alist'." + :group 'erc-track + :type 'boolean) + (defcustom erc-track-exclude-types '("NICK") "*List of message types to be ignored. This list could look like '(\"JOIN\" \"PART\")." @@ -151,6 +157,16 @@ If nil instead of a function, shortening is disabled." :type '(choice (const :tag "Disabled") function)) +(defcustom erc-track-list-changed-hook nil + "Hook that is run whenever the contents of +`erc-modified-channels-alist' changes. + +This is useful for people that don't use the default mode-line +notification but instead use a separate mechanism to provide +notification of channel activity." + :group 'erc-track + :type 'hook) + (defcustom erc-track-use-faces t "*Use faces in the mode-line. The faces used are the same as used for text in the buffers. @@ -192,12 +208,14 @@ Setting this variable only has effects in GNU Emacs versions above 21.3. Choices are: 'before-modes - add to the beginning of `mode-line-modes' 'after-modes - add to the end of `mode-line-modes' - -Any other value means add to the end of `global-mode-string'." +t - add to the end of `global-mode-string'. +nil - don't add to mode line +" :group 'erc-track :type '(choice (const :tag "Just before mode information" before-modes) (const :tag "Just after mode information" after-modes) - (const :tag "After all other information" nil)) + (const :tag "After all other information" t) + (const :tag "Don't display in mode line" nil)) :set (lambda (sym val) (set sym val) (when (and (boundp 'erc-track-mode) @@ -263,12 +281,18 @@ when there are no more active channels." (defcustom erc-track-switch-direction 'oldest "Direction `erc-track-switch-buffer' should switch. + importance - find buffer with the most important message oldest - find oldest active buffer newest - find newest active buffer leastactive - find buffer with least unseen messages - mostactive - find buffer with most unseen messages." + mostactive - find buffer with most unseen messages. + +If set to 'importance, the importance is determined by position +in `erc-track-faces-priority-list', where first is most +important." :group 'erc-track - :type '(choice (const oldest) + :type '(choice (const importance) + (const oldest) (const newest) (const leastactive) (const mostactive))) @@ -296,7 +320,7 @@ See `erc-track-position-in-mode-line' for possible values." (boundp 'mode-line-modes)) (add-to-list 'mode-line-modes '(t erc-modified-channels-object) t)) - (t + ((eq position t) (when (not global-mode-string) (setq global-mode-string '(""))) ; Padding for mode-line wart (add-to-list 'global-mode-string @@ -644,14 +668,21 @@ only consider active buffers visible.") (setq erc-buffer-activity (erc-current-time)) (erc-track-modified-channels)) +(defun erc-track-get-buffer-window (buffer frame-param) + (if (eq frame-param 'selected-visible) + (if (eq (frame-visible-p (selected-frame)) t) + (get-buffer-window buffer nil) + nil) + (get-buffer-window buffer frame-param))) + (defun erc-buffer-visible (buffer) "Return non-nil when the buffer is visible." (if erc-track-when-inactive (when erc-buffer-activity; could be nil - (and (get-buffer-window buffer erc-track-visibility) + (and (erc-track-get-buffer-window buffer erc-track-visibility) (<= (erc-time-diff erc-buffer-activity (erc-current-time)) erc-buffer-activity-timeout))) - (get-buffer-window buffer erc-track-visibility))) + (erc-track-get-buffer-window buffer erc-track-visibility))) ;;; Tracking the channel modifications @@ -668,18 +699,22 @@ called via `window-configuration-change-hook'. ARGS are ignored." (interactive) (unless erc-modified-channels-update-inside - (let ((erc-modified-channels-update-inside t)) + (let ((erc-modified-channels-update-inside t) + (removed-channel nil)) (mapcar (lambda (elt) (let ((buffer (car elt))) (when (or (not (bufferp buffer)) (not (buffer-live-p buffer)) (erc-buffer-visible buffer) + (and erc-track-remove-disconnected-buffers (not (with-current-buffer buffer - erc-server-connected))) + erc-server-connected)))) + (setq removed-channel t) (erc-modified-channels-remove-buffer buffer)))) erc-modified-channels-alist) + (when removed-channel (erc-modified-channels-display) - (force-mode-line-update t)))) + (force-mode-line-update t))))) (defvar erc-track-mouse-face (if (featurep 'xemacs) 'modeline-mousable @@ -729,10 +764,13 @@ If FACES are provided, color STRING with them." "Set `erc-modified-channels-object' according to `erc-modified-channels-alist'. Use `erc-make-mode-line-buffer-name' to create buttons." - (if (or - (eq 'mostactive erc-track-switch-direction) - (eq 'leastactive erc-track-switch-direction)) - (erc-track-sort-by-activest)) + (cond ((or (eq 'mostactive erc-track-switch-direction) + (eq 'leastactive erc-track-switch-direction)) + (erc-track-sort-by-activest)) + ((eq 'importance erc-track-switch-direction) + (erc-track-sort-by-importance))) + (run-hooks 'erc-track-list-changed-hook) + (unless (eq erc-track-position-in-mode-line nil) (if (null erc-modified-channels-alist) (setq erc-modified-channels-object (erc-modified-channels-object nil)) ;; erc-modified-channels-alist contains all the data we need. To @@ -768,7 +806,7 @@ Use `erc-make-mode-line-buffer-name' to create buttons." (when (featurep 'xemacs) (erc-modified-channels-object nil)) (setq erc-modified-channels-object - (erc-modified-channels-object strings))))) + (erc-modified-channels-object strings)))))) (defun erc-modified-channels-remove-buffer (buffer) "Remove BUFFER from `erc-modified-channels-alist'." @@ -802,8 +840,7 @@ is in `erc-mode'." (if (and (not (erc-buffer-visible (current-buffer))) (not (member this-channel erc-track-exclude)) (not (and erc-track-exclude-server-buffer - (string= this-channel - (buffer-name (erc-server-buffer))))) + (erc-server-buffer-p))) (not (erc-message-type-member (or (erc-find-parsed-property) (point-min)) @@ -847,10 +884,10 @@ is in `erc-mode'." (erc-modified-channels-display))) ;; Else if the active buffer is the current buffer, remove it ;; from our list. - (when (or (erc-buffer-visible (current-buffer)) + (when (and (or (erc-buffer-visible (current-buffer)) (and this-channel - (assq (current-buffer) erc-modified-channels-alist) (member this-channel erc-track-exclude))) + (assq (current-buffer) erc-modified-channels-alist)) ;; Remove it from mode-line if buffer is visible or ;; channel was added to erc-track-exclude recently. (erc-modified-channels-remove-buffer (current-buffer)) @@ -887,6 +924,29 @@ That means the number of unseen messages in a channel." (sort erc-modified-channels-alist (lambda (a b) (> (nth 1 a) (nth 1 b)))))) +(defun erc-track-face-priority (face) + "Return a number indicating the priority of FACE in +`erc-track-faces-priority-list'. Lower number means higher +priority. + +If face is not in `erc-track-faces-priority-list', it will have a +higher number than any other face in that list." + (let ((count 0)) + (catch 'done + (dolist (item erc-track-faces-priority-list) + (if (eq item face) + (throw 'done t) + (setq count (1+ count))))) + count)) + +(defun erc-track-sort-by-importance () + "Sort erc-modified-channels-alist by importance. +That means the position of the face in `erc-track-faces-priority-list'." + (setq erc-modified-channels-alist + (sort erc-modified-channels-alist + (lambda (a b) (< (erc-track-face-priority (cddr a)) + (erc-track-face-priority (cddr b))))))) + (defun erc-track-get-active-buffer (arg) "Return the buffer name of ARG in `erc-modified-channels-alist'. Negative arguments index in the opposite direction. This direction is @@ -898,7 +958,8 @@ relative to `erc-track-switch-direction'" (oldest 'newest) (newest 'oldest) (mostactive 'leastactive) - (leastactive 'mostactive))) + (leastactive 'mostactive) + (importance 'oldest))) (setq arg (- arg))) (setq offset (case dir ((oldest leastactive) diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index c26bdf2a19f..2c5786adff3 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -66,7 +66,7 @@ ;;; Code: -(defconst erc-version-string "Version 5.2" +(defconst erc-version-string "Version 5.3 (devel)" "ERC version. This is used by function `erc-version'.") (eval-when-compile (require 'cl)) @@ -836,8 +836,9 @@ See `erc-server-flood-margin' for other flood-related parameters.") ;; Script parameters (defcustom erc-startup-file-list - '("~/.emacs.d/.ercrc.el" "~/.emacs.d/.ercrc" - "~/.ercrc.el" "~/.ercrc" ".ercrc.el" ".ercrc") + (list (concat erc-user-emacs-directory ".ercrc.el") + (concat erc-user-emacs-directory ".ercrc") + "~/.ercrc.el" "~/.ercrc" ".ercrc.el" ".ercrc") "List of files to try for a startup script. The first existent and readable one will get executed. @@ -1460,7 +1461,7 @@ Turning on `erc-mode' runs the hook `erc-mode-hook'." (defconst erc-default-server "irc.freenode.net" "IRC server to use if it cannot be detected otherwise.") -(defconst erc-default-port "6667" +(defconst erc-default-port 6667 "IRC port to use if it cannot be detected otherwise.") (defcustom erc-join-buffer 'buffer @@ -1491,6 +1492,14 @@ This only has effect when `erc-join-buffer' is set to `frame'." :group 'erc-buffers :type 'boolean) +(defcustom erc-reuse-frames t + "*Determines whether new frames are always created. +Non-nil means that a new frame is not created to display an ERC +buffer if there is already a window displaying it. This only has +effect when `erc-join-buffer' is set to `frame'." + :group 'erc-buffers + :type 'boolean) + (defun erc-channel-p (channel) "Return non-nil if CHANNEL seems to be an IRC channel name." (cond ((stringp channel) @@ -1888,14 +1897,16 @@ removed from the list will be disabled." ((eq erc-join-buffer 'bury) nil) ((eq erc-join-buffer 'frame) - (funcall '(lambda (frame) + (when (or (not erc-reuse-frames) + (not (get-buffer-window buffer t))) + ((lambda (frame) (raise-frame frame) (select-frame frame)) (make-frame (or erc-frame-alist default-frame-alist))) (switch-to-buffer buffer) (when erc-frame-dedicated-flag - (set-window-dedicated-p (selected-window) t))) + (set-window-dedicated-p (selected-window) t)))) (t (if (active-minibuffer-window) (display-buffer buffer) @@ -2155,16 +2166,48 @@ Arguments are the same as for `erc'." "Open an SSL stream to an IRC server. The process will be given the name NAME, its target buffer will be BUFFER. HOST and PORT specify the connection target." - (when (require 'tls) - (let ((proc (open-tls-stream name buffer host port))) + (when (condition-case nil + (require 'ssl) + (error (message "You don't have ssl.el. %s" + "Try using `erc-tls' instead.") + nil)) + (let ((proc (open-ssl-stream name buffer host port))) ;; Ugly hack, but it works for now. Problem is it is ;; very hard to detect when ssl is established, because s_client ;; doesn't give any CONNECTIONESTABLISHED kind of message, and ;; most IRC servers send nothing and wait for you to identify. - ;; Disabled when switching to tls.el -- jas - ;(sit-for 5) + (sit-for 5) proc))) +(defun erc-tls (&rest r) + "Interactively select TLS connection parameters and run ERC. +Arguments are the same as for `erc'." + (interactive (erc-select-read-args)) + (let ((erc-server-connect-function 'erc-open-tls-stream)) + (apply 'erc r))) + +(defun erc-open-tls-stream (name buffer host port) + "Open an TLS stream to an IRC server. +The process will be given the name NAME, its target buffer will be +BUFFER. HOST and PORT specify the connection target." + (when (condition-case nil + (require 'tls) + (error (message "You don't have tls.el. %s" + "Try using `erc-ssl' instead.") + nil)) + (open-tls-stream name buffer host port))) + +;;; Displaying error messages + +(defun erc-error (&rest args) + "Pass ARGS to `format', and display the result as an error message. +If `debug-on-error' is set to non-nil, then throw a real error with this +message instead, to make debugging easier." + (if debug-on-error + (apply #'error args) + (apply #'message args) + (beep))) + ;;; Debugging the protocol (defvar erc-debug-irc-protocol nil @@ -2228,7 +2271,7 @@ If ARG is non-nil, show the *erc-protocol* buffer." (interactive "P") (let* ((buf (get-buffer-create "*erc-protocol*"))) (with-current-buffer buf - (erc-view-mode-enter 1) + (erc-view-mode-enter) (when (null (current-local-map)) (let ((inhibit-read-only t)) (insert (erc-make-notice "This buffer displays all IRC protocol traffic exchanged with each server.\n")) @@ -2456,6 +2499,14 @@ See also `erc-server-send'." (match-string 1 arglist) arglist))) +(defun erc-command-no-process-p (str) + "Return non-nil if STR is an ERC command that can be run when the process +is not alive, nil otherwise." + (let ((fun (erc-extract-command-from-line str))) + (and fun + (symbolp (car fun)) + (get (car fun) 'process-not-needed)))) + (defun erc-command-name (cmd) "For CMD being the function name of a ERC command, something like erc-cmd-FOO, this returns a string /FOO." @@ -2565,6 +2616,7 @@ VALUE is computed by evaluating the rest of LINE in Lisp." (defalias 'erc-cmd-VAR 'erc-cmd-SET) (defalias 'erc-cmd-VARIABLE 'erc-cmd-SET) (put 'erc-cmd-SET 'do-not-parse-args t) +(put 'erc-cmd-SET 'process-not-needed t) (defun erc-cmd-default (line) "Fallback command. @@ -2623,6 +2675,7 @@ If no USER argument is specified, list the contents of `erc-ignore-list'." "Clear the window content." (recenter 0) t) +(put 'erc-cmd-CLEAR 'process-not-needed t) (defun erc-cmd-OPS () "Show the ops in the current channel." @@ -2656,6 +2709,7 @@ If no USER argument is specified, list the contents of `erc-ignore-list'." (erc-display-message nil 'notice 'active 'country-unknown ?d tld)) t)) +(put 'erc-cmd-COUNTRY 'process-not-needed t) (defun erc-cmd-AWAY (line) "Mark the user as being away, the reason being indicated by LINE. @@ -2736,6 +2790,7 @@ For a list of user commands (/join /part, ...): t)) (defalias 'erc-cmd-H 'erc-cmd-HELP) +(put 'erc-cmd-HELP 'process-not-needed t) (defun erc-cmd-JOIN (channel &optional key) "Join the channel given in CHANNEL, optionally with KEY. @@ -2973,6 +3028,7 @@ the matching is case-sensitive." (occur line) t) (put 'erc-cmd-LASTLOG 'do-not-parse-args t) +(put 'erc-cmd-LASTLOG 'process-not-needed t) (defun erc-send-message (line &optional force) "Send LINE to the current channel or user and display it. @@ -3195,20 +3251,34 @@ the message given by REASON." (defalias 'erc-cmd-EXIT 'erc-cmd-QUIT) (defalias 'erc-cmd-SIGNOFF 'erc-cmd-QUIT) (put 'erc-cmd-QUIT 'do-not-parse-args t) +(put 'erc-cmd-QUIT 'process-not-needed t) (defun erc-cmd-GQUIT (reason) "Disconnect from all servers at once with the same quit REASON." (erc-with-all-buffers-of-server nil #'erc-open-server-buffer-p - (erc-cmd-QUIT reason))) + (erc-cmd-QUIT reason)) + (when erc-kill-queries-on-quit + ;; if the query buffers have not been killed within 4 seconds, + ;; kill them + (run-at-time + 4 nil + (lambda () + (dolist (buffer (erc-buffer-list (lambda (buf) + (not (erc-server-buffer-p buf))))) + (kill-buffer buffer))))) + t) (defalias 'erc-cmd-GQ 'erc-cmd-GQUIT) (put 'erc-cmd-GQUIT 'do-not-parse-args t) +(put 'erc-cmd-GQUIT 'process-not-needed t) (defun erc-cmd-RECONNECT () "Try to reconnect to the current IRC server." - (let ((buffer (or (erc-server-buffer) (current-buffer))) + (let ((buffer (erc-server-buffer)) (process nil)) - (with-current-buffer (if (bufferp buffer) buffer (current-buffer)) + (unless (buffer-live-p buffer) + (setq buffer (current-buffer))) + (with-current-buffer buffer (setq erc-server-quitting nil) (setq erc-server-reconnecting t) (setq erc-server-reconnect-count 0) @@ -3218,6 +3288,7 @@ the message given by REASON." (erc-server-reconnect)) (setq erc-server-reconnecting nil))) t) +(put 'erc-cmd-RECONNECT 'process-not-needed t) (defun erc-cmd-SERVER (server) "Connect to SERVER, leaving existing connection intact." @@ -3225,9 +3296,9 @@ the message given by REASON." (condition-case nil (erc :server server :nick (erc-current-nick)) (error - (message "Cannot find host %s." server) - (beep))) + (erc-error "Cannot find host %s." server))) t) +(put 'erc-cmd-SERVER 'process-not-needed t) (eval-when-compile (defvar motif-version-string) @@ -4411,33 +4482,65 @@ See also `erc-channel-begin-receiving-names'." erc-channel-users) (setq erc-channel-new-member-names nil)) +(defun erc-parse-prefix () + "Return an alist of valid prefix character types and their representations. +Example: (operator) o => @, (voiced) v => +." + (let ((str (or (cdr (assoc "PREFIX" (erc-with-server-buffer + erc-server-parameters))) + ;; provide a sane default + "(ov)@+")) + types chars) + (when (string-match "^(\\([^)]+\\))\\(.+\\)$" str) + (setq types (match-string 1 str) + chars (match-string 2 str)) + (let ((len (min (length types) (length chars))) + (i 0) + (alist nil)) + (while (< i len) + (setq alist (cons (cons (elt types i) (elt chars i)) + alist)) + (setq i (1+ i))) + alist)))) + (defun erc-channel-receive-names (names-string) "This function is for internal use only. Update `erc-channel-users' according to NAMES-STRING. NAMES-STRING is a string listing some of the names on the channel." - (let (names name op voice) - ;; We need to delete "" because in XEmacs, (split-string "a ") - ;; returns ("a" ""). - (setq names (delete "" (split-string names-string))) - (let ((erc-channel-members-changed-hook nil)) - (dolist (item names) - (cond ((string-match "^@\\(.*\\)$" item) - (setq name (match-string 1 item) - op 'on - voice 'off)) - ((string-match "^+\\(.*\\)$" item) - (setq name (match-string 1 item) - op 'off - voice 'on)) - (t (setq name item - op 'off - voice 'off))) - (puthash (erc-downcase name) t - erc-channel-new-member-names) - (erc-update-current-channel-member - name name t op voice))) + (let (prefix op-ch voice-ch names name op voice) + (setq prefix (erc-parse-prefix)) + (setq op-ch (cdr (assq ?o prefix)) + voice-ch (cdr (assq ?v prefix))) + ;; We need to delete "" because in XEmacs, (split-string "a ") + ;; returns ("a" ""). + (setq names (delete "" (split-string names-string))) + (let ((erc-channel-members-changed-hook nil)) + (dolist (item names) + (let ((updatep t) + ch) + (if (rassq (elt item 0) prefix) + (cond ((= (length item) 1) + (setq updatep nil)) + ((eq (elt item 0) op-ch) + (setq name (substring item 1) + op 'on + voice 'off)) + ((eq (elt item 0) voice-ch) + (setq name (substring item 1) + op 'off + voice 'on)) + (t (setq name (substring item 1) + op 'off + voice 'off))) + (setq name item + op 'off + voice 'off)) + (when updatep + (puthash (erc-downcase name) t + erc-channel-new-member-names) + (erc-update-current-channel-member + name name t op voice))))) (run-hooks 'erc-channel-members-changed-hook))) (defcustom erc-channel-members-changed-hook nil @@ -4529,15 +4632,15 @@ See also: `erc-update-user' and `erc-update-channel-member'." (setq changed t) (setf (erc-channel-user-op cuser) (cond ((eq op 'on) t) - ((eq op 'off) nil) - (t op)))) + ((eq op 'off) nil) + (t op)))) (when (and voice (not (eq (erc-channel-user-voice cuser) voice))) (setq changed t) (setf (erc-channel-user-voice cuser) (cond ((eq voice 'on) t) - ((eq voice 'off) nil) - (t voice)))) + ((eq voice 'off) nil) + (t voice)))) (when update-message-time (setf (erc-channel-user-last-message-time cuser) (current-time))) (setq user-changed @@ -4559,11 +4662,11 @@ See also: `erc-update-user' and `erc-update-channel-member'." (erc-server-user-buffers user)))) (setq cuser (make-erc-channel-user :op (cond ((eq op 'on) t) - ((eq op 'off) nil) - (t op)) + ((eq op 'off) nil) + (t op)) :voice (cond ((eq voice 'on) t) - ((eq voice 'off) nil) - (t voice)) + ((eq voice 'off) nil) + (t voice)) :last-message-time (if update-message-time (current-time)))) (puthash (erc-downcase nick) (cons user cuser) @@ -4892,39 +4995,37 @@ Specifically, return the position of `erc-insert-marker'." (interactive) (save-restriction (widen) - (cond - ((< (point) (erc-beg-of-input-line)) - (message "Point is not in the input area") - (beep)) - ((not (erc-server-buffer-live-p)) - (message "ERC: No process running") - (beep)) - (t - (erc-set-active-buffer (current-buffer)) + (if (< (point) (erc-beg-of-input-line)) + (erc-error "Point is not in the input area") (let ((inhibit-read-only t) (str (erc-user-input)) (old-buf (current-buffer))) - - ;; Kill the input and the prompt - (delete-region (erc-beg-of-input-line) - (erc-end-of-input-line)) - - (unwind-protect - (erc-send-input str) - ;; Fix the buffer if the command didn't kill it - (when (buffer-live-p old-buf) - (with-current-buffer old-buf - (save-restriction - (widen) - (goto-char (point-max)) - (set-marker (process-mark erc-server-process) (point)) - (set-marker erc-insert-marker (point)) - (let ((buffer-modified (buffer-modified-p))) - (erc-display-prompt) - (set-buffer-modified-p buffer-modified)))))) - - ;; Only when last hook has been run... - (run-hook-with-args 'erc-send-completed-hook str)))))) + (if (and (not (erc-server-buffer-live-p)) + (not (erc-command-no-process-p str))) + (erc-error "ERC: No process running") + (erc-set-active-buffer (current-buffer)) + + ;; Kill the input and the prompt + (delete-region (erc-beg-of-input-line) + (erc-end-of-input-line)) + + (unwind-protect + (erc-send-input str) + ;; Fix the buffer if the command didn't kill it + (when (buffer-live-p old-buf) + (with-current-buffer old-buf + (save-restriction + (widen) + (goto-char (point-max)) + (when (processp erc-server-process) + (set-marker (process-mark erc-server-process) (point))) + (set-marker erc-insert-marker (point)) + (let ((buffer-modified (buffer-modified-p))) + (erc-display-prompt) + (set-buffer-modified-p buffer-modified)))))) + + ;; Only when last hook has been run... + (run-hook-with-args 'erc-send-completed-hook str)))))) (defun erc-user-input () "Return the input of the user in the current buffer." @@ -4985,7 +5086,8 @@ This returns non-nil only if we actually send anything." (erc-put-text-property beg (point) 'face 'erc-command-indicator-face) (insert "\n")) - (set-marker (process-mark erc-server-process) (point)) + (when (processp erc-server-process) + (set-marker (process-mark erc-server-process) (point))) (set-marker erc-insert-marker (point)) (save-excursion (save-restriction @@ -5004,7 +5106,8 @@ current position." (erc-put-text-property beg (point) 'face 'erc-input-face)) (insert "\n") - (set-marker (process-mark erc-server-process) (point)) + (when (processp erc-server-process) + (set-marker (process-mark erc-server-process) (point))) (set-marker erc-insert-marker (point)) (save-excursion (save-restriction diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el index 6dc02517ec1..aaad664918f 100644 --- a/lisp/eshell/em-unix.el +++ b/lisp/eshell/em-unix.el @@ -168,6 +168,35 @@ Otherwise, Emacs will attempt to use rsh to invoke du on the remote machine." (put 'eshell/man 'eshell-no-numeric-conversions t) +(defun eshell/info (&rest args) + "Runs the info command in-frame with the same behaviour as command-line `info', ie: + 'info' => goes to top info window + 'info arg1' => IF arg1 is a file, then visits arg1 + 'info arg1' => OTHERWISE goes to top info window and then menu item arg1 + 'info arg1 arg2' => does action for arg1 (either visit-file or menu-item) and then menu item arg2 + etc." + (require 'info) + (let ((file (cond + ((not (stringp (car args))) + nil) + ((file-exists-p (expand-file-name (car args))) + (expand-file-name (car args))) + ((file-exists-p (concat (expand-file-name (car args)) ".info")) + (concat (expand-file-name (car args)) ".info"))))) + + ;; If the first arg is a file, then go to that file's Top node + ;; Otherwise, go to the global directory + (if file + (progn + (setq args (cdr args)) + (Info-find-node file "Top")) + (Info-directory)) + + ;; Treat all remaining args as menu references + (while args + (Info-menu (car args)) + (setq args (cdr args))))) + (defun eshell-remove-entries (path files &optional top-level) "From PATH, remove all of the given FILES, perhaps interactively." (while files @@ -930,7 +959,10 @@ Show wall-clock time elapsed during execution of COMMAND.") (add-hook 'eshell-post-command-hook 'eshell-show-elapsed-time nil t) ;; after setting (throw 'eshell-replace-command - (eshell-parse-command (car time-args) (cdr time-args)))))) + (eshell-parse-command (car time-args) +;;; http://lists.gnu.org/archive/html/bug-gnu-emacs/2007-08/msg00205.html + (eshell-stringify-list + (eshell-flatten-list (cdr time-args)))))))) (defalias 'eshell/whoami 'user-login-name) diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el index e1a0f73a866..2da81996dfd 100644 --- a/lisp/eshell/esh-mode.el +++ b/lisp/eshell/esh-mode.el @@ -165,7 +165,8 @@ number, if the function `eshell-truncate-buffer' is on :group 'eshell-mode) (defcustom eshell-output-filter-functions - '(eshell-handle-control-codes + '(eshell-postoutput-scroll-to-bottom + eshell-handle-control-codes eshell-watch-for-password-prompt) "*Functions to call before output is displayed. These functions are only called for output that is displayed @@ -883,9 +884,6 @@ This function should be in the list `eshell-output-filter-functions'." nil t) (set-buffer current)))) -(custom-add-option 'eshell-output-filter-functions - 'eshell-postoutput-scroll-to-bottom) - (defun eshell-beginning-of-input () "Return the location of the start of the previous input." eshell-last-input-start) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 0cf879fd264..89d9d75c60e 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,64 @@ +2007-10-04 Juanma Barranquero <lekktu@gmail.com> + + * sieve-manage.el (sieve-manage-interactive-login): Doc fix. + (sieve-manage-open): Use `mapc' instead of `mapcar'. + +2007-10-02 Stefan Monnier <monnier@iro.umontreal.ca> + + * gnus-uu.el (gnus-uu-reginize-string, gnus-uu-expand-numbers): + Don't hardcode point-min==1. + +2007-09-30 David Kastrup <dak@gnu.org> + + * gnus-art.el (gnus-article-reply-with-original) + (gnus-article-followup-with-original): When `transient-mark-mode' is + off, refrain from active-region behavior for followups. + +2007-10-08 Reiner Steib <Reiner.Steib@gmx.de> + + * mm-util.el (mm-charset-synonym-alist): Alias gbk to cp936. + +2007-10-04 Reiner Steib <Reiner.Steib@gmx.de> + + * Relicense "GPLv2 or later" files to "GPLv3 or later". + +2007-09-13 Katsumi Yamaoka <yamaoka@jpl.org> + + * gnus-sum.el (gnus-newsgroup-maximum-articles): Move from gnus.el. + Suggested by Leo <sdl.web@gmail.com>. + + * gnus.el: Do. + +2007-09-13 Katsumi Yamaoka <yamaoka@jpl.org> + + * gnus.el (gnus-newsgroup-maximum-articles): Rename from + gnus-maximum-newsgroup. Suggested by Leo <sdl.web@gmail.com>. + + * gnus-agent.el (gnus-agent-fetch-headers): Do. + + * gnus-sum.el (gnus-articles-to-read, gnus-list-of-unread-articles) + (gnus-list-of-read-articles, gnus-sequence-of-unread-articles): Do. + +2007-09-13 Katsumi Yamaoka <yamaoka@jpl.org> + + * nnmbox.el (nnmbox-request-article): Don't assume delim regexp matches + newline. + (nnmbox-request-accept-article): Don't change article in source buffer; + narrow to header to use message-fetch-field rather than + nnmail-fetch-field; use with-current-buffer instead of save-excursion. + (nnmbox-request-replace-article): Quote lines that'll be misidentified + as delimiters; make sure article ends with newline. + (nnmbox-delete-mail): Correct last position of article to be deleted; + ignore X-Gnus-Newsgroup header in article body. + (nnmbox-save-mail): Quote lines looking like delimiters at the right + positions; make sure article ends with newline. + +2007-09-05 Katsumi Yamaoka <yamaoka@jpl.org> + + * gnus-cus.el (gnus-score-extra): New widget. + (gnus-score-extra-convert): New function. + (gnus-score-customize): Use it for Extra. + 2007-08-23 Katsumi Yamaoka <yamaoka@jpl.org> * mml.el (mml-generate-mime): Make sure it uses multibyte temp buffer. diff --git a/lisp/gnus/gnus-agent.el b/lisp/gnus/gnus-agent.el index 347b57983e6..21b442aebbb 100644 --- a/lisp/gnus/gnus-agent.el +++ b/lisp/gnus/gnus-agent.el @@ -1765,12 +1765,13 @@ article numbers will be returned." (gnus-agent-find-parameter group 'agent-predicate))))) (articles (if fetch-all - (if gnus-maximum-newsgroup + (if gnus-newsgroup-maximum-articles (let ((active (gnus-active group))) (gnus-uncompress-range (cons (max (car active) (- (cdr active) - gnus-maximum-newsgroup -1)) + gnus-newsgroup-maximum-articles + -1)) (cdr active)))) (gnus-uncompress-range (gnus-active group))) (gnus-list-of-unread-articles group))) diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 696222e0043..a02a7d153bb 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -5749,7 +5749,7 @@ the entire article will be yanked." (interactive "P") (let ((article (cdr gnus-article-current)) contents) - (if (not (gnus-mark-active-p)) + (if (not (gnus-region-active-p)) (with-current-buffer gnus-summary-buffer (gnus-summary-reply (list (list article)) wide)) (setq contents (buffer-substring (point) (mark t))) @@ -5768,7 +5768,7 @@ the entire article will be yanked." (interactive) (let ((article (cdr gnus-article-current)) contents) - (if (not (gnus-mark-active-p)) + (if (not (gnus-region-active-p)) (with-current-buffer gnus-summary-buffer (gnus-summary-followup (list (list article)))) (setq contents (buffer-substring (point) (mark t))) diff --git a/lisp/gnus/gnus-cus.el b/lisp/gnus/gnus-cus.el index f1719eb04f4..1470f0cbac1 100644 --- a/lisp/gnus/gnus-cus.el +++ b/lisp/gnus/gnus-cus.el @@ -766,6 +766,67 @@ eh?"))) ,group)))) widget) +(define-widget 'gnus-score-extra 'group + "Edit score entries for extra headers." + :convert-widget 'gnus-score-extra-convert) + +(defun gnus-score-extra-convert (widget) + ;; Set args appropriately. + (let* ((tag (widget-get widget :tag)) + (item `(const :format "" :value ,(downcase tag))) + (match '(string :tag "Match")) + (score '(choice :tag "Score" + (const :tag "default" nil) + (integer :format "%v" + :hide-front-space t))) + (expire '(choice :tag "Expire" + (const :tag "off" nil) + (integer :format "%v" + :hide-front-space t))) + (type '(choice :tag "Type" + :value s + ;; I should really create a forgiving :match + ;; function for each type below, that only + ;; looked at the first letter. + (const :tag "Regexp" r) + (const :tag "Regexp (fixed case)" R) + (const :tag "Substring" s) + (const :tag "Substring (fixed case)" S) + (const :tag "Exact" e) + (const :tag "Exact (fixed case)" E) + (const :tag "Word" w) + (const :tag "Word (fixed case)" W) + (const :tag "default" nil))) + (header (if gnus-extra-headers + (let (name) + `(choice :tag "Header" + ,@(mapcar (lambda (h) + (setq name (symbol-name h)) + (list 'const :tag name name)) + gnus-extra-headers) + (string :tag "Other" :format "%v"))) + '(string :tag "Header"))) + (group `(group ,match ,score ,expire ,type ,header)) + (doc (concat (or (widget-get widget :doc) + (concat "Change score based on the " tag + " header.\n"))))) + (widget-put + widget :args + `(,item + (repeat :inline t + :indent 0 + :tag ,tag + :doc ,doc + :format "%t:\n%h%v%i\n\n" + (choice :format "%v" + :value ("" nil nil s + ,(if gnus-extra-headers + (symbol-name (car gnus-extra-headers)) + "")) + ,group + sexp))))) + widget) + (defvar gnus-custom-scores) (defvar gnus-custom-score-alist) @@ -822,7 +883,7 @@ if you do all your changes will be lost. ") (gnus-score-string :tag "Subject") (gnus-score-string :tag "References") (gnus-score-string :tag "Xref") - (gnus-score-string :tag "Extra") + (gnus-score-extra :tag "Extra") (gnus-score-string :tag "Message-ID") (gnus-score-integer :tag "Lines") (gnus-score-integer :tag "Chars") diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 851ec88c96f..36e93796a63 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -1029,6 +1029,17 @@ default charset will be used instead." :type '(repeat symbol) :group 'gnus-charset) +(defcustom gnus-newsgroup-maximum-articles nil + "The maximum number of articles a newsgroup. +If this is a number, old articles in a newsgroup exceeding this number +are silently ignored. If it is nil, no article is ignored. Note that +setting this variable to a number might prevent you from reading very +old articles." + :group 'gnus-group-select + :version "22.2" + :type '(choice (const :tag "No limit" nil) + integer)) + (gnus-define-group-parameter ignored-charsets :type list @@ -5472,11 +5483,13 @@ If SELECT-ARTICLES, only select those articles from GROUP." ;; articles in the group, or (if that's nil), the ;; articles in the cache. (or - (if gnus-maximum-newsgroup + (if gnus-newsgroup-maximum-articles (let ((active (gnus-active group))) (gnus-uncompress-range (cons (max (car active) - (- (cdr active) gnus-maximum-newsgroup -1)) + (- (cdr active) + gnus-newsgroup-maximum-articles + -1)) (cdr active)))) (gnus-uncompress-range (gnus-active group))) (gnus-cache-articles-in-group group)) @@ -6540,8 +6553,9 @@ displayed, no centering will be performed." (let* ((read (gnus-info-read (gnus-get-info group))) (active (or (gnus-active group) (gnus-activate-group group))) (last (cdr active)) - (bottom (if gnus-maximum-newsgroup - (max (car active) (- last gnus-maximum-newsgroup -1)) + (bottom (if gnus-newsgroup-maximum-articles + (max (car active) + (- last gnus-newsgroup-maximum-articles -1)) (car active))) first nlast unread) ;; If none are read, then all are unread. @@ -6585,9 +6599,11 @@ displayed, no centering will be performed." (gnus-list-range-difference (gnus-sorted-complement (gnus-uncompress-range - (if gnus-maximum-newsgroup + (if gnus-newsgroup-maximum-articles (cons (max (car active) - (- (cdr active) gnus-maximum-newsgroup -1)) + (- (cdr active) + gnus-newsgroup-maximum-articles + -1)) (cdr active)) active)) (gnus-list-of-unread-articles group)) @@ -6601,8 +6617,9 @@ displayed, no centering will be performed." (let* ((read (gnus-info-read (gnus-get-info group))) (active (or (gnus-active group) (gnus-activate-group group))) (last (cdr active)) - (bottom (if gnus-maximum-newsgroup - (max (car active) (- last gnus-maximum-newsgroup -1)) + (bottom (if gnus-newsgroup-maximum-articles + (max (car active) + (- last gnus-newsgroup-maximum-articles -1)) (car active))) first nlast unread) ;; If none are read, then all are unread. diff --git a/lisp/gnus/gnus-uu.el b/lisp/gnus/gnus-uu.el index 94fb854c960..86253f0deef 100644 --- a/lisp/gnus/gnus-uu.el +++ b/lisp/gnus/gnus-uu.el @@ -1089,7 +1089,7 @@ When called interactively, prompt for REGEXP." nil t) (replace-match "\\1[0-9]+\\2[0-9]+" t nil nil nil)))) - (goto-char 1) + (goto-char (point-min)) (while (re-search-forward "[ \t]+" nil t) (replace-match "[ \t]+" t t)) @@ -1190,7 +1190,7 @@ When called interactively, prompt for REGEXP." (format "%06d" (string-to-number (buffer-substring (match-beginning 0) (match-end 0))))))) - (setq string (buffer-substring 1 (point-max))) + (setq string (buffer-substring (point-min) (point-max))) (setcar (car string-list) string) (setq string-list (cdr string-list)))) out-list)) diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el index 3f75bba6d1c..0e8e9908cf4 100644 --- a/lisp/gnus/gnus.el +++ b/lisp/gnus/gnus.el @@ -1501,17 +1501,6 @@ If it is nil, no confirmation is required." :type '(choice (const :tag "No limit" nil) integer)) -(defcustom gnus-maximum-newsgroup nil - "The maximum number of articles a newsgroup. -If this is a number, old articles in a newsgroup exceeding this number -are silently ignored. If it is nil, no article is ignored. Note that -setting this variable to a number might prevent you from reading very -old articles." - :group 'gnus-group-select - :version "22.2" - :type '(choice (const :tag "No limit" nil) - integer)) - (defcustom gnus-use-long-file-name (not (memq system-type '(usg-unix-v xenix))) "*Non-nil means that the default name of a file to save articles in is the group name. If it's nil, the directory form of the group name is used instead. diff --git a/lisp/gnus/mm-util.el b/lisp/gnus/mm-util.el index eb67313c92a..2c9e4045eca 100644 --- a/lisp/gnus/mm-util.el +++ b/lisp/gnus/mm-util.el @@ -256,6 +256,12 @@ the alias. Else windows-NUMBER is used." ,@(when (and (not (mm-coding-system-p 'windows-31j)) (mm-coding-system-p 'cp932)) '((windows-31j . cp932))) + ;; Charset name: GBK, Charset aliases: CP936, MS936, windows-936 + ;; http://www.iana.org/assignments/charset-reg/GBK + ;; Emacs 22.1 has cp936, but not gbk, so we alias it: + ,@(when (and (not (mm-coding-system-p 'gbk)) + (mm-coding-system-p 'cp936)) + '((gbk . cp936))) ) "A mapping from unknown or invalid charset names to the real charset names. diff --git a/lisp/gnus/nnmbox.el b/lisp/gnus/nnmbox.el index 6127974d24a..fd8ec27d225 100644 --- a/lisp/gnus/nnmbox.el +++ b/lisp/gnus/nnmbox.el @@ -153,11 +153,11 @@ (re-search-backward (concat "^" message-unix-mail-delimiter) nil t) (setq start (point)) (forward-line 1) - (or (and (re-search-forward - (concat "^" message-unix-mail-delimiter) nil t) - (forward-line -1)) - (goto-char (point-max))) - (setq stop (point)) + (setq stop (if (re-search-forward (concat "^" + message-unix-mail-delimiter) + nil 'move) + (match-beginning 0) + (point))) (let ((nntp-server-buffer (or buffer nntp-server-buffer))) (set-buffer nntp-server-buffer) (erase-buffer) @@ -313,39 +313,45 @@ (nnmbox-possibly-change-newsgroup group server) (nnmail-check-syntax) (let ((buf (current-buffer)) - result) - (goto-char (point-min)) - ;; The From line may have been quoted by movemail. - (when (looking-at (concat ">" message-unix-mail-delimiter)) - (delete-char 1)) - (if (looking-at "X-From-Line: ") - (replace-match "From ") - (insert "From nobody " (current-time-string) "\n")) + result cont) (and (nnmail-activate 'nnmbox) - (progn - (set-buffer buf) + (with-temp-buffer + (insert-buffer-substring buf) (goto-char (point-min)) - (search-forward "\n\n" nil t) - (forward-line -1) + (cond (;; The From line may have been quoted by movemail. + (looking-at (concat ">" message-unix-mail-delimiter)) + (delete-char 1) + (forward-line 1)) + ((looking-at "X-From-Line: ") + (replace-match "From ") + (forward-line 1)) + (t + (insert "From nobody " (current-time-string) "\n"))) + (narrow-to-region (point) + (if (search-forward "\n\n" nil 'move) + (1- (point)) + (point))) (while (re-search-backward "^X-Gnus-Newsgroup: " nil t) (delete-region (point) (progn (forward-line 1) (point)))) (when nnmail-cache-accepted-message-ids - (nnmail-cache-insert (nnmail-fetch-field "message-id") + (nnmail-cache-insert (message-fetch-field "message-id") group - (nnmail-fetch-field "subject") - (nnmail-fetch-field "from"))) + (message-fetch-field "subject") + (message-fetch-field "from"))) + (widen) (setq result (if (stringp group) (list (cons group (nnmbox-active-number group))) (nnmail-article-group 'nnmbox-active-number))) - (if (and (null result) - (yes-or-no-p "Moved to `junk' group; delete article? ")) - (setq result 'junk) - (setq result (car (nnmbox-save-mail result))))) - (save-excursion - (set-buffer nnmbox-mbox-buffer) + (prog1 + (if (and (null result) + (yes-or-no-p "Moved to `junk' group; delete article? ")) + (setq result 'junk) + (setq result (car (nnmbox-save-mail result)))) + (setq cont (buffer-string)))) + (with-current-buffer nnmbox-mbox-buffer (goto-char (point-max)) - (insert-buffer-substring buf) + (insert cont) (when last (when nnmail-cache-accepted-message-ids (nnmail-cache-close)) @@ -360,7 +366,20 @@ (if (not (nnmbox-find-article article)) nil (nnmbox-delete-mail t t) - (insert-buffer-substring buffer) + (insert + (with-temp-buffer + (insert-buffer-substring buffer) + (goto-char (point-min)) + (when (looking-at "X-From-Line:") + (delete-region (point) (progn (forward-line 1) (point)))) + (while (re-search-forward (concat "^" message-unix-mail-delimiter) + nil t) + (goto-char (match-beginning 0)) + (insert ">")) + (goto-char (point-max)) + (unless (bolp) + (insert "\n")) + (buffer-string))) (nnmbox-save-buffer) t))) @@ -430,21 +449,20 @@ (save-excursion (save-restriction (narrow-to-region - (save-excursion - (re-search-backward (concat "^" message-unix-mail-delimiter) nil t) - (if leave-delim (progn (forward-line 1) (point)) - (match-beginning 0))) - (progn - (forward-line 1) - (or (and (re-search-forward (concat "^" message-unix-mail-delimiter) - nil t) - (if (and (not (bobp)) leave-delim) - (progn (forward-line -2) (point)) - (match-beginning 0))) - (point-max)))) + (prog2 + (re-search-backward (concat "^" message-unix-mail-delimiter) nil t) + (if leave-delim (progn (forward-line 1) (point)) + (match-beginning 0)) + (forward-line 1)) + (or (and (re-search-forward (concat "^" message-unix-mail-delimiter) + nil t) + (match-beginning 0)) + (point-max))) (goto-char (point-min)) ;; Only delete the article if no other group owns it as well. - (when (or force (not (re-search-forward "^X-Gnus-Newsgroup: " nil t))) + (when (or force + (not (re-search-forward "^X-Gnus-Newsgroup: " nil t)) + (search-backward "\n\n" nil t)) (delete-region (point-min) (point-max)))))) (defun nnmbox-possibly-change-newsgroup (newsgroup &optional server) @@ -552,24 +570,26 @@ (let ((delim (concat "^" message-unix-mail-delimiter))) (goto-char (point-min)) ;; This might come from somewhere else. - (unless (looking-at delim) - (insert "From nobody " (current-time-string) "\n") - (goto-char (point-min))) + (if (looking-at delim) + (forward-line 1) + (insert "From nobody " (current-time-string) "\n")) ;; Quote all "From " lines in the article. - (forward-line 1) (while (re-search-forward delim nil t) - (beginning-of-line) - (insert "> ")) - (nnmail-insert-lines) - (nnmail-insert-xref group-art) - (nnmbox-insert-newsgroup-line group-art) - (let ((alist group-art)) - (while alist - (nnmbox-record-active-article (car alist)) - (setq alist (cdr alist)))) - (run-hooks 'nnmail-prepare-save-mail-hook) - (run-hooks 'nnmbox-prepare-save-mail-hook) - group-art)) + (goto-char (match-beginning 0)) + (insert ">"))) + (goto-char (point-max)) + (unless (bolp) + (insert "\n")) + (nnmail-insert-lines) + (nnmail-insert-xref group-art) + (nnmbox-insert-newsgroup-line group-art) + (let ((alist group-art)) + (while alist + (nnmbox-record-active-article (car alist)) + (setq alist (cdr alist)))) + (run-hooks 'nnmail-prepare-save-mail-hook) + (run-hooks 'nnmbox-prepare-save-mail-hook) + group-art) (defun nnmbox-insert-newsgroup-line (group-art) (save-excursion diff --git a/lisp/gnus/sieve-manage.el b/lisp/gnus/sieve-manage.el index e33e5d87ca6..2f0e54a234b 100644 --- a/lisp/gnus/sieve-manage.el +++ b/lisp/gnus/sieve-manage.el @@ -183,7 +183,7 @@ Valid states are `closed', `initial', `nonauth', and `auth'.") (defun sieve-manage-interactive-login (buffer loginfunc) "Login to server in BUFFER. LOGINFUNC is passed a username and a password, it should return t if -it where sucessful authenticating itself to the server, nil otherwise. +it was successful authenticating itself to the server, nil otherwise. Returns t if login was successful, nil otherwise." (with-current-buffer buffer (make-local-variable 'sieve-manage-username) @@ -372,7 +372,7 @@ Optional variable BUFFER is buffer (buffer, or string naming buffer) to work in." (setq buffer (or buffer (format " *sieve* %s:%d" server (or port 2000)))) (with-current-buffer (get-buffer-create buffer) - (mapcar 'make-local-variable sieve-manage-local-variables) + (mapc 'make-local-variable sieve-manage-local-variables) (sieve-manage-disable-multibyte) (buffer-disable-undo) (setq sieve-manage-server (or server sieve-manage-server)) diff --git a/lisp/international/characters.el b/lisp/international/characters.el index 57ed3e5bb1f..5ea618c7b50 100644 --- a/lisp/international/characters.el +++ b/lisp/international/characters.el @@ -1170,9 +1170,9 @@ (?C . ?K) ; Chinese - Katakana )) -;;; Local Variables: -;;; coding: utf-8-emacs -;;; End: +;; Local Variables: +;; coding: utf-8-emacs +;; End: -;;; arch-tag: 85889c35-9f4d-4912-9bf5-82de31b0d42d +;; arch-tag: 85889c35-9f4d-4912-9bf5-82de31b0d42d ;;; characters.el ends here diff --git a/lisp/international/encoded-kb.el b/lisp/international/encoded-kb.el index 3956fd51bd3..62fa884a9ac 100644 --- a/lisp/international/encoded-kb.el +++ b/lisp/international/encoded-kb.el @@ -34,7 +34,7 @@ ;; Usually this map is empty (even if Encoded-kbd mode is on), but if ;; the keyboard coding system is iso-2022-based, it defines dummy key ;; bindings for ESC $ ..., etc. so that those bindings in -;; key-translation-map take effect. +;; input-decode-map take effect. (defconst encoded-kbd-mode-map (make-sparse-keymap) "Keymap for Encoded-kbd minor mode.") @@ -236,7 +236,7 @@ The following key sequence may cause multilingual text insertion." len (1- len))) (vector char))) -(defun encoded-kbd-setup-keymap (coding) +(defun encoded-kbd-setup-keymap (keymap coding) ;; At first, reset the keymap. (define-key encoded-kbd-mode-map "\e" nil) ;; Then setup the keymap according to the keyboard coding system. @@ -244,7 +244,7 @@ The following key sequence may cause multilingual text insertion." ((eq (coding-system-type coding) 'shift-jis) (let ((i 128)) (while (< i 256) - (define-key key-translation-map + (define-key keymap (vector i) 'encoded-kbd-self-insert-sjis) (setq i (1+ i)))) 8) @@ -260,7 +260,7 @@ The following key sequence may cause multilingual text insertion." (let ((from (max (car elt) 128)) (to (cdr elt))) (while (<= from to) - (define-key key-translation-map + (define-key keymap (vector from) 'encoded-kbd-self-insert-charset) (setq from (1+ from))))) 8) @@ -285,20 +285,20 @@ The following key sequence may cause multilingual text insertion." (aset encoded-kbd-iso2022-invocations 1 1)) (when (memq 'designation flags) (define-key encoded-kbd-mode-map "\e" 'encoded-kbd-iso2022-esc-prefix) - (define-key key-translation-map "\e" 'encoded-kbd-iso2022-esc-prefix)) + (define-key keymap "\e" 'encoded-kbd-iso2022-esc-prefix)) (when (or (aref designation 2) (aref designation 3)) - (define-key key-translation-map + (define-key keymap [?\216] 'encoded-kbd-iso2022-single-shift) - (define-key key-translation-map + (define-key keymap [?\217] 'encoded-kbd-iso2022-single-shift)) (or (eq (aref designation 0) 'ascii) (dotimes (i 96) - (define-key key-translation-map + (define-key keymap (vector (+ 32 i)) 'encoded-kbd-self-insert-iso2022-7bit))) (if (memq '7-bit flags) t (dotimes (i 96) - (define-key key-translation-map + (define-key keymap (vector (+ 160 i)) 'encoded-kbd-self-insert-iso2022-8bit)) 8)))) @@ -313,7 +313,7 @@ The following key sequence may cause multilingual text insertion." (setq from (setq to elt))) (while (<= from to) (if (>= from 128) - (define-key key-translation-map + (define-key keymap (vector from) 'encoded-kbd-self-insert-ccl)) (setq from (1+ from)))) 8)) @@ -321,7 +321,7 @@ The following key sequence may cause multilingual text insertion." ((eq (coding-system-type coding) 'utf-8) (let ((i #xC0)) (while (< i 256) - (define-key key-translation-map + (define-key keymap (vector i) 'encoded-kbd-self-insert-utf-8) (setq i (1+ i)))) 8) @@ -329,12 +329,9 @@ The following key sequence may cause multilingual text insertion." (t nil))) -;; key-translation-map at the time Encoded-kbd mode is turned on is -;; saved here. -(defvar saved-key-translation-map nil) - -;; Input mode at the time Encoded-kbd mode is turned on is saved here. -(defvar saved-input-mode nil) +;;;###autoload +(defun encoded-kbd-setup-display (display) + "Set up a `input-decode-map' for `keyboard-coding-system' on DISPLAY. (put 'encoded-kbd-mode 'permanent-local t) ;;;###autoload @@ -386,5 +383,5 @@ as a multilingual text encoded in a coding system set by (provide 'encoded-kb) -;;; arch-tag: 76f0f9b3-65e7-45c3-b692-59509a87ad44 +;; arch-tag: 76f0f9b3-65e7-45c3-b692-59509a87ad44 ;;; encoded-kb.el ends here diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index 71f8168558f..164c3d7ca99 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el @@ -151,7 +151,7 @@ t) (define-key-after set-coding-system-map [set-terminal-coding-system] '(menu-item "For Terminal" set-terminal-coding-system - :enable (null (memq window-system '(x w32 mac))) + :enable (null (memq initial-window-system '(x w32 mac))) :help "How to encode terminal output") t) (define-key-after set-coding-system-map [separator-3] @@ -1767,7 +1767,7 @@ The default status is as follows: (reset-language-environment) -(defun set-display-table-and-terminal-coding-system (language-name &optional coding-system) +(defun set-display-table-and-terminal-coding-system (language-name &optional coding-system display) "Set up the display table and terminal coding system for LANGUAGE-NAME." (let ((coding (get-language-info language-name 'unibyte-display))) (if (and coding @@ -1783,7 +1783,7 @@ The default status is as follows: (dotimes (i 128) (aset standard-display-table (+ i 128) nil)))) (or (eq window-system 'pc) - (set-terminal-coding-system (or coding-system coding))))) + (set-terminal-coding-system (or coding-system coding) display)))) (defun set-language-environment (language-name) "Set up multi-lingual environment for using LANGUAGE-NAME. @@ -2410,7 +2410,7 @@ is returned. Thus, for instance, if charset \"ISO8859-2\", ;; too, for setting things such as calendar holidays, ps-print paper ;; size, spelling dictionary. -(defun set-locale-environment (&optional locale-name) +(defun set-locale-environment (&optional locale-name frame) "Set up multi-lingual environment for using LOCALE-NAME. This sets the language environment, the coding system priority, the default input method and sometimes other things. @@ -2431,6 +2431,10 @@ directory named `/usr/share/locale' or `/usr/lib/locale'. LOCALE-NAME will be translated according to the table specified by `locale-translation-file-name'. +If FRAME is non-nil, only set the keyboard coding system and the +terminal coding system for the terminal of that frame, and don't +touch session-global parameters like the language environment. + See also `locale-charset-language-names', `locale-language-names', `locale-preferred-coding-systems' and `locale-coding-system'." (interactive "sSet environment for locale: ") @@ -2460,7 +2464,7 @@ See also `locale-charset-language-names', `locale-language-names', (let ((vars '("LC_ALL" "LC_CTYPE" "LANG"))) (while (and vars (= 0 (length locale))) ; nil or empty string - (setq locale (getenv (pop vars)))))) + (setq locale (getenv (pop vars) frame))))) (unless locale ;; The two tests are kept separate so the byte-compiler sees @@ -2535,28 +2539,34 @@ See also `locale-charset-language-names', `locale-language-names', ;; Set up for this character set. This is now the right way ;; to do it for both unibyte and multibyte modes. - (set-language-environment language-name) + (unless frame + (set-language-environment language-name)) ;; If default-enable-multibyte-characters is nil, ;; we are using single-byte characters, ;; so the display table and terminal coding system are irrelevant. (when default-enable-multibyte-characters (set-display-table-and-terminal-coding-system - language-name coding-system)) + language-name coding-system frame)) ;; Set the `keyboard-coding-system' if appropriate (tty ;; only). At least X and MS Windows can generate ;; multilingual input. - (unless window-system - (let ((kcs (or coding-system - (car (get-language-info language-name - 'coding-system))))) - (if kcs (set-keyboard-coding-system kcs)))) - - (setq locale-coding-system - (car (get-language-info language-name 'coding-priority)))) - - (when (and coding-system + ;; XXX This was disabled unless `window-system', but that + ;; leads to buggy behaviour when a tty frame is opened + ;; later. Setting the keyboard coding system has no adverse + ;; effect on X, so let's do it anyway. -- Lorentey + (let ((kcs (or coding-system + (car (get-language-info language-name + 'coding-system))))) + (if kcs (set-keyboard-coding-system kcs frame))) + + (unless frame + (setq locale-coding-system + (car (get-language-info language-name 'coding-priority))))) + + (when (and (not frame) + coding-system (not (coding-system-equal coding-system locale-coding-system))) (prefer-coding-system coding-system) @@ -2585,9 +2595,9 @@ system codeset `%s' for this locale." coding-system codeset)))))))) (when (boundp 'w32-ansi-code-page) (let ((code-page-coding (intern (format "cp%d" w32-ansi-code-page)))) (when (coding-system-p code-page-coding) - (setq locale-coding-system code-page-coding) - (set-keyboard-coding-system code-page-coding) - (set-terminal-coding-system code-page-coding)))) + (unless frame (setq locale-coding-system code-page-coding)) + (set-keyboard-coding-system code-page-coding frame) + (set-terminal-coding-system code-page-coding frame)))) (when (eq system-type 'darwin) ;; On Darwin, file names are always encoded in utf-8, no matter @@ -2596,38 +2606,39 @@ system codeset `%s' for this locale." coding-system codeset)))))))) ;; Mac OS X's Terminal.app by default uses utf-8 regardless of ;; the locale. (when (and (null window-system) - (equal (getenv "TERM_PROGRAM") "Apple_Terminal")) + (equal (getenv "TERM_PROGRAM" frame) "Apple_Terminal")) (set-terminal-coding-system 'utf-8) (set-keyboard-coding-system 'utf-8))) ;; Default to A4 paper if we're not in a C, POSIX or US locale. ;; (See comments in Flocale_info.) - (let ((locale locale) - (paper (locale-info 'paper))) - (if paper - ;; This will always be null at the time of writing. - (cond - ((equal paper '(216 279)) - (setq ps-paper-type 'letter)) - ((equal paper '(210 297)) - (setq ps-paper-type 'a4))) - (let ((vars '("LC_ALL" "LC_PAPER" "LANG"))) - (while (and vars (= 0 (length locale))) - (setq locale (getenv (pop vars))))) - (when locale - ;; As of glibc 2.2.5, these are the only US Letter locales, - ;; and the rest are A4. - (setq ps-paper-type - (or (locale-name-match locale '(("c$" . letter) - ("posix$" . letter) - (".._us" . letter) - (".._pr" . letter) - (".._ca" . letter) - ("enu$" . letter) ; Windows - ("esu$" . letter) - ("enc$" . letter) - ("frc$" . letter))) - 'a4)))))) + (unless frame + (let ((locale locale) + (paper (locale-info 'paper))) + (if paper + ;; This will always be null at the time of writing. + (cond + ((equal paper '(216 279)) + (setq ps-paper-type 'letter)) + ((equal paper '(210 297)) + (setq ps-paper-type 'a4))) + (let ((vars '("LC_ALL" "LC_PAPER" "LANG"))) + (while (and vars (= 0 (length locale))) + (setq locale (getenv (pop vars) frame)))) + (when locale + ;; As of glibc 2.2.5, these are the only US Letter locales, + ;; and the rest are A4. + (setq ps-paper-type + (or (locale-name-match locale '(("c$" . letter) + ("posix$" . letter) + (".._us" . letter) + (".._pr" . letter) + (".._ca" . letter) + ("enu$" . letter) ; Windows + ("esu$" . letter) + ("enc$" . letter) + ("frc$" . letter))) + 'a4))))))) nil) ;;; Character property diff --git a/lisp/international/mule-diag.el b/lisp/international/mule-diag.el index 75bf45f0525..b3f3b7eb006 100644 --- a/lisp/international/mule-diag.el +++ b/lisp/international/mule-diag.el @@ -638,7 +638,7 @@ Priority order for recognizing coding systems when reading files:\n") coding-system codings) (while categories (setq coding-system (symbol-value (car categories))) - (mapcar + (mapc (lambda (x) (if (and (not (eq x coding-system)) (let ((flags (coding-system-get :flags))) diff --git a/lisp/international/mule.el b/lisp/international/mule.el index c41cfbd1588..83468d25916 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el @@ -1211,13 +1211,17 @@ see) to CODING-SYSTEM." This is normally set according to the selected language environment. See also the command `set-terminal-coding-system'.") -(defun set-terminal-coding-system (coding-system) - "Set coding system of your terminal to CODING-SYSTEM. -All text output to the terminal will be encoded +(defun set-terminal-coding-system (coding-system &optional display) + "Set coding system of terminal output to CODING-SYSTEM. +All text output to DISPLAY will be encoded with the specified coding system. + For a list of possible values of CODING-SYSTEM, use \\[list-coding-systems]. The default is determined by the selected language environment -or by the previous use of this command." +or by the previous use of this command. + +DISPLAY may be a display id, a frame, or nil for the selected frame's display. +The setting has no effect on graphical displays." (interactive (list (let ((default (if (and (not (terminal-coding-system)) default-terminal-coding-system) @@ -1231,7 +1235,7 @@ or by the previous use of this command." (setq coding-system default-terminal-coding-system)) (if coding-system (setq default-terminal-coding-system coding-system)) - (set-terminal-coding-system-internal coding-system) + (set-terminal-coding-system-internal coding-system display) (redraw-frame (selected-frame))) (defvar default-keyboard-coding-system nil @@ -1239,14 +1243,17 @@ or by the previous use of this command." This is normally set according to the selected language environment. See also the command `set-keyboard-coding-system'.") -(defun set-keyboard-coding-system (coding-system) - "Set coding system for keyboard input to CODING-SYSTEM. -In addition, this command enables Encoded-kbd minor mode. -\(If CODING-SYSTEM is nil, Encoded-kbd mode is turned off -- see -`encoded-kbd-mode'.) +(defun set-keyboard-coding-system (coding-system &optional display) + "Set coding system for keyboard input on DISPLAY to CODING-SYSTEM. +In addition, this command calls `encoded-kbd-setup-display' to set up the +translation of keyboard input events to the specified coding system. + For a list of possible values of CODING-SYSTEM, use \\[list-coding-systems]. The default is determined by the selected language environment -or by the previous use of this command." +or by the previous use of this command. + +DISPLAY may be a display id, a frame, or nil for the selected frame's display. +The setting has no effect on graphical displays." (interactive (list (let ((default (if (and (not (keyboard-coding-system)) default-keyboard-coding-system) @@ -1264,9 +1271,9 @@ or by the previous use of this command." (not (coding-system-get coding-system :ascii-compatible-p)) (not (coding-system-get coding-system :suitable-for-keyboard))) (error "%s is not suitable for keyboard" coding-system)) - (set-keyboard-coding-system-internal coding-system) + (set-keyboard-coding-system-internal coding-system display) (setq keyboard-coding-system coding-system) - (encoded-kbd-mode (if coding-system 1 0))) + (encoded-kbd-setup-display display)) (defcustom keyboard-coding-system nil "Specify coding system for keyboard input. @@ -1282,8 +1289,8 @@ use either \\[customize] or \\[set-keyboard-coding-system]." :link '(info-link "(emacs)Terminal Coding") :link '(info-link "(emacs)Unibyte Mode") :set (lambda (symbol value) - ;; Don't load encoded-kbd-mode unnecessarily. - (if (or value (boundp 'encoded-kbd-mode)) + ;; Don't load encoded-kb unnecessarily. + (if (or value (boundp 'encoded-kbd-setup-display)) (set-keyboard-coding-system value) (set-default 'keyboard-coding-system nil))) ; must initialize :version "22.1" @@ -1569,8 +1576,9 @@ text, and convert it in the temporary buffer. Otherwise, convert in-place." (defcustom auto-coding-alist ;; .exe and .EXE are added to support archive-mode looking at DOS ;; self-extracting exe archives. - '(("\\.\\(arc\\|zip\\|lzh\\|lha\\|zoo\\|[jew]ar\\|xpi\\|exe\\)\\'" . no-conversion) - ("\\.\\(ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\|EXE\\)\\'" . no-conversion) + '(("\\.\\(\ +arc\\|zip\\|lzh\\|lha\\|zoo\\|[jew]ar\\|xpi\\|exe\\|rar\\|\ +ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\|EXE\\|RAR\\)\\'" . no-conversion) ("\\.\\(sx[dmicw]\\|odt\\|tar\\|tgz\\)\\'" . no-conversion) ("\\.\\(gz\\|Z\\|bz\\|bz2\\|gpg\\)\\'" . no-conversion) ("\\.\\(jpe?g\\|png\\|gif\\|tiff?\\|p[bpgn]m\\)\\'" . no-conversion) @@ -2284,25 +2292,26 @@ This function is intended to be added to `auto-coding-functions'." (defun sgml-html-meta-auto-coding-function (size) "If the buffer has an HTML meta tag, use it to determine encoding. This function is intended to be added to `auto-coding-functions'." - (setq size (min (+ (point) size) - (save-excursion - ;; Limit the search by the end of the HTML header. - (or (search-forward "</head>" size t) - ;; In case of no header, search only 10 lines. - (forward-line 10)) - (point)))) - ;; Make sure that the buffer really contains an HTML document, by - ;; checking that it starts with a doctype or a <HTML> start tag - ;; (allowing for whitespace at bob). Note: 'DOCTYPE NETSCAPE' is - ;; useful for Mozilla bookmark files. - (when (and (re-search-forward "\\`[[:space:]\n]*\\(<!doctype[[:space:]\n]+\\(html\\|netscape\\)\\|<html\\)" size t) - (re-search-forward "<meta\\s-+http-equiv=[\"']?content-type[\"']?\\s-+content=[\"']text/\\sw+;\\s-*charset=\\(.+?\\)[\"']" size t)) - (let* ((match (match-string 1)) - (sym (intern (downcase match)))) - (if (coding-system-p sym) - sym - (message "Warning: unknown coding system \"%s\"" match) - nil)))) + (let ((case-fold-search t)) + (setq size (min (+ (point) size) + (save-excursion + ;; Limit the search by the end of the HTML header. + (or (search-forward "</head>" size t) + ;; In case of no header, search only 10 lines. + (forward-line 10)) + (point)))) + ;; Make sure that the buffer really contains an HTML document, by + ;; checking that it starts with a doctype or a <HTML> start tag + ;; (allowing for whitespace at bob). Note: 'DOCTYPE NETSCAPE' is + ;; useful for Mozilla bookmark files. + (when (and (re-search-forward "\\`[[:space:]\n]*\\(<!doctype[[:space:]\n]+\\(html\\|netscape\\)\\|<html\\)" size t) + (re-search-forward "<meta\\s-+http-equiv=[\"']?content-type[\"']?\\s-+content=[\"']text/\\sw+;\\s-*charset=\\(.+?\\)[\"']" size t)) + (let* ((match (match-string 1)) + (sym (intern (downcase match)))) + (if (coding-system-p sym) + sym + (message "Warning: unknown coding system \"%s\"" match) + nil))))) ;;; (provide 'mule) diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el index 70169615b0d..ce98a608665 100644 --- a/lisp/mail/emacsbug.el +++ b/lisp/mail/emacsbug.el @@ -158,7 +158,7 @@ usually do not have translators to read other languages for them.\n\n") (insert "configured using `configure " system-configuration-options "'\n\n")) (insert "Important settings:\n") - (mapcar + (mapc '(lambda (var) (insert (format " value of $%s: %s\n" var (getenv var)))) '("LC_ALL" "LC_COLLATE" "LC_CTYPE" "LC_MESSAGES" diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el index 324ce427b09..34a0aa0ad82 100644 --- a/lisp/mail/sendmail.el +++ b/lisp/mail/sendmail.el @@ -767,7 +767,13 @@ Prefix arg means don't delete this window." "Bury this mail buffer." (let ((newbuf (other-buffer (current-buffer)))) (bury-buffer (current-buffer)) - (if (and (or (window-dedicated-p (frame-selected-window)) + (if (and (or nil + ;; In this case, we need to go to a different frame. + (window-dedicated-p (frame-selected-window)) + ;; In this mode of operation, the frame was probably + ;; made for this buffer, so the user probably wants + ;; to delete it now. + (and pop-up-frames (one-window-p)) (cdr (assq 'mail-dedicated-frame (frame-parameters)))) (not (null (delq (selected-frame) (visible-frame-list))))) (progn diff --git a/lisp/mail/supercite.el b/lisp/mail/supercite.el index cf9c9369497..61e7d0a00eb 100644 --- a/lisp/mail/supercite.el +++ b/lisp/mail/supercite.el @@ -1038,12 +1038,12 @@ supplied, is used instead of the line point is on in the current buffer." (let ((elements (length namelist)) (position -1) keepers filtered-list) - (mapcar + (mapc (function (lambda (name) (setq position (1+ position)) (let ((keep-p t)) - (mapcar + (mapc (function (lambda (filter) (let ((regexp (car filter)) @@ -1061,7 +1061,7 @@ supplied, is used instead of the line point is on in the current buffer." (setq keepers (cons position keepers))) ))) namelist) - (mapcar + (mapc (function (lambda (position) (setq filtered-list (cons (nth position namelist) filtered-list)) diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog index 956f7b39cf1..2619e20e6f7 100644 --- a/lisp/mh-e/ChangeLog +++ b/lisp/mh-e/ChangeLog @@ -1,3 +1,7 @@ +2007-09-11 Bill Wohler <wohler@newt.com> + + * mh-e.el (Version, mh-version): Add +cvs to version. + 2007-08-25 Stephen Gildea <gildea@stop.mail-abuse.org> * mh-e.el (mh-annotate-msg-hook): New variable. @@ -8,22 +12,22 @@ 2007-08-21 Jeffrey C Honig <jch@honig.net> * mh-folder.el (mh-folder-message-menu, mh-folder-mode-map): Add - folder mode support for mh-show-preferred-alternative. (Clooses - SF 1777321). + folder mode support for mh-show-preferred-alternative (closes SF + #1777321). * mh-show.el (mh-show-preferred-alternative) (mh-show-write-message-to-file, mh-show-message-menu) (mh-show-mode-map): Add mh-show-preferred-alternative (bound to ":") which will show the message's preferred alternative - overriding the users configured preference. Useful for showing - HTML when text content is lacking. (Closses SF 1777321). + overriding the users configured preference. Useful for showing + HTML when text content is lacking (closes SF #1777321). - * mh-e.el: - (mh-invisible-header-fields-internal): Exclude Fax and Phone. Put + * mh-e.el: + (mh-invisible-header-fields-internal): Exclude Fax and Phone. Put known exclusions as comments before the list and move parens to - separate lines to aid in sorting. (Closes SF 1701231). + separate lines to aid in sorting (closes SF #1701231). - * mh-mime.el (mm-decode-body): remove explicit autoload of + * mh-mime.el (mm-decode-body): Remove explicit autoload of mh-alias-expand. * mh-alias.el (mh-alias-expand): Set up automatic autoload of @@ -34,11 +38,11 @@ * mh-mime.el (message-options-set): Add missing autoloads from my last change. - * mh-comp.el (mh-forward): Address SF 1730393. When forwarding - with mml, messages were included in reverse order. + * mh-comp.el (mh-forward): When forwarding with mml, messages are + no longer included in reverse order (closes SF #1730393). - * mh-mime.el (mh-mml-forward-message): Address SF 1378993 and - forward messages as inline attatchments. + * mh-mime.el (mh-mml-forward-message): Forward messages as inline + attatchments (closes SF #1378993). 2007-08-19 Jeffrey C Honig <jch@honig.net> @@ -46,13 +50,13 @@ Comments: and hide Comment:, not the other way around. * mh-mime.el (mh-mml-to-mime): GPG requires e-mail addresses, not - aliases. So resolve aliases before passing addresses to GPG/PGP. - Closes SF #649226. + aliases. So resolve aliases before passing addresses to GPG/PGP + (closes SF #649226). * mh-e.el (mh-invisible-header-fields-internal): Update with all the entries from http://people.dsv.su.se/~jpalme/ietf/mail-headers, plus some of my - own. I added attributions to entries we already had that did not + own. I added attributions to entries we already had that did not list an RFC. 2007-08-08 Glenn Morris <rgm@gnu.org> diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el index 8c8446e1b7c..faec4db35b7 100644 --- a/lisp/mh-e/mh-e.el +++ b/lisp/mh-e/mh-e.el @@ -6,7 +6,7 @@ ;; Author: Bill Wohler <wohler@newt.com> ;; Maintainer: Bill Wohler <wohler@newt.com> -;; Version: 8.0.3 +;; Version: 8.0.3+cvs ;; Keywords: mail ;; This file is part of GNU Emacs. @@ -133,7 +133,7 @@ ;; Try to keep variables local to a single file. Provide accessors if ;; variables are shared. Use this section as a last resort. -(defconst mh-version "8.0.3" "Version number of MH-E.") +(defconst mh-version "8.0.3+cvs" "Version number of MH-E.") ;; Variants diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index 2f06344ccda..9962fd14613 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -4372,12 +4372,18 @@ NEWNAME should be the name to give the new compressed or uncompressed file.") ;; Treat each name as its own truename. (put 'file-truename 'ange-ftp 'identity) +;; We must return non-nil in order to mask our inability to do the job. +;; Otherwise there are errors when applied to the target file during +;; copying from a (localhost) Tramp file. +(put 'set-file-modes 'ange-ftp 'ignore) +(put 'set-file-times 'ange-ftp 'ignore) + ;; Turn off RCS/SCCS processing to save time. ;; This returns nil for any file name as argument. (put 'vc-registered 'ange-ftp 'null) ;; We can handle process-file in a restricted way (just for chown). -;; Nothing possible for start-file-process. +;; Nothing possible for `start-file-process'. (put 'process-file 'ange-ftp 'ange-ftp-process-file) (put 'start-file-process 'ange-ftp 'ignore) (put 'shell-command 'ange-ftp 'ange-ftp-shell-command) @@ -4574,7 +4580,7 @@ NEWNAME should be the name to give the new compressed or uncompressed file.") (rest (cdr args))) (if (equal "--" (car rest)) (setq rest (cdr rest))) - (mapcar + (mapc (lambda (file) (setq file (expand-file-name file)) (let ((parsed (ange-ftp-ftp-name file))) @@ -6049,8 +6055,8 @@ Other orders of $ and _ seem to all work just fine.") (puthash ".." t tbl) ;; add all additional pubsets, if not listing one of them (if (not (member pubset ange-ftp-bs2000-additional-pubsets)) - (mapcar (lambda (pubset) (puthash pubset t tbl)) - ange-ftp-bs2000-additional-pubsets)) + (mapc (lambda (pubset) (puthash pubset t tbl)) + ange-ftp-bs2000-additional-pubsets)) tbl)) (add-to-list 'ange-ftp-parse-list-func-alist diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index 04f83ed465a..cfb3f2742e9 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -55,6 +55,7 @@ ;; browse-url-default-macosx-browser Mac OS X browser ;; browse-url-gnome-moz GNOME interface to Mozilla ;; browse-url-kde KDE konqueror (kfm) +;; browse-url-elinks Elinks Don't know (tried with 0.12.GIT) ;; [A version of the Netscape browser is now free software ;; <URL:http://www.mozilla.org/>, albeit not GPLed, so it is @@ -71,7 +72,7 @@ ;; control but which window DO you want to control and how do you ;; discover its id? -;; William M. Perry's excellent "w3" WWW browser for +;; William M. Perry's excellent "w3" WWW browser for ;; Emacs <URL:ftp://cs.indiana.edu/pub/elisp/w3/> ;; has a function w3-follow-url-at-point, but that ;; doesn't let you edit the URL like browse-url. @@ -216,7 +217,8 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Variables -(eval-when-compile (require 'thingatpt) +(eval-when-compile (require 'cl) + (require 'thingatpt) (require 'term) (require 'dired) (require 'executable) @@ -263,6 +265,7 @@ regexp should probably be \".\" to specify a default browser." (function-item :tag "Grail" :value browse-url-grail) (function-item :tag "MMM" :value browse-url-mmm) (function-item :tag "KDE" :value browse-url-kde) + (function-item :tag "Elinks" :value browse-url-elinks) (function-item :tag "Specified by `Browse Url Generic Program'" :value browse-url-generic) (function-item :tag "Default Windows browser" @@ -427,7 +430,7 @@ window." :group 'browse-url) (defcustom browse-url-new-window-flag nil - "If non-nil, always open a new browser window with appropriate browsers. + "Non-nil means always open a new browser window with appropriate browsers. Passing an interactive argument to \\[browse-url], or specific browser commands reverses the effect of this variable. Requires Netscape version 1.1N or later or XMosaic version 2.5 or later if using those browsers." @@ -608,6 +611,34 @@ down (this *won't* always work)." :type '(repeat (string :tag "Argument")) :group 'browse-url) +(defcustom browse-url-elinks-wrapper '("xterm" "-e") + "*Wrapper command prepended to the Elinks command-line." + :type '(repeat (string :tag "Wrapper")) + :group 'browse-url) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; URL encoding + +(defun browse-url-url-encode-chars (text chars) + "URL-encode the chars in TEXT that match CHARS. +CHARS is a regexp-like character alternative (e.g., \"[,)$]\")." + (let ((encoded-text (copy-sequence text)) + (s 0)) + (while (setq s (string-match chars encoded-text s)) + (setq encoded-text + (replace-match (format "%%%x" + (string-to-char (match-string 0 encoded-text))) + t t encoded-text) + s (1+ s))) + encoded-text)) + +(defun browse-url-encode-url (url) + "Escape annoying characters in URL. +The annoying characters are those that can mislead a webbrowser +regarding its parameter treatment. For instance, `,' can +be misleading because it could be used to separate URLs." + (browse-url-url-encode-chars url "[,)$]")) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; URL input @@ -680,14 +711,7 @@ Use variable `browse-url-filename-alist' to map filenames to URLs." (or file-name-coding-system default-file-name-coding-system)))) (if coding (setq file (encode-coding-string file coding)))) - ;; URL-encode special chars, do % first - (let ((s 0)) - (while (setq s (string-match "%" file s)) - (setq file (replace-match "%25" t t file) - s (1+ s)))) - (while (string-match "[*\"()',=;? ]" file) - (let ((enc (format "%%%x" (aref file (match-beginning 0))))) - (setq file (replace-match enc t t file)))) + (setq file (browse-url-url-encode-chars file "[*\"()',=;?% ]")) (dolist (map browse-url-filename-alist) (when (and map (string-match (car map) file)) (setq file (replace-match (cdr map) t nil file)))) @@ -859,21 +883,21 @@ The order attempted is gnome-moz-remote, Mozilla, Firefox, Galeon, Konqueror, Netscape, Mosaic, IXI Mosaic, Lynx in an xterm, MMM, and then W3." (apply - (cond - ((executable-find browse-url-gnome-moz-program) 'browse-url-gnome-moz) - ((executable-find browse-url-mozilla-program) 'browse-url-mozilla) - ((executable-find browse-url-firefox-program) 'browse-url-firefox) - ((executable-find browse-url-galeon-program) 'browse-url-galeon) - ((executable-find browse-url-kde-program) 'browse-url-kde) - ((executable-find browse-url-netscape-program) 'browse-url-netscape) - ((executable-find browse-url-mosaic-program) 'browse-url-mosaic) - ((executable-find "tellw3b") 'browse-url-iximosaic) - ((executable-find browse-url-xterm-program) 'browse-url-lynx-xterm) - ((executable-find "mmm") 'browse-url-mmm) - ((locate-library "w3") 'browse-url-w3) - (t - (lambda (&ignore args) (error "No usable browser found")))) - url args)) + (cond + ((executable-find browse-url-gnome-moz-program) 'browse-url-gnome-moz) + ((executable-find browse-url-mozilla-program) 'browse-url-mozilla) + ((executable-find browse-url-firefox-program) 'browse-url-firefox) + ((executable-find browse-url-galeon-program) 'browse-url-galeon) + ((executable-find browse-url-kde-program) 'browse-url-kde) + ((executable-find browse-url-netscape-program) 'browse-url-netscape) + ((executable-find browse-url-mosaic-program) 'browse-url-mosaic) + ((executable-find "tellw3b") 'browse-url-iximosaic) + ((executable-find browse-url-xterm-program) 'browse-url-lynx-xterm) + ((executable-find "mmm") 'browse-url-mmm) + ((locate-library "w3") 'browse-url-w3) + (t + (lambda (&ignore args) (error "No usable browser found")))) + url args)) ;;;###autoload (defun browse-url-netscape (url &optional new-window) @@ -893,11 +917,7 @@ is loaded in a new tab in an existing window instead. When called non-interactively, optional second argument NEW-WINDOW is used instead of `browse-url-new-window-flag'." (interactive (browse-url-interactive-arg "URL: ")) - ;; URL encode any `confusing' characters in the URL. This needs to - ;; include at least commas; presumably also close parens and dollars. - (while (string-match "[,)$]" url) - (setq url (replace-match - (format "%%%x" (string-to-char (match-string 0 url))) t t url))) + (setq url (browse-url-encode-url url)) (let* ((process-environment (browse-url-process-environment)) (process (apply 'start-process @@ -939,7 +959,7 @@ How depends on `browse-url-netscape-version'." ;; <peter.kruse@psychologie.uni-regensburg.de>. (browse-url-netscape-send (if (>= browse-url-netscape-version 4) "xfeDoCommand(reload)" - "reload"))) + "reload"))) (defun browse-url-netscape-send (command) "Send a remote control command to Netscape." @@ -967,11 +987,7 @@ new tab in an existing window instead. When called non-interactively, optional second argument NEW-WINDOW is used instead of `browse-url-new-window-flag'." (interactive (browse-url-interactive-arg "URL: ")) - ;; URL encode any `confusing' characters in the URL. This needs to - ;; include at least commas; presumably also close parens and dollars. - (while (string-match "[,)$]" url) - (setq url (replace-match - (format "%%%x" (string-to-char (match-string 0 url))) t t url))) + (setq url (browse-url-encode-url url)) (let* ((process-environment (browse-url-process-environment)) (process (apply 'start-process @@ -1029,11 +1045,7 @@ command line parameter. Therefore, the are ignored as well. Firefox on Windows will always open the requested URL in a new window." (interactive (browse-url-interactive-arg "URL: ")) - ;; URL encode any `confusing' characters in the URL. This needs to - ;; include at least commas; presumably also close parens. - (while (string-match "[,)]" url) - (setq url (replace-match - (format "%%%x" (string-to-char (match-string 0 url))) t t url))) + (setq url (browse-url-encode-url url)) (let* ((process-environment (browse-url-process-environment)) (process (apply 'start-process @@ -1085,11 +1097,7 @@ new tab in an existing window instead. When called non-interactively, optional second argument NEW-WINDOW is used instead of `browse-url-new-window-flag'." (interactive (browse-url-interactive-arg "URL: ")) - ;; URL encode any `confusing' characters in the URL. This needs to - ;; include at least commas; presumably also close parens and dollars. - (while (string-match "[,)$]" url) - (setq url (replace-match - (format "%%%x" (string-to-char (match-string 0 url))) t t url))) + (setq url (browse-url-encode-url url)) (let* ((process-environment (browse-url-process-environment)) (process (apply 'start-process (concat "galeon " url) @@ -1134,11 +1142,7 @@ new tab in an existing window instead. When called non-interactively, optional second argument NEW-WINDOW is used instead of `browse-url-new-window-flag'." (interactive (browse-url-interactive-arg "URL: ")) - ;; URL encode any `confusing' characters in the URL. This needs to - ;; include at least commas; presumably also close parens and dollars. - (while (string-match "[,)$]" url) - (setq url (replace-match - (format "%%%x" (string-to-char (match-string 0 url))) t t url))) + (setq url (browse-url-encode-url url)) (let* ((process-environment (browse-url-process-environment)) (process (apply 'start-process (concat "epiphany " url) @@ -1200,7 +1204,7 @@ used instead of `browse-url-new-window-flag'." (append browse-url-gnome-moz-arguments (if (browse-url-maybe-new-window new-window) - '("--newwin")) + '("--newwin")) (list "--raise" url)))) ;; --- Mosaic --- @@ -1331,7 +1335,7 @@ prefix argument reverses the effect of `browse-url-new-window-flag'. When called non-interactively, optional second argument NEW-WINDOW is used instead of `browse-url-new-window-flag'." (interactive (browse-url-interactive-arg "W3 URL: ")) - (require 'w3) ; w3-fetch-other-window not autoloaded + (require 'w3) ; w3-fetch-other-window not autoloaded (if (browse-url-maybe-new-window new-window) (w3-fetch-other-window url) (w3-fetch url))) @@ -1343,11 +1347,11 @@ used instead of `browse-url-new-window-flag'." The `browse-url-gnudoit-program' program is used with options given by `browse-url-gnudoit-args'. Default to the URL around or before point." (interactive (browse-url-interactive-arg "W3 URL: ")) - (apply 'start-process (concat "gnudoit:" url) nil - browse-url-gnudoit-program - (append browse-url-gnudoit-args - (list (concat "(w3-fetch \"" url "\")") - "(raise-frame)")))) + (apply 'start-process (concat "gnudoit:" url) nil + browse-url-gnudoit-program + (append browse-url-gnudoit-args + (list (concat "(w3-fetch \"" url "\")") + "(raise-frame)")))) ;; --- Lynx in an xterm --- @@ -1360,8 +1364,8 @@ in an Xterm window using the Xterm program named by `browse-url-xterm-program' with possible additional arguments `browse-url-xterm-args'." (interactive (browse-url-interactive-arg "Lynx URL: ")) (apply #'start-process `(,(concat "lynx" url) nil ,browse-url-xterm-program - ,@browse-url-xterm-args "-e" "lynx" - ,url))) + ,@browse-url-xterm-args "-e" "lynx" + ,url))) ;; --- Lynx in an Emacs "term" window --- @@ -1379,7 +1383,7 @@ reverses the effect of `browse-url-new-window-flag'. When called non-interactively, optional second argument NEW-WINDOW is used instead of `browse-url-new-window-flag'." (interactive (browse-url-interactive-arg "Lynx URL: ")) - (let* ((system-uses-terminfo t) ; Lynx uses terminfo + (let* ((system-uses-terminfo t) ; Lynx uses terminfo ;; (term-term-name "vt100") ; ?? (buf (get-buffer "*lynx*")) (proc (and buf (get-buffer-process buf))) @@ -1420,11 +1424,11 @@ used instead of `browse-url-new-window-flag'." (error "Please move out of the input field first")) ((eq browse-url-lynx-input-field 'avoid) (while (and (eq (following-char) ?_) (> n 0)) - (term-send-down) ; down arrow + (term-send-down) ; down arrow (sit-for browse-url-lynx-input-delay)) (if (eq (following-char) ?_) (error "Cannot move out of the input field, sorry"))))) - (term-send-string proc (concat "g" ; goto + (term-send-string proc (concat "g" ; goto "\C-u" ; kill default url url "\r"))))) @@ -1499,7 +1503,7 @@ browser is started up in a new process with possible additional arguments don't offer a form of remote control." (interactive (browse-url-interactive-arg "URL: ")) (if (not browse-url-generic-program) - (error "No browser defined (`browse-url-generic-program')")) + (error "No browser defined (`browse-url-generic-program')")) (apply 'call-process browse-url-generic-program nil 0 nil (append browse-url-generic-args (list url)))) @@ -1511,7 +1515,56 @@ Default to the URL around or before point." (interactive (browse-url-interactive-arg "KDE URL: ")) (message "Sending URL to KDE...") (apply #'start-process (concat "KDE " url) nil browse-url-kde-program - (append browse-url-kde-args (list url)))) + (append browse-url-kde-args (list url)))) + +(defun browse-url-elinks-new-window (url) + "Ask the Elinks WWW browser to load URL in a new window." + (let ((process-environment (browse-url-process-environment))) + (apply #'start-process + (append (list (concat "elinks:" url) + nil) + browse-url-elinks-wrapper + (list "elinks" url))))) + +;;;###autoload +(defun browse-url-elinks (url &optional new-window) + "Ask the Elinks WWW browser to load URL. +Default to the URL around the point. + +The document is loaded in a new tab of a running Elinks or, if +none yet running, a newly started instance. + +The Elinks command will be prepended by the program+arguments +from `browse-url-elinks-wrapper'." + (interactive (browse-url-interactive-arg "URL: ")) + (setq url (browse-url-encode-url url)) + (if new-window + (browse-url-elinks-new-window url) + (let ((process-environment (browse-url-process-environment)) + (elinks-ping-process (start-process "elinks-ping" nil + "elinks" "-remote" "ping()"))) + (set-process-sentinel elinks-ping-process + `(lambda (process change) + (browse-url-elinks-sentinel process ,url)))))) + +(defun browse-url-elinks-sentinel (process url) + "Determines if Elinks is running or a new one has to be started." + (let ((exit-status (process-exit-status process))) + ;; Try to determine if an instance is running or if we have to + ;; create a new one. + (case exit-status + (5 + ;; No instance, start a new one. + (browse-url-elinks-new-window url)) + (0 + ;; Found an instance, open URL in new tab. + (let ((process-environment (browse-url-process-environment))) + (start-process (concat "elinks:" url) nil + "elinks" "-remote" + (concat "openURL(\"" url "\",new-tab)")))) + (otherwise + (error "Unrecognized exit-code %d of process `elinks'" + exit-status))))) (provide 'browse-url) diff --git a/lisp/net/snmp-mode.el b/lisp/net/snmp-mode.el index bf438638794..0ce0b91c037 100644 --- a/lisp/net/snmp-mode.el +++ b/lisp/net/snmp-mode.el @@ -88,6 +88,8 @@ ;;; Code: (eval-when-compile + (require 'cl) + (require 'imenu) ; Need this stuff when compiling for imenu macros, etc. (require 'tempo)) ;;;---------------------------------------------------------------------------- @@ -102,42 +104,42 @@ :version "20.4") (defcustom snmp-special-indent t - "*If non-nil, use a simple heuristic to try to guess the right indentation. + "If non-nil, use a simple heuristic to try to guess the right indentation. If nil, then no special indentation is attempted." :type 'boolean :group 'snmp) (defcustom snmp-indent-level 4 - "*Indentation level for SNMP MIBs." + "Indentation level for SNMP MIBs." :type 'integer :group 'snmp) (defcustom snmp-tab-always-indent nil - "*Non-nil means TAB should always reindent the current line. + "Non-nil means TAB should always reindent the current line. A value of nil means reindent if point is within the initial line indentation; otherwise insert a TAB." :type 'boolean :group 'snmp) (defcustom snmp-completion-ignore-case t - "*Non-nil means that case differences are ignored during completion. + "Non-nil means that case differences are ignored during completion. A value of nil means that case is significant. This is used during Tempo template completion." :type 'boolean :group 'snmp) (defcustom snmp-common-mode-hook nil - "*Hook(s) evaluated when a buffer enters either SNMP or SNMPv2 mode." + "Hook(s) evaluated when a buffer enters either SNMP or SNMPv2 mode." :type 'hook :group 'snmp) (defcustom snmp-mode-hook nil - "*Hook(s) evaluated when a buffer enters SNMP mode." + "Hook(s) evaluated when a buffer enters SNMP mode." :type 'hook :group 'snmp) (defcustom snmpv2-mode-hook nil - "*Hook(s) evaluated when a buffer enters SNMPv2 mode." + "Hook(s) evaluated when a buffer enters SNMPv2 mode." :type 'hook :group 'snmp) @@ -195,26 +197,26 @@ This is used during Tempo template completion." "Predefined types for SYNTAX clauses.") (defvar snmp-rfc1155-types - '(("INTEGER") ("OCTET STRING") ("OBJECT IDENTIFIER") ("NULL") ("IpAddress") - ("NetworkAddress") ("Counter") ("Gauge") ("TimeTicks") ("Opaque")) + '("INTEGER" "OCTET STRING" "OBJECT IDENTIFIER" "NULL" "IpAddress" + "NetworkAddress" "Counter" "Gauge" "TimeTicks" "Opaque") "Types from RFC 1155 v1 SMI.") (defvar snmp-rfc1213-types - '(("DisplayString")) + '("DisplayString") "Types from RFC 1213 MIB-II.") (defvar snmp-rfc1902-types - '(("INTEGER") ("OCTET STRING") ("OBJECT IDENTIFIER") ("Integer32") - ("IpAddress") ("Counter32") ("Gauge32") ("Unsigned32") ("TimeTicks") - ("Opaque") ("Counter64")) + '("INTEGER" "OCTET STRING" "OBJECT IDENTIFIER" "Integer32" + "IpAddress" "Counter32" "Gauge32" "Unsigned32" "TimeTicks" + "Opaque" "Counter64") "Types from RFC 1902 v2 SMI.") (defvar snmp-rfc1903-types - '(("DisplayString") ("PhysAddress") ("MacAddress") ("TruthValue") - ("TestAndIncr") ("AutonomousType") ("InstancePointer") - ("VariablePointer") ("RowPointer") ("RowStatus") ("TimeStamp") - ("TimeInterval") ("DateAndTime") ("StorageType") ("TDomain") - ("TAddress")) + '("DisplayString" "PhysAddress" "MacAddress" "TruthValue" + "TestAndIncr" "AutonomousType" "InstancePointer" + "VariablePointer" "RowPointer" "RowStatus" "TimeStamp" + "TimeInterval" "DateAndTime" "StorageType" "TDomain" + "TAddress") "Types from RFC 1903 Textual Conventions.") @@ -222,12 +224,12 @@ This is used during Tempo template completion." "Predefined values for ACCESS clauses.") (defvar snmp-rfc1155-access - '(("read-only") ("read-write") ("write-only") ("not-accessible")) + '("read-only" "read-write" "write-only" "not-accessible") "ACCESS values from RFC 1155 v1 SMI.") (defvar snmp-rfc1902-access - '(("read-only") ("read-write") ("read-create") ("not-accessible") - ("accessible-for-notify")) + '("read-only" "read-write" "read-create" "not-accessible" + "accessible-for-notify") "ACCESS values from RFC 1155 v1 SMI.") @@ -235,11 +237,11 @@ This is used during Tempo template completion." "Predefined values for STATUS clauses.") (defvar snmp-rfc1212-status - '(("mandatory") ("obsolete") ("deprecated")) + '("mandatory" "obsolete" "deprecated") "STATUS values from RFC 1212 v1 SMI.") (defvar snmp-rfc1902-status - '(("current") ("obsolete") ("deprecated")) + '("current" "obsolete" "deprecated") "STATUS values from RFC 1902 v2 SMI.") @@ -252,13 +254,6 @@ This is used during Tempo template completion." ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Need this stuff when compiling for imenu macros, etc. -;; -(eval-when-compile - (require 'cl) - (require 'imenu)) - - ;; Create abbrev table for SNMP MIB mode ;; (defvar snmp-mode-abbrev-table nil @@ -275,33 +270,30 @@ This is used during Tempo template completion." ;; Set up our keymap ;; -(defvar snmp-mode-map (make-sparse-keymap) +(defvar snmp-mode-map + (let ((map (make-sparse-keymap))) + (define-key map "\177" 'backward-delete-char-untabify) + (define-key map "\C-c\C-i" 'tempo-complete-tag) + (define-key map "\C-c\C-f" 'tempo-forward-mark) + (define-key map "\C-c\C-b" 'tempo-backward-mark) + map) "Keymap used in SNMP mode.") -(define-key snmp-mode-map "\t" 'snmp-indent-command) -(define-key snmp-mode-map "\177" 'backward-delete-char-untabify) - -(define-key snmp-mode-map "\C-c\C-i" 'tempo-complete-tag) -(define-key snmp-mode-map "\C-c\C-f" 'tempo-forward-mark) -(define-key snmp-mode-map "\C-c\C-b" 'tempo-backward-mark) - ;; Set up our syntax table ;; -(defvar snmp-mode-syntax-table nil +(defvar snmp-mode-syntax-table + (let ((st (make-syntax-table))) + (modify-syntax-entry ?\\ "\\" st) + (modify-syntax-entry ?- "_ 1234" st) + (modify-syntax-entry ?\n ">" st) + (modify-syntax-entry ?\^m ">" st) + (modify-syntax-entry ?_ "." st) + (modify-syntax-entry ?: "." st) + (modify-syntax-entry ?= "." st) + st) "Syntax table used for buffers in SNMP mode.") -(if snmp-mode-syntax-table - () - (setq snmp-mode-syntax-table (make-syntax-table)) - (modify-syntax-entry ?\\ "\\" snmp-mode-syntax-table) - (modify-syntax-entry ?- "_ 1234" snmp-mode-syntax-table) - (modify-syntax-entry ?\n ">" snmp-mode-syntax-table) - (modify-syntax-entry ?\^m ">" snmp-mode-syntax-table) - (modify-syntax-entry ?_ "." snmp-mode-syntax-table) - (modify-syntax-entry ?: "." snmp-mode-syntax-table) - (modify-syntax-entry ?= "." snmp-mode-syntax-table)) - ;; Set up the stuff that's common between snmp-mode and snmpv2-mode ;; (defun snmp-common-mode (name mode abbrev font-keywords imenu-index tempo-tags) @@ -335,10 +327,9 @@ This is used during Tempo template completion." (setq parse-sexp-ignore-comments t) ;; Set up indentation - (make-local-variable 'indent-line-function) - (setq indent-line-function (if snmp-special-indent - 'snmp-indent-line - 'indent-to-left-margin)) + (if snmp-special-indent + (set (make-local-variable 'indent-line-function) 'snmp-indent-line)) + (set (make-local-variable 'tab-always-indent) snmp-tab-always-indent) ;; Font Lock (make-local-variable 'font-lock-defaults) @@ -474,7 +465,7 @@ lines for the purposes of this function." "Indent current line as SNMP MIB code." (let ((indent (snmp-calculate-indent)) (pos (- (point-max) (point))) - shift-amt beg end) + shift-amt beg) (beginning-of-line) (setq beg (point)) (skip-chars-forward " \t") @@ -488,20 +479,6 @@ lines for the purposes of this function." (if (> (- (point-max) pos) (point)) (goto-char (- (point-max) pos))))) -(defun snmp-indent-command () - "Indent current line as SNMP MIB code, or sometimes insert a TAB. -If `snmp-tab-always-indent' is t, always reindent the current line when -this command is run. -If `snmp-tab-always-indent' is nil, reindent the current line if point is -in the initial indentation. Otherwise, insert a TAB." - (interactive) - (if (and (not snmp-tab-always-indent) - (save-excursion - (skip-chars-backward " \t") - (not (bolp)))) - (insert-tab) - (snmp-indent-line))) - ;;;---------------------------------------------------------------------------- ;; @@ -520,7 +497,7 @@ in the initial indentation. Otherwise, insert a TAB." (index-table-alist '()) (index-trap-alist '()) (case-fold-search nil) ; keywords must be uppercase - prev-pos token marker end) + prev-pos token end) (goto-char (point-min)) (imenu-progress-message prev-pos 0) ;; Search for a useful MIB item (that's not in a comment) @@ -529,7 +506,7 @@ in the initial indentation. Otherwise, insert a TAB." (imenu-progress-message prev-pos) (setq end (match-end 0) - token (cons (buffer-substring (match-beginning 1) (match-end 1)) + token (cons (match-string 1) (set-marker (make-marker) (match-beginning 1)))) (goto-char (match-beginning 2)) (cond ((looking-at "OBJECT-TYPE[ \t\n]+SYNTAX") @@ -719,5 +696,5 @@ controls whether case is significant." (provide 'snmp-mode) -;;; arch-tag: eb6cc0f9-1e47-4023-8625-bc9aae6c3527 +;; arch-tag: eb6cc0f9-1e47-4023-8625-bc9aae6c3527 ;;; snmp-mode.el ends here diff --git a/lisp/net/socks.el b/lisp/net/socks.el index 5a2364c652c..5079e84ce19 100644 --- a/lisp/net/socks.el +++ b/lisp/net/socks.el @@ -546,7 +546,9 @@ version.") atype host (if (stringp service) - (socks-find-services-entry service) + (or + (socks-find-services-entry service) + (error "Unknown service: %s" service)) service)) (puthash 'buffer buffer info) (puthash 'host host info) diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el index db08fe3b6df..35147e7907c 100644 --- a/lisp/net/tramp-cache.el +++ b/lisp/net/tramp-cache.el @@ -141,20 +141,20 @@ Remove also properties of all files in subdirectories." (defun tramp-cache-print (table) "Prints hash table TABLE." (when (hash-table-p table) - (let (result tmp) + (let (result) (maphash '(lambda (key value) - (setq tmp (format - "(%s %s)" - (if (processp key) - (prin1-to-string (prin1-to-string key)) - (prin1-to-string key)) - (if (hash-table-p value) - (tramp-cache-print value) - (if (bufferp value) - (prin1-to-string (prin1-to-string value)) - (prin1-to-string value)))) - result (if result (concat result " " tmp) tmp))) + (let ((tmp (format + "(%s %s)" + (if (processp key) + (prin1-to-string (prin1-to-string key)) + (prin1-to-string key)) + (if (hash-table-p value) + (tramp-cache-print value) + (if (bufferp value) + (prin1-to-string (prin1-to-string value)) + (prin1-to-string value)))))) + (setq result (if result (concat result " " tmp) tmp)))) table) result))) @@ -291,7 +291,8 @@ history." res)) ;; Read persistent connection history. -(when (zerop (hash-table-count tramp-cache-data)) +(when (and (stringp tramp-persistency-file-name) + (zerop (hash-table-count tramp-cache-data))) (condition-case err (with-temp-buffer (insert-file-contents tramp-persistency-file-name) @@ -306,7 +307,8 @@ history." (clrhash tramp-cache-data)) (error ;; File is corrupted. - (message "%s" (error-message-string err)) + (message "Tramp persistency file '%s' is corrupted: %s" + tramp-persistency-file-name (error-message-string err)) (clrhash tramp-cache-data)))) (provide 'tramp-cache) diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el new file mode 100644 index 00000000000..19d25f43515 --- /dev/null +++ b/lisp/net/tramp-compat.el @@ -0,0 +1,237 @@ +;;; tramp-compat.el --- Tramp compatibility functions + +;; Copyright (C) 2007 Free Software Foundation, Inc. + +;; Author: Michael Albinus <michael.albinus@gmx.de> +;; Keywords: comm, processes + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 3, or (at your option) +;; any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, see +;; <http://www.gnu.org/licenses/>. + +;;; Commentary: + +;; Tramp's main Emacs version for development is GNU Emacs 23. This +;; package provides compatibility functions for GNU Emacs 21, GNU +;; Emacs 22 and XEmacs 21.4+. + +;;; Code: + +(eval-and-compile + + ;; Pacify byte-compiler. + (require 'cl) + (require 'custom) + + ;; Load the appropriate timer package. + (if (featurep 'xemacs) + (require 'timer-funcs) + (require 'timer)) + + ;; tramp-util offers integration into other (X)Emacs packages like + ;; compile.el, gud.el etc. Not necessary in Emacs 23. + (eval-after-load "tramp" + ;; We check whether `start-file-process' is an alias. + '(when (or (not (fboundp 'start-file-process)) + (symbolp (symbol-function 'start-file-process))) + (require 'tramp-util) + (add-hook 'tramp-unload-hook + '(lambda () + (when (featurep 'tramp-util) + (unload-feature 'tramp-util 'force)))))) + + ;; Make sure that we get integration with the VC package. When it + ;; is loaded, we need to pull in the integration module. Not + ;; necessary in Emacs 23. + (eval-after-load "vc" + (eval-after-load "tramp" + ;; We check whether `start-file-process' is an alias. + '(when (or (not (fboundp 'start-file-process)) + (symbolp (symbol-function 'start-file-process))) + (require 'tramp-vc) + (add-hook 'tramp-unload-hook + '(lambda () + (when (featurep 'tramp-vc) + (unload-feature 'tramp-vc 'force))))))) + + ;; Avoid byte-compiler warnings if the byte-compiler supports this. + ;; Currently, XEmacs supports this. + (when (featurep 'xemacs) + (unless (boundp 'byte-compile-default-warnings) + (defvar byte-compile-default-warnings nil)) + (delq 'unused-vars byte-compile-default-warnings)) + + ;; `last-coding-system-used' is unknown in XEmacs. + (unless (boundp 'last-coding-system-used) + (defvar last-coding-system-used nil)) + + ;; `directory-sep-char' is an obsolete variable in Emacs. But it is + ;; used in XEmacs, so we set it here and there. The following is + ;; needed to pacify Emacs byte-compiler. + (unless (boundp 'byte-compile-not-obsolete-var) + (defvar byte-compile-not-obsolete-var nil)) + (setq byte-compile-not-obsolete-var 'directory-sep-char) + + ;; `with-temp-message' does not exists in XEmacs. + (condition-case nil + (with-temp-message (current-message) nil) + (error (defmacro with-temp-message (message &rest body) `(progn ,@body)))) + + ;; `set-buffer-multibyte' comes from Emacs Leim. + (unless (fboundp 'set-buffer-multibyte) + (defalias 'set-buffer-multibyte 'ignore)) + + ;; `font-lock-add-keywords' does not exist in XEmacs. + (unless (fboundp 'font-lock-add-keywords) + (defalias 'font-lock-add-keywords 'ignore)) + + ;; `file-remote-p' has been introduced with Emacs 22. The version + ;; of XEmacs is not a magic file name function (yet); this is + ;; corrected in tramp-util.el. Here it is sufficient if the + ;; function exists. + (unless (fboundp 'file-remote-p) + (defalias 'file-remote-p 'tramp-handle-file-remote-p)) + + ;; `process-file' exists since Emacs 22. + (unless (fboundp 'process-file) + (defalias 'process-file 'tramp-handle-process-file)) + + ;; `start-file-process' is new in Emacs 23. + (unless (fboundp 'start-file-process) + (defalias 'start-file-process 'tramp-handle-start-file-process)) + + ;; `set-file-times' is also new in Emacs 23. + (unless (fboundp 'set-file-times) + (defalias 'set-file-times 'tramp-handle-set-file-times))) + +(defsubst tramp-compat-line-end-position () + "Return point at end of line (compat function). +Calls `line-end-position' or `point-at-eol' if defined, else +own implementation." + (cond + ((fboundp 'line-end-position) (funcall (symbol-function 'line-end-position))) + ((fboundp 'point-at-eol) (funcall (symbol-function 'point-at-eol))) + (t (save-excursion (end-of-line) (point))))) + +(defsubst tramp-compat-temporary-file-directory () + "Return name of directory for temporary files (compat function). +For Emacs, this is the variable `temporary-file-directory', for XEmacs +this is the function `temp-directory'." + (cond + ((boundp 'temporary-file-directory) (symbol-value 'temporary-file-directory)) + ((fboundp 'temp-directory) (funcall (symbol-function 'temp-directory))) + ((let ((d (getenv "TEMP"))) (and d (file-directory-p d))) + (file-name-as-directory (getenv "TEMP"))) + ((let ((d (getenv "TMP"))) (and d (file-directory-p d))) + (file-name-as-directory (getenv "TMP"))) + ((let ((d (getenv "TMPDIR"))) (and d (file-directory-p d))) + (file-name-as-directory (getenv "TMPDIR"))) + ((file-exists-p "c:/temp") (file-name-as-directory "c:/temp")) + (t (message (concat "Neither `temporary-file-directory' nor " + "`temp-directory' is defined -- using /tmp.")) + (file-name-as-directory "/tmp")))) + +;; `make-temp-file' exists in Emacs only. The third parameter SUFFIX +;; has been introduced with Emacs 22. We try it, if it fails, we fall +;; back to `make-temp-name', creating the temporary file immediately +;; in order to avoid a security hole. +(defsubst tramp-compat-make-temp-file (filename) + "Create a temporary file (compat function). +Add the extension of FILENAME, if existing." + (let ((prefix (expand-file-name + (symbol-value 'tramp-temp-name-prefix) + (tramp-compat-temporary-file-directory))) + (extension (file-name-extension filename t)) + result) + (condition-case nil + (setq result + (funcall (symbol-function 'make-temp-file) prefix nil extension)) + (error + ;; We use our own implementation, taken from files.el. + (while + (condition-case () + (progn + (setq result (concat (make-temp-name prefix) extension)) + (write-region + "" nil result nil 'silent nil + ;; 7th parameter is MUSTBENEW in Emacs, and + ;; CODING-SYSTEM in XEmacs. It is not a security + ;; hole in XEmacs if we cannot use this parameter, + ;; because XEmacs uses a user-specific subdirectory + ;; with 0700 permissions. + (when (not (featurep 'xemacs)) 'excl)) + nil) + (file-already-exists t)) + ;; The file was somehow created by someone else between + ;; `make-temp-name' and `write-region', let's try again. + nil))) + result)) + +;; `most-positive-fixnum' arrived in Emacs 22. Before, and in XEmacs, +;; it is a fixed value. +(defsubst tramp-compat-most-positive-fixnum () + "Return largest positive integer value (compat function)." + (cond + ((boundp 'most-positive-fixnum) (symbol-value 'most-positive-fixnum)) + ;; Default value in XEmacs and Emacs 21. + (t 134217727))) + +;; ID-FORMAT exists since Emacs 22. +(defun tramp-compat-file-attributes (filename &optional id-format) + "Like `file-attributes' for Tramp files (compat function)." + (cond + ((or (null id-format) (eq id-format 'integer)) + (file-attributes filename)) + ((file-remote-p filename) + (funcall (symbol-function 'tramp-handle-file-attributes) + filename id-format)) + (t (condition-case nil + (funcall (symbol-function 'file-attributes) filename id-format) + (error (file-attributes filename)))))) + +;; PRESERVE-UID-GID has been introduced with Emacs 23. It does not +;; hurt to ignore it for other (X)Emacs versions. +(defun tramp-compat-copy-file + (filename newname &optional ok-if-already-exists keep-date preserve-uid-gid) + "Like `copy-file' for Tramp files (compat function)." + (if preserve-uid-gid + (funcall + (symbol-function 'copy-file) + filename newname ok-if-already-exists keep-date preserve-uid-gid) + (copy-file filename newname ok-if-already-exists keep-date))) + +;; `copy-tree' is a built-in function in XEmacs. In Emacs 21, it is +;; an auoloaded function in cl-extra.el. Since Emacs 22, it is part +;; of subr.el. There are problems when autoloading, therefore we test +;; for for `subrp' and `symbol-file'. Implementation is taken from Emacs23. +(defun tramp-compat-copy-tree (tree) + "Make a copy of TREE (compat function)." + (if (or (subrp 'copy-tree) (symbol-file 'copy-tree)) + (funcall (symbol-function 'copy-tree) tree) + (let (result) + (while (consp tree) + (let ((newcar (car tree))) + (if (consp (car tree)) + (setq newcar (tramp-compat-copy-tree (car tree)))) + (push newcar result)) + (setq tree (cdr tree))) + (nconc (nreverse result) tree)))) + +(provide 'tramp-compat) + +;;; TODO: + +;; arch-tag: 0e724b18-6699-4f87-ad96-640b272e5c85 +;;; tramp-compat.el ends here diff --git a/lisp/net/tramp-fish.el b/lisp/net/tramp-fish.el index f0db302abcb..7116d144061 100644 --- a/lisp/net/tramp-fish.el +++ b/lisp/net/tramp-fish.el @@ -155,25 +155,7 @@ (require 'tramp) (require 'tramp-cache) - -;; Pacify byte-compiler -(eval-when-compile - (require 'cl) - (require 'custom)) - -;; Avoid byte-compiler warnings if the byte-compiler supports this. -;; Currently, XEmacs supports this. -(eval-when-compile - (when (featurep 'xemacs) - (byte-compiler-options (warnings (- unused-vars))))) - -;; `directory-sep-char' is an obsolete variable in Emacs. But it is -;; used in XEmacs, so we set it here and there. The following is needed -;; to pacify Emacs byte-compiler. -(eval-when-compile - (unless (boundp 'byte-compile-not-obsolete-var) - (defvar byte-compile-not-obsolete-var nil)) - (setq byte-compile-not-obsolete-var 'directory-sep-char)) +(require 'tramp-compat) ;; Define FISH method ... (defcustom tramp-fish-method "fish" @@ -365,7 +347,7 @@ pass to the OPERATION." (unless (file-name-absolute-p name) (setq name (concat (file-name-as-directory dir) name))) ;; If NAME is not a tramp file, run the real handler - (if (or (tramp-completion-mode) (not (tramp-tramp-file-p name))) + (if (or (tramp-completion-mode-p) (not (tramp-tramp-file-p name))) (tramp-drop-volume-letter (tramp-run-real-handler 'expand-file-name (list name nil))) ;; Dissect NAME. @@ -386,7 +368,7 @@ pass to the OPERATION." (tramp-fish-send-command-and-check v "#PWD") (with-current-buffer (tramp-get-buffer v) (goto-char (point-min)) - (buffer-substring (point) (tramp-line-end-position))))) + (buffer-substring (point) (tramp-compat-line-end-position))))) (setq localname (concat uname fname)))) ;; There might be a double slash, for example when "~/" ;; expands to "/". Remove this. @@ -399,7 +381,7 @@ pass to the OPERATION." ;; bound, because on Windows there would be problems with UNC ;; shares or Cygwin mounts. (tramp-let-maybe directory-sep-char ?/ - (let ((default-directory (tramp-temporary-file-directory))) + (let ((default-directory (tramp-compat-temporary-file-directory))) (tramp-make-tramp-file-name method user host (tramp-drop-volume-letter @@ -493,14 +475,14 @@ pass to the OPERATION." (tramp-error v 'file-error "Cannot make local copy of non-existing file `%s'" filename)) - (let ((tmpfil (tramp-make-temp-file filename))) - (tramp-message v 4 "Fetching %s to tmp file %s..." filename tmpfil) + (let ((tmpfile (tramp-compat-make-temp-file filename))) + (tramp-message v 4 "Fetching %s to tmp file %s..." filename tmpfile) (when (tramp-fish-retrieve-data v) ;; Save file (with-current-buffer (tramp-get-buffer v) - (write-region (point-min) (point-max) tmpfil)) - (tramp-message v 4 "Fetching %s to tmp file %s...done" filename tmpfil) - tmpfil)))) + (write-region (point-min) (point-max) tmpfile)) + (tramp-message v 4 "Fetching %s to tmp file %s...done" filename tmpfile) + tmpfile)))) ;; This function should return "foo/" for directories and "bar" for ;; files. @@ -742,7 +724,7 @@ target of the symlink differ." (if (zerop (process-file "which" nil t nil command)) (progn (goto-char (point-min)) - (buffer-substring (point-min) (tramp-line-end-position)))))) + (buffer-substring (point-min) (tramp-compat-line-end-position)))))) (defun tramp-fish-handle-process-file (program &optional infile destination display &rest args) @@ -752,8 +734,8 @@ target of the symlink differ." (error "Implementation does not handle immediate return")) (with-parsed-tramp-file-name default-directory nil - (let ((temp-name-prefix (tramp-make-tramp-temp-file v)) - command input output stderr outbuf tmpfil ret) + (let (command input tmpinput output tmpoutput stderr tmpstderr + outbuf tmpfile ret) ;; Compute command. (setq command (mapconcat 'tramp-shell-quote-argument (cons program args) " ")) @@ -765,15 +747,14 @@ target of the symlink differ." ;; INFILE is on the same remote host. (setq input (with-parsed-tramp-file-name infile nil localname)) ;; INFILE must be copied to remote host. - (setq input (concat temp-name-prefix ".in")) - (copy-file - infile - (tramp-make-tramp-file-name method user host input) - t))) + (setq input (tramp-make-tramp-temp-file v) + tmpinput (tramp-make-tramp-file-name method user host input)) + (copy-file infile tmpinput t))) (when input (setq command (format "%s <%s" command input))) ;; Determine output. - (setq output (concat temp-name-prefix ".out")) + (setq output (tramp-make-tramp-temp-file v) + tmpoutput (tramp-make-tramp-file-name method user host output)) (cond ;; Just a buffer ((bufferp destination) @@ -799,7 +780,9 @@ target of the symlink differ." (cadr destination) nil localname)) ;; stderr must be copied to remote host. The temporary ;; file must be deleted after execution. - (setq stderr (concat temp-name-prefix ".err")))) + (setq stderr (tramp-make-tramp-temp-file v) + tmpstderr (tramp-make-tramp-file-name + method user host stderr)))) ;; stderr to be discarded ((null (cadr destination)) (setq stderr "/dev/null")))) @@ -808,9 +791,6 @@ target of the symlink differ." (setq outbuf (current-buffer)))) (when stderr (setq command (format "%s 2>%s" command stderr))) - ;; If we have a temporary file, it must be removed after operation. - (when (and input (string-match temp-name-prefix input)) - (setq command (format "%s; rm %s" command input))) ;; Goto working directory. (unless (tramp-fish-send-command-and-check @@ -823,31 +803,31 @@ target of the symlink differ." v (format "#EXEC %s %s" (tramp-shell-quote-argument command) output)) - (error)) + (error nil)) ;; Check return code. - (setq tmpfil (file-local-copy - (tramp-make-tramp-file-name method user host output))) + (setq tmpfile + (file-local-copy + (tramp-make-tramp-file-name method user host output))) (with-temp-buffer - (insert-file-contents tmpfil) + (insert-file-contents tmpfile) (goto-char (point-max)) (forward-line -1) (looking-at "^###RESULT: \\([0-9]+\\)") (setq ret (string-to-number (match-string 1))) (delete-region (point) (point-max)) - (write-region (point-min) (point-max) tmpfil)) + (write-region (point-min) (point-max) tmpfile)) ;; We should show the output anyway. (when outbuf - (with-current-buffer outbuf (insert-file-contents tmpfil)) - (when display (display-buffer outbuf))) - ;; Remove output file. - (delete-file (tramp-make-tramp-file-name method user host output))) + (with-current-buffer outbuf (insert-file-contents tmpfile)) + (when display (display-buffer outbuf)))) ;; When the user did interrupt, we should do it also. (error (setq ret 1))) - (unless ret - ;; Provide error file. - (when (and stderr (string-match temp-name-prefix stderr)) - (rename-file (tramp-make-tramp-file-name method user host stderr) - (cadr destination) t))) + + ;; Provide error file. + (when tmpstderr (rename-file tmpstderr (cadr destination) t)) + ;; Cleanup. + (when tmpinput (delete-file tmpinput)) + (when tmpoutput (delete-file tmpoutput)) ;; Return exit status. ret))) @@ -935,7 +915,7 @@ KEEP-DATE is non-nil, preserve the time stamp when copying." (tramp-shell-quote-argument v2-localname))))) ;; KEEP-DATE handling. (when (and keep-date (functionp 'set-file-times)) - (apply 'set-file-times (list newname (nth 5 (file-attributes filename))))) + (set-file-times newname (nth 5 (file-attributes filename)))) ;; Set the mode. (set-file-modes newname (file-modes filename))) @@ -961,7 +941,7 @@ SIZE MODE WEIRD INODE DEVICE)." ;; Read number of entries (goto-char (point-min)) (condition-case nil - (unless (integerp (setq num (read (current-buffer)))) (error)) + (unless (integerp (setq num (read (current-buffer)))) (error nil)) (error (return nil))) (forward-line) (delete-region (point-min) (point)) @@ -969,7 +949,7 @@ SIZE MODE WEIRD INODE DEVICE)." ;; Read return code (goto-char (point-min)) (condition-case nil - (unless (looking-at tramp-fish-continue-prompt-regexp) (error)) + (unless (looking-at tramp-fish-continue-prompt-regexp) (error nil)) (error (return nil))) (forward-line) (delete-region (point-min) (point)) @@ -986,7 +966,7 @@ SIZE MODE WEIRD INODE DEVICE)." ;; Read return code (goto-char (point-min)) (condition-case nil - (unless (looking-at tramp-fish-ok-prompt-regexp) (error)) + (unless (looking-at tramp-fish-ok-prompt-regexp) (error nil)) (error (tramp-error vec 'file-error "`%s' does not return a valid Lisp expression: `%s'" @@ -1071,7 +1051,7 @@ Returns the size of the data." ;; Read filesize (goto-char (point-min)) (condition-case nil - (unless (integerp (setq size (read (current-buffer)))) (error)) + (unless (integerp (setq size (read (current-buffer)))) (error nil)) (error (return nil))) (forward-line) (delete-region (point-min) (point)) @@ -1079,7 +1059,7 @@ Returns the size of the data." ;; Read return code (goto-char (point-min)) (condition-case nil - (unless (looking-at tramp-fish-continue-prompt-regexp) (error)) + (unless (looking-at tramp-fish-continue-prompt-regexp) (error nil)) (error (return nil))) (forward-line) (delete-region (point-min) (point)) @@ -1095,7 +1075,7 @@ Returns the size of the data." ;; Read return code (goto-char (+ (point-min) size)) (condition-case nil - (unless (looking-at tramp-fish-ok-prompt-regexp) (error)) + (unless (looking-at tramp-fish-ok-prompt-regexp) (error nil)) (error (return nil))) (delete-region (+ (point-min) size) (point-max)) size)))) @@ -1132,7 +1112,8 @@ connection if a previous connection has died for some reason." (coding-system-for-read 'binary) (coding-system-for-write 'binary) ;; This must be done in order to avoid our file name handler. - (p (let ((default-directory (tramp-temporary-file-directory))) + (p (let ((default-directory + (tramp-compat-temporary-file-directory))) (start-process (or (tramp-get-connection-property vec "process-name" nil) (tramp-buffer-name vec)) diff --git a/lisp/net/tramp-ftp.el b/lisp/net/tramp-ftp.el index 6fe069636f7..85416d308d3 100644 --- a/lisp/net/tramp-ftp.el +++ b/lisp/net/tramp-ftp.el @@ -149,6 +149,19 @@ pass to the OPERATION." (with-parsed-tramp-file-name (car args) nil (tramp-set-connection-property v "started" t)) nil)) + ;; If the second argument of `copy-file' or `rename-file' is a + ;; remote file name but via FTP, ange-ftp doesn't check this. + ;; We must copy it locally first, because there is no place in + ;; ange-ftp for correct handling. + ((and (memq operation '(copy-file rename-file)) + (file-remote-p (cadr args)) + (not (tramp-ftp-file-name-p (cadr args)))) + (let* ((filename (car args)) + (newname (cadr args)) + (tmpfile (tramp-compat-make-temp-file filename)) + (args (cddr args))) + (apply operation filename tmpfile args) + (rename-file tmpfile newname (car args)))) ;; Normally, the handlers must be discarded. (t (let* ((inhibit-file-name-handlers (list 'tramp-file-name-handler diff --git a/lisp/net/tramp-gw.el b/lisp/net/tramp-gw.el index 3ac496d8a09..70a37f384fe 100644 --- a/lisp/net/tramp-gw.el +++ b/lisp/net/tramp-gw.el @@ -307,7 +307,7 @@ password in password cache. This is done for the first try only." "%s:%s" socks-username (tramp-read-passwd - proc + nil (format "Password for %s@[%s]: " socks-username (read (current-buffer))))))))) diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index 5dbf12955d7..b4e68c77624 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el @@ -30,15 +30,7 @@ (require 'tramp) (require 'tramp-cache) - -;; Pacify byte-compiler -(eval-when-compile (require 'custom)) - -;; Avoid byte-compiler warnings if the byte-compiler supports this. -;; Currently, XEmacs supports this. -(eval-when-compile - (when (featurep 'xemacs) - (byte-compiler-options (warnings (- unused-vars))))) +(require 'tramp-compat) ;; Define SMB method ... (defcustom tramp-smb-method "smb" @@ -79,6 +71,7 @@ '(;; Connection error / timeout "Connection to \\S-+ failed" "Read from server failed, maybe it closed the connection" + "Call timed out: server did not respond" ;; Samba "ERRDOS" "ERRSRV" @@ -378,19 +371,19 @@ KEEP-DATE is not handled in case NEWNAME resides on an SMB server." "Like `file-local-copy' for Tramp files." (with-parsed-tramp-file-name filename nil (let ((file (tramp-smb-get-localname localname t)) - (tmpfil (tramp-make-temp-file filename))) + (tmpfile (tramp-compat-make-temp-file filename))) (unless (file-exists-p filename) (tramp-error v 'file-error "Cannot make local copy of non-existing file `%s'" filename)) - (tramp-message v 4 "Fetching %s to tmp file %s..." filename tmpfil) - (if (tramp-smb-send-command v (format "get \"%s\" %s" file tmpfil)) + (tramp-message v 4 "Fetching %s to tmp file %s..." filename tmpfile) + (if (tramp-smb-send-command v (format "get \"%s\" %s" file tmpfile)) (tramp-message - v 4 "Fetching %s to tmp file %s...done" filename tmpfil) + v 4 "Fetching %s to tmp file %s...done" filename tmpfile) (tramp-error v 'file-error "Cannot make local copy of file `%s'" filename)) - tmpfil))) + tmpfile))) ;; This function should return "foo/" for directories and "bar" for ;; files. @@ -582,7 +575,7 @@ Catches errors for shares like \"C$/\", which are common in Microsoft Windows." (unless (eq append nil) (tramp-error v 'file-error "Cannot append to file using tramp (`%s')" filename)) - ;; XEmacs takes a coding system as the seventh argument, not `confirm' + ;; XEmacs takes a coding system as the seventh argument, not `confirm'. (when (and (not (featurep 'xemacs)) confirm (file-exists-p filename)) (unless (y-or-n-p (format "File %s exists; overwrite anyway? " @@ -594,25 +587,23 @@ Catches errors for shares like \"C$/\", which are common in Microsoft Windows." (tramp-flush-file-property v localname) (let ((file (tramp-smb-get-localname localname t)) (curbuf (current-buffer)) - tmpfil) - ;; Write region into a tmp file. - (setq tmpfil (tramp-make-temp-file filename)) + (tmpfile (tramp-compat-make-temp-file filename))) ;; We say `no-message' here because we don't want the visited file ;; modtime data to be clobbered from the temp file. We call ;; `set-visited-file-modtime' ourselves later on. (tramp-run-real-handler 'write-region (if confirm ; don't pass this arg unless defined for backward compat. - (list start end tmpfil append 'no-message lockname confirm) - (list start end tmpfil append 'no-message lockname))) + (list start end tmpfile append 'no-message lockname confirm) + (list start end tmpfile append 'no-message lockname))) - (tramp-message v 5 "Writing tmp file %s to file %s..." tmpfil filename) - (if (tramp-smb-send-command v (format "put %s \"%s\"" tmpfil file)) + (tramp-message v 5 "Writing tmp file %s to file %s..." tmpfile filename) + (if (tramp-smb-send-command v (format "put %s \"%s\"" tmpfile file)) (tramp-message - v 5 "Writing tmp file %s to file %s...done" tmpfil filename) + v 5 "Writing tmp file %s to file %s...done" tmpfile filename) (tramp-error v 'file-error "Cannot write `%s'" filename)) - (delete-file tmpfil) + (delete-file tmpfile) (unless (equal curbuf (current-buffer)) (tramp-error v 'file-error @@ -762,7 +753,7 @@ If SHARE is result, entries are of type dir. Otherwise, shares are listed. Result is the list (LOCALNAME MODE SIZE MTIME)." ;; We are called from `tramp-smb-get-file-entries', which sets the ;; current buffer. - (let ((line (buffer-substring (point) (tramp-line-end-position))) + (let ((line (buffer-substring (point) (tramp-compat-line-end-position))) localname mode size month day hour min sec year mtime) (if (not share) @@ -890,7 +881,7 @@ connection if a previous connection has died for some reason." (when (and p (processp p)) (delete-process p)) (unless (let ((default-directory - (tramp-temporary-file-directory))) + (tramp-compat-temporary-file-directory))) (executable-find tramp-smb-program)) (error "Cannot find command %s in %s" tramp-smb-program exec-path)) @@ -929,7 +920,8 @@ connection if a previous connection has died for some reason." (let* ((coding-system-for-read nil) (process-connection-type tramp-process-connection-type) - (p (let ((default-directory (tramp-temporary-file-directory))) + (p (let ((default-directory + (tramp-compat-temporary-file-directory))) (apply #'start-process (tramp-buffer-name vec) (tramp-get-buffer vec) tramp-smb-program args)))) diff --git a/lisp/net/tramp-uu.el b/lisp/net/tramp-uu.el index c399a0b211d..d9994e9dc83 100644 --- a/lisp/net/tramp-uu.el +++ b/lisp/net/tramp-uu.el @@ -1,5 +1,5 @@ -;;; -*- coding: utf-8; -*- ;;; tramp-uu.el --- uuencode in Lisp +;;; -*- coding: utf-8; -*- ;; Copyright (C) 2002, 2003, 2004, 2005, 2006, ;; 2007 Free Software Foundation, Inc. diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index affeac31c33..26846f562f5 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -1,5 +1,5 @@ -;;; -*- mode: Emacs-Lisp; coding: utf-8; -*- ;;; tramp.el --- Transparent Remote Access, Multiple Protocol +;;; -*- mode: Emacs-Lisp; coding: utf-8; -*- ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, ;; 2005, 2006, 2007 Free Software Foundation, Inc. @@ -72,11 +72,11 @@ (when (featurep 'trampver) (unload-feature 'trampver 'force)))) -(require 'custom) - -(if (featurep 'xemacs) - (require 'timer-funcs) - (require 'timer)) +(require 'tramp-compat) +(add-hook 'tramp-unload-hook + '(lambda () + (when (featurep 'tramp-compat) + (unload-feature 'tramp-compat 'force)))) (require 'format-spec) ;from Gnus 5.8, also in tar ball ;; As long as password.el is not part of (X)Emacs, it shouldn't @@ -88,11 +88,6 @@ (require 'shell) (require 'advice) -;; `copy-tree' is part of subr.el since Emacs 22. -(eval-when-compile - (unless (functionp 'copy-tree) - (require 'cl))) - ;; Requiring 'tramp-cache results in an endless loop. (autoload 'tramp-get-file-property "tramp-cache") (autoload 'tramp-set-file-property "tramp-cache") @@ -149,56 +144,12 @@ (unload-feature 'tramp-fish 'force)))) ;; Load gateways. It needs `make-network-process' from Emacs 22. - (if (functionp 'make-network-process) - (progn - (require 'tramp-gw) - (add-hook 'tramp-unload-hook - '(lambda () - (when (featurep 'tramp-gw) - (unload-feature 'tramp-gw 'force))))) - ;; We need to declare used tramp-gw-* symbols at least. - (setq tramp-gw-tunnel-method "" - tramp-gw-socks-method "") - (defalias 'tramp-gw-open-connection 'ignore)) - - ;; tramp-util offers integration into other (X)Emacs packages like - ;; compile.el, gud.el etc. Not necessary in Emacs 23. - (unless (functionp 'start-file-process) - (require 'tramp-util) + (when (functionp 'make-network-process) + (require 'tramp-gw) (add-hook 'tramp-unload-hook '(lambda () - (when (featurep 'tramp-util) - (unload-feature 'tramp-util 'force))))))) - -;; Avoid byte-compiler warnings if the byte-compiler supports this. -;; Currently, XEmacs supports this. -(eval-when-compile - (when (featurep 'xemacs) - (byte-compiler-options (warnings (- unused-vars))))) - -;; `last-coding-system-used' is unknown in XEmacs. -(eval-when-compile - (unless (boundp 'last-coding-system-used) - (defvar last-coding-system-used nil))) - -;; `directory-sep-char' is an obsolete variable in Emacs. But it is -;; used in XEmacs, so we set it here and there. The following is needed -;; to pacify Emacs byte-compiler. -(eval-when-compile - (unless (boundp 'byte-compile-not-obsolete-var) - (defvar byte-compile-not-obsolete-var nil)) - (setq byte-compile-not-obsolete-var 'directory-sep-char)) - -;; `with-temp-message' does not exists in XEmacs. -(eval-and-compile - (condition-case nil - (with-temp-message (current-message) nil) - (error (defmacro with-temp-message (message &rest body) `(progn ,@body))))) - -;; `set-buffer-multibyte' comes from Emacs Leim. -(eval-and-compile - (unless (fboundp 'set-buffer-multibyte) - (defalias 'set-buffer-multibyte 'ignore))) + (when (featurep 'tramp-gw) + (unload-feature 'tramp-gw 'force))))))) ;;; User Customizable Internal Variables: @@ -208,7 +159,7 @@ :version "22.1") (defcustom tramp-verbose 3 - "*Verbosity level for tramp. + "*Verbosity level for Tramp. Any level x includes messages for all levels 1 .. x-1. The levels are 0 silent (no tramp messages at all) @@ -1118,7 +1069,7 @@ The answer will be provided by `tramp-action-process-alive', "*Prefix to use for temporary files. If this is a relative file name (such as \"tramp.\"), it is considered relative to the directory name returned by the function -`tramp-temporary-file-directory' (which see). It may also be an +`tramp-compat-temporary-file-directory' (which see). It may also be an absolute file name; don't forget to include a prefix for the filename part, though." :group 'tramp @@ -1311,7 +1262,7 @@ See `tramp-file-name-structure' for more explanations.") ((equal tramp-syntax 'sep) tramp-file-name-regexp-separate) ((equal tramp-syntax 'url) tramp-file-name-regexp-url) (t (error "Wrong `tramp-syntax' defined"))) - "*Regular expression matching file names handled by tramp. + "*Regular expression matching file names handled by Tramp. This regexp should match tramp file names but no other file names. \(When tramp.el is loaded, this regular expression is prepended to `file-name-handler-alist', and that is searched sequentially. Thus, @@ -1731,27 +1682,27 @@ while (my $data = <STDIN>) { Escape sequence %s is replaced with name of Perl binary. This string is passed to `format', so percent characters need to be doubled.") -(defconst tramp-file-mode-type-map '((0 . "-") ; Normal file (SVID-v2 and XPG2) - (1 . "p") ; fifo - (2 . "c") ; character device - (3 . "m") ; multiplexed character device (v7) - (4 . "d") ; directory - (5 . "?") ; Named special file (XENIX) - (6 . "b") ; block device - (7 . "?") ; multiplexed block device (v7) - (8 . "-") ; regular file - (9 . "n") ; network special file (HP-UX) - (10 . "l") ; symlink - (11 . "?") ; ACL shadow inode (Solaris, not userspace) - (12 . "s") ; socket - (13 . "D") ; door special (Solaris) - (14 . "w")) ; whiteout (BSD) +(defconst tramp-file-mode-type-map + '((0 . "-") ; Normal file (SVID-v2 and XPG2) + (1 . "p") ; fifo + (2 . "c") ; character device + (3 . "m") ; multiplexed character device (v7) + (4 . "d") ; directory + (5 . "?") ; Named special file (XENIX) + (6 . "b") ; block device + (7 . "?") ; multiplexed block device (v7) + (8 . "-") ; regular file + (9 . "n") ; network special file (HP-UX) + (10 . "l") ; symlink + (11 . "?") ; ACL shadow inode (Solaris, not userspace) + (12 . "s") ; socket + (13 . "D") ; door special (Solaris) + (14 . "w")) ; whiteout (BSD) "A list of file types returned from the `stat' system call. This is used to map a mode number to a permission string.") ;; New handlers should be added here. The following operations can be ;; handled using the normal primitives: file-name-as-directory, -;; file-name-directory, file-name-nondirectory, ;; file-name-sans-versions, get-file-buffer. (defconst tramp-file-name-handler-alist '((load . tramp-handle-load) @@ -1794,6 +1745,8 @@ This is used to map a mode number to a permission string.") (file-local-copy . tramp-handle-file-local-copy) (file-remote-p . tramp-handle-file-remote-p) (insert-file-contents . tramp-handle-insert-file-contents) + (insert-file-contents-literally + . tramp-handle-insert-file-contents-literally) (write-region . tramp-handle-write-region) (find-backup-file-name . tramp-handle-find-backup-file-name) (make-auto-save-file-name . tramp-handle-make-auto-save-file-name) @@ -1938,15 +1891,6 @@ an input event arrives. The other arguments are passed to `tramp-error'." (tramp-get-buffer vec-or-proc))) (sit-for 30)))))) -(defsubst tramp-line-end-position nil - "Return point at end of line. -Calls `line-end-position' or `point-at-eol' if defined, else -own implementation." - (cond - ((fboundp 'line-end-position) (funcall (symbol-function 'line-end-position))) - ((fboundp 'point-at-eol) (funcall (symbol-function 'point-at-eol))) - (t (save-excursion (end-of-line) (point))))) - (defmacro with-parsed-tramp-file-name (filename var &rest body) "Parse a Tramp filename and make components available in the body. @@ -1975,14 +1919,7 @@ If VAR is nil, then we bind `v' to the structure and `method', `user', (put 'with-parsed-tramp-file-name 'lisp-indent-function 2) (put 'with-parsed-tramp-file-name 'edebug-form-spec '(form symbolp body)) -;; Enable debugging. -;(eval-and-compile -; (when (featurep 'edebug) -; (def-edebug-spec with-parsed-tramp-file-name (form symbolp body)))) -;; Highlight as keyword. -(when (functionp 'font-lock-add-keywords) - (funcall 'font-lock-add-keywords - 'emacs-lisp-mode '("\\<with-parsed-tramp-file-name\\>"))) +(font-lock-add-keywords 'emacs-lisp-mode '("\\<with-parsed-tramp-file-name\\>")) (defmacro with-file-property (vec file property &rest body) "Check in Tramp cache for PROPERTY, otherwise execute BODY and set cache. @@ -1997,8 +1934,10 @@ FILE must be a local file name on a connection identified via VEC." (tramp-set-file-property ,vec ,file ,property value)) value) ,@body)) + (put 'with-file-property 'lisp-indent-function 3) (put 'with-file-property 'edebug-form-spec t) +(font-lock-add-keywords 'emacs-lisp-mode '("\\<with-file-property\\>")) (defmacro with-connection-property (key property &rest body) "Checks in Tramp for property PROPERTY, otherwise executes BODY and set." @@ -2010,8 +1949,10 @@ FILE must be a local file name on a connection identified via VEC." (setq value (progn ,@body)) (tramp-set-connection-property ,key ,property value)) value)) + (put 'with-connection-property 'lisp-indent-function 2) (put 'with-connection-property 'edebug-form-spec t) +(font-lock-add-keywords 'emacs-lisp-mode '("\\<with-connection-property\\>")) (defmacro tramp-let-maybe (variable value &rest body) "Let-bind VARIABLE to VALUE in BODY, but only if VARIABLE is not obsolete. @@ -2024,6 +1965,44 @@ The intent is to protect against `obsolete variable' warnings." (put 'tramp-let-maybe 'lisp-indent-function 2) (put 'tramp-let-maybe 'edebug-form-spec t) +(defsubst tramp-make-tramp-temp-file (vec &optional dont-create) + "Create a temporary file on the remote host identified by VEC. +Return the local name of the temporary file. +If DONT-CREATE is non-nil, just the file name is returned without +creation of the temporary file. This is not the preferred way to run, +but it is necessary during connection setup, because we cannot create +a remote file at this time. This parameter shall NOT be set to +non-nil else." + (if dont-create + ;; It sounds a little bit stupid to create a LOCAL file name. + ;; But we intend to use the remote directory "/tmp", and we have + ;; no chance to check whether a temporary file exists already + ;; remotely, because we have no working connection yet. + (make-temp-name (expand-file-name tramp-temp-name-prefix "/tmp")) + + (let ((prefix + (tramp-make-tramp-file-name + (tramp-file-name-method vec) + (tramp-file-name-user vec) + (tramp-file-name-host vec) + (expand-file-name tramp-temp-name-prefix "/tmp"))) + result) + (while (not result) + ;; `make-temp-file' would be the first choice for + ;; implementation. But it calls `write-region' internally, + ;; which also needs a temporary file - we would end in an + ;; infinite loop. + (setq result (make-temp-name prefix)) + (if (file-exists-p result) + (setq result nil) + ;; This creates the file by side effect. + (set-file-times result) + (set-file-modes result (tramp-octal-to-decimal "0700")))) + + ;; Return the local part. + (with-parsed-tramp-file-name result nil localname)))) + + ;;; Config Manipulation Functions: (defun tramp-set-completion-function (method function-list) @@ -2076,6 +2055,55 @@ For definition of that list see `tramp-set-completion-function'." ;; The method related defaults. (cdr (assoc method tramp-completion-function-alist)))) + +;;; Fontification of `read-file-name'. + +;; rfn-eshadow.el is part of Emacs 22. Its is autoloaded. +(defvar tramp-rfn-eshadow-overlay) +(make-variable-buffer-local 'tramp-rfn-eshadow-overlay) + +(defun tramp-rfn-eshadow-setup-minibuffer () + "Set up a minibuffer for `file-name-shadow-mode'. +Adds another overlay hiding filename parts according to Tramp's +special handling of `substitute-in-file-name'." + (when (symbol-value 'minibuffer-completing-file-name) + (setq tramp-rfn-eshadow-overlay + (funcall (symbol-function 'make-overlay) + (funcall (symbol-function 'minibuffer-prompt-end)) + (funcall (symbol-function 'minibuffer-prompt-end)))) + ;; Copy rfn-eshadow-overlay properties. + (let ((props (funcall (symbol-function 'overlay-properties) + (symbol-value 'rfn-eshadow-overlay)))) + (while props + (funcall (symbol-function 'overlay-put) + tramp-rfn-eshadow-overlay (pop props) (pop props)))))) + +(when (boundp 'rfn-eshadow-setup-minibuffer-hook) + (add-hook 'rfn-eshadow-setup-minibuffer-hook + 'tramp-rfn-eshadow-setup-minibuffer)) + +(defun tramp-rfn-eshadow-update-overlay () + "Update `rfn-eshadow-overlay' to cover shadowed part of minibuffer input. +This is intended to be used as a minibuffer `post-command-hook' for +`file-name-shadow-mode'; the minibuffer should have already +been set up by `rfn-eshadow-setup-minibuffer'." + ;; In remote files name, there is a shadowing just for the local part. + (let ((end (or (funcall (symbol-function 'overlay-end) + (symbol-value 'rfn-eshadow-overlay)) + (funcall (symbol-function 'minibuffer-prompt-end))))) + (when (file-remote-p (buffer-substring-no-properties end (point-max))) + (narrow-to-region + (1+ (or (string-match "/" (buffer-string) end) end)) (point-max)) + (let ((rfn-eshadow-overlay tramp-rfn-eshadow-overlay) + (rfn-eshadow-update-overlay-hook nil)) + (funcall (symbol-function 'rfn-eshadow-update-overlay))) + (widen)))) + +(when (boundp 'rfn-eshadow-update-overlay-hook) + (add-hook 'rfn-eshadow-update-overlay-hook + 'tramp-rfn-eshadow-update-overlay)) + + ;;; File Name Handler Functions: (defun tramp-handle-make-symbolic-link @@ -2112,9 +2140,9 @@ target of the symlink differ." ;; If FILENAME is a Tramp name, use just the localname component. (when (tramp-tramp-file-p filename) - (setq filename (tramp-file-name-localname - (tramp-dissect-file-name - (expand-file-name filename))))) + (setq filename + (tramp-file-name-localname + (tramp-dissect-file-name (expand-file-name filename))))) ;; Right, they are on the same host, regardless of user, method, etc. ;; We now make the link on the remote machine. This will occur as the user @@ -2156,11 +2184,17 @@ target of the symlink differ." ;; Localname manipulation functions that grok TRAMP localnames... (defun tramp-handle-file-name-directory (file) "Like `file-name-directory' but aware of Tramp files." - ;; Everything except the last filename thing is the directory. - (with-parsed-tramp-file-name file nil + ;; Everything except the last filename thing is the directory. We + ;; cannot apply `with-parsed-tramp-file-name', because this expands + ;; the remote file name parts. This is a problem when we are in + ;; file name completion. + (let ((v (tramp-dissect-file-name file t))) ;; Run the command on the localname portion only. (tramp-make-tramp-file-name - method user host (file-name-directory (or localname ""))))) + (tramp-file-name-method v) + (tramp-file-name-user v) + (tramp-file-name-host v) + (file-name-directory (or (tramp-file-name-localname v) ""))))) (defun tramp-handle-file-name-nondirectory (file) "Like `file-name-nondirectory' but aware of Tramp files." @@ -2346,7 +2380,7 @@ target of the symlink differ." (when symlinkp (search-forward "-> ") (setq res-symlink-target - (buffer-substring (point) (tramp-line-end-position)))) + (buffer-substring (point) (tramp-compat-line-end-position)))) ;; return data gathered (list ;; 0. t for directory, string (name linked to) for symbolic @@ -2368,7 +2402,7 @@ target of the symlink differ." res-size ;; 8. File modes, as a string of ten letters or dashes as in ls -l. res-filemodes - ;; 9. t iff file's gid would change if file were deleted and + ;; 9. t if file's gid would change if file were deleted and ;; recreated. Will be set in `tramp-convert-file-attributes' t ;; 10. inode number. @@ -2560,7 +2594,7 @@ and gid of the corresponding user is taken. Both parameters must be integers." ;; `set-file-uid-gid'. (let ((uid (or (and (integerp uid) uid) (tramp-get-local-uid 'integer))) (gid (or (and (integerp gid) gid) (tramp-get-local-uid 'integer))) - (default-directory (tramp-temporary-file-directory))) + (default-directory (tramp-compat-temporary-file-directory))) (call-process "chown" nil nil nil (format "%d:%d" uid gid) (tramp-shell-quote-argument filename))))) @@ -2723,7 +2757,7 @@ and gid of the corresponding user is taken. Both parameters must be integers." (when (file-directory-p directory) (setq directory (expand-file-name directory)) (let* ((temp - (copy-tree + (tramp-compat-copy-tree (with-parsed-tramp-file-name directory nil (with-file-property v localname @@ -2817,7 +2851,8 @@ and gid of the corresponding user is taken. Both parameters must be integers." (with-current-buffer (tramp-get-buffer v) (goto-char (point-max)) (while (zerop (forward-line -1)) - (push (buffer-substring (point) (tramp-line-end-position)) + (push (buffer-substring + (point) (tramp-compat-line-end-position)) result))) result))))))) @@ -2873,17 +2908,23 @@ and gid of the corresponding user is taken. Both parameters must be integers." (filename newname &optional ok-if-already-exists keep-date preserve-uid-gid) "Like `copy-file' for Tramp files." ;; Check if both files are local -- invoke normal copy-file. - ;; Otherwise, use tramp from local system. + ;; Otherwise, use Tramp from local system. (setq filename (expand-file-name filename)) (setq newname (expand-file-name newname)) - ;; At least one file a tramp file? - (if (or (tramp-tramp-file-p filename) - (tramp-tramp-file-p newname)) - (tramp-do-copy-or-rename-file - 'copy filename newname ok-if-already-exists keep-date preserve-uid-gid) + (cond + ;; At least one file a tramp file? + ((or (tramp-tramp-file-p filename) + (tramp-tramp-file-p newname)) + (tramp-do-copy-or-rename-file + 'copy filename newname ok-if-already-exists keep-date preserve-uid-gid)) + ;; Compat section. + (preserve-uid-gid (tramp-run-real-handler 'copy-file - (list filename newname ok-if-already-exists keep-date preserve-uid-gid)))) + (list filename newname ok-if-already-exists keep-date preserve-uid-gid))) + (t + (tramp-run-real-handler + 'copy-file (list filename newname ok-if-already-exists keep-date))))) (defun tramp-handle-rename-file (filename newname &optional ok-if-already-exists) @@ -3012,8 +3053,7 @@ KEEP-DATE is non-nil if NEWNAME should have the same timestamp as FILENAME." (jka-compr-inhibit t)) (write-region (point-min) (point-max) newname)))) ;; KEEP-DATE handling. - (when (and keep-date (functionp 'set-file-times)) - (apply 'set-file-times (list newname modtime))) + (when keep-date (set-file-times newname modtime)) ;; Set the mode. (set-file-modes newname (file-modes filename)) ;; If the operation was `rename', delete the original file. @@ -3030,114 +3070,107 @@ the file (for rename). Both files must reside on the same host. KEEP-DATE means to make sure that NEWNAME has the same timestamp as FILENAME. PRESERVE-UID-GID, when non-nil, instructs to keep the uid and gid from FILENAME." - (with-parsed-tramp-file-name (if t1 filename newname) nil - (let* ((cmd (cond ((and (eq op 'copy) preserve-uid-gid) "cp -f -p") - ((eq op 'copy) "cp -f") - ((eq op 'rename) "mv -f") - (t (tramp-error - vec 'file-error - "Unknown operation `%s', must be `copy' or `rename'" - op)))) - (t1 (tramp-tramp-file-p filename)) - (t2 (tramp-tramp-file-p newname)) - (localname1 - (if t1 (tramp-handle-file-remote-p filename 'localname) filename)) - (localname2 - (if t2 (tramp-handle-file-remote-p newname 'localname) newname)) - (prefix (tramp-handle-file-remote-p (if t1 filename newname))) - (tmpfile (tramp-make-temp-file localname1))) + (let ((t1 (tramp-tramp-file-p filename)) + (t2 (tramp-tramp-file-p newname))) + (with-parsed-tramp-file-name (if t1 filename newname) nil + (let* ((cmd (cond ((and (eq op 'copy) preserve-uid-gid) "cp -f -p") + ((eq op 'copy) "cp -f") + ((eq op 'rename) "mv -f") + (t (tramp-error + v 'file-error + "Unknown operation `%s', must be `copy' or `rename'" + op)))) + (localname1 + (if t1 (tramp-handle-file-remote-p filename 'localname) filename)) + (localname2 + (if t2 (tramp-handle-file-remote-p newname 'localname) newname)) + (prefix (file-remote-p (if t1 filename newname)))) - (cond - ;; Both files are on a remote host, with same user. - ((and t1 t2) - (tramp-send-command - v - (format "%s %s %s" cmd - (tramp-shell-quote-argument localname1) - (tramp-shell-quote-argument localname2))) - (with-current-buffer (tramp-get-buffer v) - (goto-char (point-min)) - (unless - (or - (and keep-date - ;; Mask cp -f error. - (re-search-forward - tramp-operation-not-permitted-regexp nil t)) - (zerop (tramp-send-command-and-check v nil))) - (tramp-error-with-buffer - nil v 'file-error - "Copying directly failed, see buffer `%s' for details." - (buffer-name))))) - - ;; We are on the local host. - ((or t1 t2) (cond - ;; We can do it directly. - ((and (file-readable-p localname1) - (file-writable-p (file-name-directory localname2))) - (if (eq op 'copy) - (copy-file - localname1 localname2 ok-if-already-exists - keep-date preserve-uid-gid) - (rename-file localname1 localname2 ok-if-already-exists))) - - ;; We can do it directly with `tramp-send-command' - ((and (file-readable-p (concat prefix localname1)) - (file-writable-p - (file-name-directory (concat prefix localname2)))) - (tramp-do-copy-or-rename-file-directly - op (concat prefix localname1) (concat prefix localname2) - ok-if-already-exists keep-date t) - ;; We must change the ownership to the local user. - (tramp-set-file-uid-gid - (concat prefix localname2) - (tramp-get-local-uid 'integer) - (tramp-get-local-gid 'integer))) - - ;; We need a temporary file in between. - (t - ;; Create the temporary file. + ;; Both files are on a remote host, with same user. + ((and t1 t2) + (tramp-send-command + v + (format "%s %s %s" cmd + (tramp-shell-quote-argument localname1) + (tramp-shell-quote-argument localname2))) + (with-current-buffer (tramp-get-buffer v) + (goto-char (point-min)) + (unless + (or + (and keep-date + ;; Mask cp -f error. + (re-search-forward + tramp-operation-not-permitted-regexp nil t)) + (zerop (tramp-send-command-and-check v nil))) + (tramp-error-with-buffer + nil v 'file-error + "Copying directly failed, see buffer `%s' for details." + (buffer-name))))) + + ;; We are on the local host. + ((or t1 t2) (cond - (t1 - (tramp-send-command - v (format - "%s %s %s" cmd - (tramp-shell-quote-argument localname1) - (tramp-shell-quote-argument tmpfile))) - ;; We must change the ownership as remote user. - (tramp-set-file-uid-gid - (concat prefix tmpfile) - (tramp-get-local-uid 'integer) - (tramp-get-local-gid 'integer))) - (t2 + ;; We can do it directly. + ((and (file-readable-p localname1) + (file-writable-p (file-name-directory localname2))) (if (eq op 'copy) - (copy-file - localname1 tmpfile ok-if-already-exists + (tramp-compat-copy-file + localname1 localname2 ok-if-already-exists keep-date preserve-uid-gid) - (rename-file localname1 tmpfile ok-if-already-exists)) - ;; We must change the ownership as local user. + (rename-file localname1 localname2 ok-if-already-exists))) + + ;; We can do it directly with `tramp-send-command' + ((and (file-readable-p (concat prefix localname1)) + (file-writable-p + (file-name-directory (concat prefix localname2)))) + (tramp-do-copy-or-rename-file-directly + op (concat prefix localname1) (concat prefix localname2) + ok-if-already-exists keep-date t) + ;; We must change the ownership to the local user. (tramp-set-file-uid-gid - tmpfile - (tramp-get-remote-uid v 'integer) - (tramp-get-remote-gid v 'integer)))) - - ;; Move the temporary file to its destination. - (cond - (t2 - (tramp-send-command - v (format - "%s %s %s" cmd - (tramp-shell-quote-argument tmpfile) - (tramp-shell-quote-argument localname2)))) - (t1 - (if (eq op 'copy) - (copy-file - tmpfile localname2 ok-if-already-exists - keep-date preserve-uid-gid) - (rename-file tmpfile localname2 ok-if-already-exists)))) + (concat prefix localname2) + (tramp-get-local-uid 'integer) + (tramp-get-local-gid 'integer))) - ;; Remove temporary file. - (when (eq op 'copy) (delete-file tmpfile)))))) + ;; We need a temporary file in between. + (t + ;; Create the temporary file. + (let ((tmpfile (tramp-compat-make-temp-file localname1))) + (cond + (t1 + (tramp-send-command + v (format + "%s %s %s" cmd + (tramp-shell-quote-argument localname1) + (tramp-shell-quote-argument tmpfile))) + ;; We must change the ownership as remote user. + (tramp-set-file-uid-gid + (concat prefix tmpfile) + (tramp-get-local-uid 'integer) + (tramp-get-local-gid 'integer))) + (t2 + (if (eq op 'copy) + (tramp-compat-copy-file + localname1 tmpfile ok-if-already-exists + keep-date preserve-uid-gid) + (rename-file localname1 tmpfile ok-if-already-exists)) + ;; We must change the ownership as local user. + (tramp-set-file-uid-gid + tmpfile + (tramp-get-remote-uid v 'integer) + (tramp-get-remote-gid v 'integer)))) + + ;; Move the temporary file to its destination. + (cond + (t2 + (tramp-send-command + v (format + "mv -f %s %s" + (tramp-shell-quote-argument tmpfile) + (tramp-shell-quote-argument localname2)))) + (t1 + (rename-file tmpfile localname2 ok-if-already-exists))))))))) ;; Set the time and mode. Mask possible errors. ;; Won't be applied for 'rename. @@ -3175,7 +3208,7 @@ be a local filename. The method used must be an out-of-band method." ;; Compose copy command. (setq spec `((?h . ,host) (?u . ,user) (?p . ,port) - (?t . ,(tramp-make-tramp-temp-file v)) + (?t . ,(tramp-make-tramp-temp-file v 'dont-create)) (?k . ,(if keep-date " " ""))) copy-program (tramp-get-method-parameter method 'tramp-copy-program) @@ -3196,7 +3229,7 @@ be a local filename. The method used must be an out-of-band method." ;; Check for program. (when (and (fboundp 'executable-find) (not (let ((default-directory - (tramp-temporary-file-directory))) + (tramp-compat-temporary-file-directory))) (executable-find copy-program)))) (tramp-error v 'file-error "Cannot find copy program: %s" copy-program)) @@ -3220,7 +3253,7 @@ be a local filename. The method used must be an out-of-band method." ;; set a timeout, because the copying of large files can ;; last longer than 60 secs. (let ((p (let ((default-directory - (tramp-temporary-file-directory))) + (tramp-compat-temporary-file-directory))) (apply 'start-process (tramp-get-connection-property v "process-name" nil) @@ -3241,9 +3274,8 @@ be a local filename. The method used must be an out-of-band method." (tramp-message v 0 "Transferring %s to %s...done" filename newname) ;; Handle KEEP-DATE argument. - (when (and keep-date (not copy-keep-date) (functionp 'set-file-times)) - (apply 'set-file-times - (list newname (nth 5 (file-attributes filename))))) + (when (and keep-date (not copy-keep-date)) + (set-file-times newname (nth 5 (file-attributes filename)))) ;; Set the mode. (unless (and keep-date copy-keep-date) @@ -3503,7 +3535,7 @@ the result will be a local, non-Tramp, filename." (tramp-send-command v (format "cd %s; pwd" uname)) (with-current-buffer (tramp-get-buffer v) (goto-char (point-min)) - (buffer-substring (point) (tramp-line-end-position))))) + (buffer-substring (point) (tramp-compat-line-end-position))))) (setq localname (concat uname fname)))) ;; There might be a double slash, for example when "~/" ;; expands to "/". Remove this. @@ -3516,7 +3548,7 @@ the result will be a local, non-Tramp, filename." ;; bound, because on Windows there would be problems with UNC ;; shares or Cygwin mounts. (tramp-let-maybe directory-sep-char ?/ - (let ((default-directory (tramp-temporary-file-directory))) + (let ((default-directory (tramp-compat-temporary-file-directory))) (tramp-make-tramp-file-name method user host (tramp-drop-volume-letter @@ -3554,7 +3586,7 @@ beginning of local filename are not substituted." ;; In XEmacs, electricity is implemented via a key map for ?/ and ?~, ;; which calls corresponding functions (see minibuf.el). (when (fboundp 'minibuffer-electric-separator) - (mapcar + (mapc '(lambda (x) (eval `(defadvice ,x @@ -3577,21 +3609,6 @@ beginning of local filename are not substituted." ;;; Remote commands. -(defsubst tramp-make-temp-file (filename) - (concat - (funcall (if (fboundp 'make-temp-file) 'make-temp-file 'make-temp-name) - (expand-file-name tramp-temp-name-prefix - (tramp-temporary-file-directory))) - (file-name-extension filename t))) - -(defsubst tramp-make-tramp-temp-file (vec) - (format - "/tmp/%s%s" - tramp-temp-name-prefix - (if (get-buffer-process (tramp-get-connection-buffer vec)) - (process-id (get-buffer-process (tramp-get-connection-buffer vec))) - (emacs-pid)))) - (defun tramp-handle-executable-find (command) "Like `executable-find' for Tramp files." (with-parsed-tramp-file-name default-directory nil @@ -3642,8 +3659,7 @@ beginning of local filename are not substituted." (error "Implementation does not handle immediate return")) (with-parsed-tramp-file-name default-directory nil - (let ((temp-name-prefix (tramp-make-tramp-temp-file v)) - command input stderr outbuf ret) + (let (command input tmpinput stderr tmpstderr outbuf ret) ;; Compute command. (setq command (mapconcat 'tramp-shell-quote-argument (cons program args) " ")) @@ -3655,11 +3671,9 @@ beginning of local filename are not substituted." ;; INFILE is on the same remote host. (setq input (with-parsed-tramp-file-name infile nil localname)) ;; INFILE must be copied to remote host. - (setq input (concat temp-name-prefix ".in")) - (copy-file - infile - (tramp-make-tramp-file-name method user host input) - t))) + (setq input (tramp-make-tramp-temp-file v) + tmpinput (tramp-make-tramp-file-name method user host input)) + (copy-file infile tmpinput t))) (when input (setq command (format "%s <%s" command input))) ;; Determine output. @@ -3688,7 +3702,9 @@ beginning of local filename are not substituted." (cadr destination) nil localname)) ;; stderr must be copied to remote host. The temporary ;; file must be deleted after execution. - (setq stderr (concat temp-name-prefix ".err")))) + (setq stderr (tramp-make-tramp-temp-file v) + tmpstderr (tramp-make-tramp-file-name + method user host stderr)))) ;; stderr to be discarded ((null (cadr destination)) (setq stderr "/dev/null")))) @@ -3697,9 +3713,6 @@ beginning of local filename are not substituted." (setq outbuf (current-buffer)))) (when stderr (setq command (format "%s 2>%s" command stderr))) - ;; If we have a temporary file, it must be removed after operation. - (when (and input (string-match temp-name-prefix input)) - (setq command (format "%s; rm %s" command input))) ;; Goto working directory. (tramp-send-command v (format "cd %s" (tramp-shell-quote-argument localname))) @@ -3719,20 +3732,20 @@ beginning of local filename are not substituted." (error (kill-buffer (tramp-get-connection-buffer v)) (setq ret 1))) - (unless ret - ;; Check return code. - (setq ret (tramp-send-command-and-check v nil)) - ;; Provide error file. - (when (and stderr (string-match temp-name-prefix stderr)) - (rename-file (tramp-make-tramp-file-name method user host stderr) - (cadr destination) t))) + + ;; Check return code. + (unless ret (setq ret (tramp-send-command-and-check v nil))) + ;; Provide error file. + (when tmpstderr (rename-file tmpstderr (cadr destination) t)) + ;; Cleanup. + (when tmpinput (delete-file tmpinput)) ;; Return exit status. ret))) (defun tramp-handle-call-process-region (start end program &optional delete buffer display &rest args) "Like `call-process-region' for Tramp files." - (let ((tmpfile (tramp-make-temp-file ""))) + (let ((tmpfile (tramp-compat-make-temp-file ""))) (write-region start end tmpfile) (when delete (delete-region start end)) (unwind-protect @@ -3770,7 +3783,7 @@ beginning of local filename are not substituted." (if (integerp asynchronous) (apply 'tramp-handle-start-file-process "*Async Shell*" buffer args) - (apply 'tramp-handle-process-file + (apply 'process-file (car args) nil buffer nil (cdr args))) ;; Insert error messages if they were separated. (when (listp buffer) @@ -3779,7 +3792,9 @@ beginning of local filename are not substituted." (delete-file (buffer-file-name (cadr buffer)))) ;; There's some output, display it. (when (with-current-buffer output-buffer (> (point-max) (point-min))) - (display-message-or-buffer output-buffer))))) + (if (functionp 'display-message-or-buffer) + (funcall (symbol-function 'display-message-or-buffer) output-buffer) + (pop-to-buffer output-buffer)))))) ;; File Editing. @@ -3792,7 +3807,7 @@ beginning of local filename are not substituted." (with-parsed-tramp-file-name filename nil (let ((rem-enc (tramp-get-remote-coding v "remote-encoding")) (loc-dec (tramp-get-local-coding v "local-decoding")) - (tmpfil (tramp-make-temp-file filename))) + (tmpfile (tramp-compat-make-temp-file filename))) (unless (file-exists-p filename) (tramp-error v 'file-error @@ -3803,7 +3818,7 @@ beginning of local filename are not substituted." ((or (tramp-local-host-p v) (and (tramp-method-out-of-band-p v) (> (nth 7 (file-attributes filename)) tramp-copy-size-limit))) - (copy-file filename tmpfil t t)) + (copy-file filename tmpfile t t)) ;; Use inline encoding for file transfer. (rem-enc @@ -3828,29 +3843,29 @@ beginning of local filename are not substituted." filename loc-dec) (funcall loc-dec (point-min) (point-max)) (let ((coding-system-for-write 'binary)) - (write-region (point-min) (point-max) tmpfil)))) + (write-region (point-min) (point-max) tmpfile)))) ;; If tramp-decoding-function is not defined for this ;; method, we invoke tramp-decoding-command instead. - (let ((tmpfil2 (tramp-make-temp-file filename))) + (let ((tmpfile2 (tramp-compat-make-temp-file filename))) (let ((coding-system-for-write 'binary)) - (write-region (point-min) (point-max) tmpfil2)) + (write-region (point-min) (point-max) tmpfile2)) (tramp-message v 5 "Decoding remote file %s with command %s..." filename loc-dec) - (tramp-call-local-coding-command loc-dec tmpfil2 tmpfil) - (delete-file tmpfil2))) + (tramp-call-local-coding-command loc-dec tmpfile2 tmpfile) + (delete-file tmpfile2))) (tramp-message v 5 "Decoding remote file %s...done" filename) ;; Set proper permissions. - (set-file-modes tmpfil (file-modes filename)) + (set-file-modes tmpfile (file-modes filename)) ;; Set local user ownership. - (tramp-set-file-uid-gid tmpfil))) + (tramp-set-file-uid-gid tmpfile))) ;; Oops, I don't know what to do. (t (tramp-error v 'file-error "Wrong method specification for `%s'" method))) (run-hooks 'tramp-handle-file-local-copy-hook) - tmpfil))) + tmpfile))) (defun tramp-handle-file-remote-p (filename &optional identification connected) "Like `file-remote-p' for Tramp files." @@ -3887,7 +3902,7 @@ beginning of local filename are not substituted." (if (and (tramp-local-host-p v) (file-readable-p localname)) ;; Short track: if we are on the local host, we can run directly. - (insert-file-contents localname visit beg end replace) + (setq result (insert-file-contents localname visit beg end replace)) ;; `insert-file-contents-literally' takes care to avoid calling ;; jka-compr. By let-binding inhibit-file-name-operation, we @@ -3916,6 +3931,28 @@ beginning of local filename are not substituted." (list (expand-file-name filename) (cadr result)))))) +;; This is needed for XEmacs only. Code stolen from files.el. +(defun tramp-handle-insert-file-contents-literally + (filename &optional visit beg end replace) + "Like `insert-file-contents-literally' for Tramp files." + (let ((format-alist nil) + (after-insert-file-functions nil) + (coding-system-for-read 'no-conversion) + (coding-system-for-write 'no-conversion) + (find-buffer-file-type-function + (if (fboundp 'find-buffer-file-type) + (symbol-function 'find-buffer-file-type) + nil)) + (inhibit-file-name-handlers '(jka-compr-handler image-file-handler)) + (inhibit-file-name-operation 'insert-file-contents)) + (unwind-protect + (progn + (fset 'find-buffer-file-type (lambda (filename) t)) + (insert-file-contents filename visit beg end replace)) + (if find-buffer-file-type-function + (fset 'find-buffer-file-type find-buffer-file-type-function) + (fmakunbound 'find-buffer-file-type))))) + (defun tramp-handle-find-backup-file-name (filename) "Like `find-backup-file-name' for Tramp files." (with-parsed-tramp-file-name filename nil @@ -3975,13 +4012,13 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file." ;; UNIQUIFY element of `auto-save-file-name-transforms'); but for ;; all other cases we must do it ourselves. (when (boundp 'auto-save-file-name-transforms) - (mapcar + (mapc '(lambda (x) (when (and (string-match (car x) buffer-file-name) (not (car (cddr x)))) (setq tramp-auto-save-directory (or tramp-auto-save-directory - (tramp-temporary-file-directory))))) + (tramp-compat-temporary-file-directory))))) (symbol-value 'auto-save-file-name-transforms))) ;; Create directory. (when tramp-auto-save-directory @@ -4022,33 +4059,33 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file." ;; (error ;; "tramp-handle-write-region: LOCKNAME must be nil or equal FILENAME")) - ;; XEmacs takes a coding system as the seventh argument, not `confirm' + ;; XEmacs takes a coding system as the seventh argument, not `confirm'. (when (and (not (featurep 'xemacs)) confirm (file-exists-p filename)) (unless (y-or-n-p (format "File %s exists; overwrite anyway? " filename)) (tramp-error v 'file-error "File not overwritten"))) - (let ((rem-dec (tramp-get-remote-coding v "remote-decoding")) - (loc-enc (tramp-get-local-coding v "local-encoding")) - (modes (save-excursion (file-modes filename))) - ;; We use this to save the value of `last-coding-system-used' - ;; after writing the tmp file. At the end of the function, - ;; we set `last-coding-system-used' to this saved value. - ;; This way, any intermediary coding systems used while - ;; talking to the remote shell or suchlike won't hose this - ;; variable. This approach was snarfed from ange-ftp.el. - coding-system-used - ;; Write region into a tmp file. This isn't really needed if we - ;; use an encoding function, but currently we use it always - ;; because this makes the logic simpler. - (tmpfil (tramp-make-temp-file filename))) - - (if (and (tramp-local-host-p v) - (file-writable-p (file-name-directory localname))) - ;; Short track: if we are on the local host, we can run directly. - (if confirm - (write-region - start end localname append 'no-message lockname confirm) - (write-region start end localname append 'no-message lockname)) + (if (and (tramp-local-host-p v) + (file-writable-p (file-name-directory localname))) + ;; Short track: if we are on the local host, we can run directly. + (if confirm + (write-region + start end localname append 'no-message lockname confirm) + (write-region start end localname append 'no-message lockname)) + + (let ((rem-dec (tramp-get-remote-coding v "remote-decoding")) + (loc-enc (tramp-get-local-coding v "local-encoding")) + (modes (save-excursion (file-modes filename))) + ;; We use this to save the value of `last-coding-system-used' + ;; after writing the tmp file. At the end of the function, + ;; we set `last-coding-system-used' to this saved value. + ;; This way, any intermediary coding systems used while + ;; talking to the remote shell or suchlike won't hose this + ;; variable. This approach was snarfed from ange-ftp.el. + coding-system-used + ;; Write region into a tmp file. This isn't really needed if we + ;; use an encoding function, but currently we use it always + ;; because this makes the logic simpler. + (tmpfile (tramp-compat-make-temp-file filename))) ;; We say `no-message' here because we don't want the visited file ;; modtime data to be clobbered from the temp file. We call @@ -4056,8 +4093,8 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file." (tramp-run-real-handler 'write-region (if confirm ; don't pass this arg unless defined for backward compat. - (list start end tmpfil append 'no-message lockname confirm) - (list start end tmpfil append 'no-message lockname))) + (list start end tmpfile append 'no-message lockname confirm) + (list start end tmpfile append 'no-message lockname))) ;; Now, `last-coding-system-used' has the right value. Remember it. (when (boundp 'last-coding-system-used) (setq coding-system-used (symbol-value 'last-coding-system-used))) @@ -4065,7 +4102,7 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file." ;; filename does not exist (eq modes nil) it has been renamed to ;; the backup file. This case `save-buffer' handles ;; permissions. - (when modes (set-file-modes tmpfil modes)) + (when modes (set-file-modes tmpfile modes)) ;; This is a bit lengthy due to the different methods possible for ;; file transfer. First, we check whether the method uses an rcp @@ -4079,11 +4116,11 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file." (and (tramp-method-out-of-band-p v) (integerp start) (> (- end start) tramp-copy-size-limit))) - (rename-file tmpfil filename t)) + (rename-file tmpfile filename t)) ;; Use inline file transfer (rem-dec - ;; Encode tmpfil + ;; Encode tmpfile (tramp-message v 5 "Encoding region...") (unwind-protect (with-temp-buffer @@ -4094,7 +4131,7 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file." v 5 "Encoding region using function `%s'..." (symbol-name loc-enc)) (let ((coding-system-for-read 'binary)) - (insert-file-contents-literally tmpfil)) + (insert-file-contents-literally tmpfile)) ;; CCC. The following `let' is a workaround for ;; the base64.el that comes with pgnus-0.84. If ;; both of the following conditions are @@ -4105,13 +4142,13 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file." ;; files, it seems.) The file in question is a ;; tmp file anyway. (let ((default-directory - (tramp-temporary-file-directory))) + (tramp-compat-temporary-file-directory))) (funcall loc-enc (point-min) (point-max)))) (tramp-message v 5 "Encoding region using command `%s'..." loc-enc) (unless (equal 0 (tramp-call-local-coding-command - loc-enc tmpfil t)) + loc-enc tmpfile t)) (tramp-error v 'file-error "Cannot write to `%s', local encoding command `%s' failed" @@ -4137,13 +4174,14 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file." filename rem-dec) ;; When `file-precious-flag' is set, the region is ;; written to a temporary file. Check that the - ;; checksum is equal to that from the local tmpfil. + ;; checksum is equal to that from the local tmpfile. (when file-precious-flag (erase-buffer) (and ;; cksum runs locally - (let ((default-directory (tramp-temporary-file-directory))) - (zerop (call-process "cksum" tmpfil t))) + (let ((default-directory + (tramp-compat-temporary-file-directory))) + (zerop (call-process "cksum" tmpfile t))) ;; cksum runs remotely (zerop (tramp-send-command-and-check @@ -4164,7 +4202,7 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file." (tramp-flush-file-property v localname)) ;; Save exit. - (delete-file tmpfil))) + (delete-file tmpfile))) ;; That's not expected. (t @@ -4172,8 +4210,13 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file." v 'file-error (concat "Method `%s' should specify both encoding and " "decoding command or an rcp program") - method)))) + method))) + + ;; Make `last-coding-system-used' have the right value. + (when coding-system-used + (set 'last-coding-system-used coding-system-used))) + ;; Set file modification time. (when (or (eq visit t) (stringp visit)) (set-visited-file-modtime ;; We must pass modtime explicitely, because filename can be different @@ -4181,9 +4224,6 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file." (nth 5 (file-attributes filename)))) ;; Set the ownership. (tramp-set-file-uid-gid filename) - ;; Make `last-coding-system-used' have the right value. - (when coding-system-used - (set 'last-coding-system-used coding-system-used)) (when (or (eq visit t) (null visit) (stringp visit)) (tramp-message v 0 "Wrote %s" filename)) (run-hooks 'tramp-handle-write-region-hook)))) @@ -4305,20 +4345,24 @@ ARGS are the arguments OPERATION has been called with." (defun tramp-find-foreign-file-name-handler (filename) "Return foreign file name handler if exists." - (when (and (stringp filename) (tramp-tramp-file-p filename) - (or (not (tramp-completion-mode)) - (not (string-match - tramp-completion-file-name-regexp filename)))) - (let (elt - res - (handler-alist tramp-foreign-file-name-handler-alist)) - (while handler-alist - (setq elt (car handler-alist) - handler-alist (cdr handler-alist)) - (when (funcall (car elt) filename) - (setq handler-alist nil) - (setq res (cdr elt)))) - res))) + (when (and (stringp filename) (tramp-tramp-file-p filename)) + (let ((v (tramp-dissect-file-name filename t)) + (handler tramp-foreign-file-name-handler-alist) + elt res) + ;; When we are not fully sure that filename completion is safe, + ;; we should not return a handler. + (when (or (tramp-file-name-method v) (tramp-file-name-user v) + (and (tramp-file-name-host v) + (not (member (tramp-file-name-host v) + (mapcar 'car tramp-methods)))) + (not (tramp-completion-mode-p))) + (while handler + (setq elt (car handler) + handler (cdr handler)) + (when (funcall (car elt) filename) + (setq handler nil + res (cdr elt)))) + res)))) ;; Main function. ;;;###autoload @@ -4327,7 +4371,7 @@ ARGS are the arguments OPERATION has been called with." Falls back to normal file name handler if no tramp file name handler exists." (save-match-data (let* ((filename (apply 'tramp-file-name-for-operation operation args)) - (completion (tramp-completion-mode)) + (completion (tramp-completion-mode-p)) (foreign (tramp-find-foreign-file-name-handler filename))) (with-parsed-tramp-file-name filename nil (cond @@ -4339,8 +4383,7 @@ Falls back to normal file name handler if no tramp file name handler exists." ((and completion (zerop (length localname)) (memq operation '(file-name-as-directory))) filename) - ;; Call the backend function. Set a connection property - ;; first, it will be reused for user/host name completion. + ;; Call the backend function. (foreign (apply foreign operation args)) ;; Nothing to do for us. (t (tramp-run-real-handler operation args))))))) @@ -4439,9 +4482,12 @@ Falls back to normal file name handler if no tramp file name handler exists." ;; `partial-completion-mode' is unknown in XEmacs. So we should ;; load it unconditionally there. In the GNU Emacs case, method/ ;; user/host name completion shall be bound to `partial-completion-mode'. + ;; `ido-mode' and `icy-mode' are other packages which extend file + ;; name completion. (when (or (not (boundp 'partial-completion-mode)) (symbol-value 'partial-completion-mode) - (featurep 'ido)) + (featurep 'ido) + (featurep 'icicles)) (add-to-list 'file-name-handler-alist (cons tramp-completion-file-name-regexp 'tramp-completion-file-name-handler)) @@ -4497,8 +4543,8 @@ Falls back to normal file name handler if no tramp file name handler exists." ;;- method user host ;;- (format "echo %s" (comint-quote-filename localname)))) (tramp-send-command v (format "echo %s" localname)) - (setq bufstr (buffer-substring (point-min) - (tramp-line-end-position))) + (setq bufstr (buffer-substring + (point-min) (tramp-compat-line-end-position))) (with-current-buffer (tramp-get-buffer v) (goto-char (point-min)) (if (string-equal localname bufstr) @@ -4528,7 +4574,15 @@ Falls back to normal file name handler if no tramp file name handler exists." (add-hook 'tramp-unload-hook '(lambda () (ad-unadvise 'PC-expand-many-files))))) -;;; File name handler functions for completion mode +;;; File name handler functions for completion mode. + +(defvar tramp-completion-mode nil + "If non-nil, external packages signal that they are in file name completion. + +This is necessary, because Tramp uses a heuristic depending on last +input event. This fails when external packages use other characters +but <TAB>, <SPACE> or ?\\? for file name completion. This variable +should never be set globally, the intention is to let-bind it.") ;; Necessary because `tramp-file-name-regexp-unified' and ;; `tramp-completion-file-name-regexp-unified' aren't different. If @@ -4541,35 +4595,38 @@ Falls back to normal file name handler if no tramp file name handler exists." ;; tramp file name syntax. Maybe another variable should be introduced ;; overwriting this check in such cases. Or we change tramp file name ;; syntax in order to avoid ambiguities, like in XEmacs ... -(defun tramp-completion-mode () +(defun tramp-completion-mode-p () "Checks whether method / user name / host name completion is active." - (or (equal last-input-event 'tab) - ;; Emacs - (and (natnump last-input-event) - (or - ;; ?\t has event-modifier 'control - (char-equal last-input-event ?\t) - (and (not (event-modifiers last-input-event)) - (or (char-equal last-input-event ?\?) - (char-equal last-input-event ?\ ))))) - ;; XEmacs - (and (featurep 'xemacs) - ;; `last-input-event' might be nil. - (not (null last-input-event)) - ;; `last-input-event' may have no character approximation. - (funcall (symbol-function 'event-to-character) last-input-event) - (or - ;; ?\t has event-modifier 'control - (char-equal - (funcall (symbol-function 'event-to-character) - last-input-event) ?\t) - (and (not (event-modifiers last-input-event)) - (or (char-equal - (funcall (symbol-function 'event-to-character) - last-input-event) ?\?) - (char-equal - (funcall (symbol-function 'event-to-character) - last-input-event) ?\ ))))))) + (or + ;; Signal from outside. + tramp-completion-mode + ;; Emacs. + (equal last-input-event 'tab) + (and (natnump last-input-event) + (or + ;; ?\t has event-modifier 'control. + (char-equal last-input-event ?\t) + (and (not (event-modifiers last-input-event)) + (or (char-equal last-input-event ?\?) + (char-equal last-input-event ?\ ))))) + ;; XEmacs. + (and (featurep 'xemacs) + ;; `last-input-event' might be nil. + (not (null last-input-event)) + ;; `last-input-event' may have no character approximation. + (funcall (symbol-function 'event-to-character) last-input-event) + (or + ;; ?\t has event-modifier 'control. + (char-equal + (funcall (symbol-function 'event-to-character) + last-input-event) ?\t) + (and (not (event-modifiers last-input-event)) + (or (char-equal + (funcall (symbol-function 'event-to-character) + last-input-event) ?\?) + (char-equal + (funcall (symbol-function 'event-to-character) + last-input-event) ?\ ))))))) ;; Method, host name and user name completion. ;; `tramp-completion-dissect-file-name' returns a list of @@ -4600,19 +4657,20 @@ Falls back to normal file name handler if no tramp file name handler exists." ;; Method dependent user / host combinations. (progn - (mapcar + (mapc (lambda (x) (setq all-user-hosts (append all-user-hosts (funcall (nth 0 x) (nth 1 x))))) (tramp-get-completion-function m)) - (setq result (append result - (mapcar - (lambda (x) - (tramp-get-completion-user-host - method user host (nth 0 x) (nth 1 x))) - (delq nil all-user-hosts))))) + (setq result + (append result + (mapcar + (lambda (x) + (tramp-get-completion-user-host + method user host (nth 0 x) (nth 1 x))) + (delq nil all-user-hosts))))) ;; Possible methods. (setq result @@ -4739,7 +4797,7 @@ They are collected by `tramp-completion-dissect-file-name1'." (concat tramp-prefix-regexp "/$")) 1 nil 3 nil))) - (mapcar (lambda (regexp) + (mapc (lambda (regexp) (add-to-list 'result (tramp-completion-dissect-file-name1 regexp name))) (list @@ -4821,7 +4879,7 @@ PARTIAL-USER must match USER, PARTIAL-HOST must match HOST." Either user or host may be nil." ;; On Windows, there are problems in completion when ;; `default-directory' is remote. - (let ((default-directory (tramp-temporary-file-directory)) + (let ((default-directory (tramp-compat-temporary-file-directory)) res) (when (file-readable-p filename) (with-temp-buffer @@ -4839,7 +4897,7 @@ Either user or host may be nil." (concat "^\\(" tramp-host-regexp "\\)" "\\([ \t]+" "\\(" tramp-user-regexp "\\)" "\\)?"))) - (narrow-to-region (point) (tramp-line-end-position)) + (narrow-to-region (point) (tramp-compat-line-end-position)) (when (re-search-forward regexp nil t) (setq result (append (list (match-string 3) (match-string 1))))) (widen) @@ -4851,7 +4909,7 @@ Either user or host may be nil." User is always nil." ;; On Windows, there are problems in completion when ;; `default-directory' is remote. - (let ((default-directory (tramp-temporary-file-directory)) + (let ((default-directory (tramp-compat-temporary-file-directory)) res) (when (file-readable-p filename) (with-temp-buffer @@ -4866,7 +4924,7 @@ User is always nil." User is always nil." (let ((result) (regexp (concat "^\\(" tramp-host-regexp "\\)"))) - (narrow-to-region (point) (tramp-line-end-position)) + (narrow-to-region (point) (tramp-compat-line-end-position)) (when (re-search-forward regexp nil t) (setq result (list nil (match-string 1)))) (widen) @@ -4880,7 +4938,7 @@ User is always nil." User is always nil." ;; On Windows, there are problems in completion when ;; `default-directory' is remote. - (let ((default-directory (tramp-temporary-file-directory)) + (let ((default-directory (tramp-compat-temporary-file-directory)) res) (when (file-readable-p filename) (with-temp-buffer @@ -4895,7 +4953,7 @@ User is always nil." User is always nil." (let ((result) (regexp (concat "^[ \t]*Host[ \t]+" "\\(" tramp-host-regexp "\\)"))) - (narrow-to-region (point) (tramp-line-end-position)) + (narrow-to-region (point) (tramp-compat-line-end-position)) (when (re-search-forward regexp nil t) (setq result (list nil (match-string 1)))) (widen) @@ -4909,7 +4967,7 @@ User is always nil." User is always nil." ;; On Windows, there are problems in completion when ;; `default-directory' is remote. - (let* ((default-directory (tramp-temporary-file-directory)) + (let* ((default-directory (tramp-compat-temporary-file-directory)) (regexp (concat "^key_[0-9]+_\\(" tramp-host-regexp "\\)\\.pub$")) (files (when (file-directory-p dirname) (directory-files dirname))) result) @@ -4924,7 +4982,7 @@ User is always nil." User is always nil." ;; On Windows, there are problems in completion when ;; `default-directory' is remote. - (let* ((default-directory (tramp-temporary-file-directory)) + (let* ((default-directory (tramp-compat-temporary-file-directory)) (regexp (concat "^\\(" tramp-host-regexp "\\)\\.ssh-\\(dss\\|rsa\\)\\.pub$")) (files (when (file-directory-p dirname) (directory-files dirname))) @@ -4940,7 +4998,7 @@ User is always nil." User is always nil." ;; On Windows, there are problems in completion when ;; `default-directory' is remote. - (let ((default-directory (tramp-temporary-file-directory)) + (let ((default-directory (tramp-compat-temporary-file-directory)) res) (when (file-readable-p filename) (with-temp-buffer @@ -4955,7 +5013,7 @@ User is always nil." User is always nil." (let ((result) (regexp (concat "^\\(" tramp-host-regexp "\\)"))) - (narrow-to-region (point) (tramp-line-end-position)) + (narrow-to-region (point) (tramp-compat-line-end-position)) (when (re-search-forward regexp nil t) (unless (char-equal (or (char-after) ?\n) ?:) ; no IPv6 (setq result (list nil (match-string 1))))) @@ -4974,7 +5032,7 @@ User is always nil." Host is always \"localhost\"." ;; On Windows, there are problems in completion when ;; `default-directory' is remote. - (let ((default-directory (tramp-temporary-file-directory)) + (let ((default-directory (tramp-compat-temporary-file-directory)) res) (if (zerop (length tramp-current-user)) '(("root" nil)) @@ -4991,7 +5049,7 @@ Host is always \"localhost\"." Host is always \"localhost\"." (let ((result) (regexp (concat "^\\(" tramp-user-regexp "\\):"))) - (narrow-to-region (point) (tramp-line-end-position)) + (narrow-to-region (point) (tramp-compat-line-end-position)) (when (re-search-forward regexp nil t) (setq result (list (match-string 1) "localhost"))) (widen) @@ -5003,7 +5061,7 @@ Host is always \"localhost\"." User may be nil." ;; On Windows, there are problems in completion when ;; `default-directory' is remote. - (let ((default-directory (tramp-temporary-file-directory)) + (let ((default-directory (tramp-compat-temporary-file-directory)) res) (when (file-readable-p filename) (with-temp-buffer @@ -5021,7 +5079,7 @@ User may be nil." (concat "^[ \t]*machine[ \t]+" "\\(" tramp-host-regexp "\\)" "\\([ \t]+login[ \t]+" "\\(" tramp-user-regexp "\\)" "\\)?"))) - (narrow-to-region (point) (tramp-line-end-position)) + (narrow-to-region (point) (tramp-compat-line-end-position)) (when (re-search-forward regexp nil t) (setq result (list (match-string 3) (match-string 1)))) (widen) @@ -5033,7 +5091,7 @@ User may be nil." User is always nil." ;; On Windows, there are problems in completion when ;; `default-directory' is remote. - (let ((default-directory (tramp-temporary-file-directory)) + (let ((default-directory (tramp-compat-temporary-file-directory)) res) (with-temp-buffer (when (zerop (call-process "reg" nil t nil "query" registry)) @@ -5047,7 +5105,7 @@ User is always nil." User is always nil." (let ((result) (regexp (concat (regexp-quote registry) "\\\\\\(.+\\)"))) - (narrow-to-region (point) (tramp-line-end-position)) + (narrow-to-region (point) (tramp-compat-line-end-position)) (when (re-search-forward regexp nil t) (setq result (list nil (match-string 1)))) (widen) @@ -5061,7 +5119,7 @@ User is always nil." Only send the definition if it has not already been done." (let* ((p (tramp-get-connection-process vec)) (scripts (tramp-get-connection-property p "scripts" nil))) - (unless (memq name scripts) + (unless (member name scripts) (tramp-message vec 5 "Sending script `%s'..." name) ;; The script could contain a call of Perl. This is masked with `%s'. (tramp-send-command-and-check @@ -5170,17 +5228,17 @@ from the default one." (get-buffer-create (tramp-debug-buffer-name vec)) (when (bobp) (setq buffer-undo-list t) - ;; Activate outline-mode - (make-local-variable 'outline-regexp) - (make-local-variable 'outline-level) - ;; This runs `text-mode-hook' and `outline-mode-hook'. We must - ;; prevent that local processes die. Yes: I've seen - ;; `flyspell-mode', which starts "ispell" ... - (let ((default-directory (tramp-temporary-file-directory))) + ;; Activate outline-mode. This runs `text-mode-hook' and + ;; `outline-mode-hook'. We must prevent that local processes + ;; die. Yes: I've seen `flyspell-mode', which starts "ispell" + ;; ... + (let ((default-directory (tramp-compat-temporary-file-directory))) (outline-mode)) - (setq outline-regexp "[0-9]+:[0-9]+:[0-9]+ [a-z0-9-]+ (\\([0-9]+\\)) #") -; (setq outline-regexp "[a-z.-]+:[0-9]+: [a-z0-9-]+ (\\([0-9]+\\)) #") - (setq outline-level 'tramp-outline-level)) + (set (make-local-variable 'outline-regexp) + "[0-9]+:[0-9]+:[0-9]+ [a-z0-9-]+ (\\([0-9]+\\)) #") +; (set (make-local-variable 'outline-regexp) +; "[a-z.-]+:[0-9]+: [a-z0-9-]+ (\\([0-9]+\\)) #") + (set (make-local-variable 'outline-level) 'tramp-outline-level)) (current-buffer))) (defun tramp-outline-level () @@ -5235,7 +5293,8 @@ This function expects to be in the right *tramp* buffer." (when (search-backward "tramp_executable " nil t) (skip-chars-forward "^ ") (skip-chars-forward " ") - (setq result (buffer-substring (point) (tramp-line-end-position))))) + (setq result (buffer-substring + (point) (tramp-compat-line-end-position))))) result))) (defun tramp-set-remote-path (vec) @@ -5659,9 +5718,7 @@ process to set up. VEC specifies the connection." (tramp-send-command-internal vec "set +o vi +o emacs") (tramp-message vec 5 "Setting shell prompt") ;; Douglas Gray Stephens <DGrayStephens@slb.com> says that we must - ;; use "\n" here, not tramp-rsh-end-of-line. We also manually frob - ;; the last time we sent a command, to avoid `tramp-send-command' to - ;; send "echo are you awake". + ;; use "\n" here, not tramp-rsh-end-of-line. (tramp-send-command vec (format "PROMPT_COMMAND=''; PS1='%s%s%s'; PS2=''; PS3=''" @@ -5898,7 +5955,7 @@ INPUT can also be nil which means `/dev/null'. OUTPUT can be a string (which specifies a filename), or t (which means standard output and thus the current buffer), or nil (which means discard it)." - (let ((default-directory (tramp-temporary-file-directory))) + (let ((default-directory (tramp-compat-temporary-file-directory))) (call-process tramp-encoding-shell ;program (when (and input (not (string-match "%s" cmd))) @@ -5945,10 +6002,12 @@ Gateway hops are already opened." (setq choices tramp-default-proxies-alist))))) ;; Handle gateways. - (when (string-match (format - "^\\(%s\\|%s\\)$" - tramp-gw-tunnel-method tramp-gw-socks-method) - (tramp-file-name-method (car target-alist))) + (when (and (boundp 'tramp-gw-tunnel-method) + (string-match (format + "^\\(%s\\|%s\\)$" + (symbol-value 'tramp-gw-tunnel-method) + (symbol-value 'tramp-gw-socks-method)) + (tramp-file-name-method (car target-alist)))) (let ((gw (pop target-alist)) (hop (pop target-alist))) ;; Is the method prepared for gateways? @@ -5973,7 +6032,7 @@ Gateway hops are already opened." 'target-alist (vector (tramp-file-name-method hop) (tramp-file-name-user hop) - (tramp-gw-open-connection vec gw hop) nil)) + (funcall (symbol-function 'tramp-gw-open-connection) vec gw hop) nil)) ;; For the password prompt, we need the correct values. ;; Therefore, we must remember the gateway vector. But we ;; cannot do it as connection property, because it shouldn't @@ -6013,16 +6072,23 @@ connection if a previous connection has died for some reason." ;; tries to send some data to the remote end. So that's why we ;; try to send a command from time to time, then look again ;; whether the process is really alive. - (when (and (> (tramp-time-diff - (current-time) - (tramp-get-connection-property p "last-cmd-time" '(0 0 0))) - 60) - p (processp p) (memq (process-status p) '(run open))) - (tramp-send-command vec "echo are you awake" t t) - (unless (and (memq (process-status p) '(run open)) - (tramp-wait-for-output p 10)) - (delete-process p) - (setq p nil))) + (condition-case nil + (when (and (> (tramp-time-diff + (current-time) + (tramp-get-connection-property + p "last-cmd-time" '(0 0 0))) + 60) + p (processp p) (memq (process-status p) '(run open))) + (tramp-send-command vec "echo are you awake" t t) + (unless (and (memq (process-status p) '(run open)) + (tramp-wait-for-output p 10)) + ;; The error will be catched locally. + (tramp-error vec 'file-error "Awake did fail"))) + (file-error + (tramp-flush-connection-property vec nil) + (tramp-flush-connection-property p nil) + (delete-process p) + (setq p nil))) ;; New connection must be opened. (unless (and p (processp p) (memq (process-status p) '(run open))) @@ -6053,7 +6119,8 @@ connection if a previous connection has died for some reason." (process-adaptive-read-buffering nil) (coding-system-for-read nil) ;; This must be done in order to avoid our file name handler. - (p (let ((default-directory (tramp-temporary-file-directory))) + (p (let ((default-directory + (tramp-compat-temporary-file-directory))) (start-process (or (tramp-get-connection-property vec "process-name" nil) (tramp-buffer-name vec)) @@ -6113,7 +6180,7 @@ connection if a previous connection has died for some reason." l-user (or l-user "") l-port (or l-port "") spec `((?h . ,l-host) (?u . ,l-user) (?p . ,l-port) - (?t . ,(tramp-make-tramp-temp-file vec))) + (?t . ,(tramp-make-tramp-temp-file vec 'dont-create))) command (concat command " " @@ -6238,8 +6305,8 @@ In case there is no valid Lisp expression, it raises an error" (condition-case nil (prog1 (read (current-buffer)) ;; Error handling. - (when (re-search-forward "\\S-" (tramp-line-end-position) t) - (error))) + (when (re-search-forward "\\S-" (tramp-compat-line-end-position) t) + (error nil))) (error (tramp-error vec 'file-error "`%s' does not return a valid Lisp expression: `%s'" @@ -6380,7 +6447,8 @@ Return ATTR." ;; Convert file size. (when (< (nth 7 attr) 0) (setcar (nthcdr 7 attr) -1)) - (when (and (floatp (nth 7 attr)) (<= (nth 7 attr) most-positive-fixnum)) + (when (and (floatp (nth 7 attr)) + (<= (nth 7 attr) (tramp-compat-most-positive-fixnum))) (setcar (nthcdr 7 attr) (round (nth 7 attr)))) ;; Convert file mode bits to string. (unless (stringp (nth 8 attr)) @@ -6524,7 +6592,7 @@ Not actually used. Use `(format \"%o\" i)' instead?" ;; The host part of a Tramp file name vector can be of kind ;; "host#port". Sometimes, we must extract these parts. -(defsubst tramp-file-name-real-host (vec) +(defun tramp-file-name-real-host (vec) "Return the host name of VEC without port." (let ((host (tramp-file-name-host vec))) (if (and (stringp host) @@ -6532,7 +6600,7 @@ Not actually used. Use `(format \"%o\" i)' instead?" (match-string 1 host) host))) -(defsubst tramp-file-name-port (vec) +(defun tramp-file-name-port (vec) "Return the port number of VEC." (let ((host (tramp-file-name-host vec))) (and (stringp host) @@ -6540,11 +6608,11 @@ Not actually used. Use `(format \"%o\" i)' instead?" (string-to-number (match-string 2 host))))) (defun tramp-tramp-file-p (name) - "Return t iff NAME is a tramp file." + "Return t if NAME is a tramp file." (save-match-data (string-match tramp-file-name-regexp name))) -(defsubst tramp-find-method (method user host) +(defun tramp-find-method (method user host) "Return the right method string to use. This is METHOD, if non-nil. Otherwise, do a lookup in `tramp-default-method-alist'." @@ -6560,7 +6628,7 @@ This is METHOD, if non-nil. Otherwise, do a lookup in lmethod) tramp-default-method)) -(defsubst tramp-find-user (method user host) +(defun tramp-find-user (method user host) "Return the right user string to use. This is USER, if non-nil. Otherwise, do a lookup in `tramp-default-user-alist'." @@ -6576,16 +6644,18 @@ This is USER, if non-nil. Otherwise, do a lookup in luser) tramp-default-user)) -(defsubst tramp-find-host (method user host) +(defun tramp-find-host (method user host) "Return the right host string to use. This is HOST, if non-nil. Otherwise, it is `tramp-default-host'." (or (and (> (length host) 0) host) tramp-default-host)) -(defun tramp-dissect-file-name (name) +(defun tramp-dissect-file-name (name &optional nodefault) "Return a `tramp-file-name' structure. -The structure consists of remote method, remote user, remote host and -localname (file name on remote host)." +The structure consists of remote method, remote user, remote host +and localname (file name on remote host). If NODEFAULT is +non-nil, the file name parts are not expanded to their default +values." (save-match-data (let ((match (string-match (nth 0 tramp-file-name-structure) name))) (unless match (error "Not a tramp file name: %s" name)) @@ -6593,11 +6663,13 @@ localname (file name on remote host)." (user (match-string (nth 2 tramp-file-name-structure) name)) (host (match-string (nth 3 tramp-file-name-structure) name)) (localname (match-string (nth 4 tramp-file-name-structure) name))) - (vector - (tramp-find-method method user host) - (tramp-find-user method user host) - (tramp-find-host method user host) - localname))))) + (if nodefault + (vector method user host localname) + (vector + (tramp-find-method method user host) + (tramp-find-user method user host) + (tramp-find-host method user host) + localname)))))) (defun tramp-equal-remote (file1 file2) "Checks, whether the remote parts of FILE1 and FILE2 are identical. @@ -6666,7 +6738,7 @@ necessary only. This function will be used in file name completion." (defun tramp-get-remote-path (vec) (with-connection-property vec "remote-path" - (let* ((remote-path (copy-tree tramp-remote-path)) + (let* ((remote-path (tramp-compat-copy-tree tramp-remote-path)) (elt (memq 'tramp-default-remote-path remote-path)) (default-remote-path (when elt @@ -6843,7 +6915,7 @@ necessary only. This function will be used in file name completion." (if (equal id-format 'integer) (user-uid) (user-login-name))) (defun tramp-get-local-gid (id-format) - (nth 3 (file-attributes "~/" id-format))) + (nth 3 (tramp-compat-file-attributes "~/" id-format))) ;; Some predefined connection properties. (defun tramp-get-remote-coding (vec prop) @@ -6951,25 +7023,6 @@ ALIST is of the form ((FROM . TO) ...)." ;; -- Compatibility functions section -- ;; ------------------------------------------------------------ -(defun tramp-temporary-file-directory () - "Return name of directory for temporary files (compat function). -For Emacs, this is the variable `temporary-file-directory', for XEmacs -this is the function `temp-directory'." - (cond ((boundp 'temporary-file-directory) - (symbol-value 'temporary-file-directory)) - ((fboundp 'temp-directory) - (funcall (symbol-function 'temp-directory))) ;pacify byte-compiler - ((let ((d (getenv "TEMP"))) (and d (file-directory-p d))) - (file-name-as-directory (getenv "TEMP"))) - ((let ((d (getenv "TMP"))) (and d (file-directory-p d))) - (file-name-as-directory (getenv "TMP"))) - ((let ((d (getenv "TMPDIR"))) (and d (file-directory-p d))) - (file-name-as-directory (getenv "TMPDIR"))) - ((file-exists-p "c:/temp") (file-name-as-directory "c:/temp")) - (t (message (concat "Neither `temporary-file-directory' nor " - "`temp-directory' is defined -- using /tmp.")) - (file-name-as-directory "/tmp")))) - (defun tramp-read-passwd (proc &optional prompt) "Read a password from user (compat function). Invokes `password-read' if available, `read-passwd' else." @@ -6982,8 +7035,9 @@ Invokes `password-read' if available, `read-passwd' else." (tramp-check-for-regexp proc tramp-password-prompt-regexp) (format "%s for %s " (capitalize (match-string 1)) key))))) (if (functionp 'password-read) - (let ((password (apply #'password-read (list pw-prompt key)))) - (apply #'password-cache-add (list key password)) + (let ((password (funcall (symbol-function 'password-read) + pw-prompt key))) + (funcall (symbol-function 'password-cache-add) key password) password) (read-passwd pw-prompt)))) @@ -6992,12 +7046,12 @@ Invokes `password-read' if available, `read-passwd' else." If METHOD, USER or HOST is given, take then for computing the key." (interactive) (when (functionp 'password-cache-remove) - (apply #'password-cache-remove - (list (tramp-make-tramp-file-name - tramp-current-method - tramp-current-user - tramp-current-host - ""))))) + (funcall (symbol-function 'password-cache-remove) + (tramp-make-tramp-file-name + tramp-current-method + tramp-current-user + tramp-current-host + "")))) ;; Snarfed code from time-date.el and parse-time.el @@ -7054,19 +7108,18 @@ T1 and T2 are time values (as returned by `current-time' for example)." "Return a coding system like CODING-SYSTEM but with given EOL-TYPE. EOL-TYPE can be one of `dos', `unix', or `mac'." (cond ((fboundp 'coding-system-change-eol-conversion) - (apply #'coding-system-change-eol-conversion - (list coding-system eol-type))) + (funcall (symbol-function 'coding-system-change-eol-conversion) + coding-system eol-type)) ((fboundp 'subsidiary-coding-system) - (apply - #'subsidiary-coding-system - (list coding-system - (cond ((eq eol-type 'dos) 'crlf) - ((eq eol-type 'unix) 'lf) - ((eq eol-type 'mac) 'cr) - (t - (error "Unknown EOL-TYPE `%s', must be %s" - eol-type - "`dos', `unix', or `mac'")))))) + (funcall (symbol-function 'subsidiary-coding-system) + coding-system + (cond ((eq eol-type 'dos) 'crlf) + ((eq eol-type 'unix) 'lf) + ((eq eol-type 'mac) 'cr) + (t + (error "Unknown EOL-TYPE `%s', must be %s" + eol-type + "`dos', `unix', or `mac'"))))) (t (error "Can't change EOL conversion -- is MULE missing?")))) (defun tramp-split-string (string pattern) @@ -7143,19 +7196,19 @@ Only works for Bourne-like shells." ;; CCC: This check is now also really awful; we should search all ;; of the filename format, not just the prefix. (when (string-match "\\[" tramp-prefix-format) - (defadvice file-expand-wildcards (around tramp-fix activate) + (defadvice file-expand-wildcards + (around tramp-advice-file-expand-wildcards activate) (let ((name (ad-get-arg 0))) (if (tramp-tramp-file-p name) ;; If it's a Tramp file, dissect it and look if wildcards ;; need to be expanded at all. - (let ((v (tramp-dissect-file-name name))) - (if (string-match "[[*?]" (tramp-file-name-localname v)) - (let ((res ad-do-it)) - (setq ad-return-value (or res (list name)))) - (setq ad-return-value (list name)))) + (if (string-match + "[[*?]" + (tramp-file-name-localname (tramp-dissect-file-name name))) + (setq ad-return-value (or ad-do-it (list name))) + (setq ad-return-value (list name))) ;; If it is not a Tramp file, just run the original function. - (let ((res ad-do-it)) - (setq ad-return-value (or res (list name))))))) + (setq ad-return-value (or ad-do-it (list name)))))) (add-hook 'tramp-unload-hook '(lambda () (ad-unadvise 'file-expand-wildcards)))) @@ -7250,7 +7303,7 @@ and what the local and remote machines are. If you can give a simple set of instructions to make this bug happen reliably, please include those. Thank you for helping -kill bugs in TRAMP. +kill bugs in Tramp. Another useful thing to do is to put @@ -7370,7 +7423,8 @@ Used for non-7bit chars in strings." (setq buffer-read-only nil) (goto-char (point-min)) (while (not (eobp)) - (if (re-search-forward tramp-buf-regexp (tramp-line-end-position) t) + (if (re-search-forward + tramp-buf-regexp (tramp-compat-line-end-position) t) (forward-line 1) (forward-line 0) (let ((start (point))) @@ -7443,18 +7497,6 @@ please ensure that the buffers are attached to your email.\n\n") (provide 'tramp) -;; Make sure that we get integration with the VC package. -;; When it is loaded, we need to pull in the integration module. -;; This must come after (provide 'tramp) because tramp-vc.el -;; requires tramp. Not necessary in Emacs 23. -(eval-after-load "vc" - '(unless (functionp 'start-file-process) - (require 'tramp-vc) - (add-hook 'tramp-unload-hook - '(lambda () - (when (featurep 'tramp-vc) - (unload-feature 'tramp-vc 'force)))))) - ;;; TODO: ;; * Allow putting passwords in the filename. @@ -7470,7 +7512,7 @@ please ensure that the buffers are attached to your email.\n\n") ;; indefinitely blocking piece of code. In this case it would be ;; within Tramp around one of its calls to accept-process-output (or ;; around one of the loops that calls accept-process-output) -;; (Stefann Monnier). +;; (Stefan Monnier). ;; * Autodetect if remote `ls' groks the "--dired" switch. ;; * Add fallback for inline encodings. This should be used ;; if the remote end doesn't support mimencode or a similar program. @@ -7528,14 +7570,8 @@ please ensure that the buffers are attached to your email.\n\n") ;; * When editing a remote CVS controlled file as a different user, VC ;; gets confused about the file locking status. Try to find out why ;; the workaround doesn't work. -;; * Change `copy-file' to grok the case where the filename handler -;; for the source and the target file are different. Right now, -;; it looks at the source file and then calls that handler, if -;; there is one. But since ange-ftp, for instance, does not know -;; about Tramp, it does not do the right thing if the target file -;; name is a Tramp name. ;; * Username and hostname completion. -;; ** Try to avoid usage of `last-input-event' in `tramp-completion-mode'. +;; ** Try to avoid usage of `last-input-event' in `tramp-completion-mode-p'. ;; ** Unify `tramp-parse-{rhosts,shosts,sconfig,hosts,passwd,netrc}'. ;; Code is nearly identical. ;; * Allow out-of-band methods as _last_ multi-hop. diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el index 6e48c3c7f47..c8da0add016 100644 --- a/lisp/net/trampver.el +++ b/lisp/net/trampver.el @@ -1,5 +1,5 @@ -;;; -*- mode: Emacs-Lisp; coding: utf-8; -*- ;;; trampver.el --- Transparent Remote Access, Multiple Protocol +;;; -*- mode: Emacs-Lisp; coding: utf-8; -*- ;;; lisp/trampver.el. Generated from trampver.el.in by configure. ;; Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. diff --git a/lisp/obsolete/hilit19.el b/lisp/obsolete/hilit19.el index c29d4fad3dd..9221753a864 100644 --- a/lisp/obsolete/hilit19.el +++ b/lisp/obsolete/hilit19.el @@ -665,9 +665,9 @@ The optional 5th arg, PROP is a property to set instead of 'hilit." (or quietly hilit-quietly (message "Unhighlighting")) (let ((lstart 0)) (while (and start (> start lstart) (< start end)) - (mapcar (function (lambda (ovr) - (and (overlay-get ovr 'hilit) (delete-overlay ovr)))) - (overlays-at start)) + (mapc (function (lambda (ovr) + (and (overlay-get ovr 'hilit) (delete-overlay ovr)))) + (overlays-at start)) (setq lstart start start (next-overlay-change start)))) (or quietly hilit-quietly (message "Done unhighlighting"))) @@ -1023,11 +1023,11 @@ See the variable hilit-mode-enable-list. Takes optional arguments PARSE-FN and CASE-FOLD." ;; change pattern - (mapcar (function (lambda (p) - (and (stringp (car p)) - (null (nth 1 p)) - (setcar (cdr p) 0)))) - patterns) + (mapc (function (lambda (p) + (and (stringp (car p)) + (null (nth 1 p)) + (setcar (cdr p) 0)))) + patterns) (setq patterns (cons case-fold patterns)) (or (consp modelist) (setq modelist (list modelist))) diff --git a/lisp/obsolete/sun-fns.el b/lisp/obsolete/sun-fns.el index 2f95d5011c1..1b6a5d239bd 100644 --- a/lisp/obsolete/sun-fns.el +++ b/lisp/obsolete/sun-fns.el @@ -385,7 +385,6 @@ relative X divided by window width." ) (defmenu emacs-quit-menu - ("Suspend" suspend-emacstool) ("Quit" save-buffers-kill-emacs)) (defmenu emacs-menu diff --git a/lisp/play/bubbles.el b/lisp/play/bubbles.el index 133c6efc0d2..5f8709d17b7 100644 --- a/lisp/play/bubbles.el +++ b/lisp/play/bubbles.el @@ -43,6 +43,9 @@ ;;; History: +;; 0.5 (2007-09-14) +;; - Minor bugfixes. + ;; 0.4 (2007-08-27) ;; - Allow for undoing last move. ;; - Bonus for removing all bubbles. @@ -78,7 +81,7 @@ ;;; Code: -(defconst bubbles-version "0.4" "Version number of bubbles.el.") +(defconst bubbles-version "0.5" "Version number of bubbles.el.") (require 'gamegrid) (require 'cl) @@ -824,89 +827,98 @@ static char * dot3d_xpm[] = { (bubbles--initialize-images) (bubbles--update-faces-or-images)) -;; bubbles mode map -(defvar bubbles-mode-map - (make-keymap 'bubbles-mode-map)) -(define-key bubbles-mode-map "q" 'bubbles-quit) -(define-key bubbles-mode-map "\n" 'bubbles-plop) -(define-key bubbles-mode-map " " 'bubbles-plop) -(define-key bubbles-mode-map [double-down-mouse-1] 'bubbles-plop) -(define-key bubbles-mode-map [mouse-2] 'bubbles-plop) -(define-key bubbles-mode-map "\C-m" 'bubbles-plop) -(define-key bubbles-mode-map "u" 'bubbles-undo) -(define-key bubbles-mode-map "p" 'previous-line) -(define-key bubbles-mode-map "n" 'next-line) -(define-key bubbles-mode-map "f" 'forward-char) -(define-key bubbles-mode-map "b" 'backward-char) - - ;; game theme menu -(defvar bubbles-game-theme-menu (make-sparse-keymap "Game Theme")) -(define-key bubbles-game-theme-menu [bubbles-set-game-userdefined] - (list 'menu-item "User defined" 'bubbles-set-game-userdefined - :button '(:radio . (eq bubbles-game-theme 'user-defined)))) -(define-key bubbles-game-theme-menu [bubbles-set-game-hard] - (list 'menu-item "Hard" 'bubbles-set-game-hard - :button '(:radio . (eq bubbles-game-theme 'hard)))) -(define-key bubbles-game-theme-menu [bubbles-set-game-difficult] - (list 'menu-item "Difficult" 'bubbles-set-game-difficult - :button '(:radio . (eq bubbles-game-theme 'difficult)))) -(define-key bubbles-game-theme-menu [bubbles-set-game-medium] - (list 'menu-item "Medium" 'bubbles-set-game-medium - :button '(:radio . (eq bubbles-game-theme 'medium)))) -(define-key bubbles-game-theme-menu [bubbles-set-game-easy] - (list 'menu-item "Easy" 'bubbles-set-game-easy - :button '(:radio . (eq bubbles-game-theme 'easy)))) +(defvar bubbles-game-theme-menu + (let ((menu (make-sparse-keymap "Game Theme"))) + (define-key menu [bubbles-set-game-userdefined] + (list 'menu-item "User defined" 'bubbles-set-game-userdefined + :button '(:radio . (eq bubbles-game-theme 'user-defined)))) + (define-key menu [bubbles-set-game-hard] + (list 'menu-item "Hard" 'bubbles-set-game-hard + :button '(:radio . (eq bubbles-game-theme 'hard)))) + (define-key menu [bubbles-set-game-difficult] + (list 'menu-item "Difficult" 'bubbles-set-game-difficult + :button '(:radio . (eq bubbles-game-theme 'difficult)))) + (define-key menu [bubbles-set-game-medium] + (list 'menu-item "Medium" 'bubbles-set-game-medium + :button '(:radio . (eq bubbles-game-theme 'medium)))) + (define-key menu [bubbles-set-game-easy] + (list 'menu-item "Easy" 'bubbles-set-game-easy + :button '(:radio . (eq bubbles-game-theme 'easy)))) + menu) + "Map for bubbles game theme menu.") ;; graphics theme menu -(defvar bubbles-graphics-theme-menu (make-sparse-keymap "Graphics Theme")) -(define-key bubbles-graphics-theme-menu [bubbles-set-graphics-theme-ascii] - (list 'menu-item "ASCII" 'bubbles-set-graphics-theme-ascii - :button '(:radio . (eq bubbles-graphics-theme 'ascii)))) -(define-key bubbles-graphics-theme-menu [bubbles-set-graphics-theme-emacs] - (list 'menu-item "Emacs" 'bubbles-set-graphics-theme-emacs - :button '(:radio . (eq bubbles-graphics-theme 'emacs)))) -(define-key bubbles-graphics-theme-menu [bubbles-set-graphics-theme-balls] - (list 'menu-item "Balls" 'bubbles-set-graphics-theme-balls - :button '(:radio . (eq bubbles-graphics-theme 'balls)))) -(define-key bubbles-graphics-theme-menu [bubbles-set-graphics-theme-diamonds] - (list 'menu-item "Diamonds" 'bubbles-set-graphics-theme-diamonds - :button '(:radio . (eq bubbles-graphics-theme 'diamonds)))) -(define-key bubbles-graphics-theme-menu [bubbles-set-graphics-theme-squares] - (list 'menu-item "Squares" 'bubbles-set-graphics-theme-squares - :button '(:radio . (eq bubbles-graphics-theme 'squares)))) -(define-key bubbles-graphics-theme-menu [bubbles-set-graphics-theme-circles] - (list 'menu-item "Circles" 'bubbles-set-graphics-theme-circles - :button '(:radio . (eq bubbles-graphics-theme 'circles)))) +(defvar bubbles-graphics-theme-menu + (let ((menu (make-sparse-keymap "Graphics Theme"))) + (define-key menu [bubbles-set-graphics-theme-ascii] + (list 'menu-item "ASCII" 'bubbles-set-graphics-theme-ascii + :button '(:radio . (eq bubbles-graphics-theme 'ascii)))) + (define-key menu [bubbles-set-graphics-theme-emacs] + (list 'menu-item "Emacs" 'bubbles-set-graphics-theme-emacs + :button '(:radio . (eq bubbles-graphics-theme 'emacs)))) + (define-key menu [bubbles-set-graphics-theme-balls] + (list 'menu-item "Balls" 'bubbles-set-graphics-theme-balls + :button '(:radio . (eq bubbles-graphics-theme 'balls)))) + (define-key menu [bubbles-set-graphics-theme-diamonds] + (list 'menu-item "Diamonds" 'bubbles-set-graphics-theme-diamonds + :button '(:radio . (eq bubbles-graphics-theme 'diamonds)))) + (define-key menu [bubbles-set-graphics-theme-squares] + (list 'menu-item "Squares" 'bubbles-set-graphics-theme-squares + :button '(:radio . (eq bubbles-graphics-theme 'squares)))) + (define-key menu [bubbles-set-graphics-theme-circles] + (list 'menu-item "Circles" 'bubbles-set-graphics-theme-circles + :button '(:radio . (eq bubbles-graphics-theme 'circles)))) + menu) + "Map for bubbles graphics theme menu.") ;; menu -(defvar bubbles-menu (make-sparse-keymap "Bubbles")) -(define-key bubbles-menu [bubbles-quit] - (list 'menu-item "Quit" 'bubbles-quit)) -(define-key bubbles-menu [bubbles] - (list 'menu-item "New game" 'bubbles)) -(define-key bubbles-menu [bubbles-separator-1] - '("--")) -(define-key bubbles-menu [bubbles-save-settings] - (list 'menu-item "Save all settings" 'bubbles-save-settings)) -(define-key bubbles-menu [bubbles-customize] - (list 'menu-item "Edit all settings" 'bubbles-customize)) -(define-key bubbles-menu [bubbles-game-theme-menu] - (list 'menu-item "Game Theme" bubbles-game-theme-menu)) -(define-key bubbles-menu [bubbles-graphics-theme-menu] - (list 'menu-item "Graphics Theme" bubbles-graphics-theme-menu - :enable 'bubbles--playing)) -(define-key bubbles-menu [bubbles-separator-2] - '("--")) -(define-key bubbles-menu [bubbles-undo] - (list 'menu-item "Undo last move" 'bubbles-undo - :enable '(and bubbles--playing bubbles--save-data))) - -;; bind menu to mouse -(define-key bubbles-mode-map [down-mouse-3] bubbles-menu) -;; Put menu in menu-bar -(define-key bubbles-mode-map [menu-bar Bubbles] - (cons "Bubbles" bubbles-menu)) +(defvar bubbles-menu + (let ((menu (make-sparse-keymap "Bubbles"))) + (define-key menu [bubbles-quit] + (list 'menu-item "Quit" 'bubbles-quit)) + (define-key menu [bubbles] + (list 'menu-item "New game" 'bubbles)) + (define-key menu [bubbles-separator-1] + '("--")) + (define-key menu [bubbles-save-settings] + (list 'menu-item "Save all settings" 'bubbles-save-settings)) + (define-key menu [bubbles-customize] + (list 'menu-item "Edit all settings" 'bubbles-customize)) + (define-key menu [bubbles-game-theme-menu] + (list 'menu-item "Game Theme" bubbles-game-theme-menu)) + (define-key menu [bubbles-graphics-theme-menu] + (list 'menu-item "Graphics Theme" bubbles-graphics-theme-menu + :enable 'bubbles--playing)) + (define-key menu [bubbles-separator-2] + '("--")) + (define-key menu [bubbles-undo] + (list 'menu-item "Undo last move" 'bubbles-undo + :enable '(and bubbles--playing (listp buffer-undo-list)))) + menu) + "Map for bubbles menu.") + +;; bubbles mode map +(defvar bubbles-mode-map + (let ((map (make-sparse-keymap 'bubbles-mode-map))) +;; (suppress-keymap map t) + (define-key map "q" 'bubbles-quit) + (define-key map "\n" 'bubbles-plop) + (define-key map " " 'bubbles-plop) + (define-key map [double-down-mouse-1] 'bubbles-plop) + (define-key map [mouse-2] 'bubbles-plop) + (define-key map "\C-m" 'bubbles-plop) + (define-key map "u" 'bubbles-undo) + (define-key map "p" 'previous-line) + (define-key map "n" 'next-line) + (define-key map "f" 'forward-char) + (define-key map "b" 'backward-char) + ;; bind menu to mouse + (define-key map [down-mouse-3] bubbles-menu) + ;; Put menu in menu-bar + (define-key map [menu-bar Bubbles] (cons "Bubbles" bubbles-menu)) + map) + "Mode map for bubbles.") (defun bubbles-mode () "Major mode for playing bubbles. @@ -916,7 +928,10 @@ static char * dot3d_xpm[] = { (setq major-mode 'bubbles-mode) (setq mode-name "Bubbles") (setq buffer-read-only t) - (buffer-enable-undo) + (buffer-disable-undo) + (setq buffer-undo-list t) + (force-mode-line-update) + (redisplay) (add-hook 'post-command-hook 'bubbles--mark-neighbourhood t t) (run-hooks 'bubbles-mode-hook)) @@ -1014,7 +1029,10 @@ Set `bubbles--col-offset' and `bubbles--row-offset'." (bubbles-mode) (bubbles--reset-score) (bubbles--update-faces-or-images) - (bubbles--goto 0 0)) + (bubbles--goto 0 0) + (setq buffer-undo-list t) + (force-mode-line-update) + (redisplay)) (defun bubbles--initialize-faces () "Prepare faces for playing `bubbles'." @@ -1196,7 +1214,6 @@ Use optional parameter POS instead of point if given." (when (and bubbles--playing (> bubbles--neighbourhood-score 0)) (setq bubbles--save-data (list bubbles--score (buffer-string))) - (setq buffer-undo-list '(apply bubbles-undo . nil)) (let ((inhibit-read-only t)) ;; blank out current neighbourhood (let ((row (bubbles--row (point))) @@ -1245,7 +1262,8 @@ Use optional parameter POS instead of point if given." (dotimes (j (bubbles--grid-width)) (bubbles--goto i j) (while (get-text-property (point) 'removed) - (setq shifted (or (bubbles--shift 'right i j) shifted)))))) + (setq shifted (or (bubbles--shift 'right i j) + shifted)))))) (bubbles--update-faces-or-images) (sleep-for 0.5)) (t ;; default shift-mode @@ -1259,7 +1277,8 @@ Use optional parameter POS instead of point if given." (dotimes (k shifted-cols) (let ((i (- (bubbles--grid-height) 2))) (while (>= i 0) - (setq shifted (or (bubbles--shift 'right i j) shifted)) + (setq shifted (or (bubbles--shift 'right i j) + shifted)) (setq i (1- i)))))))))) (when shifted ;;(sleep-for 0.5) @@ -1267,7 +1286,11 @@ Use optional parameter POS instead of point if given." (sit-for 0))) (put-text-property (point-min) (point-max) 'removed nil) (unless (bubbles--neighbourhood-available) - (bubbles--game-over))))) + (bubbles--game-over))) + ;; undo + (setq buffer-undo-list '((apply bubbles-undo . nil))) + (force-mode-line-update) + (redisplay))) (defun bubbles-undo () "Undo last move." @@ -1279,7 +1302,10 @@ Use optional parameter POS instead of point if given." (insert (cadr bubbles--save-data)) (bubbles--update-faces-or-images) (setq bubbles--score (car bubbles--save-data)) - (goto-char pos)))) + (goto-char pos)) + (setq buffer-undo-list t) + (force-mode-line-update) + (redisplay))) (defun bubbles--shift (from row col) "Move bubbles FROM one side to position ROW COL. @@ -1323,7 +1349,7 @@ Return t if new char is non-empty." (setq bubbles--empty-image (create-image (replace-regexp-in-string "^\"\\(.*\\)\t.*c .*\",$" - "\"\\1\tc #FFFFFF\"," template) + "\"\\1\tc None\"," template) 'xpm t ;;:mask 'heuristic :margin '(2 . 1))) @@ -1408,7 +1434,7 @@ Return t if new char is non-empty." (dotimes (i (bubbles--grid-height)) (dotimes (j (bubbles--grid-width)) (forward-char 1) - (let ((index (get-text-property (point) 'index))) + (let ((index (or (get-text-property (point) 'index) -1))) (let ((img bubbles--empty-image)) (if (>= index 0) (setq img (nth index bubbles--images))) diff --git a/lisp/play/gamegrid.el b/lisp/play/gamegrid.el index b041bbd2522..b5dde4323d0 100644 --- a/lisp/play/gamegrid.el +++ b/lisp/play/gamegrid.el @@ -326,8 +326,8 @@ static unsigned char gamegrid_bits[] = { (setq point-size (/ (* (float default-font-height) max-height) 10) pixel-size (floor (* resy (/ point-size 72.27))) point-size (* (/ pixel-size resy) 72.27)) - (set-face-attribute gamegrid-face nil - :height (floor (* point-size 10)))))))) + (face-spec-set gamegrid-face + `((t :height ,(floor (* point-size 10)))))))))) (defun gamegrid-initialize-display () (setq gamegrid-display-mode (gamegrid-display-type)) diff --git a/lisp/play/solitaire.el b/lisp/play/solitaire.el index b027db88ad6..e5dde1fe79c 100644 --- a/lisp/play/solitaire.el +++ b/lisp/play/solitaire.el @@ -400,7 +400,7 @@ which a stone will be taken away) and target." (<= (current-column) solitaire-end-x) (>= (solitaire-current-line) solitaire-start-y) (<= (solitaire-current-line) solitaire-end-y) - (mapcar + (mapc (lambda (movesymbol) (if (listp (solitaire-possible-move movesymbol)) (setq count (1+ count)))) @@ -446,13 +446,13 @@ Seen in info on text lines." ;; right S-left (solitaire-auto-eval nil)) (solitaire-center-point) - (mapcar (lambda (op) - (if (memq op '(S-left S-right S-up S-down)) - (sit-for 0.2)) - (execute-kbd-macro (vector op)) - (if (memq op '(S-left S-right S-up S-down)) - (sit-for 0.4))) - allmoves)) + (mapc (lambda (op) + (if (memq op '(S-left S-right S-up S-down)) + (sit-for 0.2)) + (execute-kbd-macro (vector op)) + (if (memq op '(S-left S-right S-up S-down)) + (sit-for 0.4))) + allmoves)) (solitaire-do-check)) (provide 'solitaire) diff --git a/lisp/play/zone.el b/lisp/play/zone.el index f1bbfb19938..896c1d4ac0a 100644 --- a/lisp/play/zone.el +++ b/lisp/play/zone.el @@ -86,30 +86,10 @@ If nil, don't interrupt for about 1^26 seconds.") ,@body)) (defmacro zone-hiding-modeline (&rest body) - `(let (bg mode-line-fg mode-line-bg mode-line-box) - (unwind-protect - (progn - (when (and (= 0 (get 'zone 'modeline-hidden-level)) - (display-color-p)) - (setq bg (face-background 'default) - mode-line-box (face-attribute 'mode-line :box) - mode-line-fg (face-attribute 'mode-line :foreground) - mode-line-bg (face-attribute 'mode-line :background)) - (set-face-attribute 'mode-line nil - :foreground bg - :background bg - :box nil)) - (put 'zone 'modeline-hidden-level - (1+ (get 'zone 'modeline-hidden-level))) - ,@body) - (put 'zone 'modeline-hidden-level - (1- (get 'zone 'modeline-hidden-level))) - (when (and (> 1 (get 'zone 'modeline-hidden-level)) - mode-line-fg) - (set-face-attribute 'mode-line nil - :foreground mode-line-fg - :background mode-line-bg - :box mode-line-box))))) + ;; This formerly worked by temporarily altering face `mode-line', + ;; which did not even work right, it seems. + `(let (mode-line-format) + ,@body)) (defun zone-call (program &optional timeout) "Call PROGRAM in a zoned way. @@ -158,6 +138,7 @@ If the element is a function or a list of a function and a number, (sit-for 0 500) (let ((pgm (elt zone-programs (random (length zone-programs)))) (ct (and f (frame-parameter f 'cursor-type))) + (show-trailing-whitespace nil) (restore (list '(kill-buffer outbuf)))) (when ct (modify-frame-parameters f '((cursor-type . (bar . 0)))) @@ -399,20 +380,20 @@ If the element is a function or a list of a function and a number, (let* ((specs (apply 'vector (let (res) - (mapcar (lambda (ent) - (let* ((beg (car ent)) - (end (cdr ent)) - (amt (if random-style - (funcall random-style) - (- (random 7) 3)))) - (when (< (- end (abs amt)) beg) - (setq amt (random (- end beg)))) - (unless (= 0 amt) - (setq res - (cons - (vector amt beg (- end (abs amt))) - res))))) - (zone-line-specs)) + (mapc (lambda (ent) + (let* ((beg (car ent)) + (end (cdr ent)) + (amt (if random-style + (funcall random-style) + (- (random 7) 3)))) + (when (< (- end (abs amt)) beg) + (setq amt (random (- end beg)))) + (unless (= 0 amt) + (setq res + (cons + (vector amt beg (- end (abs amt))) + res))))) + (zone-line-specs)) res))) (n (length specs)) amt aamt cut paste txt i ent) @@ -704,6 +685,7 @@ If nil, `zone-pgm-random-life' chooses a value from 0-3 (inclusive).") (life (or zone-pgm-random-life-wait (random 4))) (kill-buffer nil)))) + (random t) ;;;;;;;;;;;;;;; diff --git a/lisp/progmodes/ada-mode.el b/lisp/progmodes/ada-mode.el index 478a07bc3b6..07d38dbdaa2 100644 --- a/lisp/progmodes/ada-mode.el +++ b/lisp/progmodes/ada-mode.el @@ -1145,7 +1145,7 @@ If you use ada-xref.el: (interactive) (kill-all-local-variables) - + (set-syntax-table ada-mode-syntax-table) (set (make-local-variable 'require-final-newline) mode-require-final-newline) @@ -1423,12 +1423,12 @@ If you use ada-xref.el: Casing exception lists are `ada-case-exception' and `ada-case-exception-substring'." (find-file (expand-file-name file-name)) (erase-buffer) - (mapcar (lambda (x) (insert (car x) "\n")) - (sort (copy-sequence ada-case-exception) - (lambda(a b) (string< (car a) (car b))))) - (mapcar (lambda (x) (insert "*" (car x) "\n")) - (sort (copy-sequence ada-case-exception-substring) - (lambda(a b) (string< (car a) (car b))))) + (mapc (lambda (x) (insert (car x) "\n")) + (sort (copy-sequence ada-case-exception) + (lambda(a b) (string< (car a) (car b))))) + (mapc (lambda (x) (insert "*" (car x) "\n")) + (sort (copy-sequence ada-case-exception-substring) + (lambda(a b) (string< (car a) (car b))))) (save-buffer) (kill-buffer nil) ) @@ -4583,7 +4583,7 @@ Moves to 'begin' if in a declarative part." ;; The following keys are bound to functions defined in ada-xref.el or ;; ada-prj,el., However, RMS rightly thinks that the code should be shared, ;; and activated only if the right compiler is used - + (define-key ada-mode-map (if (featurep 'xemacs) '(shift button3) [S-mouse-3]) 'ada-point-and-xref) (define-key ada-mode-map [(control tab)] 'ada-complete-identifier) diff --git a/lisp/progmodes/ada-prj.el b/lisp/progmodes/ada-prj.el index 7cff0158f8a..b3f059b2b34 100644 --- a/lisp/progmodes/ada-prj.el +++ b/lisp/progmodes/ada-prj.el @@ -254,8 +254,8 @@ The current buffer must be the project editing buffer." (progn (setq widget-field-new nil widget-field-list nil) - (mapcar (lambda (x) (delete-overlay x)) (car (overlay-lists))) - (mapcar (lambda (x) (delete-overlay x)) (cdr (overlay-lists))))) + (mapc (lambda (x) (delete-overlay x)) (car (overlay-lists))) + (mapc (lambda (x) (delete-overlay x)) (cdr (overlay-lists))))) ;; Display the tabs diff --git a/lisp/progmodes/autoconf.el b/lisp/progmodes/autoconf.el index e01579917f6..d47a1c4d2cc 100644 --- a/lisp/progmodes/autoconf.el +++ b/lisp/progmodes/autoconf.el @@ -49,7 +49,7 @@ '(("\\<dnl\\>" 0 '(11)))) (defconst autoconf-definition-regexp - "AC_\\(SUBST\\|DEFINE\\(_UNQUOTED\\)?\\)(\\(\\sw+\\)") + "AC_\\(SUBST\\|DEFINE\\(_UNQUOTED\\)?\\)(\\[*\\(\\sw+\\)\\]*") (defvar autoconf-font-lock-keywords `(("\\_<A[CHMS]_\\sw+" . font-lock-keyword-face) diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el index 48fa7d99f5a..860893bcfa6 100644 --- a/lisp/progmodes/cc-cmds.el +++ b/lisp/progmodes/cc-cmds.el @@ -3074,7 +3074,8 @@ non-nil." indent the current line syntactically." ;; Emacs has a variable called mark-active, XEmacs uses region-active-p (interactive) - (if (c-region-is-active-p) + (if (and transient-mark-mode mark-active + (not (eq (region-beginning) (region-end)))) (c-indent-region (region-beginning) (region-end)) (c-indent-line))) diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index d0ff9c523ad..a4dfe41ca78 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el @@ -1970,6 +1970,7 @@ identifiers that follows the type in a normal declaration." "Statement keywords followed directly by a substatement." t '("do" "else") c++ '("do" "else" "try") + objc '("do" "else" "@finally" "@try") java '("do" "else" "finally" "try") idl nil) @@ -1983,6 +1984,7 @@ identifiers that follows the type in a normal declaration." "Statement keywords followed by a paren sexp and then by a substatement." t '("for" "if" "switch" "while") c++ '("for" "if" "switch" "while" "catch") + objc '("for" "if" "switch" "while" "@catch" "@synchronized") java '("for" "if" "switch" "while" "catch" "synchronized") idl nil pike '("for" "if" "switch" "while" "foreach") @@ -2014,6 +2016,7 @@ identifiers that follows the type in a normal declaration." (c-lang-defconst c-simple-stmt-kwds "Statement keywords followed by an expression or nothing." t '("break" "continue" "goto" "return") + objc '("break" "continue" "goto" "return" "@throw") ;; Note: `goto' is not valid in Java, but the keyword is still reserved. java '("break" "continue" "goto" "return" "throw") idl nil diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index 8669a41c2f0..f234404e81d 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el @@ -269,7 +269,9 @@ control). See \"cc-mode.el\" for more info." 'c-indent-new-comment-line c-mode-base-map global-map) (substitute-key-definition 'indent-for-tab-command - 'c-indent-command + ;; XXX Is this the right thing to do + ;; here? + 'c-indent-line-or-region c-mode-base-map global-map) (when (fboundp 'comment-indent-new-line) ;; indent-new-comment-line has changed name to diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 9b83cfc9f3d..9ed7ba09de9 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -240,7 +240,7 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1)) \\([0-9]+\\)\\(?:\\([.:]\\)\\([0-9]+\\)\\)?\ \\(?:-\\([0-9]+\\)?\\(?:\\3\\([0-9]+\\)\\)?\\)?:\ \\(?: *\\(\\(?:Future\\|Runtime\\)?[Ww]arning\\|W:\\)\\|\ - *\\([Ii]nfo\\(?:\\>\\|rmationa?l?\\)\\|I:\\|instantiated from\\)\\|\ + *\\([Ii]nfo\\(?:\\>\\|rmationa?l?\\)\\|I:\\|instantiated from\\|[Nn]ote\\)\\|\ \[0-9]?\\(?:[^0-9\n]\\|$\\)\\|[0-9][0-9][0-9]\\)" 1 (2 . 5) (4 . 6) (7 . 8)) @@ -1932,8 +1932,7 @@ FILE should be (FILENAME) or (RELATIVE-FILENAME . DIRNAME). In the former case, FILENAME may be relative or absolute. The file-structure looks like this: - (list (list FILENAME [DIR-FROM-PREV-MSG]) FMT LINE-STRUCT...) -" + (list (list FILENAME [DIR-FROM-PREV-MSG]) FMT LINE-STRUCT...)" (or (gethash file compilation-locs) ;; File was not previously encountered, at least not in the form passed. ;; Let's normalize it and look again. @@ -1977,9 +1976,7 @@ The file-structure looks like this: ;; directories have the same name: ;; http://lists.gnu.org/archive/html/emacs-devel/2007-08/msg00463.html (or (gethash (cons filename spec-directory) compilation-locs) - ;; TODO should this, without spec-directory, be - ;; done at all? - (puthash (list filename) + (puthash (cons filename spec-directory) (list (list filename spec-directory) fmt) compilation-locs)) compilation-locs)))) diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index cdfb8870138..4de1a845ab4 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -2635,7 +2635,8 @@ Return the amount the indentation changed by." (t (skip-chars-forward " \t") (if (listp indent) (setq indent (car indent))) - (cond ((looking-at "[A-Za-z_][A-Za-z_0-9]*:[^:]") + (cond ((and (looking-at "[A-Za-z_][A-Za-z_0-9]*:[^:]") + (not (looking-at "[smy]:\\|tr:"))) (and (> indent 0) (setq indent (max cperl-min-label-indent (+ indent cperl-label-offset))))) @@ -2810,9 +2811,9 @@ Will not look before LIM." (vector 'indentable 'first-line p)))) ((get-text-property char-after-pos 'REx-part2) (vector 'REx-part2 (point))) - ((nth 3 state) - [comment]) ((nth 4 state) + [comment]) + ((nth 3 state) [string]) ;; XXXX Do we need to special-case this? ((null containing-sexp) @@ -2918,7 +2919,9 @@ Will not look before LIM." (let ((colon-line-end 0)) (while (progn (skip-chars-forward " \t\n") - (looking-at "#\\|[a-zA-Z0-9_$]*:[^:]\\|=[a-zA-Z]")) + ;; s: foo : bar :x is NOT label + (and (looking-at "#\\|\\([a-zA-Z0-9_$]+\\):[^:]\\|=[a-zA-Z]") + (not (looking-at "[sym]:\\|tr:")))) ;; Skip over comments and labels following openbrace. (cond ((= (following-char) ?\#) (forward-line 1)) @@ -2989,8 +2992,7 @@ Will not look before LIM." (vector 'code-start-in-block containing-sexp char-after (and delim (not is-block)) ; is a HASH old-indent ; brace first thing on a line - nil (point) ; nothing interesting before - )))))))))))))) + nil (point))))))))))))))) ; nothing interesting before (defvar cperl-indent-rules-alist '((pod nil) ; via `syntax-type' property @@ -3004,9 +3006,7 @@ Will not look before LIM." "Alist of indentation rules for CPerl mode. The values mean: nil: do not indent; - number: add this amount of indentation. - -Not finished.") + number: add this amount of indentation.") (defun cperl-calculate-indent (&optional parse-data) ; was parse-start "Return appropriate indentation for current line as Perl code. @@ -3131,8 +3131,8 @@ and closing parentheses and brackets." ;; ((eq 'have-prev-sibling (elt i 0)) ;; [have-prev-sibling sibling-beg colon-line-end block-start] - (goto-char (elt i 1)) - (if (> (elt i 2) (point)) ; colon-line-end; After-label, same line + (goto-char (elt i 1)) ; sibling-beg + (if (> (elt i 2) (point)) ; colon-line-end; have label before point (if (> (current-indentation) cperl-min-label-indent) (- (current-indentation) cperl-label-offset) @@ -3184,170 +3184,6 @@ and closing parentheses and brackets." (t (error "Got strange value of indent: %s" i)))))) -(defvar cperl-indent-alist - '((string nil) - (comment nil) - (toplevel 0) - (toplevel-after-parenth 2) - (toplevel-continued 2) - (expression 1)) - "Alist of indentation rules for CPerl mode. -The values mean: - nil: do not indent; - number: add this amount of indentation. - -Not finished, not used.") - -(defun cperl-where-am-i (&optional parse-start start-state) - ;; Unfinished - "Return a list of lists ((TYPE POS)...) of good points before the point. -POS may be nil if it is hard to find, say, when TYPE is `string' or `comment'. - -Not finished, not used." - (save-excursion - (let* ((start-point (point)) unused - (s-s (cperl-get-state)) - (start (nth 0 s-s)) - (state (nth 1 s-s)) - (prestart (nth 3 s-s)) - (containing-sexp (car (cdr state))) - (case-fold-search nil) - (res (list (list 'parse-start start) (list 'parse-prestart prestart)))) - (cond ((nth 3 state) ; In string - (setq res (cons (list 'string nil (nth 3 state)) res))) ; What started string - ((nth 4 state) ; In comment - (setq res (cons '(comment) res))) - ((null containing-sexp) - ;; Line is at top level. - ;; Indent like the previous top level line - ;; unless that ends in a closeparen without semicolon, - ;; in which case this line is the first argument decl. - (cperl-backward-to-noncomment (or parse-start (point-min))) - ;;(skip-chars-backward " \t\f\n") - (cond - ((or (bobp) - (memq (preceding-char) (append ";}" nil))) - (setq res (cons (list 'toplevel start) res))) - ((eq (preceding-char) ?\) ) - (setq res (cons (list 'toplevel-after-parenth start) res))) - (t - (setq res (cons (list 'toplevel-continued start) res))))) - ((/= (char-after containing-sexp) ?{) - ;; line is expression, not statement: - ;; indent to just after the surrounding open. - ;; skip blanks if we do not close the expression. - (setq res (cons (list 'expression-blanks - (progn - (goto-char (1+ containing-sexp)) - (or (looking-at "[ \t]*\\(#\\|$\\)") - (skip-chars-forward " \t")) - (point))) - (cons (list 'expression containing-sexp) res)))) - ((progn - ;; Containing-expr starts with \{. Check whether it is a hash. - (goto-char containing-sexp) - (not (cperl-block-p))) - (setq res (cons (list 'expression-blanks - (progn - (goto-char (1+ containing-sexp)) - (or (looking-at "[ \t]*\\(#\\|$\\)") - (skip-chars-forward " \t")) - (point))) - (cons (list 'expression containing-sexp) res)))) - (t - ;; Statement level. - (setq res (cons (list 'in-block containing-sexp) res)) - ;; Is it a continuation or a new statement? - ;; Find previous non-comment character. - (cperl-backward-to-noncomment containing-sexp) - ;; Back up over label lines, since they don't - ;; affect whether our line is a continuation. - ;; Back up comma-delimited lines too ????? - (while (or (eq (preceding-char) ?\,) - (save-excursion (cperl-after-label))) - (if (eq (preceding-char) ?\,) - ;; Will go to beginning of line, essentially - ;; Will ignore embedded sexpr XXXX. - (cperl-backward-to-start-of-continued-exp containing-sexp)) - (beginning-of-line) - (cperl-backward-to-noncomment containing-sexp)) - ;; Now we get the answer. - (if (not (memq (preceding-char) (append ";}{" '(nil)))) ; Was ?\, - ;; This line is continuation of preceding line's statement. - (list (list 'statement-continued containing-sexp)) - ;; This line starts a new statement. - ;; Position following last unclosed open. - (goto-char containing-sexp) - ;; Is line first statement after an open-brace? - (or - ;; If no, find that first statement and indent like - ;; it. If the first statement begins with label, do - ;; not believe when the indentation of the label is too - ;; small. - (save-excursion - (forward-char 1) - (let ((colon-line-end 0)) - (while (progn (skip-chars-forward " \t\n" start-point) - (and (< (point) start-point) - (looking-at - "#\\|[a-zA-Z_][a-zA-Z0-9_]*:[^:]"))) - ;; Skip over comments and labels following openbrace. - (cond ((= (following-char) ?\#) - ;;(forward-line 1) - (end-of-line)) - ;; label: - (t - (save-excursion (end-of-line) - (setq colon-line-end (point))) - (search-forward ":")))) - ;; Now at the point, after label, or at start - ;; of first statement in the block. - (and (< (point) start-point) - (if (> colon-line-end (point)) - ;; Before statement after label - (if (> (current-indentation) - cperl-min-label-indent) - (list (list 'label-in-block (point))) - ;; Do not believe: `max' is involved - (list - (list 'label-in-block-min-indent (point)))) - ;; Before statement - (list 'statement-in-block (point)))))) - ;; If no previous statement, - ;; indent it relative to line brace is on. - ;; For open brace in column zero, don't let statement - ;; start there too. If cperl-indent-level is zero, - ;; use cperl-brace-offset + cperl-continued-statement-offset instead. - ;; For open-braces not the first thing in a line, - ;; add in cperl-brace-imaginary-offset. - - ;; If first thing on a line: ????? - (setq unused ; This is not finished... - (+ (if (and (bolp) (zerop cperl-indent-level)) - (+ cperl-brace-offset cperl-continued-statement-offset) - cperl-indent-level) - ;; Move back over whitespace before the openbrace. - ;; If openbrace is not first nonwhite thing on the line, - ;; add the cperl-brace-imaginary-offset. - (progn (skip-chars-backward " \t") - (if (bolp) 0 cperl-brace-imaginary-offset)) - ;; If the openbrace is preceded by a parenthesized exp, - ;; move to the beginning of that; - ;; possibly a different line - (progn - (if (eq (preceding-char) ?\)) - (forward-sexp -1)) - ;; Get initial indentation of the line we are on. - ;; If line starts with label, calculate label indentation - (if (save-excursion - (beginning-of-line) - (looking-at "[ \t]*[a-zA-Z_][a-zA-Z_0-9]*:[^:]")) - (if (> (current-indentation) cperl-min-label-indent) - (- (current-indentation) cperl-label-offset) - (cperl-calculate-indent)) - (current-indentation))))))))) - res))) - (defun cperl-calculate-indent-within-comment () "Return the indentation amount for line, assuming that the current line is to be regarded as part of a block comment." @@ -3742,12 +3578,10 @@ Should be called with the point before leading colon of an attribute." (set-syntax-table reset-st)))) (defsubst cperl-look-at-leading-count (is-x-REx e) - (if (and (> (point) e) - ;; return nil on failure, no moving - (re-search-forward (concat "\\=" - (if is-x-REx "[ \t\n]*" "") - "[{?+*]") - (1- e) t)) + (if (and + (< (point) e) + (re-search-forward (concat "\\=" (if is-x-REx "[ \t\n]*" "") "[{?+*]") + (1- e) t)) ; return nil on failure, no moving (if (eq ?\{ (preceding-char)) nil (cperl-postpone-fontification (1- (point)) (point) @@ -4791,8 +4625,8 @@ the sections using `cperl-pod-head-face', `cperl-pod-face', (if (and is-REx is-x-REx) (put-text-property (1+ b) (1- e) 'syntax-subtype 'x-REx))) - (if i2 - (progn + (if (and i2 e1 b1 (> e1 b1)) + (progn ; No errors finding the second part... (cperl-postpone-fontification (1- e1) e1 'face my-cperl-delimiters-face) (if (and (not (eobp)) @@ -4891,14 +4725,16 @@ the sections using `cperl-pod-head-face', `cperl-pod-face', (beginning-of-line) (if (memq (setq pr (get-text-property (point) 'syntax-type)) '(pod here-doc here-doc-delim)) - (cperl-unwind-to-safe nil) - (or (and (looking-at "^[ \t]*\\(#\\|$\\)") - (not (memq pr '(string prestring)))) - (progn (cperl-to-comment-or-eol) (bolp)) - (progn - (skip-chars-backward " \t") - (if (< p (point)) (goto-char p)) - (setq stop t))))))) + (progn + (cperl-unwind-to-safe nil) + (setq pr (get-text-property (point) 'syntax-type)))) + (or (and (looking-at "^[ \t]*\\(#\\|$\\)") + (not (memq pr '(string prestring)))) + (progn (cperl-to-comment-or-eol) (bolp)) + (progn + (skip-chars-backward " \t") + (if (< p (point)) (goto-char p)) + (setq stop t)))))) ;; Used only in `cperl-calculate-indent'... (defun cperl-block-p () ; Do not C-M-q ! One string contains ";" ! @@ -5723,10 +5559,11 @@ indentation and initial hashes. Behaves usually outside of comment." (defun cperl-windowed-init () "Initialization under windowed version." (cond ((featurep 'ps-print) - (unless cperl-faces-init - (if (boundp 'font-lock-multiline) - (setq cperl-font-lock-multiline t)) - (cperl-init-faces))) + (or cperl-faces-init + (progn + (and (boundp 'font-lock-multiline) + (setq cperl-font-lock-multiline t)) + (cperl-init-faces)))) ((not cperl-faces-init) (add-hook 'font-lock-mode-hook (function @@ -9041,7 +8878,7 @@ do extra unwind via `cperl-unwind-to-safe'." (cperl-fontify-syntaxically to))))) (defvar cperl-version - (let ((v "Revision: 5.22")) + (let ((v "Revision: 5.23")) (string-match ":\\s *\\([0-9.]+\\)" v) (substring v (match-beginning 1) (match-end 1))) "Version of IZ-supported CPerl package this file is based on.") diff --git a/lisp/progmodes/delphi.el b/lisp/progmodes/delphi.el index 99f03f8a545..6cbef6f426d 100644 --- a/lisp/progmodes/delphi.el +++ b/lisp/progmodes/delphi.el @@ -1677,21 +1677,21 @@ before the indent, the point is moved to the indent." (unit-file (downcase unit))) (catch 'done ;; Search for the file. - (mapcar #'(lambda (file) - (let ((path (concat dir "/" file))) - (if (and (string= unit-file (downcase file)) - (delphi-is-file path)) - (throw 'done path)))) - files) + (mapc #'(lambda (file) + (let ((path (concat dir "/" file))) + (if (and (string= unit-file (downcase file)) + (delphi-is-file path)) + (throw 'done path)))) + files) ;; Not found. Search subdirectories. (when recurse - (mapcar #'(lambda (subdir) - (unless (member subdir '("." "..")) - (let ((path (delphi-search-directory - unit (concat dir "/" subdir) recurse))) - (if path (throw 'done path))))) - files)) + (mapc #'(lambda (subdir) + (unless (member subdir '("." "..")) + (let ((path (delphi-search-directory + unit (concat dir "/" subdir) recurse))) + (if path (throw 'done path))))) + files)) ;; Not found. nil)))) @@ -1721,7 +1721,7 @@ before the indent, the point is moved to the indent." ((stringp delphi-search-path) (delphi-find-unit-in-directory unit delphi-search-path)) - ((mapcar + ((mapc #'(lambda (dir) (let ((file (delphi-find-unit-in-directory unit dir))) (if file (throw 'done file)))) @@ -1888,39 +1888,39 @@ comment block. If not in a // comment, just does a normal newline." (defvar delphi-debug-mode-map (let ((kmap (make-sparse-keymap))) - (mapcar #'(lambda (binding) (define-key kmap (car binding) (cadr binding))) - '(("n" delphi-debug-goto-next-token) - ("p" delphi-debug-goto-previous-token) - ("t" delphi-debug-show-current-token) - ("T" delphi-debug-tokenize-buffer) - ("W" delphi-debug-tokenize-window) - ("g" delphi-debug-goto-point) - ("s" delphi-debug-show-current-string) - ("a" delphi-debug-parse-buffer) - ("w" delphi-debug-parse-window) - ("f" delphi-debug-fontify-window) - ("F" delphi-debug-fontify-buffer) - ("r" delphi-debug-parse-region) - ("c" delphi-debug-unparse-buffer) - ("x" delphi-debug-show-is-stable) - )) + (mapc #'(lambda (binding) (define-key kmap (car binding) (cadr binding))) + '(("n" delphi-debug-goto-next-token) + ("p" delphi-debug-goto-previous-token) + ("t" delphi-debug-show-current-token) + ("T" delphi-debug-tokenize-buffer) + ("W" delphi-debug-tokenize-window) + ("g" delphi-debug-goto-point) + ("s" delphi-debug-show-current-string) + ("a" delphi-debug-parse-buffer) + ("w" delphi-debug-parse-window) + ("f" delphi-debug-fontify-window) + ("F" delphi-debug-fontify-buffer) + ("r" delphi-debug-parse-region) + ("c" delphi-debug-unparse-buffer) + ("x" delphi-debug-show-is-stable) + )) kmap) "Keystrokes for delphi-mode debug commands.") (defvar delphi-mode-map (let ((kmap (make-sparse-keymap))) - (mapcar #'(lambda (binding) (define-key kmap (car binding) (cadr binding))) - (list '("\r" delphi-newline) - '("\t" delphi-tab) - '("\177" backward-delete-char-untabify) -;; '("\C-cd" delphi-find-current-def) -;; '("\C-cx" delphi-find-current-xdef) -;; '("\C-cb" delphi-find-current-body) - '("\C-cu" delphi-find-unit) - '("\M-q" delphi-fill-comment) - '("\M-j" delphi-new-comment-line) - ;; Debug bindings: - (list "\C-c\C-d" delphi-debug-mode-map))) + (mapc #'(lambda (binding) (define-key kmap (car binding) (cadr binding))) + (list '("\r" delphi-newline) + '("\t" delphi-tab) + '("\177" backward-delete-char-untabify) +;; '("\C-cd" delphi-find-current-def) +;; '("\C-cx" delphi-find-current-xdef) +;; '("\C-cb" delphi-find-current-body) + '("\C-cu" delphi-find-unit) + '("\M-q" delphi-fill-comment) + '("\M-j" delphi-new-comment-line) + ;; Debug bindings: + (list "\C-c\C-d" delphi-debug-mode-map))) kmap) "Keymap used in Delphi mode.") @@ -1981,17 +1981,17 @@ no args, if that value is non-nil." (set-syntax-table delphi-mode-syntax-table) ;; Buffer locals: - (mapcar #'(lambda (var) - (let ((var-symb (car var)) - (var-val (cadr var))) - (make-local-variable var-symb) - (set var-symb var-val))) - (list '(indent-line-function delphi-indent-line) - '(comment-indent-function delphi-indent-line) - '(case-fold-search t) - '(delphi-progress-last-reported-point nil) - '(delphi-ignore-changes nil) - (list 'font-lock-defaults delphi-font-lock-defaults))) + (mapc #'(lambda (var) + (let ((var-symb (car var)) + (var-val (cadr var))) + (make-local-variable var-symb) + (set var-symb var-val))) + (list '(indent-line-function delphi-indent-line) + '(comment-indent-function delphi-indent-line) + '(case-fold-search t) + '(delphi-progress-last-reported-point nil) + '(delphi-ignore-changes nil) + (list 'font-lock-defaults delphi-font-lock-defaults))) ;; We need to keep track of changes to the buffer to determine if we need ;; to retokenize changed text. diff --git a/lisp/progmodes/ebrowse.el b/lisp/progmodes/ebrowse.el index 58a25ab5b88..9264bb42ba2 100644 --- a/lisp/progmodes/ebrowse.el +++ b/lisp/progmodes/ebrowse.el @@ -1148,15 +1148,15 @@ Tree mode key bindings: (erase-buffer) (message nil)) - (mapcar 'make-local-variable - '(ebrowse--tags-file-name - ebrowse--indentation - ebrowse--tree - ebrowse--header - ebrowse--show-file-names-flag - ebrowse--frozen-flag - ebrowse--tree-obarray - revert-buffer-function)) + (mapc 'make-local-variable + '(ebrowse--tags-file-name + ebrowse--indentation + ebrowse--tree + ebrowse--header + ebrowse--show-file-names-flag + ebrowse--frozen-flag + ebrowse--tree-obarray + revert-buffer-function)) (setf ebrowse--show-file-names-flag nil ebrowse--tree-obarray (make-vector 127 0) @@ -1638,10 +1638,10 @@ and possibly kill the viewed buffer." (setq original-frame-configuration ebrowse--frame-configuration exit-action ebrowse--view-exit-action)) ;; Delete the frame in which we viewed. - (mapcar 'delete-frame - (loop for frame in (frame-list) - when (not (assq frame original-frame-configuration)) - collect frame)) + (mapc 'delete-frame + (loop for frame in (frame-list) + when (not (assq frame original-frame-configuration)) + collect frame)) (when exit-action (funcall exit-action buffer)))) @@ -2004,7 +2004,7 @@ COLLAPSE non-nil means collapse the branch." (fillarray (car (cdr map)) 'ebrowse-electric-list-undefined) (fillarray (car (cdr submap)) 'ebrowse-electric-list-undefined) (define-key map "\e" submap) - (define-key map "\C-z" 'suspend-emacs) + (define-key map "\C-z" 'suspend-frame) (define-key map "\C-h" 'Helper-help) (define-key map "?" 'Helper-describe-bindings) (define-key map "\C-c" nil) @@ -2256,28 +2256,28 @@ See 'Electric-command-loop' for a description of STATE and CONDITION." (kill-all-local-variables) (use-local-map ebrowse-member-mode-map) (setq major-mode 'ebrowse-member-mode) - (mapcar 'make-local-variable - '(ebrowse--decl-column ;display column - ebrowse--n-columns ;number of short columns - ebrowse--column-width ;width of columns above - ebrowse--show-inherited-flag ;include inherited members? - ebrowse--filters ;public, protected, private - ebrowse--accessor ;vars, functions, friends - ebrowse--displayed-class ;class displayed - ebrowse--long-display-flag ;display with regexps? - ebrowse--source-regexp-flag ;show source regexp? - ebrowse--attributes-flag ;show `virtual' and `inline' - ebrowse--member-list ;list of members displayed - ebrowse--tree ;the class tree - ebrowse--member-mode-strings ;part of mode line - ebrowse--tags-file-name ; - ebrowse--header - ebrowse--tree-obarray - ebrowse--virtual-display-flag - ebrowse--inline-display-flag - ebrowse--const-display-flag - ebrowse--pure-display-flag - ebrowse--frozen-flag)) ;buffer not automagically reused + (mapc 'make-local-variable + '(ebrowse--decl-column ;display column + ebrowse--n-columns ;number of short columns + ebrowse--column-width ;width of columns above + ebrowse--show-inherited-flag ;include inherited members? + ebrowse--filters ;public, protected, private + ebrowse--accessor ;vars, functions, friends + ebrowse--displayed-class ;class displayed + ebrowse--long-display-flag ;display with regexps? + ebrowse--source-regexp-flag ;show source regexp? + ebrowse--attributes-flag ;show `virtual' and `inline' + ebrowse--member-list ;list of members displayed + ebrowse--tree ;the class tree + ebrowse--member-mode-strings ;part of mode line + ebrowse--tags-file-name ; + ebrowse--header + ebrowse--tree-obarray + ebrowse--virtual-display-flag + ebrowse--inline-display-flag + ebrowse--const-display-flag + ebrowse--pure-display-flag + ebrowse--frozen-flag)) ;buffer not automagically reused (setq mode-name "Ebrowse-Members" mode-line-buffer-identification (propertized-buffer-identification "C++ Members") @@ -3964,7 +3964,7 @@ Prefix arg ARG says how much." (fillarray (car (cdr map)) 'ebrowse-electric-position-undefined) (fillarray (car (cdr submap)) 'ebrowse-electric-position-undefined) (define-key map "\e" submap) - (define-key map "\C-z" 'suspend-emacs) + (define-key map "\C-z" 'suspend-frame) (define-key map "\C-h" 'Helper-help) (define-key map "?" 'Helper-describe-bindings) (define-key map "\C-c" nil) @@ -4148,7 +4148,7 @@ Otherwise, FILE-NAME specifies the file to save the tree in." (erase-buffer) (setf (ebrowse-hs-member-table header) nil) (insert (prin1-to-string header) " ") - (mapcar 'ebrowse-save-class tree) + (mapc 'ebrowse-save-class tree) (write-file file-name) (message "Tree written to file `%s'" file-name)) (kill-buffer temp-buffer) @@ -4163,7 +4163,7 @@ Otherwise, FILE-NAME specifies the file to save the tree in." (insert "[ebrowse-ts ") (prin1 (ebrowse-ts-class class)) ;class name (insert "(") ;list of subclasses - (mapcar 'ebrowse-save-class (ebrowse-ts-subclasses class)) + (mapc 'ebrowse-save-class (ebrowse-ts-subclasses class)) (insert ")") (dolist (func ebrowse-member-list-accessors) (prin1 (funcall func class)) diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el index 6c704916c65..c7042fb1f67 100644 --- a/lisp/progmodes/f90.el +++ b/lisp/progmodes/f90.el @@ -682,7 +682,7 @@ Used in the F90 entry in `hs-special-modes-alist'.") (let (abbrevs-changed) ;; Use the 6th arg (SYSTEM-FLAG) of define-abbrev if possible. ;; A little baroque to quieten the byte-compiler. - (mapcar + (mapc (function (lambda (element) (condition-case nil (apply 'define-abbrev f90-mode-abbrev-table diff --git a/lisp/progmodes/fortran.el b/lisp/progmodes/fortran.el index bcb571f8c87..016e484a6c5 100644 --- a/lisp/progmodes/fortran.el +++ b/lisp/progmodes/fortran.el @@ -56,7 +56,6 @@ ;; silence compiler (defvar dabbrev-case-fold-search) -(defvar font-lock-syntactic-keywords) (defvar gud-find-expr-function) (defvar imenu-case-fold-search) (defvar imenu-syntax-alist) @@ -151,7 +150,7 @@ You might want to change this to \"*\", for instance." ;; filling and doesn't seem to be necessary. (defcustom fortran-comment-line-start-skip "^[CcDd*!]\\(\\([^ \t\n]\\)\\2+\\)?[ \t]*" - "*Regexp to match the start of a full-line comment." + "Regexp to match the start of a full-line comment." :version "21.1" :type 'regexp :group 'fortran-comment) @@ -650,7 +649,7 @@ Used in the Fortran entry in `hs-special-modes-alist'.") (let (abbrevs-changed) ;; Use the 6th arg (SYSTEM-FLAG) of define-abbrev if possible. ;; Only use `apply' to quieten the byte-compiler. - (mapcar + (mapc (function (lambda (element) (condition-case nil (apply 'define-abbrev fortran-mode-abbrev-table @@ -827,9 +826,9 @@ with no args, if that value is non-nil." fortran-font-lock-keywords-3 fortran-font-lock-keywords-4) nil t ((?/ . "$/") ("_$" . "w")) - fortran-beginning-of-subprogram)) - (set (make-local-variable 'font-lock-syntactic-keywords) - (fortran-font-lock-syntactic-keywords)) + fortran-beginning-of-subprogram + (font-lock-syntactic-keywords + . (fortran-font-lock-syntactic-keywords)))) (set (make-local-variable 'imenu-case-fold-search) t) (set (make-local-variable 'imenu-generic-expression) fortran-imenu-generic-expression) @@ -853,20 +852,20 @@ Fortran mode. If the optional argument GLOBAL is non-nil, it affects all Fortran buffers, and also the default." (interactive "p") (let (new) - (mapcar (lambda (buff) - (with-current-buffer buff - (when (eq major-mode 'fortran-mode) - (setq fortran-line-length nchars - fill-column fortran-line-length - new (fortran-font-lock-syntactic-keywords)) - ;; Refontify only if necessary. - (unless (equal new font-lock-syntactic-keywords) - (setq font-lock-syntactic-keywords - (fortran-font-lock-syntactic-keywords)) - (if font-lock-mode (font-lock-mode 1)))))) - (if global - (buffer-list) - (list (current-buffer)))) + (mapc (lambda (buff) + (with-current-buffer buff + (when (eq major-mode 'fortran-mode) + (setq fortran-line-length nchars + fill-column fortran-line-length + new (fortran-font-lock-syntactic-keywords)) + ;; Refontify only if necessary. + (unless (equal new font-lock-syntactic-keywords) + (setq font-lock-syntactic-keywords + (fortran-font-lock-syntactic-keywords)) + (if font-lock-mode (font-lock-mode 1)))))) + (if global + (buffer-list) + (list (current-buffer)))) (if global (setq-default fortran-line-length nchars)))) diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el index 716b79138f9..89211732e44 100644 --- a/lisp/progmodes/gdb-ui.el +++ b/lisp/progmodes/gdb-ui.el @@ -34,8 +34,7 @@ ;; Emacs 21 such as the fringe/display margin for breakpoints, and the toolbar ;; (see the GDB Graphical Interface section in the Emacs info manual). -;; By default, M-x gdb will start the debugger. However, if you have customised -;; gud-gdb-command-name, then start it with M-x gdba. +;; By default, M-x gdb will start the debugger. ;; This file has evolved from gdba.el that was included with GDB 5.0 and ;; written by Tom Lord and Jim Kingdon. It uses GDB's annotation interface. @@ -218,10 +217,11 @@ handlers.") "List of changed register numbers (strings).") ;;;###autoload -(defun gdba (command-line) +(defun gdb (command-line) "Run gdb on program FILE in buffer *gud-FILE*. -The directory containing FILE becomes the initial working directory -and source-file directory for your debugger. +The directory containing FILE becomes the initial working +directory and source-file directory for your debugger. + If `gdb-many-windows' is nil (the default value) then gdb just pops up the GUD buffer unless `gdb-show-main' is t. In this case @@ -266,13 +266,61 @@ detailed description of this mode. | RET gdb-frames-select | SPC gdb-toggle-breakpoint | | | RET gdb-goto-breakpoint | | | D gdb-delete-breakpoint | -+-----------------------------------+----------------------------------+" - ;; - (interactive (list (gud-query-cmdline 'gdba))) - ;; - ;; Let's start with a basic gud-gdb buffer and then modify it a bit. - (gdb command-line) - (gdb-init-1)) ++-----------------------------------+----------------------------------+ + +To run GDB in text command mode, replace the GDB \"--annotate=3\" +option with \"--fullname\" either in the minibuffer for the +current Emacs session, or the custom variable +`gud-gdb-command-name' for all future sessions. You need to use +text command mode to debug multiple programs within one Emacs +session." + (interactive (list (gud-query-cmdline 'gdb))) + + (when (and gud-comint-buffer + (buffer-name gud-comint-buffer) + (get-buffer-process gud-comint-buffer) + (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))) + (gdb-restore-windows) + (error + "Multiple debugging requires restarting in text command mode")) + + (gud-common-init command-line nil 'gud-gdba-marker-filter) + (set (make-local-variable 'gud-minor-mode) 'gdba) + + (gud-def gud-break "break %f:%l" "\C-b" "Set breakpoint at current line.") + (gud-def gud-tbreak "tbreak %f:%l" "\C-t" + "Set temporary breakpoint at current line.") + (gud-def gud-remove "clear %f:%l" "\C-d" "Remove breakpoint at current line") + (gud-def gud-step "step %p" "\C-s" "Step one source line with display.") + (gud-def gud-stepi "stepi %p" "\C-i" "Step one instruction with display.") + (gud-def gud-next "next %p" "\C-n" "Step one line (skip functions).") + (gud-def gud-nexti "nexti %p" nil "Step one instruction (skip functions).") + (gud-def gud-cont "cont" "\C-r" "Continue with display.") + (gud-def gud-finish "finish" "\C-f" "Finish executing current function.") + (gud-def gud-jump + (progn (gud-call "tbreak %f:%l") (gud-call "jump %f:%l")) + "\C-j" "Set execution address to current line.") + + (gud-def gud-up "up %p" "<" "Up N stack frames (numeric arg).") + (gud-def gud-down "down %p" ">" "Down N stack frames (numeric arg).") + (gud-def gud-print "print %e" "\C-p" "Evaluate C expression at point.") + (gud-def gud-pstar "print* %e" nil + "Evaluate C dereferenced pointer expression at point.") + + ;; For debugging Emacs only. + (gud-def gud-pv "pv1 %e" "\C-v" "Print the value of the lisp variable.") + + (gud-def gud-until "until %l" "\C-u" "Continue to current line.") + (gud-def gud-run "run" nil "Run the program.") + + (local-set-key "\C-i" 'gud-gdb-complete-command) + (setq comint-prompt-regexp "^(.*gdb[+]?) *") + (setq paragraph-start comint-prompt-regexp) + (setq gdb-first-prompt t) + (setq gud-running nil) + (setq gdb-ready nil) + (setq gud-filter-pending-text nil) + (run-hooks 'gdb-mode-hook)) (defcustom gdb-debug-log-max 128 "Maximum size of `gdb-debug-log'. If nil, size is unlimited." @@ -465,9 +513,6 @@ otherwise do not." expr))) (defun gdb-init-1 () - (set (make-local-variable 'gud-minor-mode) 'gdba) - (set (make-local-variable 'gud-marker-filter) 'gud-gdba-marker-filter) - ;; (gud-def gud-break (if (not (string-match "Machine" mode-name)) (gud-call "break %f:%l" arg) (save-excursion @@ -599,7 +644,7 @@ otherwise do not." (gdb-enqueue-input (list "server list\n" 'ignore)) (gdb-enqueue-input (list "server info source\n" 'gdb-source-info)) - (run-hooks 'gdba-mode-hook)) + (run-hooks 'gdb-mode-hook)) (defun gdb-get-version () (goto-char (point-min)) @@ -1124,20 +1169,21 @@ The key should be one of the cars in `gdb-buffer-rules-assoc'." (defun gdb-send (proc string) "A comint send filter for gdb. This filter may simply queue input for a later time." - (with-current-buffer gud-comint-buffer - (let ((inhibit-read-only t)) - (remove-text-properties (point-min) (point-max) '(face)))) - (if gud-running - (progn - (let ((item (concat string "\n"))) - (if gdb-enable-debug (push (cons 'send item) gdb-debug-log)) - (process-send-string proc item))) - (if (string-match "\\\\\\'" string) - (setq gdb-continuation (concat gdb-continuation string "\n")) - (let ((item (concat gdb-continuation string - (if (not comint-input-sender-no-newline) "\n")))) - (gdb-enqueue-input item) - (setq gdb-continuation nil))))) + (when gdb-ready + (with-current-buffer gud-comint-buffer + (let ((inhibit-read-only t)) + (remove-text-properties (point-min) (point-max) '(face)))) + (if gud-running + (progn + (let ((item (concat string "\n"))) + (if gdb-enable-debug (push (cons 'send item) gdb-debug-log)) + (process-send-string proc item))) + (if (string-match "\\\\\\'" string) + (setq gdb-continuation (concat gdb-continuation string "\n")) + (let ((item (concat gdb-continuation string + (if (not comint-input-sender-no-newline) "\n")))) + (gdb-enqueue-input item) + (setq gdb-continuation nil)))))) ;; Note: Stuff enqueued here will be sent to the next prompt, even if it ;; is a query, or other non-top-level prompt. @@ -1193,8 +1239,8 @@ This filter may simply queue input for a later time." ;; any newlines. ;; -(defcustom gud-gdba-command-name "gdb -annotate=3" - "Default command to execute an executable under the GDB-UI debugger." +(defcustom gud-gdb-command-name "gdb --annotate=3" + "Default command to execute an executable under the GDB debugger." :type 'string :group 'gud :version "22.1") @@ -1506,6 +1552,10 @@ happens to be appropriate." (set-window-buffer source-window buffer)) source-window)) +;; Derived from gud-gdb-marker-regexp +(defvar gdb-fullname-regexp + (concat "\\(.:?[^" ":" "\n]*\\)" ":" "\\([0-9]*\\)" ":" ".*")) + (defun gud-gdba-marker-filter (string) "A gud marker filter for gdb. Handle a burst of output from GDB." (if gdb-flush-pending-output @@ -1522,34 +1572,50 @@ happens to be appropriate." ;; ;; Process all the complete markers in this chunk. (while (string-match "\n\032\032\\(.*\\)\n" gud-marker-acc) - (let ((annotation (match-string 1 gud-marker-acc))) - ;; - ;; Stuff prior to the match is just ordinary output. - ;; It is either concatenated to OUTPUT or directed - ;; elsewhere. - (setq output - (gdb-concat-output - output - (substring gud-marker-acc 0 (match-beginning 0)))) - ;; - ;; Take that stuff off the gud-marker-acc. - (setq gud-marker-acc (substring gud-marker-acc (match-end 0))) + (let ((annotation (match-string 1 gud-marker-acc)) + (before (substring gud-marker-acc 0 (match-beginning 0))) + (after (substring gud-marker-acc (match-end 0)))) ;; ;; Parse the tag from the annotation, and maybe its arguments. (string-match "\\(\\S-*\\) ?\\(.*\\)" annotation) (let* ((annotation-type (match-string 1 annotation)) (annotation-arguments (match-string 2 annotation)) (annotation-rule (assoc annotation-type - gdb-annotation-rules))) + gdb-annotation-rules)) + (fullname (string-match gdb-fullname-regexp annotation-type))) + + ;; Stuff prior to the match is just ordinary output. + ;; It is either concatenated to OUTPUT or directed + ;; elsewhere. + (setq output + (gdb-concat-output output + (concat before (if fullname "\n")))) + + ;; Take that stuff off the gud-marker-acc. + (setq gud-marker-acc after) + ;; Call the handler for this annotation. (if annotation-rule (funcall (car (cdr annotation-rule)) annotation-arguments) - ;; Else the annotation is not recognized. Ignore it silently, - ;; so that GDB can add new annotations without causing - ;; us to blow up. - )))) - ;; + + ;; Switch to gud-gdb-marker-filter if appropriate. + (when fullname + + ;; Extract the frame position from the marker. + (setq gud-last-frame (cons (match-string 1 annotation) + (string-to-number + (match-string 2 annotation)))) + + (set (make-local-variable 'gud-minor-mode) 'gdb) + (set (make-local-variable 'gud-marker-filter) + 'gud-gdb-marker-filter))) + + ;; Else the annotation is not recognized. Ignore it silently, + ;; so that GDB can add new annotations without causing + ;; us to blow up. + ))) + ;; Does the remaining text end in a partial line? ;; If it does, then keep part of the gud-marker-acc until we get more. (if (string-match "\n\\'\\|\n\032\\'\\|\n\032\032.*\\'" @@ -2801,7 +2867,7 @@ corresponding to the mode line clicked." (let ((answer (get-buffer-window buf 0)) (must-split nil)) (if answer - (display-buffer buf nil 0) ;Raise the frame if necessary. + (display-buffer buf nil 0) ;Deiconify the frame if necessary. ;; The buffer is not yet displayed. (pop-to-buffer gud-comint-buffer) ;Select the right frame. (let ((window (get-lru-window))) @@ -2996,7 +3062,8 @@ buffers." (gdb-get-buffer-create 'gdb-breakpoints-buffer) (if gdb-show-main (let ((pop-up-windows t)) - (display-buffer (gud-find-file gdb-main-file)))))) + (display-buffer (gud-find-file gdb-main-file))))) + (setq gdb-ready t)) (defun gdb-get-location (bptno line flag) "Find the directory containing the relevant source file. diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 91518641938..091735ee09d 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -142,23 +142,31 @@ The following place holders should be present in the string: :version "22.1" :group 'grep) -(defcustom grep-files-aliases '( - ("el" . "*.el") - ("ch" . "*.[ch]") - ("c" . "*.c") - ("h" . "*.h") - ("asm" . "*.[sS]") - ("m" . "[Mm]akefile*") - ("l" . "[Cc]hange[Ll]og*") - ("tex" . "*.tex") - ("texi" . "*.texi") - ) +(defcustom grep-files-aliases + '(("asm" . "*.[sS]") + ("c" . "*.c") + ("cc" . "*.cc") + ("ch" . "*.[ch]") + ("el" . "*.el") + ("h" . "*.h") + ("l" . "[Cc]hange[Ll]og*") + ("m" . "[Mm]akefile*") + ("tex" . "*.tex") + ("texi" . "*.texi")) "*Alist of aliases for the FILES argument to `lgrep' and `rgrep'." :type 'alist :group 'grep) -(defcustom grep-find-ignored-directories '("CVS" ".svn" "{arch}" ".hg" "_darcs" - ".git" ".bzr") +(defcustom grep-find-ignored-directories + '(".bzr" + ".git" + ".hg" + ".svn" + "CVS" + "RCS" + "_MTN" + "_darcs" + "{arch}") "*List of names of sub-directories which `rgrep' shall not recurse into." :type '(repeat string) :group 'grep) diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index 4b0dec7002e..d2384232686 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -104,6 +104,8 @@ If SOFT is non-nil, returns nil if the symbol doesn't already exist." "Non-nil if debugged program is running. Used to grey out relevant toolbar icons.") +(defvar gdb-ready nil) + ;; Use existing Info buffer, if possible. (defun gud-goto-info () "Go to relevant Emacs info node." @@ -592,8 +594,9 @@ required by the caller." ;; History of argument lists passed to gdb. (defvar gud-gdb-history nil) -(defcustom gud-gdb-command-name "gdb --annotate=3" - "Default command to execute an executable under the GDB debugger." +(defcustom gud-gud-gdb-command-name "gdb --fullname" + "Default command to run an executable under GDB in text command mode. +The option \"--fullname\" must be included in this value." :type 'string :group 'gud) @@ -638,14 +641,6 @@ required by the caller." (while (string-match "\n\032\032\\(.*\\)\n" gud-marker-acc) (let ((match (match-string 1 gud-marker-acc))) - ;; Pick up stopped annotation if attaching to process. - (if (string-equal match "stopped") (setq gdb-active-process t)) - - ;; Using annotations, switch to gud-gdba-marker-filter. - (when (string-equal match "prompt") - (require 'gdb-ui) - (gdb-prompt nil)) - (setq ;; Append any text before the marker to the output we're going ;; to return - we don't include the marker in this text. @@ -654,13 +649,7 @@ required by the caller." ;; Set the accumulator to the remaining text. - gud-marker-acc (substring gud-marker-acc (match-end 0))) - - ;; Pick up any errors that occur before first prompt annotation. - (if (string-equal match "error-begin") - (put-text-property 0 (length gud-marker-acc) - 'face font-lock-warning-face - gud-marker-acc)))) + gud-marker-acc (substring gud-marker-acc (match-end 0))))) ;; Does the remaining text look like it might end with the ;; beginning of another marker? If it does, then keep it in @@ -712,8 +701,9 @@ required by the caller." (defvar gud-filter-pending-text nil "Non-nil means this is text that has been saved for later in `gud-filter'.") +;; The old gdb command. The new one is in gdb-ui.el. ;;;###autoload -(defun gdb (command-line) +(defun gud-gdb (command-line) "Run gdb on program FILE in buffer *gud-FILE*. The directory containing FILE becomes the initial working directory and source-file directory for your debugger. By @@ -726,7 +716,9 @@ current Emacs session, or the custom variable `gud-gdb-command-name' for all future sessions. You need to use text command mode to debug multiple programs within one Emacs session." - (interactive (list (gud-query-cmdline 'gdb))) + (interactive (list (gud-query-cmdline 'gud-gdb))) + + (require 'gdb-ui) (when (and gud-comint-buffer (buffer-name gud-comint-buffer) @@ -736,8 +728,8 @@ session." (error "Multiple debugging requires restarting in text command mode")) - (gud-common-init command-line nil 'gud-gdb-marker-filter) - (set (make-local-variable 'gud-minor-mode) 'gdb) + (gud-common-init command-line nil 'gud-gdba-marker-filter) + (set (make-local-variable 'gud-minor-mode) 'gdba) (gud-def gud-break "break %f:%l" "\C-b" "Set breakpoint at current line.") (gud-def gud-tbreak "tbreak %f:%l" "\C-t" @@ -769,8 +761,10 @@ session." (setq comint-prompt-regexp "^(.*gdb[+]?) *") (setq paragraph-start comint-prompt-regexp) (setq gdb-first-prompt t) + (setq gud-running nil) + (setq gdb-ready nil) (setq gud-filter-pending-text nil) - (run-hooks 'gdb-mode-hook)) + (run-hooks 'gud-gdb-mode-hook)) ;; One of the nice features of GDB is its impressive support for ;; context-sensitive command completion. We preserve that feature @@ -1643,7 +1637,7 @@ and source-file directory for your debugger." (gud-common-init command-line nil 'gud-pdb-marker-filter) (set (make-local-variable 'gud-minor-mode) 'pdb) - (gud-def gud-break "break %l" "\C-b" "Set breakpoint at current line.") + (gud-def gud-break "break %f:%l" "\C-b" "Set breakpoint at current line.") (gud-def gud-remove "clear %f:%l" "\C-d" "Remove breakpoint at current line") (gud-def gud-step "step" "\C-s" "Step one source line with display.") (gud-def gud-next "next" "\C-n" "Step one line (skip functions).") @@ -2527,7 +2521,6 @@ comint mode, which see." (and file-word (file-name-nondirectory file)))) (set (make-local-variable 'gud-marker-filter) marker-filter) (if find-file (set (make-local-variable 'gud-find-file) find-file)) - (setq gud-running nil) (setq gud-last-last-frame nil) (set-process-filter (get-buffer-process (current-buffer)) 'gud-filter) @@ -2635,7 +2628,7 @@ It is saved for when this flag is not set.") ;; process-buffer is current-buffer (unwind-protect (progn - ;; Write something in *compilation* and hack its mode line, + ;; Write something in the GUD buffer and hack its mode line, (set-buffer (process-buffer proc)) ;; Fix the mode line. (setq mode-line-process @@ -2691,11 +2684,14 @@ Obeying it means displaying in another window the specified file and line." (buffer (with-current-buffer gud-comint-buffer (gud-find-file true-file))) - (window (and buffer (or (get-buffer-window buffer) - (if (memq gud-minor-mode '(gdbmi gdba)) - (unless (gdb-display-source-buffer buffer) - (gdb-display-buffer buffer nil))) - (display-buffer buffer)))) + (window (and buffer + (or (get-buffer-window buffer) + (if (memq gud-minor-mode '(gdbmi gdba)) + (or (if (get-buffer-window buffer 0) + (display-buffer buffer nil 0)) + (unless (gdb-display-source-buffer buffer) + (gdb-display-buffer buffer nil)))) + (display-buffer buffer)))) (pos)) (if buffer (progn diff --git a/lisp/progmodes/meta-mode.el b/lisp/progmodes/meta-mode.el index 6b911dd1e7a..c70f5cdb6a1 100644 --- a/lisp/progmodes/meta-mode.el +++ b/lisp/progmodes/meta-mode.el @@ -124,7 +124,7 @@ ;; ;; This package was begun on February 1, 1997, exactly 20 years after ;; the genesis of TeX took place according to Don Knuth's own account -;; (cf. ``The Errors of TeX'', reprinted in ``Literate Programming'', +;; (cf. ``The Errors of TeX'', reprinted in ``Literate Programming'', ;; Chapter 10, p. 249). What better date could there be to choose? ;; @@ -194,42 +194,42 @@ (list ;; embedded TeX code in btex ... etex (cons (concat "\\(btex\\|verbatimtex\\)" - "[ \t]+\\(.*\\)[ \t]+" + "[ \t\f]+\\(.*\\)[ \t\f]+" "\\(etex\\)") '((1 font-lock-keyword-face) (2 font-lock-string-face) (3 font-lock-keyword-face))) ;; unary macro definitions: def, vardef, let (cons (concat "\\<" macro-keywords-1 "\\>" - "[ \t]+\\(\\sw+\\|\\s_+\\|\\s.+\\)") + "[ \t\f]+\\(\\sw+\\|\\s_+\\|\\s.+\\)") '((1 font-lock-keyword-face) (2 font-lock-function-name-face))) ;; binary macro defintions: <leveldef> x operator y (cons (concat "\\<" macro-keywords-2 "\\>" - "[ \t]+\\(\\sw+\\)" - "[ \t]*\\(\\sw+\\|\\s.+\\)" - "[ \t]*\\(\\sw+\\)") + "[ \t\f]+\\(\\sw+\\)" + "[ \t\f]*\\(\\sw+\\|\\s.+\\)" + "[ \t\f]*\\(\\sw+\\)") '((1 font-lock-keyword-face) (2 font-lock-variable-name-face nil t) (3 font-lock-function-name-face nil t) (4 font-lock-variable-name-face nil t))) ;; variable declarations: numeric, pair, color, ... (cons (concat "\\<" type-keywords "\\>" - "\\([ \t]+\\(\\sw+\\)\\)*") + "\\([ \t\f]+\\(\\sw+\\)\\)*") '((1 font-lock-type-face) (font-lock-match-meta-declaration-item-and-skip-to-next (goto-char (match-end 1)) nil (1 font-lock-variable-name-face nil t)))) ;; argument declarations: expr, suffix, text, ... (cons (concat "\\<" args-keywords "\\>" - "\\([ \t]+\\(\\sw+\\|\\s_+\\)\\)*") + "\\([ \t\f]+\\(\\sw+\\|\\s_+\\)\\)*") '((1 font-lock-type-face) (font-lock-match-meta-declaration-item-and-skip-to-next (goto-char (match-end 1)) nil (1 font-lock-variable-name-face nil t)))) ;; special case of arguments: expr x of y - (cons (concat "\\(expr\\)[ \t]+\\(\\sw+\\)" - "[ \t]+\\(of\\)[ \t]+\\(\\sw+\\)") + (cons (concat "\\(expr\\)[ \t\f]+\\(\\sw+\\)" + "[ \t\f]+\\(of\\)[ \t\f]+\\(\\sw+\\)") '((1 font-lock-type-face) (2 font-lock-variable-name-face) (3 font-lock-keyword-face nil t) @@ -245,7 +245,7 @@ 'font-lock-keyword-face) ;; input, generate (cons (concat "\\<" input-keywords "\\>" - "[ \t]+\\(\\sw+\\)") + "[ \t\f]+\\(\\sw+\\)") '((1 font-lock-keyword-face) (2 font-lock-constant-face))) ;; embedded Metafont/MetaPost code in comments @@ -264,7 +264,7 @@ ;; `forward-sexp'. The list of items is expected to be separated ;; by commas and terminated by semicolons or equals signs. ;; - (if (looking-at "[ \t]*\\(\\sw+\\|\\s_+\\)") + (if (looking-at "[ \t\f]*\\(\\sw+\\|\\s_+\\)") (save-match-data (condition-case nil (save-restriction @@ -272,7 +272,7 @@ (narrow-to-region (point-min) limit) (goto-char (match-end 1)) ;; Move over any item value, etc., to the next item. - (while (not (looking-at "[ \t]*\\(\\(,\\)\\|;\\|=\\|$\\)")) + (while (not (looking-at "[ \t\f]*\\(\\(,\\)\\|;\\|=\\|$\\)")) (goto-char (or (scan-sexps (point) 1) (point-max)))) (goto-char (match-end 2))) (error t))))) @@ -586,7 +586,7 @@ If the list was changed, sort the list and remove duplicates first." (if (and meta-left-comment-regexp (looking-at meta-left-comment-regexp)) (current-column) - (skip-chars-backward "\t ") + (skip-chars-backward "\t\f ") (max (if (bolp) 0 (1+ (current-column))) comment-column))) @@ -647,20 +647,24 @@ If the list was changed, sort the list and remove duplicates first." (defun meta-indent-previous-line () "Go to the previous line of code, skipping comments." - (skip-chars-backward "\n\t ") + (skip-chars-backward "\n\t\f ") (move-to-column (current-indentation)) ;; Ignore comments. (while (and (looking-at comment-start) (not (bobp))) - (skip-chars-backward "\n\t ") - (if (not (bobp)) - (move-to-column (current-indentation))))) + (skip-chars-backward "\n\t\f ") + (when (not (bobp)) + (move-to-column (current-indentation))))) (defun meta-indent-unfinished-line () "Tell if the current line of code ends with an unfinished expression." (save-excursion (end-of-line) ;; Skip backward the comments. - (while (search-backward comment-start (point-at-bol) t)) + (let ((point-not-in-string (point))) + (while (search-backward comment-start (point-at-bol) t) + (unless (meta-indent-in-string-p) + (setq point-not-in-string (point)))) + (goto-char point-not-in-string)) ;; Search for the end of the previous expression. (if (search-backward ";" (point-at-bol) t) (progn (while (and (meta-indent-in-string-p) @@ -672,7 +676,7 @@ If the list was changed, sort the list and remove duplicates first." ;; See if the last statement of the line is environment-related, ;; or exists at all. (if (meta-indent-looking-at-code - (concat "[ \t]*\\($\\|" (regexp-quote comment-start) + (concat "[ \t\f]*\\($\\|" (regexp-quote comment-start) "\\|\\<" meta-end-environment-regexp "\\>" "\\|\\<" meta-begin-environment-regexp "\\>" "\\|\\<" meta-within-environment-regexp "\\>\\)")) @@ -782,7 +786,7 @@ Returns t unless search stops due to beginning or end of buffer." (concat "\\<" meta-begin-defun-regexp "\\>") nil t arg) (progn (goto-char (match-beginning 0)) (skip-chars-backward "%") - (skip-chars-backward " \t") t))) + (skip-chars-backward " \t\f") t))) (defun meta-end-of-defun (&optional arg) "Move forward to end of a defun in Metafont or MetaPost code. @@ -796,7 +800,7 @@ Returns t unless search stops due to beginning or end of buffer." (concat "\\<" meta-end-defun-regexp "\\>") nil t arg) (progn (goto-char (match-end 0)) (skip-chars-forward ";") - (skip-chars-forward " \t") + (skip-chars-forward " \t\f") (if (looking-at "\n") (forward-line 1)) t))) @@ -864,78 +868,74 @@ The environment marked is the one that contains point or follows point." "Abbrev table used in Metafont or MetaPost mode.") (define-abbrev-table 'meta-mode-abbrev-table ()) -(defvar meta-mode-syntax-table nil +(defvar meta-mode-syntax-table + (let ((st (make-syntax-table))) + ;; underscores are word constituents + (modify-syntax-entry ?_ "w" st) + ;; miscellaneous non-word symbols + (modify-syntax-entry ?# "_" st) + (modify-syntax-entry ?@ "_" st) + (modify-syntax-entry ?$ "_" st) + (modify-syntax-entry ?? "_" st) + (modify-syntax-entry ?! "_" st) + ;; binary operators + (modify-syntax-entry ?& "." st) + (modify-syntax-entry ?+ "." st) + (modify-syntax-entry ?- "." st) + (modify-syntax-entry ?/ "." st) + (modify-syntax-entry ?* "." st) + (modify-syntax-entry ?. "." st) + (modify-syntax-entry ?: "." st) + (modify-syntax-entry ?= "." st) + (modify-syntax-entry ?< "." st) + (modify-syntax-entry ?> "." st) + (modify-syntax-entry ?| "." st) + ;; opening and closing delimiters + (modify-syntax-entry ?\( "()" st) + (modify-syntax-entry ?\) ")(" st) + (modify-syntax-entry ?\[ "(]" st) + (modify-syntax-entry ?\] ")[" st) + (modify-syntax-entry ?\{ "(}" st) + (modify-syntax-entry ?\} "){" st) + ;; comment character + (modify-syntax-entry ?% "<" st) + (modify-syntax-entry ?\n ">" st) + ;; escape character, needed for embedded TeX code + (modify-syntax-entry ?\\ "\\" st) + st) "Syntax table used in Metafont or MetaPost mode.") -(if meta-mode-syntax-table - () - (setq meta-mode-syntax-table (make-syntax-table)) - ;; underscores are word constituents - (modify-syntax-entry ?_ "w" meta-mode-syntax-table) - ;; miscellaneous non-word symbols - (modify-syntax-entry ?# "_" meta-mode-syntax-table) - (modify-syntax-entry ?@ "_" meta-mode-syntax-table) - (modify-syntax-entry ?$ "_" meta-mode-syntax-table) - (modify-syntax-entry ?? "_" meta-mode-syntax-table) - (modify-syntax-entry ?! "_" meta-mode-syntax-table) - ;; binary operators - (modify-syntax-entry ?& "." meta-mode-syntax-table) - (modify-syntax-entry ?+ "." meta-mode-syntax-table) - (modify-syntax-entry ?- "." meta-mode-syntax-table) - (modify-syntax-entry ?/ "." meta-mode-syntax-table) - (modify-syntax-entry ?* "." meta-mode-syntax-table) - (modify-syntax-entry ?. "." meta-mode-syntax-table) - (modify-syntax-entry ?: "." meta-mode-syntax-table) - (modify-syntax-entry ?= "." meta-mode-syntax-table) - (modify-syntax-entry ?< "." meta-mode-syntax-table) - (modify-syntax-entry ?> "." meta-mode-syntax-table) - (modify-syntax-entry ?| "." meta-mode-syntax-table) - ;; opening and closing delimiters - (modify-syntax-entry ?\( "()" meta-mode-syntax-table) - (modify-syntax-entry ?\) ")(" meta-mode-syntax-table) - (modify-syntax-entry ?\[ "(]" meta-mode-syntax-table) - (modify-syntax-entry ?\] ")[" meta-mode-syntax-table) - (modify-syntax-entry ?\{ "(}" meta-mode-syntax-table) - (modify-syntax-entry ?\} "){" meta-mode-syntax-table) - ;; comment character - (modify-syntax-entry ?% "<" meta-mode-syntax-table) - (modify-syntax-entry ?\n ">" meta-mode-syntax-table) - ;; escape character, needed for embedded TeX code - (modify-syntax-entry ?\\ "\\" meta-mode-syntax-table) - ) -(defvar meta-mode-map nil +(defvar meta-mode-map + (let ((map (make-sparse-keymap))) + (define-key map "\C-m" 'reindent-then-newline-and-indent) + ;; Comment Paragraphs: + ;; (define-key map "\M-a" 'backward-sentence) + ;; (define-key map "\M-e" 'forward-sentence) + ;; (define-key map "\M-h" 'mark-paragraph) + ;; (define-key map "\M-q" 'fill-paragraph) + ;; Navigation: + (define-key map "\M-\C-a" 'meta-beginning-of-defun) + (define-key map "\M-\C-e" 'meta-end-of-defun) + (define-key map "\M-\C-h" 'meta-mark-defun) + ;; Indentation: + (define-key map "\M-\C-q" 'meta-indent-defun) + (define-key map "\C-c\C-qe" 'meta-indent-defun) + (define-key map "\C-c\C-qr" 'meta-indent-region) + (define-key map "\C-c\C-qb" 'meta-indent-buffer) + ;; Commenting Out: + (define-key map "\C-c%" 'meta-comment-defun) + ;; (define-key map "\C-uC-c%" 'meta-uncomment-defun) + (define-key map "\C-c;" 'meta-comment-region) + (define-key map "\C-c:" 'meta-uncomment-region) + ;; Symbol Completion: + (define-key map "\M-\t" 'meta-complete-symbol) + ;; Shell Commands: + ;; (define-key map "\C-c\C-c" 'meta-command-file) + ;; (define-key map "\C-c\C-k" 'meta-kill-job) + ;; (define-key map "\C-c\C-l" 'meta-recenter-output) + map) "Keymap used in Metafont or MetaPost mode.") -(if meta-mode-map - () - (setq meta-mode-map (make-sparse-keymap)) - (define-key meta-mode-map "\t" 'meta-indent-line) - (define-key meta-mode-map "\C-m" 'reindent-then-newline-and-indent) - ;; Comment Paragraphs: -; (define-key meta-mode-map "\M-a" 'backward-sentence) -; (define-key meta-mode-map "\M-e" 'forward-sentence) -; (define-key meta-mode-map "\M-h" 'mark-paragraph) -; (define-key meta-mode-map "\M-q" 'fill-paragraph) - ;; Navigation: - (define-key meta-mode-map "\M-\C-a" 'meta-beginning-of-defun) - (define-key meta-mode-map "\M-\C-e" 'meta-end-of-defun) - (define-key meta-mode-map "\M-\C-h" 'meta-mark-defun) - ;; Indentation: - (define-key meta-mode-map "\M-\C-q" 'meta-indent-defun) - (define-key meta-mode-map "\C-c\C-qe" 'meta-indent-defun) - (define-key meta-mode-map "\C-c\C-qr" 'meta-indent-region) - (define-key meta-mode-map "\C-c\C-qb" 'meta-indent-buffer) - ;; Commenting Out: - (define-key meta-mode-map "\C-c%" 'meta-comment-defun) -; (define-key meta-mode-map "\C-uC-c%" 'meta-uncomment-defun) - (define-key meta-mode-map "\C-c;" 'meta-comment-region) - (define-key meta-mode-map "\C-c:" 'meta-uncomment-region) - ;; Symbol Completion: - (define-key meta-mode-map "\M-\t" 'meta-complete-symbol) - ;; Shell Commands: -; (define-key meta-mode-map "\C-c\C-c" 'meta-command-file) -; (define-key meta-mode-map "\C-c\C-k" 'meta-kill-job) -; (define-key meta-mode-map "\C-c\C-l" 'meta-recenter-output) - ) + (easy-menu-define meta-mode-menu meta-mode-map @@ -1014,11 +1014,14 @@ The environment marked is the one that contains point or follows point." (make-local-variable 'comment-start) (make-local-variable 'comment-end) (make-local-variable 'comment-multi-line) - (setq comment-start-skip "%+[ \t]*") + (setq comment-start-skip "%+[ \t\f]*") (setq comment-start "%") (setq comment-end "") (setq comment-multi-line nil) + ;; We use `back-to-indentation' but \f is no indentation sign. + (modify-syntax-entry ?\f "_ ") + (make-local-variable 'parse-sexp-ignore-comments) (setq parse-sexp-ignore-comments t) @@ -1100,5 +1103,5 @@ Turning on MetaPost mode calls the value of the variable (provide 'meta-mode) (run-hooks 'meta-mode-load-hook) -;;; arch-tag: ec2916b2-3a83-4cf7-962d-d8019370c006 +;; arch-tag: ec2916b2-3a83-4cf7-962d-d8019370c006 ;;; meta-mode.el ends here diff --git a/lisp/progmodes/octave-inf.el b/lisp/progmodes/octave-inf.el index 83d99ab8bee..7620649981c 100644 --- a/lisp/progmodes/octave-inf.el +++ b/lisp/progmodes/octave-inf.el @@ -153,10 +153,11 @@ Entry to this mode successively runs the hooks `comint-mode-hook' and (setq comint-input-ring-file-name (or (getenv "OCTAVE_HISTFILE") "~/.octave_hist") - comint-input-ring-size (or (getenv "OCTAVE_HISTSIZE") 1024) - comint-input-filter-functions '(inferior-octave-directory-tracker)) + comint-input-ring-size (or (getenv "OCTAVE_HISTSIZE") 1024)) (set (make-local-variable 'comint-dynamic-complete-functions) inferior-octave-dynamic-complete-functions) + (add-hook 'comint-input-filter-functions + 'inferior-octave-directory-tracker nil t) (comint-read-input-ring t) (run-mode-hooks 'inferior-octave-mode-hook)) diff --git a/lisp/progmodes/octave-mod.el b/lisp/progmodes/octave-mod.el index 3da3434cda2..4630fe1856d 100644 --- a/lisp/progmodes/octave-mod.el +++ b/lisp/progmodes/octave-mod.el @@ -63,7 +63,7 @@ All Octave abbrevs start with a grave accent (`).") (unless octave-abbrev-table (define-abbrev-table 'octave-abbrev-table ())) -(let ((ac abbrevs-changed)) +(let ((abbrevs-changed abbrevs-changed)) (define-abbrev octave-abbrev-table "`a" "all_va_args" nil 0 t) (define-abbrev octave-abbrev-table "`b" "break" nil 0 t) (define-abbrev octave-abbrev-table "`cs" "case" nil 0 t) @@ -89,10 +89,10 @@ All Octave abbrevs start with a grave accent (`).") (define-abbrev octave-abbrev-table "`r" "return" nil 0 t) (define-abbrev octave-abbrev-table "`s" "switch" nil 0 t) (define-abbrev octave-abbrev-table "`t" "try" nil 0 t) + (define-abbrev octave-abbrev-table "`u" "until ()" nil 0 t) (define-abbrev octave-abbrev-table "`up" "unwind_protect" nil 0 t) (define-abbrev octave-abbrev-table "`upc" "unwind_protect_cleanup" nil 0 t) - (define-abbrev octave-abbrev-table "`w" "while ()" nil 0 t) - (setq abbrevs-changed ac)) + (define-abbrev octave-abbrev-table "`w" "while ()" nil 0 t)) (defvar octave-comment-char ?# "Character to start an Octave comment.") @@ -103,32 +103,34 @@ All Octave abbrevs start with a grave accent (`).") "Regexp to match the start of an Octave comment up to its body.") (defvar octave-begin-keywords - '("for" "function" "if" "switch" "try" "unwind_protect" "while")) + '("do" "for" "function" "if" "switch" "try" "unwind_protect" "while")) (defvar octave-else-keywords '("case" "catch" "else" "elseif" "otherwise" "unwind_protect_cleanup")) +;; FIXME: only use specific "end" tokens here to avoid confusion when "end" +;; is used in indexing (the real fix is much more complex). (defvar octave-end-keywords - '("end" "endfor" "endfunction" "endif" "endswitch" "end_try_catch" - "end_unwind_protect" "endwhile")) + '("endfor" "endfunction" "endif" "endswitch" "end_try_catch" + "end_unwind_protect" "endwhile" "until")) (defvar octave-reserved-words (append octave-begin-keywords octave-else-keywords octave-end-keywords - '("all_va_args" "break" "continue" "global" "gplot" "gsplot" - "replot" "return")) + '("break" "continue" "end" "global" "persistent" "return")) "Reserved words in Octave.") (defvar octave-text-functions '("casesen" "cd" "chdir" "clear" "diary" "dir" "document" "echo" - "edit_history" "format" "gset" "gshow" "help" "history" "hold" - "load" "ls" "more" "run_history" "save" "set" "show" "type" + "edit_history" "format" "help" "history" "hold" + "load" "ls" "more" "run_history" "save" "type" "which" "who" "whos") - "Text functions in Octave (these names are also reserved).") + "Text functions in Octave.") (defvar octave-variables - '("EDITOR" "EXEC_PATH" "F_DUPFD" "F_GETFD" "F_GETFL" "F_SETFD" - "F_SETFL" "I" "IMAGEPATH" "INFO_FILE" "INFO_PROGRAM" "Inf" "J" - "LOADPATH" "NaN" "OCTAVE_VERSION" "O_APPEND" "O_CREAT" "O_EXCL" + '("DEFAULT_EXEC_PATH" "DEFAULT_LOADPATH" + "EDITOR" "EXEC_PATH" "F_DUPFD" "F_GETFD" "F_GETFL" "F_SETFD" + "F_SETFL" "I" "IMAGE_PATH" "Inf" "J" + "NaN" "OCTAVE_VERSION" "O_APPEND" "O_CREAT" "O_EXCL" "O_NONBLOCK" "O_RDONLY" "O_RDWR" "O_TRUNC" "O_WRONLY" "PAGER" "PS1" "PS2" "PS4" "PWD" "SEEK_CUR" "SEEK_END" "SEEK_SET" "__F_DUPFD__" "__F_GETFD__" "__F_GETFL__" "__F_SETFD__" "__F_SETFL__" "__I__" @@ -136,29 +138,23 @@ All Octave abbrevs start with a grave accent (`).") "__O_CREAT__" "__O_EXCL__" "__O_NONBLOCK__" "__O_RDONLY__" "__O_RDWR__" "__O_TRUNC__" "__O_WRONLY__" "__PWD__" "__SEEK_CUR__" "__SEEK_END__" "__SEEK_SET__" "__argv__" "__e__" "__eps__" - "__error_text__" "__i__" "__inf__" "__j__" "__nan__" "__pi__" + "__i__" "__inf__" "__j__" "__nan__" "__pi__" "__program_invocation_name__" "__program_name__" "__realmax__" "__realmin__" "__stderr__" "__stdin__" "__stdout__" "ans" "argv" - "automatic_replot" "beep_on_error" "completion_append_char" - "default_return_value" "default_save_format" - "define_all_return_values" "do_fortran_indexing" "e" - "echo_executing_commands" "empty_list_elements_ok" "eps" - "error_text" "gnuplot_binary" "gnuplot_has_multiplot" "history_file" - "history_size" "ignore_function_time_stamp" "implicit_str_to_num_ok" - "inf" "nan" "nargin" "ok_to_lose_imaginary_part" - "output_max_field_width" "output_precision" + "beep_on_error" "completion_append_char" + "crash_dumps_octave_core" "default_save_format" + "e" "echo_executing_commands" "eps" + "error_text" "gnuplot_binary" "history_file" + "history_size" "ignore_function_time_stamp" + "inf" "nan" "nargin" "output_max_field_width" "output_precision" "page_output_immediately" "page_screen_output" "pi" - "prefer_column_vectors" "prefer_zero_one_indexing" "print_answer_id_name" "print_empty_dimensions" - "program_invocation_name" "program_name" "propagate_empty_matrices" - "realmax" "realmin" "resize_on_range_error" - "return_last_computed_value" "save_precision" "saving_history" + "program_invocation_name" "program_name" + "realmax" "realmin" "return_last_computed_value" "save_precision" + "saving_history" "sighup_dumps_octave_core" "sigterm_dumps_octave_core" "silent_functions" "split_long_rows" "stderr" "stdin" "stdout" "string_fill_char" "struct_levels_to_print" - "suppress_verbose_help_message" "treat_neg_dim_as_zero" - "warn_assign_as_truth_value" "warn_comma_in_global_decl" - "warn_divide_by_zero" "warn_function_name_clash" - "warn_missing_semicolon" "whitespace_in_literal_matrix") + "suppress_verbose_help_message") "Builtin variables in Octave.") (defvar octave-function-header-regexp @@ -193,22 +189,18 @@ parenthetical grouping.") "Additional Octave expressions to highlight.") (defcustom inferior-octave-buffer "*Inferior Octave*" - "*Name of buffer for running an inferior Octave process." + "Name of buffer for running an inferior Octave process." :type 'string :group 'octave-inferior) (defvar inferior-octave-process nil) -(defvar octave-mode-map nil - "Keymap used in Octave mode.") -(if octave-mode-map - () +(defvar octave-mode-map (let ((map (make-sparse-keymap))) (define-key map "`" 'octave-abbrev-start) (define-key map ";" 'octave-electric-semi) (define-key map " " 'octave-electric-space) (define-key map "\n" 'octave-reindent-then-newline-and-indent) - (define-key map "\t" 'indent-according-to-mode) (define-key map "\e;" 'octave-indent-for-comment) (define-key map "\e\n" 'octave-indent-new-comment-line) (define-key map "\e\t" 'octave-complete-symbol) @@ -245,49 +237,51 @@ parenthetical grouping.") (define-key map "\C-c\C-i\C-s" 'octave-show-process-buffer) (define-key map "\C-c\C-i\C-h" 'octave-hide-process-buffer) (define-key map "\C-c\C-i\C-k" 'octave-kill-process) - (setq octave-mode-map map))) + map) + "Keymap used in Octave mode.") + (defvar octave-mode-menu - (list "Octave" - (list "Lines" - ["Previous Code Line" octave-previous-code-line t] - ["Next Code Line" octave-next-code-line t] - ["Begin of Continuation" octave-beginning-of-line t] - ["End of Continuation" octave-end-of-line t] - ["Split Line at Point" octave-indent-new-comment-line t]) - (list "Blocks" - ["Next Block" octave-forward-block t] - ["Previous Block" octave-backward-block t] - ["Down Block" octave-down-block t] - ["Up Block" octave-backward-up-block t] - ["Mark Block" octave-mark-block t] - ["Close Block" octave-close-block t]) - (list "Functions" - ["Begin of Function" octave-beginning-of-defun t] - ["End of Function" octave-end-of-defun t] - ["Mark Function" octave-mark-defun t] - ["Indent Function" octave-indent-defun t] - ["Insert Function" octave-insert-defun t]) - "-" - (list "Debug" - ["Send Current Line" octave-send-line t] - ["Send Current Block" octave-send-block t] - ["Send Current Function" octave-send-defun t] - ["Send Region" octave-send-region t] - ["Show Process Buffer" octave-show-process-buffer t] - ["Hide Process Buffer" octave-hide-process-buffer t] - ["Kill Process" octave-kill-process t]) - "-" - ["Indent Line" indent-according-to-mode t] - ["Complete Symbol" octave-complete-symbol t] - "-" - ["Toggle Abbrev Mode" abbrev-mode t] - ["Toggle Auto-Fill Mode" auto-fill-mode t] - "-" - ["Submit Bug Report" octave-submit-bug-report t] - "-" - ["Describe Octave Mode" octave-describe-major-mode t] - ["Lookup Octave Index" octave-help t]) + '("Octave" + '("Lines" + ["Previous Code Line" octave-previous-code-line t] + ["Next Code Line" octave-next-code-line t] + ["Begin of Continuation" octave-beginning-of-line t] + ["End of Continuation" octave-end-of-line t] + ["Split Line at Point" octave-indent-new-comment-line t]) + '("Blocks" + ["Next Block" octave-forward-block t] + ["Previous Block" octave-backward-block t] + ["Down Block" octave-down-block t] + ["Up Block" octave-backward-up-block t] + ["Mark Block" octave-mark-block t] + ["Close Block" octave-close-block t]) + '("Functions" + ["Begin of Function" octave-beginning-of-defun t] + ["End of Function" octave-end-of-defun t] + ["Mark Function" octave-mark-defun t] + ["Indent Function" octave-indent-defun t] + ["Insert Function" octave-insert-defun t]) + "-" + '("Debug" + ["Send Current Line" octave-send-line t] + ["Send Current Block" octave-send-block t] + ["Send Current Function" octave-send-defun t] + ["Send Region" octave-send-region t] + ["Show Process Buffer" octave-show-process-buffer t] + ["Hide Process Buffer" octave-hide-process-buffer t] + ["Kill Process" octave-kill-process t]) + "-" + ["Indent Line" indent-according-to-mode t] + ["Complete Symbol" octave-complete-symbol t] + "-" + ["Toggle Abbrev Mode" abbrev-mode t] + ["Toggle Auto-Fill Mode" auto-fill-mode t] + "-" + ["Submit Bug Report" octave-submit-bug-report t] + "-" + ["Describe Octave Mode" octave-describe-major-mode t] + ["Lookup Octave Index" octave-help t]) "Menu for Octave mode.") (defvar octave-mode-syntax-table @@ -316,23 +310,23 @@ parenthetical grouping.") "Syntax table in use in `octave-mode' buffers.") (defcustom octave-auto-indent nil - "*Non-nil means indent line after a semicolon or space in Octave mode." + "Non-nil means indent line after a semicolon or space in Octave mode." :type 'boolean :group 'octave) (defcustom octave-auto-newline nil - "*Non-nil means automatically newline after a semicolon in Octave mode." + "Non-nil means automatically newline after a semicolon in Octave mode." :type 'boolean :group 'octave) (defcustom octave-blink-matching-block t - "*Control the blinking of matching Octave block keywords. + "Control the blinking of matching Octave block keywords. Non-nil means show matching begin of block when inserting a space, newline or semicolon after an else or end keyword." :type 'boolean :group 'octave) (defcustom octave-block-offset 2 - "*Extra indentation applied to statements in Octave block structures." + "Extra indentation applied to statements in Octave block structures." :type 'integer :group 'octave) @@ -352,15 +346,17 @@ newline or semicolon after an else or end keyword." (concat octave-block-begin-regexp "\\|" octave-block-end-regexp)) (defvar octave-block-else-or-end-regexp (concat octave-block-else-regexp "\\|" octave-block-end-regexp)) +;; FIXME: only use specific "end" tokens here to avoid confusion when "end" +;; is used in indexing (the real fix is much more complex). (defvar octave-block-match-alist - '(("for" . ("end" "endfor")) - ("function" . ("end" "endfunction")) - ("if" . ("else" "elseif" "end" "endif")) - ("switch" . ("case" "otherwise" "end" "endswitch")) - ("try" . ("catch" "end" "end_try_catch")) - ("unwind_protect" . ("unwind_protect_cleanup" "end" - "end_unwind_protect")) - ("while" . ("end" "endwhile"))) + '(("do" . ("until")) + ("for" . ("endfor")) + ("function" . ("endfunction")) + ("if" . ("else" "elseif" "endif")) + ("switch" . ("case" "otherwise" "endswitch")) + ("try" . ("catch" "end_try_catch")) + ("unwind_protect" . ("unwind_protect_cleanup" "end_unwind_protect")) + ("while" . ("endwhile"))) "Alist with Octave's matching block keywords. Has Octave's begin keywords as keys and a list of the matching else or end keywords as associated values.") @@ -370,13 +366,13 @@ end keywords as associated values.") "String to insert to start a new Octave comment on an empty line.") (defcustom octave-continuation-offset 4 - "*Extra indentation applied to Octave continuation lines." + "Extra indentation applied to Octave continuation lines." :type 'integer :group 'octave) (defvar octave-continuation-regexp "[^#%\n]*\\(\\\\\\|\\.\\.\\.\\)\\s-*\\(\\s<.*\\)?$") (defcustom octave-continuation-string "\\" - "*Character string used for Octave continuation lines. Normally \\." + "Character string used for Octave continuation lines. Normally \\." :type 'string :group 'octave) @@ -392,27 +388,22 @@ Currently, only builtin variables can be completed.") (list nil octave-function-header-regexp 3)) "Imenu expression for Octave mode. See `imenu-generic-expression'.") -(defcustom octave-mode-startup-message t - "*nil means do not display the Octave mode startup message." - :type 'boolean - :group 'octave) - (defcustom octave-mode-hook nil - "*Hook to be run when Octave mode is started." + "Hook to be run when Octave mode is started." :type 'hook :group 'octave) (defcustom octave-send-show-buffer t - "*Non-nil means display `inferior-octave-buffer' after sending to it." + "Non-nil means display `inferior-octave-buffer' after sending to it." :type 'boolean :group 'octave) (defcustom octave-send-line-auto-forward t - "*Control auto-forward after sending to the inferior Octave process. + "Control auto-forward after sending to the inferior Octave process. Non-nil means always go to the next Octave code line after sending." :type 'boolean :group 'octave) (defcustom octave-send-echo-input t - "*Non-nil means echo input sent to the inferior Octave process." + "Non-nil means echo input sent to the inferior Octave process." :type 'boolean :group 'octave) @@ -423,7 +414,7 @@ Non-nil means always go to the next Octave code line after sending." This mode makes it easier to write Octave code by helping with indentation, doing some of the typing for you (with Abbrev mode) and by -showing keywords, comments, strings, etc. in different faces (with +showing keywords, comments, strings, etc.. in different faces (with Font Lock mode on terminals that support it). Octave itself is a high-level language, primarily intended for numerical @@ -433,7 +424,7 @@ can also be stored in files, and it can be used in a batch mode (which is why you need this mode!). The latest released version of Octave is always available via anonymous -ftp from bevo.che.wisc.edu in the directory `/pub/octave'. Complete +ftp from ftp.octave.org in the directory `/pub/octave'. Complete source and binaries for several popular systems are available. Type \\[list-abbrevs] to display the built-in abbrevs for Octave keywords. @@ -446,43 +437,39 @@ Keybindings Variables you can use to customize Octave mode ============================================== -octave-auto-indent +`octave-auto-indent' Non-nil means indent current line after a semicolon or space. Default is nil. -octave-auto-newline +`octave-auto-newline' Non-nil means auto-insert a newline and indent after a semicolon. Default is nil. -octave-blink-matching-block +`octave-blink-matching-block' Non-nil means show matching begin of block when inserting a space, newline or semicolon after an else or end keyword. Default is t. -octave-block-offset +`octave-block-offset' Extra indentation applied to statements in block structures. Default is 2. -octave-continuation-offset +`octave-continuation-offset' Extra indentation applied to Octave continuation lines. Default is 4. -octave-continuation-string +`octave-continuation-string' String used for Octave continuation lines. Default is a backslash. -octave-mode-startup-message - nil means do not display the Octave mode startup message. - Default is t. - -octave-send-echo-input +`octave-send-echo-input' Non-nil means always display `inferior-octave-buffer' after sending a command to the inferior Octave process. -octave-send-line-auto-forward +`octave-send-line-auto-forward' Non-nil means always go to the next unsent line of Octave code after sending a line to the inferior Octave process. -octave-send-echo-input +`octave-send-echo-input' Non-nil means echo input sent to the inferior Octave process. Turning on Octave mode runs the hook `octave-mode-hook'. @@ -490,19 +477,15 @@ Turning on Octave mode runs the hook `octave-mode-hook'. To begin using this mode for all `.m' files that you edit, add the following lines to your `.emacs' file: - (autoload 'octave-mode \"octave-mod\" nil t) - (setq auto-mode-alist - (cons '(\"\\\\.m$\" . octave-mode) auto-mode-alist)) + (add-to-list 'auto-mode-alist '(\"\\\\.m\\\\'\" . octave-mode)) -To automatically turn on the abbrev, auto-fill and font-lock features, +To automatically turn on the abbrev and auto-fill features, add the following lines to your `.emacs' file as well: (add-hook 'octave-mode-hook (lambda () (abbrev-mode 1) - (auto-fill-mode 1) - (if (eq window-system 'x) - (font-lock-mode 1)))) + (auto-fill-mode 1))) To submit a problem report, enter \\[octave-submit-bug-report] from \ an Octave mode buffer. @@ -773,7 +756,7 @@ The new line is properly indented." (octave-reindent-then-newline-and-indent)))) (defun octave-indent-defun () - "Properly indents the Octave function which contains point." + "Properly indent the Octave function which contains point." (interactive) (save-excursion (octave-mark-defun) @@ -856,8 +839,8 @@ does not end in `...' or `\\' or is inside an open parenthesis list." (zerop (forward-line 1))))) (end-of-line))) -(defun octave-scan-blocks (from count depth) - "Scan from character number FROM by COUNT Octave begin-end blocks. +(defun octave-scan-blocks (count depth) + "Scan from point by COUNT Octave begin-end blocks. Returns the character number of the position thus found. If DEPTH is nonzero, block depth begins counting from that value. @@ -895,7 +878,7 @@ With argument, do it that many times. Negative arg -N means move backward across N blocks." (interactive "p") (or arg (setq arg 1)) - (goto-char (or (octave-scan-blocks (point) arg 0) (buffer-end arg)))) + (goto-char (or (octave-scan-blocks arg 0) (buffer-end arg)))) (defun octave-backward-block (&optional arg) "Move backward across one balanced Octave begin-end block. @@ -913,7 +896,7 @@ In Lisp programs, an argument is required." (interactive "p") (let ((inc (if (> arg 0) 1 -1))) (while (/= arg 0) - (goto-char (or (octave-scan-blocks (point) inc -1) + (goto-char (or (octave-scan-blocks inc -1) (buffer-end arg))) (setq arg (- arg inc))))) @@ -933,7 +916,7 @@ In Lisp programs, an argument is required." (interactive "p") (let ((inc (if (> arg 0) 1 -1))) (while (/= arg 0) - (goto-char (or (octave-scan-blocks (point) inc 1) + (goto-char (or (octave-scan-blocks inc 1) (buffer-end arg))) (setq arg (- arg inc))))) @@ -1149,6 +1132,8 @@ otherwise." (defun octave-fill-paragraph (&optional arg) "Fill paragraph of Octave code, handling Octave comments." + ;; FIXME: now that the default fill-paragraph takes care of similar issues, + ;; this seems obsolete. --Stef (interactive "P") (save-excursion (let ((end (progn (forward-paragraph) (point))) @@ -1389,7 +1374,7 @@ entered without parens)." ;;; Menu (defun octave-add-octave-menu () - "Adds the `Octave' menu to the menu bar in Octave mode." + "Add the `Octave' menu to the menu bar in Octave mode." (require 'easymenu) (easy-menu-define octave-mode-menu-map octave-mode-map "Menu keymap for Octave mode." octave-mode-menu) @@ -1519,7 +1504,6 @@ code line." 'octave-continuation-offset 'octave-continuation-string 'octave-help-files - 'octave-mode-startup-message 'octave-send-echo-input 'octave-send-line-auto-forward 'octave-send-show-buffer)))) @@ -1528,5 +1512,5 @@ code line." (provide 'octave-mod) -;;; arch-tag: 05f1ce09-be87-4c00-803e-4919ffa26c23 +;; arch-tag: 05f1ce09-be87-4c00-803e-4919ffa26c23 ;;; octave-mod.el ends here diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 462445f3d71..f1d6d02020b 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -1,4 +1,4 @@ -;;; python.el --- silly walks for Python +;;; python.el --- silly walks for Python -*- coding: iso-8859-1 -*- ;; Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. @@ -89,17 +89,17 @@ (defvar python-font-lock-keywords `(,(rx symbol-start - ;; From v 2.4 reference. + ;; From v 2.5 reference, § keywords. ;; def and class dealt with separately below - (or "and" "assert" "break" "continue" "del" "elif" "else" + (or "and" "as" "assert" "break" "continue" "del" "elif" "else" "except" "exec" "finally" "for" "from" "global" "if" "import" "in" "is" "lambda" "not" "or" "pass" "print" - "raise" "return" "try" "while" "yield" - ;; Future keywords - "as" "None" "with" + "raise" "return" "try" "while" "with" "yield" ;; Not real keywords, but close enough to be fontified as such "self" "True" "False") symbol-end) + (,(rx symbol-start "None" symbol-end) ; See § Keywords in 2.5 manual. + . font-lock-constant-face) ;; Definitions (,(rx symbol-start (group "class") (1+ space) (group (1+ (or word ?_)))) (1 font-lock-keyword-face) (2 font-lock-type-face)) @@ -151,7 +151,8 @@ Used for syntactic keywords. N is the match number (1, 2 or 3)." (cond ;; Consider property for the last char if in a fenced string. ((= n 3) - (let ((syntax (syntax-ppss))) + (let* ((font-lock-syntactic-keywords nil) + (syntax (syntax-ppss))) (when (eq t (nth 3 syntax)) ; after unclosed fence (goto-char (nth 8 syntax)) ; fence position (skip-chars-forward "uUrR") ; skip any prefix @@ -163,8 +164,9 @@ Used for syntactic keywords. N is the match number (1, 2 or 3)." (= (match-beginning 1) (match-end 1))) ; prefix is null (and (= n 1) ; prefix (/= (match-beginning 1) (match-end 1)))) ; non-empty - (unless (nth 3 (syntax-ppss)) - (eval-when-compile (string-to-syntax "|")))) + (let ((font-lock-syntactic-keywords nil)) + (unless (nth 3 (syntax-ppss)) + (eval-when-compile (string-to-syntax "|"))))) ;; Otherwise (we're in a non-matching string) the property is ;; nil, which is OK. ))) @@ -348,7 +350,7 @@ comments and strings, or that point is within brackets/parens." (error nil)))))))) (defun python-comment-line-p () - "Return non-nil if current line has only a comment." + "Return non-nil iff current line has only a comment." (save-excursion (end-of-line) (when (eq 'comment (syntax-ppss-context (syntax-ppss))) @@ -356,7 +358,7 @@ comments and strings, or that point is within brackets/parens." (looking-at (rx (or (syntax comment-start) line-end)))))) (defun python-blank-line-p () - "Return non-nil if current line is blank." + "Return non-nil iff current line is blank." (save-excursion (beginning-of-line) (looking-at "\\s-*$"))) @@ -850,7 +852,7 @@ multi-line bracketed expressions." "Skip out of any nested brackets. Skip forward if FORWARD is non-nil, else backward. If SYNTAX is non-nil it is the state returned by `syntax-ppss' at point. -Return non-nil if skipping was done." +Return non-nil iff skipping was done." (let ((depth (syntax-ppss-depth (or syntax (syntax-ppss)))) (forward (if forward -1 1))) (unless (zerop depth) @@ -1083,13 +1085,15 @@ just insert a single colon." (defun python-backspace (arg) "Maybe delete a level of indentation on the current line. -Do so if point is at the end of the line's indentation. +Do so if point is at the end of the line's indentation outside +strings and comments. Otherwise just call `backward-delete-char-untabify'. Repeat ARG times." (interactive "*p") (if (or (/= (current-indentation) (current-column)) (bolp) - (python-continuation-line-p)) + (python-continuation-line-p) + (python-in-string/comment)) (backward-delete-char-untabify arg) ;; Look for the largest valid indentation which is smaller than ;; the current indentation. @@ -1190,6 +1194,10 @@ local value.") 1 2) (,(rx " in file " (group (1+ not-newline)) " on line " (group (1+ digit))) + 1 2) + ;; pdb stack trace + (,(rx line-start "> " (group (1+ (not (any "(\"<")))) + "(" (group (1+ digit)) ")" (1+ (not (any "("))) "()") 1 2)) "`compilation-error-regexp-alist' for inferior Python.") @@ -1199,7 +1207,7 @@ local value.") (define-key map "\C-c\C-l" 'python-load-file) (define-key map "\C-c\C-v" 'python-check) ;; Note that we _can_ still use these commands which send to the - ;; Python process even at the prompt provided we have a normal prompt, + ;; Python process even at the prompt iff we have a normal prompt, ;; i.e. '>>> ' and not '... '. See the comment before ;; python-send-region. Fixme: uncomment these if we address that. @@ -1245,7 +1253,7 @@ For running multiple processes in multiple buffers, see `run-python' and ;; Still required by `comint-redirect-send-command', for instance ;; (and we need to match things like `>>> ... >>> '): (set (make-local-variable 'comint-prompt-regexp) - (rx line-start (1+ (and (repeat 3 (any ">.")) " ")))) + (rx line-start (1+ (and (or (repeat 3 (any ">.")) "(Pdb)") " ")))) (set (make-local-variable 'compilation-error-regexp-alist) python-compilation-regexp-alist) (compilation-shell-minor-mode 1)) @@ -1375,7 +1383,7 @@ buffer for a list of commands.)" ;; seems worth putting in a separate file, and it's probably cleaner ;; to put it in a module. ;; Ensure we're at a prompt before doing anything else. - (python-send-receive "import emacs; print '_emacs_out ()'"))) + (python-send-string "import emacs"))) (if (derived-mode-p 'python-mode) (setq python-buffer (default-value 'python-buffer))) ; buffer-local ;; Without this, help output goes into the inferior python buffer if @@ -1620,7 +1628,7 @@ The result is what follows `_emacs_out' in the output." ;; Fixme: Is there anything reasonable we can do with random methods? ;; (Currently only works with functions.) (defun python-eldoc-function () - "`eldoc-print-current-symbol-info' for Python. + "`eldoc-documentation-function' for Python. Only works when point is in a function name, not its arg list, for instance. Assumes an inferior Python is running." (let ((symbol (with-syntax-table python-dotty-syntax-table @@ -1737,47 +1745,57 @@ The criterion is either a match for `jython-mode' via (jython-mode))))))) (defun python-fill-paragraph (&optional justify) - "`fill-paragraph-function' handling comments and multi-line strings. -If any of the current line is a comment, fill the comment or the -paragraph of it that point is in, preserving the comment's -indentation and initial comment characters. Similarly if the end -of the current line is in or at the end of a multi-line string. -Otherwise, do nothing." + "`fill-paragraph-function' handling multi-line strings and possibly comments. +If any of the current line is in or at the end of a multi-line string, +fill the string or the paragraph of it that point is in, preserving +the strings's indentation." (interactive "P") (or (fill-comment-paragraph justify) - ;; The `paragraph-start' and `paragraph-separate' variables - ;; don't allow us to delimit the last paragraph in a multi-line - ;; string properly, so narrow to the string and then fill around - ;; (the end of) the current line. (save-excursion (end-of-line) (let* ((syntax (syntax-ppss)) (orig (point)) - (start (nth 8 syntax)) - end) - (cond ((eq t (nth 3 syntax)) ; in fenced string - (goto-char (nth 8 syntax)) ; string start + start end) + (cond ((nth 4 syntax) ; comment. fixme: loses with trailing one + (let (fill-paragraph-function) + (fill-paragraph justify))) + ;; The `paragraph-start' and `paragraph-separate' + ;; variables don't allow us to delimit the last + ;; paragraph in a multi-line string properly, so narrow + ;; to the string and then fill around (the end of) the + ;; current line. + ((eq t (nth 3 syntax)) ; in fenced string + (goto-char (nth 8 syntax)) ; string start + (setq start (line-beginning-position)) (setq end (condition-case () ; for unbalanced quotes - (progn (forward-sexp) (point)) + (progn (forward-sexp) + (- (point) 3)) (error (point-max))))) - ((re-search-backward "\\s|\\s-*\\=" nil t) ; end of fenced - ; string + ((re-search-backward "\\s|\\s-*\\=" nil t) ; end of fenced string (forward-char) (setq end (point)) (condition-case () (progn (backward-sexp) - (setq start (point))) - (error (setq end nil))))) + (setq start (line-beginning-position))) + (error nil)))) (when end (save-restriction (narrow-to-region start end) (goto-char orig) - (let ((paragraph-separate - ;; Make sure that fenced-string delimiters that stand - ;; on their own line stay there. - (concat "[ \t]*['\"]+[ \t]*$\\|" paragraph-separate))) - (fill-paragraph justify)))))) - t)) + ;; Avoid losing leading and trailing newlines in doc + ;; strings written like: + ;; """ + ;; ... + ;; """ + (let* ((paragraph-separate + (concat ".*\\s|\"\"$" ; newline after opening quotes + "\\|\\(?:" paragraph-separate "\\)")) + (paragraph-start + (concat ".*\\s|\"\"[ \t]*[^ \t].*" ; not newline after + ; opening quotes + "\\|\\(?:" paragraph-separate "\\)")) + (fill-paragraph-function)) + (fill-paragraph justify))))))) t) (defun python-shift-left (start end &optional count) "Shift lines in region COUNT (the prefix arg) columns to the left. @@ -1886,9 +1904,12 @@ Uses `python-beginning-of-block', `python-end-of-block'." (goto-char (point-min)) (while (re-search-forward "^import\\>\\|^from\\>" nil t) (unless (syntax-ppss-context (syntax-ppss)) - (push (buffer-substring (line-beginning-position) - (line-beginning-position 2)) - lines))) + (let ((start (line-beginning-position))) + ;; Skip over continued lines. + (while (and (eq ?\\ (char-before (line-end-position))) + (= 0 (forward-line 1)))) + (push (buffer-substring start (line-beginning-position 2)) + lines)))) (setq python-imports (if lines (apply #'concat @@ -2280,7 +2301,7 @@ with skeleton expansions for compound statement templates. ;; since it isn't (can't be) indentation-based. Also hide-level ;; doesn't seem to work properly. (add-to-list 'hs-special-modes-alist - `(python-mode "^\\s-*def\\>" nil "#" + `(python-mode "^\\s-*\\(?:def\\|class\\)\\>" nil "#" ,(lambda (arg) (python-end-of-defun) (skip-chars-backward " \t\n")) diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index f9b7e18d467..e9d9247d7cb 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -1029,7 +1029,7 @@ subshells can nest." (t (error "Internal error in sh-font-lock-quoted-subshell"))) (forward-char 1))) t)) - + (defun sh-is-quoted-p (pos) (and (eq (char-before pos) ?\\) @@ -1192,7 +1192,7 @@ This value is used for the `+' and `-' symbols in an indentation variable." nil means leave it as it is; t means indent it as a normal line, aligning it to previous non-blank non-comment line; -a number means align to that column, e.g. 0 means fist column." +a number means align to that column, e.g. 0 means first column." :type '(choice (const :tag "Leave as is." nil) (const :tag "Indent as a normal line." t) @@ -1906,14 +1906,14 @@ variable `sh-make-vars-local' has been set to nil. To revert all these variables to the global values, use command `sh-reset-indent-vars-to-global-values'." (interactive) - (mapcar 'make-local-variable sh-var-list) + (mapc 'make-local-variable sh-var-list) (message "Indentation variables are now local.")) (defun sh-reset-indent-vars-to-global-values () "Reset local indentation variables to the global values. Then, if variable `sh-make-vars-local' is non-nil, make them local." (interactive) - (mapcar 'kill-local-variable sh-var-list) + (mapc 'kill-local-variable sh-var-list) (if sh-make-vars-local (mapcar 'make-local-variable sh-var-list))) diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el index 1187129bb33..a03b58b466c 100644 --- a/lisp/progmodes/sql.el +++ b/lisp/progmodes/sql.el @@ -863,7 +863,7 @@ Based on `comint-mode-map'.") (unless sql-mode-abbrev-table (define-abbrev-table 'sql-mode-abbrev-table nil)) -(mapcar +(mapc ;; In Emacs 22+, provide SYSTEM-FLAG to define-abbrev. '(lambda (abbrev) (let ((name (car abbrev)) diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el index 0d909a4a3ff..60d30eb8a6d 100644 --- a/lisp/progmodes/vhdl-mode.el +++ b/lisp/progmodes/vhdl-mode.el @@ -2811,7 +2811,7 @@ STRING are replaced by `-' and substrings are converted to lower case." ;; set up electric character functions to work with ;; `delete-selection-mode' (Emacs) and `pending-delete-mode' (XEmacs) -(mapcar +(mapc (function (lambda (sym) (put sym 'delete-selection t) ; for `delete-selection-mode' (Emacs) @@ -5296,7 +5296,7 @@ argument. The styles are chosen from the `vhdl-style-alist' variable." (or vars (error "ERROR: Invalid VHDL indentation style `%s'" style)) ;; set all the variables - (mapcar + (mapc (function (lambda (varentry) (let ((var (car varentry)) @@ -7148,7 +7148,7 @@ ENDPOS is encountered." (actual (vhdl-get-syntactic-context)) (expurgated)) ;; remove the library unit symbols - (mapcar + (mapc (function (lambda (elt) (if (memq (car elt) '(entity configuration package diff --git a/lisp/progmodes/which-func.el b/lisp/progmodes/which-func.el index 5307445dc04..577ad024a2b 100644 --- a/lisp/progmodes/which-func.el +++ b/lisp/progmodes/which-func.el @@ -77,7 +77,8 @@ (defcustom which-func-modes '(emacs-lisp-mode c-mode c++-mode perl-mode cperl-mode python-mode - makefile-mode sh-mode fortran-mode f90-mode ada-mode) + makefile-mode sh-mode fortran-mode f90-mode ada-mode + diff-mode) "List of major modes for which Which Function mode should be used. For other modes it is disabled. If this is equal to t, then Which Function mode is enabled in any major mode that supports it." diff --git a/lisp/progmodes/xscheme.el b/lisp/progmodes/xscheme.el index a820ca4cede..f437bb7da37 100644 --- a/lisp/progmodes/xscheme.el +++ b/lisp/progmodes/xscheme.el @@ -101,17 +101,17 @@ from being inserted into the process-buffer.") (setq-default scheme-mode-line-process '("" xscheme-runlight)) -(mapcar 'make-variable-buffer-local - '(xscheme-expressions-ring - xscheme-expressions-ring-yank-pointer - xscheme-process-filter-state - xscheme-running-p - xscheme-control-g-disabled-p - xscheme-allow-output-p - xscheme-prompt - xscheme-string-accumulator - xscheme-mode-string - scheme-mode-line-process)) +(mapc 'make-variable-buffer-local + '(xscheme-expressions-ring + xscheme-expressions-ring-yank-pointer + xscheme-process-filter-state + xscheme-running-p + xscheme-control-g-disabled-p + xscheme-allow-output-p + xscheme-prompt + xscheme-string-accumulator + xscheme-mode-string + scheme-mode-line-process)) (defgroup xscheme nil "Major mode for editing Scheme and interacting with MIT's C-Scheme." diff --git a/lisp/term/AT386.el b/lisp/term/AT386.el index 8adb94c07ca..23dfd8e2b11 100644 --- a/lisp/term/AT386.el +++ b/lisp/term/AT386.el @@ -29,34 +29,34 @@ ;;; Code: -(if (boundp 'AT386-keypad-map) - nil - ;; The terminal initialization should already have set up some keys - (setq AT386-keypad-map (lookup-key function-key-map "\e[")) - (if (not (keymapp AT386-keypad-map)) - (error "What? Your AT386 termcap/terminfo has no keycaps in it")) - - ;; Equivalents of these are set up automatically by termcap/terminfo - ;; (define-key AT386-keypad-map "A" [up]) - ;; (define-key AT386-keypad-map "B" [down]) - ;; (define-key AT386-keypad-map "C" [right]) - ;; (define-key AT386-keypad-map "D" [left]) - - ;; These would be set up by terminfo, but not termcap - (define-key AT386-keypad-map "H" [home]) - (define-key AT386-keypad-map "Y" [end]) - (define-key AT386-keypad-map "U" [next]) ;; PgDn - (define-key AT386-keypad-map "V" [prior]) ;; PgUp - (define-key AT386-keypad-map "@" [insert]) ;; Ins key - - ;; These are not normally set up by either - (define-key AT386-keypad-map "G" [kp-5]) ;; Unlabeled center key - (define-key AT386-keypad-map "S" [kp-subtract]) - (define-key AT386-keypad-map "T" [kp-add]) - - ;; Arrange for the ALT key to be equivalent to ESC - (define-key function-key-map "\eN" [27]) ; ALT map - ) +(defun terminal-init-AT386 () + "Terminal initialization function for AT386." + (let ((AT386-keypad-map (lookup-key local-function-key-map "\e["))) + ;; The terminal initialization should already have set up some keys + (if (not (keymapp AT386-keypad-map)) + (error "What? Your AT386 termcap/terminfo has no keycaps in it")) + + ;; Equivalents of these are set up automatically by termcap/terminfo + ;; (define-key AT386-keypad-map "A" [up]) + ;; (define-key AT386-keypad-map "B" [down]) + ;; (define-key AT386-keypad-map "C" [right]) + ;; (define-key AT386-keypad-map "D" [left]) + + ;; These would be set up by terminfo, but not termcap + (define-key AT386-keypad-map "H" [home]) + (define-key AT386-keypad-map "Y" [end]) + (define-key AT386-keypad-map "U" [next]) ;; PgDn + (define-key AT386-keypad-map "V" [prior]) ;; PgUp + (define-key AT386-keypad-map "@" [insert]) ;; Ins key + + ;; These are not normally set up by either + (define-key AT386-keypad-map "G" [kp-5]) ;; Unlabeled center key + (define-key AT386-keypad-map "S" [kp-subtract]) + (define-key AT386-keypad-map "T" [kp-add]) + + ;; Arrange for the ALT key to be equivalent to ESC + (define-key local-function-key-map "\eN" [27]) ; ALT map + )) ;;; arch-tag: abec1b03-582f-49f8-b8cb-e2fd52ea4bd7 ;;; AT386.el ends here diff --git a/lisp/term/README b/lisp/term/README index e1cfbf15901..e5fb2da83ad 100644 --- a/lisp/term/README +++ b/lisp/term/README @@ -6,19 +6,43 @@ See the end of the file for license conditions. This directory contains files of elisp that customize Emacs for certain terminal types. - When Emacs starts, it checks the TERM environment variable to see what type -of terminal the user is running on, checks for an elisp file named -"term/${TERM}.el", and if one exists, loads it. If that doesn't yield a file -that exists, the last hyphen and what follows it is stripped. If that doesn't -yield a file that exists, the previous hyphen is stripped, and so on until all -hyphens are gone. For example, if the terminal type is `aaa-48-foo', Emacs -will try first `term/aaa-48-foo.el', then `term/aaa-48.el' and finally -`term/aaa.el'. Each terminal specific file should contain a function -named terminal-init-TERMINALNAME (eg terminal-init-aaa-48 for -term/aaa-48.el) that Emacs will call in order to initialize the -terminal. The terminal files should not contain any top level forms -that are executed when the file is loaded, all the initialization -actions are performed by the terminal-init-TERMINALNAME functions. + When Emacs opens a new terminal, it checks the TERM environment variable to +see what type of terminal the user is running on, searches for an elisp file +named "term/${TERM}.el", and if one exists, loads it. If Emacs finds no +suitable file, then it strips the last hyphen and what follows it from TERM, +and tries again. If that still doesn't yield a file, then the previous hyphen +is stripped, and so on until all hyphens are gone. For example, if the +terminal type is `aaa-48-foo', Emacs will try first `term/aaa-48-foo.el', then +`term/aaa-48.el' and finally `term/aaa.el'. Emacs stops searching at the +first file found, and will not load more than one file for any terminal. Note +that it is not an error if Emacs is unable to find a terminal initialization +file; in that case, it will simply proceed with the next step without loading +any files. + + Once the file has been loaded (or the search failed), Emacs tries to call a +function named `terminal-init-TERMINALNAME' (eg `terminal-init-aaa-48' for the +`aaa-48' terminal) in order to initialize the terminal. Once again, if the +function is not found, Emacs strips the last component of the name and tries +again using the shorter name. This search is independent of the previous file +search, so that you can have terminal initialization functions for a family of +terminals collected in a single file named after the family name, and users +may put terminal initialization functions directly in their .emacs files. + + Note that an individual terminal file is loaded only once in an Emacs +session; if the same terminal type is opened again, Emacs will simply call the +initialization function without reloading the file. Therefore, all the actual +initialization actions should be collected in terminal-init-* functions; the +file should not contain any top-level form that is not a function or variable +declaration. Simply loading the file should not have any side effect. + + Similarly, the terminal initialization function is called only once on any +given terminal, when the first frame is created on it. The function is not +called for subsequent frames on the same terminal. Therefore, terminal-init-* +functions should only modify terminal-local variables (such as +`local-function-key-map') and terminal parameters. For example, it is not +correct to modify frame parameters, since the modifications will only be +applied for the first frame opened on the terminal. + When writing terminal packages, there are some things it is good to keep in mind. diff --git a/lisp/term/apollo.el b/lisp/term/apollo.el index 749ff85a0a6..c47de919b0c 100644 --- a/lisp/term/apollo.el +++ b/lisp/term/apollo.el @@ -1,7 +1,7 @@ ;; -*- no-byte-compile: t -*- (defun terminal-init-apollo () - "Terminal initialization function for apollo." - (load "term/vt100" nil t)) + "Terminal initialization function for apollo." + (tty-run-terminal-initialization (selected-frame) "vt100")) ;;; arch-tag: c72f446f-e6b7-4749-90a4-bd68632adacf ;;; apollo.el ends here diff --git a/lisp/term/bobcat.el b/lisp/term/bobcat.el index 82401f7bf71..974476f6798 100644 --- a/lisp/term/bobcat.el +++ b/lisp/term/bobcat.el @@ -1,7 +1,7 @@ ;; -*- no-byte-compile: t -*- (defun terminal-init-bobcat () - "Terminal initialization function for bobcat." + "Terminal initialization function for bobcat." ;; HP terminals usually encourage using ^H as the rubout character (keyboard-translate ?\177 ?\^h) (keyboard-translate ?\^h ?\177)) diff --git a/lisp/term/cygwin.el b/lisp/term/cygwin.el index 3bdd5d3aa05..df857ba6625 100644 --- a/lisp/term/cygwin.el +++ b/lisp/term/cygwin.el @@ -3,7 +3,7 @@ ;;; The Cygwin terminal can't really display underlines. (defun terminal-init-cygwin () - "Terminal initialization function for cygwin." + "Terminal initialization function for cygwin." (tty-no-underline)) ;; arch-tag: ca81ce67-3c41-4883-a29b-4c3d64a21191 diff --git a/lisp/term/internal.el b/lisp/term/internal.el index 2db2cd93d4d..fb13f48d6ba 100644 --- a/lisp/term/internal.el +++ b/lisp/term/internal.el @@ -29,20 +29,20 @@ ;; --------------------------------------------------------------------------- ;; keyboard setup -- that's simple! (set-input-mode nil nil 0) -(define-key function-key-map [backspace] "\177") ; Normal behaviour for BS -(define-key function-key-map [delete] "\C-d") ; ... and Delete -(define-key function-key-map [tab] [?\t]) -(define-key function-key-map [linefeed] [?\n]) -(define-key function-key-map [clear] [11]) -(define-key function-key-map [return] [13]) -(define-key function-key-map [escape] [?\e]) -(define-key function-key-map [M-backspace] [?\M-\d]) -(define-key function-key-map [M-delete] [?\M-d]) -(define-key function-key-map [M-tab] [?\M-\t]) -(define-key function-key-map [M-linefeed] [?\M-\n]) -(define-key function-key-map [M-clear] [?\M-\013]) -(define-key function-key-map [M-return] [?\M-\015]) -(define-key function-key-map [M-escape] [?\M-\e]) +(define-key local-function-key-map [backspace] "\177") ; Normal behaviour for BS +(define-key local-function-key-map [delete] "\C-d") ; ... and Delete +(define-key local-function-key-map [tab] [?\t]) +(define-key local-function-key-map [linefeed] [?\n]) +(define-key local-function-key-map [clear] [11]) +(define-key local-function-key-map [return] [13]) +(define-key local-function-key-map [escape] [?\e]) +(define-key local-function-key-map [M-backspace] [?\M-\d]) +(define-key local-function-key-map [M-delete] [?\M-d]) +(define-key local-function-key-map [M-tab] [?\M-\t]) +(define-key local-function-key-map [M-linefeed] [?\M-\n]) +(define-key local-function-key-map [M-clear] [?\M-\013]) +(define-key local-function-key-map [M-return] [?\M-\015]) +(define-key local-function-key-map [M-escape] [?\M-\e])) (put 'backspace 'ascii-character 127) (put 'delete 'ascii-character 127) (put 'tab 'ascii-character ?\t) diff --git a/lisp/term/iris-ansi.el b/lisp/term/iris-ansi.el index 2f193007051..a941a0399f3 100644 --- a/lisp/term/iris-ansi.el +++ b/lisp/term/iris-ansi.el @@ -26,306 +26,314 @@ ;;; Code: -(defun iris-ansi-initialize-terminal () - "Terminal initialization function for iris-ansi." - (define-key function-key-map "\e[120q" [S-escape]) - (define-key function-key-map "\e[121q" [C-escape]) +(defvar iris-function-map (make-sparse-keymap) + "Function key definitions for SGI xwsh and winterm apps.") + +(define-key iris-function-map "\e[120q" [S-escape]) +(define-key iris-function-map "\e[121q" [C-escape]) - (define-key function-key-map "\e[001q" [f1]) - (define-key function-key-map "\e[013q" [S-f1]) - (define-key function-key-map "\e[025q" [C-f1]) +(define-key iris-function-map "\e[001q" [f1]) +(define-key iris-function-map "\e[013q" [S-f1]) +(define-key iris-function-map "\e[025q" [C-f1]) - (define-key function-key-map "\e[002q" [f2]) - (define-key function-key-map "\e[014q" [S-f2]) - (define-key function-key-map "\e[026q" [C-f2]) - (define-key function-key-map "\e[038q" [M-f2]) +(define-key iris-function-map "\e[002q" [f2]) +(define-key iris-function-map "\e[014q" [S-f2]) +(define-key iris-function-map "\e[026q" [C-f2]) +(define-key iris-function-map "\e[038q" [M-f2]) - (define-key function-key-map "\e[003q" [f3]) - (define-key function-key-map "\e[015q" [S-f3]) - (define-key function-key-map "\e[027q" [C-f3]) +(define-key iris-function-map "\e[003q" [f3]) +(define-key iris-function-map "\e[015q" [S-f3]) +(define-key iris-function-map "\e[027q" [C-f3]) - (define-key function-key-map "\e[004q" [f4]) - (define-key function-key-map "\e[016q" [S-f4]) - (define-key function-key-map "\e[028q" [C-f4]) +(define-key iris-function-map "\e[004q" [f4]) +(define-key iris-function-map "\e[016q" [S-f4]) +(define-key iris-function-map "\e[028q" [C-f4]) - (define-key function-key-map "\e[005q" [f5]) - (define-key function-key-map "\e[017q" [S-f5]) - (define-key function-key-map "\e[029q" [C-f5]) +(define-key iris-function-map "\e[005q" [f5]) +(define-key iris-function-map "\e[017q" [S-f5]) +(define-key iris-function-map "\e[029q" [C-f5]) - (define-key function-key-map "\e[006q" [f6]) - (define-key function-key-map "\e[018q" [S-f6]) - (define-key function-key-map "\e[030q" [C-f6]) +(define-key iris-function-map "\e[006q" [f6]) +(define-key iris-function-map "\e[018q" [S-f6]) +(define-key iris-function-map "\e[030q" [C-f6]) - (define-key function-key-map "\e[007q" [f7]) - (define-key function-key-map "\e[019q" [S-f7]) - (define-key function-key-map "\e[031q" [C-f7]) +(define-key iris-function-map "\e[007q" [f7]) +(define-key iris-function-map "\e[019q" [S-f7]) +(define-key iris-function-map "\e[031q" [C-f7]) - (define-key function-key-map "\e[008q" [f8]) - (define-key function-key-map "\e[020q" [S-f8]) - (define-key function-key-map "\e[032q" [C-f8]) +(define-key iris-function-map "\e[008q" [f8]) +(define-key iris-function-map "\e[020q" [S-f8]) +(define-key iris-function-map "\e[032q" [C-f8]) - (define-key function-key-map "\e[009q" [f9]) - (define-key function-key-map "\e[021q" [S-f9]) - (define-key function-key-map "\e[033q" [C-f9]) +(define-key iris-function-map "\e[009q" [f9]) +(define-key iris-function-map "\e[021q" [S-f9]) +(define-key iris-function-map "\e[033q" [C-f9]) - (define-key function-key-map "\e[010q" [f10]) - (define-key function-key-map "\e[022q" [S-f10]) - (define-key function-key-map "\e[034q" [C-f10]) +(define-key iris-function-map "\e[010q" [f10]) +(define-key iris-function-map "\e[022q" [S-f10]) +(define-key iris-function-map "\e[034q" [C-f10]) - (define-key function-key-map "\e[011q" [f11]) - (define-key function-key-map "\e[023q" [S-f11]) - (define-key function-key-map "\e[035q" [C-f11]) - (define-key function-key-map "\e[047q" [M-f11]) +(define-key iris-function-map "\e[011q" [f11]) +(define-key iris-function-map "\e[023q" [S-f11]) +(define-key iris-function-map "\e[035q" [C-f11]) +(define-key iris-function-map "\e[047q" [M-f11]) - (define-key function-key-map "\e[012q" [f12]) - (define-key function-key-map "\e[024q" [S-f12]) - (define-key function-key-map "\e[036q" [C-f12]) - (define-key function-key-map "\e[048q" [M-f12]) +(define-key iris-function-map "\e[012q" [f12]) +(define-key iris-function-map "\e[024q" [S-f12]) +(define-key iris-function-map "\e[036q" [C-f12]) +(define-key iris-function-map "\e[048q" [M-f12]) - (define-key function-key-map "\e[057q" [?\C-`]) - (define-key function-key-map "\e[115q" [?\M-`]) +(define-key iris-function-map "\e[057q" [?\C-`]) +(define-key iris-function-map "\e[115q" [?\M-`]) - (define-key function-key-map "\e[049q" [?\C-1]) - (define-key function-key-map "\e[058q" [?\M-1]) +(define-key iris-function-map "\e[049q" [?\C-1]) +(define-key iris-function-map "\e[058q" [?\M-1]) - (define-key function-key-map "\e[059q" [?\M-2]) +(define-key iris-function-map "\e[059q" [?\M-2]) - (define-key function-key-map "\e[050q" [?\C-3]) - (define-key function-key-map "\e[060q" [?\M-3]) +(define-key iris-function-map "\e[050q" [?\C-3]) +(define-key iris-function-map "\e[060q" [?\M-3]) - (define-key function-key-map "\e[051q" [?\C-4]) - (define-key function-key-map "\e[061q" [?\M-4]) +(define-key iris-function-map "\e[051q" [?\C-4]) +(define-key iris-function-map "\e[061q" [?\M-4]) - (define-key function-key-map "\e[052q" [?\C-5]) - (define-key function-key-map "\e[062q" [?\M-5]) +(define-key iris-function-map "\e[052q" [?\C-5]) +(define-key iris-function-map "\e[062q" [?\M-5]) - (define-key function-key-map "\e[063q" [?\M-6]) +(define-key iris-function-map "\e[063q" [?\M-6]) - (define-key function-key-map "\e[053q" [?\C-7]) - (define-key function-key-map "\e[064q" [?\M-7]) +(define-key iris-function-map "\e[053q" [?\C-7]) +(define-key iris-function-map "\e[064q" [?\M-7]) - (define-key function-key-map "\e[054q" [?\C-8]) - (define-key function-key-map "\e[065q" [?\M-8]) +(define-key iris-function-map "\e[054q" [?\C-8]) +(define-key iris-function-map "\e[065q" [?\M-8]) - (define-key function-key-map "\e[055q" [?\C-9]) - (define-key function-key-map "\e[066q" [?\M-9]) +(define-key iris-function-map "\e[055q" [?\C-9]) +(define-key iris-function-map "\e[066q" [?\M-9]) - (define-key function-key-map "\e[056q" [?\C-0]) - (define-key function-key-map "\e[067q" [?\M-0]) +(define-key iris-function-map "\e[056q" [?\C-0]) +(define-key iris-function-map "\e[067q" [?\M-0]) - (define-key function-key-map "\e[068q" [?\M--]) +(define-key iris-function-map "\e[068q" [?\M--]) - (define-key function-key-map "\e[069q" [?\C-=]) - (define-key function-key-map "\e[070q" [?\M-=]) +(define-key iris-function-map "\e[069q" [?\C-=]) +(define-key iris-function-map "\e[070q" [?\M-=]) - ;; I don't know what to do with those. - ;;(define-key function-key-map "^H" [<del>]) - ;;(define-key function-key-map "^H" [S-<del>]) - ;;(define-key function-key-map "\177" [C-<del>]) - ;;(define-key function-key-map "\e[071q" [M-<del>]) +;; I don't know what to do with those. +;;(define-key iris-function-map "^H" [<del>]) +;;(define-key iris-function-map "^H" [S-<del>]) +;;(define-key iris-function-map "\177" [C-<del>]) +;;(define-key iris-function-map "\e[071q" [M-<del>]) - (define-key function-key-map "\e[Z" [?\S-\t]) - (define-key function-key-map "\e[072q" [?\C-\t]) - ;; This only works if you remove the M-TAB keybing from the system.4Dwmrc - ;; our your ~/.4Dwmrc, if you use the 4Dwm window manager. - (define-key function-key-map "\e[073q" [?\M-\t]) +(define-key iris-function-map "\e[Z" [?\S-\t]) +(define-key iris-function-map "\e[072q" [?\C-\t]) +;; This only works if you remove the M-TAB keybing from the system.4Dwmrc +;; our your ~/.4Dwmrc, if you use the 4Dwm window manager. +(define-key iris-function-map "\e[073q" [?\M-\t]) - (define-key function-key-map "\e[074q" [?\M-q]) +(define-key iris-function-map "\e[074q" [?\M-q]) - (define-key function-key-map "\e[075q" [?\M-w]) +(define-key iris-function-map "\e[075q" [?\M-w]) - (define-key function-key-map "\e[076q" [?\M-e]) +(define-key iris-function-map "\e[076q" [?\M-e]) - (define-key function-key-map "\e[077q" [?\M-r]) +(define-key iris-function-map "\e[077q" [?\M-r]) - (define-key function-key-map "\e[078q" [?\M-t]) +(define-key iris-function-map "\e[078q" [?\M-t]) - (define-key function-key-map "\e[079q" [?\M-y]) +(define-key iris-function-map "\e[079q" [?\M-y]) - (define-key function-key-map "\e[080q" [?\M-u]) +(define-key iris-function-map "\e[080q" [?\M-u]) - (define-key function-key-map "\e[081q" [?\M-i]) +(define-key iris-function-map "\e[081q" [?\M-i]) - (define-key function-key-map "\e[082q" [?\M-o]) +(define-key iris-function-map "\e[082q" [?\M-o]) - (define-key function-key-map "\e[083q" [?\M-p]) +(define-key iris-function-map "\e[083q" [?\M-p]) - (define-key function-key-map "\e[084q" [?\M-\[]) +(define-key iris-function-map "\e[084q" [?\M-\[]) - (define-key function-key-map "\e[085q" [?\M-\]]) +(define-key iris-function-map "\e[085q" [?\M-\]]) - (define-key function-key-map "\e[086q" [?\M-\\]) +(define-key iris-function-map "\e[086q" [?\M-\\]) - (define-key function-key-map "\e[087q" [?\M-a]) +(define-key iris-function-map "\e[087q" [?\M-a]) - (define-key function-key-map "\e[088q" [?\M-s]) +(define-key iris-function-map "\e[088q" [?\M-s]) - (define-key function-key-map "\e[089q" [?\M-d]) +(define-key iris-function-map "\e[089q" [?\M-d]) - (define-key function-key-map "\e[090q" [?\M-f]) +(define-key iris-function-map "\e[090q" [?\M-f]) - (define-key function-key-map "\e[091q" [?\M-g]) +(define-key iris-function-map "\e[091q" [?\M-g]) - (define-key function-key-map "\e[092q" [?\M-h]) +(define-key iris-function-map "\e[092q" [?\M-h]) - (define-key function-key-map "\e[093q" [?\M-j]) +(define-key iris-function-map "\e[093q" [?\M-j]) - (define-key function-key-map "\e[094q" [?\M-k]) +(define-key iris-function-map "\e[094q" [?\M-k]) - (define-key function-key-map "\e[095q" [?\M-l]) +(define-key iris-function-map "\e[095q" [?\M-l]) - (define-key function-key-map "\e[096q" [?\C-\;]) - (define-key function-key-map "\e[097q" [?\M-:]) ;; we are cheating - ;; here, this is - ;; realy M-;, but - ;; M-: generates the - ;; same string and - ;; is more usefull. +(define-key iris-function-map "\e[096q" [?\C-\;]) +(define-key iris-function-map "\e[097q" [?\M-:]) ;; we are cheating + ;; here, this is realy + ;; M-;, but M-: + ;; generates the same + ;; string and is more + ;; usefull. - (define-key function-key-map "\e[098q" [?\C-']) - (define-key function-key-map "\e[099q" [?\M-']) +(define-key iris-function-map "\e[098q" [?\C-']) +(define-key iris-function-map "\e[099q" [?\M-']) - (define-key function-key-map "\e[100q" [?\M-\n]) +(define-key iris-function-map "\e[100q" [?\M-\n]) - (define-key function-key-map "\e[101q" [?\M-z]) +(define-key iris-function-map "\e[101q" [?\M-z]) - (define-key function-key-map "\e[102q" [?\M-x]) +(define-key iris-function-map "\e[102q" [?\M-x]) - (define-key function-key-map "\e[103q" [?\M-c]) +(define-key iris-function-map "\e[103q" [?\M-c]) - (define-key function-key-map "\e[104q" [?\M-v]) +(define-key iris-function-map "\e[104q" [?\M-v]) - (define-key function-key-map "\e[105q" [?\M-b]) +(define-key iris-function-map "\e[105q" [?\M-b]) - (define-key function-key-map "\e[106q" [M-n]) +(define-key iris-function-map "\e[106q" [M-n]) - (define-key function-key-map "\e[107q" [M-m]) +(define-key iris-function-map "\e[107q" [M-m]) - (define-key function-key-map "\e[108q" [?\C-,]) - (define-key function-key-map "\e[109q" [?\M-,]) +(define-key iris-function-map "\e[108q" [?\C-,]) +(define-key iris-function-map "\e[109q" [?\M-,]) - (define-key function-key-map "\e[110q" [?\C-.]) - (define-key function-key-map "\e[111q" [?\M-.]) +(define-key iris-function-map "\e[110q" [?\C-.]) +(define-key iris-function-map "\e[111q" [?\M-.]) - (define-key function-key-map "\e[112q" [?\C-/]) - (define-key function-key-map "\e[113q" [?\M-/]) +(define-key iris-function-map "\e[112q" [?\C-/]) +(define-key iris-function-map "\e[113q" [?\M-/]) - (define-key function-key-map "\e[139q" [insert]) - (define-key function-key-map "\e[139q" [S-insert]) - (define-key function-key-map "\e[140q" [C-insert]) - (define-key function-key-map "\e[141q" [M-insert]) +(define-key iris-function-map "\e[139q" [insert]) +(define-key iris-function-map "\e[139q" [S-insert]) +(define-key iris-function-map "\e[140q" [C-insert]) +(define-key iris-function-map "\e[141q" [M-insert]) - (define-key function-key-map "\e[H" [home]) - (define-key function-key-map "\e[143q" [S-home]) - (define-key function-key-map "\e[144q" [C-home]) +(define-key iris-function-map "\e[H" [home]) +(define-key iris-function-map "\e[143q" [S-home]) +(define-key iris-function-map "\e[144q" [C-home]) - (define-key function-key-map "\e[150q" [prior]) - (define-key function-key-map "\e[151q" [S-prior]) ;; those don't - ;; seem to - ;; generate +(define-key iris-function-map "\e[150q" [prior]) +(define-key iris-function-map "\e[151q" [S-prior]) ;; those don't seem + ;; to generate ;; anything - (define-key function-key-map "\e[152q" [C-prior]) +(define-key iris-function-map "\e[152q" [C-prior]) - ;; (define-key function-key-map "^?" [delete]) - (define-key function-key-map "\e[P" [S-delete]) - (define-key function-key-map "\e[142q" [C-delete]) - (define-key function-key-map "\e[M" [M-delete]) +;; (define-key iris-function-map "^?" [delete]) ?? something else seems to take care of this. +(define-key iris-function-map "\e[P" [S-delete]) +(define-key iris-function-map "\e[142q" [C-delete]) +(define-key iris-function-map "\e[M" [M-delete]) - (define-key function-key-map "\e[146q" [end]) - (define-key function-key-map "\e[147q" [S-end]) ;; those don't seem - ;; to generate - ;; anything - (define-key function-key-map "\e[148q" [C-end]) +(define-key iris-function-map "\e[146q" [end]) +(define-key iris-function-map "\e[147q" [S-end]) ;; those don't seem to + ;; generate anything +(define-key iris-function-map "\e[148q" [C-end]) - (define-key function-key-map "\e[154q" [next]) - (define-key function-key-map "\e[155q" [S-next]) - (define-key function-key-map "\e[156q" [C-next]) +(define-key iris-function-map "\e[154q" [next]) +(define-key iris-function-map "\e[155q" [S-next]) +(define-key iris-function-map "\e[156q" [C-next]) - (define-key function-key-map "\e[161q" [S-up]) - (define-key function-key-map "\e[162q" [C-up]) - (define-key function-key-map "\e[163q" [M-up]) +(define-key iris-function-map "\e[161q" [S-up]) +(define-key iris-function-map "\e[162q" [C-up]) +(define-key iris-function-map "\e[163q" [M-up]) - (define-key function-key-map "\e[158q" [S-left]) - (define-key function-key-map "\e[159q" [C-left]) - (define-key function-key-map "\e[160q" [M-left]) +(define-key iris-function-map "\e[158q" [S-left]) +(define-key iris-function-map "\e[159q" [C-left]) +(define-key iris-function-map "\e[160q" [M-left]) - (define-key function-key-map "\e[164q" [S-down]) - (define-key function-key-map "\e[165q" [C-down]) - (define-key function-key-map "\e[166q" [M-down]) +(define-key iris-function-map "\e[164q" [S-down]) +(define-key iris-function-map "\e[165q" [C-down]) +(define-key iris-function-map "\e[166q" [M-down]) - (define-key function-key-map "\e[167q" [S-right]) - (define-key function-key-map "\e[168q" [C-right]) - (define-key function-key-map "\e[169q" [M-right]) +(define-key iris-function-map "\e[167q" [S-right]) +(define-key iris-function-map "\e[168q" [C-right]) +(define-key iris-function-map "\e[169q" [M-right]) - ;; Keypad functions, most of those are untested. - (define-key function-key-map "\e[179q" [?\C-/]) - (define-key function-key-map "\e[180q" [?\M-/]) +;; Keypad functions, most of those are untested. +(define-key iris-function-map "\e[179q" [?\C-/]) +(define-key iris-function-map "\e[180q" [?\M-/]) - (define-key function-key-map "\e[187q" [?\C-*]) - (define-key function-key-map "\e[188q" [?\M-*]) +(define-key iris-function-map "\e[187q" [?\C-*]) +(define-key iris-function-map "\e[188q" [?\M-*]) - (define-key function-key-map "\e[198q" [?\C--]) - (define-key function-key-map "\e[199q" [?\M--]) +(define-key iris-function-map "\e[198q" [?\C--]) +(define-key iris-function-map "\e[199q" [?\M--]) - ;; Something else takes care of home, up, prior, down, left, right, next - ;;(define-key function-key-map "\e[H" [home]) - (define-key function-key-map "\e[172q" [C-home]) +;; Something else takes care of home, up, prior, down, left, right, next +;(define-key iris-function-map "\e[H" [home]) +(define-key iris-function-map "\e[172q" [C-home]) - ;;(define-key function-key-map "\e[A" [up]) - (define-key function-key-map "\e[182q" [C-up]) +;(define-key iris-function-map "\e[A" [up]) +(define-key iris-function-map "\e[182q" [C-up]) - ;;(define-key function-key-map "\e[150q" [prior]) - (define-key function-key-map "\e[190q" [C-prior]) +;(define-key iris-function-map "\e[150q" [prior]) +(define-key iris-function-map "\e[190q" [C-prior]) - (define-key function-key-map "\e[200q" [?\C-+]) - (define-key function-key-map "\e[201q" [?\M-+]) +(define-key iris-function-map "\e[200q" [?\C-+]) +(define-key iris-function-map "\e[201q" [?\M-+]) - ;;(define-key function-key-map "\e[D" [left]) - (define-key function-key-map "\e[174q" [C-left]) +;(define-key iris-function-map "\e[D" [left]) +(define-key iris-function-map "\e[174q" [C-left]) - (define-key function-key-map "\e[000q" [begin]) - (define-key function-key-map "\e[184q" [C-begin]) +(define-key iris-function-map "\e[000q" [begin]) +(define-key iris-function-map "\e[184q" [C-begin]) - ;;(define-key function-key-map "\e[C" [right]) - (define-key function-key-map "\e[192q" [C-right]) +;(define-key iris-function-map "\e[C" [right]) +(define-key iris-function-map "\e[192q" [C-right]) - ;;(define-key function-key-map "\e[146q" [end]) - (define-key function-key-map "\e[176q" [C-end]) +;(define-key iris-function-map "\e[146q" [end]) +(define-key iris-function-map "\e[176q" [C-end]) - ;;(define-key function-key-map "\e[B" [down]) - (define-key function-key-map "\e[186q" [C-down]) +;(define-key iris-function-map "\e[B" [down]) +(define-key iris-function-map "\e[186q" [C-down]) - ;;(define-key function-key-map "\e[154q" [next]) - (define-key function-key-map "\e[194q" [C-next]) +;(define-key iris-function-map "\e[154q" [next]) +(define-key iris-function-map "\e[194q" [C-next]) - (define-key function-key-map "\e[100q" [M-enter]) +(define-key iris-function-map "\e[100q" [M-enter]) - (define-key function-key-map "\e[139q" [insert]) - (define-key function-key-map "\e[178q" [C-inset]) +(define-key iris-function-map "\e[139q" [insert]) +(define-key iris-function-map "\e[178q" [C-inset]) - (define-key function-key-map "\e[P" [delete]) - (define-key function-key-map "\e[196q" [C-delete]) - (define-key function-key-map "\e[197q" [M-delete])) +(define-key iris-function-map "\e[P" [delete]) +(define-key iris-function-map "\e[196q" [C-delete]) +(define-key iris-function-map "\e[197q" [M-delete]) + +(defun terminal-init-iris-ansi () + "Terminal initialization function for iris-ansi." + ;; Use inheritance to let the main keymap override these defaults. + ;; This way we don't override terminfo-derived settings or settings + ;; made in the .emacs file. + (let ((m (copy-keymap iris-function-map))) + (set-keymap-parent m (keymap-parent local-function-key-map)) + (set-keymap-parent local-function-key-map m))) ;;; arch-tag: b1d0e73a-bb7d-47be-9fb2-6fb126469a1b ;;; iris-ansi.el ends here diff --git a/lisp/term/linux.el b/lisp/term/linux.el index 84de5966a88..fdd8e2229ac 100644 --- a/lisp/term/linux.el +++ b/lisp/term/linux.el @@ -16,9 +16,8 @@ ;; Meta will continue to work, because the kernel ;; turns that into Escape. - (let ((value (current-input-mode))) - ;; The third arg only matters in that it is not t or nil. - (set-input-mode (nth 0 value) (nth 1 value) 'iso-latin-1 (nth 3 value)))) + ;; The arg only matters in that it is not t or nil. + (set-input-meta-mode 'iso-latin-1)) ;;; arch-tag: 5d0c4f63-739b-4862-abf3-041fe42adb8f ;;; linux.el ends here diff --git a/lisp/term/lk201.el b/lisp/term/lk201.el index 1f8d9ca77a3..17ac3474ff0 100644 --- a/lisp/term/lk201.el +++ b/lisp/term/lk201.el @@ -1,72 +1,83 @@ ;; -*- no-byte-compile: t -*- ;; Define function key sequences for DEC terminals. +(defvar lk201-function-map (make-sparse-keymap) + "Function key definitions for DEC terminals.") + ;; Termcap or terminfo should set these. -;; (define-key function-key-map "\e[A" [up]) -;; (define-key function-key-map "\e[B" [down]) -;; (define-key function-key-map "\e[C" [right]) -;; (define-key function-key-map "\e[D" [left]) +;; (define-key lk201-function-map "\e[A" [up]) +;; (define-key lk201-function-map "\e[B" [down]) +;; (define-key lk201-function-map "\e[C" [right]) +;; (define-key lk201-function-map "\e[D" [left]) -(define-key function-key-map "\e[1~" [find]) -(define-key function-key-map "\e[2~" [insert]) -(define-key function-key-map "\e[3~" [delete]) -(define-key function-key-map "\e[4~" [select]) -(define-key function-key-map "\e[5~" [prior]) -(define-key function-key-map "\e[6~" [next]) -(define-key function-key-map "\e[11~" [f1]) -(define-key function-key-map "\e[12~" [f2]) -(define-key function-key-map "\e[13~" [f3]) -(define-key function-key-map "\e[14~" [f4]) -(define-key function-key-map "\e[15~" [f5]) -(define-key function-key-map "\e[17~" [f6]) -(define-key function-key-map "\e[18~" [f7]) -(define-key function-key-map "\e[19~" [f8]) -(define-key function-key-map "\e[20~" [f9]) -(define-key function-key-map "\e[21~" [f10]) +(define-key lk201-function-map "\e[1~" [find]) +(define-key lk201-function-map "\e[2~" [insert]) +(define-key lk201-function-map "\e[3~" [delete]) +(define-key lk201-function-map "\e[4~" [select]) +(define-key lk201-function-map "\e[5~" [prior]) +(define-key lk201-function-map "\e[6~" [next]) +(define-key lk201-function-map "\e[11~" [f1]) +(define-key lk201-function-map "\e[12~" [f2]) +(define-key lk201-function-map "\e[13~" [f3]) +(define-key lk201-function-map "\e[14~" [f4]) +(define-key lk201-function-map "\e[15~" [f5]) +(define-key lk201-function-map "\e[17~" [f6]) +(define-key lk201-function-map "\e[18~" [f7]) +(define-key lk201-function-map "\e[19~" [f8]) +(define-key lk201-function-map "\e[20~" [f9]) +(define-key lk201-function-map "\e[21~" [f10]) ;; Customarily F11 is used as the ESC key. ;; The file that includes this one, takes care of that. -(define-key function-key-map "\e[23~" [f11]) -(define-key function-key-map "\e[24~" [f12]) -(define-key function-key-map "\e[25~" [f13]) -(define-key function-key-map "\e[26~" [f14]) -(define-key function-key-map "\e[28~" [help]) -(define-key function-key-map "\e[29~" [menu]) -(define-key function-key-map "\e[31~" [f17]) -(define-key function-key-map "\e[32~" [f18]) -(define-key function-key-map "\e[33~" [f19]) -(define-key function-key-map "\e[34~" [f20]) +(define-key lk201-function-map "\e[23~" [f11]) +(define-key lk201-function-map "\e[24~" [f12]) +(define-key lk201-function-map "\e[25~" [f13]) +(define-key lk201-function-map "\e[26~" [f14]) +(define-key lk201-function-map "\e[28~" [help]) +(define-key lk201-function-map "\e[29~" [menu]) +(define-key lk201-function-map "\e[31~" [f17]) +(define-key lk201-function-map "\e[32~" [f18]) +(define-key lk201-function-map "\e[33~" [f19]) +(define-key lk201-function-map "\e[34~" [f20]) ;; Termcap or terminfo should set these. -;; (define-key function-key-map "\eOA" [up]) -;; (define-key function-key-map "\eOB" [down]) -;; (define-key function-key-map "\eOC" [right]) -;; (define-key function-key-map "\eOD" [left]) +;; (define-key lk201-function-map "\eOA" [up]) +;; (define-key lk201-function-map "\eOB" [down]) +;; (define-key lk201-function-map "\eOC" [right]) +;; (define-key lk201-function-map "\eOD" [left]) ;; Termcap or terminfo should set these, but doesn't properly. ;; Termcap sets these to k1-k4, which get mapped to f1-f4 in term.c -(define-key function-key-map "\eOP" [kp-f1]) -(define-key function-key-map "\eOQ" [kp-f2]) -(define-key function-key-map "\eOR" [kp-f3]) -(define-key function-key-map "\eOS" [kp-f4]) +(define-key lk201-function-map "\eOP" [kp-f1]) +(define-key lk201-function-map "\eOQ" [kp-f2]) +(define-key lk201-function-map "\eOR" [kp-f3]) +(define-key lk201-function-map "\eOS" [kp-f4]) + +(define-key lk201-function-map "\eOI" [kp-tab]) +(define-key lk201-function-map "\eOj" [kp-multiply]) +(define-key lk201-function-map "\eOk" [kp-add]) +(define-key lk201-function-map "\eOl" [kp-separator]) +(define-key lk201-function-map "\eOM" [kp-enter]) +(define-key lk201-function-map "\eOm" [kp-subtract]) +(define-key lk201-function-map "\eOn" [kp-decimal]) +(define-key lk201-function-map "\eOo" [kp-divide]) +(define-key lk201-function-map "\eOp" [kp-0]) +(define-key lk201-function-map "\eOq" [kp-1]) +(define-key lk201-function-map "\eOr" [kp-2]) +(define-key lk201-function-map "\eOs" [kp-3]) +(define-key lk201-function-map "\eOt" [kp-4]) +(define-key lk201-function-map "\eOu" [kp-5]) +(define-key lk201-function-map "\eOv" [kp-6]) +(define-key lk201-function-map "\eOw" [kp-7]) +(define-key lk201-function-map "\eOx" [kp-8]) +(define-key lk201-function-map "\eOy" [kp-9]) -(define-key function-key-map "\eOI" [kp-tab]) -(define-key function-key-map "\eOj" [kp-multiply]) -(define-key function-key-map "\eOk" [kp-add]) -(define-key function-key-map "\eOl" [kp-separator]) -(define-key function-key-map "\eOM" [kp-enter]) -(define-key function-key-map "\eOm" [kp-subtract]) -(define-key function-key-map "\eOn" [kp-decimal]) -(define-key function-key-map "\eOo" [kp-divide]) -(define-key function-key-map "\eOp" [kp-0]) -(define-key function-key-map "\eOq" [kp-1]) -(define-key function-key-map "\eOr" [kp-2]) -(define-key function-key-map "\eOs" [kp-3]) -(define-key function-key-map "\eOt" [kp-4]) -(define-key function-key-map "\eOu" [kp-5]) -(define-key function-key-map "\eOv" [kp-6]) -(define-key function-key-map "\eOw" [kp-7]) -(define-key function-key-map "\eOx" [kp-8]) -(define-key function-key-map "\eOy" [kp-9]) +(defun terminal-init-lk201 () + ;; Use inheritance to let the main keymap override these defaults. + ;; This way we don't override terminfo-derived settings or settings + ;; made in the .emacs file. + (let ((m (copy-keymap lk201-function-map))) + (set-keymap-parent m (keymap-parent local-function-key-map)) + (set-keymap-parent local-function-key-map m))) ;;; arch-tag: 7ffb4444-6a23-43e1-b457-43cf4f673c0d ;;; lk201.el ends here diff --git a/lisp/term/mac-win.el b/lisp/term/mac-win.el index a89d0fe306f..d638f97ede3 100644 --- a/lisp/term/mac-win.el +++ b/lisp/term/mac-win.el @@ -65,8 +65,8 @@ ;; An alist of X options and the function which handles them. See ;; ../startup.el. -(if (not (eq window-system 'mac)) - (error "%s: Loading mac-win.el but not compiled for Mac" (invocation-name))) +;; (if (not (eq window-system 'mac)) +;; (error "%s: Loading mac-win.el but not compiled for Mac" (invocation-name))) (require 'frame) (require 'mouse) @@ -76,7 +76,6 @@ (require 'menu-bar) (require 'fontset) (require 'dnd) -(eval-when-compile (require 'url)) (defvar mac-charset-info-alist) (defvar mac-service-selection) @@ -1062,22 +1061,25 @@ XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp") (substitute-key-definition 'suspend-emacs 'iconify-or-deiconify-frame global-map) +(defun x-setup-function-keys (frame) + "Setup Function Keys for mac." ;; Map certain keypad keys into ASCII characters ;; that people usually expect. -(define-key function-key-map [backspace] [?\d]) -(define-key function-key-map [delete] [?\d]) -(define-key function-key-map [tab] [?\t]) -(define-key function-key-map [linefeed] [?\n]) -(define-key function-key-map [clear] [?\C-l]) -(define-key function-key-map [return] [?\C-m]) -(define-key function-key-map [escape] [?\e]) -(define-key function-key-map [M-backspace] [?\M-\d]) -(define-key function-key-map [M-delete] [?\M-\d]) -(define-key function-key-map [M-tab] [?\M-\t]) -(define-key function-key-map [M-linefeed] [?\M-\n]) -(define-key function-key-map [M-clear] [?\M-\C-l]) -(define-key function-key-map [M-return] [?\M-\C-m]) -(define-key function-key-map [M-escape] [?\M-\e]) +(define-key local-function-key-map [backspace] [?\d]) +(define-key local-function-key-map [delete] [?\d]) +(define-key local-function-key-map [tab] [?\t]) +(define-key local-function-key-map [linefeed] [?\n]) +(define-key local-function-key-map [clear] [?\C-l]) +(define-key local-function-key-map [return] [?\C-m]) +(define-key local-function-key-map [escape] [?\e]) +(define-key local-function-key-map [M-backspace] [?\M-\d]) +(define-key local-function-key-map [M-delete] [?\M-\d]) +(define-key local-function-key-map [M-tab] [?\M-\t]) +(define-key local-function-key-map [M-linefeed] [?\M-\n]) +(define-key local-function-key-map [M-clear] [?\M-\C-l]) +(define-key local-function-key-map [M-return] [?\M-\C-m]) +(define-key local-function-key-map [M-escape] [?\M-\e]) +) ;; These tell read-char how to convert ;; these special chars to ASCII. @@ -2412,6 +2414,88 @@ It returns a name of the created fontset." (new-fontset fontset-name (list (cons 'ascii resolved-font))) (fontset-add-mac-fonts fontset-name base-family))) +(defun x-win-suspend-error () + (error "Suspending an Emacs running under Mac makes no sense")) + +(defalias 'x-cut-buffer-or-selection-value 'x-get-selection-value) + +(defvar mac-initialized nil + "Non-nil if the w32 window system has been initialized.") + +(defun mac-initialize-window-system () + "Initialize Emacs for Mac GUI frames." + +;;; Do the actual Windows setup here; the above code just defines +;;; functions and variables that we use now. + +(setq command-line-args (x-handle-args command-line-args)) + +;;; Make sure we have a valid resource name. +(or (stringp x-resource-name) + (let (i) + (setq x-resource-name (invocation-name)) + + ;; Change any . or * characters in x-resource-name to hyphens, + ;; so as not to choke when we use it in X resource queries. + (while (setq i (string-match "[.*]" x-resource-name)) + (aset x-resource-name i ?-)))) + +(if (x-display-list) + ;; On Mac OS 8/9, Most coding systems used in code conversion for + ;; font names are not ready at the time when the terminal frame is + ;; created. So we reconstruct font name table for the initial + ;; frame. + (mac-clear-font-name-table) + (x-open-connection "Mac" + x-command-line-resources + ;; Exit Emacs with fatal error if this fails. + t)) + +(add-hook 'suspend-hook 'x-win-suspend-error) + +;;; Arrange for the kill and yank functions to set and check the clipboard. +(setq interprogram-cut-function 'x-select-text) +(setq interprogram-paste-function 'x-get-selection-value) + + + + +;;; Turn off window-splitting optimization; Mac is usually fast enough +;;; that this is only annoying. +(setq split-window-keep-point t) + +;; Don't show the frame name; that's redundant. +(setq-default mode-line-frame-identification " ") + +;; Turn on support for mouse wheels. +(mouse-wheel-mode 1) + + +;; Enable CLIPBOARD copy/paste through menu bar commands. +(menu-bar-enable-clipboard) + + +;; Initiate drag and drop + +(define-key special-event-map [drag-n-drop] 'mac-dnd-handle-drag-n-drop-event) + + +;;;; Non-toolkit Scroll bars + +(unless x-toolkit-scroll-bars + +;; for debugging +;; (defun mac-handle-scroll-bar-event (event) (interactive "e") (princ event)) + +;;(global-set-key [vertical-scroll-bar mouse-1] 'mac-handle-scroll-bar-event) + +(global-set-key + [vertical-scroll-bar down-mouse-1] + 'mac-handle-scroll-bar-event) + +(global-unset-key [vertical-scroll-bar drag-mouse-1]) +(global-unset-key [vertical-scroll-bar mouse-1]) + ;; Adjust Courier font specifications in x-fixed-font-alist. (let ((courier-fonts (assoc "Courier" x-fixed-font-alist))) (if courier-fonts @@ -2477,50 +2561,7 @@ It returns a name of the created fontset." (setq default-frame-alist (cons '(reverse . t) default-frame-alist))))) -(defun x-win-suspend-error () - (error "Suspending an Emacs running under Mac makes no sense")) -(add-hook 'suspend-hook 'x-win-suspend-error) - -;;; Arrange for the kill and yank functions to set and check the clipboard. -(setq interprogram-cut-function 'x-select-text) -(setq interprogram-paste-function 'x-get-selection-value) - -(defalias 'x-cut-buffer-or-selection-value 'x-get-selection-value) - -;;; Turn off window-splitting optimization; Mac is usually fast enough -;;; that this is only annoying. -(setq split-window-keep-point t) - -;; Don't show the frame name; that's redundant. -(setq-default mode-line-frame-identification " ") - -;; Turn on support for mouse wheels. -(mouse-wheel-mode 1) - - -;; Enable CLIPBOARD copy/paste through menu bar commands. -(menu-bar-enable-clipboard) - -;; Initiate drag and drop - -(define-key special-event-map [drag-n-drop] 'mac-dnd-handle-drag-n-drop-event) - - -;;;; Non-toolkit Scroll bars - -(unless x-toolkit-scroll-bars - -;; for debugging -;; (defun mac-handle-scroll-bar-event (event) (interactive "e") (princ event)) - -;;(global-set-key [vertical-scroll-bar mouse-1] 'mac-handle-scroll-bar-event) - -(global-set-key - [vertical-scroll-bar down-mouse-1] - 'mac-handle-scroll-bar-event) - -(global-unset-key [vertical-scroll-bar drag-mouse-1]) -(global-unset-key [vertical-scroll-bar mouse-1]) +(setq mac-initialized t))) (defun mac-handle-scroll-bar-event (event) "Handle scroll bar EVENT to emulate Mac Toolbox style scrolling." @@ -2568,7 +2609,6 @@ It returns a name of the created fontset." (mac-scroll-ignore-events) (scroll-up 1))) -) ;;;; Others @@ -2606,5 +2646,11 @@ It returns a name of the created fontset." ;; or bold bitmap versions will not display these variants correctly. (setq scalable-fonts-allowed t) +(add-to-list 'handle-args-function-alist '(mac . x-handle-args)) +(add-to-list 'frame-creation-function-alist '(mac . x-create-frame-with-faces)) +(add-to-list 'window-system-initialization-alist '(mac . mac-initialize-window-system)) + +(provide 'mac-win) + ;; arch-tag: 71dfcd14-cde8-4d66-b05c-85ec94fb23a6 ;;; mac-win.el ends here diff --git a/lisp/term/news.el b/lisp/term/news.el index 57d8fd6cb14..514f363314d 100644 --- a/lisp/term/news.el +++ b/lisp/term/news.el @@ -31,10 +31,8 @@ (defun terminal-init-news () "Terminal initialization function for news." - (if (boundp 'news-fkey-prefix) - nil - ;; The terminal initialization should already have set up some keys - (setq news-fkey-prefix (lookup-key function-key-map "\eO")) + ;; The terminal initialization should already have set up some keys + (let ((news-fkey-prefix (lookup-key local-function-key-map "\eO"))) (if (not (keymapp news-fkey-prefix)) (error "What? Your news termcap/terminfo has no keycaps in it")) diff --git a/lisp/term/rxvt.el b/lisp/term/rxvt.el index 64c09e0e1bd..c96c8a6e290 100644 --- a/lisp/term/rxvt.el +++ b/lisp/term/rxvt.el @@ -26,51 +26,10 @@ ;;; Code: -(defun terminal-init-rxvt () - "Terminal initialization function for rxvt." - ;; The terminal intialization C code file might have initialized - ;; function keys F11->F42 from the termcap/terminfo information. On - ;; a PC-style keyboard these keys correspond to - ;; MODIFIER-FUNCTION_KEY, where modifier is S-, C-, C-S-. The - ;; code here subsitutes the corresponding defintions in - ;; function-key-map. This substitution is needed because if a key - ;; definition if found in function-key-map, there are no further - ;; lookups in other keymaps. - (substitute-key-definition [f11] [S-f1] function-key-map) - (substitute-key-definition [f12] [S-f2] function-key-map) - (substitute-key-definition [f13] [S-f3] function-key-map) - (substitute-key-definition [f14] [S-f4] function-key-map) - (substitute-key-definition [f15] [S-f5] function-key-map) - (substitute-key-definition [f16] [S-f6] function-key-map) - (substitute-key-definition [f17] [S-f7] function-key-map) - (substitute-key-definition [f18] [S-f8] function-key-map) - (substitute-key-definition [f19] [S-f9] function-key-map) - (substitute-key-definition [f20] [S-f10] function-key-map) - - (substitute-key-definition [f23] [C-f1] function-key-map) - (substitute-key-definition [f24] [C-f2] function-key-map) - (substitute-key-definition [f25] [C-f3] function-key-map) - (substitute-key-definition [f26] [C-f4] function-key-map) - (substitute-key-definition [f27] [C-f5] function-key-map) - (substitute-key-definition [f28] [C-f6] function-key-map) - (substitute-key-definition [f29] [C-f7] function-key-map) - (substitute-key-definition [f30] [C-f8] function-key-map) - (substitute-key-definition [f31] [C-f9] function-key-map) - (substitute-key-definition [f32] [C-f10] function-key-map) - - (substitute-key-definition [f33] [C-S-f1] function-key-map) - (substitute-key-definition [f34] [C-S-f2] function-key-map) - (substitute-key-definition [f35] [C-S-f3] function-key-map) - (substitute-key-definition [f36] [C-S-f4] function-key-map) - (substitute-key-definition [f37] [C-S-f5] function-key-map) - (substitute-key-definition [f38] [C-S-f6] function-key-map) - (substitute-key-definition [f39] [C-S-f7] function-key-map) - (substitute-key-definition [f40] [C-S-f8] function-key-map) - (substitute-key-definition [f41] [C-S-f9] function-key-map) - (substitute-key-definition [f42] [C-S-f10] function-key-map) - - ;; Set up function-key-map entries that termcap and terminfo don't know. +(defvar rxvt-function-map (let ((map (make-sparse-keymap))) + + ;; Set up input-decode-map entries that termcap and terminfo don't know. (define-key map "\e[A" [up]) (define-key map "\e[B" [down]) (define-key map "\e[C" [right]) @@ -94,8 +53,8 @@ (define-key map "\e[21~" [f10]) ;; The strings emitted by f11 and f12 are the same as the strings ;; emitted by S-f1 and S-f2, so don't define f11 and f12. - ;; (define-key map "\e[23~" [f11]) - ;; (define-key map "\e[24~" [f12]) + ;; (define-key rxvt-function-map "\e[23~" [f11]) + ;; (define-key rxvt-function-map "\e[24~" [f12]) (define-key map "\e[29~" [print]) (define-key map "\e[11^" [C-f1]) @@ -152,12 +111,67 @@ (define-key map "\e[c" [S-right]) (define-key map "\e[a" [S-up]) (define-key map "\e[b" [S-down]) + map) + "Function key overrides for rxvt.") + +(defvar rxvt-alternatives-map + (let ((map (make-sparse-keymap))) + ;; The terminal intialization C code file might have initialized + ;; function keys F11->F42 from the termcap/terminfo information. On + ;; a PC-style keyboard these keys correspond to + ;; MODIFIER-FUNCTION_KEY, where modifier is S-, C-, C-S-. The + ;; code here subsitutes the corresponding defintions in + ;; function-key-map. This substitution is needed because if a key + ;; definition if found in function-key-map, there are no further + ;; lookups in other keymaps. + (define-key map [f11] [S-f1]) + (define-key map [f12] [S-f2]) + (define-key map [f13] [S-f3]) + (define-key map [f14] [S-f4]) + (define-key map [f15] [S-f5]) + (define-key map [f16] [S-f6]) + (define-key map [f17] [S-f7]) + (define-key map [f18] [S-f8]) + (define-key map [f19] [S-f9]) + (define-key map [f20] [S-f10]) - ;; Use inheritance to let the main keymap override those defaults. - ;; This way we don't override terminfo-derived settings or settings - ;; made in the .emacs file. - (set-keymap-parent map (keymap-parent function-key-map)) - (set-keymap-parent function-key-map map)) + (define-key map [f23] [C-f1]) + (define-key map [f24] [C-f2]) + (define-key map [f25] [C-f3]) + (define-key map [f26] [C-f4]) + (define-key map [f27] [C-f5]) + (define-key map [f28] [C-f6]) + (define-key map [f29] [C-f7]) + (define-key map [f30] [C-f8]) + (define-key map [f31] [C-f9]) + (define-key map [f32] [C-f10]) + + (define-key map [f33] [C-S-f1]) + (define-key map [f34] [C-S-f2]) + (define-key map [f35] [C-S-f3]) + (define-key map [f36] [C-S-f4]) + (define-key map [f37] [C-S-f5]) + (define-key map [f38] [C-S-f6]) + (define-key map [f39] [C-S-f7]) + (define-key map [f40] [C-S-f8]) + (define-key map [f41] [C-S-f9]) + (define-key map [f42] [C-S-f10]) + map) + "Keymap of possible alternative meanings for some keys.") + +(defun terminal-init-rxvt () + "Terminal initialization function for rxvt." + + (let ((map (copy-keymap rxvt-alternatives-map))) + (set-keymap-parent map (keymap-parent local-function-key-map)) + (set-keymap-parent local-function-key-map map)) + + ;; Use inheritance to let the main keymap override those defaults. + ;; This way we don't override terminfo-derived settings or settings + ;; made in the .emacs file. + (let ((m (copy-keymap rxvt-function-map))) + (set-keymap-parent m (keymap-parent input-decode-map)) + (set-keymap-parent input-decode-map m)) ;; Initialize colors and background mode. (rxvt-register-default-colors) @@ -239,7 +253,7 @@ for the currently selected frame." (- 256 ncolors) (list color color color)) (setq ncolors (1- ncolors)))) - + ((= ncolors 72) ; rxvt-unicode ;; 64 non-gray colors (let ((levels '(0 139 205 255)) @@ -282,7 +296,7 @@ for the currently selected frame." "Set background mode as appropriate for the default rxvt colors." (let ((fgbg (getenv "COLORFGBG")) bg rgb) - (setq default-frame-background-mode 'light) + (set-terminal-parameter nil 'background-mode 'light) (when (and fgbg (string-match ".*;\\([0-9][0-9]?\\)\\'" fgbg)) (setq bg (string-to-number (substring fgbg (match-beginning 1)))) @@ -295,8 +309,7 @@ for the currently selected frame." ;; The following line assumes that white is the 15th ;; color in rxvt-standard-colors. (* (apply '+ (car (cddr (nth 15 rxvt-standard-colors)))) 0.6)) - (setq default-frame-background-mode 'dark))) - (frame-set-background-mode (selected-frame)))) + (set-terminal-parameter nil 'background-mode 'dark))))) ;; arch-tag: 20cf2fb6-6318-4bab-9dbf-1d15048f2257 ;;; rxvt.el ends here diff --git a/lisp/term/sun-mouse.el b/lisp/term/sun-mouse.el index 65ebe193c71..d3e85508b03 100644 --- a/lisp/term/sun-mouse.el +++ b/lisp/term/sun-mouse.el @@ -501,7 +501,7 @@ If there is no documentation string, then the string (defun print-mouse-format (binding) (princ (car binding)) (princ ": ") - (mapcar (function + (mapc (function (lambda (mouse-list) (princ mouse-list) (princ " "))) @@ -660,21 +660,6 @@ Insert contents into the current buffer at point." (interactive "r") (sun-set-selection (buffer-substring beg end))) -;;; -;;; Support for emacstool -;;; This closes the window instead of stopping emacs. -;;; -(defun suspend-emacstool (&optional stuffstring) - "Suspend emacstool. -If running under as a detached process emacstool, -you don't want to suspend (there is no way to resume), -just close the window, and wait for reopening." - (interactive) - (run-hooks 'suspend-hook) - (if stuffstring (send-string-to-terminal stuffstring)) - (send-string-to-terminal "\033[2t") ; To close EmacsTool window. - (run-hooks 'suspend-resume-hook)) - (provide 'sun-mouse) (provide 'term/sun-mouse) ; have to (require 'term/sun-mouse) diff --git a/lisp/term/sun.el b/lisp/term/sun.el index c3dc773e26b..b3ee0ec458e 100644 --- a/lisp/term/sun.el +++ b/lisp/term/sun.el @@ -32,12 +32,12 @@ (defun scroll-down-in-place (n) (interactive "p") - (previous-line n) + (forward-line (- n)) (scroll-down n)) (defun scroll-up-in-place (n) (interactive "p") - (next-line n) + (forward-line n) (scroll-up n)) (defun kill-region-and-unmark (beg end) @@ -102,55 +102,10 @@ "List of forms to evaluate after setting sun-raw-prefix.") -;;; This section adds definitions for the emacstool users -;; emacstool event filter converts function keys to C-x*{c}{lrt} -;; -;; for example the Open key (L7) would be encoded as "\C-x*gl" -;; the control, meta, and shift keys modify the character {lrt} -;; note that (unshifted) C-l is ",", C-r is "2", and C-t is "4" -;; -;; {c} is [a-j] for LEFT, [a-i] for TOP, [a-o] for RIGHT. -;; A higher level insists on encoding {h,j,l,n}{r} (the arrow keys) -;; as ANSI escape sequences. Use the shell command -;; % setkeys noarrows -;; if you want these to come through for emacstool. -;; -;; If you are not using EmacsTool, -;; you can also use this by creating a .ttyswrc file to do the conversion. -;; but it won't include the CONTROL, META, or SHIFT keys! -;; -;; Important to define SHIFTed sequence before matching unshifted sequence. -;; (talk about bletcherous old uppercase terminal conventions!*$#@&%*&#$%) -;; this is worse than C-S/C-Q flow control anyday! -;; Do *YOU* run in capslock mode? -;; - -;; Note: al, el and gl are trapped by EmacsTool, so they never make it here. - -(defvar suntool-map (make-sparse-keymap) - "*Keymap for Emacstool bindings.") - - -;; Since .emacs gets loaded before this file, a hook is supplied -;; for you to put your own bindings in. - -(defvar suntool-map-hooks nil - "List of forms to evaluate after setting suntool-map.") - -;; -;; If running under emacstool, arrange to call suspend-emacstool -;; instead of suspend-emacs. -;; -;; First mouse blip is a clue that we are in emacstool. -;; -;; C-x C-@ is the mouse command prefix. - -(autoload 'sun-mouse-handler "sun-mouse" - "Sun Emacstool handler for mouse blips (not loaded)." t) (defun terminal-init-sun () "Terminal initialization function for sun." - (define-key function-key-map "\e[" sun-raw-prefix) + (define-key local-function-key-map "\e[" sun-raw-prefix) (define-key sun-raw-prefix "210z" [r3]) (define-key sun-raw-prefix "213z" [r6]) @@ -207,77 +162,7 @@ (let ((hooks sun-raw-prefix-hooks)) (while hooks (eval (car hooks)) - (setq hooks (cdr hooks))))) - - (define-key suntool-map "gr" 'beginning-of-buffer) ; r7 - (define-key suntool-map "iR" 'backward-page) ; R9 - (define-key suntool-map "ir" 'scroll-down) ; r9 - (define-key suntool-map "kr" 'recenter) ; r11 - (define-key suntool-map "mr" 'end-of-buffer) ; r13 - (define-key suntool-map "oR" 'forward-page) ; R15 - (define-key suntool-map "or" 'scroll-up) ; r15 - (define-key suntool-map "b\M-L" 'rerun-prev-command) ; M-AGAIN - (define-key suntool-map "b\M-l" 'prev-complex-command) ; M-Again - (define-key suntool-map "bl" 'redraw-display) ; Again - (define-key suntool-map "cl" 'list-buffers) ; Props - (define-key suntool-map "dl" 'undo) ; Undo - (define-key suntool-map "el" 'ignore) ; Expose-Open - (define-key suntool-map "fl" 'sun-select-region) ; Put - (define-key suntool-map "f," 'copy-region-as-kill) ; C-Put - (define-key suntool-map "gl" 'ignore) ; Open-Open - (define-key suntool-map "hl" 'sun-yank-selection) ; Get - (define-key suntool-map "h," 'yank) ; C-Get - (define-key suntool-map "il" 'research-forward) ; Find - (define-key suntool-map "i," 're-search-forward) ; C-Find - (define-key suntool-map "i\M-l" 'research-backward) ; M-Find - (define-key suntool-map "i\M-," 're-search-backward) ; C-M-Find - - (define-key suntool-map "jL" 'yank) ; DELETE - (define-key suntool-map "jl" 'kill-region-and-unmark) ; Delete - (define-key suntool-map "j\M-l" 'exchange-point-and-mark) ; M-Delete - (define-key suntool-map "j," - (lambda () (interactive) (pop-mark))) ; C-Delete - - (define-key suntool-map "fT" 'shrink-window-horizontally) ; T6 - (define-key suntool-map "gT" 'enlarge-window-horizontally) ; T7 - (define-key suntool-map "ft" 'shrink-window) ; t6 - (define-key suntool-map "gt" 'enlarge-window) ; t7 - (define-key suntool-map "cT" (lambda (n) (interactive "p") (scroll-down n))) - (define-key suntool-map "dT" (lambda (n) (interactive "p") (scroll-up n))) - (define-key suntool-map "ct" 'scroll-down-in-place) ; t3 - (define-key suntool-map "dt" 'scroll-up-in-place) ; t4 - (define-key ctl-x-map "*" suntool-map) - - (when suntool-map-hooks - (message "suntool-map-hooks is obsolete! Use term-setup-hook instead!") - (let ((hooks suntool-map-hooks)) - (while hooks - (eval (car hooks)) - (setq hooks (cdr hooks))))) - - (define-key ctl-x-map "\C-@" 'sun-mouse-once)) - -(defun emacstool-init () - "Set up Emacstool window, if you know you are in an emacstool." - ;; Make sure sun-mouse and sun-fns are loaded. - (require 'sun-fns) - (define-key ctl-x-map "\C-@" 'sun-mouse-handler) - - ;; FIXME: this function does not seem to exist either. -stef'01 - (if (< (sun-window-init) 0) - (message "Not a Sun Window") - (progn - (substitute-key-definition 'suspend-emacs 'suspend-emacstool global-map) - (substitute-key-definition 'suspend-emacs 'suspend-emacstool esc-map) - (substitute-key-definition 'suspend-emacs 'suspend-emacstool ctl-x-map)) - (send-string-to-terminal - (concat "\033]lEmacstool - GNU Emacs " emacs-version "\033\\")))) - -(defun sun-mouse-once () - "Converts to emacstool and sun-mouse-handler on first mouse hit." - (interactive) - (emacstool-init) - (sun-mouse-handler)) ; Now, execute this mouse blip. + (setq hooks (cdr hooks)))))) ;;; arch-tag: db761d47-fd7d-42b4-aae1-04fa116b6ba6 ;;; sun.el ends here diff --git a/lisp/term/tvi970.el b/lisp/term/tvi970.el index 1c0bda519ac..1898153cf2a 100644 --- a/lisp/term/tvi970.el +++ b/lisp/term/tvi970.el @@ -31,14 +31,14 @@ (defun terminal-init-tvi970 () "Terminal initialization function for tvi970." - (or (lookup-key function-key-map "\e[") - (define-key function-key-map "\e[" (make-keymap))) - ;; (or (lookup-key function-key-map "\eO") - ;; (define-key function-key-map "\eO" (make-keymap))) + (or (lookup-key local-function-key-map "\e[") + (define-key local-function-key-map "\e[" (make-keymap))) + ;; (or (lookup-key local-function-key-map "\eO") + ;; (define-key local-function-key-map "\eO" (make-keymap))) ;; Miscellaneous keys - (mapcar (function (lambda (key-binding) - (define-key function-key-map + (mapc (function (lambda (key-binding) + (define-key local-function-key-map (car key-binding) (nth 1 key-binding)))) '( ;; These are set up by termcap or terminfo @@ -54,7 +54,7 @@ ("\e[@" [insert]) ("\e[L" [insertline]) ("\e[M" [deleteline]) - ("\e[U" [next]) ;; actually the `page' key + ("\e[U" [next]) ;; actually the `page' key ;; These won't be set up by either ("\eOm" [kp-subtract]) @@ -87,22 +87,23 @@ ;; The numeric keypad keys. (let ((i 0)) (while (< i 10) - (define-key function-key-map + (define-key local-function-key-map (format "\eO%c" (+ i ?p)) (vector (intern (format "kp-%d" i)))) (setq i (1+ i)))) ;; The numbered function keys. (let ((i 0)) (while (< i 16) - (define-key function-key-map + (define-key local-function-key-map (format "\e?%c" (+ i ?a)) (vector (intern (format "f%d" (1+ i))))) - (define-key function-key-map + (define-key local-function-key-map (format "\e?%c" (+ i ?A)) (vector (intern (format "S-f%d" (1+ i))))) (setq i (1+ i)))) (tvi970-set-keypad-mode 1)) + ;;; Should keypad numbers send ordinary digits or distinct escape sequences? (defvar tvi970-keypad-numeric nil diff --git a/lisp/term/vt100.el b/lisp/term/vt100.el index b185a7bb02f..17627db8923 100644 --- a/lisp/term/vt100.el +++ b/lisp/term/vt100.el @@ -38,10 +38,9 @@ ;; Set up function-key-map entries that termcap and terminfo don't know. - (defun terminal-init-vt100 () "Terminal initialization function for vt100." - (load "term/lk201" nil t)) + (tty-run-terminal-initialization (selected-frame) "lk201")) ;;; Controlling the screen width. (defvar vt100-wide-mode (= (frame-width) 132) diff --git a/lisp/term/vt102.el b/lisp/term/vt102.el index ad780ed5081..67a90a8242c 100644 --- a/lisp/term/vt102.el +++ b/lisp/term/vt102.el @@ -1,8 +1,8 @@ ;; -*- no-byte-compile: t -*- (defun terminal-init-vt102 () - "Terminal initialization function for vt102." - (load "term/vt100" nil t)) + "Terminal initialization function for vt102." + (tty-run-terminal-initialization (selected-frame) "vt100")) ;;; arch-tag: 6e839cfc-125a-4574-82f1-c23a51f7c50f ;;; vt102.el ends here diff --git a/lisp/term/vt125.el b/lisp/term/vt125.el index 2221e597aed..82a7047fef1 100644 --- a/lisp/term/vt125.el +++ b/lisp/term/vt125.el @@ -1,8 +1,8 @@ ;; -*- no-byte-compile: t -*- (defun terminal-init-vt125 () - "Terminal initialization function for vt125." - (load "term/vt100" nil t)) + "Terminal initialization function for vt125." + (tty-run-terminal-initialization (selected-frame) "vt100")) ;;; arch-tag: 1d92d70f-dd55-4a1d-9088-e215a4883801 ;;; vt125.el ends here diff --git a/lisp/term/vt200.el b/lisp/term/vt200.el index e1215d15023..7e7b3281d92 100644 --- a/lisp/term/vt200.el +++ b/lisp/term/vt200.el @@ -1,12 +1,11 @@ ;; -*- no-byte-compile: t -*- ;; For our purposes we can treat the vt200 and vt100 almost alike. ;; Most differences are handled by the termcap entry. - (defun terminal-init-vt200 () - "Terminal initialization function for vt200." - (load "term/vt100" nil t) + "Terminal initialization function for vt200." + (tty-run-terminal-initialization (selected-frame) "vt100") ;; Make F11 an escape key. - (define-key function-key-map "\e[23~" [?\e])) + (define-key local-function-key-map "\e[23~" [?\e])) ;;; arch-tag: 0f78f583-9f32-4237-b106-28bcfff21d89 ;;; vt200.el ends here diff --git a/lisp/term/vt201.el b/lisp/term/vt201.el index 315030ab687..a63f9561a6d 100644 --- a/lisp/term/vt201.el +++ b/lisp/term/vt201.el @@ -2,10 +2,10 @@ ;; For our purposes we can treat the vt200 and vt100 almost alike. ;; Most differences are handled by the termcap entry. (defun terminal-init-vt201 () - "Terminal initialization function for vt201." - (load "term/vt100" nil t) + "Terminal initialization function for vt201." + (tty-run-terminal-initialization (selected-frame) "vt100") ;; Make F11 an escape key. - (define-key function-key-map "\e[23~" [?\e])) + (define-key local-function-key-map "\e[23~" [?\e])) ;;; arch-tag: a6abb38f-60ea-449e-a9e9-3fb8572c52ae ;;; vt201.el ends here diff --git a/lisp/term/vt220.el b/lisp/term/vt220.el index cccd2a6dfb7..b2b8fc944cf 100644 --- a/lisp/term/vt220.el +++ b/lisp/term/vt220.el @@ -2,10 +2,10 @@ ;; For our purposes we can treat the vt200 and vt100 almost alike. ;; Most differences are handled by the termcap entry. (defun terminal-init-vt220 () - "Terminal initialization function for vt220." - (load "term/vt100" nil t) + "Terminal initialization function for vt220." + (tty-run-terminal-initialization (selected-frame) "vt100") ;; Make F11 an escape key. - (define-key function-key-map "\e[23~" [?\e])) + (define-key local-function-key-map "\e[23~" [?\e])) ;;; arch-tag: 98fc4867-a20d-46a1-a276-d7be31e49871 ;;; vt220.el ends here diff --git a/lisp/term/vt240.el b/lisp/term/vt240.el index bb3931edac8..cb26ebf4069 100644 --- a/lisp/term/vt240.el +++ b/lisp/term/vt240.el @@ -2,10 +2,10 @@ ;; For our purposes we can treat the vt200 and vt100 almost alike. ;; Most differences are handled by the termcap entry. (defun terminal-init-vt240 () - "Terminal initialization function for vt240." - (load "term/vt100" nil t) + "Terminal initialization function for vt240." + (tty-run-terminal-initialization (selected-frame) "vt100") ;; Make F11 an escape key. - (define-key function-key-map "\e[23~" [?\e])) + (define-key local-function-key-map "\e[23~" [?\e])) ;;; arch-tag: d9f88e9c-02dc-49ff-871c-a415f08e4eb7 ;;; vt240.el ends here diff --git a/lisp/term/vt300.el b/lisp/term/vt300.el index ff600f47a1e..9a09ad5e8cb 100644 --- a/lisp/term/vt300.el +++ b/lisp/term/vt300.el @@ -1,9 +1,9 @@ ;; -*- no-byte-compile: t -*- (defun terminal-init-vt300 () - "Terminal initialization function for vt300." - (load "term/vt100" nil t) + "Terminal initialization function for vt300." + (tty-run-terminal-initialization (selected-frame) "vt100") ;; Make F11 an escape key. - (define-key function-key-map "\e[23~" [?\e])) + (define-key local-function-key-map "\e[23~" [?\e])) ;;; arch-tag: 876831c9-a6f2-444a-b033-706e6fbc149f ;;; vt300.el ends here diff --git a/lisp/term/vt320.el b/lisp/term/vt320.el index fb7772c7b5b..803d7286067 100644 --- a/lisp/term/vt320.el +++ b/lisp/term/vt320.el @@ -1,9 +1,9 @@ ;; -*- no-byte-compile: t -*- (defun terminal-init-vt320 () - "Terminal initialization function for vt320." - (load "term/vt100" nil t) + "Terminal initialization function for vt320." + (tty-run-terminal-initialization (selected-frame) "vt100") ;; Make F11 an escape key. - (define-key function-key-map "\e[23~" [?\e])) + (define-key local-function-key-map "\e[23~" [?\e])) ;;; arch-tag: f9f4c954-0b9e-45f9-b450-a320d32abd9c ;;; vt320.el ends here diff --git a/lisp/term/vt400.el b/lisp/term/vt400.el index 97c0c5d7372..f73f4660b94 100644 --- a/lisp/term/vt400.el +++ b/lisp/term/vt400.el @@ -1,9 +1,9 @@ ;; -*- no-byte-compile: t -*- (defun terminal-init-vt400 () - "Terminal initialization function for vt400." - (load "term/vt100" nil t) + "Terminal initialization function for vt400." + (tty-run-terminal-initialization (selected-frame) "vt100") ;; Make F11 an escape key. - (define-key function-key-map "\e[23~" [?\e])) + (define-key local-function-key-map "\e[23~" [?\e])) ;;; arch-tag: a70809c5-6b21-42cc-ba20-536683e5e7d5 ;;; vt400.el ends here diff --git a/lisp/term/vt420.el b/lisp/term/vt420.el index 65ffa759c17..e65ba1a61d5 100644 --- a/lisp/term/vt420.el +++ b/lisp/term/vt420.el @@ -1,9 +1,9 @@ ;; -*- no-byte-compile: t -*- -(defun terminal-init-vt420 () - "Terminal initialization function for vt420." - (load "term/vt100" nil t) +(defun terminal-init-vt420 + "Terminal initialization function for vt420." + (tty-run-terminal-initialization (selected-frame) "vt100") ;; Make F11 an escape key. - (define-key function-key-map "\e[23~" [?\e])) + (define-key local-function-key-map "\e[23~" [?\e])) ;;; arch-tag: df2f897c-3a12-4b3c-9259-df089f96c160 ;;; vt420.el ends here diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el index 3d17fb370c2..08b57cb6d83 100644 --- a/lisp/term/w32-win.el +++ b/lisp/term/w32-win.el @@ -68,8 +68,8 @@ ;; An alist of X options and the function which handles them. See ;; ../startup.el. -(if (not (eq window-system 'w32)) - (error "%s: Loading w32-win.el but not compiled for w32" (invocation-name))) +;; (if (not (eq window-system 'w32)) +;; (error "%s: Loading w32-win.el but not compiled for w32" (invocation-name))) (require 'frame) (require 'mouse) @@ -80,6 +80,10 @@ (require 'dnd) (require 'code-pages) +;; Keep an obsolete alias for w32-focus-frame in case it is used by code +;; outside Emacs. +(define-obsolete-function-alias 'w32-focus-frame 'x-focus-frame "23.1") + (defvar xlfd-regexp-registry-subnum) ;; Conditional on new-fontset so bootstrapping works on non-GUI compiles @@ -89,9 +93,6 @@ ;; The following definition is used for debugging scroll bar events. ;(defun w32-handle-scroll-bar-event (event) (interactive "e") (princ event)) -;; Handle mouse-wheel events with mwheel. -(mouse-wheel-mode 1) - (defun w32-drag-n-drop-debug (event) "Print the drag-n-drop EVENT in a readable form." (interactive "e") @@ -111,7 +112,7 @@ Switch to a buffer editing the last file dropped." (y (cdr coords))) (if (and (> x 0) (> y 0)) (set-frame-selected-window nil window)) - (mapcar (lambda (file-name) + (mapc (lambda (file-name) (let ((f (subst-char-in-string ?\\ ?/ file-name)) (coding (or file-name-coding-system default-file-name-coding-system))) @@ -1039,58 +1040,30 @@ XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp") ;;;; Function keys -;;; make f10 activate the real menubar rather than the mini-buffer menu -;;; navigation feature. -(defun menu-bar-open (&optional frame) - "Start key navigation of the menu bar in FRAME. - -This initially activates the first menu-bar item, and you can then navigate -with the arrow keys, select a menu entry with the Return key or cancel with -the Escape key. If FRAME has no menu bar, this function does nothing. - -If FRAME is nil or not given, use the selected frame." - (interactive "i") - (w32-send-sys-command ?\xf100 frame)) -; -(global-set-key [f10] 'menu-bar-open) - -(substitute-key-definition 'suspend-emacs 'iconify-or-deiconify-frame - global-map) - -(define-key function-key-map [S-tab] [backtab]) - + ;;; make f10 activate the real menubar rather than the mini-buffer menu + ;;; navigation feature. + (defun menu-bar-open (&optional frame) + "Start key navigation of the menu bar in FRAME. + + This initially activates the first menu-bar item, and you can then navigate + with the arrow keys, select a menu entry with the Return key or cancel with + the Escape key. If FRAME has no menu bar, this function does nothing. + + If FRAME is nil or not given, use the selected frame." + (interactive "i") + (w32-send-sys-command ?\xf100 frame)) + +(defun x-setup-function-keys (frame) + "Setup Function Keys for w32." + (with-selected-frame frame + (define-key local-function-key-map [f10] 'menu-bar-open) + + (substitute-key-definition 'suspend-emacs 'iconify-or-deiconify-frame + local-function-key-map global-map) + + (define-key local-function-key-map [S-tab] [backtab])) + (set-terminal-parameter frame 'x-setup-function-keys t)) -;;; Do the actual Windows setup here; the above code just defines -;;; functions and variables that we use now. - -(setq command-line-args (x-handle-args command-line-args)) - -;;; Make sure we have a valid resource name. -(or (stringp x-resource-name) - (setq x-resource-name - ;; Change any . or * characters in x-resource-name to hyphens, - ;; so as not to choke when we use it in X resource queries. - (replace-regexp-in-string "[.*]" "-" (invocation-name)))) - -;; For the benefit of older Emacses (19.27 and earlier) that are sharing -;; the same lisp directory, don't pass the third argument unless we seem -;; to have the multi-display support. -(if (fboundp 'x-close-connection) - (x-open-connection "" - x-command-line-resources - ;; Exit Emacs with fatal error if this fails. - t) - (x-open-connection "" - x-command-line-resources)) - -(setq frame-creation-function 'x-create-frame-with-faces) - -(setq x-cut-buffer-max (min (- (/ (x-server-max-request-size) 2) 100) - x-cut-buffer-max)) - -;; W32 expects the menu bar cut and paste commands to use the clipboard. -;; This has ,? to match both on Sunos and on Solaris. -(menu-bar-enable-clipboard) ;; W32 systems have different fonts than commonly found on X, so ;; we define our own standard fontset here. @@ -1144,45 +1117,7 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.") (defun x-win-suspend-error () "Report an error when a suspend is attempted." (error "Suspending an Emacs running under W32 makes no sense")) -(add-hook 'suspend-hook 'x-win-suspend-error) - -;;; Turn off window-splitting optimization; w32 is usually fast enough -;;; that this is only annoying. -(setq split-window-keep-point t) - -;; Don't show the frame name; that's redundant. -(setq-default mode-line-frame-identification " ") - -;;; Set to a system sound if you want a fancy bell. -(set-message-beep 'ok) - -;; Remap some functions to call w32 common dialogs - -(defun internal-face-interactive (what &optional bool) - (let* ((fn (intern (concat "face-" what))) - (prompt (concat "Set " what " of face ")) - (face (read-face-name prompt)) - (default (if (fboundp fn) - (or (funcall fn face (selected-frame)) - (funcall fn 'default (selected-frame))))) - (fn-win (intern (concat (symbol-name window-system) "-select-" what))) - value) - (setq value - (cond ((fboundp fn-win) - (funcall fn-win)) - ((eq bool 'color) - (completing-read (concat prompt " " (symbol-name face) " to: ") - (mapcar (function (lambda (color) - (cons color color))) - x-colors) - nil nil nil nil default)) - (bool - (y-or-n-p (concat "Should face " (symbol-name face) - " be " bool "? "))) - (t - (read-string (concat prompt " " (symbol-name face) " to: ") - nil nil default)))) - (list face (if (equal value "") nil value)))) + ;;; Enable Japanese fonts on Windows to be used by default. ;; (set-fontset-font nil (make-char 'katakana-jisx0201) '("*" . "JISX0208-SJIS")) @@ -1229,7 +1164,120 @@ pop-up menu are unaffected by `w32-list-proportional-fonts')." (png "libpng13d.dll" "libpng13.dll" "libpng12d.dll" "libpng12.dll" "libpng.dll") (jpeg "jpeg62.dll" "libjpeg.dll" "jpeg-62.dll" "jpeg.dll") (tiff "libtiff3.dll" "libtiff.dll") - (gif "giflib4.dll" "libungif4.dll" "libungif.dll"))) + (gif "giflib4.dll" "libungif4.dll" "libungif.dll") + (svg "librsvg-2-2.dll") + (gdk-pixbuf "libgdk_pixbuf-2.0-0.dll") + (glib "libglib-2.0-0.dll"))) + +;;; multi-tty support +(defvar w32-initialized nil + "Non-nil if the w32 window system has been initialized.") + +(defun w32-initialize-window-system () + "Initialize Emacs for W32 GUI frames." + + ;; Do the actual Windows setup here; the above code just defines + ;; functions and variables that we use now. + + (setq command-line-args (x-handle-args command-line-args)) + + ;; Make sure we have a valid resource name. + (or (stringp x-resource-name) + (setq x-resource-name + ;; Change any . or * characters in x-resource-name to hyphens, + ;; so as not to choke when we use it in X resource queries. + (replace-regexp-in-string "[.*]" "-" (invocation-name)))) + + (x-open-connection "" x-command-line-resources + ;; Exit with a fatal error if this fails and we + ;; are the initial display + (eq initial-window-system 'w32)) + + ;; Setup the default fontset. + (setup-default-fontset) + ;; Create the standard fontset. + (create-fontset-from-fontset-spec w32-standard-fontset-spec t) + ;; Create fontset specified in X resources "Fontset-N" (N is 0, 1,...). + (create-fontset-from-x-resource) + ;; Try to create a fontset from a font specification which comes + ;; from initial-frame-alist, default-frame-alist, or X resource. + ;; A font specification in command line argument (i.e. -fn XXXX) + ;; should be already in default-frame-alist as a `font' + ;; parameter. However, any font specifications in site-start + ;; library, user's init file (.emacs), and default.el are not + ;; yet handled here. + + (let ((font (or (cdr (assq 'font initial-frame-alist)) + (cdr (assq 'font default-frame-alist)) + (x-get-resource "font" "Font"))) + xlfd-fields resolved-name) + (if (and font + (not (query-fontset font)) + (setq resolved-name (x-resolve-font-name font)) + (setq xlfd-fields (x-decompose-font-name font))) + (if (string= "fontset" + (aref xlfd-fields xlfd-regexp-registry-subnum)) + (new-fontset font + (x-complement-fontset-spec xlfd-fields nil)) + ;; Create a fontset from FONT. The fontset name is + ;; generated from FONT. + (create-fontset-from-ascii-font font + resolved-name "startup")))) + + ;; Apply a geometry resource to the initial frame. Put it at the end + ;; of the alist, so that anything specified on the command line takes + ;; precedence. + (let* ((res-geometry (x-get-resource "geometry" "Geometry")) + parsed) + (if res-geometry + (progn + (setq parsed (x-parse-geometry res-geometry)) + ;; If the resource specifies a position, + ;; call the position and size "user-specified". + (if (or (assq 'top parsed) (assq 'left parsed)) + (setq parsed (cons '(user-position . t) + (cons '(user-size . t) parsed)))) + ;; All geometry parms apply to the initial frame. + (setq initial-frame-alist (append initial-frame-alist parsed)) + ;; The size parms apply to all frames. + (if (assq 'height parsed) + (push (cons 'height (cdr (assq 'height parsed))) + default-frame-alist)) + (if (assq 'width parsed) + (push (cons 'width (cdr (assq 'width parsed))) + default-frame-alist))))) + + ;; Check the reverseVideo resource. + (let ((case-fold-search t)) + (let ((rv (x-get-resource "reverseVideo" "ReverseVideo"))) + (if (and rv (string-match "^\\(true\\|yes\\|on\\)$" rv)) + (push '(reverse . t) default-frame-alist)))) + + ;; Don't let Emacs suspend under w32 gui + (add-hook 'suspend-hook 'x-win-suspend-error) + + ;; Turn off window-splitting optimization; w32 is usually fast enough + ;; that this is only annoying. + (setq split-window-keep-point t) + + ;; Turn on support for mouse wheels + (mouse-wheel-mode 1) + + ;; W32 expects the menu bar cut and paste commands to use the clipboard. + (menu-bar-enable-clipboard) + + ;; Don't show the frame name; that's redundant. + (setq-default mode-line-frame-identification " ") + + ;; Set to a system sound if you want a fancy bell. + (set-message-beep 'ok) + (setq w32-initialized t)) + +(add-to-list 'handle-args-function-alist '(w32 . x-handle-args)) +(add-to-list 'frame-creation-function-alist '(w32 . x-create-frame-with-faces)) +(add-to-list 'window-system-initialization-alist '(w32 . w32-initialize-window-system)) + +(provide 'w32-win) ;; arch-tag: 69fb1701-28c2-4890-b351-3d1fe4b4f166 ;;; w32-win.el ends here diff --git a/lisp/term/wyse50.el b/lisp/term/wyse50.el index c0e4334f522..e241224c637 100644 --- a/lisp/term/wyse50.el +++ b/lisp/term/wyse50.el @@ -40,9 +40,9 @@ (defun terminal-init-wyse50 () "Terminal initialization function for wyse50." - (define-key function-key-map "\C-a" (make-keymap)) + (define-key local-function-key-map "\C-a" (make-keymap)) (mapcar (function (lambda (key-definition) - (define-key function-key-map + (define-key local-function-key-map (car key-definition) (nth 1 key-definition)))) '( ;; These might be set up by termcap and terminfo @@ -100,11 +100,11 @@ ("\eY" [key-clear]) ;; Not an X keysym ;; These are totally strange :-) - ("\eW" [?\C-?]) ;; Not an X keysym - ("\^a\^k\^m" [funct-up]) ;; Not an X keysym - ("\^a\^j\^m" [funct-down]) ;; Not an X keysym - ("\^a\^l\^m" [funct-right]) ;; Not an X keysym - ("\^a\^h\^m" [funct-left]) ;; Not an X keysym + ("\eW" [?\C-?]) ;; Not an X keysym + ("\^a\^k\^m" [funct-up]) ;; Not an X keysym + ("\^a\^j\^m" [funct-down]) ;; Not an X keysym + ("\^a\^l\^m" [funct-right]) ;; Not an X keysym + ("\^a\^h\^m" [funct-left]) ;; Not an X keysym ("\^a\^m\^m" [funct-return]) ;; Not an X keysym ("\^a\^i\^m" [funct-tab]) ;; Not an X keysym )) diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el index 246b38a6c9f..138df0f2da5 100644 --- a/lisp/term/x-win.el +++ b/lisp/term/x-win.el @@ -25,10 +25,16 @@ ;;; Commentary: -;; X-win.el: this file is loaded from ../lisp/startup.el when it recognizes -;; that X windows are to be used. Command line switches are parsed and those -;; pertaining to X are processed and removed from the command line. The -;; X display is opened and hooks are set for popping up the initial window. +;; X-win.el: this file defines functions to initialize the X window +;; system and process X-specific command line parameters before +;; creating the first X frame. + +;; Note that contrary to previous Emacs versions, the act of loading +;; this file should not have the side effect of initializing the +;; window system or processing command line arguments (this file is +;; now loaded in loadup.el). See the variables +;; `handle-args-function-alist' and +;; `window-system-initialization-alist' for more details. ;; startup.el will then examine startup files, and eventually call the hooks ;; which create the first window(s). @@ -65,7 +71,7 @@ ;; An alist of X options and the function which handles them. See ;; ../startup.el. -(if (not (eq window-system 'x)) +(if (not (fboundp 'x-create-frame)) (error "%s: Loading x-win.el but not compiled for X" (invocation-name))) (require 'frame) @@ -395,6 +401,7 @@ exists." (defconst x-pointer-ur-angle 148) (defconst x-pointer-watch 150) (defconst x-pointer-xterm 152) +(defconst x-pointer-invisible 255) ;; ;; Available colors @@ -1170,27 +1177,39 @@ XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp") ;;;; Function keys -(substitute-key-definition 'suspend-emacs 'iconify-or-deiconify-frame - global-map) - -;; Map certain keypad keys into ASCII characters -;; that people usually expect. -(define-key function-key-map [backspace] [127]) -(define-key function-key-map [delete] [127]) -(define-key function-key-map [tab] [?\t]) -(define-key function-key-map [linefeed] [?\n]) -(define-key function-key-map [clear] [?\C-l]) -(define-key function-key-map [return] [?\C-m]) -(define-key function-key-map [escape] [?\e]) -(define-key function-key-map [M-backspace] [?\M-\d]) -(define-key function-key-map [M-delete] [?\M-\d]) -(define-key function-key-map [M-tab] [?\M-\t]) -(define-key function-key-map [M-linefeed] [?\M-\n]) -(define-key function-key-map [M-clear] [?\M-\C-l]) -(define-key function-key-map [M-return] [?\M-\C-m]) -(define-key function-key-map [M-escape] [?\M-\e]) -(define-key function-key-map [iso-lefttab] [backtab]) -(define-key function-key-map [S-iso-lefttab] [backtab]) +(defvar x-alternatives-map + (let ((map (make-sparse-keymap))) + ;; Map certain keypad keys into ASCII characters that people usually expect. + (define-key map [backspace] [127]) + (define-key map [delete] [127]) + (define-key map [tab] [?\t]) + (define-key map [linefeed] [?\n]) + (define-key map [clear] [?\C-l]) + (define-key map [return] [?\C-m]) + (define-key map [escape] [?\e]) + (define-key map [M-backspace] [?\M-\d]) + (define-key map [M-delete] [?\M-\d]) + (define-key map [M-tab] [?\M-\t]) + (define-key map [M-linefeed] [?\M-\n]) + (define-key map [M-clear] [?\M-\C-l]) + (define-key map [M-return] [?\M-\C-m]) + (define-key map [M-escape] [?\M-\e]) + (define-key map [iso-lefttab] [backtab]) + (define-key map [S-iso-lefttab] [backtab]) + map) + "Keymap of possible alternative meanings for some keys.") + +(defun x-setup-function-keys (frame) + "Set up `function-key-map' on FRAME for the X window system." + ;; Don't do this twice on the same display, or it would break + ;; normal-erase-is-backspace-mode. + (unless (terminal-parameter frame 'x-setup-function-keys) + ;; Map certain keypad keys into ASCII characters that people usually expect. + (with-selected-frame frame + (let ((map (copy-keymap x-alternatives-map))) + (set-keymap-parent map (keymap-parent local-function-key-map)) + (set-keymap-parent local-function-key-map map))) + (set-terminal-parameter frame 'x-setup-function-keys t))) ;; These tell read-char how to convert ;; these special chars to ASCII. @@ -2349,15 +2368,15 @@ order until succeed.") (cond;; check cut buffer ((or (not cut-text) (string= cut-text "")) (setq x-last-selected-text-cut nil)) - ;; This short cut doesn't work because x-get-cut-buffer - ;; always returns a newly created string. - ;; ((eq cut-text x-last-selected-text-cut) nil) + ;; This short cut doesn't work because x-get-cut-buffer + ;; always returns a newly created string. + ;; ((eq cut-text x-last-selected-text-cut) nil) ((and (string= cut-text x-last-selected-text-cut-encoded) (eq x-last-cut-buffer-coding next-coding)) - ;; See the comment above. No need of this recording. - ;; Record the newer string, - ;; so subsequent calls can use the `eq' test. - ;; (setq x-last-selected-text-cut cut-text) + ;; See the comment above. No need of this recording. + ;; Record the newer string, + ;; so subsequent calls can use the `eq' test. + ;; (setq x-last-selected-text-cut cut-text) nil) (t (setq x-last-selected-text-cut-encoded cut-text @@ -2365,7 +2384,7 @@ order until succeed.") x-last-selected-text-cut ;; ICCCM says cut buffer always contain ISO-Latin-1, but ;; use next-selection-coding-system if not nil. - (decode-coding-string + (decode-coding-string cut-text next-coding)))))) ;; As we have done one selection, clear this now. @@ -2394,182 +2413,328 @@ order until succeed.") (or clip-text primary-text cut-text) )) - -;; Do the actual X Windows setup here; the above code just defines -;; functions and variables that we use now. - -(setq command-line-args (x-handle-args command-line-args)) - -;; Make sure we have a valid resource name. -(or (stringp x-resource-name) - (let (i) - (setq x-resource-name (invocation-name)) - - ;; Change any . or * characters in x-resource-name to hyphens, - ;; so as not to choke when we use it in X resource queries. - (while (setq i (string-match "[.*]" x-resource-name)) - (aset x-resource-name i ?-)))) - -(x-open-connection (or x-display-name - (setq x-display-name (getenv "DISPLAY"))) - x-command-line-resources - ;; Exit Emacs with fatal error if this fails. - t) - -(setq frame-creation-function 'x-create-frame-with-faces) - -(setq x-cut-buffer-max (min (- (/ (x-server-max-request-size) 2) 100) - x-cut-buffer-max)) - -;; Setup the default fontset. -(setup-default-fontset) - -;; Create the standard fontset. -(create-fontset-from-fontset-spec standard-fontset-spec t) - -;; Create fontset specified in X resources "Fontset-N" (N is 0, 1, ...). -(create-fontset-from-x-resource) - -;; Apply a geometry resource to the initial frame. Put it at the end -;; of the alist, so that anything specified on the command line takes -;; precedence. -(let* ((res-geometry (x-get-resource "geometry" "Geometry")) - parsed) - (if res-geometry - (progn - (setq parsed (x-parse-geometry res-geometry)) - ;; If the resource specifies a position, - ;; call the position and size "user-specified". - (if (or (assq 'top parsed) (assq 'left parsed)) - (setq parsed (cons '(user-position . t) - (cons '(user-size . t) parsed)))) - ;; All geometry parms apply to the initial frame. - (setq initial-frame-alist (append initial-frame-alist parsed)) - ;; The size parms apply to all frames. Don't set it if there are - ;; sizes there already (from command line). - (if (and (assq 'height parsed) - (not (assq 'height default-frame-alist))) - (setq default-frame-alist - (cons (cons 'height (cdr (assq 'height parsed))) - default-frame-alist))) - (if (and (assq 'width parsed) - (not (assq 'width default-frame-alist))) - (setq default-frame-alist - (cons (cons 'width (cdr (assq 'width parsed))) - default-frame-alist)))))) - -;; Check the reverseVideo resource. -(let ((case-fold-search t)) - (let ((rv (x-get-resource "reverseVideo" "ReverseVideo"))) - (if (and rv - (string-match "^\\(true\\|yes\\|on\\)$" rv)) - (setq default-frame-alist - (cons '(reverse . t) default-frame-alist))))) +(defun x-clipboard-yank () + "Insert the clipboard contents, or the last stretch of killed text." + (interactive "*") + (let ((clipboard-text (x-selection-value 'CLIPBOARD)) + (x-select-enable-clipboard t)) + (if (and clipboard-text (> (length clipboard-text) 0)) + (kill-new clipboard-text)) + (yank))) -;; Set x-selection-timeout, measured in milliseconds. -(let ((res-selection-timeout - (x-get-resource "selectionTimeout" "SelectionTimeout"))) - (setq x-selection-timeout 20000) - (if res-selection-timeout - (setq x-selection-timeout (string-to-number res-selection-timeout)))) +(defun x-menu-bar-open (&optional frame) + "Open the menu bar if `menu-bar-mode' is on. otherwise call `tmm-menubar'." + (interactive "i") + (if menu-bar-mode (accelerate-menu frame) + (tmm-menubar))) -;; Set scroll bar mode to right if set by X resources. Default is left. -(if (equal (x-get-resource "verticalScrollBars" "ScrollBars") "right") - (customize-set-variable 'scroll-bar-mode 'right)) + +;;; Window system initialization. (defun x-win-suspend-error () (error "Suspending an Emacs running under X makes no sense")) -(add-hook 'suspend-hook 'x-win-suspend-error) -;; Arrange for the kill and yank functions to set and check the clipboard. -(setq interprogram-cut-function 'x-select-text) -(setq interprogram-paste-function 'x-cut-buffer-or-selection-value) +(defvar x-initialized nil + "Non-nil if the X window system has been initialized.") + +(defun x-initialize-window-system () + "Initialize Emacs for X frames and open the first connection to an X server." + ;; Make sure we have a valid resource name. + (or (stringp x-resource-name) + (let (i) + (setq x-resource-name (invocation-name)) + + ;; Change any . or * characters in x-resource-name to hyphens, + ;; so as not to choke when we use it in X resource queries. + (while (setq i (string-match "[.*]" x-resource-name)) + (aset x-resource-name i ?-)))) + + (x-open-connection (or x-display-name + (setq x-display-name (or (getenv "DISPLAY" (selected-frame)) + (getenv "DISPLAY")))) + x-command-line-resources + ;; Exit Emacs with fatal error if this fails and we + ;; are the initial display. + (eq initial-window-system 'x)) + + (setq x-cut-buffer-max (min (- (/ (x-server-max-request-size) 2) 100) + x-cut-buffer-max)) + + ;; Setup the default fontset. + (setup-default-fontset) + + ;; Create the standard fontset. + (create-fontset-from-fontset-spec standard-fontset-spec t) + + ;; Create fontset specified in X resources "Fontset-N" (N is 0, 1, ...). + (create-fontset-from-x-resource) + + ;; Try to create a fontset from a font specification which comes + ;; from initial-frame-alist, default-frame-alist, or X resource. + ;; A font specification in command line argument (i.e. -fn XXXX) + ;; should be already in default-frame-alist as a `font' + ;; parameter. However, any font specifications in site-start + ;; library, user's init file (.emacs), and default.el are not + ;; yet handled here. + + (let ((font (or (cdr (assq 'font initial-frame-alist)) + (cdr (assq 'font default-frame-alist)) + (x-get-resource "font" "Font"))) + xlfd-fields resolved-name) + (if (and font + (not (query-fontset font)) + (setq resolved-name (x-resolve-font-name font)) + (setq xlfd-fields (x-decompose-font-name font))) + (if (string= "fontset" (aref xlfd-fields xlfd-regexp-registry-subnum)) + (new-fontset font (x-complement-fontset-spec xlfd-fields nil)) + ;; Create a fontset from FONT. The fontset name is + ;; generated from FONT. + (create-fontset-from-ascii-font font resolved-name "startup")))) + + ;; Set scroll bar mode to right if set by X resources. Default is left. + (if (equal (x-get-resource "verticalScrollBars" "ScrollBars") "right") + (customize-set-variable 'scroll-bar-mode 'right)) + + ;; Apply a geometry resource to the initial frame. Put it at the end + ;; of the alist, so that anything specified on the command line takes + ;; precedence. + (let* ((res-geometry (x-get-resource "geometry" "Geometry")) + parsed) + (if res-geometry + (progn + (setq parsed (x-parse-geometry res-geometry)) + ;; If the resource specifies a position, + ;; call the position and size "user-specified". + (if (or (assq 'top parsed) (assq 'left parsed)) + (setq parsed (cons '(user-position . t) + (cons '(user-size . t) parsed)))) + ;; All geometry parms apply to the initial frame. + (setq initial-frame-alist (append initial-frame-alist parsed)) + ;; The size parms apply to all frames. Don't set it if there are + ;; sizes there already (from command line). + (if (and (assq 'height parsed) + (not (assq 'height default-frame-alist))) + (setq default-frame-alist + (cons (cons 'height (cdr (assq 'height parsed))) + default-frame-alist))) + (if (and (assq 'width parsed) + (not (assq 'width default-frame-alist))) + (setq default-frame-alist + (cons (cons 'width (cdr (assq 'width parsed))) + default-frame-alist)))))) + + ;; Check the reverseVideo resource. + (let ((case-fold-search t)) + (let ((rv (x-get-resource "reverseVideo" "ReverseVideo"))) + (if (and rv + (string-match "^\\(true\\|yes\\|on\\)$" rv)) + (setq default-frame-alist + (cons '(reverse . t) default-frame-alist))))) -;; Turn off window-splitting optimization; X is usually fast enough -;; that this is only annoying. -(setq split-window-keep-point t) + ;; Set x-selection-timeout, measured in milliseconds. + (let ((res-selection-timeout + (x-get-resource "selectionTimeout" "SelectionTimeout"))) + (setq x-selection-timeout 20000) + (if res-selection-timeout + (setq x-selection-timeout (string-to-number res-selection-timeout)))) -;; Don't show the frame name; that's redundant with X. -(setq-default mode-line-frame-identification " ") + ;; Don't let Emacs suspend under X. + (add-hook 'suspend-hook 'x-win-suspend-error) -;; Motif direct handling of f10 wasn't working right, -;; So temporarily we've turned it off in lwlib-Xm.c -;; and turned the Emacs f10 back on. -;; ;; Motif normally handles f10 itself, so don't try to handle it a second time. -;; (if (featurep 'motif) -;; (global-set-key [f10] 'ignore)) + ;; Turn off window-splitting optimization; X is usually fast enough + ;; that this is only annoying. + (setq split-window-keep-point t) -;; Turn on support for mouse wheels. -(mouse-wheel-mode 1) + ;; Motif direct handling of f10 wasn't working right, + ;; So temporarily we've turned it off in lwlib-Xm.c + ;; and turned the Emacs f10 back on. + ;; ;; Motif normally handles f10 itself, so don't try to handle it a second time. + ;; (if (featurep 'motif) + ;; (global-set-key [f10] 'ignore)) + ;; Turn on support for mouse wheels. + (mouse-wheel-mode 1) -;; Enable CLIPBOARD copy/paste through menu bar commands. -(menu-bar-enable-clipboard) + ;; Enable CLIPBOARD copy/paste through menu bar commands. + (menu-bar-enable-clipboard) -;; Override Paste so it looks at CLIPBOARD first. -(defun x-clipboard-yank () - "Insert the clipboard contents, or the last stretch of killed text." - (interactive "*") - (let ((clipboard-text (x-selection-value 'CLIPBOARD)) - (x-select-enable-clipboard t)) - (if (and clipboard-text (> (length clipboard-text) 0)) - (kill-new clipboard-text)) - (yank))) + ;; Override Paste so it looks at CLIPBOARD first. + (define-key menu-bar-edit-menu [paste] + (append '(menu-item "Paste" x-clipboard-yank + :enable (not buffer-read-only) + :help "Paste (yank) text most recently cut/copied") + nil)) -(define-key menu-bar-edit-menu [paste] - '(menu-item "Paste" x-clipboard-yank - :enable (not buffer-read-only) - :help "Paste (yank) text most recently cut/copied")) + (setq x-initialized t)) + +(add-to-list 'handle-args-function-alist '(x . x-handle-args)) +(add-to-list 'frame-creation-function-alist '(x . x-create-frame-with-faces)) +(add-to-list 'window-system-initialization-alist '(x . x-initialize-window-system)) ;; Initiate drag and drop (add-hook 'after-make-frame-functions 'x-dnd-init-frame) (define-key special-event-map [drag-n-drop] 'x-dnd-handle-drag-n-drop-event) -;; Let F10 do menu bar navigation. -(defun x-menu-bar-open (&optional frame) - "Open the menu bar if `menu-bar-mode' is on. otherwise call `tmm-menubar'." - (interactive "i") - (if menu-bar-mode (menu-bar-open frame) - (tmm-menubar))) - -(and (fboundp 'menu-bar-open) - (global-set-key [f10] 'x-menu-bar-open)) +(defcustom x-gtk-stock-map + '( + ("etc/images/new" . "gtk-new") + ("etc/images/open" . "gtk-open") + ("etc/images/diropen" . "n:system-file-manager") + ("etc/images/close" . "gtk-close") + ("etc/images/save" . "gtk-save") + ("etc/images/saveas" . "gtk-save-as") + ("etc/images/undo" . "gtk-undo") + ("etc/images/cut" . "gtk-cut") + ("etc/images/copy" . "gtk-copy") + ("etc/images/paste" . "gtk-paste") + ("etc/images/search" . "gtk-find") + ("etc/images/print" . "gtk-print") + ("etc/images/preferences" . "gtk-preferences") + ("etc/images/help" . "gtk-help") + ("etc/images/left-arrow" . "gtk-go-back") + ("etc/images/right-arrow" . "gtk-go-forward") + ("etc/images/home" . "gtk-home") + ("etc/images/jump-to" . "gtk-jump-to") + ("etc/images/index" . "gtk-index") + ("etc/images/search" . "gtk-find") + ("etc/images/exit" . "gtk-quit") + ;; Used in Gnus and/or MH-E: + ("etc/images/attach.xpm" . "gtk-attach") + ("etc/images/connect.xpm" . "gtk-connect") + ("etc/images/contact.xpm" . "gtk-contact") + ("etc/images/delete.xpm" . "gtk-delete") + ("etc/images/describe.xpm" . "gtk-properties") + ("etc/images/disconnect.xpm" . "gtk-disconnect") + ;; ("etc/images/exit.xpm" . "gtk-exit") + ("etc/images/lock-broken.xpm" . "gtk-lock_broken") + ("etc/images/lock-ok.xpm" . "gtk-lock_ok") + ("etc/images/lock.xpm" . "gtk-lock") + ("etc/images/next-page.xpm" . "gtk-next-page") + ("etc/images/refresh.xpm" . "gtk-refresh") + ("etc/images/sort-ascending.xpm" . "gtk-sort-ascending") + ("etc/images/sort-column-ascending.xpm" . "gtk-sort-column-ascending") + ("etc/images/sort-criteria.xpm" . "gtk-sort-criteria") + ("etc/images/sort-descending.xpm" . "gtk-sort-descending") + ("etc/images/sort-row-ascending.xpm" . "gtk-sort-row-ascending") + ("images/gnus/toggle-subscription.xpm" . "gtk-task-recurring") + ("images/mail/compose.xpm" . "gtk-mail-compose") + ("images/mail/copy.xpm" . "gtk-mail-copy") + ("images/mail/forward.xpm" . "gtk-mail-forward") + ("images/mail/inbox.xpm" . "gtk-inbox") + ("images/mail/move.xpm" . "gtk-mail-move") + ("images/mail/not-spam.xpm" . "gtk-not-spam") + ("images/mail/outbox.xpm" . "gtk-outbox") + ("images/mail/reply-all.xpm" . "gtk-mail-reply-to-all") + ("images/mail/reply.xpm" . "gtk-mail-reply") + ("images/mail/save-draft.xpm" . "gtk-mail-handling") + ("images/mail/send.xpm" . "gtk-mail-send") + ("images/mail/spam.xpm" . "gtk-spam") + ;; No themed versions available: + ;; mail/preview.xpm (combining stock_mail and stock_zoom) + ;; mail/save.xpm (combining stock_mail, stock_save and stock_convert) + ) + "How icons for tool bars are mapped to Gtk+ stock items. +Emacs must be compiled with the Gtk+ toolkit for this to have any effect. +A value that begins with n: denotes a named icon instead of a stock icon." + :version "22.2" + :type '(choice (repeat (choice symbol + (cons (string :tag "Emacs icon") + (string :tag "Stock/named"))))) + :group 'x) + +(defcustom icon-map-list '(x-gtk-stock-map) + "A list of alists that maps icon file names to stock/named icons. +The alists are searched in the order they appear. The first match is used. +The keys in the alists are file names without extension and with two directory +components. For example, to map /usr/share/emacs/22.1.1/etc/images/open.xpm +to stock item gtk-open, use: + + (\"etc/images/open\" . \"gtk-open\") + +Themes also have named icons. To map to one of those, use n: before the name: + + (\"etc/images/diropen\" . \"n:system-file-manager\") + +The list elements are either the symbol name for the alist or the +alist itself. + +If you don't want stock icons, set the variable to nil." + :version "22.2" + :type '(choice (const :tag "Don't use stock icons" nil) + (repeat (choice symbol + (cons (string :tag "Emacs icon") + (string :tag "Stock/named"))))) + :group 'x) + +(defun x-gtk-map-stock (file) + "Map icon with file name FILE to a Gtk+ stock name, using `x-gtk-stock-map'." + (let* ((file-sans (file-name-sans-extension file)) + (key (and (string-match "/\\([^/]+/[^/]+/[^/]+$\\)" file-sans) + (match-string 1 file-sans))) + (value)) + (mapc (lambda (elem) + (let ((assoc (if (symbolp elem) (symbol-value elem) elem))) + (or value (setq value (assoc-string (or key file-sans) assoc))))) + icon-map-list) + (and value (cdr value)))) + +(provide 'x-win) (defcustom x-gtk-stock-map '( - ("new" . "gtk-new") - ("open" . "gtk-open") - ("diropen" . "gtk-directory") - ("close" . "gtk-close") - ("save" . "gtk-save") - ("saveas" . "gtk-save-as") - ("undo" . "gtk-undo") - ("cut" . "gtk-cut") - ("copy" . "gtk-copy") - ("paste" . "gtk-paste") - ("search" . "gtk-find") - ("print" . "gtk-print") - ("preferences" . "gtk-preferences") - ("help" . "gtk-help") - ("left-arrow" . "gtk-go-back") - ("right-arrow" . "gtk-go-forward") - ("home" . "gtk-home") - ("jump-to" . "gtk-jump-to") - ("index" . "gtk-index") - ("search" . "gtk-find") - ("exit" . "gtk-quit")) + ("etc/images/new" . "gtk-new") + ("etc/images/open" . "gtk-open") + ("etc/images/diropen" . "n:system-file-manager") + ("etc/images/close" . "gtk-close") + ("etc/images/save" . "gtk-save") + ("etc/images/saveas" . "gtk-save-as") + ("etc/images/undo" . "gtk-undo") + ("etc/images/cut" . "gtk-cut") + ("etc/images/copy" . "gtk-copy") + ("etc/images/paste" . "gtk-paste") + ("etc/images/search" . "gtk-find") + ("etc/images/print" . "gtk-print") + ("etc/images/preferences" . "gtk-preferences") + ("etc/images/help" . "gtk-help") + ("etc/images/left-arrow" . "gtk-go-back") + ("etc/images/right-arrow" . "gtk-go-forward") + ("etc/images/home" . "gtk-home") + ("etc/images/jump-to" . "gtk-jump-to") + ("etc/images/index" . "gtk-index") + ("etc/images/search" . "gtk-find") + ("etc/images/exit" . "gtk-quit")) "How icons for tool bars are mapped to Gtk+ stock items. -Emacs must be compiled with the Gtk+ toolkit for this to have any effect." - :version "23.0" +Emacs must be compiled with the Gtk+ toolkit for this to have any effect. +A value that begins with n: denotes a named icon instead of a stock icon." + :version "22.2" :type 'alist :group 'x) +(defvar icon-map-list nil + "*A list of alists that maps icon file names to stock/named icons. +The alists are searched in the order they appear. The first match is used. +The keys in the alists are file names without extension and with two directory +components. For example, to map /usr/share/emacs/22.1.1/etc/images/open.xpm +to stock item gtk-open, use: + + (\"etc/images/open\" . \"gtk-open\") + +Themes also have named icons. To map to one of those, use n: before the name: + + (\"etc/images/diropen\" . \"n:system-file-manager\") + +The list elements are either the symbol name for the alist or the alist itself.") + (defun x-gtk-map-stock (file) "Map icon with file name FILE to a Gtk+ stock name, using `x-gtk-stock-map'." - (let ((value (and file - (assoc-string (file-name-sans-extension - (file-name-nondirectory file)) - x-gtk-stock-map)))) + (let* ((file-sans (file-name-sans-extension file)) + (key (and (string-match "/\\([^/]+/[^/]+/[^/]+$\\)" file-sans) + (match-string 1 file-sans))) + (value)) + (mapc (lambda (elem) + (let ((assoc (if (symbolp elem) (symbol-value elem) elem))) + (or value (setq value (assoc-string (or key file-sans) assoc))))) + icon-map-list) (and value (cdr value)))) ;; arch-tag: f1501302-db8b-4d95-88e3-116697d89f78 diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el index 5eb1d8b4c70..8326c920528 100644 --- a/lisp/term/xterm.el +++ b/lisp/term/xterm.el @@ -27,381 +27,452 @@ ;;; Code: +(eval-when-compile (require 'xt-mouse)) + +(defvar xterm-function-map + (let ((map (make-sparse-keymap))) + + ;; xterm from X.org 6.8.2 uses these key definitions. + (define-key map "\eOP" [f1]) + (define-key map "\eOQ" [f2]) + (define-key map "\eOR" [f3]) + (define-key map "\eOS" [f4]) + (define-key map "\e[15~" [f5]) + (define-key map "\e[17~" [f6]) + (define-key map "\e[18~" [f7]) + (define-key map "\e[19~" [f8]) + (define-key map "\e[20~" [f9]) + (define-key map "\e[21~" [f10]) + (define-key map "\e[23~" [f11]) + (define-key map "\e[24~" [f12]) + + (define-key map "\eO2P" [S-f1]) + (define-key map "\eO2Q" [S-f2]) + (define-key map "\eO2R" [S-f3]) + (define-key map "\eO2S" [S-f4]) + (define-key map "\e[1;2P" [S-f1]) + (define-key map "\e[1;2Q" [S-f2]) + (define-key map "\e[1;2R" [S-f3]) + (define-key map "\e[1;2S" [S-f4]) + (define-key map "\e[15;2~" [S-f5]) + (define-key map "\e[17;2~" [S-f6]) + (define-key map "\e[18;2~" [S-f7]) + (define-key map "\e[19;2~" [S-f8]) + (define-key map "\e[20;2~" [S-f9]) + (define-key map "\e[21;2~" [S-f10]) + (define-key map "\e[23;2~" [S-f11]) + (define-key map "\e[24;2~" [S-f12]) + + (define-key map "\eO5P" [C-f1]) + (define-key map "\eO5Q" [C-f2]) + (define-key map "\eO5R" [C-f3]) + (define-key map "\eO5S" [C-f4]) + (define-key map "\e[15;5~" [C-f5]) + (define-key map "\e[17;5~" [C-f6]) + (define-key map "\e[18;5~" [C-f7]) + (define-key map "\e[19;5~" [C-f8]) + (define-key map "\e[20;5~" [C-f9]) + (define-key map "\e[21;5~" [C-f10]) + (define-key map "\e[23;5~" [C-f11]) + (define-key map "\e[24;5~" [C-f12]) + + (define-key map "\eO6P" [C-S-f1]) + (define-key map "\eO6Q" [C-S-f2]) + (define-key map "\eO6R" [C-S-f3]) + (define-key map "\eO6S" [C-S-f4]) + (define-key map "\e[15;6~" [C-S-f5]) + (define-key map "\e[17;6~" [C-S-f6]) + (define-key map "\e[18;6~" [C-S-f7]) + (define-key map "\e[19;6~" [C-S-f8]) + (define-key map "\e[20;6~" [C-S-f9]) + (define-key map "\e[21;6~" [C-S-f10]) + (define-key map "\e[23;6~" [C-S-f11]) + (define-key map "\e[24;6~" [C-S-f12]) + + (define-key map "\eO3P" [A-f1]) + (define-key map "\eO3Q" [A-f2]) + (define-key map "\eO3R" [A-f3]) + (define-key map "\eO3S" [A-f4]) + (define-key map "\e[15;3~" [A-f5]) + (define-key map "\e[17;3~" [A-f6]) + (define-key map "\e[18;3~" [A-f7]) + (define-key map "\e[19;3~" [A-f8]) + (define-key map "\e[20;3~" [A-f9]) + (define-key map "\e[21;3~" [A-f10]) + (define-key map "\e[23;3~" [A-f11]) + (define-key map "\e[24;3~" [A-f12]) + + (define-key map "\eO4P" [M-S-f1]) + (define-key map "\eO4Q" [M-S-f2]) + (define-key map "\eO4R" [M-S-f3]) + (define-key map "\eO4S" [M-S-f4]) + (define-key map "\e[15;4~" [M-S-f5]) + (define-key map "\e[17;4~" [M-S-f6]) + (define-key map "\e[18;4~" [M-S-f7]) + (define-key map "\e[19;4~" [M-S-f8]) + (define-key map "\e[20;4~" [M-S-f9]) + (define-key map "\e[21;4~" [M-S-f10]) + (define-key map "\e[23;4~" [M-S-f11]) + (define-key map "\e[24;4~" [M-S-f12]) + + (define-key map "\eOA" [up]) + (define-key map "\eOB" [down]) + (define-key map "\eOC" [right]) + (define-key map "\eOD" [left]) + (define-key map "\eOF" [end]) + (define-key map "\eOH" [home]) + + (define-key map "\e[1;2A" [S-up]) + (define-key map "\e[1;2B" [S-down]) + (define-key map "\e[1;2C" [S-right]) + (define-key map "\e[1;2D" [S-left]) + (define-key map "\e[1;2F" [S-end]) + (define-key map "\e[1;2H" [S-home]) + + (define-key map "\e[1;4A" [M-S-up]) + (define-key map "\e[1;4B" [M-S-down]) + (define-key map "\e[1;4C" [M-S-right]) + (define-key map "\e[1;4D" [M-S-left]) + (define-key map "\e[1;4F" [M-S-end]) + (define-key map "\e[1;4H" [M-S-home]) + + (define-key map "\e[1;5A" [C-up]) + (define-key map "\e[1;5B" [C-down]) + (define-key map "\e[1;5C" [C-right]) + (define-key map "\e[1;5D" [C-left]) + (define-key map "\e[1;5F" [C-end]) + (define-key map "\e[1;5H" [C-home]) + + (define-key map "\e[1;6A" [C-S-up]) + (define-key map "\e[1;6B" [C-S-down]) + (define-key map "\e[1;6C" [C-S-right]) + (define-key map "\e[1;6D" [C-S-left]) + (define-key map "\e[1;6F" [C-S-end]) + (define-key map "\e[1;6H" [C-S-home]) + + (define-key map "\e[1;7A" [C-M-up]) + (define-key map "\e[1;7B" [C-M-down]) + (define-key map "\e[1;7C" [C-M-right]) + (define-key map "\e[1;7D" [C-M-left]) + (define-key map "\e[1;7F" [C-M-end]) + (define-key map "\e[1;7H" [C-M-home]) + + (define-key map "\e[1;8A" [C-M-S-up]) + (define-key map "\e[1;8B" [C-M-S-down]) + (define-key map "\e[1;8C" [C-M-S-right]) + (define-key map "\e[1;8D" [C-M-S-left]) + (define-key map "\e[1;8F" [C-M-S-end]) + (define-key map "\e[1;8H" [C-M-S-home]) + + (define-key map "\e[1;3A" [A-up]) + (define-key map "\e[1;3B" [A-down]) + (define-key map "\e[1;3C" [A-right]) + (define-key map "\e[1;3D" [A-left]) + (define-key map "\e[1;3F" [A-end]) + (define-key map "\e[1;3H" [A-home]) + + (define-key map "\e[2~" [insert]) + (define-key map "\e[3~" [delete]) + (define-key map "\e[5~" [prior]) + (define-key map "\e[6~" [next]) + + (define-key map "\e[2;2~" [S-insert]) + (define-key map "\e[3;2~" [S-delete]) + (define-key map "\e[5;2~" [S-prior]) + (define-key map "\e[6;2~" [S-next]) + + (define-key map "\e[2;4~" [M-S-insert]) + (define-key map "\e[3;4~" [M-S-delete]) + (define-key map "\e[5;4~" [M-S-prior]) + (define-key map "\e[6;4~" [M-S-next]) + + (define-key map "\e[2;5~" [C-insert]) + (define-key map "\e[3;5~" [C-delete]) + (define-key map "\e[5;5~" [C-prior]) + (define-key map "\e[6;5~" [C-next]) + + (define-key map "\e[2;6~" [C-S-insert]) + (define-key map "\e[3;6~" [C-S-delete]) + (define-key map "\e[5;6~" [C-S-prior]) + (define-key map "\e[6;6~" [C-S-next]) + + (define-key map "\e[2;7~" [C-M-insert]) + (define-key map "\e[3;7~" [C-M-delete]) + (define-key map "\e[5;7~" [C-M-prior]) + (define-key map "\e[6;7~" [C-M-next]) + + (define-key map "\e[2;8~" [C-M-S-insert]) + (define-key map "\e[3;8~" [C-M-S-delete]) + (define-key map "\e[5;8~" [C-M-S-prior]) + (define-key map "\e[6;8~" [C-M-S-next]) + + (define-key map "\e[2;3~" [A-insert]) + (define-key map "\e[3;3~" [A-delete]) + (define-key map "\e[5;3~" [A-prior]) + (define-key map "\e[6;3~" [A-next]) + + (define-key map "\e[4~" [select]) + (define-key map "\e[29~" [print]) + + (define-key map "\eOj" [kp-multiply]) + (define-key map "\eOk" [kp-add]) + (define-key map "\eOl" [kp-separator]) + (define-key map "\eOm" [kp-subtract]) + (define-key map "\eOo" [kp-divide]) + (define-key map "\eOp" [kp-0]) + (define-key map "\eOq" [kp-1]) + (define-key map "\eOr" [kp-2]) + (define-key map "\eOs" [kp-3]) + (define-key map "\eOt" [kp-4]) + (define-key map "\eOu" [kp-5]) + (define-key map "\eOv" [kp-6]) + (define-key map "\eOw" [kp-7]) + (define-key map "\eOx" [kp-8]) + (define-key map "\eOy" [kp-9]) + + ;; These keys are available in xterm starting from version 216 + ;; if the modifyOtherKeys resource is set to 1. + + (define-key map "\e[27;5;9~" [C-tab]) + (define-key map "\e[27;5;13~" [C-return]) + (define-key map "\e[27;5;39~" [?\C-\']) + (define-key map "\e[27;5;44~" [?\C-,]) + (define-key map "\e[27;5;45~" [?\C--]) + (define-key map "\e[27;5;46~" [?\C-.]) + (define-key map "\e[27;5;47~" [?\C-/]) + (define-key map "\e[27;5;48~" [?\C-0]) + (define-key map "\e[27;5;49~" [?\C-1]) + ;; Not all C-DIGIT keys have a distinct binding. + (define-key map "\e[27;5;57~" [?\C-9]) + (define-key map "\e[27;5;59~" [?\C-\;]) + (define-key map "\e[27;5;61~" [?\C-=]) + (define-key map "\e[27;5;92~" [?\C-\\]) + + (define-key map "\e[27;6;33~" [?\C-!]) + (define-key map "\e[27;6;34~" [?\C-\"]) + (define-key map "\e[27;6;35~" [?\C-#]) + (define-key map "\e[27;6;36~" [?\C-$]) + (define-key map "\e[27;6;37~" [?\C-%]) + (define-key map "\e[27;6;38~" [?\C-&]) + (define-key map "\e[27;6;40~" [?\C-(]) + (define-key map "\e[27;6;41~" [?\C-)]) + (define-key map "\e[27;6;42~" [?\C-*]) + (define-key map "\e[27;6;43~" [?\C-+]) + (define-key map "\e[27;6;58~" [?\C-:]) + (define-key map "\e[27;6;60~" [?\C-<]) + (define-key map "\e[27;6;62~" [?\C->]) + (define-key map "\e[27;6;63~" [(control ??)]) + + ;; These are the strings emitted for various C-M- combinations + ;; for keyboards that the Meta and Alt modifiers are on the same + ;; key (usually labeled "Alt"). + (define-key map "\e[27;13;9~" [C-M-tab]) + (define-key map "\e[27;13;13~" [C-M-return]) + + (define-key map "\e[27;13;39~" [?\C-\M-\']) + (define-key map "\e[27;13;44~" [?\C-\M-,]) + (define-key map "\e[27;13;45~" [?\C-\M--]) + (define-key map "\e[27;13;46~" [?\C-\M-.]) + (define-key map "\e[27;13;47~" [?\C-\M-/]) + (define-key map "\e[27;13;48~" [?\C-\M-0]) + (define-key map "\e[27;13;49~" [?\C-\M-1]) + (define-key map "\e[27;13;50~" [?\C-\M-2]) + (define-key map "\e[27;13;51~" [?\C-\M-3]) + (define-key map "\e[27;13;52~" [?\C-\M-4]) + (define-key map "\e[27;13;53~" [?\C-\M-5]) + (define-key map "\e[27;13;54~" [?\C-\M-6]) + (define-key map "\e[27;13;55~" [?\C-\M-7]) + (define-key map "\e[27;13;56~" [?\C-\M-8]) + (define-key map "\e[27;13;57~" [?\C-\M-9]) + (define-key map "\e[27;13;59~" [?\C-\M-\;]) + (define-key map "\e[27;13;61~" [?\C-\M-=]) + (define-key map "\e[27;13;92~" [?\C-\M-\\]) + + (define-key map "\e[27;14;33~" [?\C-\M-!]) + (define-key map "\e[27;14;34~" [?\C-\M-\"]) + (define-key map "\e[27;14;35~" [?\C-\M-#]) + (define-key map "\e[27;14;36~" [?\C-\M-$]) + (define-key map "\e[27;14;37~" [?\C-\M-%]) + (define-key map "\e[27;14;38~" [?\C-\M-&]) + (define-key map "\e[27;14;40~" [?\C-\M-\(]) + (define-key map "\e[27;14;41~" [?\C-\M-\)]) + (define-key map "\e[27;14;42~" [?\C-\M-*]) + (define-key map "\e[27;14;43~" [?\C-\M-+]) + (define-key map "\e[27;14;58~" [?\C-\M-:]) + (define-key map "\e[27;14;60~" [?\C-\M-<]) + (define-key map "\e[27;14;62~" [?\C-\M->]) + (define-key map "\e[27;14;63~" [(control meta ??)]) + + (define-key map "\e[27;7;9~" [C-M-tab]) + (define-key map "\e[27;7;13~" [C-M-return]) + + (define-key map "\e[27;7;32~" [?\C-\M-\s]) + (define-key map "\e[27;7;39~" [?\C-\M-\']) + (define-key map "\e[27;7;44~" [?\C-\M-,]) + (define-key map "\e[27;7;45~" [?\C-\M--]) + (define-key map "\e[27;7;46~" [?\C-\M-.]) + (define-key map "\e[27;7;47~" [?\C-\M-/]) + (define-key map "\e[27;7;48~" [?\C-\M-0]) + (define-key map "\e[27;7;49~" [?\C-\M-1]) + (define-key map "\e[27;7;50~" [?\C-\M-2]) + (define-key map "\e[27;7;51~" [?\C-\M-3]) + (define-key map "\e[27;7;52~" [?\C-\M-4]) + (define-key map "\e[27;7;53~" [?\C-\M-5]) + (define-key map "\e[27;7;54~" [?\C-\M-6]) + (define-key map "\e[27;7;55~" [?\C-\M-7]) + (define-key map "\e[27;7;56~" [?\C-\M-8]) + (define-key map "\e[27;7;57~" [?\C-\M-9]) + (define-key map "\e[27;7;59~" [?\C-\M-\;]) + (define-key map "\e[27;7;61~" [?\C-\M-=]) + (define-key map "\e[27;7;92~" [?\C-\M-\\]) + + (define-key map "\e[27;8;33~" [?\C-\M-!]) + (define-key map "\e[27;8;34~" [?\C-\M-\"]) + (define-key map "\e[27;8;35~" [?\C-\M-#]) + (define-key map "\e[27;8;36~" [?\C-\M-$]) + (define-key map "\e[27;8;37~" [?\C-\M-%]) + (define-key map "\e[27;8;38~" [?\C-\M-&]) + (define-key map "\e[27;8;40~" [?\C-\M-\(]) + (define-key map "\e[27;8;41~" [?\C-\M-\)]) + (define-key map "\e[27;8;42~" [?\C-\M-*]) + (define-key map "\e[27;8;43~" [?\C-\M-+]) + (define-key map "\e[27;8;58~" [?\C-\M-:]) + (define-key map "\e[27;8;60~" [?\C-\M-<]) + (define-key map "\e[27;8;62~" [?\C-\M->]) + (define-key map "\e[27;8;63~" [(control meta ??)]) + + (define-key map "\e[27;2;9~" [S-tab]) + (define-key map "\e[27;2;13~" [S-return]) + + (define-key map "\e[27;6;9~" [C-S-tab]) + (define-key map "\e[27;6;13~" [C-S-return]) + + ;; Other versions of xterm might emit these. + (define-key map "\e[A" [up]) + (define-key map "\e[B" [down]) + (define-key map "\e[C" [right]) + (define-key map "\e[D" [left]) + (define-key map "\e[1~" [home]) + + (define-key map "\eO2A" [S-up]) + (define-key map "\eO2B" [S-down]) + (define-key map "\eO2C" [S-right]) + (define-key map "\eO2D" [S-left]) + (define-key map "\eO2F" [S-end]) + (define-key map "\eO2H" [S-home]) + + (define-key map "\eO5A" [C-up]) + (define-key map "\eO5B" [C-down]) + (define-key map "\eO5C" [C-right]) + (define-key map "\eO5D" [C-left]) + (define-key map "\eO5F" [C-end]) + (define-key map "\eO5H" [C-home]) + + (define-key map "\e[11~" [f1]) + (define-key map "\e[12~" [f2]) + (define-key map "\e[13~" [f3]) + (define-key map "\e[14~" [f4]) + map) + "Function key map overrides for xterm.") + +(defvar xterm-alternatives-map + (let ((map (make-sparse-keymap))) + ;; The terminal initialization C code file might have initialized + ;; function keys F13->F60 from the termcap/terminfo information. + ;; On a PC-style keyboard these keys correspond to + ;; MODIFIER-FUNCTION_KEY, where modifier is S-, C, A-, C-S-. The code + ;; here substitutes the corresponding definitions in function-key-map. + ;; The mapping from escape sequences to Fn is done in input-decode-map + ;; whereas this here mapping is done in local-function-key-map so that + ;; bindings to f45 still work, in case your keyboard really has an f45 + ;; key rather than C-S-f9. + (define-key map [f13] [S-f1]) + (define-key map [f14] [S-f2]) + (define-key map [f15] [S-f3]) + (define-key map [f16] [S-f4]) + (define-key map [f17] [S-f5]) + (define-key map [f18] [S-f6]) + (define-key map [f19] [S-f7]) + (define-key map [f20] [S-f8]) + (define-key map [f21] [S-f9]) + (define-key map [f22] [S-f10]) + (define-key map [f23] [S-f11]) + (define-key map [f24] [S-f12]) + + (define-key map [f25] [C-f1]) + (define-key map [f26] [C-f2]) + (define-key map [f27] [C-f3]) + (define-key map [f28] [C-f4]) + (define-key map [f29] [C-f5]) + (define-key map [f30] [C-f6]) + (define-key map [f31] [C-f7]) + (define-key map [f32] [C-f8]) + (define-key map [f33] [C-f9]) + (define-key map [f34] [C-f10]) + (define-key map [f35] [C-f11]) + (define-key map [f36] [C-f12]) + + (define-key map [f37] [C-S-f1]) + (define-key map [f38] [C-S-f2]) + (define-key map [f39] [C-S-f3]) + (define-key map [f40] [C-S-f4]) + (define-key map [f41] [C-S-f5]) + (define-key map [f42] [C-S-f6]) + (define-key map [f43] [C-S-f7]) + (define-key map [f44] [C-S-f8]) + (define-key map [f45] [C-S-f9]) + (define-key map [f46] [C-S-f10]) + (define-key map [f47] [C-S-f11]) + (define-key map [f48] [C-S-f12]) + + (define-key map [f49] [A-f1]) + (define-key map [f50] [A-f2]) + (define-key map [f51] [A-f3]) + (define-key map [f52] [A-f4]) + (define-key map [f53] [A-f5]) + (define-key map [f54] [A-f6]) + (define-key map [f55] [A-f7]) + (define-key map [f56] [A-f8]) + (define-key map [f57] [A-f9]) + (define-key map [f58] [A-f10]) + (define-key map [f59] [A-f11]) + (define-key map [f60] [A-f12]) + + map) + "Keymap of possible alternative meanings for some keys.") + +;; List of terminals for which modify-other-keys has been turned on. +(defvar xterm-modify-other-keys-terminal-list nil) + (defun terminal-init-xterm () "Terminal initialization function for xterm." ;; rxvt terminals sometimes set the TERM variable to "xterm", but - ;; rxvt's keybindings that are incompatible with xterm's. It is + ;; rxvt's keybindings are incompatible with xterm's. It is ;; better in that case to use rxvt's initializion function. - (if (and (getenv "COLORTERM") - (string-match "\\`rxvt" (getenv "COLORTERM"))) - (progn - (eval-and-compile (load "term/rxvt")) - (terminal-init-rxvt)) - - ;; The terminal intialization C code file might have initialized - ;; function keys F13->F60 from the termcap/terminfo information. On - ;; a PC-style keyboard these keys correspond to - ;; MODIFIER-FUNCTION_KEY, where modifier is S-, C, A-, C-S-. The - ;; code here subsitutes the corresponding defintions in - ;; function-key-map. This substitution is needed because if a key - ;; definition is found in function-key-map, there are no further - ;; lookups in other keymaps. - (substitute-key-definition [f13] [S-f1] function-key-map) - (substitute-key-definition [f14] [S-f2] function-key-map) - (substitute-key-definition [f15] [S-f3] function-key-map) - (substitute-key-definition [f16] [S-f4] function-key-map) - (substitute-key-definition [f17] [S-f5] function-key-map) - (substitute-key-definition [f18] [S-f6] function-key-map) - (substitute-key-definition [f19] [S-f7] function-key-map) - (substitute-key-definition [f20] [S-f8] function-key-map) - (substitute-key-definition [f21] [S-f9] function-key-map) - (substitute-key-definition [f22] [S-f10] function-key-map) - (substitute-key-definition [f23] [S-f11] function-key-map) - (substitute-key-definition [f24] [S-f12] function-key-map) - - (substitute-key-definition [f25] [C-f1] function-key-map) - (substitute-key-definition [f26] [C-f2] function-key-map) - (substitute-key-definition [f27] [C-f3] function-key-map) - (substitute-key-definition [f28] [C-f4] function-key-map) - (substitute-key-definition [f29] [C-f5] function-key-map) - (substitute-key-definition [f30] [C-f6] function-key-map) - (substitute-key-definition [f31] [C-f7] function-key-map) - (substitute-key-definition [f32] [C-f8] function-key-map) - (substitute-key-definition [f33] [C-f9] function-key-map) - (substitute-key-definition [f34] [C-f10] function-key-map) - (substitute-key-definition [f35] [C-f11] function-key-map) - (substitute-key-definition [f36] [C-f12] function-key-map) - - (substitute-key-definition [f37] [C-S-f1] function-key-map) - (substitute-key-definition [f38] [C-S-f2] function-key-map) - (substitute-key-definition [f39] [C-S-f3] function-key-map) - (substitute-key-definition [f40] [C-S-f4] function-key-map) - (substitute-key-definition [f41] [C-S-f5] function-key-map) - (substitute-key-definition [f42] [C-S-f6] function-key-map) - (substitute-key-definition [f43] [C-S-f7] function-key-map) - (substitute-key-definition [f44] [C-S-f8] function-key-map) - (substitute-key-definition [f45] [C-S-f9] function-key-map) - (substitute-key-definition [f46] [C-S-f10] function-key-map) - (substitute-key-definition [f47] [C-S-f11] function-key-map) - (substitute-key-definition [f48] [C-S-f12] function-key-map) - - (substitute-key-definition [f49] [A-f1] function-key-map) - (substitute-key-definition [f50] [A-f2] function-key-map) - (substitute-key-definition [f51] [A-f3] function-key-map) - (substitute-key-definition [f52] [A-f4] function-key-map) - (substitute-key-definition [f53] [A-f5] function-key-map) - (substitute-key-definition [f54] [A-f6] function-key-map) - (substitute-key-definition [f55] [A-f7] function-key-map) - (substitute-key-definition [f56] [A-f8] function-key-map) - (substitute-key-definition [f57] [A-f9] function-key-map) - (substitute-key-definition [f58] [A-f10] function-key-map) - (substitute-key-definition [f59] [A-f11] function-key-map) - (substitute-key-definition [f60] [A-f12] function-key-map) - - (let ((map (make-sparse-keymap))) - ;; xterm from X.org 6.8.2 uses these key definitions. - (define-key map "\eOP" [f1]) - (define-key map "\eOQ" [f2]) - (define-key map "\eOR" [f3]) - (define-key map "\eOS" [f4]) - (define-key map "\e[15~" [f5]) - (define-key map "\e[17~" [f6]) - (define-key map "\e[18~" [f7]) - (define-key map "\e[19~" [f8]) - (define-key map "\e[20~" [f9]) - (define-key map "\e[21~" [f10]) - (define-key map "\e[23~" [f11]) - (define-key map "\e[24~" [f12]) - - (define-key map "\eO2P" [S-f1]) - (define-key map "\eO2Q" [S-f2]) - (define-key map "\eO2R" [S-f3]) - (define-key map "\eO2S" [S-f4]) - (define-key map "\e[1;2P" [S-f1]) - (define-key map "\e[1;2Q" [S-f2]) - (define-key map "\e[1;2R" [S-f3]) - (define-key map "\e[1;2S" [S-f4]) - (define-key map "\e[15;2~" [S-f5]) - (define-key map "\e[17;2~" [S-f6]) - (define-key map "\e[18;2~" [S-f7]) - (define-key map "\e[19;2~" [S-f8]) - (define-key map "\e[20;2~" [S-f9]) - (define-key map "\e[21;2~" [S-f10]) - (define-key map "\e[23;2~" [S-f11]) - (define-key map "\e[24;2~" [S-f12]) - - (define-key map "\eO5P" [C-f1]) - (define-key map "\eO5Q" [C-f2]) - (define-key map "\eO5R" [C-f3]) - (define-key map "\eO5S" [C-f4]) - (define-key map "\e[15;5~" [C-f5]) - (define-key map "\e[17;5~" [C-f6]) - (define-key map "\e[18;5~" [C-f7]) - (define-key map "\e[19;5~" [C-f8]) - (define-key map "\e[20;5~" [C-f9]) - (define-key map "\e[21;5~" [C-f10]) - (define-key map "\e[23;5~" [C-f11]) - (define-key map "\e[24;5~" [C-f12]) - - (define-key map "\eO6P" [C-S-f1]) - (define-key map "\eO6Q" [C-S-f2]) - (define-key map "\eO6R" [C-S-f3]) - (define-key map "\eO6S" [C-S-f4]) - (define-key map "\e[15;6~" [C-S-f5]) - (define-key map "\e[17;6~" [C-S-f6]) - (define-key map "\e[18;6~" [C-S-f7]) - (define-key map "\e[19;6~" [C-S-f8]) - (define-key map "\e[20;6~" [C-S-f9]) - (define-key map "\e[21;6~" [C-S-f10]) - (define-key map "\e[23;6~" [C-S-f11]) - (define-key map "\e[24;6~" [C-S-f12]) - - (define-key map "\eO3P" [A-f1]) - (define-key map "\eO3Q" [A-f2]) - (define-key map "\eO3R" [A-f3]) - (define-key map "\eO3S" [A-f4]) - (define-key map "\e[15;3~" [A-f5]) - (define-key map "\e[17;3~" [A-f6]) - (define-key map "\e[18;3~" [A-f7]) - (define-key map "\e[19;3~" [A-f8]) - (define-key map "\e[20;3~" [A-f9]) - (define-key map "\e[21;3~" [A-f10]) - (define-key map "\e[23;3~" [A-f11]) - (define-key map "\e[24;3~" [A-f12]) - - (define-key map "\eOA" [up]) - (define-key map "\eOB" [down]) - (define-key map "\eOC" [right]) - (define-key map "\eOD" [left]) - (define-key map "\eOF" [end]) - (define-key map "\eOH" [home]) - - (define-key map "\e[1;2A" [S-up]) - (define-key map "\e[1;2B" [S-down]) - (define-key map "\e[1;2C" [S-right]) - (define-key map "\e[1;2D" [S-left]) - (define-key map "\e[1;2F" [S-end]) - (define-key map "\e[1;2H" [S-home]) - - (define-key map "\e[1;5A" [C-up]) - (define-key map "\e[1;5B" [C-down]) - (define-key map "\e[1;5C" [C-right]) - (define-key map "\e[1;5D" [C-left]) - (define-key map "\e[1;5F" [C-end]) - (define-key map "\e[1;5H" [C-home]) - - (define-key map "\e[1;6A" [C-S-up]) - (define-key map "\e[1;6B" [C-S-down]) - (define-key map "\e[1;6C" [C-S-right]) - (define-key map "\e[1;6D" [C-S-left]) - (define-key map "\e[1;6F" [C-S-end]) - (define-key map "\e[1;6H" [C-S-home]) - - (define-key map "\e[1;3A" [A-up]) - (define-key map "\e[1;3B" [A-down]) - (define-key map "\e[1;3C" [A-right]) - (define-key map "\e[1;3D" [A-left]) - (define-key map "\e[1;3F" [A-end]) - (define-key map "\e[1;3H" [A-home]) - - (define-key map "\e[2~" [insert]) - (define-key map "\e[3~" [delete]) - (define-key map "\e[5~" [prior]) - (define-key map "\e[6~" [next]) - - (define-key map "\e[2;2~" [S-insert]) - (define-key map "\e[3;2~" [S-delete]) - (define-key map "\e[5;2~" [S-prior]) - (define-key map "\e[6;2~" [S-next]) - - (define-key map "\e[2;5~" [C-insert]) - (define-key map "\e[3;5~" [C-delete]) - (define-key map "\e[5;5~" [C-prior]) - (define-key map "\e[6;5~" [C-next]) - - (define-key map "\e[2;6~" [C-S-insert]) - (define-key map "\e[3;6~" [C-S-delete]) - (define-key map "\e[5;6~" [C-S-prior]) - (define-key map "\e[6;6~" [C-S-next]) - - (define-key map "\e[2;3~" [A-insert]) - (define-key map "\e[3;3~" [A-delete]) - (define-key map "\e[5;3~" [A-prior]) - (define-key map "\e[6;3~" [A-next]) - - (define-key map "\e[4~" [select]) - (define-key map "\e[29~" [print]) - - (define-key map "\eOj" [kp-multiply]) - (define-key map "\eOk" [kp-add]) - (define-key map "\eOl" [kp-separator]) - (define-key map "\eOm" [kp-subtract]) - (define-key map "\eOo" [kp-divide]) - (define-key map "\eOp" [kp-0]) - (define-key map "\eOq" [kp-1]) - (define-key map "\eOr" [kp-2]) - (define-key map "\eOs" [kp-3]) - (define-key map "\eOt" [kp-4]) - (define-key map "\eOu" [kp-5]) - (define-key map "\eOv" [kp-6]) - (define-key map "\eOw" [kp-7]) - (define-key map "\eOx" [kp-8]) - (define-key map "\eOy" [kp-9]) - - ;; These keys are available in xterm starting from version 216 - ;; if the modifyOtherKeys resource is set to 1. - - (define-key map "\e[27;5;9~" [C-tab]) - (define-key map "\e[27;5;13~" [C-return]) - (define-key map "\e[27;5;39~" [?\C-\']) - (define-key map "\e[27;5;44~" [?\C-,]) - (define-key map "\e[27;5;45~" [?\C--]) - (define-key map "\e[27;5;46~" [?\C-.]) - (define-key map "\e[27;5;47~" [?\C-/]) - (define-key map "\e[27;5;48~" [?\C-0]) - (define-key map "\e[27;5;49~" [?\C-1]) - ;; Not all C-DIGIT keys have a distinct binding. - (define-key map "\e[27;5;57~" [?\C-9]) - (define-key map "\e[27;5;59~" [?\C-\;]) - (define-key map "\e[27;5;61~" [?\C-=]) - (define-key map "\e[27;5;92~" [?\C-\\]) - - (define-key map "\e[27;6;33~" [?\C-!]) - (define-key map "\e[27;6;34~" [?\C-\"]) - (define-key map "\e[27;6;35~" [?\C-#]) - (define-key map "\e[27;6;36~" [?\C-$]) - (define-key map "\e[27;6;37~" [?\C-%]) - (define-key map "\e[27;6;38~" [?\C-&]) - (define-key map "\e[27;6;40~" [?\C-\(]) - (define-key map "\e[27;6;41~" [?\C-\)]) - (define-key map "\e[27;6;42~" [?\C-*]) - (define-key map "\e[27;6;43~" [?\C-+]) - (define-key map "\e[27;6;58~" [?\C-:]) - (define-key map "\e[27;6;60~" [?\C-<]) - (define-key map "\e[27;6;62~" [?\C->]) - (define-key map "\e[27;6;63~" [(control ??)]) - - ;; These are the strings emitted for various C-M- combinations - ;; for keyboards that the Meta and Alt modifiers are on the same - ;; key (usually labeled "Alt"). - (define-key map "\e[27;13;9~" [C-M-tab]) - (define-key map "\e[27;13;13~" [C-M-return]) - - (define-key map "\e[27;13;39~" [?\C-\M-\']) - (define-key map "\e[27;13;44~" [?\C-\M-,]) - (define-key map "\e[27;13;45~" [?\C-\M--]) - (define-key map "\e[27;13;46~" [?\C-\M-.]) - (define-key map "\e[27;13;47~" [?\C-\M-/]) - (define-key map "\e[27;13;48~" [?\C-\M-0]) - (define-key map "\e[27;13;49~" [?\C-\M-1]) - (define-key map "\e[27;13;50~" [?\C-\M-2]) - (define-key map "\e[27;13;51~" [?\C-\M-3]) - (define-key map "\e[27;13;52~" [?\C-\M-4]) - (define-key map "\e[27;13;53~" [?\C-\M-5]) - (define-key map "\e[27;13;54~" [?\C-\M-6]) - (define-key map "\e[27;13;55~" [?\C-\M-7]) - (define-key map "\e[27;13;56~" [?\C-\M-8]) - (define-key map "\e[27;13;57~" [?\C-\M-9]) - (define-key map "\e[27;13;59~" [?\C-\M-\;]) - (define-key map "\e[27;13;61~" [?\C-\M-=]) - (define-key map "\e[27;13;92~" [?\C-\M-\\]) - - (define-key map "\e[27;14;33~" [?\C-\M-!]) - (define-key map "\e[27;14;34~" [?\C-\M-\"]) - (define-key map "\e[27;14;35~" [?\C-\M-#]) - (define-key map "\e[27;14;36~" [?\C-\M-$]) - (define-key map "\e[27;14;37~" [?\C-\M-%]) - (define-key map "\e[27;14;38~" [?\C-\M-&]) - (define-key map "\e[27;14;40~" [?\C-\M-\(]) - (define-key map "\e[27;14;41~" [?\C-\M-\)]) - (define-key map "\e[27;14;42~" [?\C-\M-*]) - (define-key map "\e[27;14;43~" [?\C-\M-+]) - (define-key map "\e[27;14;58~" [?\C-\M-:]) - (define-key map "\e[27;14;60~" [?\C-\M-<]) - (define-key map "\e[27;14;62~" [?\C-\M->]) - (define-key map "\e[27;14;63~" [(control meta ??)]) - - (define-key map "\e[27;7;9~" [C-M-tab]) - (define-key map "\e[27;7;13~" [C-M-return]) - - (define-key map "\e[27;7;32~" [?\C-\M-\s]) - (define-key map "\e[27;7;39~" [?\C-\M-\']) - (define-key map "\e[27;7;44~" [?\C-\M-,]) - (define-key map "\e[27;7;45~" [?\C-\M--]) - (define-key map "\e[27;7;46~" [?\C-\M-.]) - (define-key map "\e[27;7;47~" [?\C-\M-/]) - (define-key map "\e[27;7;48~" [?\C-\M-0]) - (define-key map "\e[27;7;49~" [?\C-\M-1]) - (define-key map "\e[27;7;50~" [?\C-\M-2]) - (define-key map "\e[27;7;51~" [?\C-\M-3]) - (define-key map "\e[27;7;52~" [?\C-\M-4]) - (define-key map "\e[27;7;53~" [?\C-\M-5]) - (define-key map "\e[27;7;54~" [?\C-\M-6]) - (define-key map "\e[27;7;55~" [?\C-\M-7]) - (define-key map "\e[27;7;56~" [?\C-\M-8]) - (define-key map "\e[27;7;57~" [?\C-\M-9]) - (define-key map "\e[27;7;59~" [?\C-\M-\;]) - (define-key map "\e[27;7;61~" [?\C-\M-=]) - (define-key map "\e[27;7;92~" [?\C-\M-\\]) - - (define-key map "\e[27;8;33~" [?\C-\M-!]) - (define-key map "\e[27;8;34~" [?\C-\M-\"]) - (define-key map "\e[27;8;35~" [?\C-\M-#]) - (define-key map "\e[27;8;36~" [?\C-\M-$]) - (define-key map "\e[27;8;37~" [?\C-\M-%]) - (define-key map "\e[27;8;38~" [?\C-\M-&]) - (define-key map "\e[27;8;40~" [?\C-\M-\(]) - (define-key map "\e[27;8;41~" [?\C-\M-\)]) - (define-key map "\e[27;8;42~" [?\C-\M-*]) - (define-key map "\e[27;8;43~" [?\C-\M-+]) - (define-key map "\e[27;8;58~" [?\C-\M-:]) - (define-key map "\e[27;8;60~" [?\C-\M-<]) - (define-key map "\e[27;8;62~" [?\C-\M->]) - (define-key map "\e[27;8;63~" [(control meta ??)]) - - (define-key map "\e[27;2;9~" [S-tab]) - (define-key map "\e[27;2;13~" [S-return]) - - (define-key map "\e[27;6;9~" [C-S-tab]) - (define-key map "\e[27;6;13~" [C-S-return]) - - ;; Other versions of xterm might emit these. - (define-key map "\e[A" [up]) - (define-key map "\e[B" [down]) - (define-key map "\e[C" [right]) - (define-key map "\e[D" [left]) - (define-key map "\e[1~" [home]) - - (define-key map "\eO2A" [S-up]) - (define-key map "\eO2B" [S-down]) - (define-key map "\eO2C" [S-right]) - (define-key map "\eO2D" [S-left]) - (define-key map "\eO2F" [S-end]) - (define-key map "\eO2H" [S-home]) - - (define-key map "\eO5A" [C-up]) - (define-key map "\eO5B" [C-down]) - (define-key map "\eO5C" [C-right]) - (define-key map "\eO5D" [C-left]) - (define-key map "\eO5F" [C-end]) - (define-key map "\eO5H" [C-home]) - - (define-key map "\e[11~" [f1]) - (define-key map "\e[12~" [f2]) - (define-key map "\e[13~" [f3]) - (define-key map "\e[14~" [f4]) + (if (and (getenv "COLORTERM" (selected-frame)) + (string-match "\\`rxvt" (getenv "COLORTERM" (selected-frame)))) + (tty-run-terminal-initialization (selected-frame) "rxvt") + + (let ((map (copy-keymap xterm-alternatives-map))) + (set-keymap-parent map (keymap-parent local-function-key-map)) + (set-keymap-parent local-function-key-map map)) + + (let ((map (copy-keymap xterm-function-map))) ;; Use inheritance to let the main keymap override those defaults. ;; This way we don't override terminfo-derived settings or settings ;; made in the .emacs file. - (set-keymap-parent map (keymap-parent function-key-map)) - (set-keymap-parent function-key-map map)) + (set-keymap-parent map (keymap-parent input-decode-map)) + (set-keymap-parent input-decode-map map))) - ;; Do it! (xterm-register-default-colors) ;; This recomputes all the default faces given the colors we've just set up. (tty-set-up-initial-frame-faces) - + + (when xterm-mouse-mode + (turn-on-xterm-mouse-tracking-on-terminal + (frame-terminal (selected-frame)))) + ;; Try to turn on the modifyOtherKeys feature on modern xterms. ;; When it is turned on much more key bindings work: things like ;; C-. C-, etc. @@ -423,14 +494,19 @@ ;; NUMBER2 is the xterm version number, look for something ;; greater than 216, the version when modifyOtherKeys was ;; introduced. - (when (>= (string-to-number + (when (>= (string-to-number (substring str (match-beginning 1) (match-end 1))) 216) ;; Make sure that the modifyOtherKeys state is restored when ;; suspending, resuming and exiting. (add-hook 'suspend-hook 'xterm-turn-off-modify-other-keys) (add-hook 'suspend-resume-hook 'xterm-turn-on-modify-other-keys) - (add-hook 'kill-emacs-hook 'xterm-turn-off-modify-other-keys) - (xterm-turn-on-modify-other-keys)))))))) + (add-hook 'kill-emacs-hook 'xterm-remove-modify-other-keys) + (add-hook 'delete-frame-hook 'xterm-remove-modify-other-keys) + ;; Add the selected frame to the list of frames that + ;; need to deal with modify-other-keys. + (push (frame-terminal (selected-frame)) + xterm-modify-other-keys-terminal-list) + (xterm-turn-on-modify-other-keys))))))) ;; Set up colors, for those versions of xterm that support it. (defvar xterm-standard-colors @@ -467,7 +543,7 @@ for the currently selected frame. The first 16 colors are taken from `xterm-standard-colors', which see, while the rest are computed assuming either the 88- or 256-color standard color scheme supported by latest versions of xterm." - (let* ((ncolors (display-color-cells)) + (let* ((ncolors (display-color-cells (selected-frame))) (colors xterm-standard-colors) (color (car colors))) (if (> ncolors 0) @@ -550,11 +626,27 @@ versions of xterm." (defun xterm-turn-on-modify-other-keys () "Turn on the modifyOtherKeys feature of xterm." - (send-string-to-terminal "\e[>4;1m")) + (let ((frame (selected-frame))) + (when (and (frame-live-p frame) + (memq frame xterm-modify-other-keys-terminal-list)) + (send-string-to-terminal "\e[>4;1m")))) -(defun xterm-turn-off-modify-other-keys () +(defun xterm-turn-off-modify-other-keys (&optional frame) "Turn off the modifyOtherKeys feature of xterm." - (send-string-to-terminal "\e[>4m")) + (setq frame (and frame (selected-frame))) + (when (and (frame-live-p frame) + (memq frame xterm-modify-other-keys-terminal-list)) + (send-string-to-terminal "\e[>4m"))) + +(defun xterm-remove-modify-other-keys (&optional frame) + "Turn off the modifyOtherKeys feature of xterm and remove frame from consideration." + (setq frame (and frame (selected-frame))) + (when (and (frame-live-p frame) + (memq frame xterm-modify-other-keys-terminal-list)) + (setq xterm-modify-other-keys-terminal-list + (delq (frame-terminal frame) + xterm-modify-other-keys-terminal-list)) + (send-string-to-terminal "\e[>4m"))) ;; arch-tag: 12e7ebdd-1e6c-4b25-b0f9-35ace25e855a ;;; xterm.el ends here diff --git a/lispref/.gitignore b/lispref/.gitignore index a149258f6dd..f3c7a7c5da6 100644 --- a/lispref/.gitignore +++ b/lispref/.gitignore @@ -1,17 +1 @@ -texput.log -elisp.?? -elisp.??? -configure -config.log -config.cache -config.status Makefile -makefile -index.texi -elisp -elisp-? -elisp-?? -vol1.* -vol2.* -elisp1* -elisp2* diff --git a/lwlib/ChangeLog b/lwlib/ChangeLog index 6079a3af84a..75597a9549e 100644 --- a/lwlib/ChangeLog +++ b/lwlib/ChangeLog @@ -1,3 +1,8 @@ +2007-08-29 Karoly Lorentey <lorentey@elte.hu> + + * xlwmenu.c (XlwMenuRealize): Ignore X errors while setting up + cursor shape. + 2007-07-25 Glenn Morris <rgm@gnu.org> * Relicense all FSF files to GPLv3 or later. diff --git a/lwlib/xlwmenu.c b/lwlib/xlwmenu.c index b3929d34a35..40a88fcced5 100644 --- a/lwlib/xlwmenu.c +++ b/lwlib/xlwmenu.c @@ -1844,7 +1844,16 @@ XlwMenuRealize (w, valueMask, attributes) xswa.save_under = True; xswa.cursor = mw->menu.cursor_shape; mask = CWSaveUnder | CWCursor; + /* I sometimes get random BadCursor errors while creating the first + frame on a display. I can not find their reason, but they are + annoying so for now let's ignore any errors here. -- lorentey */ +#ifdef emacs + x_catch_errors (XtDisplay (w)); +#endif XChangeWindowAttributes (XtDisplay (w), XtWindow (w), mask, &xswa); +#ifdef emacs + x_uncatch_errors (); +#endif mw->menu.windows [0].window = XtWindow (w); mw->menu.windows [0].x = w->core.x; diff --git a/mac/ChangeLog b/mac/ChangeLog index c25d89a83ba..326a844b638 100644 --- a/mac/ChangeLog +++ b/mac/ChangeLog @@ -1,3 +1,24 @@ +2007-09-13 Seiji Zenitani <zenitani@mac.com> + Takanori Yamamoto <takanori.yamamoto@gmail.com> + Kentaro Ohkouchi <nanasess@fsm.ne.jp> + + * Emacs.app/Contents/Info.plist: Add + filetype/extension entries for the document icon. + * Emacs.app/Contents/Resources/Emacs.icns: Update. + * Emacs.app/Contents/Resources/document.icns: New file. + +2007-08-29 Glenn Morris <rgm@gnu.org> + + * Emacs.app/Contents/Resources/English.lproj/InfoPlist.strings: + * src/Emacs.r: Increase version to 23.0.50. + +2007-08-29 Karoly Lorentey <lorentey@elte.hu> + + * makefile.MPW (EmacsObjects): Add terminal.c.x. + (callproc.c.x): Add dependencies frame.h, termhooks.h. + ({Src}terminal.c.x): New. + (shortlisp): Add server.elc and termdev.elc. + 2007-07-25 Glenn Morris <rgm@gnu.org> * Relicense all FSF files to GPLv3 or later. diff --git a/mac/Emacs.app/Contents/Info.plist b/mac/Emacs.app/Contents/Info.plist index ed2c4a8bf7c..5a369772188 100644 --- a/mac/Emacs.app/Contents/Info.plist +++ b/mac/Emacs.app/Contents/Info.plist @@ -31,6 +31,428 @@ MA 02110-1301, USA. <dict> <key>CFBundleTypeExtensions</key> <array> + <string>text</string> + <string>txt</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeName</key> + <string>Plain text document</string> + <key>CFBundleTypeOSTypes</key> + <array> + <string>TEXT</string> + <string>utxt</string> + </array> + <key>CFBundleTypeRole</key> + <string>Editor</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>html</string> + <string>htm</string> + <string>shtm</string> + <string>shtml</string> + <string>jsp</string> + <string>asp</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeName</key> + <string>HTML document</string> + <key>CFBundleTypeOSTypes</key> + <array> + <string>HTML</string> + </array> + <key>CFBundleTypeRole</key> + <string>Editor</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>css</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeName</key> + <string>CSS style sheet</string> + <key>CFBundleTypeRole</key> + <string>Editor</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>xhtml</string> + <string>xhtm</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeName</key> + <string>XHTML document</string> + <key>CFBundleTypeRole</key> + <string>Editor</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>xml</string> + <string>xsl</string> + <string>xslt</string> + <string>xbl</string> + <string>xul</string> + <string>rdf</string> + <string>dtd</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeName</key> + <string>XML document</string> + <key>CFBundleTypeRole</key> + <string>Editor</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>sgml</string> + <string>sgm</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeName</key> + <string>SGML document</string> + <key>CFBundleTypeRole</key> + <string>Editor</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>yml</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeName</key> + <string>YAML document</string> + <key>CFBundleTypeRole</key> + <string>Editor</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>js</string> + <string>JS</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeName</key> + <string>JavaScript script</string> + <key>CFBundleTypeRole</key> + <string>Editor</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>php</string> + <string>php3</string> + <string>php4</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeName</key> + <string>PHP script</string> + <key>CFBundleTypeRole</key> + <string>Editor</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>tcl</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeName</key> + <string>Tcl script</string> + <key>CFBundleTypeRole</key> + <string>Editor</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>rb</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeName</key> + <string>Ruby script</string> + <key>CFBundleTypeRole</key> + <string>Editor</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>py</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeName</key> + <string>Python script</string> + <key>CFBundleTypeRole</key> + <string>Editor</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>pl</string> + <string>pm</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeName</key> + <string>Perl script</string> + <key>CFBundleTypeRole</key> + <string>Editor</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>sh</string> + <string>csh</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeName</key> + <string>Shell script</string> + <key>CFBundleTypeRole</key> + <string>Editor</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>h</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeName</key> + <string>C Header Source File</string> + <key>CFBundleTypeRole</key> + <string>Editor</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>c</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeName</key> + <string>C Source File</string> + <key>CFBundleTypeRole</key> + <string>Editor</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>hh</string> + <string>hp</string> + <string>hpp</string> + <string>hxx</string> + <string>h++</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeName</key> + <string>C++ Header Source File</string> + <key>CFBundleTypeRole</key> + <string>Editor</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>cc</string> + <string>cp</string> + <string>cpp</string> + <string>cxx</string> + <string>c++</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeName</key> + <string>C++ Source File</string> + <key>CFBundleTypeRole</key> + <string>Editor</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>m</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeName</key> + <string>Objective-C Source File</string> + <key>CFBundleTypeRole</key> + <string>Editor</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>s</string> + <string>asm</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeName</key> + <string>Assembly Source File</string> + <key>CFBundleTypeRole</key> + <string>Editor</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>java</string> + <string>jav</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeName</key> + <string>Java Source File</string> + <key>CFBundleTypeRole</key> + <string>Editor</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>f</string> + <string>for</string> + <string>f77</string> + <string>f90</string> + <string>f95</string> + <string>f99</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeName</key> + <string>Fortran Source File</string> + <key>CFBundleTypeRole</key> + <string>Editor</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>pas</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeName</key> + <string>Pascal Source file</string> + <key>CFBundleTypeRole</key> + <string>Editor</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>ada</string> + <string>adb</string> + <string>ads</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeName</key> + <string>Ada Source File</string> + <key>CFBundleTypeRole</key> + <string>Editor</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>el</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeName</key> + <string>Emacs Lisp Source File</string> + <key>CFBundleTypeRole</key> + <string>Editor</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>hs</string> + <string>lhs</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeName</key> + <string>Haskell Source File</string> + <key>CFBundleTypeRole</key> + <string>Editor</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>lua</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeName</key> + <string>Lua Source File</string> + <key>CFBundleTypeRole</key> + <string>Editor</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>pro</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeName</key> + <string>IDL Procedure File</string> + <key>CFBundleTypeRole</key> + <string>Editor</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>gp</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeName</key> + <string>gnuplot file</string> + <key>CFBundleTypeRole</key> + <string>Editor</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>bib</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeName</key> + <string>BibTeX document</string> + <key>CFBundleTypeRole</key> + <string>Editor</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>tex</string> + <string>ltx</string> + <string>ctx</string> + <string>latex</string> + <string>texi</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeName</key> + <string>TeX document</string> + <key>CFBundleTypeRole</key> + <string>Editor</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> <string>*</string> </array> <key>CFBundleTypeName</key> diff --git a/mac/Emacs.app/Contents/Resources/Emacs.icns b/mac/Emacs.app/Contents/Resources/Emacs.icns Binary files differindex 25cc99fdd0e..de187c1142d 100644 --- a/mac/Emacs.app/Contents/Resources/Emacs.icns +++ b/mac/Emacs.app/Contents/Resources/Emacs.icns diff --git a/mac/Emacs.app/Contents/Resources/English.lproj/InfoPlist.strings b/mac/Emacs.app/Contents/Resources/English.lproj/InfoPlist.strings index fc069b9bb47..2d98a155d9e 100644 --- a/mac/Emacs.app/Contents/Resources/English.lproj/InfoPlist.strings +++ b/mac/Emacs.app/Contents/Resources/English.lproj/InfoPlist.strings @@ -1,5 +1,5 @@ /* Localized versions of Info.plist keys */ CFBundleName = "Emacs"; -CFBundleShortVersionString = "22.1.50"; -CFBundleGetInfoString = "22.1.50, Copyright (C) 2007 Free Software Foundation, Inc."; +CFBundleShortVersionString = "23.0.50"; +CFBundleGetInfoString = "23.0.50, Copyright (C) 2007 Free Software Foundation, Inc."; diff --git a/mac/Emacs.app/Contents/Resources/document.icns b/mac/Emacs.app/Contents/Resources/document.icns Binary files differnew file mode 100644 index 00000000000..e93974645fc --- /dev/null +++ b/mac/Emacs.app/Contents/Resources/document.icns diff --git a/mac/makefile.MPW b/mac/makefile.MPW index 9c03942effa..47fc1f9abf2 100644 --- a/mac/makefile.MPW +++ b/mac/makefile.MPW @@ -118,6 +118,7 @@ EmacsObjects = ¶ "{Src}sysdep.c.x" ¶ "{Src}term.c.x" ¶ "{Src}termcap.c.x" ¶ + "{Src}terminal.c.x" ¶ "{Src}textprop.c.x" ¶ "{Src}tparam.c.x" ¶ "{Src}undo.c.x" ¶ @@ -260,8 +261,8 @@ buildobj.lst Ä {CONFIG_H_GROUP} ¶ "{Includes}sys:types.h" ¶ "{Includes}sys:file.h" ¶ - "{Includes}sys:types.h" ¶ - "{Includes}sys:stat.h" ¶ + "{Includes}sys:types.h" ¶ + "{Includes}sys:stat.h" ¶ "{Src}lisp.h" ¶ "{Src}commands.h" ¶ "{Src}buffer.h" ¶ @@ -273,7 +274,9 @@ buildobj.lst Ä "{Src}process.h" ¶ "{Src}syssignal.h" ¶ "{Src}systty.h" ¶ - "{Includes}termio.h" + "{Includes}termio.h" ¶ + "{Src}frame.h" ¶ + "{Src}termhooks.h" {Src}casefiddle Ä ¶ {CONFIG_H_GROUP} ¶ @@ -798,6 +801,16 @@ buildobj.lst Ä "{Src}lisp.h" ¶ "{Includes}sys:file.h" +{Src}terminal.c.x Ä ¶ + {CONFIG_H_GROUP} ¶ + "{Src}lisp.h" ¶ + "{Src}frame.h" ¶ + "{Src}termchar.h" ¶ + "{Src}termhooks.h" ¶ + "{Src}charset.h" ¶ + "{Src}coding.h" ¶ + "{Src}keyboard.h" + {Src}textproc.c.x Ä ¶ {CONFIG_H_GROUP} ¶ "{Src}lisp.h" ¶ @@ -1014,6 +1027,7 @@ shortlisp = ¶ {Lisp}abbrev.elc ¶ {Lisp}buff-menu.elc ¶ {Lisp}button.elc ¶ + {Lisp}server.elc ¶ {Lisp}emacs-lisp:byte-run.elc ¶ {Lisp}cus-face.elc ¶ {Lisp}cus-start.elc ¶ @@ -1027,6 +1041,7 @@ shortlisp = ¶ {Lisp}emacs-lisp:float-sup.elc ¶ {Lisp}format.elc ¶ {Lisp}frame.elc ¶ + {Lisp}termdev.elc ¶ {Lisp}help.elc ¶ {Lisp}indent.elc ¶ {Lisp}isearch.elc ¶ diff --git a/mac/src/Emacs.r b/mac/src/Emacs.r index 21204ea22bb..33f69ab4258 100644 --- a/mac/src/Emacs.r +++ b/mac/src/Emacs.r @@ -144,7 +144,7 @@ resource 'DITL' (128, purgeable) { {10, 60, 72, 278}, StaticText { disabled, - "GNU Emacs 22 for Mac OS" + "GNU Emacs 23 for Mac OS" } } }; @@ -218,13 +218,13 @@ resource 'FREF' (129) { }; resource 'vers' (1) { - 0x22, /* Major revision in BCD */ - 0x1, /* Minor revision in BCD */ + 0x23, /* Major revision in BCD */ + 0x0, /* Minor revision in BCD */ development, /* development, alpha, beta, or final (release) */ 50, /* Non-final release # */ 0, /* Region code */ - "22.1.50", /* Short version number */ - "22.1.50, Copyright \0xa9 2007 " + "23.0.50", /* Short version number */ + "23.0.50, Copyright \0xa9 2007 " "Free Software Foundation, Inc." /* Long version number */ }; diff --git a/man/ack.texi b/man/ack.texi deleted file mode 100644 index d5dbf1ae8ca..00000000000 --- a/man/ack.texi +++ /dev/null @@ -1,1574 +0,0 @@ -@c This is part of the Emacs manual. -@c Copyright (C) 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003, -@c 2004, 2005, 2006, 2007 Free Software Foundation, Inc. -@c See file emacs.texi for copying conditions. -@c -@node Acknowledgments, Screen, Concept Index, Top -@unnumbered Acknowledgments - -Many people have contributed code included in the Free Software -Foundation's distribution of GNU Emacs. To show our appreciation for -their public spirit, we list here in alphabetical order those who have -written substantial portions. - -@c We should list here anyone who has contributed a new package, -@c and anyone who has made major enhancements in Emacs -@c that many users would notice and consider important. - -@itemize @bullet -@item -Per Abrahamsen wrote the customization buffer facilities, as well as -@file{double.el} for typing accented characters not normally available -from the keyboard, @file{xt-mouse.el} which handles mouse commands -through Xterm, @file{gnus-cus.el} which implements customization -commands for Gnus, @file{gnus-cite.el}, a citation-parsing facility -for news articles and @file{cpp.el} which hides or highlights parts of -C programs according to preprocessor conditionals. - -@item -Tomas Abrahamsson wrote @file{artist.el}, a package for producing @acronym{ASCII} -art with a mouse or with keyboard keys. - -@item -Jay K.@: Adams wrote @file{jka-compr.el}, providing automatic -decompression and recompression for compressed files. - -@item -Ralf Angeli wrote @file{scroll-lock.el}, a minor mode which keeps the -point vertically fixed by scrolling the window when moving up and down -in the buffer. - -@item -Joe Arceneaux wrote the original text property implementation, and -implemented support for X11. - -@item -Miles Bader wrote @file{image-file.el}, support code for visiting -image files, @file{minibuf-eldef.el}, a minor mode whereby the default -value is shown in the minibuffer prompt only when appropriate, and -@file{button.el}, the library that implements clickable buttons. - -@item -David Bakhash wrote @file{strokes.el}, a mode for controlling Emacs by -moving the mouse in particular patterns. - -@item -Eli Barzilay wrote @file{calculator.el}, a desktop calculator for -Emacs. - -@item -Steven L.@: Baur wrote -@c If earcon.el actually works with Emacs 21, it isn't useful for lack -@c of sound files. -- fx -@c @file{earcon.el}, a facility for sound effects -@c for email and news messages, -@file{footnote.el} which lets you include -footnotes in email messages, and @file{gnus-audio.el} which provides -sound effects for Gnus. - -@item -Alexander L. Belikoff, Sergey Berezin, David Edmondson, Andreas -Fuchs, Mario Lang, Gergely Nagy, Michael Olson, and Alex Schroeder -contributed ERC, an advanced Internet Relay Chat client. - -@item -Boaz Ben-Zvi wrote @file{profile.el}, to time Emacs Lisp functions. - -@item -Anna M. Bigatti wrote @file{cal-html.el}, which produces HTML calendars. - -@item -Ray Blaak wrote @file{delphi.el}, a major mode for editing Delphi -(Object Pascal) source code. - -@item -Jim Blandy wrote Emacs 19's input system, brought its configuration and -build process up to the GNU coding standards, and contributed to the -frame support and multi-face support. Jim also wrote @file{tvi970.el}, -terminal support for the TeleVideo 970 terminals. - -@item -Per Bothner wrote @file{term.el}, a terminal emulator in an Emacs -buffer. - -@item -Terrence M.@: Brannon wrote @file{landmark.el}, a neural-network robot -that learns landmarks. - -@item -Frank Bresz wrote @file{diff.el}, a program to display @code{diff} -output. - -@item -Peter Breton implemented: - -@itemize @minus -@item -@file{dirtrack} which does better tracking of directory changes in shell -buffers, -@item -@file{filecache.el} which records which directories your files are in, -@item -@file{locate.el} which interfaces to the @code{locate} command, -@item -@file{find-lisp.el}, an Emacs Lisp emulation of the @code{find} program, -@item -@file{net-utils.el}, and -@item -the ``generic mode'' feature. -@end itemize - -@item -Emmanuel Briot wrote @file{xml.el}, an XML parser for Emacs. - -@item -Kevin Broadey wrote @file{foldout.el}, providing folding extensions to -Emacs's outline modes. - -@c @item -@c Vincent Broman wrote @file{ada.el}, a mode for editing Ada code -@c (since replaced by @file{ada-mode.el}). - -@item -David M.@: Brown wrote @file{array.el}, for editing arrays and other -tabular data. - -@item -W@l{}odek Bzyl and Ryszard Kubiak wrote @file{ogonek.el}, a package for -changing the encoding of Polish characters. - -@item -Bill Carpenter provided @file{feedmail.el}, a package for massaging -outgoing mail messages and sending them through various popular mailers. - -@item -Per Cederqvist and Inge Wallin wrote @file{ewoc.el}, an Emacs widget for -manipulating object collections. - -@item -Hans Chalupsky wrote @file{advice.el}, an overloading mechanism for -Emacs Lisp functions, and @file{trace.el}, a tracing facility for Emacs -Lisp. - -@item -Chris Chase and Carsten Dominik wrote @file{idlwave.el}, an editing mode -for IDL and WAVE CL. - -@item -Bob Chassell wrote @file{texnfo-upd.el} and @file{makeinfo.el}, modes -and utilities for working with Texinfo files; and @file{page-ext.el}, -commands for extended page handling. - -@item -Andrew Choi wrote the Macintosh support code, and contributed -@file{mac-win.el}, support for the Mac window system. - -@item -James Clark wrote @file{sgml-mode.el}, a mode for editing SGML -documents, and contributed to Emacs's dumping procedures. - -@item -Mike Clarkson wrote @file{edt.el}, an emulation of DEC's EDT editor. - -@item -Glynn Clements provided @file{gamegrid.el} and a couple of games that -use it, Snake and Tetris. - -@item -Georges Brun-Cottan and Stefan Monnier wrote @file{easy-mmode.el}, a -package for easy definition of major and minor modes. - -@item -Andrew Csillag wrote M4 mode (@file{m4-mode.el}). - -@item -Doug Cutting and Jamie Zawinski wrote @file{disass.el}, a disassembler -for compiled Emacs Lisp code. - -@item -Mathias Dahl wrote @file{image-dired.el}, a package for viewing image -files as ``thumbnails.'' - -@item -Michael DeCorte wrote @file{emacs.csh}, a C-shell script that starts a -new Emacs job, or restarts a paused Emacs if one exists. - -@item -Gary Delp wrote @file{mailpost.el}, an interface between RMAIL and the -@file{/usr/uci/post} mailer. - -@item -Matthieu Devin wrote @file{delsel.el}, a package to make newly-typed -text replace the current selection. - -@item -Eric Ding contributed @file{goto-addr.el}, - -@item -Jan Dj@"{a}rv added support for the GTK+ toolkit and X drag-and-drop. - -@item -Carsten Dominik wrote @file{reftex.el}, a package for setting up -labels and cross-references in La@TeX{} documents, and @file{org.el}, -a mode for maintaining notes, todo lists, and project planning. - -@item -Scott Draves wrote @file{tq.el}, help functions for maintaining -transaction queues between Emacs and its subprocesses. - -@item -Benjamin Drieu wrote @file{pong.el}, an implementation of the classical -pong game. - -@item -Viktor Dukhovni wrote support for dumping under SunOS version 4. - -@item -John Eaton co-wrote Octave mode. - -@item -Rolf Ebert co-wrote Ada mode (@file{ada-mode.el}). - -@item -Stephen Eglen implemented @file{mspools.el}, for use with Procmail, -which tells you which mail folders have mail waiting in them, and -@file{iswitchb.el}, a feature for incremental reading and completion of -buffer names. - -@item -Torbj@"orn -Einarsson contributed the Fortran 90 mode (@file{f90.el}). - -@item -Tsugutomo Enami co-wrote the support for international character sets. - -@item -Hans Henrik Eriksen wrote @file{simula.el}, a mode for editing SIMULA 87 -code. - -@item -Michael Ernst wrote @file{reposition.el}, a command for recentering a -function's source code and preceding comment on the screen. - -@item -Ata Etemadi wrote @file{cdl.el}, functions for working with Common Data -Language source code. - -@item -Frederick Farnbach implemented @file{morse.el}, which converts text to -Morse code. - -@item -Oscar Figueiredo wrote EUDC, the Emacs Unified Directory Client, which -is an interface to directory servers via LDAP, CCSO PH/QI, or BBDB; and -@file{ldap.el}, the LDAP client interface. - -@item -Fred Fish wrote the support for dumping COFF executable files. - -@item -Karl Fogel wrote: - -@itemize @minus -@item -@file{bookmark.el}, for creating named placeholders, saving them and -jumping to them later, -@item -@file{mail-hist.el}, a history mechanism for outgoing mail messages, and -@item -@file{saveplace.el}, for preserving point's location in files between -editing sessions. -@end itemize - -@item -Gary Foster wrote @file{crisp.el}, the emulation for CRiSP and Brief -editors, and @file{scroll-lock.el} (now @file{scroll-all.el}) a mode -for scrolling several buffers together. - -@item -Noah Friedman wrote @file{rlogin.el}, an interface to Rlogin, -@file{type-break.el}, which reminds you to take periodic breaks from -typing, and @code{eldoc-mode}, a mode to show the defined parameters or -the doc string for the Lisp function near point. With Roland McGrath, -he wrote @file{rsz-mini.el}, a minor mode to automatically resize the -minibuffer to fit the text it contains. - -@item -Keith Gabryelski wrote @file{hexl.el}, a mode for editing binary files. - -@item -Kevin Gallagher rewrote and enhanced the EDT emulation, and wrote -@file{flow-ctrl.el}, a package for coping with unsuppressible XON/XOFF -flow control. - -@item -Kevin Gallo added multiple-frame support for Windows NT and wrote -@file{w32-win.el}, support functions for the MS-Windows window system. - -@item -Juan Le@'{o}n Lahoz Garc@'{i}a wrote @file{wdired.el}, a package for -performing file operations by directly editing Dired buffers. - -@item -Howard Gayle wrote: - -@itemize @minus -@item -the C and lisp code for display tables and case tables, -@item -@file{rot13.el}, a command to display the plain-text form of a buffer -encoded with the Caesar cipher, -@item -@file{case-table.el}, code to extend the character set and support case -tables, -@item -much of the support for the ISO-8859 European character sets (which -includes @file{iso-ascii.el}, @file{iso-insert.el}, @file{iso-swed.el}, -@file{latin-1.el}, @file{iso-syntax.el}, @file{iso-transl.el}, -@file{swedish.el}), and -@item -@file{vt100-led.el}, a package for controlling the LED's on -VT100-compatible terminals. -@end itemize - -@item -Stephen Gildea made the Emacs quick reference card, and made many -contributions for @file{time-stamp.el}, a package for maintaining -last-change time stamps in files. - -@item -Julien Gilles wrote @file{gnus-ml.el}, a mailing list minor mode for -Gnus. - -@item -David Gillespie wrote: - -@itemize @minus -@item -The Common Lisp compatibility packages, -@item -@code{Calc}, an advanced calculator and mathematical tool, -@item -@file{complete.el}, a partial completion mechanism, and -@item -@file{edmacro.el}, a package for editing keyboard macros. -@end itemize - -@item -Bob Glickstein contributed the @file{sregex.el} feature, a facility for -writing regexps using a Lisp-like syntax. - -@item -Boris Goldowsky wrote: - -@itemize @minus -@item -@file{avoid.el}, a package to keep the mouse cursor out of the way of -the text cursor, -@item -@file{shadowfile.el}, a package for keeping identical copies of files in -more than one place, -@item -@file{format.el}, a package for reading and writing files in various -formats, -@item -@file{enriched.el}, a package for saving text properties in files, and -@item -@file{facemenu.el}, a package for specifying faces. -@end itemize - -@item -Michelangelo Grigni wrote @file{ffap.el} which visits a file, -taking the file name from the buffer. - -@item -Odd Gripenstam wrote @file{dcl-mode.el} for editing DCL command files. - -@item -Kai Gro@ss{}johann and Michael Albinus wrote the Tramp package, which -provides transparent remote file editing using rcp, ssh, ftp, and other -network protocols. - -@item -Michael Gschwind wrote @file{iso-cvt.el}, a package to convert between -the ISO 8859-1 character set and the notations for non-@acronym{ASCII} -characters used by @TeX{} and net tradition, and @file{latin-2.el}, code -which sets up case-conversion and syntax tables for the ISO Latin-2 -character set. - -@item -Henry Guillaume wrote @file{find-file.el}, a package to visit files -related to the currently visited file. - -@item -Doug Gwyn wrote the portable @code{alloca} implementation. - -@item -Ken'ichi Handa implemented most of the support for international -character sets, and wrote @file{isearch-x.el}, a facility for searching -non-@acronym{ASCII} text. Together with Naoto Takahashi, he wrote -@file{quail.el}, a simple input facility for typing non-@acronym{ASCII} text from -an @acronym{ASCII} keyboard. Ken'ichi also wrote @file{ps-bdf.el}, a BDF font -support for printing non-@acronym{ASCII} text on a PostScript printer. - -@item -Chris Hanson wrote @file{netuname.el}, a package to use HP-UX's Remote -File Access facility from Emacs. - -@item -Jesper Harder wrote @file{yenc.el}, for decoding yenc encoded messages. - -@item -K. Shane Hartman wrote: - -@itemize @minus -@item -@file{chistory.el} and @file{echistory.el}, packages for browsing -command history lists, -@item -@file{electric.el} and @file{helper.el}, providing an alternative -command loop and appropriate help facilities, -@item -@file{emacsbug.el}, a package for reporting Emacs bugs, -@item -@file{picture.el}, a mode for editing @acronym{ASCII} pictures, and -@item -@file{view.el}, a package for perusing files and buffers without editing -them. -@end itemize - -@item -John Heidemann wrote @file{mouse-copy.el} and @file{mouse-drag.el}, -which provide alternative mouse-based editing and scrolling features. - -@item -Jon K Hellan wrote @file{utf7.el}, support for mail-safe transformation -format of Unicode. - -@item -Markus Heritsch co-wrote Ada mode (@file{ada-mode.el}). - -@item -Karl Heuer wrote the original blessmail script, implemented the -@code{intangible} text property, and rearranged the structure of the -@code{Lisp_Object} type to allow for more data bits. - -@item -Manabu Higashida ported Emacs to MS-DOS. - -@item -Anders Holst wrote @file{hippie-exp.el}, a versatile completion and -expansion package. - -@item -Kurt Hornik co-wrote Octave mode. - -@item -Tom Houlder wrote @file{mantemp.el}, which generates manual C@t{++} -template instantiations. - -@item -Joakim Hove wrote @file{html2text.el}, a html to plain text converter. -@item -Denis Howe wrote @file{browse-url.el}, a package for invoking a WWW -browser to display a URL. - -@item -Lars Magne Ingebrigtsen did a major redesign of the Gnus news-reader and -wrote many of its parts. - -@item -Andrew Innes contributed extensively to the MS-Windows support. - -@item -Seiichiro Inoue improved Emacs's XIM support. - -@item -Ulf Jasper wrote @file{icalendar.el}, a package for converting Emacs -diary entries to and from the iCalendar format, and -@file{newsticker.el}, an RSS and Atom based Newsticker. - -@item -Kyle Jones wrote @file{life.el}, a package to play Conway's ``life'' game, -and @file{mldrag.el}, a package which allows the user to resize windows -by dragging mode lines and vertical window separators with the mouse. - -@item -Terry Jones wrote @file{shadow.el}, a package for finding potential -load-path problems when some Lisp file ``shadows'' another. - -@item -Simon Josefsson wrote: - -@itemize @minus -@item -@file{dns-mode.el}, an editing mode for Domain Name System master files, -@item -@file{flow-fill.el}, a package for interpreting RFC2646 formatted text -in messages, -@item -@file{fringe.el}, a package for customizing the fringe, -@item -@file{imap.el}, an Emacs Lisp library for talking to IMAP servers, -@item -@file{nnimap}, the IMAP back-end for Gnus, and -@item -@file{rfc2104.el}, a hashed message authentication facility. -@end itemize - -@item -Arne J@o{}rgensen wrote @file{latexenc.el}, a package to -automatically guess the correct coding system in LaTeX files. - -@item -Tomoji Kagatani implemented @file{smtpmail.el}, used for sending out -mail with SMTP. - -@item -David Kaufman wrote @file{yow.c}, an essential utility program for the -hopelessly pinheaded. - -@item -Henry Kautz wrote @file{bib-mode.el}, a mode for maintaining -bibliography databases compatible with @code{refer} (the @code{troff} -version) and @code{lookbib}, and @file{refbib.el}, a package to convert -those databases to the format used by the LaTeX text formatting package. - -@item -Taichi Kawabata added support for Devanagari script and the Indian -languages. - -@item -Howard Kaye wrote @file{sort.el}, commands to sort text in Emacs -buffers. - -@item -Michael Kifer wrote @file{ediff.el}, an interactive interface to the -@command{diff}, @command{patch}, and @command{merge} programs, and -Viper, the newest emulation for VI. - -@item -Richard King wrote the first version of @file{userlock.el} and -@file{filelock.c}, which provide simple support for multiple users -editing the same file. He also wrote the initial version of -@file{uniquify.el}, a facility to make buffer names unique by adding -parts of the file's name to the buffer name. -@c We're not using his backquote.el any more. - -@item -Peter Kleiweg wrote @file{ps-mode.el}, a major mode for editing -PostScript files and running a PostScript interpreter interactively from -within Emacs. - -@item -Pavel Kobiakov wrote @file{flymake.el}, a minor mode for performing -on-the-fly syntax checking. - -@item -Larry K.@: Kolodney wrote @file{cvtmail.c}, a program to convert the mail -directories used by Gosling Emacs into RMAIL format. - -@item -David M.@: Koppelman wrote @file{hi-lock.el}, a minor mode for -interactive automatic highlighting of parts of the buffer text. - -@item -Koseki Yoshinori wrote @file{iimage.el}, a minor mode for displaying -inline images. - -@item -Robert Krawitz wrote the original @file{xmenu.c}, part of Emacs's pop-up -menu support. - -@item -Sebastian Kremer wrote Emacs 19's @code{dired-mode}, with contributions -by Lawrence R.@: Dodd. He also wrote @file{ls-lisp.el}, a Lisp emulation -of the @code{ls} command for platforms which don't have @code{ls} as a -standard program. - -@item -Geoff Kuenning wrote Emacs 19's @file{ispell.el}, based on work by Ken -Stevens and others. - -@item -David K@ringaccent{a}gedal wrote @file{tempo.el}, providing support for -easy insertion of boilerplate text and other common constructions. - -@item -Daniel LaLiberte wrote: - -@itemize @minus -@item -@file{edebug.el}, a source-level debugger for Emacs Lisp, -@item -@file{cl-specs.el}, specifications to help @code{edebug} debug code -written using David Gillespie's Common Lisp support, -@item -@file{cust-print.el}, a customizable package for printing lisp objects, -@item -@file{eval-reg.el}, a re-implementation of @code{eval-region} in Emacs -Lisp, and -@item -@file{isearch.el}, Emacs's incremental search minor mode. -@end itemize - -@item -James R.@: Larus wrote @file{mh-e.el}, an interface to the MH mail system. - -@item -Vinicius Jose Latorre wrote the Emacs printing facilities, as well as: - -@itemize @minus -@item -@code{ps-print}, a package for pretty-printing Emacs buffers to -PostScript printers, -@item -@file{delim-col.el}, a package to arrange text into columns, -@item -@file{ebnf2ps.el}, a package that translates EBNF grammar to a syntactic -chart that can be printed to a PostScript printer. -@end itemize - -@item -Frederic Lepied contributed @file{expand.el}, which uses the abbrev -mechanism for inserting programming constructs. - -@item -Peter Liljenberg wrote @file{elint.el}, a Lint-style code checker for -Emacs Lisp programs. - -@item -Lars Lindberg wrote @file{msb.el}, which provides more flexible menus -for buffer selection, and rewrote @file{dabbrev.el}. - -@item -Anders Lindgren wrote @file{autorevert.el}, a package for automatically -reverting files visited by Emacs that were changed on disk; -@file{cwarn.el}, a package to highlight suspicious C and C@t{++} -constructs; and @file{follow.el}, a minor mode to synchronize windows -that show the same buffer. - -@item -Thomas Link wrote @file{filesets.el}, a package for handling sets of -files. - -@item -Dave Love wrote much of the code dealing with Unicode support and -Latin-N unification. He added support for many coding systems, -including those in @file{code-pages.el} and the various UTF-7 and -UTF-16 coding systems. He also wrote: - -@itemize @minus -@item -@code{autoarg-mode}, a global minor mode whereby digit keys supply -prefix arguments, and @code{autoarg-kp-mode} which redefines the keypad -numeric keys to digit arguments, -@item -@file{autoconf.el}, a mode for editing Autoconf @file{configure.in} -files, -@item -@file{cfengine.el}, a mode for editing Cfengine files, -@item -@file{elide-head.el}, a package for eliding boilerplate text, such as -copyright notices, from file headers, -@item -@file{hl-line.el}, a package that provides a minor mode for highlighting -the line in the current window on which point is, -@item -@file{latin-8.el} and @file{latin-9.el}, code which sets up -case-conversion and syntax tables for the ISO Latin-8 and Latin-9 -character sets, -@item -@file{latin1-disp.el}, a package that lets you display ISO 8859 -characters on Latin-1 terminals by setting up appropriate display -tables, -@item -@file{python.el}, a major mode for the Python programming language. -@item -@file{refill.el}, a mode for automatic paragraph refilling, akin to -typical word processors, -@item -@file{smiley-ems.el}, a facility for displaying smiley faces, and -@item -@file{tool-bar.el}, a mode to control the display of the Emacs tool bar. -@end itemize - -@item -Eric Ludlam wrote the Speedbar package and the following packages: - -@itemize @minus -@item -@file{checkdoc.el}, for checking doc strings in Emacs Lisp programs, -@item -@file{dframe.el}, providing dedicatd frame support modes, and -@item -@file{ezimage.el}, a generalized way to place images over text. -@end itemize - -@item -Alan Mackenzie wrote the integrated AWK support in CC Mode. - -@item -Christopher J.@: Madsen wrote @file{decipher.el}, a package for cracking -simple substitution ciphers. - -@item -Neil M.@: Mager wrote @file{appt.el}, functions to notify users of their -appointments. It finds appointments recorded in the diary files -generated by Edward M.@: Reingold's @code{calendar} package. - -@item -Ken Manheimer wrote @file{allout.el}, a mode for manipulating and -formatting outlines, and @file{icomplete.el}, which provides incremental -completion feedback in the minibuffer. - -@item -Bill Mann wrote @file{perl-mode.el}, a mode for editing Perl code. - -@item -Brian Marick and Daniel LaLiberte wrote @file{hideif.el}, support for -hiding selected code within C @code{#ifdef} clauses. - -@item -Simon Marshall wrote @file{regexp-opt.el}, which generates a regular -expression from a list of strings. He also extended @file{comint.el}, -originally written by Olin Shivers. - -@item -Bengt Martensson, Marc Shapiro, Mike Newton, Aaron Larson, and Stefan -Schoef, wrote @file{bibtex.el}, a mode for editing Bib@TeX{} -bibliography files. - -@item -Charlie Martin wrote @file{autoinsert.el}, which provides automatic -mode-sensitive insertion of text into new files. - -@item -Thomas May wrote @file{blackbox.el}, a version of the traditional -blackbox game. - -@item -Roland McGrath wrote: - -@itemize @minus -@item -@file{compile.el}, a package for running compilations in a buffer, and -then visiting the locations reported in error messages, -@item -@file{etags.el}, a package for jumping to function definitions and -searching or replacing in all the files mentioned in a @file{TAGS} file, -@item -@file{find-dired.el}, for using @code{dired} commands on output from the -@code{find} program, with Sebastian Kremer, -@item -@file{map-ynp.el}, a general purpose boolean question-asker, -@item -@file{autoload.el}, providing semi-automatic maintenance of autoload -files, and -@item -@file{upd-copyr.el}, providing semi-automatic maintenance of copyright -notices in source code. -@end itemize - -@item -David Megginson wrote @file{derived.el}, which allows one to define new -major modes by inheriting key bindings and commands from existing major -modes. - -@item -Will Mengarini wrote @file{repeat.el}, a command to repeat the preceding -command with its arguments. - -@item -Wayne Mesard wrote @file{hscroll.el} which does horizontal scrolling -automatically. - -@item -Brad Miller wrote @file{gnus-gl.el}, a Gnus interface for GroupLens. - -@item -Richard Mlynarik wrote: - -@itemize @minus -@item -@file{cl-indent.el}, a package for indenting Common Lisp code, -@item -@file{ebuff-menu.el}, an ``electric'' browser for buffer listings, -@item -@file{ehelp.el}, bindings for browsing help screens, -@item -@file{rfc822.el}, a parser for E-mail addresses in the RFC-822 format, -used in mail messages and news articles, -@item -@file{terminal.el}, a terminal emulator for Emacs subprocesses, and -@item -@file{yow.el}, an essential utility (try @kbd{M-x yow}). -@end itemize - -@item -Gerd Moellmann was the Emacs maintainer from the beginning of Emacs 21 -development until the release of 21.1. He wrote: - -@itemize @minus -@item -the new display engine for Emacs 21, -@item -the asynchronous timers facility (@file{atimer.c}), -@item -the @code{ebrowse} C@t{++} browser, -@item -@file{jit-lock.el}, the Just-In-Time font-lock support mode, -@item -@file{tooltip.el}, a package for displaying tooltips, and -@item -@file{authors.el} package for maintaining the @file{AUTHORS} files. -@end itemize - -@item -Stefan Monnier added support for Arch, Subversion, and Meta-CVS to VC, -and re-wrote much of the Emacs server to use the built-in networking -primitives. He also wrote: - -@itemize @minus -@item -@code{PCL-CVS}, a directory-level front end to the CVS version control -system, -@item -@file{reveal.el}, a minor mode for automatically revealing invisible -text, -@item -@file{smerge-mode.el}, a minor mode for resolving @code{diff3} -conflicts, and -@item -@file{diff-mode.el}, a mode for viewing and editing context diffs. -@end itemize - -@item -Morioka Tomohiko wrote several packages for MIME support in Gnus and -elsewhere. - -@item -Sen Nagata wrote @file{crm.el}, a package for reading multiple strings -with completion, and @file{rfc2368.el}, support for @code{mailto:} -URLs. - -@item -Erik Naggum wrote the time-conversion functions. He also wrote -@file{disp-table.el}, a package for dealing with display tables, -@file{latin-4.el} and @file{latin-5.el}, code which sets up -case-conversion and syntax tables for the ISO Latin-4 and Latin-5 -character sets, @file{mailheader.el}, a package for parsing email -headers, and @file{parse-time.el}, a package for parsing time strings. - -@item -Thomas Neumann and Eric Raymond wrote @file{makefile.el} (now -@file{make-mode.el}), a mode for editing makefiles. - -@item -Thien-Thi Nguyen and Dan Nicolaescu wrote @file{hideshow.el}, a minor -mode for selectively displaying blocks of text. - -@item -Dan Nicolaescu wrote @file{romanian.el}, support for editing Romanian -text, and @file{iris-ansi.el}, support for running Emacs on SGI's -@code{xwsh} and @code{winterm} terminal emulators. - -@item -Jurgen Nickelsen wrote @file{ws-mode.el}, providing WordStar emulation. - -@item -Hrvoje Niksic wrote @file{savehist.el}, for saving the minibuffer -history between Emacs sessions. - -@item -Jeff Norden wrote @file{kermit.el}, a package to help the Kermit -dialup communications program run comfortably in an Emacs shell buffer. - -@item -Andrew Norman wrote @file{ange-ftp.el}, providing transparent FTP -support. - -@item -Alexandre Oliva wrote @file{gnus-mlspl.el}, a group params-based mail -splitting mechanism. - -@item -Takaaki Ota wrote @file{table.el}, a package for creating and editing -embedded text-based tables. - -@item -Pieter E.@: J.@: Pareit wrote @file{mixal-mode.el}, an editing mode for -the MIX assembly language. - -@item -David Pearson contributed @file{quickurl.el}, a simple method of -inserting a URL into the current buffer based on text at point; -@file{5x5.el}, a game to fill all squares on the field. - -@item -Jeff Peck wrote: - -@itemize @minus -@item -@file{emacstool.c}, support for running Emacs under SunView/Sun Windows, -@item -@file{sun.el}, key bindings for sunterm keys, -@item -@file{sun-curs.el}, cursor definitions for Sun Windows, and -@item -@file{sun-fns.el} and @file{sun-mouse.el}, providing mouse support for -Sun Windows. -@end itemize - -@item -Damon Anton Permezel wrote @file{hanoi.el}, an animated demonstration of -the ``Towers of Hanoi'' puzzle. - -@item -William M.@: Perry wrote @file{mailcap.el}, a MIME media types -configuration facility, @file{mwheel.el}, a package for supporting -mouse wheels, and the URL package. - -@item -Per Persson wrote @file{gnus-vm.el}, the VM interface for Gnus. - -@item -Jens Petersen wrote @file{find-func.el}, which makes it easy to find -the source code for an Emacs Lisp function or variable. - -@item -Daniel Pfeiffer wrote: - -@itemize @minus -@item -@file{conf-mode.el}, a major mode for editing configuration files, -@item -@file{copyright.el}, a package for updating copyright notices in files, -@item -@file{executable.el}, a package for executing interpreter scripts, -@item -@file{sh-script.el}, a mode for editing shell scripts, -@item -@file{skeleton.el}, implementing a concise language for writing -statement skeletons, and -@item -@file{two-column.el}, a minor mode for simultaneous two-column editing. -@end itemize - -Daniel also rewrote @file{apropos.el}, originally written by Joe Wells, -and, together with Jim Blandy, co-authored @file{wyse50.el}, support for -Wyse 50 terminals. - -@item -Richard L.@: Pieri wrote @file{pop3.el}, a Post Office Protocol (RFC -1460) interface for Emacs. - -@item -Fred Pierresteguy and Paul Reilly made Emacs work with X Toolkit -widgets. - -@item -Christian Plaunt wrote @file{soundex.el}, an implementation of the -Soundex algorithm for comparing English words by their pronunciation. - -@item -David Ponce wrote: - -@itemize @minus -@item -@file{recentf.el}, a package that puts a menu of recently visited -files in the Emacs menu bar, -@item -@file{ruler-mode.el}, a minor mode for displaying a ruler in the -header line, and -@item -@file{tree-widget.el}, a package to display hierarchical data structures. -@end itemize - -@item -Francesco A.@: Potorti wrote @file{cmacexp.el}, providing a command which -runs the C preprocessor on a region of a file and displays the results. -He also expanded and redesigned the @code{etags} program. - -@item -Michael D.@: Prange and Steven A.@: Wood wrote @file{fortran.el}, a mode for -editing FORTRAN code. -@c We're not distributing his tex-mode.el anymore; we're using Ed Reingold's. - -@item -Mukesh Prasad contributed @file{vmsproc.el}, a facility for running -asynchronous subprocesses on VMS. - -@item -Marko Rahamaa wrote @file{latin-3.el}, code which sets up -case-conversion and syntax tables for the ISO Latin-3 character set. - -@item -Ashwin Ram wrote @file{refer.el}, commands to look up references in -bibliography files by keyword. - -@item -Eric S.@: Raymond wrote: - -@itemize @minus -@item -@file{vc.el}, an interface to the RCS and SCCS source code version -control systems, with Paul Eggert, -@item -@file{gud.el}, a package for running source-level debuggers like GDB -and SDB in Emacs, -@item -@file{asm-mode.el}, a mode for editing assembly language code, -@item -@file{AT386.el}, terminal support package for IBM's AT keyboards, -@item -@file{cookie1.el}, support for ``fortune-cookie'' programs like -@file{yow.el} and @file{spook.el}, -@item -@file{finder.el}, a package for finding Emacs Lisp packages by keyword -and topic, -@item -@file{keyswap.el}, code to swap the @key{BS} and @key{DEL} keys, -@item -@file{loadhist.el}, functions for loading and unloading Emacs features, -@item -@file{lisp-mnt.el}, functions for working with the special headers used -in Emacs Lisp library files, and -@item -code to set and make use of the @code{load-history} lisp variable, which -records the source file from which each lisp function loaded into Emacs -came. -@end itemize - -@item -Edward M.@: Reingold wrote the extensive calendar and diary support (try -@kbd{M-x calendar}), with contributions from Stewart Clamen, Nachum -Dershowitz, Paul Eggert, Steve Fisk, Michael Kifer, and Lara Rios. Andy -Oram contributed to its documentation. Reingold has also contributed to -@file{tex-mode.el}, a mode for editing @TeX{} files, as have William -F.@: Schelter, Dick King, Stephen Gildea, Michael Prange, and Jacob Gore. - -@item -David Reitter wrote @file{mailclient.el} which can send mail via the -system's designated mail client. - -@item -Alex Rezinsky contributed @file{which-func.el}, a mode that shows the -name of the current function in the mode line. - -@item -Rob Riepel contributed @file{tpu-edt.el} and its associated files, -providing an emulation of the VMS TPU text editor emulating the VMS EDT -editor, and @file{vt-control.el}, providing some control functions for -the DEC VT line of terminals. - -@item -Nick Roberts wrote @file{gdb-ui.el}, the graphical user interface to -GDB. - -@item -Roland B.@: Roberts contributed much of the VMS support distributed with -Emacs 19, along with Joseph M.@: Kelsey, and @file{vms-pmail.el}, support -for using Emacs within VMS MAIL. - -@item -John Robinson wrote @file{bg-mouse.el}, support for the mouse on the BBN -Bitgraph terminal. - -@item -Danny Roozendaal implemented @file{handwrite.el}, which converts text -into ``handwriting.'' - -@item -William Rosenblatt wrote @file{float.el}, implementing a floating-point -numeric type using Lisp cons cells and integers. - -@item -Guillermo J.@: Rozas wrote @file{scheme.el}, a mode for editing Scheme and -DSSSL code, and @file{fakemail.c}, an interface to the System V mailer. - -@item -Ivar Rummelhoff provided @file{winner.el}, which records -recent window configurations so you can move back to them. - -@item -Jason Rumney has ported the Emacs 21 display engine to MS-Windows, and -contributed extensively to the MS-Windows port of Emacs. - -@item -Wolfgang Rupprecht contributed Emacs 19's floating-point support -(including @file{float-sup.el} and @file{floatfns.c}), and -@file{sup-mouse.el}, support for the Supdup mouse on lisp machines. - -@item -Kevin Ryde wrote @file{info-xref.el}, a library for checking -references in Info files. - -@item -James B.@: Salem and Brewster Kahle wrote @file{completion.el}, providing -dynamic word completion. - -@item -Masahiko Sato wrote @file{vip.el}, an emulation of the VI editor. - -@item -Holger Schauer wrote @file{fortune.el}, a package for using fortune in -message signatures. - -@item -William Schelter wrote @file{telnet.el}, support for @code{telnet} -sessions within Emacs. - -@item -Ralph Schleicher contributed @file{battery.el}, a package for displaying -laptop computer battery status, and @file{info-look.el}, a package for -looking up Info documentation for symbols in the buffer. - -@item -Michael Schmidt and Tom Perrine wrote @file{modula2.el}, a mode for -editing Modula-2 code, based on work by Mick Jordan and Peter Robinson. - -@item -Ronald S.@: Schnell wrote @file{dunnet.el}, a text adventure game. - -@item -Philippe Schnoebelen wrote @file{gomoku.el}, a Go Moku game played -against Emacs, and @file{mpuz.el}, a multiplication puzzle. - -@item -Jan Schormann wrote @file{solitaire.el}, an Emacs Lisp implementation of -the Solitaire game. - -@item -Alex Schroeder wrote @file{ansi-color.el}, a package for translating -ANSI color escape sequences to Emacs faces, and @file{sql.el}, a package -for interactively running an SQL interpreter in an Emacs buffer. - -@item -Randal Schwartz wrote @file{pp.el}, a pretty-printer for lisp objects. - -@item -Oliver Seidel wrote @file{todo-mode.el}, a package for maintaining -@file{TODO} list files. - -@item -Manuel Serrano contributed the Flyspell package that does spell checking -as you type. - -@item -Hovav Shacham wrote @file{windmove.el}, a set of commands for selecting -windows based on their geometrical position on the frame. - -@item -Stanislav Shalunov wrote @file{uce.el}, for responding to unsolicited -commercial email. - -@item -Richard Sharman contributed @file{hilit-chg.el}, which uses colors -to show recent editing changes. - -@item -Olin Shivers wrote: - -@itemize @minus -@item -@file{comint.el}, a library for modes running interactive command-line- -oriented subprocesses, -@item -@file{cmuscheme.el}, for running inferior Scheme processes, -@item -@file{inf-lisp.el}, for running inferior Lisp process, and -@item -@file{shell.el}, for running inferior shells. -@end itemize - -@item -Espen Skoglund wrote @file{pascal.el}, a mode for editing Pascal code. - -@item -Rick Sladkey wrote @file{backquote.el}, a lisp macro for creating -mostly-constant data. - -@item -Lynn Slater wrote @file{help-macro.el}, a macro for writing interactive -help for key bindings. - -@item -Chris Smith wrote @file{icon.el}, a mode for editing Icon code. - -@item -David Smith wrote @file{ielm.el}, a mode for interacting with the Emacs -Lisp interpreter as a subprocess. - -@item -Paul D.@: Smith wrote @file{snmp-mode.el}. - -@item -William Sommerfeld wrote @file{scribe.el}, a mode for editing Scribe -files, and @file{server.el}, a package allowing programs to send files -to an extant Emacs job to be edited. - -@item -Andre Spiegel made many contributions to the Emacs Version Control -package, and in particular made it support multiple back ends. - -@item -Michael Staats wrote @file{pc-select.el}, which rebinds keys for -selecting regions to follow many other systems. - -@item -Richard Stallman invented Emacs, and then wrote: - -@itemize @minus -@item -@file{easymenu.el}, a facility for defining Emacs menus, -@item -@file{menu-bar.el}, the Emacs menu bar support code, -@item -@file{paren.el}, a package to make matching parentheses stand out in -color, and -@item -most of the rest of Emacs code. -@end itemize - -@item -Sam Steingold wrote @file{gulp.el}, a facility for asking package -maintainers for updated versions of their packages via e-mail, and -@file{midnight.el}, a package for running a command every midnight. - -@item -Ake Stenhoff and Lars Lindberg wrote @file{imenu.el}, a framework for -browsing indices made from buffer contents. - -@item -Peter Stephenson contributed @file{vcursor.el}, which implements a -``virtual cursor'' that you can move with the keyboard and use for -copying text. - -@item -Ken Stevens wrote the initial version of @file{ispell.el} and maintains -that package since Ispell 3.1 release. - -@item -Jonathan Stigelman wrote @file{hilit19.el}, a package providing -automatic highlighting in source code buffers, mail readers, and other -contexts. - -@item -Kim F.@: Storm made many improvements to the Emacs display engine, -process support, and networking support. He also wrote: - -@itemize @minus -@item -@file{bindat.el}, a package for encoding and decoding binary data. -@item -@file{cua.el}, which allows Emacs to emulate the standard CUA key -bindings. -@item -@file{ido.el}, a package for selecting buffers and files quickly. -@item -@file{kmacro.el}, the keyboard macro facility. -@end itemize - -@item -Martin Stjernholm co-authored CC Mode, a major editing mode for C, -C@t{++}, Objective-C, Java, Pike, CORBA IDL, and AWK code. - -@item -Steve Strassman did not write @file{spook.el}, and even if he did, he -really didn't mean for you to use it in an anarchistic way. - -@item -Olaf Sylvester wrote @file{bs.el}, a package for manipulating Emacs -buffers. - -@item -Tibor @v{S}imko and Milan Zamazal wrote @file{slovak.el}, support for -editing text in Slovak language. - -@item -Naoto Takahashi wrote @file{utf-8.el}, support for encoding and -decoding UTF-8 data. - -@item -Luc Teirlinck wrote @file{help-at-pt.el}, providing local help through -the keyboard. - -@item -Jean-Philippe Theberge wrote @file{thumbs.el}, a package for viewing -image files as ``thumbnails.'' - -@item -Jens T.@: Berger Thielemann wrote @file{word-help.el}, which is -part of the basis for @file{info-look.el}. - -@item -Spencer Thomas wrote the original @file{dabbrev.el}, providing a command -which completes the partial word before point, based on other nearby -words for which it is a prefix. He also wrote the original dumping -support. - -@item -Jim Thompson wrote @file{ps-print.el}, which converts -Emacs text to PostScript. - -@item -Tom Tromey and Chris Lindblad wrote @file{tcl.el}, a major mode for -editing Tcl/Tk source files and running a Tcl interpreter as an Emacs -subprocess. - -@item -Eli Tziperman wrote @file{rmail-spam-filter.el}, a spam filter for RMAIL. -@item -Daiki Ueno wrote @file{starttls.el}, support for Transport Layer -Security protocol, and the PGG package adding GnuPG and PGP support. - -@item -Masanobu Umeda wrote: - -@itemize @minus -@item -GNUS, a feature-full reader for Usenet news, -@item -@file{prolog.el}, a mode for editing Prolog code, -@item -@file{rmailsort.el}, a package for sorting messages in RMAIL folders, -@item -@file{metamail.el}, an interface to the Metamail program, -@item -@file{gnus-kill.el}, the Kill File mode for Gnus, -@item -@file{gnus-mh.el}, an mh-e interface for Gnus, -@item -@file{gnus-msg.el}, a mail and post interface for Gnus, -@item -@file{tcp.el}, emulation of the @code{open-network-stream} function for -some Emacs configurations which lack it, and -@item -@file{timezone.el}, providing functions for dealing with time zones. -@end itemize - -@item -Rajesh Vaidheeswarran wrote @file{whitespace.el}, a package that -detects and cleans up excess whitespace in a file. - -@item -Neil W.@: Van Dyke wrote @file{webjump.el}, a ``hot links'' package. - -@item -Didier Verna contributed @file{rect.el}, a package of functions for -operations on rectangle regions of text. - -@item -Ulrik Vieth implemented @file{meta-mode.el}, for editing MetaFont code. - -@item -Geoffrey Voelker wrote the Windows NT support. He also wrote -@file{dos-w32.el}, functions shared by the MS-DOS and MS-Windows ports -of Emacs, and @file{w32-fns.el}, MS-Windows specific support functions. - -@item -Johan Vromans wrote @file{forms.el} and its associated files, a -mode for filling in forms. - -@item -Colin Walters wrote @file{ibuffer.el}, a Dired-like major mode for -operating on buffers. - -@item -Barry Warsaw wrote: - -@itemize @minus -@item -@file{assoc.el}, a set of utility functions for working with association -lists, -@item -@file{cc-mode.el}, a major mode for editing C, C@t{++}, and Java code, -based on earlier work by Dave Detlefs, Stewart Clamen, and Richard -Stallman, -@item -@file{elp.el}, a new profiler for Emacs Lisp programs. -@item -@file{man.el}, a mode for reading UNIX manual pages, -@item -@file{regi.el}, providing an AWK-like functionality for use in lisp -programs, -@item -@file{reporter.el}, providing customizable bug reporting for lisp -packages, and -@item -@file{supercite.el}, a minor mode for quoting sections of mail messages -and news articles. -@end itemize - -@item -Morten Welinder introduced face support into the MS-DOS port of Emacs, -and also wrote: - -@itemize @minus -@item -@file{desktop.el}, facilities for saving some of Emacs's state between -sessions, -@item -@file{timer.el}, the Emacs facility to run commands at a given time or -frequency, or when Emacs is idle, and its C-level support code, -@item -@file{pc-win.el}, the MS-DOS ``window-system'' support, -@item -@file{internal.el}, an ``internal terminal'' emulator for the MS-DOS -port of Emacs, -@item -@file{arc-mode.el}, the mode for editing compressed archives, -@item -@file{s-region.el}, commands for setting the region using the shift key -and motion commands, and -@item -@file{dos-fns.el}, functions for use under MS-DOS. -@end itemize - -He also helped port Emacs to MS-DOS. - -@item -Joseph Brian Wells wrote: - -@itemize @minus -@item -@file{apropos.el}, a command to find commands, functions, and variables -whose names contain matches for a regular expression, -@item -@file{resume.el}, support for processing command-line arguments after -resuming a suspended Emacs job, and -@item -@file{mail-extr.el}, a package for extracting names and addresses from -mail headers, with contributions from Jamie Zawinski. -@end itemize - -@item -Rodney Whitby and Reto Zimmermann wrote @file{vhdl-mode.el}, a major -mode for editing VHDL source code. - -@item -John Wiegley wrote @file{align.el}, a set of commands for aligning text -according to regular-expression based rules; @file{timeclock.el}, a -package for keeping track of time spent on projects; -@file{pcomplete.el}, a programmable completion facility; and -@code{eshell}, a command shell implemented entirely in Emacs Lisp. - -@item -Ed Wilkinson wrote @file{b2m.c}, a program to convert mail files from -RMAIL format to Unix @code{mbox} format. - -@item -Mike Williams wrote @file{mouse-sel.el}, providing enhanced mouse -selection, and @file{thingatpt.el}, a library of functions for finding -the ``thing'' (word, line, s-expression) containing point. - -@item -Bill Wohler wrote the Emacs interface to the MH mail system. - -@item -Dale R.@: Worley wrote @file{emerge.el}, a package for interactively -merging two versions of a file. - -@item -Francis J.@: Wright wrote @code{WoMan}, a package for browsing -manual pages without the @code{man} command. - -@item -Tom Wurgler wrote @file{emacs-lock.el}, which makes it harder -to exit with valuable buffers unsaved. - -@item -Masatake Yamato wrote @file{ld-script.el}, an editing mode for GNU -linker scripts, and contributed subword handling in CC mode. - -@item -Jonathan Yavner wrote @file{testcover.el}, a package for keeping track -of the testing status of Emacs Lisp code, and the SES spreadsheet -package. - -@item -Ryan Yeske wrote @file{rcirc.el} a simple Internet Relay Chat client. -@item -Ilya Zakharevich and Bob Olson contributed @file{cperl-mode.el}, a major -mode for editing Perl code. Ilya Zakharevich also wrote @file{tmm.el}, -a mode for accessing the Emacs menu bar on a text-mode terminal. - -@item -Milan Zamazal wrote @file{czech.el}, support for editing Czech text, -@file{glasses.el}, a package for easier reading of source code which -uses illegible identifier names such as @code{cantReadThisVariable}, and -@file{tildify.el}, commands for adding hard spaces to text, @TeX{}, and -SGML/HTML files. - -@item -Victor Zandy contributed @file{zone.el}, a package for people who like -to zone out in front of Emacs. - -@item -Eli Zaretskii made many standard Emacs features work on MS-DOS. He also -wrote @file{tty-colors.el}, which implements transparent mapping of X -colors to tty colors, and (together with Kenichi Handa) -@file{codepage.el}, a package for editing text encoded in DOS/Windows -code pages. - -@item -Jamie Zawinski wrote: - -@itemize @minus -@item -Emacs 19's optimizing byte compiler, with Hallvard Furuseth, -@item -much of the support for faces and X selections, -@item -@file{mailabbrev.el}, a package providing automatic expansion of mail -aliases, and -@item -@file{tar-mode.el}, providing simple viewing and editing commands for -tar files. -@end itemize - -@item -Andrew Zhilin created the Emacs icons used beginning with Emacs 22. - -@item -Shenghuo Zhu wrote: - -@itemize @minus -@item -@file{binhex.el}, a package for reading and writing binhex files, -@item -@file{mm-partial.el}, message/partial support for MIME messages, -@item -@file{rfc1843.el}, an HZ decoding package, -@item -@file{uudecode.el}, an Emacs Lisp decoder for uuencoded data, -@item -@file{webmail.el}, an interface to Web mail. -@end itemize - -@item -Ian T.@: Zimmerman wrote @file{gametree.el}. - -@item -Neal Ziring and Felix S.@: T.@: Wu wrote @file{vi.el}, an emulation of the -VI text editor. - -@item -Detlev Zundel wrote @file{re-builder.el}, a package for building regexps -with visual feedback. - -@end itemize - -Others too numerous to mention have reported and fixed bugs, and added -features to many parts of Emacs. (Many are mentioned in the -@file{ChangeLog} files which are summarized in the file @file{AUTHORS} -in the distribution.) We thank them for their generosity as well. - -This list intended to mention every contributor of a major package or -feature we currently distribute; if you know of someone we have omitted, -please report that as a manual bug. - -@ignore - arch-tag: bb1d0fa4-0240-4992-b5d4-8602d1e3d4ba -@end ignore diff --git a/man/arevert-xtra.texi b/man/arevert-xtra.texi deleted file mode 100644 index c2b1ddc2ffe..00000000000 --- a/man/arevert-xtra.texi +++ /dev/null @@ -1,191 +0,0 @@ -@c This is part of the Emacs manual. -@c Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. -@c See file emacs.texi for copying conditions. -@c -@c This file is included either in emacs-xtra.texi (when producing the -@c printed version) or in the main Emacs manual (for the on-line version). -@node Autorevert -@section Auto Reverting non-file Buffers - -Normally Global Auto Revert Mode only reverts file buffers. There are -two ways to auto-revert certain non-file buffers: enabling Auto Revert -Mode in those buffers (using @kbd{M-x auto-revert-mode}) and setting -@code{global-auto-revert-non-file-buffers} to @code{t}. The latter -enables Auto Reverting for all types of buffers for which it is -implemented, that is, for the types of buffers listed in the menu -below. - -Like file buffers, non-file buffers should normally not revert while -you are working on them, or while they contain information that might -get lost after reverting. Therefore, they do not revert if they are -``modified''. This can get tricky, because deciding when a non-file -buffer should be marked modified is usually more difficult than for -file buffers. - -Another tricky detail is that, for efficiency reasons, Auto Revert -often does not try to detect all possible changes in the buffer, only -changes that are ``major'' or easy to detect. Hence, enabling -auto-reverting for a non-file buffer does not always guarantee that -all information in the buffer is up to date and does not necessarily -make manual reverts useless. - -At the other extreme, certain buffers automatically auto-revert every -@code{auto-revert-interval} seconds. (This currently only applies to -the Buffer Menu.) In this case, Auto Revert does not print any -messages while reverting, even when @code{auto-revert-verbose} is -non-@code{nil}. - -The details depend on the particular types of buffers and are -explained in the corresponding sections. - -@menu -* Auto Reverting the Buffer Menu:: -* Auto Reverting Dired:: -* Supporting additional buffers:: -@end menu - -@node Auto Reverting the Buffer Menu -@subsection Auto Reverting the Buffer Menu - -If auto-reverting of non-file buffers is enabled, the Buffer Menu -automatically reverts every @code{auto-revert-interval} seconds, -whether there is a need for it or not. (It would probably take longer -to check whether there is a need than to actually revert.) - -If the Buffer Menu inappropriately gets marked modified, just revert -it manually using @kbd{g} and auto-reverting will resume. However, if -you marked certain buffers to get deleted or to be displayed, you have -to be careful, because reverting erases all marks. The fact that -adding marks sets the buffer's modified flag prevents Auto Revert from -automatically erasing the marks. - -@node Auto Reverting Dired -@subsection Auto Reverting Dired buffers - -Auto-reverting Dired buffers currently works on GNU or Unix style -operating systems. It may not work satisfactorily on some other -systems. - -Dired buffers only auto-revert when the file list of the buffer's main -directory changes. They do not auto-revert when information about a -particular file changes or when inserted subdirectories change. To be -sure that @emph{all} listed information is up to date, you have to -manually revert using @kbd{g}, @emph{even} if auto-reverting is -enabled in the Dired buffer. Sometimes, you might get the impression -that modifying or saving files listed in the main directory actually -does cause auto-reverting. This is because making changes to a file, -or saving it, very often causes changes in the directory itself, for -instance, through backup files or auto-save files. However, this is -not guaranteed. - -If the Dired buffer is marked modified and there are no changes you -want to protect, then most of the time you can make auto-reverting -resume by manually reverting the buffer using @kbd{g}. There is one -exception. If you flag or mark files, you can safely revert the -buffer. This will not erase the flags or marks (unless the marked -file has been deleted, of course). However, the buffer will stay -modified, even after reverting, and auto-reverting will not resume. -This is because, if you flag or mark files, you may be working on the -buffer and you might not want the buffer to change without warning. -If you want auto-reverting to resume in the presence of marks and -flags, mark the buffer non-modified using @kbd{M-~}. However, adding, -deleting or changing marks or flags will mark it modified again. - -Remote Dired buffers are not auto-reverted. Neither are Dired buffers -for which you used shell wildcards or file arguments to list only some -of the files. @samp{*Find*} and @samp{*Locate*} buffers do not -auto-revert either. - -@node Supporting additional buffers -@subsection Adding Support for Auto-Reverting additional Buffers. - -This section is intended for Elisp programmers who would like to add -support for auto-reverting new types of buffers. - -To support auto-reverting the buffer must first of all have a -@code{revert-buffer-function}. @xref{Definition of -revert-buffer-function,, Reverting, elisp, the Emacs Lisp Reference Manual}. - -In addition, it @emph{must} have a @code{buffer-stale-function}. - -@defvar buffer-stale-function -The value of this variable is a function to check whether a non-file -buffer needs reverting. This should be a function with one optional -argument @var{noconfirm}. The function should return non-@code{nil} -if the buffer should be reverted. The buffer is current when this -function is called. - -While this function is mainly intended for use in auto-reverting, it -could be used for other purposes as well. For instance, if -auto-reverting is not enabled, it could be used to warn the user that -the buffer needs reverting. The idea behind the @var{noconfirm} -argument is that it should be @code{t} if the buffer is going to be -reverted without asking the user and @code{nil} if the function is -just going to be used to warn the user that the buffer is out of date. -In particular, for use in auto-reverting, @var{noconfirm} is @code{t}. -If the function is only going to be used for auto-reverting, you can -ignore the @var{noconfirm} argument. - -If you just want to automatically auto-revert every -@code{auto-revert-interval} seconds, use: - -@example -(set (make-local-variable 'buffer-stale-function) - #'(lambda (&optional noconfirm) 'fast)) -@end example - -@noindent -in the buffer's mode function. - -The special return value @samp{fast} tells the caller that the need -for reverting was not checked, but that reverting the buffer is fast. -It also tells Auto Revert not to print any revert messages, even if -@code{auto-revert-verbose} is non-@code{nil}. This is important, as -getting revert messages every @code{auto-revert-interval} seconds can -be very annoying. The information provided by this return value could -also be useful if the function is consulted for purposes other than -auto-reverting. -@end defvar - -Once the buffer has a @code{revert-buffer-function} and a -@code{buffer-stale-function}, several problems usually remain. - -The buffer will only auto-revert if it is marked unmodified. Hence, -you will have to make sure that various functions mark the buffer -modified if and only if either the buffer contains information that -might be lost by reverting or there is reason to believe that the user -might be inconvenienced by auto-reverting, because he is actively -working on the buffer. The user can always override this by manually -adjusting the modified status of the buffer. To support this, calling -the @code{revert-buffer-function} on a buffer that is marked -unmodified should always keep the buffer marked unmodified. - -It is important to assure that point does not continuously jump around -as a consequence of auto-reverting. Of course, moving point might be -inevitable if the buffer radically changes. - -You should make sure that the @code{revert-buffer-function} does not -print messages that unnecessarily duplicate Auto Revert's own messages -if @code{auto-revert-verbose} is @code{t} and effectively override a -@code{nil} value for @code{auto-revert-verbose}. Hence, adapting a -mode for auto-reverting often involves getting rid of such messages. -This is especially important for buffers that automatically -auto-revert every @code{auto-revert-interval} seconds. - -Also, you may want to update the documentation string of -@code{global-auto-revert-non-file-buffers}. - -@ifinfo -Finally, you should add a node to this chapter's menu. This node -@end ifinfo -@ifnotinfo -Finally, you should add a section to this chapter. This section -@end ifnotinfo -should at the very least make clear whether enabling auto-reverting -for the buffer reliably assures that all information in the buffer is -completely up to date (or will be after @code{auto-revert-interval} -seconds). - -@ignore - arch-tag: 2983e613-a272-45f6-9593-3010ad7f865e -@end ignore diff --git a/man/buffers.texi b/man/buffers.texi deleted file mode 100644 index b43d72b1067..00000000000 --- a/man/buffers.texi +++ /dev/null @@ -1,665 +0,0 @@ -@c This is part of the Emacs manual. -@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001, -@c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. -@c See file emacs.texi for copying conditions. -@node Buffers, Windows, Files, Top -@chapter Using Multiple Buffers - -@cindex buffers - The text you are editing in Emacs resides in an object called a -@dfn{buffer}. Each time you visit a file, a buffer is created to hold the -file's text. Each time you invoke Dired, a buffer is created to hold the -directory listing. If you send a message with @kbd{C-x m}, a buffer named -@samp{*mail*} is used to hold the text of the message. When you ask for a -command's documentation, that appears in a buffer called @samp{*Help*}. - -@cindex selected buffer -@cindex current buffer - At any time, one and only one buffer is @dfn{current}. It is also -called the @dfn{selected buffer}. Often we say that a command operates on -``the buffer'' as if there were only one; but really this means that the -command operates on the current buffer (most commands do). - - When Emacs has multiple windows, each window has its own chosen -buffer and displays it; at any time, only one of the windows is -selected, and its chosen buffer is the current buffer. Each window's -mode line normally displays the name of the window's chosen buffer -(@pxref{Windows}). - - Each buffer has a name, which can be of any length, and you can select -any buffer by giving its name. Most buffers are made by visiting files, -and their names are derived from the files' names. But you can also create -an empty buffer with any name you want. A newly started Emacs has a buffer -named @samp{*scratch*} which can be used for evaluating Lisp expressions in -Emacs. The distinction between upper and lower case matters in buffer -names. - - Each buffer records individually what file it is visiting, whether it is -modified, and what major mode and minor modes are in effect in it -(@pxref{Major Modes}). Any Emacs variable can be made @dfn{local to} a -particular buffer, meaning its value in that buffer can be different from -the value in other buffers. @xref{Locals}. - -@cindex buffer size, maximum - A buffer's size cannot be larger than some maximum, which is defined -by the largest buffer position representable by the @dfn{Emacs integer} -data type. This is because Emacs tracks buffer positions using that -data type. For 32-bit machines, the largest buffer size is 256 -megabytes. - -@menu -* Select Buffer:: Creating a new buffer or reselecting an old one. -* List Buffers:: Getting a list of buffers that exist. -* Misc Buffer:: Renaming; changing read-onlyness; copying text. -* Kill Buffer:: Killing buffers you no longer need. -* Several Buffers:: How to go through the list of all buffers - and operate variously on several of them. -* Indirect Buffers:: An indirect buffer shares the text of another buffer. -* Buffer Convenience:: Convenience and customization features for - buffer handling. -@end menu - -@node Select Buffer -@section Creating and Selecting Buffers -@cindex change buffers -@cindex switch buffers - -@table @kbd -@item C-x b @var{buffer} @key{RET} -Select or create a buffer named @var{buffer} (@code{switch-to-buffer}). -@item C-x 4 b @var{buffer} @key{RET} -Similar, but select @var{buffer} in another window -(@code{switch-to-buffer-other-window}). -@item C-x 5 b @var{buffer} @key{RET} -Similar, but select @var{buffer} in a separate frame -(@code{switch-to-buffer-other-frame}). -@item C-x @key{LEFT} -Select the previous buffer in the list of existing buffers. -@item C-x @key{RIGHT} -Select the next buffer in the list of existing buffers. -@item C-u M-g M-g -@itemx C-u M-g g -Read a number @var{n} and move to line @var{n} in the most recently -selected buffer other than the current buffer. -@end table - -@kindex C-x b -@findex switch-to-buffer - To select the buffer named @var{bufname}, type @kbd{C-x b @var{bufname} -@key{RET}}. This runs the command @code{switch-to-buffer} with argument -@var{bufname}. You can use completion to enter the buffer -name (@pxref{Completion}). An empty argument to @kbd{C-x b} -specifies the buffer that was current most recently among those not -now displayed in any window. - -@kindex C-x @key{LEFT} -@kindex C-x @key{RIGHT} -@findex next-buffer -@findex previous-buffer - For conveniently switching between a few buffers, use the commands -@kbd{C-x @key{LEFT}} and @kbd{C-x @key{RIGHT}}. @kbd{C-x @key{RIGHT}} -(@code{previous-buffer}) selects the previous buffer (following the order -of most recent selection in the current frame), while @kbd{C-x @key{LEFT}} -(@code{next-buffer}) moves through buffers in the reverse direction. - -@kindex C-x 4 b -@findex switch-to-buffer-other-window -@vindex even-window-heights - To select a buffer in a window other than the current one, type -@kbd{C-x 4 b @var{bufname} @key{RET}}. This runs the command -@code{switch-to-buffer-other-window} which displays the buffer -@var{bufname} in another window. By default, if displaying the buffer -causes two vertically adjacent windows to be displayed, the heights of -those windows are evened out; to countermand that and preserve the -window configuration, set the variable @code{even-window-heights} to -@code{nil}. - -@kindex C-x 5 b -@findex switch-to-buffer-other-frame - Similarly, @kbd{C-x 5 b @var{buffer} @key{RET}} runs the command -@code{switch-to-buffer-other-frame} which selects a buffer in another -frame. - -@vindex display-buffer-reuse-frames - You can control how certain buffers are handled by these commands by -customizing the variables @code{special-display-buffer-names}, -@code{special-display-regexps}, @code{same-window-buffer-names}, and -@code{same-window-regexps}. See @ref{Force Same Window}, and -@ref{Special Buffer Frames}, for more about these variables. In -addition, if the value of @code{display-buffer-reuse-frames} is -non-@code{nil}, and the buffer you want to switch to is already -displayed in some frame, Emacs will just raise that frame. - - Most buffers are created by visiting files, or by Emacs commands that -want to display some text, but you can also create a buffer explicitly -by typing @kbd{C-x b @var{bufname} @key{RET}}. This makes a new, empty -buffer that is not visiting any file, and selects it for editing. Such -buffers are used for making notes to yourself. If you try to save one, -you are asked for the file name to use. The new buffer's major mode is -determined by the value of @code{default-major-mode} (@pxref{Major -Modes}). - - Note that @kbd{C-x C-f}, and any other command for visiting a file, -can also be used to switch to an existing file-visiting buffer. -@xref{Visiting}. - - @kbd{C-u M-g M-g}, that is @code{goto-line} with a prefix argument -of just @kbd{C-u}, reads a number @var{n} using the minibuffer, -selects the most recently selected buffer other than the current -buffer in another window, and then moves point to the beginning of -line number @var{n} in that buffer. This is mainly useful in a buffer -that refers to line numbers in another buffer: if point is on or just -after a number, @code{goto-line} uses that number as the default for -@var{n}. Note that prefix arguments other than just @kbd{C-u} behave -differently. @kbd{C-u 4 M-g M-g} goes to line 4 in the @emph{current} -buffer, without reading a number from the minibuffer. (Remember that -@kbd{M-g M-g} without prefix argument reads a number @var{n} and then -moves to line number @var{n} in the current buffer.) - - Emacs uses buffer names that start with a space for internal purposes. -It treats these buffers specially in minor ways---for example, by -default they do not record undo information. It is best to avoid using -such buffer names yourself. - -@node List Buffers -@section Listing Existing Buffers - -@table @kbd -@item C-x C-b -List the existing buffers (@code{list-buffers}). -@end table - -@cindex listing current buffers -@kindex C-x C-b -@findex list-buffers - To display a list of existing buffers, type @kbd{C-x C-b}. Each -line in the list shows one buffer's name, major mode and visited file. -The buffers are listed in the order that they were current; the -buffers that were current most recently come first. - - @samp{*} in the first field of a line indicates the buffer is -``modified.'' If several buffers are modified, it may be time to save -some with @kbd{C-x s} (@pxref{Save Commands}). @samp{%} indicates a -read-only buffer. @samp{.} marks the current buffer. Here is an -example of a buffer list:@refill - -@smallexample -CRM Buffer Size Mode File -. * .emacs 3294 Emacs-Lisp ~/.emacs - % *Help* 101 Help - search.c 86055 C ~/cvs/emacs/src/search.c - % src 20959 Dired by name ~/cvs/emacs/src/ - * *mail* 42 Mail - % HELLO 1607 Fundamental ~/cvs/emacs/etc/HELLO - % NEWS 481184 Outline ~/cvs/emacs/etc/NEWS - *scratch* 191 Lisp Interaction - * *Messages* 1554 Fundamental -@end smallexample - -@noindent -Note that the buffer @samp{*Help*} was made by a help request; it is -not visiting any file. The buffer @code{src} was made by Dired on the -directory @file{~/cvs/emacs/src/}. You can list only buffers that are -visiting files by giving the command a prefix argument, as in -@kbd{C-u C-x C-b}. - - @code{list-buffers} omits buffers whose names begin with a space, -unless they visit files: such buffers are used internally by Emacs. - -@need 2000 -@node Misc Buffer -@section Miscellaneous Buffer Operations - -@table @kbd -@item C-x C-q -Toggle read-only status of buffer (@code{toggle-read-only}). -@item M-x rename-buffer @key{RET} @var{name} @key{RET} -Change the name of the current buffer. -@item M-x rename-uniquely -Rename the current buffer by adding @samp{<@var{number}>} to the end. -@item M-x view-buffer @key{RET} @var{buffer} @key{RET} -Scroll through buffer @var{buffer}. -@end table - -@kindex C-x C-q -@vindex buffer-read-only -@cindex read-only buffer - A buffer can be @dfn{read-only}, which means that commands to change -its contents are not allowed. The mode line indicates read-only -buffers with @samp{%%} or @samp{%*} near the left margin. Read-only -buffers are usually made by subsystems such as Dired and Rmail that -have special commands to operate on the text; also by visiting a file -whose access control says you cannot write it. - -@findex toggle-read-only - If you wish to make changes in a read-only buffer, use the command -@kbd{C-x C-q} (@code{toggle-read-only}). It makes a read-only buffer -writable, and makes a writable buffer read-only. This -works by setting the variable @code{buffer-read-only}, which has a local -value in each buffer and makes the buffer read-only if its value is -non-@code{nil}. If you have files under version control, you may find -it convenient to bind @kbd{C-x C-q} to @code{vc-toggle-read-only} -instead. Then, typing @kbd{C-x C-q} not only changes the read-only -flag, but it also checks the file in or out. @xref{Version -Control}. - -@findex rename-buffer - @kbd{M-x rename-buffer} changes the name of the current buffer. You -specify the new name as a minibuffer argument; there is no default. -If you specify a name that is in use for some other buffer, an error -happens and no renaming is done. - -@findex rename-uniquely - @kbd{M-x rename-uniquely} renames the current buffer to a similar -name with a numeric suffix added to make it both different and unique. -This command does not need an argument. It is useful for creating -multiple shell buffers: if you rename the @samp{*shell*} buffer, then -do @kbd{M-x shell} again, it makes a new shell buffer named -@samp{*shell*}; meanwhile, the old shell buffer continues to exist -under its new name. This method is also good for mail buffers, -compilation buffers, and most Emacs features that create special -buffers with particular names. (With some of these features, such as -@kbd{M-x compile}, @kbd{M-x grep} an @kbd{M-x info}, you need to -switch to some other buffer before using the command, in order for it -to make a different buffer.) - -@findex view-buffer - @kbd{M-x view-buffer} is much like @kbd{M-x view-file} (@pxref{Misc -File Ops}) except that it examines an already existing Emacs buffer. -View mode provides commands for scrolling through the buffer -conveniently but not for changing it. When you exit View mode with -@kbd{q}, that switches back to the buffer (and the position) which was -previously displayed in the window. Alternatively, if you exit View -mode with @kbd{e}, the buffer and the value of point that resulted from -your perusal remain in effect. - - The commands @kbd{M-x append-to-buffer} and @kbd{M-x insert-buffer} -can be used to copy text from one buffer to another. @xref{Accumulating -Text}. - -@node Kill Buffer -@section Killing Buffers - -@cindex killing buffers - If you continue an Emacs session for a while, you may accumulate a -large number of buffers. You may then find it convenient to @dfn{kill} -the buffers you no longer need. On most operating systems, killing a -buffer releases its space back to the operating system so that other -programs can use it. Here are some commands for killing buffers: - -@table @kbd -@item C-x k @var{bufname} @key{RET} -Kill buffer @var{bufname} (@code{kill-buffer}). -@item M-x kill-some-buffers -Offer to kill each buffer, one by one. -@end table - -@findex kill-buffer -@findex kill-some-buffers -@kindex C-x k - - @kbd{C-x k} (@code{kill-buffer}) kills one buffer, whose name you -specify in the minibuffer. The default, used if you type just -@key{RET} in the minibuffer, is to kill the current buffer. If you -kill the current buffer, another buffer becomes current: one that was -current in the recent past but is not displayed in any window now. If -you ask to kill a file-visiting buffer that is modified (has unsaved -editing), then you must confirm with @kbd{yes} before the buffer is -killed. - - The command @kbd{M-x kill-some-buffers} asks about each buffer, one by -one. An answer of @kbd{y} means to kill the buffer. Killing the current -buffer or a buffer containing unsaved changes selects a new buffer or asks -for confirmation just like @code{kill-buffer}. - - The buffer menu feature (@pxref{Several Buffers}) is also convenient -for killing various buffers. - -@vindex kill-buffer-hook - If you want to do something special every time a buffer is killed, you -can add hook functions to the hook @code{kill-buffer-hook} (@pxref{Hooks}). - -@findex clean-buffer-list - If you run one Emacs session for a period of days, as many people do, -it can fill up with buffers that you used several days ago. The command -@kbd{M-x clean-buffer-list} is a convenient way to purge them; it kills -all the unmodified buffers that you have not used for a long time. An -ordinary buffer is killed if it has not been displayed for three days; -however, you can specify certain buffers that should never be killed -automatically, and others that should be killed if they have been unused -for a mere hour. - -@cindex Midnight mode -@vindex midnight-mode -@vindex midnight-hook - You can also have this buffer purging done for you, every day at -midnight, by enabling Midnight mode. Midnight mode operates each day at -midnight; at that time, it runs @code{clean-buffer-list}, or whichever -functions you have placed in the normal hook @code{midnight-hook} -(@pxref{Hooks}). - - To enable Midnight mode, use the Customization buffer to set the -variable @code{midnight-mode} to @code{t}. @xref{Easy Customization}. - -@node Several Buffers -@section Operating on Several Buffers -@cindex buffer menu - - The @dfn{buffer-menu} facility is like a ``Dired for buffers''; it allows -you to request operations on various Emacs buffers by editing an Emacs -buffer containing a list of them. You can save buffers, kill them -(here called @dfn{deleting} them, for consistency with Dired), or display -them. - -@table @kbd -@item M-x buffer-menu -Begin editing a buffer listing all Emacs buffers. -@item M-x buffer-menu-other-window. -Similar, but do it in another window. -@end table - -@findex buffer-menu -@findex buffer-menu-other-window - The command @code{buffer-menu} writes a list of all Emacs -buffers@footnote{Buffers which don't visit files and whose names begin -with a space are omitted: these are used internally by Emacs.} into the -buffer @samp{*Buffer List*}, and selects that buffer in Buffer Menu -mode. - - The buffer is read-only, and can be -changed only through the special commands described in this section. -The usual Emacs cursor motion commands can be used in the @samp{*Buffer -List*} buffer. The following commands apply to the buffer described on -the current line. - -@table @kbd -@item d -Request to delete (kill) the buffer, then move down. The request -shows as a @samp{D} on the line, before the buffer name. Requested -deletions take place when you type the @kbd{x} command. -@item C-d -Like @kbd{d} but move up afterwards instead of down. -@item s -Request to save the buffer. The request shows as an @samp{S} on the -line. Requested saves take place when you type the @kbd{x} command. -You may request both saving and deletion for the same buffer. -@item x -Perform previously requested deletions and saves. -@item u -Remove any request made for the current line, and move down. -@item @key{DEL} -Move to previous line and remove any request made for that line. -@end table - - The @kbd{d}, @kbd{C-d}, @kbd{s} and @kbd{u} commands to add or remove -flags also move down (or up) one line. They accept a numeric argument -as a repeat count. - - These commands operate immediately on the buffer listed on the current -line: - -@table @kbd -@item ~ -Mark the buffer ``unmodified.'' The command @kbd{~} does this -immediately when you type it. -@item % -Toggle the buffer's read-only flag. The command @kbd{%} does -this immediately when you type it. -@item t -Visit the buffer as a tags table. @xref{Select Tags Table}. -@end table - - There are also commands to select another buffer or buffers: - -@table @kbd -@item q -Quit the buffer menu---immediately display the most recent formerly -visible buffer in its place. -@item @key{RET} -@itemx f -Immediately select this line's buffer in place of the @samp{*Buffer -List*} buffer. -@item o -Immediately select this line's buffer in another window as if by -@kbd{C-x 4 b}, leaving @samp{*Buffer List*} visible. -@item C-o -Immediately display this line's buffer in another window, but don't -select the window. -@item 1 -Immediately select this line's buffer in a full-screen window. -@item 2 -Immediately set up two windows, with this line's buffer selected in -one, and the previously current buffer (aside from the buffer -@samp{*Buffer List*}) displayed in the other. -@item b -Bury the buffer listed on this line. -@item m -Mark this line's buffer to be displayed in another window if you exit -with the @kbd{v} command. The request shows as a @samp{>} at the -beginning of the line. (A single buffer may not have both a delete -request and a display request.) -@item v -Immediately select this line's buffer, and also display in other windows -any buffers previously marked with the @kbd{m} command. If you have not -marked any buffers, this command is equivalent to @kbd{1}. -@end table - - There is also a command that affects the entire buffer list: - -@table @kbd -@item T -Delete, or reinsert, lines for non-file buffers. This command toggles -the inclusion of such buffers in the buffer list. -@end table - - What @code{buffer-menu} actually does is create and switch to a -suitable buffer, and turn on Buffer Menu mode in it. Everything else -described above is implemented by the special commands provided in -Buffer Menu mode. One consequence of this is that you can switch from -the @samp{*Buffer List*} buffer to another Emacs buffer, and edit -there. You can reselect the @samp{*Buffer List*} buffer later, to -perform the operations already requested, or you can kill it, or pay -no further attention to it. - - The list in the @samp{*Buffer List*} buffer looks exactly like the -buffer list described in @ref{List Buffers}, because they really are -the same. The only difference between @code{buffer-menu} and -@code{list-buffers} is that @code{buffer-menu} switches to the -@samp{*Buffer List*} buffer in the selected window; -@code{list-buffers} displays the same buffer in another window. If -you run @code{list-buffers} (that is, type @kbd{C-x C-b}) and select -the buffer list manually, you can use all of the commands described -here. - - Normally, the buffer @samp{*Buffer List*} is not updated -automatically when buffers are created and killed; its contents are -just text. If you have created, deleted or renamed buffers, the way -to update @samp{*Buffer List*} to show what you have done is to type -@kbd{g} (@code{revert-buffer}). You can make this happen regularly -every @code{auto-revert-interval} seconds if you enable Auto Revert -mode in this buffer, as long as it is not marked modified. Global -Auto Revert mode applies to the @samp{*Buffer List*} buffer only if -@code{global-auto-revert-non-file-buffers} is non-@code{nil}. -@iftex -@inforef{Autorevert,, emacs-xtra}, for details. -@end iftex -@ifnottex -@xref{Autorevert, global-auto-revert-non-file-buffers}, for details. -@end ifnottex - - - The command @code{buffer-menu-other-window} works the same as -@code{buffer-menu}, except that it displays the buffers list in -another window. - -@node Indirect Buffers -@section Indirect Buffers -@cindex indirect buffer -@cindex base buffer - - An @dfn{indirect buffer} shares the text of some other buffer, which -is called the @dfn{base buffer} of the indirect buffer. In some ways it -is the analogue, for buffers, of a symbolic link between files. - -@table @kbd -@findex make-indirect-buffer -@item M-x make-indirect-buffer @key{RET} @var{base-buffer} @key{RET} @var{indirect-name} @key{RET} -Create an indirect buffer named @var{indirect-name} whose base buffer -is @var{base-buffer}. -@findex clone-indirect-buffer -@item M-x clone-indirect-buffer @key{RET} -Create an indirect buffer that is a twin copy of the current buffer. -@item C-x 4 c -@kindex C-x 4 c -@findex clone-indirect-buffer-other-window -Create an indirect buffer that is a twin copy of the current buffer, and -select it in another window (@code{clone-indirect-buffer-other-window}). -@end table - - The text of the indirect buffer is always identical to the text of its -base buffer; changes made by editing either one are visible immediately -in the other. But in all other respects, the indirect buffer and its -base buffer are completely separate. They have different names, -different values of point, different narrowing, different markers, -different major modes, and different local variables. - - An indirect buffer cannot visit a file, but its base buffer can. If -you try to save the indirect buffer, that actually works by saving the -base buffer. Killing the base buffer effectively kills the indirect -buffer, but killing an indirect buffer has no effect on its base buffer. - - One way to use indirect buffers is to display multiple views of an -outline. @xref{Outline Views}. - - A quick and handy way to make an indirect buffer is with the command -@kbd{M-x clone-indirect-buffer}. It creates and selects an indirect -buffer whose base buffer is the current buffer. With a numeric -argument, it prompts for the name of the indirect buffer; otherwise it -uses the name of the current buffer, with a @samp{<@var{n}>} suffix -added. @kbd{C-x 4 c} (@code{clone-indirect-buffer-other-window}) -works like @kbd{M-x clone-indirect-buffer}, but it selects the new -buffer in another window. - - The more general way to make an indirect buffer is with the command -@kbd{M-x make-indirect-buffer}. It creates an indirect buffer from -buffer @var{base-buffer}, under the name @var{indirect-name}. It -prompts for both @var{base-buffer} and @var{indirect-name} using the -minibuffer. - -@node Buffer Convenience -@section Convenience Features and Customization of Buffer Handling - - This section describes several modes and features that make it more -convenient to switch between buffers. - -@menu -* Uniquify:: Making buffer names unique with directory parts. -* Iswitchb:: Switching between buffers with substrings. -* Buffer Menus:: Configurable buffer menu. -@end menu - -@node Uniquify -@subsection Making Buffer Names Unique - -@cindex unique buffer names -@cindex directories in buffer names - When several buffers visit identically-named files, Emacs must give -the buffers distinct names. The usual method for making buffer names -unique adds @samp{<2>}, @samp{<3>}, etc. to the end of the buffer -names (all but one of them). - -@vindex uniquify-buffer-name-style - Other methods work by adding parts of each file's directory to the -buffer name. To select one, customize the variable -@code{uniquify-buffer-name-style} (@pxref{Easy Customization}). - - To begin with, the @code{forward} naming method includes part of the -file's directory name at the beginning of the buffer name; using this -method, buffers visiting the files @file{/u/rms/tmp/Makefile} and -@file{/usr/projects/zaphod/Makefile} would be named -@samp{tmp/Makefile} and @samp{zaphod/Makefile}, respectively (instead -of @samp{Makefile} and @samp{Makefile<2>}). - - In contrast, the @code{post-forward} naming method would call the -buffers @samp{Makefile|tmp} and @samp{Makefile|zaphod}, and the -@code{reverse} naming method would call them @samp{Makefile\tmp} and -@samp{Makefile\zaphod}. The nontrivial difference between -@code{post-forward} and @code{reverse} occurs when just one directory -name is not enough to distinguish two files; then @code{reverse} puts -the directory names in reverse order, so that @file{/top/middle/file} -becomes @samp{file\middle\top}, while @code{post-forward} puts them in -forward order after the file name, as in @samp{file|top/middle}. - - Which rule to follow for putting the directory names in the buffer -name is not very important if you are going to @emph{look} at the -buffer names before you type one. But as an experienced user, if you -know the rule, you won't have to look. And then you may find that one -rule or another is easier for you to remember and apply quickly. - -@node Iswitchb -@subsection Switching Between Buffers using Substrings - -@findex iswitchb-mode -@cindex Iswitchb mode -@cindex mode, Iswitchb -@kindex C-x b @r{(Iswitchb mode)} -@kindex C-x 4 b @r{(Iswitchb mode)} -@kindex C-x 5 b @r{(Iswitchb mode)} -@kindex C-x 4 C-o @r{(Iswitchb mode)} - - Iswitchb global minor mode provides convenient switching between -buffers using substrings of their names. It replaces the normal -definitions of @kbd{C-x b}, @kbd{C-x 4 b}, @kbd{C-x 5 b}, and @kbd{C-x -4 C-o} with alternative commands that are somewhat ``smarter.'' - - When one of these commands prompts you for a buffer name, you can -type in just a substring of the name you want to choose. As you enter -the substring, Iswitchb mode continuously displays a list of buffers -that match the substring you have typed. - - At any time, you can type @key{RET} to select the first buffer in -the list. So the way to select a particular buffer is to make it the -first in the list. There are two ways to do this. You can type more -of the buffer name and thus narrow down the list, excluding unwanted -buffers above the desired one. Alternatively, you can use @kbd{C-s} -and @kbd{C-r} to rotate the list until the desired buffer is first. - - @key{TAB} while entering the buffer name performs completion on the -string you have entered, based on the displayed list of buffers. - - To enable Iswitchb mode, type @kbd{M-x iswitchb-mode}, or customize -the variable @code{iswitchb-mode} to @code{t} (@pxref{Easy -Customization}). - -@node Buffer Menus -@subsection Customizing Buffer Menus - -@findex bs-show -@cindex buffer list, customizable -@table @kbd -@item M-x bs-show -Make a list of buffers similarly to @kbd{M-x list-buffers} but -customizable. -@end table - - @kbd{M-x bs-show} pops up a buffer list similar to the one normally -displayed by @kbd{C-x C-b} but which you can customize. If you prefer -this to the usual buffer list, you can bind this command to @kbd{C-x -C-b}. To customize this buffer list, use the @code{bs} Custom group -(@pxref{Easy Customization}). - -@findex msb-mode -@cindex mode, MSB -@cindex MSB mode -@cindex buffer menu -@findex mouse-buffer-menu -@kindex C-Down-Mouse-1 - MSB global minor mode (``MSB'' stands for ``mouse select buffer'') -provides a different and customizable mouse buffer menu which you may -prefer. It replaces the bindings of @code{mouse-buffer-menu}, -normally on @kbd{C-Down-Mouse-1}, and the menu bar buffer menu. You -can customize the menu in the @code{msb} Custom group. - -@ignore - arch-tag: 08c43460-f4f4-4b43-9cb5-1ea9ad991695 -@end ignore diff --git a/man/cal-xtra.texi b/man/cal-xtra.texi deleted file mode 100644 index 61d519cbd12..00000000000 --- a/man/cal-xtra.texi +++ /dev/null @@ -1,838 +0,0 @@ -@c This is part of the Emacs manual. -@c Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. -@c See file emacs.texi for copying conditions. -@c -@c This file is included either in emacs-xtra.texi (when producing the -@c printed version) or in the main Emacs manual (for the on-line version). - -@c Moved here from the Emacs Lisp Reference Manual, 2005-03-26. -@node Advanced Calendar/Diary Usage -@section Customizing the Calendar and Diary - - There are many customizations that you can use to make the calendar and -diary suit your personal tastes. - -@menu -* Calendar Customizing:: Defaults you can set. -* Holiday Customizing:: Defining your own holidays. -* Date Display Format:: Changing the format. -* Time Display Format:: Changing the format. -* Diary Customizing:: Defaults you can set. -* Hebrew/Islamic Entries:: How to obtain them. -* Fancy Diary Display:: Enhancing the diary display, sorting entries, - using included diary files. -* Sexp Diary Entries:: Fancy things you can do. -@end menu - -@node Calendar Customizing -@subsection Customizing the Calendar -@vindex calendar-holiday-marker -@vindex diary-entry-marker - The variable @code{calendar-holiday-marker} specifies how to mark a -date as being a holiday. Its value may be a single-character string -to insert next to the date, or a face name to use for displaying the -date. Likewise, the variable @code{diary-entry-marker} specifies how -to mark a date that has diary entries. The calendar creates faces -named @code{holiday-face} and @code{diary-face} for these purposes; -those symbols are the default values of these variables. - -@vindex calendar-load-hook - The variable @code{calendar-load-hook} is a normal hook run when the -calendar package is first loaded (before actually starting to display -the calendar). - -@vindex initial-calendar-window-hook - Starting the calendar runs the normal hook -@code{initial-calendar-window-hook}. Recomputation of the calendar -display does not run this hook. But if you leave the calendar with the -@kbd{q} command and reenter it, the hook runs again.@refill - -@vindex today-visible-calendar-hook - The variable @code{today-visible-calendar-hook} is a normal hook run -after the calendar buffer has been prepared with the calendar when the -current date is visible in the window. One use of this hook is to -replace today's date with asterisks; to do that, use the hook function -@code{calendar-star-date}. - -@findex calendar-star-date -@example -(add-hook 'today-visible-calendar-hook 'calendar-star-date) -@end example - -@noindent -Another standard hook function marks the current date, either by -changing its face or by adding an asterisk. Here's how to use it: - -@findex calendar-mark-today -@example -(add-hook 'today-visible-calendar-hook 'calendar-mark-today) -@end example - -@noindent -@vindex calendar-today-marker -The variable @code{calendar-today-marker} specifies how to mark -today's date. Its value should be a single-character string to insert -next to the date or a face name to use for displaying the date. A -face named @code{calendar-today-face} is provided for this purpose; -that symbol is the default for this variable. - -@vindex today-invisible-calendar-hook -@noindent - A similar normal hook, @code{today-invisible-calendar-hook} is run if -the current date is @emph{not} visible in the window. - -@vindex calendar-move-hook - Each of the calendar cursor motion commands runs the hook -@code{calendar-move-hook} after it moves the cursor. - -@node Holiday Customizing -@subsection Customizing the Holidays - -@vindex calendar-holidays -@vindex christian-holidays -@vindex hebrew-holidays -@vindex islamic-holidays - Emacs knows about holidays defined by entries on one of several lists. -You can customize these lists of holidays to your own needs, adding or -deleting holidays. The lists of holidays that Emacs uses are for -general holidays (@code{general-holidays}), local holidays -(@code{local-holidays}), Christian holidays (@code{christian-holidays}), -Hebrew (Jewish) holidays (@code{hebrew-holidays}), Islamic (Muslim) -holidays (@code{islamic-holidays}), and other holidays -(@code{other-holidays}). - -@vindex general-holidays - The general holidays are, by default, holidays common throughout the -United States. To eliminate these holidays, set @code{general-holidays} -to @code{nil}. - -@vindex local-holidays - There are no default local holidays (but sites may supply some). You -can set the variable @code{local-holidays} to any list of holidays, as -described below. - -@vindex all-christian-calendar-holidays -@vindex all-hebrew-calendar-holidays -@vindex all-islamic-calendar-holidays - By default, Emacs does not include all the holidays of the religions -that it knows, only those commonly found in secular calendars. For a -more extensive collection of religious holidays, you can set any (or -all) of the variables @code{all-christian-calendar-holidays}, -@code{all-hebrew-calendar-holidays}, or -@code{all-islamic-calendar-holidays} to @code{t}. If you want to -eliminate the religious holidays, set any or all of the corresponding -variables @code{christian-holidays}, @code{hebrew-holidays}, and -@code{islamic-holidays} to @code{nil}.@refill - -@vindex other-holidays - You can set the variable @code{other-holidays} to any list of -holidays. This list, normally empty, is intended for individual use. - -@cindex holiday forms - Each of the lists (@code{general-holidays}, @code{local-holidays}, -@code{christian-holidays}, @code{hebrew-holidays}, -@code{islamic-holidays}, and @code{other-holidays}) is a list of -@dfn{holiday forms}, each holiday form describing a holiday (or -sometimes a list of holidays). - - Here is a table of the possible kinds of holiday form. Day numbers -and month numbers count starting from 1, but ``dayname'' numbers -count Sunday as 0. The element @var{string} is always the -name of the holiday, as a string. - -@table @code -@item (holiday-fixed @var{month} @var{day} @var{string}) -A fixed date on the Gregorian calendar. - -@item (holiday-float @var{month} @var{dayname} @var{k} @var{string}) -The @var{k}th @var{dayname} in @var{month} on the Gregorian calendar -(@var{dayname}=0 for Sunday, and so on); negative @var{k} means count back -from the end of the month. - -@item (holiday-hebrew @var{month} @var{day} @var{string}) -A fixed date on the Hebrew calendar. - -@item (holiday-islamic @var{month} @var{day} @var{string}) -A fixed date on the Islamic calendar. - -@item (holiday-julian @var{month} @var{day} @var{string}) -A fixed date on the Julian calendar. - -@item (holiday-sexp @var{sexp} @var{string}) -A date calculated by the Lisp expression @var{sexp}. The expression -should use the variable @code{year} to compute and return the date of a -holiday, or @code{nil} if the holiday doesn't happen this year. The -value of @var{sexp} must represent the date as a list of the form -@code{(@var{month} @var{day} @var{year})}. - -@item (if @var{condition} @var{holiday-form}) -A holiday that happens only if @var{condition} is true. - -@item (@var{function} @r{[}@var{args}@r{]}) -A list of dates calculated by the function @var{function}, called with -arguments @var{args}. -@end table - - For example, suppose you want to add Bastille Day, celebrated in -France on July 14. You can do this as follows: - -@smallexample -(setq other-holidays '((holiday-fixed 7 14 "Bastille Day"))) -@end smallexample - -@noindent -The holiday form @code{(holiday-fixed 7 14 "Bastille Day")} specifies the -fourteenth day of the seventh month (July). - - Many holidays occur on a specific day of the week, at a specific time -of month. Here is a holiday form describing Hurricane Supplication Day, -celebrated in the Virgin Islands on the fourth Monday in August: - -@smallexample -(holiday-float 8 1 4 "Hurricane Supplication Day") -@end smallexample - -@noindent -Here the 8 specifies August, the 1 specifies Monday (Sunday is 0, -Tuesday is 2, and so on), and the 4 specifies the fourth occurrence in -the month (1 specifies the first occurrence, 2 the second occurrence, -@minus{}1 the last occurrence, @minus{}2 the second-to-last occurrence, and -so on). - - You can specify holidays that occur on fixed days of the Hebrew, -Islamic, and Julian calendars too. For example, - -@smallexample -(setq other-holidays - '((holiday-hebrew 10 2 "Last day of Hanukkah") - (holiday-islamic 3 12 "Mohammed's Birthday") - (holiday-julian 4 2 "Jefferson's Birthday"))) -@end smallexample - -@noindent -adds the last day of Hanukkah (since the Hebrew months are numbered with -1 starting from Nisan), the Islamic feast celebrating Mohammed's -birthday (since the Islamic months are numbered from 1 starting with -Muharram), and Thomas Jefferson's birthday, which is 2 April 1743 on the -Julian calendar. - - To include a holiday conditionally, use either Emacs Lisp's @code{if} or the -@code{holiday-sexp} form. For example, American presidential elections -occur on the first Tuesday after the first Monday in November of years -divisible by 4: - -@smallexample -(holiday-sexp '(if (= 0 (% year 4)) - (calendar-gregorian-from-absolute - (1+ (calendar-dayname-on-or-before - 1 (+ 6 (calendar-absolute-from-gregorian - (list 11 1 year))))))) - "US Presidential Election") -@end smallexample - -@noindent -or - -@smallexample -(if (= 0 (% displayed-year 4)) - (fixed 11 - (extract-calendar-day - (calendar-gregorian-from-absolute - (1+ (calendar-dayname-on-or-before - 1 (+ 6 (calendar-absolute-from-gregorian - (list 11 1 displayed-year))))))) - "US Presidential Election")) -@end smallexample - - Some holidays just don't fit into any of these forms because special -calculations are involved in their determination. In such cases you -must write a Lisp function to do the calculation. To include eclipses, -for example, add @code{(eclipses)} to @code{other-holidays} -and write an Emacs Lisp function @code{eclipses} that returns a -(possibly empty) list of the relevant Gregorian dates among the range -visible in the calendar window, with descriptive strings, like this: - -@smallexample -(((6 27 1991) "Lunar Eclipse") ((7 11 1991) "Solar Eclipse") ... ) -@end smallexample - -@node Date Display Format -@subsection Date Display Format -@vindex calendar-date-display-form - - You can customize the manner of displaying dates in the diary, in mode -lines, and in messages by setting @code{calendar-date-display-form}. -This variable holds a list of expressions that can involve the variables -@code{month}, @code{day}, and @code{year}, which are all numbers in -string form, and @code{monthname} and @code{dayname}, which are both -alphabetic strings. In the American style, the default value of this -list is as follows: - -@smallexample -((if dayname (concat dayname ", ")) monthname " " day ", " year) -@end smallexample - -@noindent -while in the European style this value is the default: - -@smallexample -((if dayname (concat dayname ", ")) day " " monthname " " year) -@end smallexample - -@noindent -The ISO standard date representation is this: - -@smallexample -(year "-" month "-" day) -@end smallexample - -@noindent -This specifies a typical American format: - -@smallexample -(month "/" day "/" (substring year -2)) -@end smallexample - -@node Time Display Format -@subsection Time Display Format -@vindex calendar-time-display-form - - The calendar and diary by default display times of day in the -conventional American style with the hours from 1 through 12, minutes, -and either @samp{am} or @samp{pm}. If you prefer the European style, -also known in the US as military, in which the hours go from 00 to 23, -you can alter the variable @code{calendar-time-display-form}. This -variable is a list of expressions that can involve the variables -@code{12-hours}, @code{24-hours}, and @code{minutes}, which are all -numbers in string form, and @code{am-pm} and @code{time-zone}, which are -both alphabetic strings. The default value of -@code{calendar-time-display-form} is as follows: - -@smallexample -(12-hours ":" minutes am-pm - (if time-zone " (") time-zone (if time-zone ")")) -@end smallexample - -@noindent -Here is a value that provides European style times: - -@smallexample -(24-hours ":" minutes - (if time-zone " (") time-zone (if time-zone ")")) -@end smallexample - -@node Diary Customizing -@subsection Customizing the Diary - -@vindex holidays-in-diary-buffer - Ordinarily, the mode line of the diary buffer window indicates any -holidays that fall on the date of the diary entries. The process of -checking for holidays can take several seconds, so including holiday -information delays the display of the diary buffer noticeably. If you'd -prefer to have a faster display of the diary buffer but without the -holiday information, set the variable @code{holidays-in-diary-buffer} to -@code{nil}.@refill - -@vindex number-of-diary-entries - The variable @code{number-of-diary-entries} controls the number of -days of diary entries to be displayed at one time. It affects the -initial display when @code{view-diary-entries-initially} is @code{t}, as -well as the command @kbd{M-x diary}. For example, the default value is -1, which says to display only the current day's diary entries. If the -value is 2, both the current day's and the next day's entries are -displayed. The value can also be a vector of seven elements: for -example, if the value is @code{[0 2 2 2 2 4 1]} then no diary entries -appear on Sunday, the current date's and the next day's diary entries -appear Monday through Thursday, Friday through Monday's entries appear -on Friday, while on Saturday only that day's entries appear. - -@vindex print-diary-entries-hook -@findex print-diary-entries - The variable @code{print-diary-entries-hook} is a normal hook run -after preparation of a temporary buffer containing just the diary -entries currently visible in the diary buffer. (The other, irrelevant -diary entries are really absent from the temporary buffer; in the diary -buffer, they are merely hidden.) The default value of this hook does -the printing with the command @code{lpr-buffer}. If you want to use a -different command to do the printing, just change the value of this -hook. Other uses might include, for example, rearranging the lines into -order by day and time. - -@vindex diary-date-forms - You can customize the form of dates in your diary file, if neither the -standard American nor European styles suits your needs, by setting the -variable @code{diary-date-forms}. This variable is a list of patterns -for recognizing a date. Each date pattern is a list whose elements may -be regular expressions (@pxref{Regular Expressions,,, elisp, the Emacs -Lisp Reference Manual}) or the symbols @code{month}, @code{day}, -@code{year}, @code{monthname}, and @code{dayname}. All these elements -serve as patterns that match certain kinds of text in the diary file. -In order for the date pattern, as a whole, to match, all of its elements -must match consecutively. - - A regular expression in a date pattern matches in its usual fashion, -using the standard syntax table altered so that @samp{*} is a word -constituent. - - The symbols @code{month}, @code{day}, @code{year}, @code{monthname}, -and @code{dayname} match the month number, day number, year number, -month name, and day name of the date being considered. The symbols that -match numbers allow leading zeros; those that match names allow -three-letter abbreviations and capitalization. All the symbols can -match @samp{*}; since @samp{*} in a diary entry means ``any day'', ``any -month'', and so on, it should match regardless of the date being -considered. - - The default value of @code{diary-date-forms} in the American style is -this: - -@example -((month "/" day "[^/0-9]") - (month "/" day "/" year "[^0-9]") - (monthname " *" day "[^,0-9]") - (monthname " *" day ", *" year "[^0-9]") - (dayname "\\W")) -@end example - - The date patterns in the list must be @emph{mutually exclusive} and -must not match any portion of the diary entry itself, just the date and -one character of whitespace. If, to be mutually exclusive, the pattern -must match a portion of the diary entry text---beyond the whitespace -that ends the date---then the first element of the date pattern -@emph{must} be @code{backup}. This causes the date recognizer to back -up to the beginning of the current word of the diary entry, after -finishing the match. Even if you use @code{backup}, the date pattern -must absolutely not match more than a portion of the first word of the -diary entry. The default value of @code{diary-date-forms} in the -European style is this list: - -@example -((day "/" month "[^/0-9]") - (day "/" month "/" year "[^0-9]") - (backup day " *" monthname "\\W+\\<[^*0-9]") - (day " *" monthname " *" year "[^0-9]") - (dayname "\\W")) -@end example - -@noindent -Notice the use of @code{backup} in the third pattern, because it needs -to match part of a word beyond the date itself to distinguish it from -the fourth pattern. - -@node Hebrew/Islamic Entries -@subsection Hebrew- and Islamic-Date Diary Entries - - Your diary file can have entries based on Hebrew or Islamic dates, as -well as entries based on the world-standard Gregorian calendar. -However, because recognition of such entries is time-consuming and most -people don't use them, you must explicitly enable their use. If you -want the diary to recognize Hebrew-date diary entries, for example, -you must do this: - -@vindex nongregorian-diary-listing-hook -@vindex nongregorian-diary-marking-hook -@findex list-hebrew-diary-entries -@findex mark-hebrew-diary-entries -@smallexample -(add-hook 'nongregorian-diary-listing-hook 'list-hebrew-diary-entries) -(add-hook 'nongregorian-diary-marking-hook 'mark-hebrew-diary-entries) -@end smallexample - -@noindent -If you want Islamic-date entries, do this: - -@findex list-islamic-diary-entries -@findex mark-islamic-diary-entries -@smallexample -(add-hook 'nongregorian-diary-listing-hook 'list-islamic-diary-entries) -(add-hook 'nongregorian-diary-marking-hook 'mark-islamic-diary-entries) -@end smallexample - - Hebrew- and Islamic-date diary entries have the same formats as -Gregorian-date diary entries, except that @samp{H} precedes a Hebrew -date and @samp{I} precedes an Islamic date. Moreover, because the -Hebrew and Islamic month names are not uniquely specified by the first -three letters, you may not abbreviate them. For example, a diary entry -for the Hebrew date Heshvan 25 could look like this: - -@smallexample -HHeshvan 25 Happy Hebrew birthday! -@end smallexample - -@noindent -and would appear in the diary for any date that corresponds to Heshvan 25 -on the Hebrew calendar. And here is an Islamic-date diary entry that matches -Dhu al-Qada 25: - -@smallexample -IDhu al-Qada 25 Happy Islamic birthday! -@end smallexample - - As with Gregorian-date diary entries, Hebrew- and Islamic-date entries -are nonmarking if they are preceded with an ampersand (@samp{&}). - - Here is a table of commands used in the calendar to create diary entries -that match the selected date and other dates that are similar in the Hebrew -or Islamic calendar: - -@table @kbd -@item i h d -Add a diary entry for the Hebrew date corresponding to the selected date -(@code{insert-hebrew-diary-entry}). -@item i h m -Add a diary entry for the day of the Hebrew month corresponding to the -selected date (@code{insert-monthly-hebrew-diary-entry}). This diary -entry matches any date that has the same Hebrew day-within-month as the -selected date. -@item i h y -Add a diary entry for the day of the Hebrew year corresponding to the -selected date (@code{insert-yearly-hebrew-diary-entry}). This diary -entry matches any date which has the same Hebrew month and day-within-month -as the selected date. -@item i i d -Add a diary entry for the Islamic date corresponding to the selected date -(@code{insert-islamic-diary-entry}). -@item i i m -Add a diary entry for the day of the Islamic month corresponding to the -selected date (@code{insert-monthly-islamic-diary-entry}). -@item i i y -Add a diary entry for the day of the Islamic year corresponding to the -selected date (@code{insert-yearly-islamic-diary-entry}). -@end table - -@findex insert-hebrew-diary-entry -@findex insert-monthly-hebrew-diary-entry -@findex insert-yearly-hebrew-diary-entry -@findex insert-islamic-diary-entry -@findex insert-monthly-islamic-diary-entry -@findex insert-yearly-islamic-diary-entry - These commands work much like the corresponding commands for ordinary -diary entries: they apply to the date that point is on in the calendar -window, and what they do is insert just the date portion of a diary entry -at the end of your diary file. You must then insert the rest of the -diary entry. - -@node Fancy Diary Display -@subsection Fancy Diary Display -@vindex diary-display-hook -@findex simple-diary-display - - Diary display works by preparing the diary buffer and then running the -hook @code{diary-display-hook}. The default value of this hook -(@code{simple-diary-display}) hides the irrelevant diary entries and -then displays the buffer. However, if you specify the hook as follows, - -@cindex diary buffer -@findex fancy-diary-display -@example -(add-hook 'diary-display-hook 'fancy-diary-display) -@end example - -@noindent -this enables fancy diary display. It displays diary entries and -holidays by copying them into a special buffer that exists only for the -sake of display. Copying to a separate buffer provides an opportunity -to change the displayed text to make it prettier---for example, to sort -the entries by the dates they apply to. - - As with simple diary display, you can print a hard copy of the buffer -with @code{print-diary-entries}. To print a hard copy of a day-by-day -diary for a week, position point on Sunday of that week, type -@kbd{7 d}, and then do @kbd{M-x print-diary-entries}. As usual, the -inclusion of the holidays slows down the display slightly; you can speed -things up by setting the variable @code{holidays-in-diary-buffer} to -@code{nil}. - -@vindex diary-list-include-blanks - Ordinarily, the fancy diary buffer does not show days for which there are -no diary entries, even if that day is a holiday. If you want such days to be -shown in the fancy diary buffer, set the variable -@code{diary-list-include-blanks} to @code{t}.@refill - -@cindex sorting diary entries - If you use the fancy diary display, you can use the normal hook -@code{list-diary-entries-hook} to sort each day's diary entries by their -time of day. Here's how: - -@findex sort-diary-entries -@example -(add-hook 'list-diary-entries-hook 'sort-diary-entries t) -@end example - -@noindent -For each day, this sorts diary entries that begin with a recognizable -time of day according to their times. Diary entries without times come -first within each day. - - Fancy diary display also has the ability to process included diary -files. This permits a group of people to share a diary file for events -that apply to all of them. Lines in the diary file of this form: - -@smallexample -#include "@var{filename}" -@end smallexample - -@noindent -includes the diary entries from the file @var{filename} in the fancy -diary buffer. The include mechanism is recursive, so that included files -can include other files, and so on; you must be careful not to have a -cycle of inclusions, of course. Here is how to enable the include -facility: - -@vindex list-diary-entries-hook -@vindex mark-diary-entries-hook -@findex include-other-diary-files -@findex mark-included-diary-files -@smallexample -(add-hook 'list-diary-entries-hook 'include-other-diary-files) -(add-hook 'mark-diary-entries-hook 'mark-included-diary-files) -@end smallexample - -The include mechanism works only with the fancy diary display, because -ordinary diary display shows the entries directly from your diary file. - -@node Sexp Diary Entries -@subsection Sexp Entries and the Fancy Diary Display -@cindex sexp diary entries - - Sexp diary entries allow you to do more than just have complicated -conditions under which a diary entry applies. If you use the fancy -diary display, sexp entries can generate the text of the entry depending -on the date itself. For example, an anniversary diary entry can insert -the number of years since the anniversary date into the text of the -diary entry. Thus the @samp{%d} in this diary entry: - -@findex diary-anniversary -@smallexample -%%(diary-anniversary 10 31 1948) Arthur's birthday (%d years old) -@end smallexample - -@noindent -gets replaced by the age, so on October 31, 1990 the entry appears in -the fancy diary buffer like this: - -@smallexample -Arthur's birthday (42 years old) -@end smallexample - -@noindent -If the diary file instead contains this entry: - -@smallexample -%%(diary-anniversary 10 31 1948) Arthur's %d%s birthday -@end smallexample - -@noindent -the entry in the fancy diary buffer for October 31, 1990 appears like this: - -@smallexample -Arthur's 42nd birthday -@end smallexample - - Similarly, cyclic diary entries can interpolate the number of repetitions -that have occurred: - -@findex diary-cyclic -@smallexample -%%(diary-cyclic 50 1 1 1990) Renew medication (%d%s time) -@end smallexample - -@noindent -looks like this: - -@smallexample -Renew medication (5th time) -@end smallexample - -@noindent -in the fancy diary display on September 8, 1990. - - There is an early reminder diary sexp that includes its entry in the -diary not only on the date of occurrence, but also on earlier dates. -For example, if you want a reminder a week before your anniversary, you -can use - -@findex diary-remind -@smallexample -%%(diary-remind '(diary-anniversary 12 22 1968) 7) Ed's anniversary -@end smallexample - -@noindent -and the fancy diary will show -@smallexample -Ed's anniversary -@end smallexample -@noindent -both on December 15 and on December 22. - -@findex diary-date - The function @code{diary-date} applies to dates described by a month, -day, year combination, each of which can be an integer, a list of -integers, or @code{t}. The value @code{t} means all values. For -example, - -@smallexample -%%(diary-date '(10 11 12) 22 t) Rake leaves -@end smallexample - -@noindent -causes the fancy diary to show - -@smallexample -Rake leaves -@end smallexample - -@noindent -on October 22, November 22, and December 22 of every year. - -@findex diary-float - The function @code{diary-float} allows you to describe diary entries -that apply to dates like the third Friday of November, or the last -Tuesday in April. The parameters are the @var{month}, @var{dayname}, -and an index @var{n}. The entry appears on the @var{n}th @var{dayname} -of @var{month}, where @var{dayname}=0 means Sunday, 1 means Monday, and -so on. If @var{n} is negative it counts backward from the end of -@var{month}. The value of @var{month} can be a list of months, a single -month, or @code{t} to specify all months. You can also use an optional -parameter @var{day} to specify the @var{n}th @var{dayname} of -@var{month} on or after/before @var{day}; the value of @var{day} defaults -to 1 if @var{n} is positive and to the last day of @var{month} if -@var{n} is negative. For example, - -@smallexample -%%(diary-float t 1 -1) Pay rent -@end smallexample - -@noindent -causes the fancy diary to show - -@smallexample -Pay rent -@end smallexample - -@noindent -on the last Monday of every month. - - The generality of sexp diary entries lets you specify any diary -entry that you can describe algorithmically. A sexp diary entry -contains an expression that computes whether the entry applies to any -given date. If its value is non-@code{nil}, the entry applies to that -date; otherwise, it does not. The expression can use the variable -@code{date} to find the date being considered; its value is a list -(@var{month} @var{day} @var{year}) that refers to the Gregorian -calendar. - - The sexp diary entry applies to a date when the expression's value -is non-@code{nil}, but some values have more specific meanings. If -the value is a string, that string is a description of the event which -occurs on that date. The value can also have the form -@code{(@var{mark} . @var{string})}; then @var{mark} specifies how to -mark the date in the calendar, and @var{string} is the description of -the event. If @var{mark} is a single-character string, that character -appears next to the date in the calendar. If @var{mark} is a face -name, the date is displayed in that face. If @var{mark} is -@code{nil}, that specifies no particular highlighting for the date. - - Suppose you get paid on the 21st of the month if it is a weekday, and -on the Friday before if the 21st is on a weekend. Here is how to write -a sexp diary entry that matches those dates: - -@smallexample -&%%(let ((dayname (calendar-day-of-week date)) - (day (car (cdr date)))) - (or (and (= day 21) (memq dayname '(1 2 3 4 5))) - (and (memq day '(19 20)) (= dayname 5))) - ) Pay check deposited -@end smallexample - - The following sexp diary entries take advantage of the ability (in the fancy -diary display) to concoct diary entries whose text varies based on the date: - -@findex diary-sunrise-sunset -@findex diary-phases-of-moon -@findex diary-day-of-year -@findex diary-iso-date -@findex diary-julian-date -@findex diary-astro-day-number -@findex diary-hebrew-date -@findex diary-islamic-date -@findex diary-french-date -@findex diary-mayan-date -@table @code -@item %%(diary-sunrise-sunset) -Make a diary entry for the local times of today's sunrise and sunset. -@item %%(diary-phases-of-moon) -Make a diary entry for the phases (quarters) of the moon. -@item %%(diary-day-of-year) -Make a diary entry with today's day number in the current year and the number -of days remaining in the current year. -@item %%(diary-iso-date) -Make a diary entry with today's equivalent ISO commercial date. -@item %%(diary-julian-date) -Make a diary entry with today's equivalent date on the Julian calendar. -@item %%(diary-astro-day-number) -Make a diary entry with today's equivalent astronomical (Julian) day number. -@item %%(diary-hebrew-date) -Make a diary entry with today's equivalent date on the Hebrew calendar. -@item %%(diary-islamic-date) -Make a diary entry with today's equivalent date on the Islamic calendar. -@item %%(diary-french-date) -Make a diary entry with today's equivalent date on the French Revolutionary -calendar. -@item %%(diary-mayan-date) -Make a diary entry with today's equivalent date on the Mayan calendar. -@end table - -@noindent -Thus including the diary entry - -@example -&%%(diary-hebrew-date) -@end example - -@noindent -causes every day's diary display to contain the equivalent date on the -Hebrew calendar, if you are using the fancy diary display. (With simple -diary display, the line @samp{&%%(diary-hebrew-date)} appears in the -diary for any date, but does nothing particularly useful.) - - These functions can be used to construct sexp diary entries based on -the Hebrew calendar in certain standard ways: - -@cindex rosh hodesh -@findex diary-rosh-hodesh -@cindex parasha, weekly -@findex diary-parasha -@cindex candle lighting times -@findex diary-sabbath-candles -@cindex omer count -@findex diary-omer -@cindex yahrzeits -@findex diary-yahrzeit -@table @code -@item %%(diary-rosh-hodesh) -Make a diary entry that tells the occurrence and ritual announcement of each -new Hebrew month. -@item %%(diary-parasha) -Make a Saturday diary entry that tells the weekly synagogue scripture reading. -@item %%(diary-sabbath-candles) -Make a Friday diary entry that tells the @emph{local time} of Sabbath -candle lighting. -@item %%(diary-omer) -Make a diary entry that gives the omer count, when appropriate. -@item %%(diary-yahrzeit @var{month} @var{day} @var{year}) @var{name} -Make a diary entry marking the anniversary of a date of death. The date -is the @emph{Gregorian} (civil) date of death. The diary entry appears -on the proper Hebrew calendar anniversary and on the day before. (In -the European style, the order of the parameters is changed to @var{day}, -@var{month}, @var{year}.) -@end table - - All the functions documented above take an optional argument -@var{mark} which specifies how to mark the date in the calendar display. -If one of these functions decides that it applies to a certain date, -it returns a value that contains @var{mark}. - -@ignore - arch-tag: 52cb299f-fd1f-4616-bfe6-91b988669431 -@end ignore diff --git a/man/cmdargs.texi b/man/cmdargs.texi deleted file mode 100644 index 28bad72f0bf..00000000000 --- a/man/cmdargs.texi +++ /dev/null @@ -1,1263 +0,0 @@ -@c This is part of the Emacs manual. -@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2001, 2002, -@c 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. -@c See file emacs.texi for copying conditions. -@node Emacs Invocation, X Resources, GNU Free Documentation License, Top -@appendix Command Line Arguments for Emacs Invocation -@cindex command line arguments -@cindex arguments (command line) -@cindex options (command line) -@cindex switches (command line) -@cindex startup (command line arguments) -@cindex invocation (command line arguments) - - GNU Emacs supports command line arguments to request various actions -when invoking Emacs. These are for compatibility with other editors and -for sophisticated activities. We don't recommend using them for -ordinary editing. - - Arguments starting with @samp{-} are @dfn{options}, and so is -@samp{+@var{linenum}}. All other arguments specify files to visit. -Emacs visits the specified files while it starts up. The last file -name on your command line becomes the current buffer; the other files -are also visited in other buffers. If there are two files, they are -both displayed; otherwise the last file is displayed along with a -buffer list that shows what other buffers there are. As with most -programs, the special argument @samp{--} says that all subsequent -arguments are file names, not options, even if they start with -@samp{-}. - - Emacs command options can specify many things, such as the size and -position of the X window Emacs uses, its colors, and so on. A few -options support advanced usage, such as running Lisp functions on files -in batch mode. The sections of this chapter describe the available -options, arranged according to their purpose. - - There are two ways of writing options: the short forms that start with -a single @samp{-}, and the long forms that start with @samp{--}. For -example, @samp{-d} is a short form and @samp{--display} is the -corresponding long form. - - The long forms with @samp{--} are easier to remember, but longer to -type. However, you don't have to spell out the whole option name; any -unambiguous abbreviation is enough. When a long option takes an -argument, you can use either a space or an equal sign to separate the -option name and the argument. Thus, you can write either -@samp{--display sugar-bombs:0.0} or @samp{--display=sugar-bombs:0.0}. -We recommend an equal sign because it makes the relationship clearer, -and the tables below always show an equal sign. - -@cindex initial options (command line) -@cindex action options (command line) -@vindex command-line-args - Most options specify how to initialize Emacs, or set parameters for -the Emacs session. We call them @dfn{initial options}. A few options -specify things to do: for example, load libraries, call functions, or -terminate Emacs. These are called @dfn{action options}. These and file -names together are called @dfn{action arguments}. Emacs processes all -the action arguments in the order they are written. The @file{.emacs} file -can access the values of the action arguments as the elements of a list in -the variable @code{command-line-args}. - - - -@menu -* Action Arguments:: Arguments to visit files, load libraries, - and call functions. -* Initial Options:: Arguments that take effect while starting Emacs. -* Command Example:: Examples of using command line arguments. -* Resume Arguments:: Specifying arguments when you resume a running Emacs. -* Environment:: Environment variables that Emacs uses. -* Display X:: Changing the default display and using remote login. -* Font X:: Choosing a font for text, under X. -* Colors:: Choosing display colors. -* Window Size X:: Start-up window size, under X. -* Borders X:: Internal and external borders, under X. -* Title X:: Specifying the initial frame's title. -* Icons X:: Choosing what sort of icon to use, under X. -* Misc X:: Other display options. -@end menu - -@node Action Arguments -@appendixsec Action Arguments - - Here is a table of the action arguments and options: - -@table @samp -@item @var{file} -@opindex --file -@itemx --file=@var{file} -@opindex --find-file -@itemx --find-file=@var{file} -@opindex --visit -@itemx --visit=@var{file} -@cindex visiting files, command-line argument -@vindex inhibit-startup-buffer-menu -Visit @var{file} using @code{find-file}. @xref{Visiting}. -If you visit several files at startup in this way, Emacs -also displays a Buffer Menu buffer to show you what files it -has visited. You can inhibit that by setting @code{inhibit-startup-buffer-menu} to @code{t}. - -@item +@var{linenum} @var{file} -@opindex +@var{linenum} -Visit @var{file} using @code{find-file}, then go to line number -@var{linenum} in it. - -@item +@var{linenum}:@var{columnnum} @var{file} -Visit @var{file} using @code{find-file}, then go to line number -@var{linenum} and put point at column number @var{columnnum}. - -@need 3000 -@item -l @var{file} -@opindex -l -@itemx --load=@var{file} -@opindex --load -@cindex loading Lisp libraries, command-line argument -Load a Lisp library named @var{file} with the function @code{load}. -@xref{Lisp Libraries}. If @var{file} is not an absolute file name, -the library can be found either in the current directory, or in the -Emacs library search path as specified with @env{EMACSLOADPATH} -(@pxref{General Variables}). - -@strong{Warning:} If previous command-line arguments have visited -files, the current directory is the directory of the last file -visited. - -@item -L @var{dir} -@opindex -L -@itemx --directory=@var{dir} -@opindex --directory -Add directory @var{dir} to the variable @code{load-path}. - -@item -f @var{function} -@opindex -f -@itemx --funcall=@var{function} -@opindex --funcall -@cindex call Lisp functions, command-line argument -Call Lisp function @var{function}. If it is an interactive function -(a command), it reads the arguments interactively just as if you had -called the same function with a key sequence. Otherwise, it calls the -function with no arguments. - -@item --eval=@var{expression} -@opindex --eval -@itemx --execute=@var{expression} -@opindex --execute -@cindex evaluate expression, command-line argument -Evaluate Lisp expression @var{expression}. - -@item --insert=@var{file} -@opindex --insert -@cindex insert file contents, command-line argument -Insert the contents of @var{file} into the current buffer. This is like -what @kbd{M-x insert-file} does. @xref{Misc File Ops}. - -@item --kill -@opindex --kill -Exit from Emacs without asking for confirmation. - -@item --help -@opindex --help -Print a usage message listing all available options, then exit -successfully. - -@item --version -@opindex --version -Print Emacs version, then exit successfully. -@end table - -@node Initial Options -@appendixsec Initial Options - - The initial options specify parameters for the Emacs session. This -section describes the more general initial options; some other options -specifically related to the X Window System appear in the following -sections. - - Some initial options affect the loading of init files. The normal -actions of Emacs are to first load @file{site-start.el} if it exists, -then your own init file @file{~/.emacs} if it exists, and finally -@file{default.el} if it exists. @xref{Init File}. Certain options -prevent loading of some of these files or substitute other files for -them. - -@table @samp -@item -t @var{device} -@opindex -t -@itemx --terminal=@var{device} -@opindex --terminal -@cindex device for Emacs terminal I/O -Use @var{device} as the device for terminal input and output. -@samp{--terminal} implies @samp{--no-window-system}. - -@item -d @var{display} -@opindex -d -@itemx --display=@var{display} -@opindex --display -@cindex display for Emacs frame -Use the X Window System and use the display named @var{display} to open -the initial Emacs frame. @xref{Display X}, for more details. - -@item -nw -@opindex -nw -@itemx --no-window-system -@opindex --no-window-system -@cindex disable window system -Don't communicate directly with the window system, disregarding the -@env{DISPLAY} environment variable even if it is set. This means that -Emacs uses the terminal from which it was launched for all its display -and input. - -@need 3000 -@cindex batch mode -@item -batch -@opindex --batch -@itemx --batch -Run Emacs in @dfn{batch mode}. Batch mode is used for running -programs written in Emacs Lisp from shell scripts, makefiles, and so -on. You should also use the @samp{-l}, @samp{-f} or @samp{--eval} -option, to invoke a Lisp program to do batch processing. - -In batch mode, Emacs does not display the text being edited, and the -standard terminal interrupt characters such as @kbd{C-z} and @kbd{C-c} -continue to have their normal effect. The functions @code{prin1}, -@code{princ} and @code{print} output to @code{stdout} instead of the -echo area, while @code{message} and error messages output to -@code{stderr}. Functions that would normally read from the minibuffer -take their input from @code{stdin} instead. - -@samp{--batch} implies @samp{-q} (do not load an init file), but -@file{site-start.el} is loaded nonetheless. It also causes Emacs to -exit after processing all the command options. In addition, it -disables auto-saving except in buffers for which it has been -explicitly requested. - -@item --script @var{file} -@opindex --script -@cindex script mode -Run Emacs in batch mode, like @samp{--batch}, and then read and -execute the Lisp code in @var{file}. - -The normal use of this option is in executable script files that run -Emacs. They can start with this text on the first line - -@example -#!/usr/bin/emacs --script -@end example - -@noindent -which will invoke Emacs with @samp{--script} and supply the name of -the script file as @var{file}. Emacs Lisp then treats @samp{#!} as a -comment delimiter. - -@item -q -@opindex -q -@itemx --no-init-file -@opindex --no-init-file -@cindex bypassing init and @file{default.el} file -@cindex init file, not loading -@cindex @file{default.el} file, not loading -Do not load your Emacs init file @file{~/.emacs}, or @file{default.el} -either. Regardless of this switch, @file{site-start.el} is still loaded. -When invoked like this, Emacs does not allow saving options -changed with the @kbd{M-x customize} command and its variants. -@xref{Easy Customization}. - -@item --no-site-file -@opindex --no-site-file -@cindex @file{site-start.el} file, not loading -Do not load @file{site-start.el}. The options @samp{-q}, @samp{-u} -and @samp{--batch} have no effect on the loading of this file---this -option and @samp{-Q} are the only options that block it. - -@item -Q -@opindex -Q -@itemx --quick -@opindex --quick -Start emacs with minimum customizations. This is like using @samp{-q} -and @samp{--no-site-file}, but also disables the startup screen. - -@item --no-splash -@opindex --no-splash -@vindex inhibit-splash-screen -@cindex splash screen -@cindex startup message -Do not display a splash screen on startup. You can also achieve this -effect by setting the variable @code{inhibit-splash-screen} to -non-@code{nil} in you personal init file (but @emph{not} in -@file{site-start.el}). (This variable was called -@code{inhibit-startup-message} in previous Emacs versions.) - -@item --no-desktop -@opindex --no-desktop -Do not reload any saved desktop. @xref{Saving Emacs Sessions}. - -@item -u @var{user} -@opindex -u -@itemx --user=@var{user} -@opindex --user -@cindex load init file of another user -Load @var{user}'s Emacs init file @file{~@var{user}/.emacs} instead of -your own@footnote{ -This option has no effect on MS-Windows.}. - -@item --debug-init -@opindex --debug-init -@cindex errors in init file -Enable the Emacs Lisp debugger for errors in the init file. -@xref{Error Debugging,, Entering the Debugger on an Error, elisp, The -GNU Emacs Lisp Reference Manual}. - -@item --unibyte -@opindex --unibyte -@itemx --no-multibyte -@opindex --no-multibyte -@cindex unibyte operation, command-line argument -Do almost everything with single-byte buffers and strings. -All buffers and strings are unibyte unless you (or a Lisp program) -explicitly ask for a multibyte buffer or string. (Note that Emacs -always loads Lisp files in multibyte mode, even if @samp{--unibyte} is -specified; see @ref{Enabling Multibyte}.) Setting the environment -variable @env{EMACS_UNIBYTE} has the same effect -(@pxref{General Variables}). - -@item --multibyte -@opindex --multibyte -@itemx --no-unibyte -@opindex --no-unibyte -Inhibit the effect of @env{EMACS_UNIBYTE}, so that Emacs -uses multibyte characters by default, as usual. -@end table - -@node Command Example -@appendixsec Command Argument Example - - Here is an example of using Emacs with arguments and options. It -assumes you have a Lisp program file called @file{hack-c.el} which, when -loaded, performs some useful operation on the current buffer, expected -to be a C program. - -@example -emacs --batch foo.c -l hack-c -f save-buffer >& log -@end example - -@noindent -This says to visit @file{foo.c}, load @file{hack-c.el} (which makes -changes in the visited file), save @file{foo.c} (note that -@code{save-buffer} is the function that @kbd{C-x C-s} is bound to), and -then exit back to the shell (because of @samp{--batch}). @samp{--batch} -also guarantees there will be no problem redirecting output to -@file{log}, because Emacs will not assume that it has a display terminal -to work with. - -@node Resume Arguments -@appendixsec Resuming Emacs with Arguments - - You can specify action arguments for Emacs when you resume it after -a suspension. To prepare for this, put the following code in your -@file{.emacs} file (@pxref{Hooks}): - -@c `resume-suspend-hook' is correct. It is the name of a function. -@example -(add-hook 'suspend-hook 'resume-suspend-hook) -(add-hook 'suspend-resume-hook 'resume-process-args) -@end example - - As further preparation, you must execute the shell script -@file{emacs.csh} (if you use csh as your shell) or @file{emacs.bash} -(if you use bash as your shell). These scripts define an alias named -@code{edit}, which will resume Emacs giving it new command line -arguments such as files to visit. The scripts are found in the -@file{etc} subdirectory of the Emacs distribution. - - Only action arguments work properly when you resume Emacs. Initial -arguments are not recognized---it's too late to execute them anyway. - - Note that resuming Emacs (with or without arguments) must be done from -within the shell that is the parent of the Emacs job. This is why -@code{edit} is an alias rather than a program or a shell script. It is -not possible to implement a resumption command that could be run from -other subjobs of the shell; there is no way to define a command that could -be made the value of @env{EDITOR}, for example. Therefore, this feature -does not take the place of the Emacs Server feature (@pxref{Emacs -Server}). - - The aliases use the Emacs Server feature if you appear to have a -server Emacs running. However, they cannot determine this with complete -accuracy. They may think that a server is still running when in -actuality you have killed that Emacs, because the file -@file{/tmp/esrv@dots{}} still exists. If this happens, find that -file and delete it. - -@node Environment -@appendixsec Environment Variables -@cindex environment variables - - The @dfn{environment} is a feature of the operating system; it -consists of a collection of variables with names and values. Each -variable is called an @dfn{environment variable}; environment variable -names are case-sensitive, and it is conventional to use upper case -letters only. The values are all text strings. - - What makes the environment useful is that subprocesses inherit the -environment automatically from their parent process. This means you -can set up an environment variable in your login shell, and all the -programs you run (including Emacs) will automatically see it. -Subprocesses of Emacs (such as shells, compilers, and version-control -software) inherit the environment from Emacs, too. - -@findex setenv -@findex getenv - Inside Emacs, the command @kbd{M-x getenv} gets the value of an -environment variable. @kbd{M-x setenv} sets a variable in the Emacs -environment. (Environment variable substitutions with @samp{$} work -in the value just as in file names; see @ref{File Names with $}.) - - The way to set environment variables outside of Emacs depends on the -operating system, and especially the shell that you are using. For -example, here's how to set the environment variable @env{ORGANIZATION} -to @samp{not very much} using Bash: - -@example -export ORGANIZATION="not very much" -@end example - -@noindent -and here's how to do it in csh or tcsh: - -@example -setenv ORGANIZATION "not very much" -@end example - - When Emacs is using the X Window System, various environment -variables that control X work for Emacs as well. See the X -documentation for more information. - -@menu -* General Variables:: Environment variables that all versions of Emacs use. -* Misc Variables:: Certain system-specific variables. -* MS-Windows Registry:: An alternative to the environment on MS-Windows. -@end menu - -@node General Variables -@appendixsubsec General Variables - - Here is an alphabetical list of specific environment variables that -have special meanings in Emacs, giving the name of each variable and -its meaning. Most of these variables are also used by some other -programs. Emacs does not require any of these environment variables -to be set, but it uses their values if they are set. - -@table @env -@item CDPATH -Used by the @code{cd} command to search for the directory you specify, -when you specify a relative directory name. -@item EMACS_UNIBYTE -@cindex unibyte operation, environment variable -Defining this environment variable with a nonempty value directs Emacs -to do almost everything with single-byte buffers and strings. It is -equivalent to using the @samp{--unibyte} command-line option on each -invocation. @xref{Initial Options}. -@item EMACSDATA -Directory for the architecture-independent files that come with Emacs. -This is used to initialize the Lisp variable @code{data-directory}. -@item EMACSDOC -Directory for the documentation string file, -@file{DOC-@var{emacsversion}}. This is used to initialize the Lisp -variable @code{doc-directory}. -@item EMACSLOADPATH -A colon-separated list of directories@footnote{ -Here and below, whenever we say ``colon-separated list of directories,'' -it pertains to Unix and GNU/Linux systems. On MS-DOS and MS-Windows, -the directories are separated by semi-colons instead, since DOS/Windows -file names might include a colon after a drive letter.} -to search for Emacs Lisp files---used to initialize @code{load-path}. -@item EMACSPATH -A colon-separated list of directories to search for executable -files---used to initialize @code{exec-path}. -@item EMAIL -@vindex user-mail-address@r{, initialization} -Your email address; used to initialize the Lisp variable -@code{user-mail-address}, which the Emacs mail interface puts into -the @samp{From} header of outgoing messages (@pxref{Mail Headers}). -@item ESHELL -Used for shell-mode to override the @env{SHELL} environment variable. -@item HISTFILE -The name of the file that shell commands are saved in between logins. -This variable defaults to @file{~/.bash_history} if you use Bash, to -@file{~/.sh_history} if you use ksh, and to @file{~/.history} -otherwise. -@item HOME -The location of your files in the directory tree; used for -expansion of file names starting with a tilde (@file{~}). On MS-DOS, -it defaults to the directory from which Emacs was started, with -@samp{/bin} removed from the end if it was present. On Windows, the -default value of @env{HOME} is the @file{Application Data} -subdirectory of the user profile directory (normally, this is -@file{C:/Documents and Settings/@var{username}/Application Data}, -where @var{username} is your user name), though for backwards -compatibility @file{C:/} will be used instead if a @file{.emacs} file -is found there. -@item HOSTNAME -The name of the machine that Emacs is running on. -@item INCPATH -A colon-separated list of directories. Used by the @code{complete} package -to search for files. -@item INFOPATH -A colon-separated list of directories in which to search for Info files. -@item LC_ALL -@itemx LC_COLLATE -@itemx LC_CTYPE -@itemx LC_MESSAGES -@itemx LC_MONETARY -@itemx LC_NUMERIC -@itemx LC_TIME -@itemx LANG -The user's preferred locale. The locale has six categories, specified -by the environment variables @env{LC_COLLATE} for sorting, -@env{LC_CTYPE} for character encoding, @env{LC_MESSAGES} for system -messages, @env{LC_MONETARY} for monetary formats, @env{LC_NUMERIC} for -numbers, and @env{LC_TIME} for dates and times. If one of these -variables is not set, the category defaults to the value of the -@env{LANG} environment variable, or to the default @samp{C} locale if -@env{LANG} is not set. But if @env{LC_ALL} is specified, it overrides -the settings of all the other locale environment variables. - -On MS-Windows, if @env{LANG} is not already set in the environment -when Emacs starts, Emacs sets it based on the system-wide default -language, which you can set in the @samp{Regional Settings} Control Panel -on some versions of MS-Windows. - -The value of the @env{LC_CTYPE} category is -matched against entries in @code{locale-language-names}, -@code{locale-charset-language-names}, and -@code{locale-preferred-coding-systems}, to select a default language -environment and coding system. @xref{Language Environments}. -@item LOGNAME -The user's login name. See also @env{USER}. -@item MAIL -The name of your system mail inbox. -@item MH -Name of setup file for the mh system. (The default is @file{~/.mh_profile}.) -@item NAME -Your real-world name. -@item NNTPSERVER -The name of the news server. Used by the mh and Gnus packages. -@item ORGANIZATION -The name of the organization to which you belong. Used for setting the -`Organization:' header in your posts from the Gnus package. -@item PATH -A colon-separated list of directories in which executables reside. This -is used to initialize the Emacs Lisp variable @code{exec-path}. -@item PWD -If set, this should be the default directory when Emacs was started. -@item REPLYTO -If set, this specifies an initial value for the variable -@code{mail-default-reply-to}. @xref{Mail Headers}. -@item SAVEDIR -The name of a directory in which news articles are saved by default. -Used by the Gnus package. -@item SHELL -The name of an interpreter used to parse and execute programs run from -inside Emacs. -@item SMTPSERVER -The name of the outgoing mail server. Used by the SMTP library -(@pxref{Top,,,smtpmail,Sending mail via SMTP}). -@cindex background mode, on @command{xterm} -@item TERM -The type of the terminal that Emacs is using. This variable must be -set unless Emacs is run in batch mode. On MS-DOS, it defaults to -@samp{internal}, which specifies a built-in terminal emulation that -handles the machine's own display. If the value of @env{TERM} indicates -that Emacs runs in non-windowed mode from @command{xterm} or a similar -terminal emulator, the background mode defaults to @samp{light}, and -Emacs will choose colors that are appropriate for a light background. -@item TERMCAP -The name of the termcap library file describing how to program the -terminal specified by the @env{TERM} variable. This defaults to -@file{/etc/termcap}. -@item TMPDIR -Used by the Emerge package as a prefix for temporary files. -@item TZ -This specifies the current time zone and possibly also daylight -saving time information. On MS-DOS, if @env{TZ} is not set in the -environment when Emacs starts, Emacs defines a default value as -appropriate for the country code returned by DOS. On MS-Windows, Emacs -does not use @env{TZ} at all. -@item USER -The user's login name. See also @env{LOGNAME}. On MS-DOS, this -defaults to @samp{root}. -@item VERSION_CONTROL -Used to initialize the @code{version-control} variable (@pxref{Numbered Backups}). -@end table - -@node Misc Variables -@appendixsubsec Miscellaneous Variables - -These variables are used only on particular configurations: - -@table @env -@item COMSPEC -On MS-DOS and MS-Windows, the name of the command interpreter to use -when invoking batch files and commands internal to the shell. On MS-DOS -this is also used to make a default value for the @env{SHELL} environment -variable. - -@item NAME -On MS-DOS, this variable defaults to the value of the @env{USER} -variable. - -@item TEMP -@itemx TMP -On MS-DOS and MS-Windows, these specify the name of the directory for -storing temporary files in. - -@item EMACSTEST -On MS-DOS, this specifies a file to use to log the operation of the -internal terminal emulator. This feature is useful for submitting bug -reports. - -@item EMACSCOLORS -On MS-DOS, this specifies the screen colors. It is useful to set them -this way, since otherwise Emacs would display the default colors -momentarily when it starts up. - -The value of this variable should be the two-character encoding of the -foreground (the first character) and the background (the second -character) colors of the default face. Each character should be the -hexadecimal code for the desired color on a standard PC text-mode -display. For example, to get blue text on a light gray background, -specify @samp{EMACSCOLORS=17}, since 1 is the code of the blue color and -7 is the code of the light gray color. - -The PC display usually supports only eight background colors. However, -Emacs switches the DOS display to a mode where all 16 colors can be used -for the background, so all four bits of the background color are -actually used. - -@item WINDOW_GFX -Used when initializing the Sun windows system. - -@item PRELOAD_WINSOCK -On MS-Windows, if you set this variable, Emacs will load and initialize -the network library at startup, instead of waiting until the first -time it is required. - -@item emacs_dir -On MS-Windows, @env{emacs_dir} is a special environment variable, which -indicates the full path of the directory in which Emacs is installed. -If Emacs is installed in the standard directory structure, it -calculates this value automatically. It is not much use setting this -variable yourself unless your installation is non-standard, since -unlike other environment variables, it will be overridden by Emacs at -startup. When setting other environment variables, such as -@env{EMACSLOADPATH}, you may find it useful to use @env{emacs_dir} -rather than hard-coding an absolute path. This allows multiple -versions of Emacs to share the same environment variable settings, and -it allows you to move the Emacs installation directory, without -changing any environment or registry settings. -@end table - -@node MS-Windows Registry -@appendixsubsec The MS-Windows System Registry -@pindex addpm, MS-Windows installation program -@cindex registry, setting environment variables and resources on MS-Windows - -Under MS-Windows, the installation program @command{addpm.exe} adds -values for @env{emacs_dir}, @env{EMACSLOADPATH}, @env{EMACSDATA}, -@env{EMACSPATH}, @env{EMACSDOC}, @env{SHELL} and @env{TERM} to the -@file{HKEY_LOCAL_MACHINE} section of the system registry, under -@file{/Software/GNU/Emacs}. It does this because there is no standard -place to set environment variables across different versions of -Windows. Running @command{addpm.exe} is no longer strictly necessary -in recent versions of Emacs, but if you are upgrading from an older -version, running @command{addpm.exe} ensures that you do not have -older registry entries from a previous installation, which may not be -compatible with the latest version of Emacs. - -When Emacs starts, as well as checking the environment, it also checks -the System Registry for those variables and for @env{HOME}, @env{LANG} -and @env{PRELOAD_WINSOCK}. - -To determine the value of those variables, Emacs goes through the -following procedure. First, the environment is checked. If the -variable is not found there, Emacs looks for registry keys by that -name under @file{/Software/GNU/Emacs}; first in the -@file{HKEY_CURRENT_USER} section of the registry, and if not found -there, in the @file{HKEY_LOCAL_MACHINE} section. Finally, if Emacs -still cannot determine the values, compiled-in defaults are used. - -In addition to the environment variables above, you can also add many -of the settings which on X belong in the @file{.Xdefaults} file -(@pxref{X Resources}) to the @file{/Software/GNU/Emacs} registry key. -Settings you add to the @file{HKEY_LOCAL_MACHINE} section will affect -all users of the machine. Settings you add to the -@file{HKEY_CURRENT_USER} section will only affect you, and will -override machine wide settings. - -@node Display X -@appendixsec Specifying the Display Name -@cindex display name (X Window System) -@cindex @env{DISPLAY} environment variable - - The environment variable @env{DISPLAY} tells all X clients, including -Emacs, where to display their windows. Its value is set by default -in ordinary circumstances, when you start an X server and run jobs -locally. Occasionally you may need to specify the display yourself; for -example, if you do a remote login and want to run a client program -remotely, displaying on your local screen. - - With Emacs, the main reason people change the default display is to -let them log into another system, run Emacs on that system, but have the -window displayed at their local terminal. You might need to log in -to another system because the files you want to edit are there, or -because the Emacs executable file you want to run is there. - - The syntax of the @env{DISPLAY} environment variable is -@samp{@var{host}:@var{display}.@var{screen}}, where @var{host} is the -host name of the X Window System server machine, @var{display} is an -arbitrarily-assigned number that distinguishes your server (X terminal) -from other servers on the same machine, and @var{screen} is a -rarely-used field that allows an X server to control multiple terminal -screens. The period and the @var{screen} field are optional. If -included, @var{screen} is usually zero. - - For example, if your host is named @samp{glasperle} and your server is -the first (or perhaps the only) server listed in the configuration, your -@env{DISPLAY} is @samp{glasperle:0.0}. - - You can specify the display name explicitly when you run Emacs, either -by changing the @env{DISPLAY} variable, or with the option @samp{-d -@var{display}} or @samp{--display=@var{display}}. Here is an example: - -@smallexample -emacs --display=glasperle:0 & -@end smallexample - - You can inhibit the direct use of the window system and GUI with the -@samp{-nw} option. It tells Emacs to display using ordinary @acronym{ASCII} on -its controlling terminal. This is also an initial option. - - Sometimes, security arrangements prevent a program on a remote system -from displaying on your local system. In this case, trying to run Emacs -produces messages like this: - -@smallexample -Xlib: connection to "glasperle:0.0" refused by server -@end smallexample - -@noindent -You might be able to overcome this problem by using the @command{xhost} -command on the local system to give permission for access from your -remote machine. - -@node Font X -@appendixsec Font Specification Options -@cindex font name (X Window System) - - By default, Emacs displays text in a twelve point Courier font (when -using X). You can specify a different font on your command line -through the option @samp{-fn @var{name}} (or @samp{--font}, which is -an alias for @samp{-fn}). - -@table @samp -@item -fn @var{name} -@opindex -fn -@itemx --font=@var{name} -@opindex --font -@cindex specify default font from the command line -Use font @var{name} as the default font. -@end table - - Under X, each font has a long name which consists of fourteen words -or numbers, separated by dashes. Some fonts also have shorter -nicknames. For instance, @samp{9x15} is such a nickname. This font -makes each character nine pixels wide and fifteen pixels high. You -can use either kind of name. Case is insignificant in both kinds. -You can use wildcard patterns for the font name; then Emacs lets X -choose one of the fonts that match the pattern. The wildcard -character @samp{*} matches any sequence of characters (including none) -and @samp{?} matches any single character. However, matching is -implementation-dependent, and can be inaccurate when wildcards match -dashes in a long name. For reliable results, supply all 14 dashes and -use wildcards only within a field. Here is an example, which happens -to specify the font whose nickname is @samp{6x13}: - -@smallexample -emacs -fn \ - "-misc-fixed-medium-r-semicondensed--13-*-*-*-c-60-iso8859-1" & -@end smallexample - -@noindent -You can also specify the font in your @file{.Xdefaults} file: - -@smallexample -emacs.font: -misc-fixed-medium-r-semicondensed--13-*-*-*-c-60-iso8859-1 -@end smallexample - - Note that if you use a wildcard pattern on the command line, you -need to enclose it in single or double quotes, to prevent the shell -from accidentally expanding it into a list of file names. On the -other hand, you should not quote the name in the @file{.Xdefaults} -file. - -The default font used by Emacs (under X) is: - -@smallexample --adobe-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-1 -@end smallexample - - A long font name has the following form: - -@smallexample --@var{maker}-@var{family}-@var{weight}-@var{slant}-@var{widthtype}-@var{style}@dots{} -@dots{}-@var{pixels}-@var{height}-@var{horiz}-@var{vert}-@var{spacing}-@var{width}-@var{registry}-@var{encoding} -@end smallexample - -@table @var -@item maker -This is the name of the font manufacturer. -@item family -This is the name of the font family---for example, @samp{courier}. -@item weight -This is normally @samp{bold}, @samp{medium} or @samp{light}. Other -words may appear here in some font names. -@item slant -This is @samp{r} (roman), @samp{i} (italic), @samp{o} (oblique), -@samp{ri} (reverse italic), or @samp{ot} (other). -@item widthtype -This is normally @samp{condensed}, @samp{extended}, @samp{semicondensed} -or @samp{normal}. Other words may appear here in some font names. -@item style -This is an optional additional style name. Usually it is empty---most -long font names have two hyphens in a row at this point. -@item pixels -This is the font height, in pixels. -@item height -This is the font height on the screen, measured in tenths of a printer's -point---approximately 1/720 of an inch. In other words, it is the point -size of the font, times ten. For a given vertical resolution, -@var{height} and @var{pixels} are proportional; therefore, it is common -to specify just one of them and use @samp{*} for the other. -@item horiz -This is the horizontal resolution, in pixels per inch, of the screen for -which the font is intended. -@item vert -This is the vertical resolution, in pixels per inch, of the screen for -which the font is intended. Normally the resolution of the fonts on -your system is the right value for your screen; therefore, you normally -specify @samp{*} for this and @var{horiz}. -@item spacing -This is @samp{m} (monospace), @samp{p} (proportional) or @samp{c} -(character cell). -@item width -This is the average character width, in pixels, multiplied by ten. -@item registry -@itemx encoding -These together make up the X font character set that the font depicts. -(X font character sets are not the same as Emacs charsets, but they -are solutions for the same problem.) You can use the -@command{xfontsel} program to check which choices you have. However, -normally you should use @samp{iso8859} for @var{registry} and @samp{1} -for @var{encoding}. -@end table - -@cindex listing system fonts - You will probably want to use a fixed-width default font---that is, -a font in which all characters have the same width. Any font with -@samp{m} or @samp{c} in the @var{spacing} field of the long name is a -fixed-width font. Here's how to use the @command{xlsfonts} program to -list all the fixed-width fonts available on your system: - -@example -xlsfonts -fn '*x*' | egrep "^[0-9]+x[0-9]+" -xlsfonts -fn '*-*-*-*-*-*-*-*-*-*-*-m*' -xlsfonts -fn '*-*-*-*-*-*-*-*-*-*-*-c*' -@end example - -@noindent -To see what a particular font looks like, use the @command{xfd} command. -For example: - -@example -xfd -fn 6x13 -@end example - -@noindent -displays the entire font @samp{6x13}. - - While running Emacs, you can set the font of the current frame -(@pxref{Frame Parameters}) or for a specific kind of text -(@pxref{Faces}). - -@node Colors -@appendixsec Window Color Options -@cindex color of window, from command line -@cindex text colors, from command line - -@findex list-colors-display -@cindex available colors - On a color display, you can specify which color to use for various -parts of the Emacs display. To find out what colors are available on -your system, type @kbd{M-x list-colors-display}, or press -@kbd{C-Mouse-2} and select @samp{Display Colors} from the pop-up menu. -(A particular window system might support many more colors, but the -list displayed by @code{list-colors-display} shows their portable -subset that can be safely used on any display supported by Emacs.) -If you do not specify colors, on windowed displays the default for the -background is white and the default for all other colors is black. On a -monochrome display, the foreground is black, the background is white, -and the border is gray if the display supports that. On terminals, the -background is usually black and the foreground is white. - - Here is a list of the command-line options for specifying colors: - -@table @samp -@item -fg @var{color} -@opindex -fg -@itemx --foreground-color=@var{color} -@opindex --foreground-color -@cindex foreground color, command-line argument -Specify the foreground color. @var{color} should be a standard color -name, or a numeric specification of the color's red, green, and blue -components as in @samp{#4682B4} or @samp{RGB:46/82/B4}. -@item -bg @var{color} -@opindex -bg -@itemx --background-color=@var{color} -@opindex --background-color -@cindex background color, command-line argument -Specify the background color. -@item -bd @var{color} -@opindex -bd -@itemx --border-color=@var{color} -@opindex --border-color -@cindex border color, command-line argument -Specify the color of the border of the X window. -@item -cr @var{color} -@opindex -cr -@itemx --cursor-color=@var{color} -@opindex --cursor-color -@cindex cursor color, command-line argument -Specify the color of the Emacs cursor which indicates where point is. -@item -ms @var{color} -@opindex -ms -@itemx --mouse-color=@var{color} -@opindex --mouse-color -@cindex mouse pointer color, command-line argument -Specify the color for the mouse cursor when the mouse is in the Emacs window. -@item -r -@opindex -r -@itemx -rv -@opindex -rv -@itemx --reverse-video -@opindex --reverse-video -@cindex reverse video, command-line argument -Reverse video---swap the foreground and background colors. -@item --color=@var{mode} -@opindex --color -@cindex standard colors on a character terminal -@cindex override character terminal color support -For a character terminal only, specify the mode of color support. -This option is intended for overriding the number of supported colors -that the character terminal advertises in its @code{termcap} or -@code{terminfo} database. The parameter @var{mode} can be one of the -following: -@table @samp -@item never -@itemx no -Don't use colors even if the terminal's capabilities specify color -support. -@item default -@itemx auto -Same as when @option{--color} is not used at all: Emacs detects at -startup whether the terminal supports colors, and if it does, turns on -colored display. -@item always -@itemx yes -@itemx ansi8 -Turn on the color support unconditionally, and use color commands -specified by the ANSI escape sequences for the 8 standard colors. -@item @var{num} -Use color mode for @var{num} colors. If @var{num} is -1, turn off -color support (equivalent to @samp{never}); if it is 0, use the -default color support for this terminal (equivalent to @samp{auto}); -otherwise use an appropriate standard mode for @var{num} colors. -Depending on your terminal's capabilities, Emacs might be able to turn -on a color mode for 8, 16, 88, or 256 as the value of @var{num}. If -there is no mode that supports @var{num} colors, Emacs acts as if -@var{num} were 0, i.e.@: it uses the terminal's default color support -mode. -@end table -If @var{mode} is omitted, it defaults to @var{ansi8}. -@end table - - For example, to use a coral mouse cursor and a slate blue text cursor, -enter: - -@example -emacs -ms coral -cr 'slate blue' & -@end example - - You can reverse the foreground and background colors through the -@samp{-rv} option or with the X resource @samp{reverseVideo}. - - The @samp{-fg}, @samp{-bg}, and @samp{-rv} options function on -text-only terminals as well as on graphical displays. - -@node Window Size X -@appendixsec Options for Window Size and Position -@cindex geometry of Emacs window -@cindex position and size of Emacs frame -@cindex width and height of Emacs frame -@cindex specifying fullscreen for Emacs frame - - Here is a list of the command-line options for specifying size and -position of the initial Emacs frame: - -@table @samp -@item -g @var{width}x@var{height}@r{[@{}+-@r{@}}@var{xoffset}@r{@{}+-@r{@}}@var{yoffset}@r{]]} -@opindex -g -@itemx --geometry=@var{width}x@var{height}@r{[@{}+-@r{@}}@var{xoffset}@r{@{}+-@r{@}}@var{yoffset}@r{]]} -@opindex --geometry -@cindex geometry, command-line argument -Specify the size @var{width} and @var{height} (measured in character -columns and lines), and positions @var{xoffset} and @var{yoffset} -(measured in pixels). The @var{width} and @var{height} parameters -apply to all frames, whereas @var{xoffset} and @var{yoffset} only to -the initial frame. - -@item -fs -@opindex -fs -@itemx --fullscreen -@opindex --fullscreen -@cindex fullscreen, command-line argument -Specify that width and height shall be the size of the screen. - -@item -fh -@opindex -fh -@itemx --fullheight -@opindex --fullheight -@cindex fullheight, command-line argument -Specify that the height shall be the height of the screen. - -@item -fw -@opindex -fw -@itemx --fullwidth -@opindex --fullwidth -@cindex fullwidth, command-line argument -Specify that the width shall be the width of the screen. -@end table - - -@noindent -In the @samp{--geometry} option, @code{@r{@{}+-@r{@}}} means either a plus - sign or a minus sign. A plus -sign before @var{xoffset} means it is the distance from the left side of -the screen; a minus sign means it counts from the right side. A plus -sign before @var{yoffset} means it is the distance from the top of the -screen, and a minus sign there indicates the distance from the bottom. -The values @var{xoffset} and @var{yoffset} may themselves be positive or -negative, but that doesn't change their meaning, only their direction. - - Emacs uses the same units as @command{xterm} does to interpret the geometry. -The @var{width} and @var{height} are measured in characters, so a large font -creates a larger frame than a small font. (If you specify a proportional -font, Emacs uses its maximum bounds width as the width unit.) The -@var{xoffset} and @var{yoffset} are measured in pixels. - - You do not have to specify all of the fields in the geometry -specification. If you omit both @var{xoffset} and @var{yoffset}, the -window manager decides where to put the Emacs frame, possibly by -letting you place it with the mouse. For example, @samp{164x55} -specifies a window 164 columns wide, enough for two ordinary width -windows side by side, and 55 lines tall. - - The default width for Emacs is 80 characters and the default height is -40 lines. You can omit either the width or the height or both. If -you start the geometry with an integer, Emacs interprets it as the -width. If you start with an @samp{x} followed by an integer, Emacs -interprets it as the height. Thus, @samp{81} specifies just the width; -@samp{x45} specifies just the height. - - If you start with @samp{+} or @samp{-}, that introduces an offset, -which means both sizes are omitted. Thus, @samp{-3} specifies the -@var{xoffset} only. (If you give just one offset, it is always -@var{xoffset}.) @samp{+3-3} specifies both the @var{xoffset} and the -@var{yoffset}, placing the frame near the bottom left of the screen. - - You can specify a default for any or all of the fields in -@file{.Xdefaults} file, and then override selected fields with a -@samp{--geometry} option. - - Since the mode line and the echo area occupy the last 2 lines of the -frame, the height of the initial text window is 2 less than the height -specified in your geometry. In non-X-toolkit versions of Emacs, the -menu bar also takes one line of the specified number. But in the X -toolkit version, the menu bar is additional and does not count against -the specified height. The tool bar, if present, is also additional. - - Enabling or disabling the menu bar or tool bar alters the amount of -space available for ordinary text. Therefore, if Emacs starts up with -a tool bar (which is the default), and handles the geometry -specification assuming there is a tool bar, and then your -@file{~/.emacs} file disables the tool bar, you will end up with a -frame geometry different from what you asked for. To get the intended -size with no tool bar, use an X resource to specify ``no tool bar'' -(@pxref{Table of Resources}); then Emacs will already know there's no -tool bar when it processes the specified geometry. - - When using one of @samp{--fullscreen}, @samp{--fullwidth} or -@samp{--fullheight} there may be some space around the frame -anyway. That is because Emacs rounds the sizes so they are an -even number of character heights and widths. - - Some window managers have options that can make them ignore both -program-specified and user-specified positions (sawfish is one). -If these are set, Emacs fails to position the window correctly. - -@node Borders X -@appendixsec Internal and External Borders -@cindex borders (X Window System) - - An Emacs frame has an internal border and an external border. The -internal border is an extra strip of the background color around the -text portion of the frame. Emacs itself draws the internal border. -The external border is added by the window manager outside the frame; -depending on the window manager you use, it may contain various boxes -you can click on to move or iconify the window. - -@table @samp -@item -ib @var{width} -@opindex -ib -@itemx --internal-border=@var{width} -@opindex --internal-border -@cindex internal border width, command-line argument -Specify @var{width} as the width of the internal border (between the text -and the main border), in pixels. - -@item -bw @var{width} -@opindex -bw -@itemx --border-width=@var{width} -@opindex --border-width -@cindex main border width, command-line argument -Specify @var{width} as the width of the main border, in pixels. -@end table - - When you specify the size of the frame, that does not count the -borders. The frame's position is measured from the outside edge of the -external border. - - Use the @samp{-ib @var{n}} option to specify an internal border -@var{n} pixels wide. The default is 1. Use @samp{-bw @var{n}} to -specify the width of the external border (though the window manager may -not pay attention to what you specify). The default width of the -external border is 2. - -@node Title X -@appendixsec Frame Titles - - An Emacs frame may or may not have a specified title. The frame -title, if specified, appears in window decorations and icons as the -name of the frame. If an Emacs frame has no specified title, the -default title has the form @samp{@var{invocation-name}@@@var{machine}} -(if there is only one frame) or the selected window's buffer name (if -there is more than one frame). - - You can specify a title for the initial Emacs frame with a command -line option: - -@table @samp -@item -T @var{title} -@opindex -T -@itemx --title=@var{title} -@opindex --title -@cindex frame title, command-line argument -Specify @var{title} as the title for the initial Emacs frame. -@end table - - The @samp{--name} option (@pxref{Resources}) also specifies the title -for the initial Emacs frame. - -@node Icons X -@appendixsec Icons -@cindex icons (X Window System) - - Most window managers allow you to ``iconify'' a frame, removing -it from sight, and leaving a small, distinctive ``icon'' window in its -place. Clicking on the icon window makes the frame itself appear again. -If you have many clients running at once, you can avoid cluttering up -the screen by iconifying most of the clients. - -@table @samp -@item -nbi -@opindex -nbi -@itemx --no-bitmap-icon -@opindex --no-bitmap-icon -@cindex Emacs icon, a gnu -Do not use a picture of a gnu as the Emacs icon. - -@item -iconic -@opindex --iconic -@itemx --iconic -@cindex start iconified, command-line argument -Start Emacs in iconified state. -@end table - - By default Emacs uses an icon window containing a picture of the GNU gnu. -The @samp{-nbi} or @samp{--no-bitmap-icon} option tells Emacs to let the -window manager choose what sort of icon to use---usually just a small -rectangle containing the frame's title. - - The @samp{-iconic} option tells Emacs to begin running as an icon, -rather than showing a frame right away. In this situation, the icon -is the only indication that Emacs has started; the text frame doesn't -appear until you deiconify it. - -@node Misc X -@appendixsec Other Display Options - -@table @samp -@item -hb -@opindex -hb -@itemx --horizontal-scroll-bars -@opindex --horizontal-scroll-bars -@c @cindex horizontal scroll bars, command-line argument -Enable horizontal scroll bars. Since horizontal scroll bars -are not yet implemented, this actually does nothing. - -@item -vb -@opindex -vb -@itemx --vertical-scroll-bars -@opindex --vertical-scroll-bars -@cindex vertical scroll bars, command-line argument -Enable vertical scroll bars. - -@item -lsp @var{pixels} -@opindex -lsp -@itemx --line-spacing=@var{pixels} -@opindex --line-spacing -@cindex line spacing, command-line argument -Specify @var{pixels} as additional space to put between lines, in pixels. - -@item -nbc -@opindex -nbc -@itemx --no-blinking-cursor -@opindex --no-blinking-cursor -@cindex blinking cursor disable, command-line argument -Disable the blinking cursor on graphical displays. - -@item -D -@opindex -D -@itemx --basic-display -@opindex --basic-display -Disable the menu-bar, the tool-bar, the scroll-bars, and tool tips, -and turn off the blinking cursor. This can be useful for making a -test case that simplifies debugging of display problems. -@end table - - The @samp{--xrm} option (@pxref{Resources}) specifies additional -X resource values. - -@ignore - arch-tag: fffecd9e-7329-4a51-a3cc-dd4a9889340e -@end ignore diff --git a/man/custom.texi b/man/custom.texi deleted file mode 100644 index 3ab3ff0f636..00000000000 --- a/man/custom.texi +++ /dev/null @@ -1,2512 +0,0 @@ -@c This is part of the Emacs manual. -@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001, -@c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. -@c See file emacs.texi for copying conditions. -@node Customization, Quitting, Amusements, Top -@chapter Customization -@cindex customization - - This chapter talks about various topics relevant to adapting the -behavior of Emacs in ways we have anticipated. -@iftex -See @cite{The Emacs Lisp Reference Manual} -@end iftex -@ifnottex -@xref{Top, Emacs Lisp, Emacs Lisp, elisp, The Emacs Lisp -Reference Manual}, -@end ifnottex -for how to make more far-reaching and open-ended changes. @xref{X -Resources}, for information on using X resources to customize Emacs. - - Customization that you do within Emacs normally affects only the -particular Emacs session that you do it in---it does not persist -between sessions unless you save the customization in a file such as -your init file (@file{.emacs}) that will affect future sessions. -(@xref{Init File}.) When you tell the customization buffer to save -customizations for future sessions, this actually works by editing -@file{.emacs} for you. - - Another means of customization is the keyboard macro, which is a -sequence of keystrokes to be replayed with a single command. -@xref{Keyboard Macros}, for full instruction how to record, manage, and -replay sequences of keys. - -@menu -* Minor Modes:: Each minor mode is one feature you can turn on - independently of any others. -* Easy Customization:: Convenient way to browse and change settings. -* Variables:: Many Emacs commands examine Emacs variables - to decide what to do; by setting variables, - you can control their functioning. -* Key Bindings:: The keymaps say what command each key runs. - By changing them, you can "redefine keys". -* Syntax:: The syntax table controls how words and - expressions are parsed. -* Init File:: How to write common customizations in the - @file{.emacs} file. -@end menu - -@node Minor Modes -@section Minor Modes -@cindex minor modes -@cindex mode, minor - - Minor modes are optional features which you can turn on or off. For -example, Auto Fill mode is a minor mode in which @key{SPC} breaks lines -between words as you type. All the minor modes are independent of each -other and of the selected major mode. Most minor modes say in the mode -line when they are enabled; for example, @samp{Fill} in the mode line means -that Auto Fill mode is enabled. - - You should append @code{-mode} to the name of a minor mode to -produce the name of the command that turns the mode on or off. Thus, -the command to enable or disable Auto Fill mode is called -@code{auto-fill-mode}. These commands are usually invoked with -@kbd{M-x}, but you can bind keys to them if you wish. - - With no argument, the minor mode function turns the mode on if it -was off, and off if it was on. This is known as @dfn{toggling}. A -positive argument always turns the mode on, and an explicit zero -argument or a negative argument always turns it off. - - Some minor modes are global: while enabled, they affect everything -you do in the Emacs session, in all buffers. Other minor modes are -buffer-local; they apply only to the current buffer, so you can enable -the mode in certain buffers and not others. - - For most minor modes, the command name is also the name of a -variable. The variable's value is non-@code{nil} if the mode is -enabled and @code{nil} if it is disabled. Some minor-mode commands -work by just setting the variable. For example, the command -@code{abbrev-mode} works by setting the value of @code{abbrev-mode} as -a variable; it is this variable that directly turns Abbrev mode on and -off. You can directly set the variable's value instead of calling the -mode function. For other minor modes, you need to either set the -variable through the Customize interface or call the mode function to -correctly enable or disable the mode. To check which of these two -possibilities applies to a given minor mode, use @kbd{C-h v} to ask -for documentation on the variable name. - - For minor mode commands that work by just setting the minor mode -variable, that variable provides a good way for Lisp programs to turn -minor modes on and off; it is also useful in a file's local variables -list (@pxref{File Variables}). But please think twice before setting -minor modes with a local variables list, because most minor modes are -a matter of user preference---other users editing the same file might -not want the same minor modes you prefer. - - The most useful buffer-local minor modes include Abbrev mode, Auto -Fill mode, Auto Save mode, Font-Lock mode, Glasses mode, Outline minor -mode, Overwrite mode, and Binary Overwrite mode. - - Abbrev mode allows you to define abbreviations that automatically expand -as you type them. For example, @samp{amd} might expand to @samp{abbrev -mode}. @xref{Abbrevs}, for full information. - - Auto Fill mode allows you to enter filled text without breaking lines -explicitly. Emacs inserts newlines as necessary to prevent lines from -becoming too long. @xref{Filling}. - - Auto Save mode saves the buffer contents periodically to reduce the -amount of work you can lose in case of a crash. @xref{Auto Save}. - - Enriched mode enables editing and saving of formatted text. -@xref{Formatted Text}. - - Flyspell mode automatically highlights misspelled words. -@xref{Spelling}. - - Font-Lock mode automatically highlights certain textual units found -in programs, such as comments, strings, and function names being -defined. This requires a display that can show multiple fonts or -colors. @xref{Faces}. - -@ignore - ISO Accents mode makes the characters @samp{`}, @samp{'}, @samp{"}, -@samp{^}, @samp{/} and @samp{~} combine with the following letter, to -produce an accented letter in the ISO Latin-1 character set. The -newer and more general feature of input methods more or less -supersedes ISO Accents mode. @xref{Unibyte Mode}. -@end ignore - - Outline minor mode provides the same facilities as the major mode -called Outline mode; but since it is a minor mode instead, you can -combine it with any major mode. @xref{Outline Mode}. - -@cindex Overwrite mode -@cindex mode, Overwrite - Overwrite mode causes ordinary printing characters to replace existing -text instead of shoving it to the right. For example, if point is in -front of the @samp{B} in @samp{FOOBAR}, then in Overwrite mode typing a -@kbd{G} changes it to @samp{FOOGAR}, instead of producing @samp{FOOGBAR} -as usual. In Overwrite mode, the command @kbd{C-q} inserts the next -character whatever it may be, even if it is a digit---this gives you a -way to insert a character instead of replacing an existing character. - -@findex overwrite-mode -@kindex INSERT - The command @code{overwrite-mode} is an exception to the rule that -commands which toggle minor modes are normally not bound to keys: it is -bound to the @key{INSERT} function key. This is because many other -programs bind @key{INSERT} to similar functions. - -@findex binary-overwrite-mode - Binary Overwrite mode is a variant of Overwrite mode for editing -binary files; it treats newlines and tabs like other characters, so that -they overwrite other characters and can be overwritten by them. -In Binary Overwrite mode, digits after @kbd{C-q} specify an -octal character code, as usual. - - Here are some useful minor modes that normally apply to all buffers -at once. Since Line Number mode and Transient Mark mode can be -enabled or disabled just by setting the value of the minor mode -variable, you @emph{can} set them differently for particular buffers, -by explicitly making the corresponding variable local in those -buffers. @xref{Locals}. - - Icomplete mode displays an indication of available completions when -you are in the minibuffer and completion is active. @xref{Completion -Options}. - - Line Number mode enables continuous display in the mode line of the -line number of point, and Column Number mode enables display of the -column number. @xref{Mode Line}. - - Scroll Bar mode gives each window a scroll bar (@pxref{Scroll Bars}). -Menu Bar mode gives each frame a menu bar (@pxref{Menu Bars}). Both of -these modes are enabled by default when you use the X Window System. - - In Transient Mark mode, every change in the buffer contents -``deactivates'' the mark, so that commands that operate on the region -will get an error. This means you must either set the mark, or -explicitly ``reactivate'' it, before each command that uses the region. -The advantage of Transient Mark mode is that Emacs can display the -region highlighted. @xref{Mark}. - -@node Easy Customization -@section Easy Customization Interface - -@cindex settings - Emacs has many @dfn{settings} which have values that you can specify -in order to customize various commands. Many are documented in this -manual. Most settings are @dfn{user options}---that is to say, Lisp -variables (@pxref{Variables})---so their names appear in the Variable -Index (@pxref{Variable Index}). The other settings are faces and -their attributes (@pxref{Faces}). - -@findex customize -@cindex customization buffer - You can browse interactively through settings and change them using -@kbd{M-x customize}. This command creates a @dfn{customization -buffer}, which offers commands to navigate through a logically -organized structure of the Emacs settings; you can also use it to edit -and set their values, and to save settings permanently in your -@file{~/.emacs} file (@pxref{Init File}). - - The appearance of the example buffers in this section is typically -different under a graphical display, since faces are then used to indicate -buttons, links and editable fields. - -@menu -* Groups: Customization Groups. How settings are classified in a structure. -* Browsing: Browsing Custom. Browsing and searching for settings. -* Changing a Variable:: How to edit an option's value and set the option. -* Saving Customizations:: Specifying the file for saving customizations. -* Face Customization:: How to edit the attributes of a face. -* Specific Customization:: Making a customization buffer for specific - variables, faces, or groups. -* Custom Themes:: How to define collections of customized options - that can be loaded and unloaded together. -@end menu - -@node Customization Groups -@subsection Customization Groups -@cindex customization groups - - For customization purposes, settings are organized into @dfn{groups} -to help you find them. Groups are collected into bigger groups, all -the way up to a master group called @code{Emacs}. - - @kbd{M-x customize} creates a customization buffer that shows the -top-level @code{Emacs} group and the second-level groups immediately -under it. It looks like this, in part: - -@c we want the buffer example to all be on one page, but unfortunately -@c that's quite a bit of text, so force all space to the bottom. -@page -@smallexample -@group -/- Emacs group: ---------------------------------------------------\ - [State]: visible group members are all at standard values. - Customization of the One True Editor. - See also [Manual]. - -Editing group: [Go to Group] -Basic text editing facilities. - -External group: [Go to Group] -Interfacing to external utilities. - -@var{more second-level groups} - -\- Emacs group end ------------------------------------------------/ -@end group -@end smallexample - -@noindent -This says that the buffer displays the contents of the @code{Emacs} -group. The other groups are listed because they are its contents. But -they are listed differently, without indentation and dashes, because -@emph{their} contents are not included. Each group has a single-line -documentation string; the @code{Emacs} group also has a @samp{[State]} -line. - -@cindex editable fields (customization buffer) -@cindex buttons (customization buffer) -@cindex links (customization buffer) - Most of the text in the customization buffer is read-only, but it -typically includes some @dfn{editable fields} that you can edit. -There are also @dfn{buttons} and @dfn{links}, which do something when -you @dfn{invoke} them. To invoke a button or a link, either click on -it with @kbd{Mouse-1}, or move point to it and type @key{RET}. - - For example, the phrase @samp{[State]} that appears in -a second-level group is a button. It operates on the same -customization buffer. The phrase @samp{[Go to Group]} is a kind -of hypertext link to another group. Invoking it creates a new -customization buffer, which shows that group and its contents. - - The @code{Emacs} group includes a few settings, but mainly it -contains other groups, which contain more groups, which contain the -settings. By browsing the hierarchy of groups, you will eventually -find the feature you are interested in customizing. Then you can use -the customization buffer to set that feature's settings. You can also -go straight to a particular group by name, using the command @kbd{M-x -customize-group}. - -@node Browsing Custom -@subsection Browsing and Searching for Options and Faces -@findex customize-browse - - @kbd{M-x customize-browse} is another way to browse the available -settings. This command creates a special customization buffer which -shows only the names of groups and settings, and puts them in a -structure. - - In this buffer, you can show the contents of a group by invoking the -@samp{[+]} button. When the group contents are visible, this button -changes to @samp{[-]}; invoking that hides the group contents again. - - Each group or setting in this buffer has a link which says -@samp{[Group]}, @samp{[Option]} or @samp{[Face]}. Invoking this link -creates an ordinary customization buffer showing just that group and -its contents, just that user option, or just that face. This is the -way to change settings that you find with @kbd{M-x customize-browse}. - - If you can guess part of the name of the settings you are interested -in, @kbd{M-x customize-apropos} is another way to search for settings. -However, unlike @code{customize} and @code{customize-browse}, -@code{customize-apropos} can only find groups and settings that are -loaded in the current Emacs session. @xref{Specific Customization,, -Customizing Specific Items}. - -@node Changing a Variable -@subsection Changing a Variable - - Here is an example of what a variable (a user option) looks like in -the customization buffer: - -@smallexample -Kill Ring Max: [Hide Value] 60 - [State]: STANDARD. -Maximum length of kill ring before oldest elements are thrown away. -@end smallexample - - The text following @samp{[Hide Value]}, @samp{60} in this case, indicates -the current value of the variable. If you see @samp{[Show Value]} instead of -@samp{[Hide Value]}, it means that the value is hidden; the customization -buffer initially hides values that take up several lines. Invoke -@samp{[Show Value]} to show the value. - - The line after the variable name indicates the @dfn{customization -state} of the variable: in the example above, it says you have not -changed the option yet. The @samp{[State]} button at the beginning of -this line gives you a menu of various operations for customizing the -variable. - - The line after the @samp{[State]} line displays the beginning of the -variable's documentation string. If there are more lines of -documentation, this line ends with a @samp{[More]} button; invoke that -to show the full documentation string. - - To enter a new value for @samp{Kill Ring Max}, move point to the -value and edit it textually. For example, you can type @kbd{M-d}, -then insert another number. As you begin to alter the text, you will -see the @samp{[State]} line change to say that you have edited the -value: - -@smallexample -[State]: EDITED, shown value does not take effect until you set or @r{@dots{}} - save it. -@end smallexample - -@cindex user options, how to set -@cindex variables, how to set -@cindex settings, how to set - Editing the value does not actually set the variable. To do that, -you must @dfn{set} the variable. To do this, invoke the -@samp{[State]} button and choose @samp{Set for Current Session}. - - The state of the variable changes visibly when you set it: - -@smallexample -[State]: SET for current session only. -@end smallexample - - You don't have to worry about specifying a value that is not valid; -the @samp{Set for Current Session} operation checks for validity and -will not install an unacceptable value. - -@kindex M-TAB @r{(customization buffer)} -@findex widget-complete - While editing a field that is a file name, directory name, -command name, or anything else for which completion is defined, you -can type @kbd{M-@key{TAB}} (@code{widget-complete}) to do completion. -(@kbd{@key{ESC} @key{TAB}} and @kbd{C-M-i} do the same thing.) - - Some variables have a small fixed set of possible legitimate values. -These variables don't let you edit the value textually. Instead, a -@samp{[Value Menu]} button appears before the value; invoke this -button to change the value. For a boolean ``on or off'' value, the -button says @samp{[Toggle]}, and it changes to the other value. -@samp{[Value Menu]} and @samp{[Toggle]} simply edit the buffer; the -changes take real effect when you use the @samp{Set for Current -Session} operation. - - Some variables have values with complex structure. For example, the -value of @code{file-coding-system-alist} is an association list. Here -is how it appears in the customization buffer: - -@smallexample -File Coding System Alist: [Hide Value] -[INS] [DEL] File regexp: \.elc\' - Choice: [Value Menu] Encoding/decoding pair: - Decoding: emacs-mule - Encoding: emacs-mule -[INS] [DEL] File regexp: \(\`\|/\)loaddefs.el\' - Choice: [Value Menu] Encoding/decoding pair: - Decoding: raw-text - Encoding: raw-text-unix -[INS] [DEL] File regexp: \.tar\' - Choice: [Value Menu] Encoding/decoding pair: - Decoding: no-conversion - Encoding: no-conversion -[INS] [DEL] File regexp: - Choice: [Value Menu] Encoding/decoding pair: - Decoding: undecided - Encoding: nil -[INS] - [State]: STANDARD. -Alist to decide a coding system to use for a file I/O @r{@dots{}} - operation. [Hide Rest] -The format is ((PATTERN . VAL) ...), -where PATTERN is a regular expression matching a file name, -@r{[@dots{}more lines of documentation@dots{}]} -@end smallexample - -@noindent -Each association in the list appears on four lines, with several -editable fields and/or buttons. You can edit the regexps and coding -systems using ordinary editing commands. You can also invoke -@samp{[Value Menu]} to switch to a different kind of value---for -instance, to specify a function instead of a pair of coding systems. - -To delete an association from the list, invoke the @samp{[DEL]} button -for that item. To add an association, invoke @samp{[INS]} at the -position where you want to add it. There is an @samp{[INS]} button -between each pair of associations, another at the beginning and another -at the end, so you can add a new association at any position in the -list. - -@kindex TAB @r{(customization buffer)} -@kindex S-TAB @r{(customization buffer)} -@findex widget-forward -@findex widget-backward - Two special commands, @key{TAB} and @kbd{S-@key{TAB}}, are useful -for moving through the customization buffer. @key{TAB} -(@code{widget-forward}) moves forward to the next button or editable -field; @kbd{S-@key{TAB}} (@code{widget-backward}) moves backward to -the previous button or editable field. - - Typing @key{RET} on an editable field also moves forward, just like -@key{TAB}. We set it up this way because people often type @key{RET} -when they are finished editing a field. To insert a newline within an -editable field, use @kbd{C-o} or @kbd{C-q C-j}. - -@cindex saving a setting -@cindex settings, how to save - Setting the variable changes its value in the current Emacs session; -@dfn{saving} the value changes it for future sessions as well. To -save the variable, invoke @samp{[State]} and select the @samp{Save for -Future Sessions} operation. This works by writing code so as to set -the variable again, each time you start Emacs (@pxref{Saving -Customizations}). - - You can also restore the variable to its standard value by invoking -@samp{[State]} and selecting the @samp{Erase Customization} operation. -There are actually four reset operations: - -@table @samp -@item Undo Edits -If you have made some modifications and not yet set the variable, -this restores the text in the customization buffer to match -the actual value. - -@item Reset to Saved -This restores the value of the variable to the last saved value, -and updates the text accordingly. - -@item Erase Customization -This sets the variable to its standard value, and updates the text -accordingly. This also eliminates any saved value for the variable, -so that you will get the standard value in future Emacs sessions. - -@item Set to Backup Value -This sets the variable to a previous value that was set in the -customization buffer in this session. If you customize a variable -and then reset it, which discards the customized value, -you can get the discarded value back again with this operation. -@end table - -@cindex comments on customized settings - Sometimes it is useful to record a comment about a specific -customization. Use the @samp{Add Comment} item from the -@samp{[State]} menu to create a field for entering the comment. The -comment you enter will be saved, and displayed again if you again view -the same variable in a customization buffer, even in another session. - - The state of a group indicates whether anything in that group has been -edited, set or saved. - - Near the top of the customization buffer there are two lines of buttons: - -@smallexample - [Set for Current Session] [Save for Future Sessions] - [Undo Edits] [Reset to Saved] [Erase Customization] [Finish] -@end smallexample - -@vindex custom-buffer-done-function -@noindent -Invoking @samp{[Finish]} either buries or kills this customization -buffer according to the setting of the option -@code{custom-buffer-done-kill}; the default is to bury the buffer. -Each of the other buttons performs an operation---set, save or -reset---on each of the settings in the buffer that could meaningfully -be set, saved or reset. They do not operate on settings whose values -are hidden, nor on subgroups which are hidden or not visible in the buffer. - -@node Saving Customizations -@subsection Saving Customizations - - Saving customizations from the customization buffer works by writing -code that future sessions will read, code to set up those -customizations again. - -@vindex custom-file - Normally this saves customizations in your init file, -@file{~/.emacs}. If you wish, you can save customizations in another -file instead. To make this work, your @file{~/.emacs} should set -@code{custom-file} to the name of that file. Then you should load the -file by calling @code{load}. For example: - -@example -(setq custom-file "~/.emacs-custom.el") -(load custom-file) -@end example - - You can use @code{custom-file} to specify different customization -files for different Emacs versions, like this: - -@example -(cond ((< emacs-major-version 21) - ;; @r{Emacs 20 customization.} - (setq custom-file "~/.custom-20.el")) - ((and (= emacs-major-version 21) (< emacs-minor-version 4)) - ;; @r{Emacs 21 customization, before version 21.4.} - (setq custom-file "~/.custom-21.el")) - ((< emacs-major-version 22) - ;; @r{Emacs version 21.4 or later.} - (setq custom-file "~/.custom-21.4.el")) - (t - ;; @r{Emacs version 22.1 or later.} - (setq custom-file "~/.custom-22.el"))) - -(load custom-file) -@end example - - If Emacs was invoked with the @option{-q} or @option{--no-init-file} -options (@pxref{Initial Options}), it will not let you save your -customizations in your @file{~/.emacs} init file. This is because -saving customizations from such a session would wipe out all the other -customizations you might have on your init file. - -@node Face Customization -@subsection Customizing Faces -@cindex customizing faces -@cindex bold font -@cindex italic font -@cindex fonts and faces - - In addition to variables, some customization groups also include -faces. When you show the contents of a group, both the variables and -the faces in the group appear in the customization buffer. Here is an -example of how a face looks: - -@smallexample -Custom Changed Face:(sample) [Hide Face] - [State]: STANDARD. -Face used when the customize item has been changed. -Parent groups: [Custom Magic Faces] -Attributes: [ ] Font Family: * - [ ] Width: * - [ ] Height: * - [ ] Weight: * - [ ] Slant: * - [ ] Underline: * - [ ] Overline: * - [ ] Strike-through: * - [ ] Box around text: * - [ ] Inverse-video: * - [X] Foreground: white (sample) - [X] Background: blue (sample) - [ ] Stipple: * - [ ] Inherit: * -@end smallexample - - Each face attribute has its own line. The @samp{[@var{x}]} button -before the attribute name indicates whether the attribute is -@dfn{enabled}; @samp{[X]} means that it's enabled, and @samp{[ ]} -means that it's disabled. You can enable or disable the attribute by -clicking that button. When the attribute is enabled, you can change -the attribute value in the usual ways. - - For the colors, you can specify a color name (use @kbd{M-x -list-colors-display} for a list of them) or a hexadecimal color -specification of the form @samp{#@var{rr}@var{gg}@var{bb}}. -(@samp{#000000} is black, @samp{#ff0000} is red, @samp{#00ff00} is -green, @samp{#0000ff} is blue, and @samp{#ffffff} is white.) On a -black-and-white display, the colors you can use for the background are -@samp{black}, @samp{white}, @samp{gray}, @samp{gray1}, and -@samp{gray3}. Emacs supports these shades of gray by using background -stipple patterns instead of a color. - - Setting, saving and resetting a face work like the same operations for -variables (@pxref{Changing a Variable}). - - A face can specify different appearances for different types of -display. For example, a face can make text red on a color display, but -use a bold font on a monochrome display. To specify multiple -appearances for a face, select @samp{For All Kinds of Displays} in the -menu you get from invoking @samp{[State]}. - -@findex modify-face - Another more basic way to set the attributes of a specific face is -with @kbd{M-x modify-face}. This command reads the name of a face, then -reads the attributes one by one. For the color and stipple attributes, -the attribute's current value is the default---type just @key{RET} if -you don't want to change that attribute. Type @samp{none} if you want -to clear out the attribute. - -@node Specific Customization -@subsection Customizing Specific Items - - Instead of finding the setting you want to change by navigating the -structure of groups, here are other ways to specify the settings that -you want to customize. - -@table @kbd -@item M-x customize-option @key{RET} @var{option} @key{RET} -Set up a customization buffer with just one user option variable, -@var{option}. -@item M-x customize-face @key{RET} @var{face} @key{RET} -Set up a customization buffer with just one face, @var{face}. -@item M-x customize-group @key{RET} @var{group} @key{RET} -Set up a customization buffer with just one group, @var{group}. -@item M-x customize-apropos @key{RET} @var{regexp} @key{RET} -Set up a customization buffer with all the settings and groups that -match @var{regexp}. -@item M-x customize-changed @key{RET} @var{version} @key{RET} -Set up a customization buffer with all the settings and groups -whose meaning has changed since Emacs version @var{version}. -@item M-x customize-saved -Set up a customization buffer containing all settings that you -have saved with customization buffers. -@item M-x customize-unsaved -Set up a customization buffer containing all settings that you have -set but not saved. -@end table - -@findex customize-option - If you want to alter a particular user option with the customization -buffer, and you know its name, you can use the command @kbd{M-x -customize-option} and specify the user option (variable) name. This -sets up the customization buffer with just one user option---the one -that you asked for. Editing, setting and saving the value work as -described above, but only for the specified user option. Minibuffer -completion is handy if you only know part of the name. However, this -command can only see options that have been loaded in the current -Emacs session. - -@findex customize-face - Likewise, you can modify a specific face, chosen by name, using -@kbd{M-x customize-face}. By default it operates on the face used -on the character after point. - -@findex customize-group - You can also set up the customization buffer with a specific group, -using @kbd{M-x customize-group}. The immediate contents of the chosen -group, including settings (user options and faces), and other groups, -all appear as well (even if not already loaded). However, the -subgroups' own contents are not included. - -@findex customize-apropos - For a more general way of controlling what to customize, you can use -@kbd{M-x customize-apropos}. You specify a regular expression as -argument; then all @emph{loaded} settings and groups whose names match -this regular expression are set up in the customization buffer. If -you specify an empty regular expression, this includes @emph{all} -loaded groups and settings---which takes a long time to set up. - -@findex customize-changed - When you upgrade to a new Emacs version, you might want to consider -customizing new settings, and settings whose meanings or default -values have changed. To do this, use @kbd{M-x customize-changed} and -specify a previous Emacs version number using the minibuffer. It -creates a customization buffer which shows all the settings and groups -whose definitions have been changed since the specified version, -loading them if necessary. - -@findex customize-saved -@findex customize-unsaved - If you change settings and then decide the change was a mistake, you -can use two special commands to revisit your previous changes. Use -@kbd{M-x customize-saved} to look at the settings that you have saved. -Use @kbd{M-x customize-unsaved} to look at the settings that you -have set but not saved. - -@node Custom Themes -@subsection Customization Themes -@cindex custom themes - - @dfn{Custom themes} are collections of settings that can be enabled -or disabled as a unit. You can use Custom themes to switch quickly -and easily between various collections of settings, and to transfer -such collections from one computer to another. - -@findex customize-create-theme - To define a Custom theme, use @kbd{M-x customize-create-theme}, -which brings up a buffer named @samp{*New Custom Theme*}. At the top -of the buffer is an editable field where you can specify the name of -the theme. Click on the button labelled @samp{Insert Variable} to add -a variable to the theme, and click on @samp{Insert Face} to add a -face. You can edit these values in the @samp{*New Custom Theme*} -buffer like in an ordinary Customize buffer. To remove an option from -the theme, click on its @samp{State} button and select @samp{Delete}. - -@vindex custom-theme-directory - After adding the desired options, click on @samp{Save Theme} to save -the Custom theme. This writes the theme definition to a file -@file{@var{foo}-theme.el} (where @var{foo} is the theme name you -supplied), in the directory @file{~/.emacs.d/}. You can specify the -directory by setting @code{custom-theme-directory}. - - You can view and edit the settings of a previously-defined theme by -clicking on @samp{Visit Theme} and specifying the theme name. You can -also import the variables and faces that you have set using Customize -by visiting the ``special'' theme named @samp{user}. This theme, which -records all the options that you set in the ordinary customization -buffer, is always enabled, and always takes precedence over all other -enabled Custom themes. Additionally, the @samp{user} theme is -recorded with code in your @file{.emacs} file, rather than a -@file{user-theme.el} file. - -@vindex custom-enabled-themes - Once you have defined a Custom theme, you can use it by customizing -the variable @code{custom-enabled-themes}. This is a list of Custom -themes that are @dfn{enabled}, or put into effect. If you set -@code{custom-enabled-themes} using the Customize interface, the theme -definitions are automatically loaded from the theme files, if they -aren't already. If you save the value of @code{custom-enabled-themes} -for future Emacs sessions, those Custom themes will be enabled -whenever Emacs is started up. - - If two enabled themes specify different values for an option, the -theme occurring earlier in @code{custom-enabled-themes} takes effect. - -@findex load-theme -@findex enable-theme -@findex disable-theme - You can temporarily enable a Custom theme with @kbd{M-x -enable-theme}. This prompts for a theme name in the minibuffer, loads -the theme from the theme file if necessary, and enables the theme. -You can @dfn{disable} any enabled theme with the command @kbd{M-x -disable-theme}; this returns the options specified in the theme to -their original values. To re-enable the theme, type @kbd{M-x -enable-theme} again. If a theme file is changed during your Emacs -session, you can reload it by typing @kbd{M-x load-theme}. (This also -enables the theme.) - -@node Variables -@section Variables -@cindex variable -@cindex option, user -@cindex user option - - A @dfn{variable} is a Lisp symbol which has a value. The symbol's -name is also called the name of the variable. A variable name can -contain any characters that can appear in a file, but conventionally -variable names consist of words separated by hyphens. A variable can -have a documentation string which describes what kind of value it should -have and how the value will be used. - - Emacs Lisp allows any variable (with a few exceptions) to have any -kind of value, but most variables that Emacs uses expect a value of a -certain type. Often the value should always be a string, or should -always be a number. Sometimes we say that a certain feature is turned -on if a variable is ``non-@code{nil},'' meaning that if the variable's -value is @code{nil}, the feature is off, but the feature is on for -@emph{any} other value. The conventional value to use to turn on the -feature---since you have to pick one particular value when you set the -variable---is @code{t}. - - Emacs uses many Lisp variables for internal record keeping, but the -most interesting variables for a non-programmer user are those meant -for users to change---these are called @dfn{user options}. - - Each user option that you can set with the customization buffer is -in fact a Lisp variable. Emacs does not (usually) change the values -of these variables on its own; instead, you set the values in order to -control the behavior of certain Emacs commands. Use of the -customization buffer is explained above (@pxref{Easy Customization}); -here we describe other aspects of Emacs variables. - -@menu -* Examining:: Examining or setting one variable's value. -* Hooks:: Hook variables let you specify programs for parts - of Emacs to run on particular occasions. -* Locals:: Per-buffer values of variables. -* File Variables:: How files can specify variable values. -@end menu - -@node Examining -@subsection Examining and Setting Variables -@cindex setting variables - -@table @kbd -@item C-h v @var{var} @key{RET} -Display the value and documentation of variable @var{var} -(@code{describe-variable}). -@item M-x set-variable @key{RET} @var{var} @key{RET} @var{value} @key{RET} -Change the value of variable @var{var} to @var{value}. -@end table - - To examine the value of a single variable, use @kbd{C-h v} -(@code{describe-variable}), which reads a variable name using the -minibuffer, with completion. It displays both the value and the -documentation of the variable. For example, - -@example -C-h v fill-column @key{RET} -@end example - -@noindent -displays something like this: - -@smallexample -fill-column is a variable defined in `C source code'. -fill-column's value is 70 -Local in buffer custom.texi; global value is 70 -Automatically becomes buffer-local when set in any fashion. - -This variable is safe to use as a file local variable only if its value -satisfies the predicate `integerp'. - -Documentation: -*Column beyond which automatic line-wrapping should happen. -Interactively, you can set the buffer local value using C-x f. - -You can customize this variable. -@end smallexample - -@noindent -The line that says you can customize the variable indicates that this -variable is a user option. (The star also indicates this, but it is -an obsolete indicator that may eventually disappear.) @kbd{C-h v} is -not restricted to user options; it allows any variable name. - -@findex set-variable -The most convenient way to set a specific user option variable is with -@kbd{M-x set-variable}. This reads the variable name with the -minibuffer (with completion), and then reads a Lisp expression for the -new value using the minibuffer a second time (you can insert the old -value into the minibuffer for editing via @kbd{M-n}). For example, - -@example -M-x set-variable @key{RET} fill-column @key{RET} 75 @key{RET} -@end example - -@noindent -sets @code{fill-column} to 75. - - @kbd{M-x set-variable} is limited to user option variables, but you can -set any variable with a Lisp expression, using the function @code{setq}. -Here is a @code{setq} expression to set @code{fill-column}: - -@example -(setq fill-column 75) -@end example - - To execute an expression like this one, go to the @samp{*scratch*} -buffer, type in the expression, and then type @kbd{C-j}. @xref{Lisp -Interaction}. - - Setting variables, like all means of customizing Emacs except where -otherwise stated, affects only the current Emacs session. The only -way to alter the variable in future sessions is to put something in -the @file{~/.emacs} file to set it those sessions (@pxref{Init File}). - -@node Hooks -@subsection Hooks -@cindex hook -@cindex running a hook - - @dfn{Hooks} are an important mechanism for customization of Emacs. A -hook is a Lisp variable which holds a list of functions, to be called on -some well-defined occasion. (This is called @dfn{running the hook}.) -The individual functions in the list are called the @dfn{hook functions} -of the hook. With rare exceptions, hooks in Emacs are empty when Emacs -starts up, so the only hook functions in any given hook are the ones you -explicitly put there as customization. - - Most major modes run one or more @dfn{mode hooks} as the last step of -initialization. This makes it easy for you to customize the behavior of -the mode, by setting up a hook function to override the local variable -assignments already made by the mode. But hooks are also used in other -contexts. For example, the hook @code{suspend-hook} runs just before -Emacs suspends itself (@pxref{Exiting}). - -@cindex normal hook - Most Emacs hooks are @dfn{normal hooks}. This means that running the -hook operates by calling all the hook functions, unconditionally, with -no arguments. We have made an effort to keep most hooks normal so that -you can use them in a uniform way. Every variable in Emacs whose name -ends in @samp{-hook} is a normal hook. - -@cindex abnormal hook - There are also a few @dfn{abnormal hooks}. These variables' names end -in @samp{-hooks} or @samp{-functions}, instead of @samp{-hook}. What -makes these hooks abnormal is that there is something peculiar about the -way its functions are called---perhaps they are given arguments, or -perhaps the values they return are used in some way. For example, -@code{find-file-not-found-functions} (@pxref{Visiting}) is abnormal because -as soon as one hook function returns a non-@code{nil} value, the rest -are not called at all. The documentation of each abnormal hook variable -explains in detail what is peculiar about it. - -@findex add-hook - You can set a hook variable with @code{setq} like any other Lisp -variable, but the recommended way to add a hook function to a hook -(either normal or abnormal) is by calling @code{add-hook}. -@xref{Hooks,,, elisp, The Emacs Lisp Reference Manual}. - - For example, here's how to set up a hook to turn on Auto Fill mode -when entering Text mode and other modes based on Text mode: - -@example -(add-hook 'text-mode-hook 'turn-on-auto-fill) -@end example - - The next example shows how to use a hook to customize the indentation -of C code. (People often have strong personal preferences for one -format compared to another.) Here the hook function is an anonymous -lambda expression. - -@example -@group -(setq my-c-style - '((c-comment-only-line-offset . 4) -@end group -@group - (c-cleanup-list . (scope-operator - empty-defun-braces - defun-close-semi)) -@end group -@group - (c-offsets-alist . ((arglist-close . c-lineup-arglist) - (substatement-open . 0))))) -@end group - -@group -(add-hook 'c-mode-common-hook - '(lambda () - (c-add-style "my-style" my-c-style t))) -@end group -@end example - - It is best to design your hook functions so that the order in which -they are executed does not matter. Any dependence on the order is -``asking for trouble.'' However, the order is predictable: the most -recently added hook functions are executed first. - -@findex remove-hook - If you play with adding various different versions of a hook -function by calling @code{add-hook} over and over, remember that all -the versions you added will remain in the hook variable together. You -can clear out individual functions by calling @code{remove-hook}, or -do @code{(setq @var{hook-variable} nil)} to remove everything. - -@node Locals -@subsection Local Variables - -@table @kbd -@item M-x make-local-variable @key{RET} @var{var} @key{RET} -Make variable @var{var} have a local value in the current buffer. -@item M-x kill-local-variable @key{RET} @var{var} @key{RET} -Make variable @var{var} use its global value in the current buffer. -@item M-x make-variable-buffer-local @key{RET} @var{var} @key{RET} -Mark variable @var{var} so that setting it will make it local to the -buffer that is current at that time. -@end table - -@cindex local variables - Almost any variable can be made @dfn{local} to a specific Emacs -buffer. This means that its value in that buffer is independent of its -value in other buffers. A few variables are always local in every -buffer. Every other Emacs variable has a @dfn{global} value which is in -effect in all buffers that have not made the variable local. - -@findex make-local-variable - @kbd{M-x make-local-variable} reads the name of a variable and makes -it local to the current buffer. Changing its value subsequently in -this buffer will not affect others, and changes in its global value -will not affect this buffer. - -@findex make-variable-buffer-local -@cindex per-buffer variables - @kbd{M-x make-variable-buffer-local} marks a variable so it will -become local automatically whenever it is set. More precisely, once a -variable has been marked in this way, the usual ways of setting the -variable automatically do @code{make-local-variable} first. We call -such variables @dfn{per-buffer} variables. Many variables in Emacs -are normally per-buffer; the variable's document string tells you when -this is so. A per-buffer variable's global value is normally never -effective in any buffer, but it still has a meaning: it is the initial -value of the variable for each new buffer. - - Major modes (@pxref{Major Modes}) always make variables local to the -buffer before setting the variables. This is why changing major modes -in one buffer has no effect on other buffers. Minor modes also work -by setting variables---normally, each minor mode has one controlling -variable which is non-@code{nil} when the mode is enabled -(@pxref{Minor Modes}). For many minor modes, the controlling variable -is per buffer, and thus always buffer-local. Otherwise, you can make -it local in a specific buffer like any other variable. - - A few variables cannot be local to a buffer because they are always -local to each display instead (@pxref{Multiple Displays}). If you try to -make one of these variables buffer-local, you'll get an error message. - -@findex kill-local-variable - @kbd{M-x kill-local-variable} makes a specified variable cease to be -local to the current buffer. The global value of the variable -henceforth is in effect in this buffer. Setting the major mode kills -all the local variables of the buffer except for a few variables -specially marked as @dfn{permanent locals}. - -@findex setq-default - To set the global value of a variable, regardless of whether the -variable has a local value in the current buffer, you can use the Lisp -construct @code{setq-default}. This construct is used just like -@code{setq}, but it sets variables' global values instead of their local -values (if any). When the current buffer does have a local value, the -new global value may not be visible until you switch to another buffer. -Here is an example: - -@example -(setq-default fill-column 75) -@end example - -@noindent -@code{setq-default} is the only way to set the global value of a variable -that has been marked with @code{make-variable-buffer-local}. - -@findex default-value - Lisp programs can use @code{default-value} to look at a variable's -default value. This function takes a symbol as argument and returns its -default value. The argument is evaluated; usually you must quote it -explicitly. For example, here's how to obtain the default value of -@code{fill-column}: - -@example -(default-value 'fill-column) -@end example - -@node File Variables -@subsection Local Variables in Files -@cindex local variables in files -@cindex file local variables - - A file can specify local variable values for use when you edit the -file with Emacs. Visiting the file checks for local variable -specifications; it automatically makes these variables local to the -buffer, and sets them to the values specified in the file. - -@menu -* Specifying File Variables:: Specifying file local variables. -* Safe File Variables:: Making sure file local variables are safe. -@end menu - -@node Specifying File Variables -@subsubsection Specifying File Variables - - There are two ways to specify file local variable values: in the first -line, or with a local variables list. Here's how to specify them in the -first line: - -@example --*- mode: @var{modename}; @var{var}: @var{value}; @dots{} -*- -@end example - -@noindent -You can specify any number of variables/value pairs in this way, each -pair with a colon and semicolon as shown above. @code{mode: -@var{modename};} specifies the major mode; this should come first in the -line. The @var{value}s are not evaluated; they are used literally. -Here is an example that specifies Lisp mode and sets two variables with -numeric values: - -@smallexample -;; -*- mode: Lisp; fill-column: 75; comment-column: 50; -*- -@end smallexample - - You can also specify the coding system for a file in this way: just -specify a value for the ``variable'' named @code{coding}. The ``value'' -must be a coding system name that Emacs recognizes. @xref{Coding -Systems}. @w{@samp{unibyte: t}} specifies unibyte loading for a -particular Lisp file. @xref{Enabling Multibyte}. - - The @code{eval} pseudo-variable, described below, can be specified in -the first line as well. - -@cindex shell scripts, and local file variables - In shell scripts, the first line is used to identify the script -interpreter, so you cannot put any local variables there. To -accommodate this, Emacs looks for local variable specifications in the -@emph{second} line when the first line specifies an interpreter. - - A @dfn{local variables list} goes near the end of the file, in the -last page. (It is often best to put it on a page by itself.) The local -variables list starts with a line containing the string @samp{Local -Variables:}, and ends with a line containing the string @samp{End:}. In -between come the variable names and values, one set per line, as -@samp{@var{variable}:@: @var{value}}. The @var{value}s are not -evaluated; they are used literally. If a file has both a local -variables list and a @samp{-*-} line, Emacs processes @emph{everything} -in the @samp{-*-} line first, and @emph{everything} in the local -variables list afterward. - - Here is an example of a local variables list: - -@example -;; Local Variables: ** -;; mode:lisp ** -;; comment-column:0 ** -;; comment-start: ";; " ** -;; comment-end:"**" ** -;; End: ** -@end example - - Each line starts with the prefix @samp{;; } and each line ends with -the suffix @samp{ **}. Emacs recognizes these as the prefix and -suffix based on the first line of the list, by finding them -surrounding the magic string @samp{Local Variables:}; then it -automatically discards them from the other lines of the list. - - The usual reason for using a prefix and/or suffix is to embed the -local variables list in a comment, so it won't confuse other programs -that the file is intended as input for. The example above is for a -language where comment lines start with @samp{;; } and end with -@samp{**}; the local values for @code{comment-start} and -@code{comment-end} customize the rest of Emacs for this unusual -syntax. Don't use a prefix (or a suffix) if you don't need one. - - If you write a multi-line string value, you should put the prefix -and suffix on each line, even lines that start or end within the -string. They will be stripped off for processing the list. If you -want to split a long string across multiple lines of the file, you can -use backslash-newline, which is ignored in Lisp string constants. -Here's an example of doing this: - -@example -# Local Variables: -# compile-command: "cc foo.c -Dfoo=bar -Dhack=whatever \ -# -Dmumble=blaah" -# End: -@end example - - Some ``variable names'' have special meanings in a local variables -list. Specifying the ``variable'' @code{mode} really sets the major -mode, while any value specified for the ``variable'' @code{eval} is -simply evaluated as an expression (its value is ignored). A value for -@code{coding} specifies the coding system for character code -conversion of this file, and a value of @code{t} for @code{unibyte} -says to visit the file in a unibyte buffer. These four ``variables'' -are not really variables; setting them in any other context has no -special meaning. - - @emph{If @code{mode} is used to set a major mode, it should be the -first ``variable'' in the list.} Otherwise, the entries that precede -it will usually be ignored, since most modes kill all local variables -as part of their initialization. - - You can use the @code{mode} ``variable'' to set minor modes as well -as the major modes; in fact, you can use it more than once, first to -set the major mode and then to set minor modes which are specific to -particular buffers. But most minor modes should not be specified in -the file at all, because they represent user preferences. - - For example, you may be tempted to try to turn on Auto Fill mode with -a local variable list. That is a mistake. The choice of Auto Fill mode -or not is a matter of individual taste, not a matter of the contents of -particular files. If you want to use Auto Fill, set up major mode hooks -with your @file{.emacs} file to turn it on (when appropriate) for you -alone (@pxref{Init File}). Don't use a local variable list to impose -your taste on everyone. - - The start of the local variables list must be no more than 3000 -characters from the end of the file, and must be in the last page if the -file is divided into pages. Otherwise, Emacs will not notice it is -there. The purpose of this rule is so that a stray @samp{Local -Variables:}@: not in the last page does not confuse Emacs, and so that -visiting a long file that is all one page and has no local variables -list need not take the time to search the whole file. - - Use the command @code{normal-mode} to reset the local variables and -major mode of a buffer according to the file name and contents, -including the local variables list if any. @xref{Choosing Modes}. - -@node Safe File Variables -@subsubsection Safety of File Variables - - File-local variables can be dangerous; when you visit someone else's -file, there's no telling what its local variables list could do to -your Emacs. Improper values of the @code{eval} ``variable,'' and -other variables such as @code{load-path}, could execute Lisp code you -didn't intend to run. - - Therefore, whenever Emacs encounters file local variable values that -are not known to be safe, it displays the file's entire local -variables list, and asks you for confirmation before setting them. -You can type @kbd{y} or @key{SPC} to put the local variables list into -effect, or @kbd{n} to ignore it. When Emacs is run in batch mode -(@pxref{Initial Options}), it can't really ask you, so it assumes the -answer @kbd{n}. - - Emacs normally recognizes certain variables/value pairs as safe. -For instance, it is safe to give @code{comment-column} or -@code{fill-column} any integer value. If a file specifies only -known-safe variable/value pairs, Emacs does not ask for confirmation -before setting them. Otherwise, you can tell Emacs to record all the -variable/value pairs in this file as safe, by typing @kbd{!} at the -confirmation prompt. When Emacs encounters these variable/value pairs -subsequently, in the same file or others, it will assume they are -safe. - -@vindex safe-local-variable-values -@cindex risky variable - Some variables, such as @code{load-path}, are considered -particularly @dfn{risky}: there is seldom any reason to specify them -as local variables, and changing them can be dangerous. Even if you -enter @kbd{!} at the confirmation prompt, Emacs will not record any -values as safe for these variables. If you really want to record safe -values for these variables, do it directly by customizing -@samp{safe-local-variable-values} (@pxref{Easy Customization}). - -@vindex enable-local-variables - The variable @code{enable-local-variables} allows you to change the -way Emacs processes local variables. Its default value is @code{t}, -which specifies the behavior described above. If it is @code{nil}, -Emacs simply ignores all file local variables. @code{:safe} means use -only the safe values and ignore the rest. Any other value says to -query you about each file that has local variables, without trying to -determine whether the values are known to be safe. - -@vindex enable-local-eval - The variable @code{enable-local-eval} controls whether Emacs -processes @code{eval} variables. The three possibilities for the -variable's value are @code{t}, @code{nil}, and anything else, just as -for @code{enable-local-variables}. The default is @code{maybe}, which -is neither @code{t} nor @code{nil}, so normally Emacs does ask for -confirmation about processing @code{eval} variables. - -@vindex safe-local-eval-forms - But there is an exception. The @code{safe-local-eval-forms} is a -customizable list of eval forms which are safe. Emacs does not ask -for confirmation when it finds these forms for the @code{eval} -variable. - -@node Key Bindings -@section Customizing Key Bindings -@cindex key bindings - - This section describes @dfn{key bindings}, which map keys to commands, -and @dfn{keymaps}, which record key bindings. It also explains how -to customize key bindings. - - Recall that a command is a Lisp function whose definition provides for -interactive use. Like every Lisp function, a command has a function -name, which usually consists of lower-case letters and hyphens. - -@menu -* Keymaps:: Generalities. The global keymap. -* Prefix Keymaps:: Keymaps for prefix keys. -* Local Keymaps:: Major and minor modes have their own keymaps. -* Minibuffer Maps:: The minibuffer uses its own local keymaps. -* Rebinding:: How to redefine one key's meaning conveniently. -* Init Rebinding:: Rebinding keys with your init file, @file{.emacs}. -* Function Keys:: Rebinding terminal function keys. -* Named ASCII Chars:: Distinguishing @key{TAB} from @kbd{C-i}, and so on. -* Mouse Buttons:: Rebinding mouse buttons in Emacs. -* Disabling:: Disabling a command means confirmation is required - before it can be executed. This is done to protect - beginners from surprises. -@end menu - -@node Keymaps -@subsection Keymaps -@cindex keymap - - The bindings between key sequences and command functions are recorded -in data structures called @dfn{keymaps}. Emacs has many of these, each -used on particular occasions. - - Recall that a @dfn{key sequence} (@dfn{key}, for short) is a sequence -of @dfn{input events} that have a meaning as a unit. Input events -include characters, function keys and mouse buttons---all the inputs -that you can send to the computer with your terminal. A key sequence -gets its meaning from its @dfn{binding}, which says what command it -runs. The function of keymaps is to record these bindings. - -@cindex global keymap - The @dfn{global} keymap is the most important keymap because it is -always in effect. The global keymap defines keys for Fundamental mode; -most of these definitions are common to most or all major modes. Each -major or minor mode can have its own keymap which overrides the global -definitions of some keys. - - For example, a self-inserting character such as @kbd{g} is -self-inserting because the global keymap binds it to the command -@code{self-insert-command}. The standard Emacs editing characters such -as @kbd{C-a} also get their standard meanings from the global keymap. -Commands to rebind keys, such as @kbd{M-x global-set-key}, actually work -by storing the new binding in the proper place in the global map. -@xref{Rebinding}. - - Meta characters work differently; Emacs translates each Meta -character into a pair of characters starting with @key{ESC}. When you -type the character @kbd{M-a} in a key sequence, Emacs replaces it with -@kbd{@key{ESC} a}. A meta key comes in as a single input event, but -becomes two events for purposes of key bindings. The reason for this is -historical, and we might change it someday. - -@cindex function key - Most modern keyboards have function keys as well as character keys. -Function keys send input events just as character keys do, and keymaps -can have bindings for them. - - On text terminals, typing a function key actually sends the computer a -sequence of characters; the precise details of the sequence depends on -which function key and on the model of terminal you are using. (Often -the sequence starts with @kbd{@key{ESC} [}.) If Emacs understands your -terminal type properly, it recognizes the character sequences forming -function keys wherever they occur in a key sequence (not just at the -beginning). Thus, for most purposes, you can pretend the function keys -reach Emacs directly and ignore their encoding as character sequences. - -@cindex mouse - Mouse buttons also produce input events. These events come with other -data---the window and position where you pressed or released the button, -and a time stamp. But only the choice of button matters for key -bindings; the other data matters only if a command looks at it. -(Commands designed for mouse invocation usually do look at the other -data.) - - A keymap records definitions for single events. Interpreting a key -sequence of multiple events involves a chain of keymaps. The first -keymap gives a definition for the first event; this definition is -another keymap, which is used to look up the second event in the -sequence, and so on. - - Key sequences can mix function keys and characters. For example, -@kbd{C-x @key{SELECT}} is meaningful. If you make @key{SELECT} a prefix -key, then @kbd{@key{SELECT} C-n} makes sense. You can even mix mouse -events with keyboard events, but we recommend against it, because such -key sequences are inconvenient to use. - - As a user, you can redefine any key; but it is usually best to stick -to key sequences that consist of @kbd{C-c} followed by a letter (upper -or lower case). These keys are ``reserved for users,'' so they won't -conflict with any properly designed Emacs extension. The function -keys @key{F5} through @key{F9} are also reserved for users. If you -redefine some other key, your definition may be overridden by certain -extensions or major modes which redefine the same key. - -@node Prefix Keymaps -@subsection Prefix Keymaps - - A prefix key such as @kbd{C-x} or @key{ESC} has its own keymap, -which holds the definition for the event that immediately follows -that prefix. - - The definition of a prefix key is usually the keymap to use for -looking up the following event. The definition can also be a Lisp -symbol whose function definition is the following keymap; the effect is -the same, but it provides a command name for the prefix key that can be -used as a description of what the prefix key is for. Thus, the binding -of @kbd{C-x} is the symbol @code{Control-X-prefix}, whose function -definition is the keymap for @kbd{C-x} commands. The definitions of -@kbd{C-c}, @kbd{C-x}, @kbd{C-h} and @key{ESC} as prefix keys appear in -the global map, so these prefix keys are always available. - - Aside from ordinary prefix keys, there is a fictitious ``prefix key'' -which represents the menu bar; see @ref{Menu Bar,,,elisp, The Emacs Lisp -Reference Manual}, for special information about menu bar key bindings. -Mouse button events that invoke pop-up menus are also prefix keys; see -@ref{Menu Keymaps,,,elisp, The Emacs Lisp Reference Manual}, for more -details. - - Some prefix keymaps are stored in variables with names: - -@itemize @bullet -@item -@vindex ctl-x-map -@code{ctl-x-map} is the variable name for the map used for characters that -follow @kbd{C-x}. -@item -@vindex help-map -@code{help-map} is for characters that follow @kbd{C-h}. -@item -@vindex esc-map -@code{esc-map} is for characters that follow @key{ESC}. Thus, all Meta -characters are actually defined by this map. -@item -@vindex ctl-x-4-map -@code{ctl-x-4-map} is for characters that follow @kbd{C-x 4}. -@item -@vindex mode-specific-map -@code{mode-specific-map} is for characters that follow @kbd{C-c}. -@end itemize - -@node Local Keymaps -@subsection Local Keymaps - -@cindex local keymap - So far we have explained the ins and outs of the global map. Major -modes customize Emacs by providing their own key bindings in @dfn{local -keymaps}. For example, C mode overrides @key{TAB} to make it indent the -current line for C code. Portions of text in the buffer can specify -their own keymaps to substitute for the keymap of the buffer's major -mode. - -@cindex minor mode keymap - Minor modes can also have local keymaps. Whenever a minor mode is -in effect, the definitions in its keymap override both the major -mode's local keymap and the global keymap. - - A local keymap can locally redefine a key as a prefix key by defining -it as a prefix keymap. If the key is also defined globally as a prefix, -then its local and global definitions (both keymaps) effectively -combine: both of them are used to look up the event that follows the -prefix key. Thus, if the mode's local keymap defines @kbd{C-c} as -another keymap, and that keymap defines @kbd{C-z} as a command, this -provides a local meaning for @kbd{C-c C-z}. This does not affect other -sequences that start with @kbd{C-c}; if those sequences don't have their -own local bindings, their global bindings remain in effect. - - Another way to think of this is that Emacs handles a multi-event key -sequence by looking in several keymaps, one by one, for a binding of the -whole key sequence. First it checks the minor mode keymaps for minor -modes that are enabled, then it checks the major mode's keymap, and then -it checks the global keymap. This is not precisely how key lookup -works, but it's good enough for understanding the results in ordinary -circumstances. - -@cindex rebinding major mode keys - Most major modes construct their keymaps when the mode is used for -the first time in a session. If you wish to change one of these -keymaps, you must use the major mode's @dfn{mode hook} -(@pxref{Hooks}). - -@findex define-key - For example, the command @code{texinfo-mode} to select Texinfo mode -runs the hook @code{texinfo-mode-hook}. Here's how you can use the hook -to add local bindings (not very useful, we admit) for @kbd{C-c n} and -@kbd{C-c p} in Texinfo mode: - -@example -(add-hook 'texinfo-mode-hook - '(lambda () - (define-key texinfo-mode-map "\C-cp" - 'backward-paragraph) - (define-key texinfo-mode-map "\C-cn" - 'forward-paragraph))) -@end example - -@node Minibuffer Maps -@subsection Minibuffer Keymaps - -@cindex minibuffer keymaps -@vindex minibuffer-local-map -@vindex minibuffer-local-ns-map -@vindex minibuffer-local-completion-map -@vindex minibuffer-local-must-match-map -@vindex minibuffer-local-filename-completion-map -@vindex minibuffer-local-must-match-filename-map - The minibuffer has its own set of local keymaps; they contain various -completion and exit commands. - -@itemize @bullet -@item -@code{minibuffer-local-map} is used for ordinary input (no completion). -@item -@code{minibuffer-local-ns-map} is similar, except that @key{SPC} exits -just like @key{RET}. This is used mainly for Mocklisp compatibility. -@item -@code{minibuffer-local-completion-map} is for permissive completion. -@item -@code{minibuffer-local-must-match-map} is for strict completion and -for cautious completion. -@item -Finally, @code{minibuffer-local-filename-completion-map} and -@code{minibuffer-local-must-match-filename-map} are like the two -previous ones, but they are specifically for file name completion. -They do not bind @key{SPC}. -@end itemize - -@node Rebinding -@subsection Changing Key Bindings Interactively -@cindex key rebinding, this session -@cindex redefining keys, this session - - The way to redefine an Emacs key is to change its entry in a keymap. -You can change the global keymap, in which case the change is effective in -all major modes (except those that have their own overriding local -definitions for the same key). Or you can change the current buffer's -local map, which affects all buffers using the same major mode. - -@findex global-set-key -@findex local-set-key -@findex global-unset-key -@findex local-unset-key -@table @kbd -@item M-x global-set-key @key{RET} @var{key} @var{cmd} @key{RET} -Define @var{key} globally to run @var{cmd}. -@item M-x local-set-key @key{RET} @var{key} @var{cmd} @key{RET} -Define @var{key} locally (in the major mode now in effect) to run -@var{cmd}. -@item M-x global-unset-key @key{RET} @var{key} -Make @var{key} undefined in the global map. -@item M-x local-unset-key @key{RET} @var{key} -Make @var{key} undefined locally (in the major mode now in effect). -@end table - - For example, suppose you like to execute commands in a subshell within -an Emacs buffer, instead of suspending Emacs and executing commands in -your login shell. Normally, @kbd{C-z} is bound to the function -@code{suspend-emacs} (when not using the X Window System), but you can -change @kbd{C-z} to invoke an interactive subshell within Emacs, by -binding it to @code{shell} as follows: - -@example -M-x global-set-key @key{RET} C-z shell @key{RET} -@end example - -@noindent -@code{global-set-key} reads the command name after the key. After you -press the key, a message like this appears so that you can confirm that -you are binding the key you want: - -@example -Set key C-z to command: -@end example - - You can redefine function keys and mouse events in the same way; just -type the function key or click the mouse when it's time to specify the -key to rebind. - - You can rebind a key that contains more than one event in the same -way. Emacs keeps reading the key to rebind until it is a complete key -(that is, not a prefix key). Thus, if you type @kbd{C-f} for -@var{key}, that's the end; it enters the minibuffer immediately to -read @var{cmd}. But if you type @kbd{C-x}, since that's a prefix, it -reads another character; if that is @kbd{4}, another prefix character, -it reads one more character, and so on. For example, - -@example -M-x global-set-key @key{RET} C-x 4 $ spell-other-window @key{RET} -@end example - -@noindent -redefines @kbd{C-x 4 $} to run the (fictitious) command -@code{spell-other-window}. - - The two-character keys consisting of @kbd{C-c} followed by a letter -are reserved for user customizations. Lisp programs are not supposed to -define these keys, so the bindings you make for them will be available -in all major modes and will never get in the way of anything. - - You can remove the global definition of a key with -@code{global-unset-key}. This makes the key @dfn{undefined}; if you -type it, Emacs will just beep. Similarly, @code{local-unset-key} makes -a key undefined in the current major mode keymap, which makes the global -definition (or lack of one) come back into effect in that major mode. - - If you have redefined (or undefined) a key and you subsequently wish -to retract the change, undefining the key will not do the job---you need -to redefine the key with its standard definition. To find the name of -the standard definition of a key, go to a Fundamental mode buffer in a -fresh Emacs and use @kbd{C-h c}. The documentation of keys in this -manual also lists their command names. - - If you want to prevent yourself from invoking a command by mistake, it -is better to disable the command than to undefine the key. A disabled -command is less work to invoke when you really want to. -@xref{Disabling}. - -@node Init Rebinding -@subsection Rebinding Keys in Your Init File - - If you have a set of key bindings that you like to use all the time, -you can specify them in your @file{.emacs} file by using their Lisp -syntax. (@xref{Init File}.) - - The simplest method for doing this works for @acronym{ASCII} characters and -Meta-modified @acronym{ASCII} characters only. This method uses a string to -represent the key sequence you want to rebind. For example, here's how -to bind @kbd{C-z} to @code{shell}: - -@example -(global-set-key "\C-z" 'shell) -@end example - -@noindent -This example uses a string constant containing one character, -@kbd{C-z}. (@samp{\C-} is string syntax for a control character.) The -single-quote before the command name, @code{shell}, marks it as a -constant symbol rather than a variable. If you omit the quote, Emacs -would try to evaluate @code{shell} immediately as a variable. This -probably causes an error; it certainly isn't what you want. - - Here is another example that binds the key sequence @kbd{C-x M-l}: - -@example -(global-set-key "\C-x\M-l" 'make-symbolic-link) -@end example - - To put @key{TAB}, @key{RET}, @key{ESC}, or @key{DEL} in the -string, you can use the Emacs Lisp escape sequences, @samp{\t}, -@samp{\r}, @samp{\e}, and @samp{\d}. Here is an example which binds -@kbd{C-x @key{TAB}}: - -@example -(global-set-key "\C-x\t" 'indent-rigidly) -@end example - - These examples show how to write some other special @acronym{ASCII} characters -in strings for key bindings: - -@example -(global-set-key "\r" 'newline) ;; @key{RET} -(global-set-key "\d" 'delete-backward-char) ;; @key{DEL} -(global-set-key "\C-x\e\e" 'repeat-complex-command) ;; @key{ESC} -@end example - - When the key sequence includes function keys or mouse button events, -or non-@acronym{ASCII} characters such as @code{C-=} or @code{H-a}, you must use -the more general method of rebinding, which uses a vector to specify the -key sequence. - - The way to write a vector in Emacs Lisp is with square brackets around -the vector elements. Use spaces to separate the elements. If an -element is a symbol, simply write the symbol's name---no other -delimiters or punctuation are needed. If a vector element is a -character, write it as a Lisp character constant: @samp{?} followed by -the character as it would appear in a string. - - Here are examples of using vectors to rebind @kbd{C-=} (a control -character not in @acronym{ASCII}), @kbd{C-M-=} (not in @acronym{ASCII} because @kbd{C-=} -is not), @kbd{H-a} (a Hyper character; @acronym{ASCII} doesn't have Hyper at -all), @key{F7} (a function key), and @kbd{C-Mouse-1} (a -keyboard-modified mouse button): - -@example -(global-set-key [?\C-=] 'make-symbolic-link) -(global-set-key [?\M-\C-=] 'make-symbolic-link) -(global-set-key [?\H-a] 'make-symbolic-link) -(global-set-key [f7] 'make-symbolic-link) -(global-set-key [C-mouse-1] 'make-symbolic-link) -@end example - - You can use a vector for the simple cases too. Here's how to -rewrite the first six examples above to use vectors: - -@example -(global-set-key [?\C-z] 'shell) -(global-set-key [?\C-x ?l] 'make-symbolic-link) -(global-set-key [?\C-x ?\t] 'indent-rigidly) -(global-set-key [?\r] 'newline) -(global-set-key [?\d] 'delete-backward-char) -(global-set-key [?\C-x ?\e ?\e] 'repeat-complex-command) -@end example - -@noindent -As you see, you represent a multi-character key sequence with a vector -by listing all of the characters, in order, within the square brackets -that delimit the vector. - - Language and coding systems can cause problems with key bindings -for non-@acronym{ASCII} characters. @xref{Init Non-ASCII}. - -@node Function Keys -@subsection Rebinding Function Keys - - Key sequences can contain function keys as well as ordinary -characters. Just as Lisp characters (actually integers) represent -keyboard characters, Lisp symbols represent function keys. If the -function key has a word as its label, then that word is also the name of -the corresponding Lisp symbol. Here are the conventional Lisp names for -common function keys: - -@table @asis -@item @code{left}, @code{up}, @code{right}, @code{down} -Cursor arrow keys. - -@item @code{begin}, @code{end}, @code{home}, @code{next}, @code{prior} -Other cursor repositioning keys. - -@item @code{select}, @code{print}, @code{execute}, @code{backtab} -@itemx @code{insert}, @code{undo}, @code{redo}, @code{clearline} -@itemx @code{insertline}, @code{deleteline}, @code{insertchar}, @code{deletechar} -Miscellaneous function keys. - -@item @code{f1}, @code{f2}, @dots{} @code{f35} -Numbered function keys (across the top of the keyboard). - -@item @code{kp-add}, @code{kp-subtract}, @code{kp-multiply}, @code{kp-divide} -@itemx @code{kp-backtab}, @code{kp-space}, @code{kp-tab}, @code{kp-enter} -@itemx @code{kp-separator}, @code{kp-decimal}, @code{kp-equal} -Keypad keys (to the right of the regular keyboard), with names or punctuation. - -@item @code{kp-0}, @code{kp-1}, @dots{} @code{kp-9} -Keypad keys with digits. - -@item @code{kp-f1}, @code{kp-f2}, @code{kp-f3}, @code{kp-f4} -Keypad PF keys. -@end table - - These names are conventional, but some systems (especially when using -X) may use different names. To make certain what symbol is used for a -given function key on your terminal, type @kbd{C-h c} followed by that -key. - - A key sequence which contains function key symbols (or anything but -@acronym{ASCII} characters) must be a vector rather than a string. -Thus, to bind function key @samp{f1} to the command @code{rmail}, -write the following: - -@example -(global-set-key [f1] 'rmail) -@end example - -@noindent -To bind the right-arrow key to the command @code{forward-char}, you can -use this expression: - -@example -(global-set-key [right] 'forward-char) -@end example - -@noindent -This uses the Lisp syntax for a vector containing the symbol -@code{right}. (This binding is present in Emacs by default.) - - @xref{Init Rebinding}, for more information about using vectors for -rebinding. - - You can mix function keys and characters in a key sequence. This -example binds @kbd{C-x @key{NEXT}} to the command @code{forward-page}. - -@example -(global-set-key [?\C-x next] 'forward-page) -@end example - -@noindent -where @code{?\C-x} is the Lisp character constant for the character -@kbd{C-x}. The vector element @code{next} is a symbol and therefore -does not take a question mark. - - You can use the modifier keys @key{CTRL}, @key{META}, @key{HYPER}, -@key{SUPER}, @key{ALT} and @key{SHIFT} with function keys. To represent -these modifiers, add the strings @samp{C-}, @samp{M-}, @samp{H-}, -@samp{s-}, @samp{A-} and @samp{S-} at the front of the symbol name. -Thus, here is how to make @kbd{Hyper-Meta-@key{RIGHT}} move forward a -word: - -@example -(global-set-key [H-M-right] 'forward-word) -@end example - -@cindex keypad - Many keyboards have a ``numeric keypad'' on the right hand side. -The numeric keys in the keypad double up as cursor motion keys, -toggled by a key labeled @samp{Num Lock}. By default, Emacs -translates these keys to the corresponding keys in the main keyboard. -For example, when @samp{Num Lock} is on, the key labeled @samp{8} on -the numeric keypad produces @code{kp-8}, which is translated to -@kbd{8}; when @samp{Num Lock} is off, the same key produces -@code{kp-up}, which is translated to @key{UP}. If you rebind a key -such as @kbd{8} or @key{UP}, it affects the equivalent keypad key too. -However, if you rebind a @samp{kp-} key directly, that won't affect -its non-keypad equivalent. - - Emacs provides a convenient method for binding the numeric keypad -keys, using the variables @code{keypad-setup}, -@code{keypad-numlock-setup}, @code{keypad-shifted-setup}, and -@code{keypad-numlock-shifted-setup}. These can be found in the -@samp{keyboard} customization group (@pxref{Easy Customization}). You -can rebind the keys to perform other tasks, such as issuing numeric -prefix arguments. - -@node Named ASCII Chars -@subsection Named @acronym{ASCII} Control Characters - - @key{TAB}, @key{RET}, @key{BS}, @key{LFD}, @key{ESC} and @key{DEL} -started out as names for certain @acronym{ASCII} control characters, -used so often that they have special keys of their own. For instance, -@key{TAB} was another name for @kbd{C-i}. Later, users found it -convenient to distinguish in Emacs between these keys and the ``same'' -control characters typed with the @key{CTRL} key. Therefore, on most -modern terminals, they are no longer the same, and @key{TAB} is -distinguishable from @kbd{C-i}. - - Emacs can distinguish these two kinds of input if the keyboard does. -It treats the ``special'' keys as function keys named @code{tab}, -@code{return}, @code{backspace}, @code{linefeed}, @code{escape}, and -@code{delete}. These function keys translate automatically into the -corresponding @acronym{ASCII} characters @emph{if} they have no -bindings of their own. As a result, neither users nor Lisp programs -need to pay attention to the distinction unless they care to. - - If you do not want to distinguish between (for example) @key{TAB} and -@kbd{C-i}, make just one binding, for the @acronym{ASCII} character @key{TAB} -(octal code 011). If you do want to distinguish, make one binding for -this @acronym{ASCII} character, and another for the ``function key'' @code{tab}. - - With an ordinary @acronym{ASCII} terminal, there is no way to distinguish -between @key{TAB} and @kbd{C-i} (and likewise for other such pairs), -because the terminal sends the same character in both cases. - -@node Mouse Buttons -@subsection Rebinding Mouse Buttons -@cindex mouse button events -@cindex rebinding mouse buttons -@cindex click events -@cindex drag events -@cindex down events -@cindex button down events - - Emacs uses Lisp symbols to designate mouse buttons, too. The ordinary -mouse events in Emacs are @dfn{click} events; these happen when you -press a button and release it without moving the mouse. You can also -get @dfn{drag} events, when you move the mouse while holding the button -down. Drag events happen when you finally let go of the button. - - The symbols for basic click events are @code{mouse-1} for the leftmost -button, @code{mouse-2} for the next, and so on. Here is how you can -redefine the second mouse button to split the current window: - -@example -(global-set-key [mouse-2] 'split-window-vertically) -@end example - - The symbols for drag events are similar, but have the prefix -@samp{drag-} before the word @samp{mouse}. For example, dragging the -first button generates a @code{drag-mouse-1} event. - - You can also define bindings for events that occur when a mouse button -is pressed down. These events start with @samp{down-} instead of -@samp{drag-}. Such events are generated only if they have key bindings. -When you get a button-down event, a corresponding click or drag event -will always follow. - -@cindex double clicks -@cindex triple clicks - If you wish, you can distinguish single, double, and triple clicks. A -double click means clicking a mouse button twice in approximately the -same place. The first click generates an ordinary click event. The -second click, if it comes soon enough, generates a double-click event -instead. The event type for a double-click event starts with -@samp{double-}: for example, @code{double-mouse-3}. - - This means that you can give a special meaning to the second click at -the same place, but it must act on the assumption that the ordinary -single click definition has run when the first click was received. - - This constrains what you can do with double clicks, but user interface -designers say that this constraint ought to be followed in any case. A -double click should do something similar to the single click, only -``more so.'' The command for the double-click event should perform the -extra work for the double click. - - If a double-click event has no binding, it changes to the -corresponding single-click event. Thus, if you don't define a -particular double click specially, it executes the single-click command -twice. - - Emacs also supports triple-click events whose names start with -@samp{triple-}. Emacs does not distinguish quadruple clicks as event -types; clicks beyond the third generate additional triple-click events. -However, the full number of clicks is recorded in the event list, so -if you know Emacs Lisp you can distinguish if you really want to -(@pxref{Accessing Events,,, elisp, The Emacs Lisp Reference Manual}). -We don't recommend distinct meanings for more than three clicks, but -sometimes it is useful for subsequent clicks to cycle through the same -set of three meanings, so that four clicks are equivalent to one -click, five are equivalent to two, and six are equivalent to three. - - Emacs also records multiple presses in drag and button-down events. -For example, when you press a button twice, then move the mouse while -holding the button, Emacs gets a @samp{double-drag-} event. And at the -moment when you press it down for the second time, Emacs gets a -@samp{double-down-} event (which is ignored, like all button-down -events, if it has no binding). - -@vindex double-click-time - The variable @code{double-click-time} specifies how much time can -elapse between clicks and still allow them to be grouped as a multiple -click. Its value is in units of milliseconds. If the value is -@code{nil}, double clicks are not detected at all. If the value is -@code{t}, then there is no time limit. The default is 500. - -@vindex double-click-fuzz - The variable @code{double-click-fuzz} specifies how much the mouse -can move between clicks and still allow them to be grouped as a multiple -click. Its value is in units of pixels on windowed displays and in -units of 1/8 of a character cell on text-mode terminals; the default is -3. - - The symbols for mouse events also indicate the status of the modifier -keys, with the usual prefixes @samp{C-}, @samp{M-}, @samp{H-}, -@samp{s-}, @samp{A-} and @samp{S-}. These always precede @samp{double-} -or @samp{triple-}, which always precede @samp{drag-} or @samp{down-}. - - A frame includes areas that don't show text from the buffer, such as -the mode line and the scroll bar. You can tell whether a mouse button -comes from a special area of the screen by means of dummy ``prefix -keys.'' For example, if you click the mouse in the mode line, you get -the prefix key @code{mode-line} before the ordinary mouse-button symbol. -Thus, here is how to define the command for clicking the first button in -a mode line to run @code{scroll-up}: - -@example -(global-set-key [mode-line mouse-1] 'scroll-up) -@end example - - Here is the complete list of these dummy prefix keys and their -meanings: - -@table @code -@item mode-line -The mouse was in the mode line of a window. -@item vertical-line -The mouse was in the vertical line separating side-by-side windows. (If -you use scroll bars, they appear in place of these vertical lines.) -@item vertical-scroll-bar -The mouse was in a vertical scroll bar. (This is the only kind of -scroll bar Emacs currently supports.) -@item menu-bar -The mouse was in the menu bar. -@item header-line -The mouse was in a header line. -@ignore -@item horizontal-scroll-bar -The mouse was in a horizontal scroll bar. Horizontal scroll bars do -horizontal scrolling, and people don't use them often. -@end ignore -@end table - - You can put more than one mouse button in a key sequence, but it isn't -usual to do so. - -@node Disabling -@subsection Disabling Commands -@cindex disabled command - - Disabling a command means that invoking it interactively asks for -confirmation from the user. The purpose of disabling a command is to -prevent users from executing it by accident; we do this for commands -that might be confusing to the uninitiated. - - Attempting to invoke a disabled command interactively in Emacs -displays a window containing the command's name, its documentation, -and some instructions on what to do immediately; then Emacs asks for -input saying whether to execute the command as requested, enable it -and execute it, or cancel. If you decide to enable the command, you -must then answer another question---whether to do this permanently, or -just for the current session. (Enabling permanently works by -automatically editing your @file{.emacs} file.) You can also type -@kbd{!} to enable @emph{all} commands, for the current session only. - - The direct mechanism for disabling a command is to put a -non-@code{nil} @code{disabled} property on the Lisp symbol for the -command. Here is the Lisp program to do this: - -@example -(put 'delete-region 'disabled t) -@end example - - If the value of the @code{disabled} property is a string, that string -is included in the message displayed when the command is used: - -@example -(put 'delete-region 'disabled - "It's better to use `kill-region' instead.\n") -@end example - -@findex disable-command -@findex enable-command - You can make a command disabled either by editing the @file{.emacs} -file directly, or with the command @kbd{M-x disable-command}, which edits -the @file{.emacs} file for you. Likewise, @kbd{M-x enable-command} -edits @file{.emacs} to enable a command permanently. @xref{Init File}. - - If Emacs was invoked with the @option{-q} or @option{--no-init-file} -options (@pxref{Initial Options}), it will not edit your -@file{~/.emacs} init file. Doing so could lose information -because Emacs has not read your init file. - - Whether a command is disabled is independent of what key is used to -invoke it; disabling also applies if the command is invoked using -@kbd{M-x}. However, disabling a command has no effect on calling it -as a function from Lisp programs. - -@node Syntax -@section The Syntax Table -@cindex syntax table - - All the Emacs commands which parse words or balance parentheses are -controlled by the @dfn{syntax table}. The syntax table says which -characters are opening delimiters, which are parts of words, which are -string quotes, and so on. It does this by assigning each character to -one of fifteen-odd @dfn{syntax classes}. In some cases it specifies -some additional information also. - - Each major mode has its own syntax table (though related major modes -sometimes share one syntax table), which it installs in each buffer -that uses the mode. The syntax table installed in the current buffer -is the one that all commands use, so we call it ``the'' syntax table. - -@kindex C-h s -@findex describe-syntax - To display a description of the contents of the current syntax -table, type @kbd{C-h s} (@code{describe-syntax}). The description of -each character includes the string you would have to give to -@code{modify-syntax-entry} to set up that character's current syntax, -starting with the character which designates its syntax class, plus -some English text to explain its meaning. - - A syntax table is actually a Lisp object, a char-table, whose -elements are cons cells. For full information on the syntax table, -see @ref{Syntax Tables,, Syntax Tables, elisp, The Emacs Lisp -Reference Manual}. - -@node Init File -@section The Init File, @file{~/.emacs} -@cindex init file -@cindex Emacs initialization file -@cindex key rebinding, permanent -@cindex rebinding keys, permanently -@cindex startup (init file) - - When Emacs is started, it normally loads a Lisp program from the file -@file{.emacs} or @file{.emacs.el} in your home directory (@pxref{Find Init}). -We call this file your @dfn{init file} because it specifies how to -initialize Emacs for you. You can use the command line switch -@samp{-q} to prevent loading your init file, and @samp{-u} (or -@samp{--user}) to specify a different user's init file (@pxref{Initial -Options}). - - You can also use @file{~/.emacs.d/init.el} as the init file. Emacs -tries this if it cannot find @file{~/.emacs} or @file{~/.emacs.el}. - -@cindex @file{default.el}, the default init file - There can also be a @dfn{default init file}, which is the library -named @file{default.el}, found via the standard search path for -libraries. The Emacs distribution contains no such library; your site -may create one for local customizations. If this library exists, it is -loaded whenever you start Emacs (except when you specify @samp{-q}). -But your init file, if any, is loaded first; if it sets -@code{inhibit-default-init} non-@code{nil}, then @file{default} is not -loaded. - -@cindex site init file -@cindex @file{site-start.el}, the site startup file - Your site may also have a @dfn{site startup file}; this is named -@file{site-start.el}, if it exists. Like @file{default.el}, Emacs -finds this file via the standard search path for Lisp libraries. -Emacs loads this library before it loads your init file. To inhibit -loading of this library, use the option @samp{--no-site-file}. -@xref{Initial Options}. We recommend against using -@file{site-start.el} for changes that some users may not like. It is -better to put them in @file{default.el}, so that users can more easily -override them. - - You can place @file{default.el} and @file{site-start.el} in any of -the directories which Emacs searches for Lisp libraries. The variable -@code{load-path} (@pxref{Lisp Libraries}) specifies these directories. -Many sites put these files in the @file{site-lisp} subdirectory of the -Emacs installation directory, typically -@file{/usr/local/share/emacs/site-lisp}. - - If you have a large amount of code in your @file{.emacs} file, you -should rename it to @file{~/.emacs.el}, and byte-compile it. @xref{Byte -Compilation,, Byte Compilation, elisp, the Emacs Lisp Reference Manual}, -for more information about compiling Emacs Lisp programs. - - If you are going to write actual Emacs Lisp programs that go beyond -minor customization, you should read the @cite{Emacs Lisp Reference Manual}. -@ifnottex -@xref{Top, Emacs Lisp, Emacs Lisp, elisp, the Emacs Lisp Reference -Manual}. -@end ifnottex - -@menu -* Init Syntax:: Syntax of constants in Emacs Lisp. -* Init Examples:: How to do some things with an init file. -* Terminal Init:: Each terminal type can have an init file. -* Find Init:: How Emacs finds the init file. -* Init Non-ASCII:: Using non-@acronym{ASCII} characters in an init file. -@end menu - -@node Init Syntax -@subsection Init File Syntax - - The @file{.emacs} file contains one or more Lisp function call -expressions. Each of these consists of a function name followed by -arguments, all surrounded by parentheses. For example, @code{(setq -fill-column 60)} calls the function @code{setq} to set the variable -@code{fill-column} (@pxref{Filling}) to 60. - - You can set any Lisp variable with @code{setq}, but with certain -variables @code{setq} won't do what you probably want in the -@file{.emacs} file. Some variables automatically become buffer-local -when set with @code{setq}; what you want in @file{.emacs} is to set -the default value, using @code{setq-default}. Some customizable minor -mode variables do special things to enable the mode when you set them -with Customize, but ordinary @code{setq} won't do that; to enable the -mode in your @file{.emacs} file, call the minor mode command. The -following section has examples of both of these methods. - - The second argument to @code{setq} is an expression for the new -value of the variable. This can be a constant, a variable, or a -function call expression. In @file{.emacs}, constants are used most -of the time. They can be: - -@table @asis -@item Numbers: -Numbers are written in decimal, with an optional initial minus sign. - -@item Strings: -@cindex Lisp string syntax -@cindex string syntax -Lisp string syntax is the same as C string syntax with a few extra -features. Use a double-quote character to begin and end a string constant. - -In a string, you can include newlines and special characters literally. -But often it is cleaner to use backslash sequences for them: @samp{\n} -for newline, @samp{\b} for backspace, @samp{\r} for carriage return, -@samp{\t} for tab, @samp{\f} for formfeed (control-L), @samp{\e} for -escape, @samp{\\} for a backslash, @samp{\"} for a double-quote, or -@samp{\@var{ooo}} for the character whose octal code is @var{ooo}. -Backslash and double-quote are the only characters for which backslash -sequences are mandatory. - -@samp{\C-} can be used as a prefix for a control character, as in -@samp{\C-s} for @acronym{ASCII} control-S, and @samp{\M-} can be used as a prefix for -a Meta character, as in @samp{\M-a} for @kbd{Meta-A} or @samp{\M-\C-a} for -@kbd{Control-Meta-A}.@refill - -@xref{Init Non-ASCII}, for information about including -non-@acronym{ASCII} in your init file. - -@item Characters: -Lisp character constant syntax consists of a @samp{?} followed by -either a character or an escape sequence starting with @samp{\}. -Examples: @code{?x}, @code{?\n}, @code{?\"}, @code{?\)}. Note that -strings and characters are not interchangeable in Lisp; some contexts -require one and some contexts require the other. - -@xref{Init Non-ASCII}, for information about binding commands to -keys which send non-@acronym{ASCII} characters. - -@item True: -@code{t} stands for `true'. - -@item False: -@code{nil} stands for `false'. - -@item Other Lisp objects: -Write a single-quote (@code{'}) followed by the Lisp object you want. -@end table - -@node Init Examples -@subsection Init File Examples - - Here are some examples of doing certain commonly desired things with -Lisp expressions: - -@itemize @bullet -@item -Make @key{TAB} in C mode just insert a tab if point is in the middle of a -line. - -@example -(setq c-tab-always-indent nil) -@end example - -Here we have a variable whose value is normally @code{t} for `true' -and the alternative is @code{nil} for `false'. - -@item -Make searches case sensitive by default (in all buffers that do not -override this). - -@example -(setq-default case-fold-search nil) -@end example - -This sets the default value, which is effective in all buffers that do -not have local values for the variable. Setting @code{case-fold-search} -with @code{setq} affects only the current buffer's local value, which -is not what you probably want to do in an init file. - -@item -@vindex user-mail-address -Specify your own email address, if Emacs can't figure it out correctly. - -@example -(setq user-mail-address "rumsfeld@@torture.gov") -@end example - -Various Emacs packages that need your own email address use the value of -@code{user-mail-address}. - -@item -Make Text mode the default mode for new buffers. - -@example -(setq default-major-mode 'text-mode) -@end example - -Note that @code{text-mode} is used because it is the command for -entering Text mode. The single-quote before it makes the symbol a -constant; otherwise, @code{text-mode} would be treated as a variable -name. - -@need 1500 -@item -Set up defaults for the Latin-1 character set -which supports most of the languages of Western Europe. - -@example -(set-language-environment "Latin-1") -@end example - -@need 1500 -@item -Turn off Line Number mode, a global minor mode. - -@example -(line-number-mode 0) -@end example - -@need 1500 -@item -Turn on Auto Fill mode automatically in Text mode and related modes. - -@example -(add-hook 'text-mode-hook - '(lambda () (auto-fill-mode 1))) -@end example - -This shows how to add a hook function to a normal hook variable -(@pxref{Hooks}). The function we supply is a list starting with -@code{lambda}, with a single-quote in front of it to make it a list -constant rather than an expression. - -It's beyond the scope of this manual to explain Lisp functions, but for -this example it is enough to know that the effect is to execute -@code{(auto-fill-mode 1)} when Text mode is entered. You can replace -that with any other expression that you like, or with several -expressions in a row. - -Emacs comes with a function named @code{turn-on-auto-fill} whose -definition is @code{(lambda () (auto-fill-mode 1))}. Thus, a simpler -way to write the above example is as follows: - -@example -(add-hook 'text-mode-hook 'turn-on-auto-fill) -@end example - -@item -Load the installed Lisp library named @file{foo} (actually a file -@file{foo.elc} or @file{foo.el} in a standard Emacs directory). - -@example -(load "foo") -@end example - -When the argument to @code{load} is a relative file name, not starting -with @samp{/} or @samp{~}, @code{load} searches the directories in -@code{load-path} (@pxref{Lisp Libraries}). - -@item -Load the compiled Lisp file @file{foo.elc} from your home directory. - -@example -(load "~/foo.elc") -@end example - -Here an absolute file name is used, so no searching is done. - -@item -@cindex loading Lisp libraries automatically -@cindex autoload Lisp libraries -Tell Emacs to find the definition for the function @code{myfunction} -by loading a Lisp library named @file{mypackage} (i.e.@: a file -@file{mypackage.elc} or @file{mypackage.el}): - -@example -(autoload 'myfunction "mypackage" "Do what I say." t) -@end example - -@noindent -Here the string @code{"Do what I say."} is the function's -documentation string. You specify it in the @code{autoload} -definition so it will be available for help commands even when the -package is not loaded. The last argument, @code{t}, indicates that -this function is interactive; that is, it can be invoked interactively -by typing @kbd{M-x myfunction @key{RET}} or by binding it to a key. -If the function is not interactive, omit the @code{t} or use -@code{nil}. - -@item -Rebind the key @kbd{C-x l} to run the function @code{make-symbolic-link} -(@pxref{Init Rebinding}). - -@example -(global-set-key "\C-xl" 'make-symbolic-link) -@end example - -or - -@example -(define-key global-map "\C-xl" 'make-symbolic-link) -@end example - -Note once again the single-quote used to refer to the symbol -@code{make-symbolic-link} instead of its value as a variable. - -@item -Do the same thing for Lisp mode only. - -@example -(define-key lisp-mode-map "\C-xl" 'make-symbolic-link) -@end example - -@item -Redefine all keys which now run @code{next-line} in Fundamental mode -so that they run @code{forward-line} instead. - -@findex substitute-key-definition -@example -(substitute-key-definition 'next-line 'forward-line - global-map) -@end example - -@item -Make @kbd{C-x C-v} undefined. - -@example -(global-unset-key "\C-x\C-v") -@end example - -One reason to undefine a key is so that you can make it a prefix. -Simply defining @kbd{C-x C-v @var{anything}} will make @kbd{C-x C-v} a -prefix, but @kbd{C-x C-v} must first be freed of its usual non-prefix -definition. - -@item -Make @samp{$} have the syntax of punctuation in Text mode. -Note the use of a character constant for @samp{$}. - -@example -(modify-syntax-entry ?\$ "." text-mode-syntax-table) -@end example - -@item -Enable the use of the command @code{narrow-to-region} without confirmation. - -@example -(put 'narrow-to-region 'disabled nil) -@end example - -@item -Adjusting the configuration to various platforms and Emacs versions. - -Users typically want Emacs to behave the same on all systems, so the -same init file is right for all platforms. However, sometimes it -happens that a function you use for customizing Emacs is not available -on some platforms or in older Emacs versions. To deal with that -situation, put the customization inside a conditional that tests whether -the function or facility is available, like this: - -@example -(if (fboundp 'blink-cursor-mode) - (blink-cursor-mode 0)) - -(if (boundp 'coding-category-utf-8) - (set-coding-priority '(coding-category-utf-8))) -@end example - -@noindent -You can also simply disregard the errors that occur if the -function is not defined. - -@example -(condition case () - (set-face-background 'region "grey75") - (error nil)) -@end example - -A @code{setq} on a variable which does not exist is generally -harmless, so those do not need a conditional. -@end itemize - -@node Terminal Init -@subsection Terminal-specific Initialization - - Each terminal type can have a Lisp library to be loaded into Emacs when -it is run on that type of terminal. For a terminal type named -@var{termtype}, the library is called @file{term/@var{termtype}} and it is -found by searching the directories @code{load-path} as usual and trying the -suffixes @samp{.elc} and @samp{.el}. Normally it appears in the -subdirectory @file{term} of the directory where most Emacs libraries are -kept.@refill - - The usual purpose of the terminal-specific library is to map the -escape sequences used by the terminal's function keys onto more -meaningful names, using @code{function-key-map}. See the file -@file{term/lk201.el} for an example of how this is done. Many function -keys are mapped automatically according to the information in the -Termcap data base; the terminal-specific library needs to map only the -function keys that Termcap does not specify. - - When the terminal type contains a hyphen, only the part of the name -before the first hyphen is significant in choosing the library name. -Thus, terminal types @samp{aaa-48} and @samp{aaa-30-rv} both use -the library @file{term/aaa}. The code in the library can use -@code{(getenv "TERM")} to find the full terminal type name.@refill - -@vindex term-file-prefix - The library's name is constructed by concatenating the value of the -variable @code{term-file-prefix} and the terminal type. Your @file{.emacs} -file can prevent the loading of the terminal-specific library by setting -@code{term-file-prefix} to @code{nil}. - -@vindex term-setup-hook - Emacs runs the hook @code{term-setup-hook} at the end of -initialization, after both your @file{.emacs} file and any -terminal-specific library have been read in. Add hook functions to this -hook if you wish to override part of any of the terminal-specific -libraries and to define initializations for terminals that do not have a -library. @xref{Hooks}. - -@node Find Init -@subsection How Emacs Finds Your Init File - - Normally Emacs uses the environment variable @env{HOME} -(@pxref{General Variables, HOME}) to find @file{.emacs}; that's what -@samp{~} means in a file name. If @file{.emacs} is not found inside -@file{~/} (nor @file{.emacs.el}), Emacs looks for -@file{~/.emacs.d/init.el} (which, like @file{~/.emacs.el}, can be -byte-compiled). - - However, if you run Emacs from a shell started by @code{su}, Emacs -tries to find your own @file{.emacs}, not that of the user you are -currently pretending to be. The idea is that you should get your own -editor customizations even if you are running as the super user. - - More precisely, Emacs first determines which user's init file to use. -It gets your user name from the environment variables @env{LOGNAME} and -@env{USER}; if neither of those exists, it uses effective user-ID. -If that user name matches the real user-ID, then Emacs uses @env{HOME}; -otherwise, it looks up the home directory corresponding to that user -name in the system's data base of users. -@c LocalWords: backtab - -@node Init Non-ASCII -@subsection Non-@acronym{ASCII} Characters in Init Files -@cindex international characters in @file{.emacs} -@cindex non-@acronym{ASCII} characters in @file{.emacs} -@cindex non-@acronym{ASCII} keys, binding -@cindex rebinding non-@acronym{ASCII} keys - - Language and coding systems may cause problems if your init file -contains non-@acronym{ASCII} characters, such as accented letters, in -strings or key bindings. - - If you want to use non-@acronym{ASCII} characters in your init file, -you should put a @w{@samp{-*-coding: @var{coding-system}-*-}} tag on -the first line of the init file, and specify a coding system that -supports the character(s) in question. @xref{Recognize Coding}. This -is because the defaults for decoding non-@acronym{ASCII} text might -not yet be set up by the time Emacs reads those parts of your init -file which use such strings, possibly leading Emacs to decode those -strings incorrectly. You should then avoid adding Emacs Lisp code -that modifies the coding system in other ways, such as calls to -@code{set-language-environment}. - - To bind non-@acronym{ASCII} keys, you must use a vector (@pxref{Init -Rebinding}). The string syntax cannot be used, since the -non-@acronym{ASCII} characters will be interpreted as meta keys. For -instance: - -@example -(global-set-key [?@var{char}] 'some-function) -@end example - -@noindent -Type @kbd{C-q}, followed by the key you want to bind, to insert @var{char}. - - @strong{Warning:} if you change the keyboard encoding, or change -between multibyte and unibyte mode, or anything that would alter which -code @kbd{C-q} would insert for that character, this keybinding may -stop working. It is therefore advisable to use one and only one -coding system, for your init file as well as the files you edit. For -example, don't mix the @samp{latin-1} and @samp{latin-9} coding -systems. - -@ignore - arch-tag: c68abddb-4410-4fb5-925f-63394e971d93 -@end ignore diff --git a/man/display.texi b/man/display.texi deleted file mode 100644 index 21a65999ec3..00000000000 --- a/man/display.texi +++ /dev/null @@ -1,1259 +0,0 @@ -@c This is part of the Emacs manual. -@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001, -@c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. -@c See file emacs.texi for copying conditions. -@node Display, Search, Registers, Top -@chapter Controlling the Display - - Since only part of a large buffer fits in the window, Emacs tries to -show a part that is likely to be interesting. Display-control -commands allow you to specify which part of the text you want to see, -and how to display it. Many variables also affect the details of -redisplay. Unless otherwise stated, the variables described in this -chapter have their effect by customizing redisplay itself; therefore, -their values only make a difference at the time of redisplay. - -@menu -* Scrolling:: Commands to move text up and down in a window. -* Auto Scrolling:: Redisplay scrolls text automatically when needed. -* Horizontal Scrolling:: Moving text left and right in a window. -* Follow Mode:: Follow mode lets two windows scroll as one. -* Faces:: How to change the display style using faces. -* Standard Faces:: Emacs' predefined faces. -* Font Lock:: Minor mode for syntactic highlighting using faces. -* Highlight Interactively:: Tell Emacs what text to highlight. -* Fringes:: Enabling or disabling window fringes. -* Displaying Boundaries:: Displaying top and bottom of the buffer. -* Useless Whitespace:: Showing possibly-spurious trailing whitespace. -* Selective Display:: Hiding lines with lots of indentation. -* Optional Mode Line:: Optional mode line display features. -* Text Display:: How text characters are normally displayed. -* Cursor Display:: Features for displaying the cursor. -* Line Truncation:: Truncating lines to fit the screen width instead - of continuing them to multiple screen lines. -* Display Custom:: Information on variables for customizing display. -@end menu - -@node Scrolling -@section Scrolling - - If a buffer contains text that is too large to fit entirely within a -window that is displaying the buffer, Emacs shows a contiguous portion of -the text. The portion shown always contains point. - -@cindex scrolling - @dfn{Scrolling} means moving text up or down in the window so that -different parts of the text are visible. Scrolling ``forward'' or -``up'' means that text moves up, and new text appears at the bottom. -Scrolling ``backward'' or ``down'' moves text down, and new text -appears at the top. - - Scrolling happens automatically if you move point past the bottom or -top of the window. You can also scroll explicitly with the commands -in this section. - -@table @kbd -@item C-l -Clear screen and redisplay, scrolling the selected window to center -point vertically within it (@code{recenter}). -@item C-v -Scroll forward (a windowful or a specified number of lines) (@code{scroll-up}). -@item @key{NEXT} -@itemx @key{PAGEDOWN} -Likewise, scroll forward. -@item M-v -Scroll backward (@code{scroll-down}). -@item @key{PRIOR} -@itemx @key{PAGEUP} -Likewise, scroll backward. -@item @var{arg} C-l -Scroll so point is on line @var{arg} (@code{recenter}). -@item C-M-l -Scroll heuristically to bring useful information onto the screen -(@code{reposition-window}). -@end table - -@kindex C-l -@findex recenter - The most basic scrolling command is @kbd{C-l} (@code{recenter}) with -no argument. It scrolls the selected window so that point is halfway -down from the top of the window. On a text terminal, it also clears -the screen and redisplays all windows. That is useful in case the -screen is garbled (@pxref{Screen Garbled}). - -@kindex C-v -@kindex M-v -@kindex NEXT -@kindex PRIOR -@kindex PAGEDOWN -@kindex PAGEUP -@findex scroll-up -@findex scroll-down - To read the buffer a windowful at a time, use @kbd{C-v} -(@code{scroll-up}) with no argument. This scrolls forward by nearly -the whole window height. The effect is to take the two lines at the -bottom of the window and put them at the top, followed by nearly a -whole windowful of lines that were not previously visible. If point -was in the text that scrolled off the top, it ends up at the new top -of the window. - -@vindex next-screen-context-lines - @kbd{M-v} (@code{scroll-down}) with no argument scrolls backward in -a similar way, also with overlap. The number of lines of overlap that -the @kbd{C-v} or @kbd{M-v} commands leave is controlled by the -variable @code{next-screen-context-lines}; by default, it is 2. The -function keys @key{NEXT} and @key{PRIOR}, or @key{PAGEDOWN} and -@key{PAGEUP}, are equivalent to @kbd{C-v} and @kbd{M-v}. - - The commands @kbd{C-v} and @kbd{M-v} with a numeric argument scroll -the text in the selected window up or down a few lines. @kbd{C-v} -with an argument moves the text and point up, together, that many -lines; it brings the same number of new lines into view at the bottom -of the window. @kbd{M-v} with numeric argument scrolls the text -downward, bringing that many new lines into view at the top of the -window. @kbd{C-v} with a negative argument is like @kbd{M-v} and vice -versa. - - The names of scroll commands are based on the direction that the -text moves in the window. Thus, the command to scroll forward is -called @code{scroll-up} because it moves the text upward on the -screen. The keys @key{PAGEDOWN} and @key{PAGEUP} derive their names -and customary meanings from a different convention that developed -elsewhere; hence the strange result that @key{PAGEDOWN} runs -@code{scroll-up}. - -@vindex scroll-preserve-screen-position - Some users like the full-screen scroll commands to keep point at the -same screen line. To enable this behavior, set the variable -@code{scroll-preserve-screen-position} to a non-@code{nil} value. In -this mode, when these commands would scroll the text around point off -the screen, or within @code{scroll-margin} lines of the edge, they -move point to keep the same vertical position within the window. -This mode is convenient for browsing through a file by scrolling by -screenfuls; if you come back to the screen where you started, point -goes back to the line where it started. However, this mode is -inconvenient when you move to the next screen in order to move point -to the text there. - - Another way to do scrolling is with @kbd{C-l} with a numeric argument. -@kbd{C-l} does not clear the screen when given an argument; it only scrolls -the selected window. With a positive argument @var{n}, it repositions text -to put point @var{n} lines down from the top. An argument of zero puts -point on the very top line. Point does not move with respect to the text; -rather, the text and point move rigidly on the screen. @kbd{C-l} with a -negative argument puts point that many lines from the bottom of the window. -For example, @kbd{C-u - 1 C-l} puts point on the bottom line, and @kbd{C-u -- 5 C-l} puts it five lines from the bottom. @kbd{C-u C-l} scrolls to put -point at the center (vertically) of the selected window. - -@kindex C-M-l -@findex reposition-window - The @kbd{C-M-l} command (@code{reposition-window}) scrolls the current -window heuristically in a way designed to get useful information onto -the screen. For example, in a Lisp file, this command tries to get the -entire current defun onto the screen if possible. - -@node Auto Scrolling -@section Automatic Scrolling - -@vindex scroll-conservatively - Redisplay scrolls the buffer automatically when point moves out of -the visible portion of the text. The purpose of automatic scrolling -is to make point visible, but you can customize many aspects of how -this is done. - - Normally, automatic scrolling centers point vertically within the -window. However, if you set @code{scroll-conservatively} to a small -number @var{n}, then if you move point just a little off the -screen---less than @var{n} lines---then Emacs scrolls the text just -far enough to bring point back on screen. By default, -@code{scroll-conservatively} is@tie{}0. - -@cindex aggressive scrolling -@vindex scroll-up-aggressively -@vindex scroll-down-aggressively - When the window does scroll by a longer distance, you can control -how aggressively it scrolls, by setting the variables -@code{scroll-up-aggressively} and @code{scroll-down-aggressively}. -The value of @code{scroll-up-aggressively} should be either -@code{nil}, or a fraction @var{f} between 0 and 1. A fraction -specifies where on the screen to put point when scrolling upward. -More precisely, when a window scrolls up because point is above the -window start, the new start position is chosen to put point @var{f} -part of the window height from the top. The larger @var{f}, the more -aggressive the scrolling. - - @code{nil}, which is the default, scrolls to put point at the center. -So it is equivalent to .5. - - Likewise, @code{scroll-down-aggressively} is used for scrolling -down. The value, @var{f}, specifies how far point should be placed -from the bottom of the window; thus, as with -@code{scroll-up-aggressively}, a larger value is more aggressive. - -@vindex scroll-margin - The variable @code{scroll-margin} restricts how close point can come -to the top or bottom of a window. Its value is a number of screen -lines; if point comes within that many lines of the top or bottom of the -window, Emacs recenters the window. By default, @code{scroll-margin} is -0. - -@node Horizontal Scrolling -@section Horizontal Scrolling -@cindex horizontal scrolling - - @dfn{Horizontal scrolling} means shifting all the lines sideways -within a window---so that some of the text near the left margin is not -displayed at all. When the text in a window is scrolled horizontally, -text lines are truncated rather than continued (@pxref{Line -Truncation}). Whenever a window shows truncated lines, Emacs -automatically updates its horizontal scrolling whenever point moves -off the left or right edge of the screen. You can also use these -commands to do explicit horizontal scrolling. - -@table @kbd -@item C-x < -Scroll text in current window to the left (@code{scroll-left}). -@item C-x > -Scroll to the right (@code{scroll-right}). -@end table - -@kindex C-x < -@kindex C-x > -@findex scroll-left -@findex scroll-right - The command @kbd{C-x <} (@code{scroll-left}) scrolls the selected -window to the left by @var{n} columns with argument @var{n}. This moves -part of the beginning of each line off the left edge of the window. -With no argument, it scrolls by almost the full width of the window (two -columns less, to be precise). - - @kbd{C-x >} (@code{scroll-right}) scrolls similarly to the right. The -window cannot be scrolled any farther to the right once it is displayed -normally (with each line starting at the window's left margin); -attempting to do so has no effect. This means that you don't have to -calculate the argument precisely for @w{@kbd{C-x >}}; any sufficiently large -argument will restore the normal display. - - If you use those commands to scroll a window horizontally, that sets -a lower bound for automatic horizontal scrolling. Automatic scrolling -will continue to scroll the window, but never farther to the right -than the amount you previously set by @code{scroll-left}. - -@vindex hscroll-margin - The value of the variable @code{hscroll-margin} controls how close -to the window's edges point is allowed to get before the window will -be automatically scrolled. It is measured in columns. If the value -is 5, then moving point within 5 columns of the edge causes horizontal -scrolling away from that edge. - -@vindex hscroll-step - The variable @code{hscroll-step} determines how many columns to -scroll the window when point gets too close to the edge. If it's -zero, horizontal scrolling centers point horizontally within the -window. If it's a positive integer, it specifies the number of -columns to scroll by. If it's a floating-point number, it specifies -the fraction of the window's width to scroll by. The default is zero. - -@vindex auto-hscroll-mode - To disable automatic horizontal scrolling, set the variable -@code{auto-hscroll-mode} to @code{nil}. - -@node Follow Mode -@section Follow Mode -@cindex Follow mode -@cindex mode, Follow -@findex follow-mode -@cindex windows, synchronizing -@cindex synchronizing windows - - @dfn{Follow mode} is a minor mode that makes two windows, both -showing the same buffer, scroll as a single tall ``virtual window.'' -To use Follow mode, go to a frame with just one window, split it into -two side-by-side windows using @kbd{C-x 3}, and then type @kbd{M-x -follow-mode}. From then on, you can edit the buffer in either of the -two windows, or scroll either one; the other window follows it. - - In Follow mode, if you move point outside the portion visible in one -window and into the portion visible in the other window, that selects -the other window---again, treating the two as if they were parts of -one large window. - - To turn off Follow mode, type @kbd{M-x follow-mode} a second time. - -@node Faces -@section Using Multiple Typefaces -@cindex faces - - You can specify various styles for displaying text using -@dfn{faces}. Each face can specify various @dfn{face attributes}, -such as the font family, the height, weight and slant of the -characters, the foreground and background color, and underlining or -overlining. A face does not have to specify all of these attributes; -often it inherits most of them from another face. - - On graphical display, all the Emacs face attributes are meaningful. -On a text-only terminal, only some of them work. Some text-only -terminals support inverse video, bold, and underline attributes; some -support colors. Text-only terminals generally do not support changing -the height and width or the font family. - - Emacs uses faces automatically for highlighting, through the work of -Font Lock mode. @xref{Font Lock}, for more information about Font -Lock mode and syntactic highlighting. You can print out the buffer -with the highlighting that appears on your screen using the command -@code{ps-print-buffer-with-faces}. @xref{PostScript}. - - You control the appearance of a part of the text in the buffer by -specifying the face or faces to use for it. The style of display used -for any given character is determined by combining the attributes of -all the applicable faces specified for that character. Any attribute -that isn't specified by these faces is taken from the @code{default} face, -whose attributes reflect the default settings of the frame itself. - - Enriched mode, the mode for editing formatted text, includes several -commands and menus for specifying faces for text in the buffer. -@xref{Format Faces}, for how to specify the font for text in the -buffer. @xref{Format Colors}, for how to specify the foreground and -background color. - -@cindex face colors, setting -@findex set-face-foreground -@findex set-face-background - To alter the appearance of a face, use the customization buffer. -@xref{Face Customization}. You can also use X resources to specify -attributes of particular faces (@pxref{Resources}). Alternatively, -you can change the foreground and background colors of a specific face -with @kbd{M-x set-face-foreground} and @kbd{M-x set-face-background}. -These commands prompt in the minibuffer for a face name and a color -name, with completion, and then set that face to use the specified -color. Changing the colors of the @code{default} face also changes -the foreground and background colors on all frames, both existing and -those to be created in the future. (You can also set foreground and -background colors for the current frame only; see @ref{Frame -Parameters}.) - - If you want to alter the appearance of all Emacs frames, you need to -customize the frame parameters in the variable -@code{default-frame-alist}; see @ref{Creating Frames, -default-frame-alist}. - - Emacs can correctly display variable-width fonts, but Emacs commands -that calculate width and indentation do not know how to calculate -variable widths. This can sometimes lead to incorrect results when -you use variable-width fonts. In particular, indentation commands can -give inconsistent results, so we recommend you avoid variable-width -fonts for editing program source code. Filling will sometimes make -lines too long or too short. We plan to address these issues in -future Emacs versions. - -@node Standard Faces -@section Standard Faces - -@findex list-faces-display - To see what faces are currently defined, and what they look like, -type @kbd{M-x list-faces-display}. It's possible for a given face to -look different in different frames; this command shows the appearance -in the frame in which you type it. With a prefix argument, this -prompts for a regular expression, and displays only faces with names -matching that regular expression. - - Here are the standard faces for specifying text appearance. You can -apply them to specific text when you want the effects they produce. - -@table @code -@item default -This face is used for ordinary text that doesn't specify any face. -@item bold -This face uses a bold variant of the default font, if it has one. -It's up to you to choose a default font that has a bold variant, -if you want to use one. -@item italic -This face uses an italic variant of the default font, if it has one. -@item bold-italic -This face uses a bold italic variant of the default font, if it has one. -@item underline -This face underlines text. -@item fixed-pitch -This face forces use of a particular fixed-width font. -@item variable-pitch -This face forces use of a particular variable-width font. It's -reasonable to customize this face to use a different variable-width font, -if you like, but you should not make it a fixed-width font. -@item shadow -This face is used for making the text less noticeable than the surrounding -ordinary text. Usually this can be achieved by using shades of gray in -contrast with either black or white default foreground color. -@end table - - Here's an incomplete list of faces used to highlight parts of the -text temporarily for specific purposes. (Many other modes define -their own faces for this purpose.) - -@table @code -@item highlight -This face is used for highlighting portions of text, in various modes. -For example, mouse-sensitive text is highlighted using this face. -@item isearch -This face is used for highlighting the current Isearch match. -@item query-replace -This face is used for highlighting the current Query Replace match. -@item lazy-highlight -This face is used for lazy highlighting of Isearch and Query Replace -matches other than the current one. -@item region -This face is used for displaying a selected region (when Transient Mark -mode is enabled---see below). -@item secondary-selection -This face is used for displaying a secondary X selection (@pxref{Secondary -Selection}). -@item trailing-whitespace -The face for highlighting excess spaces and tabs at the end of a line -when @code{show-trailing-whitespace} is non-@code{nil}; see -@ref{Useless Whitespace}. -@item nobreak-space -The face for displaying the character ``nobreak space.'' -@item escape-glyph -The face for highlighting the @samp{\} or @samp{^} that indicates -a control character. It's also used when @samp{\} indicates a -nobreak space or nobreak (soft) hyphen. -@end table - -@cindex @code{region} face - When Transient Mark mode is enabled, the text of the region is -highlighted when the mark is active. This uses the face named -@code{region}; you can control the style of highlighting by changing the -style of this face (@pxref{Face Customization}). @xref{Transient Mark}, -for more information about Transient Mark mode and activation and -deactivation of the mark. - - These faces control the appearance of parts of the Emacs frame. -They exist as faces to provide a consistent way to customize the -appearance of these parts of the frame. - -@table @code -@item mode-line -@itemx modeline -This face is used for the mode line of the currently selected window, -and for menu bars when toolkit menus are not used. By default, it's -drawn with shadows for a ``raised'' effect on graphical displays, and -drawn as the inverse of the default face on non-windowed terminals. -@code{modeline} is an alias for the @code{mode-line} face, for -compatibility with old Emacs versions. -@item mode-line-inactive -Like @code{mode-line}, but used for mode lines of the windows other -than the selected one (if @code{mode-line-in-non-selected-windows} is -non-@code{nil}). This face inherits from @code{mode-line}, so changes -in that face affect mode lines in all windows. -@item mode-line-highlight -Like @code{highlight}, but used for portions of text on mode lines. -@item mode-line-buffer-id -This face is used for buffer identification parts in the mode line. -@item header-line -Similar to @code{mode-line} for a window's header line, which appears -at the top of a window just as the mode line appears at the bottom. -Most windows do not have a header line---only some special modes, such -Info mode, create one. -@item vertical-border -This face is used for the vertical divider between windows. -By default this face inherits from the @code{mode-line-inactive} face -on character terminals. On graphical displays the foreground color of -this face is used for the vertical line between windows without -scrollbars. -@item minibuffer-prompt -@cindex @code{minibuffer-prompt} face -@vindex minibuffer-prompt-properties -This face is used for the prompt strings displayed in the minibuffer. -By default, Emacs automatically adds this face to the value of -@code{minibuffer-prompt-properties}, which is a list of text -properties used to display the prompt text. (This variable takes -effect when you enter the minibuffer.) -@item fringe -@cindex @code{fringe} face -The face for the fringes to the left and right of windows on graphic -displays. (The fringes are the narrow portions of the Emacs frame -between the text area and the window's right and left borders.) -@xref{Fringes}. -@item scroll-bar -This face determines the visual appearance of the scroll bar. -@xref{Scroll Bars}. -@item border -This face determines the color of the frame border. -@item cursor -This face determines the color of the cursor. -@item mouse -This face determines the color of the mouse pointer. -@item tool-bar -This face determines the color of tool bar icons. @xref{Tool Bars}. -@item tooltip -This face is used for tooltips. @xref{Tooltips}. -@item menu -@cindex menu bar appearance -@cindex @code{menu} face, no effect if customized -@cindex customization of @code{menu} face -This face determines the colors and font of Emacs's menus. @xref{Menu -Bars}. Setting the font of LessTif/Motif menus is currently not -supported; attempts to set the font are ignored in this case. -Likewise, attempts to customize this face in Emacs built with GTK and -in the MS-Windows/Mac ports are ignored by the respective GUI toolkits; -you need to use system-wide styles and options to change the -appearance of the menus. -@end table - -@node Font Lock -@section Font Lock mode -@cindex Font Lock mode -@cindex mode, Font Lock -@cindex syntax highlighting and coloring - - Font Lock mode is a minor mode, always local to a particular buffer, -which highlights (or ``fontifies'') the buffer contents according to -the syntax of the text you are editing. It can recognize comments and -strings in most languages; in several languages, it can also recognize -and properly highlight various other important constructs---for -example, names of functions being defined or reserved keywords. -Some special modes, such as Occur mode and Info mode, have completely -specialized ways of assigning fonts for Font Lock mode. - -@findex font-lock-mode - Font Lock mode is turned on by default in all modes which support it. -You can toggle font-lock for each buffer with the command @kbd{M-x -font-lock-mode}. Using a positive argument unconditionally turns Font -Lock mode on, and a negative or zero argument turns it off. - -@findex global-font-lock-mode -@vindex global-font-lock-mode - If you do not wish Font Lock mode to be turned on by default, -customize the variable @code{global-font-lock-mode} using the Customize -interface (@pxref{Easy Customization}), or use the function -@code{global-font-lock-mode} in your @file{.emacs} file, like this: - -@example -(global-font-lock-mode 0) -@end example - -@noindent -This variable, like all the variables that control Font Lock mode, -take effect whenever fontification is done; that is, potentially at -any time. - -@findex turn-on-font-lock - If you have disabled Global Font Lock mode, you can still enable Font -Lock for specific major modes by adding the function -@code{turn-on-font-lock} to the mode hooks (@pxref{Hooks}). For -example, to enable Font Lock mode for editing C files, you can do this: - -@example -(add-hook 'c-mode-hook 'turn-on-font-lock) -@end example - - Font Lock mode uses several specifically named faces to do its job, -including @code{font-lock-string-face}, @code{font-lock-comment-face}, -and others. The easiest way to find them all is to use @kbd{M-x -customize-group @key{RET} font-lock-faces @key{RET}}. You can then -use that customization buffer to customize the appearance of these -faces. @xref{Face Customization}. - - You can also customize these faces using @kbd{M-x -set-face-foreground} or @kbd{M-x set-face-background}. @xref{Faces}. - -@vindex font-lock-maximum-decoration - The variable @code{font-lock-maximum-decoration} specifies the -preferred level of fontification, for modes that provide multiple -levels. Level 1 is the least amount of fontification; some modes -support levels as high as 3. The normal default is ``as high as -possible.'' You can specify an integer, which applies to all modes, or -you can specify different numbers for particular major modes; for -example, to use level 1 for C/C++ modes, and the default level -otherwise, use this: - -@example -(setq font-lock-maximum-decoration - '((c-mode . 1) (c++-mode . 1))) -@end example - -@vindex font-lock-maximum-size - Fontification can be too slow for large buffers, so you can suppress -it for buffers above a certain size. The variable -@code{font-lock-maximum-size} specifies a buffer size, beyond which -buffer fontification is suppressed. - -@c @w is used below to prevent a bad page-break. -@vindex font-lock-beginning-of-syntax-function -@cindex incorrect fontification -@cindex parenthesis in column zero and fontification -@cindex brace in column zero and fontification - Comment and string fontification (or ``syntactic'' fontification) -relies on analysis of the syntactic structure of the buffer text. For -the sake of speed, some modes, including Lisp mode, rely on a special -convention: an open-parenthesis or open-brace in the leftmost column -always defines the @w{beginning} of a defun, and is thus always -outside any string or comment. (@xref{Left Margin Paren}.) If you -don't follow this convention, Font Lock mode can misfontify the text -that follows an open-parenthesis or open-brace in the leftmost column -that is inside a string or comment. - -@cindex slow display during scrolling - The variable @code{font-lock-beginning-of-syntax-function} (always -buffer-local) specifies how Font Lock mode can find a position -guaranteed to be outside any comment or string. In modes which use the -leftmost column parenthesis convention, the default value of the variable -is @code{beginning-of-defun}---that tells Font Lock mode to use the -convention. If you set this variable to @code{nil}, Font Lock no longer -relies on the convention. This avoids incorrect results, but the price -is that, in some cases, fontification for a changed text must rescan -buffer text from the beginning of the buffer. This can considerably -slow down redisplay while scrolling, particularly if you are close to -the end of a large buffer. - -@findex font-lock-add-keywords - Font Lock highlighting patterns already exist for many modes, but you -may want to fontify additional patterns. You can use the function -@code{font-lock-add-keywords}, to add your own highlighting patterns for -a particular mode. For example, to highlight @samp{FIXME:} words in C -comments, use this: - -@example -(font-lock-add-keywords - 'c-mode - '(("\\<\\(FIXME\\):" 1 font-lock-warning-face t))) -@end example - -@findex font-lock-remove-keywords - To remove keywords from the font-lock highlighting patterns, use the -function @code{font-lock-remove-keywords}. @xref{Search-based -Fontification,,, elisp, The Emacs Lisp Reference Manual}, for -documentation of the format of this list. - -@cindex just-in-time (JIT) font-lock -@cindex background syntax highlighting - Fontifying large buffers can take a long time. To avoid large -delays when a file is visited, Emacs fontifies only the visible -portion of a buffer. As you scroll through the buffer, each portion -that becomes visible is fontified as soon as it is displayed. The -parts of the buffer that are not displayed are fontified -``stealthily,'' in the background, i.e.@: when Emacs is idle. You can -control this background fontification, also called @dfn{Just-In-Time} -(or @dfn{JIT}) Lock, by customizing variables in the customization -group @samp{jit-lock}. @xref{Specific Customization}. - -@node Highlight Interactively -@section Interactive Highlighting -@cindex highlighting by matching -@cindex interactive highlighting -@cindex Highlight Changes mode - -@findex highlight-changes-mode - Use @kbd{M-x highlight-changes-mode} to enable (or disable) -Highlight Changes mode, a minor mode that uses faces (colors, -typically) to indicate which parts of the buffer were changed most -recently. - -@cindex Hi Lock mode -@findex hi-lock-mode - Hi Lock mode highlights text that matches regular expressions you -specify. For example, you might wish to see all the references to a -certain variable in a program source file, highlight certain parts in -a voluminous output of some program, or make certain names stand out -in an article. Use the @kbd{M-x hi-lock-mode} command to enable (or -disable) Hi Lock mode. To enable Hi Lock mode for all buffers, use -@kbd{M-x global-hi-lock-mode} or place @code{(global-hi-lock-mode 1)} -in your @file{.emacs} file. - - Hi Lock mode works like Font Lock mode (@pxref{Font Lock}), except -that you specify explicitly the regular expressions to highlight. You -control them with these commands: - -@table @kbd -@item C-x w h @var{regexp} @key{RET} @var{face} @key{RET} -@kindex C-x w h -@findex highlight-regexp -Highlight text that matches @var{regexp} using face @var{face} -(@code{highlight-regexp}). The highlighting will remain as long as -the buffer is loaded. For example, to highlight all occurrences of -the word ``whim'' using the default face (a yellow background) -@kbd{C-x w h whim @key{RET} @key{RET}}. Any face can be used for -highlighting, Hi Lock provides several of its own and these are -pre-loaded into a history list. While being prompted for a face use -@kbd{M-p} and @kbd{M-n} to cycle through them. - -You can use this command multiple times, specifying various regular -expressions to highlight in different ways. - -@item C-x w r @var{regexp} @key{RET} -@kindex C-x w r -@findex unhighlight-regexp -Unhighlight @var{regexp} (@code{unhighlight-regexp}). - -If you invoke this from the menu, you select the expression to -unhighlight from a list. If you invoke this from the keyboard, you -use the minibuffer. It will show the most recently added regular -expression; use @kbd{M-p} to show the next older expression and -@kbd{M-n} to select the next newer expression. (You can also type the -expression by hand, with completion.) When the expression you want to -unhighlight appears in the minibuffer, press @kbd{@key{RET}} to exit -the minibuffer and unhighlight it. - -@item C-x w l @var{regexp} @key{RET} @var{face} @key{RET} -@kindex C-x w l -@findex highlight-lines-matching-regexp -@cindex lines, highlighting -@cindex highlighting lines of text -Highlight entire lines containing a match for @var{regexp}, using face -@var{face} (@code{highlight-lines-matching-regexp}). - -@item C-x w b -@kindex C-x w b -@findex hi-lock-write-interactive-patterns -Insert all the current highlighting regexp/face pairs into the buffer -at point, with comment delimiters to prevent them from changing your -program. (This key binding runs the -@code{hi-lock-write-interactive-patterns} command.) - -These patterns are extracted from the comments, if appropriate, if you -invoke @kbd{M-x hi-lock-find-patterns}, or if you visit the file while -Hi Lock mode is enabled (since that runs @code{hi-lock-find-patterns}). - -@item C-x w i -@kindex C-x w i -@findex hi-lock-find-patterns -Extract regexp/face pairs from comments in the current buffer -(@code{hi-lock-find-patterns}). Thus, you can enter patterns -interactively with @code{highlight-regexp}, store them into the file -with @code{hi-lock-write-interactive-patterns}, edit them (perhaps -including different faces for different parenthesized parts of the -match), and finally use this command (@code{hi-lock-find-patterns}) to -have Hi Lock highlight the edited patterns. - -@vindex hi-lock-file-patterns-policy -The variable @code{hi-lock-file-patterns-policy} controls whether Hi -Lock mode should automatically extract and highlight patterns found in -a file when it is visited. Its value can be @code{nil} (never -highlight), @code{t} (highlight the patterns), @code{ask} (query the -user), or a function. If it is a function, -@code{hi-lock-find-patterns} calls it with the patterns as argument; -if the function returns non-@code{nil}, the patterns are used. The -default is @code{nil}. Note that patterns are always highlighted if -you call @code{hi-lock-find-patterns} directly, regardless of the -value of this variable. - -@vindex hi-lock-exclude-modes -Also, @code{hi-lock-find-patterns} does nothing if the current major -mode's symbol is a member of the list @code{hi-lock-exclude-modes}. -@end table - -@node Fringes -@section Window Fringes -@cindex fringes - - On a graphical display, each Emacs window normally has narrow -@dfn{fringes} on the left and right edges. The fringes display -indications about the text in the window. - - The most common use of the fringes is to indicate a continuation -line, when one line of text is split into multiple lines on the -screen. The left fringe shows a curving arrow for each screen line -except the first, indicating that ``this is not the real beginning.'' -The right fringe shows a curving arrow for each screen line except the -last, indicating that ``this is not the real end.'' - - The fringes indicate line truncation with short horizontal arrows -meaning ``there's more text on this line which is scrolled -horizontally out of view;'' clicking the mouse on one of the arrows -scrolls the display horizontally in the direction of the arrow. The -fringes can also indicate other things, such as empty lines, or where a -program you are debugging is executing (@pxref{Debuggers}). - -@findex set-fringe-style -@findex fringe-mode - You can enable and disable the fringes for all frames using -@kbd{M-x fringe-mode}. To enable and disable the fringes -for the selected frame, use @kbd{M-x set-fringe-style}. - -@node Displaying Boundaries -@section Displaying Boundaries - -@vindex indicate-buffer-boundaries - On a graphical display, Emacs can indicate the buffer boundaries in -the fringes. It indicates the first line and the last line with -angle images in the fringes. This can be combined with up and down -arrow images which say whether it is possible to scroll the window up -and down. - - The buffer-local variable @code{indicate-buffer-boundaries} controls -how the buffer boundaries and window scrolling is indicated in the -fringes. If the value is @code{left} or @code{right}, both angle and -arrow bitmaps are displayed in the left or right fringe, respectively. - - If value is an alist, each element @code{(@var{indicator} . -@var{position})} specifies the position of one of the indicators. -The @var{indicator} must be one of @code{top}, @code{bottom}, -@code{up}, @code{down}, or @code{t} which specifies the default -position for the indicators not present in the alist. -The @var{position} is one of @code{left}, @code{right}, or @code{nil} -which specifies not to show this indicator. - - For example, @code{((top . left) (t . right))} places the top angle -bitmap in left fringe, the bottom angle bitmap in right fringe, and -both arrow bitmaps in right fringe. To show just the angle bitmaps in -the left fringe, but no arrow bitmaps, use @code{((top . left) -(bottom . left))}. - -@vindex default-indicate-buffer-boundaries - The value of the variable @code{default-indicate-buffer-boundaries} -is the default value for @code{indicate-buffer-boundaries} in buffers -that do not override it. - -@node Useless Whitespace -@section Useless Whitespace - -@cindex trailing whitespace -@cindex whitespace, trailing -@vindex show-trailing-whitespace - It is easy to leave unnecessary spaces at the end of a line, or -empty lines at the end of a file, without realizing it. In most -cases, this @dfn{trailing whitespace} has no effect, but there are -special circumstances where it matters. It can also be a nuisance -that the line has ``changed,'' when the change is just spaces added or -removed at the end. - - You can make trailing whitespace at the end of a line visible on the -screen by setting the buffer-local variable -@code{show-trailing-whitespace} to @code{t}. Then Emacs displays -trailing whitespace in the face @code{trailing-whitespace}. - - This feature does not apply when point is at the end of the line -containing the whitespace. Strictly speaking, that is ``trailing -whitespace'' nonetheless, but displaying it specially in that case -looks ugly while you are typing in new text. In this special case, -the location of point is enough to show you that the spaces are -present. - -@findex delete-trailing-whitespace - To delete all trailing whitespace within the current buffer's -accessible portion (@pxref{Narrowing}), type @kbd{M-x -delete-trailing-whitespace @key{RET}}. (This command does not remove -the form-feed characters.) - -@vindex indicate-empty-lines -@vindex default-indicate-empty-lines -@cindex unused lines -@cindex fringes, and unused line indication - Emacs can indicate unused lines at the end of the window with a -small image in the left fringe (@pxref{Fringes}). The image appears -for window lines that do not correspond to any buffer text. Blank -lines at the end of the buffer then stand out because they do not have -this image in the fringe. - - To enable this feature, set the buffer-local variable -@code{indicate-empty-lines} to a non-@code{nil} value. The default -value of this variable is controlled by the variable -@code{default-indicate-empty-lines}; by setting that variable, you -can enable or disable this feature for all new buffers. (This feature -currently doesn't work on text-only terminals.) - -@node Selective Display -@section Selective Display -@cindex selective display -@findex set-selective-display -@kindex C-x $ - - Emacs has the ability to hide lines indented more than a certain number -of columns (you specify how many columns). You can use this to get an -overview of a part of a program. - - To hide lines in the current buffer, type @kbd{C-x $} -(@code{set-selective-display}) with a numeric argument @var{n}. Then -lines with at least @var{n} columns of indentation disappear from the -screen. The only indication of their presence is that three dots -(@samp{@dots{}}) appear at the end of each visible line that is -followed by one or more hidden ones. - - The commands @kbd{C-n} and @kbd{C-p} move across the hidden lines as -if they were not there. - - The hidden lines are still present in the buffer, and most editing -commands see them as usual, so you may find point in the middle of the -hidden text. When this happens, the cursor appears at the end of the -previous line, after the three dots. If point is at the end of the -visible line, before the newline that ends it, the cursor appears before -the three dots. - - To make all lines visible again, type @kbd{C-x $} with no argument. - -@vindex selective-display-ellipses - If you set the variable @code{selective-display-ellipses} to -@code{nil}, the three dots do not appear at the end of a line that -precedes hidden lines. Then there is no visible indication of the -hidden lines. This variable becomes local automatically when set. - - See also @ref{Outline Mode} for another way to hide part of -the text in a buffer. - -@node Optional Mode Line -@section Optional Mode Line Features - -@cindex buffer size display -@cindex display of buffer size -@findex size-indication-mode - The buffer percentage @var{pos} indicates the percentage of the -buffer above the top of the window. You can additionally display the -size of the buffer by typing @kbd{M-x size-indication-mode} to turn on -Size Indication mode. The size will be displayed immediately -following the buffer percentage like this: - -@example -@var{POS} of @var{SIZE} -@end example - -@noindent -Here @var{SIZE} is the human readable representation of the number of -characters in the buffer, which means that @samp{k} for 10^3, @samp{M} -for 10^6, @samp{G} for 10^9, etc., are used to abbreviate. - -@cindex narrowing, and buffer size display - If you have narrowed the buffer (@pxref{Narrowing}), the size of the -accessible part of the buffer is shown. - -@cindex line number display -@cindex display of line number -@findex line-number-mode - The current line number of point appears in the mode line when Line -Number mode is enabled. Use the command @kbd{M-x line-number-mode} to -turn this mode on and off; normally it is on. The line number appears -after the buffer percentage @var{pos}, with the letter @samp{L} to -indicate what it is. - -@cindex Column Number mode -@cindex mode, Column Number -@findex column-number-mode - Similarly, you can display the current column number by turning on -Column number mode with @kbd{M-x column-number-mode}. The column -number is indicated by the letter @samp{C}. However, when both of -these modes are enabled, the line and column numbers are displayed in -parentheses, the line number first, rather than with @samp{L} and -@samp{C}. For example: @samp{(561,2)}. @xref{Minor Modes}, for more -information about minor modes and about how to use these commands. - -@cindex narrowing, and line number display - If you have narrowed the buffer (@pxref{Narrowing}), the displayed -line number is relative to the accessible portion of the buffer. -Thus, it isn't suitable as an argument to @code{goto-line}. (Use -@code{what-line} command to see the line number relative to the whole -file.) - -@vindex line-number-display-limit - If the buffer is very large (larger than the value of -@code{line-number-display-limit}), then the line number doesn't appear. -Emacs doesn't compute the line number when the buffer is large, because -that would be too slow. Set it to @code{nil} to remove the limit. - -@vindex line-number-display-limit-width - Line-number computation can also be slow if the lines in the buffer -are too long. For this reason, Emacs normally doesn't display line -numbers if the average width, in characters, of lines near point is -larger than the value of the variable -@code{line-number-display-limit-width}. The default value is 200 -characters. - -@findex display-time -@cindex time (on mode line) - Emacs can optionally display the time and system load in all mode -lines. To enable this feature, type @kbd{M-x display-time} or customize -the option @code{display-time-mode}. The information added to the mode -line usually appears after the buffer name, before the mode names and -their parentheses. It looks like this: - -@example -@var{hh}:@var{mm}pm @var{l.ll} -@end example - -@noindent -@vindex display-time-24hr-format -Here @var{hh} and @var{mm} are the hour and minute, followed always by -@samp{am} or @samp{pm}. @var{l.ll} is the average number of running -processes in the whole system recently. (Some fields may be missing if -your operating system cannot support them.) If you prefer time display -in 24-hour format, set the variable @code{display-time-24hr-format} -to @code{t}. - -@cindex mail (on mode line) -@vindex display-time-use-mail-icon -@vindex display-time-mail-face -@vindex display-time-mail-file -@vindex display-time-mail-directory - The word @samp{Mail} appears after the load level if there is mail -for you that you have not read yet. On a graphical display you can use -an icon instead of @samp{Mail} by customizing -@code{display-time-use-mail-icon}; this may save some space on the mode -line. You can customize @code{display-time-mail-face} to make the mail -indicator prominent. Use @code{display-time-mail-file} to specify -the mail file to check, or set @code{display-time-mail-directory} -to specify the directory to check for incoming mail (any nonempty regular -file in the directory is considered as ``newly arrived mail''). - -@cindex mode line, 3D appearance -@cindex attributes of mode line, changing -@cindex non-integral number of lines in a window - By default, the mode line is drawn on graphics displays with -3D-style highlighting, like that of a button when it is not being -pressed. If you don't like this effect, you can disable the 3D -highlighting of the mode line, by customizing the attributes of the -@code{mode-line} face. @xref{Face Customization}. - -@cindex non-selected windows, mode line appearance - By default, the mode line of nonselected windows is displayed in a -different face, called @code{mode-line-inactive}. Only the selected -window is displayed in the @code{mode-line} face. This helps show -which window is selected. When the minibuffer is selected, since -it has no mode line, the window from which you activated the minibuffer -has its mode line displayed using @code{mode-line}; as a result, -ordinary entry to the minibuffer does not change any mode lines. - -@vindex mode-line-in-non-selected-windows - You can disable use of @code{mode-line-inactive} by setting variable -@code{mode-line-in-non-selected-windows} to @code{nil}; then all mode -lines are displayed in the @code{mode-line} face. - -@vindex eol-mnemonic-unix -@vindex eol-mnemonic-dos -@vindex eol-mnemonic-mac -@vindex eol-mnemonic-undecided - You can customize the mode line display for each of the end-of-line -formats by setting each of the variables @code{eol-mnemonic-unix}, -@code{eol-mnemonic-dos}, @code{eol-mnemonic-mac}, and -@code{eol-mnemonic-undecided} to the strings you prefer. - -@node Text Display -@section How Text Is Displayed -@cindex characters (in text) - - @acronym{ASCII} printing characters (octal codes 040 through 0176) in Emacs -buffers are displayed with their graphics, as are non-ASCII multibyte -printing characters (octal codes above 0400). - - Some @acronym{ASCII} control characters are displayed in special ways. The -newline character (octal code 012) is displayed by starting a new line. -The tab character (octal code 011) is displayed by moving to the next -tab stop column (normally every 8 columns). - - Other @acronym{ASCII} control characters are normally displayed as a caret -(@samp{^}) followed by the non-control version of the character; thus, -control-A is displayed as @samp{^A}. The caret appears in face -@code{escape-glyph}. - - Non-@acronym{ASCII} characters 0200 through 0237 (octal) are -displayed with octal escape sequences; thus, character code 0230 -(octal) is displayed as @samp{\230}. The backslash appears in face -@code{escape-glyph}. - -@vindex ctl-arrow - If the variable @code{ctl-arrow} is @code{nil}, control characters in -the buffer are displayed with octal escape sequences, except for newline -and tab. Altering the value of @code{ctl-arrow} makes it local to the -current buffer; until that time, the default value is in effect. The -default is initially @code{t}. - - The display of character codes 0240 through 0377 (octal) may be -either as escape sequences or as graphics. They do not normally occur -in multibyte buffers, but if they do, they are displayed as Latin-1 -graphics. In unibyte mode, if you enable European display they are -displayed using their graphics (assuming your terminal supports them), -otherwise as escape sequences. @xref{Unibyte Mode}. - -@vindex nobreak-char-display -@cindex no-break space, display -@cindex no-break hyphen, display -@cindex soft hyphen, display - Some character sets define ``no-break'' versions of the space and -hyphen characters, which are used where a line should not be broken. -Emacs normally displays these characters with special faces -(respectively, @code{nobreak-space} and @code{escape-glyph}) to -distinguish them from ordinary spaces and hyphens. You can turn off -this feature by setting the variable @code{nobreak-char-display} to -@code{nil}. If you set the variable to any other value, that means to -prefix these characters with an escape character. - -@vindex tab-width -@vindex default-tab-width - Normally, a tab character in the buffer is displayed as whitespace which -extends to the next display tab stop position, and display tab stops come -at intervals equal to eight spaces. The number of spaces per tab is -controlled by the variable @code{tab-width}, which is made local by -changing it. Note that how the tab character -in the buffer is displayed has nothing to do with the definition of -@key{TAB} as a command. The variable @code{tab-width} must have an -integer value between 1 and 1000, inclusive. The variable -@code{default-tab-width} controls the default value of this variable -for buffers where you have not set it locally. - - You can customize the way any particular character code is displayed -by means of a display table. @xref{Display Tables,, Display Tables, -elisp, The Emacs Lisp Reference Manual}. - -@node Cursor Display -@section Displaying the Cursor - -@findex blink-cursor-mode -@vindex blink-cursor-alist -@cindex cursor, locating visually -@cindex cursor, blinking - You can customize the cursor's color, and whether it blinks, using -the @code{cursor} Custom group (@pxref{Easy Customization}). On -a graphical display, the command @kbd{M-x blink-cursor-mode} enables -or disables the blinking of the cursor. (On text terminals, the -terminal itself blinks the cursor, and Emacs has no control over it.) -You can control how the cursor appears when it blinks off by setting -the variable @code{blink-cursor-alist}. - -@vindex visible-cursor - Some text terminals offer two different cursors: the normal cursor -and the very visible cursor, where the latter may be e.g. bigger or -blinking. By default Emacs uses the very visible cursor, and switches -to it when you start or resume Emacs. If the variable -@code{visible-cursor} is @code{nil} when Emacs starts or resumes, it -doesn't switch, so it uses the normal cursor. - -@cindex cursor in non-selected windows -@vindex cursor-in-non-selected-windows - Normally, the cursor appears in non-selected windows in the ``off'' -state, with the same appearance as when the blinking cursor blinks -``off.'' For a box cursor, this is a hollow box; for a bar cursor, -this is a thinner bar. To turn off cursors in non-selected windows, -customize the variable @code{cursor-in-non-selected-windows} and assign -it a @code{nil} value. - -@vindex x-stretch-cursor -@cindex wide block cursor - On graphical displays, Emacs can optionally draw the block cursor -as wide as the character under the cursor---for example, if the cursor -is on a tab character, it would cover the full width occupied by that -tab character. To enable this feature, set the variable -@code{x-stretch-cursor} to a non-@code{nil} value. - -@findex hl-line-mode -@findex global-hl-line-mode -@cindex highlight current line - To make the cursor even more visible, you can use HL Line mode, a -minor mode that highlights the line containing point. Use @kbd{M-x -hl-line-mode} to enable or disable it in the current buffer. @kbd{M-x -global-hl-line-mode} enables or disables the same mode globally. - -@node Line Truncation -@section Truncation of Lines - -@cindex truncation -@cindex line truncation, and fringes - As an alternative to continuation, Emacs can display long lines by -@dfn{truncation}. This means that all the characters that do not fit -in the width of the screen or window do not appear at all. On -graphical displays, a small straight arrow in the fringe indicates -truncation at either end of the line. On text-only terminals, @samp{$} -appears in the first column when there is text truncated to the left, -and in the last column when there is text truncated to the right. - -@vindex truncate-lines -@findex toggle-truncate-lines - Horizontal scrolling automatically causes line truncation -(@pxref{Horizontal Scrolling}). You can explicitly enable line -truncation for a particular buffer with the command @kbd{M-x -toggle-truncate-lines}. This works by locally changing the variable -@code{truncate-lines}. If that variable is non-@code{nil}, long lines -are truncated; if it is @code{nil}, they are continued onto multiple -screen lines. Setting the variable @code{truncate-lines} in any way -makes it local to the current buffer; until that time, the default -value is in effect. The default value is normally @code{nil}. - -@c @vindex truncate-partial-width-windows @c Idx entry is in Split Windows. - If the variable @code{truncate-partial-width-windows} is -non-@code{nil}, it forces truncation rather than continuation in any -window less than the full width of the screen or frame, regardless of -the value of @code{truncate-lines}. For information about side-by-side -windows, see @ref{Split Window}. See also @ref{Display,, Display, -elisp, The Emacs Lisp Reference Manual}. - -@vindex overflow-newline-into-fringe - If the variable @code{overflow-newline-into-fringe} is -non-@code{nil} on a graphical display, then Emacs does not continue or -truncate a line which is exactly as wide as the window. Instead, the -newline overflows into the right fringe, and the cursor appears in the -fringe when positioned on that newline. - -@node Display Custom -@section Customization of Display - - This section describes variables (@pxref{Variables}) that you can -change to customize how Emacs displays. Beginning users can skip -it. -@c the reason for that pxref is because an xref early in the -@c ``echo area'' section leads here. - -@vindex inverse-video - If the variable @code{inverse-video} is non-@code{nil}, Emacs attempts -to invert all the lines of the display from what they normally are. - -@vindex visible-bell - If the variable @code{visible-bell} is non-@code{nil}, Emacs attempts -to make the whole screen blink when it would normally make an audible bell -sound. This variable has no effect if your terminal does not have a way -to make the screen blink. - -@vindex echo-keystrokes - The variable @code{echo-keystrokes} controls the echoing of multi-character -keys; its value is the number of seconds of pause required to cause echoing -to start, or zero, meaning don't echo at all. The value takes effect when -there is someting to echo. @xref{Echo Area}. - -@vindex baud-rate - The variable @anchor{baud-rate}@code{baud-rate} holds the output -speed of the terminal, as far as Emacs knows. Setting this variable -does not change the speed of actual data transmission, but the value -is used for calculations. On text-only terminals, it affects padding, -and decisions about whether to scroll part of the screen or redraw it -instead. It also affects the behavior of incremental search. - - On graphical displays, @code{baud-rate} is only used to determine -how frequently to look for pending input during display updating. A -higher value of @code{baud-rate} means that check for pending input -will be done less frequently. - -@cindex hourglass pointer display -@vindex hourglass-delay - On graphical display, Emacs can optionally display the mouse pointer -in a special shape to say that Emacs is busy. To turn this feature on -or off, customize the group @code{cursor}. You can also control the -amount of time Emacs must remain busy before the busy indicator is -displayed, by setting the variable @code{hourglass-delay}. - -@vindex overline-margin - On graphical display, this variables specifies the vertical position -of an overline above the text, including the height of the overline -itself (1 pixel). The default value is 2 pixels. - -@vindex x-underline-at-descent-line - On graphical display, Emacs normally draws an underline at the -baseline level of the font. If @code{x-underline-at-descent-line} is -non-@code{nil}, Emacs draws the underline at the same height as the -font's descent line. - -@findex tty-suppress-bold-inverse-default-colors - On some text-only terminals, bold face and inverse video together -result in text that is hard to read. Call the function -@code{tty-suppress-bold-inverse-default-colors} with a non-@code{nil} -argument to suppress the effect of bold-face in this case. - -@vindex no-redraw-on-reenter - On a text-only terminal, when you reenter Emacs after suspending, Emacs -normally clears the screen and redraws the entire display. On some -terminals with more than one page of memory, it is possible to arrange -the termcap entry so that the @samp{ti} and @samp{te} strings (output -to the terminal when Emacs is entered and exited, respectively) switch -between pages of memory so as to use one page for Emacs and another -page for other output. On such terminals, you might want to set the variable -@code{no-redraw-on-reenter} non-@code{nil}; this tells Emacs to -assume, when resumed, that the screen page it is using still contains -what Emacs last wrote there. - -@ignore - arch-tag: 2219f910-2ff0-4521-b059-1bd231a536c4 -@end ignore diff --git a/man/ebrowse.texi b/man/ebrowse.texi deleted file mode 100644 index c04f99f954c..00000000000 --- a/man/ebrowse.texi +++ /dev/null @@ -1,1462 +0,0 @@ -\input texinfo @c -*-texinfo-*- - -@comment %**start of header -@setfilename ../info/ebrowse -@settitle A Class Browser for C++ -@setchapternewpage odd -@syncodeindex fn cp -@comment %**end of header - -@copying -This file documents Ebrowse, a C++ class browser for GNU Emacs. - -Copyright @copyright{} 2000, 2001, 2002, 2003, 2004, -2005, 2006, 2007 Free Software Foundation, Inc. - -@quotation -Permission is granted to copy, distribute and/or modify this document -under the terms of the GNU Free Documentation License, Version 1.2 or -any later version published by the Free Software Foundation; with no -Invariant Sections, with the Front-Cover texts being ``A GNU -Manual,'' and with the Back-Cover Texts as in (a) below. A copy of the -license is included in the section entitled ``GNU Free Documentation -License'' in the Emacs manual. - -(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify -this GNU Manual, like GNU software. Copies published by the Free -Software Foundation raise funds for GNU development.'' - -This document is part of a collection distributed under the GNU Free -Documentation License. If you want to distribute this document -separately from the collection, you can do so by adding a copy of the -license to the document, as described in section 6 of the license. -@end quotation -@end copying - -@dircategory Emacs -@direntry -* Ebrowse: (ebrowse). A C++ class browser for Emacs. -@end direntry - -@titlepage -@title Ebrowse User's Manual -@sp 4 -@subtitle Ebrowse/Emacs -@sp 5 -@author Gerd Moellmann -@page -@vskip 0pt plus 1filll -@insertcopying -@end titlepage - -@node Top, Overview, (dir), (dir) - -@ifnottex -You can browse C++ class hierarchies from within Emacs by using -Ebrowse. -@end ifnottex - -@menu -* Overview:: What is it and how does it work? -* Generating browser files:: How to process C++ source files -* Loading a Tree:: How to start browsing -* Tree Buffers:: Traversing class hierarchies -* Member Buffers:: Looking at member information -* Tags-like Functions:: Finding members from source files -* GNU Free Documentation License:: The license for this documentation. -* Concept Index:: An entry for each concept defined -@end menu - - - - -@node Overview, Generating browser files, Top, Top -@chapter Introduction - -When working in software projects using C++, I frequently missed -software support for two things: - -@itemize @bullet -@item -When you get a new class library, or you have to work on source code you -haven't written yourself (or written sufficiently long ago), you need a -tool to let you navigate class hierarchies and investigate -features of the software. Without such a tool you often end up -@command{grep}ing through dozens or even hundreds of files. - -@item -Once you are productive, it would be nice to have a tool that knows your -sources and can help you while you are editing source code. Imagine to -be able to jump to the definition of an identifier while you are -editing, or something that can complete long identifier names because it -knows what identifiers are defined in your program@dots{}. -@end itemize - -The design of Ebrowse reflects these two needs. - -How does it work? - -@cindex parser for C++ sources -A fast parser written in C is used to process C++ source files. -The parser generates a data base containing information about classes, -members, global functions, defines, types etc.@: found in the sources. - -The second part of Ebrowse is a Lisp program. This program reads -the data base generated by the parser. It displays its contents in -various forms and allows you to perform operations on it, or do -something with the help of the knowledge contained in the data base. - -@cindex major modes, of Ebrowse buffers -@dfn{Navigational} use of Ebrowse is centered around two -types of buffers which define their own major modes: - -@cindex tree buffer -@dfn{Tree buffers} are used to view class hierarchies in tree form. -They allow you to quickly find classes, find or view class declarations, -perform operations like query replace on sets of your source files, and -finally tree buffers are used to produce the second buffer form---member -buffers. @xref{Tree Buffers}. - -@cindex member buffer -Members are displayed in @dfn{member buffers}. Ebrowse -distinguishes between six different types of members; each type is -displayed as a member list of its own: - -@itemize @bullet -@item -Instance member variables; - -@item -Instance member functions; - -@item -Static member variables; - -@item -Static member functions; - -@item -Friends/Defines. The list of defines is contained in the friends -list of the pseudo-class @samp{*Globals*}; - -@item -Types (@code{enum}s, and @code{typedef}s defined with class -scope).@refill -@end itemize - -You can switch member buffers from one list to another, or to another -class. You can include inherited members in the display, you can set -filters that remove categories of members from the display, and most -importantly you can find or view member declarations and definitions -with a keystroke. @xref{Member Buffers}. - -These two buffer types and the commands they provide support the -navigational use of the browser. The second form resembles Emacs' Tags -package for C and other procedural languages. Ebrowse's commands of -this type are not confined to special buffers; they are most often used -while you are editing your source code. - -To list just a subset of what you can use the Tags part of Ebrowse for: - -@itemize @bullet -@item -Jump to the definition or declaration of an identifier in your source -code, with an electric position stack that lets you easily navigate -back and forth. - -@item -Complete identifiers in your source with a completion list containing -identifiers from your source code only. - -@item -Perform search and query replace operations over some or all of your -source files. - -@item -Show all identifiers matching a regular expression---and jump to one of -them, if you like. -@end itemize - - - - -@node Generating browser files, Loading a Tree, Overview, Top -@comment node-name, next, previous, up -@chapter Processing Source Files - -@cindex @command{ebrowse}, the program -@cindex class data base creation -Before you can start browsing a class hierarchy, you must run the parser -@command{ebrowse} on your source files in order to generate a Lisp data -base describing your program. - -@cindex command line for @command{ebrowse} -The operation of @command{ebrowse} can be tailored with command line -options. Under normal circumstances it suffices to let the parser use -its default settings. If you want to do that, call it with a command -line like: - -@example -ebrowse *.h *.cc -@end example - -@noindent -or, if your shell doesn't allow all the file names to be specified on -the command line, - -@example -ebrowse --files=@var{file} -@end example - -@noindent -where @var{file} contains the names of the files to be parsed, one -per line. - -@findex --help -When invoked with option @samp{--help}, @command{ebrowse} prints a list of -available command line options.@refill - -@menu -* Input files:: Specifying which files to parse -* Output file:: Changing the output file name -* Structs and unions:: Omitting @code{struct}s and @code{union}s -* Matching:: Setting regular expression lengths -* Verbosity:: Getting feedback for lengthy operations -@end menu - - - - -@comment name, next, prev, up -@node Input files, Output file, Generating browser files, Generating browser files -@section Specifying Input Files - -@table @samp -@cindex input files, for @command{ebrowse} -@item file -Each file name on the command line tells @command{ebrowse} to parse -that file. - -@cindex response files -@findex --files -@item --files=@var{file} -This command line switch specifies that @var{file} contains a list of -file names to parse. Each line in @var{file} must contain one file -name. More than one option of this kind is allowed. You might, for -instance, want to use one file for header files, and another for source -files. - -@cindex standard input, specifying input files -@item standard input -When @command{ebrowse} finds no file names on the command line, and no -@samp{--file} option is specified, it reads file names from standard -input. This is sometimes convenient when @command{ebrowse} is used as part -of a command pipe. - -@findex --search-path -@item --search-path=@var{paths} -This option lets you specify search paths for your input files. -@var{paths} is a list of directory names, separated from each other by a -either a colon or a semicolon, depending on the operating system. -@end table - -@cindex header files -@cindex friend functions -It is generally a good idea to specify input files so that header files -are parsed before source files. This facilitates the parser's work of -properly identifying friend functions of a class. - - - -@comment name, next, prev, up -@node Output file, Structs and unions, Input files, Generating browser files -@section Changing the Output File Name - -@table @samp -@cindex output file name -@findex --output-file -@cindex @file{BROWSE} file -@item --output-file=@var{file} -This option instructs @command{ebrowse} to generate a Lisp data base with -name @var{file}. By default, the data base is named @file{BROWSE}, and -is written in the directory in which @command{ebrowse} is invoked. - -If you regularly use data base names different from the default, you -might want to add this to your init file: - -@lisp -(add-to-list 'auto-mode-alist '(@var{NAME} . ebrowse-tree-mode)) -@end lisp - -@noindent -where @var{NAME} is the Lisp data base name you are using. - -@findex --append -@cindex appending output to class data base -@item --append -By default, each run of @command{ebrowse} erases the old contents of the -output file when writing to it. You can instruct @command{ebrowse} to -append its output to an existing file produced by @command{ebrowse} -with this command line option. -@end table - - - - -@comment name, next, prev, up -@node Structs and unions, Matching, Output file, Generating browser files -@section Structs and Unions -@cindex structs -@cindex unions - -@table @samp -@findex --no-structs-or-unions -@item --no-structs-or-unions -This switch suppresses all classes in the data base declared as -@code{struct} or @code{union} in the output. - -This is mainly useful when you are converting an existing -C program to C++, and do not want to see the old C structs in a class -tree. -@end table - - - - -@comment name, next, prev, up -@node Matching, Verbosity, Structs and unions, Generating browser files -@section Regular Expressions - -@cindex regular expressions, recording -The parser @command{ebrowse} normally writes regular expressions to its -output file that help the Lisp part of Ebrowse to find functions, -variables etc.@: in their source files. - -You can instruct @command{ebrowse} to omit these regular expressions by -calling it with the command line switch @samp{--no-regexps}. - -When you do this, the Lisp part of Ebrowse tries to guess, from member -or class names, suitable regular expressions to locate that class or -member in source files. This works fine in most cases, but the -automatic generation of regular expressions can be too weak if unusual -coding styles are used. - -@table @samp -@findex --no-regexps -@item --no-regexps -This option turns off regular expression recording. - -@findex --min-regexp-length -@cindex minimum regexp length for recording -@item --min-regexp-length=@var{n} -The number @var{n} following this option specifies the minimum length of -the regular expressions recorded to match class and member declarations -and definitions. The default value is set at compilation time of -@command{ebrowse}. - -The smaller the minimum length, the higher the probability that -Ebrowse will find a wrong match. The larger the value, the -larger the output file and therefore the memory consumption once the -file is read from Emacs. - -@findex --max-regexp-length -@cindex maximum regexp length for recording -@item --max-regexp-length=@var{n} -The number following this option specifies the maximum length of the -regular expressions used to match class and member declarations and -definitions. The default value is set at compilation time of -@command{ebrowse}. - -The larger the maximum length, the higher the probability that the -browser will find a correct match, but the larger the value the larger -the output file and therefore the memory consumption once the data is -read. As a second effect, the larger the regular expression, the higher -the probability that it will no longer match after editing the file. -@end table - - - - -@node Verbosity, , Matching, Generating browser files -@comment node-name, next, previous, up -@section Verbose Mode -@cindex verbose operation - -@table @samp -@findex --verbose -@item --verbose -When this option is specified on the command line, @command{ebrowse} prints -a period for each file parsed, and it displays a @samp{+} for each -class written to the output file. - -@findex --very-verbose -@item --very-verbose -This option makes @command{ebrowse} print out the names of the files and -the names of the classes seen. -@end table - - - - -@node Loading a Tree, Tree Buffers, Generating browser files, Top -@comment node-name, next, previous, up -@chapter Starting to Browse -@cindex loading -@cindex browsing - -You start browsing a class hierarchy parsed by @command{ebrowse} by just -finding the @file{BROWSE} file with @kbd{C-x C-f}. - -An example of a tree buffer display is shown below. - -@example -| Collection -| IndexedCollection -| Array -| FixedArray -| Set -| Dictionary -@end example - -@cindex mouse highlight in tree buffers -When you run Emacs on a display which supports colors and the mouse, you -will notice that certain areas in the tree buffer are highlighted -when you move the mouse over them. This highlight marks mouse-sensitive -regions in the buffer. Please notice the help strings in the echo area -when the mouse moves over a sensitive region. - -@cindex context menu -A click with @kbd{Mouse-3} on a mouse-sensitive region opens a context -menu. In addition to this, each buffer also has a buffer-specific menu -that is opened with a click with @kbd{Mouse-3} somewhere in the buffer -where no highlight is displayed. - - - -@comment **************************************************************** -@comment *** -@comment *** TREE BUFFERS -@comment *** -@comment **************************************************************** - -@node Tree Buffers, Member Buffers, Loading a Tree, Top -@comment node-name, next, previous, up -@chapter Tree Buffers -@cindex tree buffer mode -@cindex class trees - -Class trees are displayed in @dfn{tree buffers} which install their own -major mode. Most Emacs keys work in tree buffers in the usual way, -e.g.@: you can move around in the buffer with the usual @kbd{C-f}, -@kbd{C-v} etc., or you can search with @kbd{C-s}. - -Tree-specific commands are bound to simple keystrokes, similar to -@code{Gnus}. You can take a look at the key bindings by entering -@kbd{?} which calls @code{M-x describe-mode} in both tree and member -buffers. - -@menu -* Source Display:: Viewing and finding a class declaration -* Member Display:: Showing members, switching to member buffers -* Go to Class:: Finding a class -* Quitting:: Discarding and burying the tree buffer -* File Name Display:: Showing file names in the tree -* Expanding and Collapsing:: Expanding and collapsing branches -* Tree Indentation:: Changing the tree indentation -* Killing Classes:: Removing class from the tree -* Saving a Tree:: Saving a modified tree -* Statistics:: Displaying class tree statistics -* Marking Classes:: Marking and unmarking classes -@end menu - - - -@node Source Display, Member Display, Tree Buffers, Tree Buffers -@comment node-name, next, previous, up -@section Viewing and Finding Class Declarations -@cindex viewing, class -@cindex finding a class -@cindex class declaration - -You can view or find a class declaration when the cursor is on a class -name. - -@table @kbd -@item SPC -This command views the class declaration if the database -contains informations about it. If you don't parse the entire source -you are working on, some classes will only be known to exist but the -location of their declarations and definitions will not be known.@refill - -@item RET -Works like @kbd{SPC}, except that it finds the class -declaration rather than viewing it, so that it is ready for -editing.@refill -@end table - -The same functionality is available from the menu opened with -@kbd{Mouse-3} on the class name. - - - - -@node Member Display, Go to Class, Source Display, Tree Buffers -@comment node-name, next, previous, up -@section Displaying Members -@cindex @samp{*Members*} buffer -@cindex @samp{*Globals*} -@cindex freezing a member buffer -@cindex member lists, in tree buffers - -Ebrowse distinguishes six different kinds of members, each of -which is displayed as a separate @dfn{member list}: instance variables, -instance functions, static variables, static functions, friend -functions, and types. - -Each of these lists can be displayed in a member buffer with a command -starting with @kbd{L} when the cursor is on a class name. By default, -there is only one member buffer named @dfn{*Members*} that is reused -each time you display a member list---this has proven to be more -practical than to clutter up the buffer list with dozens of member -buffers. - -If you want to display more than one member list at a time you can -@dfn{freeze} its member buffer. Freezing a member buffer prevents it -from being overwritten the next time you display a member list. You can -toggle this buffer status at any time. - -Every member list display command in the tree buffer can be used with a -prefix argument (@kbd{C-u}). Without a prefix argument, the command will -pop to a member buffer displaying the member list. With prefix argument, -the member buffer will additionally be @dfn{frozen}. - -@table @kbd -@cindex instance member variables, list -@item L v -This command displays the list of instance member variables. - -@cindex static variables, list -@item L V -Display the list of static variables. - -@cindex friend functions, list -@item L d -Display the list of friend functions. This list is used for defines if -you are viewing the class @samp{*Globals*} which is a place holder for -global symbols. - -@cindex member functions, list -@item L f -Display the list of member functions. - -@cindex static member functions, list -@item L F -Display the list of static member functions. - -@cindex types, list -@item L t -Display a list of types. -@end table - -These lists are also available from the class' context menu invoked with -@kbd{Mouse-3} on the class name. - - - - -@node Go to Class, Quitting, Member Display, Tree Buffers -@comment node-name, next, previous, up -@section Finding a Class -@cindex locate class -@cindex expanding branches -@cindex class location - -@table @kbd -@cindex search for class -@item / -This command reads a class name from the minibuffer with completion and -positions the cursor on the class in the class tree. - -If the branch of the class tree containing the class searched for is -currently collapsed, the class itself and all its base classes are -recursively made visible. (See also @ref{Expanding and -Collapsing}.)@refill - -This function is also available from the tree buffer's context menu. - -@item n -Repeat the last search done with @kbd{/}. Each tree buffer has its own -local copy of the regular expression last searched in it. -@end table - - - - -@node Quitting, File Name Display, Go to Class, Tree Buffers -@comment node-name, next, previous, up -@section Burying a Tree Buffer -@cindex burying tree buffer - -@table @kbd -@item q -Is a synonym for @kbd{M-x bury-buffer}. -@end table - - - - -@node File Name Display, Expanding and Collapsing, Quitting, Tree Buffers -@comment node-name, next, previous, up -@section Displaying File Names - -@table @kbd -@cindex file names in tree buffers -@item T f -This command toggles the display of file names in a tree buffer. If -file name display is switched on, the names of the files containing the -class declaration are shown to the right of the class names. If the -file is not known, the string @samp{unknown} is displayed. - -This command is also provided in the tree buffer's context menu. - -@item s -Display file names for the current line, or for the number of lines -given by a prefix argument. -@end table - -Here is an example of a tree buffer with file names displayed. - -@example -| Collection (unknown) -| IndexedCollection (indexedcltn.h) -| Array (array.h) -| FixedArray (fixedarray.h) -| Set (set.h) -| Dictionary (dict.h) -@end example - - - - -@node Expanding and Collapsing, Tree Indentation, File Name Display, Tree Buffers -@comment node-name, next, previous, up -@section Expanding and Collapsing a Tree -@cindex expand tree branch -@cindex collapse tree branch -@cindex branches of class tree -@cindex class tree, collapse or expand - -You can expand and collapse parts of a tree to reduce the complexity of -large class hierarchies. Expanding or collapsing branches of a tree has -no impact on the functionality of other commands, like @kbd{/}. (See -also @ref{Go to Class}.)@refill - -Collapsed branches are indicated with an ellipsis following the class -name like in the example below. - -@example -| Collection -| IndexedCollection... -| Set -| Dictionary -@end example - -@table @kbd -@item - -This command collapses the branch of the tree starting at the class the -cursor is on. - -@item + -This command expands the branch of the tree starting at the class the -cursor is on. Both commands for collapsing and expanding branches are -also available from the class' object menu. - -@item * -This command expands all collapsed branches in the tree. -@end table - - - - -@node Tree Indentation, Killing Classes, Expanding and Collapsing, Tree Buffers -@comment node-name, next, previous, up -@section Changing the Tree Indentation -@cindex tree indentation -@cindex indentation of the tree - -@table @kbd -@item T w -This command reads a new indentation width from the minibuffer and -redisplays the tree buffer with the new indentation It is also -available from the tree buffer's context menu. -@end table - - - - -@node Killing Classes, Saving a Tree, Tree Indentation, Tree Buffers -@comment node-name, next, previous, up -@section Removing Classes from the Tree -@cindex killing classes -@cindex class, remove from tree - -@table @kbd -@item C-k -This command removes the class the cursor is on and all its derived -classes from the tree. The user is asked for confirmation before the -deletion is actually performed. -@end table - - - - -@node Saving a Tree, Statistics, Killing Classes, Tree Buffers -@comment node-name, next, previous, up -@comment node-name, next, previous, up -@section Saving a Tree -@cindex save tree to a file -@cindex tree, save to a file -@cindex class tree, save to a file - -@table @kbd -@item C-x C-s -This command writes a class tree to the file from which it was read. -This is useful after classes have been deleted from a tree. - -@item C-x C-w -Writes the tree to a file whose name is read from the minibuffer. -@end table - - - - -@node Statistics, Marking Classes, Saving a Tree, Tree Buffers -@comment node-name, next, previous, up -@cindex statistics for a tree -@cindex tree statistics -@cindex class statistics - -@table @kbd -@item x -Display statistics for the tree, like number of classes in it, number of -member functions, etc. This command can also be found in the buffer's -context menu. -@end table - - - - -@node Marking Classes, , Statistics, Tree Buffers -@comment node-name, next, previous, up -@cindex marking classes -@cindex operations on marked classes - -Classes can be marked for operations similar to the standard Emacs -commands @kbd{M-x tags-search} and @kbd{M-x tags-query-replace} (see -also @xref{Tags-like Functions}.)@refill - -@table @kbd -@cindex toggle mark -@item M t -Toggle the mark of the line point is in or for as many lines as given by -a prefix command. This command can also be found in the class' context -menu. - -@cindex unmark all -@item M a -Unmark all classes. With prefix argument @kbd{C-u}, mark all classes in -the tree. Since this command operates on the whole buffer, it can also be -found in the buffer's object menu. -@end table - -Marked classes are displayed with an @code{>} in column one of the tree -display, like in the following example - -@example -|> Collection -| IndexedCollection... -|> Set -| Dictionary -@end example - - - - -@c **************************************************************** -@c *** -@c *** MEMBER BUFFERS -@c *** -@c **************************************************************** - -@node Member Buffers, Tags-like Functions, Tree Buffers, Top -@comment node-name, next, previous, up -@chapter Member Buffers -@cindex members -@cindex member buffer mode - -@cindex class members, types -@cindex types of class members -@dfn{Member buffers} are used to operate on lists of members of a class. -Ebrowse distinguishes six kinds of lists: - -@itemize @bullet -@item -Instance variables (normal member variables); -@item -Instance functions (normal member functions); -@item -Static variables; -@item -Static member functions; -@item -Friend functions; -@item -Types (@code{enum}s and @code{typedef}s defined with class scope. -Nested classes will be shown in the class tree like normal classes. -@end itemize - -Like tree buffers, member buffers install their own major mode. Also -like in tree buffers, menus are provided for certain areas in the -buffer: members, classes, and the buffer itself. - -@menu -* Switching Member Lists:: Choosing which members to display -* Finding/Viewing:: Modifying source code -* Inherited Members:: Display of Inherited Members -* Searching Members:: Finding members in member buffer -* Switching to Tree:: Going back to the tree buffer -* Filters:: Selective member display -* Attributes:: Display of @code{virtual} etc. -* Long and Short Display:: Comprehensive and verbose display -* Regexp Display:: Showing matching regular expressions -* Switching Classes:: Displaying another class -* Killing/Burying:: Getting rid of the member buffer -* Column Width:: Display style -* Redisplay:: Redrawing the member list -* Getting Help:: How to get help for key bindings -@end menu - - - - -@node Switching Member Lists, Finding/Viewing, Member Buffers, Member Buffers -@comment node-name, next, previous, up -@section Switching Member Lists -@cindex member lists, in member buffers -@cindex static members -@cindex friends -@cindex types -@cindex defines - -@table @kbd -@cindex next member list -@item L n -This command switches the member buffer display to the next member list. - -@cindex previous member list -@item L p -This command switches the member buffer display to the previous member -list. - -@item L f -Switch to the list of member functions. - -@cindex static -@item L F -Switch to the list of static member functions. - -@item L v -Switch to the list of member variables. - -@item L V -Switch to the list of static member variables. - -@item L d -Switch to the list of friends or defines. - -@item L t -Switch to the list of types. -@end table - -Both commands cycle through the member list. - -Most of the commands are also available from the member buffer's -context menu. - - - - -@node Finding/Viewing, Inherited Members, Switching Member Lists, Member Buffers -@comment node-name, next, previous, up -@section Finding and Viewing Member Source -@cindex finding members, in member buffers -@cindex viewing members, in member buffers -@cindex member definitions, in member buffers -@cindex member declarations, in member buffers -@cindex definition of a member, in member buffers -@cindex declaration of a member, in member buffers - -@table @kbd -@item RET -This command finds the definition of the member the cursor is on. -Finding involves roughly the same as the standard Emacs tags facility -does---loading the file and searching for a regular expression matching -the member. - -@item f -This command finds the declaration of the member the cursor is on. - -@item SPC -This is the same command as @kbd{RET}, but views the member definition -instead of finding the member's source file. - -@item v -This is the same command as @kbd{f}, but views the member's declaration -instead of finding the file the declaration is in. -@end table - -You can install a hook function to perform actions after a member or -class declaration or definition has been found, or when it is not found. - -All the commands described above can also be found in the context menu -displayed when clicking @kbd{Mouse-2} on a member name. - - - - -@node Inherited Members, Searching Members, Finding/Viewing, Member Buffers -@comment node-name, next, previous, up -@section Display of Inherited Members -@cindex superclasses, members -@cindex base classes, members -@cindex inherited members - -@table @kbd -@item D b -This command toggles the display of inherited members in the member -buffer. This is also in the buffer's context menu. -@end table - - - - -@node Searching Members, Switching to Tree, Inherited Members, Member Buffers -@comment node-name, next, previous, up -@section Searching Members -@cindex searching members - -@table @kbd -@item G v -Position the cursor on a member whose name is read from the minibuffer; -only members shown in the current member buffer appear in the completion -list. - -@item G m -Like the above command, but all members for the current class appear in -the completion list. If necessary, the current member list is switched -to the one containing the member. - -With a prefix argument (@kbd{C-u}), all members in the class tree, -i.e.@: all members the browser knows about appear in the completion -list. The member display will be switched to the class and member list -containing the member. - -@item G n -Repeat the last member search. -@end table - -Look into the buffer's context menu for a convenient way to do this with -a mouse. - - - -@node Switching to Tree, Filters, Searching Members, Member Buffers -@comment node-name, next, previous, up -@section Switching to Tree Buffer -@cindex tree buffer, switch to -@cindex buffer switching -@cindex switching buffers - -@table @kbd -@item @key{TAB} -Pop up the tree buffer to which the member buffer belongs. - -@item t -Do the same as @key{TAB} but also position the cursor on the class -displayed in the member buffer. -@end table - - - - -@node Filters, Attributes, Switching to Tree, Member Buffers -@comment node-name, next, previous, up -@section Filters -@cindex filters - -@table @kbd -@cindex @code{public} members -@item F a u -This command toggles the display of @code{public} members. The -@samp{a} stands for `access'. - -@cindex @code{protected} members -@item F a o -This command toggles the display of @code{protected} members. - -@cindex @code{private} members -@item F a i -This command toggles the display of @code{private} members. - -@cindex @code{virtual} members -@item F v -This command toggles the display of @code{virtual} members. - -@cindex @code{inline} members -@item F i -This command toggles the display of @code{inline} members. - -@cindex @code{const} members -@item F c -This command toggles the display of @code{const} members. - -@cindex pure virtual members -@item F p -This command toggles the display of pure virtual members. - -@cindex remove filters -@item F r -This command removes all filters. -@end table - -These commands are also found in the buffer's context menu. - - - - -@node Attributes, Long and Short Display, Filters, Member Buffers -@comment node-name, next, previous, up -@section Displaying Member Attributes -@cindex attributes -@cindex member attribute display - -@table @kbd -@item D a -Toggle the display of member attributes (default is on). - -The nine member attributes Ebrowse knows about are displayed -as a list a single-characters flags enclosed in angle brackets in front -the of the member's name. A @samp{-} at a given position means that -the attribute is false. The list of attributes from left to right is - -@table @samp -@cindex @code{template} attribute -@item T -The member is a template. - -@cindex @code{extern "C"} attribute -@item C -The member is declared @code{extern "C"}. - -@cindex @code{virtual} attribute -@item v -Means the member is declared @code{virtual}. - -@cindex @code{inline} -@item i -The member is declared @code{inline}. - -@cindex @code{const} attribute -@item c -The member is @code{const}. - -@cindex pure virtual function attribute -@item 0 -The member is a pure virtual function. - -@cindex @code{mutable} attribute -@item m -The member is declared @code{mutable}. - -@cindex @code{explicit} attribute -@item e -The member is declared @code{explicit}. - -@item t -The member is a function with a throw list. -@end table -@end table - -This command is also in the buffer's context menu. - - - -@node Long and Short Display, Regexp Display, Attributes, Member Buffers -@comment node-name, next, previous, up -@section Long and Short Member Display -@cindex display form -@cindex long display -@cindex short display - -@table @kbd -@item D l -This command toggles the member buffer between short and long display -form. The short display form displays member names, only: - -@example -| isEmpty contains hasMember create -| storeSize hash isEqual restoreGuts -| saveGuts -@end example - -The long display shows one member per line with member name and regular -expressions matching the member (if known): - -@example -| isEmpty Bool isEmpty () const... -| hash unsigned hash () const... -| isEqual int isEqual (... -@end example - -Regular expressions will only be displayed when the Lisp database has -not been produced with the @command{ebrowse} option @samp{--no-regexps}. -@xref{Matching, --no-regexps, Regular Expressions}. -@end table - - - - -@node Regexp Display, Switching Classes, Long and Short Display, Member Buffers -@comment node-name, next, previous, up -@section Display of Regular Expressions -@cindex regular expression display - -@table @kbd -@item D r -This command toggles the long display form from displaying the regular -expressions matching the member declarations to those expressions -matching member definitions. -@end table - -Regular expressions will only be displayed when the Lisp database has -not been produced with the @command{ebrowse} option @samp{--no-regexps}, -see @ref{Matching, --no-regexps, Regular Expressions}. - - - - -@node Switching Classes, Killing/Burying, Regexp Display, Member Buffers -@comment node-name, next, previous, up -@section Displaying Another Class -@cindex base class, display -@cindex derived class, display -@cindex superclass, display -@cindex subclass, display -@cindex class display - -@table @kbd -@item C c -This command lets you switch the member buffer to another class. It -reads the name of the new class from the minibuffer with completion. - -@item C b -This is the same command as @kbd{C c} but restricts the classes shown in -the completion list to immediate base classes, only. If only one base -class exists, this one is immediately shown in the minibuffer. - -@item C d -Same as @kbd{C b}, but for derived classes. - -@item C p -Switch to the previous class in the class hierarchy on the same level as -the class currently displayed. - -@item C n -Switch to the next sibling of the class in the class tree. -@end table - - - - -@node Killing/Burying, Column Width, Switching Classes, Member Buffers -@comment node-name, next, previous, up -@section Burying a Member Buffer -@cindex burying member buffers - -@table @kbd -@item q -This command is a synonym for @kbd{M-x bury-buffer}. -@end table - - - - -@node Column Width, Redisplay, Killing/Burying, Member Buffers -@comment node-name, next, previous, up -@section Setting the Column Width -@cindex column width -@cindex member indentation -@cindex indentation, member - -@table @kbd -@item D w -This command sets the column width depending on the display form used -(long or short display). -@end table - - - - -@node Redisplay, Getting Help, Column Width, Member Buffers -@comment node-name, next, previous, up -@section Forced Redisplay -@cindex redisplay of member buffers - -@table @kbd -@item C-l -This command forces a redisplay of the member buffer. If the width -of the window displaying the member buffer is changed this command -redraws the member list with the appropriate column widths and number of -columns. -@end table - - - - -@node Getting Help, , Redisplay, Member Buffers -@comment node-name, next, previous, up -@cindex help - -@table @kbd -@item ? -This key is bound to @code{describe-mode}. -@end table - - - - -@comment ************************************************************** -@comment *** TAGS LIKE FUNCTIONS -@comment ************************************************************** - -@node Tags-like Functions, GNU Free Documentation License, Member Buffers, Top -@comment node-name, next, previous, up -@chapter Tags-like Functions - -Ebrowse provides tags functions similar to those of the standard -Emacs Tags facility, but better suited to the needs of C++ programmers. - -@menu -* Finding and Viewing:: Going to a member declaration/definition -* Position Stack:: Moving to previous locations -* Search & Replace:: Searching and replacing over class tree files -* Members in Files:: Listing all members in a given file -* Apropos:: Listing members matching a regular expression -* Symbol Completion:: Completing names while editing -* Member Buffer Display:: Quickly display a member buffer for some - identifier -@end menu - - - -@node Finding and Viewing, Position Stack, Tags-like Functions, Tags-like Functions -@comment node-name, next, previous, up -@section Finding and Viewing Members -@cindex finding class member, in C++ source -@cindex viewing class member, in C++ source -@cindex tags -@cindex member definition, finding, in C++ source -@cindex member declaration, finding, in C++ source - -The functions in this section are similar to those described in -@ref{Source Display}, and also in @ref{Finding/Viewing}, except that -they work in a C++ source buffer, not in member and tree buffers created -by Ebrowse. - -@table @kbd -@item C-c C-m f -Find the definition of the member around point. If you invoke this -function with a prefix argument, the declaration is searched. - -If more than one class contains a member with the given name you can -select the class with completion. If there is a scope declaration in -front of the member name, this class name is used as initial input for -the completion. - -@item C-c C-m F -Find the declaration of the member around point. - -@item C-c C-m v -View the definition of the member around point. - -@item C-c C-m V -View the declaration of the member around point. - -@item C-c C-m 4 f -Find a member's definition in another window. - -@item C-c C-m 4 F -Find a member's declaration in another window. - -@item C-c C-m 4 v -View a member's definition in another window. - -@item C-c C-m 4 V -View a member's declaration in another window. - -@item C-c C-m 5 f -Find a member's definition in another frame. - -@item C-c C-m 5 F -Find a member's declaration in another frame. - -@item C-c C-m 5 v -View a member's definition in another frame. - -@item C-c C-m 5 V -View a member's declaration in another frame. -@end table - - - -@node Position Stack, Search & Replace, Finding and Viewing, Tags-like Functions -@comment node-name, next, previous, up -@section The Position Stack -@cindex position stack - -When jumping to a member declaration or definition with one of -Ebrowse's commands, the position from where you performed the -jump and the position where you jumped to are recorded in a -@dfn{position stack}. There are several ways in which you can quickly -move to positions in the stack:@refill - -@table @kbd -@cindex return to original position -@item C-c C-m - -This command sets point to the previous position in the position stack. -Directly after you performed a jump, this will put you back to the -position where you came from. - -The stack is not popped, i.e.@: you can always switch back and forth -between positions in the stack. To avoid letting the stack grow to -infinite size there is a maximum number of positions defined. When this -number is reached, older positions are discarded when new positions are -pushed on the stack. - -@item C-c C-m + -This command moves forward in the position stack, setting point to -the next position stored in the position stack. - -@item C-c C-m p -Displays an electric buffer showing all positions saved in the stack. -You can select a position by pressing @kbd{SPC} in a line. You can -view a position with @kbd{v}. -@end table - - - - -@node Search & Replace, Members in Files, Position Stack, Tags-like Functions -@comment node-name, next, previous, up -@section Searching and Replacing -@cindex searching multiple C++ files -@cindex replacing in multiple C++ files -@cindex restart tags-operation - -Ebrowse allows you to perform operations on all or a subset of the files -mentioned in a class tree. When you invoke one of the following -functions and more than one class tree is loaded, you must choose a -class tree to use from an electric tree menu. If the selected tree -contains marked classes, the following commands operate on the files -mentioned in the marked classes only. Otherwise all files in the class -tree are used. - -@table @kbd -@item C-c C-m s -This function performs a regular expression search in the chosen set of -files. - -@item C-c C-m u -This command performs a search for calls of a given member which is -selected in the usual way with completion. - -@item C-c C-m % -Perform a query replace over the set of files. - -@item C-c C-m , -All three operations above stop when finding a match. You can restart -the operation with this command. - -@item C-c C-m n -This restarts the last tags operation with the next file in the list. -@end table - - - - -@node Members in Files, Apropos, Search & Replace, Tags-like Functions -@comment node-name, next, previous, up -@section Members in Files -@cindex files -@cindex members in file, listing -@cindex list class members in a file -@cindex file, members - -The command @kbd{C-c C-m l}, lists all members in a given file. The file -name is read from the minibuffer with completion. - - - - -@node Apropos, Symbol Completion, Members in Files, Tags-like Functions -@comment node-name, next, previous, up -@section Member Apropos -@cindex apropos on class members -@cindex members, matching regexp - -The command @kbd{C-c C-m a} can be used to display all members matching a -given regular expression. This command can be very useful if you -remember only part of a member name, and not its beginning. - -A special buffer is popped up containing all identifiers matching the -regular expression, and what kind of symbol it is (e.g.@: a member -function, or a type). You can then switch to this buffer, and use the -command @kbd{C-c C-m f}, for example, to jump to a specific member. - - - - -@node Symbol Completion, Member Buffer Display, Apropos, Tags-like Functions -@comment node-name, next, previous, up -@section Symbol Completion -@cindex completion -@cindex symbol completion - -The command @kbd{C-c C-m @key{TAB}} completes the symbol in front of point. - - - - -@node Member Buffer Display, , Symbol Completion, Tags-like Functions -@section Quick Member Display -@cindex member buffer, for member at point - -You can quickly display a member buffer containing the member the cursor -in on with the command @kbd{C-c C-m m}. - - -@node GNU Free Documentation License, Concept Index, Tags-like Functions, Top -@appendix GNU Free Documentation License -@include doclicense.texi - - -@node Concept Index, , GNU Free Documentation License, Top -@unnumbered Concept Index -@printindex cp - -@contents -@bye - -@ignore - arch-tag: 52fe78ac-a1c4-48e7-815e-0a31acfad4bf -@end ignore diff --git a/man/emacs-mime.texi b/man/emacs-mime.texi deleted file mode 100644 index 0f3c141c792..00000000000 --- a/man/emacs-mime.texi +++ /dev/null @@ -1,1832 +0,0 @@ -\input texinfo - -@setfilename ../info/emacs-mime -@settitle Emacs MIME Manual -@synindex fn cp -@synindex vr cp -@synindex pg cp - -@copying -This file documents the Emacs MIME interface functionality. - -Copyright @copyright{} 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, -2006, 2007 Free Software Foundation, Inc. - -@quotation -Permission is granted to copy, distribute and/or modify this document -under the terms of the GNU Free Documentation License, Version 1.2 or -any later version published by the Free Software Foundation; with no -Invariant Sections, with the Front-Cover texts being ``A GNU -Manual'', and with the Back-Cover Texts as in (a) below. A copy of the -license is included in the section entitled ``GNU Free Documentation -License'' in the Emacs manual. - -(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify -this GNU Manual, like GNU software. Copies published by the Free -Software Foundation raise funds for GNU development.'' - -This document is part of a collection distributed under the GNU Free -Documentation License. If you want to distribute this document -separately from the collection, you can do so by adding a copy of the -license to the document, as described in section 6 of the license. -@end quotation -@end copying - -@c Node ``Interface Functions'' uses Latin-1 characters -@documentencoding ISO-8859-1 - -@dircategory Emacs -@direntry -* Emacs MIME: (emacs-mime). Emacs MIME de/composition library. -@end direntry -@iftex -@finalout -@end iftex -@setchapternewpage odd - -@titlepage -@title Emacs MIME Manual - -@author by Lars Magne Ingebrigtsen -@page -@vskip 0pt plus 1filll -@insertcopying -@end titlepage - -@node Top -@top Emacs MIME - -This manual documents the libraries used to compose and display -@acronym{MIME} messages. - -This manual is directed at users who want to modify the behavior of -the @acronym{MIME} encoding/decoding process or want a more detailed -picture of how the Emacs @acronym{MIME} library works, and people who want -to write functions and commands that manipulate @acronym{MIME} elements. - -@acronym{MIME} is short for @dfn{Multipurpose Internet Mail Extensions}. -This standard is documented in a number of RFCs; mainly RFC2045 (Format -of Internet Message Bodies), RFC2046 (Media Types), RFC2047 (Message -Header Extensions for Non-@acronym{ASCII} Text), RFC2048 (Registration -Procedures), RFC2049 (Conformance Criteria and Examples). It is highly -recommended that anyone who intends writing @acronym{MIME}-compliant software -read at least RFC2045 and RFC2047. - -@menu -* Decoding and Viewing:: A framework for decoding and viewing. -* Composing:: @acronym{MML}; a language for describing @acronym{MIME} parts. -* Interface Functions:: An abstraction over the basic functions. -* Basic Functions:: Utility and basic parsing functions. -* Standards:: A summary of RFCs and working documents used. -* GNU Free Documentation License:: The license for this documentation. -* Index:: Function and variable index. -@end menu - - -@node Decoding and Viewing -@chapter Decoding and Viewing - -This chapter deals with decoding and viewing @acronym{MIME} messages on a -higher level. - -The main idea is to first analyze a @acronym{MIME} article, and then allow -other programs to do things based on the list of @dfn{handles} that are -returned as a result of this analysis. - -@menu -* Dissection:: Analyzing a @acronym{MIME} message. -* Non-MIME:: Analyzing a non-@acronym{MIME} message. -* Handles:: Handle manipulations. -* Display:: Displaying handles. -* Display Customization:: Variables that affect display. -* Files and Directories:: Saving and naming attachments. -* New Viewers:: How to write your own viewers. -@end menu - - -@node Dissection -@section Dissection - -The @code{mm-dissect-buffer} is the function responsible for dissecting -a @acronym{MIME} article. If given a multipart message, it will recursively -descend the message, following the structure, and return a tree of -@acronym{MIME} handles that describes the structure of the message. - -@node Non-MIME -@section Non-MIME -@vindex mm-uu-configure-list - -Gnus also understands some non-@acronym{MIME} attachments, such as -postscript, uuencode, binhex, yenc, shar, forward, gnatsweb, pgp, -diff. Each of these features can be disabled by add an item into -@code{mm-uu-configure-list}. For example, - -@lisp -(require 'mm-uu) -(add-to-list 'mm-uu-configure-list '(pgp-signed . disabled)) -@end lisp - -@table @code -@item postscript -@findex postscript -PostScript file. - -@item uu -@findex uu -Uuencoded file. - -@item binhex -@findex binhex -Binhex encoded file. - -@item yenc -@findex yenc -Yenc encoded file. - -@item shar -@findex shar -Shar archive file. - -@item forward -@findex forward -Non-@acronym{MIME} forwarded message. - -@item gnatsweb -@findex gnatsweb -Gnatsweb attachment. - -@item pgp-signed -@findex pgp-signed -@acronym{PGP} signed clear text. - -@item pgp-encrypted -@findex pgp-encrypted -@acronym{PGP} encrypted clear text. - -@item pgp-key -@findex pgp-key -@acronym{PGP} public keys. - -@item emacs-sources -@findex emacs-sources -@vindex mm-uu-emacs-sources-regexp -Emacs source code. This item works only in the groups matching -@code{mm-uu-emacs-sources-regexp}. - -@item diff -@vindex diff -@vindex mm-uu-diff-groups-regexp -Patches. This is intended for groups where diffs of committed files -are automatically sent to. It only works in groups matching -@code{mm-uu-diff-groups-regexp}. - -@end table - -@node Handles -@section Handles - -A @acronym{MIME} handle is a list that fully describes a @acronym{MIME} -component. - -The following macros can be used to access elements in a handle: - -@table @code -@item mm-handle-buffer -@findex mm-handle-buffer -Return the buffer that holds the contents of the undecoded @acronym{MIME} -part. - -@item mm-handle-type -@findex mm-handle-type -Return the parsed @code{Content-Type} of the part. - -@item mm-handle-encoding -@findex mm-handle-encoding -Return the @code{Content-Transfer-Encoding} of the part. - -@item mm-handle-undisplayer -@findex mm-handle-undisplayer -Return the object that can be used to remove the displayed part (if it -has been displayed). - -@item mm-handle-set-undisplayer -@findex mm-handle-set-undisplayer -Set the undisplayer object. - -@item mm-handle-disposition -@findex mm-handle-disposition -Return the parsed @code{Content-Disposition} of the part. - -@item mm-get-content-id -Returns the handle(s) referred to by @code{Content-ID}. - -@end table - - -@node Display -@section Display - -Functions for displaying, removing and saving. - -@table @code -@item mm-display-part -@findex mm-display-part -Display the part. - -@item mm-remove-part -@findex mm-remove-part -Remove the part (if it has been displayed). - -@item mm-inlinable-p -@findex mm-inlinable-p -Say whether a @acronym{MIME} type can be displayed inline. - -@item mm-automatic-display-p -@findex mm-automatic-display-p -Say whether a @acronym{MIME} type should be displayed automatically. - -@item mm-destroy-part -@findex mm-destroy-part -Free all resources occupied by a part. - -@item mm-save-part -@findex mm-save-part -Offer to save the part in a file. - -@item mm-pipe-part -@findex mm-pipe-part -Offer to pipe the part to some process. - -@item mm-interactively-view-part -@findex mm-interactively-view-part -Prompt for a mailcap method to use to view the part. - -@end table - - -@node Display Customization -@section Display Customization - -@table @code - -@item mm-inline-media-tests -@vindex mm-inline-media-tests -This is an alist where the key is a @acronym{MIME} type, the second element -is a function to display the part @dfn{inline} (i.e., inside Emacs), and -the third element is a form to be @code{eval}ed to say whether the part -can be displayed inline. - -This variable specifies whether a part @emph{can} be displayed inline, -and, if so, how to do it. It does not say whether parts are -@emph{actually} displayed inline. - -@item mm-inlined-types -@vindex mm-inlined-types -This, on the other hand, says what types are to be displayed inline, if -they satisfy the conditions set by the variable above. It's a list of -@acronym{MIME} media types. - -@item mm-automatic-display -@vindex mm-automatic-display -This is a list of types that are to be displayed ``automatically'', but -only if the above variable allows it. That is, only inlinable parts can -be displayed automatically. - -@item mm-automatic-external-display -@vindex mm-automatic-external-display -This is a list of types that will be displayed automatically in an -external viewer. - -@item mm-keep-viewer-alive-types -@vindex mm-keep-viewer-alive-types -This is a list of media types for which the external viewer will not -be killed when selecting a different article. - -@item mm-attachment-override-types -@vindex mm-attachment-override-types -Some @acronym{MIME} agents create parts that have a content-disposition of -@samp{attachment}. This variable allows overriding that disposition and -displaying the part inline. (Note that the disposition is only -overridden if we are able to, and want to, display the part inline.) - -@item mm-discouraged-alternatives -@vindex mm-discouraged-alternatives -List of @acronym{MIME} types that are discouraged when viewing -@samp{multipart/alternative}. Viewing agents are supposed to view the -last possible part of a message, as that is supposed to be the richest. -However, users may prefer other types instead, and this list says what -types are most unwanted. If, for instance, @samp{text/html} parts are -very unwanted, and @samp{text/richtext} parts are somewhat unwanted, -you could say something like: - -@lisp -(setq mm-discouraged-alternatives - '("text/html" "text/richtext") - mm-automatic-display - (remove "text/html" mm-automatic-display)) -@end lisp - -Adding @code{"image/.*"} might also be useful. Spammers use images as -the preferred part of @samp{multipart/alternative} messages, so you might -not notice there are other parts. See also -@code{gnus-buttonized-mime-types}, @ref{MIME Commands, ,MIME Commands, -gnus, Gnus Manual}. After adding @code{"multipart/alternative"} to -@code{gnus-buttonized-mime-types} you can choose manually which -alternative you'd like to view. For example, you can set those -variables like: - -@lisp -(setq gnus-buttonized-mime-types - '("multipart/alternative" "multipart/signed") - mm-discouraged-alternatives - '("text/html" "image/.*")) -@end lisp - -In this case, Gnus will display radio buttons for such a kind of spam -message as follows: - -@example -1. (*) multipart/alternative ( ) image/gif - -2. (*) text/plain ( ) text/html -@end example - -@item mm-inline-large-images -@vindex mm-inline-large-images -When displaying inline images that are larger than the window, Emacs -does not enable scrolling, which means that you cannot see the whole -image. To prevent this, the library tries to determine the image size -before displaying it inline, and if it doesn't fit the window, the -library will display it externally (e.g. with @samp{ImageMagick} or -@samp{xv}). Setting this variable to @code{t} disables this check and -makes the library display all inline images as inline, regardless of -their size. - -@item mm-inline-override-types -@vindex mm-inline-override-types -@code{mm-inlined-types} may include regular expressions, for example to -specify that all @samp{text/.*} parts be displayed inline. If a user -prefers to have a type that matches such a regular expression be treated -as an attachment, that can be accomplished by setting this variable to a -list containing that type. For example assuming @code{mm-inlined-types} -includes @samp{text/.*}, then including @samp{text/html} in this -variable will cause @samp{text/html} parts to be treated as attachments. - -@item mm-text-html-renderer -@vindex mm-text-html-renderer -This selects the function used to render @acronym{HTML}. The predefined -renderers are selected by the symbols @code{w3}, -@code{w3m}@footnote{See @uref{http://emacs-w3m.namazu.org/} for more -information about emacs-w3m}, @code{links}, @code{lynx}, -@code{w3m-standalone} or @code{html2text}. If @code{nil} use an -external viewer. You can also specify a function, which will be -called with a @acronym{MIME} handle as the argument. - -@item mm-inline-text-html-with-images -@vindex mm-inline-text-html-with-images -Some @acronym{HTML} mails might have the trick of spammers using -@samp{<img>} tags. It is likely to be intended to verify whether you -have read the mail. You can prevent your personal informations from -leaking by setting this option to @code{nil} (which is the default). -It is currently ignored by Emacs/w3. For emacs-w3m, you may use the -command @kbd{t} on the image anchor to show an image even if it is -@code{nil}.@footnote{The command @kbd{T} will load all images. If you -have set the option @code{w3m-key-binding} to @code{info}, use @kbd{i} -or @kbd{I} instead.} - -@item mm-w3m-safe-url-regexp -@vindex mm-w3m-safe-url-regexp -A regular expression that matches safe URL names, i.e. URLs that are -unlikely to leak personal information when rendering @acronym{HTML} -email (the default value is @samp{\\`cid:}). If @code{nil} consider -all URLs safe. - -@item mm-inline-text-html-with-w3m-keymap -@vindex mm-inline-text-html-with-w3m-keymap -You can use emacs-w3m command keys in the inlined text/html part by -setting this option to non-@code{nil}. The default value is @code{t}. - -@item mm-external-terminal-program -@vindex mm-external-terminal-program -The program used to start an external terminal. - -@item mm-enable-external -@vindex mm-enable-external -Indicate whether external @acronym{MIME} handlers should be used. - -If @code{t}, all defined external @acronym{MIME} handlers are used. If -@code{nil}, files are saved to disk (@code{mailcap-save-binary-file}). -If it is the symbol @code{ask}, you are prompted before the external -@acronym{MIME} handler is invoked. - -When you launch an attachment through mailcap (@pxref{mailcap}) an -attempt is made to use a safe viewer with the safest options---this isn't -the case if you save it to disk and launch it in a different way -(command line or double-clicking). Anyhow, if you want to be sure not -to launch any external programs, set this variable to @code{nil} or -@code{ask}. - -@end table - -@node Files and Directories -@section Files and Directories - -@table @code - -@item mm-default-directory -@vindex mm-default-directory -The default directory for saving attachments. If @code{nil} use -@code{default-directory}. - -@item mm-tmp-directory -@vindex mm-tmp-directory -Directory for storing temporary files. - -@item mm-file-name-rewrite-functions -@vindex mm-file-name-rewrite-functions -A list of functions used for rewriting file names of @acronym{MIME} -parts. Each function is applied successively to the file name. -Ready-made functions include - -@table @code -@item mm-file-name-delete-control -@findex mm-file-name-delete-control -Delete all control characters. - -@item mm-file-name-delete-gotchas -@findex mm-file-name-delete-gotchas -Delete characters that could have unintended consequences when used -with flawed shell scripts, i.e. @samp{|}, @samp{>} and @samp{<}; and -@samp{-}, @samp{.} as the first character. - -@item mm-file-name-delete-whitespace -@findex mm-file-name-delete-whitespace -Remove all whitespace. - -@item mm-file-name-trim-whitespace -@findex mm-file-name-trim-whitespace -Remove leading and trailing whitespace. - -@item mm-file-name-collapse-whitespace -@findex mm-file-name-collapse-whitespace -Collapse multiple whitespace characters. - -@item mm-file-name-replace-whitespace -@findex mm-file-name-replace-whitespace -@vindex mm-file-name-replace-whitespace -Replace whitespace with underscores. Set the variable -@code{mm-file-name-replace-whitespace} to any other string if you do -not like underscores. -@end table - -The standard Emacs functions @code{capitalize}, @code{downcase}, -@code{upcase} and @code{upcase-initials} might also prove useful. - -@item mm-path-name-rewrite-functions -@vindex mm-path-name-rewrite-functions -List of functions used for rewriting the full file names of @acronym{MIME} -parts. This is used when viewing parts externally, and is meant for -transforming the absolute name so that non-compliant programs can find -the file where it's saved. - -@end table - -@node New Viewers -@section New Viewers - -Here's an example viewer for displaying @code{text/enriched} inline: - -@lisp -(defun mm-display-enriched-inline (handle) - (let (text) - (with-temp-buffer - (mm-insert-part handle) - (save-window-excursion - (enriched-decode (point-min) (point-max)) - (setq text (buffer-string)))) - (mm-insert-inline handle text))) -@end lisp - -We see that the function takes a @acronym{MIME} handle as its parameter. It -then goes to a temporary buffer, inserts the text of the part, does some -work on the text, stores the result, goes back to the buffer it was -called from and inserts the result. - -The two important helper functions here are @code{mm-insert-part} and -@code{mm-insert-inline}. The first function inserts the text of the -handle in the current buffer. It handles charset and/or content -transfer decoding. The second function just inserts whatever text you -tell it to insert, but it also sets things up so that the text can be -``undisplayed'' in a convenient manner. - - -@node Composing -@chapter Composing -@cindex Composing -@cindex MIME Composing -@cindex MML -@cindex MIME Meta Language - -Creating a @acronym{MIME} message is boring and non-trivial. Therefore, -a library called @code{mml} has been defined that parses a language -called @acronym{MML} (@acronym{MIME} Meta Language) and generates -@acronym{MIME} messages. - -@findex mml-generate-mime -The main interface function is @code{mml-generate-mime}. It will -examine the contents of the current (narrowed-to) buffer and return a -string containing the @acronym{MIME} message. - -@menu -* Simple MML Example:: An example @acronym{MML} document. -* MML Definition:: All valid @acronym{MML} elements. -* Advanced MML Example:: Another example @acronym{MML} document. -* Encoding Customization:: Variables that affect encoding. -* Charset Translation:: How charsets are mapped from @sc{mule} to @acronym{MIME}. -* Conversion:: Going from @acronym{MIME} to @acronym{MML} and vice versa. -* Flowed text:: Soft and hard newlines. -@end menu - - -@node Simple MML Example -@section Simple MML Example - -Here's a simple @samp{multipart/alternative}: - -@example -<#multipart type=alternative> -This is a plain text part. -<#part type=text/enriched> -<center>This is a centered enriched part</center> -<#/multipart> -@end example - -After running this through @code{mml-generate-mime}, we get this: - -@example -Content-Type: multipart/alternative; boundary="=-=-=" - - ---=-=-= - - -This is a plain text part. - ---=-=-= -Content-Type: text/enriched - - -<center>This is a centered enriched part</center> - ---=-=-=-- -@end example - - -@node MML Definition -@section MML Definition - -The @acronym{MML} language is very simple. It looks a bit like an SGML -application, but it's not. - -The main concept of @acronym{MML} is the @dfn{part}. Each part can be of a -different type or use a different charset. The way to delineate a part -is with a @samp{<#part ...>} tag. Multipart parts can be introduced -with the @samp{<#multipart ...>} tag. Parts are ended by the -@samp{<#/part>} or @samp{<#/multipart>} tags. Parts started with the -@samp{<#part ...>} tags are also closed by the next open tag. - -There's also the @samp{<#external ...>} tag. These introduce -@samp{external/message-body} parts. - -Each tag can contain zero or more parameters on the form -@samp{parameter=value}. The values may be enclosed in quotation marks, -but that's not necessary unless the value contains white space. So -@samp{filename=/home/user/#hello$^yes} is perfectly valid. - -The following parameters have meaning in @acronym{MML}; parameters that have no -meaning are ignored. The @acronym{MML} parameter names are the same as the -@acronym{MIME} parameter names; the things in the parentheses say which -header it will be used in. - -@table @samp -@item type -The @acronym{MIME} type of the part (@code{Content-Type}). - -@item filename -Use the contents of the file in the body of the part -(@code{Content-Disposition}). - -@item charset -The contents of the body of the part are to be encoded in the character -set specified (@code{Content-Type}). @xref{Charset Translation}. - -@item name -Might be used to suggest a file name if the part is to be saved -to a file (@code{Content-Type}). - -@item disposition -Valid values are @samp{inline} and @samp{attachment} -(@code{Content-Disposition}). - -@item encoding -Valid values are @samp{7bit}, @samp{8bit}, @samp{quoted-printable} and -@samp{base64} (@code{Content-Transfer-Encoding}). @xref{Charset -Translation}. - -@item description -A description of the part (@code{Content-Description}). - -@item creation-date -RFC822 date when the part was created (@code{Content-Disposition}). - -@item modification-date -RFC822 date when the part was modified (@code{Content-Disposition}). - -@item read-date -RFC822 date when the part was read (@code{Content-Disposition}). - -@item recipients -Who to encrypt/sign the part to. This field is used to override any -auto-detection based on the To/CC headers. - -@item sender -Identity used to sign the part. This field is used to override the -default key used. - -@item size -The size (in octets) of the part (@code{Content-Disposition}). - -@item sign -What technology to sign this @acronym{MML} part with (@code{smime}, @code{pgp} -or @code{pgpmime}) - -@item encrypt -What technology to encrypt this @acronym{MML} part with (@code{smime}, -@code{pgp} or @code{pgpmime}) - -@end table - -Parameters for @samp{text/plain}: - -@table @samp -@item format -Formatting parameter for the text, valid values include @samp{fixed} -(the default) and @samp{flowed}. Normally you do not specify this -manually, since it requires the textual body to be formatted in a -special way described in RFC 2646. @xref{Flowed text}. -@end table - -Parameters for @samp{application/octet-stream}: - -@table @samp -@item type -Type of the part; informal---meant for human readers -(@code{Content-Type}). -@end table - -Parameters for @samp{message/external-body}: - -@table @samp -@item access-type -A word indicating the supported access mechanism by which the file may -be obtained. Values include @samp{ftp}, @samp{anon-ftp}, @samp{tftp}, -@samp{localfile}, and @samp{mailserver}. (@code{Content-Type}.) - -@item expiration -The RFC822 date after which the file may no longer be fetched. -(@code{Content-Type}.) - -@item size -The size (in octets) of the file. (@code{Content-Type}.) - -@item permission -Valid values are @samp{read} and @samp{read-write} -(@code{Content-Type}). - -@end table - -Parameters for @samp{sign=smime}: - -@table @samp - -@item keyfile -File containing key and certificate for signer. - -@end table - -Parameters for @samp{encrypt=smime}: - -@table @samp - -@item certfile -File containing certificate for recipient. - -@end table - - -@node Advanced MML Example -@section Advanced MML Example - -Here's a complex multipart message. It's a @samp{multipart/mixed} that -contains many parts, one of which is a @samp{multipart/alternative}. - -@example -<#multipart type=mixed> -<#part type=image/jpeg filename=~/rms.jpg disposition=inline> -<#multipart type=alternative> -This is a plain text part. -<#part type=text/enriched name=enriched.txt> -<center>This is a centered enriched part</center> -<#/multipart> -This is a new plain text part. -<#part disposition=attachment> -This plain text part is an attachment. -<#/multipart> -@end example - -And this is the resulting @acronym{MIME} message: - -@example -Content-Type: multipart/mixed; boundary="=-=-=" - - ---=-=-= - - - ---=-=-= -Content-Type: image/jpeg; - filename="~/rms.jpg" -Content-Disposition: inline; - filename="~/rms.jpg" -Content-Transfer-Encoding: base64 - -/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRof -Hh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/wAALCAAwADABAREA/8QAHwAA -AQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQR -BRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RF -RkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ip -qrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/9oACAEB -AAA/AO/rifFHjldNuGsrDa0qcSSHkA+gHrXKw+LtWLrMb+RgTyhbr+HSug07xNqV9fQtZrNI -AyiaE/NuBPOOOP0rvRNE880KOC8TbXXGCv1FPqjrF4LDR7u5L7SkTFT/ALWOP1xXgTuXfc7E -sx6nua6rwp4IvvEM8chCxWxOdzn7wz6V9AaB4S07w9p5itow0rDLSY5Pt9K43xO66P4xs71m -2QXiGCbA4yOVJ9+1aYORkdK434lyNH4ahCnG66VT9Nj15JFbPdX0MS43M4VQf5/yr2vSpLnw -5ZW8dlCZ8KFXjOPX0/mK6rSPEGt3Angu44fNEReHYNvIH3TzXDeKNO8RX+kSX2ouZkicTIOc -L+g7E810ulFjpVtv3bwgB3HJyK5L4quY/C9sVxk3ij/xx6850u7t1mtp/wDlpEw3An3Jr3Dw -34gsbWza4nBlhC5LDsaW6+IFgupQyCF3iHH7gA7c9R9ay7zx6t7aX9jHC4smhfBkGCvHGfrm -tLQ7hbnRrV1GPkAP1x1/Hr+Ncr8Vzjwrbf8AX6v/AKA9eQRyYlQk8Yx9K6XTNbkgia2ciSIn -7p5Ga9Atte0LTLKO6it4i7dVRFJDcZ4PvXN+JvEMF9bILVGXJLSZ4zkjivRPDaeX4b08HOTC -pOffmua+KkbS+GLVUGT9tT/0B68eeIpIFYjB70+OOVXyoOM9+M1eaWeCLzHPyHGO/NVWvJJm -jQ8KGH1NfQWhXSXmh2c8eArRLwO3HSv/2Q== - ---=-=-= -Content-Type: multipart/alternative; boundary="==-=-=" - - ---==-=-= - - -This is a plain text part. - ---==-=-= -Content-Type: text/enriched; - name="enriched.txt" - - -<center>This is a centered enriched part</center> - ---==-=-=-- - ---=-=-= - -This is a new plain text part. - ---=-=-= -Content-Disposition: attachment - - -This plain text part is an attachment. - ---=-=-=-- -@end example - -@node Encoding Customization -@section Encoding Customization - -@table @code - -@item mm-body-charset-encoding-alist -@vindex mm-body-charset-encoding-alist -Mapping from @acronym{MIME} charset to encoding to use. This variable is -usually used except, e.g., when other requirements force a specific -encoding (digitally signed messages require 7bit encodings). The -default is - -@lisp -((iso-2022-jp . 7bit) - (iso-2022-jp-2 . 7bit) - (utf-16 . base64) - (utf-16be . base64) - (utf-16le . base64)) -@end lisp - -As an example, if you do not want to have ISO-8859-1 characters -quoted-printable encoded, you may add @code{(iso-8859-1 . 8bit)} to -this variable. You can override this setting on a per-message basis -by using the @code{encoding} @acronym{MML} tag (@pxref{MML Definition}). - -@item mm-coding-system-priorities -@vindex mm-coding-system-priorities -Prioritize coding systems to use for outgoing messages. The default -is @code{nil}, which means to use the defaults in Emacs, but is -@code{(iso-8859-1 iso-2022-jp iso-2022-jp-2 shift_jis utf-8)} when -running Emacs in the Japanese language environment. It is a list of -coding system symbols (aliases of coding systems are also allowed, use -@kbd{M-x describe-coding-system} to make sure you are specifying correct -coding system names). For example, if you have configured Emacs -to prefer UTF-8, but wish that outgoing messages should be sent in -ISO-8859-1 if possible, you can set this variable to -@code{(iso-8859-1)}. You can override this setting on a per-message -basis by using the @code{charset} @acronym{MML} tag (@pxref{MML Definition}). - -@item mm-content-transfer-encoding-defaults -@vindex mm-content-transfer-encoding-defaults -Mapping from @acronym{MIME} types to encoding to use. This variable is usually -used except, e.g., when other requirements force a safer encoding -(digitally signed messages require 7bit encoding). Besides the normal -@acronym{MIME} encodings, @code{qp-or-base64} may be used to indicate that for -each case the most efficient of quoted-printable and base64 should be -used. - -@code{qp-or-base64} has another effect. It will fold long lines so that -MIME parts may not be broken by MTA. So do @code{quoted-printable} and -@code{base64}. - -Note that it affects body encoding only when a part is a raw forwarded -message (which will be made by @code{gnus-summary-mail-forward} with the -arg 2 for example) or is neither the @samp{text/*} type nor the -@samp{message/*} type. Even though in those cases, you can override -this setting on a per-message basis by using the @code{encoding} -@acronym{MML} tag (@pxref{MML Definition}). - -@item mm-use-ultra-safe-encoding -@vindex mm-use-ultra-safe-encoding -When this is non-@code{nil}, it means that textual parts are encoded as -quoted-printable if they contain lines longer than 76 characters or -starting with "From " in the body. Non-7bit encodings (8bit, binary) -are generally disallowed. This reduce the probability that a non-8bit -clean MTA or MDA changes the message. This should never be set -directly, but bound by other functions when necessary (e.g., when -encoding messages that are to be digitally signed). - -@end table - -@node Charset Translation -@section Charset Translation -@cindex charsets - -During translation from @acronym{MML} to @acronym{MIME}, for each -@acronym{MIME} part which has been composed inside Emacs, an appropriate -charset has to be chosen. - -@vindex mail-parse-charset -If you are running a non-@sc{mule} Emacs, this process is simple: If the -part contains any non-@acronym{ASCII} (8-bit) characters, the @acronym{MIME} charset -given by @code{mail-parse-charset} (a symbol) is used. (Never set this -variable directly, though. If you want to change the default charset, -please consult the documentation of the package which you use to process -@acronym{MIME} messages. -@xref{Various Message Variables, , Various Message Variables, message, - Message Manual}, for example.) -If there are only @acronym{ASCII} characters, the @acronym{MIME} charset US-ASCII is -used, of course. - -@cindex MULE -@cindex UTF-8 -@cindex Unicode -@vindex mm-mime-mule-charset-alist -Things are slightly more complicated when running Emacs with @sc{mule} -support. In this case, a list of the @sc{mule} charsets used in the -part is obtained, and the @sc{mule} charsets are translated to -@acronym{MIME} charsets by consulting the table provided by Emacs itself -or the variable @code{mm-mime-mule-charset-alist} for XEmacs. -If this results in a single @acronym{MIME} charset, this is used to encode -the part. But if the resulting list of @acronym{MIME} charsets contains more -than one element, two things can happen: If it is possible to encode the -part via UTF-8, this charset is used. (For this, Emacs must support -the @code{utf-8} coding system, and the part must consist entirely of -characters which have Unicode counterparts.) If UTF-8 is not available -for some reason, the part is split into several ones, so that each one -can be encoded with a single @acronym{MIME} charset. The part can only be -split at line boundaries, though---if more than one @acronym{MIME} charset is -required to encode a single line, it is not possible to encode the part. - -When running Emacs with @sc{mule} support, the preferences for which -coding system to use is inherited from Emacs itself. This means that -if Emacs is set up to prefer UTF-8, it will be used when encoding -messages. You can modify this by altering the -@code{mm-coding-system-priorities} variable though (@pxref{Encoding -Customization}). - -The charset to be used can be overridden by setting the @code{charset} -@acronym{MML} tag (@pxref{MML Definition}) when composing the message. - -The encoding of characters (quoted-printable, 8bit etc) is orthogonal -to the discussion here, and is controlled by the variables -@code{mm-body-charset-encoding-alist} and -@code{mm-content-transfer-encoding-defaults} (@pxref{Encoding -Customization}). - -@node Conversion -@section Conversion - -@findex mime-to-mml -A (multipart) @acronym{MIME} message can be converted to @acronym{MML} -with the @code{mime-to-mml} function. It works on the message in the -current buffer, and substitutes @acronym{MML} markup for @acronym{MIME} -boundaries. Non-textual parts do not have their contents in the buffer, -but instead have the contents in separate buffers that are referred to -from the @acronym{MML} tags. - -@findex mml-to-mime -An @acronym{MML} message can be converted back to @acronym{MIME} by the -@code{mml-to-mime} function. - -These functions are in certain senses ``lossy''---you will not get back -an identical message if you run @code{mime-to-mml} and then -@code{mml-to-mime}. Not only will trivial things like the order of the -headers differ, but the contents of the headers may also be different. -For instance, the original message may use base64 encoding on text, -while @code{mml-to-mime} may decide to use quoted-printable encoding, and -so on. - -In essence, however, these two functions should be the inverse of each -other. The resulting contents of the message should remain equivalent, -if not identical. - - -@node Flowed text -@section Flowed text -@cindex format=flowed - -The Emacs @acronym{MIME} library will respect the @code{use-hard-newlines} -variable (@pxref{Hard and Soft Newlines, ,Hard and Soft Newlines, -emacs, Emacs Manual}) when encoding a message, and the -``format=flowed'' Content-Type parameter when decoding a message. - -On encoding text, regardless of @code{use-hard-newlines}, lines -terminated by soft newline characters are filled together and wrapped -after the column decided by @code{fill-flowed-encode-column}. -Quotation marks (matching @samp{^>* ?}) are respected. The variable -controls how the text will look in a client that does not support -flowed text, the default is to wrap after 66 characters. If hard -newline characters are not present in the buffer, no flow encoding -occurs. - -On decoding flowed text, lines with soft newline characters are filled -together and wrapped after the column decided by -@code{fill-flowed-display-column}. The default is to wrap after -@code{fill-column}. - -@table @code -@item mm-fill-flowed -@vindex mm-fill-flowed -If non-@code{nil} a format=flowed article will be displayed flowed. -@end table - - -@node Interface Functions -@chapter Interface Functions -@cindex interface functions -@cindex mail-parse - -The @code{mail-parse} library is an abstraction over the actual -low-level libraries that are described in the next chapter. - -Standards change, and so programs have to change to fit in the new -mold. For instance, RFC2045 describes a syntax for the -@code{Content-Type} header that only allows @acronym{ASCII} characters in the -parameter list. RFC2231 expands on RFC2045 syntax to provide a scheme -for continuation headers and non-@acronym{ASCII} characters. - -The traditional way to deal with this is just to update the library -functions to parse the new syntax. However, this is sometimes the wrong -thing to do. In some instances it may be vital to be able to understand -both the old syntax as well as the new syntax, and if there is only one -library, one must choose between the old version of the library and the -new version of the library. - -The Emacs @acronym{MIME} library takes a different tack. It defines a -series of low-level libraries (@file{rfc2047.el}, @file{rfc2231.el} -and so on) that parses strictly according to the corresponding -standard. However, normal programs would not use the functions -provided by these libraries directly, but instead use the functions -provided by the @code{mail-parse} library. The functions in this -library are just aliases to the corresponding functions in the latest -low-level libraries. Using this scheme, programs get a consistent -interface they can use, and library developers are free to create -write code that handles new standards. - -The following functions are defined by this library: - -@table @code -@item mail-header-parse-content-type -@findex mail-header-parse-content-type -Parse a @code{Content-Type} header and return a list on the following -format: - -@lisp -("type/subtype" - (attribute1 . value1) - (attribute2 . value2) - ...) -@end lisp - -Here's an example: - -@example -(mail-header-parse-content-type - "image/gif; name=\"b980912.gif\"") -@result{} ("image/gif" (name . "b980912.gif")) -@end example - -@item mail-header-parse-content-disposition -@findex mail-header-parse-content-disposition -Parse a @code{Content-Disposition} header and return a list on the same -format as the function above. - -@item mail-content-type-get -@findex mail-content-type-get -Takes two parameters---a list on the format above, and an attribute. -Returns the value of the attribute. - -@example -(mail-content-type-get - '("image/gif" (name . "b980912.gif")) 'name) -@result{} "b980912.gif" -@end example - -@item mail-header-encode-parameter -@findex mail-header-encode-parameter -Takes a parameter string and returns an encoded version of the string. -This is used for parameters in headers like @code{Content-Type} and -@code{Content-Disposition}. - -@item mail-header-remove-comments -@findex mail-header-remove-comments -Return a comment-free version of a header. - -@example -(mail-header-remove-comments - "Gnus/5.070027 (Pterodactyl Gnus v0.27) (Finnish Landrace)") -@result{} "Gnus/5.070027 " -@end example - -@item mail-header-remove-whitespace -@findex mail-header-remove-whitespace -Remove linear white space from a header. Space inside quoted strings -and comments is preserved. - -@example -(mail-header-remove-whitespace - "image/gif; name=\"Name with spaces\"") -@result{} "image/gif;name=\"Name with spaces\"" -@end example - -@item mail-header-get-comment -@findex mail-header-get-comment -Return the last comment in a header. - -@example -(mail-header-get-comment - "Gnus/5.070027 (Pterodactyl Gnus v0.27) (Finnish Landrace)") -@result{} "Finnish Landrace" -@end example - -@item mail-header-parse-address -@findex mail-header-parse-address -Parse an address and return a list containing the mailbox and the -plaintext name. - -@example -(mail-header-parse-address - "Hrvoje Niksic <hniksic@@srce.hr>") -@result{} ("hniksic@@srce.hr" . "Hrvoje Niksic") -@end example - -@item mail-header-parse-addresses -@findex mail-header-parse-addresses -Parse a string with list of addresses and return a list of elements like -the one described above. - -@example -(mail-header-parse-addresses - "Hrvoje Niksic <hniksic@@srce.hr>, Steinar Bang <sb@@metis.no>") -@result{} (("hniksic@@srce.hr" . "Hrvoje Niksic") - ("sb@@metis.no" . "Steinar Bang")) -@end example - -@item mail-header-parse-date -@findex mail-header-parse-date -Parse a date string and return an Emacs time structure. - -@item mail-narrow-to-head -@findex mail-narrow-to-head -Narrow the buffer to the header section of the buffer. Point is placed -at the beginning of the narrowed buffer. - -@item mail-header-narrow-to-field -@findex mail-header-narrow-to-field -Narrow the buffer to the header under point. Understands continuation -headers. - -@item mail-header-fold-field -@findex mail-header-fold-field -Fold the header under point. - -@item mail-header-unfold-field -@findex mail-header-unfold-field -Unfold the header under point. - -@item mail-header-field-value -@findex mail-header-field-value -Return the value of the field under point. - -@item mail-encode-encoded-word-region -@findex mail-encode-encoded-word-region -Encode the non-@acronym{ASCII} words in the region. For instance, -@samp{Naïve} is encoded as @samp{=?iso-8859-1?q?Na=EFve?=}. - -@item mail-encode-encoded-word-buffer -@findex mail-encode-encoded-word-buffer -Encode the non-@acronym{ASCII} words in the current buffer. This function is -meant to be called narrowed to the headers of a message. - -@item mail-encode-encoded-word-string -@findex mail-encode-encoded-word-string -Encode the words that need encoding in a string, and return the result. - -@example -(mail-encode-encoded-word-string - "This is naïve, baby") -@result{} "This is =?iso-8859-1?q?na=EFve,?= baby" -@end example - -@item mail-decode-encoded-word-region -@findex mail-decode-encoded-word-region -Decode the encoded words in the region. - -@item mail-decode-encoded-word-string -@findex mail-decode-encoded-word-string -Decode the encoded words in the string and return the result. - -@example -(mail-decode-encoded-word-string - "This is =?iso-8859-1?q?na=EFve,?= baby") -@result{} "This is naïve, baby" -@end example - -@end table - -Currently, @code{mail-parse} is an abstraction over @code{ietf-drums}, -@code{rfc2047}, @code{rfc2045} and @code{rfc2231}. These are documented -in the subsequent sections. - - - -@node Basic Functions -@chapter Basic Functions - -This chapter describes the basic, ground-level functions for parsing and -handling. Covered here is parsing @code{From} lines, removing comments -from header lines, decoding encoded words, parsing date headers and so -on. High-level functionality is dealt with in the first chapter -(@pxref{Decoding and Viewing}). - -@menu -* rfc2045:: Encoding @code{Content-Type} headers. -* rfc2231:: Parsing @code{Content-Type} headers. -* ietf-drums:: Handling mail headers defined by RFC822bis. -* rfc2047:: En/decoding encoded words in headers. -* time-date:: Functions for parsing dates and manipulating time. -* qp:: Quoted-Printable en/decoding. -* base64:: Base64 en/decoding. -* binhex:: Binhex decoding. -* uudecode:: Uuencode decoding. -* yenc:: Yenc decoding. -* rfc1843:: Decoding HZ-encoded text. -* mailcap:: How parts are displayed is specified by the @file{.mailcap} file -@end menu - - -@node rfc2045 -@section rfc2045 - -RFC2045 is the ``main'' @acronym{MIME} document, and as such, one would -imagine that there would be a lot to implement. But there isn't, since -most of the implementation details are delegated to the subsequent -RFCs. - -So @file{rfc2045.el} has only a single function: - -@table @code -@item rfc2045-encode-string -@findex rfc2045-encode-string -Takes a parameter and a value and returns a @samp{PARAM=VALUE} string. -@var{value} will be quoted if there are non-safe characters in it. -@end table - - -@node rfc2231 -@section rfc2231 - -RFC2231 defines a syntax for the @code{Content-Type} and -@code{Content-Disposition} headers. Its snappy name is @dfn{MIME -Parameter Value and Encoded Word Extensions: Character Sets, Languages, -and Continuations}. - -In short, these headers look something like this: - -@example -Content-Type: application/x-stuff; - title*0*=us-ascii'en'This%20is%20even%20more%20; - title*1*=%2A%2A%2Afun%2A%2A%2A%20; - title*2="isn't it!" -@end example - -They usually aren't this bad, though. - -The following functions are defined by this library: - -@table @code -@item rfc2231-parse-string -@findex rfc2231-parse-string -Parse a @code{Content-Type} header and return a list describing its -elements. - -@example -(rfc2231-parse-string - "application/x-stuff; - title*0*=us-ascii'en'This%20is%20even%20more%20; - title*1*=%2A%2A%2Afun%2A%2A%2A%20; - title*2=\"isn't it!\"") -@result{} ("application/x-stuff" - (title . "This is even more ***fun*** isn't it!")) -@end example - -@item rfc2231-get-value -@findex rfc2231-get-value -Takes one of the lists on the format above and returns -the value of the specified attribute. - -@item rfc2231-encode-string -@findex rfc2231-encode-string -Encode a parameter in headers likes @code{Content-Type} and -@code{Content-Disposition}. - -@end table - - -@node ietf-drums -@section ietf-drums - -@dfn{drums} is an IETF working group that is working on the replacement -for RFC822. - -The functions provided by this library include: - -@table @code -@item ietf-drums-remove-comments -@findex ietf-drums-remove-comments -Remove the comments from the argument and return the results. - -@item ietf-drums-remove-whitespace -@findex ietf-drums-remove-whitespace -Remove linear white space from the string and return the results. -Spaces inside quoted strings and comments are left untouched. - -@item ietf-drums-get-comment -@findex ietf-drums-get-comment -Return the last most comment from the string. - -@item ietf-drums-parse-address -@findex ietf-drums-parse-address -Parse an address string and return a list that contains the mailbox and -the plain text name. - -@item ietf-drums-parse-addresses -@findex ietf-drums-parse-addresses -Parse a string that contains any number of comma-separated addresses and -return a list that contains mailbox/plain text pairs. - -@item ietf-drums-parse-date -@findex ietf-drums-parse-date -Parse a date string and return an Emacs time structure. - -@item ietf-drums-narrow-to-header -@findex ietf-drums-narrow-to-header -Narrow the buffer to the header section of the current buffer. - -@end table - - -@node rfc2047 -@section rfc2047 - -RFC2047 (Message Header Extensions for Non-@acronym{ASCII} Text) specifies how -non-@acronym{ASCII} text in headers are to be encoded. This is actually rather -complicated, so a number of variables are necessary to tweak what this -library does. - -The following variables are tweakable: - -@table @code -@item rfc2047-header-encoding-alist -@vindex rfc2047-header-encoding-alist -This is an alist of header / encoding-type pairs. Its main purpose is -to prevent encoding of certain headers. - -The keys can either be header regexps, or @code{t}. - -The values can be @code{nil}, in which case the header(s) in question -won't be encoded, @code{mime}, which means that they will be encoded, or -@code{address-mime}, which means the header(s) will be encoded carefully -assuming they contain addresses. - -@item rfc2047-charset-encoding-alist -@vindex rfc2047-charset-encoding-alist -RFC2047 specifies two forms of encoding---@code{Q} (a -Quoted-Printable-like encoding) and @code{B} (base64). This alist -specifies which charset should use which encoding. - -@item rfc2047-encode-function-alist -@vindex rfc2047-encode-function-alist -This is an alist of encoding / function pairs. The encodings are -@code{Q}, @code{B} and @code{nil}. - -@item rfc2047-encoded-word-regexp -@vindex rfc2047-encoded-word-regexp -When decoding words, this library looks for matches to this regexp. - -@item rfc2047-encode-encoded-words -@vindex rfc2047-encode-encoded-words -The boolean variable specifies whether encoded words -(e.g. @samp{=?hello?=}) should be encoded again. - -@end table - -Those were the variables, and these are this functions: - -@table @code -@item rfc2047-narrow-to-field -@findex rfc2047-narrow-to-field -Narrow the buffer to the header on the current line. - -@item rfc2047-encode-message-header -@findex rfc2047-encode-message-header -Should be called narrowed to the header of a message. Encodes according -to @code{rfc2047-header-encoding-alist}. - -@item rfc2047-encode-region -@findex rfc2047-encode-region -Encodes all encodable words in the region specified. - -@item rfc2047-encode-string -@findex rfc2047-encode-string -Encode a string and return the results. - -@item rfc2047-decode-region -@findex rfc2047-decode-region -Decode the encoded words in the region. - -@item rfc2047-decode-string -@findex rfc2047-decode-string -Decode a string and return the results. - -@item rfc2047-encode-parameter -@findex rfc2047-encode-parameter -Encode a parameter in the RFC2047-like style. This is a replacement for -the @code{rfc2231-encode-string} function. @xref{rfc2231}. - -When attaching files as @acronym{MIME} parts, we should use the RFC2231 -encoding to specify the file names containing non-@acronym{ASCII} -characters. However, many mail softwares don't support it in practice -and recipients won't be able to extract files with correct names. -Instead, the RFC2047-like encoding is acceptable generally. This -function provides the very RFC2047-like encoding, resigning to such a -regrettable trend. To use it, put the following line in your -@file{~/.gnus.el} file: - -@lisp -(defalias 'mail-header-encode-parameter 'rfc2047-encode-parameter) -@end lisp - -@end table - - -@node time-date -@section time-date - -While not really a part of the @acronym{MIME} library, it is convenient to -document this library here. It deals with parsing @code{Date} headers -and manipulating time. (Not by using tesseracts, though, I'm sorry to -say.) - -These functions convert between five formats: A date string, an Emacs -time structure, a decoded time list, a second number, and a day number. - -Here's a bunch of time/date/second/day examples: - -@example -(parse-time-string "Sat Sep 12 12:21:54 1998 +0200") -@result{} (54 21 12 12 9 1998 6 nil 7200) - -(date-to-time "Sat Sep 12 12:21:54 1998 +0200") -@result{} (13818 19266) - -(time-to-seconds '(13818 19266)) -@result{} 905595714.0 - -(seconds-to-time 905595714.0) -@result{} (13818 19266 0) - -(time-to-days '(13818 19266)) -@result{} 729644 - -(days-to-time 729644) -@result{} (961933 65536) - -(time-since '(13818 19266)) -@result{} (0 430) - -(time-less-p '(13818 19266) '(13818 19145)) -@result{} nil - -(subtract-time '(13818 19266) '(13818 19145)) -@result{} (0 121) - -(days-between "Sat Sep 12 12:21:54 1998 +0200" - "Sat Sep 07 12:21:54 1998 +0200") -@result{} 5 - -(date-leap-year-p 2000) -@result{} t - -(time-to-day-in-year '(13818 19266)) -@result{} 255 - -(time-to-number-of-days - (time-since - (date-to-time "Mon, 01 Jan 2001 02:22:26 GMT"))) -@result{} 4.146122685185185 -@end example - -And finally, we have @code{safe-date-to-time}, which does the same as -@code{date-to-time}, but returns a zero time if the date is -syntactically malformed. - -The five data representations used are the following: - -@table @var -@item date -An RFC822 (or similar) date string. For instance: @code{"Sat Sep 12 -12:21:54 1998 +0200"}. - -@item time -An internal Emacs time. For instance: @code{(13818 26466)}. - -@item seconds -A floating point representation of the internal Emacs time. For -instance: @code{905595714.0}. - -@item days -An integer number representing the number of days since 00000101. For -instance: @code{729644}. - -@item decoded time -A list of decoded time. For instance: @code{(54 21 12 12 9 1998 6 t -7200)}. -@end table - -All the examples above represent the same moment. - -These are the functions available: - -@table @code -@item date-to-time -Take a date and return a time. - -@item time-to-seconds -Take a time and return seconds. - -@item seconds-to-time -Take seconds and return a time. - -@item time-to-days -Take a time and return days. - -@item days-to-time -Take days and return a time. - -@item date-to-day -Take a date and return days. - -@item time-to-number-of-days -Take a time and return the number of days that represents. - -@item safe-date-to-time -Take a date and return a time. If the date is not syntactically valid, -return a ``zero'' time. - -@item time-less-p -Take two times and say whether the first time is less (i. e., earlier) -than the second time. - -@item time-since -Take a time and return a time saying how long it was since that time. - -@item subtract-time -Take two times and subtract the second from the first. I. e., return -the time between the two times. - -@item days-between -Take two days and return the number of days between those two days. - -@item date-leap-year-p -Take a year number and say whether it's a leap year. - -@item time-to-day-in-year -Take a time and return the day number within the year that the time is -in. - -@end table - - -@node qp -@section qp - -This library deals with decoding and encoding Quoted-Printable text. - -Very briefly explained, qp encoding means translating all 8-bit -characters (and lots of control characters) into things that look like -@samp{=EF}; that is, an equal sign followed by the byte encoded as a hex -string. - -The following functions are defined by the library: - -@table @code -@item quoted-printable-decode-region -@findex quoted-printable-decode-region -QP-decode all the encoded text in the specified region. - -@item quoted-printable-decode-string -@findex quoted-printable-decode-string -Decode the QP-encoded text in a string and return the results. - -@item quoted-printable-encode-region -@findex quoted-printable-encode-region -QP-encode all the encodable characters in the specified region. The third -optional parameter @var{fold} specifies whether to fold long lines. -(Long here means 72.) - -@item quoted-printable-encode-string -@findex quoted-printable-encode-string -QP-encode all the encodable characters in a string and return the -results. - -@end table - - -@node base64 -@section base64 -@cindex base64 - -Base64 is an encoding that encodes three bytes into four characters, -thereby increasing the size by about 33%. The alphabet used for -encoding is very resistant to mangling during transit. - -The following functions are defined by this library: - -@table @code -@item base64-encode-region -@findex base64-encode-region -base64 encode the selected region. Return the length of the encoded -text. Optional third argument @var{no-line-break} means do not break -long lines into shorter lines. - -@item base64-encode-string -@findex base64-encode-string -base64 encode a string and return the result. - -@item base64-decode-region -@findex base64-decode-region -base64 decode the selected region. Return the length of the decoded -text. If the region can't be decoded, return @code{nil} and don't -modify the buffer. - -@item base64-decode-string -@findex base64-decode-string -base64 decode a string and return the result. If the string can't be -decoded, @code{nil} is returned. - -@end table - - -@node binhex -@section binhex -@cindex binhex -@cindex Apple -@cindex Macintosh - -@code{binhex} is an encoding that originated in Macintosh environments. -The following function is supplied to deal with these: - -@table @code -@item binhex-decode-region -@findex binhex-decode-region -Decode the encoded text in the region. If given a third parameter, only -decode the @code{binhex} header and return the filename. - -@end table - -@node uudecode -@section uudecode -@cindex uuencode -@cindex uudecode - -@code{uuencode} is probably still the most popular encoding of binaries -used on Usenet, although @code{base64} rules the mail world. - -The following function is supplied by this package: - -@table @code -@item uudecode-decode-region -@findex uudecode-decode-region -Decode the text in the region. -@end table - - -@node yenc -@section yenc -@cindex yenc - -@code{yenc} is used for encoding binaries on Usenet. The following -function is supplied by this package: - -@table @code -@item yenc-decode-region -@findex yenc-decode-region -Decode the encoded text in the region. - -@end table - - -@node rfc1843 -@section rfc1843 -@cindex rfc1843 -@cindex HZ -@cindex Chinese - -RFC1843 deals with mixing Chinese and @acronym{ASCII} characters in messages. In -essence, RFC1843 switches between @acronym{ASCII} and Chinese by doing this: - -@example -This sentence is in @acronym{ASCII}. -The next sentence is in GB.~@{<:Ky2;S@{#,NpJ)l6HK!#~@}Bye. -@end example - -Simple enough, and widely used in China. - -The following functions are available to handle this encoding: - -@table @code -@item rfc1843-decode-region -Decode HZ-encoded text in the region. - -@item rfc1843-decode-string -Decode a HZ-encoded string and return the result. - -@end table - - -@node mailcap -@section mailcap - -The @file{~/.mailcap} file is parsed by most @acronym{MIME}-aware message -handlers and describes how elements are supposed to be displayed. -Here's an example file: - -@example -image/*; gimp -8 %s -audio/wav; wavplayer %s -application/msword; catdoc %s ; copiousoutput ; nametemplate=%s.doc -@end example - -This says that all image files should be displayed with @code{gimp}, -that WAVE audio files should be played by @code{wavplayer}, and that -MS-WORD files should be inlined by @code{catdoc}. - -The @code{mailcap} library parses this file, and provides functions for -matching types. - -@table @code -@item mailcap-mime-data -@vindex mailcap-mime-data -This variable is an alist of alists containing backup viewing rules. - -@end table - -Interface functions: - -@table @code -@item mailcap-parse-mailcaps -@findex mailcap-parse-mailcaps -Parse the @file{~/.mailcap} file. - -@item mailcap-mime-info -Takes a @acronym{MIME} type as its argument and returns the matching viewer. - -@end table - - - - -@node Standards -@chapter Standards - -The Emacs @acronym{MIME} library implements handling of various elements -according to a (somewhat) large number of RFCs, drafts and standards -documents. This chapter lists the relevant ones. They can all be -fetched from @uref{http://quimby.gnus.org/notes/}. - -@table @dfn -@item RFC822 -@itemx STD11 -Standard for the Format of ARPA Internet Text Messages. - -@item RFC1036 -Standard for Interchange of USENET Messages - -@item RFC2045 -Format of Internet Message Bodies - -@item RFC2046 -Media Types - -@item RFC2047 -Message Header Extensions for Non-@acronym{ASCII} Text - -@item RFC2048 -Registration Procedures - -@item RFC2049 -Conformance Criteria and Examples - -@item RFC2231 -@acronym{MIME} Parameter Value and Encoded Word Extensions: Character Sets, -Languages, and Continuations - -@item RFC1843 -HZ - A Data Format for Exchanging Files of Arbitrarily Mixed Chinese and -@acronym{ASCII} characters - -@item draft-ietf-drums-msg-fmt-05.txt -Draft for the successor of RFC822 - -@item RFC2112 -The @acronym{MIME} Multipart/Related Content-type - -@item RFC1892 -The Multipart/Report Content Type for the Reporting of Mail System -Administrative Messages - -@item RFC2183 -Communicating Presentation Information in Internet Messages: The -Content-Disposition Header Field - -@item RFC2646 -Documentation of the text/plain format parameter for flowed text. - -@end table - -@node GNU Free Documentation License -@chapter GNU Free Documentation License -@include doclicense.texi - -@node Index -@chapter Index -@printindex cp - -@summarycontents -@contents -@bye - - -@c Local Variables: -@c mode: texinfo -@c coding: iso-8859-1 -@c End: - -@ignore - arch-tag: c7ef2fd0-a91c-4e10-aa52-c1a2b11b1a8d -@end ignore diff --git a/man/emacs-xtra.texi b/man/emacs-xtra.texi deleted file mode 100644 index 841c62a527f..00000000000 --- a/man/emacs-xtra.texi +++ /dev/null @@ -1,126 +0,0 @@ -\input texinfo @c -*-texinfo-*- -@comment %**start of header -@setfilename ../info/emacs-xtra -@settitle Specialized Emacs Features -@syncodeindex fn cp -@syncodeindex vr cp -@syncodeindex ky cp -@comment %**end of header - -@copying -This manual describes specialized features of Emacs. - -Copyright @copyright{} 2004, 2005, 2006, 2007 Free Software Foundation, Inc. - -@quotation -Permission is granted to copy, distribute and/or modify this document -under the terms of the GNU Free Documentation License, Version 1.2 or -any later version published by the Free Software Foundation; with no -Invariant Sections, with the Front-Cover texts being ``A GNU -Manual,'' and with the Back-Cover Texts as in (a) below. A copy of the -license is included in the section entitled ``GNU Free Documentation -License'' in the Emacs manual. - -(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify -this GNU Manual, like GNU software. Copies published by the Free -Software Foundation raise funds for GNU development.'' - -This document is part of a collection distributed under the GNU Free -Documentation License. If you want to distribute this document -separately from the collection, you can do so by adding a copy of the -license to the document, as described in section 6 of the license. -@end quotation -@end copying - -@dircategory Emacs -@direntry -* Emacs-Xtra: (emacs-xtra). Specialized Emacs features. -@end direntry - -@titlepage -@title Specialized Emacs Features -@page -@vskip 0pt plus 1filll -@insertcopying -@end titlepage - -@contents - -@ifnottex -@node Top -@top Specialized Emacs Features - -@insertcopying - -@end ifnottex - -@menu -* Introduction:: What documentation belongs here? -@iftex -* Picture Mode:: Editing pictures made up of characters using - the quarter-plane screen model. - -* Autorevert:: Auto Reverting non-file buffers. -* Subdir Switches:: Subdirectory switches in Dired. -* Advanced Calendar/Diary Usage:: Advanced Calendar/Diary customization. -* Emerge:: A convenient way of merging two versions of a program. -* Advanced VC Usage:: Advanced VC (version control) features. -* Fortran:: Fortran mode and its special features. -* MS-DOS:: Using Emacs on MS-DOS (otherwise known as @dfn{MS-DOG}). -@end iftex -* Index:: -@end menu - -@node Introduction -@unnumbered Introduction - -This manual contains detailed information about various features that -are too specialized to be included in the printed Emacs manual. It is -intended to be readable by anyone having a basic knowledge of Emacs. -However, certain sections may be intended for a more specialized -audience, such as Elisp authors. This should be clearly pointed out -at the beginning of these sections. - -Certain packages, or collections of related features, have their own -manuals, separate from the main Emacs User's manual. This manual is -intended as a complement, rather than an alternative, to reading those -additional manuals; in a nutshell, it is a collection of smaller -specialized features, too small or too obscure to justify their own -manual. - -Sections intended specifically for Elisp programmers can follow the -style of the Elisp manual. Other sections should follow the style of -the Emacs manual. - -@iftex -@c ``Picture Mode'' is a chapter, not a section, so it's outside @raisesections. -@include picture-xtra.texi - -@raisesections -@include arevert-xtra.texi - -@include dired-xtra.texi - -@include cal-xtra.texi - -@include emerge-xtra.texi - -@include vc-xtra.texi - -@include fortran-xtra.texi - -@include msdog-xtra.texi - -@lowersections -@end iftex - -@node Index -@unnumbered Index - -@printindex cp - -@bye - -@ignore - arch-tag: 75c33f13-32c6-41b6-9537-847a312e2e49 -@end ignore diff --git a/man/emacs.texi b/man/emacs.texi deleted file mode 100644 index 7e1adb115b4..00000000000 --- a/man/emacs.texi +++ /dev/null @@ -1,1365 +0,0 @@ -\input texinfo - -@setfilename ../info/emacs -@settitle GNU Emacs Manual - -@c The edition number appears in several places in this file -@set EDITION Sixteenth -@set EMACSVER 22.1.50 - -@copying -This is the @value{EDITION} edition of the @cite{GNU Emacs Manual},@* -updated for Emacs version @value{EMACSVER}. - -Copyright @copyright{} 1985, 1986, 1987, 1993, 1994, 1995, 1996, 1997, -1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software -Foundation, Inc. - -@quotation -Permission is granted to copy, distribute and/or modify this document -under the terms of the GNU Free Documentation License, Version 1.2 or -any later version published by the Free Software Foundation; with the -Invariant Sections being ``The GNU Manifesto,'' ``Distribution'' and -``GNU GENERAL PUBLIC LICENSE,'' with the Front-Cover texts being ``A GNU -Manual,'' and with the Back-Cover Texts as in (a) below. A copy of the -license is included in the section entitled ``GNU Free Documentation -License.'' - -(a) The FSF's Back-Cover Text is: ``You are free to copy and modify -this GNU Manual. Buying copies from GNU Press supports the FSF in -developing GNU and promoting software freedom.'' -@end quotation -@end copying - -@dircategory Emacs -@direntry -* Emacs: (emacs). The extensible self-documenting text editor. -@end direntry - -@c in general, keep the following line commented out, unless doing a -@c copy of this manual that will be published. The manual should go -@c onto the distribution in the full, 8.5 x 11" size. -@c set smallbook - -@ifset smallbook -@smallbook -@end ifset - -@c per rms and peterb, use 10pt fonts for the main text, mostly to -@c save on paper cost. -@c Do this inside @tex for now, so current makeinfo does not complain. -@tex -@ifset smallbook -@fonttextsize 10 -@set EMACSVER 22 -\global\let\urlcolor=\Black % don't print links in grayscale -\global\let\linkcolor=\Black -@end ifset -\global\hbadness=6666 % don't worry about not-too-underfull boxes -@end tex - -@defcodeindex op -@synindex pg cp - -@iftex -@kbdinputstyle code - -@shorttitlepage GNU Emacs Manual -@end iftex - -@titlepage -@sp 6 -@center @titlefont{GNU Emacs Manual} -@sp 4 -@center @value{EDITION} Edition, Updated for Emacs Version @value{EMACSVER}. -@sp 5 -@center Richard Stallman -@page -@vskip 0pt plus 1filll -@insertcopying - -@sp 2 -Published by the Free Software Foundation @* -51 Franklin Street, Fifth Floor @* -Boston, MA 02110-1301 USA @* -ISBN 1-882114-86-8 - -@sp 2 -Cover art by Etienne Suvasa. - -@end titlepage - - -@summarycontents -@contents - - -@ifnottex -@node Top, Distrib, (dir), (dir) -@top The Emacs Editor - -Emacs is the extensible, customizable, self-documenting real-time -display editor. This Info file describes how to edit with Emacs and -some of how to customize it; it corresponds to GNU Emacs version -@value{EMACSVER}. - -@ifinfo -To learn more about the Info documentation system, type @kbd{h}, and -Emacs will take you to a programmed instruction sequence for the Info -commands. -@end ifinfo - -For information on extending Emacs, see @ref{Top, Emacs Lisp,, elisp, The -Emacs Lisp Reference Manual}. -@end ifnottex - -@ignore -These subcategories have been deleted for simplicity -and to avoid conflicts. -Completion -Backup Files -Auto-Saving: Protection Against Disasters -Snapshots -Text Mode -Outline Mode -@TeX{} Mode -Formatted Text -Shell Command History - -The ones for Dired and Rmail have had the items turned into :: items -to avoid conflicts. -Also Running Shell Commands from Emacs -and Sending Mail and Registers and Minibuffer. -@end ignore - -@menu -* Distrib:: How to get the latest Emacs distribution. -* Copying:: The GNU General Public License gives you permission - to redistribute GNU Emacs on certain terms; - it also explains that there is no warranty. -* GNU Free Documentation License:: The license for this documentation. -* Intro:: An introduction to Emacs concepts. -* Glossary:: The glossary. -* Antinews:: Information about Emacs version 21. -* Mac OS:: Using Emacs in the Mac. -* Microsoft Windows:: Using Emacs on Microsoft Windows and MS-DOS. -* Manifesto:: What's GNU? Gnu's Not Unix! -* Acknowledgments:: Major contributors to GNU Emacs. - -Indexes (each index contains a large menu) -* Key Index:: An item for each standard Emacs key sequence. -* Option Index:: An item for every command-line option. -* Command Index:: An item for each command name. -* Variable Index:: An item for each documented variable. -* Concept Index:: An item for each concept. - -Important General Concepts -* Screen:: How to interpret what you see on the screen. -* User Input:: Kinds of input events (characters, buttons, - function keys). -* Keys:: Key sequences: what you type to request one - editing action. -* Commands:: Named functions run by key sequences to do editing. -* Text Characters:: Character set for text (the contents of buffers - and strings). -* Entering Emacs:: Starting Emacs from the shell. -* Exiting:: Stopping or killing Emacs. -* Emacs Invocation:: Hairy startup options. - -Fundamental Editing Commands -* Basic:: The most basic editing commands. -* Minibuffer:: Entering arguments that are prompted for. -* M-x:: Invoking commands by their names. -* Help:: Commands for asking Emacs about its commands. - -Important Text-Changing Commands -* Mark:: The mark: how to delimit a ``region'' of text. -* Killing:: Killing (cutting) text. -* Yanking:: Recovering killed text. Moving text. (Pasting.) -* Accumulating Text:: Other ways of copying text. -* Rectangles:: Operating on the text inside a rectangle on the screen. -* Registers:: Saving a text string or a location in the buffer. -* Display:: Controlling what text is displayed. -* Search:: Finding or replacing occurrences of a string. -* Fixit:: Commands especially useful for fixing typos. -* Keyboard Macros:: A keyboard macro records a sequence of - keystrokes to be replayed with a single command. - -Major Structures of Emacs -* Files:: All about handling files. -* Buffers:: Multiple buffers; editing several files at once. -* Windows:: Viewing two pieces of text at once. -* Frames:: Running the same Emacs session in multiple X windows. -* International:: Using non-@acronym{ASCII} character sets (the MULE features). - -Advanced Features -* Major Modes:: Text mode vs. Lisp mode vs. C mode ... -* Indentation:: Editing the white space at the beginnings of lines. -* Text:: Commands and modes for editing English. -* Programs:: Commands and modes for editing programs. -* Building:: Compiling, running and debugging programs. -* Maintaining:: Features for maintaining large programs. -* Abbrevs:: How to define text abbreviations to reduce - the number of characters you must type. -@ifnottex -* Picture Mode:: Editing pictures made up of characters using - the quarter-plane screen model. -@end ifnottex -* Sending Mail:: Sending mail in Emacs. -* Rmail:: Reading mail in Emacs. -* Dired:: You can ``edit'' a directory to manage files in it. -* Calendar/Diary:: The calendar and diary facilities. -* Gnus:: How to read netnews with Emacs. -* Shell:: Executing shell commands from Emacs. -* Emacs Server:: Using Emacs as an editing server for @code{mail}, etc. -* Printing:: Printing hardcopies of buffers or regions. -* Sorting:: Sorting lines, paragraphs or pages within Emacs. -* Narrowing:: Restricting display and editing to a portion - of the buffer. -* Two-Column:: Splitting apart columns to edit them - in side-by-side windows. -* Editing Binary Files::Using Hexl mode to edit binary files. -* Saving Emacs Sessions:: Saving Emacs state from one session to the next. -* Recursive Edit:: A command can allow you to do editing - "within the command". This is called a - "recursive editing level". -* Emulation:: Emulating some other editors with Emacs. -* Hyperlinking:: Following links in buffers. -* Dissociated Press:: Dissociating text for fun. -* Amusements:: Various games and hacks. -* Customization:: Modifying the behavior of Emacs. -* X Resources:: X resources for customizing Emacs. - -Recovery from Problems -* Quitting:: Quitting and aborting. -* Lossage:: What to do if Emacs is hung or malfunctioning. -* Bugs:: How and when to report a bug. -* Contributing:: How to contribute improvements to Emacs. -* Service:: How to get help for your own Emacs needs. - -@c Do NOT modify the following 3 lines! They must have this form to -@c be correctly identified by `texinfo-multiple-files-update'. In -@c particular, the detailed menu header line MUST be identical to the -@c value of `texinfo-master-menu-header'. See texnfo-upd.el. - -@detailmenu - --- The Detailed Node Listing --- - --------------------------------- - -Here are some other nodes which are really inferiors of the ones -already listed, mentioned here so you can get to them in one step: - -The Organization of the Screen - -* Point:: The place in the text where editing commands operate. -* Echo Area:: Short messages appear at the bottom of the screen. -* Mode Line:: Interpreting the mode line. -* Menu Bar:: How to use the menu bar. - -Basic Editing Commands - -* Inserting Text:: Inserting text by simply typing it. -* Moving Point:: How to move the cursor to the place where you want to - change something. -* Erasing:: Deleting and killing text. -* Basic Undo:: Undoing recent changes in the text. -* Basic Files:: Visiting, creating, and saving files. -* Basic Help:: Asking what a character does. -* Blank Lines:: Commands to make or delete blank lines. -* Continuation Lines:: Lines too wide for the screen. -* Position Info:: What page, line, row, or column is point on? -* Arguments:: Numeric arguments for repeating a command. -* Repeating:: A short-cut for repeating the previous command. - -The Minibuffer - -* Minibuffer File:: Entering file names with the minibuffer. -* Minibuffer Edit:: How to edit in the minibuffer. -* Completion:: An abbreviation facility for minibuffer input. -* Minibuffer History:: Reusing recent minibuffer arguments. -* Repetition:: Re-executing commands that used the minibuffer. - -Completion - -* Example: Completion Example. Examples of using completion. -* Commands: Completion Commands. A list of completion commands. -* Strict Completion:: Different types of completion. -* Options: Completion Options. Options for completion. - -Help - -* Help Summary:: Brief list of all Help commands. -* Key Help:: Asking what a key does in Emacs. -* Name Help:: Asking about a command, variable or function name. -* Apropos:: Asking what pertains to a given topic. -* Help Mode:: Special features of Help mode and Help buffers. -* Library Keywords:: Finding Lisp libraries by keywords (topics). -* Language Help:: Help relating to international language support. -* Misc Help:: Other help commands. -* Help Files:: Commands to display pre-written help files. -* Help Echo:: Help on active text and tooltips (`balloon help') - -The Mark and the Region - -* Setting Mark:: Commands to set the mark. -* Transient Mark:: How to make Emacs highlight the region-- - when there is one. -* Momentary Mark:: Enabling Transient Mark mode momentarily. -* Using Region:: Summary of ways to operate on contents of the region. -* Marking Objects:: Commands to put region around textual units. -* Mark Ring:: Previous mark positions saved so you can go back there. -* Global Mark Ring:: Previous mark positions in various buffers. - -Killing and Moving Text - -* Deletion:: Commands for deleting small amounts of text and - blank areas. -* Killing by Lines:: How to kill entire lines of text at one time. -* Other Kill Commands:: Commands to kill large regions of text and - syntactic units such as words and sentences. -* CUA Bindings:: Using @kbd{C-x}, @kbd{C-c}, @kbd{C-v} for copy - and paste, with enhanced rectangle support. - -Yanking - -* Kill Ring:: Where killed text is stored. Basic yanking. -* Appending Kills:: Several kills in a row all yank together. -* Earlier Kills:: Yanking something killed some time ago. - -Registers - -* RegPos:: Saving positions in registers. -* RegText:: Saving text in registers. -* RegRect:: Saving rectangles in registers. -* RegConfig:: Saving window configurations in registers. -* RegNumbers:: Numbers in registers. -* RegFiles:: File names in registers. -* Bookmarks:: Bookmarks are like registers, but persistent. - -Controlling the Display - -* Scrolling:: Moving text up and down in a window. -* Auto Scrolling:: Redisplay scrolls text automatically when needed. -* Horizontal Scrolling:: Moving text left and right in a window. -* Follow Mode:: Follow mode lets two windows scroll as one. -* Faces:: How to change the display style using faces. -* Standard Faces:: Emacs' predefined faces. -* Font Lock:: Minor mode for syntactic highlighting using faces. -* Highlight Interactively:: Tell Emacs what text to highlight. -* Fringes:: Enabling or disabling window fringes. -* Displaying Boundaries:: Displaying top and bottom of the buffer. -* Useless Whitespace:: Showing possibly-spurious trailing whitespace. -* Selective Display:: Hiding lines with lots of indentation. -* Optional Mode Line:: Optional mode line display features. -* Text Display:: How text characters are normally displayed. -* Cursor Display:: Features for displaying the cursor. -* Line Truncation:: Truncating lines to fit the screen width instead - of continuing them to multiple screen lines. -* Display Custom:: Information on variables for customizing display. - -Searching and Replacement - -* Incremental Search:: Search happens as you type the string. -* Nonincremental Search:: Specify entire string and then search. -* Word Search:: Search for sequence of words. -* Regexp Search:: Search for match for a regexp. -* Regexps:: Syntax of regular expressions. -* Regexp Backslash:: Regular expression constructs starting with `\'. -* Regexp Example:: A complex regular expression explained. -* Search Case:: To ignore case while searching, or not. -* Replace:: Search, and replace some or all matches. -* Other Repeating Search:: Operating on all matches for some regexp. - -Incremental Search - -* Basic Isearch:: Basic incremental search commands. -* Repeat Isearch:: Searching for the same string again. -* Error in Isearch:: When your string is not found. -* Special Isearch:: Special input in incremental search. -* Non-ASCII Isearch:: How to search for non-ASCII characters. -* Isearch Yank:: Commands that grab text into the search string - or else edit the search string. -* Highlight Isearch:: Isearch highlights the other possible matches. -* Isearch Scroll:: Scrolling during an incremental search. -* Slow Isearch:: Incremental search features for slow terminals. - -Replacement Commands - -* Unconditional Replace:: Replacing all matches for a string. -* Regexp Replace:: Replacing all matches for a regexp. -* Replacement and Case:: How replacements preserve case of letters. -* Query Replace:: How to use querying. - -Commands for Fixing Typos - -* Undo:: Full details of Emacs undo commands. -* Kill Errors:: Commands to kill a batch of recently entered text. -* Transpose:: Exchanging two characters, words, lines, lists... -* Fixing Case:: Correcting case of last word entered. -* Spelling:: Apply spelling checker to a word or a whole buffer. - -Keyboard Macros - -* Basic Keyboard Macro:: Defining and running keyboard macros. -* Keyboard Macro Ring:: Where previous keyboard macros are saved. -* Keyboard Macro Counter:: Inserting incrementing numbers in macros. -* Keyboard Macro Query:: Making keyboard macros do different things each time. -* Save Keyboard Macro:: Giving keyboard macros names; saving them in files. -* Edit Keyboard Macro:: Editing keyboard macros. -* Keyboard Macro Step-Edit:: Interactively executing and editing a keyboard - macro. - -File Handling - -* File Names:: How to type and edit file-name arguments. -* Visiting:: Visiting a file prepares Emacs to edit the file. -* Saving:: Saving makes your changes permanent. -* Reverting:: Reverting cancels all the changes not saved. -* Autorevert:: Auto Reverting non-file buffers. -* Auto Save:: Auto Save periodically protects against loss of data. -* File Aliases:: Handling multiple names for one file. -* Version Control:: Version control systems (RCS, CVS and SCCS). -* Directories:: Creating, deleting, and listing file directories. -* Comparing Files:: Finding where two files differ. -* Diff Mode:: Editing diff output. -* Misc File Ops:: Other things you can do on files. -* Compressed Files:: Accessing compressed files. -* File Archives:: Operating on tar, zip, jar etc. archive files. -* Remote Files:: Accessing files on other sites. -* Quoted File Names:: Quoting special characters in file names. -* File Name Cache:: Completion against a list of files you often use. -* File Conveniences:: Convenience Features for Finding Files. -* Filesets:: Handling sets of files. - -Saving Files - -* Save Commands:: Commands for saving files. -* Backup:: How Emacs saves the old version of your file. -* Customize Save:: Customizing the saving of files. -* Interlocking:: How Emacs protects against simultaneous editing - of one file by two users. -* File Shadowing:: Copying files to "shadows" automatically. -* Time Stamps:: Emacs can update time stamps on saved files. - -Backup Files - -* One or Many: Numbered Backups. Whether to make one backup file or many. -* Names: Backup Names. How backup files are named. -* Deletion: Backup Deletion. Emacs deletes excess numbered backups. -* Copying: Backup Copying. Backups can be made by copying or renaming. - -Auto-Saving: Protection Against Disasters - -* Files: Auto Save Files. The file where auto-saved changes are - actually made until you save the file. -* Control: Auto Save Control. Controlling when and how often to auto-save. -* Recover:: Recovering text from auto-save files. - -Version Control - -* Introduction to VC:: How version control works in general. -* VC Mode Line:: How the mode line shows version control status. -* Basic VC Editing:: How to edit a file under version control. -* Old Versions:: Examining and comparing old versions. -* Secondary VC Commands:: The commands used a little less frequently. -* Branches:: Multiple lines of development. -* Remote Repositories:: Efficient access to remote CVS servers. -* Snapshots:: Sets of file versions treated as a unit. -* Miscellaneous VC:: Various other commands and features of VC. -* Customizing VC:: Variables that change VC's behavior. - -Using Multiple Buffers - -* Select Buffer:: Creating a new buffer or reselecting an old one. -* List Buffers:: Getting a list of buffers that exist. -* Misc Buffer:: Renaming; changing read-onliness; copying text. -* Kill Buffer:: Killing buffers you no longer need. -* Several Buffers:: How to go through the list of all buffers - and operate variously on several of them. -* Indirect Buffers:: An indirect buffer shares the text of another buffer. -* Buffer Convenience:: Convenience and customization features for - buffer handling. - -Multiple Windows - -* Basic Window:: Introduction to Emacs windows. -* Split Window:: New windows are made by splitting existing windows. -* Other Window:: Moving to another window or doing something to it. -* Pop Up Window:: Finding a file or buffer in another window. -* Force Same Window:: Forcing certain buffers to appear in the selected - window rather than in another window. -* Change Window:: Deleting windows and changing their sizes. -* Window Convenience:: Convenience functions for window handling. - -Frames and Graphical Displays - -* Cut and Paste:: Mouse commands for cut and paste. -* Mouse References:: Using the mouse to select an item from a list. -* Menu Mouse Clicks:: Mouse clicks that bring up menus. -* Mode Line Mouse:: Mouse clicks on the mode line. -* Creating Frames:: Creating additional Emacs frames with various contents. -* Frame Commands:: Iconifying, deleting, and switching frames. -* Speedbar:: How to make and use a speedbar frame. -* Multiple Displays:: How one Emacs job can talk to several displays. -* Special Buffer Frames:: You can make certain buffers have their own frames. -* Frame Parameters:: Changing the colors and other modes of frames. -* Scroll Bars:: How to enable and disable scroll bars; how to use them. -* Wheeled Mice:: Using mouse wheels for scrolling. -* Drag and Drop:: Using drag and drop to open files and insert text. -* Menu Bars:: Enabling and disabling the menu bar. -* Tool Bars:: Enabling and disabling the tool bar. -* Dialog Boxes:: Controlling use of dialog boxes. -* Tooltips:: Showing "tooltips", AKA "balloon help" for active text. -* Mouse Avoidance:: Moving the mouse pointer out of the way. -* Non-Window Terminals:: Multiple frames on terminals that show only one. -* Text-Only Mouse:: Using the mouse in text-only terminals. - -International Character Set Support - -* International Chars:: Basic concepts of multibyte characters. -* Enabling Multibyte:: Controlling whether to use multibyte characters. -* Language Environments:: Setting things up for the language you use. -* Input Methods:: Entering text characters not on your keyboard. -* Select Input Method:: Specifying your choice of input methods. -* Multibyte Conversion:: How single-byte characters convert to multibyte. -* Coding Systems:: Character set conversion when you read and - write files, and so on. -* Recognize Coding:: How Emacs figures out which conversion to use. -* Specify Coding:: Specifying a file's coding system explicitly. -* Output Coding:: Choosing coding systems for output. -* Text Coding:: Choosing conversion to use for file text. -* Communication Coding:: Coding systems for interprocess communication. -* File Name Coding:: Coding systems for file @emph{names}. -* Terminal Coding:: Specifying coding systems for converting - terminal input and output. -* Fontsets:: Fontsets are collections of fonts - that cover the whole spectrum of characters. -* Defining Fontsets:: Defining a new fontset. -* Undisplayable Characters::When characters don't display. -* Unibyte Mode:: You can pick one European character set - to use without multibyte characters. -* Charsets:: How Emacs groups its internal character codes. - -Major Modes - -* Choosing Modes:: How major modes are specified or chosen. - -Indentation - -* Indentation Commands:: Various commands and techniques for indentation. -* Tab Stops:: You can set arbitrary "tab stops" and then - indent to the next tab stop when you want to. -* Just Spaces:: You can request indentation using just spaces. - -Commands for Human Languages - -* Words:: Moving over and killing words. -* Sentences:: Moving over and killing sentences. -* Paragraphs:: Moving over paragraphs. -* Pages:: Moving over pages. -* Filling:: Filling or justifying text. -* Case:: Changing the case of text. -* Text Mode:: The major modes for editing text files. -* Outline Mode:: Editing outlines. -* TeX Mode:: Editing input to the formatter TeX. -* HTML Mode:: Editing HTML, SGML, and XML files. -* Nroff Mode:: Editing input to the formatter nroff. -* Formatted Text:: Editing formatted text directly in WYSIWYG fashion. -* Text Based Tables:: Editing text-based tables in WYSIWYG fashion. - -Filling Text - -* Auto Fill:: Auto Fill mode breaks long lines automatically. -* Refill:: Keeping paragraphs filled. -* Fill Commands:: Commands to refill paragraphs and center lines. -* Fill Prefix:: Filling paragraphs that are indented - or in a comment, etc. -* Adaptive Fill:: How Emacs can determine the fill prefix automatically. -* Longlines:: Editing text with very long lines. - -Outline Mode - -* Format: Outline Format. What the text of an outline looks like. -* Motion: Outline Motion. Special commands for moving through - outlines. -* Visibility: Outline Visibility. Commands to control what is visible. -* Views: Outline Views. Outlines and multiple views. -* Foldout:: Folding means zooming in on outlines. - -@TeX{} Mode - -* Editing: TeX Editing. Special commands for editing in TeX mode. -* LaTeX: LaTeX Editing. Additional commands for LaTeX input files. -* Printing: TeX Print. Commands for printing part of a file with TeX. -* Misc: TeX Misc. Customization of TeX mode, and related features. - -Editing Formatted Text - -* Requesting Formatted Text:: Entering and exiting Enriched mode. -* Hard and Soft Newlines:: There are two different kinds of newlines. -* Editing Format Info:: How to edit text properties. -* Faces: Format Faces. Bold, italic, underline, etc. -* Color: Format Colors. Changing the color of text. -* Indent: Format Indentation. Changing the left and right margins. -* Justification: Format Justification. - Centering, setting text flush with the - left or right margin, etc. -* Other: Format Properties. The "special" text properties submenu. -* Forcing Enriched Mode:: How to force use of Enriched mode. - -Editing Text-based Tables - -* Table Definition:: What is a text based table. -* Table Creation:: How to create a table. -* Table Recognition:: How to activate and deactivate tables. -* Cell Commands:: Cell-oriented commands in a table. -* Cell Justification:: Justifying cell contents. -* Row Commands:: Manipulating rows of table cell. -* Column Commands:: Manipulating columns of table cell. -* Fixed Width Mode:: Fixing cell width. -* Table Conversion:: Converting between plain text and tables. -* Measuring Tables:: Analyzing table dimension. -* Table Misc:: Table miscellany. - -Editing Programs - -* Program Modes:: Major modes for editing programs. -* Defuns:: Commands to operate on major top-level parts - of a program. -* Program Indent:: Adjusting indentation to show the nesting. -* Parentheses:: Commands that operate on parentheses. -* Comments:: Inserting, killing, and aligning comments. -* Documentation:: Getting documentation of functions you plan to call. -* Hideshow:: Displaying blocks selectively. -* Symbol Completion:: Completion on symbol names of your program or language. -* Glasses:: Making identifiersLikeThis more readable. -* Misc for Programs:: Other Emacs features useful for editing programs. -* C Modes:: Special commands of C, C++, Objective-C, - Java, and Pike modes. -* Asm Mode:: Asm mode and its special features. -* Fortran:: Fortran mode and its special features. - -Top-Level Definitions, or Defuns - -* Left Margin Paren:: An open-paren or similar opening delimiter - starts a defun if it is at the left margin. -* Moving by Defuns:: Commands to move over or mark a major definition. -* Imenu:: Making buffer indexes as menus. -* Which Function:: Which Function mode shows which function you are in. - -Indentation for Programs - -* Basic Indent:: Indenting a single line. -* Multi-line Indent:: Commands to reindent many lines at once. -* Lisp Indent:: Specifying how each Lisp function should be indented. -* C Indent:: Extra features for indenting C and related modes. -* Custom C Indent:: Controlling indentation style for C and related modes. - -Commands for Editing with Parentheses - -* Expressions:: Expressions with balanced parentheses. -* Moving by Parens:: Commands for moving up, down and across - in the structure of parentheses. -* Matching:: Insertion of a close-delimiter flashes matching open. - -Manipulating Comments - -* Comment Commands:: Inserting, killing, and aligning comments. -* Multi-Line Comments:: Commands for adding and editing multi-line comments. -* Options for Comments::Customizing the comment features. - -Documentation Lookup - -* Info Lookup:: Looking up library functions and commands - in Info files. -* Man Page:: Looking up man pages of library functions and commands. -* Lisp Doc:: Looking up Emacs Lisp functions, etc. - -C and Related Modes - -* Motion in C:: Commands to move by C statements, etc. -* Electric C:: Colon and other chars can automatically reindent. -* Hungry Delete:: A more powerful DEL command. -* Other C Commands:: Filling comments, viewing expansion of macros, - and other neat features. - -Compiling and Testing Programs - -* Compilation:: Compiling programs in languages other - than Lisp (C, Pascal, etc.). -* Compilation Mode:: The mode for visiting compiler errors. -* Compilation Shell:: Customizing your shell properly - for use in the compilation buffer. -* Grep Searching:: Searching with grep. -* Flymake:: Finding syntax errors on the fly. -* Debuggers:: Running symbolic debuggers for non-Lisp programs. -* Executing Lisp:: Various modes for editing Lisp programs, - with different facilities for running - the Lisp programs. -* Lisp Libraries:: Creating Lisp programs to run in Emacs. -* Lisp Eval:: Executing a single Lisp expression in Emacs. -* Lisp Interaction:: Executing Lisp in an Emacs buffer. -* External Lisp:: Communicating through Emacs with a separate Lisp. - -Running Debuggers Under Emacs - -* Starting GUD:: How to start a debugger subprocess. -* Debugger Operation:: Connection between the debugger and source buffers. -* Commands of GUD:: Key bindings for common commands. -* GUD Customization:: Defining your own commands for GUD. -* GDB Graphical Interface:: An enhanced mode that uses GDB features to - implement a graphical debugging environment through - Emacs. - -Maintaining Large Programs - -* Change Log:: Maintaining a change history for your program. -* Format of ChangeLog:: What the change log file looks like. -* Tags:: Go direct to any function in your program in one - command. Tags remembers which file it is in. -* Emerge:: A convenient way of merging two versions of a program. - -Tags Tables - -* Tag Syntax:: Tag syntax for various types of code and text files. -* Create Tags Table:: Creating a tags table with @code{etags}. -* Etags Regexps:: Create arbitrary tags using regular expressions. -* Select Tags Table:: How to visit a tags table. -* Find Tag:: Commands to find the definition of a specific tag. -* Tags Search:: Using a tags table for searching and replacing. -* List Tags:: Listing and finding tags defined in a file. - -Abbrevs - -* Abbrev Concepts:: Fundamentals of defined abbrevs. -* Defining Abbrevs:: Defining an abbrev, so it will expand when typed. -* Expanding Abbrevs:: Controlling expansion: prefixes, canceling expansion. -* Editing Abbrevs:: Viewing or editing the entire list of defined abbrevs. -* Saving Abbrevs:: Saving the entire list of abbrevs for another session. -* Dynamic Abbrevs:: Abbreviations for words already in the buffer. -* Dabbrev Customization:: What is a word, for dynamic abbrevs. Case handling. - -@ifnottex -Editing Pictures - -* Basic Picture:: Basic concepts and simple commands of Picture Mode. -* Insert in Picture:: Controlling direction of cursor motion - after "self-inserting" characters. -* Tabs in Picture:: Various features for tab stops and indentation. -* Rectangles in Picture:: Clearing and superimposing rectangles. -@end ifnottex - -Sending Mail - -* Mail Format:: Format of the mail being composed. -* Mail Headers:: Details of permitted mail header fields. -* Mail Aliases:: Abbreviating and grouping mail addresses. -* Mail Mode:: Special commands for editing mail being composed. -* Mail Amusements:: Distract the NSA's attention; add a fortune to a msg. -* Mail Methods:: Using alternative mail-composition methods. - -Reading Mail with Rmail - -* Rmail Basics:: Basic concepts of Rmail, and simple use. -* Rmail Scrolling:: Scrolling through a message. -* Rmail Motion:: Moving to another message. -* Rmail Deletion:: Deleting and expunging messages. -* Rmail Inbox:: How mail gets into the Rmail file. -* Rmail Files:: Using multiple Rmail files. -* Rmail Output:: Copying message out to files. -* Rmail Labels:: Classifying messages by labeling them. -* Rmail Attributes:: Certain standard labels, called attributes. -* Rmail Reply:: Sending replies to messages you are viewing. -* Rmail Summary:: Summaries show brief info on many messages. -* Rmail Sorting:: Sorting messages in Rmail. -* Rmail Display:: How Rmail displays a message; customization. -* Rmail Coding:: How Rmail handles decoding character sets. -* Rmail Editing:: Editing message text and headers in Rmail. -* Rmail Digest:: Extracting the messages from a digest message. -* Out of Rmail:: Converting an Rmail file to mailbox format. -* Rmail Rot13:: Reading messages encoded in the rot13 code. -* Movemail:: More details of fetching new mail. -* Remote Mailboxes:: Retrieving Mail from Remote Mailboxes. -* Other Mailbox Formats:: Retrieving Mail from Local Mailboxes in - Various Formats - -Dired, the Directory Editor - -* Dired Enter:: How to invoke Dired. -* Dired Navigation:: How to move in the Dired buffer. -* Dired Deletion:: Deleting files with Dired. -* Flagging Many Files:: Flagging files based on their names. -* Dired Visiting:: Other file operations through Dired. -* Marks vs Flags:: Flagging for deletion vs marking. -* Operating on Files:: How to copy, rename, print, compress, etc. - either one file or several files. -* Shell Commands in Dired:: Running a shell command on the marked files. -* Transforming File Names:: Using patterns to rename multiple files. -* Comparison in Dired:: Running `diff' by way of Dired. -* Subdirectories in Dired:: Adding subdirectories to the Dired buffer. -* Subdir Switches:: Subdirectory switches in Dired. -* Subdirectory Motion:: Moving across subdirectories, and up and down. -* Hiding Subdirectories:: Making subdirectories visible or invisible. -* Dired Updating:: Discarding lines for files of no interest. -* Dired and Find:: Using `find' to choose the files for Dired. -* Wdired:: Operating on files by editing the Dired buffer. -* Image-Dired:: Viewing image thumbnails in Dired -* Misc Dired Features:: Various other features. - -The Calendar and the Diary - -* Calendar Motion:: Moving through the calendar; selecting a date. -* Scroll Calendar:: Bringing earlier or later months onto the screen. -* Counting Days:: How many days are there between two dates? -* General Calendar:: Exiting or recomputing the calendar. -* Writing Calendar Files:: Writing calendars to files of various formats. -* Holidays:: Displaying dates of holidays. -* Sunrise/Sunset:: Displaying local times of sunrise and sunset. -* Lunar Phases:: Displaying phases of the moon. -* Other Calendars:: Converting dates to other calendar systems. -* Diary:: Displaying events from your diary. -* Appointments:: Reminders when it's time to do something. -* Importing Diary:: Converting diary events to/from other formats. -* Daylight Saving:: How to specify when daylight saving time is active. -* Time Intervals:: Keeping track of time intervals. -* Advanced Calendar/Diary Usage:: Advanced Calendar/Diary customization. - -Movement in the Calendar - -* Calendar Unit Motion:: Moving by days, weeks, months, and years. -* Move to Beginning or End:: Moving to start/end of weeks, months, and years. -* Specified Dates:: Moving to the current date or another - specific date. - -Conversion To and From Other Calendars - -* Calendar Systems:: The calendars Emacs understands - (aside from Gregorian). -* To Other Calendar:: Converting the selected date to various calendars. -* From Other Calendar:: Moving to a date specified in another calendar. -* Mayan Calendar:: Moving to a date specified in a Mayan calendar. - -The Diary - -* Displaying the Diary:: Viewing diary entries and associated calendar dates. -* Format of Diary File:: Entering events in your diary. -* Date Formats:: Various ways you can specify dates. -* Adding to Diary:: Commands to create diary entries. -* Special Diary Entries:: Anniversaries, blocks of dates, cyclic entries, etc. - -Gnus - -* Buffers of Gnus:: The group, summary, and article buffers. -* Gnus Startup:: What you should know about starting Gnus. -* Summary of Gnus:: A short description of the basic Gnus commands. - -Running Shell Commands from Emacs - -* Single Shell:: How to run one shell command and return. -* Interactive Shell:: Permanent shell taking input via Emacs. -* Shell Mode:: Special Emacs commands used with permanent shell. -* Shell Prompts:: Two ways to recognize shell prompts. -* Shell History:: Repeating previous commands in a shell buffer. -* Directory Tracking:: Keeping track when the subshell changes directory. -* Shell Options:: Options for customizing Shell mode. -* Terminal emulator:: An Emacs window as a terminal emulator. -* Term Mode:: Special Emacs commands used in Term mode. -* Paging in Term:: Paging in the terminal emulator. -* Remote Host:: Connecting to another computer. - -Using Emacs as a Server - -* Invoking emacsclient:: Emacs client startup options. - -Printing Hard Copies - -* PostScript:: Printing buffers or regions as PostScript. -* PostScript Variables:: Customizing the PostScript printing commands. -* Printing Package:: An optional advanced printing interface. - -Hyperlinking and Navigation Features - -* Browse-URL:: Following URLs. -* Goto-address:: Activating URLs. -* FFAP:: Finding files etc. at point. - -Customization - -* Minor Modes:: Each minor mode is one feature you can turn on - independently of any others. -* Easy Customization:: Convenient way to browse and change user options. -* Variables:: Many Emacs commands examine Emacs variables - to decide what to do; by setting variables, - you can control their functioning. -* Key Bindings:: The keymaps say what command each key runs. - By changing them, you can "redefine keys". -* Syntax:: The syntax table controls how words and - expressions are parsed. -* Init File:: How to write common customizations in the - @file{.emacs} file. - -Variables - -* Examining:: Examining or setting one variable's value. -* Hooks:: Hook variables let you specify programs for parts - of Emacs to run on particular occasions. -* Locals:: Per-buffer values of variables. -* File Variables:: How files can specify variable values. - -Customizing Key Bindings - -* Keymaps:: Generalities. The global keymap. -* Prefix Keymaps:: Keymaps for prefix keys. -* Local Keymaps:: Major and minor modes have their own keymaps. -* Minibuffer Maps:: The minibuffer uses its own local keymaps. -* Rebinding:: How to redefine one key's meaning conveniently. -* Init Rebinding:: Rebinding keys with your init file, @file{.emacs}. -* Function Keys:: Rebinding terminal function keys. -* Named ASCII Chars:: Distinguishing @key{TAB} from @kbd{C-i}, and so on. -* Mouse Buttons:: Rebinding mouse buttons in Emacs. -* Disabling:: Disabling a command means confirmation is required - before it can be executed. This is done to protect - beginners from surprises. - -The Init File, @file{~/.emacs} - -* Init Syntax:: Syntax of constants in Emacs Lisp. -* Init Examples:: How to do some things with an init file. -* Terminal Init:: Each terminal type can have an init file. -* Find Init:: How Emacs finds the init file. -* Init Non-ASCII:: Using non-@acronym{ASCII} characters in an init file. - -Dealing with Emacs Trouble - -* DEL Does Not Delete:: What to do if @key{DEL} doesn't delete. -* Stuck Recursive:: `[...]' in mode line around the parentheses. -* Screen Garbled:: Garbage on the screen. -* Text Garbled:: Garbage in the text. -* Memory Full:: How to cope when you run out of memory. -* After a Crash:: Recovering editing in an Emacs session that crashed. -* Emergency Escape:: Emergency escape--- - What to do if Emacs stops responding. -* Total Frustration:: When you are at your wits' end. - -Reporting Bugs - -* Bug Criteria:: Have you really found a bug? -* Understanding Bug Reporting:: How to report a bug effectively. -* Checklist:: Steps to follow for a good bug report. -* Sending Patches:: How to send a patch for GNU Emacs. - -Command Line Arguments for Emacs Invocation - -* Action Arguments:: Arguments to visit files, load libraries, - and call functions. -* Initial Options:: Arguments that take effect while starting Emacs. -* Command Example:: Examples of using command line arguments. -* Resume Arguments:: Specifying arguments when you resume a running Emacs. -* Environment:: Environment variables that Emacs uses. -* Display X:: Changing the default display and using remote login. -* Font X:: Choosing a font for text, under X. -* Colors:: Choosing display colors. -* Window Size X:: Start-up window size, under X. -* Borders X:: Internal and external borders, under X. -* Title X:: Specifying the initial frame's title. -* Icons X:: Choosing what sort of icon to use, under X. -* Misc X:: Other display options. - -Environment Variables - -* General Variables:: Environment variables that all versions of Emacs use. -* Misc Variables:: Certain system specific variables. -* MS-Windows Registry:: An alternative to the environment on MS-Windows. - -X Options and Resources - -* Resources:: Using X resources with Emacs (in general). -* Table of Resources:: Table of specific X resources that affect Emacs. -* Face Resources:: X resources for customizing faces. -* Lucid Resources:: X resources for Lucid menus. -* LessTif Resources:: X resources for LessTif and Motif menus. -* GTK resources:: Resources for GTK widgets. - -Emacs and Mac OS - -* Mac Input:: Keyboard and mouse input on Mac. -* Mac International:: International character sets on Mac. -* Mac Environment Variables:: Setting environment variables for Emacs. -* Mac Directories:: Volumes and directories on Mac. -* Mac Font Specs:: Specifying fonts on Mac. -* Mac Functions:: Mac-specific Lisp functions. - -Emacs and Microsoft Windows/MS-DOS - -* Text and Binary:: Text files use CRLF to terminate lines. -* Windows Files:: File-name conventions on Windows. -* ls in Lisp:: Emulation of @code{ls} for Dired. -* Windows HOME:: Where Emacs looks for your @file{.emacs}. -* Windows Keyboard:: Windows-specific keyboard features. -* Windows Mouse:: Windows-specific mouse features. -* Windows Processes:: Running subprocesses on Windows. -* Windows Printing:: How to specify the printer on MS-Windows. -* Windows Misc:: Miscellaneous Windows features. -* MS-DOS:: Using Emacs on MS-DOS (otherwise known as @dfn{MS-DOG}). -@end detailmenu -@end menu - -@iftex -@unnumbered Preface - - This manual documents the use and simple customization of the Emacs -editor. Simple Emacs customizations do not require you to be a -programmer, but if you are not interested in customizing, you can -ignore the customization hints. - - This is primarily a reference manual, but can also be used as a -primer. If you are new to Emacs, we recommend you start with -the on-line, learn-by-doing tutorial, before reading the manual. To -run the tutorial, start Emacs and type @kbd{C-h t}. The tutorial -describes commands, tells you when to try them, and explains the -results. - - On first reading, just skim chapters 1 and 2, which describe the -notational conventions of the manual and the general appearance of the -Emacs display screen. Note which questions are answered in these -chapters, so you can refer back later. After reading chapter 4, you -should practice the commands shown there. The next few chapters -describe fundamental techniques and concepts that are used constantly. -You need to understand them thoroughly, so experiment with them -until you are fluent. - - Chapters 14 through 19 describe intermediate-level features that are -useful for many kinds of editing. Chapter 20 and following chapters -describe optional but useful features; read those chapters when you -need them. - - Read the Trouble chapter if Emacs does not seem to be working -properly. It explains how to cope with several common problems -(@pxref{Lossage}), as well as when and how to report Emacs bugs -(@pxref{Bugs}). - - To find the documentation of a particular command, look in the index. -Keys (character commands) and command names have separate indexes. -There is also a glossary, with a cross reference for each term. - - This manual is available as a printed book and also as an Info file. -The Info file is for on-line perusal with the Info program, which is -the principal means of accessing on-line documentation in the GNU -system. Both the Emacs Info file and an Info reader are included with -GNU Emacs. The Info file and the printed book contain substantially -the same text and are generated from the same source files, which are -also distributed with GNU Emacs. - - GNU Emacs is a member of the Emacs editor family. There are many -Emacs editors, all sharing common principles of organization. For -information on the underlying philosophy of Emacs and the lessons -learned from its development, see @cite{Emacs, the Extensible, -Customizable Self-Documenting Display Editor}, available from -@url{ftp://publications.ai.mit.edu/ai-publications/pdf/AIM-519A.pdf}. - -This edition of the manual is intended for use with GNU Emacs -installed on GNU and Unix systems. GNU Emacs can also be used on VMS, -MS-DOS (also called MS-DOG), Microsoft Windows, and Macintosh systems. -Those systems use different file name syntax; in addition, VMS and -MS-DOS do not support all GNU Emacs features. @xref{Microsoft -Windows}, for information about using Emacs on Windows. -@xref{Mac OS}, for information about using Emacs on Macintosh. We -don't try to describe VMS usage in this manual. -@end iftex - -@node Distrib, Intro, Top, Top -@unnumbered Distribution - -GNU Emacs is @dfn{free software}; this means that everyone is free to -use it and free to redistribute it on certain conditions. GNU Emacs -is not in the public domain; it is copyrighted and there are -restrictions on its distribution, but these restrictions are designed -to permit everything that a good cooperating citizen would want to do. -What is not allowed is to try to prevent others from further sharing -any version of GNU Emacs that they might get from you. The precise -conditions are found in the GNU General Public License that comes with -Emacs and also appears in this manual@footnote{This manual is itself -covered by the GNU Free Documentation License. This license is -similar in spirit to the General Public License, but is more suitable -for documentation. @xref{GNU Free Documentation License}.}. -@xref{Copying}. - -One way to get a copy of GNU Emacs is from someone else who has it. -You need not ask for our permission to do so, or tell any one else; -just copy it. If you have access to the Internet, you can get the -latest distribution version of GNU Emacs by anonymous FTP; see -@url{http://www.gnu.org/software/emacs} on our website for more -information. - -You may also receive GNU Emacs when you buy a computer. Computer -manufacturers are free to distribute copies on the same terms that apply to -everyone else. These terms require them to give you the full sources, -including whatever changes they may have made, and to permit you to -redistribute the GNU Emacs received from them under the usual terms of the -General Public License. In other words, the program must be free for you -when you get it, not just free for the manufacturer. - -You can also order copies of GNU Emacs from the Free Software -Foundation. This is a convenient and reliable way to get a copy; it is -also a good way to help fund our work. We also sell hardcopy versions -of this manual and @cite{An Introduction to Programming in Emacs Lisp}, -by Robert J. Chassell. You can find an order form on our web site at -@url{http://www.gnu.org/order/order.html}. For further information, -write to - -@display -Free Software Foundation -51 Franklin Street, Fifth Floor -Boston, MA 02110-1301 -USA -@end display - -The income from distribution fees goes to support the foundation's -purpose: the development of new free software, and improvements to our -existing programs including GNU Emacs. - -If you find GNU Emacs useful, please @strong{send a donation} to the -Free Software Foundation to support our work. Donations to the Free -Software Foundation are tax deductible in the US. If you use GNU Emacs -at your workplace, please suggest that the company make a donation. If -company policy is unsympathetic to the idea of donating to charity, you -might instead suggest ordering a CD-ROM from the Foundation -occasionally, or subscribing to periodic updates. - -@iftex -@node Acknowledgments, Intro, Distrib, Top -@unnumberedsec Acknowledgments - -Contributors to GNU Emacs include Jari Aalto, Per Abrahamsen, Tomas -Abrahamsson, Jay K.@: Adams, Michael Albinus, Nagy Andras, Ralf -Angeli, Joe Arceneaux, Miles Bader, David Bakhash, Juanma Barranquero, -Eli Barzilay, Steven L.@: Baur, Jay Belanger, Alexander L.@: Belikoff, -Boaz Ben-Zvi, Karl Berry, Anna M.@: Bigatti, Ray Blaak, Jim Blandy, Johan Bockg@aa{}rd, -Per Bothner, Terrence Brannon, Frank Bresz, Peter Breton, Emmanuel -Briot, Kevin Broadey, Vincent Broman, David M.@: Brown, Georges -Brun-Cottan, Joe Buehler, W@l{}odek Bzyl, Bill Carpenter, Per -Cederqvist, Hans Chalupsky, Chris Chase, Bob Chassell, Andrew Choi, -Sacha Chua, James Clark, Mike Clarkson, Glynn Clements, Andrew -Csillag, Doug Cutting, Mathias Dahl, Satyaki Das, Michael DeCorte, -Gary Delp, Matthieu Devin, Eri Ding, Jan Dj@"{a}rv, Carsten Dominik, -Scott Draves, Benjamin Drieu, Viktor Dukhovni, John Eaton, Rolf Ebert, -Paul Eggert, Stephen Eglen, Torbj@"orn Einarsson, Tsugutomo Enami, -Hans Henrik Eriksen, Michael Ernst, Ata Etemadi, Frederick Farnbach, -Oscar Figueiredo, Fred Fish, Karl Fogel, Gary Foster, Romain -Francoise, Noah Friedman, Andreas Fuchs, Hallvard Furuseth, Keith -Gabryelski, Peter S.@: Galbraith, Kevin Gallagher, Kevin Gallo, Juan -Le@'{o}n Lahoz Garc@'{@dotless{i}}a, Howard Gayle, Stephen Gildea, Julien -Gilles, David Gillespie, Bob Glickstein, Deepak Goel, Boris Goldowsky, -Michelangelo Grigni, Odd Gripenstam, Kai Gro@ss{}johann, Michael -Gschwind, Henry Guillaume, Doug Gwyn, Ken'ichi Handa, Lars Hansen, -Chris Hanson, K. Shane Hartman, John Heidemann, Jon K.@: Hellan, -Jesper Harder, Markus Heritsch, Karl Heuer, Manabu Higashida, Anders -Holst, Jeffrey C.@: Honig, Kurt Hornik, Tom Houlder, Joakim Hove, -Denis Howe, Lars Ingebrigtsen, Andrew Innes, Seiichiro Inoue, Pavel -Janik, Paul Jarc, Ulf Jasper, Michael K. Johnson, Kyle Jones, Terry -Jones, Simon Josefsson, Arne J@o{}rgensen, Tomoji Kagatani, Brewster -Kahle, Lute Kamstra, David Kastrup, David Kaufman, Henry Kautz, Taichi -Kawabata, Howard Kaye, Michael Kifer, Richard King, Peter Kleiweg, -Shuhei Kobayashi, Pavel Kobiakov, Larry K.@: Kolodney, David M.@: -Koppelman, Koseki Yoshinori, Robert Krawitz, Sebastian Kremer, Ryszard -Kubiak, Geoff Kuenning, David K@aa{}gedal, Daniel LaLiberte, Mario -Lang, Aaron Larson, James R.@: Larus, Vinicius Jose Latorre, Werner -Lemberg, Frederic Lepied, Peter Liljenberg, Lars Lindberg, Chris -Lindblad, Anders Lindgren, Thomas Link, Juri Linkov, Francis Litterio, -Emilio C. Lopes, Dave Love, Sascha L@"{u}decke, Eric Ludlam,Alan -Mackenzie, Christopher J.@: Madsen, Neil M.@: Mager, Ken Manheimer, -Bill Mann, Brian Marick, Simon Marshall, Bengt Martensson, Charlie -Martin, Thomas May, Roland McGrath, Will Mengarini, David Megginson, -Ben A. Mesander, Wayne Mesard, Brad Miller, Lawrence Mitchell, Richard -Mlynarik, Gerd Moellmann, Stefan Monnier, Morioka Tomohiko, Keith -Moore, Glenn Morris, Diane Murray, Sen Nagata, Erik Naggum, Thomas -Neumann, Thien-Thi Nguyen, Mike Newton, Jurgen Nickelsen, Dan -Nicolaescu, Hrvoje Niksic, Jeff Norden, Andrew Norman, Alexandre -Oliva, Bob Olson, Michael Olson, Takaaki Ota, Pieter E.@: J.@: Pareit, -David Pearson, Jeff Peck, Damon Anton Permezel, Tom Perrine, William -M.@: Perry, Per Persson, Jens Petersen, Daniel Pfeiffer, Richard L.@: -Pieri, Fred Pierresteguy, Christian Plaunt, David Ponce, Francesco -A.@: Potorti, Michael D. Prange, Mukesh Prasad, Ken Raeburn, Marko -Rahamaa, Ashwin Ram, Eric S. Raymond, Paul Reilly, Edward M. Reingold, -Alex Rezinsky, Rob Riepel, David Reitter, Nick Roberts, Roland B.@: -Roberts, John Robinson, Danny Roozendaal, William Rosenblatt, -Guillermo J.@: Rozas, Martin Rudalics, Ivar Rummelhoff, Jason Rumney, -Wolfgang Rupprecht, Kevin Ryde, James B. Salem, Masahiko Sato, Jorgen -Schaefer, Holger Schauer, William Schelter, Ralph Schleicher, Gregor -Schmid, Michael Schmidt, Ronald S. Schnell, Philippe Schnoebelen, Jan -Schormann, Alex Schroeder, Stephen Schoef, Raymond Scholz, Randal -Schwartz, Oliver Seidel, Manuel Serrano, Hovav Shacham, Stanislav -Shalunov, Marc Shapiro, Richard Sharman, Olin Shivers, Espen Skoglund, -Rick Sladkey, Lynn Slater, Chris Smith, David Smith, Paul D.@: Smith, -Andre Spiegel, Michael Staats, William Sommerfeld, Michael Staats, -Reiner Steib, Sam Steingold, Ake Stenhoff, Peter Stephenson, Ken -Stevens, Jonathan Stigelman, Martin Stjernholm, Kim F.@: Storm, Steve -Strassman, Olaf Sylvester, Naoto Takahashi, Steven Tamm, Jean-Philippe -Theberge, Jens T.@: Berger Thielemann, Spencer Thomas, Jim Thompson, -Luc Teirlinck, Tom Tromey, Enami Tsugutomo, Eli Tziperman, Daiki Ueno, -Masanobu Umeda, Rajesh Vaidheeswarran, Neil W.@: Van Dyke, Didier -Verna, Ulrik Vieth, Geoffrey Voelker, Johan Vromans, Inge Wallin, John -Paul Wallington, Colin Walters, Barry Warsaw, Morten Welinder, Joseph -Brian Wells, Rodney Whitby, John Wiegley, Ed Wilkinson, Mike Williams, -Bill Wohler, Steven A. Wood, Dale R.@: Worley, Francis J.@: Wright, -Felix S. T. Wu, Tom Wurgler, Katsumi Yamaoka, Masatake Yamato, -Jonathan Yavner, Ryan Yeske, Chong Yidong, Ilya Zakharevich, Milan -Zamazal, Victor Zandy, Eli Zaretskii, Jamie Zawinski, Shenghuo Zhu, -Ian T.@: Zimmermann, Reto Zimmermann, Neal Ziring, Teodor Zlatanov, -and Detlev Zundel. -@end iftex - -@node Intro, Glossary, Distrib, Top -@unnumbered Introduction - - You are reading about GNU Emacs, the GNU incarnation of the -advanced, self-documenting, customizable, extensible editor Emacs. -(The `G' in `GNU' is not silent.) - - We call Emacs advanced because it provides much more than simple -insertion and deletion. It can control subprocesses, indent programs -automatically, show two or more files at once, and edit formatted -text. Emacs editing commands operate in terms of characters, words, -lines, sentences, paragraphs, and pages, as well as expressions and -comments in various programming languages. - - @dfn{Self-documenting} means that at any time you can type a special -character, @kbd{Control-h}, to find out what your options are. You can -also use it to find out what any command does, or to find all the commands -that pertain to a topic. @xref{Help}. - - @dfn{Customizable} means that you can alter Emacs commands' behavior -in simple ways. For example, if you use a programming language in -which comments start with @samp{<**} and end with @samp{**>}, you can -tell the Emacs comment manipulation commands to use those strings -(@pxref{Comments}). Another sort of customization is rearrangement of -the command set. For example, you can rebind the basic cursor motion -commands (up, down, left and right) to any keys on the keyboard that -you find comfortable. @xref{Customization}. - - @dfn{Extensible} means that you can go beyond simple customization -and write entirely new commands---programs in the Lisp language to be -run by Emacs's own Lisp interpreter. Emacs is an ``on-line -extensible'' system, which means that it is divided into many -functions that call each other, any of which can be redefined in the -middle of an editing session. Almost any part of Emacs can be -replaced without making a separate copy of all of Emacs. Most of the -editing commands of Emacs are written in Lisp; the few exceptions -could have been written in Lisp but use C instead for efficiency. -Writing an extension is programming, but non-programmers can use it -afterwards. @xref{Top, Emacs Lisp Intro, Preface, eintr, An -Introduction to Programming in Emacs Lisp}, if you want to learn Emacs -Lisp programming. - - When running on a graphical display, Emacs provides its own menus -and convenient handling of mouse buttons. In addition, Emacs provides -many of the benefits of a graphical display even on a text-only -terminal. For instance, it can highlight parts of a file, display and -edit several files at once, move text between files, and edit files -while running shell commands. - -@include screen.texi -@include commands.texi -@include entering.texi -@include basic.texi -@include mini.texi -@include m-x.texi -@include help.texi -@include mark.texi -@include killing.texi -@include regs.texi -@include display.texi -@include search.texi -@include fixit.texi -@include kmacro.texi -@include files.texi -@include buffers.texi -@include windows.texi -@include frames.texi -@include mule.texi -@include major.texi -@include indent.texi -@include text.texi -@include programs.texi -@include building.texi -@include maintaining.texi -@include abbrevs.texi -@ifnottex -@include picture-xtra.texi -@end ifnottex -@include sending.texi -@include rmail.texi -@include dired.texi -@include calendar.texi -@include misc.texi -@include custom.texi -@include trouble.texi - -@node Copying, GNU Free Documentation License, Service, Top -@appendix GNU GENERAL PUBLIC LICENSE -@include gpl.texi - -@node GNU Free Documentation License, Emacs Invocation, Copying, Top -@appendix GNU Free Documentation License -@include doclicense.texi - -@include cmdargs.texi -@include xresources.texi - -@include anti.texi -@include macos.texi -@include msdog.texi -@include gnu.texi -@include glossary.texi -@ifnottex -@include ack.texi -@end ifnottex - -@c The Option Index is produced only in the on-line version, -@c because the index entries related to command-line options -@c tend to point to the same pages and all begin with a dash. -@c This, and the need to keep the node links consistent, are -@c the reasons for the funky @iftex/@ifnottex dance below. -@c The Option Index is _not_ before Key Index, because that -@c would require changes in the glossary.texi's @node line. -@c It is not after Concept Index for similar reasons. - -@iftex -@node Key Index, Command Index, Glossary, Top -@unnumbered Key (Character) Index -@printindex ky -@end iftex - -@ifnottex -@node Key Index, Option Index, Glossary, Top -@unnumbered Key (Character) Index -@printindex ky - -@node Option Index, Command Index, Key Index, Top -@unnumbered Command-Line Options Index -@printindex op - -@node Command Index, Variable Index, Option Index, Top -@unnumbered Command and Function Index -@printindex fn -@end ifnottex - -@iftex -@node Command Index, Variable Index, Key Index, Top -@unnumbered Command and Function Index -@printindex fn -@end iftex - -@node Variable Index, Concept Index, Command Index, Top -@unnumbered Variable Index -@printindex vr - -@node Concept Index, Acknowledgments, Variable Index, Top -@unnumbered Concept Index -@printindex cp - -@bye - -@ignore - arch-tag: ed48740a-410b-46ea-9387-c9a9252a3392 -@end ignore diff --git a/man/emerge-xtra.texi b/man/emerge-xtra.texi deleted file mode 100644 index e78f17e59d6..00000000000 --- a/man/emerge-xtra.texi +++ /dev/null @@ -1,414 +0,0 @@ -@c This is part of the Emacs manual. -@c Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. -@c See file emacs.texi for copying conditions. -@c -@c This file is included either in emacs-xtra.texi (when producing the -@c printed version) or in the main Emacs manual (for the on-line version). -@node Emerge -@section Merging Files with Emerge -@cindex Emerge -@cindex merging files - - It's not unusual for programmers to get their signals crossed and -modify the same program in two different directions. To recover from -this confusion, you need to merge the two versions. Emerge makes this -easier. For other ways to compare files, see -@iftex -@ref{Comparing Files,,, emacs, the Emacs Manual}, -@end iftex -@ifnottex -@ref{Comparing Files}, -@end ifnottex -and @ref{Top, Ediff,, ediff, The Ediff Manual}. - -@menu -* Overview of Emerge:: How to start Emerge. Basic concepts. -* Submodes of Emerge:: Fast mode vs. Edit mode. - Skip Prefers mode and Auto Advance mode. -* State of Difference:: You do the merge by specifying state A or B - for each difference. -* Merge Commands:: Commands for selecting a difference, - changing states of differences, etc. -* Exiting Emerge:: What to do when you've finished the merge. -* Combining in Emerge:: How to keep both alternatives for a difference. -* Fine Points of Emerge:: Misc. -@end menu - -@node Overview of Emerge -@subsection Overview of Emerge - - To start Emerge, run one of these four commands: - -@table @kbd -@item M-x emerge-files -@findex emerge-files -Merge two specified files. - -@item M-x emerge-files-with-ancestor -@findex emerge-files-with-ancestor -Merge two specified files, with reference to a common ancestor. - -@item M-x emerge-buffers -@findex emerge-buffers -Merge two buffers. - -@item M-x emerge-buffers-with-ancestor -@findex emerge-buffers-with-ancestor -Merge two buffers with reference to a common ancestor in a third -buffer. -@end table - -@cindex merge buffer (Emerge) -@cindex A and B buffers (Emerge) - The Emerge commands compare two files or buffers, and display the -comparison in three buffers: one for each input text (the @dfn{A buffer} -and the @dfn{B buffer}), and one (the @dfn{merge buffer}) where merging -takes place. The merge buffer shows the full merged text, not just the -differences. Wherever the two input texts differ, you can choose which -one of them to include in the merge buffer. - - The Emerge commands that take input from existing buffers use only -the accessible portions of those buffers, if they are narrowed. -@iftex -@xref{Narrowing,,, emacs, the Emacs Manual}. -@end iftex -@ifnottex -@xref{Narrowing}. -@end ifnottex - - - If a common ancestor version is available, from which the two texts to -be merged were both derived, Emerge can use it to guess which -alternative is right. Wherever one current version agrees with the -ancestor, Emerge presumes that the other current version is a deliberate -change which should be kept in the merged version. Use the -@samp{with-ancestor} commands if you want to specify a common ancestor -text. These commands read three file or buffer names---variant A, -variant B, and the common ancestor. - - After the comparison is done and the buffers are prepared, the -interactive merging starts. You control the merging by typing special -@dfn{merge commands} in the merge buffer (@pxref{Merge Commands}). -For each run of differences between the input texts, you can choose -which one of them to keep, or edit them both together. - - The merge buffer uses a special major mode, Emerge mode, with commands -for making these choices. But you can also edit the buffer with -ordinary Emacs commands. - - At any given time, the attention of Emerge is focused on one -particular difference, called the @dfn{selected} difference. This -difference is marked off in the three buffers like this: - -@example -vvvvvvvvvvvvvvvvvvvv -@var{text that differs} -^^^^^^^^^^^^^^^^^^^^ -@end example - -@noindent -Emerge numbers all the differences sequentially and the mode -line always shows the number of the selected difference. - - Normally, the merge buffer starts out with the A version of the text. -But when the A version of a difference agrees with the common ancestor, -then the B version is initially preferred for that difference. - - Emerge leaves the merged text in the merge buffer when you exit. At -that point, you can save it in a file with @kbd{C-x C-w}. If you give a -numeric argument to @code{emerge-files} or -@code{emerge-files-with-ancestor}, it reads the name of the output file -using the minibuffer. (This is the last file name those commands read.) -Then exiting from Emerge saves the merged text in the output file. - - Normally, Emerge commands save the output buffer in its file when you -exit. If you abort Emerge with @kbd{C-]}, the Emerge command does not -save the output buffer, but you can save it yourself if you wish. - -@node Submodes of Emerge -@subsection Submodes of Emerge - - You can choose between two modes for giving merge commands: Fast mode -and Edit mode. In Fast mode, basic merge commands are single -characters, but ordinary Emacs commands are disabled. This is -convenient if you use only merge commands. In Edit mode, all merge -commands start with the prefix key @kbd{C-c C-c}, and the normal Emacs -commands are also available. This allows editing the merge buffer, but -slows down Emerge operations. - - Use @kbd{e} to switch to Edit mode, and @kbd{C-c C-c f} to switch to -Fast mode. The mode line indicates Edit and Fast modes with @samp{E} -and @samp{F}. - - Emerge has two additional submodes that affect how particular merge -commands work: Auto Advance mode and Skip Prefers mode. - - If Auto Advance mode is in effect, the @kbd{a} and @kbd{b} commands -advance to the next difference. This lets you go through the merge -faster as long as you simply choose one of the alternatives from the -input. The mode line indicates Auto Advance mode with @samp{A}. - - If Skip Prefers mode is in effect, the @kbd{n} and @kbd{p} commands -skip over differences in states prefer-A and prefer-B (@pxref{State of -Difference}). Thus you see only differences for which neither version -is presumed ``correct.'' The mode line indicates Skip Prefers mode with -@samp{S}. - -@findex emerge-auto-advance-mode -@findex emerge-skip-prefers-mode - Use the command @kbd{s a} (@code{emerge-auto-advance-mode}) to set or -clear Auto Advance mode. Use @kbd{s s} -(@code{emerge-skip-prefers-mode}) to set or clear Skip Prefers mode. -These commands turn on the mode with a positive argument, turns it off -with a negative or zero argument, and toggle the mode with no argument. - -@node State of Difference -@subsection State of a Difference - - In the merge buffer, a difference is marked with lines of @samp{v} and -@samp{^} characters. Each difference has one of these seven states: - -@table @asis -@item A -The difference is showing the A version. The @kbd{a} command always -produces this state; the mode line indicates it with @samp{A}. - -@item B -The difference is showing the B version. The @kbd{b} command always -produces this state; the mode line indicates it with @samp{B}. - -@item default-A -@itemx default-B -The difference is showing the A or the B state by default, because you -haven't made a choice. All differences start in the default-A state -(and thus the merge buffer is a copy of the A buffer), except those for -which one alternative is ``preferred'' (see below). - -When you select a difference, its state changes from default-A or -default-B to plain A or B. Thus, the selected difference never has -state default-A or default-B, and these states are never displayed in -the mode line. - -The command @kbd{d a} chooses default-A as the default state, and @kbd{d -b} chooses default-B. This chosen default applies to all differences -which you haven't ever selected and for which no alternative is preferred. -If you are moving through the merge sequentially, the differences you -haven't selected are those following the selected one. Thus, while -moving sequentially, you can effectively make the A version the default -for some sections of the merge buffer and the B version the default for -others by using @kbd{d a} and @kbd{d b} between sections. - -@item prefer-A -@itemx prefer-B -The difference is showing the A or B state because it is -@dfn{preferred}. This means that you haven't made an explicit choice, -but one alternative seems likely to be right because the other -alternative agrees with the common ancestor. Thus, where the A buffer -agrees with the common ancestor, the B version is preferred, because -chances are it is the one that was actually changed. - -These two states are displayed in the mode line as @samp{A*} and @samp{B*}. - -@item combined -The difference is showing a combination of the A and B states, as a -result of the @kbd{x c} or @kbd{x C} commands. - -Once a difference is in this state, the @kbd{a} and @kbd{b} commands -don't do anything to it unless you give them a numeric argument. - -The mode line displays this state as @samp{comb}. -@end table - -@node Merge Commands -@subsection Merge Commands - - Here are the Merge commands for Fast mode; in Edit mode, precede them -with @kbd{C-c C-c}: - -@table @kbd -@item p -Select the previous difference. - -@item n -Select the next difference. - -@item a -Choose the A version of this difference. - -@item b -Choose the B version of this difference. - -@item C-u @var{n} j -Select difference number @var{n}. - -@item . -Select the difference containing point. You can use this command in the -merge buffer or in the A or B buffer. - -@item q -Quit---finish the merge. - -@item C-] -Abort---exit merging and do not save the output. - -@item f -Go into Fast mode. (In Edit mode, this is actually @kbd{C-c C-c f}.) - -@item e -Go into Edit mode. - -@item l -Recenter (like @kbd{C-l}) all three windows. - -@item - -Specify part of a prefix numeric argument. - -@item @var{digit} -Also specify part of a prefix numeric argument. - -@item d a -Choose the A version as the default from here down in -the merge buffer. - -@item d b -Choose the B version as the default from here down in -the merge buffer. - -@item c a -Copy the A version of this difference into the kill ring. - -@item c b -Copy the B version of this difference into the kill ring. - -@item i a -Insert the A version of this difference at point. - -@item i b -Insert the B version of this difference at point. - -@item m -Put point and mark around the difference. - -@item ^ -Scroll all three windows down (like @kbd{M-v}). - -@item v -Scroll all three windows up (like @kbd{C-v}). - -@item < -Scroll all three windows left (like @kbd{C-x <}). - -@item > -Scroll all three windows right (like @kbd{C-x >}). - -@item | -Reset horizontal scroll on all three windows. - -@item x 1 -Shrink the merge window to one line. (Use @kbd{C-u l} to restore it -to full size.) - -@item x c -Combine the two versions of this difference (@pxref{Combining in -Emerge}). - -@item x f -Show the names of the files/buffers Emerge is operating on, in a Help -window. (Use @kbd{C-u l} to restore windows.) - -@item x j -Join this difference with the following one. -(@kbd{C-u x j} joins this difference with the previous one.) - -@item x s -Split this difference into two differences. Before you use this -command, position point in each of the three buffers at the place where -you want to split the difference. - -@item x t -Trim identical lines off the top and bottom of the difference. -Such lines occur when the A and B versions are -identical but differ from the ancestor version. -@end table - -@node Exiting Emerge -@subsection Exiting Emerge - - The @kbd{q} command (@code{emerge-quit}) finishes the merge, storing -the results into the output file if you specified one. It restores the -A and B buffers to their proper contents, or kills them if they were -created by Emerge and you haven't changed them. It also disables the -Emerge commands in the merge buffer, since executing them later could -damage the contents of the various buffers. - - @kbd{C-]} aborts the merge. This means exiting without writing the -output file. If you didn't specify an output file, then there is no -real difference between aborting and finishing the merge. - - If the Emerge command was called from another Lisp program, then its -return value is @code{t} for successful completion, or @code{nil} if you -abort. - -@node Combining in Emerge -@subsection Combining the Two Versions - - Sometimes you want to keep @emph{both} alternatives for a particular -difference. To do this, use @kbd{x c}, which edits the merge buffer -like this: - -@example -@group -#ifdef NEW -@var{version from A buffer} -#else /* not NEW */ -@var{version from B buffer} -#endif /* not NEW */ -@end group -@end example - -@noindent -@vindex emerge-combine-versions-template -While this example shows C preprocessor conditionals delimiting the two -alternative versions, you can specify the strings to use by setting -the variable @code{emerge-combine-versions-template} to a string of your -choice. In the string, @samp{%a} says where to put version A, and -@samp{%b} says where to put version B. The default setting, which -produces the results shown above, looks like this: - -@example -@group -"#ifdef NEW\n%a#else /* not NEW */\n%b#endif /* not NEW */\n" -@end group -@end example - -@node Fine Points of Emerge -@subsection Fine Points of Emerge - - During the merge, you mustn't try to edit the A and B buffers yourself. -Emerge modifies them temporarily, but ultimately puts them back the way -they were. - - You can have any number of merges going at once---just don't use any one -buffer as input to more than one merge at once, since the temporary -changes made in these buffers would get in each other's way. - - Starting Emerge can take a long time because it needs to compare the -files fully. Emacs can't do anything else until @code{diff} finishes. -Perhaps in the future someone will change Emerge to do the comparison in -the background when the input files are large---then you could keep on -doing other things with Emacs until Emerge is ready to accept -commands. - -@vindex emerge-startup-hook - After setting up the merge, Emerge runs the hook -@code{emerge-startup-hook}. -@iftex -@xref{Hooks,,, emacs, the Emacs Manual}. -@end iftex -@ifnottex -@xref{Hooks}. -@end ifnottex - -@ignore - arch-tag: cda63f09-9c5f-4ea1-adb9-4a820fdfb24e -@end ignore diff --git a/man/eshell.texi b/man/eshell.texi deleted file mode 100644 index 3a4b705d2c9..00000000000 --- a/man/eshell.texi +++ /dev/null @@ -1,948 +0,0 @@ -\input texinfo @c -*-texinfo-*- -@c %**start of header -@setfilename ../info/eshell -@settitle Eshell: The Emacs Shell -@synindex vr fn -@c %**end of header - -@copying -This manual is for Eshell, the Emacs shell. - -Copyright @copyright{} 1999, 2000, 2001, 2002, 2003, 2004, -2005, 2006, 2007 Free Software Foundation, Inc. - -@quotation -Permission is granted to copy, distribute and/or modify this document -under the terms of the GNU Free Documentation License, Version 1.2 or -any later version published by the Free Software Foundation; with no -Invariant Sections, with the Front-Cover texts being ``A GNU -Manual'', and with the Back-Cover Texts as in (a) below. A copy of the -license is included in the section entitled ``GNU Free Documentation -License'' in the Emacs manual. - -(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify -this GNU Manual, like GNU software. Copies published by the Free -Software Foundation raise funds for GNU development.'' - -This document is part of a collection distributed under the GNU Free -Documentation License. If you want to distribute this document -separately from the collection, you can do so by adding a copy of the -license to the document, as described in section 6 of the license. -@end quotation -@end copying - -@dircategory Emacs -@direntry -* Eshell: (eshell). A command shell implemented in Emacs Lisp. -@end direntry - -@setchapternewpage on - -@titlepage -@sp 4 -@c The title is printed in a large font. -@center @titlefont{User's Guide} -@sp -@center @titlefont{to} -@sp -@center @titlefont{Eshell: The Emacs Shell} -@ignore -@sp 2 -@center release 2.4 -@c -release- -@end ignore -@sp 3 -@center John Wiegley -@c -date- - -@page -@vskip 0pt plus 1filll -@insertcopying -@end titlepage - -@contents - -@c ================================================================ -@c The real text starts here -@c ================================================================ - -@ifnottex -@node Top, What is Eshell?, (dir), (dir) -@top Eshell - -This manual documents Eshell, a shell-like command interpretor -implemented in Emacs Lisp. It invokes no external processes except for -those requested by the user. It is intended to be a functional -replacement for command shells such as @command{bash}, @command{zsh}, -@command{rc}, or @command{4dos}; since Emacs itself is capable of -handling the sort of tasks accomplished by those tools. -@c This manual is updated to release 2.4 of Eshell. -@end ifnottex - -@menu -* What is Eshell?:: A brief introduction to the Emacs Shell. -* Command basics:: The basics of command usage. -* Commands:: -* Arguments:: -* Input/Output:: -* Process control:: -* Extension modules:: -* Extras and Goodies:: -* Bugs and ideas:: Known problems, and future ideas. -* GNU Free Documentation License:: The license for this documentation. -* Concept Index:: -* Function and Variable Index:: -* Key Index:: -@end menu - -@node What is Eshell? -@chapter What is Eshell? -@cindex what is Eshell? -@cindex Eshell, what it is - -Eshell is a @dfn{command shell} written in Emacs Lisp. Everything it -does, it uses Emacs' facilities to do. This means that Eshell is as -portable as Emacs itself. It also means that cooperation with Lisp code -is natural and seamless. - -What is a command shell? To properly understand the role of a shell, -it's necessary to visualize what a computer does for you. Basically, a -computer is a tool; in order to use that tool, you must tell it what to -do---or give it ``commands.'' These commands take many forms, such as -clicking with a mouse on certain parts of the screen. But that is only -one form of command input. - -By far the most versatile way to express what you want the computer to -do is by using an abbreviated language called @dfn{script}. In -script, instead of telling the computer, ``list my files, please'', -one writes a standard abbreviated command word---@samp{ls}. Typing -@samp{ls} in a command shell is a script way of telling the computer -to list your files.@footnote{This is comparable to viewing the -contents of a folder using a graphical display.} - -The real flexibility of this approach is apparent only when you realize -that there are many, many different ways to list files. Perhaps you -want them sorted by name, sorted by date, in reverse order, or grouped -by type. Most graphical browsers have simple ways to express this. But -what about showing only a few files, or only files that meet a certain -criteria? In very complex and specific situations, the request becomes -too difficult to express using a mouse or pointing device. It is just -these kinds of requests that are easily solved using a command shell. - -For example, what if you want to list every Word file on your hard -drive, larger than 100 kilobytes in size, and which hasn't been looked -at in over six months? That is a good candidate list for deletion, when -you go to clean up your hard drive. But have you ever tried asking your -computer for such a list? There is no way to do it! At least, not -without using a command shell. - -The role of a command shell is to give you more control over what your -computer does for you. Not everyone needs this amount of control, and -it does come at a cost: Learning the necessary script commands to -express what you want done. A complicated query, such as the example -above, takes time to learn. But if you find yourself using your -computer frequently enough, it is more than worthwhile in the long run. -Any tool you use often deserves the time spent learning to master it. -@footnote{For the understandably curious, here is what that command -looks like: But don't let it fool you; once you know what's going on, -it's easier than it looks: @code{ls -lt **/*.doc(Lk+50aM+5)}.} - -@menu -* Contributors to Eshell:: People who have helped out! -@end menu - -@node Contributors to Eshell -@section Contributors to Eshell -@cindex contributors -@cindex authors - -Contributions to Eshell are welcome. I have limited time to work on -this project, but I will gladly add any code you contribute to me to -this package. - -The following persons have made contributions to Eshell. - -@itemize @bullet -@item -Eli Zaretskii made it possible for Eshell to run without requiring -asynchronous subprocess support. This is important for MS-DOS, which -does not have such support.@refill - -@item -Miles Bader contributed many fixes during the port to Emacs 21.@refill - -@item -Stefan Monnier fixed the things which bothered him, which of course made -things better for all.@refill - -@item -Gerd Moellmann also helped to contribute bug fixes during the initial -integration with Emacs 21.@refill - -@item -Alex Schroeder contributed code for interactively querying the user -before overwriting files.@refill - -@item -Sudish Joseph helped with some XEmacs compatibility issues.@refill -@end itemize - -Apart from these, a lot of people have sent suggestions, ideas, -requests, bug reports and encouragement. Thanks a lot! Without you -there would be no new releases of Eshell. - -@node Command basics -@chapter Basic overview - -A command shell is a means of entering verbally-formed commands. This -is really all that it does, and every feature described in this manual -is a means to that end. Therefore, it's important to take firm hold on -exactly what a command is, and how it fits in the overall picture of -things. - -@menu -* Commands verbs:: Commands always begin with a verb. -* Command arguments:: Some verbs require arguments. -@end menu - -@node Commands verbs -@section Commands verbs - -Commands are expressed using @dfn{script}, a special shorthand language -computers can understand with no trouble. Script is an extremely simple -language; oddly enough, this is what makes it look so complicated! -Whereas normal languages use a variety of embellishments, the form of a -script command is always: - -@example -@var{verb} [@var{arguments}] -@end example - -The verb expresses what you want your computer to do. There are a fixed -number of verbs, although this number is usually quite large. On the -author's computer, it reaches almost 1400 in number. But of course, -only a handful of these are really necessary. - -Sometimes, the verb is all that's written. A verb is always a single -word, usually related to the task it performs. @command{reboot} is a -good example. Entering that on GNU/Linux will reboot the -computer---assuming you have sufficient privileges. - -Other verbs require more information. These are usually very capable -verbs, and must be told specifically what to do. The extra information -is given in the form of @dfn{arguments}. For example, the -@command{echo} verb prints back whatever arguments you type. It -requires these arguments to know what to echo. A proper use of -@command{echo} looks like this: - -@example -echo This is an example of using echo! -@end example - -This script command causes the computer to echo back: ``This is an -example of using echo!'' - -Although command verbs are always simple words, like @command{reboot} or -@command{echo}, arguments may have a wide variety of forms. There are -textual arguments, numerical arguments---even Lisp arguments. -Distinguishing these different types of arguments requires special -typing, for the computer to know exactly what you mean. - -@node Command arguments -@section Command arguments - -Eshell recognizes several different kinds of command arguments: - -@enumerate -@item Strings (also called textual arguments) -@item Numbers (floating point or integer) -@item Lisp lists -@item Lisp symbols -@item Emacs buffers -@item Emacs process handles -@end enumerate - -Most users need to worry only about the first two. The third, Lisp lists, -occur very frequently, but almost always behind the scenes. - -Strings are the most common type of argument, and consist of nearly any -character. Special characters---those used by Eshell -specifically---must be preceded by a backslash (@samp{\}). When in doubt, it -is safe to add backslashes anywhere and everywhere. - -Here is a more complicated @command{echo} example: - -@example -echo A\ Multi-word\ Argument\ With\ A\ \$\ dollar -@end example - -Beyond this, things get a bit more complicated. While not beyond the -reach of someone wishing to learn, it is definitely beyond the scope of -this manual to present it all in a simplistic manner. Get comfortable -with Eshell as a basic command invocation tool, and learn more about the -commands on your system; then come back when it all sits more familiarly -on your mind. Have fun! - -@node Commands -@chapter Commands - -@menu -* Invocation:: -* Completion:: -* Aliases:: -* History:: -* Scripts:: -* Built-ins:: -@end menu - -Essentially, a command shell is all about invoking commands---and -everything that entails. So understanding how Eshell invokes commands -is the key to comprehending how it all works. - -@node Invocation -@section Invocation - -Unlike regular system shells, Eshell never invokes kernel functions -directly, such as @code{exec(3)}. Instead, it uses the Lisp functions -available in the Emacs Lisp library. It does this by transforming the -command you specify into a callable Lisp form.@footnote{To see the Lisp -form that will be invoked, type: @samp{eshell-parse-command "echo -hello"}} - -This transformation, from the string of text typed at the command -prompt, to the ultimate invocation of either a Lisp function or external -command, follows these steps: - -@enumerate -@item Parse the command string into separate arguments. -@item -@end enumerate - -@node Completion -@section Completion - -@node Aliases -@section Aliases - -@node History -@section History - -Eshell knows a few built-in variables: - -@table @code - -@item $+ -@vindex $+ -This variable always contains the current working directory. - -@item $- -@vindex $- -This variable always contains the previous working directory (the -current working directory from before the last @code{cd} command). - -@end table - -@node Scripts -@section Scripts - - -@node Built-ins -@section Built-in commands - -Here is a list of built-in commands that Eshell knows about: - -@table @code - -@item cd -@findex cd -This command changes the current working directory. Usually, it is -invoked as @samp{cd foo} where @file{foo} is the new working -directory. But @code{cd} knows about a few special arguments: - -When it receives no argument at all, it changes to the home directory. - -Giving the command @samp{cd -} changes back to the previous working -directory (this is the same as @samp{cd $-}). - -The command @samp{cd =} shows the directory stack. Each line is -numbered. - -With @samp{cd =foo}, Eshell searches the directory stack for a -directory matching the regular expression @samp{foo} and changes to -that directory. - -With @samp{cd -42}, you can access the directory stack by number. - -@end table - - -@node Arguments -@chapter Arguments - -@menu -* The Parser:: -* Variables:: -* Substitution:: -* Globbing:: -* Predicates:: -@end menu - -@node The Parser -@section The Parser - -@node Variables -@section Variables - -@node Substitution -@section Substitution - -@node Globbing -@section Globbing - -@node Predicates -@section Predicates - - -@node Input/Output -@chapter Input/Output - -@node Process control -@chapter Process control - - -@node Extension modules -@chapter Extension modules - -@menu -* Writing a module:: -* Module testing:: -* Directory handling:: -* Key rebinding:: -* Smart scrolling:: -* Terminal emulation:: -* Built-in UNIX commands:: -@end menu - -@node Writing a module -@section Writing a module - -@node Module testing -@section Module testing - -@node Directory handling -@section Directory handling - -@node Key rebinding -@section Key rebinding - -@node Smart scrolling -@section Smart scrolling - -@node Terminal emulation -@section Terminal emulation - -@node Built-in UNIX commands -@section Built-in UNIX commands - - -@node Extras and Goodies -@chapter Extras and Goodies - -@node Bugs and ideas -@chapter Bugs and ideas -@cindex reporting bugs and ideas -@cindex bugs, how to report them -@cindex author, how to reach -@cindex email to the author -@cindex FAQ -@cindex problems, list of common - -If you find a bug or misfeature, don't hesitate to let me know! Send -email to @email{johnw@@gnu.org}. Feature requests should also be sent -there. I prefer discussing one thing at a time. If you find several -unrelated bugs, please report them separately. - -If you have ideas for improvements, or if you have written some -extensions to this package, I would like to hear from you. I hope you -find this package useful! - -@menu -* Known problems:: -@end menu - -@node Known problems -@section Known problems -@cindex known bugs -@cindex bugs, known - -Below is complete list of known problems with Eshell version 2.4.2, -which is the version included with Emacs 22. - -@table @asis -@item Documentation incomplete - -@item Differentiate between aliases and functions - -Allow for a bash-compatible syntax, such as: - -@example -alias arg=blah -function arg () @{ blah $* @} -@end example - -@item @samp{for i in 1 2 3 @{ grep -q a b && *echo has it @} | wc -l} outputs result after prompt - -In fact, piping to a process from a looping construct doesn't work in -general. If I change the call to @code{eshell-copy-handles} in -@code{eshell-rewrite-for-command} to use @code{eshell-protect}, it seems -to work, but the output occurs after the prompt is displayed. The whole -structured command thing is too complicated at present. - -@item Error with @command{bc} in @code{eshell-test} - -On some XEmacs system, the subprocess interaction test fails -inexplicably, although @command{bc} works fine at the command prompt. - -@item Eshell does not delete @file{*Help*} buffers in XEmacs 21.1.8+ - -In XEmacs 21.1.8, the @file{*Help*} buffer has been renamed such that -multiple instances of the @file{*Help*} buffer can exist. - -@item Pcomplete sometimes gets stuck - -You press @key{TAB}, but no completions appear, even though the -directory has matching files. This behavior is rare. - -@item @samp{grep python $<rpm -qa>} doesn't work, but using @samp{*grep} does - -This happens because the @code{grep} Lisp function returns immediately, -and then the asynchronous @command{grep} process expects to examine the -temporary file, which has since been deleted. - -@item Problem with C-r repeating text - -If the text @emph{before point} reads "./run", and you type @kbd{C-r r u -n}, it will repeat the line for every character typed. - -@item Backspace doesn't scroll back after continuing (in smart mode) - -Hitting space during a process invocation, such as @command{make}, will -cause it to track the bottom of the output; but backspace no longer -scrolls back. - -@item It's not possible to fully @code{unload-feature} Eshell - -@item Menu support was removed, but never put back - -@item Using C-p and C-n with rebind gets into a locked state - -This happened a few times in Emacs 21, but has been unreproducible -since. - -@item If an interactive process is currently running, @kbd{M-!} doesn't work - -@item Use a timer instead of @code{sleep-for} when killing child processes - -@item Piping to a Lisp function is not supported - -Make it so that the Lisp command on the right of the pipe is repeatedly -called with the input strings as arguments. This will require changing -@code{eshell-do-pipeline} to handle non-process targets. - -@item Input redirection is not supported - -See the above entry. - -@item Problem running @command{less} without arguments on Windows - -The result in the Eshell buffer is: - -@example -Spawning child process: invalid argument -@end example - -Also a new @command{less} buffer was created with nothing in it@dots{} -(presumably this holds the output of @command{less}). - -If @command{less.exe} is invoked from the Eshell command line, the -expected output is written to the buffer. - -Note that this happens on NT-Emacs 20.6.1 on Windows 2000. The term.el -package and the supplied shell both use the @command{cmdproxy} program -for running shells. - -@item Implement @samp{-r}, @samp{-n} and @samp{-s} switches for @command{cp} - -@item Make @kbd{M-5 M-x eshell} switch to ``*eshell<5>*'', creating if need be - -@item @samp{mv @var{dir} @var{file}.tar} does not remove directories - -This is because the tar option --remove-files doesn't do so. Should it -be Eshell's job? - -@item Bind @code{standard-output} and @code{standard-error} - -This would be so that if a Lisp function calls @code{print}, everything -will happen as it should (albeit slowly). - -@item When an extension module fails to load, @samp{cd /} gives a Lisp error - -@item If a globbing pattern returns one match, should it be a list? - -@item Make sure syntax table is correct in Eshell mode - -So that @kbd{M-DEL} acts in a predictable manner, etc. - -@item Allow all Eshell buffers to share the same history and list-dir - -@item There is a problem with script commands that output to @file{/dev/null} - -If a script file, somewhere in the middle, uses @samp{> /dev/null}, -output from all subsequent commands is swallowed. - -@item Split up parsing of text after @samp{$} in @file{esh-var.el} - -Make it similar to the way that @file{esh-arg.el} is structured. -Then add parsing of @samp{$[?\n]}. - -@item After pressing @kbd{M-RET}, redisplay before running the next command - -@item Argument predicates and modifiers should work anywhere in a path - -@example -/usr/local/src/editors/vim $ vi **/CVS(/)/Root(.) -Invalid regexp: "Unmatched ( or \\(" -@end example - -With @command{zsh}, the glob above expands to all files named -@file{Root} in directories named @file{CVS}. - -@item Typing @samp{echo $@{locate locate@}/bin<TAB>} results in a Lisp error - -Perhaps it should interpolate all permutations, and make that the -globbing result, since otherwise hitting return here will result in -``(list of filenames)/bin'', which is never valuable. Thus, one could -@command{cat} only C backup files by using @samp{ls $@{identity *.c@}~}. -In that case, having an alias command name @command{glob} for -@command{identity} would be useful. - -@item Once symbolic mode is supported for @command{umask}, implement @command{chmod} in Lisp - -@item Create @code{eshell-expand-file-name} - -This would use a data table to transform things such as @samp{~+}, -@samp{...}, etc. - -@item Abstract @file{em-smart.el} into @file{smart-scroll.el} - -It only really needs: to be hooked onto the output filter and the -pre-command hook, and to have the input-end and input-start markers. -And to know whether the last output group was ``successful.'' - -@item Allow for fully persisting the state of Eshell - -This would include: variables, history, buffer, input, dir stack, etc. - -@item Implement D as an argument predicate - -It means that files beginning with a dot should be included in the -glob match. - -@item A comma in a predicate list should mean OR - -At the moment, this is not supported. - -@item Error if a glob doesn't expand due to a predicate - -An error should be generated only if @code{eshell-error-if-no-glob} is -non-@code{nil}. - -@item @samp{(+ RET SPC TAB} does not cause @code{indent-according-to-mode} to occur - -@item Create @code{eshell-auto-accumulate-list} - -This is a list of commands for which, if the user presses @kbd{RET}, the -text is staged as the next Eshell command, rather than being sent to the -current interactive process. - -@item Display file and line number if an error occurs in a script - -@item @command{wait} doesn't work with process ids at the moment - -@item Enable the direct-to-process input code in @file{em-term.el} - -@item Problem with repeating @samp{echo $@{find /tmp@}} - -With smart display active, if @kbd{RET} is held down, after a while it -can't keep up anymore and starts outputting blank lines. It only -happens if an asynchronous process is involved@dots{} - -I think the problem is that @code{eshell-send-input} is resetting the -input target location, so that if the asynchronous process is not done -by the time the next @kbd{RET} is received, the input processor thinks -that the input is meant for the process; which, when smart display is -enabled, will be the text of the last command line! That is a bug in -itself. - -In holding down @kbd{RET} while an asynchronous process is running, -there will be a point in between termination of the process, and the -running of @code{eshell-post-command-hook}, which would cause -@code{eshell-send-input} to call @code{eshell-copy-old-input}, and then -process that text as a command to be run after the process. Perhaps -there should be a way of killing pending input between the death of the -process, and the @code{post-command-hook}. - -@item Allow for a more aggressive smart display mode - -Perhaps toggled by a command, that makes each output block a smart -display block. - -@item Create more meta variables - -@table @samp -@item $! -The reason for the failure of the last disk command, or the text of the -last Lisp error. - -@item $= -A special associate array, which can take references of the form -@samp{$=[REGEXP]}. It indexes into the directory ring. -@end table - -@item Eshell scripts can't execute in the background - -@item Support zsh's ``Parameter Expansion'' syntax, i.e. @samp{$@{@var{name}:-@var{val}@}} - -@item Write an @command{info} alias that can take arguments - -So that the user can enter @samp{info chmod}, for example. - -@item Create a mode @code{eshell-browse} - -It would treat the Eshell buffer as a outline. Collapsing the outline -hides all of the output text. Collapsing again would show only the -first command run in each directory - -@item Allow other revisions of a file to be referenced using @samp{file@{rev@}} - -This would be expanded by @code{eshell-expand-file-name} (see above). - -@item Print ``You have new mail'' when the ``Mail'' icon is turned on - -@item Implement @kbd{M-|} for Eshell - -@item Implement input redirection - -If it's a Lisp function, input redirection implies @command{xargs} (in a -way@dots{}). If input redirection is added, also update the -@code{file-name-quote-list}, and the delimiter list. - -@item Allow @samp{#<@var{word} @var{arg}>} as a generic syntax - -With the handling of @emph{word} specified by an -@code{eshell-special-alist}. - -@item In @code{eshell-veal-using-options}, allow a @code{:complete} tag - -It would be used to provide completion rules for that command. Then the -macro will automagically define the completion function. - -@item For @code{eshell-command-on-region}, apply redirections to the result - -So that @samp{+ > 'blah} would cause the result of the @code{+} (using -input from the current region) to be inserting into the symbol -@code{blah}. - -If an external command is being invoked, the input is sent as standard -input, as if a @samp{cat <region> |} had been invoked. - -If a Lisp command, or an alias, is invoked, then if the line has no -newline characters, it is divided by whitespace and passed as arguments -to the Lisp function. Otherwise, it is divided at the newline -characters. Thus, invoking @code{+} on a series of numbers will add -them; @code{min} would display the smallest figure, etc. - -@item Write @code{eshell-script-mode} as a minor mode - -It would provide syntax, abbrev, highlighting and indenting support like -@code{emacs-lisp-mode} and @code{shell-mode}. - -@item In the history mechanism, finish the @command{bash}-style support - -This means @samp{!n}, @samp{!#}, @samp{!:%}, and @samp{!:1-} as separate -from @samp{!:1*}. - -@item Support the -n command line option for @command{history} - -@item Implement @command{fc} in Lisp - -@item Specifying a frame as a redirection target should imply the currently active window's buffer - -@item Implement @samp{>@var{func-or-func-list}} - -This would allow for an ``output translators'', that take a function to -modify output with, and a target. Devise a syntax that works well with -pipes, and can accommodate multiple functions (i.e., @samp{>'(upcase -regexp-quote)} or @samp{>'upcase}). - -@item Allow Eshell to read/write to/from standard input and output - -This would be optional, rather than always using the Eshell buffer. -This would allow it to be run from the command line (perhaps). - -@item Write a @command{help} command - -It would call subcommands with @option{--help}, or @option{-h} or -@option{/?}, as appropriate. - -@item Implement @command{stty} in Lisp - -@item Support @command{rc}'s matching operator, e.g. @samp{~ (@var{list}) @var{regexp}} - -@item Implement @command{bg} and @command{fg} as editors of @code{eshell-process-list} - -Using @command{bg} on a process that is already in the background does -nothing. Specifying redirection targets replaces (or adds) to the list -current being used. - -@item Have @command{jobs} print only the processes for the current shell - -@item How can Eshell learn if a background process has requested input? - -@item Support @samp{2>&1} and @samp{>&} and @samp{2>} and @samp{|&} - -The syntax table for parsing these should be customizable, such that the -user could change it to use rc syntax: @samp{>[2=1]}. - -@item Allow @samp{$_[-1]}, which would indicate the last element of the array - -@item Make @samp{$x[*]} equal to listing out the full contents of @samp{x} - -Return them as a list, so that @samp{$_[*]} is all the arguments of the -last command. - -@item Copy ANSI code handling from @file{term.el} into @file{em-term.el} - -Make it possible for the user to send char-by-char to the underlying -process. Ultimately, I should be able to move away from using term.el -altogether, since everything but the ANSI code handling is already part -of Eshell. Then, things would work correctly on MS-Windows as well -(which doesn't have @file{/bin/sh}, although @file{term.el} tries to use -it). - -@item Make the shell spawning commands be visual - -That is, make (@command{su}, @command{bash}, @command{telnet}, -@command{rlogin}, @command{rsh}, etc.) be part of -@code{eshell-visual-commands}. The only exception is if the shell is -being used to invoke a single command. Then, the behavior should be -based on what that command is. - -@item Create a smart viewing command named @command{open} - -This would search for some way to open its argument (similar to opening -a file in the Windows Explorer). - -@item Alias @command{read} to be the same as @command{open}, only read-only - -@item Write a @command{tail} command which uses @code{view-file} - -It would move point to the end of the buffer, and then turns on -auto-revert mode in that buffer at frequent intervals---and a -@command{head} alias which assumes an upper limit of -@code{eshell-maximum-line-length} characters per line. - -@item Make @command{dgrep} load @code{dired}, mark everything, then invoke @code{dired-do-search} - -@item Write mesh.c - -This would run Emacs with the appropriate arguments to invoke Eshell -only. That way, it could be listed as a login shell. - -@item Use an intangible @code{PS2} string for multi-line input prompts - -@item Auto-detect when a command is visual, by checking @code{TERMCAP} usage - -@item The first keypress after @kbd{M-x watson} triggers `eshell-send-input' - -@item Make @kbd{/} electric - -So that it automatically expands and corrects pathnames. Or make -pathname completion for Pcomplete auto-expand @samp{/u/i/std<TAB>} to -@samp{/usr/include/std<TAB>}. - -@item Write the @command{pushd} stack to disk along with @code{last-dir-ring} - -@item Add options to @code{eshell/cat} which would allow it to sort and uniq - -@item Implement @command{wc} in Lisp - -Add support for counting sentences, paragraphs, pages, etc. - -@item Once piping is added, implement @command{sort} and @command{uniq} in Lisp - -@item Implement @command{touch} in Lisp - -@item Implement @command{comm} in Lisp - -@item Implement an @command{epatch} command in Lisp - -This would call @code{ediff-patch-file}, or @code{ediff-patch-buffer}, -depending on its argument. - -@item Have an option such that @samp{ls -l} generates a dired buffer - -@item Write a version of @command{xargs} based on command rewriting - -That is, @samp{find X | xargs Y} would be indicated using @samp{Y -$@{find X@}}. Maybe @code{eshell-do-pipelines} could be changed to -perform this on-thy-fly rewriting. - -@item Write an alias for @command{less} that brings up a @code{view-mode} buffer - -Such that the user can press @key{SPC} and @key{DEL}, and then @key{q} -to return to Eshell. It would be equivalent to: -@samp{X > #<buffer Y>; view-buffer #<buffer Y>}. - -@item Make @code{eshell-mode} as much a full citizen as @code{shell-mode} - -Everywhere in Emacs where @code{shell-mode} is specially noticed, add -@code{eshell-mode} there. - -@item Permit the umask to be selectively set on a @command{cp} target - -@item Problem using @kbd{M-x eshell} after using @code{eshell-command} - -If the first thing that I do after entering Emacs is to run -@code{eshell-command} and invoke @command{ls}, and then use @kbd{M-x -eshell}, it doesn't display anything. - -@item @kbd{M-RET} during a long command (using smart display) doesn't work - -Since it keeps the cursor up where the command was invoked. - -@end table - -@node GNU Free Documentation License -@appendix GNU Free Documentation License -@include doclicense.texi - -@node Concept Index -@unnumbered Concept Index - -@printindex cp - -@node Function and Variable Index -@unnumbered Function and Variable Index - -@printindex fn - -@node Key Index -@unnumbered Key Index - -@printindex ky -@bye - -@ignore - arch-tag: 776409ba-cb15-42b9-b2b6-d2bdc7ebad01 -@end ignore diff --git a/man/eudc.texi b/man/eudc.texi deleted file mode 100644 index 7a8dbbee524..00000000000 --- a/man/eudc.texi +++ /dev/null @@ -1,985 +0,0 @@ -\input texinfo.tex -@c %**start of header -@setfilename ../info/eudc -@settitle Emacs Unified Directory Client (EUDC) Manual -@afourpaper -@c %**end of header - -@copying -This file documents EUDC v1.30b. - -EUDC is the Emacs Unified Directory Client, a common interface to -directory servers using various protocols such as LDAP or the CCSO white -pages directory system (PH/QI) - -Copyright @copyright{} 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 -Free Software Foundation, Inc. - -@quotation -Permission is granted to copy, distribute and/or modify this document -under the terms of the GNU Free Documentation License, Version 1.2 or -any later version published by the Free Software Foundation; with no -Invariant Sections, with the Front-Cover texts being ``A GNU -Manual'', and with the Back-Cover Texts as in (a) below. A copy of the -license is included in the section entitled ``GNU Free Documentation -License'' in the Emacs manual. - -(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify -this GNU Manual, like GNU software. Copies published by the Free -Software Foundation raise funds for GNU development.'' - -This document is part of a collection distributed under the GNU Free -Documentation License. If you want to distribute this document -separately from the collection, you can do so by adding a copy of the -license to the document, as described in section 6 of the license. -@end quotation -@end copying - -@dircategory Emacs -@direntry -* EUDC: (eudc). An Emacs client for directory servers (LDAP, PH). -@end direntry - -@footnotestyle end - -@titlepage -@title{EUDC Manual} -@subtitle{The Emacs Unified Directory Client} -@author by Oscar Figueiredo -@code{1.30b} - -@page -@vskip 0pt plus 1fill -@insertcopying -@end titlepage - -@ifnottex -@node Top, Overview, (dir), (dir) -@comment node-name, next, previous, up - - -This manual documents EUDC v1.30b, the Emacs Unified Directory Client. - -A common interface to directory servers using various protocols such as -LDAP or the CCSO white pages directory system (PH/QI) - -@end ifnottex - -@menu -* Overview:: Summary of EUDC features -* Installation:: How to install EUDC -* Usage:: The various usage possibilities explained -* Credits:: Who's done what -* GNU Free Documentation License:: The license for this documentation. -* Command and Function Index:: -* Variables Index:: -@end menu - - - - - -@node Overview, Installation, Top, Top -@comment node-name, next, previous, up -@chapter Overview - -EUDC, the @dfn{Emacs Unified Directory Client}, provides a common user -interface to access directory servers using different directory -protocols. - -Currently supported back-ends are: - -@itemize @bullet -@item -LDAP, Lightweight Directory Access Protocol -@item -CCSO PH/QI -@item -BBDB, Big Brother's Insidious Database -@end itemize - -The main features of the EUDC interface are: - -@itemize @bullet -@item -Queries using a customizable form -@item -Inline query expansion (for instance you can expand a name -to an email address in a mail message buffer using a server as an -address book) -@item -Multiple servers can be tried in turn until a match is found for an -inline query -@item -Fast minibuffer queries for email addresses and phone numbers -@item -Interface to BBDB to let you insert server records into your own BBDB database -(@pxref{Top,,BBDB,bbdb,BBDB Manual}) -@end itemize - -@menu -* LDAP:: What is LDAP ? -* CCSO PH/QI:: What is CCSO, PH, QI ? -* BBDB:: What is BBDB ? -@end menu - - - -@node LDAP, CCSO PH/QI, Overview, Overview -@comment node-name, next, previous, up -@section LDAP - -LDAP, @dfn{the Lightweight Directory Access Protocol}, is a communication -protocol for directory applications defined in RFC 1777. - -Quoted from RFC 1777: - -@quotation -[LDAP] is designed to provide access to the X.500 Directory while not -incurring the resource requirements of the Directory Access Protocol -(DAP). This protocol is specifically targeted at simple management -applications and browser applications that provide simple read/write -interactive access to the X.500 Directory, and is intended to be a -complement to the DAP itself. -@end quotation - -LDAP servers usually store (but are not limited to) information about -people such as their name, phone number, email address, office -location, etc@enddots{} More information about LDAP can be found at -@url{http://www.openldap.org/} - -EUDC requires external support to access LDAP directory servers -(@pxref{LDAP Requirements}) - - -@node CCSO PH/QI, BBDB, LDAP, Overview -@comment node-name, next, previous, up -@section CCSO PH/QI - -The Central Computing Services Office (CCSO) of the University of -Illinois at Urbana Champaign (UIUC) created and freely distributes a -directory system that is currently in use in more than 300 organizations -around the world. The system records information about people such as -their address, phone number, email, academic information or any other -details it was configured to. - -The system consists of two parts: a database server traditionally called -@samp{qi} and a command-line client called @samp{ph}. -@url{ftp://uiarchive.cso.uiuc.edu/pub/packages/ph} is the main -distribution site. @url{http://www.uiuc.edu/cgi-bin/ph/lookup?Query=.} -provides a listing of the active @samp{qi} servers. - -The original command-line @samp{ph} client that comes with the -@samp{ph/qi} distribution provides additional features like the -possibility to communicate with the server in login-mode which makes it -possible to change records in the database. This is not implemented in -EUDC. - - -@node BBDB, , CCSO PH/QI, Overview -@comment node-name, next, previous, up -@section BBDB - -BBDB is the @dfn{Big Brother's Insidious Database}, a package for Emacs -originally written by Jamie Zawinski which provides rolodex-like -database functionality featuring tight integration with the Emacs mail -and news readers. - -It is often used as an enhanced email address book. - -EUDC considers BBDB as a directory server back end just like LDAP or -PH/QI servers, though BBDB has no client/server protocol and thus always -resides locally on your machine. The point in this is not to offer an -alternate way to query your BBDB database (BBDB itself provides much -more flexible ways to do that), but rather to offer an interface to your -local directory that is consistent with the interface to external -directories (LDAP, PH/QI). This is particularly interesting when -performing queries on multiple servers. - -EUDC also offers a means to insert results from directory queries into -your own local BBDB (@pxref{Creating BBDB Records}) - -@node Installation, Usage, Overview, Top -@comment node-name, next, previous, up -@chapter Installation - -Add the following to your @file{.emacs} init file: -@lisp -(require 'eudc) -@end lisp -This will install EUDC at startup. - -After installing EUDC you will find (the next time you launch Emacs) a -new @code{Directory Search} submenu in the @samp{Tools} menu that will -give you access to EUDC. - -You may also find it useful to add the following to your @file{.emacs} -initialization file to add a shortcut for email address expansion in -email composition buffers (@pxref{Inline Query Expansion}) - -@lisp -(eval-after-load - "message" - '(define-key message-mode-map [(control ?c) (tab)] 'eudc-expand-inline)) -(eval-after-load - "sendmail" - '(define-key mail-mode-map [(control ?c) (tab)] 'eudc-expand-inline)) -@end lisp - -@menu -* LDAP Requirements:: EUDC needs external support for LDAP -@end menu - -@node LDAP Requirements, , Installation, Installation -@comment node-name, next, previous, up -@section LDAP Requirements - -LDAP support is added by means of @file{ldap.el} which is part of Emacs. -@file{ldap.el} needs an external command line utility named -@file{ldapsearch} which is available as part of LDAP toolkits: - -@itemize @bullet -@item -Open LDAP Libraries -(@url{http://www.openldap.org/}) -@item -University of Michigan's LDAP Client software -(@url{http://www.umich.edu/~dirsvcs/ldap/}) -@end itemize - - -@node Usage, Credits, Installation, Top -@comment node-name, next, previous, up -@chapter Usage - -This chapter describes the usage of EUDC. Most functions and -customization options are available through the @samp{Directory Search} -submenu of the @samp{Tools} submenu. - -@menu -* Querying Servers:: How queries are performed and handled -* Query Form:: How to use and customize the query form -* Display of Query Results:: Controlling how query results are presented -* Inline Query Expansion:: How to use and customize inline queries -* The Server Hotlist:: How to use and manage the server hotlist -* Multi-server Queries:: How to query multiple servers successively -* Creating BBDB Records:: How to insert query results into your BBDB -* Server/Protocol Locals:: Customizing on a per server/protocol basis -@end menu - - -@node Querying Servers, Query Form, Usage, Usage -@comment node-name, next, previous, up -@section Querying Servers - -EUDC's basic functionality is to let you query a directory server and -return the results back to you. There are several things you may want -to customize in this process. - - -@menu -* Selecting a Server:: The first thing to do -* Return Attributes:: Configuring what the server should return -* Duplicate Attributes:: What to do when records have duplicate attributes -@end menu - -@node Selecting a Server, Return Attributes, Querying Servers, Querying Servers -@subsection Selecting a Server - -Before doing any query you will need to set the directory server. You -need to specify the name of the host machine running the server software -and the protocol to use. If you do not set the server in any fashion, -EUDC will ask you for one when you make your first query. - -You can set the server by selecting one from your hotlist of servers -(@pxref{The Server Hotlist}) available in the @samp{Server} submenu or -by selecting @samp{New Server} in that same menu. - -LDAP servers generally require some configuration before you can perform -queries on them. In particular, the @dfn{search base} must be -configured. If the server you select has no configured search base then -EUDC will propose you to configure it at this point. A customization -buffer will be displayed where you can edit the search base and other -parameters for the server. - -@defvar eudc-server -The name or IP address of the remote directory server. A TCP port number -may be specified by appending a colon and a number to the name of the -server. You will not need this unless your server runs on a port other -than the default (which depends on the protocol). -If the directory server resides on your own computer (which is the case -if you use the BBDB back end) then `localhost' is a reasonable value but -it will be ignored anyway. -@end defvar - -@defvar eudc-protocol -The directory protocol to use to query the server. Currently supported -protocols in this version of EUDC are @code{ph}, @code{ldap} and @code{bbdb}. -@end defvar - -@deffn Command eudc-set-server -This command accessible from @samp{New Server} submenu lets you specify a -new directory server and protocol. -@end deffn - -@node Return Attributes, Duplicate Attributes, Selecting a Server, Querying Servers -@subsection Return Attributes - -Directory servers may be configured to return a default set of -attributes for each record matching a query if the query specifies none. -The variable @code{eudc-default-return-attributes} controls the return -attributes you want to see, if different from the server defaults. - -@defvar eudc-default-return-attributes -A list of the default attributes to extract from directory entries. If -set to the symbol @code{all} then all available attributes are -returned. A value of @code{nil}, the default, means to return the -default attributes as configured in the server. -@end defvar - -The server may return several matching records to a query. Some of the -records may however not contain all the attributes you requested. You can -discard those records. - -@defopt eudc-strict-return-matches -If non-@code{nil}, entries that do not contain all the requested return -attributes are ignored. Default is @code{t}. -@end defopt - -@node Duplicate Attributes, , Return Attributes, Querying Servers -@subsection Duplicate Attributes - -Directory standards may authorize different instances of the same -attribute in a record. For instance the record of a person may contain -several email fields containing different email addresses. When using -a QI directory server this is difficult to distinguish from attributes -having multi-line values such as the postal address that may contain a -line for the street and another one for the zip code and city name. In -both cases, EUDC will consider the attribute duplicated. - -EUDC has several methods to deal with duplicated attributes. The -available methods are: - -@table @code -@item list -Makes a list with the different values of the duplicate attribute. The -record is returned with only one instance of the attribute with a list -of all the different values as a value. This is the default method that -is used to handle duplicate fields for which no other method has been -specified. -@item first -Discards all the duplicate values of the field keeping only the first -one. -@item concat -Concatenates the different values using a newline as a separator. The -record keeps only one instance of the field the value of which is a -single multi-line string. -@item duplicate -Duplicates the whole record into as many instances as there are different -values for the field. This is the default for the email field. Thus a -record containing 3 different email addresses is duplicated into three -different records each having a single email address. This is -particularly useful in combination with @code{select} as the method to -handle multiple matches in inline expansion queries (@pxref{Inline Query -Expansion}) because you are presented with the 3 addresses in a -selection buffer -@end table - -Because a method may not be applicable to all fields, the variable -@code{eudc-duplicate-attribute-handling-method} lets you specify either a -default method for all fields or a method for each individual field. - -@defvar eudc-duplicate-attribute-handling-method -A method to handle entries containing duplicate attributes. This is -either an alist of elements @code{(@var{attr} . @var{method})}, or a symbol -@var{method}. The alist form of the variable associates a method to an -individual attribute name; the second form specifies a method applicable -to all attribute names. Available methods are: @code{list}, -@code{first}, @code{concat}, and @code{duplicate} (see above). The default is -@code{list}. -@end defvar - - - -@node Query Form, Display of Query Results, Querying Servers, Usage -@comment node-name, next, previous, up -@section Query Form - -The simplest way to query your directory server is to use the query -form. You display the query form with the @samp{Query with Form} menu -item or by invoking the command @kbd{M-x eudc-query-form}. The attribute -names presented in this form are defined by the -@code{eudc-query-form-attributes} variable (unless a non-@code{nil} -argument is supplied to @code{eudc-query-form}). - -Since the different directory protocols to which EUDC interfaces may -use different names for equivalent attributes, EUDC defines its own set -of attribute names and a mapping between these names and their -protocol-specific equivalent through the variable -@code{eudc-protocol-attributes-translation-alist}. Names currently -defined by EUDC are @code{name}, @code{firstname}, @code{email} and -@code{phone}. - -@defvar eudc-query-form-attributes -@findex eudc-get-attribute-list -A list of attributes presented in the query form. Attribute names in -this list should be either EUDC attribute names or valid attribute -names. You can get a list of valid attribute names for the current -protocol with the @samp{List Valid Attribute Names} menu item or the -@kbd{M-x eudc-get-attribute-list} command. Defaults to @code{name}, -@code{email} and @code{phone}. -@end defvar - -@deffn Command eudc-query-form get-fields-from-server -Display a form to query the directory server. If given a non-@code{nil} -argument the function first queries the server for the existing fields -and displays a corresponding form. Not all protocols may support a -non-@code{nil} argument here. -@end deffn - -Since the names of the fields may not be explicit enough or adapted to -be directly displayed as prompt strings in the form, the variable -@code{eudc-user-attribute-names-alist} lets you define more explicit -names for directory attribute names. This variable is ignored if -@code{eudc-use-raw-directory-names} is non-@code{nil}. - -@defvar eudc-user-attribute-names-alist -This is an alist of user-defined names for the directory attributes used in -query/response forms. Prompt strings for attributes that are not in this -alist are derived by splitting the attribute name at underscores and -capitalizing the individual words. -@end defvar - -@defvar eudc-use-raw-directory-names -If non-@code{nil}, use attributes names as defined in the directory. -Otherwise, directory query/response forms display the user attribute -names defined in @code{eudc-user-attribute-names-alist}. -@end defvar - -@node Display of Query Results, Inline Query Expansion, Query Form, Usage -@comment node-name, next, previous, up -@section Display of Query Results - -Upon successful completion of a form query, EUDC will display a buffer -containing the results of the query. - -The fields that are returned for each record -are controlled by @code{eudc-default-return-attributes} (@pxref{Return -Attributes}). - -The display of each individual field can be performed by an arbitrary -function which allows specific processing for binary values, such as -images or audio samples, as well as values with semantics, such as -URLs. - -@defvar eudc-attribute-display-method-alist -An alist specifying methods to display attribute values. Each member of -the list is of the form @code{(@var{name} . @var{func})} where -@var{name} is a lowercased string naming a directory attribute -(translated according to @code{eudc-user-attribute-names-alist} if -@code{eudc-use-raw-directory-names} is non-@code{nil}) and @var{func} a -function that will be passed the corresponding attribute values for -display. -@end defvar - -This variable has protocol-local definitions (see @pxref{Server/Protocol -Locals}). For instance, it is defined as follows for LDAP: - -@lisp -(eudc-protocol-set 'eudc-attribute-display-method-alist - '(("jpegphoto" . eudc-display-jpeg-inline) - ("labeledurl" . eudc-display-url) - ("audio" . eudc-display-sound) - ("labeledurl" . eudc-display-url) - ("url" . eudc-display-url)) - 'ldap) -@end lisp - -EUDC provides a set of built-in functions to display binary value types: - -@defun eudc-display-generic-binary data -Display a button for unidentified binary @var{data}. -@end defun - -@defun eudc-display-url url -Display URL and make it clickable. -@end defun - -@defun eudc-display-sound data -Display a button to play the sound @var{data}. -@end defun - -@defun eudc-display-jpeg-inline data -Display the JPEG @var{data} inline at point if possible. -@end defun - -@defun eudc-display-jpeg-as-button data -Display a button for the JPEG @var{data}. -@end defun - -Right-clicking on a binary value button pops up a contextual menu with -options to process the value. Among these are saving the attribute -value to a file or sending it to an external viewer command. External -viewers should expect the value on their standard input and should -display it or perform arbitrary processing on it. Messages sent to -standard output are discarded. External viewers are listed in the -variable @code{eudc-external-viewers} which you can customize. - -@defvar eudc-external-viewers -This is a list of viewer program specifications. Each specification is -a list whose first element is a string naming the viewer for unique -identification, the second element is the executable program which -should be invoked and the following elements are arguments that should -be passed to the program. -@end defvar - - -@node Inline Query Expansion, The Server Hotlist, Display of Query Results, Usage -@comment node-name, next, previous, up -@section Inline Query Expansion - -Inline query expansion is a powerful method to get completion from your -directory server. The most common usage is for expanding names to email -addresses in mail message buffers. The expansion is performed by the -command @kbd{M-x eudc-expand-inline} which is available from the -@samp{Expand Inline Query} menu item but can also be conveniently -bound to a key shortcut (@pxref{Installation}). The operation is -controlled by the variables @code{eudc-inline-expansion-format}, -@code{eudc-inline-query-format}, -@code{eudc-expanding-overwrites-query} and -@code{eudc-multiple-match-handling-method}. - -If the query fails for a server, other servers may be tried successively -until one of them finds a match (@pxref{Multi-server Queries}). - -@deffn Command eudc-expand-inline replace-p -Query the server and expand the query string before point. The query -string consists of the buffer substring from the point back to the -preceding comma, colon or beginning of -line. @code{eudc-inline-query-format} controls how individual words -are mapped onto directory attribute names. After querying the server -for the given string, the expansion specified by -@code{eudc-inline-expansion-format} is inserted in the buffer at -point. If @var{replace-p} is @code{t} then this expansion replaces the -query string in the buffer. If @code{eudc-expanding-overwrites-query} -is non-@code{nil} then the meaning of @var{replace-p} is negated. -@end deffn - -@defvar eudc-inline-query-format -Format of an inline expansion query. -This is actually a list of @var{format}s. A @var{format} is a list of -one or more EUDC attribute names. A @var{format} applies if it contains -as many attributes as individual words in the inline query string. If -several @var{format}s apply then they are tried in order until a match -is found. If @code{nil} all the words will be mapped onto the default -server/protocol attribute name (generally @code{name}). - -For instance, use the following -@lisp -(setq eudc-inline-query-format '((name) - (firstname) - (firstname name))) -@end lisp -@noindent -to indicate that single word expansion queries are to be considered as -surnames and if no match is found then they should be tried as first -names. Inline queries consisting of two words are considered as -consisting of a first name followed by a surname. If the query consists -of more than two words, then the first one is considered as the first -name and the remaining words are all considered as surname constituents. - -@var{format}s are in fact not limited to EUDC attribute names, you can -use server or protocol specific names in them. It may be safer if you -do so, to set the variable @code{eudc-inline-query-format} in a protocol -or server local fashion (see @pxref{Server/Protocol Locals}). - -For instance you could use the following to match up to three words -against the @code{cn} attribute of LDAP servers: -@lisp -(eudc-protocol-set 'eudc-inline-query-format - '((cn) - (cn cn) - (cn cn cn)) - 'ldap) -@end lisp -@end defvar - -@defvar eudc-inline-expansion-format -This variable lets you control exactly what is inserted into the buffer -upon an inline expansion request. It is a list whose first element is a -string passed to @code{format}. Remaining elements are symbols -corresponding to directory attribute names. The corresponding attribute -values are passed as additional arguments to @code{format}. Default is -@code{("%s" email)} but you may want to consider a value like @code{("%s -<%s>" name email)} -@end defvar - -@defvar eudc-multiple-match-handling-method -This variable controls what to do when multiple entries match a query -for an inline expansion. Possible values are: -@table @code -@item first -The first match is considered as being the only one, the others are -discarded. -@item select -A selection buffer pops up where you can choose a particular match. This -is the default value of the variable. -@item all -The expansion uses all records successively -@item abort -An error is signaled. The expansion aborts. -@end table - -Default is @code{select} -@end defvar - - - -@node The Server Hotlist, Multi-server Queries, Inline Query Expansion, Usage -@comment node-name, next, previous, up -@section The Server Hotlist - -EUDC lets you maintain a list of frequently used servers so that you -can easily switch from one to another. This hotlist appears in the -@samp{Server} submenu. You select a server in this list by clicking on -its name. You can add the current server to the list with the command -@kbd{M-x eudc-bookmark-current-server}. The list is contained in the variable -@code{eudc-server-hotlist} which is stored in and retrieved from the file -designated by @code{eudc-options-file}. EUDC also provides a facility to -edit the hotlist interactively (@pxref{The Hotlist Edit Buffer}). - -The hotlist is also used to make queries on multiple servers -successively (@pxref{Multi-server Queries}). The order in which the -servers are tried is the order they appear in the hotlist, therefore it -is important to sort the hotlist appropriately. - -@deffn Command eudc-bookmark-server server -Add @var{server} to the hotlist of servers -@end deffn - -@deffn Command eudc-bookmark-current-server -Add the current server to the hotlist of servers -@end deffn - -@defvar eudc-options-file -The name of a file where EUDC stores its internal variables -(the hotlist and the current server). EUDC will try to load -that file upon initialization so, if you choose a file name -different from the defaults @file{~/.eudc-options}, be sure to set this -variable to the appropriate value @emph{before} EUDC is itself -loaded. -@end defvar - -@menu -* The Hotlist Edit Buffer:: An interactive hotlist editing facility -@end menu - -@node The Hotlist Edit Buffer, , The Server Hotlist, The Server Hotlist -@comment node-name, next, previous, up -@subsection The Hotlist Edit Buffer - -The hotlist edit buffer offers a means to manage a list of frequently -used servers. Commands are available in the context pop-up menu -generally bound to the right mouse button. Those commands also have -equivalent key bindings. - -@deffn Command eudc-hotlist-add-server -Bound to @kbd{a}. -Add a new server to the hotlist on the line after point -@end deffn - -@deffn Command eudc-hotlist-delete-server -Bound to @kbd{d}. -Delete the server on the line point is on -@end deffn - -@deffn Command eudc-hotlist-select-server -Bound to @kbd{s}. -Select the server the point is on as the current directory server for -the next queries -@end deffn - -@deffn Command eudc-hotlist-transpose-servers -Bound to @kbd{t}. -Bubble up the server the point is on to the top of the list -@end deffn - -@deffn Command eudc-hotlist-quit-edit -Bound to @kbd{q}. -Save the changes and quit the hotlist edit buffer. Use @kbd{x} or -@kbd{M-x kill-buffer} to exit without saving. -@end deffn - - -@node Multi-server Queries, Creating BBDB Records, The Server Hotlist, Usage -@comment node-name, next, previous, up -@section Multi-server Queries - -When using inline query expansion (@pxref{Inline Query Expansion}), EUDC -can try to query successively a sequence of directory servers until one -of them successfully finds a match for the query. - -@defvar eudc-inline-expansion-servers -This variable controls which servers are tried and in which order when -trying to perform an inline query. Possible values are: -@table @code -@item current-server -Only the current directory server is tried -@item hotlist -The servers in the hotlist are tried in order until one finds a match -for the query or `eudc-max-servers-to-query' is reached -@item server-then-hotlist -The current server then the servers in the hotlist are tried in the -order they appear in the hotlist until one of them finds a match or -`eudc-max-servers-to-query' is reached. This is the default. -@end table -@end defvar - -@defvar eudc-max-servers-to-query -This variable indicates the maximum number of servers to query when -performing a multi-server query. The default, @code{nil}, indicates -that all available servers should be tried. -@end defvar - - - -@node Creating BBDB Records, Server/Protocol Locals, Multi-server Queries, Usage -@comment node-name, next, previous, up -@section Creating BBDB Records - -@findex eudc-insert-record-at-point-into-bbdb -@findex eudc-try-bbdb-insert -With EUDC, you can automatically create BBDB records -(@pxref{Top,,BBDB,bbdb,BBDB Manual}) from records you get from a -directory server. You do this by moving point to the appropriate -record in a query result display buffer and invoking the command -@kbd{M-x eudc-insert-record-at-point-into-bbdb} with the -keyboard binding @kbd{b}@footnote{This key binding does not actually -call @code{eudc-insert-record-at-point-into-bbdb} but uses -@code{eudc-try-bbdb-insert} instead.}, or with the menu. EUDC -cannot update an existing BBDB record and will signal an error if you -try to insert a record matching an existing one. - -@findex eudc-batch-export-records-to-bbdb -It is also possible to export to BBDB the whole batch of records -contained in the directory query result with the command -@kbd{M-x eudc-batch-export-records-to-bbdb}. - -Because directory systems may not enforce a strict record format, local -server installations may use different attribute names and have -different ways to organize the information. Furthermore BBDB has its own -record structure. For these reasons converting a record from its -external directory format to the BBDB format is a highly customizable -process. - -@defvar eudc-bbdb-conversion-alist -The value of this variable should be a symbol naming an alist defining a -mapping between BBDB field names onto directory attribute names records. -This is a protocol-local variable and is initialized upon protocol -switch (@pxref{Server/Protocol Locals}). The alist is made of cells of the -form @code{(@var{bbdb-field} . @var{spec-or-list})}. -@var{bbdb-field} is the name of a field -that must be defined in your BBDB environment (standard field names are -@code{name}, @code{company}, @code{net}, @code{phone}, @code{address} -and @code{notes}). -@var{spec-or-list} is either a single mapping specification or a list of -mapping specifications. Lists of mapping specifications are valid for -the @code{phone} and @code{address} BBDB fields only. @var{spec}s are -actually s-expressions which are evaluated as follows: - -@table @asis -@item a string -evaluates to itself -@item a symbol -evaluates to the symbol value. Symbols corresponding to directory -attribute names present in the record evaluate to the value of the field -in the record -@item a form -is evaluated as a function. The argument list may contain attribute -names which evaluate to the corresponding values in the record. The form -evaluation should return something appropriate for the particular -@var{bbdb-field} (see @code{bbdb-create-internal}). -@code{eudc-bbdbify-phone} and @code{eudc-bbdbify-address} are provided as -convenience functions to parse phones and addresses. -@end table -@end defvar - -The default value of the PH-specific value of that variable is -@code{eudc-ph-bbdb-conversion-alist}: - -@lisp -((name . name) - (net . email) - (address . (eudc-bbdbify-address address "Address")) - (phone . ((eudc-bbdbify-phone phone "Phone") - (eudc-bbdbify-phone office_phone "Office Phone")))) -@end lisp - -This means that: - -@itemize @bullet -@item -the @code{name} field of the BBDB record gets its value -from the @code{name} attribute of the directory record -@item -the @code{net} field of the BBDB record gets its value -from the @code{email} attribute of the directory record -@item -the @code{address} field of the BBDB record is obtained by parsing the -@code{address} attribute of the directory record with the function -@code{eudc-bbdbify-address} -@item -two @code{phone} fields are created (when possible) in the BBDB record. -The first one has @cite{Phone} for location and its value is obtained by -parsing the @code{phone} attribute of the PH/QI record with the function -@code{eudc-bbdbify-phone}. The second one has @cite{Office Phone} for location -its value is obtained by parsing the @code{office_phone} attribute of the -PH/QI record with the function @code{eudc-bbdbify-phone}. -@end itemize - -@defun eudc-bbdbify-phone phone location -This is a convenience function provided for use in -@code{eudc-bbdb-conversion-alist}. It parses @var{phone} into a vector -compatible with @code{bbdb-create-internal}. @var{phone} is either a string -supposedly containing a phone number or a list of such strings which are -concatenated. @var{location} is used as the phone location for BBDB. -@end defun - -@defun eudc-bbdbify-address addr location -This is a convenience function provided for use in -@code{eudc-bbdb-conversion-alist}. It parses @var{addr} into a vector -compatible with @code{bbdb-create-internal}. @var{addr} should be an -address string of no more than four lines or a list of lines. The last -line is searched for the zip code, city and state name. @var{location} -is used as the phone location for BBDB. -@end defun - -Note that only a subset of the attributes you selected with -@code{eudc-default-return-attributes} and that are actually displayed may -actually be inserted as part of the newly created BBDB record. - - -@node Server/Protocol Locals, , Creating BBDB Records, Usage -@comment node-name, next, previous, up -@section Server/Protocol Locals - -EUDC can be customized independently for each server or directory -protocol. All variables can be given local bindings that are activated -when a particular server and/or protocol becomes active. This is much -like buffer-local bindings but on a per server or per protocol basis. - -@menu -* Manipulating local bindings:: Functions to set and query local bindings -@end menu - -@node Manipulating local bindings, , Server/Protocol Locals, Server/Protocol Locals -@comment node-name, next, previous, up -@subsection Manipulating local bindings - -EUDC offers functions that let you set and query variables on a per -server or per protocol basis. - -The following predicates allow you to test the existence of -server/protocol local bindings for a particular variable. - -@defun eudc-server-local-variable-p var -Return non-@code{nil} if @var{var} has server-local bindings -@end defun - -@defun eudc-protocol-local-variable-p var -Return non-@code{nil} if @var{var} has protocol-local bindings -@end defun - -The following functions allow you to set the value of a variable with -various degrees of locality. - -@defun eudc-default-set var val -Set the EUDC default value of @var{var} to @var{val}. -The current binding of @var{var} (if local to the current server or -protocol) is not changed. -@end defun - -@defun eudc-protocol-set var val &optional protocol -Set the binding of @var{var} local to @var{protocol} to @var{val}. If -omitted, @var{protocol} defaults to the current value of -@code{eudc-protocol}. The current binding of @var{var} is changed only -if @var{protocol} is omitted. -@end defun - -@defun eudc-server-set var val &optional server -Set the binding of @var{var} local to @var{server} to @var{val}. If -omitted, @var{server} defaults to the current value of -@code{eudc-server}. The current binding of @var{var} is changed only if -@var{server} is omitted. -@end defun - -@defun eudc-set var val -Set the most local (server, protocol or default) binding of @var{var} to -@var{val}. The current binding of @var{var} is also set to @var{val}. -@end defun - -The following variables allow you to query the various bindings of a -variable (local or non-local). - -@defun eudc-variable-default-value var -Return the default binding of @var{var} (outside of a particular server -or protocol local binding). -Return @code{unbound} if @var{var} has no EUDC default value. -@end defun - -@defun eudc-variable-protocol-value var &optional protocol -Return the value of @var{var} local to @var{protocol}. Return -@code{unbound} if @var{var} has no value local to @var{protocol}. -@var{protocol} defaults to @code{eudc-protocol}. -@end defun - -@defun eudc-variable-server-value var [server] -Return the value of @var{var} local to @var{server}. -Return @code{unbound} if @var{var} has no value local to @var{server}. -@var{server} defaults to @code{eudc-server}. -@end defun - -Changing a protocol-local or server-local value of a variable has no -effect on its current value. The following command is used to -synchronize the current values of variables with their local values -given the current @code{eudc-server} and @code{eudc-protocol}: - -@defun eudc-update-local-variables -Update all EUDC variables according to their local settings. -@end defun - - - -@node Credits, GNU Free Documentation License, Usage, Top -@comment node-name, next, previous, up -@chapter Credits - -EUDC was written by Oscar Figueiredo based on @file{ph.el} by the -same author. - -Thanks to Soren Dayton for his suggestions, his enthusiasm and his help -in testing and proofreading the code and docs of @file{ph.el}. - -@node GNU Free Documentation License, Command and Function Index, Credits, Top -@appendix GNU Free Documentation License -@include doclicense.texi - -@node Command and Function Index, Variables Index, GNU Free Documentation License, Top -@comment node-name, next, previous, up -@unnumbered Command and Function Index - -@printindex fn - -@node Variables Index, , Command and Function Index, Top -@comment node-name, next, previous, up -@unnumbered Variables Index - -@printindex vr - -@setchapternewpage odd -@contents -@bye - -@ignore - arch-tag: 1b79460b-4ea1-441d-ab45-05ddd16ef241 -@end ignore diff --git a/man/flymake.texi b/man/flymake.texi deleted file mode 100644 index 16947d7f2de..00000000000 --- a/man/flymake.texi +++ /dev/null @@ -1,762 +0,0 @@ -\input texinfo @c -*-texinfo-*- -@comment %**start of header -@setfilename ../info/flymake -@set VERSION 0.3 -@set UPDATED April 2004 -@settitle GNU Flymake @value{VERSION} -@syncodeindex pg cp -@comment %**end of header - -@copying -This manual is for GNU Flymake (version @value{VERSION}, @value{UPDATED}), -which is a universal on-the-fly syntax checker for GNU Emacs. - -Copyright @copyright{} 2004, 2005, 2006, 2007 Free Software Foundation, Inc. - -@quotation -Permission is granted to copy, distribute and/or modify this document -under the terms of the GNU Free Documentation License, Version 1.2 or -any later version published by the Free Software Foundation; with no -Invariant Sections, with the Front-Cover texts being ``A GNU Manual,'' -and with the Back-Cover Texts as in (a) below. A copy of the license -is included in the section entitled ``GNU Free Documentation License'' -in the Emacs manual. - -(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify -this GNU Manual, like GNU software. Copies published by the Free -Software Foundation raise funds for GNU development.'' - -This document is part of a collection distributed under the GNU Free -Documentation License. If you want to distribute this document -separately from the collection, you can do so by adding a copy of the -license to the document, as described in section 6 of the license. -@end quotation -@end copying - -@dircategory Emacs -@direntry -* Flymake: (flymake). A universal on-the-fly syntax checker. -@end direntry - -@titlepage -@title GNU Flymake -@subtitle for version @value{VERSION}, @value{UPDATED} -@author Pavel Kobiakov(@email{pk_at_work@@yahoo.com}) -@page -@vskip 0pt plus 1filll -@insertcopying -@end titlepage - -@contents - -@ifnottex -@node Top -@top GNU Flymake -@end ifnottex - -@menu -* Overview of Flymake:: -* Installing Flymake:: -* Using Flymake:: -* Configuring Flymake:: -* Flymake Implementation:: -* GNU Free Documentation License:: -* Index:: -@end menu - -@node Overview of Flymake -@chapter Overview -@cindex Overview of Flymake - -Flymake is a universal on-the-fly syntax checker implemented as an -Emacs minor mode. Flymake runs the pre-configured syntax check tool -(compiler for C++ files, @code{perl} for perl files, etc.) in the -background, passing it a temporary copy of the current buffer, and -parses the output for known error/warning message patterns. Flymake -then highlights erroneous lines (i.e. lines for which at least one -error or warning has been reported by the syntax check tool), and -displays an overall buffer status in the mode line. Status information -displayed by Flymake contains total number of errors and warnings -reported for the buffer during the last syntax check. - -@code{flymake-goto-next-error} and @code{flymake-goto-prev-error} -functions allow for easy navigation to the next/previous erroneous -line, respectively. - -Calling @code{flymake-display-err-menu-for-current-line} will popup a -menu containing error messages reported by the syntax check tool for -the current line. Errors/warnings belonging to another file, such as a -@code{.h} header file included by a @code{.c} file, are shown in the -current buffer as belonging to the first line. Menu items for such -messages also contain a filename and a line number. Selecting such a -menu item will automatically open the file and jump to the line with -error. - -Syntax check is done 'on-the-fly'. It is started whenever - -@itemize @bullet -@item buffer is loaded -@item a newline character is added to the buffer -@item some changes were made to the buffer more than @code{0.5} seconds ago (the -delay is configurable). -@end itemize - -Flymake is a universal syntax checker in the sense that it's easily -extended to support new syntax check tools and error message -patterns. @xref{Configuring Flymake}. - -@node Installing Flymake -@chapter Installing -@cindex Installing Flymake - - -Flymake is packaged in a single file, @code{flymake.el}. - -To install/update Flymake, place @code{flymake.el} to a directory -somewhere on Emacs load path. You might also want to byte-compile -@code{flymake.el} to improve performance. - -Also, place the following line in the @code{.emacs} file. - -@lisp -(require 'flymake) -@end lisp - -You might also map the most frequently used Flymake functions, such as -@code{flymake-goto-next-error}, to some keyboard shortcuts: - -@lisp -(global-set-key [f3] 'flymake-display-err-menu-for-current-line) -(global-set-key [f4] 'flymake-goto-next-error) -@end lisp - -@node Using Flymake -@chapter Using Flymake -@cindex Using Flymake - -@menu -* Flymake mode:: -* Running the syntax check:: -* Navigating to error lines:: -* Viewing error messages:: -* Syntax check statuses:: -* Troubleshooting:: -@end menu - -@node Flymake mode -@section Flymake mode -@cindex flymake-mode - -Flymake is an Emacs minor mode. To use Flymake, you -must first activate @code{flymake-mode} by using the -@code{flymake-mode} function. - -Instead of manually activating @code{flymake-mode}, you can configure -Flymake to automatically enable @code{flymake-mode} upon opening any -file for which syntax check is possible. To do so, place the following -line in @code{.emacs}: - -@lisp -(add-hook 'find-file-hook 'flymake-find-file-hook) -@end lisp - -@node Running the syntax check -@section Running the syntax check -@cindex Manually starting the syntax check - -When @code{flymake-mode} is active, syntax check is started -automatically on any of the three conditions mentioned above. Syntax -check can also be started manually by using the -@code{flymake-start-syntax-check-for-current-buffer} function. This -can be used, for example, when changes were made to some other buffer -affecting the current buffer. - -@node Navigating to error lines -@section Navigating to error lines -@cindex Navigating to error lines - -After syntax check is completed, lines for which at least one error or -warning has been reported are highlighted, and total number of errors -and warning is shown in the mode line. Use the following functions to -navigate the highlighted lines. - -@multitable @columnfractions 0.25 0.75 - -@item @code{flymake-goto-next-error} -@tab Moves point to the next erroneous line, if any. - -@item @code{flymake-goto-prev-error} -@tab Moves point to the previous erroneous line. - -@end multitable - -These functions treat erroneous lines as a linked list. Therefore, -@code{flymake-goto-next-error} will go to the first erroneous line -when invoked in the end of the buffer. - -@node Viewing error messages -@section Viewing error messages -@cindex Viewing error messages - -To view error messages belonging to the current line, use the -@code{flymake-display-err-menu-for-current-line} function. If there's -at least one error or warning reported for the current line, this -function will display a popup menu with error/warning texts. -Selecting the menu item whose error belongs to another file brings -forward that file with the help of the -@code{flymake-goto-file-and-line} function. - -@node Syntax check statuses -@section Syntax check statuses -@cindex Syntax check statuses - -After syntax check is finished, its status is displayed in the mode line. -The following statuses are defined. - -@multitable @columnfractions 0.25 0.75 -@item Flymake* or Flymake:E/W* -@tab Flymake is currently running. For the second case, E/W contains the - error and warning count for the previous run. - -@item Flymake -@tab Syntax check is not running. Usually this means syntax check was - successfully passed (no errors, no warnings). Other possibilities are: - syntax check was killed as a result of executing - @code{flymake-compile}, or syntax check cannot start as compilation - is currently in progress. - -@item Flymake:E/W -@tab Number of errors/warnings found by the syntax check process. - -@item Flymake:! -@tab Flymake was unable to find master file for the current buffer. -@end multitable - -The following errors cause a warning message and switch flymake mode -OFF for the buffer. - -@multitable @columnfractions 0.25 0.75 -@item CFGERR -@tab Syntax check process returned nonzero exit code, but no - errors/warnings were reported. This indicates a possible configuration - error (for example, no suitable error message patterns for the - syntax check tool). - -@item NOMASTER -@tab Flymake was unable to find master file for the current buffer. - -@item NOMK -@tab Flymake was unable to find a suitable buildfile for the current buffer. - -@item PROCERR -@tab Flymake was unable to launch a syntax check process. -@end multitable - - -@node Troubleshooting -@section Troubleshooting -@cindex Logging -@cindex Troubleshooting - -Flymake uses a simple logging facility for indicating important points -in the control flow. The logging facility sends logging messages to -the @code{*Messages*} buffer. The information logged can be used for -resolving various problems related to Flymake. - -Logging output is controlled by the @code{flymake-log-level} -variable. @code{3} is the most verbose level, and @code{-1} switches -logging off. - -@node Configuring Flymake -@chapter Configuring and Extending Flymake -@cindex Configuring and Extending Flymake - -@menu -* Customizable variables:: -* Adding support for a new syntax check tool:: -@end menu - -Flymake was designed to be easily extended for supporting new syntax -check tools and error message patterns. - -@node Customizable variables -@section Customizable variables -@cindex Customizable variables - -This section summarizes variables used for Flymake -configuration. - -@table @code -@item flymake-log-level -Controls logging output, see @ref{Troubleshooting}. - -@item flymake-allowed-file-name-masks -A list of @code{(filename-regexp, init-function, cleanup-function -getfname-function)} for configuring syntax check tools. @xref{Adding -support for a new syntax check tool}. - -@item flymake-buildfile-dirs -A list of directories (relative paths) for searching a -buildfile. @xref{Locating the buildfile}. - -@item flymake-master-file-dirs -A list of directories for searching a master file. @xref{Locating a -master file}. - -@item flymake-get-project-include-dirs-function -A function used for obtaining a list of project include dirs (C/C++ -specific). @xref{Getting the include directories}. - -@item flymake-master-file-count-limit -@itemx flymake-check-file-limit -Used when looking for a master file. @xref{Locating a master file}. - -@item flymake-err-line-patterns -Patterns for error/warning messages in the form @code{(regexp file-idx -line-idx err-text-idx)}. @xref{Parsing the output}. - -@item flymake-compilation-prevents-syntax-check -A flag indicating whether compilation and syntax check of the same -file cannot be run simultaneously. - -@item flymake-no-changes-timeout -If any changes are made to the buffer, syntax check is automatically -started after @code{flymake-no-changes-timeout} seconds. - -@item flymake-gui-warnings-enabled -A boolean flag indicating whether Flymake will show message boxes for -non-recoverable errors. If @code{flymake-gui-warnings-enabled} is -@code{nil}, these errors will only be logged to the @code{*Messages*} -buffer. - -@item flymake-start-syntax-check-on-newline -A boolean flag indicating whether to start syntax check after a -newline character is added to the buffer. - -@item flymake-errline-face -A custom face for highlighting lines for which at least one error has -been reported. - -@item flymake-warnline-face -A custom face for highlighting lines for which at least one warning -and no errors have been reported. - -@end table - -@node Adding support for a new syntax check tool -@section Adding support for a new syntax check tool -@cindex Adding support for a new syntax check tool - -@menu -* Example -- Configuring a tool called directly:: -* Example -- Configuring a tool called via make:: -@end menu - -Syntax check tools are configured using the -@code{flymake-allowed-file-name-masks} list. Each item of this list -has the following format: - -@lisp -(filename-regexp, init-function, cleanup-function, getfname-function) -@end lisp - -@table @code -@item filename-regexp -This field is used as a key for locating init/cleanup/getfname -functions for the buffer. Items in -@code{flymake-allowed-file-name-masks} are searched sequentially. The -first item with @code{filename-regexp} matching buffer filename is -selected. If no match is found, @code{flymake-mode} is switched off. - -@item init-function -@code{init-function} is required to initialize the syntax check, -usually by creating a temporary copy of the buffer contents. The -function must return @code{(list cmd-name arg-list)}. If -@code{init-function} returns null, syntax check is aborted, by -@code{flymake-mode} is not switched off. - -@item cleanup-function -@code{cleanup-function} is called after the syntax check process is -complete and should take care of proper deinitialization, which is -usually deleting a temporary copy created by the @code{init-function}. - -@item getfname-function -This function is used for translating filenames reported by the syntax -check tool into ``real'' filenames. Filenames reported by the tool -will be different from the real ones, as actually the tool works with -the temporary copy. In most cases, the default implementation -provided by Flymake, @code{flymake-get-real-file-name}, can be used as -@code{getfname-function}. - -@end table - -To add support for a new syntax check tool, write corresponding -@code{init-function}, and, optionally @code{cleanup-function} and -@code{getfname-function}. If the format of error messages reported by -the new tool is not yet supported by Flymake, add a new entry to -the @code{flymake-err-line-patterns} list. - -The following sections contain some examples of configuring Flymake -support for various syntax check tools. - -@node Example -- Configuring a tool called directly -@subsection Example -- Configuring a tool called directly -@cindex Adding support for perl - -In this example, we will add support for @code{perl} as a syntax check -tool. @code{perl} supports the @code{-c} option which does syntax -checking. - -First, we write the @code{init-function}: - -@lisp -(defun flymake-perl-init (buffer) - (let* ((temp-file (flymake-init-create-temp-buffer-copy - buffer 'flymake-create-temp-inplace)) - (local-file (concat (flymake-build-relative-filename - (file-name-directory - (buffer-file-name - (current-buffer))) - (file-name-directory temp-file)) - (file-name-nondirectory temp-file)))) - (list "perl" (list "-wc " local-file)))) -@end lisp - -@code{flymake-perl-init} creates a temporary copy of the buffer -contents with the help of -@code{flymake-init-create-temp-buffer-copy}, and builds an appropriate -command line. - -Next, we add a new entry to the -@code{flymake-allowed-file-name-masks}: - -@lisp -(setq flymake-allowed-file-name-masks - (cons '(".+\\.pl$" - flymake-perl-init - flymake-simple-cleanup - flymake-get-real-file-name) - flymake-allowed-file-name-masks)) -@end lisp - -Note that we use standard @code{cleanup-function} and -@code{getfname-function}. - -Finally, we add an entry to @code{flymake-err-line-patterns}: - -@lisp -(setq flymake-err-line-patterns - (cons '("\\(.*\\) at \\([^ \n]+\\) line \\([0-9]+\\)[,.\n]" - 2 3 nil 1) - flymake-err-line-patterns)) -@end lisp - -@node Example -- Configuring a tool called via make -@subsection Example -- Configuring a tool called via make -@cindex Adding support for C (gcc+make) - -In this example we will add support for C files syntax checked by -@code{gcc} called via @code{make}. - -We're not required to write any new functions, as Flymake already has -functions for @code{make}. We just add a new entry to the -@code{flymake-allowed-file-name-masks}: - -@lisp -(setq flymake-allowed-file-name-masks - (cons '(".+\\.c$" - flymake-simple-make-init - flymake-simple-cleanup - flymake-get-real-file-name) - flymake-allowed-file-name-masks)) -@end lisp - -@code{flymake-simple-make-init} builds the following @code{make} -command line: - -@lisp -(list "make" - (list "-s" "-C" - base-dir - (concat "CHK_SOURCES=" source) - "SYNTAX_CHECK_MODE=1" - "check-syntax")) -@end lisp - -@code{base-dir} is a directory containing @code{Makefile}, see @ref{Locating the buildfile}. - -Thus, @code{Makefile} must contain the @code{check-syntax} target. In -our case this target might look like this: - -@verbatim -check-syntax: - gcc -o nul -S ${CHK_SOURCES} -@end verbatim - -The format of error messages reported by @code{gcc} is already -supported by Flymake, so we don't have to add a new entry to -@code{flymake-err-line-patterns}. - -@node Flymake Implementation -@chapter Flymake Implementation -@cindex Implementation details - -@menu -* Determining whether syntax check is possible:: -* Making a temporary copy:: -* Locating a master file:: -* Getting the include directories:: -* Locating the buildfile:: -* Starting the syntax check process:: -* Parsing the output:: -* Highlighting erroneous lines:: -* Interaction with other modes:: -@end menu - -Syntax check is started by calling @code{flymake-start-syntax-check-for-current-buffer}. -Flymake first determines whether it is able to do syntax -check. It then saves a copy of the buffer in a temporary file in the -buffer's directory (or in the system temp directory -- for java -files), creates a syntax check command and launches a process with -this command. The output is parsed using a list of error message patterns, -and error information (file name, line number, type and text) is -saved. After the process has finished, Flymake highlights erroneous -lines in the buffer using the accumulated error information. - -@node Determining whether syntax check is possible -@section Determining whether syntax check is possible -@cindex Syntax check models -@cindex Master file - -Syntax check is considered possible if there's an entry in -@code{flymake-allowed-file-name-masks} matching buffer's filename and -its @code{init-function} returns non-@code{nil} value. - -Two syntax check modes are distinguished: - -@enumerate - -@item -Buffer can be syntax checked in a standalone fashion, that is, the -file (its temporary copy, in fact) can be passed over to the compiler to -do the syntax check. Examples are C/C++ (.c, .cpp) and Java (.java) -sources. - -@item -Buffer can be syntax checked, but additional file, called master file, -is required to perform this operation. A master file is a file that -includes the current file, so that running a syntax check tool on it -will also check syntax in the current file. Examples are C/C++ (.h, -.hpp) headers. - -@end enumerate - -These modes are handled inside init/cleanup/getfname functions, see -@ref{Adding support for a new syntax check tool}. - -Flymake contains implementations of all functionality required to -support different syntax check modes described above (making -temporary copies, finding master files, etc.), as well as some -tool-specific (routines for @code{make}, @code{Ant}, etc.) code. - - -@node Making a temporary copy -@section Making a temporary copy -@cindex Temporary copy of the buffer -@cindex Master file - -After the possibility of the syntax check has been determined, a -temporary copy of the current buffer is made so that the most recent -unsaved changes could be seen by the syntax check tool. Making a copy -is quite straightforward in a standalone case (mode @code{1}), as it's -just saving buffer contents to a temporary file. - -Things get trickier, however, when master file is involved, as it -requires to - -@itemize @bullet -@item locate a master file -@item patch it to include the current file using its new (temporary) -name. -@end itemize - -Locating a master file is discussed in the following section. - -Patching just changes all appropriate lines of the master file so that they -use the new (temporary) name of the current file. For example, suppose current -file name is @code{file.h}, the master file is @code{file.cpp}, and -it includes current file via @code{#include "file.h"}. Current file's copy -is saved to file @code{file_flymake.h}, so the include line must be -changed to @code{#include "file_flymake.h"}. Finally, patched master file -is saved to @code{file_flymake_master.cpp}, and the last one is passed to -the syntax check tool. - -@node Locating a master file -@section Locating a master file -@cindex Master file - -Master file is located in two steps. - -First, a list of possible master files is built. A simple name -matching is used to find the files. For a C++ header @code{file.h}, -Flymake searches for all @code{.cpp} files in the directories whose relative paths are -stored in a customizable variable @code{flymake-master-file-dirs}, which -usually contains something like @code{("." "./src")}. No more than -@code{flymake-master-file-count-limit} entries is added to the master file -list. The list is then sorted to move files with names @code{file.cpp} to -the top. - -Next, each master file in a list is checked to contain the appropriate -include directives. No more than @code{flymake-check-file-limit} of each -file are parsed. - -For @code{file.h}, the include directives to look for are -@code{#include "file.h"}, @code{#include "../file.h"}, etc. Each -include is checked against a list of include directories -(see @ref{Getting the include directories}) to be sure it points to the -correct @code{file.h}. - -First matching master file found stops the search. The master file is then -patched and saved to disk. In case no master file is found, syntax check is -aborted, and corresponding status (!) is reported in the mode line. - -@node Getting the include directories -@section Getting the include directories -@cindex Include directories (C/C++ specific) - -Two sets of include directories are distinguished: system include directories -and project include directories. The former is just the contents of the -@code{INCLUDE} environment variable. The latter is not so easy to obtain, -and the way it can be obtained can vary greatly for different projects. -Therefore, a customizable variable -@code{flymake-get-project-include-dirs-function} is used to provide the -way to implement the desired behavior. - -The default implementation, @code{flymake-get-project-include-dirs-imp}, -uses a @code{make} call. This requires a correct base directory, that is, a -directory containing a correct @code{Makefile}, to be determined. - -As obtaining the project include directories might be a costly operation, its -return value is cached in the hash table. The cache is cleared in the beginning -of every syntax check attempt. - -@node Locating the buildfile -@section Locating the buildfile -@cindex Locating the buildfile -@cindex buildfile, locating -@cindex Makefile, locating - -Flymake can be configured to use different tools for performing syntax -checks. For example, it can use direct compiler call to syntax check a perl -script or a call to @code{make} for a more complicated case of a -@code{C/C++} source. The general idea is that simple files, like perl -scripts and html pages, can be checked by directly invoking a -corresponding tool. Files that are usually more complex and generally -used as part of larger projects, might require non-trivial options to -be passed to the syntax check tool, like include directories for -C++. The latter files are syntax checked using some build tool, like -@code{make} or @code{Ant}. - -All @code{make} configuration data is usually stored in a file called -@code{Makefile}. To allow for future extensions, flymake uses a notion of -buildfile to reference the 'project configuration' file. - -Special function, @code{flymake-find-buildfile} is provided for locating buildfiles. -Searching for a buildfile is done in a manner similar to that of searching -for possible master files. A customizable variable -@code{flymake-buildfile-dirs} holds a list of relative paths to the -buildfile. They are checked sequentially until a buildfile is found. In case -there's no build file, syntax check is aborted. - -Buildfile values are also cached. - -@node Starting the syntax check process -@section Starting the syntax check process -@cindex Syntax check process - -The command line (command name and the list of arguments) for launching a process is returned by the -initialization function. Flymake then just calls @code{start-process} -to start an asynchronous process and configures process filter and -sentinel which is used for processing the output of the syntax check -tool. - -@node Parsing the output -@section Parsing the output -@cindex Parsing the output - -The output generated by the syntax check tool is parsed in the process -filter/sentinel using the error message patterns stored in the -@code{flymake-err-line-patterns} variable. This variable contains a -list of items of the form @code{(regexp file-idx line-idx -err-text-idx)}, used to determine whether a particular line is an -error message and extract file name, line number and error text, -respectively. Error type (error/warning) is also guessed by matching -error text with the '@code{^[wW]arning}' pattern. Anything that was not -classified as a warning is considered an error. Type is then used to -sort error menu items, which shows error messages first. - -Flymake is also able to interpret error message patterns missing err-text-idx -information. This is done by merely taking the rest of the matched line -(@code{(substring line (match-end 0))}) as error text. This trick allows -to make use of a huge collection of error message line patterns from -@code{compile.el}. All these error patterns are appended to -the end of @code{flymake-err-line-patterns}. - -The error information obtained is saved in a buffer local -variable. The buffer for which the process output belongs is -determined from the process-id@w{}->@w{}buffer mapping updated -after every process launch/exit. - -@node Highlighting erroneous lines -@section Highlighting erroneous lines -@cindex Erroneous lines, faces - -Highlighting is implemented with overlays and happens in the process -sentinel, after calling the cleanup function. Two customizable faces -are used: @code{flymake-errline-face} and -@code{flymake-warnline-face}. Errors belonging outside the current -buffer are considered to belong to line 1 of the current buffer. - -@node Interaction with other modes -@section Interaction with other modes -@cindex Interaction with other modes -@cindex Interaction with compile mode - -The only mode flymake currently knows about is @code{compile}. - -Flymake can be configured to not start syntax check if it thinks the -compilation is in progress. The check is made by the -@code{flymake-compilation-is-running}, which tests the -@code{compilation-in-progress} variable. The reason why this might be -useful is saving CPU time in case both syntax check and compilation -are very CPU intensive. The original reason for adding this feature, -though, was working around a locking problem with MS Visual C++ compiler. - -Flymake also provides an alternative command for starting compilation, -@code{flymake-compile}: - -@lisp -(defun flymake-compile () - "Kill all flymake syntax checks then start compilation." - (interactive) - (flymake-stop-all-syntax-checks) - (call-interactively 'compile)) -@end lisp - -It just kills all the active syntax check processes before calling -@code{compile}. - -@node GNU Free Documentation License -@appendix GNU Free Documentation License -@include doclicense.texi - -@node Index -@unnumbered Index - -@printindex cp - -@bye - -@ignore - arch-tag: 9f0db077-5598-49ab-90b9-8df9248a63ec -@end ignore diff --git a/man/forms.texi b/man/forms.texi deleted file mode 100644 index 4114453df6c..00000000000 --- a/man/forms.texi +++ /dev/null @@ -1,985 +0,0 @@ -\input texinfo @c -*-texinfo-*- -@c documentation for forms-mode -@c Written by Johan Vromans, and edited by Richard Stallman - -@comment %**start of header (This is for running Texinfo on a region.) -@setfilename ../info/forms -@settitle Forms Mode User's Manual -@syncodeindex vr cp -@syncodeindex fn cp -@syncodeindex ky cp -@iftex -@finalout -@setchapternewpage odd -@end iftex -@c @smallbook -@comment %**end of header (This is for running Texinfo on a region.) - -@copying -This file documents Forms mode, a form-editing major mode for GNU Emacs. - -Copyright @copyright{} 1989, 1997, 2001, 2002, 2003, 2004, -2005, 2006, 2007 Free Software Foundation, Inc. - -@quotation -Permission is granted to copy, distribute and/or modify this document -under the terms of the GNU Free Documentation License, Version 1.2 or -any later version published by the Free Software Foundation; with no -Invariant Sections, with the Front-Cover texts being ``A GNU -Manual,'' and with the Back-Cover Texts as in (a) below. A copy of the -license is included in the section entitled ``GNU Free Documentation -License'' in the Emacs manual. - -(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify -this GNU Manual, like GNU software. Copies published by the Free -Software Foundation raise funds for GNU development.'' - -This document is part of a collection distributed under the GNU Free -Documentation License. If you want to distribute this document -separately from the collection, you can do so by adding a copy of the -license to the document, as described in section 6 of the license. -@end quotation -@end copying - -@dircategory Emacs -@direntry -* Forms: (forms). Emacs package for editing data bases - by filling in forms. -@end direntry - -@titlepage -@sp 6 -@center @titlefont{Forms Mode User's Manual} -@sp 4 -@center Forms-Mode version 2 -@sp 1 -@center for GNU Emacs 22.1 -@sp 1 -@center April 2007 -@sp 5 -@center Johan Vromans -@center @i{jvromans@@squirrel.nl} -@page -@vskip 0pt plus 1filll -@insertcopying -@end titlepage - -@ifnottex -@node Top -@top Forms Mode - -Forms mode is an Emacs major mode for working with simple textual data -bases in a forms-oriented manner. In Forms mode, the information in -these files is presented in an Emacs window in a user-defined format, -one record at a time. The user can view records or modify their -contents. - -Forms mode is not a simple major mode, but requires two files to do its -job: a control file and a data file. The data file holds the -actual data to be presented. The control file describes -how to present it. - -@menu -* Forms Example:: An example: editing the password data base. -* Entering and Exiting Forms Mode:: - How to visit a file in Forms mode. -* Forms Commands:: Special commands to use while in Forms mode. -* Data File Format:: How to format the data file. -* Control File Format:: How to control forms mode. -* Format Description:: How to define the forms layout. -* Modifying Forms Contents:: How to modify. -* Miscellaneous:: Forms mode messages and other remarks. -* Error Messages:: List of error messages forms mode can produce. -* Long Example:: A more complex control file example. -* GNU Free Documentation License:: The license for this documentation. -* Credits:: Thanks everyone. -* Index:: Index to this manual. -@end menu -@end ifnottex - -@node Forms Example -@chapter Forms Example - -Let's illustrate Forms mode with an example. Suppose you are looking at -the @file{/etc/passwd} file, and the screen looks like this: - -@example -====== /etc/passwd ====== - -User : root Uid: 0 Gid: 1 - -Name : Super User - -Home : / - -Shell: /bin/sh -@end example - -As you can see, the familiar fields from the entry for the super user -are all there, but instead of being colon-separated on one single line, -they make up a forms. - -The contents of the forms consist of the contents of the fields of the -record (e.g. @samp{root}, @samp{0}, @samp{1}, @samp{Super User}) -interspersed with normal text (e.g @samp{User : }, @samp{Uid: }). - -If you modify the contents of the fields, Forms mode will analyze your -changes and update the file appropriately. You cannot modify the -interspersed explanatory text (unless you go to some trouble about it), -because that is marked read-only (@pxref{Text Properties,,, elisp, The -Emacs Lisp Reference Manual}). - -The Forms mode control file specifies the relationship between the -format of @file{/etc/passwd} and what appears on the screen in Forms -mode. @xref{Control File Format}. - -@node Entering and Exiting Forms Mode -@chapter Entering and Exiting Forms Mode - -@table @kbd -@findex forms-find-file -@item M-x forms-find-file @key{RET} @var{control-file} @key{RET} -Visit a database using Forms mode. Specify the name of the -@strong{control file}, not the data file! - -@findex forms-find-file-other-window -@item M-x forms-find-file-other-window @key{RET} @var{control-file} @key{RET} -Similar, but displays the file in another window. -@end table - -The command @code{forms-find-file} evaluates the file -@var{control-file}, and also visits it in Forms mode. What you see in -its buffer is not the contents of this file, but rather a single record -of the corresponding data file that is visited in its own buffer. So -there are two buffers involved in Forms mode: the @dfn{forms buffer} -that is initially used to visit the control file and that shows the -records being browsed, and the @dfn{data buffer} that holds the data -file being visited. The latter buffer is normally not visible. - -Initially, the first record is displayed in the forms buffer. -The mode line displays the major mode name @samp{Forms}, followed by the -minor mode @samp{View} if the data base is read-only. The number of the -current record (@var{n}) and the total number of records in the -file(@var{t}) are shown in the mode line as @samp{@var{n}/@var{t}}. For -example: - -@example ---%%-Emacs: passwd-demo (Forms View 1/54)----All------- -@end example - -If the buffer is not read-only, you may change the buffer to modify the -fields in the record. When you move to a different record, the contents -of the buffer are parsed using the specifications in -@code{forms-format-list}, and the data file is updated. If the record -has fields that aren't included in the display, they are not changed. - -@vindex forms-mode-hooks -Entering Forms mode runs the normal hook @code{forms-mode-hooks} to -perform user-defined customization. - -To save any modified data, you can use @kbd{C-x C-s} -(@code{forms-save-buffer}). This does not save the forms buffer (which would -be rather useless), but instead saves the buffer visiting the data file. - -To terminate Forms mode, you can use @kbd{C-x C-s} (@code{forms-save-buffer}) -and then kill the forms buffer. However, the data buffer will still -remain. If this is not desired, you have to kill this buffer too. - -@node Forms Commands -@chapter Forms Commands - -The commands of Forms mode belong to the @kbd{C-c} prefix, with one -exception: @key{TAB}, which moves to the next field. Forms mode uses -different key maps for normal mode and read-only mode. In read-only -Forms mode, you can access most of the commands without the @kbd{C-c} -prefix, but you must type ordinary letters instead of control -characters; for example, type @kbd{n} instead of @kbd{C-c C-n}. - -If your Emacs has been built with X-toolkit support, Forms mode will -provide its own menu with a number of Forms mode commands. - -@table @kbd -@findex forms-next-record -@kindex C-c C-n -@item C-c C-n -Show the next record (@code{forms-next-record}). With a numeric -argument @var{n}, show the @var{n}th next record. - -@findex forms-prev-record -@kindex C-c C-p -@item C-c C-p -Show the previous record (@code{forms-prev-record}). With a numeric -argument @var{n}, show the @var{n}th previous record. - -@findex forms-jump-record -@kindex C-c C-l -@item C-c C-l -Jump to a record by number (@code{forms-jump-record}). Specify -the record number with a numeric argument. - -@findex forms-first-record -@kindex C-c < -@item C-c < -Jump to the first record (@code{forms-first-record}). - -@findex forms-last-record -@kindex C-c > -@item C-c > -Jump to the last record (@code{forms-last-record}). This command also -recalculates the number of records in the data file. - -@findex forms-next-field -@kindex TAB -@item @key{TAB} -@kindex C-c TAB -@itemx C-c @key{TAB} -Jump to the next field in the current record (@code{forms-next-field}). -With a numeric argument @var{n}, jump forward @var{n} fields. If this command -would move past the last field, it wraps around to the first field. - -@findex forms-toggle-read-only -@kindex C-c C-q -@item C-c C-q -Toggles read-only mode (@code{forms-toggle-read-only}). In read-only -Forms mode, you cannot edit the fields; most Forms mode commands can be -accessed without the prefix @kbd{C-c} if you use the normal letter -instead (for example, type @kbd{n} instead of @kbd{C-c C-n}). In edit -mode, you can edit the fields and thus change the contents of the data -base; you must begin Forms mode commands with @code{C-c}. Switching -to edit mode is allowed only if you have write access to the data file. - -@findex forms-insert-record -@kindex C-c C-o -@item C-c C-o -Create a new record and insert it before the current record -(@code{forms-insert-record}). It starts out with empty (or default) -contents for its fields; you can then edit the fields. With a numeric -argument, the new record is created @emph{after} the current one. -See also @code{forms-modified-record-filter} in @ref{Modifying Forms -Contents}. - -@findex forms-delete-record -@kindex C-c C-k -@item C-c C-k -Delete the current record (@code{forms-delete-record}). You are -prompted for confirmation before the record is deleted unless a numeric -argument has been provided. - -@findex forms-search-forward -@kindex C-c C-s @var{regexp} @key{RET} -@item C-c C-s @var{regexp} @key{RET} -Search forward for @var{regexp} in all records following this one -(@code{forms-search-forward}). If found, this record is shown. -If you give an empty argument, the previous regexp is used again. - -@findex forms-search-backward -@kindex C-c C-r @var{regexp} @key{RET} -@item C-c C-r @var{regexp} @key{RET} -Search backward for @var{regexp} in all records following this one -(@code{forms-search-backward}). If found, this record is shown. -If you give an empty argument, the previous regexp is used again. - -@ignore -@findex forms-exit -@kindex C-c C-x -@item C-c C-x -Terminate Forms mode processing (@code{forms-exit}). The data file is -saved if it has been modified. - -@findex forms-exit-no-save -@item M-x forms-exit-no-save -Terminates forms mode processing without saving modified data first. -@end ignore - -@findex forms-prev-field -@item M-x forms-prev-field -Similar to @code{forms-next-field} but moves backwards. - -@findex forms-save-buffer -@item M-x forms-save-buffer -@kindex C-x C-s -@itemx C-x C-s -Forms mode replacement for @code{save-buffer}. When executed in the -forms buffer it will save the contents of the (modified) data buffer -instead. In Forms mode this function will be bound to @kbd{C-x C-s}. - -@findex forms-print -@item M-x forms-print -This command can be used to make a formatted print -of the contents of the data file. - -@end table - -In addition the command @kbd{M-x revert-buffer} is useful in Forms mode -just as in other modes. - -@ignore -@vindex forms-forms-scroll -@findex scroll-up -@findex scroll-down -If the variable @code{forms-forms-scrolls} is set to a value other -than @code{nil} (which it is, by default), the Emacs functions -@code{scroll-up} and @code{scroll-down} will perform a -@code{forms-next-record} and @code{forms-prev-record} when in forms -mode. So you can use your favorite page commands to page through the -data file. - -@vindex forms-forms-jump -@findex beginning-of-buffer -@findex end-of-buffer -Likewise, if the variable @code{forms-forms-jump} is not @code{nil} -(which it is, by default), Emacs functions @code{beginning-of-buffer} -and @code{end-of-buffer} will perform @code{forms-first-record} and -@code{forms-last-record} when in forms mode. -@end ignore - -The following function key definitions are set up in Forms mode -(whether read-only or not): - -@table @kbd -@kindex next -@item next -forms-next-record - -@kindex prior -@item prior -forms-prev-record - -@kindex begin -@item begin -forms-first-record - -@kindex end -@item end -forms-last-record - -@kindex S-Tab -@findex forms-prev-field -@item S-Tab -forms-prev-field -@end table - -@node Data File Format -@chapter Data File Format - -@cindex record -@cindex field -@vindex forms-field-sep -Files for use with Forms mode are very simple---each @dfn{record} -(usually one line) forms the contents of one form. Each record consists -of a number of @dfn{fields}, which are separated by the value of the -string @code{forms-field-sep}, which is @code{"\t"} (a Tab) by default. - -@vindex forms-read-file-filter -@vindex forms-write-file-filter -If the format of the data file is not suitable enough you can define the -filter functions @code{forms-read-file-filter} and -@code{forms-write-file-filter}. @code{forms-read-file-filter} is called -when the data file is read from disk into the data buffer. It operates -on the data buffer, ignoring read-only protections. When the data file -is saved to disk @code{forms-write-file-filter} is called to cancel the -effects of @code{forms-read-file-filter}. After being saved, -@code{forms-read-file-filter} is called again to prepare the data buffer -for further processing. - -@cindex pseudo-newline -@vindex forms-multi-line -Fields may contain text which shows up in the forms in multiple lines. -These lines are separated in the field using a ``pseudo-newline'' -character which is defined by the value of the string -@code{forms-multi-line}. Its default value is @code{"\^k"} (a Control-K -character). If it is -set to @code{nil}, multiple line fields are prohibited. - -If the data file does not exist, it is automatically created. - -@node Control File Format -@chapter Control File Format - -@cindex control file -The Forms mode @dfn{control file} serves two purposes. First, it names -the data file to use, and defines its format and properties. Second, -the Emacs buffer it occupies is used by Forms mode to display the forms. - -The contents of the control file are evaluated as a Lisp program. It -should set the following Lisp variables to suitable values: - -@table @code -@vindex forms-file -@item forms-file -This variable specifies the name of the data file. Example: - -@example -(setq forms-file "my/data-file") -@end example - -If the control file doesn't set @code{forms-file}, Forms mode -reports an error. - -@vindex forms-format-list -@item forms-format-list -This variable describes the way the fields of the record are formatted on -the screen. For details, see @ref{Format Description}. - -@vindex forms-number-of-fields -@item forms-number-of-fields -This variable holds the number of fields in each record of the data -file. Example: - -@example -(setq forms-number-of-fields 10) -@end example -@end table - -If the control file does not set @code{forms-format-list} a default -format is used. In this situation, Forms mode will deduce the number of -fields from the data file providing this file exists and -@code{forms-number-of-records} has not been set in the control file. - -The control file can optionally set the following additional Forms mode -variables. Most of them have default values that are good for most -applications. - -@table @code -@vindex forms-field-sep -@item forms-field-sep -This variable may be used to designate the string which separates the -fields in the records of the data file. If not set, it defaults to the -string @code{"\t"} (a Tab character). Example: - -@example -(setq forms-field-sep "\t") -@end example - -@vindex forms-read-only -@item forms-read-only -If the value is non-@code{nil}, the data file is treated read-only. (Forms -mode also treats the data file as read-only if you don't have access to -write it.) Example: - -@example -(set forms-read-only t) -@end example - -@vindex forms-multi-line -@item forms-multi-line -This variable specifies the @dfn{pseudo newline} separator that allows -multi-line fields. This separator goes between the ``lines'' within a -field---thus, the field doesn't really contain multiple lines, but it -appears that way when displayed in Forms mode. If the value is -@code{nil}, multi-line text fields are prohibited. The pseudo newline -must not be a character contained in @code{forms-field-sep}. - -The default value is @code{"\^k"}, the character Control-K. Example: - -@example -(setq forms-multi-line "\^k") -@end example - -@ignore -@vindex forms-forms-scroll -@item forms-forms-scroll -@xref{Forms Mode Commands}, for details. - -@vindex forms-forms-jump -@item forms-forms-jump -@xref{Forms Mode Commands}, for details. -@end ignore - -@findex forms-read-file-filter -@item forms-read-file-filter -This variable holds the name of a function to be called after the data -file has been read in. This can be used to transform the contents of the -data file into a format more suitable for forms processing. -If it is @code{nil}, no function is called. For example, to maintain a -gzipped database: - -@example -(defun gzip-read-file-filter () - (shell-command-on-region (point-min) (point-max) - "gzip -d" t t)) -(setq forms-read-file-filter 'gzip-read-file-filter) -@end example - -@findex forms-write-file-filter -@item forms-write-file-filter -This variable holds the name of a function to be called before writing -out the contents of the data file. -This can be used to undo the effects of @code{forms-read-file-filter}. -If it is @code{nil}, no function is called. Example: - -@example -(defun gzip-write-file-filter () - (make-variable-buffer-local 'require-final-newline) - (setq require-final-newline nil) - (shell-command-on-region (point-min) (point-max) - "gzip" t t)) -(setq forms-write-file-filter 'gzip-write-file-filter) -@end example - -@findex forms-new-record-filter -@item forms-new-record-filter -This variable holds a function to be called whenever a new record is created -to supply default values for fields. If it is @code{nil}, no function is -called. -@xref{Modifying Forms Contents}, for details. - -@findex forms-modified-record-filter -@item forms-modified-record-filter -This variable holds a function to be called whenever a record is -modified, just before updating the Forms data file. If it is -@code{nil}, no function is called. -@xref{Modifying Forms Contents}, for details. - -@findex forms-insert-after -@item forms-insert-after -If this variable is not @code{nil}, new records are created @emph{after} the -current record. Also, upon visiting a file, the initial position will be -at the last record instead of the first one. - -@findex forms-check-number-of-fields -@item forms-check-number-of-fields -Normally each record is checked to contain the correct number of fields. -Under certain circumstances, this can be undesirable. -If this variable is set to @code{nil}, these checks will be bypassed. -@end table - -@node Format Description -@chapter The Format Description - -@vindex forms-format-list - The variable @code{forms-format-list} specifies the format of the data -in the data file, and how to convert the data for display in Forms mode. -Its value must be a list of Forms mode @dfn{formatting elements}, each -of which can be a string, a number, a Lisp list, or a Lisp symbol that -evaluates to one of those. The formatting elements are processed in the -order they appear in the list. - -@table @var -@item string -A string formatting element is inserted in the forms ``as is,'' as text -that the user cannot alter. - -@item number -A number element selects a field of the record. The contents of this -field are inserted in the display at this point. Field numbers count -starting from 1 (one). - -@item list -A formatting element that is a list specifies a function call. This -function is called every time a record is displayed, and its result, -which must be a string, is inserted in the display text. The function -should do nothing but returning a string. - -@vindex forms-fields -The function you call can access the fields of the record as a list in -the variable -@code{forms-fields}. - -@item symbol -A symbol used as a formatting element should evaluate to a string, number, -or list; the value is interpreted as a formatting element, as described -above. -@end table - -If a record does not contain the number of fields as specified in -@code{forms-number-of-fields}, a warning message will be printed. Excess -fields are ignored, missing fields are set to empty. - -The control file which displays @file{/etc/passwd} file as demonstrated -in the beginning of this manual might look as follows: - -@example -;; @r{This demo visits @file{/etc/passwd}.} - -(setq forms-file "/etc/passwd") -(setq forms-number-of-fields 7) -(setq forms-read-only t) ; @r{to make sure} -(setq forms-field-sep ":") -;; @r{Don't allow multi-line fields.} -(setq forms-multi-line nil) - -(setq forms-format-list - (list - "====== /etc/passwd ======\n\n" - "User : " 1 - " Uid: " 3 - " Gid: " 4 - "\n\n" - "Name : " 5 - "\n\n" - "Home : " 6 - "\n\n" - "Shell: " 7 - "\n")) -@end example - -When you construct the value of @code{forms-format-list}, you should -usually either quote the whole value, like this, - -@example -(setq forms-format-list - '( - "====== " forms-file " ======\n\n" - "User : " 1 - (make-string 20 ?-) - @dots{} - )) -@end example - -@noindent -or quote the elements which are lists, like this: - -@example -(setq forms-format-list - (list - "====== " forms-file " ======\n\n" - "User : " 1 - '(make-string 20 ?-) - @dots{} - )) -@end example - -Forms mode validates the contents of @code{forms-format-list} when you -visit a database. If there are errors, processing is aborted with an -error message which includes a descriptive text. @xref{Error Messages}, -for a detailed list of error messages. - -If no @code{forms-format-list} is specified, Forms mode will supply a -default format list. This list contains the name of the file being -visited, and a simple label for each field indicating the field number. - -@node Modifying Forms Contents -@chapter Modifying The Forms Contents - -If @code{forms-read-only} is @code{nil}, the user can modify the fields -and records of the database. - -All normal editing commands are available for editing the contents of the -displayed record. You cannot delete or modify the fixed, explanatory -text that comes from string formatting elements, but you can modify the -actual field contents. - -@ignore -@c This is for the Emacs 18 version only. -If the contents of the forms cannot be recognized properly, this is -signaled using a descriptive text. @xref{Error Messages}, for more info. -The cursor will indicate the last part of the forms which was -successfully parsed. It's important to avoid entering field contents -that would cause confusion with the field-separating fixed text. -@end ignore - -If the variable @code{forms-modified-record-filter} is non-@code{nil}, -it is called as a function before the new data is written to the data -file. The function receives one argument, a vector that contains the -contents of the fields of the record. - -The function can refer to fields with @code{aref} and modify them with -@code{aset}. The first field has number 1 (one); thus, element 0 of the -vector is not used. The function should return the same vector it was -passed; the (possibly modified) contents of the vector determine what is -actually written in the file. Here is an example: - -@example -(defun my-modified-record-filter (record) - ;; @r{Modify second field.} - (aset record 2 (current-time-string)) - ;; @r{Return the field vector.} - record) - -(setq forms-modified-record-filter 'my-modified-record-filter) -@end example - -If the variable @code{forms-new-record-filter} is non-@code{nil}, its -value is a function to be called to fill in default values for the -fields of a new record. The function is passed a vector of empty -strings, one for each field; it should return the same vector, with -the desired field values stored in it. Fields are numbered starting -from 1 (one). Example: - -@example -(defun my-new-record-filter (fields) - (aset fields 5 (login-name)) - (aset fields 1 (current-time-string)) - fields) - -(setq forms-new-record-filter 'my-new-record-filter) -@end example - -@node Miscellaneous -@chapter Miscellaneous - -@vindex forms-version -The global variable @code{forms-version} holds the version information -of the Forms mode software. - -@findex forms-enumerate -It is very convenient to use symbolic names for the fields in a record. -The function @code{forms-enumerate} provides an elegant means to define -a series of variables whose values are consecutive integers. The -function returns the highest number used, so it can be used to set -@code{forms-number-of-fields} also. For example: - -@example -(setq forms-number-of-fields - (forms-enumerate - '(field1 field2 field3 @dots{}))) -@end example - -This sets @code{field1} to 1, @code{field2} to 2, and so on. - -Care has been taken to keep the Forms mode variables buffer-local, so it -is possible to visit multiple files in Forms mode simultaneously, even -if they have different properties. - -@findex forms-mode -If you have visited the control file in normal fashion with -@code{find-file} or a like command, you can switch to Forms mode with -the command @code{M-x forms-mode}. If you put @samp{-*- forms -*-} in -the first line of the control file, then visiting it enables Forms mode -automatically. But this makes it hard to edit the control file itself, -so you'd better think twice before using this. - -The default format for the data file, using @code{"\t"} to separate -fields and @code{"\^k"} to separate lines within a field, matches the -file format of some popular database programs, e.g. FileMaker. So -@code{forms-mode} can decrease the need to use proprietary software. - -@node Error Messages -@chapter Error Messages - -This section describes all error messages which can be generated by -forms mode. Error messages that result from parsing the control file -all start with the text @samp{Forms control file error}. Messages -generated while analyzing the definition of @code{forms-format-list} -start with @samp{Forms format error}. - -@table @code -@item Forms control file error: `forms-file' has not been set -The variable @code{forms-file} was not set by the control file. - -@item Forms control file error: `forms-number-of-fields' has not been set -The variable @code{forms-number-of-fields} was not set by the control -file. - -@item Forms control file error: `forms-number-of-fields' must be a number > 0 -The variable @code{forms-number-of-fields} did not contain a positive -number. - -@item Forms control file error: `forms-field-sep' is not a string -@itemx Forms control file error: `forms-multi-line' must be nil or a one-character string -The variable @code{forms-multi-line} was set to something other than -@code{nil} or a single-character string. - -@item Forms control file error: `forms-multi-line' is equal to 'forms-field-sep' -The variable @code{forms-multi-line} may not be equal to -@code{forms-field-sep} for this would make it impossible to distinguish -fields and the lines in the fields. - -@item Forms control file error: `forms-new-record-filter' is not a function -@itemx Forms control file error: `forms-modified-record-filter' is not a function -The variable has been set to something else than a function. - -@item Forms control file error: `forms-format-list' is not a list -The variable @code{forms-format-list} was not set to a Lisp list -by the control file. - -@item Forms format error: field number @var{xx} out of range 1..@var{nn} -A field number was supplied in @code{forms-format-list} with a value of -@var{xx}, which was not greater than zero and smaller than or equal to -the number of fields in the forms, @var{nn}. - -@item Forms format error: @var{fun} is not a function -The first element of a list which is an element of -@code{forms-format-list} was not a valid Lisp function. - -@item Forms format error: invalid element @var{xx} -A list element was supplied in @code{forms-format-list} which was not a -string, number or list. - -@ignore -@c This applies to Emacs 18 only. -@c Error messages generated while a modified form is being analyzed. - -@item Parse error: not looking at `...' -When re-parsing the contents of a forms, the text shown could not -be found. - -@item Parse error: cannot find `...' -When re-parsing the contents of a forms, the text shown, which -separates two fields, could not be found. - -@item Parse error: cannot parse adjacent fields @var{xx} and @var{yy} -Fields @var{xx} and @var{yy} were not separated by text, so could not be -parsed again. -@end ignore - -@item Warning: this record has @var{xx} fields instead of @var{yy} -The number of fields in this record in the data file did not match -@code{forms-number-of-fields}. Missing fields will be made empty. - -@item Multi-line fields in this record - update refused! -The current record contains newline characters, hence can not be written -back to the data file, for it would corrupt it. Probably you inserted a -newline in a field, while @code{forms-multi-line} was @code{nil}. - -@item Field separator occurs in record - update refused! -The current record contains the field separator string inside one of the -fields. It can not be written back to the data file, for it would -corrupt it. Probably you inserted the field separator string in a field. - -@item Record number @var{xx} out of range 1..@var{yy} -A jump was made to non-existing record @var{xx}. @var{yy} denotes the -number of records in the file. - -@item Stuck at record @var{xx} -An internal error prevented a specific record from being retrieved. - -@item No write access to @code{"}@var{file}@code{"} -An attempt was made to enable edit mode on a file that has been write -protected. - -@item Search failed: @var{regexp} -The @var{regexp} could not be found in the data file. Forward searching -is done from the current location until the end of the file, then -retrying from the beginning of the file until the current location. -Backward searching is done from the current location until the beginning -of the file, then retrying from the end of the file until the current -location. - -@item Wrapped -A search completed successfully after wrapping around. - -@item Warning: number of records changed to @var{nn} -Forms mode's idea of the number of records has been adjusted to the -number of records actually present in the data file. - -@item Problem saving buffers? -An error occurred while saving the data file buffer. Most likely, Emacs -did ask to confirm deleting the buffer because it had been modified, and -you said `no'. -@end table - -@node Long Example -@chapter Long Example - -The following example exploits most of the features of Forms mode. -This example is included in the distribution as file @file{forms-d2.el}. - -@example -;; demo2 -- demo forms-mode -*- emacs-lisp -*- - -;; @r{This sample forms exploit most of the features of forms mode.} - -;; @r{Set the name of the data file.} -(setq forms-file "forms-d2.dat") - -;; @r{Use @code{forms-enumerate} to set field names and number thereof.} -(setq forms-number-of-fields - (forms-enumerate - '(arch-newsgroup ; 1 - arch-volume ; 2 - arch-issue ; and ... - arch-article ; ... so - arch-shortname ; ... ... on - arch-parts - arch-from - arch-longname - arch-keywords - arch-date - arch-remarks))) - -;; @r{The following functions are used by this form for layout purposes.} -;; -(defun arch-tocol (target &optional fill) - "Produces a string to skip to column TARGET. -Prepends newline if needed. -The optional FILL should be a character, used to fill to the column." - (if (null fill) - (setq fill ? )) - (if (< target (current-column)) - (concat "\n" (make-string target fill)) - (make-string (- target (current-column)) fill))) -;; -(defun arch-rj (target field &optional fill) - "Produces a string to skip to column TARGET\ - minus the width of field FIELD. -Prepends newline if needed. -The optional FILL should be a character, -used to fill to the column." - (arch-tocol (- target (length (nth field forms-fields))) fill)) - -;; @r{Record filters.} -;; -(defun new-record-filter (the-record) - "Form a new record with some defaults." - (aset the-record arch-from (user-full-name)) - (aset the-record arch-date (current-time-string)) - the-record) ; return it -(setq forms-new-record-filter 'new-record-filter) - -;; @r{The format list.} -(setq forms-format-list - (list - "====== Public Domain Software Archive ======\n\n" - arch-shortname - " - " arch-longname - "\n\n" - "Article: " arch-newsgroup - "/" arch-article - " " - '(arch-tocol 40) - "Issue: " arch-issue - " " - '(arch-rj 73 10) - "Date: " arch-date - "\n\n" - "Submitted by: " arch-from - "\n" - '(arch-tocol 79 ?-) - "\n" - "Keywords: " arch-keywords - "\n\n" - "Parts: " arch-parts - "\n\n====== Remarks ======\n\n" - arch-remarks - )) - -;; @r{That's all, folks!} -@end example - -@node Credits -@chapter Credits - -Bug fixes and other useful suggestions were supplied by -Harald Hanche-Olsen (@code{hanche@@imf.unit.no}), -@code{cwitty@@portia.stanford.edu}, -Jonathan I. Kamens, -Per Cederqvist (@code{ceder@@signum.se}), -Michael Lipka (@code{lipka@@lip.hanse.de}), -Andy Piper (@code{ajp@@eng.cam.ac.uk}), -Frederic Pierresteguy (@code{F.Pierresteguy@@frcl.bull.fr}), -Ignatios Souvatzis -and Richard Stallman (@code{rms@@gnu.org}). - -This documentation was slightly inspired by the documentation of ``rolo -mode'' by Paul Davis at Schlumberger Cambridge Research -(@code{davis%scrsu1%sdr.slb.com@@relay.cs.net}). - -None of this would have been possible without GNU Emacs of the Free -Software Foundation. Thanks, Richard! - -@node GNU Free Documentation License -@appendix GNU Free Documentation License -@include doclicense.texi - -@node Index -@unnumbered Index -@printindex cp - -@contents -@bye - -@ignore - arch-tag: 2ac9810b-aa49-4ea6-8030-d7f1ecd467ed -@end ignore diff --git a/man/fortran-xtra.texi b/man/fortran-xtra.texi deleted file mode 100644 index 9249f5f006c..00000000000 --- a/man/fortran-xtra.texi +++ /dev/null @@ -1,548 +0,0 @@ -@c This is part of the Emacs manual. -@c Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. -@c See file emacs.texi for copying conditions. -@c -@c This file is included either in emacs-xtra.texi (when producing the -@c printed version) or in the main Emacs manual (for the on-line version). -@node Fortran -@section Fortran Mode -@cindex Fortran mode -@cindex mode, Fortran - - Fortran mode provides special motion commands for Fortran statements -and subprograms, and indentation commands that understand Fortran -conventions of nesting, line numbers and continuation statements. -Fortran mode has support for Auto Fill mode that breaks long lines into -proper Fortran continuation lines. - - Special commands for comments are provided because Fortran comments -are unlike those of other languages. Built-in abbrevs optionally save -typing when you insert Fortran keywords. - - Use @kbd{M-x fortran-mode} to switch to this major mode. This -command runs the hook @code{fortran-mode-hook}. -@iftex -@xref{Hooks,,, emacs, the Emacs Manual}. -@end iftex -@ifnottex -@xref{Hooks}. -@end ifnottex - -@cindex Fortran77 and Fortran90 -@findex f90-mode -@findex fortran-mode - Fortran mode is meant for editing Fortran77 ``fixed format'' (and also -``tab format'') source code. For editing the modern Fortran90 or -Fortran95 ``free format'' source code, use F90 mode (@code{f90-mode}). -Emacs normally uses Fortran mode for files with extension @samp{.f}, -@samp{.F} or @samp{.for}, and F90 mode for the extension @samp{.f90} and -@samp{.f95}. GNU Fortran supports both kinds of format. - -@menu -* Motion: Fortran Motion. Moving point by statements or subprograms. -* Indent: Fortran Indent. Indentation commands for Fortran. -* Comments: Fortran Comments. Inserting and aligning comments. -* Autofill: Fortran Autofill. Auto fill support for Fortran. -* Columns: Fortran Columns. Measuring columns for valid Fortran. -* Abbrev: Fortran Abbrev. Built-in abbrevs for Fortran keywords. -@end menu - -@node Fortran Motion -@subsection Motion Commands - - In addition to the normal commands for moving by and operating on -``defuns'' (Fortran subprograms---functions and subroutines, as well as -modules for F90 mode), Fortran mode provides special commands to move by -statements and other program units. - -@table @kbd -@kindex C-c C-n @r{(Fortran mode)} -@findex fortran-next-statement -@findex f90-next-statement -@item C-c C-n -Move to the beginning of the next statement -(@code{fortran-next-statement}/@code{f90-next-statement}). - -@kindex C-c C-p @r{(Fortran mode)} -@findex fortran-previous-statement -@findex f90-previous-statement -@item C-c C-p -Move to the beginning of the previous statement -(@code{fortran-previous-statement}/@code{f90-previous-statement}). -If there is no previous statement (i.e. if called from the first -statement in the buffer), move to the start of the buffer. - -@kindex C-c C-e @r{(F90 mode)} -@findex f90-next-block -@item C-c C-e -Move point forward to the start of the next code block -(@code{f90-next-block}). A code block is a subroutine, -@code{if}--@code{endif} statement, and so forth. This command exists -for F90 mode only, not Fortran mode. With a numeric argument, this -moves forward that many blocks. - -@kindex C-c C-a @r{(F90 mode)} -@findex f90-previous-block -@item C-c C-a -Move point backward to the previous code block -(@code{f90-previous-block}). This is like @code{f90-next-block}, but -moves backwards. - -@kindex C-M-n @r{(Fortran mode)} -@findex fortran-end-of-block -@findex f90-end-of-block -@item C-M-n -Move to the end of the current code block -(@code{fortran-end-of-block}/@code{f90-end-of-block}). With a numeric -argument, move forward that number of blocks. The mark is set before -moving point. The F90 mode version of this command checks for -consistency of block types and labels (if present), but it does not -check the outermost block since that may be incomplete. - -@kindex C-M-p @r{(Fortran mode)} -@findex fortran-beginning-of-block -@findex f90-beginning-of-block -@item C-M-p -Move to the start of the current code block -(@code{fortran-beginning-of-block}/@code{f90-beginning-of-block}). This -is like @code{fortran-end-of-block}, but moves backwards. -@end table - -@node Fortran Indent -@subsection Fortran Indentation - - Special commands and features are needed for indenting Fortran code in -order to make sure various syntactic entities (line numbers, comment line -indicators and continuation line flags) appear in the columns that are -required for standard, fixed (or tab) format Fortran. - -@menu -* Commands: ForIndent Commands. Commands for indenting and filling Fortran. -* Contline: ForIndent Cont. How continuation lines indent. -* Numbers: ForIndent Num. How line numbers auto-indent. -* Conv: ForIndent Conv. Conventions you must obey to avoid trouble. -* Vars: ForIndent Vars. Variables controlling Fortran indent style. -@end menu - -@node ForIndent Commands -@subsubsection Fortran Indentation and Filling Commands - -@table @kbd -@item C-M-j -Break the current line at point and set up a continuation line -(@code{fortran-split-line}). -@item M-^ -Join this line to the previous line (@code{fortran-join-line}). -@item C-M-q -Indent all the lines of the subprogram point is in -(@code{fortran-indent-subprogram}). -@item M-q -Fill a comment block or statement. -@end table - -@kindex C-M-q @r{(Fortran mode)} -@findex fortran-indent-subprogram - The key @kbd{C-M-q} runs @code{fortran-indent-subprogram}, a command -to reindent all the lines of the Fortran subprogram (function or -subroutine) containing point. - -@kindex C-M-j @r{(Fortran mode)} -@findex fortran-split-line - The key @kbd{C-M-j} runs @code{fortran-split-line}, which splits -a line in the appropriate fashion for Fortran. In a non-comment line, -the second half becomes a continuation line and is indented -accordingly. In a comment line, both halves become separate comment -lines. - -@kindex M-^ @r{(Fortran mode)} -@kindex C-c C-d @r{(Fortran mode)} -@findex fortran-join-line - @kbd{M-^} or @kbd{C-c C-d} runs the command @code{fortran-join-line}, -which joins a continuation line back to the previous line, roughly as -the inverse of @code{fortran-split-line}. The point must be on a -continuation line when this command is invoked. - -@kindex M-q @r{(Fortran mode)} -@kbd{M-q} in Fortran mode fills the comment block or statement that -point is in. This removes any excess statement continuations. - -@node ForIndent Cont -@subsubsection Continuation Lines -@cindex Fortran continuation lines - -@vindex fortran-continuation-string - Most Fortran77 compilers allow two ways of writing continuation lines. -If the first non-space character on a line is in column 5, then that -line is a continuation of the previous line. We call this @dfn{fixed -format}. (In GNU Emacs we always count columns from 0; but note that -the Fortran standard counts from 1.) The variable -@code{fortran-continuation-string} specifies what character to put in -column 5. A line that starts with a tab character followed by any digit -except @samp{0} is also a continuation line. We call this style of -continuation @dfn{tab format}. (Fortran90 introduced ``free format,'' -with another style of continuation lines). - -@vindex indent-tabs-mode @r{(Fortran mode)} -@vindex fortran-analyze-depth -@vindex fortran-tab-mode-default - Fortran mode can use either style of continuation line. When you -enter Fortran mode, it tries to deduce the proper continuation style -automatically from the buffer contents. It does this by scanning up to -@code{fortran-analyze-depth} (default 100) lines from the start of the -buffer. The first line that begins with either a tab character or six -spaces determines the choice. If the scan fails (for example, if the -buffer is new and therefore empty), the value of -@code{fortran-tab-mode-default} (@code{nil} for fixed format, and -non-@code{nil} for tab format) is used. @samp{/t} in the mode line -indicates tab format is selected. Fortran mode sets the value of -@code{indent-tabs-mode} accordingly. - - If the text on a line starts with the Fortran continuation marker -@samp{$}, or if it begins with any non-whitespace character in column -5, Fortran mode treats it as a continuation line. When you indent a -continuation line with @key{TAB}, it converts the line to the current -continuation style. When you split a Fortran statement with -@kbd{C-M-j}, the continuation marker on the newline is created according -to the continuation style. - - The setting of continuation style affects several other aspects of -editing in Fortran mode. In fixed format mode, the minimum column -number for the body of a statement is 6. Lines inside of Fortran -blocks that are indented to larger column numbers always use only the -space character for whitespace. In tab format mode, the minimum -column number for the statement body is 8, and the whitespace before -column 8 must always consist of one tab character. - -@node ForIndent Num -@subsubsection Line Numbers - - If a number is the first non-whitespace in the line, Fortran -indentation assumes it is a line number and moves it to columns 0 -through 4. (Columns always count from 0 in GNU Emacs.) - -@vindex fortran-line-number-indent - Line numbers of four digits or less are normally indented one space. -The variable @code{fortran-line-number-indent} controls this; it -specifies the maximum indentation a line number can have. The default -value of the variable is 1. Fortran mode tries to prevent line number -digits passing column 4, reducing the indentation below the specified -maximum if necessary. If @code{fortran-line-number-indent} has the -value 5, line numbers are right-justified to end in column 4. - -@vindex fortran-electric-line-number - Simply inserting a line number is enough to indent it according to -these rules. As each digit is inserted, the indentation is recomputed. -To turn off this feature, set the variable -@code{fortran-electric-line-number} to @code{nil}. - - -@node ForIndent Conv -@subsubsection Syntactic Conventions - - Fortran mode assumes that you follow certain conventions that simplify -the task of understanding a Fortran program well enough to indent it -properly: - -@itemize @bullet -@item -Two nested @samp{do} loops never share a @samp{continue} statement. - -@item -Fortran keywords such as @samp{if}, @samp{else}, @samp{then}, @samp{do} -and others are written without embedded whitespace or line breaks. - -Fortran compilers generally ignore whitespace outside of string -constants, but Fortran mode does not recognize these keywords if they -are not contiguous. Constructs such as @samp{else if} or @samp{end do} -are acceptable, but the second word should be on the same line as the -first and not on a continuation line. -@end itemize - -@noindent -If you fail to follow these conventions, the indentation commands may -indent some lines unaesthetically. However, a correct Fortran program -retains its meaning when reindented even if the conventions are not -followed. - -@node ForIndent Vars -@subsubsection Variables for Fortran Indentation - -@vindex fortran-do-indent -@vindex fortran-if-indent -@vindex fortran-structure-indent -@vindex fortran-continuation-indent -@vindex fortran-check-all-num@dots{} -@vindex fortran-minimum-statement-indent@dots{} - Several additional variables control how Fortran indentation works: - -@table @code -@item fortran-do-indent -Extra indentation within each level of @samp{do} statement (default 3). - -@item fortran-if-indent -Extra indentation within each level of @samp{if}, @samp{select case}, or -@samp{where} statements (default 3). - -@item fortran-structure-indent -Extra indentation within each level of @samp{structure}, @samp{union}, -@samp{map}, or @samp{interface} statements (default 3). - -@item fortran-continuation-indent -Extra indentation for bodies of continuation lines (default 5). - -@item fortran-check-all-num-for-matching-do -In Fortran77, a numbered @samp{do} statement is ended by any statement -with a matching line number. It is common (but not compulsory) to use a -@samp{continue} statement for this purpose. If this variable has a -non-@code{nil} value, indenting any numbered statement must check for a -@samp{do} that ends there. If you always end @samp{do} statements with -a @samp{continue} line (or if you use the more modern @samp{enddo}), -then you can speed up indentation by setting this variable to -@code{nil}. The default is @code{nil}. - -@item fortran-blink-matching-if -If this is @code{t}, indenting an @samp{endif} (or @samp{enddo} -statement moves the cursor momentarily to the matching @samp{if} (or -@samp{do}) statement to show where it is. The default is @code{nil}. - -@item fortran-minimum-statement-indent-fixed -Minimum indentation for Fortran statements when using fixed format -continuation line style. Statement bodies are never indented less than -this much. The default is 6. - -@item fortran-minimum-statement-indent-tab -Minimum indentation for Fortran statements for tab format continuation line -style. Statement bodies are never indented less than this much. The -default is 8. -@end table - -The variables controlling the indentation of comments are described in -the following section. - -@node Fortran Comments -@subsection Fortran Comments - - The usual Emacs comment commands assume that a comment can follow a -line of code. In Fortran77, the standard comment syntax requires an -entire line to be just a comment. Therefore, Fortran mode replaces the -standard Emacs comment commands and defines some new variables. - -@vindex fortran-comment-line-start - Fortran mode can also handle the Fortran90 comment syntax where comments -start with @samp{!} and can follow other text. Because only some Fortran77 -compilers accept this syntax, Fortran mode will not insert such comments -unless you have said in advance to do so. To do this, set the variable -@code{fortran-comment-line-start} to @samp{"!"}. - -@table @kbd -@item M-; -Align comment or insert new comment (@code{fortran-indent-comment}). - -@item C-x ; -Applies to nonstandard @samp{!} comments only. - -@item C-c ; -Turn all lines of the region into comments, or (with argument) turn them back -into real code (@code{fortran-comment-region}). -@end table - -@findex fortran-indent-comment - @kbd{M-;} in Fortran mode is redefined as the command -@code{fortran-indent-comment}. Like the usual @kbd{M-;} command, this -recognizes any kind of existing comment and aligns its text appropriately; -if there is no existing comment, a comment is inserted and aligned. But -inserting and aligning comments are not the same in Fortran mode as in -other modes. - - When a new comment must be inserted, if the current line is blank, a -full-line comment is inserted. On a non-blank line, a nonstandard @samp{!} -comment is inserted if you have said you want to use them. Otherwise a -full-line comment is inserted on a new line before the current line. - - Nonstandard @samp{!} comments are aligned like comments in other -languages, but full-line comments are different. In a standard full-line -comment, the comment delimiter itself must always appear in column zero. -What can be aligned is the text within the comment. You can choose from -three styles of alignment by setting the variable -@code{fortran-comment-indent-style} to one of these values: - -@vindex fortran-comment-indent-style -@vindex fortran-comment-line-extra-indent -@table @code -@item fixed -Align the text at a fixed column, which is the sum of -@code{fortran-comment-line-extra-indent} and the minimum statement -indentation. This is the default. - -The minimum statement indentation is -@code{fortran-minimum-statement-indent-fixed} for fixed format -continuation line style and @code{fortran-minimum-statement-indent-tab} -for tab format style. - -@item relative -Align the text as if it were a line of code, but with an additional -@code{fortran-comment-line-extra-indent} columns of indentation. - -@item nil -Don't move text in full-line comments automatically. -@end table - -@vindex fortran-comment-indent-char - In addition, you can specify the character to be used to indent within -full-line comments by setting the variable -@code{fortran-comment-indent-char} to the single-character string you want -to use. - -@vindex fortran-directive-re - Compiler directive lines, or preprocessor lines, have much the same -appearance as comment lines. It is important, though, that such lines -never be indented at all, no matter what the value of -@code{fortran-comment-indent-style}. The variable -@code{fortran-directive-re} is a regular expression that specifies which -lines are directives. Matching lines are never indented, and receive -distinctive font-locking. - - The normal Emacs comment command @kbd{C-x ;} has not been redefined. If -you use @samp{!} comments, this command can be used with them. Otherwise -it is useless in Fortran mode. - -@kindex C-c ; @r{(Fortran mode)} -@findex fortran-comment-region -@vindex fortran-comment-region - The command @kbd{C-c ;} (@code{fortran-comment-region}) turns all the -lines of the region into comments by inserting the string @samp{C$$$} at -the front of each one. With a numeric argument, it turns the region -back into live code by deleting @samp{C$$$} from the front of each line -in it. The string used for these comments can be controlled by setting -the variable @code{fortran-comment-region}. Note that here we have an -example of a command and a variable with the same name; these two uses -of the name never conflict because in Lisp and in Emacs it is always -clear from the context which one is meant. - -@node Fortran Autofill -@subsection Auto Fill in Fortran Mode - - Fortran mode has specialized support for Auto Fill mode, which is a -minor mode that automatically splits statements as you insert them -when they become too wide. Splitting a statement involves making -continuation lines using @code{fortran-continuation-string} -(@pxref{ForIndent Cont}). This splitting happens when you type -@key{SPC}, @key{RET}, or @key{TAB}, and also in the Fortran -indentation commands. You activate Auto Fill in Fortran mode in the -normal way. -@iftex -@xref{Auto Fill,,, emacs, the Emacs Manual}. -@end iftex -@ifnottex -@xref{Auto Fill}. -@end ifnottex - -@vindex fortran-break-before-delimiters - Auto Fill breaks lines at spaces or delimiters when the lines get -longer than the desired width (the value of @code{fill-column}). The -delimiters (besides whitespace) that Auto Fill can break at are -@samp{+}, @samp{-}, @samp{/}, @samp{*}, @samp{=}, @samp{<}, @samp{>}, -and @samp{,}. The line break comes after the delimiter if the -variable @code{fortran-break-before-delimiters} is @code{nil}. -Otherwise (and by default), the break comes before the delimiter. - - To enable Auto Fill in all Fortran buffers, add -@code{turn-on-auto-fill} to @code{fortran-mode-hook}. -@iftex -@xref{Hooks,,, emacs, the Emacs Manual}. -@end iftex -@ifnottex -@xref{Hooks}. -@end ifnottex - -@node Fortran Columns -@subsection Checking Columns in Fortran - -@table @kbd -@item C-c C-r -Display a ``column ruler'' momentarily above the current line -(@code{fortran-column-ruler}). -@item C-c C-w -Split the current window horizontally temporarily so that it is 72 -columns wide (@code{fortran-window-create-momentarily}). This may -help you avoid making lines longer than the 72-character limit that -some Fortran compilers impose. -@item C-u C-c C-w -Split the current window horizontally so that it is 72 columns wide -(@code{fortran-window-create}). You can then continue editing. -@item M-x fortran-strip-sequence-nos -Delete all text in column 72 and beyond. -@end table - -@kindex C-c C-r @r{(Fortran mode)} -@findex fortran-column-ruler - The command @kbd{C-c C-r} (@code{fortran-column-ruler}) shows a column -ruler momentarily above the current line. The comment ruler is two lines -of text that show you the locations of columns with special significance in -Fortran programs. Square brackets show the limits of the columns for line -numbers, and curly brackets show the limits of the columns for the -statement body. Column numbers appear above them. - - Note that the column numbers count from zero, as always in GNU Emacs. -As a result, the numbers may be one less than those you are familiar -with; but the positions they indicate in the line are standard for -Fortran. - -@vindex fortran-column-ruler-fixed -@vindex fortran-column-ruler-tabs - The text used to display the column ruler depends on the value of the -variable @code{indent-tabs-mode}. If @code{indent-tabs-mode} is -@code{nil}, then the value of the variable -@code{fortran-column-ruler-fixed} is used as the column ruler. -Otherwise, the value of the variable @code{fortran-column-ruler-tab} is -displayed. By changing these variables, you can change the column ruler -display. - -@kindex C-c C-w @r{(Fortran mode)} -@findex fortran-window-create-momentarily - @kbd{C-c C-w} (@code{fortran-window-create-momentarily}) temporarily -splits the current window horizontally, making a window 72 columns -wide, so you can see any lines that are too long. Type a space to -restore the normal width. - -@kindex C-u C-c C-w @r{(Fortran mode)} -@findex fortran-window-create - You can also split the window horizontally and continue editing with -the split in place. To do this, use @kbd{C-u C-c C-w} (@code{M-x -fortran-window-create}). By editing in this window you can -immediately see when you make a line too wide to be correct Fortran. - -@findex fortran-strip-sequence-nos - The command @kbd{M-x fortran-strip-sequence-nos} deletes all text in -column 72 and beyond, on all lines in the current buffer. This is the -easiest way to get rid of old sequence numbers. - -@node Fortran Abbrev -@subsection Fortran Keyword Abbrevs - - Fortran mode provides many built-in abbrevs for common keywords and -declarations. These are the same sort of abbrev that you can define -yourself. To use them, you must turn on Abbrev mode. -@iftex -@xref{Abbrevs,,, emacs, the Emacs Manual}. -@end iftex -@ifnottex -@xref{Abbrevs}. -@end ifnottex - - The built-in abbrevs are unusual in one way: they all start with a -semicolon. You cannot normally use semicolon in an abbrev, but Fortran -mode makes this possible by changing the syntax of semicolon to ``word -constituent.'' - - For example, one built-in Fortran abbrev is @samp{;c} for -@samp{continue}. If you insert @samp{;c} and then insert a punctuation -character such as a space or a newline, the @samp{;c} expands automatically -to @samp{continue}, provided Abbrev mode is enabled.@refill - - Type @samp{;?} or @samp{;C-h} to display a list of all the built-in -Fortran abbrevs and what they stand for. - -@ignore - arch-tag: 23ed7c36-1517-4646-9235-2d5ade5f06f6 -@end ignore diff --git a/man/gnu.texi b/man/gnu.texi deleted file mode 100644 index 1cf85f41c3c..00000000000 --- a/man/gnu.texi +++ /dev/null @@ -1,567 +0,0 @@ -@c This is part of the Emacs manual. -@c Copyright (C) 1985, 1986, 1987, 1993, 1995, 2001, 2002, 2003, 2004, -@c 2005, 2006, 2007 Free Software Foundation, Inc. -@ifclear justgnu -@node Manifesto,, Microsoft Windows, Top -@unnumbered The GNU Manifesto -@end ifclear -@ifset justgnu -Copyright @copyright{} 1985, 1993, 2001, 2002, 2003, 2004, -2005, 2006, 2007 Free Software Foundation, Inc. - -Permission is granted to copy, distribute and/or modify this document -under the terms of the GNU Free Documentation License, Version 1.2 or -any later version published by the Free Software Foundation; with no -Invariant Sections, with the Front-Cover texts being ``A GNU -Manual'', and with the Back-Cover Texts as in (a) below. A copy of the -license is included in the section entitled ``GNU Free Documentation -License'' in the Emacs manual. - -(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify -this GNU Manual, like GNU software. Copies published by the Free -Software Foundation raise funds for GNU development.'' - -This document is part of a collection distributed under the GNU Free -Documentation License. If you want to distribute this document -separately from the collection, you can do so by adding a copy of the -license to the document, as described in section 6 of the license. - -@node Top -@top The GNU Manifesto -@end ifset - -@quotation -The GNU Manifesto which appears below was written by Richard Stallman at -the beginning of the GNU project, to ask for participation and support. -For the first few years, it was updated in minor ways to account for -developments, but now it seems best to leave it unchanged as most people -have seen it. - -Since that time, we have learned about certain common misunderstandings -that different wording could help avoid. Footnotes added in 1993 help -clarify these points. - -For up-to-date information about available GNU software, please see -our web site, @uref{http://www.gnu.org}. For software tasks and other -ways to contribute, see @uref{http://www.gnu.org/help}. -@end quotation - -@unnumberedsec What's GNU? Gnu's Not Unix! - -GNU, which stands for Gnu's Not Unix, is the name for the complete -Unix-compatible software system which I am writing so that I can give it -away free to everyone who can use it.@footnote{The wording here was -careless. The intention was that nobody would have to pay for -@emph{permission} to use the GNU system. But the words don't make this -clear, and people often interpret them as saying that copies of GNU -should always be distributed at little or no charge. That was never the -intent; later on, the manifesto mentions the possibility of companies -providing the service of distribution for a profit. Subsequently I have -learned to distinguish carefully between ``free'' in the sense of -freedom and ``free'' in the sense of price. Free software is software -that users have the freedom to distribute and change. Some users may -obtain copies at no charge, while others pay to obtain copies---and if -the funds help support improving the software, so much the better. The -important thing is that everyone who has a copy has the freedom to -cooperate with others in using it.} Several other volunteers are helping -me. Contributions of time, money, programs and equipment are greatly -needed. - -So far we have an Emacs text editor with Lisp for writing editor commands, -a source level debugger, a yacc-compatible parser generator, a linker, and -around 35 utilities. A shell (command interpreter) is nearly completed. A -new portable optimizing C compiler has compiled itself and may be released -this year. An initial kernel exists but many more features are needed to -emulate Unix. When the kernel and compiler are finished, it will be -possible to distribute a GNU system suitable for program development. We -will use @TeX{} as our text formatter, but an nroff is being worked on. We -will use the free, portable X window system as well. After this we will -add a portable Common Lisp, an Empire game, a spreadsheet, and hundreds of -other things, plus on-line documentation. We hope to supply, eventually, -everything useful that normally comes with a Unix system, and more. - -GNU will be able to run Unix programs, but will not be identical to Unix. -We will make all improvements that are convenient, based on our experience -with other operating systems. In particular, we plan to have longer -file names, file version numbers, a crashproof file system, file name -completion perhaps, terminal-independent display support, and perhaps -eventually a Lisp-based window system through which several Lisp programs -and ordinary Unix programs can share a screen. Both C and Lisp will be -available as system programming languages. We will try to support UUCP, -MIT Chaosnet, and Internet protocols for communication. - -GNU is aimed initially at machines in the 68000/16000 class with virtual -memory, because they are the easiest machines to make it run on. The extra -effort to make it run on smaller machines will be left to someone who wants -to use it on them. - -To avoid horrible confusion, please pronounce the `G' in the word `GNU' -when it is the name of this project. - -@unnumberedsec Why I Must Write GNU - -I consider that the golden rule requires that if I like a program I must -share it with other people who like it. Software sellers want to divide -the users and conquer them, making each user agree not to share with -others. I refuse to break solidarity with other users in this way. I -cannot in good conscience sign a nondisclosure agreement or a software -license agreement. For years I worked within the Artificial Intelligence -Lab to resist such tendencies and other inhospitalities, but eventually -they had gone too far: I could not remain in an institution where such -things are done for me against my will. - -So that I can continue to use computers without dishonor, I have decided to -put together a sufficient body of free software so that I will be able to -get along without any software that is not free. I have resigned from the -AI lab to deny MIT any legal excuse to prevent me from giving GNU away. - -@unnumberedsec Why GNU Will Be Compatible with Unix - -Unix is not my ideal system, but it is not too bad. The essential features -of Unix seem to be good ones, and I think I can fill in what Unix lacks -without spoiling them. And a system compatible with Unix would be -convenient for many other people to adopt. - -@unnumberedsec How GNU Will Be Available - -GNU is not in the public domain. Everyone will be permitted to modify and -redistribute GNU, but no distributor will be allowed to restrict its -further redistribution. That is to say, proprietary modifications will not -be allowed. I want to make sure that all versions of GNU remain free. - -@unnumberedsec Why Many Other Programmers Want to Help - -I have found many other programmers who are excited about GNU and want to -help. - -Many programmers are unhappy about the commercialization of system -software. It may enable them to make more money, but it requires them to -feel in conflict with other programmers in general rather than feel as -comrades. The fundamental act of friendship among programmers is the -sharing of programs; marketing arrangements now typically used essentially -forbid programmers to treat others as friends. The purchaser of software -must choose between friendship and obeying the law. Naturally, many decide -that friendship is more important. But those who believe in law often do -not feel at ease with either choice. They become cynical and think that -programming is just a way of making money. - -By working on and using GNU rather than proprietary programs, we can be -hospitable to everyone and obey the law. In addition, GNU serves as an -example to inspire and a banner to rally others to join us in sharing. -This can give us a feeling of harmony which is impossible if we use -software that is not free. For about half the programmers I talk to, this -is an important happiness that money cannot replace. - -@unnumberedsec How You Can Contribute - -I am asking computer manufacturers for donations of machines and money. -I'm asking individuals for donations of programs and work. - -One consequence you can expect if you donate machines is that GNU will run -on them at an early date. The machines should be complete, ready to use -systems, approved for use in a residential area, and not in need of -sophisticated cooling or power. - -I have found very many programmers eager to contribute part-time work for -GNU. For most projects, such part-time distributed work would be very hard -to coordinate; the independently-written parts would not work together. -But for the particular task of replacing Unix, this problem is absent. A -complete Unix system contains hundreds of utility programs, each of which -is documented separately. Most interface specifications are fixed by Unix -compatibility. If each contributor can write a compatible replacement for -a single Unix utility, and make it work properly in place of the original -on a Unix system, then these utilities will work right when put together. -Even allowing for Murphy to create a few unexpected problems, assembling -these components will be a feasible task. (The kernel will require closer -communication and will be worked on by a small, tight group.) - -If I get donations of money, I may be able to hire a few people full or -part time. The salary won't be high by programmers' standards, but I'm -looking for people for whom building community spirit is as important as -making money. I view this as a way of enabling dedicated people to devote -their full energies to working on GNU by sparing them the need to make a -living in another way. - -@unnumberedsec Why All Computer Users Will Benefit - -Once GNU is written, everyone will be able to obtain good system -software free, just like air.@footnote{This is another place I failed to -distinguish carefully between the two different meanings of ``free.'' -The statement as it stands is not false---you can get copies of GNU -software at no charge, from your friends or over the net. But it does -suggest the wrong idea.} - -This means much more than just saving everyone the price of a Unix license. -It means that much wasteful duplication of system programming effort will -be avoided. This effort can go instead into advancing the state of the -art. - -Complete system sources will be available to everyone. As a result, a user -who needs changes in the system will always be free to make them himself, -or hire any available programmer or company to make them for him. Users -will no longer be at the mercy of one programmer or company which owns the -sources and is in sole position to make changes. - -Schools will be able to provide a much more educational environment by -encouraging all students to study and improve the system code. Harvard's -computer lab used to have the policy that no program could be installed on -the system if its sources were not on public display, and upheld it by -actually refusing to install certain programs. I was very much inspired by -this. - -Finally, the overhead of considering who owns the system software and what -one is or is not entitled to do with it will be lifted. - -Arrangements to make people pay for using a program, including licensing of -copies, always incur a tremendous cost to society through the cumbersome -mechanisms necessary to figure out how much (that is, which programs) a -person must pay for. And only a police state can force everyone to obey -them. Consider a space station where air must be manufactured at great -cost: charging each breather per liter of air may be fair, but wearing the -metered gas mask all day and all night is intolerable even if everyone can -afford to pay the air bill. And the TV cameras everywhere to see if you -ever take the mask off are outrageous. It's better to support the air -plant with a head tax and chuck the masks. - -Copying all or parts of a program is as natural to a programmer as -breathing, and as productive. It ought to be as free. - -@unnumberedsec Some Easily Rebutted Objections to GNU's Goals - -@quotation -``Nobody will use it if it is free, because that means they can't rely -on any support.'' - -``You have to charge for the program to pay for providing the -support.'' -@end quotation - -If people would rather pay for GNU plus service than get GNU free without -service, a company to provide just service to people who have obtained GNU -free ought to be profitable.@footnote{Several such companies now exist.} - -We must distinguish between support in the form of real programming work -and mere handholding. The former is something one cannot rely on from a -software vendor. If your problem is not shared by enough people, the -vendor will tell you to get lost. - -If your business needs to be able to rely on support, the only way is to -have all the necessary sources and tools. Then you can hire any available -person to fix your problem; you are not at the mercy of any individual. -With Unix, the price of sources puts this out of consideration for most -businesses. With GNU this will be easy. It is still possible for there to -be no available competent person, but this problem cannot be blamed on -distribution arrangements. GNU does not eliminate all the world's problems, -only some of them. - -Meanwhile, the users who know nothing about computers need handholding: -doing things for them which they could easily do themselves but don't know -how. - -Such services could be provided by companies that sell just hand-holding -and repair service. If it is true that users would rather spend money and -get a product with service, they will also be willing to buy the service -having got the product free. The service companies will compete in quality -and price; users will not be tied to any particular one. Meanwhile, those -of us who don't need the service should be able to use the program without -paying for the service. - -@quotation -``You cannot reach many people without advertising, -and you must charge for the program to support that.'' - -``It's no use advertising a program people can get free.'' -@end quotation - -There are various forms of free or very cheap publicity that can be used to -inform numbers of computer users about something like GNU. But it may be -true that one can reach more microcomputer users with advertising. If this -is really so, a business which advertises the service of copying and -mailing GNU for a fee ought to be successful enough to pay for its -advertising and more. This way, only the users who benefit from the -advertising pay for it. - -On the other hand, if many people get GNU from their friends, and such -companies don't succeed, this will show that advertising was not really -necessary to spread GNU. Why is it that free market advocates don't -want to let the free market decide this?@footnote{The Free Software -Foundation raises most of its funds from a distribution service, -although it is a charity rather than a company. If @emph{no one} -chooses to obtain copies by ordering from the FSF, it will be unable -to do its work. But this does not mean that proprietary restrictions -are justified to force every user to pay. If a small fraction of all -the users order copies from the FSF, that is sufficient to keep the FSF -afloat. So we ask users to choose to support us in this way. Have you -done your part?} - -@quotation -``My company needs a proprietary operating system -to get a competitive edge.'' -@end quotation - -GNU will remove operating system software from the realm of competition. -You will not be able to get an edge in this area, but neither will your -competitors be able to get an edge over you. You and they will compete in -other areas, while benefiting mutually in this one. If your business is -selling an operating system, you will not like GNU, but that's tough on -you. If your business is something else, GNU can save you from being -pushed into the expensive business of selling operating systems. - -I would like to see GNU development supported by gifts from many -manufacturers and users, reducing the cost to each.@footnote{A group of -computer companies recently pooled funds to support maintenance of the -GNU C Compiler.} - -@quotation -``Don't programmers deserve a reward for their creativity?'' -@end quotation - -If anything deserves a reward, it is social contribution. Creativity can -be a social contribution, but only in so far as society is free to use the -results. If programmers deserve to be rewarded for creating innovative -programs, by the same token they deserve to be punished if they restrict -the use of these programs. - -@quotation -``Shouldn't a programmer be able to ask for a reward for his creativity?'' -@end quotation - -There is nothing wrong with wanting pay for work, or seeking to maximize -one's income, as long as one does not use means that are destructive. But -the means customary in the field of software today are based on -destruction. - -Extracting money from users of a program by restricting their use of it is -destructive because the restrictions reduce the amount and the ways that -the program can be used. This reduces the amount of wealth that humanity -derives from the program. When there is a deliberate choice to restrict, -the harmful consequences are deliberate destruction. - -The reason a good citizen does not use such destructive means to become -wealthier is that, if everyone did so, we would all become poorer from the -mutual destructiveness. This is Kantian ethics; or, the Golden Rule. -Since I do not like the consequences that result if everyone hoards -information, I am required to consider it wrong for one to do so. -Specifically, the desire to be rewarded for one's creativity does not -justify depriving the world in general of all or part of that creativity. - -@quotation -``Won't programmers starve?'' -@end quotation - -I could answer that nobody is forced to be a programmer. Most of us cannot -manage to get any money for standing on the street and making faces. But -we are not, as a result, condemned to spend our lives standing on the -street making faces, and starving. We do something else. - -But that is the wrong answer because it accepts the questioner's implicit -assumption: that without ownership of software, programmers cannot possibly -be paid a cent. Supposedly it is all or nothing. - -The real reason programmers will not starve is that it will still be -possible for them to get paid for programming; just not paid as much as -now. - -Restricting copying is not the only basis for business in software. It is -the most common basis because it brings in the most money. If it were -prohibited, or rejected by the customer, software business would move to -other bases of organization which are now used less often. There are -always numerous ways to organize any kind of business. - -Probably programming will not be as lucrative on the new basis as it is -now. But that is not an argument against the change. It is not considered -an injustice that sales clerks make the salaries that they now do. If -programmers made the same, that would not be an injustice either. (In -practice they would still make considerably more than that.) - -@quotation -``Don't people have a right to control how their creativity is used?'' -@end quotation - -``Control over the use of one's ideas'' really constitutes control over -other people's lives; and it is usually used to make their lives more -difficult. - -People who have studied the issue of intellectual property -rights@footnote{In the 80s I had not yet realized how confusing it was -to speak of ``the issue'' of ``intellectual property.'' That term is -obviously biased; more subtle is the fact that it lumps together -various disparate laws which raise very different issues. Nowadays I -urge people to reject the term ``intellectual property'' entirely, -lest it lead others to suppose that those laws form one coherent -issue. The way to be clear is to discuss patents, copyrights, and -trademarks separately. See -@uref{http://www.gnu.org/philosophy/not-ipr.xhtml} for more -explanation of how this term spreads confusion and bias.} carefully -(such as lawyers) say that there is no intrinsic right to intellectual -property. The kinds of supposed intellectual property rights that the -government recognizes were created by specific acts of legislation for -specific purposes. - -For example, the patent system was established to encourage inventors to -disclose the details of their inventions. Its purpose was to help society -rather than to help inventors. At the time, the life span of 17 years for -a patent was short compared with the rate of advance of the state of the -art. Since patents are an issue only among manufacturers, for whom the -cost and effort of a license agreement are small compared with setting up -production, the patents often do not do much harm. They do not obstruct -most individuals who use patented products. - -The idea of copyright did not exist in ancient times, when authors -frequently copied other authors at length in works of non-fiction. This -practice was useful, and is the only way many authors' works have survived -even in part. The copyright system was created expressly for the purpose -of encouraging authorship. In the domain for which it was -invented---books, which could be copied economically only on a printing -press---it did little harm, and did not obstruct most of the individuals -who read the books. - -All intellectual property rights are just licenses granted by society -because it was thought, rightly or wrongly, that society as a whole would -benefit by granting them. But in any particular situation, we have to ask: -are we really better off granting such license? What kind of act are we -licensing a person to do? - -The case of programs today is very different from that of books a hundred -years ago. The fact that the easiest way to copy a program is from one -neighbor to another, the fact that a program has both source code and -object code which are distinct, and the fact that a program is used rather -than read and enjoyed, combine to create a situation in which a person who -enforces a copyright is harming society as a whole both materially and -spiritually; in which a person should not do so regardless of whether the -law enables him to. - -@quotation -``Competition makes things get done better.'' -@end quotation - -The paradigm of competition is a race: by rewarding the winner, we -encourage everyone to run faster. When capitalism really works this way, -it does a good job; but its defenders are wrong in assuming it always works -this way. If the runners forget why the reward is offered and become -intent on winning, no matter how, they may find other strategies---such as, -attacking other runners. If the runners get into a fist fight, they will -all finish late. - -Proprietary and secret software is the moral equivalent of runners in a -fist fight. Sad to say, the only referee we've got does not seem to -object to fights; he just regulates them (``For every ten yards you run, -you can fire one shot''). He really ought to break them up, and penalize -runners for even trying to fight. - -@quotation -``Won't everyone stop programming without a monetary incentive?'' -@end quotation - -Actually, many people will program with absolutely no monetary incentive. -Programming has an irresistible fascination for some people, usually the -people who are best at it. There is no shortage of professional musicians -who keep at it even though they have no hope of making a living that way. - -But really this question, though commonly asked, is not appropriate to the -situation. Pay for programmers will not disappear, only become less. So -the right question is, will anyone program with a reduced monetary -incentive? My experience shows that they will. - -For more than ten years, many of the world's best programmers worked at the -Artificial Intelligence Lab for far less money than they could have had -anywhere else. They got many kinds of non-monetary rewards: fame and -appreciation, for example. And creativity is also fun, a reward in itself. - -Then most of them left when offered a chance to do the same interesting -work for a lot of money. - -What the facts show is that people will program for reasons other than -riches; but if given a chance to make a lot of money as well, they will -come to expect and demand it. Low-paying organizations do poorly in -competition with high-paying ones, but they do not have to do badly if the -high-paying ones are banned. - -@quotation -``We need the programmers desperately. If they demand that we -stop helping our neighbors, we have to obey.'' -@end quotation - -You're never so desperate that you have to obey this sort of demand. -Remember: millions for defense, but not a cent for tribute! - -@quotation -``Programmers need to make a living somehow.'' -@end quotation - -In the short run, this is true. However, there are plenty of ways that -programmers could make a living without selling the right to use a program. -This way is customary now because it brings programmers and businessmen the -most money, not because it is the only way to make a living. It is easy to -find other ways if you want to find them. Here are a number of examples. - -A manufacturer introducing a new computer will pay for the porting of -operating systems onto the new hardware. - -The sale of teaching, hand-holding and maintenance services could also -employ programmers. - -People with new ideas could distribute programs as -freeware@footnote{Subsequently we have discovered the need to -distinguish between ``free software'' and ``freeware''. The term -``freeware'' means software you are free to redistribute, but usually -you are not free to study and change the source code, so most of it is -not free software. See -@uref{http://www.gnu.org/philosophy/words-to-avoid.html} for more -explanation.}, asking for donations from satisfied users, or selling -hand-holding services. I have met people who are already working this -way successfully. - -Users with related needs can form users' groups, and pay dues. A group -would contract with programming companies to write programs that the -group's members would like to use. - -All sorts of development can be funded with a Software Tax: - -@quotation -Suppose everyone who buys a computer has to pay x percent of -the price as a software tax. The government gives this to -an agency like the NSF to spend on software development. - -But if the computer buyer makes a donation to software development -himself, he can take a credit against the tax. He can donate to -the project of his own choosing---often, chosen because he hopes to -use the results when it is done. He can take a credit for any amount -of donation up to the total tax he had to pay. - -The total tax rate could be decided by a vote of the payers of -the tax, weighted according to the amount they will be taxed on. - -The consequences: - -@itemize @bullet -@item -The computer-using community supports software development. -@item -This community decides what level of support is needed. -@item -Users who care which projects their share is spent on -can choose this for themselves. -@end itemize -@end quotation - -In the long run, making programs free is a step toward the post-scarcity -world, where nobody will have to work very hard just to make a living. -People will be free to devote themselves to activities that are fun, such -as programming, after spending the necessary ten hours a week on required -tasks such as legislation, family counseling, robot repair and asteroid -prospecting. There will be no need to be able to make a living from -programming. - -We have already greatly reduced the amount of work that the whole society -must do for its actual productivity, but only a little of this has -translated itself into leisure for workers because much nonproductive -activity is required to accompany productive activity. The main causes of -this are bureaucracy and isometric struggles against competition. Free -software will greatly reduce these drains in the area of software -production. We must do this, in order for technical gains in productivity -to translate into less work for us. - -@ignore - arch-tag: 21eb38f8-6fa0-480a-91cd-f3dab7148542 -@end ignore diff --git a/man/gnus.texi b/man/gnus.texi deleted file mode 100644 index 7cabf674102..00000000000 --- a/man/gnus.texi +++ /dev/null @@ -1,29508 +0,0 @@ -\input texinfo - -@setfilename ../info/gnus -@settitle Gnus Manual -@syncodeindex fn cp -@syncodeindex vr cp -@syncodeindex pg cp - -@copying -Copyright @copyright{} 1995, 1996, 1997, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. - -@quotation -Permission is granted to copy, distribute and/or modify this document -under the terms of the GNU Free Documentation License, Version 1.2 or -any later version published by the Free Software Foundation; with no -Invariant Sections, with the Front-Cover texts being ``A GNU -Manual'', and with the Back-Cover Texts as in (a) below. A copy of the -license is included in the section entitled ``GNU Free Documentation -License'' in the Emacs manual. - -(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify -this GNU Manual, like GNU software. Copies published by the Free -Software Foundation raise funds for GNU development.'' - -This document is part of a collection distributed under the GNU Free -Documentation License. If you want to distribute this document -separately from the collection, you can do so by adding a copy of the -license to the document, as described in section 6 of the license. -@end quotation -@end copying - -@iftex -@iflatex -\documentclass[twoside,a4paper,openright,11pt]{book} -\usepackage[latin1]{inputenc} -\usepackage{pagestyle} -\usepackage{epsfig} -\usepackage{pixidx} -\input{gnusconfig.tex} - -\ifx\pdfoutput\undefined -\else -\usepackage[pdftex,bookmarks,colorlinks=true]{hyperref} -\usepackage{thumbpdf} -\pdfcompresslevel=9 -\fi - -\makeindex -\begin{document} - -% Adjust ../Makefile.in if you change the following line: -\newcommand{\gnusversionname}{Gnus v5.11} -\newcommand{\gnuschaptername}{} -\newcommand{\gnussectionname}{} - -\newcommand{\gnusbackslash}{/} - -\newcommand{\gnusref}[1]{``#1'' on page \pageref{#1}} -\ifx\pdfoutput\undefined -\newcommand{\gnusuref}[1]{\gnustt{#1}} -\else -\newcommand{\gnusuref}[1]{\href{#1}{\gnustt{#1}}} -\fi -\newcommand{\gnusxref}[1]{See ``#1'' on page \pageref{#1}} -\newcommand{\gnuspxref}[1]{see ``#1'' on page \pageref{#1}} - -\newcommand{\gnuskindex}[1]{\index{#1}} -\newcommand{\gnusindex}[1]{\index{#1}} - -\newcommand{\gnustt}[1]{{\gnusselectttfont{}#1}} -\newcommand{\gnuscode}[1]{\gnustt{#1}} -\newcommand{\gnusasis}[1]{\gnustt{#1}} -\newcommand{\gnusurl}[1]{\gnustt{#1}} -\newcommand{\gnuscommand}[1]{\gnustt{#1}} -\newcommand{\gnusenv}[1]{\gnustt{#1}} -\newcommand{\gnussamp}[1]{``{\fontencoding{OT1}\gnusselectttfont{}#1}''} -\newcommand{\gnuslisp}[1]{\gnustt{#1}} -\newcommand{\gnuskbd}[1]{`\gnustt{#1}'} -\newcommand{\gnuskey}[1]{`\gnustt{#1}'} -\newcommand{\gnusfile}[1]{`\gnustt{#1}'} -\newcommand{\gnusdfn}[1]{\textit{#1}} -\newcommand{\gnusi}[1]{\textit{#1}} -\newcommand{\gnusr}[1]{\textrm{#1}} -\newcommand{\gnusstrong}[1]{\textbf{#1}} -\newcommand{\gnusemph}[1]{\textit{#1}} -\newcommand{\gnusvar}[1]{{\fontsize{10pt}{10}\selectfont\textsl{\textsf{#1}}}} -\newcommand{\gnussc}[1]{\textsc{#1}} -\newcommand{\gnustitle}[1]{{\huge\textbf{#1}}} -\newcommand{\gnusversion}[1]{{\small\textit{#1}}} -\newcommand{\gnusauthor}[1]{{\large\textbf{#1}}} -\newcommand{\gnusresult}[1]{\gnustt{=> #1}} -\newcommand{\gnusacronym}[1]{\textsc{#1}} -\newcommand{\gnusemail}[1]{\textit{#1}} - -\newcommand{\gnusbullet}{{${\bullet}$}} -\newcommand{\gnusdollar}{\$} -\newcommand{\gnusampersand}{\&} -\newcommand{\gnuspercent}{\%} -\newcommand{\gnushash}{\#} -\newcommand{\gnushat}{\symbol{"5E}} -\newcommand{\gnusunderline}{\symbol{"5F}} -\newcommand{\gnusnot}{$\neg$} -\newcommand{\gnustilde}{\symbol{"7E}} -\newcommand{\gnusless}{{$<$}} -\newcommand{\gnusgreater}{{$>$}} -\newcommand{\gnusbraceleft}{{$>$}} -\newcommand{\gnusbraceright}{{$>$}} - -\newcommand{\gnushead}{\raisebox{-1cm}{\epsfig{figure=ps/gnus-head,height=1cm}}} -\newcommand{\gnusinteresting}{ -\marginpar[\mbox{}\hfill\gnushead]{\gnushead} -} - -\newcommand{\gnuscleardoublepage}{\ifodd\count0\mbox{}\clearpage\thispagestyle{empty}\mbox{}\clearpage\else\clearpage\fi} - -\newcommand{\gnuspagechapter}[1]{ -{\mbox{}} -} - -\newdimen{\gnusdimen} -\gnusdimen 0pt - -\newcommand{\gnuschapter}[2]{ -\gnuscleardoublepage -\ifdim \gnusdimen = 0pt\setcounter{page}{1}\pagestyle{gnus}\pagenumbering{arabic} \gnusdimen 1pt\fi -\chapter{#2} -\renewcommand{\gnussectionname}{} -\renewcommand{\gnuschaptername}{#2} -\thispagestyle{empty} -\hspace*{-2cm} -\begin{picture}(500,500)(0,0) -\put(480,350){\makebox(0,0)[tr]{#1}} -\put(40,300){\makebox(500,50)[bl]{{\Huge\bf{#2}}}} -\end{picture} -\clearpage -} - -\newcommand{\gnusfigure}[3]{ -\begin{figure} -\mbox{}\ifodd\count0\hspace*{-0.8cm}\else\hspace*{-3cm}\fi\begin{picture}(440,#2) -#3 -\end{picture} -\caption{#1} -\end{figure} -} - -\newcommand{\gnusicon}[1]{ -\marginpar[\mbox{}\hfill\raisebox{-1.5cm}{\epsfig{figure=ps/#1-up,height=1.5cm}}]{\raisebox{-1cm}{\epsfig{figure=ps/#1-up,height=1cm}}} -} - -\newcommand{\gnuspicon}[1]{ -\margindex{\epsfig{figure=#1,width=2cm}} -} - -\newcommand{\gnusxface}[2]{ -\margindex{\epsfig{figure=#1,width=1cm}\epsfig{figure=#2,width=1cm}} -} - -\newcommand{\gnussmiley}[2]{ -\margindex{\makebox[2cm]{\hfill\epsfig{figure=#1,width=0.5cm}\hfill\epsfig{figure=#2,width=0.5cm}\hfill}} -} - -\newcommand{\gnusitemx}[1]{\mbox{}\vspace*{-\itemsep}\vspace*{-\parsep}\item#1} - -\newcommand{\gnussection}[1]{ -\renewcommand{\gnussectionname}{#1} -\section{#1} -} - -\newenvironment{codelist}% -{\begin{list}{}{ -} -}{\end{list}} - -\newenvironment{asislist}% -{\begin{list}{}{ -} -}{\end{list}} - -\newenvironment{kbdlist}% -{\begin{list}{}{ -\labelwidth=0cm -} -}{\end{list}} - -\newenvironment{dfnlist}% -{\begin{list}{}{ -} -}{\end{list}} - -\newenvironment{stronglist}% -{\begin{list}{}{ -} -}{\end{list}} - -\newenvironment{samplist}% -{\begin{list}{}{ -} -}{\end{list}} - -\newenvironment{varlist}% -{\begin{list}{}{ -} -}{\end{list}} - -\newenvironment{emphlist}% -{\begin{list}{}{ -} -}{\end{list}} - -\newlength\gnusheadtextwidth -\setlength{\gnusheadtextwidth}{\headtextwidth} -\addtolength{\gnusheadtextwidth}{1cm} - -\newpagestyle{gnuspreamble}% -{ -{ -\ifodd\count0 -{ -\hspace*{-0.23cm}\underline{\makebox[\gnusheadtextwidth]{\mbox{}}\textbf{\hfill\roman{page}}} -} -\else -{ -\hspace*{-3.25cm}\underline{\makebox[\gnusheadtextwidth]{\textbf{\roman{page}\hfill\mbox{}}} -} -} -\fi -} -} -{ -\ifodd\count0 -\mbox{} \hfill -\raisebox{-0.5cm}{\epsfig{figure=ps/gnus-big-logo,height=1cm}} -\else -\raisebox{-0.5cm}{\epsfig{figure=ps/gnus-big-logo,height=1cm}} -\hfill \mbox{} -\fi -} - -\newpagestyle{gnusindex}% -{ -{ -\ifodd\count0 -{ -\hspace*{-0.23cm}\underline{\makebox[\gnusheadtextwidth]{\textbf{\gnuschaptername\hfill\arabic{page}}}} -} -\else -{ -\hspace*{-3.25cm}\underline{\makebox[\gnusheadtextwidth]{\textbf{\arabic{page}\hfill\gnuschaptername}}} -} -\fi -} -} -{ -\ifodd\count0 -\mbox{} \hfill -\raisebox{-0.5cm}{\epsfig{figure=ps/gnus-big-logo,height=1cm}} -\else -\raisebox{-0.5cm}{\epsfig{figure=ps/gnus-big-logo,height=1cm}} -\hfill \mbox{} -\fi -} - -\newpagestyle{gnus}% -{ -{ -\ifodd\count0 -{ -\makebox[12cm]{\hspace*{3.1cm}\underline{\makebox[\gnusheadtextwidth]{\textbf{\arabic{chapter}.\arabic{section}} \textbf{\gnussectionname\hfill\arabic{page}}}}} -} -\else -{ -\makebox[12cm]{\hspace*{-2.95cm}\underline{\makebox[\gnusheadtextwidth]{\textbf{\arabic{page}\hfill\gnuschaptername}}}} -} -\fi -} -} -{ -\ifodd\count0 -\mbox{} \hfill -\raisebox{-0.5cm}{\epsfig{figure=ps/gnus-big-logo,height=1cm}} -\else -\raisebox{-0.5cm}{\epsfig{figure=ps/gnus-big-logo,height=1cm}} -\hfill \mbox{} -\fi -} - -\pagenumbering{roman} -\pagestyle{gnuspreamble} - -@end iflatex -@end iftex - -@iftex -@iflatex - -\begin{titlepage} -{ - -%\addtolength{\oddsidemargin}{-5cm} -%\addtolength{\evensidemargin}{-5cm} -\parindent=0cm -\addtolength{\textheight}{2cm} - -\gnustitle{\gnustitlename}\hfill\gnusversion{\gnusversionname}\\ -\rule{15cm}{1mm}\\ -\vfill -\hspace*{0cm}\epsfig{figure=ps/gnus-big-logo,height=15cm} -\vfill -\rule{15cm}{1mm}\\ -\gnusauthor{by Lars Magne Ingebrigtsen} -\newpage -} - -\mbox{} -\vfill - -\thispagestyle{empty} - -@c @insertcopying -\newpage -\end{titlepage} -@end iflatex -@end iftex - -@ifnottex -@insertcopying -@end ifnottex - -@dircategory Emacs -@direntry -* Gnus: (gnus). The newsreader Gnus. -@end direntry -@iftex -@finalout -@end iftex -@setchapternewpage odd - - - -@titlepage -@title Gnus Manual - -@author by Lars Magne Ingebrigtsen -@page -@vskip 0pt plus 1filll -@insertcopying -@end titlepage - - -@node Top -@top The Gnus Newsreader - -@ifinfo - -You can read news (and mail) from within Emacs by using Gnus. The news -can be gotten by any nefarious means you can think of---@acronym{NNTP}, local -spool or your mbox file. All at the same time, if you want to push your -luck. - -@c Adjust ../Makefile.in if you change the following line: -This manual corresponds to Gnus v5.11. - -@end ifinfo - -@iftex - -@iflatex -\tableofcontents -\gnuscleardoublepage -@end iflatex - -Gnus is the advanced, self-documenting, customizable, extensible -unreal-time newsreader for GNU Emacs. - -Oops. That sounds oddly familiar, so let's start over again to avoid -being accused of plagiarism: - -Gnus is a message-reading laboratory. It will let you look at just -about anything as if it were a newsgroup. You can read mail with it, -you can browse directories with it, you can @code{ftp} with it---you -can even read news with it! - -Gnus tries to empower people who read news the same way Emacs empowers -people who edit text. Gnus sets no limits to what the user should be -allowed to do. Users are encouraged to extend Gnus to make it behave -like they want it to behave. A program should not control people; -people should be empowered to do what they want by using (or abusing) -the program. - -@end iftex - -@menu -* Starting Up:: Finding news can be a pain. -* Group Buffer:: Selecting, subscribing and killing groups. -* Summary Buffer:: Reading, saving and posting articles. -* Article Buffer:: Displaying and handling articles. -* Composing Messages:: Information on sending mail and news. -* Select Methods:: Gnus reads all messages from various select methods. -* Scoring:: Assigning values to articles. -* Various:: General purpose settings. -* The End:: Farewell and goodbye. -* Appendices:: Terminology, Emacs intro, @acronym{FAQ}, History, Internals. -* GNU Free Documentation License:: The license for this documentation. -* Index:: Variable, function and concept index. -* Key Index:: Key Index. - -Other related manuals - -* Message:(message). Composing messages. -* Emacs-MIME:(emacs-mime). Composing messages; @acronym{MIME}-specific parts. -* Sieve:(sieve). Managing Sieve scripts in Emacs. -* PGG:(pgg). @acronym{PGP/MIME} with Gnus. - -@detailmenu - --- The Detailed Node Listing --- - -Starting Gnus - -* Finding the News:: Choosing a method for getting news. -* The First Time:: What does Gnus do the first time you start it? -* The Server is Down:: How can I read my mail then? -* Slave Gnusae:: You can have more than one Gnus active at a time. -* Fetching a Group:: Starting Gnus just to read a group. -* New Groups:: What is Gnus supposed to do with new groups? -* Changing Servers:: You may want to move from one server to another. -* Startup Files:: Those pesky startup files---@file{.newsrc}. -* Auto Save:: Recovering from a crash. -* The Active File:: Reading the active file over a slow line Takes Time. -* Startup Variables:: Other variables you might change. - -New Groups - -* Checking New Groups:: Determining what groups are new. -* Subscription Methods:: What Gnus should do with new groups. -* Filtering New Groups:: Making Gnus ignore certain new groups. - -Group Buffer - -* Group Buffer Format:: Information listed and how you can change it. -* Group Maneuvering:: Commands for moving in the group buffer. -* Selecting a Group:: Actually reading news. -* Subscription Commands:: Unsubscribing, killing, subscribing. -* Group Data:: Changing the info for a group. -* Group Levels:: Levels? What are those, then? -* Group Score:: A mechanism for finding out what groups you like. -* Marking Groups:: You can mark groups for later processing. -* Foreign Groups:: Creating and editing groups. -* Group Parameters:: Each group may have different parameters set. -* Listing Groups:: Gnus can list various subsets of the groups. -* Sorting Groups:: Re-arrange the group order. -* Group Maintenance:: Maintaining a tidy @file{.newsrc} file. -* Browse Foreign Server:: You can browse a server. See what it has to offer. -* Exiting Gnus:: Stop reading news and get some work done. -* Group Topics:: A folding group mode divided into topics. -* Misc Group Stuff:: Other stuff that you can to do. - -Group Buffer Format - -* Group Line Specification:: Deciding how the group buffer is to look. -* Group Mode Line Specification:: The group buffer mode line. -* Group Highlighting:: Having nice colors in the group buffer. - -Group Topics - -* Topic Commands:: Interactive E-Z commands. -* Topic Variables:: How to customize the topics the Lisp Way. -* Topic Sorting:: Sorting each topic individually. -* Topic Topology:: A map of the world. -* Topic Parameters:: Parameters that apply to all groups in a topic. - -Misc Group Stuff - -* Scanning New Messages:: Asking Gnus to see whether new messages have arrived. -* Group Information:: Information and help on groups and Gnus. -* Group Timestamp:: Making Gnus keep track of when you last read a group. -* File Commands:: Reading and writing the Gnus files. -* Sieve Commands:: Managing Sieve scripts. - -Summary Buffer - -* Summary Buffer Format:: Deciding how the summary buffer is to look. -* Summary Maneuvering:: Moving around the summary buffer. -* Choosing Articles:: Reading articles. -* Paging the Article:: Scrolling the current article. -* Reply Followup and Post:: Posting articles. -* Delayed Articles:: Send articles at a later time. -* Marking Articles:: Marking articles as read, expirable, etc. -* Limiting:: You can limit the summary buffer. -* Threading:: How threads are made. -* Sorting the Summary Buffer:: How articles and threads are sorted. -* Asynchronous Fetching:: Gnus might be able to pre-fetch articles. -* Article Caching:: You may store articles in a cache. -* Persistent Articles:: Making articles expiry-resistant. -* Article Backlog:: Having already read articles hang around. -* Saving Articles:: Ways of customizing article saving. -* Decoding Articles:: Gnus can treat series of (uu)encoded articles. -* Article Treatment:: The article buffer can be mangled at will. -* MIME Commands:: Doing MIMEy things with the articles. -* Charsets:: Character set issues. -* Article Commands:: Doing various things with the article buffer. -* Summary Sorting:: Sorting the summary buffer in various ways. -* Finding the Parent:: No child support? Get the parent. -* Alternative Approaches:: Reading using non-default summaries. -* Tree Display:: A more visual display of threads. -* Mail Group Commands:: Some commands can only be used in mail groups. -* Various Summary Stuff:: What didn't fit anywhere else. -* Exiting the Summary Buffer:: Returning to the Group buffer, - or reselecting the current group. -* Crosspost Handling:: How crossposted articles are dealt with. -* Duplicate Suppression:: An alternative when crosspost handling fails. -* Security:: Decrypt and Verify. -* Mailing List:: Mailing list minor mode. - -Summary Buffer Format - -* Summary Buffer Lines:: You can specify how summary lines should look. -* To From Newsgroups:: How to not display your own name. -* Summary Buffer Mode Line:: You can say how the mode line should look. -* Summary Highlighting:: Making the summary buffer all pretty and nice. - -Choosing Articles - -* Choosing Commands:: Commands for choosing articles. -* Choosing Variables:: Variables that influence these commands. - -Reply, Followup and Post - -* Summary Mail Commands:: Sending mail. -* Summary Post Commands:: Sending news. -* Summary Message Commands:: Other Message-related commands. -* Canceling and Superseding:: - -Marking Articles - -* Unread Articles:: Marks for unread articles. -* Read Articles:: Marks for read articles. -* Other Marks:: Marks that do not affect readedness. -* Setting Marks:: How to set and remove marks. -* Generic Marking Commands:: How to customize the marking. -* Setting Process Marks:: How to mark articles for later processing. - -Threading - -* Customizing Threading:: Variables you can change to affect the threading. -* Thread Commands:: Thread based commands in the summary buffer. - -Customizing Threading - -* Loose Threads:: How Gnus gathers loose threads into bigger threads. -* Filling In Threads:: Making the threads displayed look fuller. -* More Threading:: Even more variables for fiddling with threads. -* Low-Level Threading:: You thought it was over@dots{} but you were wrong! - -Decoding Articles - -* Uuencoded Articles:: Uudecode articles. -* Shell Archives:: Unshar articles. -* PostScript Files:: Split PostScript. -* Other Files:: Plain save and binhex. -* Decoding Variables:: Variables for a happy decoding. -* Viewing Files:: You want to look at the result of the decoding? - -Decoding Variables - -* Rule Variables:: Variables that say how a file is to be viewed. -* Other Decode Variables:: Other decode variables. -* Uuencoding and Posting:: Variables for customizing uuencoding. - -Article Treatment - -* Article Highlighting:: You want to make the article look like fruit salad. -* Article Fontisizing:: Making emphasized text look nice. -* Article Hiding:: You also want to make certain info go away. -* Article Washing:: Lots of way-neat functions to make life better. -* Article Header:: Doing various header transformations. -* Article Buttons:: Click on URLs, Message-IDs, addresses and the like. -* Article Button Levels:: Controlling appearance of buttons. -* Article Date:: Grumble, UT! -* Article Display:: Display various stuff---X-Face, Picons, Smileys -* Article Signature:: What is a signature? -* Article Miscellanea:: Various other stuff. - -Alternative Approaches - -* Pick and Read:: First mark articles and then read them. -* Binary Groups:: Auto-decode all articles. - -Various Summary Stuff - -* Summary Group Information:: Information oriented commands. -* Searching for Articles:: Multiple article commands. -* Summary Generation Commands:: -* Really Various Summary Commands:: Those pesky non-conformant commands. - -Article Buffer - -* Hiding Headers:: Deciding what headers should be displayed. -* Using MIME:: Pushing articles through @acronym{MIME} before reading them. -* Customizing Articles:: Tailoring the look of the articles. -* Article Keymap:: Keystrokes available in the article buffer. -* Misc Article:: Other stuff. - -Composing Messages - -* Mail:: Mailing and replying. -* Posting Server:: What server should you post and mail via? -* POP before SMTP:: You cannot send a mail unless you read a mail. -* Mail and Post:: Mailing and posting at the same time. -* Archived Messages:: Where Gnus stores the messages you've sent. -* Posting Styles:: An easier way to specify who you are. -* Drafts:: Postponing messages and rejected messages. -* Rejected Articles:: What happens if the server doesn't like your article? -* Signing and encrypting:: How to compose secure messages. - -Select Methods - -* Server Buffer:: Making and editing virtual servers. -* Getting News:: Reading USENET news with Gnus. -* Getting Mail:: Reading your personal mail with Gnus. -* Browsing the Web:: Getting messages from a plethora of Web sources. -* IMAP:: Using Gnus as a @acronym{IMAP} client. -* Other Sources:: Reading directories, files, SOUP packets. -* Combined Groups:: Combining groups into one group. -* Email Based Diary:: Using mails to manage diary events in Gnus. -* Gnus Unplugged:: Reading news and mail offline. - -Server Buffer - -* Server Buffer Format:: You can customize the look of this buffer. -* Server Commands:: Commands to manipulate servers. -* Example Methods:: Examples server specifications. -* Creating a Virtual Server:: An example session. -* Server Variables:: Which variables to set. -* Servers and Methods:: You can use server names as select methods. -* Unavailable Servers:: Some servers you try to contact may be down. - -Getting News - -* NNTP:: Reading news from an @acronym{NNTP} server. -* News Spool:: Reading news from the local spool. - -@acronym{NNTP} - -* Direct Functions:: Connecting directly to the server. -* Indirect Functions:: Connecting indirectly to the server. -* Common Variables:: Understood by several connection functions. - -Getting Mail - -* Mail in a Newsreader:: Important introductory notes. -* Getting Started Reading Mail:: A simple cookbook example. -* Splitting Mail:: How to create mail groups. -* Mail Sources:: How to tell Gnus where to get mail from. -* Mail Back End Variables:: Variables for customizing mail handling. -* Fancy Mail Splitting:: Gnus can do hairy splitting of incoming mail. -* Group Mail Splitting:: Use group customize to drive mail splitting. -* Incorporating Old Mail:: What about the old mail you have? -* Expiring Mail:: Getting rid of unwanted mail. -* Washing Mail:: Removing cruft from the mail you get. -* Duplicates:: Dealing with duplicated mail. -* Not Reading Mail:: Using mail back ends for reading other files. -* Choosing a Mail Back End:: Gnus can read a variety of mail formats. - -Mail Sources - -* Mail Source Specifiers:: How to specify what a mail source is. -* Mail Source Customization:: Some variables that influence things. -* Fetching Mail:: Using the mail source specifiers. - -Choosing a Mail Back End - -* Unix Mail Box:: Using the (quite) standard Un*x mbox. -* Rmail Babyl:: Emacs programs use the Rmail Babyl format. -* Mail Spool:: Store your mail in a private spool? -* MH Spool:: An mhspool-like back end. -* Maildir:: Another one-file-per-message format. -* Mail Folders:: Having one file for each group. -* Comparing Mail Back Ends:: An in-depth looks at pros and cons. - -Browsing the Web - -* Archiving Mail:: -* Web Searches:: Creating groups from articles that match a string. -* Slashdot:: Reading the Slashdot comments. -* Ultimate:: The Ultimate Bulletin Board systems. -* Web Archive:: Reading mailing list archived on web. -* RSS:: Reading RDF site summary. -* Customizing W3:: Doing stuff to Emacs/W3 from Gnus. - -@acronym{IMAP} - -* Splitting in IMAP:: Splitting mail with nnimap. -* Expiring in IMAP:: Expiring mail with nnimap. -* Editing IMAP ACLs:: Limiting/enabling other users access to a mailbox. -* Expunging mailboxes:: Equivalent of a ``compress mailbox'' button. -* A note on namespaces:: How to (not) use @acronym{IMAP} namespace in Gnus. -* Debugging IMAP:: What to do when things don't work. - -Other Sources - -* Directory Groups:: You can read a directory as if it was a newsgroup. -* Anything Groups:: Dired? Who needs dired? -* Document Groups:: Single files can be the basis of a group. -* SOUP:: Reading @sc{soup} packets ``offline''. -* Mail-To-News Gateways:: Posting articles via mail-to-news gateways. - -Document Groups - -* Document Server Internals:: How to add your own document types. - -SOUP - -* SOUP Commands:: Commands for creating and sending @sc{soup} packets -* SOUP Groups:: A back end for reading @sc{soup} packets. -* SOUP Replies:: How to enable @code{nnsoup} to take over mail and news. - -Combined Groups - -* Virtual Groups:: Combining articles from many groups. -* Kibozed Groups:: Looking through parts of the newsfeed for articles. - -Email Based Diary - -* The NNDiary Back End:: Basic setup and usage. -* The Gnus Diary Library:: Utility toolkit on top of nndiary. -* Sending or Not Sending:: A final note on sending diary messages. - -The NNDiary Back End - -* Diary Messages:: What makes a message valid for nndiary. -* Running NNDiary:: NNDiary has two modes of operation. -* Customizing NNDiary:: Bells and whistles. - -The Gnus Diary Library - -* Diary Summary Line Format:: A nicer summary buffer line format. -* Diary Articles Sorting:: A nicer way to sort messages. -* Diary Headers Generation:: Not doing it manually. -* Diary Group Parameters:: Not handling them manually. - -Gnus Unplugged - -* Agent Basics:: How it all is supposed to work. -* Agent Categories:: How to tell the Gnus Agent what to download. -* Agent Commands:: New commands for all the buffers. -* Agent Visuals:: Ways that the agent may effect your summary buffer. -* Agent as Cache:: The Agent is a big cache too. -* Agent Expiry:: How to make old articles go away. -* Agent Regeneration:: How to recover from lost connections and other accidents. -* Agent and IMAP:: How to use the Agent with @acronym{IMAP}. -* Outgoing Messages:: What happens when you post/mail something? -* Agent Variables:: Customizing is fun. -* Example Setup:: An example @file{~/.gnus.el} file for offline people. -* Batching Agents:: How to fetch news from a @code{cron} job. -* Agent Caveats:: What you think it'll do and what it does. - -Agent Categories - -* Category Syntax:: What a category looks like. -* Category Buffer:: A buffer for maintaining categories. -* Category Variables:: Customize'r'Us. - -Agent Commands - -* Group Agent Commands:: Configure groups and fetch their contents. -* Summary Agent Commands:: Manually select then fetch specific articles. -* Server Agent Commands:: Select the servers that are supported by the agent. - -Scoring - -* Summary Score Commands:: Adding score entries for the current group. -* Group Score Commands:: General score commands. -* Score Variables:: Customize your scoring. (My, what terminology). -* Score File Format:: What a score file may contain. -* Score File Editing:: You can edit score files by hand as well. -* Adaptive Scoring:: Big Sister Gnus knows what you read. -* Home Score File:: How to say where new score entries are to go. -* Followups To Yourself:: Having Gnus notice when people answer you. -* Scoring On Other Headers:: Scoring on non-standard headers. -* Scoring Tips:: How to score effectively. -* Reverse Scoring:: That problem child of old is not problem. -* Global Score Files:: Earth-spanning, ear-splitting score files. -* Kill Files:: They are still here, but they can be ignored. -* Converting Kill Files:: Translating kill files to score files. -* GroupLens:: Getting predictions on what you like to read. -* Advanced Scoring:: Using logical expressions to build score rules. -* Score Decays:: It can be useful to let scores wither away. - -GroupLens - -* Using GroupLens:: How to make Gnus use GroupLens. -* Rating Articles:: Letting GroupLens know how you rate articles. -* Displaying Predictions:: Displaying predictions given by GroupLens. -* GroupLens Variables:: Customizing GroupLens. - -Advanced Scoring - -* Advanced Scoring Syntax:: A definition. -* Advanced Scoring Examples:: What they look like. -* Advanced Scoring Tips:: Getting the most out of it. - -Various - -* Process/Prefix:: A convention used by many treatment commands. -* Interactive:: Making Gnus ask you many questions. -* Symbolic Prefixes:: How to supply some Gnus functions with options. -* Formatting Variables:: You can specify what buffers should look like. -* Window Layout:: Configuring the Gnus buffer windows. -* Faces and Fonts:: How to change how faces look. -* Compilation:: How to speed Gnus up. -* Mode Lines:: Displaying information in the mode lines. -* Highlighting and Menus:: Making buffers look all nice and cozy. -* Buttons:: Get tendinitis in ten easy steps! -* Daemons:: Gnus can do things behind your back. -* NoCeM:: How to avoid spam and other fatty foods. -* Undo:: Some actions can be undone. -* Predicate Specifiers:: Specifying predicates. -* Moderation:: What to do if you're a moderator. -* Image Enhancements:: Modern versions of Emacs/XEmacs can display images. -* Fuzzy Matching:: What's the big fuzz? -* Thwarting Email Spam:: Simple ways to avoid unsolicited commercial email. -* Spam Package:: A package for filtering and processing spam. -* Other modes:: Interaction with other modes. -* Various Various:: Things that are really various. - -Formatting Variables - -* Formatting Basics:: A formatting variable is basically a format string. -* Mode Line Formatting:: Some rules about mode line formatting variables. -* Advanced Formatting:: Modifying output in various ways. -* User-Defined Specs:: Having Gnus call your own functions. -* Formatting Fonts:: Making the formatting look colorful and nice. -* Positioning Point:: Moving point to a position after an operation. -* Tabulation:: Tabulating your output. -* Wide Characters:: Dealing with wide characters. - -Image Enhancements - -* X-Face:: Display a funky, teensy black-and-white image. -* Face:: Display a funkier, teensier colored image. -* Smileys:: Show all those happy faces the way they were - meant to be shown. -* Picons:: How to display pictures of what you're reading. -* XVarious:: Other XEmacsy Gnusey variables. - -Thwarting Email Spam - -* The problem of spam:: Some background, and some solutions -* Anti-Spam Basics:: Simple steps to reduce the amount of spam. -* SpamAssassin:: How to use external anti-spam tools. -* Hashcash:: Reduce spam by burning CPU time. - -Spam Package - -* Spam Package Introduction:: -* Filtering Incoming Mail:: -* Detecting Spam in Groups:: -* Spam and Ham Processors:: -* Spam Package Configuration Examples:: -* Spam Back Ends:: -* Extending the Spam package:: -* Spam Statistics Package:: - -Spam Statistics Package - -* Creating a spam-stat dictionary:: -* Splitting mail using spam-stat:: -* Low-level interface to the spam-stat dictionary:: - -Appendices - -* XEmacs:: Requirements for installing under XEmacs. -* History:: How Gnus got where it is today. -* On Writing Manuals:: Why this is not a beginner's guide. -* Terminology:: We use really difficult, like, words here. -* Customization:: Tailoring Gnus to your needs. -* Troubleshooting:: What you might try if things do not work. -* Gnus Reference Guide:: Rilly, rilly technical stuff. -* Emacs for Heathens:: A short introduction to Emacsian terms. -* Frequently Asked Questions:: The Gnus FAQ - -History - -* Gnus Versions:: What Gnus versions have been released. -* Other Gnus Versions:: Other Gnus versions that also have been released. -* Why?:: What's the point of Gnus? -* Compatibility:: Just how compatible is Gnus with @sc{gnus}? -* Conformity:: Gnus tries to conform to all standards. -* Emacsen:: Gnus can be run on a few modern Emacsen. -* Gnus Development:: How Gnus is developed. -* Contributors:: Oodles of people. -* New Features:: Pointers to some of the new stuff in Gnus. - -New Features - -* ding Gnus:: New things in Gnus 5.0/5.1, the first new Gnus. -* September Gnus:: The Thing Formally Known As Gnus 5.2/5.3. -* Red Gnus:: Third time best---Gnus 5.4/5.5. -* Quassia Gnus:: Two times two is four, or Gnus 5.6/5.7. -* Pterodactyl Gnus:: Pentad also starts with P, AKA Gnus 5.8/5.9. -* Oort Gnus:: It's big. It's far out. Gnus 5.10/5.11. - -Customization - -* Slow/Expensive Connection:: You run a local Emacs and get the news elsewhere. -* Slow Terminal Connection:: You run a remote Emacs. -* Little Disk Space:: You feel that having large setup files is icky. -* Slow Machine:: You feel like buying a faster machine. - -Gnus Reference Guide - -* Gnus Utility Functions:: Common functions and variable to use. -* Back End Interface:: How Gnus communicates with the servers. -* Score File Syntax:: A BNF definition of the score file standard. -* Headers:: How Gnus stores headers internally. -* Ranges:: A handy format for storing mucho numbers. -* Group Info:: The group info format. -* Extended Interactive:: Symbolic prefixes and stuff. -* Emacs/XEmacs Code:: Gnus can be run under all modern Emacsen. -* Various File Formats:: Formats of files that Gnus use. - -Back End Interface - -* Required Back End Functions:: Functions that must be implemented. -* Optional Back End Functions:: Functions that need not be implemented. -* Error Messaging:: How to get messages and report errors. -* Writing New Back Ends:: Extending old back ends. -* Hooking New Back Ends Into Gnus:: What has to be done on the Gnus end. -* Mail-like Back Ends:: Some tips on mail back ends. - -Various File Formats - -* Active File Format:: Information on articles and groups available. -* Newsgroups File Format:: Group descriptions. - -Emacs for Heathens - -* Keystrokes:: Entering text and executing commands. -* Emacs Lisp:: The built-in Emacs programming language. - -@end detailmenu -@end menu - -@node Starting Up -@chapter Starting Gnus -@cindex starting up - -If you haven't used Emacs much before using Gnus, read @ref{Emacs for -Heathens} first. - -@kindex M-x gnus -@findex gnus -If your system administrator has set things up properly, starting Gnus -and reading news is extremely easy---you just type @kbd{M-x gnus} in -your Emacs. If not, you should customize the variable -@code{gnus-select-method} as described in @ref{Finding the News}. For a -minimal setup for posting should also customize the variables -@code{user-full-name} and @code{user-mail-address}. - -@findex gnus-other-frame -@kindex M-x gnus-other-frame -If you want to start Gnus in a different frame, you can use the command -@kbd{M-x gnus-other-frame} instead. - -If things do not go smoothly at startup, you have to twiddle some -variables in your @file{~/.gnus.el} file. This file is similar to -@file{~/.emacs}, but is read when Gnus starts. - -If you puzzle at any terms used in this manual, please refer to the -terminology section (@pxref{Terminology}). - -@menu -* Finding the News:: Choosing a method for getting news. -* The First Time:: What does Gnus do the first time you start it? -* The Server is Down:: How can I read my mail then? -* Slave Gnusae:: You can have more than one Gnus active at a time. -* New Groups:: What is Gnus supposed to do with new groups? -* Changing Servers:: You may want to move from one server to another. -* Startup Files:: Those pesky startup files---@file{.newsrc}. -* Auto Save:: Recovering from a crash. -* The Active File:: Reading the active file over a slow line Takes Time. -* Startup Variables:: Other variables you might change. -@end menu - - -@node Finding the News -@section Finding the News -@cindex finding news - -@vindex gnus-select-method -@c @head -The @code{gnus-select-method} variable says where Gnus should look for -news. This variable should be a list where the first element says -@dfn{how} and the second element says @dfn{where}. This method is your -native method. All groups not fetched with this method are -foreign groups. - -For instance, if the @samp{news.somewhere.edu} @acronym{NNTP} server is where -you want to get your daily dosage of news from, you'd say: - -@lisp -(setq gnus-select-method '(nntp "news.somewhere.edu")) -@end lisp - -If you want to read directly from the local spool, say: - -@lisp -(setq gnus-select-method '(nnspool "")) -@end lisp - -If you can use a local spool, you probably should, as it will almost -certainly be much faster. But do not use the local spool if your -server is running Leafnode (which is a simple, standalone private news -server); in this case, use @code{(nntp "localhost")}. - -@vindex gnus-nntpserver-file -@cindex NNTPSERVER -@cindex @acronym{NNTP} server -If this variable is not set, Gnus will take a look at the -@env{NNTPSERVER} environment variable. If that variable isn't set, -Gnus will see whether @code{gnus-nntpserver-file} -(@file{/etc/nntpserver} by default) has any opinions on the matter. -If that fails as well, Gnus will try to use the machine running Emacs -as an @acronym{NNTP} server. That's a long shot, though. - -@vindex gnus-nntp-server -If @code{gnus-nntp-server} is set, this variable will override -@code{gnus-select-method}. You should therefore set -@code{gnus-nntp-server} to @code{nil}, which is what it is by default. - -@vindex gnus-secondary-servers -@vindex gnus-nntp-server -You can also make Gnus prompt you interactively for the name of an -@acronym{NNTP} server. If you give a non-numerical prefix to @code{gnus} -(i.e., @kbd{C-u M-x gnus}), Gnus will let you choose between the servers -in the @code{gnus-secondary-servers} list (if any). You can also just -type in the name of any server you feel like visiting. (Note that this -will set @code{gnus-nntp-server}, which means that if you then @kbd{M-x -gnus} later in the same Emacs session, Gnus will contact the same -server.) - -@findex gnus-group-browse-foreign-server -@kindex B (Group) -However, if you use one @acronym{NNTP} server regularly and are just -interested in a couple of groups from a different server, you would be -better served by using the @kbd{B} command in the group buffer. It will -let you have a look at what groups are available, and you can subscribe -to any of the groups you want to. This also makes @file{.newsrc} -maintenance much tidier. @xref{Foreign Groups}. - -@vindex gnus-secondary-select-methods -@c @head -A slightly different approach to foreign groups is to set the -@code{gnus-secondary-select-methods} variable. The select methods -listed in this variable are in many ways just as native as the -@code{gnus-select-method} server. They will also be queried for active -files during startup (if that's required), and new newsgroups that -appear on these servers will be subscribed (or not) just as native -groups are. - -For instance, if you use the @code{nnmbox} back end to read your mail, -you would typically set this variable to - -@lisp -(setq gnus-secondary-select-methods '((nnmbox ""))) -@end lisp - - -@node The First Time -@section The First Time -@cindex first time usage - -If no startup files exist (@pxref{Startup Files}), Gnus will try to -determine what groups should be subscribed by default. - -@vindex gnus-default-subscribed-newsgroups -If the variable @code{gnus-default-subscribed-newsgroups} is set, Gnus -will subscribe you to just those groups in that list, leaving the rest -killed. Your system administrator should have set this variable to -something useful. - -Since she hasn't, Gnus will just subscribe you to a few arbitrarily -picked groups (i.e., @samp{*.newusers}). (@dfn{Arbitrary} is defined -here as @dfn{whatever Lars thinks you should read}.) - -You'll also be subscribed to the Gnus documentation group, which should -help you with most common problems. - -If @code{gnus-default-subscribed-newsgroups} is @code{t}, Gnus will just -use the normal functions for handling new groups, and not do anything -special. - - -@node The Server is Down -@section The Server is Down -@cindex server errors - -If the default server is down, Gnus will understandably have some -problems starting. However, if you have some mail groups in addition to -the news groups, you may want to start Gnus anyway. - -Gnus, being the trusting sort of program, will ask whether to proceed -without a native select method if that server can't be contacted. This -will happen whether the server doesn't actually exist (i.e., you have -given the wrong address) or the server has just momentarily taken ill -for some reason or other. If you decide to continue and have no foreign -groups, you'll find it difficult to actually do anything in the group -buffer. But, hey, that's your problem. Blllrph! - -@findex gnus-no-server -@kindex M-x gnus-no-server -@c @head -If you know that the server is definitely down, or you just want to read -your mail without bothering with the server at all, you can use the -@code{gnus-no-server} command to start Gnus. That might come in handy -if you're in a hurry as well. This command will not attempt to contact -your primary server---instead, it will just activate all groups on level -1 and 2. (You should preferably keep no native groups on those two -levels.) Also @pxref{Group Levels}. - - -@node Slave Gnusae -@section Slave Gnusae -@cindex slave - -You might want to run more than one Emacs with more than one Gnus at the -same time. If you are using different @file{.newsrc} files (e.g., if you -are using the two different Gnusae to read from two different servers), -that is no problem whatsoever. You just do it. - -The problem appears when you want to run two Gnusae that use the same -@file{.newsrc} file. - -To work around that problem some, we here at the Think-Tank at the Gnus -Towers have come up with a new concept: @dfn{Masters} and -@dfn{slaves}. (We have applied for a patent on this concept, and have -taken out a copyright on those words. If you wish to use those words in -conjunction with each other, you have to send $1 per usage instance to -me. Usage of the patent (@dfn{Master/Slave Relationships In Computer -Applications}) will be much more expensive, of course.) - -@findex gnus-slave -Anyway, you start one Gnus up the normal way with @kbd{M-x gnus} (or -however you do it). Each subsequent slave Gnusae should be started with -@kbd{M-x gnus-slave}. These slaves won't save normal @file{.newsrc} -files, but instead save @dfn{slave files} that contain information only -on what groups have been read in the slave session. When a master Gnus -starts, it will read (and delete) these slave files, incorporating all -information from them. (The slave files will be read in the sequence -they were created, so the latest changes will have precedence.) - -Information from the slave files has, of course, precedence over the -information in the normal (i.e., master) @file{.newsrc} file. - -If the @file{.newsrc*} files have not been saved in the master when the -slave starts, you may be prompted as to whether to read an auto-save -file. If you answer ``yes'', the unsaved changes to the master will be -incorporated into the slave. If you answer ``no'', the slave may see some -messages as unread that have been read in the master. - - - -@node New Groups -@section New Groups -@cindex new groups -@cindex subscription - -@vindex gnus-check-new-newsgroups -If you are satisfied that you really never want to see any new groups, -you can set @code{gnus-check-new-newsgroups} to @code{nil}. This will -also save you some time at startup. Even if this variable is -@code{nil}, you can always subscribe to the new groups just by pressing -@kbd{U} in the group buffer (@pxref{Group Maintenance}). This variable -is @code{ask-server} by default. If you set this variable to -@code{always}, then Gnus will query the back ends for new groups even -when you do the @kbd{g} command (@pxref{Scanning New Messages}). - -@menu -* Checking New Groups:: Determining what groups are new. -* Subscription Methods:: What Gnus should do with new groups. -* Filtering New Groups:: Making Gnus ignore certain new groups. -@end menu - - -@node Checking New Groups -@subsection Checking New Groups - -Gnus normally determines whether a group is new or not by comparing the -list of groups from the active file(s) with the lists of subscribed and -dead groups. This isn't a particularly fast method. If -@code{gnus-check-new-newsgroups} is @code{ask-server}, Gnus will ask the -server for new groups since the last time. This is both faster and -cheaper. This also means that you can get rid of the list of killed -groups altogether, so you may set @code{gnus-save-killed-list} to -@code{nil}, which will save time both at startup, at exit, and all over. -Saves disk space, too. Why isn't this the default, then? -Unfortunately, not all servers support this command. - -I bet I know what you're thinking now: How do I find out whether my -server supports @code{ask-server}? No? Good, because I don't have a -fail-safe answer. I would suggest just setting this variable to -@code{ask-server} and see whether any new groups appear within the next -few days. If any do, then it works. If none do, then it doesn't -work. I could write a function to make Gnus guess whether the server -supports @code{ask-server}, but it would just be a guess. So I won't. -You could @code{telnet} to the server and say @code{HELP} and see -whether it lists @samp{NEWGROUPS} among the commands it understands. If -it does, then it might work. (But there are servers that lists -@samp{NEWGROUPS} without supporting the function properly.) - -This variable can also be a list of select methods. If so, Gnus will -issue an @code{ask-server} command to each of the select methods, and -subscribe them (or not) using the normal methods. This might be handy -if you are monitoring a few servers for new groups. A side effect is -that startup will take much longer, so you can meditate while waiting. -Use the mantra ``dingnusdingnusdingnus'' to achieve permanent bliss. - - -@node Subscription Methods -@subsection Subscription Methods - -@vindex gnus-subscribe-newsgroup-method -What Gnus does when it encounters a new group is determined by the -@code{gnus-subscribe-newsgroup-method} variable. - -This variable should contain a function. This function will be called -with the name of the new group as the only parameter. - -Some handy pre-fab functions are: - -@table @code - -@item gnus-subscribe-zombies -@vindex gnus-subscribe-zombies -Make all new groups zombies. This is the default. You can browse the -zombies later (with @kbd{A z}) and either kill them all off properly -(with @kbd{S z}), or subscribe to them (with @kbd{u}). - -@item gnus-subscribe-randomly -@vindex gnus-subscribe-randomly -Subscribe all new groups in arbitrary order. This really means that all -new groups will be added at ``the top'' of the group buffer. - -@item gnus-subscribe-alphabetically -@vindex gnus-subscribe-alphabetically -Subscribe all new groups in alphabetical order. - -@item gnus-subscribe-hierarchically -@vindex gnus-subscribe-hierarchically -Subscribe all new groups hierarchically. The difference between this -function and @code{gnus-subscribe-alphabetically} is slight. -@code{gnus-subscribe-alphabetically} will subscribe new groups in a strictly -alphabetical fashion, while this function will enter groups into its -hierarchy. So if you want to have the @samp{rec} hierarchy before the -@samp{comp} hierarchy, this function will not mess that configuration -up. Or something like that. - -@item gnus-subscribe-interactively -@vindex gnus-subscribe-interactively -Subscribe new groups interactively. This means that Gnus will ask -you about @strong{all} new groups. The groups you choose to subscribe -to will be subscribed hierarchically. - -@item gnus-subscribe-killed -@vindex gnus-subscribe-killed -Kill all new groups. - -@item gnus-subscribe-topics -@vindex gnus-subscribe-topics -Put the groups into the topic that has a matching @code{subscribe} topic -parameter (@pxref{Topic Parameters}). For instance, a @code{subscribe} -topic parameter that looks like - -@example -"nnslashdot" -@end example - -will mean that all groups that match that regex will be subscribed under -that topic. - -If no topics match the groups, the groups will be subscribed in the -top-level topic. - -@end table - -@vindex gnus-subscribe-hierarchical-interactive -A closely related variable is -@code{gnus-subscribe-hierarchical-interactive}. (That's quite a -mouthful.) If this variable is non-@code{nil}, Gnus will ask you in a -hierarchical fashion whether to subscribe to new groups or not. Gnus -will ask you for each sub-hierarchy whether you want to descend the -hierarchy or not. - -One common mistake is to set the variable a few paragraphs above -(@code{gnus-subscribe-newsgroup-method}) to -@code{gnus-subscribe-hierarchical-interactive}. This is an error. This -will not work. This is ga-ga. So don't do it. - - -@node Filtering New Groups -@subsection Filtering New Groups - -A nice and portable way to control which new newsgroups should be -subscribed (or ignored) is to put an @dfn{options} line at the start of -the @file{.newsrc} file. Here's an example: - -@example -options -n !alt.all !rec.all sci.all -@end example - -@vindex gnus-subscribe-options-newsgroup-method -This line obviously belongs to a serious-minded intellectual scientific -person (or she may just be plain old boring), because it says that all -groups that have names beginning with @samp{alt} and @samp{rec} should -be ignored, and all groups with names beginning with @samp{sci} should -be subscribed. Gnus will not use the normal subscription method for -subscribing these groups. -@code{gnus-subscribe-options-newsgroup-method} is used instead. This -variable defaults to @code{gnus-subscribe-alphabetically}. - -@vindex gnus-options-not-subscribe -@vindex gnus-options-subscribe -If you don't want to mess with your @file{.newsrc} file, you can just -set the two variables @code{gnus-options-subscribe} and -@code{gnus-options-not-subscribe}. These two variables do exactly the -same as the @file{.newsrc} @samp{options -n} trick. Both are regexps, -and if the new group matches the former, it will be unconditionally -subscribed, and if it matches the latter, it will be ignored. - -@vindex gnus-auto-subscribed-groups -Yet another variable that meddles here is -@code{gnus-auto-subscribed-groups}. It works exactly like -@code{gnus-options-subscribe}, and is therefore really superfluous, -but I thought it would be nice to have two of these. This variable is -more meant for setting some ground rules, while the other variable is -used more for user fiddling. By default this variable makes all new -groups that come from mail back ends (@code{nnml}, @code{nnbabyl}, -@code{nnfolder}, @code{nnmbox}, @code{nnmh}, and @code{nnmaildir}) -subscribed. If you don't like that, just set this variable to -@code{nil}. - -New groups that match this regexp are subscribed using -@code{gnus-subscribe-options-newsgroup-method}. - - -@node Changing Servers -@section Changing Servers -@cindex changing servers - -Sometimes it is necessary to move from one @acronym{NNTP} server to another. -This happens very rarely, but perhaps you change jobs, or one server is -very flaky and you want to use another. - -Changing the server is pretty easy, right? You just change -@code{gnus-select-method} to point to the new server? - -@emph{Wrong!} - -Article numbers are not (in any way) kept synchronized between different -@acronym{NNTP} servers, and the only way Gnus keeps track of what articles -you have read is by keeping track of article numbers. So when you -change @code{gnus-select-method}, your @file{.newsrc} file becomes -worthless. - -Gnus provides a few functions to attempt to translate a @file{.newsrc} -file from one server to another. They all have one thing in -common---they take a looong time to run. You don't want to use these -functions more than absolutely necessary. - -@kindex M-x gnus-change-server -@findex gnus-change-server -If you have access to both servers, Gnus can request the headers for all -the articles you have read and compare @code{Message-ID}s and map the -article numbers of the read articles and article marks. The @kbd{M-x -gnus-change-server} command will do this for all your native groups. It -will prompt for the method you want to move to. - -@kindex M-x gnus-group-move-group-to-server -@findex gnus-group-move-group-to-server -You can also move individual groups with the @kbd{M-x -gnus-group-move-group-to-server} command. This is useful if you want to -move a (foreign) group from one server to another. - -@kindex M-x gnus-group-clear-data-on-native-groups -@findex gnus-group-clear-data-on-native-groups -If you don't have access to both the old and new server, all your marks -and read ranges have become worthless. You can use the @kbd{M-x -gnus-group-clear-data-on-native-groups} command to clear out all data -that you have on your native groups. Use with caution. - -@kindex M-x gnus-group-clear-data -@findex gnus-group-clear-data -Clear the data from the current group only---nix out marks and the -list of read articles (@code{gnus-group-clear-data}). - -After changing servers, you @strong{must} move the cache hierarchy away, -since the cached articles will have wrong article numbers, which will -affect which articles Gnus thinks are read. -@code{gnus-group-clear-data-on-native-groups} will ask you if you want -to have it done automatically; for @code{gnus-group-clear-data}, you -can use @kbd{M-x gnus-cache-move-cache} (but beware, it will move the -cache for all groups). - - -@node Startup Files -@section Startup Files -@cindex startup files -@cindex .newsrc -@cindex .newsrc.el -@cindex .newsrc.eld - -Most common Unix news readers use a shared startup file called -@file{.newsrc}. This file contains all the information about what -groups are subscribed, and which articles in these groups have been -read. - -Things got a bit more complicated with @sc{gnus}. In addition to -keeping the @file{.newsrc} file updated, it also used a file called -@file{.newsrc.el} for storing all the information that didn't fit into -the @file{.newsrc} file. (Actually, it also duplicated everything in -the @file{.newsrc} file.) @sc{gnus} would read whichever one of these -files was the most recently saved, which enabled people to swap between -@sc{gnus} and other newsreaders. - -That was kinda silly, so Gnus went one better: In addition to the -@file{.newsrc} and @file{.newsrc.el} files, Gnus also has a file called -@file{.newsrc.eld}. It will read whichever of these files that are most -recent, but it will never write a @file{.newsrc.el} file. You should -never delete the @file{.newsrc.eld} file---it contains much information -not stored in the @file{.newsrc} file. - -@vindex gnus-save-newsrc-file -@vindex gnus-read-newsrc-file -You can turn off writing the @file{.newsrc} file by setting -@code{gnus-save-newsrc-file} to @code{nil}, which means you can delete -the file and save some space, as well as exiting from Gnus faster. -However, this will make it impossible to use other newsreaders than -Gnus. But hey, who would want to, right? Similarly, setting -@code{gnus-read-newsrc-file} to @code{nil} makes Gnus ignore the -@file{.newsrc} file and any @file{.newsrc-SERVER} files, which can be -convenient if you use a different news reader occasionally, and you -want to read a different subset of the available groups with that -news reader. - -@vindex gnus-save-killed-list -If @code{gnus-save-killed-list} (default @code{t}) is @code{nil}, Gnus -will not save the list of killed groups to the startup file. This will -save both time (when starting and quitting) and space (on disk). It -will also mean that Gnus has no record of what groups are new or old, -so the automatic new groups subscription methods become meaningless. -You should always set @code{gnus-check-new-newsgroups} to @code{nil} or -@code{ask-server} if you set this variable to @code{nil} (@pxref{New -Groups}). This variable can also be a regular expression. If that's -the case, remove all groups that do not match this regexp before -saving. This can be useful in certain obscure situations that involve -several servers where not all servers support @code{ask-server}. - -@vindex gnus-startup-file -@vindex gnus-backup-startup-file -@vindex version-control -The @code{gnus-startup-file} variable says where the startup files are. -The default value is @file{~/.newsrc}, with the Gnus (El Dingo) startup -file being whatever that one is, with a @samp{.eld} appended. -If you want version control for this file, set -@code{gnus-backup-startup-file}. It respects the same values as the -@code{version-control} variable. - -@vindex gnus-save-newsrc-hook -@vindex gnus-save-quick-newsrc-hook -@vindex gnus-save-standard-newsrc-hook -@code{gnus-save-newsrc-hook} is called before saving any of the newsrc -files, while @code{gnus-save-quick-newsrc-hook} is called just before -saving the @file{.newsrc.eld} file, and -@code{gnus-save-standard-newsrc-hook} is called just before saving the -@file{.newsrc} file. The latter two are commonly used to turn version -control on or off. Version control is on by default when saving the -startup files. If you want to turn backup creation off, say something like: - -@lisp -(defun turn-off-backup () - (set (make-local-variable 'backup-inhibited) t)) - -(add-hook 'gnus-save-quick-newsrc-hook 'turn-off-backup) -(add-hook 'gnus-save-standard-newsrc-hook 'turn-off-backup) -@end lisp - -@vindex gnus-init-file -@vindex gnus-site-init-file -When Gnus starts, it will read the @code{gnus-site-init-file} -(@file{.../site-lisp/gnus-init} by default) and @code{gnus-init-file} -(@file{~/.gnus} by default) files. These are normal Emacs Lisp files -and can be used to avoid cluttering your @file{~/.emacs} and -@file{site-init} files with Gnus stuff. Gnus will also check for files -with the same names as these, but with @file{.elc} and @file{.el} -suffixes. In other words, if you have set @code{gnus-init-file} to -@file{~/.gnus}, it will look for @file{~/.gnus.elc}, @file{~/.gnus.el}, -and finally @file{~/.gnus} (in this order). If Emacs was invoked with -the @option{-q} or @option{--no-init-file} options (@pxref{Initial -Options, ,Initial Options, emacs, The Emacs Manual}), Gnus doesn't read -@code{gnus-init-file}. - - -@node Auto Save -@section Auto Save -@cindex dribble file -@cindex auto-save - -Whenever you do something that changes the Gnus data (reading articles, -catching up, killing/subscribing groups), the change is added to a -special @dfn{dribble buffer}. This buffer is auto-saved the normal -Emacs way. If your Emacs should crash before you have saved the -@file{.newsrc} files, all changes you have made can be recovered from -this file. - -If Gnus detects this file at startup, it will ask the user whether to -read it. The auto save file is deleted whenever the real startup file is -saved. - -@vindex gnus-use-dribble-file -If @code{gnus-use-dribble-file} is @code{nil}, Gnus won't create and -maintain a dribble buffer. The default is @code{t}. - -@vindex gnus-dribble-directory -Gnus will put the dribble file(s) in @code{gnus-dribble-directory}. If -this variable is @code{nil}, which it is by default, Gnus will dribble -into the directory where the @file{.newsrc} file is located. (This is -normally the user's home directory.) The dribble file will get the same -file permissions as the @file{.newsrc} file. - -@vindex gnus-always-read-dribble-file -If @code{gnus-always-read-dribble-file} is non-@code{nil}, Gnus will -read the dribble file on startup without querying the user. - - -@node The Active File -@section The Active File -@cindex active file -@cindex ignored groups - -When Gnus starts, or indeed whenever it tries to determine whether new -articles have arrived, it reads the active file. This is a very large -file that lists all the active groups and articles on the server. - -@vindex gnus-ignored-newsgroups -Before examining the active file, Gnus deletes all lines that match the -regexp @code{gnus-ignored-newsgroups}. This is done primarily to reject -any groups with bogus names, but you can use this variable to make Gnus -ignore hierarchies you aren't ever interested in. However, this is not -recommended. In fact, it's highly discouraged. Instead, @pxref{New -Groups} for an overview of other variables that can be used instead. - -@c This variable is -@c @code{nil} by default, and will slow down active file handling somewhat -@c if you set it to anything else. - -@vindex gnus-read-active-file -@c @head -The active file can be rather Huge, so if you have a slow network, you -can set @code{gnus-read-active-file} to @code{nil} to prevent Gnus from -reading the active file. This variable is @code{some} by default. - -Gnus will try to make do by getting information just on the groups that -you actually subscribe to. - -Note that if you subscribe to lots and lots of groups, setting this -variable to @code{nil} will probably make Gnus slower, not faster. At -present, having this variable @code{nil} will slow Gnus down -considerably, unless you read news over a 2400 baud modem. - -This variable can also have the value @code{some}. Gnus will then -attempt to read active info only on the subscribed groups. On some -servers this is quite fast (on sparkling, brand new INN servers that -support the @code{LIST ACTIVE group} command), on others this isn't fast -at all. In any case, @code{some} should be faster than @code{nil}, and -is certainly faster than @code{t} over slow lines. - -Some news servers (old versions of Leafnode and old versions of INN, for -instance) do not support the @code{LIST ACTIVE group}. For these -servers, @code{nil} is probably the most efficient value for this -variable. - -If this variable is @code{nil}, Gnus will ask for group info in total -lock-step, which isn't very fast. If it is @code{some} and you use an -@acronym{NNTP} server, Gnus will pump out commands as fast as it can, and -read all the replies in one swoop. This will normally result in better -performance, but if the server does not support the aforementioned -@code{LIST ACTIVE group} command, this isn't very nice to the server. - -If you think that starting up Gnus takes too long, try all the three -different values for this variable and see what works best for you. - -In any case, if you use @code{some} or @code{nil}, you should definitely -kill all groups that you aren't interested in to speed things up. - -Note that this variable also affects active file retrieval from -secondary select methods. - - -@node Startup Variables -@section Startup Variables - -@table @code - -@item gnus-load-hook -@vindex gnus-load-hook -A hook run while Gnus is being loaded. Note that this hook will -normally be run just once in each Emacs session, no matter how many -times you start Gnus. - -@item gnus-before-startup-hook -@vindex gnus-before-startup-hook -A hook run after starting up Gnus successfully. - -@item gnus-startup-hook -@vindex gnus-startup-hook -A hook run as the very last thing after starting up Gnus - -@item gnus-started-hook -@vindex gnus-started-hook -A hook that is run as the very last thing after starting up Gnus -successfully. - -@item gnus-setup-news-hook -@vindex gnus-setup-news-hook -A hook that is run after reading the @file{.newsrc} file(s), but before -generating the group buffer. - -@item gnus-check-bogus-newsgroups -@vindex gnus-check-bogus-newsgroups -If non-@code{nil}, Gnus will check for and delete all bogus groups at -startup. A @dfn{bogus group} is a group that you have in your -@file{.newsrc} file, but doesn't exist on the news server. Checking for -bogus groups can take quite a while, so to save time and resources it's -best to leave this option off, and do the checking for bogus groups once -in a while from the group buffer instead (@pxref{Group Maintenance}). - -@item gnus-inhibit-startup-message -@vindex gnus-inhibit-startup-message -If non-@code{nil}, the startup message won't be displayed. That way, -your boss might not notice as easily that you are reading news instead -of doing your job. Note that this variable is used before -@file{~/.gnus.el} is loaded, so it should be set in @file{.emacs} instead. - -@item gnus-no-groups-message -@vindex gnus-no-groups-message -Message displayed by Gnus when no groups are available. - -@item gnus-play-startup-jingle -@vindex gnus-play-startup-jingle -If non-@code{nil}, play the Gnus jingle at startup. - -@item gnus-startup-jingle -@vindex gnus-startup-jingle -Jingle to be played if the above variable is non-@code{nil}. The -default is @samp{Tuxedomoon.Jingle4.au}. - -@end table - - -@node Group Buffer -@chapter Group Buffer -@cindex group buffer - -@c Alex Schroeder suggests to rearrange this as follows: -@c -@c <kensanata> ok, just save it for reference. I'll go to bed in a minute. -@c 1. Selecting a Group, 2. (new) Finding a Group, 3. Group Levels, -@c 4. Subscription Commands, 5. Group Maneuvering, 6. Group Data, -@c 7. Group Score, 8. Group Buffer Format -@c <kensanata> Group Levels should have more information on levels 5 to 9. I -@c suggest to split the 4th paragraph ("Gnus considers groups...") as follows: -@c <kensanata> First, "Gnus considers groups... (default 9)." -@c <kensanata> New, a table summarizing what levels 1 to 9 mean. -@c <kensanata> Third, "Gnus treats subscribed ... reasons of efficiency" -@c <kensanata> Then expand the next paragraph or add some more to it. -@c This short one sentence explains levels 1 and 2, therefore I understand -@c that I should keep important news at 3 and boring news at 4. -@c Say so! Then go on to explain why I should bother with levels 6 to 9. -@c Maybe keep those that you don't want to read temporarily at 6, -@c those that you never want to read at 8, those that offend your -@c human rights at 9... - - -The @dfn{group buffer} lists all (or parts) of the available groups. It -is the first buffer shown when Gnus starts, and will never be killed as -long as Gnus is active. - -@iftex -@iflatex -\gnusfigure{The Group Buffer}{320}{ -\put(75,50){\epsfig{figure=ps/group,height=9cm}} -\put(120,37){\makebox(0,0)[t]{Buffer name}} -\put(120,38){\vector(1,2){10}} -\put(40,60){\makebox(0,0)[r]{Mode line}} -\put(40,58){\vector(1,0){30}} -\put(200,28){\makebox(0,0)[t]{Native select method}} -\put(200,26){\vector(-1,2){15}} -} -@end iflatex -@end iftex - -@menu -* Group Buffer Format:: Information listed and how you can change it. -* Group Maneuvering:: Commands for moving in the group buffer. -* Selecting a Group:: Actually reading news. -* Subscription Commands:: Unsubscribing, killing, subscribing. -* Group Data:: Changing the info for a group. -* Group Levels:: Levels? What are those, then? -* Group Score:: A mechanism for finding out what groups you like. -* Marking Groups:: You can mark groups for later processing. -* Foreign Groups:: Creating and editing groups. -* Group Parameters:: Each group may have different parameters set. -* Listing Groups:: Gnus can list various subsets of the groups. -* Sorting Groups:: Re-arrange the group order. -* Group Maintenance:: Maintaining a tidy @file{.newsrc} file. -* Browse Foreign Server:: You can browse a server. See what it has to offer. -* Exiting Gnus:: Stop reading news and get some work done. -* Group Topics:: A folding group mode divided into topics. -* Misc Group Stuff:: Other stuff that you can to do. -@end menu - - -@node Group Buffer Format -@section Group Buffer Format - -@menu -* Group Line Specification:: Deciding how the group buffer is to look. -* Group Mode Line Specification:: The group buffer mode line. -* Group Highlighting:: Having nice colors in the group buffer. -@end menu - -You can customize the Group Mode tool bar, see @kbd{M-x -customize-apropos RET gnus-group-tool-bar}. This feature is only -available in Emacs. - -The tool bar icons are now (de)activated correctly depending on the -cursor position. Therefore, moving around in the Group Buffer is -slower. You can disable this via the variable -@code{gnus-group-update-tool-bar}. Its default value depends on your -Emacs version. - -@node Group Line Specification -@subsection Group Line Specification -@cindex group buffer format - -The default format of the group buffer is nice and dull, but you can -make it as exciting and ugly as you feel like. - -Here's a couple of example group lines: - -@example - 25: news.announce.newusers - * 0: alt.fan.andrea-dworkin -@end example - -Quite simple, huh? - -You can see that there are 25 unread articles in -@samp{news.announce.newusers}. There are no unread articles, but some -ticked articles, in @samp{alt.fan.andrea-dworkin} (see that little -asterisk at the beginning of the line?). - -@vindex gnus-group-line-format -You can change that format to whatever you want by fiddling with the -@code{gnus-group-line-format} variable. This variable works along the -lines of a @code{format} specification, which is pretty much the same as -a @code{printf} specifications, for those of you who use (feh!) C. -@xref{Formatting Variables}. - -@samp{%M%S%5y:%B%(%g%)\n} is the value that produced those lines above. - -There should always be a colon on the line; the cursor always moves to -the colon after performing an operation. @xref{Positioning -Point}. Nothing else is required---not even the group name. All -displayed text is just window dressing, and is never examined by Gnus. -Gnus stores all real information it needs using text properties. - -(Note that if you make a really strange, wonderful, spreadsheet-like -layout, everybody will believe you are hard at work with the accounting -instead of wasting time reading news.) - -Here's a list of all available format characters: - -@table @samp - -@item M -An asterisk if the group only has marked articles. - -@item S -Whether the group is subscribed. - -@item L -Level of subscribedness. - -@item N -Number of unread articles. - -@item I -Number of dormant articles. - -@item T -Number of ticked articles. - -@item R -Number of read articles. - -@item U -Number of unseen articles. - -@item t -Estimated total number of articles. (This is really @var{max-number} -minus @var{min-number} plus 1.) - -Gnus uses this estimation because the @acronym{NNTP} protocol provides -efficient access to @var{max-number} and @var{min-number} but getting -the true unread message count is not possible efficiently. For -hysterical raisins, even the mail back ends, where the true number of -unread messages might be available efficiently, use the same limited -interface. To remove this restriction from Gnus means that the back -end interface has to be changed, which is not an easy job. If you -want to work on this, please contact the Gnus mailing list. - -@item y -Number of unread, unticked, non-dormant articles. - -@item i -Number of ticked and dormant articles. - -@item g -Full group name. - -@item G -Group name. - -@item C -Group comment (@pxref{Group Parameters}) or group name if there is no -comment element in the group parameters. - -@item D -Newsgroup description. You need to read the group descriptions -before these will appear, and to do that, you either have to set -@code{gnus-read-active-file} or use the group buffer @kbd{M-d} -command. - -@item o -@samp{m} if moderated. - -@item O -@samp{(m)} if moderated. - -@item s -Select method. - -@item B -If the summary buffer for the group is open or not. - -@item n -Select from where. - -@item z -A string that looks like @samp{<%s:%n>} if a foreign select method is -used. - -@item P -Indentation based on the level of the topic (@pxref{Group Topics}). - -@item c -@vindex gnus-group-uncollapsed-levels -Short (collapsed) group name. The @code{gnus-group-uncollapsed-levels} -variable says how many levels to leave at the end of the group name. -The default is 1---this will mean that group names like -@samp{gnu.emacs.gnus} will be shortened to @samp{g.e.gnus}. - -@item m -@vindex gnus-new-mail-mark -@cindex % -@samp{%} (@code{gnus-new-mail-mark}) if there has arrived new mail to -the group lately. - -@item p -@samp{#} (@code{gnus-process-mark}) if the group is process marked. - -@item d -A string that says when you last read the group (@pxref{Group -Timestamp}). - -@item u -User defined specifier. The next character in the format string should -be a letter. Gnus will call the function -@code{gnus-user-format-function-}@samp{X}, where @samp{X} is the letter -following @samp{%u}. The function will be passed a single dummy -parameter as argument. The function should return a string, which will -be inserted into the buffer just like information from any other -specifier. -@end table - -@cindex * -All the ``number-of'' specs will be filled with an asterisk (@samp{*}) -if no info is available---for instance, if it is a non-activated foreign -group, or a bogus native group. - - -@node Group Mode Line Specification -@subsection Group Mode Line Specification -@cindex group mode line - -@vindex gnus-group-mode-line-format -The mode line can be changed by setting -@code{gnus-group-mode-line-format} (@pxref{Mode Line Formatting}). It -doesn't understand that many format specifiers: - -@table @samp -@item S -The native news server. -@item M -The native select method. -@end table - - -@node Group Highlighting -@subsection Group Highlighting -@cindex highlighting -@cindex group highlighting - -@vindex gnus-group-highlight -Highlighting in the group buffer is controlled by the -@code{gnus-group-highlight} variable. This is an alist with elements -that look like @code{(@var{form} . @var{face})}. If @var{form} evaluates to -something non-@code{nil}, the @var{face} will be used on the line. - -Here's an example value for this variable that might look nice if the -background is dark: - -@lisp -(cond (window-system - (setq custom-background-mode 'light) - (defface my-group-face-1 - '((t (:foreground "Red" :bold t))) "First group face") - (defface my-group-face-2 - '((t (:foreground "DarkSeaGreen4" :bold t))) - "Second group face") - (defface my-group-face-3 - '((t (:foreground "Green4" :bold t))) "Third group face") - (defface my-group-face-4 - '((t (:foreground "SteelBlue" :bold t))) "Fourth group face") - (defface my-group-face-5 - '((t (:foreground "Blue" :bold t))) "Fifth group face"))) - -(setq gnus-group-highlight - '(((> unread 200) . my-group-face-1) - ((and (< level 3) (zerop unread)) . my-group-face-2) - ((< level 3) . my-group-face-3) - ((zerop unread) . my-group-face-4) - (t . my-group-face-5))) -@end lisp - -Also @pxref{Faces and Fonts}. - -Variables that are dynamically bound when the forms are evaluated -include: - -@table @code -@item group -The group name. -@item unread -The number of unread articles in the group. -@item method -The select method. -@item mailp -Whether the group is a mail group. -@item level -The level of the group. -@item score -The score of the group. -@item ticked -The number of ticked articles in the group. -@item total -The total number of articles in the group. Or rather, -@var{max-number} minus @var{min-number} plus one. -@item topic -When using the topic minor mode, this variable is bound to the current -topic being inserted. -@end table - -When the forms are @code{eval}ed, point is at the beginning of the line -of the group in question, so you can use many of the normal Gnus -functions for snarfing info on the group. - -@vindex gnus-group-update-hook -@findex gnus-group-highlight-line -@code{gnus-group-update-hook} is called when a group line is changed. -It will not be called when @code{gnus-visual} is @code{nil}. This hook -calls @code{gnus-group-highlight-line} by default. - - -@node Group Maneuvering -@section Group Maneuvering -@cindex group movement - -All movement commands understand the numeric prefix and will behave as -expected, hopefully. - -@table @kbd - -@item n -@kindex n (Group) -@findex gnus-group-next-unread-group -Go to the next group that has unread articles -(@code{gnus-group-next-unread-group}). - -@item p -@itemx DEL -@kindex DEL (Group) -@kindex p (Group) -@findex gnus-group-prev-unread-group -Go to the previous group that has unread articles -(@code{gnus-group-prev-unread-group}). - -@item N -@kindex N (Group) -@findex gnus-group-next-group -Go to the next group (@code{gnus-group-next-group}). - -@item P -@kindex P (Group) -@findex gnus-group-prev-group -Go to the previous group (@code{gnus-group-prev-group}). - -@item M-n -@kindex M-n (Group) -@findex gnus-group-next-unread-group-same-level -Go to the next unread group on the same (or lower) level -(@code{gnus-group-next-unread-group-same-level}). - -@item M-p -@kindex M-p (Group) -@findex gnus-group-prev-unread-group-same-level -Go to the previous unread group on the same (or lower) level -(@code{gnus-group-prev-unread-group-same-level}). -@end table - -Three commands for jumping to groups: - -@table @kbd - -@item j -@kindex j (Group) -@findex gnus-group-jump-to-group -Jump to a group (and make it visible if it isn't already) -(@code{gnus-group-jump-to-group}). Killed groups can be jumped to, just -like living groups. - -@item , -@kindex , (Group) -@findex gnus-group-best-unread-group -Jump to the unread group with the lowest level -(@code{gnus-group-best-unread-group}). - -@item . -@kindex . (Group) -@findex gnus-group-first-unread-group -Jump to the first group with unread articles -(@code{gnus-group-first-unread-group}). -@end table - -@vindex gnus-group-goto-unread -If @code{gnus-group-goto-unread} is @code{nil}, all the movement -commands will move to the next group, not the next unread group. Even -the commands that say they move to the next unread group. The default -is @code{t}. - - -@node Selecting a Group -@section Selecting a Group -@cindex group selection - -@table @kbd - -@item SPACE -@kindex SPACE (Group) -@findex gnus-group-read-group -Select the current group, switch to the summary buffer and display the -first unread article (@code{gnus-group-read-group}). If there are no -unread articles in the group, or if you give a non-numerical prefix to -this command, Gnus will offer to fetch all the old articles in this -group from the server. If you give a numerical prefix @var{n}, @var{n} -determines the number of articles Gnus will fetch. If @var{n} is -positive, Gnus fetches the @var{n} newest articles, if @var{n} is -negative, Gnus fetches the @code{abs(@var{n})} oldest articles. - -Thus, @kbd{SPC} enters the group normally, @kbd{C-u SPC} offers old -articles, @kbd{C-u 4 2 SPC} fetches the 42 newest articles, and @kbd{C-u -- 4 2 SPC} fetches the 42 oldest ones. - -When you are in the group (in the Summary buffer), you can type -@kbd{M-g} to fetch new articles, or @kbd{C-u M-g} to also show the old -ones. - -@item RET -@kindex RET (Group) -@findex gnus-group-select-group -Select the current group and switch to the summary buffer -(@code{gnus-group-select-group}). Takes the same arguments as -@code{gnus-group-read-group}---the only difference is that this command -does not display the first unread article automatically upon group -entry. - -@item M-RET -@kindex M-RET (Group) -@findex gnus-group-quick-select-group -This does the same as the command above, but tries to do it with the -minimum amount of fuzz (@code{gnus-group-quick-select-group}). No -scoring/killing will be performed, there will be no highlights and no -expunging. This might be useful if you're in a real hurry and have to -enter some humongous group. If you give a 0 prefix to this command -(i.e., @kbd{0 M-RET}), Gnus won't even generate the summary buffer, -which is useful if you want to toggle threading before generating the -summary buffer (@pxref{Summary Generation Commands}). - -@item M-SPACE -@kindex M-SPACE (Group) -@findex gnus-group-visible-select-group -This is yet one more command that does the same as the @kbd{RET} -command, but this one does it without expunging and hiding dormants -(@code{gnus-group-visible-select-group}). - -@item C-M-RET -@kindex C-M-RET (Group) -@findex gnus-group-select-group-ephemerally -Finally, this command selects the current group ephemerally without -doing any processing of its contents -(@code{gnus-group-select-group-ephemerally}). Even threading has been -turned off. Everything you do in the group after selecting it in this -manner will have no permanent effects. - -@end table - -@vindex gnus-large-newsgroup -The @code{gnus-large-newsgroup} variable says what Gnus should -consider to be a big group. If it is @code{nil}, no groups are -considered big. The default value is 200. If the group has more -(unread and/or ticked) articles than this, Gnus will query the user -before entering the group. The user can then specify how many -articles should be fetched from the server. If the user specifies a -negative number (@var{-n}), the @var{n} oldest articles will be -fetched. If it is positive, the @var{n} articles that have arrived -most recently will be fetched. - -@vindex gnus-large-ephemeral-newsgroup -@code{gnus-large-ephemeral-newsgroup} is the same as -@code{gnus-large-newsgroup}, but is only used for ephemeral -newsgroups. - -@vindex gnus-maximum-newsgroup -In groups in some news servers, there might be a big gap between a few -very old articles that will never be expired and the recent ones. In -such a case, the server will return the data like @code{(1 . 30000000)} -for the @code{LIST ACTIVE group} command, for example. Even if there -are actually only the articles 1-10 and 29999900-30000000, Gnus doesn't -know it at first and prepares for getting 30000000 articles. However, -it will consume hundreds megabytes of memories and might make Emacs get -stuck as the case may be. If you use such news servers, set the -variable @code{gnus-maximum-newsgroup} to a positive number. The value -means that Gnus ignores articles other than this number of the latest -ones in every group. For instance, the value 10000 makes Gnus get only -the articles 29990001-30000000 (if the latest article number is 30000000 -in a group). Note that setting this variable to a number might prevent -you from reading very old articles. The default value of the variable -@code{gnus-maximum-newsgroup} is @code{nil}, which means Gnus never -ignores old articles. - -@vindex gnus-select-group-hook -@vindex gnus-auto-select-first -@vindex gnus-auto-select-subject -If @code{gnus-auto-select-first} is non-@code{nil}, select an article -automatically when entering a group with the @kbd{SPACE} command. -Which article this is is controlled by the -@code{gnus-auto-select-subject} variable. Valid values for this -variable are: - -@table @code - -@item unread -Place point on the subject line of the first unread article. - -@item first -Place point on the subject line of the first article. - -@item unseen -Place point on the subject line of the first unseen article. - -@item unseen-or-unread -Place point on the subject line of the first unseen article, and if -there is no such article, place point on the subject line of the first -unread article. - -@item best -Place point on the subject line of the highest-scored unread article. - -@end table - -This variable can also be a function. In that case, that function -will be called to place point on a subject line. - -If you want to prevent automatic selection in some group (say, in a -binary group with Huge articles) you can set the -@code{gnus-auto-select-first} variable to @code{nil} in -@code{gnus-select-group-hook}, which is called when a group is -selected. - - -@node Subscription Commands -@section Subscription Commands -@cindex subscription - -@table @kbd - -@item S t -@itemx u -@kindex S t (Group) -@kindex u (Group) -@findex gnus-group-unsubscribe-current-group -@c @icon{gnus-group-unsubscribe} -Toggle subscription to the current group -(@code{gnus-group-unsubscribe-current-group}). - -@item S s -@itemx U -@kindex S s (Group) -@kindex U (Group) -@findex gnus-group-unsubscribe-group -Prompt for a group to subscribe, and then subscribe it. If it was -subscribed already, unsubscribe it instead -(@code{gnus-group-unsubscribe-group}). - -@item S k -@itemx C-k -@kindex S k (Group) -@kindex C-k (Group) -@findex gnus-group-kill-group -@c @icon{gnus-group-kill-group} -Kill the current group (@code{gnus-group-kill-group}). - -@item S y -@itemx C-y -@kindex S y (Group) -@kindex C-y (Group) -@findex gnus-group-yank-group -Yank the last killed group (@code{gnus-group-yank-group}). - -@item C-x C-t -@kindex C-x C-t (Group) -@findex gnus-group-transpose-groups -Transpose two groups (@code{gnus-group-transpose-groups}). This isn't -really a subscription command, but you can use it instead of a -kill-and-yank sequence sometimes. - -@item S w -@itemx C-w -@kindex S w (Group) -@kindex C-w (Group) -@findex gnus-group-kill-region -Kill all groups in the region (@code{gnus-group-kill-region}). - -@item S z -@kindex S z (Group) -@findex gnus-group-kill-all-zombies -Kill all zombie groups (@code{gnus-group-kill-all-zombies}). - -@item S C-k -@kindex S C-k (Group) -@findex gnus-group-kill-level -Kill all groups on a certain level (@code{gnus-group-kill-level}). -These groups can't be yanked back after killing, so this command should -be used with some caution. The only time where this command comes in -really handy is when you have a @file{.newsrc} with lots of unsubscribed -groups that you want to get rid off. @kbd{S C-k} on level 7 will -kill off all unsubscribed groups that do not have message numbers in the -@file{.newsrc} file. - -@end table - -Also @pxref{Group Levels}. - - -@node Group Data -@section Group Data - -@table @kbd - -@item c -@kindex c (Group) -@findex gnus-group-catchup-current -@vindex gnus-group-catchup-group-hook -@c @icon{gnus-group-catchup-current} -Mark all unticked articles in this group as read -(@code{gnus-group-catchup-current}). -@code{gnus-group-catchup-group-hook} is called when catching up a group from -the group buffer. - -@item C -@kindex C (Group) -@findex gnus-group-catchup-current-all -Mark all articles in this group, even the ticked ones, as read -(@code{gnus-group-catchup-current-all}). - -@item M-c -@kindex M-c (Group) -@findex gnus-group-clear-data -Clear the data from the current group---nix out marks and the list of -read articles (@code{gnus-group-clear-data}). - -@item M-x gnus-group-clear-data-on-native-groups -@kindex M-x gnus-group-clear-data-on-native-groups -@findex gnus-group-clear-data-on-native-groups -If you have switched from one @acronym{NNTP} server to another, all your marks -and read ranges have become worthless. You can use this command to -clear out all data that you have on your native groups. Use with -caution. - -@end table - - -@node Group Levels -@section Group Levels -@cindex group level -@cindex level - -All groups have a level of @dfn{subscribedness}. For instance, if a -group is on level 2, it is more subscribed than a group on level 5. You -can ask Gnus to just list groups on a given level or lower -(@pxref{Listing Groups}), or to just check for new articles in groups on -a given level or lower (@pxref{Scanning New Messages}). - -Remember: The higher the level of the group, the less important it is. - -@table @kbd - -@item S l -@kindex S l (Group) -@findex gnus-group-set-current-level -Set the level of the current group. If a numeric prefix is given, the -next @var{n} groups will have their levels set. The user will be -prompted for a level. -@end table - -@vindex gnus-level-killed -@vindex gnus-level-zombie -@vindex gnus-level-unsubscribed -@vindex gnus-level-subscribed -Gnus considers groups from levels 1 to -@code{gnus-level-subscribed} (inclusive) (default 5) to be subscribed, -@code{gnus-level-subscribed} (exclusive) and -@code{gnus-level-unsubscribed} (inclusive) (default 7) to be -unsubscribed, @code{gnus-level-zombie} to be zombies (walking dead) -(default 8) and @code{gnus-level-killed} to be killed (completely dead) -(default 9). Gnus treats subscribed and unsubscribed groups exactly the -same, but zombie and killed groups have no information on what articles -you have read, etc, stored. This distinction between dead and living -groups isn't done because it is nice or clever, it is done purely for -reasons of efficiency. - -It is recommended that you keep all your mail groups (if any) on quite -low levels (e.g. 1 or 2). - -Maybe the following description of the default behavior of Gnus helps to -understand what these levels are all about. By default, Gnus shows you -subscribed nonempty groups, but by hitting @kbd{L} you can have it show -empty subscribed groups and unsubscribed groups, too. Type @kbd{l} to -go back to showing nonempty subscribed groups again. Thus, unsubscribed -groups are hidden, in a way. - -Zombie and killed groups are similar to unsubscribed groups in that they -are hidden by default. But they are different from subscribed and -unsubscribed groups in that Gnus doesn't ask the news server for -information (number of messages, number of unread messages) on zombie -and killed groups. Normally, you use @kbd{C-k} to kill the groups you -aren't interested in. If most groups are killed, Gnus is faster. - -Why does Gnus distinguish between zombie and killed groups? Well, when -a new group arrives on the server, Gnus by default makes it a zombie -group. This means that you are normally not bothered with new groups, -but you can type @kbd{A z} to get a list of all new groups. Subscribe -the ones you like and kill the ones you don't want. (@kbd{A k} shows a -list of killed groups.) - -If you want to play with the level variables, you should show some care. -Set them once, and don't touch them ever again. Better yet, don't touch -them at all unless you know exactly what you're doing. - -@vindex gnus-level-default-unsubscribed -@vindex gnus-level-default-subscribed -Two closely related variables are @code{gnus-level-default-subscribed} -(default 3) and @code{gnus-level-default-unsubscribed} (default 6), -which are the levels that new groups will be put on if they are -(un)subscribed. These two variables should, of course, be inside the -relevant valid ranges. - -@vindex gnus-keep-same-level -If @code{gnus-keep-same-level} is non-@code{nil}, some movement commands -will only move to groups of the same level (or lower). In -particular, going from the last article in one group to the next group -will go to the next group of the same level (or lower). This might be -handy if you want to read the most important groups before you read the -rest. - -If this variable is @code{best}, Gnus will make the next newsgroup the -one with the best level. - -@vindex gnus-group-default-list-level -All groups with a level less than or equal to -@code{gnus-group-default-list-level} will be listed in the group buffer -by default. - -@vindex gnus-group-list-inactive-groups -If @code{gnus-group-list-inactive-groups} is non-@code{nil}, non-active -groups will be listed along with the unread groups. This variable is -@code{t} by default. If it is @code{nil}, inactive groups won't be -listed. - -@vindex gnus-group-use-permanent-levels -If @code{gnus-group-use-permanent-levels} is non-@code{nil}, once you -give a level prefix to @kbd{g} or @kbd{l}, all subsequent commands will -use this level as the ``work'' level. - -@vindex gnus-activate-level -Gnus will normally just activate (i. e., query the server about) groups -on level @code{gnus-activate-level} or less. If you don't want to -activate unsubscribed groups, for instance, you might set this variable -to 5. The default is 6. - - -@node Group Score -@section Group Score -@cindex group score -@cindex group rank -@cindex rank - -You would normally keep important groups on high levels, but that scheme -is somewhat restrictive. Don't you wish you could have Gnus sort the -group buffer according to how often you read groups, perhaps? Within -reason? - -This is what @dfn{group score} is for. You can have Gnus assign a score -to each group through the mechanism described below. You can then sort -the group buffer based on this score. Alternatively, you can sort on -score and then level. (Taken together, the level and the score is -called the @dfn{rank} of the group. A group that is on level 4 and has -a score of 1 has a higher rank than a group on level 5 that has a score -of 300. (The level is the most significant part and the score is the -least significant part.)) - -@findex gnus-summary-bubble-group -If you want groups you read often to get higher scores than groups you -read seldom you can add the @code{gnus-summary-bubble-group} function to -the @code{gnus-summary-exit-hook} hook. This will result (after -sorting) in a bubbling sort of action. If you want to see that in -action after each summary exit, you can add -@code{gnus-group-sort-groups-by-rank} or -@code{gnus-group-sort-groups-by-score} to the same hook, but that will -slow things down somewhat. - - -@node Marking Groups -@section Marking Groups -@cindex marking groups - -If you want to perform some command on several groups, and they appear -subsequently in the group buffer, you would normally just give a -numerical prefix to the command. Most group commands will then do your -bidding on those groups. - -However, if the groups are not in sequential order, you can still -perform a command on several groups. You simply mark the groups first -with the process mark and then execute the command. - -@table @kbd - -@item # -@kindex # (Group) -@itemx M m -@kindex M m (Group) -@findex gnus-group-mark-group -Set the mark on the current group (@code{gnus-group-mark-group}). - -@item M-# -@kindex M-# (Group) -@itemx M u -@kindex M u (Group) -@findex gnus-group-unmark-group -Remove the mark from the current group -(@code{gnus-group-unmark-group}). - -@item M U -@kindex M U (Group) -@findex gnus-group-unmark-all-groups -Remove the mark from all groups (@code{gnus-group-unmark-all-groups}). - -@item M w -@kindex M w (Group) -@findex gnus-group-mark-region -Mark all groups between point and mark (@code{gnus-group-mark-region}). - -@item M b -@kindex M b (Group) -@findex gnus-group-mark-buffer -Mark all groups in the buffer (@code{gnus-group-mark-buffer}). - -@item M r -@kindex M r (Group) -@findex gnus-group-mark-regexp -Mark all groups that match some regular expression -(@code{gnus-group-mark-regexp}). -@end table - -Also @pxref{Process/Prefix}. - -@findex gnus-group-universal-argument -If you want to execute some command on all groups that have been marked -with the process mark, you can use the @kbd{M-&} -(@code{gnus-group-universal-argument}) command. It will prompt you for -the command to be executed. - - -@node Foreign Groups -@section Foreign Groups -@cindex foreign groups - -Below are some group mode commands for making and editing general foreign -groups, as well as commands to ease the creation of a few -special-purpose groups. All these commands insert the newly created -groups under point---@code{gnus-subscribe-newsgroup-method} is not -consulted. - -Changes from the group editing commands are stored in -@file{~/.newsrc.eld} (@code{gnus-startup-file}). An alternative is the -variable @code{gnus-parameters}, @xref{Group Parameters}. - -@table @kbd - -@item G m -@kindex G m (Group) -@findex gnus-group-make-group -@cindex making groups -Make a new group (@code{gnus-group-make-group}). Gnus will prompt you -for a name, a method and possibly an @dfn{address}. For an easier way -to subscribe to @acronym{NNTP} groups (@pxref{Browse Foreign Server}). - -@item G M -@kindex G M (Group) -@findex gnus-group-read-ephemeral-group -Make an ephemeral group (@code{gnus-group-read-ephemeral-group}). Gnus -will prompt you for a name, a method and an @dfn{address}. - -@item G r -@kindex G r (Group) -@findex gnus-group-rename-group -@cindex renaming groups -Rename the current group to something else -(@code{gnus-group-rename-group}). This is valid only on some -groups---mail groups mostly. This command might very well be quite slow -on some back ends. - -@item G c -@kindex G c (Group) -@cindex customizing -@findex gnus-group-customize -Customize the group parameters (@code{gnus-group-customize}). - -@item G e -@kindex G e (Group) -@findex gnus-group-edit-group-method -@cindex renaming groups -Enter a buffer where you can edit the select method of the current -group (@code{gnus-group-edit-group-method}). - -@item G p -@kindex G p (Group) -@findex gnus-group-edit-group-parameters -Enter a buffer where you can edit the group parameters -(@code{gnus-group-edit-group-parameters}). - -@item G E -@kindex G E (Group) -@findex gnus-group-edit-group -Enter a buffer where you can edit the group info -(@code{gnus-group-edit-group}). - -@item G d -@kindex G d (Group) -@findex gnus-group-make-directory-group -@cindex nndir -Make a directory group (@pxref{Directory Groups}). You will be prompted -for a directory name (@code{gnus-group-make-directory-group}). - -@item G h -@kindex G h (Group) -@cindex help group -@findex gnus-group-make-help-group -Make the Gnus help group (@code{gnus-group-make-help-group}). - -@item G a -@kindex G a (Group) -@cindex (ding) archive -@cindex archive group -@findex gnus-group-make-archive-group -@vindex gnus-group-archive-directory -@vindex gnus-group-recent-archive-directory -Make a Gnus archive group (@code{gnus-group-make-archive-group}). By -default a group pointing to the most recent articles will be created -(@code{gnus-group-recent-archive-directory}), but given a prefix, a full -group will be created from @code{gnus-group-archive-directory}. - -@item G k -@kindex G k (Group) -@findex gnus-group-make-kiboze-group -@cindex nnkiboze -Make a kiboze group. You will be prompted for a name, for a regexp to -match groups to be ``included'' in the kiboze group, and a series of -strings to match on headers (@code{gnus-group-make-kiboze-group}). -@xref{Kibozed Groups}. - -@item G D -@kindex G D (Group) -@findex gnus-group-enter-directory -@cindex nneething -Read an arbitrary directory as if it were a newsgroup with the -@code{nneething} back end (@code{gnus-group-enter-directory}). -@xref{Anything Groups}. - -@item G f -@kindex G f (Group) -@findex gnus-group-make-doc-group -@cindex ClariNet Briefs -@cindex nndoc -Make a group based on some file or other -(@code{gnus-group-make-doc-group}). If you give a prefix to this -command, you will be prompted for a file name and a file type. -Currently supported types are @code{mbox}, @code{babyl}, -@code{digest}, @code{news}, @code{rnews}, @code{mmdf}, @code{forward}, -@code{rfc934}, @code{rfc822-forward}, @code{mime-parts}, -@code{standard-digest}, @code{slack-digest}, @code{clari-briefs}, -@code{nsmail}, @code{outlook}, @code{oe-dbx}, and @code{mailman}. If -you run this command without a prefix, Gnus will guess at the file -type. @xref{Document Groups}. - -@item G u -@kindex G u (Group) -@vindex gnus-useful-groups -@findex gnus-group-make-useful-group -Create one of the groups mentioned in @code{gnus-useful-groups} -(@code{gnus-group-make-useful-group}). - -@item G w -@kindex G w (Group) -@findex gnus-group-make-web-group -@cindex Google -@cindex nnweb -@cindex gmane -Make an ephemeral group based on a web search -(@code{gnus-group-make-web-group}). If you give a prefix to this -command, make a solid group instead. You will be prompted for the -search engine type and the search string. Valid search engine types -include @code{google}, @code{dejanews}, and @code{gmane}. -@xref{Web Searches}. - -If you use the @code{google} search engine, you can limit the search -to a particular group by using a match string like -@samp{shaving group:alt.sysadmin.recovery}. - -@item G R -@kindex G R (Group) -@findex gnus-group-make-rss-group -Make a group based on an @acronym{RSS} feed -(@code{gnus-group-make-rss-group}). You will be prompted for an URL. -@xref{RSS}. - -@item G DEL -@kindex G DEL (Group) -@findex gnus-group-delete-group -This function will delete the current group -(@code{gnus-group-delete-group}). If given a prefix, this function will -actually delete all the articles in the group, and forcibly remove the -group itself from the face of the Earth. Use a prefix only if you are -absolutely sure of what you are doing. This command can't be used on -read-only groups (like @code{nntp} groups), though. - -@item G V -@kindex G V (Group) -@findex gnus-group-make-empty-virtual -Make a new, fresh, empty @code{nnvirtual} group -(@code{gnus-group-make-empty-virtual}). @xref{Virtual Groups}. - -@item G v -@kindex G v (Group) -@findex gnus-group-add-to-virtual -Add the current group to an @code{nnvirtual} group -(@code{gnus-group-add-to-virtual}). Uses the process/prefix convention. -@end table - -@xref{Select Methods}, for more information on the various select -methods. - -@vindex gnus-activate-foreign-newsgroups -If @code{gnus-activate-foreign-newsgroups} is a positive number, -Gnus will check all foreign groups with this level or lower at startup. -This might take quite a while, especially if you subscribe to lots of -groups from different @acronym{NNTP} servers. Also @pxref{Group Levels}; -@code{gnus-activate-level} also affects activation of foreign -newsgroups. - - -@node Group Parameters -@section Group Parameters -@cindex group parameters - -The group parameters store information local to a particular group. -Here's an example group parameter list: - -@example -((to-address . "ding@@gnus.org") - (auto-expire . t)) -@end example - -We see that each element consists of a ``dotted pair''---the thing before -the dot is the key, while the thing after the dot is the value. All the -parameters have this form @emph{except} local variable specs, which are -not dotted pairs, but proper lists. - -Some parameters have correspondent customizable variables, each of which -is an alist of regexps and values. - -The following group parameters can be used: - -@table @code -@item to-address -@cindex to-address -Address used by when doing followups and new posts. - -@example -(to-address . "some@@where.com") -@end example - -This is primarily useful in mail groups that represent closed mailing -lists---mailing lists where it's expected that everybody that writes to -the mailing list is subscribed to it. Since using this parameter -ensures that the mail only goes to the mailing list itself, it means -that members won't receive two copies of your followups. - -Using @code{to-address} will actually work whether the group is foreign -or not. Let's say there's a group on the server that is called -@samp{fa.4ad-l}. This is a real newsgroup, but the server has gotten -the articles from a mail-to-news gateway. Posting directly to this -group is therefore impossible---you have to send mail to the mailing -list address instead. - -See also @code{gnus-parameter-to-address-alist}. - -@item to-list -@cindex to-list -Address used when doing @kbd{a} in that group. - -@example -(to-list . "some@@where.com") -@end example - -It is totally ignored -when doing a followup---except that if it is present in a news group, -you'll get mail group semantics when doing @kbd{f}. - -If you do an @kbd{a} command in a mail group and you have neither a -@code{to-list} group parameter nor a @code{to-address} group parameter, -then a @code{to-list} group parameter will be added automatically upon -sending the message if @code{gnus-add-to-list} is set to @code{t}. -@vindex gnus-add-to-list - -@findex gnus-mailing-list-mode -@cindex mail list groups -If this variable is set, @code{gnus-mailing-list-mode} is turned on when -entering summary buffer. - -See also @code{gnus-parameter-to-list-alist}. - -@anchor{subscribed} -@item subscribed -@cindex subscribed -@cindex Mail-Followup-To -@findex gnus-find-subscribed-addresses -If this parameter is set to @code{t}, Gnus will consider the -to-address and to-list parameters for this group as addresses of -mailing lists you are subscribed to. Giving Gnus this information is -(only) a first step in getting it to generate correct Mail-Followup-To -headers for your posts to these lists. The second step is to put the -following in your @file{.gnus.el} - -@lisp -(setq message-subscribed-address-functions - '(gnus-find-subscribed-addresses)) -@end lisp - -@xref{Mailing Lists, ,Mailing Lists, message, The Message Manual}, for -a complete treatment of available MFT support. - -@item visible -@cindex visible -If the group parameter list has the element @code{(visible . t)}, -that group will always be visible in the Group buffer, regardless -of whether it has any unread articles. - -This parameter cannot be set via @code{gnus-parameters}. See -@code{gnus-permanently-visible-groups} as an alternative. - -@item broken-reply-to -@cindex broken-reply-to -Elements like @code{(broken-reply-to . t)} signals that @code{Reply-To} -headers in this group are to be ignored, and for the header to be hidden -if @code{reply-to} is part of @code{gnus-boring-article-headers}. This -can be useful if you're reading a mailing list group where the listserv -has inserted @code{Reply-To} headers that point back to the listserv -itself. That is broken behavior. So there! - -@item to-group -@cindex to-group -Elements like @code{(to-group . "some.group.name")} means that all -posts in that group will be sent to @code{some.group.name}. - -@item newsgroup -@cindex newsgroup -If you have @code{(newsgroup . t)} in the group parameter list, Gnus -will treat all responses as if they were responses to news articles. -This can be useful if you have a mail group that's really a mirror of a -news group. - -@item gcc-self -@cindex gcc-self -If @code{(gcc-self . t)} is present in the group parameter list, newly -composed messages will be @code{Gcc}'d to the current group. If -@code{(gcc-self . none)} is present, no @code{Gcc:} header will be -generated, if @code{(gcc-self . "string")} is present, this string will -be inserted literally as a @code{gcc} header. This parameter takes -precedence over any default @code{Gcc} rules as described later -(@pxref{Archived Messages}). - -@strong{Caveat}: Adding @code{(gcc-self . t)} to the parameter list of -@code{nntp} groups (or the like) isn't valid. An @code{nntp} server -doesn't accept articles. - -@item auto-expire -@cindex auto-expire -@cindex expiring mail -If the group parameter has an element that looks like @code{(auto-expire -. t)}, all articles read will be marked as expirable. For an -alternative approach, @pxref{Expiring Mail}. - -See also @code{gnus-auto-expirable-newsgroups}. - -@item total-expire -@cindex total-expire -@cindex expiring mail -If the group parameter has an element that looks like -@code{(total-expire . t)}, all read articles will be put through the -expiry process, even if they are not marked as expirable. Use with -caution. Unread, ticked and dormant articles are not eligible for -expiry. - -See also @code{gnus-total-expirable-newsgroups}. - -@item expiry-wait -@cindex expiry-wait -@vindex nnmail-expiry-wait-function -If the group parameter has an element that looks like -@code{(expiry-wait . 10)}, this value will override any -@code{nnmail-expiry-wait} and @code{nnmail-expiry-wait-function} -(@pxref{Expiring Mail}) when expiring expirable messages. The value -can either be a number of days (not necessarily an integer) or the -symbols @code{never} or @code{immediate}. - -@item expiry-target -@cindex expiry-target -Where expired messages end up. This parameter overrides -@code{nnmail-expiry-target}. - -@item score-file -@cindex score file group parameter -Elements that look like @code{(score-file . "file")} will make -@file{file} into the current score file for the group in question. All -interactive score entries will be put into this file. - -@item adapt-file -@cindex adapt file group parameter -Elements that look like @code{(adapt-file . "file")} will make -@file{file} into the current adaptive file for the group in question. -All adaptive score entries will be put into this file. - -@item admin-address -@cindex admin-address -When unsubscribing from a mailing list you should never send the -unsubscription notice to the mailing list itself. Instead, you'd send -messages to the administrative address. This parameter allows you to -put the admin address somewhere convenient. - -@item display -@cindex display -Elements that look like @code{(display . MODE)} say which articles to -display on entering the group. Valid values are: - -@table @code -@item all -Display all articles, both read and unread. - -@item an integer -Display the last @var{integer} articles in the group. This is the same as -entering the group with @kbd{C-u @var{integer}}. - -@item default -Display the default visible articles, which normally includes unread and -ticked articles. - -@item an array -Display articles that satisfy a predicate. - -Here are some examples: - -@table @code -@item [unread] -Display only unread articles. - -@item [not expire] -Display everything except expirable articles. - -@item [and (not reply) (not expire)] -Display everything except expirable and articles you've already -responded to. -@end table - -The available operators are @code{not}, @code{and} and @code{or}. -Predicates include @code{tick}, @code{unsend}, @code{undownload}, -@code{unread}, @code{dormant}, @code{expire}, @code{reply}, -@code{killed}, @code{bookmark}, @code{score}, @code{save}, -@code{cache}, @code{forward}, @code{unseen} and @code{recent}. - -@end table - -The @code{display} parameter works by limiting the summary buffer to -the subset specified. You can pop the limit by using the @kbd{/ w} -command (@pxref{Limiting}). - -@item comment -@cindex comment -Elements that look like @code{(comment . "This is a comment")} are -arbitrary comments on the group. You can display comments in the -group line (@pxref{Group Line Specification}). - -@item charset -@cindex charset -Elements that look like @code{(charset . iso-8859-1)} will make -@code{iso-8859-1} the default charset; that is, the charset that will be -used for all articles that do not specify a charset. - -See also @code{gnus-group-charset-alist}. - -@item ignored-charsets -@cindex ignored-charset -Elements that look like @code{(ignored-charsets x-unknown iso-8859-1)} -will make @code{iso-8859-1} and @code{x-unknown} ignored; that is, the -default charset will be used for decoding articles. - -See also @code{gnus-group-ignored-charsets-alist}. - -@item posting-style -@cindex posting-style -You can store additional posting style information for this group -here (@pxref{Posting Styles}). The format is that of an entry in the -@code{gnus-posting-styles} alist, except that there's no regexp matching -the group name (of course). Style elements in this group parameter will -take precedence over the ones found in @code{gnus-posting-styles}. - -For instance, if you want a funky name and signature in this group only, -instead of hacking @code{gnus-posting-styles}, you could put something -like this in the group parameters: - -@example -(posting-style - (name "Funky Name") - ("X-My-Header" "Funky Value") - (signature "Funky Signature")) -@end example - -@item post-method -@cindex post-method -If it is set, the value is used as the method for posting message -instead of @code{gnus-post-method}. - -@item banner -@cindex banner -An item like @code{(banner . @var{regexp})} causes any part of an article -that matches the regular expression @var{regexp} to be stripped. Instead of -@var{regexp}, you can also use the symbol @code{signature} which strips the -last signature or any of the elements of the alist -@code{gnus-article-banner-alist}. - -@item sieve -@cindex sieve -This parameter contains a Sieve test that should match incoming mail -that should be placed in this group. From this group parameter, a -Sieve @samp{IF} control structure is generated, having the test as the -condition and @samp{fileinto "group.name";} as the body. - -For example, if the @samp{INBOX.list.sieve} group has the @code{(sieve -address "sender" "sieve-admin@@extundo.com")} group parameter, when -translating the group parameter into a Sieve script (@pxref{Sieve -Commands}) the following Sieve code is generated: - -@example -if address \"sender\" \"sieve-admin@@extundo.com\" @{ - fileinto \"INBOX.list.sieve\"; -@} -@end example - -The Sieve language is described in RFC 3028. @xref{Top, Emacs Sieve, -Top, sieve, Emacs Sieve}. - -@item (agent parameters) -If the agent has been enabled, you can set any of the its parameters -to control the behavior of the agent in individual groups. See Agent -Parameters in @ref{Category Syntax}. Most users will choose to set -agent parameters in either an agent category or group topic to -minimize the configuration effort. - -@item (@var{variable} @var{form}) -You can use the group parameters to set variables local to the group you -are entering. If you want to turn threading off in @samp{news.answers}, -you could put @code{(gnus-show-threads nil)} in the group parameters of -that group. @code{gnus-show-threads} will be made into a local variable -in the summary buffer you enter, and the form @code{nil} will be -@code{eval}ed there. - -Note that this feature sets the variable locally to the summary buffer. -But some variables are evaluated in the article buffer, or in the -message buffer (of a reply or followup or otherwise newly created -message). As a workaround, it might help to add the variable in -question to @code{gnus-newsgroup-variables}. @xref{Various Summary -Stuff}. So if you want to set @code{message-from-style} via the group -parameters, then you may need the following statement elsewhere in your -@file{~/.gnus} file: - -@lisp -(add-to-list 'gnus-newsgroup-variables 'message-from-style) -@end lisp - -@vindex gnus-list-identifiers -A use for this feature is to remove a mailing list identifier tag in -the subject fields of articles. E.g. if the news group - -@example -nntp+news.gnus.org:gmane.text.docbook.apps -@end example - -has the tag @samp{DOC-BOOK-APPS:} in the subject of all articles, this -tag can be removed from the article subjects in the summary buffer for -the group by putting @code{(gnus-list-identifiers "DOCBOOK-APPS:")} -into the group parameters for the group. - -This can also be used as a group-specific hook function. If you want to -hear a beep when you enter a group, you could put something like -@code{(dummy-variable (ding))} in the parameters of that group. -@code{dummy-variable} will be set to the (meaningless) result of the -@code{(ding)} form. - -Alternatively, since the VARIABLE becomes local to the group, this -pattern can be used to temporarily change a hook. For example, if the -following is added to a group parameter - -@lisp -(gnus-summary-prepared-hook - '(lambda nil (local-set-key "d" (local-key-binding "n")))) -@end lisp - -when the group is entered, the 'd' key will not mark the article as -expired. - -@end table - -Use the @kbd{G p} or the @kbd{G c} command to edit group parameters of a -group. (@kbd{G p} presents you with a Lisp-based interface, @kbd{G c} -presents you with a Customize-like interface. The latter helps avoid -silly Lisp errors.) You might also be interested in reading about topic -parameters (@pxref{Topic Parameters}). - -@vindex gnus-parameters -Group parameters can be set via the @code{gnus-parameters} variable too. -But some variables, such as @code{visible}, have no effect (For this -case see @code{gnus-permanently-visible-groups} as an alternative.). -For example: - -@lisp -(setq gnus-parameters - '(("mail\\..*" - (gnus-show-threads nil) - (gnus-use-scoring nil) - (gnus-summary-line-format - "%U%R%z%I%(%[%d:%ub%-23,23f%]%) %s\n") - (gcc-self . t) - (display . all)) - - ("^nnimap:\\(foo.bar\\)$" - (to-group . "\\1")) - - ("mail\\.me" - (gnus-use-scoring t)) - - ("list\\..*" - (total-expire . t) - (broken-reply-to . t)))) -@end lisp - -String value of parameters will be subjected to regexp substitution, as -the @code{to-group} example shows. - -@vindex gnus-parameters-case-fold-search -By default, whether comparing the group name and one of those regexps -specified in @code{gnus-parameters} is done in a case-sensitive manner -or a case-insensitive manner depends on the value of -@code{case-fold-search} at the time when the comparison is done. The -value of @code{case-fold-search} is typically @code{t}; it means, for -example, the element @code{("INBOX\\.FOO" (total-expire . t))} might be -applied to both the @samp{INBOX.FOO} group and the @samp{INBOX.foo} -group. If you want to make those regexps always case-sensitive, set the -value of the @code{gnus-parameters-case-fold-search} variable to -@code{nil}. Otherwise, set it to @code{t} if you want to compare them -always in a case-insensitive manner. - - -@node Listing Groups -@section Listing Groups -@cindex group listing - -These commands all list various slices of the groups available. - -@table @kbd - -@item l -@itemx A s -@kindex A s (Group) -@kindex l (Group) -@findex gnus-group-list-groups -List all groups that have unread articles -(@code{gnus-group-list-groups}). If the numeric prefix is used, this -command will list only groups of level ARG and lower. By default, it -only lists groups of level five (i.e., -@code{gnus-group-default-list-level}) or lower (i.e., just subscribed -groups). - -@item L -@itemx A u -@kindex A u (Group) -@kindex L (Group) -@findex gnus-group-list-all-groups -List all groups, whether they have unread articles or not -(@code{gnus-group-list-all-groups}). If the numeric prefix is used, -this command will list only groups of level ARG and lower. By default, -it lists groups of level seven or lower (i.e., just subscribed and -unsubscribed groups). - -@item A l -@kindex A l (Group) -@findex gnus-group-list-level -List all unread groups on a specific level -(@code{gnus-group-list-level}). If given a prefix, also list the groups -with no unread articles. - -@item A k -@kindex A k (Group) -@findex gnus-group-list-killed -List all killed groups (@code{gnus-group-list-killed}). If given a -prefix argument, really list all groups that are available, but aren't -currently (un)subscribed. This could entail reading the active file -from the server. - -@item A z -@kindex A z (Group) -@findex gnus-group-list-zombies -List all zombie groups (@code{gnus-group-list-zombies}). - -@item A m -@kindex A m (Group) -@findex gnus-group-list-matching -List all unread, subscribed groups with names that match a regexp -(@code{gnus-group-list-matching}). - -@item A M -@kindex A M (Group) -@findex gnus-group-list-all-matching -List groups that match a regexp (@code{gnus-group-list-all-matching}). - -@item A A -@kindex A A (Group) -@findex gnus-group-list-active -List absolutely all groups in the active file(s) of the -server(s) you are connected to (@code{gnus-group-list-active}). This -might very well take quite a while. It might actually be a better idea -to do a @kbd{A M} to list all matching, and just give @samp{.} as the -thing to match on. Also note that this command may list groups that -don't exist (yet)---these will be listed as if they were killed groups. -Take the output with some grains of salt. - -@item A a -@kindex A a (Group) -@findex gnus-group-apropos -List all groups that have names that match a regexp -(@code{gnus-group-apropos}). - -@item A d -@kindex A d (Group) -@findex gnus-group-description-apropos -List all groups that have names or descriptions that match a regexp -(@code{gnus-group-description-apropos}). - -@item A c -@kindex A c (Group) -@findex gnus-group-list-cached -List all groups with cached articles (@code{gnus-group-list-cached}). - -@item A ? -@kindex A ? (Group) -@findex gnus-group-list-dormant -List all groups with dormant articles (@code{gnus-group-list-dormant}). - -@item A / -@kindex A / (Group) -@findex gnus-group-list-limit -List groups limited within the current selection -(@code{gnus-group-list-limit}). - -@item A f -@kindex A f (Group) -@findex gnus-group-list-flush -Flush groups from the current selection (@code{gnus-group-list-flush}). - -@item A p -@kindex A p (Group) -@findex gnus-group-list-plus -List groups plus the current selection (@code{gnus-group-list-plus}). - -@end table - -@vindex gnus-permanently-visible-groups -@cindex visible group parameter -Groups that match the @code{gnus-permanently-visible-groups} regexp will -always be shown, whether they have unread articles or not. You can also -add the @code{visible} element to the group parameters in question to -get the same effect. - -@vindex gnus-list-groups-with-ticked-articles -Groups that have just ticked articles in it are normally listed in the -group buffer. If @code{gnus-list-groups-with-ticked-articles} is -@code{nil}, these groups will be treated just like totally empty -groups. It is @code{t} by default. - - -@node Sorting Groups -@section Sorting Groups -@cindex sorting groups - -@kindex C-c C-s (Group) -@findex gnus-group-sort-groups -@vindex gnus-group-sort-function -The @kbd{C-c C-s} (@code{gnus-group-sort-groups}) command sorts the -group buffer according to the function(s) given by the -@code{gnus-group-sort-function} variable. Available sorting functions -include: - -@table @code - -@item gnus-group-sort-by-alphabet -@findex gnus-group-sort-by-alphabet -Sort the group names alphabetically. This is the default. - -@item gnus-group-sort-by-real-name -@findex gnus-group-sort-by-real-name -Sort the group alphabetically on the real (unprefixed) group names. - -@item gnus-group-sort-by-level -@findex gnus-group-sort-by-level -Sort by group level. - -@item gnus-group-sort-by-score -@findex gnus-group-sort-by-score -Sort by group score. @xref{Group Score}. - -@item gnus-group-sort-by-rank -@findex gnus-group-sort-by-rank -Sort by group score and then the group level. The level and the score -are, when taken together, the group's @dfn{rank}. @xref{Group Score}. - -@item gnus-group-sort-by-unread -@findex gnus-group-sort-by-unread -Sort by number of unread articles. - -@item gnus-group-sort-by-method -@findex gnus-group-sort-by-method -Sort alphabetically on the select method. - -@item gnus-group-sort-by-server -@findex gnus-group-sort-by-server -Sort alphabetically on the Gnus server name. - - -@end table - -@code{gnus-group-sort-function} can also be a list of sorting -functions. In that case, the most significant sort key function must be -the last one. - - -There are also a number of commands for sorting directly according to -some sorting criteria: - -@table @kbd -@item G S a -@kindex G S a (Group) -@findex gnus-group-sort-groups-by-alphabet -Sort the group buffer alphabetically by group name -(@code{gnus-group-sort-groups-by-alphabet}). - -@item G S u -@kindex G S u (Group) -@findex gnus-group-sort-groups-by-unread -Sort the group buffer by the number of unread articles -(@code{gnus-group-sort-groups-by-unread}). - -@item G S l -@kindex G S l (Group) -@findex gnus-group-sort-groups-by-level -Sort the group buffer by group level -(@code{gnus-group-sort-groups-by-level}). - -@item G S v -@kindex G S v (Group) -@findex gnus-group-sort-groups-by-score -Sort the group buffer by group score -(@code{gnus-group-sort-groups-by-score}). @xref{Group Score}. - -@item G S r -@kindex G S r (Group) -@findex gnus-group-sort-groups-by-rank -Sort the group buffer by group rank -(@code{gnus-group-sort-groups-by-rank}). @xref{Group Score}. - -@item G S m -@kindex G S m (Group) -@findex gnus-group-sort-groups-by-method -Sort the group buffer alphabetically by back end name@* -(@code{gnus-group-sort-groups-by-method}). - -@item G S n -@kindex G S n (Group) -@findex gnus-group-sort-groups-by-real-name -Sort the group buffer alphabetically by real (unprefixed) group name -(@code{gnus-group-sort-groups-by-real-name}). - -@end table - -All the commands below obey the process/prefix convention -(@pxref{Process/Prefix}). - -When given a symbolic prefix (@pxref{Symbolic Prefixes}), all these -commands will sort in reverse order. - -You can also sort a subset of the groups: - -@table @kbd -@item G P a -@kindex G P a (Group) -@findex gnus-group-sort-selected-groups-by-alphabet -Sort the groups alphabetically by group name -(@code{gnus-group-sort-selected-groups-by-alphabet}). - -@item G P u -@kindex G P u (Group) -@findex gnus-group-sort-selected-groups-by-unread -Sort the groups by the number of unread articles -(@code{gnus-group-sort-selected-groups-by-unread}). - -@item G P l -@kindex G P l (Group) -@findex gnus-group-sort-selected-groups-by-level -Sort the groups by group level -(@code{gnus-group-sort-selected-groups-by-level}). - -@item G P v -@kindex G P v (Group) -@findex gnus-group-sort-selected-groups-by-score -Sort the groups by group score -(@code{gnus-group-sort-selected-groups-by-score}). @xref{Group Score}. - -@item G P r -@kindex G P r (Group) -@findex gnus-group-sort-selected-groups-by-rank -Sort the groups by group rank -(@code{gnus-group-sort-selected-groups-by-rank}). @xref{Group Score}. - -@item G P m -@kindex G P m (Group) -@findex gnus-group-sort-selected-groups-by-method -Sort the groups alphabetically by back end name@* -(@code{gnus-group-sort-selected-groups-by-method}). - -@item G P n -@kindex G P n (Group) -@findex gnus-group-sort-selected-groups-by-real-name -Sort the groups alphabetically by real (unprefixed) group name -(@code{gnus-group-sort-selected-groups-by-real-name}). - -@item G P s -@kindex G P s (Group) -@findex gnus-group-sort-selected-groups -Sort the groups according to @code{gnus-group-sort-function}. - -@end table - -And finally, note that you can use @kbd{C-k} and @kbd{C-y} to manually -move groups around. - - -@node Group Maintenance -@section Group Maintenance -@cindex bogus groups - -@table @kbd -@item b -@kindex b (Group) -@findex gnus-group-check-bogus-groups -Find bogus groups and delete them -(@code{gnus-group-check-bogus-groups}). - -@item F -@kindex F (Group) -@findex gnus-group-find-new-groups -Find new groups and process them (@code{gnus-group-find-new-groups}). -With 1 @kbd{C-u}, use the @code{ask-server} method to query the server -for new groups. With 2 @kbd{C-u}'s, use most complete method possible -to query the server for new groups, and subscribe the new groups as -zombies. - -@item C-c C-x -@kindex C-c C-x (Group) -@findex gnus-group-expire-articles -@cindex expiring mail -Run all expirable articles in the current group through the expiry -process (if any) (@code{gnus-group-expire-articles}). That is, delete -all expirable articles in the group that have been around for a while. -(@pxref{Expiring Mail}). - -@item C-c C-M-x -@kindex C-c C-M-x (Group) -@findex gnus-group-expire-all-groups -@cindex expiring mail -Run all expirable articles in all groups through the expiry process -(@code{gnus-group-expire-all-groups}). - -@end table - - -@node Browse Foreign Server -@section Browse Foreign Server -@cindex foreign servers -@cindex browsing servers - -@table @kbd -@item B -@kindex B (Group) -@findex gnus-group-browse-foreign-server -You will be queried for a select method and a server name. Gnus will -then attempt to contact this server and let you browse the groups there -(@code{gnus-group-browse-foreign-server}). -@end table - -@findex gnus-browse-mode -A new buffer with a list of available groups will appear. This buffer -will use the @code{gnus-browse-mode}. This buffer looks a bit (well, -a lot) like a normal group buffer. - -Here's a list of keystrokes available in the browse mode: - -@table @kbd -@item n -@kindex n (Browse) -@findex gnus-group-next-group -Go to the next group (@code{gnus-group-next-group}). - -@item p -@kindex p (Browse) -@findex gnus-group-prev-group -Go to the previous group (@code{gnus-group-prev-group}). - -@item SPACE -@kindex SPACE (Browse) -@findex gnus-browse-read-group -Enter the current group and display the first article -(@code{gnus-browse-read-group}). - -@item RET -@kindex RET (Browse) -@findex gnus-browse-select-group -Enter the current group (@code{gnus-browse-select-group}). - -@item u -@kindex u (Browse) -@findex gnus-browse-unsubscribe-current-group -Unsubscribe to the current group, or, as will be the case here, -subscribe to it (@code{gnus-browse-unsubscribe-current-group}). - -@item l -@itemx q -@kindex q (Browse) -@kindex l (Browse) -@findex gnus-browse-exit -Exit browse mode (@code{gnus-browse-exit}). - -@item d -@kindex d (Browse) -@findex gnus-browse-describe-group -Describe the current group (@code{gnus-browse-describe-group}). - -@item ? -@kindex ? (Browse) -@findex gnus-browse-describe-briefly -Describe browse mode briefly (well, there's not much to describe, is -there) (@code{gnus-browse-describe-briefly}). -@end table - - -@node Exiting Gnus -@section Exiting Gnus -@cindex exiting Gnus - -Yes, Gnus is ex(c)iting. - -@table @kbd -@item z -@kindex z (Group) -@findex gnus-group-suspend -Suspend Gnus (@code{gnus-group-suspend}). This doesn't really exit Gnus, -but it kills all buffers except the Group buffer. I'm not sure why this -is a gain, but then who am I to judge? - -@item q -@kindex q (Group) -@findex gnus-group-exit -@c @icon{gnus-group-exit} -Quit Gnus (@code{gnus-group-exit}). - -@item Q -@kindex Q (Group) -@findex gnus-group-quit -Quit Gnus without saving the @file{.newsrc} files (@code{gnus-group-quit}). -The dribble file will be saved, though (@pxref{Auto Save}). -@end table - -@vindex gnus-exit-gnus-hook -@vindex gnus-suspend-gnus-hook -@vindex gnus-after-exiting-gnus-hook -@code{gnus-suspend-gnus-hook} is called when you suspend Gnus and -@code{gnus-exit-gnus-hook} is called when you quit Gnus, while -@code{gnus-after-exiting-gnus-hook} is called as the final item when -exiting Gnus. - -Note: - -@quotation -Miss Lisa Cannifax, while sitting in English class, felt her feet go -numbly heavy and herself fall into a hazy trance as the boy sitting -behind her drew repeated lines with his pencil across the back of her -plastic chair. -@end quotation - - -@node Group Topics -@section Group Topics -@cindex topics - -If you read lots and lots of groups, it might be convenient to group -them hierarchically according to topics. You put your Emacs groups over -here, your sex groups over there, and the rest (what, two groups or so?) -you put in some misc section that you never bother with anyway. You can -even group the Emacs sex groups as a sub-topic to either the Emacs -groups or the sex groups---or both! Go wild! - -@iftex -@iflatex -\gnusfigure{Group Topics}{400}{ -\put(75,50){\epsfig{figure=ps/group-topic,height=9cm}} -} -@end iflatex -@end iftex - -Here's an example: - -@example -Gnus - Emacs -- I wuw it! - 3: comp.emacs - 2: alt.religion.emacs - Naughty Emacs - 452: alt.sex.emacs - 0: comp.talk.emacs.recovery - Misc - 8: comp.binaries.fractals - 13: comp.sources.unix -@end example - -@findex gnus-topic-mode -@kindex t (Group) -To get this @emph{fab} functionality you simply turn on (ooh!) the -@code{gnus-topic} minor mode---type @kbd{t} in the group buffer. (This -is a toggling command.) - -Go ahead, just try it. I'll still be here when you get back. La de -dum@dots{} Nice tune, that@dots{} la la la@dots{} What, you're back? -Yes, and now press @kbd{l}. There. All your groups are now listed -under @samp{misc}. Doesn't that make you feel all warm and fuzzy? -Hot and bothered? - -If you want this permanently enabled, you should add that minor mode to -the hook for the group mode. Put the following line in your -@file{~/.gnus.el} file: - -@lisp -(add-hook 'gnus-group-mode-hook 'gnus-topic-mode) -@end lisp - -@menu -* Topic Commands:: Interactive E-Z commands. -* Topic Variables:: How to customize the topics the Lisp Way. -* Topic Sorting:: Sorting each topic individually. -* Topic Topology:: A map of the world. -* Topic Parameters:: Parameters that apply to all groups in a topic. -@end menu - - -@node Topic Commands -@subsection Topic Commands -@cindex topic commands - -When the topic minor mode is turned on, a new @kbd{T} submap will be -available. In addition, a few of the standard keys change their -definitions slightly. - -In general, the following kinds of operations are possible on topics. -First of all, you want to create topics. Secondly, you want to put -groups in topics and to move them around until you have an order you -like. The third kind of operation is to show/hide parts of the whole -shebang. You might want to hide a topic including its subtopics and -groups, to get a better overview of the other groups. - -Here is a list of the basic keys that you might need to set up topics -the way you like. - -@table @kbd - -@item T n -@kindex T n (Topic) -@findex gnus-topic-create-topic -Prompt for a new topic name and create it -(@code{gnus-topic-create-topic}). - -@item T TAB -@itemx TAB -@kindex T TAB (Topic) -@kindex TAB (Topic) -@findex gnus-topic-indent -``Indent'' the current topic so that it becomes a sub-topic of the -previous topic (@code{gnus-topic-indent}). If given a prefix, -``un-indent'' the topic instead. - -@item M-TAB -@kindex M-TAB (Topic) -@findex gnus-topic-unindent -``Un-indent'' the current topic so that it becomes a sub-topic of the -parent of its current parent (@code{gnus-topic-unindent}). - -@end table - -The following two keys can be used to move groups and topics around. -They work like the well-known cut and paste. @kbd{C-k} is like cut and -@kbd{C-y} is like paste. Of course, this being Emacs, we use the terms -kill and yank rather than cut and paste. - -@table @kbd - -@item C-k -@kindex C-k (Topic) -@findex gnus-topic-kill-group -Kill a group or topic (@code{gnus-topic-kill-group}). All groups in the -topic will be removed along with the topic. - -@item C-y -@kindex C-y (Topic) -@findex gnus-topic-yank-group -Yank the previously killed group or topic -(@code{gnus-topic-yank-group}). Note that all topics will be yanked -before all groups. - -So, to move a topic to the beginning of the list of topics, just hit -@kbd{C-k} on it. This is like the ``cut'' part of cut and paste. Then, -move the cursor to the beginning of the buffer (just below the ``Gnus'' -topic) and hit @kbd{C-y}. This is like the ``paste'' part of cut and -paste. Like I said -- E-Z. - -You can use @kbd{C-k} and @kbd{C-y} on groups as well as on topics. So -you can move topics around as well as groups. - -@end table - -After setting up the topics the way you like them, you might wish to -hide a topic, or to show it again. That's why we have the following -key. - -@table @kbd - -@item RET -@kindex RET (Topic) -@findex gnus-topic-select-group -@itemx SPACE -Either select a group or fold a topic (@code{gnus-topic-select-group}). -When you perform this command on a group, you'll enter the group, as -usual. When done on a topic line, the topic will be folded (if it was -visible) or unfolded (if it was folded already). So it's basically a -toggling command on topics. In addition, if you give a numerical -prefix, group on that level (and lower) will be displayed. - -@end table - -Now for a list of other commands, in no particular order. - -@table @kbd - -@item T m -@kindex T m (Topic) -@findex gnus-topic-move-group -Move the current group to some other topic -(@code{gnus-topic-move-group}). This command uses the process/prefix -convention (@pxref{Process/Prefix}). - -@item T j -@kindex T j (Topic) -@findex gnus-topic-jump-to-topic -Go to a topic (@code{gnus-topic-jump-to-topic}). - -@item T c -@kindex T c (Topic) -@findex gnus-topic-copy-group -Copy the current group to some other topic -(@code{gnus-topic-copy-group}). This command uses the process/prefix -convention (@pxref{Process/Prefix}). - -@item T h -@kindex T h (Topic) -@findex gnus-topic-hide-topic -Hide the current topic (@code{gnus-topic-hide-topic}). If given -a prefix, hide the topic permanently. - -@item T s -@kindex T s (Topic) -@findex gnus-topic-show-topic -Show the current topic (@code{gnus-topic-show-topic}). If given -a prefix, show the topic permanently. - -@item T D -@kindex T D (Topic) -@findex gnus-topic-remove-group -Remove a group from the current topic (@code{gnus-topic-remove-group}). -This command is mainly useful if you have the same group in several -topics and wish to remove it from one of the topics. You may also -remove a group from all topics, but in that case, Gnus will add it to -the root topic the next time you start Gnus. In fact, all new groups -(which, naturally, don't belong to any topic) will show up in the root -topic. - -This command uses the process/prefix convention -(@pxref{Process/Prefix}). - -@item T M -@kindex T M (Topic) -@findex gnus-topic-move-matching -Move all groups that match some regular expression to a topic -(@code{gnus-topic-move-matching}). - -@item T C -@kindex T C (Topic) -@findex gnus-topic-copy-matching -Copy all groups that match some regular expression to a topic -(@code{gnus-topic-copy-matching}). - -@item T H -@kindex T H (Topic) -@findex gnus-topic-toggle-display-empty-topics -Toggle hiding empty topics -(@code{gnus-topic-toggle-display-empty-topics}). - -@item T # -@kindex T # (Topic) -@findex gnus-topic-mark-topic -Mark all groups in the current topic with the process mark -(@code{gnus-topic-mark-topic}). This command works recursively on -sub-topics unless given a prefix. - -@item T M-# -@kindex T M-# (Topic) -@findex gnus-topic-unmark-topic -Remove the process mark from all groups in the current topic -(@code{gnus-topic-unmark-topic}). This command works recursively on -sub-topics unless given a prefix. - -@item C-c C-x -@kindex C-c C-x (Topic) -@findex gnus-topic-expire-articles -@cindex expiring mail -Run all expirable articles in the current group or topic through the -expiry process (if any) -(@code{gnus-topic-expire-articles}). (@pxref{Expiring Mail}). - -@item T r -@kindex T r (Topic) -@findex gnus-topic-rename -Rename a topic (@code{gnus-topic-rename}). - -@item T DEL -@kindex T DEL (Topic) -@findex gnus-topic-delete -Delete an empty topic (@code{gnus-topic-delete}). - -@item A T -@kindex A T (Topic) -@findex gnus-topic-list-active -List all groups that Gnus knows about in a topics-ified way -(@code{gnus-topic-list-active}). - -@item T M-n -@kindex T M-n (Topic) -@findex gnus-topic-goto-next-topic -Go to the next topic (@code{gnus-topic-goto-next-topic}). - -@item T M-p -@kindex T M-p (Topic) -@findex gnus-topic-goto-previous-topic -Go to the next topic (@code{gnus-topic-goto-previous-topic}). - -@item G p -@kindex G p (Topic) -@findex gnus-topic-edit-parameters -@cindex group parameters -@cindex topic parameters -@cindex parameters -Edit the topic parameters (@code{gnus-topic-edit-parameters}). -@xref{Topic Parameters}. - -@end table - - -@node Topic Variables -@subsection Topic Variables -@cindex topic variables - -The previous section told you how to tell Gnus which topics to display. -This section explains how to tell Gnus what to display about each topic. - -@vindex gnus-topic-line-format -The topic lines themselves are created according to the -@code{gnus-topic-line-format} variable (@pxref{Formatting Variables}). -Valid elements are: - -@table @samp -@item i -Indentation. -@item n -Topic name. -@item v -Visibility. -@item l -Level. -@item g -Number of groups in the topic. -@item a -Number of unread articles in the topic. -@item A -Number of unread articles in the topic and all its subtopics. -@end table - -@vindex gnus-topic-indent-level -Each sub-topic (and the groups in the sub-topics) will be indented with -@code{gnus-topic-indent-level} times the topic level number of spaces. -The default is 2. - -@vindex gnus-topic-mode-hook -@code{gnus-topic-mode-hook} is called in topic minor mode buffers. - -@vindex gnus-topic-display-empty-topics -The @code{gnus-topic-display-empty-topics} says whether to display even -topics that have no unread articles in them. The default is @code{t}. - - -@node Topic Sorting -@subsection Topic Sorting -@cindex topic sorting - -You can sort the groups in each topic individually with the following -commands: - - -@table @kbd -@item T S a -@kindex T S a (Topic) -@findex gnus-topic-sort-groups-by-alphabet -Sort the current topic alphabetically by group name -(@code{gnus-topic-sort-groups-by-alphabet}). - -@item T S u -@kindex T S u (Topic) -@findex gnus-topic-sort-groups-by-unread -Sort the current topic by the number of unread articles -(@code{gnus-topic-sort-groups-by-unread}). - -@item T S l -@kindex T S l (Topic) -@findex gnus-topic-sort-groups-by-level -Sort the current topic by group level -(@code{gnus-topic-sort-groups-by-level}). - -@item T S v -@kindex T S v (Topic) -@findex gnus-topic-sort-groups-by-score -Sort the current topic by group score -(@code{gnus-topic-sort-groups-by-score}). @xref{Group Score}. - -@item T S r -@kindex T S r (Topic) -@findex gnus-topic-sort-groups-by-rank -Sort the current topic by group rank -(@code{gnus-topic-sort-groups-by-rank}). @xref{Group Score}. - -@item T S m -@kindex T S m (Topic) -@findex gnus-topic-sort-groups-by-method -Sort the current topic alphabetically by back end name -(@code{gnus-topic-sort-groups-by-method}). - -@item T S e -@kindex T S e (Topic) -@findex gnus-topic-sort-groups-by-server -Sort the current topic alphabetically by server name -(@code{gnus-topic-sort-groups-by-server}). - -@item T S s -@kindex T S s (Topic) -@findex gnus-topic-sort-groups -Sort the current topic according to the function(s) given by the -@code{gnus-group-sort-function} variable -(@code{gnus-topic-sort-groups}). - -@end table - -When given a prefix argument, all these commands will sort in reverse -order. @xref{Sorting Groups}, for more information about group -sorting. - - -@node Topic Topology -@subsection Topic Topology -@cindex topic topology -@cindex topology - -So, let's have a look at an example group buffer: - -@example -@group -Gnus - Emacs -- I wuw it! - 3: comp.emacs - 2: alt.religion.emacs - Naughty Emacs - 452: alt.sex.emacs - 0: comp.talk.emacs.recovery - Misc - 8: comp.binaries.fractals - 13: comp.sources.unix -@end group -@end example - -So, here we have one top-level topic (@samp{Gnus}), two topics under -that, and one sub-topic under one of the sub-topics. (There is always -just one (1) top-level topic). This topology can be expressed as -follows: - -@lisp -(("Gnus" visible) - (("Emacs -- I wuw it!" visible) - (("Naughty Emacs" visible))) - (("Misc" visible))) -@end lisp - -@vindex gnus-topic-topology -This is in fact how the variable @code{gnus-topic-topology} would look -for the display above. That variable is saved in the @file{.newsrc.eld} -file, and shouldn't be messed with manually---unless you really want -to. Since this variable is read from the @file{.newsrc.eld} file, -setting it in any other startup files will have no effect. - -This topology shows what topics are sub-topics of what topics (right), -and which topics are visible. Two settings are currently -allowed---@code{visible} and @code{invisible}. - - -@node Topic Parameters -@subsection Topic Parameters -@cindex topic parameters - -All groups in a topic will inherit group parameters from the parent -(and ancestor) topic parameters. All valid group parameters are valid -topic parameters (@pxref{Group Parameters}). When the agent is -enabled, all agent parameters (See Agent Parameters in @ref{Category -Syntax}) are also valid topic parameters. - -In addition, the following parameters are only valid as topic -parameters: - -@table @code -@item subscribe -When subscribing new groups by topic (@pxref{Subscription Methods}), the -@code{subscribe} topic parameter says what groups go in what topic. Its -value should be a regexp to match the groups that should go in that -topic. - -@item subscribe-level -When subscribing new groups by topic (see the @code{subscribe} parameter), -the group will be subscribed with the level specified in the -@code{subscribe-level} instead of @code{gnus-level-default-subscribed}. - -@end table - -Group parameters (of course) override topic parameters, and topic -parameters in sub-topics override topic parameters in super-topics. You -know. Normal inheritance rules. (@dfn{Rules} is here a noun, not a -verb, although you may feel free to disagree with me here.) - -@example -@group -Gnus - Emacs - 3: comp.emacs - 2: alt.religion.emacs - 452: alt.sex.emacs - Relief - 452: alt.sex.emacs - 0: comp.talk.emacs.recovery - Misc - 8: comp.binaries.fractals - 13: comp.sources.unix - 452: alt.sex.emacs -@end group -@end example - -The @samp{Emacs} topic has the topic parameter @code{(score-file -. "emacs.SCORE")}; the @samp{Relief} topic has the topic parameter -@code{(score-file . "relief.SCORE")}; and the @samp{Misc} topic has the -topic parameter @code{(score-file . "emacs.SCORE")}. In addition, -@* @samp{alt.religion.emacs} has the group parameter @code{(score-file -. "religion.SCORE")}. - -Now, when you enter @samp{alt.sex.emacs} in the @samp{Relief} topic, you -will get the @file{relief.SCORE} home score file. If you enter the same -group in the @samp{Emacs} topic, you'll get the @file{emacs.SCORE} home -score file. If you enter the group @samp{alt.religion.emacs}, you'll -get the @file{religion.SCORE} home score file. - -This seems rather simple and self-evident, doesn't it? Well, yes. But -there are some problems, especially with the @code{total-expiry} -parameter. Say you have a mail group in two topics; one with -@code{total-expiry} and one without. What happens when you do @kbd{M-x -gnus-expire-all-expirable-groups}? Gnus has no way of telling which one -of these topics you mean to expire articles from, so anything may -happen. In fact, I hereby declare that it is @dfn{undefined} what -happens. You just have to be careful if you do stuff like that. - - -@node Misc Group Stuff -@section Misc Group Stuff - -@menu -* Scanning New Messages:: Asking Gnus to see whether new messages have arrived. -* Group Information:: Information and help on groups and Gnus. -* Group Timestamp:: Making Gnus keep track of when you last read a group. -* File Commands:: Reading and writing the Gnus files. -* Sieve Commands:: Managing Sieve scripts. -@end menu - -@table @kbd - -@item v -@kindex v (Group) -@cindex keys, reserved for users (Group) -The key @kbd{v} is reserved for users. You can bind it to some -command or better use it as a prefix key. For example: - -@lisp -(define-key gnus-group-mode-map (kbd "v j d") - (lambda () - (interactive) - (gnus-group-jump-to-group "nndraft:drafts"))) -@end lisp - -On keys reserved for users in Emacs and on keybindings in general -@xref{Keymaps, Keymaps, , emacs, The Emacs Editor}. - -@item ^ -@kindex ^ (Group) -@findex gnus-group-enter-server-mode -Enter the server buffer (@code{gnus-group-enter-server-mode}). -@xref{Server Buffer}. - -@item a -@kindex a (Group) -@findex gnus-group-post-news -Start composing a message (a news by default) -(@code{gnus-group-post-news}). If given a prefix, post to the group -under the point. If the prefix is 1, prompt for a group to post to. -Contrary to what the name of this function suggests, the prepared -article might be a mail instead of a news, if a mail group is specified -with the prefix argument. @xref{Composing Messages}. - -@item m -@kindex m (Group) -@findex gnus-group-mail -Mail a message somewhere (@code{gnus-group-mail}). If given a prefix, -use the posting style of the group under the point. If the prefix is 1, -prompt for a group name to find the posting style. -@xref{Composing Messages}. - -@item i -@kindex i (Group) -@findex gnus-group-news -Start composing a news (@code{gnus-group-news}). If given a prefix, -post to the group under the point. If the prefix is 1, prompt -for group to post to. @xref{Composing Messages}. - -This function actually prepares a news even when using mail groups. -This is useful for ``posting'' messages to mail groups without actually -sending them over the network: they're just saved directly to the group -in question. The corresponding back end must have a request-post method -for this to work though. - -@end table - -Variables for the group buffer: - -@table @code - -@item gnus-group-mode-hook -@vindex gnus-group-mode-hook -is called after the group buffer has been -created. - -@item gnus-group-prepare-hook -@vindex gnus-group-prepare-hook -is called after the group buffer is -generated. It may be used to modify the buffer in some strange, -unnatural way. - -@item gnus-group-prepared-hook -@vindex gnus-group-prepare-hook -is called as the very last thing after the group buffer has been -generated. It may be used to move point around, for instance. - -@item gnus-permanently-visible-groups -@vindex gnus-permanently-visible-groups -Groups matching this regexp will always be listed in the group buffer, -whether they are empty or not. - -@item gnus-group-name-charset-method-alist -@vindex gnus-group-name-charset-method-alist -An alist of method and the charset for group names. It is used to show -non-@acronym{ASCII} group names. - -For example: -@lisp -(setq gnus-group-name-charset-method-alist - '(((nntp "news.com.cn") . cn-gb-2312))) -@end lisp - -@item gnus-group-name-charset-group-alist -@cindex UTF-8 group names -@vindex gnus-group-name-charset-group-alist -An alist of regexp of group name and the charset for group names. It -is used to show non-@acronym{ASCII} group names. @code{((".*" -utf-8))} is the default value if UTF-8 is supported, otherwise the -default is @code{nil}. - -For example: -@lisp -(setq gnus-group-name-charset-group-alist - '(("\\.com\\.cn:" . cn-gb-2312))) -@end lisp - -@end table - -@node Scanning New Messages -@subsection Scanning New Messages -@cindex new messages -@cindex scanning new news - -@table @kbd - -@item g -@kindex g (Group) -@findex gnus-group-get-new-news -@c @icon{gnus-group-get-new-news} -Check the server(s) for new articles. If the numerical prefix is used, -this command will check only groups of level @var{arg} and lower -(@code{gnus-group-get-new-news}). If given a non-numerical prefix, this -command will force a total re-reading of the active file(s) from the -back end(s). - -@item M-g -@kindex M-g (Group) -@findex gnus-group-get-new-news-this-group -@vindex gnus-goto-next-group-when-activating -@c @icon{gnus-group-get-new-news-this-group} -Check whether new articles have arrived in the current group -(@code{gnus-group-get-new-news-this-group}). -@code{gnus-goto-next-group-when-activating} says whether this command is -to move point to the next group or not. It is @code{t} by default. - -@findex gnus-activate-all-groups -@cindex activating groups -@item C-c M-g -@kindex C-c M-g (Group) -Activate absolutely all groups (@code{gnus-activate-all-groups}). - -@item R -@kindex R (Group) -@cindex restarting -@findex gnus-group-restart -Restart Gnus (@code{gnus-group-restart}). This saves the @file{.newsrc} -file(s), closes the connection to all servers, clears up all run-time -Gnus variables, and then starts Gnus all over again. - -@end table - -@vindex gnus-get-new-news-hook -@code{gnus-get-new-news-hook} is run just before checking for new news. - -@vindex gnus-after-getting-new-news-hook -@code{gnus-after-getting-new-news-hook} is run after checking for new -news. - - -@node Group Information -@subsection Group Information -@cindex group information -@cindex information on groups - -@table @kbd - - -@item H f -@kindex H f (Group) -@findex gnus-group-fetch-faq -@vindex gnus-group-faq-directory -@cindex FAQ -@cindex ange-ftp -Try to fetch the @acronym{FAQ} for the current group -(@code{gnus-group-fetch-faq}). Gnus will try to get the @acronym{FAQ} -from @code{gnus-group-faq-directory}, which is usually a directory on -a remote machine. This variable can also be a list of directories. -In that case, giving a prefix to this command will allow you to choose -between the various sites. @code{ange-ftp} (or @code{efs}) will be -used for fetching the file. - -If fetching from the first site is unsuccessful, Gnus will attempt to go -through @code{gnus-group-faq-directory} and try to open them one by one. - -@item H c -@kindex H c (Group) -@findex gnus-group-fetch-charter -@vindex gnus-group-charter-alist -@cindex charter -Try to open the charter for the current group in a web browser -(@code{gnus-group-fetch-charter}). Query for a group if given a -prefix argument. - -Gnus will use @code{gnus-group-charter-alist} to find the location of -the charter. If no location is known, Gnus will fetch the control -messages for the group, which in some cases includes the charter. - -@item H C -@kindex H C (Group) -@findex gnus-group-fetch-control -@vindex gnus-group-fetch-control-use-browse-url -@cindex control message -Fetch the control messages for the group from the archive at -@code{ftp.isc.org} (@code{gnus-group-fetch-control}). Query for a -group if given a prefix argument. - -If @code{gnus-group-fetch-control-use-browse-url} is non-@code{nil}, -Gnus will open the control messages in a browser using -@code{browse-url}. Otherwise they are fetched using @code{ange-ftp} -and displayed in an ephemeral group. - -Note that the control messages are compressed. To use this command -you need to turn on @code{auto-compression-mode} (@pxref{Compressed -Files, ,Compressed Files, emacs, The Emacs Manual}). - -@item H d -@itemx C-c C-d -@c @icon{gnus-group-describe-group} -@kindex H d (Group) -@kindex C-c C-d (Group) -@cindex describing groups -@cindex group description -@findex gnus-group-describe-group -Describe the current group (@code{gnus-group-describe-group}). If given -a prefix, force Gnus to re-read the description from the server. - -@item M-d -@kindex M-d (Group) -@findex gnus-group-describe-all-groups -Describe all groups (@code{gnus-group-describe-all-groups}). If given a -prefix, force Gnus to re-read the description file from the server. - -@item H v -@itemx V -@kindex V (Group) -@kindex H v (Group) -@cindex version -@findex gnus-version -Display current Gnus version numbers (@code{gnus-version}). - -@item ? -@kindex ? (Group) -@findex gnus-group-describe-briefly -Give a very short help message (@code{gnus-group-describe-briefly}). - -@item C-c C-i -@kindex C-c C-i (Group) -@cindex info -@cindex manual -@findex gnus-info-find-node -Go to the Gnus info node (@code{gnus-info-find-node}). -@end table - - -@node Group Timestamp -@subsection Group Timestamp -@cindex timestamps -@cindex group timestamps - -It can be convenient to let Gnus keep track of when you last read a -group. To set the ball rolling, you should add -@code{gnus-group-set-timestamp} to @code{gnus-select-group-hook}: - -@lisp -(add-hook 'gnus-select-group-hook 'gnus-group-set-timestamp) -@end lisp - -After doing this, each time you enter a group, it'll be recorded. - -This information can be displayed in various ways---the easiest is to -use the @samp{%d} spec in the group line format: - -@lisp -(setq gnus-group-line-format - "%M\%S\%p\%P\%5y: %(%-40,40g%) %d\n") -@end lisp - -This will result in lines looking like: - -@example -* 0: mail.ding 19961002T012943 - 0: custom 19961002T012713 -@end example - -As you can see, the date is displayed in compact ISO 8601 format. This -may be a bit too much, so to just display the date, you could say -something like: - -@lisp -(setq gnus-group-line-format - "%M\%S\%p\%P\%5y: %(%-40,40g%) %6,6~(cut 2)d\n") -@end lisp - -If you would like greater control of the time format, you can use a -user-defined format spec. Something like the following should do the -trick: - -@lisp -(setq gnus-group-line-format - "%M\%S\%p\%P\%5y: %(%-40,40g%) %ud\n") -(defun gnus-user-format-function-d (headers) - (let ((time (gnus-group-timestamp gnus-tmp-group))) - (if time - (format-time-string "%b %d %H:%M" time) - ""))) -@end lisp - - -@node File Commands -@subsection File Commands -@cindex file commands - -@table @kbd - -@item r -@kindex r (Group) -@findex gnus-group-read-init-file -@vindex gnus-init-file -@cindex reading init file -Re-read the init file (@code{gnus-init-file}, which defaults to -@file{~/.gnus.el}) (@code{gnus-group-read-init-file}). - -@item s -@kindex s (Group) -@findex gnus-group-save-newsrc -@cindex saving .newsrc -Save the @file{.newsrc.eld} file (and @file{.newsrc} if wanted) -(@code{gnus-group-save-newsrc}). If given a prefix, force saving the -file(s) whether Gnus thinks it is necessary or not. - -@c @item Z -@c @kindex Z (Group) -@c @findex gnus-group-clear-dribble -@c Clear the dribble buffer (@code{gnus-group-clear-dribble}). - -@end table - - -@node Sieve Commands -@subsection Sieve Commands -@cindex group sieve commands - -Sieve is a server-side mail filtering language. In Gnus you can use -the @code{sieve} group parameter (@pxref{Group Parameters}) to specify -sieve rules that should apply to each group. Gnus provides two -commands to translate all these group parameters into a proper Sieve -script that can be transfered to the server somehow. - -@vindex gnus-sieve-file -@vindex gnus-sieve-region-start -@vindex gnus-sieve-region-end -The generated Sieve script is placed in @code{gnus-sieve-file} (by -default @file{~/.sieve}). The Sieve code that Gnus generate is placed -between two delimiters, @code{gnus-sieve-region-start} and -@code{gnus-sieve-region-end}, so you may write additional Sieve code -outside these delimiters that will not be removed the next time you -regenerate the Sieve script. - -@vindex gnus-sieve-crosspost -The variable @code{gnus-sieve-crosspost} controls how the Sieve script -is generated. If it is non-@code{nil} (the default) articles is -placed in all groups that have matching rules, otherwise the article -is only placed in the group with the first matching rule. For -example, the group parameter @samp{(sieve address "sender" -"owner-ding@@hpc.uh.edu")} will generate the following piece of Sieve -code if @code{gnus-sieve-crosspost} is @code{nil}. (When -@code{gnus-sieve-crosspost} is non-@code{nil}, it looks the same -except that the line containing the call to @code{stop} is removed.) - -@example -if address "sender" "owner-ding@@hpc.uh.edu" @{ - fileinto "INBOX.ding"; - stop; -@} -@end example - -@xref{Top, Emacs Sieve, Top, sieve, Emacs Sieve}. - -@table @kbd - -@item D g -@kindex D g (Group) -@findex gnus-sieve-generate -@vindex gnus-sieve-file -@cindex generating sieve script -Regenerate a Sieve script from the @code{sieve} group parameters and -put you into the @code{gnus-sieve-file} without saving it. - -@item D u -@kindex D u (Group) -@findex gnus-sieve-update -@vindex gnus-sieve-file -@cindex updating sieve script -Regenerates the Gnus managed part of @code{gnus-sieve-file} using the -@code{sieve} group parameters, save the file and upload it to the -server using the @code{sieveshell} program. - -@end table - - -@node Summary Buffer -@chapter Summary Buffer -@cindex summary buffer - -A line for each article is displayed in the summary buffer. You can -move around, read articles, post articles and reply to articles. - -The most common way to a summary buffer is to select a group from the -group buffer (@pxref{Selecting a Group}). - -You can have as many summary buffers open as you wish. - -You can customize the Summary Mode tool bar, see @kbd{M-x -customize-apropos RET gnus-summary-tool-bar}. This feature is only -available in Emacs. - -@kindex v (Summary) -@cindex keys, reserved for users (Summary) -The key @kbd{v} is reserved for users. You can bind it to some -command or better use it as a prefix key. For example: -@lisp -(define-key gnus-summary-mode-map (kbd "v -") "LrS") ;; lower subthread -@end lisp - -@menu -* Summary Buffer Format:: Deciding how the summary buffer is to look. -* Summary Maneuvering:: Moving around the summary buffer. -* Choosing Articles:: Reading articles. -* Paging the Article:: Scrolling the current article. -* Reply Followup and Post:: Posting articles. -* Delayed Articles:: Send articles at a later time. -* Marking Articles:: Marking articles as read, expirable, etc. -* Limiting:: You can limit the summary buffer. -* Threading:: How threads are made. -* Sorting the Summary Buffer:: How articles and threads are sorted. -* Asynchronous Fetching:: Gnus might be able to pre-fetch articles. -* Article Caching:: You may store articles in a cache. -* Persistent Articles:: Making articles expiry-resistant. -* Article Backlog:: Having already read articles hang around. -* Saving Articles:: Ways of customizing article saving. -* Decoding Articles:: Gnus can treat series of (uu)encoded articles. -* Article Treatment:: The article buffer can be mangled at will. -* MIME Commands:: Doing MIMEy things with the articles. -* Charsets:: Character set issues. -* Article Commands:: Doing various things with the article buffer. -* Summary Sorting:: Sorting the summary buffer in various ways. -* Finding the Parent:: No child support? Get the parent. -* Alternative Approaches:: Reading using non-default summaries. -* Tree Display:: A more visual display of threads. -* Mail Group Commands:: Some commands can only be used in mail groups. -* Various Summary Stuff:: What didn't fit anywhere else. -* Exiting the Summary Buffer:: Returning to the Group buffer, - or reselecting the current group. -* Crosspost Handling:: How crossposted articles are dealt with. -* Duplicate Suppression:: An alternative when crosspost handling fails. -* Security:: Decrypt and Verify. -* Mailing List:: Mailing list minor mode. -@end menu - - -@node Summary Buffer Format -@section Summary Buffer Format -@cindex summary buffer format - -@iftex -@iflatex -\gnusfigure{The Summary Buffer}{180}{ -\put(0,0){\epsfig{figure=ps/summary,width=7.5cm}} -\put(445,0){\makebox(0,0)[br]{\epsfig{figure=ps/summary-article,width=7.5cm}}} -} -@end iflatex -@end iftex - -@menu -* Summary Buffer Lines:: You can specify how summary lines should look. -* To From Newsgroups:: How to not display your own name. -* Summary Buffer Mode Line:: You can say how the mode line should look. -* Summary Highlighting:: Making the summary buffer all pretty and nice. -@end menu - -@findex mail-extract-address-components -@findex gnus-extract-address-components -@vindex gnus-extract-address-components -Gnus will use the value of the @code{gnus-extract-address-components} -variable as a function for getting the name and address parts of a -@code{From} header. Two pre-defined functions exist: -@code{gnus-extract-address-components}, which is the default, quite -fast, and too simplistic solution; and -@code{mail-extract-address-components}, which works very nicely, but is -slower. The default function will return the wrong answer in 5% of the -cases. If this is unacceptable to you, use the other function instead: - -@lisp -(setq gnus-extract-address-components - 'mail-extract-address-components) -@end lisp - -@vindex gnus-summary-same-subject -@code{gnus-summary-same-subject} is a string indicating that the current -article has the same subject as the previous. This string will be used -with those specs that require it. The default is @code{""}. - - -@node Summary Buffer Lines -@subsection Summary Buffer Lines - -@vindex gnus-summary-line-format -You can change the format of the lines in the summary buffer by changing -the @code{gnus-summary-line-format} variable. It works along the same -lines as a normal @code{format} string, with some extensions -(@pxref{Formatting Variables}). - -There should always be a colon or a point position marker on the line; -the cursor always moves to the point position marker or the colon after -performing an operation. (Of course, Gnus wouldn't be Gnus if it wasn't -possible to change this. Just write a new function -@code{gnus-goto-colon} which does whatever you like with the cursor.) -@xref{Positioning Point}. - -The default string is @samp{%U%R%z%I%(%[%4L: %-23,23f%]%) %s\n}. - -The following format specification characters and extended format -specification(s) are understood: - -@table @samp -@item N -Article number. -@item S -Subject string. List identifiers stripped, -@code{gnus-list-identifiers}. @xref{Article Hiding}. -@item s -Subject if the article is the root of the thread or the previous article -had a different subject, @code{gnus-summary-same-subject} otherwise. -(@code{gnus-summary-same-subject} defaults to @code{""}.) -@item F -Full @code{From} header. -@item n -The name (from the @code{From} header). -@item f -The name, @code{To} header or the @code{Newsgroups} header (@pxref{To -From Newsgroups}). -@item a -The name (from the @code{From} header). This differs from the @code{n} -spec in that it uses the function designated by the -@code{gnus-extract-address-components} variable, which is slower, but -may be more thorough. -@item A -The address (from the @code{From} header). This works the same way as -the @code{a} spec. -@item L -Number of lines in the article. -@item c -Number of characters in the article. This specifier is not supported -in some methods (like nnfolder). -@item k -Pretty-printed version of the number of characters in the article; -for example, @samp{1.2k} or @samp{0.4M}. -@item I -Indentation based on thread level (@pxref{Customizing Threading}). -@item B -A complex trn-style thread tree, showing response-connecting trace -lines. A thread could be drawn like this: - -@example -> -+-> -| +-> -| | \-> -| | \-> -| \-> -+-> -\-> -@end example - -You can customize the appearance with the following options. Note -that it is possible to make the thread display look really neat by -replacing the default @acronym{ASCII} characters with graphic -line-drawing glyphs. -@table @code -@item gnus-sum-thread-tree-root -@vindex gnus-sum-thread-tree-root -Used for the root of a thread. If @code{nil}, use subject -instead. The default is @samp{> }. - -@item gnus-sum-thread-tree-false-root -@vindex gnus-sum-thread-tree-false-root -Used for the false root of a thread (@pxref{Loose Threads}). If -@code{nil}, use subject instead. The default is @samp{> }. - -@item gnus-sum-thread-tree-single-indent -@vindex gnus-sum-thread-tree-single-indent -Used for a thread with just one message. If @code{nil}, use subject -instead. The default is @samp{}. - -@item gnus-sum-thread-tree-vertical -@vindex gnus-sum-thread-tree-vertical -Used for drawing a vertical line. The default is @samp{| }. - -@item gnus-sum-thread-tree-indent -@vindex gnus-sum-thread-tree-indent -Used for indenting. The default is @samp{ }. - -@item gnus-sum-thread-tree-leaf-with-other -@vindex gnus-sum-thread-tree-leaf-with-other -Used for a leaf with brothers. The default is @samp{+-> }. - -@item gnus-sum-thread-tree-single-leaf -@vindex gnus-sum-thread-tree-single-leaf -Used for a leaf without brothers. The default is @samp{\-> } - -@end table - -@item T -Nothing if the article is a root and lots of spaces if it isn't (it -pushes everything after it off the screen). -@item [ -Opening bracket, which is normally @samp{[}, but can also be @samp{<} -for adopted articles (@pxref{Customizing Threading}). -@item ] -Closing bracket, which is normally @samp{]}, but can also be @samp{>} -for adopted articles. -@item > -One space for each thread level. -@item < -Twenty minus thread level spaces. -@item U -Unread. @xref{Read Articles}. - -@item R -This misleadingly named specifier is the @dfn{secondary mark}. This -mark will say whether the article has been replied to, has been cached, -or has been saved. @xref{Other Marks}. - -@item i -Score as a number (@pxref{Scoring}). -@item z -@vindex gnus-summary-zcore-fuzz -Zcore, @samp{+} if above the default level and @samp{-} if below the -default level. If the difference between -@code{gnus-summary-default-score} and the score is less than -@code{gnus-summary-zcore-fuzz}, this spec will not be used. -@item V -Total thread score. -@item x -@code{Xref}. -@item D -@code{Date}. -@item d -The @code{Date} in @code{DD-MMM} format. -@item o -The @code{Date} in @var{YYYYMMDD}@code{T}@var{HHMMSS} format. -@item M -@code{Message-ID}. -@item r -@code{References}. -@item t -Number of articles in the current sub-thread. Using this spec will slow -down summary buffer generation somewhat. -@item e -An @samp{=} (@code{gnus-not-empty-thread-mark}) will be displayed if the -article has any children. -@item P -The line number. -@item O -Download mark. -@item * -Desired cursor position (instead of after first colon). -@item &user-date; -Age sensitive date format. Various date format is defined in -@code{gnus-user-date-format-alist}. -@item u -User defined specifier. The next character in the format string should -be a letter. Gnus will call the function -@code{gnus-user-format-function-@var{x}}, where @var{x} is the letter -following @samp{%u}. The function will be passed the current header as -argument. The function should return a string, which will be inserted -into the summary just like information from any other summary specifier. -@end table - -Text between @samp{%(} and @samp{%)} will be highlighted with -@code{gnus-mouse-face} when the mouse point is placed inside the area. -There can only be one such area. - -The @samp{%U} (status), @samp{%R} (replied) and @samp{%z} (zcore) specs -have to be handled with care. For reasons of efficiency, Gnus will -compute what column these characters will end up in, and ``hard-code'' -that. This means that it is invalid to have these specs after a -variable-length spec. Well, you might not be arrested, but your summary -buffer will look strange, which is bad enough. - -The smart choice is to have these specs as far to the left as possible. -(Isn't that the case with everything, though? But I digress.) - -This restriction may disappear in later versions of Gnus. - - -@node To From Newsgroups -@subsection To From Newsgroups -@cindex To -@cindex Newsgroups - -In some groups (particularly in archive groups), the @code{From} header -isn't very interesting, since all the articles there are written by -you. To display the information in the @code{To} or @code{Newsgroups} -headers instead, you need to decide three things: What information to -gather; where to display it; and when to display it. - -@enumerate -@item -@vindex gnus-extra-headers -The reading of extra header information is controlled by the -@code{gnus-extra-headers}. This is a list of header symbols. For -instance: - -@lisp -(setq gnus-extra-headers - '(To Newsgroups X-Newsreader)) -@end lisp - -This will result in Gnus trying to obtain these three headers, and -storing it in header structures for later easy retrieval. - -@item -@findex gnus-extra-header -The value of these extra headers can be accessed via the -@code{gnus-extra-header} function. Here's a format line spec that will -access the @code{X-Newsreader} header: - -@example -"%~(form (gnus-extra-header 'X-Newsreader))@@" -@end example - -@item -@vindex gnus-ignored-from-addresses -The @code{gnus-ignored-from-addresses} variable says when the @samp{%f} -summary line spec returns the @code{To}, @code{Newsreader} or -@code{From} header. If this regexp matches the contents of the -@code{From} header, the value of the @code{To} or @code{Newsreader} -headers are used instead. - -@end enumerate - -@vindex nnmail-extra-headers -A related variable is @code{nnmail-extra-headers}, which controls when -to include extra headers when generating overview (@acronym{NOV}) files. -If you have old overview files, you should regenerate them after -changing this variable, by entering the server buffer using @kbd{^}, -and then @kbd{g} on the appropriate mail server (e.g. nnml) to cause -regeneration. - -@vindex gnus-summary-line-format -You also have to instruct Gnus to display the data by changing the -@code{%n} spec to the @code{%f} spec in the -@code{gnus-summary-line-format} variable. - -In summary, you'd typically put something like the following in -@file{~/.gnus.el}: - -@lisp -(setq gnus-extra-headers - '(To Newsgroups)) -(setq nnmail-extra-headers gnus-extra-headers) -(setq gnus-summary-line-format - "%U%R%z%I%(%[%4L: %-23,23f%]%) %s\n") -(setq gnus-ignored-from-addresses - "Your Name Here") -@end lisp - -(The values listed above are the default values in Gnus. Alter them -to fit your needs.) - -A note for news server administrators, or for users who wish to try to -convince their news server administrator to provide some additional -support: - -The above is mostly useful for mail groups, where you have control over -the @acronym{NOV} files that are created. However, if you can persuade your -nntp admin to add (in the usual implementation, notably INN): - -@example -Newsgroups:full -@end example - -to the end of her @file{overview.fmt} file, then you can use that just -as you would the extra headers from the mail groups. - - -@node Summary Buffer Mode Line -@subsection Summary Buffer Mode Line - -@vindex gnus-summary-mode-line-format -You can also change the format of the summary mode bar (@pxref{Mode Line -Formatting}). Set @code{gnus-summary-mode-line-format} to whatever you -like. The default is @samp{Gnus: %%b [%A] %Z}. - -Here are the elements you can play with: - -@table @samp -@item G -Group name. -@item p -Unprefixed group name. -@item A -Current article number. -@item z -Current article score. -@item V -Gnus version. -@item U -Number of unread articles in this group. -@item e -Number of unread articles in this group that aren't displayed in the -summary buffer. -@item Z -A string with the number of unread and unselected articles represented -either as @samp{<%U(+%e) more>} if there are both unread and unselected -articles, and just as @samp{<%U more>} if there are just unread articles -and no unselected ones. -@item g -Shortish group name. For instance, @samp{rec.arts.anime} will be -shortened to @samp{r.a.anime}. -@item S -Subject of the current article. -@item u -User-defined spec (@pxref{User-Defined Specs}). -@item s -Name of the current score file (@pxref{Scoring}). -@item d -Number of dormant articles (@pxref{Unread Articles}). -@item t -Number of ticked articles (@pxref{Unread Articles}). -@item r -Number of articles that have been marked as read in this session. -@item E -Number of articles expunged by the score files. -@end table - - -@node Summary Highlighting -@subsection Summary Highlighting - -@table @code - -@item gnus-visual-mark-article-hook -@vindex gnus-visual-mark-article-hook -This hook is run after selecting an article. It is meant to be used for -highlighting the article in some way. It is not run if -@code{gnus-visual} is @code{nil}. - -@item gnus-summary-update-hook -@vindex gnus-summary-update-hook -This hook is called when a summary line is changed. It is not run if -@code{gnus-visual} is @code{nil}. - -@item gnus-summary-selected-face -@vindex gnus-summary-selected-face -This is the face (or @dfn{font} as some people call it) used to -highlight the current article in the summary buffer. - -@item gnus-summary-highlight -@vindex gnus-summary-highlight -Summary lines are highlighted according to this variable, which is a -list where the elements are of the format @code{(@var{form} -. @var{face})}. If you would, for instance, like ticked articles to be -italic and high-scored articles to be bold, you could set this variable -to something like -@lisp -(((eq mark gnus-ticked-mark) . italic) - ((> score default) . bold)) -@end lisp -As you may have guessed, if @var{form} returns a non-@code{nil} value, -@var{face} will be applied to the line. -@end table - - -@node Summary Maneuvering -@section Summary Maneuvering -@cindex summary movement - -All the straight movement commands understand the numeric prefix and -behave pretty much as you'd expect. - -None of these commands select articles. - -@table @kbd -@item G M-n -@itemx M-n -@kindex M-n (Summary) -@kindex G M-n (Summary) -@findex gnus-summary-next-unread-subject -Go to the next summary line of an unread article -(@code{gnus-summary-next-unread-subject}). - -@item G M-p -@itemx M-p -@kindex M-p (Summary) -@kindex G M-p (Summary) -@findex gnus-summary-prev-unread-subject -Go to the previous summary line of an unread article -(@code{gnus-summary-prev-unread-subject}). - -@item G g -@kindex G g (Summary) -@findex gnus-summary-goto-subject -Ask for an article number and then go to the summary line of that article -without displaying the article (@code{gnus-summary-goto-subject}). -@end table - -If Gnus asks you to press a key to confirm going to the next group, you -can use the @kbd{C-n} and @kbd{C-p} keys to move around the group -buffer, searching for the next group to read without actually returning -to the group buffer. - -Variables related to summary movement: - -@table @code - -@vindex gnus-auto-select-next -@item gnus-auto-select-next -If you issue one of the movement commands (like @kbd{n}) and there are -no more unread articles after the current one, Gnus will offer to go to -the next group. If this variable is @code{t} and the next group is -empty, Gnus will exit summary mode and return to the group buffer. If -this variable is neither @code{t} nor @code{nil}, Gnus will select the -next group with unread articles. As a special case, if this variable -is @code{quietly}, Gnus will select the next group without asking for -confirmation. If this variable is @code{almost-quietly}, the same -will happen only if you are located on the last article in the group. -Finally, if this variable is @code{slightly-quietly}, the @kbd{Z n} -command will go to the next group without confirmation. Also -@pxref{Group Levels}. - -@item gnus-auto-select-same -@vindex gnus-auto-select-same -If non-@code{nil}, all the movement commands will try to go to the next -article with the same subject as the current. (@dfn{Same} here might -mean @dfn{roughly equal}. See @code{gnus-summary-gather-subject-limit} -for details (@pxref{Customizing Threading}).) If there are no more -articles with the same subject, go to the first unread article. - -This variable is not particularly useful if you use a threaded display. - -@item gnus-summary-check-current -@vindex gnus-summary-check-current -If non-@code{nil}, all the ``unread'' movement commands will not proceed -to the next (or previous) article if the current article is unread. -Instead, they will choose the current article. - -@item gnus-auto-center-summary -@vindex gnus-auto-center-summary -If non-@code{nil}, Gnus will keep the point in the summary buffer -centered at all times. This makes things quite tidy, but if you have a -slow network connection, or simply do not like this un-Emacsism, you can -set this variable to @code{nil} to get the normal Emacs scrolling -action. This will also inhibit horizontal re-centering of the summary -buffer, which might make it more inconvenient to read extremely long -threads. - -This variable can also be a number. In that case, center the window at -the given number of lines from the top. - -@end table - - -@node Choosing Articles -@section Choosing Articles -@cindex selecting articles - -@menu -* Choosing Commands:: Commands for choosing articles. -* Choosing Variables:: Variables that influence these commands. -@end menu - - -@node Choosing Commands -@subsection Choosing Commands - -None of the following movement commands understand the numeric prefix, -and they all select and display an article. - -If you want to fetch new articles or redisplay the group, see -@ref{Exiting the Summary Buffer}. - -@table @kbd -@item SPACE -@kindex SPACE (Summary) -@findex gnus-summary-next-page -Select the current article, or, if that one's read already, the next -unread article (@code{gnus-summary-next-page}). - -If you have an article window open already and you press @kbd{SPACE} -again, the article will be scrolled. This lets you conveniently -@kbd{SPACE} through an entire newsgroup. @xref{Paging the Article}. - -@item G n -@itemx n -@kindex n (Summary) -@kindex G n (Summary) -@findex gnus-summary-next-unread-article -@c @icon{gnus-summary-next-unread} -Go to next unread article (@code{gnus-summary-next-unread-article}). - -@item G p -@itemx p -@kindex p (Summary) -@findex gnus-summary-prev-unread-article -@c @icon{gnus-summary-prev-unread} -Go to previous unread article (@code{gnus-summary-prev-unread-article}). - -@item G N -@itemx N -@kindex N (Summary) -@kindex G N (Summary) -@findex gnus-summary-next-article -Go to the next article (@code{gnus-summary-next-article}). - -@item G P -@itemx P -@kindex P (Summary) -@kindex G P (Summary) -@findex gnus-summary-prev-article -Go to the previous article (@code{gnus-summary-prev-article}). - -@item G C-n -@kindex G C-n (Summary) -@findex gnus-summary-next-same-subject -Go to the next article with the same subject -(@code{gnus-summary-next-same-subject}). - -@item G C-p -@kindex G C-p (Summary) -@findex gnus-summary-prev-same-subject -Go to the previous article with the same subject -(@code{gnus-summary-prev-same-subject}). - -@item G f -@itemx . -@kindex G f (Summary) -@kindex . (Summary) -@findex gnus-summary-first-unread-article -Go to the first unread article -(@code{gnus-summary-first-unread-article}). - -@item G b -@itemx , -@kindex G b (Summary) -@kindex , (Summary) -@findex gnus-summary-best-unread-article -Go to the unread article with the highest score -(@code{gnus-summary-best-unread-article}). If given a prefix argument, -go to the first unread article that has a score over the default score. - -@item G l -@itemx l -@kindex l (Summary) -@kindex G l (Summary) -@findex gnus-summary-goto-last-article -Go to the previous article read (@code{gnus-summary-goto-last-article}). - -@item G o -@kindex G o (Summary) -@findex gnus-summary-pop-article -@cindex history -@cindex article history -Pop an article off the summary history and go to this article -(@code{gnus-summary-pop-article}). This command differs from the -command above in that you can pop as many previous articles off the -history as you like, while @kbd{l} toggles the two last read articles. -For a somewhat related issue (if you use these commands a lot), -@pxref{Article Backlog}. - -@item G j -@itemx j -@kindex j (Summary) -@kindex G j (Summary) -@findex gnus-summary-goto-article -Ask for an article number or @code{Message-ID}, and then go to that -article (@code{gnus-summary-goto-article}). - -@end table - - -@node Choosing Variables -@subsection Choosing Variables - -Some variables relevant for moving and selecting articles: - -@table @code -@item gnus-auto-extend-newsgroup -@vindex gnus-auto-extend-newsgroup -All the movement commands will try to go to the previous (or next) -article, even if that article isn't displayed in the Summary buffer if -this variable is non-@code{nil}. Gnus will then fetch the article from -the server and display it in the article buffer. - -@item gnus-select-article-hook -@vindex gnus-select-article-hook -This hook is called whenever an article is selected. The default is -@code{nil}. If you would like each article to be saved in the Agent as -you read it, putting @code{gnus-agent-fetch-selected-article} on this -hook will do so. - -@item gnus-mark-article-hook -@vindex gnus-mark-article-hook -@findex gnus-summary-mark-unread-as-read -@findex gnus-summary-mark-read-and-unread-as-read -@findex gnus-unread-mark -This hook is called whenever an article is selected. It is intended to -be used for marking articles as read. The default value is -@code{gnus-summary-mark-read-and-unread-as-read}, and will change the -mark of almost any article you read to @code{gnus-read-mark}. The only -articles not affected by this function are ticked, dormant, and -expirable articles. If you'd instead like to just have unread articles -marked as read, you can use @code{gnus-summary-mark-unread-as-read} -instead. It will leave marks like @code{gnus-low-score-mark}, -@code{gnus-del-mark} (and so on) alone. - -@end table - - -@node Paging the Article -@section Scrolling the Article -@cindex article scrolling - -@table @kbd - -@item SPACE -@kindex SPACE (Summary) -@findex gnus-summary-next-page -Pressing @kbd{SPACE} will scroll the current article forward one page, -or, if you have come to the end of the current article, will choose the -next article (@code{gnus-summary-next-page}). - -@vindex gnus-article-boring-faces -@vindex gnus-article-skip-boring -If @code{gnus-article-skip-boring} is non-@code{nil} and the rest of -the article consists only of citations and signature, then it will be -skipped; the next article will be shown instead. You can customize -what is considered uninteresting with -@code{gnus-article-boring-faces}. You can manually view the article's -pages, no matter how boring, using @kbd{C-M-v}. - -@item DEL -@kindex DEL (Summary) -@findex gnus-summary-prev-page -Scroll the current article back one page (@code{gnus-summary-prev-page}). - -@item RET -@kindex RET (Summary) -@findex gnus-summary-scroll-up -Scroll the current article one line forward -(@code{gnus-summary-scroll-up}). - -@item M-RET -@kindex M-RET (Summary) -@findex gnus-summary-scroll-down -Scroll the current article one line backward -(@code{gnus-summary-scroll-down}). - -@item A g -@itemx g -@kindex A g (Summary) -@kindex g (Summary) -@findex gnus-summary-show-article -@vindex gnus-summary-show-article-charset-alist -(Re)fetch the current article (@code{gnus-summary-show-article}). If -given a prefix, fetch the current article, but don't run any of the -article treatment functions. This will give you a ``raw'' article, just -the way it came from the server. - -If given a numerical prefix, you can do semi-manual charset stuff. -@kbd{C-u 0 g cn-gb-2312 RET} will decode the message as if it were -encoded in the @code{cn-gb-2312} charset. If you have - -@lisp -(setq gnus-summary-show-article-charset-alist - '((1 . cn-gb-2312) - (2 . big5))) -@end lisp - -then you can say @kbd{C-u 1 g} to get the same effect. - -@item A < -@itemx < -@kindex < (Summary) -@kindex A < (Summary) -@findex gnus-summary-beginning-of-article -Scroll to the beginning of the article -(@code{gnus-summary-beginning-of-article}). - -@item A > -@itemx > -@kindex > (Summary) -@kindex A > (Summary) -@findex gnus-summary-end-of-article -Scroll to the end of the article (@code{gnus-summary-end-of-article}). - -@item A s -@itemx s -@kindex A s (Summary) -@kindex s (Summary) -@findex gnus-summary-isearch-article -Perform an isearch in the article buffer -(@code{gnus-summary-isearch-article}). - -@item h -@kindex h (Summary) -@findex gnus-summary-select-article-buffer -Select the article buffer (@code{gnus-summary-select-article-buffer}). - -@end table - - -@node Reply Followup and Post -@section Reply, Followup and Post - -@menu -* Summary Mail Commands:: Sending mail. -* Summary Post Commands:: Sending news. -* Summary Message Commands:: Other Message-related commands. -* Canceling and Superseding:: -@end menu - - -@node Summary Mail Commands -@subsection Summary Mail Commands -@cindex mail -@cindex composing mail - -Commands for composing a mail message: - -@table @kbd - -@item S r -@itemx r -@kindex S r (Summary) -@kindex r (Summary) -@findex gnus-summary-reply -@c @icon{gnus-summary-mail-reply} -@c @icon{gnus-summary-reply} -Mail a reply to the author of the current article -(@code{gnus-summary-reply}). - -@item S R -@itemx R -@kindex R (Summary) -@kindex S R (Summary) -@findex gnus-summary-reply-with-original -@c @icon{gnus-summary-reply-with-original} -Mail a reply to the author of the current article and include the -original message (@code{gnus-summary-reply-with-original}). This -command uses the process/prefix convention. - -@item S w -@kindex S w (Summary) -@findex gnus-summary-wide-reply -Mail a wide reply to the author of the current article -(@code{gnus-summary-wide-reply}). A @dfn{wide reply} is a reply that -goes out to all people listed in the @code{To}, @code{From} (or -@code{Reply-to}) and @code{Cc} headers. If @code{Mail-Followup-To} is -present, that's used instead. - -@item S W -@kindex S W (Summary) -@findex gnus-summary-wide-reply-with-original -Mail a wide reply to the current article and include the original -message (@code{gnus-summary-wide-reply-with-original}). This command uses -the process/prefix convention. - -@item S v -@kindex S v (Summary) -@findex gnus-summary-very-wide-reply -Mail a very wide reply to the author of the current article -(@code{gnus-summary-wide-reply}). A @dfn{very wide reply} is a reply -that goes out to all people listed in the @code{To}, @code{From} (or -@code{Reply-to}) and @code{Cc} headers in all the process/prefixed -articles. This command uses the process/prefix convention. - -@item S V -@kindex S V (Summary) -@findex gnus-summary-very-wide-reply-with-original -Mail a very wide reply to the author of the current article and include the -original message (@code{gnus-summary-very-wide-reply-with-original}). This -command uses the process/prefix convention. - -@item S B r -@kindex S B r (Summary) -@findex gnus-summary-reply-broken-reply-to -Mail a reply to the author of the current article but ignore the -@code{Reply-To} field (@code{gnus-summary-reply-broken-reply-to}). -If you need this because a mailing list incorrectly sets a -@code{Reply-To} header pointing to the list, you probably want to set -the @code{broken-reply-to} group parameter instead, so things will work -correctly. @xref{Group Parameters}. - -@item S B R -@kindex S B R (Summary) -@findex gnus-summary-reply-broken-reply-to-with-original -Mail a reply to the author of the current article and include the -original message but ignore the @code{Reply-To} field -(@code{gnus-summary-reply-broken-reply-to-with-original}). - -@item S o m -@itemx C-c C-f -@kindex S o m (Summary) -@kindex C-c C-f (Summary) -@findex gnus-summary-mail-forward -@c @icon{gnus-summary-mail-forward} -Forward the current article to some other person -(@code{gnus-summary-mail-forward}). If no prefix is given, the message -is forwarded according to the value of (@code{message-forward-as-mime}) -and (@code{message-forward-show-mml}); if the prefix is 1, decode the -message and forward directly inline; if the prefix is 2, forward message -as an rfc822 @acronym{MIME} section; if the prefix is 3, decode message and -forward as an rfc822 @acronym{MIME} section; if the prefix is 4, forward message -directly inline; otherwise, the message is forwarded as no prefix given -but use the flipped value of (@code{message-forward-as-mime}). By -default, the message is decoded and forwarded as an rfc822 @acronym{MIME} -section. - -@item S m -@itemx m -@kindex m (Summary) -@kindex S m (Summary) -@findex gnus-summary-mail-other-window -@c @icon{gnus-summary-mail-originate} -Prepare a mail (@code{gnus-summary-mail-other-window}). By default, use -the posting style of the current group. If given a prefix, disable that. -If the prefix is 1, prompt for a group name to find the posting style. - -@item S i -@itemx i -@kindex i (Summary) -@kindex S i (Summary) -@findex gnus-summary-news-other-window -Prepare a news (@code{gnus-summary-news-other-window}). By default, -post to the current group. If given a prefix, disable that. If the -prefix is 1, prompt for a group to post to. - -This function actually prepares a news even when using mail groups. -This is useful for ``posting'' messages to mail groups without actually -sending them over the network: they're just saved directly to the group -in question. The corresponding back end must have a request-post method -for this to work though. - -@item S D b -@kindex S D b (Summary) -@findex gnus-summary-resend-bounced-mail -@cindex bouncing mail -If you have sent a mail, but the mail was bounced back to you for some -reason (wrong address, transient failure), you can use this command to -resend that bounced mail (@code{gnus-summary-resend-bounced-mail}). You -will be popped into a mail buffer where you can edit the headers before -sending the mail off again. If you give a prefix to this command, and -the bounced mail is a reply to some other mail, Gnus will try to fetch -that mail and display it for easy perusal of its headers. This might -very well fail, though. - -@item S D r -@kindex S D r (Summary) -@findex gnus-summary-resend-message -Not to be confused with the previous command, -@code{gnus-summary-resend-message} will prompt you for an address to -send the current message off to, and then send it to that place. The -headers of the message won't be altered---but lots of headers that say -@code{Resent-To}, @code{Resent-From} and so on will be added. This -means that you actually send a mail to someone that has a @code{To} -header that (probably) points to yourself. This will confuse people. -So, natcherly you'll only do that if you're really eVIl. - -This command is mainly used if you have several accounts and want to -ship a mail to a different account of yours. (If you're both -@code{root} and @code{postmaster} and get a mail for @code{postmaster} -to the @code{root} account, you may want to resend it to -@code{postmaster}. Ordnung muss sein! - -This command understands the process/prefix convention -(@pxref{Process/Prefix}). - -@item S D e -@kindex S D e (Summary) -@findex gnus-summary-resend-message-edit - -Like the previous command, but will allow you to edit the message as -if it were a new message before resending. - -@item S O m -@kindex S O m (Summary) -@findex gnus-uu-digest-mail-forward -Digest the current series (@pxref{Decoding Articles}) and forward the -result using mail (@code{gnus-uu-digest-mail-forward}). This command -uses the process/prefix convention (@pxref{Process/Prefix}). - -@item S M-c -@kindex S M-c (Summary) -@findex gnus-summary-mail-crosspost-complaint -@cindex crossposting -@cindex excessive crossposting -Send a complaint about excessive crossposting to the author of the -current article (@code{gnus-summary-mail-crosspost-complaint}). - -@findex gnus-crosspost-complaint -This command is provided as a way to fight back against the current -crossposting pandemic that's sweeping Usenet. It will compose a reply -using the @code{gnus-crosspost-complaint} variable as a preamble. This -command understands the process/prefix convention -(@pxref{Process/Prefix}) and will prompt you before sending each mail. - -@end table - -Also @xref{Header Commands, ,Header Commands, message, The Message -Manual}, for more information. - - -@node Summary Post Commands -@subsection Summary Post Commands -@cindex post -@cindex composing news - -Commands for posting a news article: - -@table @kbd -@item S p -@itemx a -@kindex a (Summary) -@kindex S p (Summary) -@findex gnus-summary-post-news -@c @icon{gnus-summary-post-news} -Prepare for posting an article (@code{gnus-summary-post-news}). By -default, post to the current group. If given a prefix, disable that. -If the prefix is 1, prompt for another group instead. - -@item S f -@itemx f -@kindex f (Summary) -@kindex S f (Summary) -@findex gnus-summary-followup -@c @icon{gnus-summary-followup} -Post a followup to the current article (@code{gnus-summary-followup}). - -@item S F -@itemx F -@kindex S F (Summary) -@kindex F (Summary) -@c @icon{gnus-summary-followup-with-original} -@findex gnus-summary-followup-with-original -Post a followup to the current article and include the original message -(@code{gnus-summary-followup-with-original}). This command uses the -process/prefix convention. - -@item S n -@kindex S n (Summary) -@findex gnus-summary-followup-to-mail -Post a followup to the current article via news, even if you got the -message through mail (@code{gnus-summary-followup-to-mail}). - -@item S N -@kindex S N (Summary) -@findex gnus-summary-followup-to-mail-with-original -Post a followup to the current article via news, even if you got the -message through mail and include the original message -(@code{gnus-summary-followup-to-mail-with-original}). This command uses -the process/prefix convention. - -@item S o p -@kindex S o p (Summary) -@findex gnus-summary-post-forward -Forward the current article to a newsgroup -(@code{gnus-summary-post-forward}). - If no prefix is given, the message is forwarded according to the value -of (@code{message-forward-as-mime}) and -(@code{message-forward-show-mml}); if the prefix is 1, decode the -message and forward directly inline; if the prefix is 2, forward message -as an rfc822 @acronym{MIME} section; if the prefix is 3, decode message and -forward as an rfc822 @acronym{MIME} section; if the prefix is 4, forward message -directly inline; otherwise, the message is forwarded as no prefix given -but use the flipped value of (@code{message-forward-as-mime}). By -default, the message is decoded and forwarded as an rfc822 @acronym{MIME} section. - -@item S O p -@kindex S O p (Summary) -@findex gnus-uu-digest-post-forward -@cindex digests -@cindex making digests -Digest the current series and forward the result to a newsgroup -(@code{gnus-uu-digest-post-forward}). This command uses the -process/prefix convention. - -@item S u -@kindex S u (Summary) -@findex gnus-uu-post-news -@c @icon{gnus-uu-post-news} -Uuencode a file, split it into parts, and post it as a series -(@code{gnus-uu-post-news}). (@pxref{Uuencoding and Posting}). -@end table - -Also @xref{Header Commands, ,Header Commands, message, The Message -Manual}, for more information. - - -@node Summary Message Commands -@subsection Summary Message Commands - -@table @kbd -@item S y -@kindex S y (Summary) -@findex gnus-summary-yank-message -Yank the current article into an already existing Message composition -buffer (@code{gnus-summary-yank-message}). This command prompts for -what message buffer you want to yank into, and understands the -process/prefix convention (@pxref{Process/Prefix}). - -@end table - - -@node Canceling and Superseding -@subsection Canceling Articles -@cindex canceling articles -@cindex superseding articles - -Have you ever written something, and then decided that you really, -really, really wish you hadn't posted that? - -Well, you can't cancel mail, but you can cancel posts. - -@findex gnus-summary-cancel-article -@kindex C (Summary) -@c @icon{gnus-summary-cancel-article} -Find the article you wish to cancel (you can only cancel your own -articles, so don't try any funny stuff). Then press @kbd{C} or @kbd{S -c} (@code{gnus-summary-cancel-article}). Your article will be -canceled---machines all over the world will be deleting your article. -This command uses the process/prefix convention (@pxref{Process/Prefix}). - -Be aware, however, that not all sites honor cancels, so your article may -live on here and there, while most sites will delete the article in -question. - -Gnus will use the ``current'' select method when canceling. If you -want to use the standard posting method, use the @samp{a} symbolic -prefix (@pxref{Symbolic Prefixes}). - -Gnus ensures that only you can cancel your own messages using a -@code{Cancel-Lock} header (@pxref{Canceling News, Canceling News, , -message, Message Manual}). - -If you discover that you have made some mistakes and want to do some -corrections, you can post a @dfn{superseding} article that will replace -your original article. - -@findex gnus-summary-supersede-article -@kindex S (Summary) -Go to the original article and press @kbd{S s} -(@code{gnus-summary-supersede-article}). You will be put in a buffer -where you can edit the article all you want before sending it off the -usual way. - -The same goes for superseding as for canceling, only more so: Some -sites do not honor superseding. On those sites, it will appear that you -have posted almost the same article twice. - -If you have just posted the article, and change your mind right away, -there is a trick you can use to cancel/supersede the article without -waiting for the article to appear on your site first. You simply return -to the post buffer (which is called @code{*sent ...*}). There you will -find the article you just posted, with all the headers intact. Change -the @code{Message-ID} header to a @code{Cancel} or @code{Supersedes} -header by substituting one of those words for the word -@code{Message-ID}. Then just press @kbd{C-c C-c} to send the article as -you would do normally. The previous article will be -canceled/superseded. - -Just remember, kids: There is no 'c' in 'supersede'. - -@node Delayed Articles -@section Delayed Articles -@cindex delayed sending -@cindex send delayed - -Sometimes, you might wish to delay the sending of a message. For -example, you might wish to arrange for a message to turn up just in time -to remind your about the birthday of your Significant Other. For this, -there is the @code{gnus-delay} package. Setup is simple: - -@lisp -(gnus-delay-initialize) -@end lisp - -@findex gnus-delay-article -Normally, to send a message you use the @kbd{C-c C-c} command from -Message mode. To delay a message, use @kbd{C-c C-j} -(@code{gnus-delay-article}) instead. This will ask you for how long the -message should be delayed. Possible answers are: - -@itemize @bullet -@item -A time span. Consists of an integer and a letter. For example, -@code{42d} means to delay for 42 days. Available letters are @code{m} -(minutes), @code{h} (hours), @code{d} (days), @code{w} (weeks), @code{M} -(months) and @code{Y} (years). - -@item -A specific date. Looks like @code{YYYY-MM-DD}. The message will be -delayed until that day, at a specific time (eight o'clock by default). -See also @code{gnus-delay-default-hour}. - -@item -A specific time of day. Given in @code{hh:mm} format, 24h, no am/pm -stuff. The deadline will be at that time today, except if that time has -already passed, then it's at the given time tomorrow. So if it's ten -o'clock in the morning and you specify @code{11:15}, then the deadline -is one hour and fifteen minutes hence. But if you specify @code{9:20}, -that means a time tomorrow. -@end itemize - -The action of the @code{gnus-delay-article} command is influenced by a -couple of variables: - -@table @code -@item gnus-delay-default-hour -@vindex gnus-delay-default-hour -When you specify a specific date, the message will be due on that hour -on the given date. Possible values are integers 0 through 23. - -@item gnus-delay-default-delay -@vindex gnus-delay-default-delay -This is a string and gives the default delay. It can be of any of the -formats described above. - -@item gnus-delay-group -@vindex gnus-delay-group -Delayed articles will be kept in this group on the drafts server until -they are due. You probably don't need to change this. The default -value is @code{"delayed"}. - -@item gnus-delay-header -@vindex gnus-delay-header -The deadline for each article will be stored in a header. This variable -is a string and gives the header name. You probably don't need to -change this. The default value is @code{"X-Gnus-Delayed"}. -@end table - -The way delaying works is like this: when you use the -@code{gnus-delay-article} command, you give a certain delay. Gnus -calculates the deadline of the message and stores it in the -@code{X-Gnus-Delayed} header and puts the message in the -@code{nndraft:delayed} group. - -@findex gnus-delay-send-queue -And whenever you get new news, Gnus looks through the group for articles -which are due and sends them. It uses the @code{gnus-delay-send-queue} -function for this. By default, this function is added to the hook -@code{gnus-get-new-news-hook}. But of course, you can change this. -Maybe you want to use the demon to send drafts? Just tell the demon to -execute the @code{gnus-delay-send-queue} function. - -@table @code -@item gnus-delay-initialize -@findex gnus-delay-initialize -By default, this function installs @code{gnus-delay-send-queue} in -@code{gnus-get-new-news-hook}. But it accepts the optional second -argument @code{no-check}. If it is non-@code{nil}, -@code{gnus-get-new-news-hook} is not changed. The optional first -argument is ignored. - -For example, @code{(gnus-delay-initialize nil t)} means to do nothing. -Presumably, you want to use the demon for sending due delayed articles. -Just don't forget to set that up :-) -@end table - - -@node Marking Articles -@section Marking Articles -@cindex article marking -@cindex article ticking -@cindex marks - -There are several marks you can set on an article. - -You have marks that decide the @dfn{readedness} (whoo, neato-keano -neologism ohoy!) of the article. Alphabetic marks generally mean -@dfn{read}, while non-alphabetic characters generally mean @dfn{unread}. - -In addition, you also have marks that do not affect readedness. - -@ifinfo -There's a plethora of commands for manipulating these marks. -@end ifinfo - -@menu -* Unread Articles:: Marks for unread articles. -* Read Articles:: Marks for read articles. -* Other Marks:: Marks that do not affect readedness. -* Setting Marks:: How to set and remove marks. -* Generic Marking Commands:: How to customize the marking. -* Setting Process Marks:: How to mark articles for later processing. -@end menu - - -@node Unread Articles -@subsection Unread Articles - -The following marks mark articles as (kinda) unread, in one form or -other. - -@table @samp -@item ! -@vindex gnus-ticked-mark -Marked as ticked (@code{gnus-ticked-mark}). - -@dfn{Ticked articles} are articles that will remain visible always. If -you see an article that you find interesting, or you want to put off -reading it, or replying to it, until sometime later, you'd typically -tick it. However, articles can be expired (from news servers by the -news server software, Gnus itself never expires ticked messages), so if -you want to keep an article forever, you'll have to make it persistent -(@pxref{Persistent Articles}). - -@item ? -@vindex gnus-dormant-mark -Marked as dormant (@code{gnus-dormant-mark}). - -@dfn{Dormant articles} will only appear in the summary buffer if there -are followups to it. If you want to see them even if they don't have -followups, you can use the @kbd{/ D} command (@pxref{Limiting}). -Otherwise (except for the visibility issue), they are just like ticked -messages. - -@item SPACE -@vindex gnus-unread-mark -Marked as unread (@code{gnus-unread-mark}). - -@dfn{Unread articles} are articles that haven't been read at all yet. -@end table - - -@node Read Articles -@subsection Read Articles -@cindex expirable mark - -All the following marks mark articles as read. - -@table @samp - -@item r -@vindex gnus-del-mark -These are articles that the user has marked as read with the @kbd{d} -command manually, more or less (@code{gnus-del-mark}). - -@item R -@vindex gnus-read-mark -Articles that have actually been read (@code{gnus-read-mark}). - -@item O -@vindex gnus-ancient-mark -Articles that were marked as read in previous sessions and are now -@dfn{old} (@code{gnus-ancient-mark}). - -@item K -@vindex gnus-killed-mark -Marked as killed (@code{gnus-killed-mark}). - -@item X -@vindex gnus-kill-file-mark -Marked as killed by kill files (@code{gnus-kill-file-mark}). - -@item Y -@vindex gnus-low-score-mark -Marked as read by having too low a score (@code{gnus-low-score-mark}). - -@item C -@vindex gnus-catchup-mark -Marked as read by a catchup (@code{gnus-catchup-mark}). - -@item G -@vindex gnus-canceled-mark -Canceled article (@code{gnus-canceled-mark}) - -@item F -@vindex gnus-souped-mark -@sc{soup}ed article (@code{gnus-souped-mark}). @xref{SOUP}. - -@item Q -@vindex gnus-sparse-mark -Sparsely reffed article (@code{gnus-sparse-mark}). @xref{Customizing -Threading}. - -@item M -@vindex gnus-duplicate-mark -Article marked as read by duplicate suppression -(@code{gnus-duplicate-mark}). @xref{Duplicate Suppression}. - -@end table - -All these marks just mean that the article is marked as read, really. -They are interpreted differently when doing adaptive scoring, though. - -One more special mark, though: - -@table @samp -@item E -@vindex gnus-expirable-mark -Marked as expirable (@code{gnus-expirable-mark}). - -Marking articles as @dfn{expirable} (or have them marked as such -automatically) doesn't make much sense in normal groups---a user doesn't -control expiring of news articles, but in mail groups, for instance, -articles marked as @dfn{expirable} can be deleted by Gnus at -any time. -@end table - - -@node Other Marks -@subsection Other Marks -@cindex process mark -@cindex bookmarks - -There are some marks that have nothing to do with whether the article is -read or not. - -@itemize @bullet - -@item -You can set a bookmark in the current article. Say you are reading a -long thesis on cats' urinary tracts, and have to go home for dinner -before you've finished reading the thesis. You can then set a bookmark -in the article, and Gnus will jump to this bookmark the next time it -encounters the article. @xref{Setting Marks}. - -@item -@vindex gnus-replied-mark -All articles that you have replied to or made a followup to (i.e., have -answered) will be marked with an @samp{A} in the second column -(@code{gnus-replied-mark}). - -@item -@vindex gnus-forwarded-mark -All articles that you have forwarded will be marked with an @samp{F} in -the second column (@code{gnus-forwarded-mark}). - -@item -@vindex gnus-cached-mark -Articles stored in the article cache will be marked with an @samp{*} in -the second column (@code{gnus-cached-mark}). @xref{Article Caching}. - -@item -@vindex gnus-saved-mark -Articles ``saved'' (in some manner or other; not necessarily -religiously) are marked with an @samp{S} in the second column -(@code{gnus-saved-mark}). - -@item -@vindex gnus-recent-mark -Articles that according to the server haven't been shown to the user -before are marked with a @samp{N} in the second column -(@code{gnus-recent-mark}). Note that not all servers support this -mark, in which case it simply never appears. Compare with -@code{gnus-unseen-mark}. - -@item -@vindex gnus-unseen-mark -Articles that haven't been seen before in Gnus by the user are marked -with a @samp{.} in the second column (@code{gnus-unseen-mark}). -Compare with @code{gnus-recent-mark}. - -@item -@vindex gnus-downloaded-mark -When using the Gnus agent (@pxref{Agent Basics}), articles may be -downloaded for unplugged (offline) viewing. If you are using the -@samp{%O} spec, these articles get the @samp{+} mark in that spec. -(The variable @code{gnus-downloaded-mark} controls which character to -use.) - -@item -@vindex gnus-undownloaded-mark -When using the Gnus agent (@pxref{Agent Basics}), some articles might -not have been downloaded. Such articles cannot be viewed while you -are unplugged (offline). If you are using the @samp{%O} spec, these -articles get the @samp{-} mark in that spec. (The variable -@code{gnus-undownloaded-mark} controls which character to use.) - -@item -@vindex gnus-downloadable-mark -The Gnus agent (@pxref{Agent Basics}) downloads some articles -automatically, but it is also possible to explicitly mark articles for -download, even if they would not be downloaded automatically. Such -explicitly-marked articles get the @samp{%} mark in the first column. -(The variable @code{gnus-downloadable-mark} controls which character to -use.) - -@item -@vindex gnus-not-empty-thread-mark -@vindex gnus-empty-thread-mark -If the @samp{%e} spec is used, the presence of threads or not will be -marked with @code{gnus-not-empty-thread-mark} and -@code{gnus-empty-thread-mark} in the third column, respectively. - -@item -@vindex gnus-process-mark -Finally we have the @dfn{process mark} (@code{gnus-process-mark}). A -variety of commands react to the presence of the process mark. For -instance, @kbd{X u} (@code{gnus-uu-decode-uu}) will uudecode and view -all articles that have been marked with the process mark. Articles -marked with the process mark have a @samp{#} in the second column. - -@end itemize - -You might have noticed that most of these ``non-readedness'' marks -appear in the second column by default. So if you have a cached, saved, -replied article that you have process-marked, what will that look like? - -Nothing much. The precedence rules go as follows: process -> cache -> -replied -> saved. So if the article is in the cache and is replied, -you'll only see the cache mark and not the replied mark. - - -@node Setting Marks -@subsection Setting Marks -@cindex setting marks - -All the marking commands understand the numeric prefix. - -@table @kbd -@item M c -@itemx M-u -@kindex M c (Summary) -@kindex M-u (Summary) -@findex gnus-summary-clear-mark-forward -@cindex mark as unread -Clear all readedness-marks from the current article -(@code{gnus-summary-clear-mark-forward}). In other words, mark the -article as unread. - -@item M t -@itemx ! -@kindex ! (Summary) -@kindex M t (Summary) -@findex gnus-summary-tick-article-forward -Tick the current article (@code{gnus-summary-tick-article-forward}). -@xref{Article Caching}. - -@item M ? -@itemx ? -@kindex ? (Summary) -@kindex M ? (Summary) -@findex gnus-summary-mark-as-dormant -Mark the current article as dormant -(@code{gnus-summary-mark-as-dormant}). @xref{Article Caching}. - -@item M d -@itemx d -@kindex M d (Summary) -@kindex d (Summary) -@findex gnus-summary-mark-as-read-forward -Mark the current article as read -(@code{gnus-summary-mark-as-read-forward}). - -@item D -@kindex D (Summary) -@findex gnus-summary-mark-as-read-backward -Mark the current article as read and move point to the previous line -(@code{gnus-summary-mark-as-read-backward}). - -@item M k -@itemx k -@kindex k (Summary) -@kindex M k (Summary) -@findex gnus-summary-kill-same-subject-and-select -Mark all articles that have the same subject as the current one as read, -and then select the next unread article -(@code{gnus-summary-kill-same-subject-and-select}). - -@item M K -@itemx C-k -@kindex M K (Summary) -@kindex C-k (Summary) -@findex gnus-summary-kill-same-subject -Mark all articles that have the same subject as the current one as read -(@code{gnus-summary-kill-same-subject}). - -@item M C -@kindex M C (Summary) -@findex gnus-summary-catchup -@c @icon{gnus-summary-catchup} -Mark all unread articles as read (@code{gnus-summary-catchup}). - -@item M C-c -@kindex M C-c (Summary) -@findex gnus-summary-catchup-all -Mark all articles in the group as read---even the ticked and dormant -articles (@code{gnus-summary-catchup-all}). - -@item M H -@kindex M H (Summary) -@findex gnus-summary-catchup-to-here -Catchup the current group to point (before the point) -(@code{gnus-summary-catchup-to-here}). - -@item M h -@kindex M h (Summary) -@findex gnus-summary-catchup-from-here -Catchup the current group from point (after the point) -(@code{gnus-summary-catchup-from-here}). - -@item C-w -@kindex C-w (Summary) -@findex gnus-summary-mark-region-as-read -Mark all articles between point and mark as read -(@code{gnus-summary-mark-region-as-read}). - -@item M V k -@kindex M V k (Summary) -@findex gnus-summary-kill-below -Kill all articles with scores below the default score (or below the -numeric prefix) (@code{gnus-summary-kill-below}). - -@item M e -@itemx E -@kindex M e (Summary) -@kindex E (Summary) -@findex gnus-summary-mark-as-expirable -Mark the current article as expirable -(@code{gnus-summary-mark-as-expirable}). - -@item M b -@kindex M b (Summary) -@findex gnus-summary-set-bookmark -Set a bookmark in the current article -(@code{gnus-summary-set-bookmark}). - -@item M B -@kindex M B (Summary) -@findex gnus-summary-remove-bookmark -Remove the bookmark from the current article -(@code{gnus-summary-remove-bookmark}). - -@item M V c -@kindex M V c (Summary) -@findex gnus-summary-clear-above -Clear all marks from articles with scores over the default score (or -over the numeric prefix) (@code{gnus-summary-clear-above}). - -@item M V u -@kindex M V u (Summary) -@findex gnus-summary-tick-above -Tick all articles with scores over the default score (or over the -numeric prefix) (@code{gnus-summary-tick-above}). - -@item M V m -@kindex M V m (Summary) -@findex gnus-summary-mark-above -Prompt for a mark, and mark all articles with scores over the default -score (or over the numeric prefix) with this mark -(@code{gnus-summary-clear-above}). -@end table - -@vindex gnus-summary-goto-unread -The @code{gnus-summary-goto-unread} variable controls what action should -be taken after setting a mark. If non-@code{nil}, point will move to -the next/previous unread article. If @code{nil}, point will just move -one line up or down. As a special case, if this variable is -@code{never}, all the marking commands as well as other commands (like -@kbd{SPACE}) will move to the next article, whether it is unread or not. -The default is @code{t}. - - -@node Generic Marking Commands -@subsection Generic Marking Commands - -Some people would like the command that ticks an article (@kbd{!}) go to -the next article. Others would like it to go to the next unread -article. Yet others would like it to stay on the current article. And -even though I haven't heard of anybody wanting it to go to the -previous (unread) article, I'm sure there are people that want that as -well. - -Multiply these five behaviors with five different marking commands, and -you get a potentially complex set of variable to control what each -command should do. - -To sidestep that mess, Gnus provides commands that do all these -different things. They can be found on the @kbd{M M} map in the summary -buffer. Type @kbd{M M C-h} to see them all---there are too many of them -to list in this manual. - -While you can use these commands directly, most users would prefer -altering the summary mode keymap. For instance, if you would like the -@kbd{!} command to go to the next article instead of the next unread -article, you could say something like: - -@lisp -@group -(add-hook 'gnus-summary-mode-hook 'my-alter-summary-map) -(defun my-alter-summary-map () - (local-set-key "!" 'gnus-summary-put-mark-as-ticked-next)) -@end group -@end lisp - -@noindent -or - -@lisp -(defun my-alter-summary-map () - (local-set-key "!" "MM!n")) -@end lisp - - -@node Setting Process Marks -@subsection Setting Process Marks -@cindex setting process marks - -Process marks are displayed as @code{#} in the summary buffer, and are -used for marking articles in such a way that other commands will -process these articles. For instance, if you process mark four -articles and then use the @kbd{*} command, Gnus will enter these four -articles into the cache. For more information, -@pxref{Process/Prefix}. - -@table @kbd - -@item M P p -@itemx # -@kindex # (Summary) -@kindex M P p (Summary) -@findex gnus-summary-mark-as-processable -Mark the current article with the process mark -(@code{gnus-summary-mark-as-processable}). -@findex gnus-summary-unmark-as-processable - -@item M P u -@itemx M-# -@kindex M P u (Summary) -@kindex M-# (Summary) -Remove the process mark, if any, from the current article -(@code{gnus-summary-unmark-as-processable}). - -@item M P U -@kindex M P U (Summary) -@findex gnus-summary-unmark-all-processable -Remove the process mark from all articles -(@code{gnus-summary-unmark-all-processable}). - -@item M P i -@kindex M P i (Summary) -@findex gnus-uu-invert-processable -Invert the list of process marked articles -(@code{gnus-uu-invert-processable}). - -@item M P R -@kindex M P R (Summary) -@findex gnus-uu-mark-by-regexp -Mark articles that have a @code{Subject} header that matches a regular -expression (@code{gnus-uu-mark-by-regexp}). - -@item M P G -@kindex M P G (Summary) -@findex gnus-uu-unmark-by-regexp -Unmark articles that have a @code{Subject} header that matches a regular -expression (@code{gnus-uu-unmark-by-regexp}). - -@item M P r -@kindex M P r (Summary) -@findex gnus-uu-mark-region -Mark articles in region (@code{gnus-uu-mark-region}). - -@item M P g -@kindex M P g (Summary) -@findex gnus-uu-unmark-region -Unmark articles in region (@code{gnus-uu-unmark-region}). - -@item M P t -@kindex M P t (Summary) -@findex gnus-uu-mark-thread -Mark all articles in the current (sub)thread -(@code{gnus-uu-mark-thread}). - -@item M P T -@kindex M P T (Summary) -@findex gnus-uu-unmark-thread -Unmark all articles in the current (sub)thread -(@code{gnus-uu-unmark-thread}). - -@item M P v -@kindex M P v (Summary) -@findex gnus-uu-mark-over -Mark all articles that have a score above the prefix argument -(@code{gnus-uu-mark-over}). - -@item M P s -@kindex M P s (Summary) -@findex gnus-uu-mark-series -Mark all articles in the current series (@code{gnus-uu-mark-series}). - -@item M P S -@kindex M P S (Summary) -@findex gnus-uu-mark-sparse -Mark all series that have already had some articles marked -(@code{gnus-uu-mark-sparse}). - -@item M P a -@kindex M P a (Summary) -@findex gnus-uu-mark-all -Mark all articles in series order (@code{gnus-uu-mark-all}). - -@item M P b -@kindex M P b (Summary) -@findex gnus-uu-mark-buffer -Mark all articles in the buffer in the order they appear -(@code{gnus-uu-mark-buffer}). - -@item M P k -@kindex M P k (Summary) -@findex gnus-summary-kill-process-mark -Push the current process mark set onto the stack and unmark all articles -(@code{gnus-summary-kill-process-mark}). - -@item M P y -@kindex M P y (Summary) -@findex gnus-summary-yank-process-mark -Pop the previous process mark set from the stack and restore it -(@code{gnus-summary-yank-process-mark}). - -@item M P w -@kindex M P w (Summary) -@findex gnus-summary-save-process-mark -Push the current process mark set onto the stack -(@code{gnus-summary-save-process-mark}). - -@end table - -Also see the @kbd{&} command in @ref{Searching for Articles}, for how to -set process marks based on article body contents. - - -@node Limiting -@section Limiting -@cindex limiting - -It can be convenient to limit the summary buffer to just show some -subset of the articles currently in the group. The effect most limit -commands have is to remove a few (or many) articles from the summary -buffer. - -All limiting commands work on subsets of the articles already fetched -from the servers. None of these commands query the server for -additional articles. - -@table @kbd - -@item / / -@itemx / s -@kindex / / (Summary) -@findex gnus-summary-limit-to-subject -Limit the summary buffer to articles that match some subject -(@code{gnus-summary-limit-to-subject}). If given a prefix, exclude -matching articles. - -@item / a -@kindex / a (Summary) -@findex gnus-summary-limit-to-author -Limit the summary buffer to articles that match some author -(@code{gnus-summary-limit-to-author}). If given a prefix, exclude -matching articles. - -@item / x -@kindex / x (Summary) -@findex gnus-summary-limit-to-extra -Limit the summary buffer to articles that match one of the ``extra'' -headers (@pxref{To From Newsgroups}) -(@code{gnus-summary-limit-to-extra}). If given a prefix, exclude -matching articles. - -@item / u -@itemx x -@kindex / u (Summary) -@kindex x (Summary) -@findex gnus-summary-limit-to-unread -Limit the summary buffer to articles not marked as read -(@code{gnus-summary-limit-to-unread}). If given a prefix, limit the -buffer to articles strictly unread. This means that ticked and -dormant articles will also be excluded. - -@item / m -@kindex / m (Summary) -@findex gnus-summary-limit-to-marks -Ask for a mark and then limit to all articles that have been marked -with that mark (@code{gnus-summary-limit-to-marks}). - -@item / t -@kindex / t (Summary) -@findex gnus-summary-limit-to-age -Ask for a number and then limit the summary buffer to articles older than (or equal to) that number of days -(@code{gnus-summary-limit-to-age}). If given a prefix, limit to -articles younger than that number of days. - -@item / n -@kindex / n (Summary) -@findex gnus-summary-limit-to-articles -With prefix @samp{n}, limit the summary buffer to the next @samp{n} -articles. If not given a prefix, use the process marked articles -instead. (@code{gnus-summary-limit-to-articles}). - -@item / w -@kindex / w (Summary) -@findex gnus-summary-pop-limit -Pop the previous limit off the stack and restore it -(@code{gnus-summary-pop-limit}). If given a prefix, pop all limits off -the stack. - -@item / . -@kindex / . (Summary) -@findex gnus-summary-limit-to-unseen -Limit the summary buffer to the unseen articles -(@code{gnus-summary-limit-to-unseen}). - -@item / v -@kindex / v (Summary) -@findex gnus-summary-limit-to-score -Limit the summary buffer to articles that have a score at or above some -score (@code{gnus-summary-limit-to-score}). - -@item / p -@kindex / p (Summary) -@findex gnus-summary-limit-to-display-predicate -Limit the summary buffer to articles that satisfy the @code{display} -group parameter predicate -(@code{gnus-summary-limit-to-display-predicate}). @xref{Group -Parameters}, for more on this predicate. - -@item / E -@itemx M S -@kindex M S (Summary) -@kindex / E (Summary) -@findex gnus-summary-limit-include-expunged -Include all expunged articles in the limit -(@code{gnus-summary-limit-include-expunged}). - -@item / D -@kindex / D (Summary) -@findex gnus-summary-limit-include-dormant -Include all dormant articles in the limit -(@code{gnus-summary-limit-include-dormant}). - -@item / * -@kindex / * (Summary) -@findex gnus-summary-limit-include-cached -Include all cached articles in the limit -(@code{gnus-summary-limit-include-cached}). - -@item / d -@kindex / d (Summary) -@findex gnus-summary-limit-exclude-dormant -Exclude all dormant articles from the limit -(@code{gnus-summary-limit-exclude-dormant}). - -@item / M -@kindex / M (Summary) -@findex gnus-summary-limit-exclude-marks -Exclude all marked articles (@code{gnus-summary-limit-exclude-marks}). - -@item / T -@kindex / T (Summary) -@findex gnus-summary-limit-include-thread -Include all the articles in the current thread in the limit. - -@item / c -@kindex / c (Summary) -@findex gnus-summary-limit-exclude-childless-dormant -Exclude all dormant articles that have no children from the limit@* -(@code{gnus-summary-limit-exclude-childless-dormant}). - -@item / C -@kindex / C (Summary) -@findex gnus-summary-limit-mark-excluded-as-read -Mark all excluded unread articles as read -(@code{gnus-summary-limit-mark-excluded-as-read}). If given a prefix, -also mark excluded ticked and dormant articles as read. - -@item / N -@kindex / N (Summary) -@findex gnus-summary-insert-new-articles -Insert all new articles in the summary buffer. It scans for new emails -if @var{back-end}@code{-get-new-mail} is non-@code{nil}. - -@item / o -@kindex / o (Summary) -@findex gnus-summary-insert-old-articles -Insert all old articles in the summary buffer. If given a numbered -prefix, fetch this number of articles. - -@end table - - -@node Threading -@section Threading -@cindex threading -@cindex article threading - -Gnus threads articles by default. @dfn{To thread} is to put responses -to articles directly after the articles they respond to---in a -hierarchical fashion. - -Threading is done by looking at the @code{References} headers of the -articles. In a perfect world, this would be enough to build pretty -trees, but unfortunately, the @code{References} header is often broken -or simply missing. Weird news propagation exacerbates the problem, -so one has to employ other heuristics to get pleasing results. A -plethora of approaches exists, as detailed in horrible detail in -@ref{Customizing Threading}. - -First, a quick overview of the concepts: - -@table @dfn -@item root -The top-most article in a thread; the first article in the thread. - -@item thread -A tree-like article structure. - -@item sub-thread -A small(er) section of this tree-like structure. - -@item loose threads -Threads often lose their roots due to article expiry, or due to the root -already having been read in a previous session, and not displayed in the -summary buffer. We then typically have many sub-threads that really -belong to one thread, but are without connecting roots. These are -called loose threads. - -@item thread gathering -An attempt to gather loose threads into bigger threads. - -@item sparse threads -A thread where the missing articles have been ``guessed'' at, and are -displayed as empty lines in the summary buffer. - -@end table - - -@menu -* Customizing Threading:: Variables you can change to affect the threading. -* Thread Commands:: Thread based commands in the summary buffer. -@end menu - - -@node Customizing Threading -@subsection Customizing Threading -@cindex customizing threading - -@menu -* Loose Threads:: How Gnus gathers loose threads into bigger threads. -* Filling In Threads:: Making the threads displayed look fuller. -* More Threading:: Even more variables for fiddling with threads. -* Low-Level Threading:: You thought it was over@dots{} but you were wrong! -@end menu - - -@node Loose Threads -@subsubsection Loose Threads -@cindex < -@cindex > -@cindex loose threads - -@table @code -@item gnus-summary-make-false-root -@vindex gnus-summary-make-false-root -If non-@code{nil}, Gnus will gather all loose subtrees into one big tree -and create a dummy root at the top. (Wait a minute. Root at the top? -Yup.) Loose subtrees occur when the real root has expired, or you've -read or killed the root in a previous session. - -When there is no real root of a thread, Gnus will have to fudge -something. This variable says what fudging method Gnus should use. -There are four possible values: - -@iftex -@iflatex -\gnusfigure{The Summary Buffer}{390}{ -\put(0,0){\epsfig{figure=ps/summary-adopt,width=7.5cm}} -\put(445,0){\makebox(0,0)[br]{\epsfig{figure=ps/summary-empty,width=7.5cm}}} -\put(0,400){\makebox(0,0)[tl]{\epsfig{figure=ps/summary-none,width=7.5cm}}} -\put(445,400){\makebox(0,0)[tr]{\epsfig{figure=ps/summary-dummy,width=7.5cm}}} -} -@end iflatex -@end iftex - -@cindex adopting articles - -@table @code - -@item adopt -Gnus will make the first of the orphaned articles the parent. This -parent will adopt all the other articles. The adopted articles will be -marked as such by pointy brackets (@samp{<>}) instead of the standard -square brackets (@samp{[]}). This is the default method. - -@item dummy -@vindex gnus-summary-dummy-line-format -@vindex gnus-summary-make-false-root-always -Gnus will create a dummy summary line that will pretend to be the -parent. This dummy line does not correspond to any real article, so -selecting it will just select the first real article after the dummy -article. @code{gnus-summary-dummy-line-format} is used to specify the -format of the dummy roots. It accepts only one format spec: @samp{S}, -which is the subject of the article. @xref{Formatting Variables}. -If you want all threads to have a dummy root, even the non-gathered -ones, set @code{gnus-summary-make-false-root-always} to @code{t}. - -@item empty -Gnus won't actually make any article the parent, but simply leave the -subject field of all orphans except the first empty. (Actually, it will -use @code{gnus-summary-same-subject} as the subject (@pxref{Summary -Buffer Format}).) - -@item none -Don't make any article parent at all. Just gather the threads and -display them after one another. - -@item nil -Don't gather loose threads. -@end table - -@item gnus-summary-gather-subject-limit -@vindex gnus-summary-gather-subject-limit -Loose threads are gathered by comparing subjects of articles. If this -variable is @code{nil}, Gnus requires an exact match between the -subjects of the loose threads before gathering them into one big -super-thread. This might be too strict a requirement, what with the -presence of stupid newsreaders that chop off long subject lines. If -you think so, set this variable to, say, 20 to require that only the -first 20 characters of the subjects have to match. If you set this -variable to a really low number, you'll find that Gnus will gather -everything in sight into one thread, which isn't very helpful. - -@cindex fuzzy article gathering -If you set this variable to the special value @code{fuzzy}, Gnus will -use a fuzzy string comparison algorithm on the subjects (@pxref{Fuzzy -Matching}). - -@item gnus-simplify-subject-fuzzy-regexp -@vindex gnus-simplify-subject-fuzzy-regexp -This can either be a regular expression or list of regular expressions -that match strings that will be removed from subjects if fuzzy subject -simplification is used. - -@item gnus-simplify-ignored-prefixes -@vindex gnus-simplify-ignored-prefixes -If you set @code{gnus-summary-gather-subject-limit} to something as low -as 10, you might consider setting this variable to something sensible: - -@c Written by Michael Ernst <mernst@cs.rice.edu> -@lisp -(setq gnus-simplify-ignored-prefixes - (concat - "\\`\\[?\\(" - (mapconcat - 'identity - '("looking" - "wanted" "followup" "summary\\( of\\)?" - "help" "query" "problem" "question" - "answer" "reference" "announce" - "How can I" "How to" "Comparison of" - ;; ... - ) - "\\|") - "\\)\\s *\\(" - (mapconcat 'identity - '("for" "for reference" "with" "about") - "\\|") - "\\)?\\]?:?[ \t]*")) -@end lisp - -All words that match this regexp will be removed before comparing two -subjects. - -@item gnus-simplify-subject-functions -@vindex gnus-simplify-subject-functions -If non-@code{nil}, this variable overrides -@code{gnus-summary-gather-subject-limit}. This variable should be a -list of functions to apply to the @code{Subject} string iteratively to -arrive at the simplified version of the string. - -Useful functions to put in this list include: - -@table @code -@item gnus-simplify-subject-re -@findex gnus-simplify-subject-re -Strip the leading @samp{Re:}. - -@item gnus-simplify-subject-fuzzy -@findex gnus-simplify-subject-fuzzy -Simplify fuzzily. - -@item gnus-simplify-whitespace -@findex gnus-simplify-whitespace -Remove excessive whitespace. - -@item gnus-simplify-all-whitespace -@findex gnus-simplify-all-whitespace -Remove all whitespace. -@end table - -You may also write your own functions, of course. - - -@item gnus-summary-gather-exclude-subject -@vindex gnus-summary-gather-exclude-subject -Since loose thread gathering is done on subjects only, that might lead -to many false hits, especially with certain common subjects like -@samp{} and @samp{(none)}. To make the situation slightly better, -you can use the regexp @code{gnus-summary-gather-exclude-subject} to say -what subjects should be excluded from the gathering process.@* -The default is @samp{^ *$\\|^(none)$}. - -@item gnus-summary-thread-gathering-function -@vindex gnus-summary-thread-gathering-function -Gnus gathers threads by looking at @code{Subject} headers. This means -that totally unrelated articles may end up in the same ``thread'', which -is confusing. An alternate approach is to look at all the -@code{Message-ID}s in all the @code{References} headers to find matches. -This will ensure that no gathered threads ever include unrelated -articles, but it also means that people who have posted with broken -newsreaders won't be gathered properly. The choice is yours---plague or -cholera: - -@table @code -@item gnus-gather-threads-by-subject -@findex gnus-gather-threads-by-subject -This function is the default gathering function and looks at -@code{Subject}s exclusively. - -@item gnus-gather-threads-by-references -@findex gnus-gather-threads-by-references -This function looks at @code{References} headers exclusively. -@end table - -If you want to test gathering by @code{References}, you could say -something like: - -@lisp -(setq gnus-summary-thread-gathering-function - 'gnus-gather-threads-by-references) -@end lisp - -@end table - - -@node Filling In Threads -@subsubsection Filling In Threads - -@table @code -@item gnus-fetch-old-headers -@vindex gnus-fetch-old-headers -If non-@code{nil}, Gnus will attempt to build old threads by fetching -more old headers---headers to articles marked as read. If you would -like to display as few summary lines as possible, but still connect as -many loose threads as possible, you should set this variable to -@code{some} or a number. If you set it to a number, no more than that -number of extra old headers will be fetched. In either case, fetching -old headers only works if the back end you are using carries overview -files---this would normally be @code{nntp}, @code{nnspool}, -@code{nnml}, and @code{nnmaildir}. Also remember that if the root of -the thread has been expired by the server, there's not much Gnus can -do about that. - -This variable can also be set to @code{invisible}. This won't have any -visible effects, but is useful if you use the @kbd{A T} command a lot -(@pxref{Finding the Parent}). - -@item gnus-fetch-old-ephemeral-headers -@vindex gnus-fetch-old-ephemeral-headers -Same as @code{gnus-fetch-old-headers}, but only used for ephemeral -newsgroups. - -@item gnus-build-sparse-threads -@vindex gnus-build-sparse-threads -Fetching old headers can be slow. A low-rent similar effect can be -gotten by setting this variable to @code{some}. Gnus will then look at -the complete @code{References} headers of all articles and try to string -together articles that belong in the same thread. This will leave -@dfn{gaps} in the threading display where Gnus guesses that an article -is missing from the thread. (These gaps appear like normal summary -lines. If you select a gap, Gnus will try to fetch the article in -question.) If this variable is @code{t}, Gnus will display all these -``gaps'' without regard for whether they are useful for completing the -thread or not. Finally, if this variable is @code{more}, Gnus won't cut -off sparse leaf nodes that don't lead anywhere. This variable is -@code{nil} by default. - -@item gnus-read-all-available-headers -@vindex gnus-read-all-available-headers -This is a rather obscure variable that few will find useful. It's -intended for those non-news newsgroups where the back end has to fetch -quite a lot to present the summary buffer, and where it's impossible to -go back to parents of articles. This is mostly the case in the -web-based groups, like the @code{nnultimate} groups. - -If you don't use those, then it's safe to leave this as the default -@code{nil}. If you want to use this variable, it should be a regexp -that matches the group name, or @code{t} for all groups. - -@end table - - -@node More Threading -@subsubsection More Threading - -@table @code -@item gnus-show-threads -@vindex gnus-show-threads -If this variable is @code{nil}, no threading will be done, and all of -the rest of the variables here will have no effect. Turning threading -off will speed group selection up a bit, but it is sure to make reading -slower and more awkward. - -@item gnus-thread-hide-subtree -@vindex gnus-thread-hide-subtree -If non-@code{nil}, all threads will be hidden when the summary buffer is -generated. - -This can also be a predicate specifier (@pxref{Predicate Specifiers}). -Available predicates are @code{gnus-article-unread-p} and -@code{gnus-article-unseen-p}. - -Here's an example: - -@lisp -(setq gnus-thread-hide-subtree - '(or gnus-article-unread-p - gnus-article-unseen-p)) -@end lisp - -(It's a pretty nonsensical example, since all unseen articles are also -unread, but you get my drift.) - - -@item gnus-thread-expunge-below -@vindex gnus-thread-expunge-below -All threads that have a total score (as defined by -@code{gnus-thread-score-function}) less than this number will be -expunged. This variable is @code{nil} by default, which means that no -threads are expunged. - -@item gnus-thread-hide-killed -@vindex gnus-thread-hide-killed -if you kill a thread and this variable is non-@code{nil}, the subtree -will be hidden. - -@item gnus-thread-ignore-subject -@vindex gnus-thread-ignore-subject -Sometimes somebody changes the subject in the middle of a thread. If -this variable is non-@code{nil}, which is the default, the subject -change is ignored. If it is @code{nil}, a change in the subject will -result in a new thread. - -@item gnus-thread-indent-level -@vindex gnus-thread-indent-level -This is a number that says how much each sub-thread should be indented. -The default is 4. - -@item gnus-sort-gathered-threads-function -@vindex gnus-sort-gathered-threads-function -Sometimes, particularly with mailing lists, the order in which mails -arrive locally is not necessarily the same as the order in which they -arrived on the mailing list. Consequently, when sorting sub-threads -using the default @code{gnus-thread-sort-by-number}, responses can end -up appearing before the article to which they are responding to. -Setting this variable to an alternate value -(e.g. @code{gnus-thread-sort-by-date}), in a group's parameters or in an -appropriate hook (e.g. @code{gnus-summary-generate-hook}) can produce a -more logical sub-thread ordering in such instances. - -@end table - - -@node Low-Level Threading -@subsubsection Low-Level Threading - -@table @code - -@item gnus-parse-headers-hook -@vindex gnus-parse-headers-hook -Hook run before parsing any headers. - -@item gnus-alter-header-function -@vindex gnus-alter-header-function -If non-@code{nil}, this function will be called to allow alteration of -article header structures. The function is called with one parameter, -the article header vector, which it may alter in any way. For instance, -if you have a mail-to-news gateway which alters the @code{Message-ID}s -in systematic ways (by adding prefixes and such), you can use this -variable to un-scramble the @code{Message-ID}s so that they are more -meaningful. Here's one example: - -@lisp -(setq gnus-alter-header-function 'my-alter-message-id) - -(defun my-alter-message-id (header) - (let ((id (mail-header-id header))) - (when (string-match - "\\(<[^<>@@]*\\)\\.?cygnus\\..*@@\\([^<>@@]*>\\)" id) - (mail-header-set-id - (concat (match-string 1 id) "@@" (match-string 2 id)) - header)))) -@end lisp - -@end table - - -@node Thread Commands -@subsection Thread Commands -@cindex thread commands - -@table @kbd - -@item T k -@itemx C-M-k -@kindex T k (Summary) -@kindex C-M-k (Summary) -@findex gnus-summary-kill-thread -Mark all articles in the current (sub-)thread as read -(@code{gnus-summary-kill-thread}). If the prefix argument is positive, -remove all marks instead. If the prefix argument is negative, tick -articles instead. - -@item T l -@itemx C-M-l -@kindex T l (Summary) -@kindex C-M-l (Summary) -@findex gnus-summary-lower-thread -Lower the score of the current (sub-)thread -(@code{gnus-summary-lower-thread}). - -@item T i -@kindex T i (Summary) -@findex gnus-summary-raise-thread -Increase the score of the current (sub-)thread -(@code{gnus-summary-raise-thread}). - -@item T # -@kindex T # (Summary) -@findex gnus-uu-mark-thread -Set the process mark on the current (sub-)thread -(@code{gnus-uu-mark-thread}). - -@item T M-# -@kindex T M-# (Summary) -@findex gnus-uu-unmark-thread -Remove the process mark from the current (sub-)thread -(@code{gnus-uu-unmark-thread}). - -@item T T -@kindex T T (Summary) -@findex gnus-summary-toggle-threads -Toggle threading (@code{gnus-summary-toggle-threads}). - -@item T s -@kindex T s (Summary) -@findex gnus-summary-show-thread -Expose the (sub-)thread hidden under the current article, if any@* -(@code{gnus-summary-show-thread}). - -@item T h -@kindex T h (Summary) -@findex gnus-summary-hide-thread -Hide the current (sub-)thread (@code{gnus-summary-hide-thread}). - -@item T S -@kindex T S (Summary) -@findex gnus-summary-show-all-threads -Expose all hidden threads (@code{gnus-summary-show-all-threads}). - -@item T H -@kindex T H (Summary) -@findex gnus-summary-hide-all-threads -Hide all threads (@code{gnus-summary-hide-all-threads}). - -@item T t -@kindex T t (Summary) -@findex gnus-summary-rethread-current -Re-thread the current article's thread -(@code{gnus-summary-rethread-current}). This works even when the -summary buffer is otherwise unthreaded. - -@item T ^ -@kindex T ^ (Summary) -@findex gnus-summary-reparent-thread -Make the current article the child of the marked (or previous) article -(@code{gnus-summary-reparent-thread}). - -@end table - -The following commands are thread movement commands. They all -understand the numeric prefix. - -@table @kbd - -@item T n -@kindex T n (Summary) -@itemx C-M-f -@kindex C-M-n (Summary) -@itemx M-down -@kindex M-down (Summary) -@findex gnus-summary-next-thread -Go to the next thread (@code{gnus-summary-next-thread}). - -@item T p -@kindex T p (Summary) -@itemx C-M-b -@kindex C-M-p (Summary) -@itemx M-up -@kindex M-up (Summary) -@findex gnus-summary-prev-thread -Go to the previous thread (@code{gnus-summary-prev-thread}). - -@item T d -@kindex T d (Summary) -@findex gnus-summary-down-thread -Descend the thread (@code{gnus-summary-down-thread}). - -@item T u -@kindex T u (Summary) -@findex gnus-summary-up-thread -Ascend the thread (@code{gnus-summary-up-thread}). - -@item T o -@kindex T o (Summary) -@findex gnus-summary-top-thread -Go to the top of the thread (@code{gnus-summary-top-thread}). -@end table - -@vindex gnus-thread-operation-ignore-subject -If you ignore subject while threading, you'll naturally end up with -threads that have several different subjects in them. If you then issue -a command like @kbd{T k} (@code{gnus-summary-kill-thread}) you might not -wish to kill the entire thread, but just those parts of the thread that -have the same subject as the current article. If you like this idea, -you can fiddle with @code{gnus-thread-operation-ignore-subject}. If it -is non-@code{nil} (which it is by default), subjects will be ignored -when doing thread commands. If this variable is @code{nil}, articles in -the same thread with different subjects will not be included in the -operation in question. If this variable is @code{fuzzy}, only articles -that have subjects fuzzily equal will be included (@pxref{Fuzzy -Matching}). - - -@node Sorting the Summary Buffer -@section Sorting the Summary Buffer - -@findex gnus-thread-sort-by-total-score -@findex gnus-thread-sort-by-date -@findex gnus-thread-sort-by-score -@findex gnus-thread-sort-by-subject -@findex gnus-thread-sort-by-author -@findex gnus-thread-sort-by-number -@findex gnus-thread-sort-by-random -@vindex gnus-thread-sort-functions -@findex gnus-thread-sort-by-most-recent-number -@findex gnus-thread-sort-by-most-recent-date -If you are using a threaded summary display, you can sort the threads by -setting @code{gnus-thread-sort-functions}, which can be either a single -function, a list of functions, or a list containing functions and -@code{(not some-function)} elements. - -By default, sorting is done on article numbers. Ready-made sorting -predicate functions include @code{gnus-thread-sort-by-number}, -@code{gnus-thread-sort-by-author}, @code{gnus-thread-sort-by-subject}, -@code{gnus-thread-sort-by-date}, @code{gnus-thread-sort-by-score}, -@code{gnus-thread-sort-by-most-recent-number}, -@code{gnus-thread-sort-by-most-recent-date}, -@code{gnus-thread-sort-by-random} and -@code{gnus-thread-sort-by-total-score}. - -Each function takes two threads and returns non-@code{nil} if the first -thread should be sorted before the other. Note that sorting really is -normally done by looking only at the roots of each thread. - -If you use more than one function, the primary sort key should be the -last function in the list. You should probably always include -@code{gnus-thread-sort-by-number} in the list of sorting -functions---preferably first. This will ensure that threads that are -equal with respect to the other sort criteria will be displayed in -ascending article order. - -If you would like to sort by reverse score, then by subject, and finally -by number, you could do something like: - -@lisp -(setq gnus-thread-sort-functions - '(gnus-thread-sort-by-number - gnus-thread-sort-by-subject - (not gnus-thread-sort-by-total-score))) -@end lisp - -The threads that have highest score will be displayed first in the -summary buffer. When threads have the same score, they will be sorted -alphabetically. The threads that have the same score and the same -subject will be sorted by number, which is (normally) the sequence in -which the articles arrived. - -If you want to sort by score and then reverse arrival order, you could -say something like: - -@lisp -(setq gnus-thread-sort-functions - '((lambda (t1 t2) - (not (gnus-thread-sort-by-number t1 t2))) - gnus-thread-sort-by-score)) -@end lisp - -@vindex gnus-thread-score-function -The function in the @code{gnus-thread-score-function} variable (default -@code{+}) is used for calculating the total score of a thread. Useful -functions might be @code{max}, @code{min}, or squared means, or whatever -tickles your fancy. - -@findex gnus-article-sort-functions -@findex gnus-article-sort-by-date -@findex gnus-article-sort-by-score -@findex gnus-article-sort-by-subject -@findex gnus-article-sort-by-author -@findex gnus-article-sort-by-random -@findex gnus-article-sort-by-number -If you are using an unthreaded display for some strange reason or -other, you have to fiddle with the @code{gnus-article-sort-functions} -variable. It is very similar to the -@code{gnus-thread-sort-functions}, except that it uses slightly -different functions for article comparison. Available sorting -predicate functions are @code{gnus-article-sort-by-number}, -@code{gnus-article-sort-by-author}, -@code{gnus-article-sort-by-subject}, @code{gnus-article-sort-by-date}, -@code{gnus-article-sort-by-random}, and -@code{gnus-article-sort-by-score}. - -If you want to sort an unthreaded summary display by subject, you could -say something like: - -@lisp -(setq gnus-article-sort-functions - '(gnus-article-sort-by-number - gnus-article-sort-by-subject)) -@end lisp - - - -@node Asynchronous Fetching -@section Asynchronous Article Fetching -@cindex asynchronous article fetching -@cindex article pre-fetch -@cindex pre-fetch - -If you read your news from an @acronym{NNTP} server that's far away, the -network latencies may make reading articles a chore. You have to wait -for a while after pressing @kbd{n} to go to the next article before the -article appears. Why can't Gnus just go ahead and fetch the article -while you are reading the previous one? Why not, indeed. - -First, some caveats. There are some pitfalls to using asynchronous -article fetching, especially the way Gnus does it. - -Let's say you are reading article 1, which is short, and article 2 is -quite long, and you are not interested in reading that. Gnus does not -know this, so it goes ahead and fetches article 2. You decide to read -article 3, but since Gnus is in the process of fetching article 2, the -connection is blocked. - -To avoid these situations, Gnus will open two (count 'em two) -connections to the server. Some people may think this isn't a very nice -thing to do, but I don't see any real alternatives. Setting up that -extra connection takes some time, so Gnus startup will be slower. - -Gnus will fetch more articles than you will read. This will mean that -the link between your machine and the @acronym{NNTP} server will become more -loaded than if you didn't use article pre-fetch. The server itself will -also become more loaded---both with the extra article requests, and the -extra connection. - -Ok, so now you know that you shouldn't really use this thing@dots{} unless -you really want to. - -@vindex gnus-asynchronous -Here's how: Set @code{gnus-asynchronous} to @code{t}. The rest should -happen automatically. - -@vindex gnus-use-article-prefetch -You can control how many articles are to be pre-fetched by setting -@code{gnus-use-article-prefetch}. This is 30 by default, which means -that when you read an article in the group, the back end will pre-fetch -the next 30 articles. If this variable is @code{t}, the back end will -pre-fetch all the articles it can without bound. If it is -@code{nil}, no pre-fetching will be done. - -@vindex gnus-async-prefetch-article-p -@findex gnus-async-unread-p -There are probably some articles that you don't want to pre-fetch---read -articles, for instance. The @code{gnus-async-prefetch-article-p} -variable controls whether an article is to be pre-fetched. This -function should return non-@code{nil} when the article in question is -to be pre-fetched. The default is @code{gnus-async-unread-p}, which -returns @code{nil} on read articles. The function is called with an -article data structure as the only parameter. - -If, for instance, you wish to pre-fetch only unread articles shorter -than 100 lines, you could say something like: - -@lisp -(defun my-async-short-unread-p (data) - "Return non-nil for short, unread articles." - (and (gnus-data-unread-p data) - (< (mail-header-lines (gnus-data-header data)) - 100))) - -(setq gnus-async-prefetch-article-p 'my-async-short-unread-p) -@end lisp - -These functions will be called many, many times, so they should -preferably be short and sweet to avoid slowing down Gnus too much. -It's probably a good idea to byte-compile things like this. - -@vindex gnus-prefetched-article-deletion-strategy -Articles have to be removed from the asynch buffer sooner or later. The -@code{gnus-prefetched-article-deletion-strategy} says when to remove -articles. This is a list that may contain the following elements: - -@table @code -@item read -Remove articles when they are read. - -@item exit -Remove articles when exiting the group. -@end table - -The default value is @code{(read exit)}. - -@c @vindex gnus-use-header-prefetch -@c If @code{gnus-use-header-prefetch} is non-@code{nil}, prefetch articles -@c from the next group. - - -@node Article Caching -@section Article Caching -@cindex article caching -@cindex caching - -If you have an @emph{extremely} slow @acronym{NNTP} connection, you may -consider turning article caching on. Each article will then be stored -locally under your home directory. As you may surmise, this could -potentially use @emph{huge} amounts of disk space, as well as eat up all -your inodes so fast it will make your head swim. In vodka. - -Used carefully, though, it could be just an easier way to save articles. - -@vindex gnus-use-long-file-name -@vindex gnus-cache-directory -@vindex gnus-use-cache -To turn caching on, set @code{gnus-use-cache} to @code{t}. By default, -all articles ticked or marked as dormant will then be copied -over to your local cache (@code{gnus-cache-directory}). Whether this -cache is flat or hierarchical is controlled by the -@code{gnus-use-long-file-name} variable, as usual. - -When re-selecting a ticked or dormant article, it will be fetched from the -cache instead of from the server. As articles in your cache will never -expire, this might serve as a method of saving articles while still -keeping them where they belong. Just mark all articles you want to save -as dormant, and don't worry. - -When an article is marked as read, is it removed from the cache. - -@vindex gnus-cache-remove-articles -@vindex gnus-cache-enter-articles -The entering/removal of articles from the cache is controlled by the -@code{gnus-cache-enter-articles} and @code{gnus-cache-remove-articles} -variables. Both are lists of symbols. The first is @code{(ticked -dormant)} by default, meaning that ticked and dormant articles will be -put in the cache. The latter is @code{(read)} by default, meaning that -articles marked as read are removed from the cache. Possibly -symbols in these two lists are @code{ticked}, @code{dormant}, -@code{unread} and @code{read}. - -@findex gnus-jog-cache -So where does the massive article-fetching and storing come into the -picture? The @code{gnus-jog-cache} command will go through all -subscribed newsgroups, request all unread articles, score them, and -store them in the cache. You should only ever, ever ever ever, use this -command if 1) your connection to the @acronym{NNTP} server is really, really, -really slow and 2) you have a really, really, really huge disk. -Seriously. One way to cut down on the number of articles downloaded is -to score unwanted articles down and have them marked as read. They will -not then be downloaded by this command. - -@vindex gnus-uncacheable-groups -@vindex gnus-cacheable-groups -It is likely that you do not want caching on all groups. For instance, -if your @code{nnml} mail is located under your home directory, it makes no -sense to cache it somewhere else under your home directory. Unless you -feel that it's neat to use twice as much space. - -To limit the caching, you could set @code{gnus-cacheable-groups} to a -regexp of groups to cache, @samp{^nntp} for instance, or set the -@code{gnus-uncacheable-groups} regexp to @samp{^nnml}, for instance. -Both variables are @code{nil} by default. If a group matches both -variables, the group is not cached. - -@findex gnus-cache-generate-nov-databases -@findex gnus-cache-generate-active -@vindex gnus-cache-active-file -The cache stores information on what articles it contains in its active -file (@code{gnus-cache-active-file}). If this file (or any other parts -of the cache) becomes all messed up for some reason or other, Gnus -offers two functions that will try to set things right. @kbd{M-x -gnus-cache-generate-nov-databases} will (re)build all the @acronym{NOV} -files, and @kbd{gnus-cache-generate-active} will (re)generate the active -file. - -@findex gnus-cache-move-cache -@code{gnus-cache-move-cache} will move your whole -@code{gnus-cache-directory} to some other location. You get asked to -where, isn't that cool? - -@node Persistent Articles -@section Persistent Articles -@cindex persistent articles - -Closely related to article caching, we have @dfn{persistent articles}. -In fact, it's just a different way of looking at caching, and much more -useful in my opinion. - -Say you're reading a newsgroup, and you happen on to some valuable gem -that you want to keep and treasure forever. You'd normally just save it -(using one of the many saving commands) in some file. The problem with -that is that it's just, well, yucky. Ideally you'd prefer just having -the article remain in the group where you found it forever; untouched by -the expiry going on at the news server. - -This is what a @dfn{persistent article} is---an article that just won't -be deleted. It's implemented using the normal cache functions, but -you use two explicit commands for managing persistent articles: - -@table @kbd - -@item * -@kindex * (Summary) -@findex gnus-cache-enter-article -Make the current article persistent (@code{gnus-cache-enter-article}). - -@item M-* -@kindex M-* (Summary) -@findex gnus-cache-remove-article -Remove the current article from the persistent articles -(@code{gnus-cache-remove-article}). This will normally delete the -article. -@end table - -Both these commands understand the process/prefix convention. - -To avoid having all ticked articles (and stuff) entered into the cache, -you should set @code{gnus-use-cache} to @code{passive} if you're just -interested in persistent articles: - -@lisp -(setq gnus-use-cache 'passive) -@end lisp - - -@node Article Backlog -@section Article Backlog -@cindex backlog -@cindex article backlog - -If you have a slow connection, but the idea of using caching seems -unappealing to you (and it is, really), you can help the situation some -by switching on the @dfn{backlog}. This is where Gnus will buffer -already read articles so that it doesn't have to re-fetch articles -you've already read. This only helps if you are in the habit of -re-selecting articles you've recently read, of course. If you never do -that, turning the backlog on will slow Gnus down a little bit, and -increase memory usage some. - -@vindex gnus-keep-backlog -If you set @code{gnus-keep-backlog} to a number @var{n}, Gnus will store -at most @var{n} old articles in a buffer for later re-fetching. If this -variable is non-@code{nil} and is not a number, Gnus will store -@emph{all} read articles, which means that your Emacs will grow without -bound before exploding and taking your machine down with you. I put -that in there just to keep y'all on your toes. - -The default value is 20. - - -@node Saving Articles -@section Saving Articles -@cindex saving articles - -Gnus can save articles in a number of ways. Below is the documentation -for saving articles in a fairly straight-forward fashion (i.e., little -processing of the article is done before it is saved). For a different -approach (uudecoding, unsharing) you should use @code{gnus-uu} -(@pxref{Decoding Articles}). - -For the commands listed here, the target is a file. If you want to -save to a group, see the @kbd{B c} (@code{gnus-summary-copy-article}) -command (@pxref{Mail Group Commands}). - -@vindex gnus-save-all-headers -If @code{gnus-save-all-headers} is non-@code{nil}, Gnus will not delete -unwanted headers before saving the article. - -@vindex gnus-saved-headers -If the preceding variable is @code{nil}, all headers that match the -@code{gnus-saved-headers} regexp will be kept, while the rest will be -deleted before saving. - -@table @kbd - -@item O o -@itemx o -@kindex O o (Summary) -@kindex o (Summary) -@findex gnus-summary-save-article -@c @icon{gnus-summary-save-article} -Save the current article using the default article saver -(@code{gnus-summary-save-article}). - -@item O m -@kindex O m (Summary) -@findex gnus-summary-save-article-mail -Save the current article in a Unix mail box (mbox) file -(@code{gnus-summary-save-article-mail}). - -@item O r -@kindex O r (Summary) -@findex gnus-summary-save-article-rmail -Save the current article in Rmail format -(@code{gnus-summary-save-article-rmail}). - -@item O f -@kindex O f (Summary) -@findex gnus-summary-save-article-file -@c @icon{gnus-summary-save-article-file} -Save the current article in plain file format -(@code{gnus-summary-save-article-file}). - -@item O F -@kindex O F (Summary) -@findex gnus-summary-write-article-file -Write the current article in plain file format, overwriting any previous -file contents (@code{gnus-summary-write-article-file}). - -@item O b -@kindex O b (Summary) -@findex gnus-summary-save-article-body-file -Save the current article body in plain file format -(@code{gnus-summary-save-article-body-file}). - -@item O h -@kindex O h (Summary) -@findex gnus-summary-save-article-folder -Save the current article in mh folder format -(@code{gnus-summary-save-article-folder}). - -@item O v -@kindex O v (Summary) -@findex gnus-summary-save-article-vm -Save the current article in a VM folder -(@code{gnus-summary-save-article-vm}). - -@item O p -@itemx | -@kindex O p (Summary) -@kindex | (Summary) -@findex gnus-summary-pipe-output -Save the current article in a pipe. Uhm, like, what I mean is---Pipe -the current article to a process (@code{gnus-summary-pipe-output}). -If given a symbolic prefix (@pxref{Symbolic Prefixes}), include the -complete headers in the piped output. - -@item O P -@kindex O P (Summary) -@findex gnus-summary-muttprint -@vindex gnus-summary-muttprint-program -Save the current article into muttprint. That is, print it using the -external program @uref{http://muttprint.sourceforge.net/, -Muttprint}. The program name and options to use is controlled by the -variable @code{gnus-summary-muttprint-program}. -(@code{gnus-summary-muttprint}). - -@end table - -@vindex gnus-prompt-before-saving -All these commands use the process/prefix convention -(@pxref{Process/Prefix}). If you save bunches of articles using these -functions, you might get tired of being prompted for files to save each -and every article in. The prompting action is controlled by -the @code{gnus-prompt-before-saving} variable, which is @code{always} by -default, giving you that excessive prompting action you know and -loathe. If you set this variable to @code{t} instead, you'll be prompted -just once for each series of articles you save. If you like to really -have Gnus do all your thinking for you, you can even set this variable -to @code{nil}, which means that you will never be prompted for files to -save articles in. Gnus will simply save all the articles in the default -files. - - -@vindex gnus-default-article-saver -You can customize the @code{gnus-default-article-saver} variable to make -Gnus do what you want it to. You can use any of the eight ready-made -functions below, or you can create your own. - -@table @code - -@item gnus-summary-save-in-rmail -@findex gnus-summary-save-in-rmail -@vindex gnus-rmail-save-name -@findex gnus-plain-save-name -This is the default format, @dfn{Babyl}. Uses the function in the -@code{gnus-rmail-save-name} variable to get a file name to save the -article in. The default is @code{gnus-plain-save-name}. - -@item gnus-summary-save-in-mail -@findex gnus-summary-save-in-mail -@vindex gnus-mail-save-name -Save in a Unix mail (mbox) file. Uses the function in the -@code{gnus-mail-save-name} variable to get a file name to save the -article in. The default is @code{gnus-plain-save-name}. - -@item gnus-summary-save-in-file -@findex gnus-summary-save-in-file -@vindex gnus-file-save-name -@findex gnus-numeric-save-name -Append the article straight to an ordinary file. Uses the function in -the @code{gnus-file-save-name} variable to get a file name to save the -article in. The default is @code{gnus-numeric-save-name}. - -@item gnus-summary-write-to-file -@findex gnus-summary-write-to-file -Write the article straight to an ordinary file. The file is -overwritten if it exists. Uses the function in the -@code{gnus-file-save-name} variable to get a file name to save the -article in. The default is @code{gnus-numeric-save-name}. - -@item gnus-summary-save-body-in-file -@findex gnus-summary-save-body-in-file -Append the article body to an ordinary file. Uses the function in the -@code{gnus-file-save-name} variable to get a file name to save the -article in. The default is @code{gnus-numeric-save-name}. - -@item gnus-summary-write-body-to-file -@findex gnus-summary-write-body-to-file -Write the article body straight to an ordinary file. The file is -overwritten if it exists. Uses the function in the -@code{gnus-file-save-name} variable to get a file name to save the -article in. The default is @code{gnus-numeric-save-name}. - -@item gnus-summary-save-in-folder -@findex gnus-summary-save-in-folder -@findex gnus-folder-save-name -@findex gnus-Folder-save-name -@vindex gnus-folder-save-name -@cindex rcvstore -@cindex MH folders -Save the article to an MH folder using @code{rcvstore} from the MH -library. Uses the function in the @code{gnus-folder-save-name} variable -to get a file name to save the article in. The default is -@code{gnus-folder-save-name}, but you can also use -@code{gnus-Folder-save-name}, which creates capitalized names. - -@item gnus-summary-save-in-vm -@findex gnus-summary-save-in-vm -Save the article in a VM folder. You have to have the VM mail -reader to use this setting. -@end table - -The symbol of each function may have the following properties: - -@table @code -@item :decode -The value non-@code{nil} means save decoded articles. This is -meaningful only with @code{gnus-summary-save-in-file}, -@code{gnus-summary-save-body-in-file}, -@code{gnus-summary-write-to-file}, and -@code{gnus-summary-write-body-to-file}. - -@item :function -The value specifies an alternative function which appends, not -overwrites, articles to a file. This implies that when saving many -articles at a time, @code{gnus-prompt-before-saving} is bound to -@code{t} and all articles are saved in a single file. This is -meaningful only with @code{gnus-summary-write-to-file} and -@code{gnus-summary-write-body-to-file}. - -@item :headers -The value specifies the symbol of a variable of which the value -specifies headers to be saved. If it is omitted, -@code{gnus-save-all-headers} and @code{gnus-saved-headers} control what -headers should be saved. -@end table - -@vindex gnus-article-save-directory -All of these functions, except for the last one, will save the article -in the @code{gnus-article-save-directory}, which is initialized from the -@env{SAVEDIR} environment variable. This is @file{~/News/} by -default. - -As you can see above, the functions use different functions to find a -suitable name of a file to save the article in. Below is a list of -available functions that generate names: - -@table @code - -@item gnus-Numeric-save-name -@findex gnus-Numeric-save-name -File names like @file{~/News/Alt.andrea-dworkin/45}. - -@item gnus-numeric-save-name -@findex gnus-numeric-save-name -File names like @file{~/News/alt.andrea-dworkin/45}. - -@item gnus-Plain-save-name -@findex gnus-Plain-save-name -File names like @file{~/News/Alt.andrea-dworkin}. - -@item gnus-plain-save-name -@findex gnus-plain-save-name -File names like @file{~/News/alt.andrea-dworkin}. - -@item gnus-sender-save-name -@findex gnus-sender-save-name -File names like @file{~/News/larsi}. -@end table - -@vindex gnus-split-methods -You can have Gnus suggest where to save articles by plonking a regexp into -the @code{gnus-split-methods} alist. For instance, if you would like to -save articles related to Gnus in the file @file{gnus-stuff}, and articles -related to VM in @file{vm-stuff}, you could set this variable to something -like: - -@lisp -(("^Subject:.*gnus\\|^Newsgroups:.*gnus" "gnus-stuff") - ("^Subject:.*vm\\|^Xref:.*vm" "vm-stuff") - (my-choosing-function "../other-dir/my-stuff") - ((equal gnus-newsgroup-name "mail.misc") "mail-stuff")) -@end lisp - -We see that this is a list where each element is a list that has two -elements---the @dfn{match} and the @dfn{file}. The match can either be -a string (in which case it is used as a regexp to match on the article -head); it can be a symbol (which will be called as a function with the -group name as a parameter); or it can be a list (which will be -@code{eval}ed). If any of these actions have a non-@code{nil} result, -the @dfn{file} will be used as a default prompt. In addition, the -result of the operation itself will be used if the function or form -called returns a string or a list of strings. - -You basically end up with a list of file names that might be used when -saving the current article. (All ``matches'' will be used.) You will -then be prompted for what you really want to use as a name, with file -name completion over the results from applying this variable. - -This variable is @code{((gnus-article-archive-name))} by default, which -means that Gnus will look at the articles it saves for an -@code{Archive-name} line and use that as a suggestion for the file -name. - -Here's an example function to clean up file names somewhat. If you have -lots of mail groups called things like -@samp{nnml:mail.whatever}, you may want to chop off the beginning of -these group names before creating the file name to save to. The -following will do just that: - -@lisp -(defun my-save-name (group) - (when (string-match "^nnml:mail." group) - (substring group (match-end 0)))) - -(setq gnus-split-methods - '((gnus-article-archive-name) - (my-save-name))) -@end lisp - - -@vindex gnus-use-long-file-name -Finally, you have the @code{gnus-use-long-file-name} variable. If it is -@code{nil}, all the preceding functions will replace all periods -(@samp{.}) in the group names with slashes (@samp{/})---which means that -the functions will generate hierarchies of directories instead of having -all the files in the top level directory -(@file{~/News/alt/andrea-dworkin} instead of -@file{~/News/alt.andrea-dworkin}.) This variable is @code{t} by default -on most systems. However, for historical reasons, this is @code{nil} on -Xenix and usg-unix-v machines by default. - -This function also affects kill and score file names. If this variable -is a list, and the list contains the element @code{not-score}, long file -names will not be used for score files, if it contains the element -@code{not-save}, long file names will not be used for saving, and if it -contains the element @code{not-kill}, long file names will not be used -for kill files. - -If you'd like to save articles in a hierarchy that looks something like -a spool, you could - -@lisp -(setq gnus-use-long-file-name '(not-save)) ; @r{to get a hierarchy} -(setq gnus-default-article-saver - 'gnus-summary-save-in-file) ; @r{no encoding} -@end lisp - -Then just save with @kbd{o}. You'd then read this hierarchy with -ephemeral @code{nneething} groups---@kbd{G D} in the group buffer, and -the top level directory as the argument (@file{~/News/}). Then just walk -around to the groups/directories with @code{nneething}. - - -@node Decoding Articles -@section Decoding Articles -@cindex decoding articles - -Sometime users post articles (or series of articles) that have been -encoded in some way or other. Gnus can decode them for you. - -@menu -* Uuencoded Articles:: Uudecode articles. -* Shell Archives:: Unshar articles. -* PostScript Files:: Split PostScript. -* Other Files:: Plain save and binhex. -* Decoding Variables:: Variables for a happy decoding. -* Viewing Files:: You want to look at the result of the decoding? -@end menu - -@cindex series -@cindex article series -All these functions use the process/prefix convention -(@pxref{Process/Prefix}) for finding out what articles to work on, with -the extension that a ``single article'' means ``a single series''. Gnus -can find out by itself what articles belong to a series, decode all the -articles and unpack/view/save the resulting file(s). - -Gnus guesses what articles are in the series according to the following -simplish rule: The subjects must be (nearly) identical, except for the -last two numbers of the line. (Spaces are largely ignored, however.) - -For example: If you choose a subject called @samp{cat.gif (2/3)}, Gnus -will find all the articles that match the regexp @samp{^cat.gif -([0-9]+/[0-9]+).*$}. - -Subjects that are non-standard, like @samp{cat.gif (2/3) Part 6 of a -series}, will not be properly recognized by any of the automatic viewing -commands, and you have to mark the articles manually with @kbd{#}. - - -@node Uuencoded Articles -@subsection Uuencoded Articles -@cindex uudecode -@cindex uuencoded articles - -@table @kbd - -@item X u -@kindex X u (Summary) -@findex gnus-uu-decode-uu -@c @icon{gnus-uu-decode-uu} -Uudecodes the current series (@code{gnus-uu-decode-uu}). - -@item X U -@kindex X U (Summary) -@findex gnus-uu-decode-uu-and-save -Uudecodes and saves the current series -(@code{gnus-uu-decode-uu-and-save}). - -@item X v u -@kindex X v u (Summary) -@findex gnus-uu-decode-uu-view -Uudecodes and views the current series (@code{gnus-uu-decode-uu-view}). - -@item X v U -@kindex X v U (Summary) -@findex gnus-uu-decode-uu-and-save-view -Uudecodes, views and saves the current series -(@code{gnus-uu-decode-uu-and-save-view}). - -@end table - -Remember that these all react to the presence of articles marked with -the process mark. If, for instance, you'd like to decode and save an -entire newsgroup, you'd typically do @kbd{M P a} -(@code{gnus-uu-mark-all}) and then @kbd{X U} -(@code{gnus-uu-decode-uu-and-save}). - -All this is very much different from how @code{gnus-uu} worked with -@sc{gnus 4.1}, where you had explicit keystrokes for everything under -the sun. This version of @code{gnus-uu} generally assumes that you mark -articles in some way (@pxref{Setting Process Marks}) and then press -@kbd{X u}. - -@vindex gnus-uu-notify-files -Note: When trying to decode articles that have names matching -@code{gnus-uu-notify-files}, which is hard-coded to -@samp{[Cc][Ii][Nn][Dd][Yy][0-9]+.\\(gif\\|jpg\\)}, @code{gnus-uu} will -automatically post an article on @samp{comp.unix.wizards} saying that -you have just viewed the file in question. This feature can't be turned -off. - - -@node Shell Archives -@subsection Shell Archives -@cindex unshar -@cindex shell archives -@cindex shared articles - -Shell archives (``shar files'') used to be a popular way to distribute -sources, but it isn't used all that much today. In any case, we have -some commands to deal with these: - -@table @kbd - -@item X s -@kindex X s (Summary) -@findex gnus-uu-decode-unshar -Unshars the current series (@code{gnus-uu-decode-unshar}). - -@item X S -@kindex X S (Summary) -@findex gnus-uu-decode-unshar-and-save -Unshars and saves the current series (@code{gnus-uu-decode-unshar-and-save}). - -@item X v s -@kindex X v s (Summary) -@findex gnus-uu-decode-unshar-view -Unshars and views the current series (@code{gnus-uu-decode-unshar-view}). - -@item X v S -@kindex X v S (Summary) -@findex gnus-uu-decode-unshar-and-save-view -Unshars, views and saves the current series -(@code{gnus-uu-decode-unshar-and-save-view}). -@end table - - -@node PostScript Files -@subsection PostScript Files -@cindex PostScript - -@table @kbd - -@item X p -@kindex X p (Summary) -@findex gnus-uu-decode-postscript -Unpack the current PostScript series (@code{gnus-uu-decode-postscript}). - -@item X P -@kindex X P (Summary) -@findex gnus-uu-decode-postscript-and-save -Unpack and save the current PostScript series -(@code{gnus-uu-decode-postscript-and-save}). - -@item X v p -@kindex X v p (Summary) -@findex gnus-uu-decode-postscript-view -View the current PostScript series -(@code{gnus-uu-decode-postscript-view}). - -@item X v P -@kindex X v P (Summary) -@findex gnus-uu-decode-postscript-and-save-view -View and save the current PostScript series -(@code{gnus-uu-decode-postscript-and-save-view}). -@end table - - -@node Other Files -@subsection Other Files - -@table @kbd -@item X o -@kindex X o (Summary) -@findex gnus-uu-decode-save -Save the current series -(@code{gnus-uu-decode-save}). - -@item X b -@kindex X b (Summary) -@findex gnus-uu-decode-binhex -Unbinhex the current series (@code{gnus-uu-decode-binhex}). This -doesn't really work yet. -@end table - - -@node Decoding Variables -@subsection Decoding Variables - -Adjective, not verb. - -@menu -* Rule Variables:: Variables that say how a file is to be viewed. -* Other Decode Variables:: Other decode variables. -* Uuencoding and Posting:: Variables for customizing uuencoding. -@end menu - - -@node Rule Variables -@subsubsection Rule Variables -@cindex rule variables - -Gnus uses @dfn{rule variables} to decide how to view a file. All these -variables are of the form - -@lisp - (list '(regexp1 command2) - '(regexp2 command2) - ...) -@end lisp - -@table @code - -@item gnus-uu-user-view-rules -@vindex gnus-uu-user-view-rules -@cindex sox -This variable is consulted first when viewing files. If you wish to use, -for instance, @code{sox} to convert an @file{.au} sound file, you could -say something like: -@lisp -(setq gnus-uu-user-view-rules - (list '("\\\\.au$" "sox %s -t .aiff > /dev/audio"))) -@end lisp - -@item gnus-uu-user-view-rules-end -@vindex gnus-uu-user-view-rules-end -This variable is consulted if Gnus couldn't make any matches from the -user and default view rules. - -@item gnus-uu-user-archive-rules -@vindex gnus-uu-user-archive-rules -This variable can be used to say what commands should be used to unpack -archives. -@end table - - -@node Other Decode Variables -@subsubsection Other Decode Variables - -@table @code -@vindex gnus-uu-grabbed-file-functions - -@item gnus-uu-grabbed-file-functions -All functions in this list will be called right after each file has been -successfully decoded---so that you can move or view files right away, -and don't have to wait for all files to be decoded before you can do -anything. Ready-made functions you can put in this list are: - -@table @code - -@item gnus-uu-grab-view -@findex gnus-uu-grab-view -View the file. - -@item gnus-uu-grab-move -@findex gnus-uu-grab-move -Move the file (if you're using a saving function.) -@end table - -@item gnus-uu-be-dangerous -@vindex gnus-uu-be-dangerous -Specifies what to do if unusual situations arise during decoding. If -@code{nil}, be as conservative as possible. If @code{t}, ignore things -that didn't work, and overwrite existing files. Otherwise, ask each -time. - -@item gnus-uu-ignore-files-by-name -@vindex gnus-uu-ignore-files-by-name -Files with name matching this regular expression won't be viewed. - -@item gnus-uu-ignore-files-by-type -@vindex gnus-uu-ignore-files-by-type -Files with a @acronym{MIME} type matching this variable won't be viewed. -Note that Gnus tries to guess what type the file is based on the name. -@code{gnus-uu} is not a @acronym{MIME} package (yet), so this is slightly -kludgey. - -@item gnus-uu-tmp-dir -@vindex gnus-uu-tmp-dir -Where @code{gnus-uu} does its work. - -@item gnus-uu-do-not-unpack-archives -@vindex gnus-uu-do-not-unpack-archives -Non-@code{nil} means that @code{gnus-uu} won't peek inside archives -looking for files to display. - -@item gnus-uu-view-and-save -@vindex gnus-uu-view-and-save -Non-@code{nil} means that the user will always be asked to save a file -after viewing it. - -@item gnus-uu-ignore-default-view-rules -@vindex gnus-uu-ignore-default-view-rules -Non-@code{nil} means that @code{gnus-uu} will ignore the default viewing -rules. - -@item gnus-uu-ignore-default-archive-rules -@vindex gnus-uu-ignore-default-archive-rules -Non-@code{nil} means that @code{gnus-uu} will ignore the default archive -unpacking commands. - -@item gnus-uu-kill-carriage-return -@vindex gnus-uu-kill-carriage-return -Non-@code{nil} means that @code{gnus-uu} will strip all carriage returns -from articles. - -@item gnus-uu-unmark-articles-not-decoded -@vindex gnus-uu-unmark-articles-not-decoded -Non-@code{nil} means that @code{gnus-uu} will mark unsuccessfully -decoded articles as unread. - -@item gnus-uu-correct-stripped-uucode -@vindex gnus-uu-correct-stripped-uucode -Non-@code{nil} means that @code{gnus-uu} will @emph{try} to fix -uuencoded files that have had trailing spaces deleted. - -@item gnus-uu-pre-uudecode-hook -@vindex gnus-uu-pre-uudecode-hook -Hook run before sending a message to @code{uudecode}. - -@item gnus-uu-view-with-metamail -@vindex gnus-uu-view-with-metamail -@cindex metamail -Non-@code{nil} means that @code{gnus-uu} will ignore the viewing -commands defined by the rule variables and just fudge a @acronym{MIME} -content type based on the file name. The result will be fed to -@code{metamail} for viewing. - -@item gnus-uu-save-in-digest -@vindex gnus-uu-save-in-digest -Non-@code{nil} means that @code{gnus-uu}, when asked to save without -decoding, will save in digests. If this variable is @code{nil}, -@code{gnus-uu} will just save everything in a file without any -embellishments. The digesting almost conforms to RFC 1153---no easy way -to specify any meaningful volume and issue numbers were found, so I -simply dropped them. - -@end table - - -@node Uuencoding and Posting -@subsubsection Uuencoding and Posting - -@table @code - -@item gnus-uu-post-include-before-composing -@vindex gnus-uu-post-include-before-composing -Non-@code{nil} means that @code{gnus-uu} will ask for a file to encode -before you compose the article. If this variable is @code{t}, you can -either include an encoded file with @kbd{C-c C-i} or have one included -for you when you post the article. - -@item gnus-uu-post-length -@vindex gnus-uu-post-length -Maximum length of an article. The encoded file will be split into how -many articles it takes to post the entire file. - -@item gnus-uu-post-threaded -@vindex gnus-uu-post-threaded -Non-@code{nil} means that @code{gnus-uu} will post the encoded file in a -thread. This may not be smart, as no other decoder I have seen is able -to follow threads when collecting uuencoded articles. (Well, I have -seen one package that does that---@code{gnus-uu}, but somehow, I don't -think that counts@dots{}) Default is @code{nil}. - -@item gnus-uu-post-separate-description -@vindex gnus-uu-post-separate-description -Non-@code{nil} means that the description will be posted in a separate -article. The first article will typically be numbered (0/x). If this -variable is @code{nil}, the description the user enters will be included -at the beginning of the first article, which will be numbered (1/x). -Default is @code{t}. - -@end table - - -@node Viewing Files -@subsection Viewing Files -@cindex viewing files -@cindex pseudo-articles - -After decoding, if the file is some sort of archive, Gnus will attempt -to unpack the archive and see if any of the files in the archive can be -viewed. For instance, if you have a gzipped tar file @file{pics.tar.gz} -containing the files @file{pic1.jpg} and @file{pic2.gif}, Gnus will -uncompress and de-tar the main file, and then view the two pictures. -This unpacking process is recursive, so if the archive contains archives -of archives, it'll all be unpacked. - -Finally, Gnus will normally insert a @dfn{pseudo-article} for each -extracted file into the summary buffer. If you go to these -``articles'', you will be prompted for a command to run (usually Gnus -will make a suggestion), and then the command will be run. - -@vindex gnus-view-pseudo-asynchronously -If @code{gnus-view-pseudo-asynchronously} is @code{nil}, Emacs will wait -until the viewing is done before proceeding. - -@vindex gnus-view-pseudos -If @code{gnus-view-pseudos} is @code{automatic}, Gnus will not insert -the pseudo-articles into the summary buffer, but view them -immediately. If this variable is @code{not-confirm}, the user won't even -be asked for a confirmation before viewing is done. - -@vindex gnus-view-pseudos-separately -If @code{gnus-view-pseudos-separately} is non-@code{nil}, one -pseudo-article will be created for each file to be viewed. If -@code{nil}, all files that use the same viewing command will be given as -a list of parameters to that command. - -@vindex gnus-insert-pseudo-articles -If @code{gnus-insert-pseudo-articles} is non-@code{nil}, insert -pseudo-articles when decoding. It is @code{t} by default. - -So; there you are, reading your @emph{pseudo-articles} in your -@emph{virtual newsgroup} from the @emph{virtual server}; and you think: -Why isn't anything real anymore? How did we get here? - - -@node Article Treatment -@section Article Treatment - -Reading through this huge manual, you may have quite forgotten that the -object of newsreaders is to actually, like, read what people have -written. Reading articles. Unfortunately, people are quite bad at -writing, so there are tons of functions and variables to make reading -these articles easier. - -@menu -* Article Highlighting:: You want to make the article look like fruit salad. -* Article Fontisizing:: Making emphasized text look nice. -* Article Hiding:: You also want to make certain info go away. -* Article Washing:: Lots of way-neat functions to make life better. -* Article Header:: Doing various header transformations. -* Article Buttons:: Click on URLs, Message-IDs, addresses and the like. -* Article Button Levels:: Controlling appearance of buttons. -* Article Date:: Grumble, UT! -* Article Display:: Display various stuff---X-Face, Picons, Smileys -* Article Signature:: What is a signature? -* Article Miscellanea:: Various other stuff. -@end menu - - -@node Article Highlighting -@subsection Article Highlighting -@cindex highlighting - -Not only do you want your article buffer to look like fruit salad, but -you want it to look like technicolor fruit salad. - -@table @kbd - -@item W H a -@kindex W H a (Summary) -@findex gnus-article-highlight -@findex gnus-article-maybe-highlight -Do much highlighting of the current article -(@code{gnus-article-highlight}). This function highlights header, cited -text, the signature, and adds buttons to the body and the head. - -@item W H h -@kindex W H h (Summary) -@findex gnus-article-highlight-headers -@vindex gnus-header-face-alist -Highlight the headers (@code{gnus-article-highlight-headers}). The -highlighting will be done according to the @code{gnus-header-face-alist} -variable, which is a list where each element has the form -@code{(@var{regexp} @var{name} @var{content})}. -@var{regexp} is a regular expression for matching the -header, @var{name} is the face used for highlighting the header name -(@pxref{Faces and Fonts}) and @var{content} is the face for highlighting -the header value. The first match made will be used. Note that -@var{regexp} shouldn't have @samp{^} prepended---Gnus will add one. - -@item W H c -@kindex W H c (Summary) -@findex gnus-article-highlight-citation -Highlight cited text (@code{gnus-article-highlight-citation}). - -Some variables to customize the citation highlights: - -@table @code -@vindex gnus-cite-parse-max-size - -@item gnus-cite-parse-max-size -If the article size in bytes is bigger than this variable (which is -25000 by default), no citation highlighting will be performed. - -@item gnus-cite-max-prefix -@vindex gnus-cite-max-prefix -Maximum possible length for a citation prefix (default 20). - -@item gnus-cite-face-list -@vindex gnus-cite-face-list -List of faces used for highlighting citations (@pxref{Faces and Fonts}). -When there are citations from multiple articles in the same message, -Gnus will try to give each citation from each article its own face. -This should make it easier to see who wrote what. - -@item gnus-supercite-regexp -@vindex gnus-supercite-regexp -Regexp matching normal Supercite attribution lines. - -@item gnus-supercite-secondary-regexp -@vindex gnus-supercite-secondary-regexp -Regexp matching mangled Supercite attribution lines. - -@item gnus-cite-minimum-match-count -@vindex gnus-cite-minimum-match-count -Minimum number of identical prefixes we have to see before we believe -that it's a citation. - -@item gnus-cite-attribution-prefix -@vindex gnus-cite-attribution-prefix -Regexp matching the beginning of an attribution line. - -@item gnus-cite-attribution-suffix -@vindex gnus-cite-attribution-suffix -Regexp matching the end of an attribution line. - -@item gnus-cite-attribution-face -@vindex gnus-cite-attribution-face -Face used for attribution lines. It is merged with the face for the -cited text belonging to the attribution. - -@item gnus-cite-ignore-quoted-from -@vindex gnus-cite-ignore-quoted-from -If non-@code{nil}, no citation highlighting will be performed on lines -beginning with @samp{>From }. Those lines may have been quoted by MTAs -in order not to mix up with the envelope From line. The default value -is @code{t}. - -@end table - - -@item W H s -@kindex W H s (Summary) -@vindex gnus-signature-separator -@vindex gnus-signature-face -@findex gnus-article-highlight-signature -Highlight the signature (@code{gnus-article-highlight-signature}). -Everything after @code{gnus-signature-separator} (@pxref{Article -Signature}) in an article will be considered a signature and will be -highlighted with @code{gnus-signature-face}, which is @code{italic} by -default. - -@end table - -@xref{Customizing Articles}, for how to highlight articles automatically. - - -@node Article Fontisizing -@subsection Article Fontisizing -@cindex emphasis -@cindex article emphasis - -@findex gnus-article-emphasize -@kindex W e (Summary) -People commonly add emphasis to words in news articles by writing things -like @samp{_this_} or @samp{*this*} or @samp{/this/}. Gnus can make -this look nicer by running the article through the @kbd{W e} -(@code{gnus-article-emphasize}) command. - -@vindex gnus-emphasis-alist -How the emphasis is computed is controlled by the -@code{gnus-emphasis-alist} variable. This is an alist where the first -element is a regular expression to be matched. The second is a number -that says what regular expression grouping is used to find the entire -emphasized word. The third is a number that says what regexp grouping -should be displayed and highlighted. (The text between these two -groupings will be hidden.) The fourth is the face used for -highlighting. - -@lisp -(setq gnus-emphasis-alist - '(("_\\(\\w+\\)_" 0 1 gnus-emphasis-underline) - ("\\*\\(\\w+\\)\\*" 0 1 gnus-emphasis-bold))) -@end lisp - -@cindex slash -@cindex asterisk -@cindex underline -@cindex / -@cindex * - -@vindex gnus-emphasis-underline -@vindex gnus-emphasis-bold -@vindex gnus-emphasis-italic -@vindex gnus-emphasis-underline-bold -@vindex gnus-emphasis-underline-italic -@vindex gnus-emphasis-bold-italic -@vindex gnus-emphasis-underline-bold-italic -By default, there are seven rules, and they use the following faces: -@code{gnus-emphasis-bold}, @code{gnus-emphasis-italic}, -@code{gnus-emphasis-underline}, @code{gnus-emphasis-bold-italic}, -@code{gnus-emphasis-underline-italic}, -@code{gnus-emphasis-underline-bold}, and -@code{gnus-emphasis-underline-bold-italic}. - -If you want to change these faces, you can either use @kbd{M-x -customize}, or you can use @code{copy-face}. For instance, if you want -to make @code{gnus-emphasis-italic} use a red face instead, you could -say something like: - -@lisp -(copy-face 'red 'gnus-emphasis-italic) -@end lisp - -@vindex gnus-group-highlight-words-alist - -If you want to highlight arbitrary words, you can use the -@code{gnus-group-highlight-words-alist} variable, which uses the same -syntax as @code{gnus-emphasis-alist}. The @code{highlight-words} group -parameter (@pxref{Group Parameters}) can also be used. - -@xref{Customizing Articles}, for how to fontize articles automatically. - - -@node Article Hiding -@subsection Article Hiding -@cindex article hiding - -Or rather, hiding certain things in each article. There usually is much -too much cruft in most articles. - -@table @kbd - -@item W W a -@kindex W W a (Summary) -@findex gnus-article-hide -Do quite a lot of hiding on the article buffer -(@kbd{gnus-article-hide}). In particular, this function will hide -headers, @acronym{PGP}, cited text and the signature. - -@item W W h -@kindex W W h (Summary) -@findex gnus-article-hide-headers -Hide headers (@code{gnus-article-hide-headers}). @xref{Hiding -Headers}. - -@item W W b -@kindex W W b (Summary) -@findex gnus-article-hide-boring-headers -Hide headers that aren't particularly interesting -(@code{gnus-article-hide-boring-headers}). @xref{Hiding Headers}. - -@item W W s -@kindex W W s (Summary) -@findex gnus-article-hide-signature -Hide signature (@code{gnus-article-hide-signature}). @xref{Article -Signature}. - -@item W W l -@kindex W W l (Summary) -@findex gnus-article-hide-list-identifiers -@vindex gnus-list-identifiers -Strip list identifiers specified in @code{gnus-list-identifiers}. These -are strings some mailing list servers add to the beginning of all -@code{Subject} headers---for example, @samp{[zebra 4711]}. Any leading -@samp{Re: } is skipped before stripping. @code{gnus-list-identifiers} -may not contain @code{\\(..\\)}. - -@table @code - -@item gnus-list-identifiers -@vindex gnus-list-identifiers -A regular expression that matches list identifiers to be removed from -subject. This can also be a list of regular expressions. - -@end table - -@item W W P -@kindex W W P (Summary) -@findex gnus-article-hide-pem -Hide @acronym{PEM} (privacy enhanced messages) cruft -(@code{gnus-article-hide-pem}). - -@item W W B -@kindex W W B (Summary) -@findex gnus-article-strip-banner -@vindex gnus-article-banner-alist -@vindex gnus-article-address-banner-alist -@cindex banner -@cindex OneList -@cindex stripping advertisements -@cindex advertisements -Strip the banner specified by the @code{banner} group parameter -(@code{gnus-article-strip-banner}). This is mainly used to hide those -annoying banners and/or signatures that some mailing lists and moderated -groups adds to all the messages. The way to use this function is to add -the @code{banner} group parameter (@pxref{Group Parameters}) to the -group you want banners stripped from. The parameter either be a string, -which will be interpreted as a regular expression matching text to be -removed, or the symbol @code{signature}, meaning that the (last) -signature should be removed, or other symbol, meaning that the -corresponding regular expression in @code{gnus-article-banner-alist} is -used. - -Regardless of a group, you can hide things like advertisements only when -the sender of an article has a certain mail address specified in -@code{gnus-article-address-banner-alist}. - -@table @code - -@item gnus-article-address-banner-alist -@vindex gnus-article-address-banner-alist -Alist of mail addresses and banners. Each element has the form -@code{(@var{address} . @var{banner})}, where @var{address} is a regexp -matching a mail address in the From header, @var{banner} is one of a -symbol @code{signature}, an item in @code{gnus-article-banner-alist}, -a regexp and @code{nil}. If @var{address} matches author's mail -address, it will remove things like advertisements. For example, if a -sender has the mail address @samp{hail@@yoo-hoo.co.jp} and there is a -banner something like @samp{Do You Yoo-hoo!?} in all articles he -sends, you can use the following element to remove them: - -@lisp -("@@yoo-hoo\\.co\\.jp\\'" . - "\n_+\nDo You Yoo-hoo!\\?\n.*\n.*\n") -@end lisp - -@end table - -@item W W c -@kindex W W c (Summary) -@findex gnus-article-hide-citation -Hide citation (@code{gnus-article-hide-citation}). Some variables for -customizing the hiding: - -@table @code - -@item gnus-cited-opened-text-button-line-format -@itemx gnus-cited-closed-text-button-line-format -@vindex gnus-cited-closed-text-button-line-format -@vindex gnus-cited-opened-text-button-line-format -Gnus adds buttons to show where the cited text has been hidden, and to -allow toggle hiding the text. The format of the variable is specified -by these format-like variable (@pxref{Formatting Variables}). These -specs are valid: - -@table @samp -@item b -Starting point of the hidden text. -@item e -Ending point of the hidden text. -@item l -Number of characters in the hidden region. -@item n -Number of lines of hidden text. -@end table - -@item gnus-cited-lines-visible -@vindex gnus-cited-lines-visible -The number of lines at the beginning of the cited text to leave -shown. This can also be a cons cell with the number of lines at the top -and bottom of the text, respectively, to remain visible. - -@end table - -@item W W C-c -@kindex W W C-c (Summary) -@findex gnus-article-hide-citation-maybe - -Hide citation (@code{gnus-article-hide-citation-maybe}) depending on the -following two variables: - -@table @code -@item gnus-cite-hide-percentage -@vindex gnus-cite-hide-percentage -If the cited text is of a bigger percentage than this variable (default -50), hide the cited text. - -@item gnus-cite-hide-absolute -@vindex gnus-cite-hide-absolute -The cited text must have at least this length (default 10) before it -is hidden. -@end table - -@item W W C -@kindex W W C (Summary) -@findex gnus-article-hide-citation-in-followups -Hide cited text in articles that aren't roots -(@code{gnus-article-hide-citation-in-followups}). This isn't very -useful as an interactive command, but might be a handy function to stick -have happen automatically (@pxref{Customizing Articles}). - -@end table - -All these ``hiding'' commands are toggles, but if you give a negative -prefix to these commands, they will show what they have previously -hidden. If you give a positive prefix, they will always hide. - -Also @pxref{Article Highlighting} for further variables for -citation customization. - -@xref{Customizing Articles}, for how to hide article elements -automatically. - - -@node Article Washing -@subsection Article Washing -@cindex washing -@cindex article washing - -We call this ``article washing'' for a really good reason. Namely, the -@kbd{A} key was taken, so we had to use the @kbd{W} key instead. - -@dfn{Washing} is defined by us as ``changing something from something to -something else'', but normally results in something looking better. -Cleaner, perhaps. - -@xref{Customizing Articles}, if you want to change how Gnus displays -articles by default. - -@table @kbd - -@item C-u g -This is not really washing, it's sort of the opposite of washing. If -you type this, you see the article exactly as it exists on disk or on -the server. - -@item g -Force redisplaying of the current article -(@code{gnus-summary-show-article}). This is also not really washing. -If you type this, you see the article without any previously applied -interactive Washing functions but with all default treatments -(@pxref{Customizing Articles}). - -@item W l -@kindex W l (Summary) -@findex gnus-summary-stop-page-breaking -Remove page breaks from the current article -(@code{gnus-summary-stop-page-breaking}). @xref{Misc Article}, for page -delimiters. - -@item W r -@kindex W r (Summary) -@findex gnus-summary-caesar-message -@c @icon{gnus-summary-caesar-message} -Do a Caesar rotate (rot13) on the article buffer -(@code{gnus-summary-caesar-message}). -Unreadable articles that tell you to read them with Caesar rotate or rot13. -(Typically offensive jokes and such.) - -It's commonly called ``rot13'' because each letter is rotated 13 -positions in the alphabet, e. g. @samp{B} (letter #2) -> @samp{O} (letter -#15). It is sometimes referred to as ``Caesar rotate'' because Caesar -is rumored to have employed this form of, uh, somewhat weak encryption. - -@item W m -@kindex W m (Summary) -@findex gnus-summary-morse-message -Morse decode the article buffer (@code{gnus-summary-morse-message}). - -@item W t -@item t -@kindex W t (Summary) -@kindex t (Summary) -@findex gnus-summary-toggle-header -Toggle whether to display all headers in the article buffer -(@code{gnus-summary-toggle-header}). - -@item W v -@kindex W v (Summary) -@findex gnus-summary-verbose-headers -Toggle whether to display all headers in the article buffer permanently -(@code{gnus-summary-verbose-headers}). - -@item W o -@kindex W o (Summary) -@findex gnus-article-treat-overstrike -Treat overstrike (@code{gnus-article-treat-overstrike}). - -@item W d -@kindex W d (Summary) -@findex gnus-article-treat-dumbquotes -@vindex gnus-article-dumbquotes-map -@cindex Smartquotes -@cindex M****s*** sm*rtq**t*s -@cindex Latin 1 -Treat M****s*** sm*rtq**t*s according to -@code{gnus-article-dumbquotes-map} -(@code{gnus-article-treat-dumbquotes}). Note that this function guesses -whether a character is a sm*rtq**t* or not, so it should only be used -interactively. - -Sm*rtq**t*s are M****s***'s unilateral extension to the character map in -an attempt to provide more quoting characters. If you see something -like @code{\222} or @code{\264} where you're expecting some kind of -apostrophe or quotation mark, then try this wash. - -@item W Y f -@kindex W Y f (Summary) -@findex gnus-article-outlook-deuglify-article -@cindex Outlook Express -Full deuglify of broken Outlook (Express) articles: Treat dumbquotes, -unwrap lines, repair attribution and rearrange citation. -(@code{gnus-article-outlook-deuglify-article}). - -@item W Y u -@kindex W Y u (Summary) -@findex gnus-article-outlook-unwrap-lines -@vindex gnus-outlook-deuglify-unwrap-min -@vindex gnus-outlook-deuglify-unwrap-max -Unwrap lines that appear to be wrapped citation lines. You can control -what lines will be unwrapped by frobbing -@code{gnus-outlook-deuglify-unwrap-min} and -@code{gnus-outlook-deuglify-unwrap-max}, indicating the minimum and -maximum length of an unwrapped citation line. -(@code{gnus-article-outlook-unwrap-lines}). - -@item W Y a -@kindex W Y a (Summary) -@findex gnus-article-outlook-repair-attribution -Repair a broken attribution line.@* -(@code{gnus-article-outlook-repair-attribution}). - -@item W Y c -@kindex W Y c (Summary) -@findex gnus-article-outlook-rearrange-citation -Repair broken citations by rearranging the text. -(@code{gnus-article-outlook-rearrange-citation}). - -@item W w -@kindex W w (Summary) -@findex gnus-article-fill-cited-article -Do word wrap (@code{gnus-article-fill-cited-article}). - -You can give the command a numerical prefix to specify the width to use -when filling. - -@item W Q -@kindex W Q (Summary) -@findex gnus-article-fill-long-lines -Fill long lines (@code{gnus-article-fill-long-lines}). - -@item W C -@kindex W C (Summary) -@findex gnus-article-capitalize-sentences -Capitalize the first word in each sentence -(@code{gnus-article-capitalize-sentences}). - -@item W c -@kindex W c (Summary) -@findex gnus-article-remove-cr -Translate CRLF pairs (i. e., @samp{^M}s on the end of the lines) into LF -(this takes care of DOS line endings), and then translate any remaining -CRs into LF (this takes care of Mac line endings) -(@code{gnus-article-remove-cr}). - -@item W q -@kindex W q (Summary) -@findex gnus-article-de-quoted-unreadable -Treat quoted-printable (@code{gnus-article-de-quoted-unreadable}). -Quoted-Printable is one common @acronym{MIME} encoding employed when -sending non-@acronym{ASCII} (i.e., 8-bit) articles. It typically -makes strings like @samp{déjà vu} look like @samp{d=E9j=E0 vu}, which -doesn't look very readable to me. Note that this is usually done -automatically by Gnus if the message in question has a -@code{Content-Transfer-Encoding} header that says that this encoding -has been done. If a prefix is given, a charset will be asked for. - -@item W 6 -@kindex W 6 (Summary) -@findex gnus-article-de-base64-unreadable -Treat base64 (@code{gnus-article-de-base64-unreadable}). Base64 is -one common @acronym{MIME} encoding employed when sending -non-@acronym{ASCII} (i.e., 8-bit) articles. Note that this is -usually done automatically by Gnus if the message in question has a -@code{Content-Transfer-Encoding} header that says that this encoding -has been done. If a prefix is given, a charset will be asked for. - -@item W Z -@kindex W Z (Summary) -@findex gnus-article-decode-HZ -Treat HZ or HZP (@code{gnus-article-decode-HZ}). HZ (or HZP) is one -common encoding employed when sending Chinese articles. It typically -makes strings look like @samp{~@{<:Ky2;S@{#,NpJ)l6HK!#~@}}. - -@item W u -@kindex W u (Summary) -@findex gnus-article-unsplit-urls -Remove newlines from within URLs. Some mailers insert newlines into -outgoing email messages to keep lines short. This reformatting can -split long URLs onto multiple lines. Repair those URLs by removing -the newlines (@code{gnus-article-unsplit-urls}). - -@item W h -@kindex W h (Summary) -@findex gnus-article-wash-html -Treat @acronym{HTML} (@code{gnus-article-wash-html}). Note that this is -usually done automatically by Gnus if the message in question has a -@code{Content-Type} header that says that the message is @acronym{HTML}. - -If a prefix is given, a charset will be asked for. If it is a number, -the charset defined in @code{gnus-summary-show-article-charset-alist} -(@pxref{Paging the Article}) will be used. - -@vindex gnus-article-wash-function -The default is to use the function specified by -@code{mm-text-html-renderer} (@pxref{Display Customization, ,Display -Customization, emacs-mime, The Emacs MIME Manual}) to convert the -@acronym{HTML}, but this is controlled by the -@code{gnus-article-wash-function} variable. Pre-defined functions you -can use include: - -@table @code -@item w3 -Use Emacs/W3. - -@item w3m -Use @uref{http://emacs-w3m.namazu.org/, emacs-w3m}. - -@item w3m-standalone -Use @uref{http://w3m.sourceforge.net/, w3m}. - -@item links -Use @uref{http://links.sf.net/, Links}. - -@item lynx -Use @uref{http://lynx.isc.org/, Lynx}. - -@item html2text -Use html2text---a simple @acronym{HTML} converter included with Gnus. - -@end table - -@item W b -@kindex W b (Summary) -@findex gnus-article-add-buttons -Add clickable buttons to the article (@code{gnus-article-add-buttons}). -@xref{Article Buttons}. - -@item W B -@kindex W B (Summary) -@findex gnus-article-add-buttons-to-head -Add clickable buttons to the article headers -(@code{gnus-article-add-buttons-to-head}). - -@item W p -@kindex W p (Summary) -@findex gnus-article-verify-x-pgp-sig -Verify a signed control message -(@code{gnus-article-verify-x-pgp-sig}). Control messages such as -@code{newgroup} and @code{checkgroups} are usually signed by the -hierarchy maintainer. You need to add the @acronym{PGP} public key of -the maintainer to your keyring to verify the -message.@footnote{@acronym{PGP} keys for many hierarchies are -available at @uref{ftp://ftp.isc.org/pub/pgpcontrol/README.html}} - -@item W s -@kindex W s (Summary) -@findex gnus-summary-force-verify-and-decrypt -Verify a signed (@acronym{PGP}, @acronym{PGP/MIME} or -@acronym{S/MIME}) message -(@code{gnus-summary-force-verify-and-decrypt}). @xref{Security}. - -@item W a -@kindex W a (Summary) -@findex gnus-article-strip-headers-in-body -Strip headers like the @code{X-No-Archive} header from the beginning of -article bodies (@code{gnus-article-strip-headers-in-body}). - -@item W E l -@kindex W E l (Summary) -@findex gnus-article-strip-leading-blank-lines -Remove all blank lines from the beginning of the article -(@code{gnus-article-strip-leading-blank-lines}). - -@item W E m -@kindex W E m (Summary) -@findex gnus-article-strip-multiple-blank-lines -Replace all blank lines with empty lines and then all multiple empty -lines with a single empty line. -(@code{gnus-article-strip-multiple-blank-lines}). - -@item W E t -@kindex W E t (Summary) -@findex gnus-article-remove-trailing-blank-lines -Remove all blank lines at the end of the article -(@code{gnus-article-remove-trailing-blank-lines}). - -@item W E a -@kindex W E a (Summary) -@findex gnus-article-strip-blank-lines -Do all the three commands above -(@code{gnus-article-strip-blank-lines}). - -@item W E A -@kindex W E A (Summary) -@findex gnus-article-strip-all-blank-lines -Remove all blank lines -(@code{gnus-article-strip-all-blank-lines}). - -@item W E s -@kindex W E s (Summary) -@findex gnus-article-strip-leading-space -Remove all white space from the beginning of all lines of the article -body (@code{gnus-article-strip-leading-space}). - -@item W E e -@kindex W E e (Summary) -@findex gnus-article-strip-trailing-space -Remove all white space from the end of all lines of the article -body (@code{gnus-article-strip-trailing-space}). - -@end table - -@xref{Customizing Articles}, for how to wash articles automatically. - - -@node Article Header -@subsection Article Header - -These commands perform various transformations of article header. - -@table @kbd - -@item W G u -@kindex W G u (Summary) -@findex gnus-article-treat-unfold-headers -Unfold folded header lines (@code{gnus-article-treat-unfold-headers}). - -@item W G n -@kindex W G n (Summary) -@findex gnus-article-treat-fold-newsgroups -Fold the @code{Newsgroups} and @code{Followup-To} headers -(@code{gnus-article-treat-fold-newsgroups}). - -@item W G f -@kindex W G f (Summary) -@findex gnus-article-treat-fold-headers -Fold all the message headers -(@code{gnus-article-treat-fold-headers}). - -@item W E w -@kindex W E w (Summary) -@findex gnus-article-remove-leading-whitespace -Remove excessive whitespace from all headers -(@code{gnus-article-remove-leading-whitespace}). - -@end table - - -@node Article Buttons -@subsection Article Buttons -@cindex buttons - -People often include references to other stuff in articles, and it would -be nice if Gnus could just fetch whatever it is that people talk about -with the minimum of fuzz when you hit @kbd{RET} or use the middle mouse -button on these references. - -@vindex gnus-button-man-handler -Gnus adds @dfn{buttons} to certain standard references by default: -Well-formed URLs, mail addresses, Message-IDs, Info links, man pages and -Emacs or Gnus related references. This is controlled by two variables, -one that handles article bodies and one that handles article heads: - -@table @code - -@item gnus-button-alist -@vindex gnus-button-alist -This is an alist where each entry has this form: - -@lisp -(@var{regexp} @var{button-par} @var{use-p} @var{function} @var{data-par}) -@end lisp - -@table @var - -@item regexp -All text that match this regular expression (case insensitive) will be -considered an external reference. Here's a typical regexp that matches -embedded URLs: @samp{<URL:\\([^\n\r>]*\\)>}. This can also be a -variable containing a regexp, useful variables to use include -@code{gnus-button-url-regexp} and @code{gnus-button-mid-or-mail-regexp}. - -@item button-par -Gnus has to know which parts of the matches is to be highlighted. This -is a number that says what sub-expression of the regexp is to be -highlighted. If you want it all highlighted, you use 0 here. - -@item use-p -This form will be @code{eval}ed, and if the result is non-@code{nil}, -this is considered a match. This is useful if you want extra sifting to -avoid false matches. Often variables named -@code{gnus-button-@var{*}-level} are used here, @xref{Article Button -Levels}, but any other form may be used too. - -@c @code{use-p} is @code{eval}ed only if @code{regexp} matches. - -@item function -This function will be called when you click on this button. - -@item data-par -As with @var{button-par}, this is a sub-expression number, but this one -says which part of the match is to be sent as data to @var{function}. - -@end table - -So the full entry for buttonizing URLs is then - -@lisp -("<URL:\\([^\n\r>]*\\)>" 0 t gnus-button-url 1) -@end lisp - -@item gnus-header-button-alist -@vindex gnus-header-button-alist -This is just like the other alist, except that it is applied to the -article head only, and that each entry has an additional element that is -used to say what headers to apply the buttonize coding to: - -@lisp -(@var{header} @var{regexp} @var{button-par} @var{use-p} @var{function} @var{data-par}) -@end lisp - -@var{header} is a regular expression. -@end table - -@subsubsection Related variables and functions - -@table @code -@item gnus-button-@var{*}-level -@xref{Article Button Levels}. - -@c Stuff related to gnus-button-browse-level - -@item gnus-button-url-regexp -@vindex gnus-button-url-regexp -A regular expression that matches embedded URLs. It is used in the -default values of the variables above. - -@c Stuff related to gnus-button-man-level - -@item gnus-button-man-handler -@vindex gnus-button-man-handler -The function to use for displaying man pages. It must take at least one -argument with a string naming the man page. - -@c Stuff related to gnus-button-message-level - -@item gnus-button-mid-or-mail-regexp -@vindex gnus-button-mid-or-mail-regexp -Regular expression that matches a message ID or a mail address. - -@item gnus-button-prefer-mid-or-mail -@vindex gnus-button-prefer-mid-or-mail -This variable determines what to do when the button on a string as -@samp{foo123@@bar.invalid} is pushed. Strings like this can be either a -message ID or a mail address. If it is one of the symbols @code{mid} or -@code{mail}, Gnus will always assume that the string is a message ID or -a mail address, respectively. If this variable is set to the symbol -@code{ask}, always query the user what to do. If it is a function, this -function will be called with the string as its only argument. The -function must return @code{mid}, @code{mail}, @code{invalid} or -@code{ask}. The default value is the function -@code{gnus-button-mid-or-mail-heuristic}. - -@item gnus-button-mid-or-mail-heuristic -@findex gnus-button-mid-or-mail-heuristic -Function that guesses whether its argument is a message ID or a mail -address. Returns @code{mid} if it's a message IDs, @code{mail} if -it's a mail address, @code{ask} if unsure and @code{invalid} if the -string is invalid. - -@item gnus-button-mid-or-mail-heuristic-alist -@vindex gnus-button-mid-or-mail-heuristic-alist -An alist of @code{(RATE . REGEXP)} pairs used by the function -@code{gnus-button-mid-or-mail-heuristic}. - -@c Stuff related to gnus-button-tex-level - -@item gnus-button-ctan-handler -@findex gnus-button-ctan-handler -The function to use for displaying CTAN links. It must take one -argument, the string naming the URL. - -@item gnus-ctan-url -@vindex gnus-ctan-url -Top directory of a CTAN (Comprehensive TeX Archive Network) archive used -by @code{gnus-button-ctan-handler}. - -@c Misc stuff - -@item gnus-article-button-face -@vindex gnus-article-button-face -Face used on buttons. - -@item gnus-article-mouse-face -@vindex gnus-article-mouse-face -Face used when the mouse cursor is over a button. - -@end table - -@xref{Customizing Articles}, for how to buttonize articles automatically. - - -@node Article Button Levels -@subsection Article button levels -@cindex button levels -The higher the value of the variables @code{gnus-button-@var{*}-level}, -the more buttons will appear. If the level is zero, no corresponding -buttons are displayed. With the default value (which is 5) you should -already see quite a lot of buttons. With higher levels, you will see -more buttons, but you may also get more false positives. To avoid them, -you can set the variables @code{gnus-button-@var{*}-level} local to -specific groups (@pxref{Group Parameters}). Here's an example for the -variable @code{gnus-parameters}: - -@lisp -;; @r{increase @code{gnus-button-*-level} in some groups:} -(setq gnus-parameters - '(("\\<\\(emacs\\|gnus\\)\\>" (gnus-button-emacs-level 10)) - ("\\<unix\\>" (gnus-button-man-level 10)) - ("\\<tex\\>" (gnus-button-tex-level 10)))) -@end lisp - -@table @code - -@item gnus-button-browse-level -@vindex gnus-button-browse-level -Controls the display of references to message IDs, mail addresses and -news URLs. Related variables and functions include -@code{gnus-button-url-regexp}, @code{browse-url}, and -@code{browse-url-browser-function}. - -@item gnus-button-emacs-level -@vindex gnus-button-emacs-level -Controls the display of Emacs or Gnus references. Related functions are -@code{gnus-button-handle-custom}, -@code{gnus-button-handle-describe-function}, -@code{gnus-button-handle-describe-variable}, -@code{gnus-button-handle-symbol}, -@code{gnus-button-handle-describe-key}, -@code{gnus-button-handle-apropos}, -@code{gnus-button-handle-apropos-command}, -@code{gnus-button-handle-apropos-variable}, -@code{gnus-button-handle-apropos-documentation}, and -@code{gnus-button-handle-library}. - -@item gnus-button-man-level -@vindex gnus-button-man-level -Controls the display of references to (Unix) man pages. -See @code{gnus-button-man-handler}. - -@item gnus-button-message-level -@vindex gnus-button-message-level -Controls the display of message IDs, mail addresses and news URLs. -Related variables and functions include -@code{gnus-button-mid-or-mail-regexp}, -@code{gnus-button-prefer-mid-or-mail}, -@code{gnus-button-mid-or-mail-heuristic}, and -@code{gnus-button-mid-or-mail-heuristic-alist}. - -@item gnus-button-tex-level -@vindex gnus-button-tex-level -Controls the display of references to @TeX{} or LaTeX stuff, e.g. for CTAN -URLs. See the variables @code{gnus-ctan-url}, -@code{gnus-button-ctan-handler}, -@code{gnus-button-ctan-directory-regexp}, and -@code{gnus-button-handle-ctan-bogus-regexp}. - -@end table - - -@node Article Date -@subsection Article Date - -The date is most likely generated in some obscure timezone you've never -heard of, so it's quite nice to be able to find out what the time was -when the article was sent. - -@table @kbd - -@item W T u -@kindex W T u (Summary) -@findex gnus-article-date-ut -Display the date in UT (aka. GMT, aka ZULU) -(@code{gnus-article-date-ut}). - -@item W T i -@kindex W T i (Summary) -@findex gnus-article-date-iso8601 -@cindex ISO 8601 -Display the date in international format, aka. ISO 8601 -(@code{gnus-article-date-iso8601}). - -@item W T l -@kindex W T l (Summary) -@findex gnus-article-date-local -Display the date in the local timezone (@code{gnus-article-date-local}). - -@item W T p -@kindex W T p (Summary) -@findex gnus-article-date-english -Display the date in a format that's easily pronounceable in English -(@code{gnus-article-date-english}). - -@item W T s -@kindex W T s (Summary) -@vindex gnus-article-time-format -@findex gnus-article-date-user -@findex format-time-string -Display the date using a user-defined format -(@code{gnus-article-date-user}). The format is specified by the -@code{gnus-article-time-format} variable, and is a string that's passed -to @code{format-time-string}. See the documentation of that variable -for a list of possible format specs. - -@item W T e -@kindex W T e (Summary) -@findex gnus-article-date-lapsed -@findex gnus-start-date-timer -@findex gnus-stop-date-timer -Say how much time has elapsed between the article was posted and now -(@code{gnus-article-date-lapsed}). It looks something like: - -@example -X-Sent: 6 weeks, 4 days, 1 hour, 3 minutes, 8 seconds ago -@end example - -@vindex gnus-article-date-lapsed-new-header -The value of @code{gnus-article-date-lapsed-new-header} determines -whether this header will just be added below the old Date one, or will -replace it. - -An advantage of using Gnus to read mail is that it converts simple bugs -into wonderful absurdities. - -If you want to have this line updated continually, you can put - -@lisp -(gnus-start-date-timer) -@end lisp - -in your @file{~/.gnus.el} file, or you can run it off of some hook. If -you want to stop the timer, you can use the @code{gnus-stop-date-timer} -command. - -@item W T o -@kindex W T o (Summary) -@findex gnus-article-date-original -Display the original date (@code{gnus-article-date-original}). This can -be useful if you normally use some other conversion function and are -worried that it might be doing something totally wrong. Say, claiming -that the article was posted in 1854. Although something like that is -@emph{totally} impossible. Don't you trust me? *titter* - -@end table - -@xref{Customizing Articles}, for how to display the date in your -preferred format automatically. - - -@node Article Display -@subsection Article Display -@cindex picons -@cindex x-face -@cindex smileys - -These commands add various frivolous display gimmicks to the article -buffer in Emacs versions that support them. - -@code{X-Face} headers are small black-and-white images supplied by the -message headers (@pxref{X-Face}). - -@code{Face} headers are small colored images supplied by the message -headers (@pxref{Face}). - -Smileys are those little @samp{:-)} symbols that people like to litter -their messages with (@pxref{Smileys}). - -Picons, on the other hand, reside on your own system, and Gnus will -try to match the headers to what you have (@pxref{Picons}). - -All these functions are toggles---if the elements already exist, -they'll be removed. - -@table @kbd -@item W D x -@kindex W D x (Summary) -@findex gnus-article-display-x-face -Display an @code{X-Face} in the @code{From} header. -(@code{gnus-article-display-x-face}). - -@item W D d -@kindex W D d (Summary) -@findex gnus-article-display-face -Display a @code{Face} in the @code{From} header. -(@code{gnus-article-display-face}). - -@item W D s -@kindex W D s (Summary) -@findex gnus-treat-smiley -Display smileys (@code{gnus-treat-smiley}). - -@item W D f -@kindex W D f (Summary) -@findex gnus-treat-from-picon -Piconify the @code{From} header (@code{gnus-treat-from-picon}). - -@item W D m -@kindex W D m (Summary) -@findex gnus-treat-mail-picon -Piconify all mail headers (i. e., @code{Cc}, @code{To}) -(@code{gnus-treat-mail-picon}). - -@item W D n -@kindex W D n (Summary) -@findex gnus-treat-newsgroups-picon -Piconify all news headers (i. e., @code{Newsgroups} and -@code{Followup-To}) (@code{gnus-treat-newsgroups-picon}). - -@item W D D -@kindex W D D (Summary) -@findex gnus-article-remove-images -Remove all images from the article buffer -(@code{gnus-article-remove-images}). - -@end table - - - -@node Article Signature -@subsection Article Signature -@cindex signatures -@cindex article signature - -@vindex gnus-signature-separator -Each article is divided into two parts---the head and the body. The -body can be divided into a signature part and a text part. The variable -that says what is to be considered a signature is -@code{gnus-signature-separator}. This is normally the standard -@samp{^-- $} as mandated by son-of-RFC 1036. However, many people use -non-standard signature separators, so this variable can also be a list -of regular expressions to be tested, one by one. (Searches are done -from the end of the body towards the beginning.) One likely value is: - -@lisp -(setq gnus-signature-separator - '("^-- $" ; @r{The standard} - "^-- *$" ; @r{A common mangling} - "^-------*$" ; @r{Many people just use a looong} - ; @r{line of dashes. Shame!} - "^ *--------*$" ; @r{Double-shame!} - "^________*$" ; @r{Underscores are also popular} - "^========*$")) ; @r{Pervert!} -@end lisp - -The more permissive you are, the more likely it is that you'll get false -positives. - -@vindex gnus-signature-limit -@code{gnus-signature-limit} provides a limit to what is considered a -signature when displaying articles. - -@enumerate -@item -If it is an integer, no signature may be longer (in characters) than -that integer. -@item -If it is a floating point number, no signature may be longer (in lines) -than that number. -@item -If it is a function, the function will be called without any parameters, -and if it returns @code{nil}, there is no signature in the buffer. -@item -If it is a string, it will be used as a regexp. If it matches, the text -in question is not a signature. -@end enumerate - -This variable can also be a list where the elements may be of the types -listed above. Here's an example: - -@lisp -(setq gnus-signature-limit - '(200.0 "^---*Forwarded article")) -@end lisp - -This means that if there are more than 200 lines after the signature -separator, or the text after the signature separator is matched by -the regular expression @samp{^---*Forwarded article}, then it isn't a -signature after all. - - -@node Article Miscellanea -@subsection Article Miscellanea - -@table @kbd -@item A t -@kindex A t (Summary) -@findex gnus-article-babel -Translate the article from one language to another -(@code{gnus-article-babel}). - -@end table - - -@node MIME Commands -@section MIME Commands -@cindex MIME decoding -@cindex attachments -@cindex viewing attachments - -The following commands all understand the numerical prefix. For -instance, @kbd{3 b} means ``view the third @acronym{MIME} part''. - -@table @kbd -@item b -@itemx K v -@kindex b (Summary) -@kindex K v (Summary) -View the @acronym{MIME} part. - -@item K o -@kindex K o (Summary) -Save the @acronym{MIME} part. - -@item K c -@kindex K c (Summary) -Copy the @acronym{MIME} part. - -@item K e -@kindex K e (Summary) -View the @acronym{MIME} part externally. - -@item K i -@kindex K i (Summary) -View the @acronym{MIME} part internally. - -@item K | -@kindex K | (Summary) -Pipe the @acronym{MIME} part to an external command. -@end table - -The rest of these @acronym{MIME} commands do not use the numerical prefix in -the same manner: - -@table @kbd -@item K b -@kindex K b (Summary) -Make all the @acronym{MIME} parts have buttons in front of them. This is -mostly useful if you wish to save (or perform other actions) on inlined -parts. - -@item K m -@kindex K m (Summary) -@findex gnus-summary-repair-multipart -Some multipart messages are transmitted with missing or faulty headers. -This command will attempt to ``repair'' these messages so that they can -be viewed in a more pleasant manner -(@code{gnus-summary-repair-multipart}). - -@item X m -@kindex X m (Summary) -@findex gnus-summary-save-parts -Save all parts matching a @acronym{MIME} type to a directory -(@code{gnus-summary-save-parts}). Understands the process/prefix -convention (@pxref{Process/Prefix}). - -@item M-t -@kindex M-t (Summary) -@findex gnus-summary-toggle-display-buttonized -Toggle the buttonized display of the article buffer -(@code{gnus-summary-toggle-display-buttonized}). - -@item W M w -@kindex W M w (Summary) -@findex gnus-article-decode-mime-words -Decode RFC 2047-encoded words in the article headers -(@code{gnus-article-decode-mime-words}). - -@item W M c -@kindex W M c (Summary) -@findex gnus-article-decode-charset -Decode encoded article bodies as well as charsets -(@code{gnus-article-decode-charset}). - -This command looks in the @code{Content-Type} header to determine the -charset. If there is no such header in the article, you can give it a -prefix, which will prompt for the charset to decode as. In regional -groups where people post using some common encoding (but do not -include @acronym{MIME} headers), you can set the @code{charset} group/topic -parameter to the required charset (@pxref{Group Parameters}). - -@item W M v -@kindex W M v (Summary) -@findex gnus-mime-view-all-parts -View all the @acronym{MIME} parts in the current article -(@code{gnus-mime-view-all-parts}). - -@end table - -Relevant variables: - -@table @code -@item gnus-ignored-mime-types -@vindex gnus-ignored-mime-types -This is a list of regexps. @acronym{MIME} types that match a regexp from -this list will be completely ignored by Gnus. The default value is -@code{nil}. - -To have all Vcards be ignored, you'd say something like this: - -@lisp -(setq gnus-ignored-mime-types - '("text/x-vcard")) -@end lisp - -@item gnus-article-loose-mime -@vindex gnus-article-loose-mime -If non-@code{nil}, Gnus won't require the @samp{MIME-Version} header -before interpreting the message as a @acronym{MIME} message. This helps -when reading messages from certain broken mail user agents. The -default is @code{nil}. - -@item gnus-article-emulate-mime -@vindex gnus-article-emulate-mime -@cindex uuencode -@cindex yEnc -There are other, non-@acronym{MIME} encoding methods used. The most common -is @samp{uuencode}, but yEncode is also getting to be popular. If -this variable is non-@code{nil}, Gnus will look in message bodies to -see if it finds these encodings, and if so, it'll run them through the -Gnus @acronym{MIME} machinery. The default is @code{t}. Only -single-part yEnc encoded attachments can be decoded. There's no support -for encoding in Gnus. - -@item gnus-unbuttonized-mime-types -@vindex gnus-unbuttonized-mime-types -This is a list of regexps. @acronym{MIME} types that match a regexp from -this list won't have @acronym{MIME} buttons inserted unless they aren't -displayed or this variable is overridden by -@code{gnus-buttonized-mime-types}. The default value is -@code{(".*/.*")}. This variable is only used when -@code{gnus-inhibit-mime-unbuttonizing} is @code{nil}. - -@item gnus-buttonized-mime-types -@vindex gnus-buttonized-mime-types -This is a list of regexps. @acronym{MIME} types that match a regexp from -this list will have @acronym{MIME} buttons inserted unless they aren't -displayed. This variable overrides -@code{gnus-unbuttonized-mime-types}. The default value is @code{nil}. -This variable is only used when @code{gnus-inhibit-mime-unbuttonizing} -is @code{nil}. - -To see e.g. security buttons but no other buttons, you could set this -variable to @code{("multipart/signed")} and leave -@code{gnus-unbuttonized-mime-types} at the default value. - -You could also add @code{"multipart/alternative"} to this list to -display radio buttons that allow you to choose one of two media types -those mails include. See also @code{mm-discouraged-alternatives} -(@pxref{Display Customization, ,Display Customization, emacs-mime, The -Emacs MIME Manual}). - -@item gnus-inhibit-mime-unbuttonizing -@vindex gnus-inhibit-mime-unbuttonizing -If this is non-@code{nil}, then all @acronym{MIME} parts get buttons. The -default value is @code{nil}. - -@item gnus-article-mime-part-function -@vindex gnus-article-mime-part-function -For each @acronym{MIME} part, this function will be called with the @acronym{MIME} -handle as the parameter. The function is meant to be used to allow -users to gather information from the article (e. g., add Vcard info to -the bbdb database) or to do actions based on parts (e. g., automatically -save all jpegs into some directory). - -Here's an example function the does the latter: - -@lisp -(defun my-save-all-jpeg-parts (handle) - (when (equal (car (mm-handle-type handle)) "image/jpeg") - (with-temp-buffer - (insert (mm-get-part handle)) - (write-region (point-min) (point-max) - (read-file-name "Save jpeg to: "))))) -(setq gnus-article-mime-part-function - 'my-save-all-jpeg-parts) -@end lisp - -@vindex gnus-mime-multipart-functions -@item gnus-mime-multipart-functions -Alist of @acronym{MIME} multipart types and functions to handle them. - -@vindex gnus-mime-display-multipart-alternative-as-mixed -@item gnus-mime-display-multipart-alternative-as-mixed -Display "multipart/alternative" parts as "multipart/mixed". - -@vindex gnus-mime-display-multipart-related-as-mixed -@item gnus-mime-display-multipart-related-as-mixed -Display "multipart/related" parts as "multipart/mixed". - -If displaying "text/html" is discouraged, see -@code{mm-discouraged-alternatives}, images or other material inside a -"multipart/related" part might be overlooked when this variable is -@code{nil}. @ref{Display Customization, Display Customization, , -emacs-mime, Emacs-Mime Manual}. - -@vindex gnus-mime-display-multipart-as-mixed -@item gnus-mime-display-multipart-as-mixed -Display "multipart" parts as "multipart/mixed". If @code{t}, it -overrides @code{nil} values of -@code{gnus-mime-display-multipart-alternative-as-mixed} and -@code{gnus-mime-display-multipart-related-as-mixed}. - -@vindex mm-file-name-rewrite-functions -@item mm-file-name-rewrite-functions -List of functions used for rewriting file names of @acronym{MIME} parts. -Each function takes a file name as input and returns a file name. - -Ready-made functions include@* -@code{mm-file-name-delete-whitespace}, -@code{mm-file-name-trim-whitespace}, -@code{mm-file-name-collapse-whitespace}, and -@code{mm-file-name-replace-whitespace}. The later uses the value of -the variable @code{mm-file-name-replace-whitespace} to replace each -whitespace character in a file name with that string; default value -is @code{"_"} (a single underscore). -@findex mm-file-name-delete-whitespace -@findex mm-file-name-trim-whitespace -@findex mm-file-name-collapse-whitespace -@findex mm-file-name-replace-whitespace -@vindex mm-file-name-replace-whitespace - -The standard functions @code{capitalize}, @code{downcase}, -@code{upcase}, and @code{upcase-initials} may be useful, too. - -Everybody knows that whitespace characters in file names are evil, -except those who don't know. If you receive lots of attachments from -such unenlightened users, you can make live easier by adding - -@lisp -(setq mm-file-name-rewrite-functions - '(mm-file-name-trim-whitespace - mm-file-name-collapse-whitespace - mm-file-name-replace-whitespace)) -@end lisp - -@noindent -to your @file{~/.gnus.el} file. - -@end table - - -@node Charsets -@section Charsets -@cindex charsets - -People use different charsets, and we have @acronym{MIME} to let us know what -charsets they use. Or rather, we wish we had. Many people use -newsreaders and mailers that do not understand or use @acronym{MIME}, and -just send out messages without saying what character sets they use. To -help a bit with this, some local news hierarchies have policies that say -what character set is the default. For instance, the @samp{fj} -hierarchy uses @code{iso-2022-jp}. - -@vindex gnus-group-charset-alist -This knowledge is encoded in the @code{gnus-group-charset-alist} -variable, which is an alist of regexps (use the first item to match full -group names) and default charsets to be used when reading these groups. - -@vindex gnus-newsgroup-ignored-charsets -In addition, some people do use soi-disant @acronym{MIME}-aware agents that -aren't. These blithely mark messages as being in @code{iso-8859-1} -even if they really are in @code{koi-8}. To help here, the -@code{gnus-newsgroup-ignored-charsets} variable can be used. The -charsets that are listed here will be ignored. The variable can be -set on a group-by-group basis using the group parameters (@pxref{Group -Parameters}). The default value is @code{(unknown-8bit x-unknown)}, -which includes values some agents insist on having in there. - -@vindex gnus-group-posting-charset-alist -When posting, @code{gnus-group-posting-charset-alist} is used to -determine which charsets should not be encoded using the @acronym{MIME} -encodings. For instance, some hierarchies discourage using -quoted-printable header encoding. - -This variable is an alist of regexps and permitted unencoded charsets -for posting. Each element of the alist has the form @code{(}@var{test -header body-list}@code{)}, where: - -@table @var -@item test -is either a regular expression matching the newsgroup header or a -variable to query, -@item header -is the charset which may be left unencoded in the header (@code{nil} -means encode all charsets), -@item body-list -is a list of charsets which may be encoded using 8bit content-transfer -encoding in the body, or one of the special values @code{nil} (always -encode using quoted-printable) or @code{t} (always use 8bit). -@end table - -@cindex Russian -@cindex koi8-r -@cindex koi8-u -@cindex iso-8859-5 -@cindex coding system aliases -@cindex preferred charset - -@xref{Encoding Customization, , Encoding Customization, emacs-mime, -The Emacs MIME Manual}, for additional variables that control which -MIME charsets are used when sending messages. - -Other charset tricks that may be useful, although not Gnus-specific: - -If there are several @acronym{MIME} charsets that encode the same Emacs -charset, you can choose what charset to use by saying the following: - -@lisp -(put-charset-property 'cyrillic-iso8859-5 - 'preferred-coding-system 'koi8-r) -@end lisp - -This means that Russian will be encoded using @code{koi8-r} instead of -the default @code{iso-8859-5} @acronym{MIME} charset. - -If you want to read messages in @code{koi8-u}, you can cheat and say - -@lisp -(define-coding-system-alias 'koi8-u 'koi8-r) -@end lisp - -This will almost do the right thing. - -And finally, to read charsets like @code{windows-1251}, you can say -something like - -@lisp -(codepage-setup 1251) -(define-coding-system-alias 'windows-1251 'cp1251) -@end lisp - - -@node Article Commands -@section Article Commands - -@table @kbd - -@item A P -@cindex PostScript -@cindex printing -@kindex A P (Summary) -@vindex gnus-ps-print-hook -@findex gnus-summary-print-article -Generate and print a PostScript image of the article buffer -(@code{gnus-summary-print-article}). @code{gnus-ps-print-hook} will -be run just before printing the buffer. An alternative way to print -article is to use Muttprint (@pxref{Saving Articles}). - -@end table - - -@node Summary Sorting -@section Summary Sorting -@cindex summary sorting - -You can have the summary buffer sorted in various ways, even though I -can't really see why you'd want that. - -@table @kbd - -@item C-c C-s C-n -@kindex C-c C-s C-n (Summary) -@findex gnus-summary-sort-by-number -Sort by article number (@code{gnus-summary-sort-by-number}). - -@item C-c C-s C-a -@kindex C-c C-s C-a (Summary) -@findex gnus-summary-sort-by-author -Sort by author (@code{gnus-summary-sort-by-author}). - -@item C-c C-s C-s -@kindex C-c C-s C-s (Summary) -@findex gnus-summary-sort-by-subject -Sort by subject (@code{gnus-summary-sort-by-subject}). - -@item C-c C-s C-d -@kindex C-c C-s C-d (Summary) -@findex gnus-summary-sort-by-date -Sort by date (@code{gnus-summary-sort-by-date}). - -@item C-c C-s C-l -@kindex C-c C-s C-l (Summary) -@findex gnus-summary-sort-by-lines -Sort by lines (@code{gnus-summary-sort-by-lines}). - -@item C-c C-s C-c -@kindex C-c C-s C-c (Summary) -@findex gnus-summary-sort-by-chars -Sort by article length (@code{gnus-summary-sort-by-chars}). - -@item C-c C-s C-i -@kindex C-c C-s C-i (Summary) -@findex gnus-summary-sort-by-score -Sort by score (@code{gnus-summary-sort-by-score}). - -@item C-c C-s C-r -@kindex C-c C-s C-r (Summary) -@findex gnus-summary-sort-by-random -Randomize (@code{gnus-summary-sort-by-random}). - -@item C-c C-s C-o -@kindex C-c C-s C-o (Summary) -@findex gnus-summary-sort-by-original -Sort using the default sorting method -(@code{gnus-summary-sort-by-original}). -@end table - -These functions will work both when you use threading and when you don't -use threading. In the latter case, all summary lines will be sorted, -line by line. In the former case, sorting will be done on a -root-by-root basis, which might not be what you were looking for. To -toggle whether to use threading, type @kbd{T T} (@pxref{Thread -Commands}). - - -@node Finding the Parent -@section Finding the Parent -@cindex parent articles -@cindex referring articles - -@table @kbd -@item ^ -@kindex ^ (Summary) -@findex gnus-summary-refer-parent-article -If you'd like to read the parent of the current article, and it is not -displayed in the summary buffer, you might still be able to. That is, -if the current group is fetched by @acronym{NNTP}, the parent hasn't expired -and the @code{References} in the current article are not mangled, you -can just press @kbd{^} or @kbd{A r} -(@code{gnus-summary-refer-parent-article}). If everything goes well, -you'll get the parent. If the parent is already displayed in the -summary buffer, point will just move to this article. - -If given a positive numerical prefix, fetch that many articles back into -the ancestry. If given a negative numerical prefix, fetch just that -ancestor. So if you say @kbd{3 ^}, Gnus will fetch the parent, the -grandparent and the grandgrandparent of the current article. If you say -@kbd{-3 ^}, Gnus will only fetch the grandgrandparent of the current -article. - -@item A R (Summary) -@findex gnus-summary-refer-references -@kindex A R (Summary) -Fetch all articles mentioned in the @code{References} header of the -article (@code{gnus-summary-refer-references}). - -@item A T (Summary) -@findex gnus-summary-refer-thread -@kindex A T (Summary) -Display the full thread where the current article appears -(@code{gnus-summary-refer-thread}). This command has to fetch all the -headers in the current group to work, so it usually takes a while. If -you do it often, you may consider setting @code{gnus-fetch-old-headers} -to @code{invisible} (@pxref{Filling In Threads}). This won't have any -visible effects normally, but it'll make this command work a whole lot -faster. Of course, it'll make group entry somewhat slow. - -@vindex gnus-refer-thread-limit -The @code{gnus-refer-thread-limit} variable says how many old (i. e., -articles before the first displayed in the current group) headers to -fetch when doing this command. The default is 200. If @code{t}, all -the available headers will be fetched. This variable can be overridden -by giving the @kbd{A T} command a numerical prefix. - -@item M-^ (Summary) -@findex gnus-summary-refer-article -@kindex M-^ (Summary) -@cindex Message-ID -@cindex fetching by Message-ID -You can also ask Gnus for an arbitrary article, no matter what group it -belongs to. @kbd{M-^} (@code{gnus-summary-refer-article}) will ask you -for a @code{Message-ID}, which is one of those long, hard-to-read -thingies that look something like @samp{<38o6up$6f2@@hymir.ifi.uio.no>}. -You have to get it all exactly right. No fuzzy searches, I'm afraid. - -Gnus looks for the @code{Message-ID} in the headers that have already -been fetched, but also tries all the select methods specified by -@code{gnus-refer-article-method} if it is not found. -@end table - -@vindex gnus-refer-article-method -If the group you are reading is located on a back end that does not -support fetching by @code{Message-ID} very well (like @code{nnspool}), -you can set @code{gnus-refer-article-method} to an @acronym{NNTP} method. It -would, perhaps, be best if the @acronym{NNTP} server you consult is the one -updating the spool you are reading from, but that's not really -necessary. - -It can also be a list of select methods, as well as the special symbol -@code{current}, which means to use the current select method. If it -is a list, Gnus will try all the methods in the list until it finds a -match. - -Here's an example setting that will first try the current method, and -then ask Google if that fails: - -@lisp -(setq gnus-refer-article-method - '(current - (nnweb "google" (nnweb-type google)))) -@end lisp - -Most of the mail back ends support fetching by @code{Message-ID}, but -do not do a particularly excellent job at it. That is, @code{nnmbox}, -@code{nnbabyl}, @code{nnmaildir}, @code{nnml}, are able to locate -articles from any groups, while @code{nnfolder}, and @code{nnimap} are -only able to locate articles that have been posted to the current -group. (Anything else would be too time consuming.) @code{nnmh} does -not support this at all. - - -@node Alternative Approaches -@section Alternative Approaches - -Different people like to read news using different methods. This being -Gnus, we offer a small selection of minor modes for the summary buffers. - -@menu -* Pick and Read:: First mark articles and then read them. -* Binary Groups:: Auto-decode all articles. -@end menu - - -@node Pick and Read -@subsection Pick and Read -@cindex pick and read - -Some newsreaders (like @code{nn} and, uhm, @code{Netnews} on VM/CMS) use -a two-phased reading interface. The user first marks in a summary -buffer the articles she wants to read. Then she starts reading the -articles with just an article buffer displayed. - -@findex gnus-pick-mode -@kindex M-x gnus-pick-mode -Gnus provides a summary buffer minor mode that allows -this---@code{gnus-pick-mode}. This basically means that a few process -mark commands become one-keystroke commands to allow easy marking, and -it provides one additional command for switching to the summary buffer. - -Here are the available keystrokes when using pick mode: - -@table @kbd -@item . -@kindex . (Pick) -@findex gnus-pick-article-or-thread -Pick the article or thread on the current line -(@code{gnus-pick-article-or-thread}). If the variable -@code{gnus-thread-hide-subtree} is true, then this key selects the -entire thread when used at the first article of the thread. Otherwise, -it selects just the article. If given a numerical prefix, go to that -thread or article and pick it. (The line number is normally displayed -at the beginning of the summary pick lines.) - -@item SPACE -@kindex SPACE (Pick) -@findex gnus-pick-next-page -Scroll the summary buffer up one page (@code{gnus-pick-next-page}). If -at the end of the buffer, start reading the picked articles. - -@item u -@kindex u (Pick) -@findex gnus-pick-unmark-article-or-thread. -Unpick the thread or article -(@code{gnus-pick-unmark-article-or-thread}). If the variable -@code{gnus-thread-hide-subtree} is true, then this key unpicks the -thread if used at the first article of the thread. Otherwise it unpicks -just the article. You can give this key a numerical prefix to unpick -the thread or article at that line. - -@item RET -@kindex RET (Pick) -@findex gnus-pick-start-reading -@vindex gnus-pick-display-summary -Start reading the picked articles (@code{gnus-pick-start-reading}). If -given a prefix, mark all unpicked articles as read first. If -@code{gnus-pick-display-summary} is non-@code{nil}, the summary buffer -will still be visible when you are reading. - -@end table - -All the normal summary mode commands are still available in the -pick-mode, with the exception of @kbd{u}. However @kbd{!} is available -which is mapped to the same function -@code{gnus-summary-tick-article-forward}. - -If this sounds like a good idea to you, you could say: - -@lisp -(add-hook 'gnus-summary-mode-hook 'gnus-pick-mode) -@end lisp - -@vindex gnus-pick-mode-hook -@code{gnus-pick-mode-hook} is run in pick minor mode buffers. - -@vindex gnus-mark-unpicked-articles-as-read -If @code{gnus-mark-unpicked-articles-as-read} is non-@code{nil}, mark -all unpicked articles as read. The default is @code{nil}. - -@vindex gnus-summary-pick-line-format -The summary line format in pick mode is slightly different from the -standard format. At the beginning of each line the line number is -displayed. The pick mode line format is controlled by the -@code{gnus-summary-pick-line-format} variable (@pxref{Formatting -Variables}). It accepts the same format specs that -@code{gnus-summary-line-format} does (@pxref{Summary Buffer Lines}). - - -@node Binary Groups -@subsection Binary Groups -@cindex binary groups - -@findex gnus-binary-mode -@kindex M-x gnus-binary-mode -If you spend much time in binary groups, you may grow tired of hitting -@kbd{X u}, @kbd{n}, @kbd{RET} all the time. @kbd{M-x gnus-binary-mode} -is a minor mode for summary buffers that makes all ordinary Gnus article -selection functions uudecode series of articles and display the result -instead of just displaying the articles the normal way. - -@kindex g (Binary) -@findex gnus-binary-show-article -The only way, in fact, to see the actual articles is the @kbd{g} -command, when you have turned on this mode -(@code{gnus-binary-show-article}). - -@vindex gnus-binary-mode-hook -@code{gnus-binary-mode-hook} is called in binary minor mode buffers. - - -@node Tree Display -@section Tree Display -@cindex trees - -@vindex gnus-use-trees -If you don't like the normal Gnus summary display, you might try setting -@code{gnus-use-trees} to @code{t}. This will create (by default) an -additional @dfn{tree buffer}. You can execute all summary mode commands -in the tree buffer. - -There are a few variables to customize the tree display, of course: - -@table @code -@item gnus-tree-mode-hook -@vindex gnus-tree-mode-hook -A hook called in all tree mode buffers. - -@item gnus-tree-mode-line-format -@vindex gnus-tree-mode-line-format -A format string for the mode bar in the tree mode buffers (@pxref{Mode -Line Formatting}). The default is @samp{Gnus: %%b %S %Z}. For a list -of valid specs, @pxref{Summary Buffer Mode Line}. - -@item gnus-selected-tree-face -@vindex gnus-selected-tree-face -Face used for highlighting the selected article in the tree buffer. The -default is @code{modeline}. - -@item gnus-tree-line-format -@vindex gnus-tree-line-format -A format string for the tree nodes. The name is a bit of a misnomer, -though---it doesn't define a line, but just the node. The default value -is @samp{%(%[%3,3n%]%)}, which displays the first three characters of -the name of the poster. It is vital that all nodes are of the same -length, so you @emph{must} use @samp{%4,4n}-like specifiers. - -Valid specs are: - -@table @samp -@item n -The name of the poster. -@item f -The @code{From} header. -@item N -The number of the article. -@item [ -The opening bracket. -@item ] -The closing bracket. -@item s -The subject. -@end table - -@xref{Formatting Variables}. - -Variables related to the display are: - -@table @code -@item gnus-tree-brackets -@vindex gnus-tree-brackets -This is used for differentiating between ``real'' articles and -``sparse'' articles. The format is -@example -((@var{real-open} . @var{real-close}) - (@var{sparse-open} . @var{sparse-close}) - (@var{dummy-open} . @var{dummy-close})) -@end example -and the default is @code{((?[ . ?]) (?( . ?)) (?@{ . ?@}) (?< . ?>))}. - -@item gnus-tree-parent-child-edges -@vindex gnus-tree-parent-child-edges -This is a list that contains the characters used for connecting parent -nodes to their children. The default is @code{(?- ?\\ ?|)}. - -@end table - -@item gnus-tree-minimize-window -@vindex gnus-tree-minimize-window -If this variable is non-@code{nil}, Gnus will try to keep the tree -buffer as small as possible to allow more room for the other Gnus -windows. If this variable is a number, the tree buffer will never be -higher than that number. The default is @code{t}. Note that if you -have several windows displayed side-by-side in a frame and the tree -buffer is one of these, minimizing the tree window will also resize all -other windows displayed next to it. - -You may also wish to add the following hook to keep the window minimized -at all times: - -@lisp -(add-hook 'gnus-configure-windows-hook - 'gnus-tree-perhaps-minimize) -@end lisp - -@item gnus-generate-tree-function -@vindex gnus-generate-tree-function -@findex gnus-generate-horizontal-tree -@findex gnus-generate-vertical-tree -The function that actually generates the thread tree. Two predefined -functions are available: @code{gnus-generate-horizontal-tree} and -@code{gnus-generate-vertical-tree} (which is the default). - -@end table - -Here's an example from a horizontal tree buffer: - -@example -@{***@}-(***)-[odd]-[Gun] - | \[Jan] - | \[odd]-[Eri] - | \(***)-[Eri] - | \[odd]-[Paa] - \[Bjo] - \[Gun] - \[Gun]-[Jor] -@end example - -Here's the same thread displayed in a vertical tree buffer: - -@example -@group -@{***@} - |--------------------------\-----\-----\ -(***) [Bjo] [Gun] [Gun] - |--\-----\-----\ | -[odd] [Jan] [odd] (***) [Jor] - | | |--\ -[Gun] [Eri] [Eri] [odd] - | - [Paa] -@end group -@end example - -If you're using horizontal trees, it might be nice to display the trees -side-by-side with the summary buffer. You could add something like the -following to your @file{~/.gnus.el} file: - -@lisp -(setq gnus-use-trees t - gnus-generate-tree-function 'gnus-generate-horizontal-tree - gnus-tree-minimize-window nil) -(gnus-add-configuration - '(article - (vertical 1.0 - (horizontal 0.25 - (summary 0.75 point) - (tree 1.0)) - (article 1.0)))) -@end lisp - -@xref{Window Layout}. - - -@node Mail Group Commands -@section Mail Group Commands -@cindex mail group commands - -Some commands only make sense in mail groups. If these commands are -invalid in the current group, they will raise a hell and let you know. - -All these commands (except the expiry and edit commands) use the -process/prefix convention (@pxref{Process/Prefix}). - -@table @kbd - -@item B e -@kindex B e (Summary) -@findex gnus-summary-expire-articles -@cindex expiring mail -Run all expirable articles in the current group through the expiry -process (@code{gnus-summary-expire-articles}). That is, delete all -expirable articles in the group that have been around for a while. -(@pxref{Expiring Mail}). - -@item B C-M-e -@kindex B C-M-e (Summary) -@findex gnus-summary-expire-articles-now -@cindex expiring mail -Delete all the expirable articles in the group -(@code{gnus-summary-expire-articles-now}). This means that @strong{all} -articles eligible for expiry in the current group will -disappear forever into that big @file{/dev/null} in the sky. - -@item B DEL -@kindex B DEL (Summary) -@findex gnus-summary-delete-article -@c @icon{gnus-summary-mail-delete} -Delete the mail article. This is ``delete'' as in ``delete it from your -disk forever and ever, never to return again.'' Use with caution. -(@code{gnus-summary-delete-article}). - -@item B m -@kindex B m (Summary) -@cindex move mail -@findex gnus-summary-move-article -@vindex gnus-preserve-marks -Move the article from one mail group to another -(@code{gnus-summary-move-article}). Marks will be preserved if -@code{gnus-preserve-marks} is non-@code{nil} (which is the default). - -@item B c -@kindex B c (Summary) -@cindex copy mail -@findex gnus-summary-copy-article -@c @icon{gnus-summary-mail-copy} -Copy the article from one group (mail group or not) to a mail group -(@code{gnus-summary-copy-article}). Marks will be preserved if -@code{gnus-preserve-marks} is non-@code{nil} (which is the default). - -@item B B -@kindex B B (Summary) -@cindex crosspost mail -@findex gnus-summary-crosspost-article -Crosspost the current article to some other group -(@code{gnus-summary-crosspost-article}). This will create a new copy of -the article in the other group, and the Xref headers of the article will -be properly updated. - -@item B i -@kindex B i (Summary) -@findex gnus-summary-import-article -Import an arbitrary file into the current mail newsgroup -(@code{gnus-summary-import-article}). You will be prompted for a file -name, a @code{From} header and a @code{Subject} header. - -@item B I -@kindex B I (Summary) -@findex gnus-summary-create-article -Create an empty article in the current mail newsgroups -(@code{gnus-summary-create-article}). You will be prompted for a -@code{From} header and a @code{Subject} header. - -@item B r -@kindex B r (Summary) -@findex gnus-summary-respool-article -@vindex gnus-summary-respool-default-method -Respool the mail article (@code{gnus-summary-respool-article}). -@code{gnus-summary-respool-default-method} will be used as the default -select method when respooling. This variable is @code{nil} by default, -which means that the current group select method will be used instead. -Marks will be preserved if @code{gnus-preserve-marks} is non-@code{nil} -(which is the default). - -@item B w -@itemx e -@kindex B w (Summary) -@kindex e (Summary) -@findex gnus-summary-edit-article -@kindex C-c C-c (Article) -@findex gnus-summary-edit-article-done -Edit the current article (@code{gnus-summary-edit-article}). To finish -editing and make the changes permanent, type @kbd{C-c C-c} -(@code{gnus-summary-edit-article-done}). If you give a prefix to the -@kbd{C-c C-c} command, Gnus won't re-highlight the article. - -@item B q -@kindex B q (Summary) -@findex gnus-summary-respool-query -If you want to re-spool an article, you might be curious as to what group -the article will end up in before you do the re-spooling. This command -will tell you (@code{gnus-summary-respool-query}). - -@item B t -@kindex B t (Summary) -@findex gnus-summary-respool-trace -Similarly, this command will display all fancy splitting patterns used -when respooling, if any (@code{gnus-summary-respool-trace}). - -@item B p -@kindex B p (Summary) -@findex gnus-summary-article-posted-p -Some people have a tendency to send you ``courtesy'' copies when they -follow up to articles you have posted. These usually have a -@code{Newsgroups} header in them, but not always. This command -(@code{gnus-summary-article-posted-p}) will try to fetch the current -article from your news server (or rather, from -@code{gnus-refer-article-method} or @code{gnus-select-method}) and will -report back whether it found the article or not. Even if it says that -it didn't find the article, it may have been posted anyway---mail -propagation is much faster than news propagation, and the news copy may -just not have arrived yet. - -@item K E -@kindex K E (Summary) -@findex gnus-article-encrypt-body -@vindex gnus-article-encrypt-protocol -Encrypt the body of an article (@code{gnus-article-encrypt-body}). -The body is encrypted with the encryption protocol specified by the -variable @code{gnus-article-encrypt-protocol}. - -@end table - -@vindex gnus-move-split-methods -@cindex moving articles -If you move (or copy) articles regularly, you might wish to have Gnus -suggest where to put the articles. @code{gnus-move-split-methods} is a -variable that uses the same syntax as @code{gnus-split-methods} -(@pxref{Saving Articles}). You may customize that variable to create -suggestions you find reasonable. (Note that -@code{gnus-move-split-methods} uses group names where -@code{gnus-split-methods} uses file names.) - -@lisp -(setq gnus-move-split-methods - '(("^From:.*Lars Magne" "nnml:junk") - ("^Subject:.*gnus" "nnfolder:important") - (".*" "nnml:misc"))) -@end lisp - - -@node Various Summary Stuff -@section Various Summary Stuff - -@menu -* Summary Group Information:: Information oriented commands. -* Searching for Articles:: Multiple article commands. -* Summary Generation Commands:: -* Really Various Summary Commands:: Those pesky non-conformant commands. -@end menu - -@table @code -@vindex gnus-summary-display-while-building -@item gnus-summary-display-while-building -If non-@code{nil}, show and update the summary buffer as it's being -built. If @code{t}, update the buffer after every line is inserted. -If the value is an integer, @var{n}, update the display every @var{n} -lines. The default is @code{nil}. - -@vindex gnus-summary-display-arrow -@item gnus-summary-display-arrow -If non-@code{nil}, display an arrow in the fringe to indicate the -current article. - -@vindex gnus-summary-mode-hook -@item gnus-summary-mode-hook -This hook is called when creating a summary mode buffer. - -@vindex gnus-summary-generate-hook -@item gnus-summary-generate-hook -This is called as the last thing before doing the threading and the -generation of the summary buffer. It's quite convenient for customizing -the threading variables based on what data the newsgroup has. This hook -is called from the summary buffer after most summary buffer variables -have been set. - -@vindex gnus-summary-prepare-hook -@item gnus-summary-prepare-hook -It is called after the summary buffer has been generated. You might use -it to, for instance, highlight lines or modify the look of the buffer in -some other ungodly manner. I don't care. - -@vindex gnus-summary-prepared-hook -@item gnus-summary-prepared-hook -A hook called as the very last thing after the summary buffer has been -generated. - -@vindex gnus-summary-ignore-duplicates -@item gnus-summary-ignore-duplicates -When Gnus discovers two articles that have the same @code{Message-ID}, -it has to do something drastic. No articles are allowed to have the -same @code{Message-ID}, but this may happen when reading mail from some -sources. Gnus allows you to customize what happens with this variable. -If it is @code{nil} (which is the default), Gnus will rename the -@code{Message-ID} (for display purposes only) and display the article as -any other article. If this variable is @code{t}, it won't display the -article---it'll be as if it never existed. - -@vindex gnus-alter-articles-to-read-function -@item gnus-alter-articles-to-read-function -This function, which takes two parameters (the group name and the list -of articles to be selected), is called to allow the user to alter the -list of articles to be selected. - -For instance, the following function adds the list of cached articles to -the list in one particular group: - -@lisp -(defun my-add-cached-articles (group articles) - (if (string= group "some.group") - (append gnus-newsgroup-cached articles) - articles)) -@end lisp - -@vindex gnus-newsgroup-variables -@item gnus-newsgroup-variables -A list of newsgroup (summary buffer) local variables, or cons of -variables and their default expressions to be evalled (when the default -values are not @code{nil}), that should be made global while the summary -buffer is active. - -Note: The default expressions will be evaluated (using function -@code{eval}) before assignment to the local variable rather than just -assigned to it. If the default expression is the symbol @code{global}, -that symbol will not be evaluated but the global value of the local -variable will be used instead. - -These variables can be used to set variables in the group parameters -while still allowing them to affect operations done in other -buffers. For example: - -@lisp -(setq gnus-newsgroup-variables - '(message-use-followup-to - (gnus-visible-headers . - "^From:\\|^Newsgroups:\\|^Subject:\\|^Date:\\|^To:"))) -@end lisp - -Also @pxref{Group Parameters}. -@end table - - -@node Summary Group Information -@subsection Summary Group Information - -@table @kbd - -@item H f -@kindex H f (Summary) -@findex gnus-summary-fetch-faq -@vindex gnus-group-faq-directory -Try to fetch the @acronym{FAQ} (list of frequently asked questions) -for the current group (@code{gnus-summary-fetch-faq}). Gnus will try -to get the @acronym{FAQ} from @code{gnus-group-faq-directory}, which -is usually a directory on a remote machine. This variable can also be -a list of directories. In that case, giving a prefix to this command -will allow you to choose between the various sites. @code{ange-ftp} -or @code{efs} will probably be used for fetching the file. - -@item H d -@kindex H d (Summary) -@findex gnus-summary-describe-group -Give a brief description of the current group -(@code{gnus-summary-describe-group}). If given a prefix, force -rereading the description from the server. - -@item H h -@kindex H h (Summary) -@findex gnus-summary-describe-briefly -Give an extremely brief description of the most important summary -keystrokes (@code{gnus-summary-describe-briefly}). - -@item H i -@kindex H i (Summary) -@findex gnus-info-find-node -Go to the Gnus info node (@code{gnus-info-find-node}). -@end table - - -@node Searching for Articles -@subsection Searching for Articles - -@table @kbd - -@item M-s -@kindex M-s (Summary) -@findex gnus-summary-search-article-forward -Search through all subsequent (raw) articles for a regexp -(@code{gnus-summary-search-article-forward}). - -@item M-r -@kindex M-r (Summary) -@findex gnus-summary-search-article-backward -Search through all previous (raw) articles for a regexp -(@code{gnus-summary-search-article-backward}). - -@item & -@kindex & (Summary) -@findex gnus-summary-execute-command -This command will prompt you for a header, a regular expression to match -on this field, and a command to be executed if the match is made -(@code{gnus-summary-execute-command}). If the header is an empty -string, the match is done on the entire article. If given a prefix, -search backward instead. - -For instance, @kbd{& RET some.*string RET #} will put the process mark on -all articles that have heads or bodies that match @samp{some.*string}. - -@item M-& -@kindex M-& (Summary) -@findex gnus-summary-universal-argument -Perform any operation on all articles that have been marked with -the process mark (@code{gnus-summary-universal-argument}). -@end table - -@node Summary Generation Commands -@subsection Summary Generation Commands - -@table @kbd - -@item Y g -@kindex Y g (Summary) -@findex gnus-summary-prepare -Regenerate the current summary buffer (@code{gnus-summary-prepare}). - -@item Y c -@kindex Y c (Summary) -@findex gnus-summary-insert-cached-articles -Pull all cached articles (for the current group) into the summary buffer -(@code{gnus-summary-insert-cached-articles}). - -@item Y d -@kindex Y d (Summary) -@findex gnus-summary-insert-dormant-articles -Pull all dormant articles (for the current group) into the summary buffer -(@code{gnus-summary-insert-dormant-articles}). - -@end table - - -@node Really Various Summary Commands -@subsection Really Various Summary Commands - -@table @kbd - -@item A D -@itemx C-d -@kindex C-d (Summary) -@kindex A D (Summary) -@findex gnus-summary-enter-digest-group -If the current article is a collection of other articles (for instance, -a digest), you might use this command to enter a group based on the that -article (@code{gnus-summary-enter-digest-group}). Gnus will try to -guess what article type is currently displayed unless you give a prefix -to this command, which forces a ``digest'' interpretation. Basically, -whenever you see a message that is a collection of other messages of -some format, you @kbd{C-d} and read these messages in a more convenient -fashion. - -@item C-M-d -@kindex C-M-d (Summary) -@findex gnus-summary-read-document -This command is very similar to the one above, but lets you gather -several documents into one biiig group -(@code{gnus-summary-read-document}). It does this by opening several -@code{nndoc} groups for each document, and then opening an -@code{nnvirtual} group on top of these @code{nndoc} groups. This -command understands the process/prefix convention -(@pxref{Process/Prefix}). - -@item C-t -@kindex C-t (Summary) -@findex gnus-summary-toggle-truncation -Toggle truncation of summary lines -(@code{gnus-summary-toggle-truncation}). This will probably confuse the -line centering function in the summary buffer, so it's not a good idea -to have truncation switched off while reading articles. - -@item = -@kindex = (Summary) -@findex gnus-summary-expand-window -Expand the summary buffer window (@code{gnus-summary-expand-window}). -If given a prefix, force an @code{article} window configuration. - -@item C-M-e -@kindex C-M-e (Summary) -@findex gnus-summary-edit-parameters -Edit the group parameters (@pxref{Group Parameters}) of the current -group (@code{gnus-summary-edit-parameters}). - -@item C-M-a -@kindex C-M-a (Summary) -@findex gnus-summary-customize-parameters -Customize the group parameters (@pxref{Group Parameters}) of the current -group (@code{gnus-summary-customize-parameters}). - -@end table - - -@node Exiting the Summary Buffer -@section Exiting the Summary Buffer -@cindex summary exit -@cindex exiting groups - -Exiting from the summary buffer will normally update all info on the -group and return you to the group buffer. - -@table @kbd - -@item Z Z -@itemx Z Q -@itemx q -@kindex Z Z (Summary) -@kindex Z Q (Summary) -@kindex q (Summary) -@findex gnus-summary-exit -@vindex gnus-summary-exit-hook -@vindex gnus-summary-prepare-exit-hook -@vindex gnus-group-no-more-groups-hook -@c @icon{gnus-summary-exit} -Exit the current group and update all information on the group -(@code{gnus-summary-exit}). @code{gnus-summary-prepare-exit-hook} is -called before doing much of the exiting, which calls -@code{gnus-summary-expire-articles} by default. -@code{gnus-summary-exit-hook} is called after finishing the exit -process. @code{gnus-group-no-more-groups-hook} is run when returning to -group mode having no more (unread) groups. - -@item Z E -@itemx Q -@kindex Z E (Summary) -@kindex Q (Summary) -@findex gnus-summary-exit-no-update -Exit the current group without updating any information on the group -(@code{gnus-summary-exit-no-update}). - -@item Z c -@itemx c -@kindex Z c (Summary) -@kindex c (Summary) -@findex gnus-summary-catchup-and-exit -@c @icon{gnus-summary-catchup-and-exit} -Mark all unticked articles in the group as read and then exit -(@code{gnus-summary-catchup-and-exit}). - -@item Z C -@kindex Z C (Summary) -@findex gnus-summary-catchup-all-and-exit -Mark all articles, even the ticked ones, as read and then exit -(@code{gnus-summary-catchup-all-and-exit}). - -@item Z n -@kindex Z n (Summary) -@findex gnus-summary-catchup-and-goto-next-group -Mark all articles as read and go to the next group -(@code{gnus-summary-catchup-and-goto-next-group}). - -@item Z R -@itemx C-x C-s -@kindex Z R (Summary) -@kindex C-x C-s (Summary) -@findex gnus-summary-reselect-current-group -Exit this group, and then enter it again -(@code{gnus-summary-reselect-current-group}). If given a prefix, select -all articles, both read and unread. - -@item Z G -@itemx M-g -@kindex Z G (Summary) -@kindex M-g (Summary) -@findex gnus-summary-rescan-group -@c @icon{gnus-summary-mail-get} -Exit the group, check for new articles in the group, and select the -group (@code{gnus-summary-rescan-group}). If given a prefix, select all -articles, both read and unread. - -@item Z N -@kindex Z N (Summary) -@findex gnus-summary-next-group -Exit the group and go to the next group -(@code{gnus-summary-next-group}). - -@item Z P -@kindex Z P (Summary) -@findex gnus-summary-prev-group -Exit the group and go to the previous group -(@code{gnus-summary-prev-group}). - -@item Z s -@kindex Z s (Summary) -@findex gnus-summary-save-newsrc -Save the current number of read/marked articles in the dribble buffer -and then save the dribble buffer (@code{gnus-summary-save-newsrc}). If -given a prefix, also save the @file{.newsrc} file(s). Using this -command will make exit without updating (the @kbd{Q} command) worthless. -@end table - -@vindex gnus-exit-group-hook -@code{gnus-exit-group-hook} is called when you exit the current group -with an ``updating'' exit. For instance @kbd{Q} -(@code{gnus-summary-exit-no-update}) does not call this hook. - -@findex gnus-summary-wake-up-the-dead -@findex gnus-dead-summary-mode -@vindex gnus-kill-summary-on-exit -If you're in the habit of exiting groups, and then changing your mind -about it, you might set @code{gnus-kill-summary-on-exit} to @code{nil}. -If you do that, Gnus won't kill the summary buffer when you exit it. -(Quelle surprise!) Instead it will change the name of the buffer to -something like @samp{*Dead Summary ... *} and install a minor mode -called @code{gnus-dead-summary-mode}. Now, if you switch back to this -buffer, you'll find that all keys are mapped to a function called -@code{gnus-summary-wake-up-the-dead}. So tapping any keys in a dead -summary buffer will result in a live, normal summary buffer. - -There will never be more than one dead summary buffer at any one time. - -@vindex gnus-use-cross-reference -The data on the current group will be updated (which articles you have -read, which articles you have replied to, etc.) when you exit the -summary buffer. If the @code{gnus-use-cross-reference} variable is -@code{t} (which is the default), articles that are cross-referenced to -this group and are marked as read, will also be marked as read in the -other subscribed groups they were cross-posted to. If this variable is -neither @code{nil} nor @code{t}, the article will be marked as read in -both subscribed and unsubscribed groups (@pxref{Crosspost Handling}). - - -@node Crosspost Handling -@section Crosspost Handling - -@cindex velveeta -@cindex spamming -Marking cross-posted articles as read ensures that you'll never have to -read the same article more than once. Unless, of course, somebody has -posted it to several groups separately. Posting the same article to -several groups (not cross-posting) is called @dfn{spamming}, and you are -by law required to send nasty-grams to anyone who perpetrates such a -heinous crime. You may want to try NoCeM handling to filter out spam -(@pxref{NoCeM}). - -Remember: Cross-posting is kinda ok, but posting the same article -separately to several groups is not. Massive cross-posting (aka. -@dfn{velveeta}) is to be avoided at all costs, and you can even use the -@code{gnus-summary-mail-crosspost-complaint} command to complain about -excessive crossposting (@pxref{Summary Mail Commands}). - -@cindex cross-posting -@cindex Xref -@cindex @acronym{NOV} -One thing that may cause Gnus to not do the cross-posting thing -correctly is if you use an @acronym{NNTP} server that supports @sc{xover} -(which is very nice, because it speeds things up considerably) which -does not include the @code{Xref} header in its @acronym{NOV} lines. This is -Evil, but all too common, alas, alack. Gnus tries to Do The Right Thing -even with @sc{xover} by registering the @code{Xref} lines of all -articles you actually read, but if you kill the articles, or just mark -them as read without reading them, Gnus will not get a chance to snoop -the @code{Xref} lines out of these articles, and will be unable to use -the cross reference mechanism. - -@cindex LIST overview.fmt -@cindex overview.fmt -To check whether your @acronym{NNTP} server includes the @code{Xref} header -in its overview files, try @samp{telnet your.nntp.server nntp}, -@samp{MODE READER} on @code{inn} servers, and then say @samp{LIST -overview.fmt}. This may not work, but if it does, and the last line you -get does not read @samp{Xref:full}, then you should shout and whine at -your news admin until she includes the @code{Xref} header in the -overview files. - -@vindex gnus-nov-is-evil -If you want Gnus to get the @code{Xref}s right all the time, you have to -set @code{gnus-nov-is-evil} to @code{t}, which slows things down -considerably. - -C'est la vie. - -For an alternative approach, @pxref{Duplicate Suppression}. - - -@node Duplicate Suppression -@section Duplicate Suppression - -By default, Gnus tries to make sure that you don't have to read the same -article more than once by utilizing the crossposting mechanism -(@pxref{Crosspost Handling}). However, that simple and efficient -approach may not work satisfactory for some users for various -reasons. - -@enumerate -@item -The @acronym{NNTP} server may fail to generate the @code{Xref} header. This -is evil and not very common. - -@item -The @acronym{NNTP} server may fail to include the @code{Xref} header in the -@file{.overview} data bases. This is evil and all too common, alas. - -@item -You may be reading the same group (or several related groups) from -different @acronym{NNTP} servers. - -@item -You may be getting mail that duplicates articles posted to groups. -@end enumerate - -I'm sure there are other situations where @code{Xref} handling fails as -well, but these four are the most common situations. - -If, and only if, @code{Xref} handling fails for you, then you may -consider switching on @dfn{duplicate suppression}. If you do so, Gnus -will remember the @code{Message-ID}s of all articles you have read or -otherwise marked as read, and then, as if by magic, mark them as read -all subsequent times you see them---in @emph{all} groups. Using this -mechanism is quite likely to be somewhat inefficient, but not overly -so. It's certainly preferable to reading the same articles more than -once. - -Duplicate suppression is not a very subtle instrument. It's more like a -sledge hammer than anything else. It works in a very simple -fashion---if you have marked an article as read, it adds this Message-ID -to a cache. The next time it sees this Message-ID, it will mark the -article as read with the @samp{M} mark. It doesn't care what group it -saw the article in. - -@table @code -@item gnus-suppress-duplicates -@vindex gnus-suppress-duplicates -If non-@code{nil}, suppress duplicates. - -@item gnus-save-duplicate-list -@vindex gnus-save-duplicate-list -If non-@code{nil}, save the list of duplicates to a file. This will -make startup and shutdown take longer, so the default is @code{nil}. -However, this means that only duplicate articles read in a single Gnus -session are suppressed. - -@item gnus-duplicate-list-length -@vindex gnus-duplicate-list-length -This variable says how many @code{Message-ID}s to keep in the duplicate -suppression list. The default is 10000. - -@item gnus-duplicate-file -@vindex gnus-duplicate-file -The name of the file to store the duplicate suppression list in. The -default is @file{~/News/suppression}. -@end table - -If you have a tendency to stop and start Gnus often, setting -@code{gnus-save-duplicate-list} to @code{t} is probably a good idea. If -you leave Gnus running for weeks on end, you may have it @code{nil}. On -the other hand, saving the list makes startup and shutdown much slower, -so that means that if you stop and start Gnus often, you should set -@code{gnus-save-duplicate-list} to @code{nil}. Uhm. I'll leave this up -to you to figure out, I think. - -@node Security -@section Security - -Gnus is able to verify signed messages or decrypt encrypted messages. -The formats that are supported are @acronym{PGP}, @acronym{PGP/MIME} -and @acronym{S/MIME}, however you need some external programs to get -things to work: - -@enumerate -@item -To handle @acronym{PGP} and @acronym{PGP/MIME} messages, you have to -install an OpenPGP implementation such as GnuPG. The Lisp interface -to GnuPG included with Gnus is called PGG (@pxref{Top, ,PGG, pgg, PGG -Manual}), but Mailcrypt and gpg.el are also supported. - -@item -To handle @acronym{S/MIME} message, you need to install OpenSSL. OpenSSL 0.9.6 -or newer is recommended. - -@end enumerate - -The variables that control security functionality on reading messages -include: - -@table @code -@item mm-verify-option -@vindex mm-verify-option -Option of verifying signed parts. @code{never}, not verify; -@code{always}, always verify; @code{known}, only verify known -protocols. Otherwise, ask user. - -@item mm-decrypt-option -@vindex mm-decrypt-option -Option of decrypting encrypted parts. @code{never}, no decryption; -@code{always}, always decrypt; @code{known}, only decrypt known -protocols. Otherwise, ask user. - -@item mml1991-use -@vindex mml1991-use -Symbol indicating elisp interface to OpenPGP implementation for -@acronym{PGP} messages. The default is @code{pgg}, but -@code{mailcrypt} and @code{gpg} are also supported although -deprecated. - -@item mml2015-use -@vindex mml2015-use -Symbol indicating elisp interface to OpenPGP implementation for -@acronym{PGP/MIME} messages. The default is @code{pgg}, but -@code{mailcrypt} and @code{gpg} are also supported although -deprecated. - -@end table - -By default the buttons that display security information are not -shown, because they clutter reading the actual e-mail. You can type -@kbd{K b} manually to display the information. Use the -@code{gnus-buttonized-mime-types} and -@code{gnus-unbuttonized-mime-types} variables to control this -permanently. @ref{MIME Commands} for further details, and hints on -how to customize these variables to always display security -information. - -@cindex snarfing keys -@cindex importing PGP keys -@cindex PGP key ring import -Snarfing OpenPGP keys (i.e., importing keys from articles into your -key ring) is not supported explicitly through a menu item or command, -rather Gnus do detect and label keys as @samp{application/pgp-keys}, -allowing you to specify whatever action you think is appropriate -through the usual @acronym{MIME} infrastructure. You can use a -@file{~/.mailcap} entry (@pxref{mailcap, , mailcap, emacs-mime, The -Emacs MIME Manual}) such as the following to import keys using GNU -Privacy Guard when you click on the @acronym{MIME} button -(@pxref{Using MIME}). - -@example -application/pgp-keys; gpg --import --interactive --verbose; needsterminal -@end example -@noindent -This happens to also be the default action defined in -@code{mailcap-mime-data}. - -More information on how to set things for sending outgoing signed and -encrypted messages up can be found in the message manual -(@pxref{Security, ,Security, message, Message Manual}). - -@node Mailing List -@section Mailing List -@cindex mailing list -@cindex RFC 2396 - -@kindex A M (summary) -@findex gnus-mailing-list-insinuate -Gnus understands some mailing list fields of RFC 2369. To enable it, -add a @code{to-list} group parameter (@pxref{Group Parameters}), -possibly using @kbd{A M} (@code{gnus-mailing-list-insinuate}) in the -summary buffer. - -That enables the following commands to the summary buffer: - -@table @kbd - -@item C-c C-n h -@kindex C-c C-n h (Summary) -@findex gnus-mailing-list-help -Send a message to fetch mailing list help, if List-Help field exists. - -@item C-c C-n s -@kindex C-c C-n s (Summary) -@findex gnus-mailing-list-subscribe -Send a message to subscribe the mailing list, if List-Subscribe field exists. - -@item C-c C-n u -@kindex C-c C-n u (Summary) -@findex gnus-mailing-list-unsubscribe -Send a message to unsubscribe the mailing list, if List-Unsubscribe -field exists. - -@item C-c C-n p -@kindex C-c C-n p (Summary) -@findex gnus-mailing-list-post -Post to the mailing list, if List-Post field exists. - -@item C-c C-n o -@kindex C-c C-n o (Summary) -@findex gnus-mailing-list-owner -Send a message to the mailing list owner, if List-Owner field exists. - -@item C-c C-n a -@kindex C-c C-n a (Summary) -@findex gnus-mailing-list-owner -Browse the mailing list archive, if List-Archive field exists. - -@end table - - -@node Article Buffer -@chapter Article Buffer -@cindex article buffer - -The articles are displayed in the article buffer, of which there is only -one. All the summary buffers share the same article buffer unless you -tell Gnus otherwise. - -@menu -* Hiding Headers:: Deciding what headers should be displayed. -* Using MIME:: Pushing articles through @acronym{MIME} before reading them. -* Customizing Articles:: Tailoring the look of the articles. -* Article Keymap:: Keystrokes available in the article buffer. -* Misc Article:: Other stuff. -@end menu - - -@node Hiding Headers -@section Hiding Headers -@cindex hiding headers -@cindex deleting headers - -The top section of each article is the @dfn{head}. (The rest is the -@dfn{body}, but you may have guessed that already.) - -@vindex gnus-show-all-headers -There is a lot of useful information in the head: the name of the person -who wrote the article, the date it was written and the subject of the -article. That's well and nice, but there's also lots of information -most people do not want to see---what systems the article has passed -through before reaching you, the @code{Message-ID}, the -@code{References}, etc. ad nauseam---and you'll probably want to get rid -of some of those lines. If you want to keep all those lines in the -article buffer, you can set @code{gnus-show-all-headers} to @code{t}. - -Gnus provides you with two variables for sifting headers: - -@table @code - -@item gnus-visible-headers -@vindex gnus-visible-headers -If this variable is non-@code{nil}, it should be a regular expression -that says what headers you wish to keep in the article buffer. All -headers that do not match this variable will be hidden. - -For instance, if you only want to see the name of the person who wrote -the article and the subject, you'd say: - -@lisp -(setq gnus-visible-headers "^From:\\|^Subject:") -@end lisp - -This variable can also be a list of regexps to match headers to -remain visible. - -@item gnus-ignored-headers -@vindex gnus-ignored-headers -This variable is the reverse of @code{gnus-visible-headers}. If this -variable is set (and @code{gnus-visible-headers} is @code{nil}), it -should be a regular expression that matches all lines that you want to -hide. All lines that do not match this variable will remain visible. - -For instance, if you just want to get rid of the @code{References} line -and the @code{Xref} line, you might say: - -@lisp -(setq gnus-ignored-headers "^References:\\|^Xref:") -@end lisp - -This variable can also be a list of regexps to match headers to -be removed. - -Note that if @code{gnus-visible-headers} is non-@code{nil}, this -variable will have no effect. - -@end table - -@vindex gnus-sorted-header-list -Gnus can also sort the headers for you. (It does this by default.) You -can control the sorting by setting the @code{gnus-sorted-header-list} -variable. It is a list of regular expressions that says in what order -the headers are to be displayed. - -For instance, if you want the name of the author of the article first, -and then the subject, you might say something like: - -@lisp -(setq gnus-sorted-header-list '("^From:" "^Subject:")) -@end lisp - -Any headers that are to remain visible, but are not listed in this -variable, will be displayed in random order after all the headers listed in this variable. - -@findex gnus-article-hide-boring-headers -@vindex gnus-boring-article-headers -You can hide further boring headers by setting -@code{gnus-treat-hide-boring-headers} to @code{head}. What this function -does depends on the @code{gnus-boring-article-headers} variable. It's a -list, but this list doesn't actually contain header names. Instead it -lists various @dfn{boring conditions} that Gnus can check and remove -from sight. - -These conditions are: -@table @code -@item empty -Remove all empty headers. -@item followup-to -Remove the @code{Followup-To} header if it is identical to the -@code{Newsgroups} header. -@item reply-to -Remove the @code{Reply-To} header if it lists the same addresses as -the @code{From} header, or if the @code{broken-reply-to} group -parameter is set. -@item newsgroups -Remove the @code{Newsgroups} header if it only contains the current group -name. -@item to-address -Remove the @code{To} header if it only contains the address identical to -the current group's @code{to-address} parameter. -@item to-list -Remove the @code{To} header if it only contains the address identical to -the current group's @code{to-list} parameter. -@item cc-list -Remove the @code{Cc} header if it only contains the address identical to -the current group's @code{to-list} parameter. -@item date -Remove the @code{Date} header if the article is less than three days -old. -@item long-to -Remove the @code{To} and/or @code{Cc} header if it is very long. -@item many-to -Remove all @code{To} and/or @code{Cc} headers if there are more than one. -@end table - -To include these three elements, you could say something like: - -@lisp -(setq gnus-boring-article-headers - '(empty followup-to reply-to)) -@end lisp - -This is also the default value for this variable. - - -@node Using MIME -@section Using MIME -@cindex @acronym{MIME} - -Mime is a standard for waving your hands through the air, aimlessly, -while people stand around yawning. - -@acronym{MIME}, however, is a standard for encoding your articles, aimlessly, -while all newsreaders die of fear. - -@acronym{MIME} may specify what character set the article uses, the encoding -of the characters, and it also makes it possible to embed pictures and -other naughty stuff in innocent-looking articles. - -@vindex gnus-display-mime-function -@findex gnus-display-mime -Gnus pushes @acronym{MIME} articles through @code{gnus-display-mime-function} -to display the @acronym{MIME} parts. This is @code{gnus-display-mime} by -default, which creates a bundle of clickable buttons that can be used to -display, save and manipulate the @acronym{MIME} objects. - -The following commands are available when you have placed point over a -@acronym{MIME} button: - -@table @kbd -@findex gnus-article-press-button -@item RET (Article) -@kindex RET (Article) -@itemx BUTTON-2 (Article) -Toggle displaying of the @acronym{MIME} object -(@code{gnus-article-press-button}). If built-in viewers can not display -the object, Gnus resorts to external viewers in the @file{mailcap} -files. If a viewer has the @samp{copiousoutput} specification, the -object is displayed inline. - -@findex gnus-mime-view-part -@item M-RET (Article) -@kindex M-RET (Article) -@itemx v (Article) -Prompt for a method, and then view the @acronym{MIME} object using this -method (@code{gnus-mime-view-part}). - -@findex gnus-mime-view-part-as-type -@item t (Article) -@kindex t (Article) -View the @acronym{MIME} object as if it were a different @acronym{MIME} media type -(@code{gnus-mime-view-part-as-type}). - -@findex gnus-mime-view-part-as-charset -@item C (Article) -@kindex C (Article) -Prompt for a charset, and then view the @acronym{MIME} object using this -charset (@code{gnus-mime-view-part-as-charset}). - -@findex gnus-mime-save-part -@item o (Article) -@kindex o (Article) -Prompt for a file name, and then save the @acronym{MIME} object -(@code{gnus-mime-save-part}). - -@findex gnus-mime-save-part-and-strip -@item C-o (Article) -@kindex C-o (Article) -Prompt for a file name, then save the @acronym{MIME} object and strip it from -the article. Then proceed to article editing, where a reasonable -suggestion is being made on how the altered article should look -like. The stripped @acronym{MIME} object will be referred via the -message/external-body @acronym{MIME} type. -(@code{gnus-mime-save-part-and-strip}). - -@findex gnus-mime-delete-part -@item d (Article) -@kindex d (Article) -Delete the @acronym{MIME} object from the article and replace it with some -information about the removed @acronym{MIME} object -(@code{gnus-mime-delete-part}). - -@findex gnus-mime-copy-part -@item c (Article) -@kindex c (Article) -Copy the @acronym{MIME} object to a fresh buffer and display this buffer -(@code{gnus-mime-copy-part}). Compressed files like @file{.gz} and -@file{.bz2} are automatically decompressed if -@code{auto-compression-mode} is enabled (@pxref{Compressed Files,, -Accessing Compressed Files, emacs, The Emacs Editor}). - -@findex gnus-mime-print-part -@item p (Article) -@kindex p (Article) -Print the @acronym{MIME} object (@code{gnus-mime-print-part}). This -command respects the @samp{print=} specifications in the -@file{.mailcap} file. - -@findex gnus-mime-inline-part -@item i (Article) -@kindex i (Article) -Insert the contents of the @acronym{MIME} object into the buffer -(@code{gnus-mime-inline-part}) as text/plain. If given a prefix, insert -the raw contents without decoding. If given a numerical prefix, you can -do semi-manual charset stuff (see -@code{gnus-summary-show-article-charset-alist} in @ref{Paging the -Article}). - -@findex gnus-mime-view-part-internally -@item E (Article) -@kindex E (Article) -View the @acronym{MIME} object with an internal viewer. If no internal -viewer is available, use an external viewer -(@code{gnus-mime-view-part-internally}). - -@findex gnus-mime-view-part-externally -@item e (Article) -@kindex e (Article) -View the @acronym{MIME} object with an external viewer. -(@code{gnus-mime-view-part-externally}). - -@findex gnus-mime-pipe-part -@item | (Article) -@kindex | (Article) -Output the @acronym{MIME} object to a process (@code{gnus-mime-pipe-part}). - -@findex gnus-mime-action-on-part -@item . (Article) -@kindex . (Article) -Interactively run an action on the @acronym{MIME} object -(@code{gnus-mime-action-on-part}). - -@end table - -Gnus will display some @acronym{MIME} objects automatically. The way Gnus -determines which parts to do this with is described in the Emacs -@acronym{MIME} manual. - -It might be best to just use the toggling functions from the article -buffer to avoid getting nasty surprises. (For instance, you enter the -group @samp{alt.sing-a-long} and, before you know it, @acronym{MIME} has -decoded the sound file in the article and some horrible sing-a-long song -comes screaming out your speakers, and you can't find the volume button, -because there isn't one, and people are starting to look at you, and you -try to stop the program, but you can't, and you can't find the program -to control the volume, and everybody else in the room suddenly decides -to look at you disdainfully, and you'll feel rather stupid.) - -Any similarity to real events and people is purely coincidental. Ahem. - -Also @pxref{MIME Commands}. - - -@node Customizing Articles -@section Customizing Articles -@cindex article customization - -A slew of functions for customizing how the articles are to look like -exist. You can call these functions interactively -(@pxref{Article Washing}), or you can have them -called automatically when you select the articles. - -To have them called automatically, you should set the corresponding -``treatment'' variable. For instance, to have headers hidden, you'd set -@code{gnus-treat-hide-headers}. Below is a list of variables that can -be set, but first we discuss the values these variables can have. - -Note: Some values, while valid, make little sense. Check the list below -for sensible values. - -@enumerate -@item -@code{nil}: Don't do this treatment. - -@item -@code{t}: Do this treatment on all body parts. - -@item -@code{head}: Do the treatment on the headers. - -@item -@code{last}: Do this treatment on the last part. - -@item -An integer: Do this treatment on all body parts that have a length less -than this number. - -@item -A list of strings: Do this treatment on all body parts that are in -articles that are read in groups that have names that match one of the -regexps in the list. - -@item -A list where the first element is not a string: - -The list is evaluated recursively. The first element of the list is a -predicate. The following predicates are recognized: @code{or}, -@code{and}, @code{not} and @code{typep}. Here's an example: - -@lisp -(or last - (typep "text/x-vcard")) -@end lisp - -@end enumerate - -You may have noticed that the word @dfn{part} is used here. This refers -to the fact that some messages are @acronym{MIME} multipart articles that may -be divided into several parts. Articles that are not multiparts are -considered to contain just a single part. - -@vindex gnus-article-treat-types -Are the treatments applied to all sorts of multipart parts? Yes, if you -want to, but by default, only @samp{text/plain} parts are given the -treatment. This is controlled by the @code{gnus-article-treat-types} -variable, which is a list of regular expressions that are matched to the -type of the part. This variable is ignored if the value of the -controlling variable is a predicate list, as described above. - -@ifinfo -@c Avoid sort of redundant entries in the same section for the printed -@c manual, but add them in info to allow `i gnus-treat-foo-bar RET' or -@c `i foo-bar'. -@vindex gnus-treat-buttonize -@vindex gnus-treat-buttonize-head -@vindex gnus-treat-capitalize-sentences -@vindex gnus-treat-overstrike -@vindex gnus-treat-strip-cr -@vindex gnus-treat-strip-headers-in-body -@vindex gnus-treat-strip-leading-blank-lines -@vindex gnus-treat-strip-multiple-blank-lines -@vindex gnus-treat-strip-pem -@vindex gnus-treat-strip-trailing-blank-lines -@vindex gnus-treat-unsplit-urls -@vindex gnus-treat-wash-html -@vindex gnus-treat-date-english -@vindex gnus-treat-date-iso8601 -@vindex gnus-treat-date-lapsed -@vindex gnus-treat-date-local -@vindex gnus-treat-date-original -@vindex gnus-treat-date-user-defined -@vindex gnus-treat-date-ut -@vindex gnus-treat-from-picon -@vindex gnus-treat-mail-picon -@vindex gnus-treat-newsgroups-picon -@vindex gnus-treat-display-smileys -@vindex gnus-treat-body-boundary -@vindex gnus-treat-display-x-face -@vindex gnus-treat-display-face -@vindex gnus-treat-emphasize -@vindex gnus-treat-fill-article -@vindex gnus-treat-fill-long-lines -@vindex gnus-treat-hide-boring-headers -@vindex gnus-treat-hide-citation -@vindex gnus-treat-hide-citation-maybe -@vindex gnus-treat-hide-headers -@vindex gnus-treat-hide-signature -@vindex gnus-treat-strip-banner -@vindex gnus-treat-strip-list-identifiers -@vindex gnus-treat-highlight-citation -@vindex gnus-treat-highlight-headers -@vindex gnus-treat-highlight-signature -@vindex gnus-treat-play-sounds -@vindex gnus-treat-translate -@vindex gnus-treat-x-pgp-sig -@vindex gnus-treat-unfold-headers -@vindex gnus-treat-fold-headers -@vindex gnus-treat-fold-newsgroups -@vindex gnus-treat-leading-whitespace -@end ifinfo - -The following treatment options are available. The easiest way to -customize this is to examine the @code{gnus-article-treat} customization -group. Values in parenthesis are suggested sensible values. Others are -possible but those listed are probably sufficient for most people. - -@table @code -@item gnus-treat-buttonize (t, integer) -@item gnus-treat-buttonize-head (head) - -@xref{Article Buttons}. - -@item gnus-treat-capitalize-sentences (t, integer) -@item gnus-treat-overstrike (t, integer) -@item gnus-treat-strip-cr (t, integer) -@item gnus-treat-strip-headers-in-body (t, integer) -@item gnus-treat-strip-leading-blank-lines (t, integer) -@item gnus-treat-strip-multiple-blank-lines (t, integer) -@item gnus-treat-strip-pem (t, last, integer) -@item gnus-treat-strip-trailing-blank-lines (t, last, integer) -@item gnus-treat-unsplit-urls (t, integer) -@item gnus-treat-wash-html (t, integer) - -@xref{Article Washing}. - -@item gnus-treat-date-english (head) -@item gnus-treat-date-iso8601 (head) -@item gnus-treat-date-lapsed (head) -@item gnus-treat-date-local (head) -@item gnus-treat-date-original (head) -@item gnus-treat-date-user-defined (head) -@item gnus-treat-date-ut (head) - -@xref{Article Date}. - -@item gnus-treat-from-picon (head) -@item gnus-treat-mail-picon (head) -@item gnus-treat-newsgroups-picon (head) - -@xref{Picons}. - -@item gnus-treat-display-smileys (t, integer) - -@item gnus-treat-body-boundary (head) - -@vindex gnus-body-boundary-delimiter -Adds a delimiter between header and body, the string used as delimiter -is controlled by @code{gnus-body-boundary-delimiter}. - -@xref{Smileys}. - -@vindex gnus-treat-display-x-face -@item gnus-treat-display-x-face (head) - -@xref{X-Face}. - -@vindex gnus-treat-display-face -@item gnus-treat-display-face (head) - -@xref{Face}. - -@vindex gnus-treat-emphasize -@item gnus-treat-emphasize (t, head, integer) -@vindex gnus-treat-fill-article -@item gnus-treat-fill-article (t, integer) -@vindex gnus-treat-fill-long-lines -@item gnus-treat-fill-long-lines (t, integer) -@vindex gnus-treat-hide-boring-headers -@item gnus-treat-hide-boring-headers (head) -@vindex gnus-treat-hide-citation -@item gnus-treat-hide-citation (t, integer) -@vindex gnus-treat-hide-citation-maybe -@item gnus-treat-hide-citation-maybe (t, integer) -@vindex gnus-treat-hide-headers -@item gnus-treat-hide-headers (head) -@vindex gnus-treat-hide-signature -@item gnus-treat-hide-signature (t, last) -@vindex gnus-treat-strip-banner -@item gnus-treat-strip-banner (t, last) -@vindex gnus-treat-strip-list-identifiers -@item gnus-treat-strip-list-identifiers (head) - -@xref{Article Hiding}. - -@vindex gnus-treat-highlight-citation -@item gnus-treat-highlight-citation (t, integer) -@vindex gnus-treat-highlight-headers -@item gnus-treat-highlight-headers (head) -@vindex gnus-treat-highlight-signature -@item gnus-treat-highlight-signature (t, last, integer) - -@xref{Article Highlighting}. - -@vindex gnus-treat-play-sounds -@item gnus-treat-play-sounds -@vindex gnus-treat-translate -@item gnus-treat-translate -@vindex gnus-treat-x-pgp-sig -@item gnus-treat-x-pgp-sig (head) - -@vindex gnus-treat-unfold-headers -@item gnus-treat-unfold-headers (head) -@vindex gnus-treat-fold-headers -@item gnus-treat-fold-headers (head) -@vindex gnus-treat-fold-newsgroups -@item gnus-treat-fold-newsgroups (head) -@vindex gnus-treat-leading-whitespace -@item gnus-treat-leading-whitespace (head) - -@xref{Article Header}. - - -@end table - -@vindex gnus-part-display-hook -You can, of course, write your own functions to be called from -@code{gnus-part-display-hook}. The functions are called narrowed to the -part, and you can do anything you like, pretty much. There is no -information that you have to keep in the buffer---you can change -everything. - - -@node Article Keymap -@section Article Keymap - -Most of the keystrokes in the summary buffer can also be used in the -article buffer. They should behave as if you typed them in the summary -buffer, which means that you don't actually have to have a summary -buffer displayed while reading. You can do it all from the article -buffer. - -@kindex v (Article) -@cindex keys, reserved for users (Article) -The key @kbd{v} is reserved for users. You can bind it to some -command or better use it as a prefix key. - -A few additional keystrokes are available: - -@table @kbd - -@item SPACE -@kindex SPACE (Article) -@findex gnus-article-next-page -Scroll forwards one page (@code{gnus-article-next-page}). -This is exactly the same as @kbd{h SPACE h}. - -@item DEL -@kindex DEL (Article) -@findex gnus-article-prev-page -Scroll backwards one page (@code{gnus-article-prev-page}). -This is exactly the same as @kbd{h DEL h}. - -@item C-c ^ -@kindex C-c ^ (Article) -@findex gnus-article-refer-article -If point is in the neighborhood of a @code{Message-ID} and you press -@kbd{C-c ^}, Gnus will try to get that article from the server -(@code{gnus-article-refer-article}). - -@item C-c C-m -@kindex C-c C-m (Article) -@findex gnus-article-mail -Send a reply to the address near point (@code{gnus-article-mail}). If -given a prefix, include the mail. - -@item s -@kindex s (Article) -@findex gnus-article-show-summary -Reconfigure the buffers so that the summary buffer becomes visible -(@code{gnus-article-show-summary}). - -@item ? -@kindex ? (Article) -@findex gnus-article-describe-briefly -Give a very brief description of the available keystrokes -(@code{gnus-article-describe-briefly}). - -@item TAB -@kindex TAB (Article) -@findex gnus-article-next-button -Go to the next button, if any (@code{gnus-article-next-button}). This -only makes sense if you have buttonizing turned on. - -@item M-TAB -@kindex M-TAB (Article) -@findex gnus-article-prev-button -Go to the previous button, if any (@code{gnus-article-prev-button}). - -@item R -@kindex R (Article) -@findex gnus-article-reply-with-original -Send a reply to the current article and yank the current article -(@code{gnus-article-reply-with-original}). If given a prefix, make a -wide reply. If the region is active, only yank the text in the -region. - -@item F -@kindex F (Article) -@findex gnus-article-followup-with-original -Send a followup to the current article and yank the current article -(@code{gnus-article-followup-with-original}). If given a prefix, make -a wide reply. If the region is active, only yank the text in the -region. - - -@end table - - -@node Misc Article -@section Misc Article - -@table @code - -@item gnus-single-article-buffer -@vindex gnus-single-article-buffer -@cindex article buffers, several -If non-@code{nil}, use the same article buffer for all the groups. -(This is the default.) If @code{nil}, each group will have its own -article buffer. - -@vindex gnus-article-decode-hook -@item gnus-article-decode-hook -@cindex @acronym{MIME} -Hook used to decode @acronym{MIME} articles. The default value is -@code{(article-decode-charset article-decode-encoded-words)} - -@vindex gnus-article-prepare-hook -@item gnus-article-prepare-hook -This hook is called right after the article has been inserted into the -article buffer. It is mainly intended for functions that do something -depending on the contents; it should probably not be used for changing -the contents of the article buffer. - -@item gnus-article-mode-hook -@vindex gnus-article-mode-hook -Hook called in article mode buffers. - -@item gnus-article-mode-syntax-table -@vindex gnus-article-mode-syntax-table -Syntax table used in article buffers. It is initialized from -@code{text-mode-syntax-table}. - -@vindex gnus-article-over-scroll -@item gnus-article-over-scroll -If non-@code{nil}, allow scrolling the article buffer even when there -no more new text to scroll in. The default is @code{nil}. - -@vindex gnus-article-mode-line-format -@item gnus-article-mode-line-format -This variable is a format string along the same lines as -@code{gnus-summary-mode-line-format} (@pxref{Summary Buffer Mode -Line}). It accepts the same format specifications as that variable, -with two extensions: - -@table @samp - -@item w -The @dfn{wash status} of the article. This is a short string with one -character for each possible article wash operation that may have been -performed. The characters and their meaning: - -@table @samp - -@item c -Displayed when cited text may be hidden in the article buffer. - -@item h -Displayed when headers are hidden in the article buffer. - -@item p -Displayed when article is digitally signed or encrypted, and Gnus has -hidden the security headers. (N.B. does not tell anything about -security status, i.e. good or bad signature.) - -@item s -Displayed when the signature has been hidden in the Article buffer. - -@item o -Displayed when Gnus has treated overstrike characters in the article buffer. - -@item e -Displayed when Gnus has treated emphasised strings in the article buffer. - -@end table - -@item m -The number of @acronym{MIME} parts in the article. - -@end table - -@vindex gnus-break-pages - -@item gnus-break-pages -Controls whether @dfn{page breaking} is to take place. If this variable -is non-@code{nil}, the articles will be divided into pages whenever a -page delimiter appears in the article. If this variable is @code{nil}, -paging will not be done. - -@item gnus-page-delimiter -@vindex gnus-page-delimiter -This is the delimiter mentioned above. By default, it is @samp{^L} -(formfeed). - -@cindex IDNA -@cindex internationalized domain names -@vindex gnus-use-idna -@item gnus-use-idna -This variable controls whether Gnus performs IDNA decoding of -internationalized domain names inside @samp{From}, @samp{To} and -@samp{Cc} headers. This requires -@uref{http://www.gnu.org/software/libidn/, GNU Libidn}, and this -variable is only enabled if you have installed it. - -@end table - - -@node Composing Messages -@chapter Composing Messages -@cindex composing messages -@cindex messages -@cindex mail -@cindex sending mail -@cindex reply -@cindex followup -@cindex post -@cindex using gpg -@cindex using s/mime -@cindex using smime - -@kindex C-c C-c (Post) -All commands for posting and mailing will put you in a message buffer -where you can edit the article all you like, before you send the -article by pressing @kbd{C-c C-c}. @xref{Top, , Overview, message, -Message Manual}. Where the message will be posted/mailed to depends -on your setup (@pxref{Posting Server}). - -@menu -* Mail:: Mailing and replying. -* Posting Server:: What server should you post and mail via? -* POP before SMTP:: You cannot send a mail unless you read a mail. -* Mail and Post:: Mailing and posting at the same time. -* Archived Messages:: Where Gnus stores the messages you've sent. -* Posting Styles:: An easier way to specify who you are. -* Drafts:: Postponing messages and rejected messages. -* Rejected Articles:: What happens if the server doesn't like your article? -* Signing and encrypting:: How to compose secure messages. -@end menu - -Also @pxref{Canceling and Superseding} for information on how to -remove articles you shouldn't have posted. - - -@node Mail -@section Mail - -Variables for customizing outgoing mail: - -@table @code -@item gnus-uu-digest-headers -@vindex gnus-uu-digest-headers -List of regexps to match headers included in digested messages. The -headers will be included in the sequence they are matched. If -@code{nil} include all headers. - -@item gnus-add-to-list -@vindex gnus-add-to-list -If non-@code{nil}, add a @code{to-list} group parameter to mail groups -that have none when you do a @kbd{a}. - -@item gnus-confirm-mail-reply-to-news -@vindex gnus-confirm-mail-reply-to-news -If non-@code{nil}, Gnus will ask you for a confirmation when you are -about to reply to news articles by mail. If it is @code{nil}, nothing -interferes in what you want to do. This can also be a function -receiving the group name as the only parameter which should return -non-@code{nil} if a confirmation is needed, or a regular expression -matching group names, where confirmation should be asked for. - -If you find yourself never wanting to reply to mail, but occasionally -press @kbd{R} anyway, this variable might be for you. - -@item gnus-confirm-treat-mail-like-news -@vindex gnus-confirm-treat-mail-like-news -If non-@code{nil}, Gnus also requests confirmation according to -@code{gnus-confirm-mail-reply-to-news} when replying to mail. This is -useful for treating mailing lists like newsgroups. - -@end table - - -@node Posting Server -@section Posting Server - -When you press those magical @kbd{C-c C-c} keys to ship off your latest -(extremely intelligent, of course) article, where does it go? - -Thank you for asking. I hate you. - -It can be quite complicated. - -@vindex gnus-post-method -When posting news, Message usually invokes @code{message-send-news} -(@pxref{News Variables, , News Variables, message, Message Manual}). -Normally, Gnus will post using the same select method as you're -reading from (which might be convenient if you're reading lots of -groups from different private servers). However. If the server -you're reading from doesn't allow posting, just reading, you probably -want to use some other server to post your (extremely intelligent and -fabulously interesting) articles. You can then set the -@code{gnus-post-method} to some other method: - -@lisp -(setq gnus-post-method '(nnspool "")) -@end lisp - -Now, if you've done this, and then this server rejects your article, or -this server is down, what do you do then? To override this variable you -can use a non-zero prefix to the @kbd{C-c C-c} command to force using -the ``current'' server, to get back the default behavior, for posting. - -If you give a zero prefix (i.e., @kbd{C-u 0 C-c C-c}) to that command, -Gnus will prompt you for what method to use for posting. - -You can also set @code{gnus-post-method} to a list of select methods. -If that's the case, Gnus will always prompt you for what method to use -for posting. - -Finally, if you want to always post using the native select method, -you can set this variable to @code{native}. - -When sending mail, Message invokes @code{message-send-mail-function}. -The default function, @code{message-send-mail-with-sendmail}, pipes -your article to the @code{sendmail} binary for further queuing and -sending. When your local system is not configured for sending mail -using @code{sendmail}, and you have access to a remote @acronym{SMTP} -server, you can set @code{message-send-mail-function} to -@code{smtpmail-send-it} and make sure to setup the @code{smtpmail} -package correctly. An example: - -@lisp -(setq message-send-mail-function 'smtpmail-send-it - smtpmail-default-smtp-server "YOUR SMTP HOST") -@end lisp - -To the thing similar to this, there is -@code{message-smtpmail-send-it}. It is useful if your @acronym{ISP} -requires the @acronym{POP}-before-@acronym{SMTP} authentication. -@xref{POP before SMTP}. - -Other possible choices for @code{message-send-mail-function} includes -@code{message-send-mail-with-mh}, @code{message-send-mail-with-qmail}, -and @code{feedmail-send-it}. - -@node POP before SMTP -@section POP before SMTP -@cindex pop before smtp -@findex message-smtpmail-send-it -@findex mail-source-touch-pop - -Does your @acronym{ISP} require the @acronym{POP}-before-@acronym{SMTP} -authentication? It is whether you need to connect to the @acronym{POP} -mail server within a certain time before sending mails. If so, there is -a convenient way. To do that, put the following lines in your -@file{~/.gnus.el} file: - -@lisp -(setq message-send-mail-function 'message-smtpmail-send-it) -(add-hook 'message-send-mail-hook 'mail-source-touch-pop) -@end lisp - -@noindent -It means to let Gnus connect to the @acronym{POP} mail server in advance -whenever you send a mail. The @code{mail-source-touch-pop} function -does only a @acronym{POP} authentication according to the value of -@code{mail-sources} without fetching mails, just before sending a mail. -Note that you have to use @code{message-smtpmail-send-it} which runs -@code{message-send-mail-hook} rather than @code{smtpmail-send-it} and -set the value of @code{mail-sources} for a @acronym{POP} connection -correctly. @xref{Mail Sources}. - -If you have two or more @acronym{POP} mail servers set in -@code{mail-sources}, you may want to specify one of them to -@code{mail-source-primary-source} as the @acronym{POP} mail server to be -used for the @acronym{POP}-before-@acronym{SMTP} authentication. If it -is your primary @acronym{POP} mail server (i.e., you are fetching mails -mainly from that server), you can set it permanently as follows: - -@lisp -(setq mail-source-primary-source - '(pop :server "pop3.mail.server" - :password "secret")) -@end lisp - -@noindent -Otherwise, bind it dynamically only when performing the -@acronym{POP}-before-@acronym{SMTP} authentication as follows: - -@lisp -(add-hook 'message-send-mail-hook - (lambda () - (let ((mail-source-primary-source - '(pop :server "pop3.mail.server" - :password "secret"))) - (mail-source-touch-pop)))) -@end lisp - -@node Mail and Post -@section Mail and Post - -Here's a list of variables relevant to both mailing and -posting: - -@table @code -@item gnus-mailing-list-groups -@findex gnus-mailing-list-groups -@cindex mailing lists - -If your news server offers groups that are really mailing lists -gatewayed to the @acronym{NNTP} server, you can read those groups without -problems, but you can't post/followup to them without some difficulty. -One solution is to add a @code{to-address} to the group parameters -(@pxref{Group Parameters}). An easier thing to do is set the -@code{gnus-mailing-list-groups} to a regexp that matches the groups that -really are mailing lists. Then, at least, followups to the mailing -lists will work most of the time. Posting to these groups (@kbd{a}) is -still a pain, though. - -@item gnus-user-agent -@vindex gnus-user-agent -@cindex User-Agent - -This variable controls which information should be exposed in the -User-Agent header. It can be a list of symbols or a string. Valid -symbols are @code{gnus} (show Gnus version) and @code{emacs} (show Emacs -version). In addition to the Emacs version, you can add @code{codename} -(show (S)XEmacs codename) or either @code{config} (show system -configuration) or @code{type} (show system type). If you set it to a -string, be sure to use a valid format, see RFC 2616. - -@end table - -You may want to do spell-checking on messages that you send out. Or, if -you don't want to spell-check by hand, you could add automatic -spell-checking via the @code{ispell} package: - -@cindex ispell -@findex ispell-message -@lisp -(add-hook 'message-send-hook 'ispell-message) -@end lisp - -If you want to change the @code{ispell} dictionary based on what group -you're in, you could say something like the following: - -@lisp -(add-hook 'gnus-select-group-hook - (lambda () - (cond - ((string-match - "^de\\." (gnus-group-real-name gnus-newsgroup-name)) - (ispell-change-dictionary "deutsch")) - (t - (ispell-change-dictionary "english"))))) -@end lisp - -Modify to suit your needs. - - -@node Archived Messages -@section Archived Messages -@cindex archived messages -@cindex sent messages - -Gnus provides a few different methods for storing the mail and news you -send. The default method is to use the @dfn{archive virtual server} to -store the messages. If you want to disable this completely, the -@code{gnus-message-archive-group} variable should be @code{nil}, which -is the default. - -For archiving interesting messages in a group you read, see the -@kbd{B c} (@code{gnus-summary-copy-article}) command (@pxref{Mail -Group Commands}). - -@vindex gnus-message-archive-method -@code{gnus-message-archive-method} says what virtual server Gnus is to -use to store sent messages. The default is: - -@lisp -(nnfolder "archive" - (nnfolder-directory "~/Mail/archive") - (nnfolder-active-file "~/Mail/archive/active") - (nnfolder-get-new-mail nil) - (nnfolder-inhibit-expiry t)) -@end lisp - -You can, however, use any mail select method (@code{nnml}, -@code{nnmbox}, etc.). @code{nnfolder} is a quite likable select method -for doing this sort of thing, though. If you don't like the default -directory chosen, you could say something like: - -@lisp -(setq gnus-message-archive-method - '(nnfolder "archive" - (nnfolder-inhibit-expiry t) - (nnfolder-active-file "~/News/sent-mail/active") - (nnfolder-directory "~/News/sent-mail/"))) -@end lisp - -@vindex gnus-message-archive-group -@cindex Gcc -Gnus will insert @code{Gcc} headers in all outgoing messages that point -to one or more group(s) on that server. Which group to use is -determined by the @code{gnus-message-archive-group} variable. - -This variable can be used to do the following: - -@table @asis -@item a string -Messages will be saved in that group. - -Note that you can include a select method in the group name, then the -message will not be stored in the select method given by -@code{gnus-message-archive-method}, but in the select method specified -by the group name, instead. Suppose @code{gnus-message-archive-method} -has the default value shown above. Then setting -@code{gnus-message-archive-group} to @code{"foo"} means that outgoing -messages are stored in @samp{nnfolder+archive:foo}, but if you use the -value @code{"nnml:foo"}, then outgoing messages will be stored in -@samp{nnml:foo}. - -@item a list of strings -Messages will be saved in all those groups. - -@item an alist of regexps, functions and forms -When a key ``matches'', the result is used. - -@item @code{nil} -No message archiving will take place. This is the default. -@end table - -Let's illustrate: - -Just saving to a single group called @samp{MisK}: -@lisp -(setq gnus-message-archive-group "MisK") -@end lisp - -Saving to two groups, @samp{MisK} and @samp{safe}: -@lisp -(setq gnus-message-archive-group '("MisK" "safe")) -@end lisp - -Save to different groups based on what group you are in: -@lisp -(setq gnus-message-archive-group - '(("^alt" "sent-to-alt") - ("mail" "sent-to-mail") - (".*" "sent-to-misc"))) -@end lisp - -More complex stuff: -@lisp -(setq gnus-message-archive-group - '((if (message-news-p) - "misc-news" - "misc-mail"))) -@end lisp - -How about storing all news messages in one file, but storing all mail -messages in one file per month: - -@lisp -(setq gnus-message-archive-group - '((if (message-news-p) - "misc-news" - (concat "mail." (format-time-string "%Y-%m"))))) -@end lisp - -@c (XEmacs 19.13 doesn't have @code{format-time-string}, so you'll have to -@c use a different value for @code{gnus-message-archive-group} there.) - -Now, when you send a message off, it will be stored in the appropriate -group. (If you want to disable storing for just one particular message, -you can just remove the @code{Gcc} header that has been inserted.) The -archive group will appear in the group buffer the next time you start -Gnus, or the next time you press @kbd{F} in the group buffer. You can -enter it and read the articles in it just like you'd read any other -group. If the group gets really big and annoying, you can simply rename -if (using @kbd{G r} in the group buffer) to something -nice---@samp{misc-mail-september-1995}, or whatever. New messages will -continue to be stored in the old (now empty) group. - -That's the default method of archiving sent messages. Gnus offers a -different way for the people who don't like the default method. In that -case you should set @code{gnus-message-archive-group} to @code{nil}; -this will disable archiving. - -@table @code -@item gnus-outgoing-message-group -@vindex gnus-outgoing-message-group -All outgoing messages will be put in this group. If you want to store -all your outgoing mail and articles in the group @samp{nnml:archive}, -you set this variable to that value. This variable can also be a list of -group names. - -If you want to have greater control over what group to put each -message in, you can set this variable to a function that checks the -current newsgroup name and then returns a suitable group name (or list -of names). - -This variable can be used instead of @code{gnus-message-archive-group}, -but the latter is the preferred method. - -@item gnus-gcc-mark-as-read -@vindex gnus-gcc-mark-as-read -If non-@code{nil}, automatically mark @code{Gcc} articles as read. - -@item gnus-gcc-externalize-attachments -@vindex gnus-gcc-externalize-attachments -If @code{nil}, attach files as normal parts in Gcc copies; if a regexp -and matches the Gcc group name, attach files as external parts; if it is -@code{all}, attach local files as external parts; if it is other -non-@code{nil}, the behavior is the same as @code{all}, but it may be -changed in the future. - -@end table - - -@node Posting Styles -@section Posting Styles -@cindex posting styles -@cindex styles - -All them variables, they make my head swim. - -So what if you want a different @code{Organization} and signature based -on what groups you post to? And you post both from your home machine -and your work machine, and you want different @code{From} lines, and so -on? - -@vindex gnus-posting-styles -One way to do stuff like that is to write clever hooks that change the -variables you need to have changed. That's a bit boring, so somebody -came up with the bright idea of letting the user specify these things in -a handy alist. Here's an example of a @code{gnus-posting-styles} -variable: - -@lisp -((".*" - (signature "Peace and happiness") - (organization "What me?")) - ("^comp" - (signature "Death to everybody")) - ("comp.emacs.i-love-it" - (organization "Emacs is it"))) -@end lisp - -As you might surmise from this example, this alist consists of several -@dfn{styles}. Each style will be applicable if the first element -``matches'', in some form or other. The entire alist will be iterated -over, from the beginning towards the end, and each match will be -applied, which means that attributes in later styles that match override -the same attributes in earlier matching styles. So -@samp{comp.programming.literate} will have the @samp{Death to everybody} -signature and the @samp{What me?} @code{Organization} header. - -The first element in each style is called the @code{match}. If it's a -string, then Gnus will try to regexp match it against the group name. -If it is the form @code{(header @var{match} @var{regexp})}, then Gnus -will look in the original article for a header whose name is -@var{match} and compare that @var{regexp}. @var{match} and -@var{regexp} are strings. (The original article is the one you are -replying or following up to. If you are not composing a reply or a -followup, then there is nothing to match against.) If the -@code{match} is a function symbol, that function will be called with -no arguments. If it's a variable symbol, then the variable will be -referenced. If it's a list, then that list will be @code{eval}ed. In -any case, if this returns a non-@code{nil} value, then the style is -said to @dfn{match}. - -Each style may contain an arbitrary amount of @dfn{attributes}. Each -attribute consists of a @code{(@var{name} @var{value})} pair. In -addition, you can also use the @code{(@var{name} :file @var{value})} -form or the @code{(@var{name} :value @var{value})} form. Where -@code{:file} signifies @var{value} represents a file name and its -contents should be used as the attribute value, @code{:value} signifies -@var{value} does not represent a file name explicitly. The attribute -name can be one of: - -@itemize @bullet -@item @code{signature} -@item @code{signature-file} -@item @code{x-face-file} -@item @code{address}, overriding @code{user-mail-address} -@item @code{name}, overriding @code{(user-full-name)} -@item @code{body} -@end itemize - -The attribute name can also be a string or a symbol. In that case, -this will be used as a header name, and the value will be inserted in -the headers of the article; if the value is @code{nil}, the header -name will be removed. If the attribute name is @code{eval}, the form -is evaluated, and the result is thrown away. - -The attribute value can be a string (used verbatim), a function with -zero arguments (the return value will be used), a variable (its value -will be used) or a list (it will be @code{eval}ed and the return value -will be used). The functions and sexps are called/@code{eval}ed in the -message buffer that is being set up. The headers of the current article -are available through the @code{message-reply-headers} variable, which -is a vector of the following headers: number subject from date id -references chars lines xref extra. - -@vindex message-reply-headers - -If you wish to check whether the message you are about to compose is -meant to be a news article or a mail message, you can check the values -of the @code{message-news-p} and @code{message-mail-p} functions. - -@findex message-mail-p -@findex message-news-p - -So here's a new example: - -@lisp -(setq gnus-posting-styles - '((".*" - (signature-file "~/.signature") - (name "User Name") - (x-face-file "~/.xface") - (x-url (getenv "WWW_HOME")) - (organization "People's Front Against MWM")) - ("^rec.humor" - (signature my-funny-signature-randomizer)) - ((equal (system-name) "gnarly") ;; @r{A form} - (signature my-quote-randomizer)) - (message-news-p ;; @r{A function symbol} - (signature my-news-signature)) - (window-system ;; @r{A value symbol} - ("X-Window-System" (format "%s" window-system))) - ;; @r{If I'm replying to Larsi, set the Organization header.} - ((header "from" "larsi.*org") - (Organization "Somewhere, Inc.")) - ((posting-from-work-p) ;; @r{A user defined function} - (signature-file "~/.work-signature") - (address "user@@bar.foo") - (body "You are fired.\n\nSincerely, your boss.") - (organization "Important Work, Inc")) - ("nnml:.*" - (From (save-excursion - (set-buffer gnus-article-buffer) - (message-fetch-field "to")))) - ("^nn.+:" - (signature-file "~/.mail-signature")))) -@end lisp - -The @samp{nnml:.*} rule means that you use the @code{To} address as the -@code{From} address in all your outgoing replies, which might be handy -if you fill many roles. -You may also use @code{message-alternative-emails} instead. -@xref{Message Headers, ,Message Headers, message, Message Manual}. - -@node Drafts -@section Drafts -@cindex drafts - -If you are writing a message (mail or news) and suddenly remember that -you have a steak in the oven (or some pesto in the food processor, you -craaazy vegetarians), you'll probably wish there was a method to save -the message you are writing so that you can continue editing it some -other day, and send it when you feel its finished. - -Well, don't worry about it. Whenever you start composing a message of -some sort using the Gnus mail and post commands, the buffer you get will -automatically associate to an article in a special @dfn{draft} group. -If you save the buffer the normal way (@kbd{C-x C-s}, for instance), the -article will be saved there. (Auto-save files also go to the draft -group.) - -@cindex nndraft -@vindex nndraft-directory -The draft group is a special group (which is implemented as an -@code{nndraft} group, if you absolutely have to know) called -@samp{nndraft:drafts}. The variable @code{nndraft-directory} says where -@code{nndraft} is to store its files. What makes this group special is -that you can't tick any articles in it or mark any articles as -read---all articles in the group are permanently unread. - -If the group doesn't exist, it will be created and you'll be subscribed -to it. The only way to make it disappear from the Group buffer is to -unsubscribe it. The special properties of the draft group comes from -a group property (@pxref{Group Parameters}), and if lost the group -behaves like any other group. This means the commands below will not -be available. To restore the special properties of the group, the -simplest way is to kill the group, using @kbd{C-k}, and restart -Gnus. The group is automatically created again with the -correct parameters. The content of the group is not lost. - -@c @findex gnus-dissociate-buffer-from-draft -@c @kindex C-c M-d (Mail) -@c @kindex C-c M-d (Post) -@c @findex gnus-associate-buffer-with-draft -@c @kindex C-c C-d (Mail) -@c @kindex C-c C-d (Post) -@c If you're writing some super-secret message that you later want to -@c encode with PGP before sending, you may wish to turn the auto-saving -@c (and association with the draft group) off. You never know who might be -@c interested in reading all your extremely valuable and terribly horrible -@c and interesting secrets. The @kbd{C-c M-d} -@c (@code{gnus-dissociate-buffer-from-draft}) command does that for you. -@c If you change your mind and want to turn the auto-saving back on again, -@c @kbd{C-c C-d} (@code{gnus-associate-buffer-with-draft} does that. -@c -@c @vindex gnus-use-draft -@c To leave association with the draft group off by default, set -@c @code{gnus-use-draft} to @code{nil}. It is @code{t} by default. - -@findex gnus-draft-edit-message -@kindex D e (Draft) -When you want to continue editing the article, you simply enter the -draft group and push @kbd{D e} (@code{gnus-draft-edit-message}) to do -that. You will be placed in a buffer where you left off. - -Rejected articles will also be put in this draft group (@pxref{Rejected -Articles}). - -@findex gnus-draft-send-all-messages -@kindex D s (Draft) -@findex gnus-draft-send-message -@kindex D S (Draft) -If you have lots of rejected messages you want to post (or mail) without -doing further editing, you can use the @kbd{D s} command -(@code{gnus-draft-send-message}). This command understands the -process/prefix convention (@pxref{Process/Prefix}). The @kbd{D S} -command (@code{gnus-draft-send-all-messages}) will ship off all messages -in the buffer. - -@findex gnus-draft-toggle-sending -@kindex D t (Draft) -If you have some messages that you wish not to send, you can use the -@kbd{D t} (@code{gnus-draft-toggle-sending}) command to mark the message -as unsendable. This is a toggling command. - - -@node Rejected Articles -@section Rejected Articles -@cindex rejected articles - -Sometimes a news server will reject an article. Perhaps the server -doesn't like your face. Perhaps it just feels miserable. Perhaps -@emph{there be demons}. Perhaps you have included too much cited text. -Perhaps the disk is full. Perhaps the server is down. - -These situations are, of course, totally beyond the control of Gnus. -(Gnus, of course, loves the way you look, always feels great, has angels -fluttering around inside of it, doesn't care about how much cited text -you include, never runs full and never goes down.) So Gnus saves these -articles until some later time when the server feels better. - -The rejected articles will automatically be put in a special draft group -(@pxref{Drafts}). When the server comes back up again, you'd then -typically enter that group and send all the articles off. - -@node Signing and encrypting -@section Signing and encrypting -@cindex using gpg -@cindex using s/mime -@cindex using smime - -Gnus can digitally sign and encrypt your messages, using vanilla -@acronym{PGP} format or @acronym{PGP/MIME} or @acronym{S/MIME}. For -decoding such messages, see the @code{mm-verify-option} and -@code{mm-decrypt-option} options (@pxref{Security}). - -@vindex gnus-message-replysign -@vindex gnus-message-replyencrypt -@vindex gnus-message-replysignencrypted -Often, you would like to sign replies to people who send you signed -messages. Even more often, you might want to encrypt messages which -are in reply to encrypted messages. Gnus offers -@code{gnus-message-replysign} to enable the former, and -@code{gnus-message-replyencrypt} for the latter. In addition, setting -@code{gnus-message-replysignencrypted} (on by default) will sign -automatically encrypted messages. - -Instructing @acronym{MML} to perform security operations on a -@acronym{MIME} part is done using the @kbd{C-c C-m s} key map for -signing and the @kbd{C-c C-m c} key map for encryption, as follows. - -@table @kbd - -@item C-c C-m s s -@kindex C-c C-m s s (Message) -@findex mml-secure-message-sign-smime - -Digitally sign current message using @acronym{S/MIME}. - -@item C-c C-m s o -@kindex C-c C-m s o (Message) -@findex mml-secure-message-sign-pgp - -Digitally sign current message using @acronym{PGP}. - -@item C-c C-m s p -@kindex C-c C-m s p (Message) -@findex mml-secure-message-sign-pgp - -Digitally sign current message using @acronym{PGP/MIME}. - -@item C-c C-m c s -@kindex C-c C-m c s (Message) -@findex mml-secure-message-encrypt-smime - -Digitally encrypt current message using @acronym{S/MIME}. - -@item C-c C-m c o -@kindex C-c C-m c o (Message) -@findex mml-secure-message-encrypt-pgp - -Digitally encrypt current message using @acronym{PGP}. - -@item C-c C-m c p -@kindex C-c C-m c p (Message) -@findex mml-secure-message-encrypt-pgpmime - -Digitally encrypt current message using @acronym{PGP/MIME}. - -@item C-c C-m C-n -@kindex C-c C-m C-n (Message) -@findex mml-unsecure-message -Remove security related @acronym{MML} tags from message. - -@end table - -@xref{Security, ,Security, message, Message Manual}, for more information. - -@node Select Methods -@chapter Select Methods -@cindex foreign groups -@cindex select methods - -A @dfn{foreign group} is a group not read by the usual (or -default) means. It could be, for instance, a group from a different -@acronym{NNTP} server, it could be a virtual group, or it could be your own -personal mail group. - -A foreign group (or any group, really) is specified by a @dfn{name} and -a @dfn{select method}. To take the latter first, a select method is a -list where the first element says what back end to use (e.g. @code{nntp}, -@code{nnspool}, @code{nnml}) and the second element is the @dfn{server -name}. There may be additional elements in the select method, where the -value may have special meaning for the back end in question. - -One could say that a select method defines a @dfn{virtual server}---so -we do just that (@pxref{Server Buffer}). - -The @dfn{name} of the group is the name the back end will recognize the -group as. - -For instance, the group @samp{soc.motss} on the @acronym{NNTP} server -@samp{some.where.edu} will have the name @samp{soc.motss} and select -method @code{(nntp "some.where.edu")}. Gnus will call this group -@samp{nntp+some.where.edu:soc.motss}, even though the @code{nntp} -back end just knows this group as @samp{soc.motss}. - -The different methods all have their peculiarities, of course. - -@menu -* Server Buffer:: Making and editing virtual servers. -* Getting News:: Reading USENET news with Gnus. -* Getting Mail:: Reading your personal mail with Gnus. -* Browsing the Web:: Getting messages from a plethora of Web sources. -* IMAP:: Using Gnus as a @acronym{IMAP} client. -* Other Sources:: Reading directories, files, SOUP packets. -* Combined Groups:: Combining groups into one group. -* Email Based Diary:: Using mails to manage diary events in Gnus. -* Gnus Unplugged:: Reading news and mail offline. -@end menu - - -@node Server Buffer -@section Server Buffer - -Traditionally, a @dfn{server} is a machine or a piece of software that -one connects to, and then requests information from. Gnus does not -connect directly to any real servers, but does all transactions through -one back end or other. But that's just putting one layer more between -the actual media and Gnus, so we might just as well say that each -back end represents a virtual server. - -For instance, the @code{nntp} back end may be used to connect to several -different actual @acronym{NNTP} servers, or, perhaps, to many different ports -on the same actual @acronym{NNTP} server. You tell Gnus which back end to -use, and what parameters to set by specifying a @dfn{select method}. - -These select method specifications can sometimes become quite -complicated---say, for instance, that you want to read from the -@acronym{NNTP} server @samp{news.funet.fi} on port number 13, which -hangs if queried for @acronym{NOV} headers and has a buggy select. Ahem. -Anyway, if you had to specify that for each group that used this -server, that would be too much work, so Gnus offers a way of naming -select methods, which is what you do in the server buffer. - -To enter the server buffer, use the @kbd{^} -(@code{gnus-group-enter-server-mode}) command in the group buffer. - -@menu -* Server Buffer Format:: You can customize the look of this buffer. -* Server Commands:: Commands to manipulate servers. -* Example Methods:: Examples server specifications. -* Creating a Virtual Server:: An example session. -* Server Variables:: Which variables to set. -* Servers and Methods:: You can use server names as select methods. -* Unavailable Servers:: Some servers you try to contact may be down. -@end menu - -@vindex gnus-server-mode-hook -@code{gnus-server-mode-hook} is run when creating the server buffer. - - -@node Server Buffer Format -@subsection Server Buffer Format -@cindex server buffer format - -@vindex gnus-server-line-format -You can change the look of the server buffer lines by changing the -@code{gnus-server-line-format} variable. This is a @code{format}-like -variable, with some simple extensions: - -@table @samp - -@item h -How the news is fetched---the back end name. - -@item n -The name of this server. - -@item w -Where the news is to be fetched from---the address. - -@item s -The opened/closed/denied status of the server. - -@item a -Whether this server is agentized. -@end table - -@vindex gnus-server-mode-line-format -The mode line can also be customized by using the -@code{gnus-server-mode-line-format} variable (@pxref{Mode Line -Formatting}). The following specs are understood: - -@table @samp -@item S -Server name. - -@item M -Server method. -@end table - -Also @pxref{Formatting Variables}. - - -@node Server Commands -@subsection Server Commands -@cindex server commands - -@table @kbd - -@item v -@kindex v (Server) -@cindex keys, reserved for users (Server) -The key @kbd{v} is reserved for users. You can bind it to some -command or better use it as a prefix key. - -@item a -@kindex a (Server) -@findex gnus-server-add-server -Add a new server (@code{gnus-server-add-server}). - -@item e -@kindex e (Server) -@findex gnus-server-edit-server -Edit a server (@code{gnus-server-edit-server}). - -@item SPACE -@kindex SPACE (Server) -@findex gnus-server-read-server -Browse the current server (@code{gnus-server-read-server}). - -@item q -@kindex q (Server) -@findex gnus-server-exit -Return to the group buffer (@code{gnus-server-exit}). - -@item k -@kindex k (Server) -@findex gnus-server-kill-server -Kill the current server (@code{gnus-server-kill-server}). - -@item y -@kindex y (Server) -@findex gnus-server-yank-server -Yank the previously killed server (@code{gnus-server-yank-server}). - -@item c -@kindex c (Server) -@findex gnus-server-copy-server -Copy the current server (@code{gnus-server-copy-server}). - -@item l -@kindex l (Server) -@findex gnus-server-list-servers -List all servers (@code{gnus-server-list-servers}). - -@item s -@kindex s (Server) -@findex gnus-server-scan-server -Request that the server scan its sources for new articles -(@code{gnus-server-scan-server}). This is mainly sensible with mail -servers. - -@item g -@kindex g (Server) -@findex gnus-server-regenerate-server -Request that the server regenerate all its data structures -(@code{gnus-server-regenerate-server}). This can be useful if you have -a mail back end that has gotten out of sync. - -@end table - - -@node Example Methods -@subsection Example Methods - -Most select methods are pretty simple and self-explanatory: - -@lisp -(nntp "news.funet.fi") -@end lisp - -Reading directly from the spool is even simpler: - -@lisp -(nnspool "") -@end lisp - -As you can see, the first element in a select method is the name of the -back end, and the second is the @dfn{address}, or @dfn{name}, if you -will. - -After these two elements, there may be an arbitrary number of -@code{(@var{variable} @var{form})} pairs. - -To go back to the first example---imagine that you want to read from -port 15 on that machine. This is what the select method should -look like then: - -@lisp -(nntp "news.funet.fi" (nntp-port-number 15)) -@end lisp - -You should read the documentation to each back end to find out what -variables are relevant, but here's an @code{nnmh} example: - -@code{nnmh} is a mail back end that reads a spool-like structure. Say -you have two structures that you wish to access: One is your private -mail spool, and the other is a public one. Here's the possible spec for -your private mail: - -@lisp -(nnmh "private" (nnmh-directory "~/private/mail/")) -@end lisp - -(This server is then called @samp{private}, but you may have guessed -that.) - -Here's the method for a public spool: - -@lisp -(nnmh "public" - (nnmh-directory "/usr/information/spool/") - (nnmh-get-new-mail nil)) -@end lisp - -@cindex proxy -@cindex firewall - -If you are behind a firewall and only have access to the @acronym{NNTP} -server from the firewall machine, you can instruct Gnus to @code{rlogin} -on the firewall machine and telnet from there to the @acronym{NNTP} server. -Doing this can be rather fiddly, but your virtual server definition -should probably look something like this: - -@lisp -(nntp "firewall" - (nntp-open-connection-function nntp-open-via-rlogin-and-telnet) - (nntp-via-address "the.firewall.machine") - (nntp-address "the.real.nntp.host") - (nntp-end-of-line "\n")) -@end lisp - -If you want to use the wonderful @code{ssh} program to provide a -compressed connection over the modem line, you could add the following -configuration to the example above: - -@lisp - (nntp-via-rlogin-command "ssh") -@end lisp - -See also @code{nntp-via-rlogin-command-switches}. - -If you're behind a firewall, but have direct access to the outside world -through a wrapper command like "runsocks", you could open a socksified -telnet connection to the news server as follows: - -@lisp -(nntp "outside" - (nntp-pre-command "runsocks") - (nntp-open-connection-function nntp-open-via-telnet) - (nntp-address "the.news.server") - (nntp-end-of-line "\n")) -@end lisp - -This means that you have to have set up @code{ssh-agent} correctly to -provide automatic authorization, of course. And to get a compressed -connection, you have to have the @samp{Compression} option in the -@code{ssh} @file{config} file. - - -@node Creating a Virtual Server -@subsection Creating a Virtual Server - -If you're saving lots of articles in the cache by using persistent -articles, you may want to create a virtual server to read the cache. - -First you need to add a new server. The @kbd{a} command does that. It -would probably be best to use @code{nnml} to read the cache. You -could also use @code{nnspool} or @code{nnmh}, though. - -Type @kbd{a nnml RET cache RET}. - -You should now have a brand new @code{nnml} virtual server called -@samp{cache}. You now need to edit it to have the right definitions. -Type @kbd{e} to edit the server. You'll be entered into a buffer that -will contain the following: - -@lisp -(nnml "cache") -@end lisp - -Change that to: - -@lisp -(nnml "cache" - (nnml-directory "~/News/cache/") - (nnml-active-file "~/News/cache/active")) -@end lisp - -Type @kbd{C-c C-c} to return to the server buffer. If you now press -@kbd{RET} over this virtual server, you should be entered into a browse -buffer, and you should be able to enter any of the groups displayed. - - -@node Server Variables -@subsection Server Variables -@cindex server variables -@cindex server parameters - -One sticky point when defining variables (both on back ends and in Emacs -in general) is that some variables are typically initialized from other -variables when the definition of the variables is being loaded. If you -change the ``base'' variable after the variables have been loaded, you -won't change the ``derived'' variables. - -This typically affects directory and file variables. For instance, -@code{nnml-directory} is @file{~/Mail/} by default, and all @code{nnml} -directory variables are initialized from that variable, so -@code{nnml-active-file} will be @file{~/Mail/active}. If you define a -new virtual @code{nnml} server, it will @emph{not} suffice to set just -@code{nnml-directory}---you have to explicitly set all the file -variables to be what you want them to be. For a complete list of -variables for each back end, see each back end's section later in this -manual, but here's an example @code{nnml} definition: - -@lisp -(nnml "public" - (nnml-directory "~/my-mail/") - (nnml-active-file "~/my-mail/active") - (nnml-newsgroups-file "~/my-mail/newsgroups")) -@end lisp - -Server variables are often called @dfn{server parameters}. - -@node Servers and Methods -@subsection Servers and Methods - -Wherever you would normally use a select method -(e.g. @code{gnus-secondary-select-method}, in the group select method, -when browsing a foreign server) you can use a virtual server name -instead. This could potentially save lots of typing. And it's nice all -over. - - -@node Unavailable Servers -@subsection Unavailable Servers - -If a server seems to be unreachable, Gnus will mark that server as -@code{denied}. That means that any subsequent attempt to make contact -with that server will just be ignored. ``It can't be opened,'' Gnus -will tell you, without making the least effort to see whether that is -actually the case or not. - -That might seem quite naughty, but it does make sense most of the time. -Let's say you have 10 groups subscribed to on server -@samp{nephelococcygia.com}. This server is located somewhere quite far -away from you and the machine is quite slow, so it takes 1 minute just -to find out that it refuses connection to you today. If Gnus were to -attempt to do that 10 times, you'd be quite annoyed, so Gnus won't -attempt to do that. Once it has gotten a single ``connection refused'', -it will regard that server as ``down''. - -So, what happens if the machine was only feeling unwell temporarily? -How do you test to see whether the machine has come up again? - -You jump to the server buffer (@pxref{Server Buffer}) and poke it -with the following commands: - -@table @kbd - -@item O -@kindex O (Server) -@findex gnus-server-open-server -Try to establish connection to the server on the current line -(@code{gnus-server-open-server}). - -@item C -@kindex C (Server) -@findex gnus-server-close-server -Close the connection (if any) to the server -(@code{gnus-server-close-server}). - -@item D -@kindex D (Server) -@findex gnus-server-deny-server -Mark the current server as unreachable -(@code{gnus-server-deny-server}). - -@item M-o -@kindex M-o (Server) -@findex gnus-server-open-all-servers -Open the connections to all servers in the buffer -(@code{gnus-server-open-all-servers}). - -@item M-c -@kindex M-c (Server) -@findex gnus-server-close-all-servers -Close the connections to all servers in the buffer -(@code{gnus-server-close-all-servers}). - -@item R -@kindex R (Server) -@findex gnus-server-remove-denials -Remove all marks to whether Gnus was denied connection from any servers -(@code{gnus-server-remove-denials}). - -@item L -@kindex L (Server) -@findex gnus-server-offline-server -Set server status to offline (@code{gnus-server-offline-server}). - -@end table - - -@node Getting News -@section Getting News -@cindex reading news -@cindex news back ends - -A newsreader is normally used for reading news. Gnus currently provides -only two methods of getting news---it can read from an @acronym{NNTP} server, -or it can read from a local spool. - -@menu -* NNTP:: Reading news from an @acronym{NNTP} server. -* News Spool:: Reading news from the local spool. -@end menu - - -@node NNTP -@subsection NNTP -@cindex nntp - -Subscribing to a foreign group from an @acronym{NNTP} server is rather easy. -You just specify @code{nntp} as method and the address of the @acronym{NNTP} -server as the, uhm, address. - -If the @acronym{NNTP} server is located at a non-standard port, setting the -third element of the select method to this port number should allow you -to connect to the right port. You'll have to edit the group info for -that (@pxref{Foreign Groups}). - -The name of the foreign group can be the same as a native group. In -fact, you can subscribe to the same group from as many different servers -you feel like. There will be no name collisions. - -The following variables can be used to create a virtual @code{nntp} -server: - -@table @code - -@item nntp-server-opened-hook -@vindex nntp-server-opened-hook -@cindex @sc{mode reader} -@cindex authinfo -@cindex authentication -@cindex nntp authentication -@findex nntp-send-authinfo -@findex nntp-send-mode-reader -is run after a connection has been made. It can be used to send -commands to the @acronym{NNTP} server after it has been contacted. By -default it sends the command @code{MODE READER} to the server with the -@code{nntp-send-mode-reader} function. This function should always be -present in this hook. - -@item nntp-authinfo-function -@vindex nntp-authinfo-function -@findex nntp-send-authinfo -@vindex nntp-authinfo-file -This function will be used to send @samp{AUTHINFO} to the @acronym{NNTP} -server. The default function is @code{nntp-send-authinfo}, which looks -through your @file{~/.authinfo} (or whatever you've set the -@code{nntp-authinfo-file} variable to) for applicable entries. If none -are found, it will prompt you for a login name and a password. The -format of the @file{~/.authinfo} file is (almost) the same as the -@code{ftp} @file{~/.netrc} file, which is defined in the @code{ftp} -manual page, but here are the salient facts: - -@enumerate -@item -The file contains one or more line, each of which define one server. - -@item -Each line may contain an arbitrary number of token/value pairs. - -The valid tokens include @samp{machine}, @samp{login}, @samp{password}, -@samp{default}. In addition Gnus introduces two new tokens, not present -in the original @file{.netrc}/@code{ftp} syntax, namely @samp{port} and -@samp{force}. (This is the only way the @file{.authinfo} file format -deviates from the @file{.netrc} file format.) @samp{port} is used to -indicate what port on the server the credentials apply to and -@samp{force} is explained below. - -@end enumerate - -Here's an example file: - -@example -machine news.uio.no login larsi password geheimnis -machine nntp.ifi.uio.no login larsi force yes -@end example - -The token/value pairs may appear in any order; @samp{machine} doesn't -have to be first, for instance. - -In this example, both login name and password have been supplied for the -former server, while the latter has only the login name listed, and the -user will be prompted for the password. The latter also has the -@samp{force} tag, which means that the authinfo will be sent to the -@var{nntp} server upon connection; the default (i.e., when there is not -@samp{force} tag) is to not send authinfo to the @var{nntp} server -until the @var{nntp} server asks for it. - -You can also add @samp{default} lines that will apply to all servers -that don't have matching @samp{machine} lines. - -@example -default force yes -@end example - -This will force sending @samp{AUTHINFO} commands to all servers not -previously mentioned. - -Remember to not leave the @file{~/.authinfo} file world-readable. - -@item nntp-server-action-alist -@vindex nntp-server-action-alist -This is a list of regexps to match on server types and actions to be -taken when matches are made. For instance, if you want Gnus to beep -every time you connect to innd, you could say something like: - -@lisp -(setq nntp-server-action-alist - '(("innd" (ding)))) -@end lisp - -You probably don't want to do that, though. - -The default value is - -@lisp -'(("nntpd 1\\.5\\.11t" - (remove-hook 'nntp-server-opened-hook - 'nntp-send-mode-reader))) -@end lisp - -This ensures that Gnus doesn't send the @code{MODE READER} command to -nntpd 1.5.11t, since that command chokes that server, I've been told. - -@item nntp-maximum-request -@vindex nntp-maximum-request -If the @acronym{NNTP} server doesn't support @acronym{NOV} headers, this back end -will collect headers by sending a series of @code{head} commands. To -speed things up, the back end sends lots of these commands without -waiting for reply, and then reads all the replies. This is controlled -by the @code{nntp-maximum-request} variable, and is 400 by default. If -your network is buggy, you should set this to 1. - -@item nntp-connection-timeout -@vindex nntp-connection-timeout -If you have lots of foreign @code{nntp} groups that you connect to -regularly, you're sure to have problems with @acronym{NNTP} servers not -responding properly, or being too loaded to reply within reasonable -time. This is can lead to awkward problems, which can be helped -somewhat by setting @code{nntp-connection-timeout}. This is an integer -that says how many seconds the @code{nntp} back end should wait for a -connection before giving up. If it is @code{nil}, which is the default, -no timeouts are done. - -@item nntp-nov-is-evil -@vindex nntp-nov-is-evil -If the @acronym{NNTP} server does not support @acronym{NOV}, you could set this -variable to @code{t}, but @code{nntp} usually checks automatically whether @acronym{NOV} -can be used. - -@item nntp-xover-commands -@vindex nntp-xover-commands -@cindex @acronym{NOV} -@cindex XOVER -List of strings used as commands to fetch @acronym{NOV} lines from a -server. The default value of this variable is @code{("XOVER" -"XOVERVIEW")}. - -@item nntp-nov-gap -@vindex nntp-nov-gap -@code{nntp} normally sends just one big request for @acronym{NOV} lines to -the server. The server responds with one huge list of lines. However, -if you have read articles 2-5000 in the group, and only want to read -article 1 and 5001, that means that @code{nntp} will fetch 4999 @acronym{NOV} -lines that you will not need. This variable says how -big a gap between two consecutive articles is allowed to be before the -@code{XOVER} request is split into several request. Note that if your -network is fast, setting this variable to a really small number means -that fetching will probably be slower. If this variable is @code{nil}, -@code{nntp} will never split requests. The default is 5. - -@item nntp-xref-number-is-evil -@vindex nntp-xref-number-is-evil -When Gnus refers to an article having the @code{Message-ID} that a user -specifies or having the @code{Message-ID} of the parent article of the -current one (@pxref{Finding the Parent}), Gnus sends a @code{HEAD} -command to the @acronym{NNTP} server to know where it is, and the server -returns the data containing the pairs of a group and an article number -in the @code{Xref} header. Gnus normally uses the article number to -refer to the article if the data shows that that article is in the -current group, while it uses the @code{Message-ID} otherwise. However, -some news servers, e.g., ones running Diablo, run multiple engines -having the same articles but article numbers are not kept synchronized -between them. In that case, the article number that appears in the -@code{Xref} header varies by which engine is chosen, so you cannot refer -to the parent article that is in the current group, for instance. If -you connect to such a server, set this variable to a non-@code{nil} -value, and Gnus never uses article numbers. For example: - -@lisp -(setq gnus-select-method - '(nntp "newszilla" - (nntp-address "newszilla.example.com") - (nntp-xref-number-is-evil t) - @dots{})) -@end lisp - -The default value of this server variable is @code{nil}. - -@item nntp-prepare-server-hook -@vindex nntp-prepare-server-hook -A hook run before attempting to connect to an @acronym{NNTP} server. - -@item nntp-record-commands -@vindex nntp-record-commands -If non-@code{nil}, @code{nntp} will log all commands it sends to the -@acronym{NNTP} server (along with a timestamp) in the @samp{*nntp-log*} -buffer. This is useful if you are debugging a Gnus/@acronym{NNTP} connection -that doesn't seem to work. - -@item nntp-open-connection-function -@vindex nntp-open-connection-function -It is possible to customize how the connection to the nntp server will -be opened. If you specify an @code{nntp-open-connection-function} -parameter, Gnus will use that function to establish the connection. -Six pre-made functions are supplied. These functions can be grouped in -two categories: direct connection functions (four pre-made), and -indirect ones (two pre-made). - -@item nntp-never-echoes-commands -@vindex nntp-never-echoes-commands -Non-@code{nil} means the nntp server never echoes commands. It is -reported that some nntps server doesn't echo commands. So, you may want -to set this to non-@code{nil} in the method for such a server setting -@code{nntp-open-connection-function} to @code{nntp-open-ssl-stream} for -example. The default value is @code{nil}. Note that the -@code{nntp-open-connection-functions-never-echo-commands} variable -overrides the @code{nil} value of this variable. - -@item nntp-open-connection-functions-never-echo-commands -@vindex nntp-open-connection-functions-never-echo-commands -List of functions that never echo commands. Add or set a function which -you set to @code{nntp-open-connection-function} to this list if it does -not echo commands. Note that a non-@code{nil} value of the -@code{nntp-never-echoes-commands} variable overrides this variable. The -default value is @code{(nntp-open-network-stream)}. - -@item nntp-prepare-post-hook -@vindex nntp-prepare-post-hook -A hook run just before posting an article. If there is no -@code{Message-ID} header in the article and the news server provides the -recommended ID, it will be added to the article before running this -hook. It is useful to make @code{Cancel-Lock} headers even if you -inhibit Gnus to add a @code{Message-ID} header, you could say: - -@lisp -(add-hook 'nntp-prepare-post-hook 'canlock-insert-header) -@end lisp - -Note that not all servers support the recommended ID. This works for -INN versions 2.3.0 and later, for instance. - -@end table - -@menu -* Direct Functions:: Connecting directly to the server. -* Indirect Functions:: Connecting indirectly to the server. -* Common Variables:: Understood by several connection functions. -@end menu - - -@node Direct Functions -@subsubsection Direct Functions -@cindex direct connection functions - -These functions are called direct because they open a direct connection -between your machine and the @acronym{NNTP} server. The behavior of these -functions is also affected by commonly understood variables -(@pxref{Common Variables}). - -@table @code -@findex nntp-open-network-stream -@item nntp-open-network-stream -This is the default, and simply connects to some port or other on the -remote system. - -@findex nntp-open-tls-stream -@item nntp-open-tls-stream -Opens a connection to a server over a @dfn{secure} channel. To use -this you must have @uref{http://www.gnu.org/software/gnutls/, GNUTLS} -installed. You then define a server as follows: - -@lisp -;; @r{"nntps" is port 563 and is predefined in our @file{/etc/services}} -;; @r{however, @samp{gnutls-cli -p} doesn't like named ports.} -;; -(nntp "snews.bar.com" - (nntp-open-connection-function nntp-open-tls-stream) - (nntp-port-number ) - (nntp-address "snews.bar.com")) -@end lisp - -@findex nntp-open-ssl-stream -@item nntp-open-ssl-stream -Opens a connection to a server over a @dfn{secure} channel. To use -this you must have @uref{http://www.openssl.org, OpenSSL} or -@uref{ftp://ftp.psy.uq.oz.au/pub/Crypto/SSL, SSLeay} installed. You -then define a server as follows: - -@lisp -;; @r{"snews" is port 563 and is predefined in our @file{/etc/services}} -;; @r{however, @samp{openssl s_client -port} doesn't like named ports.} -;; -(nntp "snews.bar.com" - (nntp-open-connection-function nntp-open-ssl-stream) - (nntp-port-number 563) - (nntp-address "snews.bar.com")) -@end lisp - -@findex nntp-open-telnet-stream -@item nntp-open-telnet-stream -Opens a connection to an @acronym{NNTP} server by simply @samp{telnet}'ing -it. You might wonder why this function exists, since we have the -default @code{nntp-open-network-stream} which would do the job. (One -of) the reason(s) is that if you are behind a firewall but have direct -connections to the outside world thanks to a command wrapper like -@code{runsocks}, you can use it like this: - -@lisp -(nntp "socksified" - (nntp-pre-command "runsocks") - (nntp-open-connection-function nntp-open-telnet-stream) - (nntp-address "the.news.server")) -@end lisp - -With the default method, you would need to wrap your whole Emacs -session, which is not a good idea. -@end table - - -@node Indirect Functions -@subsubsection Indirect Functions -@cindex indirect connection functions - -These functions are called indirect because they connect to an -intermediate host before actually connecting to the @acronym{NNTP} server. -All of these functions and related variables are also said to belong to -the ``via'' family of connection: they're all prefixed with ``via'' to make -things cleaner. The behavior of these functions is also affected by -commonly understood variables (@pxref{Common Variables}). - -@table @code -@item nntp-open-via-rlogin-and-telnet -@findex nntp-open-via-rlogin-and-telnet -Does an @samp{rlogin} on a remote system, and then does a @samp{telnet} -to the real @acronym{NNTP} server from there. This is useful for instance if -you need to connect to a firewall machine first. - -@code{nntp-open-via-rlogin-and-telnet}-specific variables: - -@table @code -@item nntp-via-rlogin-command -@vindex nntp-via-rlogin-command -Command used to log in on the intermediate host. The default is -@samp{rsh}, but @samp{ssh} is a popular alternative. - -@item nntp-via-rlogin-command-switches -@vindex nntp-via-rlogin-command-switches -List of strings to be used as the switches to -@code{nntp-via-rlogin-command}. The default is @code{nil}. If you use -@samp{ssh} for @code{nntp-via-rlogin-command}, you may set this to -@samp{("-C")} in order to compress all data connections, otherwise set -this to @samp{("-t" "-e" "none")} or @samp{("-C" "-t" "-e" "none")} if -the telnet command requires a pseudo-tty allocation on an intermediate -host. -@end table - -@item nntp-open-via-telnet-and-telnet -@findex nntp-open-via-telnet-and-telnet -Does essentially the same, but uses @samp{telnet} instead of -@samp{rlogin} to connect to the intermediate host. - -@code{nntp-open-via-telnet-and-telnet}-specific variables: - -@table @code -@item nntp-via-telnet-command -@vindex nntp-via-telnet-command -Command used to @code{telnet} the intermediate host. The default is -@samp{telnet}. - -@item nntp-via-telnet-switches -@vindex nntp-via-telnet-switches -List of strings to be used as the switches to the -@code{nntp-via-telnet-command} command. The default is @samp{("-8")}. - -@item nntp-via-user-password -@vindex nntp-via-user-password -Password to use when logging in on the intermediate host. - -@item nntp-via-envuser -@vindex nntp-via-envuser -If non-@code{nil}, the intermediate @code{telnet} session (client and -server both) will support the @code{ENVIRON} option and not prompt for -login name. This works for Solaris @code{telnet}, for instance. - -@item nntp-via-shell-prompt -@vindex nntp-via-shell-prompt -Regexp matching the shell prompt on the intermediate host. The default -is @samp{bash\\|\$ *\r?$\\|> *\r?}. - -@end table - -@end table - - -Here are some additional variables that are understood by all the above -functions: - -@table @code - -@item nntp-via-user-name -@vindex nntp-via-user-name -User name to use when connecting to the intermediate host. - -@item nntp-via-address -@vindex nntp-via-address -Address of the intermediate host to connect to. - -@end table - - -@node Common Variables -@subsubsection Common Variables - -The following variables affect the behavior of all, or several of the -pre-made connection functions. When not specified, all functions are -affected (the values of the following variables will be used as the -default if each virtual @code{nntp} server doesn't specify those server -variables individually). - -@table @code - -@item nntp-pre-command -@vindex nntp-pre-command -A command wrapper to use when connecting through a non native -connection function (all except @code{nntp-open-network-stream}, -@code{nntp-open-tls-stream}, and @code{nntp-open-ssl-stream}). This is -where you would put a @samp{SOCKS} wrapper for instance. - -@item nntp-address -@vindex nntp-address -The address of the @acronym{NNTP} server. - -@item nntp-port-number -@vindex nntp-port-number -Port number to connect to the @acronym{NNTP} server. The default is -@samp{nntp}. If you use @acronym{NNTP} over -@acronym{TLS}/@acronym{SSL}, you may want to use integer ports rather -than named ports (i.e, use @samp{563} instead of @samp{snews} or -@samp{nntps}), because external @acronym{TLS}/@acronym{SSL} tools may -not work with named ports. - -@item nntp-end-of-line -@vindex nntp-end-of-line -String to use as end-of-line marker when talking to the @acronym{NNTP} -server. This is @samp{\r\n} by default, but should be @samp{\n} when -using a non native connection function. - -@item nntp-telnet-command -@vindex nntp-telnet-command -Command to use when connecting to the @acronym{NNTP} server through -@samp{telnet}. This is @emph{not} for an intermediate host. This is -just for the real @acronym{NNTP} server. The default is -@samp{telnet}. - -@item nntp-telnet-switches -@vindex nntp-telnet-switches -A list of switches to pass to @code{nntp-telnet-command}. The default -is @samp{("-8")}. - -@end table - - -@node News Spool -@subsection News Spool -@cindex nnspool -@cindex news spool - -Subscribing to a foreign group from the local spool is extremely easy, -and might be useful, for instance, to speed up reading groups that -contain very big articles---@samp{alt.binaries.pictures.furniture}, for -instance. - -Anyway, you just specify @code{nnspool} as the method and @code{""} (or -anything else) as the address. - -If you have access to a local spool, you should probably use that as the -native select method (@pxref{Finding the News}). It is normally faster -than using an @code{nntp} select method, but might not be. It depends. -You just have to try to find out what's best at your site. - -@table @code - -@item nnspool-inews-program -@vindex nnspool-inews-program -Program used to post an article. - -@item nnspool-inews-switches -@vindex nnspool-inews-switches -Parameters given to the inews program when posting an article. - -@item nnspool-spool-directory -@vindex nnspool-spool-directory -Where @code{nnspool} looks for the articles. This is normally -@file{/usr/spool/news/}. - -@item nnspool-nov-directory -@vindex nnspool-nov-directory -Where @code{nnspool} will look for @acronym{NOV} files. This is normally@* -@file{/usr/spool/news/over.view/}. - -@item nnspool-lib-dir -@vindex nnspool-lib-dir -Where the news lib dir is (@file{/usr/lib/news/} by default). - -@item nnspool-active-file -@vindex nnspool-active-file -The name of the active file. - -@item nnspool-newsgroups-file -@vindex nnspool-newsgroups-file -The name of the group descriptions file. - -@item nnspool-history-file -@vindex nnspool-history-file -The name of the news history file. - -@item nnspool-active-times-file -@vindex nnspool-active-times-file -The name of the active date file. - -@item nnspool-nov-is-evil -@vindex nnspool-nov-is-evil -If non-@code{nil}, @code{nnspool} won't try to use any @acronym{NOV} files -that it finds. - -@item nnspool-sift-nov-with-sed -@vindex nnspool-sift-nov-with-sed -@cindex sed -If non-@code{nil}, which is the default, use @code{sed} to get the -relevant portion from the overview file. If @code{nil}, -@code{nnspool} will load the entire file into a buffer and process it -there. - -@end table - - -@node Getting Mail -@section Getting Mail -@cindex reading mail -@cindex mail - -Reading mail with a newsreader---isn't that just plain WeIrD? But of -course. - -@menu -* Mail in a Newsreader:: Important introductory notes. -* Getting Started Reading Mail:: A simple cookbook example. -* Splitting Mail:: How to create mail groups. -* Mail Sources:: How to tell Gnus where to get mail from. -* Mail Back End Variables:: Variables for customizing mail handling. -* Fancy Mail Splitting:: Gnus can do hairy splitting of incoming mail. -* Group Mail Splitting:: Use group customize to drive mail splitting. -* Incorporating Old Mail:: What about the old mail you have? -* Expiring Mail:: Getting rid of unwanted mail. -* Washing Mail:: Removing cruft from the mail you get. -* Duplicates:: Dealing with duplicated mail. -* Not Reading Mail:: Using mail back ends for reading other files. -* Choosing a Mail Back End:: Gnus can read a variety of mail formats. -@end menu - - -@node Mail in a Newsreader -@subsection Mail in a Newsreader - -If you are used to traditional mail readers, but have decided to switch -to reading mail with Gnus, you may find yourself experiencing something -of a culture shock. - -Gnus does not behave like traditional mail readers. If you want to make -it behave that way, you can, but it's an uphill battle. - -Gnus, by default, handles all its groups using the same approach. This -approach is very newsreaderly---you enter a group, see the new/unread -messages, and when you read the messages, they get marked as read, and -you don't see them any more. (Unless you explicitly ask for them.) - -In particular, you do not do anything explicitly to delete messages. - -Does this mean that all the messages that have been marked as read are -deleted? How awful! - -But, no, it means that old messages are @dfn{expired} according to some -scheme or other. For news messages, the expire process is controlled by -the news administrator; for mail, the expire process is controlled by -you. The expire process for mail is covered in depth in @ref{Expiring -Mail}. - -What many Gnus users find, after using it a while for both news and -mail, is that the transport mechanism has very little to do with how -they want to treat a message. - -Many people subscribe to several mailing lists. These are transported -via @acronym{SMTP}, and are therefore mail. But we might go for weeks without -answering, or even reading these messages very carefully. We may not -need to save them because if we should need to read one again, they are -archived somewhere else. - -Some people have local news groups which have only a handful of readers. -These are transported via @acronym{NNTP}, and are therefore news. But we may need -to read and answer a large fraction of the messages very carefully in -order to do our work. And there may not be an archive, so we may need -to save the interesting messages the same way we would personal mail. - -The important distinction turns out to be not the transport mechanism, -but other factors such as how interested we are in the subject matter, -or how easy it is to retrieve the message if we need to read it again. - -Gnus provides many options for sorting mail into ``groups'' which behave -like newsgroups, and for treating each group (whether mail or news) -differently. - -Some users never get comfortable using the Gnus (ahem) paradigm and wish -that Gnus should grow up and be a male, er, mail reader. It is possible -to whip Gnus into a more mailreaderly being, but, as said before, it's -not easy. People who prefer proper mail readers should try @sc{vm} -instead, which is an excellent, and proper, mail reader. - -I don't mean to scare anybody off, but I want to make it clear that you -may be required to learn a new way of thinking about messages. After -you've been subjected to The Gnus Way, you will come to love it. I can -guarantee it. (At least the guy who sold me the Emacs Subliminal -Brain-Washing Functions that I've put into Gnus did guarantee it. You -Will Be Assimilated. You Love Gnus. You Love The Gnus Mail Way. -You Do.) - - -@node Getting Started Reading Mail -@subsection Getting Started Reading Mail - -It's quite easy to use Gnus to read your new mail. You just plonk the -mail back end of your choice into @code{gnus-secondary-select-methods}, -and things will happen automatically. - -For instance, if you want to use @code{nnml} (which is a ``one file per -mail'' back end), you could put the following in your @file{~/.gnus.el} file: - -@lisp -(setq gnus-secondary-select-methods '((nnml ""))) -@end lisp - -Now, the next time you start Gnus, this back end will be queried for new -articles, and it will move all the messages in your spool file to its -directory, which is @file{~/Mail/} by default. The new group that will -be created (@samp{mail.misc}) will be subscribed, and you can read it -like any other group. - -You will probably want to split the mail into several groups, though: - -@lisp -(setq nnmail-split-methods - '(("junk" "^From:.*Lars Ingebrigtsen") - ("crazy" "^Subject:.*die\\|^Organization:.*flabby") - ("other" ""))) -@end lisp - -This will result in three new @code{nnml} mail groups being created: -@samp{nnml:junk}, @samp{nnml:crazy}, and @samp{nnml:other}. All the -mail that doesn't fit into the first two groups will be placed in the -last group. - -This should be sufficient for reading mail with Gnus. You might want to -give the other sections in this part of the manual a perusal, though. -Especially @pxref{Choosing a Mail Back End} and @pxref{Expiring Mail}. - - -@node Splitting Mail -@subsection Splitting Mail -@cindex splitting mail -@cindex mail splitting -@cindex mail filtering (splitting) - -@vindex nnmail-split-methods -The @code{nnmail-split-methods} variable says how the incoming mail is -to be split into groups. - -@lisp -(setq nnmail-split-methods - '(("mail.junk" "^From:.*Lars Ingebrigtsen") - ("mail.crazy" "^Subject:.*die\\|^Organization:.*flabby") - ("mail.other" ""))) -@end lisp - -This variable is a list of lists, where the first element of each of -these lists is the name of the mail group (they do not have to be called -something beginning with @samp{mail}, by the way), and the second -element is a regular expression used on the header of each mail to -determine if it belongs in this mail group. The first string may -contain @samp{\\1} forms, like the ones used by @code{replace-match} to -insert sub-expressions from the matched text. For instance: - -@lisp -("list.\\1" "From:.* \\(.*\\)-list@@majordomo.com") -@end lisp - -@noindent -In that case, @code{nnmail-split-lowercase-expanded} controls whether -the inserted text should be made lowercase. @xref{Fancy Mail Splitting}. - -The second element can also be a function. In that case, it will be -called narrowed to the headers with the first element of the rule as the -argument. It should return a non-@code{nil} value if it thinks that the -mail belongs in that group. - -@cindex @samp{bogus} group -The last of these groups should always be a general one, and the regular -expression should @emph{always} be @samp{""} so that it matches any mails -that haven't been matched by any of the other regexps. (These rules are -processed from the beginning of the alist toward the end. The first rule -to make a match will ``win'', unless you have crossposting enabled. In -that case, all matching rules will ``win''.) If no rule matched, the mail -will end up in the @samp{bogus} group. When new groups are created by -splitting mail, you may want to run @code{gnus-group-find-new-groups} to -see the new groups. This also applies to the @samp{bogus} group. - -If you like to tinker with this yourself, you can set this variable to a -function of your choice. This function will be called without any -arguments in a buffer narrowed to the headers of an incoming mail -message. The function should return a list of group names that it -thinks should carry this mail message. - -Note that the mail back ends are free to maul the poor, innocent, -incoming headers all they want to. They all add @code{Lines} headers; -some add @code{X-Gnus-Group} headers; most rename the Unix mbox -@code{From<SPACE>} line to something else. - -@vindex nnmail-crosspost -The mail back ends all support cross-posting. If several regexps match, -the mail will be ``cross-posted'' to all those groups. -@code{nnmail-crosspost} says whether to use this mechanism or not. Note -that no articles are crossposted to the general (@samp{""}) group. - -@vindex nnmail-crosspost-link-function -@cindex crosspost -@cindex links -@code{nnmh} and @code{nnml} makes crossposts by creating hard links to -the crossposted articles. However, not all file systems support hard -links. If that's the case for you, set -@code{nnmail-crosspost-link-function} to @code{copy-file}. (This -variable is @code{add-name-to-file} by default.) - -@kindex M-x nnmail-split-history -@findex nnmail-split-history -If you wish to see where the previous mail split put the messages, you -can use the @kbd{M-x nnmail-split-history} command. If you wish to see -where re-spooling messages would put the messages, you can use -@code{gnus-summary-respool-trace} and related commands (@pxref{Mail -Group Commands}). - -@vindex nnmail-split-header-length-limit -Header lines longer than the value of -@code{nnmail-split-header-length-limit} are excluded from the split -function. - -@vindex nnmail-mail-splitting-decodes -@vindex nnmail-mail-splitting-charset -By default, splitting does not decode headers, so you can not match on -non-@acronym{ASCII} strings. But it is useful if you want to match -articles based on the raw header data. To enable it, set the -@code{nnmail-mail-splitting-decodes} variable to a non-@code{nil} value. -In addition, the value of the @code{nnmail-mail-splitting-charset} -variable is used for decoding non-@acronym{MIME} encoded string when -@code{nnmail-mail-splitting-decodes} is non-@code{nil}. The default -value is @code{nil} which means not to decode non-@acronym{MIME} encoded -string. A suitable value for you will be @code{undecided} or be the -charset used normally in mails you are interested in. - -@vindex nnmail-resplit-incoming -By default, splitting is performed on all incoming messages. If you -specify a @code{directory} entry for the variable @code{mail-sources} -(@pxref{Mail Source Specifiers}), however, then splitting does -@emph{not} happen by default. You can set the variable -@code{nnmail-resplit-incoming} to a non-@code{nil} value to make -splitting happen even in this case. (This variable has no effect on -other kinds of entries.) - -Gnus gives you all the opportunity you could possibly want for shooting -yourself in the foot. Let's say you create a group that will contain -all the mail you get from your boss. And then you accidentally -unsubscribe from the group. Gnus will still put all the mail from your -boss in the unsubscribed group, and so, when your boss mails you ``Have -that report ready by Monday or you're fired!'', you'll never see it and, -come Tuesday, you'll still believe that you're gainfully employed while -you really should be out collecting empty bottles to save up for next -month's rent money. - - -@node Mail Sources -@subsection Mail Sources - -Mail can be gotten from many different sources---the mail spool, from -a @acronym{POP} mail server, from a procmail directory, or from a -maildir, for instance. - -@menu -* Mail Source Specifiers:: How to specify what a mail source is. -* Mail Source Customization:: Some variables that influence things. -* Fetching Mail:: Using the mail source specifiers. -@end menu - - -@node Mail Source Specifiers -@subsubsection Mail Source Specifiers -@cindex POP -@cindex mail server -@cindex procmail -@cindex mail spool -@cindex mail source - -You tell Gnus how to fetch mail by setting @code{mail-sources} -(@pxref{Fetching Mail}) to a @dfn{mail source specifier}. - -Here's an example: - -@lisp -(pop :server "pop3.mailserver.com" :user "myname") -@end lisp - -As can be observed, a mail source specifier is a list where the first -element is a @dfn{mail source type}, followed by an arbitrary number of -@dfn{keywords}. Keywords that are not explicitly specified are given -default values. - -The following mail source types are available: - -@table @code -@item file -Get mail from a single file; typically from the mail spool. - -Keywords: - -@table @code -@item :path -The file name. Defaults to the value of the @env{MAIL} -environment variable or the value of @code{rmail-spool-directory} -(usually something like @file{/usr/mail/spool/user-name}). - -@item :prescript -@itemx :postscript -Script run before/after fetching mail. -@end table - -An example file mail source: - -@lisp -(file :path "/usr/spool/mail/user-name") -@end lisp - -Or using the default file name: - -@lisp -(file) -@end lisp - -If the mail spool file is not located on the local machine, it's best -to use @acronym{POP} or @acronym{IMAP} or the like to fetch the mail. -You can not use ange-ftp file names here---it has no way to lock the -mail spool while moving the mail. - -If it's impossible to set up a proper server, you can use ssh instead. - -@lisp -(setq mail-sources - '((file :prescript "ssh host bin/getmail >%t"))) -@end lisp - -The @samp{getmail} script would look something like the following: - -@example -#!/bin/sh -# getmail - move mail from spool to stdout -# flu@@iki.fi - -MOVEMAIL=/usr/lib/emacs/20.3/i386-redhat-linux/movemail -TMP=$HOME/Mail/tmp -rm -f $TMP; $MOVEMAIL $MAIL $TMP >/dev/null && cat $TMP -@end example - -Alter this script to fit the @samp{movemail} and temporary -file you want to use. - - -@item directory -@vindex nnmail-scan-directory-mail-source-once -Get mail from several files in a directory. This is typically used -when you have procmail split the incoming mail into several files. -That is, there is a one-to-one correspondence between files in that -directory and groups, so that mail from the file @file{foo.bar.spool} -will be put in the group @code{foo.bar}. (You can change the suffix -to be used instead of @code{.spool}.) Setting -@code{nnmail-scan-directory-mail-source-once} to non-@code{nil} forces -Gnus to scan the mail source only once. This is particularly useful -if you want to scan mail groups at a specified level. - -@vindex nnmail-resplit-incoming -There is also the variable @code{nnmail-resplit-incoming}, if you set -that to a non-@code{nil} value, then the normal splitting process is -applied to all the files from the directory, @ref{Splitting Mail}. - -Keywords: - -@table @code -@item :path -The name of the directory where the files are. There is no default -value. - -@item :suffix -Only files ending with this suffix are used. The default is -@samp{.spool}. - -@item :predicate -Only files that have this predicate return non-@code{nil} are returned. -The default is @code{identity}. This is used as an additional -filter---only files that have the right suffix @emph{and} satisfy this -predicate are considered. - -@item :prescript -@itemx :postscript -Script run before/after fetching mail. - -@end table - -An example directory mail source: - -@lisp -(directory :path "/home/user-name/procmail-dir/" - :suffix ".prcml") -@end lisp - -@item pop -Get mail from a @acronym{POP} server. - -Keywords: - -@table @code -@item :server -The name of the @acronym{POP} server. The default is taken from the -@env{MAILHOST} environment variable. - -@item :port -The port number of the @acronym{POP} server. This can be a number (eg, -@samp{:port 1234}) or a string (eg, @samp{:port "pop3"}). If it is a -string, it should be a service name as listed in @file{/etc/services} on -Unix systems. The default is @samp{"pop3"}. On some systems you might -need to specify it as @samp{"pop-3"} instead. - -@item :user -The user name to give to the @acronym{POP} server. The default is the login -name. - -@item :password -The password to give to the @acronym{POP} server. If not specified, -the user is prompted. - -@item :program -The program to use to fetch mail from the @acronym{POP} server. This -should be a @code{format}-like string. Here's an example: - -@example -fetchmail %u@@%s -P %p %t -@end example - -The valid format specifier characters are: - -@table @samp -@item t -The name of the file the mail is to be moved to. This must always be -included in this string. - -@item s -The name of the server. - -@item P -The port number of the server. - -@item u -The user name to use. - -@item p -The password to use. -@end table - -The values used for these specs are taken from the values you give the -corresponding keywords. - -@item :prescript -A script to be run before fetching the mail. The syntax is the same as -the @code{:program} keyword. This can also be a function to be run. - -@item :postscript -A script to be run after fetching the mail. The syntax is the same as -the @code{:program} keyword. This can also be a function to be run. - -@item :function -The function to use to fetch mail from the @acronym{POP} server. The -function is called with one parameter---the name of the file where the -mail should be moved to. - -@item :authentication -This can be either the symbol @code{password} or the symbol @code{apop} -and says what authentication scheme to use. The default is -@code{password}. - -@end table - -@vindex pop3-movemail -@vindex pop3-leave-mail-on-server -If the @code{:program} and @code{:function} keywords aren't specified, -@code{pop3-movemail} will be used. If @code{pop3-leave-mail-on-server} -is non-@code{nil} the mail is to be left on the @acronym{POP} server -after fetching when using @code{pop3-movemail}. Note that POP servers -maintain no state information between sessions, so what the client -believes is there and what is actually there may not match up. If they -do not, then you may get duplicate mails or the whole thing can fall -apart and leave you with a corrupt mailbox. - -Here are some examples for getting mail from a @acronym{POP} server. -Fetch from the default @acronym{POP} server, using the default user -name, and default fetcher: - -@lisp -(pop) -@end lisp - -Fetch from a named server with a named user and password: - -@lisp -(pop :server "my.pop.server" - :user "user-name" :password "secret") -@end lisp - -Use @samp{movemail} to move the mail: - -@lisp -(pop :program "movemail po:%u %t %p") -@end lisp - -@item maildir -Get mail from a maildir. This is a type of mailbox that is supported by -at least qmail and postfix, where each file in a special directory -contains exactly one mail. - -Keywords: - -@table @code -@item :path -The name of the directory where the mails are stored. The default is -taken from the @env{MAILDIR} environment variable or -@file{~/Maildir/}. -@item :subdirs -The subdirectories of the Maildir. The default is -@samp{("new" "cur")}. - -@c If you sometimes look at your mail through a pop3 daemon before fetching -@c them with Gnus, you may also have to fetch your mails from the -@c @code{cur} directory inside the maildir, like in the first example -@c below. - -You can also get mails from remote hosts (because maildirs don't suffer -from locking problems). - -@end table - -Two example maildir mail sources: - -@lisp -(maildir :path "/home/user-name/Maildir/" - :subdirs ("cur" "new")) -@end lisp - -@lisp -(maildir :path "/user@@remotehost.org:~/Maildir/" - :subdirs ("new")) -@end lisp - -@item imap -Get mail from a @acronym{IMAP} server. If you don't want to use -@acronym{IMAP} as intended, as a network mail reading protocol (ie -with nnimap), for some reason or other, Gnus let you treat it similar -to a @acronym{POP} server and fetches articles from a given -@acronym{IMAP} mailbox. @xref{IMAP}, for more information. - -Note that for the Kerberos, GSSAPI, @acronym{TLS}/@acronym{SSL} and STARTTLS support you -may need external programs and libraries, @xref{IMAP}. - -Keywords: - -@table @code -@item :server -The name of the @acronym{IMAP} server. The default is taken from the -@env{MAILHOST} environment variable. - -@item :port -The port number of the @acronym{IMAP} server. The default is @samp{143}, or -@samp{993} for @acronym{TLS}/@acronym{SSL} connections. - -@item :user -The user name to give to the @acronym{IMAP} server. The default is the login -name. - -@item :password -The password to give to the @acronym{IMAP} server. If not specified, the user is -prompted. - -@item :stream -What stream to use for connecting to the server, this is one of the -symbols in @code{imap-stream-alist}. Right now, this means -@samp{gssapi}, @samp{kerberos4}, @samp{starttls}, @samp{tls}, -@samp{ssl}, @samp{shell} or the default @samp{network}. - -@item :authentication -Which authenticator to use for authenticating to the server, this is -one of the symbols in @code{imap-authenticator-alist}. Right now, -this means @samp{gssapi}, @samp{kerberos4}, @samp{digest-md5}, -@samp{cram-md5}, @samp{anonymous} or the default @samp{login}. - -@item :program -When using the `shell' :stream, the contents of this variable is -mapped into the @code{imap-shell-program} variable. This should be a -@code{format}-like string (or list of strings). Here's an example: - -@example -ssh %s imapd -@end example - -The valid format specifier characters are: - -@table @samp -@item s -The name of the server. - -@item l -User name from @code{imap-default-user}. - -@item p -The port number of the server. -@end table - -The values used for these specs are taken from the values you give the -corresponding keywords. - -@item :mailbox -The name of the mailbox to get mail from. The default is @samp{INBOX} -which normally is the mailbox which receive incoming mail. - -@item :predicate -The predicate used to find articles to fetch. The default, @samp{UNSEEN -UNDELETED}, is probably the best choice for most people, but if you -sometimes peek in your mailbox with a @acronym{IMAP} client and mark some -articles as read (or; SEEN) you might want to set this to @samp{1:*}. -Then all articles in the mailbox is fetched, no matter what. For a -complete list of predicates, see RFC 2060 section 6.4.4. - -@item :fetchflag -How to flag fetched articles on the server, the default @samp{\Deleted} -will mark them as deleted, an alternative would be @samp{\Seen} which -would simply mark them as read. These are the two most likely choices, -but more flags are defined in RFC 2060 section 2.3.2. - -@item :dontexpunge -If non-@code{nil}, don't remove all articles marked as deleted in the -mailbox after finishing the fetch. - -@end table - -An example @acronym{IMAP} mail source: - -@lisp -(imap :server "mail.mycorp.com" - :stream kerberos4 - :fetchflag "\\Seen") -@end lisp - -@item webmail -Get mail from a webmail server, such as @uref{http://www.hotmail.com/}, -@uref{http://webmail.netscape.com/}, @uref{http://www.netaddress.com/}, -@uref{http://mail.yahoo.com/}. - -NOTE: Webmail largely depends on cookies. A "one-line-cookie" patch is -required for url "4.0pre.46". - -WARNING: Mails may be lost. NO WARRANTY. - -Keywords: - -@table @code -@item :subtype -The type of the webmail server. The default is @code{hotmail}. The -alternatives are @code{netscape}, @code{netaddress}, @code{my-deja}. - -@item :user -The user name to give to the webmail server. The default is the login -name. - -@item :password -The password to give to the webmail server. If not specified, the user is -prompted. - -@item :dontexpunge -If non-@code{nil}, only fetch unread articles and don't move them to -trash folder after finishing the fetch. - -@end table - -An example webmail source: - -@lisp -(webmail :subtype 'hotmail - :user "user-name" - :password "secret") -@end lisp -@end table - -@table @dfn -@item Common Keywords -Common keywords can be used in any type of mail source. - -Keywords: - -@table @code -@item :plugged -If non-@code{nil}, fetch the mail even when Gnus is unplugged. If you -use directory source to get mail, you can specify it as in this -example: - -@lisp -(setq mail-sources - '((directory :path "/home/pavel/.Spool/" - :suffix "" - :plugged t))) -@end lisp - -Gnus will then fetch your mail even when you are unplugged. This is -useful when you use local mail and news. - -@end table -@end table - -@subsubsection Function Interface - -Some of the above keywords specify a Lisp function to be executed. -For each keyword @code{:foo}, the Lisp variable @code{foo} is bound to -the value of the keyword while the function is executing. For example, -consider the following mail-source setting: - -@lisp -(setq mail-sources '((pop :user "jrl" - :server "pophost" :function fetchfunc))) -@end lisp - -While the function @code{fetchfunc} is executing, the symbol @code{user} -is bound to @code{"jrl"}, and the symbol @code{server} is bound to -@code{"pophost"}. The symbols @code{port}, @code{password}, -@code{program}, @code{prescript}, @code{postscript}, @code{function}, -and @code{authentication} are also bound (to their default values). - -See above for a list of keywords for each type of mail source. - - -@node Mail Source Customization -@subsubsection Mail Source Customization - -The following is a list of variables that influence how the mail is -fetched. You would normally not need to set or change any of these -variables. - -@table @code -@item mail-source-crash-box -@vindex mail-source-crash-box -File where mail will be stored while processing it. The default is@* -@file{~/.emacs-mail-crash-box}. - -@item mail-source-delete-incoming -@vindex mail-source-delete-incoming -If non-@code{nil}, delete incoming files after handling them. If -@code{t}, delete the files immediately, if @code{nil}, never delete any -files. If a positive number, delete files older than number of days -(This will only happen, when receiving new mail). You may also set -@code{mail-source-delete-incoming} to @code{nil} and call -@code{mail-source-delete-old-incoming} from a hook or interactively. - -@item mail-source-delete-old-incoming-confirm -@vindex mail-source-delete-old-incoming-confirm -If non-@code{nil}, ask for confirmation before deleting old incoming -files. This variable only applies when -@code{mail-source-delete-incoming} is a positive number. - -@item mail-source-ignore-errors -@vindex mail-source-ignore-errors -If non-@code{nil}, ignore errors when reading mail from a mail source. - -@item mail-source-directory -@vindex mail-source-directory -Directory where incoming mail source files (if any) will be stored. The -default is @file{~/Mail/}. At present, the only thing this is used for -is to say where the incoming files will be stored if the variable -@code{mail-source-delete-incoming} is @code{nil} or a number. - -@item mail-source-incoming-file-prefix -@vindex mail-source-incoming-file-prefix -Prefix for file name for storing incoming mail. The default is -@file{Incoming}, in which case files will end up with names like -@file{Incoming30630D_} or @file{Incoming298602ZD}. This is really only -relevant if @code{mail-source-delete-incoming} is @code{nil} or a -number. - -@item mail-source-default-file-modes -@vindex mail-source-default-file-modes -All new mail files will get this file mode. The default is 384. - -@item mail-source-movemail-program -@vindex mail-source-movemail-program -If non-@code{nil}, name of program for fetching new mail. If -@code{nil}, @code{movemail} in @var{exec-directory}. - -@end table - - -@node Fetching Mail -@subsubsection Fetching Mail - -@vindex mail-sources -@vindex nnmail-spool-file -The way to actually tell Gnus where to get new mail from is to set -@code{mail-sources} to a list of mail source specifiers -(@pxref{Mail Source Specifiers}). - -If this variable (and the obsolescent @code{nnmail-spool-file}) is -@code{nil}, the mail back ends will never attempt to fetch mail by -themselves. - -If you want to fetch mail both from your local spool as well as a -@acronym{POP} mail server, you'd say something like: - -@lisp -(setq mail-sources - '((file) - (pop :server "pop3.mail.server" - :password "secret"))) -@end lisp - -Or, if you don't want to use any of the keyword defaults: - -@lisp -(setq mail-sources - '((file :path "/var/spool/mail/user-name") - (pop :server "pop3.mail.server" - :user "user-name" - :port "pop3" - :password "secret"))) -@end lisp - - -When you use a mail back end, Gnus will slurp all your mail from your -inbox and plonk it down in your home directory. Gnus doesn't move any -mail if you're not using a mail back end---you have to do a lot of magic -invocations first. At the time when you have finished drawing the -pentagram, lightened the candles, and sacrificed the goat, you really -shouldn't be too surprised when Gnus moves your mail. - - - -@node Mail Back End Variables -@subsection Mail Back End Variables - -These variables are (for the most part) pertinent to all the various -mail back ends. - -@table @code -@vindex nnmail-read-incoming-hook -@item nnmail-read-incoming-hook -The mail back ends all call this hook after reading new mail. You can -use this hook to notify any mail watch programs, if you want to. - -@vindex nnmail-split-hook -@item nnmail-split-hook -@findex gnus-article-decode-encoded-words -@cindex RFC 1522 decoding -@cindex RFC 2047 decoding -Hook run in the buffer where the mail headers of each message is kept -just before the splitting based on these headers is done. The hook is -free to modify the buffer contents in any way it sees fit---the buffer -is discarded after the splitting has been done, and no changes performed -in the buffer will show up in any files. -@code{gnus-article-decode-encoded-words} is one likely function to add -to this hook. - -@vindex nnmail-pre-get-new-mail-hook -@vindex nnmail-post-get-new-mail-hook -@item nnmail-pre-get-new-mail-hook -@itemx nnmail-post-get-new-mail-hook -These are two useful hooks executed when treating new incoming -mail---@code{nnmail-pre-get-new-mail-hook} (is called just before -starting to handle the new mail) and -@code{nnmail-post-get-new-mail-hook} (is called when the mail handling -is done). Here's and example of using these two hooks to change the -default file modes the new mail files get: - -@lisp -(add-hook 'nnmail-pre-get-new-mail-hook - (lambda () (set-default-file-modes 511))) - -(add-hook 'nnmail-post-get-new-mail-hook - (lambda () (set-default-file-modes 551))) -@end lisp - -@item nnmail-use-long-file-names -@vindex nnmail-use-long-file-names -If non-@code{nil}, the mail back ends will use long file and directory -names. Groups like @samp{mail.misc} will end up in directories -(assuming use of @code{nnml} back end) or files (assuming use of -@code{nnfolder} back end) like @file{mail.misc}. If it is @code{nil}, -the same group will end up in @file{mail/misc}. - -@item nnmail-delete-file-function -@vindex nnmail-delete-file-function -@findex delete-file -Function called to delete files. It is @code{delete-file} by default. - -@item nnmail-cache-accepted-message-ids -@vindex nnmail-cache-accepted-message-ids -If non-@code{nil}, put the @code{Message-ID}s of articles imported into -the back end (via @code{Gcc}, for instance) into the mail duplication -discovery cache. The default is @code{nil}. - -@item nnmail-cache-ignore-groups -@vindex nnmail-cache-ignore-groups -This can be a regular expression or a list of regular expressions. -Group names that match any of the regular expressions will never be -recorded in the @code{Message-ID} cache. - -This can be useful, for example, when using Fancy Splitting -(@pxref{Fancy Mail Splitting}) together with the function -@code{nnmail-split-fancy-with-parent}. - -@end table - - -@node Fancy Mail Splitting -@subsection Fancy Mail Splitting -@cindex mail splitting -@cindex fancy mail splitting - -@vindex nnmail-split-fancy -@findex nnmail-split-fancy -If the rather simple, standard method for specifying how to split mail -doesn't allow you to do what you want, you can set -@code{nnmail-split-methods} to @code{nnmail-split-fancy}. Then you can -play with the @code{nnmail-split-fancy} variable. - -Let's look at an example value of this variable first: - -@lisp -;; @r{Messages from the mailer daemon are not crossposted to any of} -;; @r{the ordinary groups. Warnings are put in a separate group} -;; @r{from real errors.} -(| ("from" mail (| ("subject" "warn.*" "mail.warning") - "mail.misc")) - ;; @r{Non-error messages are crossposted to all relevant} - ;; @r{groups, but we don't crosspost between the group for the} - ;; @r{(ding) list and the group for other (ding) related mail.} - (& (| (any "ding@@ifi\\.uio\\.no" "ding.list") - ("subject" "ding" "ding.misc")) - ;; @r{Other mailing lists@dots{}} - (any "procmail@@informatik\\.rwth-aachen\\.de" "procmail.list") - (any "SmartList@@informatik\\.rwth-aachen\\.de" "SmartList.list") - ;; @r{Both lists below have the same suffix, so prevent} - ;; @r{cross-posting to mkpkg.list of messages posted only to} - ;; @r{the bugs- list, but allow cross-posting when the} - ;; @r{message was really cross-posted.} - (any "bugs-mypackage@@somewhere" "mypkg.bugs") - (any "mypackage@@somewhere" - "bugs-mypackage" "mypkg.list") - ;; @r{People@dots{}} - (any "larsi@@ifi\\.uio\\.no" "people.Lars_Magne_Ingebrigtsen")) - ;; @r{Unmatched mail goes to the catch all group.} - "misc.misc") -@end lisp - -This variable has the format of a @dfn{split}. A split is a -(possibly) recursive structure where each split may contain other -splits. Here are the possible split syntaxes: - -@table @code - -@item group -If the split is a string, that will be taken as a group name. Normal -regexp match expansion will be done. See below for examples. - -@c Don't fold this line. -@item (@var{field} @var{value} [- @var{restrict} [@dots{}] ] @var{split} [@var{invert-partial}]) -The split can be a list containing at least three elements. If the -first element @var{field} (a regexp matching a header) contains -@var{value} (also a regexp) then store the message as specified by -@var{split}. - -If @var{restrict} (yet another regexp) matches some string after -@var{field} and before the end of the matched @var{value}, the -@var{split} is ignored. If none of the @var{restrict} clauses match, -@var{split} is processed. - -The last element @var{invert-partial} is optional. If it is -non-@code{nil}, the match-partial-words behavior controlled by the -variable @code{nnmail-split-fancy-match-partial-words} (see below) is -be inverted. (New in Gnus 5.10.7) - -@item (| @var{split} @dots{}) -If the split is a list, and the first element is @code{|} (vertical -bar), then process each @var{split} until one of them matches. A -@var{split} is said to match if it will cause the mail message to be -stored in one or more groups. - -@item (& @var{split} @dots{}) -If the split is a list, and the first element is @code{&}, then -process all @var{split}s in the list. - -@item junk -If the split is the symbol @code{junk}, then don't save (i.e., delete) -this message. Use with extreme caution. - -@item (: @var{function} @var{arg1} @var{arg2} @dots{}) -If the split is a list, and the first element is @samp{:}, then the -second element will be called as a function with @var{args} given as -arguments. The function should return a @var{split}. - -@cindex body split -For instance, the following function could be used to split based on the -body of the messages: - -@lisp -(defun split-on-body () - (save-excursion - (save-restriction - (widen) - (goto-char (point-min)) - (when (re-search-forward "Some.*string" nil t) - "string.group")))) -@end lisp - -The buffer is narrowed to the message in question when @var{function} -is run. That's why @code{(widen)} needs to be called after -@code{save-excursion} and @code{save-restriction} in the example -above. Also note that with the nnimap backend, message bodies will -not be downloaded by default. You need to set -@code{nnimap-split-download-body} to @code{t} to do that -(@pxref{Splitting in IMAP}). - -@item (! @var{func} @var{split}) -If the split is a list, and the first element is @code{!}, then -@var{split} will be processed, and @var{func} will be called as a -function with the result of @var{split} as argument. @var{func} -should return a split. - -@item nil -If the split is @code{nil}, it is ignored. - -@end table - -In these splits, @var{field} must match a complete field name. - -Normally, @var{value} in these splits must match a complete @emph{word} -according to the fundamental mode syntax table. In other words, all -@var{value}'s will be implicitly surrounded by @code{\<...\>} markers, -which are word delimiters. Therefore, if you use the following split, -for example, - -@example -(any "joe" "joemail") -@end example - -@noindent -messages sent from @samp{joedavis@@foo.org} will normally not be filed -in @samp{joemail}. If you want to alter this behavior, you can use any -of the following three ways: - -@enumerate -@item -@vindex nnmail-split-fancy-match-partial-words -You can set the @code{nnmail-split-fancy-match-partial-words} variable -to non-@code{nil} in order to ignore word boundaries and instead the -match becomes more like a grep. This variable controls whether partial -words are matched during fancy splitting. The default value is -@code{nil}. - -Note that it influences all @var{value}'s in your split rules. - -@item -@var{value} beginning with @code{.*} ignores word boundaries in front of -a word. Similarly, if @var{value} ends with @code{.*}, word boundaries -in the rear of a word will be ignored. For example, the @var{value} -@code{"@@example\\.com"} does not match @samp{foo@@example.com} but -@code{".*@@example\\.com"} does. - -@item -You can set the @var{invert-partial} flag in your split rules of the -@samp{(@var{field} @var{value} @dots{})} types, aforementioned in this -section. If the flag is set, word boundaries on both sides of a word -are ignored even if @code{nnmail-split-fancy-match-partial-words} is -@code{nil}. Contrarily, if the flag is set, word boundaries are not -ignored even if @code{nnmail-split-fancy-match-partial-words} is -non-@code{nil}. (New in Gnus 5.10.7) -@end enumerate - -@vindex nnmail-split-abbrev-alist -@var{field} and @var{value} can also be Lisp symbols, in that case -they are expanded as specified by the variable -@code{nnmail-split-abbrev-alist}. This is an alist of cons cells, -where the @sc{car} of a cell contains the key, and the @sc{cdr} -contains the associated value. Predefined entries in -@code{nnmail-split-abbrev-alist} include: - -@table @code -@item from -Matches the @samp{From}, @samp{Sender} and @samp{Resent-From} fields. -@item to -Matches the @samp{To}, @samp{Cc}, @samp{Apparently-To}, -@samp{Resent-To} and @samp{Resent-Cc} fields. -@item any -Is the union of the @code{from} and @code{to} entries. -@end table - -@vindex nnmail-split-fancy-syntax-table -@code{nnmail-split-fancy-syntax-table} is the syntax table in effect -when all this splitting is performed. - -If you want to have Gnus create groups dynamically based on some -information in the headers (i.e., do @code{replace-match}-like -substitutions in the group names), you can say things like: - -@example -(any "debian-\\b\\(\\w+\\)@@lists.debian.org" "mail.debian.\\1") -@end example - -In this example, messages sent to @samp{debian-foo@@lists.debian.org} -will be filed in @samp{mail.debian.foo}. - -If the string contains the element @samp{\&}, then the previously -matched string will be substituted. Similarly, the elements @samp{\\1} -up to @samp{\\9} will be substituted with the text matched by the -groupings 1 through 9. - -@vindex nnmail-split-lowercase-expanded -Where @code{nnmail-split-lowercase-expanded} controls whether the -lowercase of the matched string should be used for the substitution. -Setting it as non-@code{nil} is useful to avoid the creation of multiple -groups when users send to an address using different case -(i.e. mailing-list@@domain vs Mailing-List@@Domain). The default value -is @code{t}. - -@findex nnmail-split-fancy-with-parent -@code{nnmail-split-fancy-with-parent} is a function which allows you to -split followups into the same groups their parents are in. Sometimes -you can't make splitting rules for all your mail. For example, your -boss might send you personal mail regarding different projects you are -working on, and as you can't tell your boss to put a distinguishing -string into the subject line, you have to resort to manually moving the -messages into the right group. With this function, you only have to do -it once per thread. - -To use this feature, you have to set @code{nnmail-treat-duplicates} -and @code{nnmail-cache-accepted-message-ids} to a non-@code{nil} -value. And then you can include @code{nnmail-split-fancy-with-parent} -using the colon feature, like so: -@lisp -(setq nnmail-treat-duplicates 'warn ; @r{or @code{delete}} - nnmail-cache-accepted-message-ids t - nnmail-split-fancy - '(| (: nnmail-split-fancy-with-parent) - ;; @r{other splits go here} - )) -@end lisp - -This feature works as follows: when @code{nnmail-treat-duplicates} is -non-@code{nil}, Gnus records the message id of every message it sees -in the file specified by the variable -@code{nnmail-message-id-cache-file}, together with the group it is in -(the group is omitted for non-mail messages). When mail splitting is -invoked, the function @code{nnmail-split-fancy-with-parent} then looks -at the References (and In-Reply-To) header of each message to split -and searches the file specified by @code{nnmail-message-id-cache-file} -for the message ids. When it has found a parent, it returns the -corresponding group name unless the group name matches the regexp -@code{nnmail-split-fancy-with-parent-ignore-groups}. It is -recommended that you set @code{nnmail-message-id-cache-length} to a -somewhat higher number than the default so that the message ids are -still in the cache. (A value of 5000 appears to create a file some -300 kBytes in size.) -@vindex nnmail-cache-accepted-message-ids -When @code{nnmail-cache-accepted-message-ids} is non-@code{nil}, Gnus -also records the message ids of moved articles, so that the followup -messages goes into the new group. - -Also see the variable @code{nnmail-cache-ignore-groups} if you don't -want certain groups to be recorded in the cache. For example, if all -outgoing messages are written to an ``outgoing'' group, you could set -@code{nnmail-cache-ignore-groups} to match that group name. -Otherwise, answers to all your messages would end up in the -``outgoing'' group. - - -@node Group Mail Splitting -@subsection Group Mail Splitting -@cindex mail splitting -@cindex group mail splitting - -@findex gnus-group-split -If you subscribe to dozens of mailing lists but you don't want to -maintain mail splitting rules manually, group mail splitting is for you. -You just have to set @code{to-list} and/or @code{to-address} in group -parameters or group customization and set @code{nnmail-split-methods} to -@code{gnus-group-split}. This splitting function will scan all groups -for those parameters and split mail accordingly, i.e., messages posted -from or to the addresses specified in the parameters @code{to-list} or -@code{to-address} of a mail group will be stored in that group. - -Sometimes, mailing lists have multiple addresses, and you may want mail -splitting to recognize them all: just set the @code{extra-aliases} group -parameter to the list of additional addresses and it's done. If you'd -rather use a regular expression, set @code{split-regexp}. - -All these parameters in a group will be used to create an -@code{nnmail-split-fancy} split, in which the @var{field} is @samp{any}, -the @var{value} is a single regular expression that matches -@code{to-list}, @code{to-address}, all of @code{extra-aliases} and all -matches of @code{split-regexp}, and the @var{split} is the name of the -group. @var{restrict}s are also supported: just set the -@code{split-exclude} parameter to a list of regular expressions. - -If you can't get the right split to be generated using all these -parameters, or you just need something fancier, you can set the -parameter @code{split-spec} to an @code{nnmail-split-fancy} split. In -this case, all other aforementioned parameters will be ignored by -@code{gnus-group-split}. In particular, @code{split-spec} may be set to -@code{nil}, in which case the group will be ignored by -@code{gnus-group-split}. - -@vindex gnus-group-split-default-catch-all-group -@code{gnus-group-split} will do cross-posting on all groups that match, -by defining a single @code{&} fancy split containing one split for each -group. If a message doesn't match any split, it will be stored in the -group named in @code{gnus-group-split-default-catch-all-group}, unless -some group has @code{split-spec} set to @code{catch-all}, in which case -that group is used as the catch-all group. Even though this variable is -often used just to name a group, it may also be set to an arbitrarily -complex fancy split (after all, a group name is a fancy split), and this -may be useful to split mail that doesn't go to any mailing list to -personal mail folders. Note that this fancy split is added as the last -element of a @code{|} split list that also contains a @code{&} split -with the rules extracted from group parameters. - -It's time for an example. Assume the following group parameters have -been defined: - -@example -nnml:mail.bar: -((to-address . "bar@@femail.com") - (split-regexp . ".*@@femail\\.com")) -nnml:mail.foo: -((to-list . "foo@@nowhere.gov") - (extra-aliases "foo@@localhost" "foo-redist@@home") - (split-exclude "bugs-foo" "rambling-foo") - (admin-address . "foo-request@@nowhere.gov")) -nnml:mail.others: -((split-spec . catch-all)) -@end example - -Setting @code{nnmail-split-methods} to @code{gnus-group-split} will -behave as if @code{nnmail-split-fancy} had been selected and variable -@code{nnmail-split-fancy} had been set as follows: - -@lisp -(| (& (any "\\(bar@@femail\\.com\\|.*@@femail\\.com\\)" "mail.bar") - (any "\\(foo@@nowhere\\.gov\\|foo@@localhost\\|foo-redist@@home\\)" - - "bugs-foo" - "rambling-foo" "mail.foo")) - "mail.others") -@end lisp - -@findex gnus-group-split-fancy -If you'd rather not use group splitting for all your mail groups, you -may use it for only some of them, by using @code{nnmail-split-fancy} -splits like this: - -@lisp -(: gnus-group-split-fancy @var{groups} @var{no-crosspost} @var{catch-all}) -@end lisp - -@var{groups} may be a regular expression or a list of group names whose -parameters will be scanned to generate the output split. -@var{no-crosspost} can be used to disable cross-posting; in this case, a -single @code{|} split will be output. @var{catch-all} is the fall back -fancy split, used like @code{gnus-group-split-default-catch-all-group}. -If @var{catch-all} is @code{nil}, or if @code{split-regexp} matches the -empty string in any selected group, no catch-all split will be issued. -Otherwise, if some group has @code{split-spec} set to @code{catch-all}, -this group will override the value of the @var{catch-all} argument. - -@findex gnus-group-split-setup -Unfortunately, scanning all groups and their parameters can be quite -slow, especially considering that it has to be done for every message. -But don't despair! The function @code{gnus-group-split-setup} can be -used to enable @code{gnus-group-split} in a much more efficient way. It -sets @code{nnmail-split-methods} to @code{nnmail-split-fancy} and sets -@code{nnmail-split-fancy} to the split produced by -@code{gnus-group-split-fancy}. Thus, the group parameters are only -scanned once, no matter how many messages are split. - -@findex gnus-group-split-update -However, if you change group parameters, you'd have to update -@code{nnmail-split-fancy} manually. You can do it by running -@code{gnus-group-split-update}. If you'd rather have it updated -automatically, just tell @code{gnus-group-split-setup} to do it for -you. For example, add to your @file{~/.gnus.el}: - -@lisp -(gnus-group-split-setup @var{auto-update} @var{catch-all}) -@end lisp - -If @var{auto-update} is non-@code{nil}, @code{gnus-group-split-update} -will be added to @code{nnmail-pre-get-new-mail-hook}, so you won't ever -have to worry about updating @code{nnmail-split-fancy} again. If you -don't omit @var{catch-all} (it's optional, equivalent to @code{nil}), -@code{gnus-group-split-default-catch-all-group} will be set to its -value. - -@vindex gnus-group-split-updated-hook -Because you may want to change @code{nnmail-split-fancy} after it is set -by @code{gnus-group-split-update}, this function will run -@code{gnus-group-split-updated-hook} just before finishing. - -@node Incorporating Old Mail -@subsection Incorporating Old Mail -@cindex incorporating old mail -@cindex import old mail - -Most people have lots of old mail stored in various file formats. If -you have set up Gnus to read mail using one of the spiffy Gnus mail -back ends, you'll probably wish to have that old mail incorporated into -your mail groups. - -Doing so can be quite easy. - -To take an example: You're reading mail using @code{nnml} -(@pxref{Mail Spool}), and have set @code{nnmail-split-methods} to a -satisfactory value (@pxref{Splitting Mail}). You have an old Unix mbox -file filled with important, but old, mail. You want to move it into -your @code{nnml} groups. - -Here's how: - -@enumerate -@item -Go to the group buffer. - -@item -Type @kbd{G f} and give the file name to the mbox file when prompted to create an -@code{nndoc} group from the mbox file (@pxref{Foreign Groups}). - -@item -Type @kbd{SPACE} to enter the newly created group. - -@item -Type @kbd{M P b} to process-mark all articles in this group's buffer -(@pxref{Setting Process Marks}). - -@item -Type @kbd{B r} to respool all the process-marked articles, and answer -@samp{nnml} when prompted (@pxref{Mail Group Commands}). -@end enumerate - -All the mail messages in the mbox file will now also be spread out over -all your @code{nnml} groups. Try entering them and check whether things -have gone without a glitch. If things look ok, you may consider -deleting the mbox file, but I wouldn't do that unless I was absolutely -sure that all the mail has ended up where it should be. - -Respooling is also a handy thing to do if you're switching from one mail -back end to another. Just respool all the mail in the old mail groups -using the new mail back end. - - -@node Expiring Mail -@subsection Expiring Mail -@cindex article expiry -@cindex expiring mail - -Traditional mail readers have a tendency to remove mail articles when -you mark them as read, in some way. Gnus takes a fundamentally -different approach to mail reading. - -Gnus basically considers mail just to be news that has been received in -a rather peculiar manner. It does not think that it has the power to -actually change the mail, or delete any mail messages. If you enter a -mail group, and mark articles as ``read'', or kill them in some other -fashion, the mail articles will still exist on the system. I repeat: -Gnus will not delete your old, read mail. Unless you ask it to, of -course. - -To make Gnus get rid of your unwanted mail, you have to mark the -articles as @dfn{expirable}. (With the default key bindings, this means -that you have to type @kbd{E}.) This does not mean that the articles -will disappear right away, however. In general, a mail article will be -deleted from your system if, 1) it is marked as expirable, AND 2) it is -more than one week old. If you do not mark an article as expirable, it -will remain on your system until hell freezes over. This bears -repeating one more time, with some spurious capitalizations: IF you do -NOT mark articles as EXPIRABLE, Gnus will NEVER delete those ARTICLES. - -You do not have to mark articles as expirable by hand. Gnus provides -two features, called ``auto-expire'' and ``total-expire'', that can help you -with this. In a nutshell, ``auto-expire'' means that Gnus hits @kbd{E} -for you when you select an article. And ``total-expire'' means that Gnus -considers all articles as expirable that are read. So, in addition to -the articles marked @samp{E}, also the articles marked @samp{r}, -@samp{R}, @samp{O}, @samp{K}, @samp{Y} and so on are considered -expirable. - -When should either auto-expire or total-expire be used? Most people -who are subscribed to mailing lists split each list into its own group -and then turn on auto-expire or total-expire for those groups. -(@xref{Splitting Mail}, for more information on splitting each list -into its own group.) - -Which one is better, auto-expire or total-expire? It's not easy to -answer. Generally speaking, auto-expire is probably faster. Another -advantage of auto-expire is that you get more marks to work with: for -the articles that are supposed to stick around, you can still choose -between tick and dormant and read marks. But with total-expire, you -only have dormant and ticked to choose from. The advantage of -total-expire is that it works well with adaptive scoring (@pxref{Adaptive -Scoring}). Auto-expire works with normal scoring but not with adaptive -scoring. - -@vindex gnus-auto-expirable-newsgroups -Groups that match the regular expression -@code{gnus-auto-expirable-newsgroups} will have all articles that you -read marked as expirable automatically. All articles marked as -expirable have an @samp{E} in the first column in the summary buffer. - -By default, if you have auto expiry switched on, Gnus will mark all the -articles you read as expirable, no matter if they were read or unread -before. To avoid having articles marked as read marked as expirable -automatically, you can put something like the following in your -@file{~/.gnus.el} file: - -@vindex gnus-mark-article-hook -@lisp -(remove-hook 'gnus-mark-article-hook - 'gnus-summary-mark-read-and-unread-as-read) -(add-hook 'gnus-mark-article-hook 'gnus-summary-mark-unread-as-read) -@end lisp - -Note that making a group auto-expirable doesn't mean that all read -articles are expired---only the articles marked as expirable -will be expired. Also note that using the @kbd{d} command won't make -articles expirable---only semi-automatic marking of articles as read will -mark the articles as expirable in auto-expirable groups. - -Let's say you subscribe to a couple of mailing lists, and you want the -articles you have read to disappear after a while: - -@lisp -(setq gnus-auto-expirable-newsgroups - "mail.nonsense-list\\|mail.nice-list") -@end lisp - -Another way to have auto-expiry happen is to have the element -@code{auto-expire} in the group parameters of the group. - -If you use adaptive scoring (@pxref{Adaptive Scoring}) and -auto-expiring, you'll have problems. Auto-expiring and adaptive scoring -don't really mix very well. - -@vindex nnmail-expiry-wait -The @code{nnmail-expiry-wait} variable supplies the default time an -expirable article has to live. Gnus starts counting days from when the -message @emph{arrived}, not from when it was sent. The default is seven -days. - -Gnus also supplies a function that lets you fine-tune how long articles -are to live, based on what group they are in. Let's say you want to -have one month expiry period in the @samp{mail.private} group, a one day -expiry period in the @samp{mail.junk} group, and a six day expiry period -everywhere else: - -@vindex nnmail-expiry-wait-function -@lisp -(setq nnmail-expiry-wait-function - (lambda (group) - (cond ((string= group "mail.private") - 31) - ((string= group "mail.junk") - 1) - ((string= group "important") - 'never) - (t - 6)))) -@end lisp - -The group names this function is fed are ``unadorned'' group -names---no @samp{nnml:} prefixes and the like. - -The @code{nnmail-expiry-wait} variable and -@code{nnmail-expiry-wait-function} function can either be a number (not -necessarily an integer) or one of the symbols @code{immediate} or -@code{never}. - -You can also use the @code{expiry-wait} group parameter to selectively -change the expiry period (@pxref{Group Parameters}). - -@vindex nnmail-expiry-target -The normal action taken when expiring articles is to delete them. -However, in some circumstances it might make more sense to move them -to other groups instead of deleting them. The variable -@code{nnmail-expiry-target} (and the @code{expiry-target} group -parameter) controls this. The variable supplies a default value for -all groups, which can be overridden for specific groups by the group -parameter. default value is @code{delete}, but this can also be a -string (which should be the name of the group the message should be -moved to), or a function (which will be called in a buffer narrowed to -the message in question, and with the name of the group being moved -from as its parameter) which should return a target---either a group -name or @code{delete}. - -Here's an example for specifying a group name: -@lisp -(setq nnmail-expiry-target "nnml:expired") -@end lisp - -@findex nnmail-fancy-expiry-target -@vindex nnmail-fancy-expiry-targets -Gnus provides a function @code{nnmail-fancy-expiry-target} which will -expire mail to groups according to the variable -@code{nnmail-fancy-expiry-targets}. Here's an example: - -@lisp - (setq nnmail-expiry-target 'nnmail-fancy-expiry-target - nnmail-fancy-expiry-targets - '((to-from "boss" "nnfolder:Work") - ("subject" "IMPORTANT" "nnfolder:IMPORTANT.%Y.%b") - ("from" ".*" "nnfolder:Archive-%Y"))) -@end lisp - -With this setup, any mail that has @code{IMPORTANT} in its Subject -header and was sent in the year @code{YYYY} and month @code{MMM}, will -get expired to the group @code{nnfolder:IMPORTANT.YYYY.MMM}. If its -From or To header contains the string @code{boss}, it will get expired -to @code{nnfolder:Work}. All other mail will get expired to -@code{nnfolder:Archive-YYYY}. - -@vindex nnmail-keep-last-article -If @code{nnmail-keep-last-article} is non-@code{nil}, Gnus will never -expire the final article in a mail newsgroup. This is to make life -easier for procmail users. - -@vindex gnus-total-expirable-newsgroups -By the way: That line up there, about Gnus never expiring non-expirable -articles, is a lie. If you put @code{total-expire} in the group -parameters, articles will not be marked as expirable, but all read -articles will be put through the expiry process. Use with extreme -caution. Even more dangerous is the -@code{gnus-total-expirable-newsgroups} variable. All groups that match -this regexp will have all read articles put through the expiry process, -which means that @emph{all} old mail articles in the groups in question -will be deleted after a while. Use with extreme caution, and don't come -crying to me when you discover that the regexp you used matched the -wrong group and all your important mail has disappeared. Be a -@emph{man}! Or a @emph{woman}! Whatever you feel more comfortable -with! So there! - -Most people make most of their mail groups total-expirable, though. - -@vindex gnus-inhibit-user-auto-expire -If @code{gnus-inhibit-user-auto-expire} is non-@code{nil}, user marking -commands will not mark an article as expirable, even if the group has -auto-expire turned on. - - -@node Washing Mail -@subsection Washing Mail -@cindex mail washing -@cindex list server brain damage -@cindex incoming mail treatment - -Mailers and list servers are notorious for doing all sorts of really, -really stupid things with mail. ``Hey, RFC 822 doesn't explicitly -prohibit us from adding the string @code{wE aRe ElItE!!!!!1!!} to the -end of all lines passing through our server, so let's do that!!!!1!'' -Yes, but RFC 822 wasn't designed to be read by morons. Things that were -considered to be self-evident were not discussed. So. Here we are. - -Case in point: The German version of Microsoft Exchange adds @samp{AW: -} to the subjects of replies instead of @samp{Re: }. I could pretend to -be shocked and dismayed by this, but I haven't got the energy. It is to -laugh. - -Gnus provides a plethora of functions for washing articles while -displaying them, but it might be nicer to do the filtering before -storing the mail to disk. For that purpose, we have three hooks and -various functions that can be put in these hooks. - -@table @code -@item nnmail-prepare-incoming-hook -@vindex nnmail-prepare-incoming-hook -This hook is called before doing anything with the mail and is meant for -grand, sweeping gestures. It is called in a buffer that contains all -the new, incoming mail. Functions to be used include: - -@table @code -@item nnheader-ms-strip-cr -@findex nnheader-ms-strip-cr -Remove trailing carriage returns from each line. This is default on -Emacs running on MS machines. - -@end table - -@item nnmail-prepare-incoming-header-hook -@vindex nnmail-prepare-incoming-header-hook -This hook is called narrowed to each header. It can be used when -cleaning up the headers. Functions that can be used include: - -@table @code -@item nnmail-remove-leading-whitespace -@findex nnmail-remove-leading-whitespace -Clear leading white space that ``helpful'' listservs have added to the -headers to make them look nice. Aaah. - -(Note that this function works on both the header on the body of all -messages, so it is a potentially dangerous function to use (if a body -of a message contains something that looks like a header line). So -rather than fix the bug, it is of course the right solution to make it -into a feature by documenting it.) - -@item nnmail-remove-list-identifiers -@findex nnmail-remove-list-identifiers -Some list servers add an identifier---for example, @samp{(idm)}---to the -beginning of all @code{Subject} headers. I'm sure that's nice for -people who use stone age mail readers. This function will remove -strings that match the @code{nnmail-list-identifiers} regexp, which can -also be a list of regexp. @code{nnmail-list-identifiers} may not contain -@code{\\(..\\)}. - -For instance, if you want to remove the @samp{(idm)} and the -@samp{nagnagnag} identifiers: - -@lisp -(setq nnmail-list-identifiers - '("(idm)" "nagnagnag")) -@end lisp - -This can also be done non-destructively with -@code{gnus-list-identifiers}, @xref{Article Hiding}. - -@item nnmail-remove-tabs -@findex nnmail-remove-tabs -Translate all @samp{TAB} characters into @samp{SPACE} characters. - -@item nnmail-fix-eudora-headers -@findex nnmail-fix-eudora-headers -@cindex Eudora -Eudora produces broken @code{References} headers, but OK -@code{In-Reply-To} headers. This function will get rid of the -@code{References} headers. - -@end table - -@item nnmail-prepare-incoming-message-hook -@vindex nnmail-prepare-incoming-message-hook -This hook is called narrowed to each message. Functions to be used -include: - -@table @code -@item article-de-quoted-unreadable -@findex article-de-quoted-unreadable -Decode Quoted Readable encoding. - -@end table -@end table - - -@node Duplicates -@subsection Duplicates - -@vindex nnmail-treat-duplicates -@vindex nnmail-message-id-cache-length -@vindex nnmail-message-id-cache-file -@cindex duplicate mails -If you are a member of a couple of mailing lists, you will sometimes -receive two copies of the same mail. This can be quite annoying, so -@code{nnmail} checks for and treats any duplicates it might find. To do -this, it keeps a cache of old @code{Message-ID}s--- -@code{nnmail-message-id-cache-file}, which is @file{~/.nnmail-cache} by -default. The approximate maximum number of @code{Message-ID}s stored -there is controlled by the @code{nnmail-message-id-cache-length} -variable, which is 1000 by default. (So 1000 @code{Message-ID}s will be -stored.) If all this sounds scary to you, you can set -@code{nnmail-treat-duplicates} to @code{warn} (which is what it is by -default), and @code{nnmail} won't delete duplicate mails. Instead it -will insert a warning into the head of the mail saying that it thinks -that this is a duplicate of a different message. - -This variable can also be a function. If that's the case, the function -will be called from a buffer narrowed to the message in question with -the @code{Message-ID} as a parameter. The function must return either -@code{nil}, @code{warn}, or @code{delete}. - -You can turn this feature off completely by setting the variable to -@code{nil}. - -If you want all the duplicate mails to be put into a special -@dfn{duplicates} group, you could do that using the normal mail split -methods: - -@lisp -(setq nnmail-split-fancy - '(| ;; @r{Messages duplicates go to a separate group.} - ("gnus-warning" "duplicat\\(e\\|ion\\) of message" "duplicate") - ;; @r{Message from daemons, postmaster, and the like to another.} - (any mail "mail.misc") - ;; @r{Other rules.} - [...] )) -@end lisp -@noindent -Or something like: -@lisp -(setq nnmail-split-methods - '(("duplicates" "^Gnus-Warning:.*duplicate") - ;; @r{Other rules.} - [...])) -@end lisp - -Here's a neat feature: If you know that the recipient reads her mail -with Gnus, and that she has @code{nnmail-treat-duplicates} set to -@code{delete}, you can send her as many insults as you like, just by -using a @code{Message-ID} of a mail that you know that she's already -received. Think of all the fun! She'll never see any of it! Whee! - - -@node Not Reading Mail -@subsection Not Reading Mail - -If you start using any of the mail back ends, they have the annoying -habit of assuming that you want to read mail with them. This might not -be unreasonable, but it might not be what you want. - -If you set @code{mail-sources} and @code{nnmail-spool-file} to -@code{nil}, none of the back ends will ever attempt to read incoming -mail, which should help. - -@vindex nnbabyl-get-new-mail -@vindex nnmbox-get-new-mail -@vindex nnml-get-new-mail -@vindex nnmh-get-new-mail -@vindex nnfolder-get-new-mail -This might be too much, if, for instance, you are reading mail quite -happily with @code{nnml} and just want to peek at some old Rmail -file you have stashed away with @code{nnbabyl}. All back ends have -variables called back-end-@code{get-new-mail}. If you want to disable -the @code{nnbabyl} mail reading, you edit the virtual server for the -group to have a setting where @code{nnbabyl-get-new-mail} to @code{nil}. - -All the mail back ends will call @code{nn}*@code{-prepare-save-mail-hook} -narrowed to the article to be saved before saving it when reading -incoming mail. - - -@node Choosing a Mail Back End -@subsection Choosing a Mail Back End - -Gnus will read the mail spool when you activate a mail group. The mail -file is first copied to your home directory. What happens after that -depends on what format you want to store your mail in. - -There are six different mail back ends in the standard Gnus, and more -back ends are available separately. The mail back end most people use -(because it is possibly the fastest) is @code{nnml} (@pxref{Mail -Spool}). - -@menu -* Unix Mail Box:: Using the (quite) standard Un*x mbox. -* Rmail Babyl:: Emacs programs use the Rmail Babyl format. -* Mail Spool:: Store your mail in a private spool? -* MH Spool:: An mhspool-like back end. -* Maildir:: Another one-file-per-message format. -* Mail Folders:: Having one file for each group. -* Comparing Mail Back Ends:: An in-depth looks at pros and cons. -@end menu - - -@node Unix Mail Box -@subsubsection Unix Mail Box -@cindex nnmbox -@cindex unix mail box - -@vindex nnmbox-active-file -@vindex nnmbox-mbox-file -The @dfn{nnmbox} back end will use the standard Un*x mbox file to store -mail. @code{nnmbox} will add extra headers to each mail article to say -which group it belongs in. - -Virtual server settings: - -@table @code -@item nnmbox-mbox-file -@vindex nnmbox-mbox-file -The name of the mail box in the user's home directory. Default is -@file{~/mbox}. - -@item nnmbox-active-file -@vindex nnmbox-active-file -The name of the active file for the mail box. Default is -@file{~/.mbox-active}. - -@item nnmbox-get-new-mail -@vindex nnmbox-get-new-mail -If non-@code{nil}, @code{nnmbox} will read incoming mail and split it -into groups. Default is @code{t}. -@end table - - -@node Rmail Babyl -@subsubsection Rmail Babyl -@cindex nnbabyl -@cindex Rmail mbox - -@vindex nnbabyl-active-file -@vindex nnbabyl-mbox-file -The @dfn{nnbabyl} back end will use a Babyl mail box (aka. @dfn{Rmail -mbox}) to store mail. @code{nnbabyl} will add extra headers to each -mail article to say which group it belongs in. - -Virtual server settings: - -@table @code -@item nnbabyl-mbox-file -@vindex nnbabyl-mbox-file -The name of the Rmail mbox file. The default is @file{~/RMAIL} - -@item nnbabyl-active-file -@vindex nnbabyl-active-file -The name of the active file for the rmail box. The default is -@file{~/.rmail-active} - -@item nnbabyl-get-new-mail -@vindex nnbabyl-get-new-mail -If non-@code{nil}, @code{nnbabyl} will read incoming mail. Default is -@code{t} -@end table - - -@node Mail Spool -@subsubsection Mail Spool -@cindex nnml -@cindex mail @acronym{NOV} spool - -The @dfn{nnml} spool mail format isn't compatible with any other known -format. It should be used with some caution. - -@vindex nnml-directory -If you use this back end, Gnus will split all incoming mail into files, -one file for each mail, and put the articles into the corresponding -directories under the directory specified by the @code{nnml-directory} -variable. The default value is @file{~/Mail/}. - -You do not have to create any directories beforehand; Gnus will take -care of all that. - -If you have a strict limit as to how many files you are allowed to store -in your account, you should not use this back end. As each mail gets its -own file, you might very well occupy thousands of inodes within a few -weeks. If this is no problem for you, and it isn't a problem for you -having your friendly systems administrator walking around, madly, -shouting ``Who is eating all my inodes?! Who? Who!?!'', then you should -know that this is probably the fastest format to use. You do not have -to trudge through a big mbox file just to read your new mail. - -@code{nnml} is probably the slowest back end when it comes to article -splitting. It has to create lots of files, and it also generates -@acronym{NOV} databases for the incoming mails. This makes it possibly the -fastest back end when it comes to reading mail. - -@cindex self contained nnml servers -@cindex marks -When the marks file is used (which it is by default), @code{nnml} -servers have the property that you may backup them using @code{tar} or -similar, and later be able to restore them into Gnus (by adding the -proper @code{nnml} server) and have all your marks be preserved. Marks -for a group is usually stored in the @code{.marks} file (but see -@code{nnml-marks-file-name}) within each @code{nnml} group's directory. -Individual @code{nnml} groups are also possible to backup, use @kbd{G m} -to restore the group (after restoring the backup into the nnml -directory). - -If for some reason you believe your @file{.marks} files are screwed -up, you can just delete them all. Gnus will then correctly regenerate -them next time it starts. - -Virtual server settings: - -@table @code -@item nnml-directory -@vindex nnml-directory -All @code{nnml} directories will be placed under this directory. The -default is the value of @code{message-directory} (whose default value -is @file{~/Mail}). - -@item nnml-active-file -@vindex nnml-active-file -The active file for the @code{nnml} server. The default is -@file{~/Mail/active}. - -@item nnml-newsgroups-file -@vindex nnml-newsgroups-file -The @code{nnml} group descriptions file. @xref{Newsgroups File -Format}. The default is @file{~/Mail/newsgroups}. - -@item nnml-get-new-mail -@vindex nnml-get-new-mail -If non-@code{nil}, @code{nnml} will read incoming mail. The default is -@code{t}. - -@item nnml-nov-is-evil -@vindex nnml-nov-is-evil -If non-@code{nil}, this back end will ignore any @acronym{NOV} files. The -default is @code{nil}. - -@item nnml-nov-file-name -@vindex nnml-nov-file-name -The name of the @acronym{NOV} files. The default is @file{.overview}. - -@item nnml-prepare-save-mail-hook -@vindex nnml-prepare-save-mail-hook -Hook run narrowed to an article before saving. - -@item nnml-marks-is-evil -@vindex nnml-marks-is-evil -If non-@code{nil}, this back end will ignore any @sc{marks} files. The -default is @code{nil}. - -@item nnml-marks-file-name -@vindex nnml-marks-file-name -The name of the @dfn{marks} files. The default is @file{.marks}. - -@item nnml-use-compressed-files -@vindex nnml-use-compressed-files -If non-@code{nil}, @code{nnml} will allow using compressed message -files. - -@end table - -@findex nnml-generate-nov-databases -If your @code{nnml} groups and @acronym{NOV} files get totally out of -whack, you can do a complete update by typing @kbd{M-x -nnml-generate-nov-databases}. This command will trawl through the -entire @code{nnml} hierarchy, looking at each and every article, so it -might take a while to complete. A better interface to this -functionality can be found in the server buffer (@pxref{Server -Commands}). - - -@node MH Spool -@subsubsection MH Spool -@cindex nnmh -@cindex mh-e mail spool - -@code{nnmh} is just like @code{nnml}, except that is doesn't generate -@acronym{NOV} databases and it doesn't keep an active file or marks -file. This makes @code{nnmh} a @emph{much} slower back end than -@code{nnml}, but it also makes it easier to write procmail scripts -for. - -Virtual server settings: - -@table @code -@item nnmh-directory -@vindex nnmh-directory -All @code{nnmh} directories will be located under this directory. The -default is the value of @code{message-directory} (whose default is -@file{~/Mail}) - -@item nnmh-get-new-mail -@vindex nnmh-get-new-mail -If non-@code{nil}, @code{nnmh} will read incoming mail. The default is -@code{t}. - -@item nnmh-be-safe -@vindex nnmh-be-safe -If non-@code{nil}, @code{nnmh} will go to ridiculous lengths to make -sure that the articles in the folder are actually what Gnus thinks -they are. It will check date stamps and stat everything in sight, so -setting this to @code{t} will mean a serious slow-down. If you never -use anything but Gnus to read the @code{nnmh} articles, you do not -have to set this variable to @code{t}. The default is @code{nil}. -@end table - - -@node Maildir -@subsubsection Maildir -@cindex nnmaildir -@cindex maildir - -@code{nnmaildir} stores mail in the maildir format, with each maildir -corresponding to a group in Gnus. This format is documented here: -@uref{http://cr.yp.to/proto/maildir.html} and here: -@uref{http://www.qmail.org/man/man5/maildir.html}. @code{nnmaildir} -also stores extra information in the @file{.nnmaildir/} directory -within a maildir. - -Maildir format was designed to allow concurrent deliveries and -reading, without needing locks. With other back ends, you would have -your mail delivered to a spool of some kind, and then you would -configure Gnus to split mail from that spool into your groups. You -can still do that with @code{nnmaildir}, but the more common -configuration is to have your mail delivered directly to the maildirs -that appear as group in Gnus. - -@code{nnmaildir} is designed to be perfectly reliable: @kbd{C-g} will -never corrupt its data in memory, and @code{SIGKILL} will never -corrupt its data in the filesystem. - -@code{nnmaildir} stores article marks and @acronym{NOV} data in each -maildir. So you can copy a whole maildir from one Gnus setup to -another, and you will keep your marks. - -Virtual server settings: - -@table @code -@item directory -For each of your @code{nnmaildir} servers (it's very unlikely that -you'd need more than one), you need to create a directory and populate -it with maildirs or symlinks to maildirs (and nothing else; do not -choose a directory already used for other purposes). Each maildir -will be represented in Gnus as a newsgroup on that server; the -filename of the symlink will be the name of the group. Any filenames -in the directory starting with @samp{.} are ignored. The directory is -scanned when you first start Gnus, and each time you type @kbd{g} in -the group buffer; if any maildirs have been removed or added, -@code{nnmaildir} notices at these times. - -The value of the @code{directory} parameter should be a Lisp form -which is processed by @code{eval} and @code{expand-file-name} to get -the path of the directory for this server. The form is @code{eval}ed -only when the server is opened; the resulting string is used until the -server is closed. (If you don't know about forms and @code{eval}, -don't worry---a simple string will work.) This parameter is not -optional; you must specify it. I don't recommend using -@code{"~/Mail"} or a subdirectory of it; several other parts of Gnus -use that directory by default for various things, and may get confused -if @code{nnmaildir} uses it too. @code{"~/.nnmaildir"} is a typical -value. - -@item target-prefix -This should be a Lisp form which is processed by @code{eval} and -@code{expand-file-name}. The form is @code{eval}ed only when the -server is opened; the resulting string is used until the server is -closed. - -When you create a group on an @code{nnmaildir} server, the maildir is -created with @code{target-prefix} prepended to its name, and a symlink -pointing to that maildir is created, named with the plain group name. -So if @code{directory} is @code{"~/.nnmaildir"} and -@code{target-prefix} is @code{"../maildirs/"}, then when you create -the group @code{foo}, @code{nnmaildir} will create -@file{~/.nnmaildir/../maildirs/foo} as a maildir, and will create -@file{~/.nnmaildir/foo} as a symlink pointing to -@file{../maildirs/foo}. - -You can set @code{target-prefix} to a string without any slashes to -create both maildirs and symlinks in the same @code{directory}; in -this case, any maildirs found in @code{directory} whose names start -with @code{target-prefix} will not be listed as groups (but the -symlinks pointing to them will be). - -As a special case, if @code{target-prefix} is @code{""} (the default), -then when you create a group, the maildir will be created in -@code{directory} without a corresponding symlink. Beware that you -cannot use @code{gnus-group-delete-group} on such groups without the -@code{force} argument. - -@item directory-files -This should be a function with the same interface as -@code{directory-files} (such as @code{directory-files} itself). It is -used to scan the server's @code{directory} for maildirs. This -parameter is optional; the default is -@code{nnheader-directory-files-safe} if -@code{nnheader-directory-files-is-safe} is @code{nil}, and -@code{directory-files} otherwise. -(@code{nnheader-directory-files-is-safe} is checked only once when the -server is opened; if you want to check it each time the directory is -scanned, you'll have to provide your own function that does that.) - -@item get-new-mail -If non-@code{nil}, then after scanning for new mail in the group -maildirs themselves as usual, this server will also incorporate mail -the conventional Gnus way, from @code{mail-sources} according to -@code{nnmail-split-methods} or @code{nnmail-split-fancy}. The default -value is @code{nil}. - -Do @emph{not} use the same maildir both in @code{mail-sources} and as -an @code{nnmaildir} group. The results might happen to be useful, but -that would be by chance, not by design, and the results might be -different in the future. If your split rules create new groups, -remember to supply a @code{create-directory} server parameter. -@end table - -@subsubsection Group parameters - -@code{nnmaildir} uses several group parameters. It's safe to ignore -all this; the default behavior for @code{nnmaildir} is the same as the -default behavior for other mail back ends: articles are deleted after -one week, etc. Except for the expiry parameters, all this -functionality is unique to @code{nnmaildir}, so you can ignore it if -you're just trying to duplicate the behavior you already have with -another back end. - -If the value of any of these parameters is a vector, the first element -is evaluated as a Lisp form and the result is used, rather than the -original value. If the value is not a vector, the value itself is -evaluated as a Lisp form. (This is why these parameters use names -different from those of other, similar parameters supported by other -back ends: they have different, though similar, meanings.) (For -numbers, strings, @code{nil}, and @code{t}, you can ignore the -@code{eval} business again; for other values, remember to use an extra -quote and wrap the value in a vector when appropriate.) - -@table @code -@item expire-age -An integer specifying the minimum age, in seconds, of an article -before it will be expired, or the symbol @code{never} to specify that -articles should never be expired. If this parameter is not set, -@code{nnmaildir} falls back to the usual -@code{nnmail-expiry-wait}(@code{-function}) variables (the -@code{expiry-wait} group parameter overrides @code{nnmail-expiry-wait} -and makes @code{nnmail-expiry-wait-function} ineffective). If you -wanted a value of 3 days, you could use something like @code{[(* 3 24 -60 60)]}; @code{nnmaildir} will evaluate the form and use the result. -An article's age is measured starting from the article file's -modification time. Normally, this is the same as the article's -delivery time, but editing an article makes it younger. Moving an -article (other than via expiry) may also make an article younger. - -@item expire-group -If this is set to a string such as a full Gnus group name, like -@example -"backend+server.address.string:group.name" -@end example -and if it is not the name of the same group that the parameter belongs -to, then articles will be moved to the specified group during expiry -before being deleted. @emph{If this is set to an @code{nnmaildir} -group, the article will be just as old in the destination group as it -was in the source group.} So be careful with @code{expire-age} in the -destination group. If this is set to the name of the same group that -the parameter belongs to, then the article is not expired at all. If -you use the vector form, the first element is evaluated once for each -article. So that form can refer to -@code{nnmaildir-article-file-name}, etc., to decide where to put the -article. @emph{Even if this parameter is not set, @code{nnmaildir} -does not fall back to the @code{expiry-target} group parameter or the -@code{nnmail-expiry-target} variable.} - -@item read-only -If this is set to @code{t}, @code{nnmaildir} will treat the articles -in this maildir as read-only. This means: articles are not renamed -from @file{new/} into @file{cur/}; articles are only found in -@file{new/}, not @file{cur/}; articles are never deleted; articles -cannot be edited. @file{new/} is expected to be a symlink to the -@file{new/} directory of another maildir---e.g., a system-wide mailbox -containing a mailing list of common interest. Everything in the -maildir outside @file{new/} is @emph{not} treated as read-only, so for -a shared mailbox, you do still need to set up your own maildir (or -have write permission to the shared mailbox); your maildir just won't -contain extra copies of the articles. - -@item directory-files -A function with the same interface as @code{directory-files}. It is -used to scan the directories in the maildir corresponding to this -group to find articles. The default is the function specified by the -server's @code{directory-files} parameter. - -@item distrust-Lines: -If non-@code{nil}, @code{nnmaildir} will always count the lines of an -article, rather than use the @code{Lines:} header field. If -@code{nil}, the header field will be used if present. - -@item always-marks -A list of mark symbols, such as @code{['(read expire)]}. Whenever -Gnus asks @code{nnmaildir} for article marks, @code{nnmaildir} will -say that all articles have these marks, regardless of whether the -marks stored in the filesystem say so. This is a proof-of-concept -feature that will probably be removed eventually; it ought to be done -in Gnus proper, or abandoned if it's not worthwhile. - -@item never-marks -A list of mark symbols, such as @code{['(tick expire)]}. Whenever -Gnus asks @code{nnmaildir} for article marks, @code{nnmaildir} will -say that no articles have these marks, regardless of whether the marks -stored in the filesystem say so. @code{never-marks} overrides -@code{always-marks}. This is a proof-of-concept feature that will -probably be removed eventually; it ought to be done in Gnus proper, or -abandoned if it's not worthwhile. - -@item nov-cache-size -An integer specifying the size of the @acronym{NOV} memory cache. To -speed things up, @code{nnmaildir} keeps @acronym{NOV} data in memory -for a limited number of articles in each group. (This is probably not -worthwhile, and will probably be removed in the future.) This -parameter's value is noticed only the first time a group is seen after -the server is opened---i.e., when you first start Gnus, typically. -The @acronym{NOV} cache is never resized until the server is closed -and reopened. The default is an estimate of the number of articles -that would be displayed in the summary buffer: a count of articles -that are either marked with @code{tick} or not marked with -@code{read}, plus a little extra. -@end table - -@subsubsection Article identification -Articles are stored in the @file{cur/} subdirectory of each maildir. -Each article file is named like @code{uniq:info}, where @code{uniq} -contains no colons. @code{nnmaildir} ignores, but preserves, the -@code{:info} part. (Other maildir readers typically use this part of -the filename to store marks.) The @code{uniq} part uniquely -identifies the article, and is used in various places in the -@file{.nnmaildir/} subdirectory of the maildir to store information -about the corresponding article. The full pathname of an article is -available in the variable @code{nnmaildir-article-file-name} after you -request the article in the summary buffer. - -@subsubsection NOV data -An article identified by @code{uniq} has its @acronym{NOV} data (used -to generate lines in the summary buffer) stored in -@code{.nnmaildir/nov/uniq}. There is no -@code{nnmaildir-generate-nov-databases} function. (There isn't much -need for it---an article's @acronym{NOV} data is updated automatically -when the article or @code{nnmail-extra-headers} has changed.) You can -force @code{nnmaildir} to regenerate the @acronym{NOV} data for a -single article simply by deleting the corresponding @acronym{NOV} -file, but @emph{beware}: this will also cause @code{nnmaildir} to -assign a new article number for this article, which may cause trouble -with @code{seen} marks, the Agent, and the cache. - -@subsubsection Article marks -An article identified by @code{uniq} is considered to have the mark -@code{flag} when the file @file{.nnmaildir/marks/flag/uniq} exists. -When Gnus asks @code{nnmaildir} for a group's marks, @code{nnmaildir} -looks for such files and reports the set of marks it finds. When Gnus -asks @code{nnmaildir} to store a new set of marks, @code{nnmaildir} -creates and deletes the corresponding files as needed. (Actually, -rather than create a new file for each mark, it just creates hard -links to @file{.nnmaildir/markfile}, to save inodes.) - -You can invent new marks by creating a new directory in -@file{.nnmaildir/marks/}. You can tar up a maildir and remove it from -your server, untar it later, and keep your marks. You can add and -remove marks yourself by creating and deleting mark files. If you do -this while Gnus is running and your @code{nnmaildir} server is open, -it's best to exit all summary buffers for @code{nnmaildir} groups and -type @kbd{s} in the group buffer first, and to type @kbd{g} or -@kbd{M-g} in the group buffer afterwards. Otherwise, Gnus might not -pick up the changes, and might undo them. - - -@node Mail Folders -@subsubsection Mail Folders -@cindex nnfolder -@cindex mbox folders -@cindex mail folders - -@code{nnfolder} is a back end for storing each mail group in a -separate file. Each file is in the standard Un*x mbox format. -@code{nnfolder} will add extra headers to keep track of article -numbers and arrival dates. - -@cindex self contained nnfolder servers -@cindex marks -When the marks file is used (which it is by default), @code{nnfolder} -servers have the property that you may backup them using @code{tar} or -similar, and later be able to restore them into Gnus (by adding the -proper @code{nnfolder} server) and have all your marks be preserved. -Marks for a group are usually stored in a file named as the mbox file -with @code{.mrk} concatenated to it (but see -@code{nnfolder-marks-file-suffix}) within the @code{nnfolder} -directory. Individual @code{nnfolder} groups are also possible to -backup, use @kbd{G m} to restore the group (after restoring the backup -into the @code{nnfolder} directory). - -Virtual server settings: - -@table @code -@item nnfolder-directory -@vindex nnfolder-directory -All the @code{nnfolder} mail boxes will be stored under this -directory. The default is the value of @code{message-directory} -(whose default is @file{~/Mail}) - -@item nnfolder-active-file -@vindex nnfolder-active-file -The name of the active file. The default is @file{~/Mail/active}. - -@item nnfolder-newsgroups-file -@vindex nnfolder-newsgroups-file -The name of the group descriptions file. @xref{Newsgroups File -Format}. The default is @file{~/Mail/newsgroups} - -@item nnfolder-get-new-mail -@vindex nnfolder-get-new-mail -If non-@code{nil}, @code{nnfolder} will read incoming mail. The -default is @code{t} - -@item nnfolder-save-buffer-hook -@vindex nnfolder-save-buffer-hook -@cindex backup files -Hook run before saving the folders. Note that Emacs does the normal -backup renaming of files even with the @code{nnfolder} buffers. If -you wish to switch this off, you could say something like the -following in your @file{.emacs} file: - -@lisp -(defun turn-off-backup () - (set (make-local-variable 'backup-inhibited) t)) - -(add-hook 'nnfolder-save-buffer-hook 'turn-off-backup) -@end lisp - -@item nnfolder-delete-mail-hook -@vindex nnfolder-delete-mail-hook -Hook run in a buffer narrowed to the message that is to be deleted. -This function can be used to copy the message to somewhere else, or to -extract some information from it before removing it. - -@item nnfolder-nov-is-evil -@vindex nnfolder-nov-is-evil -If non-@code{nil}, this back end will ignore any @acronym{NOV} files. The -default is @code{nil}. - -@item nnfolder-nov-file-suffix -@vindex nnfolder-nov-file-suffix -The extension for @acronym{NOV} files. The default is @file{.nov}. - -@item nnfolder-nov-directory -@vindex nnfolder-nov-directory -The directory where the @acronym{NOV} files should be stored. If -@code{nil}, @code{nnfolder-directory} is used. - -@item nnfolder-marks-is-evil -@vindex nnfolder-marks-is-evil -If non-@code{nil}, this back end will ignore any @sc{marks} files. The -default is @code{nil}. - -@item nnfolder-marks-file-suffix -@vindex nnfolder-marks-file-suffix -The extension for @sc{marks} files. The default is @file{.mrk}. - -@item nnfolder-marks-directory -@vindex nnfolder-marks-directory -The directory where the @sc{marks} files should be stored. If -@code{nil}, @code{nnfolder-directory} is used. - -@end table - - -@findex nnfolder-generate-active-file -@kindex M-x nnfolder-generate-active-file -If you have lots of @code{nnfolder}-like files you'd like to read with -@code{nnfolder}, you can use the @kbd{M-x nnfolder-generate-active-file} -command to make @code{nnfolder} aware of all likely files in -@code{nnfolder-directory}. This only works if you use long file names, -though. - -@node Comparing Mail Back Ends -@subsubsection Comparing Mail Back Ends - -First, just for terminology, the @dfn{back end} is the common word for a -low-level access method---a transport, if you will, by which something -is acquired. The sense is that one's mail has to come from somewhere, -and so selection of a suitable back end is required in order to get that -mail within spitting distance of Gnus. - -The same concept exists for Usenet itself: Though access to articles is -typically done by @acronym{NNTP} these days, once upon a midnight dreary, everyone -in the world got at Usenet by running a reader on the machine where the -articles lay (the machine which today we call an @acronym{NNTP} server), and -access was by the reader stepping into the articles' directory spool -area directly. One can still select between either the @code{nntp} or -@code{nnspool} back ends, to select between these methods, if one happens -actually to live on the server (or can see its spool directly, anyway, -via NFS). - -The goal in selecting a mail back end is to pick one which -simultaneously represents a suitable way of dealing with the original -format plus leaving mail in a form that is convenient to use in the -future. Here are some high and low points on each: - -@table @code -@item nnmbox - -UNIX systems have historically had a single, very common, and well- -defined format. All messages arrive in a single @dfn{spool file}, and -they are delineated by a line whose regular expression matches -@samp{^From_}. (My notational use of @samp{_} is to indicate a space, -to make it clear in this instance that this is not the RFC-specified -@samp{From:} header.) Because Emacs and therefore Gnus emanate -historically from the Unix environment, it is simplest if one does not -mess a great deal with the original mailbox format, so if one chooses -this back end, Gnus' primary activity in getting mail from the real spool -area to Gnus' preferred directory is simply to copy it, with no -(appreciable) format change in the process. It is the ``dumbest'' way -to move mail into availability in the Gnus environment. This makes it -fast to move into place, but slow to parse, when Gnus has to look at -what's where. - -@item nnbabyl - -Once upon a time, there was the DEC-10 and DEC-20, running operating -systems called TOPS and related things, and the usual (only?) mail -reading environment was a thing called Babyl. I don't know what format -was used for mail landing on the system, but Babyl had its own internal -format to which mail was converted, primarily involving creating a -spool-file-like entity with a scheme for inserting Babyl-specific -headers and status bits above the top of each message in the file. -Rmail was Emacs' first mail reader, it was written by Richard Stallman, -and Stallman came out of that TOPS/Babyl environment, so he wrote Rmail -to understand the mail files folks already had in existence. Gnus (and -VM, for that matter) continue to support this format because it's -perceived as having some good qualities in those mailer-specific -headers/status bits stuff. Rmail itself still exists as well, of -course, and is still maintained by Stallman. - -Both of the above forms leave your mail in a single file on your -file system, and they must parse that entire file each time you take a -look at your mail. - -@item nnml - -@code{nnml} is the back end which smells the most as though you were -actually operating with an @code{nnspool}-accessed Usenet system. (In -fact, I believe @code{nnml} actually derived from @code{nnspool} code, -lo these years ago.) One's mail is taken from the original spool file, -and is then cut up into individual message files, 1:1. It maintains a -Usenet-style active file (analogous to what one finds in an INN- or -CNews-based news system in (for instance) @file{/var/lib/news/active}, -or what is returned via the @samp{NNTP LIST} verb) and also creates -@dfn{overview} files for efficient group entry, as has been defined for -@acronym{NNTP} servers for some years now. It is slower in mail-splitting, -due to the creation of lots of files, updates to the @code{nnml} active -file, and additions to overview files on a per-message basis, but it is -extremely fast on access because of what amounts to the indexing support -provided by the active file and overviews. - -@code{nnml} costs @dfn{inodes} in a big way; that is, it soaks up the -resource which defines available places in the file system to put new -files. Sysadmins take a dim view of heavy inode occupation within -tight, shared file systems. But if you live on a personal machine where -the file system is your own and space is not at a premium, @code{nnml} -wins big. - -It is also problematic using this back end if you are living in a -FAT16-based Windows world, since much space will be wasted on all these -tiny files. - -@item nnmh - -The Rand MH mail-reading system has been around UNIX systems for a very -long time; it operates by splitting one's spool file of messages into -individual files, but with little or no indexing support---@code{nnmh} -is considered to be semantically equivalent to ``@code{nnml} without -active file or overviews''. This is arguably the worst choice, because -one gets the slowness of individual file creation married to the -slowness of access parsing when learning what's new in one's groups. - -@item nnfolder - -Basically the effect of @code{nnfolder} is @code{nnmbox} (the first -method described above) on a per-group basis. That is, @code{nnmbox} -itself puts @emph{all} one's mail in one file; @code{nnfolder} provides a -little bit of optimization to this so that each of one's mail groups has -a Unix mail box file. It's faster than @code{nnmbox} because each group -can be parsed separately, and still provides the simple Unix mail box -format requiring minimal effort in moving the mail around. In addition, -it maintains an ``active'' file making it much faster for Gnus to figure -out how many messages there are in each separate group. - -If you have groups that are expected to have a massive amount of -messages, @code{nnfolder} is not the best choice, but if you receive -only a moderate amount of mail, @code{nnfolder} is probably the most -friendly mail back end all over. - -@item nnmaildir - -For configuring expiry and other things, @code{nnmaildir} uses -incompatible group parameters, slightly different from those of other -mail back ends. - -@code{nnmaildir} is largely similar to @code{nnml}, with some notable -differences. Each message is stored in a separate file, but the -filename is unrelated to the article number in Gnus. @code{nnmaildir} -also stores the equivalent of @code{nnml}'s overview files in one file -per article, so it uses about twice as many inodes as @code{nnml}. (Use -@code{df -i} to see how plentiful your inode supply is.) If this slows -you down or takes up very much space, consider switching to -@uref{http://www.namesys.com/, ReiserFS} or another non-block-structured -file system. - -Since maildirs don't require locking for delivery, the maildirs you use -as groups can also be the maildirs your mail is directly delivered to. -This means you can skip Gnus' mail splitting if your mail is already -organized into different mailboxes during delivery. A @code{directory} -entry in @code{mail-sources} would have a similar effect, but would -require one set of mailboxes for spooling deliveries (in mbox format, -thus damaging message bodies), and another set to be used as groups (in -whatever format you like). A maildir has a built-in spool, in the -@code{new/} subdirectory. Beware that currently, mail moved from -@code{new/} to @code{cur/} instead of via mail splitting will not -undergo treatment such as duplicate checking. - -@code{nnmaildir} stores article marks for a given group in the -corresponding maildir, in a way designed so that it's easy to manipulate -them from outside Gnus. You can tar up a maildir, unpack it somewhere -else, and still have your marks. @code{nnml} also stores marks, but -it's not as easy to work with them from outside Gnus as with -@code{nnmaildir}. - -@code{nnmaildir} uses a significant amount of memory to speed things up. -(It keeps in memory some of the things that @code{nnml} stores in files -and that @code{nnmh} repeatedly parses out of message files.) If this -is a problem for you, you can set the @code{nov-cache-size} group -parameter to something small (0 would probably not work, but 1 probably -would) to make it use less memory. This caching will probably be -removed in the future. - -Startup is likely to be slower with @code{nnmaildir} than with other -back ends. Everything else is likely to be faster, depending in part -on your file system. - -@code{nnmaildir} does not use @code{nnoo}, so you cannot use @code{nnoo} -to write an @code{nnmaildir}-derived back end. - -@end table - - -@node Browsing the Web -@section Browsing the Web -@cindex web -@cindex browsing the web -@cindex www -@cindex http - -Web-based discussion forums are getting more and more popular. On many -subjects, the web-based forums have become the most important forums, -eclipsing the importance of mailing lists and news groups. The reason -is easy to understand---they are friendly to new users; you just point -and click, and there's the discussion. With mailing lists, you have to -go through a cumbersome subscription procedure, and most people don't -even know what a news group is. - -The problem with this scenario is that web browsers are not very good at -being newsreaders. They do not keep track of what articles you've read; -they do not allow you to score on subjects you're interested in; they do -not allow off-line browsing; they require you to click around and drive -you mad in the end. - -So---if web browsers suck at reading discussion forums, why not use Gnus -to do it instead? - -Gnus has been getting a bit of a collection of back ends for providing -interfaces to these sources. - -@menu -* Archiving Mail:: -* Web Searches:: Creating groups from articles that match a string. -* Slashdot:: Reading the Slashdot comments. -* Ultimate:: The Ultimate Bulletin Board systems. -* Web Archive:: Reading mailing list archived on web. -* RSS:: Reading RDF site summary. -* Customizing W3:: Doing stuff to Emacs/W3 from Gnus. -@end menu - -All the web sources require Emacs/W3 and the url library or those -alternatives to work. - -The main caveat with all these web sources is that they probably won't -work for a very long time. Gleaning information from the @acronym{HTML} data -is guesswork at best, and when the layout is altered, the Gnus back end -will fail. If you have reasonably new versions of these back ends, -though, you should be ok. - -One thing all these Web methods have in common is that the Web sources -are often down, unavailable or just plain too slow to be fun. In those -cases, it makes a lot of sense to let the Gnus Agent (@pxref{Gnus -Unplugged}) handle downloading articles, and then you can read them at -leisure from your local disk. No more World Wide Wait for you. - -@node Archiving Mail -@subsection Archiving Mail -@cindex archiving mail -@cindex backup of mail - -Some of the back ends, notably @code{nnml}, @code{nnfolder}, and -@code{nnmaildir}, now actually store the article marks with each group. -For these servers, archiving and restoring a group while preserving -marks is fairly simple. - -(Preserving the group level and group parameters as well still -requires ritual dancing and sacrifices to the @file{.newsrc.eld} deity -though.) - -To archive an entire @code{nnml}, @code{nnfolder}, or @code{nnmaildir} -server, take a recursive copy of the server directory. There is no need -to shut down Gnus, so archiving may be invoked by @code{cron} or -similar. You restore the data by restoring the directory tree, and -adding a server definition pointing to that directory in Gnus. The -@ref{Article Backlog}, @ref{Asynchronous Fetching} and other things -might interfere with overwriting data, so you may want to shut down Gnus -before you restore the data. - -It is also possible to archive individual @code{nnml}, -@code{nnfolder}, or @code{nnmaildir} groups, while preserving marks. -For @code{nnml} or @code{nnmaildir}, you copy all files in the group's -directory. For @code{nnfolder} you need to copy both the base folder -file itself (@file{FOO}, say), and the marks file (@file{FOO.mrk} in -this example). Restoring the group is done with @kbd{G m} from the Group -buffer. The last step makes Gnus notice the new directory. -@code{nnmaildir} notices the new directory automatically, so @kbd{G m} -is unnecessary in that case. - -@node Web Searches -@subsection Web Searches -@cindex nnweb -@cindex Google -@cindex dejanews -@cindex gmane -@cindex Usenet searches -@cindex searching the Usenet - -It's, like, too neat to search the Usenet for articles that match a -string, but it, like, totally @emph{sucks}, like, totally, to use one of -those, like, Web browsers, and you, like, have to, rilly, like, look at -the commercials, so, like, with Gnus you can do @emph{rad}, rilly, -searches without having to use a browser. - -The @code{nnweb} back end allows an easy interface to the mighty search -engine. You create an @code{nnweb} group, enter a search pattern, and -then enter the group and read the articles like you would any normal -group. The @kbd{G w} command in the group buffer (@pxref{Foreign -Groups}) will do this in an easy-to-use fashion. - -@code{nnweb} groups don't really lend themselves to being solid -groups---they have a very fleeting idea of article numbers. In fact, -each time you enter an @code{nnweb} group (not even changing the search -pattern), you are likely to get the articles ordered in a different -manner. Not even using duplicate suppression (@pxref{Duplicate -Suppression}) will help, since @code{nnweb} doesn't even know the -@code{Message-ID} of the articles before reading them using some search -engines (Google, for instance). The only possible way to keep track -of which articles you've read is by scoring on the @code{Date} -header---mark all articles posted before the last date you read the -group as read. - -If the search engine changes its output substantially, @code{nnweb} -won't be able to parse it and will fail. One could hardly fault the Web -providers if they were to do this---their @emph{raison d'être} is to -make money off of advertisements, not to provide services to the -community. Since @code{nnweb} washes the ads off all the articles, one -might think that the providers might be somewhat miffed. We'll see. - -You must have the @code{url} and @code{W3} package or those alternatives -(try @code{customize-group} on the @samp{mm-url} variable group) -installed to be able to use @code{nnweb}. - -Virtual server variables: - -@table @code -@item nnweb-type -@vindex nnweb-type -What search engine type is being used. The currently supported types -are @code{google}, @code{dejanews}, and @code{gmane}. Note that -@code{dejanews} is an alias to @code{google}. - -@item nnweb-search -@vindex nnweb-search -The search string to feed to the search engine. - -@item nnweb-max-hits -@vindex nnweb-max-hits -Advisory maximum number of hits per search to display. The default is -999. - -@item nnweb-type-definition -@vindex nnweb-type-definition -Type-to-definition alist. This alist says what @code{nnweb} should do -with the various search engine types. The following elements must be -present: - -@table @code -@item article -Function to decode the article and provide something that Gnus -understands. - -@item map -Function to create an article number to message header and URL alist. - -@item search -Function to send the search string to the search engine. - -@item address -The address the aforementioned function should send the search string -to. - -@item id -Format string URL to fetch an article by @code{Message-ID}. -@end table - -@end table - - -@node Slashdot -@subsection Slashdot -@cindex Slashdot -@cindex nnslashdot - -@uref{http://slashdot.org/, Slashdot} is a popular news site, with -lively discussion following the news articles. @code{nnslashdot} will -let you read this forum in a convenient manner. - -The easiest way to read this source is to put something like the -following in your @file{~/.gnus.el} file: - -@lisp -(setq gnus-secondary-select-methods - '((nnslashdot ""))) -@end lisp - -This will make Gnus query the @code{nnslashdot} back end for new comments -and groups. The @kbd{F} command will subscribe each new news article as -a new Gnus group, and you can read the comments by entering these -groups. (Note that the default subscription method is to subscribe new -groups as zombies. Other methods are available (@pxref{Subscription -Methods}). - -If you want to remove an old @code{nnslashdot} group, the @kbd{G DEL} -command is the most handy tool (@pxref{Foreign Groups}). - -When following up to @code{nnslashdot} comments (or posting new -comments), some light @acronym{HTML}izations will be performed. In -particular, text quoted with @samp{> } will be quoted with -@samp{blockquote} instead, and signatures will have @samp{br} added to -the end of each line. Other than that, you can just write @acronym{HTML} -directly into the message buffer. Note that Slashdot filters out some -@acronym{HTML} forms. - -The following variables can be altered to change its behavior: - -@table @code -@item nnslashdot-threaded -Whether @code{nnslashdot} should display threaded groups or not. The -default is @code{t}. To be able to display threads, @code{nnslashdot} -has to retrieve absolutely all comments in a group upon entry. If a -threaded display is not required, @code{nnslashdot} will only retrieve -the comments that are actually wanted by the user. Threading is nicer, -but much, much slower than unthreaded. - -@item nnslashdot-login-name -@vindex nnslashdot-login-name -The login name to use when posting. - -@item nnslashdot-password -@vindex nnslashdot-password -The password to use when posting. - -@item nnslashdot-directory -@vindex nnslashdot-directory -Where @code{nnslashdot} will store its files. The default is -@file{~/News/slashdot/}. - -@item nnslashdot-active-url -@vindex nnslashdot-active-url -The @acronym{URL} format string that will be used to fetch the -information on news articles and comments. The default is@* -@samp{http://slashdot.org/search.pl?section=&min=%d}. - -@item nnslashdot-comments-url -@vindex nnslashdot-comments-url -The @acronym{URL} format string that will be used to fetch comments. - -@item nnslashdot-article-url -@vindex nnslashdot-article-url -The @acronym{URL} format string that will be used to fetch the news -article. The default is -@samp{http://slashdot.org/article.pl?sid=%s&mode=nocomment}. - -@item nnslashdot-threshold -@vindex nnslashdot-threshold -The score threshold. The default is -1. - -@item nnslashdot-group-number -@vindex nnslashdot-group-number -The number of old groups, in addition to the ten latest, to keep -updated. The default is 0. - -@end table - - - -@node Ultimate -@subsection Ultimate -@cindex nnultimate -@cindex Ultimate Bulletin Board - -@uref{http://www.ultimatebb.com/, The Ultimate Bulletin Board} is -probably the most popular Web bulletin board system used. It has a -quite regular and nice interface, and it's possible to get the -information Gnus needs to keep groups updated. - -The easiest way to get started with @code{nnultimate} is to say -something like the following in the group buffer: @kbd{B nnultimate RET -http://www.tcj.com/messboard/ubbcgi/ RET}. (Substitute the @acronym{URL} -(not including @samp{Ultimate.cgi} or the like at the end) for a forum -you're interested in; there's quite a list of them on the Ultimate web -site.) Then subscribe to the groups you're interested in from the -server buffer, and read them from the group buffer. - -The following @code{nnultimate} variables can be altered: - -@table @code -@item nnultimate-directory -@vindex nnultimate-directory -The directory where @code{nnultimate} stores its files. The default is@* -@file{~/News/ultimate/}. -@end table - - -@node Web Archive -@subsection Web Archive -@cindex nnwarchive -@cindex Web Archive - -Some mailing lists only have archives on Web servers, such as -@uref{http://www.egroups.com/} and -@uref{http://www.mail-archive.com/}. It has a quite regular and nice -interface, and it's possible to get the information Gnus needs to keep -groups updated. - -@findex gnus-group-make-warchive-group -The easiest way to get started with @code{nnwarchive} is to say -something like the following in the group buffer: @kbd{M-x -gnus-group-make-warchive-group RET @var{an_egroup} RET egroups RET -www.egroups.com RET @var{your@@email.address} RET}. (Substitute the -@var{an_egroup} with the mailing list you subscribed, the -@var{your@@email.address} with your email address.), or to browse the -back end by @kbd{B nnwarchive RET mail-archive RET}. - -The following @code{nnwarchive} variables can be altered: - -@table @code -@item nnwarchive-directory -@vindex nnwarchive-directory -The directory where @code{nnwarchive} stores its files. The default is@* -@file{~/News/warchive/}. - -@item nnwarchive-login -@vindex nnwarchive-login -The account name on the web server. - -@item nnwarchive-passwd -@vindex nnwarchive-passwd -The password for your account on the web server. -@end table - -@node RSS -@subsection RSS -@cindex nnrss -@cindex RSS - -Some web sites have an RDF Site Summary (@acronym{RSS}). -@acronym{RSS} is a format for summarizing headlines from news related -sites (such as BBC or CNN). But basically anything list-like can be -presented as an @acronym{RSS} feed: weblogs, changelogs or recent -changes to a wiki (e.g. @url{http://cliki.net/recent-changes.rdf}). - -@acronym{RSS} has a quite regular and nice interface, and it's -possible to get the information Gnus needs to keep groups updated. - -Note: you had better use Emacs which supports the @code{utf-8} coding -system because @acronym{RSS} uses UTF-8 for encoding non-@acronym{ASCII} -text by default. It is also used by default for non-@acronym{ASCII} -group names. - -@kindex G R (Group) -Use @kbd{G R} from the group buffer to subscribe to a feed---you will be -prompted for the location, the title and the description of the feed. -The title, which allows any characters, will be used for the group name -and the name of the group data file. The description can be omitted. - -An easy way to get started with @code{nnrss} is to say something like -the following in the group buffer: @kbd{B nnrss RET RET y}, then -subscribe to groups. - -The @code{nnrss} back end saves the group data file in -@code{nnrss-directory} (see below) for each @code{nnrss} group. File -names containing non-@acronym{ASCII} characters will be encoded by the -coding system specified with the @code{nnmail-pathname-coding-system} -variable. If it is @code{nil}, in Emacs the coding system defaults to -the value of @code{default-file-name-coding-system}. If you are using -XEmacs and want to use non-@acronym{ASCII} group names, you should set -the value for the @code{nnmail-pathname-coding-system} variable properly. - -The @code{nnrss} back end generates @samp{multipart/alternative} -@acronym{MIME} articles in which each contains a @samp{text/plain} part -and a @samp{text/html} part. - -@cindex OPML -You can also use the following commands to import and export your -subscriptions from a file in @acronym{OPML} format (Outline Processor -Markup Language). - -@defun nnrss-opml-import file -Prompt for an @acronym{OPML} file, and subscribe to each feed in the -file. -@end defun - -@defun nnrss-opml-export -Write your current @acronym{RSS} subscriptions to a buffer in -@acronym{OPML} format. -@end defun - -The following @code{nnrss} variables can be altered: - -@table @code -@item nnrss-directory -@vindex nnrss-directory -The directory where @code{nnrss} stores its files. The default is -@file{~/News/rss/}. - -@item nnrss-file-coding-system -@vindex nnrss-file-coding-system -The coding system used when reading and writing the @code{nnrss} groups -data files. The default is the value of -@code{mm-universal-coding-system} (which defaults to @code{emacs-mule} -in Emacs or @code{escape-quoted} in XEmacs). - -@item nnrss-use-local -@vindex nnrss-use-local -@findex nnrss-generate-download-script -If you set @code{nnrss-use-local} to @code{t}, @code{nnrss} will read -the feeds from local files in @code{nnrss-directory}. You can use -the command @code{nnrss-generate-download-script} to generate a -download script using @command{wget}. - -@item nnrss-wash-html-in-text-plain-parts -Non-@code{nil} means that @code{nnrss} renders text in @samp{text/plain} -parts as @acronym{HTML}. The function specified by the -@code{mm-text-html-renderer} variable (@pxref{Display Customization, -,Display Customization, emacs-mime, The Emacs MIME Manual}) will be used -to render text. If it is @code{nil}, which is the default, text will -simply be folded. Leave it @code{nil} if you prefer to see -@samp{text/html} parts. -@end table - -The following code may be helpful, if you want to show the description in -the summary buffer. - -@lisp -(add-to-list 'nnmail-extra-headers nnrss-description-field) -(setq gnus-summary-line-format "%U%R%z%I%(%[%4L: %-15,15f%]%) %s%uX\n") - -(defun gnus-user-format-function-X (header) - (let ((descr - (assq nnrss-description-field (mail-header-extra header)))) - (if descr (concat "\n\t" (cdr descr)) ""))) -@end lisp - -The following code may be useful to open an nnrss url directly from the -summary buffer. - -@lisp -(require 'browse-url) - -(defun browse-nnrss-url( arg ) - (interactive "p") - (let ((url (assq nnrss-url-field - (mail-header-extra - (gnus-data-header - (assq (gnus-summary-article-number) - gnus-newsgroup-data)))))) - (if url - (progn - (browse-url (cdr url)) - (gnus-summary-mark-as-read-forward 1)) - (gnus-summary-scroll-up arg)))) - -(eval-after-load "gnus" - #'(define-key gnus-summary-mode-map - (kbd "<RET>") 'browse-nnrss-url)) -(add-to-list 'nnmail-extra-headers nnrss-url-field) -@end lisp - -Even if you have added @code{"text/html"} to the -@code{mm-discouraged-alternatives} variable (@pxref{Display -Customization, ,Display Customization, emacs-mime, The Emacs MIME -Manual}) since you don't want to see @acronym{HTML} parts, it might be -more useful especially in @code{nnrss} groups to display -@samp{text/html} parts. Here's an example of setting -@code{mm-discouraged-alternatives} as a group parameter (@pxref{Group -Parameters}) in order to display @samp{text/html} parts only in -@code{nnrss} groups: - -@lisp -;; @r{Set the default value of @code{mm-discouraged-alternatives}.} -(eval-after-load "gnus-sum" - '(add-to-list - 'gnus-newsgroup-variables - '(mm-discouraged-alternatives - . '("text/html" "image/.*")))) - -;; @r{Display @samp{text/html} parts in @code{nnrss} groups.} -(add-to-list - 'gnus-parameters - '("\\`nnrss:" (mm-discouraged-alternatives nil))) -@end lisp - - -@node Customizing W3 -@subsection Customizing W3 -@cindex W3 -@cindex html -@cindex url -@cindex Netscape - -Gnus uses the url library to fetch web pages and Emacs/W3 (or those -alternatives) to display web pages. Emacs/W3 is documented in its own -manual, but there are some things that may be more relevant for Gnus -users. - -For instance, a common question is how to make Emacs/W3 follow links -using the @code{browse-url} functions (which will call some external web -browser like Netscape). Here's one way: - -@lisp -(eval-after-load "w3" - '(progn - (fset 'w3-fetch-orig (symbol-function 'w3-fetch)) - (defun w3-fetch (&optional url target) - (interactive (list (w3-read-url-with-default))) - (if (eq major-mode 'gnus-article-mode) - (browse-url url) - (w3-fetch-orig url target))))) -@end lisp - -Put that in your @file{.emacs} file, and hitting links in W3-rendered -@acronym{HTML} in the Gnus article buffers will use @code{browse-url} to -follow the link. - - -@node IMAP -@section IMAP -@cindex nnimap -@cindex @acronym{IMAP} - -@acronym{IMAP} is a network protocol for reading mail (or news, or @dots{}), -think of it as a modernized @acronym{NNTP}. Connecting to a @acronym{IMAP} -server is much similar to connecting to a news server, you just -specify the network address of the server. - -@acronym{IMAP} has two properties. First, @acronym{IMAP} can do -everything that @acronym{POP} can, it can hence be viewed as a -@acronym{POP++}. Secondly, @acronym{IMAP} is a mail storage protocol, -similar to @acronym{NNTP} being a news storage protocol---however, -@acronym{IMAP} offers more features than @acronym{NNTP} because news -is more or less read-only whereas mail is read-write. - -If you want to use @acronym{IMAP} as a @acronym{POP++}, use an imap -entry in @code{mail-sources}. With this, Gnus will fetch mails from -the @acronym{IMAP} server and store them on the local disk. This is -not the usage described in this section---@xref{Mail Sources}. - -If you want to use @acronym{IMAP} as a mail storage protocol, use an nnimap -entry in @code{gnus-secondary-select-methods}. With this, Gnus will -manipulate mails stored on the @acronym{IMAP} server. This is the kind of -usage explained in this section. - -A server configuration in @file{~/.gnus.el} with a few @acronym{IMAP} -servers might look something like the following. (Note that for -@acronym{TLS}/@acronym{SSL}, you need external programs and libraries, -see below.) - -@lisp -(setq gnus-secondary-select-methods - '((nnimap "simpleserver") ; @r{no special configuration} - ; @r{perhaps a ssh port forwarded server:} - (nnimap "dolk" - (nnimap-address "localhost") - (nnimap-server-port 1430)) - ; @r{a UW server running on localhost} - (nnimap "barbar" - (nnimap-server-port 143) - (nnimap-address "localhost") - (nnimap-list-pattern ("INBOX" "mail/*"))) - ; @r{anonymous public cyrus server:} - (nnimap "cyrus.andrew.cmu.edu" - (nnimap-authenticator anonymous) - (nnimap-list-pattern "archive.*") - (nnimap-stream network)) - ; @r{a ssl server on a non-standard port:} - (nnimap "vic20" - (nnimap-address "vic20.somewhere.com") - (nnimap-server-port 9930) - (nnimap-stream ssl)))) -@end lisp - -After defining the new server, you can subscribe to groups on the -server using normal Gnus commands such as @kbd{U} in the Group Buffer -(@pxref{Subscription Commands}) or via the Server Buffer -(@pxref{Server Buffer}). - -The following variables can be used to create a virtual @code{nnimap} -server: - -@table @code - -@item nnimap-address -@vindex nnimap-address - -The address of the remote @acronym{IMAP} server. Defaults to the virtual -server name if not specified. - -@item nnimap-server-port -@vindex nnimap-server-port -Port on server to contact. Defaults to port 143, or 993 for @acronym{TLS}/@acronym{SSL}. - -Note that this should be an integer, example server specification: - -@lisp -(nnimap "mail.server.com" - (nnimap-server-port 4711)) -@end lisp - -@item nnimap-list-pattern -@vindex nnimap-list-pattern -String or list of strings of mailboxes to limit available groups to. -This is used when the server has very many mailboxes and you're only -interested in a few---some servers export your home directory via -@acronym{IMAP}, you'll probably want to limit the mailboxes to those in -@file{~/Mail/*} then. - -The string can also be a cons of REFERENCE and the string as above, what -REFERENCE is used for is server specific, but on the University of -Washington server it's a directory that will be concatenated with the -mailbox. - -Example server specification: - -@lisp -(nnimap "mail.server.com" - (nnimap-list-pattern ("INBOX" "Mail/*" "alt.sex.*" - ("~friend/Mail/" . "list/*")))) -@end lisp - -@item nnimap-stream -@vindex nnimap-stream -The type of stream used to connect to your server. By default, nnimap -will detect and automatically use all of the below, with the exception -of @acronym{TLS}/@acronym{SSL}. (@acronym{IMAP} over -@acronym{TLS}/@acronym{SSL} is being replaced by STARTTLS, which can -be automatically detected, but it's not widely deployed yet.) - -Example server specification: - -@lisp -(nnimap "mail.server.com" - (nnimap-stream ssl)) -@end lisp - -Please note that the value of @code{nnimap-stream} is a symbol! - -@itemize @bullet -@item -@dfn{gssapi:} Connect with GSSAPI (usually Kerberos 5). Requires the -@samp{gsasl} or @samp{imtest} program. -@item -@dfn{kerberos4:} Connect with Kerberos 4. Requires the @samp{imtest} program. -@item -@dfn{starttls:} Connect via the STARTTLS extension (similar to -@acronym{TLS}/@acronym{SSL}). Requires the external library @samp{starttls.el} and program -@samp{starttls}. -@item -@dfn{tls:} Connect through @acronym{TLS}. Requires GNUTLS (the program -@samp{gnutls-cli}). -@item -@dfn{ssl:} Connect through @acronym{SSL}. Requires OpenSSL (the program -@samp{openssl}) or SSLeay (@samp{s_client}). -@item -@dfn{shell:} Use a shell command to start @acronym{IMAP} connection. -@item -@dfn{network:} Plain, TCP/IP network connection. -@end itemize - -@vindex imap-kerberos4-program -The @samp{imtest} program is shipped with Cyrus IMAPD. If you're -using @samp{imtest} from Cyrus IMAPD < 2.0.14 (which includes version -1.5.x and 1.6.x) you need to frob @code{imap-process-connection-type} -to make @code{imap.el} use a pty instead of a pipe when communicating -with @samp{imtest}. You will then suffer from a line length -restrictions on @acronym{IMAP} commands, which might make Gnus seem to hang -indefinitely if you have many articles in a mailbox. The variable -@code{imap-kerberos4-program} contain parameters to pass to the imtest -program. - -For @acronym{TLS} connection, the @code{gnutls-cli} program from GNUTLS is -needed. It is available from -@uref{http://www.gnu.org/software/gnutls/}. - -@vindex imap-gssapi-program -This parameter specifies a list of command lines that invoke a GSSAPI -authenticated @acronym{IMAP} stream in a subshell. They are tried -sequentially until a connection is made, or the list has been -exhausted. By default, @samp{gsasl} from GNU SASL, available from -@uref{http://www.gnu.org/software/gsasl/}, and the @samp{imtest} -program from Cyrus IMAPD (see @code{imap-kerberos4-program}), are -tried. - -@vindex imap-ssl-program -For @acronym{SSL} connections, the OpenSSL program is available from -@uref{http://www.openssl.org/}. OpenSSL was formerly known as SSLeay, -and nnimap support it too---although the most recent versions of -SSLeay, 0.9.x, are known to have serious bugs making it -useless. Earlier versions, especially 0.8.x, of SSLeay are known to -work. The variable @code{imap-ssl-program} contain parameters to pass -to OpenSSL/SSLeay. - -@vindex imap-shell-program -@vindex imap-shell-host -For @acronym{IMAP} connections using the @code{shell} stream, the variable -@code{imap-shell-program} specify what program to call. - -@item nnimap-authenticator -@vindex nnimap-authenticator - -The authenticator used to connect to the server. By default, nnimap -will use the most secure authenticator your server is capable of. - -Example server specification: - -@lisp -(nnimap "mail.server.com" - (nnimap-authenticator anonymous)) -@end lisp - -Please note that the value of @code{nnimap-authenticator} is a symbol! - -@itemize @bullet -@item -@dfn{gssapi:} GSSAPI (usually kerberos 5) authentication. Requires -external program @code{gsasl} or @code{imtest}. -@item -@dfn{kerberos4:} Kerberos 4 authentication. Requires external program -@code{imtest}. -@item -@dfn{digest-md5:} Encrypted username/password via DIGEST-MD5. Requires -external library @code{digest-md5.el}. -@item -@dfn{cram-md5:} Encrypted username/password via CRAM-MD5. -@item -@dfn{login:} Plain-text username/password via LOGIN. -@item -@dfn{anonymous:} Login as ``anonymous'', supplying your email address as password. -@end itemize - -@item nnimap-expunge-on-close -@cindex expunging -@vindex nnimap-expunge-on-close -Unlike Parmenides the @acronym{IMAP} designers have decided things that -don't exist actually do exist. More specifically, @acronym{IMAP} has -this concept of marking articles @code{Deleted} which doesn't actually -delete them, and this (marking them @code{Deleted}, that is) is what -nnimap does when you delete an article in Gnus (with @kbd{B DEL} or -similar). - -Since the articles aren't really removed when we mark them with the -@code{Deleted} flag we'll need a way to actually delete them. Feel like -running in circles yet? - -Traditionally, nnimap has removed all articles marked as @code{Deleted} -when closing a mailbox but this is now configurable by this server -variable. - -The possible options are: - -@table @code - -@item always -The default behavior, delete all articles marked as ``Deleted'' when -closing a mailbox. -@item never -Never actually delete articles. Currently there is no way of showing -the articles marked for deletion in nnimap, but other @acronym{IMAP} clients -may allow you to do this. If you ever want to run the EXPUNGE command -manually, @xref{Expunging mailboxes}. -@item ask -When closing mailboxes, nnimap will ask if you wish to expunge deleted -articles or not. - -@end table - -@item nnimap-importantize-dormant -@vindex nnimap-importantize-dormant - -If non-@code{nil} (the default), marks dormant articles as ticked (as -well), for other @acronym{IMAP} clients. Within Gnus, dormant articles will -naturally still (only) be marked as dormant. This is to make dormant -articles stand out, just like ticked articles, in other @acronym{IMAP} -clients. (In other words, Gnus has two ``Tick'' marks and @acronym{IMAP} -has only one.) - -Probably the only reason for frobbing this would be if you're trying -enable per-user persistent dormant flags, using something like: - -@lisp -(setcdr (assq 'dormant nnimap-mark-to-flag-alist) - (format "gnus-dormant-%s" (user-login-name))) -(setcdr (assq 'dormant nnimap-mark-to-predicate-alist) - (format "KEYWORD gnus-dormant-%s" (user-login-name))) -@end lisp - -In this case, you would not want the per-user dormant flag showing up -as ticked for other users. - -@item nnimap-expunge-search-string -@cindex expunging -@vindex nnimap-expunge-search-string -@cindex expiring @acronym{IMAP} mail - -This variable contain the @acronym{IMAP} search command sent to server when -searching for articles eligible for expiring. The default is -@code{"UID %s NOT SINCE %s"}, where the first @code{%s} is replaced by -UID set and the second @code{%s} is replaced by a date. - -Probably the only useful value to change this to is -@code{"UID %s NOT SENTSINCE %s"}, which makes nnimap use the Date: in -messages instead of the internal article date. See section 6.4.4 of -RFC 2060 for more information on valid strings. - -However, if @code{nnimap-search-uids-not-since-is-evil} -is true, this variable has no effect since the search logic -is reversed, as described below. - -@item nnimap-authinfo-file -@vindex nnimap-authinfo-file - -A file containing credentials used to log in on servers. The format is -(almost) the same as the @code{ftp} @file{~/.netrc} file. See the -variable @code{nntp-authinfo-file} for exact syntax; also see -@ref{NNTP}. An example of an .authinfo line for an IMAP server, is: - -@example -machine students.uio.no login larsi password geheimnis port imap -@end example - -Note that it should be @code{port imap}, or @code{port 143}, if you -use a @code{nnimap-stream} of @code{tls} or @code{ssl}, even if the -actual port number used is port 993 for secured IMAP. For -convenience, Gnus will accept @code{port imaps} as a synonym of -@code{port imap}. - -@item nnimap-need-unselect-to-notice-new-mail -@vindex nnimap-need-unselect-to-notice-new-mail - -Unselect mailboxes before looking for new mail in them. Some servers -seem to need this under some circumstances; it was reported that -Courier 1.7.1 did. - -@item nnimap-nov-is-evil -@vindex nnimap-nov-is-evil -@cindex Courier @acronym{IMAP} server -@cindex @acronym{NOV} - -Never generate or use a local @acronym{NOV} database. Defaults to the -value of @code{gnus-agent}. - -Using a @acronym{NOV} database usually makes header fetching much -faster, but it uses the @code{UID SEARCH UID} command, which is very -slow on some servers (notably some versions of Courier). Since the Gnus -Agent caches the information in the @acronym{NOV} database without using -the slow command, this variable defaults to true if the Agent is in use, -and false otherwise. - -@item nnimap-search-uids-not-since-is-evil -@vindex nnimap-search-uids-not-since-is-evil -@cindex Courier @acronym{IMAP} server -@cindex expiring @acronym{IMAP} mail - -Avoid the @code{UID SEARCH UID @var{message numbers} NOT SINCE -@var{date}} command, which is slow on some @acronym{IMAP} servers -(notably, some versions of Courier). Instead, use @code{UID SEARCH SINCE -@var{date}} and prune the list of expirable articles within Gnus. - -When Gnus expires your mail (@pxref{Expiring Mail}), it starts with a -list of expirable articles and asks the IMAP server questions like ``Of -these articles, which ones are older than a week?'' While this seems -like a perfectly reasonable question, some IMAP servers take a long time -to answer it, since they seemingly go looking into every old article to -see if it is one of the expirable ones. Curiously, the question ``Of -@emph{all} articles, which ones are newer than a week?'' seems to be -much faster to answer, so setting this variable causes Gnus to ask this -question and figure out the answer to the real question itself. - -This problem can really sneak up on you: when you first configure Gnus, -everything works fine, but once you accumulate a couple thousand -messages, you start cursing Gnus for being so slow. On the other hand, -if you get a lot of email within a week, setting this variable will -cause a lot of network traffic between Gnus and the IMAP server. - -@end table - -@menu -* Splitting in IMAP:: Splitting mail with nnimap. -* Expiring in IMAP:: Expiring mail with nnimap. -* Editing IMAP ACLs:: Limiting/enabling other users access to a mailbox. -* Expunging mailboxes:: Equivalent of a ``compress mailbox'' button. -* A note on namespaces:: How to (not) use @acronym{IMAP} namespace in Gnus. -* Debugging IMAP:: What to do when things don't work. -@end menu - - - -@node Splitting in IMAP -@subsection Splitting in IMAP -@cindex splitting imap mail - -Splitting is something Gnus users have loved and used for years, and now -the rest of the world is catching up. Yeah, dream on, not many -@acronym{IMAP} servers have server side splitting and those that have -splitting seem to use some non-standard protocol. This means that -@acronym{IMAP} support for Gnus has to do its own splitting. - -And it does. - -(Incidentally, people seem to have been dreaming on, and Sieve has -gaining a market share and is supported by several IMAP servers. -Fortunately, Gnus support it too, @xref{Sieve Commands}.) - -Here are the variables of interest: - -@table @code - -@item nnimap-split-crosspost -@cindex splitting, crosspost -@cindex crosspost -@vindex nnimap-split-crosspost - -If non-@code{nil}, do crossposting if several split methods match the -mail. If @code{nil}, the first match in @code{nnimap-split-rule} -found will be used. - -Nnmail equivalent: @code{nnmail-crosspost}. - -@item nnimap-split-inbox -@cindex splitting, inbox -@cindex inbox -@vindex nnimap-split-inbox - -A string or a list of strings that gives the name(s) of @acronym{IMAP} -mailboxes to split from. Defaults to @code{nil}, which means that -splitting is disabled! - -@lisp -(setq nnimap-split-inbox - '("INBOX" ("~/friend/Mail" . "lists/*") "lists.imap")) -@end lisp - -No nnmail equivalent. - -@item nnimap-split-rule -@cindex splitting, rules -@vindex nnimap-split-rule - -New mail found in @code{nnimap-split-inbox} will be split according to -this variable. - -This variable contains a list of lists, where the first element in the -sublist gives the name of the @acronym{IMAP} mailbox to move articles -matching the regexp in the second element in the sublist. Got that? -Neither did I, we need examples. - -@lisp -(setq nnimap-split-rule - '(("INBOX.nnimap" - "^Sender: owner-nnimap@@vic20.globalcom.se") - ("INBOX.junk" "^Subject:.*MAKE MONEY") - ("INBOX.private" ""))) -@end lisp - -This will put all articles from the nnimap mailing list into mailbox -INBOX.nnimap, all articles containing MAKE MONEY in the Subject: line -into INBOX.junk and everything else in INBOX.private. - -The first string may contain @samp{\\1} forms, like the ones used by -replace-match to insert sub-expressions from the matched text. For -instance: - -@lisp -("INBOX.lists.\\1" "^Sender: owner-\\([a-z-]+\\)@@") -@end lisp - -The first element can also be the symbol @code{junk} to indicate that -matching messages should simply be deleted. Use with care. - -The second element can also be a function. In that case, it will be -called with the first element of the rule as the argument, in a buffer -containing the headers of the article. It should return a -non-@code{nil} value if it thinks that the mail belongs in that group. - -Nnmail users might recollect that the last regexp had to be empty to -match all articles (like in the example above). This is not required in -nnimap. Articles not matching any of the regexps will not be moved out -of your inbox. (This might affect performance if you keep lots of -unread articles in your inbox, since the splitting code would go over -them every time you fetch new mail.) - -These rules are processed from the beginning of the alist toward the -end. The first rule to make a match will ``win'', unless you have -crossposting enabled. In that case, all matching rules will ``win''. - -This variable can also have a function as its value, the function will -be called with the headers narrowed and should return a group where it -thinks the article should be split to. See @code{nnimap-split-fancy}. - -The splitting code tries to create mailboxes if it needs to. - -To allow for different split rules on different virtual servers, and -even different split rules in different inboxes on the same server, -the syntax of this variable have been extended along the lines of: - -@lisp -(setq nnimap-split-rule - '(("my1server" (".*" (("ding" "ding@@gnus.org") - ("junk" "From:.*Simon")))) - ("my2server" ("INBOX" nnimap-split-fancy)) - ("my[34]server" (".*" (("private" "To:.*Simon") - ("junk" my-junk-func)))))) -@end lisp - -The virtual server name is in fact a regexp, so that the same rules -may apply to several servers. In the example, the servers -@code{my3server} and @code{my4server} both use the same rules. -Similarly, the inbox string is also a regexp. The actual splitting -rules are as before, either a function, or a list with group/regexp or -group/function elements. - -Nnmail equivalent: @code{nnmail-split-methods}. - -@item nnimap-split-predicate -@cindex splitting -@vindex nnimap-split-predicate - -Mail matching this predicate in @code{nnimap-split-inbox} will be -split, it is a string and the default is @samp{UNSEEN UNDELETED}. - -This might be useful if you use another @acronym{IMAP} client to read mail in -your inbox but would like Gnus to split all articles in the inbox -regardless of readedness. Then you might change this to -@samp{UNDELETED}. - -@item nnimap-split-fancy -@cindex splitting, fancy -@findex nnimap-split-fancy -@vindex nnimap-split-fancy - -It's possible to set @code{nnimap-split-rule} to -@code{nnmail-split-fancy} if you want to use fancy -splitting. @xref{Fancy Mail Splitting}. - -However, to be able to have different fancy split rules for nnmail and -nnimap back ends you can set @code{nnimap-split-rule} to -@code{nnimap-split-fancy} and define the nnimap specific fancy split -rule in @code{nnimap-split-fancy}. - -Example: - -@lisp -(setq nnimap-split-rule 'nnimap-split-fancy - nnimap-split-fancy ...) -@end lisp - -Nnmail equivalent: @code{nnmail-split-fancy}. - -@item nnimap-split-download-body -@findex nnimap-split-download-body -@vindex nnimap-split-download-body - -Set to non-@code{nil} to download entire articles during splitting. -This is generally not required, and will slow things down -considerably. You may need it if you want to use an advanced -splitting function that analyzes the body to split the article. - -@end table - -@node Expiring in IMAP -@subsection Expiring in IMAP -@cindex expiring @acronym{IMAP} mail - -Even though @code{nnimap} is not a proper @code{nnmail} derived back -end, it supports most features in regular expiring (@pxref{Expiring -Mail}). Unlike splitting in @acronym{IMAP} (@pxref{Splitting in -IMAP}) it does not clone the @code{nnmail} variables (i.e., creating -@var{nnimap-expiry-wait}) but reuse the @code{nnmail} variables. What -follows below are the variables used by the @code{nnimap} expiry -process. - -A note on how the expire mark is stored on the @acronym{IMAP} server is -appropriate here as well. The expire mark is translated into a -@code{imap} client specific mark, @code{gnus-expire}, and stored on the -message. This means that likely only Gnus will understand and treat -the @code{gnus-expire} mark properly, although other clients may allow -you to view client specific flags on the message. It also means that -your server must support permanent storage of client specific flags on -messages. Most do, fortunately. - -If expiring @acronym{IMAP} mail seems very slow, try setting the server -variable @code{nnimap-search-uids-not-since-is-evil}. - -@table @code - -@item nnmail-expiry-wait -@item nnmail-expiry-wait-function - -These variables are fully supported. The expire value can be a -number, the symbol @code{immediate} or @code{never}. - -@item nnmail-expiry-target - -This variable is supported, and internally implemented by calling the -@code{nnmail} functions that handle this. It contains an optimization -that if the destination is a @acronym{IMAP} group on the same server, the -article is copied instead of appended (that is, uploaded again). - -@end table - -@node Editing IMAP ACLs -@subsection Editing IMAP ACLs -@cindex editing imap acls -@cindex Access Control Lists -@cindex Editing @acronym{IMAP} ACLs -@kindex G l (Group) -@findex gnus-group-nnimap-edit-acl - -ACL stands for Access Control List. ACLs are used in @acronym{IMAP} for -limiting (or enabling) other users access to your mail boxes. Not all -@acronym{IMAP} servers support this, this function will give an error if it -doesn't. - -To edit an ACL for a mailbox, type @kbd{G l} -(@code{gnus-group-edit-nnimap-acl}) and you'll be presented with an ACL -editing window with detailed instructions. - -Some possible uses: - -@itemize @bullet -@item -Giving ``anyone'' the ``lrs'' rights (lookup, read, keep seen/unseen flags) -on your mailing list mailboxes enables other users on the same server to -follow the list without subscribing to it. -@item -At least with the Cyrus server, you are required to give the user -``anyone'' posting ("p") capabilities to have ``plussing'' work (that is, -mail sent to user+mailbox@@domain ending up in the @acronym{IMAP} mailbox -INBOX.mailbox). -@end itemize - -@node Expunging mailboxes -@subsection Expunging mailboxes -@cindex expunging - -@cindex expunge -@cindex manual expunging -@kindex G x (Group) -@findex gnus-group-nnimap-expunge - -If you're using the @code{never} setting of @code{nnimap-expunge-on-close}, -you may want the option of expunging all deleted articles in a mailbox -manually. This is exactly what @kbd{G x} does. - -Currently there is no way of showing deleted articles, you can just -delete them. - -@node A note on namespaces -@subsection A note on namespaces -@cindex IMAP namespace -@cindex namespaces - -The @acronym{IMAP} protocol has a concept called namespaces, described -by the following text in the RFC2060: - -@display -5.1.2. Mailbox Namespace Naming Convention - - By convention, the first hierarchical element of any mailbox name - which begins with "#" identifies the "namespace" of the remainder of - the name. This makes it possible to disambiguate between different - types of mailbox stores, each of which have their own namespaces. - - For example, implementations which offer access to USENET - newsgroups MAY use the "#news" namespace to partition the USENET - newsgroup namespace from that of other mailboxes. Thus, the - comp.mail.misc newsgroup would have an mailbox name of - "#news.comp.mail.misc", and the name "comp.mail.misc" could refer - to a different object (e.g. a user's private mailbox). -@end display - -While there is nothing in this text that warrants concern for the -@acronym{IMAP} implementation in Gnus, some servers use namespace -prefixes in a way that does not work with how Gnus uses mailbox names. - -Specifically, University of Washington's @acronym{IMAP} server uses -mailbox names like @code{#driver.mbx/read-mail} which are valid only -in the @sc{create} and @sc{append} commands. After the mailbox is -created (or a messages is appended to a mailbox), it must be accessed -without the namespace prefix, i.e. @code{read-mail}. Since Gnus do -not make it possible for the user to guarantee that user entered -mailbox names will only be used with the CREATE and APPEND commands, -you should simply not use the namespace prefixed mailbox names in -Gnus. - -See the UoW IMAPD documentation for the @code{#driver.*/} prefix -for more information on how to use the prefixes. They are a power -tool and should be used only if you are sure what the effects are. - -@node Debugging IMAP -@subsection Debugging IMAP -@cindex IMAP debugging -@cindex protocol dump (IMAP) - -@acronym{IMAP} is a complex protocol, more so than @acronym{NNTP} or -@acronym{POP3}. Implementation bugs are not unlikely, and we do our -best to fix them right away. If you encounter odd behavior, chances -are that either the server or Gnus is buggy. - -If you are familiar with network protocols in general, you will -probably be able to extract some clues from the protocol dump of the -exchanges between Gnus and the server. Even if you are not familiar -with network protocols, when you include the protocol dump in -@acronym{IMAP}-related bug reports you are helping us with data -critical to solving the problem. Therefore, we strongly encourage you -to include the protocol dump when reporting IMAP bugs in Gnus. - - -@vindex imap-log -Because the protocol dump, when enabled, generates lots of data, it is -disabled by default. You can enable it by setting @code{imap-log} as -follows: - -@lisp -(setq imap-log t) -@end lisp - -This instructs the @code{imap.el} package to log any exchanges with -the server. The log is stored in the buffer @samp{*imap-log*}. Look -for error messages, which sometimes are tagged with the keyword -@code{BAD}---but when submitting a bug, make sure to include all the -data. - -@node Other Sources -@section Other Sources - -Gnus can do more than just read news or mail. The methods described -below allow Gnus to view directories and files as if they were -newsgroups. - -@menu -* Directory Groups:: You can read a directory as if it was a newsgroup. -* Anything Groups:: Dired? Who needs dired? -* Document Groups:: Single files can be the basis of a group. -* SOUP:: Reading @sc{soup} packets ``offline''. -* Mail-To-News Gateways:: Posting articles via mail-to-news gateways. -@end menu - - -@node Directory Groups -@subsection Directory Groups -@cindex nndir -@cindex directory groups - -If you have a directory that has lots of articles in separate files in -it, you might treat it as a newsgroup. The files have to have numerical -names, of course. - -This might be an opportune moment to mention @code{ange-ftp} (and its -successor @code{efs}), that most wonderful of all wonderful Emacs -packages. When I wrote @code{nndir}, I didn't think much about it---a -back end to read directories. Big deal. - -@code{ange-ftp} changes that picture dramatically. For instance, if you -enter the @code{ange-ftp} file name -@file{/ftp.hpc.uh.edu:/pub/emacs/ding-list/} as the directory name, -@code{ange-ftp} or @code{efs} will actually allow you to read this -directory over at @samp{sina} as a newsgroup. Distributed news ahoy! - -@code{nndir} will use @acronym{NOV} files if they are present. - -@code{nndir} is a ``read-only'' back end---you can't delete or expire -articles with this method. You can use @code{nnmh} or @code{nnml} for -whatever you use @code{nndir} for, so you could switch to any of those -methods if you feel the need to have a non-read-only @code{nndir}. - - -@node Anything Groups -@subsection Anything Groups -@cindex nneething - -From the @code{nndir} back end (which reads a single spool-like -directory), it's just a hop and a skip to @code{nneething}, which -pretends that any arbitrary directory is a newsgroup. Strange, but -true. - -When @code{nneething} is presented with a directory, it will scan this -directory and assign article numbers to each file. When you enter such -a group, @code{nneething} must create ``headers'' that Gnus can use. -After all, Gnus is a newsreader, in case you're forgetting. -@code{nneething} does this in a two-step process. First, it snoops each -file in question. If the file looks like an article (i.e., the first -few lines look like headers), it will use this as the head. If this is -just some arbitrary file without a head (e.g. a C source file), -@code{nneething} will cobble up a header out of thin air. It will use -file ownership, name and date and do whatever it can with these -elements. - -All this should happen automatically for you, and you will be presented -with something that looks very much like a newsgroup. Totally like a -newsgroup, to be precise. If you select an article, it will be displayed -in the article buffer, just as usual. - -If you select a line that represents a directory, Gnus will pop you into -a new summary buffer for this @code{nneething} group. And so on. You can -traverse the entire disk this way, if you feel like, but remember that -Gnus is not dired, really, and does not intend to be, either. - -There are two overall modes to this action---ephemeral or solid. When -doing the ephemeral thing (i.e., @kbd{G D} from the group buffer), Gnus -will not store information on what files you have read, and what files -are new, and so on. If you create a solid @code{nneething} group the -normal way with @kbd{G m}, Gnus will store a mapping table between -article numbers and file names, and you can treat this group like any -other groups. When you activate a solid @code{nneething} group, you will -be told how many unread articles it contains, etc., etc. - -Some variables: - -@table @code -@item nneething-map-file-directory -@vindex nneething-map-file-directory -All the mapping files for solid @code{nneething} groups will be stored -in this directory, which defaults to @file{~/.nneething/}. - -@item nneething-exclude-files -@vindex nneething-exclude-files -All files that match this regexp will be ignored. Nice to use to exclude -auto-save files and the like, which is what it does by default. - -@item nneething-include-files -@vindex nneething-include-files -Regexp saying what files to include in the group. If this variable is -non-@code{nil}, only files matching this regexp will be included. - -@item nneething-map-file -@vindex nneething-map-file -Name of the map files. -@end table - - -@node Document Groups -@subsection Document Groups -@cindex nndoc -@cindex documentation group -@cindex help group - -@code{nndoc} is a cute little thing that will let you read a single file -as a newsgroup. Several files types are supported: - -@table @code -@cindex Babyl -@cindex Rmail mbox -@item babyl -The Babyl (Rmail) mail box. - -@cindex mbox -@cindex Unix mbox -@item mbox -The standard Unix mbox file. - -@cindex MMDF mail box -@item mmdf -The MMDF mail box format. - -@item news -Several news articles appended into a file. - -@cindex rnews batch files -@item rnews -The rnews batch transport format. - -@item nsmail -Netscape mail boxes. - -@item mime-parts -@acronym{MIME} multipart messages. - -@item standard-digest -The standard (RFC 1153) digest format. - -@item mime-digest -A @acronym{MIME} digest of messages. - -@item lanl-gov-announce -Announcement messages from LANL Gov Announce. - -@cindex forwarded messages -@item rfc822-forward -A message forwarded according to RFC822. - -@item outlook -The Outlook mail box. - -@item oe-dbx -The Outlook Express dbx mail box. - -@item exim-bounce -A bounce message from the Exim MTA. - -@item forward -A message forwarded according to informal rules. - -@item rfc934 -An RFC934-forwarded message. - -@item mailman -A mailman digest. - -@item clari-briefs -A digest of Clarinet brief news items. - -@item slack-digest -Non-standard digest format---matches most things, but does it badly. - -@item mail-in-mail -The last resort. -@end table - -You can also use the special ``file type'' @code{guess}, which means -that @code{nndoc} will try to guess what file type it is looking at. -@code{digest} means that @code{nndoc} should guess what digest type the -file is. - -@code{nndoc} will not try to change the file or insert any extra headers into -it---it will simply, like, let you use the file as the basis for a -group. And that's it. - -If you have some old archived articles that you want to insert into your -new & spiffy Gnus mail back end, @code{nndoc} can probably help you with -that. Say you have an old @file{RMAIL} file with mail that you now want -to split into your new @code{nnml} groups. You look at that file using -@code{nndoc} (using the @kbd{G f} command in the group buffer -(@pxref{Foreign Groups})), set the process mark on all the articles in -the buffer (@kbd{M P b}, for instance), and then re-spool (@kbd{B r}) -using @code{nnml}. If all goes well, all the mail in the @file{RMAIL} -file is now also stored in lots of @code{nnml} directories, and you can -delete that pesky @file{RMAIL} file. If you have the guts! - -Virtual server variables: - -@table @code -@item nndoc-article-type -@vindex nndoc-article-type -This should be one of @code{mbox}, @code{babyl}, @code{digest}, -@code{news}, @code{rnews}, @code{mmdf}, @code{forward}, @code{rfc934}, -@code{rfc822-forward}, @code{mime-parts}, @code{standard-digest}, -@code{slack-digest}, @code{clari-briefs}, @code{nsmail}, @code{outlook}, -@code{oe-dbx}, @code{mailman}, and @code{mail-in-mail} or @code{guess}. - -@item nndoc-post-type -@vindex nndoc-post-type -This variable says whether Gnus is to consider the group a news group or -a mail group. There are two valid values: @code{mail} (the default) -and @code{news}. -@end table - -@menu -* Document Server Internals:: How to add your own document types. -@end menu - - -@node Document Server Internals -@subsubsection Document Server Internals - -Adding new document types to be recognized by @code{nndoc} isn't -difficult. You just have to whip up a definition of what the document -looks like, write a predicate function to recognize that document type, -and then hook into @code{nndoc}. - -First, here's an example document type definition: - -@example -(mmdf - (article-begin . "^\^A\^A\^A\^A\n") - (body-end . "^\^A\^A\^A\^A\n")) -@end example - -The definition is simply a unique @dfn{name} followed by a series of -regexp pseudo-variable settings. Below are the possible -variables---don't be daunted by the number of variables; most document -types can be defined with very few settings: - -@table @code -@item first-article -If present, @code{nndoc} will skip past all text until it finds -something that match this regexp. All text before this will be -totally ignored. - -@item article-begin -This setting has to be present in all document type definitions. It -says what the beginning of each article looks like. To do more -complicated things that cannot be dealt with a simple regexp, you can -use @code{article-begin-function} instead of this. - -@item article-begin-function -If present, this should be a function that moves point to the beginning -of each article. This setting overrides @code{article-begin}. - -@item head-begin -If present, this should be a regexp that matches the head of the -article. To do more complicated things that cannot be dealt with a -simple regexp, you can use @code{head-begin-function} instead of this. - -@item head-begin-function -If present, this should be a function that moves point to the head of -the article. This setting overrides @code{head-begin}. - -@item head-end -This should match the end of the head of the article. It defaults to -@samp{^$}---the empty line. - -@item body-begin -This should match the beginning of the body of the article. It defaults -to @samp{^\n}. To do more complicated things that cannot be dealt with -a simple regexp, you can use @code{body-begin-function} instead of this. - -@item body-begin-function -If present, this function should move point to the beginning of the body -of the article. This setting overrides @code{body-begin}. - -@item body-end -If present, this should match the end of the body of the article. To do -more complicated things that cannot be dealt with a simple regexp, you -can use @code{body-end-function} instead of this. - -@item body-end-function -If present, this function should move point to the end of the body of -the article. This setting overrides @code{body-end}. - -@item file-begin -If present, this should match the beginning of the file. All text -before this regexp will be totally ignored. - -@item file-end -If present, this should match the end of the file. All text after this -regexp will be totally ignored. - -@end table - -So, using these variables @code{nndoc} is able to dissect a document -file into a series of articles, each with a head and a body. However, a -few more variables are needed since not all document types are all that -news-like---variables needed to transform the head or the body into -something that's palatable for Gnus: - -@table @code -@item prepare-body-function -If present, this function will be called when requesting an article. It -will be called with point at the start of the body, and is useful if the -document has encoded some parts of its contents. - -@item article-transform-function -If present, this function is called when requesting an article. It's -meant to be used for more wide-ranging transformation of both head and -body of the article. - -@item generate-head-function -If present, this function is called to generate a head that Gnus can -understand. It is called with the article number as a parameter, and is -expected to generate a nice head for the article in question. It is -called when requesting the headers of all articles. - -@item generate-article-function -If present, this function is called to generate an entire article that -Gnus can understand. It is called with the article number as a -parameter when requesting all articles. - -@item dissection-function -If present, this function is called to dissect a document by itself, -overriding @code{first-article}, @code{article-begin}, -@code{article-begin-function}, @code{head-begin}, -@code{head-begin-function}, @code{head-end}, @code{body-begin}, -@code{body-begin-function}, @code{body-end}, @code{body-end-function}, -@code{file-begin}, and @code{file-end}. - -@end table - -Let's look at the most complicated example I can come up with---standard -digests: - -@example -(standard-digest - (first-article . ,(concat "^" (make-string 70 ?-) "\n\n+")) - (article-begin . ,(concat "\n\n" (make-string 30 ?-) "\n\n+")) - (prepare-body-function . nndoc-unquote-dashes) - (body-end-function . nndoc-digest-body-end) - (head-end . "^ ?$") - (body-begin . "^ ?\n") - (file-end . "^End of .*digest.*[0-9].*\n\\*\\*\\|^End of.*Digest *$") - (subtype digest guess)) -@end example - -We see that all text before a 70-width line of dashes is ignored; all -text after a line that starts with that @samp{^End of} is also ignored; -each article begins with a 30-width line of dashes; the line separating -the head from the body may contain a single space; and that the body is -run through @code{nndoc-unquote-dashes} before being delivered. - -To hook your own document definition into @code{nndoc}, use the -@code{nndoc-add-type} function. It takes two parameters---the first -is the definition itself and the second (optional) parameter says -where in the document type definition alist to put this definition. -The alist is traversed sequentially, and -@code{nndoc-@var{type}-type-p} is called for a given type @var{type}. -So @code{nndoc-mmdf-type-p} is called to see whether a document is of -@code{mmdf} type, and so on. These type predicates should return -@code{nil} if the document is not of the correct type; @code{t} if it -is of the correct type; and a number if the document might be of the -correct type. A high number means high probability; a low number -means low probability with @samp{0} being the lowest valid number. - - -@node SOUP -@subsection SOUP -@cindex SOUP -@cindex offline - -In the PC world people often talk about ``offline'' newsreaders. These -are thingies that are combined reader/news transport monstrosities. -With built-in modem programs. Yecchh! - -Of course, us Unix Weenie types of human beans use things like -@code{uucp} and, like, @code{nntpd} and set up proper news and mail -transport things like Ghod intended. And then we just use normal -newsreaders. - -However, it can sometimes be convenient to do something that's a bit -easier on the brain if you have a very slow modem, and you're not really -that interested in doing things properly. - -A file format called @sc{soup} has been developed for transporting news -and mail from servers to home machines and back again. It can be a bit -fiddly. - -First some terminology: - -@table @dfn - -@item server -This is the machine that is connected to the outside world and where you -get news and/or mail from. - -@item home machine -This is the machine that you want to do the actual reading and responding -on. It is typically not connected to the rest of the world in any way. - -@item packet -Something that contains messages and/or commands. There are two kinds -of packets: - -@table @dfn -@item message packets -These are packets made at the server, and typically contain lots of -messages for you to read. These are called @file{SoupoutX.tgz} by -default, where @var{x} is a number. - -@item response packets -These are packets made at the home machine, and typically contains -replies that you've written. These are called @file{SoupinX.tgz} by -default, where @var{x} is a number. - -@end table - -@end table - - -@enumerate - -@item -You log in on the server and create a @sc{soup} packet. You can either -use a dedicated @sc{soup} thingie (like the @code{awk} program), or you -can use Gnus to create the packet with its @sc{soup} commands (@kbd{O -s} and/or @kbd{G s b}; and then @kbd{G s p}) (@pxref{SOUP Commands}). - -@item -You transfer the packet home. Rail, boat, car or modem will do fine. - -@item -You put the packet in your home directory. - -@item -You fire up Gnus on your home machine using the @code{nnsoup} back end as -the native or secondary server. - -@item -You read articles and mail and answer and followup to the things you -want (@pxref{SOUP Replies}). - -@item -You do the @kbd{G s r} command to pack these replies into a @sc{soup} -packet. - -@item -You transfer this packet to the server. - -@item -You use Gnus to mail this packet out with the @kbd{G s s} command. - -@item -You then repeat until you die. - -@end enumerate - -So you basically have a bipartite system---you use @code{nnsoup} for -reading and Gnus for packing/sending these @sc{soup} packets. - -@menu -* SOUP Commands:: Commands for creating and sending @sc{soup} packets -* SOUP Groups:: A back end for reading @sc{soup} packets. -* SOUP Replies:: How to enable @code{nnsoup} to take over mail and news. -@end menu - - -@node SOUP Commands -@subsubsection SOUP Commands - -These are commands for creating and manipulating @sc{soup} packets. - -@table @kbd -@item G s b -@kindex G s b (Group) -@findex gnus-group-brew-soup -Pack all unread articles in the current group -(@code{gnus-group-brew-soup}). This command understands the -process/prefix convention. - -@item G s w -@kindex G s w (Group) -@findex gnus-soup-save-areas -Save all @sc{soup} data files (@code{gnus-soup-save-areas}). - -@item G s s -@kindex G s s (Group) -@findex gnus-soup-send-replies -Send all replies from the replies packet -(@code{gnus-soup-send-replies}). - -@item G s p -@kindex G s p (Group) -@findex gnus-soup-pack-packet -Pack all files into a @sc{soup} packet (@code{gnus-soup-pack-packet}). - -@item G s r -@kindex G s r (Group) -@findex nnsoup-pack-replies -Pack all replies into a replies packet (@code{nnsoup-pack-replies}). - -@item O s -@kindex O s (Summary) -@findex gnus-soup-add-article -This summary-mode command adds the current article to a @sc{soup} packet -(@code{gnus-soup-add-article}). It understands the process/prefix -convention (@pxref{Process/Prefix}). - -@end table - - -There are a few variables to customize where Gnus will put all these -thingies: - -@table @code - -@item gnus-soup-directory -@vindex gnus-soup-directory -Directory where Gnus will save intermediate files while composing -@sc{soup} packets. The default is @file{~/SoupBrew/}. - -@item gnus-soup-replies-directory -@vindex gnus-soup-replies-directory -This is what Gnus will use as a temporary directory while sending our -reply packets. @file{~/SoupBrew/SoupReplies/} is the default. - -@item gnus-soup-prefix-file -@vindex gnus-soup-prefix-file -Name of the file where Gnus stores the last used prefix. The default is -@samp{gnus-prefix}. - -@item gnus-soup-packer -@vindex gnus-soup-packer -A format string command for packing a @sc{soup} packet. The default is -@samp{tar cf - %s | gzip > $HOME/Soupout%d.tgz}. - -@item gnus-soup-unpacker -@vindex gnus-soup-unpacker -Format string command for unpacking a @sc{soup} packet. The default is -@samp{gunzip -c %s | tar xvf -}. - -@item gnus-soup-packet-directory -@vindex gnus-soup-packet-directory -Where Gnus will look for reply packets. The default is @file{~/}. - -@item gnus-soup-packet-regexp -@vindex gnus-soup-packet-regexp -Regular expression matching @sc{soup} reply packets in -@code{gnus-soup-packet-directory}. - -@end table - - -@node SOUP Groups -@subsubsection SOUP Groups -@cindex nnsoup - -@code{nnsoup} is the back end for reading @sc{soup} packets. It will -read incoming packets, unpack them, and put them in a directory where -you can read them at leisure. - -These are the variables you can use to customize its behavior: - -@table @code - -@item nnsoup-tmp-directory -@vindex nnsoup-tmp-directory -When @code{nnsoup} unpacks a @sc{soup} packet, it does it in this -directory. (@file{/tmp/} by default.) - -@item nnsoup-directory -@vindex nnsoup-directory -@code{nnsoup} then moves each message and index file to this directory. -The default is @file{~/SOUP/}. - -@item nnsoup-replies-directory -@vindex nnsoup-replies-directory -All replies will be stored in this directory before being packed into a -reply packet. The default is @file{~/SOUP/replies/}. - -@item nnsoup-replies-format-type -@vindex nnsoup-replies-format-type -The @sc{soup} format of the replies packets. The default is @samp{?n} -(rnews), and I don't think you should touch that variable. I probably -shouldn't even have documented it. Drats! Too late! - -@item nnsoup-replies-index-type -@vindex nnsoup-replies-index-type -The index type of the replies packet. The default is @samp{?n}, which -means ``none''. Don't fiddle with this one either! - -@item nnsoup-active-file -@vindex nnsoup-active-file -Where @code{nnsoup} stores lots of information. This is not an ``active -file'' in the @code{nntp} sense; it's an Emacs Lisp file. If you lose -this file or mess it up in any way, you're dead. The default is -@file{~/SOUP/active}. - -@item nnsoup-packer -@vindex nnsoup-packer -Format string command for packing a reply @sc{soup} packet. The default -is @samp{tar cf - %s | gzip > $HOME/Soupin%d.tgz}. - -@item nnsoup-unpacker -@vindex nnsoup-unpacker -Format string command for unpacking incoming @sc{soup} packets. The -default is @samp{gunzip -c %s | tar xvf -}. - -@item nnsoup-packet-directory -@vindex nnsoup-packet-directory -Where @code{nnsoup} will look for incoming packets. The default is -@file{~/}. - -@item nnsoup-packet-regexp -@vindex nnsoup-packet-regexp -Regular expression matching incoming @sc{soup} packets. The default is -@samp{Soupout}. - -@item nnsoup-always-save -@vindex nnsoup-always-save -If non-@code{nil}, save the replies buffer after each posted message. - -@end table - - -@node SOUP Replies -@subsubsection SOUP Replies - -Just using @code{nnsoup} won't mean that your postings and mailings end -up in @sc{soup} reply packets automagically. You have to work a bit -more for that to happen. - -@findex nnsoup-set-variables -The @code{nnsoup-set-variables} command will set the appropriate -variables to ensure that all your followups and replies end up in the -@sc{soup} system. - -In specific, this is what it does: - -@lisp -(setq message-send-news-function 'nnsoup-request-post) -(setq message-send-mail-function 'nnsoup-request-mail) -@end lisp - -And that's it, really. If you only want news to go into the @sc{soup} -system you just use the first line. If you only want mail to be -@sc{soup}ed you use the second. - - -@node Mail-To-News Gateways -@subsection Mail-To-News Gateways -@cindex mail-to-news gateways -@cindex gateways - -If your local @code{nntp} server doesn't allow posting, for some reason -or other, you can post using one of the numerous mail-to-news gateways. -The @code{nngateway} back end provides the interface. - -Note that you can't read anything from this back end---it can only be -used to post with. - -Server variables: - -@table @code -@item nngateway-address -@vindex nngateway-address -This is the address of the mail-to-news gateway. - -@item nngateway-header-transformation -@vindex nngateway-header-transformation -News headers often have to be transformed in some odd way or other -for the mail-to-news gateway to accept it. This variable says what -transformation should be called, and defaults to -@code{nngateway-simple-header-transformation}. The function is called -narrowed to the headers to be transformed and with one parameter---the -gateway address. - -This default function just inserts a new @code{To} header based on the -@code{Newsgroups} header and the gateway address. -For instance, an article with this @code{Newsgroups} header: - -@example -Newsgroups: alt.religion.emacs -@end example - -will get this @code{To} header inserted: - -@example -To: alt-religion-emacs@@GATEWAY -@end example - -The following pre-defined functions exist: - -@findex nngateway-simple-header-transformation -@table @code - -@item nngateway-simple-header-transformation -Creates a @code{To} header that looks like -@var{newsgroup}@@@code{nngateway-address}. - -@findex nngateway-mail2news-header-transformation - -@item nngateway-mail2news-header-transformation -Creates a @code{To} header that looks like -@code{nngateway-address}. -@end table - -@end table - -Here's an example: - -@lisp -(setq gnus-post-method - '(nngateway - "mail2news@@replay.com" - (nngateway-header-transformation - nngateway-mail2news-header-transformation))) -@end lisp - -So, to use this, simply say something like: - -@lisp -(setq gnus-post-method '(nngateway "GATEWAY.ADDRESS")) -@end lisp - - - -@node Combined Groups -@section Combined Groups - -Gnus allows combining a mixture of all the other group types into bigger -groups. - -@menu -* Virtual Groups:: Combining articles from many groups. -* Kibozed Groups:: Looking through parts of the newsfeed for articles. -@end menu - - -@node Virtual Groups -@subsection Virtual Groups -@cindex nnvirtual -@cindex virtual groups -@cindex merging groups - -An @dfn{nnvirtual group} is really nothing more than a collection of -other groups. - -For instance, if you are tired of reading many small groups, you can -put them all in one big group, and then grow tired of reading one -big, unwieldy group. The joys of computing! - -You specify @code{nnvirtual} as the method. The address should be a -regexp to match component groups. - -All marks in the virtual group will stick to the articles in the -component groups. So if you tick an article in a virtual group, the -article will also be ticked in the component group from whence it -came. (And vice versa---marks from the component groups will also be -shown in the virtual group.). To create an empty virtual group, run -@kbd{G V} (@code{gnus-group-make-empty-virtual}) in the group buffer -and edit the method regexp with @kbd{M-e} -(@code{gnus-group-edit-group-method}) - -Here's an example @code{nnvirtual} method that collects all Andrea Dworkin -newsgroups into one, big, happy newsgroup: - -@lisp -(nnvirtual "^alt\\.fan\\.andrea-dworkin$\\|^rec\\.dworkin.*") -@end lisp - -The component groups can be native or foreign; everything should work -smoothly, but if your computer explodes, it was probably my fault. - -Collecting the same group from several servers might actually be a good -idea if users have set the Distribution header to limit distribution. -If you would like to read @samp{soc.motss} both from a server in Japan -and a server in Norway, you could use the following as the group regexp: - -@example -"^nntp\\+server\\.jp:soc\\.motss$\\|^nntp\\+server\\.no:soc\\.motss$" -@end example - -(Remember, though, that if you're creating the group with @kbd{G m}, you -shouldn't double the backslashes, and you should leave off the quote -characters at the beginning and the end of the string.) - -This should work kinda smoothly---all articles from both groups should -end up in this one, and there should be no duplicates. Threading (and -the rest) will still work as usual, but there might be problems with the -sequence of articles. Sorting on date might be an option here -(@pxref{Selecting a Group}). - -One limitation, however---all groups included in a virtual -group have to be alive (i.e., subscribed or unsubscribed). Killed or -zombie groups can't be component groups for @code{nnvirtual} groups. - -@vindex nnvirtual-always-rescan -If the @code{nnvirtual-always-rescan} variable is non-@code{nil} (which -is the default), @code{nnvirtual} will always scan groups for unread -articles when entering a virtual group. If this variable is @code{nil} -and you read articles in a component group after the virtual group has -been activated, the read articles from the component group will show up -when you enter the virtual group. You'll also see this effect if you -have two virtual groups that have a component group in common. If -that's the case, you should set this variable to @code{t}. Or you can -just tap @code{M-g} on the virtual group every time before you enter -it---it'll have much the same effect. - -@code{nnvirtual} can have both mail and news groups as component groups. -When responding to articles in @code{nnvirtual} groups, @code{nnvirtual} -has to ask the back end of the component group the article comes from -whether it is a news or mail back end. However, when you do a @kbd{^}, -there is typically no sure way for the component back end to know this, -and in that case @code{nnvirtual} tells Gnus that the article came from a -not-news back end. (Just to be on the safe side.) - -@kbd{C-c C-n} in the message buffer will insert the @code{Newsgroups} -line from the article you respond to in these cases. - -@code{nnvirtual} groups do not inherit anything but articles and marks -from component groups---group parameters, for instance, are not -inherited. - - -@node Kibozed Groups -@subsection Kibozed Groups -@cindex nnkiboze -@cindex kibozing - -@dfn{Kibozing} is defined by the @acronym{OED} as ``grepping through -(parts of) the news feed''. @code{nnkiboze} is a back end that will -do this for you. Oh joy! Now you can grind any @acronym{NNTP} server -down to a halt with useless requests! Oh happiness! - -@kindex G k (Group) -To create a kibozed group, use the @kbd{G k} command in the group -buffer. - -The address field of the @code{nnkiboze} method is, as with -@code{nnvirtual}, a regexp to match groups to be ``included'' in the -@code{nnkiboze} group. That's where most similarities between -@code{nnkiboze} and @code{nnvirtual} end. - -In addition to this regexp detailing component groups, an -@code{nnkiboze} group must have a score file to say what articles are -to be included in the group (@pxref{Scoring}). - -@kindex M-x nnkiboze-generate-groups -@findex nnkiboze-generate-groups -You must run @kbd{M-x nnkiboze-generate-groups} after creating the -@code{nnkiboze} groups you want to have. This command will take time. -Lots of time. Oodles and oodles of time. Gnus has to fetch the -headers from all the articles in all the component groups and run them -through the scoring process to determine if there are any articles in -the groups that are to be part of the @code{nnkiboze} groups. - -Please limit the number of component groups by using restrictive -regexps. Otherwise your sysadmin may become annoyed with you, and the -@acronym{NNTP} site may throw you off and never let you back in again. -Stranger things have happened. - -@code{nnkiboze} component groups do not have to be alive---they can be dead, -and they can be foreign. No restrictions. - -@vindex nnkiboze-directory -The generation of an @code{nnkiboze} group means writing two files in -@code{nnkiboze-directory}, which is @file{~/News/kiboze/} by default. -One contains the @acronym{NOV} header lines for all the articles in -the group, and the other is an additional @file{.newsrc} file to store -information on what groups have been searched through to find -component articles. - -Articles marked as read in the @code{nnkiboze} group will have -their @acronym{NOV} lines removed from the @acronym{NOV} file. - - -@node Email Based Diary -@section Email Based Diary -@cindex diary -@cindex email based diary -@cindex calendar - -This section describes a special mail back end called @code{nndiary}, -and its companion library @code{gnus-diary}. It is ``special'' in the -sense that it is not meant to be one of the standard alternatives for -reading mail with Gnus. See @ref{Choosing a Mail Back End} for that. -Instead, it is used to treat @emph{some} of your mails in a special way, -namely, as event reminders. - -Here is a typical scenario: - -@itemize @bullet -@item -You've got a date with Andy Mc Dowell or Bruce Willis (select according -to your sexual preference) in one month. You don't want to forget it. -@item -So you send a ``reminder'' message (actually, a diary one) to yourself. -@item -You forget all about it and keep on getting and reading new mail, as usual. -@item -From time to time, as you type `g' in the group buffer and as the date -is getting closer, the message will pop up again to remind you of your -appointment, just as if it were new and unread. -@item -Read your ``new'' messages, this one included, and start dreaming again -of the night you're gonna have. -@item -Once the date is over (you actually fell asleep just after dinner), the -message will be automatically deleted if it is marked as expirable. -@end itemize - -The Gnus Diary back end has the ability to handle regular appointments -(that wouldn't ever be deleted) as well as punctual ones, operates as a -real mail back end and is configurable in many ways. All of this is -explained in the sections below. - -@menu -* The NNDiary Back End:: Basic setup and usage. -* The Gnus Diary Library:: Utility toolkit on top of nndiary. -* Sending or Not Sending:: A final note on sending diary messages. -@end menu - - -@node The NNDiary Back End -@subsection The NNDiary Back End -@cindex nndiary -@cindex the nndiary back end - -@code{nndiary} is a back end very similar to @code{nnml} (@pxref{Mail -Spool}). Actually, it could appear as a mix of @code{nnml} and -@code{nndraft}. If you know @code{nnml}, you're already familiar with -the message storing scheme of @code{nndiary}: one file per message, one -directory per group. - - Before anything, there is one requirement to be able to run -@code{nndiary} properly: you @emph{must} use the group timestamp feature -of Gnus. This adds a timestamp to each group's parameters. @ref{Group -Timestamp} to see how it's done. - -@menu -* Diary Messages:: What makes a message valid for nndiary. -* Running NNDiary:: NNDiary has two modes of operation. -* Customizing NNDiary:: Bells and whistles. -@end menu - -@node Diary Messages -@subsubsection Diary Messages -@cindex nndiary messages -@cindex nndiary mails - -@code{nndiary} messages are just normal ones, except for the mandatory -presence of 7 special headers. These headers are of the form -@code{X-Diary-<something>}, @code{<something>} being one of -@code{Minute}, @code{Hour}, @code{Dom}, @code{Month}, @code{Year}, -@code{Time-Zone} and @code{Dow}. @code{Dom} means ``Day of Month'', and -@code{dow} means ``Day of Week''. These headers actually behave like -crontab specifications and define the event date(s): - -@itemize @bullet -@item -For all headers except the @code{Time-Zone} one, a header value is -either a star (meaning all possible values), or a list of fields -(separated by a comma). -@item -A field is either an integer, or a range. -@item -A range is two integers separated by a dash. -@item -Possible integer values are 0--59 for @code{Minute}, 0--23 for -@code{Hour}, 1--31 for @code{Dom}, 1--12 for @code{Month}, above 1971 -for @code{Year} and 0--6 for @code{Dow} (0 meaning Sunday). -@item -As a special case, a star in either @code{Dom} or @code{Dow} doesn't -mean ``all possible values'', but ``use only the other field''. Note -that if both are star'ed, the use of either one gives the same result. -@item -The @code{Time-Zone} header is special in that it can only have one -value (@code{GMT}, for instance). A star doesn't mean ``all possible -values'' (because it makes no sense), but ``the current local time -zone''. Most of the time, you'll be using a star here. However, for a -list of available time zone values, see the variable -@code{nndiary-headers}. -@end itemize - -As a concrete example, here are the diary headers to add to your message -for specifying ``Each Monday and each 1st of month, at 12:00, 20:00, -21:00, 22:00, 23:00 and 24:00, from 1999 to 2010'' (I'll let you find -what to do then): - -@example -X-Diary-Minute: 0 -X-Diary-Hour: 12, 20-24 -X-Diary-Dom: 1 -X-Diary-Month: * -X-Diary-Year: 1999-2010 -X-Diary-Dow: 1 -X-Diary-Time-Zone: * -@end example - -@node Running NNDiary -@subsubsection Running NNDiary -@cindex running nndiary -@cindex nndiary operation modes - -@code{nndiary} has two modes of operation: ``traditional'' (the default) -and ``autonomous''. In traditional mode, @code{nndiary} does not get new -mail by itself. You have to move (@kbd{B m}) or copy (@kbd{B c}) mails -from your primary mail back end to nndiary groups in order to handle them -as diary messages. In autonomous mode, @code{nndiary} retrieves its own -mail and handles it independently from your primary mail back end. - -One should note that Gnus is not inherently designed to allow several -``master'' mail back ends at the same time. However, this does make -sense with @code{nndiary}: you really want to send and receive diary -messages to your diary groups directly. So, @code{nndiary} supports -being sort of a ``second primary mail back end'' (to my knowledge, it is -the only back end offering this feature). However, there is a limitation -(which I hope to fix some day): respooling doesn't work in autonomous -mode. - -In order to use @code{nndiary} in autonomous mode, you have several -things to do: - -@itemize @bullet -@item -Allow @code{nndiary} to retrieve new mail by itself. Put the following -line in your @file{~/.gnus.el} file: - -@lisp -(setq nndiary-get-new-mail t) -@end lisp -@item -You must arrange for diary messages (those containing @code{X-Diary-*} -headers) to be split in a private folder @emph{before} Gnus treat them. -Again, this is needed because Gnus cannot (yet ?) properly handle -multiple primary mail back ends. Getting those messages from a separate -source will compensate this misfeature to some extent. - -As an example, here's my procmailrc entry to store diary files in -@file{~/.nndiary} (the default @code{nndiary} mail source file): - -@example -:0 HD : -* ^X-Diary -.nndiary -@end example -@end itemize - -Once this is done, you might want to customize the following two options -that affect the diary mail retrieval and splitting processes: - -@defvar nndiary-mail-sources -This is the diary-specific replacement for the standard -@code{mail-sources} variable. It obeys the same syntax, and defaults to -@code{(file :path "~/.nndiary")}. -@end defvar - -@defvar nndiary-split-methods -This is the diary-specific replacement for the standard -@code{nnmail-split-methods} variable. It obeys the same syntax. -@end defvar - - Finally, you may add a permanent @code{nndiary} virtual server -(something like @code{(nndiary "diary")} should do) to your -@code{gnus-secondary-select-methods}. - - Hopefully, almost everything (see the TODO section in -@file{nndiary.el}) will work as expected when you restart Gnus: in -autonomous mode, typing @kbd{g} and @kbd{M-g} in the group buffer, will -also get your new diary mails and split them according to your -diary-specific rules, @kbd{F} will find your new diary groups etc. - -@node Customizing NNDiary -@subsubsection Customizing NNDiary -@cindex customizing nndiary -@cindex nndiary customization - -Now that @code{nndiary} is up and running, it's time to customize it. -The custom group is called @code{nndiary} (no, really ?!). You should -browse it to figure out which options you'd like to tweak. The following -two variables are probably the only ones you will want to change: - -@defvar nndiary-reminders -This is the list of times when you want to be reminded of your -appointments (e.g. 3 weeks before, then 2 days before, then 1 hour -before and that's it). Remember that ``being reminded'' means that the -diary message will pop up as brand new and unread again when you get new -mail. -@end defvar - -@defvar nndiary-week-starts-on-monday -Rather self-explanatory. Otherwise, Sunday is assumed (this is the -default). -@end defvar - - -@node The Gnus Diary Library -@subsection The Gnus Diary Library -@cindex gnus-diary -@cindex the gnus diary library - -Using @code{nndiary} manually (I mean, writing the headers by hand and -so on) would be rather boring. Fortunately, there is a library called -@code{gnus-diary} written on top of @code{nndiary}, that does many -useful things for you. - - In order to use it, add the following line to your @file{~/.gnus.el} file: - -@lisp -(require 'gnus-diary) -@end lisp - - Also, you shouldn't use any @code{gnus-user-format-function-[d|D]} -(@pxref{Summary Buffer Lines}). @code{gnus-diary} provides both of these -(sorry if you used them before). - - -@menu -* Diary Summary Line Format:: A nicer summary buffer line format. -* Diary Articles Sorting:: A nicer way to sort messages. -* Diary Headers Generation:: Not doing it manually. -* Diary Group Parameters:: Not handling them manually. -@end menu - -@node Diary Summary Line Format -@subsubsection Diary Summary Line Format -@cindex diary summary buffer line -@cindex diary summary line format - -Displaying diary messages in standard summary line format (usually -something like @samp{From Joe: Subject}) is pretty useless. Most of -the time, you're the one who wrote the message, and you mostly want to -see the event's date. - - @code{gnus-diary} provides two supplemental user formats to be used in -summary line formats. @code{D} corresponds to a formatted time string -for the next occurrence of the event (e.g. ``Sat, Sep 22 01, 12:00''), -while @code{d} corresponds to an approximative remaining time until the -next occurrence of the event (e.g. ``in 6 months, 1 week''). - - For example, here's how Joe's birthday is displayed in my -@code{nndiary+diary:birthdays} summary buffer (note that the message is -expirable, but will never be deleted, as it specifies a periodic event): - -@example - E Sat, Sep 22 01, 12:00: Joe's birthday (in 6 months, 1 week) -@end example - -In order to get something like the above, you would normally add the -following line to your diary groups'parameters: - -@lisp -(gnus-summary-line-format "%U%R%z %uD: %(%s%) (%ud)\n") -@end lisp - -However, @code{gnus-diary} does it automatically (@pxref{Diary Group -Parameters}). You can however customize the provided summary line format -with the following user options: - -@defvar gnus-diary-summary-line-format -Defines the summary line format used for diary groups (@pxref{Summary -Buffer Lines}). @code{gnus-diary} uses it to automatically update the -diary groups'parameters. -@end defvar - -@defvar gnus-diary-time-format -Defines the format to display dates in diary summary buffers. This is -used by the @code{D} user format. See the docstring for details. -@end defvar - -@defvar gnus-diary-delay-format-function -Defines the format function to use for displaying delays (remaining -times) in diary summary buffers. This is used by the @code{d} user -format. There are currently built-in functions for English and French; -you can also define your own. See the docstring for details. -@end defvar - -@node Diary Articles Sorting -@subsubsection Diary Articles Sorting -@cindex diary articles sorting -@cindex diary summary lines sorting -@findex gnus-summary-sort-by-schedule -@findex gnus-thread-sort-by-schedule -@findex gnus-article-sort-by-schedule - -@code{gnus-diary} provides new sorting functions (@pxref{Sorting the -Summary Buffer} ) called @code{gnus-summary-sort-by-schedule}, -@code{gnus-thread-sort-by-schedule} and -@code{gnus-article-sort-by-schedule}. These functions let you organize -your diary summary buffers from the closest event to the farthest one. - -@code{gnus-diary} automatically installs -@code{gnus-summary-sort-by-schedule} as a menu item in the summary -buffer's ``sort'' menu, and the two others as the primary (hence -default) sorting functions in the group parameters (@pxref{Diary Group -Parameters}). - -@node Diary Headers Generation -@subsubsection Diary Headers Generation -@cindex diary headers generation -@findex gnus-diary-check-message - -@code{gnus-diary} provides a function called -@code{gnus-diary-check-message} to help you handle the @code{X-Diary-*} -headers. This function ensures that the current message contains all the -required diary headers, and prompts you for values or corrections if -needed. - - This function is hooked into the @code{nndiary} back end, so that -moving or copying an article to a diary group will trigger it -automatically. It is also bound to @kbd{C-c D c} in @code{message-mode} -and @code{article-edit-mode} in order to ease the process of converting -a usual mail to a diary one. - - This function takes a prefix argument which will force prompting of -all diary headers, regardless of their presence or validity. That way, -you can very easily reschedule an already valid diary message, for -instance. - -@node Diary Group Parameters -@subsubsection Diary Group Parameters -@cindex diary group parameters - -When you create a new diary group, or visit one, @code{gnus-diary} -automatically checks your group parameters and if needed, sets the -summary line format to the diary-specific value, installs the -diary-specific sorting functions, and also adds the different -@code{X-Diary-*} headers to the group's posting-style. It is then easier -to send a diary message, because if you use @kbd{C-u a} or @kbd{C-u m} -on a diary group to prepare a message, these headers will be inserted -automatically (although not filled with proper values yet). - -@node Sending or Not Sending -@subsection Sending or Not Sending - -Well, assuming you've read all of the above, here are two final notes on -mail sending with @code{nndiary}: - -@itemize @bullet -@item -@code{nndiary} is a @emph{real} mail back end. You really send real diary -messsages for real. This means for instance that you can give -appointments to anybody (provided they use Gnus and @code{nndiary}) by -sending the diary message to them as well. -@item -However, since @code{nndiary} also has a @code{request-post} method, you -can also use @kbd{C-u a} instead of @kbd{C-u m} on a diary group and the -message won't actually be sent; just stored locally in the group. This -comes in very handy for private appointments. -@end itemize - -@node Gnus Unplugged -@section Gnus Unplugged -@cindex offline -@cindex unplugged -@cindex agent -@cindex Gnus agent -@cindex Gnus unplugged - -In olden times (ca. February '88), people used to run their newsreaders -on big machines with permanent connections to the net. News transport -was dealt with by news servers, and all the newsreaders had to do was to -read news. Believe it or not. - -Nowadays most people read news and mail at home, and use some sort of -modem to connect to the net. To avoid running up huge phone bills, it -would be nice to have a way to slurp down all the news and mail, hang up -the phone, read for several hours, and then upload any responses you -have to make. And then you repeat the procedure. - -Of course, you can use news servers for doing this as well. I've used -@code{inn} together with @code{slurp}, @code{pop} and @code{sendmail} -for some years, but doing that's a bore. Moving the news server -functionality up to the newsreader makes sense if you're the only person -reading news on a machine. - -Setting up Gnus as an ``offline'' newsreader is quite simple. In -fact, you don't even have to configure anything. - -Of course, to use it as such, you have to learn a few new commands. - -@menu -* Agent Basics:: How it all is supposed to work. -* Agent Categories:: How to tell the Gnus Agent what to download. -* Agent Commands:: New commands for all the buffers. -* Agent Visuals:: Ways that the agent may effect your summary buffer. -* Agent as Cache:: The Agent is a big cache too. -* Agent Expiry:: How to make old articles go away. -* Agent Regeneration:: How to recover from lost connections and other accidents. -* Agent and IMAP:: How to use the Agent with @acronym{IMAP}. -* Outgoing Messages:: What happens when you post/mail something? -* Agent Variables:: Customizing is fun. -* Example Setup:: An example @file{~/.gnus.el} file for offline people. -* Batching Agents:: How to fetch news from a @code{cron} job. -* Agent Caveats:: What you think it'll do and what it does. -@end menu - - -@node Agent Basics -@subsection Agent Basics - -First, let's get some terminology out of the way. - -The Gnus Agent is said to be @dfn{unplugged} when you have severed the -connection to the net (and notified the Agent that this is the case). -When the connection to the net is up again (and Gnus knows this), the -Agent is @dfn{plugged}. - -The @dfn{local} machine is the one you're running on, and which isn't -connected to the net continuously. - -@dfn{Downloading} means fetching things from the net to your local -machine. @dfn{Uploading} is doing the opposite. - -You know that Gnus gives you all the opportunity you'd ever want for -shooting yourself in the foot. Some people call it flexibility. Gnus -is also customizable to a great extent, which means that the user has a -say on how Gnus behaves. Other newsreaders might unconditionally shoot -you in your foot, but with Gnus, you have a choice! - -Gnus is never really in plugged or unplugged state. Rather, it applies -that state to each server individually. This means that some servers -can be plugged while others can be unplugged. Additionally, some -servers can be ignored by the Agent altogether (which means that -they're kinda like plugged always). - -So when you unplug the Agent and then wonder why is Gnus opening a -connection to the Net, the next step to do is to look whether all -servers are agentized. If there is an unagentized server, you found -the culprit. - -Another thing is the @dfn{offline} state. Sometimes, servers aren't -reachable. When Gnus notices this, it asks you whether you want the -server to be switched to offline state. If you say yes, then the -server will behave somewhat as if it was unplugged, except that Gnus -will ask you whether you want to switch it back online again. - -Let's take a typical Gnus session using the Agent. - -@itemize @bullet - -@item -@findex gnus-unplugged -You start Gnus with @code{gnus-unplugged}. This brings up the Gnus -Agent in a disconnected state. You can read all the news that you have -already fetched while in this mode. - -@item -You then decide to see whether any new news has arrived. You connect -your machine to the net (using PPP or whatever), and then hit @kbd{J j} -to make Gnus become @dfn{plugged} and use @kbd{g} to check for new mail -as usual. To check for new mail in unplugged mode (@pxref{Mail -Source Specifiers}). - -@item -You can then read the new news immediately, or you can download the -news onto your local machine. If you want to do the latter, you press -@kbd{g} to check if there are any new news and then @kbd{J s} to fetch -all the eligible articles in all the groups. (To let Gnus know which -articles you want to download, @pxref{Agent Categories}). - -@item -After fetching the articles, you press @kbd{J j} to make Gnus become -unplugged again, and you shut down the PPP thing (or whatever). And -then you read the news offline. - -@item -And then you go to step 2. -@end itemize - -Here are some things you should do the first time (or so) that you use -the Agent. - -@itemize @bullet - -@item -Decide which servers should be covered by the Agent. If you have a mail -back end, it would probably be nonsensical to have it covered by the -Agent. Go to the server buffer (@kbd{^} in the group buffer) and press -@kbd{J a} on the server (or servers) that you wish to have covered by the -Agent (@pxref{Server Agent Commands}), or @kbd{J r} on automatically -added servers you do not wish to have covered by the Agent. By default, -all @code{nntp} and @code{nnimap} servers in @code{gnus-select-method} and -@code{gnus-secondary-select-methods} are agentized. - -@item -Decide on download policy. It's fairly simple once you decide whether -you are going to use agent categories, topic parameters, and/or group -parameters to implement your policy. If you're new to gnus, it -is probably best to start with a category, @xref{Agent Categories}. - -Both topic parameters (@pxref{Topic Parameters}) and agent categories -(@pxref{Agent Categories}) provide for setting a policy that applies -to multiple groups. Which you use is entirely up to you. Topic -parameters do override categories so, if you mix the two, you'll have -to take that into account. If you have a few groups that deviate from -your policy, you can use group parameters (@pxref{Group Parameters}) to -configure them. - -@item -Uhm@dots{} that's it. -@end itemize - - -@node Agent Categories -@subsection Agent Categories - -One of the main reasons to integrate the news transport layer into the -newsreader is to allow greater control over what articles to download. -There's not much point in downloading huge amounts of articles, just to -find out that you're not interested in reading any of them. It's better -to be somewhat more conservative in choosing what to download, and then -mark the articles for downloading manually if it should turn out that -you're interested in the articles anyway. - -One of the more effective methods for controlling what is to be -downloaded is to create a @dfn{category} and then assign some (or all) -groups to this category. Groups that do not belong in any other -category belong to the @code{default} category. Gnus has its own -buffer for creating and managing categories. - -If you prefer, you can also use group parameters (@pxref{Group -Parameters}) and topic parameters (@pxref{Topic Parameters}) for an -alternative approach to controlling the agent. The only real -difference is that categories are specific to the agent (so there is -less to learn) while group and topic parameters include the kitchen -sink. - -Since you can set agent parameters in several different places we have -a rule to decide which source to believe. This rule specifies that -the parameter sources are checked in the following order: group -parameters, topic parameters, agent category, and finally customizable -variables. So you can mix all of these sources to produce a wide range -of behavior, just don't blame me if you don't remember where you put -your settings. - -@menu -* Category Syntax:: What a category looks like. -* Category Buffer:: A buffer for maintaining categories. -* Category Variables:: Customize'r'Us. -@end menu - - -@node Category Syntax -@subsubsection Category Syntax - -A category consists of a name, the list of groups belonging to the -category, and a number of optional parameters that override the -customizable variables. The complete list of agent parameters are -listed below. - -@cindex Agent Parameters -@table @code -@item gnus-agent-cat-name -The name of the category. - -@item gnus-agent-cat-groups -The list of groups that are in this category. - -@item gnus-agent-cat-predicate -A predicate which (generally) gives a rough outline of which articles -are eligible for downloading; and - -@item gnus-agent-cat-score-file -a score rule which (generally) gives you a finer granularity when -deciding what articles to download. (Note that this @dfn{download -score} is not necessarily related to normal scores.) - -@item gnus-agent-cat-enable-expiration -a boolean indicating whether the agent should expire old articles in -this group. Most groups should be expired to conserve disk space. In -fact, its probably safe to say that the gnus.* hierarchy contains the -only groups that should not be expired. - -@item gnus-agent-cat-days-until-old -an integer indicating the number of days that the agent should wait -before deciding that a read article is safe to expire. - -@item gnus-agent-cat-low-score -an integer that overrides the value of @code{gnus-agent-low-score}. - -@item gnus-agent-cat-high-score -an integer that overrides the value of @code{gnus-agent-high-score}. - -@item gnus-agent-cat-length-when-short -an integer that overrides the value of -@code{gnus-agent-short-article}. - -@item gnus-agent-cat-length-when-long -an integer that overrides the value of @code{gnus-agent-long-article}. - -@c @item gnus-agent-cat-disable-undownloaded-faces -@c a symbol indicating whether the summary buffer should @emph{not} display -@c undownloaded articles using the gnus-summary-*-undownloaded-face -@c faces. The symbol nil will enable the use of undownloaded faces while -@c all other symbols disable them. - -@item gnus-agent-cat-enable-undownloaded-faces -a symbol indicating whether the summary buffer should display -undownloaded articles using the gnus-summary-*-undownloaded-face -faces. The symbol nil will disable the use of undownloaded faces while -all other symbols enable them. -@end table - -The name of a category can not be changed once the category has been -created. - -Each category maintains a list of groups that are exclusive members of -that category. The exclusivity rule is automatically enforced, add a -group to a new category and it is automatically removed from its old -category. - -A predicate in its simplest form can be a single predicate such as -@code{true} or @code{false}. These two will download every available -article or nothing respectively. In the case of these two special -predicates an additional score rule is superfluous. - -Predicates of @code{high} or @code{low} download articles in respect of -their scores in relationship to @code{gnus-agent-high-score} and -@code{gnus-agent-low-score} as described below. - -To gain even finer control of what is to be regarded eligible for -download a predicate can consist of a number of predicates with logical -operators sprinkled in between. - -Perhaps some examples are in order. - -Here's a simple predicate. (It's the default predicate, in fact, used -for all groups that don't belong to any other category.) - -@lisp -short -@end lisp - -Quite simple, eh? This predicate is true if and only if the article is -short (for some value of ``short''). - -Here's a more complex predicate: - -@lisp -(or high - (and - (not low) - (not long))) -@end lisp - -This means that an article should be downloaded if it has a high score, -or if the score is not low and the article is not long. You get the -drift. - -The available logical operators are @code{or}, @code{and} and -@code{not}. (If you prefer, you can use the more ``C''-ish operators -@samp{|}, @code{&} and @code{!} instead.) - -The following predicates are pre-defined, but if none of these fit what -you want to do, you can write your own. - -When evaluating each of these predicates, the named constant will be -bound to the value determined by calling -@code{gnus-agent-find-parameter} on the appropriate parameter. For -example, gnus-agent-short-article will be bound to -@code{(gnus-agent-find-parameter group 'agent-short-article)}. This -means that you can specify a predicate in your category then tune that -predicate to individual groups. - -@table @code -@item short -True if the article is shorter than @code{gnus-agent-short-article} -lines; default 100. - -@item long -True if the article is longer than @code{gnus-agent-long-article} -lines; default 200. - -@item low -True if the article has a download score less than -@code{gnus-agent-low-score}; default 0. - -@item high -True if the article has a download score greater than -@code{gnus-agent-high-score}; default 0. - -@item spam -True if the Gnus Agent guesses that the article is spam. The -heuristics may change over time, but at present it just computes a -checksum and sees whether articles match. - -@item true -Always true. - -@item false -Always false. -@end table - -If you want to create your own predicate function, here's what you have -to know: The functions are called with no parameters, but the -@code{gnus-headers} and @code{gnus-score} dynamic variables are bound to -useful values. - -For example, you could decide that you don't want to download articles -that were posted more than a certain number of days ago (e.g. posted -more than @code{gnus-agent-expire-days} ago) you might write a function -something along the lines of the following: - -@lisp -(defun my-article-old-p () - "Say whether an article is old." - (< (time-to-days (date-to-time (mail-header-date gnus-headers))) - (- (time-to-days (current-time)) gnus-agent-expire-days))) -@end lisp - -with the predicate then defined as: - -@lisp -(not my-article-old-p) -@end lisp - -or you could append your predicate to the predefined -@code{gnus-category-predicate-alist} in your @file{~/.gnus.el} or -wherever. - -@lisp -(require 'gnus-agent) -(setq gnus-category-predicate-alist - (append gnus-category-predicate-alist - '((old . my-article-old-p)))) -@end lisp - -and simply specify your predicate as: - -@lisp -(not old) -@end lisp - -If/when using something like the above, be aware that there are many -misconfigured systems/mailers out there and so an article's date is not -always a reliable indication of when it was posted. Hell, some people -just don't give a damn. - -The above predicates apply to @emph{all} the groups which belong to the -category. However, if you wish to have a specific predicate for an -individual group within a category, or you're just too lazy to set up a -new category, you can enter a group's individual predicate in its group -parameters like so: - -@lisp -(agent-predicate . short) -@end lisp - -This is the group/topic parameter equivalent of the agent category default. -Note that when specifying a single word predicate like this, the -@code{agent-predicate} specification must be in dotted pair notation. - -The equivalent of the longer example from above would be: - -@lisp -(agent-predicate or high (and (not low) (not long))) -@end lisp - -The outer parenthesis required in the category specification are not -entered here as, not being in dotted pair notation, the value of the -predicate is assumed to be a list. - - -Now, the syntax of the download score is the same as the syntax of -normal score files, except that all elements that require actually -seeing the article itself are verboten. This means that only the -following headers can be scored on: @code{Subject}, @code{From}, -@code{Date}, @code{Message-ID}, @code{References}, @code{Chars}, -@code{Lines}, and @code{Xref}. - -As with predicates, the specification of the @code{download score rule} -to use in respect of a group can be in either the category definition if -it's to be applicable to all groups in therein, or a group's parameters -if it's to be specific to that group. - -In both of these places the @code{download score rule} can take one of -three forms: - -@enumerate -@item -Score rule - -This has the same syntax as a normal Gnus score file except only a -subset of scoring keywords are available as mentioned above. - -example: - -@itemize @bullet -@item -Category specification - -@lisp -(("from" - ("Lars Ingebrigtsen" 1000000 nil s)) -("lines" - (500 -100 nil <))) -@end lisp - -@item -Group/Topic Parameter specification - -@lisp -(agent-score ("from" - ("Lars Ingebrigtsen" 1000000 nil s)) - ("lines" - (500 -100 nil <))) -@end lisp - -Again, note the omission of the outermost parenthesis here. -@end itemize - -@item -Agent score file - -These score files must @emph{only} contain the permitted scoring -keywords stated above. - -example: - -@itemize @bullet -@item -Category specification - -@lisp -("~/News/agent.SCORE") -@end lisp - -or perhaps - -@lisp -("~/News/agent.SCORE" "~/News/agent.group.SCORE") -@end lisp - -@item -Group Parameter specification - -@lisp -(agent-score "~/News/agent.SCORE") -@end lisp - -Additional score files can be specified as above. Need I say anything -about parenthesis? -@end itemize - -@item -Use @code{normal} score files - -If you don't want to maintain two sets of scoring rules for a group, and -your desired @code{downloading} criteria for a group are the same as your -@code{reading} criteria then you can tell the agent to refer to your -@code{normal} score files when deciding what to download. - -These directives in either the category definition or a group's -parameters will cause the agent to read in all the applicable score -files for a group, @emph{filtering out} those sections that do not -relate to one of the permitted subset of scoring keywords. - -@itemize @bullet -@item -Category Specification - -@lisp -file -@end lisp - -@item -Group Parameter specification - -@lisp -(agent-score . file) -@end lisp -@end itemize -@end enumerate - -@node Category Buffer -@subsubsection Category Buffer - -You'd normally do all category maintenance from the category buffer. -When you enter it for the first time (with the @kbd{J c} command from -the group buffer), you'll only see the @code{default} category. - -The following commands are available in this buffer: - -@table @kbd -@item q -@kindex q (Category) -@findex gnus-category-exit -Return to the group buffer (@code{gnus-category-exit}). - -@item e -@kindex e (Category) -@findex gnus-category-customize-category -Use a customization buffer to set all of the selected category's -parameters at one time (@code{gnus-category-customize-category}). - -@item k -@kindex k (Category) -@findex gnus-category-kill -Kill the current category (@code{gnus-category-kill}). - -@item c -@kindex c (Category) -@findex gnus-category-copy -Copy the current category (@code{gnus-category-copy}). - -@item a -@kindex a (Category) -@findex gnus-category-add -Add a new category (@code{gnus-category-add}). - -@item p -@kindex p (Category) -@findex gnus-category-edit-predicate -Edit the predicate of the current category -(@code{gnus-category-edit-predicate}). - -@item g -@kindex g (Category) -@findex gnus-category-edit-groups -Edit the list of groups belonging to the current category -(@code{gnus-category-edit-groups}). - -@item s -@kindex s (Category) -@findex gnus-category-edit-score -Edit the download score rule of the current category -(@code{gnus-category-edit-score}). - -@item l -@kindex l (Category) -@findex gnus-category-list -List all the categories (@code{gnus-category-list}). -@end table - - -@node Category Variables -@subsubsection Category Variables - -@table @code -@item gnus-category-mode-hook -@vindex gnus-category-mode-hook -Hook run in category buffers. - -@item gnus-category-line-format -@vindex gnus-category-line-format -Format of the lines in the category buffer (@pxref{Formatting -Variables}). Valid elements are: - -@table @samp -@item c -The name of the category. - -@item g -The number of groups in the category. -@end table - -@item gnus-category-mode-line-format -@vindex gnus-category-mode-line-format -Format of the category mode line (@pxref{Mode Line Formatting}). - -@item gnus-agent-short-article -@vindex gnus-agent-short-article -Articles that have fewer lines than this are short. Default 100. - -@item gnus-agent-long-article -@vindex gnus-agent-long-article -Articles that have more lines than this are long. Default 200. - -@item gnus-agent-low-score -@vindex gnus-agent-low-score -Articles that have a score lower than this have a low score. Default -0. - -@item gnus-agent-high-score -@vindex gnus-agent-high-score -Articles that have a score higher than this have a high score. Default -0. - -@item gnus-agent-expire-days -@vindex gnus-agent-expire-days -The number of days that a @samp{read} article must stay in the agent's -local disk before becoming eligible for expiration (While the name is -the same, this doesn't mean expiring the article on the server. It -just means deleting the local copy of the article). What is also -important to understand is that the counter starts with the time the -article was written to the local disk and not the time the article was -read. -Default 7. - -@item gnus-agent-enable-expiration -@vindex gnus-agent-enable-expiration -Determines whether articles in a group are, by default, expired or -retained indefinitely. The default is @code{ENABLE} which means that -you'll have to disable expiration when desired. On the other hand, -you could set this to @code{DISABLE}. In that case, you would then -have to enable expiration in selected groups. - -@end table - - -@node Agent Commands -@subsection Agent Commands -@findex gnus-agent-toggle-plugged -@kindex J j (Agent) - -All the Gnus Agent commands are on the @kbd{J} submap. The @kbd{J j} -(@code{gnus-agent-toggle-plugged}) command works in all modes, and -toggles the plugged/unplugged state of the Gnus Agent. - - -@menu -* Group Agent Commands:: Configure groups and fetch their contents. -* Summary Agent Commands:: Manually select then fetch specific articles. -* Server Agent Commands:: Select the servers that are supported by the agent. -@end menu - - - - -@node Group Agent Commands -@subsubsection Group Agent Commands - -@table @kbd -@item J u -@kindex J u (Agent Group) -@findex gnus-agent-fetch-groups -Fetch all eligible articles in the current group -(@code{gnus-agent-fetch-groups}). - -@item J c -@kindex J c (Agent Group) -@findex gnus-enter-category-buffer -Enter the Agent category buffer (@code{gnus-enter-category-buffer}). - -@item J s -@kindex J s (Agent Group) -@findex gnus-agent-fetch-session -Fetch all eligible articles in all groups -(@code{gnus-agent-fetch-session}). - -@item J S -@kindex J S (Agent Group) -@findex gnus-group-send-queue -Send all sendable messages in the queue group -(@code{gnus-group-send-queue}). @xref{Drafts}. - -@item J a -@kindex J a (Agent Group) -@findex gnus-agent-add-group -Add the current group to an Agent category -(@code{gnus-agent-add-group}). This command understands the -process/prefix convention (@pxref{Process/Prefix}). - -@item J r -@kindex J r (Agent Group) -@findex gnus-agent-remove-group -Remove the current group from its category, if any -(@code{gnus-agent-remove-group}). This command understands the -process/prefix convention (@pxref{Process/Prefix}). - -@item J Y -@kindex J Y (Agent Group) -@findex gnus-agent-synchronize-flags -Synchronize flags changed while unplugged with remote server, if any. - - -@end table - - -@node Summary Agent Commands -@subsubsection Summary Agent Commands - -@table @kbd -@item J # -@kindex J # (Agent Summary) -@findex gnus-agent-mark-article -Mark the article for downloading (@code{gnus-agent-mark-article}). - -@item J M-# -@kindex J M-# (Agent Summary) -@findex gnus-agent-unmark-article -Remove the downloading mark from the article -(@code{gnus-agent-unmark-article}). - -@cindex % -@item @@ -@kindex @@ (Agent Summary) -@findex gnus-agent-toggle-mark -Toggle whether to download the article -(@code{gnus-agent-toggle-mark}). The download mark is @samp{%} by -default. - -@item J c -@kindex J c (Agent Summary) -@findex gnus-agent-catchup -Mark all articles as read (@code{gnus-agent-catchup}) that are neither cached, downloaded, nor downloadable. - -@item J S -@kindex J S (Agent Summary) -@findex gnus-agent-fetch-group -Download all eligible (@pxref{Agent Categories}) articles in this group. -(@code{gnus-agent-fetch-group}). - -@item J s -@kindex J s (Agent Summary) -@findex gnus-agent-fetch-series -Download all processable articles in this group. -(@code{gnus-agent-fetch-series}). - -@item J u -@kindex J u (Agent Summary) -@findex gnus-agent-summary-fetch-group -Download all downloadable articles in the current group -(@code{gnus-agent-summary-fetch-group}). - -@end table - - -@node Server Agent Commands -@subsubsection Server Agent Commands - -@table @kbd -@item J a -@kindex J a (Agent Server) -@findex gnus-agent-add-server -Add the current server to the list of servers covered by the Gnus Agent -(@code{gnus-agent-add-server}). - -@item J r -@kindex J r (Agent Server) -@findex gnus-agent-remove-server -Remove the current server from the list of servers covered by the Gnus -Agent (@code{gnus-agent-remove-server}). - -@end table - - -@node Agent Visuals -@subsection Agent Visuals - -If you open a summary while unplugged and, Gnus knows from the group's -active range that there are more articles than the headers currently -stored in the Agent, you may see some articles whose subject looks -something like @samp{[Undownloaded article #####]}. These are -placeholders for the missing headers. Aside from setting a mark, -there is not much that can be done with one of these placeholders. -When Gnus finally gets a chance to fetch the group's headers, the -placeholders will automatically be replaced by the actual headers. -You can configure the summary buffer's maneuvering to skip over the -placeholders if you care (See @code{gnus-auto-goto-ignores}). - -While it may be obvious to all, the only headers and articles -available while unplugged are those headers and articles that were -fetched into the Agent while previously plugged. To put it another -way, ``If you forget to fetch something while plugged, you might have a -less than satisfying unplugged session''. For this reason, the Agent -adds two visual effects to your summary buffer. These effects display -the download status of each article so that you always know which -articles will be available when unplugged. - -The first visual effect is the @samp{%O} spec. If you customize -@code{gnus-summary-line-format} to include this specifier, you will add -a single character field that indicates an article's download status. -Articles that have been fetched into either the Agent or the Cache, -will display @code{gnus-downloaded-mark} (defaults to @samp{+}). All -other articles will display @code{gnus-undownloaded-mark} (defaults to -@samp{-}). If you open a group that has not been agentized, a space -(@samp{ }) will be displayed. - -The second visual effect are the undownloaded faces. The faces, there -are three indicating the article's score (low, normal, high), seem to -result in a love/hate response from many Gnus users. The problem is -that the face selection is controlled by a list of condition tests and -face names (See @code{gnus-summary-highlight}). Each condition is -tested in the order in which it appears in the list so early -conditions have precedence over later conditions. All of this means -that, if you tick an undownloaded article, the article will continue -to be displayed in the undownloaded face rather than the ticked face. - -If you use the Agent as a cache (to avoid downloading the same article -each time you visit it or to minimize your connection time), the -undownloaded face will probably seem like a good idea. The reason -being that you do all of our work (marking, reading, deleting) with -downloaded articles so the normal faces always appear. - -For occasional Agent users, the undownloaded faces may appear to be an -absolutely horrible idea. The issue being that, since most of their -articles have not been fetched into the Agent, most of the normal -faces will be obscured by the undownloaded faces. If this is your -situation, you have two choices available. First, you can completely -disable the undownload faces by customizing -@code{gnus-summary-highlight} to delete the three cons-cells that -refer to the @code{gnus-summary-*-undownloaded-face} faces. Second, -if you prefer to take a more fine-grained approach, you may set the -@code{agent-disable-undownloaded-faces} group parameter to @code{t}. -This parameter, like all other agent parameters, may be set on an -Agent Category (@pxref{Agent Categories}), a Group Topic (@pxref{Topic -Parameters}), or an individual group (@pxref{Group Parameters}). - -@node Agent as Cache -@subsection Agent as Cache - -When Gnus is plugged, it is not efficient to download headers or -articles from the server again, if they are already stored in the -Agent. So, Gnus normally only downloads headers once, and stores them -in the Agent. These headers are later used when generating the summary -buffer, regardless of whether you are plugged or unplugged. Articles -are not cached in the Agent by default though (that would potentially -consume lots of disk space), but if you have already downloaded an -article into the Agent, Gnus will not download the article from the -server again but use the locally stored copy instead. - -If you so desire, you can configure the agent (see @code{gnus-agent-cache} -@pxref{Agent Variables}) to always download headers and articles while -plugged. Gnus will almost certainly be slower, but it will be kept -synchronized with the server. That last point probably won't make any -sense if you are using a nntp or nnimap back end. - -@node Agent Expiry -@subsection Agent Expiry - -@vindex gnus-agent-expire-days -@findex gnus-agent-expire -@kindex M-x gnus-agent-expire -@kindex M-x gnus-agent-expire-group -@findex gnus-agent-expire-group -@cindex agent expiry -@cindex Gnus agent expiry -@cindex expiry, in Gnus agent - -The Agent back end, @code{nnagent}, doesn't handle expiry. Well, at -least it doesn't handle it like other back ends. Instead, there are -special @code{gnus-agent-expire} and @code{gnus-agent-expire-group} -commands that will expire all read articles that are older than -@code{gnus-agent-expire-days} days. They can be run whenever you feel -that you're running out of space. Neither are particularly fast or -efficient, and it's not a particularly good idea to interrupt them (with -@kbd{C-g} or anything else) once you've started one of them. - -Note that other functions, e.g. @code{gnus-request-expire-articles}, -might run @code{gnus-agent-expire} for you to keep the agent -synchronized with the group. - -The agent parameter @code{agent-enable-expiration} may be used to -prevent expiration in selected groups. - -@vindex gnus-agent-expire-all -If @code{gnus-agent-expire-all} is non-@code{nil}, the agent -expiration commands will expire all articles---unread, read, ticked -and dormant. If @code{nil} (which is the default), only read articles -are eligible for expiry, and unread, ticked and dormant articles will -be kept indefinitely. - -If you find that some articles eligible for expiry are never expired, -perhaps some Gnus Agent files are corrupted. There's are special -commands, @code{gnus-agent-regenerate} and -@code{gnus-agent-regenerate-group}, to fix possible problems. - -@node Agent Regeneration -@subsection Agent Regeneration - -@cindex agent regeneration -@cindex Gnus agent regeneration -@cindex regeneration - -The local data structures used by @code{nnagent} may become corrupted -due to certain exceptional conditions. When this happens, -@code{nnagent} functionality may degrade or even fail. The solution -to this problem is to repair the local data structures by removing all -internal inconsistencies. - -For example, if your connection to your server is lost while -downloaded articles into the agent, the local data structures will not -know about articles successfully downloaded prior to the connection -failure. Running @code{gnus-agent-regenerate} or -@code{gnus-agent-regenerate-group} will update the data structures -such that you don't need to download these articles a second time. - -@findex gnus-agent-regenerate -@kindex M-x gnus-agent-regenerate -The command @code{gnus-agent-regenerate} will perform -@code{gnus-agent-regenerate-group} on every agentized group. While -you can run @code{gnus-agent-regenerate} in any buffer, it is strongly -recommended that you first close all summary buffers. - -@findex gnus-agent-regenerate-group -@kindex M-x gnus-agent-regenerate-group -The command @code{gnus-agent-regenerate-group} uses the local copies -of individual articles to repair the local @acronym{NOV}(header) database. It -then updates the internal data structures that document which articles -are stored locally. An optional argument will mark articles in the -agent as unread. - -@node Agent and IMAP -@subsection Agent and IMAP - -The Agent works with any Gnus back end, including nnimap. However, -since there are some conceptual differences between @acronym{NNTP} and -@acronym{IMAP}, this section (should) provide you with some information to -make Gnus Agent work smoother as a @acronym{IMAP} Disconnected Mode client. - -The first thing to keep in mind is that all flags (read, ticked, etc) -are kept on the @acronym{IMAP} server, rather than in @file{.newsrc} as is the -case for nntp. Thus Gnus need to remember flag changes when -disconnected, and synchronize these flags when you plug back in. - -Gnus keeps track of flag changes when reading nnimap groups under the -Agent. When you plug back in, Gnus will check if you have any changed -any flags and ask if you wish to synchronize these with the server. -The behavior is customizable by @code{gnus-agent-synchronize-flags}. - -@vindex gnus-agent-synchronize-flags -If @code{gnus-agent-synchronize-flags} is @code{nil}, the Agent will -never automatically synchronize flags. If it is @code{ask}, which is -the default, the Agent will check if you made any changes and if so -ask if you wish to synchronize these when you re-connect. If it has -any other value, all flags will be synchronized automatically. - -If you do not wish to synchronize flags automatically when you -re-connect, you can do it manually with the -@code{gnus-agent-synchronize-flags} command that is bound to @kbd{J Y} -in the group buffer. - -Some things are currently not implemented in the Agent that you'd might -expect from a disconnected @acronym{IMAP} client, including: - -@itemize @bullet - -@item -Copying/moving articles into nnimap groups when unplugged. - -@item -Creating/deleting nnimap groups when unplugged. - -@end itemize - -Technical note: the synchronization algorithm does not work by ``pushing'' -all local flags to the server, but rather incrementally update the -server view of flags by changing only those flags that were changed by -the user. Thus, if you set one flag on an article, quit the group and -re-select the group and remove the flag; the flag will be set and -removed from the server when you ``synchronize''. The queued flag -operations can be found in the per-server @code{flags} file in the Agent -directory. It's emptied when you synchronize flags. - - -@node Outgoing Messages -@subsection Outgoing Messages - -When Gnus is unplugged, all outgoing messages (both mail and news) are -stored in the draft group ``queue'' (@pxref{Drafts}). You can view -them there after posting, and edit them at will. - -When Gnus is plugged again, you can send the messages either from the -draft group with the special commands available there, or you can use -the @kbd{J S} command in the group buffer to send all the sendable -messages in the draft group. - - - -@node Agent Variables -@subsection Agent Variables - -@table @code -@item gnus-agent-directory -@vindex gnus-agent-directory -Where the Gnus Agent will store its files. The default is -@file{~/News/agent/}. - -@item gnus-agent-handle-level -@vindex gnus-agent-handle-level -Groups on levels (@pxref{Group Levels}) higher than this variable will -be ignored by the Agent. The default is @code{gnus-level-subscribed}, -which means that only subscribed group will be considered by the Agent -by default. - -@item gnus-agent-plugged-hook -@vindex gnus-agent-plugged-hook -Hook run when connecting to the network. - -@item gnus-agent-unplugged-hook -@vindex gnus-agent-unplugged-hook -Hook run when disconnecting from the network. - -@item gnus-agent-fetched-hook -@vindex gnus-agent-fetched-hook -Hook run when finished fetching articles. - -@item gnus-agent-cache -@vindex gnus-agent-cache -Variable to control whether use the locally stored @acronym{NOV} and -articles when plugged, e.g. essentially using the Agent as a cache. -The default is non-@code{nil}, which means to use the Agent as a cache. - -@item gnus-agent-go-online -@vindex gnus-agent-go-online -If @code{gnus-agent-go-online} is @code{nil}, the Agent will never -automatically switch offline servers into online status. If it is -@code{ask}, the default, the Agent will ask if you wish to switch -offline servers into online status when you re-connect. If it has any -other value, all offline servers will be automatically switched into -online status. - -@item gnus-agent-mark-unread-after-downloaded -@vindex gnus-agent-mark-unread-after-downloaded -If @code{gnus-agent-mark-unread-after-downloaded} is non-@code{nil}, -mark articles as unread after downloading. This is usually a safe -thing to do as the newly downloaded article has obviously not been -read. The default is @code{t}. - -@item gnus-agent-consider-all-articles -@vindex gnus-agent-consider-all-articles -If @code{gnus-agent-consider-all-articles} is non-@code{nil}, the -agent will let the agent predicate decide whether articles need to be -downloaded or not, for all articles. When @code{nil}, the default, -the agent will only let the predicate decide whether unread articles -are downloaded or not. If you enable this, you may also want to look -into the agent expiry settings (@pxref{Category Variables}), so that -the agent doesn't download articles which the agent will later expire, -over and over again. - -@item gnus-agent-max-fetch-size -@vindex gnus-agent-max-fetch-size -The agent fetches articles into a temporary buffer prior to parsing -them into individual files. To avoid exceeding the max. buffer size, -the agent alternates between fetching and parsing until all articles -have been fetched. @code{gnus-agent-max-fetch-size} provides a size -limit to control how often the cycling occurs. A large value improves -performance. A small value minimizes the time lost should the -connection be lost while fetching (You may need to run -@code{gnus-agent-regenerate-group} to update the group's state. -However, all articles parsed prior to loosing the connection will be -available while unplugged). The default is 10M so it is unusual to -see any cycling. - -@item gnus-server-unopen-status -@vindex gnus-server-unopen-status -Perhaps not an Agent variable, but closely related to the Agent, this -variable says what will happen if Gnus cannot open a server. If the -Agent is enabled, the default, @code{nil}, makes Gnus ask the user -whether to deny the server or whether to unplug the agent. If the -Agent is disabled, Gnus always simply deny the server. Other choices -for this variable include @code{denied} and @code{offline} the latter -is only valid if the Agent is used. - -@item gnus-auto-goto-ignores -@vindex gnus-auto-goto-ignores -Another variable that isn't an Agent variable, yet so closely related -that most will look for it here, this variable tells the summary -buffer how to maneuver around undownloaded (only headers stored in the -agent) and unfetched (neither article nor headers stored) articles. - -The valid values are @code{nil} (maneuver to any article), -@code{undownloaded} (maneuvering while unplugged ignores articles that -have not been fetched), @code{always-undownloaded} (maneuvering always -ignores articles that have not been fetched), @code{unfetched} -(maneuvering ignores articles whose headers have not been fetched). - -@item gnus-agent-auto-agentize-methods -@vindex gnus-agent-auto-agentize-methods -If you have never used the Agent before (or more technically, if -@file{~/News/agent/lib/servers} does not exist), Gnus will -automatically agentize a few servers for you. This variable control -which backends should be auto-agentized. It is typically only useful -to agentize remote backends. The auto-agentizing has the same effect -as running @kbd{J a} on the servers (@pxref{Server Agent Commands}). -If the file exist, you must manage the servers manually by adding or -removing them, this variable is only applicable the first time you -start Gnus. The default is @samp{(nntp nnimap)}. - -@end table - - -@node Example Setup -@subsection Example Setup - -If you don't want to read this manual, and you have a fairly standard -setup, you may be able to use something like the following as your -@file{~/.gnus.el} file to get started. - -@lisp -;; @r{Define how Gnus is to fetch news. We do this over @acronym{NNTP}} -;; @r{from your ISP's server.} -(setq gnus-select-method '(nntp "news.your-isp.com")) - -;; @r{Define how Gnus is to read your mail. We read mail from} -;; @r{your ISP's @acronym{POP} server.} -(setq mail-sources '((pop :server "pop.your-isp.com"))) - -;; @r{Say how Gnus is to store the mail. We use nnml groups.} -(setq gnus-secondary-select-methods '((nnml ""))) - -;; @r{Make Gnus into an offline newsreader.} -;; (gnus-agentize) ; @r{The obsolete setting.} -;; (setq gnus-agent t) ; @r{Now the default.} -@end lisp - -That should be it, basically. Put that in your @file{~/.gnus.el} file, -edit to suit your needs, start up PPP (or whatever), and type @kbd{M-x -gnus}. - -If this is the first time you've run Gnus, you will be subscribed -automatically to a few default newsgroups. You'll probably want to -subscribe to more groups, and to do that, you have to query the -@acronym{NNTP} server for a complete list of groups with the @kbd{A A} -command. This usually takes quite a while, but you only have to do it -once. - -After reading and parsing a while, you'll be presented with a list of -groups. Subscribe to the ones you want to read with the @kbd{u} -command. @kbd{l} to make all the killed groups disappear after you've -subscribe to all the groups you want to read. (@kbd{A k} will bring -back all the killed groups.) - -You can now read the groups at once, or you can download the articles -with the @kbd{J s} command. And then read the rest of this manual to -find out which of the other gazillion things you want to customize. - - -@node Batching Agents -@subsection Batching Agents -@findex gnus-agent-batch - -Having the Gnus Agent fetch articles (and post whatever messages you've -written) is quite easy once you've gotten things set up properly. The -following shell script will do everything that is necessary: - -You can run a complete batch command from the command line with the -following incantation: - -@example -#!/bin/sh -emacs -batch -l ~/.emacs -l ~/.gnus.el -f gnus-agent-batch >/dev/null 2>&1 -@end example - - -@node Agent Caveats -@subsection Agent Caveats - -The Gnus Agent doesn't seem to work like most other offline -newsreaders. Here are some common questions that some imaginary people -may ask: - -@table @dfn -@item If I read an article while plugged, do they get entered into the Agent? - -@strong{No}. If you want this behavior, add -@code{gnus-agent-fetch-selected-article} to -@code{gnus-select-article-hook}. - -@item If I read an article while plugged, and the article already exists in -the Agent, will it get downloaded once more? - -@strong{No}, unless @code{gnus-agent-cache} is @code{nil}. - -@end table - -In short, when Gnus is unplugged, it only looks into the locally stored -articles; when it's plugged, it talks to your ISP and may also use the -locally stored articles. - - -@node Scoring -@chapter Scoring -@cindex scoring - -Other people use @dfn{kill files}, but we here at Gnus Towers like -scoring better than killing, so we'd rather switch than fight. They do -something completely different as well, so sit up straight and pay -attention! - -@vindex gnus-summary-mark-below -All articles have a default score (@code{gnus-summary-default-score}), -which is 0 by default. This score may be raised or lowered either -interactively or by score files. Articles that have a score lower than -@code{gnus-summary-mark-below} are marked as read. - -Gnus will read any @dfn{score files} that apply to the current group -before generating the summary buffer. - -There are several commands in the summary buffer that insert score -entries based on the current article. You can, for instance, ask Gnus to -lower or increase the score of all articles with a certain subject. - -There are two sorts of scoring entries: Permanent and temporary. -Temporary score entries are self-expiring entries. Any entries that are -temporary and have not been used for, say, a week, will be removed -silently to help keep the sizes of the score files down. - -@menu -* Summary Score Commands:: Adding score entries for the current group. -* Group Score Commands:: General score commands. -* Score Variables:: Customize your scoring. (My, what terminology). -* Score File Format:: What a score file may contain. -* Score File Editing:: You can edit score files by hand as well. -* Adaptive Scoring:: Big Sister Gnus knows what you read. -* Home Score File:: How to say where new score entries are to go. -* Followups To Yourself:: Having Gnus notice when people answer you. -* Scoring On Other Headers:: Scoring on non-standard headers. -* Scoring Tips:: How to score effectively. -* Reverse Scoring:: That problem child of old is not problem. -* Global Score Files:: Earth-spanning, ear-splitting score files. -* Kill Files:: They are still here, but they can be ignored. -* Converting Kill Files:: Translating kill files to score files. -* GroupLens:: Getting predictions on what you like to read. -* Advanced Scoring:: Using logical expressions to build score rules. -* Score Decays:: It can be useful to let scores wither away. -@end menu - - -@node Summary Score Commands -@section Summary Score Commands -@cindex score commands - -The score commands that alter score entries do not actually modify real -score files. That would be too inefficient. Gnus maintains a cache of -previously loaded score files, one of which is considered the -@dfn{current score file alist}. The score commands simply insert -entries into this list, and upon group exit, this list is saved. - -The current score file is by default the group's local score file, even -if no such score file actually exists. To insert score commands into -some other score file (e.g. @file{all.SCORE}), you must first make this -score file the current one. - -General score commands that don't actually change the score file: - -@table @kbd - -@item V s -@kindex V s (Summary) -@findex gnus-summary-set-score -Set the score of the current article (@code{gnus-summary-set-score}). - -@item V S -@kindex V S (Summary) -@findex gnus-summary-current-score -Display the score of the current article -(@code{gnus-summary-current-score}). - -@item V t -@kindex V t (Summary) -@findex gnus-score-find-trace -Display all score rules that have been used on the current article -(@code{gnus-score-find-trace}). In the @code{*Score Trace*} buffer, you -may type @kbd{e} to edit score file corresponding to the score rule on -current line and @kbd{f} to format (@code{gnus-score-pretty-print}) the -score file and edit it. - -@item V w -@kindex V w (Summary) -@findex gnus-score-find-favourite-words -List words used in scoring (@code{gnus-score-find-favourite-words}). - -@item V R -@kindex V R (Summary) -@findex gnus-summary-rescore -Run the current summary through the scoring process -(@code{gnus-summary-rescore}). This might be useful if you're playing -around with your score files behind Gnus' back and want to see the -effect you're having. - -@item V c -@kindex V c (Summary) -@findex gnus-score-change-score-file -Make a different score file the current -(@code{gnus-score-change-score-file}). - -@item V e -@kindex V e (Summary) -@findex gnus-score-edit-current-scores -Edit the current score file (@code{gnus-score-edit-current-scores}). -You will be popped into a @code{gnus-score-mode} buffer (@pxref{Score -File Editing}). - -@item V f -@kindex V f (Summary) -@findex gnus-score-edit-file -Edit a score file and make this score file the current one -(@code{gnus-score-edit-file}). - -@item V F -@kindex V F (Summary) -@findex gnus-score-flush-cache -Flush the score cache (@code{gnus-score-flush-cache}). This is useful -after editing score files. - -@item V C -@kindex V C (Summary) -@findex gnus-score-customize -Customize a score file in a visually pleasing manner -(@code{gnus-score-customize}). - -@end table - -The rest of these commands modify the local score file. - -@table @kbd - -@item V m -@kindex V m (Summary) -@findex gnus-score-set-mark-below -Prompt for a score, and mark all articles with a score below this as -read (@code{gnus-score-set-mark-below}). - -@item V x -@kindex V x (Summary) -@findex gnus-score-set-expunge-below -Prompt for a score, and add a score rule to the current score file to -expunge all articles below this score -(@code{gnus-score-set-expunge-below}). -@end table - -The keystrokes for actually making score entries follow a very regular -pattern, so there's no need to list all the commands. (Hundreds of -them.) - -@findex gnus-summary-increase-score -@findex gnus-summary-lower-score - -@enumerate -@item -The first key is either @kbd{I} (upper case i) for increasing the score -or @kbd{L} for lowering the score. -@item -The second key says what header you want to score on. The following -keys are available: -@table @kbd - -@item a -Score on the author name. - -@item s -Score on the subject line. - -@item x -Score on the @code{Xref} line---i.e., the cross-posting line. - -@item r -Score on the @code{References} line. - -@item d -Score on the date. - -@item l -Score on the number of lines. - -@item i -Score on the @code{Message-ID} header. - -@item e -Score on an ``extra'' header, that is, one of those in gnus-extra-headers, -if your @acronym{NNTP} server tracks additional header data in overviews. - -@item f -Score on followups---this matches the author name, and adds scores to -the followups to this author. (Using this key leads to the creation of -@file{ADAPT} files.) - -@item b -Score on the body. - -@item h -Score on the head. - -@item t -Score on thread. (Using this key leads to the creation of @file{ADAPT} -files.) - -@end table - -@item -The third key is the match type. Which match types are valid depends on -what headers you are scoring on. - -@table @code - -@item strings - -@table @kbd - -@item e -Exact matching. - -@item s -Substring matching. - -@item f -Fuzzy matching (@pxref{Fuzzy Matching}). - -@item r -Regexp matching -@end table - -@item date -@table @kbd - -@item b -Before date. - -@item a -After date. - -@item n -This date. -@end table - -@item number -@table @kbd - -@item < -Less than number. - -@item = -Equal to number. - -@item > -Greater than number. -@end table -@end table - -@item -The fourth and usually final key says whether this is a temporary (i.e., -expiring) score entry, or a permanent (i.e., non-expiring) score entry, -or whether it is to be done immediately, without adding to the score -file. -@table @kbd - -@item t -Temporary score entry. - -@item p -Permanent score entry. - -@item i -Immediately scoring. -@end table - -@item -If you are scoring on `e' (extra) headers, you will then be prompted for -the header name on which you wish to score. This must be a header named -in gnus-extra-headers, and @samp{TAB} completion is available. - -@end enumerate - -So, let's say you want to increase the score on the current author with -exact matching permanently: @kbd{I a e p}. If you want to lower the -score based on the subject line, using substring matching, and make a -temporary score entry: @kbd{L s s t}. Pretty easy. - -To make things a bit more complicated, there are shortcuts. If you use -a capital letter on either the second or third keys, Gnus will use -defaults for the remaining one or two keystrokes. The defaults are -``substring'' and ``temporary''. So @kbd{I A} is the same as @kbd{I a s -t}, and @kbd{I a R} is the same as @kbd{I a r t}. - -These functions take both the numerical prefix and the symbolic prefix -(@pxref{Symbolic Prefixes}). A numerical prefix says how much to lower -(or increase) the score of the article. A symbolic prefix of @code{a} -says to use the @file{all.SCORE} file for the command instead of the -current score file. - -@vindex gnus-score-mimic-keymap -The @code{gnus-score-mimic-keymap} says whether these commands will -pretend they are keymaps or not. - - -@node Group Score Commands -@section Group Score Commands -@cindex group score commands - -There aren't many of these as yet, I'm afraid. - -@table @kbd - -@item W f -@kindex W f (Group) -@findex gnus-score-flush-cache -Gnus maintains a cache of score alists to avoid having to reload them -all the time. This command will flush the cache -(@code{gnus-score-flush-cache}). - -@end table - -You can do scoring from the command line by saying something like: - -@findex gnus-batch-score -@cindex batch scoring -@example -$ emacs -batch -l ~/.emacs -l ~/.gnus.el -f gnus-batch-score -@end example - - -@node Score Variables -@section Score Variables -@cindex score variables - -@table @code - -@item gnus-use-scoring -@vindex gnus-use-scoring -If @code{nil}, Gnus will not check for score files, and will not, in -general, do any score-related work. This is @code{t} by default. - -@item gnus-kill-killed -@vindex gnus-kill-killed -If this variable is @code{nil}, Gnus will never apply score files to -articles that have already been through the kill process. While this -may save you lots of time, it also means that if you apply a kill file -to a group, and then change the kill file and want to run it over you -group again to kill more articles, it won't work. You have to set this -variable to @code{t} to do that. (It is @code{t} by default.) - -@item gnus-kill-files-directory -@vindex gnus-kill-files-directory -All kill and score files will be stored in this directory, which is -initialized from the @env{SAVEDIR} environment variable by default. -This is @file{~/News/} by default. - -@item gnus-score-file-suffix -@vindex gnus-score-file-suffix -Suffix to add to the group name to arrive at the score file name -(@file{SCORE} by default.) - -@item gnus-score-uncacheable-files -@vindex gnus-score-uncacheable-files -@cindex score cache -All score files are normally cached to avoid excessive re-loading of -score files. However, if this might make your Emacs grow big and -bloated, so this regexp can be used to weed out score files unlikely -to be needed again. It would be a bad idea to deny caching of -@file{all.SCORE}, while it might be a good idea to not cache -@file{comp.infosystems.www.authoring.misc.ADAPT}. In fact, this -variable is @samp{ADAPT$} by default, so no adaptive score files will -be cached. - -@item gnus-save-score -@vindex gnus-save-score -If you have really complicated score files, and do lots of batch -scoring, then you might set this variable to @code{t}. This will make -Gnus save the scores into the @file{.newsrc.eld} file. - -If you do not set this to @code{t}, then manual scores (like those set -with @kbd{V s} (@code{gnus-summary-set-score})) will not be preserved -across group visits. - -@item gnus-score-interactive-default-score -@vindex gnus-score-interactive-default-score -Score used by all the interactive raise/lower commands to raise/lower -score with. Default is 1000, which may seem excessive, but this is to -ensure that the adaptive scoring scheme gets enough room to play with. -We don't want the small changes from the adaptive scoring to overwrite -manually entered data. - -@item gnus-summary-default-score -@vindex gnus-summary-default-score -Default score of an article, which is 0 by default. - -@item gnus-summary-expunge-below -@vindex gnus-summary-expunge-below -Don't display the summary lines of articles that have scores lower than -this variable. This is @code{nil} by default, which means that no -articles will be hidden. This variable is local to the summary buffers, -and has to be set from @code{gnus-summary-mode-hook}. - -@item gnus-score-over-mark -@vindex gnus-score-over-mark -Mark (in the third column) used for articles with a score over the -default. Default is @samp{+}. - -@item gnus-score-below-mark -@vindex gnus-score-below-mark -Mark (in the third column) used for articles with a score below the -default. Default is @samp{-}. - -@item gnus-score-find-score-files-function -@vindex gnus-score-find-score-files-function -Function used to find score files for the current group. This function -is called with the name of the group as the argument. - -Predefined functions available are: -@table @code - -@item gnus-score-find-single -@findex gnus-score-find-single -Only apply the group's own score file. - -@item gnus-score-find-bnews -@findex gnus-score-find-bnews -Apply all score files that match, using bnews syntax. This is the -default. If the current group is @samp{gnu.emacs.gnus}, for instance, -@file{all.emacs.all.SCORE}, @file{not.alt.all.SCORE} and -@file{gnu.all.SCORE} would all apply. In short, the instances of -@samp{all} in the score file names are translated into @samp{.*}, and -then a regexp match is done. - -This means that if you have some score entries that you want to apply to -all groups, then you put those entries in the @file{all.SCORE} file. - -The score files are applied in a semi-random order, although Gnus will -try to apply the more general score files before the more specific score -files. It does this by looking at the number of elements in the score -file names---discarding the @samp{all} elements. - -@item gnus-score-find-hierarchical -@findex gnus-score-find-hierarchical -Apply all score files from all the parent groups. This means that you -can't have score files like @file{all.SCORE}, but you can have -@file{SCORE}, @file{comp.SCORE} and @file{comp.emacs.SCORE} for each -server. - -@end table -This variable can also be a list of functions. In that case, all -these functions will be called with the group name as argument, and -all the returned lists of score files will be applied. These -functions can also return lists of lists of score alists directly. In -that case, the functions that return these non-file score alists -should probably be placed before the ``real'' score file functions, to -ensure that the last score file returned is the local score file. -Phu. - -For example, to do hierarchical scoring but use a non-server-specific -overall score file, you could use the value -@example -(list (lambda (group) ("all.SCORE")) - 'gnus-score-find-hierarchical) -@end example - -@item gnus-score-expiry-days -@vindex gnus-score-expiry-days -This variable says how many days should pass before an unused score file -entry is expired. If this variable is @code{nil}, no score file entries -are expired. It's 7 by default. - -@item gnus-update-score-entry-dates -@vindex gnus-update-score-entry-dates -If this variable is non-@code{nil}, temporary score entries that have -been triggered (matched) will have their dates updated. (This is how Gnus -controls expiry---all non-matched-entries will become too old while -matched entries will stay fresh and young.) However, if you set this -variable to @code{nil}, even matched entries will grow old and will -have to face that oh-so grim reaper. - -@item gnus-score-after-write-file-function -@vindex gnus-score-after-write-file-function -Function called with the name of the score file just written. - -@item gnus-score-thread-simplify -@vindex gnus-score-thread-simplify -If this variable is non-@code{nil}, article subjects will be -simplified for subject scoring purposes in the same manner as with -threading---according to the current value of -@code{gnus-simplify-subject-functions}. If the scoring entry uses -@code{substring} or @code{exact} matching, the match will also be -simplified in this manner. - -@end table - - -@node Score File Format -@section Score File Format -@cindex score file format - -A score file is an @code{emacs-lisp} file that normally contains just a -single form. Casual users are not expected to edit these files; -everything can be changed from the summary buffer. - -Anyway, if you'd like to dig into it yourself, here's an example: - -@lisp -(("from" - ("Lars Ingebrigtsen" -10000) - ("Per Abrahamsen") - ("larsi\\|lmi" -50000 nil R)) - ("subject" - ("Ding is Badd" nil 728373)) - ("xref" - ("alt.politics" -1000 728372 s)) - ("lines" - (2 -100 nil <)) - (mark 0) - (expunge -1000) - (mark-and-expunge -10) - (read-only nil) - (orphan -10) - (adapt t) - (files "/hom/larsi/News/gnu.SCORE") - (exclude-files "all.SCORE") - (local (gnus-newsgroup-auto-expire t) - (gnus-summary-make-false-root empty)) - (eval (ding))) -@end lisp - -This example demonstrates most score file elements. @xref{Advanced -Scoring}, for a different approach. - -Even though this looks much like Lisp code, nothing here is actually -@code{eval}ed. The Lisp reader is used to read this form, though, so it -has to be valid syntactically, if not semantically. - -Six keys are supported by this alist: - -@table @code - -@item STRING -If the key is a string, it is the name of the header to perform the -match on. Scoring can only be performed on these eight headers: -@code{From}, @code{Subject}, @code{References}, @code{Message-ID}, -@code{Xref}, @code{Lines}, @code{Chars} and @code{Date}. In addition to -these headers, there are three strings to tell Gnus to fetch the entire -article and do the match on larger parts of the article: @code{Body} -will perform the match on the body of the article, @code{Head} will -perform the match on the head of the article, and @code{All} will -perform the match on the entire article. Note that using any of these -last three keys will slow down group entry @emph{considerably}. The -final ``header'' you can score on is @code{Followup}. These score -entries will result in new score entries being added for all follow-ups -to articles that matches these score entries. - -Following this key is an arbitrary number of score entries, where each -score entry has one to four elements. -@enumerate - -@item -The first element is the @dfn{match element}. On most headers this will -be a string, but on the Lines and Chars headers, this must be an -integer. - -@item -If the second element is present, it should be a number---the @dfn{score -element}. This number should be an integer in the neginf to posinf -interval. This number is added to the score of the article if the match -is successful. If this element is not present, the -@code{gnus-score-interactive-default-score} number will be used -instead. This is 1000 by default. - -@item -If the third element is present, it should be a number---the @dfn{date -element}. This date says when the last time this score entry matched, -which provides a mechanism for expiring the score entries. It this -element is not present, the score entry is permanent. The date is -represented by the number of days since December 31, 1 BCE. - -@item -If the fourth element is present, it should be a symbol---the @dfn{type -element}. This element specifies what function should be used to see -whether this score entry matches the article. What match types that can -be used depends on what header you wish to perform the match on. -@table @dfn - -@item From, Subject, References, Xref, Message-ID -For most header types, there are the @code{r} and @code{R} (regexp), as -well as @code{s} and @code{S} (substring) types, and @code{e} and -@code{E} (exact match), and @code{w} (word match) types. If this -element is not present, Gnus will assume that substring matching should -be used. @code{R}, @code{S}, and @code{E} differ from the others in -that the matches will be done in a case-sensitive manner. All these -one-letter types are really just abbreviations for the @code{regexp}, -@code{string}, @code{exact}, and @code{word} types, which you can use -instead, if you feel like. - -@item Extra -Just as for the standard string overview headers, if you are using -gnus-extra-headers, you can score on these headers' values. In this -case, there is a 5th element in the score entry, being the name of the -header to be scored. The following entry is useful in your -@file{all.SCORE} file in case of spam attacks from a single origin -host, if your @acronym{NNTP} server tracks @samp{NNTP-Posting-Host} in -overviews: - -@lisp -("111.222.333.444" -1000 nil s - "NNTP-Posting-Host") -@end lisp - -@item Lines, Chars -These two headers use different match types: @code{<}, @code{>}, -@code{=}, @code{>=} and @code{<=}. - -These predicates are true if - -@example -(PREDICATE HEADER MATCH) -@end example - -evaluates to non-@code{nil}. For instance, the advanced match -@code{("lines" 4 <)} (@pxref{Advanced Scoring}) will result in the -following form: - -@lisp -(< header-value 4) -@end lisp - -Or to put it another way: When using @code{<} on @code{Lines} with 4 as -the match, we get the score added if the article has less than 4 lines. -(It's easy to get confused and think it's the other way around. But -it's not. I think.) - -When matching on @code{Lines}, be careful because some back ends (like -@code{nndir}) do not generate @code{Lines} header, so every article ends -up being marked as having 0 lines. This can lead to strange results if -you happen to lower score of the articles with few lines. - -@item Date -For the Date header we have three kinda silly match types: -@code{before}, @code{at} and @code{after}. I can't really imagine this -ever being useful, but, like, it would feel kinda silly not to provide -this function. Just in case. You never know. Better safe than sorry. -Once burnt, twice shy. Don't judge a book by its cover. Never not have -sex on a first date. (I have been told that at least one person, and I -quote, ``found this function indispensable'', however.) - -@cindex ISO8601 -@cindex date -A more useful match type is @code{regexp}. With it, you can match the -date string using a regular expression. The date is normalized to -ISO8601 compact format first---@var{YYYYMMDD}@code{T}@var{HHMMSS}. If -you want to match all articles that have been posted on April 1st in -every year, you could use @samp{....0401.........} as a match string, -for instance. (Note that the date is kept in its original time zone, so -this will match articles that were posted when it was April 1st where -the article was posted from. Time zones are such wholesome fun for the -whole family, eh?) - -@item Head, Body, All -These three match keys use the same match types as the @code{From} (etc) -header uses. - -@item Followup -This match key is somewhat special, in that it will match the -@code{From} header, and affect the score of not only the matching -articles, but also all followups to the matching articles. This allows -you e.g. increase the score of followups to your own articles, or -decrease the score of followups to the articles of some known -trouble-maker. Uses the same match types as the @code{From} header -uses. (Using this match key will lead to creation of @file{ADAPT} -files.) - -@item Thread -This match key works along the same lines as the @code{Followup} match -key. If you say that you want to score on a (sub-)thread started by an -article with a @code{Message-ID} @var{x}, then you add a @samp{thread} -match. This will add a new @samp{thread} match for each article that -has @var{x} in its @code{References} header. (These new @samp{thread} -matches will use the @code{Message-ID}s of these matching articles.) -This will ensure that you can raise/lower the score of an entire thread, -even though some articles in the thread may not have complete -@code{References} headers. Note that using this may lead to -undeterministic scores of the articles in the thread. (Using this match -key will lead to creation of @file{ADAPT} files.) -@end table -@end enumerate - -@cindex score file atoms -@item mark -The value of this entry should be a number. Any articles with a score -lower than this number will be marked as read. - -@item expunge -The value of this entry should be a number. Any articles with a score -lower than this number will be removed from the summary buffer. - -@item mark-and-expunge -The value of this entry should be a number. Any articles with a score -lower than this number will be marked as read and removed from the -summary buffer. - -@item thread-mark-and-expunge -The value of this entry should be a number. All articles that belong to -a thread that has a total score below this number will be marked as read -and removed from the summary buffer. @code{gnus-thread-score-function} -says how to compute the total score for a thread. - -@item files -The value of this entry should be any number of file names. These files -are assumed to be score files as well, and will be loaded the same way -this one was. - -@item exclude-files -The clue of this entry should be any number of files. These files will -not be loaded, even though they would normally be so, for some reason or -other. - -@item eval -The value of this entry will be @code{eval}el. This element will be -ignored when handling global score files. - -@item read-only -Read-only score files will not be updated or saved. Global score files -should feature this atom (@pxref{Global Score Files}). (Note: -@dfn{Global} here really means @dfn{global}; not your personal -apply-to-all-groups score files.) - -@item orphan -The value of this entry should be a number. Articles that do not have -parents will get this number added to their scores. Imagine you follow -some high-volume newsgroup, like @samp{comp.lang.c}. Most likely you -will only follow a few of the threads, also want to see any new threads. - -You can do this with the following two score file entries: - -@example - (orphan -500) - (mark-and-expunge -100) -@end example - -When you enter the group the first time, you will only see the new -threads. You then raise the score of the threads that you find -interesting (with @kbd{I T} or @kbd{I S}), and ignore (@kbd{C y}) the -rest. Next time you enter the group, you will see new articles in the -interesting threads, plus any new threads. - -I.e.---the orphan score atom is for high-volume groups where a few -interesting threads which can't be found automatically by ordinary -scoring rules exist. - -@item adapt -This entry controls the adaptive scoring. If it is @code{t}, the -default adaptive scoring rules will be used. If it is @code{ignore}, no -adaptive scoring will be performed on this group. If it is a list, this -list will be used as the adaptive scoring rules. If it isn't present, -or is something other than @code{t} or @code{ignore}, the default -adaptive scoring rules will be used. If you want to use adaptive -scoring on most groups, you'd set @code{gnus-use-adaptive-scoring} to -@code{t}, and insert an @code{(adapt ignore)} in the groups where you do -not want adaptive scoring. If you only want adaptive scoring in a few -groups, you'd set @code{gnus-use-adaptive-scoring} to @code{nil}, and -insert @code{(adapt t)} in the score files of the groups where you want -it. - -@item adapt-file -All adaptive score entries will go to the file named by this entry. It -will also be applied when entering the group. This atom might be handy -if you want to adapt on several groups at once, using the same adaptive -file for a number of groups. - -@item local -@cindex local variables -The value of this entry should be a list of @code{(@var{var} -@var{value})} pairs. Each @var{var} will be made buffer-local to the -current summary buffer, and set to the value specified. This is a -convenient, if somewhat strange, way of setting variables in some -groups if you don't like hooks much. Note that the @var{value} won't -be evaluated. -@end table - - -@node Score File Editing -@section Score File Editing - -You normally enter all scoring commands from the summary buffer, but you -might feel the urge to edit them by hand as well, so we've supplied you -with a mode for that. - -It's simply a slightly customized @code{emacs-lisp} mode, with these -additional commands: - -@table @kbd - -@item C-c C-c -@kindex C-c C-c (Score) -@findex gnus-score-edit-done -Save the changes you have made and return to the summary buffer -(@code{gnus-score-edit-done}). - -@item C-c C-d -@kindex C-c C-d (Score) -@findex gnus-score-edit-insert-date -Insert the current date in numerical format -(@code{gnus-score-edit-insert-date}). This is really the day number, if -you were wondering. - -@item C-c C-p -@kindex C-c C-p (Score) -@findex gnus-score-pretty-print -The adaptive score files are saved in an unformatted fashion. If you -intend to read one of these files, you want to @dfn{pretty print} it -first. This command (@code{gnus-score-pretty-print}) does that for -you. - -@end table - -Type @kbd{M-x gnus-score-mode} to use this mode. - -@vindex gnus-score-mode-hook -@code{gnus-score-menu-hook} is run in score mode buffers. - -In the summary buffer you can use commands like @kbd{V f}, @kbd{V e} and -@kbd{V t} to begin editing score files. - - -@node Adaptive Scoring -@section Adaptive Scoring -@cindex adaptive scoring - -If all this scoring is getting you down, Gnus has a way of making it all -happen automatically---as if by magic. Or rather, as if by artificial -stupidity, to be precise. - -@vindex gnus-use-adaptive-scoring -When you read an article, or mark an article as read, or kill an -article, you leave marks behind. On exit from the group, Gnus can sniff -these marks and add score elements depending on what marks it finds. -You turn on this ability by setting @code{gnus-use-adaptive-scoring} to -@code{t} or @code{(line)}. If you want score adaptively on separate -words appearing in the subjects, you should set this variable to -@code{(word)}. If you want to use both adaptive methods, set this -variable to @code{(word line)}. - -@vindex gnus-default-adaptive-score-alist -To give you complete control over the scoring process, you can customize -the @code{gnus-default-adaptive-score-alist} variable. For instance, it -might look something like this: - -@lisp -(setq gnus-default-adaptive-score-alist - '((gnus-unread-mark) - (gnus-ticked-mark (from 4)) - (gnus-dormant-mark (from 5)) - (gnus-del-mark (from -4) (subject -1)) - (gnus-read-mark (from 4) (subject 2)) - (gnus-expirable-mark (from -1) (subject -1)) - (gnus-killed-mark (from -1) (subject -3)) - (gnus-kill-file-mark) - (gnus-ancient-mark) - (gnus-low-score-mark) - (gnus-catchup-mark (from -1) (subject -1)))) -@end lisp - -As you see, each element in this alist has a mark as a key (either a -variable name or a ``real'' mark---a character). Following this key is -a arbitrary number of header/score pairs. If there are no header/score -pairs following the key, no adaptive scoring will be done on articles -that have that key as the article mark. For instance, articles with -@code{gnus-unread-mark} in the example above will not get adaptive score -entries. - -Each article can have only one mark, so just a single of these rules -will be applied to each article. - -To take @code{gnus-del-mark} as an example---this alist says that all -articles that have that mark (i.e., are marked with @samp{e}) will have a -score entry added to lower based on the @code{From} header by -4, and -lowered by @code{Subject} by -1. Change this to fit your prejudices. - -If you have marked 10 articles with the same subject with -@code{gnus-del-mark}, the rule for that mark will be applied ten times. -That means that that subject will get a score of ten times -1, which -should be, unless I'm much mistaken, -10. - -If you have auto-expirable (mail) groups (@pxref{Expiring Mail}), all -the read articles will be marked with the @samp{E} mark. This'll -probably make adaptive scoring slightly impossible, so auto-expiring and -adaptive scoring doesn't really mix very well. - -The headers you can score on are @code{from}, @code{subject}, -@code{message-id}, @code{references}, @code{xref}, @code{lines}, -@code{chars} and @code{date}. In addition, you can score on -@code{followup}, which will create an adaptive score entry that matches -on the @code{References} header using the @code{Message-ID} of the -current article, thereby matching the following thread. - -If you use this scheme, you should set the score file atom @code{mark} -to something small---like -300, perhaps, to avoid having small random -changes result in articles getting marked as read. - -After using adaptive scoring for a week or so, Gnus should start to -become properly trained and enhance the authors you like best, and kill -the authors you like least, without you having to say so explicitly. - -You can control what groups the adaptive scoring is to be performed on -by using the score files (@pxref{Score File Format}). This will also -let you use different rules in different groups. - -@vindex gnus-adaptive-file-suffix -The adaptive score entries will be put into a file where the name is the -group name with @code{gnus-adaptive-file-suffix} appended. The default -is @file{ADAPT}. - -@vindex gnus-score-exact-adapt-limit -When doing adaptive scoring, substring or fuzzy matching would probably -give you the best results in most cases. However, if the header one -matches is short, the possibility for false positives is great, so if -the length of the match is less than -@code{gnus-score-exact-adapt-limit}, exact matching will be used. If -this variable is @code{nil}, exact matching will always be used to avoid -this problem. - -@vindex gnus-default-adaptive-word-score-alist -As mentioned above, you can adapt either on individual words or entire -headers. If you adapt on words, the -@code{gnus-default-adaptive-word-score-alist} variable says what score -each instance of a word should add given a mark. - -@lisp -(setq gnus-default-adaptive-word-score-alist - `((,gnus-read-mark . 30) - (,gnus-catchup-mark . -10) - (,gnus-killed-mark . -20) - (,gnus-del-mark . -15))) -@end lisp - -This is the default value. If you have adaption on words enabled, every -word that appears in subjects of articles marked with -@code{gnus-read-mark} will result in a score rule that increase the -score with 30 points. - -@vindex gnus-default-ignored-adaptive-words -@vindex gnus-ignored-adaptive-words -Words that appear in the @code{gnus-default-ignored-adaptive-words} list -will be ignored. If you wish to add more words to be ignored, use the -@code{gnus-ignored-adaptive-words} list instead. - -@vindex gnus-adaptive-word-length-limit -Some may feel that short words shouldn't count when doing adaptive -scoring. If so, you may set @code{gnus-adaptive-word-length-limit} to -an integer. Words shorter than this number will be ignored. This -variable defaults to @code{nil}. - -@vindex gnus-adaptive-word-syntax-table -When the scoring is done, @code{gnus-adaptive-word-syntax-table} is the -syntax table in effect. It is similar to the standard syntax table, but -it considers numbers to be non-word-constituent characters. - -@vindex gnus-adaptive-word-minimum -If @code{gnus-adaptive-word-minimum} is set to a number, the adaptive -word scoring process will never bring down the score of an article to -below this number. The default is @code{nil}. - -@vindex gnus-adaptive-word-no-group-words -If @code{gnus-adaptive-word-no-group-words} is set to @code{t}, gnus -won't adaptively word score any of the words in the group name. Useful -for groups like @samp{comp.editors.emacs}, where most of the subject -lines contain the word @samp{emacs}. - -After using this scheme for a while, it might be nice to write a -@code{gnus-psychoanalyze-user} command to go through the rules and see -what words you like and what words you don't like. Or perhaps not. - -Note that the adaptive word scoring thing is highly experimental and is -likely to change in the future. Initial impressions seem to indicate -that it's totally useless as it stands. Some more work (involving more -rigorous statistical methods) will have to be done to make this useful. - - -@node Home Score File -@section Home Score File - -The score file where new score file entries will go is called the -@dfn{home score file}. This is normally (and by default) the score file -for the group itself. For instance, the home score file for -@samp{gnu.emacs.gnus} is @file{gnu.emacs.gnus.SCORE}. - -However, this may not be what you want. It is often convenient to share -a common home score file among many groups---all @samp{emacs} groups -could perhaps use the same home score file. - -@vindex gnus-home-score-file -The variable that controls this is @code{gnus-home-score-file}. It can -be: - -@enumerate -@item -A string. Then this file will be used as the home score file for all -groups. - -@item -A function. The result of this function will be used as the home score -file. The function will be called with the name of the group as the -parameter. - -@item -A list. The elements in this list can be: - -@enumerate -@item -@code{(@var{regexp} @var{file-name})}. If the @var{regexp} matches the -group name, the @var{file-name} will be used as the home score file. - -@item -A function. If the function returns non-@code{nil}, the result will -be used as the home score file. The function will be called with the -name of the group as the parameter. - -@item -A string. Use the string as the home score file. -@end enumerate - -The list will be traversed from the beginning towards the end looking -for matches. - -@end enumerate - -So, if you want to use just a single score file, you could say: - -@lisp -(setq gnus-home-score-file - "my-total-score-file.SCORE") -@end lisp - -If you want to use @file{gnu.SCORE} for all @samp{gnu} groups and -@file{rec.SCORE} for all @samp{rec} groups (and so on), you can say: - -@findex gnus-hierarchial-home-score-file -@lisp -(setq gnus-home-score-file - 'gnus-hierarchial-home-score-file) -@end lisp - -This is a ready-made function provided for your convenience. -Other functions include - -@table @code -@item gnus-current-home-score-file -@findex gnus-current-home-score-file -Return the ``current'' regular score file. This will make scoring -commands add entry to the ``innermost'' matching score file. - -@end table - -If you want to have one score file for the @samp{emacs} groups and -another for the @samp{comp} groups, while letting all other groups use -their own home score files: - -@lisp -(setq gnus-home-score-file - ;; @r{All groups that match the regexp @code{"\\.emacs"}} - '(("\\.emacs" "emacs.SCORE") - ;; @r{All the comp groups in one score file} - ("^comp" "comp.SCORE"))) -@end lisp - -@vindex gnus-home-adapt-file -@code{gnus-home-adapt-file} works exactly the same way as -@code{gnus-home-score-file}, but says what the home adaptive score file -is instead. All new adaptive file entries will go into the file -specified by this variable, and the same syntax is allowed. - -In addition to using @code{gnus-home-score-file} and -@code{gnus-home-adapt-file}, you can also use group parameters -(@pxref{Group Parameters}) and topic parameters (@pxref{Topic -Parameters}) to achieve much the same. Group and topic parameters take -precedence over this variable. - - -@node Followups To Yourself -@section Followups To Yourself - -Gnus offers two commands for picking out the @code{Message-ID} header in -the current buffer. Gnus will then add a score rule that scores using -this @code{Message-ID} on the @code{References} header of other -articles. This will, in effect, increase the score of all articles that -respond to the article in the current buffer. Quite useful if you want -to easily note when people answer what you've said. - -@table @code - -@item gnus-score-followup-article -@findex gnus-score-followup-article -This will add a score to articles that directly follow up your own -article. - -@item gnus-score-followup-thread -@findex gnus-score-followup-thread -This will add a score to all articles that appear in a thread ``below'' -your own article. -@end table - -@vindex message-sent-hook -These two functions are both primarily meant to be used in hooks like -@code{message-sent-hook}, like this: -@lisp -(add-hook 'message-sent-hook 'gnus-score-followup-thread) -@end lisp - - -If you look closely at your own @code{Message-ID}, you'll notice that -the first two or three characters are always the same. Here's two of -mine: - -@example -<x6u3u47icf.fsf@@eyesore.no> -<x6sp9o7ibw.fsf@@eyesore.no> -@end example - -So ``my'' ident on this machine is @samp{x6}. This can be -exploited---the following rule will raise the score on all followups to -myself: - -@lisp -("references" - ("<x6[0-9a-z]+\\.fsf\\(_-_\\)?@@.*eyesore\\.no>" - 1000 nil r)) -@end lisp - -Whether it's the first two or first three characters that are ``yours'' -is system-dependent. - - -@node Scoring On Other Headers -@section Scoring On Other Headers -@cindex scoring on other headers - -Gnus is quite fast when scoring the ``traditional'' -headers---@samp{From}, @samp{Subject} and so on. However, scoring -other headers requires writing a @code{head} scoring rule, which means -that Gnus has to request every single article from the back end to find -matches. This takes a long time in big groups. - -Now, there's not much you can do about this for news groups, but for -mail groups, you have greater control. In @ref{To From Newsgroups}, -it's explained in greater detail what this mechanism does, but here's -a cookbook example for @code{nnml} on how to allow scoring on the -@samp{To} and @samp{Cc} headers. - -Put the following in your @file{~/.gnus.el} file. - -@lisp -(setq gnus-extra-headers '(To Cc Newsgroups Keywords) - nnmail-extra-headers gnus-extra-headers) -@end lisp - -Restart Gnus and rebuild your @code{nnml} overview files with the -@kbd{M-x nnml-generate-nov-databases} command. This will take a long -time if you have much mail. - -Now you can score on @samp{To} and @samp{Cc} as ``extra headers'' like -so: @kbd{I e s p To RET <your name> RET}. - -See? Simple. - - -@node Scoring Tips -@section Scoring Tips -@cindex scoring tips - -@table @dfn - -@item Crossposts -@cindex crossposts -@cindex scoring crossposts -If you want to lower the score of crossposts, the line to match on is -the @code{Xref} header. -@lisp -("xref" (" talk.politics.misc:" -1000)) -@end lisp - -@item Multiple crossposts -If you want to lower the score of articles that have been crossposted to -more than, say, 3 groups: -@lisp -("xref" - ("[^:\n]+:[0-9]+ +[^:\n]+:[0-9]+ +[^:\n]+:[0-9]+" - -1000 nil r)) -@end lisp - -@item Matching on the body -This is generally not a very good idea---it takes a very long time. -Gnus actually has to fetch each individual article from the server. But -you might want to anyway, I guess. Even though there are three match -keys (@code{Head}, @code{Body} and @code{All}), you should choose one -and stick with it in each score file. If you use any two, each article -will be fetched @emph{twice}. If you want to match a bit on the -@code{Head} and a bit on the @code{Body}, just use @code{All} for all -the matches. - -@item Marking as read -You will probably want to mark articles that have scores below a certain -number as read. This is most easily achieved by putting the following -in your @file{all.SCORE} file: -@lisp -((mark -100)) -@end lisp -You may also consider doing something similar with @code{expunge}. - -@item Negated character classes -If you say stuff like @code{[^abcd]*}, you may get unexpected results. -That will match newlines, which might lead to, well, The Unknown. Say -@code{[^abcd\n]*} instead. -@end table - - -@node Reverse Scoring -@section Reverse Scoring -@cindex reverse scoring - -If you want to keep just articles that have @samp{Sex with Emacs} in the -subject header, and expunge all other articles, you could put something -like this in your score file: - -@lisp -(("subject" - ("Sex with Emacs" 2)) - (mark 1) - (expunge 1)) -@end lisp - -So, you raise all articles that match @samp{Sex with Emacs} and mark the -rest as read, and expunge them to boot. - - -@node Global Score Files -@section Global Score Files -@cindex global score files - -Sure, other newsreaders have ``global kill files''. These are usually -nothing more than a single kill file that applies to all groups, stored -in the user's home directory. Bah! Puny, weak newsreaders! - -What I'm talking about here are Global Score Files. Score files from -all over the world, from users everywhere, uniting all nations in one -big, happy score file union! Ange-score! New and untested! - -@vindex gnus-global-score-files -All you have to do to use other people's score files is to set the -@code{gnus-global-score-files} variable. One entry for each score file, -or each score file directory. Gnus will decide by itself what score -files are applicable to which group. - -To use the score file -@file{/ftp@@ftp.gnus.org:/pub/larsi/ding/score/soc.motss.SCORE} and -all score files in the @file{/ftp@@ftp.some-where:/pub/score} directory, -say this: - -@lisp -(setq gnus-global-score-files - '("/ftp@@ftp.gnus.org:/pub/larsi/ding/score/soc.motss.SCORE" - "/ftp@@ftp.some-where:/pub/score/")) -@end lisp - -@findex gnus-score-search-global-directories -@noindent -Simple, eh? Directory names must end with a @samp{/}. These -directories are typically scanned only once during each Gnus session. -If you feel the need to manually re-scan the remote directories, you can -use the @code{gnus-score-search-global-directories} command. - -Note that, at present, using this option will slow down group entry -somewhat. (That is---a lot.) - -If you want to start maintaining score files for other people to use, -just put your score file up for anonymous ftp and announce it to the -world. Become a retro-moderator! Participate in the retro-moderator -wars sure to ensue, where retro-moderators battle it out for the -sympathy of the people, luring them to use their score files on false -premises! Yay! The net is saved! - -Here are some tips for the would-be retro-moderator, off the top of my -head: - -@itemize @bullet - -@item -Articles heavily crossposted are probably junk. -@item -To lower a single inappropriate article, lower by @code{Message-ID}. -@item -Particularly brilliant authors can be raised on a permanent basis. -@item -Authors that repeatedly post off-charter for the group can safely be -lowered out of existence. -@item -Set the @code{mark} and @code{expunge} atoms to obliterate the nastiest -articles completely. - -@item -Use expiring score entries to keep the size of the file down. You -should probably have a long expiry period, though, as some sites keep -old articles for a long time. -@end itemize - -@dots{} I wonder whether other newsreaders will support global score files -in the future. @emph{Snicker}. Yup, any day now, newsreaders like Blue -Wave, xrn and 1stReader are bound to implement scoring. Should we start -holding our breath yet? - - -@node Kill Files -@section Kill Files -@cindex kill files - -Gnus still supports those pesky old kill files. In fact, the kill file -entries can now be expiring, which is something I wrote before Daniel -Quinlan thought of doing score files, so I've left the code in there. - -In short, kill processing is a lot slower (and I do mean @emph{a lot}) -than score processing, so it might be a good idea to rewrite your kill -files into score files. - -Anyway, a kill file is a normal @code{emacs-lisp} file. You can put any -forms into this file, which means that you can use kill files as some -sort of primitive hook function to be run on group entry, even though -that isn't a very good idea. - -Normal kill files look like this: - -@lisp -(gnus-kill "From" "Lars Ingebrigtsen") -(gnus-kill "Subject" "ding") -(gnus-expunge "X") -@end lisp - -This will mark every article written by me as read, and remove the -marked articles from the summary buffer. Very useful, you'll agree. - -Other programs use a totally different kill file syntax. If Gnus -encounters what looks like a @code{rn} kill file, it will take a stab at -interpreting it. - -Two summary functions for editing a @sc{gnus} kill file: - -@table @kbd - -@item M-k -@kindex M-k (Summary) -@findex gnus-summary-edit-local-kill -Edit this group's kill file (@code{gnus-summary-edit-local-kill}). - -@item M-K -@kindex M-K (Summary) -@findex gnus-summary-edit-global-kill -Edit the general kill file (@code{gnus-summary-edit-global-kill}). -@end table - -Two group mode functions for editing the kill files: - -@table @kbd - -@item M-k -@kindex M-k (Group) -@findex gnus-group-edit-local-kill -Edit this group's kill file (@code{gnus-group-edit-local-kill}). - -@item M-K -@kindex M-K (Group) -@findex gnus-group-edit-global-kill -Edit the general kill file (@code{gnus-group-edit-global-kill}). -@end table - -Kill file variables: - -@table @code -@item gnus-kill-file-name -@vindex gnus-kill-file-name -A kill file for the group @samp{soc.motss} is normally called -@file{soc.motss.KILL}. The suffix appended to the group name to get -this file name is detailed by the @code{gnus-kill-file-name} variable. -The ``global'' kill file (not in the score file sense of ``global'', of -course) is just called @file{KILL}. - -@vindex gnus-kill-save-kill-file -@item gnus-kill-save-kill-file -If this variable is non-@code{nil}, Gnus will save the -kill file after processing, which is necessary if you use expiring -kills. - -@item gnus-apply-kill-hook -@vindex gnus-apply-kill-hook -@findex gnus-apply-kill-file-unless-scored -@findex gnus-apply-kill-file -A hook called to apply kill files to a group. It is -@code{(gnus-apply-kill-file)} by default. If you want to ignore the -kill file if you have a score file for the same group, you can set this -hook to @code{(gnus-apply-kill-file-unless-scored)}. If you don't want -kill files to be processed, you should set this variable to @code{nil}. - -@item gnus-kill-file-mode-hook -@vindex gnus-kill-file-mode-hook -A hook called in kill-file mode buffers. - -@end table - - -@node Converting Kill Files -@section Converting Kill Files -@cindex kill files -@cindex converting kill files - -If you have loads of old kill files, you may want to convert them into -score files. If they are ``regular'', you can use -the @file{gnus-kill-to-score.el} package; if not, you'll have to do it -by hand. - -The kill to score conversion package isn't included in Gnus by default. -You can fetch it from -@uref{http://www.stud.ifi.uio.no/~larsi/ding-various/gnus-kill-to-score.el}. - -If your old kill files are very complex---if they contain more -non-@code{gnus-kill} forms than not, you'll have to convert them by -hand. Or just let them be as they are. Gnus will still use them as -before. - - -@node GroupLens -@section GroupLens -@cindex GroupLens - -@sc{Note:} Unfortunately the GroupLens system seems to have shut down, -so this section is mostly of historical interest. - -@uref{http://www.cs.umn.edu/Research/GroupLens/, GroupLens} is a -collaborative filtering system that helps you work together with other -people to find the quality news articles out of the huge volume of -news articles generated every day. - -To accomplish this the GroupLens system combines your opinions about -articles you have already read with the opinions of others who have done -likewise and gives you a personalized prediction for each unread news -article. Think of GroupLens as a matchmaker. GroupLens watches how you -rate articles, and finds other people that rate articles the same way. -Once it has found some people you agree with it tells you, in the form -of a prediction, what they thought of the article. You can use this -prediction to help you decide whether or not you want to read the -article. - -@menu -* Using GroupLens:: How to make Gnus use GroupLens. -* Rating Articles:: Letting GroupLens know how you rate articles. -* Displaying Predictions:: Displaying predictions given by GroupLens. -* GroupLens Variables:: Customizing GroupLens. -@end menu - - -@node Using GroupLens -@subsection Using GroupLens - -To use GroupLens you must register a pseudonym with your local -@uref{http://www.cs.umn.edu/Research/GroupLens/bbb.html, Better Bit -Bureau (BBB)} is the only better bit in town at the moment. - -Once you have registered you'll need to set a couple of variables. - -@table @code - -@item gnus-use-grouplens -@vindex gnus-use-grouplens -Setting this variable to a non-@code{nil} value will make Gnus hook into -all the relevant GroupLens functions. - -@item grouplens-pseudonym -@vindex grouplens-pseudonym -This variable should be set to the pseudonym you got when registering -with the Better Bit Bureau. - -@item grouplens-newsgroups -@vindex grouplens-newsgroups -A list of groups that you want to get GroupLens predictions for. - -@end table - -That's the minimum of what you need to get up and running with GroupLens. -Once you've registered, GroupLens will start giving you scores for -articles based on the average of what other people think. But, to get -the real benefit of GroupLens you need to start rating articles -yourself. Then the scores GroupLens gives you will be personalized for -you, based on how the people you usually agree with have already rated. - - -@node Rating Articles -@subsection Rating Articles - -In GroupLens, an article is rated on a scale from 1 to 5, inclusive. -Where 1 means something like this article is a waste of bandwidth and 5 -means that the article was really good. The basic question to ask -yourself is, ``on a scale from 1 to 5 would I like to see more articles -like this one?'' - -There are four ways to enter a rating for an article in GroupLens. - -@table @kbd - -@item r -@kindex r (GroupLens) -@findex bbb-summary-rate-article -This function will prompt you for a rating on a scale of one to five. - -@item k -@kindex k (GroupLens) -@findex grouplens-score-thread -This function will prompt you for a rating, and rate all the articles in -the thread. This is really useful for some of those long running giant -threads in rec.humor. - -@end table - -The next two commands, @kbd{n} and @kbd{,} take a numerical prefix to be -the score of the article you're reading. - -@table @kbd - -@item 1-5 n -@kindex n (GroupLens) -@findex grouplens-next-unread-article -Rate the article and go to the next unread article. - -@item 1-5 , -@kindex , (GroupLens) -@findex grouplens-best-unread-article -Rate the article and go to the next unread article with the highest score. - -@end table - -If you want to give the current article a score of 4 and then go to the -next article, just type @kbd{4 n}. - - -@node Displaying Predictions -@subsection Displaying Predictions - -GroupLens makes a prediction for you about how much you will like a -news article. The predictions from GroupLens are on a scale from 1 to -5, where 1 is the worst and 5 is the best. You can use the predictions -from GroupLens in one of three ways controlled by the variable -@code{gnus-grouplens-override-scoring}. - -@vindex gnus-grouplens-override-scoring -There are three ways to display predictions in grouplens. You may -choose to have the GroupLens scores contribute to, or override the -regular Gnus scoring mechanism. override is the default; however, some -people prefer to see the Gnus scores plus the grouplens scores. To get -the separate scoring behavior you need to set -@code{gnus-grouplens-override-scoring} to @code{'separate}. To have the -GroupLens predictions combined with the grouplens scores set it to -@code{'override} and to combine the scores set -@code{gnus-grouplens-override-scoring} to @code{'combine}. When you use -the combine option you will also want to set the values for -@code{grouplens-prediction-offset} and -@code{grouplens-score-scale-factor}. - -@vindex grouplens-prediction-display -In either case, GroupLens gives you a few choices for how you would like -to see your predictions displayed. The display of predictions is -controlled by the @code{grouplens-prediction-display} variable. - -The following are valid values for that variable. - -@table @code -@item prediction-spot -The higher the prediction, the further to the right an @samp{*} is -displayed. - -@item confidence-interval -A numeric confidence interval. - -@item prediction-bar -The higher the prediction, the longer the bar. - -@item confidence-bar -Numerical confidence. - -@item confidence-spot -The spot gets bigger with more confidence. - -@item prediction-num -Plain-old numeric value. - -@item confidence-plus-minus -Prediction +/- confidence. - -@end table - - -@node GroupLens Variables -@subsection GroupLens Variables - -@table @code - -@item gnus-summary-grouplens-line-format -The summary line format used in GroupLens-enhanced summary buffers. It -accepts the same specs as the normal summary line format (@pxref{Summary -Buffer Lines}). The default is @samp{%U%R%z%l%I%(%[%4L: %-23,23n%]%) -%s\n}. - -@item grouplens-bbb-host -Host running the bbbd server. @samp{grouplens.cs.umn.edu} is the -default. - -@item grouplens-bbb-port -Port of the host running the bbbd server. The default is 9000. - -@item grouplens-score-offset -Offset the prediction by this value. In other words, subtract the -prediction value by this number to arrive at the effective score. The -default is 0. - -@item grouplens-score-scale-factor -This variable allows the user to magnify the effect of GroupLens scores. -The scale factor is applied after the offset. The default is 1. - -@end table - - -@node Advanced Scoring -@section Advanced Scoring - -Scoring on Subjects and From headers is nice enough, but what if you're -really interested in what a person has to say only when she's talking -about a particular subject? Or what if you really don't want to -read what person A has to say when she's following up to person B, but -want to read what she says when she's following up to person C? - -By using advanced scoring rules you may create arbitrarily complex -scoring patterns. - -@menu -* Advanced Scoring Syntax:: A definition. -* Advanced Scoring Examples:: What they look like. -* Advanced Scoring Tips:: Getting the most out of it. -@end menu - - -@node Advanced Scoring Syntax -@subsection Advanced Scoring Syntax - -Ordinary scoring rules have a string as the first element in the rule. -Advanced scoring rules have a list as the first element. The second -element is the score to be applied if the first element evaluated to a -non-@code{nil} value. - -These lists may consist of three logical operators, one redirection -operator, and various match operators. - -Logical operators: - -@table @code -@item & -@itemx and -This logical operator will evaluate each of its arguments until it finds -one that evaluates to @code{false}, and then it'll stop. If all arguments -evaluate to @code{true} values, then this operator will return -@code{true}. - -@item | -@itemx or -This logical operator will evaluate each of its arguments until it finds -one that evaluates to @code{true}. If no arguments are @code{true}, -then this operator will return @code{false}. - -@item ! -@itemx not -@itemx ¬ -This logical operator only takes a single argument. It returns the -logical negation of the value of its argument. - -@end table - -There is an @dfn{indirection operator} that will make its arguments -apply to the ancestors of the current article being scored. For -instance, @code{1-} will make score rules apply to the parent of the -current article. @code{2-} will make score rules apply to the -grandparent of the current article. Alternatively, you can write -@code{^^}, where the number of @code{^}s (carets) says how far back into -the ancestry you want to go. - -Finally, we have the match operators. These are the ones that do the -real work. Match operators are header name strings followed by a match -and a match type. A typical match operator looks like @samp{("from" -"Lars Ingebrigtsen" s)}. The header names are the same as when using -simple scoring, and the match types are also the same. - - -@node Advanced Scoring Examples -@subsection Advanced Scoring Examples - -Please note that the following examples are score file rules. To -make a complete score file from them, surround them with another pair -of parentheses. - -Let's say you want to increase the score of articles written by Lars -when he's talking about Gnus: - -@example -@group -((& - ("from" "Lars Ingebrigtsen") - ("subject" "Gnus")) - 1000) -@end group -@end example - -Quite simple, huh? - -When he writes long articles, he sometimes has something nice to say: - -@example -((& - ("from" "Lars Ingebrigtsen") - (| - ("subject" "Gnus") - ("lines" 100 >))) - 1000) -@end example - -However, when he responds to things written by Reig Eigil Logge, you -really don't want to read what he's written: - -@example -((& - ("from" "Lars Ingebrigtsen") - (1- ("from" "Reig Eigil Logge"))) - -100000) -@end example - -Everybody that follows up Redmondo when he writes about disappearing -socks should have their scores raised, but only when they talk about -white socks. However, when Lars talks about socks, it's usually not -very interesting: - -@example -((& - (1- - (& - ("from" "redmondo@@.*no" r) - ("body" "disappearing.*socks" t))) - (! ("from" "Lars Ingebrigtsen")) - ("body" "white.*socks")) - 1000) -@end example - -Suppose you're reading a high volume group and you're only interested -in replies. The plan is to score down all articles that don't have -subject that begin with "Re:", "Fw:" or "Fwd:" and then score up all -parents of articles that have subjects that begin with reply marks. - -@example -((! ("subject" "re:\\|fwd?:" r)) - -200) -((1- ("subject" "re:\\|fwd?:" r)) - 200) -@end example - -The possibilities are endless. - -@node Advanced Scoring Tips -@subsection Advanced Scoring Tips - -The @code{&} and @code{|} logical operators do short-circuit logic. -That is, they stop processing their arguments when it's clear what the -result of the operation will be. For instance, if one of the arguments -of an @code{&} evaluates to @code{false}, there's no point in evaluating -the rest of the arguments. This means that you should put slow matches -(@samp{body}, @samp{header}) last and quick matches (@samp{from}, -@samp{subject}) first. - -The indirection arguments (@code{1-} and so on) will make their -arguments work on previous generations of the thread. If you say -something like: - -@example -... -(1- - (1- - ("from" "lars"))) -... -@end example - -Then that means ``score on the from header of the grandparent of the -current article''. An indirection is quite fast, but it's better to say: - -@example -(1- - (& - ("from" "Lars") - ("subject" "Gnus"))) -@end example - -than it is to say: - -@example -(& - (1- ("from" "Lars")) - (1- ("subject" "Gnus"))) -@end example - - -@node Score Decays -@section Score Decays -@cindex score decays -@cindex decays - -You may find that your scores have a tendency to grow without -bounds, especially if you're using adaptive scoring. If scores get too -big, they lose all meaning---they simply max out and it's difficult to -use them in any sensible way. - -@vindex gnus-decay-scores -@findex gnus-decay-score -@vindex gnus-decay-score-function -Gnus provides a mechanism for decaying scores to help with this problem. -When score files are loaded and @code{gnus-decay-scores} is -non-@code{nil}, Gnus will run the score files through the decaying -mechanism thereby lowering the scores of all non-permanent score rules. -The decay itself if performed by the @code{gnus-decay-score-function} -function, which is @code{gnus-decay-score} by default. Here's the -definition of that function: - -@lisp -(defun gnus-decay-score (score) - "Decay SCORE according to `gnus-score-decay-constant' -and `gnus-score-decay-scale'." - (let ((n (- score - (* (if (< score 0) -1 1) - (min (abs score) - (max gnus-score-decay-constant - (* (abs score) - gnus-score-decay-scale))))))) - (if (and (featurep 'xemacs) - ;; XEmacs' floor can handle only the floating point - ;; number below the half of the maximum integer. - (> (abs n) (lsh -1 -2))) - (string-to-number - (car (split-string (number-to-string n) "\\."))) - (floor n)))) -@end lisp - -@vindex gnus-score-decay-scale -@vindex gnus-score-decay-constant -@code{gnus-score-decay-constant} is 3 by default and -@code{gnus-score-decay-scale} is 0.05. This should cause the following: - -@enumerate -@item -Scores between -3 and 3 will be set to 0 when this function is called. - -@item -Scores with magnitudes between 3 and 60 will be shrunk by 3. - -@item -Scores with magnitudes greater than 60 will be shrunk by 5% of the -score. -@end enumerate - -If you don't like this decay function, write your own. It is called -with the score to be decayed as its only parameter, and it should return -the new score, which should be an integer. - -Gnus will try to decay scores once a day. If you haven't run Gnus for -four days, Gnus will decay the scores four times, for instance. - -@iftex -@iflatex -@chapter Message -@include message.texi -@chapter Emacs MIME -@include emacs-mime.texi -@chapter Sieve -@include sieve.texi -@chapter PGG -@include pgg.texi -@end iflatex -@end iftex - -@node Various -@chapter Various - -@menu -* Process/Prefix:: A convention used by many treatment commands. -* Interactive:: Making Gnus ask you many questions. -* Symbolic Prefixes:: How to supply some Gnus functions with options. -* Formatting Variables:: You can specify what buffers should look like. -* Window Layout:: Configuring the Gnus buffer windows. -* Faces and Fonts:: How to change how faces look. -* Compilation:: How to speed Gnus up. -* Mode Lines:: Displaying information in the mode lines. -* Highlighting and Menus:: Making buffers look all nice and cozy. -* Buttons:: Get tendinitis in ten easy steps! -* Daemons:: Gnus can do things behind your back. -* NoCeM:: How to avoid spam and other fatty foods. -* Undo:: Some actions can be undone. -* Predicate Specifiers:: Specifying predicates. -* Moderation:: What to do if you're a moderator. -* Fetching a Group:: Starting Gnus just to read a group. -* Image Enhancements:: Modern versions of Emacs/XEmacs can display images. -* Fuzzy Matching:: What's the big fuzz? -* Thwarting Email Spam:: Simple ways to avoid unsolicited commercial email. -* Spam Package:: A package for filtering and processing spam. -* Other modes:: Interaction with other modes. -* Various Various:: Things that are really various. -@end menu - - -@node Process/Prefix -@section Process/Prefix -@cindex process/prefix convention - -Many functions, among them functions for moving, decoding and saving -articles, use what is known as the @dfn{Process/Prefix convention}. - -This is a method for figuring out what articles the user wants the -command to be performed on. - -It goes like this: - -If the numeric prefix is N, perform the operation on the next N -articles, starting with the current one. If the numeric prefix is -negative, perform the operation on the previous N articles, starting -with the current one. - -@vindex transient-mark-mode -If @code{transient-mark-mode} in non-@code{nil} and the region is -active, all articles in the region will be worked upon. - -If there is no numeric prefix, but some articles are marked with the -process mark, perform the operation on the articles marked with -the process mark. - -If there is neither a numeric prefix nor any articles marked with the -process mark, just perform the operation on the current article. - -Quite simple, really, but it needs to be made clear so that surprises -are avoided. - -Commands that react to the process mark will push the current list of -process marked articles onto a stack and will then clear all process -marked articles. You can restore the previous configuration with the -@kbd{M P y} command (@pxref{Setting Process Marks}). - -@vindex gnus-summary-goto-unread -One thing that seems to shock & horrify lots of people is that, for -instance, @kbd{3 d} does exactly the same as @kbd{d} @kbd{d} @kbd{d}. -Since each @kbd{d} (which marks the current article as read) by default -goes to the next unread article after marking, this means that @kbd{3 d} -will mark the next three unread articles as read, no matter what the -summary buffer looks like. Set @code{gnus-summary-goto-unread} to -@code{nil} for a more straightforward action. - -Many commands do not use the process/prefix convention. All commands -that do explicitly say so in this manual. To apply the process/prefix -convention to commands that do not use it, you can use the @kbd{M-&} -command. For instance, to mark all the articles in the group as -expirable, you could say @kbd{M P b M-& E}. - - -@node Interactive -@section Interactive -@cindex interaction - -@table @code - -@item gnus-novice-user -@vindex gnus-novice-user -If this variable is non-@code{nil}, you are either a newcomer to the -World of Usenet, or you are very cautious, which is a nice thing to be, -really. You will be given questions of the type ``Are you sure you want -to do this?'' before doing anything dangerous. This is @code{t} by -default. - -@item gnus-expert-user -@vindex gnus-expert-user -If this variable is non-@code{nil}, you will seldom be asked any -questions by Gnus. It will simply assume you know what you're doing, no -matter how strange. - -@item gnus-interactive-catchup -@vindex gnus-interactive-catchup -Require confirmation before catching up a group if non-@code{nil}. It -is @code{t} by default. - -@item gnus-interactive-exit -@vindex gnus-interactive-exit -Require confirmation before exiting Gnus. This variable is @code{t} by -default. -@end table - - -@node Symbolic Prefixes -@section Symbolic Prefixes -@cindex symbolic prefixes - -Quite a lot of Emacs commands react to the (numeric) prefix. For -instance, @kbd{C-u 4 C-f} moves point four characters forward, and -@kbd{C-u 9 0 0 I s s p} adds a permanent @code{Subject} substring score -rule of 900 to the current article. - -This is all nice and well, but what if you want to give a command some -additional information? Well, what most commands do is interpret the -``raw'' prefix in some special way. @kbd{C-u 0 C-x C-s} means that one -doesn't want a backup file to be created when saving the current buffer, -for instance. But what if you want to save without making a backup -file, and you want Emacs to flash lights and play a nice tune at the -same time? You can't, and you're probably perfectly happy that way. - -@kindex M-i (Summary) -@findex gnus-symbolic-argument -I'm not, so I've added a second prefix---the @dfn{symbolic prefix}. The -prefix key is @kbd{M-i} (@code{gnus-symbolic-argument}), and the next -character typed in is the value. You can stack as many @kbd{M-i} -prefixes as you want. @kbd{M-i a C-M-u} means ``feed the @kbd{C-M-u} -command the symbolic prefix @code{a}''. @kbd{M-i a M-i b C-M-u} means -``feed the @kbd{C-M-u} command the symbolic prefixes @code{a} and -@code{b}''. You get the drift. - -Typing in symbolic prefixes to commands that don't accept them doesn't -hurt, but it doesn't do any good either. Currently not many Gnus -functions make use of the symbolic prefix. - -If you're interested in how Gnus implements this, @pxref{Extended -Interactive}. - - -@node Formatting Variables -@section Formatting Variables -@cindex formatting variables - -Throughout this manual you've probably noticed lots of variables called -things like @code{gnus-group-line-format} and -@code{gnus-summary-mode-line-format}. These control how Gnus is to -output lines in the various buffers. There's quite a lot of them. -Fortunately, they all use the same syntax, so there's not that much to -be annoyed by. - -Here's an example format spec (from the group buffer): @samp{%M%S%5y: -%(%g%)\n}. We see that it is indeed extremely ugly, and that there are -lots of percentages everywhere. - -@menu -* Formatting Basics:: A formatting variable is basically a format string. -* Mode Line Formatting:: Some rules about mode line formatting variables. -* Advanced Formatting:: Modifying output in various ways. -* User-Defined Specs:: Having Gnus call your own functions. -* Formatting Fonts:: Making the formatting look colorful and nice. -* Positioning Point:: Moving point to a position after an operation. -* Tabulation:: Tabulating your output. -* Wide Characters:: Dealing with wide characters. -@end menu - -Currently Gnus uses the following formatting variables: -@code{gnus-group-line-format}, @code{gnus-summary-line-format}, -@code{gnus-server-line-format}, @code{gnus-topic-line-format}, -@code{gnus-group-mode-line-format}, -@code{gnus-summary-mode-line-format}, -@code{gnus-article-mode-line-format}, -@code{gnus-server-mode-line-format}, and -@code{gnus-summary-pick-line-format}. - -All these format variables can also be arbitrary elisp forms. In that -case, they will be @code{eval}ed to insert the required lines. - -@kindex M-x gnus-update-format -@findex gnus-update-format -Gnus includes a command to help you while creating your own format -specs. @kbd{M-x gnus-update-format} will @code{eval} the current form, -update the spec in question and pop you to a buffer where you can -examine the resulting Lisp code to be run to generate the line. - - - -@node Formatting Basics -@subsection Formatting Basics - -Each @samp{%} element will be replaced by some string or other when the -buffer in question is generated. @samp{%5y} means ``insert the @samp{y} -spec, and pad with spaces to get a 5-character field''. - -As with normal C and Emacs Lisp formatting strings, the numerical -modifier between the @samp{%} and the formatting type character will -@dfn{pad} the output so that it is always at least that long. -@samp{%5y} will make the field always (at least) five characters wide by -padding with spaces to the left. If you say @samp{%-5y}, it will pad to -the right instead. - -You may also wish to limit the length of the field to protect against -particularly wide values. For that you can say @samp{%4,6y}, which -means that the field will never be more than 6 characters wide and never -less than 4 characters wide. - -Also Gnus supports some extended format specifications, such as -@samp{%&user-date;}. - - -@node Mode Line Formatting -@subsection Mode Line Formatting - -Mode line formatting variables (e.g., -@code{gnus-summary-mode-line-format}) follow the same rules as other, -buffer line oriented formatting variables (@pxref{Formatting Basics}) -with the following two differences: - -@enumerate - -@item -There must be no newline (@samp{\n}) at the end. - -@item -The special @samp{%%b} spec can be used to display the buffer name. -Well, it's no spec at all, really---@samp{%%} is just a way to quote -@samp{%} to allow it to pass through the formatting machinery unmangled, -so that Emacs receives @samp{%b}, which is something the Emacs mode line -display interprets to mean ``show the buffer name''. For a full list of -mode line specs Emacs understands, see the documentation of the -@code{mode-line-format} variable. - -@end enumerate - - -@node Advanced Formatting -@subsection Advanced Formatting - -It is frequently useful to post-process the fields in some way. -Padding, limiting, cutting off parts and suppressing certain values can -be achieved by using @dfn{tilde modifiers}. A typical tilde spec might -look like @samp{%~(cut 3)~(ignore "0")y}. - -These are the valid modifiers: - -@table @code -@item pad -@itemx pad-left -Pad the field to the left with spaces until it reaches the required -length. - -@item pad-right -Pad the field to the right with spaces until it reaches the required -length. - -@item max -@itemx max-left -Cut off characters from the left until it reaches the specified length. - -@item max-right -Cut off characters from the right until it reaches the specified -length. - -@item cut -@itemx cut-left -Cut off the specified number of characters from the left. - -@item cut-right -Cut off the specified number of characters from the right. - -@item ignore -Return an empty string if the field is equal to the specified value. - -@item form -Use the specified form as the field value when the @samp{@@} spec is -used. - -Here's an example: - -@lisp -"~(form (current-time-string))@@" -@end lisp - -@end table - -Let's take an example. The @samp{%o} spec in the summary mode lines -will return a date in compact ISO8601 format---@samp{19960809T230410}. -This is quite a mouthful, so we want to shave off the century number and -the time, leaving us with a six-character date. That would be -@samp{%~(cut-left 2)~(max-right 6)~(pad 6)o}. (Cutting is done before -maxing, and we need the padding to ensure that the date is never less -than 6 characters to make it look nice in columns.) - -Ignoring is done first; then cutting; then maxing; and then as the very -last operation, padding. - -If you use lots of these advanced thingies, you'll find that Gnus gets -quite slow. This can be helped enormously by running @kbd{M-x -gnus-compile} when you are satisfied with the look of your lines. -@xref{Compilation}. - - -@node User-Defined Specs -@subsection User-Defined Specs - -All the specs allow for inserting user defined specifiers---@samp{u}. -The next character in the format string should be a letter. Gnus -will call the function @code{gnus-user-format-function-}@samp{X}, where -@samp{X} is the letter following @samp{%u}. The function will be passed -a single parameter---what the parameter means depends on what buffer -it's being called from. The function should return a string, which will -be inserted into the buffer just like information from any other -specifier. This function may also be called with dummy values, so it -should protect against that. - -Also Gnus supports extended user-defined specs, such as @samp{%u&foo;}. -Gnus will call the function @code{gnus-user-format-function-}@samp{foo}. - -You can also use tilde modifiers (@pxref{Advanced Formatting} to achieve -much the same without defining new functions. Here's an example: -@samp{%~(form (count-lines (point-min) (point)))@@}. The form -given here will be evaluated to yield the current line number, and then -inserted. - - -@node Formatting Fonts -@subsection Formatting Fonts - -There are specs for highlighting, and these are shared by all the format -variables. Text inside the @samp{%(} and @samp{%)} specifiers will get -the special @code{mouse-face} property set, which means that it will be -highlighted (with @code{gnus-mouse-face}) when you put the mouse pointer -over it. - -Text inside the @samp{%@{} and @samp{%@}} specifiers will have their -normal faces set using @code{gnus-face-0}, which is @code{bold} by -default. If you say @samp{%1@{}, you'll get @code{gnus-face-1} instead, -and so on. Create as many faces as you wish. The same goes for the -@code{mouse-face} specs---you can say @samp{%3(hello%)} to have -@samp{hello} mouse-highlighted with @code{gnus-mouse-face-3}. - -Text inside the @samp{%<<} and @samp{%>>} specifiers will get the -special @code{balloon-help} property set to -@code{gnus-balloon-face-0}. If you say @samp{%1<<}, you'll get -@code{gnus-balloon-face-1} and so on. The @code{gnus-balloon-face-*} -variables should be either strings or symbols naming functions that -return a string. When the mouse passes over text with this property -set, a balloon window will appear and display the string. Please -refer to @ref{Tooltips, ,Tooltips, emacs, The Emacs Manual}, -(in GNU Emacs) or the doc string of @code{balloon-help-mode} (in -XEmacs) for more information on this. (For technical reasons, the -guillemets have been approximated as @samp{<<} and @samp{>>} in this -paragraph.) - -Here's an alternative recipe for the group buffer: - -@lisp -;; @r{Create three face types.} -(setq gnus-face-1 'bold) -(setq gnus-face-3 'italic) - -;; @r{We want the article count to be in} -;; @r{a bold and green face. So we create} -;; @r{a new face called @code{my-green-bold}.} -(copy-face 'bold 'my-green-bold) -;; @r{Set the color.} -(set-face-foreground 'my-green-bold "ForestGreen") -(setq gnus-face-2 'my-green-bold) - -;; @r{Set the new & fancy format.} -(setq gnus-group-line-format - "%M%S%3@{%5y%@}%2[:%] %(%1@{%g%@}%)\n") -@end lisp - -I'm sure you'll be able to use this scheme to create totally unreadable -and extremely vulgar displays. Have fun! - -Note that the @samp{%(} specs (and friends) do not make any sense on the -mode-line variables. - -@node Positioning Point -@subsection Positioning Point - -Gnus usually moves point to a pre-defined place on each line in most -buffers. By default, point move to the first colon character on the -line. You can customize this behavior in three different ways. - -You can move the colon character to somewhere else on the line. - -@findex gnus-goto-colon -You can redefine the function that moves the point to the colon. The -function is called @code{gnus-goto-colon}. - -But perhaps the most convenient way to deal with this, if you don't want -to have a colon in your line, is to use the @samp{%*} specifier. If you -put a @samp{%*} somewhere in your format line definition, Gnus will -place point there. - - -@node Tabulation -@subsection Tabulation - -You can usually line up your displays by padding and cutting your -strings. However, when combining various strings of different size, it -can often be more convenient to just output the strings, and then worry -about lining up the following text afterwards. - -To do that, Gnus supplies tabulator specs---@samp{%=}. There are two -different types---@dfn{hard tabulators} and @dfn{soft tabulators}. - -@samp{%50=} will insert space characters to pad the line up to column -50. If the text is already past column 50, nothing will be inserted. -This is the soft tabulator. - -@samp{%-50=} will insert space characters to pad the line up to column -50. If the text is already past column 50, the excess text past column -50 will be removed. This is the hard tabulator. - - -@node Wide Characters -@subsection Wide Characters - -Fixed width fonts in most countries have characters of the same width. -Some countries, however, use Latin characters mixed with wider -characters---most notable East Asian countries. - -The problem is that when formatting, Gnus assumes that if a string is 10 -characters wide, it'll be 10 Latin characters wide on the screen. In -these countries, that's not true. - -@vindex gnus-use-correct-string-widths -To help fix this, you can set @code{gnus-use-correct-string-widths} to -@code{t}. This makes buffer generation slower, but the results will be -prettier. The default value under XEmacs is @code{t} but @code{nil} -for Emacs. - - -@node Window Layout -@section Window Layout -@cindex window layout - -No, there's nothing here about X, so be quiet. - -@vindex gnus-use-full-window -If @code{gnus-use-full-window} non-@code{nil}, Gnus will delete all -other windows and occupy the entire Emacs screen by itself. It is -@code{t} by default. - -Setting this variable to @code{nil} kinda works, but there are -glitches. Use at your own peril. - -@vindex gnus-buffer-configuration -@code{gnus-buffer-configuration} describes how much space each Gnus -buffer should be given. Here's an excerpt of this variable: - -@lisp -((group (vertical 1.0 (group 1.0 point) - (if gnus-carpal (group-carpal 4)))) - (article (vertical 1.0 (summary 0.25 point) - (article 1.0)))) -@end lisp - -This is an alist. The @dfn{key} is a symbol that names some action or -other. For instance, when displaying the group buffer, the window -configuration function will use @code{group} as the key. A full list of -possible names is listed below. - -The @dfn{value} (i.e., the @dfn{split}) says how much space each buffer -should occupy. To take the @code{article} split as an example - - -@lisp -(article (vertical 1.0 (summary 0.25 point) - (article 1.0))) -@end lisp - -This @dfn{split} says that the summary buffer should occupy 25% of upper -half of the screen, and that it is placed over the article buffer. As -you may have noticed, 100% + 25% is actually 125% (yup, I saw y'all -reaching for that calculator there). However, the special number -@code{1.0} is used to signal that this buffer should soak up all the -rest of the space available after the rest of the buffers have taken -whatever they need. There should be only one buffer with the @code{1.0} -size spec per split. - -Point will be put in the buffer that has the optional third element -@code{point}. In a @code{frame} split, the last subsplit having a leaf -split where the tag @code{frame-focus} is a member (i.e. is the third or -fourth element in the list, depending on whether the @code{point} tag is -present) gets focus. - -Here's a more complicated example: - -@lisp -(article (vertical 1.0 (group 4) - (summary 0.25 point) - (if gnus-carpal (summary-carpal 4)) - (article 1.0))) -@end lisp - -If the size spec is an integer instead of a floating point number, -then that number will be used to say how many lines a buffer should -occupy, not a percentage. - -If the @dfn{split} looks like something that can be @code{eval}ed (to be -precise---if the @code{car} of the split is a function or a subr), this -split will be @code{eval}ed. If the result is non-@code{nil}, it will -be used as a split. This means that there will be three buffers if -@code{gnus-carpal} is @code{nil}, and four buffers if @code{gnus-carpal} -is non-@code{nil}. - -Not complicated enough for you? Well, try this on for size: - -@lisp -(article (horizontal 1.0 - (vertical 0.5 - (group 1.0) - (gnus-carpal 4)) - (vertical 1.0 - (summary 0.25 point) - (summary-carpal 4) - (article 1.0)))) -@end lisp - -Whoops. Two buffers with the mystery 100% tag. And what's that -@code{horizontal} thingie? - -If the first element in one of the split is @code{horizontal}, Gnus will -split the window horizontally, giving you two windows side-by-side. -Inside each of these strips you may carry on all you like in the normal -fashion. The number following @code{horizontal} says what percentage of -the screen is to be given to this strip. - -For each split, there @emph{must} be one element that has the 100% tag. -The splitting is never accurate, and this buffer will eat any leftover -lines from the splits. - -To be slightly more formal, here's a definition of what a valid split -may look like: - -@example -@group -split = frame | horizontal | vertical | buffer | form -frame = "(frame " size *split ")" -horizontal = "(horizontal " size *split ")" -vertical = "(vertical " size *split ")" -buffer = "(" buf-name " " size *[ "point" ] *[ "frame-focus"] ")" -size = number | frame-params -buf-name = group | article | summary ... -@end group -@end example - -The limitations are that the @code{frame} split can only appear as the -top-level split. @var{form} should be an Emacs Lisp form that should -return a valid split. We see that each split is fully recursive, and -may contain any number of @code{vertical} and @code{horizontal} splits. - -@vindex gnus-window-min-width -@vindex gnus-window-min-height -@cindex window height -@cindex window width -Finding the right sizes can be a bit complicated. No window may be less -than @code{gnus-window-min-height} (default 1) characters high, and all -windows must be at least @code{gnus-window-min-width} (default 1) -characters wide. Gnus will try to enforce this before applying the -splits. If you want to use the normal Emacs window width/height limit, -you can just set these two variables to @code{nil}. - -If you're not familiar with Emacs terminology, @code{horizontal} and -@code{vertical} splits may work the opposite way of what you'd expect. -Windows inside a @code{horizontal} split are shown side-by-side, and -windows within a @code{vertical} split are shown above each other. - -@findex gnus-configure-frame -If you want to experiment with window placement, a good tip is to call -@code{gnus-configure-frame} directly with a split. This is the function -that does all the real work when splitting buffers. Below is a pretty -nonsensical configuration with 5 windows; two for the group buffer and -three for the article buffer. (I said it was nonsensical.) If you -@code{eval} the statement below, you can get an idea of how that would -look straight away, without going through the normal Gnus channels. -Play with it until you're satisfied, and then use -@code{gnus-add-configuration} to add your new creation to the buffer -configuration list. - -@lisp -(gnus-configure-frame - '(horizontal 1.0 - (vertical 10 - (group 1.0) - (article 0.3 point)) - (vertical 1.0 - (article 1.0) - (horizontal 4 - (group 1.0) - (article 10))))) -@end lisp - -You might want to have several frames as well. No prob---just use the -@code{frame} split: - -@lisp -(gnus-configure-frame - '(frame 1.0 - (vertical 1.0 - (summary 0.25 point frame-focus) - (article 1.0)) - (vertical ((height . 5) (width . 15) - (user-position . t) - (left . -1) (top . 1)) - (picon 1.0)))) - -@end lisp - -This split will result in the familiar summary/article window -configuration in the first (or ``main'') frame, while a small additional -frame will be created where picons will be shown. As you can see, -instead of the normal @code{1.0} top-level spec, each additional split -should have a frame parameter alist as the size spec. -@xref{Frame Parameters, , Frame Parameters, elisp, The GNU Emacs Lisp -Reference Manual}. Under XEmacs, a frame property list will be -accepted, too---for instance, @code{(height 5 width 15 left -1 top 1)} -is such a plist. -The list of all possible keys for @code{gnus-buffer-configuration} can -be found in its default value. - -Note that the @code{message} key is used for both -@code{gnus-group-mail} and @code{gnus-summary-mail-other-window}. If -it is desirable to distinguish between the two, something like this -might be used: - -@lisp -(message (horizontal 1.0 - (vertical 1.0 (message 1.0 point)) - (vertical 0.24 - (if (buffer-live-p gnus-summary-buffer) - '(summary 0.5)) - (group 1.0)))) -@end lisp - -One common desire for a multiple frame split is to have a separate frame -for composing mail and news while leaving the original frame intact. To -accomplish that, something like the following can be done: - -@lisp -(message - (frame 1.0 - (if (not (buffer-live-p gnus-summary-buffer)) - (car (cdr (assoc 'group gnus-buffer-configuration))) - (car (cdr (assoc 'summary gnus-buffer-configuration)))) - (vertical ((user-position . t) (top . 1) (left . 1) - (name . "Message")) - (message 1.0 point)))) -@end lisp - -@findex gnus-add-configuration -Since the @code{gnus-buffer-configuration} variable is so long and -complicated, there's a function you can use to ease changing the config -of a single setting: @code{gnus-add-configuration}. If, for instance, -you want to change the @code{article} setting, you could say: - -@lisp -(gnus-add-configuration - '(article (vertical 1.0 - (group 4) - (summary .25 point) - (article 1.0)))) -@end lisp - -You'd typically stick these @code{gnus-add-configuration} calls in your -@file{~/.gnus.el} file or in some startup hook---they should be run after -Gnus has been loaded. - -@vindex gnus-always-force-window-configuration -If all windows mentioned in the configuration are already visible, Gnus -won't change the window configuration. If you always want to force the -``right'' window configuration, you can set -@code{gnus-always-force-window-configuration} to non-@code{nil}. - -If you're using tree displays (@pxref{Tree Display}), and the tree -window is displayed vertically next to another window, you may also want -to fiddle with @code{gnus-tree-minimize-window} to avoid having the -windows resized. - -@subsection Example Window Configurations - -@itemize @bullet -@item -Narrow left hand side occupied by group buffer. Right hand side split -between summary buffer (top one-sixth) and article buffer (bottom). - -@ifinfo -@example -+---+---------+ -| G | Summary | -| r +---------+ -| o | | -| u | Article | -| p | | -+---+---------+ -@end example -@end ifinfo - -@lisp -(gnus-add-configuration - '(article - (horizontal 1.0 - (vertical 25 (group 1.0)) - (vertical 1.0 - (summary 0.16 point) - (article 1.0))))) - -(gnus-add-configuration - '(summary - (horizontal 1.0 - (vertical 25 (group 1.0)) - (vertical 1.0 (summary 1.0 point))))) -@end lisp - -@end itemize - - -@node Faces and Fonts -@section Faces and Fonts -@cindex faces -@cindex fonts -@cindex colors - -Fiddling with fonts and faces used to be very difficult, but these days -it is very simple. You simply say @kbd{M-x customize-face}, pick out -the face you want to alter, and alter it via the standard Customize -interface. - - -@node Compilation -@section Compilation -@cindex compilation -@cindex byte-compilation - -@findex gnus-compile - -Remember all those line format specification variables? -@code{gnus-summary-line-format}, @code{gnus-group-line-format}, and so -on. Now, Gnus will of course heed whatever these variables are, but, -unfortunately, changing them will mean a quite significant slow-down. -(The default values of these variables have byte-compiled functions -associated with them, while the user-generated versions do not, of -course.) - -To help with this, you can run @kbd{M-x gnus-compile} after you've -fiddled around with the variables and feel that you're (kind of) -satisfied. This will result in the new specs being byte-compiled, and -you'll get top speed again. Gnus will save these compiled specs in the -@file{.newsrc.eld} file. (User-defined functions aren't compiled by -this function, though---you should compile them yourself by sticking -them into the @file{~/.gnus.el} file and byte-compiling that file.) - - -@node Mode Lines -@section Mode Lines -@cindex mode lines - -@vindex gnus-updated-mode-lines -@code{gnus-updated-mode-lines} says what buffers should keep their mode -lines updated. It is a list of symbols. Supported symbols include -@code{group}, @code{article}, @code{summary}, @code{server}, -@code{browse}, and @code{tree}. If the corresponding symbol is present, -Gnus will keep that mode line updated with information that may be -pertinent. If this variable is @code{nil}, screen refresh may be -quicker. - -@cindex display-time - -@vindex gnus-mode-non-string-length -By default, Gnus displays information on the current article in the mode -lines of the summary and article buffers. The information Gnus wishes -to display (e.g. the subject of the article) is often longer than the -mode lines, and therefore have to be cut off at some point. The -@code{gnus-mode-non-string-length} variable says how long the other -elements on the line is (i.e., the non-info part). If you put -additional elements on the mode line (e.g. a clock), you should modify -this variable: - -@c Hook written by Francesco Potorti` <pot@cnuce.cnr.it> -@lisp -(add-hook 'display-time-hook - (lambda () (setq gnus-mode-non-string-length - (+ 21 - (if line-number-mode 5 0) - (if column-number-mode 4 0) - (length display-time-string))))) -@end lisp - -If this variable is @code{nil} (which is the default), the mode line -strings won't be chopped off, and they won't be padded either. Note -that the default is unlikely to be desirable, as even the percentage -complete in the buffer may be crowded off the mode line; the user should -configure this variable appropriately for her configuration. - - -@node Highlighting and Menus -@section Highlighting and Menus -@cindex visual -@cindex highlighting -@cindex menus - -@vindex gnus-visual -The @code{gnus-visual} variable controls most of the Gnus-prettifying -aspects. If @code{nil}, Gnus won't attempt to create menus or use fancy -colors or fonts. This will also inhibit loading the @file{gnus-vis.el} -file. - -This variable can be a list of visual properties that are enabled. The -following elements are valid, and are all included by default: - -@table @code -@item group-highlight -Do highlights in the group buffer. -@item summary-highlight -Do highlights in the summary buffer. -@item article-highlight -Do highlights in the article buffer. -@item highlight -Turn on highlighting in all buffers. -@item group-menu -Create menus in the group buffer. -@item summary-menu -Create menus in the summary buffers. -@item article-menu -Create menus in the article buffer. -@item browse-menu -Create menus in the browse buffer. -@item server-menu -Create menus in the server buffer. -@item score-menu -Create menus in the score buffers. -@item menu -Create menus in all buffers. -@end table - -So if you only want highlighting in the article buffer and menus in all -buffers, you could say something like: - -@lisp -(setq gnus-visual '(article-highlight menu)) -@end lisp - -If you want highlighting only and no menus whatsoever, you'd say: - -@lisp -(setq gnus-visual '(highlight)) -@end lisp - -If @code{gnus-visual} is @code{t}, highlighting and menus will be used -in all Gnus buffers. - -Other general variables that influence the look of all buffers include: - -@table @code -@item gnus-mouse-face -@vindex gnus-mouse-face -This is the face (i.e., font) used for mouse highlighting in Gnus. No -mouse highlights will be done if @code{gnus-visual} is @code{nil}. - -@end table - -There are hooks associated with the creation of all the different menus: - -@table @code - -@item gnus-article-menu-hook -@vindex gnus-article-menu-hook -Hook called after creating the article mode menu. - -@item gnus-group-menu-hook -@vindex gnus-group-menu-hook -Hook called after creating the group mode menu. - -@item gnus-summary-menu-hook -@vindex gnus-summary-menu-hook -Hook called after creating the summary mode menu. - -@item gnus-server-menu-hook -@vindex gnus-server-menu-hook -Hook called after creating the server mode menu. - -@item gnus-browse-menu-hook -@vindex gnus-browse-menu-hook -Hook called after creating the browse mode menu. - -@item gnus-score-menu-hook -@vindex gnus-score-menu-hook -Hook called after creating the score mode menu. - -@end table - - -@node Buttons -@section Buttons -@cindex buttons -@cindex mouse -@cindex click - -Those new-fangled @dfn{mouse} contraptions is very popular with the -young, hep kids who don't want to learn the proper way to do things -these days. Why, I remember way back in the summer of '89, when I was -using Emacs on a Tops 20 system. Three hundred users on one single -machine, and every user was running Simula compilers. Bah! - -Right. - -@vindex gnus-carpal -Well, you can make Gnus display bufferfuls of buttons you can click to -do anything by setting @code{gnus-carpal} to @code{t}. Pretty simple, -really. Tell the chiropractor I sent you. - - -@table @code - -@item gnus-carpal-mode-hook -@vindex gnus-carpal-mode-hook -Hook run in all carpal mode buffers. - -@item gnus-carpal-button-face -@vindex gnus-carpal-button-face -Face used on buttons. - -@item gnus-carpal-header-face -@vindex gnus-carpal-header-face -Face used on carpal buffer headers. - -@item gnus-carpal-group-buffer-buttons -@vindex gnus-carpal-group-buffer-buttons -Buttons in the group buffer. - -@item gnus-carpal-summary-buffer-buttons -@vindex gnus-carpal-summary-buffer-buttons -Buttons in the summary buffer. - -@item gnus-carpal-server-buffer-buttons -@vindex gnus-carpal-server-buffer-buttons -Buttons in the server buffer. - -@item gnus-carpal-browse-buffer-buttons -@vindex gnus-carpal-browse-buffer-buttons -Buttons in the browse buffer. -@end table - -All the @code{buttons} variables are lists. The elements in these list -are either cons cells where the @code{car} contains a text to be displayed and -the @code{cdr} contains a function symbol, or a simple string. - - -@node Daemons -@section Daemons -@cindex demons -@cindex daemons - -Gnus, being larger than any program ever written (allegedly), does lots -of strange stuff that you may wish to have done while you're not -present. For instance, you may want it to check for new mail once in a -while. Or you may want it to close down all connections to all servers -when you leave Emacs idle. And stuff like that. - -Gnus will let you do stuff like that by defining various -@dfn{handlers}. Each handler consists of three elements: A -@var{function}, a @var{time}, and an @var{idle} parameter. - -Here's an example of a handler that closes connections when Emacs has -been idle for thirty minutes: - -@lisp -(gnus-demon-close-connections nil 30) -@end lisp - -Here's a handler that scans for @acronym{PGP} headers every hour when -Emacs is idle: - -@lisp -(gnus-demon-scan-pgp 60 t) -@end lisp - -This @var{time} parameter and that @var{idle} parameter work together -in a strange, but wonderful fashion. Basically, if @var{idle} is -@code{nil}, then the function will be called every @var{time} minutes. - -If @var{idle} is @code{t}, then the function will be called after -@var{time} minutes only if Emacs is idle. So if Emacs is never idle, -the function will never be called. But once Emacs goes idle, the -function will be called every @var{time} minutes. - -If @var{idle} is a number and @var{time} is a number, the function will -be called every @var{time} minutes only when Emacs has been idle for -@var{idle} minutes. - -If @var{idle} is a number and @var{time} is @code{nil}, the function -will be called once every time Emacs has been idle for @var{idle} -minutes. - -And if @var{time} is a string, it should look like @samp{07:31}, and -the function will then be called once every day somewhere near that -time. Modified by the @var{idle} parameter, of course. - -@vindex gnus-demon-timestep -(When I say ``minute'' here, I really mean @code{gnus-demon-timestep} -seconds. This is 60 by default. If you change that variable, -all the timings in the handlers will be affected.) - -So, if you want to add a handler, you could put something like this in -your @file{~/.gnus.el} file: - -@findex gnus-demon-add-handler -@lisp -(gnus-demon-add-handler 'gnus-demon-close-connections 30 t) -@end lisp - -@findex gnus-demon-add-nocem -@findex gnus-demon-add-scanmail -@findex gnus-demon-add-rescan -@findex gnus-demon-add-scan-timestamps -@findex gnus-demon-add-disconnection -Some ready-made functions to do this have been created: -@code{gnus-demon-add-nocem}, @code{gnus-demon-add-disconnection}, -@code{gnus-demon-add-nntp-close-connection}, -@code{gnus-demon-add-scan-timestamps}, @code{gnus-demon-add-rescan}, and -@code{gnus-demon-add-scanmail}. Just put those functions in your -@file{~/.gnus.el} if you want those abilities. - -@findex gnus-demon-init -@findex gnus-demon-cancel -@vindex gnus-demon-handlers -If you add handlers to @code{gnus-demon-handlers} directly, you should -run @code{gnus-demon-init} to make the changes take hold. To cancel all -daemons, you can use the @code{gnus-demon-cancel} function. - -Note that adding daemons can be pretty naughty if you over do it. Adding -functions that scan all news and mail from all servers every two seconds -is a sure-fire way of getting booted off any respectable system. So -behave. - - -@node NoCeM -@section NoCeM -@cindex nocem -@cindex spam - -@dfn{Spamming} is posting the same article lots and lots of times. -Spamming is bad. Spamming is evil. - -Spamming is usually canceled within a day or so by various anti-spamming -agencies. These agencies usually also send out @dfn{NoCeM} messages. -NoCeM is pronounced ``no see-'em'', and means what the name -implies---these are messages that make the offending articles, like, go -away. - -What use are these NoCeM messages if the articles are canceled anyway? -Some sites do not honor cancel messages and some sites just honor cancels -from a select few people. Then you may wish to make use of the NoCeM -messages, which are distributed in the @samp{alt.nocem.misc} newsgroup. - -Gnus can read and parse the messages in this group automatically, and -this will make spam disappear. - -There are some variables to customize, of course: - -@table @code -@item gnus-use-nocem -@vindex gnus-use-nocem -Set this variable to @code{t} to set the ball rolling. It is @code{nil} -by default. - -You can also set this variable to a positive number as a group level. -In that case, Gnus scans NoCeM messages when checking new news if this -value is not exceeding a group level that you specify as the prefix -argument to some commands, e.g. @code{gnus}, -@code{gnus-group-get-new-news}, etc. Otherwise, Gnus does not scan -NoCeM messages if you specify a group level to those commands. For -example, if you use 1 or 2 on the mail groups and the levels on the news -groups remain the default, 3 is the best choice. - -@item gnus-nocem-groups -@vindex gnus-nocem-groups -Gnus will look for NoCeM messages in the groups in this list. The -default is -@lisp -("news.lists.filters" "news.admin.net-abuse.bulletins" - "alt.nocem.misc" "news.admin.net-abuse.announce") -@end lisp - -@item gnus-nocem-issuers -@vindex gnus-nocem-issuers -There are many people issuing NoCeM messages. This list says what -people you want to listen to. The default is -@lisp -("Automoose-1" "clewis@@ferret.ocunix.on.ca" - "cosmo.roadkill" "SpamHippo" "hweede@@snafu.de") -@end lisp -fine, upstanding citizens all of them. - -Known despammers that you can put in this list are listed at@* -@uref{http://www.xs4all.nl/~rosalind/nocemreg/nocemreg.html}. - -You do not have to heed NoCeM messages from all these people---just the -ones you want to listen to. You also don't have to accept all NoCeM -messages from the people you like. Each NoCeM message has a @dfn{type} -header that gives the message a (more or less, usually less) rigorous -definition. Common types are @samp{spam}, @samp{spew}, @samp{mmf}, -@samp{binary}, and @samp{troll}. To specify this, you have to use -@code{(@var{issuer} @var{conditions} @dots{})} elements in the list. -Each condition is either a string (which is a regexp that matches types -you want to use) or a list on the form @code{(not @var{string})}, where -@var{string} is a regexp that matches types you don't want to use. - -For instance, if you want all NoCeM messages from Chris Lewis except his -@samp{troll} messages, you'd say: - -@lisp -("clewis@@ferret.ocunix.on.ca" ".*" (not "troll")) -@end lisp - -On the other hand, if you just want nothing but his @samp{spam} and -@samp{spew} messages, you'd say: - -@lisp -("clewis@@ferret.ocunix.on.ca" (not ".*") "spew" "spam") -@end lisp - -The specs are applied left-to-right. - - -@item gnus-nocem-verifyer -@vindex gnus-nocem-verifyer -@findex pgg-verify -This should be a function for verifying that the NoCeM issuer is who she -says she is. The default is @code{pgg-verify}, which returns -non-@code{nil} if the verification is successful, otherwise (including -the case the NoCeM message was not signed) returns @code{nil}. If this -is too slow and you don't care for verification (which may be dangerous), -you can set this variable to @code{nil}. - -Formerly the default was @code{mc-verify}, which is a Mailcrypt -function. While you can still use it, you can change it into -@code{pgg-verify} running with GnuPG if you are willing to add the -@acronym{PGP} public keys to GnuPG's keyring. - -@item gnus-nocem-directory -@vindex gnus-nocem-directory -This is where Gnus will store its NoCeM cache files. The default is@* -@file{~/News/NoCeM/}. - -@item gnus-nocem-expiry-wait -@vindex gnus-nocem-expiry-wait -The number of days before removing old NoCeM entries from the cache. -The default is 15. If you make it shorter Gnus will be faster, but you -might then see old spam. - -@item gnus-nocem-check-from -@vindex gnus-nocem-check-from -Non-@code{nil} means check for valid issuers in message bodies. -Otherwise don't bother fetching articles unless their author matches a -valid issuer; that is much faster if you are selective about the -issuers. - -@item gnus-nocem-check-article-limit -@vindex gnus-nocem-check-article-limit -If non-@code{nil}, the maximum number of articles to check in any NoCeM -group. NoCeM groups can be huge and very slow to process. - -@end table - -Using NoCeM could potentially be a memory hog. If you have many living -(i. e., subscribed or unsubscribed groups), your Emacs process will grow -big. If this is a problem, you should kill off all (or most) of your -unsubscribed groups (@pxref{Subscription Commands}). - - -@node Undo -@section Undo -@cindex undo - -It is very useful to be able to undo actions one has done. In normal -Emacs buffers, it's easy enough---you just push the @code{undo} button. -In Gnus buffers, however, it isn't that simple. - -The things Gnus displays in its buffer is of no value whatsoever to -Gnus---it's all just data designed to look nice to the user. -Killing a group in the group buffer with @kbd{C-k} makes the line -disappear, but that's just a side-effect of the real action---the -removal of the group in question from the internal Gnus structures. -Undoing something like that can't be done by the normal Emacs -@code{undo} function. - -Gnus tries to remedy this somewhat by keeping track of what the user -does and coming up with actions that would reverse the actions the user -takes. When the user then presses the @code{undo} key, Gnus will run -the code to reverse the previous action, or the previous actions. -However, not all actions are easily reversible, so Gnus currently offers -a few key functions to be undoable. These include killing groups, -yanking groups, and changing the list of read articles of groups. -That's it, really. More functions may be added in the future, but each -added function means an increase in data to be stored, so Gnus will -never be totally undoable. - -@findex gnus-undo-mode -@vindex gnus-use-undo -@findex gnus-undo -The undoability is provided by the @code{gnus-undo-mode} minor mode. It -is used if @code{gnus-use-undo} is non-@code{nil}, which is the -default. The @kbd{C-M-_} key performs the @code{gnus-undo} -command, which should feel kinda like the normal Emacs @code{undo} -command. - - -@node Predicate Specifiers -@section Predicate Specifiers -@cindex predicate specifiers - -Some Gnus variables are @dfn{predicate specifiers}. This is a special -form that allows flexible specification of predicates without having -to type all that much. - -These specifiers are lists consisting of functions, symbols and lists. - -Here's an example: - -@lisp -(or gnus-article-unseen-p - gnus-article-unread-p) -@end lisp - -The available symbols are @code{or}, @code{and} and @code{not}. The -functions all take one parameter. - -@findex gnus-make-predicate -Internally, Gnus calls @code{gnus-make-predicate} on these specifiers -to create a function that can be called. This input parameter to this -function will be passed along to all the functions in the predicate -specifier. - - -@node Moderation -@section Moderation -@cindex moderation - -If you are a moderator, you can use the @file{gnus-mdrtn.el} package. -It is not included in the standard Gnus package. Write a mail to -@samp{larsi@@gnus.org} and state what group you moderate, and you'll -get a copy. - -The moderation package is implemented as a minor mode for summary -buffers. Put - -@lisp -(add-hook 'gnus-summary-mode-hook 'gnus-moderate) -@end lisp - -in your @file{~/.gnus.el} file. - -If you are the moderator of @samp{rec.zoofle}, this is how it's -supposed to work: - -@enumerate -@item -You split your incoming mail by matching on -@samp{Newsgroups:.*rec.zoofle}, which will put all the to-be-posted -articles in some mail group---for instance, @samp{nnml:rec.zoofle}. - -@item -You enter that group once in a while and post articles using the @kbd{e} -(edit-and-post) or @kbd{s} (just send unedited) commands. - -@item -If, while reading the @samp{rec.zoofle} newsgroup, you happen upon some -articles that weren't approved by you, you can cancel them with the -@kbd{c} command. -@end enumerate - -To use moderation mode in these two groups, say: - -@lisp -(setq gnus-moderated-list - "^nnml:rec.zoofle$\\|^rec.zoofle$") -@end lisp - - -@node Fetching a Group -@section Fetching a Group -@cindex fetching a group - -@findex gnus-fetch-group -It is sometimes convenient to be able to just say ``I want to read this -group and I don't care whether Gnus has been started or not''. This is -perhaps more useful for people who write code than for users, but the -command @code{gnus-fetch-group} provides this functionality in any case. -It takes the group name as a parameter. - - -@node Image Enhancements -@section Image Enhancements - -XEmacs, as well as Emacs 21@footnote{Emacs 21 on MS Windows doesn't -support images, Emacs 22 does.} and up, are able to display pictures and -stuff, so Gnus has taken advantage of that. - -@menu -* X-Face:: Display a funky, teensy black-and-white image. -* Face:: Display a funkier, teensier colored image. -* Smileys:: Show all those happy faces the way they were meant to be shown. -* Picons:: How to display pictures of what you're reading. -* XVarious:: Other XEmacsy Gnusey variables. -@end menu - - -@node X-Face -@subsection X-Face -@cindex x-face - -@code{X-Face} headers describe a 48x48 pixel black-and-white (1 bit -depth) image that's supposed to represent the author of the message. -It seems to be supported by an ever-growing number of mail and news -readers. - -@cindex x-face -@findex gnus-article-display-x-face -@vindex gnus-article-x-face-command -@vindex gnus-article-x-face-too-ugly -@iftex -@iflatex -\include{xface} -@end iflatex -@end iftex -@c @anchor{X-Face} - -Viewing an @code{X-Face} header either requires an Emacs that has -@samp{compface} support (which most XEmacs versions has), or that you -have suitable conversion or display programs installed. If your Emacs -has image support the default action is to display the face before the -@code{From} header. If there's no native @code{X-Face} support, Gnus -will try to convert the @code{X-Face} header using external programs -from the @code{pbmplus} package and friends, see below. For XEmacs it's -faster if XEmacs has been compiled with @code{X-Face} support. The -default action under Emacs without image support is to fork off the -@code{display} program. - -On a GNU/Linux system, the @code{display} program is included in the -ImageMagick package. For external conversion programs look for packages -with names like @code{netpbm}, @code{libgr-progs} and @code{compface}. -On Windows, you may use the packages @code{netpbm} and @code{compface} -from @url{http://gnuwin32.sourceforge.net}. You need to add the -@code{bin} directory to your @code{PATH} environment variable. -@c In fact only the following DLLs and binaries seem to be required: -@c compface1.dll uncompface.exe libnetpbm10.dll icontopbm.exe - -The variable @code{gnus-article-x-face-command} controls which programs -are used to display the @code{X-Face} header. If this variable is a -string, this string will be executed in a sub-shell. If it is a -function, this function will be called with the face as the argument. -If @code{gnus-article-x-face-too-ugly} (which is a regexp) matches the -@code{From} header, the face will not be shown. - -(Note: @code{x-face} is used in the variable/function names, not -@code{xface}). - -@noindent -Face and variable: - -@table @code -@item gnus-x-face -@vindex gnus-x-face -Face to show X-Face. The colors from this face are used as the -foreground and background colors of the displayed X-Faces. The -default colors are black and white. -@end table - -If you use posting styles, you can use an @code{x-face-file} entry in -@code{gnus-posting-styles}, @xref{Posting Styles}. If you don't, Gnus -provides a few convenience functions and variables to allow easier -insertion of X-Face headers in outgoing messages. You also need the -above mentioned ImageMagick, netpbm or other image conversion packages -(depending the values of the variables below) for these functions. - -@findex gnus-random-x-face -@vindex gnus-convert-pbm-to-x-face-command -@vindex gnus-x-face-directory -@code{gnus-random-x-face} goes through all the @samp{pbm} files in -@code{gnus-x-face-directory} and picks one at random, and then -converts it to the X-Face format by using the -@code{gnus-convert-pbm-to-x-face-command} shell command. The -@samp{pbm} files should be 48x48 pixels big. It returns the X-Face -header data as a string. - -@findex gnus-insert-random-x-face-header -@code{gnus-insert-random-x-face-header} calls -@code{gnus-random-x-face} and inserts a @samp{X-Face} header with the -randomly generated data. - -@findex gnus-x-face-from-file -@vindex gnus-convert-image-to-x-face-command -@code{gnus-x-face-from-file} takes a GIF file as the parameter, and then -converts the file to X-Face format by using the -@code{gnus-convert-image-to-x-face-command} shell command. - -Here's how you would typically use the first function. Put something -like the following in your @file{~/.gnus.el} file: - -@lisp -(setq message-required-news-headers - (nconc message-required-news-headers - (list '(X-Face . gnus-random-x-face)))) -@end lisp - -Using the last function would be something like this: - -@lisp -(setq message-required-news-headers - (nconc message-required-news-headers - (list '(X-Face . (lambda () - (gnus-x-face-from-file - "~/My-face.gif")))))) -@end lisp - - -@node Face -@subsection Face -@cindex face - -@c #### FIXME: faces and x-faces' implementations should really be harmonized. - -@code{Face} headers are essentially a funkier version of @code{X-Face} -ones. They describe a 48x48 pixel colored image that's supposed to -represent the author of the message. - -@cindex face -@findex gnus-article-display-face -The contents of a @code{Face} header must be a base64 encoded PNG image. -See @uref{http://quimby.gnus.org/circus/face/} for the precise -specifications. - -Viewing an @code{Face} header requires an Emacs that is able to display -PNG images. -@c Maybe add this: -@c (if (featurep 'xemacs) -@c (featurep 'png) -@c (image-type-available-p 'png)) - -Gnus provides a few convenience functions and variables to allow -easier insertion of Face headers in outgoing messages. - -@findex gnus-convert-png-to-face -@code{gnus-convert-png-to-face} takes a 48x48 PNG image, no longer than -726 bytes long, and converts it to a face. - -@findex gnus-face-from-file -@vindex gnus-convert-image-to-face-command -@code{gnus-face-from-file} takes a JPEG file as the parameter, and then -converts the file to Face format by using the -@code{gnus-convert-image-to-face-command} shell command. - -Here's how you would typically use this function. Put something like the -following in your @file{~/.gnus.el} file: - -@lisp -(setq message-required-news-headers - (nconc message-required-news-headers - (list '(Face . (lambda () - (gnus-face-from-file "~/face.jpg")))))) -@end lisp - - -@node Smileys -@subsection Smileys -@cindex smileys - -@iftex -@iflatex -\gnusfig{-3cm}{0.5cm}{\epsfig{figure=ps/BigFace,height=20cm}} -\input{smiley} -@end iflatex -@end iftex - -@dfn{Smiley} is a package separate from Gnus, but since Gnus is -currently the only package that uses Smiley, it is documented here. - -In short---to use Smiley in Gnus, put the following in your -@file{~/.gnus.el} file: - -@lisp -(setq gnus-treat-display-smileys t) -@end lisp - -Smiley maps text smiley faces---@samp{:-)}, @samp{8-)}, @samp{:-(} and -the like---to pictures and displays those instead of the text smiley -faces. The conversion is controlled by a list of regexps that matches -text and maps that to file names. - -@vindex smiley-regexp-alist -The alist used is specified by the @code{smiley-regexp-alist} -variable. The first item in each element is the regexp to be matched; -the second element is the regexp match group that is to be replaced by -the picture; and the third element is the name of the file to be -displayed. - -The following variables customize where Smiley will look for these -files: - -@table @code - -@item smiley-data-directory -@vindex smiley-data-directory -Where Smiley will look for smiley faces files. - -@item gnus-smiley-file-types -@vindex gnus-smiley-file-types -List of suffixes on smiley file names to try. - -@end table - - -@node Picons -@subsection Picons - -@iftex -@iflatex -\include{picons} -@end iflatex -@end iftex - -So@dots{} You want to slow down your news reader even more! This is a -good way to do so. It's also a great way to impress people staring -over your shoulder as you read news. - -What are Picons? To quote directly from the Picons Web site: - -@iftex -@iflatex -\margindex{} -@end iflatex -@end iftex - -@quotation -@dfn{Picons} is short for ``personal icons''. They're small, -constrained images used to represent users and domains on the net, -organized into databases so that the appropriate image for a given -e-mail address can be found. Besides users and domains, there are picon -databases for Usenet newsgroups and weather forecasts. The picons are -in either monochrome @code{XBM} format or color @code{XPM} and -@code{GIF} formats. -@end quotation - -@vindex gnus-picon-databases -For instructions on obtaining and installing the picons databases, -point your Web browser at -@uref{http://www.cs.indiana.edu/picons/ftp/index.html}. - -If you are using Debian GNU/Linux, saying @samp{apt-get install -picons.*} will install the picons where Gnus can find them. - -To enable displaying picons, simply make sure that -@code{gnus-picon-databases} points to the directory containing the -Picons databases. - -The following variables offer control over where things are located. - -@table @code - -@item gnus-picon-databases -@vindex gnus-picon-databases -The location of the picons database. This is a list of directories -containing the @file{news}, @file{domains}, @file{users} (and so on) -subdirectories. Defaults to @code{("/usr/lib/picon" -"/usr/local/faces")}. - -@item gnus-picon-news-directories -@vindex gnus-picon-news-directories -List of subdirectories to search in @code{gnus-picon-databases} for -newsgroups faces. @code{("news")} is the default. - -@item gnus-picon-user-directories -@vindex gnus-picon-user-directories -List of subdirectories to search in @code{gnus-picon-databases} for user -faces. @code{("users" "usenix" "local" "misc")} is the default. - -@item gnus-picon-domain-directories -@vindex gnus-picon-domain-directories -List of subdirectories to search in @code{gnus-picon-databases} for -domain name faces. Defaults to @code{("domains")}. Some people may -want to add @samp{"unknown"} to this list. - -@item gnus-picon-file-types -@vindex gnus-picon-file-types -Ordered list of suffixes on picon file names to try. Defaults to -@code{("xpm" "gif" "xbm")} minus those not built-in your Emacs. - -@end table - - -@node XVarious -@subsection Various XEmacs Variables - -@table @code -@item gnus-xmas-glyph-directory -@vindex gnus-xmas-glyph-directory -This is where Gnus will look for pictures. Gnus will normally -auto-detect this directory, but you may set it manually if you have an -unusual directory structure. - -@item gnus-xmas-modeline-glyph -@vindex gnus-xmas-modeline-glyph -A glyph displayed in all Gnus mode lines. It is a tiny gnu head by -default. - -@end table - -@subsubsection Toolbar - -@table @code - -@item gnus-use-toolbar -@vindex gnus-use-toolbar -This variable specifies the position to display the toolbar. If -@code{nil}, don't display toolbars. If it is non-@code{nil}, it should -be one of the symbols @code{default}, @code{top}, @code{bottom}, -@code{right}, and @code{left}. @code{default} means to use the default -toolbar, the rest mean to display the toolbar on the place which those -names show. The default is @code{default}. - -@item gnus-toolbar-thickness -@vindex gnus-toolbar-thickness -Cons of the height and the width specifying the thickness of a toolbar. -The height is used for the toolbar displayed on the top or the bottom, -the width is used for the toolbar displayed on the right or the left. -The default is that of the default toolbar. - -@item gnus-group-toolbar -@vindex gnus-group-toolbar -The toolbar in the group buffer. - -@item gnus-summary-toolbar -@vindex gnus-summary-toolbar -The toolbar in the summary buffer. - -@item gnus-summary-mail-toolbar -@vindex gnus-summary-mail-toolbar -The toolbar in the summary buffer of mail groups. - -@end table - -@iftex -@iflatex -\margindex{} -@end iflatex -@end iftex - - -@node Fuzzy Matching -@section Fuzzy Matching -@cindex fuzzy matching - -Gnus provides @dfn{fuzzy matching} of @code{Subject} lines when doing -things like scoring, thread gathering and thread comparison. - -As opposed to regular expression matching, fuzzy matching is very fuzzy. -It's so fuzzy that there's not even a definition of what @dfn{fuzziness} -means, and the implementation has changed over time. - -Basically, it tries to remove all noise from lines before comparing. -@samp{Re: }, parenthetical remarks, white space, and so on, are filtered -out of the strings before comparing the results. This often leads to -adequate results---even when faced with strings generated by text -manglers masquerading as newsreaders. - - -@node Thwarting Email Spam -@section Thwarting Email Spam -@cindex email spam -@cindex spam -@cindex UCE -@cindex unsolicited commercial email - -In these last days of the Usenet, commercial vultures are hanging about -and grepping through news like crazy to find email addresses they can -foist off their scams and products to. As a reaction to this, many -people have started putting nonsense addresses into their @code{From} -lines. I think this is counterproductive---it makes it difficult for -people to send you legitimate mail in response to things you write, as -well as making it difficult to see who wrote what. This rewriting may -perhaps be a bigger menace than the unsolicited commercial email itself -in the end. - -The biggest problem I have with email spam is that it comes in under -false pretenses. I press @kbd{g} and Gnus merrily informs me that I -have 10 new emails. I say ``Golly gee! Happy is me!'' and select the -mail group, only to find two pyramid schemes, seven advertisements -(``New! Miracle tonic for growing full, lustrous hair on your toes!'') -and one mail asking me to repent and find some god. - -This is annoying. Here's what you can do about it. - -@menu -* The problem of spam:: Some background, and some solutions -* Anti-Spam Basics:: Simple steps to reduce the amount of spam. -* SpamAssassin:: How to use external anti-spam tools. -* Hashcash:: Reduce spam by burning CPU time. -@end menu - -@node The problem of spam -@subsection The problem of spam -@cindex email spam -@cindex spam filtering approaches -@cindex filtering approaches, spam -@cindex UCE -@cindex unsolicited commercial email - -First, some background on spam. - -If you have access to e-mail, you are familiar with spam (technically -termed @acronym{UCE}, Unsolicited Commercial E-mail). Simply put, it -exists because e-mail delivery is very cheap compared to paper mail, -so only a very small percentage of people need to respond to an UCE to -make it worthwhile to the advertiser. Ironically, one of the most -common spams is the one offering a database of e-mail addresses for -further spamming. Senders of spam are usually called @emph{spammers}, -but terms like @emph{vermin}, @emph{scum}, @emph{sociopaths}, and -@emph{morons} are in common use as well. - -Spam comes from a wide variety of sources. It is simply impossible to -dispose of all spam without discarding useful messages. A good -example is the TMDA system, which requires senders -unknown to you to confirm themselves as legitimate senders before -their e-mail can reach you. Without getting into the technical side -of TMDA, a downside is clearly that e-mail from legitimate sources may -be discarded if those sources can't or won't confirm themselves -through the TMDA system. Another problem with TMDA is that it -requires its users to have a basic understanding of e-mail delivery -and processing. - -The simplest approach to filtering spam is filtering, at the mail -server or when you sort through incoming mail. If you get 200 spam -messages per day from @samp{random-address@@vmadmin.com}, you block -@samp{vmadmin.com}. If you get 200 messages about @samp{VIAGRA}, you -discard all messages with @samp{VIAGRA} in the message. If you get -lots of spam from Bulgaria, for example, you try to filter all mail -from Bulgarian IPs. - -This, unfortunately, is a great way to discard legitimate e-mail. The -risks of blocking a whole country (Bulgaria, Norway, Nigeria, China, -etc.) or even a continent (Asia, Africa, Europe, etc.) from contacting -you should be obvious, so don't do it if you have the choice. - -In another instance, the very informative and useful RISKS digest has -been blocked by overzealous mail filters because it @strong{contained} -words that were common in spam messages. Nevertheless, in isolated -cases, with great care, direct filtering of mail can be useful. - -Another approach to filtering e-mail is the distributed spam -processing, for instance DCC implements such a system. In essence, -@var{N} systems around the world agree that a machine @var{X} in -Ghana, Estonia, or California is sending out spam e-mail, and these -@var{N} systems enter @var{X} or the spam e-mail from @var{X} into a -database. The criteria for spam detection vary---it may be the number -of messages sent, the content of the messages, and so on. When a user -of the distributed processing system wants to find out if a message is -spam, he consults one of those @var{N} systems. - -Distributed spam processing works very well against spammers that send -a large number of messages at once, but it requires the user to set up -fairly complicated checks. There are commercial and free distributed -spam processing systems. Distributed spam processing has its risks as -well. For instance legitimate e-mail senders have been accused of -sending spam, and their web sites and mailing lists have been shut -down for some time because of the incident. - -The statistical approach to spam filtering is also popular. It is -based on a statistical analysis of previous spam messages. Usually -the analysis is a simple word frequency count, with perhaps pairs of -words or 3-word combinations thrown into the mix. Statistical -analysis of spam works very well in most of the cases, but it can -classify legitimate e-mail as spam in some cases. It takes time to -run the analysis, the full message must be analyzed, and the user has -to store the database of spam analysis. Statistical analysis on the -server is gaining popularity. This has the advantage of letting the -user Just Read Mail, but has the disadvantage that it's harder to tell -the server that it has misclassified mail. - -Fighting spam is not easy, no matter what anyone says. There is no -magic switch that will distinguish Viagra ads from Mom's e-mails. -Even people are having a hard time telling spam apart from non-spam, -because spammers are actively looking to fool us into thinking they -are Mom, essentially. Spamming is irritating, irresponsible, and -idiotic behavior from a bunch of people who think the world owes them -a favor. We hope the following sections will help you in fighting the -spam plague. - -@node Anti-Spam Basics -@subsection Anti-Spam Basics -@cindex email spam -@cindex spam -@cindex UCE -@cindex unsolicited commercial email - -One way of dealing with spam is having Gnus split out all spam into a -@samp{spam} mail group (@pxref{Splitting Mail}). - -First, pick one (1) valid mail address that you can be reached at, and -put it in your @code{From} header of all your news articles. (I've -chosen @samp{larsi@@trym.ifi.uio.no}, but for many addresses on the form -@samp{larsi+usenet@@ifi.uio.no} will be a better choice. Ask your -sysadmin whether your sendmail installation accepts keywords in the local -part of the mail address.) - -@lisp -(setq message-default-news-headers - "From: Lars Magne Ingebrigtsen <larsi@@trym.ifi.uio.no>\n") -@end lisp - -Then put the following split rule in @code{nnmail-split-fancy} -(@pxref{Fancy Mail Splitting}): - -@lisp -(... - (to "larsi@@trym.ifi.uio.no" - (| ("subject" "re:.*" "misc") - ("references" ".*@@.*" "misc") - "spam")) - ...) -@end lisp - -This says that all mail to this address is suspect, but if it has a -@code{Subject} that starts with a @samp{Re:} or has a @code{References} -header, it's probably ok. All the rest goes to the @samp{spam} group. -(This idea probably comes from Tim Pierce.) - -In addition, many mail spammers talk directly to your @acronym{SMTP} server -and do not include your email address explicitly in the @code{To} -header. Why they do this is unknown---perhaps it's to thwart this -thwarting scheme? In any case, this is trivial to deal with---you just -put anything not addressed to you in the @samp{spam} group by ending -your fancy split rule in this way: - -@lisp -( - ... - (to "larsi" "misc") - "spam") -@end lisp - -In my experience, this will sort virtually everything into the right -group. You still have to check the @samp{spam} group from time to time to -check for legitimate mail, though. If you feel like being a good net -citizen, you can even send off complaints to the proper authorities on -each unsolicited commercial email---at your leisure. - -This works for me. It allows people an easy way to contact me (they can -just press @kbd{r} in the usual way), and I'm not bothered at all with -spam. It's a win-win situation. Forging @code{From} headers to point -to non-existent domains is yucky, in my opinion. - -Be careful with this approach. Spammers are wise to it. - - -@node SpamAssassin -@subsection SpamAssassin, Vipul's Razor, DCC, etc -@cindex SpamAssassin -@cindex Vipul's Razor -@cindex DCC - -The days where the hints in the previous section were sufficient in -avoiding spam are coming to an end. There are many tools out there -that claim to reduce the amount of spam you get. This section could -easily become outdated fast, as new products replace old, but -fortunately most of these tools seem to have similar interfaces. Even -though this section will use SpamAssassin as an example, it should be -easy to adapt it to most other tools. - -Note that this section does not involve the @code{spam.el} package, -which is discussed in the next section. If you don't care for all -the features of @code{spam.el}, you can make do with these simple -recipes. - -If the tool you are using is not installed on the mail server, you -need to invoke it yourself. Ideas on how to use the -@code{:postscript} mail source parameter (@pxref{Mail Source -Specifiers}) follow. - -@lisp -(setq mail-sources - '((file :prescript "formail -bs spamassassin < /var/mail/%u") - (pop :user "jrl" - :server "pophost" - :postscript - "mv %t /tmp/foo; formail -bs spamc < /tmp/foo > %t"))) -@end lisp - -Once you manage to process your incoming spool somehow, thus making -the mail contain e.g.@: a header indicating it is spam, you are ready to -filter it out. Using normal split methods (@pxref{Splitting Mail}): - -@lisp -(setq nnmail-split-methods '(("spam" "^X-Spam-Flag: YES") - ...)) -@end lisp - -Or using fancy split methods (@pxref{Fancy Mail Splitting}): - -@lisp -(setq nnmail-split-methods 'nnmail-split-fancy - nnmail-split-fancy '(| ("X-Spam-Flag" "YES" "spam") - ...)) -@end lisp - -Some people might not like the idea of piping the mail through various -programs using a @code{:prescript} (if some program is buggy, you -might lose all mail). If you are one of them, another solution is to -call the external tools during splitting. Example fancy split method: - -@lisp -(setq nnmail-split-fancy '(| (: kevin-spamassassin) - ...)) -(defun kevin-spamassassin () - (save-excursion - (save-restriction - (widen) - (if (eq 1 (call-process-region (point-min) (point-max) - "spamc" nil nil nil "-c")) - "spam")))) -@end lisp - -Note that with the nnimap backend, message bodies will not be -downloaded by default. You need to set -@code{nnimap-split-download-body} to @code{t} to do that -(@pxref{Splitting in IMAP}). - -That is about it. As some spam is likely to get through anyway, you -might want to have a nifty function to call when you happen to read -spam. And here is the nifty function: - -@lisp - (defun my-gnus-raze-spam () - "Submit SPAM to Vipul's Razor, then mark it as expirable." - (interactive) - (gnus-summary-show-raw-article) - (gnus-summary-save-in-pipe "razor-report -f -d") - (gnus-summary-mark-as-expirable 1)) -@end lisp - -@node Hashcash -@subsection Hashcash -@cindex hashcash - -A novel technique to fight spam is to require senders to do something -costly for each message they send. This has the obvious drawback that -you cannot rely on everyone in the world using this technique, -since it is not part of the Internet standards, but it may be useful -in smaller communities. - -While the tools in the previous section work well in practice, they -work only because the tools are constantly maintained and updated as -new form of spam appears. This means that a small percentage of spam -will always get through. It also means that somewhere, someone needs -to read lots of spam to update these tools. Hashcash avoids that, but -instead prefers that everyone you contact through e-mail supports the -scheme. You can view the two approaches as pragmatic vs dogmatic. -The approaches have their own advantages and disadvantages, but as -often in the real world, a combination of them is stronger than either -one of them separately. - -@cindex X-Hashcash -The ``something costly'' is to burn CPU time, more specifically to -compute a hash collision up to a certain number of bits. The -resulting hashcash cookie is inserted in a @samp{X-Hashcash:} -header. For more details, and for the external application -@code{hashcash} you need to install to use this feature, see -@uref{http://www.cypherspace.org/~adam/hashcash/}. Even more -information can be found at @uref{http://www.camram.org/}. - -If you wish to call hashcash for each message you send, say something -like: - -@lisp -(require 'hashcash) -(add-hook 'message-send-hook 'mail-add-payment) -@end lisp - -The @file{hashcash.el} library can be found in the Gnus development -contrib directory or at -@uref{http://users.actrix.gen.nz/mycroft/hashcash.el}. - -You will need to set up some additional variables as well: - -@table @code - -@item hashcash-default-payment -@vindex hashcash-default-payment -This variable indicates the default number of bits the hash collision -should consist of. By default this is 0, meaning nothing will be -done. Suggested useful values include 17 to 29. - -@item hashcash-payment-alist -@vindex hashcash-payment-alist -Some receivers may require you to spend burn more CPU time than the -default. This variable contains a list of @samp{(@var{addr} -@var{amount})} cells, where @var{addr} is the receiver (email address -or newsgroup) and @var{amount} is the number of bits in the collision -that is needed. It can also contain @samp{(@var{addr} @var{string} -@var{amount})} cells, where the @var{string} is the string to use -(normally the email address or newsgroup name is used). - -@item hashcash -@vindex hashcash -Where the @code{hashcash} binary is installed. - -@end table - -Currently there is no built in functionality in Gnus to verify -hashcash cookies, it is expected that this is performed by your hand -customized mail filtering scripts. Improvements in this area would be -a useful contribution, however. - -@node Spam Package -@section Spam Package -@cindex spam filtering -@cindex spam - -The Spam package provides Gnus with a centralized mechanism for -detecting and filtering spam. It filters new mail, and processes -messages according to whether they are spam or ham. (@dfn{Ham} is the -name used throughout this manual to indicate non-spam messages.) - -@menu -* Spam Package Introduction:: -* Filtering Incoming Mail:: -* Detecting Spam in Groups:: -* Spam and Ham Processors:: -* Spam Package Configuration Examples:: -* Spam Back Ends:: -* Extending the Spam package:: -* Spam Statistics Package:: -@end menu - -@node Spam Package Introduction -@subsection Spam Package Introduction -@cindex spam filtering -@cindex spam filtering sequence of events -@cindex spam - -You must read this section to understand how the Spam package works. -Do not skip, speed-read, or glance through this section. - -@cindex spam-initialize -@vindex spam-use-stat -To use the Spam package, you @strong{must} first run the function -@code{spam-initialize}: - -@example -(spam-initialize) -@end example - -This autoloads @code{spam.el} and installs the various hooks necessary -to let the Spam package do its job. In order to make use of the Spam -package, you have to set up certain group parameters and variables, -which we will describe below. All of the variables controlling the -Spam package can be found in the @samp{spam} customization group. - -There are two ``contact points'' between the Spam package and the rest -of Gnus: checking new mail for spam, and leaving a group. - -Checking new mail for spam is done in one of two ways: while splitting -incoming mail, or when you enter a group. - -The first way, checking for spam while splitting incoming mail, is -suited to mail back ends such as @code{nnml} or @code{nnimap}, where -new mail appears in a single spool file. The Spam package processes -incoming mail, and sends mail considered to be spam to a designated -``spam'' group. @xref{Filtering Incoming Mail}. - -The second way is suited to back ends such as @code{nntp}, which have -no incoming mail spool, or back ends where the server is in charge of -splitting incoming mail. In this case, when you enter a Gnus group, -the unseen or unread messages in that group are checked for spam. -Detected spam messages are marked as spam. @xref{Detecting Spam in -Groups}. - -@cindex spam back ends -In either case, you have to tell the Spam package what method to use -to detect spam messages. There are several methods, or @dfn{spam back -ends} (not to be confused with Gnus back ends!) to choose from: spam -``blacklists'' and ``whitelists'', dictionary-based filters, and so -forth. @xref{Spam Back Ends}. - -In the Gnus summary buffer, messages that have been identified as spam -always appear with a @samp{$} symbol. - -The Spam package divides Gnus groups into three categories: ham -groups, spam groups, and unclassified groups. You should mark each of -the groups you subscribe to as either a ham group or a spam group, -using the @code{spam-contents} group parameter (@pxref{Group -Parameters}). Spam groups have a special property: when you enter a -spam group, all unseen articles are marked as spam. Thus, mail split -into a spam group is automatically marked as spam. - -Identifying spam messages is only half of the Spam package's job. The -second half comes into play whenever you exit a group buffer. At this -point, the Spam package does several things: - -First, it calls @dfn{spam and ham processors} to process the articles -according to whether they are spam or ham. There is a pair of spam -and ham processors associated with each spam back end, and what the -processors do depends on the back end. At present, the main role of -spam and ham processors is for dictionary-based spam filters: they add -the contents of the messages in the group to the filter's dictionary, -to improve its ability to detect future spam. The @code{spam-process} -group parameter specifies what spam processors to use. @xref{Spam and -Ham Processors}. - -If the spam filter failed to mark a spam message, you can mark it -yourself, so that the message is processed as spam when you exit the -group: - -@table @kbd -@item M-d -@itemx M s x -@itemx S x -@kindex M-d -@kindex S x -@kindex M s x -@findex gnus-summary-mark-as-spam -@findex gnus-summary-mark-as-spam -Mark current article as spam, showing it with the @samp{$} mark -(@code{gnus-summary-mark-as-spam}). -@end table - -@noindent -Similarly, you can unmark an article if it has been erroneously marked -as spam. @xref{Setting Marks}. - -Normally, a ham message found in a non-ham group is not processed as -ham---the rationale is that it should be moved into a ham group for -further processing (see below). However, you can force these articles -to be processed as ham by setting -@code{spam-process-ham-in-spam-groups} and -@code{spam-process-ham-in-nonham-groups}. - -@vindex gnus-ham-process-destinations -@vindex gnus-spam-process-destinations -The second thing that the Spam package does when you exit a group is -to move ham articles out of spam groups, and spam articles out of ham -groups. Ham in a spam group is moved to the group specified by the -variable @code{gnus-ham-process-destinations}, or the group parameter -@code{ham-process-destination}. Spam in a ham group is moved to the -group specified by the variable @code{gnus-spam-process-destinations}, -or the group parameter @code{spam-process-destination}. If these -variables are not set, the articles are left in their current group. -If an article cannot be moved (e.g., with a read-only backend such -as @acronym{NNTP}), it is copied. - -If an article is moved to another group, it is processed again when -you visit the new group. Normally, this is not a problem, but if you -want each article to be processed only once, load the -@code{gnus-registry.el} package and set the variable -@code{spam-log-to-registry} to @code{t}. @xref{Spam Package -Configuration Examples}. - -Normally, spam groups ignore @code{gnus-spam-process-destinations}. -However, if you set @code{spam-move-spam-nonspam-groups-only} to -@code{nil}, spam will also be moved out of spam groups, depending on -the @code{spam-process-destination} parameter. - -The final thing the Spam package does is to mark spam articles as -expired, which is usually the right thing to do. - -If all this seems confusing, don't worry. Soon it will be as natural -as typing Lisp one-liners on a neural interface@dots{} err, sorry, that's -50 years in the future yet. Just trust us, it's not so bad. - -@node Filtering Incoming Mail -@subsection Filtering Incoming Mail -@cindex spam filtering -@cindex spam filtering incoming mail -@cindex spam - -To use the Spam package to filter incoming mail, you must first set up -fancy mail splitting. @xref{Fancy Mail Splitting}. The Spam package -defines a special splitting function that you can add to your fancy -split variable (either @code{nnmail-split-fancy} or -@code{nnimap-split-fancy}, depending on your mail back end): - -@example -(: spam-split) -@end example - -@vindex spam-split-group -@noindent -The @code{spam-split} function scans incoming mail according to your -chosen spam back end(s), and sends messages identified as spam to a -spam group. By default, the spam group is a group named @samp{spam}, -but you can change this by customizing @code{spam-split-group}. Make -sure the contents of @code{spam-split-group} are an unqualified group -name. For instance, in an @code{nnimap} server @samp{your-server}, -the value @samp{spam} means @samp{nnimap+your-server:spam}. The value -@samp{nnimap+server:spam} is therefore wrong---it gives the group -@samp{nnimap+your-server:nnimap+server:spam}. - -@code{spam-split} does not modify the contents of messages in any way. - -@vindex nnimap-split-download-body -Note for IMAP users: if you use the @code{spam-check-bogofilter}, -@code{spam-check-ifile}, and @code{spam-check-stat} spam back ends, -you should also set set the variable @code{nnimap-split-download-body} -to @code{t}. These spam back ends are most useful when they can -``scan'' the full message body. By default, the nnimap back end only -retrieves the message headers; @code{nnimap-split-download-body} tells -it to retrieve the message bodies as well. We don't set this by -default because it will slow @acronym{IMAP} down, and that is not an -appropriate decision to make on behalf of the user. @xref{Splitting -in IMAP}. - -You have to specify one or more spam back ends for @code{spam-split} -to use, by setting the @code{spam-use-*} variables. @xref{Spam Back -Ends}. Normally, @code{spam-split} simply uses all the spam back ends -you enabled in this way. However, you can tell @code{spam-split} to -use only some of them. Why this is useful? Suppose you are using the -@code{spam-use-regex-headers} and @code{spam-use-blackholes} spam back -ends, and the following split rule: - -@example - nnimap-split-fancy '(| - (any "ding" "ding") - (: spam-split) - ;; @r{default mailbox} - "mail") -@end example - -@noindent -The problem is that you want all ding messages to make it to the ding -folder. But that will let obvious spam (for example, spam detected by -SpamAssassin, and @code{spam-use-regex-headers}) through, when it's -sent to the ding list. On the other hand, some messages to the ding -list are from a mail server in the blackhole list, so the invocation -of @code{spam-split} can't be before the ding rule. - -The solution is to let SpamAssassin headers supersede ding rules, and -perform the other @code{spam-split} rules (including a second -invocation of the regex-headers check) after the ding rule. This is -done by passing a parameter to @code{spam-split}: - -@example -nnimap-split-fancy - '(| - ;; @r{spam detected by @code{spam-use-regex-headers} goes to @samp{regex-spam}} - (: spam-split "regex-spam" 'spam-use-regex-headers) - (any "ding" "ding") - ;; @r{all other spam detected by spam-split goes to @code{spam-split-group}} - (: spam-split) - ;; @r{default mailbox} - "mail") -@end example - -@noindent -This lets you invoke specific @code{spam-split} checks depending on -your particular needs, and target the results of those checks to a -particular spam group. You don't have to throw all mail into all the -spam tests. Another reason why this is nice is that messages to -mailing lists you have rules for don't have to have resource-intensive -blackhole checks performed on them. You could also specify different -spam checks for your nnmail split vs. your nnimap split. Go crazy. - -You should set the @code{spam-use-*} variables for whatever spam back -ends you intend to use. The reason is that when loading -@file{spam.el}, some conditional loading is done depending on what -@code{spam-use-xyz} variables you have set. @xref{Spam Back Ends}. - -@c @emph{TODO: spam.el needs to provide a uniform way of training all the -@c statistical databases. Some have that functionality built-in, others -@c don't.} - -@node Detecting Spam in Groups -@subsection Detecting Spam in Groups - -To detect spam when visiting a group, set the group's -@code{spam-autodetect} and @code{spam-autodetect-methods} group -parameters. These are accessible with @kbd{G c} or @kbd{G p}, as -usual (@pxref{Group Parameters}). - -You should set the @code{spam-use-*} variables for whatever spam back -ends you intend to use. The reason is that when loading -@file{spam.el}, some conditional loading is done depending on what -@code{spam-use-xyz} variables you have set. - -By default, only unseen articles are processed for spam. You can -force Gnus to recheck all messages in the group by setting the -variable @code{spam-autodetect-recheck-messages} to @code{t}. - -If you use the @code{spam-autodetect} method of checking for spam, you -can specify different spam detection methods for different groups. -For instance, the @samp{ding} group may have @code{spam-use-BBDB} as -the autodetection method, while the @samp{suspect} group may have the -@code{spam-use-blacklist} and @code{spam-use-bogofilter} methods -enabled. Unlike with @code{spam-split}, you don't have any control -over the @emph{sequence} of checks, but this is probably unimportant. - -@node Spam and Ham Processors -@subsection Spam and Ham Processors -@cindex spam filtering -@cindex spam filtering variables -@cindex spam variables -@cindex spam - -@vindex gnus-spam-process-newsgroups -Spam and ham processors specify special actions to take when you exit -a group buffer. Spam processors act on spam messages, and ham -processors on ham messages. At present, the main role of these -processors is to update the dictionaries of dictionary-based spam back -ends such as Bogofilter (@pxref{Bogofilter}) and the Spam Statistics -package (@pxref{Spam Statistics Filtering}). - -The spam and ham processors that apply to each group are determined by -the group's@code{spam-process} group parameter. If this group -parameter is not defined, they are determined by the variable -@code{gnus-spam-process-newsgroups}. - -@vindex gnus-spam-newsgroup-contents -Gnus learns from the spam you get. You have to collect your spam in -one or more spam groups, and set or customize the variable -@code{spam-junk-mailgroups} as appropriate. You can also declare -groups to contain spam by setting their group parameter -@code{spam-contents} to @code{gnus-group-spam-classification-spam}, or -by customizing the corresponding variable -@code{gnus-spam-newsgroup-contents}. The @code{spam-contents} group -parameter and the @code{gnus-spam-newsgroup-contents} variable can -also be used to declare groups as @emph{ham} groups if you set their -classification to @code{gnus-group-spam-classification-ham}. If -groups are not classified by means of @code{spam-junk-mailgroups}, -@code{spam-contents}, or @code{gnus-spam-newsgroup-contents}, they are -considered @emph{unclassified}. All groups are unclassified by -default. - -@vindex gnus-spam-mark -@cindex $ -In spam groups, all messages are considered to be spam by default: -they get the @samp{$} mark (@code{gnus-spam-mark}) when you enter the -group. If you have seen a message, had it marked as spam, then -unmarked it, it won't be marked as spam when you enter the group -thereafter. You can disable that behavior, so all unread messages -will get the @samp{$} mark, if you set the -@code{spam-mark-only-unseen-as-spam} parameter to @code{nil}. You -should remove the @samp{$} mark when you are in the group summary -buffer for every message that is not spam after all. To remove the -@samp{$} mark, you can use @kbd{M-u} to ``unread'' the article, or -@kbd{d} for declaring it read the non-spam way. When you leave a -group, all spam-marked (@samp{$}) articles are sent to a spam -processor which will study them as spam samples. - -Messages may also be deleted in various other ways, and unless -@code{ham-marks} group parameter gets overridden below, marks @samp{R} -and @samp{r} for default read or explicit delete, marks @samp{X} and -@samp{K} for automatic or explicit kills, as well as mark @samp{Y} for -low scores, are all considered to be associated with articles which -are not spam. This assumption might be false, in particular if you -use kill files or score files as means for detecting genuine spam, you -should then adjust the @code{ham-marks} group parameter. - -@defvar ham-marks -You can customize this group or topic parameter to be the list of -marks you want to consider ham. By default, the list contains the -deleted, read, killed, kill-filed, and low-score marks (the idea is -that these articles have been read, but are not spam). It can be -useful to also include the tick mark in the ham marks. It is not -recommended to make the unread mark a ham mark, because it normally -indicates a lack of classification. But you can do it, and we'll be -happy for you. -@end defvar - -@defvar spam-marks -You can customize this group or topic parameter to be the list of -marks you want to consider spam. By default, the list contains only -the spam mark. It is not recommended to change that, but you can if -you really want to. -@end defvar - -When you leave @emph{any} group, regardless of its -@code{spam-contents} classification, all spam-marked articles are sent -to a spam processor, which will study these as spam samples. If you -explicit kill a lot, you might sometimes end up with articles marked -@samp{K} which you never saw, and which might accidentally contain -spam. Best is to make sure that real spam is marked with @samp{$}, -and nothing else. - -@vindex gnus-ham-process-destinations -When you leave a @emph{spam} group, all spam-marked articles are -marked as expired after processing with the spam processor. This is -not done for @emph{unclassified} or @emph{ham} groups. Also, any -@strong{ham} articles in a spam group will be moved to a location -determined by either the @code{ham-process-destination} group -parameter or a match in the @code{gnus-ham-process-destinations} -variable, which is a list of regular expressions matched with group -names (it's easiest to customize this variable with @kbd{M-x -customize-variable @key{RET} gnus-ham-process-destinations}). Each -group name list is a standard Lisp list, if you prefer to customize -the variable manually. If the @code{ham-process-destination} -parameter is not set, ham articles are left in place. If the -@code{spam-mark-ham-unread-before-move-from-spam-group} parameter is -set, the ham articles are marked as unread before being moved. - -If ham can not be moved---because of a read-only backend such as -@acronym{NNTP}, for example, it will be copied. - -Note that you can use multiples destinations per group or regular -expression! This enables you to send your ham to a regular mail -group and to a @emph{ham training} group. - -When you leave a @emph{ham} group, all ham-marked articles are sent to -a ham processor, which will study these as non-spam samples. - -@vindex spam-process-ham-in-spam-groups -By default the variable @code{spam-process-ham-in-spam-groups} is -@code{nil}. Set it to @code{t} if you want ham found in spam groups -to be processed. Normally this is not done, you are expected instead -to send your ham to a ham group and process it there. - -@vindex spam-process-ham-in-nonham-groups -By default the variable @code{spam-process-ham-in-nonham-groups} is -@code{nil}. Set it to @code{t} if you want ham found in non-ham (spam -or unclassified) groups to be processed. Normally this is not done, -you are expected instead to send your ham to a ham group and process -it there. - -@vindex gnus-spam-process-destinations -When you leave a @emph{ham} or @emph{unclassified} group, all -@strong{spam} articles are moved to a location determined by either -the @code{spam-process-destination} group parameter or a match in the -@code{gnus-spam-process-destinations} variable, which is a list of -regular expressions matched with group names (it's easiest to -customize this variable with @kbd{M-x customize-variable @key{RET} -gnus-spam-process-destinations}). Each group name list is a standard -Lisp list, if you prefer to customize the variable manually. If the -@code{spam-process-destination} parameter is not set, the spam -articles are only expired. The group name is fully qualified, meaning -that if you see @samp{nntp:servername} before the group name in the -group buffer then you need it here as well. - -If spam can not be moved---because of a read-only backend such as -@acronym{NNTP}, for example, it will be copied. - -Note that you can use multiples destinations per group or regular -expression! This enables you to send your spam to multiple @emph{spam -training} groups. - -@vindex spam-log-to-registry -The problem with processing ham and spam is that Gnus doesn't track -this processing by default. Enable the @code{spam-log-to-registry} -variable so @code{spam.el} will use @code{gnus-registry.el} to track -what articles have been processed, and avoid processing articles -multiple times. Keep in mind that if you limit the number of registry -entries, this won't work as well as it does without a limit. - -@vindex spam-mark-only-unseen-as-spam -Set this variable if you want only unseen articles in spam groups to -be marked as spam. By default, it is set. If you set it to -@code{nil}, unread articles will also be marked as spam. - -@vindex spam-mark-ham-unread-before-move-from-spam-group -Set this variable if you want ham to be unmarked before it is moved -out of the spam group. This is very useful when you use something -like the tick mark @samp{!} to mark ham---the article will be placed -in your @code{ham-process-destination}, unmarked as if it came fresh -from the mail server. - -@vindex spam-autodetect-recheck-messages -When autodetecting spam, this variable tells @code{spam.el} whether -only unseen articles or all unread articles should be checked for -spam. It is recommended that you leave it off. - -@node Spam Package Configuration Examples -@subsection Spam Package Configuration Examples -@cindex spam filtering -@cindex spam filtering configuration examples -@cindex spam configuration examples -@cindex spam - -@subsubheading Ted's setup - -From Ted Zlatanov <tzz@@lifelogs.com>. -@example -;; @r{for @code{gnus-registry-split-fancy-with-parent} and spam autodetection} -;; @r{see @file{gnus-registry.el} for more information} -(gnus-registry-initialize) -(spam-initialize) - -(setq - spam-log-to-registry t ; @r{for spam autodetection} - spam-use-BBDB t - spam-use-regex-headers t ; @r{catch X-Spam-Flag (SpamAssassin)} - ;; @r{all groups with @samp{spam} in the name contain spam} - gnus-spam-newsgroup-contents - '(("spam" gnus-group-spam-classification-spam)) - ;; @r{see documentation for these} - spam-move-spam-nonspam-groups-only nil - spam-mark-only-unseen-as-spam t - spam-mark-ham-unread-before-move-from-spam-group t - nnimap-split-rule 'nnimap-split-fancy - ;; @r{understand what this does before you copy it to your own setup!} - nnimap-split-fancy '(| - ;; @r{trace references to parents and put in their group} - (: gnus-registry-split-fancy-with-parent) - ;; @r{this will catch server-side SpamAssassin tags} - (: spam-split 'spam-use-regex-headers) - (any "ding" "ding") - ;; @r{note that spam by default will go to @samp{spam}} - (: spam-split) - ;; @r{default mailbox} - "mail")) - -;; @r{my parameters, set with @kbd{G p}} - -;; @r{all nnml groups, and all nnimap groups except} -;; @r{@samp{nnimap+mail.lifelogs.com:train} and} -;; @r{@samp{nnimap+mail.lifelogs.com:spam}: any spam goes to nnimap training,} -;; @r{because it must have been detected manually} - -((spam-process-destination . "nnimap+mail.lifelogs.com:train")) - -;; @r{all @acronym{NNTP} groups} -;; @r{autodetect spam with the blacklist and ham with the BBDB} -((spam-autodetect-methods spam-use-blacklist spam-use-BBDB) -;; @r{send all spam to the training group} - (spam-process-destination . "nnimap+mail.lifelogs.com:train")) - -;; @r{only some @acronym{NNTP} groups, where I want to autodetect spam} -((spam-autodetect . t)) - -;; @r{my nnimap @samp{nnimap+mail.lifelogs.com:spam} group} - -;; @r{this is a spam group} -((spam-contents gnus-group-spam-classification-spam) - - ;; @r{any spam (which happens when I enter for all unseen messages,} - ;; @r{because of the @code{gnus-spam-newsgroup-contents} setting above), goes to} - ;; @r{@samp{nnimap+mail.lifelogs.com:train} unless I mark it as ham} - - (spam-process-destination "nnimap+mail.lifelogs.com:train") - - ;; @r{any ham goes to my @samp{nnimap+mail.lifelogs.com:mail} folder, but} - ;; @r{also to my @samp{nnimap+mail.lifelogs.com:trainham} folder for training} - - (ham-process-destination "nnimap+mail.lifelogs.com:mail" - "nnimap+mail.lifelogs.com:trainham") - ;; @r{in this group, only @samp{!} marks are ham} - (ham-marks - (gnus-ticked-mark)) - ;; @r{remembers senders in the blacklist on the way out---this is} - ;; @r{definitely not needed, it just makes me feel better} - (spam-process (gnus-group-spam-exit-processor-blacklist))) - -;; @r{Later, on the @acronym{IMAP} server I use the @samp{train} group for training} -;; @r{SpamAssassin to recognize spam, and the @samp{trainham} group fora} -;; @r{recognizing ham---but Gnus has nothing to do with it.} - -@end example - -@subsubheading Using @file{spam.el} on an IMAP server with a statistical filter on the server -From Reiner Steib <reiner.steib@@gmx.de>. - -My provider has set up bogofilter (in combination with @acronym{DCC}) on -the mail server (@acronym{IMAP}). Recognized spam goes to -@samp{spam.detected}, the rest goes through the normal filter rules, -i.e. to @samp{some.folder} or to @samp{INBOX}. Training on false -positives or negatives is done by copying or moving the article to -@samp{training.ham} or @samp{training.spam} respectively. A cron job on -the server feeds those to bogofilter with the suitable ham or spam -options and deletes them from the @samp{training.ham} and -@samp{training.spam} folders. - -With the following entries in @code{gnus-parameters}, @code{spam.el} -does most of the job for me: - -@lisp - ("nnimap:spam\\.detected" - (gnus-article-sort-functions '(gnus-article-sort-by-chars)) - (ham-process-destination "nnimap:INBOX" "nnimap:training.ham") - (spam-contents gnus-group-spam-classification-spam)) - ("nnimap:\\(INBOX\\|other-folders\\)" - (spam-process-destination . "nnimap:training.spam") - (spam-contents gnus-group-spam-classification-ham)) -@end lisp - -@itemize - -@item @b{The Spam folder:} - -In the folder @samp{spam.detected}, I have to check for false positives -(i.e. legitimate mails, that were wrongly judged as spam by -bogofilter or DCC). - -Because of the @code{gnus-group-spam-classification-spam} entry, all -messages are marked as spam (with @code{$}). When I find a false -positive, I mark the message with some other ham mark -(@code{ham-marks}, @ref{Spam and Ham Processors}). On group exit, -those messages are copied to both groups, @samp{INBOX} (where I want -to have the article) and @samp{training.ham} (for training bogofilter) -and deleted from the @samp{spam.detected} folder. - -The @code{gnus-article-sort-by-chars} entry simplifies detection of -false positives for me. I receive lots of worms (sweN, @dots{}), that all -have a similar size. Grouping them by size (i.e. chars) makes finding -other false positives easier. (Of course worms aren't @i{spam} -(@acronym{UCE}, @acronym{UBE}) strictly speaking. Anyhow, bogofilter is -an excellent tool for filtering those unwanted mails for me.) - -@item @b{Ham folders:} - -In my ham folders, I just hit @kbd{S x} -(@code{gnus-summary-mark-as-spam}) whenever I see an unrecognized spam -mail (false negative). On group exit, those messages are moved to -@samp{training.ham}. -@end itemize - -@subsubheading Reporting spam articles in Gmane groups with @code{spam-report.el} - -From Reiner Steib <reiner.steib@@gmx.de>. - -With following entry in @code{gnus-parameters}, @kbd{S x} -(@code{gnus-summary-mark-as-spam}) marks articles in @code{gmane.*} -groups as spam and reports the to Gmane at group exit: - -@lisp - ("^gmane\\." - (spam-process (gnus-group-spam-exit-processor-report-gmane))) -@end lisp - -Additionally, I use @code{(setq spam-report-gmane-use-article-number nil)} -because I don't read the groups directly from news.gmane.org, but -through my local news server (leafnode). I.e. the article numbers are -not the same as on news.gmane.org, thus @code{spam-report.el} has to check -the @code{X-Report-Spam} header to find the correct number. - -@node Spam Back Ends -@subsection Spam Back Ends -@cindex spam back ends - -The spam package offers a variety of back ends for detecting spam. -Each back end defines a set of methods for detecting spam -(@pxref{Filtering Incoming Mail}, @pxref{Detecting Spam in Groups}), -and a pair of spam and ham processors (@pxref{Spam and Ham -Processors}). - -@menu -* Blacklists and Whitelists:: -* BBDB Whitelists:: -* Gmane Spam Reporting:: -* Anti-spam Hashcash Payments:: -* Blackholes:: -* Regular Expressions Header Matching:: -* Bogofilter:: -* ifile spam filtering:: -* Spam Statistics Filtering:: -* SpamOracle:: -@end menu - -@node Blacklists and Whitelists -@subsubsection Blacklists and Whitelists -@cindex spam filtering -@cindex whitelists, spam filtering -@cindex blacklists, spam filtering -@cindex spam - -@defvar spam-use-blacklist - -Set this variable to @code{t} if you want to use blacklists when -splitting incoming mail. Messages whose senders are in the blacklist -will be sent to the @code{spam-split-group}. This is an explicit -filter, meaning that it acts only on mail senders @emph{declared} to -be spammers. - -@end defvar - -@defvar spam-use-whitelist - -Set this variable to @code{t} if you want to use whitelists when -splitting incoming mail. Messages whose senders are not in the -whitelist will be sent to the next spam-split rule. This is an -explicit filter, meaning that unless someone is in the whitelist, their -messages are not assumed to be spam or ham. - -@end defvar - -@defvar spam-use-whitelist-exclusive - -Set this variable to @code{t} if you want to use whitelists as an -implicit filter, meaning that every message will be considered spam -unless the sender is in the whitelist. Use with care. - -@end defvar - -@defvar gnus-group-spam-exit-processor-blacklist - -Add this symbol to a group's @code{spam-process} parameter by -customizing the group parameters or the -@code{gnus-spam-process-newsgroups} variable. When this symbol is -added to a group's @code{spam-process} parameter, the senders of -spam-marked articles will be added to the blacklist. - -@emph{WARNING} - -Instead of the obsolete -@code{gnus-group-spam-exit-processor-blacklist}, it is recommended -that you use @code{'(spam spam-use-blacklist)}. Everything will work -the same way, we promise. - -@end defvar - -@defvar gnus-group-ham-exit-processor-whitelist - -Add this symbol to a group's @code{spam-process} parameter by -customizing the group parameters or the -@code{gnus-spam-process-newsgroups} variable. When this symbol is -added to a group's @code{spam-process} parameter, the senders of -ham-marked articles in @emph{ham} groups will be added to the -whitelist. Note that this ham processor has no effect in @emph{spam} -or @emph{unclassified} groups. - -@emph{WARNING} - -Instead of the obsolete -@code{gnus-group-ham-exit-processor-whitelist}, it is recommended -that you use @code{'(ham spam-use-whitelist)}. Everything will work -the same way, we promise. - -@end defvar - -Blacklists are lists of regular expressions matching addresses you -consider to be spam senders. For instance, to block mail from any -sender at @samp{vmadmin.com}, you can put @samp{vmadmin.com} in your -blacklist. You start out with an empty blacklist. Blacklist entries -use the Emacs regular expression syntax. - -Conversely, whitelists tell Gnus what addresses are considered -legitimate. All messages from whitelisted addresses are considered -non-spam. Also see @ref{BBDB Whitelists}. Whitelist entries use the -Emacs regular expression syntax. - -The blacklist and whitelist file locations can be customized with the -@code{spam-directory} variable (@file{~/News/spam} by default), or -the @code{spam-whitelist} and @code{spam-blacklist} variables -directly. The whitelist and blacklist files will by default be in the -@code{spam-directory} directory, named @file{whitelist} and -@file{blacklist} respectively. - -@node BBDB Whitelists -@subsubsection BBDB Whitelists -@cindex spam filtering -@cindex BBDB whitelists, spam filtering -@cindex BBDB, spam filtering -@cindex spam - -@defvar spam-use-BBDB - -Analogous to @code{spam-use-whitelist} (@pxref{Blacklists and -Whitelists}), but uses the BBDB as the source of whitelisted -addresses, without regular expressions. You must have the BBDB loaded -for @code{spam-use-BBDB} to work properly. Messages whose senders are -not in the BBDB will be sent to the next spam-split rule. This is an -explicit filter, meaning that unless someone is in the BBDB, their -messages are not assumed to be spam or ham. - -@end defvar - -@defvar spam-use-BBDB-exclusive - -Set this variable to @code{t} if you want to use the BBDB as an -implicit filter, meaning that every message will be considered spam -unless the sender is in the BBDB. Use with care. Only sender -addresses in the BBDB will be allowed through; all others will be -classified as spammers. - -@end defvar - -@defvar gnus-group-ham-exit-processor-BBDB - -Add this symbol to a group's @code{spam-process} parameter by -customizing the group parameters or the -@code{gnus-spam-process-newsgroups} variable. When this symbol is -added to a group's @code{spam-process} parameter, the senders of -ham-marked articles in @emph{ham} groups will be added to the -BBDB. Note that this ham processor has no effect in @emph{spam} -or @emph{unclassified} groups. - -@emph{WARNING} - -Instead of the obsolete -@code{gnus-group-ham-exit-processor-BBDB}, it is recommended -that you use @code{'(ham spam-use-BBDB)}. Everything will work -the same way, we promise. - -@end defvar - -@node Gmane Spam Reporting -@subsubsection Gmane Spam Reporting -@cindex spam reporting -@cindex Gmane, spam reporting -@cindex Gmane, spam reporting -@cindex spam - -@defvar gnus-group-spam-exit-processor-report-gmane - -Add this symbol to a group's @code{spam-process} parameter by -customizing the group parameters or the -@code{gnus-spam-process-newsgroups} variable. When this symbol is -added to a group's @code{spam-process} parameter, the spam-marked -articles groups will be reported to the Gmane administrators via a -HTTP request. - -Gmane can be found at @uref{http://gmane.org}. - -@emph{WARNING} - -Instead of the obsolete -@code{gnus-group-spam-exit-processor-report-gmane}, it is recommended -that you use @code{'(spam spam-use-gmane)}. Everything will work the -same way, we promise. - -@end defvar - -@defvar spam-report-gmane-use-article-number - -This variable is @code{t} by default. Set it to @code{nil} if you are -running your own news server, for instance, and the local article -numbers don't correspond to the Gmane article numbers. When -@code{spam-report-gmane-use-article-number} is @code{nil}, -@code{spam-report.el} will use the @code{X-Report-Spam} header that -Gmane provides. - -@end defvar - -@node Anti-spam Hashcash Payments -@subsubsection Anti-spam Hashcash Payments -@cindex spam filtering -@cindex hashcash, spam filtering -@cindex spam - -@defvar spam-use-hashcash - -Similar to @code{spam-use-whitelist} (@pxref{Blacklists and -Whitelists}), but uses hashcash tokens for whitelisting messages -instead of the sender address. You must have the @code{hashcash.el} -package loaded for @code{spam-use-hashcash} to work properly. -Messages without a hashcash payment token will be sent to the next -spam-split rule. This is an explicit filter, meaning that unless a -hashcash token is found, the messages are not assumed to be spam or -ham. - -@end defvar - -@node Blackholes -@subsubsection Blackholes -@cindex spam filtering -@cindex blackholes, spam filtering -@cindex spam - -@defvar spam-use-blackholes - -This option is disabled by default. You can let Gnus consult the -blackhole-type distributed spam processing systems (DCC, for instance) -when you set this option. The variable @code{spam-blackhole-servers} -holds the list of blackhole servers Gnus will consult. The current -list is fairly comprehensive, but make sure to let us know if it -contains outdated servers. - -The blackhole check uses the @code{dig.el} package, but you can tell -@file{spam.el} to use @code{dns.el} instead for better performance if -you set @code{spam-use-dig} to @code{nil}. It is not recommended at -this time to set @code{spam-use-dig} to @code{nil} despite the -possible performance improvements, because some users may be unable to -use it, but you can try it and see if it works for you. - -@end defvar - -@defvar spam-blackhole-servers - -The list of servers to consult for blackhole checks. - -@end defvar - -@defvar spam-blackhole-good-server-regex - -A regular expression for IPs that should not be checked against the -blackhole server list. When set to @code{nil}, it has no effect. - -@end defvar - -@defvar spam-use-dig - -Use the @code{dig.el} package instead of the @code{dns.el} package. -The default setting of @code{t} is recommended. - -@end defvar - -Blackhole checks are done only on incoming mail. There is no spam or -ham processor for blackholes. - -@node Regular Expressions Header Matching -@subsubsection Regular Expressions Header Matching -@cindex spam filtering -@cindex regular expressions header matching, spam filtering -@cindex spam - -@defvar spam-use-regex-headers - -This option is disabled by default. You can let Gnus check the -message headers against lists of regular expressions when you set this -option. The variables @code{spam-regex-headers-spam} and -@code{spam-regex-headers-ham} hold the list of regular expressions. -Gnus will check against the message headers to determine if the -message is spam or ham, respectively. - -@end defvar - -@defvar spam-regex-headers-spam - -The list of regular expressions that, when matched in the headers of -the message, positively identify it as spam. - -@end defvar - -@defvar spam-regex-headers-ham - -The list of regular expressions that, when matched in the headers of -the message, positively identify it as ham. - -@end defvar - -Regular expression header checks are done only on incoming mail. -There is no specific spam or ham processor for regular expressions. - -@node Bogofilter -@subsubsection Bogofilter -@cindex spam filtering -@cindex bogofilter, spam filtering -@cindex spam - -@defvar spam-use-bogofilter - -Set this variable if you want @code{spam-split} to use Eric Raymond's -speedy Bogofilter. - -With a minimum of care for associating the @samp{$} mark for spam -articles only, Bogofilter training all gets fairly automatic. You -should do this until you get a few hundreds of articles in each -category, spam or not. The command @kbd{S t} in summary mode, either -for debugging or for curiosity, shows the @emph{spamicity} score of -the current article (between 0.0 and 1.0). - -Bogofilter determines if a message is spam based on a specific -threshold. That threshold can be customized, consult the Bogofilter -documentation. - -If the @code{bogofilter} executable is not in your path, Bogofilter -processing will be turned off. - -You should not enable this if you use @code{spam-use-bogofilter-headers}. - -@end defvar - -@table @kbd -@item M s t -@itemx S t -@kindex M s t -@kindex S t -@findex spam-bogofilter-score -Get the Bogofilter spamicity score (@code{spam-bogofilter-score}). -@end table - -@defvar spam-use-bogofilter-headers - -Set this variable if you want @code{spam-split} to use Eric Raymond's -speedy Bogofilter, looking only at the message headers. It works -similarly to @code{spam-use-bogofilter}, but the @code{X-Bogosity} header -must be in the message already. Normally you would do this with a -procmail recipe or something similar; consult the Bogofilter -installation documents for details. - -You should not enable this if you use @code{spam-use-bogofilter}. - -@end defvar - -@defvar gnus-group-spam-exit-processor-bogofilter -Add this symbol to a group's @code{spam-process} parameter by -customizing the group parameters or the -@code{gnus-spam-process-newsgroups} variable. When this symbol is -added to a group's @code{spam-process} parameter, spam-marked articles -will be added to the Bogofilter spam database. - -@emph{WARNING} - -Instead of the obsolete -@code{gnus-group-spam-exit-processor-bogofilter}, it is recommended -that you use @code{'(spam spam-use-bogofilter)}. Everything will work -the same way, we promise. -@end defvar - -@defvar gnus-group-ham-exit-processor-bogofilter -Add this symbol to a group's @code{spam-process} parameter by -customizing the group parameters or the -@code{gnus-spam-process-newsgroups} variable. When this symbol is -added to a group's @code{spam-process} parameter, the ham-marked -articles in @emph{ham} groups will be added to the Bogofilter database -of non-spam messages. Note that this ham processor has no effect in -@emph{spam} or @emph{unclassified} groups. - -@emph{WARNING} - -Instead of the obsolete -@code{gnus-group-ham-exit-processor-bogofilter}, it is recommended -that you use @code{'(ham spam-use-bogofilter)}. Everything will work -the same way, we promise. -@end defvar - -@defvar spam-bogofilter-database-directory - -This is the directory where Bogofilter will store its databases. It -is not specified by default, so Bogofilter will use its own default -database directory. - -@end defvar - -The Bogofilter mail classifier is similar to @command{ifile} in intent and -purpose. A ham and a spam processor are provided, plus the -@code{spam-use-bogofilter} and @code{spam-use-bogofilter-headers} -variables to indicate to spam-split that Bogofilter should either be -used, or has already been used on the article. The 0.9.2.1 version of -Bogofilter was used to test this functionality. - -@node ifile spam filtering -@subsubsection ifile spam filtering -@cindex spam filtering -@cindex ifile, spam filtering -@cindex spam - -@defvar spam-use-ifile - -Enable this variable if you want @code{spam-split} to use @command{ifile}, a -statistical analyzer similar to Bogofilter. - -@end defvar - -@defvar spam-ifile-all-categories - -Enable this variable if you want @code{spam-use-ifile} to give you all -the ifile categories, not just spam/non-spam. If you use this, make -sure you train ifile as described in its documentation. - -@end defvar - -@defvar spam-ifile-spam-category - -This is the category of spam messages as far as ifile is concerned. -The actual string used is irrelevant, but you probably want to leave -the default value of @samp{spam}. -@end defvar - -@defvar spam-ifile-database - -This is the filename for the ifile database. It is not specified by -default, so ifile will use its own default database name. - -@end defvar - -The ifile mail classifier is similar to Bogofilter in intent and -purpose. A ham and a spam processor are provided, plus the -@code{spam-use-ifile} variable to indicate to spam-split that ifile -should be used. The 1.2.1 version of ifile was used to test this -functionality. - -@node Spam Statistics Filtering -@subsubsection Spam Statistics Filtering -@cindex spam filtering -@cindex spam-stat, spam filtering -@cindex spam-stat -@cindex spam - -This back end uses the Spam Statistics Emacs Lisp package to perform -statistics-based filtering (@pxref{Spam Statistics Package}). Before -using this, you may want to perform some additional steps to -initialize your Spam Statistics dictionary. @xref{Creating a -spam-stat dictionary}. - -@defvar spam-use-stat - -@end defvar - -@defvar gnus-group-spam-exit-processor-stat -Add this symbol to a group's @code{spam-process} parameter by -customizing the group parameters or the -@code{gnus-spam-process-newsgroups} variable. When this symbol is -added to a group's @code{spam-process} parameter, the spam-marked -articles will be added to the spam-stat database of spam messages. - -@emph{WARNING} - -Instead of the obsolete -@code{gnus-group-spam-exit-processor-stat}, it is recommended -that you use @code{'(spam spam-use-stat)}. Everything will work -the same way, we promise. -@end defvar - -@defvar gnus-group-ham-exit-processor-stat -Add this symbol to a group's @code{spam-process} parameter by -customizing the group parameters or the -@code{gnus-spam-process-newsgroups} variable. When this symbol is -added to a group's @code{spam-process} parameter, the ham-marked -articles in @emph{ham} groups will be added to the spam-stat database -of non-spam messages. Note that this ham processor has no effect in -@emph{spam} or @emph{unclassified} groups. - -@emph{WARNING} - -Instead of the obsolete -@code{gnus-group-ham-exit-processor-stat}, it is recommended -that you use @code{'(ham spam-use-stat)}. Everything will work -the same way, we promise. -@end defvar - -This enables @file{spam.el} to cooperate with @file{spam-stat.el}. -@file{spam-stat.el} provides an internal (Lisp-only) spam database, -which unlike ifile or Bogofilter does not require external programs. -A spam and a ham processor, and the @code{spam-use-stat} variable for -@code{spam-split} are provided. - -@node SpamOracle -@subsubsection Using SpamOracle with Gnus -@cindex spam filtering -@cindex SpamOracle -@cindex spam - -An easy way to filter out spam is to use SpamOracle. SpamOracle is an -statistical mail filtering tool written by Xavier Leroy and needs to be -installed separately. - -There are several ways to use SpamOracle with Gnus. In all cases, your -mail is piped through SpamOracle in its @emph{mark} mode. SpamOracle will -then enter an @samp{X-Spam} header indicating whether it regards the -mail as a spam mail or not. - -One possibility is to run SpamOracle as a @code{:prescript} from the -@xref{Mail Source Specifiers}, (@pxref{SpamAssassin}). This method has -the advantage that the user can see the @emph{X-Spam} headers. - -The easiest method is to make @file{spam.el} (@pxref{Spam Package}) -call SpamOracle. - -@vindex spam-use-spamoracle -To enable SpamOracle usage by @file{spam.el}, set the variable -@code{spam-use-spamoracle} to @code{t} and configure the -@code{nnmail-split-fancy} or @code{nnimap-split-fancy}. @xref{Spam -Package}. In this example the @samp{INBOX} of an nnimap server is -filtered using SpamOracle. Mails recognized as spam mails will be -moved to @code{spam-split-group}, @samp{Junk} in this case. Ham -messages stay in @samp{INBOX}: - -@example -(setq spam-use-spamoracle t - spam-split-group "Junk" - nnimap-split-inbox '("INBOX") - nnimap-split-rule 'nnimap-split-fancy - nnimap-split-fancy '(| (: spam-split) "INBOX")) -@end example - -@defvar spam-use-spamoracle -Set to @code{t} if you want Gnus to enable spam filtering using -SpamOracle. -@end defvar - -@defvar spam-spamoracle-binary -Gnus uses the SpamOracle binary called @file{spamoracle} found in the -user's PATH. Using the variable @code{spam-spamoracle-binary}, this -can be customized. -@end defvar - -@defvar spam-spamoracle-database -By default, SpamOracle uses the file @file{~/.spamoracle.db} as a database to -store its analysis. This is controlled by the variable -@code{spam-spamoracle-database} which defaults to @code{nil}. That means -the default SpamOracle database will be used. In case you want your -database to live somewhere special, set -@code{spam-spamoracle-database} to this path. -@end defvar - -SpamOracle employs a statistical algorithm to determine whether a -message is spam or ham. In order to get good results, meaning few -false hits or misses, SpamOracle needs training. SpamOracle learns -the characteristics of your spam mails. Using the @emph{add} mode -(training mode) one has to feed good (ham) and spam mails to -SpamOracle. This can be done by pressing @kbd{|} in the Summary -buffer and pipe the mail to a SpamOracle process or using -@file{spam.el}'s spam- and ham-processors, which is much more -convenient. For a detailed description of spam- and ham-processors, -@xref{Spam Package}. - -@defvar gnus-group-spam-exit-processor-spamoracle -Add this symbol to a group's @code{spam-process} parameter by -customizing the group parameter or the -@code{gnus-spam-process-newsgroups} variable. When this symbol is added -to a group's @code{spam-process} parameter, spam-marked articles will be -sent to SpamOracle as spam samples. - -@emph{WARNING} - -Instead of the obsolete -@code{gnus-group-spam-exit-processor-spamoracle}, it is recommended -that you use @code{'(spam spam-use-spamoracle)}. Everything will work -the same way, we promise. -@end defvar - -@defvar gnus-group-ham-exit-processor-spamoracle -Add this symbol to a group's @code{spam-process} parameter by -customizing the group parameter or the -@code{gnus-spam-process-newsgroups} variable. When this symbol is added -to a group's @code{spam-process} parameter, the ham-marked articles in -@emph{ham} groups will be sent to the SpamOracle as samples of ham -messages. Note that this ham processor has no effect in @emph{spam} or -@emph{unclassified} groups. - -@emph{WARNING} - -Instead of the obsolete -@code{gnus-group-ham-exit-processor-spamoracle}, it is recommended -that you use @code{'(ham spam-use-spamoracle)}. Everything will work -the same way, we promise. -@end defvar - -@emph{Example:} These are the Group Parameters of a group that has been -classified as a ham group, meaning that it should only contain ham -messages. -@example - ((spam-contents gnus-group-spam-classification-ham) - (spam-process ((ham spam-use-spamoracle) - (spam spam-use-spamoracle)))) -@end example -For this group the @code{spam-use-spamoracle} is installed for both -ham and spam processing. If the group contains spam message -(e.g. because SpamOracle has not had enough sample messages yet) and -the user marks some messages as spam messages, these messages will be -processed by SpamOracle. The processor sends the messages to -SpamOracle as new samples for spam. - -@node Extending the Spam package -@subsection Extending the Spam package -@cindex spam filtering -@cindex spam elisp package, extending -@cindex extending the spam elisp package - -Say you want to add a new back end called blackbox. For filtering -incoming mail, provide the following: - -@enumerate - -@item -Code - -@lisp -(defvar spam-use-blackbox nil - "True if blackbox should be used.") -@end lisp - -Add -@lisp -(spam-use-blackbox . spam-check-blackbox) -@end lisp -to @code{spam-list-of-checks}. - -Add -@lisp -(gnus-group-ham-exit-processor-blackbox ham spam-use-blackbox) -(gnus-group-spam-exit-processor-blackbox spam spam-use-blackbox) -@end lisp - -to @code{spam-list-of-processors}. - -Add -@lisp -(spam-use-blackbox spam-blackbox-register-routine - nil - spam-blackbox-unregister-routine - nil) -@end lisp - -to @code{spam-registration-functions}. Write the register/unregister -routines using the bogofilter register/unregister routines as a -start, or other register/unregister routines more appropriate to -Blackbox. - -@item -Functionality - -Write the @code{spam-check-blackbox} function. It should return -@samp{nil} or @code{spam-split-group}, observing the other -conventions. See the existing @code{spam-check-*} functions for -examples of what you can do, and stick to the template unless you -fully understand the reasons why you aren't. - -Make sure to add @code{spam-use-blackbox} to -@code{spam-list-of-statistical-checks} if Blackbox is a statistical -mail analyzer that needs the full message body to operate. - -@end enumerate - -For processing spam and ham messages, provide the following: - -@enumerate - -@item -Code - -Note you don't have to provide a spam or a ham processor. Only -provide them if Blackbox supports spam or ham processing. - -Also, ham and spam processors are being phased out as single -variables. Instead the form @code{'(spam spam-use-blackbox)} or -@code{'(ham spam-use-blackbox)} is favored. For now, spam/ham -processor variables are still around but they won't be for long. - -@lisp -(defvar gnus-group-spam-exit-processor-blackbox "blackbox-spam" - "The Blackbox summary exit spam processor. -Only applicable to spam groups.") - -(defvar gnus-group-ham-exit-processor-blackbox "blackbox-ham" - "The whitelist summary exit ham processor. -Only applicable to non-spam (unclassified and ham) groups.") - -@end lisp - -@item -Gnus parameters - -Add -@lisp -(const :tag "Spam: Blackbox" (spam spam-use-blackbox)) -(const :tag "Ham: Blackbox" (ham spam-use-blackbox)) -@end lisp -to the @code{spam-process} group parameter in @code{gnus.el}. Make -sure you do it twice, once for the parameter and once for the -variable customization. - -Add -@lisp -(variable-item spam-use-blackbox) -@end lisp -to the @code{spam-autodetect-methods} group parameter in -@code{gnus.el}. - -@end enumerate - -@node Spam Statistics Package -@subsection Spam Statistics Package -@cindex Paul Graham -@cindex Graham, Paul -@cindex naive Bayesian spam filtering -@cindex Bayesian spam filtering, naive -@cindex spam filtering, naive Bayesian - -Paul Graham has written an excellent essay about spam filtering using -statistics: @uref{http://www.paulgraham.com/spam.html,A Plan for -Spam}. In it he describes the inherent deficiency of rule-based -filtering as used by SpamAssassin, for example: Somebody has to write -the rules, and everybody else has to install these rules. You are -always late. It would be much better, he argues, to filter mail based -on whether it somehow resembles spam or non-spam. One way to measure -this is word distribution. He then goes on to describe a solution -that checks whether a new mail resembles any of your other spam mails -or not. - -The basic idea is this: Create a two collections of your mail, one -with spam, one with non-spam. Count how often each word appears in -either collection, weight this by the total number of mails in the -collections, and store this information in a dictionary. For every -word in a new mail, determine its probability to belong to a spam or a -non-spam mail. Use the 15 most conspicuous words, compute the total -probability of the mail being spam. If this probability is higher -than a certain threshold, the mail is considered to be spam. - -The Spam Statistics package adds support to Gnus for this kind of -filtering. It can be used as one of the back ends of the Spam package -(@pxref{Spam Package}), or by itself. - -Before using the Spam Statistics package, you need to set it up. -First, you need two collections of your mail, one with spam, one with -non-spam. Then you need to create a dictionary using these two -collections, and save it. And last but not least, you need to use -this dictionary in your fancy mail splitting rules. - -@menu -* Creating a spam-stat dictionary:: -* Splitting mail using spam-stat:: -* Low-level interface to the spam-stat dictionary:: -@end menu - -@node Creating a spam-stat dictionary -@subsubsection Creating a spam-stat dictionary - -Before you can begin to filter spam based on statistics, you must -create these statistics based on two mail collections, one with spam, -one with non-spam. These statistics are then stored in a dictionary -for later use. In order for these statistics to be meaningful, you -need several hundred emails in both collections. - -Gnus currently supports only the nnml back end for automated dictionary -creation. The nnml back end stores all mails in a directory, one file -per mail. Use the following: - -@defun spam-stat-process-spam-directory -Create spam statistics for every file in this directory. Every file -is treated as one spam mail. -@end defun - -@defun spam-stat-process-non-spam-directory -Create non-spam statistics for every file in this directory. Every -file is treated as one non-spam mail. -@end defun - -Usually you would call @code{spam-stat-process-spam-directory} on a -directory such as @file{~/Mail/mail/spam} (this usually corresponds to -the group @samp{nnml:mail.spam}), and you would call -@code{spam-stat-process-non-spam-directory} on a directory such as -@file{~/Mail/mail/misc} (this usually corresponds to the group -@samp{nnml:mail.misc}). - -When you are using @acronym{IMAP}, you won't have the mails available -locally, so that will not work. One solution is to use the Gnus Agent -to cache the articles. Then you can use directories such as -@file{"~/News/agent/nnimap/mail.yourisp.com/personal_spam"} for -@code{spam-stat-process-spam-directory}. @xref{Agent as Cache}. - -@defvar spam-stat -This variable holds the hash-table with all the statistics---the -dictionary we have been talking about. For every word in either -collection, this hash-table stores a vector describing how often the -word appeared in spam and often it appeared in non-spam mails. -@end defvar - -If you want to regenerate the statistics from scratch, you need to -reset the dictionary. - -@defun spam-stat-reset -Reset the @code{spam-stat} hash-table, deleting all the statistics. -@end defun - -When you are done, you must save the dictionary. The dictionary may -be rather large. If you will not update the dictionary incrementally -(instead, you will recreate it once a month, for example), then you -can reduce the size of the dictionary by deleting all words that did -not appear often enough or that do not clearly belong to only spam or -only non-spam mails. - -@defun spam-stat-reduce-size -Reduce the size of the dictionary. Use this only if you do not want -to update the dictionary incrementally. -@end defun - -@defun spam-stat-save -Save the dictionary. -@end defun - -@defvar spam-stat-file -The filename used to store the dictionary. This defaults to -@file{~/.spam-stat.el}. -@end defvar - -@node Splitting mail using spam-stat -@subsubsection Splitting mail using spam-stat - -This section describes how to use the Spam statistics -@emph{independently} of the @xref{Spam Package}. - -First, add the following to your @file{~/.gnus.el} file: - -@lisp -(require 'spam-stat) -(spam-stat-load) -@end lisp - -This will load the necessary Gnus code, and the dictionary you -created. - -Next, you need to adapt your fancy splitting rules: You need to -determine how to use @code{spam-stat}. The following examples are for -the nnml back end. Using the nnimap back end works just as well. Just -use @code{nnimap-split-fancy} instead of @code{nnmail-split-fancy}. - -In the simplest case, you only have two groups, @samp{mail.misc} and -@samp{mail.spam}. The following expression says that mail is either -spam or it should go into @samp{mail.misc}. If it is spam, then -@code{spam-stat-split-fancy} will return @samp{mail.spam}. - -@lisp -(setq nnmail-split-fancy - `(| (: spam-stat-split-fancy) - "mail.misc")) -@end lisp - -@defvar spam-stat-split-fancy-spam-group -The group to use for spam. Default is @samp{mail.spam}. -@end defvar - -If you also filter mail with specific subjects into other groups, use -the following expression. Only mails not matching the regular -expression are considered potential spam. - -@lisp -(setq nnmail-split-fancy - `(| ("Subject" "\\bspam-stat\\b" "mail.emacs") - (: spam-stat-split-fancy) - "mail.misc")) -@end lisp - -If you want to filter for spam first, then you must be careful when -creating the dictionary. Note that @code{spam-stat-split-fancy} must -consider both mails in @samp{mail.emacs} and in @samp{mail.misc} as -non-spam, therefore both should be in your collection of non-spam -mails, when creating the dictionary! - -@lisp -(setq nnmail-split-fancy - `(| (: spam-stat-split-fancy) - ("Subject" "\\bspam-stat\\b" "mail.emacs") - "mail.misc")) -@end lisp - -You can combine this with traditional filtering. Here, we move all -HTML-only mails into the @samp{mail.spam.filtered} group. Note that since -@code{spam-stat-split-fancy} will never see them, the mails in -@samp{mail.spam.filtered} should be neither in your collection of spam mails, -nor in your collection of non-spam mails, when creating the -dictionary! - -@lisp -(setq nnmail-split-fancy - `(| ("Content-Type" "text/html" "mail.spam.filtered") - (: spam-stat-split-fancy) - ("Subject" "\\bspam-stat\\b" "mail.emacs") - "mail.misc")) -@end lisp - - -@node Low-level interface to the spam-stat dictionary -@subsubsection Low-level interface to the spam-stat dictionary - -The main interface to using @code{spam-stat}, are the following functions: - -@defun spam-stat-buffer-is-spam -Called in a buffer, that buffer is considered to be a new spam mail. -Use this for new mail that has not been processed before. -@end defun - -@defun spam-stat-buffer-is-no-spam -Called in a buffer, that buffer is considered to be a new non-spam -mail. Use this for new mail that has not been processed before. -@end defun - -@defun spam-stat-buffer-change-to-spam -Called in a buffer, that buffer is no longer considered to be normal -mail but spam. Use this to change the status of a mail that has -already been processed as non-spam. -@end defun - -@defun spam-stat-buffer-change-to-non-spam -Called in a buffer, that buffer is no longer considered to be spam but -normal mail. Use this to change the status of a mail that has already -been processed as spam. -@end defun - -@defun spam-stat-save -Save the hash table to the file. The filename used is stored in the -variable @code{spam-stat-file}. -@end defun - -@defun spam-stat-load -Load the hash table from a file. The filename used is stored in the -variable @code{spam-stat-file}. -@end defun - -@defun spam-stat-score-word -Return the spam score for a word. -@end defun - -@defun spam-stat-score-buffer -Return the spam score for a buffer. -@end defun - -@defun spam-stat-split-fancy -Use this function for fancy mail splitting. Add the rule @samp{(: -spam-stat-split-fancy)} to @code{nnmail-split-fancy} -@end defun - -Make sure you load the dictionary before using it. This requires the -following in your @file{~/.gnus.el} file: - -@lisp -(require 'spam-stat) -(spam-stat-load) -@end lisp - -Typical test will involve calls to the following functions: - -@smallexample -Reset: (setq spam-stat (make-hash-table :test 'equal)) -Learn spam: (spam-stat-process-spam-directory "~/Mail/mail/spam") -Learn non-spam: (spam-stat-process-non-spam-directory "~/Mail/mail/misc") -Save table: (spam-stat-save) -File size: (nth 7 (file-attributes spam-stat-file)) -Number of words: (hash-table-count spam-stat) -Test spam: (spam-stat-test-directory "~/Mail/mail/spam") -Test non-spam: (spam-stat-test-directory "~/Mail/mail/misc") -Reduce table size: (spam-stat-reduce-size) -Save table: (spam-stat-save) -File size: (nth 7 (file-attributes spam-stat-file)) -Number of words: (hash-table-count spam-stat) -Test spam: (spam-stat-test-directory "~/Mail/mail/spam") -Test non-spam: (spam-stat-test-directory "~/Mail/mail/misc") -@end smallexample - -Here is how you would create your dictionary: - -@smallexample -Reset: (setq spam-stat (make-hash-table :test 'equal)) -Learn spam: (spam-stat-process-spam-directory "~/Mail/mail/spam") -Learn non-spam: (spam-stat-process-non-spam-directory "~/Mail/mail/misc") -Repeat for any other non-spam group you need... -Reduce table size: (spam-stat-reduce-size) -Save table: (spam-stat-save) -@end smallexample - -@node Other modes -@section Interaction with other modes - -@subsection Dired -@cindex dired - -@code{gnus-dired-minor-mode} provides some useful functions for dired -buffers. It is enabled with -@lisp -(add-hook 'dired-mode-hook 'turn-on-gnus-dired-mode) -@end lisp - -@table @kbd -@item C-c C-m C-a -@findex gnus-dired-attach -@cindex attachments, selection via dired -Send dired's marked files as an attachment (@code{gnus-dired-attach}). -You will be prompted for a message buffer. - -@item C-c C-m C-l -@findex gnus-dired-find-file-mailcap -Visit a file according to the appropriate mailcap entry -(@code{gnus-dired-find-file-mailcap}). With prefix, open file in a new -buffer. - -@item C-c C-m C-p -@findex gnus-dired-print -Print file according to the mailcap entry (@code{gnus-dired-print}). If -there is no print command, print in a PostScript image. -@end table - -@node Various Various -@section Various Various -@cindex mode lines -@cindex highlights - -@table @code - -@item gnus-home-directory -@vindex gnus-home-directory -All Gnus file and directory variables will be initialized from this -variable, which defaults to @file{~/}. - -@item gnus-directory -@vindex gnus-directory -Most Gnus storage file and directory variables will be initialized from -this variable, which defaults to the @env{SAVEDIR} environment -variable, or @file{~/News/} if that variable isn't set. - -Note that Gnus is mostly loaded when the @file{~/.gnus.el} file is read. -This means that other directory variables that are initialized from this -variable won't be set properly if you set this variable in -@file{~/.gnus.el}. Set this variable in @file{.emacs} instead. - -@item gnus-default-directory -@vindex gnus-default-directory -Not related to the above variable at all---this variable says what the -default directory of all Gnus buffers should be. If you issue commands -like @kbd{C-x C-f}, the prompt you'll get starts in the current buffer's -default directory. If this variable is @code{nil} (which is the -default), the default directory will be the default directory of the -buffer you were in when you started Gnus. - -@item gnus-verbose -@vindex gnus-verbose -This variable is an integer between zero and ten. The higher the value, -the more messages will be displayed. If this variable is zero, Gnus -will never flash any messages, if it is seven (which is the default), -most important messages will be shown, and if it is ten, Gnus won't ever -shut up, but will flash so many messages it will make your head swim. - -@item gnus-verbose-backends -@vindex gnus-verbose-backends -This variable works the same way as @code{gnus-verbose}, but it applies -to the Gnus back ends instead of Gnus proper. - -@item nnheader-max-head-length -@vindex nnheader-max-head-length -When the back ends read straight heads of articles, they all try to read -as little as possible. This variable (default 8192) specifies -the absolute max length the back ends will try to read before giving up -on finding a separator line between the head and the body. If this -variable is @code{nil}, there is no upper read bound. If it is -@code{t}, the back ends won't try to read the articles piece by piece, -but read the entire articles. This makes sense with some versions of -@code{ange-ftp} or @code{efs}. - -@item nnheader-head-chop-length -@vindex nnheader-head-chop-length -This variable (default 2048) says how big a piece of each article to -read when doing the operation described above. - -@item nnheader-file-name-translation-alist -@vindex nnheader-file-name-translation-alist -@cindex file names -@cindex invalid characters in file names -@cindex characters in file names -This is an alist that says how to translate characters in file names. -For instance, if @samp{:} is invalid as a file character in file names -on your system (you OS/2 user you), you could say something like: - -@lisp -@group -(setq nnheader-file-name-translation-alist - '((?: . ?_))) -@end group -@end lisp - -In fact, this is the default value for this variable on OS/2 and MS -Windows (phooey) systems. - -@item gnus-hidden-properties -@vindex gnus-hidden-properties -This is a list of properties to use to hide ``invisible'' text. It is -@code{(invisible t intangible t)} by default on most systems, which -makes invisible text invisible and intangible. - -@item gnus-parse-headers-hook -@vindex gnus-parse-headers-hook -A hook called before parsing headers. It can be used, for instance, to -gather statistics on the headers fetched, or perhaps you'd like to prune -some headers. I don't see why you'd want that, though. - -@item gnus-shell-command-separator -@vindex gnus-shell-command-separator -String used to separate two shell commands. The default is @samp{;}. - -@item gnus-invalid-group-regexp -@vindex gnus-invalid-group-regexp - -Regexp to match ``invalid'' group names when querying user for a group -name. The default value catches some @strong{really} invalid group -names who could possibly mess up Gnus internally (like allowing -@samp{:} in a group name, which is normally used to delimit method and -group). - -@acronym{IMAP} users might want to allow @samp{/} in group names though. - - -@end table - -@node The End -@chapter The End - -Well, that's the manual---you can get on with your life now. Keep in -touch. Say hello to your cats from me. - -My @strong{ghod}---I just can't stand goodbyes. Sniffle. - -Ol' Charles Reznikoff said it pretty well, so I leave the floor to him: - -@quotation -@strong{Te Deum} - -@sp 1 -Not because of victories @* -I sing,@* -having none,@* -but for the common sunshine,@* -the breeze,@* -the largess of the spring. - -@sp 1 -Not for victory@* -but for the day's work done@* -as well as I was able;@* -not for a seat upon the dais@* -but at the common table.@* -@end quotation - - -@node Appendices -@chapter Appendices - -@menu -* XEmacs:: Requirements for installing under XEmacs. -* History:: How Gnus got where it is today. -* On Writing Manuals:: Why this is not a beginner's guide. -* Terminology:: We use really difficult, like, words here. -* Customization:: Tailoring Gnus to your needs. -* Troubleshooting:: What you might try if things do not work. -* Gnus Reference Guide:: Rilly, rilly technical stuff. -* Emacs for Heathens:: A short introduction to Emacsian terms. -* Frequently Asked Questions:: The Gnus FAQ -@end menu - - -@node XEmacs -@section XEmacs -@cindex XEmacs -@cindex installing under XEmacs - -XEmacs is distributed as a collection of packages. You should install -whatever packages the Gnus XEmacs package requires. The current -requirements are @samp{gnus}, @samp{mail-lib}, @samp{xemacs-base}, -@samp{eterm}, @samp{sh-script}, @samp{net-utils}, @samp{os-utils}, -@samp{dired}, @samp{mh-e}, @samp{sieve}, @samp{ps-print}, @samp{W3}, -@samp{pgg}, @samp{mailcrypt}, @samp{ecrypto}, and @samp{sasl}. - - -@node History -@section History - -@cindex history -@sc{gnus} was written by Masanobu @sc{Umeda}. When autumn crept up in -'94, Lars Magne Ingebrigtsen grew bored and decided to rewrite Gnus. - -If you want to investigate the person responsible for this outrage, -you can point your (feh!) web browser to -@uref{http://quimby.gnus.org/}. This is also the primary -distribution point for the new and spiffy versions of Gnus, and is -known as The Site That Destroys Newsrcs And Drives People Mad. - -During the first extended alpha period of development, the new Gnus was -called ``(ding) Gnus''. @dfn{(ding)} is, of course, short for -@dfn{ding is not Gnus}, which is a total and utter lie, but who cares? -(Besides, the ``Gnus'' in this abbreviation should probably be -pronounced ``news'' as @sc{Umeda} intended, which makes it a more -appropriate name, don't you think?) - -In any case, after spending all that energy on coming up with a new and -spunky name, we decided that the name was @emph{too} spunky, so we -renamed it back again to ``Gnus''. But in mixed case. ``Gnus'' vs. -``@sc{gnus}''. New vs. old. - -@menu -* Gnus Versions:: What Gnus versions have been released. -* Other Gnus Versions:: Other Gnus versions that also have been released. -* Why?:: What's the point of Gnus? -* Compatibility:: Just how compatible is Gnus with @sc{gnus}? -* Conformity:: Gnus tries to conform to all standards. -* Emacsen:: Gnus can be run on a few modern Emacsen. -* Gnus Development:: How Gnus is developed. -* Contributors:: Oodles of people. -* New Features:: Pointers to some of the new stuff in Gnus. -@end menu - - -@node Gnus Versions -@subsection Gnus Versions -@cindex ding Gnus -@cindex September Gnus -@cindex Red Gnus -@cindex Quassia Gnus -@cindex Pterodactyl Gnus -@cindex Oort Gnus -@cindex No Gnus -@cindex Gnus versions - -The first ``proper'' release of Gnus 5 was done in November 1995 when it -was included in the Emacs 19.30 distribution (132 (ding) Gnus releases -plus 15 Gnus 5.0 releases). - -In May 1996 the next Gnus generation (aka. ``September Gnus'' (after 99 -releases)) was released under the name ``Gnus 5.2'' (40 releases). - -On July 28th 1996 work on Red Gnus was begun, and it was released on -January 25th 1997 (after 84 releases) as ``Gnus 5.4'' (67 releases). - -On September 13th 1997, Quassia Gnus was started and lasted 37 releases. -It was released as ``Gnus 5.6'' on March 8th 1998 (46 releases). - -Gnus 5.6 begat Pterodactyl Gnus on August 29th 1998 and was released as -``Gnus 5.8'' (after 99 releases and a CVS repository) on December 3rd -1999. - -On the 26th of October 2000, Oort Gnus was begun and was released as -Gnus 5.10 on May 1st 2003 (24 releases). - -On the January 4th 2004, No Gnus was begun. - -If you happen upon a version of Gnus that has a prefixed name -- -``(ding) Gnus'', ``September Gnus'', ``Red Gnus'', ``Quassia Gnus'', -``Pterodactyl Gnus'', ``Oort Gnus'', ``No Gnus'' -- don't panic. -Don't let it know that you're frightened. Back away. Slowly. Whatever -you do, don't run. Walk away, calmly, until you're out of its reach. -Find a proper released version of Gnus and snuggle up to that instead. - - -@node Other Gnus Versions -@subsection Other Gnus Versions -@cindex Semi-gnus - -In addition to the versions of Gnus which have had their releases -coordinated by Lars, one major development has been Semi-gnus from -Japan. It's based on a library called @acronym{SEMI}, which provides -@acronym{MIME} capabilities. - -These Gnusae are based mainly on Gnus 5.6 and Pterodactyl Gnus. -Collectively, they are called ``Semi-gnus'', and different strains are -called T-gnus, ET-gnus, Nana-gnus and Chaos. These provide powerful -@acronym{MIME} and multilingualization things, especially important for -Japanese users. - - -@node Why? -@subsection Why? - -What's the point of Gnus? - -I want to provide a ``rad'', ``happening'', ``way cool'' and ``hep'' -newsreader, that lets you do anything you can think of. That was my -original motivation, but while working on Gnus, it has become clear to -me that this generation of newsreaders really belong in the stone age. -Newsreaders haven't developed much since the infancy of the net. If the -volume continues to rise with the current rate of increase, all current -newsreaders will be pretty much useless. How do you deal with -newsgroups that have thousands of new articles each day? How do you -keep track of millions of people who post? - -Gnus offers no real solutions to these questions, but I would very much -like to see Gnus being used as a testing ground for new methods of -reading and fetching news. Expanding on @sc{Umeda}-san's wise decision -to separate the newsreader from the back ends, Gnus now offers a simple -interface for anybody who wants to write new back ends for fetching mail -and news from different sources. I have added hooks for customizations -everywhere I could imagine it being useful. By doing so, I'm inviting -every one of you to explore and invent. - -May Gnus never be complete. @kbd{C-u 100 M-x all-hail-emacs} and -@kbd{C-u 100 M-x all-hail-xemacs}. - - -@node Compatibility -@subsection Compatibility - -@cindex compatibility -Gnus was designed to be fully compatible with @sc{gnus}. Almost all key -bindings have been kept. More key bindings have been added, of course, -but only in one or two obscure cases have old bindings been changed. - -Our motto is: -@quotation -@cartouche -@center In a cloud bones of steel. -@end cartouche -@end quotation - -All commands have kept their names. Some internal functions have changed -their names. - -The @code{gnus-uu} package has changed drastically. @xref{Decoding -Articles}. - -One major compatibility question is the presence of several summary -buffers. All variables relevant while reading a group are -buffer-local to the summary buffer they belong in. Although many -important variables have their values copied into their global -counterparts whenever a command is executed in the summary buffer, this -change might lead to incorrect values being used unless you are careful. - -All code that relies on knowledge of @sc{gnus} internals will probably -fail. To take two examples: Sorting @code{gnus-newsrc-alist} (or -changing it in any way, as a matter of fact) is strictly verboten. Gnus -maintains a hash table that points to the entries in this alist (which -speeds up many functions), and changing the alist directly will lead to -peculiar results. - -@cindex hilit19 -@cindex highlighting -Old hilit19 code does not work at all. In fact, you should probably -remove all hilit code from all Gnus hooks -(@code{gnus-group-prepare-hook} and @code{gnus-summary-prepare-hook}). -Gnus provides various integrated functions for highlighting. These are -faster and more accurate. To make life easier for everybody, Gnus will -by default remove all hilit calls from all hilit hooks. Uncleanliness! -Away! - -Packages like @code{expire-kill} will no longer work. As a matter of -fact, you should probably remove all old @sc{gnus} packages (and other -code) when you start using Gnus. More likely than not, Gnus already -does what you have written code to make @sc{gnus} do. (Snicker.) - -Even though old methods of doing things are still supported, only the -new methods are documented in this manual. If you detect a new method of -doing something while reading this manual, that does not mean you have -to stop doing it the old way. - -Gnus understands all @sc{gnus} startup files. - -@kindex M-x gnus-bug -@findex gnus-bug -@cindex reporting bugs -@cindex bugs -Overall, a casual user who hasn't written much code that depends on -@sc{gnus} internals should suffer no problems. If problems occur, -please let me know by issuing that magic command @kbd{M-x gnus-bug}. - -@vindex gnus-bug-create-help-buffer -If you are in the habit of sending bug reports @emph{very} often, you -may find the helpful help buffer annoying after a while. If so, set -@code{gnus-bug-create-help-buffer} to @code{nil} to avoid having it pop -up at you. - - -@node Conformity -@subsection Conformity - -No rebels without a clue here, ma'am. We conform to all standards known -to (wo)man. Except for those standards and/or conventions we disagree -with, of course. - -@table @strong - -@item RFC (2)822 -@cindex RFC 822 -@cindex RFC 2822 -There are no known breaches of this standard. - -@item RFC 1036 -@cindex RFC 1036 -There are no known breaches of this standard, either. - -@item Son-of-RFC 1036 -@cindex Son-of-RFC 1036 -We do have some breaches to this one. - -@table @emph - -@item X-Newsreader -@itemx User-Agent -These are considered to be ``vanity headers'', while I consider them -to be consumer information. After seeing so many badly formatted -articles coming from @code{tin} and @code{Netscape} I know not to use -either of those for posting articles. I would not have known that if -it wasn't for the @code{X-Newsreader} header. -@end table - -@item USEFOR -@cindex USEFOR -USEFOR is an IETF working group writing a successor to RFC 1036, based -on Son-of-RFC 1036. They have produced a number of drafts proposing -various changes to the format of news articles. The Gnus towers will -look into implementing the changes when the draft is accepted as an RFC. - -@item MIME - RFC 2045-2049 etc -@cindex @acronym{MIME} -All the various @acronym{MIME} RFCs are supported. - -@item Disposition Notifications - RFC 2298 -Message Mode is able to request notifications from the receiver. - -@item PGP - RFC 1991 and RFC 2440 -@cindex RFC 1991 -@cindex RFC 2440 -RFC 1991 is the original @acronym{PGP} message specification, -published as an informational RFC. RFC 2440 was the follow-up, now -called Open PGP, and put on the Standards Track. Both document a -non-@acronym{MIME} aware @acronym{PGP} format. Gnus supports both -encoding (signing and encryption) and decoding (verification and -decryption). - -@item PGP/MIME - RFC 2015/3156 -RFC 2015 (superseded by 3156 which references RFC 2440 instead of RFC -1991) describes the @acronym{MIME}-wrapping around the RFC 1991/2440 format. -Gnus supports both encoding and decoding. - -@item S/MIME - RFC 2633 -RFC 2633 describes the @acronym{S/MIME} format. - -@item IMAP - RFC 1730/2060, RFC 2195, RFC 2086, RFC 2359, RFC 2595, RFC 1731 -RFC 1730 is @acronym{IMAP} version 4, updated somewhat by RFC 2060 -(@acronym{IMAP} 4 revision 1). RFC 2195 describes CRAM-MD5 -authentication for @acronym{IMAP}. RFC 2086 describes access control -lists (ACLs) for @acronym{IMAP}. RFC 2359 describes a @acronym{IMAP} -protocol enhancement. RFC 2595 describes the proper @acronym{TLS} -integration (STARTTLS) with @acronym{IMAP}. RFC 1731 describes the -GSSAPI/Kerberos4 mechanisms for @acronym{IMAP}. - -@end table - -If you ever notice Gnus acting non-compliant with regards to the texts -mentioned above, don't hesitate to drop a note to Gnus Towers and let us -know. - - -@node Emacsen -@subsection Emacsen -@cindex Emacsen -@cindex XEmacs -@cindex Mule -@cindex Emacs - -Gnus should work on: - -@itemize @bullet - -@item -Emacs 21.1 and up. - -@item -XEmacs 21.4 and up. - -@end itemize - -This Gnus version will absolutely not work on any Emacsen older than -that. Not reliably, at least. Older versions of Gnus may work on older -Emacs versions. Particularly, Gnus 5.10.8 should also work on Emacs -20.7 and XEmacs 21.1. - -There are some vague differences between Gnus on the various -platforms---XEmacs features more graphics (a logo and a toolbar)---but -other than that, things should look pretty much the same under all -Emacsen. - - -@node Gnus Development -@subsection Gnus Development - -Gnus is developed in a two-phased cycle. The first phase involves much -discussion on the @samp{ding@@gnus.org} mailing list, where people -propose changes and new features, post patches and new back ends. This -phase is called the @dfn{alpha} phase, since the Gnusae released in this -phase are @dfn{alpha releases}, or (perhaps more commonly in other -circles) @dfn{snapshots}. During this phase, Gnus is assumed to be -unstable and should not be used by casual users. Gnus alpha releases -have names like ``Red Gnus'' and ``Quassia Gnus''. - -After futzing around for 50-100 alpha releases, Gnus is declared -@dfn{frozen}, and only bug fixes are applied. Gnus loses the prefix, -and is called things like ``Gnus 5.6.32'' instead. Normal people are -supposed to be able to use these, and these are mostly discussed on the -@samp{gnu.emacs.gnus} newsgroup. - -@cindex Incoming* -@vindex mail-source-delete-incoming -Some variable defaults differ between alpha Gnusae and released Gnusae. -In particular, @code{mail-source-delete-incoming} defaults to @code{nil} in -alpha Gnusae and @code{t} in released Gnusae. This is to prevent -lossage of mail if an alpha release hiccups while handling the mail. - -The division of discussion between the ding mailing list and the Gnus -newsgroup is not purely based on publicity concerns. It's true that -having people write about the horrible things that an alpha Gnus release -can do (sometimes) in a public forum may scare people off, but more -importantly, talking about new experimental features that have been -introduced may confuse casual users. New features are frequently -introduced, fiddled with, and judged to be found wanting, and then -either discarded or totally rewritten. People reading the mailing list -usually keep up with these rapid changes, while people on the newsgroup -can't be assumed to do so. - - - -@node Contributors -@subsection Contributors -@cindex contributors - -The new Gnus version couldn't have been done without the help of all the -people on the (ding) mailing list. Every day for over a year I have -gotten billions of nice bug reports from them, filling me with joy, -every single one of them. Smooches. The people on the list have been -tried beyond endurance, what with my ``oh, that's a neat idea <type -type>, yup, I'll release it right away <ship off> no wait, that doesn't -work at all <type type>, yup, I'll ship that one off right away <ship -off> no, wait, that absolutely does not work'' policy for releases. -Micro$oft---bah. Amateurs. I'm @emph{much} worse. (Or is that -``worser''? ``much worser''? ``worsest''?) - -I would like to take this opportunity to thank the Academy for@dots{} oops, -wrong show. - -@itemize @bullet - -@item -Masanobu @sc{Umeda}---the writer of the original @sc{gnus}. - -@item -Shenghuo Zhu---uudecode.el, mm-uu.el, rfc1843.el, webmail.el, -nnwarchive and many, many other things connected with @acronym{MIME} and -other types of en/decoding, as well as general bug fixing, new -functionality and stuff. - -@item -Per Abrahamsen---custom, scoring, highlighting and @sc{soup} code (as -well as numerous other things). - -@item -Luis Fernandes---design and graphics. - -@item -Joe Reiss---creator of the smiley faces. - -@item -Justin Sheehy---the @acronym{FAQ} maintainer. - -@item -Erik Naggum---help, ideas, support, code and stuff. - -@item -Wes Hardaker---@file{gnus-picon.el} and the manual section on -@dfn{picons} (@pxref{Picons}). - -@item -Kim-Minh Kaplan---further work on the picon code. - -@item -Brad Miller---@file{gnus-gl.el} and the GroupLens manual section -(@pxref{GroupLens}). - -@item -Sudish Joseph---innumerable bug fixes. - -@item -Ilja Weis---@file{gnus-topic.el}. - -@item -Steven L. Baur---lots and lots and lots of bugs detections and fixes. - -@item -Vladimir Alexiev---the refcard and reference booklets. - -@item -Felix Lee & Jamie Zawinski---I stole some pieces from the XGnus -distribution by Felix Lee and JWZ. - -@item -Scott Byer---@file{nnfolder.el} enhancements & rewrite. - -@item -Peter Mutsaers---orphan article scoring code. - -@item -Ken Raeburn---POP mail support. - -@item -Hallvard B Furuseth---various bits and pieces, especially dealing with -.newsrc files. - -@item -Brian Edmonds---@file{gnus-bbdb.el}. - -@item -David Moore---rewrite of @file{nnvirtual.el} and many other things. - -@item -Kevin Davidson---came up with the name @dfn{ding}, so blame him. - -@item -François Pinard---many, many interesting and thorough bug reports, as -well as autoconf support. - -@end itemize - -This manual was proof-read by Adrian Aichner, with Ricardo Nassif, Mark -Borges, and Jost Krieger proof-reading parts of the manual. - -The following people have contributed many patches and suggestions: - -Christopher Davis, -Andrew Eskilsson, -Kai Grossjohann, -Kevin Greiner, -Jesper Harder, -Paul Jarc, -Simon Josefsson, -David Kågedal, -Richard Pieri, -Fabrice Popineau, -Daniel Quinlan, -Michael Shields, -Reiner Steib, -Jason L. Tibbitts, III, -Jack Vinson, -Katsumi Yamaoka, @c Yamaoka -and -Teodor Zlatanov. - -Also thanks to the following for patches and stuff: - -Jari Aalto, -Adrian Aichner, -Vladimir Alexiev, -Russ Allbery, -Peter Arius, -Matt Armstrong, -Marc Auslander, -Miles Bader, -Alexei V. Barantsev, -Frank Bennett, -Robert Bihlmeyer, -Chris Bone, -Mark Borges, -Mark Boyns, -Lance A. Brown, -Rob Browning, -Kees de Bruin, -Martin Buchholz, -Joe Buehler, -Kevin Buhr, -Alastair Burt, -Joao Cachopo, -Zlatko Calusic, -Massimo Campostrini, -Castor, -David Charlap, -Dan Christensen, -Kevin Christian, -Jae-you Chung, @c ? -James H. Cloos, Jr., -Laura Conrad, -Michael R. Cook, -Glenn Coombs, -Andrew J. Cosgriff, -Neil Crellin, -Frank D. Cringle, -Geoffrey T. Dairiki, -Andre Deparade, -Ulrik Dickow, -Dave Disser, -Rui-Tao Dong, @c ? -Joev Dubach, -Michael Welsh Duggan, -Dave Edmondson, -Paul Eggert, -Mark W. Eichin, -Karl Eichwalder, -Enami Tsugutomo, @c Enami -Michael Ernst, -Luc Van Eycken, -Sam Falkner, -Nelson Jose dos Santos Ferreira, -Sigbjorn Finne, -Sven Fischer, -Paul Fisher, -Decklin Foster, -Gary D. Foster, -Paul Franklin, -Guy Geens, -Arne Georg Gleditsch, -David S. Goldberg, -Michelangelo Grigni, -Dale Hagglund, -D. Hall, -Magnus Hammerin, -Kenichi Handa, @c Handa -Raja R. Harinath, -Yoshiki Hayashi, @c Hayashi -P. E. Jareth Hein, -Hisashige Kenji, @c Hisashige -Scott Hofmann, -Marc Horowitz, -Gunnar Horrigmo, -Richard Hoskins, -Brad Howes, -Miguel de Icaza, -François Felix Ingrand, -Tatsuya Ichikawa, @c Ichikawa -Ishikawa Ichiro, @c Ishikawa -Lee Iverson, -Iwamuro Motonori, @c Iwamuro -Rajappa Iyer, -Andreas Jaeger, -Adam P. Jenkins, -Randell Jesup, -Fred Johansen, -Gareth Jones, -Greg Klanderman, -Karl Kleinpaste, -Michael Klingbeil, -Peter Skov Knudsen, -Shuhei Kobayashi, @c Kobayashi -Petr Konecny, -Koseki Yoshinori, @c Koseki -Thor Kristoffersen, -Jens Lautenbacher, -Martin Larose, -Seokchan Lee, @c Lee -Joerg Lenneis, -Carsten Leonhardt, -James LewisMoss, -Christian Limpach, -Markus Linnala, -Dave Love, -Mike McEwan, -Tonny Madsen, -Shlomo Mahlab, -Nat Makarevitch, -Istvan Marko, -David Martin, -Jason R. Mastaler, -Gordon Matzigkeit, -Timo Metzemakers, -Richard Mlynarik, -Lantz Moore, -Morioka Tomohiko, @c Morioka -Erik Toubro Nielsen, -Hrvoje Niksic, -Andy Norman, -Fred Oberhauser, -C. R. Oldham, -Alexandre Oliva, -Ken Olstad, -Masaharu Onishi, @c Onishi -Hideki Ono, @c Ono -Ettore Perazzoli, -William Perry, -Stephen Peters, -Jens-Ulrik Holger Petersen, -Ulrich Pfeifer, -Matt Pharr, -Andy Piper, -John McClary Prevost, -Bill Pringlemeir, -Mike Pullen, -Jim Radford, -Colin Rafferty, -Lasse Rasinen, -Lars Balker Rasmussen, -Joe Reiss, -Renaud Rioboo, -Roland B. Roberts, -Bart Robinson, -Christian von Roques, -Markus Rost, -Jason Rumney, -Wolfgang Rupprecht, -Jay Sachs, -Dewey M. Sasser, -Conrad Sauerwald, -Loren Schall, -Dan Schmidt, -Ralph Schleicher, -Philippe Schnoebelen, -Andreas Schwab, -Randal L. Schwartz, -Danny Siu, -Matt Simmons, -Paul D. Smith, -Jeff Sparkes, -Toby Speight, -Michael Sperber, -Darren Stalder, -Richard Stallman, -Greg Stark, -Sam Steingold, -Paul Stevenson, -Jonas Steverud, -Paul Stodghill, -Kiyokazu Suto, @c Suto -Kurt Swanson, -Samuel Tardieu, -Teddy, -Chuck Thompson, -Tozawa Akihiko, @c Tozawa -Philippe Troin, -James Troup, -Trung Tran-Duc, -Jack Twilley, -Aaron M. Ucko, -Aki Vehtari, -Didier Verna, -Vladimir Volovich, -Jan Vroonhof, -Stefan Waldherr, -Pete Ware, -Barry A. Warsaw, -Christoph Wedler, -Joe Wells, -Lee Willis, -and -Lloyd Zusman. - - -For a full overview of what each person has done, the ChangeLogs -included in the Gnus alpha distributions should give ample reading -(550kB and counting). - -Apologies to everybody that I've forgotten, of which there are many, I'm -sure. - -Gee, that's quite a list of people. I guess that must mean that there -actually are people who are using Gnus. Who'd'a thunk it! - - -@node New Features -@subsection New Features -@cindex new features - -@menu -* ding Gnus:: New things in Gnus 5.0/5.1, the first new Gnus. -* September Gnus:: The Thing Formally Known As Gnus 5.2/5.3. -* Red Gnus:: Third time best---Gnus 5.4/5.5. -* Quassia Gnus:: Two times two is four, or Gnus 5.6/5.7. -* Pterodactyl Gnus:: Pentad also starts with P, AKA Gnus 5.8/5.9. -* Oort Gnus:: It's big. It's far out. Gnus 5.10/5.11. -@end menu - -These lists are, of course, just @emph{short} overviews of the -@emph{most} important new features. No, really. There are tons more. -Yes, we have feeping creaturism in full effect. - -@node ding Gnus -@subsubsection (ding) Gnus - -New features in Gnus 5.0/5.1: - -@itemize @bullet - -@item -The look of all buffers can be changed by setting format-like variables -(@pxref{Group Buffer Format} and @pxref{Summary Buffer Format}). - -@item -Local spool and several @acronym{NNTP} servers can be used at once -(@pxref{Select Methods}). - -@item -You can combine groups into virtual groups (@pxref{Virtual Groups}). - -@item -You can read a number of different mail formats (@pxref{Getting Mail}). -All the mail back ends implement a convenient mail expiry scheme -(@pxref{Expiring Mail}). - -@item -Gnus can use various strategies for gathering threads that have lost -their roots (thereby gathering loose sub-threads into one thread) or it -can go back and retrieve enough headers to build a complete thread -(@pxref{Customizing Threading}). - -@item -Killed groups can be displayed in the group buffer, and you can read -them as well (@pxref{Listing Groups}). - -@item -Gnus can do partial group updates---you do not have to retrieve the -entire active file just to check for new articles in a few groups -(@pxref{The Active File}). - -@item -Gnus implements a sliding scale of subscribedness to groups -(@pxref{Group Levels}). - -@item -You can score articles according to any number of criteria -(@pxref{Scoring}). You can even get Gnus to find out how to score -articles for you (@pxref{Adaptive Scoring}). - -@item -Gnus maintains a dribble buffer that is auto-saved the normal Emacs -manner, so it should be difficult to lose much data on what you have -read if your machine should go down (@pxref{Auto Save}). - -@item -Gnus now has its own startup file (@file{~/.gnus.el}) to avoid -cluttering up the @file{.emacs} file. - -@item -You can set the process mark on both groups and articles and perform -operations on all the marked items (@pxref{Process/Prefix}). - -@item -You can grep through a subset of groups and create a group from the -results (@pxref{Kibozed Groups}). - -@item -You can list subsets of groups according to, well, anything -(@pxref{Listing Groups}). - -@item -You can browse foreign servers and subscribe to groups from those -servers (@pxref{Browse Foreign Server}). - -@item -Gnus can fetch articles, asynchronously, on a second connection to the -server (@pxref{Asynchronous Fetching}). - -@item -You can cache articles locally (@pxref{Article Caching}). - -@item -The uudecode functions have been expanded and generalized -(@pxref{Decoding Articles}). - -@item -You can still post uuencoded articles, which was a little-known feature -of @sc{gnus}' past (@pxref{Uuencoding and Posting}). - -@item -Fetching parents (and other articles) now actually works without -glitches (@pxref{Finding the Parent}). - -@item -Gnus can fetch @acronym{FAQ}s and group descriptions (@pxref{Group Information}). - -@item -Digests (and other files) can be used as the basis for groups -(@pxref{Document Groups}). - -@item -Articles can be highlighted and customized (@pxref{Customizing -Articles}). - -@item -URLs and other external references can be buttonized (@pxref{Article -Buttons}). - -@item -You can do lots of strange stuff with the Gnus window & frame -configuration (@pxref{Window Layout}). - -@item -You can click on buttons instead of using the keyboard -(@pxref{Buttons}). - -@end itemize - - -@node September Gnus -@subsubsection September Gnus - -@iftex -@iflatex -\gnusfig{-28cm}{0cm}{\epsfig{figure=ps/september,height=20cm}} -@end iflatex -@end iftex - -New features in Gnus 5.2/5.3: - -@itemize @bullet - -@item -A new message composition mode is used. All old customization variables -for @code{mail-mode}, @code{rnews-reply-mode} and @code{gnus-msg} are -now obsolete. - -@item -Gnus is now able to generate @dfn{sparse} threads---threads where -missing articles are represented by empty nodes (@pxref{Customizing -Threading}). - -@lisp -(setq gnus-build-sparse-threads 'some) -@end lisp - -@item -Outgoing articles are stored on a special archive server -(@pxref{Archived Messages}). - -@item -Partial thread regeneration now happens when articles are -referred. - -@item -Gnus can make use of GroupLens predictions (@pxref{GroupLens}). - -@item -Picons (personal icons) can be displayed under XEmacs (@pxref{Picons}). - -@item -A @code{trn}-like tree buffer can be displayed (@pxref{Tree Display}). - -@lisp -(setq gnus-use-trees t) -@end lisp - -@item -An @code{nn}-like pick-and-read minor mode is available for the summary -buffers (@pxref{Pick and Read}). - -@lisp -(add-hook 'gnus-summary-mode-hook 'gnus-pick-mode) -@end lisp - -@item -In binary groups you can use a special binary minor mode (@pxref{Binary -Groups}). - -@item -Groups can be grouped in a folding topic hierarchy (@pxref{Group -Topics}). - -@lisp -(add-hook 'gnus-group-mode-hook 'gnus-topic-mode) -@end lisp - -@item -Gnus can re-send and bounce mail (@pxref{Summary Mail Commands}). - -@item -Groups can now have a score, and bubbling based on entry frequency -is possible (@pxref{Group Score}). - -@lisp -(add-hook 'gnus-summary-exit-hook 'gnus-summary-bubble-group) -@end lisp - -@item -Groups can be process-marked, and commands can be performed on -groups of groups (@pxref{Marking Groups}). - -@item -Caching is possible in virtual groups. - -@item -@code{nndoc} now understands all kinds of digests, mail boxes, rnews -news batches, ClariNet briefs collections, and just about everything -else (@pxref{Document Groups}). - -@item -Gnus has a new back end (@code{nnsoup}) to create/read SOUP packets -(@pxref{SOUP}). - -@item -The Gnus cache is much faster. - -@item -Groups can be sorted according to many criteria (@pxref{Sorting -Groups}). - -@item -New group parameters have been introduced to set list-addresses and -expiry times (@pxref{Group Parameters}). - -@item -All formatting specs allow specifying faces to be used -(@pxref{Formatting Fonts}). - -@item -There are several more commands for setting/removing/acting on process -marked articles on the @kbd{M P} submap (@pxref{Setting Process Marks}). - -@item -The summary buffer can be limited to show parts of the available -articles based on a wide range of criteria. These commands have been -bound to keys on the @kbd{/} submap (@pxref{Limiting}). - -@item -Articles can be made persistent with the @kbd{*} command -(@pxref{Persistent Articles}). - -@item -All functions for hiding article elements are now toggles. - -@item -Article headers can be buttonized (@pxref{Article Washing}). - -@item -All mail back ends support fetching articles by @code{Message-ID}. - -@item -Duplicate mail can now be treated properly (@pxref{Duplicates}). - -@item -All summary mode commands are available directly from the article -buffer (@pxref{Article Keymap}). - -@item -Frames can be part of @code{gnus-buffer-configuration} (@pxref{Window -Layout}). - -@item -Mail can be re-scanned by a daemonic process (@pxref{Daemons}). -@iftex -@iflatex -\marginpar[\mbox{}\hfill\epsfig{figure=ps/fseptember,height=5cm}]{\epsfig{figure=ps/fseptember,height=5cm}} -@end iflatex -@end iftex - -@item -Gnus can make use of NoCeM files to weed out spam (@pxref{NoCeM}). - -@lisp -(setq gnus-use-nocem t) -@end lisp - -@item -Groups can be made permanently visible (@pxref{Listing Groups}). - -@lisp -(setq gnus-permanently-visible-groups "^nnml:") -@end lisp - -@item -Many new hooks have been introduced to make customizing easier. - -@item -Gnus respects the @code{Mail-Copies-To} header. - -@item -Threads can be gathered by looking at the @code{References} header -(@pxref{Customizing Threading}). - -@lisp -(setq gnus-summary-thread-gathering-function - 'gnus-gather-threads-by-references) -@end lisp - -@item -Read articles can be stored in a special backlog buffer to avoid -refetching (@pxref{Article Backlog}). - -@lisp -(setq gnus-keep-backlog 50) -@end lisp - -@item -A clean copy of the current article is always stored in a separate -buffer to allow easier treatment. - -@item -Gnus can suggest where to save articles (@pxref{Saving Articles}). - -@item -Gnus doesn't have to do as much prompting when saving (@pxref{Saving -Articles}). - -@lisp -(setq gnus-prompt-before-saving t) -@end lisp - -@item -@code{gnus-uu} can view decoded files asynchronously while fetching -articles (@pxref{Other Decode Variables}). - -@lisp -(setq gnus-uu-grabbed-file-functions 'gnus-uu-grab-view) -@end lisp - -@item -Filling in the article buffer now works properly on cited text -(@pxref{Article Washing}). - -@item -Hiding cited text adds buttons to toggle hiding, and how much -cited text to hide is now customizable (@pxref{Article Hiding}). - -@lisp -(setq gnus-cited-lines-visible 2) -@end lisp - -@item -Boring headers can be hidden (@pxref{Article Hiding}). - -@item -Default scoring values can now be set from the menu bar. - -@item -Further syntax checking of outgoing articles have been added. - -@end itemize - - -@node Red Gnus -@subsubsection Red Gnus - -New features in Gnus 5.4/5.5: - -@iftex -@iflatex -\gnusfig{-5.5cm}{-4cm}{\epsfig{figure=ps/red,height=20cm}} -@end iflatex -@end iftex - -@itemize @bullet - -@item -@file{nntp.el} has been totally rewritten in an asynchronous fashion. - -@item -Article prefetching functionality has been moved up into -Gnus (@pxref{Asynchronous Fetching}). - -@item -Scoring can now be performed with logical operators like @code{and}, -@code{or}, @code{not}, and parent redirection (@pxref{Advanced -Scoring}). - -@item -Article washing status can be displayed in the -article mode line (@pxref{Misc Article}). - -@item -@file{gnus.el} has been split into many smaller files. - -@item -Suppression of duplicate articles based on Message-ID can be done -(@pxref{Duplicate Suppression}). - -@lisp -(setq gnus-suppress-duplicates t) -@end lisp - -@item -New variables for specifying what score and adapt files are to be -considered home score and adapt files (@pxref{Home Score File}) have -been added. - -@item -@code{nndoc} was rewritten to be easily extendable (@pxref{Document -Server Internals}). - -@item -Groups can inherit group parameters from parent topics (@pxref{Topic -Parameters}). - -@item -Article editing has been revamped and is now actually usable. - -@item -Signatures can be recognized in more intelligent fashions -(@pxref{Article Signature}). - -@item -Summary pick mode has been made to look more @code{nn}-like. Line -numbers are displayed and the @kbd{.} command can be used to pick -articles (@code{Pick and Read}). - -@item -Commands for moving the @file{.newsrc.eld} from one server to -another have been added (@pxref{Changing Servers}). - -@item -There's a way now to specify that ``uninteresting'' fields be suppressed -when generating lines in buffers (@pxref{Advanced Formatting}). - -@item -Several commands in the group buffer can be undone with @kbd{C-M-_} -(@pxref{Undo}). - -@item -Scoring can be done on words using the new score type @code{w} -(@pxref{Score File Format}). - -@item -Adaptive scoring can be done on a Subject word-by-word basis -(@pxref{Adaptive Scoring}). - -@lisp -(setq gnus-use-adaptive-scoring '(word)) -@end lisp - -@item -Scores can be decayed (@pxref{Score Decays}). - -@lisp -(setq gnus-decay-scores t) -@end lisp - -@item -Scoring can be performed using a regexp on the Date header. The Date is -normalized to compact ISO 8601 format first (@pxref{Score File Format}). - -@item -A new command has been added to remove all data on articles from -the native server (@pxref{Changing Servers}). - -@item -A new command for reading collections of documents -(@code{nndoc} with @code{nnvirtual} on top) has been added---@kbd{C-M-d} -(@pxref{Really Various Summary Commands}). - -@item -Process mark sets can be pushed and popped (@pxref{Setting Process -Marks}). - -@item -A new mail-to-news back end makes it possible to post even when the @acronym{NNTP} -server doesn't allow posting (@pxref{Mail-To-News Gateways}). - -@item -A new back end for reading searches from Web search engines -(@dfn{DejaNews}, @dfn{Alta Vista}, @dfn{InReference}) has been added -(@pxref{Web Searches}). - -@item -Groups inside topics can now be sorted using the standard sorting -functions, and each topic can be sorted independently (@pxref{Topic -Sorting}). - -@item -Subsets of the groups can be sorted independently (@code{Sorting -Groups}). - -@item -Cached articles can be pulled into the groups (@pxref{Summary Generation -Commands}). -@iftex -@iflatex -\marginpar[\mbox{}\hfill\epsfig{figure=ps/fred,width=3cm}]{\epsfig{figure=ps/fred,width=3cm}} -@end iflatex -@end iftex - -@item -Score files are now applied in a more reliable order (@pxref{Score -Variables}). - -@item -Reports on where mail messages end up can be generated (@pxref{Splitting -Mail}). - -@item -More hooks and functions have been added to remove junk from incoming -mail before saving the mail (@pxref{Washing Mail}). - -@item -Emphasized text can be properly fontisized: - -@end itemize - - -@node Quassia Gnus -@subsubsection Quassia Gnus - -New features in Gnus 5.6: - -@itemize @bullet - -@item -New functionality for using Gnus as an offline newsreader has been -added. A plethora of new commands and modes have been added. -@xref{Gnus Unplugged}, for the full story. - -@item -The @code{nndraft} back end has returned, but works differently than -before. All Message buffers are now also articles in the @code{nndraft} -group, which is created automatically. - -@item -@code{gnus-alter-header-function} can now be used to alter header -values. - -@item -@code{gnus-summary-goto-article} now accept Message-ID's. - -@item -A new Message command for deleting text in the body of a message -outside the region: @kbd{C-c C-v}. - -@item -You can now post to component group in @code{nnvirtual} groups with -@kbd{C-u C-c C-c}. - -@item - @code{nntp-rlogin-program}---new variable to ease customization. - -@item -@code{C-u C-c C-c} in @code{gnus-article-edit-mode} will now inhibit -re-highlighting of the article buffer. - -@item -New element in @code{gnus-boring-article-headers}---@code{long-to}. - -@item -@kbd{M-i} symbolic prefix command. @xref{Symbolic Prefixes}, for -details. - -@item -@kbd{L} and @kbd{I} in the summary buffer now take the symbolic prefix -@kbd{a} to add the score rule to the @file{all.SCORE} file. - -@item -@code{gnus-simplify-subject-functions} variable to allow greater -control over simplification. - -@item -@kbd{A T}---new command for fetching the current thread. - -@item -@kbd{/ T}---new command for including the current thread in the -limit. - -@item -@kbd{M-RET} is a new Message command for breaking cited text. - -@item -@samp{\\1}-expressions are now valid in @code{nnmail-split-methods}. - -@item -The @code{custom-face-lookup} function has been removed. -If you used this function in your initialization files, you must -rewrite them to use @code{face-spec-set} instead. - -@item -Canceling now uses the current select method. Symbolic prefix -@kbd{a} forces normal posting method. - -@item -New command to translate M******** sm*rtq**t*s into proper -text---@kbd{W d}. - -@item -For easier debugging of @code{nntp}, you can set -@code{nntp-record-commands} to a non-@code{nil} value. - -@item -@code{nntp} now uses @file{~/.authinfo}, a @file{.netrc}-like file, for -controlling where and how to send @sc{authinfo} to @acronym{NNTP} servers. - -@item -A command for editing group parameters from the summary buffer -has been added. - -@item -A history of where mails have been split is available. - -@item -A new article date command has been added---@code{article-date-iso8601}. - -@item -Subjects can be simplified when threading by setting -@code{gnus-score-thread-simplify}. - -@item -A new function for citing in Message has been -added---@code{message-cite-original-without-signature}. - -@item -@code{article-strip-all-blank-lines}---new article command. - -@item -A new Message command to kill to the end of the article has -been added. - -@item -A minimum adaptive score can be specified by using the -@code{gnus-adaptive-word-minimum} variable. - -@item -The ``lapsed date'' article header can be kept continually -updated by the @code{gnus-start-date-timer} command. - -@item -Web listserv archives can be read with the @code{nnlistserv} back end. - -@item -Old dejanews archives can now be read by @code{nnweb}. - -@end itemize - -@node Pterodactyl Gnus -@subsubsection Pterodactyl Gnus - -New features in Gnus 5.8: - -@itemize @bullet - -@item -The mail-fetching functions have changed. See the manual for the -many details. In particular, all procmail fetching variables are gone. - -If you used procmail like in - -@lisp -(setq nnmail-use-procmail t) -(setq nnmail-spool-file 'procmail) -(setq nnmail-procmail-directory "~/mail/incoming/") -(setq nnmail-procmail-suffix "\\.in") -@end lisp - -this now has changed to - -@lisp -(setq mail-sources - '((directory :path "~/mail/incoming/" - :suffix ".in"))) -@end lisp - -@xref{Mail Source Specifiers}. - -@item -Gnus is now a @acronym{MIME}-capable reader. This affects many parts of -Gnus, and adds a slew of new commands. See the manual for details. - -@item -Gnus has also been multilingualized. This also affects too -many parts of Gnus to summarize here, and adds many new variables. - -@item -@code{gnus-auto-select-first} can now be a function to be -called to position point. - -@item -The user can now decide which extra headers should be included in -summary buffers and @acronym{NOV} files. - -@item -@code{gnus-article-display-hook} has been removed. Instead, a number -of variables starting with @code{gnus-treat-} have been added. - -@item -The Gnus posting styles have been redone again and now works in a -subtly different manner. - -@item -New web-based back ends have been added: @code{nnslashdot}, -@code{nnwarchive} and @code{nnultimate}. nnweb has been revamped, -again, to keep up with ever-changing layouts. - -@item -Gnus can now read @acronym{IMAP} mail via @code{nnimap}. - -@end itemize - -@node Oort Gnus -@subsubsection Oort Gnus -@cindex Oort Gnus - -New features in Gnus 5.10: - -@itemize @bullet - -@item Installation changes -@c *********************** - -@itemize @bullet -@item -Upgrading from previous (stable) version if you have used Oort. - -If you have tried Oort (the unstable Gnus branch leading to this -release) but went back to a stable version, be careful when upgrading to -this version. In particular, you will probably want to remove all -@file{.marks} (nnml) and @file{.mrk} (nnfolder) files, so that flags are -read from your @file{.newsrc.eld} instead of from the -@file{.marks}/@file{.mrk} file where this release store flags. See a -later entry for more information about marks. Note that downgrading -isn't save in general. - -@item -Lisp files are now installed in @file{.../site-lisp/gnus/} by default. -It defaulted to @file{.../site-lisp/} formerly. In addition to this, -the new installer issues a warning if other Gnus installations which -will shadow the latest one are detected. You can then remove those -shadows manually or remove them using @code{make -remove-installed-shadows}. - -@item -New @file{make.bat} for compiling and installing Gnus under MS Windows - -Use @file{make.bat} if you want to install Gnus under MS Windows, the -first argument to the batch-program should be the directory where -@file{xemacs.exe} respectively @file{emacs.exe} is located, if you want -to install Gnus after compiling it, give @file{make.bat} @code{/copy} as -the second parameter. - -@file{make.bat} has been rewritten from scratch, it now features -automatic recognition of XEmacs and GNU Emacs, generates -@file{gnus-load.el}, checks if errors occur while compilation and -generation of info files and reports them at the end of the build -process. It now uses @code{makeinfo} if it is available and falls -back to @file{infohack.el} otherwise. @file{make.bat} should now -install all files which are necessary to run Gnus and be generally a -complete replacement for the @code{configure; make; make install} -cycle used under Unix systems. - -The new @file{make.bat} makes @file{make-x.bat} and @file{xemacs.mak} -superfluous, so they have been removed. - -@item -@file{~/News/overview/} not used. - -As a result of the following change, the @file{~/News/overview/} -directory is not used any more. You can safely delete the entire -hierarchy. - -@c FIXME: `gnus-load' is mentioned in README, which is not included in -@c CVS. We should find a better place for this item. -@item -@code{(require 'gnus-load)} - -If you use a stand-alone Gnus distribution, you'd better add -@code{(require 'gnus-load)} into your @file{~/.emacs} after adding the Gnus -lisp directory into load-path. - -File @file{gnus-load.el} contains autoload commands, functions and variables, -some of which may not be included in distributions of Emacsen. - -@end itemize - -@item New packages and libraries within Gnus -@c ***************************************** - -@itemize @bullet - -@item -The revised Gnus @acronym{FAQ} is included in the manual, -@xref{Frequently Asked Questions}. - -@item -@acronym{TLS} wrapper shipped with Gnus - -@acronym{TLS}/@acronym{SSL} is now supported in @acronym{IMAP} and -@acronym{NNTP} via @file{tls.el} and GNUTLS. The old -@acronym{TLS}/@acronym{SSL} support via (external third party) -@file{ssl.el} and OpenSSL still works. - -@item -Improved anti-spam features. - -Gnus is now able to take out spam from your mail and news streams -using a wide variety of programs and filter rules. Among the supported -methods are RBL blocklists, bogofilter and white/blacklists. Hooks -for easy use of external packages such as SpamAssassin and Hashcash -are also new. @xref{Thwarting Email Spam}. -@c FIXME: @xref{Spam Package}?. Should this be under Misc? - -@item -Gnus supports server-side mail filtering using Sieve. - -Sieve rules can be added as Group Parameters for groups, and the -complete Sieve script is generated using @kbd{D g} from the Group -buffer, and then uploaded to the server using @kbd{C-c C-l} in the -generated Sieve buffer. @xref{Sieve Commands}, and the new Sieve -manual @ref{Top, , Top, sieve, Emacs Sieve}. - -@end itemize - -@item Changes in group mode -@c ************************ - -@itemize @bullet - -@item -@code{gnus-group-read-ephemeral-group} can be called interactively, -using @kbd{G M}. - -@item -Retrieval of charters and control messages - -There are new commands for fetching newsgroup charters (@kbd{H c}) and -control messages (@kbd{H C}). - -@item -The new variable @code{gnus-parameters} can be used to set group parameters. - -Earlier this was done only via @kbd{G p} (or @kbd{G c}), which stored -the parameters in @file{~/.newsrc.eld}, but via this variable you can -enjoy the powers of customize, and simplified backups since you set the -variable in @file{~/.gnus.el} instead of @file{~/.newsrc.eld}. The -variable maps regular expressions matching group names to group -parameters, a'la: -@lisp -(setq gnus-parameters - '(("mail\\..*" - (gnus-show-threads nil) - (gnus-use-scoring nil)) - ("^nnimap:\\(foo.bar\\)$" - (to-group . "\\1")))) -@end lisp - -@item -Unread count correct in nnimap groups. - -The estimated number of unread articles in the group buffer should now -be correct for nnimap groups. This is achieved by calling -@code{nnimap-fixup-unread-after-getting-new-news} from the -@code{gnus-setup-news-hook} (called on startup) and -@code{gnus-after-getting-new-news-hook}. (called after getting new -mail). If you have modified those variables from the default, you may -want to add @code{nnimap-fixup-unread-after-getting-new-news} again. If -you were happy with the estimate and want to save some (minimal) time -when getting new mail, remove the function. - -@item -Group names are treated as UTF-8 by default. - -This is supposedly what USEFOR wanted to migrate to. See -@code{gnus-group-name-charset-group-alist} and -@code{gnus-group-name-charset-method-alist} for customization. - -@item -@code{gnus-group-charset-alist} and -@code{gnus-group-ignored-charsets-alist}. - -The regexps in these variables are compared with full group names -instead of real group names in 5.8. Users who customize these -variables should change those regexps accordingly. For example: -@lisp -("^han\\>" euc-kr) -> ("\\(^\\|:\\)han\\>" euc-kr) -@end lisp - -@end itemize - -@item Changes in summary and article mode -@c ************************************** - -@itemize @bullet - -@item -@kbd{F} (@code{gnus-article-followup-with-original}) and @kbd{R} -(@code{gnus-article-reply-with-original}) only yank the text in the -region if the region is active. - -@item -In draft groups, @kbd{e} is now bound to @code{gnus-draft-edit-message}. -Use @kbd{B w} for @code{gnus-summary-edit-article} instead. - -@item -Article Buttons - -More buttons for URLs, mail addresses, Message-IDs, Info links, man -pages and Emacs or Gnus related references. @xref{Article Buttons}. The -variables @code{gnus-button-@var{*}-level} can be used to control the -appearance of all article buttons. @xref{Article Button Levels}. - -@item -Single-part yenc encoded attachments can be decoded. - -@item -Picons - -The picons code has been reimplemented to work in GNU Emacs---some of -the previous options have been removed or renamed. - -Picons are small ``personal icons'' representing users, domain and -newsgroups, which can be displayed in the Article buffer. -@xref{Picons}. - -@item -If the new option @code{gnus-treat-body-boundary} is non-@code{nil}, a -boundary line is drawn at the end of the headers. - -@item -Signed article headers (X-PGP-Sig) can be verified with @kbd{W p}. - -@item -The Summary Buffer uses an arrow in the fringe to indicate the current -article. Use @code{(setq gnus-summary-display-arrow nil)} to disable it. - -@item -Warn about email replies to news - -Do you often find yourself replying to news by email by mistake? Then -the new option @code{gnus-confirm-mail-reply-to-news} is just the thing for -you. - -@item -If the new option @code{gnus-summary-display-while-building} is -non-@code{nil}, the summary buffer is shown and updated as it's being -built. - -@item -The new @code{recent} mark @samp{.} indicates newly arrived messages (as -opposed to old but unread messages). - -@item -Gnus supports RFC 2369 mailing list headers, and adds a number of -related commands in mailing list groups. @xref{Mailing List}. - -@item -The Date header can be displayed in a format that can be read aloud -in English. @xref{Article Date}. - -@item -diffs are automatically highlighted in groups matching -@code{mm-uu-diff-groups-regexp} - -@item -Better handling of Microsoft citation styles - -Gnus now tries to recognize the mangled header block that some Microsoft -mailers use to indicate that the rest of the message is a citation, even -though it is not quoted in any way. The variable -@code{gnus-cite-unsightly-citation-regexp} matches the start of these -citations. - -The new command @kbd{W Y f} -(@code{gnus-article-outlook-deuglify-article}) allows deuglifying broken -Outlook (Express) articles. - -@item -@code{gnus-article-skip-boring} - -If you set @code{gnus-article-skip-boring} to @code{t}, then Gnus will -not scroll down to show you a page that contains only boring text, -which by default means cited text and signature. You can customize -what is skippable using @code{gnus-article-boring-faces}. - -This feature is especially useful if you read many articles that -consist of a little new content at the top with a long, untrimmed -message cited below. - -@item -Smileys (@samp{:-)}, @samp{;-)} etc) are now displayed graphically in -Emacs too. - -Put @code{(setq gnus-treat-display-smileys nil)} in @file{~/.gnus.el} to -disable it. - -@item -Face headers handling. @xref{Face}. - -@item -In the summary buffer, the new command @kbd{/ N} inserts new messages -and @kbd{/ o} inserts old messages. - -@item -Gnus decodes morse encoded messages if you press @kbd{W m}. - -@item -@code{gnus-summary-line-format} - -The default value changed to @samp{%U%R%z%I%(%[%4L: %-23,23f%]%) -%s\n}. Moreover @code{gnus-extra-headers}, -@code{nnmail-extra-headers} and @code{gnus-ignored-from-addresses} -changed their default so that the users name will be replaced by the -recipient's name or the group name posting to for @acronym{NNTP} -groups. - -@item -Deleting of attachments. - -The command @code{gnus-mime-save-part-and-strip} (bound to @kbd{C-o} -on @acronym{MIME} buttons) saves a part and replaces the part with an -external one. @code{gnus-mime-delete-part} (bound to @kbd{d} on -@acronym{MIME} buttons) removes a part. It works only on back ends -that support editing. - -@item -@code{gnus-default-charset} - -The default value is determined from the -@code{current-language-environment} variable, instead of -@code{iso-8859-1}. Also the @samp{.*} item in -@code{gnus-group-charset-alist} is removed. - -@item -Printing capabilities are enhanced. - -Gnus supports Muttprint natively with @kbd{O P} from the Summary and -Article buffers. Also, each individual @acronym{MIME} part can be -printed using @kbd{p} on the @acronym{MIME} button. - -@item -Extended format specs. - -Format spec @samp{%&user-date;} is added into -@code{gnus-summary-line-format-alist}. Also, user defined extended -format specs are supported. The extended format specs look like -@samp{%u&foo;}, which invokes function -@code{gnus-user-format-function-@var{foo}}. Because @samp{&} is used as the -escape character, old user defined format @samp{%u&} is no longer supported. - -@item -@kbd{/ *} (@code{gnus-summary-limit-include-cached}) is rewritten. -@c FIXME: Was this a user-visible change? - -It was aliased to @kbd{Y c} -(@code{gnus-summary-insert-cached-articles}). The new function filters -out other articles. - -@item -Some limiting commands accept a @kbd{C-u} prefix to negate the match. - -If @kbd{C-u} is used on subject, author or extra headers, i.e., @kbd{/ -s}, @kbd{/ a}, and @kbd{/ x} -(@code{gnus-summary-limit-to-@{subject,author,extra@}}) respectively, the -result will be to display all articles that do not match the expression. - -@item -Gnus inlines external parts (message/external). - -@end itemize - -@item Changes in Message mode and related Gnus features -@c **************************************************** - -@itemize @bullet - -@item -Delayed articles - -You can delay the sending of a message with @kbd{C-c C-j} in the Message -buffer. The messages are delivered at specified time. This is useful -for sending yourself reminders. @xref{Delayed Articles}. - -@item -If the new option @code{nnml-use-compressed-files} is non-@code{nil}, -the nnml back end allows compressed message files. - -@item -The new option @code{gnus-gcc-mark-as-read} automatically marks -Gcc articles as read. - -@item -Externalizing of attachments - -If @code{gnus-gcc-externalize-attachments} or -@code{message-fcc-externalize-attachments} is non-@code{nil}, attach -local files as external parts. - -@item -The envelope sender address can be customized when using Sendmail. -@xref{Mail Variables, Mail Variables,, message, Message Manual}. - -@item -Gnus no longer generate the Sender: header automatically. - -Earlier it was generated when the user configurable email address was -different from the Gnus guessed default user address. As the guessing -algorithm is rarely correct these days, and (more controversially) the -only use of the Sender: header was to check if you are entitled to -cancel/supersede news (which is now solved by Cancel Locks instead, -see another entry), generation of the header has been disabled by -default. See the variables @code{message-required-headers}, -@code{message-required-news-headers}, and -@code{message-required-mail-headers}. - -@item -Features from third party @file{message-utils.el} added to @file{message.el}. - -Message now asks if you wish to remove @samp{(was: <old subject>)} from -subject lines (see @code{message-subject-trailing-was-query}). @kbd{C-c -M-m} and @kbd{C-c M-f} inserts markers indicating included text. -@kbd{C-c C-f a} adds a X-No-Archive: header. @kbd{C-c C-f x} inserts -appropriate headers and a note in the body for cross-postings and -followups (see the variables @code{message-cross-post-@var{*}}). - -@item -References and X-Draft-From headers are no longer generated when you -start composing messages and @code{message-generate-headers-first} is -@code{nil}. - -@item -Easy inclusion of X-Faces headers. @xref{X-Face}. - -@item -Group Carbon Copy (GCC) quoting - -To support groups that contains SPC and other weird characters, groups -are quoted before they are placed in the Gcc: header. This means -variables such as @code{gnus-message-archive-group} should no longer -contain quote characters to make groups containing SPC work. Also, if -you are using the string @samp{nnml:foo, nnml:bar} (indicating Gcc -into two groups) you must change it to return the list -@code{("nnml:foo" "nnml:bar")}, otherwise the Gcc: line will be quoted -incorrectly. Note that returning the string @samp{nnml:foo, nnml:bar} -was incorrect earlier, it just didn't generate any problems since it -was inserted directly. - -@item -@code{message-insinuate-rmail} - -Adding @code{(message-insinuate-rmail)} and @code{(setq -mail-user-agent 'gnus-user-agent)} in @file{.emacs} convinces Rmail to -compose, reply and forward messages in message-mode, where you can -enjoy the power of @acronym{MML}. - -@item -@code{message-minibuffer-local-map} - -The line below enables BBDB in resending a message: -@lisp -(define-key message-minibuffer-local-map [(tab)] - 'bbdb-complete-name) -@end lisp - -@item -@code{gnus-posting-styles} - -Add a new format of match like -@lisp -((header "to" "larsi.*org") - (Organization "Somewhere, Inc.")) -@end lisp -The old format like the lines below is obsolete, but still accepted. -@lisp -(header "to" "larsi.*org" - (Organization "Somewhere, Inc.")) -@end lisp - -@item -@code{message-ignored-news-headers} and @code{message-ignored-mail-headers} - -@samp{X-Draft-From} and @samp{X-Gnus-Agent-Meta-Information} have been -added into these two variables. If you customized those, perhaps you -need add those two headers too. - -@item -Gnus supports the ``format=flowed'' (RFC 2646) parameter. On -composing messages, it is enabled by @code{use-hard-newlines}. -Decoding format=flowed was present but not documented in earlier -versions. - -@item -The option @code{mm-fill-flowed} can be used to disable treatment of -``format=flowed'' messages. Also, flowed text is disabled when sending -inline PGP signed messages. @xref{Flowed text, , Flowed text, -emacs-mime, The Emacs MIME Manual}. (New in Gnus 5.10.7) -@c This entry is also present in the node "No Gnus". - -@item -Gnus supports the generation of RFC 2298 Disposition Notification requests. - -This is invoked with the @kbd{C-c M-n} key binding from message mode. - -@item -Message supports the Importance: (RFC 2156) header. - -In the message buffer, @kbd{C-c C-f C-i} or @kbd{C-c C-u} cycles through -the valid values. - -@item -Gnus supports Cancel Locks in News. - -This means a header @samp{Cancel-Lock} is inserted in news posting. It is -used to determine if you wrote an article or not (for canceling and -superseding). Gnus generates a random password string the first time -you post a message, and saves it in your @file{~/.emacs} using the Custom -system. While the variable is called @code{canlock-password}, it is not -security sensitive data. Publishing your canlock string on the web -will not allow anyone to be able to anything she could not already do. -The behavior can be changed by customizing @code{message-insert-canlock}. - -@item -Gnus supports @acronym{PGP} (RFC 1991/2440), @acronym{PGP/MIME} (RFC -2015/3156) and @acronym{S/MIME} (RFC 2630-2633). - -It needs an external @acronym{S/MIME} and OpenPGP implementation, but no -additional Lisp libraries. This add several menu items to the -Attachments menu, and @kbd{C-c RET} key bindings, when composing -messages. This also obsoletes @code{gnus-article-hide-pgp-hook}. - -@item -@acronym{MML} (Mime compose) prefix changed from @kbd{M-m} to @kbd{C-c -C-m}. - -This change was made to avoid conflict with the standard binding of -@code{back-to-indentation}, which is also useful in message mode. - -@item -The default for @code{message-forward-show-mml} changed to the symbol -@code{best}. - -The behavior for the @code{best} value is to show @acronym{MML} (i.e., -convert to @acronym{MIME}) when appropriate. @acronym{MML} will not be -used when forwarding signed or encrypted messages, as the conversion -invalidate the digital signature. - -@item -If @code{auto-compression-mode} is enabled, attachments are automatically -decompressed when activated. -@c FIXME: Does this affect article or message mode? - -@item -Support for non-@acronym{ASCII} domain names - -Message supports non-@acronym{ASCII} domain names in From:, To: and -Cc: and will query you whether to perform encoding when you try to -send a message. The variable @code{message-use-idna} controls this. -Gnus will also decode non-@acronym{ASCII} domain names in From:, To: -and Cc: when you view a message. The variable @code{gnus-use-idna} -controls this. - -@item You can now drag and drop attachments to the Message buffer. -See @code{mml-dnd-protocol-alist} and @code{mml-dnd-attach-options}. -@xref{MIME, ,MIME, message, Message Manual}. -@c New in 5.10.9 / 5.11 - -@end itemize - -@item Changes in back ends -@c *********************** - -@itemize @bullet -@item -Gnus can display RSS newsfeeds as a newsgroup. @xref{RSS}. - -@item -The nndoc back end now supports mailman digests and exim bounces. - -@item -Gnus supports Maildir groups. - -Gnus includes a new back end @file{nnmaildir.el}. @xref{Maildir}. - -@item -The nnml and nnfolder back ends store marks for each groups. - -This makes it possible to take backup of nnml/nnfolder servers/groups -separately of @file{~/.newsrc.eld}, while preserving marks. It also -makes it possible to share articles and marks between users (without -sharing the @file{~/.newsrc.eld} file) within e.g. a department. It -works by storing the marks stored in @file{~/.newsrc.eld} in a per-group -file @file{.marks} (for nnml) and @file{@var{groupname}.mrk} (for -nnfolder, named @var{groupname}). If the nnml/nnfolder is moved to -another machine, Gnus will automatically use the @file{.marks} or -@file{.mrk} file instead of the information in @file{~/.newsrc.eld}. -The new server variables @code{nnml-marks-is-evil} and -@code{nnfolder-marks-is-evil} can be used to disable this feature. - -@end itemize - -@item Appearance -@c ************* - -@itemize @bullet - -@item -The menu bar item (in Group and Summary buffer) named ``Misc'' has -been renamed to ``Gnus''. - -@item -The menu bar item (in Message mode) named ``@acronym{MML}'' has been -renamed to ``Attachments''. Note that this menu also contains security -related stuff, like signing and encryption (@pxref{Security, Security,, -message, Message Manual}). - -@item -The tool bars have been updated to use GNOME icons in Group, Summary and -Message mode. You can also customize the tool bars. This is a new -feature in Gnus 5.10.9. (Only for Emacs, not in XEmacs.) - -@item The tool bar icons are now (de)activated correctly -in the group buffer, see the variable @code{gnus-group-update-tool-bar}. -Its default value depends on your Emacs version. This is a new feature -in Gnus 5.10.9. -@end itemize - - -@item Miscellaneous changes -@c ************************ - -@itemize @bullet - -@item -@code{gnus-agent} - -The Gnus Agent has seen a major updated and is now enabled by default, -and all nntp and nnimap servers from @code{gnus-select-method} and -@code{gnus-secondary-select-method} are agentized by default. Earlier -only the server in @code{gnus-select-method} was agentized by the -default, and the agent was disabled by default. When the agent is -enabled, headers are now also retrieved from the Agent cache instead -of the back ends when possible. Earlier this only happened in the -unplugged state. You can enroll or remove servers with @kbd{J a} and -@kbd{J r} in the server buffer. Gnus will not download articles into -the Agent cache, unless you instruct it to do so, though, by using -@kbd{J u} or @kbd{J s} from the Group buffer. You revert to the old -behavior of having the Agent disabled with @code{(setq gnus-agent -nil)}. Note that putting @code{(gnus-agentize)} in @file{~/.gnus.el} -is not needed any more. - -@item -Gnus reads the @acronym{NOV} and articles in the Agent if plugged. - -If one reads an article while plugged, and the article already exists -in the Agent, it won't get downloaded once more. @code{(setq -gnus-agent-cache nil)} reverts to the old behavior. - -@item -Dired integration - -@code{gnus-dired-minor-mode} (see @ref{Other modes}) installs key -bindings in dired buffers to send a file as an attachment, open a file -using the appropriate mailcap entry, and print a file using the mailcap -entry. - -@item -The format spec @code{%C} for positioning point has changed to @code{%*}. - -@item -@code{gnus-slave-unplugged} - -A new command which starts Gnus offline in slave mode. - -@end itemize - -@end itemize - -@iftex - -@page -@node The Manual -@section The Manual -@cindex colophon -@cindex manual - -This manual was generated from a TeXinfo file and then run through -either @code{texi2dvi} -@iflatex -or my own home-brewed TeXinfo to \LaTeX\ transformer, -and then run through @code{latex} and @code{dvips} -@end iflatex -to get what you hold in your hands now. - -The following conventions have been used: - -@enumerate - -@item -This is a @samp{string} - -@item -This is a @kbd{keystroke} - -@item -This is a @file{file} - -@item -This is a @code{symbol} - -@end enumerate - -So if I were to say ``set @code{flargnoze} to @samp{yes}'', that would -mean: - -@lisp -(setq flargnoze "yes") -@end lisp - -If I say ``set @code{flumphel} to @code{yes}'', that would mean: - -@lisp -(setq flumphel 'yes) -@end lisp - -@samp{yes} and @code{yes} are two @emph{very} different things---don't -ever get them confused. - -@iflatex -@c @head -Of course, everything in this manual is of vital interest, so you should -read it all. Several times. However, if you feel like skimming the -manual, look for that gnu head you should see in the margin over -there---it means that what's being discussed is of more importance than -the rest of the stuff. (On the other hand, if everything is infinitely -important, how can anything be more important than that? Just one more -of the mysteries of this world, I guess.) -@end iflatex - -@end iftex - - -@node On Writing Manuals -@section On Writing Manuals - -I guess most manuals are written after-the-fact; documenting a program -that's already there. This is not how this manual is written. When -implementing something, I write the manual entry for that something -straight away. I then see that it's difficult to explain the -functionality, so I write how it's supposed to be, and then I change the -implementation. Writing the documentation and writing the code goes -hand in hand. - -This, of course, means that this manual has no, or little, flow. It -documents absolutely everything in Gnus, but often not where you're -looking for it. It is a reference manual, and not a guide to how to get -started with Gnus. - -That would be a totally different book, that should be written using the -reference manual as source material. It would look quite differently. - - -@page -@node Terminology -@section Terminology - -@cindex terminology -@table @dfn - -@item news -@cindex news -This is what you are supposed to use this thing for---reading news. -News is generally fetched from a nearby @acronym{NNTP} server, and is -generally publicly available to everybody. If you post news, the entire -world is likely to read just what you have written, and they'll all -snigger mischievously. Behind your back. - -@item mail -@cindex mail -Everything that's delivered to you personally is mail. Some news/mail -readers (like Gnus) blur the distinction between mail and news, but -there is a difference. Mail is private. News is public. Mailing is -not posting, and replying is not following up. - -@item reply -@cindex reply -Send a mail to the person who has written what you are reading. - -@item follow up -@cindex follow up -Post an article to the current newsgroup responding to the article you -are reading. - -@item back end -@cindex back end -Gnus considers mail and news to be mostly the same, really. The only -difference is how to access the actual articles. News articles are -commonly fetched via the protocol @acronym{NNTP}, whereas mail -messages could be read from a file on the local disk. The internal -architecture of Gnus thus comprises a ``front end'' and a number of -``back ends''. Internally, when you enter a group (by hitting -@key{RET}, say), you thereby invoke a function in the front end in -Gnus. The front end then ``talks'' to a back end and says things like -``Give me the list of articles in the foo group'' or ``Show me article -number 4711''. - -So a back end mainly defines either a protocol (the @code{nntp} back -end accesses news via @acronym{NNTP}, the @code{nnimap} back end -accesses mail via @acronym{IMAP}) or a file format and directory -layout (the @code{nnspool} back end accesses news via the common -``spool directory'' format, the @code{nnml} back end access mail via a -file format and directory layout that's quite similar). - -Gnus does not handle the underlying media, so to speak---this is all -done by the back ends. A back end is a collection of functions to -access the articles. - -However, sometimes the term ``back end'' is also used where ``server'' -would have been more appropriate. And then there is the term ``select -method'' which can mean either. The Gnus terminology can be quite -confusing. - -@item native -@cindex native -Gnus will always use one method (and back end) as the @dfn{native}, or -default, way of getting news. - -@item foreign -@cindex foreign -You can also have any number of foreign groups active at the same time. -These are groups that use non-native non-secondary back ends for getting -news. - -@item secondary -@cindex secondary -Secondary back ends are somewhere half-way between being native and being -foreign, but they mostly act like they are native. - -@item article -@cindex article -A message that has been posted as news. - -@item mail message -@cindex mail message -A message that has been mailed. - -@item message -@cindex message -A mail message or news article - -@item head -@cindex head -The top part of a message, where administrative information (etc.) is -put. - -@item body -@cindex body -The rest of an article. Everything not in the head is in the -body. - -@item header -@cindex header -A line from the head of an article. - -@item headers -@cindex headers -A collection of such lines, or a collection of heads. Or even a -collection of @acronym{NOV} lines. - -@item @acronym{NOV} -@cindex @acronym{NOV} -When Gnus enters a group, it asks the back end for the headers of all -unread articles in the group. Most servers support the News OverView -format, which is more compact and much faster to read and parse than the -normal @sc{head} format. - -@item level -@cindex levels -Each group is subscribed at some @dfn{level} or other (1-9). The ones -that have a lower level are ``more'' subscribed than the groups with a -higher level. In fact, groups on levels 1-5 are considered -@dfn{subscribed}; 6-7 are @dfn{unsubscribed}; 8 are @dfn{zombies}; and 9 -are @dfn{killed}. Commands for listing groups and scanning for new -articles will all use the numeric prefix as @dfn{working level}. - -@item killed groups -@cindex killed groups -No information on killed groups is stored or updated, which makes killed -groups much easier to handle than subscribed groups. - -@item zombie groups -@cindex zombie groups -Just like killed groups, only slightly less dead. - -@item active file -@cindex active file -The news server has to keep track of what articles it carries, and what -groups exist. All this information in stored in the active file, which -is rather large, as you might surmise. - -@item bogus groups -@cindex bogus groups -A group that exists in the @file{.newsrc} file, but isn't known to the -server (i.e., it isn't in the active file), is a @emph{bogus group}. -This means that the group probably doesn't exist (any more). - -@item activating -@cindex activating groups -The act of asking the server for info on a group and computing the -number of unread articles is called @dfn{activating the group}. -Un-activated groups are listed with @samp{*} in the group buffer. - -@item spool -@cindex spool -News servers store their articles locally in one fashion or other. -One old-fashioned storage method is to have just one file per -article. That's called a ``traditional spool''. - -@item server -@cindex server -A machine one can connect to and get news (or mail) from. - -@item select method -@cindex select method -A structure that specifies the back end, the server and the virtual -server settings. - -@item virtual server -@cindex virtual server -A named select method. Since a select method defines all there is to -know about connecting to a (physical) server, taking the thing as a -whole is a virtual server. - -@item washing -@cindex washing -Taking a buffer and running it through a filter of some sort. The -result will (more often than not) be cleaner and more pleasing than the -original. - -@item ephemeral groups -@cindex ephemeral groups -@cindex temporary groups -Most groups store data on what articles you have read. @dfn{Ephemeral} -groups are groups that will have no data stored---when you exit the -group, it'll disappear into the aether. - -@item solid groups -@cindex solid groups -This is the opposite of ephemeral groups. All groups listed in the -group buffer are solid groups. - -@item sparse articles -@cindex sparse articles -These are article placeholders shown in the summary buffer when -@code{gnus-build-sparse-threads} has been switched on. - -@item threading -@cindex threading -To put responses to articles directly after the articles they respond -to---in a hierarchical fashion. - -@item root -@cindex root -@cindex thread root -The first article in a thread is the root. It is the ancestor of all -articles in the thread. - -@item parent -@cindex parent -An article that has responses. - -@item child -@cindex child -An article that responds to a different article---its parent. - -@item digest -@cindex digest -A collection of messages in one file. The most common digest format is -specified by RFC 1153. - -@item splitting -@cindex splitting, terminology -@cindex mail sorting -@cindex mail filtering (splitting) -The action of sorting your emails according to certain rules. Sometimes -incorrectly called mail filtering. - -@end table - - -@page -@node Customization -@section Customization -@cindex general customization - -All variables are properly documented elsewhere in this manual. This -section is designed to give general pointers on how to customize Gnus -for some quite common situations. - -@menu -* Slow/Expensive Connection:: You run a local Emacs and get the news elsewhere. -* Slow Terminal Connection:: You run a remote Emacs. -* Little Disk Space:: You feel that having large setup files is icky. -* Slow Machine:: You feel like buying a faster machine. -@end menu - - -@node Slow/Expensive Connection -@subsection Slow/Expensive NNTP Connection - -If you run Emacs on a machine locally, and get your news from a machine -over some very thin strings, you want to cut down on the amount of data -Gnus has to get from the @acronym{NNTP} server. - -@table @code - -@item gnus-read-active-file -Set this to @code{nil}, which will inhibit Gnus from requesting the -entire active file from the server. This file is often very large. You -also have to set @code{gnus-check-new-newsgroups} and -@code{gnus-check-bogus-newsgroups} to @code{nil} to make sure that Gnus -doesn't suddenly decide to fetch the active file anyway. - -@item gnus-nov-is-evil -This one has to be @code{nil}. If not, grabbing article headers from -the @acronym{NNTP} server will not be very fast. Not all @acronym{NNTP} servers -support @sc{xover}; Gnus will detect this by itself. -@end table - - -@node Slow Terminal Connection -@subsection Slow Terminal Connection - -Let's say you use your home computer for dialing up the system that runs -Emacs and Gnus. If your modem is slow, you want to reduce (as much as -possible) the amount of data sent over the wires. - -@table @code - -@item gnus-auto-center-summary -Set this to @code{nil} to inhibit Gnus from re-centering the summary -buffer all the time. If it is @code{vertical}, do only vertical -re-centering. If it is neither @code{nil} nor @code{vertical}, do both -horizontal and vertical recentering. - -@item gnus-visible-headers -Cut down on the headers included in the articles to the -minimum. You can, in fact, make do without them altogether---most of the -useful data is in the summary buffer, anyway. Set this variable to -@samp{^NEVVVVER} or @samp{From:}, or whatever you feel you need. - -Use the following to enable all the available hiding features: -@lisp -(setq gnus-treat-hide-headers 'head - gnus-treat-hide-signature t - gnus-treat-hide-citation t) -@end lisp - -@item gnus-use-full-window -By setting this to @code{nil}, you can make all the windows smaller. -While this doesn't really cut down much generally, it means that you -have to see smaller portions of articles before deciding that you didn't -want to read them anyway. - -@item gnus-thread-hide-subtree -If this is non-@code{nil}, all threads in the summary buffer will be -hidden initially. - - -@item gnus-updated-mode-lines -If this is @code{nil}, Gnus will not put information in the buffer mode -lines, which might save some time. -@end table - - -@node Little Disk Space -@subsection Little Disk Space -@cindex disk space - -The startup files can get rather large, so you may want to cut their -sizes a bit if you are running out of space. - -@table @code - -@item gnus-save-newsrc-file -If this is @code{nil}, Gnus will never save @file{.newsrc}---it will -only save @file{.newsrc.eld}. This means that you will not be able to -use any other newsreaders than Gnus. This variable is @code{t} by -default. - -@item gnus-read-newsrc-file -If this is @code{nil}, Gnus will never read @file{.newsrc}---it will -only read @file{.newsrc.eld}. This means that you will not be able to -use any other newsreaders than Gnus. This variable is @code{t} by -default. - -@item gnus-save-killed-list -If this is @code{nil}, Gnus will not save the list of dead groups. You -should also set @code{gnus-check-new-newsgroups} to @code{ask-server} -and @code{gnus-check-bogus-newsgroups} to @code{nil} if you set this -variable to @code{nil}. This variable is @code{t} by default. - -@end table - - -@node Slow Machine -@subsection Slow Machine -@cindex slow machine - -If you have a slow machine, or are just really impatient, there are a -few things you can do to make Gnus run faster. - -Set @code{gnus-check-new-newsgroups} and -@code{gnus-check-bogus-newsgroups} to @code{nil} to make startup faster. - -Set @code{gnus-show-threads}, @code{gnus-use-cross-reference} and -@code{gnus-nov-is-evil} to @code{nil} to make entering and exiting the -summary buffer faster. - - -@page -@node Troubleshooting -@section Troubleshooting -@cindex troubleshooting - -Gnus works @emph{so} well straight out of the box---I can't imagine any -problems, really. - -Ahem. - -@enumerate - -@item -Make sure your computer is switched on. - -@item -Make sure that you really load the current Gnus version. If you have -been running @sc{gnus}, you need to exit Emacs and start it up again before -Gnus will work. - -@item -Try doing an @kbd{M-x gnus-version}. If you get something that looks -like @samp{Gnus v5.10.6} you have the right files loaded. Otherwise -you have some old @file{.el} files lying around. Delete these. - -@item -Read the help group (@kbd{G h} in the group buffer) for a -@acronym{FAQ} and a how-to. - -@item -@vindex max-lisp-eval-depth -Gnus works on many recursive structures, and in some extreme (and very -rare) cases Gnus may recurse down ``too deeply'' and Emacs will beep at -you. If this happens to you, set @code{max-lisp-eval-depth} to 500 or -something like that. -@end enumerate - -If all else fails, report the problem as a bug. - -@cindex bugs -@cindex reporting bugs - -@kindex M-x gnus-bug -@findex gnus-bug -If you find a bug in Gnus, you can report it with the @kbd{M-x gnus-bug} -command. @kbd{M-x set-variable RET debug-on-error RET t RET}, and send -me the backtrace. I will fix bugs, but I can only fix them if you send -me a precise description as to how to reproduce the bug. - -You really can never be too detailed in a bug report. Always use the -@kbd{M-x gnus-bug} command when you make bug reports, even if it creates -a 10Kb mail each time you use it, and even if you have sent me your -environment 500 times before. I don't care. I want the full info each -time. - -It is also important to remember that I have no memory whatsoever. If -you send a bug report, and I send you a reply, and then you just send -back ``No, it's not! Moron!'', I will have no idea what you are -insulting me about. Always over-explain everything. It's much easier -for all of us---if I don't have all the information I need, I will just -mail you and ask for more info, and everything takes more time. - -If the problem you're seeing is very visual, and you can't quite explain -it, copy the Emacs window to a file (with @code{xwd}, for instance), put -it somewhere it can be reached, and include the URL of the picture in -the bug report. - -@cindex patches -If you would like to contribute a patch to fix bugs or make -improvements, please produce the patch using @samp{diff -u}. - -@cindex edebug -If you want to debug your problem further before reporting, possibly -in order to solve the problem yourself and send a patch, you can use -edebug. Debugging Lisp code is documented in the Elisp manual -(@pxref{Debugging, , Debugging Lisp Programs, elisp, The GNU Emacs -Lisp Reference Manual}). To get you started with edebug, consider if -you discover some weird behavior when pressing @kbd{c}, the first -step is to do @kbd{C-h k c} and click on the hyperlink (Emacs only) in -the documentation buffer that leads you to the function definition, -then press @kbd{M-x edebug-defun RET} with point inside that function, -return to Gnus and press @kbd{c} to invoke the code. You will be -placed in the lisp buffer and can single step using @kbd{SPC} and -evaluate expressions using @kbd{M-:} or inspect variables using -@kbd{C-h v}, abort execution with @kbd{q}, and resume execution with -@kbd{c} or @kbd{g}. - -@cindex elp -@cindex profile -@cindex slow -Sometimes, a problem do not directly generate an elisp error but -manifests itself by causing Gnus to be very slow. In these cases, you -can use @kbd{M-x toggle-debug-on-quit} and press @kbd{C-g} when things are -slow, and then try to analyze the backtrace (repeating the procedure -helps isolating the real problem areas). - -A fancier approach is to use the elisp profiler, ELP. The profiler is -(or should be) fully documented elsewhere, but to get you started -there are a few steps that need to be followed. First, instrument the -part of Gnus you are interested in for profiling, e.g. @kbd{M-x -elp-instrument-package RET gnus} or @kbd{M-x elp-instrument-package -RET message}. Then perform the operation that is slow and press -@kbd{M-x elp-results}. You will then see which operations that takes -time, and can debug them further. If the entire operation takes much -longer than the time spent in the slowest function in the profiler -output, you probably profiled the wrong part of Gnus. To reset -profiling statistics, use @kbd{M-x elp-reset-all}. @kbd{M-x -elp-restore-all} is supposed to remove profiling, but given the -complexities and dynamic code generation in Gnus, it might not always -work perfectly. - -@cindex gnu.emacs.gnus -@cindex ding mailing list -If you just need help, you are better off asking on -@samp{gnu.emacs.gnus}. I'm not very helpful. You can also ask on -@email{ding@@gnus.org, the ding mailing list}. Write to -@email{ding-request@@gnus.org} to subscribe. - - -@page -@node Gnus Reference Guide -@section Gnus Reference Guide - -It is my hope that other people will figure out smart stuff that Gnus -can do, and that other people will write those smart things as well. To -facilitate that I thought it would be a good idea to describe the inner -workings of Gnus. And some of the not-so-inner workings, while I'm at -it. - -You can never expect the internals of a program not to change, but I -will be defining (in some details) the interface between Gnus and its -back ends (this is written in stone), the format of the score files -(ditto), data structures (some are less likely to change than others) -and general methods of operation. - -@menu -* Gnus Utility Functions:: Common functions and variable to use. -* Back End Interface:: How Gnus communicates with the servers. -* Score File Syntax:: A BNF definition of the score file standard. -* Headers:: How Gnus stores headers internally. -* Ranges:: A handy format for storing mucho numbers. -* Group Info:: The group info format. -* Extended Interactive:: Symbolic prefixes and stuff. -* Emacs/XEmacs Code:: Gnus can be run under all modern Emacsen. -* Various File Formats:: Formats of files that Gnus use. -@end menu - - -@node Gnus Utility Functions -@subsection Gnus Utility Functions -@cindex Gnus utility functions -@cindex utility functions -@cindex functions -@cindex internal variables - -When writing small functions to be run from hooks (and stuff), it's -vital to have access to the Gnus internal functions and variables. -Below is a list of the most common ones. - -@table @code - -@item gnus-newsgroup-name -@vindex gnus-newsgroup-name -This variable holds the name of the current newsgroup. - -@item gnus-find-method-for-group -@findex gnus-find-method-for-group -A function that returns the select method for @var{group}. - -@item gnus-group-real-name -@findex gnus-group-real-name -Takes a full (prefixed) Gnus group name, and returns the unprefixed -name. - -@item gnus-group-prefixed-name -@findex gnus-group-prefixed-name -Takes an unprefixed group name and a select method, and returns the full -(prefixed) Gnus group name. - -@item gnus-get-info -@findex gnus-get-info -Returns the group info list for @var{group}. - -@item gnus-group-unread -@findex gnus-group-unread -The number of unread articles in @var{group}, or @code{t} if that is -unknown. - -@item gnus-active -@findex gnus-active -The active entry for @var{group}. - -@item gnus-set-active -@findex gnus-set-active -Set the active entry for @var{group}. - -@item gnus-add-current-to-buffer-list -@findex gnus-add-current-to-buffer-list -Adds the current buffer to the list of buffers to be killed on Gnus -exit. - -@item gnus-continuum-version -@findex gnus-continuum-version -Takes a Gnus version string as a parameter and returns a floating point -number. Earlier versions will always get a lower number than later -versions. - -@item gnus-group-read-only-p -@findex gnus-group-read-only-p -Says whether @var{group} is read-only or not. - -@item gnus-news-group-p -@findex gnus-news-group-p -Says whether @var{group} came from a news back end. - -@item gnus-ephemeral-group-p -@findex gnus-ephemeral-group-p -Says whether @var{group} is ephemeral or not. - -@item gnus-server-to-method -@findex gnus-server-to-method -Returns the select method corresponding to @var{server}. - -@item gnus-server-equal -@findex gnus-server-equal -Says whether two virtual servers are equal. - -@item gnus-group-native-p -@findex gnus-group-native-p -Says whether @var{group} is native or not. - -@item gnus-group-secondary-p -@findex gnus-group-secondary-p -Says whether @var{group} is secondary or not. - -@item gnus-group-foreign-p -@findex gnus-group-foreign-p -Says whether @var{group} is foreign or not. - -@item gnus-group-find-parameter -@findex gnus-group-find-parameter -Returns the parameter list of @var{group}. If given a second parameter, -returns the value of that parameter for @var{group}. - -@item gnus-group-set-parameter -@findex gnus-group-set-parameter -Takes three parameters; @var{group}, @var{parameter} and @var{value}. - -@item gnus-narrow-to-body -@findex gnus-narrow-to-body -Narrows the current buffer to the body of the article. - -@item gnus-check-backend-function -@findex gnus-check-backend-function -Takes two parameters, @var{function} and @var{group}. If the back end -@var{group} comes from supports @var{function}, return non-@code{nil}. - -@lisp -(gnus-check-backend-function "request-scan" "nnml:misc") -@result{} t -@end lisp - -@item gnus-read-method -@findex gnus-read-method -Prompts the user for a select method. - -@end table - - -@node Back End Interface -@subsection Back End Interface - -Gnus doesn't know anything about @acronym{NNTP}, spools, mail or virtual -groups. It only knows how to talk to @dfn{virtual servers}. A virtual -server is a @dfn{back end} and some @dfn{back end variables}. As examples -of the first, we have @code{nntp}, @code{nnspool} and @code{nnmbox}. As -examples of the latter we have @code{nntp-port-number} and -@code{nnmbox-directory}. - -When Gnus asks for information from a back end---say @code{nntp}---on -something, it will normally include a virtual server name in the -function parameters. (If not, the back end should use the ``current'' -virtual server.) For instance, @code{nntp-request-list} takes a virtual -server as its only (optional) parameter. If this virtual server hasn't -been opened, the function should fail. - -Note that a virtual server name has no relation to some physical server -name. Take this example: - -@lisp -(nntp "odd-one" - (nntp-address "ifi.uio.no") - (nntp-port-number 4324)) -@end lisp - -Here the virtual server name is @samp{odd-one} while the name of -the physical server is @samp{ifi.uio.no}. - -The back ends should be able to switch between several virtual servers. -The standard back ends implement this by keeping an alist of virtual -server environments that they pull down/push up when needed. - -There are two groups of interface functions: @dfn{required functions}, -which must be present, and @dfn{optional functions}, which Gnus will -always check for presence before attempting to call 'em. - -All these functions are expected to return data in the buffer -@code{nntp-server-buffer} (@samp{ *nntpd*}), which is somewhat -unfortunately named, but we'll have to live with it. When I talk about -@dfn{resulting data}, I always refer to the data in that buffer. When I -talk about @dfn{return value}, I talk about the function value returned by -the function call. Functions that fail should return @code{nil} as the -return value. - -Some back ends could be said to be @dfn{server-forming} back ends, and -some might be said not to be. The latter are back ends that generally -only operate on one group at a time, and have no concept of ``server'' ----they have a group, and they deliver info on that group and nothing -more. - -Gnus identifies each message by way of group name and article number. A -few remarks about these article numbers might be useful. First of all, -the numbers are positive integers. Secondly, it is normally not -possible for later articles to ``re-use'' older article numbers without -confusing Gnus. That is, if a group has ever contained a message -numbered 42, then no other message may get that number, or Gnus will get -mightily confused.@footnote{See the function -@code{nnchoke-request-update-info}, @ref{Optional Back End Functions}.} -Third, article numbers must be assigned in order of arrival in the -group; this is not necessarily the same as the date of the message. - -The previous paragraph already mentions all the ``hard'' restrictions that -article numbers must fulfill. But it seems that it might be useful to -assign @emph{consecutive} article numbers, for Gnus gets quite confused -if there are holes in the article numbering sequence. However, due to -the ``no-reuse'' restriction, holes cannot be avoided altogether. It's -also useful for the article numbers to start at 1 to avoid running out -of numbers as long as possible. - -Note that by convention, back ends are named @code{nnsomething}, but -Gnus also comes with some @code{nnnotbackends}, such as -@file{nnheader.el}, @file{nnmail.el} and @file{nnoo.el}. - -In the examples and definitions I will refer to the imaginary back end -@code{nnchoke}. - -@cindex @code{nnchoke} - -@menu -* Required Back End Functions:: Functions that must be implemented. -* Optional Back End Functions:: Functions that need not be implemented. -* Error Messaging:: How to get messages and report errors. -* Writing New Back Ends:: Extending old back ends. -* Hooking New Back Ends Into Gnus:: What has to be done on the Gnus end. -* Mail-like Back Ends:: Some tips on mail back ends. -@end menu - - -@node Required Back End Functions -@subsubsection Required Back End Functions - -@table @code - -@item (nnchoke-retrieve-headers ARTICLES &optional GROUP SERVER FETCH-OLD) - -@var{articles} is either a range of article numbers or a list of -@code{Message-ID}s. Current back ends do not fully support either---only -sequences (lists) of article numbers, and most back ends do not support -retrieval of @code{Message-ID}s. But they should try for both. - -The result data should either be HEADs or @acronym{NOV} lines, and the result -value should either be @code{headers} or @code{nov} to reflect this. -This might later be expanded to @code{various}, which will be a mixture -of HEADs and @acronym{NOV} lines, but this is currently not supported by Gnus. - -If @var{fetch-old} is non-@code{nil} it says to try fetching ``extra -headers'', in some meaning of the word. This is generally done by -fetching (at most) @var{fetch-old} extra headers less than the smallest -article number in @code{articles}, and filling the gaps as well. The -presence of this parameter can be ignored if the back end finds it -cumbersome to follow the request. If this is non-@code{nil} and not a -number, do maximum fetches. - -Here's an example HEAD: - -@example -221 1056 Article retrieved. -Path: ifi.uio.no!sturles -From: sturles@@ifi.uio.no (Sturle Sunde) -Newsgroups: ifi.discussion -Subject: Re: Something very droll -Date: 27 Oct 1994 14:02:57 +0100 -Organization: Dept. of Informatics, University of Oslo, Norway -Lines: 26 -Message-ID: <38o8e1$a0o@@holmenkollen.ifi.uio.no> -References: <38jdmq$4qu@@visbur.ifi.uio.no> -NNTP-Posting-Host: holmenkollen.ifi.uio.no -. -@end example - -So a @code{headers} return value would imply that there's a number of -these in the data buffer. - -Here's a BNF definition of such a buffer: - -@example -headers = *head -head = error / valid-head -error-message = [ "4" / "5" ] 2number " " <error message> eol -valid-head = valid-message *header "." eol -valid-message = "221 " <number> " Article retrieved." eol -header = <text> eol -@end example - -@cindex BNF -(The version of BNF used here is the one used in RFC822.) - -If the return value is @code{nov}, the data buffer should contain -@dfn{network overview database} lines. These are basically fields -separated by tabs. - -@example -nov-buffer = *nov-line -nov-line = field 7*8[ <TAB> field ] eol -field = <text except TAB> -@end example - -For a closer look at what should be in those fields, -@pxref{Headers}. - - -@item (nnchoke-open-server SERVER &optional DEFINITIONS) - -@var{server} is here the virtual server name. @var{definitions} is a -list of @code{(VARIABLE VALUE)} pairs that define this virtual server. - -If the server can't be opened, no error should be signaled. The back end -may then choose to refuse further attempts at connecting to this -server. In fact, it should do so. - -If the server is opened already, this function should return a -non-@code{nil} value. There should be no data returned. - - -@item (nnchoke-close-server &optional SERVER) - -Close connection to @var{server} and free all resources connected -to it. Return @code{nil} if the server couldn't be closed for some -reason. - -There should be no data returned. - - -@item (nnchoke-request-close) - -Close connection to all servers and free all resources that the back end -have reserved. All buffers that have been created by that back end -should be killed. (Not the @code{nntp-server-buffer}, though.) This -function is generally only called when Gnus is shutting down. - -There should be no data returned. - - -@item (nnchoke-server-opened &optional SERVER) - -If @var{server} is the current virtual server, and the connection to the -physical server is alive, then this function should return a -non-@code{nil} value. This function should under no circumstances -attempt to reconnect to a server we have lost connection to. - -There should be no data returned. - - -@item (nnchoke-status-message &optional SERVER) - -This function should return the last error message from @var{server}. - -There should be no data returned. - - -@item (nnchoke-request-article ARTICLE &optional GROUP SERVER TO-BUFFER) - -The result data from this function should be the article specified by -@var{article}. This might either be a @code{Message-ID} or a number. -It is optional whether to implement retrieval by @code{Message-ID}, but -it would be nice if that were possible. - -If @var{to-buffer} is non-@code{nil}, the result data should be returned -in this buffer instead of the normal data buffer. This is to make it -possible to avoid copying large amounts of data from one buffer to -another, while Gnus mainly requests articles to be inserted directly -into its article buffer. - -If it is at all possible, this function should return a cons cell where -the @code{car} is the group name the article was fetched from, and the @code{cdr} is -the article number. This will enable Gnus to find out what the real -group and article numbers are when fetching articles by -@code{Message-ID}. If this isn't possible, @code{t} should be returned -on successful article retrieval. - - -@item (nnchoke-request-group GROUP &optional SERVER FAST) - -Get data on @var{group}. This function also has the side effect of -making @var{group} the current group. - -If @var{fast}, don't bother to return useful data, just make @var{group} -the current group. - -Here's an example of some result data and a definition of the same: - -@example -211 56 1000 1059 ifi.discussion -@end example - -The first number is the status, which should be 211. Next is the -total number of articles in the group, the lowest article number, the -highest article number, and finally the group name. Note that the total -number of articles may be less than one might think while just -considering the highest and lowest article numbers, but some articles -may have been canceled. Gnus just discards the total-number, so -whether one should take the bother to generate it properly (if that is a -problem) is left as an exercise to the reader. If the group contains no -articles, the lowest article number should be reported as 1 and the -highest as 0. - -@example -group-status = [ error / info ] eol -error = [ "4" / "5" ] 2<number> " " <Error message> -info = "211 " 3* [ <number> " " ] <string> -@end example - - -@item (nnchoke-close-group GROUP &optional SERVER) - -Close @var{group} and free any resources connected to it. This will be -a no-op on most back ends. - -There should be no data returned. - - -@item (nnchoke-request-list &optional SERVER) - -Return a list of all groups available on @var{server}. And that means -@emph{all}. - -Here's an example from a server that only carries two groups: - -@example -ifi.test 0000002200 0000002000 y -ifi.discussion 3324 3300 n -@end example - -On each line we have a group name, then the highest article number in -that group, the lowest article number, and finally a flag. If the group -contains no articles, the lowest article number should be reported as 1 -and the highest as 0. - -@example -active-file = *active-line -active-line = name " " <number> " " <number> " " flags eol -name = <string> -flags = "n" / "y" / "m" / "x" / "j" / "=" name -@end example - -The flag says whether the group is read-only (@samp{n}), is moderated -(@samp{m}), is dead (@samp{x}), is aliased to some other group -(@samp{=other-group}) or none of the above (@samp{y}). - - -@item (nnchoke-request-post &optional SERVER) - -This function should post the current buffer. It might return whether -the posting was successful or not, but that's not required. If, for -instance, the posting is done asynchronously, it has generally not been -completed by the time this function concludes. In that case, this -function should set up some kind of sentinel to beep the user loud and -clear if the posting could not be completed. - -There should be no result data from this function. - -@end table - - -@node Optional Back End Functions -@subsubsection Optional Back End Functions - -@table @code - -@item (nnchoke-retrieve-groups GROUPS &optional SERVER) - -@var{groups} is a list of groups, and this function should request data -on all those groups. How it does it is of no concern to Gnus, but it -should attempt to do this in a speedy fashion. - -The return value of this function can be either @code{active} or -@code{group}, which says what the format of the result data is. The -former is in the same format as the data from -@code{nnchoke-request-list}, while the latter is a buffer full of lines -in the same format as @code{nnchoke-request-group} gives. - -@example -group-buffer = *active-line / *group-status -@end example - - -@item (nnchoke-request-update-info GROUP INFO &optional SERVER) - -A Gnus group info (@pxref{Group Info}) is handed to the back end for -alterations. This comes in handy if the back end really carries all -the information (as is the case with virtual and imap groups). This -function should destructively alter the info to suit its needs, and -should return a non-@code{nil} value. - -There should be no result data from this function. - - -@item (nnchoke-request-type GROUP &optional ARTICLE) - -When the user issues commands for ``sending news'' (@kbd{F} in the -summary buffer, for instance), Gnus has to know whether the article the -user is following up on is news or mail. This function should return -@code{news} if @var{article} in @var{group} is news, @code{mail} if it -is mail and @code{unknown} if the type can't be decided. (The -@var{article} parameter is necessary in @code{nnvirtual} groups which -might very well combine mail groups and news groups.) Both @var{group} -and @var{article} may be @code{nil}. - -There should be no result data from this function. - - -@item (nnchoke-request-set-mark GROUP ACTION &optional SERVER) - -Set/remove/add marks on articles. Normally Gnus handles the article -marks (such as read, ticked, expired etc) internally, and store them in -@file{~/.newsrc.eld}. Some back ends (such as @acronym{IMAP}) however carry -all information about the articles on the server, so Gnus need to -propagate the mark information to the server. - -@var{action} is a list of mark setting requests, having this format: - -@example -(RANGE ACTION MARK) -@end example - -@var{range} is a range of articles you wish to update marks on. -@var{action} is @code{add} or @code{del}, used to add marks or remove -marks (preserving all marks not mentioned). @var{mark} is a list of -marks; where each mark is a symbol. Currently used marks are -@code{read}, @code{tick}, @code{reply}, @code{expire}, @code{killed}, -@code{dormant}, @code{save}, @code{download}, @code{unsend}, -@code{forward} and @code{recent}, but your back end should, if -possible, not limit itself to these. - -Given contradictory actions, the last action in the list should be the -effective one. That is, if your action contains a request to add the -@code{tick} mark on article 1 and, later in the list, a request to -remove the mark on the same article, the mark should in fact be removed. - -An example action list: - -@example -(((5 12 30) 'del '(tick)) - ((10 . 90) 'add '(read expire)) - ((92 94) 'del '(read))) -@end example - -The function should return a range of articles it wasn't able to set the -mark on (currently not used for anything). - -There should be no result data from this function. - -@item (nnchoke-request-update-mark GROUP ARTICLE MARK) - -If the user tries to set a mark that the back end doesn't like, this -function may change the mark. Gnus will use whatever this function -returns as the mark for @var{article} instead of the original -@var{mark}. If the back end doesn't care, it must return the original -@var{mark}, and not @code{nil} or any other type of garbage. - -The only use for this I can see is what @code{nnvirtual} does with -it---if a component group is auto-expirable, marking an article as read -in the virtual group should result in the article being marked as -expirable. - -There should be no result data from this function. - - -@item (nnchoke-request-scan &optional GROUP SERVER) - -This function may be called at any time (by Gnus or anything else) to -request that the back end check for incoming articles, in one way or -another. A mail back end will typically read the spool file or query -the @acronym{POP} server when this function is invoked. The -@var{group} doesn't have to be heeded---if the back end decides that -it is too much work just scanning for a single group, it may do a -total scan of all groups. It would be nice, however, to keep things -local if that's practical. - -There should be no result data from this function. - - -@item (nnchoke-request-group-description GROUP &optional SERVER) - -The result data from this function should be a description of -@var{group}. - -@example -description-line = name <TAB> description eol -name = <string> -description = <text> -@end example - -@item (nnchoke-request-list-newsgroups &optional SERVER) - -The result data from this function should be the description of all -groups available on the server. - -@example -description-buffer = *description-line -@end example - - -@item (nnchoke-request-newgroups DATE &optional SERVER) - -The result data from this function should be all groups that were -created after @samp{date}, which is in normal human-readable date format -(i.e., the date format used in mail and news headers, and returned by -the function @code{message-make-date} by default). The data should be -in the active buffer format. - -It is okay for this function to return ``too many'' groups; some back ends -might find it cheaper to return the full list of groups, rather than -just the new groups. But don't do this for back ends with many groups. -Normally, if the user creates the groups herself, there won't be too -many groups, so @code{nnml} and the like are probably safe. But for -back ends like @code{nntp}, where the groups have been created by the -server, it is quite likely that there can be many groups. - - -@item (nnchoke-request-create-group GROUP &optional SERVER) - -This function should create an empty group with name @var{group}. - -There should be no return data. - - -@item (nnchoke-request-expire-articles ARTICLES &optional GROUP SERVER FORCE) - -This function should run the expiry process on all articles in the -@var{articles} range (which is currently a simple list of article -numbers.) It is left up to the back end to decide how old articles -should be before they are removed by this function. If @var{force} is -non-@code{nil}, all @var{articles} should be deleted, no matter how new -they are. - -This function should return a list of articles that it did not/was not -able to delete. - -There should be no result data returned. - - -@item (nnchoke-request-move-article ARTICLE GROUP SERVER ACCEPT-FORM &optional LAST) - -This function should move @var{article} (which is a number) from -@var{group} by calling @var{accept-form}. - -This function should ready the article in question for moving by -removing any header lines it has added to the article, and generally -should ``tidy up'' the article. Then it should @code{eval} -@var{accept-form} in the buffer where the ``tidy'' article is. This -will do the actual copying. If this @code{eval} returns a -non-@code{nil} value, the article should be removed. - -If @var{last} is @code{nil}, that means that there is a high likelihood -that there will be more requests issued shortly, so that allows some -optimizations. - -The function should return a cons where the @code{car} is the group name and -the @code{cdr} is the article number that the article was entered as. - -There should be no data returned. - - -@item (nnchoke-request-accept-article GROUP &optional SERVER LAST) - -This function takes the current buffer and inserts it into @var{group}. -If @var{last} in @code{nil}, that means that there will be more calls to -this function in short order. - -The function should return a cons where the @code{car} is the group name and -the @code{cdr} is the article number that the article was entered as. - -The group should exist before the back end is asked to accept the -article for that group. - -There should be no data returned. - - -@item (nnchoke-request-replace-article ARTICLE GROUP BUFFER) - -This function should remove @var{article} (which is a number) from -@var{group} and insert @var{buffer} there instead. - -There should be no data returned. - - -@item (nnchoke-request-delete-group GROUP FORCE &optional SERVER) - -This function should delete @var{group}. If @var{force}, it should -really delete all the articles in the group, and then delete the group -itself. (If there is such a thing as ``the group itself''.) - -There should be no data returned. - - -@item (nnchoke-request-rename-group GROUP NEW-NAME &optional SERVER) - -This function should rename @var{group} into @var{new-name}. All -articles in @var{group} should move to @var{new-name}. - -There should be no data returned. - -@end table - - -@node Error Messaging -@subsubsection Error Messaging - -@findex nnheader-report -@findex nnheader-get-report -The back ends should use the function @code{nnheader-report} to report -error conditions---they should not raise errors when they aren't able to -perform a request. The first argument to this function is the back end -symbol, and the rest are interpreted as arguments to @code{format} if -there are multiple of them, or just a string if there is one of them. -This function must always returns @code{nil}. - -@lisp -(nnheader-report 'nnchoke "You did something totally bogus") - -(nnheader-report 'nnchoke "Could not request group %s" group) -@end lisp - -Gnus, in turn, will call @code{nnheader-get-report} when it gets a -@code{nil} back from a server, and this function returns the most -recently reported message for the back end in question. This function -takes one argument---the server symbol. - -Internally, these functions access @var{back-end}@code{-status-string}, -so the @code{nnchoke} back end will have its error message stored in -@code{nnchoke-status-string}. - - -@node Writing New Back Ends -@subsubsection Writing New Back Ends - -Many back ends are quite similar. @code{nnml} is just like -@code{nnspool}, but it allows you to edit the articles on the server. -@code{nnmh} is just like @code{nnml}, but it doesn't use an active file, -and it doesn't maintain overview databases. @code{nndir} is just like -@code{nnml}, but it has no concept of ``groups'', and it doesn't allow -editing articles. - -It would make sense if it were possible to ``inherit'' functions from -back ends when writing new back ends. And, indeed, you can do that if you -want to. (You don't have to if you don't want to, of course.) - -All the back ends declare their public variables and functions by using a -package called @code{nnoo}. - -To inherit functions from other back ends (and allow other back ends to -inherit functions from the current back end), you should use the -following macros: - -@table @code - -@item nnoo-declare -This macro declares the first parameter to be a child of the subsequent -parameters. For instance: - -@lisp -(nnoo-declare nndir - nnml nnmh) -@end lisp - -@code{nndir} has declared here that it intends to inherit functions from -both @code{nnml} and @code{nnmh}. - -@item defvoo -This macro is equivalent to @code{defvar}, but registers the variable as -a public server variable. Most state-oriented variables should be -declared with @code{defvoo} instead of @code{defvar}. - -In addition to the normal @code{defvar} parameters, it takes a list of -variables in the parent back ends to map the variable to when executing -a function in those back ends. - -@lisp -(defvoo nndir-directory nil - "Where nndir will look for groups." - nnml-current-directory nnmh-current-directory) -@end lisp - -This means that @code{nnml-current-directory} will be set to -@code{nndir-directory} when an @code{nnml} function is called on behalf -of @code{nndir}. (The same with @code{nnmh}.) - -@item nnoo-define-basics -This macro defines some common functions that almost all back ends should -have. - -@lisp -(nnoo-define-basics nndir) -@end lisp - -@item deffoo -This macro is just like @code{defun} and takes the same parameters. In -addition to doing the normal @code{defun} things, it registers the -function as being public so that other back ends can inherit it. - -@item nnoo-map-functions -This macro allows mapping of functions from the current back end to -functions from the parent back ends. - -@lisp -(nnoo-map-functions nndir - (nnml-retrieve-headers 0 nndir-current-group 0 0) - (nnmh-request-article 0 nndir-current-group 0 0)) -@end lisp - -This means that when @code{nndir-retrieve-headers} is called, the first, -third, and fourth parameters will be passed on to -@code{nnml-retrieve-headers}, while the second parameter is set to the -value of @code{nndir-current-group}. - -@item nnoo-import -This macro allows importing functions from back ends. It should be the -last thing in the source file, since it will only define functions that -haven't already been defined. - -@lisp -(nnoo-import nndir - (nnmh - nnmh-request-list - nnmh-request-newgroups) - (nnml)) -@end lisp - -This means that calls to @code{nndir-request-list} should just be passed -on to @code{nnmh-request-list}, while all public functions from -@code{nnml} that haven't been defined in @code{nndir} yet should be -defined now. - -@end table - -Below is a slightly shortened version of the @code{nndir} back end. - -@lisp -;;; @r{nndir.el --- single directory newsgroup access for Gnus} -;; @r{Copyright (C) 1995,96 Free Software Foundation, Inc.} - -;;; @r{Code:} - -(require 'nnheader) -(require 'nnmh) -(require 'nnml) -(require 'nnoo) -(eval-when-compile (require 'cl)) - -(nnoo-declare nndir - nnml nnmh) - -(defvoo nndir-directory nil - "Where nndir will look for groups." - nnml-current-directory nnmh-current-directory) - -(defvoo nndir-nov-is-evil nil - "*Non-nil means that nndir will never retrieve NOV headers." - nnml-nov-is-evil) - -(defvoo nndir-current-group "" - nil - nnml-current-group nnmh-current-group) -(defvoo nndir-top-directory nil nil nnml-directory nnmh-directory) -(defvoo nndir-get-new-mail nil nil nnml-get-new-mail nnmh-get-new-mail) - -(defvoo nndir-status-string "" nil nnmh-status-string) -(defconst nndir-version "nndir 1.0") - -;;; @r{Interface functions.} - -(nnoo-define-basics nndir) - -(deffoo nndir-open-server (server &optional defs) - (setq nndir-directory - (or (cadr (assq 'nndir-directory defs)) - server)) - (unless (assq 'nndir-directory defs) - (push `(nndir-directory ,server) defs)) - (push `(nndir-current-group - ,(file-name-nondirectory - (directory-file-name nndir-directory))) - defs) - (push `(nndir-top-directory - ,(file-name-directory (directory-file-name nndir-directory))) - defs) - (nnoo-change-server 'nndir server defs)) - -(nnoo-map-functions nndir - (nnml-retrieve-headers 0 nndir-current-group 0 0) - (nnmh-request-article 0 nndir-current-group 0 0) - (nnmh-request-group nndir-current-group 0 0) - (nnmh-close-group nndir-current-group 0)) - -(nnoo-import nndir - (nnmh - nnmh-status-message - nnmh-request-list - nnmh-request-newgroups)) - -(provide 'nndir) -@end lisp - - -@node Hooking New Back Ends Into Gnus -@subsubsection Hooking New Back Ends Into Gnus - -@vindex gnus-valid-select-methods -@findex gnus-declare-backend -Having Gnus start using your new back end is rather easy---you just -declare it with the @code{gnus-declare-backend} functions. This will -enter the back end into the @code{gnus-valid-select-methods} variable. - -@code{gnus-declare-backend} takes two parameters---the back end name and -an arbitrary number of @dfn{abilities}. - -Here's an example: - -@lisp -(gnus-declare-backend "nnchoke" 'mail 'respool 'address) -@end lisp - -The above line would then go in the @file{nnchoke.el} file. - -The abilities can be: - -@table @code -@item mail -This is a mailish back end---followups should (probably) go via mail. -@item post -This is a newsish back end---followups should (probably) go via news. -@item post-mail -This back end supports both mail and news. -@item none -This is neither a post nor mail back end---it's something completely -different. -@item respool -It supports respooling---or rather, it is able to modify its source -articles and groups. -@item address -The name of the server should be in the virtual server name. This is -true for almost all back ends. -@item prompt-address -The user should be prompted for an address when doing commands like -@kbd{B} in the group buffer. This is true for back ends like -@code{nntp}, but not @code{nnmbox}, for instance. -@end table - - -@node Mail-like Back Ends -@subsubsection Mail-like Back Ends - -One of the things that separate the mail back ends from the rest of the -back ends is the heavy dependence by most of the mail back ends on -common functions in @file{nnmail.el}. For instance, here's the -definition of @code{nnml-request-scan}: - -@lisp -(deffoo nnml-request-scan (&optional group server) - (setq nnml-article-file-alist nil) - (nnmail-get-new-mail 'nnml 'nnml-save-nov nnml-directory group)) -@end lisp - -It simply calls @code{nnmail-get-new-mail} with a few parameters, -and @code{nnmail} takes care of all the moving and splitting of the -mail. - -This function takes four parameters. - -@table @var -@item method -This should be a symbol to designate which back end is responsible for -the call. - -@item exit-function -This function should be called after the splitting has been performed. - -@item temp-directory -Where the temporary files should be stored. - -@item group -This optional argument should be a group name if the splitting is to be -performed for one group only. -@end table - -@code{nnmail-get-new-mail} will call @var{back-end}@code{-save-mail} to -save each article. @var{back-end}@code{-active-number} will be called to -find the article number assigned to this article. - -The function also uses the following variables: -@var{back-end}@code{-get-new-mail} (to see whether to get new mail for -this back end); and @var{back-end}@code{-group-alist} and -@var{back-end}@code{-active-file} to generate the new active file. -@var{back-end}@code{-group-alist} should be a group-active alist, like -this: - -@example -(("a-group" (1 . 10)) - ("some-group" (34 . 39))) -@end example - - -@node Score File Syntax -@subsection Score File Syntax - -Score files are meant to be easily parseable, but yet extremely -mallable. It was decided that something that had the same read syntax -as an Emacs Lisp list would fit that spec. - -Here's a typical score file: - -@lisp -(("summary" - ("win95" -10000 nil s) - ("Gnus")) - ("from" - ("Lars" -1000)) - (mark -100)) -@end lisp - -BNF definition of a score file: - -@example -score-file = "" / "(" *element ")" -element = rule / atom -rule = string-rule / number-rule / date-rule -string-rule = "(" quote string-header quote space *string-match ")" -number-rule = "(" quote number-header quote space *number-match ")" -date-rule = "(" quote date-header quote space *date-match ")" -quote = <ascii 34> -string-header = "subject" / "from" / "references" / "message-id" / - "xref" / "body" / "head" / "all" / "followup" -number-header = "lines" / "chars" -date-header = "date" -string-match = "(" quote <string> quote [ "" / [ space score [ "" / - space date [ "" / [ space string-match-t ] ] ] ] ] ")" -score = "nil" / <integer> -date = "nil" / <natural number> -string-match-t = "nil" / "s" / "substring" / "S" / "Substring" / - "r" / "regex" / "R" / "Regex" / - "e" / "exact" / "E" / "Exact" / - "f" / "fuzzy" / "F" / "Fuzzy" -number-match = "(" <integer> [ "" / [ space score [ "" / - space date [ "" / [ space number-match-t ] ] ] ] ] ")" -number-match-t = "nil" / "=" / "<" / ">" / ">=" / "<=" -date-match = "(" quote <string> quote [ "" / [ space score [ "" / - space date [ "" / [ space date-match-t ] ] ] ] ")" -date-match-t = "nil" / "at" / "before" / "after" -atom = "(" [ required-atom / optional-atom ] ")" -required-atom = mark / expunge / mark-and-expunge / files / - exclude-files / read-only / touched -optional-atom = adapt / local / eval -mark = "mark" space nil-or-number -nil-or-number = "nil" / <integer> -expunge = "expunge" space nil-or-number -mark-and-expunge = "mark-and-expunge" space nil-or-number -files = "files" *[ space <string> ] -exclude-files = "exclude-files" *[ space <string> ] -read-only = "read-only" [ space "nil" / space "t" ] -adapt = "adapt" [ space "ignore" / space "t" / space adapt-rule ] -adapt-rule = "(" *[ <string> *[ "(" <string> <integer> ")" ] ")" -local = "local" *[ space "(" <string> space <form> ")" ] -eval = "eval" space <form> -space = *[ " " / <TAB> / <NEWLINE> ] -@end example - -Any unrecognized elements in a score file should be ignored, but not -discarded. - -As you can see, white space is needed, but the type and amount of white -space is irrelevant. This means that formatting of the score file is -left up to the programmer---if it's simpler to just spew it all out on -one looong line, then that's ok. - -The meaning of the various atoms are explained elsewhere in this -manual (@pxref{Score File Format}). - - -@node Headers -@subsection Headers - -Internally Gnus uses a format for storing article headers that -corresponds to the @acronym{NOV} format in a mysterious fashion. One could -almost suspect that the author looked at the @acronym{NOV} specification and -just shamelessly @emph{stole} the entire thing, and one would be right. - -@dfn{Header} is a severely overloaded term. ``Header'' is used in -RFC 1036 to talk about lines in the head of an article (e.g., -@code{From}). It is used by many people as a synonym for -``head''---``the header and the body''. (That should be avoided, in my -opinion.) And Gnus uses a format internally that it calls ``header'', -which is what I'm talking about here. This is a 9-element vector, -basically, with each header (ouch) having one slot. - -These slots are, in order: @code{number}, @code{subject}, @code{from}, -@code{date}, @code{id}, @code{references}, @code{chars}, @code{lines}, -@code{xref}, and @code{extra}. There are macros for accessing and -setting these slots---they all have predictable names beginning with -@code{mail-header-} and @code{mail-header-set-}, respectively. - -All these slots contain strings, except the @code{extra} slot, which -contains an alist of header/value pairs (@pxref{To From Newsgroups}). - - -@node Ranges -@subsection Ranges - -@sc{gnus} introduced a concept that I found so useful that I've started -using it a lot and have elaborated on it greatly. - -The question is simple: If you have a large amount of objects that are -identified by numbers (say, articles, to take a @emph{wild} example) -that you want to qualify as being ``included'', a normal sequence isn't -very useful. (A 200,000 length sequence is a bit long-winded.) - -The solution is as simple as the question: You just collapse the -sequence. - -@example -(1 2 3 4 5 6 10 11 12) -@end example - -is transformed into - -@example -((1 . 6) (10 . 12)) -@end example - -To avoid having those nasty @samp{(13 . 13)} elements to denote a -lonesome object, a @samp{13} is a valid element: - -@example -((1 . 6) 7 (10 . 12)) -@end example - -This means that comparing two ranges to find out whether they are equal -is slightly tricky: - -@example -((1 . 5) 7 8 (10 . 12)) -@end example - -and - -@example -((1 . 5) (7 . 8) (10 . 12)) -@end example - -are equal. In fact, any non-descending list is a range: - -@example -(1 2 3 4 5) -@end example - -is a perfectly valid range, although a pretty long-winded one. This is -also valid: - -@example -(1 . 5) -@end example - -and is equal to the previous range. - -Here's a BNF definition of ranges. Of course, one must remember the -semantic requirement that the numbers are non-descending. (Any number -of repetition of the same number is allowed, but apt to disappear in -range handling.) - -@example -range = simple-range / normal-range -simple-range = "(" number " . " number ")" -normal-range = "(" start-contents ")" -contents = "" / simple-range *[ " " contents ] / - number *[ " " contents ] -@end example - -Gnus currently uses ranges to keep track of read articles and article -marks. I plan on implementing a number of range operators in C if The -Powers That Be are willing to let me. (I haven't asked yet, because I -need to do some more thinking on what operators I need to make life -totally range-based without ever having to convert back to normal -sequences.) - - -@node Group Info -@subsection Group Info - -Gnus stores all permanent info on groups in a @dfn{group info} list. -This list is from three to six elements (or more) long and exhaustively -describes the group. - -Here are two example group infos; one is a very simple group while the -second is a more complex one: - -@example -("no.group" 5 ((1 . 54324))) - -("nnml:my.mail" 3 ((1 . 5) 9 (20 . 55)) - ((tick (15 . 19)) (replied 3 6 (19 . 3))) - (nnml "") - ((auto-expire . t) (to-address . "ding@@gnus.org"))) -@end example - -The first element is the @dfn{group name}---as Gnus knows the group, -anyway. The second element is the @dfn{subscription level}, which -normally is a small integer. (It can also be the @dfn{rank}, which is a -cons cell where the @code{car} is the level and the @code{cdr} is the -score.) The third element is a list of ranges of read articles. The -fourth element is a list of lists of article marks of various kinds. -The fifth element is the select method (or virtual server, if you like). -The sixth element is a list of @dfn{group parameters}, which is what -this section is about. - -Any of the last three elements may be missing if they are not required. -In fact, the vast majority of groups will normally only have the first -three elements, which saves quite a lot of cons cells. - -Here's a BNF definition of the group info format: - -@example -info = "(" group space ralevel space read - [ "" / [ space marks-list [ "" / [ space method [ "" / - space parameters ] ] ] ] ] ")" -group = quote <string> quote -ralevel = rank / level -level = <integer in the range of 1 to inf> -rank = "(" level "." score ")" -score = <integer in the range of 1 to inf> -read = range -marks-lists = nil / "(" *marks ")" -marks = "(" <string> range ")" -method = "(" <string> *elisp-forms ")" -parameters = "(" *elisp-forms ")" -@end example - -Actually that @samp{marks} rule is a fib. A @samp{marks} is a -@samp{<string>} consed on to a @samp{range}, but that's a bitch to say -in pseudo-BNF. - -If you have a Gnus info and want to access the elements, Gnus offers a -series of macros for getting/setting these elements. - -@table @code -@item gnus-info-group -@itemx gnus-info-set-group -@findex gnus-info-group -@findex gnus-info-set-group -Get/set the group name. - -@item gnus-info-rank -@itemx gnus-info-set-rank -@findex gnus-info-rank -@findex gnus-info-set-rank -Get/set the group rank (@pxref{Group Score}). - -@item gnus-info-level -@itemx gnus-info-set-level -@findex gnus-info-level -@findex gnus-info-set-level -Get/set the group level. - -@item gnus-info-score -@itemx gnus-info-set-score -@findex gnus-info-score -@findex gnus-info-set-score -Get/set the group score (@pxref{Group Score}). - -@item gnus-info-read -@itemx gnus-info-set-read -@findex gnus-info-read -@findex gnus-info-set-read -Get/set the ranges of read articles. - -@item gnus-info-marks -@itemx gnus-info-set-marks -@findex gnus-info-marks -@findex gnus-info-set-marks -Get/set the lists of ranges of marked articles. - -@item gnus-info-method -@itemx gnus-info-set-method -@findex gnus-info-method -@findex gnus-info-set-method -Get/set the group select method. - -@item gnus-info-params -@itemx gnus-info-set-params -@findex gnus-info-params -@findex gnus-info-set-params -Get/set the group parameters. -@end table - -All the getter functions take one parameter---the info list. The setter -functions take two parameters---the info list and the new value. - -The last three elements in the group info aren't mandatory, so it may be -necessary to extend the group info before setting the element. If this -is necessary, you can just pass on a non-@code{nil} third parameter to -the three final setter functions to have this happen automatically. - - -@node Extended Interactive -@subsection Extended Interactive -@cindex interactive -@findex gnus-interactive - -Gnus extends the standard Emacs @code{interactive} specification -slightly to allow easy use of the symbolic prefix (@pxref{Symbolic -Prefixes}). Here's an example of how this is used: - -@lisp -(defun gnus-summary-increase-score (&optional score symp) - (interactive (gnus-interactive "P\ny")) - ... - ) -@end lisp - -The best thing to do would have been to implement -@code{gnus-interactive} as a macro which would have returned an -@code{interactive} form, but this isn't possible since Emacs checks -whether a function is interactive or not by simply doing an @code{assq} -on the lambda form. So, instead we have @code{gnus-interactive} -function that takes a string and returns values that are usable to -@code{interactive}. - -This function accepts (almost) all normal @code{interactive} specs, but -adds a few more. - -@table @samp -@item y -@vindex gnus-current-prefix-symbol -The current symbolic prefix---the @code{gnus-current-prefix-symbol} -variable. - -@item Y -@vindex gnus-current-prefix-symbols -A list of the current symbolic prefixes---the -@code{gnus-current-prefix-symbol} variable. - -@item A -The current article number---the @code{gnus-summary-article-number} -function. - -@item H -The current article header---the @code{gnus-summary-article-header} -function. - -@item g -The current group name---the @code{gnus-group-group-name} -function. - -@end table - - -@node Emacs/XEmacs Code -@subsection Emacs/XEmacs Code -@cindex XEmacs -@cindex Emacsen - -While Gnus runs under Emacs, XEmacs and Mule, I decided that one of the -platforms must be the primary one. I chose Emacs. Not because I don't -like XEmacs or Mule, but because it comes first alphabetically. - -This means that Gnus will byte-compile under Emacs with nary a warning, -while XEmacs will pump out gigabytes of warnings while byte-compiling. -As I use byte-compilation warnings to help me root out trivial errors in -Gnus, that's very useful. - -I've also consistently used Emacs function interfaces, but have used -Gnusey aliases for the functions. To take an example: Emacs defines a -@code{run-at-time} function while XEmacs defines a @code{start-itimer} -function. I then define a function called @code{gnus-run-at-time} that -takes the same parameters as the Emacs @code{run-at-time}. When running -Gnus under Emacs, the former function is just an alias for the latter. -However, when running under XEmacs, the former is an alias for the -following function: - -@lisp -(defun gnus-xmas-run-at-time (time repeat function &rest args) - (start-itimer - "gnus-run-at-time" - `(lambda () - (,function ,@@args)) - time repeat)) -@end lisp - -This sort of thing has been done for bunches of functions. Gnus does -not redefine any native Emacs functions while running under XEmacs---it -does this @code{defalias} thing with Gnus equivalents instead. Cleaner -all over. - -In the cases where the XEmacs function interface was obviously cleaner, -I used it instead. For example @code{gnus-region-active-p} is an alias -for @code{region-active-p} in XEmacs, whereas in Emacs it is a function. - -Of course, I could have chosen XEmacs as my native platform and done -mapping functions the other way around. But I didn't. The performance -hit these indirections impose on Gnus under XEmacs should be slight. - - -@node Various File Formats -@subsection Various File Formats - -@menu -* Active File Format:: Information on articles and groups available. -* Newsgroups File Format:: Group descriptions. -@end menu - - -@node Active File Format -@subsubsection Active File Format - -The active file lists all groups available on the server in -question. It also lists the highest and lowest current article numbers -in each group. - -Here's an excerpt from a typical active file: - -@example -soc.motss 296030 293865 y -alt.binaries.pictures.fractals 3922 3913 n -comp.sources.unix 1605 1593 m -comp.binaries.ibm.pc 5097 5089 y -no.general 1000 900 y -@end example - -Here's a pseudo-BNF definition of this file: - -@example -active = *group-line -group-line = group spc high-number spc low-number spc flag <NEWLINE> -group = <non-white-space string> -spc = " " -high-number = <non-negative integer> -low-number = <positive integer> -flag = "y" / "n" / "m" / "j" / "x" / "=" group -@end example - -For a full description of this file, see the manual pages for -@samp{innd}, in particular @samp{active(5)}. - - -@node Newsgroups File Format -@subsubsection Newsgroups File Format - -The newsgroups file lists groups along with their descriptions. Not all -groups on the server have to be listed, and not all groups in the file -have to exist on the server. The file is meant purely as information to -the user. - -The format is quite simple; a group name, a tab, and the description. -Here's the definition: - -@example -newsgroups = *line -line = group tab description <NEWLINE> -group = <non-white-space string> -tab = <TAB> -description = <string> -@end example - - -@page -@node Emacs for Heathens -@section Emacs for Heathens - -Believe it or not, but some people who use Gnus haven't really used -Emacs much before they embarked on their journey on the Gnus Love Boat. -If you are one of those unfortunates whom ``@kbd{C-M-a}'', ``kill the -region'', and ``set @code{gnus-flargblossen} to an alist where the key -is a regexp that is used for matching on the group name'' are magical -phrases with little or no meaning, then this appendix is for you. If -you are already familiar with Emacs, just ignore this and go fondle your -cat instead. - -@menu -* Keystrokes:: Entering text and executing commands. -* Emacs Lisp:: The built-in Emacs programming language. -@end menu - - -@node Keystrokes -@subsection Keystrokes - -@itemize @bullet -@item -Q: What is an experienced Emacs user? - -@item -A: A person who wishes that the terminal had pedals. -@end itemize - -Yes, when you use Emacs, you are apt to use the control key, the shift -key and the meta key a lot. This is very annoying to some people -(notably @code{vi}le users), and the rest of us just love the hell out -of it. Just give up and submit. Emacs really does stand for -``Escape-Meta-Alt-Control-Shift'', and not ``Editing Macros'', as you -may have heard from other disreputable sources (like the Emacs author). - -The shift keys are normally located near your pinky fingers, and are -normally used to get capital letters and stuff. You probably use it all -the time. The control key is normally marked ``CTRL'' or something like -that. The meta key is, funnily enough, never marked as such on any -keyboard. The one I'm currently at has a key that's marked ``Alt'', -which is the meta key on this keyboard. It's usually located somewhere -to the left hand side of the keyboard, usually on the bottom row. - -Now, us Emacs people don't say ``press the meta-control-m key'', -because that's just too inconvenient. We say ``press the @kbd{C-M-m} -key''. @kbd{M-} is the prefix that means ``meta'' and ``C-'' is the -prefix that means ``control''. So ``press @kbd{C-k}'' means ``press -down the control key, and hold it down while you press @kbd{k}''. -``Press @kbd{C-M-k}'' means ``press down and hold down the meta key and -the control key and then press @kbd{k}''. Simple, ay? - -This is somewhat complicated by the fact that not all keyboards have a -meta key. In that case you can use the ``escape'' key. Then @kbd{M-k} -means ``press escape, release escape, press @kbd{k}''. That's much more -work than if you have a meta key, so if that's the case, I respectfully -suggest you get a real keyboard with a meta key. You can't live without -it. - - - -@node Emacs Lisp -@subsection Emacs Lisp - -Emacs is the King of Editors because it's really a Lisp interpreter. -Each and every key you tap runs some Emacs Lisp code snippet, and since -Emacs Lisp is an interpreted language, that means that you can configure -any key to run any arbitrary code. You just, like, do it. - -Gnus is written in Emacs Lisp, and is run as a bunch of interpreted -functions. (These are byte-compiled for speed, but it's still -interpreted.) If you decide that you don't like the way Gnus does -certain things, it's trivial to have it do something a different way. -(Well, at least if you know how to write Lisp code.) However, that's -beyond the scope of this manual, so we are simply going to talk about -some common constructs that you normally use in your @file{~/.gnus.el} -file to customize Gnus. (You can also use the @file{~/.emacs} file, but -in order to set things of Gnus up, it is much better to use the -@file{~/.gnus.el} file, @xref{Startup Files}.) - -If you want to set the variable @code{gnus-florgbnize} to four (4), you -write the following: - -@lisp -(setq gnus-florgbnize 4) -@end lisp - -This function (really ``special form'') @code{setq} is the one that can -set a variable to some value. This is really all you need to know. Now -you can go and fill your @file{~/.gnus.el} file with lots of these to -change how Gnus works. - -If you have put that thing in your @file{~/.gnus.el} file, it will be -read and @code{eval}ed (which is Lisp-ese for ``run'') the next time you -start Gnus. If you want to change the variable right away, simply say -@kbd{C-x C-e} after the closing parenthesis. That will @code{eval} the -previous ``form'', which is a simple @code{setq} statement here. - -Go ahead---just try it, if you're located at your Emacs. After you -@kbd{C-x C-e}, you will see @samp{4} appear in the echo area, which -is the return value of the form you @code{eval}ed. - -Some pitfalls: - -If the manual says ``set @code{gnus-read-active-file} to @code{some}'', -that means: - -@lisp -(setq gnus-read-active-file 'some) -@end lisp - -On the other hand, if the manual says ``set @code{gnus-nntp-server} to -@samp{nntp.ifi.uio.no}'', that means: - -@lisp -(setq gnus-nntp-server "nntp.ifi.uio.no") -@end lisp - -So be careful not to mix up strings (the latter) with symbols (the -former). The manual is unambiguous, but it can be confusing. - -@page -@include gnus-faq.texi - -@node GNU Free Documentation License -@chapter GNU Free Documentation License -@include doclicense.texi - -@node Index -@chapter Index -@printindex cp - -@node Key Index -@chapter Key Index -@printindex ky - -@summarycontents -@contents -@bye - -@iftex -@iflatex -\end{document} -@end iflatex -@end iftex - -@c Local Variables: -@c mode: texinfo -@c coding: iso-8859-1 -@c End: - -@ignore - arch-tag: c9fa47e7-78ca-4681-bda9-9fef45d1c819 -@end ignore diff --git a/man/gpl.texi b/man/gpl.texi deleted file mode 100644 index 5b416d3cb41..00000000000 --- a/man/gpl.texi +++ /dev/null @@ -1,721 +0,0 @@ -@c The GNU General Public License. -@center Version 3, 29 June 2007 - -@c This file is intended to be included within another document, -@c hence no sectioning command or @node. - -@display -Copyright @copyright{} 2007 Free Software Foundation, Inc. @url{http://fsf.org/} - -Everyone is permitted to copy and distribute verbatim copies of this -license document, but changing it is not allowed. -@end display - -@heading Preamble - -The GNU General Public License is a free, copyleft license for -software and other kinds of works. - -The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom -to share and change all versions of a program---to make sure it remains -free software for all its users. We, the Free Software Foundation, -use the GNU General Public License for most of our software; it -applies also to any other work released this way by its authors. You -can apply it to your programs, too. - -When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - -To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you -have certain responsibilities if you distribute copies of the -software, or if you modify it: responsibilities to respect the freedom -of others. - -For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, -receive or can get the source code. And you must show them these -terms so they know their rights. - -Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - -For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - -Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the -manufacturer can do so. This is fundamentally incompatible with the -aim of protecting users' freedom to change the software. The -systematic pattern of such abuse occurs in the area of products for -individuals to use, which is precisely where it is most unacceptable. -Therefore, we have designed this version of the GPL to prohibit the -practice for those products. If such problems arise substantially in -other domains, we stand ready to extend this provision to those -domains in future versions of the GPL, as needed to protect the -freedom of users. - -Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish -to avoid the special danger that patents applied to a free program -could make it effectively proprietary. To prevent this, the GPL -assures that patents cannot be used to render the program non-free. - -The precise terms and conditions for copying, distribution and -modification follow. - -@heading TERMS AND CONDITIONS - -@enumerate 0 -@item Definitions. - -``This License'' refers to version 3 of the GNU General Public License. - -``Copyright'' also means copyright-like laws that apply to other kinds -of works, such as semiconductor masks. - -``The Program'' refers to any copyrightable work licensed under this -License. Each licensee is addressed as ``you''. ``Licensees'' and -``recipients'' may be individuals or organizations. - -To ``modify'' a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of -an exact copy. The resulting work is called a ``modified version'' of -the earlier work or a work ``based on'' the earlier work. - -A ``covered work'' means either the unmodified Program or a work based -on the Program. - -To ``propagate'' a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - -To ``convey'' a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user -through a computer network, with no transfer of a copy, is not -conveying. - -An interactive user interface displays ``Appropriate Legal Notices'' to -the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - -@item Source Code. - -The ``source code'' for a work means the preferred form of the work for -making modifications to it. ``Object code'' means any non-source form -of a work. - -A ``Standard Interface'' means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - -The ``System Libraries'' of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -``Major Component'', in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - -The ``Corresponding Source'' for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - -The Corresponding Source need not include anything that users can -regenerate automatically from other parts of the Corresponding Source. - -The Corresponding Source for a work in source code form is that same -work. - -@item Basic Permissions. - -All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - -You may make, run and propagate covered works that you do not convey, -without conditions so long as your license otherwise remains in force. -You may convey covered works to others for the sole purpose of having -them make modifications exclusively for you, or provide you with -facilities for running those works, provided that you comply with the -terms of this License in conveying all material for which you do not -control copyright. Those thus making or running the covered works for -you must do so exclusively on your behalf, under your direction and -control, on terms that prohibit them from making any copies of your -copyrighted material outside their relationship with you. - -Conveying under any other circumstances is permitted solely under the -conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - -@item Protecting Users' Legal Rights From Anti-Circumvention Law. - -No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - -When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such -circumvention is effected by exercising rights under this License with -respect to the covered work, and you disclaim any intention to limit -operation or modification of the work as a means of enforcing, against -the work's users, your or third parties' legal rights to forbid -circumvention of technological measures. - -@item Conveying Verbatim Copies. - -You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - -You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - -@item Conveying Modified Source Versions. - -You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these -conditions: - -@enumerate a -@item -The work must carry prominent notices stating that you modified it, -and giving a relevant date. - -@item -The work must carry prominent notices stating that it is released -under this License and any conditions added under section 7. This -requirement modifies the requirement in section 4 to ``keep intact all -notices''. - -@item -You must license the entire work, as a whole, under this License to -anyone who comes into possession of a copy. This License will -therefore apply, along with any applicable section 7 additional terms, -to the whole of the work, and all its parts, regardless of how they -are packaged. This License gives no permission to license the work in -any other way, but it does not invalidate such permission if you have -separately received it. - -@item -If the work has interactive user interfaces, each must display -Appropriate Legal Notices; however, if the Program has interactive -interfaces that do not display Appropriate Legal Notices, your work -need not make them do so. -@end enumerate - -A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -``aggregate'' if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - -@item Conveying Non-Source Forms. - -You may convey a covered work in object code form under the terms of -sections 4 and 5, provided that you also convey the machine-readable -Corresponding Source under the terms of this License, in one of these -ways: - -@enumerate a -@item -Convey the object code in, or embodied in, a physical product -(including a physical distribution medium), accompanied by the -Corresponding Source fixed on a durable physical medium customarily -used for software interchange. - -@item -Convey the object code in, or embodied in, a physical product -(including a physical distribution medium), accompanied by a written -offer, valid for at least three years and valid for as long as you -offer spare parts or customer support for that product model, to give -anyone who possesses the object code either (1) a copy of the -Corresponding Source for all the software in the product that is -covered by this License, on a durable physical medium customarily used -for software interchange, for a price no more than your reasonable -cost of physically performing this conveying of source, or (2) access -to copy the Corresponding Source from a network server at no charge. - -@item -Convey individual copies of the object code with a copy of the written -offer to provide the Corresponding Source. This alternative is -allowed only occasionally and noncommercially, and only if you -received the object code with such an offer, in accord with subsection -6b. - -@item -Convey the object code by offering access from a designated place -(gratis or for a charge), and offer equivalent access to the -Corresponding Source in the same way through the same place at no -further charge. You need not require recipients to copy the -Corresponding Source along with the object code. If the place to copy -the object code is a network server, the Corresponding Source may be -on a different server (operated by you or a third party) that supports -equivalent copying facilities, provided you maintain clear directions -next to the object code saying where to find the Corresponding Source. -Regardless of what server hosts the Corresponding Source, you remain -obligated to ensure that it is available for as long as needed to -satisfy these requirements. - -@item -Convey the object code using peer-to-peer transmission, provided you -inform other peers where the object code and Corresponding Source of -the work are being offered to the general public at no charge under -subsection 6d. - -@end enumerate - -A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - -A ``User Product'' is either (1) a ``consumer product'', which means any -tangible personal property which is normally used for personal, -family, or household purposes, or (2) anything designed or sold for -incorporation into a dwelling. In determining whether a product is a -consumer product, doubtful cases shall be resolved in favor of -coverage. For a particular product received by a particular user, -``normally used'' refers to a typical or common use of that class of -product, regardless of the status of the particular user or of the way -in which the particular user actually uses, or expects or is expected -to use, the product. A product is a consumer product regardless of -whether the product has substantial commercial, industrial or -non-consumer uses, unless such uses represent the only significant -mode of use of the product. - -``Installation Information'' for a User Product means any methods, -procedures, authorization keys, or other information required to -install and execute modified versions of a covered work in that User -Product from a modified version of its Corresponding Source. The -information must suffice to ensure that the continued functioning of -the modified object code is in no case prevented or interfered with -solely because modification has been made. - -If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - -The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or -updates for a work that has been modified or installed by the -recipient, or for the User Product in which it has been modified or -installed. Access to a network may be denied when the modification -itself materially and adversely affects the operation of the network -or violates the rules and protocols for communication across the -network. - -Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - -@item Additional Terms. - -``Additional permissions'' are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - -When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - -Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders -of that material) supplement the terms of this License with terms: - -@enumerate a -@item -Disclaiming warranty or limiting liability differently from the terms -of sections 15 and 16 of this License; or - -@item -Requiring preservation of specified reasonable legal notices or author -attributions in that material or in the Appropriate Legal Notices -displayed by works containing it; or - -@item -Prohibiting misrepresentation of the origin of that material, or -requiring that modified versions of such material be marked in -reasonable ways as different from the original version; or - -@item -Limiting the use for publicity purposes of names of licensors or -authors of the material; or - -@item -Declining to grant rights under trademark law for use of some trade -names, trademarks, or service marks; or - -@item -Requiring indemnification of licensors and authors of that material by -anyone who conveys the material (or modified versions of it) with -contractual assumptions of liability to the recipient, for any -liability that these contractual assumptions directly impose on those -licensors and authors. -@end enumerate - -All other non-permissive additional terms are considered ``further -restrictions'' within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - -If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - -Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; the -above requirements apply either way. - -@item Termination. - -You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - -However, if you cease all violation of this License, then your license -from a particular copyright holder is reinstated (a) provisionally, -unless and until the copyright holder explicitly and finally -terminates your license, and (b) permanently, if the copyright holder -fails to notify you of the violation by some reasonable means prior to -60 days after the cessation. - -Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - -Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - -@item Acceptance Not Required for Having Copies. - -You are not required to accept this License in order to receive or run -a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - -@item Automatic Licensing of Downstream Recipients. - -Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - -An ``entity transaction'' is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - -You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - -@item Patents. - -A ``contributor'' is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's ``contributor version''. - -A contributor's ``essential patent claims'' are all patent claims owned -or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, ``control'' includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - -Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - -In the following three paragraphs, a ``patent license'' is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To ``grant'' such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - -If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. ``Knowingly relying'' means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - -If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - -A patent license is ``discriminatory'' if it does not include within the -scope of its coverage, prohibits the exercise of, or is conditioned on -the non-exercise of one or more of the rights that are specifically -granted under this License. You may not convey a covered work if you -are a party to an arrangement with a third party that is in the -business of distributing software, under which you make payment to the -third party based on the extent of your activity of conveying the -work, and under which the third party grants, to any of the parties -who would receive the covered work from you, a discriminatory patent -license (a) in connection with copies of the covered work conveyed by -you (or copies made from those copies), or (b) primarily for and in -connection with specific products or compilations that contain the -covered work, unless you entered into that arrangement, or that patent -license was granted, prior to 28 March 2007. - -Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - -@item No Surrender of Others' Freedom. - -If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey -a covered work so as to satisfy simultaneously your obligations under -this License and any other pertinent obligations, then as a -consequence you may not convey it at all. For example, if you agree -to terms that obligate you to collect a royalty for further conveying -from those to whom you convey the Program, the only way you could -satisfy both those terms and this License would be to refrain entirely -from conveying the Program. - -@item Use with the GNU Affero General Public License. - -Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - -@item Revised Versions of this License. - -The Free Software Foundation may publish revised and/or new versions -of the GNU General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies that a certain numbered version of the GNU General Public -License ``or any later version'' applies to it, you have the option of -following the terms and conditions either of that numbered version or -of any later version published by the Free Software Foundation. If -the Program does not specify a version number of the GNU General -Public License, you may choose any version ever published by the Free -Software Foundation. - -If the Program specifies that a proxy can decide which future versions -of the GNU General Public License can be used, that proxy's public -statement of acceptance of a version permanently authorizes you to -choose that version for the Program. - -Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - -@item Disclaimer of Warranty. - -THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM ``AS IS'' WITHOUT -WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND -PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE -DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR -CORRECTION. - -@item Limitation of Liability. - -IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR -CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT -NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR -LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM -TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER -PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -@item Interpretation of Sections 15 and 16. - -If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - -@end enumerate - -@heading END OF TERMS AND CONDITIONS - -@heading How to Apply These Terms to Your New Programs - -If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these -terms. - -To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the ``copyright'' line and a pointer to where the full notice is found. - -@smallexample -@var{one line to give the program's name and a brief idea of what it does.} -Copyright (C) @var{year} @var{name of author} - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or (at -your option) any later version. - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see @url{http://www.gnu.org/licenses/}. -@end smallexample - -Also add information on how to contact you by electronic and paper mail. - -If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - -@smallexample -@var{program} Copyright (C) @var{year} @var{name of author} -This program comes with ABSOLUTELY NO WARRANTY; for details type @samp{show w}. -This is free software, and you are welcome to redistribute it -under certain conditions; type @samp{show c} for details. -@end smallexample - -The hypothetical commands @samp{show w} and @samp{show c} should show -the appropriate parts of the General Public License. Of course, your -program's commands might be different; for a GUI interface, you would -use an ``about box''. - -You should also get your employer (if you work as a programmer) or school, -if any, to sign a ``copyright disclaimer'' for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -@url{http://www.gnu.org/licenses/}. - -The GNU General Public License does not permit incorporating your -program into proprietary programs. If your program is a subroutine -library, you may consider it more useful to permit linking proprietary -applications with the library. If this is what you want to do, use -the GNU Lesser General Public License instead of this License. But -first, please read @url{http://www.gnu.org/philosophy/why-not-lgpl.html}. - -@ignore - arch-tag: 0c4a2556-f87e-464f-9b1d-efd920fcaf67 -@end ignore diff --git a/man/m-x.texi b/man/m-x.texi deleted file mode 100644 index 7a5b80fd348..00000000000 --- a/man/m-x.texi +++ /dev/null @@ -1,75 +0,0 @@ -@c This is part of the Emacs manual. -@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2001, 2002, -@c 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. -@c See file emacs.texi for copying conditions. -@node M-x, Help, Minibuffer, Top -@chapter Running Commands by Name - - Every Emacs command has a name that you can use to run it. For -convenience, many commands also have key bindings. You can run those -commands by typing the keys, or run them by name. Most Emacs commands -have no key bindings, so the only way to run them is by name. -(@xref{Key Bindings}, for how to set up key bindings.) - - By convention, a command name consists of one or more words, -separated by hyphens; for example, @code{auto-fill-mode} or -@code{manual-entry}. Command names mostly use complete English words -to make them easier to remember. - -@kindex M-x - To run a command by name, start with @kbd{M-x}, type the command -name, then terminate it with @key{RET}. @kbd{M-x} uses the minibuffer -to read the command name. The string @samp{M-x} appears at the -beginning of the minibuffer as a @dfn{prompt} to remind you to enter a -command name to be run. @key{RET} exits the minibuffer and runs the -command. @xref{Minibuffer}, for more information on the minibuffer. - - You can use completion to enter the command name. For example, -to invoke the command @code{forward-char}, you can type - -@example -M-x forward-char @key{RET} -@end example - -@noindent -or - -@example -M-x forw @key{TAB} c @key{RET} -@end example - -@noindent -Note that @code{forward-char} is the same command that you invoke with -the key @kbd{C-f}. The existence of a key binding does not stop you -from running the command by name. - - To cancel the @kbd{M-x} and not run a command, type @kbd{C-g} instead -of entering the command name. This takes you back to command level. - - To pass a numeric argument to the command you are invoking with -@kbd{M-x}, specify the numeric argument before @kbd{M-x}. The -argument value appears in the prompt while the command name is being -read, and finally @kbd{M-x} passes the argument to that command. - -@vindex suggest-key-bindings - When the command you run with @kbd{M-x} has a key binding, Emacs -mentions this in the echo area after running the command. For -example, if you type @kbd{M-x forward-word}, the message says that you -can run the same command by typing @kbd{M-f}. You can turn off these -messages by setting the variable @code{suggest-key-bindings} to -@code{nil}. - - In this manual, when we speak of running a command by name, we often -omit the @key{RET} that terminates the name. Thus we might say -@kbd{M-x auto-fill-mode} rather than @kbd{M-x auto-fill-mode -@key{RET}}. We mention the @key{RET} only for emphasis, such as when -the command is followed by arguments. - -@findex execute-extended-command - @kbd{M-x} works by running the command -@code{execute-extended-command}, which is responsible for reading the -name of another command and invoking it. - -@ignore - arch-tag: b67bff53-9628-4666-b94e-eda972a7ba56 -@end ignore diff --git a/man/mark.texi b/man/mark.texi deleted file mode 100644 index be446ab6bfc..00000000000 --- a/man/mark.texi +++ /dev/null @@ -1,452 +0,0 @@ -@c This is part of the Emacs manual. -@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2001, 2002, -@c 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. -@c See file emacs.texi for copying conditions. -@node Mark, Killing, Help, Top -@chapter The Mark and the Region -@cindex mark -@cindex setting a mark -@cindex region - - Many Emacs commands operate on an arbitrary contiguous part of the -current buffer. To specify the text for such a command to operate on, -you set @dfn{the mark} at one end of it, and move point to the other -end. The text between point and the mark is called @dfn{the region}. -Emacs highlights the region whenever there is one, if you enable -Transient Mark mode (@pxref{Transient Mark}). - - Certain Emacs commands set the mark; other editing commands do not -affect it, so the mark remains where you set it last. Each Emacs -buffer has its own mark, and setting the mark in one buffer has no -effect on other buffers' marks. When you return to a buffer that was -current earlier, its mark is at the same place as before. - - The ends of the region are always point and the mark. It doesn't -matter which of them was put in its current place first, or which one -comes earlier in the text---the region starts from point or the mark -(whichever comes first), and ends at point or the mark (whichever -comes last). Every time you move point, or set the mark in a new -place, the region changes. - - Many commands that insert text, such as @kbd{C-y} (@code{yank}) and -@kbd{M-x insert-buffer}, position point and the mark at opposite ends -of the inserted text, so that the region consists of the text just -inserted. - - Aside from delimiting the region, the mark is also useful for -remembering a spot that you may want to go back to. To make this -feature more useful, each buffer remembers 16 previous locations of the -mark in the @dfn{mark ring}. - -@menu -* Setting Mark:: Commands to set the mark. -* Transient Mark:: How to make Emacs highlight the region-- - when there is one. -* Momentary Mark:: Enabling Transient Mark mode momentarily. -* Using Region:: Summary of ways to operate on contents of the region. -* Marking Objects:: Commands to put region around textual units. -* Mark Ring:: Previous mark positions saved so you can go back there. -* Global Mark Ring:: Previous mark positions in various buffers. -@end menu - -@node Setting Mark -@section Setting the Mark - - Here are some commands for setting the mark: - -@table @kbd -@item C-@key{SPC} -Set the mark where point is (@code{set-mark-command}). -@item C-@@ -The same. -@item C-x C-x -Interchange mark and point (@code{exchange-point-and-mark}). -@item Drag-Mouse-1 -Set point and the mark around the text you drag across. -@item Mouse-3 -Set the mark where point is, then move point to where you click -(@code{mouse-save-then-kill}). -@end table - - For example, suppose you wish to convert part of the buffer to -upper case, using the @kbd{C-x C-u} (@code{upcase-region}) command, -which operates on the text in the region. You can first go to the -beginning of the text to be capitalized, type @kbd{C-@key{SPC}} to put -the mark there, move to the end, and then type @kbd{C-x C-u}. Or, you -can set the mark at the end of the text, move to the beginning, and then -type @kbd{C-x C-u}. - -@kindex C-SPC -@findex set-mark-command - The most common way to set the mark is with the @kbd{C-@key{SPC}} command -(@code{set-mark-command}). This sets the mark where point is. Then you -can move point away, leaving the mark behind. - - There are two ways to set the mark with the mouse. You can drag mouse -button one across a range of text; that puts point where you release the -mouse button, and sets the mark at the other end of that range. Or you -can click mouse button three, which sets the mark at point (like -@kbd{C-@key{SPC}}) and then moves point where you clicked (like -@kbd{Mouse-1}). - - Using the mouse to mark a region copies the region into the kill -ring in addition to setting the mark; that gives behavior consistent -with other window-driven applications. If you don't want to modify -the kill ring, you must use keyboard commands to set the mark. -@xref{Mouse Commands}. - -@kindex C-x C-x -@findex exchange-point-and-mark - When Emacs was developed, terminals had only one cursor, so Emacs -does not show where the mark is located--you have to remember. If you -enable Transient Mark mode (see below), then the region is highlighted -when it is active; you can tell mark is at the other end of the -highlighted region. But this only applies when the mark is active. - - The usual solution to this problem is to set the mark and then use -it soon, before you forget where it is. Alternatively, you can see -where the mark is with the command @kbd{C-x C-x} -(@code{exchange-point-and-mark}) which puts the mark where point was -and point where the mark was. The extent of the region is unchanged, -but the cursor and point are now at the previous position of the mark. -In Transient Mark mode, this command also reactivates the mark. - - @kbd{C-x C-x} is also useful when you are satisfied with the position -of point but want to move the other end of the region (where the mark -is); do @kbd{C-x C-x} to put point at that end of the region, and then -move it. Using @kbd{C-x C-x} a second time, if necessary, puts the mark at -the new position with point back at its original position. - - For more facilities that allow you to go to previously set marks, see -@ref{Mark Ring}. - -@kindex C-@@ - There is no such character as @kbd{C-@key{SPC}} in @acronym{ASCII}; -when you type @key{SPC} while holding down @key{CTRL} on a text -terminal, what you get is the character @kbd{C-@@}. This key is also -bound to @code{set-mark-command}--so unless you are unlucky enough to -have a text terminal where typing @kbd{C-@key{SPC}} does not produce -@kbd{C-@@}, you might as well think of this character as -@kbd{C-@key{SPC}}. - -@node Transient Mark -@section Transient Mark Mode -@cindex mode, Transient Mark -@cindex Transient Mark mode -@cindex highlighting region -@cindex region highlighting - - On a terminal that supports colors, Emacs has the ability to -highlight the current region. But normally it does not. Why not? - - In the normal mode of use, every command that sets the mark also -activates it, and nothing ever deactivates it. Thus, once you have -set the mark in a buffer, there is @emph{always} a region in that -buffer. Highlighting the region all the time would be a nuisance. So -normally Emacs highlights the region only immediately after you have -selected one with the mouse. - - If you want region highlighting, you can use Transient Mark mode. -This is a more rigid mode of operation in which the region ``lasts'' -only until you use it; operating on the region text deactivates the -mark, so there is no region any more. Therefore, you must explicitly -set up a region for each command that uses one. - - When Transient Mark mode is enabled, Emacs highlights the region, -whenever there is a region. In Transient Mark mode, most of the time -there is no region; therefore, highlighting the region when it exists -is useful and not annoying. - -@findex transient-mark-mode - To enable Transient Mark mode, type @kbd{M-x transient-mark-mode}. -This command toggles the mode; you can use the same command to turn -the mode off again. - - Here are the details of Transient Mark mode: - -@itemize @bullet -@item -To set the mark, type @kbd{C-@key{SPC}} (@code{set-mark-command}). -This makes the mark active and thus begins highlighting of the region. -As you move point, you will see the highlighted region grow and -shrink. - -@item -The mouse commands for specifying the mark also make it active. So do -keyboard commands whose purpose is to specify a region, including -@kbd{M-@@}, @kbd{C-M-@@}, @kbd{M-h}, @kbd{C-M-h}, @kbd{C-x C-p}, and -@kbd{C-x h}. - -@item -You can tell that the mark is active because the region is highlighted. - -@item -When the mark is active, you can execute commands that operate on the -region, such as killing, indenting, or writing to a file. - -@item -Any change to the buffer, such as inserting or deleting a character, -deactivates the mark. This means any subsequent command that operates -on a region will get an error and refuse to operate. You can make the -region active again by typing @kbd{C-x C-x}. - -@item -If Delete Selection mode is also enabled, some commands delete the -region when used while the mark is active. @xref{Mouse Commands}. - -@item -Quitting with @kbd{C-g} deactivates the mark. - -@item -Commands like @kbd{M->} and @kbd{C-s}, that ``leave the mark behind'' in -addition to some other primary purpose, do not activate the new mark. -You can activate the new region by executing @kbd{C-x C-x} -(@code{exchange-point-and-mark}). - -@item -Commands that normally set the mark before moving long distances (like -@kbd{M-<} and @kbd{C-s}) do not alter the mark in Transient Mark mode -when the mark is active. - -@item -Some commands operate on the region if a region is active. For -instance, @kbd{C-x u} in Transient Mark mode operates on the region, -when there is a region. (Outside Transient Mark mode, you must type -@kbd{C-u C-x u} if you want it to operate on the region.) -@xref{Undo}. Other commands that act this way are identified in their -own documentation. -@end itemize - - The highlighting of the region uses the @code{region} face; you can -customize the appearance of the highlighted region by changing this -face. @xref{Face Customization}. - -@vindex highlight-nonselected-windows - When multiple windows show the same buffer, they can have different -regions, because they can have different values of point (though they -all share one common mark position). Ordinarily, only the selected -window highlights its region (@pxref{Windows}). However, if the -variable @code{highlight-nonselected-windows} is non-@code{nil}, then -each window highlights its own region (provided that Transient Mark mode -is enabled and the mark in the window's buffer is active). - -@vindex mark-even-if-inactive - If the variable @code{mark-even-if-inactive} is non-@code{nil} in -Transient Mark mode, then commands can use the mark and the region -even when it is inactive. Region highlighting appears and disappears -just as it normally does in Transient Mark mode, but the mark doesn't -really go away when the highlighting disappears, so you can still use -region commands. - -@cindex Zmacs mode - Transient Mark mode is also sometimes known as ``Zmacs mode'' -because the Zmacs editor on the MIT Lisp Machine handled the mark in a -similar way. - -@node Momentary Mark -@section Using Transient Mark Mode Momentarily - - If you don't like Transient Mark mode in general, you might still -want to use it once in a while. To do this, type @kbd{C-@key{SPC} -C-@key{SPC}} or @kbd{C-u C-x C-x}. These commands set or activate the -mark, and enable Transient Mark mode only until the mark is -deactivated. - -@table @kbd -@item C-@key{SPC} C-@key{SPC} -@kindex C-@key{SPC} C-@key{SPC} -Set the mark at point (like plain @kbd{C-@key{SPC}}), and enable -Transient Mark mode just once until the mark is deactivated. (This is -not really a separate command; you are using the @kbd{C-@key{SPC}} -command twice.) - -@item C-u C-x C-x -@kindex C-u C-x C-x -Activate the mark without changing it; enable Transient Mark mode just -once, until the mark is deactivated. (This is the @kbd{C-x C-x} -command, @code{exchange-point-and-mark}, with a prefix argument.) -@end table - - One of the secondary features of Transient Mark mode is that certain -commands operate only on the region, when there is an active region. -If you don't use Transient Mark mode, the region once set never -becomes inactive, so there is no way for these commands to make such a -distinction. Enabling Transient Mark mode momentarily gives you a way -to use these commands on the region. - - Momentary use of Transient Mark mode is also a way to highlight the -region for the time being. - -@node Using Region -@section Operating on the Region - -@cindex operations on a marked region - Once you have a region and the mark is active, here are some of the -ways you can operate on the region: - -@itemize @bullet -@item -Kill it with @kbd{C-w} (@pxref{Killing}). -@item -Save it in a register with @kbd{C-x r s} (@pxref{Registers}). -@item -Save it in a buffer or a file (@pxref{Accumulating Text}). -@item -Convert case with @kbd{C-x C-l} or @kbd{C-x C-u} (@pxref{Case}). -@item -Indent it with @kbd{C-x @key{TAB}} or @kbd{C-M-\} (@pxref{Indentation}). -@item -Fill it as text with @kbd{M-x fill-region} (@pxref{Filling}). -@item -Print hardcopy with @kbd{M-x print-region} (@pxref{Printing}). -@item -Evaluate it as Lisp code with @kbd{M-x eval-region} (@pxref{Lisp Eval}). -@item -Undo changes within it using @kbd{C-u C-x u} (@pxref{Undo}). -@end itemize - - Most commands that operate on the text in the region have the word -@code{region} in their names. - -@node Marking Objects -@section Commands to Mark Textual Objects - -@cindex marking sections of text - Here are the commands for placing point and the mark around a textual -object such as a word, list, paragraph or page. - -@table @kbd -@item M-@@ -Set mark after end of next word (@code{mark-word}). This command and -the following one do not move point. -@item C-M-@@ -Set mark after end of following balanced expression (@code{mark-sexp}). -@item M-h -Put region around current paragraph (@code{mark-paragraph}). -@item C-M-h -Put region around current defun (@code{mark-defun}). -@item C-x h -Put region around the entire buffer (@code{mark-whole-buffer}). -@item C-x C-p -Put region around current page (@code{mark-page}). -@end table - -@kbd{M-@@} (@code{mark-word}) puts the mark at the end of the next -word, while @kbd{C-M-@@} (@code{mark-sexp}) puts it at the end of the -next balanced expression (@pxref{Expressions}). These commands handle -arguments just like @kbd{M-f} and @kbd{C-M-f}. Repeating these -commands extends the region. For example, you can type either -@kbd{C-u 2 M-@@} or @kbd{M-@@ M-@@} to mark the next two words. These -commands also extend the region in Transient Mark mode, regardless of -the last command. - -@kindex C-x h -@findex mark-whole-buffer - Other commands set both point and mark, to delimit an object in the -buffer. For example, @kbd{M-h} (@code{mark-paragraph}) moves point to -the beginning of the paragraph that surrounds or follows point, and -puts the mark at the end of that paragraph (@pxref{Paragraphs}). It -prepares the region so you can indent, case-convert, or kill a whole -paragraph. With a prefix argument, if the argument's value is positive, -@kbd{M-h} marks that many paragraphs starting with the one surrounding -point. If the prefix argument is @minus{}@var{n}, @kbd{M-h} also -marks @var{n} paragraphs, running back form the one surrounding point. -In that last case, point moves forward to the end of that paragraph, -and the mark goes at the start of the region. Repeating the @kbd{M-h} -command extends the region to subsequent paragraphs. - - @kbd{C-M-h} (@code{mark-defun}) similarly puts point before, and the -mark after, the current (or following) major top-level definition, or -defun (@pxref{Moving by Defuns}). Repeating @kbd{C-M-h} extends -the region to subsequent defuns. - - @kbd{C-x C-p} (@code{mark-page}) puts point before the current page, -and mark at the end (@pxref{Pages}). The mark goes after the -terminating page delimiter (to include it in the region), while point -goes after the preceding page delimiter (to exclude it). A numeric -argument specifies a later page (if positive) or an earlier page (if -negative) instead of the current page. - - Finally, @kbd{C-x h} (@code{mark-whole-buffer}) sets up the entire -buffer as the region, by putting point at the beginning and the mark at -the end. (In some programs this is called ``select all.'') - - In Transient Mark mode, all of these commands activate the mark. - -@node Mark Ring -@section The Mark Ring - -@kindex C-u C-SPC -@cindex mark ring -@kindex C-u C-@@ - Aside from delimiting the region, the mark is also useful for -remembering a spot that you may want to go back to. To make this -feature more useful, each buffer remembers 16 previous locations of the -mark, in the @dfn{mark ring}. Commands that set the mark also push the -old mark onto this ring. To return to a marked location, use @kbd{C-u -C-@key{SPC}} (or @kbd{C-u C-@@}); this is the command -@code{set-mark-command} given a numeric argument. It moves point to -where the mark was, and restores the mark from the ring of former -marks. - -@vindex set-mark-command-repeat-pop - If you set @code{set-mark-command-repeat-pop} to non-@code{nil}, -then when you repeat the character @kbd{C-@key{SPC}} after typing -@kbd{C-u C-@key{SPC}}, each repetition moves point to a previous mark -position from the ring. The mark positions you move through in this -way are not lost; they go to the end of the ring. - - Each buffer has its own mark ring. All editing commands use the current -buffer's mark ring. In particular, @kbd{C-u C-@key{SPC}} always stays in -the same buffer. - - Many commands that can move long distances, such as @kbd{M-<} -(@code{beginning-of-buffer}), start by setting the mark and saving the -old mark on the mark ring. This is to make it easier for you to move -back later. Searches set the mark if they move point. However, in -Transient Mark mode, these commands do not set the mark when the mark -is already active. You can tell when a command sets the mark because -it displays @samp{Mark set} in the echo area. - - If you want to move back to the same place over and over, the mark -ring may not be convenient enough. If so, you can record the position -in a register for later retrieval (@pxref{RegPos,, Saving Positions in -Registers}). - -@vindex mark-ring-max - The variable @code{mark-ring-max} specifies the maximum number of -entries to keep in the mark ring. If that many entries exist and -another one is pushed, the earliest one in the list is discarded. Repeating -@kbd{C-u C-@key{SPC}} cycles through the positions currently in the -ring. - -@vindex mark-ring - The variable @code{mark-ring} holds the mark ring itself, as a list of -marker objects, with the most recent first. This variable is local in -every buffer. - -@node Global Mark Ring -@section The Global Mark Ring -@cindex global mark ring - - In addition to the ordinary mark ring that belongs to each buffer, -Emacs has a single @dfn{global mark ring}. It records a sequence of -buffers in which you have recently set the mark, so you can go back -to those buffers. - - Setting the mark always makes an entry on the current buffer's mark -ring. If you have switched buffers since the previous mark setting, the -new mark position makes an entry on the global mark ring also. The -result is that the global mark ring records a sequence of buffers that -you have been in, and, for each buffer, a place where you set the mark. - -@kindex C-x C-@key{SPC} -@findex pop-global-mark - The command @kbd{C-x C-@key{SPC}} (@code{pop-global-mark}) jumps to -the buffer and position of the latest entry in the global ring. It also -rotates the ring, so that successive uses of @kbd{C-x C-@key{SPC}} take -you to earlier and earlier buffers. - -@ignore - arch-tag: f35e4d82-911b-4cfc-a3d7-3c87b2abba20 -@end ignore diff --git a/man/mini.texi b/man/mini.texi deleted file mode 100644 index b57e79420b6..00000000000 --- a/man/mini.texi +++ /dev/null @@ -1,580 +0,0 @@ -@c This is part of the Emacs manual. -@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001, -@c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. -@c See file emacs.texi for copying conditions. -@node Minibuffer, M-x, Basic, Top -@chapter The Minibuffer -@cindex minibuffer - - The @dfn{minibuffer} is where Emacs commands read complicated -arguments (anything more a single number). We call it the -``minibuffer'' because it's a special-purpose buffer with a small -amount of screen space. Minibuffer arguments can be file names, -buffer names, Lisp function names, Emacs command names, Lisp -expressions, and many other things---whatever the command wants to -read. You can use the usual Emacs editing commands in the minibuffer -to edit the argument text. - -@cindex prompt - When the minibuffer is in use, it appears in the echo area, with a -cursor. The minibuffer display starts with a @dfn{prompt} in a -distinct color; it says what kind of input is expected and how it will -be used. Often the prompt is derived from the name of the command -that is reading the argument. The prompt normally ends with a colon. - -@cindex default argument - Sometimes a @dfn{default argument} appears in the prompt, inside -parentheses before the colon. The default will be used as the -argument value if you just type @key{RET}. For example, commands that -read buffer names show a buffer name as the default. You can type -@key{RET} to operate on that default buffer. - - The simplest way to enter a minibuffer argument is to type the text, -then @key{RET} to exit the minibuffer. You can cancel the minibuffer, -and the command that wants the argument, by typing @kbd{C-g}. - - Since the minibuffer appears in the echo area, it can conflict with -other uses of the echo area. Here is how Emacs handles such -conflicts: - -@itemize @bullet -@item -An error occurs while the minibuffer is active. - -The error message hides the minibuffer for a few seconds, or until you -type something. Then the minibuffer comes back. - -@item -A command such as @kbd{C-x =} needs to display a message in the echo -area. - -The message hides the minibuffer for a few seconds, or until you type -something. Then the minibuffer comes back. - -@item -Keystrokes don't echo while the minibuffer is in use. -@end itemize - -@menu -* File: Minibuffer File. Entering file names with the minibuffer. -* Edit: Minibuffer Edit. How to edit in the minibuffer. -* Completion:: An abbreviation facility for minibuffer input. -* Minibuffer History:: Reusing recent minibuffer arguments. -* Repetition:: Re-executing commands that used the minibuffer. -@end menu - -@node Minibuffer File -@section Minibuffers for File Names - - When you use the minibuffer to enter a file name, it starts out with -some initial text---the @dfn{default directory}, ending in a slash. -The file you specify will be in this directory unless you alter or -replace it. - -@c Separate paragraph to clean up ugly page break--rms -@need 1500 - For example, if the minibuffer starts out with these contents: - -@example -Find File: /u2/emacs/src/ -@end example - -@noindent -(where @samp{Find File:@: } is the prompt), and you type -@kbd{buffer.c} as input, that specifies the file -@file{/u2/emacs/src/buffer.c}. You can specify the parent directory -by adding @file{..}; thus, if you type @kbd{../lisp/simple.el}, you -will get @file{/u2/emacs/lisp/simple.el}. Alternatively, you can use -@kbd{M-@key{DEL}} to kill the directory names you don't want -(@pxref{Words}). - - You can kill the entire default with @kbd{C-a C-k}, but there's no -need to do that. It's easier to ignore the default, and enter an -absolute file name starting with a slash or a tilde after the default -directory. For example, to specify @file{/etc/termcap}, just type -that name: - -@example -Find File: /u2/emacs/src//etc/termcap -@end example - -@noindent -@cindex // in file name -@cindex double slash in file name -@cindex slashes repeated in file name -@findex file-name-shadow-mode -GNU Emacs interprets a double slash (which is not normally useful in -file names) as, ``ignore everything before the second slash in the -pair.'' In the example above. @samp{/u2/emacs/src/} is ignored, so -you get @file{/etc/termcap}. The ignored part of the file name is -dimmed if the terminal allows it; to disable this dimming, turn off -File Name Shadow mode (a minor mode) with the command -@kbd{M-x file-name-shadow-mode}. - - If the variable @code{insert-default-directory} is @code{nil}, the -default directory is never inserted in the minibuffer---so the -minibuffer starts out empty. Nonetheless, relative file name -arguments are still interpreted based on the same default directory. - -@node Minibuffer Edit -@section Editing in the Minibuffer - - The minibuffer is an Emacs buffer (albeit a peculiar one), and the -usual Emacs commands are available for editing the argument text. - - Since @key{RET} in the minibuffer is defined to exit the minibuffer, -you can't use it to insert a newline in the minibuffer. To do that, -type @kbd{C-o} or @kbd{C-q C-j}. (The newline character is really the -@acronym{ASCII} character control-J.) - - The minibuffer has its own window, which normally has space in the -frame at all times, but it only acts like an Emacs window when the -minibuffer is active. When active, this window is much like any other -Emacs window; for instance, you can switch to another window (with -@kbd{C-x o}), edit text there, then return to the minibuffer window to -finish the argument. You can even kill text in another window, return -to the minibuffer window, and then yank the text into the argument. -@xref{Windows}. - -@cindex height of minibuffer -@cindex size of minibuffer -@cindex growing minibuffer -@cindex resizing minibuffer - There are some restrictions on the minibuffer window, however: you -cannot kill it, or split it, or switch buffers in it---the minibuffer -and its window are permanently attached. - -@vindex resize-mini-windows - The minibuffer window expands vertically as necessary to hold the -text that you put in the minibuffer. If @code{resize-mini-windows} is -@code{t} (the default), the window always resizes as needed by its -contents. If its value is the symbol @code{grow-only}, the window -grows automatically as needed, but shrinks (back to the normal size) -only when the minibuffer becomes inactive. If its value is -@code{nil}, you have to adjust the height yourself. - -@vindex max-mini-window-height - The variable @code{max-mini-window-height} controls the maximum -height for resizing the minibuffer window: a floating-point number -specifies a fraction of the frame's height; an integer specifies the -maximum number of lines; @code{nil} means do not resize the minibuffer -window automatically. The default value is 0.25. - - The @kbd{C-M-v} command in the minibuffer scrolls the help text from -commands that display help text of any sort in another window. -@kbd{M-@key{PAGEUP}} and @kbd{M-@key{PAGEDOWN}} also operate on that -help text. This is especially useful with long lists of possible -completions. @xref{Other Window}. - -@vindex enable-recursive-minibuffers - Emacs normally disallows most commands that use the minibuffer while -the minibuffer is active. (Entering the minibuffer from the -minibuffer can be confusing.) To allow such commands in the -minibuffer, set the variable @code{enable-recursive-minibuffers} to -@code{t}. - -@node Completion -@section Completion -@cindex completion - - Some arguments allow @dfn{completion} to enter their value. This -means that after you type part of the argument, Emacs can fill in the -rest, or some of it, based on what you have typed so far. - - When completion is available, certain keys---@key{TAB}, @key{RET}, -and @key{SPC}---are rebound to complete the text in the minibuffer -before point into a longer string chosen from a set of @dfn{completion -alternatives} provided by the command that requested the argument. -(@key{SPC} does not do completion in reading file names, because it is -common to use spaces in file names on some systems.) @kbd{?} displays -a list of the possible completions at any time. - - For example, @kbd{M-x} uses the minibuffer to read the name of a -command, so it provides a list of all Emacs command names for -completion candidates. The completion keys match the minibuffer text -against these candidates, find any additional name characters implied -by the text already present in the minibuffer, and add those -characters. This makes it possible to type @kbd{M-x ins @key{SPC} b -@key{RET}} instead of @kbd{M-x insert-buffer @key{RET}}, for example. - - Case is significant in completion when it is significant in the -argument you are entering (buffer names, file names, command names, -for instance). Thus, @samp{fo} does not complete to @samp{Foo}. -Completion ignores case distinctions for certain arguments in which -case does not matter. - - Completion acts only on the text before point. If there is text in -the minibuffer after point---i.e., if you move point backward after -typing some text into the minibuffer---it remains unchanged. - -@menu -* Example: Completion Example. Examples of using completion. -* Commands: Completion Commands. A list of completion commands. -* Strict Completion:: Different types of completion. -* Options: Completion Options. Options for completion. -@end menu - -@node Completion Example -@subsection Completion Example - -@kindex TAB @r{(completion)} - A concrete example may help here. If you type @kbd{M-x au -@key{TAB}}, the @key{TAB} looks for alternatives (in this case, -command names) that start with @samp{au}. There are several, -including @code{auto-fill-mode} and @code{auto-save-mode}, but they -all begin with @code{auto-}, so the @samp{au} in the minibuffer -completes to @samp{auto-}. - - If you type @key{TAB} again immediately, it cannot determine the -next character; it could be any of @samp{cfilrs}. So it does not add -any characters; instead, @key{TAB} displays a list of all possible -completions in another window. - - Now type @kbd{f @key{TAB}}. This @key{TAB} sees @samp{auto-f}. The -only command name starting with that is @code{auto-fill-mode}, so -completion fills in the rest of that. You have been able to enter -@samp{auto-fill-mode} by typing just @kbd{au @key{TAB} f @key{TAB}}. - -@node Completion Commands -@subsection Completion Commands - - Here is a list of the completion commands defined in the minibuffer -when completion is allowed. - -@table @kbd -@item @key{TAB} -@findex minibuffer-complete -Complete the text before point in the minibuffer as much as possible -(@code{minibuffer-complete}). -@item @key{SPC} -Complete up to one word from the minibuffer text before point -(@code{minibuffer-complete-word}). @key{SPC} for completion is not -available when entering a file name, since file names often include -spaces. -@item @key{RET} -Submit the text in the minibuffer as the argument, possibly completing -first as described -@iftex -in the next subsection (@code{minibuffer-complete-and-exit}). -@end iftex -@ifnottex -in the next node (@code{minibuffer-complete-and-exit}). @xref{Strict -Completion}. -@end ifnottex -@item ? -Display a list of possible completions of the text before point -(@code{minibuffer-completion-help}). -@end table - -@kindex SPC -@findex minibuffer-complete-word - @key{SPC} completes like @key{TAB}, but only up to the next hyphen -or space. If you have @samp{auto-f} in the minibuffer and type -@key{SPC}, it finds that the completion is @samp{auto-fill-mode}, but -it only inserts @samp{ill-}, giving @samp{auto-fill-}. Another -@key{SPC} at this point completes all the way to -@samp{auto-fill-mode}. The command that implements this behavior is -called @code{minibuffer-complete-word}. - - When you display a list of possible completions, you can choose -one from it: - -@table @kbd -@findex mouse-choose-completion -@item Mouse-1 -@itemx Mouse-2 -Clicking mouse button 1 or 2 on a completion possibility chooses that -completion (@code{mouse-choose-completion}). You must click in the -list of completions, not in the minibuffer. - -@findex switch-to-completions -@item @key{PRIOR} -@itemx M-v -Typing @key{PRIOR} or @key{PAGE-UP}, or @kbd{M-v}, while in the -minibuffer, selects the window showing the completion list buffer -(@code{switch-to-completions}). This paves the way for using the -commands below. (Selecting that window in other ways has the same -effect.) - -@findex choose-completion -@item @key{RET} -Typing @key{RET} @emph{in the completion list buffer} chooses the -completion that point is in or next to (@code{choose-completion}). To -use this command, you must first switch to the completion list window. - -@findex next-completion -@item @key{RIGHT} -Typing the right-arrow key @key{RIGHT} @emph{in the completion list -buffer} moves point to the following completion possibility -(@code{next-completion}). - -@findex previous-completion -@item @key{LEFT} -Typing the left-arrow key @key{LEFT} @emph{in the completion list -buffer} moves point to the previous completion possibility -(@code{previous-completion}). -@end table - -@node Strict Completion -@subsection Strict Completion - - There are three different ways that @key{RET} can do completion, -depending on how the argument will be used. - -@itemize @bullet -@item -@dfn{Strict} completion accepts only known completion candidates. For -example, when @kbd{C-x k} reads the name of a buffer to kill, only the -name of an existing buffer makes sense. In strict completion, -@key{RET} refuses to exit if the text in the minibuffer does not -complete to an exact match. - -@item -@dfn{Cautious} completion is similar to strict completion, except that -@key{RET} exits only if the text is an already exact match. -Otherwise, @key{RET} does not exit, but it does complete the text. If -that completes to an exact match, a second @key{RET} will exit. - -Cautious completion is used for reading file names for files that must -already exist, for example. - -@item -@dfn{Permissive} completion allows any input; the completion -candidates are just suggestions. For example, when @kbd{C-x C-f} -reads the name of a file to visit, any file name is allowed, including -nonexistent file (in case you want to create a file). In permissive -completion, @key{RET} does not complete, it just submits the argument -as you have entered it. -@end itemize - - The completion commands display a list of all possible completions -whenever they can't determine even one more character by completion. -Also, typing @kbd{?} explicitly requests such a list. You can scroll -the list with @kbd{C-M-v} (@pxref{Other Window}). - -@node Completion Options -@subsection Completion Options - -@vindex completion-ignored-extensions -@cindex ignored file names, in completion - When completing file names, certain file names are usually ignored. -The variable @code{completion-ignored-extensions} contains a list of -strings; a file name ending in any of those strings is ignored as a -completion candidate. The standard value of this variable has several -elements including @code{".o"}, @code{".elc"}, @code{".dvi"} and -@code{"~"}. The effect is that, for example, @samp{foo} can complete -to @samp{foo.c} even though @samp{foo.o} exists as well. However, if -@emph{all} the possible completions end in ``ignored'' strings, then -they are not ignored. Displaying a list of possible completions -disregards @code{completion-ignored-extensions}; it shows them all. - - If an element of @code{completion-ignored-extensions} ends in a -slash (@file{/}), it's a subdirectory name; then that directory and -its contents are ignored. Elements of -@code{completion-ignored-extensions} which do not end in a slash are -ordinary file names, and do not apply to names of directories. - -@vindex completion-auto-help - If @code{completion-auto-help} is set to @code{nil}, the completion -commands never display a list of possibilities; you must type @kbd{?} -to display the list. - -@cindex Partial Completion mode -@vindex partial-completion-mode -@findex partial-completion-mode - Partial Completion mode implements a more powerful kind of -completion that can complete multiple words in parallel. For example, -it can complete the command name abbreviation @code{p-b} into -@code{print-buffer} if no other command starts with two words whose -initials are @samp{p} and @samp{b}. - - To enable this mode, use @kbd{M-x partial-completion-mode}, or -customize the variable @code{partial-completion-mode}. This mode -binds special partial completion commands to @key{TAB}, @key{SPC}, -@key{RET}, and @kbd{?} in the minibuffer. The usual completion -commands are available on @kbd{M-@key{TAB}} (or @kbd{C-M-i}), -@kbd{M-@key{SPC}}, @kbd{M-@key{RET}} and @kbd{M-?}. - - Partial completion of directories in file names uses @samp{*} to -indicate the places for completion; thus, @file{/u*/b*/f*} might -complete to @file{/usr/bin/foo}. For remote files, partial completion -enables completion of methods, user names and host names. -@xref{Remote Files}. - -@vindex PC-include-file-path -@vindex PC-disable-includes - Partial Completion mode also extends @code{find-file} so that -@samp{<@var{include}>} looks for the file named @var{include} in the -directories in the path @code{PC-include-file-path}. If you set -@code{PC-disable-includes} to non-@code{nil}, this feature is -disabled. - -@cindex Icomplete mode -@findex icomplete-mode - Icomplete mode presents a constantly-updated display that tells you -what completions are available for the text you've entered so far. The -command to enable or disable this minor mode is @kbd{M-x -icomplete-mode}. - -@node Minibuffer History -@section Minibuffer History -@cindex minibuffer history -@cindex history of minibuffer input - - Every argument that you enter with the minibuffer is saved on a -@dfn{minibuffer history list} so you can easily use it again later. -Special commands fetch the text of an earlier argument into the -minibuffer, replacing the old minibuffer contents. You can think of -them as moving through the history of previous arguments. - -@table @kbd -@item @key{UP} -@itemx M-p -Move to the previous item in the minibuffer history, an earlier argument -(@code{previous-history-element}). -@item @key{DOWN} -@itemx M-n -Move to the next item in the minibuffer history -(@code{next-history-element}). -@item M-r @var{regexp} @key{RET} -Move to an earlier item in the minibuffer history that -matches @var{regexp} (@code{previous-matching-history-element}). -@item M-s @var{regexp} @key{RET} -Move to a later item in the minibuffer history that matches -@var{regexp} (@code{next-matching-history-element}). -@end table - -@kindex M-p @r{(minibuffer history)} -@kindex M-n @r{(minibuffer history)} -@findex next-history-element -@findex previous-history-element - To move through the minibuffer history list one item at a time, use -@kbd{M-p} or up-arrow (@code{previous-history-element}) to fetch the -next earlier minibuffer input, and use @kbd{M-n} or down-arrow -(@code{next-history-element}) to fetch the next later input. These -commands don't move the cursor, they pull different saved strings into -the minibuffer. But you can think of them as ``moving'' through the -history list. - - The input that you fetch from the history entirely replaces the -contents of the minibuffer. To use it again unchanged, just type -@key{RET}. You can also edit the text before you reuse it; this does -not change the history element that you ``moved'' to, but your new -argument does go at the end of the history list in its own right. - - For many minibuffer arguments there is a ``default'' value. You can -insert the default value into the minibuffer as text by using -@kbd{M-n}. You can think of this as moving ``into the future'' in the -history. - -@findex previous-matching-history-element -@findex next-matching-history-element -@kindex M-r @r{(minibuffer history)} -@kindex M-s @r{(minibuffer history)} - There are also commands to search forward or backward through the -history; they search for history elements that match a regular -expression. @kbd{M-r} (@code{previous-matching-history-element}) -searches older elements in the history, while @kbd{M-s} -(@code{next-matching-history-element}) searches newer elements. These -commands are unusual; they use the minibuffer to read the regular -expression even though they are invoked from the minibuffer. As with -incremental searching, an upper-case letter in the regular expression -makes the search case-sensitive (@pxref{Search Case}). - -@ignore - We may change the precise way these commands read their arguments. -Perhaps they will search for a match for the string given so far in the -minibuffer; perhaps they will search for a literal match rather than a -regular expression match; perhaps they will only accept matches at the -beginning of a history element; perhaps they will read the string to -search for incrementally like @kbd{C-s}. To find out what interface is -actually available, type @kbd{C-h f previous-matching-history-element}. -@end ignore - - All uses of the minibuffer record your input on a history list, but -there are separate history lists for different kinds of arguments. -For example, there is a list for file names, used by all the commands -that read file names. (As a special feature, this history list -records the absolute file name, even if the name you entered was not -absolute.) - - There are several other specific history lists, including one for -buffer names, one for arguments of commands like @code{query-replace}, -one used by @kbd{M-x} for command names, and one used by -@code{compile} for compilation commands. Finally, there is one -``miscellaneous'' history list that most minibuffer arguments use. - -@vindex history-length - The variable @code{history-length} specifies the maximum length of a -minibuffer history list; adding a new element deletes the oldest -element if the list gets too long. If the value of -@code{history-length} is @code{t}, though, there is no maximum length. - -@vindex history-delete-duplicates - The variable @code{history-delete-duplicates} specifies whether to -delete duplicates in history. If it is @code{t}, adding a new element -deletes from the list all other elements that are equal to it. - -@node Repetition -@section Repeating Minibuffer Commands -@cindex command history -@cindex history of commands - - Every command that uses the minibuffer once is recorded on a special -history list, the @dfn{command history}, together with the values of -its arguments, so that you can repeat the entire command. In -particular, every use of @kbd{M-x} is recorded there, since @kbd{M-x} -uses the minibuffer to read the command name. - -@findex list-command-history -@table @kbd -@item C-x @key{ESC} @key{ESC} -Re-execute a recent minibuffer command from the command history - (@code{repeat-complex-command}). -@item M-x list-command-history -Display the entire command history, showing all the commands -@kbd{C-x @key{ESC} @key{ESC}} can repeat, most recent first. -@end table - -@kindex C-x ESC ESC -@findex repeat-complex-command - @kbd{C-x @key{ESC} @key{ESC}} is used to re-execute a recent command -that used the minibuffer. With no argument, it repeats the last such -command. A numeric argument specifies which command to repeat; 1 -means the last one, 2 the previous, and so on. - - @kbd{C-x @key{ESC} @key{ESC}} works by turning the previous command -into a Lisp expression and then entering a minibuffer initialized with -the text for that expression. Even if you don't understand Lisp -syntax, it will probably be obvious which command is displayed for -repetition. If you type just @key{RET}, that repeats the command -unchanged. You can also change the command by editing the Lisp -expression before you execute it. The repeated command is added to -the front of the command history unless it is identical to the most -recently item. - - Once inside the minibuffer for @kbd{C-x @key{ESC} @key{ESC}}, you can -use the minibuffer history commands (@kbd{M-p}, @kbd{M-n}, @kbd{M-r}, -@kbd{M-s}; @pxref{Minibuffer History}) to move through the history list -of saved entire commands. After finding the desired previous command, -you can edit its expression as usual and then repeat it by typing -@key{RET}. - -@vindex isearch-resume-in-command-history - Incremental search does not, strictly speaking, use the minibuffer. -Therefore, although it behaves like a complex command, it normally -does not appear in the history list for @kbd{C-x @key{ESC} @key{ESC}}. -You can make incremental search commands appear in the history by -setting @code{isearch-resume-in-command-history} to a non-@code{nil} -value. @xref{Incremental Search}. - -@vindex command-history - The list of previous minibuffer-using commands is stored as a Lisp -list in the variable @code{command-history}. Each element is a Lisp -expression which describes one command and its arguments. Lisp programs -can re-execute a command by calling @code{eval} with the -@code{command-history} element. - -@ignore - arch-tag: ba913cfd-b70e-400f-b663-22b2c309227f -@end ignore diff --git a/man/msdog-xtra.texi b/man/msdog-xtra.texi deleted file mode 100644 index 432f28888f6..00000000000 --- a/man/msdog-xtra.texi +++ /dev/null @@ -1,687 +0,0 @@ -@c This is part of the Emacs manual. -@c Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. -@c See file emacs.texi for copying conditions. -@c -@c This file is included either in emacs-xtra.texi (when producing the -@c printed version) or in the main Emacs manual (for the on-line version). -@node MS-DOS -@section Emacs and MS-DOS -@cindex MS-DOG -@cindex MS-DOS peculiarities - - This section briefly describes the peculiarities of using Emacs on -the MS-DOS ``operating system'' (also known as ``MS-DOG''). -@iftex -Information about Emacs and Microsoft's current operating system -Windows (also known as ``Losedows) is in the main Emacs manual -(@pxref{Microsoft Systems,,, emacs, the Emacs Manual}). -@end iftex -@ifnottex -Information about peculiarities common to MS-DOS and Microsoft's -current operating systems Windows (also known as ``Losedows) is in -@ref{Microsoft Windows}. -@end ifnottex - - If you build Emacs for MS-DOS, the binary will also run on Windows -3.X, Windows NT, Windows 9X/ME, Windows 2000/XP, or OS/2 as a DOS -application; all of this chapter applies for all of those systems, if -you use an Emacs that was built for MS-DOS. - -@iftex - @xref{Text and Binary,,,emacs, the Emacs Manual}, for information -@end iftex -@ifnottex - @xref{Text and Binary}, for information -@end ifnottex -about Emacs' special handling of text files under MS-DOS (and Windows). - -@menu -* Keyboard: MS-DOS Keyboard. Keyboard conventions on MS-DOS. -* Mouse: MS-DOS Mouse. Mouse conventions on MS-DOS. -* Display: MS-DOS Display. Fonts, frames and display size on MS-DOS. -* Files: MS-DOS File Names. File name conventions on MS-DOS. -* Printing: MS-DOS Printing. Printing specifics on MS-DOS. -* I18N: MS-DOS and MULE. Support for internationalization on MS-DOS. -* Processes: MS-DOS Processes. Running subprocesses on MS-DOS. -@end menu - -@node MS-DOS Keyboard -@subsection Keyboard Usage on MS-DOS - -@kindex DEL @r{(MS-DOS)} -@kindex BS @r{(MS-DOS)} - The key that is called @key{DEL} in Emacs (because that's how it is -designated on most workstations) is known as @key{BS} (backspace) on a -PC. That is why the PC-specific terminal initialization remaps the -@key{BS} key to act as @key{DEL}; the @key{DELETE} key is remapped to act -as @kbd{C-d} for the same reasons. - -@kindex C-g @r{(MS-DOS)} -@kindex C-BREAK @r{(MS-DOS)} -@cindex quitting on MS-DOS - Emacs built for MS-DOS recognizes @kbd{C-@key{BREAK}} as a quit -character, just like @kbd{C-g}. This is because Emacs cannot detect -that you have typed @kbd{C-g} until it is ready for more input. As a -consequence, you cannot use @kbd{C-g} to stop a running command -@iftex -(@pxref{Quitting,,,emacs, the Emacs Manual}). -@end iftex -@ifnottex -(@pxref{Quitting}). -@end ifnottex -By contrast, @kbd{C-@key{BREAK}} @emph{is} detected as soon as you -type it (as @kbd{C-g} is on other systems), so it can be used to stop -a running command and for emergency escape -@iftex -(@pxref{Emergency Escape,,,emacs, the Emacs Manual}). -@end iftex -@ifnottex -(@pxref{Emergency Escape}). -@end ifnottex - -@cindex Meta (under MS-DOS) -@cindex Hyper (under MS-DOS) -@cindex Super (under MS-DOS) -@vindex dos-super-key -@vindex dos-hyper-key - The PC keyboard maps use the left @key{ALT} key as the @key{META} key. -You have two choices for emulating the @key{SUPER} and @key{HYPER} keys: -choose either the right @key{CTRL} key or the right @key{ALT} key by -setting the variables @code{dos-hyper-key} and @code{dos-super-key} to 1 -or 2 respectively. If neither @code{dos-super-key} nor -@code{dos-hyper-key} is 1, then by default the right @key{ALT} key is -also mapped to the @key{META} key. However, if the MS-DOS international -keyboard support program @file{KEYB.COM} is installed, Emacs will -@emph{not} map the right @key{ALT} to @key{META}, since it is used for -accessing characters like @kbd{~} and @kbd{@@} on non-US keyboard -layouts; in this case, you may only use the left @key{ALT} as @key{META} -key. - -@kindex C-j @r{(MS-DOS)} -@vindex dos-keypad-mode - The variable @code{dos-keypad-mode} is a flag variable that controls -what key codes are returned by keys in the numeric keypad. You can also -define the keypad @key{ENTER} key to act like @kbd{C-j}, by putting the -following line into your @file{_emacs} file: - -@smallexample -;; @r{Make the @key{ENTER} key from the numeric keypad act as @kbd{C-j}.} -(define-key function-key-map [kp-enter] [?\C-j]) -@end smallexample - -@node MS-DOS Mouse -@subsection Mouse Usage on MS-DOS - -@cindex mouse support under MS-DOS - Emacs on MS-DOS supports a mouse (on the default terminal only). -The mouse commands work as documented, including those that use menus -and the menu bar -@iftex -(@pxref{Menu Bar,,,emacs, the Emacs Manual}). -@end iftex -@ifnottex -(@pxref{Menu Bar}). -@end ifnottex - Scroll bars don't work in MS-DOS Emacs. PC mice usually have only -two buttons; these act as @kbd{Mouse-1} and @kbd{Mouse-2}, but if you -press both of them together, that has the effect of @kbd{Mouse-3}. If -the mouse does have 3 buttons, Emacs detects that at startup, and all -the 3 buttons function normally, as on X. - - Help strings for menu-bar and pop-up menus are displayed in the echo -area when the mouse pointer moves across the menu items. Highlighting -of mouse-sensitive text -@iftex -(@pxref{Mouse References,,,emacs, the Emacs Manual}) -@end iftex -@ifnottex -(@pxref{Mouse References}) -@end ifnottex -is also supported. - -@cindex mouse, set number of buttons -@findex msdos-set-mouse-buttons - Some versions of mouse drivers don't report the number of mouse -buttons correctly. For example, mice with a wheel report that they -have 3 buttons, but only 2 of them are passed to Emacs; the clicks on -the wheel, which serves as the middle button, are not passed. In -these cases, you can use the @kbd{M-x msdos-set-mouse-buttons} command -to tell Emacs how many mouse buttons to expect. You could make such a -setting permanent by adding this fragment to your @file{_emacs} init -file: - -@example -;; @r{Treat the mouse like a 2-button mouse.} -(msdos-set-mouse-buttons 2) -@end example - -@cindex Windows clipboard support - Emacs built for MS-DOS supports clipboard operations when it runs on -Windows. Commands that put text on the kill ring, or yank text from -the ring, check the Windows clipboard first, just as Emacs does on the -X Window System -@iftex -(@pxref{Mouse Commands,,,emacs, the Emacs Manual}). -@end iftex -@ifnottex -(@pxref{Mouse Commands}). -@end ifnottex -Only the primary selection and the cut buffer are supported by MS-DOS -Emacs on Windows; the secondary selection always appears as empty. - - Due to the way clipboard access is implemented by Windows, the -length of text you can put into the clipboard is limited by the amount -of free DOS memory that is available to Emacs. Usually, up to 620KB of -text can be put into the clipboard, but this limit depends on the system -configuration and is lower if you run Emacs as a subprocess of -another program. If the killed text does not fit, Emacs outputs a -message saying so, and does not put the text into the clipboard. - - Null characters also cannot be put into the Windows clipboard. If the -killed text includes null characters, Emacs does not put such text into -the clipboard, and displays in the echo area a message to that effect. - -@vindex dos-display-scancodes - The variable @code{dos-display-scancodes}, when non-@code{nil}, -directs Emacs to display the @acronym{ASCII} value and the keyboard scan code of -each keystroke; this feature serves as a complement to the -@code{view-lossage} command, for debugging. - -@node MS-DOS Display -@subsection Display on MS-DOS -@cindex faces under MS-DOS -@cindex fonts, emulating under MS-DOS - - Display on MS-DOS cannot use font variants, like bold or italic, but -it does support multiple faces, each of which can specify a foreground -and a background color. Therefore, you can get the full functionality -of Emacs packages that use fonts (such as @code{font-lock}, Enriched -Text mode, and others) by defining the relevant faces to use different -colors. Use the @code{list-colors-display} command -@iftex -(@pxref{Frame Parameters,,,emacs, the Emacs Manual}) -@end iftex -@ifnottex -(@pxref{Frame Parameters}) -@end ifnottex -and the @code{list-faces-display} command -@iftex -(@pxref{Faces,,,emacs, the Emacs Manual}) -@end iftex -@ifnottex -(@pxref{Faces}) -@end ifnottex -to see what colors and faces are available and what they look like. - - @xref{MS-DOS and MULE}, later in this chapter, for information on -how Emacs displays glyphs and characters that aren't supported by the -native font built into the DOS display. - -@cindex cursor shape on MS-DOS - When Emacs starts, it changes the cursor shape to a solid box. This -is for compatibility with other systems, where the box cursor is the -default in Emacs. This default shape can be changed to a bar by -specifying the @code{cursor-type} parameter in the variable -@code{default-frame-alist} -@iftex -(@pxref{Creating Frames,,,emacs, the Emacs Manual}). -@end iftex -@ifnottex -(@pxref{Creating Frames}). -@end ifnottex -The MS-DOS terminal doesn't support a vertical-bar cursor, -so the bar cursor is horizontal, and the @code{@var{width}} parameter, -if specified by the frame parameters, actually determines its height. -For this reason, the @code{bar} and @code{hbar} cursor types produce -the same effect on MS-DOS. As an extension, the bar cursor -specification can include the starting scan line of the cursor as well -as its width, like this: - -@example - '(cursor-type bar @var{width} . @var{start}) -@end example - -@noindent -In addition, if the @var{width} parameter is negative, the cursor bar -begins at the top of the character cell. - -@cindex frames on MS-DOS - The MS-DOS terminal can only display a single frame at a time. The -Emacs frame facilities work on MS-DOS much as they do on text-only -terminals -@iftex -(@pxref{Frames,,,emacs, the Emacs Manual}). -@end iftex -@ifnottex -(@pxref{Frames}). -@end ifnottex -When you run Emacs from a DOS window on MS-Windows, you can make the -visible frame smaller than the full screen, but Emacs still cannot -display more than a single frame at a time. - -@cindex frame size under MS-DOS -@findex mode4350 -@findex mode25 - The @code{mode4350} command switches the display to 43 or 50 -lines, depending on your hardware; the @code{mode25} command switches -to the default 80x25 screen size. - - By default, Emacs only knows how to set screen sizes of 80 columns by -25, 28, 35, 40, 43 or 50 rows. However, if your video adapter has -special video modes that will switch the display to other sizes, you can -have Emacs support those too. When you ask Emacs to switch the frame to -@var{n} rows by @var{m} columns dimensions, it checks if there is a -variable called @code{screen-dimensions-@var{n}x@var{m}}, and if so, -uses its value (which must be an integer) as the video mode to switch -to. (Emacs switches to that video mode by calling the BIOS @code{Set -Video Mode} function with the value of -@code{screen-dimensions-@var{n}x@var{m}} in the @code{AL} register.) -For example, suppose your adapter will switch to 66x80 dimensions when -put into video mode 85. Then you can make Emacs support this screen -size by putting the following into your @file{_emacs} file: - -@example -(setq screen-dimensions-66x80 85) -@end example - - Since Emacs on MS-DOS can only set the frame size to specific -supported dimensions, it cannot honor every possible frame resizing -request. When an unsupported size is requested, Emacs chooses the next -larger supported size beyond the specified size. For example, if you -ask for 36x80 frame, you will get 40x80 instead. - - The variables @code{screen-dimensions-@var{n}x@var{m}} are used only -when they exactly match the specified size; the search for the next -larger supported size ignores them. In the above example, even if your -VGA supports 38x80 dimensions and you define a variable -@code{screen-dimensions-38x80} with a suitable value, you will still get -40x80 screen when you ask for a 36x80 frame. If you want to get the -38x80 size in this case, you can do it by setting the variable named -@code{screen-dimensions-36x80} with the same video mode value as -@code{screen-dimensions-38x80}. - - Changing frame dimensions on MS-DOS has the effect of changing all the -other frames to the new dimensions. - -@node MS-DOS File Names -@subsection File Names on MS-DOS -@cindex file names under MS-DOS -@cindex init file, default name under MS-DOS - - On MS-DOS, file names are case-insensitive and limited to eight -characters, plus optionally a period and three more characters. Emacs -knows enough about these limitations to handle file names that were -meant for other operating systems. For instance, leading dots -@samp{.} in file names are invalid in MS-DOS, so Emacs transparently -converts them to underscores @samp{_}; thus your default init file -@iftex -(@pxref{Init File,,,emacs, the Emacs Manual}) -@end iftex -@ifnottex -(@pxref{Init File}) -@end ifnottex -is called @file{_emacs} on MS-DOS. Excess characters before or after -the period are generally ignored by MS-DOS itself; thus, if you visit -the file @file{LongFileName.EvenLongerExtension}, you will silently -get @file{longfile.eve}, but Emacs will still display the long file -name on the mode line. Other than that, it's up to you to specify -file names which are valid under MS-DOS; the transparent conversion as -described above only works on file names built into Emacs. - -@cindex backup file names on MS-DOS - The above restrictions on the file names on MS-DOS make it almost -impossible to construct the name of a backup file -@iftex -(@pxref{Backup Names,,,emacs, the Emacs Manual}) -@end iftex -@ifnottex -(@pxref{Backup Names}) -@end ifnottex -without losing some of the original file name characters. For -example, the name of a backup file for @file{docs.txt} is -@file{docs.tx~} even if single backup is used. - -@cindex file names under Windows 95/NT -@cindex long file names in DOS box under Windows 95/NT - If you run Emacs as a DOS application under Windows 9X, Windows ME, or -Windows 2000/XP, you can turn on support for long file names. If you do -that, Emacs doesn't truncate file names or convert them to lower case; -instead, it uses the file names that you specify, verbatim. To enable -long file name support, set the environment variable @env{LFN} to -@samp{y} before starting Emacs. Unfortunately, Windows NT doesn't allow -DOS programs to access long file names, so Emacs built for MS-DOS will -only see their short 8+3 aliases. - -@cindex @env{HOME} directory under MS-DOS - MS-DOS has no notion of home directory, so Emacs on MS-DOS pretends -that the directory where it is installed is the value of the @env{HOME} -environment variable. That is, if your Emacs binary, -@file{emacs.exe}, is in the directory @file{c:/utils/emacs/bin}, then -Emacs acts as if @env{HOME} were set to @samp{c:/utils/emacs}. In -particular, that is where Emacs looks for the init file @file{_emacs}. -With this in mind, you can use @samp{~} in file names as an alias for -the home directory, as you would on GNU or Unix. You can also set -@env{HOME} variable in the environment before starting Emacs; its -value will then override the above default behavior. - - Emacs on MS-DOS handles the directory name @file{/dev} specially, -because of a feature in the emulator libraries of DJGPP that pretends -I/O devices have names in that directory. We recommend that you avoid -using an actual directory named @file{/dev} on any disk. - -@node MS-DOS Printing -@subsection Printing and MS-DOS - - Printing commands, such as @code{lpr-buffer} -@iftex -(@pxref{Printing,,,emacs, the Emacs Manual}) and @code{ps-print-buffer} -(@pxref{PostScript,,,emacs, the Emacs Manual}) -@end iftex -@ifnottex -(@pxref{Printing}) and @code{ps-print-buffer} (@pxref{PostScript}) -@end ifnottex -can work on MS-DOS by sending the output to one of the printer ports, -if a Posix-style @code{lpr} program is unavailable. The same Emacs -variables control printing on all systems, but in some cases they have -different default values on MS-DOS. - -@iftex -@xref{Windows Printing,,,emacs, the Emacs Manual}, -@end iftex -@ifnottex -@xref{Windows Printing}, -@end ifnottex -for details about setting up printing to a networked printer. - - Some printers expect DOS codepage encoding of non-@acronym{ASCII} text, even -though they are connected to a Windows machine which uses a different -encoding for the same locale. For example, in the Latin-1 locale, DOS -uses codepage 850 whereas Windows uses codepage 1252. @xref{MS-DOS and -MULE}. When you print to such printers from Windows, you can use the -@kbd{C-x RET c} (@code{universal-coding-system-argument}) command before -@kbd{M-x lpr-buffer}; Emacs will then convert the text to the DOS -codepage that you specify. For example, @kbd{C-x RET c cp850-dos RET -M-x lpr-region RET} will print the region while converting it to the -codepage 850 encoding. You may need to create the @code{cp@var{nnn}} -coding system with @kbd{M-x codepage-setup}. - -@vindex dos-printer -@vindex dos-ps-printer - For backwards compatibility, the value of @code{dos-printer} -(@code{dos-ps-printer}), if it has a value, overrides the value of -@code{printer-name} (@code{ps-printer-name}), on MS-DOS. - - -@node MS-DOS and MULE -@subsection International Support on MS-DOS -@cindex international support @r{(MS-DOS)} - - Emacs on MS-DOS supports the same international character sets as it -does on GNU, Unix and other platforms -@iftex -(@pxref{International,,,emacs, the Emacs Manual}), -@end iftex -@ifnottex -(@pxref{International}), -@end ifnottex -including coding systems for converting between the different -character sets. However, due to incompatibilities between -MS-DOS/MS-Windows and other systems, there are several DOS-specific -aspects of this support that you should be aware of. This section -describes these aspects. - - The description below is largely specific to the MS-DOS port of -Emacs, especially where it talks about practical implications for -Emacs users. For other operating systems, see the @file{code-pages.el} -package, which implements support for MS-DOS- and MS-Windows-specific -encodings for all platforms other than MS-DOS. - -@table @kbd -@item M-x dos-codepage-setup -Set up Emacs display and coding systems as appropriate for the current -DOS codepage. - -@item M-x codepage-setup -Create a coding system for a certain DOS codepage. -@end table - -@cindex codepage, MS-DOS -@cindex DOS codepages - MS-DOS is designed to support one character set of 256 characters at -any given time, but gives you a variety of character sets to choose -from. The alternative character sets are known as @dfn{DOS codepages}. -Each codepage includes all 128 @acronym{ASCII} characters, but the other 128 -characters (codes 128 through 255) vary from one codepage to another. -Each DOS codepage is identified by a 3-digit number, such as 850, 862, -etc. - - In contrast to X, which lets you use several fonts at the same time, -MS-DOS normally doesn't allow use of several codepages in a single -session. MS-DOS was designed to load a single codepage at system -startup, and require you to reboot in order to change -it@footnote{Normally, one particular codepage is burnt into the -display memory, while other codepages can be installed by modifying -system configuration files, such as @file{CONFIG.SYS}, and rebooting. -While there is third-party software that allows changing the codepage -without rebooting, we describe here how a stock MS-DOS system -behaves.}. Much the same limitation applies when you run DOS -executables on other systems such as MS-Windows. - -@cindex unibyte operation @r{(MS-DOS)} - If you invoke Emacs on MS-DOS with the @samp{--unibyte} option -@iftex -(@pxref{Initial Options,,,emacs, the Emacs Manual}), -@end iftex -@ifnottex -(@pxref{Initial Options}), -@end ifnottex -Emacs does not perform any conversion of non-@acronym{ASCII} -characters. Instead, it reads and writes any non-@acronym{ASCII} -characters verbatim, and sends their 8-bit codes to the display -verbatim. Thus, unibyte Emacs on MS-DOS supports the current -codepage, whatever it may be, but cannot even represent any other -characters. - -@vindex dos-codepage - For multibyte operation on MS-DOS, Emacs needs to know which -characters the chosen DOS codepage can display. So it queries the -system shortly after startup to get the chosen codepage number, and -stores the number in the variable @code{dos-codepage}. Some systems -return the default value 437 for the current codepage, even though the -actual codepage is different. (This typically happens when you use the -codepage built into the display hardware.) You can specify a different -codepage for Emacs to use by setting the variable @code{dos-codepage} in -your init file. - -@cindex language environment, automatic selection on @r{MS-DOS} - Multibyte Emacs supports only certain DOS codepages: those which can -display Far-Eastern scripts, like the Japanese codepage 932, and those -that encode a single ISO 8859 character set. - - The Far-Eastern codepages can directly display one of the MULE -character sets for these countries, so Emacs simply sets up to use the -appropriate terminal coding system that is supported by the codepage. -The special features described in the rest of this section mostly -pertain to codepages that encode ISO 8859 character sets. - - For the codepages which correspond to one of the ISO character sets, -Emacs knows the character set name based on the codepage number. Emacs -automatically creates a coding system to support reading and writing -files that use the current codepage, and uses this coding system by -default. The name of this coding system is @code{cp@var{nnn}}, where -@var{nnn} is the codepage number.@footnote{The standard Emacs coding -systems for ISO 8859 are not quite right for the purpose, because -typically the DOS codepage does not match the standard ISO character -codes. For example, the letter @samp{@,{c}} (@samp{c} with cedilla) has -code 231 in the standard Latin-1 character set, but the corresponding -DOS codepage 850 uses code 135 for this glyph.} - -@cindex mode line @r{(MS-DOS)} - All the @code{cp@var{nnn}} coding systems use the letter @samp{D} -(for ``DOS'') as their mode-line mnemonic. Since both the terminal -coding system and the default coding system for file I/O are set to -the proper @code{cp@var{nnn}} coding system at startup, it is normal -for the mode line on MS-DOS to begin with @samp{-DD\-}. -@iftex -@xref{Mode Line,,,emacs, the Emacs Manual}. -@end iftex -@ifnottex -@xref{Mode Line}. -@end ifnottex -Far-Eastern DOS terminals do not use the @code{cp@var{nnn}} coding -systems, and thus their initial mode line looks like the Emacs -default. - - Since the codepage number also indicates which script you are using, -Emacs automatically runs @code{set-language-environment} to select the -language environment for that script -@iftex -(@pxref{Language Environments,,,emacs, the Emacs Manual}). -@end iftex -@ifnottex -(@pxref{Language Environments}). -@end ifnottex - - If a buffer contains a character belonging to some other ISO 8859 -character set, not the one that the chosen DOS codepage supports, Emacs -displays it using a sequence of @acronym{ASCII} characters. For example, if the -current codepage doesn't have a glyph for the letter @samp{@`o} (small -@samp{o} with a grave accent), it is displayed as @samp{@{`o@}}, where -the braces serve as a visual indication that this is a single character. -(This may look awkward for some non-Latin characters, such as those from -Greek or Hebrew alphabets, but it is still readable by a person who -knows the language.) Even though the character may occupy several -columns on the screen, it is really still just a single character, and -all Emacs commands treat it as one. - -@cindex IBM graphics characters (MS-DOS) -@cindex box-drawing characters (MS-DOS) -@cindex line-drawing characters (MS-DOS) - Not all characters in DOS codepages correspond to ISO 8859 -characters---some are used for other purposes, such as box-drawing -characters and other graphics. Emacs maps these characters to two -special character sets called @code{eight-bit-control} and -@code{eight-bit-graphic}, and displays them as their IBM glyphs. -However, you should be aware that other systems might display these -characters differently, so you should avoid them in text that might be -copied to a different operating system, or even to another DOS machine -that uses a different codepage. - -@vindex dos-unsupported-character-glyph - Emacs supports many other characters sets aside from ISO 8859, but it -cannot display them on MS-DOS. So if one of these multibyte characters -appears in a buffer, Emacs on MS-DOS displays them as specified by the -@code{dos-unsupported-character-glyph} variable; by default, this glyph -is an empty triangle. Use the @kbd{C-u C-x =} command to display the -actual code and character set of such characters. -@iftex -@xref{Position Info,,,emacs, the Emacs Manual}. -@end iftex -@ifnottex -@xref{Position Info}. -@end ifnottex - -@findex codepage-setup - By default, Emacs defines a coding system to support the current -codepage. To define a coding system for some other codepage (e.g., to -visit a file written on a DOS machine in another country), use the -@kbd{M-x codepage-setup} command. It prompts for the 3-digit code of -the codepage, with completion, then creates the coding system for the -specified codepage. You can then use the new coding system to read and -write files, but you must specify it explicitly for the file command -when you want to use it -@iftex -(@pxref{Text Coding,,,emacs, the Emacs Manual}). -@end iftex -@ifnottex -(@pxref{Text Coding}). -@end ifnottex - - These coding systems are also useful for visiting a file encoded using -a DOS codepage, using Emacs running on some other operating system. - -@cindex MS-Windows codepages - MS-Windows provides its own codepages, which are different from the -DOS codepages for the same locale. For example, DOS codepage 850 -supports the same character set as Windows codepage 1252; DOS codepage -855 supports the same character set as Windows codepage 1251, etc. -The MS-Windows version of Emacs uses the current codepage for display -when invoked with the @samp{-nw} option. Support for codepages in the -Windows port of Emacs is part of the @file{code-pages.el} package. - -@node MS-DOS Processes -@subsection Subprocesses on MS-DOS - -@cindex compilation under MS-DOS -@cindex inferior processes under MS-DOS -@findex compile @r{(MS-DOS)} -@findex grep @r{(MS-DOS)} - Because MS-DOS is a single-process ``operating system,'' -asynchronous subprocesses are not available. In particular, Shell -mode and its variants do not work. Most Emacs features that use -asynchronous subprocesses also don't work on MS-DOS, including -Shell mode and GUD. When in doubt, try and see; commands that -don't work output an error message saying that asynchronous processes -aren't supported. - - Compilation under Emacs with @kbd{M-x compile}, searching files with -@kbd{M-x grep} and displaying differences between files with @kbd{M-x -diff} do work, by running the inferior processes synchronously. This -means you cannot do any more editing until the inferior process -finishes. - - Spell checking also works, by means of special support for synchronous -invocation of the @code{ispell} program. This is slower than the -asynchronous invocation on other platforms - - Instead of the Shell mode, which doesn't work on MS-DOS, you can use -the @kbd{M-x eshell} command. This invokes the Eshell package that -implements a Posix-like shell entirely in Emacs Lisp. - - By contrast, Emacs compiled as a native Windows application -@strong{does} support asynchronous subprocesses. -@iftex -@xref{Windows Processes,,,emacs, the Emacs Manual}. -@end iftex -@ifnottex -@xref{Windows Processes}. -@end ifnottex - -@cindex printing under MS-DOS - Printing commands, such as @code{lpr-buffer} -@iftex -(@pxref{Printing,,,emacs, the Emacs Manual}) and -@code{ps-print-buffer} (@pxref{PostScript,,,emacs, the Emacs Manual}), -work in MS-DOS by sending the output to one of the printer ports. -@xref{MS-DOS Printing,,,emacs, the Emacs Manual}. -@end iftex -@ifnottex -(@pxref{Printing}) and @code{ps-print-buffer} (@pxref{PostScript}), -work in MS-DOS by sending the output to one of the printer ports. -@xref{MS-DOS Printing}. -@end ifnottex - - When you run a subprocess synchronously on MS-DOS, make sure the -program terminates and does not try to read keyboard input. If the -program does not terminate on its own, you will be unable to terminate -it, because MS-DOS provides no general way to terminate a process. -Pressing @kbd{C-c} or @kbd{C-@key{BREAK}} might sometimes help in these -cases. - - Accessing files on other machines is not supported on MS-DOS. Other -network-oriented commands such as sending mail, Web browsing, remote -login, etc., don't work either, unless network access is built into -MS-DOS with some network redirector. - -@cindex directory listing on MS-DOS -@vindex dired-listing-switches @r{(MS-DOS)} - Dired on MS-DOS uses the @code{ls-lisp} package where other -platforms use the system @code{ls} command. Therefore, Dired on -MS-DOS supports only some of the possible options you can mention in -the @code{dired-listing-switches} variable. The options that work are -@samp{-A}, @samp{-a}, @samp{-c}, @samp{-i}, @samp{-r}, @samp{-S}, -@samp{-s}, @samp{-t}, and @samp{-u}. - -@ignore - arch-tag: 868d50ff-07f8-4a13-a807-dab6f1cdb431 -@end ignore diff --git a/man/picture-xtra.texi b/man/picture-xtra.texi deleted file mode 100644 index ad3b9f27cc5..00000000000 --- a/man/picture-xtra.texi +++ /dev/null @@ -1,291 +0,0 @@ -@c This is part of the Emacs manual. -@c Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. -@c See file emacs.texi for copying conditions. -@c -@c This file is included either in emacs-xtra.texi (when producing the -@c printed version) or in the main Emacs manual (for the on-line version). -@node Picture Mode -@chapter Editing Pictures -@cindex pictures -@cindex making pictures out of text characters -@findex edit-picture - - To edit a picture made out of text characters (for example, a picture -of the division of a register into fields, as a comment in a program), -use the command @kbd{M-x edit-picture} to enter Picture mode. - - In Picture mode, editing is based on the @dfn{quarter-plane} model of -text, according to which the text characters lie studded on an area that -stretches infinitely far to the right and downward. The concept of the end -of a line does not exist in this model; the most you can say is where the -last nonblank character on the line is found. - - Of course, Emacs really always considers text as a sequence of -characters, and lines really do have ends. But Picture mode replaces -the most frequently-used commands with variants that simulate the -quarter-plane model of text. They do this by inserting spaces or by -converting tabs to spaces. - - Most of the basic editing commands of Emacs are redefined by Picture mode -to do essentially the same thing but in a quarter-plane way. In addition, -Picture mode defines various keys starting with the @kbd{C-c} prefix to -run special picture editing commands. - - One of these keys, @kbd{C-c C-c}, is particularly important. Often a -picture is part of a larger file that is usually edited in some other -major mode. @kbd{M-x edit-picture} records the name of the previous -major mode so you can use the @kbd{C-c C-c} command -(@code{picture-mode-exit}) later to go back to that mode. @kbd{C-c C-c} -also deletes spaces from the ends of lines, unless given a numeric -argument. - - The special commands of Picture mode all work in other modes (provided -the @file{picture} library is loaded), but are not bound to keys except -in Picture mode. The descriptions below talk of moving ``one column'' -and so on, but all the picture mode commands handle numeric arguments as -their normal equivalents do. - -@vindex picture-mode-hook - Turning on Picture mode runs the hook @code{picture-mode-hook}. -Additional extensions to Picture mode can be found in -@file{artist.el}. - -@menu -* Basic Picture:: Basic concepts and simple commands of Picture Mode. -* Insert in Picture:: Controlling direction of cursor motion - after "self-inserting" characters. -* Tabs in Picture:: Various features for tab stops and indentation. -* Rectangles in Picture:: Clearing and superimposing rectangles. -@end menu - -@node Basic Picture -@section Basic Editing in Picture Mode - -@findex picture-forward-column -@findex picture-backward-column -@findex picture-move-down -@findex picture-move-up -@cindex editing in Picture mode - - Most keys do the same thing in Picture mode that they usually do, but -do it in a quarter-plane style. For example, @kbd{C-f} is rebound to -run @code{picture-forward-column}, a command which moves point one -column to the right, inserting a space if necessary so that the actual -end of the line makes no difference. @kbd{C-b} is rebound to run -@code{picture-backward-column}, which always moves point left one -column, converting a tab to multiple spaces if necessary. @kbd{C-n} and -@kbd{C-p} are rebound to run @code{picture-move-down} and -@code{picture-move-up}, which can either insert spaces or convert tabs -as necessary to make sure that point stays in exactly the same column. -@kbd{C-e} runs @code{picture-end-of-line}, which moves to after the last -nonblank character on the line. There is no need to change @kbd{C-a}, -as the choice of screen model does not affect beginnings of -lines. - -@findex picture-newline - Insertion of text is adapted to the quarter-plane screen model -through the use of Overwrite mode -@iftex -(@pxref{Minor Modes,,, emacs, the Emacs Manual}.) -@end iftex -@ifnottex -(@pxref{Minor Modes}.) -@end ifnottex -Self-inserting characters replace existing text, column by column, -rather than pushing existing text to the right. @key{RET} runs -@code{picture-newline}, which just moves to the beginning of the -following line so that new text will replace that line. - -@findex picture-backward-clear-column -@findex picture-clear-column -@findex picture-clear-line - In Picture mode, the commands that normally delete or kill text, -instead erase text (replacing it with spaces). @key{DEL} -(@code{picture-backward-clear-column}) replaces the preceding -character with a space rather than removing it; this moves point -backwards. @kbd{C-d} (@code{picture-clear-column}) replaces the next -character or characters with spaces, but does not move point. (If you -want to clear characters to spaces and move forward over them, use -@key{SPC}.) @kbd{C-k} (@code{picture-clear-line}) really kills the -contents of lines, but does not delete the newlines from the buffer. - -@findex picture-open-line - To do actual insertion, you must use special commands. @kbd{C-o} -(@code{picture-open-line}) creates a blank line after the current -line; it never splits a line. @kbd{C-M-o} (@code{split-line}) makes -sense in Picture mode, so it is not changed. @kbd{C-j} -(@code{picture-duplicate-line}) inserts another line with the same -contents below the current line. - -@kindex C-c C-d @r{(Picture mode)} - To do actual deletion in Picture mode, use @kbd{C-w}, @kbd{C-c C-d} -(which is defined as @code{delete-char}, as @kbd{C-d} is in other -modes), or one of the picture rectangle commands (@pxref{Rectangles in -Picture}). - -@node Insert in Picture -@section Controlling Motion after Insert - -@findex picture-movement-up -@findex picture-movement-down -@findex picture-movement-left -@findex picture-movement-right -@findex picture-movement-nw -@findex picture-movement-ne -@findex picture-movement-sw -@findex picture-movement-se -@kindex C-c < @r{(Picture mode)} -@kindex C-c > @r{(Picture mode)} -@kindex C-c ^ @r{(Picture mode)} -@kindex C-c . @r{(Picture mode)} -@kindex C-c ` @r{(Picture mode)} -@kindex C-c ' @r{(Picture mode)} -@kindex C-c / @r{(Picture mode)} -@kindex C-c \ @r{(Picture mode)} - Since ``self-inserting'' characters in Picture mode overwrite and move -point, there is no essential restriction on how point should be moved. -Normally point moves right, but you can specify any of the eight -orthogonal or diagonal directions for motion after a ``self-inserting'' -character. This is useful for drawing lines in the buffer. - -@table @kbd -@item C-c < -@itemx C-c @key{LEFT} -Move left after insertion (@code{picture-movement-left}). -@item C-c > -@itemx C-c @key{RIGHT} -Move right after insertion (@code{picture-movement-right}). -@item C-c ^ -@itemx C-c @key{UP} -Move up after insertion (@code{picture-movement-up}). -@item C-c . -@itemx C-c @key{DOWN} -Move down after insertion (@code{picture-movement-down}). -@item C-c ` -@itemx C-c @key{HOME} -Move up and left (``northwest'') after insertion (@code{picture-movement-nw}). -@item C-c ' -@itemx C-c @key{PAGEUP} -Move up and right (``northeast'') after insertion -(@code{picture-movement-ne}). -@item C-c / -@itemx C-c @key{END} -Move down and left (``southwest'') after insertion -@*(@code{picture-movement-sw}). -@item C-c \ -@itemx C-c @key{PAGEDOWN} -Move down and right (``southeast'') after insertion -@*(@code{picture-movement-se}). -@end table - -@kindex C-c C-f @r{(Picture mode)} -@kindex C-c C-b @r{(Picture mode)} -@findex picture-motion -@findex picture-motion-reverse - Two motion commands move based on the current Picture insertion -direction. The command @kbd{C-c C-f} (@code{picture-motion}) moves in the -same direction as motion after ``insertion'' currently does, while @kbd{C-c -C-b} (@code{picture-motion-reverse}) moves in the opposite direction. - -@node Tabs in Picture -@section Picture Mode Tabs - -@kindex M-TAB @r{(Picture mode)} -@findex picture-tab-search -@vindex picture-tab-chars - Two kinds of tab-like action are provided in Picture mode. Use -@kbd{M-@key{TAB}} (@code{picture-tab-search}) for context-based tabbing. -With no argument, it moves to a point underneath the next -``interesting'' character that follows whitespace in the previous -nonblank line. ``Next'' here means ``appearing at a horizontal position -greater than the one point starts out at.'' With an argument, as in -@kbd{C-u M-@key{TAB}}, this command moves to the next such interesting -character in the current line. @kbd{M-@key{TAB}} does not change the -text; it only moves point. ``Interesting'' characters are defined by -the variable @code{picture-tab-chars}, which should define a set of -characters. The syntax for this variable is like the syntax used inside -of @samp{[@dots{}]} in a regular expression---but without the @samp{[} -and the @samp{]}. Its default value is @code{"!-~"}. - -@findex picture-tab - @key{TAB} itself runs @code{picture-tab}, which operates based on the -current tab stop settings; it is the Picture mode equivalent of -@code{tab-to-tab-stop}. Normally it just moves point, but with a numeric -argument it clears the text that it moves over. - -@kindex C-c TAB @r{(Picture mode)} -@findex picture-set-tab-stops - The context-based and tab-stop-based forms of tabbing are brought -together by the command @kbd{C-c @key{TAB}} (@code{picture-set-tab-stops}). -This command sets the tab stops to the positions which @kbd{M-@key{TAB}} -would consider significant in the current line. The use of this command, -together with @key{TAB}, can get the effect of context-based tabbing. But -@kbd{M-@key{TAB}} is more convenient in the cases where it is sufficient. - - It may be convenient to prevent use of actual tab characters in -pictures. For example, this prevents @kbd{C-x @key{TAB}} from messing -up the picture. You can do this by setting the variable -@code{indent-tabs-mode} to @code{nil}. - -@node Rectangles in Picture -@section Picture Mode Rectangle Commands -@cindex rectangles and Picture mode -@cindex Picture mode and rectangles - - Picture mode defines commands for working on rectangular pieces of -the text in ways that fit with the quarter-plane model. The standard -rectangle commands may also be useful. -@iftex -@xref{Rectangles,,, emacs, the Emacs Manual}. -@end iftex -@ifnottex -@xref{Rectangles}. -@end ifnottex - -@table @kbd -@item C-c C-k -Clear out the region-rectangle with spaces -(@code{picture-clear-rectangle}). With argument, delete the text. -@item C-c C-w @var{r} -Similar, but save rectangle contents in register @var{r} first -(@code{picture-clear-rectangle-to-register}). -@item C-c C-y -Copy last killed rectangle into the buffer by overwriting, with upper -left corner at point (@code{picture-yank-rectangle}). With argument, -insert instead. -@item C-c C-x @var{r} -Similar, but use the rectangle in register @var{r} -(@code{picture-yank-rectangle-from-register}). -@end table - -@kindex C-c C-k @r{(Picture mode)} -@kindex C-c C-w @r{(Picture mode)} -@findex picture-clear-rectangle -@findex picture-clear-rectangle-to-register - The picture rectangle commands @kbd{C-c C-k} -(@code{picture-clear-rectangle}) and @kbd{C-c C-w} -(@code{picture-clear-rectangle-to-register}) differ from the standard -rectangle commands in that they normally clear the rectangle instead of -deleting it; this is analogous with the way @kbd{C-d} is changed in Picture -mode. - - However, deletion of rectangles can be useful in Picture mode, so -these commands delete the rectangle if given a numeric argument. -@kbd{C-c C-k} either with or without a numeric argument saves the -rectangle for @kbd{C-c C-y}. - -@kindex C-c C-y @r{(Picture mode)} -@kindex C-c C-x @r{(Picture mode)} -@findex picture-yank-rectangle -@findex picture-yank-rectangle-from-register - The Picture mode commands for yanking rectangles differ from the -standard ones in that they overwrite instead of inserting. This is -the same way that Picture mode insertion of other text differs from -other modes. @kbd{C-c C-y} (@code{picture-yank-rectangle}) inserts -(by overwriting) the rectangle that was most recently killed, while -@kbd{C-c C-x} (@code{picture-yank-rectangle-from-register}) does -likewise for the rectangle found in a specified register. - -@ignore - arch-tag: 10e423ad-d896-42f2-a7e8-7018adeaf8c2 -@end ignore diff --git a/man/programs.texi b/man/programs.texi deleted file mode 100644 index 2472d7daabe..00000000000 --- a/man/programs.texi +++ /dev/null @@ -1,1773 +0,0 @@ -@c This is part of the Emacs manual. -@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 1999, 2000, -@c 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. -@c See file emacs.texi for copying conditions. -@node Programs, Building, Text, Top -@chapter Editing Programs -@cindex Lisp editing -@cindex C editing -@cindex program editing - - Emacs provides many features to facilitate editing programs. Some -of these features can - -@itemize @bullet -@item -Find or move over top-level definitions (@pxref{Defuns}). -@item -Apply the usual indentation conventions of the language -(@pxref{Program Indent}). -@item -Balance parentheses (@pxref{Parentheses}). -@item -Insert, kill or align comments (@pxref{Comments}). -@item -Highlight program syntax (@pxref{Font Lock}). -@end itemize - - This chapter describes these features and many more. - -@menu -* Program Modes:: Major modes for editing programs. -* Defuns:: Commands to operate on major top-level parts - of a program. -* Program Indent:: Adjusting indentation to show the nesting. -* Parentheses:: Commands that operate on parentheses. -* Comments:: Inserting, killing, and aligning comments. -* Documentation:: Getting documentation of functions you plan to call. -* Hideshow:: Displaying blocks selectively. -* Symbol Completion:: Completion on symbol names of your program or language. -* Glasses:: Making identifiersLikeThis more readable. -* Misc for Programs:: Other Emacs features useful for editing programs. -* C Modes:: Special commands of C, C++, Objective-C, - Java, and Pike modes. -* Asm Mode:: Asm mode and its special features. -@ifnottex -* Fortran:: Fortran mode and its special features. -@end ifnottex -@end menu - -@node Program Modes -@section Major Modes for Programming Languages -@cindex modes for programming languages - - Emacs has specialized major modes for various programming languages. -@xref{Major Modes}. A programming language major mode typically -specifies the syntax of expressions, the customary rules for -indentation, how to do syntax highlighting for the language, and how -to find the beginning of a function definition. It often customizes -or provides facilities for compiling and debugging programs as well. - - Ideally, Emacs should provide a major mode for each programming -language that you might want to edit; if it doesn't have a mode for -your favorite language, you can contribute one. But often the mode -for one language can serve for other syntactically similar languages. -The major mode for language @var{l} is called @code{@var{l}-mode}, -and you can select it by typing @kbd{M-x @var{l}-mode @key{RET}}. -@xref{Choosing Modes}. - -@cindex Perl mode -@cindex Icon mode -@cindex Makefile mode -@cindex Tcl mode -@cindex CPerl mode -@cindex DSSSL mode -@cindex Octave mode -@cindex Metafont mode -@cindex Modula2 mode -@cindex Prolog mode -@cindex Python mode -@cindex Simula mode -@cindex VHDL mode -@cindex M4 mode -@cindex Shell-script mode -@cindex Delphi mode -@cindex PostScript mode -@cindex Conf mode -@cindex DNS mode - The existing programming language major modes include Lisp, Scheme (a -variant of Lisp) and the Scheme-based DSSSL expression language, Ada, -ASM, AWK, C, C++, Delphi (Object Pascal), Fortran (free format and fixed -format), Icon, IDL (CORBA), IDLWAVE, Java, Metafont (@TeX{}'s -companion for font creation), Modula2, Objective-C, Octave, Pascal, -Perl, Pike, PostScript, Prolog, Python, Simula, Tcl, and VHDL. An -alternative mode for Perl is called CPerl mode. Modes are available for -the scripting languages of the common GNU and Unix shells, VMS DCL, and -MS-DOS/MS-Windows @samp{BAT} files. There are also major modes for -editing makefiles, DNS master files, and various sorts of configuration -files. - -@kindex DEL @r{(programming modes)} -@findex c-electric-backspace - In most programming languages, indentation should vary from line to -line to illustrate the structure of the program. So the major modes -for programming languages arrange for @key{TAB} to update the -indentation of the current line. They also rebind @key{DEL} to treat -a tab as if it were the equivalent number of spaces; this lets you -delete one column of indentation without worrying whether the -whitespace consists of spaces or tabs. Use @kbd{C-b C-d} to delete a -tab character before point, in these modes. - - Separate manuals are available for the modes for Ada (@pxref{Top, , Ada -Mode, ada-mode, Ada Mode}), C/C++/Objective C/Java/Corba IDL/Pike/AWK -(@pxref{Top, , CC Mode, ccmode, CC Mode}) and the IDLWAVE modes -(@pxref{Top, , IDLWAVE, idlwave, IDLWAVE User Manual}). For Fortran -mode, see -@iftex -@ref{Fortran,,, emacs-xtra, Specialized Emacs Features}. -@end iftex -@ifnottex -@ref{Fortran}. -@end ifnottex - - -@cindex mode hook -@vindex c-mode-hook -@vindex lisp-mode-hook -@vindex emacs-lisp-mode-hook -@vindex lisp-interaction-mode-hook -@vindex scheme-mode-hook - Turning on a major mode runs a normal hook called the @dfn{mode -hook}, which is the value of a Lisp variable. Each major mode has a -mode hook, and the hook's name is always made from the mode command's -name by adding @samp{-hook}. For example, turning on C mode runs the -hook @code{c-mode-hook}, while turning on Lisp mode runs the hook -@code{lisp-mode-hook}. The purpose of the mode hook is to give you a -place to set up customizations for that major mode. @xref{Hooks}. - -@node Defuns -@section Top-Level Definitions, or Defuns - - In Emacs, a major definition at the top level in the buffer, -something like a function, is called a @dfn{defun}. The name comes -from Lisp, but in Emacs we use it for all languages. - -@menu -* Left Margin Paren:: An open-paren or similar opening delimiter - starts a defun if it is at the left margin. -* Moving by Defuns:: Commands to move over or mark a major definition. -* Imenu:: Making buffer indexes as menus. -* Which Function:: Which Function mode shows which function you are in. -@end menu - -@node Left Margin Paren -@subsection Left Margin Convention - -@cindex open-parenthesis in leftmost column -@cindex ( in leftmost column - Emacs assumes by default that any opening delimiter found at the -left margin is the start of a top-level definition, or defun. -Therefore, @strong{don't put an opening delimiter at the left margin -unless it should have that significance}. For instance, never put an -open-parenthesis at the left margin in a Lisp file unless it is the -start of a top-level list. - - If you don't follow this convention, not only will you have trouble -when you explicitly use the commands for motion by defuns; other -features that use them will also give you trouble. This includes -the indentation commands (@pxref{Program Indent}) and Font Lock -mode (@pxref{Font Lock}). - - The most likely problem case is when you want an opening delimiter -at the start of a line inside a string. To avoid trouble, put an -escape character (@samp{\}, in C and Emacs Lisp, @samp{/} in some -other Lisp dialects) before the opening delimiter. This will not -affect the contents of the string, but will prevent that opening -delimiter from starting a defun. Here's an example: - -@example - (insert "Foo: -\(bar) -") -@end example - - To help you catch violations of this convention, Font Lock mode -highlights confusing opening delimiters (those that ought to be -quoted) in bold red. - -If you need to override this convention, you can so by setting this -user option: - -@defvar open-paren-in-column-0-is-defun-start -If this user option is set to @code{t} (the default), opening -parentheses or braces at column zero always start defuns. When it's -@code{nil}, defuns are found by searching for parens or braces at the -outermost level. -@end defvar - - Usually, you shouldn't need to set -@code{open-paren-in-column-0-is-defun-start} to @code{nil}. However, -if your buffer contains parentheses or braces in column zero which -don't start defuns and this confuses Emacs, it sometimes helps to set -the option to @code{nil}. Be aware, though, that this will make -scrolling and display in large buffers quite sluggish, and that -parentheses and braces must be correctly matched throughout the buffer -for it to work properly. - - In the earliest days, the original Emacs found defuns by moving -upward a level of parentheses or braces until there were no more -levels to go up. This always required scanning all the way back to -the beginning of the buffer, even for a small function. To speed up -the operation, we changed Emacs to assume that any opening delimiter -at the left margin is the start of a defun. This heuristic is nearly -always right, and avoids the need to scan back to the beginning of the -buffer. However, now that modern computers are so powerful, this -scanning is rarely slow enough to annoy, so we've provided a way to -disable the heuristic. - -@node Moving by Defuns -@subsection Moving by Defuns -@cindex defuns - - These commands move point or set up the region based on top-level -major definitions, also called @dfn{defuns}. - -@table @kbd -@item C-M-a -Move to beginning of current or preceding defun -(@code{beginning-of-defun}). -@item C-M-e -Move to end of current or following defun (@code{end-of-defun}). -@item C-M-h -Put region around whole current or following defun (@code{mark-defun}). -@end table - -@cindex move to beginning or end of function -@cindex function, move to beginning or end -@kindex C-M-a -@kindex C-M-e -@kindex C-M-h -@findex beginning-of-defun -@findex end-of-defun -@findex mark-defun - The commands to move to the beginning and end of the current defun -are @kbd{C-M-a} (@code{beginning-of-defun}) and @kbd{C-M-e} -(@code{end-of-defun}). If you repeat one of these commands, or use a -positive numeric argument, each repetition moves to the next defun in -the direction of motion. - - @kbd{C-M-a} with a negative argument @minus{}@var{n} moves forward -@var{n} times to the next beginning of a defun. This is not exactly -the same place that @kbd{C-M-e} with argument @var{n} would move to; -the end of this defun is not usually exactly the same place as the -beginning of the following defun. (Whitespace, comments, and perhaps -declarations can separate them.) Likewise, @kbd{C-M-e} with a -negative argument moves back to an end of a defun, which is not quite -the same as @kbd{C-M-a} with a positive argument. - -@kindex C-M-h @r{(C mode)} -@findex c-mark-function - To operate on the current defun, use @kbd{C-M-h} (@code{mark-defun}) -which puts point at the beginning and mark at the end of the current -defun. This is the easiest way to get ready to kill the defun in -order to move it to a different place in the file. If you use the -command while point is between defuns, it uses the following defun. -Successive uses of @kbd{C-M-h}, or using it in Transient Mark mode -when the mark is active, extends the end of the region to include one -more defun each time. - - In C mode, @kbd{C-M-h} runs the function @code{c-mark-function}, -which is almost the same as @code{mark-defun}; the difference is that -it backs up over the argument declarations, function name and returned -data type so that the entire C function is inside the region. This is -an example of how major modes adjust the standard key bindings so that -they do their standard jobs in a way better fitting a particular -language. Other major modes may replace any or all of these key -bindings for that purpose. - -@node Imenu -@subsection Imenu -@cindex index of buffer definitions -@cindex buffer definitions index -@cindex tags - - The Imenu facility offers a way to find the major definitions in -a file by name. It is also useful in text formatter major modes, -where it treats each chapter, section, etc., as a definition. -(@xref{Tags}, for a more powerful feature that handles multiple files -together.) - -@findex imenu - If you type @kbd{M-x imenu}, it reads the name of a definition using -the minibuffer, then moves point to that definition. You can use -completion to specify the name; the command always displays the whole -list of valid names. - -@findex imenu-add-menubar-index - Alternatively, you can bind the command @code{imenu} to a mouse -click. Then it displays mouse menus for you to select a definition -name. You can also add the buffer's index to the menu bar by calling -@code{imenu-add-menubar-index}. If you want to have this menu bar -item available for all buffers in a certain major mode, you can do -this by adding @code{imenu-add-menubar-index} to its mode hook. But -if you have done that, you will have to wait a little while each time -you visit a file in that mode, while Emacs finds all the definitions -in that buffer. - -@vindex imenu-auto-rescan - When you change the contents of a buffer, if you add or delete -definitions, you can update the buffer's index based on the -new contents by invoking the @samp{*Rescan*} item in the menu. -Rescanning happens automatically if you set @code{imenu-auto-rescan} to -a non-@code{nil} value. There is no need to rescan because of small -changes in the text. - -@vindex imenu-sort-function - You can customize the way the menus are sorted by setting the -variable @code{imenu-sort-function}. By default, names are ordered as -they occur in the buffer; if you want alphabetic sorting, use the -symbol @code{imenu--sort-by-name} as the value. You can also -define your own comparison function by writing Lisp code. - - Imenu provides the information to guide Which Function mode -@ifnottex -(@pxref{Which Function}). -@end ifnottex -@iftex -(see below). -@end iftex -The Speedbar can also use it (@pxref{Speedbar}). - -@node Which Function -@subsection Which Function Mode -@cindex current function name in mode line - - Which Function mode is a minor mode that displays the current -function name in the mode line, updating it as you move around in a -buffer. - -@findex which-function-mode -@vindex which-func-modes - To either enable or disable Which Function mode, use the command -@kbd{M-x which-function-mode}. This command is global; it applies to -all buffers, both existing ones and those yet to be created. However, -it takes effect only in certain major modes, those listed in the value -of @code{which-func-modes}. If the value is @code{t}, then Which -Function mode applies to all major modes that know how to support -it---in other words, all the major modes that support Imenu. - -@node Program Indent -@section Indentation for Programs -@cindex indentation for programs - - The best way to keep a program properly indented is to use Emacs to -reindent it as you change it. Emacs has commands to indent properly -either a single line, a specified number of lines, or all of the lines -inside a single parenthetical grouping. - -@menu -* Basic Indent:: Indenting a single line. -* Multi-line Indent:: Commands to reindent many lines at once. -* Lisp Indent:: Specifying how each Lisp function should be indented. -* C Indent:: Extra features for indenting C and related modes. -* Custom C Indent:: Controlling indentation style for C and related modes. -@end menu - -@cindex pretty-printer - Emacs also provides a Lisp pretty-printer in the library @code{pp}. -This program reformats a Lisp object with indentation chosen to look nice. - -@node Basic Indent -@subsection Basic Program Indentation Commands - - The basic indentation commands indent a single line according to the -usual conventions of the language you are editing. - -@need 1000 -@table @kbd -@item @key{TAB} -Adjust indentation of current line. -@item C-j -Insert a newline, then adjust indentation of following line -(@code{newline-and-indent}). -@end table - -@kindex TAB @r{(programming modes)} -@findex c-indent-command -@findex indent-line-function -@findex indent-for-tab-command - The basic indentation command is @key{TAB}, which gives the current line -the correct indentation as determined from the previous lines. The -function that @key{TAB} runs depends on the major mode; it is -@code{lisp-indent-line} -in Lisp mode, @code{c-indent-command} in C mode, etc. These functions -understand the syntax and conventions of different languages, but they all do -conceptually the same job: @key{TAB} in any programming-language major mode -inserts or deletes whitespace at the beginning of the current line, -independent of where point is in the line. If point was inside the -whitespace at the beginning of the line, @key{TAB} puts it at the end of -that whitespace; otherwise, @key{TAB} keeps point fixed with respect to -the characters around it. - - Use @kbd{C-q @key{TAB}} to insert a tab character at point. - -@kindex C-j -@findex newline-and-indent - When entering lines of new code, use @kbd{C-j} -(@code{newline-and-indent}), which inserts a newline and then adjusts -indentation after it. (It also deletes any trailing whitespace which -remains before the new newline.) Thus, @kbd{C-j} at the end of a line -creates a blank line with appropriate indentation. In programming -language modes, it is equivalent to @key{RET} @key{TAB}. - - @key{TAB} indents a line that starts within a parenthetical grouping -under the preceding line within the grouping, or the text after the -parenthesis. Therefore, if you manually give one of these lines a -nonstandard indentation, the lines below will tend to follow it. This -behavior is convenient in cases where you have overridden the standard -result of @key{TAB} because you find it unaesthetic for a particular -line. - - In some modes, an open-parenthesis, open-brace or other opening -delimiter at the left margin is assumed by Emacs (including the -indentation routines) to be the start of a function. This speeds up -indentation commands. If you will be editing text which contains -opening delimiters in column zero that aren't the beginning of a -functions, even inside strings or comments, you must set -@code{open-paren-in-column-0-is-defun-start}. @xref{Left Margin -Paren}, for more information on this. - - Normally, lines are indented with tabs and spaces. If you want Emacs -to use spaces only, set @code{indent-tabs-mode} (@pxref{Just Spaces}). - -@node Multi-line Indent -@subsection Indenting Several Lines - - When you wish to reindent several lines of code which have been -altered or moved to a different level in the parenthesis structure, -you have several commands available. - -@table @kbd -@item C-M-q -Reindent all the lines within one parenthetical grouping (@code{indent-pp-sexp}). -@item C-M-\ -Reindent all lines in the region (@code{indent-region}). -@item C-u @key{TAB} -Shift an entire parenthetical grouping rigidly sideways so that its -first line is properly indented. -@item M-x indent-code-rigidly -Shift all the lines in the region rigidly sideways, but do not alter -lines that start inside comments and strings. -@end table - -@kindex C-M-q -@findex indent-pp-sexp - You can reindent the contents of a single parenthetical grouping by -positioning point before the beginning of it and typing @kbd{C-M-q} -(@code{indent-pp-sexp} in Lisp mode, @code{c-indent-exp} in C mode; also -bound to other suitable commands in other modes). The indentation of -the line where the grouping starts is not changed; therefore this -changes only the relative indentation within the grouping, not its -overall indentation. To correct that as well, type @key{TAB} first. - - Another way to specify the range to be reindented is with the -region. The command @kbd{C-M-\} (@code{indent-region}) applies -@key{TAB} to every line whose first character is between point and -mark. - -@kindex C-u TAB - If you like the relative indentation within a grouping, but not the -indentation of its first line, you can type @kbd{C-u @key{TAB}} to -reindent the whole grouping as a rigid unit. (This works in Lisp -modes and C and related modes.) @key{TAB} with a numeric argument -reindents the current line as usual, then reindents by the same amount -all the lines in the parenthetical grouping starting on the current -line. It is clever, though, and does not alter lines that start -inside strings. Neither does it alter C preprocessor lines when in C -mode, but it does reindent any continuation lines that may be attached -to them. - -@findex indent-code-rigidly - You can also perform this operation on the region, using the command -@kbd{M-x indent-code-rigidly}. It rigidly shifts all the lines in the -region sideways, like @code{indent-rigidly} does (@pxref{Indentation -Commands}). It doesn't alter the indentation of lines that start -inside a string, unless the region also starts inside that string. -The prefix arg specifies the number of columns to indent. - -@node Lisp Indent -@subsection Customizing Lisp Indentation -@cindex customizing Lisp indentation - - The indentation pattern for a Lisp expression can depend on the function -called by the expression. For each Lisp function, you can choose among -several predefined patterns of indentation, or define an arbitrary one with -a Lisp program. - - The standard pattern of indentation is as follows: the second line of the -expression is indented under the first argument, if that is on the same -line as the beginning of the expression; otherwise, the second line is -indented underneath the function name. Each following line is indented -under the previous line whose nesting depth is the same. - -@vindex lisp-indent-offset - If the variable @code{lisp-indent-offset} is non-@code{nil}, it overrides -the usual indentation pattern for the second line of an expression, so that -such lines are always indented @code{lisp-indent-offset} more columns than -the containing list. - -@vindex lisp-body-indent - Certain functions override the standard pattern. Functions whose -names start with @code{def} treat the second lines as the start of -a @dfn{body}, by indenting the second line @code{lisp-body-indent} -additional columns beyond the open-parenthesis that starts the -expression. - -@cindex @code{lisp-indent-function} property - You can override the standard pattern in various ways for individual -functions, according to the @code{lisp-indent-function} property of -the function name. Normally you would use this for macro definitions -and specify it using the @code{declare} construct (@pxref{Defining -Macros,,, elisp, the Emacs Lisp Reference Manual}). - -@node C Indent -@subsection Commands for C Indentation - - Here are special features for indentation in C mode and related modes: - -@table @code -@item C-c C-q -@kindex C-c C-q @r{(C mode)} -@findex c-indent-defun -Reindent the current top-level function definition or aggregate type -declaration (@code{c-indent-defun}). - -@item C-M-q -@kindex C-M-q @r{(C mode)} -@findex c-indent-exp -Reindent each line in the balanced expression that follows point -(@code{c-indent-exp}). A prefix argument inhibits warning messages -about invalid syntax. - -@item @key{TAB} -@findex c-indent-command -Reindent the current line, and/or in some cases insert a tab character -(@code{c-indent-command}). - -@vindex c-tab-always-indent -If @code{c-tab-always-indent} is @code{t}, this command always reindents -the current line and does nothing else. This is the default. - -If that variable is @code{nil}, this command reindents the current line -only if point is at the left margin or in the line's indentation; -otherwise, it inserts a tab (or the equivalent number of spaces, -if @code{indent-tabs-mode} is @code{nil}). - -Any other value (not @code{nil} or @code{t}) means always reindent the -line, and also insert a tab if within a comment or a string. -@end table - - To reindent the whole current buffer, type @kbd{C-x h C-M-\}. This -first selects the whole buffer as the region, then reindents that -region. - - To reindent the current block, use @kbd{C-M-u C-M-q}. This moves -to the front of the block and then reindents it all. - -@node Custom C Indent -@subsection Customizing C Indentation -@cindex style (for indentation) - - C mode and related modes use a flexible mechanism for customizing -indentation. C mode indents a source line in two steps: first it -classifies the line syntactically according to its contents and -context; second, it determines the indentation offset associated by -your selected @dfn{style} with the syntactic construct and adds this -onto the indentation of the @dfn{anchor statement}. - -@table @kbd -@item C-c . @key{RET} @var{style} @key{RET} -Select a predefined style @var{style} (@code{c-set-style}). -@end table - - A @dfn{style} is a named collection of customizations that can be -used in C mode and the related modes. @ref{Styles,,, ccmode, The CC -Mode Manual}, for a complete description. Emacs comes with several -predefined styles, including @code{gnu}, @code{k&r}, @code{bsd}, -@code{stroustrup}, @code{linux}, @code{python}, @code{java}, -@code{whitesmith}, @code{ellemtel}, and @code{awk}. Some of these -styles are primarily intended for one language, but any of them can be -used with any of the languages supported by these modes. To find out -what a style looks like, select it and reindent some code, e.g., by -typing @key{C-M-q} at the start of a function definition. - -@kindex C-c . @r{(C mode)} -@findex c-set-style - To choose a style for the current buffer, use the command @w{@kbd{C-c -.}}. Specify a style name as an argument (case is not significant). -This command affects the current buffer only, and it affects only -future invocations of the indentation commands; it does not reindent -the code already in the buffer. To reindent the whole buffer in the -new style, you can type @kbd{C-x h C-M-\}. - -@vindex c-default-style - You can also set the variable @code{c-default-style} to specify the -default style for various major modes. Its value should be either the -style's name (a string) or an alist, in which each element specifies -one major mode and which indentation style to use for it. For -example, - -@example -(setq c-default-style - '((java-mode . "java") (awk-mode . "awk") (other . "gnu"))) -@end example - -@noindent -specifies explicit choices for Java and AWK modes, and the default -@samp{gnu} style for the other C-like modes. (These settings are -actually the defaults.) This variable takes effect when you select -one of the C-like major modes; thus, if you specify a new default -style for Java mode, you can make it take effect in an existing Java -mode buffer by typing @kbd{M-x java-mode} there. - - The @code{gnu} style specifies the formatting recommended by the GNU -Project for C; it is the default, so as to encourage use of our -recommended style. - - @xref{Indentation Engine Basics,,, ccmode, the CC Mode Manual}, and -@ref{Customizing Indentation,,, ccmode, the CC Mode Manual}, for more -information on customizing indentation for C and related modes, -including how to override parts of an existing style and how to define -your own styles. - -@node Parentheses -@section Commands for Editing with Parentheses - -@findex check-parens -@cindex unbalanced parentheses and quotes - This section describes the commands and features that take advantage -of the parenthesis structure in a program, or help you keep it -balanced. - - When talking about these facilities, the term ``parenthesis'' also -includes braces, brackets, or whatever delimiters are defined to match -in pairs. The major mode controls which delimiters are significant, -through the syntax table (@pxref{Syntax}). In Lisp, only parentheses -count; in C, these commands apply to braces and brackets too. - - You can use @kbd{M-x check-parens} to find any unbalanced -parentheses and unbalanced string quotes in the buffer. - -@menu -* Expressions:: Expressions with balanced parentheses. -* Moving by Parens:: Commands for moving up, down and across - in the structure of parentheses. -* Matching:: Insertion of a close-delimiter flashes matching open. -@end menu - -@node Expressions -@subsection Expressions with Balanced Parentheses - -@cindex sexp -@cindex expression -@cindex balanced expression - These commands deal with balanced expressions, also called -@dfn{sexps}@footnote{The word ``sexp'' is used to refer to an -expression in Lisp.}. - -@table @kbd -@item C-M-f -Move forward over a balanced expression (@code{forward-sexp}). -@item C-M-b -Move backward over a balanced expression (@code{backward-sexp}). -@item C-M-k -Kill balanced expression forward (@code{kill-sexp}). -@item C-M-t -Transpose expressions (@code{transpose-sexps}). -@item C-M-@@ -@itemx C-M-@key{SPC} -Put mark after following expression (@code{mark-sexp}). -@end table - - Each programming language major mode customizes the definition of -balanced expressions to suit that language. Balanced expressions -typically include symbols, numbers, and string constants, as well as -any pair of matching delimiters and their contents. Some languages -have obscure forms of expression syntax that nobody has bothered to -implement in Emacs. - -@cindex Control-Meta - By convention, the keys for these commands are all Control-Meta -characters. They usually act on expressions just as the corresponding -Meta characters act on words. For instance, the command @kbd{C-M-b} -moves backward over a balanced expression, just as @kbd{M-b} moves -back over a word. - -@kindex C-M-f -@kindex C-M-b -@findex forward-sexp -@findex backward-sexp - To move forward over a balanced expression, use @kbd{C-M-f} -(@code{forward-sexp}). If the first significant character after point -is an opening delimiter (@samp{(} in Lisp; @samp{(}, @samp{[} or -@samp{@{} in C), @kbd{C-M-f} moves past the matching closing -delimiter. If the character begins a symbol, string, or number, -@kbd{C-M-f} moves over that. - - The command @kbd{C-M-b} (@code{backward-sexp}) moves backward over a -balanced expression. The detailed rules are like those above for -@kbd{C-M-f}, but with directions reversed. If there are prefix -characters (single-quote, backquote and comma, in Lisp) preceding the -expression, @kbd{C-M-b} moves back over them as well. The balanced -expression commands move across comments as if they were whitespace, -in most modes. - - @kbd{C-M-f} or @kbd{C-M-b} with an argument repeats that operation the -specified number of times; with a negative argument, it moves in the -opposite direction. - -@cindex killing expressions -@kindex C-M-k -@findex kill-sexp - Killing a whole balanced expression can be done with @kbd{C-M-k} -(@code{kill-sexp}). @kbd{C-M-k} kills the characters that @kbd{C-M-f} -would move over. - -@cindex transposition of expressions -@kindex C-M-t -@findex transpose-sexps - A somewhat random-sounding command which is nevertheless handy is -@kbd{C-M-t} (@code{transpose-sexps}), which drags the previous -balanced expression across the next one. An argument serves as a -repeat count, moving the previous expression over that many following -ones. A negative argument drags the previous balanced expression -backwards across those before it (thus canceling out the effect of -@kbd{C-M-t} with a positive argument). An argument of zero, rather -than doing nothing, transposes the balanced expressions ending at or -after point and the mark. - -@kindex C-M-@@ -@kindex C-M-@key{SPC} -@findex mark-sexp - To set the region around the next balanced expression in the buffer, -use @kbd{C-M-@@} (@code{mark-sexp}), which sets mark at the same place -that @kbd{C-M-f} would move to. @kbd{C-M-@@} takes arguments like -@kbd{C-M-f}. In particular, a negative argument is useful for putting -the mark at the beginning of the previous balanced expression. The -alias @kbd{C-M-@key{SPC}} is equivalent to @kbd{C-M-@@}. When you -repeat this command, or use it in Transient Mark mode when the mark is -active, it extends the end of the region by one sexp each time. - - In languages that use infix operators, such as C, it is not possible -to recognize all balanced expressions as such because there can be -multiple possibilities at a given position. For example, C mode does -not treat @samp{foo + bar} as a single expression, even though it -@emph{is} one C expression; instead, it recognizes @samp{foo} as one -expression and @samp{bar} as another, with the @samp{+} as punctuation -between them. Both @samp{foo + bar} and @samp{foo} are legitimate -choices for ``the expression following point'' when point is at the -@samp{f}, so the expression commands must perforce choose one or the -other to operate on. Note that @samp{(foo + bar)} is recognized as a -single expression in C mode, because of the parentheses. - -@node Moving by Parens -@subsection Moving in the Parenthesis Structure - -@cindex parenthetical groupings -@cindex parentheses, moving across -@cindex matching parenthesis and braces, moving to -@cindex braces, moving across -@cindex list commands - The Emacs commands for handling parenthetical groupings see nothing -except parentheses (or whatever characters must balance in the -language you are working with), and the escape characters that might -be used to quote those. They are mainly intended for editing -programs, but can be useful for editing any text that has parentheses. -They are sometimes called ``list'' commands because in Lisp these -groupings are lists. - -@table @kbd -@item C-M-n -Move forward over a parenthetical group (@code{forward-list}). -@item C-M-p -Move backward over a parenthetical group (@code{backward-list}). -@item C-M-u -Move up in parenthesis structure (@code{backward-up-list}). -@item C-M-d -Move down in parenthesis structure (@code{down-list}). -@end table - -@kindex C-M-n -@kindex C-M-p -@findex forward-list -@findex backward-list - The ``list'' commands @kbd{C-M-n} (@code{forward-list}) and -@kbd{C-M-p} (@code{backward-list}) move over one (or @var{n}) -parenthetical groupings, skipping blithely over any amount of text -that doesn't include meaningful parentheses (symbols, strings, etc.). - -@kindex C-M-u -@findex backward-up-list - @kbd{C-M-n} and @kbd{C-M-p} try to stay at the same level in the -parenthesis structure. To move @emph{up} one (or @var{n}) levels, use -@kbd{C-M-u} (@code{backward-up-list}). @kbd{C-M-u} moves backward up -past one unmatched opening delimiter. A positive argument serves as a -repeat count; a negative argument reverses the direction of motion, so -that the command moves forward and up one or more levels. - -@kindex C-M-d -@findex down-list - To move @emph{down} in the parenthesis structure, use @kbd{C-M-d} -(@code{down-list}). In Lisp mode, where @samp{(} is the only opening -delimiter, this is nearly the same as searching for a @samp{(}. An -argument specifies the number of levels to go down. - -@node Matching -@subsection Automatic Display Of Matching Parentheses -@cindex matching parentheses -@cindex parentheses, displaying matches - - The Emacs parenthesis-matching feature is designed to show -automatically how parentheses (and other matching delimiters) match in -the text. Whenever you type a self-inserting character that is a -closing delimiter, the cursor moves momentarily to the location of the -matching opening delimiter, provided that is on the screen. If it is -not on the screen, Emacs displays some of the text near it in the echo -area. Either way, you can tell which grouping you are closing off. - - If the opening delimiter and closing delimiter are mismatched---such -as in @samp{[x)}---a warning message is displayed in the echo area. - -@vindex blink-matching-paren -@vindex blink-matching-paren-distance -@vindex blink-matching-delay - Three variables control parenthesis match display: - - @code{blink-matching-paren} turns the feature on or off: @code{nil} -disables it, but the default is @code{t} to enable match display. - - @code{blink-matching-delay} says how many seconds to leave the -cursor on the matching opening delimiter, before bringing it back to -the real location of point; the default is 1, but on some systems it -is useful to specify a fraction of a second. - - @code{blink-matching-paren-distance} specifies how many characters -back to search to find the matching opening delimiter. If the match -is not found in that distance, scanning stops, and nothing is displayed. -This is to prevent the scan for the matching delimiter from wasting -lots of time when there is no match. The default is 25600. - -@cindex Show Paren mode -@cindex highlighting matching parentheses -@findex show-paren-mode - Show Paren mode provides a more powerful kind of automatic matching. -Whenever point is after a closing delimiter, that delimiter and its -matching opening delimiter are both highlighted; otherwise, if point -is before an opening delimiter, the matching closing delimiter is -highlighted. (There is no need to highlight the opening delimiter in -that case, because the cursor appears on top of that character.) Use -the command @kbd{M-x show-paren-mode} to enable or disable this mode. - - Show Paren mode uses the faces @code{show-paren-match} and -@code{show-paren-mismatch} to highlight parentheses; you can customize -them to control how highlighting looks. @xref{Face Customization}. - -@node Comments -@section Manipulating Comments -@cindex comments - - Because comments are such an important part of programming, Emacs -provides special commands for editing and inserting comments. It can -also do spell checking on comments with Flyspell Prog mode -(@pxref{Spelling}). - -@menu -* Comment Commands:: Inserting, killing, and aligning comments. -* Multi-Line Comments:: Commands for adding and editing multi-line comments. -* Options for Comments::Customizing the comment features. -@end menu - -@node Comment Commands -@subsection Comment Commands -@cindex indentation for comments -@cindex alignment for comments - - The comment commands in this table insert, kill and align comments. -They are described in this section and following sections. - -@table @asis -@item @kbd{M-;} -Insert or realign comment on current line; alternatively, comment or -uncomment the region (@code{comment-dwim}). -@item @kbd{C-u M-;} -Kill comment on current line (@code{comment-kill}). -@item @kbd{C-x ;} -Set comment column (@code{comment-set-column}). -@item @kbd{C-M-j} -@itemx @kbd{M-j} -Like @key{RET} followed by inserting and aligning a comment -(@code{comment-indent-new-line}). @xref{Multi-Line Comments}. -@item @kbd{M-x comment-region} -@itemx @kbd{C-c C-c} (in C-like modes) -Add or remove comment delimiters on all the lines in the region. -@end table - -@kindex M-; -@findex comment-dwim - The command to create or align a comment is @kbd{M-;} -(@code{comment-dwim}). The word ``dwim'' is an acronym for ``Do What -I Mean''; it indicates that this command can be used for many -different jobs relating to comments, depending on the situation where -you use it. - - If there is no comment already on the line, @kbd{M-;} inserts a new -comment, aligned at a specific column called the @dfn{comment column}. -The new comment begins with the string Emacs thinks comments should -start with (the value of @code{comment-start}; see below). Point is -after that string, so you can insert the text of the comment right -away. If the major mode has specified a string to terminate comments, -@kbd{M-;} inserts that after point, to keep the syntax valid. - - If the text of the line extends past the comment column, this -command aligns the comment start string to a suitable boundary -(usually, at least one space is inserted). - - You can also use @kbd{M-;} to align an existing comment. If a line -already contains the comment-start string, @kbd{M-;} realigns it to -the conventional alignment and moves point after it. (Exception: -comments starting in column 0 are not moved.) Even when an existing -comment is properly aligned, @kbd{M-;} is still useful for moving -directly to the start of the text inside the comment. - -@findex comment-kill -@kindex C-u M-; - @kbd{C-u M-;} kills any comment on the current line, along with the -whitespace before it. To reinsert the comment on another line, move -to the end of that line, do @kbd{C-y}, and then do @kbd{M-;} to -realign it. - - Note that @kbd{C-u M-;} is not a distinct key; it is @kbd{M-;} -(@code{comment-dwim}) with a prefix argument. That command is -programmed so that when it receives a prefix argument it calls -@code{comment-kill}. However, @code{comment-kill} is a valid command -in its own right, and you can bind it directly to a key if you wish. - - @kbd{M-;} does two other jobs when used with an active region in -Transient Mark mode (@pxref{Transient Mark}). Then it either adds or -removes comment delimiters on each line of the region. (If every line -is a comment, it removes comment delimiters from each; otherwise, it -adds comment delimiters to each.) If you are not using Transient Mark -mode, then you should use the commands @code{comment-region} and -@code{uncomment-region} to do these jobs (@pxref{Multi-Line Comments}), -or else enable Transient Mark mode momentarily (@pxref{Momentary Mark}). -A prefix argument used in these circumstances specifies how many -comment delimiters to add or how many to delete. - - Some major modes have special rules for aligning certain kinds of -comments in certain contexts. For example, in Lisp code, comments which -start with two semicolons are indented as if they were lines of code, -instead of at the comment column. Comments which start with three -semicolons are supposed to start at the left margin and are often used -for sectioning purposes. Emacs understands -these conventions by indenting a double-semicolon comment using @key{TAB}, -and by not changing the indentation of a triple-semicolon comment at all. - -@example -;; This function is just an example. -;;; Here either two or three semicolons are appropriate. -(defun foo (x) -;;; And now, the first part of the function: - ;; The following line adds one. - (1+ x)) ; This line adds one. -@end example - - For C-like modes, you can configure the exact effect of @kbd{M-;} -more flexibly than for most buffers by setting the variables -@code{c-indent-comment-alist} and -@code{c-indent-comments-syntactically-p}. For example, on a line -ending in a closing brace, @kbd{M-;} puts the comment one space after -the brace rather than at @code{comment-column}. For full details see -@ref{Comment Commands,,, ccmode, The CC Mode Manual}. - -@node Multi-Line Comments -@subsection Multiple Lines of Comments - -@kindex C-M-j -@kindex M-j -@cindex blank lines in programs -@findex comment-indent-new-line - - If you are typing a comment and wish to continue it on another line, -you can use the command @kbd{C-M-j} or @kbd{M-j} -(@code{comment-indent-new-line}). If @code{comment-multi-line} -(@pxref{Options for Comments}) is non-@code{nil}, it moves to a new -line within the comment. Otherwise it closes the comment and starts a -new comment on a new line. When Auto Fill mode is on, going past the -fill column while typing a comment causes the comment to be continued -in just this fashion. - -@kindex C-c C-c (C mode) -@findex comment-region - To turn existing lines into comment lines, use the @kbd{M-x -comment-region} command (or type @kbd{C-c C-c} in C-like modes). It -adds comment delimiters to the lines that start in the region, thus -commenting them out. With a negative argument, it does the -opposite---it deletes comment delimiters from the lines in the region. - - With a positive argument, @code{comment-region} duplicates the last -character of the comment start sequence it adds; the argument -specifies how many copies of the character to insert. Thus, in Lisp -mode, @kbd{C-u 2 M-x comment-region} adds @samp{;;} to each line. -Duplicating the comment delimiter is a way of calling attention to the -comment. It can also affect how the comment is aligned or indented. -In Lisp, for proper indentation, you should use an argument of two or -three, if between defuns; if within a defun, it must be three. - - You can configure C Mode such that when you type a @samp{/} at the -start of a line in a multi-line block comment, this closes the -comment. Enable the @code{comment-close-slash} clean-up for this. -@xref{Clean-ups,,, ccmode, The CC Mode Manual}. - -@node Options for Comments -@subsection Options Controlling Comments - -@vindex comment-column -@kindex C-x ; -@findex comment-set-column - The @dfn{comment column}, the column at which Emacs tries to place -comments, is stored in the variable @code{comment-column}. You can -set it to a number explicitly. Alternatively, the command @kbd{C-x ;} -(@code{comment-set-column}) sets the comment column to the column -point is at. @kbd{C-u C-x ;} sets the comment column to match the -last comment before point in the buffer, and then does a @kbd{M-;} to -align the current line's comment under the previous one. - - The variable @code{comment-column} is per-buffer: setting the variable -in the normal fashion affects only the current buffer, but there is a -default value which you can change with @code{setq-default}. -@xref{Locals}. Many major modes initialize this variable for the -current buffer. - -@vindex comment-start-skip - The comment commands recognize comments based on the regular -expression that is the value of the variable @code{comment-start-skip}. -Make sure this regexp does not match the null string. It may match more -than the comment starting delimiter in the strictest sense of the word; -for example, in C mode the value of the variable is -@c This stops M-q from breaking the line inside that @code. -@code{@w{"/\\*+ *\\|//+ *"}}, which matches extra stars and spaces -after the @samp{/*} itself, and accepts C++ style comments also. -(Note that @samp{\\} is needed in Lisp syntax to include a @samp{\} in -the string, which is needed to deny the first star its special meaning -in regexp syntax. @xref{Regexp Backslash}.) - -@vindex comment-start -@vindex comment-end - When a comment command makes a new comment, it inserts the value of -@code{comment-start} to begin it. The value of @code{comment-end} is -inserted after point, so that it will follow the text that you will -insert into the comment. When @code{comment-end} is non-empty, it -should start with a space. For example, in C mode, -@code{comment-start} has the value @w{@code{"/* "}} and -@code{comment-end} has the value @w{@code{" */"}}. - -@vindex comment-padding - The variable @code{comment-padding} specifies how many spaces -@code{comment-region} should insert on each line between the comment -delimiter and the line's original text. The default is 1, to insert -one space. @code{nil} means 0. Alternatively, @code{comment-padding} -can hold the actual string to insert. - -@vindex comment-multi-line - The variable @code{comment-multi-line} controls how @kbd{C-M-j} -(@code{indent-new-comment-line}) behaves when used inside a comment. -Specifically, when @code{comment-multi-line} is @code{nil}, the -command inserts a comment terminator, begins a new line, and finally -inserts a comment starter. Otherwise it does not insert the -terminator and starter, so it effectively continues the current -comment across multiple lines. In languages that allow multi-line -comments, the choice of value for this variable is a matter of taste. -The default for this variable depends on the major mode. - -@vindex comment-indent-function - The variable @code{comment-indent-function} should contain a function -that will be called to compute the alignment for a newly inserted -comment or for aligning an existing comment. It is set differently by -various major modes. The function is called with no arguments, but with -point at the beginning of the comment, or at the end of a line if a new -comment is to be inserted. It should return the column in which the -comment ought to start. For example, in Lisp mode, the indent hook -function bases its decision on how many semicolons begin an existing -comment, and on the code in the preceding lines. - -@node Documentation -@section Documentation Lookup - - Emacs provides several features you can use to look up the -documentation of functions, variables and commands that you plan to -use in your program. - -@menu -* Info Lookup:: Looking up library functions and commands - in Info files. -* Man Page:: Looking up man pages of library functions and commands. -* Lisp Doc:: Looking up Emacs Lisp functions, etc. -@end menu - -@node Info Lookup -@subsection Info Documentation Lookup - -@findex info-lookup-symbol -@findex info-lookup-file -@kindex C-h S - For many major modes, that apply to languages that have -documentation in Info, you can use @kbd{C-h S} -(@code{info-lookup-symbol}) to view the Info documentation for a -symbol used in the program. You specify the symbol with the -minibuffer; the default is the symbol appearing in the buffer at -point. For example, in C mode this looks for the symbol in the C -Library Manual. The command only works if the appropriate manual's -Info files are installed. - - The major mode determines where to look for documentation for the -symbol---which Info files to look in, and which indices to search. -You can also use @kbd{M-x info-lookup-file} to look for documentation -for a file name. - - If you use @kbd{C-h S} in a major mode that does not support it, -it asks you to specify the ``symbol help mode.'' You should enter -a command such as @code{c-mode} that would select a major -mode which @kbd{C-h S} does support. - -@node Man Page -@subsection Man Page Lookup - -@cindex manual page - On Unix, the main form of on-line documentation was the @dfn{manual -page} or @dfn{man page}. In the GNU operating system, we aim to -replace man pages with better-organized manuals that you can browse -with Info (@pxref{Misc Help}). This process is not finished, so it is -still useful to read manual pages. - -@findex manual-entry - You can read the man page for an operating system command, library -function, or system call, with the @kbd{M-x man} command. It -runs the @code{man} program to format the man page; if the system -permits, it runs @code{man} asynchronously, so that you can keep on -editing while the page is being formatted. (On MS-DOS and MS-Windows -3, you cannot edit while Emacs waits for @code{man} to finish.) The -result goes in a buffer named @samp{*Man @var{topic}*}. These buffers -use a special major mode, Man mode, that facilitates scrolling and -jumping to other manual pages. For details, type @kbd{C-h m} while in -a man page buffer. - -@cindex sections of manual pages - Each man page belongs to one of ten or more @dfn{sections}, each -named by a digit or by a digit and a letter. Sometimes there are -multiple man pages with the same name in different sections. To read -a man page from a specific section, type -@samp{@var{topic}(@var{section})} or @samp{@var{section} @var{topic}} -when @kbd{M-x manual-entry} prompts for the topic. For example, to -read the man page for the C library function @code{chmod} (as opposed -to a command of the same name), type @kbd{M-x manual-entry @key{RET} -chmod(2) @key{RET}}. (@code{chmod} is a system call, so it is in -section @samp{2}.) - -@vindex Man-switches - If you do not specify a section, the results depend on how the -@code{man} program works on your system. Some of them display only -the first man page they find. Others display all man pages that have -the specified name, so you can move between them with the @kbd{M-n} -and @kbd{M-p} keys@footnote{On some systems, the @code{man} program -accepts a @samp{-a} command-line option which tells it to display all -the man pages for the specified topic. If you want this behavior, you -can add this option to the value of the variable @code{Man-switches}.}. -The mode line shows how many manual pages are present in the Man buffer. - -@vindex Man-fontify-manpage-flag - By default, Emacs highlights the text in man pages. For a long man -page, highlighting can take substantial time. You can turn off -highlighting of man pages by setting the variable -@code{Man-fontify-manpage-flag} to @code{nil}. - -@findex Man-fontify-manpage - If you insert the text of a man page into an Emacs buffer in some -other fashion, you can use the command @kbd{M-x Man-fontify-manpage} to -perform the same conversions that @kbd{M-x manual-entry} does. - -@findex woman -@cindex manual pages, on MS-DOS/MS-Windows - An alternative way of reading manual pages is the @kbd{M-x woman} -command@footnote{The name of the command, @code{woman}, is an acronym -for ``w/o (without) man,'' since it doesn't use the @code{man} -program.}. Unlike @kbd{M-x man}, it does not run any external -programs to format and display the man pages; instead it does the job -in Emacs Lisp, so it works on systems such as MS-Windows, where the -@code{man} program (and other programs it uses) are not generally -available. - - @kbd{M-x woman} prompts for a name of a manual page, and provides -completion based on the list of manual pages that are installed on -your machine; the list of available manual pages is computed -automatically the first time you invoke @code{woman}. The word at -point in the current buffer is used to suggest the default for the -name the manual page. - - With a numeric argument, @kbd{M-x woman} recomputes the list of the -manual pages used for completion. This is useful if you add or delete -manual pages. - - If you type a name of a manual page and @kbd{M-x woman} finds that -several manual pages by the same name exist in different sections, it -pops up a window with possible candidates asking you to choose one of -them. - - For more information about setting up and using @kbd{M-x woman}, see -@ref{Top, WoMan, Browse UN*X Manual Pages WithOut Man, woman, The WoMan -Manual}. - -@node Lisp Doc -@subsection Emacs Lisp Documentation Lookup - - As you edit Lisp code to be run in Emacs, you can use the commands -@kbd{C-h f} (@code{describe-function}) and @kbd{C-h v} -(@code{describe-variable}) to view documentation of functions and -variables that you want to use. These commands use the minibuffer to -read the name of a function or variable to document, and display the -documentation in a window. Their default arguments are based on the -code in the neighborhood of point. For @kbd{C-h f}, the default is -the function called in the innermost list containing point. @kbd{C-h -v} uses the symbol name around or adjacent to point as its default. - -@cindex Eldoc mode -@findex eldoc-mode - A more automatic but less powerful method is Eldoc mode. This minor -mode constantly displays in the echo area the argument list for the -function being called at point. (In other words, it finds the -function call that point is contained in, and displays the argument -list of that function.) If point is over a documented variable, it -shows the first line of the variable's docstring. Eldoc mode applies -in Emacs Lisp and Lisp Interaction modes, and perhaps a few others -that provide special support for looking up doc strings. Use the -command @kbd{M-x eldoc-mode} to enable or disable this feature. - -@node Hideshow -@section Hideshow minor mode - -@findex hs-minor-mode - Hideshow minor mode provides selective display of portions of a -program, known as @dfn{blocks}. You can use @kbd{M-x hs-minor-mode} -to enable or disable this mode, or add @code{hs-minor-mode} to the -mode hook for certain major modes in order to enable it automatically -for those modes. - - Just what constitutes a block depends on the major mode. In C mode -or C++ mode, they are delimited by braces, while in Lisp mode and -similar modes they are delimited by parentheses. Multi-line comments -also count as blocks. - -@findex hs-hide-all -@findex hs-hide-block -@findex hs-show-all -@findex hs-show-block -@findex hs-show-region -@findex hs-hide-level -@findex hs-minor-mode -@kindex C-c @@ C-h -@kindex C-c @@ C-s -@kindex C-c @@ C-M-h -@kindex C-c @@ C-M-s -@kindex C-c @@ C-r -@kindex C-c @@ C-l -@kindex S-Mouse-2 -@table @kbd -@item C-c @@ C-h -Hide the current block (@code{hs-hide-block}). -@item C-c @@ C-s -Show the current block (@code{hs-show-block}). -@item C-c @@ C-c -Either hide or show the current block (@code{hs-toggle-hiding}). -@item S-Mouse-2 -Either hide or show the block you click on (@code{hs-mouse-toggle-hiding}). -@item C-c @@ C-M-h -Hide all top-level blocks (@code{hs-hide-all}). -@item C-c @@ C-M-s -Show everything in the buffer (@code{hs-show-all}). -@item C-c @@ C-l -Hide all blocks @var{n} levels below this block -(@code{hs-hide-level}). -@end table - -@vindex hs-hide-comments-when-hiding-all -@vindex hs-isearch-open -@vindex hs-special-modes-alist - These variables exist for customizing Hideshow mode. - -@table @code -@item hs-hide-comments-when-hiding-all -Non-@code{nil} says that @kbd{hs-hide-all} should hide comments too. - -@item hs-isearch-open -Specifies what kind of hidden blocks incremental search should make -visible. The value should be one of these four symbols: - -@table @code -@item code -Open only code blocks. -@item comment -Open only comments. -@item t -Open both code blocks and comments. -@item nil -Open neither code blocks nor comments. -@end table - -@item hs-special-modes-alist -A list of elements, each specifying how to initialize Hideshow -variables for one major mode. See the variable's documentation string -for more information. -@end table - -@node Symbol Completion -@section Completion for Symbol Names -@cindex completion (symbol names) - - In Emacs, completion is something you normally do in the minibuffer. -But one kind of completion is available in all buffers: completion for -symbol names. - -@kindex M-TAB - The character @kbd{M-@key{TAB}} runs a command to complete the -partial symbol before point against the set of meaningful symbol -names. This command inserts at point any additional characters that -it can determine from the partial name. - - If your window manager defines @kbd{M-@key{TAB}} to switch windows, -you can type @kbd{@key{ESC} @key{TAB}} or @kbd{C-M-i} instead. -However, most window managers let you customize these shortcuts, and -we recommend that you change any that get in the way of use of Emacs. - - If the partial name in the buffer has multiple possible completions -that differ in the very next character, so that it is impossible to -complete even one more character, @kbd{M-@key{TAB}} displays a list of -all possible completions in another window. - -@cindex tags-based completion -@cindex Info index completion -@findex complete-symbol - In most programming language major modes, @kbd{M-@key{TAB}} runs the -command @code{complete-symbol}, which provides two kinds of completion. -Normally it does completion based on a tags table (@pxref{Tags}); with a -numeric argument (regardless of the value), it does completion based on -the names listed in the Info file indexes for your language. Thus, to -complete the name of a symbol defined in your own program, use -@kbd{M-@key{TAB}} with no argument; to complete the name of a standard -library function, use @kbd{C-u M-@key{TAB}}. Of course, Info-based -completion works only if there is an Info file for the standard library -functions of your language, and only if it is installed at your site. - -@cindex Lisp symbol completion -@cindex completion (Lisp symbols) -@findex lisp-complete-symbol - In Emacs-Lisp mode, the name space for completion normally consists of -nontrivial symbols present in Emacs---those that have function -definitions, values or properties. However, if there is an -open-parenthesis immediately before the beginning of the partial symbol, -only symbols with function definitions are considered as completions. -The command which implements this is @code{lisp-complete-symbol}. - - In Text mode and related modes, @kbd{M-@key{TAB}} completes words -based on the spell-checker's dictionary. @xref{Spelling}. - -@node Glasses -@section Glasses minor mode -@cindex Glasses mode -@cindex identifiers, making long ones readable -@cindex StudlyCaps, making them readable -@findex glasses-mode - - Glasses minor mode makes @samp{unreadableIdentifiersLikeThis} -readable by altering the way they display. It knows two different -ways to do this: by displaying underscores between a lower-case letter -and the following capital letter, and by emboldening the capital -letters. It does not alter the buffer text, only the way they -display, so you can use it even on read-only buffers. You can use the -command @kbd{M-x glasses-mode} to enable or disable the mode in the -current buffer; you can also add @code{glasses-mode} to the mode hook -of the programming language major modes in which you normally want -to use Glasses mode. - -@node Misc for Programs -@section Other Features Useful for Editing Programs - - A number of Emacs commands that aren't designed specifically for -editing programs are useful for that nonetheless. - - The Emacs commands that operate on words, sentences and paragraphs -are useful for editing code. Most symbols names contain words -(@pxref{Words}); sentences can be found in strings and comments -(@pxref{Sentences}). Paragraphs in the strict sense can be found in -program code (in long comments), but the paragraph commands are useful -in other places too, because programming language major modes define -paragraphs to begin and end at blank lines (@pxref{Paragraphs}). -Judicious use of blank lines to make the program clearer will also -provide useful chunks of text for the paragraph commands to work on. -Auto Fill mode, if enabled in a programming language major mode, -indents the new lines which it creates. - - The selective display feature is useful for looking at the overall -structure of a function (@pxref{Selective Display}). This feature -hides the lines that are indented more than a specified amount. -Programming modes often support Outline minor mode (@pxref{Outline -Mode}). The Foldout package provides folding-editor features -(@pxref{Foldout}). - - The ``automatic typing'' features may be useful for writing programs. -@xref{Top,,Autotyping, autotype, Autotyping}. - -@node C Modes -@section C and Related Modes -@cindex C mode -@cindex Java mode -@cindex Pike mode -@cindex IDL mode -@cindex CORBA IDL mode -@cindex Objective C mode -@cindex C++ mode -@cindex AWK mode -@cindex mode, Java -@cindex mode, C -@cindex mode, C++ -@cindex mode, Objective C -@cindex mode, CORBA IDL -@cindex mode, Pike -@cindex mode, AWK - - This section gives a brief description of the special features -available in C, C++, Objective-C, Java, CORBA IDL, Pike and AWK modes. -(These are called ``C mode and related modes.'') @xref{Top, , CC Mode, -ccmode, CC Mode}, for a more extensive description of these modes -and their special features. - -@menu -* Motion in C:: Commands to move by C statements, etc. -* Electric C:: Colon and other chars can automatically reindent. -* Hungry Delete:: A more powerful DEL command. -* Other C Commands:: Filling comments, viewing expansion of macros, - and other neat features. -@end menu - -@node Motion in C -@subsection C Mode Motion Commands - - This section describes commands for moving point, in C mode and -related modes. - -@table @code -@item M-x c-beginning-of-defun -@itemx M-x c-end-of-defun -@findex c-beginning-of-defun -@findex c-end-of-defun -Move point to the beginning or end of the current function or -top-level definition. These are found by searching for the least -enclosing braces. (By contrast, @code{beginning-of-defun} and -@code{end-of-defun} search for braces in column zero.) If you are -editing code where the opening brace of a function isn't placed in -column zero, you may wish to bind @code{C-M-a} and @code{C-M-e} to -these commands. @xref{Moving by Defuns}. - -@item C-c C-u -@kindex C-c C-u @r{(C mode)} -@findex c-up-conditional -Move point back to the containing preprocessor conditional, leaving the -mark behind. A prefix argument acts as a repeat count. With a negative -argument, move point forward to the end of the containing -preprocessor conditional. - -@samp{#elif} is equivalent to @samp{#else} followed by @samp{#if}, so -the function will stop at a @samp{#elif} when going backward, but not -when going forward. - -@item C-c C-p -@kindex C-c C-p @r{(C mode)} -@findex c-backward-conditional -Move point back over a preprocessor conditional, leaving the mark -behind. A prefix argument acts as a repeat count. With a negative -argument, move forward. - -@item C-c C-n -@kindex C-c C-n @r{(C mode)} -@findex c-forward-conditional -Move point forward across a preprocessor conditional, leaving the mark -behind. A prefix argument acts as a repeat count. With a negative -argument, move backward. - -@item M-a -@kindex M-a (C mode) -@findex c-beginning-of-statement -Move point to the beginning of the innermost C statement -(@code{c-beginning-of-statement}). If point is already at the beginning -of a statement, move to the beginning of the preceding statement. With -prefix argument @var{n}, move back @var{n} @minus{} 1 statements. - -In comments or in strings which span more than one line, this command -moves by sentences instead of statements. - -@item M-e -@kindex M-e (C mode) -@findex c-end-of-statement -Move point to the end of the innermost C statement or sentence; like -@kbd{M-a} except that it moves in the other direction -(@code{c-end-of-statement}). -@end table - -@node Electric C -@subsection Electric C Characters - - In C mode and related modes, certain printing characters are -@dfn{electric}---in addition to inserting themselves, they also -reindent the current line, and optionally also insert newlines. The -``electric'' characters are @kbd{@{}, @kbd{@}}, @kbd{:}, @kbd{#}, -@kbd{;}, @kbd{,}, @kbd{<}, @kbd{>}, @kbd{/}, @kbd{*}, @kbd{(}, and -@kbd{)}. - - You might find electric indentation inconvenient if you are editing -chaotically indented code. If you are new to CC Mode, you might find -it disconcerting. You can toggle electric action with the command -@kbd{C-c C-l}; when it is enabled, @samp{/l} appears in the mode line -after the mode name: - -@table @kbd -@item C-c C-l -@kindex C-c C-l @r{(C mode)} -@findex c-toggle-electric-state -Toggle electric action (@code{c-toggle-electric-state}). With a -prefix argument, this command enables electric action if the argument -is positive, disables it if it is negative. -@end table - - Electric characters insert newlines only when, in addition to the -electric state, the @dfn{auto-newline} feature is enabled (indicated -by @samp{/la} in the mode line after the mode name). You can turn -this feature on or off with the command @kbd{C-c C-a}: - -@table @kbd -@item C-c C-a -@kindex C-c C-a @r{(C mode)} -@findex c-toggle-auto-newline -Toggle the auto-newline feature (@code{c-toggle-auto-newline}). With a -prefix argument, this command turns the auto-newline feature on if the -argument is positive, and off if it is negative. -@end table - - Usually the CC Mode style configures the exact circumstances in -which Emacs inserts auto-newlines. You can also configure this -directly. @xref{Custom Auto-newlines,,, ccmode, The CC Mode Manual}. - -@node Hungry Delete -@subsection Hungry Delete Feature in C -@cindex hungry deletion (C Mode) - - If you want to delete an entire block of whitespace at point, you -can use @dfn{hungry deletion}. This deletes all the contiguous -whitespace either before point or after point in a single operation. -@dfn{Whitespace} here includes tabs and newlines, but not comments or -preprocessor commands. - -@table @kbd -@item C-c C-@key{DEL} -@itemx C-c @key{DEL} -@findex c-hungry-delete-backwards -@kindex C-c C-@key{DEL} (C Mode) -@kindex C-c @key{DEL} (C Mode) -@code{c-hungry-delete-backwards}---Delete the entire block of whitespace -preceding point. - -@item C-c C-d -@itemx C-c C-@key{DELETE} -@itemx C-c @key{DELETE} -@findex c-hungry-delete-forward -@kindex C-c C-d (C Mode) -@kindex C-c C-@key{DELETE} (C Mode) -@kindex C-c @key{DELETE} (C Mode) -@code{c-hungry-delete-forward}---Delete the entire block of whitespace -following point. -@end table - - As an alternative to the above commands, you can enable @dfn{hungry -delete mode}. When this feature is enabled (indicated by @samp{/h} in -the mode line after the mode name), a single @key{DEL} deletes all -preceding whitespace, not just one space, and a single @kbd{C-c C-d} -(but @emph{not} plain @key{DELETE}) deletes all following whitespace. - -@table @kbd -@item M-x c-toggle-hungry-state -@findex c-toggle-hungry-state -Toggle the hungry-delete feature -(@code{c-toggle-hungry-state})@footnote{This command had the binding -@kbd{C-c C-d} in earlier versions of Emacs. @kbd{C-c C-d} is now -bound to @code{c-hungry-delete-forward}.}. With a prefix argument, -this command turns the hungry-delete feature on if the argument is -positive, and off if it is negative. -@end table - -@vindex c-hungry-delete-key - The variable @code{c-hungry-delete-key} controls whether the -hungry-delete feature is enabled. - -@node Other C Commands -@subsection Other Commands for C Mode - -@table @kbd -@item C-c C-w -@itemx M-x c-subword-mode -@findex c-subword-mode -Enable (or disable) @dfn{subword mode}. In subword mode, Emacs's word -commands recognize upper case letters in -@samp{StudlyCapsIdentifiers} as word boundaries. This is indicated by -the flag @samp{/w} on the mode line after the mode name -(e.g. @samp{C/law}). You can even use @kbd{M-x c-subword-mode} in -non-CC Mode buffers. - -In the GNU project, we recommend using underscores to separate words -within an identifier in C or C++, rather than using case distinctions. - -@item M-x c-context-line-break -@findex c-context-line-break -This command inserts a line break and indents the new line in a manner -appropriate to the context. In normal code, it does the work of -@kbd{C-j} (@code{newline-and-indent}), in a C preprocessor line it -additionally inserts a @samp{\} at the line break, and within comments -it's like @kbd{M-j} (@code{c-indent-new-comment-line}). - -@code{c-context-line-break} isn't bound to a key by default, but it -needs a binding to be useful. The following code will bind it to -@kbd{C-j}. We use @code{c-initialization-hook} here to make sure -the keymap is loaded before we try to change it. - -@smallexample -(defun my-bind-clb () - (define-key c-mode-base-map "\C-j" 'c-context-line-break)) -(add-hook 'c-initialization-hook 'my-bind-clb) -@end smallexample - -@item C-M-h -Put mark at the end of a function definition, and put point at the -beginning (@code{c-mark-function}). - -@item M-q -@kindex M-q @r{(C mode)} -@findex c-fill-paragraph -Fill a paragraph, handling C and C++ comments (@code{c-fill-paragraph}). -If any part of the current line is a comment or within a comment, this -command fills the comment or the paragraph of it that point is in, -preserving the comment indentation and comment delimiters. - -@item C-c C-e -@cindex macro expansion in C -@cindex expansion of C macros -@findex c-macro-expand -@kindex C-c C-e @r{(C mode)} -Run the C preprocessor on the text in the region, and show the result, -which includes the expansion of all the macro calls -(@code{c-macro-expand}). The buffer text before the region is also -included in preprocessing, for the sake of macros defined there, but the -output from this part isn't shown. - -When you are debugging C code that uses macros, sometimes it is hard to -figure out precisely how the macros expand. With this command, you -don't have to figure it out; you can see the expansions. - -@item C-c C-\ -@findex c-backslash-region -@kindex C-c C-\ @r{(C mode)} -Insert or align @samp{\} characters at the ends of the lines of the -region (@code{c-backslash-region}). This is useful after writing or -editing a C macro definition. - -If a line already ends in @samp{\}, this command adjusts the amount of -whitespace before it. Otherwise, it inserts a new @samp{\}. However, -the last line in the region is treated specially; no @samp{\} is -inserted on that line, and any @samp{\} there is deleted. - -@item M-x cpp-highlight-buffer -@cindex preprocessor highlighting -@findex cpp-highlight-buffer -Highlight parts of the text according to its preprocessor conditionals. -This command displays another buffer named @samp{*CPP Edit*}, which -serves as a graphic menu for selecting how to display particular kinds -of conditionals and their contents. After changing various settings, -click on @samp{[A]pply these settings} (or go to that buffer and type -@kbd{a}) to rehighlight the C mode buffer accordingly. - -@item C-c C-s -@findex c-show-syntactic-information -@kindex C-c C-s @r{(C mode)} -Display the syntactic information about the current source line -(@code{c-show-syntactic-information}). This information directs how -the line is indented. - -@item M-x cwarn-mode -@itemx M-x global-cwarn-mode -@findex cwarn-mode -@findex global-cwarn-mode -@vindex global-cwarn-mode -@cindex CWarn mode -@cindex suspicious constructions in C, C++ -CWarn minor mode highlights certain suspicious C and C++ constructions: - -@itemize @bullet{} -@item -Assignments inside expressions. -@item -Semicolon following immediately after @samp{if}, @samp{for}, and @samp{while} -(except after a @samp{do @dots{} while} statement); -@item -C++ functions with reference parameters. -@end itemize - -@noindent -You can enable the mode for one buffer with the command @kbd{M-x -cwarn-mode}, or for all suitable buffers with the command @kbd{M-x -global-cwarn-mode} or by customizing the variable -@code{global-cwarn-mode}. You must also enable Font Lock mode to make -it work. - -@item M-x hide-ifdef-mode -@findex hide-ifdef-mode -@cindex Hide-ifdef mode -Hide-ifdef minor mode hides selected code within @samp{#if} and -@samp{#ifdef} preprocessor blocks. See the documentation string of -@code{hide-ifdef-mode} for more information. - -@item M-x ff-find-related-file -@cindex related files -@findex ff-find-related-file -@vindex ff-related-file-alist -Find a file ``related'' in a special way to the file visited by the -current buffer. Typically this will be the header file corresponding -to a C/C++ source file, or vice versa. The variable -@code{ff-related-file-alist} specifies how to compute related file -names. -@end table - -@node Asm Mode -@section Asm Mode - -@cindex Asm mode -@cindex assembler mode -Asm mode is a major mode for editing files of assembler code. It -defines these commands: - -@table @kbd -@item @key{TAB} -@code{tab-to-tab-stop}. -@item C-j -Insert a newline and then indent using @code{tab-to-tab-stop}. -@item : -Insert a colon and then remove the indentation from before the label -preceding colon. Then do @code{tab-to-tab-stop}. -@item ; -Insert or align a comment. -@end table - - The variable @code{asm-comment-char} specifies which character -starts comments in assembler syntax. - -@ifnottex -@include fortran-xtra.texi -@end ifnottex - -@ignore - arch-tag: c7ee7409-40a4-45c7-bfb7-ae7f2c74d0c0 -@end ignore diff --git a/man/sc.texi b/man/sc.texi deleted file mode 100644 index 5ac3b882ccd..00000000000 --- a/man/sc.texi +++ /dev/null @@ -1,2533 +0,0 @@ -\input texinfo @comment -*-texinfo-*- -@comment 3.48 -@comment %**start of header (This is for running Texinfo on a region.) -@setfilename ../info/sc -@settitle Supercite Version 3.1 User's Manual -@iftex -@finalout -@end iftex - -@c @setchapternewpage odd % For book style double sided manual. -@comment %**end of header (This is for running Texinfo on a region.) - -@copying -This document describes the Supercite Version 3.1 package for citing and -attributing the replies for various GNU Emacs mail and news reading -subsystems. - -Copyright @copyright{} 1993, 2001, 2002, 2003, 2004, -2005, 2006, 2007 Free Software Foundation, Inc. - -@quotation -Permission is granted to copy, distribute and/or modify this document -under the terms of the GNU Free Documentation License, Version 1.2 or -any later version published by the Free Software Foundation; with no -Invariant Sections, with the Front-Cover texts being ``A GNU -Manual'', and with the Back-Cover Texts as in (a) below. A copy of the -license is included in the section entitled ``GNU Free Documentation -License'' in the Emacs manual. - -(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify -this GNU Manual, like GNU software. Copies published by the Free -Software Foundation raise funds for GNU development.'' - -This document is part of a collection distributed under the GNU Free -Documentation License. If you want to distribute this document -separately from the collection, you can do so by adding a copy of the -license to the document, as described in section 6 of the license. -@end quotation -@end copying - -@c @smallbook - -@dircategory Emacs -@direntry -* SC: (sc). Supercite lets you cite parts of messages you're - replying to, in flexible ways. -@end direntry - -@titlepage -@sp 6 -@center @titlefont{Supercite User's Manual} -@sp 2 -@center @titlefont{Supercite Version 3.1} -@sp 4 -@center Manual Revision: 3.48 -@center April 2007 -@sp 5 -@center Barry A@. Warsaw -@center @t{bwarsaw@@cen.com} -@center @t{@dots{}!uunet!cen.com!bwarsaw} -@page -@vskip 0pt plus 1filll -@insertcopying -@end titlepage - -@ifnottex -@node Top, Introduction, (dir), (dir) -@comment node-name, next, previous, up - -This document describes the Supercite Version 3.1 package for citing and -attributing the replies for various GNU Emacs mail and news reading -subsystems. The manual is divided into the following chapters. - -@menu -* Introduction:: -* Citations:: -* Getting Connected:: -* Replying and Yanking:: -* Selecting an Attribution:: -* Configuring the Citation Engine:: -* Post-yank Formatting Commands:: -* Information Keys and the Info Alist:: -* Reference Headers:: -* Hints to MUA Authors:: -* Version 3 Changes:: -* Thanks and History:: -* The Supercite Mailing List:: - -* GNU Free Documentation License:: -* Concept Index:: -* Command Index:: -* Key Index:: -* Variable Index:: -@end menu -@end ifnottex - - -@node Introduction, Usage Overview, Top, Top -@comment node-name, next, previous, up -@chapter Introduction -@ifinfo - -@end ifinfo -Supercite version 3.1 is a GNU Emacs package written entirely in Emacs -Lisp. It interfaces to most of the commonly used Emacs mail user agents -(@dfn{MUAs}) and news user agents (@dfn{NUAs}), and provides -sophisticated facilities for the citing and attributing of message -replies. Supercite has a very specific and limited role in the process -of composing replies to both USENET network news and electronic mail. - -The preferred way to spell Supercite is with a capital @samp{S}, -lowercase @samp{upercite}. There are a few alternate spellings out there -and I won't be terribly offended if you use them. People often ask -though@dots{} - -@ifinfo -@menu -* Usage Overview:: -* What Supercite Does Not Do:: -* What Supercite Does:: -@end menu -@end ifinfo - -@cindex MUA -@cindex NUA -Supercite is only useful in conjunction with MUAs and NUAs such as VM, -GNUS, RMAIL, etc@. (hereafter referred to collectively as MUAs). -Supercite is typically called by the MUA after a reply buffer has been -setup. Thereafter, Supercite's many commands and formatting styles are -available in that reply buffer until the reply is sent. Supercite is -re-initialized in each new reply buffer. - -Supercite is currently at major revision 3.1, and is known to work in the -following environments: - -@table @asis -@item Emacs versions: - GNU Emacs 18.57 through 18.59, all Emacs 19, - all current Lucid Emacs, and Epoch 4.@refill - -@item MUAs: - VM 4.37 and beyond (including VM version 5), RMAIL, MH-E 3.7 and - beyond, PCMAIL.@refill - -@item NUAs: - RNEWS, GNUS 3.12 and beyond, GNEWS.@refill - -@end table -For systems with version numbers, all known subsequent versions also -work with Supercite. For those systems without version numbers, -Supercite probably works with any recently released version. Note that -only some of these systems will work with Supercite ``out of the box.'' -All others must overload interfacing routines to supply the necessary -glue. @xref{Getting Connected}, for more details.@refill - - -@node Usage Overview, What Supercite Does Not Do, Introduction, Introduction -@comment node-name, next, previous, up -@kindex r -@kindex f -@kindex C-c C-y -@cindex yank -@cindex cite, citing -@cindex attribute, attributing -@comment -@section Usage Overview -@ifinfo - -@end ifinfo -Typical usage is as follows. You want to reply or followup to a message -in your MUA. You will probably hit @kbd{r} (i.e., ``reply'') or @kbd{f} -(i.e., ``forward'') to begin composing the reply. In response, the MUA -will create a reply buffer and initialize the outgoing mail headers -appropriately. The body of the reply will usually be empty at this -point. You now decide that you would like to include part of the -original message in your reply. To do this, you @dfn{yank} the original -message into the reply buffer, typically with a key stroke such as -@kbd{C-c C-y}. This sequence will invoke an MUA-specific function which -fills the body of the reply with the original message and then -@dfn{attributes} this text to its author. This is called @dfn{citing} -and its effect is to prefix every line from the original message with a -special text tag. Most MUAs provide some default style of citing; by -using Supercite you gain a wider flexibility in the look and style of -citations. Supercite's only job is to cite the original message. - -@node What Supercite Does Not Do, What Supercite Does, Usage Overview, Introduction -@comment node-name, next, previous, up -@section What Supercite Doesn't Do -@ifinfo - -@end ifinfo -Because of this clear division of labor, there are useful features which -are the sole responsibility of the MUA, even though it might seem that -Supercite should provide them. For example, many people would like to -be able to yank (and cite) only a portion of the original message. -Since Supercite only modifies the text it finds in the reply buffer as -set up by the MUA, it is the MUA's responsibility to do partial yanking. -@xref{Reply Buffer Initialization}.@refill - -@vindex mail-header-separator -@comment -Another potentially useful thing would be for Supercite to set up the -outgoing mail headers with information it gleans from the reply buffer. -But by previously agreed upon convention, any text above the -@code{mail-header-separator} which separates mail headers from message -bodies cannot be modified by Supercite. Supercite, in fact, doesn't -know anything about the meaning of these headers, and never ventures -outside the designated region. @xref{Hints to MUA Authors}, for more -details.@refill - -@node What Supercite Does, Citations, What Supercite Does Not Do, Introduction -@comment node-name, next, previous, up -@findex sc-cite-original -@section What Supercite Does -@ifinfo - -@end ifinfo -Supercite is invoked for the first time on a reply buffer via your MUA's -reply or forward command. This command will actually perform citations -by calling a hook variable to which Supercite's top-level function -@code{sc-cite-original} has been added. When @code{sc-cite-original} is -executed, the original message must be set up in a very specific way, -but this is handled automatically by the MUA. @xref{Hints to MUA -Authors}.@refill - -@cindex info alist -The first thing Supercite does, via @code{sc-cite-original}, is to parse -through the original message's mail headers. It saves this data in an -@dfn{information association list}, or @dfn{info alist}. The information -in this list is used in a number of places throughout Supercite. -@xref{Information Keys and the Info Alist}.@refill - -@cindex nuking mail headers -@cindex reference header -After the mail header info is extracted, the headers are optionally -removed (@dfn{nuked}) from the reply. Supercite then writes a -@dfn{reference header} into the buffer. This reference header is a -string carrying details about the citation it is about to perform. - -@cindex modeline -Next, Supercite visits each line in the reply, transforming the line -according to a customizable ``script.'' Lines which were not previously -cited in the original message are given a citation, while already cited -lines remain untouched, or are coerced to your preferred style. -Finally, Supercite installs a keymap into the reply buffer so that you -have access to Supercite's post-yank formatting and reciting commands as -you subsequently edit your reply. You can tell that Supercite has been -installed into the reply buffer because that buffer's modeline will -display the minor mode string @samp{SC}. - -@cindex filladapt -@cindex gin-mode -@vindex fill-prefix -@findex fill-paragraph -@comment -When the original message is cited by @code{sc-cite-original}, it will -(optionally) be filled by Supercite. However, if you manually edit the -cited text and want to re-fill it, you must use an add-on package such -as @cite{filladapt} or @cite{gin-mode}. These packages can recognize -Supercited text and will fill them appropriately. Emacs' built-in -filling routines, e.g@. @code{fill-paragraph}, do not recognize cited -text and will not re-fill them properly because it cannot guess the -@code{fill-prefix} being used. -@xref{Post-yank Formatting Commands}, for details.@refill - -As mentioned above, Supercite provides commands to recite or uncite -regions of text in the reply buffer, and commands to perform other -beautifications on the cited original text, maintaining consistent and -informative citations throughout. Supercite tries to be as configurable -as possible to allow for a wide range of personalized citation styles, -but it is also immediately useful with the default configuration, once -it has been properly connected to your MUA. @xref{Getting Connected}, -for more details.@refill - -@node Citations, Citation Elements, What Supercite Does, Top -@comment node-name, next, previous, up -@cindex nested citations -@cindex citation -@comment -@chapter Citations -@ifinfo - -@end ifinfo -A @dfn{citation} is the acknowledgement of the original author of a mail -message in the body of the reply. There are two basic citation styles -which Supercite supports. The first, called @dfn{nested citations} is -an anonymous form of citation; in other words, an indication is made -that the cited line was written by someone @emph{other} that the current -message author (i.e., other than you, the person composing the reply), -but no reference is made as to the identity of the original author. -This style should look familiar since its use on the net is widespread. -Here's an example of what a message buffer would look like using nested -citations after multiple replies: - -@example ->> John originally wrote this ->> and this as well -> Jane said that John didn't know -> what he was talking about -And that's what I think too. -@end example - -@ifinfo -@menu -* Citation Elements:: -* Recognizing Citations:: -@end menu -@end ifinfo - -Note that multiple inclusions of the original messages result in a -nesting of the @samp{@code{>}} characters. This can sometimes be quite -confusing when many levels of citations are included since it may be -difficult or impossible to figure out who actually participated in the -thread, and multiple nesting of @samp{@code{>}} characters can sometimes -make the message very difficult for the eye to scan. - -@cindex non-nested citations -In @dfn{non-nested citations}, each cited line begins with an -informative string attributing that line to the original author. Only -the first level of attribution will be shown; subsequent citations don't -nest the citation strings. The above dialog might look like this when -non-nested citations are used: - -@example -John> John originally wrote this -John> and this as well -Jane> Jane said that John didn't know -Jane> what he was talking about -And that's what I think too. -@end example - -Notice here that my inclusion of Jane's inclusion of John's original -message did not result in a line cited with @samp{Jane>John>}. - -@vindex sc-nested-citation-p -@vindex nested-citation-p (sc-) -Supercite supports both styles of citation, and the variable -@code{sc-nested-citation-p} controls which style it will use when citing -previously uncited text. When this variable is @code{nil} (the default), -non-nested citations are used. When non-@code{nil}, nested citations -are used. - - -@node Citation Elements, Recognizing Citations, Citations, Citations -@comment node-name, next, previous, up -@cindex citation string -@comment -@section Citation Elements -@ifinfo - -@end ifinfo -@dfn{Citation strings} are composed of one or more elements. Non-nested -citations are composed of four elements, three of which are directly -user definable. The elements are concatenated together, in this order: - -@cindex citation leader -@vindex citation-leader (sc-) -@vindex sc-citation-leader -@enumerate -@item -The @dfn{citation leader}. The citation leader is contained in the -variable @code{sc-citation-leader}, and has the default value of a -string containing four spaces. - -@cindex attribution string -@item -The @dfn{attribution string}. This element is supplied automatically by -Supercite, based on your preferences and the original message's mail -headers, though you may be asked to confirm Supercite's choice. -@xref{Selecting an Attribution}, for more details.@refill - -@cindex citation delimiter -@vindex sc-citation-delimiter -@vindex citation-delimiter (sc-) -@item -The @dfn{citation delimiter}. This string, contained in the variable -@code{sc-citation-delimiter} visually separates the citation from the -text of the line. This variable has a default value of @code{">"} and -for best results, the string should consist of only a single character. - -@cindex citation separator -@vindex citation-separator (sc-) -@vindex sc-citation-separator -@item -The @dfn{citation separator}. The citation separator is contained in -the variable @code{sc-citation-separator}, and has the default value of -a string containing a single space. -@end enumerate - -For example, suppose you were using the default values for the above -variables, and Supercite provided the attribution string @samp{Jane}. -In this case, the composed, non-nested citation string used might be -something like -@code{@asis{" Jane> "}}. -This citation string will be inserted in front of -every line in the original message that is not already cited.@refill - -Nested citations, being simpler than non-nested citations, are composed -of the same elements, sans the attribution string. Supercite is smart -enough to not put additional spaces between citation delimiters for -multi-level nested citations. - -@node Recognizing Citations, Getting Connected, Citation Elements, Citations -@comment node-name, next, previous, up -@section Recognizing Citations -@ifinfo - -@end ifinfo -Supercite also recognizes citations in the original article, and can -transform these already cited lines in a number of ways. This is how -Supercite suppresses the multiple citing of non-nested citations. -Recognition of cited lines is controlled by variables analogous to those -that make up the citation string as mentioned previously. - -@vindex sc-citation-leader-regexp -@vindex citation-leader-regexp (sc-) -@vindex sc-citation-delimiter-regexp -@vindex citation-delimiter-regexp (sc-) -@vindex sc-citation-separator-regexp -@vindex citation-separator-regexp (sc-) -@vindex sc-citation-root-regexp -@vindex citation-root-regexp (sc-) -@vindex sc-citation-nonnested-root-regexp -@vindex citation-nonnested-root-regexp (sc-) - -The variable @code{sc-citation-leader-regexp} describes how citation -leaders can look, by default it matches any number of spaces or tabs. -Note that since the lisp function @code{looking-at} is used to do the -matching, if you change this variable it need not start with a leading -@code{"^"}. - -Similarly, the variables @code{sc-citation-delimiter-regexp} and -@code{sc-citation-separator-regexp} respectively describe how citation -delimiters and separators can look. They follow the same rule as -@code{sc-citation-leader-regexp} above. - -When Supercite composes a citation string, it provides the attribution -automatically. The analogous variable which handles recognition of the -attribution part of citation strings is @code{sc-citation-root-regexp}. -This variable describes the attribution root for both nested and -non-nested citations. By default it can match zero-to-many alphanumeric -characters (also ``.'', ``-'', and ``_''). But in some situations, -Supercite has to determine whether it is looking at a nested or -non-nested citation. Thus the variable -@code{sc-citation-nonnested-root-regexp} is used to describe only -non-nested citation roots. It is important to remember that if you -change @code{sc-citation-root-regexp} you should always also change -@code{sc-citation-nonnested-root-regexp}.@refill - -@node Information Keys and the Info Alist, Reference Headers, Miscellaneous Commands, Top -@comment node-name, next, previous, up -@cindex information keys -@cindex Info Alist -@cindex information extracted from mail fields -@findex sc-mail-field -@findex mail-field (sc-) -@comment -@chapter Information Keys and the Info Alist -@ifinfo - -@end ifinfo -@dfn{Mail header information keys} are nuggets of information that -Supercite extracts from the various mail headers of the original -message, placed in the reply buffer by the MUA. Information is kept in -the @dfn{Info Alist} as key-value pairs, and can be retrieved for use in -various places within Supercite, such as in header rewrite functions and -attribution selection. Other bits of data, composed and created by -Supercite, are also kept as key-value pairs in this alist. In the case -of mail fields, the key is the name of the field, omitting the trailing -colon. Info keys are always case insensitive (as are mail headers), and -the value for a corresponding key can be retrieved from the alist with -the @code{sc-mail-field} function. Thus, if the following fields were -present in the original article:@refill - -@example -Date:@: 08 April 1991, 17:32:09 EST -Subject:@: Better get out your asbestos suit -@end example - -@vindex sc-mumble -@vindex mumble (sc-) -@noindent -then, the following lisp constructs return: - -@example -(sc-mail-field "date") -==> "08 April 1991, 17:32:09 EST" - -(sc-mail-field "subject") -==> "Better get out your asbestos suit" -@end example - -Since the argument to @code{sc-mail-field} can be any string, it is -possible that the mail field will not be present on the info alist -(possibly because the mail header was not present in the original -message). In this case, @code{sc-mail-field} will return the value of -the variable @code{sc-mumble}. - -Supercite always places all mail fields found in the yanked original -article into the info alist. If possible, Supercite will also places -the following keys into the info alist: - -@table @code -@cindex sc-attribution info field -@cindex attribution info field (sc-) -@item "sc-attribution" -the selected attribution string. - -@cindex sc-citation info field -@cindex citation info field (sc-) -@item "sc-citation" -the non-nested citation string. - -@cindex sc-from-address info field -@cindex from-address info field (sc-) -@item "sc-from-address" -email address extracted from the @samp{From:@:} field. - -@cindex sc-reply-address info field -@cindex reply-address info field (sc-) -@item "sc-reply-address" -email address extracted from the @samp{Reply-To:@:} field. - -@cindex sc-sender-address info field -@cindex sender-address info field (sc-) -@item "sc-sender-address" -email address extracted from the @samp{Sender:@:} field. - -@cindex sc-emailname info field -@cindex emailname info field (sc-) -@item "sc-emailname" -email terminus extracted from the @samp{From:@:} field. - -@cindex sc-initials info field -@cindex initials info field (sc-) -@item "sc-initials" -the author's initials. - -@cindex sc-author info field -@cindex author info field (sc-) -@item "sc-author" -the author's full name. - -@cindex sc-firstname info field -@cindex firstname info field (sc-) -@item "sc-firstname" -the author's first name. - -@cindex sc-lastname info field -@cindex lastname info field (sc-) -@item "sc-lastname" -the author's last name. - -@cindex sc-middlename-1 info field -@cindex middlename-1 info field (sc-) -@item "sc-middlename-1" -the author's first middle name. -@end table - -If the author's name has more than one middle name, they will appear as -info keys with the appropriate index (e.g., @code{"sc-middlename-2"}, -@dots{}). @xref{Selecting an Attribution}.@refill - -@node Reference Headers, The Built-in Header Rewrite Functions, Information Keys and the Info Alist, Top -@comment node-name, next, previous, up -@cindex reference headers -@chapter Reference Headers -@ifinfo - -@end ifinfo -Supercite will insert an informative @dfn{reference header} at the -beginning of the cited body of text, which display more detail about the -original article and provides the mapping between the attribution and -the original author in non-nested citations. Whereas the citation -string usually only contains a portion of the original author's name, -the reference header can contain such information as the author's full -name, email address, the original article's subject, etc. In fact any -information contained in the info alist can be inserted into a reference -header. - -@ifinfo -@menu -* The Built-in Header Rewrite Functions:: -* Electric References:: -@end menu -@end ifinfo - -@cindex header rewrite functions -@vindex sc-rewrite-header-list -@vindex rewrite-header-list (sc-) -There are a number of built-in @dfn{header rewrite functions} supplied -by Supercite, but you can write your own custom header rewrite functions -(perhaps using the built-in ones as examples). The variable -@code{sc-rewrite-header-list} contains the list of such header rewrite -functions. This list is consulted both when inserting the initial -reference header, and when displaying @dfn{electric references}. -@xref{Electric References}. - -@vindex sc-preferred-header-style -@vindex preferred-header-style (sc-) -When Supercite is initially run on a reply buffer (via -@code{sc-cite-original}), it will automatically call one of these -functions. The one it uses is defined in the variable -@code{sc-preferred-header-style}. The value of this variable is an -integer which is an index into the @code{sc-rewrite-header-list}, -beginning at zero. - -@node The Built-in Header Rewrite Functions, Electric References, Reference Headers, Reference Headers -@comment node-name, next, previous, up -@cindex header rewrite functions, built-in -@comment -@section The Built-in Header Rewrite Functions -@ifinfo - -@end ifinfo -Below are examples of the various built-in header rewrite functions. -Please note the following:@: first, the text which appears in the -examples below as @var{infokey} indicates that the corresponding value -of the info key from the info alist will be inserted there. -(@pxref{Information Keys and the Info Alist}). For example, in @code{sc-header-on-said} -below, @var{date} and @var{from} correspond to the values of the -@samp{Date:@:} and @samp{From:@:} mail headers respectively.@refill - -@vindex sc-reference-tag-string -@vindex reference-tag-string (sc-) -Also, the string @code{">>>>>"} below is really the value of the -variable @code{sc-reference-tag-string}. This variable is used in all -built-in header rewrite functions, and you can customize its value to -change the tag string globally. - -Finally, the references headers actually written may omit certain parts -of the header if the info key associated with @var{infokey} is not -present in the info alist. In fact, for all built-in headers, if the -@samp{From:@:} field is not present in the mail headers, the entire -reference header will be omitted (but this usually signals a serious -problem either in your MUA or in Supercite's installation). - -@table @code -@findex sc-no-header -@findex no-header (sc-) -@item sc-no-header -This function produces no header. It should be used instead of -@code{nil} to produce a blank header. This header can possibly contain -a blank line after the @code{mail-header-separator} line. - -@item sc-no-blank-line-or-header -@findex sc-no-blank-line-or-header -@findex no-blank-line-or-header (sc-) -This function is similar to @code{sc-no-header} except that any blank -line after the @code{mail-header-separator} line will be removed. - -@item sc-header-on-said -@findex sc-header-on-said -@findex header-on-said (sc-) -@code{>>>>> On @var{date}, @var{from} said:} - -@item sc-header-inarticle-writes -@findex sc-header-inarticle-writes -@findex header-inarticle-writes (sc-) -@code{>>>>> In article @var{message-id}, @var{from} writes:} - -@item sc-header-regarding-adds -@findex sc-header-regarding-adds -@findex header-regarding-adds (sc-) -@code{>>>>> Regarding @var{subject}; @var{from} adds:} - -@item sc-header-attributed-writes -@findex sc-header-attributed-writes -@findex header-attributed-writes (sc-) -@code{>>>>> "@var{sc-attribution}" == @var{sc-author} <@var{sc-reply-address}> writes:} - -@item sc-header-author-writes -@findex sc-header-author-writes -@findex header-author-writes (sc-) -@code{>>>>> @var{sc-author} writes:} - -@item sc-header-verbose -@findex sc-header-verbose -@findex header-verbose (sc-) -@code{>>>>> On @var{date},}@* -@code{>>>>> @var{sc-author}}@* -@code{>>>>> from the organization of @var{organization}}@* -@code{>>>>> who can be reached at:@: @var{sc-reply-address}}@* -@code{>>>>> (whose comments are cited below with:@: "@var{sc-cite}")}@* -@code{>>>>> had this to say in article @var{message-id}}@* -@code{>>>>> in newsgroups @var{newsgroups}}@* -@code{>>>>> concerning the subject of @var{subject}}@* -@code{>>>>> see @var{references} for more details} -@end table - -@node Electric References, Hints to MUA Authors, The Built-in Header Rewrite Functions, Reference Headers -@comment node-name, next, previous, up -@cindex electric references -@section Electric References -@ifinfo - -@end ifinfo -By default, when Supercite cites the original message for the first -time, it just goes ahead and inserts the reference header indexed by -@code{sc-preferred-header-style}. However, you may want to select -different reference headers based on the type of reply or forwarding you -are doing. You may also want to preview the reference header before -deciding whether to insert it into the reply buffer or not. Supercite -provides an optional @dfn{electric reference} mode which you can drop -into to give you this functionality. - -@vindex sc-electric-references-p -@vindex electric-references-p (sc-) -If the variable @code{sc-electric-references-p} is non-@code{nil}, -Supercite will bring up an electric reference mode buffer and place you -into a recursive edit. The electric reference buffer is read-only, so -you cannot directly modify the reference text until you exit electric -references and insert the text into the reply buffer. But you can cycle -through all the reference header rewrite functions in your -@code{sc-rewrite-header-list}. - -You can also set a new preferred header style, jump to any header, or -jump to the preferred header. The header will be shown in the electric -reference buffer and the header index and function name will appear in -the echo area. - -The following commands are available while in electric reference mode -(shown here with their default key bindings): - -@table @asis -@item @code{sc-eref-next} (@kbd{n}) -@findex sc-eref-next -@findex eref-next (sc-) -@kindex n -@vindex sc-electric-circular-p -@vindex electric-circular-p (sc-) -Displays the next reference header in the electric reference buffer. If -the variable @code{sc-electric-circular-p} is non-@code{nil}, invoking -@code{sc-eref-next} while viewing the last reference header in the list -will wrap around to the first header.@refill - -@item @code{sc-eref-prev} (@kbd{p}) -@findex sc-eref-prev -@findex eref-prev (sc-) -@kindex p -Displays the previous reference header in the electric reference buffer. -If the variable @code{sc-electric-circular-p} is non-@code{nil}, -invoking @code{sc-eref-prev} will wrap around to the last header.@refill - -@item @code{sc-eref-goto} (@kbd{g}) -@findex sc-eref-goto -@findex eref-goto (sc-) -@kindex g -Goes to a specified reference header. The index (into the -@code{sc-rewrite-header-list}) can be specified as a numeric argument to -the command. Otherwise, Supercite will query you for the index in the -minibuffer.@refill - -@item @code{sc-eref-jump} (@kbd{j}) -@findex sc-eref-jump -@findex eref-jump (sc-) -@kindex j -Display the preferred reference header, i.e., the one indexed by the current -value of @code{sc-preferred-header-style}. - -@item @code{sc-eref-setn} (@kbd{s}) -@findex sc-eref-setn -@findex eref-setn (sc-) -@kindex s -Set the preferred reference header (i.e., -@code{sc-preferred-header-style}) to the currently displayed header.@refill - -@item @code{sc-eref-exit} (@kbd{C-j}, @key{RET}, and @key{ESC C-c}) -@kindex RET -@kindex C-j -@kindex q -@findex sc-eref-exit -@findex eref-exit (sc-) -Exit from electric reference mode and insert the current header into the -reply buffer.@refill - -@item @code{sc-eref-abort} (@kbd{q}, @kbd{x}) -@findex sc-eref-abort -@findex eref-abort (sc-) -@kindex x -Exit from electric reference mode without inserting the current header. -@end table - -@vindex sc-electric-mode-hook -@vindex electric-mode-hook (sc-) -@noindent -Supercite will execute the hook @code{sc-electric-mode-hook} before -entering electric reference mode. - -@node Getting Connected, Emacs 19 MUAs, Recognizing Citations, Top -@comment node-name, next, previous, up -@cindex citation interface specification -@chapter Getting Connected -@ifinfo - -@end ifinfo -Hitting @kbd{C-c C-y} in your MUA's reply buffer yanks and cites the -original message into the reply buffer. In reality, the citation of the -original message is performed via a call through a configurable hook -variable. The name of this variable has been agreed to in advance as -part of the @dfn{citation interface specification}. By default this -hook variable has a @code{nil} value, which the MUA recognizes to mean, -``use your default citation function.'' When you add Supercite's -citation function to the hook, thereby giving the variable a -non-@code{nil} value, it tells the MUA to run the hook via -@code{run-hooks} instead of using the default citation.@refill - -@ifinfo -@menu -* Emacs 19 MUAs:: -* Emacs 18 MUAs:: -* MH-E with any Emacsen:: -* VM with any Emacsen:: -* GNEWS with any Emacsen:: -* Overloading for Non-conforming MUAs:: -@end menu -@end ifinfo - -Early in Supercite's development, the Supercite author, a few MUA -authors, and some early Supercite users got together and agreed upon a -standard interface between MUAs and citation packages (of which -Supercite is currently the only known add-on @t{:-)}. With the recent -release of the Free Software Foundation's GNU Emacs 19, the interface -has undergone some modification and it is possible that not all MUAs -support the new interface yet. Some support only the old interface and -some do not support the interface at all. Still, it is possible for all -known MUAs to use Supercite, and the following sections will outline the -procedures you need to follow. - -To learn exactly how to connect Supercite to the software systems you -are using, read the appropriate following sections. For details on the -interface specifications, or if you are writing or maintaining an MUA, -@pxref{Hints to MUA Authors}. - -@cindex autoload -@cindex .emacs file -@findex sc-cite-original -@findex cite-original (sc-) -@findex sc-submit-bug-report -@findex submit-bug-report (sc-) -The first thing that everyone should do, regardless of the MUA you are -using is to set up Emacs so it will load Supercite at the appropriate -time. You can either dump Supercite into your Emacs binary (ask your -local Emacs guru how to do this if you don't know), or you can set up an -@dfn{autoload} for Supercite. To do the latter, put the following in -your @file{.emacs} file: - -@example -(autoload 'sc-cite-original "supercite" "Supercite 3.1" t) -(autoload 'sc-submit-bug-report "supercite" "Supercite 3.1" t) -@end example - -@cindex point -@cindex mark -The function @code{sc-cite-original} is the top-level Supercite function -designed to be run from the citation hook. It expects -@samp{point} and @samp{mark} to be set around the region to cite, and it -expects the original article's mail headers to be present within this -region. Note that Supercite @emph{never} touches any text outside this -region. Note further that for Emacs 19, the region need not be active -for @code{sc-cite-original} to do its job. -@xref{Hints to MUA Authors}.@refill - -The other step in the getting connected process is to make sure your -MUA calls @code{sc-cite-original} at the right time. As mentioned -above, some MUAs handle this differently. Read the sections that follow -pertaining to the MUAs you are using. - -@vindex sc-load-hook -@vindex load-hook (sc-) -@vindex sc-pre-hook -@vindex pre-hook (sc-) -One final note. After Supercite is loaded into your Emacs session, it -runs the hook @code{sc-load-hook}. You can put any customizations into -this hook since it is only run once. This will not work, however, if -your Emacs maintainer has put Supercite into your dumped Emacs' image. -In that case, you can use the @code{sc-pre-hook} variable, but this will -get executed every time @code{sc-cite-original} is called. @xref{Reply -Buffer Initialization}.@refill - -@node Emacs 19 MUAs, Emacs 18 MUAs, Getting Connected, Getting Connected -@comment node-name, next, previous, up -@vindex mail-citation-hook -@cindex .emacs file -@section GNUS, RMAIL, or RNEWS with any Emacs 19 -@ifinfo - -@end ifinfo -These MUAs, distributed with Emacs and with Lucid Emacs, use Emacs's -built-in yanking facility, which provides the citing hook variable -@code{mail-citation-hook}. By default, this hook's value is @code{nil}, -but by adding the following to your @file{.emacs} file, you can tell -these MUAs to use Supercite to perform the citing of the original -message: - -@example -(add-hook 'mail-citation-hook 'sc-cite-original) -@end example - -GNUS users may also want to add the following bit of lisp as well. This -prevents GNUS from inserting its default attribution header. Otherwise, -both GNUS and Supercite will insert an attribution header: - -@example -(setq news-reply-header-hook nil) -@end example - -@node Emacs 18 MUAs, MH-E with any Emacsen, Emacs 19 MUAs, Getting Connected -@comment node-name, next, previous, up -@vindex mail-citation-hook -@cindex .emacs file -@cindex overloading -@cindex sendmail.el file -@section GNUS, RMAIL, PCMAIL, RNEWS with Emacs 18 or Epoch 4 -@ifinfo - -@end ifinfo -These MUAs use Emacs' built-in yanking and citing routines, contained in -the @file{sendmail.el} file. @file{sendmail.el} for Emacs 18, and its -derivative Epoch 4, do not know anything about the citation interface -required by Supercite. To connect Supercite to any of these MUAs under -Emacs 18 or Epoch 4, you should first -@pxref{Overloading for Non-conforming MUAs}. Then follow the directions -for using these MUAs under Emacs 19. -@xref{Emacs 19 MUAs}.@refill - -@cindex add-hook substitute -@cindex setq as a substitute for add-hook -@findex setq -@findex add-hook -@cindex sc-unsupp.el file -Note that those instructions will tell you to use the function -@code{add-hook}. This function is new with Emacs 19 and you will not -have it by default if you are running Emacs 18 or Epoch 4. You can -either substitute the appropriate call to @code{setq}, or you can use -the @code{add-hook} function that is provided in the @file{sc-unsupp.el} -file of unsupported Supercite hacks and ideas. Or you can upgrade to -some Emacs 19 variant! @t{:-)}@refill - -To use @code{setq} instead of @code{add-hook}, you would, for example, -change this: - -@example -(add-hook 'mail-citation-hook 'sc-cite-original) -@end example - -to: - -@example -(setq mail-citation-hook 'sc-cite-original) -@end example - -Note the lack of a single quote on the first argument to @code{setq}. - -@node MH-E with any Emacsen, VM with any Emacsen, Emacs 18 MUAs, Getting Connected -@comment node-name, next, previous, up -@cindex .emacs file -@vindex mh-yank-hooks -@findex add-hook -@cindex mail-citation-hook -@section MH-E with any Emacsen -@ifinfo - -@end ifinfo -MH-E 4.x conforms to the @code{mail-citation-hook} interface supported -by other MUAs. At the time of this writing, MH-E 4.0 has not been -released, but if you have it, put this in your @file{.emacs} file to -connect Supercite and MH-E 4.x: - -@example -(add-hook 'mail-citation-hook 'sc-cite-original) -@end example - -Note that if you are using Emacs 18 or Epoch 4, you will not have the -@code{add-hook} function. @xref{Emacs 18 MUAs}, for details on how to -proceed without @code{add-hook}. - -MH-E version 3.x uses a slightly different interface than other MUAs. -MH-E provides a hook variable @code{mh-yank-hooks}, but it doesn't act -like a hook, and doing an @code{add-hook} will not work. - -To connect Supercite to MH-E 3.x, you should instead add the following -to your @code{.emacs} file: - -@example -(add-hook 'mh-yank-hooks 'sc-cite-original) -@end example - -@vindex mh-yank-from-start-of-msg -You also need to make sure that MH-E includes all the original mail -headers in the yanked message. The variable that controls this is -@code{mh-yank-from-start-of-msg}. By default, this variable has the -value @code{t}, which tells MH-E to include all the mail headers when -yanking the original message. Before you switched to using Supercite, -you may have set this variable to other values so as not to include the -mail headers in the yanked message. Since Supercite requires these -headers (and cleans them out for you), you need to make sure the value -is @code{t}. This lisp, in your @file{.emacs} file will do the trick: - -@example -(setq mh-yank-from-start-of-msg t) -@end example - -Note that versions of MH-E before 3.7 did not provide the -@code{mh-yank-hooks} variable. Your only option is to upgrade to MH-E -version 3.7 or later. - -@node VM with any Emacsen, GNEWS with any Emacsen, MH-E with any Emacsen, Getting Connected -@comment node-name, next, previous, up -@cindex .emacs file -@vindex mail-citation-hook -@vindex mail-yank-hooks -@section VM with any Emacsen -@ifinfo - -@end ifinfo -Since release 4.40, VM has supported the citation interface required by -Supercite. But since the interface has changed recently the details of -getting connected differ with the version of VM you are using. - -If you are running any release of VM after 4.40, you can add the -following to your @file{.emacs} to connect Supercite with VM: - -@example -(add-hook 'mail-yank-hooks 'sc-cite-original) -@end example - -Note that if you are using Emacs 18 or Epoch 4, you will not have the -@code{add-hook} function. @xref{Emacs 18 MUAs}, for details on how to -proceed without @code{add-hook}. - -Since version 5.34, VM has supported the newer @code{mail-citation-hook} -interface, but @code{mail-yank-hooks} is still being supported for -backward compatibility. If you are running a newer version of VM and -you want to maintain consistency with other MUAs, use this bit of code -instead: - -@example -(add-hook 'mail-citation-hook 'sc-cite-original) -@end example - -@node GNEWS with any Emacsen, Overloading for Non-conforming MUAs, VM with any Emacsen, Getting Connected -@comment node-name, next, previous, up@cindex .emacs file -@vindex news-reply-mode-hook -@findex sc-perform-overloads -@findex perform-overloads (sc-) -@vindex gnews-ready-hook -@section GNEWS with any Emacsen -@ifinfo - -@end ifinfo -As far as I know, no version of GNEWS supports the citation interface -required by Supercite. To connect Supercite with GNEWS, please first -@pxref{Overloading for Non-conforming MUAs}. - -After you have followed the directions in that section. You should add -the following lisp code to your @file{.emacs} file: - -@example -(add-hook 'mail-citation-hook 'sc-cite-original) -@end example - -Note that if you are using Emacs 18 or Epoch 4, you will not have the -@code{add-hook} function. @xref{Emacs 18 MUAs}, for details on how to -proceed without @code{add-hook}. - -@node Overloading for Non-conforming MUAs, Replying and Yanking, GNEWS with any Emacsen, Getting Connected -@comment node-name, next, previous, up -@cindex overloading -@cindex sc-oloads.el -@vindex mail-citation-hook -@findex sc-perform-overloads -@cindex .emacs file -@section Overloading for Non-conforming MUAs -@ifinfo - -@end ifinfo -As mentioned elsewhere, some MUAs do not provide the necessary hooks to -connect with Supercite. Supercite version 3.1 provides an unsupported -mechanism, called @dfn{overloading} which redefines certain key -functions in the MUA, so that it will call the @code{mail-citation-hook} -variable instead of the MUA's default hard-coded citing routines. Since -most newer versions of the known MUAs support the -@code{mail-citation-hook} variable, it is recommended that you upgrade -if at all possible. But if you can't upgrade, at least you're not out -of luck! Once you set up overloading properly, you should follow the -directions for connecting Supercite to the Emacs 19 MUAs. -@xref{Emacs 19 MUAs}.@refill - -@cindex Hyperbole -@vindex hyperb:version -Users of Bob Weiner's Hyperbole package take note. Hyperbole provides -the necessary overloads (and a whole lot more!) and you can potentially -clobber it if you were to load Supercite's overloading after -Hyperbole's. For this reason, Supercite will @emph{not} perform any -overloading if it finds the variable @code{hyperb:version} is -@code{boundp} (i.e. it exists because Hyperbole has been loaded into -your Emacs session). If this is the case, Supercite will display a -warning message in the minibuffer. You should consult the Hyperbole -manual for further details. - -Overloading involves the re-definition of the citing function with the -new, @code{mail-citation-hook} savvy version. The function in -@file{sc-oloads.el} that does this is @code{sc-perform-overloads}. This -function is smart enough to only overload the MUA functions when it is -absolutely necessary, based on the version numbers it can figure out. -Also, @code{sc-perform-overloads} will only install the new functions -once. It is also smart enough to do nothing if the MUA is not yet -loaded.@refill - -The tricky part is finding the right time and place to perform the -overloading. It must be done after the MUA has been loaded into your -Emacs session, but before the first time you try to yank in a message. -Fortunately, this has been figured out for you. - -If you must overload, you should put the following lisp code in your -@file{.emacs} file, to make sure the @file{sc-oloads.el} file gets -loaded at the right time: - -@example -(autoload 'sc-perform-overloads "sc-oloads" "Supercite 3.1" t) -@end example - -Then you must make sure that the function @code{sc-perform-overloads} -gets run at the right time. For GNUS, put this in your @file{.emacs} -file: - -@example -(setq news-reply-mode-hook 'sc-perform-overloads) -(setq mail-setup-hook 'sc-perform-overloads) -@end example - -If you are using RNEWS, put this in your @file{.emacs} file: - -@vindex news-reply-mode-hook -@example -(setq news-reply-mode-hook 'sc-perform-overloads) -@end example - -If you are using RMAIL or PCMAIL, put this in your @file{.emacs} file: - -@example -(setq mail-setup-hook 'sc-perform-overloads) -@end example - -If you are using GNEWS, put this in your @file{.emacs} file: - -@example -(setq news-reply-mode-hook 'sc-perform-overloads) -(setq gnews-ready-hook 'sc-perform-overloads) -@end example - -Now go back and follow the directions for getting the Emacs 19 MUAs -connected to Supercite. Be sure to @pxref{Emacs 18 MUAs} on substitutes -for Emacs 19's @code{add-hook} function.@refill - -@node Replying and Yanking, Reply Buffer Initialization, Overloading for Non-conforming MUAs, Top -@comment node-name, next, previous, up -@chapter Replying and Yanking -@ifinfo - -This chapter explains what happens when you reply and yank an original -message from an MUA. - -@menu -* Reply Buffer Initialization:: -* Filling Cited Text:: -@end menu -@end ifinfo -@node Reply Buffer Initialization, Filling Cited Text, Replying and Yanking, Replying and Yanking -@comment node-name, next, previous, up -@findex sc-cite-original -@findex cite-original (sc-) -@comment -@section Reply Buffer Initialization -@ifinfo - -@end ifinfo -Executing @code{sc-cite-original} performs the following steps as it -initializes the reply buffer: - -@enumerate -@item -@vindex sc-pre-hook -@vindex pre-hook (sc-) -@emph{Runs @code{sc-pre-hook}.} -This hook variable is run before @code{sc-cite-original} does any other -work. You could conceivably use this hook to set certain Supercite -variables based on the reply buffer's mode or name (i.e., to do -something different based on whether you are replying or following up to -an article).@refill - -@item -@emph{Inserts Supercite's keymap.} -@vindex sc-mode-map-prefix -@vindex mode-map-prefix (sc-) -@kindex C-c C-p -@cindex keymap prefix -Supercite provides a number of commands for performing post-yank -modifications to the reply buffer. These commands are installed on -Supercite's top-level keymap. Since Supercite has to interface with a -wide variety of MUAs, it does not install all of its commands directly -into the reply buffer's keymap. Instead, it puts its commands on a -keymap prefix, then installs this prefix onto the buffer's keymap. What -this means is that you typically have to type more characters to invoke -a Supercite command, but Supercite's key bindings can be made much more -consistent across MUAs. - -You can control what key Supercite uses as its keymap prefix by changing -the variable @code{sc-mode-map-prefix}. By default, this variable is -set to @code{C-c C-p}; a finger twister perhaps, but unfortunately the -best default due to the scarcity of available key bindings in many MUAs. - -@item -@emph{Turns on Supercite minor mode.} -@cindex modeline -The modeline of the reply buffer should indicate that Supercite is -active in that buffer by displaying the string @samp{SC}. - -@item -@emph{Sets the ``Undo Boundary.''} -@cindex undo boundary -Supercite sets an undo boundary before it begins to modify the original -yanked text. This allows you to easily undo Supercite's changes to -affect alternative citing styles. - -@item -@emph{Processes the mail headers.} -@vindex sc-confirm-always-p -@vindex confirm-always-p (sc-) -@vindex sc-mail-warn-if-non-rfc822-p -@vindex mail-warn-if-non-rfc822-p (sc-) -All previously retrieved info key-value pairs are deleted from the info -alist, then the mail headers in the body of the yanked message are -scanned. Info key-value pairs are created for each header found. Also, -such useful information as the author's name and email address are -extracted. If the variable @code{sc-mail-warn-if-non-rfc822-p} is -non-@code{nil}, then Supercite will warn you if it finds a mail header -that does not conform to RFC822. This is rare and indicates a problem -either with your MUA or the original author's MUA, or some MTA (mail -transport agent) along the way. - -@vindex sc-nuke-mail-headers -@vindex sc-nuke-mail-header-list -@vindex nuke-mail-headers (sc-) -@vindex nuke-mail-header-list (sc-) -Once the info keys have been extracted from the mail headers, the -headers are nuked from the reply buffer. You can control exactly which -headers are removed or kept, but by default, all headers are removed. - -There are two variables which control mail header nuking. The variable -@code{sc-nuke-mail-headers} controls the overall behavior of the header -nuking routines. By setting this variable to @code{'all}, you -automatically nuke all mail headers. Likewise, setting this variable to -@code{'none} inhibits nuking of any mail headers. In between these -extremes, you can tell Supercite to nuke only a specified list of mail -headers by setting this variable to @code{'specified}, or to keep only a -specified list of headers by setting it to @code{'keep}. - -If @code{sc-nuke-mail-headers} is set to @code{'specified} or -@code{'keep}, then the variable @code{sc-nuke-mail-header-list} is -consulted for the list of headers to nuke or keep. This variable -contains a list of regular expressions. If the mail header line matches -a regular expression in this list, the header will be nuked or kept. -The line is matched against the regexp using @code{looking-at} rooted at -the beginning of the line. - -@vindex sc-blank-lines-after-headers -@vindex blank-lines-after-headers (sc-) -If the variable @code{sc-blank-lines-after-headers} is non-@code{nil}, -it contains the number of blank lines remaining in the buffer after mail -headers are nuked. By default, only one blank line is left in the buffer. - -@item -@emph{Selects the attribution and citation strings.} -Once the mail headers have been processed, Supercite selects a -attribution string and a citation string which it will use to cite the -original message. @xref{Selecting an Attribution}, for details. - -@item -@emph{Cites the message body.} -@vindex sc-cite-region-limit -@vindex cite-region-limit (sc-)b -After the selection of the attribution and citation strings, Supercite -cites the original message by inserting the citation string prefix in -front of every uncited line. You may not want Supercite to -automatically cite very long messages however. For example, some email -could contain a smaller header section followed by a huge uuencoded -message. It wouldn't make sense to cite the uuencoded message part when -responding to the original author's short preface. For this reason, -Supercite provides a variable which limits the automatic citation of -long messages to a certain maximum number of lines. The variable is -called @code{sc-cite-region-limit}. If this variable contains an -integer, messages with more lines that this will not be cited at all, -and a warning message will be displayed. Supercite has performed -everything necessary, though, for you to manually cite only the small -portion of the original message that you want to use. - -If @code{sc-cite-region-limit} contains a non-@code{nil} value, the -original message will always be cited, regardless of its size. If the -variable contains the value @code{nil}, the region will never be cited -automatically. Use this if you always want to be able to edit and cite -the message manually. - -@vindex sc-cite-blank-lines-p -@vindex cite-blank-lines-p (sc-) -The variable @code{sc-cite-blank-lines-p} controls whether blank lines -in the original message should be cited or not. If this variable is -non-@code{nil}, blank lines will be cited just like non-blank lines. -Otherwise, blank lines will be treated as paragraph separators. - -Citing of the original message is highly configurable. Supercite's -default setup does a pretty good job of citing many common forms of -previously cited messages. But there are as many citation styles out -there as people on the net, or just about! It would be impossible for -Supercite to anticipate every style in existence, and you probably -wouldn't encounter them all anyway. But you can configure Supercite to -recognize those styles you see often. -@xref{Configuring the Citation Engine}, for details.@refill - -@item -@emph{Runs @code{sc-post-hook}.} -@vindex sc-post-hook -@vindex post-hook (sc-) -This variable is very similar to @code{sc-pre-hook}, except that it runs -after @code{sc-cite-original} is finished. This hook is provided mostly -for completeness and backward compatibility. Perhaps it could be used to -reset certain variables set in @code{sc-pre-hook}.@refill -@end enumerate - -@node Filling Cited Text, Selecting an Attribution, Reply Buffer Initialization, Replying and Yanking -@comment node-name, next, previous, up -@cindex filling paragraphs -@vindex sc-auto-fill-region-p -@vindex auto-fill-region-p (sc-) -@cindex filladapt -@cindex gin-mode -@findex sc-setup-filladapt -@findex setup-filladapt (sc-) -@vindex sc-load-hook -@vindex load-hook (sc-) -@section Filling Cited Text -@ifinfo - -@end ifinfo -Supercite will automatically fill newly cited text from the original -message unless the variable @code{sc-auto-fill-region-p} has a -@code{nil} value. Supercite will also re-fill paragraphs when you -manually cite or re-cite text. - -However, during normal editing, Supercite itself cannot be used to fill -paragraphs. This is a change from version 2. There are other add-on -lisp packages which do filling much better than Supercite ever did. The -two best known are @dfn{filladapt} and @dfn{gin-mode}. Both work well -with Supercite and both are available at the normal Emacs Lisp archive -sites. @dfn{gin-mode} works pretty well out of the box, but if you use -@dfn{filladapt}, you may want to run the function -@code{sc-setup-filladapt} from your @code{sc-load-hook}. This simply -makes @dfn{filladapt} a little more Supercite savvy than its default -setup. - -@vindex sc-fixup-whitespace-p -@vindex fixup-whitespace-p (sc-) -Also, Supercite will collapse leading whitespace between the citation -string and the text on a line when the variable -@code{sc-fixup-whitespace-p} is non-@code{nil}. The default value for -this variable is @code{nil}.@refill - -@vindex fill-prefix -Its important to understand that Supercite's automatic filling (during -the initial citation of the reply) is very fragile. That is because -figuring out the @code{fill-prefix} for a particular paragraph is a -really hard thing to do automatically. This is especially the case when -the original message contains code or some other text where leading -whitespace is important to preserve. For this reason, many Supercite -users typically run with @code{sc-auto-fill-region-p} (and possibly also -@code{sc-fixup-whitespace-p}) set to @code{nil}. They then manually -fill each cited paragraph in the reply buffer. - -I usually run with both these variables containing their default values. -When Supercite's automatic filling breaks on a particular message, I -will use Emacs' undo feature to undo back before the citation was -applied to the original message. Then I'll toggle the variables and -manually cite those paragraphs that I don't want to fill or collapse -whitespace on. @xref{Variable Toggling Shortcuts}.@refill - -@kindex C-c C-p C-p -If you find that Supercite's automatic filling is just too fragile for -your tastes, you might consider one of these alternate approaches. -Also, to make life easier, a shortcut function to toggle the state of -both of these variables is provided on the key binding -@kbd{C-c C-p C-p} (with the default value of @code{sc-mode-map-prefix}; -@pxref{Post-yank Formatting Commands}).@refill - -You will noticed that the minor mode string will -show the state of these variables as qualifier characters. When both -variables are @code{nil}, the Supercite minor mode string will display -@samp{SC}. When just @code{sc-auto-fill-region-p} is non-@code{nil}, the -string will display @samp{SC:f}, and when just -@code{sc-fixup-whitespace-p} is non-@code{nil}, the string will display -@samp{SC:w}. When both variables are non-@code{nil}, the string will -display @samp{SC:fw}. Note that the qualifiers chosen are mnemonics for -the default bindings of the toggling function for each respective -variable. -@xref{Variable Toggling Shortcuts}.@refill - -Why are these variables not set to @code{nil} by default? It is because -many users won't manually fill paragraphs that are Supercited, and there -have been widespread complaints on the net about mail and news messages -containing lines greater than about 72 characters. So the default is to -fill cited text. - -@node Selecting an Attribution, Attribution Preferences, Filling Cited Text, Top -@comment node-name, next, previous, up -@cindex attribution list -@vindex sc-preferred-attribution-list -@vindex preferred-attribution-list (sc-) -@comment -@chapter Selecting an Attribution -@ifinfo - -@end ifinfo -As you know, the attribution string is the part of the author's name -that will be used to composed a non-nested citation string. Supercite -scans the various mail headers present in the original article and uses -a number of heuristics to extract strings which it puts into the -@dfn{attribution association list} or @dfn{attribution alist}. This is -analogous, but different than, the info alist previously mentioned. Each -element in the attribution alist is a key-value pair containing such -information as the author's first name, middle names, and last name, the -author's initials, and the author's email terminus. - -@ifinfo -@menu -* Attribution Preferences:: -* Anonymous Attributions:: -* Author Names:: -@end menu -@end ifinfo - -@node Attribution Preferences, Anonymous Attributions, Selecting an Attribution, Selecting an Attribution -@comment node-name, next, previous, up -@section Attribution Preferences -@ifinfo - -@end ifinfo -When you cite an original message, you can tell Supercite which part of -the author's name you would prefer it to use as the attribution. The -variable @code{sc-preferred-attribution-list} controls this; it contains -keys which are matched against the attribution alist in the given order. -The first value of a key that produces a non-@code{nil}, non-empty -string match is used as the attribution string, and if no keys match, a -secondary mechanism is used to generate the attribution. -@xref{Anonymous Attributions}. - -The following preferences are always available in the attribution alist -(barring error): - -@table @code -@item "emailname" -the author's email terminus. - -@item "initials" -the author's initials. - -@item "firstname" -the author's first name. - -@item "lastname" -the author's last name. - -@item "middlename-1" -the author's first middle name. - -@item "sc-lastchoice" -the last attribution string you have selected. This is useful when you -recite paragraphs in the reply.@refill - -@item "sc-consult" -@vindex sc-attrib-selection-list -@vindex attrib-selection-list (sc-) -consults the customizable list @code{sc-attrib-selection-list} which can -be used to select special attributions based on the value of any info -key. See below for details. - -@item "x-attribution" -the original author's suggestion for attribution string choice. See below -for details.@refill -@end table - -Middle name indexes can be any positive integer greater than zero, -though it is unlikely that many authors will have more than one middle -name, if that many. - -At this point, let me digress into a discussion of etiquette. It is my -belief that while the style of the citations is a reflection of the -personal tastes of the replier (i.e., you), the attribution selection is -ultimately the personal choice of the original author. In a sense it is -his or her ``net nickname'', and therefore the author should have some -say in the selection of attribution string. Imagine how you would feel -if someone gave you a nickname that you didn't like? - -For this reason, Supercite recognizes a special mail header, -@samp{X-Attribution:}, which if present, tells Supercite the attribution -string preferred by the original author. It is the value of this header -that is associated with the @code{"x-attribution"} key in the -attribution alist. Currently, you can override the preference of this -key by changing @code{sc-preferred-attribution-list}, but that isn't -polite, and in the future Supercite may hard-code this. For now, it is -suggested that if you change the order of the keys in this list, that -@code{"x-attribution"} always be first, or possible second behind only -@code{"sc-lastchoice"}. This latter is the default. - -@vindex sc-attrib-selection-list -@vindex attrib-selection-list (sc-) -The value @code{"sc-consult"} in @code{sc-preferred-attribution-list} -has a special meaning during attribution selection. When Supercite -encounters this preference, it begins processing a customizable list of -attributions, contained in the variable @code{sc-attrib-selection-list}. -Each element in this list contains lists of the following form: - -@example -@group -(@var{infokey} ((@var{regexp} @. @var{attribution}) - (@var{regexp} @. @var{attribution}) - (@dots{}))) -@end group -@end example - -@noindent -@findex sc-mail-field -@findex mail-field (sc-) -where @var{infokey} is a key for @code{sc-mail-field} and @var{regexp} -is a regular expression to match against the @var{infokey}'s value. If -@var{regexp} matches the @var{infokey}'s value, the @var{attribution} is -used as the attribution string. Actually, @var{attribution} can be a -string or a list; if it is a list, it is @code{eval}uated and the return -value (which must be a string), is used as the attribution. - -This can be very useful for when you are replying to net acquaintances -who do not use the @samp{X-Attribution:@:} mail header. You may know -what nickname they would prefer to use, and you can set up this list to -match against a specific mail field, e.g., @samp{From:@:}, allowing you -to cite your friend's message with the appropriate attribution. - -@node Anonymous Attributions, Author Names, Attribution Preferences, Selecting an Attribution -@comment node-name, next, previous, up -@vindex sc-default-author-name -@vindex default-author-name (sc-) -@vindex sc-default-attribution -@vindex default-attribution (sc-) -@comment -@section Anonymous Attributions -@ifinfo - -@end ifinfo -When the author's name cannot be found in the @samp{From:@:} mail -header, a fallback author name and attribution string must be supplied. -The fallback author name is contained in the variable -@code{sc-default-author-name} and the fallback attribution string is -contained in the variable @code{sc-default-attribution}. Default values -for these variables are @code{"Anonymous"} and @code{"Anon"}, -respectively. Note that in most circumstances, getting the default -author name or attribution is a sign that something is set up -incorrectly. - -@vindex sc-use-only-preference-p -@vindex use-only-preference-p (sc-) -Also, if the preferred attribution, which you specified in your -@code{sc-preferred-attribution-list} variable cannot be found, a -secondary method can be employed to find a valid attribution string. The -variable @code{sc-use-only-preference-p} controls what happens in this -case. If the variable's value is non-@code{nil}, then -@code{sc-default-author-name} and @code{sc-default-attribution} are -used, otherwise, the following steps are taken to find a valid -attribution string, and the first step to return a non-@code{nil}, -non-empty string becomes the attribution:@refill - -@enumerate -@item -Use the last selected attribution, if there is one. - -@item -Use the value of the @code{"x-attribution"} key. - -@item -Use the author's first name. - -@item -Use the author's last name. - -@item -Use the author's initials. - -@item -Find the first non-@code{nil}, non-empty attribution string in the -attribution alist. - -@item -@code{sc-default-attribution} is used. -@end enumerate - -@vindex sc-confirm-always-p -@vindex confirm-always-p (sc-) -Once the attribution string has been automatically selected, a number of -things can happen. If the variable @code{sc-confirm-always-p} is -non-@code{nil}, you are queried for confirmation of the chosen -attribution string. The possible values for completion are those strings -in the attribution alist, however you are not limited to these choices. -You can type any arbitrary string at the confirmation prompt. The string -you enter becomes the value associated with the @code{"sc-lastchoice"} -key in the attribution alist. - -@vindex sc-downcase-p -@vindex downcase-p (sc-) -Once an attribution string has been selected, Supercite will force the -string to lower case if the variable @code{sc-downcase-p} is -non-@code{nil}. - -@vindex sc-attribs-preselect-hook -@vindex attribs-preselect-hook (sc-) -@vindex sc-attribs-postselect-hook -@vindex attribs-postselect-hook (sc-) - -Two hook variables provide even greater control of the attribution -selection process. The hook @code{sc-attribs-preselect-hook} is run -before any attribution is selected. Likewise, the hook -@code{sc-attribs-postselect-hook} is run after the attribution is -selected (and the corresponding citation string is built), but before -these values are committed for use by Supercite. During the -post-selection hook, the local variables @code{attribution} and -@code{citation} are bound to the appropriate strings. By changing these -variables in your hook functions, you change the attribution and -citation strings used by Supercite. One possible use of this would be -to override any automatically derived attribution string when it is only -one character long; e.g. you prefer to use @code{"initials"} but the -author only has one name.@refill - -@node Author Names, Configuring the Citation Engine, Anonymous Attributions, Selecting an Attribution -@comment node-name, next, previous, up -@cindex author names -@section Author Names -@ifinfo - -@end ifinfo -Supercite employs a number of heuristics to decipher the author's name -based on value of the @samp{From:@:} mail field of the original message. -Supercite can recognize almost all of the common @samp{From:@:} field -formats in use. If you encounter a @samp{From:@:} field that Supercite -cannot parse, please report this bug. -@xref{The Supercite Mailing List}.@refill - -@vindex sc-titlecue-regexp -@vindex titlecue-regexp (sc-) -There are a number of Supercite variables that control how author names -are extracted from the @samp{From:@:} header. Some headers may contain a -descriptive title as in: - -@example -From:@: computer!speedy!doe (John Xavier-Doe -- Decent Hacker) -@end example - -Supercite knows which part of the @samp{From:@:} header is email address -and which part is author name, but in this case the string @code{"Decent -Hacker"} is not part of the author's name. You can tell Supercite to -ignore the title, while still recognizing hyphenated names through the -use of a regular expression in the variable @code{sc-titlecue-regexp}. -This variable has the default value of @code{"\\\\s +-+\\\\s +"}. Any -text after this regexp is encountered is ignored as noise. - -@vindex sc-name-filter-alist -@vindex name-filter-alist (sc-) -Some @samp{From:@:} headers may contain extra titles in the name fields -not separated by a title cue, but which are nonetheless not part of the -author's name proper. Examples include the titles ``Dr.'', ``Mr.'', -``Ms.'', ``Jr.'', ``Sr.'', and ``III'' (e.g., Thurston Howe, the Third). -Also, some companies prepend or append the name of the division, -organization, or project on the author's name. All of these titles are -noise which should be ignored. The variable @code{sc-name-filter-alist} -is used for this purpose. As implied by its name, this variable is an -association list, where each element is a cons cell of the form: - -@example -(@var{regexp} @. @var{position}) -@end example - -@noindent -where @var{regexp} is a regular expression that is matched (using -@code{string-match}) against each element of the @samp{From:@:} field's -author name. @var{position} is a position indicator, starting at zero. -Thus to strip out all titles of ``Dr.'', ``Mr.'', etc. from the name, -@code{sc-name-filter-alist} would have an entry such as: - -@example -("^\\(Mr\\|Mrs\\|Ms\\|Dr\\)[.]?$" @. 0) -@end example - -@noindent -which only removes them if they appear as the first word in the name. -The position indicator is an integer, or one of the two special symbols -@code{last} or @code{any}. @code{last} always matches against the last -word in the name field, while @code{any} matches against every word in -the name field. - -@node Configuring the Citation Engine, Using Regi, Author Names, Top -@comment node-name, next, previous, up -@cindex Regi -@cindex frames (Regi) -@cindex entries (Regi) -@chapter Configuring the Citation Engine -@ifinfo - -@end ifinfo -At the heart of Supercite is a regular expression interpreting engine -called @dfn{Regi}. Regi operates by interpreting a data structure -called a Regi-frame (or just @dfn{frame}), which is a list of -Regi-entries (or just @dfn{entry}). Each entry contains a predicate, -typically a regular expression, which is matched against a line of text -in the current buffer. If the predicate matches true, an associated -expression is @code{eval}uated. In this way, an entire region of text -can be transformed in an @emph{awk}-like manner. Regi is used -throughout Supercite, from mail header information extraction, to header -nuking, to citing text. - -@ifinfo -@menu -* Using Regi:: -* Frames You Can Customize:: -@end menu -@end ifinfo - -While the details of Regi are discussed below (@pxref{Using Regi}), only -those who wish to customize certain aspects of Supercite need concern -themselves with it. It is important to understand though, that any -conceivable citation style that can be described by a regular expression -can be recognized by Supercite. This leads to some interesting -applications. For example, if you regularly receive email from a -co-worker that uses an uncommon citation style (say one that employs a -@samp{|} or @samp{@}} character at the front of the line), it is -possible for Supercite to recognize this and @emph{coerce} the citation -to your preferred style, for consistency. In theory, it is possible for -Supercite to recognize such things as uuencoded messages or C code and -cite or fill those differently than normal text. None of this is -currently part of Supercite, but contributions are welcome! - -@node Using Regi, Frames You Can Customize, Configuring the Citation Engine, Configuring the Citation Engine -@comment node-name, next, previous, up -@findex regi-interpret -@findex eval -@findex looking-at -@section Using Regi -@ifinfo - -@end ifinfo -Regi works by interpreting frames with the function -@code{regi-interpret}. A frame is a list of arbitrary size where each -element is a entry of the following form: - -@example -(@var{pred} @var{func} [@var{negate-p} [@var{case-fold-search}]]) -@end example - -Regi starts with the first entry in a frame, evaluating the @var{pred} -of that entry against the beginning of the line that @samp{point} is on. -If the @var{pred} evaluates to true (or false if the optional -@var{negate-p} is non-@code{nil}), then the @var{func} for that entry is -@code{eval}uated. How processing continues is determined by the return -value for @var{func}, and is described below. If @var{pred} was false -the next entry in the frame is checked until all entries have been -matched against the current line. If no entry matches, @samp{point} is -moved forward one line and the frame is reset to the first entry. - -@var{pred} can be a string, a variable, a list or one of the following -symbols: @code{t}, @code{begin}, @code{end}, or @code{every}. If -@var{pred} is a string, or a variable or list that @code{eval}uates to a -string, it is interpreted as a regular expression. This regexp is -matched against the current line, from the beginning, using -@code{looking-at}. This match folds case if the optional -@var{case-fold-search} is non-@code{nil}. If @var{pred} is not a -string, or does not @code{eval}uate to a string, it is interpreted as a -binary value (@code{nil} or non-@code{nil}).@refill - -The four special symbol values for @var{pred} are recognized: - -@table @code -@item t -Always produces a true outcome. -@item begin -Always executed before the frame is interpreted. This can be used to -initialize some global variables for example. -@item end -Always executed after frame interpreting is completed. This can be used -to perform any necessary post-processing. -@item every -Executes whenever the frame is reset, usually after the entire frame has -been matched against the current line. -@end table - -Note that @var{negate-p} and @var{case-fold-search} are ignored if -@var{pred} is one of these special symbols. Only the first occurrence of -each symbol in a frame is used; any duplicates are ignored. Also -note that for performance reasons, the entries associated with these -symbols are removed from the frame during the main interpreting loop. - -Your @var{func} can return certain values which control continued Regi -processing. By default, if your @var{func} returns @code{nil} (as it -should be careful to do explicitly), Regi will reset the frame to the -first entry, and advance @samp{point} to the beginning of the next line. -If a list is returned from your function, it can contain any combination -of the following elements:@refill - -@table @asis -@item the symbol @code{continue} -This tells Regi to continue processing entries after a match, instead of -resetting the frame and moving @samp{point}. In this way, lines of text -can have multiple matches, but you have to be careful to avoid entering -infinite loops. - -@item the symbol @code{abort} -This tells Regi to terminate frame processing. However, any @code{end} -entry is still processed. - -@item the list @code{(frame . @var{newframe})} -This tells Regi to substitute @var{newframe} as the frame it is -interpreting. In other words, your @var{func} can modify the Regi frame -on the fly. @var{newframe} can be a variable containing a frame, or it -can be the frame in-lined.@refill - -@item the list @code{(step . @var{step})} -Tells Regi to move @var{step} number of lines forward as it continues -processing. By default, Regi moves forward one line. @var{step} can be -zero or negative of course, but watch out for infinite loops.@refill -@end table - -During execution of your @var{func}, the following variables will be -temporarily bound to some useful information:@refill - -@table @code -@item curline -The current line in the buffer that Regi is @code{looking-at}, as a string. -@item curframe -The current frame being interpreted. -@item curentry -The current frame entry being interpreted. -@end table - -@node Frames You Can Customize, Post-yank Formatting Commands, Using Regi, Configuring the Citation Engine -@comment node-name, next, previous, up -@vindex sc-nuke-mail-header -@section Frames You Can Customize -@ifinfo - -@end ifinfo -As mentioned earlier, Supercite uses various frames to perform -certain jobs such as mail header information extraction and mail header -nuking. However, these frames are not available for you to customize, -except through abstract interfaces such as @code{sc-nuke-mail-header}, -et al. - -@vindex sc-default-cite-frame -However, the citation frames Supercite uses provide a lot of customizing -power and are thus available to you to change to suit your needs. The -workhorse of citation is the frame contained in the variable -@code{sc-default-cite-frame}. This frame recognizes many situations, -such as blank lines, which it interprets as paragraph separators. It -also recognizes previously cited nested and non-nested citations in the -original message. By default it will coerce non-nested citations into -your preferred citation style, and it will add a level of citation to -nested citations. It will also simply cite uncited lines in your -preferred style. - -@cindex unciting -@cindex reciting -@vindex sc-default-uncite-frame -@vindex sc-default-recite-frame -In a similar vein, there are default frames for @dfn{unciting} and -@dfn{reciting}, contained in the variables -@code{sc-default-uncite-frame} and @code{sc-default-recite-frame} -respectively.@refill - -As mentioned earlier (@pxref{Recognizing Citations}), citations are -recognized through the values of the regular expressions -@code{sc-citation-root-regexp}, et al. To recognize odd styles, you -could modify these variables, or you could modify the default citing -frame. Alternatively, you could set up association lists of frames for -recognizing specific alternative forms. - -@vindex sc-cite-frame-alist -@vindex sc-uncite-frame-alist -@vindex sc-recite-frame-alist -For each of the actions -- citing, unciting, and reciting -- an alist is -consulted to find the frame to use (@code{sc-cite-frame-alist}, -@code{sc-uncite-frame-alist}, and @code{sc-recite-frame-alist} -respectively). These frames can contain alists of the form: - -@example -((@var{infokey} (@var{regexp} @. @var{frame}) (@var{regexp} @. @var{frame}) @dots{}) - (@var{infokey} (@var{regexp} @. @var{frame}) (@var{regexp} @. @var{frame}) @dots{}) - (@dots{})) -@end example - -@vindex sc-mail-field -@findex string-match -Where @var{infokey} is a key suitable for @code{sc-mail-field}, -@var{regexp} is a regular expression which is @code{string-match}'d -against the value of the @code{sc-mail-field} key, and @var{frame} is -the frame to use if a match occurred. @var{frame} can be a variable -containing a frame or a frame in-lined.@refill - -When Supercite is about to cite, uncite, or recite a region, it consults -the appropriate alist and attempts to find a frame to use. If one -is not found from the alist, then the appropriate default frame is used. - -@node Post-yank Formatting Commands, Citing Commands, Frames You Can Customize, Top -@comment node-name, next, previous, up -@vindex sc-mode-map-prefix -@vindex mode-map-prefix (sc-) -@kindex C-c C-p -@chapter Post-yank Formatting Commands -@ifinfo - -@end ifinfo -Once the original message has been yanked into the reply buffer, and -@code{sc-cite-original} has had a chance to do its thing, a number of -useful Supercite commands will be available to you. Since there is wide -variety in the keymaps that MUAs set up in their reply buffers, it is -next to impossible for Supercite to properly sprinkle its commands into -the existing keymap. For this reason Supercite places its commands on a -separate keymap, putting this keymap onto a prefix key in the reply -buffer. You can customize the prefix key Supercite uses by changing the -variable @code{sc-mode-map-prefix}. By default, the -@code{sc-mode-map-prefix} is @kbd{C-c C-p}; granted, not a great choice, -but unfortunately the best general solution so far. In the rest of this -chapter, we'll assume you've installed Supercite's keymap on the default -prefix.@refill - -@ifinfo -@menu -* Citing Commands:: -* Insertion Commands:: -* Variable Toggling Shortcuts:: -* Mail Field Commands:: -* Miscellaneous Commands:: -@end menu -@end ifinfo - -@node Citing Commands, Insertion Commands, Post-yank Formatting Commands, Post-yank Formatting Commands -@comment node-name, next, previous, up -@vindex sc-cite-region-limit -@section Commands to Manually Cite, Recite, and Uncite -@ifinfo - -@end ifinfo -Probably the three most common post-yank formatting operations that you -will perform will be the manual citing, reciting, and unciting of -regions of text in the reply buffer. Often you may want to recite a -paragraph to use a nickname, or manually cite a message when setting -@code{sc-cite-region-limit} to @code{nil}. The following commands -perform these functions on the region of text between @samp{point} and -@samp{mark}. Each of them sets the @dfn{undo boundary} before modifying -the region so that the command can be undone in the standard Emacs -way.@refill - -A quick note about Emacs 19. Unlike in Emacs 18, the region delimited -by @samp{point} and @samp{mark} can have two states. It can be -@dfn{active} or @dfn{inactive}. Although Emacs 19 and Lucid Emacs 19 -use different terminology and functions, both employ the same convention -such that when the region is inactive, commands that modify the region -should generate an error. The user needs to explicitly activate the -region before successfully executing the command. All Supercite -commands conform to this convention. - -Here is the list of Supercite citing commands: - -@table @asis -@findex sc-cite-region -@findex cite-region (sc-) -@kindex C-c C-p c -@vindex sc-pre-cite-hook -@vindex pre-cite-hook (sc-) -@vindex sc-confirm-always-p -@vindex confirm-always-p -@kindex C-u -@item @code{sc-cite-region} (@kbd{C-c C-p c}) -@comment -This command cites each line in the region of text by interpreting the -selected frame from @code{sc-cite-frame-alist}, or the default citing -frame @code{sc-default-cite-frame}. It runs the hook -@code{sc-pre-cite-hook} before interpreting the frame. With an optional -universal argument (@kbd{C-u}), it temporarily sets -@code{sc-confirm-always-p} to @code{t} so you can confirm the -attribution string for a single manual citing. -@xref{Configuring the Citation Engine}.@refill - -@findex sc-uncite-region -@findex uncite-region (sc-) -@kindex C-c C-p u -@item @code{sc-uncite-region} (@kbd{C-c C-p u}) -@comment -This command removes any citation strings from the beginning of each -cited line in the region by interpreting the selected frame from -@code{sc-uncite-frame-alist}, or the default unciting frame -@code{sc-default-uncite-frame}. It runs the hook -@code{sc-pre-uncite-hook} before interpreting the frame. -@xref{Configuring the Citation Engine}.@refill - -@findex sc-recite-region -@findex recite-region (sc-) -@kindex C-c C-p r -@item @code{sc-recite-region} (@kbd{C-c C-p r}) -@comment -This command recites each line the region by interpreting the selected -frame from @code{sc-recite-frame-alist}, or the default reciting frame -@code{sc-default-recite-frame}. It runs the hook -@code{sc-pre-recite-hook} before interpreting the frame. -@xref{Configuring the Citation Engine}.@refill - -@vindex sc-confirm-always-p -@vindex confirm-always-p (sc-) -Supercite will always ask you to confirm the attribution when reciting a -region, regardless of the value of @code{sc-confirm-always-p}. -@end table - -@node Insertion Commands, Variable Toggling Shortcuts, Citing Commands, Post-yank Formatting Commands -@comment node-name, next, previous, up -@section Insertion Commands -@ifinfo - -@end ifinfo -These two functions insert various strings into the reply buffer. - -@table @asis -@findex sc-insert-reference -@findex insert-reference (sc-) -@kindex C-c C-p w -@item @code{sc-insert-reference} (@kbd{C-c C-p w}) -@comment -@vindex sc-preferred-header-style -@vindex preferred-header-style (sc-) -Inserts a reference header into the reply buffer at @samp{point}. With -no arguments, the header indexed by @code{sc-preferred-header-style} is -inserted. An optional numeric argument is the index into -@code{sc-rewrite-header-list} indicating which reference header to -write.@refill - -With just the universal argument (@kbd{C-u}), electric reference mode is -entered, regardless of the value of @code{sc-electric-references-p}. - -@findex sc-insert-citation -@findex insert-citation (sc-) -@kindex C-c C-p i -@item @code{sc-insert-citation} (@kbd{C-c C-p i}) -@comment -Inserts the current citation string at the beginning of the line that -@samp{point} is on. If the line is already cited, Supercite will issue -an error and will not cite the line. -@end table - -@node Variable Toggling Shortcuts, Mail Field Commands, Insertion Commands, Post-yank Formatting Commands -@comment node-name, next, previous, up -@cindex toggling variables -@section Variable Toggling Shortcuts -@ifinfo - -@end ifinfo -Supercite defines a number of commands that make it easier for you to -toggle and set various Supercite variables as you are editing the reply -buffer. For example, you may want to turn off filling or whitespace -cleanup, but only temporarily. These toggling shortcut commands make -this easy to do. - -@kindex C-c C-p C-t -Like Supercite commands in general, the toggling commands are placed on -a keymap prefix within the greater Supercite keymap. For the default -value of @code{sc-mode-map-prefix}, this will be -@kbd{C-c C-p C-t}.@refill - -The following commands toggle the value of certain Supercite variables -which take only a binary value: - -@table @kbd -@item C-c C-p C-t b -Toggles the variable @code{sc-mail-nuke-blank-lines-p}. - -@item C-c C-p C-t c -Toggles the variable @code{sc-confirm-always-p}. - -@item C-c C-p C-t d -Toggles the variable @code{sc-downcase-p}. - -@item C-c C-p C-t e -Toggles the variable @code{sc-electric-references-p}. - -@item C-c C-p C-t f -Toggles the variable @code{sc-auto-fill-region-p}. - -@item C-c C-p C-t o -Toggles the variable @code{sc-electric-circular-p}. - -@item C-c C-p C-t s -Toggles the variable @code{sc-nested-citation-p}. - -@item C-c C-p C-t u -Toggles the variable @code{sc-use-only-preferences-p}. - -@item C-c C-p C-t w -Toggles the variable @code{sc-fixup-whitespace-p}. -@end table - -@findex set-variable -The following commands let you set the value of multi-value variables, -in the same way that Emacs' @code{set-variable} does: - -@table @kbd -@item C-c C-p C-t a -Sets the value of the variable @code{sc-preferred-attribution-list}. - -@item C-c C-p C-t l -Sets the value of the variable @code{sc-cite-region-limit}. - -@item C-c C-p C-t n -Sets the value of the variable @code{sc-mail-nuke-mail-headers}. - -@item C-c C-p C-t N -Sets the value of the variable @code{sc-mail-header-nuke-list}. - -@item C-c C-p C-t p -Sets the value of the variable @code{sc-preferred-header-style}. -@end table - -@kindex C-c C-p C-p -One special command is provided to toggle both -@code{sc-auto-fill-region-p} and @code{sc-fixup-whitespace-p} together. -This is because you typically want to run Supercite with either variable -as @code{nil} or non-@code{nil}. The command to toggle these variables -together is bound on @kbd{C-c C-p C-p}.@refill - -Finally, the command @kbd{C-c C-p C-t h} (also @kbd{C-c C-p C-t ?}) -brings up a Help message on the toggling keymap. - - -@node Mail Field Commands, Miscellaneous Commands, Variable Toggling Shortcuts, Post-yank Formatting Commands -@comment node-name, next, previous, up -@section Mail Field Commands -@ifinfo - -@end ifinfo -These commands allow you to view, modify, add, and delete various bits -of information from the info alist. -@xref{Information Keys and the Info Alist}.@refill - -@table @asis -@kindex C-c C-p f -@findex sc-mail-field-query -@findex mail-field-query (sc-) -@kindex C-c C-p f -@item @code{sc-mail-field-query} (@kbd{C-c C-p f}) -@comment -Allows you to interactively view, modify, add, and delete info alist -key-value pairs. With no argument, you are prompted (with completion) -for a info key. The value associated with that key is displayed in the -minibuffer. With an argument, this command will first ask if you want -to view, modify, add, or delete an info key. Viewing is identical to -running the command with no arguments. - -If you want to modify the value of a key, Supercite will first prompt -you (with completion) for the key of the value you want to change. It -will then put you in the minibuffer with the key's current value so you -can edit the value as you wish. When you hit @key{RET}, the key's value -is changed. For those of you running Emacs 19, minibuffer history is -kept for the values. - -If you choose to delete a key-value pair, Supercite will prompt you (with -completion) for the key to delete. - -If you choose to add a new key-value pair, Supercite firsts prompts you -for the key to add. Note that completion is turned on for this prompt, -but you can type any key name here, even one that does not yet exist. -After entering the key, Supercite prompts you for the key's value. It -is not an error to enter a key that already exists, but the new value -will override any old value. It will not replace it though; if you -subsequently delete the key-value pair, the old value will reappear. - -@findex sc-mail-process-headers -@findex mail-process-headers (sc-) -@kindex C-c C-p g -@item @code{sc-mail-process-headers} (@kbd{C-c C-p g}) -@comment -This command lets you re-initialize Supercite's info alist from any set -of mail headers in the region between @samp{point} and @samp{mark}. -This function is especially useful for replying to digest messages where -Supercite will initially set up its information for the digest -originator, but you want to cite each component article with the real -message author. Note that unless an error during processing occurs, any -old information is lost.@refill -@end table - -@node Miscellaneous Commands, Information Keys and the Info Alist, Mail Field Commands, Post-yank Formatting Commands -@comment node-name, next, previous, up -@section Miscellaneous Commands -@ifinfo - -@end ifinfo -@table @asis -@findex sc-open-line -@findex open-line (sc-) -@findex open-line -@kindex C-c C-p o -@item @code{sc-open-line} (@kbd{C-c C-p o}) -@comment -Similar to Emacs' standard @code{open-line} commands, but inserts the -citation string in front of the new line. As with @code{open-line}, -an optional numeric argument inserts that many new lines.@refill - -@findex sc-describe -@findex describe (sc-) -@kindex C-c C-p ? -@kindex C-c C-p h -@item @code{sc-describe} (@kbd{C-c C-p h} and @kbd{C-c C-p ?}) -@comment -This function has been obsoleted by the @TeX{}info manual you are now -reading. It is still provided for compatibility, but it will eventually -go away. - -@findex sc-version -@findex version (sc-) -@kindex C-c C-p v -@item @code{sc-version} (@kbd{C-c C-p v}) -@comment -Echos the version of Supercite you are using. With the optional -universal argument (@kbd{C-u}), this command inserts the version -information into the current buffer. - -@findex sc-submit-bug-report -@findex submit-bug-report (sc-) -@kindex C-c C-p C-b -@item @code{sc-submit-bug-report} (@kbd{C-c C-p C-b}) -@comment -If you encounter a bug, or wish to suggest an enhancement, use this -command to set up an outgoing mail buffer, with the proper address to -the Supercite maintainer automatically inserted in the @samp{To:@:} -field. This command also inserts information that the Supercite -maintainer can use to recreate your exact setup, making it easier to -verify your bug. -@end table - -@node Hints to MUA Authors, Version 3 Changes, Electric References, Top -@comment node-name, next, previous, up -@chapter Hints to MUA Authors -@ifinfo - -@end ifinfo -In June of 1989, some discussion was held between the various MUA -authors, the Supercite author, and other Supercite users. These -discussions centered around the need for a standard interface between -MUAs and Supercite (or any future Supercite-like packages). This -interface was formally proposed by Martin Neitzel on Fri, 23 Jun 89, in -a mail message to the Supercite mailing list: - -@example - Martin> Each news/mail-reader should provide a form of - Martin> mail-yank-original that - - Martin> 1: inserts the original message incl. header into the - Martin> reply buffer; no indentation/prefixing is done, the header - Martin> tends to be a "full blown" version rather than to be - Martin> stripped down. - - Martin> 2: `point' is at the start of the header, `mark' at the - Martin> end of the message body. - - Martin> 3: (run-hooks 'mail-yank-hooks) - - Martin> [Supercite] should be run as such a hook and merely - Martin> rewrite the message. This way it isn't anymore - Martin> [Supercite]'s job to gather the original from obscure - Martin> sources. [@dots{}] -@end example - -@vindex mail-citation-hook -@vindex mail-yank-hooks -@cindex sendmail.el -@findex mail-yank-original -@findex defvar -This specification was adopted, but with the recent release of -Emacs 19, it has undergone a slight modification. Instead of the -variable @code{mail-yank-hooks}, the new preferred hook variable that -the MUA should provide is @code{mail-citation-hook}. -@code{mail-yank-hooks} can be provided for backward compatibility, but -@code{mail-citation-hook} should always take precedence. Richard -Stallman (of the FSF) suggests that the MUAs should @code{defvar} -@code{mail-citation-hook} to @code{nil} and perform some default citing -when that is the case. Take a look at Emacs 19's @file{sendmail.el} -file, specifically the @code{mail-yank-original} defun for -details.@refill - -If you are writing a new MUA package, or maintaining an existing MUA -package, you should make it conform to this interface so that your users -will be able to link Supercite easily and seamlessly. To do this, when -setting up a reply or forward buffer, your MUA should follow these -steps: - -@enumerate -@item -Insert the original message, including the mail headers into the reply -buffer. At this point you should not modify the raw text in any way, and -you should place all the original headers into the body of the reply. -This means that many of the mail headers will be duplicated, one copy -above the @code{mail-header-separator} line and one copy below, -however there will probably be more headers below this line.@refill - -@item -Set @samp{point} to the beginning of the line containing the first mail -header in the body of the reply. Set @samp{mark} at the end of the -message text. It is very important that the region be set around the -text Supercite is to modify and that the mail headers are within this -region. Supercite will not venture outside the region for any reason, -and anything within the region is fair game, so don't put anything that -@strong{must} remain unchanged inside the region. Further note that for -Emacs 19, the region need not be set active. Supercite will work -properly when the region is inactive, as should any other like-minded -package.@refill - -@item -Run the hook @code{mail-citation-hook}. You will probably want to -provide some kind of default citation functions in cases where the user -does not have Supercite installed. By default, your MUA should -@code{defvar} @code{mail-citation-hook} to @code{nil}, and in your -yanking function, check its value. If it finds -@code{mail-citation-hook} to be @code{nil}, it should perform some -default citing behavior. User who want to connect to Supercite then -need only add @code{sc-cite-original} to this list of hooks using -@code{add-hook}.@refill -@end enumerate - -If you do all this, your users will not need to overload your routines -to use Supercite, and your MUA will join the ranks of those that conform -to this interface ``out of the box.'' - -@node Version 3 Changes, Thanks and History, Hints to MUA Authors, Top -@comment node-name, next, previous, up -@chapter Version 3 Changes -@ifinfo - -@end ifinfo -@cindex sc-unsupp.el file -With version 3, Supercite has undergone an almost complete rewrite, and -has hopefully benefited in a number of ways, including vast -improvements in the speed of performance, a big reduction in size of the -code and in the use of Emacs resources, and a much cleaner and flexible -internal architecture. The central construct of the info alist, and its -role in Supercite has been expanded, and the other central concept, the -general package Regi, was developed to provide a theoretically unlimited -flexibility. - -But most of this work is internal and not of very great importance to the -casual user. There have been some changes at the user-visible level, -but for the most part, the Supercite configuration variables from -version 2 should still be relevant to version 3. Below, I briefly -outline those user-visible things that have changed since version 2. For -details, look to other sections of this manual. - -@enumerate -@item -@cindex supercite.el file -@cindex reporter.el file -@cindex regi.el file -@cindex sc.el from version 2 -@cindex sc-elec.el from version 2 -Supercite proper now comes in a single file, @file{supercite.el}, which -contains everything except the unsupported noodlings, overloading (which -should be more or less obsolete with the release of Emacs 19), and the -general lisp packages @file{reporter.el} and @file{regi.el}. Finally, -the @TeX{}info manual comes in its own file as well. In particular, the -file @file{sc.el} from the version 2 distribution is obsolete, as is the -file @file{sc-elec.el}. - -@item -@code{sc-spacify-name-chars} is gone in version 3. - -@item -@vindex sc-attrib-selection-list -@vindex attrib-selection-list -@code{sc-nickname-alist} is gone in version 3. The -@code{sc-attrib-selection-list} is a more general construct supporting -the same basic feature. - -@item -The version 2 variable @code{sc-preferred-attribution} has been changed -to @code{sc-preferred-attribution-list}, and has been expanded upon to -allow you to specify an ordered list of preferred attributions. - -@item -@code{sc-mail-fields-list} has been removed, and header nuking in -general has been greatly improved, giving you wider flexibility in -specifying which headers to keep and remove while presenting a -simplified interface to commonly chosen defaults. - -@item -Post-yank paragraph filling has been completely removed from Supercite, -other packages just do it better than Supercite ever would. Supercite -will still fill newly cited paragraphs. - -@item -@vindex sc-cite-region-limit -@vindex cite-region-limit -The variable @code{sc-all-but-cite-p} has been replaced by -@code{sc-cite-region-limit}. - -@item -Keymap hacking in the reply buffer has been greatly simplified, with, I -believe, little reduction in functionality. - -@item -Hacking of the reply buffer's docstring has been completely eliminated. -@end enumerate - -@node Thanks and History, The Supercite Mailing List, Version 3 Changes, Top -@comment node-name, next, previous, up -@chapter Thanks and History -@ifinfo - -@end ifinfo -The Supercite package was derived from its predecessor Superyank 1.11 -which was inspired by various bits of code and ideas from Martin Neitzel -and Ashwin Ram. They were the folks who came up with the idea of -non-nested citations and implemented some rough code to provide this -style. Superyank and Supercite version 2 evolved to the point where much -of the attribution selection mechanism was automatic, and features have -been continuously added through the comments and suggestions of the -Supercite mailing list participants. Supercite version 3 represents a -nearly complete rewrite with many of the algorithms and coding styles -being vastly improved. Hopefully Supercite version 3 is faster, -smaller, and much more flexible than its predecessors. - -In the version 2 manual I thanked some specific people for their help in -developing Supercite 2. You folks know who you are and your continued -support is greatly appreciated. I wish to thank everyone on the -Supercite mailing list, especially the brave alpha testers, who helped -considerably in testing out the concepts and implementation of Supercite -version 3. Special thanks go out to the MUA and Emacs authors Kyle -Jones, Stephen Gildea, Richard Stallman, and Jamie Zawinski for coming -to a quick agreement on the new @code{mail-citation-hook} interface, and -for adding the magic lisp to their code to support this. - -All who have helped and contributed have been greatly appreciated. - -@node The Supercite Mailing List, GNU Free Documentation License, Thanks and History, Top -@comment node-name, next, previous, up -@cindex supercite mailing list address -@cindex mailing list address -@chapter The Supercite Mailing List -@ifinfo - -@end ifinfo -The author runs a simple mail expanding mailing list for discussion of -issues related to Supercite. This includes enhancement requests, bug -reports, general help questions, etc. To subscribe or unsubscribe to -the mailing list, send a request to the administrative address: - -@example -supercite-request@@python.org -@end example - -Please be sure to include the most reliable and shortest (preferably -Internet) address back to you. To post articles to the list, send your -message to this address (you do not need to be a member to post, but be -sure to indicate this in your article or replies may not be CC'd to -you): - -@example -supercite@@python.org -@end example - -If you are sending bug reports, they should go to the following address, -but @emph{please}! use the command @code{sc-submit-bug-report} since it -will be much easier for me to duplicate your problem if you do so. It -will set up a mail buffer automatically with this address on the -@samp{To:@:} line: - -@example -supercite-help@@python.org -@end example - -@node GNU Free Documentation License, Concept Index, The Supercite Mailing List, Top -@appendix GNU Free Documentation License -@include doclicense.texi - -@node Concept Index, Command Index, GNU Free Documentation License, Top -@comment node-name, next, previous, up -@unnumbered Concept Index -@printindex cp - -@node Command Index, Key Index, Concept Index, Top -@comment node-name, next, previous, up -@unnumbered Command Index -@ifinfo - -@end ifinfo -Since all supercite commands are prepended with the string -``@code{sc-}'', each appears under its @code{sc-}@var{command} name and -its @var{command} name. -@iftex -@sp 2 -@end iftex -@printindex fn - -@node Key Index, Variable Index, Command Index, Top -@comment node-name, next, previous, up -@unnumbered Key Index -@printindex ky - -@node Variable Index, , Key Index, Top -@comment node-name, next, previous, up -@unnumbered Variable Index -@ifinfo - -@end ifinfo -Since all supercite variables are prepended with the string -``@code{sc-}'', each appears under its @code{sc-}@var{variable} name and -its @var{variable} name. -@iftex -@sp 2 -@end iftex -@printindex vr -@setchapternewpage odd -@summarycontents -@contents -@bye - -@ignore - arch-tag: 0521847a-4680-44b6-ae6e-13ce20e18436 -@end ignore diff --git a/man/search.texi b/man/search.texi deleted file mode 100644 index 1a8a6372ba2..00000000000 --- a/man/search.texi +++ /dev/null @@ -1,1361 +0,0 @@ -@c This is part of the Emacs manual. -@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001, 2002, -@c 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. -@c See file emacs.texi for copying conditions. -@node Search, Fixit, Display, Top -@chapter Searching and Replacement -@cindex searching -@cindex finding strings within text - - Like other editors, Emacs has commands for searching for occurrences of -a string. The principal search command is unusual in that it is -@dfn{incremental}; it begins to search before you have finished typing the -search string. There are also nonincremental search commands more like -those of other editors. - - Besides the usual @code{replace-string} command that finds all -occurrences of one string and replaces them with another, Emacs has a -more flexible replacement command called @code{query-replace}, which -asks interactively which occurrences to replace. There are also -commands to find and operate on all matches for a pattern. - - You can also search multiple files under control of a tags -table (@pxref{Tags Search}) or through the Dired @kbd{A} command -(@pxref{Operating on Files}), or ask the @code{grep} program to do it -(@pxref{Grep Searching}). - - -@menu -* Incremental Search:: Search happens as you type the string. -* Nonincremental Search:: Specify entire string and then search. -* Word Search:: Search for sequence of words. -* Regexp Search:: Search for match for a regexp. -* Regexps:: Syntax of regular expressions. -* Regexp Backslash:: Regular expression constructs starting with `\'. -* Regexp Example:: A complex regular expression explained. -* Search Case:: To ignore case while searching, or not. -* Replace:: Search, and replace some or all matches. -* Other Repeating Search:: Operating on all matches for some regexp. -@end menu - -@node Incremental Search -@section Incremental Search -@cindex incremental search -@cindex isearch - - An incremental search begins searching as soon as you type the first -character of the search string. As you type in the search string, Emacs -shows you where the string (as you have typed it so far) would be -found. When you have typed enough characters to identify the place you -want, you can stop. Depending on what you plan to do next, you may or -may not need to terminate the search explicitly with @key{RET}. - -@table @kbd -@item C-s -Incremental search forward (@code{isearch-forward}). -@item C-r -Incremental search backward (@code{isearch-backward}). -@end table - -@menu -* Basic Isearch:: Basic incremental search commands. -* Repeat Isearch:: Searching for the same string again. -* Error in Isearch:: When your string is not found. -* Special Isearch:: Special input in incremental search. -* Non-ASCII Isearch:: How to search for non-ASCII characters. -* Isearch Yank:: Commands that grab text into the search string - or else edit the search string. -* Highlight Isearch:: Isearch highlights the other possible matches. -* Isearch Scroll:: Scrolling during an incremental search. -* Slow Isearch:: Incremental search features for slow terminals. -@end menu - -@node Basic Isearch -@subsection Basics of Incremental Search - -@kindex C-s -@findex isearch-forward - @kbd{C-s} starts a forward incremental search. It reads characters -from the keyboard, and moves point past the next occurrence of those -characters. If you type @kbd{C-s} and then @kbd{F}, that puts the -cursor after the first @samp{F} (the first following the starting point, since -this is a forward search). Then if you type an @kbd{O}, you will see -the cursor move to just after the first @samp{FO} (the @samp{F} in that -@samp{FO} may or may not be the first @samp{F}). After another -@kbd{O}, the cursor moves to just after the first @samp{FOO} after the place -where you started the search. At each step, the buffer text that -matches the search string is highlighted, if the terminal can do that; -the current search string is always displayed in the echo area. - - If you make a mistake in typing the search string, you can cancel -characters with @key{DEL}. Each @key{DEL} cancels the last character of -search string. This does not happen until Emacs is ready to read another -input character; first it must either find, or fail to find, the character -you want to erase. If you do not want to wait for this to happen, use -@kbd{C-g} as described below. - - When you are satisfied with the place you have reached, you can type -@key{RET}, which stops searching, leaving the cursor where the search -brought it. Also, any command not specially meaningful in searches -stops the searching and is then executed. Thus, typing @kbd{C-a} -would exit the search and then move to the beginning of the line. -@key{RET} is necessary only if the next command you want to type is a -printing character, @key{DEL}, @key{RET}, or another character that is -special within searches (@kbd{C-q}, @kbd{C-w}, @kbd{C-r}, @kbd{C-s}, -@kbd{C-y}, @kbd{M-y}, @kbd{M-r}, @kbd{M-c}, @kbd{M-e}, and some other -meta-characters). - - When you exit the incremental search, it sets the mark where point -@emph{was} before the search. That is convenient for moving back -there. In Transient Mark mode, incremental search sets the mark -without activating it, and does so only if the mark is not already -active. - -@node Repeat Isearch -@subsection Repeating Incremental Search - - Sometimes you search for @samp{FOO} and find one, but not the one you -expected to find. There was a second @samp{FOO} that you forgot -about, before the one you were aiming for. In this event, type -another @kbd{C-s} to move to the next occurrence of the search string. -You can repeat this any number of times. If you overshoot, you can -cancel some @kbd{C-s} characters with @key{DEL}. - - After you exit a search, you can search for the same string again by -typing just @kbd{C-s C-s}: the first @kbd{C-s} is the key that invokes -incremental search, and the second @kbd{C-s} means ``search again.'' - - If a search is failing and you ask to repeat it by typing another -@kbd{C-s}, it starts again from the beginning of the buffer. -Repeating a failing reverse search with @kbd{C-r} starts again from -the end. This is called @dfn{wrapping around}, and @samp{Wrapped} -appears in the search prompt once this has happened. If you keep on -going past the original starting point of the search, it changes to -@samp{Overwrapped}, which means that you are revisiting matches that -you have already seen. - - To reuse earlier search strings, use the @dfn{search ring}. The -commands @kbd{M-p} and @kbd{M-n} move through the ring to pick a search -string to reuse. These commands leave the selected search ring element -in the minibuffer, where you can edit it. To edit the current search -string in the minibuffer without replacing it with items from the -search ring, type @kbd{M-e}. Type @kbd{C-s} or @kbd{C-r} -to terminate editing the string and search for it. - - You can change to searching backwards with @kbd{C-r}. For instance, -if you are searching forward but you realize you were looking for -something above the starting point, you can do this. Repeated -@kbd{C-r} keeps looking for more occurrences backwards. A @kbd{C-s} -starts going forwards again. @kbd{C-r} in a search can be canceled -with @key{DEL}. - -@kindex C-r -@findex isearch-backward - If you know initially that you want to search backwards, you can use -@kbd{C-r} instead of @kbd{C-s} to start the search, because @kbd{C-r} -as a key runs a command (@code{isearch-backward}) to search backward. -A backward search finds matches that end before the starting point, -just as a forward search finds matches that begin after it. - -@node Error in Isearch -@subsection Errors in Incremental Search - - If your string is not found at all, the echo area says @samp{Failing -I-Search}. The cursor is after the place where Emacs found as much of your -string as it could. Thus, if you search for @samp{FOOT}, and there is no -@samp{FOOT}, you might see the cursor after the @samp{FOO} in @samp{FOOL}. -At this point there are several things you can do. If your string was -mistyped, you can rub some of it out and correct it. If you like the place -you have found, you can type @key{RET} or some other Emacs command to -remain there. Or you can type @kbd{C-g}, which -removes from the search string the characters that could not be found (the -@samp{T} in @samp{FOOT}), leaving those that were found (the @samp{FOO} in -@samp{FOOT}). A second @kbd{C-g} at that point cancels the search -entirely, returning point to where it was when the search started. - -@cindex quitting (in search) - The @kbd{C-g} ``quit'' character does special things during searches; -just what it does depends on the status of the search. If the search has -found what you specified and is waiting for input, @kbd{C-g} cancels the -entire search. The cursor moves back to where you started the search. If -@kbd{C-g} is typed when there are characters in the search string that have -not been found---because Emacs is still searching for them, or because it -has failed to find them---then the search string characters which have not -been found are discarded from the search string. With them gone, the -search is now successful and waiting for more input, so a second @kbd{C-g} -will cancel the entire search. - -@node Special Isearch -@subsection Special Input for Incremental Search - - An upper-case letter in the search string makes the search -case-sensitive. If you delete the upper-case character from the search -string, it ceases to have this effect. @xref{Search Case}. - - To search for a newline, type @kbd{C-j}. To search for another -control character, such as control-S or carriage return, you must quote -it by typing @kbd{C-q} first. This function of @kbd{C-q} is analogous -to its use for insertion (@pxref{Inserting Text}): it causes the -following character to be treated the way any ``ordinary'' character is -treated in the same context. You can also specify a character by its -octal code: enter @kbd{C-q} followed by a sequence of octal digits. - - @kbd{M-%} typed in incremental search invokes @code{query-replace} -or @code{query-replace-regexp} (depending on search mode) with the -current search string used as the string to replace. @xref{Query -Replace}. - - Entering @key{RET} when the search string is empty launches -nonincremental search (@pxref{Nonincremental Search}). - -@vindex isearch-mode-map - To customize the special characters that incremental search understands, -alter their bindings in the keymap @code{isearch-mode-map}. For a list -of bindings, look at the documentation of @code{isearch-mode} with -@kbd{C-h f isearch-mode @key{RET}}. - -@node Non-ASCII Isearch -@subsection Isearch for Non-@acronym{ASCII} Characters -@cindex searching for non-@acronym{ASCII} characters -@cindex input method, during incremental search - - To enter non-@acronym{ASCII} characters in an incremental search, -you can use @kbd{C-q} (see the previous section), but it is easier to -use an input method (@pxref{Input Methods}). If an input method is -enabled in the current buffer when you start the search, you can use -it in the search string also. Emacs indicates that by including the -input method mnemonic in its prompt, like this: - -@example -I-search [@var{im}]: -@end example - -@noindent -@findex isearch-toggle-input-method -@findex isearch-toggle-specified-input-method -where @var{im} is the mnemonic of the active input method. - - You can toggle (enable or disable) the input method while you type -the search string with @kbd{C-\} (@code{isearch-toggle-input-method}). -You can turn on a certain (non-default) input method with @kbd{C-^} -(@code{isearch-toggle-specified-input-method}), which prompts for the -name of the input method. The input method you enable during -incremental search remains enabled in the current buffer afterwards. - -@node Isearch Yank -@subsection Isearch Yanking - - The characters @kbd{C-w} and @kbd{C-y} can be used in incremental -search to grab text from the buffer into the search string. This -makes it convenient to search for another occurrence of text at point. -@kbd{C-w} copies the character or word after point as part of the -search string, advancing point over it. (The decision, whether to -copy a character or a word, is heuristic.) Another @kbd{C-s} to -repeat the search will then search for a string including that -character or word. - - @kbd{C-y} is similar to @kbd{C-w} but copies all the rest of the -current line into the search string. If point is already at the end -of a line, it grabs the entire next line. Both @kbd{C-y} and -@kbd{C-w} convert the text they copy to lower case if the search is -currently not case-sensitive; this is so the search remains -case-insensitive. - - @kbd{C-M-w} and @kbd{C-M-y} modify the search string by only one -character at a time: @kbd{C-M-w} deletes the last character from the -search string and @kbd{C-M-y} copies the character after point to the -end of the search string. An alternative method to add the character -after point into the search string is to enter the minibuffer by -@kbd{M-e} and to type @kbd{C-f} at the end of the search string in the -minibuffer. - - The character @kbd{M-y} copies text from the kill ring into the search -string. It uses the same text that @kbd{C-y} as a command would yank. -@kbd{Mouse-2} in the echo area does the same. -@xref{Yanking}. - -@node Highlight Isearch -@subsection Lazy Search Highlighting -@cindex lazy search highlighting -@vindex isearch-lazy-highlight - - When you pause for a little while during incremental search, it -highlights all other possible matches for the search string. This -makes it easier to anticipate where you can get to by typing @kbd{C-s} -or @kbd{C-r} to repeat the search. The short delay before highlighting -other matches helps indicate which match is the current one. -If you don't like this feature, you can turn it off by setting -@code{isearch-lazy-highlight} to @code{nil}. - -@cindex faces for highlighting search matches - You can control how this highlighting looks by customizing the faces -@code{isearch} (used for the current match) and @code{lazy-highlight} -(for all the other matches). - -@node Isearch Scroll -@subsection Scrolling During Incremental Search - - You can enable the use of vertical scrolling during incremental -search (without exiting the search) by setting the customizable -variable @code{isearch-allow-scroll} to a non-@code{nil} value. This -applies to using the vertical scroll-bar and to certain keyboard -commands such as @kbd{@key{PRIOR}} (@code{scroll-down}), -@kbd{@key{NEXT}} (@code{scroll-up}) and @kbd{C-l} (@code{recenter}). -You must run these commands via their key sequences to stay in the -search---typing @kbd{M-x} will terminate the search. You can give -prefix arguments to these commands in the usual way. - - This feature won't let you scroll the current match out of visibility, -however. - - The feature also affects some other commands, such as @kbd{C-x 2} -(@code{split-window-vertically}) and @kbd{C-x ^} -(@code{enlarge-window}) which don't exactly scroll but do affect where -the text appears on the screen. In general, it applies to any command -whose name has a non-@code{nil} @code{isearch-scroll} property. So you -can control which commands are affected by changing these properties. - - For example, to make @kbd{C-h l} usable within an incremental search -in all future Emacs sessions, use @kbd{C-h c} to find what command it -runs. (You type @kbd{C-h c C-h l}; it says @code{view-lossage}.) -Then you can put the following line in your @file{.emacs} file -(@pxref{Init File}): - -@example -(put 'view-lossage 'isearch-scroll t) -@end example - -@noindent -This feature can be applied to any command that doesn't permanently -change point, the buffer contents, the match data, the current buffer, -or the selected window and frame. The command must not itself attempt -an incremental search. - -@node Slow Isearch -@subsection Slow Terminal Incremental Search - - Incremental search on a slow terminal uses a modified style of display -that is designed to take less time. Instead of redisplaying the buffer at -each place the search gets to, it creates a new single-line window and uses -that to display the line that the search has found. The single-line window -comes into play as soon as point moves outside of the text that is already -on the screen. - - When you terminate the search, the single-line window is removed. -Emacs then redisplays the window in which the search was done, to show -its new position of point. - -@vindex search-slow-speed - The slow terminal style of display is used when the terminal baud rate is -less than or equal to the value of the variable @code{search-slow-speed}, -initially 1200. See also the discussion of the variable @code{baud-rate} -(@pxref{baud-rate,, Customization of Display}). - -@vindex search-slow-window-lines - The number of lines to use in slow terminal search display is controlled -by the variable @code{search-slow-window-lines}. Its normal value is 1. - -@node Nonincremental Search -@section Nonincremental Search -@cindex nonincremental search - - Emacs also has conventional nonincremental search commands, which require -you to type the entire search string before searching begins. - -@table @kbd -@item C-s @key{RET} @var{string} @key{RET} -Search for @var{string}. -@item C-r @key{RET} @var{string} @key{RET} -Search backward for @var{string}. -@end table - - To do a nonincremental search, first type @kbd{C-s @key{RET}}. This -enters the minibuffer to read the search string; terminate the string -with @key{RET}, and then the search takes place. If the string is not -found, the search command signals an error. - - When you type @kbd{C-s @key{RET}}, the @kbd{C-s} invokes incremental -search as usual. That command is specially programmed to invoke -nonincremental search, @code{search-forward}, if the string you -specify is empty. (Such an empty argument would otherwise be -useless.) But it does not call @code{search-forward} right away. First -it checks the next input character to see if is @kbd{C-w}, -which specifies a word search. -@ifnottex -@xref{Word Search}. -@end ifnottex -@kbd{C-r @key{RET}} does likewise, for a reverse incremental search. - -@findex search-forward -@findex search-backward - Forward and backward nonincremental searches are implemented by the -commands @code{search-forward} and @code{search-backward}. These -commands may be bound to keys in the usual manner. The feature that you -can get to them via the incremental search commands exists for -historical reasons, and to avoid the need to find separate key sequences -for them. - -@node Word Search -@section Word Search -@cindex word search - - Word search searches for a sequence of words without regard to how the -words are separated. More precisely, you type a string of many words, -using single spaces to separate them, and the string can be found even -if there are multiple spaces, newlines, or other punctuation characters -between these words. - - Word search is useful for editing a printed document made with a text -formatter. If you edit while looking at the printed, formatted version, -you can't tell where the line breaks are in the source file. With word -search, you can search without having to know them. - -@table @kbd -@item C-s @key{RET} C-w @var{words} @key{RET} -Search for @var{words}, ignoring details of punctuation. -@item C-r @key{RET} C-w @var{words} @key{RET} -Search backward for @var{words}, ignoring details of punctuation. -@end table - - Word search as a special case of nonincremental search is invoked -with @kbd{C-s @key{RET} C-w}. This is followed by the search string, -which must always be terminated with @key{RET}. Being nonincremental, -this search does not start until the argument is terminated. It works -by constructing a regular expression and searching for that; see -@ref{Regexp Search}. - - Use @kbd{C-r @key{RET} C-w} to do backward word search. - - You can also invoke word search with @kbd{C-s M-e C-w} or @kbd{C-r -M-e C-w} followed by the search string and terminated with @key{RET}, -@kbd{C-s} or @kbd{C-r}. This puts word search into incremental mode -where you can use all keys available for incremental search. However, -when you type more words in incremental word search, it will fail -until you type complete words. - -@findex word-search-forward -@findex word-search-backward - Forward and backward word searches are implemented by the commands -@code{word-search-forward} and @code{word-search-backward}. These -commands may be bound to keys in the usual manner. They are available -via the incremental search commands both for historical reasons and -to avoid the need to find separate key sequences for them. - -@node Regexp Search -@section Regular Expression Search -@cindex regular expression -@cindex regexp - - A @dfn{regular expression} (@dfn{regexp}, for short) is a pattern -that denotes a class of alternative strings to match, possibly -infinitely many. GNU Emacs provides both incremental and -nonincremental ways to search for a match for a regexp. The syntax of -regular expressions is explained in the following section. - -@kindex C-M-s -@findex isearch-forward-regexp -@kindex C-M-r -@findex isearch-backward-regexp - Incremental search for a regexp is done by typing @kbd{C-M-s} -(@code{isearch-forward-regexp}), by invoking @kbd{C-s} with a -prefix argument (whose value does not matter), or by typing @kbd{M-r} -within a forward incremental search. This command reads a -search string incrementally just like @kbd{C-s}, but it treats the -search string as a regexp rather than looking for an exact match -against the text in the buffer. Each time you add text to the search -string, you make the regexp longer, and the new regexp is searched -for. To search backward for a regexp, use @kbd{C-M-r} -(@code{isearch-backward-regexp}), @kbd{C-r} with a prefix argument, -or @kbd{M-r} within a backward incremental search. - - All of the control characters that do special things within an -ordinary incremental search have the same function in incremental regexp -search. Typing @kbd{C-s} or @kbd{C-r} immediately after starting the -search retrieves the last incremental search regexp used; that is to -say, incremental regexp and non-regexp searches have independent -defaults. They also have separate search rings that you can access with -@kbd{M-p} and @kbd{M-n}. - -@vindex search-whitespace-regexp - If you type @key{SPC} in incremental regexp search, it matches any -sequence of whitespace characters, including newlines. If you want to -match just a space, type @kbd{C-q @key{SPC}}. You can control what a -bare space matches by setting the variable -@code{search-whitespace-regexp} to the desired regexp. - - In some cases, adding characters to the regexp in an incremental regexp -search can make the cursor move back and start again. For example, if -you have searched for @samp{foo} and you add @samp{\|bar}, the cursor -backs up in case the first @samp{bar} precedes the first @samp{foo}. - - Forward and backward regexp search are not symmetrical, because -regexp matching in Emacs always operates forward, starting with the -beginning of the regexp. Thus, forward regexp search scans forward, -trying a forward match at each possible starting position. Backward -regexp search scans backward, trying a forward match at each possible -starting position. These search methods are not mirror images. - -@findex re-search-forward -@findex re-search-backward - Nonincremental search for a regexp is done by the functions -@code{re-search-forward} and @code{re-search-backward}. You can invoke -these with @kbd{M-x}, or bind them to keys, or invoke them by way of -incremental regexp search with @kbd{C-M-s @key{RET}} and @kbd{C-M-r -@key{RET}}. - - If you use the incremental regexp search commands with a prefix -argument, they perform ordinary string search, like -@code{isearch-forward} and @code{isearch-backward}. @xref{Incremental -Search}. - -@node Regexps -@section Syntax of Regular Expressions -@cindex syntax of regexps - - This manual describes regular expression features that users -typically want to use. There are additional features that are -mainly used in Lisp programs; see @ref{Regular Expressions,,, -elisp, The Emacs Lisp Reference Manual}. - - Regular expressions have a syntax in which a few characters are -special constructs and the rest are @dfn{ordinary}. An ordinary -character is a simple regular expression which matches that same -character and nothing else. The special characters are @samp{$}, -@samp{^}, @samp{.}, @samp{*}, @samp{+}, @samp{?}, @samp{[}, and -@samp{\}. The character @samp{]} is special if it ends a character -alternative (see later). The character @samp{-} is special inside a -character alternative. Any other character appearing in a regular -expression is ordinary, unless a @samp{\} precedes it. (When you use -regular expressions in a Lisp program, each @samp{\} must be doubled, -see the example near the end of this section.) - - For example, @samp{f} is not a special character, so it is ordinary, and -therefore @samp{f} is a regular expression that matches the string -@samp{f} and no other string. (It does @emph{not} match the string -@samp{ff}.) Likewise, @samp{o} is a regular expression that matches -only @samp{o}. (When case distinctions are being ignored, these regexps -also match @samp{F} and @samp{O}, but we consider this a generalization -of ``the same string,'' rather than an exception.) - - Any two regular expressions @var{a} and @var{b} can be concatenated. The -result is a regular expression which matches a string if @var{a} matches -some amount of the beginning of that string and @var{b} matches the rest of -the string.@refill - - As a simple example, we can concatenate the regular expressions @samp{f} -and @samp{o} to get the regular expression @samp{fo}, which matches only -the string @samp{fo}. Still trivial. To do something nontrivial, you -need to use one of the special characters. Here is a list of them. - -@table @asis -@item @kbd{.}@: @r{(Period)} -is a special character that matches any single character except a newline. -Using concatenation, we can make regular expressions like @samp{a.b}, which -matches any three-character string that begins with @samp{a} and ends with -@samp{b}.@refill - -@item @kbd{*} -is not a construct by itself; it is a postfix operator that means to -match the preceding regular expression repetitively as many times as -possible. Thus, @samp{o*} matches any number of @samp{o}s (including no -@samp{o}s). - -@samp{*} always applies to the @emph{smallest} possible preceding -expression. Thus, @samp{fo*} has a repeating @samp{o}, not a repeating -@samp{fo}. It matches @samp{f}, @samp{fo}, @samp{foo}, and so on. - -The matcher processes a @samp{*} construct by matching, immediately, -as many repetitions as can be found. Then it continues with the rest -of the pattern. If that fails, backtracking occurs, discarding some -of the matches of the @samp{*}-modified construct in case that makes -it possible to match the rest of the pattern. For example, in matching -@samp{ca*ar} against the string @samp{caaar}, the @samp{a*} first -tries to match all three @samp{a}s; but the rest of the pattern is -@samp{ar} and there is only @samp{r} left to match, so this try fails. -The next alternative is for @samp{a*} to match only two @samp{a}s. -With this choice, the rest of the regexp matches successfully.@refill - -@item @kbd{+} -is a postfix operator, similar to @samp{*} except that it must match -the preceding expression at least once. So, for example, @samp{ca+r} -matches the strings @samp{car} and @samp{caaaar} but not the string -@samp{cr}, whereas @samp{ca*r} matches all three strings. - -@item @kbd{?} -is a postfix operator, similar to @samp{*} except that it can match the -preceding expression either once or not at all. For example, -@samp{ca?r} matches @samp{car} or @samp{cr}; nothing else. - -@item @kbd{*?}, @kbd{+?}, @kbd{??} -@cindex non-greedy regexp matching -are non-greedy variants of the operators above. The normal operators -@samp{*}, @samp{+}, @samp{?} are @dfn{greedy} in that they match as -much as they can, as long as the overall regexp can still match. With -a following @samp{?}, they are non-greedy: they will match as little -as possible. - -Thus, both @samp{ab*} and @samp{ab*?} can match the string @samp{a} -and the string @samp{abbbb}; but if you try to match them both against -the text @samp{abbb}, @samp{ab*} will match it all (the longest valid -match), while @samp{ab*?} will match just @samp{a} (the shortest -valid match). - -Non-greedy operators match the shortest possible string starting at a -given starting point; in a forward search, though, the earliest -possible starting point for match is always the one chosen. Thus, if -you search for @samp{a.*?$} against the text @samp{abbab} followed by -a newline, it matches the whole string. Since it @emph{can} match -starting at the first @samp{a}, it does. - -@item @kbd{\@{@var{n}\@}} -is a postfix operator that specifies repetition @var{n} times---that -is, the preceding regular expression must match exactly @var{n} times -in a row. For example, @samp{x\@{4\@}} matches the string @samp{xxxx} -and nothing else. - -@item @kbd{\@{@var{n},@var{m}\@}} -is a postfix operator that specifies repetition between @var{n} and -@var{m} times---that is, the preceding regular expression must match -at least @var{n} times, but no more than @var{m} times. If @var{m} is -omitted, then there is no upper limit, but the preceding regular -expression must match at least @var{n} times.@* @samp{\@{0,1\@}} is -equivalent to @samp{?}. @* @samp{\@{0,\@}} is equivalent to -@samp{*}. @* @samp{\@{1,\@}} is equivalent to @samp{+}. - -@item @kbd{[ @dots{} ]} -is a @dfn{character set}, which begins with @samp{[} and is terminated -by @samp{]}. In the simplest case, the characters between the two -brackets are what this set can match. - -Thus, @samp{[ad]} matches either one @samp{a} or one @samp{d}, and -@samp{[ad]*} matches any string composed of just @samp{a}s and @samp{d}s -(including the empty string), from which it follows that @samp{c[ad]*r} -matches @samp{cr}, @samp{car}, @samp{cdr}, @samp{caddaar}, etc. - -You can also include character ranges in a character set, by writing the -starting and ending characters with a @samp{-} between them. Thus, -@samp{[a-z]} matches any lower-case @acronym{ASCII} letter. Ranges may be -intermixed freely with individual characters, as in @samp{[a-z$%.]}, -which matches any lower-case @acronym{ASCII} letter or @samp{$}, @samp{%} or -period. - -Note that the usual regexp special characters are not special inside a -character set. A completely different set of special characters exists -inside character sets: @samp{]}, @samp{-} and @samp{^}. - -To include a @samp{]} in a character set, you must make it the first -character. For example, @samp{[]a]} matches @samp{]} or @samp{a}. To -include a @samp{-}, write @samp{-} as the first or last character of the -set, or put it after a range. Thus, @samp{[]-]} matches both @samp{]} -and @samp{-}. - -To include @samp{^} in a set, put it anywhere but at the beginning of -the set. (At the beginning, it complements the set---see below.) - -When you use a range in case-insensitive search, you should write both -ends of the range in upper case, or both in lower case, or both should -be non-letters. The behavior of a mixed-case range such as @samp{A-z} -is somewhat ill-defined, and it may change in future Emacs versions. - -@item @kbd{[^ @dots{} ]} -@samp{[^} begins a @dfn{complemented character set}, which matches any -character except the ones specified. Thus, @samp{[^a-z0-9A-Z]} matches -all characters @emph{except} @acronym{ASCII} letters and digits. - -@samp{^} is not special in a character set unless it is the first -character. The character following the @samp{^} is treated as if it -were first (in other words, @samp{-} and @samp{]} are not special there). - -A complemented character set can match a newline, unless newline is -mentioned as one of the characters not to match. This is in contrast to -the handling of regexps in programs such as @code{grep}. - -@item @kbd{^} -is a special character that matches the empty string, but only at the -beginning of a line in the text being matched. Otherwise it fails to -match anything. Thus, @samp{^foo} matches a @samp{foo} that occurs at -the beginning of a line. - -For historical compatibility reasons, @samp{^} can be used with this -meaning only at the beginning of the regular expression, or after -@samp{\(} or @samp{\|}. - -@item @kbd{$} -is similar to @samp{^} but matches only at the end of a line. Thus, -@samp{x+$} matches a string of one @samp{x} or more at the end of a line. - -For historical compatibility reasons, @samp{$} can be used with this -meaning only at the end of the regular expression, or before @samp{\)} -or @samp{\|}. - -@item @kbd{\} -has two functions: it quotes the special characters (including -@samp{\}), and it introduces additional special constructs. - -Because @samp{\} quotes special characters, @samp{\$} is a regular -expression that matches only @samp{$}, and @samp{\[} is a regular -expression that matches only @samp{[}, and so on. - -See the following section for the special constructs that begin -with @samp{\}. -@end table - - Note: for historical compatibility, special characters are treated as -ordinary ones if they are in contexts where their special meanings make no -sense. For example, @samp{*foo} treats @samp{*} as ordinary since there is -no preceding expression on which the @samp{*} can act. It is poor practice -to depend on this behavior; it is better to quote the special character anyway, -regardless of where it appears. - -As a @samp{\} is not special inside a character alternative, it can -never remove the special meaning of @samp{-} or @samp{]}. So you -should not quote these characters when they have no special meaning -either. This would not clarify anything, since backslashes can -legitimately precede these characters where they @emph{have} special -meaning, as in @samp{[^\]} (@code{"[^\\]"} for Lisp string syntax), -which matches any single character except a backslash. - -@node Regexp Backslash -@section Backslash in Regular Expressions - - For the most part, @samp{\} followed by any character matches only -that character. However, there are several exceptions: two-character -sequences starting with @samp{\} that have special meanings. The -second character in the sequence is always an ordinary character when -used on its own. Here is a table of @samp{\} constructs. - -@table @kbd -@item \| -specifies an alternative. Two regular expressions @var{a} and @var{b} -with @samp{\|} in between form an expression that matches some text if -either @var{a} matches it or @var{b} matches it. It works by trying to -match @var{a}, and if that fails, by trying to match @var{b}. - -Thus, @samp{foo\|bar} matches either @samp{foo} or @samp{bar} -but no other string.@refill - -@samp{\|} applies to the largest possible surrounding expressions. Only a -surrounding @samp{\( @dots{} \)} grouping can limit the grouping power of -@samp{\|}.@refill - -Full backtracking capability exists to handle multiple uses of @samp{\|}. - -@item \( @dots{} \) -is a grouping construct that serves three purposes: - -@enumerate -@item -To enclose a set of @samp{\|} alternatives for other operations. -Thus, @samp{\(foo\|bar\)x} matches either @samp{foox} or @samp{barx}. - -@item -To enclose a complicated expression for the postfix operators @samp{*}, -@samp{+} and @samp{?} to operate on. Thus, @samp{ba\(na\)*} matches -@samp{bananana}, etc., with any (zero or more) number of @samp{na} -strings.@refill - -@item -To record a matched substring for future reference. -@end enumerate - -This last application is not a consequence of the idea of a -parenthetical grouping; it is a separate feature that is assigned as a -second meaning to the same @samp{\( @dots{} \)} construct. In practice -there is usually no conflict between the two meanings; when there is -a conflict, you can use a ``shy'' group. - -@item \(?: @dots{} \) -@cindex shy group, in regexp -specifies a ``shy'' group that does not record the matched substring; -you can't refer back to it with @samp{\@var{d}}. This is useful -in mechanically combining regular expressions, so that you -can add groups for syntactic purposes without interfering with -the numbering of the groups that are meant to be referred to. - -@item \@var{d} -@cindex back reference, in regexp -matches the same text that matched the @var{d}th occurrence of a -@samp{\( @dots{} \)} construct. This is called a @dfn{back -reference}. - -After the end of a @samp{\( @dots{} \)} construct, the matcher remembers -the beginning and end of the text matched by that construct. Then, -later on in the regular expression, you can use @samp{\} followed by the -digit @var{d} to mean ``match the same text matched the @var{d}th time -by the @samp{\( @dots{} \)} construct.'' - -The strings matching the first nine @samp{\( @dots{} \)} constructs -appearing in a regular expression are assigned numbers 1 through 9 in -the order that the open-parentheses appear in the regular expression. -So you can use @samp{\1} through @samp{\9} to refer to the text matched -by the corresponding @samp{\( @dots{} \)} constructs. - -For example, @samp{\(.*\)\1} matches any newline-free string that is -composed of two identical halves. The @samp{\(.*\)} matches the first -half, which may be anything, but the @samp{\1} that follows must match -the same exact text. - -If a particular @samp{\( @dots{} \)} construct matches more than once -(which can easily happen if it is followed by @samp{*}), only the last -match is recorded. - -@item \` -matches the empty string, but only at the beginning of the string or -buffer (or its accessible portion) being matched against. - -@item \' -matches the empty string, but only at the end of the string or buffer -(or its accessible portion) being matched against. - -@item \= -matches the empty string, but only at point. - -@item \b -matches the empty string, but only at the beginning or -end of a word. Thus, @samp{\bfoo\b} matches any occurrence of -@samp{foo} as a separate word. @samp{\bballs?\b} matches -@samp{ball} or @samp{balls} as a separate word.@refill - -@samp{\b} matches at the beginning or end of the buffer -regardless of what text appears next to it. - -@item \B -matches the empty string, but @emph{not} at the beginning or -end of a word. - -@item \< -matches the empty string, but only at the beginning of a word. -@samp{\<} matches at the beginning of the buffer only if a -word-constituent character follows. - -@item \> -matches the empty string, but only at the end of a word. @samp{\>} -matches at the end of the buffer only if the contents end with a -word-constituent character. - -@item \w -matches any word-constituent character. The syntax table -determines which characters these are. @xref{Syntax}. - -@item \W -matches any character that is not a word-constituent. - -@item \_< -matches the empty string, but only at the beginning of a symbol. -A symbol is a sequence of one or more symbol-constituent characters. -A symbol-constituent character is a character whose syntax is either -@samp{w} or @samp{_}. @samp{\_<} matches at the beginning of the -buffer only if a symbol-constituent character follows. - -@item \_> -matches the empty string, but only at the end of a symbol. @samp{\_>} -matches at the end of the buffer only if the contents end with a -symbol-constituent character. - -@item \s@var{c} -matches any character whose syntax is @var{c}. Here @var{c} is a -character that designates a particular syntax class: thus, @samp{w} -for word constituent, @samp{-} or @samp{ } for whitespace, @samp{.} -for ordinary punctuation, etc. @xref{Syntax}. - -@item \S@var{c} -matches any character whose syntax is not @var{c}. - -@cindex categories of characters -@cindex characters which belong to a specific language -@findex describe-categories -@item \c@var{c} -matches any character that belongs to the category @var{c}. For -example, @samp{\cc} matches Chinese characters, @samp{\cg} matches -Greek characters, etc. For the description of the known categories, -type @kbd{M-x describe-categories @key{RET}}. - -@item \C@var{c} -matches any character that does @emph{not} belong to category -@var{c}. -@end table - - The constructs that pertain to words and syntax are controlled by the -setting of the syntax table (@pxref{Syntax}). - -@node Regexp Example -@section Regular Expression Example - - Here is a complicated regexp---a simplified version of the regexp -that Emacs uses, by default, to recognize the end of a sentence -together with any whitespace that follows. We show its Lisp syntax to -distinguish the spaces from the tab characters. In Lisp syntax, the -string constant begins and ends with a double-quote. @samp{\"} stands -for a double-quote as part of the regexp, @samp{\\} for a backslash as -part of the regexp, @samp{\t} for a tab, and @samp{\n} for a newline. - -@example -"[.?!][]\"')]*\\($\\| $\\|\t\\| \\)[ \t\n]*" -@end example - -@noindent -This contains four parts in succession: a character set matching -period, @samp{?}, or @samp{!}; a character set matching -close-brackets, quotes, or parentheses, repeated zero or more times; a -set of alternatives within backslash-parentheses that matches either -end-of-line, a space at the end of a line, a tab, or two spaces; and a -character set matching whitespace characters, repeated any number of -times. - - To enter the same regexp in incremental search, you would type -@key{TAB} to enter a tab, and @kbd{C-j} to enter a newline. You would -also type single backslashes as themselves, instead of doubling them -for Lisp syntax. In commands that use ordinary minibuffer input to -read a regexp, you would quote the @kbd{C-j} by preceding it with a -@kbd{C-q} to prevent @kbd{C-j} from exiting the minibuffer. - -@node Search Case -@section Searching and Case - - Incremental searches in Emacs normally ignore the case of the text -they are searching through, if you specify the text in lower case. -Thus, if you specify searching for @samp{foo}, then @samp{Foo} and -@samp{foo} are also considered a match. Regexps, and in particular -character sets, are included: @samp{[ab]} would match @samp{a} or -@samp{A} or @samp{b} or @samp{B}.@refill - - An upper-case letter anywhere in the incremental search string makes -the search case-sensitive. Thus, searching for @samp{Foo} does not find -@samp{foo} or @samp{FOO}. This applies to regular expression search as -well as to string search. The effect ceases if you delete the -upper-case letter from the search string. - - Typing @kbd{M-c} within an incremental search toggles the case -sensitivity of that search. The effect does not extend beyond the -current incremental search to the next one, but it does override the -effect of including an upper-case letter in the current search. - -@vindex case-fold-search -@vindex default-case-fold-search - If you set the variable @code{case-fold-search} to @code{nil}, then -all letters must match exactly, including case. This is a per-buffer -variable; altering the variable affects only the current buffer, but -there is a default value in @code{default-case-fold-search} that you -can also set. @xref{Locals}. This variable applies to nonincremental -searches also, including those performed by the replace commands -(@pxref{Replace}) and the minibuffer history matching commands -(@pxref{Minibuffer History}). - - Several related variables control case-sensitivity of searching and -matching for specific commands or activities. For instance, -@code{tags-case-fold-search} controls case sensitivity for -@code{find-tag}. To find these variables, do @kbd{M-x -apropos-variable @key{RET} case-fold-search @key{RET}}. - -@node Replace -@section Replacement Commands -@cindex replacement -@cindex search-and-replace commands -@cindex string substitution -@cindex global substitution - - Global search-and-replace operations are not needed often in Emacs, -but they are available. In addition to the simple @kbd{M-x -replace-string} command which replaces all occurrences, -there is @kbd{M-%} (@code{query-replace}), which presents each occurrence -of the pattern and asks you whether to replace it. - - The replace commands normally operate on the text from point to the -end of the buffer; however, in Transient Mark mode (@pxref{Transient -Mark}), when the mark is active, they operate on the region. The -basic replace commands replace one string (or regexp) with one -replacement string. It is possible to perform several replacements in -parallel using the command @code{expand-region-abbrevs} -(@pxref{Expanding Abbrevs}). - -@menu -* Unconditional Replace:: Replacing all matches for a string. -* Regexp Replace:: Replacing all matches for a regexp. -* Replacement and Case:: How replacements preserve case of letters. -* Query Replace:: How to use querying. -@end menu - -@node Unconditional Replace, Regexp Replace, Replace, Replace -@subsection Unconditional Replacement -@findex replace-string - -@table @kbd -@item M-x replace-string @key{RET} @var{string} @key{RET} @var{newstring} @key{RET} -Replace every occurrence of @var{string} with @var{newstring}. -@end table - - To replace every instance of @samp{foo} after point with @samp{bar}, -use the command @kbd{M-x replace-string} with the two arguments -@samp{foo} and @samp{bar}. Replacement happens only in the text after -point, so if you want to cover the whole buffer you must go to the -beginning first. All occurrences up to the end of the buffer are -replaced; to limit replacement to part of the buffer, narrow to that -part of the buffer before doing the replacement (@pxref{Narrowing}). -In Transient Mark mode, when the region is active, replacement is -limited to the region (@pxref{Transient Mark}). - - When @code{replace-string} exits, it leaves point at the last -occurrence replaced. It sets the mark to the prior position of point -(where the @code{replace-string} command was issued); use @kbd{C-u -C-@key{SPC}} to move back there. - - A numeric argument restricts replacement to matches that are surrounded -by word boundaries. The argument's value doesn't matter. - - @xref{Replacement and Case}, for details about case-sensitivity in -replace commands. - - What if you want to exchange @samp{x} and @samp{y}: replace every @samp{x} with a @samp{y} and vice versa? You can do it this way: - -@example -M-x replace-string @key{RET} x @key{RET} @@TEMP@@ @key{RET} -M-< M-x replace-string @key{RET} y @key{RET} x @key{RET} -M-< M-x replace-string @key{RET} @@TEMP@@ @key{RET} y @key{RET} -@end example - -@noindent -This works provided the string @samp{@@TEMP@@} does not appear -in your text. - -@node Regexp Replace, Replacement and Case, Unconditional Replace, Replace -@subsection Regexp Replacement -@findex replace-regexp - - The @kbd{M-x replace-string} command replaces exact matches for a -single string. The similar command @kbd{M-x replace-regexp} replaces -any match for a specified pattern. - -@table @kbd -@item M-x replace-regexp @key{RET} @var{regexp} @key{RET} @var{newstring} @key{RET} -Replace every match for @var{regexp} with @var{newstring}. -@end table - -@cindex back reference, in regexp replacement - In @code{replace-regexp}, the @var{newstring} need not be constant: -it can refer to all or part of what is matched by the @var{regexp}. -@samp{\&} in @var{newstring} stands for the entire match being -replaced. @samp{\@var{d}} in @var{newstring}, where @var{d} is a -digit, stands for whatever matched the @var{d}th parenthesized -grouping in @var{regexp}. (This is called a ``back reference.'') -@samp{\#} refers to the count of replacements already made in this -command, as a decimal number. In the first replacement, @samp{\#} -stands for @samp{0}; in the second, for @samp{1}; and so on. For -example, - -@example -M-x replace-regexp @key{RET} c[ad]+r @key{RET} \&-safe @key{RET} -@end example - -@noindent -replaces (for example) @samp{cadr} with @samp{cadr-safe} and @samp{cddr} -with @samp{cddr-safe}. - -@example -M-x replace-regexp @key{RET} \(c[ad]+r\)-safe @key{RET} \1 @key{RET} -@end example - -@noindent -performs the inverse transformation. To include a @samp{\} in the -text to replace with, you must enter @samp{\\}. - - If you want to enter part of the replacement string by hand each -time, use @samp{\?} in the replacement string. Each replacement will -ask you to edit the replacement string in the minibuffer, putting -point where the @samp{\?} was. - - The remainder of this subsection is intended for specialized tasks -and requires knowledge of Lisp. Most readers can skip it. - - You can use Lisp expressions to calculate parts of the -replacement string. To do this, write @samp{\,} followed by the -expression in the replacement string. Each replacement calculates the -value of the expression and converts it to text without quoting (if -it's a string, this means using the string's contents), and uses it in -the replacement string in place of the expression itself. If the -expression is a symbol, one space in the replacement string after the -symbol name goes with the symbol name, so the value replaces them -both. - - Inside such an expression, you can use some special sequences. -@samp{\&} and @samp{\@var{n}} refer here, as usual, to the entire -match as a string, and to a submatch as a string. @var{n} may be -multiple digits, and the value of @samp{\@var{n}} is @code{nil} if -subexpression @var{n} did not match. You can also use @samp{\#&} and -@samp{\#@var{n}} to refer to those matches as numbers (this is valid -when the match or submatch has the form of a numeral). @samp{\#} here -too stands for the number of already-completed replacements. - - Repeating our example to exchange @samp{x} and @samp{y}, we can thus -do it also this way: - -@example -M-x replace-regexp @key{RET} \(x\)\|y @key{RET} -\,(if \1 "y" "x") @key{RET} -@end example - - For computing replacement strings for @samp{\,}, the @code{format} -function is often useful (@pxref{Formatting Strings,,, elisp, The Emacs -Lisp Reference Manual}). For example, to add consecutively numbered -strings like @samp{ABC00042} to columns 73 @w{to 80} (unless they are -already occupied), you can use - -@example -M-x replace-regexp @key{RET} ^.\@{0,72\@}$ @key{RET} -\,(format "%-72sABC%05d" \& \#) @key{RET} -@end example - -@node Replacement and Case, Query Replace, Regexp Replace, Replace -@subsection Replace Commands and Case - - If the first argument of a replace command is all lower case, the -command ignores case while searching for occurrences to -replace---provided @code{case-fold-search} is non-@code{nil}. If -@code{case-fold-search} is set to @code{nil}, case is always significant -in all searches. - -@vindex case-replace - In addition, when the @var{newstring} argument is all or partly lower -case, replacement commands try to preserve the case pattern of each -occurrence. Thus, the command - -@example -M-x replace-string @key{RET} foo @key{RET} bar @key{RET} -@end example - -@noindent -replaces a lower case @samp{foo} with a lower case @samp{bar}, an -all-caps @samp{FOO} with @samp{BAR}, and a capitalized @samp{Foo} with -@samp{Bar}. (These three alternatives---lower case, all caps, and -capitalized, are the only ones that @code{replace-string} can -distinguish.) - - If upper-case letters are used in the replacement string, they remain -upper case every time that text is inserted. If upper-case letters are -used in the first argument, the second argument is always substituted -exactly as given, with no case conversion. Likewise, if either -@code{case-replace} or @code{case-fold-search} is set to @code{nil}, -replacement is done without case conversion. - -@node Query Replace,, Replacement and Case, Replace -@subsection Query Replace -@cindex query replace - -@table @kbd -@item M-% @var{string} @key{RET} @var{newstring} @key{RET} -@itemx M-x query-replace @key{RET} @var{string} @key{RET} @var{newstring} @key{RET} -Replace some occurrences of @var{string} with @var{newstring}. -@item C-M-% @var{regexp} @key{RET} @var{newstring} @key{RET} -@itemx M-x query-replace-regexp @key{RET} @var{regexp} @key{RET} @var{newstring} @key{RET} -Replace some matches for @var{regexp} with @var{newstring}. -@end table - -@kindex M-% -@findex query-replace - If you want to change only some of the occurrences of @samp{foo} to -@samp{bar}, not all of them, then you cannot use an ordinary -@code{replace-string}. Instead, use @kbd{M-%} (@code{query-replace}). -This command finds occurrences of @samp{foo} one by one, displays each -occurrence and asks you whether to replace it. Aside from querying, -@code{query-replace} works just like @code{replace-string}. It -preserves case, like @code{replace-string}, provided -@code{case-replace} is non-@code{nil}, as it normally is -(@pxref{Replacement and Case}). A numeric argument means consider -only occurrences that are bounded by word-delimiter characters. - -@kindex C-M-% -@findex query-replace-regexp - @kbd{C-M-%} performs regexp search and replace (@code{query-replace-regexp}). -It works like @code{replace-regexp} except that it queries -like @code{query-replace}. - -@cindex faces for highlighting query replace - These commands highlight the current match using the face -@code{query-replace}. They highlight other matches using -@code{lazy-highlight} just like incremental search (@pxref{Incremental -Search}). - - The characters you can type when you are shown a match for the string -or regexp are: - -@ignore @c Not worth it. -@kindex SPC @r{(query-replace)} -@kindex DEL @r{(query-replace)} -@kindex , @r{(query-replace)} -@kindex RET @r{(query-replace)} -@kindex . @r{(query-replace)} -@kindex ! @r{(query-replace)} -@kindex ^ @r{(query-replace)} -@kindex C-r @r{(query-replace)} -@kindex C-w @r{(query-replace)} -@kindex C-l @r{(query-replace)} -@end ignore - -@c WideCommands -@table @kbd -@item @key{SPC} -to replace the occurrence with @var{newstring}. - -@item @key{DEL} -to skip to the next occurrence without replacing this one. - -@item , @r{(Comma)} -to replace this occurrence and display the result. You are then asked -for another input character to say what to do next. Since the -replacement has already been made, @key{DEL} and @key{SPC} are -equivalent in this situation; both move to the next occurrence. - -You can type @kbd{C-r} at this point (see below) to alter the replaced -text. You can also type @kbd{C-x u} to undo the replacement; this exits -the @code{query-replace}, so if you want to do further replacement you -must use @kbd{C-x @key{ESC} @key{ESC} @key{RET}} to restart -(@pxref{Repetition}). - -@item @key{RET} -to exit without doing any more replacements. - -@item .@: @r{(Period)} -to replace this occurrence and then exit without searching for more -occurrences. - -@item ! -to replace all remaining occurrences without asking again. - -@item ^ -to go back to the position of the previous occurrence (or what used to -be an occurrence), in case you changed it by mistake or want to -reexamine it. - -@item C-r -to enter a recursive editing level, in case the occurrence needs to be -edited rather than just replaced with @var{newstring}. When you are -done, exit the recursive editing level with @kbd{C-M-c} to proceed to -the next occurrence. @xref{Recursive Edit}. - -@item C-w -to delete the occurrence, and then enter a recursive editing level as in -@kbd{C-r}. Use the recursive edit to insert text to replace the deleted -occurrence of @var{string}. When done, exit the recursive editing level -with @kbd{C-M-c} to proceed to the next occurrence. - -@item e -to edit the replacement string in the minibuffer. When you exit the -minibuffer by typing @key{RET}, the minibuffer contents replace the -current occurrence of the pattern. They also become the new -replacement string for any further occurrences. - -@item C-l -to redisplay the screen. Then you must type another character to -specify what to do with this occurrence. - -@item C-h -to display a message summarizing these options. Then you must type -another character to specify what to do with this occurrence. -@end table - - Some other characters are aliases for the ones listed above: @kbd{y}, -@kbd{n} and @kbd{q} are equivalent to @key{SPC}, @key{DEL} and -@key{RET}. - - Aside from this, any other character exits the @code{query-replace}, -and is then reread as part of a key sequence. Thus, if you type -@kbd{C-k}, it exits the @code{query-replace} and then kills to end of -line. - - To restart a @code{query-replace} once it is exited, use @kbd{C-x -@key{ESC} @key{ESC}}, which repeats the @code{query-replace} because it -used the minibuffer to read its arguments. @xref{Repetition, C-x ESC -ESC}. - - @xref{Operating on Files}, for the Dired @kbd{Q} command which -performs query replace on selected files. See also @ref{Transforming -File Names}, for Dired commands to rename, copy, or link files by -replacing regexp matches in file names. - -@node Other Repeating Search -@section Other Search-and-Loop Commands - - Here are some other commands that find matches for a regular -expression. They all ignore case in matching, if the pattern contains -no upper-case letters and @code{case-fold-search} is non-@code{nil}. -Aside from @code{occur} and its variants, all operate on the text from -point to the end of the buffer, or on the active region in Transient -Mark mode. - -@findex list-matching-lines -@findex occur -@findex multi-occur -@findex multi-occur-in-matching-buffers -@findex how-many -@findex delete-non-matching-lines -@findex delete-matching-lines -@findex flush-lines -@findex keep-lines - -@table @kbd -@item M-x occur @key{RET} @var{regexp} @key{RET} -Display a list showing each line in the buffer that contains a match -for @var{regexp}. To limit the search to part of the buffer, narrow -to that part (@pxref{Narrowing}). A numeric argument @var{n} -specifies that @var{n} lines of context are to be displayed before and -after each matching line. Currently, @code{occur} can not correctly -handle multiline matches. - -@kindex RET @r{(Occur mode)} -@kindex o @r{(Occur mode)} -@kindex C-o @r{(Occur mode)} -The buffer @samp{*Occur*} containing the output serves as a menu for -finding the occurrences in their original context. Click -@kbd{Mouse-2} on an occurrence listed in @samp{*Occur*}, or position -point there and type @key{RET}; this switches to the buffer that was -searched and moves point to the original of the chosen occurrence. -@kbd{o} and @kbd{C-o} display the match in another window; @kbd{C-o} -does not select it. - -After using @kbd{M-x occur}, you can use @code{next-error} to visit -the occurrences found, one by one. @ref{Compilation Mode}. - -@item M-x list-matching-lines -Synonym for @kbd{M-x occur}. - -@item M-x multi-occur @key{RET} @var{buffers} @key{RET} @var{regexp} @key{RET} -This function is just like @code{occur}, except it is able to search -through multiple buffers. It asks you to specify the buffer names one by one. - -@item M-x multi-occur-in-matching-buffers @key{RET} @var{bufregexp} @key{RET} @var{regexp} @key{RET} -This function is similar to @code{multi-occur}, except the buffers to -search are specified by a regular expression that matches visited -file names. With a prefix argument, it uses the regular expression to match -buffer names instead. - -@item M-x how-many @key{RET} @var{regexp} @key{RET} -Print the number of matches for @var{regexp} that exist in the buffer -after point. In Transient Mark mode, if the region is active, the -command operates on the region instead. - -@item M-x flush-lines @key{RET} @var{regexp} @key{RET} -This command deletes each line that contains a match for @var{regexp}, -operating on the text after point; it deletes the current line -if it contains a match starting after point. In Transient Mark mode, -if the region is active, the command operates on the region instead; -it deletes a line partially contained in the region if it contains a -match entirely contained in the region. - -If a match is split across lines, @code{flush-lines} deletes all those -lines. It deletes the lines before starting to look for the next -match; hence, it ignores a match starting on the same line at which -another match ended. - -@item M-x keep-lines @key{RET} @var{regexp} @key{RET} -This command deletes each line that @emph{does not} contain a match for -@var{regexp}, operating on the text after point; if point is not at the -beginning of a line, it always keeps the current line. In Transient -Mark mode, if the region is active, the command operates on the region -instead; it never deletes lines that are only partially contained in -the region (a newline that ends a line counts as part of that line). - -If a match is split across lines, this command keeps all those lines. -@end table - -@ignore - arch-tag: fd9d8e77-66af-491c-b212-d80999613e3e -@end ignore diff --git a/man/trampver.texi b/man/trampver.texi deleted file mode 100644 index 4ed196a80f0..00000000000 --- a/man/trampver.texi +++ /dev/null @@ -1,62 +0,0 @@ -@c -*-texinfo-*- -@c texi/trampver.texi. Generated from trampver.texi.in by configure. - -@c In the Tramp CVS, the version number is auto-frobbed from -@c configure.ac, so you should edit that file and run -@c "autoconf && ./configure" to change the version number. -@set trampver 2.1.11-pre - -@c Other flags from configuration -@set instprefix /usr/local -@set lispdir /usr/local/share/emacs/site-lisp -@set infodir /usr/local/info - -@c Formatting of the tramp program name consistent. -@set tramp @sc{tramp} - -@c Whether or not describe gateway methods. -@ifclear noemacsgw -@set emacsgw -@end ifclear - -@c Some flags which make the text independent on the (X)Emacs flavor. -@c "emacs" resp "xemacs" are set in the Makefile. Default is "emacs". -@ifclear emacs -@ifclear xemacs -@set emacs -@end ifclear -@end ifclear - -@c Emacs values. -@ifset emacs -@set emacsname GNU Emacs -@set emacsdir emacs -@set ftppackagename Ange-FTP -@set prefix / -@set prefixhop -@set postfix : -@set postfixhop : -@set emacsothername XEmacs -@set emacsotherdir xemacs -@set emacsotherfilename tramp-xemacs.html -@set japanesemanual tramp_ja-emacs.html -@end ifset - -@c XEmacs counterparts. -@ifset xemacs -@set emacsname XEmacs -@set emacsdir xemacs -@set ftppackagename EFS -@set prefix /[ -@set prefixhop [ -@set postfix ] -@set postfixhop / -@set emacsothername GNU Emacs -@set emacsotherdir emacs -@set emacsotherfilename tramp-emacs.html -@set japanesemanual tramp_ja-xemacs.html -@end ifset - -@ignore - arch-tag: e0fe322c-e06b-46eb-bb5b-d091b521f41c -@end ignore diff --git a/man/vc2-xtra.texi b/man/vc2-xtra.texi deleted file mode 100644 index 83f28088726..00000000000 --- a/man/vc2-xtra.texi +++ /dev/null @@ -1,789 +0,0 @@ -@c This is part of the Emacs manual. -@c Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. -@c See file emacs.texi for copying conditions. -@c -@c This file is included either in vc-xtra.texi (when producing the -@c printed version) or in the main Emacs manual (for the on-line version). -@node Remote Repositories -@subsection Remote Repositories -@cindex remote repositories (CVS) - - A common way of using CVS is to set up a central CVS repository on -some Internet host, then have each developer check out a personal -working copy of the files on his local machine. Committing changes to -the repository, and picking up changes from other users into one's own -working area, then works by direct interactions with the CVS server. - - One difficulty is that access to the CVS server is often slow, and -that developers might need to work off-line as well. VC is designed -to reduce the amount of network interaction necessary. - -@menu -* Version Backups:: Keeping local copies of repository versions. -* Local Version Control:: Using another version system for local editing. -@end menu - -@node Version Backups -@subsubsection Version Backups -@cindex version backups - -@cindex automatic version backups - When VC sees that the CVS repository for a file is on a remote -machine, it automatically makes local backups of unmodified versions -of the file---@dfn{automatic version backups}. This means that you -can compare the file to the repository version (@kbd{C-x v =}), or -revert to that version (@kbd{C-x v u}), without any network -interactions. - - The local copy of the unmodified file is called a @dfn{version -backup} to indicate that it corresponds exactly to a version that is -stored in the repository. Note that version backups are not the same -as ordinary Emacs backup files -@iftex -(@pxref{Backup,,,emacs, the Emacs Manual}). -@end iftex -@ifnottex -(@pxref{Backup}). -@end ifnottex -But they follow a similar naming convention. - - For a file that comes from a remote CVS repository, VC makes a -version backup whenever you save the first changes to the file, and -removes it after you have committed your modified version to the -repository. You can disable the making of automatic version backups by -setting @code{vc-cvs-stay-local} to @code{nil} (@pxref{CVS Options}). - -@cindex manual version backups - The name of the automatic version backup for version @var{version} -of file @var{file} is @code{@var{file}.~@var{version}.~}. This is -almost the same as the name used by @kbd{C-x v ~} -@iftex -(@pxref{Old Versions,,,emacs, the Emacs Manual}), -@end iftex -@ifnottex -(@pxref{Old Versions}), -@end ifnottex -the only difference being the additional dot (@samp{.}) after the -version number. This similarity is intentional, because both kinds of -files store the same kind of information. The file made by @kbd{C-x v -~} acts as a @dfn{manual version backup}. - - All the VC commands that operate on old versions of a file can use -both kinds of version backups. For instance, @kbd{C-x v ~} uses -either an automatic or a manual version backup, if possible, to get -the contents of the version you request. Likewise, @kbd{C-x v =} and -@kbd{C-x v u} use either an automatic or a manual version backup, if -one of them exists, to get the contents of a version to compare or -revert to. If you changed a file outside of Emacs, so that no -automatic version backup was created for the previous text, you can -create a manual backup of that version using @kbd{C-x v ~}, and thus -obtain the benefit of the local copy for Emacs commands. - - The only difference in Emacs's handling of manual and automatic -version backups, once they exist, is that Emacs deletes automatic -version backups when you commit to the repository. By contrast, -manual version backups remain until you delete them. - -@node Local Version Control -@subsubsection Local Version Control -@cindex local version control -@cindex local back end (version control) - -When you make many changes to a file that comes from a remote -repository, it can be convenient to have version control on your local -machine as well. You can then record intermediate versions, revert to -a previous state, etc., before you actually commit your changes to the -remote server. - -VC lets you do this by putting a file under a second, local version -control system, so that the file is effectively registered in two -systems at the same time. For the description here, we will assume -that the remote system is CVS, and you use RCS locally, although the -mechanism works with any combination of version control systems -(@dfn{back ends}). - -To make it work with other back ends, you must make sure that the -``more local'' back end comes before the ``more remote'' back end in -the setting of @code{vc-handled-backends} (@pxref{Customizing VC}). By -default, this variable is set up so that you can use remote CVS and -local RCS as described here. - -To start using local RCS for a file that comes from a remote CVS -server, you must @emph{register the file in RCS}, by typing @kbd{C-u -C-x v v rcs @key{RET}}. (In other words, use @code{vc-next-action} with a -prefix argument, and specify RCS as the back end.) - -You can do this at any time; it does not matter whether you have -already modified the file with respect to the version in the CVS -repository. If possible, VC tries to make the RCS master start with -the unmodified repository version, then checks in any local changes -as a new version. This works if you have not made any changes yet, or -if the unmodified repository version exists locally as a version -backup (@pxref{Version Backups}). If the unmodified version is not -available locally, the RCS master starts with the modified version; -the only drawback to this is that you cannot compare your changes -locally to what is stored in the repository. - -The version number of the RCS master is derived from the current CVS -version, starting a branch from it. For example, if the current CVS -version is 1.23, the local RCS branch will be 1.23.1. Version 1.23 in -the RCS master will be identical to version 1.23 under CVS; your first -changes are checked in as 1.23.1.1. (If the unmodified file is not -available locally, VC will check in the modified file twice, both as -1.23 and 1.23.1.1, to make the revision numbers consistent.) - -If you do not use locking under CVS (the default), locking is also -disabled for RCS, so that editing under RCS works exactly as under -CVS. - -When you are done with local editing, you can commit the final version -back to the CVS repository by typing @kbd{C-u C-x v v cvs @key{RET}}. -This initializes the log entry buffer -@iftex -(@pxref{Log Buffer,,,emacs, the Emacs Manual}) -@end iftex -@ifnottex -(@pxref{Log Buffer}) -@end ifnottex -to contain all the log entries you have recorded in the RCS master; -you can edit them as you wish, and then commit in CVS by typing -@kbd{C-c C-c}. If the commit is successful, VC removes the RCS -master, so that the file is once again registered under CVS only. -(The RCS master is not actually deleted, just renamed by appending -@samp{~} to the name, so that you can refer to it later if you wish.) - -While using local RCS, you can pick up recent changes from the CVS -repository into your local file, or commit some of your changes back -to CVS, without terminating local RCS version control. To do this, -switch to the CVS back end temporarily, with the @kbd{C-x v b} command: - -@table @kbd -@item C-x v b -Switch to another back end that the current file is registered -under (@code{vc-switch-backend}). - -@item C-u C-x v b @var{backend} @key{RET} -Switch to @var{backend} for the current file. -@end table - -@kindex C-x v b -@findex vc-switch-backend -@kbd{C-x v b} does not change the buffer contents, or any files; it -only changes VC's perspective on how to handle the file. Any -subsequent VC commands for that file will operate on the back end that -is currently selected. - -If the current file is registered in more than one back end, typing -@kbd{C-x v b} ``cycles'' through all of these back ends. With a -prefix argument, it asks for the back end to use in the minibuffer. - -Thus, if you are using local RCS, and you want to pick up some recent -changes in the file from remote CVS, first visit the file, then type -@kbd{C-x v b} to switch to CVS, and finally use @kbd{C-x v m -@key{RET}} to merge the news -@iftex -(@pxref{Merging,,,emacs, the Emacs Manual}). -@end iftex -@ifnottex -(@pxref{Merging}). -@end ifnottex -You can then switch back to RCS by typing @kbd{C-x v b} again, and -continue to edit locally. - -But if you do this, the revision numbers in the RCS master no longer -correspond to those of CVS. Technically, this is not a problem, but -it can become difficult to keep track of what is in the CVS repository -and what is not. So we suggest that you return from time to time to -CVS-only operation, by committing your local changes back to the -repository using @kbd{C-u C-x v v cvs @key{RET}}. - -@node Snapshots -@subsection Snapshots -@cindex snapshots and version control - - A @dfn{snapshot} is a named set of file versions (one for each -registered file) that you can treat as a unit. One important kind of -snapshot is a @dfn{release}, a (theoretically) stable version of the -system that is ready for distribution to users. - -@menu -* Making Snapshots:: The snapshot facilities. -* Snapshot Caveats:: Things to be careful of when using snapshots. -@end menu - -@node Making Snapshots -@subsubsection Making and Using Snapshots - - There are two basic commands for snapshots; one makes a -snapshot with a given name, the other retrieves a named snapshot. - -@table @code -@kindex C-x v s -@findex vc-create-snapshot -@item C-x v s @var{name} @key{RET} -Define the last saved versions of every registered file in or under the -current directory as a snapshot named @var{name} -(@code{vc-create-snapshot}). - -@kindex C-x v r -@findex vc-retrieve-snapshot -@item C-x v r @var{name} @key{RET} -For all registered files at or below the current directory level, select -whatever versions correspond to the snapshot @var{name} -(@code{vc-retrieve-snapshot}). - -This command reports an error if any files are locked at or below the -current directory, without changing anything; this is to avoid -overwriting work in progress. -@end table - - A snapshot uses a very small amount of resources---just enough to record -the list of file names and which version belongs to the snapshot. Thus, -you need not hesitate to create snapshots whenever they are useful. - - You can give a snapshot name as an argument to @kbd{C-x v =} or -@kbd{C-x v ~} -@iftex -(@pxref{Old Versions,,,emacs, the Emacs Manual}). -@end iftex -@ifnottex -(@pxref{Old Versions}). -@end ifnottex -Thus, you can use it to compare a snapshot against the current files, -or two snapshots against each other, or a snapshot against a named -version. - -@node Snapshot Caveats -@subsubsection Snapshot Caveats - -@cindex named configurations (RCS) - VC's snapshot facilities are modeled on RCS's named-configuration -support. They use RCS's native facilities for this, so -snapshots made using RCS through VC are visible even when you bypass VC. - - With CVS, Meta-CVS, and Subversion, VC also uses the native -mechanism provided by that back end to make snapshots and retrieve them -(@dfn{tags} for CVS and Meta-CVS, @dfn{copies} for Subversion). - -@c worded verbosely to avoid overfull hbox. - For SCCS, VC implements snapshots itself. The files it uses contain -name/file/version-number triples. These snapshots are visible only -through VC. - - There is no support for VC snapshots using GNU Arch yet. - - A snapshot is a set of checked-in versions. So make sure that all the -files are checked in and not locked when you make a snapshot. - - File renaming and deletion can create some difficulties with snapshots. -This is not a VC-specific problem, but a general design issue in version -control systems that no one has solved very well yet. - - If you rename a registered file, you need to rename its master along -with it (the command @code{vc-rename-file} does this automatically). If -you are using SCCS, you must also update the records of the snapshot, to -mention the file by its new name (@code{vc-rename-file} does this, -too). An old snapshot that refers to a master file that no longer -exists under the recorded name is invalid; VC can no longer retrieve -it. It would be beyond the scope of this manual to explain enough about -RCS and SCCS to explain how to update the snapshots by hand. - - Using @code{vc-rename-file} makes the snapshot remain valid for -retrieval, but it does not solve all problems. For example, some of the -files in your program probably refer to others by name. At the very -least, the makefile probably mentions the file that you renamed. If you -retrieve an old snapshot, the renamed file is retrieved under its new -name, which is not the name that the makefile expects. So the program -won't really work as retrieved. - -@node Miscellaneous VC -@subsection Miscellaneous Commands and Features of VC - - This section explains the less-frequently-used features of VC. - -@menu -* Change Logs and VC:: Generating a change log file from log entries. -* Renaming and VC:: A command to rename both the source and master - file correctly. -* Version Headers:: Inserting version control headers into working files. -@end menu - -@node Change Logs and VC -@subsubsection Change Logs and VC - - If you use RCS or CVS for a program and also maintain a change log -file for it -@iftex -(@pxref{Change Log,,,emacs, the Emacs Manual}), -@end iftex -@ifnottex -(@pxref{Change Log}), -@end ifnottex -you can generate change log entries automatically from the version -control log entries: - -@table @kbd -@item C-x v a -@kindex C-x v a -@findex vc-update-change-log -Visit the current directory's change log file and, for registered files -in that directory, create new entries for versions checked in since the -most recent entry in the change log file. -(@code{vc-update-change-log}). - -This command works with RCS or CVS only, not with any of the other -back ends. - -@item C-u C-x v a -As above, but only find entries for the current buffer's file. - -@item M-1 C-x v a -As above, but find entries for all the currently visited files that are -maintained with version control. This works only with RCS, and it puts -all entries in the log for the default directory, which may not be -appropriate. -@end table - - For example, suppose the first line of @file{ChangeLog} is dated -1999-04-10, and that the only check-in since then was by Nathaniel -Bowditch to @file{rcs2log} on 1999-05-22 with log text @samp{Ignore log -messages that start with `#'.}. Then @kbd{C-x v a} visits -@file{ChangeLog} and inserts text like this: - -@iftex -@medbreak -@end iftex -@smallexample -@group -1999-05-22 Nathaniel Bowditch <nat@@apn.org> - - * rcs2log: Ignore log messages that start with `#'. -@end group -@end smallexample -@iftex -@medbreak -@end iftex - -@noindent -You can then edit the new change log entry further as you wish. - - Some of the new change log entries may duplicate what's already in -ChangeLog. You will have to remove these duplicates by hand. - - Normally, the log entry for file @file{foo} is displayed as @samp{* -foo: @var{text of log entry}}. The @samp{:} after @file{foo} is omitted -if the text of the log entry starts with @w{@samp{(@var{functionname}): -}}. For example, if the log entry for @file{vc.el} is -@samp{(vc-do-command): Check call-process status.}, then the text in -@file{ChangeLog} looks like this: - -@iftex -@medbreak -@end iftex -@smallexample -@group -1999-05-06 Nathaniel Bowditch <nat@@apn.org> - - * vc.el (vc-do-command): Check call-process status. -@end group -@end smallexample -@iftex -@medbreak -@end iftex - - When @kbd{C-x v a} adds several change log entries at once, it groups -related log entries together if they all are checked in by the same -author at nearly the same time. If the log entries for several such -files all have the same text, it coalesces them into a single entry. -For example, suppose the most recent check-ins have the following log -entries: - -@flushleft -@bullet{} For @file{vc.texinfo}: @samp{Fix expansion typos.} -@bullet{} For @file{vc.el}: @samp{Don't call expand-file-name.} -@bullet{} For @file{vc-hooks.el}: @samp{Don't call expand-file-name.} -@end flushleft - -@noindent -They appear like this in @file{ChangeLog}: - -@iftex -@medbreak -@end iftex -@smallexample -@group -1999-04-01 Nathaniel Bowditch <nat@@apn.org> - - * vc.texinfo: Fix expansion typos. - - * vc.el, vc-hooks.el: Don't call expand-file-name. -@end group -@end smallexample -@iftex -@medbreak -@end iftex - - Normally, @kbd{C-x v a} separates log entries by a blank line, but you -can mark several related log entries to be clumped together (without an -intervening blank line) by starting the text of each related log entry -with a label of the form @w{@samp{@{@var{clumpname}@} }}. The label -itself is not copied to @file{ChangeLog}. For example, suppose the log -entries are: - -@flushleft -@bullet{} For @file{vc.texinfo}: @samp{@{expand@} Fix expansion typos.} -@bullet{} For @file{vc.el}: @samp{@{expand@} Don't call expand-file-name.} -@bullet{} For @file{vc-hooks.el}: @samp{@{expand@} Don't call expand-file-name.} -@end flushleft - -@noindent -Then the text in @file{ChangeLog} looks like this: - -@iftex -@medbreak -@end iftex -@smallexample -@group -1999-04-01 Nathaniel Bowditch <nat@@apn.org> - - * vc.texinfo: Fix expansion typos. - * vc.el, vc-hooks.el: Don't call expand-file-name. -@end group -@end smallexample -@iftex -@medbreak -@end iftex - - A log entry whose text begins with @samp{#} is not copied to -@file{ChangeLog}. For example, if you merely fix some misspellings in -comments, you can log the change with an entry beginning with @samp{#} -to avoid putting such trivia into @file{ChangeLog}. - -@node Renaming and VC -@subsubsection Renaming VC Work Files and Master Files - -@findex vc-rename-file - When you rename a registered file, you must also rename its master -file correspondingly to get proper results. Use @code{vc-rename-file} -to rename the source file as you specify, and rename its master file -accordingly. It also updates any snapshots (@pxref{Snapshots}) that -mention the file, so that they use the new name; despite this, the -snapshot thus modified may not completely work (@pxref{Snapshot -Caveats}). - - Some back ends do not provide an explicit rename operation to their -repositories. After issuing @code{vc-rename-file}, use @kbd{C-x v v} -on the original and renamed buffers and provide the necessary edit -log. - - You cannot use @code{vc-rename-file} on a file that is locked by -someone else. - -@node Version Headers -@subsubsection Inserting Version Control Headers - - Sometimes it is convenient to put version identification strings -directly into working files. Certain special strings called -@dfn{version headers} are replaced in each successive version by the -number of that version, the name of the user who created it, and other -relevant information. All of the back ends that VC supports have such -a mechanism, except GNU Arch. - - VC does not normally use the information contained in these headers. -The exception is RCS---with RCS, version headers are sometimes more -reliable than the master file to determine which version of the file -you are editing. Note that in a multi-branch environment, version -headers are necessary to make VC behave correctly -@iftex -(@pxref{Multi-User Branching,,,emacs, the Emacs Manual}). -@end iftex -@ifnottex -(@pxref{Multi-User Branching}). -@end ifnottex - - Searching for RCS version headers is controlled by the variable -@code{vc-consult-headers}. If it is non-@code{nil} (the default), -Emacs searches for headers to determine the version number you are -editing. Setting it to @code{nil} disables this feature. - - Note that although CVS uses the same kind of version headers as RCS -does, VC never searches for these headers if you are using CVS, -regardless of the above setting. - -@kindex C-x v h -@findex vc-insert-headers - You can use the @kbd{C-x v h} command (@code{vc-insert-headers}) to -insert a suitable header string. - -@table @kbd -@item C-x v h -Insert headers in a file for use with your version-control system. -@end table - -@vindex vc-@var{backend}-header - The default header string is @samp{@w{$}Id$} for RCS and -@samp{@w{%}W%} for SCCS. You can specify other headers to insert by -setting the variables @code{vc-@var{backend}-header} where -@var{backend} is @code{rcs} or @code{sccs}. - - Instead of a single string, you can specify a list of strings; then -each string in the list is inserted as a separate header on a line of -its own. - - It may be necessary to use apparently-superfluous backslashes when -writing the strings that you put in this variable. For instance, you -might write @code{"$Id\$"} rather than @code{"$Id@w{$}"}. The extra -backslash prevents the string constant from being interpreted as a -header, if the Emacs Lisp file containing it is maintained with -version control. - -@vindex vc-comment-alist - Each header is inserted surrounded by tabs, inside comment delimiters, -on a new line at point. Normally the ordinary comment -start and comment end strings of the current mode are used, but for -certain modes, there are special comment delimiters for this purpose; -the variable @code{vc-comment-alist} specifies them. Each element of -this list has the form @code{(@var{mode} @var{starter} @var{ender})}. - -@vindex vc-static-header-alist - The variable @code{vc-static-header-alist} specifies further strings -to add based on the name of the buffer. Its value should be a list of -elements of the form @code{(@var{regexp} . @var{format})}. Whenever -@var{regexp} matches the buffer name, @var{format} is inserted as part -of the header. A header line is inserted for each element that matches -the buffer name, and for each string specified by -@code{vc-@var{backend}-header}. The header line is made by processing the -string from @code{vc-@var{backend}-header} with the format taken from the -element. The default value for @code{vc-static-header-alist} is as follows: - -@example -@group -(("\\.c$" . - "\n#ifndef lint\nstatic char vcid[] = \"\%s\";\n\ -#endif /* lint */\n")) -@end group -@end example - -@noindent -It specifies insertion of text of this form: - -@example -@group - -#ifndef lint -static char vcid[] = "@var{string}"; -#endif /* lint */ -@end group -@end example - -@noindent -Note that the text above starts with a blank line. - - If you use more than one version header in a file, put them close -together in the file. The mechanism in @code{revert-buffer} that -preserves markers may not handle markers positioned between two version -headers. - -@node Customizing VC -@subsection Customizing VC - -@vindex vc-handled-backends -The variable @code{vc-handled-backends} determines which version -control systems VC should handle. The default value is @code{(RCS CVS -SVN SCCS BZR GIT HG Arch MCVS)}, so it contains all the version systems -that are currently supported. If you want VC to ignore one or more of -these systems, exclude its name from the list. To disable VC entirely, -set this variable to @code{nil}. - -The order of systems in the list is significant: when you visit a file -registered in more than one system (@pxref{Local Version Control}), VC -uses the system that comes first in @code{vc-handled-backends} by -default. The order is also significant when you register a file for -the first time, see -@iftex -@ref{Registering,,,emacs, the Emacs Manual}, -@end iftex -@ifnottex -@ref{Registering}, -@end ifnottex -for details. - -@menu -* General VC Options:: Options that apply to multiple back ends. -* RCS and SCCS:: Options for RCS and SCCS. -* CVS Options:: Options for CVS. -@end menu - -@node General VC Options -@subsubsection General Options - -@vindex vc-make-backup-files - Emacs normally does not save backup files for source files that are -maintained with version control. If you want to make backup files even -for files that use version control, set the variable -@code{vc-make-backup-files} to a non-@code{nil} value. - -@vindex vc-keep-workfiles - Normally the work file exists all the time, whether it is locked or -not. If you set @code{vc-keep-workfiles} to @code{nil}, then checking -in a new version with @kbd{C-x v v} deletes the work file; but any -attempt to visit the file with Emacs creates it again. (With CVS, work -files are always kept.) - -@vindex vc-follow-symlinks - Editing a version-controlled file through a symbolic link can be -dangerous. It bypasses the version control system---you can edit the -file without locking it, and fail to check your changes in. Also, -your changes might overwrite those of another user. To protect against -this, VC checks each symbolic link that you visit, to see if it points -to a file under version control. - - The variable @code{vc-follow-symlinks} controls what to do when a -symbolic link points to a version-controlled file. If it is @code{nil}, -VC only displays a warning message. If it is @code{t}, VC automatically -follows the link, and visits the real file instead, telling you about -this in the echo area. If the value is @code{ask} (the default), VC -asks you each time whether to follow the link. - -@vindex vc-suppress-confirm - If @code{vc-suppress-confirm} is non-@code{nil}, then @kbd{C-x v v} -and @kbd{C-x v i} can save the current buffer without asking, and -@kbd{C-x v u} also operates without asking for confirmation. (This -variable does not affect @kbd{C-x v c}; that operation is so drastic -that it should always ask for confirmation.) - -@vindex vc-command-messages - VC mode does much of its work by running the shell commands for RCS, -CVS and SCCS. If @code{vc-command-messages} is non-@code{nil}, VC -displays messages to indicate which shell commands it runs, and -additional messages when the commands finish. - -@vindex vc-path - You can specify additional directories to search for version control -programs by setting the variable @code{vc-path}. These directories -are searched before the usual search path. It is rarely necessary to -set this variable, because VC normally finds the proper files -automatically. - -@node RCS and SCCS -@subsubsection Options for RCS and SCCS - -@cindex non-strict locking (RCS) -@cindex locking, non-strict (RCS) - By default, RCS uses locking to coordinate the activities of several -users, but there is a mode called @dfn{non-strict locking} in which -you can check-in changes without locking the file first. Use -@samp{rcs -U} to switch to non-strict locking for a particular file, -see the @code{rcs} manual page for details. - - When deducing the version control state of an RCS file, VC first -looks for an RCS version header string in the file (@pxref{Version -Headers}). If there is no header string, VC normally looks at the -file permissions of the work file; this is fast. But there might be -situations when the file permissions cannot be trusted. In this case -the master file has to be consulted, which is rather expensive. Also -the master file can only tell you @emph{if} there's any lock on the -file, but not whether your work file really contains that locked -version. - -@vindex vc-consult-headers - You can tell VC not to use version headers to determine the file -status by setting @code{vc-consult-headers} to @code{nil}. VC then -always uses the file permissions (if it is supposed to trust them), or -else checks the master file. - -@vindex vc-mistrust-permissions - You can specify the criterion for whether to trust the file -permissions by setting the variable @code{vc-mistrust-permissions}. -Its value can be @code{t} (always mistrust the file permissions and -check the master file), @code{nil} (always trust the file -permissions), or a function of one argument which makes the decision. -The argument is the directory name of the @file{RCS} subdirectory. A -non-@code{nil} value from the function says to mistrust the file -permissions. If you find that the file permissions of work files are -changed erroneously, set @code{vc-mistrust-permissions} to @code{t}. -Then VC always checks the master file to determine the file's status. - - VC determines the version control state of files under SCCS much as -with RCS. It does not consider SCCS version headers, though. Thus, -the variable @code{vc-mistrust-permissions} affects SCCS use, but -@code{vc-consult-headers} does not. - -@node CVS Options -@subsubsection Options specific for CVS - -@cindex locking (CVS) - By default, CVS does not use locking to coordinate the activities of -several users; anyone can change a work file at any time. However, -there are ways to restrict this, resulting in behavior that resembles -locking. - -@cindex CVSREAD environment variable (CVS) - For one thing, you can set the @env{CVSREAD} environment variable -(the value you use makes no difference). If this variable is defined, -CVS makes your work files read-only by default. In Emacs, you must -type @kbd{C-x v v} to make the file writable, so that editing works -in fact similar as if locking was used. Note however, that no actual -locking is performed, so several users can make their files writable -at the same time. When setting @env{CVSREAD} for the first time, make -sure to check out all your modules anew, so that the file protections -are set correctly. - -@cindex cvs watch feature -@cindex watching files (CVS) - Another way to achieve something similar to locking is to use the -@dfn{watch} feature of CVS. If a file is being watched, CVS makes it -read-only by default, and you must also use @kbd{C-x v v} in Emacs to -make it writable. VC calls @code{cvs edit} to make the file writable, -and CVS takes care to notify other developers of the fact that you -intend to change the file. See the CVS documentation for details on -using the watch feature. - -@vindex vc-stay-local -@vindex vc-cvs-stay-local -@cindex remote repositories (CVS) - When a file's repository is on a remote machine, VC tries to keep -network interactions to a minimum. This is controlled by the variable -@code{vc-cvs-stay-local}. There is another variable, -@code{vc-stay-local}, which enables the feature also for other back -ends that support it, including CVS. In the following, we will talk -only about @code{vc-cvs-stay-local}, but everything applies to -@code{vc-stay-local} as well. - -If @code{vc-cvs-stay-local} is @code{t} (the default), then VC uses -only the entry in the local CVS subdirectory to determine the file's -state (and possibly information returned by previous CVS commands). -One consequence of this is that when you have modified a file, and -somebody else has already checked in other changes to the file, you -are not notified of it until you actually try to commit. (But you can -try to pick up any recent changes from the repository first, using -@kbd{C-x v m @key{RET}}, -@iftex -@pxref{Merging,,,emacs, the Emacs Manual}). -@end iftex -@ifnottex -@pxref{Merging}). -@end ifnottex - - When @code{vc-cvs-stay-local} is @code{t}, VC also makes local -version backups, so that simple diff and revert operations are -completely local (@pxref{Version Backups}). - - On the other hand, if you set @code{vc-cvs-stay-local} to @code{nil}, -then VC queries the remote repository @emph{before} it decides what to -do in @code{vc-next-action} (@kbd{C-x v v}), just as it does for local -repositories. It also does not make any version backups. - - You can also set @code{vc-cvs-stay-local} to a regular expression -that is matched against the repository host name; VC then stays local -only for repositories from hosts that match the pattern. - -@vindex vc-cvs-global-switches - You can specify additional command line options to pass to all CVS -operations in the variable @code{vc-cvs-global-switches}. These -switches are inserted immediately after the @code{cvs} command, before -the name of the operation to invoke. - -@ignore - arch-tag: 140b8629-4339-4b5e-9e50-72453e51615e -@end ignore diff --git a/man/widget.texi b/man/widget.texi deleted file mode 100644 index 0cf77ee4600..00000000000 --- a/man/widget.texi +++ /dev/null @@ -1,1855 +0,0 @@ -\input texinfo.tex - -@c %**start of header -@setfilename ../info/widget -@settitle The Emacs Widget Library -@syncodeindex fn cp -@syncodeindex vr cp -@syncodeindex ky cp -@afourpaper -@c %**end of header - -@copying -Copyright @copyright{} 2000, 2001, 2002, 2003, 2004, 2005, -2006, 2007 Free Software Foundation, Inc. - -@quotation -Permission is granted to copy, distribute and/or modify this document -under the terms of the GNU Free Documentation License, Version 1.2 or -any later version published by the Free Software Foundation; with the -Invariant Sections being ``The GNU Manifesto'', ``Distribution'' and -``GNU GENERAL PUBLIC LICENSE'', with the Front-Cover texts being ``A GNU -Manual'', and with the Back-Cover Texts as in (a) below. A copy of the -license is included in the section entitled ``GNU Free Documentation -License'' in the Emacs manual. - -This document is part of a collection distributed under the GNU Free -Documentation License. If you want to distribute this document -separately from the collection, you can do so by adding a copy of the -license to the document, as described in section 6 of the license. - -(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify -this GNU Manual, like GNU software. Copies published by the Free -Software Foundation raise funds for GNU development.'' -@end quotation -@end copying - -@dircategory Emacs -@direntry -* Widget: (widget). The "widget" package used by the Emacs Customization - facility. -@end direntry - -@node Top, Introduction, (dir), (dir) -@comment node-name, next, previous, up -@top The Emacs Widget Library - -@menu -* Introduction:: -* User Interface:: -* Programming Example:: -* Setting Up the Buffer:: -* Basic Types:: -* Sexp Types:: -* Widget Properties:: -* Defining New Widgets:: -* Widget Browser:: -* Widget Minor Mode:: -* Utilities:: -* Widget Wishlist:: -* GNU Free Documentation License:: -* Index:: -@end menu - -@node Introduction, User Interface, Top, Top -@comment node-name, next, previous, up -@section Introduction - -Most graphical user interface toolkits provide a number of standard -user interface controls (sometimes known as `widgets' or `gadgets'). -Emacs doesn't really support anything like this, except for an -incredibly powerful text ``widget.'' On the other hand, Emacs does -provide the necessary primitives to implement many other widgets -within a text buffer. The @code{widget} package simplifies this task. - -@cindex basic widgets -@cindex widgets, basic types -The basic widgets are: - -@table @code -@item link -Areas of text with an associated action. Intended for hypertext links -embedded in text. -@item push-button -Like link, but intended for stand-alone buttons. -@item editable-field -An editable text field. It can be either variable or fixed length. -@item menu-choice -Allows the user to choose one of multiple options from a menu, each -option is itself a widget. Only the selected option will be visible in -the buffer. -@item radio-button-choice -Allows the user to choose one of multiple options by activating radio -buttons. The options are implemented as widgets. All options will be -visible in the buffer. -@item item -A simple constant widget intended to be used in the @code{menu-choice} and -@code{radio-button-choice} widgets. -@item choice-item -A button item only intended for use in choices. When invoked, the user -will be asked to select another option from the choice widget. -@item toggle -A simple @samp{on}/@samp{off} switch. -@item checkbox -A checkbox (@samp{[ ]}/@samp{[X]}). -@item editable-list -Create an editable list. The user can insert or delete items in the -list. Each list item is itself a widget. -@end table - -Now, of what possible use can support for widgets be in a text editor? -I'm glad you asked. The answer is that widgets are useful for -implementing forms. A @dfn{form} in Emacs is a buffer where the user is -supposed to fill out a number of fields, each of which has a specific -meaning. The user is not supposed to change or delete any of the text -between the fields. Examples of forms in Emacs are the @file{forms} -package (of course), the customize buffers, the mail and news compose -modes, and the @acronym{HTML} form support in the @file{w3} browser. - -@cindex widget library, why use it -The advantages for a programmer of using the @code{widget} package to -implement forms are: - -@enumerate -@item -More complex fields than just editable text are supported. -@item -You can give the users immediate feedback if they enter invalid data in a -text field, and sometimes prevent entering invalid data. -@item -You can have fixed sized fields, thus allowing multiple fields to be -lined up in columns. -@item -It is simple to query or set the value of a field. -@item -Editing happens in the buffer, not in the mini-buffer. -@item -Packages using the library get a uniform look, making them easier for -the user to learn. -@item -As support for embedded graphics improve, the widget library will be -extended to use the GUI features. This means that your code using the -widget library will also use the new graphic features automatically. -@end enumerate - -In order to minimize the code that is loaded by users who do not -create any widgets, the code has been split in two files: - -@cindex widget library, files -@table @file -@item widget.el -This will declare the user variables, define the function -@code{define-widget}, and autoload the function @code{widget-create}. -@item wid-edit.el -Everything else is here, there is no reason to load it explicitly, as -it will be autoloaded when needed. -@end table - -@node User Interface, Programming Example, Introduction, Top -@comment node-name, next, previous, up -@section User Interface - -A form consists of read only text for documentation and some fields, -where each field contains two parts, a tag and a value. The tags are -used to identify the fields, so the documentation can refer to the -@samp{foo field}, meaning the field tagged with @samp{Foo}. Here is an -example form: - -@example -Here is some documentation. - -Name: @i{My Name} @strong{Choose}: This option -Address: @i{Some Place -In some City -Some country.} - -See also @b{_other work_} for more information. - -Numbers: count to three below -@b{[INS]} @b{[DEL]} @i{One} -@b{[INS]} @b{[DEL]} @i{Eh, two?} -@b{[INS]} @b{[DEL]} @i{Five!} -@b{[INS]} - -Select multiple: - -@b{[X]} This -@b{[ ]} That -@b{[X]} Thus - -Select one: - -@b{(*)} One -@b{( )} Another One. -@b{( )} A Final One. - -@b{[Apply Form]} @b{[Reset Form]} -@end example - -The top level widgets in this example are tagged @samp{Name}, -@samp{Choose}, @samp{Address}, @samp{_other work_}, @samp{Numbers}, -@samp{Select multiple}, @samp{Select one}, @samp{[Apply Form]}, and -@samp{[Reset Form]}. There are basically two things the user can do -within a form, namely editing the editable text fields and activating -the buttons. - -@subsection Editable Text Fields - -In the example, the value for the @samp{Name} is most likely displayed -in an editable text field, and so are values for each of the members of -the @samp{Numbers} list. All the normal Emacs editing operations are -available for editing these fields. The only restriction is that each -change you make must be contained within a single editable text field. -For example, capitalizing all text from the middle of one field to the -middle of another field is prohibited. - -Editable text fields are created by the @code{editable-field} widget. - -@strong{Warning:} In an @code{editable-field} widget, the editable -field must not be adjacent to another widget---that won't work. -You must put some text in between. Either make this text part of -the @code{editable-field} widget itself, or insert it with -@code{widget-insert}. - -The @code{:format} keyword is useful for generating the necessary -text; for instance, if you give it a value of @code{"Name: %v "}, -the @samp{Name: } part will provide the necessary separating text -before the field and the trailing space will provide the -separating text after the field. If you don't include the -@code{:size} keyword, the field will extend to the end of the -line, and the terminating newline will provide separation after. - -@strong{Warning:} In an @code{editable-field} widget, the @samp{%v} escape -must be preceded by some other text in the @code{:format} string -(if specified). - -The editing text fields are highlighted with the -@code{widget-field-face} face, making them easy to find. - -@deffn Face widget-field-face -Face used for other editing fields. -@end deffn - -@subsection Buttons - -@cindex widget buttons -@cindex button widgets -Some portions of the buffer have an associated @dfn{action}, which can -be @dfn{invoked} by a standard key or mouse command. These portions -are called @dfn{buttons}. The default commands for activating a button -are: - -@table @kbd -@item @key{RET} -@deffn Command widget-button-press @var{pos} &optional @var{event} -Invoke the button at @var{pos}, defaulting to point. -If point is not located on a button, invoke the binding in -@code{widget-global-map} (by default the global map). -@end deffn - -@kindex Mouse-2 @r{(on button widgets}) -@item Mouse-2 -@deffn Command widget-button-click @var{event} -Invoke the button at the location of the mouse pointer. If the mouse -pointer is located in an editable text field, invoke the binding in -@code{widget-global-map} (by default the global map). -@end deffn -@end table - -There are several different kind of buttons, all of which are present in -the example: - -@table @emph -@cindex option field tag -@item The Option Field Tags -When you invoke one of these buttons, you will be asked to choose -between a number of different options. This is how you edit an option -field. Option fields are created by the @code{menu-choice} widget. In -the example, @samp{@b{Choose}} is an option field tag. -@item The @samp{@b{[INS]}} and @samp{@b{[DEL]}} buttons -Activating these will insert or delete elements from an editable list. -The list is created by the @code{editable-list} widget. -@cindex embedded buttons -@item Embedded Buttons -The @samp{@b{_other work_}} is an example of an embedded -button. Embedded buttons are not associated with any fields, but can serve -any purpose, such as implementing hypertext references. They are -usually created by the @code{link} widget. -@item The @samp{@b{[ ]}} and @samp{@b{[X]}} buttons -Activating one of these will convert it to the other. This is useful -for implementing multiple-choice fields. You can create them with the -@code{checkbox} widget. -@item The @samp{@b{( )}} and @samp{@b{(*)}} buttons -Only one radio button in a @code{radio-button-choice} widget can be -selected at any time. When you invoke one of the unselected radio -buttons, it will be selected and the previous selected radio button will -become unselected. -@item The @samp{@b{[Apply Form]}} and @samp{@b{[Reset Form]}} buttons -These are explicit buttons made with the @code{push-button} widget. The -main difference from the @code{link} widget is that the buttons will be -displayed as GUI buttons when possible. -@end table - -To make them easier to locate, buttons are emphasized in the buffer. - -@deffn Face widget-button-face -Face used for buttons. -@end deffn - -@defopt widget-mouse-face -Face used for highlighting a button when the mouse pointer moves across -it. -@end defopt - -@subsection Navigation - -You can use all the normal Emacs commands to move around in a form -buffer, plus you will have these additional commands: - -@table @kbd -@item @key{TAB} -@deffn Command widget-forward &optional count -Move point @var{count} buttons or editing fields forward. -@end deffn -@item @kbd{M-@key{TAB}} -@itemx @kbd{S-@key{TAB}} -@deffn Command widget-backward &optional count -Move point @var{count} buttons or editing fields backward. -@end deffn -@end table - -@node Programming Example, Setting Up the Buffer, User Interface, Top -@comment node-name, next, previous, up -@section Programming Example - -@cindex widgets, programming example -@cindex example of using widgets -Here is the code to implement the user interface example (@pxref{User -Interface}). - -@lisp -(require 'widget) - -(eval-when-compile - (require 'wid-edit)) - -(defvar widget-example-repeat) - -(defun widget-example () - "Create the widgets from the Widget manual." - (interactive) - (switch-to-buffer "*Widget Example*") - (kill-all-local-variables) - (make-local-variable 'widget-example-repeat) - (let ((inhibit-read-only t)) - (erase-buffer)) - (remove-overlays) - (widget-insert "Here is some documentation.\n\n") - (widget-create 'editable-field - :size 13 - :format "Name: %v " ; Text after the field! - "My Name") - (widget-create 'menu-choice - :tag "Choose" - :value "This" - :help-echo "Choose me, please!" - :notify (lambda (widget &rest ignore) - (message "%s is a good choice!" - (widget-value widget))) - '(item :tag "This option" :value "This") - '(choice-item "That option") - '(editable-field :menu-tag "No option" "Thus option")) - (widget-create 'editable-field - :format "Address: %v" - "Some Place\nIn some City\nSome country.") - (widget-insert "\nSee also ") - (widget-create 'link - :notify (lambda (&rest ignore) - (widget-value-set widget-example-repeat - '("En" "To" "Tre")) - (widget-setup)) - "other work") - (widget-insert - " for more information.\n\nNumbers: count to three below\n") - (setq widget-example-repeat - (widget-create 'editable-list - :entry-format "%i %d %v" - :notify (lambda (widget &rest ignore) - (let ((old (widget-get widget - ':example-length)) - (new (length (widget-value widget)))) - (unless (eq old new) - (widget-put widget ':example-length new) - (message "You can count to %d." new)))) - :value '("One" "Eh, two?" "Five!") - '(editable-field :value "three"))) - (widget-insert "\n\nSelect multiple:\n\n") - (widget-create 'checkbox t) - (widget-insert " This\n") - (widget-create 'checkbox nil) - (widget-insert " That\n") - (widget-create 'checkbox - :notify (lambda (&rest ignore) (message "Tickle")) - t) - (widget-insert " Thus\n\nSelect one:\n\n") - (widget-create 'radio-button-choice - :value "One" - :notify (lambda (widget &rest ignore) - (message "You selected %s" - (widget-value widget))) - '(item "One") '(item "Another One.") '(item "A Final One.")) - (widget-insert "\n") - (widget-create 'push-button - :notify (lambda (&rest ignore) - (if (= (length (widget-value widget-example-repeat)) - 3) - (message "Congratulation!") - (error "Three was the count!"))) - "Apply Form") - (widget-insert " ") - (widget-create 'push-button - :notify (lambda (&rest ignore) - (widget-example)) - "Reset Form") - (widget-insert "\n") - (use-local-map widget-keymap) - (widget-setup)) -@end lisp - -@node Setting Up the Buffer, Basic Types, Programming Example, Top -@comment node-name, next, previous, up -@section Setting Up the Buffer - -Widgets are created with @code{widget-create}, which returns a -@dfn{widget} object. This object can be queried and manipulated by -other widget functions, until it is deleted with @code{widget-delete}. -After the widgets have been created, @code{widget-setup} must be called -to enable them. - -@defun widget-create type [ keyword argument ]@dots{} -Create and return a widget of type @var{type}. -The syntax for the @var{type} argument is described in @ref{Basic Types}. - -The keyword arguments can be used to overwrite the keyword arguments -that are part of @var{type}. -@end defun - -@defun widget-delete widget -Delete @var{widget} and remove it from the buffer. -@end defun - -@defun widget-setup -Set up a buffer to support widgets. - -This should be called after creating all the widgets and before allowing -the user to edit them. -@refill -@end defun - -If you want to insert text outside the widgets in the form, the -recommended way to do that is with @code{widget-insert}. - -@defun widget-insert -Insert the arguments, either strings or characters, at point. -The inserted text will be read-only. -@end defun - -There is a standard widget keymap which you might find useful. - -@findex widget-button-press -@findex widget-button-click -@defvr Const widget-keymap -A keymap with the global keymap as its parent.@* -@key{TAB} and @kbd{C-@key{TAB}} are bound to @code{widget-forward} and -@code{widget-backward}, respectively. @key{RET} and @kbd{Mouse-2} -are bound to @code{widget-button-press} and -@code{widget-button-click}.@refill -@end defvr - -@defvar widget-global-map -Keymap used by @code{widget-button-press} and @code{widget-button-click} -when not on a button. By default this is @code{global-map}. -@end defvar - -@node Basic Types, Sexp Types, Setting Up the Buffer, Top -@comment node-name, next, previous, up -@section Basic Types - -This is the general syntax of a type specification: - -@example -@var{name} ::= (@var{name} [@var{keyword} @var{argument}]... @var{args}) - | @var{name} -@end example - -Where, @var{name} is a widget name, @var{keyword} is the name of a -property, @var{argument} is the value of the property, and @var{args} -are interpreted in a widget specific way. - -@cindex keyword arguments -The following keyword arguments apply to all widgets: - -@table @code -@vindex value@r{ keyword} -@item :value -The initial value for widgets of this type. - -@vindex format@r{ keyword} -@item :format -This string will be inserted in the buffer when you create a widget. -The following @samp{%} escapes are available: - -@table @samp -@item %[ -@itemx %] -The text inside will be marked as a button. - -By default, the text will be shown in @code{widget-button-face}, and -surrounded by brackets. - -@defopt widget-button-prefix -String to prefix buttons. -@end defopt - -@defopt widget-button-suffix -String to suffix buttons. -@end defopt - -@item %@{ -@itemx %@} -The text inside will be displayed with the face specified by -@code{:sample-face}. - -@item %v -This will be replaced with the buffer representation of the widget's -value. What this is depends on the widget type. - -@strong{Warning:} In an @code{editable-field} widget, the @samp{%v} escape -must be preceded by some other text in the format string (if specified). - -@item %d -Insert the string specified by @code{:doc} here. - -@item %h -Like @samp{%d}, with the following modifications: If the documentation -string is more than one line, it will add a button which will toggle -between showing only the first line, and showing the full text. -Furthermore, if there is no @code{:doc} property in the widget, it will -instead examine the @code{:documentation-property} property. If it is a -lambda expression, it will be called with the widget's value as an -argument, and the result will be used as the documentation text. - -@item %t -Insert the string specified by @code{:tag} here, or the @code{princ} -representation of the value if there is no tag. - -@item %% -Insert a literal @samp{%}. -@end table - -@vindex button-face@r{ keyword} -@item :button-face -Face used to highlight text inside %[ %] in the format. - -@vindex button-prefix@r{ keyword} -@vindex button-suffix@r{ keyword} -@item :button-prefix -@itemx :button-suffix -Text around %[ %] in the format. - -These can be -@table @emph -@item nil -No text is inserted. - -@item a string -The string is inserted literally. - -@item a symbol -The value of the symbol is expanded according to this table. -@end table - -@vindex doc@r{ keyword} -@item :doc -The string inserted by the @samp{%d} escape in the format -string. - -@vindex tag@r{ keyword} -@item :tag -The string inserted by the @samp{%t} escape in the format -string. - -@vindex tag-glyph@r{ keyword} -@item :tag-glyph -Name of image to use instead of the string specified by @code{:tag} on -Emacsen that supports it. - -@vindex help-echo@r{ keyword} -@item :help-echo -Specifies how to display a message whenever you move to the widget with -either @code{widget-forward} or @code{widget-backward} or move the mouse -over it (using the standard @code{help-echo} mechanism). The argument -is either a string to display, a function of one argument, the widget, -which should return a string to display, or a form that evaluates to -such a string. - -@vindex follow-link@r{ keyword} -@item :follow-link -Specifies how to interpret a @key{mouse-1} click on the widget. -@xref{Links and Mouse-1,,, elisp, the Emacs Lisp Reference Manual}. - -@vindex indent@r{ keyword} -@item :indent -An integer indicating the absolute number of spaces to indent children -of this widget. - -@vindex offset@r{ keyword} -@item :offset -An integer indicating how many extra spaces to add to the widget's -grandchildren compared to this widget. - -@vindex extra-offset@r{ keyword} -@item :extra-offset -An integer indicating how many extra spaces to add to the widget's -children compared to this widget. - -@vindex notify@r{ keyword} -@item :notify -A function called each time the widget or a nested widget is changed. -The function is called with two or three arguments. The first argument -is the widget itself, the second argument is the widget that was -changed, and the third argument is the event leading to the change, if -any. - -@vindex menu-tag@r{ keyword} -@item :menu-tag -Tag used in the menu when the widget is used as an option in a -@code{menu-choice} widget. - -@vindex menu-tag-get@r{ keyword} -@item :menu-tag-get -Function used for finding the tag when the widget is used as an option -in a @code{menu-choice} widget. By default, the tag used will be either the -@code{:menu-tag} or @code{:tag} property if present, or the @code{princ} -representation of the @code{:value} property if not. - -@vindex match@r{ keyword} -@item :match -Should be a function called with two arguments, the widget and a value, -and returning non-@code{nil} if the widget can represent the specified value. - -@vindex validate@r{ keyword} -@item :validate -A function which takes a widget as an argument, and returns @code{nil} -if the widget's current value is valid for the widget. Otherwise it -should return the widget containing the invalid data, and set that -widget's @code{:error} property to a string explaining the error. - -The following predefined function can be used: - -@defun widget-children-validate widget -All the @code{:children} of @var{widget} must be valid. -@end defun - -@vindex tab-order@r{ keyword} -@item :tab-order -Specify the order in which widgets are traversed with -@code{widget-forward} or @code{widget-backward}. This is only partially -implemented. - -@enumerate a -@item -Widgets with tabbing order @code{-1} are ignored. - -@item -(Unimplemented) When on a widget with tabbing order @var{n}, go to the -next widget in the buffer with tabbing order @var{n+1} or @code{nil}, -whichever comes first. - -@item -When on a widget with no tabbing order specified, go to the next widget -in the buffer with a positive tabbing order, or @code{nil} -@end enumerate - -@vindex parent@r{ keyword} -@item :parent -The parent of a nested widget (e.g.@: a @code{menu-choice} item or an -element of a @code{editable-list} widget). - -@vindex sibling-args@r{ keyword} -@item :sibling-args -This keyword is only used for members of a @code{radio-button-choice} or -@code{checklist}. The value should be a list of extra keyword -arguments, which will be used when creating the @code{radio-button} or -@code{checkbox} associated with this item. - -@end table - -@deffn {User Option} widget-glyph-directory -Directory where glyphs are found. -Widget will look here for a file with the same name as specified for the -image, with either a @file{.xpm} (if supported) or @file{.xbm} extension. -@end deffn - -@deffn{User Option} widget-glyph-enable -If non-@code{nil}, allow glyphs to appear on displays where they are supported. -@end deffn - - -@menu -* link:: -* url-link:: -* info-link:: -* push-button:: -* editable-field:: -* text:: -* menu-choice:: -* radio-button-choice:: -* item:: -* choice-item:: -* toggle:: -* checkbox:: -* checklist:: -* editable-list:: -* group:: -@end menu - -@node link, url-link, Basic Types, Basic Types -@comment node-name, next, previous, up -@subsection The @code{link} Widget -@findex link@r{ widget} - -Syntax: - -@example -@var{type} ::= (link [@var{keyword} @var{argument}]... [ @var{value} ]) -@end example - -The @var{value}, if present, is used to initialize the @code{:value} -property. The value should be a string, which will be inserted in the -buffer. - -By default the link will be shown in brackets. - -@defopt widget-link-prefix -String to prefix links. -@end defopt - -@defopt widget-link-suffix -String to suffix links. -@end defopt - -@node url-link, info-link, link, Basic Types -@comment node-name, next, previous, up -@subsection The @code{url-link} Widget -@findex url-link@r{ widget} - -Syntax: - -@example -@var{type} ::= (url-link [@var{keyword} @var{argument}]... @var{url}) -@end example - -@findex browse-url-browser-function@r{, and @code{url-link} widget} -When this link is invoked, the @acronym{WWW} browser specified by -@code{browse-url-browser-function} will be called with @var{url}. - -@node info-link, push-button, url-link, Basic Types -@comment node-name, next, previous, up -@subsection The @code{info-link} Widget -@findex info-link@r{ widget} - -Syntax: - -@example -@var{type} ::= (info-link [@var{keyword} @var{argument}]... @var{address}) -@end example - -When this link is invoked, the built-in Info reader is started on -@var{address}. - -@node push-button, editable-field, info-link, Basic Types -@comment node-name, next, previous, up -@subsection The @code{push-button} Widget -@findex push-button@r{ widget} - -Syntax: - -@example -@var{type} ::= (push-button [@var{keyword} @var{argument}]... [ @var{value} ]) -@end example - -The @var{value}, if present, is used to initialize the @code{:value} -property. The value should be a string, which will be inserted in the -buffer. - -By default the tag will be shown in brackets. - -@defopt widget-push-button-prefix -String to prefix push buttons. -@end defopt - -@defopt widget-push-button-suffix -String to suffix push buttons. -@end defopt - -@node editable-field, text, push-button, Basic Types -@comment node-name, next, previous, up -@subsection The @code{editable-field} Widget -@findex editable-field@r{ widget} - -Syntax: - -@example -@var{type} ::= (editable-field [@var{keyword} @var{argument}]... [ @var{value} ]) -@end example - -The @var{value}, if present, is used to initialize the @code{:value} -property. The value should be a string, which will be inserted in the -field. This widget will match all string values. - -The following extra properties are recognized: - -@table @code -@vindex size@r{ keyword} -@item :size -The width of the editable field.@* -By default the field will reach to the end of the line. - -@vindex value-face@r{ keyword} -@item :value-face -Face used for highlighting the editable field. Default is -@code{widget-field-face}, see @ref{User Interface}. - -@vindex secret@r{ keyword} -@item :secret -Character used to display the value. You can set this to e.g.@: @code{?*} -if the field contains a password or other secret information. By -default, this is @code{nil}, and the value is not secret. - -@vindex valid-regexp@r{ keyword} -@item :valid-regexp -By default the @code{:validate} function will match the content of the -field with the value of this attribute. The default value is @code{""} -which matches everything. - -@vindex keymap@r{ keyword} -@vindex widget-field-keymap -@item :keymap -Keymap used in the editable field. The default value is -@code{widget-field-keymap}, which allows you to use all the normal -editing commands, even if the buffer's major mode suppresses some of -them. Pressing @key{RET} invokes the function specified by -@code{:action}. -@end table - -@node text, menu-choice, editable-field, Basic Types -@comment node-name, next, previous, up -@subsection The @code{text} Widget -@findex text@r{ widget} - -@vindex widget-text-keymap -This is just like @code{editable-field}, but intended for multiline text -fields. The default @code{:keymap} is @code{widget-text-keymap}, which -does not rebind the @key{RET} key. - -@node menu-choice, radio-button-choice, text, Basic Types -@comment node-name, next, previous, up -@subsection The @code{menu-choice} Widget -@findex menu-choice@r{ widget} - -Syntax: - -@example -@var{type} ::= (menu-choice [@var{keyword} @var{argument}]... @var{type} ... ) -@end example - -The @var{type} argument represents each possible choice. The widget's -value will be that of the chosen @var{type} argument. This widget will -match any value matching at least one of the specified @var{type} -arguments. - -@table @code -@vindex void@r{ keyword} -@item :void -Widget type used as a fallback when the value does not match any of the -specified @var{type} arguments. - -@vindex case-fold@r{ keyword} -@item :case-fold -Set this to @code{nil} if you don't want to ignore case when prompting for a -choice through the minibuffer. - -@vindex children@r{ keyword} -@item :children -A list whose @sc{car} is the widget representing the currently chosen -type in the buffer. - -@vindex choice@r{ keyword} -@item :choice -The current chosen type. - -@vindex args@r{ keyword} -@item :args -The list of types. -@end table - -@node radio-button-choice, item, menu-choice, Basic Types -@comment node-name, next, previous, up -@subsection The @code{radio-button-choice} Widget -@findex radio-button-choice@r{ widget} - -Syntax: - -@example -@var{type} ::= (radio-button-choice [@var{keyword} @var{argument}]... @var{type} ... ) -@end example - -The component types specify the choices, with one radio button for -each. The widget's value will be that of the chosen @var{type} -argument. This widget matches any value that matches at least one of -the specified @var{type} arguments. - -The following extra properties are recognized. - -@table @code -@vindex entry-format@r{ keyword} -@item :entry-format -This string will be inserted for each entry in the list. -The following @samp{%} escapes are available: -@table @samp -@item %v -Replace with the buffer representation of the @var{type} widget. -@item %b -Replace with the radio button. -@item %% -Insert a literal @samp{%}. -@end table - -@vindex button-args@r{ keyword} -@item :button-args -A list of keywords to pass to the radio buttons. Useful for setting -e.g.@: the @samp{:help-echo} for each button. - -@vindex buttons@r{ keyword} -@item :buttons -The widgets representing the radio buttons. - -@vindex children@r{ keyword} -@item :children -The widgets representing each type. - -@vindex choice@r{ keyword} -@item :choice -The current chosen type - -@vindex args@r{ keyword} -@item :args -The list of types. -@end table - -You can add extra radio button items to a @code{radio-button-choice} -widget after it has been created with the function -@code{widget-radio-add-item}. - -@defun widget-radio-add-item widget type -Add to @code{radio-button-choice} widget @var{widget} a new radio button -item of type @var{type}. -@end defun - -Please note that such items added after the @code{radio-button-choice} -widget has been created will @strong{not} be properly destructed when -you call @code{widget-delete}. - -@node item, choice-item, radio-button-choice, Basic Types -@comment node-name, next, previous, up -@subsection The @code{item} Widget -@findex item@r{ widget} - -Syntax: - -@example -@var{item} ::= (item [@var{keyword} @var{argument}]... @var{value}) -@end example - -The @var{value}, if present, is used to initialize the @code{:value} -property. The value should be a string, which will be inserted in the -buffer. This widget will only match the specified value. - -@node choice-item, toggle, item, Basic Types -@comment node-name, next, previous, up -@subsection The @code{choice-item} Widget -@findex choice-item@r{ widget} - -Syntax: - -@example -@var{item} ::= (choice-item [@var{keyword} @var{argument}]... @var{value}) -@end example - -The @var{value}, if present, is used to initialize the @code{:value} -property. The value should be a string, which will be inserted in the -buffer as a button. Activating the button of a @code{choice-item} is -equivalent to activating the parent widget. This widget will only match -the specified value. - -@node toggle, checkbox, choice-item, Basic Types -@comment node-name, next, previous, up -@subsection The @code{toggle} Widget -@findex toggle@r{ widget} - -Syntax: - -@example -@var{type} ::= (toggle [@var{keyword} @var{argument}]...) -@end example - -The widget has two possible states, @samp{on} and @samp{off}, which -correspond to a @code{t} or @code{nil} value, respectively. - -The following extra properties are recognized: - -@table @code -@item :on -A string representing the @samp{on} state. By default the string -@samp{on}. -@item :off -A string representing the @samp{off} state. By default the string -@samp{off}. -@vindex on-glyph@r{ keyword} -@item :on-glyph -Name of a glyph to be used instead of the @samp{:on} text string, on -emacsen that supports this. -@vindex off-glyph@r{ keyword} -@item :off-glyph -Name of a glyph to be used instead of the @samp{:off} text string, on -emacsen that supports this. -@end table - -@node checkbox, checklist, toggle, Basic Types -@comment node-name, next, previous, up -@subsection The @code{checkbox} Widget -@findex checkbox@r{ widget} - -This widget has two possible states, @samp{selected} and -@samp{unselected}, which corresponds to a @code{t} or @code{nil} value. - -Syntax: - -@example -@var{type} ::= (checkbox [@var{keyword} @var{argument}]...) -@end example - -@node checklist, editable-list, checkbox, Basic Types -@comment node-name, next, previous, up -@subsection The @code{checklist} Widget -@findex checklist@r{ widget} - -Syntax: - -@example -@var{type} ::= (checklist [@var{keyword} @var{argument}]... @var{type} ... ) -@end example - -The @var{type} arguments represent each checklist item. The widget's -value will be a list containing the values of all checked @var{type} -arguments. The checklist widget will match a list whose elements all -match at least one of the specified @var{type} arguments. - -The following extra properties are recognized: - -@table @code -@vindex entry-format@r{ keyword} -@item :entry-format -This string will be inserted for each entry in the list. -The following @samp{%} escapes are available: -@table @samp -@item %v -Replaced with the buffer representation of the @var{type} widget. -@item %b -Replace with the checkbox. -@item %% -Insert a literal @samp{%}. -@end table - -@vindex greedy@r{ keyword} -@item :greedy -Usually a checklist will only match if the items are in the exact -sequence given in the specification. By setting @code{:greedy} to -non-@code{nil}, it will allow the items to come in any sequence. -However, if you extract the value they will be in the sequence given -in the checklist, i.e.@: the original sequence is forgotten. - -@vindex button-args@r{ keyword} -@item :button-args -A list of keywords to pass to the checkboxes. Useful for setting -e.g.@: the @samp{:help-echo} for each checkbox. - -@vindex buttons@r{ keyword} -@item :buttons -The widgets representing the checkboxes. - -@vindex children@r{ keyword} -@item :children -The widgets representing each type. - -@vindex args@r{ keyword} -@item :args -The list of types. -@end table - -@node editable-list, group, checklist, Basic Types -@comment node-name, next, previous, up -@subsection The @code{editable-list} Widget -@findex editable-list@r{ widget} - -Syntax: - -@example -@var{type} ::= (editable-list [@var{keyword} @var{argument}]... @var{type}) -@end example - -The value is a list, where each member represents one widget of type -@var{type}. - -The following extra properties are recognized: - -@table @code -@vindex entry-format@r{ keyword} -@item :entry-format -This string will be inserted for each entry in the list. -The following @samp{%} escapes are available: -@table @samp -@item %v -This will be replaced with the buffer representation of the @var{type} -widget. -@item %i -Insert the @b{[INS]} button. -@item %d -Insert the @b{[DEL]} button. -@item %% -Insert a literal @samp{%}. -@end table - -@vindex insert-button-args@r{ keyword} -@item :insert-button-args -A list of keyword arguments to pass to the insert buttons. - -@vindex delete-button-args@r{ keyword} -@item :delete-button-args -A list of keyword arguments to pass to the delete buttons. - -@vindex append-button-args@r{ keyword} -@item :append-button-args -A list of keyword arguments to pass to the trailing insert button. - -@vindex buttons@r{ keyword} -@item :buttons -The widgets representing the insert and delete buttons. - -@vindex children@r{ keyword} -@item :children -The widgets representing the elements of the list. - -@vindex args@r{ keyword} -@item :args -List whose @sc{car} is the type of the list elements. -@end table - -@node group, , editable-list, Basic Types -@comment node-name, next, previous, up -@subsection The @code{group} Widget -@findex group@r{ widget} - -This widget simply group other widgets together. - -Syntax: - -@example -@var{type} ::= (group [@var{keyword} @var{argument}]... @var{type}...) -@end example - -The value is a list, with one member for each @var{type}. - -@node Sexp Types, Widget Properties, Basic Types, Top -@comment -@section Sexp Types -@cindex sexp types - -A number of widgets for editing @dfn{s-expressions} (Lisp types), sexp -for short, are also available. These basically fall in several -categories described in this section. - -@menu -* constants:: -* generic:: -* atoms:: -* composite:: -@end menu - -@node constants, generic, Sexp Types, Sexp Types -@comment node-name, next, previous, up -@subsection The Constant Widgets -@cindex constant widgets - -The @code{const} widget can contain any Lisp expression, but the user is -prohibited from editing it, which is mainly useful as a component of one -of the composite widgets. - -The syntax for the @code{const} widget is: - -@example -@var{type} ::= (const [@var{keyword} @var{argument}]... [ @var{value} ]) -@end example - -The @var{value}, if present, is used to initialize the @code{:value} -property and can be any s-expression. - -@deffn Widget const -This will display any valid s-expression in an immutable part of the -buffer. -@end deffn - -There are two variations of the @code{const} widget, namely -@code{variable-item} and @code{function-item}. These should contain a -symbol with a variable or function binding. The major difference from -the @code{const} widget is that they will allow the user to see the -variable or function documentation for the symbol. - -@deffn Widget variable-item -An immutable symbol that is bound as a variable. -@end deffn - -@deffn Widget function-item -An immutable symbol that is bound as a function. -@end deffn - -@node generic, atoms, constants, Sexp Types -@comment node-name, next, previous, up -@subsection Generic Sexp Widget -@cindex generic sexp widget - -The @code{sexp} widget can contain any Lisp expression, and allows the -user to edit it inline in the buffer. - -The syntax for the @code{sexp} widget is: - -@example -@var{type} ::= (sexp [@var{keyword} @var{argument}]... [ @var{value} ]) -@end example - -@deffn Widget sexp -This will allow you to edit any valid s-expression in an editable buffer -field. - -The @code{sexp} widget takes the same keyword arguments as the -@code{editable-field} widget. @xref{editable-field}. -@end deffn - -@node atoms, composite, generic, Sexp Types -@comment node-name, next, previous, up -@subsection Atomic Sexp Widgets -@cindex atomic sexp widget - -The atoms are s-expressions that do not consist of other s-expressions. -For example, a string, a file name, or a symbol are atoms, while a list -is a composite type. You can edit the value of an atom with the -following widgets. - -The syntax for all the atoms are: - -@example -@var{type} ::= (@var{construct} [@var{keyword} @var{argument}]... [ @var{value} ]) -@end example - -The @var{value}, if present, is used to initialize the @code{:value} -property and must be an expression of the same type as the widget. -That is, the string widget can only be initialized with a string. - -All the atom widgets take the same keyword arguments as the -@code{editable-field} widget. @xref{editable-field}. - -@deffn Widget string -Allows you to edit a string in an editable field. -@end deffn - -@deffn Widget regexp -Allows you to edit a regular expression in an editable field. -@end deffn - -@deffn Widget character -Allows you to enter a character in an editable field. -@end deffn - -@deffn Widget file -Allows you to edit a file name in an editable field. - -Keywords: -@table @code -@vindex must-match@r{ keyword} -@item :must-match -If this is set to non-@code{nil}, only existing file names will be -allowed in the minibuffer. -@end table -@end deffn - -@deffn Widget directory -Allows you to edit a directory name in an editable field. -Similar to the @code{file} widget. -@end deffn - -@deffn Widget symbol -Allows you to edit a Lisp symbol in an editable field. -@end deffn - -@deffn Widget function -Allows you to edit a lambda expression, or a function name with completion. -@end deffn - -@deffn Widget variable -Allows you to edit a variable name, with completion. -@end deffn - -@deffn Widget integer -Allows you to edit an integer in an editable field. -@end deffn - -@deffn Widget number -Allows you to edit a number in an editable field. -@end deffn - -@deffn Widget boolean -Allows you to edit a boolean. In Lisp this means a variable which is -either @code{nil} meaning false, or non-@code{nil} meaning true. -@end deffn - - -@node composite, , atoms, Sexp Types -@comment node-name, next, previous, up -@subsection Composite Sexp Widgets -@cindex composite sexp widgets - -The syntax for the composite widget construct is: - -@example -@var{type} ::= (@var{construct} [@var{keyword} @var{argument}]... @var{component}...) -@end example - -@noindent -where each @var{component} must be a widget type. Each component widget -will be displayed in the buffer, and will be editable by the user. - -@deffn Widget cons -The value of a @code{cons} widget must be a cons-cell whose @sc{car} -and @sc{cdr} have two specified types. It uses this syntax: - -@example -@var{type} ::= (cons [@var{keyword} @var{argument}]... @var{car-type} @var{cdr-type}) -@end example -@end deffn - -@deffn Widget choice -The value matched by a @code{choice} widget must have one of a fixed -set of types. The widget's syntax is as follows: - -@example -@var{type} ::= (choice [@var{keyword} @var{argument}]... @var{type} ... ) -@end example - -The value of a @code{choice} widget can be anything that matches any of the -@var{types}. -@end deffn - -@deffn Widget list -The value of a @code{list} widget must be a list whose element types -match the specified component types: - -@example -@var{type} ::= (list [@var{keyword} @var{argument}]... @var{component-type}...) -@end example - -Thus, @code{(list string number)} matches lists of two elements, -the first being a string and the second being a number. -@end deffn - -@deffn Widget vector -The @code{vector} widget is like the @code{list} widget but matches -vectors instead of lists. Thus, @code{(vector string number)} matches -vectors of two elements, the first being a string and the second being -a number. -@end deffn - -The above suffice for specifying fixed size lists and vectors. To get -variable length lists and vectors, you can use a @code{choice}, -@code{set}, or @code{repeat} widget together with the @code{:inline} -keyword. If any component of a composite widget has the -@code{:inline} keyword set, its value must be a list which will then -be spliced into the composite. For example, to specify a list whose -first element must be a file name, and whose remaining elements should -either be the symbol @code{t} or two strings (file names), you can use -the following widget specification: - -@example -(list file - (choice (const t) - (list :inline t - :value ("foo" "bar") - string string))) -@end example - -The value of a widget of this type will either have the form -@code{(file t)} or @code{(file @var{string} @var{string})}. - -This concept of @code{:inline} may be hard to understand. It was -certainly hard to implement, so instead of confusing you more by -trying to explain it here, I'll just suggest you meditate over it for -a while. - -@deffn Widget set -Specifies a type whose values are the lists whose elements all belong -to a given set. The order of elements of the list is not significant. -Here's the syntax: - -@example -@var{type} ::= (set [@var{keyword} @var{argument}]... @var{permitted-element} ... ) -@end example - -Use @code{const} to specify each permitted element, like this: -@code{(set (const a) (const b))}. -@end deffn - -@deffn Widget repeat -Specifies a list of any number of elements that fit a certain type. - -@example -@var{type} ::= (repeat [@var{keyword} @var{argument}]... @var{type}) -@end example -@end deffn - -@node Widget Properties, Defining New Widgets, Sexp Types, Top -@comment node-name, next, previous, up -@section Properties -@cindex properties of widgets -@cindex widget properties - -You can examine or set the value of a widget by using the widget object -that was returned by @code{widget-create}. - -@defun widget-value widget -Return the current value contained in @var{widget}. -It is an error to call this function on an uninitialized widget. -@end defun - -@defun widget-value-set widget value -Set the value contained in @var{widget} to @var{value}. -It is an error to call this function with an invalid @var{value}. -@end defun - -@strong{Important:} You @emph{must} call @code{widget-setup} after -modifying the value of a widget before the user is allowed to edit the -widget again. It is enough to call @code{widget-setup} once if you -modify multiple widgets. This is currently only necessary if the widget -contains an editing field, but may be necessary for other widgets in the -future. - -If your application needs to associate some information with the widget -objects, for example a reference to the item being edited, it can be -done with @code{widget-put} and @code{widget-get}. The property names -must begin with a @samp{:}. - -@defun widget-put widget property value -In @var{widget} set @var{property} to @var{value}. -@var{property} should be a symbol, while @var{value} can be anything. -@end defun - -@defun widget-get widget property -In @var{widget} return the value for @var{property}. -@var{property} should be a symbol, the value is what was last set by -@code{widget-put} for @var{property}. -@end defun - -@defun widget-member widget property -Non-@code{nil} if @var{widget} has a value (even @code{nil}) for -property @var{property}. -@end defun - -Occasionally it can be useful to know which kind of widget you have, -i.e.@: the name of the widget type you gave when the widget was created. - -@defun widget-type widget -Return the name of @var{widget}, a symbol. -@end defun - -@cindex active widget -@cindex inactive widget -@cindex activate a widget -@cindex deactivate a widget -Widgets can be in two states: active, which means they are modifiable by -the user, or inactive, which means they cannot be modified by the user. -You can query or set the state with the following code: - -@lisp -;; Examine if @var{widget} is active or not. -(if (widget-apply @var{widget} :active) - (message "Widget is active.") - (message "Widget is inactive.") - -;; Make @var{widget} inactive. -(widget-apply @var{widget} :deactivate) - -;; Make @var{widget} active. -(widget-apply @var{widget} :activate) -@end lisp - -A widget is inactive if it, or any of its ancestors (found by -following the @code{:parent} link), have been deactivated. To make sure -a widget is really active, you must therefore activate both it and -all its ancestors. - -@lisp -(while widget - (widget-apply widget :activate) - (setq widget (widget-get widget :parent))) -@end lisp - -You can check if a widget has been made inactive by examining the value -of the @code{:inactive} keyword. If this is non-@code{nil}, the widget itself -has been deactivated. This is different from using the @code{:active} -keyword, in that the latter tells you if the widget @strong{or} any of -its ancestors have been deactivated. Do not attempt to set the -@code{:inactive} keyword directly. Use the @code{:activate} -@code{:deactivate} keywords instead. - - -@node Defining New Widgets, Widget Browser, Widget Properties, Top -@comment node-name, next, previous, up -@section Defining New Widgets -@cindex new widgets -@cindex defining new widgets - -You can define specialized widgets with @code{define-widget}. It allows -you to create a shorthand for more complex widgets, including specifying -component widgets and new default values for the keyword -arguments. - -@defun define-widget name class doc &rest args -Define a new widget type named @var{name} from @code{class}. - -@var{name} and class should both be symbols, @code{class} should be one -of the existing widget types. - -The third argument @var{doc} is a documentation string for the widget. - -After the new widget has been defined, the following two calls will -create identical widgets: - -@itemize @bullet -@item -@lisp -(widget-create @var{name}) -@end lisp - -@item -@lisp -(apply widget-create @var{class} @var{args}) -@end lisp -@end itemize - -@end defun - -Using @code{define-widget} just stores the definition of the widget type -in the @code{widget-type} property of @var{name}, which is what -@code{widget-create} uses. - -If you only want to specify defaults for keywords with no complex -conversions, you can use @code{identity} as your conversion function. - -The following additional keyword arguments are useful when defining new -widgets: -@table @code -@vindex convert-widget@r{ keyword} -@item :convert-widget -Function to convert a widget type before creating a widget of that -type. It takes a widget type as an argument, and returns the converted -widget type. When a widget is created, this function is called for the -widget type and all the widget's parent types, most derived first. - -The following predefined functions can be used here: - -@defun widget-types-convert-widget widget -Convert @code{:args} as widget types in @var{widget}. -@end defun - -@defun widget-value-convert-widget widget -Initialize @code{:value} from @code{:args} in @var{widget}. -@end defun - -@vindex copy@r{ keyword} -@item :copy -Function to deep copy a widget type. It takes a shallow copy of the -widget type as an argument (made by @code{copy-sequence}), and returns a -deep copy. The purpose of this is to avoid having different instances -of combined widgets share nested attributes. - -The following predefined functions can be used here: - -@defun widget-types-copy widget -Copy @code{:args} as widget types in @var{widget}. -@end defun - -@vindex value-to-internal@r{ keyword} -@item :value-to-internal -Function to convert the value to the internal format. The function -takes two arguments, a widget and an external value, and returns the -internal value. The function is called on the present @code{:value} -when the widget is created, and on any value set later with -@code{widget-value-set}. - -@vindex value-to-external@r{ keyword} -@item :value-to-external -Function to convert the value to the external format. The function -takes two arguments, a widget and an internal value, and returns the -external value. The function is called on the present @code{:value} -when the widget is created, and on any value set later with -@code{widget-value-set}. - -@vindex create@r{ keyword} -@item :create -Function to create a widget from scratch. The function takes one -argument, a widget type, and creates a widget of that type, inserts it -in the buffer, and returns a widget object. - -@vindex delete@r{ keyword} -@item :delete -Function to delete a widget. The function takes one argument, a widget, -and should remove all traces of the widget from the buffer. - -The default value is: - -@defun widget-default-delete widget -Remove @var{widget} from the buffer. -Delete all @code{:children} and @code{:buttons} in @var{widget}. -@end defun - -In most cases you should not change this value, but instead use -@code{:value-delete} to make any additional cleanup. - -@vindex value-create@r{ keyword} -@item :value-create -Function to expand the @samp{%v} escape in the format string. It will -be called with the widget as its argument and should insert a -representation of the widget's value in the buffer. - -Nested widgets should be listed in @code{:children} or @code{:buttons} -to make sure they are automatically deleted. - -@vindex value-delete@r{ keyword} -@item :value-delete -Should remove the representation of the widget's value from the buffer. -It will be called with the widget as its argument. It doesn't have to -remove the text, but it should release markers and delete nested widgets -if these are not listed in @code{:children} or @code{:buttons}. - -@vindex value-get@r{ keyword} -@item :value-get -Function to extract the value of a widget, as it is displayed in the -buffer. - -The following predefined function can be used here: - -@defun widget-value-value-get widget -Return the @code{:value} property of @var{widget}. -@end defun - -@vindex format-handler@r{ keyword} -@item :format-handler -Function to handle unknown @samp{%} escapes in the format string. It -will be called with the widget and the character that follows the -@samp{%} as arguments. You can set this to allow your widget to handle -non-standard escapes. - -@findex widget-default-format-handler -You should end up calling @code{widget-default-format-handler} to handle -unknown escape sequences, which will handle the @samp{%h} and any future -escape sequences, as well as give an error for unknown escapes. - -@vindex action@r{ keyword} -@item :action -Function to handle user initiated events. By default, @code{:notify} -the parent. - -The following predefined function can be used here: - -@defun widget-parent-action widget &optional event -Tell @code{:parent} of @var{widget} to handle the @code{:action}. -Optional @var{event} is the event that triggered the action. -@end defun - -@vindex prompt-value@r{ keyword} -@item :prompt-value -Function to prompt for a value in the minibuffer. The function should -take four arguments, @var{widget}, @var{prompt}, @var{value}, and -@var{unbound} and should return a value for widget entered by the user. -@var{prompt} is the prompt to use. @var{value} is the default value to -use, unless @var{unbound} is non-@code{nil}, in which case there is no default -value. The function should read the value using the method most natural -for this widget, and does not have to check that it matches. -@end table - -If you want to define a new widget from scratch, use the @code{default} -widget as its base. - -@deffn Widget default -Widget used as a base for other widgets. - -It provides most of the functionality that is referred to as ``by -default'' in this text. -@end deffn - -@node Widget Browser, Widget Minor Mode, Defining New Widgets, Top -@comment node-name, next, previous, up -@section Widget Browser -@cindex widget browser - -There is a separate package to browse widgets. This is intended to help -programmers who want to examine the content of a widget. The browser -shows the value of each keyword, but uses links for certain keywords -such as @samp{:parent}, which avoids printing cyclic structures. - -@deffn Command widget-browse @var{widget} -Create a widget browser for @var{widget}. -When called interactively, prompt for @var{widget}. -@end deffn - -@deffn Command widget-browse-other-window @var{widget} -Create a widget browser for @var{widget} and show it in another window. -When called interactively, prompt for @var{widget}. -@end deffn - -@deffn Command widget-browse-at @var{pos} -Create a widget browser for the widget at @var{pos}. -When called interactively, use the position of point. -@end deffn - -@node Widget Minor Mode, Utilities, Widget Browser, Top -@comment node-name, next, previous, up -@section Widget Minor Mode -@cindex widget minor mode - -There is a minor mode for manipulating widgets in major modes that -don't provide any support for widgets themselves. This is mostly -intended to be useful for programmers doing experiments. - -@deffn Command widget-minor-mode -Toggle minor mode for traversing widgets. -With arg, turn widget mode on if and only if arg is positive. -@end deffn - -@defvar widget-minor-mode-keymap -Keymap used in @code{widget-minor-mode}. -@end defvar - -@node Utilities, Widget Wishlist, Widget Minor Mode, Top -@comment node-name, next, previous, up -@section Utilities. -@cindex utility functions for widgets - -@defun widget-prompt-value widget prompt [ value unbound ] -Prompt for a value matching @var{widget}, using @var{prompt}. -The current value is assumed to be @var{value}, unless @var{unbound} is -non-@code{nil}.@refill -@end defun - -@defun widget-get-sibling widget -Get the item which @var{widget} is assumed to toggle. -This is only meaningful for radio buttons or checkboxes in a list. -@end defun - -@node Widget Wishlist, GNU Free Documentation License, Utilities, Top -@comment node-name, next, previous, up -@section Wishlist -@cindex todo - -@itemize @bullet -@item -It should be possible to add or remove items from a list with @kbd{C-k} -and @kbd{C-o} (suggested by @sc{rms}). - -@item -The @samp{[INS]} and @samp{[DEL]} buttons should be replaced by a single -dash (@samp{-}). The dash should be a button that, when invoked, asks -whether you want to add or delete an item (@sc{rms} wanted to git rid of -the ugly buttons, the dash is my idea). - -@item -The @code{menu-choice} tag should be prettier, something like the abbreviated -menus in Open Look. - -@item -Finish @code{:tab-order}. - -@item -Make indentation work with glyphs and proportional fonts. - -@item -Add commands to show overview of object and class hierarchies to the -browser. - -@item -Find a way to disable mouse highlight for inactive widgets. - -@item -Find a way to make glyphs look inactive. - -@item -Add @code{property-list} widget. - -@item -Add @code{association-list} widget. - -@item -Add @code{key-binding} widget. - -@item -Add @code{widget} widget for editing widget specifications. - -@item -Find clean way to implement variable length list. -See @code{TeX-printer-list} for an explanation. - -@item -@kbd{C-h} in @code{widget-prompt-value} should give type specific help. - -@item -Add a @code{mailto} widget. -@end itemize - -@node GNU Free Documentation License, Index, Widget Wishlist, Top -@appendix GNU Free Documentation License -@include doclicense.texi - -@node Index, , GNU Free Documentation License, Top -@comment node-name, next, previous, up -@unnumbered Index - -This is an alphabetical listing of all concepts, functions, commands, -variables, and widgets described in this manual. -@printindex cp - -@setchapternewpage odd -@contents -@bye - -@ignore - arch-tag: 2b427731-4c61-4e72-85de-5ccec9c623f0 -@end ignore diff --git a/man/xresources.texi b/man/xresources.texi deleted file mode 100644 index c402ec89f88..00000000000 --- a/man/xresources.texi +++ /dev/null @@ -1,1216 +0,0 @@ -@c This is part of the Emacs manual. -@c Copyright (C) 1987, 1993, 1994, 1995, 1997, 2001, 2002, 2003, -@c 2004, 2005, 2006, 2007 Free Software Foundation, Inc. -@c See file emacs.texi for copying conditions. -@node X Resources, Antinews, Emacs Invocation, Top -@appendix X Options and Resources - - You can customize some X-related aspects of Emacs behavior using X -resources, as is usual for programs that use X. On MS-Windows, you -can customize some of the same aspects using the system registry. -@xref{MS-Windows Registry}. Likewise, Emacs on MacOS Carbon emulates X -resources using the Preferences system. @xref{Mac Environment Variables}. - - When Emacs is built using an ``X toolkit'', such as Lucid or -LessTif, you need to use X resources to customize the appearance of -the widgets, including the menu-bar, scroll-bar, and dialog boxes. -This is because the libraries that implement these don't provide for -customization through Emacs. GTK+ widgets use a separate system of -@ifnottex -``GTK resources'', which we will also describe. -@end ifnottex -@iftex -``GTK resources.'' In this chapter we describe the most commonly used -resource specifications. For full documentation, see the online -manual. - -@c Add xref for LessTif/Motif menu resources. -@end iftex - - -@menu -* Resources:: Using X resources with Emacs (in general). -* Table of Resources:: Table of specific X resources that affect Emacs. -* Face Resources:: X resources for customizing faces. -* Lucid Resources:: X resources for Lucid menus. -* LessTif Resources:: X resources for LessTif and Motif menus. -* GTK resources:: Resources for GTK widgets. -@end menu - -@node Resources -@appendixsec X Resources -@cindex resources -@cindex X resources -@cindex @file{~/.Xdefaults} file -@cindex @file{~/.Xresources} file - - Programs running under the X Window System organize their user -options under a hierarchy of classes and resources. You can specify -default values for these options in your X resources file, usually -named @file{~/.Xdefaults} or @file{~/.Xresources}. -If changes in @file{~/.Xdefaults} do not -take effect, it is because your X server stores its own list of -resources; to update them, use the shell command @command{xrdb}---for -instance, @samp{xrdb ~/.Xdefaults}. - - Each line in the file specifies a value for one option or for a -collection of related options, for one program or for several programs -(optionally even for all programs). - -@cindex Registry (MS-Windows) - MS-Windows systems do not support @file{~/.Xdefaults} files, so -instead Emacs compiled for Windows looks for X resources in the -Windows Registry, first under the key -@samp{HKEY_CURRENT_USER\SOFTWARE\GNU\Emacs} and then under the key -@samp{HKEY_LOCAL_MACHINE\SOFTWARE\GNU\Emacs}. The menu and scroll -bars are native widgets on MS-Windows, so they are only customizable -via the system-wide settings in the Display Control Panel. You can -also set resources using the @samp{-xrm} command line option (see -below.) - -@iftex - Applications such as Emacs look for resources with specific names -and their particular meanings. Case distinctions are significant in -these names. Each resource specification in @file{~/.Xdefaults} -states the name of the program and the name of the resource. For -Emacs, the program name is @samp{Emacs}. It looks like this: - -@example -Emacs.borderWidth: 2 -@end example -@end iftex -@ifnottex - Programs define named resources with particular meanings. They also -define how to group resources into named classes. For instance, in -Emacs, the @samp{internalBorder} resource controls the width of the -internal border, and the @samp{borderWidth} resource controls the width -of the external border. Both of these resources are part of the -@samp{BorderWidth} class. Case distinctions are significant in these -names. - - Every resource definition is associated with a specific program -name---the name of the executable file that you ran. For Emacs, that -is normally @samp{emacs}. To specify a definition for all instances -of Emacs, regardless of their names, use @samp{Emacs}. - - In @file{~/.Xdefaults}, you can specify a value for a single resource -on one line, like this: - -@example -emacs.borderWidth: 2 -@end example - -@noindent -Or you can use a class name to specify the same value for all resources -in that class. Here's an example: - -@example -emacs.BorderWidth: 2 -@end example - - If you specify a value for a class, it becomes the default for all -resources in that class. You can specify values for individual -resources as well; these override the class value, for those particular -resources. Thus, this example specifies 2 as the default width for all -borders, but overrides this value with 4 for the external border: - -@example -emacs.BorderWidth: 2 -emacs.borderWidth: 4 -@end example -@end ifnottex - - The order in which the lines appear in the file does not matter. -Also, command-line options always override the X resources file. - -@ifnottex -Here is a list of X command-line options and their corresponding -resource names. - -@table @samp -@item -name @var{name} -@opindex --name -@itemx --name=@var{name} -@cindex resource name, command-line argument -Use @var{name} as the resource name (and the title) for the initial -Emacs frame. This option does not affect subsequent frames, but Lisp -programs can specify frame names when they create frames. - -If you don't specify this option, the default is to use the Emacs -executable's name as the resource name. - -@item -xrm @var{resource-values} -@opindex --xrm -@itemx --xrm=@var{resource-values} -@cindex resource values, command-line argument -Specify X resource values for this Emacs job (see below). -@end table - - For consistency, @samp{-name} also specifies the name to use for -other resource values that do not belong to any particular frame. - - The resources that name Emacs invocations also belong to a class; its -name is @samp{Emacs}. If you write @samp{Emacs} instead of -@samp{emacs}, the resource applies to all frames in all Emacs jobs, -regardless of frame titles and regardless of the name of the executable -file. Here is an example: - -@example -Emacs.BorderWidth: 2 -Emacs.borderWidth: 4 -@end example - - You can specify a string of additional resource values for Emacs to -use with the command line option @samp{-xrm @var{resources}}. The text -@var{resources} should have the same format that you would use inside a file -of X resources. To include multiple resource specifications in -@var{resources}, put a newline between them, just as you would in a file. -You can also use @samp{#include "@var{filename}"} to include a file full -of resource specifications. Resource values specified with @samp{-xrm} -take precedence over all other resource specifications. - - One way to experiment with the effect of different resource settings -is to use the @code{editres} program. Select @samp{Get Tree} from the -@end ifnottex -@iftex - You can experiment with the effect of different resource settings -with the @code{editres} program. Select @samp{Get Tree} from the -@end iftex -@samp{Commands} menu, then click on an Emacs frame. This will display -a tree showing the structure of X toolkit widgets used in an Emacs -frame. Select one of them, such as @samp{menubar}, then select -@samp{Show Resource Box} from the @samp{Commands} menu. This displays -a list of all the meaningful X resources for that widget, and allows -you to edit them. Changes take effect when you click on the -@samp{Apply} button. (See the @code{editres} man page for more -details.) - -@node Table of Resources -@appendixsec Table of X Resources for Emacs - - This table lists the resource names that designate options for -Emacs, not counting those for the appearance of the menu bar, each -with the class that it belongs to: - -@table @asis -@item @code{background} (class @code{Background}) -Background color name. - -@ifnottex -@item @code{bitmapIcon} (class @code{BitmapIcon}) -Use a bitmap icon (a picture of a gnu) if @samp{on}, let the window -manager choose an icon if @samp{off}. -@end ifnottex - -@item @code{borderColor} (class @code{BorderColor}) -Color name for the external border. - -@ifnottex -@item @code{borderWidth} (class @code{BorderWidth}) -Width in pixels of the external border. -@end ifnottex - -@item @code{cursorColor} (class @code{Foreground}) -Color name for text cursor (point). - -@ifnottex -@item @code{cursorBlink} (class @code{CursorBlink}) -Specifies whether to make the cursor blink. The default is @samp{on}. Use -@samp{off} or @samp{false} to turn cursor blinking off. -@end ifnottex - -@item @code{font} (class @code{Font}) -Font name (or fontset name, @pxref{Fontsets}) for @code{default} font. - -@item @code{foreground} (class @code{Foreground}) -Color name for text. - -@item @code{geometry} (class @code{Geometry}) -Window size and position. Be careful not to specify this resource as -@samp{emacs*geometry}, because that may affect individual menus as well -as the Emacs frame itself. - -If this resource specifies a position, that position applies only to the -initial Emacs frame (or, in the case of a resource for a specific frame -name, only that frame). However, the size, if specified here, applies to -all frames. - -@ifnottex -@item @code{fullscreen} (class @code{Fullscreen}) -The desired fullscreen size. The value can be one of @code{fullboth}, -@code{fullwidth} or @code{fullheight}, which correspond to -the command-line options @samp{-fs}, @samp{-fw}, and @samp{-fh} -(@pxref{Window Size X}). - -Note that this applies to the initial frame only. -@end ifnottex - -@item @code{iconName} (class @code{Title}) -Name to display in the icon. - -@item @code{internalBorder} (class @code{BorderWidth}) -Width in pixels of the internal border. - -@item @code{lineSpacing} (class @code{LineSpacing}) -@cindex line spacing -@cindex leading -Additional space (@dfn{leading}) between lines, in pixels. - -@item @code{menuBar} (class @code{MenuBar}) -@cindex menu bar -Give frames menu bars if @samp{on}; don't have menu bars if @samp{off}. -@ifnottex -@xref{Lucid Resources}, and @ref{LessTif Resources}, -@end ifnottex -@iftex -@xref{Lucid Resources}, -@end iftex -for how to control the appearance of the menu bar if you have one. - -@ifnottex -@item @code{minibuffer} (class @code{Minibuffer}) -If @samp{none}, don't make a minibuffer in this frame. -It will use a separate minibuffer frame instead. - -@item @code{paneFont} (class @code{Font}) -@cindex font for menus -Font name for menu pane titles, in non-toolkit versions of Emacs. -@end ifnottex - -@item @code{pointerColor} (class @code{Foreground}) -Color of the mouse cursor. - -@ifnottex -@item @code{privateColormap} (class @code{PrivateColormap}) -If @samp{on}, use a private color map, in the case where the ``default -visual'' of class PseudoColor and Emacs is using it. - -@item @code{reverseVideo} (class @code{ReverseVideo}) -Switch foreground and background default colors if @samp{on}, use colors as -specified if @samp{off}. -@end ifnottex - -@item @code{screenGamma} (class @code{ScreenGamma}) -@cindex gamma correction -Gamma correction for colors, equivalent to the frame parameter -@code{screen-gamma}. - -@item @code{scrollBarWidth} (class @code{ScrollBarWidth}) -@cindex scrollbar width -The scroll bar width in pixels, equivalent to the frame parameter -@code{scroll-bar-width}. - -@ifnottex -@item @code{selectionFont} (class @code{SelectionFont}) -Font name for pop-up menu items, in non-toolkit versions of Emacs. (For -toolkit versions, see @ref{Lucid Resources}, also see @ref{LessTif -Resources}.) - -@item @code{selectionTimeout} (class @code{SelectionTimeout}) -Number of milliseconds to wait for a selection reply. -If the selection owner doesn't reply in this time, we give up. -A value of 0 means wait as long as necessary. - -@item @code{synchronous} (class @code{Synchronous}) -@cindex debugging X problems -@cindex synchronous X mode -Run Emacs in synchronous mode if @samp{on}. Synchronous mode is -useful for debugging X problems. -@end ifnottex - -@item @code{title} (class @code{Title}) -Name to display in the title bar of the initial Emacs frame. - -@item @code{toolBar} (class @code{ToolBar}) -@cindex tool bar -Number of lines to reserve for the tool bar. A zero value suppresses -the tool bar. If the value is non-zero and -@code{auto-resize-tool-bars} is non-@code{nil}, the tool bar's size -will be changed automatically so that all tool bar items are visible. - If the value of @code{auto-resize-tool-bars} is @code{grow-only}, -the tool bar expands automatically, but does not contract automatically. -To contract the tool bar, you must redraw the frame by entering @kbd{C-l}. - -@item @code{useXIM} (class @code{UseXIM}) -@cindex XIM -@cindex X input methods -@cindex input methods, X -Turn off use of X input methods (XIM) if @samp{false} or @samp{off}. -This is only relevant if your Emacs is actually built with XIM -support. It is potentially useful to turn off XIM for efficiency, -especially slow X client/server links. - -@item @code{verticalScrollBars} (class @code{ScrollBars}) -Give frames scroll bars if @samp{on}; don't have scroll bars if -@samp{off}. - -@ifnottex -@item @code{visualClass} (class @code{VisualClass}) -Specify the ``visual'' that X should use. This tells X how to handle -colors. - -The value should start with one of @samp{TrueColor}, -@samp{PseudoColor}, @samp{DirectColor}, @samp{StaticColor}, -@samp{GrayScale}, and @samp{StaticGray}, followed by -@samp{-@var{depth}}, where @var{depth} is the number of color planes. -Most terminals only allow a few ``visuals,'' and the @samp{dpyinfo} -program outputs information saying which ones. -@end ifnottex -@end table - -@node Face Resources -@appendixsec X Resources for Faces - - You can use resources to customize the appearance of particular -faces (@pxref{Faces}): - -@table @code -@item @var{face}.attributeForeground -Foreground color for face @var{face}. -@item @var{face}.attributeBackground -Background color for face @var{face}. -@item @var{face}.attributeUnderline -Underline flag for face @var{face}. Use @samp{on} or @samp{true} for -yes. -@item @var{face}.attributeStrikeThrough -@itemx @var{face}.attributeOverline -@itemx @var{face}.attributeBox -@itemx @var{face}.attributeInverse -Likewise, for other boolean font attributes. -@item @var{face}.attributeStipple -The name of a pixmap data file to use for the stipple pattern, or -@code{false} to not use stipple for the face @var{face}. -@item @var{face}.attributeBackgroundPixmap -The background pixmap for the face @var{face}. Should be a name of a -pixmap file or @code{false}. -@item @var{face}.attributeFont -Font name (full XFD name or valid X abbreviation) for face @var{face}. -Instead of this, you can specify the font through separate attributes. -@end table - - Instead of using @code{attributeFont} to specify a font name, you can -select a font through these separate attributes: - -@table @code -@item @var{face}.attributeFamily -Font family for face @var{face}. -@item @var{face}.attributeHeight -Height of the font to use for face @var{face}: either an integer -specifying the height in units of 1/10@dmn{pt}, or a floating point -number that specifies a scale factor to scale the underlying face's -default font, or a function to be called with the default height which -will return a new height. -@item @var{face}.attributeWidth -@itemx @var{face}.attributeWeight -@itemx @var{face}.attributeSlant -Each of these resources corresponds to a like-named font attribute, -and you write the resource value the same as the symbol you would use -for the font attribute value. -@item @var{face}.attributeBold -Bold flag for face @var{face}---instead of @code{attributeWeight}. Use @samp{on} or @samp{true} for -yes. -@item @var{face}.attributeItalic -Italic flag for face @var{face}---instead of @code{attributeSlant}. -@end table - -@node Lucid Resources -@appendixsec Lucid Menu X Resources -@cindex Menu X Resources (Lucid widgets) -@cindex Lucid Widget X Resources - -@ifnottex - If the Emacs installed at your site was built to use the X toolkit -with the Lucid menu widgets, then the menu bar is a separate widget and -has its own resources. The resource names contain @samp{pane.menubar} -(following, as always, the name of the Emacs invocation, or @samp{Emacs}, -which stands for all Emacs invocations). Specify them like this: - -@example -Emacs.pane.menubar.@var{resource}: @var{value} -@end example - -@noindent -For example, to specify the font @samp{8x16} for the menu-bar items, -write this: -@end ifnottex -@iftex - If the Emacs installed at your site was built to use the X toolkit -with the Lucid menu widgets, then the menu bar is a separate widget -and has its own resources. The resource specifications start with -@samp{Emacs.pane.menubar}---for instance, to specify the font -@samp{8x16} for the menu-bar items, write this: -@end iftex - -@example -Emacs.pane.menubar.font: 8x16 -@end example - -@noindent -Resources for @emph{non-menubar} toolkit pop-up menus have -@samp{menu*} instead of @samp{pane.menubar}. For example, to specify -the font @samp{8x16} for the pop-up menu items, write this: - -@example -Emacs.menu*.font: 8x16 -@end example - -@noindent -For dialog boxes, use @samp{dialog*}: - -@example -Emacs.dialog*.font: 8x16 -@end example - -@noindent -The Lucid menus can display multilingual text in your locale. For -more information about fontsets see the man page for -@code{XCreateFontSet}. To enable multilingual menu text you specify a -@code{fontSet} resource instead of the font resource. If both -@code{font} and @code{fontSet} resources are specified, the -@code{fontSet} resource is used. - - Thus, to specify @samp{-*-helvetica-medium-r-*--*-120-*-*-*-*-*-*,*} -for both the popup and menu bar menus, write this: - -@example -Emacs*menu*fontSet: -*-helvetica-medium-r-*--*-120-*-*-*-*-*-*,* -@end example - -@noindent -The @samp{*menu*} as a wildcard matches @samp{pane.menubar} and -@samp{menu@dots{}}. - -Experience shows that on some systems you may need to add -@samp{shell.}@: before the @samp{pane.menubar} or @samp{menu*}. On -some other systems, you must not add @samp{shell.}. The generic wildcard -approach should work on both kinds of systems. - - Here is a list of the specific resources for menu bars and pop-up menus: - -@table @code -@item font -Font for menu item text. -@item fontSet -Fontset for menu item text. -@item foreground -Color of the foreground. -@item background -Color of the background. -@item buttonForeground -In the menu bar, the color of the foreground for a selected item. -@ifnottex -@item horizontalSpacing -Horizontal spacing in pixels between items. Default is 3. -@item verticalSpacing -Vertical spacing in pixels between items. Default is 2. -@item arrowSpacing -Horizontal spacing between the arrow (which indicates a submenu) and -the associated text. Default is 10. -@item shadowThickness -Thickness of shadow line around the widget. Default is 1. - -Also determines the thickness of shadow lines around other objects, -for instance 3D buttons and arrows. If you have the impression that -the arrows in the menus do not stand out clearly enough or that the -difference between ``in'' and ``out'' buttons is difficult to see, set -this to 2. If you have no problems with visibility, the default -probably looks better. The background color may also have some effect -on the contrast. -@end ifnottex -@item margin -The margin of the menu bar, in characters. Default is 1. -@end table - -@ifnottex -@node LessTif Resources -@appendixsec LessTif Menu X Resources -@cindex Menu X Resources (LessTif widgets) -@cindex LessTif Widget X Resources - - If the Emacs installed at your site was built to use the X toolkit -with the LessTif or Motif widgets, then the menu bar, the dialog -boxes, the pop-up menus, and the file-selection box are separate -widgets and have their own resources. - - The resource names for the menu bar contain @samp{pane.menubar} -(following, as always, the name of the Emacs invocation, or -@samp{Emacs}, which stands for all Emacs invocations). Specify them -like this: - -@smallexample -Emacs.pane.menubar.@var{subwidget}.@var{resource}: @var{value} -@end smallexample - - Each individual string in the menu bar is a subwidget; the subwidget's -name is the same as the menu item string. For example, the word -@samp{File} in the menu bar is part of a subwidget named -@samp{emacs.pane.menubar.File}. Most likely, you want to specify the -same resources for the whole menu bar. To do this, use @samp{*} instead -of a specific subwidget name. For example, to specify the font -@samp{8x16} for the menu-bar items, write this: - -@smallexample -Emacs.pane.menubar.*.fontList: 8x16 -@end smallexample - -@noindent -This also specifies the resource value for submenus. - - Each item in a submenu in the menu bar also has its own name for X -resources; for example, the @samp{File} submenu has an item named -@samp{Save (current buffer)}. A resource specification for a submenu -item looks like this: - -@smallexample -Emacs.pane.menubar.popup_*.@var{menu}.@var{item}.@var{resource}: @var{value} -@end smallexample - -@noindent -For example, here's how to specify the font for the @samp{Save (current -buffer)} item: - -@smallexample -Emacs.pane.menubar.popup_*.File.Save (current buffer).fontList: 8x16 -@end smallexample - -@noindent -For an item in a second-level submenu, such as @samp{Complete Word} -under @samp{Spell Checking} under @samp{Tools}, the resource fits this -template: - -@smallexample -Emacs.pane.menubar.popup_*.popup_*.@var{menu}.@var{resource}: @var{value} -@end smallexample - -@noindent -For example, - -@smallexample -Emacs.pane.menubar.popup_*.popup_*.Spell Checking.Complete Word: @var{value} -@end smallexample - -@noindent -(This should be one long line.) - - It's impossible to specify a resource for all the menu-bar items -without also specifying it for the submenus as well. So if you want the -submenu items to look different from the menu bar itself, you must ask -for that in two steps. First, specify the resource for all of them; -then, override the value for submenus alone. Here is an example: - -@smallexample -Emacs.pane.menubar.*.fontList: 8x16 -Emacs.pane.menubar.popup_*.fontList: 8x16 -@end smallexample - -@noindent -For LessTif pop-up menus, use @samp{menu*} instead of -@samp{pane.menubar}. For example, to specify the font @samp{8x16} for -the pop-up menu items, write this: - -@smallexample -Emacs.menu*.fontList: 8x16 -@end smallexample - -@noindent -For LessTif dialog boxes, use @samp{dialog} instead of @samp{menu}: - -@example -Emacs.dialog*.fontList: 8x16 -Emacs.dialog*.foreground: hotpink -@end example - -To specify resources for the LessTif file-selection box, use -@samp{fsb*}, like this: - -@example -Emacs.fsb*.fontList: 8x16 -@end example - -@iftex -@medbreak -@end iftex - Here is a list of the specific resources for LessTif menu bars and -pop-up menus: - -@table @code -@item armColor -The color to show in an armed button. -@item fontList -The font to use. -@item marginBottom -@itemx marginHeight -@itemx marginLeft -@itemx marginRight -@itemx marginTop -@itemx marginWidth -Amount of space to leave around the item, within the border. -@item borderWidth -The width of the border around the menu item, on all sides. -@item shadowThickness -The width of the border shadow. -@item bottomShadowColor -The color for the border shadow, on the bottom and the right. -@item topShadowColor -The color for the border shadow, on the top and the left. -@end table -@end ifnottex - - -@node GTK resources -@appendixsec GTK resources -@iftex - The most common way to customize the GTK widgets Emacs uses (menus, dialogs -tool bars and scroll bars) is by choosing an appropriate theme, for example -with the GNOME theme selector. You can also do Emacs specific customization -by inserting GTK style directives in the file @file{~/.emacs.d/gtkrc}. Some GTK -themes ignore customizations in @file{~/.emacs.d/gtkrc} so not everything -works with all themes. To customize Emacs font, background, faces, etc., use -the normal X resources (@pxref{Resources}). We will present some examples of -customizations here, but for a more detailed description, see the online manual - - The first example is just one line. It changes the font on all GTK widgets -to courier with size 12: - -@smallexample -gtk-font-name = "courier 12" -@end smallexample - - The thing to note is that the font name is not an X font name, like --*-helvetica-medium-r-*--*-120-*-*-*-*-*-*, but a Pango font name. A Pango -font name is basically of the format "family style size", where the style -is optional as in the case above. A name with a style could be for example: - -@smallexample -gtk-font-name = "helvetica bold 10" -@end smallexample - - To customize widgets you first define a style and then apply the style to -the widgets. Here is an example that sets the font for menus, but not -for other widgets: - -@smallexample -# @r{Define the style @samp{menufont}.} -style "menufont" -@{ - font_name = "helvetica bold 14" # This is a Pango font name -@} - -# @r{Specify that widget type @samp{*emacs-menuitem*} uses @samp{menufont}.} -widget "*emacs-menuitem*" style "menufont" -@end smallexample - -The widget name in this example contains wildcards, so the style will be -applied to all widgets that match "*emacs-menuitem*". The widgets are -named by the way they are contained, from the outer widget to the inner widget. -So to apply the style "my_style" (not shown) with the full, absolute name, for -the menubar and the scroll bar in Emacs we use: - -@smallexample -widget "Emacs.pane.menubar" style "my_style" -widget "Emacs.pane.emacs.verticalScrollBar" style "my_style" -@end smallexample - -But to avoid having to type it all, wildcards are often used. @samp{*} -matches zero or more characters and @samp{?} matches one character. So "*" -matches all widgets. - - Each widget has a class (for example GtkMenuItem) and a name (emacs-menuitem). -You can assign styles by name or by class. In this example we have used the -class: - -@smallexample -style "menufont" -@{ - font_name = "helvetica bold 14" -@} - -widget_class "*GtkMenuBar" style "menufont" -@end smallexample - -@noindent -The names and classes for the GTK widgets Emacs uses are: - -@multitable {@code{verticalScrollbar plus}} {@code{GtkFileSelection} and some} -@item @code{emacs-filedialog} -@tab @code{GtkFileSelection} -@item @code{emacs-dialog} -@tab @code{GtkDialog} -@item @code{Emacs} -@tab @code{GtkWindow} -@item @code{pane} -@tab @code{GtkVHbox} -@item @code{emacs} -@tab @code{GtkFixed} -@item @code{verticalScrollBar} -@tab @code{GtkVScrollbar} -@item @code{emacs-toolbar} -@tab @code{GtkToolbar} -@item @code{menubar} -@tab @code{GtkMenuBar} -@item @code{emacs-menuitem} -@tab anything in menus -@end multitable - - GTK absolute names are quite strange when it comes to menus -and dialogs. The names do not start with @samp{Emacs}, as they are -free-standing windows and not contained (in the GTK sense) by the -Emacs GtkWindow. To customize the dialogs and menus, use wildcards like this: - -@smallexample -widget "*emacs-dialog*" style "my_dialog_style" -widget "*emacs-filedialog* style "my_file_style" -widget "*emacs-menuitem* style "my_menu_style" -@end smallexample - - If you specify a customization in @file{~/.emacs.d/gtkrc}, then it -automatically applies only to Emacs, since other programs don't read -that file. For example, the drop down menu in the file dialog can not -be customized by any absolute widget name, only by an absolute class -name. This is because the widgets in the drop down menu do not -have names and the menu is not contained in the Emacs GtkWindow. To -have all menus in Emacs look the same, use this in -@file{~/.emacs.d/gtkrc}: - -@smallexample -widget_class "*Menu*" style "my_menu_style" -@end smallexample - - Here is a more elaborate example, showing how to change the parts of -the scroll bar: - -@smallexample -style "scroll" -@{ - fg[NORMAL] = "red"@ @ @ @ @ # @r{The arrow color.} - bg[NORMAL] = "yellow"@ @ # @r{The thumb and background around the arrow.} - bg[ACTIVE] = "blue"@ @ @ @ # @r{The trough color.} - bg[PRELIGHT] = "white"@ # @r{The thumb color when the mouse is over it.} -@} - -widget "*verticalScrollBar*" style "scroll" -@end smallexample -@end iftex - -@ifnottex -@cindex GTK resources and customization -@cindex resource files for GTK -@cindex @file{~/.gtkrc-2.0} file -@cindex @file{~/.emacs.d/gtkrc} file - - If Emacs was built to use the GTK widget set, then the menu bar, tool bar, -scroll bar and the dialogs are customized with the standard GTK -customization file, @file{~/.gtkrc-2.0}, or with the Emacs specific -file @file{~/.emacs.d/gtkrc}. We recommend that you use -@file{~/.emacs.d/gtkrc} for customizations, since @file{~/.gtkrc-2.0} -seems to be ignored when running GConf with GNOME. These files apply -only to GTK widget features. To customize Emacs font, background, -faces, etc., use the normal X resources (@pxref{Resources}). - - Some GTK themes override these mechanisms, which means that using -these mechanisms will not work to customize them. - - In these files you first define a style and say what it means; then -you specify to apply the style to various widget types (@pxref{GTK -widget names}). Here is an example of how to change the font for -Emacs menus: - -@smallexample -# @r{Define the style @samp{menufont}.} -style "menufont" -@{ - font_name = "helvetica bold 14" # This is a Pango font name -@} - -# @r{Specify that widget type @samp{*emacs-menuitem*} uses @samp{menufont}.} -widget "*emacs-menuitem*" style "menufont" -@end smallexample - - Here is a more elaborate example, showing how to change the parts of -the scroll bar: - -@smallexample -style "scroll" -@{ - fg[NORMAL] = "red"@ @ @ @ @ # @r{The arrow color.} - bg[NORMAL] = "yellow"@ @ # @r{The thumb and background around the arrow.} - bg[ACTIVE] = "blue"@ @ @ @ # @r{The trough color.} - bg[PRELIGHT] = "white"@ # @r{The thumb color when the mouse is over it.} -@} - -widget "*verticalScrollBar*" style "scroll" -@end smallexample - - There are also parameters that affect GTK as a whole. For example, -the property @code{gtk-font-name} sets the default font for GTK. You -must use Pango font names (@pxref{GTK styles}). A GTK resources file -that just sets a default font looks like this: - -@smallexample -gtk-font-name = "courier 12" -@end smallexample - - The GTK resources file is fully described in the GTK API document. -This can be found in -@file{@var{prefix}/share/gtk-doc/html/gtk/gtk-resource-files.html}, -where @file{prefix} is the directory in which the GTK libraries were -installed (usually @file{/usr} or @file{/usr/local}). You can also -find the document online, at -@uref{http://developer.gnome.org/doc/API/2.0/gtk/gtk-Resource-Files.html}. - -@menu -* GTK widget names:: How widgets in GTK are named in general. -* GTK Names in Emacs:: GTK widget names in Emacs. -* GTK styles:: What can be customized in a GTK widget. -@end menu - -@node GTK widget names -@appendixsubsec GTK widget names -@cindex GTK widget names - - A GTK widget is specified by its @dfn{widget class} and -@dfn{widget name}. The widget class is the type of the widget: for -example, @code{GtkMenuBar}. The widget name is the name given to a -specific widget. A widget always has a class, but need not have a -name. - - @dfn{Absolute names} are sequences of widget names or widget -classes, corresponding to hierarchies of widgets embedded within -other widgets. For example, if a @code{GtkWindow} named @code{top} -contains a @code{GtkVBox} named @code{box}, which in turn contains -a @code{GtkMenuBar} called @code{menubar}, the absolute class name -of the menu-bar widget is @code{GtkWindow.GtkVBox.GtkMenuBar}, and -its absolute widget name is @code{top.box.menubar}. - - When assigning a style to a widget, you can use the absolute class -name or the absolute widget name. - - There are two commands to specify changes for widgets: - -@table @asis -@item @code{widget_class} -specifies a style for widgets based on the absolute class name. - -@item @code{widget} -specifies a style for widgets based on the absolute class name, -or just the class. -@end table - -@noindent -You must specify the class and the style in double-quotes, and put -these commands at the top level in the GTK customization file, like -this: - -@smallexample -style "menufont" -@{ - font_name = "helvetica bold 14" -@} - -widget "top.box.menubar" style "menufont" -widget_class "GtkWindow.GtkVBox.GtkMenuBar" style "menufont" -@end smallexample - - Matching of absolute names uses shell wildcard syntax: @samp{*} -matches zero or more characters and @samp{?} matches one character. -This example assigns @code{base_style} to all widgets: - -@smallexample -widget "*" style "base_style" -@end smallexample - - Given the absolute class name @code{GtkWindow.GtkVBox.GtkMenuBar} -and the corresponding absolute widget name @code{top.box.menubar}, all -these examples specify @code{my_style} for the menu bar: - -@smallexample -widget_class "GtkWindow.GtkVBox.GtkMenuBar" style "my_style" -widget_class "GtkWindow.*.GtkMenuBar" style "my_style" -widget_class "*GtkMenuBar" style "my_style" -widget "top.box.menubar" style "my_style" -widget "*box*menubar" style "my_style" -widget "*menubar" style "my_style" -widget "*menu*" style "my_style" -@end smallexample - -@node GTK Names in Emacs -@appendixsubsec GTK Widget Names in Emacs -@cindex GTK widget names -@cindex GTK widget classes - - In Emacs, the top level widget for a frame is a @code{GtkWindow} -that contains a @code{GtkVBox}. The @code{GtkVBox} contains the -@code{GtkMenuBar} and a @code{GtkFixed} widget. The vertical scroll -bars, @code{GtkVScrollbar}, are contained in the @code{GtkFixed} -widget. The text you write in Emacs is drawn in the @code{GtkFixed} -widget. - - Dialogs in Emacs are @code{GtkDialog} widgets. The file dialog is a -@code{GtkFileSelection} widget. - -@noindent -To set a style for the menu bar using the absolute class name, use: - -@smallexample -widget_class "GtkWindow.GtkVBox.GtkMenuBar" style "my_style" -@end smallexample - -@noindent -For the scroll bar, the absolute class name is: - -@smallexample -widget_class - "GtkWindow.GtkVBox.GtkFixed.GtkVScrollbar" - style "my_style" -@end smallexample - -@noindent -The names for the emacs widgets, and their classes, are: - -@multitable {@code{verticalScrollbar plus}} {@code{GtkFileSelection} and some} -@item @code{emacs-filedialog} -@tab @code{GtkFileSelection} -@item @code{emacs-dialog} -@tab @code{GtkDialog} -@item @code{Emacs} -@tab @code{GtkWindow} -@item @code{pane} -@tab @code{GtkVHbox} -@item @code{emacs} -@tab @code{GtkFixed} -@item @code{verticalScrollBar} -@tab @code{GtkVScrollbar} -@item @code{emacs-toolbar} -@tab @code{GtkToolbar} -@item @code{menubar} -@tab @code{GtkMenuBar} -@item @code{emacs-menuitem} -@tab anything in menus -@end multitable - -@noindent -Thus, for Emacs you can write the two examples above as: - -@smallexample -widget "Emacs.pane.menubar" style "my_style" -widget "Emacs.pane.emacs.verticalScrollBar" style "my_style" -@end smallexample - - GTK absolute names are quite strange when it comes to menus -and dialogs. The names do not start with @samp{Emacs}, as they are -free-standing windows and not contained (in the GTK sense) by the -Emacs GtkWindow. To customize the dialogs and menus, use wildcards like this: - -@smallexample -widget "*emacs-dialog*" style "my_dialog_style" -widget "*emacs-filedialog* style "my_file_style" -widget "*emacs-menuitem* style "my_menu_style" -@end smallexample - - If you specify a customization in @file{~/.emacs.d/gtkrc}, then it -automatically applies only to Emacs, since other programs don't read -that file. For example, the drop down menu in the file dialog can not -be customized by any absolute widget name, only by an absolute class -name. This is because the widgets in the drop down menu do not -have names and the menu is not contained in the Emacs GtkWindow. To -have all menus in Emacs look the same, use this in -@file{~/.emacs.d/gtkrc}: - -@smallexample -widget_class "*Menu*" style "my_menu_style" -@end smallexample - -@node GTK styles -@appendixsubsec GTK styles -@cindex GTK styles - - In a GTK style you specify the appearance widgets shall have. You -can specify foreground and background color, background pixmap and -font. The edit widget (where you edit the text) in Emacs is a GTK -widget, but trying to specify a style for the edit widget will have no -effect. This is so that Emacs compiled for GTK is compatible with -Emacs compiled for other X toolkits. The settings for foreground, -background and font for the edit widget is taken from the X resources; -@pxref{Resources}. Here is an example of two style declarations, -@samp{default} and @samp{ruler}: - -@smallexample -pixmap_path "/usr/share/pixmaps:/usr/include/X11/pixmaps" - -style "default" -@{ - font_name = "helvetica 12" - - bg[NORMAL] = @{ 0.83, 0.80, 0.73 @} - bg[SELECTED] = @{ 0.0, 0.55, 0.55 @} - bg[INSENSITIVE] = @{ 0.77, 0.77, 0.66 @} - bg[ACTIVE] = @{ 0.0, 0.55, 0.55 @} - bg[PRELIGHT] = @{ 0.0, 0.55, 0.55 @} - - fg[NORMAL] = "black" - fg[SELECTED] = @{ 0.9, 0.9, 0.9 @} - fg[ACTIVE] = "black" - fg[PRELIGHT] = @{ 0.9, 0.9, 0.9 @} - - base[INSENSITIVE] = "#777766" - text[INSENSITIVE] = @{ 0.60, 0.65, 0.57 @} - - bg_pixmap[NORMAL] = "background.xpm" - bg_pixmap[INSENSITIVE] = "background.xpm" - bg_pixmap[ACTIVE] = "background.xpm" - bg_pixmap[PRELIGHT] = "<none>" - -@} - -style "ruler" = "default" -@{ - font_name = "helvetica 8" -@} - -@end smallexample - - The style @samp{ruler} inherits from @samp{default}. This way you can build -on existing styles. The syntax for fonts and colors is described below. - - As this example shows, it is possible to specify several values for -foreground and background depending on the widget's @dfn{state}. The -possible states are: - -@table @code -@item NORMAL -This is the default state for widgets. -@item ACTIVE -This is the state for a widget that is ready to do something. It is -also for the trough of a scroll bar, i.e. @code{bg[ACTIVE] = "red"} -sets the scroll bar trough to red. Buttons that have been pressed but -not released yet (``armed'') are in this state. -@item PRELIGHT -This is the state for a widget that can be manipulated, when the mouse -pointer is over it---for example when the mouse is over the thumb in -the scroll bar or over a menu item. When the mouse is over a button -that is not pressed, the button is in this state. -@item SELECTED -This is the state for data that has been selected by the user. It can -be selected text or items selected in a list. This state is not used -in Emacs. -@item INSENSITIVE -This is the state for widgets that are visible, but they can not be -manipulated in the usual way---for example, buttons that can't be -pressed, and disabled menu items. To display disabled menu items in -yellow, use @code{fg[INSENSITIVE] = "yellow"}. -@end table - - Here are the things that can go in a style declaration: - -@table @code -@item bg[@var{state}] = @var{color} -This specifies the background color for the widget. Note that -editable text doesn't use @code{bg}; it uses @code{base} instead. - -@item base[@var{state}] = @var{color} -This specifies the background color for editable text. In Emacs, this -color is used for the background of the text fields in the file -dialog. - -@item bg_pixmap[@var{state}] = "@var{pixmap}" -This specifies an image background (instead of a background color). -@var{pixmap} should be the image file name. GTK can use a number of -image file formats, including XPM, XBM, GIF, JPEG and PNG. If you -want a widget to use the same image as its parent, use -@samp{<parent>}. If you don't want any image, use @samp{<none>}. -@samp{<none>} is the way to cancel a background image inherited from a -parent style. - -You can't specify the file by its absolute file name. GTK looks for -the pixmap file in directories specified in @code{pixmap_path}. -@code{pixmap_path} is a colon-separated list of directories within -double quotes, specified at the top level in a @file{gtkrc} file -(i.e. not inside a style definition; see example above): - -@smallexample -pixmap_path "/usr/share/pixmaps:/usr/include/X11/pixmaps" -@end smallexample - -@item fg[@var{state}] = @var{color} -This specifies the foreground color for widgets to use. It is the -color of text in menus and buttons, and the color for the arrows in -the scroll bar. For editable text, use @code{text}. - -@item text[@var{state}] = @var{color} -This is the color for editable text. In Emacs, this color is used for the -text fields in the file dialog. - -@item font_name = "@var{font}" -This specifies the font for text in the widget. @var{font} is a -Pango font name, for example @samp{Sans Italic 10}, @samp{Helvetica -Bold 12}, @samp{Courier 14}, @samp{Times 18}. See below for exact -syntax. The names are case insensitive. -@end table - - There are three ways to specify a color: by name, in hexadecimal -form, and with an RGB triplet. - -@noindent -A color name is written within double quotes, for example @code{"red"}. - -@noindent -Hexadecimal form is the same as in X: -@code{#@var{rrrr}@var{gggg}@var{bbbb}}, where all three color specs -must have the same number of hex digits (1, 2, 3 or 4). - -@noindent -An RGB triplet looks like @code{@{ @var{r}, @var{g}, @var{b} @}}, -where @var{r}, @var{g} and @var{b} are either integers in the range -0-65535 or floats in the range 0.0-1.0. - - Pango font names have the form ``@var{family-list} @var{style-options} -@var{size}.'' -@cindex Pango font name -@noindent -@var{family-list} is a comma separated list of font families optionally -terminated by a comma. This way you can specify several families and the -first one found will be used. @var{family} corresponds to the second part in -an X font name, for example in - -@smallexample --adobe-times-medium-r-normal--12-120-75-75-p-64-iso10646-1 -@end smallexample - -@noindent -the family name is @samp{times}. - -@noindent -@var{style-options} is a whitespace separated list of words where each word -is a style, variant, weight, or stretch. The default value for all of -these is @code{normal}. - -@noindent -A `style' corresponds to the fourth part of an X font name. In X font -names it is the character @samp{r}, @samp{i} or @samp{o}; in Pango -font names the corresponding values are @code{normal}, @code{italic}, -or @code{oblique}. - -@noindent -A `variant' is either @code{normal} or @code{small-caps}. -Small caps is a font with the lower case characters replaced by -smaller variants of the capital characters. - -@noindent -Weight describes the ``boldness'' of a font. It corresponds to the third -part of an X font name. It is one of @code{ultra-light}, @code{light}, -@code{normal}, @code{bold}, @code{ultra-bold}, or @code{heavy}. - -@noindent -Stretch gives the width of the font relative to other designs within a -family. It corresponds to the fifth part of an X font name. It is one of -@code{ultra-condensed}, @code{extra-condensed}, @code{condensed}, -@code{semi-condensed}, @code{normal}, @code{semi-expanded}, -@code{expanded}, @code{extra-expanded}, or @code{ultra-expanded}. - -@noindent -@var{size} is a decimal number that describes the font size in points. -@end ifnottex - -@ignore - arch-tag: 9b6ff773-48b6-41f6-b2f9-f114b8bdd97f -@end ignore diff --git a/msdos/ChangeLog b/msdos/ChangeLog index 0fd192b7722..d61f9e27ace 100644 --- a/msdos/ChangeLog +++ b/msdos/ChangeLog @@ -1,3 +1,9 @@ +2007-10-05 Eli Zaretskii <eliz@gnu.org> + + * sed6.inp: Update comment to reflect doc directory structure. + + * sed1v2.inp (RSVG_LIBS, RSVG_CFLAGS): Edit out. + 2007-07-25 Glenn Morris <rgm@gnu.org> * Relicense all FSF files to GPLv3 or later. diff --git a/msdos/sed1v2.inp b/msdos/sed1v2.inp index 688a946b5d5..5d3ae877c42 100644 --- a/msdos/sed1v2.inp +++ b/msdos/sed1v2.inp @@ -37,6 +37,8 @@ s/\.h\.in/.h-in/ /^GETLOADAVG_LIBS *=/s/@[^@\n]*@// /^LIBSOUND *=/s/@LIBSOUND@// /^CFLAGS_SOUND *=/s/@CFLAGS_SOUND@// +/^RSVG_LIBS *=/s/@RSVG_LIBS@// +/^RSVG_CFLAGS *=/s/@RSVG_CFLAGS@// /^EXEEXT *=/s/@EXEEXT@// /^LN_S *=/s/@[^@\n]*@/ln -s/ /^M_FILE *=/s!@[^@\n]*@!m/intel386.h! diff --git a/msdos/sed6.inp b/msdos/sed6.inp index fe377878b5d..1f290fe3fab 100644 --- a/msdos/sed6.inp +++ b/msdos/sed6.inp @@ -1,6 +1,6 @@ # -sed6.inp------------------------------------------------------------------ -# Configuration script for man/Makefile, lispref/Makefile, and -# lispintro/Makefile under DJGPP v2.x +# Configuration script for doc/emacs/Makefile, doc/lispref/Makefile, +# doc/lispintro/Makefile, and doc/misc/Makefile under DJGPP v2.x # --------------------------------------------------------------------------- # # Copyright (C) 1997, 2000, 2001, 2002, 2003, 2004, diff --git a/nt/ChangeLog b/nt/ChangeLog index 82771f836c6..4a8f353782b 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog @@ -1,3 +1,21 @@ +2007-09-27 Jason Rumney <jasonr@gnu.org> + + * gmake.defs (COMCTL32): New system library. + + * nmake.defs (COMCTL32): New system library. + +2007-09-06 Glenn Morris <rgm@gnu.org> + + * configure.bat: + * makefile.w32-in (info-nmake, info-gmake) + (clean-other-dirs-nmake): Change from ../man to ../doc/emacs and + ../doc/misc; and from ../lispref, ../lispintro to ../doc/lispref, + ../doc/lispintro. + +2007-08-29 Glenn Morris <rgm@gnu.org> + + * emacs.rc: Increase version to 23.0.50. + 2007-08-14 Dhuvra Krishnamurthy <dhuvrakm@gmail.com> (tiny change) * makefile.w32-in (bootstrap-nmake): Change directories once more. diff --git a/nt/configure.bat b/nt/configure.bat index a70cba47e9f..994a41d259e 100755 --- a/nt/configure.bat +++ b/nt/configure.bat @@ -518,9 +518,10 @@ if exist config.tmp del config.tmp copy /b config.settings+%MAKECMD%.defs+..\nt\makefile.w32-in ..\nt\makefile
copy /b config.settings+%MAKECMD%.defs+..\lib-src\makefile.w32-in ..\lib-src\makefile
copy /b config.settings+%MAKECMD%.defs+..\src\makefile.w32-in ..\src\makefile
-copy /b config.settings+%MAKECMD%.defs+..\man\makefile.w32-in ..\man\makefile
-copy /b config.settings+%MAKECMD%.defs+..\lispref\makefile.w32-in ..\lispref\makefile
-copy /b config.settings+%MAKECMD%.defs+..\lispintro\makefile.w32-in ..\lispintro\makefile
+copy /b config.settings+%MAKECMD%.defs+..\doc\emacs\makefile.w32-in ..\doc\emacs\makefile
+copy /b config.settings+%MAKECMD%.defs+..\doc\misc\makefile.w32-in ..\doc\misc\makefile
+copy /b config.settings+%MAKECMD%.defs+..\doc\lispref\makefile.w32-in ..\doc\lispref\makefile
+copy /b config.settings+%MAKECMD%.defs+..\doc\lispintro\makefile.w32-in ..\doc\lispintro\makefile
if exist ..\lisp\makefile rm -f ../lisp/[Mm]akefile
copy /b config.settings+%MAKECMD%.defs+..\lisp\makefile.w32-in ..\lisp\makefile
rem Use the default (no-op) Makefile.in if the nt version is not present.
diff --git a/nt/emacs.rc b/nt/emacs.rc index 861b336fd35..3565493d003 100644 --- a/nt/emacs.rc +++ b/nt/emacs.rc @@ -7,8 +7,8 @@ Emacs ICON icons\emacs.ico #endif VS_VERSION_INFO VERSIONINFO - FILEVERSION 22,1,50,0 - PRODUCTVERSION 22,1,50,0 + FILEVERSION 23,0,50,0 + PRODUCTVERSION 23,0,50,0 FILEFLAGSMASK 0x3FL #ifdef EMACSDEBUG FILEFLAGS 0x1L @@ -25,12 +25,12 @@ BEGIN BEGIN VALUE "CompanyName", "Free Software Foundation\0" VALUE "FileDescription", "GNU Emacs for Windows NT/95/98/2000/ME/XP\0" - VALUE "FileVersion", "22, 1, 50, 0\0" + VALUE "FileVersion", "23, 0, 50, 0\0" VALUE "InternalName", "Emacs\0" VALUE "LegalCopyright", "Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007\0" VALUE "OriginalFilename", "emacs.exe" VALUE "ProductName", "Emacs: The extensible self-documenting text editor\0" - VALUE "ProductVersion", "22, 1, 50, 0\0" + VALUE "ProductVersion", "23, 0, 50, 0\0" VALUE "OLESelfRegister", "\0" END END diff --git a/nt/gmake.defs b/nt/gmake.defs index 51b4756995d..28023e99924 100644 --- a/nt/gmake.defs +++ b/nt/gmake.defs @@ -170,6 +170,7 @@ A = a BASE_LIBS = $(libc) $(baselibs) ADVAPI32 = -ladvapi32 +COMCTL32 = -lcomctl32 COMDLG32 = -lcomdlg32 GDI32 = -lgdi32 MPR = -lmpr diff --git a/nt/makefile.w32-in b/nt/makefile.w32-in index 05e9a665879..155f201aa1e 100644 --- a/nt/makefile.w32-in +++ b/nt/makefile.w32-in @@ -232,23 +232,26 @@ install-other-dirs-gmake: $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../leim install
force-info:
-# Note that man/makefile knows how to
+# Note that doc/emacs/makefile knows how to
# put the info files in $(infodir),
# so we can do ok running make in the build dir.
info: force-info info-$(MAKETYPE)
info-nmake:
- cd ..\man
+ cd ..\doc\emacs
$(MAKE) $(MFLAGS) info
- cd ..\lispref
+ cd ..\doc\misc
$(MAKE) $(MFLAGS) info
- cd ..\lispintro
+ cd ..\doc\lispref
+ $(MAKE) $(MFLAGS) info
+ cd ..\doc\lispintro
$(MAKE) $(MFLAGS) info
info-gmake:
- $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../man info
- $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lispref info
- $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lispintro info
+ $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/emacs info
+ $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/misc info
+ $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/lispref info
+ $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/lispintro info
#
# Maintenance
#
@@ -265,13 +268,15 @@ clean-other-dirs-nmake: $(MAKE) $(MFLAGS) clean
cd ..\lisp
$(MAKE) $(MFLAGS) clean
- cd ..\lispintro
+ cd ..\doc\lispintro
$(MAKE) $(MFLAGS) clean
- cd ..\lispref
+ cd ..\doc\lispref
$(MAKE) $(MFLAGS) clean
cd ..\leim
$(MAKE) $(MFLAGS) clean
- cd ..\man
+ cd ..\doc\emacs
+ $(MAKE) $(MFLAGS) clean
+ cd ..\doc\misc
$(MAKE) $(MFLAGS) clean
cd ..\nt
diff --git a/nt/nmake.defs b/nt/nmake.defs index 2a69c0ed3a5..7d19c74dcbd 100644 --- a/nt/nmake.defs +++ b/nt/nmake.defs @@ -117,6 +117,7 @@ A = lib BASE_LIBS = $(libc) $(baselibs) oldnames.lib
ADVAPI32 = advapi32.lib
+COMCTL32 = comctl32.lib
COMDLG32 = comdlg32.lib
GDI32 = gdi32.lib
MPR = mpr.lib
diff --git a/src/.arch-inventory b/src/.arch-inventory index fe99529135f..c21e38d47d7 100644 --- a/src/.arch-inventory +++ b/src/.arch-inventory @@ -3,7 +3,10 @@ source ^\.(gdbinit|dbxinit)$ # Auto-generated files, which ignore precious ^(config\.stamp|config\.h|epaths\.h|buildobj\.lst)$ +precious ^(TAGS-LISP)$ +precious ^(buildobj\.lst)$ backup ^(stamp-oldxmenu|prefix-args|temacs|emacs|emacs-[0-9.]*)$ +backup ^(bootstrap-emacs)$ # arch-tag: 277cc7ae-b3f5-44af-abf1-84c073164543 diff --git a/src/.gdbinit b/src/.gdbinit index a54f9d7b289..2c3750bd8de 100644 --- a/src/.gdbinit +++ b/src/.gdbinit @@ -1021,7 +1021,7 @@ define xbacktrace xgettype (*$bt->function) if $type == Lisp_Symbol xprintsym (*$bt->function) - printf " (0x%x)\n", *$bt->args + printf " (0x%x)\n", $bt->args else printf "0x%x ", *$bt->function if $type == Lisp_Vectorlike @@ -1138,7 +1138,7 @@ end tbreak init_sys_modes commands silent - xgetptr Vwindow_system + xgetptr Vinitial_window_system set $tem = (struct Lisp_Symbol *) $ptr xgetptr $tem->xname set $tem = (struct Lisp_String *) $ptr diff --git a/src/ChangeLog b/src/ChangeLog index e2ff82ff975..4160a53e9d7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,1281 @@ +2007-10-08 Martin Rudalics <rudalics@gmx.at> + + * keyboard.c (kbd_buffer_get_event): Break loop waiting for input + when there's an unread command event. + + * frame.c (focus_follows_mouse): Moved here from frame.el to allow + window autoselection act appropriately when leaving selected frame. + (syms_of_frame): Initialize focus_follows_mouse. + * frame.h (focus_follows_mouse): Extern it. + * macterm.c (XTread_socket): When focus_follows_mouse is nil + make SELECT_WINDOW_EVENT only if we don't leave the selected + frame. + * msdos.c (dos_rawgetc): Likewise. + * w32term.c (w32_read_socket): Likewise. + * xterm.c (handle_one_xevent): Likewise. + * xdisp.c (syms_of_xdisp): In doc-string of + mouse-autoselect-window mention focus-follows-mouse. + +2007-10-08 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c (mac_load_query_font): Fix missing return value. + [USE_CG_DRAWING] (mac_define_fringe_bitmap, mac_destroy_fringe_bitmap): + Add BLOCK_INPUT. + +2007-10-08 Richard Stallman <rms@gnu.org> + + * xdisp.c (get_window_cursor_type): Implement documented behavior + for cursor-in-non-selected-windows = t. + +2007-10-08 Jason Rumney <jasonr@gnu.org> + + * w32.c (w32_get_resource): Always close registry keys. + +2007-10-08 Jason Rumney <jasonr@gnu.org> + + * makefile.w32-in (LIBS): Add COMCTL32. + + * w32fns.c (globals_of_w32fns): Init common controls. + +2007-10-08 Richard Stallman <rms@gnu.org> + + * image.c (our_memory_buffer): Renamed from omfib_buffer. + +2007-10-08 Richard Stallman <rms@gnu.org> + + * buffer.c (Foverlays_at): Doc fix. + +2007-10-08 Stefan Monnier <monnier@iro.umontreal.ca> + + * fns.c (Fplist_put): Preserve uneven tail data. + +2007-10-08 Peter O'Gorman <bug-gnu-emacs@mlists.thewrittenword.com> (tiny change) + + * termhooks.h (enum event_kind): Remove trailing comma. + + * frame.h (enum): Remove trailing comma. + +2007-10-08 Dhuvra Krishnamurthy <dhuvrakm@gmail.com> (tiny change) + + * w32proc.c (delete_child): Don't terminate threads of zombies. + +2007-10-08 Martin Rudalics <rudalics@gmx.at> + + * keyboard.h (struct kboard): New elt Vlast_repeatable_command. + + * keyboard.c (syms_of_keyboard): Set up new Lisp variable + last-repeatable-command. + (init_kboard): Initialize Vlast_repeatable_command. + (command_loop_1): Set it to real_this_command unless that was + bound to an input event. + (mark_kboards): Mark it. + +2007-10-08 Richard Stallman <rms@gnu.org> + + * eval.c (condition-case): Doc fix. + +2007-10-08 Masatake YAMATO <jet@gyve.org> + + * xfaces.c (tty_supports_face_attributes_p): Fix code + for LFACE_INVERSE_INDEX and LFACE_BACKGROUND_INDEX; code + was copied and not edited. + +2007-10-09 Stefan Monnier <monnier@iro.umontreal.ca> + + Add new `input-decode-map' keymap and use it for temrinal + escape sequences. + * keyboard.h (struct kboard): Add Vinput_decode_map. + Remove Vlocal_key_translation_map. + * keyboard.c (read_key_sequence): Add support for input-decode-map. + (init_kboard): Init input-decode-map. + Replace local-key-translation-map back with key-translation-map. + (syms_of_keyboard): Declare input-decode-map. + Remove local-key-translation-map. Update docstrings. + (mark_kboards): Mark Vinput_decode_map. + Don't mark Vlocal_key_translation_map. + * keymap.c (Fdescribe_buffer_bindings): Describe input-decode-map. + Replace local-key-translation-map back with key-translation-map. + * term.c (term_get_fkeys_1, CONDITIONAL_REASSIGN): + Bind in input-decode-map rather than function-key-map. + + * lisp.h (XSETPSEUDOVECTOR): Don't set the tag anymore. + This was made redundant by the previous introduction of XSETPVECTYPE. + +2007-10-09 Richard Stallman <rms@gnu.org> + + * image.c (free_bitmap_record): Rename from Free_Bitmap_Record. + +2007-09-29 Richard Stallman <rms@gnu.org> + + * eval.c (internal_condition_case_2, internal_condition_case_1) + (internal_condition_case): Reenable abort if x_catching_errors () + to see if that really happens and why. + +2007-10-06 Andreas Schwab <schwab@suse.de> + + * fileio.c (Fwrite_region): Ignore EINVAL error from fsync. + +2007-10-04 Juanma Barranquero <lekktu@gmail.com> + + * image.c (syms_of_image) <image-types>: Fix typo in docstring. + +2007-10-03 Stefan Monnier <monnier@iro.umontreal.ca> + + * frame.h (struct frame): Don't try to GC-mark menu_bar_items_used. + +2007-10-02 Stefan Monnier <monnier@iro.umontreal.ca> + + * window.h (struct window): + * window.c (struct save_window_data, struct saved_window): + * termhooks.h (struct terminal): + * process.h (struct Lisp_Process): + * frame.h (struct frame): + * buffer.h (struct buffer): + * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table) + (struct Lisp_Bool_Vector, struct Lisp_Subr, struct Lisp_Hash_Table): + The size field of (pseudo)vectors is now unsigned. + (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG): Simplify accordingly. + + * lisp.h (struct Lisp_Hash_Table): Move non-traced elements at the end. + Turn `count' into an integer. + + * fns.c (make_hash_table, hash_put, hash_remove, hash_clear) + (sweep_weak_table, sweep_weak_hash_tables, Fhash_table_count): + * print.c (print_object) <HASH_TABLE_P>: `count' is an int. + * alloc.c (allocate_hash_table): Use ALLOCATE_PSEUDOVECTOR. + (mark_object) <HASH_TABLE_P>: Use mark_vectorlike. + + * alloc.c (allocate_pseudovector): New fun. + (ALLOCATE_PSEUDOVECTOR): New macro. + (allocate_window, allocate_terminal, allocate_frame) + (allocate_process): Use it. + (mark_vectorlike): New function. + (mark_object) <FRAMEP, WINDOWP, BOOL_VECTOR_P, VECTORP>: Use it. + (mark_terminals): Use it. + (Fmake_bool_vector, Fmake_char_table, make_sub_char_table) + (Fmake_byte_code): Use XSETPVECTYPE. + + * frame.c (Fframe_parameters): Minor simplification. + + * insdel.c (adjust_markers_for_insert): Generalize assertion checks. + + * marker.c (Fmarker_buffer): Make test for odd case into a failure. + + * buffer.c (Fget_buffer_create, init_buffer_once): + * lread.c (defsubr): + * window.c (Fcurrent_window_configuration): Use XSETPVECTYPE. + + * lisp.h (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG): Don't let them be + defined differently in the m/*.h files. + (XCHAR_TABLE, XBOOL_VECTOR): Add assertion checking. + (XSETPVECTYPE): New macro. + (XSETPSEUDOVECTOR): Use it. + + * buffer.c (syms_of_buffer) <local-abbrev-table>: Move from abbrev.c. + (DEFVAR_PER_BUFFER, defvar_per_buffer): Move from lisp.h and lread.c. + + * lisp.h (defvar_per_buffer, DEFVAR_PER_BUFFER): + * lread.c (defvar_per_buffer): + * abbrev.c (syms_of_abbrev) <local-abbrev-tabl>: Move to buffer.c. + + * window.c (candidate_window_p): Only consider as visible frames that + are on the same terminal. + + * m/ibms390x.h (MARKBIT): Remove unused macro. + +2007-10-01 Juanma Barranquero <lekktu@gmail.com> + + * lread.c (Fload): Fix typo in docstring. + +2007-10-01 Micha,Ak(Bl Cadilhac <michael@cadilhac.name> + + * floatfns.c (Fexpt): Manually check for overflows, so that a power + of a non-zero value can't yield zero. + +2007-09-29 Stefan Monnier <monnier@iro.umontreal.ca> + + * term.c (term_clear_mouse_face, term_mouse_highlight) + (tty_write_glyphs_with_face): Only define is HAVE_GPM. + + * print.c (safe_debug_print): Use XHASH. + + * lisp.h (DECL_ALIGN, USE_LSB_TAG): Move logic to before definition of + Lisp elements such as tags. + (XHASH): New macro. + (EQ): Use it. + (SREF, SSET, STRING_COPYIN): Use SDATA. + (VOID_TO_LISP, CVOID_TO_LISP, LISP_TO_VOID, LISP_TO_CVOID): Remove. + + * alloc.c (mark_terminal): Remove left-over declaration. + (enum mem_type): Replace all vector subtypes -> MEM_TYPE_VECTORLIKE. + (allocate_vectorlike): Remove type argument. Adjust callers. + (live_vector_p, mark_maybe_pointer, valid_lisp_object_p): + Only handle the one remaining MEM_TYPE_VECTORLIKE. + + * alloc.c (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): New macros + to avoid unnecessary BLOCK_INPUTs when SYNC_INPUT is used. + (xmalloc, xrealloc, xfree, lisp_malloc, lisp_free, lisp_align_malloc) + (lisp_align_free, make_interval, allocate_string, allocate_string_data) + (make_float, Fcons, allocate_vectorlike, Fmake_symbol, allocate_misc): + Use them. + + * xfaces.c (load_face_font, free_realized_face, clear_face_gcs): + Don't let signal handlers run when a GC is freed but not yet NULL'ed. + (x_free_gc): Remove BLOCK_INPUT since it's now redundant. + +2007-09-28 Dan Nicolaescu <dann@ics.uci.edu> + + * Makefile.in (lisp, shortlisp): Delete server.elc, it is not + loaded by default. + +2007-09-28 Stefan Monnier <monnier@iro.umontreal.ca> + + * term.c (Fgpm_mouse_start): Don't signal an error if already activated + on this tty. + (Fgpm_mouse_stop): Only deactivate if it was activated on this tty. + + * term.c (mouse_face_window): Rename from Qmouse_face_window. + Update all users. + (handle_one_term_event): Use Gpm_DrawPointer. + (Fgpm_mouse_start): Rename from Fterm_open_connection. + Signal errors instead of returning nil. Always return nil. + (Fgpm_mouse_stop): Rename from Fterm_close_connection. + Make it a noop if gpm-mouse was not activated. + (syms_of_term): Update names. + +2007-09-27 Stefan Monnier <monnier@iro.umontreal.ca> + + * sysdep.c (narrow_foreground_group, widen_foreground_group): Static. + (init_sys_modes): Check that gpm_tty is the current tty. + + * alloc.c (allocate_terminal): Set the vector size to only count the + lisp fields. Initialize those to nil. + (mark_object): Don't treat terminals specially. + (mark_terminal): Remove. + (mark_terminals): Use mark_object instead. + + * termhooks.h (struct terminal): Move all Lisp_Object fields traced by + the GC to the beginning. + + * indent.h: + * indent.c: Use EMACS_INT for ints coming from Elisp data. + + * indent.c (Fmove_to_column): Use EMACS_INT for buffer positions. + +2007-09-25 Jason Rumney <jasonr@gnu.org> + + * frame.c (make_terminal_frame): Remove special case for WINDOWSNT. + + * w32console.c (create_w32cons_output): Remove. + + * term.c (init_tty): Call init_sys_modes on WINDOWSNT also. + + * sysdep.c (init_sys_modes): Use set_terminal_modes_hook. + (reset_sys_modes): Use reset_terminal_modes_hook. + +2007-09-24 Stefan Monnier <monnier@iro.umontreal.ca> + + * eval.c (do_autoload): Don't output any message. + +2007-09-24 Juri Linkov <juri@jurta.org> + + * emacs.c (standard_args): Change priority of "--no-splash" + from 40 to 3. Add "--no-desktop" with the same priority. + +2007-09-23 Dmitry Antipov <dmantipov@yandex.ru> + + * alloc.c (gc_sweep): Check cons cell mark bits word by word + and optimize the case where they are all 1. + +2007-09-23 Johannes Weiner <hannes@saeurebad.de> + + * lisp.h (abs): Define if not defined. + * keyboard.c, sound.c, w32term.c, xfaces.c, xterm.c: + Don't define `abs', since it's defined in lisp.h. + +2007-09-22 Eli Zaretskii <eliz@gnu.org> + + * term.c (DEV_TTY): New macro. Provide a definition for + MS-Windows. + (FRAME_TERMCAP_P) [WINDOWSNT]: Don't define to zero. + (Fcontrolling_tty_p, Fresume_tty, dissociate_if_controlling_tty) + (init_tty): Use DEV_TTY instead of "/dev/tty". + [WINDOWSNT]: No need to protect from NAME arg being null. + +2007-09-21 Dan Nicolaescu <dann@ics.uci.edu> + + * term.c (Fsuspend_tty): Run suspend-tty-functions before cleaning + up the tty state. + +2007-09-21 Stefan Monnier <monnier@iro.umontreal.ca> + + * termhooks.h (term_gpm): Delete. Use gpm_tty's NULLness instead. + (gpm_tty): Change its type. + * term.c (term_gpm): Delete. Use gpm_tty's NULLness instead. + (gpm_tty): Change its type and initialize it. + (Fterm_open_connection): Check the frame is indeed a tty. + Use the new gpm_tty. + (Fterm_close_connection): Use the new gpm_tty. + * keyboard.c (tty_read_avail_input): Use the new gpm_tty. + * sysdep.c (init_sys_modes): term_gpm -> gpm_tty. + +2007-09-21 Juanma Barranquero <lekktu@gmail.com> + + * w32term.c (x_draw_glyph_string): Use strike_through_color, not + underline_color, to draw strike-through. + +2007-09-21 Stefan Monnier <monnier@iro.umontreal.ca> + + * lisp.h (allocate_terminal): Declare. + + * window.c (candidate_window_p): Consider frames that are being placed + by the user as somewhere between visible and iconified. + (window_loop): Prefer windows on the current frame. + (Fselect_window): Move the use of select-frame to the beginning so we + can just delegate all the work (it'll call us back anyway). + + * frame.c (Qdisplay_environment_variable): + * frame.h (Qdisplay_environment_variable): Delete. + + * .gdbinit (xbacktrace): Print the arg's address rather than the value + of the first arg, since that value may be a union. + + * callproc.c (child_setup, getenv_internal): Use the frame's `display' + parameter rather than Qdisplay_environment_variable. If all else + fails, look for DISPLAY in initial-environment. + +2007-09-21 Glenn Morris <rgm@gnu.org> + + * Makefile.in (emacstool): Remove target. + (lisp, shortlisp): Remove termdev.elc. + +2007-09-21 Markus Triska <markus.triska@gmx.at> + + * xterm.c (x_delete_display): Compile session management conditionally. + +2007-09-20 Stefan Monnier <monnier@iro.umontreal.ca> + + * callproc.c (getenv_internal_1): New function. + (getenv_internal): Use it. + (Fgetenv_internal): Use it. Accept an env-list as optional arg. + + * terminal.c (get_terminal): Don't accept ints to represent terminals. + (Fterminal_name, Fterminal_parameters, Fterminal_parameter) + (Fset_terminal_parameter): Work with dead terminals as well. + (Fmodify_terminal_parameters): Remove. + + * terminal.c (get_terminal): Handle terminals. + Make sure the terminal returned is live. + (create_terminal): Use allocate_terminal. + (mark_terminals): Move to alloc.c. + (delete_terminal): Use terminal->name as liveness status. + NULL out fields after freeing their contents. + Don't deallocate the object. + (Fframe_terminal): Use FRAME_TERMINAL. Return the terminal object + rather than an int. + (Fterminal_live_p): Accept non-integer arguments. + (Fterminal_list): Return terminal objects rather than an ints. + + * alloc.c (enum mem_type): New member for `terminal' objects. + (allocate_terminal): New function. + (mark_maybe_pointer, valid_lisp_object_p, mark_object): + Handle terminals. + (mark_terminal): New fun. + (mark_terminals): Move from terminal.c. + + * term.c (get_tty_terminal): Don't treat output_initial specially. + (Fsuspend_tty, Fresume_tty): Use terminal objects rather than ints. + (delete_tty): Use terminal->name as liveness status. + + * termhooks.h (struct terminal): Make it into a pseudovector. + Remove `deleted' replaced by checking `name's nullness. + + * print.c (print_object): Handle terminals. + + * lisp.h (enum pvec_type): New `terminal' pseudovector. + (XTERMINAL, XSETTERMINAL, TERMINALP, GC_TERMINALP): New macros. + + * frame.c (make_terminal_frame): + * keyboard.c (tty_read_avail_input): + * w32term.c (x_delete_terminal): + * xfns.c (Fx_create_frame, x_create_tip_frame): + * xterm.c (x_delete_terminal): Use terminal->name as liveness status. + +2007-09-20 Glenn Morris <rgm@gnu.org> + + * process.c (Fmake_network_process): Doc fix. + +2007-09-19 Jason Rumney <jasonr@gnu.org> + + * dispextern.h (w32_init_fringe, mac_init_fringe): Declare rif argument. + +2007-09-19 Micha,Ak(Bl Cadilhac <michael@cadilhac.name> + + * coding.c (detect_eol_type, detect_eol_type_in_2_octet_form): + Fix a C warning regarding variable constness. + + * xterm.c (handle_one_xevent): Fix a C warning. + +2007-09-18 Jason Rumney <jasonr@gnu.org> + + * w32fns.c (Fx_focus_frame): Rename from Fw32_focus_frame. + +2007-09-17 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (gdpy_def): New variable. + (xg_initialize): Initialize gdpy_def. + (xg_display_close): If no other display exists, set gdpy_def to a + new connection. + +2007-09-16 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (xg_get_image_for_pixmap): Always create a GdkPixbuf + when we have no file name for the icon. + (xg_tool_bar_expose_callback): Remove. + (xg_create_tool_bar): Don't connect expose signal to + xg_tool_bar_expose_callback. + (xg_get_file_with_chooser): Move GCPRO1 after declarations. + +2007-09-16 Andreas Schwab <schwab@suse.de> + + * alloc.c (reset_malloc_hooks): Set the hooks to the previous + values instead of zapping them. + +2007-09-14 Glenn Morris <rgm@gnu.org> + + * fringe.c (init_fringe_bitmap) <swap_nibble>: Move to file scope. + * gtkutil.c (xg_separator_p) <separator_names>: Move to file scope. + * image.c (our_memory_fill_input_buffer) <buffer>: Move to file + scope and rename to omfib_buffer for clarity. + (gif_load) <interlace_start, interlace_increment>: Move to file scope. + +2007-09-14 Kenichi Handa <handa@m17n.org> + + * xterm.c (handle_one_xevent): Skip decoding if nbytes is zero. + +2007-09-13 Jason Rumney <jasonr@gnu.org> + + * fringe.c (w32_init_fringe, mac_init_fringe): Add rif argument. + + * w32term.c (w32_term_init): Pass rif to w32_init_fringe. + + * macterm.c (mac_initialize): Don't call mac_init_fringe here. + (mac_term_init): Call here instead, passing rif. + +2007-09-13 Glenn Morris <rgm@gnu.org> + + * s/hpux.h: No longer define `static' as nothing. + +2007-09-13 Johan Bockg,Ae(Brd <bojohan@gnu.org> + + * callint.c (Fcall_interactively): Remove unused var `fun'. + +2007-09-12 Romain Francoise <romain@orebokech.com> + + * window.c (prefer_window_split_horizontally, display_buffer): + Revert 2007-09-08 change. + +2007-09-12 Glenn Morris <rgm@gnu.org> + + * alloca.c: Remove file. + * Makefile.in (alloca): Do not undef. + (allocaobj, alloca.o): Remove. + (otherobj): Remove allocaobj. + * keyboard.c (command_loop_1): Remove #ifdef C_ALLOCA block. + * regex.c (C_ALLOCA): Remove all references and code that was only + used when this was defined. + * search.c (boyer_moore): Remove #ifdef C_ALLOCA block. + * xmenu.c (xmenu_show): Remove #ifdef C_ALLOCA block. + * m/ibms390x.h, m/sh3el.h (C_ALLOCA): Remove references to this. + + * Makefile.in (SOURCES, unlock, relock): Delete. + + * gtkutil.c (cnt): Rename to menu_grab_callback_cnt for clarity. + (menu_grab_callback): All uses changed. + + * xselect.c (cnt): Rename to x_reply_selection_request_cnt for clarity. + (x_reply_selection_request): All uses changed. + +2007-09-11 Stefan Monnier <monnier@iro.umontreal.ca> + + * lread.c (load_warn_old_style_backquotes): Change message to look + better when it appears in the middle of byte-compiler messages. + +2007-09-10 Dan Nicolaescu <dann@ics.uci.edu> + + * s/darwin.h (MULTI_KBOARD): Only define for Carbon. + + * xterm.c (x_create_terminal): Add comment. + + * term.c (clear_tty_hooks, set_tty_hooks): Add comments. + +2007-09-10 Richard Stallman <rms@gnu.org> + + * xterm.c (x_term_init): Give error if can't open DISPLAY_NAME. + +2007-09-10 Micha,Ak(Bl Cadilhac <michael@cadilhac.name> + + * lisp.h (struct Lisp_Subr): Rename `prompt' field to `intspec'. + (DEFUN): Document `intspec', use it instead of `prompt'. + + * eval.c (Fcommandp): Change `->prompt' to `->intspec'. + + * data.c (Finteractive_form): If the interactive specification starts + with a `(', use it as a Lisp form. + + * fileio.c (Fset_file_modes): Add an interactive spec that reads a file + name and file modes. + + * callint.c (Fcall_interactively): Comment fixes. + +2007-09-10 Stefan Monnier <monnier@iro.umontreal.ca> + + * callint.c (Fcall_interactively): Use Finteractive_form also for subrs + and compiled functions. + +2007-09-08 Fredrik Axelsson <f.axelsson@gmail.com> + + * window.c (prefer_window_split_horizontally): New variable. + (display_buffer): Consider splitting window horizontally depending + on prefer_window_split_horizontally. + +2007-09-08 Eli Zaretskii <eliz@gnu.org> + + * sysdep.c [WINDOWSNT]: Don't include sysselect.h. + +2007-09-07 Stefan Monnier <monnier@iro.umontreal.ca> + + * s/cygwin.h (GC_MARK_STACK): Enable conservative stack marking. + + * frame.c (x_set_frame_parameters): Check number is positive before + using XFASTINT. + + * window.c (freeze_window_start): Don't presume selected_window holds + a window object. + (Fdisplay_buffer): Remove `register' since `buffer' needs to be gcpro'd. + +2007-09-07 Angelo Graziosi <Angelo.Graziosi@roma1.infn.it> (tiny change) + + * term.c (dissociate_if_controlling_tty): Call setsid on CYGWIN. + +2007-09-07 Stefan Monnier <monnier@iro.umontreal.ca> + + * window.c (Vsplit_window_preferred_function): New var. + (Fdisplay_buffer): Use it. + (syms_of_window): Export, and initialize it. + +2007-09-06 Pixel <pixel@mandriva.com> (tiny change) + + * image.c (gif_load): Fix bug: Handle nonexistent colormap. + +2007-09-06 Glenn Morris <rgm@gnu.org> + + * gtkutil.c (menu_grab_callback) <cnt>: + * xselect.c (x_reply_selection_request) <cnt>: Move static + variable to file scope. + +2007-09-06 Stefan Monnier <monnier@iro.umontreal.ca> + + * xdisp.c (redisplay_internal): Make sure Elisp code always sees + consistent values of selected_frame and selected_window. + +2007-09-04 Jason Rumney <jasonr@gnu.org> + + * w32console.c (initialize_w32_display): Zero unused hooks. + +2007-09-04 Dan Nicolaescu <dann@ics.uci.edu> + + * term.c (Vsuspend_tty_functions, Vresume_tty_functions) + (syms_of_term, Fsuspend_tty, Fresume_tty): Undo previous change. + +2007-09-04 Jason Rumney <jasonr@gnu.org> + + * term.c (init_tty) [WINDOWSNT]: Add hooks that are not accessible + in w32console.c. Set up input. Remove XXX comments that have been + confirmed as correct. + + * s/ms-w32.h (MULTI_KBOARD): Define. + + * w32console.c (one_and_only_w32cons): Remove. + (initialize_w32_display): Take terminal argument. + + * term.c (init_tty) [WINDOWSNT]: Pass terminal to + initialize_w32_display. + (init_tty) [MULTI_KBOARD]: Include this code on WINDOWSNT too. + + * termhooks.h (enum event_kind) <HORIZ_WHEEL_EVENT>: New event. + + * keyboard.c (discard_mouse_events): Discard it. + (make_lispy_event): Translate it to a lisp event. + (lispy_wheel_names): Add wheel-left and right events. + (syms_of_keyboard): Enlarge wheel_syms. + + * w32fns.c (w32_wnd_proc) <WM_DROPFILES>: Merge with WM_MOUSEWHEEL. + <WM_MOUSEHWHEEL>: Pass new system message to lisp. + + * w32term.h (WM_MOUSEHWHEEL): Define if system headers don't. + + * w32term.c (construct_mouse_wheel): Make HORIZ_WHEEL_EVENT + from WM_MOUSEHWHEEL. + (w32_read_socket) <WM_MOUSEHWHEEL>: Treat as WM_MOUSEWHEEL. + + * w32fns.c (x_create_tip_frame) [MULTI_KBOARD]: Get keyboard from + terminal. + + * w32term.c (w32_create_terminal) [MULTI_KBOARD]: Create a new + keyboard for the terminal. + +2007-09-04 Dan Nicolaescu <dann@ics.uci.edu> + + * term.c (Vsuspend_tty_hook): Rename from Vsuspend_tty_functions. + (Vresume_tty_hook): Rename from Vresume_tty_functions. + (syms_of_term): Rename suspend-tty-functions to suspend-tty-hook + and resume-tty-function to resume-tty-hook. + (Fsuspend_tty, Fresume_tty): Use new names. + +2007-09-02 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (update_frame_tool_bar): Handle stock name as a named icon + if it starts with "n:". + +2007-08-31 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (update_frame_tool_bar): Initialize wbutton to NULL. + +2007-08-31 Stefan Monnier <monnier@iro.umontreal.ca> + + * frame.h: + * frame.c (Qterm_environment_variable): Remove. + (syms_of_frame): Don't init and staticpro it. + + * callproc.c (getenv_internal): Remove special case for $TERM. + + * callproc.c (Vinitial_environment): New variable. + (set_initial_environment): Initialize it. + (syms_of_callproc): Declare it. + (child_setup): Don't mess with TERM via Qterm_environment_variable; the + TERM under which a process runs is never related to the TERM in which + Emacs is running. + +2007-08-29 Dan Nicolaescu <dann@ics.uci.edu> + + * config.in (HAVE_WINDOW_SYSTEM): Don't undef MULTI_KBOARD here... + * s/darwin.h: ... do it here. + +2007-08-29 Stefan Monnier <monnier@iro.umontreal.ca> + + * lisp.h (set_initial_environment): Rename from set_global_environment. + + * Makefile.in (${etc}DOC): Re-add a ${EXEEXT} which seems to have been + removed by mistake on the multi-tty branch. + + * frame.c (make_terminal_frame): Yet Another Int/Lisp_Object Mixup. + (Fmodify_frame_parameters): Return a value. + + * image.c (png_load): Comment-out var only used in commented-out code. + + * term.c (mark_ttys): Don't bother checking top_frame (incorrectly) + before passing it to mark_object. + + * xfaces.c (internal_resolve_face_name): Return a value. + (internal_resolve_face_name, resolve_face_name_error): Comment out. + + * xfns.c (check_x_display_info): Yet Another Int/Lisp_Object Mixup. + (x_icon): Comment-out var only used in commented-out code. + +2007-08-29 Romain Francoise <romain@orebokech.com> + + * keyboard.c (Fset_input_mode): Don't call `Fset_quit_char' if + QUIT hasn't been provided. + +2007-08-29 Dan Nicolaescu <dann@ics.uci.edu> + + * callproc.c (child_setup, getenv_internal): Use the + display-environment-variable and term-environment-variable frame + params. + (set_initial_environment): Initialise Vprocess_environment. + + * config.in: Disable multi-keyboard support on a mac. + + * frame.c (Qterm_environment_variable) + (Qdisplay_environment_variable): New variables. + (syms_of_frame): Intern and staticpro them. + (Fmake_terminal_frame): Disable output method test. + + * frame.h: Declare them here. + + * macfns.c (x_set_mouse_color): Get rif from the frame. + (x_set_tool_bar_lines): Don't use updating_frame. + (mac_window): Add 2 new parameters for consistency with other systems. + (Fx_create_frame): Fix doc string. Rename the parameter. Set the + frame parameters following what is done in X11 and w32. Don't use + FRAME_MAC_DISPLAY_INFO. + (Fx_open_connection, start_hourglass): Remove window-system check. + (x_create_tip_frame): Get the keyboard from the terminal. + + * macmenu.c: Reorder includes. + (Fx_popup_menu): Use terminal specific mouse_position_hook. + + * macterm.c (XTset_terminal_modes, XTreset_terminal_modes): Add a + terminal parameter. + (x_clear_frame): Add a frame parameter. + (note_mouse_movement): Get rif from the frame. + (mac_term_init): Initialize the terminal. + (mac_initialize): Make static and move terminal initialization ... + (mac_create_terminal): ... to this new function. + + * macterm.h (struct mac_display_info): Add terminal. + (mac_initialize): Delete declaration. + + * puresize.h (BASE_PURESIZE): Increase base value to 1164000. + + * sysdep.c: Comment out text after #endif. + + * term.c (init_tty): Only use terminal->kboard when MULTI_KBOARD + is defined. Better initialize ttys in windows. Use terminal + specific mouse_position_hook. + + * termhooks.h (union display_info): Add mac_display_info. + + * w32fns.c (Fx_create_frame): Use kboard from the terminal. + Set the default minibuffer frame, window_system and the rest of the + frame parameters following what is done in X11. + + * w32term.c (w32_initialize): Make static. + + * xselect.c (x_handle_selection_clear): Only access + terminal->kboard when MULTI_KBOARD is defined. + + * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Define here. + (SYSTEM_PURESIZE_EXTRA): Only define on Carbon. + +2007-08-29 Jason Rumney <jasonr@gnu.org> + + * frame.c (Fdelete_frame): Only get kboard when MULTI_KBOARD defined. + (make_terminal_frame) [WINDOWSNT]: Initialize terminal. + + * fringe.c (w32_init_fringe w32_reset_fringes) [HAVE_NTGUI]: + (mac_init_fringe) [MAC_OS]: Get rif from selected_frame. + + * keyboard.c (restore_kboard_configuration): Only define when + MULTI_KBOARD defined. + + * makefile.w32-in: Update dependancies from Makefile.in + (OBJ1): Add terminal.$(O) + + * term.c (dissociate_if_controlling_tty) [WINDOWSNT]: + Don't define function body. + (init_tty) [WINDOWSNT]: Use selected_frame for initializing. + + * termhooks.h (display_info) [WINDOWSNT]: Add w32. + + * w32.c (request_sigio, unrequest_sigio): Remove. + + * w32console.c (w32con_move_cursor, w32con_clear_to_end) + (w32con_clear_frame, w32con_clear_end_of_line) + (w32con_ins_del_lines, w32con_insert_glyphs, w32con_write_glyphs) + (w32con_delete_glyphs, w32con_set_terminal_window) + (scroll_line, w32_sys_ring_bell): Add frame arg. + (w32con_set_terminal_modes, w32con_reset_terminal_modes): + Add terminal arg. + (PICK_FRAME): Remove. + (w32con_write_glyphs): Use frame specific terminal coding. + (one_and_only_w32cons): New global variable. + (initialize_w32_display): Use it for storing hooks. + (create_w32cons_output): New function. + + * w32inevt.c, w32inevt.h (w32_console_read_socket): Make first + arg a frame. + + * w32fns.c (x_create_tip_frame): Set terminal and ref count. + Set window_system. + (x_set_tool_bar_lines): Don't use updating_frame. + (Fx_create_frame): Set terminal and ref count. + (Fx_open_connection): Remove window-system check. + + * w32menu.c (Fx_popup_menu): Use terminal specific mouse_position_hook. + + * w32term.c (w32_term_init): Call add_keyboard_wait_descriptor. + (w32_set_terminal_modes, w32_reset_terminal_modes): Add terminal arg. + (x_clear_frame, x_delete_glyphs, w32_ring_bell, x_ins_del_lines): + Add frame arg. + (x_delete_terminal, w32_create_terminal): New functions. + (w32_term_init): Create a terminal. + (w32_initialize): Move terminal specific initialization to + w32_create_terminal. + + * w32term.h (x_output): Remove foreground_pixel and background_pixel. + (w32_clear_rect, w32_clear_area): Use background from frame. + (w32_display_info): Add terminal. + (w32_sys_ring_bell, x_delete_display): Declare here. + + * xdisp.c (display_menu_bar) [HAVE_NTGUI]: Check frame type. + + * s/ms-w32.h (SYSTEM_PURESIZE_EXTRA): Bump to 50k. + +2007-08-29 Kalle Olavi Niemitalo <kon@iki.fi> (tiny change) + + * keyboard.c (interrupt_signal, handle_interrupt, Fset_quit_char): + Fix get_named_tty calls for the controlling tty. + +2007-08-29 ARISAWA Akihiro <ari@mbf.ocn.ne.jp> (tiny change) + + * term.c (dissociate_if_controlling_tty)[USG]: Fix parse error. + +2007-08-29 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change) + + * term.c (tty_insert_glyphs): Add missing first parameter. + +2007-08-29 Karoly Lorentey <karoly@lorentey.hu> + + * buffer.c (Fbuffer_list, Fbury_buffer): + Take frame->buried_buffer_list into account. + + * cm.c (current_tty): New variable, for cmputc(). + (cmputc): Use it. + (cmcheckmagic): Add tty parameter, look up terminal streams there. + (calccost): Add tty parameter. Use emacs_tputs() instead of tputs(). + (cmgoto): Add tty parameter. Pass it on to calccost(). + Use emacs_tputs() instead of tputs(). + + * cm.h (emacs_tputs): New macro to set current_tty, and then call + tputs(). + (current_tty): New variable, for cmputc(). + (cmcheckmagic, cmputc, cmgoto): Add prototypes. + + * eval.c (unwind_to_catch): Don't call x_fully_uncatch_errors. + (internal_condition_case, internal_condition_case_1) + (internal_condition_case_2): Don't abort when x_catching_errors. + + * fns.c (Fyes_or_no_p): Don't try to open an X dialog on tty terminals. + (Fy_or_n_p): Likewise. Use temporarily_switch_to_single_kboard to + prevent crashes caused by bogus longjmps in read_char. + + * keymap.h (Fset_keymap_parent): Add EXFUN. + + * macterm.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL) + * w32term.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): + Remove redundant definition. + + * macfns.c (x_set_mouse_color, x_make_gc): + Use FRAME_BACKGROUND_PIXEL and FRAME_FOREGROUND_PIXEL. + + * w32term.c (x_free_frame_resources): + Use FRAME_BACKGROUND_PIXEL and FRAME_FOREGROUND_PIXEL. + (w32_initialize): Use the accessor macros for terminal characteristics. + + * macterm.c (mac_initialize): Use Fset_input_interrupt_mode. + Use the accessor macros for terminal characteristics. + * msdos.c (internal_terminal_init): Use the accessor macros for + terminal characteristics. + (ScreenVisualBell, internal_terminal_init): + Use FRAME_BACKGROUND_PIXEL and FRAME_FOREGROUND_PIXEL. + + * termopts.h (no_redraw_on_reenter): Declare. + + * alloc.c (emacs_blocked_malloc): Disable mallopt call. + (mark_terminals, mark_ttys): Declare. + (Fgarbage_collect): Call them. + (mark_object): Mark buried_buffer_list. + + * prefix-args.c: Include stdlib.h for exit. + + * syssignal.h: Add comment. + + * indent.c: Include stdio.h. + + * window.h (Vinitial_window_system): Declare. + (Vwindow_system): Delete declaration. + + * fontset.c (Finternal_char_font): Use FRAME_RIF. + + * image.c (lookup_image): Don't initialize `c' until the xasserts + have been run. + + * gtkutil.c (xg_create_frame_widgets): Use FRAME_BACKGROUND_PIXEL and + FRAME_FOREGROUND_PIXEL. + + * print.c (print_preprocess): Don't lose print_depth levels while + iterating. + + * widget.c (update_from_various_frame_slots): + Use FRAME_BACKGROUND_PIXEL and FRAME_FOREGROUND_PIXEL. + + * window.c (set_window_buffer): Don't call clear_mouse_face on tty + frames. + (window_internal_height): Remove bogus make_number call. + (init_window_once): Call make_terminal_frame with two zero parameters. + + * fileio.c (Fread_file_name): Update comment. + + * callint.c (Fcall_interactively): + Use temporarily_switch_to_single_kboard instead of single_kboard_state. + Make sure it is correctly unwound. + + * xsmfns.c (x_session_close): New function. + + * coding.h (terminal_coding, safe_terminal_coding, keyboard_coding): + Delete declarations. + + * xterm.h: Remove declaration for x_fully_uncatch_errors. + (x_output): Remove background_pixel and foreground_pixel fields. + (x_display_info): Add new field TERMINAL. Remove KBOARD field. + (x_delete_device): + (x_session_close): Declare. + + * lread.c: Include setjmp.h. Update declaration of `read_char'. + (read_filtered_event): Call `read_char' with a local + `wrong_kboard_jmpbuf'. + + * minibuf.c (read_minibuf): Call temporarily_switch_to_single_kboard. + Don't call single_kboard_state. Use FRAME_RIF. + + * process.c (Fmake_network_process): Don't unrequest_sigio on modern + systems. + + * lisp.h (set_process_environment): Rename to `set_global_environment'. + (Fframe_with_environment, Fset_input_meta_mode) + (Fset_quit_char): EXFUN. + (x_create_device, tty_output, terminal, tty_display_info): Declare. + (init_sys_modes, reset_sys_modes): Update prototypes. + (init_all_sys_modes, reset_all_sys_modes): New prototypes. + + * keyboard.h (struct kboard): Add new fields Vlocal_function_key_map, + Vlocal_key_translation_map, and Vkeyboard_translate_table. + (Vfunction_key_map, Vkeyboard_translate_table, single_kboard_state): + Delete declarations. + (Vfunction_key_map, Vkey_translation_map, push_kboard, pop_kboard) + (temporarily_switch_to_single_kboard, tty_read_avail_input): + New declarations. + + * emacs.c (main): Don't call init_sys_modes(), the new term_init() + already does that during init_display(). Call syms_of_keymap + before syms_of_keyboard. Call `syms_of_terminal'. + Call set_initial_environment, not set_process_environment. + (shut_down_emacs): Call reset_all_sys_modes() instead of + reset_sys_modes(). + + * xfaces.c (x_free_gc): Protect xassert with GLYPH_DEBUG. + (internal_resolve_face_name, resolve_face_name_error): New functions. + (resolve_face_name): Protect against loops and errors thrown by Fget. + (realize_default_face): Don't use FRAME_FONT unless frame is an X frame. + (Ftty_supports_face_attributes_p): Update tty_capable_p call. + + * scroll.c: Replace CURTTY() with local variables throughout the + file (where applicable). + (calculate_scrolling, calculate_direct_scrolling) + (scrolling_1, scroll_cost): Use the accessor macros for terminal + characteristics. + + * keymap.c (Vfunction_key_map): Remove. + (Fdescribe_buffer_bindings): Update references to Vfunction_key_map. + (syms_of_keymap): Remove DEFVAR for Vfunction_key_map. + (Vkey_translation_map): Remove. + (syms_of_keymap): Remove DEFVAR for key-translation-map. + (Fdescribe_buffer_bindings): + (read_key_sequence, init_kboard, syms_of_keyboard, mark_kboards): + Update for terminal-local key-translation-map. + + * Makefile.in (callproc.o): Update dependencies. + (lisp, shortlisp): Add termdev.elc. + (obj): Add terminal.o. + (terminal.o): Add dependencies. + [HAVE_CARBON]: Make terminal.o depend on macgui.h. + (data.o, fns.o): Add termhooks.h dependency. + (SOME_MACHINE_LISP): Add dnd.elc. + (minibuf.o): Fix typo. + Update dependencies. + + * data.c (do_symval_forwarding, store_symval_forwarding) + (find_symbol_value): Use the selected frame's keyboard, not + current_kboard. + + * .gdbinit (init_sys_modes): Use Vinitial_window_system instead of + Vwindow_system. + + * xmenu.c (Fx_menu_bar_open) [USE_X_TOOLKIT, USE_GTK]: Rename from + Fmenu_bar_open. + (syms_of_xmenu): Update defsubr. + (mouse_position_for_popup, Fx_popup_menu) + (Fx_popup_dialog, x_activate_menubar, update_frame_menubar) + (set_frame_menubar, free_frame_menubar) + (create_and_show_popup_menu, xmenu_show, ) + (create_and_show_dialog, xdialog_show, xmenu_show): Abort if not + an X frame. + + * xselect.c (x_own_selection): Abort if not an X frame. + (some_frame_on_display): Check if it is an X frame. + (x_handle_selection_clear): Deal with MULTI_KBOARD. + + * coding.c: Include frame.h and termhooks.h. + (terminal_coding, keyboard_coding): Delete. + (Fset_terminal_coding_system_internal): + (Fset_keyboard_coding_system_internal): + (Fkeyboard_coding_system): + (Fterminal_coding_system): Add a terminal parameter. + Get terminal_coding from the terminal. + (init_coding_once): Don't call setup_coding_system here. + + * dispextern.h (set_scroll_region, turn_off_insert) + (turn_off_highlight, background_highlight, clear_end_of_line_raw) + (tty_clear_end_of_line, tty_setup_colors) + (delete_tty, updating_frame) + (produce_special_glyphs, produce_glyphs, write_glyphs) + (insert_glyphs): Remove. + (raw_cursor_to, clear_to_end, tty_turn_off_insert) + (tty_turn_off_highlight, get_tty_size): Add declaration. + (tabs_safe_p, init_baud_rate, get_tty_terminal): Update prototypes. + + * frame.h (enum output_method): Add output_initial. + (struct x_output): Delete. + (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): + Access foreground_pixel and background_pixel directly from the frame. + (tty_display): Delete. + (struct frame): Add buried_buffer_list, foreground_pixel, + background_pixel and terminal. Delete kboard + (union output_data): Add tty. + (FRAME_KBOARD): Get the kboard from the terminal. + (FRAME_INITIAL_P): New macro. + (Qtty, Qtty_type, Qterminal, Qterminal_live_p, Qenvironment) + (Qterm_environment_variable, Qdisplay_environment_variable) + (make_terminal_frame, Qburied_buffer_list, Qwindow_system): + New declarations. + + * termchar.h (tty_output, tty_display_info): New structures. + (tty_list): Declare. + (FRAME_TTY, CURTTY): New macros. + (must_write_spaces, min_padding_speed, fast_clear_end_of_line) + (line_ins_del_ok, char_ins_del_ok, scroll_region_ok) + (scroll_region_cost, memory_below_frame, fast_clear_end_of_line) + (dont_calculate_costs, no_redraw_on_reenter): Remove declarations. + + * callproc.c: Include frame.h and termhooks.h, for terminal + parameters. + (add_env): New function. + (child_setup): Use it. + (child_setup, getenv_internal): Handle the new Vprocess_environment. + (getenv_internal): Fix get_terminal_param call. + (Fgetenv_internal, egetenv): Update doc. + (syms_of_callproc): Initialize Vprocess_environment to nil. + Register and initialize them. Remove obsolete defvars. Update doc + strings. + (child_setup): Handle Vlocal_environment_variables. + (getenv_internal): Add terminal parameter. + Handle Vlocal_environment_variables. + (Fgetenv_internal): Add terminal parameter. + (child_setup, getenv_internal, Fgetenv_internal): Store the local + environment in a frame (not terminal) parameter. Update doc strings. + (set_initial_environment): Rename from set_global_environment. + Store Emacs environment in initial frame parameter. + + * xdisp.c (redisplay_internal): Update references to + `previous_terminal_frame'. + (display_mode_line, Fformat_mode_line): Replace calls to + `push_frame_kboard' with `push_kboard'. + (get_glyph_string_clip_rects): Add extra parentheses and + braces to prevent compiler warnings. + (calc_pixel_width_or_height): Add xassert to check that the + frame is alive. Don't call `lookup_image' on a termcap frame. + (message2_nolog, message3_nolog, redisplay_internal) + (set_vertical_scroll_bar, redisplay_window, check_x_display_info) + (x_set_scroll_bar_foreground, x_set_scroll_bar_background) + (Fx_create_frame, Fxw_display_color_p, Fx_display_grayscale_p) + (Fx_display_pixel_width, Fx_display_pixel_height) + (Fx_display_planes, Fx_display_color_cells) + (Fx_server_max_request_size, Fx_server_vendor, Fx_server_version) + (Fx_display_screens, Fx_display_mm_height, Fx_display_mm_width) + (Fx_display_backing_store, Fx_display_visual_class) + (Fx_display_save_under, Fx_close_connection, x_create_tip_frame): + Use FRAME_TERMINAL_P, FRAME_WINDOW_P, FRAME_TTY and FRAME_RIF. + + * xfns.c (x_set_foreground_color x_set_background_color) + (x_set_mouse_color, x_set_cursor_color, x_make_gc): + Use FRAME_BACKGROUND_PIXEL and FRAME_FOREGROUND_PIXEL. + (Fx_create_frame, x_create_tip_frame, build_string, x_window) + (Fx_create_frame, x_create_tip_frame): Don't create frames on a + terminal that is being deleted. + (Fx_create_frame): Use `store_frame_param' to set `window-system' + frame parameter, and make sure it overrides any user-supplied setting. + (Fx_close_connection, Fx_synchronize): Unify argument names with + the rest of the DEFUNs. + + * dispnew.c (Fsend_string_to_terminal): Update call to + `get_tty_terminal'. + (Fredraw_frame, Fsend_string_to_terminal) + (Fsend_string_to_terminal, init_display): Use FRAME_RIF, + FRAME_TERMCAP_P and FRAME_TTY. + (window_change_signal): Don't believe width/height values that are + impossibly small. + (Vinitial_window_system): Rename from Vwindow_system. + (termscript, Wcm, rif): Delete. + + * termhooks.h (struct terminal): New struct containing the + previously global text display hooks and new members NAME, + DELETED and PARAM_ALIST. + (FRAME_TERMINAL, TERMINAL_TERMINAL_CODING) + (TERMINAL_KEYBOARD_CODING, TERMINAL_ACTIVE_P, FRAME_WINDOW_P) + (FRAME_RIF): New macros. + (get_terminal_param, get_device): New declarations. + (termscript): Delete declaration. + + * xterm.c (x_initialize): Use Fset_input_interrupt_mode. + (XTflash, x_free_frame_resources, x_scroll_bar_create) + (x_scroll_bar_set_handle): Use FRAME_BACKGROUND_PIXEL and + FRAME_FOREGROUND_PIXEL. + (x_fully_uncatch_errors): Disable definition. + (x_scroll_bar_expose): Fix reference to foreground pixel. + (XTread_socket): Disable loop on all X displays. + (x_delete_terminal): Don't set terminal->deleted and let + delete_terminal delete the frames on the terminal. + (x_delete_display): Doc update to reflect changes in + delete_terminal. + (x_display_info) <terminal>: Move member earlier in the struct. + (deleting_tty): Remove old variable. + (Fsuspend_tty): Call clear_tty_hooks. + (Fresume_tty, init_tty): Call set_tty_hooks. + (Ftty_display_color_p, Ftty_display_color_cells): Don't throw + errors on X frames. + (x_catch_errors_unwind): Abort if x_error_message is NULL. + (handle_one_xevent): Initialize `f' to NULL. + (x_delete_terminal, x_create_terminal): New functions. + (XTset_terminal_modes, XTreset_terminal_modes) + (XTread_socket, x_connection_closed, x_term_init) + (x_term_init, x_delete_display): Add terminal parameter. + (x_term_init) [!HAVE_GTK_MULTIDISPLAY]: Refuse to create secondary + X connections. + + * frame.c (Fframep): Deal with output_initial. + (Qbuffer_predicate, Qbuffer_list, Qburied_buffer_list, Qtty) + (Qtty_type, Qwindow_system, Qenvironment) + (Qterm_environment_variable, Qdisplay_environment_variable): New vars. + (x_set_screen_gamma, store_frame_param): Fix compilation errors. + (make_terminal_frame): Don't create frames on a terminal that is + being deleted. + (make_terminal_frame): Use FRAME_BACKGROUND_PIXEL and + FRAME_FOREGROUND_PIXEL. + (store_frame_param): Check for found_for_frame before calling XFRAME. + (Fmake_terminal_frame): Handle NULL tty names correctly. + (syms_of_frame): Enhance doc string of `default-frame-alist'. + (Fdelete_frame): Remove unused variable `count'. + (Qenvironment): New variable. + (Fdelete_frame): Don't allow other frames to refer to a deleted + frame in their 'environment parameter. + (Fframe_with_environment): New function. + (syms_of_frame): Defsubr it. Initialize and staticpro Qenvironment. + (get_future_frame_param): New function. + (Fmake_terminal_frame): Use it. + (x_set_frame_parameters, x_set_screen_gamma): Use FRAME_RIF. + + * sysdep.c (init_sys_modes, reset_sys_modes): Update for renames. + * sysdep.c (reset_sys_modes): Update for renames. + + * keyboard.c (tty_read_avail_input): New function. + (Fset_input_interrupt_mode, Fset_output_flow_control): New functions. + (syms_of_keyboard): Defsubr them. + (Fset_input_meta_mode, Fset_quit_char): New functions. + (Fset_input_mode): Split to above functions. + + (read_char_minibuf_menu_prompt): Add wrong_kboard_jmpbuf + parameter. Use it in call to `read_char'. + (read_char): Declare. Update call to `read_char_minibuf_menu_prompt'. + Set wrong_kboard_jmpbuf correctly in recursive calls. + Use current_kboard to access Vkeyboard_translate_table. + Enhance comment before extra longjmp to wrong_kboard_jmpbuf. + Add wrong_kboard_jmpbuf parameter to allow for recursive calls. + Update longjmp invocations. Remember the original current_kboard, + and longjmp to `wrong_kboard_jmpbuf' when a filter, timer or sentinel + changes it. Comment out unnecessary calls to + `record_single_kboard_state' and `any_kboard_state'. + Update recursive calls. + (wrong_kboard_jmpbuf): Remove global variable. + (read_key_sequence): Remove unused variable wrong_kboard_jmpbuf. + Handle deleted interrupted_kboards correctly; that is a legal + case. Add `wrong_kboard_jmpbuf' local variable. Update setjmp + and read_char calls. Abort if interrupted_kboard died in read_char. + (any_kboard_state, single_kboard_state) + (push_frame_kboard): Remove function. + (pop_kboard): Switch out of single_kboard mode if the kboard has + been deleted. Remove unused variable. Help debugging by not + changing current_kboard unnecessarily. Set current_kboard to the + kboard of the selected frame when the stored kboard object has + been deleted before pop_kboard. + (temporarily_switch_to_single_kboard): Change first parameter to a + frame pointer. Throw an error when caller wants to change kboards + while in single_kboard mode. Don't push_kboard if we weren't in + single kboard state. Don't pop_kboard if we popped into any + kboard state. + (restore_kboard_configuration): Abort if pop_kboard changed the + kboard in single_kboard mode. Call pop_kboard only after setting + up single_kboard mode. + (Frecursive_edit): Switch to single_kboard mode only in nested + command loops. + (cmd_error, command_loop, command_loop_1, timer_check): + Comment out unnecessary call to `any_kboard_state' and + `record_single_kboard_state'. + (delete_kboard): Exit single_kboard mode if we have just deleted + that kboard. Use FRAME_KBOARD. + (interrupt_signal): Use `Fkill_emacs' to exit Emacs, not + `fatal_error_signal'. + (record_single_kboard_state): Don't push_kboard if we weren't in + single kboard state. Don't pop_kboard if we popped into any + kboard state. + (push_frame_kboard): Rename to push_kboard. + (kbd_buffer_get_event): Use FRAME_TERMINAL. + (read_avail_input): Read input from all terminals. + (mark_kboards): Also mark Vkeyboard_translate_table. + (kbd_buffer_store_event_hold): Simplify condition. + (read_key_sequence): Reinitialize fkey and keytran at each replay. + (Vkeyboard_translate_table): Move to struct kboard. + (init_kboard): Initialize Vkeyboard_translate_table. + (syms_of_keyboard): Use DEFVAR_KBOARD to define + Vkeyboard_translate_table. Update doc strings. Update docs of + local-function-key-map and function-key-map. + + * terminal.c: New file. + + * term.c: Include errno.h. + (Vring_bell_function, device_list, initial_device) + (next_device_id, ring_bell, update_begin, update_end) + (set_terminal_window, cursor_to, raw_cursor_to) + (clear_to_end, clear_frame, clear_end_of_line) + (write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines) + (Fdisplay_name, create_device, delete_device): Move to terminal.c. + (syms_of_term): Move their initialization to terminal.c. + (get_tty_terminal, Fdisplay_tty_type, Ftty_display_color_p) + (Ftty_display_color_cells) + (Ftty_no_underline, Fsuspend_tty, Fresume_tty, create_tty_output) + (clear_tty_hooks, set_tty_hooks) + (init_tty, maybe_fatal): New functions. + (Ftty_type): Return nil if terminal is not on a tty instead of + throwing an error. Doc update. + (syms_of_term) <Vsuspend_tty_functions, Vresume_tty_functions>: + Doc update. Initialize new subrs and variables. + (delete_tty): Use terminal->deleted. + (tty_set_terminal_modes): Rename from set_terminal_modes. + (tty_reset_terminal_modes): Rename from reset_terminal_modes. + (set_scroll_region): Rename to `tty_set_scroll_region'. + (turn_on_insert): Rename to `tty_turn_on_insert'. + (turn_off_insert): Rename to `tty_turn_off_insert'. + (turn_off_highlight): Rename to `tty_turn_off_highlight'. + (turn_on_highlight): Rename to `tty_turn_on_highlight'. + (toggle_highligh): Rename to `tty_toggle_highlight'. + (background_highlight): Rename to `tty_background_highlight'. + (highlight_if_desired): Rename to `tty_highlight_if_desired'. + (tty_ring_bell, tty_update_end, tty_set_terminal_window) + (tty_set_scroll_region, tty_background_highlight) + (tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end) + (tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs) + (tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines) + (term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty): + Add static modifier. + (tty_reset_terminal_modes, tty_set_terminal_window) + (tty_set_scroll_region, tty_background_highlight) + (tty_highlight_if_desired, tty_cursor_to) + (tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame) + (tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs) + (tty_delete_glyphs, tty_ins_del_lines, turn_on_face): Update for + renames. + 2007-08-28 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> * keyboard.c: Qrtl is new. @@ -205,8 +1483,7 @@ For consistency, run after_insert_file_functions iff something got inserted. Move signal_after_change and update_compositions after code running after_insert_file_functions. Make sure that - undo_list doesn't record intermediate steps of the decoding - process. + undo_list doesn't record intermediate steps of the decoding process. 2007-08-07 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> @@ -395,8 +1672,8 @@ 2007-07-17 Glenn Morris <rgm@gnu.org> * abbrev.c (abbrev_check_chars): New function. - (Fdefine_global_abbrev, Fdefine_mode_abbrev): Call - abbrev_check_chars to check abbrev characters are word + (Fdefine_global_abbrev, Fdefine_mode_abbrev): + Call abbrev_check_chars to check abbrev characters are word constituents. Doc fix. 2007-07-17 Stefan Monnier <monnier@iro.umontreal.ca> @@ -427,6 +1704,10 @@ customizable variable. Rather explicitly check whether the height of the window that shall be splitted is at least as large as split_height_threshold. + (Fwindow_full_width_p): New defun. + (syms_of_window): Defsubr it. + + * window.h: Add EXFUN for Fwindow_full_width_p. 2007-07-14 Jason Rumney <jasonr@gnu.org> @@ -1141,27921 +2422,14 @@ * gtkutil.c (xg_update_menubar, create_menus): Create empty submenu for menu bar items. -2007-04-24 Chong Yidong <cyd@stupidchicken.com> - - * Branch for 22.1. - -2007-04-24 Chong Yidong <cyd@stupidchicken.com> - - * xdisp.c (redisplay_window): Use BEG_UNCHANGED and END_UNCHANGED - values of the actual window. - -2007-04-23 Richard Stallman <rms@gnu.org> - - * process.c (Fstart_process): Doc fix. - -2007-04-23 Eli Zaretskii <eliz@gnu.org> - - * process.c (Fstart_process): Doc fix. - -2007-04-22 Richard Stallman <rms@gnu.org> - - * abbrev.c (Fdefine_abbrev): Doc fix. - - * keymap.c (Fdefine_key): Minor doc fix. - -2007-04-21 Glenn Morris <rgm@gnu.org> - - * keymap.c (Fdefine_key): Fix info ref in doc string. - -2007-04-20 Glenn Morris <rgm@gnu.org> - - * sysdep.c (init_system_name): Don't accept localhost.localdomain. - -2007-04-19 Juanma Barranquero <lekktu@gmail.com> - - * minibuf.c (Fminibuffer_contents, Fminibuffer_contents_no_properties) - (Fminibuffer_completion_contents, Fdelete_minibuffer_contents): - Doc fixes. - -2007-04-16 Chong Yidong <cyd@stupidchicken.com> - - * dispnew.c (adjust_frame_glyphs_for_frame_redisplay): - Set garbaged flag in presence of window margins. - (showing_window_margins_p): New function. - - * xdisp.c (cursor_row_p): Only end row on newline if it's a - display string. Suggested by Lennart Borgman. - -2007-04-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * alloc.c (mem_insert): Set min_heap_address and max_heap_address - if they are not yet initialized. - -2007-04-15 Chong Yidong <cyd@stupidchicken.com> - - * xdisp.c (redisplay_window): When deciding whether or not to - recenter, don't use the reset values of BEG_UNCHANGED and - END_UNCHANGED. - -2007-04-13 Kim F. Storm <storm@cua.dk> - - * buffer.c (Fkill_buffer): gcpro BUF during kill_buffer_processes - and check that buffer is still alive upon return. - -2007-04-13 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macterm.c [!TARGET_API_MAC_CARBON]: Include Displays.h. - (mac_screen_config_changed): New variable. - (mac_handle_dm_notification, init_dm_notification_handler) - (mac_get_screen_info): New functions. - [MAC_OS8] (main): Call init_dm_notification_handler. - (mac_initialize) [MAC_OSX]: Likewise. - (XTread_socket): Call mac_get_screen_info if screen config changed. - (mac_initialized): Make static. - (mac_initialize_display_info): Remove function. - (mac_term_init): Call mac_get_screen_info. Add partial contents of - mac_initialize_display_info. - -2007-04-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * mac.c (xrm_get_preference_database, Fmac_get_preference) - [TARGET_API_MAC_CARBON]: Use CFPreferencesAppSynchronize. - - * macterm.c [TARGET_API_MAC_CARBON] (mac_post_mouse_moved_event): - Use GetGlobalMouse instead of GetMouse and LocalToGlobal. - (mac_initialize_display_info) [MAC_OSX]: Use CGRectZero. - (mac_initialize_display_info) [!MAC_OSX]: dpyinfo->height and - dpyinfo->width are those of whole screen. - -2007-04-10 Chong Yidong <cyd@stupidchicken.com> - - * xdisp.c (note_mode_line_or_margin_highlight): Don't decrement - glyph pointer before start of glyph row. - -2007-04-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * s/darwin.h (__restrict, struct kboard): Remove outdated workarounds. - (C_SWITCH_SYSTEM): Remove `-I../mac/src'. - -2007-04-09 Martin Rudalics <rudalics@gmx.at> - - * indent.c (Fmove_to_column): Set next_boundary with correct start pt. - -2007-04-08 Richard Stallman <rms@gnu.org> - - * xdisp.c (syms_of_xdisp) <message-log-max>: Default 100. - -2007-04-07 Chong Yidong <cyd@stupidchicken.com> - - * editfns.c (Ftranspose_regions): Validate interval before setting - text properties. - -2007-04-03 Eli Zaretskii <eliz@gnu.org> - - * emacs.c (main): Fix instructions for building Emacs for profiling. - -2007-04-03 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (xg_update_menubar): Call g_list_next after moving - menu bar item. - -2007-04-02 Juanma Barranquero <lekktu@gmail.com> - - * print.c (Fprin1_to_string): Use macro SPECPDL_INDEX. - -2007-04-01 Chong Yidong <cyd@stupidchicken.com> - - * keymap.c (Fcommand_remapping): New optional argument. - (where_is_internal): Use new keymaps argument. - (Fkey_binding): Caller changed. - - * keyboard.c (command_loop_1): Caller changed. - -2007-03-31 Eli Zaretskii <eliz@gnu.org> - - * window.c (Fget_lru_window): Doc fix. - -2007-03-30 Chong Yidong <cyd@stupidchicken.com> - - * undo.c (Fprimitive_undo): Give clearer error message when trying - to change text properties outside accessible part of buffer. - -2007-03-29 Kim F. Storm <storm@cua.dk> - - * process.c (wait_reading_process_output) [HAVE_PTYS]: - When EIO happens, clear channel from descriptor masks before raising - SIGCHLD signal to avoid busy loop between read and sigchld_handler. - (sigchld_handler): Remove sleep (2007-03-11 & 2007-03-26 changes). - -2007-03-29 Juanma Barranquero <lekktu@gmail.com> - - * buffer.c (Fset_buffer_major_mode): Check that BUFFER is valid. - - * process.c (Fformat_network_address): Return nil when the - argument vector contains invalid values. - -2007-03-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * gmalloc.c [HAVE_GTK_AND_PTHREAD]: Define USE_PTHREAD. - [USE_PTHREAD]: Include pthread.h. - (malloc_init_once_control, _malloc_mutex) [USE_PTHREAD]: New variables. - (malloc_initialize_1): New function created from __malloc_initialize. - (__malloc_initialize): Use it. - (LOCK, UNLOCK): New macros to make malloc etc. thread safe. - (_malloc_internal, _free_internal, _realloc_internal): Use them. - - * lread.c (readchar): Extend BLOCK_INPUT block to ferror/clearerr. - -2007-03-27 Juanma Barranquero <lekktu@gmail.com> - - * process.c (Fformat_network_address): Make args array big enough - to format IPv6 addresses. - -2007-03-27 Glenn Morris <rgm@gnu.org> - - * m/hp800.h: Restore HP-UX support (removed 2007-01-29). - -2007-03-26 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macfns.c (Fx_display_mm_height, Fx_display_mm_width): Scale whole - screen size in pixels by millimeters per pixel of main display. - - * macselect.c (get_scrap_target_type_list, x_own_selection): - Move assignments outside predicate macros. - (Vselection_converter_alist): Doc fix. - - * macterm.c (create_text_encoding_info_alist): Move assignments - outside predicate macros. - (mac_initialize_display_info) [MAC_OSX]: dpyinfo->height and - dpyinfo->width are those of whole screen. - -2007-03-26 Sam Steingold <sds@gnu.org> - - * process.c (sigchld_handler): Delay by 1ms instead of 1s to - alleviate sluggishness (the original problem is still fixed). - -2007-03-25 Kim F. Storm <storm@cua.dk> - - * intervals.c (merge_properties): Use explicit loop instead of - Fplist_member to avoid QUIT. Don't use Fcdr. - (intervals_equal): Likewise. Rewrite loop to perform length check - on the fly rather than calling Flength. Don't use Fcar. - -2007-03-24 Eli Zaretskii <eliz@gnu.org> - - * editfns.c (Fgoto_char): Doc fix. - - * indent.c (Findent_to): Doc fix. - -2007-03-24 Chong Yidong <cyd@stupidchicken.com> - - * editfns.c (Ftranspose_regions): Use set_text_properties_1 - instead of Fset_text_properties to avoid GC. Signal after change. - -2007-03-24 Eli Zaretskii <eliz@gnu.org> - - * xfns.c (Fx_show_tip): Doc fix. - - * macfns.c (Fx_show_tip): Doc fix. - - * w32fns.c (Fx_show_tip): Doc fix. - -2007-03-23 Kim F. Storm <storm@cua.dk> - - * intervals.c (merge_properties, intervals_equal): - Use Fplist_member instead of Fmemq to find properties. - -2007-03-23 Glenn Morris <rgm@gnu.org> - - * unexhp9k800.c: Restore file with clarified legal status. - * m/sr2k.h: Restore since dependency unexhp9k800.c is restored. - -2007-03-22 Chong Yidong <cyd@stupidchicken.com> - - * widget.c (EmacsFrameSetCharSize): Catch X errors. - -2007-03-22 Kenichi Handa <handa@m17n.org> - - * fileio.c (Fcopy_file): Call barf_or_query_if_file_exists with - non-encoded file name. - (Frename_file): Likewise. - (Fadd_name_to_file): Likewise. - (Fmake_symbolic_link): Likewise. - -2007-03-20 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * Makefile.in (alloca.o, gtkutil.o): Depend on systime.h. - (dired.o, editfns.o, fileio.o, msdos.o): Depend on atimer.h. - (dosfns.o, window.o, fns.o, macselect.o): Depend on atimer.h and - systime.h. - (term.o, print.o, lread.o): Depend on blockinput.h, atimer.h, and - systime.h. - (macfns.o): Remove duplicate dependency on systime.h. - - * dispnew.c (Fopen_termscript): Add BLOCK_INPUT around fclose. - (Fsend_string_to_terminal): Add BLOCK_INPUT around fwrite. - - * fileio.c (do_auto_save_unwind): Add BLOCK_INPUT around fclose. - (Fdo_auto_save): Add BLOCK_INPUT around fwrite. - - * keyboard.c (record_char): Add BLOCK_INPUT around fwrite. - (Fopen_dribble_file): Add BLOCK_INPUT around fclose. - - * lread.c: Include blockinput.h. - (readchar, Fget_file_char): Add BLOCK_INPUT around getc. - (unreadchar): Add BLOCK_INPUT around ungetc. - (load_unwind): Add BLOCK_INPUT around fclose. - - * print.c: Include blockinput.h. - (Fredirect_debugging_output): Add BLOCK_INPUT around fclose. - - * process.c (Fmake_network_process) [HAVE_GETADDRINFO]: - Clear immediate_quit before calling freeaddrinfo. - Add BLOCK_INPUT around freeaddrinfo. - - * term.c: Include blockinput.h. - (write_glyphs, insert_glyphs): Add BLOCK_INPUT around fwrite. - -2007-03-19 Richard Stallman <rms@gnu.org> - - * keyboard.c (NUM_RECENT_KEYS): Bump up to 300. - - * buffer.c (syms_of_buffer): Doc fix. - -2007-03-18 Chong Yidong <cyd@stupidchicken.com> - - * image.c (pbm_load): Signal error for invalid image size. - -2007-03-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macterm.c (note_mouse_movement): Don't return immediately for - LeaveNotify case. - - * macmenu.c (popup_activated_flag): New variable. - (x_activate_menubar, mac_menu_show): Set it during menu tracking. - (popup_activated): New function. - - * xdisp.c (redisplay_internal, note_mouse_highlight): - Check popup_activated for MAC_OS. - -2007-03-17 Juanma Barranquero <lekktu@gmail.com> - - * buffer.c (syms_of_buffer) <buffer-display-table>: Doc fix. - Reported by Nikolaj Schumacher <n_schumacher@web.de>. - -2007-03-17 Richard Stallman <rms@gnu.org> - - * dired.c (file_name_completion): gcpro NAME. - -2007-03-17 Chong Yidong <cyd@stupidchicken.com> - - * xdisp.c (try_window_id): Increment matrix positions if the - buffer's byte count has increased, but not the character count. - -2007-03-12 Andreas Schwab <schwab@suse.de> - - * lisp.h: Declare check_obarray. - - * process.c (Fdelete_process): Properly handle deletion of first - element of deleted_pid_list. - (create_process): Declare pid as pid_t. - -2007-03-12 Kim F. Storm <storm@cua.dk> - - * process.c (sigchld_handler): Change type of pid to pid_t. - Scan deleted_pid_list explicitly to avoid using Fmember which don't - know about mark bits and make_fixnum_or_float which may malloc. - Reported by Andreas Schwab. - - * keyboard.c (read_key_sequence): Store original event into keybuf - when replaying sequence with local keymap(s) from string. - -2007-03-12 Glenn Morris <rgm@gnu.org> - - * editfns.c (Fdecode_time, Fencode_time): Doc fix ("daylight - savings" to "daylight saving"). - -2007-03-11 Sam Steingold <sds@gnu.org> - - * process.c (sigchld_handler): Sleep before wait3 to avoid a busyloop. - -2007-03-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macfns.c (Fx_server_vendor): Change vendor string to "Apple Inc.". - -2007-03-10 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macterm.c [USE_CARBON_EVENTS] (mac_handle_mouse_event): - Ignore mouse wheel movement on title bar or tool bar. - -2007-03-10 Chong Yidong <cyd@stupidchicken.com> - - * keyboard.c (help_form_saved_window_configs): New var. - (read_char_help_form_unwind): New function. - (read_char): Don't restore window configuration if a mouse click - arrives while the help form is being displayed. - -2007-03-10 Kim F. Storm <storm@cua.dk> - - * xdisp.c (redisplay_window): Don't automatically select a new window - start for a contination line during mouse-click. - -2007-03-09 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.c (handle_one_xevent): Ignore buttons > 3 for the tool bar. - -2007-03-09 Juanma Barranquero <lekktu@gmail.com> - - * keymap.c (Fdescribe_buffer_bindings): Check that BUFFER is valid. - -2007-03-08 Richard Stallman <rms@gnu.org> - - * keyboard.c (syms_of_keyboard): Doc fix. - -2007-03-08 Chong Yidong <cyd@stupidchicken.com> - - * minibuf.c (Ftry_completion): Don't short circuit if - completion-ignore-case is non-nil. - -2007-03-07 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macfns.c (mac_set_scroll_bar_width, mac_frame_parm_handlers): - Undo 2006-03-06 changes. - - * macterm.c (XTset_vertical_scroll_bar) [MAC_OSX]: Don't show scroll - bar if its width is smaller than that of Aqua small scroll bar. - -2007-03-07 Stefan Monnier <monnier@iro.umontreal.ca> - - * minibuf.c (read_minibuf): Bind inhibit-read-only a bit longer so as - to handle correctly prompts with read-only property. - -2007-03-06 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * sound.c (wav_play): Check header->data_length to see how much we - shall read. - (alsa_period_size): Convert ALSA period size in frames to bytes. - (alsa_write): Return if frames is zero. - -2007-03-06 Kenichi Handa <handa@m17n.org> - - * xselect.c (Vselection_coding_system): Documentation improved. - -2007-03-05 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macterm.c (x_scroll_bar_create, XTread_socket): Replace #if - USE_TOOLKIT_SCROLL_BARS with #ifdef USE_TOOLKIT_SCROLL_BARS. - (x_set_window_size): Call SET_FRAME_GARBAGED. Clear window if - internal border width has changed. - - * macterm.h (struct mac_output): New member `internal_border_width'. - -2007-03-04 Richard Stallman <rms@gnu.org> - - * window.c (Fdisplay_buffer): Doc fix. - -2007-03-03 Glenn Morris <rgm@gnu.org> - - * Makefile.in: Don't clear out LIB_X11_LIB, since XFT_LIBS does - not include -lX11 on Solaris. - -2007-03-02 Stuart D. Herring <herring@lanl.gov> - - * keymap.c (Fkey_binding): Don't consider one-element lists as events. - -2007-03-01 Kenichi Handa <handa@m17n.org> - - * process.c (send_process_object): Check the process status and - signal an error if something is wrong. - -2007-02-28 Chong Yidong <cyd@stupidchicken.com> - - * insdel.c (Fcombine_after_change_execute): Return nil if - combine_after_change_buffer has been invalidated. - -2007-02-25 Dan Nicolaescu <dann@ics.uci.edu> - - * m/xtensa.h: New file. - -2007-02-24 Nick Roberts <nickrob@snap.net.nz> - - * .gdbinit (xprintstr): Ensure GDB (> 6.6) prints symbol name - as strings and not character arrays. - -2007-02-24 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macterm.c [USE_TOOLKIT_SCROLL_BARS] (x_scroll_bar_handle_drag) - (x_set_toolkit_scroll_bar_thumb): Add bar->min_handle as margin to - scroll bar handle size in order to avoid `scroll backward' problem. - (x_scroll_bar_create, XTset_vertical_scroll_bar) - [USE_TOOLKIT_SCROLL_BARS]: Initialize bar->min_handle. - - * macterm.h (struct scroll_bar) [USE_TOOLKIT_SCROLL_BARS]: - New member `min_handle'. - -2007-02-23 Kim F. Storm <storm@cua.dk> - - * print.c (print): Reset print_number_index if Vprint_number_table - is nil. - -2007-02-23 Eli Zaretskii <eliz@gnu.org> - - * w32.c (stat, get_long_basename, is_unc_volume): Use _mbspbrk - instead of strpbrk. - -2007-02-23 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macmenu.c (mac_menu_show): Call unbind_to early. Use variable - `menu_item_selection' as in W32 version. - [TARGET_API_MAC_CARBON] (mac_handle_dialog_event): Add explicit - braces to avoid ambiguous `else'. - - * macterm.c (mac_display_info_for_display): Remove function. - (mac_flush_display_optional) [USE_CG_DRAWING]: New function. - (x_redisplay_interface) [USE_CG_DRAWING]: Set it as handler for - flush_display_optional. - [USE_TOOLKIT_SCROLL_BARS] (x_scroll_bar_handle_press): - New argument MOUSE_POS. All uses changed. Set bar->dragging to - negative integer if scroll bar handle is pressed. - [USE_TOOLKIT_SCROLL_BARS] (x_scroll_bar_handle_release): - Negative bar->dragging means scroll bar handle is not dragged. - [USE_TOOLKIT_SCROLL_BARS] (x_scroll_bar_handle_drag): Get initial - offset of scroll bar handle from negative bar->dragging. - (XTread_socket) [USE_TOOLKIT_SCROLL_BARS]: Modifiers for scroll - bar click is compared against mapped one. Set down/up_modifier - for scroll bar click event with control key. - - * macterm.h (x_display_info_for_display): Remove extern. - (SCROLL_BAR_UNPACK, SET_SCROLL_BAR_CONTROL_HANDLE): Don't limit - value to be unpacked to 32-bit on LP64 model. - -2007-02-23 Kenichi Handa <handa@m17n.org> - - * process.c (send_process_object_unwind): New function. - (send_process_object): New function. - (Fprocess_send_region): Call send_process_object. - (Fprocess_send_string): Likewise. - -2007-02-22 Jason Rumney <jasonr@gnu.org> - - * w32menu.c (w32_menu_show): Mark the frame's menu as inactive - when popup menu finishes. - - * w32fns.c (menubar_in_use): New flag. - (w32_wnd_proc) <WM_INITMENU, WM_EXITMENULOOP, WM_TIMER, WM_COMMAND>: - Use it. - - * w32menu.c (Fx_popup_menu): Don't free menu strings here. - (w32_menu_show): Do it here instead. - - * w32fns.c (w32_wnd_proc) <WM_INITMENU>: Set menubar_active frame - parameter. - - * w32menu.c (current_popup_menu): Make available globally. - (menubar_selection_callback): Free menu strings before pushing the - menu event into the keyboard buffer. Remove menu_command_in_progress. - - * w32fns.c (current_popup_menu): Use from w32menu.c. - (w32_wnd_proc) <WM_EXITMENULOOP, WM_TIMER>: Use menubar_active - and current_popup_menu to determine whether a menubar menu has - been cancelled. - - * w32term.h (w32_output): Remove menu_command_in_progress. - -2007-02-22 Kim F. Storm <storm@cua.dk> - - * dispnew.c (update_frame, update_single_window): Set force_p here if - redisplay_dont_pause is set or Vredisplay_preemption_period is nil... - (update_window, update_frame_1): ... instead of here. - (update_text_area): Clear mouse face on header lines. - -2007-02-21 Kim F. Storm <storm@cua.dk> - - * minibuf.c (Fassoc_string): Doc fix. Allow symbol for KEY too. - -2007-02-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macterm.c (WINDOW_RESOURCE, TERM_WINDOW_RESOURCE): Remove macros. - [USE_MAC_TSM] (mac_handle_text_input_event): Remove unused variable - `mapped_modifiers'. - (XTread_socket) [MAC_OS_X_VERSION_MAX_ALLOWED >= 1020]: Use Keyboard - Layout Services routines to get current Unicode keyboard layout. - -2007-02-20 Chong Yidong <cyd@stupidchicken.com> - - * frame.c (x_set_screen_gamma): Apply gamma value to the frame's - bgcolor. - -2007-02-19 Kim F. Storm <storm@cua.dk> - - * minibuf.c (Fassoc_string): Allow symbols as keys. - - * w32term.c (w32_set_scroll_bar_thumb): Don't resize scroll-bar - handle while dragging, except when we get close to eob. - Fix position and size calculations so we don't scroll backwards - just by clicking on the handle. - -2007-02-17 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * Makefile.in (${emacsapp}Contents/Resources/Emacs.rsrc) - [HAVE_CARBON]: Remove target. - (macosx-app) [HAVE_CARBON]: Don't depend on it. - -2007-02-17 Juanma Barranquero <lekktu@gmail.com> - - * callproc.c (syms_of_callproc) <doc-directory>: - <configure-info-directory>: - (Fgetenv_internal): Fix typos in docstrings. - - * doc.c (Fsubstitute_command_keys): Fix typo in docstring. - -2007-02-16 Andreas Schwab <schwab@suse.de> - - * frame.c (Fmodify_frame_parameters): Return a value. - - * editfns.c (Fformat): Add support for '+' flag. - * doprnt.c (doprnt1): Likewise. Fix overflow checking. - -2007-02-14 Chong Yidong <cyd@stupidchicken.com> - - * s/umips.h: Unused file removed. - -2007-02-14 Juanma Barranquero <lekktu@gmail.com> - - * xfaces.c (Fcolor_distance): Don't continue checking a color for - errors after it has been correctly parsed as an RGB list. - -2007-02-14 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.c (do_ewmh_fullscreen): Also check for _NET_WM_STATE_FULLSCREEN. - -2007-02-13 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macfns.c (Fx_focus_frame): Move current process to foreground if - it is not. - [TARGET_API_MAC_CARBON] (Fx_file_dialog): Replace #if MAC_OSX with - #ifdef MAC_OSX. - (Fmac_set_font_panel_visible_p) [USE_MAC_FONT_PANEL]: Rename from - Fmac_set_font_panel_visibility. All uses changed. Rename argument - VISIBLE to FLAG. - - * macterm.c (MakeMeTheFrontProcess) [MAC_OSX]: Remove function. - (mac_initialize) [MAC_OSX]: Call SetFrontProcess instead of - MakeMeTheFrontProcess. - -2007-02-12 Chong Yidong <cyd@stupidchicken.com> - - * frame.c (x_set_screen_gamma): Clear face cache. - -2007-02-11 Juanma Barranquero <lekktu@gmail.com> - - * buffer.c (Fgenerate_new_buffer_name, Fbuffer_modified_tick): - Reflow docstrings. - -2007-02-10 Eli Zaretskii <eliz@gnu.org> - - * window.c (Fwindow_height, Fwindow_hscroll) - (Fwindow_redisplay_end_trigger, Fwindow_point, Fwindow_start) - (Fwindow_end, Fwindow_display_table, Fwindow_text_height): - Document the effect of WINDOW arg being nil. - -2007-02-08 Kim F. Storm <storm@cua.dk> - - * minibuf.c (read_minibuf): Fix 2007-01-30 change. - Use Qlambda as interim value of Vminibuffer_completing_file_name. - (Fcompleting_read): Use non-filename maps if value is Qlambda (or Qnil). - (syms_of_minibuf) <minibuffer-completing-file-name>: Document lambda. - -2007-02-07 Juanma Barranquero <lekktu@gmail.com> - - * makefile.w32-in ($(TRES)): Use literal "../nt/emacs.rc" instead - of $(ALL_DEPS). - -2007-02-07 Eli Zaretskii <eliz@gnu.org> - - * makefile.w32-in ($(TRES)): Depend on stamp_BLD, since $(TRES) is - put into $(BLD). - -2007-02-06 Chong Yidong <cyd@stupidchicken.com> - - * frame.c (Fmodify_frame_parameters): Don't bind - Qinhibit_default_face_x_resources, which has no effect. - (Qinhibit_default_face_x_resources): Symbol deleted. - -2007-02-03 Eli Zaretskii <eliz@gnu.org> - - * indent.c (Fmove_to_column): Document that the argument COLUMN is - taken from prefix numeric argument. - -2007-02-03 Juanma Barranquero <lekktu@gmail.com> - - * lread.c (syms_of_lread) <load-history>: Doc fix. - -2007-01-29 Andreas Seltenreich <uwi7@rz.uni-karlsruhe.de> (tiny change) - - * xterm.c [!USE_TOOLKIT_SCROLL_BARS] (x_scroll_bar_expose): - Use the foreground color of the scroll-bar face when drawing - the scroll-bar's border. - -2007-02-02 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.c (do_ewmh_fullscreen): Check that what != NULL before - calling wm_supports. - -2007-02-01 Juanma Barranquero <lekktu@gmail.com> - - * lread.c (syms_of_lread) <user-init-file>: Doc fix. - Wording by Eli Zaretskii. - -2007-01-31 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (update_frame_tool_bar): Initialize h/vmargin to 0. - -2007-01-30 Richard Stallman <rms@gnu.org> - - * minibuf.c (read_minibuf): - Save and clear Vminibuffer_completing_file_name. - (read_minibuf_unwind): Restore it. - (Vminibuffer_completion_table, Qminibuffer_completion_table) - (Vminibuffer_completion_predicate, Qminibuffer_completion_predicate) - (Vminibuffer_completion_confirm, Qminibuffer_completion_confirm) - (Vminibuffer_completing_file_name): Definitions moved up. - -2007-01-29 Chong Yidong <cyd@stupidchicken.com> - - * m/hp800.h: Restore, removing HP-UX support. - -2007-01-29 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * Makefile.in: Use a variable, XFT_LIBS, instead #define LIB_X11_LIB. - -2007-01-28 Richard Stallman <rms@gnu.org> - - * minibuf.c (Ftry_completion, Fall_completions) - (Fcompleting_read, Ftest_completion): - Rename arg ALIST or TABLE to COLLECTION. - -2007-01-27 Chong Yidong <cyd@stupidchicken.com> - - * unexhp9k800.c: Remove due to lack of legal papers. - - * m/sr2k.h, m/hp800.h: Remove due to dependence on above. - -2007-01-27 Eli Zaretskii <eliz@gnu.org> - - * keyboard.c (Fthis_command_keys, Fthis_command_keys_vector): Doc fix. - - * minibuf.c (Fcompleting_read): Doc fix. - -2007-01-26 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (xg_initialize): Call XftInit if HAVE_XFT. - - * Makefile.in: Use XFT_LIBS if defined. - -2007-01-26 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * alloc.c (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Use - BLOCK_INPUT/UNBLOCK_INPUT. - - * blockinput.h (interrupt_input_blocked): Declare volatile. - - * keyboard.c (interrupt_input_blocked): Declare volatile. - - * syssignal.h (SIGNAL_THREAD_CHECK): Use pthread_equal. - -2007-01-24 Kim F. Storm <storm@cua.dk> - - * keymap.c (describe_map): Don't consider prefix keys to be shadowed. - -2007-01-23 Juanma Barranquero <lekktu@gmail.com> - - * editfns.c (Finsert_char): Doc fix. - (Fget_internal_run_time, Fdecode_time): Fix typos in docstrings. - -2007-01-22 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macselect.c [TARGET_API_MAC_CARBON] (mac_do_receive_drag): - Don't pass keyboard modifiers to mac_store_drag_event, but put - them as kEventParamKeyModifiers Apple event parameter. - -2007-01-21 Chong Yidong <cyd@stupidchicken.com> - - * xdisp.c (try_window): Revert previous change. - - * dispnew.c (update_text_area): Revert 2006-09-17 change. - Always redraw non-mode-line rows with mouse-face. - -2007-01-20 Chong Yidong <cyd@stupidchicken.com> - - * xdisp.c (try_window): Clear mouse-face highlights first. - - * window.c (set_window_buffer): Revert 2006-11-22 change. - -2007-01-20 Eli Zaretskii <eliz@gnu.org> - - * .gdbinit (ppt, xtype, xmisctype, xint, xptr, xmarker, xframe) - (xbuffer, xcons, xcar, xcdr): Fix doc strings. - -2007-01-20 Chong Yidong <cyd@stupidchicken.com> - - * keyboard.c (read_key_sequence): Extract local map only if the - given position is in an accessible buffer region. - -2007-01-19 Nick Roberts <nickrob@snap.net.nz> - - * .gdbinit: Reformat documentation so that first sentence - displays properly with "help user-defined" (like apropos). - -2007-01-18 Bruno Haible <bruno@clisp.org> (tiny change) - - * epaths.in: Move PATH_DOC from local/info to local/share/info. - -2007-01-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macmenu.c (create_and_show_dialog) [TARGET_API_MAC_CARBON]: - Create movable modal window instead of movable alert window. - (create_and_show_dialog) [!MAC_OSX]: Use DeactivateControl instead - of DisableControl. - - * macselect.c (Fmac_resume_apple_event): Set error number when - descriptor type of reply is non-null. - -2007-01-14 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macmenu.c (create_and_show_dialog) [TARGET_API_MAC_CARBON]: - Use DisableControl for disabled items. Set default button to first - enabled one. Use icon of application in execution. - -2007-01-13 Eli Zaretskii <eliz@gnu.org> - - * process.c (Fdelete_process, Fprocess_id, sigchld_handler): - Copy PID into EMACS_INT to avoid GCC warnings. - - * fns.c (maybe_resize_hash_table): Copy new size of hash table - into EMACS_INT to avoid GCC warnings. - - * editfns.c (Fuser_uid, Fuser_real_uid): Copy values returned by - geteuid and getuid into EMACS_INT to avoid GCC warnings. - - * dired.c (Ffile_attributes): Fix last change. - -2007-01-12 Eli Zaretskii <eliz@gnu.org> - - * dired.c (Ffile_attributes): Copy some members of `struct stat' - into int's to avoid GCC warnings about limited range of short in - arguments to FIXNUM_OVERFLOW_P. - -2007-01-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macmenu.c (HAVE_DIALOGS): Define if TARGET_API_MAC_CARBON. - (mac_handle_dialog_event, install_dialog_event_handler) - (create_and_show_dialog) [TARGET_API_MAC_CARBON]: New functions. - (DIALOG_LEFT_MARGIN, DIALOG_TOP_MARGIN, DIALOG_RIGHT_MARGIN) - (DIALOG_BOTTOM_MARGIN, DIALOG_MIN_INNER_WIDTH) - (DIALOG_MAX_INNER_WIDTH, DIALOG_BUTTON_BUTTON_HORIZONTAL_SPACE) - (DIALOG_BUTTON_BUTTON_VERTICAL_SPACE, DIALOG_BUTTON_MIN_WIDTH) - (DIALOG_TEXT_MIN_HEIGHT, DIALOG_TEXT_BUTTONS_VERTICAL_SPACE) - (DIALOG_ICON_WIDTH, DIALOG_ICON_HEIGHT, DIALOG_ICON_LEFT_MARGIN) - (DIALOG_ICON_TOP_MARGIN) [TARGET_API_MAC_CARBON]: New macros. - (mac_dialog) [TARGET_API_MAC_CARBON]: Remove function. - (mac_dialog_show) [TARGET_API_MAC_CARBON]: Use create_and_show_dialog. - - * macterm.c (x_free_frame_resources) [USE_CG_DRAWING]: - Call mac_prepare_for_quickdraw. - (quit_char, make_ctrl_char) [TARGET_API_MAC_CARBON]: Move externs - outside #ifdef MAC_OSX. - (mac_quit_char_key_p) [TARGET_API_MAC_CARBON]: Move function - outside #ifdef MAC_OSX. - (mac_check_bundle) [MAC_OSX]: Remove unused function. - - * macterm.h (mac_quit_char_key_p): Move extern outside #ifdef MAC_OSX. - (HOURGLASS_WIDTH, HOURGLASS_HEIGHT): Parenthesize definitions. - -2007-01-11 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * alloc.c (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Use pthread_equal, - block/unblock SIGIO. - -2007-01-10 Stefan Monnier <monnier@iro.umontreal.ca> - - * editfns.c (Fformat): Allow integer-format to work with floats of size - larger than most-positive-fixnum (but still smaller than MAXINT). - - * dired.c (Ffile_attributes): Use floats for large uids/gids. - -2007-01-09 Eli Zaretskii <eliz@gnu.org> - - * emacs.c (syms_of_emacs) <path-separator>: Doc fix. - -2007-01-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * callproc.c (Fcall_process_region) [HAVE_MKSTEMP]: Add BLOCK_INPUT - around mkstemp. - - * image.c (XDrawLine) [MAC_OS]: Remove macro. - (XCreateGC_pixmap) [!HAVE_NTGUI]: Likewise. - (x_disable_image) [!HAVE_NTGUI]: Use XCreateGC instead of - XCreateGC_pixmap. - - * macgui.h (Display): Typedef to opaque type. - - * macmenu.c (mac_dialog_modal_filter) [MAC_OSX]: New function. - (Fx_popup_dialog) [MAC_OSX]: Use standard alert if called from - Fmessage_box, Fyes_or_no_p, or Fy_or_n_p. - [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030] (menu_quit_handler): - Use mac_quit_char_key_p. - - * macterm.c (XDrawLine): Rename from mac_draw_line_to_pixmap. - (XCreateGC): Change type of 2nd argument to void *. - (XFreeGC) [USE_CG_DRAWING && MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]: - Fix last change. - (mac_to_emacs_modifiers): Change return type to int. - [USE_CARBON_EVENTS] (mac_event_to_emacs_modifiers): Likewise. - (mac_mapped_modifiers): New function. - (XTread_socket): Use it. - [USE_TSM] (mac_handle_text_input_event): Likewise. - (do_window_update) [USE_CG_DRAWING]: Call mac_prepare_for_quickdraw. - (mac_quit_char_modifiers, mac_quit_char_keycode) [MAC_OSX]: - Remove variables. - (mac_determine_quit_char_modifiers, init_quit_char_handler) - [MAC_OSX]: Remove functions. - (make_ctrl_char) [MAC_OSX]: Add extern. - (mac_quit_char_key_p) [MAC_OSX]: New function. - (mac_initialize) [MAC_OSX]: Don't call init_quit_char_handler. - - * macterm.h (FONT_MAX_WIDTH): Remove unused macro. - (XCreateGC): Change type in extern. - (XDrawLine): Rename from mac_draw_line_to_pixmap. - (mac_quit_char_key_p) [MAC_OSX]: Add extern. - -2007-01-08 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * keyboard.c (init_keyboard): Initialize interrupt_input_blocked and - interrupt_input_pending. - - * xterm.h (x_display_info): New: net_supported_atoms, - nr_net_supported_atoms and net_supported_window. - - * xterm.c (last_user_time): New variable. - (handle_one_xevent): Set last_user_time from events that have Time. - Set net_supported_window to 0 when reparented. - (wm_supports): New function. - (do_ewmh_fullscreen): Use wm_supports to check for _NET_WM_STATE. - (x_term_init): Initialize net_supported_atoms, nr_net_supported_atoms - and net_supported_window. - -2007-01-05 Kim F. Storm <storm@cua.dk> - - * indent.c (Fvertical_motion): Fix it overshoot check for overlay - strings without embedded newlines immediately followed by newline. - -2007-01-05 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * editfns.c (Fformat_time_string, Fdecode_time, Fencode_time) - (Fcurrent_time_string, Fcurrent_time_zone): Add BLOCK_INPUT around - gmtime/localtime/emacs_memftimeu/mktime. - - * mac.c (Fmac_set_file_creator): Use MAC_EMACS_CREATOR_CODE - instead of 'EMAx'. - [!MAC_OSX] (sys_open, sys_creat, sys_fopen): Likewise. - - * macgui.h (struct _XGC) [USE_CG_DRAWING - && MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]: New members cg_fore_color - and cg_back_color. - - * macmenu.c (Vshow_help_function) [TARGET_API_MAC_CARBON]: Add extern. - (restore_show_help_function, menu_target_item_handler) - [TARGET_API_MAC_CARBON]: New functions. - (install_menu_target_item_handler): New function. - (add_menu_item) [TARGET_API_MAC_CARBON]: Set help string as menu - item property. - - * macterm.c (CG_SET_FILL_COLOR_MAYBE_WITH_CGCOLOR) - (CG_SET_FILL_COLOR_WITH_GC_FOREGROUND) - (CG_SET_FILL_COLOR_WITH_GC_BACKGROUND) - (CG_SET_STROKE_COLOR_MAYBE_WITH_CGCOLOR) - (CG_SET_STROKE_COLOR_WITH_GC_FOREGROUND): New macros. - (mac_cg_color_space_rgb) [USE_CG_DRAWING]: New variable. - (mac_cg_color_black) [USE_CG_DRAWING - && MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]: New variable. - (init_cg_color) [USE_CG_DRAWING]: New function. - (mac_draw_line, mac_draw_rectangle) [USE_CG_DRAWING]: Use - CG_SET_STROKE_COLOR_WITH_GC_FOREGROUND instead of CG_SET_STROKE_COLOR. - (mac_erase_rectangle, mac_clear_window, mac_draw_cg_image) - (mac_fill_rectangle, mac_draw_image_string_cg) [USE_CG_DRAWING]: - Use CG_SET_FILL_COLOR_WITH_GC_FOREGROUND or - CG_SET_FILL_COLOR_WITH_GC_BACKGROUND instead of CG_SET_FILL_COLOR. - (mac_draw_string_common) [MAC_OSX && USE_ATSUI]: Likewise. - (XCreateGC, XFreeGC, XSetForeground, XSetBackground) [USE_CG_DRAWING - && MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]: Use gc->cg_fore_color and/or - gc->cg_back_color. - (install_drag_handler, remove_drag_handler): Make extern. - (install_menu_target_item_handler): Add extern. - (install_window_handler): Call install_menu_target_item_handler. - [MAC_OS8] (main): Use MAC_EMACS_CREATOR_CODE instead of 'EMAx'. - (mac_initialize) [USE_CG_DRAWING]: Call init_cg_color. - - * macterm.h (MAC_EMACS_CREATOR_CODE): New enumerator. - -2007-01-04 Juanma Barranquero <lekktu@gmail.com> - - * window.c (Fwindow_end): Fix use of >= operator. - -2007-01-03 Richard Stallman <rms@gnu.org> - - * window.c (Fwindow_end): Check BUF_OVERLAY_MODIFF like BUF_MODIFF. - -2007-01-02 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.h (xg_menu_item_cb_data_): Remove highlight_id and - unhighlight_id. - - * gtkutil.c (menuitem_highlight_callback): Invoked widget is the - parent of the menu item. Get menu item widget from event. - (xg_create_one_menuitem, xg_update_menu_item): highlight_id and - unhighlight_id has been removed. - (create_menus): Connect enter/leave-notify-event to the menu instead - of individual items. - -2006-12-31 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (update_frame_tool_bar): Connect create-menu-proxy with - xg_tool_bar_menu_proxy. - (xg_tool_bar_menu_proxy): New function. - (xg_tool_bar_proxy_callback): New function. - -2006-12-30 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (xg_tool_bar_button_cb): Save last modifier on widget. - (xg_tool_bar_callback): Remove check for button. - (update_frame_tool_bar): Put an event box in the tool bar and a button - in the event box. Attach enter/leave-notify-event to the event box. - -2006-12-30 Richard Stallman <rms@gnu.org> - - * keymap.c (Fdefine_key): Doc fix. - -2006-12-29 Kim F. Storm <storm@cua.dk> - - * frame.h (struct frame): New member minimize_tool_bar_window_p. - - * xdisp.c (auto_resize_tool_bars_p): Replace with ... - (Vauto_resize_tool_bars): ... this. - (syms_of_xdisp): DEFVAR_LISP and initialize it. Update doc string - to describe new value `grow-only', and use of C-l. - (display_tool_bar_line): Only use default face for border below - toolbar if not grow-only (to get acceptable visual appearence). - Explicitly set visible_height for empty toolbar lines. - (redisplay_tool_bar): Handle `grow-only' setting. Check and clear - minimize_tool_bar_window_p flag. - - * window.c (Frecenter): Set minimize_tool_bar_window_p flag - when called without arg to redraw with minimum toolbar height. - Update doc string. - -2006-12-29 Jason Rumney <jasonr@gnu.org> - - * s/ms-w32.h (tzname): Do not define in msvc8. - (utime): Do not define in msvc8. - - * regex.c (regerror): Change parameter name err_code. - -2006-12-26 Richard Stallman <rms@gnu.org> - - * search.c (Fsearch_forward): Doc fix. - - * callint.c (Finteractive): Doc fix. - -2006-12-25 Kim F. Storm <storm@cua.dk> - - * s/ms-w32.h (BROKEN_DATAGRAM_SOCKETS): Define it. - -2006-12-23 Eli Zaretskii <eliz@gnu.org> - - * keyboard.c (some_mouse_moved): Fix last change. - -2006-12-22 Eli Zaretskii <eliz@gnu.org> - - * callproc.c (syms_of_callproc) <shell-file-name>: Doc fix. - -2006-12-22 Mark Davies <mark@mcs.vuw.ac.nz> - - * m/amdx86-64.h, m/hp800.h: Add support for NetBSD. - * m/sh3el.h: New file. - -2006-12-22 Eli Zaretskii <eliz@gnu.org> - - * makefile.w32-in (emacs, temacs): Depend on stamp_BLD instead of - $(BLD). - ($(OBJ0) $(OBJ1) $(WIN32OBJ)): New dependency on stamp_BLD. - (bootstrap-temacs): Pass $(XMFLAGS) to sub-make. - ($(OBJ0) $(OBJ1) $(WIN32OBJ)): Add lastfile.$(O) and firstfile.$(O). - (clean): Delete stamp_BLD. - -2006-12-22 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macfns.c (mac_update_title_bar) [TARGET_API_MAC_CARBON]: - Call mac_update_proxy_icon also when buffer modification flag changed. - [TARGET_API_MAC_CARBON] (mac_update_proxy_icon): Don't update alias, - but compare FSRef/FSSpec of resolved alias. - -2006-12-21 Kim F. Storm <storm@cua.dk> - - * w32.c (_sys_wait_accept): Fix handle leak. - -2006-12-20 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * sound.c: Include <alsa/asoundlib.h> if ALSA_SUBDIR_INCLUDE is - defined. - -2006-12-20 Kim F. Storm <storm@cua.dk> - - * s/ms-w32.h (BROKEN_NON_BLOCKING_CONNECT): Define it. - -2006-12-19 Juanma Barranquero <lekktu@gmail.com> - - * keyboard.c (syms_of_keyboard) <double-click-time>: - * mac.c (Fmac_code_convert_string): - * search.c (Fsearch_forward): Doc fixes. - -2006-12-19 Kim F. Storm <storm@cua.dk> - - Rework 2006-12-04 change. A SIGUSR1 (SIGUSR2) signal now generates - a sigusr1 event instead of [signal usr1] sequence, and signal events - are now supposed to be handled via special-event-map. - - * keyboard.c (kbd_buffer_store_event_hold): Undo 2006-12-04 change. - (make_lispy_event): Don't generate Qsignal prefix for code 0. - Abort if signal code is unknown. - (store_user_signal_events): Don't make Qsignal prefix (code 0). - (Qsignal): Move declaration back to process.c. - (syms_of_keyboard): Don't intern or staticpro it here. - - * process.c (Qsignal): Declare here. - (syms_of_process): Intern or staticpro it. - - * emacs.c (main): Rename user signals to sigusr1 and sigusr2. - - * .gdbinit: Pass on SIGUSR1 and SIGUSR2 to Emacs. - -2006-12-19 Juanma Barranquero <lekktu@gmail.com> - - * buffer.c (syms_of_buffer) <buffer-display-table>: - <scroll-up-aggressively, scroll-down-aggressively>: Doc fixes. - -2006-12-17 Richard Stallman <rms@gnu.org> - - * fileio.c (Fread_file_name_internal): Pass Vread_file_name_predicate - to Ffile_name_completion. - - * dired.c (file_name_completion): New arg PREDICATE. Some cleanup. - (Ffile_name_completion): New arg PREDICATE. - -2006-12-17 Juanma Barranquero <lekktu@gmail.com> - - * buffer.c (Fkill_buffer): Doc fix. - (syms_of_buffer) <kill-buffer-query-functions>: Doc fix. - -2006-12-16 Juanma Barranquero <lekktu@gmail.com> - - * minibuf.c (Ftry_completion): Check that obarray buckets are symbols. - -2006-12-16 Eli Zaretskii <eliz@gnu.org> - - * w32fns.c (w32-window-exists-p): New function. - (syms_of_w32fns): Defsubr it. - - * prefix-args.c [STDC_HEADERS]: Include stdlib.h. - -2006-12-16 Juanma Barranquero <lekktu@gmail.com> - - * minibuf.c (Ftry_completion): Use `check_obarray' if ALIST is a vector. - -2006-12-15 Eli Zaretskii <eliz@gnu.org> - - * emacs.c (USAGE3): Clarify documentation of --color. - -2006-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * mac.c (wakeup_from_rne_enabled_p) [TARGET_API_MAC_CARBON]: - New variable. - (ENABLE_WAKEUP_FROM_RNE, DISABLE_WAKEUP_FROM_RNE): New macros. - [!MAC_OSX] (select): Use them. - [MAC_OSX] (select_and_poll_event, sys_select): Likewise. - (mac_wakeup_from_rne) [TARGET_API_MAC_CARBON]: New function. - - * macfns.c (mac_atsu_font_face_attributes) [USE_ATSUI]: Add extern. - (Fmac_atsu_font_face_attributes) [USE_ATSUI]: New function. - (syms_of_macfns) [USE_ATSUI]: Defsubr it. - - * macselect.c [TARGET_API_MAC_CARBON] (mac_do_receive_drag): - Use mac_wakeup_from_rne instead of mac_post_mouse_moved_event. - - * macterm.c (mac_query_char_extents) [USE_ATSUI]: Don't call - ATSUGetGlyphBounds if not necessary. - (Vmac_atsu_font_table) [USE_ATSUI]: Remove variable. - (syms_of_macterm) [USE_ATSUI]: Don't defvar it. - (fm_get_style_from_font, atsu_find_font_from_family_name) - (atsu_find_font_family_name, mac_atsu_font_face_attributes) - [USE_ATSUI]: New functions. - (init_font_name_table) [USE_ATSUI]: Use atsu_find_font_family_name. - (mac_load_query_font) [USE_ATSUI]: Use atsu_find_font_from_family_name. - Don't get metrics for Latin-1 right half characters. - (mac_load_query_font): Don't load font if space width is not positive. - [TARGET_API_MAC_CARBON] (mac_store_event_ref_as_apple_event): - Use mac_wakeup_from_rne instead of mac_post_mouse_moved_event. - (XTread_socket): Call SelectWindow when unfocused frame is clicked. - - * macterm.h (mac_wakeup_from_rne) [TARGET_API_MAC_CARBON]: Add extern. - -2006-12-15 Kim F. Storm <storm@cua.dk> - - * keyboard.c (ignore_mouse_drag_p): New global var. - (some_mouse_moved): Return 0 if it is non-zero. - (make_lispy_event): Generate click event on mouse up if - ignore_mouse_drag_p is non-zero, even if mouse moved. - Clear ignore_mouse_drag_p on mouse down/up. - - * xdisp.c (redisplay_window): Set ignore_mouse_drag_p if tool-bar - is resized to avoid generating a mouse drag event. - -2006-12-14 Juanma Barranquero <lekktu@gmail.com> - - * w32fns.c (w32_wnd_proc): Force non-tooltip frames to respect the - minimum tracking size. Remove non-working old hack to do the same. - -2006-12-14 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * emacs.c (handle_user_signal): Move function to keyboard.c. - (main): Use add_user_signal for SIGUSR1 and SIGUSR2. - - * keyboard.c (make_lispy_event): Use find_user_signal_name. - (read_avail_input): Store pending user signal events. - (struct user_signal_info): New struct. - (user_signals): New variable. - (add_user_signal, store_user_signal_events) - (find_user_signal_name): New functions. - (handle_user_signal): Move function from emacs.c. Don't store - USER_SIGNAL_EVENT here, but increment number of pending signals. - - * keyboard.h (add_user_signals): Add extern. - -2006-12-11 Juanma Barranquero <lekktu@gmail.com> - - * buffer.c (syms_of_buffer) <cursor-in-non-selected-windows>: - <default-scroll-up-aggressively, default-scroll-down-aggressively>: - <line-spacing, left-margin>: Doc fixes. - - * xdisp.c (syms_of_xdisp) <mode-line-inverse-video>: Doc fix. - -2006-12-10 Kim F. Storm <storm@cua.dk> - - * xdisp.c (show_mouse_face): Never use text cursor in tool-bar. - -2006-12-10 Juanma Barranquero <lekktu@gmail.com> - - * abbrev.c (syms_of_abbrev) <last-abbrev-text>: - * buffer.c (syms_of_buffer) <default-major-mode>: - * keymap.c (Flookup_key): - * lread.c (Feval_buffer, Feval_region): - * macterm.c (syms_of_macterm) <x-use-underline-position-properties>: - <x-underline-at-descent-line, mac-emulate-three-button-mouse>: - * marker.c (Fmarker_insertion_type): - * minibuf.c (syms_of_minibuf) <minibuffer-completion-table>: - * msdos.c (syms_of_msdos) <delete-exited-processes>: - * w32term.c (syms_of_w32term) <x-use-underline-position-properties>: - <x-underline-at-descent-line>: - * xdisp.c (format-mode-line): - * xterm.c (syms_of_xterm) <x-use-underline-position-properties>: - <x-underline-at-descent-line>: Doc fixes. - -2006-12-10 Andreas Schwab <schwab@suse.de> - - * systime.h (EMACS_GET_TIME): Remove check for - HAVE_STRUCT_TIMEZONE which is never defined. - -2006-12-10 Alan Mackenzie <acm@muc.de> - - * syntax.c (Fpartial_parse_sexp): Correct Docco: Elt 8 of the - result is now neither the last elt nor optional for OLDSTATE. - -2006-12-09 Eli Zaretskii <eliz@gnu.org> - - * process.c (Fsignal_process): Doc fix. Use XFLOAT_DATA to - extract the process ID from a Lisp float. - -2006-12-09 Chong Yidong <cyd@stupidchicken.com> - - * xterm.c (XTframe_raise_lower): Comment out _NET_ACTIVE_WINDOW code. - -2006-12-08 Eli Zaretskii <eliz@gnu.org> - - * frame.h (PIX_TYPE): Redefine as `unsigned long', for 64-bit - platforms where long is 64-bit. - - * msdos.h (PIX_TYPE): Redefine as `unsigned long'. - -2006-12-08 NAKAJI Hiroyuki <nakaji@jp.freebsd.org> (tiny change) - - * m/amdx86-64.h: Add support for Solaris 10 on x86-64. - -2006-12-08 Kenichi Handa <handa@m17n.org> - - * xterm.c (x_query_font): Use xstricmp instead off strcasecmp. - -2006-12-08 Juanma Barranquero <lekktu@gmail.com> - - * emacs.c (syms_of_emacs) <system-type>: Doc fix. - -2006-12-07 Kim F. Storm <storm@cua.dk> - - * process.c (parse_signal): Use xstricmp instead of strcasecmp. - (Fsignal_process): Don't use strncasecmp. - -2006-12-05 Glenn Morris <rgm@gnu.org> - - * abbrev.c (Qforce): New Lisp_Object. - (Fdefine_abbrev): Do not overwrite non-system abbrevs with system - abbrevs, unless 'force is applied. - (syms_of_abbrev): Add Qforce. - -2006-12-04 Kim F. Storm <storm@cua.dk> - - * process.c (parse_signal): Rename macro from handle_signal. - (Fsignal_process): Also accept lower-case variants of signal - names (to align with signal names generated by Emacs itself). - - * emacs.c (handle_USR1_signal, handle_USR2_signal): Replace by... - (handle_user_signal): ... this, which generates two USER_SIGNAL_EVENTs - first with code == 0 [signal] and one with code == sig number. - (main): Use it as handler for SIGUR1 and SIGUSR2. - - * keyboard.c (kbd_buffer_store_event_hold): Don't throw-on-input - if first event in [signal xxx] sequence. - (lispy_user_signals, Qusr1_signal, Qusr2_signal): Remove. - (syms_of_keyboard): Don't intern and staticpro them. - (Qsignal): Declare here. - (syms_of_keyboard): Intern and staticpro it. - (make_lispy_event): Use it. Intern symbols on the fly for other - USER_SIGNAL_EVENTs events. - - * process.c (Qsignal): Declare extern. - (syms_of_process): Don't intern/staticpro it here. - - * process.c (read_process_output): Abort if carryover < 0. - -2006-12-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * config.in: Regenerate. - - * fileio.c [__NetBSD__]: Don't define `unix'. - (Funix_sync, syms_of_fileio): Use `#ifdef HAVE_SYNC' instead of - `#ifdef unix'. - -2006-12-04 Glenn Morris <rgm@gnu.org> - - * Makefile.in (version): New variable, set by configure. - (bootstrapclean, mostlyclean): Also remove emacs-${version}. - -2006-12-03 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (update_frame_tool_bar): Handle modifying a toolbar item - without an image. - -2006-12-01 Eli Zaretskii <eliz@gnu.org> - - * w32fns.c (Fw32_shell_execute): Doc fix. - -2006-11-30 Chong Yidong <cyd@stupidchicken.com> - - * xdisp.c (move_it_to): Correctly count tab glyphs for continued - lines ending in tab. - -2006-11-30 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.c (x_raise_frame): Move setting of _NET_ACTIVE_WINDOW - property ... - (XTframe_raise_lower): ... to here. - -2006-11-30 Kenichi Handa <handa@m17n.org> - - * regex.c (regex_compile): Fix previous change. - -2006-11-29 Juanma Barranquero <lekktu@gmail.com> - - * sound.c (Fplay_sound_internal): Remove spurious newline in docstring. - -2006-11-28 Chong Yidong <cyd@stupidchicken.com> - - * config.in: Regenerate. - -2006-11-28 Kenichi Handa <handa@m17n.org> - - * regex.c (regex_compile): Don't call SET_LIST_BIT with a - multibyte character. - -2006-11-27 Chong Yidong <cyd@stupidchicken.com> - - * s/aix4-2.h: Undefine _NO_PROTO. Suggested by Joe Buehler. - -2006-11-27 Kim F. Storm <storm@cua.dk> - - * window.c (set_window_buffer): Refactor recent changes. - -2006-11-27 Jason Rumney <jasonr@gnu.org> - - * w32term.c (w32_msg_worker): Declare correctly. - (w32_initialize): Don't cast w32_msg_worker. - - * w32fns.c (w32_msg_worker): Define as WINAPI and arg as void pointer. - -2006-11-26 Chong Yidong <cyd@stupidchicken.com> - - * m/amdx86-64.h: Look for standard libs in /usr/lib64 only if that - directory exists. - -2006-11-25 Eli Zaretskii <eliz@gnu.org> - - * w16select.c (Fw16_set_clipboard_data): Fix the call to sit_for - as per the calling sequence change on 2006-07-11. - -2006-11-25 Chong Yidong <cyd@stupidchicken.com> - - * window.c (set_window_buffer): Use BLOCK_INPUT. - -2006-11-24 Juanma Barranquero <lekktu@gmail.com> - - * fns.c (substring_both): Add missing address operator. - -2006-11-24 Stefan Monnier <monnier@iro.umontreal.ca> - - * fns.c: Use AREF/ASIZE macros. - (concat): Provide the full ANSI prototype. - -2006-11-24 Juanma Barranquero <lekktu@gmail.com> - - * buffer.c (syms_of_buffer) <buffer-undo-list>: Doc fix. - -2006-11-23 William Smith <William.Smith@global360.com> (tiny change) - - * strftime.c (HAVE_SYS__MBSTATE_T_H): Fix typo. - -2006-11-22 Alfred M. Szmidt <ams@gnu.org> (tiny change) - - * s/openbsd.h (LD_SWITCH_SYSTEM): Remove /usr/pkg/lib and - /usr/pkg/lib from the library search path. - (LD_SWITCH_X_DEFAULT): New macro. - -2006-11-22 Chong Yidong <cyd@stupidchicken.com> - - * window.c (set_window_buffer): Clear mouse highlight if it is in - this window. - -2006-11-21 Chong Yidong <cyd@stupidchicken.com> - - * xfaces.c (realize_default_face): Check if the default font name - exists on this display before trying to use it. - -2006-11-21 Richard Stallman <rms@gnu.org> - - * fileio.c: Break line before &&, not after. - -2006-11-20 Eli Zaretskii <eliz@gnu.org> - - * fns.c (concat) [!__GNUC__]: Add prototype. - -2006-11-20 Kenichi Handa <handa@m17n.org> - - * fileio.c (Fread_file_name_internal): Use SBYTES (not SCHARS) to - check the tailing slash of a filename. - -2006-11-20 KOBAYASHI Yasuhiro <kobayays@otsukakj.co.jp> (tiny change) - - * indent.c (Fvertical_motion): Include composition in the case of - overshoot expected. - -2006-11-19 Andreas Schwab <schwab@gnu.org> - - * xfaces.c (Fdisplay_supports_face_attributes_p): Initialize supports. - - * xmenu.c (Fx_popup_menu): Initialize selection. - -2006-11-18 Andreas Schwab <schwab@suse.de> - - * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Update call to mark_memory. - -2006-11-17 Tetsurou Okazaki <okazaki@be.to> (tiny change) - - * xterm.c (do_ewmh_fullscreen): Declare variable before XSETFRAME - to avoid gcc 2.96 error. - -2006-11-17 NIIMI Satoshi <sa2c@sa2c.net> (tiny change) - - * search.c (simple_search): In the loop of backward searching, - check also the byte position against the limit. - -2006-11-14 Romain Francoise <romain@orebokech.com> - - * minibuf.c (Fcompleting_read): Fix typo in docstring. - -2006-11-14 Kenichi Handa <handa@m17n.org> - - * coding.c (code_convert_region): Initialize coding->heading_ascii. - (decode_coding_string, code_convert_region): Likewise. - -2006-11-14 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * config.in: Regenerate. - - * macfns.c (Fx_display_mm_height, Fx_display_mm_width) - [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 - && MAC_OS_X_VERSION_MIN_REQUIRED == 1020]: Check if - CGDisplayScreenSize is available. - - * macmenu.c (menu_quit_handler, install_menu_quit_handler): - Replace `#ifdef HAVE_CANCELMENUTRACKING' with - `#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030'. - (install_menu_quit_handler) [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 - && MAC_OS_X_VERSION_MIN_REQUIRED == 1020]: Check if - CancelMenuTracking is available. - - * macterm.c [USE_CG_TEXT_DRAWING] (mac_draw_image_string_cg) - [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 - && MAC_OS_X_VERSION_MIN_REQUIRED == 1020]: Check if - CGContextShowGlyphsWithAdvances is available. - -2006-11-13 Jason Rumney <jasonr@gnu.org> - - * s/ms-w32.h: Define HAVE_INET_SOCKETS. - -2006-11-13 Nozomu Ando <nand@mac.com> - - * alloc.c (mark_memory): New argument OFFSET. All uses changed. - Fix address calculations for case END < START. - (mark_stack): Impose Lisp_Object alignment on jmp_buf. - -2006-11-12 Juanma Barranquero <lekktu@gmail.com> - - * coding.c (Fencode_sjis_char, Fencode_big5_char): - Improve argument/docstring consistency. - - * editfns.c (Fmessage): Doc fixes. - - * process.c (syms_of_process) <delete-exited-processes>: Doc fix. - -2006-11-12 Chong Yidong <cyd@stupidchicken.com> - - * xmenu.c (popup_activated): Define outside HAVE_MENUS. - -2006-11-12 Romain Francoise <romain@orebokech.com> - - * xselect.c (selection-coding-system): Fix docstring. - -2006-11-12 Juanma Barranquero <lekktu@gmail.com> - - * category.c (Fchar_category_set): Improve arg/docstring consistency. - - * data.c (Flogxor): - * fns.c (Frandom, Flength, Fsafe_length, Fstring_bytes) - (Fstring_equal, Fcompare_strings, Fstring_lessp, Fcopy_sequence) - (Fstring_make_unibyte): Fix typos in docstrings. - -2006-11-10 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.h (struct x_display_info): Fix indentation. - - * xterm.c (do_ewmh_fullscreen, XTfullscreen_hook): New functions. - (x_check_fullscreen): Call do_ewmh_fullscreen. - (x_initialize): Set fullscreen_hook to XTfullscreen_hook. - - * frame.c (x_set_fullscreen): Call fullscreen_hook if set. - - * term.c: Define fullscreen_hook. - (syms_of_term): Initialize fullscreen_hook to NULL. - - * termhooks.h: Add fullscreen_hook. - -2006-11-08 Juanma Barranquero <lekktu@gmail.com> - - * bytecode.c (Fbyte_code): - * data.c (Fmakunbound): Use SYMBOL_CONSTANT_P macro. - -2006-11-06 Juanma Barranquero <lekktu@gmail.com> - - * lread.c (syms_of_lread): - * xsmfns.c (syms_of_xsmfns): Fix typo in docstring. - -2006-11-06 Martin Rudalics <rudalics@gmx.at> - - * macmenu.c (Fmenu_or_popup_active_p): Define outside HAVE_MENUS. - - * w32menu.c (Fmenu_or_popup_active_p): Define outside HAVE_MENUS. - Return nil if building without menus. - - * xmenu.c (Fmenu_or_popup_active_p): Define outside HAVE_MENUS. - Return nil if building without menus. - -2006-11-05 Mark Davies <mark@mcs.vuw.ac.nz> (tiny change) - - * s/netbsd.h (POSIX_SIGNALS): Define. - -2006-11-05 Martin Rudalics <rudalics@gmx.at> - - * macmenu.c (Fmenu_or_popup_active_p): New function. - (syms_of_macmenu): Defsubr it. - - * w32menu.c (Fmenu_or_popup_active_p): New function. - (syms_of_w32menu): Defsubr it. - (popup_activated_flag, popup_activated): Remove. - - * xdisp.c (note_mouse_highlight) [HAVE_NTGUI]: Don't bother to - check popup_activated. - - * xmenu.c (Fmenu_or_popup_active_p): New function. - (syms_of_xmenu): Defsubr it. - -2006-11-05 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * unexmacosx.c (malloc_cookie): Remove unused variable. - (region_list_head, region_list_tail, lca, nlc, infile_lc_highest_addr) - (text_seg_lowest_offset, mh, curr_header_offset, infd, outfd) - (emacs_zone, data_segment_old_fileoff, data_segment_scp) - (num_unexec_regions, unexec_regions): Make variables static. - (print_regions, find_emacs_zone_regions): Make static. - (unexec_region_info): New typedef. - (unexec_regions): Change type from vm_range_t[] to unexec_region_info[]. - All uses changed. - (unexec_regions_recorder): Subtract size of trailing null pages from - filesize. Show filesize. - (unexec_regions_merge): Don't merge if null pages of preceding region - is not too small. Use long format in printf. - (copy_segment, copy_data_segment): Show filesize. - (copy_data_segment): Write filesize bytes of region data. - Adjust filesize in segment command accordingly. - (dump_it): Use long format in printf. - -2006-11-05 Juanma Barranquero <lekktu@gmail.com> - - * dosfns.c (Finsert_startup_screen): - * fns.c (Ffeaturep, syms_of_fns): - * frame.c (syms_of_frame): Fix typos in docstrings. - - * unexcw.c (unexec): Fix typo in output message. - -2006-11-04 Ralf Angeli <angeli@caeruleus.net> - - * w32fns.c (w32_createwindow): Remove code for handling -geometry - command line option and `initial-frame-alist' which is superfluous - after the last change to `w32_createwindow'. - -2006-11-04 Slawomir Nowaczyk <slawek@cs.lth.se> (tiny change) - - * w32proc.c (sys_wait): Only wait for processes with fd<0. - Others should be handled by sys_select instead. Fixes problems - with (progn (start-process "" nil "ls") (call-process "ls")). - -2006-11-04 Giorgos Keramidas <keramida@ceid.upatras.gr> (tiny change) - - * xmenu.c (Fmenu_bar_open): Declare variable before BLOCK_INPUT to - avoid gcc 2.95 error. - -2006-11-04 Chong Yidong <cyd@stupidchicken.com> - - * gtkutil.c (update_frame_tool_bar): If icon image is invalid and - wicon is null, insert an empty button. - -2006-11-03 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.c (x_raise_frame): Send _NET_ACTIVE_WINDOW when raising the - window. - -2006-11-02 Juanma Barranquero <lekktu@gmail.com> - - * emacs.c (Fkill_emacs): Fix typo in docstring. - -2006-11-02 Nozomu Ando <nand@mac.com> - - * unexmacosx.c (mach_header, segment_command, vm_region, section) - [_LP64]: New defines. - (VM_REGION_BASIC_INFO_COUNT, VM_REGION_BASIC_INFO, LC_SEGMENT) - (MH_MAGIC) [_LP64]: Redefine. - (delta): Remove variable. - (curr_file_offset, pagesize): New variables. - (ROUNDUP_TO_PAGE_BOUNDARY): New macro. - (data_segment_old_fileoff): Initialize explicitly. - (print_region, unexec_regions_recorder, print_load_command_name) - (copy_segment, copy_data_segment): Use long format in printf. - (MAX_UNEXEC_REGIONS): Increase to 400. - (unexec_regions_recorder): Don't warn too many regions here. - (find_emacs_zone_regions): Warn too many regions here. - (print_load_command_name) [_LP64]: Show correct load command name. - (copy_segment, copy_data_segment): Use variable `curr_file_offset'. - Show starting virtual memory address. Don't show ending file offset. - (copy_symtab, copy_dysymtab, copy_twolevelhints): New argument DELTA. - (dump_it): Use new local variable `linkedit_delta' and pass to them. - Error if trying to handle multiple DATA segments. - (unexec): Initialize variable `pagesize'. - -2006-11-01 Juanma Barranquero <lekktu@gmail.com> - - * eval.c (Fcatch): Doc fix. - -2006-10-31 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * image.c [MAC_OS] (image_load_qt_1, xpm_scan, xpm_make_color_table_v) - (xpm_put_color_table_v, xpm_get_color_table_v, xpm_make_color_table_h) - (xpm_put_color_table_h, xpm_get_color_table_h, xpm_str_to_color_key) - (xpm_load_image): Add const qualifier to arguments. - [MAC_OS] (xpm_color_key_strings): Make static const. - - * mac.c (create_apple_event_from_event_ref) - (create_apple_event_from_drag_ref, skip_white_space, parse_comment) - (parse_include_file, parse_binding, parse_component) - (parse_resource_name, parse_value, parse_resource_line) - (xrm_merge_string_database, xrm_get_resource) - (xrm_get_preference_database): Add const qualifier to arguments. - [MAC_OSX] (sys_select): Make variable `context' static const. - - * macfns.c (mac_color_map): Make static const. - (mac_color_map_lookup): Add const qualifier to arguments. - - * macmenu.c (install_menu_quit_handler): Make variable `typesList' - static const. - (name_is_separator): Add const qualifier to arguments. - - * macselect.c (init_service_handler): Make variable `specs' static - const. - - * macterm.c (mac_create_bitmap_from_bitmap_data): Make variable - `swap_nibbles' static const. - (atsu_get_text_layout_with_text_ptr): Make variables `lengths', - `tags', `sizes', `values' static const. - (mac_draw_string_common): Make variables `context' static. - Make variables `tags', `sizes', and `values' static const. - (pcm_get_status, x_detect_focus_change, x_scroll_bar_handle_click) - (xlfdpat_create, xlfdpat_block_match_1, xlfdpat_match) - (mac_to_x_fontname, parse_x_font_name, add_mac_font_name) - (mac_do_list_fonts, is_fully_specified_xlfd, do_grow_window) - (mac_store_event_ref_as_apple_event, mac_make_rdb): Add const - qualifier to arguments. - (xlfd_scalable_fields, keycode_to_xkeysym_table) - (fn_keycode_to_keycode_table): Make static const. - (mac_load_query_font): Make variables `tags', `sizes', `values', - `types', and `selectors' static const. - (mac_handle_command_event, mac_handle_window_event): - Make variables `names' and `types' static const. - (init_command_handler, install_window_handler): Make variables - `specs*' static const. - (mac_handle_font_event, mac_handle_text_input_event) - (mac_store_service_event): Make variables `names' and `types' - const. Make variables `names_*' and `types_*' static const. - - * macterm.h (create_apple_event_from_event_ref) - (create_apple_event_from_drag_ref, xrm_merge_string_database) - (xrm_get_resource, xrm_get_preference_database): Add const - qualifier to arguments in externs. - -2006-10-31 Kenichi Handa <handa@m17n.org> - - * xfns.c (xic_create_xfontset): Fix previous change. - -2006-10-30 Chong Yidong <cyd@stupidchicken.com> - - * s/openbsd.h (LD_SWITCH_SYSTEM): Add /usr/pkg/lib and - /usr/pkg/lib to library search path. - -2006-10-29 Mark Davies <mark@mcs.vuw.ac.nz> (tiny change) - - * ralloc.c (relinquish): Use a long for excess space counter to - handle 64-bit case correctly. - -2006-10-29 Jeramey Crawford <jeramey@jeramey.com> - - * m/amdx86-64.h: Add defines for OpenBSD x86-64. - -2006-10-29 Juanma Barranquero <lekktu@gmail.com> - - * window.c (Fdisplay_buffer): Fix typo in docstring. - -2006-10-27 Ben North <ben@redfrontdoor.org> (tiny change) - - * w32term.c (x_draw_glyph_string_foreground): Set background mode - to TRANSPARENT before using overstrike to simulate bold faces. - - * xfaces.c (best_matching_font): Fix logic to decide whether to - use overstriking to simulate bold-face (it was reversed). - -2006-10-23 Kim F. Storm <storm@cua.dk> - - * xdisp.c (remember_mouse_glyph): Do nothing if glyphs are not - initialized. - - * keyboard.c (read_char): Make an element (t . EVENT) in - unread-command-events add EVENT to the current command's key sequence. - (syms_of_keyboard) <unread-command-events>: Update doc. - -2006-10-21 Richard Stallman <rms@gnu.org> - - * minibuf.c (Vread_expression_map): Define here. - (Qread_expression_history): New variable. - (syms_of_minibuf): Initialize them. - (Feval_minibuffer): Use Vread_expression_map and - Qread_expression_history. - -2006-10-21 Kenichi Handa <handa@m17n.org> - - * xfns.c (xic_create_fontsetname): If ADSTYLE field is not a wild - card, change it to "*". - (xic_create_xfontset): Call XCreateFontSet for each single - fontname in fontsetname. - -2006-10-19 Chong Yidong <cyd@stupidchicken.com> - - * callint.c (callint_message): Convert to a Lisp string. - (syms_of_callint): Initialize it. - (callint_message_size): Var deleted. - (Fcall_interactively): Use Fformat instead of doprnt to construct - prompt string. - -2006-10-19 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * xdisp.c (display_mode_line): Clear enabled_p flag on mode-line row. - -2006-10-19 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macfns.c (Vmac_carbon_version_string) [TARGET_API_MAC_CARBON]: - New variable. - (syms_of_macfns) [TARGET_API_MAC_CARBON]: Defvar it. - -2006-10-19 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xselect.c (x_handle_selection_request): If the converted_selection - is nil or XCDR (converted_selection) is nil, decline the request. - -2006-10-16 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (get_utf8_string): Remove warnings with casts. - (xg_tool_bar_button_cb): Ditto. - (xg_tool_bar_callback): Ditto. - -2006-10-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * dispnew.c (adjust_frame_glyphs_for_frame_redisplay): Remove unused - variable ch_dim. - (adjust_frame_glyphs_for_window_redisplay): Likewise. Don't allocate - menu bar window matrices on non-X systems. - - * mac.c (Fmac_get_preference, Fmac_code_convert_string): Add GCPROs. - - * macterm.c (mac_query_char_extents): Don't return glyph ID if layout - adjustment is needed. - (mac_load_query_font): Check if width and height are positive. - -2006-10-14 Richard Stallman <rms@gnu.org> - - * sysdep.c (init_sys_modes): Delete DEFVAR_LISP in the wrong place. - -2006-10-13 Chong Yidong <cyd@stupidchicken.com> - - * xdisp.c (decode_mode_spec): Ignore %c and %l constructs in frame - title. - -2006-10-12 Chong Yidong <cyd@stupidchicken.com> - - * keymap.c (Fkey_binding): Check Lisp_Object types before doing - XCAR and XINT. - -2006-10-12 Romain Francoise <romain@orebokech.com> - - * image.c (xbm_read_bitmap_data): Delete extra semicolon. - -2006-10-10 Stefan Monnier <monnier@iro.umontreal.ca> - - * eval.c: Include xterm.h for x_fully_uncatch_errors and friends. - - * dispextern.h: Declare x_create_bitmap_from_xpm_data. - - * xterm.c (x_check_expected_move): Remove unused var `count'. - - * xmenu.c (syms_of_xmenu): Use Ffset rather than Fdefalias, since - Fdefalias is not declared in any *.h file. - -2006-10-09 Chong Yidong <cyd@stupidchicken.com> - - * dispnew.c (sit_for): Sit forever if TIMEOUT is t. - - * keyboard.c (command_loop_1): Handle non-number values of - `minibuffer-message-timeout'. - (Fexecute_extended_command): Fix typo. - - * minibuf.c (temp_echo_area_glyphs): Sit for - `minibuffer-message-timeout' seconds. - -2006-10-08 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macterm.c (mac_draw_image_string, mac_draw_image_string_16): - Add argument OVERSTRIKE_P. - (mac_draw_string_common, mac_draw_image_string_cg): Likewise. - Support overstrike. - (mac_draw_string, mac_draw_string_16): Remove functions. - (x_draw_glyph_string_foreground): Use overstrike when needed. - (x_draw_composite_glyph_string_foreground): Likewise. - Use mac_draw_image_string_16 instead of mac_draw_string_16. - (mac_load_query_font): Rename from XLoadQueryFont. Take argument - F instead of DPY. All uses changed. Don't save/restore font. - -2006-10-07 Ralf Angeli <angeli@caeruleus.net> - - * w32fns.c (w32_createwindow): Honour left and top positions if - supplied explicitly. - -2006-10-06 Kim F. Storm <storm@cua.dk> - - * xdisp.c (pos_visible_p): Fix value when EOB is visible. - -2006-10-05 Chong Yidong <cyd@stupidchicken.com> - - * frame.c (Qinhibit_face_set_after_frame_default): New var. - (syms_of_frame): Initialize it. - (x_set_frame_parameters): Avoid resetting :font attributes to the - new-frame defaults. - -2006-10-03 Stefan Monnier <monnier@iro.umontreal.ca> - - * lisp.h (clear_regexp_cache): Declare. - - * search.c (compile_pattern): Only check `cp->syntax_table' if needed. - (compile_pattern_1): Remember `used_syntax' in `cp->syntax_table'. - (clear_regexp_cache): Only flush those regexps which depend on - a syntax-table. - - * regex.c (regex_compile): Set the new `used_syntax' bit. - - * regex.h: Remove file local variables. - (struct re_pattern_buffer): New field `used_syntax'. - -2006-10-03 Kim F. Storm <storm@cua.dk> - - * process.c (list_processes_1): Run sentinels before removing dead - processes. Also remove `closed' network connections. - -2006-10-01 Stefan Monnier <monnier@iro.umontreal.ca> - - * xdisp.c (handle_fontified_prop): Don't fontify at EOB. - -2006-09-30 Eli Zaretskii <eliz@gnu.org> - - * config.in: Regenerated. - -2006-09-29 Juri Linkov <juri@jurta.org> - - * buffer.c (syms_of_buffer): Reorder coding systems in the - docstring of %z to the real order displayed in the modeline. - -2006-09-28 Stefan Monnier <monnier@iro.umontreal.ca> - - * keymap.c (Fdefine_key): Yet another int/Lisp_Object mixup (YAILOM). - -2006-09-26 Chong Yidong <cyd@stupidchicken.com> - - * indent.c (Fvertical_motion): Do move back if the Lisp string - being displayed contains newlines. - -2006-09-26 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macterm.c (mac_compute_glyph_string_overhangs, XLoadQueryFont) - [USE_CG_DRAWING]: Call mac_prepare_for_quickdraw before QDTextBounds. - -2006-09-26 Kenichi Handa <handa@m17n.org> - - * keymap.c (Fsingle_key_description): For an invalid char, return - "Invalid char code NNNNN". - -2006-09-25 Chong Yidong <cyd@stupidchicken.com> - - * callint.c (Fcall_interactively): Doc fix. - -2006-09-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macterm.c (x_underline_at_descent_line): New variable. - (syms_of_macterm): DEFVAR_BOOL it. - (x_draw_glyph_string): Use it. - (XLoadQueryFont): Calculate min_bounds.descent and max_bounds.descent. - -2006-09-25 Kenichi Handa <handa@m17n.org> - - * keymap.c (Fsingle_key_description): Return unique names for - generic characters. - -2006-09-24 Richard Stallman <rms@gnu.org> - - * search.c (compile_pattern_1): Don't BLOCK_INPUT. - -2006-09-24 Eli Zaretskii <eliz@gnu.org> - - * makefile.w32-in ($(BLD)/fns.$(O), $(BLD)/w32proc.$(O)): - Depend on nt/inc/langinfo.h and nt/inc/nl_types.h. - - * w32proc.c (nl_langinfo): New function. - - * w32fns.c (w32-pass-alt-to-system, w32-alt-is-meta) - (w32-pass-lwindow-to-system, w32-enable-num-lock) - (w32-enable-caps-lock, w32-scroll-lock-modifier) - (w32-lwindow-modifier, w32-rwindow-modifier) - (w32-apps-modifier, w32-mouse-button-tolerance): Doc fix. - -2006-09-23 Juanma Barranquero <lekktu@gmail.com> - - * minibuf.c (Finternal_complete_buffer, Fread_minibuffer) - (Fdisplay_completion_list): Fix typos in docstrings. - -2006-09-23 Romain Francoise <romain@orebokech.com> - - * s/gnu-linux.h (MAIL_USE_FLOCK): Check for HAVE_LIBLOCKFILE too. - -2006-09-23 Kenichi Handa <handa@m17n.org> - - * keymap.c (Fmap_keymap): Docstring mentions about generic character. - -2006-09-22 Stefan Monnier <monnier@iro.umontreal.ca> - - * regex.c (analyse_first): For eight-bit-control chars, mark both the - char's value and its leading byte in the fastmap. - (re_search_2): When fast-scanning without translation, be careful to - check that we only match the leading byte of a multibyte char. - - * charset.h (PREV_CHAR_BOUNDARY): Make it work from within a char's - byte sequence. - (AT_CHAR_BOUNDARY): New macro. - -2006-09-22 Kenichi Handa <handa@m17n.org> - - * fns.c (optimize_sub_char_table): Don't optimize a sub-char-table - whose default value is non-nil. - -2006-09-22 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (xg_get_file_with_chooser): Only show C-l help for - Gtk+ versions < 2.10. - - * xfns.c (syms_of_xfns): Fix typo in help text for - x-gtk-file-dialog-help-text. - -2006-09-21 Kim F. Storm <storm@cua.dk> - - * fns.c (Fmemq): Refill doc string. - (Fmemql): New defun, like memq but using eql. - (syms_of_fns): Defsubr it. - -2006-09-20 Kim F. Storm <storm@cua.dk> - - * xdisp.c (pos_visible_p): CHARPOS < 0 means return info for - last visible glyph in window. - - * window.c (Fset_window_hscroll, Fwindow_line_height): - Doc fix. Use "off-window" instead of "off-screen". - (Fpos_visible_in_window_p): Likewise. - If POS is t, return info for last visible glyph in window. - -2006-09-19 Chong Yidong <cyd@stupidchicken.com> - - * search.c (struct regexp_cache): New entry syntax_table. - (compile_pattern_1): Set it. - (syms_of_search): Initialize it. - (compile_pattern): Require the syntax_table entry of the cache - element to match the current syntax table entry. - -2006-09-19 Stefan Monnier <monnier@iro.umontreal.ca> - - * window.c (Fwindow_end): Fix recent change. - -2006-09-19 Kim F. Storm <storm@cua.dk> - - * window.c (Fset_window_hscroll, Fpos_visible_in_window_p): - Doc fix. Use "off-screen" instead of "invisible". - (Fwindow_line_height): Make line numbers 0-based. Make line arg - optional; if nil, use current cursor row. Handle text terminals - properly. Return nil if non-interactive or pseudo-window. - -2006-09-19 Stefan Monnier <monnier@iro.umontreal.ca> - - * keymap.c: Include alloca.h if available. - (Fkey_binding): Only use AREF after checking it's a vector. - Remove unused var `window'. - -2006-09-19 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * emacs.c (shut_down_emacs) [!subprocesses]: Don't set - inhibit_sentinels. - - * mac.c [!MAC_OSX] (select): Fix argument name. - - * macmenu.c (enum mac_menu_kind, min_menu_id): New enumerator and - menu ID for Apple menu. - (menubar_selection_callback): Remove function. - (find_and_call_menu_selection): New function from xmenu.c. - (x_activate_menubar): Use it. - (set_frame_menubar): Don't use f->output_data.mac->menubar_active. - - * macterm.c (menubar_selection_callback): Remove extern. - (M_APPLE): Change to 234. - (do_apple_menu) [!TARGET_API_MAC_CARBON]: Make non-static. - (do_menu_choice): Remove function. - - * macterm.h (struct mac_output): Remove member menubar_active. - (do_menu_choice): Remove extern. - (do_apple_menu) [!TARGET_API_MAC_CARBON]: Add extern. - -2006-09-18 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xfns.c (syms_of_xfns): Rename x_gtk_show_chooser_help_text to - x_gtk_file_dialog_help_text. - - * gtkutil.c (xg_uses_old_file_dialog): Rename x-use-old-gtk-file-dialog - to x-gtk-use-old-file-dialog. - (xg_get_file_with_chooser): Rename x_gtk_show_chooser_help_text to - x_gtk_file_dialog_help_text. - - * xfns.c (syms_of_xfns): Ditto. - -2006-09-18 Kim F. Storm <storm@cua.dk> - - * window.c (Fwindow_line_visibility): Remove. - (Fwindow_line_height): New defun replacing it. - (syms_of_window): Defsubr it. - -2006-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * mac.c (SELECT_USE_CFSOCKET) [MAC_OSX]: Set default to 1. - [MAC_OSX] (sys_select) [SELECT_USE_CFSOCKET]: Fix pointer type. - -2006-09-17 Jay Belanger <belanger@truman.edu> - - * gmalloc.c: - * md5.c: - * md5.h: - * strftime.c: Replace "GNU Library General Public License" by "GNU - General Public License" throughout. - -2006-09-17 Kim F. Storm <storm@cua.dk> - - * dispnew.c (update_text_area): Undo 2000-07-18 change. - Always redrawing whole row if line has mouse-face in it causes - excessive flickering of the mode line. - -2006-09-17 Chong Yidong <cyd@stupidchicken.com> - - * search.c (clear_regexp_cache): New function. - - * syntax.c (Fmodify_syntax_entry): Clear regexp cache. - -2006-09-16 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (xg_get_file_with_chooser): - Check x-gtk-show-chooser-help-text before adding the help text. - - * xfns.c (syms_of_xfns): New variable: x-gtk-show-chooser-help-text. - - * gtkutil.c (get_utf8_string): Try harder to convert to UTF8. Gtk+ - will simply crash if we fail. - -2006-09-16 Richard Stallman <rms@gnu.org> - - * regex.c (re_compile_pattern): Set gl_state.current_syntax_table. - -2006-09-15 Kim F. Storm <storm@cua.dk> - - * window.c (Fwindow_line_visibility): New defun for line-move-partial. - (syms_of_window): Defsubr it. - (Fwindow_end): Use window's buffer rather than current buffer. - -2006-09-15 Jay Belanger <belanger@truman.edu> - - * COPYING: Replace "Library Public License" by "Lesser Public - License" throughout. - -2006-09-15 David Kastrup <dak@gnu.org> - - * Makefile.in (keymap.o): Add "keymap.h" and "window.h" dependencies. - - * keymap.c: include "window.h". - (Fcommand_remapping): New optional POSITION argument. - (Fkey_binding): New optional POSITION argument. Completely rework - handling of mouse clicks to get the same order of keymaps as - `read-key-sequence' and heed POSITION. Also temporarily switch - buffers to location of mouse click and back. - - * keyboard.c (command_loop_1): Adjust call of `Fcommand_remapping' - for additional argument. - (parse_menu_item): Adjust call of `Fkey_binding' for additional - argument. - (read_key_sequence): If there are both `local-map' and `keymap' - text properties at some buffer position, heed both. - - * keymap.h: Declare additional optional arguments of - `Fcommand_remapping' and `Fkey_binding'. - -2006-09-15 Juanma Barranquero <lekktu@gmail.com> - - * indent.c (Fcurrent_column, Findent_to): Fix typos in docstring. - -2006-09-14 Andreas Schwab <schwab@suse.de> - - * print.c: Whitespace fixup. - -2006-09-14 Kim F. Storm <storm@cua.dk> - - * xdisp.c (produce_image_glyph): Automatically crop wide images at - right window edge so we can draw the cursor on the same row to - avoid confusing redisplay by placing the cursor outside the visible - window area. - -2006-09-13 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * xterm.c (x_initialize): Don't install Xt event timer here. - (x_timeout_atimer_activated_flag): New var. - (x_activate_timeout_atimer): New function to install Xt timer. - (x_send_scroll_bar_event, x_process_timeouts): Use it. - - * xmenu.c (x_menu_set_in_use, popup_activate_callback) - (create_and_show_popup_menu, create_and_show_dialog): Use it. - - * xterm.h (x_activate_timeout_atimer): Add prototype. - -2006-09-13 Richard Stallman <rms@gnu.org> - - * print.c (print_string): When printcharfun is t, - copy string contents and call strout on the copy. - - * keyboard.c (read_char): If end_time specified, don't put the - event into this_command_keys. - (read_key_sequence): If Voverriding_terminal_local_map is specified, - don't check Voverriding_local_map at all. - -2006-09-12 Stefan Monnier <monnier@iro.umontreal.ca> - - * textprop.c (Fnext_property_change, Fnext_single_property_change) - (Fprevious_property_change, Fprevious_single_property_change): - Avoid changing limit, so we can correctly catch the case where the - property is constant up to limit. - -2006-09-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macfns.c (mac_window) [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]: - * macterm.c (XTread_socket) [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]: - Undo 2006-09-08 change. - -2006-09-11 Chong Yidong <cyd@stupidchicken.com> - - * keymap.c (Fkey_binding): Use string position for string objects. - -2006-09-11 Kim F. Storm <storm@cua.dk> - - * keymap.c (Fkey_binding): Fix last change. - - * editfns.c (Fmessage): Recommend using (message "%s" ...). - -2006-09-10 Chong Yidong <cyd@stupidchicken.com> - - * keymap.c (Fkey_binding): Check for local keymap for mouse click - events. - -2006-09-10 Kim F. Storm <storm@cua.dk> - - * keyboard.c (Finput_pending_p): Check Vunread_input_method_events - and Vunread_post_input_method_events. - - * dispnew.c (Fredisplay): Document return value. - -2006-09-10 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xfns.c (Fx_close_connection): Call xg_display_close when USE_GTK. - - * gtkutil.c (xg_display_close): Always change default display if needed, - check for < Gtk+ version 2.10 before calling gdk_display_close. - -2006-09-10 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * mac.c [MAC_OSX] (sys_select): Check argument `nfds' more rigidly. - Make variable `ofds' static. Remove variable `maxfd'. - - * macfns.c (Fx_file_dialog): Remove unused variable `f'. - Call check_mac. - - * macmenu.c (Vmenu_updating_frame, syms_of_macmenu): - * w32menu.c (Vmenu_updating_frame, syms_of_w32menu): - Apply 2006-09-08 change for xmenu.c. - - * xfns.c (Fx_file_dialog): Call check_x. - -2006-09-10 Kim F. Storm <storm@cua.dk> - - * xdisp.c (get_window_cursor_type): Use hollow cursor on - non-transparent images. - -2006-09-09 Eli Zaretskii <eliz@gnu.org> - - * editfns.c (Fsystem_name): Mention "host" in the doc string. - (syms_of_editfns) <system-name>: Likewise. - -2006-09-08 Martin Rudalics <rudalics@gmx.at> - - * xdisp.c (mouse_autoselect_window): Remove. - (Vmouse_autoselect_window): New variable. DEFVAR_LISP it. - - * dispextern.h (mouse_autoselect_window): Remove extern. - (Vmouse_autoselect_window): Add extern. - - * macterm.c (XTread_socket): Test Vmouse_autoselect_window - instead of mouse_autoselect_window. - - * msdos.c (dos_rawgetc): Likewise. - - * w32term.c (w32_read_socket): Likewise. - - * xterm.c (handle_one_xevent): Likewise. - -2006-09-08 Richard Stallman <rms@gnu.org> - - * xdisp.c (Vmenu_updating_frame): Define here. - (syms_of_xdisp): DEFVAR it here. - (update_menu_bar): Always return hooks_run. - Set Vmenu_updating_frame. - - * xdisp.c (redisplay_internal): Test Vinhibit_redisplay - before calculating SELECTED_FRAME. - - * xmenu.c (Vmenu_updating_frame): Don't define here. - (syms_of_xmenu): Don't DEFVAR it here. - - * xterm.c (x_error_quitter): For BadName error, just return. - - * eval.c (find_handler_clause): Give up on debugger if INPUT_BLOCKED_P. - - * casetab.c (init_casetab_once): Call set_case_table. - - * emacs.c (shut_down_emacs): Set inhibit_sentinels. - - * process.c (inhibit_sentinels): New variable. - (exec_sentinel): Test inhibit_sentinels. - (init_process): Initialize it. - - * process.h (inhibit_sentinels): Add decl. - - * search.c (looking_at_1, string_match_1, search_command): - Make syntax table's canon table point to eqv table. - -2006-09-08 Andreas Schwab <schwab@suse.de> - - * print.c (strout): Fix whitespace. - -2006-09-08 Kim F. Storm <storm@cua.dk> - - * xterm.c (x_draw_glyph_string): Fix 2006-08-24 change. - -2006-09-08 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * mac.c [!MAC_OSX]: Don't include keyboard.h. - [!MAC_OSX] (select): Try detect_input_pending before ReceiveNextEvent - in the same BLOCK_INPUT block, in case that some input has already - been read asynchronously. Pretend to be interrupted by a signal - if some input is available. - [MAC_OSX] (select_and_poll_event, sys_select): Likewise. - (SELECT_POLLING_PERIOD_USEC) [SELECT_USE_CFSOCKET]: Change to 100000. - Now used for ReceiveNextEvent timeout instead of select timeout. - (EVENT_CLASS_SOCK) [SELECT_USE_CFSOCKET]: Remove macro. - [SELECT_USE_CFSOCKET] (socket_callback): Add non-blocking connect - support. Quit event loop. - [MAC_OSX] (sys_select) [SELECT_USE_CFSOCKET]: Add non-blocking - connect support. Reuse previously allocated CFRunLoopSource. - (Fmac_process_hi_command) [TARGET_API_MAC_CARBON]: New function. - (syms_of_mac) [TARGET_API_MAC_CARBON]: Defsubr it. - - * macfns.c (mac_window) [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]: - Specify kWindowAsyncDragAttribute. - - * macterm.c (mac_handle_origin_change, mac_handle_size_change) - (mac_get_ideal_size): New functions. - (x_set_offset, x_set_window_size, x_make_frame_visible) - (do_zoom_window, mac_handle_window_event, XTread_socket): Use them. - (install_window_handler, mac_handle_window_event) - [USE_CARBON_EVENTS]: Handle kEventWindowGetIdealSize and - kEventWindowBoundsChanged. - (XTread_socket) [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]: Don't call - DragWindow. - -2006-09-07 Andreas Schwab <schwab@suse.de> - - * m/ibms390x.h (START_FILES, LIB_STANDARD): Override to - use lib64 instead of lib. - -2006-09-06 Stefan Monnier <monnier@iro.umontreal.ca> - - * Makefile.in: Avoid double quotes when possible. - -2006-09-06 Kenichi Handa <handa@m17n.org> - - * editfns.c (Fformat_time_string): Use make_unibyte_string to make - a Lisp string from the result of emacs_memftimeu call. - -2006-09-06 Kim F. Storm <storm@cua.dk> - - * xdisp.c (pos_visible_p): Remove exact_mode_line_heights_p arg; - so calculate heights even when pos-visible-in-window-p is called - with partially = t. Don't overshoot last_visible_y in move_it_to. - Return row height and row number in new rowh and vpos args. - (cursor_row_fully_visible_p): First line is always "fully visible". - (try_window): Don't clear matrix if vscrolled. - - * lisp.h (pos_visible_p): Update prototype. - - * window.c (Fpos_visible_in_window_p): Adapt to new pos_visible_p. - Return row height and row number for partially visible rows. - Modify return value to a 2 element list for fully visible rows and - 6 for partially visible row. - (window_scroll_pixel_based): Use pos_visible_p directly instead of - Fpos_visible_in_window_p. Fix auto vscrolling for partially - visible lines. Only vscroll backwards if already vscrolled - forwards. Unconditionally vscroll forwards if PT is first (and - only) line. Set new window start instead of scrolling at - start/end of tall line. - -2006-09-05 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macterm.c (install_window_handler, mac_handle_window_event) - [USE_CARBON_EVENTS]: Handle kEventWindowClose. - [USE_MAC_TSM] (mac_handle_text_input_event): Set modifiers for - ASCII keystroke event. - -2006-09-04 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (xg_get_file_with_chooser): Don't mention specific keys in - the file chooser message. Only call gtk_file_chooser_set_current_name - when action is SAVE. - -2006-09-04 Andreas Schwab <schwab@suse.de> - - * Makefile.in: Double all single and back quotes in C-style - comments to help fontifier. - -2006-09-03 Jason Rumney <jasonr@gnu.org> - - * w32.c (shutdown_handler): New function to exit cleanly on shutdown. - (globals_of_w32): Register it as a signal handler. - -2006-09-02 Juri Linkov <juri@jurta.org> - - * marker.c (Fmarker_position): Doc fix. - -2006-09-03 Eli Zaretskii <eliz@gnu.org> - - * window.c (syms_of_window) <split-height-threshold>: - <window-min-height, window-min-width>: Doc fix. - -2006-09-02 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (xg_get_file_with_chooser): Change file chooser message - for writing files. Call gtk_file_chooser_set_current_name to keep - default filename. - - * minibuf.c (Finternal_complete_buffer): Move after DEFUN:s it calls. - -2006-09-02 Jindrich Makovicka <makovick@gmail.com> (tiny change) - - * fns.c (concat) [__GNUC__]: Declare with - `__attribute__((noinline))'. - - * eval.c (apply1, call2) [__GNUC__]: Declare with - `__attribute__((noinline))'. - -2006-09-02 Stuart D. Herring <herring@lanl.gov> - - * minibuf.c (Finternal_complete_buffer): New function. - (syms_of_minibuf): Defsubr it. - (Fread_buffer): Use it, instead of Vbuffer_alist. - -2006-09-01 Martin Rudalics <rudalics@gmx.at> - - * buffer.h (struct buffer_text): New field chars_modiff. - (CHARS_MODIFF, BUF_CHARS_MODIFF): New macros. - * buffer.c (Fbuffer_chars_modified_tick): New function returning - value of BUF_CHARS_MODIFF. - (syms_of_buffer): Defsubr it. - (Fget_buffer_create): Initialize BUF_CHARS_MODIFF. - * insdel.c (modify_region): New argument preserve_chars_modiff. - Set CHARS_MODIFF to MODIFF provided preserve_chars_modiff is zero. - (insert_1_both, insert_from_string_1, insert_from_buffer_1) - (adjust_after_replace, adjust_after_replace_noundo) - (replace_range, replace_range_2, del_range_2): Reset CHARS_MODIFF. - * lisp.h (modify_region): Add fourth argument in extern. - * casefiddle.c (casify_region): Call modify_region with fourth - argument zero to assert that CHARS_MODIFF is updated. - * editfns.c (Fsubst_char_in_region, Ftranslate_region_internal) - (Ftranspose_regions): Likewise. - * textprop.c (Fadd_text_properties, Fset_text_properties) - (Fremove_text_properties, Fremove_list_of_text_properties): - Call modify_region with fourth argument 1 to avoid that - CHARS_MODIFF is updated. - -2006-08-31 Richard Stallman <rms@gnu.org> - - * editfns.c (Fformat): Don't sign-extend for %o or %x. - -2006-08-29 Chong Yidong <cyd@stupidchicken.com> - - * indent.c (Fvertical_motion): Don't move back if we were - displaying a Lisp string, either. - -2006-08-28 Kim F. Storm <storm@cua.dk> - - * xdisp.c (get_window_cursor_type) [!HAVE_WINDOW_SYSTEM]: - Don't attempt to replace cursor on image glyphs. - -2006-08-28 Kenichi Handa <handa@m17n.org> - - * coding.c (Fdetect_coding_region, Fdetect_coding_string): - Fix docstring about ISO-2022 control characters. - -2006-08-28 Kim F. Storm <storm@cua.dk> - - * xdisp.c (get_window_cursor_type): Replace BOX cursor on images - with a hollow box cursor if image is larger than 32x32 (or the default - frame font if that is bigger). Replace any other cursor on images - with hollow box cursor, as redisplay doesn't support bar and hbar - cursors on images. - -2006-08-27 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * alloc.c (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Undo previous - change. Move mutex lock/unlock operations inside BLOCK_INPUT. - - * dired.c (directory_files_internal_unwind, directory_files_internal) - (file_name_completion): Add BLOCK_INPUT around opendir/closedir. - - * image.c [MAC_OS] (image_load_qt_1): Use ComponentResult instead - of OSErr. - - * keyboard.c (in_sighandler): Remove variable. - (Fcurrent_idle_time): Add missing `doc:'. - (input_available_signal, init_keyboard): Undo previous change. - - * keyboard.h (in_sighandler): Remove extern. - - * mac.c (create_apple_event_from_event_ref, select) - (Fmac_get_file_creator, Fmac_get_file_type, Fmac_set_file_creator) - (Fmac_set_file_type, cfstring_create_normalized) - (mac_get_system_locale, select_and_poll_event, sys_select): - Use OSStatus instead of OSErr. - - * macfns.c [TARGET_API_MAC_CARBON] (mac_update_proxy_icon): - Don't use FRAME_FILE_NAME. Use (FS)UpdateAlias. - (Fx_create_frame): Apply 2006-07-03 for xfns.c. - - * macselect.c (get_scrap_from_symbol, clear_scrap, put_scrap_string) - (put_scrap_private_timestamp, scrap_has_target_type, get_scrap_string) - (get_scrap_private_timestamp, get_scrap_target_type_list) - (x_own_selection, x_get_foreign_selection) - (Fx_disown_selection_internal, Fx_selection_owner_p) - (Fx_selection_exists_p): Use OSStatus instead of OSErr. - - * macterm.c (mac_draw_string_common, mac_query_char_extents) - (x_iconify_frame, XLoadQueryFont, install_window_handler) - (mac_handle_command_event, init_command_handler, init_menu_bar): - Use OSStatus instead of OSErr. - (x_free_frame_resources) [TARGET_API_MAC_CARBON]: Don't use - FRAME_FILE_NAME. - (x_query_font): Apply 2006-08-04 change for xterm.c. - (Qhi_command): Rename from Qhicommand. All uses changed. - - * macterm.h (struct mac_output) [TARGET_API_MAC_CARBON]: Remove member - file_name. - (FRAME_FILE_NAME): Remove macro. - (install_window_handler, create_apple_event_from_event_ref): - Return OSStatus instead of OSErr. - -2006-08-26 Kim F. Storm <storm@cua.dk> - - * buffer.c (Fset_buffer_multibyte): - * editfns.c (Fcurrent_time, Fget_internal_run_time): - * macfns.c (Fxw_color_values): - * w32fns.c (Fxw_color_values): - * xfns.c (Fxw_color_values): Simplify; use list3. - - * fileio.c (Fmake_directory_internal, Fdelete_directory) - (Fdelete_file): Simplify; use list1. - (Frename_file, Fadd_name_to_file, Fmake_symbolic_link): - Simplify; remove NO_ARG_ARRAY stuff, use list2. - -2006-08-25 Richard Stallman <rms@gnu.org> - - * buffer.c (Fswitch_to_buffer): Fix previous change. - -2006-08-25 Kim F. Storm <storm@cua.dk> - - * keyboard.c (Fcurrent_idle_time): Simplify. - -2006-08-25 Richard Stallman <rms@gnu.org> - - * fns.c (sxhash_string): Rotate properly; don't lose bits. - -2006-08-24 Francesc Rocher <francesc.rocher@gmail.com> - - * xdisp.c (overline_margin): New variable. - (x_produce_glyphs): Use it. - (syms_of_xdisp): DEFVAR_INT it. - - * xterm.c (x_underline_at_descent_line): New variable. - (syms_of_xterm): DEFVAR_BOOL it. - (x_draw_glyph_string): Use it. - Draw underline and overline up to the end of line if the face - extends to the end of line. - - * macterm.c: Likewise. - - * w32term.c: Likewise. - -2006-08-24 Nick Roberts <nickrob@snap.net.nz> - - * buffer.c (Fswitch_to_buffer): Move buffer to front of - buffer-alist if necessary. - -2006-08-22 Kim F. Storm <storm@cua.dk> - - * xdisp.c (update_tool_bar): Redisplay toolbar also when only - number of items changes. - -2006-08-22 Stefan Monnier <monnier@iro.umontreal.ca> - - * buffer.c (Fset_buffer_multibyte): Record proper undo entry. - -2006-08-21 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * keyboard.c: Clarify difference between in_sighandler and - handling_signal. - -2006-08-21 Kim F. Storm <storm@cua.dk> - - * macterm.c (x_draw_stretch_glyph_string): - * w32term.c (x_draw_stretch_glyph_string): - * xterm.c (x_draw_stretch_glyph_string): It is ok to draw a - stretch glyph in left marginal areas on header and mode lines. - -2006-08-21 Kenichi Handa <handa@m17n.org> - - * keyboard.c (syms_of_keyboard): Docstring of - Vunread_post_input_method_events and Vunread_input_method_events - fixed. - -2006-08-20 Chong Yidong <cyd@stupidchicken.com> - - * keyboard.c (show_help_echo): Preserve mouse movement flag if - tracking mouse. - -2006-08-20 Richard Stallman <rms@gnu.org> - - * xfaces.c (load_pixmap): Add quotes in error message. - - * keyboard.c (Fcurrent_idle_time): New function. - (syms_of_keyboard): defsubr it. - -2006-08-18 Nick Roberts <nickrob@snap.net.nz> - - * window.c (Fset_window_fringes): Do nothing on a tty. - (Fwindow_fringes): Put ? operator after the line break. - -2006-08-16 Andreas Schwab <schwab@suse.de> - - * print.c (debug_output_compilation_hack): Fix return type. - -2006-08-16 Richard Stallman <rms@gnu.org> - - * print.c (debug_output_compilation_hack): New function. - -2006-08-16 Kenichi Handa <handa@m17n.org> - - * fileio.c (choose_write_coding_system): Use LF for end-of-line - in auto-saving. - -2006-08-15 Chong Yidong <cyd@stupidchicken.com> - - * keyboard.c (read_char): Don't change idle timer state at all if - end_time is supplied. - -2006-08-15 Kenichi Handa <handa@m17n.org> - - * coding.c (ONE_MORE_BYTE_CHECK_MULTIBYTE): New arg RET. If SRC - is exhausted, return with RET. - (detect_coding_emacs_mule, detect_coding_iso2022) - (detect_coding_sjis, detect_coding_big5, detect_coding_utf_8) - (detect_coding_utf_16, detect_coding_ccl): Adjusted for the above - change. - -2006-08-14 Chong Yidong <cyd@stupidchicken.com> - - * keyboard.c (read_char): Don't reset idle timers if a time limit - is supplied. - -2006-08-14 Kim F. Storm <storm@cua.dk> - - * .gdbinit (pitx): Print iterator position. - Limit stack dump in case iterator is not initialized. - -2006-08-12 Eli Zaretskii <eliz@gnu.org> - - * frame.c (Fmouse_position, Fmouse_pixel_position) - (Fset_mouse_position, Fset_mouse_pixel_position): Doc fix. - -2006-08-11 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xselect.c (Fx_register_dnd_atom): New function. - (syms_of_xselect): Defsubr it. - (x_handle_dnd_message): Check that message_type is in - dpyinfo->x_dnd_atoms before generating lisp event. - - * xterm.h (struct x_display_info): Add x_dnd_atoms* to keep track - of drag and drop Atoms. - - * xterm.c (x_term_init): Initialize dpyinfo->x_dnd_atoms*. - -2006-08-10 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * keyboard.c: Define in_sighandler. - (input_available_signal): Set in_sighandler. - (init_keyboard): Initialize in_sighandler. - - * keyboard.h: Declare in_sighandler. - - * alloc.c (UNBLOCK_INPUT_ALLOC, BLOCK_INPUT_ALLOC): Use in_sighandler - to check if mutex should be locked or not. - -2006-08-09 Richard Stallman <rms@gnu.org> - - * keyboard.c (keyremap_step): No-op if fkey->parent = nil. - (read_key_sequence): Always start fkey.start and fkey.end at 0, - and likewise for keytran. - -2006-08-09 Kenichi Handa <handa@m17n.org> - - * coding.c (syms_of_coding): Improve the docstring - of file-coding-system-alist. - -2006-08-07 Andreas Schwab <schwab@suse.de> - - * puresize.h (BASE_PURESIZE): Increase to 1120000. - -2006-08-06 Chong Yidong <cyd@stupidchicken.com> - - * buffer.c (Vchange_major_mode_hook, Qchange_major_mode_hook): New vars. - (Fkill_all_local_variables): Use it. - (syms_of_buffer): Defvar it. - -2006-08-05 Eli Zaretskii <eliz@gnu.org> - - * w32.c (w32_valid_pointer_p): New function. - - * w32.h: Add prototype for w32_valid_pointer_p. - - * alloc.c: Include w32.h. - (valid_lisp_object_p) [WINDOWSNT]: Call w32_valid_pointer_p to do - the job. - - * keyboard.c (kbd_buffer_get_event): Return Qnil when current time - is exactly equal to end_time, not only when it is past that. - -2006-08-04 Chong Yidong <cyd@stupidchicken.com> - - * keyboard.c (read_char): Rebalance specpdl after receiving jump. - - * process.c: Reapply 2006-08-01 change. - -2006-08-04 Eli Zaretskii <eliz@gnu.org> - - * w32fns.c (w32_query_font): Fix last change: use stricmp. - -2006-08-04 Stefan Monnier <monnier@iro.umontreal.ca> - - * editfns.c (Fsubst_char_in_region): Redo the setup work after running - the before-change-functions since they may have altered the buffer. - -2006-08-04 Ralf Angeli <angeli@caeruleus.net> - - * w32fns.c (w32_createwindow): Handle -geometry command line option - and the geometry settings in the Registry. - -2006-08-04 Kenichi Handa <handa@m17n.org> - - * w32fns.c (w32_query_font): Compare names by ignoring case. - - * xterm.c (x_query_font): Compare names by ignoring case. - -2006-08-03 Jason Rumney <jasonr@gnu.org> - - * w32menu.c (w32_menu_show, w32_dialog_show): Call Fsignal to quit - when no option selected. - -2006-08-03 Chong Yidong <cyd@stupidchicken.com> - - * process.c: Revert last change. - -2006-08-01 Kim F. Storm <storm@cua.dk> - - * process.c (wait_reading_process_output_unwind): New function. - Restores waiting_for_user_input_p to saved value. - (wait_reading_process_output): Unwind protect waiting_for_user_input_p - instead of save/restore old value on stack. - -2006-07-30 Thien-Thi Nguyen <ttn@gnu.org> - - * editfns.c: Undo 2006-06-27 change. - -2006-07-29 Eli Zaretskii <eliz@gnu.org> - - * coding.c (Ffind_operation_coding_system): Revert the change from - 2006-05-29. - - * alloc.c [WINDOWSNT]: Include fcntl.h, to fix last change. - -2006-07-28 Richard Stallman <rms@gnu.org> - - * xfaces.c (lookup_named_face, Fdisplay_supports_face_attributes_p): - Add conditional aborts for clarity. - - * xdisp.c (update_menu_bar): New arg HOOKS_RUN. Callers changed. - Used to avoid running the hooks over and over for each frame. - (prepare_menu_bars): Pass value from update_menu_bar - as HOOKS_RUN of next call. - - * keyboard.c (safe_run_hooks_1): Don't crash if Vrun_hooks is nil. - -2006-07-28 Kim F. Storm <storm@cua.dk> - - * alloc.c (valid_pointer_p): New function (from valid_lisp_object_p). - (valid_lisp_object_p): Use it to check for valid SUBRP obj. - -2006-07-26 Chong Yidong <cyd@stupidchicken.com> - - * keyboard.c (read_char): New arg END_TIME specifying timeout. - All callers changed. Turn off echoing if END_TIME is non-NULL. - (kbd_buffer_get_event): New arg END_TIME. - - * lread.c (read_filtered_event): New arg SECONDS to wait until. - (Fread_char, Fread_event, Fread_char_exclusive): New arg SECONDS. - - * lisp.h: Update read-char, read-event, and read_filtered_event - prototypes. - - * keyboard.h: Include systime.h. Update read_char prototype. - -2006-07-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * alloc.c (find_string_data_in_pure): New function. - (make_pure_string): Use it to reuse existing string data if possible. - - * puresize.h (BASE_PURESIZE): Decrease to 1102000. - -2006-07-22 Stefan Monnier <monnier@iro.umontreal.ca> - - * keymap.c (Fdefine_key): If the key binding definition looks like an - XEmacs-style key sequence, convert it to Emacs's format. - -2006-07-22 Ralf Angeli <angeli@caeruleus.net> - - * w32fns.c (w32_createwindow): If `left' and/or `top' frame - parameters are bound to some values, use that instead of - CW_USEDEFAULT. - -2006-07-21 Eli Zaretskii <eliz@gnu.org> - - * w32.c (convert_time): Use explicit long double constants to - ensure long double arithmetics is used throughout. - -2006-07-20 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp): New vars. - (init_alloc_once): Initialize them. - (pure_alloc): Allocate non-Lisp objects from the end of pure storage - without alignment. - - * puresize.h (BASE_PURESIZE): Decrease to 1141000. - -2006-07-18 Francis Litterio <franl@world.std.com> - - * w32term.c (x_calc_absolute_position): Fix frame positioning - with negative X/Y coordinates. - -2006-07-18 Dan Nicolaescu <dann@ics.uci.edu> - - * xterm.c (x_connection_closed, x_error_quitter): Mark as NO_RETURN. - - * textprop.c (text_read_only): Likewise. - - * lread.c (end_of_file_error): Likewise. - - * lisp.h (circular_list_error, memory_full, buffer_memory_full): - Likewise. - - * eval.c (unwind_to_catch): Likewise. - - * buffer.h (buffer_slot_type_mismatch): Likewise. - -2006-07-18 Kim F. Storm <storm@cua.dk> - - Cleanup Fsignal calls that never returns; now only use it for Qquit. - - * eval.c (xsignal): New func. Like Fsignal, but marked no-return. - (xsignal0, xsignal1, xsignal2, xsignal3): New no-return functions. - (signal_error): New no-return function (from xfaces.c). - (Fthrow): Use xsignal2 instead of Fsignal + abort. - (error): Use xsignal1 instead of Fsignal + abort. - (FletX, Flet, grow_specpdl): Use signal_error. - (Feval, Ffuncall, funcall_lambda): Use xsignal1, xsignal2. - - * alloc.c (buffer_memory_full, memory_full): Use xsignal. Remove loop. - (list1): New function. - - * lisp.h (list1): Add EXFUN. - (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error): - Add prototypes. Mark them as no-return. - - * buffer.c (Fbuffer_local_value, Fbarf_if_buffer_read_only): - Use xsignal1. - - * callint.c (check_mark): Use xsignal0. - - * casefiddle.c (casify_object): wrong_type_argument is no-return. - - * cmds.c (Fforward_char, Fdelete_char): Use xsignal0. - - * coding.c (Fcheck_coding_system): Use xsignal1. Remove loop. - (Fdefine_coding_system_internal): Use xsignal1. - - * data.c (circular_list_error): Use xsignal. - (wrong_type_argument): Use xsignal2. Don't care about return value. - (args_out_of_range, args_out_of_range_3): Use xsignal2, xsignal3. - Remove loop around Fsignal. - (indirect_variable, Fsymbol_value, set_internal, Fdefault_value) - (indirect_function, Findirect_function, Fstring_to_number) - (Fmakunbound, Ffmakunbound, Fsymbol_function, Ffset): Use xsignal1. - (arith_driver, float_arith_driver, Frem, Fmod, arith_error): - Use xsignal0. - - * doc.c (Fdocumentation): Use xsignal1. - - * editfns.c (region_limit, Fget_internal_run_time): Use xsignal0. - - * fileio.c (report_file_error): Use xsignal. - (barf_or_query_if_file_exists, Fcopy_file, Fdelete_file) - (Finsert_file_contents): Use xsignal2. - (syms_of_fileio): Use list2, list3. - - * floatfns.c (arith_error, range_error, domain_error): Use xsignal2. - (range_error2, domain_error2): Use xsignal3. - (rounding_driver, fmod_float): Use xsignal0. - (float_error): Use xsignal1. - (matherr): Use xsignal. - - * fns.c (Flength): wrong_type_argument is no-return. - (hashfn_user_defined, Fmake_hash_table): Use signal_error. - (Fmd5): Use xsignal1. - - * frame.c (x_set_line_spacing, x_set_screen_gamma): Use signal_error. - - * keyboard.c (recursive_edit_1): Use xsignal1. - - * keymap.c (Fmap_keymap): Use xsignal1. - - * lread.c (Fload): Use xsignal2, signal_error. - (end_of_file_error): Use xsignal0, xsignal1. - (read0): Use xsignal1. - (invalid_syntax): New error function marked no-return. - (read_integer, read1, read_list): Use it. - - * macselect.c (x_get_local_selection): Use signal_error. - - * msdos.c (Fmsdos_set_mouse_buttons): Use xsignal2. - - * search.c (compile_pattern_1): Use xsignal1. - (signal_failure): Remove (was only called once). - (search_command): Use xsignal1 instead of signal_failure. - - * syntax.c (scan_lists): Use xsignal3. - - * textprop.c (text_read_only): Use xsignal0, xsignal1. - - * unexsol.c (unexec): Use xsignal. - - * window.c (window_scroll_pixel_based, window_scroll_line_based): - Use xsignal0. - - * xfaces.c (signal_error): Move to eval.c. - (resolve_face_name): Use xsignal1. - - * xfns.c (x_decode_color): Use signal_error. - - * xselect.c (x_get_local_selection, copy_multiple_data) - (x_get_window_property_as_lisp_data) - (lisp_data_to_selection_data, CHECK_CUT_BUFFER) - (Fx_get_cut_buffer_internal): Use signal_error. - -2006-07-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macterm.c (XTread_socket): Undo previous change. - -2006-07-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macterm.c (keycode_to_xkeysym): Remove function. All uses now - directly lookup keycode_to_xkeysym_table. - [USE_MAC_TSM] (mac_handle_text_input_event): Don't construct - ASCII_KEYSTROKE_EVENT for non-zero keycode_to_xkeysym_table entries. - (XTread_socket): Use character codes to construct keypad key events. - (mac_initialize_display_info) [MAC_OSX]: Use CGDisplaySamplesPerPixel. - (x_delete_display): Apply 2006-07-04 change for xterm.c. - -2006-07-17 Richard Stallman <rms@gnu.org> - - * keyboard.c (Vcommand_error_function): New variable. - (syms_of_keyboard): Defvar it. - (cmd_error_internal): Simplify, and handle Vcommand_error_function. - - * dispnew.c (init_display): Mention DISPLAY as well as TERM in err msg. - -2006-07-17 Kim F. Storm <storm@cua.dk> - - * xdisp.c (handle_single_display_spec): Ensure the right value of - it->position is saved by push_it. - (pop_it): Restore it->object for GET_FROM_BUFFER and GET_FROM_STRING. - (reseat_1): Don't setup it->object twice. - (set_iterator_to_next): No need to set it->object after pop_it. - (move_it_to): Explicitly check to see if last move reached to_charpos. - -2006-07-17 Thien-Thi Nguyen <ttn@gnu.org> - - * xdisp.c (display_mode_line): Preserve match data. - -2006-07-14 Kim F. Storm <storm@cua.dk> - - * w32.c (pfn_WSACreateEvent, pfn_WSACloseEvent): New func ptrs. - (init_winsock): Load them. Use ws2_32.dll. - (sys_listen): Undo last change. Just set FILE_LISTEN flag. - (sys_accept): Undo last change. Instead, set child status to - STATUS_READ_ACKNOWLEDGED and reset char_avail event so next - sys_select will wakeup the reader thread. - (_sys_wait_accept): New function used by reader thread to wait for - an incoming connection on a server socket. - - * w32.h (_sys_read_ahead, _sys_wait_accept): Add prototypes. - - * w32proc.c (reader_thread): Use _sys_wait_accept to wait on a - server socket (FILE_LISTEN flag). - -2006-07-14 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * sound.c (alsa_init): Call snd_pcm_close after successful snd_pcm_open. - -2006-07-14 Kim F. Storm <storm@cua.dk> - - * w32.c: Fix high cpu load for server sockets. - (pfn_WSAEventSelect): New function ptr. - (init_winsock): Load it. - (sys_listen): Set FILE_LISTEN flag. Set event mask for socket's - char_avail event object to FD_ACCEPT. - (sys_accept): Check FILE_LISTEN flag. Set event mask on new - socket's char_avail event object to FD_READ|FD_CLOSE. - - * w32.h (FILE_LISTEN): New filedesc flag value. - -2006-07-13 Kim F. Storm <storm@cua.dk> - - * bytecode.c (Fbyte_code): Use CAR, CDR for Bcar, Bcdr. - Use CAR_SAFE, CDR_SAFE for Bcar_safe, Bcdr_safe. - Simplify loops and use CAR for Bnth and Belt. - - * data.c (Findirect_function): Optimize for no indirection. - - * eval.c (Fthrow): Remove loop around Fsignal. - (Feval, Fapply, Ffuncall): Optimize for no function indirection. - Use original function name in all signaled errors. - Simplify Fsignal calls (no return). - (funcall_lambda): Simplify Fsignal calls (no return). - -2006-07-13 Andreas Schwab <schwab@suse.de> - - * syntax.c (scan_sexps_forward): Use EMACS_INT for out_bytepos and - out_charpos. - -2006-07-13 Kenichi Handa <handa@m17n.org> - - * editfns.c (Fformat): Fix calculation of text property positions - of format string. - -2006-07-12 Kim F. Storm <storm@cua.dk> - - * lisp.h (CHECK_TYPE): New macro for generic type checking. - (CAR_SAFE, CDR_SAFE): New macros. - (ARRAYP, CHECK_ARRAY): New macros. - (CHECK_VECTOR_OR_STRING, CHECK_SUBR): New macros. - (CHECK_WINDOW_CONFIGURATION): New macro. - (CHECK_LIST_CONS, CHECK_LIST_END): New checks for list traversal. - (CHECK_STRING_OR_BUFFER, CHECK_HASH_TABLE, CHECK_LIST) - (CHECK_STRING, CHECK_STRING_CAR, CHECK_CONS, CHECK_SYMBOL) - (CHECK_CHAR_TABLE, CHECK_VECTOR, CHECK_VECTOR_OR_CHAR_TABLE) - (CHECK_BUFFER, CHECK_WINDOW, CHECK_LIVE_WINDOW, CHECK_PROCESS) - (CHECK_NUMBER, CHECK_NATNUM, CHECK_MARKER, CHECK_OVERLAY) - (CHECK_NUMBER_COERCE_MARKER, CHECK_FLOAT, CHECK_NUMBER_OR_FLOAT) - (CHECK_NUMBER_OR_FLOAT_COERCE_MARKER): Use CHECK_TYPE. - - * category.h (CHECK_CATEGORY, CHECK_CATEGORY_SET): - * frame.h (CHECK_FRAME, CHECK_LIVE_FRAME): Use CHECK_TYPE. - - * callint.c (Fcall_interactively): - * casefiddle.c (casify_object): - * editfns.c (general_insert_function): - * fns.c (Flength, Felt, Ffillarray): - * data.c (Fcar, Fcdr): Remove loop around wrong_type_argument. - - * data.c (wrong_type_argument): Remove loop around Fsignal. - (Farrayp, Fsequencep): Use ARRAYP. - (Fcar): Use CAR. - (Fcar_safe): Use CAR_SAFE. - (Fcdr): Use CDR. - (Fcdr_safe): Use CDR_SAFE. - (Fsetcar, Fsetcdr): Use CHECK_CONS. - (Fsubr_arity, Fsubr_name): Use CHECK_SUBR. - (Faset): Use CHECK_ARRAY. - - * fns.c (Felt): Use CHECK_ARRAY. - (concat): Use CHECK_NUMBER. - (Fsubstring, substring_both): Use CHECK_VECTOR_OR_STRING. - (Fmemq): Use CHECK_LIST. - (Fassq, Fassoc, Frassq, Frassoc): Use CAR. - (assq_no_quit): Use CAR_SAFE. - (Fnthcdr, Fmember, Fdelq, Fdelete, Fnreverse, Fnconc): - Use CHECK_LIST_CONS. - (Freverse, Fplist_get, Flax_plist_get): Use CHECK_LIST_END. - - * bytecode.c (Fbyte_code): Use CHECK_VECTOR. - - * casetab.c (check_case_table): - * category.c (check_category_table): - * marker.c (Fcopy_marker): - * syntax.c (check_syntax_table): - * xfaces.c (load_pixmap): Use CHECK_TYPE. - - * fns.c (Fcopy_sequence, concat): - * fringe.c (Fdefine_fringe_bitmap): - * lread.c (check_obarray): Cleanup wrong_type_argument use. - - * keyboard.c (access_keymap_keyremap): Use ARRAYP. - - * keymap.c (Fdefine_key, Flookup_key): - * macros.c (Fstart_kbd_macro): Use CHECK_VECTOR_OR_STRING. - - * mac.c (Fmac_get_preference): Use CHECK_LIST_END. - - * search.c (Fset_match_data): Use CHECK_LIST. - - * sunfns.c (sun_item_create): Use CHECK_LIST_CONS. - - * window.c (Fwindow_configuration_frame, Fset_window_configuration): - (compare_window_configurations): Use CHECK_WINDOW_CONFIGURATION. - -2006-07-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * Makefile.in (dired.o, editfns.o, fileio.o): Depend on blockinput.h. - - * dired.c: Include blockinput.h. - (Ffile_attributes): Add BLOCK_INPUT around getpwuid/getgrgid. - - * editfns.c: Include blockinput.h. - (Fuser_login_name, Fuser_full_name): Add BLOCK_INPUT around - getpwuid/getpwnam. - - * fileio.c: Include blockinput.h. - (Fexpand_file_name, search_embedded_absfilename): Add BLOCK_INPUT - around getpwnam. - (search_embedded_absfilename): Remove spurious xfree. - -2006-07-11 Kim F. Storm <storm@cua.dk> - - * dispnew.c (sit_for): Reduce number of args from 5 to 3. - Now just one TIMEOUT arg that can be a Lisp float or Lisp int. - Combine args DISPLAY and INITIAL_DISPLAY into one arg DO_DISPLAY. - Signal error if TIMEOUT is not a number. - Undo 2006-06-14 change for non-preemptive display if TIMEOUT < 0. - The rework of sit_for args also fixes several incorrect Qt args - which should have been 1. - (Fredisplay): Pass 1 instead of Qt to swallow_events and - detect_input_pending_run_timers. - - * lisp.h (sit_for): Update prototype. - (Fredisplay): Add EXFUN. - - * dispextern.h (sit_for): Remove prototype. - - * callint.c (Fcall_interactively): - * minibuf.c (temp_echo_area_glyphs): - * keyboard.c (command_loop_1, read_char, Fexecute_extended_command): - * fileio.c (Fdo_auto_save): Update/simplify sit_for calls. - -2006-07-11 Stefan Monnier <monnier@iro.umontreal.ca> - - * syntax.c (forw_comment): Also use EMACS_INT for buffer positions. - -2006-07-11 Kim F. Storm <storm@cua.dk> - - * dispnew.c (Fredisplay): Add FORCE argument to force redisplay when - input is available. Fix test for redisplay_dont_pause non-nil. - Specbind redisplay-dont-pause to t if FORCE non-nil. - -2006-07-10 Chong Yidong <cyd@stupidchicken.com> - - * puresize.h (BASE_PURESIZE): Increment to 1211000. - - * dispnew.c (Fredisplay): New function, equivalent to (sit-for 0). - (Fsit_for): Function deleted. - - * keyboard.c (command_loop_1, Fexecute_extended_command): - Call sit_for instead of Fsit_for. - - * minibuf.c (temp_echo_area_glyphs): Likewise. - -2006-07-09 Stefan Monnier <monnier@iro.umontreal.ca> - - * syntax.c (Fforward_comment): Revert the reversion. - (back_comment, scan_lists): Also use EMACS_INT for buffer positions. - -2006-07-09 John Paul Wallington <jpw@pobox.com> - - * syntax.c (Fforward_comment): Revert previous change. - -2006-07-09 Kim F. Storm <storm@cua.dk> - - * window.c (Fforce_window_update): Doc fix. - -2006-07-08 Stephen Gildea <gildea@stop.mail-abuse.org> - - * fileio.c (do_auto_save_make_dir): Make the auto-save-list-file - directory unreadable for better user privacy. - -2006-07-07 Stefan Monnier <monnier@iro.umontreal.ca> - - * syntax.c (Fforward_comment): Fix int-32 vs EMACS_INT-64 mixup. - - * lread.c (read_filtered_event): Remove `register' qualifier because it - causes compilation problem with gcc-4.0.2-20051125 on amd64. - (readevalloop): Remove unused var `bpos'. - Yet another int/Lisp_Object mixup (YAILOM). - -2006-07-07 Eli Zaretskii <eliz@gnu.org> - - * keyboard.c (Fexecute_extended_command): Mention the argument - PREFIXARG in the doc string. - -2006-07-07 Kim F. Storm <storm@cua.dk> - - * fringe.c (Fdefine_fringe_bitmap): Doc fix. - -2006-07-05 Chong Yidong <cyd@stupidchicken.com> - - * insdel.c (prepare_to_modify_buffer): For an indirect buffer, do - clash detection using the base buffer. - - * puresize.h (BASE_PURESIZE): Increment to 1210500. - -2006-07-04 Kim F. Storm <storm@cua.dk> - - * xterm.c (x_delete_display): Don't free or derefence NULL pointers. - -2006-07-04 Kenichi Handa <handa@m17n.org> - - * fontset.c (Fset_overriding_fontspec_internal): Check if we need - to update Voverriding_fontspec_alist. - -2006-07-03 Richard Stallman <rms@gnu.org> - - * xfns.c (Fx_create_frame): Move unwind_create_frame setup down. - - * xfaces.c (Fface_attribute_relative_p): Doc fix. - - * textprop.c (Fget_char_property_and_overlay): Doc fix. - - * eval.c (Fdefvaralias): Doc fix. - -2006-07-03 Kim F. Storm <storm@cua.dk> - - * dispnew.c (sit_for): Fix preempt condition. - -2006-07-02 Stefan Monnier <monnier@iro.umontreal.ca> - - * lread.c (read_filtered_event): Treat select-window just like - switch-frame. - -2006-07-02 Kim F. Storm <storm@cua.dk> - - * xdisp.c (display_tool_bar_line): Skip glyphs which are too big - to ever fit the tool-bar, - (MAX_FRAME_TOOL_BAR_HEIGHT): New macro. - (tool_bar_lines_needed): Use unused mode-line row as temp_row. - (redisplay_tool_bar): Only clear desired matrix if we actually - change the tool-bar window height. Only try to make the tool-bar - window bigger if there is actually room for it. - -2006-06-30 Ralf Angeli <angeli@caeruleus.net> - - * w32term.c (x_make_frame_visible): Use SystemParametersInfo with - SPI_GETWORKAREA to find the dimensions of the screen work area, - and adjust vertical position of the frame in order to avoid being - covered by the task bar. - - * w32fns.c (w32_createwindow): Use CW_USEDEFAULT instead of - f->left_pos and SH_SHOW instead of f->top_pos in the call to - CreateWindow. Record the actual position in f->left_pos and - f->top_pos. - -2006-06-30 John Paul Wallington <jpw@pobox.com> - - * w32console.c (syms_of_ntterm) <w32-use-full-screen-buffer>: - Doc fix - default value has changed. - -2006-06-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * mac.c [!TARGET_API_MAC_CARBON]: Don't include FixMath.h or Scrap.h. - - * macfns.c (Fx_create_frame): Apply 2006-06-24 change for xfns.c. - - * macgui.h (USE_MAC_TSM) [TARGET_API_MAC_CARBON]: Set default to 1. - - * macterm.c (Qeql): Add extern. - (x_set_mouse_pixel_position) [MAC_OSX]: Use CGWarpMouseCursorPosition. - (fm_style_face_attributes_alist) [USE_ATSUI]: New variable. - (syms_of_macterm) [USE_ATSUI]: Initialize and staticpro it. - Change keys of Vmac_atsu_font_table from strings to numbers. - (fm_style_to_face_attributes) [USE_ATSUI]: New function. - (init_font_name_table) [USE_ATSUI]: Use it. - (saved_ts_script_language_on_focus) [USE_MAC_TSM]: New variable. - (syms_of_macterm) [USE_MAC_TSM]: Initialize and staticpro it. - [USE_MAC_TSM] (mac_tsm_resume): Restore script and language codes - only when saved_ts_script_language_on_focus coincides with - Vmac_ts_script_language_on_focus. - [USE_MAC_TSM] (mac_tsm_suspend): Save value of - Vmac_ts_script_language_on_focus to saved_ts_script_language_on_focus. - (XTread_socket) [USE_MAC_TSM]: Add Mac OS Classic support. - [USE_MAC_TSM] (mac_handle_text_input_event, init_tsm): Likewise. - -2006-06-27 Chong Yidong <cyd@stupidchicken.com> - - * editfns.c (Fdelete_field, Ffield_string, Ffield_beginning) - (Ffield_string_no_properties, Ffield_end): Mention - args-out-of-range error condition in docstring. - -2006-06-27 Kim F. Storm <storm@cua.dk> - - * xdisp.c (handle_composition_prop): Set stop_charpos before push_it. - -2006-06-25 Kim F. Storm <storm@cua.dk> - - * s/gnu-linux.h (SIGNALS_VIA_CHARACTERS): Define for Linux kernel - version 2.4 and later. - -2006-06-24 Chong Yidong <cyd@stupidchicken.com> - - * xfns.c (Fx_create_frame): Set font parameter directly instead of - using x_default_parameter, since x_get_args clears the parm alist. - -2006-06-24 Eli Zaretskii <eliz@gnu.org> - - * dired.c (directory_files_internal) [WINDOWSNT]: Find files - case-insensitively. - -2006-06-24 Aidan Kehoe <kehoea@parhasard.net> - - * lread.c (read_escape): When an unknown Unicode code point is - encountered as a string or character escape, signal an error. - -2006-06-23 Kim F. Storm <storm@cua.dk> - - * .gdbinit (pitx): Dump iterator stack. - - * xdisp.c (handle_composition_prop): Push iterator on stack. - (set_iterator_to_next): Pop iterator at end of composition. - -2006-06-23 Martin Rudalics <rudalics@gmx.at> - - * fileio.c (Frename_file) [DOS_NT]: Don't try to move directory to - itself on DOS_NT platforms, if the old and new names are identical - but for the letter-case. - -2006-06-21 Kim F. Storm <storm@cua.dk> - - * dispextern.h (struct it): Add `position' member to iterator stack. - Rename `pos' member to `current'. Rearrange and add comments. - - * xdisp.c (handle_stop): Set it->ignore_overlay_strings_at_pos_p - if we get any overlays. - (set_cursor_from_row): Don't clobber `end' if we rescan from - start_string. - (push_it, pop_it): Save it->position. - -2006-06-19 Richard Stallman <rms@gnu.org> - - * window.c (size_window): New arg FIRST_ONLY. All callers changed. - (adjust_window_trailing_edge): Specially compute FIRST_PARALLEL - for the case of a top-level window and the following minibuffer. - Don't exit because of no `next' when there is a parent. - Use the FIRST_ONLY feature when resizing following windows. - - * syntax.c (init_syntax_once): Give most control chars' syntax Spunct. - -2006-06-17 Kim F. Storm <storm@cua.dk> - - * dispnew.c (update_frame): Check for input pending on entry. - (update_window, update_frame_1): Break loop if input is detected. - -2006-06-16 Francis Litterio <flitterio@gmail.com> - - * xterm.c (x_check_expected_move, handle_one_xevent) - (x_set_offset, x_check_fullscreen): Extensive changes to make - frame positioning deterministic under X. - - * xterm.h (x_output): Add members left_before_move and - top_before_move. Removed members expected_left and expected_top. - -2006-06-16 Kim F. Storm <storm@cua.dk> - - * dispextern.h (struct it): Add union to iterator stack to save - image, composition, and stretch specific paramters. - - * xdisp.c (next_overlay_string): Fix assert. - (push_it, pop_it): Handle composition and stretch specific values. - Only handle it->slice in image (for now). - (back_to_previous_visible_line_start): Continue search if newline is - part of a compisition. Simplify. - (reseat_1): Set it->object to buffer. - (set_iterator_to_next): Set it->object to string or buffer, when - setting it->method to GET_FROM_STRING or GET_FROM_BUFFER. - (next_element_from_composition): Set it->object to buffer if not - from string. - (set_cursor_from_row): Only save start of string if not already - done to handle multiple strings in a row. - - * .gdbinit (pitx): Show composition parameters. - (pgx, pg): New commands to print a glyph structure. - (pgi, pgn): New commands to print specific/next glyph. - (pgrowx, pgrow): New commands to print all glyphs in a row. - -2006-06-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macfns.c (Fx_display_mm_height, Fx_display_mm_width) - [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]: Use CGDisplayScreenSize. - - * macterm.c (do_app_resume, do_app_suspend): Remove functions. - (mac_tsm_resume, mac_tsm_suspend) [USE_MAC_TSM]: New functions. - (mac_handle_window_event, XTread_socket) [USE_MAC_TSM]: Use them. - (Vmac_ts_script_language_on_focus) [USE_MAC_TSM]: New variable. - (syms_of_macterm) [USE_MAC_TSM]: Defvar it. - (saved_ts_language, saved_ts_component) [USE_MAC_TSM]: New variables. - (mac_initialize_display_info) [MAC_OSX]: Use Quartz Display - Services functions to get size of main display in pixels. - -2006-06-14 Chong Yidong <cyd@stupidchicken.com> - - * xdisp.c (back_to_previous_visible_line_start): - Reset it->continuation_lines_width. - -2006-06-14 Richard Stallman <rms@gnu.org> - - * eval.c (Fdefconst): Mark variable as risky. - - * callproc.c (Fcall_process): Doc fix. - - * window.c (adjust_window_trailing_edge): Don't break out of the loop - because there's no next window, if there are parallel windows. - Do break out when WINDOW is nil. - -2006-06-14 Kim F. Storm <storm@cua.dk> - - * dispextern.h (IT_STACK_SIZE): New macro specifying size of - iterator stack (instead of hardcoded number). Increase from 2 to - 4 to make room for propertized overlay strings before and after a - display string, image or composition. - (struct it): Add image_id and method members to iterator stack. - - * xdisp.c (init_from_display_pos): Don't set it->method and - overlay_string_index after pop_it. Add asserts. - (handle_stop): Look for overlay strings around a display string, - image, or composition. Handle properties on those strings. - (next_overlay_string): Don't set string, pos or method after pop_it. - (get_overlay_strings_1): Split from get_overlay_strings; don't - modify it if no overlay strings are found. - (get_overlay_strings): Use get_overlay_strings_1. Always set - it->string and it->method. - (push_it): Push it->image_id and it->method. Push it->object - instead of it->string if method is GET_FROM_IMAGE. - (pop_it): Pop it->image_id and it->method. Ppo it->object - instead of it->string if method is GET_FROM_IMAGE. - Reset it->current.string_pos if popped it->string is nil. - (reseat_1): Remove comment dated 19 May 2003. It expressed doubt - whether a given change was correct; but the change is correct. - Clear it->string_from_display_prop_p. - (set_iterator_to_next): Rely on it->method and it->image_id from - iterator stack, instead of setting them explicitly after pop_it. - - * dispnew.c (sit_for): Undo 2006-06-01 change. Instead, a - negative time forces redisplay even when input is available. - (Fsit_for): Doc fix. - -2006-06-13 Kim F. Storm <storm@cua.dk> - - * dispnew.c: Modify preemptive redisplay to be based on periodic - checks for input. - (PERIODIC_PREEMPTION_CHECKING): Define to 1 iff EMACS_HAS_USECS. - (Vredisplay_preemption_period): New variable. - (syms_of_display): DEFVAR_LISP and initialize it. - (preemption_period, preemption_next_check): New variables. - (update_frame, update_single_window): Initialize them based on - Vredisplay_preemption_period if !force_p. - (update_window, update_frame_1): Use them to determine when to - check for input. - -2006-06-03 Aidan Kehoe <kehoea@parhasard.net> - - * lread.c (read_escape): Provide a Unicode character escape - syntax; \u followed by exactly four or \U followed by exactly - eight hex digits in a comment or string is read as a Unicode - character with that code point. - -2006-06-09 Eli Zaretskii <eliz@gnu.org> - - * window.c (window_scroll_pixel_based): Signal "Beginning of - buffer" when scroll-down at the beginning of an empty buffer. - -2006-06-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macterm.c [USE_MAC_TSM] (mac_handle_text_input_event): - Exclude 0x7f from ASCII range. - -2006-06-05 Jason Rumney <jasonr@gnu.org> - - * w32term.c (w32_set_scroll_bar_thumb, x_scroll_bar_create) - (w32_set_vertical_scroll_bar, w32_scroll_bar_handle_click) - (x_scroll_bar_report_motion): Remove workarounds for - versions of Windows NT < 3.51. - [!SIF_ALL]: Remove. - (pfnSetScrollInfo, pfnGetScrollInfo): Remove. - (w32_initialize): Don't dynamically load Get/SetScrollInfo. - -2006-06-04 David Kastrup <dak@gnu.org> - - * dispnew.c: Mention `redisplay-dont-pause' in doc string of - `sit-for'. - -2006-06-03 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macfns.c (x_set_icon_name): Apply 2006-06-02 change for xfns.c. - - * macgui.h (USE_MAC_TSM): Set default to 1 on Mac OS X. - - * macterm.c (tsm_document_id) [USE_MAC_TSM]: New variable. - (Qtext_input, Qupdate_active_input_area, Qunicode_for_key_event) - [USE_MAC_TSM]: Likewise. - (syms_of_macterm) [USE_MAC_TSM]: Intern and staticpro them. - (Qbefore_string) [USE_MAC_TSM]: Add extern. - (do_app_resume, do_app_suspend) [USE_MAC_TSM]: Call - ActivateTSMDocument/DeactivateTSMDocument. - (mac_store_event_ref_as_apple_event): Call mac_post_mouse_moved_event. - (mac_handle_window_event) [USE_MAC_TSM]: Handle - kEventWindowFocusAcquired/kEventWindowFocusRelinquish. - (mac_handle_text_input_event) [USE_MAC_TSM]: New function. - (install_window_handler) [USE_MAC_TSM]: Install it. Register - kEventWindowFocusAcquired/kEventWindowFocusRelinquish. - (keycode_to_xkeysym_table): Add entry for f16. - (XTread_socket) [USE_MAC_TSM]: Set/reset read_socket_inev - before/after passing keystroke event to toolbox dispatcher. - (init_tsm) [USE_MAC_TSM]: New function. - (mac_initialize) [USE_MAC_TSM]: Call it. - (Vmac_ts_active_input_overlay) [USE_MAC_TSM]: New defvar. - - * macterm.h (EVENT_PARAM_TEXT_INPUT_SEQUENCE_NUMBER): New enumerator. - -2006-06-02 John Paul Wallington <jpw@gnu.org> - - * xfns.c (x_set_name_internal): Set icon to `text', derived from - name, when frame's icon_name isn't a string rather than only when - it is nil. - -2006-06-03 Eli Zaretskii <eliz@gnu.org> - - * w32fns.c (x_set_icon_name): Don't use arg if it's not a string - and not nil. - -2006-06-02 Chong Yidong <cyd@stupidchicken.com> - - * xfns.c (x_set_icon_name): No-op if arg is non-nil and not a - string. - -2006-06-02 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * xdisp.c (next_element_from_composition): Set it->object to - it->string if composition is coming from string. - (set_cursor_from_row): Don't return 0 unless row displays a - continued line. - (dump_glyph): Dump composite glyph. - -2006-06-02 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (menu_nav_ended): Check that menubar_widget is not NULL. - -2006-06-01 Richard Stallman <rms@gnu.org> - - * window.c (Fsplit_window): Doc fix. - -2006-06-01 Micha,Ak(Bl Cadilhac <michael.cadilhac@lrde.org> - - * process.c (deleted_pid_list): New variable to store the pids - of deleted processes. Declare it only if SIGCHLD is defined. - (init_process): Initialize it. - (syms_of_process): Staticpro it. - (Fdelete_process): Add pid of the deleted process to it. Check after - the addition and before the kill if the process is already stopped, - in which case it is deleted from the list and not killed. - (sigchld_handler): Define it only if SIGCHLD is. Search the process - that signaled Emacs in `deleted_pid_list' before `Vprocess_alist'. - Original idea by Stefan Monnier. - -2006-06-01 Kim F. Storm <storm@cua.dk> - - * dispnew.c (sit_for): Perform redisplay even if input is pending - when redisplay-dont-pause is non-nil. - -2006-06-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macterm.c (mac_handle_visibility_change): Set buf.arg to Qnil. - (XTread_socket): Remove obsolete comment. - -2006-06-01 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xmenu.c (syms_of_xmenu): Make accelerate-menu an alias for - menu-bar-open. - -2006-06-01 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xmenu.c (Fmenu_bar_open, syms_of_xmenu): Change menu-bar-start to - menu-bar-open. - - * gtkutil.c (menu_nav_ended): Change x-menu-bar-start to menu-bar-open. - -2006-05-31 Juri Linkov <juri@jurta.org> - - * minibuf.c (Vhistory_add_new_input): New variable. - (read_minibuf): Use it. - (syms_of_minibuf) <history-add-new-input>: New Lisp variable. - (syms_of_minibuf) <history-delete-duplicates>: Doc fix. - -2006-05-31 Kim F. Storm <storm@cua.dk> - - * process.c (select_wrapper): Add wrapper around select to work around - "incomplete backtrace" bug in gdb 5.3, when emacs is stopped inside - select called from wait_reading_process_output. - -2006-05-30 Andreas Schwab <schwab@suse.de> - - * xmenu.c (Fmenu_bar_start): Return a value. - -2006-05-30 Richard Stallman <rms@gnu.org> - - * coding.c (Ffind_operation_coding_system): Doc fix. - -2006-05-30 Eli Zaretskii <eliz@gnu.org> - - * w32term.c (x_draw_hollow_cursor): Fix last change. - -2006-05-29 Kim F. Storm <storm@cua.dk> - - * w32term.c (x_draw_stretch_glyph_string): Fix last change. - -2006-05-29 Eli Zaretskii <eliz@gnu.org> - - * coding.c (Ffind_operation_coding_system): Doc fix. - -2006-05-29 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macfns.c [USE_MAC_FONT_PANEL] (Fmac_set_font_panel_visibility): - Call mac_set_font_info_for_selection if font panel is made visible. - - * macterm.c (font_panel_shown_p) [USE_MAC_FONT_PANEL]: New variable. - (mac_font_panel_visible_p, mac_show_hide_font_panel) - [USE_MAC_FONT_PANEL]: New functions. - [USE_MAC_FONT_PANEL] (mac_set_font_info_for_selection): - Return immediately if font panel is not visible. - - * macterm.h (mac_font_panel_visible_p, mac_show_hide_font_panel): - Add externs. - -2006-05-29 Dan Nicolaescu <dann@ics.uci.edu> - - * search.c (matcher_overflow): Mark as NO_RETURN. - - * xterm.c (x_connection_closed): Likewise. - - * sysdep.c (croak): Likewise. - - * sound.c (sound_perror, alsa_sound_perror): Likewise. - - * lisp.h (die, nsberror): Likewise. - -2006-05-29 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * sound.c (alsa_open, alsa_configure, alsa_write): - Move assignment to err out of if-statement. - - * gtkutil.c (menu_nav_ended): New function. - (create_menus): Connect menu_nav_ended to "selection-done" to fix - grabs. - - * xmenu.c (Fmenu_bar_start): New function for USE_GTK and USE_X_TOOLKIT. - -2006-05-28 Dan Nicolaescu <dann@ics.uci.edu> - - * charset.h (invalid_character): Mark as NO_RETURN. - -2006-05-29 Kenichi Handa <handa@m17n.org> - - * coding.c (Ffind_operation_coding_system): Call a function by - safe_call1 instead of call1. - -2006-05-28 Stefan Monnier <monnier@iro.umontreal.ca> - - * window.c (struct saved_window): Add `dedicated'. - (Fset_window_configuration, save_window_save): Save/restore the - `dedicated' flag. - -2006-05-28 Kim F. Storm <storm@cua.dk> - - * xdisp.c (set_cursor_from_row): If cursor cannot be set in row, - don't update w->cursor and return 0. Return 1 on success. - (try_cursor_movement): Repeat set_cursor_from_row on successive rows - until it succeeds. - - * dispextern.h (set_cursor_from_row): Update prototype. - -2006-05-28 Kim F. Storm <storm@cua.dk> - - * xdisp.c (get_phys_cursor_geometry): Return computed x and y through - parameters. Adjust x and width in case cursor in on a partially - visible stretch glyph on the left edge. - (erase_phys_cursor): Don't erase into left fringe/margin in case - previous cursor glyph is a partially visible stretch glyph on left. - - * dispextern.h (get_phys_cursor_geometry): Update prototype. - - * xterm.c (x_draw_stretch_glyph_string): Fix problems with invisible - cursor and erasing cursor on partially visible stretch glyph on left. - (x_draw_hollow_cursor): Compute x via get_phys_cursor_geometry. - - * macterm.c: Likewise. - - * w32term.c: Likewise. - -2006-05-27 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macselect.c (mac_handle_apple_event): - Return errAEEventNotHandled if key binding is not found. - -2006-05-26 Eli Zaretskii <eliz@gnu.org> - - * emacs.c (main) [PROFILING]: Enable also for __MINGW32__. - [__MINGW32__]: MinGW-specific declaration of `etext'. - - * w32heap.c (etext, edata): Remove unused definitions. - -2006-05-26 Chong Yidong <cyd@stupidchicken.com> - - * fileio.c (Fcopy_file): Delete argument MUSTBENEW. - Incorporate the exclusive file-opening functionality into the behavior - when OK-IF-ALREADY-EXISTS is nil. - (Frename_file): Call Fcopy_file without MUSTBENEW argument. - -2006-05-26 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * sound.c (alsa_configure): Move get period/buffer_size after - setting hwparams. - -2006-05-26 Kenichi Handa <handa@m17n.org> - - * coding.c (Ffind_operation_coding_system): Allow (FILENAME - . BUFFER) in TARGET. - -2006-05-25 Chong Yidong <cyd@stupidchicken.com> - - * image.c (png_load): Don't call fclose on NULL. - -2006-05-25 Luc Teirlinck <teirllm@auburn.edu> - - * fns.c (Fyes_or_no_p): - * callint.c (Fcall_interactively): Fread_from_minibuffer now takes - only seven args. - -2006-05-25 Juri Linkov <juri@jurta.org> - - * lisp.h (Fread_from_minibuffer): Decrement number of args. - - * minibuf.c (read_minibuf): Remove arg KEEP_ALL. Callers changed. - (Fread_from_minibuffer): Remove arg KEEP_ALL. Callers changed. - - * buffer.c (mode-line-format): Fix docstring. - -2006-05-25 Richard Stallman <rms@gnu.org> - - * emacs.c (main, Fdump_emacs): Don't test __linux or __linux__. - -2006-05-24 Luc Teirlinck <teirllm@auburn.edu> - - * puresize.h (BASE_PURESIZE): Increase to 1210000. - -2006-05-24 Alan Mackenzie <acm@muc.de> - - * lread.c (Vload_history): Enhance doc-string to say that the file - is the absolute truename of the loaded file. - - * lread.c (Vafter_load_alist): doc-string: state that an element - now has a regexp to match file names, not a file name as such. - - * lread.c (readevalloop): Call file-truename on the name for - load-history, except at preloading time. - - * lread.c (Fload): At preloading time, preserve the extension of - the filename which goes into load-history. New var hist_file_name. - - * lread.c (Fload): Do eval-after-load stuff by calling the lisp - function do-after-load-evaluation. - -2006-05-24 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * mac.c (ae_attr_table): New variable. - (syms_of_mac): Intern and staticpro its elements. - (mac_aelist_to_lisp): Also convert Apple event attributes. - (mac_ae_put_lisp): New function. - (create_apple_event_from_event_ref) [MAC_OSX]: Use typeUTF8Text. - - * macfns.c (Fx_server_version): Use gestaltSystemVersionMajor etc. - - * macselect.c (Qemacs_suspension_id): New variable. - (syms_of_macselect): Intern and staticpro it. - (struct suspended_ae_info): New struct. - (deferred_apple_events, defer_apple_events) - (Fmac_process_deferred_apple_events): Use it. - (suspended_apple_events): New variable. - (mac_handle_apple_event_1): New function. - (mac_handle_apple_event): Use it. Don't process previously - suspended events. - (cleanup_suspended_apple_events, get_suspension_id) - (cleanup_all_suspended_apple_events): New functions. - (init_apple_event_handler): Call cleanup_all_suspended_apple_events - at exit. - (Fmac_cleanup_expired_apple_events, Fmac_ae_set_reply_parameter) - (Fmac_resume_apple_event): New defuns. - (syms_of_macselect): Defsubr them. - - * macterm.c (fn_keycode_to_keycode_table, XTread_socket) [MAC_OSX]: - Fix last change. Don't map `fn' modifier if pressed with F1 ... F12. - - * macterm.h (TYPE_FILE_NAME): Change from macro to enumerator. - (KEY_EMACS_SUSPENSION_ID_ATTR): New enumerator. - (keyReplyRequestedAttr) [MAC_OS_X_VERSION_MAX_ALLOWED < 1030]: Likewise. - (gestaltSystemVersionMajor, gestaltSystemVersionMinor) - (gestaltSystemVersionBugFix) [MAC_OS_X_VERSION_MAX_ALLOWED < 1040]: - Likewise. - (typeUTF8Text, kEventParamWindowMouseLocation) - [MAC_OSX && MAC_OS_X_VERSION_MAX_ALLOWED < 1020]: Likewise. - (x_get_focus_frame, mac_ae_put_lisp): Add externs. - -2006-05-23 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macterm.c (fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove. - (fn_keycode_to_keycode_table) [MAC_OSX]: New variable. - (mac_set_unicode_keystroke_event) [TARGET_API_MAC_CARBON]: New function. - (XTread_socket) [TARGET_API_MAC_CARBON]: Use it. - (XTread_socket) [MAC_OSX]: Try 'uchr' Unicode keyboard-layout - resource to backtranslate key with modifiers. - (XTread_socket): Don't set read_socket_inev around AEProcessAppleEvent. - -2006-05-23 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.c: Remove declarations already in xterm.h. - - * xterm.h: Add extern declarations for x_clear_errors, - x_fully_uncatch_errors, x_catching_errors and - x_alloc_lighter_color_for_widget. Remove duplicated declarations. - -2006-05-21 Richard Stallman <rms@gnu.org> - - * xfaces.c (best_matching_font): Abort for best == NULL - before we start to use it. - - * buffer.c (syms_of_buffer, Fmake_overlay): Doc fixes. - -2006-05-20 Kim F. Storm <storm@cua.dk> - - * xfaces.c (best_matching_font): Fix crash in 2006-05-17 change. - -2006-05-20 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macterm.c (convert_fn_keycode): Fix last change. - -2006-05-19 Eli Zaretskii <eliz@gnu.org> - - * w32.c (init_environment): Perform the processing of environment - variables on a copy of default variables and their values, not on - the original. Simplify code that calls ExpandEnvironmentStrings - and make buf1[] and buf2[] more visible for easier debugging. - -2006-05-19 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * frame.c (x_set_border_width): Remove #ifndef MAC_OS. - - * image.c [MAC_OS] (gif_load): Allocate Lisp string first. - - * macfns.c (Fx_focus_frame): Don't check dpyinfo->x_focus_frame. - - * macterm.c (XTread_socket) [TARGET_API_MAC_CARBON && MAC_OSX]: - Forward keyUp events to toolbox_dispatcher. - - * window.c (foreach_window): Check WINDOWP (FRAME_ROOT_WINDOW (f)). - -2006-05-18 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * config.in: Regenerated (HAVE_ALSA). - - * sound.c (alsa_sound_perror, alsa_open, alsa_period_size) - (alsa_configure, alsa_close, alsa_choose_format, alsa_write) - (snd_error_quiet, alsa_init): New functions. - (vox_init): Return 0 if unable to open device. - (Fplay_sound_internal): Test for alsa first and use vox (oss) as - a fallback. - (struct sound_device): Add period_size. - (wav_play, au_play): Use period_size if set. - - * Makefile.in (CFLAGS_SOUND): New flags for ALSA. - (ALL_CFLAGS): Add CFLAGS_SOUND. - -2006-05-18 Kenichi Handa <handa@m17n.org> - - * callproc.c (Fcall_process): Reject encoding arguments by - ascii-incompatible coding systems (e.g. utf-16). - - * coding.c (Qascii_incompatible): New variable. - (syms_of_coding): Setup Qascii_incompatible. - (setup_coding_system): Be sure to initialize coding->common_flags. - Check `ascii-incompatible' property of the coding system. - - * coding.h (CODING_ASCII_INCOMPATIBLE_MASK): New macro. - -2006-05-18 Kim F. Storm <storm@cua.dk> - - * xdisp.c (display_tool_bar_line): Restore entire tool-bar - geometry when backtracking in case last image doesn't fit on line. - -2006-05-18 MIYOSHI Masanori <miyoshi@meadowy.org> (tiny change) - - * xdisp.c (display_tool_bar_line): Don't adjust tool-bar height by - more than height of one frame default line. - -2006-05-17 Richard Stallman <rms@gnu.org> - - * xfaces.c (better_font_p): Any font beats no font. - (best_matching_font): Simplify based on above change. - - * buffer.c (Fprevious_overlay_change, Fnext_overlay_change): Doc fixes. - -2006-05-16 Kim F. Storm <storm@cua.dk> - - * xterm.c (handle_one_xevent): Check that f is not NULL before - calling x_kill_gs_process. - -2006-05-14 Richard Stallman <rms@gnu.org> - - * textprop.c (Fnext_single_char_property_change) - (Fprevious_single_char_property_change): Don't allow returning - value beyond LIMIT in any cases. - (Fnext_char_property_change, Fprevious_char_property_change): Doc fix. - - * intervals.c (get_local_map): Abort if POSITION outside BEGV, ZV. - -2006-05-14 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.c (handle_one_xevent): Check that f is not NULL before - calling _XEditResCheckMessages. - -2006-05-14 Kim F. Storm <storm@cua.dk> - - * xterm.c (handle_one_xevent): Fix crash in 2006-03-24 change. - -2006-05-13 Eli Zaretskii <eliz@gnu.org> - - * frame.c (x_set_border_width): Fix error message to say "frame", - not "window". - - * Makefile.in (SOME_MACHINE_LISP): Add fringe.elc. - -2006-05-12 Chong Yidong <cyd@stupidchicken.com> - - * intervals.c (set_point_both): Fix mixup before before and after - in variable names. - - * editfns.c (Fline_beginning_position): Inhibit point-motion hooks - while setting point temporarily. - -2006-05-11 Richard Stallman <rms@gnu.org> - - * lread.c (readevalloop): Abort if START non-nil for non-buffer input. - -2006-05-11 Kim F. Storm <storm@cua.dk> - - * xdisp.c (redisplay_tool_bar): Handle large tool-bar-border values. - -2006-05-11 Kenichi Handa <handa@m17n.org> - - * fileio.c (Finsert_file_contents): Fix for the case of IO error - while handling replace operation. - -2006-05-10 Kenichi Handa <handa@m17n.org> - - * xfaces.c (realize_default_face) [HAVE_X_WINDOWS]: If the font - chosen for the default face was different from the frame font, - adjust the frame font. - -2006-05-10 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * image.c (Qduration) [MAC_OS]: Undo previous change. - (syms_of_image) [MAC_OS]: Likewise. - [MAC_OS] (gif_load): Emulate Graphic Control Extension block. - - * macfns.c (x_to_mac_color): Fix shift amount change. - (mac_set_font) [USE_MAC_FONT_PANEL]: Use x_get_focus_frame. - [USE_MAC_FONT_PANEL] (Fmac_set_font_panel_visibility): Doc fix. - - * macselect.c (Vmac_service_selection) [MAC_OSX]: Rename from - Vmac_services_selection. All uses changed. - (mac_store_service_event): Rename from mac_store_services_event in - extern and calls. - - * macterm.c (Qservice) [MAC_OSX]: Rename from Qservices. All uses - changed. - [MAC_OSX] (mac_store_service_event): Rename from - mac_store_services_event. All callers changed. - [USE_MAC_FONT_PANEL] (mac_set_font_info_for_selection): Add args - FACE_ID and C. All callers changed. - (x_free_frame_resources) [USE_MAC_FONT_PANEL]: Call - mac_set_font_info_for_selection when focus frame is destroyed. - (XTread_socket): Revert to FrontNonFloatingWindow/FrontWindow. - - * macterm.h (mac_set_font_info_for_selection): Add 2nd and 3rd - args in extern. - -2006-05-09 Chong Yidong <cyd@stupidchicken.com> - - * keymap.c (describe_map): Avoid generating duplicate entries if - the shadowed binding has the same definition. - -2006-05-09 Kenichi Handa <handa@m17n.org> - - * keymap.c (push_key_description): Handle invalid character key. - -2006-05-08 Kenichi Handa <handa@m17n.org> - - * callproc.c (Fcall_process): Use system_eol_type for encoding - arguments if eol_type is not yet decided. - - * coding.h (system_eol_type): Extern it. - - * coding.c (setup_coding_system): For invalid coding-system, set - coding->eol_type to CODING_EOL_UNDECIDED. - (encode_coding): Cancel previous change. - (shrink_encoding_region): Likewise. - (code_convert_region1): Likewise. - (code_convert_string1): Likewise. - (code_convert_string_norecord): Likewise. - - * fileio.c (choose_write_coding_system): Use system_eol_type for - encoding if eol_type is not yet decided. - - * process.c (setup_process_coding_systems): Use system_eol_type - for encoding if eol_type is not yet decided. - (read_process_output): Likewise. - (send_process): Likewise. - -2006-05-07 Juanma Barranquero <lekktu@gmail.com> - - * minibuf.c (syms_of_minibuf) <history-length>: Fix typo in doc. - -2006-05-07 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * mac.c (Fmac_clear_font_name_table): Move defun to macfns.c. - (syms_of_mac): Likewise for defsubr. - - * macfns.c (mac_set_font): New function. - (mac_frame_parm_handlers, syms_of_macfns): Replace x_set_font with it. - (mac_window) [TARGET_API_MAC_CARBON && MAC_OSX]: Specify - kWindowToolbarButtonAttribute when creating window. - (Fmac_clear_font_name_table): Move from macfns.c. - (syms_of_macfns): Likewise for defsubr. - [USE_MAC_FONT_PANEL] (Fmac_set_font_panel_visibility): New defun. - (syms_of_macfns) [USE_MAC_FONT_PANEL]: Defsubr it. - - * macgui.h (USE_MAC_FONT_PANEL): Define to 1 if USE_ATSUI is set - and build is done on Mac OS X 10.2 and later. - - * macselect.c (mac_do_receive_drag): Remove unused variable `index'. - (mac_store_services_event): Change return type in extern. - - * macterm.c (XLoadQueryFont) [USE_ATSUI]: Set font->mac_fontnum to - FMFontFamily value. - [USE_MAC_FONT_PANEL] (mac_set_font_info_for_selection): New function. - (x_new_focus_frame) [USE_MAC_FONT_PANEL]: Use it. - (QCfamily, QCweight, QCslant, Qnormal, Qbold, Qitalic): Add extern. - (QWindow) [MAC_OSX]: Likewise. - (Qfont) [USE_MAC_FONT_PANEL]: Likewise. - (Vmac_atsu_font_table) [USE_ATSUI]: New variable. - (syms_of_macterm) [USE_ATSUI]: Defvar it. - (Qtoolbar_switch_mode) [MAC_OSX]: New variable. - (Qpanel_closed, Qselection) [USE_MAC_FONT_PANEL]: Likewise. - (syms_of_macterm): Intern and staticpro them. - (init_font_name_table) [USE_ATSUI]: Add data to Vmac_atsu_font_table. - [TARGET_API_MAC_CARBON] (mac_store_event_ref_as_apple_event): - New function. - [USE_CARBON_EVENTS] (mac_handle_command_event): Use it. - [MAC_OSX] (mac_store_services_event): Likewise. - [USE_CARBON_EVENTS] (mac_handle_window_event) [MAC_OSX]: Handle - kEventWindowToolbarSwitchMode event. - (install_window_handler) [USE_CARBON_EVENTS && MAC_OSX]: Register it. - [MAC_OSX] (mac_store_services_event): Change return type to OSStatus. - [USE_MAC_FONT_PANEL] (mac_handle_font_event): New function. - (install_window_handler) [USE_MAC_FONT_PANEL]: Install it. - (XTread_socket): Select window on mouse click if x_focus_frame is NULL. - - * macterm.h (mac_set_font_info_for_selection): Add extern. - -2006-05-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * image.c (Qduration) [MAC_OS]: New variable. - (syms_of_image) [MAC_OS]: Intern and staticpro it. - [MAC_OS] (gif_load): Save image extension data in img->data.lisp_val. - [MAC_OSX] (image_load_quartz2d): Use cfstring_create_with_utf8_cstring - instead of cfstring_create_with_string. - -2006-05-06 Kim F. Storm <storm@cua.dk> - - * .gdbinit (xframe): Print frame name. - (xlist): New command to print a list (max 10 elements). - (xpr): Print lisp object of any type. - (pitx): Print it->pixel_width. - -2006-05-05 Kenichi Handa <handa@m17n.org> - - * xdisp.c (handle_composition_prop): Fix for the case of empty - composition component. - -2006-05-05 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * keyboard.c (make_lispy_event) [MAC_OS]: Get Apple event info - from event->arg. - - * termhooks.h (enum event_kind) [MAC_OS]: Update comment for - MAC_APPLE_EVENT. - - * macterm.h (mac_make_lispy_event_code): Remove extern. - (mac_post_mouse_moved_event): Add extern. - (mac_aelist_to_lisp, mac_aedesc_to_lisp): Change arg 1 to - `const AEDesc *' in externs. - (create_apple_event_from_drag_ref) [TARGET_API_MAC_CARBON]: New extern. - - * mac.c (mac_aelist_to_lisp, mac_aedesc_to_lisp): Change arg 1 to - `const AEDesc *'. - [TARGET_API_MAC_CARBON] (create_apple_event): New function. - [TARGET_API_MAC_CARBON] (create_apple_event_from_event_ref): Use it. - Use xrealloc instead of repeated xmalloc/xfree. - [TARGET_API_MAC_CARBON] (create_apple_event_from_drag_ref): - New function. - - * macmenu.c (restore_menu_items, cleanup_popup_menu): Return a value. - - * macselect.c: Update copyright year. - (mac_store_apple_event): Change return type to void in extern. - (mac_handle_apple_event): Don't get return value from - mac_store_apple_event. - [TARGET_API_MAC_CARBON] (Vmac_dnd_known_types): New variable. - (syms_of_macselect) [TARGET_API_MAC_CARBON]: Defvar it. - [TARGET_API_MAC_CARBON] (mac_do_track_drag): Move function from - macterm.c. Use Vmac_dnd_known_types as acceptable flavors. - [TARGET_API_MAC_CARBON] (mac_do_receive_drag): Likewise. New - implementation using create_apple_event_from_drag_ref. - [TARGET_API_MAC_CARBON] (mac_do_track_dragUPP) - (mac_do_receive_dragUPP): Move variables from macterm.c. - (install_drag_handler, remove_drag_handler): New functions. - - * macterm.c (XTread_socket) [TARGET_API_MAC_CARBON]: Try window - path select also for proxy icon click. - [TARGET_API_MAC_CARBON] (mac_post_mouse_moved_event): New function. - [USE_TOOLKIT_SCROLL_BARS] (scroll_bar_timer_callback): Use it. - (xlfdpat_create): Remove unused label `error' and trailing sentences. - (mac_do_track_drag, mac_do_receive_drag): Move functions to macselect.c. - (mac_do_track_dragUPP, mac_do_receive_dragUPP): Move variables to - macselect.c. - (install_drag_handler, remove_drag_handler): Add extern. - (mac_store_apple_event): Change return type to void. All uses changed. - Create Lisp object from Apple event and store it into input event. - (mac_make_lispy_event_code): Remove function. - [TARGET_API_MAC_CARBON] (mac_store_drag_event): New function. - (install_window_handler): Call install_drag_handler. - (remove_window_handler): Call remove_drag_handler. - -2006-05-03 Richard Stallman <rms@gnu.org> - - * sound.c (Fplay_sound_internal): Dynamically allocate - current_sound_device and current_sound. - (sound_cleanup): Free them. - - * minibuf.c (read_minibuf): Don't use read_minibuf_noninteractive - when inside a keyboard macro. - -2006-05-02 Andreas Schwab <schwab@suse.de> - - * xmenu.c (restore_menu_items): Return a value. - -2006-05-01 Martin Rudalics <rudalics@gmx.at> - - * syntax.c (Fforward_comment): Detect generic comment at beginning of - buffer when moving backwards. - -2006-05-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * dispnew.c (update_window): Don't set changed_p when mode/header - line is updated. - - * xdisp.c (prepare_menu_bars) [MAC_OS]: Call mac_update_title_bar. - (get_glyph_face_and_encoding, get_char_face_and_encoding): - Don't distinguish known faces from others. - - * mac.c (mac_coerce_file_name_ptr): Try typeFSRef if coercion - through typeFileURL failed. - - * macfns.c (mac_update_title_bar): New function. - [TARGET_API_MAC_CARBON] (mac_update_proxy_icon): New function. - (show_hourglass, hide_hourglass) [USE_CG_DRAWING]: - Call mac_prepare_for_quickdraw. - - * macgui.h (USE_ATSUI): Set default to 1 if MAC_OSX is defined. - (USE_CG_DRAWING): Don't define if compiled on Mac OS X 10.1. - (enum pcm_status): New enum. - (XCHARSTRUCTROW_CHAR_VALID_P, XCHARSTRUCTROW_SET_CHAR_VALID) - (XCharStructRow): Remove. Now validity is represented by - non-negativeness of sum of ascent and descent. - (struct MacFontStruct): Change type of member `rows'. - (struct _XGC) [USE_CG_DRAWING]: Add member `clip_rects'. - - * macterm.c (mac_draw_line, mac_draw_line_to_pixmap): - Adjust endpoints of strictly horizontal/vertical lines. - (mac_set_clip_rectangles) [USE_CG_DRAWING]: Set clip_rects. - (pcm_init, pcm_get_status): New functions. - (x_per_char_metric, XLoadQueryFont): Use them instead of - XCharStructRow and related macros. - (x_draw_relief_rect): Don't adjust arguments of mac_draw_line. - (x_free_frame_resources) [TARGET_API_MAC_CARBON]: Free FRAME_FILE_NAME. - (XTread_socket) [TARGET_API_MAC_CARBON]: Handle proxy icon drag - and window path pop-up menu on title bar. - (mac_use_core_graphics) [USE_CG_DRAWING]: Set default to 1. - - * macterm.h (mac_update_title_bar): Add extern. - (struct mac_output) [TARGET_API_MAC_CARBON]: New member `file_name'. - (FRAME_FILE_NAME): New macro. - - * unexmacosx.c (unexec): Error if trying unexec from dumped executable. - -2006-04-30 Richard Stallman <rms@gnu.org> - - * keymap.c (Fdefine_key): Improve error message - when KEY begins with a non-prefix key. - -2006-04-30 Martin Rudalics <rudalics@gmx.at> - - * syntax.c (Fforward_comment): Don't forget to break out of the loop - when we skipped backward over a generic comment. - -2006-04-27 Nick Roberts <nickrob@snap.net.nz> - - * .gdbinit (pp1, pv1): Only print value as expression is now - printed out by gud-print. - (pv1): Correct doc string. - -2006-04-26 Stefan Monnier <monnier@iro.umontreal.ca> - - * keymap.c (store_in_keymap): Change `def' arg to not be `register'. - Seems to trigger a bug in gcc-amd64 4.0.2 20051125 (Red Hat 4.0.2-8): - keymap.c:895: error: address of register variable `def' requested. - -2006-04-26 Jason Rumney <jasonr@gnu.org> - - * w32term.c (construct_mouse_wheel): Handle negative coordinates. - - * w32fns.c (w32_wnd_proc) <WM_LBUTTONDOWN, WM_RBUTTONDOWN>: - <WM_LBUTTONUP, WM_RBUTTONUP>: Call signal_user_input in the cases - where we preempt mouse_button_timer. - -2006-04-25 Miles Bader <miles@gnu.org> - - * editfns.c (Ffield_beginning, find_field): Undo change of 2006-04-23. - -2006-04-24 Stefan Monnier <monnier@iro.umontreal.ca> - - * process.h: Include headers for pid_t. - -2006-04-24 Kim F. Storm <storm@cua.dk> - - * xdisp.c (fill_stretch_glyph_string): Set s->nchars = 1 for code which - does last_glyph=s->first_glyph+s->nchars-1, e.g. if stretch has relief. - (produce_stretch_glyph): Assume that face box height and width is - already included in stretch glyph size so caller doesn't have to - consider the extra space otherwise added (fixes problem in ses.el). - - * frame.c (x_set_font): Clear f->n_tool_bar_rows and current frame - matrices to force recalculation of tool-bar height after font change. - - * xdisp.c (tool_bar_lines_needed): New local `temp_row' for clarity. - Clear it when done, so we don't accidentally draw a second copy of - the tool-bar after resetting f->n_tool_bar_rows. - (redisplay_tool_bar): Update tool-bar-lines frame parameter whenever - we recalculate f->n_tool_bar_rows. - -2006-04-23 Lars Hansen <larsh@soem.dk> - - * editfns.c (find_field): Fix comment. - (Ffield_beginning): Fix bug when POS is at field beginning. - -2006-04-22 Eli Zaretskii <eliz@gnu.org> - - * puresize.h (BASE_PURESIZE): Increase to 1205000. - -2006-04-21 Kim F. Storm <storm@cua.dk> - - * xdisp.c (redisplay_window): Fix last change. Don't recenter if - window start is at BEGV. - - * dispextern.h (struct image): New member `corners'. - (TOP_CORNER, LEFT_CORNER, BOT_CORNER, RIGHT_CORNER): New macros. - - * image.c (four_corners_best): New arg CORNERS specifies what pixels - to look at in case image has margin. - (x_create_bitmap_mask): Pass NULL for CORNERS to four_corners_best. - (image_background, image_background_transparent) - (x_build_heuristic_mask): Pass img->corners to four_corners_best. - (gif_load): Set img->corners according to image's margin spec. - Use img->corners values directly where applicable. - Save image extension data in img->data.lisp_val. - (gif_clear_image): New function to free img->data.lisp_val. - (gif_type): Use it instead of generic x_clear_image. - (Fimage_extension_data): New defun. - (syms_of_image): Defsubr it. - -2006-04-21 John Sullivan <john@wjsullivan.net> (tiny change) - - * window.c (Fdisplay_buffer): Doc fix. - -2006-04-21 Eli Zaretskii <eliz@gnu.org> - - * s/ms-w32.h (SYSTEM_PURESIZE_EXTRA): Increase to 25000. - -2006-04-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * image.c [MAC_OS] (xpm_load_image): Fill in background field - while we have ximg handy. - - * macmenu.c (restore_menu_items, save_menu_items): New functions - from xmenu.c. - (set_frame_menubar, digest_single_submenu): Apply 2006-04-18 - changes for xmenu.c. - - * macterm.c (x_per_char_metric): Return NULL if glyph width is 0. - (add_mac_font_name): New function. - (init_font_name_table): Use it. Adopt the first found font from - those having the same family name. - -2006-04-21 Nick Roberts <nickrob@snap.net.nz> - - * xdisp.c (note_mouse_highlight): Use build_string. - -2006-04-20 Lars Hansen <larsh@soem.dk> - - * textprop.c (Fremove_list_of_text_properties): - Ensure modify_region is called only when buffer is modified and that - signal_after_change is allways called in that case. - - * print.c (PRINTFINISH): Call signal_after_change. - -2006-04-20 Kim F. Storm <storm@cua.dk> - - * xdisp.c (redisplay_window): Fix last change. - - * xdisp.c (redisplay_window): If current window start is not at the - beginning of a line, select a new window start if buffer is modified - and window start is in the modified region, but the first change is - before window start. - -2006-04-18 Richard Stallman <rms@gnu.org> - - * xmenu.c (restore_menu_items, save_menu_items): New fns. - (set_frame_menubar): Use save_menu_items. Save updated vector in - the frame before unwinding it. Don't use unuse_menu_items. - Don't use discard_menu_items. - (digest_single_submenu): Abort if an item is not in a pane. - (init_menu_items): Put the error check at the top. - - * keymap.c (describe_map): Make "shadowed" warning more verbose. - - * window.c (adjust_window_trailing_edge): Correctly distinguish - series vs parallel cases, even when window has no parent. - - * abbrev.c (record_symbol): New function. - (Finsert_abbrev_table_description): Sort the abbrevs alphabetically. - -2006-04-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * image.c (x_create_bitmap_from_data) [MAC_OS]: Don't check return - value of xmalloc. - - * mac.c (mac_coerce_file_name_ptr, mac_coerce_file_name_desc) - (create_apple_event_from_event_ref, xrm_get_preference_database) - (cfstring_create_normalized): Don't check return value of xmalloc. - - * macselect.c (get_scrap_target_type_list, defer_apple_events) - (copy_scrap_flavor_data, mac_handle_service_event): Don't check - return value of xmalloc/xrealloc. - - * macterm.c (XCreateGC, x_per_char_metric, xlfdpat_create) - (init_font_name_table, init_font_name_table, mac_do_list_fonts) - (XLoadQueryFont, mac_store_apple_event): Don't check return value - of xmalloc. - -2006-04-17 Kim F. Storm <storm@cua.dk> - - * window.c (coordinates_in_window): On the vertical border, - calculate the row number measured from the top of the window, not - the top of the frame. - (window_loop): Test w->dedicated with !NILP instead of EQ Qt. - (window_scroll_pixel_based): Fix off-by-one bug in 2002-12-23 change. - -2006-04-16 Eli Zaretskii <eliz@gnu.org> - - * s/ms-w32.h (SYSTEM_PURESIZE_EXTRA): Reduce to 24000. - -2006-04-16 Romain Francoise <romain@orebokech.com> - - * puresize.h (BASE_PURESIZE): Decrement back to 1200000. - -2006-04-16 Andreas Schwab <schwab@suse.de> - - * puresize.h (PURESIZE_RATIO): Reduce to 10/6. - -2006-04-15 Romain Francoise <romain@orebokech.com> - - * puresize.h (BASE_PURESIZE): Increment to 1210000. - -2006-04-13 Micha,Ak(Bl Cadilhac <michael.cadilhac@lrde.org> - - * print.c (Fprin1_to_string): Mention in the `doc' that the - behavior is modified by `print-level' and `print-length'. - -2006-04-13 Kenichi Handa <handa@m17n.org> - - * coding.c (setup_coding_system): If eol-type is not yet decided - and system_eol_type is not LF, set CODING_REQUIRE_ENCODING_MASK. - If coding_system is nil, return 0. - (code_convert_region1): Even if coding_system is nil, don't skip - conversion if system_eol_type is not LF. - (code_convert_string1): Likewise. - (code_convert_string_norecord): Likewise. - -2006-04-13 Kenichi Handa <handa@m17n.org> - - * coding.c (setup_coding_system): Fix previous change. - (encode_coding): If eol_type is not yet decided, use system_eol_type. - (shrink_encoding_region): If eol_type is not yet decided and - system_eol_type is not LF, don't shrink. - -2006-04-13 Nick Roberts <nickrob@snap.net.nz> - - * xdisp.c (note_mouse_highlight): Add help echo for dragging vertical - line. - -2006-04-12 Richard Stallman <rms@gnu.org> - - * keyboard.c (read_key_sequence): Explicitly avoid keybuf[-1]. - - * process.c (conv_lisp_to_sockaddr): If FAMILY unknown, just return. - (Fprocess_send_eof): Abort if fail to open null device. - -2006-04-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * fns.c [HAVE_MENUS && MAC_OS]: Include macterm.h. - - * image.c [MAC_OS] (xpm_load_image): Add parentheses around - assignment used as truth value. Add explicit braces to avoid - ambiguous `else'. - [MAC_OS] (gif_load): Remove unused variable `gcpro1'. - - * lisp.h (syms_of_fontset, Fset_fontset_font): Put extern and - EXFUN in #ifdef HAVE_WINDOW_SYSTEM. - (syms_of_xfns, syms_of_xsmfns, syms_of_xselect, syms_of_xterm): - Put externs in #ifdef HAVE_X_WINDOWS. - (syms_of_macfns, syms_of_macselect, syms_of_macterm) - (syms_of_macmenu, syms_of_mac) [MAC_OS]: Add externs. - (init_mac_osx_environment) [MAC_OSX]: Add extern. - - * mac.c (init_process): Remove undef. - (select) [MAC_OSX]: Undefine before including sysselect.h. - (posix_pathname_to_fsspec, fsspec_to_posix_pathname) [MAC_OSX]: - Remove functions and prototypes. - (parse_value): Add parentheses around + inside shift. - (path_from_vol_dir_name): Make static. - (get_temp_dir_name): Remove unused variables `cpb' and `dir_name'. - [!MAC_OSX] (get_path_to_system_folder): Likewise. - (Fmac_get_file_creator, Fmac_get_file_type): Remove unused - variable `cCode'. - (Fmac_coerce_ae_data): Remove unused variables `fref' and `fs'. - (Fmac_get_preference): Add explicit braces to avoid ambiguous `else'. - - * macfns.c (x_to_mac_color): Remove unused variable `tail'. - (x_set_mouse_color): Remove unused variable `dpy'. - (Fx_create_frame): Remove unused variable `x_frame_count'. - (Fx_server_version): Add explicit braces to avoid ambiguous `else'. - (x_sync): Move from macterm.c. - (Fx_file_dialog): Remove unused variable `default_filter_index'. - - * macmenu.c (min_menu_id): Make element type explicit. - - * macselect.c (get_flavor_type_from_symbol): Remove unused - variable `val'. - (get_scrap_private_timestamp, x_get_foreign_selection) - (copy_scrap_flavor_data): Add explicit braces to avoid ambiguous `else'. - (Fmac_process_deferred_apple_events): Remove unused variables - `keyword', `reply', `apple_event', `count', and `err'. - - * macterm.c: Don't include gnu.h. - (x_io_error_quitter, x_draw_image_foreground_1): Remove prototypes. - (x_sync): Move to macfns.c. - [USE_CG_DRAWING] (mac_define_fringe_bitmap): Remove unused - variable `mask_bits'. - (mac_compute_glyph_string_overhangs): Avoid ambiguous `else'. - (x_draw_image_glyph_string): Remove unused variable `pixmap'. - (x_mac_to_emacs_modifiers): Remove function. - (XTset_vertical_scroll_bar, mac_handle_visibility_change) - (x_make_frame_visible, xlfdpat_create, mac_handle_command_event): - Add explicit braces to avoid ambiguous `else'. - (x_make_frame_visible): Remove unused variables `type', - `original_top', and `original_left'. - (mac_do_list_fonts, XTread_socket): Add parentheses around && within ||. - (x_load_font): Remove unused variables `full_name', and `value'. - (do_get_menus, do_init_managers, do_check_ram_size) [!MAC_OS8]: - Remove functions. - (do_zoom_window): Reorganize variables with respect to conditionals. - (init_command_handler): Remove unused variable `err'. - [MAC_OSX] (mac_check_bundle): Remove unused variable `child'. - - * macterm.h (x_set_mouse_position, x_set_mouse_pixel_position) - (x_make_frame_invisible, x_iconify_frame, x_free_frame_resources) - (x_destroy_window, x_wm_set_size_hint, x_delete_display, XFreeGC) - (do_menu_choice, have_menus_p, x_real_positions) - (x_set_menu_bar_lines, x_pixel_width, x_pixel_height, x_char_width) - (x_char_height, x_sync, x_set_tool_bar_lines, x_activate_menubar) - (free_frame_menubar): Add externs. - - * unexmacosx.c: Include config.h before using HAVE_MALLOC_MALLOC_H. - (malloc, realloc, free): Add undefs. - (read_load_commands): Remove unused variable `n' and `j'. - (copy_data_segment): Remove unused variable `r'. - - * xdisp.c (get_glyph_string_clip_rects): Add parentheses around && - within ||. Add explicit braces to avoid ambiguous `else'. - (dump_glyph_row): Remove label for `inverse_p' from legend. - - * xfaces.c (Finternal_merge_in_global_face, try_font_list): - Add explicit braces to avoid ambiguous `else'. - -2006-04-11 Micha,Ak(Bl Cadilhac <michael.cadilhac@lrde.org> - - * dispnew.c (init_display): Don't init X display if the user asked - for a non-X display. - -2006-04-12 Kenichi Handa <handa@m17n.org> - - * coding.c (setup_coding_system): Use system_eol_type for default - coding->eol_type. - -2006-04-11 Dan Nicolaescu <dann@ics.uci.edu> - - * lisp.h (wrong_type_argument): Mark as NO_RETURN. - - * data.c (wrong_type_argument): Try to avoid compiler warnings due - to the fact the function is now marked as NO_RETURN. - -2006-04-10 Eli Zaretskii <eliz@gnu.org> - - * s/ms-w32.h (pid_t) [_MSC_VER]: New typedef. - -2006-04-10 Romain Francoise <romain@orebokech.com> - - * xrdb.c (gethomedir): Use xstrdup. - -2006-04-10 Andreas Schwab <schwab@suse.de> - - * xrdb.c (gethomedir): Make sure to always return a pointer that - can be passed to free. - -2006-04-09 Richard Stallman <rms@gnu.org> - - * lisp.h (Fkill_emacs): Undo previous change. - -2006-04-08 Richard Stallman <rms@gnu.org> - - * search.c (boyer_moore): Test ch >= 0400, not >. - -2006-04-09 Dan Nicolaescu <dann@ics.uci.edu> - - * puresize.h (pure_write_error): Mark as NO_RETURN. - - * lisp.h (args_out_of_range, args_out_of_range_3, Fkill_emacs): - Likewise. - -2006-04-08 Eli Zaretskii <eliz@gnu.org> - - * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Ignore mouse movements - if a menu is active on this frame. - -2006-04-08 Dan Nicolaescu <dann@ics.uci.edu> - - * lisp.h (report_file_error): Mark as NO_RETURN. - -2006-04-08 Eli Zaretskii <eliz@gnu.org> - - * alloc.c [STDC_HEADERS]: Include stddef.h. - - * lisp.h (PSEUDOVECSIZE): Fix last change. - -2006-04-08 Stefan Monnier <monnier@iro.umontreal.ca> - - * process.h (struct Lisp_Process): Replace Lisp_Objects `pid', - `raw_status_high', and `raw_status_low' with plain integers, and move - them to the end of the structure. - - * alloc.c (allocate_process): Use PSEUDOVECSIZE to initialize the - pseudovector's size field so only the Lisp_Object fields get GC'd. - - * process.c (update_status, make_process, Fdelete_process) - (Fprocess_status, list_processes_1, start_process_unwind) - (create_process, Fmake_network_process, server_accept_connection) - (wait_reading_process_output, send_process, Fprocess_running_child_p) - (process_send_signal, proc_encode_coding_system, Fprocess_send_eof) - (sigchld_handler, status_notify): Adjust to new non-Lisp fields for - `pid' and `raw_status'. - (Fprocess_id, Fsignal_process): Same, and additionally use floats when - representing PIDs that are larger than most-positive-fixnum. - - * keymap.c (describe_map): Only use XINT if we checked INTEGERP. - - * lisp.h (OFFSETOF, PSEUDOVECSIZE): New macros. - -2006-04-08 Eli Zaretskii <eliz@gnu.org> - - * w32fns.c (Fx_show_tip): Add 3 to the 5th arg of SetWindowPos. - -2006-04-03 Paul Eggert <eggert@cs.ucla.edu> - - * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): New macro, identical to - ../lib-src/b2m.c and ../lib-src/editfns.c. - (Fcurrent_time_string): Use it. - Document that the year might not consume 4 columns if it's outside - the range 1000-9999. - Check for asctime failure. - Don't assume that the output string length is always exactly 24. - -2006-04-03 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macterm.c (XTread_socket): Initialize variable `f' before its use. - -2006-04-03 Kenichi Handa <handa@m17n.org> - - * image.c: Include "charset.h" and "coding.h". - (x_find_image_file): Return an encoded file name. - -2006-04-01 Eli Zaretskii <eliz@gnu.org> - - * configure: Regenerated. - -2006-03-31 Kenichi Handa <handa@m17n.org> - - * xfns.c (xg_set_icon): Delete superfluous UNGCPRO. - -2006-03-30 Dan Nicolaescu <dann@ics.uci.edu> - - * xdisp.c (syms_of_xdisp): Fix variable name. - -2006-03-30 Kenichi Handa <handa@m17n.org> - - * xterm.c (x_term_init): Delete superfluous UNGCPRO. - -2006-03-29 Juanma Barranquero <lekktu@gmail.com> - - * keyboard.c (process_tool_bar_item): Reorder dummy args. - -2006-03-29 Stefan Monnier <monnier@iro.umontreal.ca> - - * keyboard.c (tool_bar_items): Use map_keymap. - (process_tool_bar_item): Add dummy args to fit the required interface. - -2006-03-25 Eli Zaretskii <eliz@gnu.org> - - * .gdbinit (pr, pp, pp1, pv, pv1): Force print_output_debug_flag - to zero before calling debug_print or safe_debug_print. - - * print.c (print_output_debug_flag): New global variable. - (Fexternal_debugging_output) [WINDOWSNT]: Don't call - OutputDebugString if print_output_debug_flag is zero. - -2006-03-24 Paul Eggert <eggert@cs.ucla.edu> - - * editfns.c (TM_YEAR_BASE): Move up, so the changes below can use it. - (Fdecode_time, Fencode_time): Use TM_YEAR_BASE instead of 1900. - (Fdecode_time): Cast tm_year to EMACS_INT. - (Fcurrent_time_string): Report an invalid time specification if - the argument is invalid. Also, check for out-of-range time stamps. - -2006-03-24 Kim F. Storm <storm@cua.dk> - - * xterm.c (handle_one_xevent): - * w32term.c (w32_read_socket): - * macterm.c (XTread_socket): Don't let key-press clear mouse face - on in toolbar window if mouse-highlight is an integer. - - * fns.c (sxhash_list): Include last non-nil CDR in hash. - -2006-03-24 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macmenu.c (enum mac_menu_kind): New enum. - (min_menu_id): New variable. - (POPUP_SUBMENU_ID, MIN_POPUP_SUBMENU_ID, MIN_MENU_ID) - (MIN_SUBMENU_ID): Remove defines. All uses are replaced with - min_menu_id and enumerators in enum mac_menu_kind. - (fill_menu, dispose_menus, install_menu_quit_handler): New arg KIND. - All uses changed. Add range check for menu ID. - (fill_menubar): Add range check for menu ID. - [HAVE_CANCELMENUTRACKING] (menu_quit_handler): Check error code of - GetEventParameter. - (set_frame_menubar, mac_menu_show): Call install_menu_quit_handler - for each menu kind. - -2006-03-22 Kim F. Storm <storm@cua.dk> - - * xdisp.c: Undo 2006-03-21 change. - - * term.c: Define aliases for append_glyph and produce_stretch_glyph - when `static' is defined to avoid name clash with those in xdisp.c. - - * process.c (Faccept_process_output): Fix to comply with lisp - reference. Change arg "timeout" to "seconds" and allow both - integer and float value. Change arg "timeout-msec" to "millisec" - and interpret" as milliseconds rather than microseconds. Fix doc - string accordingly. - -2006-03-21 Ken Raeburn <raeburn@raeburn.org> - - * xdisp.c (store_next_glyph): Rename from append_glyph. - (generate_stretch_glyph): Rename from produce_stretch_glyph. - All callers changed accordingly. - -2006-03-21 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.c: x_session_initialized new variable. - (x_term_init): Use x_session_initialized to check if - x_session_initialize should be called. - (x_initialize): Initialize x_session_initialized. - -2006-03-21 Kim F. Storm <storm@cua.dk> - - * fringe.c (draw_fringe_bitmap): Don't calculate default overlay arrow - bitmap here, but ... - (update_window_fringes): ... here, so we can test if it has changed. - -2006-03-20 Andreas Schwab <schwab@suse.de> - - * dispnew.c (init_display): Check DISPLAY here. - - * emacs.c (main): Don't check here. - - * xterm.c (x_display_ok): Don't use DISPLAY env var. - -2006-03-20 Stefan Monnier <monnier@iro.umontreal.ca> - - * window.c (window_scroll_pixel_based): Yet another int/Lisp_Object - mixup (YAILOM). - -2006-03-20 Eli Zaretskii <eliz@gnu.org> - - * emacs.c (main): Fix last change. - -2006-03-20 Kenichi Handa <handa@m17n.org> - - * fileio.c (Fwrite_region): Set visit_file to Qnil before GCPRO it. - - * keymap.c (map_keymap): Set tail to Qnil before GCPRO it. - - * xfns.c (xg_set_icon): Remove unnecessary GCPRO. - - * xterm.c (x_term_init): Remove unnecessary GCPRO. - -2006-03-19 Kim F. Storm <storm@cua.dk> - - * xdisp.c (set_cursor_from_row): Fix cursor property on overlay string, - so it doesn't associate overlay string with following glyph by default. - Allow integer property value to specify explicit number of buffer - positions associate with overlay string. - -2006-03-18 Chong Yidong <cyd@stupidchicken.com> - - * xterm.c (x_display_ok): Fix minor bug and compilation warnings. - -2006-03-18 Nozomu Ando <nand@mac.com> - - * m/pmax.h (BROKEN_NOCOMBRELOC) [__NetBSD__]: Define. - (LIB_STANDARD, START_FILES) [__NetBSD__]: Don't define. - (START_FILES, RUN_TIME_REMAP, UNEXEC) [__NetBSD__, __OpenBSD__]: - Don't redefine. - - * m/mips.h: Don't use unexmips on NetBSD. - (LIBS_MACHINE): Move definition lower, so it doesn't use - LD_SWITCH_MACHINE, START_FILES, LIB_STANDARD, LIBS_TERMCAP, - C_SWITCH_MACHINE, and C_DEBUG_SWITCH. - - * unexelf.c [BROKEN_NOCOMBRELOC]: Include assert.h. - (unexec) [BROKEN_NOCOMBRELOC]: Handle platforms whose nocombreloc - option is broken (e.g., MIPS/NetBSD). - -2006-03-18 Craig McDaniel <craigmcd@gmail.com> (tiny change) - - * sheap.c (STATIC_HEAP_SIZE): Enlarge STATIC_HEAP_SIZE to 12MB. - Remove the HAVE_X_WINDOWS conditional. - -2006-03-18 Vivek Dasmohapatra <vivek@etla.org> (tiny change) - - * emacs.c (main): If user asks for a display that is unavailable, - simulate -nw. - - * xterm.c (x_display_ok): New function. - - * xterm.h: Add prototype for x_display_ok. - -2006-03-18 Eli Zaretskii <eliz@gnu.org> - - * w32fns.c (Fw32_select_font): Doc fix. - -2006-03-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * image.c [MAC_OS] (XPutPixel, XGetPixel) - [!WORDS_BIG_ENDIAN && USE_CG_DRAWING]: Don't use specialized - version when depth is 32. - (mac_create_cg_image_from_image) [MAC_OS && USE_CG_DRAWING]: - New function. - (prepare_image_for_display) [MAC_OS && USE_CG_DRAWING]: Use it. - (x_clear_image_1) [MAC_OS && USE_CG_DRAWING]: Release CGImage. - - * macterm.c (XCreatePixmap) [!WORDS_BIG_ENDIAN && USE_CG_DRAWING]: - Create GWorld in ARGB pixel format. - (mac_copy_area, mac_copy_area_with_mask) [USE_CG_DRAWING]: - Remove functions. - (x_draw_image_foreground) [USE_CG_DRAWING]: Use mac_draw_cg_image - instead of mac_copy_area/mac_copy_area_with_mask. - -2006-03-15 Kim F. Storm <storm@cua.dk> - - * xdisp.c (extend_face_to_end_of_line): Always add space glyph to - empty row. Fixes memory corruption revealed by 2006-03-02 change. - (display_tool_bar_line): Skip empty tool-bar line if HEIGHT < 0. - (tool_bar_lines_needed): Fix tool-bar display in case the tool-bar - width is exactly the same as the window width. Don't count a final - empty tool-bar line (pass HEIGHT = -1 to display_tool_bar_line). - -2006-03-15 Juanma Barranquero <lekktu@gmail.com> - - * fringe.c (w32_init_fringe, w32_reset_fringes): Revert to being - conditional on HAVE_NTGUI, not WINDOWS_NT. - -2006-03-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * dispextern.h (mac_init_fringe) [MAC_OS]: Add prototype. - - * fringe.c (mac_init_fringe) [MAC_OS]: New function. - - * macterm.c (mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe. - (max_fringe_bmp, fringe_bmp) [USE_CG_DRAWING]: New variables. - (mac_define_fringe_bitmap, mac_destroy_fringe_bitmap) - (mac_draw_cg_image) [USE_CG_DRAWING]: New functions. - (mac_draw_bitmap) [USE_CG_DRAWING]: Remove function. - (x_draw_fringe_bitmap) [USE_CG_DRAWING]: Use mac_draw_cg_image - instead of mac_draw_bitmap. - (x_redisplay_interface) [USE_CG_DRAWING]: Set handlers for - define_fringe_bitmap and destroy_fringe_bitmap. - -2006-03-14 Chong Yidong <cyd@stupidchicken.com> - - * xterm.c (x_uncatch_errors): Block input for entire function. - -2006-03-12 Jason Rumney <jasonr@gnu.org> - - * w32fns.c (Fx_create_frame): Remove call to - Qface_set_after_frame_default (from xfns.c 2003-05-26). - - * w32menu.c (Fx_popup_menu): Call w32_free_menu_strings when - finished with the menu. - - * w32term.c: Sync 2005-10-24 xterm.c changes. - (last_mouse_glyph_frame): New var. - (note_mouse_movement): Say mouse moved if current frame differs - from last_mouse_glyph_frame, and update last_mouse_glyph_frame. - (w32_mouse_position): Set last_mouse_glyph_frame. - Remove OLD_REDISPLAY_CODE block. - -2006-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macgui.h [USE_ATSUI && MAC_OSX]: Define USE_CG_TEXT_DRAWING to 1. - - * macterm.h (struct mac_output) [USE_CG_DRAWING]: New member cg_context. - (mac_prepare_for_quickdraw) [USE_CG_DRAWING]: Add prototype. - - * mac.c (sys_select) [USE_CG_DRAWING]: Call mac_prepare_for_quickdraw. - - * macfns.c (x_create_tip_frame): Apply 2006-03-11 change for xfns.c. - - * macterm.c (mac_draw_rectangle, x_draw_glyph_string_foreground) - (x_draw_composite_glyph_string_foreground) - (x_draw_image_foreground): Undo previous changes. - (x_draw_hollow_cursor): Likewise. Subtract 1 from the last - argument of mac_draw_rectangle. - (CG_SET_FILL_COLOR, CG_SET_STROKE_COLOR): New macros. - (mac_draw_string_common, mac_draw_image_string_cg): Use them. - (FRAME_CG_CONTEXT) [USE_CG_DRAWING]: New macro. - (mac_begin_cg_clip, mac_end_cg_clip, mac_prepare_for_quickdraw) - [USE_CG_DRAWING]: New functions. - (mac_draw_line, mac_erase_rectangle, mac_clear_window) - (mac_fill_rectangle, mac_draw_rectangle, mac_draw_string_common) - (mac_draw_image_string_cg) [USE_CG_DRAWING]: Add Quartz 2D drawing part. - (mac_draw_bitmap, mac_invert_rectangle, mac_draw_string_common) - (mac_copy_area, mac_scroll_area, x_scroll_bar_create) - (x_scroll_bar_remove, XTset_vertical_scroll_bar, x_set_window_size) - (XTread_socket) [USE_CG_DRAWING]: Call mac_prepare_for_quickdraw. - -2006-03-12 L$,1 q(Brentey K,Aa(Broly <lorentey@elte.hu> - - * xfns.c (x_icon): Disable redundant call to `x_wm_set_window_state'. - -2006-03-11 Jason Rumney <jasonr@gnu.org> - - * w32fns.c (signal_user_input): New function. - (post_character_message): Use it for keyboard input. - (w32_msg_pump): Use it for mouse input. - -2006-03-11 Luc Teirlinck <teirllm@auburn.edu> - - * window.c: Rename preserve_y to window_scroll_pixel_based_preserve_y. - (window_scroll_pixel_based, syms_of_window): Adapt to above change. - -2006-03-11 Eli Zaretskii <eliz@gnu.org> - - * w32fns.c (w32_wnd_proc): Ignore middle and extra button events - if a menu is already active (the menubar_active flag is on). - -2006-03-11 David Ponce <david@dponce.com> - - * xfns.c (x_create_tip_frame): Preserve received parms by copying them. - -2006-03-11 Eli Zaretskii <eliz@gnu.org> - - * w32term.c: Add x_fully_uncatch_errors and x_catching_errors to - the list of unused display error handling functions. - - * eval.c (unwind_to_catch): Call x_fully_uncatch_errors only if - HAVE_X_WINDOWS. - (internal_condition_case, internal_condition_case_1) - (internal_condition_case_2): Call x_catching_errors only if - HAVE_X_WINDOWS. - - * vm-limit.c [HAVE_GETRLIMIT]: Don't define unconditionally. - Don't include sys/resource.h unless defined. - -2006-03-11 Richard Stallman <rms@gnu.org> - - * keymap.c (describe_map): Shorten string to indicate shadowed binding. - - * vm-limit.c (get_lim_data, lim_data, data_space_start): - Move from mem-limits.h. - (enum warnlevel): New data type. - (check_memory_limits): Rewrite the logic about warnings. - Use standard `struct rlimit'. Check return values for nonsense. - (memory_warnings): Always clear lim_data. - - * mem-limits.h (get_lim_data, lim_data, data_space_start): - Move to vm-limit.c. - - * xterm.c (x_fully_uncatch_errors, x_catching_errors): New functions. - - * eval.c (unwind_to_catch): Call x_fully_uncatch_errors. - (internal_condition_case_1, internal_condition_case_2): - Abort if within unclosed x_catch_errors. - -2006-03-11 Romain Francoise <romain@orebokech.com> - - * process.c (Vprocess_adaptive_read_buffering): Doc fix. - -2006-03-11 Giorgos Keramidas <keramida@ceid.upatras.gr> (tiny change) - - * lisp.h: Remove duplicate prototypes. Make the prototype of - getloadavg be conditioned on HAVE_GETLOADAVG being undefined. - -2006-03-11 Eli Zaretskii <eliz@gnu.org> - - * xterm.c (x_draw_hollow_cursor): Subtract 1 from the last - argument of XDrawRectangle. - - * xdisp.c (get_phys_cursor_geometry): Don't decrease height by 1. - - * macterm.c (mac_draw_rectangle): Don't add 1 to width and height. - (x_draw_glyph_string_foreground) - (x_draw_composite_glyph_string_foreground) - (x_draw_image_foreground): Don't subtract 1 from width and height - arguments to mac_draw_rectangle. - (x_draw_hollow_cursor): Add 1 to w->phys_cursor_width. - -2006-03-10 Kim F. Storm <storm@cua.dk> - - * alloc.c (USE_POSIX_MEMALIGN): Fix last change. - -2006-03-09 Stefan Monnier <monnier@iro.umontreal.ca> - - * alloc.c (USE_POSIX_MEMALIGN): New macro. - (ABLOCKS_BASE, lisp_align_malloc, lisp_align_free): Use it. - -2006-03-09 Kenichi Handa <handa@m17n.org> - - * coding.c (DECODE_EMACS_MULE_COMPOSITION_CHAR): Fix decoding - ASCII component of a composition. - -2006-03-08 Luc Teirlinck <teirllm@auburn.edu> - - * window.c: Declare preserve_y as a static global variable. - (window_scroll_pixel_based): No longer declare preserve_y; - it is global now. - (syms_of_window): Set preserve_y to -1. - -2006-03-08 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * image.c [MAC_OS] (XPutPixel): Set alpha channel bits if pixmap - depth is 32. - [MAC_OS] (XGetPixel): Strip off alpha channel bits if pixmap - depth is 32. - -2006-03-06 Chong Yidong <cyd@stupidchicken.com> - - * xdisp.c (handle_invisible_prop): Don't update it->position with - a buffer position if we're in a display string. - -2006-03-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macterm.h (MAC_AQUA_VERTICAL_SCROLL_BAR_WIDTH) - (MAC_AQUA_SMALL_VERTICAL_SCROLL_BAR_WIDTH): New defines. - - * macfns.c (x_default_scroll_bar_color_parameter) - (x_set_scroll_bar_foreground, x_set_scroll_bar_background): - Remove unnecessary prototypes. - (x_set_scroll_bar_default_width): - Use MAC_AQUA_VERTICAL_SCROLL_BAR_WIDTH. - (mac_set_scroll_bar_width): New function. - (mac_frame_parm_handlers): Set it as handler for scroll-bar-width. - - * macterm.c (get_control_part_bounds): Fix type of return value. - (x_set_toolkit_scroll_bar_thumb, x_scroll_bar_create) - (XTset_vertical_scroll_bar) [USE_TOOLKIT_SCROLL_BARS]: Don't show - scroll bar if it is not tall enough to display scroll bar thumb. - [USE_CARBON_EVENTS] (mac_convert_event_ref) - (mac_handle_command_event, mac_handle_window_event) - (mac_handle_mouse_event): Check error code of GetEventParameter. - (convert_fn_keycode) [MAC_OSX]: Likewise. - -2006-03-05 Andreas Schwab <schwab@suse.de> - - * xselect.c (x_catch_errors_unwind): Fix missing return value. - -2006-03-02 Kim F. Storm <storm@cua.dk> - - * frame.h (struct frame): New member n_tool_bar_rows. - - * xdisp.c: Minimize the unpleasent visual impact of the requirement - that non-toolkit tool-bars must occupy an integral number of screen - lines, by distributing the rows evenly over the tool-bar screen area. - (Vtool_bar_border): New variable. - (syms_of_xdisp): DEFVAR_LISP it. - (display_tool_bar_line): Add HEIGHT arg for desired row height. - Make tool-bar row the desired height. Use default face for border - below tool-bar. - (tool_bar_lines_needed): Add N_ROWS arg. Use it to return number of - actual tool-bar rows. - (redisplay_tool_bar): Calculate f->n_tool_bar_rows initially. - Adjust the height of the tool-bar rows to fill tool-bar screen area. - (redisplay_tool_bar): Calculate f->n_tool_bar_rows when tool-bar area - is resized. - -2006-03-01 Luc Teirlinck <teirllm@auburn.edu> - - * search.c (Fregexp_quote): Do not precede a literal `]' with two - backslashes to try to make clear that it has a literal meaning; it - does not do that. (It could close a character alternative - containing a backslash.) - -2006-02-28 Chong Yidong <cyd@stupidchicken.com> - - * xselect.c (x_catch_errors_unwind): New function. - (x_reply_selection_request): Put x_uncatch_errors in an unwind. - (Fx_get_atom_name): Call x_uncatch_errors earlier. - - * window.c (Qscroll_up, Qscroll_down): New syms. - (window_scroll_pixel_based): Make preserve_y static to avoid - getting point stuck when scrolling 1 line. - -2006-02-26 Chong Yidong <cyd@stupidchicken.com> - - * xterm.h, xterm.c (x_uncatch_errors): Delete unneccessary argument. - - * xterm.c (x_load_font, x_term_init, XTmouse_position) - (handle_one_xevent, x_connection_closed, x_list_fonts): - No arg for x_uncatch_errors. - - * xselect.c (x_own_selection, x_decline_selection_request) - (x_reply_selection_request, x_get_foreign_selection) - (Fx_get_atom_name, Fx_send_client_event): Likewise. - - * xfns.c (x_real_positions, x_set_mouse_color, Fx_focus_frame): - Likewise. - -2006-02-26 Luc Teirlinck <teirllm@auburn.edu> - - * lread.c: Declare Vload_file_rep_suffixes instead of - deleted variable default_suffixes. - (Fget_load_suffixes): New function. - (Fload): Use Fget_load_suffixes and Vload_file_rep_suffixes. - No longer use deleted variable default_suffixes. Update docstring. - (syms_of_lread): defsubr Sget_load_suffixes. - Expand `load-suffixes' docstring. - Delete default_suffixes and DEFVAR_LISP the new variable - `load-file-rep-suffixes'. - - * w32.c (check_windows_init_file): Use Fget_load_suffixes instead - of Vload_suffixes. - - * lisp.h: EXFUN Fget_load_suffixes. - Extern Vload_file_rep_suffixes. - - * eval.c (specpdl_ptr): Remove volatile qualifier for consistency - with lisp.h. - -2006-02-26 Stefan Monnier <monnier@iro.umontreal.ca> - - * lisp.h (struct specbinding, specpdl_ptr): Remove the volatile - qualifier which was trying to avoid the bug that was fixed by - yesterday's changes to xterm.c. - -2006-02-25 Chong Yidong <cyd@stupidchicken.com> - - * xterm.h (x_catch_errors) Return value changed to void. - (x_uncatch_errors): Delete unused count argument. - - * xterm.c (x_catch_errors): Don't use record_unwind_protect, since - it can be called in a signal handler. - (x_catch_errors_unwind): Function deleted. - (x_uncatch_errors): Deallocate last x_error_message_stack struct. - (x_check_errors): Call x_uncatch_errors before signalling error. - - (x_load_font, x_term_init, XTmouse_position, handle_one_xevent) - (x_connection_closed, x_list_fonts): Use new versions of - x_catch_errors and x_uncatch_errors. - - * xselect.c (x_own_selection, x_decline_selection_request) - (x_reply_selection_request, x_get_foreign_selection) - (Fx_get_atom_name, Fx_send_client_event): Likewise. - - * xfns.c (x_real_positions, x_set_mouse_color, Fx_focus_frame): - Likewise. - - * eval.c (record_unwind_protect): Add an assertion. - -2006-02-25 Stefan Monnier <monnier@iro.umontreal.ca> - - * process.c (Fmake_network_process): Init the process's mark. - -2006-02-25 Kim F. Storm <storm@cua.dk> - - * buffer.c (modify_overlay): Force redisplay if we modify an - overlay at the end of the buffer. - -2006-02-24 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (xg_get_image_for_pixmap): If x_find_image_file returns - nil the image file has been removed, in that case use the (cached) - pixmap. - -2006-02-24 Kenichi Handa <handa@m17n.org> - - * fileio.c (Finsert_file_contents): When a text is replaced - partially, be sure to set point before the inserted characters. - -2006-02-23 Zhang Wei <id.brep@gmail.com> (tiny change) - - * xfns.c (Fx_file_dialog): Return a decoded file name. - -2006-02-23 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * dispnew.c (update_text_area): Avoid needless redraw of rightmost - glyph whose face is extended to the text area end. - - * macterm.c (x_set_toolkit_scroll_bar_thumb): Don't set control - values if control is not visible or values are not changed. - -2006-02-22 Stefan Monnier <monnier@iro.umontreal.ca> - - * window.c (Fwindow_list): Check `window' before doing XWINDOW. - The default `window' should not be "on a different frame". - -2006-02-22 Kim F. Storm <storm@cua.dk> - - * indent.c (Fvertical_motion): Only try to move back if we can. - -2006-02-22 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macgui.h (struct _XGC) [!MAC_OSX || !USE_ATSUI]: New member - n_clip_rects. - - * macmenu.c (digest_single_submenu): Apply 2006-02-19 change for - xmenu.c. - - * macterm.c (GC_CLIP_REGION): Remove macro. - (mac_begin_clip, mac_end_clip): Take arg GC instead of REGION. - All uses changed. Don't do clipping if n_clip_rects is zero. - (mac_set_clip_rectangles): Use xassert instead of abort. - Set n_clip_rects. Don't make clip_region empty when number of - clipping rectangles is zero. - (mac_reset_clip_rectangles): Set n_clip_rects directly instead of - calling mac_set_clip_rectangles. - (x_set_toolkit_scroll_bar_thumb): Temporarily hide scroll bar to - avoid multiple redraws. - -2006-02-22 Kim F. Storm <storm@cua.dk> - - * fringe.c (draw_fringe_bitmap): Fix overlay-arrow display. - -2006-02-21 Kim F. Storm <storm@cua.dk> - - * fringe.c (syms_of_fringe) <fringe-bitmaps>: Doc fix. - -2006-02-21 Zhang Wei <brep@newsmth.org> - - * xfns.c (Fx_file_dialog, Motif and GTK): DECODE_FILE before - returning it. - -2006-02-21 Giorgos Keramidas <keramida@ceid.upatras.gr> (tiny change) - - * fringe.c (horizontal_bar_bits): Rename from `horisontal_bar_bits'. - (standard_bitmaps): Use it. - -2006-02-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macterm.c (mac_draw_string_common): Remove arg MODE. New arg - BG_WIDTH. All uses changed. Draw background if BG_WIDTH is not zero. - (mac_draw_image_string, mac_draw_image_string_16): New arg BG_WIDTH. - [USE_CG_TEXT_DRAWING] (mac_draw_image_string_cg): Rename from - mac_draw_string_cg. New arg BG_WIDTH. All uses changed. - Draw background if BG_WIDTH is not zero. Use float constants as - divisors instead of double. Use alloca instead of xmalloc/xfree. - (x_draw_glyph_string_background, x_draw_glyph_string_foreground) - [!MAC_OS8 || USE_ATSUI]: Background may be drawn using - mac_draw_image_string* functions. - (XLoadQueryFont) [MAC_OS8 && USE_ATSUI]: Don't adjust heights of - some fonts when srcCopy text transfer mode might be used. - (mac_begin_clip, mac_end_clip): Check if region is empty. - (mac_set_clip_rectangles): When resetting clip region, make it - empty instead of disposing of it. - -2006-02-20 Kim F. Storm <storm@cua.dk> - - * Makefile.in: Add fringe.elc to WINDOW_SUPPORT. - - * buffer.h (struct buffer): New members fringe_indicator_alist and - fringe_cursor_alist. - - * buffer.c (init_buffer_once): Set dummy default values for - fringe-indicator-alist and fringe-cursor-alist. The proper - default values are set by pre-loading fringe.el. - (syms_of_buffer): defvar_per_buffer new fringe-indicator-alist and - fringe-cursor-alist buffer-local variables and defvar_lisp_nopro - corresponding default- variables. - - * fringe.c (enum fringe_bitmap_type): Remove. Change all uses - to use `int'. - (NO_FRINGE_BITMAP, UNDEF_FRINGE_BITMAP, MAX_STANDARD_FRINGE_BITMAPS): - Define explicitly. - (Qtruncation, Qcontinuation, Qempty_line, Qtop_bottom) - (Qhollow_small): New variables. - (syms_of_fringe): Intern and staticpro them. - (question_mark_bits): Rename from unknown_bits. - (left_curly_arrow_bits): Rename from continuation_bits. - (right_curly_arrow_bits): Rename from continued_bits. - (left_triangle_bits): Rename from ov_bits. - (right_triangle_bits): Add. - (filled_rectangle_bits): Rename from filled_box_cursor_bits. - (hollow_rectangle_bits): Rename from hollow_box_cursor_bits. - (filled_square_bits): Add. - (vertical_bar_bits): Rename from bar_cursor_bits. - (horizontal_bar_bits): Rename from hbar_cursor_bits. - (empty_line_bits): Rename from zv_bits. - (standard_bitmaps): Update to use new names. - (draw_fringe_bitmap_1): Make static. - (get_logical_cursor_bitmap, get_logical_fringe_bitmap): New functions - to map from logical cursors and indicators to physical bitmaps. - (draw_fringe_bitmap): Resolve fringe cursor and overlay-arrow - bitmaps using symbol names instead of bitmap numbers. - (update_window_fringes): Use logical indicator symbol names - instead of bitmap numbers for logical. Add bitmap cache. - (LEFT_FRINGE, RIGHT_FRINGE): New helper macros. - -2006-02-20 Chong Yidong <cyd@stupidchicken.com> - - * regex.c: Revert 2006-02-19 change. - (xmalloc, xrealloc): Define these when not linked to Emacs. - Redefine malloc -> xmalloc, realloc -> xrealloc as in Emacs case. - -2006-02-19 Luc Teirlinck <teirllm@auburn.edu> - - * regex.c (extend_range_table_work_area): Fix typo. - -2006-02-19 Richard M. Stallman <rms@gnu.org> - - * xterm.c (x_catch_errors): Use xmalloc. - - * regex.c (extend_range_table_work_area): Call xmalloc and xrealloc. - (regex_compile): Likewise. - (regcomp): Use xmalloc. - - * gtkutil.c (malloc_widget_value): Use xmalloc. - - * vm-limit.c [HAVE_GETRLIMIT]: Include sys/resource.h. - (check_memory_limits) [HAVE_GETRLIMIT]: Use getrlimit. - - * xmenu.c (digest_single_submenu): When pane_string is empty, - do initialize save_wv. - -2006-02-19 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * xdisp.c (update_menu_bar) [MAC_OS]: Don't set - w->update_mode_line if arg F is not the selected frame. - - * macmenu.c (popup_activated_flag, submenu_id) - (next_menubar_widget_id): Remove variables. - (initialize_frame_menubar): Remove function. - (pop_down_menu, mac_menu_show): Simplify save value. - (dispose_menus): New function. - (pop_down_menu, fill_menubar): Use it. - (fill_submenu): Remove function. All uses changed to fill_menu. - (add_menu_item): Remove args SUBMENU and FORCE_DISABLE. New arg - POS. Don't call SetMenuItemHierarchicalID here. - (fill_menu): Add arg SUBMENU_ID. Return submenu_id that is to be - used next. Call SetMenuItemHierarchicalID here. - (fill_menubar): Add arg DEEP_P. All uses changed. Clean up menu - objects if needed. Reuse existing menu bar titles if possible. - (set_frame_menubar): Don't clean up menu objects here. - -2006-02-18 Chong Yidong <cyd@stupidchicken.com> - - * window.c (window_min_size_1): Ensure room for the scroll bar and - fringes. - -2006-02-17 Romain Francoise <romain@orebokech.com> - - * puresize.h (BASE_PURESIZE): Increment to 1200000. - -2006-02-17 Stefan Monnier <monnier@iro.umontreal.ca> - - * alloc.c (Fmake_symbol): Comment-out left-over assert from before the - addition of the BLOCK_INPUTs. - -2006-02-17 Juanma Barranquero <lekktu@gmail.com> - - * window.c (Fset_window_scroll_bars): Doc fix. - -2006-02-17 Kenichi Handa <handa@m17n.org> - - * xdisp.c (display_mode_element): Call display_string with correct - PREC arg (which must be a number of characters, not column width). - -2006-02-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * frame.c (x_get_arg): Clear out PARAM in ALIST also on Mac. - - * macfns.c (x_set_menu_bar_lines): Menu bar is always shown on Mac. - - * macmenu.c (set_frame_menubar): Don't call DrawMenuBar. - -2006-02-14 Richard M. Stallman <rms@gnu.org> - - * frame.c (x_get_arg): Clear out all occurrences of PARAM in ALIST. - - * m/ibms390x.h: New file. - -2006-02-14 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (xg_tool_bar_detach_callback): Set show-arrow to the - value of x-gtk-whole-detached-tool-bar. - (xg_tool_bar_attach_callback): Set show-arrow to TRUE. - - * xfns.c (syms_of_xfns): New variable: x-gtk-whole-detached-tool-bar. - -2006-02-14 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.c (x_x_to_emacs_modifiers): Make non-static. - - * xterm.h: Declare x_x_to_emacs_modifiers. - - * gtkutil.c (xg_tool_bar_button_cb): New function. - (xg_tool_bar_callback): Call x_x_to_emacs_modifiers to - store modifiers in event. - (update_frame_tool_bar): Connect button-release-event to - xg_tool_bar_button_cb. - -2006-02-13 Richard M. Stallman <rms@gnu.org> - - * .gdbinit (xwindow): Update the code to show the window box. - -2006-02-13 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.c (note_mouse_movement): Check for NULL FRAME_X_OUTPUT (frame). - -2006-02-12 Richard M. Stallman <rms@gnu.org> - - * cmds.c (internal_self_insert): Handle weird auto-fill-function. - -2006-02-11 Eli Zaretskii <eliz@gnu.org> - - * keyboard.c (Venable_disabled_menus_and_buttons): New variable. - (syms_of_keyboard): DEVFAR_LISP and initialize it. - (parse_tool_bar_item, parse_menu_item): If that variable is - non-nil, don't disable menu items and tool-bar buttons. - -2006-02-11 Juanma Barranquero <lekktu@gmail.com> - - * doc.c (Fsubstitute_command_keys): Doc fix. - -2006-02-10 Thien-Thi Nguyen <ttn@gnu.org> - - * data.c (Findirect_function): Rewrite docstring. - Fix omission bug: Declare new arg NOERROR. - -2006-02-10 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macfns.c (x_set_mouse_color): Don't call rif->define_frame_cursor - if window_desc is not set yet. - (Fx_create_frame): Remove variable x_frame_name. Apply 2005-12-07 - and 2006-01-26 changes for xfns.c. Call x_iconify_frame if frame - parameter `visibility' is `icon'. - (Fx_create_frame, x_create_tip_frame): Use "fontset-standard" - instead of "fontset-mac". - (Fx_focus_frame): New defun. - (syms_of_macfns): Defsubr it. - - * macterm.c (mac_define_frame_cursor): Don't change pointer shape - for unfocused frame. - (x_raise_frame): Call BringToFront instead of SelectWindow. - (x_lower_frame): Use NULL instead of nil. - (x_make_frame_visible): Don't call SelectWindow. - (XTread_socket): Increment handling_signal at the start, decrement - it at the end. - [USE_CG_TEXT_DRAWING] (init_cg_text_anti_aliasing_threshold): Use - CFPreferencesGetAppIntegerValue instead of Fmac_get_preference. - -2006-02-10 Kim F. Storm <storm@cua.dk> - - * data.c (Findirect_function): Add NOERROR arg. All callers changed - to pass Qnil for NOERROR. - - * keymap.c (current_minor_maps_error): Remove. - (current_minor_maps): Pass Qt for NOERROR to Findirect_function - instead of using internal_condition_case_1+current_minor_maps_error. - -2006-02-09 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.c (handle_one_xevent): Must note mouse movement even for nil - frames for GTK, in that case it is the tool bar. This is so that - highlighted text get reset properly. - -2006-02-09 Juanma Barranquero <lekktu@gmail.com> - - * alloc.c (Fmake_bool_vector, Fpurecopy): Doc fixes. - -2006-02-08 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * window.c (adjust_window_trailing_edge): Check that shrinking - does not set a window to size zero or less. - -2006-02-08 Miles Bader <miles@gnu.org> - - * editfns.c (Fconstrain_to_field): Use Fget_char_property instead - of Fget_text_property (other field functions work with overlays as - well as text-properties). - -2006-02-07 Kenichi Handa <handa@m17n.org> - - * dispextern.h (unibyte_display_via_language_environment): Extern it. - - * xterm.h (unibyte_display_via_language_environment): - * w32term.h (unibyte_display_via_language_environment): - * macterm.h (unibyte_display_via_language_environment): Delete extern. - -2006-02-07 Kenichi Handa <handa@m17n.org> - - * term.c (append_glyph): Refer to it->char_to_display instead of it->c. - (produce_glyphs): Set the character to print in - it->char_to_display. Handle unibyte-display-via-language-environment. - (produce_stretch_glyph): Set character to print in it->char_to_display. - -2006-02-06 Kenichi Handa <handa@m17n.org> - - * lread.c (openp): Initialize encoded_fn before GCPRO it. - -2006-02-05 Ken Raeburn <raeburn@raeburn.org> - - * editfns.c (Fconstrain_to_field): Fix int/Lisp_Object mixup. - - * lisp.h (XPNTR) [!NO_UNION_TYPE && !HAVE_SHM && !DATA_SEG_BITS]: - Cast bitfield value to EMACS_INT, to suppress gcc warning. - - * xrdb.c (malloc, realloc, free) [emacs]: Undefine macros before - defining. - -2006-02-03 Kim F. Storm <storm@cua.dk> - - * xdisp.c: Cache last merged escape glyph face. - (last_escape_glyph_frame, last_escape_glyph_face_id) - (last_escape_glyph_merged_face_id): New variables. - (get_next_display_element): Use/update them. - (redisplay_internal): Reset them before redisplay. - - * xdisp.c (set_iterator_to_next): Optimize 2004-12-13 fix. - Only recheck faces after displaying ellipsis. - -2006-02-02 Kenichi Handa <handa@m17n.org> - - * coding.c (decode_composition_emacs_mule): Fix handling of - incorrect format data. - -2006-01-31 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (update_frame_tool_bar): Use new tool bar function - gtk_toolbar_insert() so we can have tool bars of different sizes. - -2006-01-30 Luc Teirlinck <teirllm@auburn.edu> - - * data.c (Flistp): Doc fix. - -2006-01-30 Juanma Barranquero <lekktu@gmail.com> - - * window.c (Fother_window, Fwindow_vscroll, Fset_window_vscroll): - Fix typos in docstrings. - -2006-01-28 Luc Teirlinck <teirllm@auburn.edu> - - * data.c (Fcar, Fcdr): Add links to Elisp manual to the docstrings. - -2006-01-27 Chong Yidong <cyd@stupidchicken.com> - - * alloc.c (make_interval, allocate_string) - (allocate_string_data, make_float, Fcons, allocate_vectorlike) - (Fmake_symbol, allocate_misc): Use BLOCK_INPUT when accessing - global variables. - -2006-01-27 Eli Zaretskii <eliz@gnu.org> - - * dired.c (DIRENTRY_NONEMPTY) [__CYGWIN__]: Don't use d_ino; use - the MSDOS definition. - -2006-01-26 Richard M. Stallman <rms@gnu.org> - - * alloc.c (check_pure_size): Make overflow message an "error message". - - * keymap.c (Fmap_keymap): Doc fix. - - * xfns.c (Fx_create_frame): Put all specified parms into f->param_alist - unless they were cleared out. - - * frame.c (x_get_arg): "Clear out" the parm in ALIST if found there. - -2006-01-26 L$,1 q(Brentey K,Aa(Broly <lorentey@elte.hu> - - * editfns.c (Fconstrain_to_field): Fix behaviour on field boundaries. - (find_field): Set before_field to after_field when pos is at BEGV. - (Fline_beginning_position, Fline_end_position): - Clarify confusing doc string. - - * cmds.c (Fbeginning_of_line, Fend_of_line): Clarify confusing doc - string. - -2006-01-26 Kenichi Handa <handa@m17n.org> - - * callproc.c (Fcall_process): GCPRO error_file. Encode infile, - current_dir, and error_file. On reporting an error, decode them - back. - -2006-01-24 Stefan Monnier <monnier@iro.umontreal.ca> - - * regex.c (IMMEDIATE_QUIT_CHECK): Use it with SYNC_INPUT as well. - (re_match_2_internal) <on_failure_jump, on_failure_jump_smart>: - Don't check for quit, since any loop will go through fail or jump. - -2006-01-24 Chong Yidong <cyd@stupidchicken.com> - - * alloc.c (allocate_string_data): Update next_free immediately, to - reduce risk of memory clobberage. - -2006-01-24 L$,1 q(Brentey K,Aa(Broly <lorentey@elte.hu> - - * xdisp.c (handle_invisible_prop): Set it->position to fix cursor - display when point moves across an ellipsis. If there are - adjacent invisible texts, don't lose the second one's ellipsis. - (x_produce_glyphs): Doc fix. - -2006-01-23 Stefan Monnier <monnier@iro.umontreal.ca> - - * xterm.c (x_catch_errors_unwind): Yet another int/Lisp_Object mixup. - -2006-01-23 Kim F. Storm <storm@cua.dk> - - * xdisp.c (handle_single_display_spec): Fix handling of space - property on char from string: set *position rather than - it->current.pos. - (produce_stretch_glyph): Reduce width of stretch glyphs so they - don't get wider than the window (unless truncate-lines is on). - -2006-01-22 Stefan Monnier <monnier@iro.umontreal.ca> - - * xterm.c: Avoid allocating Lisp data from a signal handler. - (x_error_message): New var to replace x_error_message_string. - (x_error_catcher, x_catch_errors, x_catch_errors_unwind) - (x_check_errors, x_had_errors_p, x_clear_errors, x_error_handler) - (syms_of_xterm): Use it instead of x_error_message_string. - - * alloc.c (lisp_align_free): Add an assertion. - (make_interval, allocate_string, make_float, Fcons, Fmake_symbol) - (allocate_misc): If ENABLE_CHECKING is on, check we're not called from - a signal handler. - -2006-01-21 Luc Teirlinck <teirllm@auburn.edu> - - * dired.c (syms_of_dired) <completion-ignored-extensions>: Doc fix. - -2006-01-21 Romain Francoise <romain@orebokech.com> - - * xdisp.c (get_window_cursor_type): Fix last change. - Update copyright year. - -2006-01-20 Eli Zaretskii <eliz@gnu.org> - - * lread.c (Fload): Don't leak the file descriptor returned by - openp if we are going to signal an error. - - * w32.c (sys_close): If FD is outside [0..MAXDESC) limits, pass it - directly to _close. - (sys_dup): Protect against new_fd larger than fd_info[] can handle. - (sys_read): If FD is outside [0..MAXDESC) limits, pass it directly - to _read. - (sys_write): If FD is outside [0..MAXDESC) limits, pass it - directly to _write. - - * .gdbinit: Don't dereference Vsystem_type's Lisp_Symbol pointer - if it is NULL. - -2006-01-20 Kenichi Handa <handa@m17n.org> - - * puresize.h (BASE_PURESIZE): Increment to 1190000. - -2006-01-19 Chong Yidong <cyd@stupidchicken.com> - - * xdisp.c (get_window_cursor_type): Use cursor type specified by - the selected buffer for the echo area too. - -2006-01-19 Richard M. Stallman <rms@gnu.org> - - * keymap.c (Fmap_keymap): Doc fix. - - * s/irix6-5.h (GC_SETJMP_WORKS, GC_MARK_STACK): New definitions. - - * keyboard.c (echo_char): Don't omit the space between first two - echoed chars. - - * minibuf.c (read_minibuf): Fix previous change. - -2006-01-19 Kenichi Handa <handa@m17n.org> - - * xterm.c (handle_one_xevent): Handle keysyms 0x1000000..0x10000FF. - -2006-01-17 Richard M. Stallman <rms@gnu.org> - - * frame.c (x_frame_get_and_record_arg): Don't record Qunbound - value in f->param_alist. - -2006-01-15 Andreas Schwab <schwab@suse.de> - - * search.c (Freplace_match): Use UPPERCASEP instead of !NOCASEP. - -2006-01-13 Richard M. Stallman <rms@gnu.org> - - * Makefile.in: Define new macro WINDOW_SUPPORT. - (lisp): Use it. - (SOME_MACHINE_LISP): Add conditionally loaded files. - -2006-01-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macterm.c [USE_ATSUI] (atsu_get_text_layout_with_text_ptr) - [MAC_OS_X_VERSION_MAX_ALLOWED >= 1020]: Specify kATSLineUseQDRendering. - (XLoadQueryFont) [USE_ATSUI]: Display diacritical marks in - decomposed form. - - * process.c [HAVE_INTTYPES_H]: Include inttypes.h. - (ifflag_table): Fix typo (IFF_OACTIV -> IFF_OACTIVE). - (Fnetwork_interface_info): Use HAVE_STRUCT_IFREQ_IFR_NETMASK - macro. Also try member ifr_addr when getting netmask. - -2006-01-10 Stefan Monnier <monnier@iro.umontreal.ca> - - * fileio.c (Fexpand_file_name): Remove redundant tests. - Fix elimination of // so that it doesn't prevent elimination of an - immediately following /. or /.. - -2006-01-09 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (xg_toggle_notify_cb): New function. - (xg_toggle_visibility_cb): Move setting of x_gtk_show_hidden_files to - xg_toggle_notify_cb. - (xg_get_file_with_chooser): Add callback to xg_toggle_notify_cb when - parameter value changes so the toggle button gets updated. - -2006-01-06 Nick Roberts <nickrob@snap.net.nz> - - * .gdbinit: Fix typo. - -2006-01-05 Eli Zaretskii <eliz@gnu.org> - - * .gdbinit: Fix last change. - -2006-01-05 Kim F. Storm <storm@cua.dk> - - * process.c (Fmake_network_process): Use AF_INET instead of - AF_UNSPEC when AF_INET6 is not defined. - -2006-01-05 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * mac.c (mac_coerce_file_name_ptr, mac_coerce_file_name_desc): - Don't check that the other type is known file-related one. - - * macfns.c (Fx_server_version): Use gestaltSystemVersionMajor, - gestaltSystemVersionMinor, and gestaltSystemVersionBugFix on Mac - OS X 10.4 and later. - -2006-01-04 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (xg_get_image_for_pixmap): If the image is from a file, - let GTK do all image processing. Importing Emacs own pixmaps to GTK - looks bad for inactive tool bar items with some Gnome themes. - -2006-01-04 Eli Zaretskii <eliz@gnu.org> - - * .gdbinit: Avoid a warning message when x_error_quitter is not - compiled in. - - * process.c [WINDOWSNT]: Undef AF_INET6 to disable IPv6 support - for w32. - -2006-01-04 Kim F. Storm <storm@cua.dk> - - * process.c: Add IPv6 support. - (Qipv4, Qipv6): New vars. - (syms_of_process): Intern and staticpro them. - (Fformat_network_address): Handle 9 or 8 element vector as IPv6 address - with or without port number. Handle 4 element vector as IPv4 address - without port number. - (conv_sockaddr_to_lisp, get_lisp_to_sockaddr_size) - (conv_lisp_to_sockaddr): Handle IPv6 addresses. - (Fmake_network_process): Use :family 'ipv4 and 'ipv6 to explicitly - request that address family only. :family nil or omitted means to - determine address family from the specified :host and :service. - (ifflag_table): Add missing OpenBSD IFF_ flags. - (server_accept_connection): Handle IPv6 addresses. - (init_process): Add (:family ipv4) and (:family ipv6) sub-features. - - * .gdbinit: Undo last change. Instead, look at Vsystem_type to - determine which breakpoints to set. - -2006-01-03 Stefan Monnier <monnier@iro.umontreal.ca> - - * keymap.c (describe_map_compare): Yet another int/Lisp_Object mixup. - - * window.h (Fwindow_minibuffer_p): Declare (for use in minibuf.c). - -2006-01-03 Romain Francoise <romain@orebokech.com> - - * emacs.c (main): Update copyright year. - -2006-01-03 Ken Raeburn <raeburn@gnu.org> - - * callproc.c (delete_temp_file): Bind file-name-handler-alist to - nil for the call to internal_delete_file. - -2006-01-01 Ken Raeburn <raeburn@gnu.org> - - * callproc.c (Fcall_process_region): Bind file-name-handler-alist - to nil for the call to Fwrite_region. - -2005-12-31 Richard M. Stallman <rms@gnu.org> - - * minibuf.c (read_minibuf): Clear out all other minibuffer windows. - -2005-12-31 Eli Zaretskii <eliz@gnu.org> - - * emacs.c (gdb_pvec_type): A dummy variable for GDB's sake. - -2005-12-30 Luc Teirlinck <teirllm@auburn.edu> - - * textprop.c (set_text_properties): Reword description of return value. - Return Qnil if caller wants to remove all text properties from a - string and the string already has no intervals. - -2005-12-30 Stefan Monnier <monnier@iro.umontreal.ca> - - * term.c (visible_cursor): New boolean var. - (set_terminal_modes, tty_show_cursor): Use "vs" or "ve" depending on - visible_cursor. - (syms_of_term): Export the new var as "visible-cursor". - -2005-12-30 Eli Zaretskii <eliz@gnu.org> - - * .gdbinit: Tell users not to worry about GDB warnings that some - functions do not exist in the binary. - -2005-12-30 Andreas Schwab <schwab@suse.de> - - * process.c (Fnetwork_interface_info): Correctly terminate the - loop over ifflag_table. - -2005-12-29 Richard M. Stallman <rms@gnu.org> - - * lread.c (readevalloop): Test for reading a whole buffer - before actually reading anything. Handle all cases, including - START = END = nil and an already-narrowed buffer. - Convert END to a marker if it is a number. - - * keymap.c (describe_map): Put sparse map elements into an array, - sort them, then output a sequence of identical bindings on one line. - (struct describe_map_elt): New data type. - (describe_map_compare): New function. - -2005-12-28 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (xg_get_file_with_chooser): Change message shown - in file chooser. - -2005-12-27 Richard M. Stallman <rms@gnu.org> - - * lread.c (readevalloop): Set PT and ZV in the proper buffer, - not the current one. - - * minibuf.c (Fminibuffer_message): Doc fix. - (read_minibuf): Set current_buffer->enable_multibyte_characters sooner. - - * eval.c (do_autoload): Ignore elements of Vautoload_queue - where car is not symbol. - -2005-12-27 Kenichi Handa <handa@m17n.org> - - * charset.c (lisp_string_width): Check multibyteness of STRING. - -2005-12-27 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xfns.c (x_show_hidden_files): New variable. - (syms_of_xfns): Defvar it. - - * gtkutil.c (xg_toggle_visibility_cb): New function. - (xg_get_file_with_chooser): Add toggle hidden files and a message - to the new file chooser dialog. Show hidden files if - x_show_hidden_files is non-zero. - -2005-12-26 Richard M. Stallman <rms@gnu.org> - - * keyboard.h: Undo previous change. - - * Makefile.in (undo.o): Undo previous change. - - * undo.c: Undo previous change. - -2005-12-26 Luc Teirlinck <teirllm@auburn.edu> - - * keyboard.h: extern last_point_position_window. - - * undo.c: include keyboard.h. - - * Makefile.in (undo.o): Depend on keyboard.h. - -2005-12-26 Richard M. Stallman <rms@gnu.org> - - * commands.h (last_point_position_window): Declare. - - * undo.c: Depend on window.h. - (record_point): Save old point from the correct window. - - * keyboard.c (last_point_position_window): New variable. - (command_loop_1): Set last_point_position_window. - (syms_of_keyboard): Init it. - - * Makefile.in (undo.o): Depend on window.h. - -2005-12-25 Richard M. Stallman <rms@gnu.org> - - * eval.c (un_autoload): Expect (0 . OFEATURES) in Vautoload_queue - to undo a `provide'. - - * fns.c (Fprovide): Store (0 . OFEATURES) in Vautoload_queue. - -2005-12-25 Giorgos Keramidas <keramida@ceid.upatras.gr> - - * m/amdx86-64.h [__FreeBSD__] (START_FILES, LIB_STANDARD): - define for FreeBSD on this platform. - -2005-12-24 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macterm.h (TYPE_FILE_NAME): New define. - (posix_pathname_to_fsspec, fsspec_to_posix_pathname): Remove externs. - - * mac.c (posix_pathname_to_fsspec, fsspec_to_posix_pathname): - Add prototypes. Make static. - (mac_aedesc_to_lisp): Initialize err to noErr. - (mac_coerce_file_name_ptr, mac_coerce_file_name_desc) - (init_coercion_handler): New functions. - (Fmac_coerce_ae_data): Use coercion of Apple event data for - translation from/to file names. - - * macterm.c: Don't include sys/param.h. - (init_coercion_handler): Add extern. - [MAC_OS8] (main): Call init_coercion_handler. - (mac_initialize) [MAC_OSX]: Likewise. - [TARGET_API_MAC_CARBON] (mac_do_receive_drag): Use coercion of - Apple event data for translation from/to file names. - - * macfns.c [TARGET_API_MAC_CARBON] (Fx_file_dialog): Likewise. - - * image.c [MAC_OS] (find_image_fsspec): Likewise. - -2005-12-23 Martin Rudalics <rudalics@gmx.at> - - * insdel.c (insert, insert_and_inherit, insert_before_markers) - (insert_before_markers_and_inherit): Make sure FROM is correct - when `after-change-functions' are called. - -2005-12-23 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xfns.c (Fx_uses_old_gtk_dialog): New function. - - * gtkutil.c (xg_uses_old_file_dialog): New function. - (xg_get_file_name): Use xg_uses_old_file_dialog. - - * gtkutil.h: Declare xg_uses_old_file_dialog. - -2005-12-22 Richard M. Stallman <rms@gnu.org> - - * xmenu.c (xmenu_show): Call inhibit_garbage_collection. - -2005-12-22 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * mac.c (Fmac_coerce_ae_data) [MAC_OSX]: Fix memory leak. - - * macgui.h (XCharStruct): Remove member `valid_p'. - (STORE_XCHARSTRUCT): Don't set member `valid_p'. - (XCharStructRow): New typedef. - (XCHARSTRUCTROW_CHAR_VALID_P, XCHARSTRUCTROW_SET_CHAR_VALID): - New macros. - (struct MacFontStruct): Add member `bounds'. Remove member - `per_char'. All uses for QuichDraw Text fonts are changed to - `bounds.per_char'. ATSUI font bounds are represented as an array - `bounds.rows' of XCharStructRow's, each of which consists of a - bitmap of valid entries and an array of char bounds. - - * macterm.c (mac_per_char_metric): Add prototype. - (x_per_char_metric) [USE_CG_TEXT_DRAWING]: Remove prototype. - (mac_query_char_extents): New function. - (x_per_char_metric): Use it. - (XLoadQueryFont): Likewise. Consolidate min/max_bounds calculations. - [USE_CG_TEXT_DRAWING] (mac_draw_string_cg): - Use mac_per_char_metric instead of x_per_char_metric. - (mac_text_extents_16): New function. - (mac_compute_glyph_string_overhangs): Use it. - (mac_unload_font): Free member `bounds' in struct MacFontStruct. - -2005-12-21 Stefan Monnier <monnier@iro.umontreal.ca> - - * minibuf.c (Fdisplay_completion_list): Use XCAR/XCDR. - (Fminibuffer_completion_help): Remove duplicates before display. - -2005-12-21 L$,1 q(Brentey K,Aa(Broly <lorentey@elte.hu> - - * print.c (print_preprocess): Don't lose print_depth levels while - iterating. - -2005-12-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macmenu.c (Qmac_apple_event): Add extern. - (set_frame_menubar, mac_menu_show keymp_panes) - (single_keymap_panes, list_of_panes, list_of_item) - (single_menu_item): Add argument types to prototypes. - (mac_dialog_show) [HAVE_DIALOGS]: Likewise. - (struct skp): New struct (from xmenu.c). - (single_keymap_panes, single_menu_item, list_of_panes) - (list_of_item): Sync with xmenu.c. - (Fx_popup_menu, Fx_popup_dialog): Likewise. Don't get window from - POSITION if it is mac-apple-event event. - (menubar_selection_callback): Don't use menu_command_in_progress. - (set_frame_menubar): First parse all submenus, then make - widget_value trees from them. Don't allocate any widget_value - objects until we are done with the parsing. - (parse_single_submenu, digest_single_submenu): New functions. - (single_submenu): Function deleted, replaced by those two. - (install_menu_quit_handler) [HAVE_CANCELMENUTRACKING]: Don't create - or dispose of EventHandlerUPP. Install hander to all submenus. - (mac_menu_show) [!HAVE_MULTILINGUAL_MENU]: Use ENCODE_MENU_STRING - instead of ENCODE_SYSTEM. - (free_frame_menubar, fill_submenu, fill_menu): Don't use NULL for - integer values. - [HAVE_DIALOGS] (mac_dialog_show): Sync with xdialog_show (in xmenu.c). - (add_menu_item) [TARGET_API_MAC_CARBON]: Use CFString functions to - format menu item string. Don't use NULL for integer value. - - * macterm.h (struct mac_output): Remove unused member - menu_command_in_progress. - -2005-12-20 Juri Linkov <juri@jurta.org> - - * xmenu.c (Fx_popup_menu): Set Vmenu_updating_frame to f if - position is non-nil, else set it to nil. - - * macmenu.c (Fx_popup_menu): Add `else' to set - Vmenu_updating_frame to nil only if position is nil. - - * w32menu.c (Fx_popup_menu): Add `else' to set - Vmenu_updating_frame to nil only if position is nil. - -2005-12-19 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * keyboard.c (make_lispy_event): Drag-and-drop items are now - stored in member `args' of struct input_event. - - * termhooks.h (struct input_event): Fix comment for DRAG_N_DROP_EVENT. - - * xselect.c (x_handle_dnd_message): Drag-and-drop items are now - stored in member `args' of struct input_event. - - * w32term.c (construct_drag_n_drop): Likewise. - - * macterm.c (mac_do_receive_drag): Likewise. - (x_use_underline_position_properties): Undo 2005-07-13 change. - (syms_of_macterm) <x-use-underline-position-properties>: Likewise. - (mac_use_core_graphics, mac_wheel_button_is_mouse_2) - (mac_pass_command_to_system, mac_pass_control_to_system): - New boolean variables renamed from Lisp_Object ones - Vmac_use_core_graphics, Vmac_wheel_button_is_mouse_2, - Vmac_pass_command_to_system, and Vmac_pass_control_to_system. - All uses changed. - (syms_of_macterm): DEFVAR_BOOL them. Remove previous DEFVAR_LISPs. - Make them user options. - (mac_handle_command_event, mac_store_services_event): - Call create_apple_event_from_event_ref without 5th argument. - (backtranslate_modified_keycode): Mask off modifier keys that are - mapped to some Emacs modifiers before passing it to KeyTranslate. - (syms_of_macterm): Make variables `mac-emulate-three-button-mouse', - `mac-wheel-button-is-mouse-2', and `mac-*-modifier' user options. - Fix docstrings of `mac-*-modifier'. - - * mac.c (create_apple_event_from_event_ref): Remove arg `types'. - (do_applescript): Change argument types to Lisp_Object. - All uses changed. - - * macterm.h (create_apple_event_from_event_ref): Remove 5th - argument from extern. - -2005-12-18 Dan Nicolaescu <dann@ics.uci.edu> - - * xfns.c (Fx_backspace_delete_keys_p): In case we cannot determine - the answer, return `lambda', not nil. - -2005-12-17 Eli Zaretskii <eliz@gnu.org> - - * makefile.w32-in (bootstrap-temacs): Warn that parts of commands - enclosed in $(ARGQUOTE)s should not be split between two lines, as - that will break with GNU Make >3.80, when sh.exe is used and - arg quoting is with '..'. - -2005-12-17 Chong Yidong <cyd@stupidchicken.com> - - * print.c (print_preprocess): Just signal an error if print_depth - is exceeded. - -2005-12-17 Eli Zaretskii <eliz@gnu.org> - - * .gdbinit: Set a breakpoint on w32_abort. - -2005-12-16 Juri Linkov <juri@jurta.org> - - * minibuf.c (Fminibuffer_completion_contents): New Lisp function - created from minibuffer_completion_contents. - (minibuffer_completion_contents): Remove. - (do_completion, Fminibuffer_complete_word) - (Fminibuffer_completion_help): Replace minibuffer_completion_contents - with Fminibuffer_completion_contents. - (syms_of_minibuf): Add Sminibuffer_completion_contents. - (Fdisplay_completion_list): Doc fix. - (display_completion_list_1): Use `nil' for second arg of - `Fdisplay_completion_list'. - -2005-12-14 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xfns.c (compute_tip_xy): Handle negative dx and dy. - - * w32fns.c (compute_tip_xy): Ditto. - - * macfns.c (compute_tip_xy): Ditto. - -2005-12-14 Chong Yidong <cyd@stupidchicken.com> - - * print.c (print_preprocess): Go to a deeper print_depth to avoid - print_object loop. - -2005-12-14 Kyotaro HORIGUCHI <horiguti@meadowy.org> (tiny change) - - * coding.c (code_convert_region_unwind): GCPRO arg. - -2005-12-12 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xfns.c (compute_tip_xy): Calculate root_y the same way as root_x, - i.e. dy is offset from top of frame instead of bottom. - - * macfns.c (compute_tip_xy): Ditto. - - * w32fns.c (compute_tip_xy): Ditto. - - * gtkutil.c (SSDATA): New macro to remove compiler warnings. - (xg_get_image_for_pixmap, xg_create_frame_widgets) - (xg_get_file_with_chooser): Use SSDATA instead of SDATA. - - * xmenu.c (menubar_selection_callback): Do nothing if the callback - is for an unselected radio menu item. - -2005-12-11 Richard M. Stallman <rms@gnu.org> - - * xdisp.c (syms_of_xdisp) <blink-cursor-alist>: Doc fix. - - * lisp.h [! NO_UNION_TYPE] (EQ): Use == so args are computed just once. - - * keymap.c (Fset_keymap_parent, store_in_keymap): Use CHECK_IMPURE. - (Flookup_key): Doc fix. - (syms_of_keymap) <function-key-map>: Doc fix. - - * fns.c (Frequire): Treat evaluating from a source file - like loading the file. - - * floatfns.c (Flog): Doc fix. - - * fileio.c (Finsert_file_contents): Set Vdeactivate_mark - when we change the buffer. - -2005-12-11 Juri Linkov <juri@jurta.org> - - * minibuf.c (display_completion_list_1): - Call `minibuffer_completion_contents' instead of using `nil' as - second arg of `Fdisplay_completion_list'. - (keys_of_minibuf): Unbind SPC in - Vminibuffer_local_filename_completion_map (see also related - change on 2005-12-06). - -2005-12-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * emacs.c (main) [MAC_OS8]: Undo previous change. - - * macselect.c (syms_of_macselect) <mac-apple-event-map>: - Initialize to nil. Keymap is now created in lisp/term/mac-win.el. - -2005-12-10 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * Makefile.in (macselect.o): Depend on keymap.h. - - * emacs.c (main) [MAC_OS8]: Call syms_of_keymap before - syms_of_macselect. - - * image.c (init_image) [MAC_OS]: Don't call EnterMovies. - [!HAVE_GIF && MAC_OS] (gif_load): Call EnterMovies. - - * keyboard.c (Qmac_apple_event) [MAC_OS]: New variable. - (syms_of_keyboard) [MAC_OS]: Initialize it. - (make_lispy_event) [MAC_OS]: Build lisp event for MAC_APPLE_EVENT. - - * mac.c (Qundecoded_file_name): New variable. - (syms_of_mac): Initialize it. - (mac_aelist_to_lisp, mac_aedesc_to_lisp): New functions. - [TARGET_API_MAC_CARBON] (create_apple_event_from_event_ref): New fun. - (Fmac_coerce_ae_data): New defun. - (syms_of_mac): Defsubr it. - - * macselect.c: Include keymap.h. - (mac_ready_for_apple_events): New variable. - (Vmac_apple_event_map, Qmac_apple_event_class) - (Qmac_apple_event_id): New variables. - (syms_of_macselect): Initialize them. - (Qundefined, mac_store_apple_event): Add externs. - (struct apple_event_binding): New struct. - (find_event_binding_fun, find_event_binding) - (mac_find_apple_event_spec, defer_apple_events) - (mac_handle_apple_event, init_apple_event_handler) - (copy_scrap_flavor_data): New functions. - (Fmac_process_deferred_apple_events): New defun. - (syms_of_macselect): Defsubr it. - (mac_store_services_event): Fix extern. - (mac_handle_service_event): Don't allocate Lisp objects during - asynchronous input processing. Use mac_store_services_event - instead of mac_store_application_menu_event. - - * macterm.c (Qmac_ready_for_drag_n_drop, Qapplication, Qabout) - (Qpreferences): Remove variables. - (syms_of_macterm): Don't initialize them. - (Qhicommand) [USE_CARBON_EVENTS]: New variable. - (syms_of_macterm) [USE_CARBON_EVENTS]: Initialize it. - (init_required_apple_events, do_ae_open_application) - (do_ae_print_documents, do_ae_open_documents) - (do_ae_quit_application): Remove functions and prototypes. - (mac_ready_for_apple_events, Qundefined, init_apple_event_handler) - (mac_find_apple_event_spec): Add externs. - (mac_store_application_menu_event): Remove function. - (mac_store_apple_event, mac_make_lispy_event_code): New functions. - (mac_handle_command_event): Create Apple event from Carbon event. - Use mac_store_apple_event instead of mac_store_application_menu_event. - [MAC_OSX] (mac_store_services_event): Likewise. - (struct SelectionRange, SelectionRange): Remove struct and typedef. - [MAC_OS8] (main): Call init_apple_event_handler instead of - init_required_apple_events. - (mac_initialize) [MAC_OSX]: Likewise. - [!USE_CARBON_EVENTS] (mac_wait_next_event): - Use mac_ready_for_apple_events instead of Qmac_ready_for_drag_n_drop. - - * macterm.h (mac_make_lispy_event_code, mac_aedesc_to_lisp): - Add externs. - (create_apple_event_from_event_ref) [TARGET_API_MAC_CARBON]: Likewise. - (Fmac_get_preference): Add EXFUN. - - * termhooks.h (enum event_kind) [MAC_OS]: Add new MAC_APPLE_EVENT - event. - -2005-12-09 Richard M. Stallman <rms@gnu.org> - - * xfns.c (Fx_create_frame): Reinstate previous change. - -2005-12-09 Eli Zaretskii <eliz@gnu.org> - - * w32fns.c (w32_abort) [__GNUC__]: Add instructions for attaching - GDB to the abort dialog. - -2005-12-09 Kyotaro HORIGUCHI <horiguti@meadowy.org> (tiny change) - - * indent.c (Fvertical_motion): Force move if starting on - stretch glyph. - -2005-12-08 Richard M. Stallman <rms@gnu.org> - - * lread.c (read_escape) <\s>: Don't treat strings specially. - - * xfns.c (Fx_create_frame): Comment out previous change. - -2005-12-07 L$,1 q(Brentey K,Aa(Broly <lorentey@elte.hu> - - * xfns.c (Fx_create_frame): Initialize Vdefault_minibuffer_frame, - when needed. - -2005-12-06 Stefan Monnier <monnier@iro.umontreal.ca> - - * minibuf.c (keys_of_minibuf): Just unbind SPC in - Vminibuffer_local_filename_completion_map rather than forcing it - explicitly to the same binding as the global map. - -2005-12-06 Ken Raeburn <raeburn@gnu.org> - - * buffer.c (Fkill_buffer): Avoid dangerous side effects in NILP args. - * bytecode.c (Fbyte_code): Likewise. - * fileio.c (internal_delete_file, Fread_file_name_internal): Likewise. - * minibuf.c (Fminibuffer_complete_and_exit): Likewise. - * undo.c (truncate_undo_list): Likewise. - -2005-12-05 Richard M. Stallman <rms@gnu.org> - - * window.c (enlarge_window): Eliminate arg preserve_before. - Assume it is 0. All callers changed. - (Fenlarge_window, Fshrink_window): Likewise. - -2005-12-02 Eli Zaretskii <eliz@gnu.org> - - * w32fns.c (compute_tip_xy): Put tip above pointer if it doesn't - fit below. - -2005-12-02 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.h: Add prototype for xg_set_icon_from_xpm_data. - - * xfns.c (x_real_positions): int ign => unsigned int. - (xg_set_icon_from_xpm_data): Remove unused variable err. - (x_set_name_internal, Fx_create_frame, xg_set_icon): Add cast - to remove compiler warning. - (compute_tip_xy): Put tip above pointer if it doesn't fit below. - -2005-12-02 David Reitter <david.reitter@gmail.com> - - * minibuf.c (Fcompleting_read): If Vminibuffer_completing_file_name is - non-nil, use the new keymaps Vminibuffer_local_filename_completion_map - and Vminibuffer_local_must_match_filename_map keymaps. - (keys_of_minibuf): Bind SPC in the new file-name completion keymaps. - - * keymap.c (Vminibuffer_local_filename_completion_map) - (Vminibuffer_local_must_match_filename_map): New variables. - (syms_of_keymap): DEFVAR_LISP them, initialize them, and set their - parent to be Vminibuffer_local_completion_map and - Vminibuffer_local_must_match_map, respectively. - - * commands.h (Vminibuffer_local_filename_completion_map) - (Vminibuffer_local_must_match_filename_map): Declare the new keymaps. - -2005-12-01 Stefan Monnier <monnier@iro.umontreal.ca> - - * window.c (Fset_window_configuration): Don't accidentally copy the - window-point of one window to another. - -2005-11-30 L$,1 q(Brentey K,Aa(Broly <lorentey@elte.hu> - - * buffer.c (Fpop_to_buffer): Remove superfluous call to record_buffer. - -2005-11-30 Kim F. Storm <storm@cua.dk> - - * alloc.c: Include fcntl.h. Define O_WRONLY if not defined. - (valid_lisp_object_p) [!GC_MARK_STACK]: Validate pointer by - passing it to `emacs_write'. - -2005-11-29 Ari Roponen <arjuropo@cc.jyu.fi> (tiny change) - - * atimer.c (stop_other_atimers): Fix loop to correctly compute `prev'. - -2005-11-27 Richard M. Stallman <rms@gnu.org> - - * window.c (adjust_window_trailing_edge): New function. - (Fadjust_window_trailing_edge): New function. - (syms_of_window): Defsubr it. - (window_deletion_count): New variable. - (delete_window): Update window_deletion_count. - -2005-11-26 Eli Zaretskii <eliz@gnu.org> - - * minibuf.c (syms_of_minibuf): Mention the extension of - `completion-auto-help's meaning by complete.el. - -2005-11-26 Henrik Enberg <henrik.enberg@telia.com> - - * xfaces.c (Finternal_set_lisp_face_attribute_from_resource): - Handle :inherit property as a lisp expression. - -2005-11-24 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macterm.c (Qcontrol): Rename from Qctrl. All uses changed. - (syms_of_macterm): Staticpro Qcontrol, Qmeta, Qalt, Qhyper, - Qsuper, and Qmodifier_value. - (Vmac_control_modifier, Vmac_option_modifier) - (Vmac_command_modifier, Vmac_function_modifier) - (Vmac_emulate_three_button_mouse, Vmac_wheel_button_is_mouse_2) - (Vmac_pass_command_to_system, Vmac_pass_control_to_system) - (Vmac_charset_info_alist): Doc fixes. - -2005-11-23 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * emacs.c (main) [MAC_OSX]: Change working directory to home - directory if `-psn_*' option is specified. - - * mac.c (DECODE_UTF_8): Remove macro. - [TARGET_API_MAC_CARBON] (cfstring_to_lisp_nodecode): New function - created from cfstring_to_lisp. - [TARGET_API_MAC_CARBON] (cfstring_to_lisp): Use it. - (xrm_get_preference_database) [TARGET_API_MAC_CARBON]: Likewise. - - * macterm.h (cfstring_to_lisp_nodecode) [TARGET_API_MAC_CARBON]: - Add prototype. - -2005-11-21 Ken Raeburn <raeburn@gnu.org> - - * keymap.c (shadow_lookup): Use make_number to pass a number to - Fsubstring. - -2005-11-21 Juri Linkov <juri@jurta.org> - - * puresize.h (BASE_PURESIZE): Increment to 1180000. - -2005-11-20 Chong Yidong <cyd@stupidchicken.com> - - * xfaces.c (Finternal_set_lisp_face_attribute): - Use :ignore-defface for new frame defaults when `unspecified' is - supplied. - (Finternal_get_lisp_face_attribute): Hide :ignore-defface. - (merge_face_vectors): Don't do :ignore-defface overwriting here. - (Finternal_merge_in_global_face): Do it here. - -2005-11-20 Juri Linkov <juri@jurta.org> - - * charset.c (invalid_character): Use Lisp-readable syntax - for octal and hex. Reorder decimal, octal and hex values. - -2005-11-20 Nick Roberts <nickrob@snap.net.nz> - - * lisp.h: Use typedef when Lisp_Object is EMACS_INT so that - this type is recognised when debugging. - -2005-11-19 Andreas Schwab <schwab@suse.de> - - * .gdbinit (nextcons, xcdr, xfloat): Update for changes in - Lisp_Cons and Lisp_Float. - -2005-11-19 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macterm.c [USE_CG_TEXT_DRAWING] (cg_text_anti_aliasing_threshold): - New variable. - [USE_CG_TEXT_DRAWING] (init_cg_text_anti_aliasing_threshold): New fun. - (init_font_name_table) [USE_ATSUI && USE_CG_TEXT_DRAWING]: Use it. - [USE_CG_TEXT_DRAWING] (mac_draw_string_cg): Don't do antialiasing if - font size is smaller than or equal to cg_text_anti_aliasing_threshold. - -2005-11-17 Chong Yidong <cyd@stupidchicken.com> - - * image.c (x_create_bitmap_from_xpm_data): Free attributes on fail. - - * xfaces.c (Qignore_defface): New variable. - (syms_of_xfaces): Provide `:ignore-defface'. - (IGNORE_DEFFACE_P): New macro. - (check_lface_attrs, lface_fully_specified_p) - (Finternal_set_lisp_face_attribute) - (Fface_attribute_relative_p, Fmerge_face_attribute): - Handle Qignore_defface as a possible value. - (merge_face_vectors): The merged face is `unspecified' if the - mergee specifies `:ignore-defface'. - -2005-11-16 Stefan Monnier <monnier@iro.umontreal.ca> - - * lread.c (readevalloop): Add missing GCPROs. - -2005-11-16 Chong Yidong <cyd@stupidchicken.com> - - * xfns.c (xg_set_icon_from_xpm_data): New function. - - * gnu.h (gnu_xpm_bits): Rename from gnu_bits. - (gnu_xbm_bits): Rename from gnu_bits (xbm version). - - * xterm.c (x_bitmap_icon): Use the xpm if available. - - * image.c (x_create_bitmap_from_xpm_data): New function. - (x_create_bitmap_from_xpm_data): Initialize XpmAttributes. - -2005-11-15 Luc Teirlinck <teirllm@auburn.edu> - - * Makefile.in (lisp, shortlisp): Add rfn-eshadow. - -2005-11-16 Nick Roberts <nickrob@snap.net.nz> - - * .gdbinit: Make SIGTSTP work like SIGINT normally does. - -2005-11-15 Andreas Schwab <schwab@suse.de> - - * lisp.h (struct Lisp_Cons): Make cdr a union. - (XCDR_AS_LVALUE): Adjust. - (struct Lisp_Float): Make data a union. - (XFLOAT_DATA): Adjust. - - * alloc.c (free_float): Make free list chaining aliasing-safe. - (make_float): Likewise. - (free_cons): Likewise. - (Fcons): Likewise. - (check_cons_list): Likewise. - (Fmake_symbol): Likewise. - (allocate_misc): Likewise. - (free_misc): Likewise. - (gc_sweep): Likewise. - -2005-11-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * mac.c (HASHKEY_QUERY_CACHE): New define. - (xrm_create_database, xrm_q_put_resource): Empty query cache. - (xrm_get_resource): Use query cache. - - * image.c (init_image) [MAC_OS]: Don't call EnterMovies if - inhibit_window_system is set. - -2005-11-13 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macgui.h (USE_CG_TEXT_DRAWING): New define. - (struct MacFontStruct) [USE_CG_TEXT_DRAWING]: New members cg_font - and cg_glyphs. - - * macterm.c [USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function. - (x_draw_glyph_string_foreground) [USE_CG_TEXT_DRAWING]: Use it. - (XLoadQueryFont) [USE_CG_TEXT_DRAWING]: Set members cg_font and - cg_glyphs in struct MacFontStruct if synthesized bold or italic is - not used and font substitution never occurs for ASCII and Latin-1 - characters. - (XLoadQueryFont): Maximum and minimum metrics are now those among - ASCII characters. - (XLoadQueryFont) [!MAC_OS8 || USE_ATSUI]: Apply WebKit-style - height adjustments for Courier, Helvetica, and Times. - - * s/darwin.h (LIBS_CARBON) [!HAVE_CARBON]: Remove `-framework Carbon'. - -2005-11-11 David Reitter <david.reitter@gmail.com> - - * macterm.c (syms_of_macterm): Remove macCtrlKey, macShiftKey, - macMetaKey, macAltKey. Introduce Qctrl, Qmeta, - Vmac_control_modifier / mac-control-modifier, - Vmac_option_modifier / mac-option-modifier, - Vmac_command_modifier / mac-command-modifier. - (mac_to_emacs_modifiers): Use the new style modifier - variables. Return UInt32 (modifiers are longs now.) - (backtranslate_modified_keycode): New function (refactoring). - (XTread_socket): Use new modifier variables and refactored function. - (mac_determine_quit_char_modifiers): Remove macMetaKey (there is - no dedicated meta key. Not in use anyway.) - (convert_fn_keycode): Map Fn-keys to their original keycode - using a table (english keyboard only). - -2005-11-11 Kim F. Storm <storm@cua.dk> - - * .gdbinit (pitx): Fix output format if n_overlay_strings > 0. - Add post hook to "backtrace" to always dump lisp call stack to - increase chance of people sending it to us when reporting bugs. - - * doc.c (Fsubstitute_command_keys): Doc fix. - - * dispextern.h (struct it): New member ignore_overlay_strings_at_pos_p. - - * xdisp.c (handle_stop): Skip overlay string handling if - ignore_overlay_strings_at_pos_p is set. - (set_iterator_to_next): At end of display vector, set - ignore_overlay_strings_at_pos_p if dpvec came from an overlay - string, so we skip those overlay strings at current pos. - -2005-11-10 Lars Hansen <larsh@soem.dk> - - * fileio.c (file-regular-p): Doc fix. - -2005-11-10 Kim F. Storm <storm@cua.dk> - - * alloc.c (valid_lisp_object_p): New function to validate that - an object is really a valid Lisp_Object. - - * lisp.h (valid_lisp_object_p): Add prototype. - - * print.c (safe_debug_print): New function to be called from gdb - to print Lisp objects; use valid_lisp_object_p to avoid crashing - if user tries to print something which is not a Lisp object. - - * .gdbinit (pp, pp1): Use safe_debug_print. - (pv, pv1): New commands to print value of a lisp variable. - -2005-11-10 Nick Roberts <nickrob@snap.net.nz> - - * .gdbinit (pp1): New user-defined function. - -2005-11-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * image.c [MAC_OSX] (image_load_quartz2d): Fix memory leak. - - * mac.c [MAC_OSX] (init_mac_osx_environment): Reinitialize locale - related variables for dumped executable. - - * unexmacosx.c (unexec_write_zero): New function. - (copy_data_segment): Clear uninitialized local variables in - statically linked libraries. - - * s/darwin.h (C_SWITCH_SYSTEM): Remove -fno-common. - -2005-11-09 Juri Linkov <juri@jurta.org> - - * keymap.c (shadow_lookup): If Flookup_key returns a number, - call it again with a sub-key-sequence, and if its return value - is non-nil (sub-key is bound), return nil. - -2005-11-08 Kim F. Storm <storm@cua.dk> - - * process.c (Fsignal_process): Recognize signal names with and - without SIG prefix, e.g. SIGHUP and HUP. - - * search.c (search_buffer): No need to initialize base_pat. - -2005-11-04 Stefan Monnier <monnier@iro.umontreal.ca> - - * window.c (Fget_lru_window, Fget_largest_window, window_loop): - Don't abuse the `mini' arg. Use the `obj' arg instead. - -2005-11-04 Kim F. Storm <storm@cua.dk> - - * xdisp.c (show_mouse_face): Clear mouse face to eol. - -2005-11-03 Dan Nicolaescu <dann@ics.uci.edu> - - * Makefile.in (lisp, shortlisp): Add emacs-lisp/syntax.elc, - font-lock.elc and jit-lock.elc. - -2005-11-03 Richard M. Stallman <rms@gnu.org> - - * window.c (Fenlarge_window): Rename SIDE to HORIZONTAL. - (enlarge_window): Rename WIDTHFLAG to HORIZ_FLAG. - (CURBEG, CURSIZE): Use HORIZ_FLAG instead of WIDTHFLAG. - - * sheap.c (STATIC_HEAP_SIZE): Increment both definitions. - - * alloc.c (refill_memory_reserve): Move decl out of conditionals. - -2005-11-03 Stefan Monnier <monnier@iro.umontreal.ca> - - * window.c (Fdisplay_buffer): Fix last change to not use - a dedicated window. - -2005-11-01 Kim F. Storm <storm@cua.dk> - - * fringe.c (update_window_fringes): Undo 2005-10-27 change. - Instead, rotate the bottom angle bitmap 180 degrees to indicate - that the bottom row does not end in a newline. - -2005-11-01 Andreas Schwab <schwab@suse.de> - - * unexelf.c (unexec): Handle .plt section in BSS segment. - -2005-11-01 Stefan Monnier <monnier@iro.umontreal.ca> - - * lread.c (readevalloop): Yet another int/Lisp_Object mixup (YAILOM). - - * window.c (window_loop): For LRU and LARGEST, let the `mini' argument - determine whether to consider dedicated windows as well. - (Fget_lru_window, Fget_largest_window): Add `dedicated' argument. - (Fdisplay_buffer): Do consider dedicated windows in those cases where - we will split the window rather than reuse it. - Don't try to use windows on other displays. - -2005-10-31 Dan Nicolaescu <dann@ics.uci.edu> - - * puresize.h (BASE_PURESIZE): Increment to 1170000. - -2005-10-31 Romain Francoise <romain@orebokech.com> - - * macfns.c: Update copyright year. - * m/gould.h: Likewise. - -2005-10-30 Kim F. Storm <storm@cua.dk> - - * xdisp.c (display_line): Restore it->current_x and call - extend_face_to_end_of_line when last glyph doesn't fit on line. - (set_glyph_string_background_width): Remove specific tests here - to see if face background should extend to end of line. Simplify. - -2005-10-30 Richard M. Stallman <rms@gnu.org> - - * alloc.c (BYTES_USED): Use uordblks, not arena. - (bytes_used_when_reconsidered): New variable. - (emacs_blocked_free): Set that. - -2005-10-29 Chong Yidong <cyd@stupidchicken.com> - - * alloc.c (emacs_blocked_free): Fix typo. - -2005-10-29 Richard M. Stallman <rms@gnu.org> - - * data.c (Fmake_variable_frame_local): Doc fix. - - * xdisp.c (handle_fontified_prop): Do nothing if memory full. - (format_mode_line_unwind_data): New arg SAVE_PROPTRANS - controls whether to save and restore mode_line_proptrans_alist. - Callers changed. - (unwind_format_mode_line): Work with that feature. - (redisplay_internal): Don't call prepare_menu_bars if memory full. - (move_elt_to_front): New function. - (display_mode_element): Use move_elt_to_front. - Don't bother munging text props on a null string. - Delete obsolete elts from mode_line_proptrans_alist. - (decode_mode_spec): Test Vmemory_full, not spare_memory. - (Fformat_mode_line): Clear mode_line_proptrans_alist after saving. - - * lisp.h (memory_full_cons_threshold): Declare. - (internal_lisp_condition_case): Declare. - - * alloc.c (syms_of_alloc) <memory-full>: Doc fix. - (Fmemory_full_p): Function deleted. - (syms_of_alloc): Don't defsubr it. - (memory_full_cons_threshold): New variable. - (spare_memory): Now a vector of 7 elts. - (buffer_memory_full): Don't set Vmemory_full here. - (xfree): Don't try to refill here. - (emacs_blocked_free): Record BYTES_USED in local var. - (memory_full): Now free all the slots in spare_memory. - (refill_memory_reserve): Allocate each slot in spare_memory. - (init_alloc_once): Call refill_memory_reserve. - - * keyboard.c (command_loop_1): Don't set Vmemory_full here. - - * eval.c (internal_lisp_condition_case): New function. - (Fcondition_case): Use internal_lisp_condition_case. - (Feval): Test Vmemory_full and memory_full_cons_threshold. - (Ffuncall): Likewise. - - * bytecode.c (Fbyte_code): Use internal_lisp_condition_case. - -2005-10-29 Stefan Monnier <monnier@iro.umontreal.ca> - - * syntax.c (Fparse_partial_sexp): Fix docstring. - -2005-10-28 Romain Francoise <romain@orebokech.com> - - * puresize.h (BASE_PURESIZE): Increment to 1130000. - -2005-10-28 Richard M. Stallman <rms@gnu.org> - - * xfns.c (syms_of_xfns): Provide `x' as feature. - - * xdisp.c (decode_mode_spec): Define %e to indicate memory full. - - * editfns.c (Fformat): Don't include string padding - between info[n].start and info[n].end. - - * alloc.c (spare_memory): No longer static. - (xfree) [!SYSTEM_MALLOC]: Call refill_memory_reserve. - - * puresize.h (BASE_PURESIZE): Increment to 1120000. - -2005-10-27 Chong Yidong <cyd@stupidchicken.com> - - * data.c (Fmake_variable_frame_local): Add clarification to docstring. - - * fringe.c (update_window_fringes): Handle case where buffer ends - with a newline. - -2005-10-27 Kenichi Handa <handa@m17n.org> - - * coding.h (DECODE_SYSTEM): Fix argument name; name->str. - -2005-10-24 Kenichi Handa <handa@m17n.org> - - * charset.h (charset_mule_unicode_0100_24ff) - (charset_mule_unicode_2500_33ff, charset_mule_unicode_e000_ffff): - Extern them. - - * charset.c (charset_mule_unicode_0100_24ff) - (charset_mule_unicode_2500_33ff, charset_mule_unicode_e000_ffff): - New variables. - (Fsetup_special_charsets): Initialize them. - - * xterm.c (handle_one_xevent): Handle keysyms directly mapped to - supported Unicode characters. - -2005-10-25 Jason Rumney <jasonr@gnu.org> - - * w32fns.c (w32_to_x_font): Avoid forcing font widths. - -2005-10-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * image.c [MAC_OS] (image_load_qt_1): Check image size. - Use GraphicsImportGetImageDescription instead of - GraphicsImportGetNaturalBounds. - [MAC_OSX] (image_load_quartz2d): Check image size. - [MAC_OS] (xpm_load_image): Likewise. - - * macterm.c (last_mouse_glyph_frame): New var. - (note_mouse_movement): Say mouse moved if current frame differs - from last_mouse_glyph_frame, and update last_mouse_glyph_frame. - (XTmouse_position): Set last_mouse_glyph_frame. - (XTread_socket): Clear last_mouse_glyph_frame on mouse up/down event. - (mac_draw_string_common) [USE_ATSUI && WORDS_BIG_ENDIAN]: Fix typo. - Use EndianU16_BtoN. - (mac_draw_string_common) [MAC_OSX]: Don't use ATSUClearLayoutControls. - (x_per_char_metric, XLoadQueryFont) - [MAC_OS_X_VERSION_MAX_ALLOWED < 1020]: Use device origins to get - glyph bounds. - (mac_to_x_fontname, mac_do_list_fonts) - (mac_initialize_display_info): Change screen resolutions to 72dpi. - -2005-10-25 Masatake YAMATO <jet@gyve.org> - - * minibuf.c (Fdisplay_completion_list): Small doc fix. - -2005-10-24 Kim F. Storm <storm@cua.dk> - - * xterm.c: Undo 2005-10-23 change. - (last_mouse_glyph_frame): New var. - (note_mouse_movement): Say mouse moved if current frame differs - from last_mouse_glyph_frame, and update last_mouse_glyph_frame. - (XTmouse_position): Set last_mouse_glyph_frame. - (handle_one_xevent): Clear last_mouse_glyph_frame [instead of - last_mouse_glyph] on mouse up/down event. - - * editfns.c (Fcompare_buffer_substrings): Fix last change. - -2005-10-23 Stefan Monnier <monnier@iro.umontreal.ca> - - * editfns.c (Fcompare_buffer_substrings): Handle multibyte chars. - -2005-10-23 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.c (note_mouse_movement): Always call note_mouse_highlight - so tool tips don't interfere with press on tool bar button. - -2005-10-23 Richard M. Stallman <rms@gnu.org> - - * casetab.c (Fset_case_table): Doc fix. - - * lread.c (build_load_history): Replace STREAM arg with ENTIRE. - (readevalloop): Compute ENTIRE properly. - (syms_of_lread) <load-history>: Doc fix. - -2005-10-21 Richard M. Stallman <rms@gnu.org> - - * lread.c (Fload): Simplify gcpro structure. - Gcpro FOUND as well as FILE, but not EFOUND. - Unless preloading, record FOUND instead of FILE in Vload_history. - Rename repeat local FILE to MSG_FILE. - (syms_of_lread) <load-history>: Doc fix. - -2005-10-21 Kenichi Handa <handa@m17n.org> - - * search.c (boyer_moore): Add parens to fix and/or precedence bug. - -2005-10-20 Kim F. Storm <storm@cua.dk> - - * buffer.c (clone_per_buffer_values): Remove unused var tem. - (init_buffer): Remove unused vars dotstat, pwdstat. - - * ccl.c (check_ccl_update): Remove unused var vp. - - * fileio.c (auto_save_error): Call SAFE_FREE. - - * fns.c (Fchar_table_range): Remove unused var i. - - * minibuf.c (display_completion_list_1): New wrapper function - for Fdisplay_completion_list. - (Fminibuffer_completion_help): Use it. - - * term.c (encode_terminal_code): Remove unused var src_start. - - * window.c (Fwindow_tree): Remove unused var alist. - - * xterm.c (x_calc_absolute_position): Remove unused vars win_x, win_y. - -2005-10-20 Aubrey Jaffer <agj@alum.mit.edu> (tiny change) - - * unexelf.c (unexec): Fix calls to `fatal' with less than 3 arguments. - -2005-10-20 Olli Savia <ops@iki.fi> (tiny change) - - * syssignal.h [__Lynx__]: Undef SIGPOLL along with SIGIO. - -2005-10-20 Andreas Schwab <schwab@suse.de> - - * minibuf.c (Fdisplay_completion_list): Doc fix. - -2005-10-19 Kim F. Storm <storm@cua.dk> - - * image.c (check_image_size): Handle integer Vmax_image_size value - directly as max pixel value. Use default frame size for null frame. - (syms_of_image) <max-image-size>: Describe integer value. - -2005-10-19 Romain Francoise <romain@orebokech.com> - - * emacs.c (main): Update copyright year. - -2005-10-18 Chong Yidong <cyd@stupidchicken.com> - - * image.c (Vmax_image_size): New variable. - (check_image_size): New function. - (xbm_read_bitmap_data, pbm_load, png_load, jpeg_load, tiff_load) - (gif_load, gs_load): Use it. - (lookup_image): Try loading again if previous load failed. - (xbm_read_bitmap_data): Add a new argument, a pointer to the frame - to display in, NULL if none. - (xbm_load_image, xbm_file_p): Pass xbm_read_bitmap_data the new - argument. - -2005-10-18 Richard M. Stallman <rms@gnu.org> - - * search.c (Fstring_match): Doc fix. - -2005-10-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macterm.c (note_mouse_movement): Use PtInRect. - (XTread_socket): Also ignore mouse motion just before a button - release event. Don't process button release event when mouse is - not grabbed. - -2005-10-16 Masatake YAMATO <jet@gyve.org> - - * minibuf.c (Fdisplay_completion_list): Add new optional - argument COMMON_SUBSTRING. Bind `completion-common-substring' - to the optional argument during running `completion-setup-hook'. - -2005-10-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * mac.c [TARGET_API_MAC_CARBON] (get_cfstring_encoding_from_lisp): - Allow nil as argument. - [TARGET_API_MAC_CARBON] (Fmac_code_convert_string): Regard nil - for encoding arguments as UTF-16 in native byte order, no BOM. - - * macfns.c (Fx_create_frame): Add debugging code. - (Fx_show_tip): Set frame pixel width and height. - - * macterm.c (MAC_WINDOW_NORMAL_GC): Remove macro. - (FRAME_NORMAL_GC): New macro. - (mac_draw_line, mac_clear_area, mac_clear_window) - (mac_fill_rectangle, mac_draw_string, mac_draw_string_16) - (mac_draw_image_string, mac_draw_image_string_16): Rename from - XDrawLine, XClearArea, XClearWindow, XFillRectangle, XDrawString, - XDrawString16, XDrawImageString, and XDrawImageString16, respectively. - All uses changed. - (mac_draw_line, mac_erase_rectangle, mac_clear_area) - (mac_clear_window, mac_draw_bitmap, mac_draw_rectangle) - (mac_invert_rectangle, mac_draw_string_common, mac_draw_string) - (mac_draw_string_16, mac_draw_image_string) - (mac_draw_image_string_16, mac_copy_area, mac_copy_area_with_mask) - (mac_scroll_area): Drawing functions now take frame as destination. - All uses changed. - (mac_draw_string_common): Get port height with FRAME_PIXEL_HEIGHT. - (x_draw_fringe_bitmap): Set clipping area in face->gc. - - * macterm.h (mac_clear_area): Add extern. - -2005-10-14 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macterm.c (note_mouse_movement, XTread_socket): Apply 2005-10-14 - changes for xterm.c. - - * w32term.c (note_mouse_movement, w32_read_socket): Likewise. - -2005-10-14 Kenichi Handa <handa@m17n.org> - - * search.c (search_buffer): Give up BM search on case-fold-search - if one of a target character has a case-equivalence of different - charset even if that target charcter is an ASCII. - - * casefiddle.c (casify_object): Fix for the case that case - conversion change the byte length. - -2005-10-14 Kim F. Storm <storm@cua.dk> - - * xterm.c (note_mouse_movement): Return 1 if mouse moved; 0 otherwise. - (handle_one_xevent): Only clear help_echo_string; restore it if - note_mouse_movement didn't record any mouse movement. - - * xdisp.c (pos_visible_p): Convert w->hscroll to pixels before use. - (remember_mouse_glyph): Clear RECT if mouse is over an image glyph. - - * keyboard.c (make_lispy_position): Adjust wx for left margin if - ON_TEXT. - (Fposn_at_x_y): Fix calculation of x coordinate. - (Fposn_at_point): Return nil if point is hscrolled out of view. - -2005-10-13 Andreas Schwab <schwab@suse.de> - - * sysdep.c (request_sigio, unrequest_sigio): Do nothing in - non-interactive mode. - -2005-10-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * xterm.c, w32term.c, macterm.c (note_mouse_movement): Undo last change. - -2005-10-12 Kim F. Storm <storm@cua.dk> - - * xterm.c (handle_one_xevent): Clear last_mouse_glyph on mouse up/down. - -2005-10-12 Romain Francoise <romain@orebokech.com> - - * buffer.c (init_buffer): Rename `rc' to `len' for clarity. - -2005-10-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * xdisp.c (remember_mouse_glyph): Use MATRIX_BOTTOM_TEXT_ROW to - get end of text rows. Obtain header-line/mode-line rows directly. - - * xterm.c, w32term.c, macterm.c (note_mouse_movement): - Restore help_echo_string if mouse is moved inside last_mouse_glyph. - -2005-10-12 Kim F. Storm <storm@cua.dk> - - * xdisp.c (remember_mouse_glyph): New generic version based on - glyph_rect and remember_mouse_glyph from xterm.c enhanced to - properly handle all different window areas. - - * dispextern.h (remember_mouse_glyph): Add prototype. - - * xterm.c (glyph_rect, remember_mouse_glyph): Remove X versions. - (note_mouse_movement, XTmouse_position): Use generic - remember_mouse_glyph, add last_mouse_glyph arg. - - * w32term.c (note_mouse_movement): Fix last_mouse_glyph check. - (glyph_rect, remember_mouse_glyph): Remove w32 specific versions. - (note_mouse_movement, w32_mouse_position): Use generic - remember_mouse_glyph, add last_mouse_glyph arg. - - * macterm.c (note_mouse_movement): Add call to remember_mouse_glyph. - (glyph_rect, remember_mouse_glyph): Remove mac specific versions. - (XTmouse_position): Adapt to use generic remember_mouse_glyph - instead of pixel_to_glyph_coords. - - * window.c (coordinates_in_window): Fix x position for ON_RIGHT_MARGIN. - Fix x position for ON_TEXT when left margin width > 0. - -2005-10-11 Kim F. Storm <storm@cua.dk> - - * window.c (coordinates_in_window): Fix y position for ON_SCROLL_BAR. - - * keyboard.c (make_lispy_position): Fix buffer calculations for - mouse click or movement in right fringe and the margins. - -2005-10-11 Juanma Barranquero <lekktu@gmail.com> - - * image.c (fn_jpeg_stdio_src): Don't define it. - (init_jpeg_functions): Don't initialize `fn_jpeg_stdio_src'. - (our_common_init_source): Rename from `our_init_source'. - (our_common_term_source): Rename from `our_term_source'. - (our_memory_fill_input_buffer): Rename from - `our_fill_input_buffer'. - (our_memory_skip_input_data): Rename from `our_skip_input_data'. - (jpeg_memory_src): Use the new names. - (struct jpeg_stdio_mgr): New struct. - (JPEG_STDIO_BUFFER_SIZE): New constant. - (our_stdio_fill_input_buffer, our_stdio_skip_input_data) - (jpeg_file_src): New functions. - (jpeg_load): Use `jpeg_file_src' instead of `fn_jpeg_stdio_src'. - -2005-10-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macterm.c (PER_CHAR_METRIC): Remove unused macro. - (fm_font_family_alist): New variable. - (syms_of_macterm): Initialize and staticpro it. - (decode_mac_font_name): Replace '-' in family name with '_' if it - occurs just once. Lower family name. - (parse_x_font_name): Rename from x_font_name_to_mac_font_name. - All uses changed. Remove argument MF and code conversion for it. - Add argument SIZE. Rename argument MF_DECODED to FAMILY, and CS - to CHARSET. Parse font size. Lower family name. Return integer - value for status of parsing. - (init_font_name_table) [USE_ATSUI]: Use decode_mac_font_name. - Don't use Fdowncase because family name is already lowered by - decode_mac_font_name. - (init_font_name_table): Always call decode_mac_font_name. - Add pair of family name and its reference to fm_font_family_alist. - (mac_clear_font_name_table): Clear fm_font_family_alist. - (XLoadQueryFont): Move font size parsing part to parse_x_font_name. - Lookup fm_font_family_alist to get font family reference. - (XLoadQueryFont) [USE_ATSUI]: Don't use Fdowncase because family - name is already lowered by parse_x_font_name. - -2005-10-11 Kim F. Storm <storm@cua.dk> - - * xterm.c (glyph_rect): Return 0 if position is outside text area. - - * keyboard.c (make_lispy_position): Fix buffer position calculation for - mouse click or movement in fringe. - -2005-10-10 Jason Rumney <jasonr@gnu.org> - - * xterm.c (remember_mouse_glyph): New function. - (note_mouse_movement): Use it to remember the current glyph if changed. - (XTmouse_position): Fix calculation of fake glyph under mouse. - Move code to calculate glyph under mouse into remember_mouse_glyph. - -2005-10-10 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * emacs.c (USAGE3, standard_args): -nb => -nbi. - -2005-10-10 Juanma Barranquero <lekktu@gmail.com> - - * frame.c (Fredirect_frame_focus): Fix typos in docstring. - (next_frame, prev_frame, set_term_frame_name): Make static. - - * window.c (Fwindow_tree): Fix spelling. - -2005-10-09 Romain Francoise <romain@orebokech.com> - - * window.c (Fwindow_end): Don't try to redisplay if non-interactive. - -2005-10-09 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * emacs.c (standard_args): Remove options -i, -itype, --icon-type. - Add options -nb, --no-bitmap-icon. - - * xfns.c (Fx_create_frame): Make bitmapIcon have default on. - -2005-10-08 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macgui.h (MAX_CLIP_RECTS): New define. - (struct _XGC): New member clip_region. - (struct _XGC) [MAC_OSX && USE_ATSUI]: New members n_clip_rects and - clip_rects. - - * macterm.c (GC_CLIP_REGION): New macro. - (saved_port_clip_region): New variable. - (mac_begin_clip, mac_end_clip): New functions. - (XDrawLine, mac_erase_rectangle, mac_draw_bitmap, XFillRectangle) - (mac_draw_rectangle, mac_draw_string_common, mac_copy_area) - (mac_copy_area_with_mask, mac_scroll_area): Use them. - (mac_set_clip_rectangle, mac_reset_clipping): Remove functions. - [USE_ATSUI] (atsu_get_text_layout_with_text_ptr) - [MAC_OS_X_VERSION_MAX_ALLOWED < 1020]: Specify kATSLineFractDisable. - (mac_draw_string_common) [MAC_OSX && USE_ATSUI]: Clip to clipping - rectangles stored in gc. - (XFreeGC): Dispose of clipping region. - (mac_set_clip_rectangles, mac_reset_clip_rectangles): New functions. - (x_draw_fringe_bitmap, x_set_glyph_string_clipping) - (x_draw_relief_rect, x_draw_box_rect, x_draw_stretch_glyph_string) - (x_draw_glyph_string, x_clip_to_row, x_draw_hollow_cursor) - (x_draw_bar_cursor): Use them. - (x_set_glyph_string_clipping): Use get_glyph_string_clip_rects to - get multiple clipping rectangles. - - * macterm.h (mac_term_init): Add types to extern. - (struct mac_output): Remove members mWP and pending_menu_activation. - Put members scroll_bar_foreground_pixel and - scroll_bar_background_pixel in #if 0. - (FRAME_MAC_WINDOW, FRAME_X_WINDOW): Use window_desc. - - * xfaces.c (x_create_gc, x_free_gc) [MAC_OS]: Add BLOCK_INPUT. - Add debugging code. - -2005-10-08 Kim F. Storm <storm@cua.dk> - - * window.c (window_tree, Fwindow_tree): Rename fns added 2005-10-04. - -2005-10-07 Kim F. Storm <storm@cua.dk> - - * dispnew.c (redraw_overlapped_rows, redraw_overlapping_rows) - [!HAVE_WINDOW_SYSTEM]: Don't declare them... - (update_window) [!HAVE_WINDOW_SYSTEM]: ...and don't call them. - -2005-10-07 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * dispextern.h (struct glyph_string): Rename member for_overlaps_p - to for_overlaps. Now occupy 3 bits. - (OVERLAPS_PRED, OVERLAPS_SUCC, OVERLAPS_BOTH) - (OVERLAPS_ERASED_CURSOR): New defines. - (struct redisplay_interface): Add new OVERLAPS arg to member - fix_overlapping_area. - (x_fix_overlapping_area): Add new OVERLAPS arg. - (get_glyph_string_clip_rects): Add extern. - - * dispnew.c (redraw_overlapping_rows): - Call rif->fix_overlapping_area with new OVERLAPS arg as redrawn part. - - * xdisp.c: Rename member for_overlaps_p in struct glyph_string to - for_overlaps. - (get_glyph_string_clip_rects): New function created from - get_glyph_string_clip_rect. Set clipping rectangles according to the - value of for_overlaps. Enable to store multiple clipping rectangles. - (get_glyph_string_clip_rect): Use get_glyph_string_clip_rects. - (fill_composite_glyph_string, fill_glyph_string, draw_glyphs): - Rename argument OVERLAPS_P to OVERLAPS. All uses in macros changed. - (x_fix_overlapping_area): Add OVERLAPS arg. Pass it to draw_glyphs. - (draw_phys_cursor_glyph): Set width of erased cursor to use it for - calculating clipping rectangles later. Call x_fix_overlapping_area - with new OVERLAPS arg to draw only erased cursor area. - (expose_overlaps): Call x_fix_overlapping_area with new OVERLAPS arg - to draw overlaps in both preceding and succeeding rows. - - * xterm.c, w32term.c, macterm.c: Rename member for_overlaps_p in - struct glyph_string to for_overlaps. - -2005-10-04 Richard M. Stallman <rms@gnu.org> - - * alloc.c (refill_memory_reserve): Conditionalize the body, - not the function's existence. - -2005-10-04 Kim F. Storm <storm@cua.dk> - - * window.c (window_split_tree): New function. - (Fwindow_split_tree): New defun. - (syms_of_window): Defsubr it. - -2005-10-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macterm.c (mac_invert_rectangle): New function. - (XTflash): Use it. - -2005-10-04 Stefan Monnier <monnier@iro.umontreal.ca> - - * regex.h (re_char): Don't expose it in the interface. - (re_set_whitespace_regexp): Adjust the arg's type to not use it. - - * regex.c (re_char): Move it back here. - (re_set_whitespace_regexp): Change the arg's type to not use it. - - * keyboard.c (make_lispy_event): If point has moved between down and up - event, make it a drag, not a click, to mirror what - mouse-drag-region expects. - -2005-10-02 Dan Nicolaescu <dann@ics.uci.edu> - - * lisp.h (fatal): Undo previous change. - * term.c (fatal): Undo previous change. - -2005-10-01 Richard M. Stallman <rms@gnu.org> - - * xfaces.c (face_color_gray_p): Colors close to black count as gray. - -2005-10-01 Kim F. Storm <storm@cua.dk> - - * xdisp.c (try_window): Skip scroll-margin check if ZV is visible. - -2005-10-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * keyboard.c (init_keyboard) [MAC_OSX]: Don't install SIGINT handler. - - * macfns.c (start_hourglass): Apply 2005-05-07 change for xfns.c. - (x_create_tip_frame) [GLYPH_DEBUG]: Uncomment debugging code. - (Fx_create_frame, x_create_tip_frame) [USE_ATSUI]: - Try ATSUI-compatible 12pt Monaco font first. - - * macgui.h (struct _XCharStruct): New member valid_p. - (STORE_XCHARSTRUCT): Set valid_p. - (struct MacFontStruct) [USE_ATSUI]: New member mac_style. - - * macterm.c (mac_draw_string_common, x_per_char_metric) - (mac_compute_glyph_string_overhangs, init_font_name_table) - (XLoadQueryFont, mac_unload_font) [USE_ATSUI]: Add ATSUI support. - (atsu_get_text_layout_with_text_ptr) [USE_ATSUI]: New function. - (x_draw_glyph_string_background) - (x_draw_glyph_string_foreground) [MAC_OS8 && USE_ATSUI]: Don't use - XDrawImageString. Always draw background and foreground separately. - (x_draw_glyph_string_foreground) [USE_ATSUI]: Don't use 8-bit - functions for one-byte chars when using ATSUI-compatible fonts. - (atsu_font_id_hash) [USE_ATSUI]: New variable. - (syms_of_macterm) [USE_ATSUI]: Initialize and staticpro it. - (XLoadQueryFont): Set min_byte1, max_byte1, min_char_or_byte2, and - max_char_or_byte2 more in detail. - (quit_char_comp, mac_check_for_quit_char) [MAC_OSX]: Remove functions. - -2005-09-30 Dan Nicolaescu <dann@ics.uci.edu> - - * image.c (slurp_file, xbm_read_bitmap_data): Cast to the correct type. - * xterm.c (handle_one_xevent, handle_one_xevent): Likewise. - - * unexelf.c (fatal): Fix prototype. - - * term.c (fatal): Implement using varargs. - - * regex.c (re_char): Move typedef ... - * regex.h (re_char): ... here. - (re_iswctype, re_wctype, re_set_whitespace_regexp): New prototypes. - - * emacs.c (malloc_set_state): Fix return type. - (endif): Fix type. - - * lisp.h (fatal): Add argument types. - - * dispextern.h (fatal): Delete prototype. - - * systime.h (make_time): Prototype moved from ... - * editfns.c (make_time): ... here. - - * editfns.c: Move systime.h include after lisp.h. - * dired.c: - * xsmfns.c: - * process.c: Likewise. - - * alloc.c (old_malloc_hook, old_realloc_hook, old_realloc_hook): - Add parameter types. - (__malloc_hook, __realloc_hook, __free_hook): Fix prototypes. - (emacs_blocked_free): Change definition to match __free_hook. - (emacs_blocked_malloc): Change definition to match __malloc_hook. - (emacs_blocked_realloc): Change definition to match __realloc_hook. - -2005-09-30 Romain Francoise <romain@orebokech.com> - - * minibuf.c (Fread_buffer): Follow convention for reading from the - minibuffer with a default value. Doc fix. - -2005-09-29 Juri Linkov <juri@jurta.org> - - * editfns.c (Fmessage, Fmessage_box, Fmessage_or_box): - Rename argument name `string' to `format-string'. - (Fformat): Doc fix. - -2005-09-28 Kim F. Storm <storm@cua.dk> - - * image.c (gif_load): Fix size of allocated image buffer - for images where a sub-image may be larger than the image's - total height/width specifications. - -2005-09-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macgui.h (struct _XCharStruct): Each member now takes short value. - -2005-09-27 Dan Nicolaescu <dann@ics.uci.edu> - - * xfaces.c (lookup_derived_face): Add parameter type. - - * xdisp.c (cursor_row_fully_visible_p): Add parameter type. - - * marker.c (verify_bytepos): Add parameter type. - - * process.c (get_operating_system_release): Move prototype ... - - * systime.h (get_operating_system_release): ... here. - - * xterm.c (handle_one_xevent): Refer to union field to match the - type required by the function definition. - (set_vertical_scroll_bar): Move prototype ... - - * xterm.h: ... here. - - * fns.c (internal_equal, seed_random): Fix prototypes. - (internal_equal): Add missing parameter. - -2005-09-25 Richard M. Stallman <rms@gnu.org> - - * keyboard.c (update_menu_bindings): Variable deleted. - (syms_of_keyboard): Don't defvar it. - (parse_menu_item): Don't test it. - -2005-09-23 Richard M. Stallman <rms@gnu.org> - - * editfns.c (Fformat): Explicitly test for end of format string - and don't use `index'. - -2005-09-23 Dan Nicolaescu <dann@ics.uci.edu> - - * s/aix4-2.h (BROKEN_GET_CURRENT_DIR_NAME): - Define BROKEN_GET_CURRENT_DIR_NAME. - - * sysdep.c (get_current_dir_name): Also define if - BROKEN_GET_CURRENT_DIR_NAME. - - * m/ibmrs6000.h: Test for USG5, not USG5_4. - -2005-09-22 Kim F. Storm <storm@cua.dk> - - * xdisp.c (message_dolog): Add warning about GC and Lisp strings. - (message2): Fix commentary. Ok to use alloca'ed memory. - Still not ok to use Lisp string data (because of GC). - (set_message): Add comment why GC cannot happen. - -2005-09-22 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macterm.c (xlfdpat_block_match_1): Fix assertion. - (init_font_name_table) [TARGET_API_MAC_CARBON]: Don't add style - variants for a scalable font multiple times. - -2005-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * process.c (create_process) [RTU || UNIPLUS || DONT_REOPEN_PTY]: - Setup slave tty options before forking. - -2005-09-20 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (xg_set_geometry): Do a gtk_window_move if program - positions have been set for the frame (as is done for frames in - special-display-buffer-names). - -2005-09-19 Kim F. Storm <storm@cua.dk> - - * editfns.c (Fformat): Don't scan past end of format string that - ends in %. Reported by Johan Bockg,Ae(Brd. - -2005-09-18 Andreas Schwab <schwab@suse.de> - - * window.h (struct window): Remove height_fixed_p, no longer set. - - * window.c (make_window): Don't initialize height_fixed_p. - (window_fixed_size_p): Don't use it. - -2005-09-18 John Paul Wallington <jpw@pobox.com> - - * data.c (Fdefalias): Signal an error if SYMBOL is not a symbol. - -2005-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * Makefile.in (SOME_MACHINE_OBJECTS): Undo previous change. - - * macfns.c (image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]: - New variables. - [TARGET_API_MAC_CARBON] (Fx_file_dialog): Don't allow multiple - file selection. - - * sysdep.c [MAC_OS8]: Don't include stdlib.h. Include sys/param.h. - -2005-09-17 Eli Zaretskii <eliz@gnu.org> - - * Makefile.in (XMENU_OBJ) [!HAVE_CARBON]: Reinstate variable. - (obj): Use XMENU_OBJ, not a literal xmenu.o. - -2005-09-16 Romain Francoise <romain@orebokech.com> - - * fileio.c (syms_of_fileio) <write-region-inhibit-fsync>: Doc fix. - -2005-09-15 Richard M. Stallman <rms@gnu.org> - - * xdisp.c (overlay_arrow_at_row): Add HAVE_WINDOW_SYSTEM conditional. - (display_mode_element): Instead of `lisp_string' and `this', - record `offset' and increment that. - `last_offset' replaces `last'. - - * Makefile.in (XMENU_OBJ): Variable deleted. - (obj): Use xmenu.o unconditionally. - (SOME_MACHINE_OBJECTS): Delete xmenu.o. - - * emacs.c (main): Don't conditionalize syms_of_xmenu on HAVE_XMENU. - -2005-09-15 Kim F. Storm <storm@cua.dk> - - * xdisp.c (move_it_vertically): Don't try to fetch byte BEGV-1. - (reseat_at_next_visible_line_start): Likewise (in xassert). - -2005-09-14 Romain Francoise <romain@orebokech.com> - - * fileio.c (write_region_inhibit_fsync): New variable. - (Fwrite_region): Use it to skip call to fsync. - (syms_of_fileio): Initialize it. - -2005-09-14 Kenichi Handa <handa@m17n.org> - - * coding.c (code_convert_region_unwind): Argument format changed. - (run_pre_post_conversion_on_str): If pre-write-conversion function - changed the current buffer, delete the new buffer. - (run_pre_write_conversin_on_c_str): Likewise. - - * fileio.c (Fexpand_file_name): Check multibyteness of - default_directory. - -2005-09-13 Kenichi Handa <handa@m17n.org> - - * composite.c (compose_chars_in_text): Delete it. - - * composite.h (compose_chars_in_text): Delete extern. - -2005-09-13 Kim F. Storm <storm@cua.dk> - - * print.c (print_error_message): Fix last change. - -2005-09-12 Kim F. Storm <storm@cua.dk> - - * composite.c (compose_chars_in_text): Fix setup of `pend'. - Unconditionally reload `ptr' and `pend' after eval. - - * xdisp.c (message3): Pass copy of lisp string to message_dolog. - - * print.c (print_error_message): Pass copy of caller name to - message_dolog. - - * fileio.c (auto_save_error): Pass copy of lisp string to message2. - -2005-09-12 Kenichi Handa <handa@m17n.org> - - * xdisp.c (display_mode_element): Be sure to make variables THIS - and LISP_STRING point into a string data of ELT. - -2005-09-12 Kim F. Storm <storm@cua.dk> - - * editfns.c (Ftranslate_region_internal): Reload `tt' after - signal_after_change that may have GC'ed. - (Fmessage, Fmessage_box, Fmessage_or_box): Doc fix. - - * keymap.c (Fdescribe_buffer_bindings): Reload `translate' - after insert while runs signal_after_change. - - * minibuf.c (Fminibuffer_complete_word): Move `completion_string' - declaration to where it is used. - - * w32.c (check_windows_init_file): Fix allocation of error buffer. - - * xfns.c (x_encode_text): Declare static. Add FREEP arg. - (x_set_name_internal): Call x_encode_text with new FREEP arg to - know if xfree is needed instead of guessing. - - * xterm.h (x_encode_text): Remove prototype. - -2005-09-11 Chris Prince <cprince@gmail.com> (tiny change) - - * w32term.c (x_bitmap_icon): Load small icons too. - -2005-09-10 Romain Francoise <romain@orebokech.com> - - * buffer.c (init_buffer): Grow buffer to add directory separator - and terminal zero. Fix typos. - -2005-09-10 Eli Zaretskii <eliz@gnu.org> - - * buffer.c (init_buffer): Fix error message for failed call to - get_current_dir_name. - (get_current_dir_name): Remove prototype. - - * xsmfns.c (get_current_dir_name): Remove prototype. - - * lisp.h (get_current_dir_name) [!HAVE_GET_CURRENT_DIR_NAME]: - Add prototype. - - * sysdep.c [WINDOWSNT]: Add prototype for getwd. - Don't #undef NULL after including blockinput.h. - - * config.in: Regenerated. - -2005-09-10 Giuseppe Scrivano <gscrivano@gmail.com> - - Remove the MAXPATHLEN limitations: - - * sysdep.c (get_current_dir_name) [!HAVE_GET_CURRENT_DIR_NAME]: - New function. - - * buffer.c (init_buffer): Use it. - - * xsmfns.c (smc_save_yourself_CB): Ditto. - -2005-09-09 Kim F. Storm <storm@cua.dk> - - * doc.c (Fsubstitute_command_keys): Lookup key binding for - commands that are remapped from some other command. - - * xdisp.c (try_window_reusing_current_matrix): Clear mode_line_p - flag in disabled rows below the window. - - * frame.h (struct frame): New member updated_p. - - * xdisp.c (redisplay_internal): Mark updated frames in new updated_p - member. Remove local `updated' array and associated variables. - -2005-09-07 Kim F. Storm <storm@cua.dk> - - * xdisp.c (handle_display_prop): Respect overlay window property. - - * xdisp.c (try_window): Remove superfluous cursor_height calculation. - Fixes crash reported by YAMAMOTO Mitsuharu. - -2005-09-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macterm.c (struct xlfdpat_block, struct xlfdpat): New structs. - (xlfdpat_destroy, xlfdpat_create, xlfdpat_exact_p) - (xlfdpat_block_match_1, xlfdpat_match): New functions. - (xlfdpat_block_match): New macro. - (mac_to_x_fontname): Don't use tolower for non-ASCII characters. - (x_font_name_to_mac_font_name): Set coding.dst_multibyte to 0. - (add_font_name_table_entry): Increase font_name_table_size more - rapidly. - (mac_c_string_match): Remove function. - (mac_do_list_fonts): Use XLFD pattern match instead of regular - expression match. - - * xfaces.c (xstrlwr): Don't use tolower for non-ASCII characters. - -2005-09-03 Richard M. Stallman <rms@gnu.org> - - * xdisp.c (redisplay_internal): Make UPDATED as long as needed. - (move_it_in_display_line_to): Stop after last char on line even - on a windowing terminal, if that's the specified stop position. - - * fns.c (Fsort): Doc fix. - - * editfns.c (Fpropertize): Don't insist that properties be symbols. - -2005-09-02 Stefan Monnier <monnier@iro.umontreal.ca> - - * dired.c (directory_files_internal_unwind, directory_files_internal) - (file_name_completion): Use a Save_Value object rather than a cons of - two 16bit ints to store the DIR*. - (directory_files_internal, file_name_completion): Handle both EINTR and - EAGAIN consistently after `readdir'. - -2005-09-01 Stefan Monnier <monnier@iro.umontreal.ca> - - * intervals.c (update_interval): Add position info in error. - - * dispnew.c (window_to_frame_hpos, update_window): - Avoid gcc warning about unused variable `f'. - -2005-08-31 Jason Rumney <jasonr@gnu.org> - - * w32menu.c (add_menu_item): If unicode_append_menu returns an - error, revert to using AppendMenu. - -2005-08-31 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * image.c (PIX_MASK_DRAW, PIX_MASK_RETAIN): Remove argument. - All uses changed. - [MAC_OS] (XPutPixel, XGetPixel): Add efficient versions for common - cases. - (x_create_x_image_and_pixmap) [MAC_OS]: Don't call x_destroy_x_image. - [MAC_OS] (find_image_fsspec) [!MAC_OSX]: Don't use FSRef. - Use posix_pathname_to_fsspec. - [MAC_OS] (xpm_load_image): Fill in background_transparent field - while we have mask. - - * macgui.h [!TARGET_API_MAC_CARBON] (GetPixDepth): New define. - - * macterm.h (PIX_MASK_DRAW, PIX_MASK_RETAIN): Move defines to image.c. - -2005-08-29 Stefan Monnier <monnier@iro.umontreal.ca> - - * syntax.c (update_syntax_table): Properly reproduce the special +1 - setting of e_property at the end of the buffer when bumping into the - INTERVALS_AT_ONCE limit. - -2005-08-27 Eli Zaretskii <eliz@gnu.org> - - * emacs.c (USAGE1): Fix the description of the -Q option. - -2005-08-26 Stefan Monnier <monnier@iro.umontreal.ca> - - * xdisp.c (pos_visible_p): Yet another int/Lisp_Object mixup (YAILOM). - -2005-08-26 Kim F. Storm <storm@cua.dk> - - * xdisp.c (resize_mini_window): Fix 2005-08-20 change. - Don't move PT to new window start. - -2005-08-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * keyboard.c (kbd_buffer_get_event) [MAC_OS]: Make events for - ICONIFY/DEICONIFY_EVENT. - - * macterm.c (mac_copy_area, mac_copy_area_with_mask): - Restore background color. - (mac_handle_visibility_change): New function. - (x_make_frame_invisible, x_iconify_frame) - (XTread_socket) [!USE_CARBON_EVENTS]: Use it. - [USE_CARBON_EVENTS] (mac_handle_window_event) - (install_window_handler): Handle visibility change events. - (x_make_frame_visible): Don't reposition window if it is iconified - or asked for visible before. Select and uncollapse window when it - is made visible. - (x_make_frame_invisible): Don't reset x_highlight_frame. - (x_iconify_frame): Likewise. Make invisible frame visible before - it is iconified. - (read_socket_inev): Move variable outside #if USE_CARBON_EVENTS. - (do_window_update): Don't change visibility of invisible frame. - -2005-08-22 Juri Linkov <juri@jurta.org> - - * term.c (turn_on_face): Check for TS_set_foreground and - TS_set_background depending on standout_mode. Simplify. - -2005-08-21 Kim F. Storm <storm@cua.dk> - - * fringe.c (update_window_fringes): Only put TOP and BOTTOM - bitmaps on fully visible rows. - - * fringe.c (update_window_fringes): Replace FORCE_P arg with - KEEP_CURRENT_P arg; if non-zero, don't update current row fringes, - and return 0. - - * xdisp.c (redisplay_window): Call update_window_fringes with - KEEP_CURRENT_P non-0 if we are going to refresh fringes later. - -2005-08-20 Richard M. Stallman <rms@gnu.org> - - * xdisp.c (display_echo_area_1): Get display start pos from w->start. - (resize_mini_window): Set w->start, and PT, so as to display the tail - end of the buffer, if it doesn't all fit. - -2005-08-18 Kim F. Storm <storm@cua.dk> - - * xdisp.c (calc_pixel_width_or_height): Use actual display - resolution when available instead of Vdisplay_pixels_per_inch. - -2005-08-17 Kim F. Storm <storm@cua.dk> - - * xdisp.c (pos_visible_p): Adjust X value if window is hscrolled. - - * dispnew.c (buffer_posn_from_coords): Check that target row is - within matrix. - -2005-08-16 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.c (x_wm_set_icon_pixmap): Move GTK specific code to - xg_set_frame_icon and call it. - - * gtkutil.c (xg_set_frame_icon): New function. - - * gtkutil.h (xg_set_frame_icon): Declare it. - -2005-08-16 Kim F. Storm <storm@cua.dk> - - * dispnew.c (increment_row_positions): Skip non-enabled rows. - - * window.c (SAVED_WINDOW_VECTOR_SIZE): Remove dangerous define. - (Fcurrent_window_configuration): Use VECSIZE macro instead. - -2005-08-15 Richard M. Stallman <rms@gnu.org> - - * xdisp.c (message3_nolog): Clear echo_message_buffer. - -2005-08-15 Kim F. Storm <storm@cua.dk> - - * lisp.h (QUIT) [!SYNC_INPUT]: Throw t to Vthrow_on_input. - - * process.c (deactivate_process, status_notify, read_process_output) - (update_status, status_convert, decode_status, allocate_pty) - (make_process, remove_process, list_processes_1) - (create_process_1, unwind_request_sigio, read_process_output) - (send_process, keyboard_bit_set): Declare static. - (Fdelete_process): Simplify. Pass process to status_notify, so we - don't try to read output from it. - (status_notify): New arg deleting_process--don't try to read - output from that process. - - * lisp.h (deactivate_process, status_notify, read_process_output): - Remove prototypes. - -2005-08-14 Richard M. Stallman <rms@gnu.org> - - * image.c (syms_of_image): Init Qxbm, Qpbm before calling - define_image_type. - -2005-08-13 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (xg_get_pixbuf_from_pix_and_mask): New function. - (xg_get_image_for_pixmap): Move some code to - xg_get_pixbuf_from_pix_and_mask, and call it. - - * gtkutil.h (xg_get_pixbuf_from_pix_and_mask): Declare. - - * xterm.c (x_wm_set_icon_pixmap): Call xg_get_pixbuf_from_pix_and_mask - to get an GTK icon and set it with GTK functions to avoid having GTK - override an icon set with just X functions. - -2005-08-11 Richard M. Stallman <rms@gnu.org> - - * image.c (syms_of_image): Init image_types here, and call - define_image_type. - (init_image): Not here. - -2005-08-09 Richard M. Stallman <rms@gnu.org> - - * bytecode.c (BYTE_CODE_QUIT): Throw t to Vthrow_on_input. - - * lisp.h (QUIT): Throw t to Vthrow_on_input. - -2005-08-09 Thien-Thi Nguyen <ttn@gnu.org> - - * floatfns.c (Fexpt): Use floats for negative exponent. - -2005-08-08 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (xg_modify_menubar_widgets): Remove semicolon that - should not be there, causing menu display errors with GTK 2.6.9. - -2005-08-07 Richard M. Stallman <rms@gnu.org> - - * floatfns.c (Fexpt): Undo previous change. - - * dispnew.c (Fframe_or_buffer_changed_p): Take an arg - so it can be used with various state vectors. - - * emacs.c (endif): Convert -script into -scriptload. - (standard_args): Add -scriptload. Allow -basic-display with one dash. - - * fns.c (syms_of_fns): Add `emacs' to features. - - * term.c (set_terminal_modes): If no TS_termcap_modes string, - output newlines to scroll the old screen contents off the screen. - -2005-08-06 Thien-Thi Nguyen <ttn@gnu.org> - - * floatfns.c (Fexpt): Use floats for negative exponent. - Reported by D Goel. - -2005-08-02 Richard M. Stallman <rms@gnu.org> - - * frame.c (Fframe_char_width): Doc fix. - -2005-07-30 Juanma Barranquero <lekktu@gmail.com> - - * xdisp.c (syms_of_xdisp) <redisplay-end-trigger-functions>: - Defvar it. - -2005-07-28 Juanma Barranquero <lekktu@gmail.com> - - * w32fns.c (my_set_window_pos, my_show_window): Don't declare. - (my_create_window, my_create_tip_window): Make static. - - * w32term.c (my_show_window, my_set_window_pos, my_set_focus) - (my_set_foreground_window, my_destroy_window): Make static. - -2005-07-26 Paul Eggert <eggert@cs.ucla.edu> - - Merge gnulib getopt implementation into Emacs. - - * s/cygwin.h (C_SWITCH_SYSTEM): Remove, since gettext.h is - now part of lib-src. - -2005-07-26 Stefan Monnier <monnier@iro.umontreal.ca> - - * eval.c (Fdefvar): Allow (defvar enable-multibyte-characters). - -2005-07-25 Jason Rumney <jasonr@gnu.org> - - * w32menu.c (w32_menu_display_help): Suppress tooltip when - navigating menus with the keyboard. - -2005-07-23 Richard M. Stallman <rms@gnu.org> - - * insdel.c (syms_of_insdel): staticpro combine_after_change_buffer. - - * bytecode.c (MAYBE_GC): Test gc_cons_threshold and - gc_relative_threshold, one by one. - - * keyboard.c (read_char): Test gc_cons_threshold. - (syms_of_keyboard): staticpro Qecho_area_clear_hook. - - * eval.c (Feval, Ffuncall): Test gc_cons_threshold and - gc_relative_threshold, one by one. - - * alloc.c (gc_cons_threshold): Not static. - (gc_cons_combined_threshold): Var deleted. - (gc_relative_threshold): New variable. - (Fgarbage_collect, init_alloc_once): Compute gc_relative_threshold - instead of gc_cons_combined_threshold. - - * lisp.h (gc_cons_threshold, gc_relative_threshold): Declare. - (gc_cons_combined_threshold): Declaration deleted. - -2005-07-23 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * mac.c: Don't include stdlib.h or string.h. - (Fdo_applescript, Fmac_file_name_to_posix) - (Fmac_file_name_to_posix): Doc fixes. - [TARGET_API_MAC_CARBON] (Fmac_get_preference) - (Fmac_code_convert_string): Likewise. - [MAC_OSX] (init_mac_osx_environment): Fall back on terminal mode - if the executable is not contained in a bundle. - - * macfns.c: Don't include stdlib.h or string.h. Include atimer.h. - (gray_width, gray_height): Remove defines. - (gray_bits, gray_bitmap_width, gray_bitmap_height) - (gray_bitmap_bits): Remove variables. - (lispy_function_keys): Remove extern. - (free_frame_menubar): Add extern. - (x_window_to_frame): Remove function. - (unwind_create_tip_frame): Add declaration. - (x_set_name_internal): New function. - (x_set_name, x_set_title): Use it. - (Fx_create_frame, Fx_display_grayscale_p, Fx_display_pixel_width) - (Fx_display_pixel_height, Fx_display_planes) - (Fx_display_color_cells, Fx_server_max_request_size) - (Fx_server_vendor, Fx_server_version, Fx_display_screens) - (Fx_display_mm_height, Fx_display_mm_width) - (Fx_display_backing_store, Fx_display_visual_class) - (Fx_display_save_under, Fx_synchronize, Fx_show_tip): Doc fixes. - - * macmenu.c (Fx_popup_menu, Fx_popup_dialog): Doc fixes. - - * macselect.c (Fx_own_selection_internal): Follow error conventions. - (Fx_get_selection_internal, Fx_selection_owner_p) - (Fx_selection_exists_p): Doc fixes. - (syms_of_macselect) <selection-converter-alist>: Likewise. - -2005-07-21 Juanma Barranquero <lekktu@gmail.com> - - * buffer.c (syms_of_buffer) <cursor-type>: Doc fix. - - * ccl.c (Fregister_ccl_program): Fix typos in docstring. - (Fccl_execute_on_string): Likewise; add usage info. - - * composite.c (Fcompose_region_internal) - (Fcompose_string_internal): - Improve argument/docstring consistency. - - * minibuf.c (Fminibuffer_prompt_end, Feval_minibuffer): - Fix typos in docstrings. - - * textprop.c (Fnext_char_property_change) - (Fprevious_char_property_change): Doc fixes. - - * window.c (Fset_window_margins, Fset_window_fringes): - Improve argument/docstring consistency. - - * xfaces.c (Finternal_lisp_face_p): Doc fix. - -2005-07-21 Andreas Schwab <schwab@suse.de> - - * eval.c (restore_stack_limits): Return a value. - -2005-07-20 Juanma Barranquero <lekktu@gmail.com> - - * eval.c (Fdefvar): Doc fix. - -2005-07-20 Kim F. Storm <storm@cua.dk> - - * fileio.c (Fdo_auto_save, do_auto_save_unwind): - Use make_save_value to unwind protect stream. - - * lread.c (Fload, load_unwind): - Use make_save_value to unwind protect stream. - -2005-07-19 Juanma Barranquero <lekktu@gmail.com> - - * eval.c (Fprog2, Fcalled_interactively_p), - (syms_of_eval) <debug-on-quit>: Doc fixes. - (syms_of_eval) <max-specpdl-size>: - (Finteractive_p): Fix typos in docstrings. - -2005-07-19 Kim F. Storm <storm@cua.dk> - - * w32fns.c (Vx_hand_shape): Variable removed. - (syms_of_w32fns): Intern and staticpro Qw32_charset_default. - -2005-07-19 Kenichi Handa <handa@m17n.org> - - * fns.c (Fstring_as_multibyte): Escape backslashes in the docstring. - -2005-07-18 Stefan Monnier <monnier@iro.umontreal.ca> - - * buffer.h (Fgenerate_new_buffer_name): Declare (for use in coding.c). - -2005-07-18 Kim F. Storm <storm@cua.dk> - - * frame.h (struct frame): New member already_hscrolled_p. - - * xdisp.c (redisplay_internal): Only try to hscroll each frame once - to avoid redisplay looping hscrolling back and forth ad infinitum. - -2005-07-18 Juri Linkov <juri@jurta.org> - - * buffer.c (scroll-up-aggressively, scroll-down-aggressively): - * keymap.c (Fminor_mode_key_binding): - * macterm.c (mac-emulate-three-button-mouse): - Delete duplicate duplicate words. - -2005-07-18 Ken Raeburn <raeburn@gnu.org> - - * minibuf.c (Ftest_completion): Fix odd syntax in test. - -2005-07-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macfns.c (x_set_cursor_color): Use XSetBackground and XSetForeground. - - * macgui.h (struct _XGC): New struct. - (GC): Use it. - (GCForeground, GCBackground, GCFont): Use X11 mask values. - (XCreateGC, XParseGeometry): Move externs to macterm.h. - - * macterm.c (x_bitmap_icon, x_make_frame_visible): Remove declarations. - (XSetFont): Add declaration. - (mac_set_forecolor, mac_set_backcolor, mac_set_colors): - Remove functions. - (GC_FORE_COLOR, GC_BACK_COLOR, GC_FONT, MAC_WINDOW_NORMAL_GC): - New defines. - (XDrawLine, mac_draw_line_to_pixmap, XClearWindow) - (mac_draw_bitmap, XCreatePixmapFromBitmapData, XFillRectangle) - (mac_draw_rectangle, mac_draw_string_common, mac_scroll_area): - Use them. - (mac_erase_rectangle): New function. - (XClearArea, x_draw_fringe_bitmap, x_clear_glyph_string_rect) - (x_draw_stretch_glyph_string): Use it. - (XChangeGC, XCreateGC, XGetGCValues, XSetForeground) - (XSetBackground, XSetFont): Adjust for new GC implementation. - (x_draw_fringe_bitmap, x_draw_box_rect): Use GC to set colors. - (XTset_vertical_scroll_bar): Clear area under scroll bar. - - * macterm.h (struct mac_display_info): Change types of - scratch_cursor_gc black_relief.gc, and white_relief.gc to GC. - (XCreateGC, XParseGeometry): Move externs from macgui.h. - - * xfaces.c [MAC_OS] (XCreateGC): Remove extern. - -2005-07-16 Richard M. Stallman <rms@gnu.org> - - * buffer.c (Fmake_overlay): Doc fix. - -2005-07-16 Eli Zaretskii <eliz@gnu.org> - - * w32proc.c (syms_of_ntproc): staticpro Qhigh, Qlow, - Vw32_valid_locale_ids, and Vw32_valid_codepages. - -2005-07-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * mac.c [TARGET_API_MAC_CARBON] (Fmac_code_convert_string): - Use Fstring_as_unibyte instead of string_make_unibyte. - -2005-07-15 Richard M. Stallman <rms@gnu.org> - - * xdisp.c (select_frame_for_redisplay): Use find_symbol_value. - -2005-07-15 Kim F. Storm <storm@cua.dk> - - * xdisp.c: Fix redisplay loop in last change. - (IT_POS_VALID_AFTER_MOVE_P): New macro. - (move_it_vertically_backward, move_it_by_lines): Use it. - -2005-07-14 Jason Rumney <jasonr@gnu.org> - - * w32.c (init_environment): Default HOME directory to user's - appdata directory if possible. - -2005-07-14 Kim F. Storm <storm@cua.dk> - - * .gdbinit (pitx): Fix output format. Print string charpos. - - * lread.c (syms_of_lread): Initialize seen_list. - - * search.c (syms_of_search): Staticpro searchbuf.whitespace_regexp. - - * syntax.c (syms_of_syntax): Staticpro lisp objects in gl_state. - Staticpro re_match_object. - -2005-07-14 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macselect.c (get_scrap_target_type_list): Avoid NULL pointer - dereference. - - * macterm.c (mac_window_to_frame): Remove duplicate define. - -2005-07-14 Kenichi Handa <handa@m17n.org> - - * coding.c (code_convert_region_unwind): ARG is changed to a cons. - (code_convert_region): Adjust for the above change. - (set_conversion_work_buffer): If the work buffer is already in - use, generate a new buffer and return it. Otherwise return Qnil. - (run_pre_post_conversion_on_str): Adjust for the above change. - (run_pre_write_conversin_on_c_str): Likewise. - -2005-07-13 Kim F. Storm <storm@cua.dk> - - * xdisp.c (start_display): Don't reseat to next visible line start - if current start position is in a string or image. - (move_it_vertically_backward): Be sure to move out of strings and - images when moving it2 forward. - (move_it_by_lines): When moving forward, move to next buffer - position if we end up in a string or image. When moving backward, - count rows moved over when moving to start of current row in case - row starts in middle of a string or image. Also move further - backward if we end up in a string or image. - (try_cursor_movement): If overlay string spans multiple lines, - move backward to set cursor on start of an overlay string. - (cursor_row_p): Row is ok if cursor is at newline from string, but - string starts on this line (so we always position cursor at start - of string). - - * indent.c (Fvertical_motion): If start position is on an image, - don't move back if we move too far (that's almost certain to happen). - - * xdisp.c (cursor_row_fully_visible_p): Allow partially visible - row in minibuffer windows. - (try_window): Don't check margins in minibuffer windows. - -2005-07-13 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macterm.c: Don't include stdlib.h or composite.h. - (x_use_underline_position_properties, last_mouse_press_frame) - (x_noop_count, Qvendor_specific_keysyms): Remove unused variables. - (syms_of_macterm, mac_initialize): Don't initialize them. - (waiting_for_input, initial_argv, initial_argc) - (Vcommand_line_args, Vx_no_window_manager, errno, window_scroll) - (set_frame_menubar, path_from_vol_dir_name): Remove externs. - (extra_keyboard_modifiers): Fix type in extern. - (x_window_to_frame, x_window_to_scroll_bar): Remove declarations. - (x_scroll_bar_report_motion): Add argument types to declaration. - (mac_compute_glyph_string_overhangs): Add declaration. - (disable_mouse_highlight): Remove unused variable. - [USE_TOOLKIT_SCROLL_BARS] (construct_scroll_bar_click) - (x_scroll_bar_handle_press, x_scroll_bar_handle_release) - (x_scroll_bar_handle_drag): Remove argument `timestamp'. - All callers changed. - [USE_TOOLKIT_SCROLL_BARS] (construct_scroll_bar_click): Don't set - timestamp. - [USE_CARBON_EVENTS] (mac_handle_mouse_event): Likewise. - (x_scroll_bar_create, XTset_vertical_scroll_bar): Show scroll bar - only when its width is less than the height. - (XTredeem_scroll_bar): Sync with xterm.c. - (font_name_table, font_name_table_size, font_name_count): - Make static. - (drag_and_drop_file_list): Remove variable. Previous use is now - local to function. - (do_ae_open_documents): Move DRAG_N_DROP event construction part - from XTread_socket. - (XTread_socket): Consolidate setting of event timestamp. - Move DRAG_N_DROP event construction part to do_ae_open_documents. - Support extra_keyboard_modifiers. - - * xfaces.c (try_font_list) [MAC_OS]: Try font family name - beginning with that for ASCII. - -2005-07-13 Stefan Monnier <monnier@iro.umontreal.ca> - - * alloc.c (gc_cons_combined_threshold, Vgc_cons_percentage): New vars. - (Fgarbage_collect, init_alloc_once): Set gc_cons_combined_threshold. - (syms_of_alloc): Declare gc-cons-percentage. - - * eval.c (Feval, Ffuncall): - * keyboard.c (read_char): - * bytecode.c (MAYBE_GC): Use gc_cons_combined_threshold. - - * lisp.h (gc_cons_combined_threshold): Declare. - -2005-07-12 Kim F. Storm <storm@cua.dk> - - * coding.c (Qprocess_argument): - * coding.h (Qprocess_argument): Remove unused var. - - * xselect.c (intern): Remove dup. intern and staticpro for QTIMESTAMP. - -2005-07-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * mac.c [!TARGET_API_MAC_CARBON]: Include charset.h, coding.h, and - Endian.h. - [!MAC_OSX] (fchmod, fchown): New functions. - (mac_get_code_from_arg): Don't accept Lisp integer as argument. - Use SBYTES and EndianU32_BtoN. - (mac_get_object_from_code): Return 4 byte string even if argument - is 0. Use make_unibyte_string and EndianU32_NtoB. - (Fmac_get_file_creator, Fmac_get_file_type, Fmac_set_file_creator) - (Fmac_set_file_type): Fix documents and argument declarations. - Don't specify kFSCatInfoNodeFlags. Support Mac OS Classic. - -2005-07-11 Stefan Monnier <monnier@iro.umontreal.ca> - - * window.c (Frecenter): Yet another int/Lisp_Object mixup (YAILOM). - -2005-07-11 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xfaces.c (x_update_menu_appearance): Use fontSet resource for - Lucid if X_I18N, font otherwise. - -2005-07-10 Steven Tamm <steventamm@mac.com> - - * mac.c (Fmac_get_file_type, Fmac_get_file_creator): Add. - (Fmac_set_file_type, Fmac_set_file_creator): Add. - (mac_get_object_from_code, mac_get_code_from_arg): Add. - -2005-07-10 Richard M. Stallman <rms@gnu.org> - - * lread.c (Qeval_buffer_list, Veval_buffer_list): New vars. - (syms_of_lread): Set up eval-buffer-list. - (Feval_buffer, Feval_region): Bind eval-buffer-list. - -2005-07-08 Richard M. Stallman <rms@gnu.org> - - * eval.c (Fdefvar): Allow defvaring a constant to itself quoted. - -2005-07-08 Kim F. Storm <storm@cua.dk> - - * keyboard.c (menu_bar_items): Don't GCPRO menu_bar_items_vector here. - (syms_of_keyboard): Initialize and staticpro menu_bar_items_vector. - -2005-07-07 Kim F. Storm <storm@cua.dk> - - * window.c (Frecenter): Fix last change (set iarg before use). - -2005-07-06 Richard M. Stallman <rms@gnu.org> - - * window.c (Frecenter): When arg is inside the scroll margin, - move it out of the margin. - -2005-07-06 Jason Rumney <jasonr@gnu.org> - - * w32console.c (initialize_w32_display): Detect when the console - dimensions are insane, and default to 80x25 instead. - (w32_use_full_screen_buffer): Default to nil. - -2005-07-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macterm.c (mac_draw_vertical_window_border): Use foreground of - VERTICAL_BORDER_FACE_ID for vertical border line. - (mac_encode_char): Call check_ccl_update in advance. - (mac_to_x_fontname, x_font_name_to_mac_font_name) - (init_font_name_table, mac_do_list_fonts, XLoadQueryFont): - Don't assume that font family length is less than 32. - (x_compute_min_glyph_bounds): Make static. - (x_load_font): Never set fonts_changed_p to zero. - -2005-07-04 Lute Kamstra <lute@gnu.org> - - * Update FSF's address in GPL notices. - -2005-07-03 Richard M. Stallman <rms@gnu.org> - - * xdisp.c (try_window): Fix previous change in how it handles - a partially-visible line or one only partly past the margin. - - * window.c (window_scroll_pixel_based): Take account - of this_scroll_margin when finding point when scrolling up. - -2005-06-29 Ralf Angeli <angeli@iwi.uni-sb.de> - - * window.c (window_scroll_pixel_based, window_scroll_line_based): - Handle `scroll-preserve-screen-position' non-nil, non-t specially. - (syms_of_window) <scroll-preserve-screen-position>: Doc fix. - -2005-07-02 Juri Linkov <juri@jurta.org> - - * w32term.c (w32_draw_vertical_window_border): Use foreground of - VERTICAL_BORDER_FACE_ID for vertical border line. - -2005-07-02 Eli Zaretskii <eliz@gnu.org> - - * fileio.c (Fcopy_file): Rearrange the code that calls fchown and - fchmod so that chmod doesn't get called on MSDOS before the file - is closed. - -2005-07-01 Jason Rumney <jasonr@gnu.org> - - * w32term.c (cleartype_active): New flag for enabling sub-pixel - workaround. - (w32_initialize): Initialize it. - (w32_native_per_char_metric): Allow a couple of extra pixels when - Cleartype is active. - - * w32term.c (w32_initialize): Move check for screen reader here - from syms_of_w32term. - -2005-06-30 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.c (handle_one_xevent): bzero compose_status when nbytes - is not zero. - -2005-07-01 Masatake YAMATO <jet@gyve.org> - - * emacs.c (main): Passing ADD_NO_RANDOMIZE to `personality'. - -2005-06-30 Juri Linkov <juri@jurta.org> - - * xdisp.c (x_draw_vertical_border): If left fringe is not present - decrease x coord of vertical border by 1 pixel to not occupy text - area of the right window. - - * xterm.c (x_draw_vertical_window_border): Use foreground of - VERTICAL_BORDER_FACE_ID for vertical border line. - - * term.c (turn_on_face): In standout mode apply specified - fg to bg, and specified bg to fg (this makes the logic of - inversion on terminal consistent with X). - -2005-06-29 Juanma Barranquero <lekktu@gmail.com> - - * eval.c (user_variable_p_eh): New function. - (Fuser_variable_p): Use it. Clarify docstring. - Return t for aliases of user options, nil for alias loops. - -2005-06-27 Richard M. Stallman <rms@gnu.org> - - * eval.c (Fdefvar): Improve error message. - -2005-06-27 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macterm.c [USE_CARBON_EVENTS] (mac_convert_event_ref): Fix last - change. - -2005-06-27 Juanma Barranquero <lekktu@gmail.com> - - * eval.c (Fdefvar): Don't try to set constant symbols. - -2005-06-25 Richard M. Stallman <rms@gnu.org> - - * macfns.c (Fx_show_tip): Pass new arg to try_window. - - * w32fns.c (Fx_show_tip): Pass new arg to try_window. - - * xfns.c (Fx_show_tip): Pass new arg to try_window. - - * xdisp.c (try_window): New arg CHECK_MARGINS. Calls changed. - (redisplay_window): Handle try_window reporting point in scroll margin. - - * dispextern.h (try_window): Declare new arg. - - * fileio.c (Fcopy_file): New arg PRESERVE_UID_GID. - Use fchmod to copy the file modes. - (Frename_file): Don't copy UID and GID here; - instead, specify t for PRESERVE_UID_GID when calling Fcopy_file. - - * eval.c (call_debugger): Take full care of extending stack limits - to make space for the debugger, and restore the change afterward. - Bind debug-on-error to nil. - (restore_stack_limits): New subroutine. - (Fsignal): Extend specpdl bound along with eval depth bound, - for calling edebug. Don't do either one, for calling debugger. - (find_handler_clause): Don't bind debug-on-error here. - Don't unbind anything either. - Temporarily advance max_specpdl_size for calling - internal_with_output_to_temp_buffer. - (grow_specpdl): Don't alter max_specpdl_size before signaling - an error. - (syms_of_eval) <max-specpdl-size>: Doc fix. - - * lread.c (read1): 0.0e+NaN should make a "positive" NaN. - -2005-06-24 Eli Zaretskii <eliz@gnu.org> - - * fileio.c (Frename_file): Undo last change: no need to ifdef away - chown on DOS_NT platforms. - - * w32.c (sys_chown): New function. - - * s/ms-w32.h (chown): New; define to sys_chown. - -2005-06-24 Juanma Barranquero <lekktu@gmail.com> - - * xdisp.c (syms_of_xdisp) <nobreak-char-display>: Doc fix. - (syms_of_xdisp) <void-text-area-pointer>: Doc fix. - - * fileio.c (Frename_file)[!DOS_NT]: Don't call chown on MSDOS/Windows. - -2005-06-23 Richard M. Stallman <rms@gnu.org> - - * xdisp.c (get_next_display_element): Finish reversing the tests of - Vnobreak_char_display. - - * xdisp.c (Vnobreak_char_display): Rename from Vshow_nonbreak_escape. - All uses changed. - (Qnobreak_space): Rename from Qno_break_space. All uses changed. - (syms_of_xdisp): Define nobreak-char-display and nobreak-space. - - * fileio.c (Frename_file): Preserve owner and group, if possible, - when copying. - -2005-06-23 Juanma Barranquero <lekktu@gmail.com> - - * abbrev.c (Funexpand_abbrev): - * category.c (Fmake_category_set): - * dispnew.c (Fsleep_for, Fsit_for): - * editfns.c (Fsubst_char_in_region): - * eval.c (Fdefvar, Fdefconst, Feval, Ffuncall): - * frame.c (make_frame_without_minibuffer): - * lread.c (read_vector): - * macfns.c (check_x_frame): - * process.c (Fstop_process, Fcontinue_process): - * search.c (Freplace_match): - * syntax.c (Fstring_to_syntax): - * w32fns.c (check_x_frame, check_x_display_info): - * xfaces.c (x_supports_face_attributes_p): - * xselect.c (Fx_own_selection_internal): Follow error conventions. - - * image.c (fn_png_init_io): Don't define it. - (init_png_functions) [HAVE_NTGUI]: Don't initialize fn_png_init_io. - (png_read_from_file): New function, based on png_read_from_memory. - (png_load): Use it, instead of fn_png_init_io. - -2005-06-23 Kim F. Storm <storm@cua.dk> - - * search.c (Fmatch_data): Remove evaporate option. - (Fset_match_data): Do not mention evaporate option in doc string. - Add commentary explaining evaporate arg (for internal use only). - (unwind_set_match_data): Add comment on evaporate use. - -2005-06-22 Miles Bader <miles@gnu.org> - - * xfaces.c (Qvertical_border): Rename from `Qvertical_divider'. - (realize_basic_faces, syms_of_xfaces): Update references to it. - * dispextern.h (enum face_id): Rename `VERTICAL_DIVIDER_FACE_ID' - to `VERTICAL_BORDER_FACE_ID'. - * dispnew.c (build_frame_matrix_from_leaf_window): Update references. - -2005-06-21 Juri Linkov <juri@jurta.org> - - * dispextern.h: Add extern Qframe_set_background_mode. - - * xfaces.c: Rename obsolete function Qframe_update_face_colors to - Qframe_set_background_mode. - - * frame.c (Fmodify_frame_parameters): - Call frame-set-background-mode after changing the background color - on non-window non-dos branch. - -2005-06-21 Juanma Barranquero <lekktu@gmail.com> - - * fns.c (Fchar_table_range): - * process.c (Fmake_network_process): Fix spellings. - -2005-06-20 Kim F. Storm <storm@cua.dk> - - * fns.c (Fsort): Doc fix. - -2005-06-20 Miles Bader <miles@gnu.org> - - * xfaces.c (Qvertical_divider): New variable. - (realize_basic_faces): Realize its face. - (syms_of_xfaces): Initialize it. - - * dispextern.h (enum face_id): Add `VERTICAL_DIVIDER_FACE_ID'. - - * dispnew.c (build_frame_matrix_from_leaf_window): Display vertical - window-separator on ttys using `vertical-divider' face by default. - -2005-06-17 Richard M. Stallman <rms@gnu.org> - - * xdisp.c (get_next_display_element): - Reverse test of Vshow_nonbreak_escape. - - * term.c (produce_special_glyphs): Use spec_glyph_lookup_face. - (Ftty_no_underline): New function. - (syms_of_term): defsubr it. - - * keyboard.c (read_char): Call restore_getcjmp after jump occurs. - - * dispnew.c (spec_glyph_lookup_face): New function. - (build_frame_matrix_from_leaf_window): Use it. - - * dispextern.h (spec_glyph_lookup_face): Add declaration. - - * buffer.c (syms_of_buffer) <cursor-type>: Doc fix. - -2005-06-12 Richard M. Stallman <rms@gnu.org> - - * keyboard.c (read_char): After catching a longjmp, - call restore_getcjmp. - -2005-06-17 Juanma Barranquero <lekktu@gmail.com> - - * xselect.c (lisp_data_to_selection_data): Fix spelling. - -2005-06-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macterm.c (mac_compute_glyph_string_overhangs): Don't set - overhangs unless the given glyph type is noncomposite CHAR_GLYPH. - [USE_CARBON_EVENTS] (mac_convert_event_ref): Convert dead key down - events. - (XTread_socket): Don't pass keyboard events with the option - modifier to the system when Vmac_command_key_is_meta is nil or - Vmac_option_modifier is non-nil. - [USE_CARBON_EVENTS] (read_socket_inev): New variable. - [USE_CARBON_EVENTS] (init_command_handler): Fix argument. - [USE_CARBON_EVENTS] (mac_handle_mouse_event): New Carbon event - handler function. - (install_window_handler) [USE_CARBON_EVENTS]: Install it. - (XTread_socket) [USE_CARBON_EVENTS]: Move mouse wheel event - handler part to mac_handle_mouse_event. - -2005-06-14 Juanma Barranquero <lekktu@gmail.com> - - * eval.c (Fdefvaralias): Rename arguments SYMBOL and ALIASED to - NEW-ALIAS and BASE-VARIABLE, respectively. - -2005-06-13 Stefan Monnier <monnier@iro.umontreal.ca> - - * xdisp.c (note_mode_line_or_margin_highlight): Lisp_Object/int mixup. - (get_phys_cursor_geometry, format_mode_line_unwind_data) - (get_line_height_property, x_produce_glyphs): Remove unused vars. - - * coding.c (run_pre_post_conversion_on_str): Remove unused var `buf'. - -2005-06-13 Eli Zaretskii <eliz@gnu.org> - - * w32term.c (x_use_underline_position_properties): New variable. - (x_draw_glyph_string): Remind in a comment to change doc string of - x-use-underline-position-properties if/when underline positioning - is implemented. - (syms_of_w32term): DEFVAR_BOOL x-use-underline-position-properties, - and initialize it to nil. - -2005-06-12 Jason Rumney <jasonr@gnu.org> - - * w32fns.c (NEWOPENFILENAME): New struct. - (Fx_file_dialog): Use it to trick the system into giving us up to - date dialogs on systems that are documented to support it. - Do not set OFN_FILEMUSTEXIST flag if looking for a directory. - -2005-06-12 Eli Zaretskii <eliz@gnu.org> - - * w32fns.c (w32_abort): Use the MB_YESNO dialog instead of - MB_ABORTRETRYIGNORE. Never return, even if DebugBreak does. - -2005-06-11 Eli Zaretskii <eliz@gnu.org> - - * image.c (x_create_x_image_and_pixmap) [HAVE_NTGUI]: Cast 4th arg - to CreateDIBSection to avoid a compiler warning. - (pbm_load): Cast 3rd arg to IMAGE_BACKGROUND to avoid a compiler - warning. - (png_load): Cast return values of fn_png_create_read_struct and - fn_png_create_info_struct, to avoid compiler warnings on W32. - Cast 3rd arg to IMAGE_BACKGROUND and image_background_transparent - to avoid compiler warnings. - (jpeg_load): Cast return value of fn_jpeg_std_error to avoid a - compiler warning on W32. Cast 3rd arg to IMAGE_BACKGROUND to - avoid a compiler warning. - (tiff_load): Cast return values of fn_TIFFOpen and - fn_TIFFClientOpen to avoid compiler warning on W32. Cast 3rd arg - to IMAGE_BACKGROUND to avoid a compiler warning. - (gif_load): Cast return values of fn_DGifOpenFileName and - fn_DGifOpen to avoid compiler warnings on W32. Cast 3rd arg to - IMAGE_BACKGROUND to avoid a compiler warning. - (DrawText) [HAVE_NTGUI || MAC_OS]: If already defined, undef - before redefining. - - * w32bdf.c (create_offscreen_bitmap): Cast `bitsp' to `void **' in - the call to CreateDIBSection, to avoid a compiler warning. - -2005-06-11 Jason Rumney <jasonr@gnu.org> - - * w32fns.c (Fx_file_dialog): Unblock input before falling back to - minibuffer. - * macfns.c (Fx_file_dialog): Likewise. - -2005-06-10 Eli Zaretskii <eliz@gnu.org> - - * makefile.w32-in ($(TEMACS)): Depend on addsection.exe. - -2005-06-10 Juanma Barranquero <lekktu@gmail.com> - - * process.c (syms_of_process) [ADAPTIVE_READ_BUFFERING]: - * w32fns.c (syms_of_w32fns): Fix spellings. - -2005-06-10 Eli Zaretskii <eliz@gnu.org> - - * unexw32.c (COPY_CHUNK, COPY_PROC_CHUNK): Add a new argument - `verbose'; print diagnostic messages only if it is non-zero. - All callers changed to pass a zero value unless DEBUG_DUMP is defined - in the environment. - (copy_executable_and_dump_data): Print section names with %.8s. - -2005-06-10 Masatake YAMATO <jet@gyve.org> - - * xdisp.c (note_mode_line_or_margin_highlight): Call clear_mouse_face - when mouse_face is not given. - -2005-06-09 Luc Teirlinck <teirllm@auburn.edu> - - * window.c (Fselect_window): Adapt call to Fselect_frame. - - * lisp.h: Update EXFUN of Fselect_frame. - - * keyboard.c (command_loop_1): Adapt call to Fselect_frame. - - * frame.c (Fhandle_switch_frame, Fselect_frame): Delete unused arg - no_enter. - (Fset_mouse_position, Fset_mouse_pixel_position, Ficonify_frame): - Adapt to above change. - -2005-06-10 Juanma Barranquero <lekktu@gmail.com> - - * fns.c (Fmemq, Fmaphash): Doc fixes. - -2005-06-09 Juanma Barranquero <lekktu@gmail.com> - - * xfaces.c (Fdisplay_supports_face_attributes_p): - Fix typo in docstring. - -2005-06-08 Steven Tamm <steventamm@mac.com> - - * unexmacosx.c (copy_data_segment): Copy __la_sym_ptr2 section - used by gcc4 on intel mac. - -2005-06-09 Kim F. Storm <storm@cua.dk> - - * search.c (Fmatch_data): Add optional RESEAT arg. Unchain markers - in REUSE list if non-nil; free them if equal to evaporate. - (Fset_match_data): Add optional RESEAT arg. Unchain markers in LIST - if non-nil; free them if equal to evaporate. Use XCAR/XCDR. - (restore_search_regs): Rename from restore_match_data. Uses changed. - (unwind_set_match_data): New function. - (record_unwind_save_match_data): New function like save-match-data. - - * lisp.h (Fmatch_data, Fset_match_data): Fix EXFUN. - (record_unwind_save_match_data): Add prototype. - (restore_search_regs): Rename from restore_match_data. - - * composite.c (compose_chars_in_text): - * eval.c (do_autoload): - * macmenu.c (set_frame_menubar): - * process.c (read_process_output, exec_sentinel): - * xmenu.c (set_frame_menubar): - * xdisp.c (prepare_menu_bars, update_menu_bar, update_tool_bar): - * w32menu.c (set_frame_menubar): - Use record_unwind_save_match_data. - -2005-06-08 Richard M. Stallman <rms@gnu.org> - - * xdisp.c (get_next_display_element): Alter previous change: - Distinguish Vshow_nonbreak_escape = t or not t. - For t, use escape_glyph once again, as before previous change. - Use space or hyphen for display, instead of the non-ASCII char. - (syms_of_xdisp) <show-nonbreak-escape>: Doc fix. - - * process.c (Fstart_process): Don't touch command_channel_p slot. - - * process.h (struct process): Delete command_channel_p. - -2005-06-07 Masatake YAMATO <jet@gyve.org> - - * xdisp.c (note_mode_line_or_margin_highlight): - Check the overlapping of re-rendering area to avoid flickering. - (note_mouse_highlight): Call clear_mouse_face if PART - is not ON_MODE_LINE nor ON_HEADER_LINE. - -2005-06-07 Kim F. Storm <storm@cua.dk> - - * process.c: Improve commentary for adaptive read buffering. - -2005-06-06 Stefan Monnier <monnier@iro.umontreal.ca> - - * xterm.c (x_create_toolkit_scroll_bar): Use XtNarrowScrollbars - if available. - -2005-06-06 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * macmenu.c (menu_quit_handler, install_menu_quit_handler): - New functions for popping down menus on C-g. - (set_frame_menubar, mac_menu_show): Call install_menu_quit_handler. - - * macterm.c: Make mac_quit_char_modifiers and mac_quit_char_keycode - non-static. - - * config.in: Add HAVE_CANCELMENUTRACKING. - -2005-06-06 Eli Zaretskii <eliz@gnu.org> - - * w32heap.h (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_PTR): Remove macros. - - * unexw32.c (RVA_TO_PTR): Move here from w32heap.h. - - * w32proc.c (RVA_TO_PTR): New macro. - - * w32heap.c (RVA_TO_PTR): No need to #undef now. - - * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/w32select.$(O)): - Depend on w32heap.h. - -2005-06-06 Luc Teirlinck <teirllm@auburn.edu> - - * keyboard.c (command_loop_1): Update Vthis_original_command. - -2005-06-06 Richard M. Stallman <rms@gnu.org> - - * xmenu.c (popup_get_selection): Undo previous change. - -2005-06-06 Juri Linkov <juri@jurta.org> - - * xdisp.c (Qno_break_space): New variable. - (syms_of_xdisp): Initialize it. - (get_next_display_element): Add no-break space and soft hypen - codes for iso8859-2 and iso8859-5. Don't add `\' for them. - Use `no-break-space' face for no-break spaces. - -2005-06-06 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * window.c (delete_window): Handle the case where a h/vchild has - a h/vchild. - -2005-06-05 Eli Zaretskii <eliz@gnu.org> - - * w32.c (sys_setsockopt): Change arg 4 to `const void *'. In the - call to pfn_setsockopt, cast optval to `const char *'. - -2005-06-04 Eli Zaretskii <eliz@gnu.org> - - * w32.c (gettimeofday): Use struct _timeb, not struct timeb. - (open_unc_volume): Cast return value of map_w32_filename, to avoid - compiler warnings. - - * s/ms-w32.h (fileno): Don't define if already defined. - - * emacs.c: Include w32heap.h, to avoid compiler warning about sbrk. - - * makefile.w32-in (DOC): Define to point to the generated DOC-X. - -2005-06-04 Richard M. Stallman <rms@gnu.org> - - * xmenu.c (popup_get_selection): Click not in menu deactivates menu. - -2005-06-04 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * macmenu.c (cleanup_popup_menu): New function. - (Fx_popup_menu): Unwind protect cleanup_popup_menu in case - mac_menu_show Quit:s. - (mac_menu_show): Quit on cancel if not popped up on click (i.e. - a dialog). - -2005-06-04 Kim F. Storm <storm@cua.dk> - - * coding.c (decode_coding_string): Handle CODING_FINISH_INTERRUPT. - - * callproc.c (Fcall_process): Don't use alloca to gradually - increase size of buf, as it effectively uses twice the necessary - space on the stack. Instead, pre-allocate buf of full size, and - gradually increase the read size. - - * bytecode.c (BYTE_CODE_QUIT): Check Vthrow_on_input. - - * eval.c (unbind_to): Preserve value of Vquit_flag. - - * xterm.c (handle_one_xevent): Also ignore mouse motion just - before a button release event. - -2005-06-03 Juanma Barranquero <lekktu@gmail.com> - - * xfaces.c (Finternal_lisp_face_equal_p): Really report - on faces in a frame, if the argument FRAME is non-nil. - Improve argument/docstring consistency. - -2005-06-02 Kim F. Storm <storm@cua.dk> - - * xdisp.c (MODE_LINE_NOPROP_LEN): New macro. - (x_consider_frame_title, Fformat_mode_line): Save offset into - mode_line_noprop_buf rather than pointer, in case buffer is relocated. - -2005-06-01 Kim F. Storm <storm@cua.dk> - - * fns.c (mapcar1): Maybe exit loop if original sequence was modified. - -2005-06-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macterm.c (mac_to_x_fontname, mac_do_list_fonts): Set XLFD - resolution fields for scalable fonts to 0. - - * xfaces.c (build_scalable_font_name): Round pixel size to the - nearest integer. - -2005-06-01 Kim F. Storm <storm@cua.dk> - - * xdisp.c (display_mode_line): Support nested calls to redisplay - and format-mode-line. Set mode_line_target to MODE_LINE_DISPLAY. - -2005-05-31 Stefan Monnier <monnier@iro.umontreal.ca> - - * fileio.c (Finsert_file_contents): - * xdisp.c (note_mode_line_or_margin_highlight): Lisp_Object/int mixup. - -2005-05-31 Kim F. Storm <storm@cua.dk> - - * xdisp.c (mode_line_noprop_buf, mode_line_noprop_buf_end) - (mode_line_noprop_ptr): Rename from frame_title_*. - (store_mode_line_noprop_char): Rename from store_frame_title_char. - (store_mode_line_noprop): Rename from store_frame_title. - (mode_line_target): New enum to specify current output target - for mode line formatting. - (display_mode_element): Test it rather than frame_title_ptr and - mode_line_string_list to determine where output should go. - (mode_line_proptrans_alist, mode_line_string_alist): Make static. - (Vmode_line_unwind_vector): New variable. - (format_mode_line_unwind_data, unwind_format_mode_line): - New functions for unwind protection in mode line formatting. - (x_consider_frame_title): Use them and new local var 'title_start' - to support nested calls to format-mode-line and redisplay. - Set mode_line_target to MODE_LINE_TITLE. - (Fformat_mode_line): Use them and new local var 'string_start' to - support nested calls to format-mode-line and redisplay. - Set mode_line_target to MODE_LINE_NOPROP or MODE_LINE_STRING. - Don't trim trailing dashes. - (decode_mode_spec): Don't make infinite number of trailing dashes - for MODE_LINE_NOPROP and MODE_LINE_STRING targets. - (syms_of_xdisp): Initialize and staticpro mode_line_string_face, - mode_line_string_face_prop, and Vmode_line_unwind_vector. - (init_xdisp): Initialize mode_line_noprop_ptr to start of _buf. - Initialize mode_line_target to MODE_LINE_DISPLAY. - -2005-05-29 Richard M. Stallman <rms@gnu.org> - - * buffer.c (Fbuffer_local_value): Call indirect_variable. - -2005-05-28 Masatake YAMATO <jet@gyve.org> - - * xdisp.c (note_mode_line_or_margin_highlight): Change the - pointer to a hand cursor when hoovering over a mouse-face. - -2005-05-27 Kenichi Handa <handa@m17n.org> - - * xterm.c (x_encode_char): Call check_ccl_update in advance. - - * ccl.c: Now an element of Vccl_program_table is a vector of - length 4, not 3. - (ccl_get_compiled_code): New arg idx. Caller changed. - Adjust for the change of Vccl_program_table. - (setup_ccl_program): Adjust for the change of Vccl_program_table. - (check_ccl_update): New function. - (Fregister_ccl_program): Use ASET to set an element of a vector. - Adjusted for the change of Vccl_program_table. - - * ccl.h (struct ccl_program): New member idx. - (check_ccl_update): Extern it. - -2005-05-27 Juanma Barranquero <lekktu@gmail.com> - - * image.c (Vimage_library_alist): Move from image.el. - (syms_of_image): Defvar it. - (lookup_image_type): Use it. - - * buffer.c (Fbuffer_local_value): Make argument name match its use - in docstring. - -2005-05-26 Juanma Barranquero <lekktu@gmail.com> - - * keyboard.c (Frecursive_edit): Fix typo in docstring. - (Fposn_at_x_y): Make argument name match its use in docstring. - -2005-05-26 Lute Kamstra <lute@gnu.org> - - * eval.c (Frun_hooks): Mention run-mode-hooks in docstring. - -2005-05-24 Masatake YAMATO <jet@gyve.org> - - * xdisp.c (note_mode_line_or_margin_highlight): Use b and e - as loop sentinels. - -2005-05-24 Nick Roberts <nickrob@snap.net.nz> - - * xmenu.c (Fx_popup_dialog): Add a third boolean argument to - select frame title ("Question"/"Information"). - (xdialog_show): Use it. - - * macmenu.c (Fx_popup_dialog, mac_dialog_show): As for xmenu.c. - - * w32menu.c (Fx_popup_dialog, w32_dialog_show): As for xmenu.c. - - * fns.c (Fyes_or_no_p, Fy_or_n_p): Call Fx_popup_dialog with - a third argument (Qnil). - - * lisp.h: x-popup-dialog can have three arguments. - - * editfns.c (Fmessage_box): Use "Information" for frame title. - -2005-05-23 Thien-Thi Nguyen <ttn@gnu.org> - - * termcap.c [VMS]: Include <starlet.h>. - -2005-05-23 Masatake YAMATO <jet@gyve.org> - - * xdisp.c (note_mode_line_or_margin_highlight): Add code - for mouse-face. Change the type of the first argument from `window' - to `Lisp_Object'. - (note_mouse_highlight): Call note_mode_line_or_margin_highlight with - window instead of w. - -2005-05-22 Andreas Schwab <schwab@suse.de> - - * process.c (send_process): Move misplaced volatile. - -2005-05-21 Richard M. Stallman <rms@gnu.org> - - * xdisp.c (display_mode_element): If we're processing a list and - padding is specified, put it after the last element. - -2005-05-21 Eli Zaretskii <eliz@gnu.org> - - * fileio.c (Fexpand_file_name) [DOS_NT]: Don't try to support - "superroot" on DOS_NT systems. - -2005-05-21 David Hunter <hunterd42@comcast.net> (tiny change) - - * process.c (send_process): Restore the SIGPIPE handler if we - catch a SIGPIPE. - -2005-05-20 Juanma Barranquero <lekktu@gmail.com> - - * image.c (lookup_image, png_read_from_memory): Remove hacks (and - misleading comments). - (DEF_IMGLIB_FN): Use C calling convention for image libraries. - -2005-05-20 KOBAYASHI Yasuhiro <kobayays@otsukakj.co.jp> - - * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges): - Correct the right value. - -2005-05-19 Nick Roberts <nickrob@snap.net.nz> - - * keyboard.c (syms_of_keyboard): Remove Lisp variables - post-command-idle-hook and post-command-idle-delay. - (command_loop_1): Don't try to execute post-command-idle-hook. - -2005-05-16 Kim F. Storm <storm@cua.dk> - - * xdisp.c (handle_display_prop): Handle empty replacement. - (handle_single_display_spec): Return -1 for empty replacement. - - * keyboard.c (adjust_point_for_property): Skip empty overlay string. - - * .gdbinit (pitx): Print more info about iterator. - -2005-05-16 Andreas Schwab <schwab@suse.de> - - * unexmacosx.c (unexec_realloc): Move declarations before statements. - -2005-05-14 Richard M. Stallman <rms@gnu.org> - - * xdisp.c (message3): Call cancel_echoing. - - * alloc.c (Fmemory_full_p): New function. - (syms_of_alloc): defsubr it. - - * process.c (send_process_trap): Unblock SIGPIPE. - (send_process): Reset SIGPIPE handler before reporting error. - -2005-05-14 Nick Roberts <nickrob@snap.net.nz> - - * emacs.c (syms_of_emacs): Fix doc string for system-type. - -2005-05-13 Richard M. Stallman <rms@gnu.org> - - * fileio.c (Ffind_file_name_handler): Handle lambda-exp as handler. - (Finsert_file_contents): If we read 0 bytes from a special file, - unlock the visited file if we locked it. - (Fmake_symbolic_link, Frecent_auto_save_p): Doc fixes. - (Ffile_exists_p, Ffile_symlink_p): Doc fixes. - -2005-05-13 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * emacs.c (main) [MAC_OS8]: Call init_atimer before mac_term_init. - - * keyboard.c (readable_events) [USE_TOOLKIT_SCROLL_BARS]: - Regard toolkit scroll bar thumb drag events as squeezable and prevent - redisplay from being paused by them. - - * mac.c [!MAC_OSX]: Include keyboard.h and syssignal.h. - [!MAC_OSX] (target_ticks): Remove variable. - [!MAC_OSX] (check_alarm, pause, index): Remove functions. - [!MAC_OSX && __MRC__] (sys_strftime): Likewise. - [!MAC_OSX] (select): If fd 0 is not set in rfds and some input - event occurs before timeout, behave as if the function were interrupted. - [!MAC_OSX] (sigblock, sigsetmask, alarm): Simulate SIGALRM - handling using Time Manager routines. - [!MAC_OSX] (mac_atimer_task, mac_atimer_qlink, signal_mask): - New variables. - [!MAC_OSX] (mac_atimer_handler, set_mac_atimer, remove_mac_atimer) - (setitimer): New functions. - - * macfns.c, macmenu.c: Don't include signal.h. - - * macterm.c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds): - Rename from get_control_part_bound. All callers changed. - (x_scroll_bar_clear): New function. - (x_clear_frame): Use it. - (XTset_vertical_scroll_bar): Don't call Draw1Control. - (x_scroll_bar_handle_click): Change type of second argument from - int to ControlPartCode. - (check_alarm): Remove declaration. - (XTread_socket) [!TARGET_API_MAC_CARBON]: Don't call it. - (XTread_socket): Use ControlPartCode instead of SInt16. - -2005-05-13 Nozomu Ando <nand@mac.com> - - * unexmacosx.c: Include assert.h. - (MACOSX_MALLOC_MULT16): New define. - [MACOSX_MALLOC_MULT16] (ptr_in_unexec_regions): Determine whether - ptr is in unexec regions by checking it is multiple of 16. - (unexec_malloc_header_t): New typedef. - (unexec_malloc, unexec_realloc, unexec_free): Store and use - allocated size information in unexec_malloc_header. - -2005-05-10 Richard M. Stallman <rms@gnu.org> - - * xterm.c (noinclude): Add #undef. - - * image.c, xfns.c, xmenu.c: Don't include signal.h. - -2005-05-09 Juanma Barranquero <lekktu@gmail.com> - - * fileio.c (Fexpand_file_name, Frename_file, Fadd_name_to_file) - (Fmake_symbolic_link, Faccess_file, Frecent_auto_save_p): - Doc fixes. - - * dired.c (Ffile_name_completion): Make argument name - match its use in docstring. - -2005-05-08 Luc Teirlinck <teirllm@auburn.edu> - - * eval.c (Fdefvaralias): Remove any pre-existing - variable-documentation property of the alias. - -2005-05-07 Thien-Thi Nguyen <ttn@gnu.org> - - * xfns.c (start_hourglass): Do nothing when running on a tty. - -2005-05-07 Juanma Barranquero <lekktu@gmail.com> - - * fns.c (Fchar_table_range): Fix typos in docstring. - -2005-05-06 Stefan Monnier <monnier@iro.umontreal.ca> - - * fns.c (Fchar_table_range): Yet Another Int/Lisp_Object Mixup. - -2005-05-06 Eli Zaretskii <eliz@gnu.org> - - * lread.c (Flocate_file_internal): Doc fix. - - * Makefile.in (lisp, shortlisp): Add jka-cmpr-hook.elc. - -2005-05-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macselect.c (x_own_selection): Accept Lisp string as result of - selection converter function. - (x_clear_frame_selections): Don't call x-lost-selection-functions - if Emacs is not owner of the selection. - (Vmac_services_selection): Put variable and initialization in - #ifdef MAC_OSX. - (syms_of_macselect) [MAC_OSX]: Set default value of - Vmac_services_selection to PRIMARY. - - * macterm.c (toolkit_scroll_bar_interaction): Remove unused variable. - (mac_handle_tool_bar_click): Remove unused function and declaration. - [USE_TOOLKIT_SCROLL_BARS] (scroll_bar_timer_callback) - (install_scroll_bar_timer, set_scroll_bar_timer) - (control_part_code_to_scroll_bar_part, construct_scroll_bar_click) - (get_control_part_bound, x_scroll_bar_handle_press) - (x_scroll_bar_handle_release, x_scroll_bar_handle_drag) - (x_set_toolkit_scroll_bar_thumb): New functions and declarations. - [USE_TOOLKIT_SCROLL_BARS] (last_scroll_bar_part, scroll_bar_timer) - (scroll_bar_timer_event_posted_p): New variables. - [USE_TOOLKIT_SCROLL_BARS] (SCROLL_BAR_FIRST_DELAY) - (SCROLL_BAR_CONTINUOUS_DELAY): New macros. - (x_scroll_bar_create): Set control reference with NewControl. - (x_scroll_bar_create) [USE_TOOLKIT_SCROLL_BARS]: - Initialize track_top and track_height to nil. - (x_scroll_bar_set_handle, x_scroll_bar_note_movement): - Put functions in #ifndef USE_TOOLKIT_SCROLL_BARS. - (XTset_vertical_scroll_bar): Don't make space between scroll bar - and associated window. - (XTset_vertical_scroll_bar) [MAC_OSX]: Get scroll bar area width - from window config. - (XTset_vertical_scroll_bar) [USE_TOOLKIT_SCROLL_BARS]: - Set track_top and track_height to nil when scroll bar size is changed. - Recalculate them if they are nil. - (XTread_socket) [MAC_OSX]: Use control kind to determine if the - clicked control is a scroll bar. - (XTread_socket) [USE_TOOLKIT_SCROLL_BARS]: Use toolkit scroll bar - event handler functions. Don't add modifiers to scroll bar click - events. Call scroll bar release handler when window is deactivated. - (mac_initialize): Remove unused code for X toolkit. - (syms_of_macterm) [!USE_TOOLKIT_SCROLL_BARS]: - Initialize Vx_toolkit_scroll_bars to nil. - - * macterm.h (struct scroll_bar) [USE_TOOLKIT_SCROLL_BARS]: - New members track_top and track_height. - - * sysselect.h [DARWIN || MAC_OSX]: Temporarily undefine - init_process when including sys/select.h. - -2005-05-05 Luc Teirlinck <teirllm@auburn.edu> - - * eval.c (Fdefvaralias): Doc fix. - - * xmenu.c (Fx_popup_menu, Fx_popup_dialog): Doc fixes. - -2005-05-05 Kim F. Storm <storm@cua.dk> - - * buffer.c (init_buffer_once): Set cursor_in_non_selected_windows - default value. - (syms_of_buffer): Add default-cursor-in-non-selected-windows. - Fix type of cursor-in-non-selected-windows. - -2005-05-03 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * mac.c: #undef init_process so not to conflict with system headers. - -2005-05-02 Richard M. Stallman <rms@gnu.org> - - * buffer.c (syms_of_buffer): Define cursor-in-non-selected-windows. - - * buffer.h (struct buffer): Add cursor_in_non_selected_windows slot. - - * xdisp.c (Vcursor_in_non_selected_windows) - (Qcursor_in_non_selected_windows): Vars deleted. - (syms_of_xdisp): Don't initialize them. - (get_window_cursor_type): Use cursor_in_non_selected_windows - buffer slot. - -2005-05-02 Kim F. Storm <storm@cua.dk> - - * macros.c (executing_kbd_macro_index): Rename from - executing_macro_index. All uses changed. - (executing_kbd_macro_iterations): Rename from - executing_macro_iterations. All uses changed. - (executing_kbd_macro): Rename from executing_macro. - All uses changed. - (syms_of_macros): Rename Lisp var executing-macro-index to - executing-kbd-macro-index. - - * xdisp.c (move_it_in_display_line_to): Fix last change. - -2005-05-01 Luc Teirlinck <teirllm@auburn.edu> - - * xmenu.c (Fx_popup_menu): Doc fix. - - * charset.c (syms_of_charset): Delete defsubr for Schars_in_region. - -2005-05-02 Jason Rumney <jasonr@gnu.org> - - * emacs.c (USAGE3, USAGE4): Keep strings below 2048 bytes. - -2005-05-02 Nozomu Ando <nand@mac.com> - - * sysselect.h: Fix typo. - -2005-05-02 Nick Roberts <nickrob@snap.net.nz> - - * charset.c (Fchars_in_region): Remove as obsolete. - -2005-05-01 Kim F. Storm <storm@cua.dk> - - * xdisp.c (move_it_in_display_line_to): Stop if we move beyond - TO_CHARPOS. This may happen if last glyphs was an image or stretch - glyph. - -2005-05-01 Luc Teirlinck <teirllm@auburn.edu> - - * dispnew.c (sit_for): Vexecuting_macro -> Vexecuting_kbd_macro. - -2005-05-01 Richard M. Stallman <rms@gnu.org> - - * xmenu.c [not HAVE_X_TOOLKIT] (xmenu_show): - If user cancels the menu, quit unless FOR_CLICK. - - * macros.c (Vexecuting_kbd_macro): Rename from Vexecuting_macro. - All uses changed. - (syms_of_macros): Define only executing-kbd-macro, not executing-macro. - * keyboard.c: Change Vexecuting_macro to Vexecuting_kbd_macro. - * macros.h (Vexecuting_kbd_macro): Declare instead of Vexecuting_macro. - * commands.h (Vexecuting_kbd_macro): Likewise. - -2005-05-01 Thien-Thi Nguyen <ttn@gnu.org> - - * sysdep.c (get_frame_size) [VMS]: Use a fresh i/o channel. - -2005-04-30 Richard M. Stallman <rms@gnu.org> - - * fileio.c (Ffind_file_name_handler): Handle the `operations' - property of the file name handler. - (Qoperations): New variable. - (syms_of_fileio): Initialize and staticpro it. - - * xdisp.c (set_message_1): Delete xassert. - -2005-04-29 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * mac.c: Don't include time.h. Include sysselect.h after systime.h. - - * macfns.c (Fx_server_version): Add BLOCK_INPUT around Gestalt. - - * macgui.h [HAVE_CARBON && MAC_OSX]: Don't undefine/define mktime - before/after including Carbon.h if there is a working mktime. - -2005-04-28 Kim F. Storm <storm@cua.dk> - - * xfaces.c (resolve_face_name): Add arg SIGNAL_P. Calls changed. - Fix cyclic alias check. If alias loop is detected, signal - circular-list error if SIGNAL_P, and return Qdefault if !SIGNAL_P. - -2005-04-28 Lute Kamstra <lute@gnu.org> - - * eval.c (do_autoload): Record only autoloads in the autoload - property of symbols. - -2005-04-28 Nick Roberts <nickrob@snap.net.nz> - - * emacs.c (USAGE1): Add --basic-display and --quick options. - -2005-04-27 Kim F. Storm <storm@cua.dk> - - * data.c (syms_of_data) Staticpro Qcyclic_variable_indirection. - -2005-04-26 Richard M. Stallman <rms@gnu.org> - - * window.c (Fsame_window_p, Fspecial_display_p): Doc fixes. - (syms_of_window): Doc fixes. - - * indent.c (Fvertical_motion): Undo previous change. - -2005-04-26 Kenichi Handa <handa@m17n.org> - - * fns.c (char_table_range): New function. - (Fchar_table_range): Signal an error if characters in the range - have inconsistent values. Don't check the parent. - -2005-04-25 Kenichi Handa <handa@m17n.org> - - * fontset.c (fontset_set): Fix previous change. - -2005-04-24 Richard M. Stallman <rms@gnu.org> - - * indent.c (Fvertical_motion): Bind fontification-functions to nil. - -2005-04-24 Eli Zaretskii <eliz@gnu.org> - - * regex.c (re_search_2, re_match_2_internal): Convert second arg - of RE_TRANSLATE to int, to shut up GCC warnings. - - * fileio.c (Fcopy_file): Doc fix. - [MSDOS]: Fix call to emacs_open: buffer_file_type not defined and - not needed. - -2005-04-24 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * Makefile.in [HAVE_CARBON] (MAC_OBJ): Add macselect.o. - (SOME_MACHINE_OBJECTS): Likewise. - (mac.o): Depend on ccl.h. - (macselect.o): New target. - - * emacs.c (main) [MAC_OS8 || MAC_OSX && HAVE_CARBON]: - Call syms_of_macselect. - - * frame.c (Fdelete_frame) [MAC_OS]: Call x_clear_frame_selections. - - * mac.c [!TARGET_API_MAC_CARBON]: Don't include charset.h or coding.h. - (QCLIPBOARD): Remove variable. - (syms_of_mac): Don't initialize it. - (Fmac_paste_function, Fmac_cut_function, Fx_selection_exists_p): - Remove functions. - (syms_of_mac): Don't defsubr them. - [TARGET_API_MAC_CARBON] (Qmime_charset, QNFD, QNFKD, QNFC, QNFKC) - (QHFS_plus_D, QHFS_plus_C): New variables. - (syms_of_mac) [TARGET_API_MAC_CARBON]: Initialize them. - [TARGET_API_MAC_CARBON] (get_cfstring_encoding_from_lisp) - (cfstring_create_normalized): New functions. - [TARGET_API_MAC_CARBON] (Fmac_code_convert_string): Likewise. - (syms_of_mac) [TARGET_API_MAC_CARBON]: Defsubr it. - - * macterm.c (handling_window_update, terminate_flag): - Remove variables. - (do_window_update, do_ae_quit_application, XTread_socket): - Don't use them. - (WNE_SLEEP_AT_SUSPEND, WNE_SLEEP_AT_RESUME): Don't define. - [USE_CARBON_EVENTS && MAC_OSX] (mac_handle_service_event) - (init_service_handler): Move to macselect.c. Remove declarations. - [USE_CARBON_EVENTS && MAC_OSX] (init_service_handler): Add extern. - (Qapplication, Qabout): New variables. - (syms_of_mac): Initialize them. - [USE_CARBON_EVENTS && MAC_OSX] (Qpreferences, Qservices, Qpaste) - (Qperform): New variables. - (syms_of_mac) [USE_CARBON_EVENTS && MAC_OSX]: Initialize them. - (do_get_menus) [TARGET_API_MAC_CARBON]: Don't call AppendResMenu. - (do_menu_choice): Unhighlight menu bar also when menu_id is 0. - (mac_store_application_menu_event, init_menu_bar): New functions. - [USE_CARBON_EVENTS] (mac_handle_command_event) - (init_command_handler): New functions. - (mac_handle_window_event): Return noErr on window update event. - (do_ae_quit_application): Call mac_store_application_menu_event. - (mac_initialize) [USE_CARBON_EVENTS]: Call init_command_handler - and init_menu_bar. - - * macterm.h (x_clear_frame_selections): Add extern. - - * macselect.c: New file for selection processing on Mac OS. - -2005-04-23 Richard M. Stallman <rms@gnu.org> - - * fileio.c (Fcopy_file): New arg MUSTBENEW. - (Frename_file): Pass new arg to Fcopy_file. - - * window.c (window_size_fixed): Variable deleted. - (syms_of_window): Initialize window-size-fixed to nil. - But don't DEFVAR window_size_fixed. - -2005-04-23 Andreas Schwab <schwab@suse.de> - - * m/macppc.h (LD_SWITCH_MACHINE) [LINUX]: Don't define. - (START_FILES, LIB_STANDARD) [LINUX && _ARCH_PPC64]: Override to - use lib64 instead of lib. - (_LP64) [_ARCH_PPC64]: Define if not defined. - -2005-04-23 David Hunter <hunterd42@comcast.net> (tiny change) - - * s/ms-w32.h (HAVE_PWD_H): Define. - -2005-04-22 Kenichi Handa <handa@m17n.org> - - * fns.c (copy_sub_char_table): Explicitly copy the default value - of the sub-chartable. - - * fontset.c (fontset_set): When a sub-chartable is created, - explicitly sets the defalt value. - -2005-04-22 Kim F. Storm <storm@cua.dk> - - * fns.c (Fplist_get): Replace by Fsafe_plist_get. - (Fsafe_plist_get): Rename to Fplist_get. - (Fsafe_get): Remove, as Fget now uses safe Fplist_get. - (defsubr): Remove defsubr for Fsafe_plist_get and Fsafe_get. - - * lisp.h (Fsafe_plist_get, Fsafe_get): Remove EXFUN. - - * xdisp.c (store_mode_line_string, produce_stretch_glyph) - (note_mode_line_or_margin_highlight, note_mouse_highlight): - Use Fplist_get instead of Fsafe_plist_get. - - * xfaces.c (resolve_face_name): Use Fget instead of Fsafe_get. - -2005-04-21 Miles Bader <miles@gnu.org> - - * xdisp.c (dump_glyph_row): Don't display overlay_arrow_p field. - -2005-04-20 Thien-Thi Nguyen <ttn@gnu.org> - - * sysdep.c: Remove reference to defunct vms-pwd.h. - * dired.c: Likewise. Also, for pwd.h, use HAVE_PWD_H, not !VMS. - * editfns.c, fileio.c, filelock.c, sysdep.c, xrdb.c: Likewise. - - * config.in: Regenerate. - -2005-04-20 Kenichi Handa <handa@m17n.org> - - * lisp.h (CHAR_TABLE_DEFAULT_SLOT_ASCII): New macro. - (CHAR_TABLE_DEFAULT_SLOT_8_BIT_CONTROL): New macro. - (CHAR_TABLE_DEFAULT_SLOT_8_BIT_GRAPHIC): New macro. - - * alloc.c (make_sub_char_table): Argument changed to initial - value of the slots. - - * data.c (Faref): Handle special slots used as default values of - ascii, eight-bit-control, eight-bit-control. Don't ignore a - default value set for a group of characters. - (Faset): Signal an error if IDXVAL is not a valid character code. - Make a sub-chartable with correct initial value. - - * fns.c (Fset_char_table_range): Don't set slots used as default - values for ascii, eight-bit-control, eight-bit-graphic. - Don't call Faref with charset-id. - (Fset_char_table_default): Document how to treat normal character - argument. Handle special slots used as default values of ascii, - eight-bit-control, eight-bit-control. Make a sub chartable if - necessary. - -2005-04-20 Kenichi Handa <handa@m17n.org> - - * search.c (boyer_moore): Fix previous change. - -2005-04-19 Kim F. Storm <storm@cua.dk> - - * xdisp.c (setup_for_ellipsis): Reset saved_face_id to use default - face unless last visible char and first invisible char have the - same face. Also use default face if saved_face_id is undefined. - -2005-04-19 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macgui.h (MacFontStruct): Remove member `fontname'. Add member - `full_name'. - [TARGET_API_MAC_CARBON] (MacFontStruct): Use type int for - mac_scriptcode member. - - * macterm.c (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables. - (syms_of_mac): Don't initialize them. - (Vmac_charset_info_alist): New variable. - (syms_of_mac): Defvar it. - (create_text_encoding_info_alist): New function. - (decode_mac_font_name, mac_to_x_fontname) - (x_font_name_to_mac_font_name, init_font_name_table): Don't hard - code the correspondence among XLFD charsets, Mac script codes, and - Emacs coding systems. Use Vmac_charset_info_alist and result of - create_text_encoding_info_alist instead. - (init_font_name_table) [TARGET_API_MAC_CARBON]: Use Font Manager - routines also on Mac OS Classic. - (init_font_name_table) [!TARGET_API_MAC_CARBON]: - Use add_font_name_table_entry. - (mac_do_list_fonts): Regard 0 in XLFD scaleble fields as - specified. Derive unspecified scalable fields from specified one. - (x_list_fonts): Consider Valternate_fontname_alist. - (kDefaultFontSize): Change value from 9 to 12. - (XLoadQueryFont): Get decoded font family, font face, and charset - from x_font_name_to_mac_font_name. Set full name of loaded font. - (mac_unload_font): Free `full_name' member. - (x_load_font): Don't try XLoadQueryFont if x_list_fonts returns - NULL. Copy full_name member of struct MacFontStruct to that of - struct font_info. - -2005-04-19 Kim F. Storm <storm@cua.dk> - - * xdisp.c (handle_stop): Set saved_face_id to current face if - selective_display_ellipsis_p so ellipsis will be shown in same - face as preceding text. - (setup_for_ellipsis): Don't set saved_face_id here. - (next_element_from_display_vector): Default to saved_face_id. - - * fns.c (Fsafe_get): New function. - (syms_of_fns): Defsubr it. - - * lisp.h (Fsafe_get): EXFUN it. - - * xfaces.c (resolve_face_name): Use Fsafe_get to avoid redisplay - loops in case of bad face property lists. Limit number of face - alias lookups to 10 (in case of face alias loops). - -2005-04-18 Kim F. Storm <storm@cua.dk> - - * dispextern.h (struct glyph_row): New member overlay_arrow_bitmap. - It replaces the corresponding member from struct window, as a - window may now show multiple overlay arrows. - Remove member overlay_arrow_p, superseeded by overlay_arrow_bitmap. - - * dispnew.c (row_equal_p, update_window_line, scrolling_window): - Compare overlay_arrow_bitmap than overlay_arrow_p members. - - * fringe.c (draw_fringe_bitmap): Use overlay_arrow_bitmap from row - rather than from window. - (update_window_fringes): Compare overlay_arrow_bitmap rather than - overlay_arrow_p members. - (Ffringe_bitmaps_at_pos): Return fringe overlay_arrow_bitmap name - if not default. - - * window.h (struct window): Remove member overlay_arrow_bitmap. - - * window.c (make_window): Don't initialize overlay_arrow_bitmap. - - * xdisp.c (overlay_arrow_string_or_property): Remove PBITMAP arg. - Calls changed. Don't check for overlay-arrow-bitmap property here. - (overlay_arrow_at_row): Remove PBITMAP arg. Instead, if left - fringe is present, return Lisp integer for bitmap (or -1 for default). - Fix value of overlay-arrow-bitmap property to be a symbol, use - lookup_fringe_bitmap to parse it. - (display_line): Change call to overlay_arrow_at_row. Store integer - return value as overlay bitmap in row rather than window. - Only show overlay arrow if row displays text, or if no other overlay - arrow is seen in window (if overlay marker is at point-max). - -2005-04-18 Thien-Thi Nguyen <ttn@gnu.org> - - * xfaces.c (realize_x_face) [!HAVE_WINDOW_SYSTEM]: Return NULL. - -2005-04-18 Lute Kamstra <lute@gnu.org> - - * lread.c (Vloads_in_progress): Static. - * fns.c (Vloads_in_progress): Remove extern. - (load_in_progress): Add extern. - (Frequire): Use load_in_progress instead of Vloads_in_progress. - -2005-04-18 Thien-Thi Nguyen <ttn@gnu.org> - - * xmenu.c (Fx_popup_menu): Initialize error_name to NULL. - -2005-04-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macterm.c (XTread_socket): Don't beep on keyboard input even if - no frame is visible. - -2005-04-16 Dan Nicolaescu <dann@ics.uci.edu> - - * term.c (struct keys): Add support for shifted keys. - -2005-04-16 Richard M. Stallman <rms@gnu.org> - - * xdisp.c (with_echo_area_buffer): Delete WHICH < 0 case. - (set_message): Call with_echo_area_buffer with WHICH = 0. - (set_message_1): Erase the echo area buffer first thing. - (echo_area_display): Don't clear echo_message_buffer. - -2005-04-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * Makefile.in (mac.o): Depend on charset.h and coding.h. - - * mac.c: Include charset.h and coding.h. - [TARGET_API_MAC_CARBON] (Qutf_8): Remove extern. - [TARGET_API_MAC_CARBON] (cfstring_create_with_string): New function. - [TARGET_API_MAC_CARBON] (Fmac_get_preference): Use it. - - * macfns.c [TARGET_API_MAC_CARBON] (Fx_file_dialog): Likewise. - - * image.c [MAC_OSX] (image_load_quartz2d): Likewise. - - * macterm.c (x_autoselect_window_p): Remove variable. - (last_window): New variable. - (XTreassert_line_highlight, x_change_line_highlight): - Remove declarations. - (mac_focus_changed, x_detect_focus_change): New functions and - declarations. - (XTextExtents16, front_emacs_window): Remove function. - (mac_focus_frame): New function. - (XTmouse_position, do_menu_choice, do_zoom_window, XTread_socket) - (mac_check_for_quit_char): Use it instead of front_emacs_window. - (x_scroll_bar_report_motion): Obtain window from control owner. - (x_make_frame_invisible): Set window manager size hint. - (do_mouse_moved): Remove function. - (XTread_socket): Move its contents here. Generate select-window - event on mouse movement if needed. Use x_detect_focus_change on - activate/deactivate events. Don't deiconify frame or invalidate - window rectangle when dnd items are dropped. - Don't activate/deactivate root control. - (frame_highlight, frame_unhighlight): Activate/deactivate root - control here. - (syms_of_macterm): Delete DEFVAR_BOOL for x_autoselect_window_p. - - * macterm.h (cfstring_create_with_string) [TARGET_API_MAC_CARBON]: - New extern. - -2005-04-15 Luc Teirlinck <teirllm@auburn.edu> - - * Makefile.in: Define new macro TOOLTIP_SUPPORT. - (lisp): Use it. - (SOME_MACHINE_LISP): Add tooltip. - -2005-04-14 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * mac.c [!TARGET_API_MAC_CARBON]: Include MacLocales.h. - Don't include TextEncodingConverter.h. - (mac_system_script_code, Vmac_system_locale): New variables. - (syms_of_mac): Defvar them. - (mac_get_system_locale): New function. - - * macfns.c (x_set_name, x_set_title) [!TARGET_API_MAC_CARBON]: - Use ENCODE_SYSTEM to encode title bar string. - (x_create_tip_frame): Apply 2005-03-18 change for xfns.c. - (Fx_file_dialog) [TARGET_API_MAC_CARBON && !MAC_OSX]: - Use CFStringGetSystemEncoding to get system default string encoding. - - * macterm.c [!TARGET_API_MAC_CARBON]: Don't include - TextEncodingConverter.h. - -2005-04-13 Steven Tamm <steventamm@mac.com> - - * macterm.c (syms_of_macterm): Remove redundant definition of - mac-pass-control-to-system. - -2005-04-12 Stefan Monnier <monnier@iro.umontreal.ca> - - * window.c (Fset_window_configuration): Be careful when you choose - among several possible points for the new_current_buffer. - -2005-04-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * keyboard.c (poll_for_input) [SYNC_INPUT]: Don't call - poll_for_input_1. Set interrupt_input_pending to 1 instead. - (Qlanguage_change) [MAC_OS]: New variable. - (syms_of_keyboard) [MAC_OS]: Intern and staticpro it. - (kbd_buffer_get_event) [MAC_OS]: Make event for LANGUAGE_CHANGE_EVENT. - - * macterm.c (mac_keyboard_text_encoding) - (current_mac_keyboard_text_encoding): Remove variables. - (XTread_socket): Store language-change event if keyboard script change - is detected. Don't convert input to `mac_keyboard_text_encoding'. - (syms_of_macterm): Delete DEFVAR_INT for mac-keyboard-text-encoding. - - * termhooks.h (enum event_kind) [MAC_OS]: Add LANGUAGE_CHANGE_EVENT. - -2005-04-10 Richard M. Stallman <rms@gnu.org> - - * emacs.c (standard_args): Rename --bare-bones to --quick. - Add -D aka --basic-display. - - * buffer.c (Fmake_indirect_buffer): Clear out some local variables. - -2005-04-09 Richard M. Stallman <rms@gnu.org> - - * keymap.c (where_is_internal): Convert a string used as event type - into "(any string)". - - * lread.c (Vloads_in_progress): Not static. - * fns.c (Vloads_in_progress): Add extern. - (Frequire): Don't do LOADHIST_ATTACH if Vloads_in_progress is nil. - -2005-04-09 Thien-Thi Nguyen <ttn@surf.glug.org> - - * dispnew.c (mirror_line_dance): Avoid crash if W2 is null. - -2005-04-09 Lute Kamstra <lute@gnu.org> - - * print.c (PRINTPREPARE): Check if the marker PRINTCHARFUN is - within the accessible part of the buffer. - -2005-04-09 Kim F. Storm <storm@cua.dk> - - * lread.c (readevalloop): Add args START and END as region in - current buffer to read. Callers changed. - When specified, narrow to this region only when reading, - not during eval. Track next point to read from during eval. - Also restore point to "real" buffer position before eval. - (Feval_region): Don't save excursion and restriction here, and - don't narrow to region. Just pass region to readevalloop. - Note: Point is now preserved even when PRINTFLAG is nil. - -2005-04-08 Kim F. Storm <storm@cua.dk> - - * xdisp.c (syms_of_xdisp): Init overlay-arrow-string to "=>". - -2005-04-06 Kim F. Storm <storm@cua.dk> - - * emacs.c (standard_args): Add -Q, --bare-bones, -bare-bones. - -2005-04-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * mac.c (cfdate_to_lisp): Add `const' for variable `epoch_gdate'. - (Fmac_get_preference): Doc fix. - - * macfns.c (Fx_create_frame, x_create_tip_frame): - Add "fontset-mac" to fallback font/fontsets. - -2005-04-04 Kim F. Storm <storm@cua.dk> - - * alloc.c (Fgarbage_collect): Call CHECK_CONS_LIST before and after gc. - - * eval.c (Ffuncall): Always call CHECK_CONS_LIST on entry. - Call it again after autoload. - -2005-04-02 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * alloc.c (allocate_string_data): Call BLOCK_INPUT before calling - mallopt. - - * ralloc.c (r_alloc_init): Ditto. - -2005-04-01 Kenichi Handa <handa@m17n.org> - - * lisp.h (Vascii_upcase_table, Vascii_canon_table) - (Vascii_eqv_table): Extern them. - - * casetab.c (set_case_table): If standard is nonzero, setup - Vascii_upcase_table, Vascii_canon_table, and Vascii_eqv_table. - - * search.c (looking_at_1): Use current_buffer->case_canon_table, - not DOWNCASE_TABLE. - (string_match_1): Likewise. - (fast_c_string_match_ignore_case): Use Vascii_canon_table, not - Vascii_downcase_table. - (fast_string_match_ignore_case): Likewise. - (search_buffer): Fix checking of boyer-moore usability. - (boyer_moore): Calculate translate_prev_byte1/2/3 in advance. - No need of tranlating characters in PAT. Fix calculation of - simple_translate. - -2005-03-31 Stefan Monnier <monnier@iro.umontreal.ca> - - * xterm.c [HAVE_XAW3D]: Include ThreeD.h for XtNbeNiceToColormap. - (x_create_toolkit_scroll_bar): Test XtNbeNiceToColormap before using it. - Use XtNtopShadowPixel and XtNbottomShadowPixel. - (x_set_toolkit_scroll_bar_thumb): Remove ugly old hack that didn't - really work and that breaks with some versions of Xaw3d. - -2005-03-31 Kenichi Handa <handa@m17n.org> - - * coding.c (syms_of_coding): Fix previous change. - -2005-03-30 Stefan Monnier <monnier@iro.umontreal.ca> - - * fileio.c (search_embedded_absfilename): Fix last change. - -2005-03-25 Kenichi Handa <handa@m17n.org> - - * coding.c (syms_of_coding): Suggest to use set-coding-category in - the docstring of coding-category-list. - -2005-03-31 Kim F. Storm <storm@cua.dk> - - * keyboard.c (Qmouse_fixup_help_message): New var. - (syms_of_keyboard): Intern and staticpro it. - (show_help_echo): Apply mouse-fixup-help-message to help string. - -2005-03-30 Kim F. Storm <storm@cua.dk> - - * xdisp.c (display_line): Allow multiple overlay arrows in window. - -2005-03-28 Stefan Monnier <monnier@iro.umontreal.ca> - - * fileio.c (Fexpand_file_name): Use IS_DEVICE_SEP. - (file_name_absolute_p): New fun, extracted from Ffile_name_absolute_p. - (Ffile_name_absolute_p): Use it. - (search_embedded_absfilename): New fun, extracted from - Fsubstitute_in_file_name. Use file_name_absolute_p. - Free the pw data after use. - (Fsubstitute_in_file_name): Use it. - After cutting a prefix, re-check file-name-handler. - -2005-03-26 Lennart Borgman <lennart.borgman.073@student.lu.se> - - * w32term.h (x_output): Add focus_state. - - * w32term.c (x_focus_changed, w32_detect_focus_change): New functions. - (w32_read_socket) <WM_SETFOCUS>: Call w32_detect_focus_change. - -2005-03-25 Stefan Monnier <monnier@iro.umontreal.ca> - - * minibuf.c (Fminibuffer_complete_and_exit, Fself_insert_and_exit): - Use Fexit_minibuffer. - (Fexit_minibuffer): Mark it as no-return, deactivate the mark. - -2005-03-24 Stefan Monnier <monnier@iro.umontreal.ca> - - * dired.c (Ffile_attributes): Add a missing gcpro. - - * alloc.c (make_number): The arg can be bigger than `int'. - * lisp.h (make_number): Make prototype more precise. - - * process.c, dired.c (Vfile_name_coding_system) - (Vdefault_file_name_coding_system): - * callproc.c (Vdoc_file_name, Vfile_name_coding_system) - (Vdefault_file_name_coding_system): Remove unused declarations. - -2005-03-24 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xmenu.c (create_and_show_popup_menu): Just remove menu and return - if it failed to pop up (Gnome "show pointer on ctrl" option makes - menus fail to pop up). - -2005-03-24 Stefan Monnier <monnier@iro.umontreal.ca> - - * xdisp.c (get_next_display_element): Also use `\ ' & `\-' for latin-9. - Just prepend a backslash without replacing the NBSP by an SPC. - -2005-03-22 Kim F. Storm <storm@cua.dk> - - * xfaces.c (lookup_derived_face): Add arg SIGNAL_P. - * dispextern.h (lookup_derived_face): Fix prototype. - * msdos.c (XMenuActivate): Fix call to lookup_derived_face. - - * xdisp.c (handle_single_display_spec): Derive left-fringe and - right-fringe face from fringe face. - - * fringe.c (draw_fringe_bitmap_1, Fset_fringe_bitmap_face): - Derive face from fringe face. - -2005-03-22 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xrdb.c (x_load_resources): Undo previous change (2005-03-18). - -2005-03-22 David Kastrup <dak@gnu.org> - - * textprop.c (Fnext_char_property_change) - (Fprevious_char_property_change): Allow marker as limit. - (Fnext_single_char_property_change) - (Fprevious_single_char_property_change): Check that limit is a - number in strings. - (Fnext_single_char_property_change): Coerce position to integer. - (Fprevious_single_char_property_change): Same here. - -2005-03-21 Thien-Thi Nguyen <ttn@gnu.org> - - * s/openbsd.h (LD_SWITCH_SYSTEM_tmp): Define if undefined. - -2005-03-19 Stefan Monnier <monnier@iro.umontreal.ca> - - * frame.c (Fignore_event): Remove. - (syms_of_frame): Don't defsubr it. - - * keyboard.c (keys_of_keyboard): Just use `ignore' instead of the - redundant `ignore-event'. - -2005-03-19 Eli Zaretskii <eliz@gnu.org> - - * unexec.c (write_segment, unexec): Move these functions to avoid - forward references (which cause errors with "gcc -gcoff"). - -2005-03-18 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xfns.c (x_create_tip_frame): Remove setting of Vx_resource_name so - that it doesn't become "tooltip". The specbind is enough. - - * xrdb.c (x_load_resources): Use different char *helv when I18N - is present. - -2005-03-17 Kenichi Handa <handa@m17n.org> - - * coding.c (syms_of_coding): Docstring of coding-category-list fixed. - -2005-03-17 Stefan Monnier <monnier@iro.umontreal.ca> - - * xfaces.c (x_update_menu_appearance) [HAVE_X_I18N]: - Use xic_create_fontsetname even for non-Motif menus. - Don't forget to free the fontsetname. - - * xfns.c (xic_create_fontsetname): Add a final catch-all font pattern. - -2005-03-17 Richard M. Stallman <rms@gnu.org> - - * dispnew.c (mirror_line_dance): Set W2 according to FRAME_FROM. - - * fileio.c (Fcopy_file, Frename_file, Fadd_name_to_file) - (Fmake_symbolic_link): Use G to read the new file name. - - * callint.c (Finteractive): Document G option. - (Fcall_interactively): Implement G option. - - * buffer.c (buffer_lisp_local_variables): New function, - broken out from Fbuffer_local_variables. - (clone_per_buffer_values): Use buffer_lisp_local_variables. - -2005-03-17 Stefan Monnier <monnier@iro.umontreal.ca> - - * xfns.c (xic_create_fontsetname): Add `motif' argument. - Always return a freshly allocated string. - (xic_create_xfontset): Adjust call. - - * xfaces.c (x_update_menu_appearance) [USE_MOTIF]: - Use xic_create_fontsetname to create a fontset so utf-8 locales work. - (dump_realized_face): Fix warning. - - * emacs.c (Fkill_emacs): YAILOM. - - * frame.c (Fignore_event): Fix ancient obscure C-u handling bug. - -2005-03-17 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * mac.c (HASHKEY_TERMINAL): Remove. - (HASHKEY_MAX_NID): New macro. - (xrm_q_get_resource_1): Rename from xrm_q_get_resource. Add extra - argument. - (xrm_q_get_resource): Call xrm_q_get_resource_1 with extra argument. - (xrm_create_database, xrm_q_put_resource) - (xrm_merge_string_database, xrm_q_get_resource_1) - (xrm_q_get_resource): Change resource database representation so - that it may not use multiple hash tables for a single database. - [TARGET_API_MAC_CARBON] (xrm_cfproperty_list_to_value): YAILOM. - -2005-03-16 Stefan Monnier <monnier@iro.umontreal.ca> - - * xmenu.c (ENCODE_MENU_STRING) [HAVE_X_I18N]: Use ENCODE_SYSTEM. - - * coding.h (ENCODE_SYSTEM, DECODE_SYSTEM) [!WINDOWSNT]: Use the - locale-coding-system, as was already done for WINDOWSNT. - - * keyboard.c (read_char): Only do the 7-bit-meta -> 27-bit-meta - translation for chars in the 0-255 range. - -2005-03-16 Lute Kamstra <lute@gnu.org> - - * floatfns.c (Ffloor): Doc fix. - -2005-03-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * mac.c: Include macterm.h instead of directly including Carbon.h. - [TARGET_API_MAC_CARBON] (Qstring, Qnumber, Qboolean, Qdate, Qdata) - (Qarray, Qdictionary): New variables. - (syms_of_mac) [TARGET_API_MAC_CARBON]: Initialize them. - [TARGET_API_MAC_CARBON] (Qutf_8): Add extern. - [TARGET_API_MAC_CARBON] (DECODE_UTF_8): New macro. - [TARGET_API_MAC_CARBON] (struct cfdict_context): New struct used - in callback for CFDictionaryApplyFunction. - [TARGET_API_MAC_CARBON] (cfdata_to_lisp, cfstring_to_lisp) - (cfnumber_to_lisp, cfdate_to_lisp, cfboolean_to_lisp) - (cfobject_desc_to_lisp, cfdictionary_add_to_list) - (cfdictionary_puthash, cfproperty_list_to_lisp): New functions. - [TARGET_API_MAC_CARBON] (Fmac_get_preference): New function. - (syms_of_mac) [TARGET_API_MAC_CARBON]: Defsubr it. - (P, LOOSE_BINDING, SINGLE_COMPONENT, HASHKEY_TERMINAL): New macro. - (skip_white_space, parse_comment, parse_include_file) - (parse_binding, parse_component, parse_resource_name, parse_value) - (parse_resource_line, xrm_create_database, xrm_q_put_resource) - (xrm_merge_string_database, xrm_q_get_resource, xrm_get_resource) - (xrm_cfproperty_list_to_value, xrm_get_preference_database): - New functions. - - * macfns.c (mac_get_rdb_resource): Remove function. - (x_get_string_resource): Use xrm_get_resource. - - * macgui.h (XrmDatabase): Typedef to Lisp_Object. - - * macterm.c (x_list_fonts): FONT-LIST-CACHE is now cadr part of - name_list_element. - (mac_make_rdb): Create resource database from preferences and - argument string. - (mac_term_init): Save resource database to cddr part of - name_list_element. - - * macterm.h (xrm_merge_string_database, xrm_get_resource) - (xrm_get_preference_database): Add externs. - [TARGET_API_MAC_CARBON] (cfdata_to_lisp, cfstring_to_lisp) - (cfnumber_to_lisp, cfdate_to_lisp, cfboolean_to_lisp) - (cfobject_desc_to_lisp, cfproperty_list_to_lisp): Likewise. - - * process.c (init_process): Change `#ifdef DARWIN' to `#if - defined (DARWIN) || defined (MAC_OSX)'. - - * s/darwin.h (DARWIN): Don't define. - -2005-03-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macfns.c (Qhyper, Qsuper, Qmeta, Qalt, Qctrl, Qcontrol, Qshift): - Remove unused variables. - (syms_of_macfns): Don't initialize them. Likewise for - Qface_set_after_frame_default. Defvar and initialize - Vx_window_horizontal_drag_shape. - (x_set_mouse_color): Change mouse pointer shape. - (mac_window) [!MAC_OSX]: Create root control. - (Fx_create_frame): Remove initializations of mouse pointer shapes. - (hourglass_started): New function (from xfns.c). - (start_hourglass, cancel_hourglass): Put function body in #ifdef - MAC_OSX. - (show_hourglass) [TARGET_API_MAC_CARBON]: Create progress - indicator for each non-tooltip frame if needed, and show it. - (hide_hourglass) [TARGET_API_MAC_CARBON]: Hide progress indicators. - - * macgui.h [!TARGET_API_MAC_CARBON]: Include Appearance.h and - Controls.h. Use ThemeCursor instead of CursHandle. - - * macterm.c (activate_scroll_bars, deactivate_scroll_bars): - Remove functions and declarations. - (mac_set_colors): Take argument for saving background color. - All callers changed. - (XDrawLine, XClearArea, mac_draw_bitmap, XFillRectangle) - (mac_draw_rectangle, mac_draw_string_common): Save and Restore - background color. - (x_update_end, mac_do_track_drag): Don't reset background color. - (mac_define_frame_cursor) [!TARGET_API_MAC_CARBON]: - Use SetThemeCursor. - (x_set_window_size) [TARGET_API_MAC_CARBON]: Move progress - indicator control to the upper-right corner of the window. - (arrow_cursor) [!TARGET_API_MAC_CARBON]: Remove variable. - (do_init_managers) [!TARGET_API_MAC_CARBON]: Don't initialize it. - (do_window_update): Update controls after updating content area. - (mac_handle_window_event): Remove unused extern. - (XTread_socket): Check both control handle and control part code - to determine whether a scroll bar is clicked. Activate/deactivate - root control instead of contained scroll bar controls. - (make_mac_terminal_frame): Use ThemeCursor constants. - - * macterm.h (struct mac_output) [TARGET_API_MAC_CARBON]: - New member hourglass_control. - (HOURGLASS_WIDTH, HOURGLASS_HEIGHT): New defines. - (activate_scroll_bars, deactivate_scroll_bars): Remove declarations. - -2005-03-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macterm.c (keycode_to_xkeysym_table): Change mapping so that it - coincides with that in Apple X11 except `clear', `enter' on - laptops, and fn + `enter' on laptops. - -2005-03-12 Stefan Monnier <monnier@iro.umontreal.ca> - - * xmenu.c (ENCODE_MENU_STRING): Explicitly use string_make_unibyte. - (list_of_panes, list_of_items, Fx_popup_menu): Use XCAR/XCDR. - (digest_single_submenu, xmenu_show): Use ENCODE_MENU_STRING. - - * xfns.c (xic_defaut_fontset): New constant. - (xic_create_fontsetname): New function. - Extracted from create_frame_xic. Try to generate a slightly - better fontset. - (xic_create_xfontset): Use it. - (create_frame_xic): Simplify. - -2005-03-11 Stefan Monnier <monnier@iro.umontreal.ca> - - * fileio.c (Fmake_symbolic_link): Fix last change. - -2005-03-11 Richard M. Stallman <rms@gnu.org> - - * fileio.c (Frename_file, Fadd_name_to_file) - (Fmake_symbolic_link): If NEWNAME or LINKNAME is a directory, - expand the basename of FILE relative to it. - -2005-03-11 Kenichi Handa <handa@m17n.org> - - * fileio.c (Finsert_file_contents): Call Fcheck_coding_system - before calling setup_coding_system so that autoloading of a coding - system work. - -2005-03-10 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xfns.c (hourglass_started): New function. - - * dispextern.h: Declare hourglass_started. - - * keyboard.c (Fexecute_extended_command): Restart hourglass - after call to Fcompleting_read if already started. - - * gtkutil.c (xg_update_scrollbar_pos): Call x_sync so that the - GTK main loop is entered in xterm.c, thus doing the redraw. - -2005-03-10 Kim F. Storm <storm@cua.dk> - - * xdisp.c (pos_visible_p): Fix X value in last line of buffer. - -2005-03-08 Kenichi Handa <handa@m17n.org> - - * frame.c (x_set_font): Call set_default_ascii_font if an - available font is found. - - * fontset.c (set_default_ascii_font): New function. - (syms_of_fontset): Don't set FONTSET_ASCII (Vdefault_fontset) here. - - * fontset.h (set_default_ascii_font): Extern it. - -2005-03-07 Kim F. Storm <storm@cua.dk> - - * xdisp.c (CLEAR_IMAGE_CACHE_COUNT): New const. - (clear_image_cache_count): New var. - (redisplay_internal): Don't clear face and image caches in the - middle of redisplay; do it afterwards. - - * blockinput.h (TOTALLY_UNBLOCK_INPUT): Avoid dangling else. - - * xdisp.c (notice_overwritten_cursor): Check that phys_cursor.vpos - is valid. If not, clear phys_cursor_on_p and return. - -2005-03-07 Andreas Schwab <schwab@suse.de> - - * blockinput.h (UNBLOCK_INPUT_TO): Always call UNBLOCK_INPUT. - -2005-03-06 Richard M. Stallman <rms@gnu.org> - - * keyboard.c (Ftop_level): Let Fthrow deal with UNBLOCK_INPUT. - - * eval.c (unwind_to_catch): Use UNBLOCK_INPUT_TO. - (Feval, Ffuncall): Use CHECK_CONS_LIST. - - * lisp.h (CHECK_CONS_LIST): New macro (two definitions). - - * blockinput.h (UNBLOCK_INPUT_TO): New macro. - (TOTALLY_UNBLOCK_INPUT): Handle a pending signal if any. - -2005-03-05 Juri Linkov <juri@jurta.org> - - * emacs.c (USAGE1): Replace Info node name "command arguments" - with "emacs invocation". - (USAGE3): Fix usage of `--color=MODE' which actually doesn't - allow arguments `--color' and `MODE' to be separated by space. - Add --no-blinking-cursor, -nbc. - (standard_args): Add -nbc, --no-blinking-cursor. - -2005-03-04 Thien-Thi Nguyen <ttn@gnu.org> - - * s/vms.h: Define NO_HYPHENS_IN_FILENAMES. - * s/vms4-4.h, s/vms5-5.h: Undefine NO_HYPHENS_IN_FILENAMES. - * fileio.c (Fexpand_file_name) [VMS]: - Use NO_HYPHENS_IN_FILENAMES, not VMS4_4. - * doc.c (munge_doc_file_name) [VMS]: Likewise. - (Fsnarf_documentation): Call munge_doc_file_name. - -2005-03-04 Thien-Thi Nguyen <ttn@gnu.org> - - * s/vms.h (FILE_SYSTEM_CASE): New macro. - * fileio.c (Fexpand_file_name) [VMS]: Don't upcase the name - "manually"; this is now handled generally via FILE_SYSTEM_CASE. - -2005-03-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * emacs.c (main): Change `#ifdef HAVE_CARBON' to `#if - defined (MAC_OSX) && defined (HAVE_CARBON)'. - - * image.c [!MAC_OSX && TARGET_API_MAC_CARBON]: Include QuickTime.h. - - * mac.c [!MAC_OSX && HAVE_CARBON]: Include Carbon.h. - [!MAC_OSX] (select) [TARGET_API_MAC_CARBON]: Use ReceiveNextEvent. - (posix_pathname_to_fsspec, fsspec_to_posix_pathname): New functions. - (mac_clear_font_name_table): Move extern to macterm.h. - - * macfns.c (install_window_handler): Move extern to macterm.h. - (Fx_file_dialog): Check STRINGP (default_filename) to see it is - valid. Don't check !NILP (dir) because it is already checked with - CHECK_STRING. - (Fx_file_dialog) [!MAC_OSX]: Use FSSpec instead of FSRef for - specifying the default location and obtaining the selected filename. - - * macgui.h [!MAC_OSX && HAVE_CARBON]: Include Carbon.h. - - * macmenu.c [TARGET_API_MAC_CARBON]: Don't include headers that - are included via Carbon.h. - - * macterm.c [TARGET_API_MAC_CARBON && !MAC_OSX]: - Define USE_CARBON_EVENTS to 1. - (qd) [__MRC__ && TARGET_API_MAC_CARBON]: Don't declare. - (x_free_frame_resources): Call remove_window_handler for - non-tooltip windows. - [TARGET_API_MAC_CARBON]: Don't include headers that are included - via Carbon.h. - [TARGET_API_MAC_CARBON] (mac_do_track_dragUPP) - (mac_do_receive_dragUPP): New variables. - (mac_handle_service_event, init_service_handler): Put declarations - and definitions in #ifdef MAC_OSX. - (install_window_handler) [TARGET_API_MAC_CARBON]: Create UPPs for - drag-and-drop handler functions and register them. - (remove_window_handler): New function. - (do_ae_open_documents, mac_do_receive_drag) [!MAC_OSX]: - Use fsspec_to_posix_pathname. - (main): Change #if !TARGET_API_MAC_CARBON to #ifdef MAC_OS8. - (XTread_socket) [!MAC_OSX]: Don't pass keyboard events to TSM. - [MAC_OS8] (make_mac_terminal_frame) [TARGET_API_MAC_CARBON]: - Set default cursors. - (mac_initialize) [USE_CARBON_EVENTS && !MAC_OSX]: Don't call - init_service_handler or init_quit_char_handler. - (mac_initialize) [!MAC_OSX]: Don't call MakeMeTheFrontProcess. - - * macterm.h (install_window_handler, remove_window_handler) - (posix_pathname_to_fsspec, fsspec_to_posix_pathname) - (mac_clear_font_name_table): New externs. - -2005-03-03 Thien-Thi Nguyen <ttn@gnu.org> - - * fileio.c (FILE_SYSTEM_CASE): Define macro if not already defined. - (Ffile_name_directory): Use FILE_SYSTEM_CASE unconditionally. - (Fexpand_file_name): Likewise. - -2005-03-03 Thien-Thi Nguyen <ttn@gnu.org> - - * emacs.c (Fkill_emacs): Use EXIT_SUCCESS; - no longer special-case VMS. Add bogus return value. - -2005-03-02 Kim F. Storm <storm@cua.dk> - - * dispextern.h (XASSERTS): Define to 0 if not already defined. - (xassert) [!XASSERTS]: Define dummy version. - -2005-03-02 Kim F. Storm <storm@cua.dk> - - * xdisp.c (redisplay_window): YABX (yet another bogus xassert). - Reported by David Kastrup. - -2005-03-01 Ehud Karni <ehud@unix.mvs.co.il> - - * xdisp.c (get_next_display_element): Fix control and escape - glyph from display vector. - -2005-03-01 Stefan Monnier <monnier@iro.umontreal.ca> - - * keyboard.c (Fposn_at_x_y): Check integerness of X and Y. - -2005-02-27 Richard M. Stallman <rms@gnu.org> - - * xdisp.c (fast_find_position): Rename END to BEG. - (syms_of_xdisp) <menu-bar-update-hook>: Doc fix. - -2005-02-27 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (xg_resize_outer_widget): Remove unneeded call to - gtk_window_resize and x_wm_set_size_hint. - -2005-02-25 Kim F. Storm <storm@cua.dk> - - * dispextern.h (OVERLAY_STRING_CHUNK_SIZE): Increase from 3 to 16. - - * xdisp.c (init_from_display_pos): Don't read past end of - it->overlay_strings array. - -2005-02-25 Stephan Stahl <stahl@eos.franken.de> (tiny change) - - * buffer.c (syms_of_buffer): Fix typo. - -2005-02-23 Lute Kamstra <lute@gnu.org> - - * buffer.c (Foverlay_buffer): Doc fix. - -2005-02-22 Kim F. Storm <storm@cua.dk> - - * minibuf.c (Ftry_completion, Fall_completions): Allow both string - and symbol keys in alists and hash tables. - - * xdisp.c (fast_find_position): Fix search for start of overlay. - -2005-02-21 Kim F. Storm <storm@cua.dk> - - * window.c (window_scroll_pixel_based): When scrolling backwards, - handle partial visible line at end of window even when we hit PT. - -2005-02-21 Stefan Monnier <monnier@iro.umontreal.ca> - - * keymap.h: Declare Fcurrent_active_maps, used in doc.c. - -2005-02-21 Kim F. Storm <storm@cua.dk> - - * xdisp.c (move_it_vertically_backward): Eliminate two xasserts. - I think those asserts are bogus if buffer contains invisible text - or images. - -2005-02-21 David Kastrup <dak@gnu.org> - - * gtkutil.c (xg_create_frame_widgets): UNBLOCK_INPUT on error. - -2005-02-20 Kim F. Storm <storm@cua.dk> - - * xdisp.c (pos_visible_p): Be sure to move to the specified - position. Always get the full ascent / descent of the - corresponding row, to return reliable rtop and rbot values. - (back_to_previous_visible_line_start): Fix 2005-01-18 change. - Must look one character back, as back_to_previous_line_start - returns position after the newline. - (move_it_vertically_backward): Fix heuristic for when to move further - back in case line_height * 2/3 is larger than window height. - (cursor_row_fully_visible_p): Rename make_cursor_line_fully_visible_p - as it does not do anything anymore. Add arg current_matrix_p to - use current matrix rather than desired matrix when set. - (try_cursor_movement): Don't scroll to make cursor row fully - visible if cursor didn't move. This avoids unexpected recentering - in case of blinking cursor or accepting process output. - Use current matrix to check cursor row visibility. - (redisplay_window): Fix whether to recenter or move to top in case - cursor line is taller than window height. - (find_first_unchanged_at_end_row): Stop search if we reach a row - which not enabled (instead of abort). - -2005-02-18 Kim F. Storm <storm@cua.dk> - - * xfaces.c (Finternal_set_lisp_face_attribute): Allow :color property - to be nil in a :box attribute value list; customize prints that - as lisp value when no box color is specified. - - * .gdbinit (pitx, pit): Pretty print display iterator. - (prowx, prow): Pretty print glyph row. - (pcursorx, pcursor): Pretty print a window cursor. - (pwinx, pwin): Pretty print struct window. - -2005-02-18 Stefan Monnier <monnier@iro.umontreal.ca> - - * alloc.c (BLOCK_BYTES): Harmless typo. - -2005-02-17 Andreas Schwab <schwab@suse.de> - - * xfns.c (hack_wm_protocols): Use correct type for last parameter - of XGetWindowProperty to avoid aliasing issues. - (Fx_window_property): Likewise. - - * xselect.c (Fx_disown_selection_internal): Use union of struct - input_event and struct selection_input_event to avoid aliasing issues. - - * xterm.c (handle_one_xevent): Use union of struct input_event and - struct selection_input_event to avoid aliasing issues. - (SET_SAVED_MENU_EVENT): Adapt reference to inev. - -2005-02-17 Kim F. Storm <storm@cua.dk> - - * dispextern.h (enum it_method): New enum. - (GET_FROM_*): Its members. - (struct it): Change member method from function pointer to enum. - - * xdisp.c (check_it, init_from_display_pos, handle_stop) - (setup_for_ellipsis, handle_single_display_spec) - (handle_composition_prop, next_overlay_string) - (get_overlay_strings, reseat_1, reseat_to_string) - (next_element_from_ellipsis, BUFFER_POS_REACHED_P) - (in_display_vector_p, display_line, get_next_display_element): - Change it->method from function pointer to enum. - (get_next_element): New array to map it->method to function. - (get_next_display_element): Use it. - (set_iterator_to_next): Use switch instead of if/else chain. - -2005-02-15 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de> - - * w32select.c: Summary: Thorough rework to implement Unicode - clipboard operations and delayed rendering. - - Drop last_clipboard_text and related code, keep track of - ownership via clipboard_owner instead. Drop old #if0 sections. - - (DEFAULT_LCID, ANSICP, OEMCP, QUNICODE, QANSICP, QOEMCP) - (clipboard_owner, modifying_clipboard, cfg_coding_system) - (cfg_codepage, cfg_lcid, cfg_clipboard_type, current_text) - (current_coding_system, current_requires_encoding) - (current_num_nls, current_clipboard_type, current_lcid): - New static variables. - - (convert_to_handle_as_ascii, convert_to_handle_as_coded) - (render, render_all, run_protected, lisp_error_handler) - (owner_callback, create_owner, setup_config) - (enum_locale_callback, cp_from_locale, coding_from_cp): - New local functions. - - (term_w32select, globals_of_w32select): New global functions. - - (Fw32_set_clipboard_data): Ignore parameter FRAME, use - clipboard_owner instead. Use delayed rendering and provide - all text formats. Provide CF_LOCALE if necessary. - - (Fw32_get_clipboard_data): Handle CF_UNICODETEXT and - CF_LOCALE. Fall back to CF_TEXT, if CF_UNICODETEXT is not - available. Force DOS line-ends for decoding. - - (Fx_selection_exists_p): Handle CF_UNICODETEXT. - - (syms_of_w32select): Init and register new variables. - - * w32.h: Add prototypes for globals_of_w32select and - term_w32select. Make the neighboring K&R declarations into - prototypes, too. - - * emacs.c: Include w32.h to get function prototypes. - (main): Call globals_of_w32select. - - * w32.c (term_ntproc): Call term_w32select. - - * s/ms-w32.h: Guard MSC-specific #pragmas with an #ifdef. - -2005-02-16 Kim F. Storm <storm@cua.dk> - - * xdisp.c (BUFFER_POS_REACHED_P): Return true if pos reached and - at end of display vector. - -2005-02-15 Richard M. Stallman <rms@gnu.org> - - * xdisp.c (get_next_display_element): Fix escape-glyph criterion - for mode and header lines. - - * lread.c (syms_of_lread) <user-init-file>: Doc fix. - - * keymap.h (describe_map_tree): Change decl. - - * keyboard.c (command_loop_1): Always use safe_run_hooks - to run Qdeferred_action_function. - - * keymap.c (describe_map_tree): New arg MENTION_SHADOW. Calls changed. - (describe_map, describe_vector): Likewise. When it's 1, - don't omit shadowed bindings, instead mark them as shadowed. - - * doc.c (Fsubstitute_command_keys): Compute list of shadowing maps - for describe_map_tree. Pass 1 for MENTION_SHADOW. - - * data.c (Fsetq_default): Allow no arg case. - -2005-02-14 Kenichi Handa <handa@m17n.org> - - * coding.c (encode_coding_string): Always return a unibyte string. - If NOCOPY is nonzero and there's no need of encoding, make STR - unibyte directly. - - * xselect.c (lisp_data_to_selection_data): If OBJ is a non-ASCII - multibyte string, signal an error instead of aborting. - -2005-02-12 Dan Nicolaescu <dann@ics.uci.edu> - - * keyboard.c: If HAVE_FCNTL_H include fcntl.h. - -2005-02-12 Kim F. Storm <storm@cua.dk> - - * xdisp.c (expose_window): Don't fix overlaps for mode lines. - -2005-02-10 Kim F. Storm <storm@cua.dk> - - * xdisp.c (try_window_id): Set first_unchanged_at_end_row to NULL - if it moves outside window or it doesn't display text. - -2005-02-09 Kim F. Storm <storm@cua.dk> - - * undo.c (Fprimitive_undo): Check that undo function does not - switch buffer. - -2005-02-08 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xselect.c (selection_data_to_lisp_data): For the special case - type == XA_ATOM, data contains array of int, not array of Atom. - (x_property_data_to_lisp, selection_data_to_lisp_data): - Comment update: data must be array of int for format == 32. - -2005-02-08 Stefan Monnier <monnier@iro.umontreal.ca> - - * undo.c (Fprimitive_undo): Check veracity of delta,start,end. - -2005-02-07 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xfns.c (Fx_change_window_property): Use long array when format is 32. - (Fx_window_property): If format is 32 and long is bigger than 32 bits, - convert long array returned from XGetWindowProperty to an int array. - (x_set_tool_bar_lines): Check that width and height is greater than - zero before clearing area. - - * xselect.c (x_reply_selection_request): Pass long array to - XChangeProperty so that 64 bit longs are handeled correctly. - (x_get_window_property): If format is 32 and long is bigger than 32 - bits convert data from XGetWindowProperty from long array to int array. - (lisp_data_to_selection_data): When the input is a vector and the - format is 32, allocate a long array even if long is bigger than 32 bits. - (x_fill_property_data): Use char, short and long as the man page - for XChangeProperty specifies. This way the data returned is OK for - both 32 and 64 bit machines. - (x_handle_dnd_message): Calculate size correctly even for 64 bit - machines. - (Fx_send_client_event): Undo change from 2005-02-05, - x_fill_property_data now handles that case. - - * xfns.c (Fx_backspace_delete_keys_p): Add comment about the - reason for the approach in the code. - -2005-02-07 Kim F. Storm <storm@cua.dk> - - * undo.c (Fprimitive_undo): Record max one dummmy apply element. - -2005-02-06 Richard M. Stallman <rms@gnu.org> - - * eval.c (Frun_hook_with_args) - (Frun_hook_with_args_until_success) - (Frun_hook_with_args_until_failure): Doc fixes. - -2005-02-05 Andreas Schwab <schwab@suse.de> - - * sysdep.c (sys_subshell): Properly terminate execlp argument list. - -2005-02-05 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xselect.c (Fx_send_client_event, x_handle_dnd_message): Handle - the longs in a XClientMessageEvent correctly when long is 64 bits. - -2005-02-05 Eli Zaretskii <eliz@gnu.org> - - * xfaces.c (face_color_supported_p): Use HAVE_WINDOW_SYSTEM - instead of HAVE_X_WINDOWS, for non-X windowed sessions. - -2005-02-03 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xmenu.c (menubar_selection_callback): Force out GTK buffered - events so the menu event comes after them. This is to prevent sit-for - from exiting on buffered events directly after a menu selection, - lisp code for Help => About Emacs uses sit-for. - - * gtkutil.c (create_menus): Connect selection-done event instead of - the deactivate event to deactivate_cb. This will make the last - leave event come before the call to deactivate_cb, so the leave - event does not make sit-for exit after a menu selection. - -2005-02-03 Kim F. Storm <storm@cua.dk> - - * dispnew.c (build_frame_matrix_from_leaf_window) - [!GLYPH_DEBUG]: Fix xassert. - - * xfaces.c (x_free_gc) [!GLYPH_DEBUG]: Fix xassert. - - * xfns.c (unwind_create_frame) [!GLYPH_DEBUG]: Fix xassert. - -2005-02-03 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * mac.c: Use MAC_OS_X_VERSION_MAX_ALLOWED to conditionalize by - the compiling OS version. - - * macfns.c (x_create_tip_frame): Likewise. - - * macterm.c (mac_draw_string_common, x_make_frame_visible): Likewise. - -2005-02-03 Richard M. Stallman <rms@gnu.org> - - * xterm.c (x_error_quitter): On GCC 3 and up, specify noinline. - - * xdisp.c (echo_area_display): Clear echo_message_buffer. - - * buffer.c (Fbury_buffer): Doc fix. - -2005-02-02 Steven Tamm <steventamm@mac.com> - - * macfns.c (unwind_create_frame): Fix compile error due to - xassert being uncondition, but predicate is. - * dispnew.c (update_window): Fix compile error due to - xassert being uncondition, but predicate is. - -2005-02-02 Miles Bader <miles@gnu.org> - - * dispextern.h (xassert): Enable unconditionally. - -2005-02-02 Kim F. Storm <storm@cua.dk> - - * undo.c (Fprimitive_undo): Fix dummy apply undo entry. - -2005-02-02 Kenichi Handa <handa@m17n.org> - - * casefiddle.c (casify_object): Enable changing characters of - different byte length. - (casify_region): Fix loop condition, args to replace_range_2, and - update opoint_byte. - - * insdel.c (replace_range_2): Fix bugs in adjusting markers and point. - -2005-02-01 Kim F. Storm <storm@cua.dk> - - * xdisp.c (back_to_previous_visible_line_start): Reset iterator - stack before calling handle_display_prop. - -2005-01-31 Kim F. Storm <storm@cua.dk> - - * undo.c (Qapply): New lisp var. - (syms_of_undo): Intern and staticpro it. - (Fprimitive_undo): Support formats (apply FUNNAME . ARGS) and - (apply DELTA BEG END FUNNAME . ARGS) instead of (FUNNAME . ARGS). - - * buffer.c (syms_of_buffer) <buffer-undo-list>: Doc fix. - -2005-01-30 Jesper Harder <harder@phys.au.dk> - - * macterm.c (syms_of_macterm) <mac-reverse-ctrl-meta> - <mac-emulate-three-button-mouse>: Fix docstring indentation. - -2005-01-29 Luc Teirlinck <teirllm@auburn.edu> - - * undo.c (syms_of_undo) <undo-outer-limit>: Doc update. - Increase value to 3 Meg. - -2005-01-29 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xfns.c (show_hourglass): Use FRAME_X_WINDOW as parent for GTK, - button events are not received otherwise. - -2005-01-29 Richard M. Stallman <rms@gnu.org> - - * buffer.c (syms_of_buffer) <buffer-undo-list>: Doc fix. - - * undo.c (Fprimitive_undo): Handle (FUNNAME . ARGS) by calling FUNNAME. - -2005-01-28 Stefan Monnier <monnier@iro.umontreal.ca> - - * keymap.c (access_keymap): YAILOM. - -2005-01-27 Kim F. Storm <storm@cua.dk> - - * xdisp.c (get_phys_cursor_geometry): New function to calculate - phys cursor position and size for hollow cursor. Position is - aligned with get_glyph_string_clip_rect and ensures that a hollow - cursor is shown, even when the actual glyph is not visible. - - * dispextern.h (get_phys_cursor_geometry): Add prototype. - - * xterm.c (x_clip_to_row): Ensure y >= 0. - (x_draw_hollow_cursor): Use get_phys_cursor_geometry. - - * w32term.c (x_draw_hollow_cursor): Use get_phys_cursor_geometry. - - * macterm.c (x_draw_hollow_cursor): Use get_phys_cursor_geometry. - -2005-01-27 Stefan Monnier <monnier@iro.umontreal.ca> - - * xterm.c (x_error_quitter): Add a prototype. Make it static again. - -2005-01-27 Kim F. Storm <storm@cua.dk> - - * xdisp.c (get_glyph_string_clip_rect): Always show a cursor - glyph, even when row is only partially visible and actual cursor - position is not visible. - -2005-01-24 Richard M. Stallman <rms@gnu.org> - - * xterm.c (x_error_quitter): No longer static, and moved after - x_error_handler. - -2005-01-24 Kim F. Storm <storm@cua.dk> - - * xdisp.c (move_it_by_lines): If we move forward after going too - far back, cancel move if end position is same as start position. - -2005-01-24 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * dispextern.h (struct glyph_string): New members clip_head and - clip_tail. - - * xdisp.c (get_glyph_string_clip_rect): Restrict horizontal clip - region to the area between clip_head and clip_tail. - (draw_glyphs): Record the area that need to be actually redrawn to - the new variables clip_head and clip_tail when there are - overhangs. Set values of these variables to the corresponding - members in struct glyph_string. Refine x coordinates for - notice_overwritten_cursor using clip_head and clip_tail. - - * macgui.h (STORE_XCHARSETSTRUCT): New macro. - - * macterm.c (mac_compute_glyph_string_overhangs): Implement with - QDTextBounds. - (x_draw_glyph_string): Don't fill the background of the successor - of a glyph with a right overhang if the successor will draw a cursor. - (XLoadQueryFont): Obtain font metrics using QDTextBounds. - (x_redisplay_interface): Add entry for compute_glyph_string_overhangs. - -2005-01-24 Kim F. Storm <storm@cua.dk> - - * window.c (window_scroll_pixel_based): Fix scrolling in the wrong - direction if window height was smaller than next-screen-context-lines. - Now always scroll at least one line in the requested direction. - Ensure that we actually do scroll backwards when requested to do so. - - * xdisp.c (redisplay_window): Only try to make cursor line fully - visible once (to avoid redisplay loop). - -2005-01-23 Kim F. Storm <storm@cua.dk> - - * window.c (Fpos_visible_in_window_p): Simplify return value for - partially visible rows. - (window_scroll_pixel_based): Adapt to that change. - - * window.c (window_scroll_pixel_based): Force moving to next line - if scrolling doesn't move start point, e.g. if looking at tall image. - - * xdisp.c (pos_visible_p): Return 0 if non-interactive. - Clear last_height before calling line_bottom_y to get real height. - Fix calculation of y. - -2005-01-22 Steven Tamm <steventamm@mac.com> - - * s/darwin.h: Removed PTY_ITERATION from here. - (DARWIN): Define. - - * process.c (init_process): Default process-connection-type to - nil on darwin 6 or less, t if it is 7 or higher. This way the - broken pty behavior is still allowed on darwin 6 for interactive - processes for people that know what they are doing. - -2005-01-22 Kim F. Storm <storm@cua.dk> - - * window.c (auto_window_vscroll_p): New boolean. - (syms_of_window): DEFVAR_BOOL it. - (Fpos_visible_in_window_p): Extend return value to include RTOP - and RBOT values if FULLY is nil. - (window_scroll_pixel_based): Adjust vscroll for partially visible - rows if auto_window_vscroll_p is set. - (Fset_window_vscroll): Do nothing if vscroll is not modified. - - * xdisp.c (pos_visible_p): Replace FULLY arg by RTOP and RBOT args - to return number of partially invisible pixels at top and bottom - of the dislay row at POS. - - * lisp.h (pos_visible_p): Fix prototype. - -2005-01-21 Richard M. Stallman <rms@gnu.org> - - * fileio.c (Fcopy_file): Doc fix. - -2005-01-21 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (xg_tool_bar_detach_callback): Remove unused variable bw. - (xg_get_file_name): Move declaration ofx_use_old_gtk_file_dialog to - start of function for older compilers. - -2005-01-20 Richard M. Stallman <rms@gnu.org> - - * editfns.c (Fmessage): If arg is "", return "" (as before). - - * keymap.c (access_keymap): Protect from bad value of meta_prefix_char. - - * .gdbinit (xgetptr, xgetint, xgettype): Copy $arg0 into a temp - variable. - -2005-01-20 Steven Tamm <steventamm@mac.com> - - * editfns.c (Voperating_system_release): Add. - (init_editfns): Assign new variable operating-system-release - based on call to uname if available. - (get_operating_system_release): Add function to - allow c-level access to operating system release. - - * config.h: Regenerated. - - * s/darwin.h (PTY_ITERATION): Don't allow PTYs on darwin 6 or less. - (MIN_PTY_KERNEL_VERSION): Define minimum kernel version for - using ptys as '7'. - -2005-01-20 Kim F. Storm <storm@cua.dk> - - * alloc.c (STRING_MARKED_P, VECTOR_MARKED_P): Return boolean. - - * xterm.c (x_draw_glyph_string_box): Fix last_x for full width rows. - Thanks to Chong Yidong <cyd@stupidchicken.com> for debugging this. - - * macterm.c (x_draw_glyph_string_box): Likewise. - - * w32term.c (x_draw_glyph_string_box): Likewise. - - * indent.c (Fvertical_motion): Temporarily disable selective display. - -2005-01-19 Kim F. Storm <storm@cua.dk> - - * xdisp.c (note_mode_line_or_margin_highlight): Fix :pointer - image property. - - * fns.c (sweep_weak_table): Advance prev pointer when we keep a pair. - -2005-01-18 Kim F. Storm <storm@cua.dk> - - * xdisp.c (fast_find_position): Backtrack to find first row if - charpos is inside a display overlay that spans multiple lines. - -2005-01-18 Kenichi Handa <handa@m17n.org> - - * coding.c (decode_coding_iso2022): Translate invalid codes if - translation-table is specified. - -2005-01-18 Kim F. Storm <storm@cua.dk> - - * xdisp.c (back_to_previous_visible_line_start): Undo 2004-12-28 - change. If handle_display_prop indicates newline is replaced by - image or text, move back to start of relevant overlay or interval - and continue scan from there. Simplify. - -2005-01-17 Kim F. Storm <storm@cua.dk> - - * dispnew.c (mode_line_string, marginal_area_string): - Fix off-by-one error in search for glyph. - -2005-01-16 Kim F. Storm <storm@cua.dk> - - * macterm.c (syms_of_macterm) <mac-allow-anti-aliasing>: Doc fix. - -2005-01-16 Steven Tamm <steventamm@mac.com> - - * macterm.c (mac_to_x_fontname): Remove spurious argument. - -2005-01-16 Andreas Schwab <schwab@suse.de> - - * macterm.c (mac_draw_string_common): Fix compilation on OSX 10.1. - -2005-01-16 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * fringe.c (Fdefine_fringe_bitmap, init_fringe): When assigning - fringe_faces, cast result from xmalloc/xrealloc to Lisp_Object *. - -2005-01-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * keyboard.c (READABLE_EVENTS_DO_TIMERS_NOW) - (READABLE_EVENTS_FILTER_EVENTS, READABLE_EVENTS_IGNORE_SQUEEZABLES): - New flags for readable_events. - (get_filtered_input_pending, readable_filtered_events): Remove. - (tracking_off): Call readable_events and get_input_pending with - flag READABLE_EVENTS_DO_TIMERS_NOW. - (readable_events): Move code from old readable_filtered_events here, - but check new READABLE_EVENTS_* in argument flags instead of previous - two boolean arguments do_timers_now and filter_events. - If we are doing mouse tracking and the mouse moved, return only if - READABLE_EVENTS_IGNORE_SQUEEZABLES is not set in flags. - (swallow_events): Call get_input_pending with flag - READABLE_EVENTS_DO_TIMERS_NOW. - (get_input_pending): Move code from old get_filtered_input_pending - here. Replace boolean arguments do_timers_now, filter_events with - flags, and pass flags to readable_events. Document new - READABLE_EVENTS_* flags. - (detect_input_pending_ignore_squeezables): New function. - (detect_input_pending_run_timers): Call get_input_pending with flag - READABLE_EVENTS_DO_TIMERS_NOW. - (Finput_pending_p): Call get_input_pending with flags - READABLE_EVENTS_DO_TIMERS_NOW and READABLE_EVENTS_FILTER_EVENTS. - - * dispnew.c (update_window, update_frame_1): Replace calls to - detect_input_pending with detect_input_pending_ignore_squeezables - so that redisplay is not paused if the event queue contains only - mouse movements. - - * lisp.h: Declare detect_input_pending_ignore_squeezables. - -2005-01-15 Steven Tamm <steventamm@mac.com> - - * macterm.c (Vmac_use_core_graphics): Declare variable for - mac-allow-anti-aliasing. - (syms_of_macterm): DEFVAR_LISP and initialize it. - (mac_draw_string_common): Use core graphics text rendering if - mac-allow-anti-aliasing is enabled. - - * macfns.c (Fx_file_dialog): Save As dialog includes only the - file name in the text box. - -2005-01-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macfns.c (x_set_foreground_color, x_set_background_color): - Sync with xfns.c. - (mac_window, x_create_tip_frame): Use XSetWindowBackground. - * macterm.c (XSetBackground, XSetWindowBackground): New functions. - * macterm.h (XSetBackground, XSetWindowBackground): Add externs. - -2005-01-14 Kim F. Storm <storm@cua.dk> - - * keyboard.c (Fposn_at_x_y): Add optional arg WHOLE. - -2005-01-13 Richard M. Stallman <rms@gnu.org> - - * keymap.c (Fcurrent_active_maps): Ignore Voverriding_local_map - if Voverriding_terminal_local_map is non-nil. - - * keyboard.c (syms_of_keyboard): Doc fix. - -2005-01-13 Kim F. Storm <storm@cua.dk> - - * xdisp.c (Fformat_mode_line): Fix last change. Remove NO_PROPS arg - (specify 0 for FACE instead). Reorder arg list. Doc fix. - -2005-01-12 Richard M. Stallman <rms@gnu.org> - - * xdisp.c (Fformat_mode_line): New arg FACE specifies a default - face property for characters that don't specify one. - - * fns.c (Frequire): Record in load-history unconditionally. - -2005-01-10 Kim F. Storm <storm@cua.dk> - - * dispextern.h (merge_faces): Rename from merge_into_realized_face. - - * xfaces.c (merge_faces): Rename from merge_into_realized_face. - Callers changed. - Add support to merge with lisp face id too (if face_name is t). - - * xdisp.c (get_next_display_element, next_element_from_display_vector): - Don't lookup lface_id from display table glyphs here; instead use - merge_faces to merge the lisp face id into current face. - -2005-01-09 Kim F. Storm <storm@cua.dk> - - * dispextern.h (struct it): New member dpvec_face_id. - (merge_into_realized_face): Add prototype. - - * xfaces.c (merge_into_realized_face): New function. Used to - merge escape-glyph face or face from display table into current face. - - * xdisp.c (Vshow_nonbreak_escape): New lisp var. - (syms_of_xdisp): DEFVAR_LISP it. - (escape_glyph_face): Remove var. - (redisplay_window): Don't initialize it. - (setup_for_ellipsis, get_next_display_element): - Set it->dpvec_face_id to -1. - (get_next_display_element): Test Vshow_nonbreak_escape. - Do not setup escape_glyph_face. - Properly merge escape-glyph face or face from display table with - current face for escape and control characters. - Set it->dpvec_face_id to relevant face id instead of adding it to each - element of display vector. - (next_element_from_display_vector): If it->dpvec_face_id is set, - use that instead of lface_id from glyph itself. - -2005-01-08 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.h (struct x_output): New member, toolbar_detached. - - * gtkutil.c (xg_create_frame_widgets): Set initial tool bar height to - 38. - (xg_tool_bar_detach_callback): Set toolbar_detached to 1. - (xg_tool_bar_attach_callback): Set toolbar_detached to 0. - (xg_create_tool_bar): Initialize toolbar_detached. - (update_frame_tool_bar): Only set FRAME_TOOLBAR_HEIGHT (f) if - toolbar_detached is zero. - -2005-01-07 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xmenu.c (create_and_show_popup_menu): Pass zero as button to - gtk_menu_popup if not for_click, so callbacks for the menu are called. - - * gtkutil.c (xg_gtk_scroll_destroy, xg_create_scroll_bar) - (xg_tool_bar_callback, xg_tool_bar_help_callback) - (update_frame_tool_bar): Cast to EMACS_INT to avoid compiler warning. - - * xselect.c (x_get_foreign_selection, x_fill_property_data) - (Fx_get_atom_name, Fx_send_client_event): Replace XFLOAT with - XFLOAT_DATA to get extract number from Lisp object. - -2005-01-07 Kim F. Storm <storm@cua.dk> - - * xdisp.c (set_iterator_to_next): Fix 2004-12-13 change. - Set stop_charpos to current charpos instead of 0. - -2005-01-06 Nick Roberts <nickrob@snap.net.nz> - - * xdisp.c (Fformat_mode_line): First arg now required. - -2005-01-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macterm.c (XLoadQueryFont): Correctly handle 0 size - font widths that are returned from some Japanese fonts. - -2005-01-06 Kim F. Storm <storm@cua.dk> - - * fringe.c (fringe_faces): Change to Lisp_Object pointer. - (draw_fringe_bitmap_1): Lookup user defined fringe faces here. - (destroy_fringe_bitmap): Set fringe_faces element to nil. - (Fdefine_fringe_bitmap, init_fringe): Change allocation of - fringe_faces array and init elements to nil. - (Fset_fringe_bitmap_face): Set fringe_faces to face name instead of - non-persistent face id. - (mark_fringe_data): New function for GC. - - * alloc.c (mark_fringe_data): Declare extern. - (Fgarbage_collect): Call mark_fringe_data. - - * alloc.c (overrun_check_free): Invalidate freed memory if - XMALLOC_CLEAR_FREE_MEMORY is defined. - -2005-01-05 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macfns.c: Include sys/param.h. - [TARGET_API_MAC_CARBON] (mac_nav_event_callback): New declaration - and function. - [TARGET_API_MAC_CARBON] (Fx_file_dialog): Use MAXPATHLEN for size - of filename string. Set event callback function when creating - dialog boxes. Add code conversions for filenames. Don't dispose - of apple event descriptor record if failed to create it. - - * macterm.c: Include sys/param.h. - [USE_CARBON_EVENTS] (mac_handle_window_event): Add handler for - kEventWindowUpdate. - (install_window_handler) [USE_CARBON_EVENTS]: Register it. - (do_ae_open_documents) [TARGET_API_MAC_CARBON]: Get FSRef instead - of FSSpec from apple event descriptor record. - (do_ae_open_documents) [TARGET_API_MAC_CARBON]: Use MAXPATHLEN for - size of filename string. - [TARGET_API_MAC_CARBON] (mac_do_receive_drag): Likewise. - [TARGET_API_MAC_CARBON] (mac_do_receive_drag): Return error when a - file dialog is in action. - [TARGET_API_MAC_CARBON] (mac_do_track_drag): Likewise. - Reject only when there are no filename items. Set background color - before (un)highlighting the window below the dragged items. - (XTread_socket) [USE_CARBON_EVENTS]: Don't call do_window_update. - -2005-01-05 Romain Francoise <romain@orebokech.com> - - * term.c (encode_terminal_code): Fix buffer size computation. - -2005-01-04 Richard M. Stallman <rms@gnu.org> - - * xdisp.c (Fformat_mode_line): Doc fix. - -2005-01-04 Stefan Monnier <monnier@iro.umontreal.ca> - - * alloc.c (refill_memory_reserve): Move. - (emacs_blocked_free, emacs_blocked_malloc, emacs_blocked_realloc) - (reset_malloc_hooks, uninterrupt_malloc) [SYNC_INPUT]: Don't define. - -2005-01-03 Richard M. Stallman <rms@gnu.org> - - * window.c (window_scroll_pixel_based): Don't correct preserve_y - for CURRENT_HEADER_LINE_HEIGHT when moving backwards. - -2005-01-03 Jason Rumney <jasonr@gnu.org> - - * w32bdf.c (w32_load_bdf_font): Set fontp->average_width and - fontp->space_width to FONT_WIDTH so they are valid. - - * w32fns.c (w32_load_system_font): Set FONT_WIDTH to maximum, not - average width. Set fontp->average_width and fontp->space_width to - their appropriate values. - - * w32term.c (x_new_font): Set FRAME_COLUMN_WIDTH to - fontp->average_width, not FONT_WIDTH. Set FRAME_SPACE_WIDTH to - fontp->space_width. - -2005-01-03 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macterm.c (x_new_font): Set FRAME_SPACE_WIDTH. - (x_font_min_bounds, XLoadQueryFont): Use the correct font width - metrics for max and min bounds. - (x_load_font): Correctly calculate average font width metrics. - -2005-01-02 Richard M. Stallman <rms@gnu.org> - - * alloc.c (Fgarbage_collect): Don't truncate_undo_list on dead buffers. - -2004-12-31 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.c (handle_one_xevent): Clear area in expose event for GTK. - -2004-12-31 Richard M. Stallman <rms@gnu.org> - - * xdisp.c (setup_for_ellipsis, get_next_display_element): - Set it->ellipsis_p to 1 or 0. - (display_line): Record whether row ends in mid-ellipsis. - (set_cursor_from_row): If ends in ellipsis, find start of it. - (cursor_row_p): If PT's at the end of the ellipsis the row - ends within, don't display cursor on this row. - - * dispextern.h (struct it): New element ellipsis_p. - (struct glyph_row): New element ends_in_ellipsis_p. - - * xdisp.c (BUFFER_POS_REACHED_P): We haven't reached the specified - position if we're reading from something other than the buffer. - - * window.c (window_scroll_pixel_based): Only look at - Vscroll_preserve_screen_position if the old PT can't be kept. - (syms_of_window) <scroll-preserve-screen-position>: Doc fix. - -2004-12-30 Kim F. Storm <storm@cua.dk> - - * xdisp.c (get_line_height_property): New function extracted from - original calc_line_height_property. - (calc_line_height_property): Rework. Handle t and (nil . ratio). - (x_produce_glyphs): Use them to handle line-height and - line-spacing according to new height spec. - (Qtotal): Remove. - (syms_of_xdisp): Remove intern and staticpro for Qtotal. - -2004-12-30 Kenichi Handa <handa@m17n.org> - - * fileio.c (Finsert_file_contents): Don't use - current_buffer->buffer_file_coding_system even if REPLACE is - non-nil. Call Qafter_insert_file_set_coding with the second arg VISIT. - - * fontset.h (struct font_info): New members space_width and - average_width. - - * frame.h (struct frame): New member space_width. - (FRAME_SPACE_WIDTH): New macro. - - * xterm.h (struct x_display_info): New member Xatom_AVERAGE_WIDTH. - - * xterm.c (x_new_font): Set FRAME_COLUMN_WIDTH to - fontp->average_width, not FONT_WIDTH. Set FRAME_SPACE_WIDTH to - fontp->space_width. - (x_load_font): Calculate fontp->space_width and fontp->average_width. - (x_term_init): Initialize dpyinfo->Xatom_AVERAGE_WIDTH. - - * xdisp.c (x_produce_glyphs): Calculate tab width by - FRAME_SPACE_WIDTH, not FRAME_COLUMN_WIDTH. - -2004-12-29 Sanghyuk Suh <han9kin@mac.com> - - * macterm.c (SelectionRange): Add Xcode position apple event struct. - (do_ae_open_documents): Handle Xcode-style file position open events. - -2004-12-29 Luc Teirlinck <teirllm@auburn.edu> - - * buffer.c (syms_of_buffer) <vertical-scroll-bar>: Correct typo. - -2004-12-29 Richard M. Stallman <rms@gnu.org> - - * buffer.c (syms_of_buffer) <vertical-scroll-bar>: Doc fix. - -2004-12-29 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macfns.c (install_window_handler): Modify extern to return OSErr - value. - (mac_window): Handle return value of install_window_handler. - - * macterm.c (reflect_byte): Remove function. - (mac_create_bitmap_from_bitmap_data): Don't call reflect_byte. - Lookup table instead. - (mac_do_font_lists): Simplify calculation of the longest - nonspecial string. - (init_mac_drag_n_drop): Remove function and declaration. - (mac_initialize) [TARGET_API_MAC_CARBON]: Don't call - init_mac_drag_n_drop. - (mac_do_track_drag): New function and declaration. - (install_window_handler): Return OSErr value. - (install_window_handler) [TARGET_API_MAC_CARBON]: - Register handlers for tracking/receiving drag-and-drop items. - (do_ae_open_documents): Generate unibyte strings for filenames. - (mac_do_receive_drag) [TARGET_API_MAC_CARBON]: Likewise. - Reject only non-filename items. Set event modifiers, and return value. - -2004-12-28 Dan Nicolaescu <dann@ics.uci.edu> - - * coding.c (decode_coding): Fix previous change. - -2004-12-28 Richard M. Stallman <rms@gnu.org> - - * xdisp.c (back_to_previous_visible_line_start): - Don't call handle_display_prop. - -2004-12-28 Dan Nicolaescu <dann@ics.uci.edu> - - * coding.c (decode_coding_XXX, decode_composition_emacs_mule) - (decode_coding_emacs_mule, encode_coding_emacs_mule) - (decode_coding_iso2022, encode_designation_at_bol) - (encode_coding_iso2022, decode_coding_sjis_big5, decode_eol) - (decode_coding): Constify arguments and local vars. - -2004-12-27 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xmenu.c (popup_get_selection): Only pop down dialogs - on C-g and Escape. - (popup_get_selection): Remove parameter down_on_keypress. - (create_and_show_popup_menu, create_and_show_dialog): - Remove parameter down_on_keypress to popup_get_selection. - -2004-12-27 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * dispextern.h: Change HAVE_CARBON to MAC_OS. - (struct glyph_string): Likewise. - - * emacs.c (main) [MAC_OS8]: Call mac_term_init instead of - mac_initialize. - - * fileio.c (Fnext_read_file_uses_dialog_p, Fread_file_name): - Change TARGET_API_MAC_CARBON to HAVE_CARBON. - - * fns.c (vector): Change MAC_OSX to MAC_OS. - - * frame.c (x_set_frame_parameters, x_report_frame_params) - (x_set_fullscreen): Remove #ifndef HAVE_CARBON. - (x_set_border_width, Vdefault_frame_scroll_bars): - Change HAVE_CARBON to MAC_OS. - - * image.c [MAC_OS]: Include sys/stat.h. - [MAC_OS && !MAC_OSX]: Include sys/param.h, ImageCompression.h, and - QuickTimeComponents.h. - - * mac.c [!MAC_OSX] (mac_wait_next_event): Add extern. - [!MAC_OSX] (select): Use mac_wait_next_event. - [!MAC_OSX] (run_mac_command): Change EXEC_SUFFIXES to Vexec_suffixes. - [!MAC_OSX] (select, run_mac_command): Change `#ifdef - TARGET_API_MAC_CARBON' to `#if TARGET_API_MAC_CARBON'. - (mac_clear_font_name_table): Add extern. - (Fmac_clear_font_name_table): New defun. - (syms_of_mac): Defsubr it. - [MAC_OSX] (SELECT_POLLING_PERIOD_USEC): New define. - [MAC_OSX] (select_and_poll_event): New function. - [MAC_OSX] (sys_select): Use it. - [MAC_OSX && SELECT_USE_CFSOCKET] (socket_callback): New function. - [MAC_OSX && SELECT_USE_CFSOCKET] - (SELECT_TIMEOUT_THRESHOLD_RUNLOOP, EVENT_CLASS_SOCK): New defines. - [MAC_OSX] (sys_select) [SELECT_USE_CFSOCKET]: Use CFSocket and - RunLoop for simultaneously monitoring two kinds of inputs, window - events and process outputs, without periodically polling. - - * macfns.c (mac_initialized): Remove extern. - (stricmp): Put in #if 0. All callers changed to use xstricmp in - xfaces.c. - (strnicmp): Decrement `n' at the end of each loop, not the beginning. - (check_mac): Use the term "Mac native windows" instead of "Mac OS". - (check_x_display_info, x_display_info_for_name): Sync with xfns.c. - (mac_get_rdb_resource): New function (from w32reg.c). - (x_get_string_resource): Use it. - (install_window_handler): Add extern. - (mac_window): New function. - (Fx_create_frame): Use it instead of make_mac_frame. - Set parameter for Qfullscreen. Call x_wm_set_size_hint. - (Fx_open_connection, Fx_close_connection): New defuns. - (syms_of_macfns): Defsubr them. - (x_create_tip_frame) [TARGET_API_MAC_CARBON]: - Add kWindowNoUpdatesAttribute to the window attribute. - (x_create_tip_frame) [!TARGET_API_MAC_CARBON]: Use NewCWindow. - (x_create_tip_frame): Don't call ShowWindow. - (Fx_show_tip): Call ShowWindow. - (Fx_file_dialog): Change `#ifdef TARGET_API_MAC_CARBON' to `#if - TARGET_API_MAC_CARBON'. - (mac_frame_parm_handlers): Set handlers for Qfullscreen. - (syms_of_macfns) [MAC_OSX]: Initialize mac_in_use to 0. - - * macgui.h [!MAC_OSX]: Don't include Controls.h. Include Windows.h. - (Window): Typedef to WindowPtr and move outside `#if - TARGET_API_MAC_CARBON'. - (XSizeHints): New struct. - - * macterm.c (x_update_begin, x_update_end) - [TARGET_API_MAC_CARBON]: Disable screen updates during update of a - frame. - (x_draw_glyph_string_background, x_draw_glyph_string_foreground) - [MAC_OS8]: Use XDrawImageString/XDrawImageString16. - (construct_mouse_click): Put in #if 0. - (x_check_fullscreen, x_check_fullscreen_move): Remove decls. - (x_scroll_bar_create, x_scroll_bar_handle_click): Change `#ifdef - TARGET_API_MAC_CARBON' to `#if TARGET_API_MAC_CARBON'. - (activate_scroll_bars, deactivate_scroll_bars) - [!TARGET_API_MAC_CARBON]: Use ActivateControl/DeactivateControl. - (x_make_frame_visible) [TARGET_API_MAC_CARBON]: Reposition window - if the position is neither user-specified nor program-specified. - (x_free_frame_resources): Free size_hints. - (x_wm_set_size_hint): Allocate size_hints if needed. Set size_hints. - (mac_clear_font_name_table): New function. - (mac_do_list_fonts): Initialize font_name_table if needed. - (x_list_fonts): Don't initialize font_name_table. Add BLOCK_INPUT - around mac_do_list_fonts. - (mac_unload_font): New function. - (x_load_font): Add BLOCK_INPUT around XLoadQueryFont. - (init_mac_drag_n_drop, mac_do_receive_drag): Enclose declarations - and definitions with #if TARGET_API_MAC_CARBON. - [USE_CARBON_EVENTS] (mac_handle_window_event): Add decl. - (install_window_handler): Add decl. - (do_window_update): Add BeginUpdate/EndUpdate for the tooltip - window. Use UpdateControls. Get the rectangle that should be - updated and restrict the target of expose_frame to it. - (do_grow_window): Set minimum height/width according to size_hints. - (do_grow_window) [TARGET_API_MAC_CARBON]: Use ResizeWindow. - (do_zoom_window): Don't use x_set_window_size. - [USE_CARBON_EVENTS] (mac_handle_window_event): New function. - (install_window_handler): New function. - [!USE_CARBON_EVENTS] (mouse_region): New variable. - [!USE_CARBON_EVENTS] (mac_wait_next_event): New function. - (XTread_socket) [USE_CARBON_EVENTS]: Move call to - GetEventDispatcherTarget inside BLOCK_INPUT. - (XTread_socket) [!USE_CARBON_EVENTS]: Use mac_wait_next_event. - Update mouse_region when mouse is moved. - (make_mac_frame): Remove. - (make_mac_terminal_frame): Put in #ifdef MAC_OS8. - Initialize mouse pointer shapes. Change values of f->left_pos and - f->top_pos. Don't use make_mac_frame. Use NewCWindow. - Don't call ShowWindow. - (mac_initialize_display_info) [MAC_OSX]: Create mac_id_name from - Vinvocation_name and Vsystem_name. - (mac_make_rdb): New function (from w32term.c). - (mac_term_init): Use it. Add BLOCK_INPUT. Error if display has - already been opened. Don't pass argument to - mac_initialize_display_info. Don't set dpyinfo->height/width. - Add entries to x_display_list and x_display_name_list. - (x_delete_display): New function. - (mac_initialize): Don't call mac_initialize_display_info. - (syms_of_macterm) [!MAC_OSX]: Don't call Fprovide. - - * macterm.h (check_mac): Add extern. - (struct mac_output): New member size_hints. - (FRAME_SIZE_HINTS): New macro. - (mac_unload_font): Add extern. - - * xdisp.c (expose_window, expose_frame): Remove kludges for Mac. - - * xfaces.c (clear_font_table) [MAC_OS]: Call mac_unload_font. - -2004-12-27 Richard M. Stallman <rms@gnu.org> - - * buffer.c (Fbuffer_disable_undo): Delete (move to simple.el). - (syms_of_buffer): Don't defsubr it. - - * process.c (list_processes_1): Set undo_list instead - of calling Fbuffer_disable_undo. - - * xdisp.c (single_display_spec_string_p): Rename from - single_display_prop_string_p. - (single_display_spec_intangible_p): Rename from - single_display_prop_intangible_p. - (handle_single_display_spec): Rename from handle_single_display_prop. - Rewritten to be easier to understand. - - Change in load-history format. Functions now get (defun . NAME), - and variables get just NAME. - - * data.c (Fdefalias): Use (defun . FN_NAME) in LOADHIST_ATTACH. - - * eval.c (Fdefun, Fdefmacro): Use (defun . FN_NAME) in LOADHIST_ATTACH. - (Fdefvaralias, Fdefvar, Fdefconst): Use just SYM in LOADHIST_ATTACH. - (Qdefvar): Var deleted. - (syms_of_eval): Don't initialze it. - - * lread.c (syms_of_lread) <load-history>: Doc fix. - -2004-12-27 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xmenu.c (popup_get_selection): Pop down on C-g. - (set_frame_menubar): Install translations for Lucid/Motif/Lesstif that - pops down menu on C-g. - (xdialog_show): If dialog popped down and no button in the dialog was - pushed, call Fsignal to quit. - (xmenu_show): In no toolkit version, if menu returns NO_SELECT call - Fsignal to quit. - - * xfns.c (Fx_file_dialog): Motif/Lesstif version: Pop down on C-g. - - * gtkutil.c (xg_initialize): Install bindings for C-g so that - dialogs and menus pop down. - -2004-12-27 Kenichi Handa <handa@m17n.org> - - * coding.c (code_convert_region): Fix calculation of `ratio'. - -2004-12-25 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (update_frame_tool_bar): Make the value of - tool-bar-button-margin control margins of images in tool bar. - - * alloc.c (check_depth): New variable. - (overrun_check_malloc, overrun_check_realloc): Only add - overhead and write check pattern if check_depth is 1 (to handle - recursive calls). Increase/decrease check_depth in entry/exit. - (overrun_check_free): Only check for overhead if check_depth is 1. - Increase/decrease check_depth in entry/exit. - -2004-12-23 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * keyboard.c (input_available_signal): Call SIGNAL_THREAD_CHECK - before touching input_available_clear_time, to avoid accessing it - from multiple threads. - -2004-12-23 Jason Rumney <jasonr@gnu.org> - - * image.c (__WIN32__) [HAVE_NTGUI]: Define for correct behaviour - of JPEG library. - -2004-12-22 Richard M. Stallman <rms@gnu.org> - - * emacs.c (main): If batch mode, set Vundo_outer_limit to nil. - - * lisp.h (Vundo_outer_limit): Fix decl. - - * undo.c (Vundo_outer_limit): Replaces undo_outer_limit. - Uses changed. - (syms_of_undo): Initialize appropriately. - (truncate_undo_list): If it's nil, there's no limit. - -2004-12-22 Kenichi Handa <handa@m17n.org> - - * xselect.c (Fx_get_cut_buffer_internal): Return a unibyte string. - -2004-12-21 Richard M. Stallman <rms@gnu.org> - - * eval.c (unwind_to_catch): Clear immediate_quit. - - * xdisp.c (get_next_display_element): Display codes 8a0 and 8ad - specially as `\ ' and `\-'. - - * keyboard.c (kbd_buffer_store_event_hold): - In the code for while-no-input, handle immediate_quit. - - * alloc.c (Fgarbage_collect): Update call to truncate_undo_list. - Call that at the very start. - (undo_limit, undo_strong_limit, undo_outer_limit): Move to undo.c. - (syms_of_alloc): Don't define undo-limit, - undo-strong-limit and undo-outer-limit here. - - * undo.c (truncate_undo_list): Return void. - Take just one argument, the buffer. - Make it current, and inhibit recursive GC. - Access and update the undo list directly; return void. - Refer to the undo...limit variables directly. - Test undo_outer_limit only after counting the whole current command. - When it's exceeded, call the function in undo-outer-limit-function. - (undo_limit, undo_strong_limit, undo_outer_limit): From alloc.c. - (Vundo_outer_limit_function): New variable. - (syms_of_undo): Define undo-limit, undo-strong-limit - and undo-outer-limit here, and undo-outer-limit-function. - Doc fixes. - - * lisp.h (truncate_undo_list): Update decl. - -2004-12-21 Piet van Oostrum <piet@cs.uu.nl> - - * fileio.c (Fread_file_name): Delete duplicates in - file-name-history when history_delete_duplicates is true. - -2004-12-20 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macterm.c (mac_do_list_fonts): Fix memory leak. - -2004-12-20 Richard M. Stallman <rms@gnu.org> - - * regex.c (re_match_2_internal) <symend, wordend>: - Fix calls to UPDATE_SYNTAX_TABLE_FORWARD. - -2004-12-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macterm.c (endif, x_font_name_to_mac_font_name): - Use maccentraleurroman instead of maccentraleuropean - (mac_c_string_match, mac_do_list_fonts): Speed up font search by - quickly finding a specific font without needing regexps. - -2004-12-15 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * syssignal.h: Declare main_thread. - (SIGNAL_THREAD_CHECK): New macro. - - * keyboard.c (input_available_signal): Move thread checking code - to macro SIGNAL_THREAD_CHECK and call that macro. - (interrupt_signal): Call SIGNAL_THREAD_CHECK. - - * alloc.c (uninterrupt_malloc): Move main_thread to emacs.c. - - * emacs.c: Define main_thread. - (main): Initialize main_thread. - (handle_USR1_signal, handle_USR2_signal, fatal_error_signal) - (memory_warning_signal): Call SIGNAL_THREAD_CHECK. - - * floatfns.c (float_error): Call SIGNAL_THREAD_CHECK. - - * dispnew.c (window_change_signal): Call SIGNAL_THREAD_CHECK. - - * sysdep.c (select_alarm): Call SIGNAL_THREAD_CHECK. - - * process.c (send_process_trap, sigchld_handler): - Call SIGNAL_THREAD_CHECK. - - * data.c (arith_error): Call SIGNAL_THREAD_CHECK. - - * atimer.c (alarm_signal_handler): Call SIGNAL_THREAD_CHECK. - - * xterm.c (xg_scroll_callback): Update XG_LAST_SB_DATA before - returning when xg_ignore_gtk_scrollbar is true. - -2004-12-14 Kim F. Storm <storm@cua.dk> - - * keyboard.c (read_char): Save and restore echo_string when - handling input method. - -2004-12-13 Richard M. Stallman <rms@gnu.org> - - * eval.c (syms_of_eval) <quit-flag>: Doc fix. - - * keyboard.c (Vthrow_on_input): New variable. - (syms_of_keyboard): Defvar and initialize it. - (kbd_buffer_store_event_hold): Handle Vthrow_on_input. - - * lisp.h (QUIT): Check for Vthrow_on_input. - (Vthrow_on_input): Declare it. - -2004-12-13 Kim F. Storm <storm@cua.dk> - - * xdisp.c (set_iterator_to_next): Reset stop_charpos after display - vector. - -2004-12-12 Richard M. Stallman <rms@gnu.org> - - * indent.c (Fvertical_motion): Call move_it_by_lines even if LINES = 0. - - * minibuf.c (Fall_completions): Add var `zero' and use it in loop. - (Ftry_completion): Really use outer `zero'; eliminate inner one. - -2004-12-12 Kenichi Handa <handa@m17n.org> - - * term.c (encode_terminal_code): Fix previous change. - -2004-12-11 Stefan Monnier <monnier@iro.umontreal.ca> - - * keyboard.c (handle_async_input): Remove pthread mutex handling. - (input_available_signal): Move pthread thingy to !SYNC_INPUT branch. - - * syntax.c (Fforward_word): Avoid non-idempotent side-effects - in macro arguments. - - * minibuf.c (Ftry_completion, Fall_completions): Don't use - XFASTINT blindly. - - * emacs.c (main, Fdump_emacs): Don't touch malloc hooks if SYNC_INPUT. - -2004-12-11 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * w32term.c (x_calc_absolute_position): Remove calculation of - difference between inner and outer window. Don't subtract difference - for left and top calculations. - - * xterm.c (x_calc_absolute_position): Don't subtract outer_pixel_diff - for left and top calculations. Remove call to x_real_positions. - [Bug report by Drew Adams in November.] - (x_check_expected_move): Do not set change_gravity to 1 when calling - x_set_offset. - -2004-12-08 Richard M. Stallman <rms@gnu.org> - - * xdisp.c (get_next_display_element): Use `escape-glyph' for - control chars and escaped octal codes. - (Qescape_glyph): New variable. - (syms_of_xdisp): Initialize it. - (escape_glyph_face): New variable. - (redisplay_window): Initialize it. - -2004-12-07 Paul Eggert <eggert@cs.ucla.edu> - - * image.c (our_fill_input_buffer, jpeg_load, CHECK_LIB_AVAILABLE) - (init_image): Use 1 rather than TRUE. TRUE's not always defined. - -2004-12-07 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * emacs.c (Fdump_emacs): Add ! defined (SYSTEM_MALLOC) around - reset_malloc_hooks. - - * keyboard.c (handle_async_input, input_available_signal): - Add ! defined (SYSTEM_MALLOC) around thread code. - - * alloc.c: Add comment about the reason for (UN)BLOCK_INPUT_ALLOC. - -2004-12-07 Stefan Monnier <monnier@iro.umontreal.ca> - - * eval.c (init_eval_once): Increase max_specpdl_size to 1000. - - * config.in: Regenerate. - -2004-12-07 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xmenu.c (Fx_popup_menu): Correct documentation about position. - (xmenu_show): Do not call XTranslateCoordinates. Adjust position - if not given by a mouse click to correspond with x-popup-menu - documentation. - - * config.in: Regenerate. - - * gtkutil.c: Include signal.h and syssignal.h. - (xg_get_file_name): Block and unblock __SIGRTMIN if defined. - - * alloc.c: If HAVE_GTK_AND_PTHREAD, include pthread.h, - new variables main_thread and alloc_mutex, - define (UN)BLOCK_INPUT_ALLOC to use alloc_mutex to protect - emacs_blocked_* calls and only do (UN)BLOCK_INPUT in the main thread. - If not HAVE_GTK_AND_PTHREAD, (UN)BLOCK_INPUT_ALLOC is the same - as (UN)BLOCK_INPUT. - (emacs_blocked_free, emacs_blocked_malloc) - (emacs_blocked_realloc): Use (UN)BLOCK_INPUT_ALLOC. - (uninterrupt_malloc): Initialize main_thread and alloc_mutex. - (reset_malloc_hooks): New function. - - * lisp.h: Declare reset_malloc_hooks. - - * emacs.c (Fdump_emacs): Call reset_malloc_hooks. - - * keyboard.c: Conditionally include pthread.h. - (handle_async_input, input_available_signalt): If not in the main - thread, block signal, send signal to main thread and return. - - * gtkutil.c (xg_get_file_with_chooser): Handle local files only. - Set current folder in file chooser if default_filename is a directory. - -2004-12-05 Stefan Monnier <monnier@iro.umontreal.ca> - - * regex.c (GET_UNSIGNED_NUMBER): Signal an error when reaching the end. - Remove redundant correctness checks. - (regex_compile): Fix up error codes for \{..\} expressions. - -2004-12-05 Richard M. Stallman <rms@gnu.org> - - * regex.c (regex_compile): Fix end-of-pattern case for space. - -2004-12-03 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macterm.h (cfstring_create_with_utf8_cstring): Add prototype. - * mac.c (cfstring_create_with_utf8_cstring): Add to prevent - crashes with invalid characters. - * macmenu.c (add_menu_item): Use it. - * image.c (image_load_quartz2d): Likewise. - * macfns.c (x_set_name, x_set_title): Likewise. - (Fx_file_dialog): Likewise. Use constant CFRefs instead of - creating them each time for labels. - -2004-12-02 Richard M. Stallman <rms@gnu.org> - - * config.in (RE_TRANSLATE_P): If make_number is not a macro, - don't use it here. - - * eval.c (Fcalled_interactively_p): Don't check INTERACTIVE. - (interactive_p): Skip Scalled_interactively_p frames - like Sinteractive_p frames. - (unwind_to_catch): Clear handling_signal. - - * data.c (Fmake_variable_buffer_local): Doc fix. - (Fmake_local_variable): Doc fix. - - * insdel.c (insert_from_string_before_markers) - (insert_from_string): Don't modify buffer on empty insertion. - - * window.c (Fget_lru_window, Fget_largest_window): Doc fixes. - -2004-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macmenu.c (add_menu_item): Fallback on MacRoman if encoding - menu text as UTF8 fails. - -2004-12-01 Kim F. Storm <storm@cua.dk> - - * alloc.c: Add commentary for last change. - (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): New macros to handle - sizeof(size_t) != 4. - (overrun_check_malloc, overrun_check_realloc, overrun_check_free): - Use them. Also clear header and trailer of freed memory. - (GC_STRING_OVERRUN_COOKIE_SIZE): Rename from GC_STRING_EXTRA. - (string_overrun_cookie): Rename from string_overrun_pattern. - (GC_STRING_EXTRA): Define from GC_STRING_OVERRUN_COOKIE_SIZE. - -2004-12-01 Andreas Schwab <schwab@suse.de> - - * lisp.h: Declare string_to_multibyte. - -2004-12-01 Kenichi Handa <handa@m17n.org> - - * w32console.c (w32con_write_glyphs): Decide coding here. - Adjusted for the change of encode_terminal_code. - - * term.c (encode_terminal_code): Don't make it "static". - -2004-11-30 Kenichi Handa <handa@m17n.org> - - * term.c (encode_terminal_buf, encode_terminal_bufsize): New variables. - (encode_terminal_code): Argument changed. Encode all - characters at once, and return a pointer to the result of encoding. - (write_glyphs): Decide coding here. Adjusted for the above change. - (insert_glyphs): Likewise. - (term_init): Initialize encode_terminal_bufsize to 0. - - * coding.c (Vcode_conversion_workbuf_name): New variable. - (syms_of_coding): Initialize and staticpro it. - (set_conversion_work_buffer): New function. - (run_pre_post_conversion_on_str): Use it. - (run_pre_write_conversin_on_c_str): New function. - - * coding.h (run_pre_write_conversin_on_c_str): Extern it. - -2004-11-30 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * keyboard.c: Don't undef SIGIO - * s/darwin.h (NO_SOCK_SIGIO): Define NO_SOCK_SIGIO on carbon - * Makefile.in (mac.o): Depend on blockinput.h and atimer.h. - (macfns.o): Don't depend on ccl.h. - * macfns.c (mac_frame_parm_handlers): Set handlers for - Qleft_fringe and Qright_fringe. - * macterm.c (mac_fill_rectangle_to_pixmap) - (mac_draw_rectangle_to_pixmap, mac_copy_area_to_pixmap) - (mac_copy_area_with_mask_to_pixmap, x_draw_image_foreground_1): - Put in #if 0. - (mac_scroll_area) [TARGET_API_MAC_CARBON]: Use ScrollWindowRect. - (x_flush) [TARGET_API_MAC_CARBON]: Don't traverse frames. - (XFlush) [TARGET_API_MAC_CARBON]: Define to an empty replacement. - (x_draw_glyph_string_background, x_draw_glyph_string_foreground) - [!MAC_OS8]: Added ifdef'd out code for os8. Don't use - XDrawImageString. Always draw background and foreground separately. - (x_draw_image_foreground): Use clipping instead of computing the - intersection rectangle. - (x_draw_image_glyph_string): Don't draw an image with mask to a - pixmap. - (x_redisplay_interface): Set flush_display_optional member to 0. - (XTread_socket): Correctly reset the TEConverter - object. - -2004-11-30 Kim F. Storm <storm@cua.dk> - - * lisp.h: New defines to enable buffer overrun checking. - (GC_CHECK_STRING_OVERRUN, GC_CHECK_STRING_FREE_LIST) - (XMALLOC_OVERRUN_CHECK, GC_CHECK_CONS_LIST): Add. - - * alloc.c: Add more checks for buffer overruns. - (XMALLOC_OVERRUN_CHECK_SIZE, xmalloc_overrun_check_header) - xmalloc_overrun_check_trailer, overrun_check_malloc) - overrun_check_realloc, overrun_check_free): Add. - (GC_STRING_EXTRA, string_overrun_pattern): Add. - (check_sblock, allocate_string_data, compact_small_strings): - Set and check string_overrun_pattern if GC_CHECK_STRING_OVERRUN. - (check_cons_list): Condition on GC_CHECK_CONS_LIST. - (check_string_free_list): Add. - (allocate_string, sweep_strings): Call check_string_free_list. - - * emacs.c (malloc_initialize_hook): Don't free malloc_state_ptr if - XMALLOC_OVERRUN_CHECK to avoid crash during load. - -2004-11-29 Kim F. Storm <storm@cua.dk> - - * fns.c (concat): Use SAFE_ALLOCA. - -2004-11-29 Stefan Monnier <monnier@iro.umontreal.ca> - - * sysdep.c (emacs_write): Don't use QUIT. - -2004-11-29 Kenichi Handa <handa@m17n.org> - - * buffer.c (init_buffer): Set current_buffer->directory to a - multibyte string made by string_to_multibyte. - - * emacs.c (init_cmdargs): Set unibyte strings in Vcommand_line_args. - -2004-11-27 Andreas Schwab <schwab@suse.de> - - * alloc.c (mark_stack): Call GC_MARK_SECONDARY_STACK if defined. - - * s/gnu-linux.h: Enable no-op gcpros on ia64. - (GC_MARK_SECONDARY_STACK) [__ia64__]: Define. - - * filelock.c (lock_file_1): Call get_boot_time early. - Increase buffer size. - -2004-11-27 Eli Zaretskii <eliz@gnu.org> - - * lisp.h (DECL_ALIGN): Define non-trivially only if NO_DECL_ALIGN - is not defined. - -2004-11-27 Kim F. Storm <storm@cua.dk> - - * search.c (syms_of_search) <search-spaces-regexp>: Move 'doc:' - marker out of doc string. - -2004-11-26 Stefan Monnier <monnier@iro.umontreal.ca> - - * s/darwin.h (POSIX_SIGNALS): Undo the removal of 2002-08-25, - which was not mentioned in the log. - -2004-11-26 Kim F. Storm <storm@cua.dk> - - * fringe.c (update_window_fringes): Prefer truncation bitmaps over - angle bitmaps at top/bottom line. - - * xdisp.c: Undo recent changes for restoring saved_face_id. Instead, - set it when it->method is set to next_element_from_display_vector. - (setup_for_ellipsis): Add LEN argument. Callers changed. - Set it->saved_face_id. - (get_next_display_element): Use loop instead of recursion. - Set it->saved_face_id. Combine duplicate code for ctr chars. - (next_element_from_display_vector): Do not set it->saved_face_id. - (next_element_from_ellipsis): Use setup_for_ellipsis. - -2004-11-26 Eli Zaretskii <eliz@gnu.org> - - * eval.c (Fdefvar): Declare pdl from last change as `volatile' to - prevent compiler warnings. - -2004-11-25 Stefan Monnier <monnier@iro.umontreal.ca> - - * keyboard.c (command_loop_1): Print a message describing the key - the user just pressed when this key has no binding. - - * sysdep.c (sys_signal): Don't use SA_RESTART if SYNC_INPUT is set. - (emacs_open, emacs_read, emacs_write): Check QUIT when interrupted. - - * lread.c (readchar): Check QUIT when `getc' is interrupted. - -2004-11-24 Richard M. Stallman <rms@gnu.org> - - * coding.c (run_pre_post_conversion_on_str): Bind Qinhibit_read_only. - - * buffer.c (syms_of_buffer) <indicate-buffer-boundaries>: Doc fix. - -2004-11-24 Kim F. Storm <storm@cua.dk> - - * xdisp.c (move_it_in_display_line_to, display_line): - Restore saved_face_id also when truncate-lines or hscrolled. - -2004-11-23 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (xg_get_file_name): Rename use-old-gtk-file-dialog to - x-use-old-gtk-file-dialog. - - * xfns.c: Define x_use_old_gtk_file_dialog. - (syms_of_xfns): Rename use-old-gtk-file-dialog to x-... Move it - outside ifdef USE_GTK. - -2004-11-23 Stefan Monnier <monnier@iro.umontreal.ca> - - * coding.h (ENCODE_FILE, DECODE_FILE, ENCODE_SYSTEM, DECODE_SYSTEM): - Don't use XFASTINT blindly. - - * config.in (RE_TRANSLATE_P): Don't use XFASTINT blindly. - - * indent.c (skip_invisible): Avoid non-idempotent side-effects - in macro arguments. - - * keymap.c (Flookup_key): Check INTEGERP before XINT. - - * lread.c (oblookup): Don't use XFASTINT blindly. - - * window.c (Fset_window_scroll_bars): Don't use XINT if it isn't int. - (decode_next_window_args, window_loop): Don't use XFASTINT blindly. - -2004-11-23 Kim F. Storm <storm@cua.dk> - - * dispextern.h (MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P) - (MATRIX_ROW_STARTS_IN_MIDDLE_OF_CHAR_P): Not if dpvec_index is zero. - - * xfaces.c (lookup_named_face): Add signal_p arg. Return -1 if - signal_p is zero and face name is unknown. - (Fx_list_fonts): Don't signal error in lookup_named_face. - (Fface_font): Signal error in lookup_named_face. - (ascii_face_of_lisp_face): Likewise. - - * dispextern.h (lookup_named_face): Fix prototype. - - * xdisp.c (handle_single_display_prop): Don't signal error in - lookup_named_face for unknown fringe face name. - (highlight_trailing_whitespace): Don't signal error in - lookup_named_face if trailing-whitespace face unknown. - (calc_line_height_property): Don't signal error in - lookup_named_face if specified face name is unknown. - - * fringe.c (update_window_fringes): Show top row indicator if - window has header-line. Don't show arrow at bob and eob - if the boundary indicators are not used. - (Fset_fringe_bitmap_face): Signal error in lookup_named_face. - - * window.c (set_window_buffer): Clear display_error_modiff. - -2004-11-22 Kim F. Storm <storm@cua.dk> - - * fringe.c (update_window_fringes): Provide sensible fall-back - value for non-nil indicate-buffer-boundaries setting. - -2004-11-22 Markus Rost <rost@ias.edu> - - * minibuf.c (Fminibuffer_complete_and_exit): Fix previous change. - -2004-11-22 Stefan Monnier <monnier@iro.umontreal.ca> - - * eval.c (Fdefvar): Warn when var is let-bound but globally void. - -2004-11-21 Kim F. Storm <storm@cua.dk> - - * xdisp.c (erase_phys_cursor): Clear hollow cursor inside TEXT_AREA. - - * xterm.c (x_clip_to_row): Add area arg. Callers changed. - (x_draw_hollow_cursor, x_draw_bar_cursor): Clip to TEXT_AREA. - - * w32term.c (w32_clip_to_row): Add area arg. Callers changed. - (x_draw_hollow_cursor, x_draw_bar_cursor): Clip to TEXT_AREA. - - * macterm.c (x_clip_to_row): Add area arg. Callers changed. - (x_draw_hollow_cursor, x_draw_bar_cursor): Clip to TEXT_AREA. - - * xdisp.c (move_it_in_display_line_to, display_line): - Restore saved_face_id if overflow-newline-into-fringe is enabled and - line is continued before or in middle of element from display vector. - - * indent.c (Fvertical_motion): Fix last change. Use another - method to detect if iterator moved too far ahead after reseat. - - * xdisp.c (IT_EXPAND_MATRIX_WIDTH): New macro. Do not - expand matrix width for overflow in zero-width area. - (append_glyph, append_composite_glyph, produce_image_glyph) - (append_stretch_glyph): Use it to avoid loop in redisplay. - (note_mode_line_or_margin_highlight): Don't let help-echo from - string override help-echo from image map. - -2004-11-20 Luc Teirlinck <teirllm@auburn.edu> - - * fns.c (Fyes_or_no_p): Call Fread_from_minibuffer with extra argument. - * callint.c (Fcall_interactively): Ditto. - -2004-11-20 Stefan Monnier <monnier@iro.umontreal.ca> - - * minibuf.c (Fminibuffer_complete_and_exit): - Fixup the case of the completed value, for case-indep completion. - -2004-11-20 Richard M. Stallman <rms@gnu.org> - - * lisp.h (Fread_from_minibuffer): Add arg in decl. - - * minibuf.c (read_minibuf): New arg KEEP_ALL. Callers changed. - (Fread_from_minibuffer): New arg KEEP_ALL. Callers changed. - - * search.c (Vsearch_spaces_regexp): - Rename from Vsearch_whitespace_regexp. All uses changed. - -2004-11-20 Thien-Thi Nguyen <ttn@gnu.org> - - * eval.c (init_eval_once): Increase `max_specpdl_size' to 650. - -2004-11-19 Richard M. Stallman <rms@gnu.org> - - * search.c (Vsearch_whitespace_regexp): New variable. - (syms_of_search): Defvar it. - (compile_pattern_1): Call re_set_whitespace_regexp with it. - (search_buffer): No regexp is trivial if Vsearch_whitespace_regexp - is non-nil. - (struct regexp_cache): New element whitespace_regexp. - (syms_of_search): Initialize whitespace_regexp elements. - (compile_pattern): Compare whitespace_regexp elements. - (compile_pattern_1): Set whitespace_regexp elements. - - * regex.c (regex_compile): Substitute whitespace_regexp - for spaces, if it is nonzero. - (whitespace_regexp): New variable. - (re_set_whitespace_regexp): New function. - -2004-11-19 Kim F. Storm <storm@cua.dk> - - * indent.c (Fvertical_motion): Fix last change. - -2004-11-18 Kim F. Storm <storm@cua.dk> - - * indent.c (Fvertical_motion): Undo 2004-11-16 change. - Instead, move back again if reseating moves too far ahead. - -2004-11-17 Luc Teirlinck <teirllm@auburn.edu> - - * xdisp.c (message3): Call clear_message. - -2004-11-17 Kim F. Storm <storm@cua.dk> - - * xdisp.c (erase_phys_cursor): Adjust cursor row visible height. - -2004-11-16 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (xg_get_file_name): Typo in HAVE_GTK_FILE_SELECTION_NEW. - - * xmenu.c (x_menu_in_use): Remove. - (x_menu_set_in_use): Also set popup_activated_flag. - - * xfns.c (Fx_file_dialog): Call popup_activated instead of - x_menu_in_use. Call x_menu_set_in_use in Motif version also. - - * xterm.h (x_menu_in_use): Remove. - -2004-11-16 Richard M. Stallman <rms@gnu.org> - - * keymap.c (Fmap_keymap): New arg SORT-FIRST. - Use map-keymap-internal to implement that. - - * indent.c (Fvertical_motion): In batch mode, use vmotion directly. - -2004-11-16 Stefan Monnier <monnier@iro.umontreal.ca> - - * xdisp.c (get_glyph_string_clip_rect, init_glyph_string): Check it's - a window before using XWINDOW. - - * window.c (make_window, Fselect_window, make_dummy_parent) - (save_window_save): - * frame.c (make_frame): - * fns.c (concat): Avoid side-effects inside XSETFASTINT's arguments. - - * lisp.h (NILP): Use EQ rather than XFASTINT. - -2004-11-16 Kim F. Storm <storm@cua.dk> - - * fringe.c (Fdefine_fringe_bitmap): Always set 'h'. Simplify. - - * indent.c (Fvertical_motion): Fix last change. Only reseat when - moving backwards. - -2004-11-16 Luc Teirlinck <teirllm@auburn.edu> - - * dispextern.h: Extern reseat_at_previous_visible_line_start. - -2004-11-16 Kenichi Handa <handa@m17n.org> - - * xdisp.c (display_mode_element): Fix previous change (calculate - end position of substring to display correctly). - -2004-11-16 Kim F. Storm <storm@cua.dk> - - * keyboard.c (Fposn_at_point): Remove extra */ after doc string. - Reported by Andrew M. Scott. - -2004-11-15 Kim F. Storm <storm@cua.dk> - - * fns.c (Fsafe_plist_get): New defun. - (syms_of_fns): Defsubr it. - - * lisp.h (Fsafe_plist_get): Add EXFUN. - - * xdisp.c (store_mode_line_string, produce_stretch_glyph): - Use Fsafe_plist_get. - (note_mode_line_or_margin_highlight, note_mouse_highlight): - Fix image map element parsing. Use Fsafe_plist_get. - -2004-11-15 Richard M. Stallman <rms@gnu.org> - - * xdisp.c (get_next_display_element): Fix previous change. - -2004-11-14 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * window.c (shrink_windows): Handle special case of one window left - when trying to shrink the final reminder. Grow windows if - total_removed is less than total_shrink. - - * xmenu.c (pop_down_menu): Remove global variable current_menu, - extract pointer from arg with XSAVE_VALUE. - (create_and_show_popup_menu, create_and_show_dialog, xmenu_show): - Construct arg to record_unwind_protect with make_save_value. - -2004-11-13 Richard M. Stallman <rms@gnu.org> - - * xdisp.c (reseat_at_previous_visible_line_start): No longer static. - (get_next_display_element): Fix previous change to apply only to \n. - - * indent.c (Fvertical_motion): Scan to PT from start of line to - make iterator consistent. - - * minibuf.c (syms_of_minibuf) <completion-ignore-case>: Doc fix. - -2004-11-14 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (pop_down_file_dialog): Add BLOCK_INPUT. - - * xfns.c (Fx_file_dialog): Call x_menu_in_use and x_menu_set_in_use. - Record unwind with clean_up_file_dialog. - - * xterm.h (x_menu_in_use, x_menu_set_in_use, x_menu_wait_for_event): - Declare. - - * xmenu.c (x_menu_in_use, x_menu_set_in_use): New functions. - -2004-11-13 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (xg_file_sel_ok, xg_file_sel_cancel) - (xg_file_sel_destroy): Remove. - (xg_file_response_cb, pop_down_file_dialog) - (xg_get_file_name_from_chooser, xg_get_file_name_from_selector): - New functions. - (xg_get_file_with_chooser, xg_get_file_with_selection): - Take new arg func, set it to xg_get_file_name_from_chooser/selector. - Move common code to xg_get_file_name. Return widget created. - (xg_get_file_name): Set name, transient for, modal and destroy - with parent here. Connect response signal to xg_file_response_cb, - connect delete-event to gtk_true. Record pop_down_file_dialog - for unwind. Do event loop and call x_menu_wait_for_event in loop. - (xg_create_widget): Make dialogs modal. - - * xmenu.c (unuse_menu_items, pop_down_menu): Arg is of type - Lisp_Object. - (popup_get_selection): Move unwind protect ... - (create_and_show_popup_menu, create_and_show_dialog): ... to here. - Move destroy of widget to pop_down_menu. - (popup_widget_loop): Move unwind protect ... - (create_and_show_popup_menu, create_and_show_dialog): ... to here. - Move destroy of widget to pop_down_menu. - (pop_down_menu): BLOCK_INPUT and destroy widget/window. - (xmenu_show): Record unwind pop_down_menu. Move XMenuDestroy, - x_mouse_leave and grabbed = 0 to pop_down_menu. - -2004-11-13 Kim F. Storm <storm@cua.dk> - - * xdisp.c (make_cursor_line_fully_visible_p): New variable. - (syms_of_xdisp): DEFVAR_BOOL it. - (make_cursor_line_fully_visible, try_cursor_movement) - (try_window_id): Use it. - -2004-11-12 Kim F. Storm <storm@cua.dk> - - * dispextern.h (struct glyph_row): New member extra_line_spacing. - (struct it): New member max_extra_line_spacing. - (MR_PARTIALLY_VISIBLE, MR_PARTIALLY_VISIBLE_AT_TOP) - (MR_PARTIALLY_VISIBLE_AT_BOTTOM): New helper macros. - (MATRIX_ROW_PARTIALLY_VISIBLE_P): Fix to return false if invisible - part of last line is only extra line spacing (so the text on the - line is fully visible). Use helper macros. - Add W arg (to use them). All callers changed. - (MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P) - (MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P): Use helper macros. - - * window.c (window_scroll_pixel_based, Frecenter): - Use move_it_vertically_backward directly. - (Frecenter): Fix calculation of new start pos for negative arg. - Before, the new start pos was sometimes chosen too far back, so - the last line became only partially visible, and thus would be - either only semi-visible or automatically scrolled to the middle - of the window by redisplay. - - * xdisp.c (init_iterator): Clear it.max_extra_line_spacing. - (move_it_vertically_backward): Don't recure to move further back. - (move_it_vertically): Remove superfluous condition. - (move_it_by_lines): Clear last_height when moved 0 lines. - (resize_mini_window): Use it.max_extra_line_spacing. - (display_tool_bar_line): Clear row->extra_line_spacing. - (try_scrolling): Use move_it_vertically_backward directly. - (redisplay_window): Likewise. - (compute_line_metrics): Set row->extra_line_spacing. - (display_line, display_string): Likewise. - (x_produce_glyphs): Update it->max_extra_line_spacing. - - * xmenu.c (pop_down_menu): Return nil. - -2004-11-12 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xmenu.c (x_menu_wait_for_event): New function. - (popup_get_selection, popup_widget_loop): Call x_menu_wait_for_event - to handle timers. - (popup_widget_loop): Add argument do_timers. - (create_and_show_popup_menu, create_and_show_dialog): Pass 1 for - do_timers to popup_widget_loop. - (xmenu_show): Call XMenuActivateSetWaitFunction so that - x_menu_wait_for_event is called by XMenuActivate. - (create_and_show_popup_menu): Pass 1 for do_timers to - popup_get_selection. - (pop_down_menu): New function. - (popup_get_selection, popup_widget_loop): Unwind protect to - pop_down_menu. - (popup_widget_loop): Add argument widget. - (create_and_show_popup_menu, create_and_show_dialog): Pass new - argument widget to popup_widget_loop. - -2004-11-10 Stefan Monnier <monnier@iro.umontreal.ca> - - * keymap.c (Fkeymap_prompt): Accept symbol keymaps. - -2004-11-09 Kim F. Storm <storm@cua.dk> - - * xselect.c: Include <sys/types.h> and <unistd.h> (for getpid). - Fix various comments referring to XEvents instead of input events. - (x_queue_event): Fix format strings. - (x_stop_queuing_selection_requests): Likewise. - - * xdisp.c (produce_image_glyph): Remove unused variable 'face_ascent'. - (pint2hrstr): Add extra braces to silence compiler. - - * print.c (print_object): Fix format string. - - * lread.c (read1): Fix next_char matching. - - * lisp.h (Fdelete): Add EXFUN. - (replace_range_2): Add prototype. - - * keyboard.c (read_avail_input): Remove unused variable 'discard'. - - * intervals.h (NULL_INTERVAL_P): Add separate version when - ENABLE_CHECKING is not defined to silence compiler. - (compare_string_intervals): Add prototype. - - * fringe.c (destroy_fringe_bitmap): Fix return type. - (Ffringe_bitmaps_at_pos): Remove unused var 'old_buffer'. - - * emacs.c (Fdump_emacs): Fix format string. - - * doc.c: Include <ctype.h>. - (Fsubstitute_command_keys): Remove unused variable 'firstkey'. - - * data.c (store_symval_forwarding): Remove unused variables. - - * callint.c (Fcall_interactively): Remove unused variable 'funcar'. - -2004-11-09 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * Makefile.in (stamp-oldxmenu): If HAVE_GTK, don't add dependencies - to ${OLDXMENU}. - -2004-11-09 Kim F. Storm <storm@cua.dk> - - * process.c (Fmake_network_process): Remove kludge for interrupted - connects on BSD. If connect is interrupted, just close socket and - start over rather than sleeping and retry with same socket. - -2004-11-09 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * .cvsignore: Add buildobj.lst. - - * doc.c: New variable Vbuild_files. - (Fsnarf_documentation): If Vbuild_files is nil, populate it with - file names from buildobj.lst. Only attach docstrings from files - that are in Vbuild_files. - (syms_of_doc): Defvar Vbuild_files. - - * Makefile.in (SOME_MACHINE_OBJECTS): Add fringe.o, image.o - and w32*.o. - (temacs${EXEEXT}): Generate buildobj.lst when temacs is linked. - (mostlyclean): Rm buildobj.lst. - - * makefile.w32-in ($(TEMACS)): Generate buildobj.lst when temacs - is linked. - -2004-11-09 Kim F. Storm <storm@cua.dk> - - * fringe.c (update_window_fringes): Update fringe bitmaps if - cur and row ends_at_zv_p differs. If bitmaps of a row is updated, - also update previous row to get rid of misc. artifacts. - -2004-11-08 Kim F. Storm <storm@cua.dk> - - * xdisp.c (fast_find_position): Fix start pos if header line present. - (note_mouse_highlight): Clear mouse face if we move out of text area. - -2004-11-08 Eli Zaretskii <eliz@gnu.org> - - * editfns.c: Move #include "systime.h" before <sys/resource.h>. - Don't include <sys/time.h> explicitly. - Include <stdio.h> unconditionally, not just on MacOS. - -2004-11-08 Kenichi Handa <handa@m17n.org> - - * fontset.c (fontset_pattern_regexp): Cancel my previous change; - don't pay attention to '\' before '*'. - (fontset_pattern_regexp): Change the meaning of the second arg. - (Fnew_fontset): Call fs_query_fontset, not Fquery_fontset. - (check_fontset_name): Try NAME as literal at first, and if it - failes, try NAME as pattern. - -2004-11-07 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * emacs.c (Fdump_emacs): Only output warning on GNU/Linux. - -2004-11-07 Andreas Schwab <schwab@suse.de> - - * lisp.h (Fmsdos_downcase_filename): Declare. - * dired.c (Fmsdos_downcase_filename): Don't declare here. - * fileio.c: Likewise. - -2004-11-07 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * dosfns.c (Fdos_memget, Fdos_memput): Use integer variable offs in - comparisons with integers instead of Lisp_Object address. - (Fmsdos_set_keyboard): Declare argument allkeys. - - * msdos.c (IT_set_frame_parameters): Use EQ, not ==, for Lisp_Object:s. - - * dired.c (Fmsdos_downcase_filename): Declare extern on MSDOS to avoid - int/Lisp_Object mixup. - - * fileio.c: Ditto. - -2004-11-06 Steven Tamm <steventamm@mac.com> - - * editfns.c: Need to include sys/time.h before resource.h on darwin. - -2004-11-06 Richard M. Stallman <rms@gnu.org> - - * callint.c (Fcall_interactively): Avoid reusing EVENT for other data. - - * xfaces.c (merge_named_face): GCPRO the face_name in the - named_merge_point struct that we make. - (merge_face_heights): Eliminate GCPRO arg. All callers changed. - - * keyboard.c (command_loop_1): Change Vtransient_mark_mode - before deciding whether to inactivate mark. - -2004-11-06 Lars Brinkhoff <lars@nocrew.org> - - * config.in: Regenerate (add HAVE_GETRUSAGE). - * editfns.c (Fget_internal_run_time): New function. - (syms_of_data): Defsubr it. - * fns.c (sxhash): As far as possible, merge calculation of - hash code for symbols and strings. - -2004-11-06 Eli Zaretskii <eliz@gnu.org> - - * frame.c (syms_of_frame): Fix the example in the doc string. - -2004-11-06 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * eval.c (Feval): Remove check for INPUT_BLOCKED_P. - - * xmenu.c (popup_get_selection, create_and_show_popup_menu) - (create_and_show_dialog): Revert change from 2004-10-31. - -2004-11-05 Luc Teirlinck <teirllm@auburn.edu> - - * macros.c (syms_of_macros) <defining-kbd-macro>: Doc fix. - -2004-11-05 Kim F. Storm <storm@cua.dk> - - * print.c (print_object): Print Lisp_Misc_Save_Value objects. - - * fileio.c (Ffile_modes): Doc fix. - (auto_save_1): Check for Ffile_modes nil value. - -2004-11-05 Kim F. Storm <storm@cua.dk> - - * xselect.c (struct selection_event_queue, selection_queue) - (x_queue_selection_requests, x_queue_event) - (x_start_queuing_selection_requests) - (x_stop_queuing_selection_requests): Add new queue for selection - input events to replace previous XEvent queue in xterm.c. - (queue_selection_requests_unwind): Adapt to new queue. - (x_reply_selection_request): Adapt to new queue. - Unexpect wait_object in case of x errors (memory leak). - (x_handle_selection_request, x_handle_selection_clear): Make static. - (x_handle_selection_event): New function. May queue selection events. - (wait_for_property_change_unwind): Use save_value instead of cons. - Clear property_change_reply_object. - (wait_for_property_change): Abort if already waiting. - Use save_value instead of cons for unwind data. - (x_handle_property_notify): Skip events already arrived, but don't - free them, as "arrived" field is checked by wait_for_property_change, - and it will be freed by unwind or explicit unexpect_property_change. - (x_get_foreign_selection): Add to new queue. - (receive_incremental_selection): Don't unexpect wait_object when done - as it has already been freed by previous wait_for_property_change. - - * xterm.h (x_start_queuing_selection_requests) - (x_stop_queuing_selection_requests, x_handle_selection_request) - (x_handle_selection_clear): Remove prototypes. - (x_handle_selection_event): Add prototype. - - * xterm.c (handle_one_xevent): Don't queue X selection events - here, it may be too late if we start queuing after we have already - stored some selection events into the kbd buffer. - (struct selection_event_queue, queue, x_queue_selection_requests) - (x_queue_event, x_unqueue_events, x_start_queuing_selection_requests) - (x_stop_queuing_selection_requests): Remove/move to xselect.c. - (x_catch_errors_unwind): Block input around final XSync. - - * keyboard.h (kbd_buffer_unget_event): Add prototype. - - * keyboard.c (kbd_buffer_store_event_hold): Remove obsolete code. - (kbd_buffer_unget_event): New function. - (kbd_buffer_get_event, swallow_events): Combine SELECTION events - and use x_handle_selection_event. - (mark_kboards): Don't mark x and y of SELECTION_CLEAR_EVENT. - -2004-11-05 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xselect.c (TRACE3): New debug macro. - (x_reply_selection_request): Use it. - (receive_incremental_selection): In call to TRACE0, the name of - a symbol is in xname. - -2004-11-05 Kim F. Storm <storm@cua.dk> - - * fontset.c (fontset_pattern_regexp): Use unsigned char. - -2004-11-04 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * fileio.c (Fnext_read_file_uses_dialog_p): New function. - - * gtkutil.h (use_old_gtk_file_dialog): Declare. - - * gtkutil.c: Make use_old_gtk_file_dialog non-static. - (xg_initialize): Move DEFVAR_BOOL for use_old_gtk_file_dialog ... - * xfns.c (syms_of_xfns): ... to here. - - * gtkutil.c (xg_get_file_with_chooser): Expand DEFAULT_FILENAME if - it doesn't start with /. - -2004-11-04 Kenichi Handa <handa@m17n.org> - - * fontset.c (fontset_pattern_regexp): If '*' is preceded by '\', - treat it as a literal character. - -2004-11-03 Kim F. Storm <storm@cua.dk> - - * .gdbinit (ppt): New function. - -2004-11-02 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.c (x_window_to_scroll_bar): Only call - xg_get_scroll_id_for_window if toolkit scroll bars are used. - - * gtkutil.c (xg_get_file_with_chooser): Use GTK_STOCK_OK instead - of save. - -2004-11-02 Andreas Schwab <schwab@suse.de> - - * window.c (Fscroll_right): Fix last change. - -2004-11-02 Kim F. Storm <storm@cua.dk> - - * Makefile.in (callproc.o): Depend on blockinput.h, atimer.h, systime.h. - -2004-11-02 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * callproc.c (Fcall_process): Block input around vfork. - -2004-11-02 Kim F. Storm <storm@cua.dk> - - * eval.c (Fcalled_interactively_p): Rename from Fcall_interactive_p. - (syms_of_eval): Defsubr it. - -2004-11-02 Richard M. Stallman <rms@gnu.org> - - * insdel.c (replace_range_2): New function. - - * casefiddle.c (casify_region): Handle changes in byte-length - using replace_range_2. - - * emacs.c (USAGE3): Delete --horizontal-scroll-bars, -hb. - - * xdisp.c (back_to_previous_visible_line_start): - Subtract 1 from pos when checking previous newline for invisibility. - - * window.c (window_scroll_pixel_based): Update preserve_y - for header line if any. - (Fscroll_left, Fscroll_right): Don't call interactive_p; - use a new second argument instead. - - * eval.c (Fcall_interactive_p): New function. - (interactive_p): Don't test INTERACTIVE here. - (Finteractive_p): Doc fix. - - * eval.c (Feval): Abort if INPUT_BLOCKED_P. - -2004-11-02 KOBAYASHI Yasuhiro <kobayays@otsukakj.co.jp> - - * w32fns.c (w32_font_match): Use fast_string_match_ignore_case for - comparing font names. - -2004-11-02 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * fileio.c (Fread_file_name): Pass Qt as fifth parameter to - Fx_file_dialog if only directories should be read. - - * lisp.h: Fx_file_dialog takes 5 parameters. - - * xfns.c (Fx_file_dialog): Both Motif and GTK version: - Add parameter only_dir_p. - In Motif version, don't put DEFAULT_FILENAME in filter part of the - dialog, just text field part. Do not add DEFAULT_FILENAME - to list of files if it isn't there. - In GTK version, pass only_dir_p parameter to xg_get_file_name. - - * macfns.c (Fx_file_dialog): Add parameter only_dir_p. - Check only_dir_p instead of comparing prompt to "Dired". When using - a save dialog, add option kNavDontConfirmReplacement, change title - to "Enter name", change text for save button to "Ok". - - * w32fns.c (Fx_file_dialog): Add parameter only_dir_p. - Check only_dir_p instead of comparing prompt to "Dired". - - * gtkutil.c (xg_get_file_with_chooser, xg_get_file_with_selection): - New functions, only defined ifdef HAVE_GTK_FILE_CHOOSER_DIALOG_NEW - and HAVE_GTK_FILE_SELECTION_NEW respectively. - (xg_get_file_name): Add parameter only_dir_p. - Call xg_get_file_with_chooser or xg_get_file_with_selection - depending on HAVE_GTK_FILE* and the value of use_old_gtk_file_dialog. - (xg_initialize): New DEFVAR_BOOL use_old_gtk_file_dialog. - - * gtkutil.h (xg_get_file_name): Add parameter only_dir_p. - - * config.in: Rebuild (added HAVE_GTK_FILE_*). - -2004-11-01 Kim F. Storm <storm@cua.dk> - - * process.c (connect_wait_mask, num_pending_connects): - Only declare and use them if NON_BLOCKING_CONNECT is defined. - (init_process): Initialize them if NON_BLOCKING_CONNECT defined. - (IF_NON_BLOCKING_CONNECT): New helper macro. - (wait_reading_process_output): Only declare and use local vars - Connecting and check_connect when NON_BLOCKING_CONNECT is defined. - -2004-11-01 Andy Petrusenco <Igrek@star-sw.com> (tiny change) - - * w32term.c (x_scroll_run): Delete region objects after use. - -2004-10-31 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xmenu.c: Add prototypes for forward function declarations. - (popup_get_selection): Remove parameter do_timers, remove call to - timer_check. - (create_and_show_popup_menu, create_and_show_dialog): - Remove parameter do_timers from call to popup_get_selection. - - * xdisp.c (update_tool_bar): Pass a copy of f->tool_bar_items to - tool_bar_items and assign the result to f->tool_bar_items if - not equal. Move BLOCK/UNBLOCK_INPUT from around call to - tool_bar_items to assignment of result. - - * atimer.c (alarm_signal_handler): Do not call set_alarm if - pending_atimers is non-zero. - -2004-10-31 Kim F. Storm <storm@cua.dk> - - * dispnew.c (margin_glyphs_to_reserve): Don't use ncols_scale_factor. - -2004-10-28 Will <will@glozer.net> - - * macterm.c: Allow user to assign key modifiers to the Mac Option - key via a 'mac-option-modifier' variable. - -2004-10-28 Stefan Monnier <monnier@iro.umontreal.ca> - - * xselect.c (Vx_lost_selection_functions, Vx_sent_selection_functions): - Rename from Vx_lost_selection_hooks and Vx_sent_selection_hooks. - (x_handle_selection_request, x_handle_selection_clear) - (x_clear_frame_selections, syms_of_xselect): Adjust accordingly. - -2004-10-28 Richard M. Stallman <rms@gnu.org> - - * w32fns.c (Fx_server_vendor, Fx_server_version): Doc fixes. - - * xfns.c (Fx_server_vendor, Fx_server_version): Doc fixes. - -2004-10-27 Stefan Monnier <monnier@iro.umontreal.ca> - - * syntax.c (scan_sexps_forward): Give precedence to a 2-char - comment-starter over a 1-char one. - -2004-10-27 Richard M. Stallman <rms@gnu.org> - - * xdisp.c (get_next_display_element): In mode lines, - treat newline and tab like other control characters. - - * editfns.c (Fmessage): Doc fix. - - * indent.c (vmotion): When moving up, check the newline before. - Make prevline an int, not a Lisp_Object. - -2004-10-27 Kim F. Storm <storm@cua.dk> - - * editfns.c (Fformat): Allocate discarded table with SAFE_ALLOCA. - Only allocate info and discarded tables once. - - * lisp.h (USE_SAFE_ALLOCA): Add and init sa_must_free integer. - (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Increment it when malloc is used. - (SAFE_FREE): Test it to determine if we need to unwind to free. - Remove size arg. All users changed. - (SAFE_FREE_LISP): Remove. All users changed to use SAFE_FREE. - -2004-10-26 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c: Put empty line between comment and function body. - (xg_destroy_widgets): Rename from remove_from_container. - Just destroy all widgets in list. Argument wcont removed. - (xg_update_menubar, xg_update_submenu): Call xg_destroy_widgets - instead of remove_from_container. - (xg_display_close, xg_create_tool_bar, update_frame_tool_bar) - (free_frame_tool_bar): Add comment. - - * xfns.c (xic_create_xfontset): Check that FRAME_XIC_BASE_FONTNAME - is not NULL before strcmp. - -2004-10-26 Kim F. Storm <storm@cua.dk> - - * callint.c (Fcall_interactively): Add 'U' code to get the - up-event discarded by a previous 'k' or 'K' argument. - -2004-10-26 David Kastrup <dak@gnu.org> - - * buffer.c (syms_of_buffer): Fix a few typos. - -2004-10-26 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xsmfns.c: Put empty line between comment and function body. - Use two spaces before comment end. - -2004-10-25 Kenichi Handa <handa@m17n.org> - - * fontset.c (fontset_pattern_regexp): Optimize for the case that - PATTERN is full XLFD. - -2004-10-24 Kenichi Handa <handa@m17n.org> - - * regex.h (enum reg_errcode_t): New value REG_ERANGEX. - - * regex.c (re_error_msgid): Add an entry for REG_ERANGEX. - (regex_compile): Return REG_ERANGEX if appropriate. - -2004-10-22 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xfns.c (xic_create_xfontset): Initialize missing_list to NULL. - -2004-10-21 K,Aa(Broly L$,1 q(Brentey <lorentey@elte.hu> - - * xterm.h (x_output): New member `xic_base_fontname'. - (FRAME_XIC_BASE_FONTNAME): New macro. - (xic_free_xfontset): Declare. - - * xfns.c (xic_create_xfontset): Share fontsets between frames - based on base_fontname. - (xic_free_xfontset): New function. - (free_frame_xic): Use it. - (xic_set_xfontset): Ditto. - - * xterm.c (xim_destroy_callback): Ditto. - -2004-10-20 B. Anyos <banyos@freemail.hu> (tiny change) - - * w32term.c (x_draw_glyph_string): Use overline_color for overlines. - -2004-10-20 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.h (XSync): If USE_GTK, define XSync as process_all and then - XSync. - - * emacs.c (my_heap_start, heap_bss_diff, MAX_HEAP_BSS_DIFF): - New variables and constant. - (main): Calculate heap_bss_diff. If we are dumping and the - heap_bss_diff is greater than MAX_HEAP_BSS_DIFF, set PER_LINUX32 - and exec ourself again. - (Fdump_emacs): If heap_bss_diff is greater than MAX_HEAP_BSS_DIFF - print a warning. - - * lastfile.c: Make my_endbss and my_endbss_static available on all - platforms. - - * Makefile.in (RUN_TEMACS): Remove @SETARCH@. - * config.in (HAVE_PERSONALITY_LINUX32): Regenerate. - -2004-10-19 Luc Teirlinck <teirllm@auburn.edu> - - * data.c (Flocal_variable_if_set_p): Doc fix. - -2004-10-19 Jason Rumney <jasonr@gnu.org> - - * w32.c (init_environment): Set emacs_dir correctly when running - emacs from the build directory. - -2004-10-19 Richard M. Stallman <rms@gnu.org> - - * editfns.c (Fdelete_and_extract_region): - If region is empty, return null string. - -2004-10-19 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.h (xg_update_scrollbar_pos): Remove arguments real_left - and canon_width. - (xg_frame_cleared): Remove. - - * gtkutil.c (xg_frame_cleared, xg_fixed_handle_expose) - (xg_find_top_left_in_fixed): Remove. - (xg_create_scroll_bar): Put an event box widget between - the scroll bar widget and the edit widget. - (xg_show_scroll_bar): Show the parent widget (the event box). - (xg_remove_scroll_bar): Destroy parent (the event box) also. - (xg_update_scrollbar_pos): Remove arguments real_left and canon_width. - Move the parent (the event box) widget inside the fixed widget. - Move window clear to xterm.c. - - * gtkutil.h (xg_frame_cleared): Remove. - - * xterm.c (x_clear_frame): Remove call to xg_frame_cleared - (x_scroll_bar_create, XTset_vertical_scroll_bar): - Remove arguments left and width to xg_update_scrollbar_pos. - (XTset_vertical_scroll_bar): Do x_clear_area for USE_GTK also. - -2004-10-19 Kenichi Handa <handa@m17n.org> - - * xdisp.c (display_mode_element): Fix display of wide chars. - -2004-10-18 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (xg_update_scrollbar_pos): Change XClearWindow to - gdk_window_clear and move gdk_window_process_all_updates after - clear so events are sent to the X server in correct order. - -2004-10-18 Kenichi Handa <handa@m17n.org> - - * fontset.c (fs_load_font): Use fast_string_match_ignore_case for - comparing font names. - (fs_query_fontset): Use fast_string_match for comparing fontset names. - (list_fontsets): Likewise. - - * search.c (fast_string_match_ignore_case): New function. - - * lisp.h (fast_string_match_ignore_case): Extern it. - -2004-10-17 Kim F. Storm <storm@cua.dk> - - * xdisp.c (overlay_arrow_at_row): Return overlay string rather - than bitmap if there is not left fringe. - (get_overlay_arrow_glyph_row): Also used on windows system. - (display_line): Display overlay string if no left fringe. - -2004-10-16 Jason Rumney <jasonr@gnu.org> - - * w32fns.c (w32_font_match): Encode font name being matched. - -2004-10-16 Richard M. Stallman <rms@gnu.org> - - * window.c (Fspecial_display_p): Doc fix. - -2004-10-15 Stefan Monnier <monnier@iro.umontreal.ca> - - * doc.c (Fsubstitute_command_keys): Fix remap-handling. - Don't ignore menus, because where-is-internal already does it for us. - -2004-10-15 Kim F. Storm <storm@cua.dk> - - * xdisp.c (redisplay_window): Only update fringes and vertical - border on window frames. - -2004-10-14 Andreas Schwab <schwab@suse.de> - - * m/ia64.h (DATA_SEG_BITS): Don't define. - -2004-10-14 Kim F. Storm <storm@cua.dk> - - * xterm.h: Include Xutil.h after keysym.h to work around bug - in some X versions. - -2004-10-13 Stefan Monnier <monnier@iro.umontreal.ca> - - * fns.c (map_char_table): Add missing gcpros. - -2004-10-13 Stefan Monnier <monnier@iro.umontreal.ca> - - * keymap.c (get_keymap): An autoload form is not a keymap. - - * textprop.c (syms_of_textprop): Make `syntax-table' nonsticky. - -2004-10-13 Kim F. Storm <storm@cua.dk> - - * callproc.c (Fcall_process): Simplify handling of display arg. - Resume `display_on_the_fly' once a coding system is determined. - - * xdisp.c (redisplay_preserve_echo_area): Fix last change. - -2004-10-12 Kim F. Storm <storm@cua.dk> - - * xdisp.c (redisplay_preserve_echo_area): Flush display in case - caller, such as call-process, is not going to poll for input. - (calc_line_height_property): Handle case where it->object is nil. - - * xterm.c (x_redisplay_interface): Fix flush_display_optional. - -2004-10-12 Kenichi Handa <handa@m17n.org> - - * xdisp.c (get_next_display_element): - If unibyte_display_via_language_environment is zero, display 8-bit - chars in octal in unibyte buffer. - -2004-10-12 Kim F. Storm <storm@cua.dk> - - * doc.c (Fsubstitute_command_keys): Ignore remappings unless there - are no ordinary bindings. - -2004-10-11 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xfns.c (syms_of_xfns): Defsubr x-file-dialog for GTK also. - -2004-10-10 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macterm.c (x_raise_frame): Add BLOCK_INPUT around SelectWindow. - (x_lower_frame): Add BLOCK_INPUT around SendBehind. - (make_mac_frame): Add BLOCK_INPUT around the making of a - terminal frame. - (mac_initialize): Add BLOCK_INPUT around carbon initialization. - * macgui.h (mktime): Use emacs_mktime. - * macfns.c (Fx_file_dialog): Add BLOCK_INPUT around more code. - Make a cancel file-open dialog be like C-g. - * mac.c (mktime): Use emacs_mktime. - (Fdo_applescript): Add BLOCK_INPUT around do_applescript. - (Fmac_paste_function): Add better error handling for carbon cut/paste. - -2004-10-10 Kim F. Storm <storm@cua.dk> - - * keyboard.c (timer_resume_idle): New function to resume idle - timer without resetting timers on the idle list. - (read_char): Use timer_resume_idle. Remove local var last_idle_start. - (timer_start_idle, timer_stop_idle): Declare static. - (read_key_sequence): Use timer_resume_idle instead of timer_start_idle. - - * keyboard.h (timer_start_idle, timer_stop_idle): Remove prototypes. - -2004-10-08 Steven Tamm <steventamm@mac.com> - - * config.in (HAVE_MALLOC_MALLOC_H): Regenerate. - * macterm.c (mac_check_for_quit_char): Remove warning for using - NULL where 0 should be used. - * unexmacosx.c: Use malloc/malloc.h on Tiger instead of - objc/malloc.h - * mac.c: Include time.h for Tiger compatibility. - -2004-10-07 Kim F. Storm <storm@cua.dk> - - * xdisp.c (redisplay_window): Fix flicker on vertical line between - windows. Update vertical line after drawing window fringes, but - only if actually drawing any bitmaps--or there is no fringe. - - * xterm.c (x_update_window_end): Likewise. - * macterm.c (x_update_window_end): Likewise. - * w32term.c (x_update_window_end): Likewise. - - * fringe.c (draw_window_fringes): Return value now indicates if - any fringe bitmaps were redrawn (or there are no fringes). - - * dispextern.h (draw_window_fringes): Update prototype. - -2004-10-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macfns.c (mac_get_window_bounds): Add extern. - (x_real_positions): Use mac_get_window_bounds. - - * macmenu.c (update_submenu_strings): Apply 2004-09-07 change for - xmenu.c (YAILOM). - - * macterm.c [!MAC_OSX]: Include Windows.h. - (front_emacs_window): Rename from mac_front_window. All uses - changed. Return the frontmost non-tooltip emacs window. - (mac_get_window_bounds): New function. - (x_calc_absolute_position): Use the difference of width and height - between the inner and outer window. - (x_set_offset): Specify window position by the coordinae of the - outer window. Adjust the position if the title bar is completely - outside the screen. - (app_is_suspended, app_sleep_time): Remove unused variables. - (do_app_resume, do_app_suspend): Remove their contents because - window-activate/deactivate events will do the job. - (do_zoom_window): Remove unused variables. Make compliant to the - standard way of zooming. Set f->left_pos and f->top_pos. - (XTread_socket): Don't use argument `expected'. Don't use - FrontWindow to determine the clicked window. Exclude unprocessed - mouseUp cases in the early stage. Add parentheses to fix operator - precedence. - (XTread_socket) [TARGET_API_MAC_CARBON]: Don't specify drag area. - -2004-10-05 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * config.in: Regenerate. - - * Makefile.in (RUN_TEMACS): Check HAVE_RANDOM_HEAPSTART instead of - HAVE_EXECSHIELD. - -2004-10-05 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.c (x_find_modifier_meanings): Ignore any Super or Hyper for - a row if Alt or Meta has been found for that row. Also stop scanning - for Keysyms for that row. - -2004-10-04 Kim F. Storm <storm@cua.dk> - - * fringe.c (Ffringe_bitmaps_at_pos): Change return value from cons - to list. Include overlay arrow bitmap in return value. - - * xterm.c (XTset_vertical_scroll_bar): Improve handling of scroll - bars with fractional column width. If scroll bar separates two - windows, move it towards the window it belongs to. Only update - the padding area below the scroll bar widget when necessary, - i.e. when scroll bar widget is created, moved, or resized. - - * xdisp.c (define_frame_cursor1): Do not change frame cursor - while tracking/dragging mouse. - (x_draw_vertical_border): Do not draw line if frame has scroll bars. - - * window.c (coordinates_in_window): Relax check for cursor - on vertial border between mode lines. - (Fset_window_fringes): Do not allow negative widths. - (Fset_window_scroll_bars): Likewise. - - * .gdbinit (pp): Shorthand for p ARG + pr. - (ff): New command: flush frame updates (X only). - -2004-10-03 Michael Albinus <michael.albinus@gmx.de> - - * fileio.c (auto_save_1) Call Ffile_modes for remote files. - -2004-09-30 Kenichi Handa <handa@m17n.org> - - * process.c (send_process): Free composition data. - - * fileio.c (Finsert_file_contents): Free composition data. - - * coding.c (code_convert_region): Don't skip ASCIIs if there are - compositions to encode. - (encode_coding_string): Likewise. Free composition data. - -2004-09-30 Florian Weimer <fw@deneb.enyo.de> - - * coding.c (code_convert_region): Free composition data. - -2004-09-29 Kim F. Storm <storm@cua.dk> - - * fringe.c: Remove limit on number of bitmaps. - (fringe_bitmaps, fringe_faces): Change to pointers. - (max_fringe_bitmaps): New var. - (Fdefine_fringe_bitmap): Expand fringe_bitmaps and fringe_faces. - (init_fringe): Allocate fringe_bitmaps and fringe_faces. - - * dispextern.h (FRINGE_ID_BITS): Increase to 16 bits (64K bitmaps). - (struct glyph_row): Reorder fringe_bitmap related fields. - (struct it): Likewise. - - * w32term.c (fringe_bmp): Change to pointer. - (max_fringe_bmp): New var. - (w32_define_fringe_bitmap): Expand fringe_bmp. - (w32_draw_fringe_bitmap): Check max_fringe_bmp. - (w32_destroy_fringe_bitmap): Likewise. - -2004-09-29 Kim F. Storm <storm@cua.dk> - - * fringe.c: Simplify last change. - (lookup_fringe_bitmap): New function. - (valid_fringe_bitmap_p, resolve_fringe_bitmap): Remove. - (Fdestroy_fringe_bitmap): Use lookup_fringe_bitmap. - Keep standard bitmaps in Vfringe_bitmaps. - (Fdefine_fringe_bitmap): Use lookup_fringe_bitmap. - (Fset_fringe_bitmap_face): Likewise. - - * dispextern.h (lookup_fringe_bitmap): Add prototype. - (valid_fringe_bitmap_p): Remove prototype. - - * xdisp.c (handle_single_display_prop): Use lookup_fringe_bitmap. - -2004-09-29 Kim F. Storm <storm@cua.dk> - - * fringe.c (destroy_fringe_bitmap, init_fringe_bitmap) - (w32_init_fringe, w32_reset_fringes): Fix bootstrap (NULL rif). - - * dispextern.h (valid_fringe_bitmap_p): Fix prototype. - - * fringe.c (Vfringe_bitmaps): New variable. - (syms_of_fringe): DEFVAR_LISP it. - (valid_fringe_bitmap_p): Rename from valid_fringe_bitmap_id_p. - Change arg to Lisp_Object and fail if not an integer. - (get_fringe_bitmap_name, resolve_fringe_bitmap) - (destroy_fringe_bitmap): New functions. - (Fdestroy_fringe_bitmap): Change arg to bitmap symbol. - Use destroy_fringe_bitmap. Remove symbol from Vfringe_bitmaps and - clear its fringe property. - (init_fringe_bitmap): Use destroy_fringe_bitmap instead of - Fdestroy_fringe_bitmap. - (Fdefine_fringe_bitmap): Add BITMAP arg specifying new or existing - bitmap symbol; remove WHICH arg. Add symbol to Vfringe_bitmaps - and set fringe property. Signal error if no free slots. - (Fset_fringe_bitmap_face): Change arg to bitmap symbol. - (Ffringe_bitmaps_at_pos): Return bitmap symbols instead of numbers. - - * xdisp.c (handle_single_display_prop): Fringe bitmaps are now - symbols with a fringe property. - -2004-09-27 Kim F. Storm <storm@cua.dk> - - * buffer.c (syms_of_buffer) <indicate-buffer-boundaries>: - Doc fix. Format may now be a symbol or alist, not a cons. - - * fringe.c (update_window_fringes): Handle new formats of - indicate-buffer-boundaries (symbol or alist). No longer - allow a simple cons. - (Ffringe_bitmaps_at_pos): Use nil value for no bitmap. - -2004-09-25 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * config.in: Rebuild. - -2004-09-24 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * config.in: Rebuild. - - * Makefile.in: Run setarch i386 ./temacs if exec-shield is present. - -2004-09-18 Stefan Monnier <monnier@iro.umontreal.ca> - - * xterm.c (x_term_init): Work around a bug in some X servers. - -2004-09-18 Richard M. Stallman <rms@gnu.org> - - * buffer.c (syms_of_buffer) <default-major-mode>: Doc fix. - - * xdisp.c (try_window_reusing_current_matrix): - Handle the case where we reach the old displayed text, - out of sync with the old line boundary. - -2004-09-14 Stefan Monnier <monnier@iro.umontreal.ca> - - * fileio.c (Finsert_file_contents): Fix case of replacement in a - narrowed buffer. - -2004-09-14 Kim F. Storm <storm@cua.dk> - - * puresize.h (PURESIZE_RATIO): Define based on BITS_PER_EMACS_INT. - - * xfaces.c (Qface_no_inherit): New var. - (syms_of_xfaces): Intern and staticpro it. - (Finternal_make_lisp_face, Finternal_set_lisp_face_attribute) - (Finternal_copy_lisp_face, update_face_from_frame_parameter): - Don't increment face_change_count when face has non-nil - face-no-inherit property. - -2004-09-13 Stefan Monnier <monnier@iro.umontreal.ca> - - * bytecode.c (BYTE_CODE_QUIT): Add missing AFTER_POTENTIAL_GC. - (Fbyte_code): Remove dead code after `wrong_type_argument'. - - * alloc.c (Fgarbage_collect): Mark keyboards, gtk data, and specpdl - before doing the mark_stack_check_gcpros since they're not on the stack. - -2004-09-12 Kim F. Storm <storm@cua.dk> - - * editfns.c (Fformat): Handle format strings with multiple text - properties. Reverse text property list from the format string, - so the positions are in increasing order. - -2004-09-10 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xselect.c (x_reply_selection_request): XSync and UNBLOCK before - x_uncatch_errors so that possible protocol errors are delivered. - -2004-09-10 Eli Zaretskii <eliz@gnu.org> - - * Makefile.in (msdos.o): Depend on buffer.h, commands.h, and - blockinput.h. - (dosfns.o): Depend on blockinput.h, window.h, dispextern.h, - charset.h, and coding.h - (w16select.o): Depend on buffer.h, charset.h, coding.h, and composite.h. - (term.o): Depend on window.h and keymap.h. - (abbrev.o): Depend on syntax.h. - (callint.o): Depend on keymap.h. - (casefiddle.o): Depend on charset.h and keymap.h. - (category.o): Depend on keymap.h. - (coding.o): Depend on dispextern.h. - (cmds.o): Depend on keyboard.h and keymap.h. - (dispnew.o): Depend on indent.h and intervals.h. - (doc.o): Depend on keymap.h. - (editfns.o): Depend on frame.h. - (emacs.o): Depend on dispextern.h. - (fileio.o): Don't depend on ccl.h. - (filelock.o): Depend on charset.h and coding.h. - (frame.o): Depend on w32term.h and macterm.h. - (insdel.o): Depend on region-cache.h. - (keyboard.o): Depend on keymap.h, w32term.h, and macterm.h. - (minibuf.o): Depend on $(INTERVALS_SRC) and keymap.h. - (search.o): Depend on $(INTERVALS_SRC). - (syntax.o): Depend on keymap.h, regex.h, and $(INTERVALS_SRC). - (window.o): Depend on keymap.h, blockinput.h, $(INTERVALS_SRC), - xterm.h, w32term.h, and macterm.h. - (xdisp.o): Depend on keyboard.h, $(INTERVALS_SRC), xterm.h, - w32term.h, and macterm.h. - (xfaces.o): Depend on keyboard.h, $(INTERVALS_SRC), - region-cache.h, xterm.h, w32term.h, and macterm.h. - (bytecode.o): Depend on dispextern.h, frame.h, and xterm.h. - (data.o): Depend on frame.h. - (fns.o): Depend on keymap.h, xterm.h, and blockinput.h. - (print.o): Depend on termchar.h and $(INTERVALS_SRC). - (lread.o): Depend on $(INTERVALS_SRC), termhooks.h, and coding.h. - (intervals.o): Depend on keymap.h. - - * msdos.c (msdos_set_cursor_shape, IT_display_cursor): - Add debugging print-out to termscript. - -2004-09-09 Richard M. Stallman <rms@gnu.org> - - * xdisp.c (decode_mode_spec): Use current buffer for most purposes. - -2004-09-08 Richard M. Stallman <rms@gnu.org> - - * window.c (Fset_window_buffer): Doc fix. - - * xdisp.c (Fformat_mode_line): New arg BUFFER says which buffer to use. - -2004-09-08 Dan Nicolaescu <dann@ics.uci.edu> - - * minibuf.c (history_delete_duplicates): New variable. - (read_minibuf): Use it. - (syms_of_minibuf): Create the corresponding lisp variable. - -2004-09-08 Kim F. Storm <storm@cua.dk> - - * xdisp.c (set_cursor_from_row): Also look at 'cursor' property in - overlay just before point. - -2004-09-07 Luc Teirlinck <teirllm@auburn.edu> - - * buffer.h (struct buffer): Add auto_save_file_format field. - * buffer.c (reset_buffer, init_buffer_once): - Handle auto_save_file_format field. - (syms_of_buffer): Add DEFVAR_PER_BUFFER for - `buffer-auto-save-file-format'. - * fileio.c: Delete declaration for removed Vauto_save_file_format. - (build_annotations): Adapt to replacement of - `auto-save-file-format' with the new buffer-local variable - `buffer-auto-save-file-format'. - (syms_of_fileio): Delete DEFVAR_LISP for auto-save-file-format. - -2004-09-07 Jason Rumney <jasonr@gnu.org> - - * w32term.h (AppendMenuW_Proc): Move declaration from w32menu.c. - - * w32fns.c (w32_wnd_proc) <WM_MEASUREITEM, WM_DRAWITEM>: - Handle Unicode menu titles. - -2004-09-07 Kim F. Storm <storm@cua.dk> - - * xdisp.c (set_cursor_from_row): Fix last change. Only use 'cursor' - property from text property or overlay strings at point. - -2004-09-07 Stefan Monnier <monnier@iro.umontreal.ca> - - * xmenu.c (update_submenu_strings): YAILOM. - (set_frame_menubar): Make sure last_i is initialized. - -2004-09-03 Jason Rumney <jasonr@gnu.org> - - * w32menu.c (_widget_value): Add lname and lkey. - (digest_single_submenu): Set lname and lkey in widget_value - instead of name and key. - (update_submenu_strings): New function. - (set_frame_menubar): Remove call to inhibit_garbage_collection, - call update_submenu_strings. - - * w32menu.c (globals_of_w32menu): Check for Unicode API. - (digest_single_submenu, w32_menu_show): Encode menu strings as - UTF-8 if Unicode API is available. - (utf8to16): New function. - (add_menu_item): Use it when calling Unicode API. - -2004-09-03 Kim F. Storm <storm@cua.dk> - - * xdisp.c (set_cursor_from_row): Look for non-nil `cursor' property - in overlay or text-property strings; set cursor on corresponding - glyph rather than at end of the string. - -2004-09-02 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macfns.c (x_real_positions): Save the current window port and - set a new one before obtaining the global coordinate. - Use FRAME_MAC_WINDOW. - (x_set_name, x_set_title): Encode title to UTF8. - Use SetWindowTitleWithCFString. - (Fx_server_version): Get correct OS version. - - * macmenu.c (add_menu_item): Remove unused variable `i'. - Don't let separator items destroy refence constants of other menu items. - - * macterm.c (x_update_end): Move SetPortWindowPort to inside - BLOCK_INPUT. - (x_set_offset): Use FRAME_MAC_WINDOW. - - * xdisp.c (note_mouse_highlight): Set the mouse pointer shape to - nontext_cursor if it is on a scroll bar. - - * s/darwin.h (LIBS_CARBON): New define to specify libraries for - Carbon support. - (LD_SWITCH_SYSTEM_TEMACS): Don't link with unused libstdc++. - Use LIBS_CARBON. - -2004-09-02 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xfns.c (x_set_name_internal): New function. Check if we shall call - xfree before ENCODE_UTF_8. - (x_set_name, x_set_title): Call x_set_name_internal. - -2004-08-31 NAKAMURA Toshikazu <nr-tkz@nifty.com> (tiny change) - - * w32fns.c (w32_load_font): If a BDF font is already loaded, do not - reload it. - -2004-08-30 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * macmenu.c (_widget_value): Add lname and lkey. - (single_submenu): Set lname and lkey in widget_value - instead of name and key. - (update_submenu_strings): New function. - (set_frame_menubar): Remove call to inhibit_garbage_collection, - call update_submenu_strings. - - * xmenu.c (digest_single_submenu): Set lname and lkey in widget_value - instead of name and key. - (update_submenu_strings): New function. - (set_frame_menubar): Remove call to inhibit_garbage_collection, - call update_submenu_strings. - - * gtkutil.h (_widget_value): Added lname and lkey. - -2004-08-30 Steven Tamm <steventamm@mac.com> - - * macmenu.c (mac_menu_show): Remove shadowing of menu variable - by using different names for inner loop variables. - -2004-08-27 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xmenu.c (set_frame_menubar): Reintroduce inhibit_garbage_collection - from 2002-07-15T00:01:34Z!raeburn@raeburn.org so that strings from ENCODE_UTF_8 isn't GC:ed before used. - - * gtkutil.c (xg_create_frame_widgets): Compensate for tool bar when - tool bar items is 0. - -2004-08-26 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macmenu.c (ENCODE_MENU_STRING): Added to handle multibyte - strings in menu items. - (single_submenu): Use ENCODE_MENU_STRING - (mac_menu_show): Use ENCODE_MENU_STRING. Reset grabbed because - button release isn't passed to event loop - (add_menu_item): Use SetMenuItemWithCFString. - -2004-08-26 Steven Tamm <steventamm@mac.com> - - * fileio.c (Fread_file_name): Call x_file_dialog on carbon on - tool-bar/menu click. - * macfns.c (Fx_file_dialog): Implement using NavServices. - -2004-08-24 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.c (x_catch_errors_unwind): Do not XSync if display has closed. - - * xfns.c (x_window_to_frame, x_any_window_to_frame) - (x_non_menubar_window_to_frame, x_menubar_window_to_frame) - (x_top_window_to_frame): Return 0 if wdesc is None. - -2004-08-22 Richard M. Stallman <rms@gnu.org> - - * process.c (process_send_signal) [SIGNALS_VIA_CHARACTERS, - HAVE_TERMIOS]: If there's no char for this signal, drop through - and use system calls. - - * bytecode.c (Fbyte_code) <unwind-protect>: Cannot GC. - -2004-08-20 Kim F. Storm <storm@cua.dk> - - * process.c (wait_reading_process_output): Rename from - wait_reading_process_input. All uses changed. - (wait_reading_process_output_1): Rename from - wait_reading_process_input_1. All uses changed. - - * dispnew.c (Fsleep_for): Remove obsolete code. - -2004-08-20 Kenichi Handa <handa@m17n.org> - - * syntax.c (skip_chars): Fix for unibyte case. - -2004-08-19 Stefan Monnier <monnier@iro.umontreal.ca> - - * syntax.c (char_quoted): Mixup byte/char pos. - (back_comment): Fixup globals in all cases. - -2004-08-19 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xfns.c (x_set_name, x_set_title): Encode title to UTF8 before - passing it to gtk_window_set_title. - -2004-08-19 Kim F. Storm <storm@cua.dk> - - * process.c (wait_reading_process_input): Clean up. - Add wait_for_cell, wait_proc, and just_wait_proc args - to avoid overloading `read_kbd' and `do_display' args. - Change read_kbd arg to int. All callers changed. - - * process.c (process_send_signal): Use CDISABLE. - - * sysdep.c (child_setup_tty, init_sys_modes): Use CDISABLE. - -2004-08-18 Kim F. Storm <storm@cua.dk> - - * process.c (Faccept_process_output): Add arg JUST-THIS-ONE; - forward to wait_reading_process_input via DO_DISPLAY arg. - (wait_reading_process_input): If DO_DISPLAY < 0 for a process - object, only process output from that process; also inhibit - running timers if DO_DISPLAY==-2. - -2004-08-17 Kim F. Storm <storm@cua.dk> - - * process.c (process_send_signal): Fix last change--use - _POSIX_VDISABLE instead of CVDISABLE when available. - -2004-08-16 Richard M. Stallman <rms@gnu.org> - - * sysdep.c (child_setup_tty) [SIGNALS_VIA_CHARACTERS]: - Set VQUIT and VINTR chars to the standard ones if they are unset. - [AIX]: Don't do that here. And don't force VINTR to standard - when SIGNALS_VIA_CHARACTERS. - - * process.c (process_send_signal) - [SIGNALS_VIA_CHARACTERS, HAVE_TERMIOS]: Clean up. - Do nothing if the character is CVDISABLE. - - * xfaces.c (merge_face_ref): Specifying `unspecified' is a no-op. - - * intervals.c (move_if_not_intangible): - Force POSITION to be between BEGV and ZV. - -2004-08-14 John Paul Wallington <jpw@gnu.org> - - * buffer.c (Frestore_buffer_modified_p): Doc fix. - - * fileio.c (Fread_file_name): Doc fix. - - * minibuf.c (syms_of_minibuf) <completion-ignore-case>: Doc fix. - -2004-08-09 Luc Teirlinck <teirllm@auburn.edu> - - * keymap.c (Fmake_keymap, Fmap_keymap, Fwhere_is_internal): Doc fixes. - -2004-08-08 Luc Teirlinck <teirllm@auburn.edu> - - * keyboard.c: Declare Qdisabled_command_function instead of - Qdisabled_command_hook. - (Fcommand_execute): Use Qdisabled_command_function instead of - Qdisabled_command_hook. - (syms_of_keyboard): Ditto. - -2004-08-07 Luc Teirlinck <teirllm@auburn.edu> - - * keymap.c (Flocal_key_binding, Fglobal_key_binding) - (syms_of_keymap) <key-translation-map>: Doc fixes. - -2004-08-07 Stefan Monnier <monnier@iro.umontreal.ca> - - * window.c (window_list_1): YAILOM. - - * fileio.c (make_temp_name): Handle multibyte prefixes. - -2004-08-06 Luc Teirlinck <teirllm@auburn.edu> - - * keyboard.c (syms_of_keyboard) <overriding-terminal-local-map>: - Doc fix. - -2004-08-03 Kenichi Handa <handa@m17n.org> - - * coding.c (decode_coding_string): Adjust coding->consumed, and - etc. with shrinked_bytes. - -2004-08-03 Kim F. Storm <storm@cua.dk> - - * indent.c (compute_motion): Fix check for full width window - in non-window case. Do not count left truncation glyph on - window systems. - -2004-08-02 Luc Teirlinck <teirllm@auburn.edu> - - * data.c (Finteractive_form): Doc fix. - -2004-08-02 Kim F. Storm <storm@cua.dk> - - * indent.c (compute_motion): Use actual window width if WIDTH is -1, - properly accounting for continuation glyph on non-window systems. - (Fcompute_motion): Use actual window width if WIDTH is nil, and - actual window width/height if TOPOS is nil, properly accounting for - continuation glyphs on non-window systems, and optional header lines. - (vmotion): Let compute_motion calculate actual window width. - - * window.c (window_scroll_line_based): Let compute_motion - calculate actual window width. - -2004-08-02 Kim F. Storm <storm@cua.dk> - - * process.c (read_process_output): Use whole read buffer. - Don't trigger adaptive read buffering on errors. - -2004-07-31 Luc Teirlinck <teirllm@auburn.edu> - - * keymap.c (Fset_keymap_parent, Fdefine_prefix_command): Doc fixes. - - * keyboard.c (syms_of_keyboard) <disable-point-adjustment>: Doc fix. - - * callint.c (Fcall_interactively): Doc fix. - -2004-07-30 Richard M. Stallman <rms@gnu.org> - - * abbrev.c (Fexpand_abbrev): Undo previous change. - -2004-07-30 Kim F. Storm <storm@cua.dk> - - * editfns.c (Fformat): Allocate extra (dummy) element in info. - -2004-07-28 Luc Teirlinck <teirllm@auburn.edu> - - * eval.c (Fdefvar, Fdefconst): Doc fixes. - -2004-07-27 Kim F. Storm <storm@cua.dk> - - * xdisp.c (move_it_in_display_line_to): Check BUFFER_POS_REACHED_P after - we have ensured that the glyph fits on the current line (or returned - MOVE_LINE_CONTINUED otherwise). - -2004-07-26 Kim F. Storm <storm@cua.dk> - - * xdisp.c (move_it_in_display_line_to): If overflow-newline-into-fringe - is enabled, return MOVE_LINE_CONTINUED rather than MOVE_POS_MATCH_OR_ZV - if target position is at end of display line but char is not a newline. - -2004-07-25 Richard M. Stallman <rms@gnu.org> - - * window.c (coordinates_in_window): Return ON_SCROLL_BAR - instead of ON_VERTICAL_BORDER, when on scroll bar. - (Fcoordinates_in_window_p): Handle ON_SCROLL_BAR--return nil. - - * dispextern.h (enum window_part): Add ON_SCROLL_BAR. - - * window.c (Fcoordinates_in_window_p): - Take account of FRAME_INTERNAL_BORDER_WIDTH. - - * alloc.c (check_cons_list): New function (contents commented out). - -2004-07-24 Luc Teirlinck <teirllm@auburn.edu> - - * xfaces.c (Fcolor_supported_p): Doc fix. - - * frame.c (Fselect_frame, Fset_frame_selected_window) - (Fframe_visible_p, Fraise_frame): Doc fixes. - -2004-07-24 Richard M. Stallman <rms@gnu.org> - - * keyboard.h (not_single_kboard_state): Declare. - - * fileio.c (Fwrite_region): Doc fix. - - * window.c (Fwindow_at): Take account of FRAME_INTERNAL_BORDER_WIDTH. - - * abbrev.c (Fexpand_abbrev): Run Qpre_abbrev_expand_hook - only when a real abbrev is present. - - * xfns.c (x_icon_verify): New function. - (Fx_create_frame): Use it. - -2004-07-22 Barry Fishman <barry_fishman@att.net> (tiny change) - - * s/gnu-linux.h: Use GC_MARK_STACK if __amd64__ is defined. - -2004-07-21 Kim F. Storm <storm@cua.dk> - - * window.h (struct glyph_matrix): New members nrows_scale_factor - and ncols_scale_factor. - - * window.c (make_window): Initialize nrows_scale_factor and - ncols_scale_factor members. - - * dispnew.c (margin_glyphs_to_reserve): Apply ncols_scale_factor. - (allocate_matrices_for_frame_redisplay): Fix left/right margin mix-up. - (required_matrix_height): Apply nrows_scale_factor. - (required_matrix_width): Apply ncols_scale_factor. - - * xdisp.c (display_line): Increment nrows_scale_factor and set - fonts_changed_p if past last allocated row. - (append_glyph, append_composite_glyph, produce_image_glyph) - (append_stretch_glyph): Increment ncols_scale_factor and set - fonts_changed_p if current area is full. - -2004-07-21 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * widget.c (EmacsFrameDestroy): Don't abort if normal_gc is 0. - -2004-07-19 Luc Teirlinck <teirllm@auburn.edu> - - * window.c (Fpos_visible_in_window_p, Fset_window_hscroll) - (Fwindow_inside_pixel_edges, Fwindow_end, Fset_window_point) - (Fset_window_start, Fscroll_up, Fscroll_down) - (Fother_window_for_scrolling, Fscroll_other_window) - (Fsave_window_excursion, Fset_window_vscroll) - (syms_of_window) <window-size-fixed>: Doc fixes. - -2004-07-19 KOBAYASHI Yasuhiro <kobayays@otsukakj.co.jp> - - * w32fns.c (Fx_file_dialog): Use ENCODE_FILE instead of - ENCODE_SYSTEM for filenames. - -2004-07-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * mac.c (sys_select): Block input around call to - ReceiveNextEvent to prevent breakage. Correctly handle - blocking on event queue only by calling ReceiveNextEvent - instead of select (since GUI events aren't on an fd). - (sys_read): Remove function - * sysdep.c: Remove redefine of read to sys_read if HAVE_CARBON. - -2004-07-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * mac.c (sys_select): Redo sys_select to use alarm-based - polling instead of 1 sec timeouts (like solaris). - - * macterm.c (x_make_frame_visible): Comment in polling on - frame creation. - - * keyboard.c: Undef SIGIO on Carbon. - - * atimer.c (alarm_signal_handler): Call alarm handlers after - scheduling. - - * eval.c (Feval): Remove quit_char test. - - * process.c (wait_reading_process_input): Remove clearing - stdin for select call on process input. - -2004-07-18 Luc Teirlinck <teirllm@auburn.edu> - - * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Correct - capitalization error in docstring. - -2004-07-17 Juanma Barranquero <lektu@terra.es> - - * keyboard.c (not_single_kboard_state): Do nothing unless - MULTI_KBOARD is defined. - -2004-07-17 Richard M. Stallman <rms@gnu.org> - - * window.c (coordinates_in_window): Inside the window but outside - its box to the L or R, return ON_VERTICAL_BORDER. - (window_list_1): Rotate the list to start with WINDOW. - - * print.c (print_preprocess): Test for print_depth at limit - before entering in being_printed. - - * keyboard.c (not_single_kboard_state): New function. - (stuff_buffered_input): Now no-op only if no SIGTSTP. - - * frame.c (Fdelete_frame): If we're in single_bboard_state on - this kboard, and we delete its last frame, go to any_kboard_state. - - * buffer.c (syms_of_buffer) <transient-mark-mode>: Doc fix. - -2004-07-15 KOBAYASHI Yasuhiro <kobayays@otsukakj.co.jp> - - * w32fns.c (Fx_file_dialog): Encode strings in system coding - system before passing them to OS functions for display. - -2004-07-15 David Kastrup <dak@gnu.org> - - * search.c (syms_of_search): Staticpro `saved_last_thing_searched'. - Apparently fixes an abort condition. - -2004-07-14 Luc Teirlinck <teirllm@auburn.edu> - - * fileio.c (Fvisited_file_modtime): Return a list of two integers, - instead of a cons. - -2004-07-14 K,Aa(Broly L$,1 q(Brentey <lorentey@elte.hu> - - * keyboard.c (echo_dash): Do nothing if there already is a dash - at the end of the echo string. - -2004-07-12 Kim F. Storm <storm@cua.dk> - - * alloc.c (mark_object): Only look at Lisp_Misc_Save_Value - if GC_MARK_STACK. - -2004-07-10 Luc Teirlinck <teirllm@auburn.edu> - - * buffer.c (Fswitch_to_buffer, Fpop_to_buffer): Doc fixes. - - * window.c (Fwindow_buffer, Fother_window, Fget_lru_window) - (Fget_largest_window, Fget_buffer_window, Fdelete_windows_on) - (Freplace_buffer_in_windows, Fset_window_buffer) - (Fselect-window, Fdisplay-buffer, Fsplit_window): Doc fixes. - (syms_of_window): Expand docstring of `display-buffer-function'. - -2004-07-09 Luc Teirlinck <teirllm@auburn.edu> - - * editfns.c (Ffloat_time, Fformat_time_string, Fdecode_time) - (Fcurrent_time_string, Fcurrent_time_zone): Mention in docstrings - that time values of the type (HIGH . LOW) are considered obsolete. - -2004-07-06 Luc Teirlinck <teirllm@auburn.edu> - - * keyboard.c (syms_of_keyboard): Fix `keyboard-translate-table' - docstring. - - * fns.c (Fclear_string): Declare `len' before call to CHECK_STRING. - -2004-07-06 John Paul Wallington <jpw@gnu.org> - - * eval.c (Fdefmacro): Signal an error if NAME is not a symbol. - - * fns.c (Fclear_string): Signal an error if STRING is not a string. - -2004-07-05 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * macterm.c (mac_initialize_display_info): Use CGGetActiveDisplayList - instead of CGMainDisplayID (only in OSX 10.2 and later). - -2004-07-04 John Paul Wallington <jpw@gnu.org> - - * fileio.c (read_file_name_completion_ignore_case): New variable. - (syms_of_fileio): Declare and initialise it. - (Fread_file_name): Bind `completion-ignore-case' to respect it. - -2004-07-03 Eli Zaretskii <eliz@gnu.org> - - * msdos.c (dos_rawgetc): Use make_number to produce Lisp objects - for event.x and event.y. - -2004-07-01 Kenichi Handa <handa@m17n.org> - - * w32select.c (Fw32_set_clipboard_data): Update `nbytes' correctly - after getting a new string by pre-write-conversion. - -2004-06-30 Stefan Monnier <monnier@iro.umontreal.ca> - - * xterm.c (x_detect_focus_change): Remove unused var `nr_events'. - (x_calc_absolute_position): Remove unused var `child'. - - * xfaces.c (x_supports_face_attributes_p) - (Fdisplay_supports_face_attributes_p): YAILOM. - (tty_supports_face_attributes_p): Remove unused var `i'. - - * syntax.c (skip_chars): Remove unused labels fwd_unibyte_ok and - back_unibyte_ok. - - * search.c (match_limit, Fmatch_data, Fset_match_data): YAILOM. - - * fontset.c (Fset_fontset_font): Remove unused vars `family' and - `registry'. - - * Makefile.in (${etc}DOC): Fix file name of make-docfile. - -2004-06-30 Andreas Schwab <schwab@suse.de> - - * image.c (CHECK_LIB_AVAILABLE): Add third parameter LIBRARIES. - (Finit_image_library): Pass LIBRARIES through to - CHECK_LIB_AVAILABLE. Declare parameters. Doc fix. - (lookup_image_type): Pass Qnil as second argument to - Finit_image_library. - - * lisp.h (Finit_image_library): Declare. - -2004-06-29 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macterm.c (do_window_activate, do_window_deactivate): Remove. - (XTread_socket): Send mouse button events to the toolbox - dispatcher even when the mouse is grabbed. Don't process window - activate events for non-Emacs windows. Replace function calls to - do_window_activate and do_window_deactivate with their contents. - Reset mouse grabbing status when a window is deactivated. - -2004-06-29 Steven Tamm <steventamm@mac.com> - - * macterm.c (mac_get_emulated_btn) - (mac_event_to_emacs_modifiers): Fix emulated mouse button - support to correctly mask out modifiers. - -2004-06-29 David Kastrup <dak@gnu.org> - - * search.c (Fset_match_data): Allow buffer before end of list - which can happen if set-match-data is using a pre-consed list. - -2004-06-28 Steven Tamm <steventamm@mac.com> - - * macterm.c (XTread_socket): Correctly set the frame position - after the window is moved. - -2004-06-28 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (xg_get_image_for_pixmap): Call g_object_unref on - gpix and gmask just before return to avoid memory leak. - (xg_get_image_for_pixmap): Add workaround for monochrome displays - so insensitive and activated icons look ok. - -2004-06-27 Jason Rumney <jasonr@gnu.org> - - * w32fns.c (file_dialog_callback): Disable edit control if set - to directories only on CDN_INITDONE message. - (Fx_file_dialog): Default to directories only when prompt starts - with "Dired". - -2004-06-25 Kim F. Storm <storm@cua.dk> - - * alloc.c (allocate_misc): Update total_free_markers. - (free_misc): New function. - (safe_alloca_unwind, free_marker): Use it. - - * lisp.h (free_misc): Add prototype. - - * fns.c (Fmapconcat, Fmapcar): Remove superfluous GCPROs. - -2004-06-24 Richard M. Stallman <rms@gnu.org> - - * emacs.c (Vsignal_USR1_hook, Vsignal_USR2_hook): Definitions deleted. - (syms_of_emacs): Lisp variables deleted. - -2004-06-23 David Kastrup <dak@gnu.org> - - * search.c (Freplace_match): Adjust the match-data more thoroughly - when replacing strings in the buffer. - (Fmatch_data): When INTEGERS is non-nil and the last match was in - a buffer, add the buffer as last element to the match data. - (Fset_match_data): If an additional element of the match-data is a - buffer, restore it to last_thing_searched. - (save_search_regs): Save last_thing_searched as part of the match data. - (restore_match_data): Restore it again. - -2004-06-23 Luc Teirlinck <teirllm@auburn.edu> - - * keymap.c (Ftext_char_description): Doc fix. - * doc.c (Fsnarf_documentation): Doc fix. - -2004-06-22 Kim F. Storm <storm@cua.dk> - - * fns.c (Fmapcar, Fmapconcat): GCPRO the args array. - - * lisp.h (struct Lisp_Save_Value): New member dogc. - (SAFE_ALLOCA_LISP): Change second arg to number of elements. - Set dogc member in Lisp_Save_Value object so it will be GC'ed. - (SAFE_FREE_LISP): New macro. - - * alloc.c (safe_alloca_unwind): Clear dogc and pointer members. - (make_save_value): Init new dogc member. - (mark_object): Mark Lisp_Save_Value pointer array if dogc is set. - - * fns.c (Fmapconcat, Fmapcar): Use new SAFE_ALLOCA_LISP and - SAFE_FREE_LISP macros. - -2004-06-22 Kim F. Storm <storm@cua.dk> - - * lisp.h (SAFE_ALLOCA_LISP): New macro to allocate Lisp_Objects. - Temporarily inhibits GC if memory is xmalloc'ed, as the Lisp_Objects - in that memory area are unknown to GC. Add comments. - - * fns.c (Fmapconcat, Fmapcar): Use SAFE_ALLOCA_LISP. - -2004-06-21 Kim F. Storm <storm@cua.dk> - - * lisp.h (MAX_ALLOCA): Define here. - (safe_alloca_unwind): Add prototype. - (USE_SAFE_ALLOCA, SAFE_ALLOCA, SAFE_FREE): New macros. - - * alloc.c (safe_alloca_unwind): New function. - - * casefiddle.c (casify_object): Use SAFE_ALLOCA. - - * charset.c (Fstring): Use SAFE_ALLOCA. - - * coding.c (MAX_ALLOCA): Remove define. - - * data.c (MAX_ALLOCA): Remove define. - (Faset): Use SAFE_ALLOCA. - - * editfns.c (Fformat, Ftranspose_regions): Use SAFE_ALLOCA. - - * fns.c (string_make_multibyte, string_to_multibyte) - (string_make_unibyte, Fmapconcat, Fmapcar): Use SAFE_ALLOCA. - (MAX_ALLOCA): Remove define. - (Fbase64_encode_region, Fbase64_encode_string) - (Fbase64_decode_region, Fbase64_decode_string): Use SAFE_ALLOCA. - (Fbase64_encode_region, Fbase64_encode_string): Fix potential - memory leak if encoding fails. - - * xdisp.c (add_to_log): Use SAFE_ALLOCA. - -2004-06-21 Eli Zaretskii <eliz@gnu.org> - - * print.c (Fwith_output_to_temp_buffer): Doc fix. - -2004-06-20 Richard M. Stallman <rms@gnu.org> - - * xfaces.c (Finternal_copy_lisp_face): Small cleanup; doc fix. - - * search.c (match_limit): Cleaner err msg when no match data available. - - * window.c (syms_of_window): Doc fix. - - * keyboard.c (command_loop_1): Handle values `only' and `identity' - for Vtransient_mark_mode. - - * buffer.c (syms_of_buffer): Doc fix. - -2004-06-21 David Kastrup <dak@gnu.org> - - * minibuf.c (Ftry_completion, Fall_completions): Do lazy binding - and unbinding of `case-fold-search' according to - `completion-ignore-case' around calls of string-match and - predicates, respectively. Should give satisfactory performance - in all relevant cases. - -2004-06-17 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.c (x_draw_image_foreground_1): Subtract slice.x/y from - clip_x/y_origin. - - * fns.c (string_to_multibyte): Use xmalloc/xfree instead of alloca. - - * macfns.c (Fx_display_color_cells): Do not limit return value to 256. - - * macterm.c (mac_initialize_display_info): Initialize n_planes correctly - on Mac OSX. - -2004-06-16 Luc Teirlinck <teirllm@auburn.edu> - - * buffer.c (syms_of_buffer): Clarify `fill-column' docstring. - -2004-06-16 Kim F. Storm <storm@cua.dk> - - * dispextern.h (Vimage_types): Remove extern. - -2004-06-16 Miles Bader <miles@gnu.org> - - * image.c (lookup_image_type): Initialize image type if necessary. - -2004-06-15 Kim F. Storm <storm@cua.dk> - - * xdisp.c (try_cursor_movement): Exclude header line from scroll - margin at top of window. - (try_window_reusing_current_matrix): Calculate proper cursor position - after scrolling up with non-zero scroll margin, as the old cursor - position corresponds to value of PT before executing this command. - (try_window_id): Consider scroll margin at bottom of window too; - otherwise we fail to scroll when hl-line-mode is enabled. - - * syntax.c (skip_chars): Only recognize [:class:] when it has the - proper format and class is a lower-case word. - -2004-06-14 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (xg_get_image_for_pixmap): New function. - (xg_get_gdk_pixmap_and_mask): Remove. - (update_frame_tool_bar): Call xg_get_image_for_pixmap instead of - xg_get_gdk_pixmap_and_mask. - - * xterm.h (struct x_display_info): Typo in comment fixed. - -2004-06-14 Juanma Barranquero <lektu@terra.es> - - * dispextern.h (Vimage_types): Make it conditional on - HAVE_WINDOW_SYSTEM. - - * image.c (Vimage_types): Move from xdisp.c. - (Vimage_type_cache): New variable. - (define_image_type): New argument indicating whether an image - library was loaded; cache loaded status and return t on success, - nil otherwise. - (CACHE_IMAGE_TYPE, ADD_IMAGE_TYPE): New macros. - (w32_delayed_load): New function to load an image library from a - list of possible filenames. - (init_xpm_functions, init_png_functions, init_jpeg_functions) - (init_tiff_functions, init_gif_functions): Use `w32_delayed_load'. - (CHECK_LIB_AVAILABLE): Call `define_image_library' with new argument. - (Finit_image_library): New function, extracted from `init_image'. - Try to initialize an image library on demand and cache whether we - were successful or not. - (syms_of_image): Initialize `Vimage_types' and - `Vimage_type_cache'. Add recognized image types to Vimage_types. - Export `init-image-library'. - (init_image): Remove initialization of all image types, except xbm - and pbm. - - * xdisp.c (Vimage_types): Delete (moved to image.c). - -2004-06-14 Andreas Schwab <schwab@suse.de> - - * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion): - Avoid calling specbind when completion-regexp-list is empty. - -2004-06-13 Richard M. Stallman <rms@gnu.org> - - * regex.h (CHAR_CLASS_MAX_LENGTH, re_wctype_t, re_wchar_t) - (re_wctype, re_iswctype, re_wctype_to_bit): - Non-function definitions moved here from regex.c. - - * regex.c (re_wctype, re_iswctype): Function defs longer static. - (CHAR_CLASS_MAX_LENGTH, re_wctype_t, re_wchar_t) - (re_wctype, re_iswctype, re_wctype_to_bit): - Non-function definitions moved to regex.h. - - * window.c (Fselect_window): Doc fix. - - * syntax.c: Include regex.h. - (skip_chars): New arg HANDLE_ISO_CLASSES. Callers changed. - If requested, make a list of classes, then check the scanned - chars for membership in them. - (in_classes): New function. - Doc fix. - - * keyboard.c (cmd_error): Don't call any_kboard_state - if inside a recursive edit level. - -2004-06-13 K,Aa(Broly L$,1 q(Brentey <lorentey@elte.hu> - - * keyboard.c (command_loop): Call any_kboard_state before - command_loop_2 when at top level. - -2004-06-13 Andreas Schwab <schwab@suse.de> - - * print.c (print_object): Always use %ld for printing EMACS_INT. - - * keyboard.c (cancel_hourglass_unwind): Return a value. - (modify_event_symbol): Always use %ld for printing EMACS_INT. - (Fexecute_extended_command): Likewise. - - * syntax.h (SYNTAX_ENTRY_FOLLOW_PARENT): Rename local variable to - avoid clashes. - (SYNTAX): Likewise. - (SYNTAX_WITH_FLAGS): Likewise. - (SYNTAX_MATCH): Likewise. - - * syntax.c (char_quoted): Avoid warning about undefined operation. - (find_defun_start): Likewise. - (scan_lists): Likewise. - (INC_FROM): Likewise. - (scan_sexps_forward): Likewise. - - * image.c: Include <ctype.h>. - - * xfaces.c (face_attr_equal_p): Declare parameters. - -2004-06-13 Kenichi Handa <handa@m17n.org> - - * ccl.c (CCL_READ_CHAR): If hit EOF, set REG to -1. - -2004-06-12 Matthew Mundell <matt@mundell.ukfsn.org> - - * eval.c (Fdefun): Signal an error if NAME is not a symbol. - -2004-06-12 Kenichi Handa <handa@m17n.org> - - * ccl.c (CCL_CALL_FOR_MAP_INSTRUCTION): Save eof_ic in - ccl_prog_stack_struct and update it. - (CCL_INVALID_CMD): If CCL_DEBUG is defined, call ccl_debug_hook. - (CCL_READ_CHAR): Get instruction counter from eof_ic, not from - ccl->eof_ic on EOF. - (ccl_debug_hook): New function. - (struct ccl_prog_stack): New member eof_ic. - (ccl_driver): Handle EOF in subrountine call correctly. - -2004-06-11 Kenichi Handa <handa@m17n.org> - - * coding.c (encode_coding_string): Check CODING_FINISH_INTERRUPT. - -2004-06-11 Kim F. Storm <storm@cua.dk> - - * emacs.c (shut_down_emacs): Inhibit redisplay during shutdown. - -2004-06-11 Juanma Barranquero <lektu@terra.es> - - * keyboard.c (Fposn_at_point): Doc fix. - -2004-06-11 David Kastrup <dak@gnu.org> - - * search.c (match_limit): Don't flag an error if match-data - exceeding the allocated search_regs.num_regs gets requested, just - return Qnil. - -2004-06-08 Miles Bader <miles@gnu.org> - - * xfaces.c (push_named_merge_point): Return 0 when a cycle is detected. - -2004-06-07 Juanma Barranquero <lektu@terra.es> - - * editfns.c (Fuser_login_name, Ffloat_time, Fencode_time) - (Fcurrent_time_string, Fcurrent_time_zone) - (Finsert_buffer_substring, Ftranspose_regions): Doc fixes. - -2004-06-07 Miles Bader <miles@gnu.org> - - * xfaces.c (struct named_merge_point): New type. - (push_named_merge_point): New function. - (merge_named_face): New function. - (merge_face_ref, face_at_buffer_position, face_at_string_position): - Use `merge_named_face'. - (merge_face_inheritance): Function removed. - (merge_face_ref): Rename from `merge_face_vector_with_property'. - Add new `err_msgs' and `named_merge_points' args. Return error - status. Only print error messages if ERR_MSGS is true. Don't try to - do :inherit attribute validation. - (merge_face_heights): Handle `unspecified' in both directions. - (merge_face_vectors): Rename `cycle_check' arg to `named_merge_points'. - Call `merge_face_ref' instead of `merge_face_inheritance'. - (Fdisplay_supports_face_attributes_p, Fface_attributes_as_vector) - (compute_char_face, face_at_buffer_position) - (face_at_string_position): Call `merge_face_ref' instead of - `merge_face_vector_with_property'. - -2004-06-07 Kenichi Handa <handa@m17n.org> - - * coding.c (find_safe_codings): Check NILP (safe_codings) only at - the necessary places. - -2004-06-07 Kim F. Storm <storm@cua.dk> - - * process.c (Fdelete_process): Undo 2004-05-28 change. - Instead, call status_notify also for network process. - (status_message): Use process instead of status as arg. - Give messages "deleted" or "connection broken by remote peer" for - an exited network process. - (status_notify): Change call to status_message. - (read_process_output): Increase readmax to 4096. Do not increase - buffer size for datagram channels (default is now large enough). - -2004-06-06 Steven Tamm <tamm@Steven-Tamms-Computer.local> - - * macfns.c (x_create_tip_frame): Fix Mac OS X 10.1 compilation - problem due to newly defined variable. - -2004-06-06 Miles Bader <miles@gnu.org> - - * xfaces.c (Fdisplay_supports_face_attributes_p): Give up - immediately if non-interactive or not initialized. - -2004-06-05 Richard M. Stallman <rms@gnu.org> - - * minibuf.c (Fcompleting_read): Doc fix. - -2004-06-05 Andreas Schwab <schwab@suse.de> - - * macfns.c (x_create_tip_frame): Fix declaration after statement. - -2004-06-05 Juanma Barranquero <lektu@terra.es> - - * keymap.c (Fdescribe_vector): Fix docstring. - (Fkey_description, Fglobal_key_binding): Fix typo in docstring. - -2004-06-05 Miles Bader <miles@gnu.org> - - * xfaces.c (tty_supports_face_attributes_p): Make sure the specified - attributes have different values than the default face. - -2004-06-04 Eli Zaretskii <eliz@gnu.org> - - * xfaces.c (x_supports_face_attributes_p): Make this function - conditional on HAVE_WINDOW_SYSTEM. - (Fdisplay_supports_face_attributes_p) [HAVE_WINDOW_SYSTEM]: - Don't call x_supports_face_attributes_p if it was not compiled in. - -2004-06-04 Miles Bader <miles@gnu.org> - - * xfaces.c (tty_supports_face_attributes_p): New function, mostly - from Ftty_supports_face_attributes_p. - (x_supports_face_attributes_p): New function. - (Ftty_supports_face_attributes_p): Function deleted. - (Fdisplay_supports_face_attributes_p): New function. - (syms_of_xfaces): Initialize Sdisplay_supports_face_attributes_p. - (face_attr_equal_p): New function. - (lface_equal_p): Use it. - -2004-06-03 Juanma Barranquero <lektu@terra.es> - - * w32fns.c (Fx_display_grayscale_p, Fw32_send_sys_command) - (Vw32_color_map): Fix typo in docstring. - (Fx_create_frame, Fw32_find_bdf_fonts, Fx_show_tip) - (Fw32_unregister_hot_key, Fw32_reconstruct_hot_key): - Make argument names match their use in docstring. - -2004-06-02 Juanma Barranquero <lektu@terra.es> - - Work around bugs/problems with MinGW builds of graphics libraries - called from MSVC builds of Emacs. - - * image.c (lookup_image): Make pointer to img static. - (png_read_from_memory): Disable "global" optimization. - -2004-06-01 Stefan Monnier <monnier@iro.umontreal.ca> - - * eval.c (Fcondition_case): Fix usage. Simplify. - - * mem-limits.h (EXCEEDS_LISP_PTR) [USE_LSB_TAG]: Never true. - -2004-05-29 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macfns.c: Don't include ccl.h. - [MAC_OSX]: Don't include QuickTime/QuickTime.h. - [!MAC_OSX]: Don't include alloca.h, Windows.h, Gestalt.h, or - TextUtils.h. - (Fx_create_frame): Sync with xfns.c. Initialize cursor descriptors. - (Fx_display_mm_height, Fx_display_mm_width): Calculate length from - display height/width. - (compute_tip_xy, Vx_max_tooltip_size): Declare. - (unwind_create_tip_frame, compute_tip_xy): New functions. - (x_create_tip_frame, Fx_show_tip, Fx_hide_tip): Sync with xfns.c. - (syms_of_macfns): Initialize Qcancel_timer, Vx_max_tooltip_size, - and last_show_tip_args. - - * macgui.h [!MAC_OSX]: Include Gestalt.h. - (Cursor, No_Cursor): New defines. - [!TARGET_API_MAC_CARBON] (SetPortWindowPort): New compatibility macro. - [!TARGET_API_MAC_CARBON] (arrow_cursor): Declare. - - * macmenu.c (mac_menu_show, mac_dialog): Use SetPortWindowPort. - - * macterm.c: Don't include Gestalt.h. - (enum mouse_tracking_type, mouse_tracking_in_progress): Remove. - (XDrawLine, XClearArea, XClearWindow, mac_draw_bitmap) - (mac_set_clip_rectangle, mac_reset_clipping, XCreatePixmap) - (XFillRectangle, mac_draw_rectangle, mac_draw_string_common) - (mac_copy_area, mac_copy_area_with_mask, x_update_end) - (construct_mouse_click, XTmouse_position) - (x_scroll_bar_report_motion, x_calc_absolute_position) - (do_mouse_moved, do_zoom_window, mac_do_receive_drag) - (XTread_socket, make_mac_frame): Use SetPortWindowPort. - (note_mouse_movement): Clear the mouse face and reset the pointer - shape when the pointer goes outside the frame without grabbing. - (mac_front_window): New function. - (mac_window_to_frame): New macro. - (XTmouse_position, x_scroll_bar_report_motion, do_window_update) - (do_window_activate, do_window_deactivate, do_app_resume) - (do_app_suspend, do_mouse_moved, do_menu_choice, do_grow_window) - (do_zoom_window, mac_do_receive_drag, XTread_socket) - (mac_check_for_quit_char): Use mac_front_window and/or - mac_window_to_frame. - (x_scroll_bar_handle_click): Set `(PORTION . WHOLE)' part in a - scroll-bar click event. - (mac_define_frame_cursor): Change the pointer shape. - (x_free_frame_resources): Reset tip_window to NULL when it is - disposed of. - [!TARGET_API_MAC_CARBON] (arrow_cursor): New variable. - [!TARGET_API_MAC_CARBON] (do_init_managers): Initialize arrow_cursor. - (do_window_update): Don't do anything if the updated window is the - tooltip window. - (do_mouse_moved): Handle mouse movement events here (previously in - XTread_socket). Clear the mouse face if - dpyinfo->mouse_face_hidden is set. - (do_os_event, do_events): Remove (now in XTread_socket). - (XTread_socket): Immediately return if interrupt_input_blocked. - Loop until all the events in the queue are processed. - Rearrange codes for mouse grabbing. Add tooltip support. Include the - contents of do_os_event and do_events. Remove mouse movement - handling (now in do_mouse_moved). Add the case where - Vmouse_highlight has an integer value. - (NewMacWindow): Remove. - (make_mac_frame): Do what NewMacWindow previously did. Don't do - excess initializations. - (make_mac_terminal_frame): Previous initializations in - make_mac_frame are moved here. - (mac_initialize_display_info): - Initialize dpyinfo->mouse_face_overlay and dpyinfo->mouse_face_hidden. - - * xdisp.c [MAC_OS] (No_Cursor): Remove variable. - (define_frame_cursor1): Don't treat HAVE_CARBON as a special case. - -2004-05-29 Richard M. Stallman <rms@gnu.org> - - * lisp.h (truncate_undo_list): Update decl. - - * alloc.c (undo_outer_limit): New variable. - (syms_of_alloc): Defvar it. - (Fgarbage_collect): Pass undo_outer_limit to truncate_undo_list. - - * undo.c (truncate_undo_list): New arg LIMITSIZE. - - * alloc.c (lisp_align_malloc): Check for base == 0 - regardless of HAVE_POSIX_MEMALIGN. - Clean up HAVE_POSIX_MEMALIGN handling of `err'. - -2004-05-28 Stefan Monnier <monnier@iro.umontreal.ca> - - * alloc.c: Undo Kim's recent changes and fix the same bug differently. - (marker_blocks_pending_free): Remove. - (Fgarbage_collect): Sweep after cleaning up undo-lists. - Mark the undo lists after claning them up. - Don't free block in marker_blocks_pending_free. - (mark_buffer): Don't mark undo_list. - (gc_sweep): Sweep hash-tables and strings first. - Do free marker blocks that are empty. - -2004-05-28 Jim Blandy <jimb@redhat.com> - - * regex.c (print_partial_compiled_pattern): Add missing 'break' - after 'case wordend'. For symbeg and symend, print to stderr, - like the other cases. - -2004-05-28 Noah Friedman <friedman@splode.com> - - * process.c (Fdelete_process): Do not call remove_process. - -2004-05-28 Stefan Monnier <monnier@iro.umontreal.ca> - - * alloc.c (struct backtrace): Remove. - (Fgarbage_collect): Use the new mark_backtrace. - - * eval.c (mark_backtrace): New function. - - * minibuf.c (run_exit_minibuf_hook): New function. - (read_minibuf_unwind): Don't run exit-minibuffer-hook any more. - (read_minibuf): Use separate unwind handler to run exit-minibuf-hook. - -2004-05-27 Kim F. Storm <storm@cua.dk> - - * xdisp.c (back_to_previous_visible_line_start): Skip backwards - over display properties, e.g. images, that replace buffer text. - -2004-05-25 Kim F. Storm <storm@cua.dk> - - * alloc.c (marker_blocks_pending_free): New var. - (gc_sweep): Store free marker blocks on that list. - (Fgarbage_collect): Free them after undo-list cleanup. - - * process.c (wait_reading_process_input): Check connect_wait_mask - before actually accepting connection in case it has already been - accepted due to recursion. - -2004-05-23 K,Aa(Broly L$,1 q(Brentey <lorentey@elte.hu> - - * coding.c (Fset_safe_terminal_coding_system_internal): - Set suppress_error in safe_terminal_coding, not terminal_coding. - -2004-05-22 Richard M. Stallman <rms@gnu.org> - - * alloc.c (Fmake_string): Doc fix. - - * buffer.c (clone_per_buffer_values): Copy the alist of local vars, - and the alist pairs too. - - * casefiddle.c (casify_object): Return OBJ unchanged if not real char. - - * emacs.c (main): Update copyright year. - - * fileio.c (Fread_file_name): Expand DIR if not absolute. - - * insdel.c (del_range_2, replace_range): Don't write an anchor - if the gap is empty. - - * xdisp.c (try_scrolling): If scroll-up-aggressively or - scroll-down-aggressively is small but positive, put point - near the screen edge. - -2004-05-22 Juanma Barranquero <lektu@terra.es> - - * keymap.c (Fdefine_key): Doc fix. - -2004-05-22 Kim F. Storm <storm@cua.dk> - - * alloc.c (struct backtrace): Add debug_on_exit member. - (Fgarbage_collect): Clear out buffer undo_list markers after gc_sweep. - Identify those markers as Lisp_Misc_Free objects. Clear car and cdr of - the removed cons cells. - (mark_object): Undo previous change - disallow Lisp_Misc_Free objects. - (gc_sweep): Clear cons_blocks before sweeping strings, so we don't have - any cons cells pointing to unallocated stings. - Do not lisp_free any marker blocks, as there may still be pointers - to them from buffer undo lists at this stage of GC. - - * keyboard.c (struct backtrace): Add debug_on_exit member. - (Fcommand_execute): Clear it. - -2004-05-20 Luc Teirlinck <teirllm@auburn.edu> - - * intervals.c (lookup_char_property): Do not prematurely return nil. - -2004-05-19 Jim Blandy <jimb@redhat.com> - - Add support for new '\_<' and '\_>' regexp operators, matching the - beginning and end of symbols. - - * regex.c (enum syntaxcode): Add Ssymbol. - (init_syntax_once): Set the syntax for '_' to Ssymbol, not Sword. - (re_opcode_t): New opcodes `symbeg' and `symend'. - (print_partial_compiled_pattern): Print the new opcodes properly. - (regex_compile): Parse the new operators. - (analyse_first): Skip sym(beg|end) (they match only the empty string). - (mutually_exclusive_p): `symend' is mutually exclusive with \s_ and - \sw; `symbeg' is mutually exclusive with \S_ and \Sw. - (re_match_2_internal): Match symbeg and symend. - - * search.c (trivial_regexp_p): \_ is no longer a trivial regexp. - -2004-05-19 Kim F. Storm <storm@cua.dk> - - * .gdbinit (xsymbol): Fix last change. - -2004-05-18 Stefan Monnier <monnier@iro.umontreal.ca> - - * .gdbinit (xprintstr): New fun. - (xstring, xprintsym): Use it. - - * w32proc.c (create_child): Use INTMASK. - - * alloc.c (Fgarbage_collect): Do all the marking before flushing - unmarked elements of the undo list. - -2004-05-18 David Ponce <david@dponce.com> - - * print.c (print): Reset print_depth before to call print_object. - -2004-05-18 Jason Rumney <jasonr@gnu.org> - - * w32console.c: Prefix RIF functions with w32con_ to avoid - namespace clash with functions in term.c and w32term.c. - - * w32menu.c (add_menu_item, w32_menu_display_help) - [USE_LISP_UNION_TYPE]: Cast from Lisp_Object using i member. - - * w32term.h (display_x_get_resource, vga_stdcolor_name): Add prototype. - -2004-05-18 Eli Zaretskii <eliz@gnu.org> - - * lisp.h (DECL_ALIGN): Remove restriction on MS-DOS systems. - - * msdos.c (syms_of_msdos): Initialize dos-unsupported-char-glyph - with make_number. - (IT_write_glyphs): Extract glyph from dos-unsupported-char-glyph - with XINT. - -2004-05-18 Kim F. Storm <storm@cua.dk> - - * blockinput.h (INPUT_BLOCKED_P): New macros. - - * keyboard.c (Frecursive_edit): Return immediately if input blocked. - (Ftop_level): Unblock input if blocked. - - * buffer.h (GET_OVERLAYS_AT): New macro. - * msdos.c (IT_note_mouse_highlight): Use it. - * textprop.c (get_char_property_and_overlay): Use it. - * xdisp.c (next_overlay_change, note_mouse_highlight): Use it. - * xfaces.c (face_at_buffer_position): Use it. - - * print.c (print_object): Increase buf size. - -2004-05-17 Jason Rumney <jasonr@gnu.org> - - * w32fns.c (Fw32_register_hot_key, Fw32_unregister_hot_key) - (Fw32_toggle_lock_key) [USE_LISP_UNION_TYPE]: Cast from - Lisp_Object using i member. - (w32_quit_key): Rename from Vw32_quit_key, and make an int. - (syms_of_w32fns, globals_of_w32fns): Use Lisp_Object and int - consistently. - - * w32proc.c (create_child): Use make_number instead of masking pid. - - * w32fns.c (w32_color_map_lookup): Return a Lisp_Object. - (x_to_w32_charset, w32_to_x_charset, w32_to_all_x_charsets): - Use EQ to compare Lisp_Objects. - (w32_parse_hot_key): Use int for lisp_modifiers consistently. - - * w32term.c (w32_num_mouse_buttons): Rename from - Vw32_num_mouse_buttons and make it an int. - - * w32.c (init_environment): Use it. - - * w32fns.c (w32_wnd_proc): Likewise. - - * w32proc.c (w32_pipe_read_delay): Rename from - Vw32_pipe_read_delay and make it an int. - - * w32.c (_sys_read_ahead): Use it. - - * lisp.h (egetenv) [USE_CRT_DLL]: Remove condition. - - * w32proc.c (create_child) [USE_LSB_TAG]: Don't try to mask pid. - - * w32inevt.c (w32_console_mouse_position, do_mouse_event) - (key_event): Don't mix Lisp_Object and int. - - * w32heap.c (init_heap) [USE_LSB_TAG]: Don't check heap location. - - * keyboard.c (kbd_buffer_get_event): Don't use event->code and - modifiers in language change event. - -2004-05-17 Kim F. Storm <storm@cua.dk> - - * alloc.c (mark_object): Ignore Lisp_Misc_Free objects. - Such objects may be freed markers which still exist on an undo list. - -2004-05-16 Juanma Barranquero <lektu@terra.es> - - * data.c (Fset_default): Make argument names match their use in - docstring. - -2004-05-15 Andreas Schwab <schwab@suse.de> - - * emacs.c (gdb_array_mark_flag): Define. - * .gdbinit: Mask off gdb_array_mark_flag from vector sizes. - -2004-05-15 Eli Zaretskii <eliz@gnu.org> - - * lisp.h (DECL_ALIGN) [MSDOS]: Don't define DECL_ALIGN to use - __attribute__((__aligned__)), so that USE_LSB_TAG would not become - defined for the MS-DOS build. - -2004-05-14 Stefan Monnier <monnier@iro.umontreal.ca> - - * w32fns.c (Fw32_define_rgb_color): Avoid XSET. - -2004-05-14 Kenichi Handa <handa@m17n.org> - - * ccl.c (Fccl_execute_on_string): Fix setting elements of STATUS. - -2004-05-14 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * lisp.h (Vx_resource_name, Vx_resource_class): Move from xfns.c - section to frame.c section. - (Fxw_display_color_p, Fx_file_dialog): Declare if - HAVE_WINDOW_SYSTEM defined. - - * macfns.c (Fx_create_frame): Fix int/Lisp_Object mixup. - - * macmenu.c (set_frame_menubar): Use NILP to test a lisp value. - - * macterm.c (mac_get_emulated_btn, mac_event_to_emacs_modifiers) - (mac_get_mouse_btn): Use NILP and EQ to test/compare lisp values. - (XTread_socket): Fix int/Lisp_Object mixup. - (mac_check_for_quit_char): Fix pointer/Lisp_Object mixup. - - * macterm.h (struct frame, struct face, struct image) - (display_x_get_resource, Fx_display_color_p) - (Fx_display_grayscale_p, Fx_display_planes, x_free_gcs): - Add prototypes. - -2004-05-14 Kim F. Storm <storm@cua.dk> - - * process.c (wait_reading_process_input): Make reentrant. - Make Available and Connecting non-static. Save and restore value - of waiting_for_user_input_p. - -2004-05-13 Kim F. Storm <storm@cua.dk> - - * keyboard.c (mark_kboards): Don't mark x and y members - that are overloaded in selection request events. - -2004-05-13 Stefan Monnier <monnier@iro.umontreal.ca> - - * lisp.h (USE_LSB_TAG): Make it the default when it is known to work. - -2004-05-13 Glenn Morris <gmorris@ast.cam.ac.uk> - - * window.c (Fdisplay_buffer, Fsplit_window) - (split-height-threshold): Doc fix. - -2004-05-13 Juanma Barranquero <lektu@terra.es> - - * xfaces.c (Ftty_supports_face_attributes_p) - (Finternal_copy_lisp_face): Fix typo in docstring. - (Finternal_get_lisp_face_attribute): Fix docstring. - -2004-05-12 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xfns.c (syms_of_xfns): Provide x-toolkit also for GTK. - -2004-05-11 Steven Tamm <steventamm@mac.com> - - * macfns.c (Fx_create_frame): Default to using tool-bar by - setting tool-bar-lines to 1 in default-frame-alist. - -2004-05-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * image.c (xpm_scan, xpm_make_color_table_v, xpm_put_color_table_v) - (xpm_get_color_table_v, xpm_make_color_table_h) - (xpm_put_color_table_h, xpm_get_color_table_h) - (xpm_str_to_color_key, xpm_load_image, xpm_load) - (syms_of_image): Support XPM on Carbon Emacs. Does not - depend on libXpm, but only supports XPM version 3 without extensions. - -2004-05-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macterm.c (x_flush, XTframe_up_to_date): Use FRAME_MAC_P - instead of FRAME_X_P. - -2004-05-11 Kim F. Storm <storm@cua.dk> - - * process.c (read_process_output): Grow decoding_buf when needed; - this could cause a crash in allocate_string and compact_small_strings. - -2004-04-29 Jim Blandy <jimb@redhat.com> - - * regex.c (mutually_exclusive_p): In 'case wordbeg', compare op2 - against proper opcode. - -2004-05-10 Juanma Barranquero <lektu@terra.es> - - * process.c (Fstart_process): Fix docstring. - - * charset.c (Fget_unused_iso_final_char): Fix typos in docstring. - (Fchar_bytes, Fchar_width, Fstring_width, Fchar_direction) - (Fsplit_char, Fchar_charset): Make argument names match their use - in docstring. - -2004-05-10 Richard M. Stallman <rms@gnu.org> - - * print.c (print_preprocess): Use being_printed, loop_count and - halftail to detect overdeep nesting and cyclic cdr chains. - -2004-05-10 Andreas Schwab <schwab@suse.de> - - * lisp.h (Fmake_symbolic_link): Declare. - - * fileio.c (Frename_file): Remove extra argument in call to - Fmake_symbolic_link. - -2004-05-10 Kim F. Storm <storm@cua.dk> - - * xdisp.c (calc_line_height_property): Use string position when - object is a string. - -2004-05-10 Kenichi Handa <handa@m17n.org> - - * print.c (temp_output_buffer_setup): Bind inhibit-read-only and - inhibit-modification-hooks to t temporarily before calling - Ferase_buffer. - - * xfns.c (x_create_tip_frame): Bind inhibit-read-only and - inhibit-modification-hooks to t temporarily before calling - Ferase_buffer. - - * w32fns.c (x_create_tip_frame): Bind inhibit-read-only and - inhibit-modification-hooks to t temporarily before calling - Ferase_buffer. - - * fns.c (count_combining): Delete it. - (concat): Don't check combining bytes. - -2004-05-09 Jason Rumney <jasonr@gnu.org> - - * w32fns.c (Vw32_ansi_code_page): New Lisp variable. - (globals_of_w32fns): Set it. - -2004-05-09 Piet van Oostrum <piet@cs.uu.nl> - - * data.c (Fquo): Simplify. - -2004-05-08 Peter Whaite <emacs@whaite.ca> (tiny change) - - * data.c (Fquo): If any argument is float, do the computation in - floating point. - -2004-05-08 Juanma Barranquero <lektu@terra.es> - - * process.c (Fwaiting_for_user_input_p, Fmake_network_process) - (Fset_process_query_on_exit_flag, Vprocess_adaptive_read_buffering): - Fix spelling of Emacs on docstring. - (Fset_process_coding_system, Fprocess_coding_system) - (Fset_process_filter_multibyte, Fprocess_filter_multibyte_p): - Make argument names match their use in docstring. - (Fprocess_id, Fprocess_query_on_exit_flag, Finterrupt_process): - Fix docstring. - - * editfns.c (Finsert_buffer_substring): Make argument names match their - use in docstring. - - * syntax.c (Fmodify_syntax_entry): Fix docstring. - -2004-05-07 Steven Tamm <steventamm@mac.com> - - * macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT - around call to ReceiveEvent to avoid certain crashes. - -2004-05-07 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macterm.c (mac_draw_line_to_pixmap, XCreatePixmapFromBitmapData) - (mac_fill_rectangle_to_pixmap, mac_draw_rectangle_to_pixmap) - (mac_copy_area_to_pixmap, mac_copy_area_with_mask_to_pixmap): - Save/restore the current graphics port and device handle when - drawing into an offscreen graphics world. - - * image.c [MAC_OS] (XPutPixel, XGetPixel, image_load_qt_1) - (gif_load): Likewise. - -2004-05-07 Juanma Barranquero <lektu@terra.es> - - * window.c (Fset_window_buffer): Fix docstring. - -2004-05-06 Thien-Thi Nguyen <ttn@gnu.org> - - * emacs.c (main) [VMS]: Fix var ref. - -2004-05-06 Romain Francoise <romain@orebokech.com> - - * data.c (Fsetq_default): Fix docstring. - -2004-05-06 Jason Rumney <jasonr@gnu.org> - - * image.c (Display) [HAVE_NTGUI]: Redefine while loading xpm.h - to avoid name clash. - -2004-05-04 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * fileio.c (barf_or_query_if_file_exists): Use lstat. - (Frename_file): Handle renaming of symlinks across file systems. - (Frename_file): Put symlink handling inside #ifdef S_IFLNK. - -2004-05-04 Kim F. Storm <storm@cua.dk> - - * xdisp.c (Qtotal): New var. - (syms_of_xdisp): Intern and staticpro it. - (calc_line_height_property): New arg total. Set it if - line-spacing property has format (total . VALUE). - (x_produce_glyphs): Ignore line-spacing if line-height is 0. - Handle total line-spacing property. - -2004-05-03 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (xg_update_scrollbar_pos): Call XClearWindow to clear - "under" scroll bar when size/position changes. - -2004-05-03 Jason Rumney <jasonr@gnu.org> - - * makefile.nt: Remove. - -2004-05-02 Eli Zaretskii <eliz@gnu.org> - - * syntax.h (SET_RAW_SYNTAX_ENTRY, SYNTAX_ENTRY_INT): - Avoid compiler warnings. - - * Makefile.in (region-cache.o): Depend on config.h. - -2004-05-02 Romain Francoise <romain@orebokech.com> - - * indent.c (compute_motion): Save vpos in prev_vpos when dealing - with continuation lines, too. - -2004-05-02 Thien-Thi Nguyen <ttn@gnu.org> - - * syssignal.h (init_signals): Move decl outside `#ifdef POSIX_SIGNALS'. - -2004-05-01 Stefan Monnier <monnier@iro.umontreal.ca> - - * xdisp.c (calc_line_height_property): YAILOM (yet another - int/Lisp_Object mixup). - -2004-05-01 Eli Zaretskii <eliz@gnu.org> - - * msdos.c (top-level): Add "#pragma pack(0)" after <dir.h>, to - undo bad effect of pack(4) in some versions of system headers. - -2004-05-01 Jason Rumney <jasonr@gnu.org> - - * w32term.c (x_draw_hollow_cursor): Sync with xterm.c. - -2004-04-30 Kim F. Storm <storm@cua.dk> - - * buffer.c (syms_of_buffer) <line-spacing>: Allow float value. - (syms_of_buffer) <cursor-type>: Doc fix. - - * dispextern.h (struct it): Remove member use_default_face. - Add members override_ascent, override_descent, override_boff. - - * xdisp.c (init_iterator): Handle line-spacing float value. - Initialize override_ascent member. - (append_space_for_newline): Reset override_ascent. - Remove use_default_face. - (calc_line_height_property): New function to calculate value of - line-height and line-spacing properties. Look at overlays, too. - Set override_ascent, override_descent, override_boff members when - using another face than the current face. Float values are now - relative to the frame default font, by default; accept a cons - of ratio and face name to specify value relative to a specific face. - (x_produce_glyphs): Use calc_line_height_property. - Use override_ascent etc. when set to handle different face heights. - A negative line-spacing property value is interpreted as a total - line height, rather than inter-line spacing. - (note_mouse_highlight): Allocate room for 40 overlays initially. - -2004-04-29 Stefan Monnier <monnier@iro.umontreal.ca> - - * data.c (Fsubr_name): New fun. - (syms_of_data): Defsubr it. - -2004-04-29 Kim F. Storm <storm@cua.dk> - - * xdisp.c (null_glyph_slice): New var. - (append_glyph, append_composite_glyph, append_stretch_glyph): - Use it to initialize glyph slice. - -2004-04-27 Stefan Monnier <monnier@iro.umontreal.ca> - - * xdisp.c (x_produce_glyphs): Fix the proverbial int/Lisp_Object mixup. - (on_hot_spot_p): Make sure we always return a value. - (Flookup_image_map): Remove unused var ix and iy. - (note_mode_line_or_margin_highlight): Remove unused var `image'. - -2004-04-27 Eli Zaretskii <eliz@gnu.org> - - * msdos.c (init_environment): If one of the TMP... environment - variables is set to a drive letter without a trailing slash, - append a slash. - -2004-04-27 Matthew Mundell <matt@mundell.ukfsn.org> - - * editfns.c (lisp_time_argument): Provide externally. - - * fileio.c (Fset_file_times): New function. - (syms_of_fileio): Intern and staticpro it. - -2004-04-27 Kim F. Storm <storm@cua.dk> - - * xdisp.c (x_produce_glyphs): Fix last change; handle newline in - header line strings. - - * dispextern.h (struct it): New member use_default_face. - - * xdisp.c (Qline_height): New variable. - (syms_of_xdisp): Intern and staticpro it. - (append_space_for_newline): Partially undo 2004-04-25 change; - add default_face_p arg, and restore callers. - Clear it->use_default_face after use. - (x_produce_glyphs): Set default font for ascii char if - it->use_default_font is set. Change line-spacing property to set - just extra line spacing. Handle new line-height property. - -2004-04-26 Andreas Schwab <schwab@suse.de> - - * print.c (print_object): Print non-ascii characters in bool - vector representation as octal escapes. - - * lisp.h (BOOL_VECTOR_BITS_PER_CHAR): Define. - * print.c (print_object): Use it instead of BITS_PER_CHAR for - bool vectors. - * lread.c (read1): Likewise. - * alloc.c (Fmake_bool_vector): Likewise. - * data.c (Faref, Faset): Likewise. - * fns.c (Fcopy_sequence, concat, internal_equal, Ffillarray) - (mapcar1): Likewise. - -2004-04-26 Steven Tamm <tamm@Steven-Tamms-Computer.local> - - * lread.c (init_lread): Fix typo in HAVE_CARBON test logic. - -2004-04-26 Miles Bader <miles@gnu.org> - - * lisp.h (CYCLE_CHECK): Macro moved from xfaces.c. - -2004-04-26 Juanma Barranquero <lektu@terra.es> - - * buffer.c (Fpop_to_buffer): Fix docstring. - -2004-04-26 Steven Tamm <steventamm@mac.com> - - * lread.c (init_lread): Don't display missing lisp directory - warnings with Carbon Emacs because self-contained bundled Emacs - may be built without correct installation path. - -2004-04-25 Kim F. Storm <storm@cua.dk> - - * macterm.c (x_draw_hollow_cursor): Fix height of box for narrow lines. - - * xterm.c (x_draw_hollow_cursor): Fix height of box for narrow lines. - - * xdisp.c (append_space_for_newline): Rename from append_space. - Remove DEFAULT_FACE_P arg; always use current face. Callers changed. - (x_produce_glyphs): Handle line-spacing property on newline char. - If value is t, adjust ascent and descent to fit current row height. - If value is an integer or float, set extra_line_spacing to integer - value, or to float value x current line height. - -2004-04-23 Kenichi Handa <handa@m17n.org> - - * fontset.c (Finternal_char_font): If POSITION is nil, return - font for displaying CH with the default face. - -2004-04-23 Juanma Barranquero <lektu@terra.es> - - * makefile.w32-in: Add "-*- makefile -*-" mode tag. - -2004-04-21 Stefan Monnier <monnier@iro.umontreal.ca> - - * lisp.h (XINT) [EXPLICIT_SIGN_EXTEND && !NO_UNION_TYPE]: - Don't make assumptions about the relative place of i and val. - (EQ) [!NO_UNION_TYPE]: Don't forget to check the type match as well. - -2004-04-21 Kim F. Storm <storm@cua.dk> - - * dispextern.h (struct glyph_slice): New struct. - (struct glyph): New member slice. - (GLYPH_SLICE_EQUAL_P): New macro. - (GLYPH_EQUAL_P): Use it. - (struct glyph_string): New member slice. - (struct it_slice): New struct. - (struct it): New member slice, add member to stack too. - New member constrain_row_ascent_descent_p. - (image_ascent): Add prototype. - - * dispnew.c (buffer_posn_from_coords): Return full image width - and height even for image slices (posn is relative to full image). - (marginal_area_string): Adjust x0,y0 for image slice. - - * image.c (image_ascent): Add slice arg; calculate ascent for - image slice (or full image). - - * keyboard.c (Fposn_at_x_y, Fposn_at_point): New defuns. - (syms_of_keyboard): Defsubr them. - - * lisp.h (pos_visible_p): Fix prototype. - - * macterm.c (x_draw_relief_rect): Add top_p and bot_p args. - (x_draw_glyph_string_box): Fix call to x_draw_relief_rect. - (x_draw_image_foreground, x_draw_image_relief) - (x_draw_image_foreground_1, x_draw_image_glyph_string): - Draw sliced images. - - * w32term.c (w32_draw_relief_rect): Add top_p and bot_p args. - (x_draw_glyph_string_box): Fix call to x_draw_relief_rect. - (x_draw_image_foreground, x_draw_image_relief) - (w32_draw_image_foreground_1, x_draw_image_glyph_string): - Draw sliced images. - - * w32term.h (image_ascent): Remove prototype. - - * window.c (Fpos_visible_in_window_p): Return pixel position if - PARTIALLY arg is non-nil. Simplify. Doc fix. - (Fwindow_vscroll, Fset_window_vscroll): Add optional PIXEL_P arg - to return/set vscroll in pixels. - - * window.h (Fwindow_vscroll, Fset_window_vscroll): Fix EXFUN. - - * xdisp.c (Qslice): New variable. - (syms_of_xdisp): Intern and staticpro it. - (pos_visible_p): Return pixel position in new x and y args. - (init_iterator): Reset it->slice info. - (handle_display_prop): Parse (slice ...) property. - (push_it, pop_it): Save/restore slice info. - (make_cursor_line_fully_visible): Fix 2004-04-14 change. Do not - force repositioning of tall row if window is vscrolled, as that - would reset vscroll. - (append_space): Set it->constrain_row_ascent_descent_p to avoid - increasing row height if row is non-empty. - (fill_image_glyph_string): Copy slice info. - (take_vertical_position_into_account): Simplify. - (produce_image_glyph): Handle iterator slice info, setup glyph - slice info. Do not force minimum line height. - (x_produce_glyphs): If it->constrain_row_ascent_descent_p is set, - do not increase height (ascent/descent) of non-empty row when - adding normal character glyph; instead reduce glyph ascent/descent - appropriately; if row is higher than current glyph, adjust glyph - descent/ascent to reposition glyph within the existing row. - Likewise, when char is newline, only set ascent/descent if row is - currently empty. - (note_mouse_highlight): Handle hotspots with sliced image. - - * xterm.c (x_draw_relief_rect): Add top_p and bot_p args. - (x_draw_glyph_string_box): Fix call to x_draw_relief_rect. - (x_draw_image_foreground, x_draw_image_relief) - (x_draw_image_foreground_1, x_draw_image_glyph_string): - Draw sliced images. - - * xterm.h (image_ascent): Remove prototype. - -2004-04-20 Stefan Monnier <monnier@iro.umontreal.ca> - - * keymap.c (Fkey_description): Fix the usual int/Lisp_Object mixup. - -2004-04-20 John Paul Wallington <jpw@gnu.org> - - * fns.c (Fassoc, Feql): Fix indentation. - - * fontset.c (regularize_fontname): Rename from regulalize_fontname. - -2004-04-19 John Paul Wallington <jpw@gnu.org> - - * fns.c (Feql): New function. - (syms_of_fns): Defsubr it. - -2004-04-18 Jason Rumney <jasonr@gnu.org> - - * w32select.c (Fw32_set_clipboard_data): Get sequence number - after closing the clipboard. - -2004-04-16 Luc Teirlinck <teirllm@auburn.edu> - - * buffer.c (Fbuffer_base_buffer): Doc fix. - -2004-04-17 Kim F. Storm <storm@cua.dk> - - * keymap.c (Fkey_description): Add optional PREFIX arg. - Combine prefix with KEYS to make up the full key sequence to describe. - Correlate meta_prefix_char and following (simple) key to describe - as meta modifier. All callers changed. - (describe_map): Rename arg `keys' to `prefix'. Remove local - `elt_prefix' var. Use Fkey_description with prefix instead of - elt_prefix combined with Fsingle_key_description. - (describe_vector): Declare static. Replace arg `elt_prefix' with - `prefix'. Add KEYMAP_P arg. Add local var `elt_prefix'; use it - if !KEYMAP_P. Use Fkey_description with prefix instead of - Fsingle_key_description. - - * keymap.h (Fkey_description): Fix prototype. - (describe_vector): Remove prototype. - - * xdisp.c (update_overlay_arrows): Fix handling of up_to_date < 0. - - * image.c (PNG_BG_COLOR_SHIFT): Remove. - (png_load): Fix calculation of transparent background color on X - and W32 platforms. - -2004-04-16 Juanma Barranquero <lektu@terra.es> - - * xdisp.c (try_scrolling): Make sure `scroll-conservatively' is - not too large before computing how much to scroll. - -2004-04-15 Stefan Monnier <monnier@iro.umontreal.ca> - - * dired.c (Ffile_attributes): Don't pass extra nil arg to file-handler. - -2004-04-14 Luc Teirlinck <teirllm@auburn.edu> - - * fileio.c (Fverify_visited_file_modtime, Fvisited_file_modtime): - Add hyperlink to Elisp manual to the docstring. - -2004-04-14 Stefan Monnier <monnier@iro.umontreal.ca> - - * callint.c (fix_command): Use XDCR. - -2004-04-14 Nick Roberts <nick@nick.uklinux.net> - - * window.c (Fget_lru_window): Doc fix. - -2004-04-14 Kim F. Storm <storm@cua.dk> - - * editfns.c (Fformat): Fix allocation size of precision array. - - * dispnew.c (update_window): Only set changed_p if - scrolling_window actually did scroll. - (scrolling_window): Only return 1 if we actually did scroll. - - * xdisp.c (get_glyph_string_clip_rect): Fix reduction of cursor - height to glyph height when cursor row is not fully visible. - (make_cursor_line_fully_visible): Add FORCE_P arg to return - failure in case row is higher than window. Callers changed. - (try_scrolling): Fix loop in scrolling if last_line_misfit (from Gerd). - Try to scroll partially visible, higher-than-window cursor row. - (redisplay_window): Always try to scroll partially visible, - higher-than-window cursor row - both initially and again with - centering_position = 0. - Clear desired matrix before retrying with centering_position = 0. - -2004-04-13 Stefan Monnier <monnier@iro.umontreal.ca> - - * syntax.c (scan_lists): Simplify backward string scan. - Fix off-by-one boundary check for string and comment fences. - -2004-04-13 Joe Buehler <jbuehler@hekimian.com> - - * sheap.c, unexcw.c: New files. - -2004-04-12 Luc Teirlinck <teirllm@auburn.edu> - - * buffer.c (Fmake_indirect_buffer): Throw an error if the intended - base buffer has been killed. Correct the error message if the - base buffer does not exist. - -2004-04-12 Joe Buehler <jbuehler@hekimian.com> - - * s/cygwin.h: Changes for Cygwin unexec() support, changes in - Cygwin itself. Add support for Xaw3d scrollbars. - - * puresize.h: Set up PURE_P() for Cygwin unexec() support. - - * lastfile.c: Define my_endbss[] for Cygwin unexec() support. - - * gmalloc.c (__default_morecore): Use bss_sbrk(), not __sbrk(), - before Cygwin unexec. - - * Makefile.in: Link changes for Cygwin unexec() support. - -2004-04-12 Andreas Schwab <schwab@suse.de> - - * buffer.c (Fmake_indirect_buffer): Check that NAME is a string. - -2004-04-11 Luc Teirlinck <teirllm@auburn.edu> - - * buffer.c (Fgenerate_new_buffer_name): Return NAME argument if - IGNORE argument equals NAME. Doc fix. - -2004-04-11 Masatake YAMATO <jet@gyve.org> - - * buffer.c (fix_start_end_in_overlays): Make overlays - empty if they are backwards. - -2004-04-09 Stefan Monnier <monnier@iro.umontreal.ca> - - * xfaces.c (face_color_supported_p): Fix compilation without X11. - -2004-04-07 Stefan Monnier <monnier@iro.umontreal.ca> - - * doc.c (Fsnarf_documentation): Ignore new file name entries. - -2004-04-06 Kim F. Storm <storm@cua.dk> - - * msdos.c (clear_mouse_face): Only clear mouse highlight if not hidden. - (dos_rawgetc): Set mouse_face_hidden after clearing highlight. - - * w32term.c (w32_read_socket): Set mouse_face_hidden after - clearing highlight. - - * xdisp.c (clear_mouse_face): Only clear mouse highlight if not hidden. - - * xterm.c (handle_one_xevent): Set mouse_face_hidden after - clearing highlight. - - * indent.c (vmotion): Do not reserve one column for continuation - marks on window frames. - -2004-04-04 Eli Zaretskii <eliz@gnu.org> - - * charset.h (SINGLE_BYTE_CHAR_P): Fix macro to avoid warnings - from GCC. - -2004-04-03 Stefan Monnier <monnier@iro.umontreal.ca> - - * .gdbinit-union: Remove. - - * .gdbinit: Make it work for USE_LSB_TAG and !NO_LISP_UNION. - (xgetptr, xgetint, xgettype): New funs. Use them everywhere. - ($nonvalbits): Remove. - ($valmask): Set it by calling xreload to avoid redundancy. - - * emacs.c (gdb_use_union, gdb_use_lsb): New vars. - (gdb_emacs_intbits): Remove. - -2004-03-31 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * data.c (Fbyteorder): Make test work even if unsigned is not 4 bytes. - -2004-03-30 Kenichi Handa <handa@m17n.org> - - * editfns.c (Fformat): Fix initialization of the array info. - -2004-03-30 Kim F. Storm <storm@cua.dk> - - * xterm.c (x_mouse_click_focus_ignore_position): New var. - (syms_of_xterm): DEFVAR_BOOL it. - (ignore_next_mouse_click_timeout): New var. - (handle_one_xevent): Clear it on KeyPress, set it on EnterNotify. - Use it to filter mouse clicks following focus event. - -2004-03-29 David Ponce <david@dponce.com> - - * callint.c (Fcall_interactively): Fix last change. - -2004-03-28 Stefan Monnier <monnier@iro.umontreal.ca> - - * eval.c (Fcommandp): Simplify. - - * data.c (Finteractive_form): Rename from Fsubr_interactive_form. - Extend to handle all kinds of functions. - - * lisp.h (Finteractive_form): Declare. - - * callint.c (Fcall_interactively): Use it. - -2004-03-26 Kim F. Storm <storm@cua.dk> - - * xdisp.c (syms_of_xdisp): Include `void-variable' in list_of_error - to catch errors in calc_pixel_width_or_height during redisplay. - -2004-03-26 Masatake YAMATO <jet@gyve.org> - - * buffer.c (fix_start_end_in_overlays): Rename fix_overlays_in_range. - - * lisp.h (fix_start_end_in_overlays): Likewise. - - * insdel.c (adjust_markers_for_insert): Call fix_start_end_in_overlays. - - * editfns.c (Ftranspose_regions): Likewise. - -2004-03-20 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.c (handle_one_xevent): Do not pass key press events to GTK. - -2004-03-19 Richard M. Stallman <rms@gnu.org> - - * s/sol2-6.h: Delete previous change. - -2004-03-19 Kim F. Storm <storm@cua.dk> - - * xdisp.c (move_it_in_display_line_to): Fix MOVE_TO_POS case when - to_charpos corresponds to newline in right fringe. Use local - BUFFER_POS_REACHED_P macro. - -2004-03-19 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xdisp.c (calc_pixel_width_or_height): Add ifdef HAVE_WINDOW_SYSTEM - to compile on non-window system. - -2004-03-19 Kim F. Storm <storm@cua.dk> - - * dispextern.h (calc_pixel_width_or_height): Add prototype. - - * image.c (Qcenter): Move to xdisp.c. - - * xdisp.c (Qcenter): Declare here. - (syms_of_xdisp): Intern and staticpro it. - (handle_single_display_prop): Allow space display property on all - platforms. - (display_mode_line): Set mode_line_p before displaying line. - (calc_pixel_width_or_height): Declare extern. Add separate :align-to - handling. Remove complex cases for fringes and scroll-bars. - Add left, right, and center alignment positions. Add text (area) - width/height. Return width or height for image specs. - (produce_stretch_glyph): Improve handling of :align-to. Is now - relative to left of text area by default, but other base offsets - can be specified -- also for text lines. - - * term.c (produce_glyphs): Handle IT_STRETCH. - (produce_stretch_glyph): New function to handle space width and - align-to display properties on non-window systems. - -2004-03-17 Stefan Monnier <monnier@iro.umontreal.ca> - - * fileio.c (Fread_file_name): Set completion-ignore-case for - case-insensitive systems. - -2004-03-14 Masatake YAMATO <jet@gyve.org> - - * xdisp.c (note_mode_line_or_margin_highlight): Accept HEADER_LINE - when keymap and cursor are setup. - -2004-03-14 Steven Tamm <steventamm@mac.com> - - * Makefile.in (XMENU_OBJ) [HAVE_CARBON]: Do not include xmenu.o. - -2004-03-14 Kim F. Storm <storm@cua.dk> - - * dispextern.h (x_find_image_file): Add prototype. - - * image.c (x_find_image_file): Make extern. - - * xfns.c (x_find_image_file): Remove prototype. - -2004-03-13 Eli Zaretskii <eliz@gnu.org> - - * Makefile.in (XMENU_OBJ): Include xmenu.o if HAVE_MENUS is defined. - - * emacs.c (main): Call syms_of_xmenu only if HAVE_MENUS is defined. - -2004-03-12 Richard M. Stallman <rms@gnu.org> - - * fns.c (internal_equal): New arg PROPS controls comparing - text properties. All callers changed. - (Fequal_including_properties): New function. - (syms_of_fns): defsubr it. - -2004-03-12 Kim F. Storm <storm@cua.dk> - - Fix image support on MAC. From YAMAMOTO Mitsuharu. - - * dispextern.h (XImagePtr, XImagePtr_or_DC): Add typedefs. - (image_background, image_background_transparent): Fix prototypes. - - * image.c (XImagePtr, XImagePtr_or_DC): Move typedefs to dispextern.h. - - * macfns.c (x_list_fonts, x_get_font_info, x_load_font) - (x_query_font, x_find_ccl_program, x_set_window_size) - (x_make_frame_visible, mac_initialize, XCreatePixmap) - (XCreatePixmapFromBitmapData, XFreePixmap, XSetForeground) - (mac_draw_line_to_pixmap): Move prototypes to macterm.h. - - * macterm.h (x_list_fonts, x_get_font_info, x_load_font) - (x_query_font, x_find_ccl_program, x_set_window_size) - (x_make_frame_visible, mac_initialize, XCreatePixmap) - (XCreatePixmapFromBitmapData, XFreePixmap, XSetForeground) - (mac_draw_line_to_pixmap): Add prototypes. - -2004-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * macterm.c (XTread_socket): Fix mouse click on tool bar. - -2004-03-11 Kim F. Storm <storm@cua.dk> - - * dispextern.h: Move image related prototypes from xfns.c section - to image.c. Condition them by HAVE_WINDOW_SYSTEM rather than - HAVE_X_WINDOWS. - - * Makefile.in (XOBJ): Consolidate into one list. Add image.o. - Move gtkutil.o to new GTK_OBJ list. - (XMENU_OBJ) [HAVE_MENUS]: Move declaration to proper place. - (GTK_OBJ) [USE_GTK]: New declaration. - (obj): Add $(GTK_OBJ) to list. - -2004-03-11 Steven Tamm <steventamm@mac.com> - - * image.c [MAC_OSX]: Include sys/stat.h. - - * macfns.c (syms_of_macfns): Remove definitions of things now - defined in image.c. - -2004-03-11 Kim F. Storm <storm@cua.dk> - - The following changes consolidates the identical/similar image - support code previously found in xfns.c, w32fns.c, and macfns.c - into a new file image.c. - - * makefile.w32-in (OBJ1): Add image.o. - ($(BLD)/image.$(O)): Add dependencies. - - * Makefile.in (XOBJ, MAC_OBJ): Add image.o. - (image.o): Add dependencies. - - * image.c: New file with consolidated image support code. - (COLOR_TABLE_SUPPORT): New define to control whether - color table support is available (X only). - (Bitmap_Record): Common name for x_bitmap_record, - w32_bitmap_record, and mac_bitmap_record. - (XImagePtr): Common name for pointer to XImage or equivalent. - (XImagePtr_or_DC): New type to simplify code sharing; equivalent - to XImagePtr on X+MAC, and to HDC on W32. - (GET_PIXEL): Wrapper for XGetPixel or equivalent. - (NO_PIXMAP): Common name for "None" or equivalent. - (PNG_BG_COLOR_SHIFT): Bits to shift PNG background colors. - (RGB_PIXEL_COLOR): Common type for an integer "pixel color" value. - (PIX_MASK_RETAIN, PIX_MASK_DRAW): Portability macros (from macfns.c). - (FRAME_X_VISUAL, x_defined_color, DefaultDepthOfScreen): - Define with suitable equivalents on W32 and MAC for code sharing. - (XDrawLine): Define on MAC for code sharing. - (Destroy_Image, Free_Pixmap): Wrappers for code sharing. - (IF_LIB_AVAILABLE): Macro to simplify code sharing. - (Vx_bitmap_file_path, Vimage_cache_eviction_delay) - (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap) - (x_reference_bitmap, x_create_bitmap_from_data) - (x_create_bitmap_from_file, x_destroy_bitmap) - (x_destroy_all_bitmaps, x_create_bitmap_mask) - (XGetImage, XPutPixel, XGetPixel, XDestroyImage) - (QCascent, QCmargin, QCrelief, QCconversion, QCcolor_symbols) - (QCheuristic_mask, QCindex, QCmatrix, QCcolor_adjustment, QCmask) - (Qlaplace, Qemboss, Qedge_detection, Qheuristic, Qcenter) - (define_image_type, lookup_image_type, valid_image_p) - (image_error, enum image_value_type, struct image_keyword) - (parse_image_spec, image_spec_value, Fimage_size, Fimage_mask_p) - (make_image, free_image, prepare_image_for_display, image_ascent) - (four_corners_best, image_background, image_background_transparent) - (x_clear_image_1, x_clear_image, x_alloc_image_color) - (make_image_cache, free_image_cache, clear_image_cache) - (Fclear_image_cache, postprocess_image, lookup_image, cache_image) - (forall_images_in_image_cache, x_create_x_image_and_pixmap) - (x_destroy_x_image, x_put_x_image, x_find_image_file, slurp_file) - (find_image_fsspec, image_load_qt_1, image_load_quicktime) - (init_image_func_pointer, image_load_quartz2d) - (struct ct_color, init_color_table, free_color_table) - (lookup_rgb_color, lookup_pixel_color, colors_in_color_table) - (cross_disabled_images, x_to_xcolors, x_from_xcolors) - (x_detect_edges, x_emboss, x_laplace, x_edge_detection) - (x_disable_image, x_build_heuristic_mask) - (XBM support, XPM support, PBM support, PNG support, JPEG support) - (TIFF support, GIF support, Ghostscript support): Consolidate image - code from xfns.c, w32fns.c, and macfns.c. - (syms_of_image): Consolidate image related symbol setup here. - (init_image): Consolidate image related initializations here. - - * emacs.c (main) [HAVE_WINDOW_SYSTEM]: Add calls to syms_of_image - and init_image. Remove call to init_xfns. - - * macterm.h (struct mac_bitmap_record): Add file member. - Not currently used, but simplifies code sharing. - - * macfns.c (Vx_bitmap_file_path, Vimage_cache_eviction_delay) - (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap) - (x_reference_bitmap, x_create_bitmap_from_data) - (x_create_bitmap_from_file, x_destroy_bitmap) - (x_destroy_all_bitmaps, x_create_bitmap_mask) - (XGetImage, XPutPixel, XGetPixel, XDestroyImage) - (QCascent, QCmargin, QCrelief, QCconversion, QCcolor_symbols) - (QCheuristic_mask, QCindex, QCmatrix, QCcolor_adjustment, QCmask) - (Qlaplace, Qemboss, Qedge_detection, Qheuristic, Qcenter) - (define_image_type, lookup_image_type, valid_image_p) - (image_error, enum image_value_type, struct image_keyword) - (parse_image_spec, image_spec_value, Fimage_size, Fimage_mask_p) - (make_image, free_image, prepare_image_for_display, image_ascent) - (four_corners_best, image_background, image_background_transparent) - (x_clear_image_1, x_clear_image, x_alloc_image_color) - (make_image_cache, free_image_cache, clear_image_cache) - (Fclear_image_cache, postprocess_image, lookup_image, cache_image) - (forall_images_in_image_cache, x_create_x_image_and_pixmap) - (x_destroy_x_image, x_put_x_image, x_find_image_file, slurp_file) - (find_image_fsspec, image_load_qt_1, image_load_quicktime) - (init_image_func_pointer, image_load_quartz2d) - (struct ct_color, init_color_table, free_color_table) - (lookup_rgb_color, lookup_pixel_color, colors_in_color_table) - (cross_disabled_images, x_to_xcolors, x_from_xcolors) - (x_detect_edges, x_emboss, x_laplace, x_edge_detection) - (x_disable_image, x_build_heuristic_mask) - (XBM support, XPM support, PBM support, PNG support, JPEG support) - (TIFF support, GIF support, Ghostscript support): Merge with image - code from xfns.c and macfns.c into image.c. - (syms_of_xfns): Move image related symbols to image.c. - (init_external_image_libraries, init_xfns): Remove; initialization - moved to init_image in image.c. - - * w32fns.c (Vx_bitmap_file_path, Vimage_cache_eviction_delay) - (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap) - (x_reference_bitmap, x_create_bitmap_from_data) - (x_create_bitmap_from_file, x_destroy_bitmap) - (x_destroy_all_bitmaps, x_create_bitmap_mask) - (QCascent, QCmargin, QCrelief, QCconversion, QCcolor_symbols) - (QCheuristic_mask, QCindex, QCmatrix, QCcolor_adjustment, QCmask) - (Qlaplace, Qemboss, Qedge_detection, Qheuristic, Qcenter) - (define_image_type, lookup_image_type, valid_image_p) - (image_error, enum image_value_type, struct image_keyword) - (parse_image_spec, image_spec_value, Fimage_size, Fimage_mask_p) - (make_image, free_image, prepare_image_for_display, image_ascent) - (four_corners_best, image_background, image_background_transparent) - (x_clear_image_1, x_clear_image, x_alloc_image_color) - (make_image_cache, free_image_cache, clear_image_cache) - (Fclear_image_cache, postprocess_image, lookup_image, cache_image) - (forall_images_in_image_cache, x_create_x_image_and_pixmap) - (x_destroy_x_image, x_put_x_image, x_find_image_file, slurp_file) - (struct ct_color, init_color_table, free_color_table) - (lookup_rgb_color, lookup_pixel_color, colors_in_color_table) - (cross_disabled_images, x_to_xcolors, x_from_xcolors) - (x_detect_edges, x_emboss, x_laplace, x_edge_detection) - (x_disable_image, x_build_heuristic_mask) - (XBM support, XPM support, PBM support, PNG support, JPEG support) - (TIFF support, GIF support, Ghostscript support): Merge with image - code from xfns.c and macfns.c into image.c. - (syms_of_xfns): Move image related symbols to image.c. - (init_external_image_libraries, init_xfns): Remove; initialization - moved to init_image in image.c. - - * xfns.c (Vx_bitmap_file_path, Vimage_cache_eviction_delay) - (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap) - (x_reference_bitmap, x_create_bitmap_from_data) - (x_create_bitmap_from_file, x_destroy_bitmap) - (x_destroy_all_bitmaps, x_create_bitmap_mask) - (QCascent, QCmargin, QCrelief, QCconversion, QCcolor_symbols) - (QCheuristic_mask, QCindex, QCmatrix, QCcolor_adjustment, QCmask) - (Qlaplace, Qemboss, Qedge_detection, Qheuristic, Qcenter) - (define_image_type, lookup_image_type, valid_image_p) - (image_error, enum image_value_type, struct image_keyword) - (parse_image_spec, image_spec_value, Fimage_size, Fimage_mask_p) - (make_image, free_image, prepare_image_for_display, image_ascent) - (four_corners_best, image_background, image_background_transparent) - (x_clear_image_1, x_clear_image, x_alloc_image_color) - (make_image_cache, free_image_cache, clear_image_cache) - (Fclear_image_cache, postprocess_image, lookup_image, cache_image) - (forall_images_in_image_cache, x_create_x_image_and_pixmap) - (x_destroy_x_image, x_put_x_image, x_find_image_file, slurp_file) - (struct ct_color, init_color_table, free_color_table) - (lookup_rgb_color, lookup_pixel_color, colors_in_color_table) - (cross_disabled_images, x_to_xcolors, x_from_xcolors) - (x_detect_edges, x_emboss, x_laplace, x_edge_detection) - (x_disable_image, x_build_heuristic_mask) - (XBM support, XPM support, PBM support, PNG support, JPEG support) - (TIFF support, GIF support, Ghostscript support): Merge with - w32fns.c and macfns.c image code into image.c. - (syms_of_xfns): Move image related symbols to image.c. - (init_xfns): Remove; initialization moved to init_image in image.c. - - * lisp.h (syms_of_image, init_image): Add protoypes. - (init_xfns): Remove prototype. - - * dispextern.h (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap) - (x_reference_bitmap, x_create_bitmap_from_data) - (x_create_bitmap_from_file, x_destroy_bitmap) - (x_create_bitmap_mask): Move prototypes from dispextern.h. - (gamma_correct) [MAC_OS]: Add prototype. - - * xterm.h (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap) - (x_reference_bitmap, x_create_bitmap_from_data) - (x_create_bitmap_from_file, x_destroy_bitmap) - (x_create_bitmap_mask): Move prototypes to dispextern.h. - -2004-03-09 Kenichi Handa <handa@etlken2> - - * coding.c (decode_coding_emacs_mule): Handle insufficent source - correctly. - -2004-03-04 Richard M. Stallman <rms@gnu.org> - - * s/sol2-6.h (LD_SWITCH_SYSTEM_TEMACS): New definition. - - * window.c (Fdisplay_buffer): Doc fix. - - * buffer.c (Fpop_to_buffer): Doc fix. - -2004-03-03 Kim F. Storm <storm@cua.dk> - - * xdisp.c (display_line): Fix call to get_overlay_arrow_glyph_row. - -2004-03-02 Stefan Monnier <monnier@iro.umontreal.ca> - - * editfns.c (Ftranslate_region): Lisp_Object/int mixup. - -2004-03-02 Richard M. Stallman <rms@gnu.org> - - * indent.c (compute_motion): Save vpos in prev_vpos, like hpos etc. - -2004-03-02 Kenichi Handa <handa@m17n.org> - - * doc.c (Fsubstitute_command_keys): Fix counding bytes. - -2004-03-02 Kim F. Storm <storm@cua.dk> - - * window.h (struct window): New member overlay_arrow_bitmap. - - * window.c (make_window): Initialize overlay_arrow_bitmap. - - * xdisp.c (Voverlay_arrow_variable_list): New variable to properly - implement and integrate multiple overlay arrows with redisplay. - (syms_of_xdisp): DEFVAR_LISP and initialize it. - (last_arrow_position, last_arrow_string): Replace by properties. - (Qlast_arrow_position, Qlast_arrow_string) - (Qoverlay_arrow_string, Qoverlay_arrow_bitmap): New variables. - (syms_of_xdisp): Intern and staticpro them. - (overlay_arrow_string_or_property, update_overlay_arrows) - (overlay_arrow_in_current_buffer_p, overlay_arrows_changed_p) - (overlay_arrow_at_row): New functions for multiple overlay arrows. - (redisplay_internal): Use them instead of directly accessing - Voverlay_arrow_position etc. for multiple overlay arrows. - (mark_window_display_accurate): Use update_overlay_arrows. - (try_cursor_movement): Use overlay_arrow_in_current_buffer_p. - (try_window_id): Use overlay_arrows_changed_p. - (get_overlay_arrow_glyph_row): Add overlay_arrow_string arg. - (display_line): Use overlay_arrow_at_row to check multiple - overlay arrows, and get relevant overlay-arrow-string and - overlay-arrow-bitmap. Set w->overlay_arrow_bitmap accordingly. - (produce_image_glyph): Set pixel_width = 0 for fringe bitmap. - (syms_of_xdisp): Remove last_arrow_position and last_arrow_string. - - * fringe.c (draw_fringe_bitmap): Use w->overlay_arrow_bitmap if set. - (update_window_fringes): Remove unused code. - -2004-03-01 Jason Rumney <jasonr@gnu.org> - - * w32term.c (w32_read_socket): Fix last change to ButtonPress handling. - -2004-03-01 Juanma Barranquero <lektu@terra.es> - - * fringe.c (Fdefine_fringe_bitmap): Fix typo in docstring. - - * makefile.w32-in ($(BLD)/fringe.$(O)): Add dependencies. - -2004-03-01 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xfns.c (Fx_display_color_cells): Use number of planes to calculate - how many colors can be displayed. - -2004-03-01 Kenichi Handa <handa@m17n.org> - - * editfns.c (Ftranslate_region): Handle multibyte chars in TABLE - correctly. - -2004-02-28 Kim F. Storm <storm@cua.dk> - - * dispnew.c (update_window): Update header line also if there are - no other changes in window (move code after set_cursor label). - - * lisp.h (mark_window_display_accurate): Remove prototype. - - * window.c (window_loop, Fforce_window_update): Force mode line - updates by setting prevent_redisplay_optimizations_p and - update_mode_lines. - -2004-02-28 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xfns.c (x_window): Fix indentation. - - * xterm.c (x_calc_absolute_position): Call x_real_positions - to get WM window sizes and use those to calculate position. - (x_set_offset): Remove code commented out. - -2004-02-28 Miles Bader <miles@gnu.org> - - * keyboard.c (adjust_point_for_property): #ifdef-out dodgy xassert. - -2004-02-28 Kim F. Storm <storm@cua.dk> - - * keyboard.c (kbd_buffer_store_event_hold): New function to store - an event into kbd fifo, but with special handling of quit event; - a quit event is saved for later, and further events are discarded - until the saved quit event has been processed. - (kbd_buffer_store_event): Use kbd_buffer_store_event_hold. - (gen_help_event): Store help event in kbd fifo. - (NREAD_INPUT_EVENTS): Remove. - (read_avail_input): Adapt to new read_socket_hook interface. - Remove allocation and initialization of local input_event buffer, - as read_socket_hook stores events directly in fifo. Allocate and - initialize local hold_quit event to handle postponed quit event - (and store it if set by kbd_buffer_store_event_hold). - - * keyboard.h (kbd_buffer_store_event_hold): Add prototype. - (gen_help_event): Fix prototype. - - * macterm.c (XTread_socket): Remove bufp_r and - numcharsp args. Add hold_quit arg. - Rework to use just one, local, inev input_event. Store inev - directly in fifo using kbd_buffer_store_event_hold. - - * sysdep.c (BUFFER_SIZE_FACTOR): Remove. - (read_input_waiting): Adapt to new read_socket_hook interface. - Remove allocation and initialization of local input_event buffer, - as read_socket_hook stores events directly in fifo. Allocate and - initialize local hold_quit event to handle postponed quit event - (and store it if set by kbd_buffer_store_event_hold). - - * term.c (read_socket_hook): Fix arg list. - - * termhooks.h (read_socket_hook): Fix prototype. - - * w32inevt.c (w32_console_read_socket): Remove bufp_r and - numcharsp args. Add hold_quit arg. - Rework to use just one, local, inev input_event. Store inev - directly in fifo using kbd_buffer_store_event_hold. - - * w32inevt.h (w32_console_mouse_position): Fix prototype. - - * w32term.c (w32_read_socket): Remove bufp_r and numcharsp args. - Add hold_quit arg. Rework to use just one, local, inev - input_event. Store inev directly in fifo using - kbd_buffer_store_event_hold. Update count in one place. - Postpone call to gen_help_event until inev is stored; use new - local do_help for this. - Remove local emacs_event in handing of ButtonPress event; just use - inev instead (so no reason to copy it later). - - * xsmfns.c (x_session_check_input): Remove numchars arg. - - * xterm.c (x_focus_changed, x_detect_focus_change): - Remove numchars arg. Always store event into bufp arg. - Return nothing. Callers changed accordingly. - (glyph_rect): Simplify. - (STORE_KEYSYM_FOR_DEBUG): New macro. - (SET_SAVED_MENU_EVENT): Use inev instead of bufp, etc. - (current_bufp, current_numcharsp) [USE_GTK]: Remove. - (current_hold_quit) [USE_GTK]: Add. - (event_handler_gdk): Adapt to new handle_one_xevent. - (handle_one_xevent): Remove bufp_r and numcharsp args. - Add hold_quit arg. Rework to use just one, local, inev - input_event. Store inev directly in fifo using - kbd_buffer_store_event_hold. Update count in one place. - Postpone call to gen_help_event until inev is stored; use new - local do_help for this. - Simplify handling of keysyms (consolidate common code). Fix bug - where count was updated with nchars instead of nbytes. - Remove local emacs_event in handing of ButtonPress event; just use - inev instead (so no reason to copy it later). - Remove `out' label. Rename label `ret' to `done'; add various - `goto done' to clarify code flow in deeply nested blocks. - (x_dispatch_event): Simplify as handle_one_xevent now calls - kbd_buffer_store_event itself. - (XTread_socket): Remove bufp_r and numcharsp args. Add hold_quit - arg. Call handle_one_xevent with new arglist. Store event from - x_session_check_input in fifo. - [USE_GTK]: Setup current_hold_quit. - Decrement handling_signal before unblocking input. - (x_initialize) [USE_GTK]: Initialize current_count. - - * xterm.h (x_session_check_input): Fix prototype. - -2004-02-26 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * s/darwin.h (LD_SWITCH_SYSTEM_TEMACS): Add `-framework QuickTime'. - - * dispextern.h [MAC_OSX]: Do not include Carbon/Carbon.h (now in - macgui.h). - - * emacs.c (main) [HAVE_CARBON]: Call init_xfns. - - * macgui.h [MAC_OSX]: Include Carbon/Carbon.h. - (mktime, DEBUG, Z, free, malloc, realloc, max, min) - (init_process) [MAC_OSX]: Avoid conflicts with Carbon/Carbon.h. - [!MAC_OSX]: Include QDOffscreen.h and Controls.h. - (INFINITY) [MAC_OSX]: Avoid conflict with definition in math.h. - (Bitmap): Remove typedef. - (Pixmap): Change int to GWorldPtr. - - * macmenu.c [MAC_OSX]: Don't include Carbon/Carbon.h (now in macgui.h). - - * macterm.h [MAC_OSX]: Don't include Carbon/Carbon.h (now in macgui.h). - (RED16_FROM_ULONG, GREEN16_FROM_ULONG, BLUE16_FROM_ULONG): - New #define to extract 16-bit depth color components from unsigned - long representation. - (PIX_MASK_DRAW, PIX_MASK_RETAIN): New #define to represent pixel - colors used for masks. - (struct mac_display_info): Add color_p. Remove n_cbits. - - * macfns.c: Include sys/types.h and sys/stat.h. - [MAC_OSX]: Do not include Carbon/Carbon.h (now in macgui.h). - Include QuickTime/QuickTime.h. - (XCreatePixmap, XCreatePixmapFromBitmapData, XFreePixmap) - (XSetForeground, mac_draw_line_to_pixmap): Add externs for - functions defined in macterm.c. - (XImagePtr): New typedef. Corresponds to XImage * in xfns.c. - (ZPixmap): New #define for compatibility with xfns.c. - (XGetImage, XPutPixel, XGetPixel, XDestroyImage) - (x_create_x_image_and_pixmap, x_destroy_x_image, x_put_x_image) - (find_image_fsspec, image_load_qt_1, image_load_quicktime): - New functions. - (four_corners_best, x_create_x_image_and_pixmap) - (x_destroy_x_image, unwind_create_frame, x_disable_image) - (x_edge_detection, init_color_table, colors_in_color_table) - (lookup_rgb_color, lookup_pixel_color, postprocess_image) - (x_put_x_image, slurp_file, xbm_scan, xbm_load, xbm_load_image) - (xbm_image_p, xbm_read_bitmap_data, xbm_file_p, x_to_xcolors) - (x_from_xcolors, x_detect_edges): New declarations (from xfns.c). - (mac_color_map_lookup, x_to_mac_color): Fix Lisp_Object/unsigned - long mixup. - (mac_defined_color, x_to_x_colors): Use RED16_FROM_ULONG etc. - (x_decode_color): Don't use n_cbits (in struct mac_display_info). - (x_set_foreground_color, x_set_cursor_color): Sync with w32fns.c. - (x_set_cursor_type, Fxw_color_values, valid_image_p) - (image_value_type, parse_image_spec, image_ascent, x_clear_image) - (x_alloc_image_color, clear_image_cache, lookup_image) - (x_find_image_file, xbm_read_bitmap_file_data) - (enum xbm_keyword_index, xbm_format, xbm_image_p, xbm_scan) - (xbm_read_bitmap_data, xbm_load, pbm_image_p, pbm_scan_number) - (enum pbm_keyword_index, pbm_format, enum png_keyword_index) - (png_format, png_image_p, enum jpeg_keyword_index, jpeg_format) - (jpeg_image_p, enum tiff_keyword_index, tiff_format, tiff_image_p) - (enum gif_keyword_index, gif_format, gif_image_p): Sync with xfns.c. - (x_make_gc): Sync with xfns.c. Enclose unused `border_tile' with - #if 0. - (x_free_gcs): Sync with xfns.c. Enclose unused `border_tile' with - #if 0. Free white_relief.gc and black_relief.gc. - (unwind_create_frame, x_emboss, x_laplace, x_edge_detection): - New functions (from xfns.c). - (Fx_create_frame): Record unwind_create_frame. - (Fxw_display_color_p): Use dpyinfo->color_p. - (Fx_display_grayscale_p, Fx_display_planes): Don't use - dpyinfo->n_cbits. - (Fx_display_color_cells): Use dpyinfo->n_planes; - (QCmatrix, QCcolor_adjustment, QCmask, Qemboss, Qedge_detection) - (Qheuristic, cross_disabled_images, emboss_matrix) - (laplace_matrix): New variables (from xfns.c). - (Fimage_size, Fimage_mask_p, four_corners_best, image_background) - (x_clear_image_1, postprocess_image, slurp_file, xbm_load_image) - (xbm_file_p, x_to_xcolors, x_from_xcolors, x_detect_edges) - (image_background_transparent): New function (from xfns.c). - Use PIX_MASK_DRAW/PIX_MASK_RETAIN. - (image_load_quicktime): Add declaration. - [MAC_OSX] (image_load_quartz2d): Likewise. - [MAC_OSX] (CGImageCreateWithPNGDataProviderProcType): New typedef. - [MAC_OSX] (MyCGImageCreateWithPNGDataProvider): New variable. - [MAC_OSX] (init_image_func_pointer, image_load_quartz2d): New funs. - (xbm_load_image_from_file, x_laplace_read_row) - (x_laplace_write_row, pbm_read_file): Remove functions. - [HAVE_XPM] (enum xpm_keyword_index, xpm_format, xpm_image_p) - (xpm_load): Sync with xfns.c (although XPM is not supported yet). - (colors_in_color_table): Sync with xfns.c (although not used). - (lookup_rgb_color): Don't lookup color table. Just do gamma - correction. - (COLOR_INTENSITY): New #define (from xfns.c). - (x_disable_image): New function (from xfns.c). - Use PIX_MASK_DRAW/PIX_MASK_RETAIN. - (x_build_heuristic_mask): Sync with xfns.c. - Use PIX_MASK_DRAW/PIX_MASK_RETAIN. - (HAVE_PBM): Remove #ifdef. - (pbm_load): Sync with xfns.c. Set img->width and img->height - before IMAGE_BACKGROUND. - (png_image_p, png_load): Don't enclose declarations with #if HAVE_PNG. - (Qpng, enum png_keyword_index, png_format, png_type, png_image_p): - Don't enclose with #if HAVE_PNG. - [!HAVE_PNG] (png_load) [MAC_OSX]: Use image_load_quartz2d if a - symbol _CGImageCreateWithPNGDataProvider is defined. - Otherwise use image_load_quicktime. - [!HAVE_PNG] (png_load) [!MAC_OSX]: Use image_load_quicktime. - [HAVE_PNG] (png_load): Sync with xfns.c. - Use PIX_MASK_DRAW/PIX_MASK_RETAIN. - (jpeg_image_p, jpeg_load): Don't enclose declarations with #if - HAVE_JPEG. - (Qjpeg, enum jpeg_keyword_index, jpeg_format, jpeg_type) - (jpeg_image_p): Don't enclose with #if HAVE_JPEG. - [!HAVE_JPEG] (jpeg_load) [MAC_OSX]: Use image_load_quartz2d. - [!HAVE_JPEG] (jpeg_load) [!MAC_OSX]: Use image_load_quicktime. - [HAVE_JPEG] (jpeg_load): Sync with xfns.c. - (tiff_image_p, tiff_load): Don't enclose declarations with #if - HAVE_TIFF. - (Qtiff, enum tiff_keyword_index, tiff_format, tiff_type) - (tiff_image_p): Don't enclose with #if HAVE_TIFF. - [!HAVE_TIFF] (tiff_load): Use image_load_quicktime. - [HAVE_TIFF] (tiff_error_handler, tiff_warning_handler): - New functions (from xfns.c). - [HAVE_TIFF] (tiff_load): Sync with xfns.c. - (gif_image_p, gif_load): Don't enclose declarations with #if HAVE_GIF. - (Qgif, enum gif_keyword_index, gif_format, gif_type, gif_image_p): - Don't enclose with #if HAVE_GIF. - [!HAVE_GIF] (gif_load): Use Quicktime Movie Toolbox if it is - animated gif. Otherwise use image_load_quicktime. - [HAVE_GIF] (gif_lib.h): Temporarily define DrawText as - gif_DrawText to avoid conflict with QuickdrawText.h. - [HAVE_GIF] (gif_load): Sync with xfns.c. - (enum gs_keyword_index, gs_format, gs_image_p, gs_load) - [HAVE_GHOSTSCRIPT] (x_kill_gs_process): Sync with xfns.c (although - Ghostscript is not supported yet). - (syms_of_macfns): Initialize Qemboss, Qedge_detection, Qheuristic, - QCmatrix, QCcolor_adjustment, and QCmask. Add DEFVAR_BOOL - cross_disabled_images (from xfns.c). Remove #if 0 for supported - image types. Remove #if HAVE_JPEG, HAVE_TIFF, HAVE_GIF, and - HAVE_PNG. Add defsubr for Simage_size and Simage_mask_p. - (init_xfns): Remove #if HAVE_JPEG, HAVE_TIFF, HAVE_GIF, and - HAVE_PNG. Call EnterMovies to support animated gifs. - Call init_image_func_pointer to bind a symbol - _CGImageCreateWithPNGDataProvider if it is defined. - - * macterm.c [MAC_OSX]: Don't include Carbon/Carbon.h (now in macgui.h). - (x_draw_bar_cursor): Sync declaration with xterm.c. - (XFreePixmap, mac_draw_rectangle_to_pixmap, mac_copy_area) - (mac_copy_area_to_pixmap): Implementation with GWorld (offscreen - graphics). - (mac_set_forecolor, mac_set_backcolor): Use RED16_FROM_ULONG etc. - (mac_draw_line_to_pixmap, XCreatePixmap) - (XCreatePixmapFromBitmapData, mac_fill_rectangle_to_pixmap) - (mac_copy_area_with_mask, mac_copy_area_with_mask_to_pixmap): - New functions. - (mac_draw_bitmap) [TARGET_API_MAC_CARBON]: - Use GetPortBitMapForCopyBits instead of the cast to Bitmap *. - Cast bits to char *. - (reflect_byte): New function (from w32fns.c). - (mac_create_bitmap_from_bitmap_data): Use it and don't stuff bits - due to byte alignment. - (mac_scroll_area) [TARGET_API_MAC_CARBON]: - Use GetPortBitMapForCopyBits instead of the cast to Bitmap *. - (XSetForeground): Remove static (now used in macfns.c). - (HIGHLIGHT_COLOR_DARK_BOOST_LIMIT): New #define (from w32term.c). - (mac_alloc_lighter_color, x_destroy_window): Sync with w32term.c. - (x_setup_relief_color, x_setup_relief_colors, x_draw_box_rect) - (x_draw_glyph_string_box, x_draw_image_foreground) - (x_draw_image_foreground_1, x_draw_image_glyph_string) - (x_draw_stretch_glyph_string, x_draw_glyph_string) - (x_draw_hollow_cursor, x_draw_bar_cursor, mac_draw_window_cursor): - Sync with xterm.c. - (x_draw_relief_rect): Sync with xterm.c. Make 1 pixel shorter - than the xterm.c version when a strictly horizontal or vertical - line is drawn. - (XTset_terminal_window): Add static. - (x_make_frame_visible): Add UNBLOCK_INPUT. - (x_free_frame_resources): New funcion (from xterm.c). - (XTread_socket): Call handle_tool_bar_click if mouse up/down event - occurs in tool bar area. - (mac_initialize_display_info): Remove dpyinfo->n_cbits. - Set dpyinfo->color_p. Determine dpyinfo->n_planes using HasDepth. - Initialize image cache. - (stricmp, wildstrieq, mac_font_pattern_match, mac_font_match): - Enclose unused functions with #if 0. - (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): New variables. - (decode_mac_font_name): New function to apply code conversions - from a mac font name to an XLFD font name according to its script code. - (x_font_name_to_mac_font_name): Apply code conversion from an XLFD - font name to a mac font name according to REGISTRY and ENCODING fields. - (init_font_name_table) [TARGET_API_MAC_CARBON]: Don't use a font - whose name starts with `.'. - (init_font_name_table): Use decode_mac_font_name. Add both - jisx0208.1983-sjis and jisx0201.1976-0 entries if the script code - of a font is smJapanese. - (mac_do_list_fonts): New function to list fonts that match a given - pattern. - (x_list_fonts, XLoadQueryFont): Use it. - (XLoadQueryFont): Set rbearing field for each variable width - character to avoid needless redraw. - (syms_of_macterm): Initialize Qbig5, Qcn_gb, Qsjis, and Qeuc_kr. - -2004-02-26 Kim F. Storm <storm@cua.dk> - - * keyboard.c (NREAD_INPUT_EVENTS): Temporarily increase to 512 - as read_socket_hook handler on X aborts if buffer is too small - and W32 handler doesn't always check buffer limit. - - * xdisp.c (handle_single_display_prop): Handle left-fringe and - right-fringe similar to a display margin image. Specifically, - the characters having the fringe prop are no longer shown, and - we use IT_IMAGE/next_element_from_image with image_id = -1 to - do this. Set fringe bitmap face_id in it->face_id. - (produce_image_glyph): Handle image_id < 0 as "no image" case, but - still realize it->face (i.e. the fringe bitmap face). - -2004-02-25 Miles Bader <miles@gnu.org> - - * xdisp.c (check_it): Check string/string_pos consistency. - (init_iterator): Initialize string-related fields properly. - -2004-02-11 Miles Bader <miles@gnu.org> - - * xdisp.c (produce_image_glyph): Force negative descents to zero. - -2004-02-10 Miles Bader <miles@gnu.org> - - * xfns.c (lookup_image): Remove xassert(!interrupt_input_blocked); - BLOCK_INPUT can be nested, so it doesn't make much sense. - -2004-02-24 Michael Mauger <mmaug@yahoo.com> - - * w32fns.c (slurp_file, xbm_scan, xbm_load_image) - (xbm_read_bitmap_data): Use unsigned char for image data. - -2004-02-23 Luc Teirlinck <teirllm@auburn.edu> - - * abbrev.c (Finsert_abbrev_table_description): Doc fix. - -2004-02-22 Jason Rumney <jasonr@gnu.org> - - * w32term.c (w32_draw_fringe_bitmap): Draw overlaid bitmaps - correctly over other bitmaps. - -2004-02-21 Eli Zaretskii <eliz@gnu.org> - - * emacs.c (USAGE1): Split into two halves. - (USAGE2): Second half of the old USAGE1. - (USAGE3): Rename from USAGE2. - (USAGE4): Rename from USAGE3. - -2004-02-21 Juri Linkov <juri@jurta.org> - - * emacs.c (USAGE1): Add --no-desktop. Move --display from USAGE2. - Fix --multibyte. Move --help, --version to USAGE2. Add alias - --file. Fix -f, -l. Sort options. Untabify. - (USAGE2): Add -hb. Fix --name, --title. Sort options. Untabify. - -2004-02-19 Luc Teirlinck <teirllm@auburn.edu> - - * category.c (Fdefine_category, Fcategory_docstring) - (Fget_unused_category, Fset_category_table) - (Fcategory_set_mnemonics): Doc fixes. - -2004-02-20 Kim F. Storm <storm@cua.dk> - - * keyboard.c: Undo 2004-02-16 and 2004-02-17 changes. - The following changes are relative to the 2004-01-21 revision. - (NREAD_INPUT_EVENTS): Define as max number of input events to read - in one call to read_socket_hook. Value is 8. - (read_avail_input): Separate and rework handling of read_socket_hook - and non-read_socket_hook cases. Use smaller input_event buffer - in read_socket_hook case, and repeat if full buffer is read. - Use new local variable 'discard' to skip input after C-g. - In non-read_socket_hook case, just use a single input_event, and - call kbd_buffer_store_event on the fly for each character. - -2004-02-19 Stefan Monnier <monnier@iro.umontreal.ca> - - * lisp.h (union Lisp_Object): Give a more precise type for `type'. - Remove unused `gu' alternative. - -2004-02-19 Andreas Schwab <schwab@suse.de> - - * fringe.c (Fdefine_fringe_bitmap): Use && instead of & to avoid - warning. - -2004-02-18 Kim F. Storm <storm@cua.dk> - - * xdisp.c (get_window_cursor_type, display_and_set_cursor): - Fix last change. - -2004-02-17 Kim F. Storm <storm@cua.dk> - - * xdisp.c (fast_find_position): Fix return value of new version; - it was inverted compared to the 21.1 version. - (get_window_cursor_type): Don't look at glyph if NULL. - (display_and_set_cursor): Set glyph to NULL if cursor in fringe. - - * keyboard.c: Rework previous change; it didn't consider that the - buf array was allocated on the stack. - (prev_read): Remove variable. - (read_avail_input_buf): New static event buffer array. - (in_read_avail_input): New static variable to handle re-entrancy. - (read_avail_input): Change buf to pinter to read_avail_input_buf. - Use in_read_avail_input to handle re-entrance; when re-entered, - fully initialize and use tmp_buf array instead of read_avail_input_buf. - Do not initialize read_avail_input_buf in full here; instead assume it - is always cleared on entry. To ensure that, we clear (just) the - entries that were used before we return. - (init_keyboard): Initialize read_avail_input_buf here. - -2004-02-16 Jesper Harder <harder@ifa.au.dk> - - * cmds.c (Fend_of_line): Doc fix. - -2004-02-16 Dmitry Antipov <dmantipov@yandex.ru> (tiny change) - - * keyboard.c (prev_read): New static variable. - (read_avail_input): Use it to zero out only those slots in buf[] - that were used last time we were called. - -2004-02-16 Eli Zaretskii <eliz@gnu.org> - - * Makefile.in (obj): Move fringe.o from here... - (XOBJ, MAC_OBJ): ...to here. - -2004-02-16 Stephen Eglen <stephen@gnu.org> - - * fringe.c (init_fringe_bitmap): Define j in MAC_OS code. - -2004-02-15 Stefan Monnier <monnier@iro.umontreal.ca> - - * data.c (Fbyteorder): - * fringe.c (Fdefine_fringe_bitmap): - * xdisp.c (handle_single_display_prop): - * xselect.c (x_handle_dnd_message): Lisp_Object/int mixup. - -2004-02-16 Jason Rumney <jasonr@gnu.org> - - * w32term.c (w32_draw_fringe_bitmap): Handle overlay fringe bitmaps. - -2004-02-15 Steven Tamm <steventamm@mac.com> - - * macterm.c (Vmac_emulate_three_button_mouse): New variable for - controlling emulation of a three button mouse with option and - command keys. - (Qreverse, mac_get_enumlated_btn): Handle the emulation. - (mac_event_to_emacs_modifiers, XTread_socket): Ditto. - -2004-02-15 Kim F. Storm <storm@cua.dk> - - * buffer.c (syms_of_buffer): Doc fix for indicate-buffer-boundaries. - - * fringe.c (init_fringe_bitmap) [MAC_OS, WORDS_BIG_ENDIAN]: - Perform byte-swapping. - -2004-02-14 Kim F. Storm <storm@cua.dk> - - * dispextern.h (struct draw_fringe_bitmap_params): Change member - bits from char to short to facilitate wider bitmaps. - (struct redisplay_interface): Fix prototype of define_fringe_bitmap - member. - - * fringe.c (struct fringe_bitmap): Change member bits from char to - short to facilitate 16 bits wide bitmaps. Modify all standard - bitmaps accordingly. - (BYTES_PER_BITMAP_ROW, STANDARD_BITMAP_HEIGHT): New macros. - (FRBITS): Use STANDARD_BITMAP_HEIGHT instead of just sizeof. - (draw_fringe_bitmap): Ditto. - (init_fringe_bitmap) [MAC_OS]: Don't bitswap. - (init_fringe_bitmap) [HAVE_X_WINDOWS]: Enhance bitswapping to - handle up to 16 bits wide bitmaps. - (Fdefine_fringe_bitmap): Doc fix. Handle wider bitmaps. - (Ffringe_bitmaps_at_pos): Add missing arg declarations. - - * macterm.c (mac_draw_bitmap): Handle 16 bits wide bitmaps directly. - (x_draw_fringe_bitmap): Use enhanced mac_draw_bitmap, so we no longer - need to call mac_create_bitmap_from_bitmap_data and mac_free_bitmap. - - * w32term.c (w32_define_fringe_bitmap): Bitmaps are now 16 bits wide, - so it is no longer necessary to expand them here. - - * xterm.c (x_draw_fringe_bitmap): Handle wider bitmaps (max 16 bits). - -2004-02-12 Kim F. Storm <storm@cua.dk> - - * window.c (Fwindow_fringes): Doc fix. - -2004-02-10 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xselect.c (x_get_foreign_selection): Add new optional parameter - time_stamp. - (Fx_get_selection_internal): Ditto, pass time_stamp to - x_get_foreign_selection. - - * data.c (Fbyteorder): New function. - -2004-02-09 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * atimer.c: Move include stdio.h to same place as in other files. - - * region-cache.c: Ditto. - - * sysdep.c: Ditto. - - * xfaces.c: Ditto. - -2004-02-09 Sam Steingold <sds@gnu.org> - - * w32term.c (w32_draw_fringe_bitmap): Fix a typo in the last patch. - -2004-02-09 Kim F. Storm <storm@cua.dk> - - * fringe.c: New file. Move original fringe related declarations - and code from dispextern.h and xdisp.c here. - Rework code to support user defined fringe bitmaps, redefining - standard bitmaps, ability to overlay user defined bitmap with - overlay arrow bitmap, and add faces to bitmaps. - (Voverflow_newline_into_fringe): Declare here. - (enum fringe_bitmap_align): New enum. - (..._bits): All bitmaps are now defined without bitswapping; that - is now done in init_fringe_once (if necessary). - (standard_bitmaps): New array with specifications for the - standard fringe bitmaps. - (fringe_faces): New array. - (valid_fringe_bitmap_id_p): New function. - (draw_fringe_bitmap_1): Rename from draw_fringe_bitmap. - (draw_fringe_bitmap): New function which draws fringe bitmap, - possibly overlaying bitmap with cursor in right fringe or the - overlay arrow in the left fringe. - (update_window_fringes): Do not handle overlay arrow here. - Compare and copy fringe bitmap faces. - (init_fringe_bitmap): New function. - (Fdefine_fringe_bitmap, Fdestroy_fringe_bitmap): New DEFUNs to - define and destroy user defined fringe bitmaps. - (Fset_fringe_bitmap_face): New DEFUN to set face for a fringe bitmap. - (Ffringe_bitmaps_at_pos): New DEFUN to read current fringe bitmaps. - (syms_of_fringe): New function. Defsubr new DEFUNs. - DEFVAR_LISP Voverflow_newline_into_fringe. - (init_fringe_once, init_fringe): New functions. - (w32_init_fringe, w32_reset_fringes) [WINDOWS_NT]: New functions. - - * Makefile.in (obj): Add fringe.o. - (fringe.o): New dependencies. - - * dispextern.h (FRINGE_ID_BITS): New definition for number of - bits allocated to hold a fringe number. Increase number of bits - from 4 to 8 to allow user defined fringe bitmaps. - (struct glyph_row, struct it): New members left_user_fringe_bitmap, - left_user_fringe_face_id, right_user_fringe_bitmap, - right_user_fringe_face_id. - (enum fringe_bitmap_type, struct fringe_bitmap, fringe_bitmaps): - Move to new file fringe.c. - (MAX_FRINGE_BITMAPS): Define here. - (struct draw_fringe_bitmap_params): New members bits, cursor_p, - and overlay_p. Change member which to int. - (struct redisplay_interface): New members define_fringe_bitmap - and destroy_fringe_bitmap. - (valid_fringe_bitmap_id_p): Add prototype. - (w32_init_fringe, w32_reset_fringes) [WINDOWS_NT]: Add prototypes. - - * dispnew.c (row_equal_p): Compare fringe bitmap faces and overlay - arrows. - (update_frame): Do flush_display if force_flush_display_p to - ensure display (specifically fringes) are updated in a timely - manner when resizing the frame by dragging the mouse. - (update_window_line): Update row if overlay arrow changed. - (scrolling_window): Redraw fringe bitmaps if fringe bitmap faces - or overlay arrow changed. - - * emacs.c (main) [HAVE_WINDOW_SYSTEM]: Call init_fringe_once, - syms_of_fringe, and init_fringe. - - * frame.h (struct frame): New member force_flush_display_p. - - * lisp.h (syms_of_fringe, init_fringe, init_fringe_once): - Add prototypes. - - * macterm.c (mac_draw_bitmap): Add overlay_p arg. - (x_draw_fringe_bitmap): Handle overlayed fringe bitmaps; - thanks to YAMAMOTO Mitsuharu for advice on how to do this. - Use cursor color for displaying cursor in fringe. - (x_redisplay_interface): Add null handlers for - define_fringe_bitmap and destroy_fringe_bitmap functions. - - * w32term.c (w32_draw_fringe_bitmap): Copy unadapted code from - xterm.c to handle overlayed fringe bitmaps and to use cursor color - for displaying cursor in fringe. - (w32_define_fringe_bitmap, w32_destroy_fringe_bitmap): New W32 - specific functions to define and destroy fringe bitmaps in fringe_bmp. - (w32_redisplay_interface): Add them to redisplay_interface. - (w32_term_init): Call w32_init_fringe instead of explicitly - defining fringe bitmaps in fringe_bmp array. - (x_delete_display): Call w32_reset_fringes instead of explicitly - destroying fringe bitmaps in fringe_bmp array. - - * xdisp.c (Voverflow_newline_into_fringe, syms_of_xdisp) - (left_bits, right_bits, up_arrow_bits, down_arrow_bits) - (continued_bits, continuation_bits, ov_bits, first_line_bits) - (last_line_bits, filled_box_cursor_bits, hollow_box_cursor_bits) - (bar_cursor_bits, hbar_cursor_bits, zv_bits, hollow_square_bits) - (fringe_bitmaps, draw_fringe_bitmap, draw_row_fringe_bitmaps) - (draw_window_fringes, compute_fringe_widths, update_window_fringes): - Move fringe handling vars and code to new file fringe.c. - (handle_display_prop): Handle left-fringe and right-fringe - display properties; store user fringe bitmaps in iterator. - (move_it_in_display_line_to): Handle cursor in fringe at eob. - (clear_garbaged_frames): Set force_flush_display_p if resized. - (redisplay_window): Redraw fringe bitmaps if not just_this_one_p. - (display_line): Handle cursor in fringe at eob. - (display_line): Set row user fringe bitmaps from iterator. - - * xterm.c (x_draw_fringe_bitmap): Handle overlayed fringe bitmaps. - Use cursor color for displaying cursor in fringe. - (x_redisplay_interface): Add null handlers for - define_fringe_bitmap and destroy_fringe_bitmap functions. - -2004-02-07 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * macfns.c (Fx_change_window_property): Make doc string and - parameters same as for X version. - - * w32fns.c (Fx_change_window_property): Ditto. - -2004-02-07 Kim F. Storm <storm@cua.dk> - - * xdisp.c (hscroll_window_tree): Position cursor near to right - margin in hscrolled window when jumping to end of line (rather - than centering cursor). - - * process.c (wait_reading_process_input): Don't do adaptive read - buffering if waiting for a specific process. - -2004-02-05 Luc Teirlinck <teirllm@auburn.edu> - - * minibuf.c (Fminibufferp, Fread_from_minibuffer) - (Fread_minibuffer, Feval_minibuffer) - (Fread_string, Fread_no_blanks_input) - (Fcompleting_read): Doc fixes. - (syms_of_minibuf): Doc fixes for minibuffer-completion-table and - completion-regexp-list. Define Qcase_fold_search and staticpro it. - (read_minibuf): Fix initial comment. - (Ftry_completion, Fall_completions, Ftest_completion): Bind - case-fold-search to the value of completion-ignore-case when - checking completion-regexp-list. - (Fdisplay_completion_list): Make it handle arguments that are - symbols. Doc fix. - -2004-02-05 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.h: Add declaration of free_frame_menubar. - - * xfns.c (x_create_bitmap_mask): Removed unused variable depth. - (x_set_menu_bar_lines): Added ! defined USE_GTK for olines. - (Fx_change_window_property): Add declaration of parameters type and - format. Remove unused variable cons. - - * xselect.c: Include stdio.h. - -2004-02-05 Kenichi Handa <handa@m17n.org> - - * fns.c (Fset_char_table_range): Fix previous change. - - * buffer.c (Fset_buffer_multibyte): Fix docstring. - -2004-02-04 Luc Teirlinck <teirllm@auburn.edu> - - * editfns.c (Fchar_after, Fchar_before): Doc fixes. - -2004-02-04 Stefan Monnier <monnier@iro.umontreal.ca> - - * keymap.c (Vmouse_events): Rename from Vmenu_events. - (syms_of_keymap): Add mouse-[45], header-line, and mode-line to it. - -2004-02-04 Kenichi Handa <handa@m17n.org> - - * fns.c (Fset_char_table_range): Handle charsets ascii, - eight-bit-control, and eight-bit-graphic correctly. - -2004-02-03 Jason Rumney <jasonr@gnu.org> - - * w32select.c (Fw32_set_clipboard_data): Make coding iso2022 safe. - - * w32fns.c (x_to_w32_font): Likewise. - -2004-02-03 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.h: Add x_handle_dnd_message, x_check_property_data, - x_fill_property_data, x_property_data_to_lisp and check_x_display_info. - - * xterm.c (handle_one_xevent): Call x_handle_dnd_message for - ClientMessages. - - * xselect.c: Include termhooks.h and X11/Xproto.h. - (x_check_property_data, x_fill_property_data) - (x_property_data_to_lisp, mouse_position_for_drop) - (Fx_get_atom_name, x_handle_dnd_message): New functions for DND support. - (Fx_send_client_event): Move here from xfns.c. - (syms_of_xselect): Add Sx_get_atom_name and Sx_send_client_message. - - * xfns.c (x-send-client-message): Move to xselect.c. - (Fx_change_window_property): Add optional arguments TYPE, FORMAT and - OUTER_P. - (Fx_window_property): Add optional arguments TYPE, SOURCE, DELETE_P, - VECTOR_RET_P. Handle AnyPropertyType. Call x_property_data_to_lisp - if vector_ret_p is true. - (syms_of_xfns): Sx_send_client_message moved to xselect.c. - -2004-02-02 Eli Zaretskii <eliz@gnu.org> - - * fileio.c (Fcopy_file): If NEWNAME is a directory, expand the - basename of FILE relative to it, not FILE itself. - -2004-02-02 Kenichi Handa <handa@m17n.org> - - * coding.c (coding_restore_composition): Check invalid - composition data more rigidly. - -2004-01-30 Luc Teirlinck <teirllm@auburn.edu> - - * fileio.c (Fread_file_name_internal): Correctly handle the case - where insert-default-directory is nil. - (Fread_file_name): Always return an empty string if the user exits - with an empty minibuffer. Adapt the docstring accordingly. - (syms_of_fileio): Adapt the docstring of insert-default-directory - to the change in Fread_file_name. - -2004-01-29 Eli Zaretskii <eliz@gnu.org> - - * alloca.c [!alloca]: Fix the prototype for xfree. - -2004-01-29 Kenichi Handa <handa@m17n.org> - - * fns.c (string_char_to_byte): Optimize for ASCII only string. - (string_byte_to_char): Likewise. - -2004-01-28 Peter Runestig <peter@runestig.com> - - * makefile.w32-in, w32fns.c: Add `default-printer-name' function. - -2004-01-27 Steven Tamm <steventamm@mac.com> - - * unexmacosx.c (unexec_copy): Do not copy more than was - requested to prevent overwriting during unexec. - -2004-01-27 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * process.c (sigchld_handler): Add comment about not calling malloc. - - * process.h: Add extern to synch_process_termsig. - -2004-01-27 Steven Tamm <steventamm@mac.com> - - * macterm.c (make_mac_frame, make_mac_terminal_frame): - Move setting of scroll bars from make_mac_frame to - make_mac_terminal_frame to prevent clobbering of scroll-bar-mode. - -2004-01-26 Richard M. Stallman <rms@gnu.org> - - * search.c (Freplace_match): Handle nonexistent - back-references properly. - -2004-01-03 Richard M. Stallman <rms@gnu.org> - - * window.c (decode_any_window): New function. - (Fwindow_height, Fwindow_width, Fwindow_edges) - (Fwindow_pixel_edges, Fwindow_inside_edges) - (Fwindow_inside_pixel_edges): Use decode_any_window. - -2004-01-27 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * process.h: synch_process_termsig new variable. - - * callproc.c: Define synch_process_termsig. - (Fcall_process): Initiate synch_process_termsig to zero and - check if non-zero and get signal name after subprocess has ended. - - * process.c (sigchld_handler): Set synch_process_termsig - if terminated by a signal. synch_process_death setting removed. - - * sysdep.c (mkdir, rmdir): Also check synch_process_termsig. - -2004-01-26 Andreas Schwab <schwab@suse.de> - - * print.c (print_preprocess): Declare size as EMACS_INT to not - lose bits. - (print_object): Likewise. - * alloc.c (Fpurecopy): Likewise. - -2004-01-25 Luc Teirlinck <teirllm@auburn.edu> - - * window.c (Fwindow_minibuffer_p): Doc fix. - -2004-01-24 Jonathan Yavner <jyavner@member.fsf.org> - - * editfns.c (Fformat): Make both passes accept the same set of flags. - -2004-01-23 Kenichi Handa <handa@m17n.org> - - * fns.c (Fmd5): If OBJECT is a buffer different from the current - one, set buffer to OBJECT temporarily. - -2004-01-21 Stefan Monnier <monnier@iro.umontreal.ca> - - * keyboard.c (kbd_buffer_gcpro): Remove. - (kbd_buffer_store_event, clear_event, Fdiscard_input) - (stuff_buffered_input, init_keyboard, syms_of_keyboard): - Don't initialize and/or maintain the variable any more. It was made - redundant by my commit of 2003-06-15. - - * lisp.h [USE_LSB_TAG && !DECL_ALIGN]: Signal an error. - -2004-01-21 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * lisp.h: Add undef DECL_ALIGN. - -2004-01-21 Stefan Monnier <monnier@iro.umontreal.ca> - - * process.c (wait_reading_process_input) [SYNC_INPUT]: - Check interrupt_input_pending explicitly. - - * lisp.h (QUIT) [SYNC_INPUT]: Check interrupt_input_pending as well. - - * keyboard.c (handle_async_input): New fun, - extracted from input_available_signal. - (input_available_signal, reinvoke_input_signal): Use it. - -2004-01-20 Stefan Monnier <monnier@iro.umontreal.ca> - - * buffer.c (buffer_defaults, buffer_local_symbols): Use DECL_ALIGN. - - * lisp.h [USE_LSB_TAG]: Add definitions for Lisp_Object value - manipulation macros for when tags are in the lower bits. - (struct Lisp_Free) [USE_LSB_TAG]: Add padding. - (DECL_ALIGN): New macro. - (DEFUN): Use it. - - * lisp.h [ENABLE_CHECKING]: Don't force union type. - - * s/darwin.h (__attribute__): Remove outdated workaround. - - * macterm.c (main) [USE_LSB_TAG]: Don't range check the ram. - - * alloc.c (lisp_malloc, lisp_align_malloc) [USE_LSB_TAG]: - Don't check range of malloc address. - (pure_alloc) [USE_LSB_TAG]: Enforce alignment. - - * process.c (wait_reading_process_input): Lisp_Object/int mixup. - - * dired.c (Ffile_attributes): Lisp_Object/int mixup. - -2004-01-19 Kenichi Handa <handa@m17n.org> - - * fontset.c (fontset_font_pattern): Fix previous change. - -2004-01-16 Miles Bader <miles@gnu.ai.mit.edu> - - * xdisp.c (Voverflow_newline_into_fringe) - (move_it_in_display_line_to, redisplay_internal) - (update_window_fringes, redisplay_window, display_line, window): - Add `#ifdef HAVE_WINDOW_SYSTEM' around fringe-drawing stuff, so - that it compiles without a window-system. - * dispnew.c (direct_output_for_insert, update_window): Likewise. - -2004-01-16 Kim F. Storm <storm@cua.dk> - - * buffer.h (struct buffer): New member indicate_buffer_boundaries. - - * buffer.c (init_buffer_once): Set buffer_defaults and - buffer_local_flags for indicate_buffer_boundaries. - (syms_of_buffer): Defvar_per_buffer it, and defvar_lisp_nopro - default- variable for it. - - * dispextern.h (struct glyph_row): New members left_fringe_bitmap, - right_fringe_bitmap, redraw_fringe_bitmaps_p for new fringe handling. - New members exact_window_width_line_p and cursor_in_fringe_p for - overflowing newlines into right fringe. - New members indicate_bob_p, indicate_top_line_p, indicate_eob_p, - and indicate_bottom_line_p for buffer boundaries and scrolling. - (enum fringe_bitmap_type): Add UP_ARROW_BITMAP, DOWN_ARROW_BITMAP, - FIRST_LINE_BITMAP, LAST_LINE_BITMAP, FILLED_BOX_CURSOR_BITMAP, - HOLLOW_BOX_CURSOR_BITMAP, BAR_CURSOR_BITMAP, HBAR_CURSOR_BITMAP, - and HOLLOW_SQUARE_BITMAP. - (draw_fringe_bitmap, draw_window_fringes, update_window_fringes): - Add prototypes. - - * dispnew.c (row_equal_p, update_window_line): Compare fringe bitmaps - instead of related indicator fields. - Compare exact_window_width_line_p and cursor_in_mouse_face_p indicators. - (direct_output_for_insert): Handle exact width lines like - contined lines. Call update_window_fringes. - (update_window): Call update_window_fringes. - (scrolling_window): Don't skip desired rows with changed bitmaps. - Check if fringe bitmaps changes when assigning scrolled rows. - - * xdisp.c (Voverflow_newline_into_fringe): New variable. - (IT_OVERFLOW_NEWLINE_INTO_FRINGE): New macro. - (move_it_in_display_line_to): Overflow newline into fringe for - rows that are exactly as wide as the window. - (up_arrow_bits, down_arrow_bits, first_line_bits, last_line_bits) - (filled_box_cursor_bits, hollow_box_cursor_bits, bar_cursor_bits) - (hbar_cursor_bits, hollow_square_bits): New fringe bitmaps. - (fringe_bitmaps): Add new bitmaps. - (draw_fringe_bitmap): Make extern. Remove WHICH arg. - Select proper bitmap for cursor in fringe when appropriate. - Handle alignment of bitmap to top or bottom of row. - (draw_row_fringe_bitmaps): Don't select bitmaps here; that is now - done by update_window_fringes. - (update_window_fringes, draw_window_fringes): New functions. - (redisplay_internal): Call update_window_fringes in case only - cursor row is updated. - (redisplay_window): Call update_window_fringes. - Explicitly call draw_window_fringes if redisplay was done using - the current matrix or the overlay arrow is in the window. - (try_window_reusing_current_matrix): Mark scrolled rows for - fringe update (to update buffer-boundaries / scrolling icons). - (find_last_unchanged_at_beg_row): Handle exact width lines line - continued lines. - (display_line): Overflow newline into fringe for rows that are - exactly as wide as the window. Don't append space for newline - in this case. - (notice_overwritten_cursor): Explicitly clear cursor bitmap - in fringe as if it had been overwritten. - (erase_phys_cursor): Erase cursor bitmap in fringe. - (syms_of_xdisp): Mark show-trailing-whitespace and - void-text-area-pointer as user options. - DEFVAR_LISP Voverflow_newline_into_fringe. Enable by default. - - * xterm.c (x_update_window_end): Call draw_window_fringes. - (x_after_update_window_line): Just set redraw_fringe_bitmaps_p - in row instead of actually drawing fringe bitmaps. - (x_draw_fringe_bitmap): Handle bottom aligned bitmaps. - (x_draw_window_cursor): Draw cursor in fringe. - - * w32term.c (x_update_window_end): Call draw_window_fringes. - (x_after_update_window_line): Just set redraw_fringe_bitmaps_p - in row instead of actually drawing fringe bitmaps. - (w32_draw_fringe_bitmap): Handle bottom aligned bitmaps. - (w32_draw_window_cursor): Draw cursor in fringe. - - * macterm.c (x_update_window_end): Call draw_window_fringes. - (x_after_update_window_line): Just set redraw_fringe_bitmaps_p - in row instead of actually drawing fringe bitmaps. - (x_draw_fringe_bitmap): Handle bottom aligned bitmaps. - (mac_draw_window_cursor): Draw cursor in fringe. - -2004-01-16 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.c (handle_one_xevent): Don't handle characters that are part - of an old style (XLookupString) compose sequence. - -2004-01-15 Kenichi Handa <handa@m17n.org> - - * search.c (Freplace_match): Use make_multibyte_string or - make_unibyte_string according to the buffer multibyteness. - -2004-01-14 Stefan Monnier <monnier@iro.umontreal.ca> - - * alloc.c (struct interval_block, struct string_block) - (struct symbol_block, struct marker_block, live_string_p) - (live_cons_p, live_symbol_p, live_float_p, live_misc_p): - Better preserve alignment for objects in blocks. - (FLOAT_BLOCK_SIZE): Adjust for possible alignment padding. - - * lread.c (defvar_per_buffer): Remove dead declaration. - - * macterm.c (do_check_ram_size): Don't hardcode the lisp address - space size. - -2004-01-12 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xmenu.c (popup_get_selection): Check new parameter down_on_keypress - if a key press should pop down. Only pop down if a key is pressed - outside the menu/dialog. - (create_and_show_popup_menu): Pass 0 for down_on_keypress to - popup_get_selection. - (create_and_show_dialog): Pass 1 for down_on_keypress to - popup_get_selection. - -2004-01-11 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * alloc.c (allocate_vectorlike): Surround calls to mallopt with - BLOCK/UNBLOCK_INPUT. - -2004-01-08 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xmenu.c (Fx_popup_dialog): Add an Ok button if no buttons are - specified. - -2004-01-08 Kenichi Handa <handa@m17n.org> - - * editfns.c (Fformat): Fix '&' to '&&'. - -2004-01-08 Andreas Schwab <schwab@suse.de> - - * print.c (print_preprocess) <case Lisp_Vectorlike>: Only mask - size if PSEUDOVECTOR_FLAG is set. - -2004-01-07 Kenichi Handa <handa@m17n.org> - - * charset.c (Fdeclare_equiv_charset): Fix docstring. - - * fontset.c (fontset_ref_via_base): Fix previous change. - -2004-01-07 Kim F. Storm <storm@cua.dk> - - * process.c (read_process_output): Only activate adaptive - buffering if we read less than 256 bytes at a time. - -2004-01-06 Kim F. Storm <storm@cua.dk> - - * dispnew.c (buffer_posn_from_coords): Return both buffer/string - object and image object. Return glyph width and height. - (mode_line_string, marginal_area_string): Ditto. - - * dispextern.h (buffer_posn_from_coords, mode_line_string) - (marginal_area_string): Fix prototypes. - - * keyboard.h (POSN_POSN, POSN_SET_POSN): Rename macros from - POSN_BUFFER_POSN and POSN_SET_BUFFER_POSN. All uses changed. - (POSN_INBUFFER_P, POSN_BUFFER_POSN): New macros. - - * keyboard.c (make_lispy_position): Use modified mode_line_string, - buffer_posn_from_coords, and marginal_area_string functions to - include both string object and image object in the lispy position. - Also add actual glyph width and height to position. - (read_key_sequence): Use real buffer position from mouse - event to find keymap property even when click is in marginal area. - - * xdisp.c (note_mode_line_or_margin_highlight): Use modified - mode_line_string and marginal_area_string functions to handle - both string object and image object properties. - -2004-01-06 Andreas Schwab <schwab@suse.de> - - * syntax.c (skip_chars): Treat '-' at end of string as ordinary - character. - -2004-01-02 Andreas Schwab <schwab@suse.de> - - * macterm.c (emacs_options, x_initialized, same_x_server): - Remove unused (and duplicated) definitions. - -2004-01-02 Kim F. Storm <storm@cua.dk> - - * process.h (struct Lisp_Process): New members for adaptive read - buffering: adaptive_read_buffering, read_output_delay, and - read_output_skip. - - * process.c (ADAPTIVE_READ_BUFFERING): New conditional. - (READ_OUTPUT_DELAY_INCREMENT, READ_OUTPUT_DELAY_MAX) - (READ_OUTPUT_DELAY_MAX_MAX): New constants. - (process_output_delay_count, process_output_skip): New vars. - (Vprocess_adaptive_read_buffering): New variable. - (make_process): Initialize adaptive read buffering members. - (Fstart_process): Set adaptive_read_buffering member. - (deactivate_process): Cleanup adaptive read buffering. - (wait_reading_process_input): Temporarily omit delayed - subprocesses from the set of file descriptors to read from; - adjust the select timeout if we skipped any subprocesses. - (read_process_output): Increase adaptive read buffering delay if - we read less than a full buffer; reduce delay when we read a - full buffer. - (send_process): Simplify using local Lisp_Process var. - Reset adaptive read buffering delay after write. - (init_process): Initialize process_output_delay_count and - process_output_skip. - (syms_of_process): DEFVAR_LISP Vprocess_adaptive_read_buffering. - -2004-01-01 Jason Rumney <jasonr@gnu.org> - - * w32term.c (w32_text_out): Use s->font, for consistency with callers. - -2003-12-30 Luc Teirlinck <teirllm@auburn.edu> - - * print.c (Ferror_message_string): Add hyperlink in the docstring - to the definition of `signal' in the Elisp manual. - * eval.c (Fsignal): Ditto. - -2003-12-29 James Clark <jjc@jclark.com> - - * fns.c (internal_equal): Return t for two NaN arguments. - -2003-12-29 Richard M. Stallman <rms@gnu.org> - - * data.c (store_symval_forwarding): Handle setting - default-fill-column, etc., by changing the value in - buffers that use the default. - - * minibuf.c (Fset_minibuffer_window): Doc fix. - - * fileio.c (choose_write_coding_system): Ignore auto_saving - if using the visited file for auto saves. - (Fwrite_region): Don't update SAVE_MODIFF - if auto-saving in visited file. - -2003-12-29 Kenichi Handa <handa@m17n.org> - - * dispextern.h (face_font_available_p): Extern it. - - * fontset.c (Voverriding_fontspec_alist): New variable. - (lookup_overriding_fontspec): New function. - (fontset_ref_via_base): Call lookup_overriding_fontspec if necessary. - (fontset_font_pattern): Likewise. - (regulalize_fontname): New function. - (Fset_fontset_font): Call regulalize_fontname. - (Fset_overriding_fontspec_internal): New function. - (syms_of_fontset): Initialize and staticpro Voverriding_fontspec_alist. - Defsubr Sset_overriding_fontspec_internal. - - * xfaces.c (face_font_available_p): New function. - -2003-12-28 Richard M. Stallman <rms@gnu.org> - - * buffer.c (Fother_buffer): Don't crash if BUF is nil - or if its name is nil. - - * buffer.c (Fkill_buffer): Don't delete auto-save file - if it's the same as the visited file. - -2003-12-28 Luc Teirlinck <teirllm@auburn.edu> - - * coding.c (Fcheck_coding_system): Doc fix. - -2003-12-28 Kim F. Storm <storm@cua.dk> - - * Makefile.in (eval.o): Depend on dispextern.h. - - * dispnew.c (buffer_posn_from_coords): Fix calculation of dy for - image glyph using image's ascent. - (mode_line_string): Return image glyph as object clicked on. - Adjust y0 for image glyph using image's ascent. - - * dispextern.h (FACE_ID_BITS, MAX_FACE_ID): New defines. - (struct glyph): New members, ascent and descent. Used to save - this glyph's ascent and descent, instead of having. - (struct glyph): Declare member face_id using FACE_ID_BITS. - (find_hot_spot): Add prototype. - - * keyboard.c (Qimage): Remove extern (now in lisp.h). - (QCmap): Declare extern. - (make_lispy_position): When position is inside image hot-spot, - use hot-spot element's id as posn element. - - * lisp.h (IMAGEP): New macro to test for image object type. - (Qimage): Declare extern. - - * macfns.c (Qimage): Remove extern (now in lisp.h). - (valid_image_p, parse_image_spec): Use IMAGEP macro. - - * macterm.c (Qface, Qmouse_face): Remove unused externs. - - * w32fns.c (Qimage): Remove extern (now in lisp.h). - (valid_image_p, parse_image_spec): Use IMAGEP macro. - - * w32menu.c (Qmouse_click, Qevent_kind): Remove unused externs. - - * w32term.c (Qface, Qmouse_face): Remove unused externs. - - * xdisp.c (Qarrow, Qhand, Qtext, Qpointer): New variables for - pointer types. - (Qrelative_width, Qalign_to): Remove unused variables. - (Vvoid_text_area_pointer): Replace Vshow_text_cursor_in_void. - (QCmap, QCpointer, Qrect, Qcircle, Qpoly): New variables for image - maps. - (x_y_to_hpos_vpos): Return glyph relative coordinates through new - dx and dy args. Remove buffer_only_p arg (always 0). Simplify - code accordingly. - (get_glyph_string_clip_rect): Draw cursor using glyph's rather - than row's ascent and height, to get sensible height on tall rows. - (build_desired_tool_bar_string): Remove Qimage extern. - (get_tool_bar_item): Fix call to x_y_to_hpos_vpos. - (produce_image_glyph): Adjust it.ascent to minimum row ascent if - image glyph is alone on the last line. - (append_glyph, append_composite_glyph, produce_image_glyph) - (append_stretch_glyph): Set glyph's ascent and descent. - (on_hot_spot_p): New function to check if position is inside an - rectangular, circular, or polygon-shaped image hot-spot, - (find_hot_spot): New function to search for image hot-spot. - (Flookup_image_map): New defun to search for image hot-spot. - (define_frame_cursor1): New aux function to determine frame - pointer. - (note_mode_line_or_margin_highlight, note_mouse_highlight): Handle - `pointer' text property and :pointer image property to control - frame pointer shape. Detect image hot-spots for pointer and - help_echo properties. Use define_frame_cursor1. - (note_mouse_highlight): Use Vvoid_text_area_pointer. - (syms_of_xdisp): Defsubr new defun. Intern and staticpro new - variables. DEFVAR_LISP Vvoid_text_area_pointer instead of - Vshow_text_cursor_in_void. - - * xfaces.c (cache_face): Abort if c->size exceeds MAX_FACE_ID. - - * xfns.c (x_set_mouse_color): Remove bogus x_check_errors call. - (Qimage): Remove extern (now in lisp.h). - (valid_image_p, parse_image_spec): Use IMAGEP macro. - - * xmenu.c (show_help_event): Remove unused code. - - * xterm.c (Qface, Qmouse_face): Remove unused externs. - (x_draw_hollow_cursor): Draw cursor using glyph's rather than - row's ascent and descent, to get a sensible height on tall rows. - -2003-12-25 Luc Teirlinck <teirllm@auburn.edu> - - * minibuf.c (Fcompleting_read): Undo previous change. - -2003-12-25 Lars Hansen <larsh@math.ku.dk> - - * dired.c (Fdirectory_files, Fdirectory_files_and_attributes): - Arguments GCPRO'ed in call to file name handler. - -2003-12-25 Thien-Thi Nguyen <ttn@gnu.org> - - * termcap.c (tgetst1): Scan for "%pN"; if all - N are continuous in [1,9], remove all "%pN". - -2003-12-24 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (xg_frame_set_char_size): Call x_wm_set_size_hint. - - * xfaces.c (lface_fully_specified_p): Take into account that - MAC OS always have unspecified stipple. - -2003-12-24 Thien-Thi Nguyen <ttn@gnu.org> - - * tparam.c (tparam1): Add handling for `%pN', which - means use param N for the next substitution. - -2003-12-24 Thien-Thi Nguyen <ttn@gnu.org> - - * xfaces.c (Fcolor_gray_p): Fix omission bug: - In case `frame' is nil, consult the selected frame. - (Fcolor_supported_p): Likewise. - -2003-12-23 Luc Teirlinck <teirllm@auburn.edu> - - * fns.c (Frandom, Fstring_make_multibyte, Fset_char_table_range): - Doc fixes. - - * minibuf.c (read_minibuf): Allow INITIAL to be a cons of a string - and an integer. Adapt the introductory comment accordingly. - (Fread_from_minibuffer): Delete code moved into read_minibuf. - Doc fix. - (Fread_minibuffer, Fread_no_blanks_input): Adapt to changes in - read_minibuf. - (Fcompleting_read): Delete code moved into read_minibuf. - (Ftest_completion): Make it handle obarrays and hash tables correctly. - -2003-12-03 Kenichi Handa <handa@m17n.org> - - * coding.c (decode_coding_iso2022): Fix for preserving UTF-8 - encoding sequence. - -2003-12-01 Kenichi Handa <handa@m17n.org> - - * composite.c (syms_of_composite): Don't make the compostion hash - table week. - -2003-11-30 Luc Teirlinck <teirllm@auburn.edu> - - * intervals.h: Add EXFUN for Fget_char_property_and_overlay. - * textprop.c (Fget_char_property_and_overlay): New function. - (syms_of_textprop): Defsubr it. - -2003-11-29 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * dispnew.c (buffer_posn_from_coords): Add ifdef HAVE_WINDOW_SYSTEM - to compile on terminal configuration. - - * fileio.c (Fread_file_name): Check use_file_dialog also before - calling Fx_file_dialog. - - * fns.c (use_file_dialog): New variable. - (syms_of_fns): DEFVAR_BOOL use-file-dialog. - -2003-11-29 Kim F. Storm <storm@cua.dk> - - * msdos.c (Qcursor_type, Qbar, Qhbar): Declare extern. - (syms_of_msdos): Don't intern and staticpro them. - -2003-11-27 Kim F. Storm <storm@cua.dk> - - * dispnew.c (buffer_posn_from_coords): Calculate and return pixel - coordinates relative to glyph at posn. If glyph is an image, - return that as object at posn. Callers changed. - (mode_line_string, marginal_area_string): Calculate and return - pixel coordinates relative to glyph. Callers changed. - - * dispextern.h (buffer_posn_from_coords, mode_line_string) - (marginal_area_string): Fix prototypes. - (window_box_left_offset, window_box_right_offset): Add prototypes. - - * frame.h (get_specified_cursor_type, get_window_cursor_type): - Remove prototypes. - - * keyboard.h (EVENT_CLICK_COUNT, POSN_SCROLLBAR_PART): Fix defines. - - * keyboard.c (make_lispy_position): Add x and y coordinates - relative to the current glyph as 7th element of position. - If glyph is an image, return it in the object element. - (read_key_sequence): Skip checks for keymap property in cases - where POSN_STRING is not a string (e.g. an image). - - * xdisp.c (Vdisplay_pixels_per_inch): New variable. - (Vshow_text_cursor_in_void): New variable. - (glyph_to_pixel_coords): Don't use negative hpos. - (x_y_to_hpos_vpos): Fix for partially visible first glyph. - (append_stretch_glyph): Change ascent arg to be actual value - in pixels rather than ratio to height. Callers changed. - (calc_pixel_width_or_height): New aux function, implementing - pixel based artihmetic for glyph widths and heights. - (produce_stretch_glyph): Use calc_pixel_width_or_height for - :width, :height, :align-to, and :ascent, thus allowing these to - be specified in pixels as well as multiples of characters. - Don't produce stretch glyphs with zero width or height. - (get_specified_cursor_type): Declare static. - (get_window_cursor_type): Declare static. Add glyph arg to be - able to know when cursor is on an image; always substitute - hollow-box cursor for filled-box cursor on images, to avoid - negative images and flicker when blinking the cursor. - (display_and_set_cursor): Pass glyph to get_window_cursor_type. - (note_mode_line_or_margin_highlight): Use non-text cursor rather - than vertical scroll-bar cursor in display margins. - (note_mouse_highlight): Use non-text cursor rather than text - cursor in fringes and over images in the text area. - Use non-text cursor when mouse pointer is outside editable text, - i.e. in the void after end-of-line or end-of-buffer; this was - already done for W32, but is now standard for all systems -- - user can toggle show-text-cursor-in-void to get old behaviour. - (syms_of_xdisp): DEFVAR_LISP Vshow_text_cursor_in_void and - Vdisplay_pixels_per_inch. - -2003-11-25 Andreas Schwab <schwab@suse.de> - - * fns.c (internal_equal) <case Lisp_Vectorlike>: Declare size as - EMACS_INT to not lose bits. - (Ffillarray): Don't set bits beyond the size of a bool vector. - -2003-11-25 Kim F. Storm <storm@cua.dk> - - * print.c (Fredirect_debugging_output) [!GNU_LINUX]: Do not - define this defun on systems that cannot use stderr as lvalue. - -2003-11-24 Gerd Moellmann <gerd@gnu.org> - - * s/freebsd.h (LD_SWITCH_SYSTEM_TEMACS) - [__FreeBSD_version >= 500042]: Define as -znocombreloc because - ld's default is incompatible with unexec. - -2003-11-23 Kim F. Storm <storm@cua.dk> - - * window.c (enum window_loop): Add REDISPLAY_BUFFER_WINDOWS. - (window_loop): Handle REDISPLAY_BUFFER_WINDOWS. - (Fforce_window_update): New defun. - (syms_of_window): Defsubr it. - (Fset_window_margins, Fset_window_fringes): Doc fix. - - * print.c (Fredirect_debugging_output): New defun. - (syms_of_print): Defsubr it. - -2003-11-22 Luc Teirlinck <teirllm@auburn.edu> - - * fns.c (Fset_char_table_parent): Doc fix. - -2003-11-22 Kim F. Storm <storm@cua.dk> - - * dispnew.c (buffer_posn_from_coords): Return actual row/column - for glyph clicked on, rather than (unused) pixel positions. - (mode_line_string, marginal_area_string): Change X and Y args to - pointers for returning actual row/column for glyph clicked on. - Simplify and optimize loops. - - * dispextern.h (mode_line_string, marginal_area_string): - Update prototypes. - - * keyboard.c (make_lispy_position): New function for generating - mouse click positions from frame and pixel coordinates. - Enhanced to return buffer position and actual row/column for - events outside the text area using updated mode_line_string and - marginal_area_string functions. - Return left-fringe and right-fringe clicks as such, rather than - clicks in text area. - (make_lispy_event) [USE_X_TOOLKIT, USE_GTK]: Don't call - pixel_to_glyph_coords, as we never use the results. - (make_lispy_event): Use make_lispy_position for MOUSE_CLICK_EVENT, - WHEEL_EVENT, and DRAG_N_DROP_EVENT to replace redundant code. - Eliminate unused code in WHEEL_EVENT handling. - (make_lispy_movement): Use make_lispy_position. - - * window.c (coordinates_in_window): Remove redundant tests. - Fix returned X pixel value for left-margin. - - * xdisp.c (note_mode_line_or_margin_highlight): Adapt to new - mode_line_string and marginal_area_string parameters. - -2003-11-22 Lars Hansen <larsh@math.ku.dk> - - * w32.c (struct the_group, getgrgid): Add. - * mac.c (struct my_group, getgrgid): Add. - -2003-11-21 Luc Teirlinck <teirllm@auburn.edu> - - * fns.c (Fassq, Fassoc, Frassq, Frassoc): Doc fixes. - -2003-11-21 Lars Hansen <larsh@math.ku.dk> - - * dired.c (Ffile_attributes): Add parameter ID-FORMAT and - include in call to file name handler. Optionally translate numeric - UID and GID to strings. Update docstring. - (directory_files_internal): Add parameter ID-FORMAT. - (Fdirectory_files_and_attributes): Add parameter ID-FORMAT and - include in call to file name handler and call to - directory_files_internal. Update Docstring. - (Fdirectory_files): Add dummy parameter in call to - directory_files_internal. - * lisp.h (Qinteger): Add. - (Qinteger_or_floatp, Qinteger_or_float_or_marker_p): Remove. - (Ffile_attributes): Add parameter. - * data.c (Qinteger): Export. - -2003-11-21 Luc Teirlinck <teirllm@auburn.edu> - - * fns.c (Freverse, Fnreverse): Doc fixes. - -2003-11-19 Kim F. Storm <storm@cua.dk> - - * xdisp.c (init_iterator): Initialize it->start to position - before reseating (in case start position is invisible). - (init_to_row_start): Set it->start to row-start. - (redisplay_window): Accept optional_new_start if start position - is invisible (in which case IT_CHARPOS overshoots PT). - (display_line): Setup row->start from it->start (rather than - it->current which is wrong if first char on line is invisible). - When done, reseat it->start to it->current (= start of next row). - (expose_area): Fix exposure of text area when first char (e.g. TAB) - is only partially visible. - - * dispextern.h (struct it): New member start. - -2003-11-17 Stefan Monnier <monnier@iro.umontreal.ca> - - * alloc.c (make_float, Fcons): Clear the markbit at init time. - (make_float, Fcons, Fmake_symbol, allocate_misc): Move the increment - of block_index outside of the macro call. - (Fgarbage_collect): Remove null code. - - * m/amdx86-64.h: Don't redefine XPNTR. - - * keyboard.c (parse_modifiers, apply_modifiers): Use INTMASK instead - of VALMASK. - - * fns.c (hashfn_eq, hashfn_eql, hashfn_equal, hash_put) - (sxhash_string, sxhash): Use INTMASK instead of VALMASK. - (maybe_resize_hash_table): Use MOST_POSITIVE_FIXNUM. - - * lisp.h (VALMASK): Only define for non-union type. - (MARKBIT): Remove. - (ARRAY_MARK_FLAG): Use previous value of MARKBIT. - (XTYPE): Define unconditionally. - (XSETTYPE): Remove one more remnant. - (EQ): Define differently for the union and non-union cases. - (INTMASK): New bit mask. - (struct Lisp_Marker): Move down to prepare for upcoming patch. - (GC_EQ): Delegate to EQ. - - * coding.c (coding_restore_composition): Lisp_Object/int mixup. - -2003-11-17 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.c (x_window_to_scroll_bar): Move check of display to - where window_id is compared. - -2003-11-17 Kim F. Storm <storm@cua.dk> - - * dispextern.h (struct it): New member first_vpos. - - * xdisp.c (start_display): Set it->first_vpos. - (try_window_id): Use first_vpos to start display in first _text_ - line if no reusable lines at start of window with header line. - -2003-11-16 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * w32fns.c (XPutPixel): - * w32bdf.c (w32_init_bdf_font): - * sunfns.c (sel_read): - * process.c (Fmake_network_process): - * frame.c (store_frame_param): - * fontset.c (Fset_fontset_font): - * emacs.c (shut_down_emacs): - * ccl.c (ccl_driver): Remove period at end of error message. - - * config.in: Regenerate. - - * xfns.c (x_window_to_frame, x_any_window_to_frame) - (x_non_menubar_window_to_frame, x_menubar_window_to_frame) - (x_top_window_to_frame): Add Display* argument to xg_win_to_widget. - (x_create_bitmap_mask, xg_set_icon, create_frame_xic) - (xic_set_statusarea, x_window, gif_load): Formatting adjustments. - - * xterm.h (struct x_display_info): New field xg_cursor for GTK. - - * xterm.c: Add Display * to x_window_to_scroll_bar declaration. - (XTmouse_position, handle_one_xevent): Pass Display* to - x_window_to_scroll_bar. - (x_window_to_scroll_bar): Take a Display* argument. - Check that display for frame is equal to Display* argument. - (event_handler_gdk): Remove current_dpyinfo. Get dpyinfo from - x_display_info_for_display instead. Use Display in xev instead - of GDK_DISPLAY. - (x_dispatch_event): Call x_display_info_for_display. - (XTread_socket): Move GTK part out of loop. current_dpyinfo removed. - (x_connection_closed): Call xg_display_close for GTK. - (x_term_init): Call xg_display_open for additional displays. - Initiate dpyinfo->xg_cursor with call to xg_create_default_cursor - for GTK. - - * xmenu.c (single_menu_item, mouse_position_for_popup) - (x_activate_menubar): Formatting adjustments. - - * xdisp.c (update_tool_bar, redisplay_tool_bar): Formatting - adjustments. - - * gtkutil.c (xg_get_gdk_display, xg_set_screen, xg_display_open) - (xg_display_close, xg_create_default_cursor) - (xg_get_gdk_pixmap_and_mask): New functions for multiple display - handling. - (xg_left_ptr_cursor): Remove. - (xg_set_cursor): Change cursor to GdkCursor*. Do not create - cursor here. - (xg_win_to_widget): Take Display* argument, call - gdk_xid_table_lookup_for_display. - (xg_create_frame_widgets, xg_get_file_name, create_menus) - (xg_create_widget, xg_modify_menubar_widgets): Call xg_set_screen. - (xg_create_widget, xg_create_scroll_bar): Use xg_cursor - in FRAME_X_DISPLAY_INFO. - (xg_get_scroll_id_for_window): Take Display* argument. - (update_frame_tool_bar): Call xg_get_gdk_pixmap_and_mask. - (xg_initialize): Remove xg_left_ptr_cursor. - - * gtkutil.h (xg_get_scroll_id_for_window, xg_win_to_widget): Add - Display* argument. - (xg_display_open, xg_display_close, xg_create_default_cursor): Declare. - -2003-11-14 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.c (x_detect_focus_change): Do not change focus frame for - Enter/LeaveNotify if the current focus frame has explicit focus. - -2003-11-14 Kim F. Storm <storm@cua.dk> - - * dispnew.c (update_text_area): Fix redisplay error when hscroll - is active and first glyph is only partially visible. - -2003-11-13 Kenichi Handa <handa@m17n.org> - - * xdisp.c (select_frame_for_redisplay): New function. - (redisplay_internal): Record also selected_frame for - unwind_redisplay. Call select_frame_for_redisplay before - redrawing each frame. - (unwind_redisplay): Argument changed to a cons. - -2003-11-12 Luc Teirlinck <teirllm@auburn.edu> - - * fns.c (Fstring_to_multibyte): Doc fix. - -2003-11-11 Kenichi Handa <handa@m17n.org> - - * xterm.c (x_list_fonts): Fix excluding of auto-scaled fonts. - -2003-11-09 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xfns.c (x_window): Set XtNx and XtNy in shell widget for - program specified positions. - -2003-11-08 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.c (XAW_ARROW_SCROLLBARS): Define it for Xaw 1.5E. - -2003-11-08 Kenichi Handa <handa@m17n.org> - - * Makefile.in (lisp): Add kannada.el. - (shortlisp): Likewise. - -2003-11-07 Kenichi Handa <handa@m17n.org> - - * coding.c (coding_allocate_composition_data): - Reset coding->composing to COMPOSITION_NO. - (coding_restore_composition): Detect invalid composition data. - Give Fstring and Fvector a Lispy integer, not C int. - -2003-11-05 Stefan Monnier <monnier@iro.umontreal.ca> - - * floatfns.c (Flogb): Don't use VALMASK. - - * m/amdx86-64.h (VALBITS, XINT, XUINT): Remove. - * m/ia64.h (VALBITS, XINT, XUINT): Remove. - - * lisp.h (XINT): Move the cast to clarify what is going on. - (GCTYPEMASK, XSETTYPE): Remove. - (XGCTYPE): Make it an alias of XTYPE. - -2003-11-03 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.c (x_term_init): Fix formatting. - -2003-11-02 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.h (xg_have_tear_offs): Declare. - (xg_keep_popup, xg_did_tearoff): Remove. - - * gtkutil.c: Remove variable xg_did_tearoff. - (xg_have_tear_offs): New function. - (tearoff_remove): Just decrease xg_detached_menus. - (tearoff_activate): Increase xg_detached_menus and call - tearoff_remove when tearoff is removed. - (xg_keep_popup): Remove function. - (create_menus): Give add_tearoff_p as argument to recursive - call to create_menus. - (xg_create_widget): Use variables instead of multiple - strcmp. Tell create_menus to create tear off only for - menu bar menus. - (xg_update_menubar): Change title for a detached menu also. - (xg_modify_menubar_widgets): Always call xg_update_menubar, regardless - of deep_p. - (xg_initialize): Initialize xg_detached_menus, remove - initialization of xg_did_tearoff. - - * xmenu.c (set_frame_menubar): For GTK, set deep_p if - xg_have_tear_offs returns non-zero. - (create_and_show_popup_menu): Remove setting of xg_did_tearoff and - call to xg_keep_popup. - -2003-11-01 Andrew Choi <akochoi@shaw.ca> - - * macterm.c (XTread_socket): Handle menubar selection and grow - window only for mouseDown events. - -2003-10-31 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.c (x_term_init): For GTK part, increase x_initialized - to check for more than one display. Use error instead of return 0. - -2003-10-31 Andrew Choi <akochoi@shaw.ca> - - * unexmacosx.c (unrelocate): New function (contributed by Nozomu Ando). - (copy_dysymtab): Call it. - -2003-10-31 Luc Teirlinck <teirllm@auburn.edu> - - * eval.c (Fdefvaralias): Doc fix. - -2003-10-26 Luc Teirlinck <teirllm@auburn.edu> - - * data.c (Fsetplist): Doc fix. - -2003-10-14 Lute Kamstra <lute@gnu.org> - - * window.c (Fset_window_fringes): Clarify docstring. - -2003-10-14 Kim F. Storm <storm@cua.dk> - - * window.c (Fset_window_margins): Simplify arg checking. - -2003-10-13 Richard M. Stallman <rms@gnu.org> - - * regex.c (MAX_BUF_SIZE): Reduce to 2**15. - (print_partial_compiled_pattern): Replace assert with a printout. - (skip_noops, mutually_exclusive_p): Change args, values to re_char *. - - * alloc.c (lisp_align_malloc): If BASE is 0, call memory_full. - - * window.c (Fset_window_margins): Allow only integers as args. - (syms_of_window) <special-display-buffer-names, - special-display-regexps>: Doc fixes. - -2003-10-13 Lute Kamstra <lute@gnu.org> - - * window.c (Fset_window_fringes): Elaborate docstring. - -2003-10-12 Andrew Choi <akochoi@shaw.ca> - - * macterm.c (XTread_socket): Call DragWindow only for mouseDown events. - - * s/darwin.h (GC_MARK_STACK): Define. - -2003-10-12 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * window.c (shrink_windows): New function. - (size_window): Call shrink_windows to calculate window sizes when - shrinking frame with more than one window. - -2003-10-12 Kim F. Storm <storm@cua.dk> - - * xdisp.c (compute_fringe_widths): Doc fix. - -2003-10-08 Kenichi Handa <handa@m17n.org> - - * coding.c (Fcoding_system_p): Return t for auto-loading coding system. - -2003-10-07 Kenichi Handa <handa@m17n.org> - - * coding.c (Qcoding_system_define_form): New variable. - (syms_of_coding): Intern and staticpro it. - (Fcheck_coding_system): Try to autoload the definition of - CODING-SYSTEM. - -2003-10-05 Luc Teirlinck <teirllm@auburn.edu> - - * fns.c (Frequire): Doc fix. - -2003-10-05 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xfns.c (Fx_send_client_event): New function as a base for - manipulating extended window manager hints. - (Fx_send_client_event): Remove unused variable s. - - * w32term.c (w32_read_socket): Remove call to x_check_fullscreen_move, - that function is removed. - - * xterm.c (x_set_offset): Use move_offset_left/top instead of - x/y_pixels_outer_diff. - (x_check_expected_move): Calculate move_offset_left/top. - - * xterm.h (struct x_output): New members: move_offset_top/left. - - * frame.c (x_set_frame_parameters): Remove x_fullscreen_move, - call x_set_offset directly. - - * frame.h (enum): FULLSCREEN_MOVE_WAIT removed. - - * frame.c (Fdelete_frame): Free decode_mode_spec_buffer. - - * xterm.c (x_delete_display): Free font names and font_encoder - in dpyinfo->font_table. - - * xfns.c (Fx_close_connection): Only call XFreeFont here. - Move xfree of font names to x_delete_display. - - * xterm.h (struct x_display_info): New member, wm_type. - (struct x_output): New members, expected_top/left and - check_expected_move. - - * xterm.c (handle_one_xevent): Reset wm_type when ReparentNotify - is received. - (handle_one_xevent): Rename x_check_expected_move from - x_check_fullscreen_move. - (x_set_offset): Only add WM decoration sizes to modified_top/left - for X_WMTYPE_A. Set check_expected_move when WM type is unknown. - (x_check_expected_move): Rename from x_check_fullscreen_move. - Removed fullscreen specific code. Use check_expected_move, - expected_left/top instead. Also, set wm_type. - (x_term_init): Initialize wm_type to unknown. - - * frame.c (x_fullscreen_move): Remove addition of WM decoration - sizes to move_x/y. - -2003-10-03 Kenichi Handa <handa@m17n.org> - - * macterm.c (x_load_font): Clear all members of FONTP before start - filling them. - -2003-10-02 Kenichi Handa <handa@m17n.org> - - * fontset.c (fs_load_font): Don't set fontp->font_encoder to NULL - before calling find_ccl_program_func. Call find_ccl_program_func - only when fontp->font_encoder is not NULL. - - * xterm.c (x_load_font): Clear all members of FONTP before start - filling them. - -2003-10-03 John Paul Wallington <jpw@gnu.org> - - * keymap.c (map_keymap): Don't abort when binding is a vector. - -2003-10-02 Jason Rumney <jasonr@gnu.org> - - * makefile.w32-in (emacs.o, coding.o, bytecode.o): - Sync dependencies with Makefile.in. - (alloca.o): Remove. - - * w32fns.c (w32_load_system_font): Clear all members of FONTP before - filling them. - - * w32bdf.c (w32_load_bdf_font): Likewise. - -2003-09-30 Richard M. Stallman <rms@gnu.org> - - * term.c (set_tty_color_mode): Calculate current_mode_spec - regardless of value of VAL. - - * intervals.c (graft_intervals_into_buffer): - Set BUF_INTERVALS (buffer)->up_obj when appropriate. - Handle over_used when splitting UNDER. - -2003-09-30 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - - * regex.c (regex_compile): Free the stack when returning from function. - -2003-09-28 Kenichi Handa <handa@m17n.org> - - * fontset.c (Finternal_char_font): Change return value to - cons (FONT-NAME . GLYPH-CODE). - -2003-09-28 Eli Zaretskii <eliz@gnu.org> - - * term.c (tty_setup_colors): Treat any negative argument as -1. - -2003-09-27 Gaute B Strokkenes <biggaute@uwc.net> (tiny change) - - * process.c (send_process): Delete unused temp_buf. - -2003-09-26 Dave Love <fx@gnu.org> - - * xterm.c (x_bitmap_mask): Declare. - -2003-09-25 Dave Love <fx@gnu.org> - - * Makefile.in (fns.o): Depend on md5.h. - -2003-09-25 Kim F. Storm <storm@cua.dk> - - * window.c (set_window_buffer): Fix redisplay problems when - switching between buffers with different display margin widths. - -2003-09-23 Kim F. Storm <storm@cua.dk> - - * process.c (set_socket_option): Fix :bindtodevice option. - (Fset_network_process_option): Update process contact list when - setting option succeeds. - (Fmake_network_process): Doc fix. - -2003-09-23 Dave Love <fx@gnu.org> - - * process.c (Fnetwork_interface_info): Use HAVE_STRUCT_IFREQ... macros. - -2003-09-22 Eli Zaretskii <eliz@gnu.org> - - * term.c (set_tty_color_mode): Use INTEGERP to test whether a - color mode is an integer number (it could be -1). - -2003-09-22 Richard M. Stallman <rms@gnu.org> - - * intervals.c (graft_intervals_into_buffer): Correct the main loop - in the case where OVER is longer than UNDER. - -2003-09-22 Masatake YAMATO <jet@gyve.org> - - * window.c (Fset_window_scroll_bars): Validate the value of - `vertical_type'. - -2003-09-21 Kim F. Storm <storm@cua.dk> - - * frame.c (Vdefault_frame_scroll_bars): New variable. - (x_set_vertical_scroll_bars): Use it instead of hardcoded values. - (syms_of_frame): DEFVAR_LISP it, and initialize according to - window-system default scroll bar position. - - * window.c (Fwindow_scroll_bars): Doc fix. - -2003-09-19 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.c (x_set_offset): Take window manager decorations into account. - -2003-09-19 Richard M. Stallman <rms@gnu.org> - - * atimer.h: Don't include lisp.h. - (P_): Define it here (as well as elsewhere). - - * print.c (Fprin1_to_string): Move the PRINTPREPARE - later, so that PRINTFINISH won't unbind Qinhibit_modification_hooks. - - * data.c (Fvariable_binding_locus): New function. - (syms_of_data): defsubr it. - (Flocal_variable_p): Delete duplicate call to indirect_variable. - -2003-09-18 Dave Love <fx@gnu.org> - - * alloc.c (GC_MALLOC_CHECK): Move conditional undef after lisp.h. - - * process.c (Fnetwork_interface_info): Fix type error. - (Fnetwork_interface_list): Doc fix. - (read_process_output, read_process_output): Delete unused var. - -2003-09-17 Kim F. Storm <storm@cua.dk> - - * process.c (Fnetwork_interface_list, Fnetwork_interface_info): - Require HAVE_NET_IF_H and HAVE_SYS_IOCTL_H to include these fns. - (Fnetwork_interface_info): Check that ifreq struct has required - fields before accessing them; this requires that those fields are - defined as macros, which may be too restrictive on some platforms, - but it is better than failing on other platforms. - (syms_of_process): Only defsubr above fns when included. - -2003-09-17 Dave Love <fx@gnu.org> - - * unexalpha.c: Don't include varargs.h. - -2003-09-17 Kim F. Storm <storm@cua.dk> - - * process.c (Fset_process_sentinel): Add sentinel to childp plist - for network process. - (socket_options): Add `:' prefix to option names. Add optbit field. - (set_socket_option): Remove no_error arg and special handling of s < 0. - Return 1<<optbit for known option, 0 for unknown. - Do not interpret 0 as false for boolean option (only nil). - Pass failed option and value to report_file_error. - (Fset_network_process_options): Replace by Fset_network_process_option. - (Fset_network_process_option): New function to set just one option. - (Fmake_network_process): Allow :coding arg to be a cons. - Allow :server arg to be an integer specifying backlog size. - Remove :options arg, and allow options to be specified directly - as :KEY, VALUE pairs. Parse these options before binding socket. - As before, :reuseaddr t is default for a server process, but this - can now be disabled by specifying :reuseaddr nil. - (Fnetwork_interface_info): Rename from Fget_network_interface_info. - (init_process): Availability of network options is now checked with - simpler syntax (featurep 'make-network-process :OPTION); use loop to - setup features. - (syms_of_process): Fix defsubr's for the replaced functions. - -2003-09-16 Dave Love <fx@gnu.org> - - * Makefile.in: Depend on coding.h. - -2003-09-14 Kim F. Storm <storm@cua.dk> - - * process.c [HAVE_SOCKETS]: Include sys/ioctl.h and net/if.h. - (Fnetwork_interface_list, Fget_network_interface_info): New defuns. - (syms_of_process): Defsubr them. - - * config.in: Regenerate. - -2003-09-12 Stefan Monnier <monnier@iro.umontreal.ca> - - * m/sr2k.h (XMARKBIT, XUNMARK): Remove. - * m/news-r6.h (XUNMARK): Remove. - * m/mips.h (XUNMARK): Remove. - * m/mips-siemens.h (XUNMARK): Remove. - * m/iris4d.h (XUNMARK): Remove. - * m/hp800.h (XMARKBIT, XUNMARK): Remove. - -2003-09-11 Stefan Monnier <monnier@iro.umontreal.ca> - - * lisp.h (VALBITS): Don't remove 1 for the markbit. - (union Lisp_Object): Use unsigned int for types. Remove markbit. - (MARKBIT): Remove 1 from VALBITS so we still use same old val. - (XTYPE): Use unsigned right-shift. - (XMARKBIT, XMARK, XUNMARK): Remove. - - * alloc.c (init_intervals, init_symbol, init_marker): - Don't preallocate anything. - (Fgarbage_collect, mark_object): Ignore the markbit. - - * bytecode.c (mark_byte_stack, unmark_byte_stack): Ignore the markbit. - -2003-09-08 Lute Kamstra <lute@gnu.org> - - * xdisp.c (pint2hrstr): New function. - (decode_mode_spec): Add `%i' and `%I' specs. - * buffer.c (syms_of_buffer): Document `%i' and `%I' constructs - for `mode-line-format'. - -2003-09-07 Andreas Schwab <schwab@suse.de> - - * alloc.c: Use long instead of int when casting ABLOCKS_BUSY to - avoid warning. - -2003-09-07 Eli Zaretskii <eliz@gnu.org> - - * editfns.c (region_limit): Support any non-zero value of BEGINNINGP. - -2003-09-03 Kim F. Storm <storm@cua.dk> - - * xdisp.c (get_window_cursor_type): Partially undo 2002-03-01 - change (superseded by 2002-08-30 change); the default blink-off - cursor is now again "no cursor". - -2003-09-01 Jason Rumney <jasonr@gnu.org> - - * makefile.w32-in (alloca.o): Remove. - (coding.o): Depend on intervals.h - (emacs.o, bytecode.o): Depend on window.h. - -2003-09-01 Dave Love <fx@gnu.org> - - * Makefile.in (alloca.o): Remove commands. - (coding.o): Depend on intervals.h composite.h window.h. - (emacs.o): Depend on window.h keyboard.h keymap.h. - (gtkutil.o): Depend on keyboard.h charset.h coding.h. - (bytecode.o): Depend on window.h. - -2003-08-31 Jason Rumney <jasonr@gnu.org> - - * w32term.c (w32_per_char_metric): Allow cached metrics to be - returned even when font_type is unknown. - - * xdisp.c (init_iterator): Remove old WINDOWSNT conditional. - -2003-08-30 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.c (x_term_init): Initialize new fields in x_display_info. - - * xterm.h (struct x_display_info): Add red/green/blue_bits and - *_offset. - - * xfns.c (lookup_rgb_color): Use new fields in x_display_info to - calculate pixel value. - -2003-08-29 Gerd Moellmann <gerd.moellmann@t-online.de> - - * xdisp.c (redisplay_internal): Fix change of 2003-04-30. - Don't tell redisplay display is accurate when it's actually been - paused for pending input. - -2003-08-29 Richard M. Stallman <rms@gnu.org> - - * dispnew.c (adjust_glyph_matrix): Call window_box - whenever W is nonzero. - - * data.c (Fmake_variable_buffer_local, Fmake_local_variable) - (Fkill_local_variable, Fmake_variable_frame_local) - (Flocal_variable_p, Flocal_variable_if_set_p): - Use indirect_variable to trace thru variable aliases. - - * config.in: Updated. - - * callint.c (Fcall_interactively): Save and restore - Vthis_command, Vthis_original_command, real_this_command, - and current_kboard->Vlast_command. - - * abbrev.c (Fexpand_abbrev): Insert before deleting. - -2003-08-29 Gerd Moellmann <gerd@gnu.org> - - * xfns.c (lookup_rgb_color): Handle TrueColor visuals specially. - -2003-08-28 David Abrahams <dave@boost-consulting.com> (tiny change) - - * coding.c (decode_coding_iso2022): Initialize local variable c2. - (decode_coding_sjis_big5): Likewise. - -2003-08-27 Jason Rumney <jasonr@gnu.org> - - * w32.c (sys_pipe): Protect against file descriptor overflow. - - * w32fns.c (syms_of_w32fns): Remove non-existent functions. - - * w32term.c (w32_read_socket): Fix WM_MOUSEWHEEL assignment. - -2003-08-26 Terje Rosten <terjeros@phys.ntnu.no> - - * xfns.c (Vgtk_version_string): New variable. - (syms_of_xfns): DEFVAR_LISP it. Provide gtk. - -2003-08-24 Eli Zaretskii <eliz@gnu.org> - - * term.c (term_init): Remove `const' from buffer_size's declaration. - - * Makefile.in (msdos.o): Depend on intervals.h. - - * msdos.c: Include intervals.h, since STRING_INTERVALS requires that. - -2003-08-21 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.h (struct x_display_info): New fields: client_leader_window - and Xatom_wm_client_leader. - - * xterm.c (x_initialize): Move call to x_session_initialize to ... - (x_term_init): ... here. Initialize client_leader fields in dpyinfo. - - * xsmfns.c (create_client_leader_window): New function. - (x_session_initialize): Call create_client_leader_window, take - dpyinfo as argument. - - * xfns.c (Fx_create_frame): Set property WM_CLIENT_LEADER. - - * Makefile.in (xsmfns.o): Add more depenedencies. - -2003-08-21 Dave Love <fx@gnu.org> - - * m/iris4d.h: Use _MIPS_SZLONG, not _LP64. - -2003-08-21 Kenichi Handa <handa@m17n.org> - - * term.c (term_init): Fix previous change; don't rely on the - length of `buffer' if TERMINFO is defined. - -2003-08-20 Dave Love <fx@gnu.org> - - * atimer.h: Include lisp.h. - - * lisp.h (EMACS_LISP_H): New. - (popup_activated_flag): Don't declare. - - * alloca.c: Some merging with gnulib. Change logic and doc - concerning (x)malloc/(x)free -- no longer Emacs-specific. - [DO_BLOCK_INPUT]: Don't include lisp.h. - (xmalloc, xfree): Declare. - (malloc): Don't declare. - - * Makefile.in (LWLIB_OPTIONS): Remove (unused). - (alloca.o): Remove obsolete stuff concerning alloca.s. Depend on - atimer.h, blockinput.h. - - * alloc.c (lisp_align_malloc): Change type of `aligned'. - - * alloca.s: Remove. - -2003-08-19 Gerd Moellmann <gerd@gnu.org> - - * s/freebsd.h [__FreeBSD_version >= 400000]: Define TERMINFO, - use -lncurses. - - * term.c (term_init): Use a buffer of size 4096 for tgetent since - FreeBSD returns something longer than 2044. Abort if the end of - the buffer is overwritten. - -2003-08-19 Miles Bader <miles@gnu.org> - - * xterm.c (x_term_init): Correctly use result of Ffile_readable_p. - -2003-08-19 Gerd Moellmann <gerd@gnu.org> - - * alloc.c (lisp_align_malloc): Check for memory full when - allocating ablocks, which also avoids freeing a pointer into an - ablocks structure. - - * puresize.h (BASE_PURESIZE): Increase to 1100000. - - * buffer.c (Fmove_overlay): Set overlay's next pointer unconditionally. - -2003-08-16 Richard M. Stallman <rms@gnu.org> - - * editfns.c (Fencode_time): Doc fix. - -2003-08-16 David Ponce <david@dponce.com> - - * fileio.c (Fwrite_region): Fix conditional expression to issue - the right message. - -2003-08-16 Juri Linkov <juri@jurta.org> - - * syntax.c (Fforward_word): Argument changed to optional. - Set default value to 1. - -2003-08-15 Kenichi Handa <handa@m17n.org> - - * xfaces.c (better_font_p): Prefer a real scalable font; i.e. not - what autoscaled. - (best_matching_font): Once we find a better scalable font, set - non_scalable_has_exact_height_p to 1. - (try_font_list): Call try_alternative_families to try any family - with the given registry. - -2003-08-09 Andreas Schwab <schwab@suse.de> - - * alloc.c (mark_object): Handle Lisp_Misc_Save_Value. - - * print.c (print_string): Fix printing of multibyte string with - nontrivial printcharfun. - -2003-07-31 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xfns.c (xg_set_icon): Rewrite to compile with GTK 2.0 and 2.2. - - * xterm.c (x_bitmap_icon): Return if xg_set_icon succeeds. - -2003-07-31 Kenichi Handa <handa@m17n.org> - - * process.c (read_process_output): Return the actually read bytes - instead of the result of decoding. - -2003-07-31 Kenichi Handa <handa@m17n.org> - - * xterm.h (struct x_bitmap_record): New member have_mask. - - * xfns.c (x_create_bitmap_from_data): Initialize have_mask member - to 0. - (x_create_bitmap_from_file): Likewise. - (x_destroy_bitmap): Check have_mask member before freeing a mask. - (x_destroy_all_bitmaps): Likewise. - (x_create_bitmap_mask): Set have_mask member to 1. - -2003-07-30 Richard M. Stallman <rms@gnu.org> - - * Makefile.in (CFLAGS) [!OPTIMIZE]: Undo previous change. - -2003-07-29 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (xg_mark_data): Update calls to mark_object. - -2003-07-29 Richard M. Stallman <rms@gnu.org> - - * xterm.c (xim_open_dpy, xim_initialize, xim_close_dpy): - Conditionalize XIM code on HAVE_XIM. - - * fns.c (Fclear_string): New function. - (syms_of_fns): defsubr it. - -2003-07-28 KOBAYASHI Yasuhiro <kobayays@otsukakj.co.jp> - - * xfns.c (xic_set_preeditarea): Add the left fringe width to spot.x. - -2003-07-22 Stefan Monnier <monnier@cs.yale.edu> - - * xfns.c: Don't check HAVE_PNG_H: autoconf doesn't seem to find it. - - * buffer.c (delete_all_overlays): New function. - * buffer.h (delete_all_overlays): Declare. - * coding.c (run_pre_post_conversion_on_str): - * print.c (temp_output_buffer_setup): - * fileio.c (Finsert_file_contents): - * minibuf.c (get_minibuffer): Use it. - -2003-07-22 Andrew Choi <akochoi@shaw.ca> - - * unexmacosx.c (unexec_regions_sort_compare): - (unexec_regions_merge): New functions. Sort and merge unexec - regions before dumping them. - -2003-07-22 Dave Love <fx@gnu.org> - - * xfns.c [HAVE_PNG]: Consider both png.h and libpng/png.h. - -2003-07-21 Stefan Monnier <monnier@cs.yale.edu> - - * alloc.c (MARK_STRING, UNMARK_STRING, STRING_MARKED_P) - (GC_STRING_CHARS, string_bytes): Use ARRAY_MARK_FLAG rather than - MARKBIT as the gcmarkbit for strings. - -2003-07-21 Richard M. Stallman <rms@gnu.org> - - * s/openbsd.h (LD_SWITCH_SYSTEM_TEMACS): Add undef. - - * fns.c (Flocale_info): Rename from Flanginfo. Doc fixes. - (syms_of_fns): Corresponding change. - - * alloc.c (syms_of_alloc): Doc fixes. - -2003-07-20 Han Boetes <han@mijncomputer.nl> (tiny change) - - * s/netbsd.h: Use -Wl syntax. - -2003-07-17 Richard M. Stallman <rms@gnu.org> - - * xterm.c (xim_initialize): Redo 6/24 change. - -2003-07-15 Stefan Monnier <monnier@cs.yale.edu> - - * buffer.c (copy_overlays): Use EMACS_INT for positions. - (Fswitch_to_buffer): Don't signal an error when switching to the same - buffer in a dedicated window. - - * alloc.c: Use bitmaps for cons, as was done for floats. - (init_float, init_cons): Let the normal code allocate the first block. - (CONS_BLOCK_SIZE): Redefine based on BLOCK_BYTES and bitmap size. - (CONS_BLOCK, CONS_INDEX, CONS_MARKED_P, CONS_MARK, CONS_UNMARK): - New macros. - (struct cons_block): Move conses to the beginning. Add gcmarkbits. - (Fcons): Use lisp_align_malloc and CONS_UNMARK. - (live_cons_p): Check the pointer is not past the `conses' array. - (mark_maybe_object, mark_maybe_pointer): Use CONS_MARKED_P. - (mark_object, mark_buffer): Use CONS_MARKED_P and CONS_MARK. - (survives_gc_p): Use CONS_MARKED_P and simplify. - (gc_sweep): Use CONS_MARKED_P, CONS_UNMARK, and lisp_align_free. - -2003-07-13 Paul Eggert <eggert@twinsun.com> - - GCC 3.3 (sparc) no longer puts "int foo = 0;" into data; it - puts it into BSS instead, at least on Solaris 8 and 9. - This is a valid optimization, and it may occur on other platforms, - so Emacs should not assume that initializing a static variable to - zero puts it into data. - * alloc.c (pure, staticvec): - Initialize these arrays to nonzero, so that they're not - put into BSS by that optimization. - -2003-07-13 Stefan Monnier <monnier@cs.yale.edu> - - * alloc.c (BLOCK_PADDING): Rename from ABLOCKS_PADDING. Update users. - (lisp_align_malloc): Use posix_memalign is available. - (ABLOCKS_BASE): Use HAVE_POSIX_MEMALIGN as an optimization. - (STRING_BLOCK_SIZE): Rename from STRINGS_IN_STRING_BLOCK - for consistency. Update users. - -2003-07-13 Richard M. Stallman <rms@gnu.org> - - * s/netbsd.h (START_FILES_1, END_FILES_1): Always define them. - -2003-07-13 Terje Rosten <terjeros@phys.ntnu.no> - - * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap): Modify to add mask, - and use the Gtk+ function gtk_window_icon_from_file if available. - - * xfns.c (x_bitmap_mask, x_create_bitmap_mask): New functions to - handle mask of bitmaps. - (x_allocate_bitmap_record, x_destroy_bitmap): Modify to handle the - mask property. - (xg_set_icon): New function, wrapper for gtk_window_icon_from_file. - - * xterm.h (xg_set_icon): New function. - -2003-07-12 Paul Eggert <eggert@twinsun.com> - - * unexelf.c (unexec): Consider a section to precede the .bss - section if its addresses overlap that of .bss. - -2003-07-12 Richard M. Stallman <rms@gnu.org> - - * Makefile.in (CFLAGS) [!OPTIMIZE]: Set CFLAGS to -g. - - * config.in (HAVE_CRTIN): Add #undef. - (INLINE): Really inline only if OPTIMIZE is defined. - - * s/netbsd.h (START_FILES, LIB_STANDARD): Use START_FILES_1, - END_FILES_1. - (START_FILES_1, END_FILES_1): New macros (conditional). - (LD_SWITCH_SYSTEM_TEMACS): Define. - - * s/openbsd.h: Don't include bsd4-3.h. - (TERMINFO): Define. - (LIBS_TERMCAP): Define. - (LD_SWITCH_SYSTEM): Define (two definitions). - - * xfns.c: Include libpng/png.h instead of png.h. - -2003-07-11 Andreas Schwab <schwab@suse.de> - - * buffer.c (modify_overlay): Update prototype. - * lisp.h (adjust_overlays_for_insert, adjust_overlays_for_delete): - Likewise. - -2003-07-09 Stefan Monnier <monnier@cs.yale.edu> - - * lisp.h (VALBITS): Define in terms of GCTYPEBITS. - (struct interval): Move to intervals.h. - (struct Lisp_Marker): Use EMACS_INT for position info. - (forward_point): Remove prototype of defunct function. - (Qmodification_hooks, Qrear_nonsticky, Fnext_property_change) - (Fget_text_property, Fset_text_properties, Ftext_propertes_not_all) - (syms_of_textprop, set_text_properties): Remove prototypes that are - already in intervals.h. - - * intervals.h (struct interval): Move from lisp.h. - Use EMACS_INT for position and size info. - - * coding.c: Include intervals.h for Fset_text_properties. - - * buffer.h (struct buffer_text, struct buffer): Use EMACS_INT for - position and length information. - -2003-07-09 Stefan Monnier <monnier@cs.yale.edu> - - * buffer.h (struct buffer_text, struct buffer): Use EMACS_INT for - position and length information. - -2003-07-09 Stefan Monnier <monnier@cs.yale.edu> - - Change overlays_after and overlays_before so the overlays themselves - are linked into lists, rather than using cons cells. After all each - Lisp_Misc already occupies 5 words, so we can add a `next' field to - Lisp_Overlay for free and save up one cons cell per overlay (not - to mention one indirection when traversing the list of overlay). - - * lisp.h (struct Lisp_Overlay): New field `next'. - - * buffer.h (struct buffer): Change overlays_before and overlays_after - from Lisp lists of overlays to pointers to overlays. - - * buffer.c (overlay_strings, recenter_overlay_lists): - Fix typo in eassert in last commit. - (unchain_overlay): New function. - (add_overlay_mod_hooklist): Use AREF. - (copy_overlays, reset_buffer, overlays_at, overlays_in) - (overlay_touches_p, overlay_strings, recenter_overlay_lists) - (fix_overlays_in_range, fix_overlays_before, Fmake_overlay) - (Fmove_overlay, Fdelete_overlay, Foverlay_lists) - (report_overlay_modification, evaporate_overlays, init_buffer_once): - Adjust to new type of overlays_(before|after). - - * alloc.c (mark_object): Mark the new `next' field of overlays. - (mark_buffer): Manually mark the overlays_(after|before) fields. - - * coding.c (run_pre_post_conversion_on_str): - * editfns.c (overlays_around): - * xdisp.c (load_overlay_strings): - * fileio.c (Finsert_file_contents): - * indent.c (current_column): - * insdel.c (signal_before_change, signal_after_change): - * intervals.c (set_point_both): - * print.c (temp_output_buffer_setup): Use new type for - overlays_(before|after). - -2003-07-08 Stefan Monnier <monnier@cs.yale.edu> - - * buffer.c (report_overlay_modification): Don't run hooks while - traversing the list of overlays. - - * buffer.h (struct buffer): Use an int for overlay_center. - (overlays_at, evaporate_overlays, recenter_overlay_lists) - (overlay_strings, fix_overlays_before): Use EMACS_INT for positions. - - * buffer.c (reset_buffer, recenter_overlay_lists) - (adjust_overlays_for_insert, adjust_overlays_for_delete) - (fix_overlays_in_range, Fmake_overlay, Fmove_overlay) - (evaporate_overlays, init_buffer_once): Update use of overlay_center. - (overlays_at, evaporate_overlays, recenter_overlay_lists) - (overlay_strings, fix_overlays_before): Use EMACS_INT for positions. - - * xdisp.c (fast_find_position): Remove unused var. - - * cmds.c (Qexpand_abbrev): New sym. - (syms_of_cmds): Initialize it. - (internal_self_insert): Use it to call expand-abbrev. - -2003-07-09 Kim F. Storm <storm@cua.dk> - - * xterm.c (use_xim) [!USE_XIM]: Default to disable XIM if Emacs - was configured with --without-xim. - (x_term_init) [!USE_XIM]: Use `useXIM' resource to turn on XIM. - -2003-07-07 Richard M. Stallman <rms@gnu.org> - - * xdisp.c (reseat_1): Set it->area to TEXT_AREA. - - * alloc.c (Fgarbage_collect): Doc fix. - -2003-07-07 Nozomu Ando <nand@mac.com> - - * buffer.c (Fkill_buffer): Clear charpos cache if necessary. - -2003-07-06 Stefan Monnier <monnier@cs.yale.edu> - - * minibuf.c (read_minibuf): UNGCPRO before returning. - (Ftry_completion, Fall_completions): Doc fix. - - * alloc.c (live_float_p): Check that p is not past the `floats' array, - now that `floats' is not the last element of the struct any more. - -2003-07-06 Jason Rumney <jasonr@gnu.org> - - * w32term.h (ClipboardSequence_Proc): New type. - - * w32fns.c (clipboard_sequence_fn): New variable. - (globals_of_w32fns): Initialize it. - - * w32select.c (last_clipboard_sequence_number): New variable. - (Fw32_set_clipboard_data, Fw32_get_clipboard_data): Use sequence - number if possible. - -2003-07-06 Stefan Monnier <monnier@cs.yale.edu> - - * m/amdx86-64.h (MARKBIT): - * m/ia64.h (MARKBIT): Remove definition since lisp.h does not compare - MARKBIT and ARRAY_MARK_FLAG any more. - - * m/hp800.h (XSETMARKBIT): - * m/sr2k.h (XSETMARKBIT): - * lisp.h (XSETMARKBIT): Remove unused macro. - - * lisp.h (mark_object): Change prototype. - - * alloc.c (mark_object): Change arg *Lisp_Object -> Lisp_Object. - (last_marked): Change accordingly. - (mark_interval, mark_maybe_object, mark_maybe_pointer) - (Fgarbage_collect, mark_glyph_matrix, mark_face_cache, mark_image) - (mark_buffer): Update calls to mark_object. - - * bytecode.c (mark_byte_stack): - * fns.c (sweep_weak_table): - * keyboard.c (mark_kboards): Update calls to mark_object. - -2003-07-06 Jason Rumney <jasonr@gnu.org> - - * alloc.c (struct ablock): Only include padding when there is some. - -2003-07-04 Stefan Monnier <monnier@cs.yale.edu> - - * alloc.c (ALIGN): Add casts to simplify usage. - (BLOCK_ALIGN, BLOCK_BYTES, ABLOCKS_PADDING, ABLOCKS_SIZE) - (ABLOCKS_BYTES, ABLOCK_ABASE, ABLOCKS_BUSY, ABLOCKS_BASE): New macros. - (struct ablock, struct ablocks): New types. - (free_ablock): New global var. - (lisp_align_malloc, lisp_align_free): New functions. - (FLOAT_BLOCK_SIZE): Redefine in terms of BLOCK_BYTES. - (struct float_block): Reorder and add gcmarkbits. - (GETMARKBIT, SETMARKBIT, UNSETMARKBIT, FLOAT_BLOCK, FLOAT_INDEX) - (FLOAT_MARKED_P, FLOAT_MARK, FLOAT_UNMARK): New macros. - (init_float, make_float): Use lisp_align_malloc. - (free_float, live_float_p): Don't use `type' any more. - (make_float): Use FLOAT_UNMARK to access to mark bit. - (mark_maybe_object, mark_maybe_pointer, survives_gc_p): - Use FLOAT_MARKED_P to access the mark bit. - (pure_alloc): Simplify use of ALIGN. - (mark_object): Use FLOAT_MARK to access the mark bit. - (gc_sweep): Use new macros to access the float's mark bit. - (init_alloc_once): Init free_ablock. - - * lisp.h (struct Lisp_Float): Remove unused field `type'. - -2003-06-27 Stefan Monnier <monnier@cs.yale.edu> - - * alloc.c (VECTOR_MARK, VECTOR_UNMARK, VECTOR_MARKED_P): New macros. - (GC_STRING_BYTES): Don't mask markbit (it's only used on `size'). - (allocate_buffer): Move. - (string_bytes): Don't mask markbit of `size_byte'. - (mark_maybe_object, mark_maybe_pointer, Fgarbage_collect) - (mark_object, mark_buffer, survives_gc_p, gc_sweep): - Use the `size' field of buffers (rather than the `name' field) for - the mark bit, as is done for all other vectorlike objects. - Use the new macros to access the mark bit of vectorlike objects. - -2003-06-26 Richard M. Stallman <rms@gnu.org> - - * puresize.h (BASE_PURESIZE): Increment base size. - - * xdisp.c (fast_find_position): Enable Gerd's new definition. - - * xterm.c (xim_initialize): Undo previous change. - -2003-06-26 Stefan Monnier <monnier@cs.yale.edu> - - * alloc.c (survives_gc_p): Simplify. - - * buffer.c (set_buffer_internal_1): Test CONSP for lists. - - * window.c (Fset_window_dedicated_p): Simplify. - (display_buffer_1): Don't raise the win from which minibuf was entered. - (temp_output_buffer_show): Don't assume BEG == 1. Simplify. - (Fminibuffer_selected_window): Simplify. - - * buffer.h (struct buffer_text): Lisp_Object `markers' => Lisp_Marker. - - * lisp.h (unchain_marker): Lisp_Object arg => Lisp_Marker. - (struct Lisp_Marker): Lisp_Object `chain' => Lisp_Marker `next'. - - * insdel.c (check_markers, adjust_markers_for_delete) - (adjust_markers_for_insert, adjust_markers_for_replace) - (prepare_to_modify_buffer, RESTORE_VALUE): - * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos) - (Fset_marker, set_marker_restricted, set_marker_both, unchain_marker) - (set_marker_restricted_both, Fbuffer_has_markers_at, count_markers): - * alloc.c (Fmake_marker, free_marker, gc_sweep): - * buffer.c (Fget_buffer_create, Fkill_buffer, Fset_buffer_multibyte): - * editfns.c (save_excursion_restore, transpose_markers): - * window.c (delete_window): - * xdisp.c (message_dolog): Update for new types. - -2003-06-26 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xfaces.c (set_font_frame_param): Set default_face_done_p to zero. - (realize_default_face): Use default_face_done_p for the force_p - argument to set_lface_from_font_name. Set default_face_done_p to one. - - * frame.c (make_frame): Initialize default_face_done_p. - - * frame.h (struct frame): Add default_face_done_p. - - * config.in: Add XRegisterIMInstantiateCallback_arg6 so it - will be defined. - -2003-06-25 Stefan Monnier <monnier@cs.yale.edu> - - * alloc.c (make_interval, Fmake_symbol, allocate_misc): - Initialize the new field `gcmarkbit'. - (mark_interval, MARK_INTERVAL_TREE): Use the new `gcmarkbit' field. - (mark_interval_tree): Don't mark the tree separately from the nodes. - (UNMARK_BALANCE_INTERVALS): Don't unmark the tree. - (mark_maybe_object, mark_maybe_pointer, Fgarbage_collect) - (mark_object, survives_gc_p, gc_sweep): Use new `gcmarkbit' fields. - - * lisp.h (struct interval, struct Lisp_Symbol, struct Lisp_Free) - (struct Lisp_Marker, struct Lisp_Intfwd, struct Lisp_Boolfwd) - (struct Lisp_Kboard_Objfwd, struct Lisp_Save_Value) - (struct Lisp_Buffer_Local_Value, struct Lisp_Overlay) - (struct Lisp_Objfwd, struct Lisp_Buffer_Objfwd): Add `gcmarkbit' field. - -2003-06-24 Dave Love <fx@gnu.org> - - * xterm.c (xim_initialize): Use XRegisterIMInstantiateCallback_arg6. - - * strftime.c: Test HAVE_SYS__MBSTATE_H, not __hpux. Merge changes - from gnulib. - -2003-06-21 Richard M. Stallman <rms@gnu.org> - - * fileio.c (Fwrite_region): Alternate messages - for append and partial write. - - * keyboard.c (read_key_sequence): When converting upcase fn key to - downcase, update fkey and keytran so `backspace' gets translated. - - * keyboard.c (read_avail_input): Don't signal SIGHUP in batch mode. - - * process.c (wait_reading_process_input): Don't signal SIGIO - in batch mode. - -2003-06-17 Kenichi Handa <handa@m17n.org> - - * Makefile.in (xselect.o): Don't depend on charset.h, coding.h, - composite.h. - - * xselect.c: Don't include charset.h, coding.h, composite.h. - (Qforeign_selection): New variable. - (syms_of_xselect): Intern and static it. - (selection_data_to_lisp_data): Return a unibyte string made from - data with `foreign-selection' text property. - -2003-06-15 Stefan Monnier <monnier@cs.yale.edu> - - * termhooks.h (EVENT_INIT): New macro. - - * keyboard.c (mark_kboards): Move from alloc.c. Mark kbd_buffer. - - * alloc.c (mark_kboards): Move to keyboard.c. - - * keyboard.c (record_asynch_buffer_change, read_avail_input): - * xterm.c (x_dispatch_event): - * xmenu.c (find_and_call_menu_selection): - * xdisp.c (handle_tool_bar_click): - * w32menu.c (menubar_selection_callback): - * sysdep.c (kbd_input_ast, read_input_waiting): - * msdos.c (dos_rawgetc): - * macterm.c (mac_check_for_quit_char): - * macmenu.c (menubar_selection_callback): - * gtkutil.c (xg_tool_bar_callback): Don't pass uninitialized - data to kbd_buffer_store_event. - -2003-06-15 Kim F. Storm <storm@cua.dk> - - * xdisp.c (x_fix_overlapping_area): Always use area relative X - to fix redisplay problem with tall characters (such as ,AC(B). - -2003-06-13 Kai Gro,A_(Bjohann <kai.grossjohann@gmx.net> - - * fileio.c (Fcopy_file): Doc fix: copies file modes, too. - -2003-06-12 Kenichi Handa <handa@m17n.org> - - * fileio.c (Fwrite_region): Save and restore restriction. - -2003-06-12 Dave Love <fx@gnu.org> - - * alloca.c (alloca): Declare arg as size_t. - - * sysdep.c: Remove redundant include of unistd.h, stdlib.h. - Use HAVE_DECL_SYS_SIGLIST, not SYS_SIGLIST_DECLARED. - -2003-06-11 Dave Love <fx@gnu.org> - - * search.c (shrink_regexp_cache): Use xrealloc. - (syms_of_search): Use xmalloc. - -2003-06-10 Kim F. Storm <storm@cua.dk> - - * xdisp.c (phys_cursor_in_rect_p): Fix 2003-05-24 change. - Adjust phys_cursor.x to be relative to window box, rather than - text area before checking -- to ensure cursor is redrawn when - exposing window. - Note: This also fixes a similar (older) bug if display margins - are present. - -2003-06-06 Kenichi Handa <handa@m17n.org> - - * coding.c (encoding_buffer_size): If coding->type is - coding_type_ccl, double magnification on CRLF encoding. - -2003-06-06 Jason Rumney <jasonr@gnu.org> - - * w32reg.c (SYSTEM_DEFAULT_RESOURCES): New constant. - (w32_get_string_resource): Try SYSTEM_DEFAULT_RESOURCES last. - - * xfaces.c (Finternal_face_x_get_resource): Do it on Windows and - Mac too. - -2003-06-05 Dave Love <fx@gnu.org> - - * strftime.c: Merge changes from gnulib. - - * mktime.c (__mktime_internal): Merge changes from gnulib - involving year 69 and dst2. - - Changes to merge with gnulib version and be consistent with the - autoconf test: - - * getloadavg.c: Set NLIST_STRUCT from HAVE_NLIST_H. - Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not NLIST_NAME_UNION. - [HAVE_LOCALE_H]: Include locale.h. - (getloadavg) [HAVE_SETLOCALE]: Run sscanf in C locale. - -2003-06-05 Kim F. Storm <storm@cua.dk> - - * window.c (coordinates_in_window): Convert X and Y to window - relative coordinates inside mode-line and header-line parts. - Convert X and Y to margin area relative coordinates inside left - and right display margin parts. - -2003-06-05 Jason Rumney <jasonr@gnu.org> - - * w32fns.c (add_system_logical_colors_to_map): New function. - (Fx_open_connection): Use it. - -2003-06-04 Stefan Monnier <monnier@cs.yale.edu> - - * process.c (allocate_pty): Revert part of the previous patch. - (Faccept_process_output): Simplify. - -2003-06-04 Jason Rumney <jasonr@gnu.org> - - * termhooks.h (enum event_kind): Remove MOUSE_WHEEL_EVENT. - - * keyboard.c (Qmouse_wheel, mouse_wheel_syms) - (lispy_mouse_wheel_names): Remove. - (syms_of_keyboard): Remove Qmouse_wheel and mouse_wheel_syms. - Always define drag_and_drop_syms. - - * macterm.c (XTread_socket): Map mouse wheel events to Emacs - WHEEL_EVENT events. - -2003-06-03 Stefan Monnier <monnier@cs.yale.edu> - - * xdisp.c (update_tool_bar): Add missing UNGCPRO. - - * buffer.c (init_buffer_once): Make kill-buffer-hook permanent-local. - -2003-06-03 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (make_menu_item): Make sure we don't crash on a NULL - menu item label. - -2003-06-03 Richard M. Stallman <rms@gnu.org> - - * window.c (Fwindow_edges): Doc fix. - (Fwindow_pixel_edges, Fwindow_inside_edges) - (Fwindow_inside_pixel_edges): New functions. - (syms_of_window): defsubr them. - - * window.h (WINDOW_LEFT_FRINGE_COLS, WINDOW_RIGHT_FRINGE_COLS) - (WINDOW_MODE_LINE_LINES, WINDOW_HEADER_LINE_LINES): New macros. - -2003-06-02 Stefan Monnier <monnier@cs.yale.edu> - - * dispnew.c (Fsit_for): Don't lie about the number of args. - -2003-06-02 Dave Love <fx@gnu.org> - - * callproc.c: Use HAVE_FCNTL_H, not USG5. - (syms_of_callproc) <process-environment>: Doc fix. - - * doc.c: Use HAVE_FCNTL_H, not USG5. - - * xfaces.c (font_rescale_ratio): Fix for K&R. - - * termcap.c: Use HAVE_FCNTL_H, not _POSIX_VERSION. - - * mem-limits.h: Use HAVE_SYS_RESOURCE_H, HAVE_SYS_VLIMIT_H. - - * lread.c [HAVE_FCNTL_H]: Include fcntl.h. - - * gtkutil.c: Include keyboard.h, charset.h, coding.h. - (xg_create_frame_widgets): Use ENCODE_UTF_8. - - * xterm.c (Qutf_8): Move to coding.c. - - * xmenu.c (ENCODE_MENU_STRING): New. - (list_of_panes, list_of_items, digest_single_submenu, xmenu_show): - Use it. - - * coding.h (ENCODE_UTF_8): New. - (Qutf_8): Declare. - - * coding.c (Qutf_8): New. - (syms_of_coding): Intern it. - - * fns.c: Doc fixes. - -2003-06-02 Kenichi Handa <handa@m17n.org> - - * buffer.c (Fset_buffer_multibyte): Fix previous change. - -2003-06-01 Stefan Monnier <monnier@cs.yale.edu> - - * lread.c (openp): Make sure STR is a string. - -2003-06-01 David Ponce <david@dponce.com> - - * termhooks.h (enum event_kind): Add new WHEEL_EVENT event. - Declare MOUSE_WHEEL_EVENT only if MAC_OSX defined. - - * keyboard.c (Qmouse_wheel): Declare only if MAC_OSX defined. - (mouse_wheel_syms, lispy_mouse_wheel_names): Likewise. - (discard_mouse_events): Discard WHEEL_EVENT events too. - (lispy_wheel_names, wheel_syms): New. - (syms_of_keyboard): Init and staticpro `wheel_syms'. Init and - staticpro `Qmouse_wheel' and `mouse_wheel_syms' only if MAC_OSX defined. - (make_lispy_event): Add WHEEL_EVENT handler. - - * w32term.c (construct_mouse_wheel): Construct WHEEL_EVENT. - (w32_read_socket): Map w32 WM_MOUSEWHEEL events to Emacs - WHEEL_EVENT events. - -2003-05-31 John Paul Wallington <jpw@gnu.org> - - * Makefile.in (lisp, shortlisp): byte-run, float-sup, map-ynp, and - timer are in lisp/emacs-lisp. - -2003-05-31 Kenichi Handa <handa@m17n.org> - - * buffer.c (Fset_buffer_multibyte): Correctly recover a narrowed - region when a buffer is changed to unibyte. - - * charset.h (VALID_LEADING_CODE_P): New macro. - (UNIBYTE_STR_AS_MULTIBYTE_P): Check more rigidly. - - * coding.c (DECODE_EMACS_MULE_COMPOSITION_CHAR): If coding->flags - is nonzero, accept multibyte form of eight-bit-control chars. - (decode_composition_emacs_mule): Likewise. - (decode_coding_emacs_mule): Likewise. - (encode_coding_emacs_mule): If coding->flags is nonzero, produce - multibyte form of eight-bit-control chars. - - * fileio.c (Qauto_save_coding, auto_save_coding): New variables. - (Finsert_file_contents): If coding-system-for-read is bound to - Qauto_save_coding, use the coding system emacs-mule with special - setting for recovering a file. - (choose_write_coding_system): On auto saving, use the coding - system emacs-mule with special setting for auto saving. - (syms_of_fileio) <Qauto_save_coding>: Intern and staticpro it. - -2003-05-30 Kenichi Handa <handa@m17n.org> - - * coding.c (ccl_coding_driver): Set ccl->eight_bit_control - properly before calling ccl_driver. - - * ccl.h (struct ccl_program) <eight_bit_control>: Comment fixed. - - * ccl.c (CCL_WRITE_CHAR): Increment extra_bytes only when it is nonzero. - (ccl_driver): Initialize extra_bytes to ccl->eight_bit_control. - (setup_ccl_program): Initialize ccl->eight_bit_control to zero. - -2003-05-29 Glenn Morris <gmorris@ast.cam.ac.uk> - - * xfaces.c (realize_default_face): Do not abort if lface is - non-existent - reverts change from 2003-05-19. - -2003-05-29 Kenichi Handa <handa@m17n.org> - - * coding.c (decode_coding_iso2022): Pay attention to the byte - sequence of CTEXT extended segment, and retain those bytes as is. - -2003-05-28 Kenichi Handa <handa@m17n.org> - - * coding.c (ENCODE_UNSAFE_CHARACTER): Adjust for the name change - of CODING_REPLACEMENT_CHARACTER. - (decode_coding_iso2022): If CODING_FLAG_ISO_SAFE, set - CODING_MODE_INHIBIT_UNENCODABLE_CHAR flag in coding->mode, and - check this flag on encoding. - (encode_coding_sjis_big5): - Check CODING_MODE_INHIBIT_UNENCODABLE_CHAR flag of coding->mode. - (Fset_terminal_coding_system_internal): - Set CODING_MODE_INHIBIT_UNENCODABLE_CHAR flag in terminal_coding.mode - instead of setting CODING_FLAG_ISO_SAFE flag in terminal_coding.flags. - - * coding.h (CODING_REPLACEMENT_CHARACTER): Rename from - CODING_INHIBIT_CHARACTER_SUBSTITUTION. - (CODING_MODE_INHIBIT_UNENCODABLE_CHAR): New macro. - -2003-05-28 Richard M. Stallman <rms@gnu.org> - - * print.c (syms_of_print) <print-escape-nonascii>: Doc fix. - - * eval.c (unbind_to): Move init of this_binding to separate statement. - -2003-05-28 Kim F. Storm <storm@cua.dk> - - * xdisp.c (expose_window): Fix error in calculation of - window relative coordinates of area to redisplay. - -2003-05-27 Jason Rumney <jasonr@gnu.org> - - * w32term.c (GET_WHEEL_DELTA_WPARAM): New macro. - -2003-05-27 David Ponce <david@dponce.com> - - Handle W32 mouse wheel events as mouse click events, like in X. - - * keyboard.c (make_lispy_event) [WINDOWSNT]: Don't handle - MOUSE_WHEEL_EVENT anymore. - - * w32term.c (construct_mouse_wheel): Result is a MOUSE_CLICK_EVENT. - Scrolling down/up the mouse wheel is respectively mapped to mouse - button 4 and 5. - (w32_read_socket): Map w32 WM_MOUSEWHEEL events to Emacs - MOUSE_CLICK_EVENT events. Forward w32 MSH_MOUSEWHEEL events as - WM_MOUSEWHEEL events. - -2003-05-27 Andreas Schwab <schwab@suse.de> - - * buffer.c (syms_of_buffer) <default-direction-reversed>: Doc fix. - - * xdisp.c (try_window_id): Avoid aborting if PT is inside a - partially visible line. - - * alloc.c (Fgarbage_collect): Fix last change. - -2003-05-26 John Paul Wallington <jpw@gnu.org> - - * xfns.c (Fx_create_frame): Don't call Qface_set_after_frame_default. - -2003-05-25 Stefan Monnier <monnier@cs.yale.edu> - - * window.c (Fset_window_buffer): Add type of `keep_margins'. - (Fset_window_fringes, Fset_window_scroll_bars): Declare before use. - - * window.h (window_box_text_cols): Declare. - - * xdisp.c (window_text_bottom_y, draw_row_fringe_bitmaps) - (x_draw_vertical_border): Remove unused var `f'. - - * xfaces.c (build_scalable_font_name): Remove `unused var - pixel_size' warning. - - * xfns.c (png_load): Remove `unused vars intent, image_gamma' warning. - - * unexelf.c (unexec): Remove `unused var n' warning. - - * strftime.c (my_strftime_localtime_r): Remove `defined but - unused' warning. - - * process.c (allocate_pty): Remove `unused var stb' and - `cp might be used uninitialized' warnings. - - * dispnew.c (mode_line_string): Remove unused var `f'. - - * coding.c (find_safe_codings): Remove unused var `i'. - - * bytecode.c (Fbyte_code): Remove `unused val' warning. - - * buffer.c (Fkill_buffer): Remove unused var `list'. - - * alloc.c (Fgarbage_collect): Remove `unused var tail' warning. - -2003-05-25 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * frame.c (make_frame): Condition want_fullscreen with - HAVE_WINDOW_SYSTEM. - -2003-05-25 Juanma Barranquero <lektu@terra.es> - - * window.c (Fset_window_scroll_bars): Fix typo in argument name. - (Fwindow_scroll_bars): Fix typo in docstring. - -2003-05-24 Kim F. Storm <storm@cua.dk> - - The following changes serve several purposes: - - 1) Swap the position of fringes and display margins in windows, i.e. - the fringes are now displayed between the margins and the text area - (by default). - - 2) Allow fringe and scroll bar parameters to be set per-buffer and - per-window (like display margins). Such settings are now stored - in window configurations, preserved when frames are resized, and - copied when windows are split vertically or horizontally. - Several bugs related to display margins have been fixed. - - 3) Consistently use FRAME_FONT and FRAME_FONTSET macros. - - 4) Use FRAME_COLUMN_WIDTH (f) consistently throughout the code - rather than FRAME_WIDTH (FRAME_FONT (f)). - - 5) Introduce a consistent naming of variables, members and macros - depending on whether their value is measured in pixels or in - canonical columns/lines. Pixel dimensions are named *_width and - *_height, while canonical columns/lines are named *_cols and - *_lines. Pixel positions are named *_x and *_y, while column/line - positions are named *_col and *_line. - - 6) Consolidate more of the X, W32, and MAC gui code by moving - common data into struct frame, and generalize it for the non-gui - case by using suitable defaults. - - 7) Cleanup and consolidate the macros controlling frame and window - layout into frame.h and window.h, and generalize the use of the - various window_box_* functions (enhanced to handle the new fringe - position and the per-window fringe and scroll bar settings). - - * frame.h (struct frame): Rename members height to text_lines, - width to text_cols, window_height to total_lines, window_width to - total_cols, new_height to new_text_lines, new_width to - new_text_cols. All uses changed. - (struct frame): New members which consolidate common members of - x_output, w32_output, and mac_output structures: left_pos, - top_pos, pixel_height, pixel_width, x_pixels_diff, y_pixels_diff, - win_gravity, size_hint_flags, border_width, internal_border_width, - line_height, fringe_cols, left_fringe_width, right_fringe_width, - want_fullscreen. All uses changed. - (struct frame): New member column_width contaning the canonical - column width, analogue to line_height. All uses changed. - (struct frame): Rename members scroll_bar_pixel_width to - config_scroll_bar_width, and scroll_bar_cols to - config_scroll_bar_cols. All uses changed. - (struct frame): New member scroll_bar_actual_width which - consolidates and renames the vertical_scroll_bar_extra member of - x_output, w32_output, and mac_output structures. All uses changed. - (FRAME_PIXEL_HEIGHT): Rename from PIXEL_HEIGHT and moved - from x/w32/macterm.h files. All uses changed. Also change code - which referred to f->output_data...->pixel_height. - (FRAME_PIXEL_WIDTH): Rename from PIXEL_WIDTH and moved - from x/w32/macterm.h files. All uses changed. Also change code - which referred to f->output_data...->pixel_width. - (FRAME_LINES): Rename from FRAME_HEIGHT. All uses changed. - Also change code which referred to f->height. - (FRAME_COLS): Rename from FRAME_WIDTH. All uses changed. - Also change code which referred to f->width. - (FRAME_NEW_HEIGHT, FRAME_NEW_WIDTH): Remove macros; change uses - to update new_text_lines and new_text_cols members directly. - (FRAME_CONFIG_SCROLL_BAR_WIDTH): Rename from - FRAME_SCROLL_BAR_PIXEL_WIDTH. All uses changed. - (FRAME_CONFIG_SCROLL_BAR_COLS): Rename from - FRAME_SCROLL_BAR_COLS. All uses changed. - (FRAME_LEFT_SCROLL_BAR_COLS, FRAME_RIGHT_SCROLL_BAR_COLS): - Rename from FRAME_LEFT_SCROLL_BAR_WIDTH and - FRAME_RIGHT_SCROLL_BAR_WIDTH, resp. All uses changed. - (FRAME_SCROLL_BAR_AREA_WIDTH, FRAME_LEFT_SCROLL_BAR_AREA_WIDTH) - (FRAME_RIGHT_SCROLL_BAR_AREA_WIDTH): New macros. - (FRAME_TOTAL_COLS): Rename from FRAME_WINDOW_WIDTH. - (SET_FRAME_COLS): Rename from SET_FRAME_WIDTH. - (FRAME_TOTAL_COLS_ARG): Rename from FRAME_WINDOW_WIDTH_ARG. - (WINDOW_VERTICAL_SCROLL_BAR_COLUMN): Remove unused macro. - (WINDOW_VERTICAL_SCROLL_BAR_HEIGHT): Remove unused macro. - (FRAME_LINE_HEIGHT): Rename from CANON_Y_UNIT. - Unconditionally return line_height member (it now has proper value - also for non-window frames). - (FRAME_COLUMN_WIDTH): Rename from CANON_X_UNIT. Unconditionally - return new column_width member (rather than the default font width). - (FRAME_FRINGE_COLS, FRAME_LEFT_FRINGE_WIDTH) - (FRAME_RIGHT_FRINGE_WIDTH): Rename from FRAME_X_... and moved - from x/w32/macterm.h files. Unconditionally return corresponding - member of frame structure (they now have proper values also for - non-window frames). - (FRAME_TOTAL_FRINGE_WIDTH): Rename from FRAME_FRINGE_WIDTH. - Calculate return value from left and right widths. - (FRAME_INTERNAL_BORDER_WIDTH): Unconditionally return - internal_border_width member (has proper value for non-window frame). - (FRAME_PIXEL_X_FROM_CANON_X): Rename from PIXEL_X_FROM_CANON_X. - (FRAME_PIXEL_Y_FROM_CANON_Y): Rename from PIXEL_Y_FROM_CANON_Y. - (FRAME_CANON_X_FROM_PIXEL_X): Rename from CANON_X_FROM_PIXEL_X. - (FRAME_CANON_Y_FROM_PIXEL_Y): Rename from CANON_Y_FROM_PIXEL_Y. - (FRAME_LINE_TO_PIXEL_Y): Rename from CHAR_TO_PIXEL_ROW, - consolidated from xterm.h, macterm.h, and w32term.h. - (FRAME_COL_TO_PIXEL_X): Rename from CHAR_TO_PIXEL_COL, - consolidated from xterm.h, macterm.h, and w32term.h. - (FRAME_TEXT_COLS_TO_PIXEL_WIDTH): Rename from - CHAR_TO_PIXEL_WIDTH consolidated from x/mac/w32term.h. - (FRAME_TEXT_LINES_TO_PIXEL_HEIGHT): Rename from - CHAR_TO_PIXEL_HEIGHT consolidated from x/mac/w32term.h. - (FRAME_PIXEL_Y_TO_LINE): Rename from PIXEL_TO_CHAR_ROW - consolidated from x/mac/w32term.h. - (FRAME_PIXEL_X_TO_COL): Rename from PIXEL_TO_CHAR_COL - consolidated from x/mac/w32term.h. - (FRAME_PIXEL_WIDTH_TO_TEXT_COLS): Rename from - PIXEL_TO_CHAR_WIDTH consolidated from x/mac/w32term.h. - (FRAME_PIXEL_HEIGHT_TO_TEXT_LINES): Rename from - PIXEL_TO_CHAR_HEIGHT consolidated from x/mac/w32term.h. - - * window.h (struct window): Rename members left to left_col, - top to top_line, height to total_lines, width to total_cols, - left_margin_width to left_margin_cols, right_margin_width to - right_margin_cols, orig_height to orig_total_lines, orig_top to - orig_top_line. All uses changed. - (struct window): New members left_fringe_width, right_fringe_width, - fringes_outside_margins, scroll_bar_width, vertical_scroll_bar_type. - (WINDOW_XFRAME, WINDOW_FRAME_COLUMN_WIDTH, WINDOW_FRAME_LINE_HEIGHT): - New macros primarily used to simplify other macros. - (WINDOW_TOTAL_COLS): New macro. Change relevant code that - referred to XINT (w->width). - (WINDOW_TOTAL_LINES): New macro. Change relevant code that - referred to XINT (w->height). - (WINDOW_TOTAL_WIDTH): New macro. Change relevant code that - referred to XINT (w->width) * canon_x_unit. - (WINDOW_TOTAL_HEIGHT): New macro. Change relevant code that - referred to XINT (w->height) * canon_y_unit. - (WINDOW_LEFT_EDGE_COL): New macro. Change relevant code that - referred to XINT (w->left). - (WINDOW_RIGHT_EDGE_COL): Rename from WINDOW_RIGHT_EDGE. Change - all uses and code that referred to XINT (w->left) + XINT (w->width). - (WINDOW_TOP_EDGE_LINE): New macro. Change relevant code that - referred to XINT (w->top). - (WINDOW_BOTTOM_EDGE_LINE): New macro. Change relevant code that - referred to XINT (w->top) + XINT (w->height). - (WINDOW_LEFT_EDGE_X): New macro. Change relevant code that - referred to XINT (w->left) * canon_x_unit. - (WINDOW_RIGHT_EDGE_X): New macro. Change relevant code that - referred to (XINT (w->left) + XINT (w->width)) * canon_x_unit. - (WINDOW_TOP_EDGE_Y): New macro. Change relevant code that - referred to XINT (w->top) * canon_y_unit. - (WINDOW_BOTTOM_EDGE_Y): New macro. Change relevant code that - referred to (XINT (w->top) + XINT (w->height)) * canon_y_unit. - (WINDOW_LEFTMOST_P): New macro. - (WINDOW_BOX_LEFT_EDGE_COL): Rename from WINDOW_LEFT_MARGIN. - All uses changed. - (WINDOW_BOX_RIGHT_EDGE_COL): Rename from WINDOW_RIGHT_MARGIN. - All uses changed. - (WINDOW_BOX_LEFT_EDGE_X): Rename from - WINDOW_DISPLAY_LEFT_EDGE_PIXEL_X, moved from dispextern.h. - Do not exclude left fringe width. - (WINDOW_BOX_RIGHT_EDGE_X): Rename from - WINDOW_DISPLAY_RIGHT_EDGE_PIXEL_X, moved from dispextern.h. - Do not exclude fringe widths. - (WINDOW_LEFT_FRINGE_WIDTH, WINDOW_RIGHT_FRINGE_WIDTH) - (WINDOW_FRINGE_COLS, WINDOW_TOTAL_FRINGE_WIDTH): New macros. - Change relevant code that referred to FRAME_LEFT_FRINGE_WIDTH, - FRAME_RIGHT_FRINGE_WIDTH, FRAME_FRINGE_COLS, and - FRAME_TOTAL_FRINGE_WIDTH to allow per-window fringe settings. - (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS): New macro. - (WINDOW_VERTICAL_SCROLL_BAR_TYPE, WINDOW_HAS_VERTICAL_SCROLL_BAR) - (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT) - (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT) - (WINDOW_CONFIG_SCROLL_BAR_WIDTH, WINDOW_CONFIG_SCROLL_BAR_COLS): - New macros. Change code which referenced corresponding - FRAME_VERTICAL_SCROLL_BAR_TYPE, FRAME_HAS_VERTICAL_SCROLL_BARS, - FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT, - FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT, - FRAME_SCROLL_BAR_PIXEL_WIDTH, and FRAME_SCROLL_BAR_COLS macros to - allow per-window scroll-bar settings. - (WINDOW_LEFT_SCROLL_BAR_COLS, WINDOW_RIGHT_SCROLL_BAR_COLS): New macros. - (WINDOW_LEFT_SCROLL_BAR_AREA_WIDTH): New macro. Change code that - referred to FRAME_LEFT_SCROLL_BAR_WIDTH. - (WINDOW_RIGHT_SCROLL_BAR_AREA_WIDTH): New macro. Change code - that referred to FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT and - FRAME_SCROLL_BAR_WIDTH. - (WINDOW_SCROLL_BAR_COLS, WINDOW_SCROLL_BAR_AREA_WIDTH) - (WINDOW_SCROLL_BAR_AREA_X): New macros. - (WINDOW_HEADER_LINE_HEIGHT): Rename from - WINDOW_DISPLAY_HEADER_LINE_HEIGHT, moved from dispextern.h. - (WINDOW_BOX_HEIGHT_NO_MODE_LINE): Rename from - WINDOW_DISPLAY_HEIGHT_NO_MODE_LINE, moved from dispextern.h. - (WINDOW_BOX_TEXT_HEIGHT): Rename from - WINDOW_DISPLAY_PIXEL_WIDTH, moved from dispextern.h. - (WINDOW_TO_FRAME_PIXEL_X, WINDOW_TO_FRAME_PIXEL_Y) - (FRAME_TO_WINDOW_PIXEL_X, FRAME_TO_WINDOW_PIXEL_Y) - (WINDOW_TEXT_TO_FRAME_PIXEL_X): Move here from dispextern.h. - (WINDOW_LEFT_MARGIN_WIDTH): Rename from - WINDOW_DISPLAY_LEFT_AREA_PIXEL_WIDTH, moved from dispextern.h. - (WINDOW_RIGHT_MARGIN_WIDTH): Rename from - WINDOW_DISPLAY_RIGHT_AREA_PIXEL_WIDTH, moved from dispextern.h. - (window_from_coordinates): Update prototype. - (Fset_window_buffer): Update EXFUN. - (set_window_buffer): Update prototype. - - * dispextern.h (struct glyph_matrix): Rename members window_left_x - to window_left_col, window_top_y to window_top_line. All uses - changed. - (FRAME_INTERNAL_BORDER_WIDTH_SAFE): Remove macro; can now safely - use FRAME_INTERNAL_BORDER_WIDTH macro instead as - internal_border_width is now set to 0 for non-window frames. - (WINDOW_DISPLAY_PIXEL_WIDTH, WINDOW_DISPLAY_PIXEL_HEIGHT) - (WINDOW_DISPLAY_MODE_LINE_HEIGHT, WINDOW_DISPLAY_HEADER_LINE_HEIGHT) - (WINDOW_DISPLAY_HEIGHT_NO_MODE_LINE, WINDOW_DISPLAY_TEXT_HEIGHT) - (WINDOW_DISPLAY_LEFT_EDGE_PIXEL_X, WINDOW_DISPLAY_RIGHT_EDGE_PIXEL_X) - (WINDOW_DISPLAY_TOP_EDGE_PIXEL_Y, WINDOW_DISPLAY_BOTTOM_EDGE_PIXEL_Y) - (WINDOW_TO_FRAME_PIXEL_X, WINDOW_TO_FRAME_PIXEL_Y) - (FRAME_TO_WINDOW_PIXEL_X, FRAME_TO_WINDOW_PIXEL_Y) - (WINDOW_DISPLAY_LEFT_AREA_PIXEL_WIDTH) - (WINDOW_DISPLAY_RIGHT_AREA_PIXEL_WIDTH, WINDOW_WANTS_MODELINE_P): - Move to window.h and renamed [see window.h changes]. - (WINDOW_AREA_TO_FRAME_PIXEL_X, WINDOW_AREA_PIXEL_WIDTH) - (WINDOW_DISPLAY_TEXT_AREA_PIXEL_WIDTH): Remove macros. - (WINDOW_WANTS_MODELINE_P, WINDOW_WANTS_HEADER_LINE_P): - Use WINDOW_TOTAL_LINES. - (frame_update_line_height): Remove prototype. - - * buffer.h (struct buffer): Rename members measured in columns: - left_margin_width to left_margin_cols, right_margin_width to - right_margin_cols. All uses changed. - New members left_fringe_width, right_fringe_width, - fringes_outside_margins for per-buffer fringe settings. - New members scroll_bar_width and vertical_scroll_bar_type for - per-buffer scroll bar settings. - - * buffer.c (init_buffer_once): Set buffer_defaults and - buffer_local_flags for new buffer-local variables - left_fringe_width, right_fringe_width, fringes_outside_margins, - scroll_bar_width, and vertical_scroll_bar_type. - (syms_of_buffer): Defvar_per_buffer them, and defvar_lisp_nopro - default-* variables for them. - - * dispnew.c: Make (many) trivial substitutions for renamed and - new macros in dispextern.h, frame.h and window.h. - (mode_line_string): No need to adjust width for mode lines, as it - is already adjusted by the caller. - (marginal_area_string): Handle fringes inside/outside margins. - - * frame.c: Make (many) trivial substitutions for renamed and - new macros in dispextern.h, frame.h and window.h. - (make_frame): Initialize left_fringe_width, right_fringe_width, - fringe_cols, scroll_bar_actual_width, border_width, - internal_border_width, column_width, line_height, x_pixels_diff, - y_pixels_diff, want_fullscreen, size_hint_flags, and win_gravity - members with values suitable for a non-window frames. - - * gtkutil.c: Make (many) trivial substitutions for renamed and - new macros in dispextern.h, frame.h and window.h. - - * indent.c: Make (few) trivial substitutions for renamed and - new macros in dispextern.h, frame.h and window.h. - - * keyboard.c: Make (many) trivial substitutions for renamed and - new macros in dispextern.h, frame.h and window.h. - (make_lispy_event): Use window positions returned from - window_from_coordinates when constructing the lisp event for - MOUSE_CLICK_EVENT and DRAG_N_DROP_EVENT, rather than calculating - (incorrect) values locally. - (make_lispy_movement): Use window positions returned from - window_from_coordinates when constructing the lisp event, rather - than calculating (incorrect) values locally. - - * scroll.c: Make (some) trivial substitutions for renamed and - new macros in dispextern.h, frame.h and window.h. - - * sunfns.c (Fsun_menu_internal): Adapt to per-window fringes and - scroll-bars. - - * sysdep.c: Make (few) trivial substitutions for renamed and - new macros in dispextern.h, frame.h and window.h. - - * term.c: Make (some) trivial substitutions for renamed and - new macros in dispextern.h, frame.h and window.h. - - * widget.c: Make (few) trivial substitutions for renamed and - new macros in dispextern.h, frame.h and window.h. - - * window.c: Make (many) trivial substitutions for renamed and - new macros in dispextern.h, frame.h and window.h. - (make_window): Initialize new members - left_margin_cols, right_margin_cols, left_fringe_width, - right_fringe_width, fringes_outside_margins, scroll_bar_width, - and vertical_scroll_bar_type. - (coordinates_in_window): Adapt to new fringe/margin positions - and per-window fringes and scroll-bars. - Fix bug related to incorrectly adjusting coordinates by - frame's internal_border_width (the effect normally negible since - the internal_border_width is typically 0 or 1 pixel, but very - noticeable for an internal_border_width of e.g. 25 pixels). - Upon successful return (other than ON_NOTHING), the coordinates - are now always properly converted to window relative for the - given display element. - (window_from_coordinates): Add new parameters wx and wy to - return the window relative x and y position in the returned - window and part. A null arg means, don't return the position. - All callers changed. - (adjust_window_margins): New function which may reduce the width - of the display margins if a window's text area is too small after - resizing or splitting windows. - (size_window): Fix bug that did not account for display margin - widths when checking the minimum width of a window; use - adjust_window_margins. - (set_window_buffer): Call Fset_window_fringes and - Fset_window_scroll_bars to setup per-window elements. - Add new arg KEEP_MARGINS_P. Non-nil means to keep window's - existing display margin, fringe widths, and scroll bar settings - (e.g. after splitting a window or resizing the frame). - All callers changed. - (Fset_window_buffer): New arg KEEP_MARGINS. All callers changed. - (Fsplit_window): Duplicate original window's display margin, - fringe, and scroll-bar settings; then call Fset_window_buffer with - KEEP_MARGINS non-nil. This fixes a bug which caused a split - window to only preserve the display margins in one of the windows. - When splitting horizontally, call adjust_window_margins on both - windows to ensure that the text area of the new windows is non too - narrow. This fixes a bug which could cause Emacs to trap if the - width of the split window was less than the width of the display - margins. - (window_box_text_cols): Rename from window_internal_width. - All uses changed. Adapt to per-window fringes and scroll bars. - Fix bug that caused vertical separator to be subtracted also on - window frames. Fix another bug that did not reduce the returned - value by the columns used for display margins. - (window_scroll_line_based): Fix bug related to scrolling too much - when display margins are present (implicitly fixed by the fix to - window_box_text_cols). - (scroll_left, scroll_right): Fix bug related to scrolling too far - by default when display margins are present (implicitly fixed by - the fix to window_box_text_cols). - (struct saved_window): Rename members left to left_col, top to - top_line, width to total_cols, height to total_lines, orig_top to - orig_top_line, orig_height to orig_total_lines. All uses changed. - New members left_margin_cols, right_margin_cols, - left_fringe_width, right_fringe_width, fringes_outside_margins, - scroll_bar_width, and vertical_scroll_bar_type for saving - per-window display elements. - (Fset_window_configuration): Restore display margins, fringes, - and scroll bar settings. This fixes a bug which caused display - margins to be discarded when saving and restoring a window - configuration. - (save_window_save): Save display margins, fringes, and scroll bar - settings. This fixes a bug which caused display margins to be - discarded when saving and restoring a window configuration. - (Fset_window_margins): Do nothing if display margins are not - really changed. Otherwise, call adjust_window_margins to ensure - the text area doesn't get too narrow. This fixes a bug which - could cause Emacs to trap if setting display margins wider than - the width of the window. - (Fset_window_fringes): New defun to allow user to specifically set - this window's fringe widths and position vs. display margins. - (Fwindow_fringes): New defun to return window's actual fringe settings. - (Fset_window_scroll_bars): New defun to allow user to specifically - set this window's scroll bar width and position. - (Fwindow_scroll_bars): New defun to return window's actual scroll - bar settings. - (compare_window_configurations): Also compare display margins, - fringes, and scroll bar settings. - (syms_of_window): Defsubr new defuns for fringe and scroll bars. - - * xdisp.c: Make (many) trivial substitutions for renamed and - new macros in dispextern.h, frame.h and window.h. - (window_box_width): Adapt to per-window fringes and scroll bars, - and new fringe vs. display margin position. Note that returned - value is no longer guaranteed to be a whole multiple of the frame - column width, since per-window fringes may now be any width. - (window_box_left_offset): New function like window_box_left, but - value is relative to left border of window (rather than frame). - (window_box_right_offset): New function like window_box_right, - but value is relative to left border of window. - (window_box_left): Adapt to per-window fringes and scroll bars, - and new fringe vs. display margin position. Simplify by using - WINDOW_LEFT_EDGE_X and window_box_left_offset. - (window_box): Allow null args for unnecessary return values; - change/simplify relevant callers. - (x_y_to_hpos_vpos): Adapt to per-window fringes and scroll bars, - and new fringe vs. display margin position. - Use window_box_left_offset and window_box_right_offset - (get_glyph_string_clip_rect): Adapt to per-window fringes and - scroll bars, and new fringe vs. display margin position. - Use WINDOW_LEFT_EDGE_X and WINDOW_TOTAL_WIDTH. - (draw_fringe_bitmap): Rework to handle per-window fringes and new - fringe vs. display margin position. - (hscroll_window_tree): Use window_box_width instead of window_box. - (redisplay_window): Adapt to per-window scroll bars. - (draw_glyphs): Rework to handle per-window fringes and scroll - bars, and new fringe vs. display margin position. - Use WINDOW_LEFT_EDGE_X, WINDOW_TOTAL_WIDTH, and window_box_left. - (x_clear_end_of_line): Adapt to per-window fringes and scroll - bars, and new fringe vs. display margin position. Fix bug which - increased total width of full_width rows by width of scroll bars - although window's total width already includes that. - (x_fix_overlapping_area): Simplify using window_box_left_offset. - (expose_area): Simplify using window_box_left_offset. - (x_draw_vertical_border): Handle per-window scroll bar settings, - mixing windows with left, right and no scroll bars. - - * xfaces.c [WINDOWSNT]: Move redefinition of FONT_WIDTH macro to - where it's used in x_list_fonts (for clarity). - (frame_update_line_height): Remove unused function; functionality - is now done directly when setting the default font in x_set_font. - - * xfns.c: Make (many) trivial substitutions for renamed and - new macros in dispextern.h, frame.h and window.h. - - * xmenu.c: Make (some) trivial substitutions for renamed and - new macros in dispextern.h, frame.h and window.h. - - * xterm.h (struct x_output): Move members left_pos, top_pos, - border_width, pixel_height, pixel_width, line_height, - internal_border_width, vertical_scroll_bar_extra, - left_fringe_width, right_fringe_width, fringe_cols, - fringes_extra, win_gravity, size_hint_flags, want_fullscreen, - x_pixels_diff, and y_pixels_diff to struct frame (frame.h). - (FRAME_INTERNAL_BORDER_WIDTH, FRAME_LINE_HEIGHT): Move to frame.h. - (FRAME_DEFAULT_FONT_WIDTH): Remove macro. - (PIXEL_WIDTH, PIXEL_HEIGHT) - (FRAME_X_FRINGE_COLS, FRAME_X_FRINGE_WIDTH) - (FRAME_X_LEFT_FRINGE_WIDTH, FRAME_X_RIGHT_FRINGE_WIDTH): Move to - frame.h and renamed [see frame.h changes]. - (CHAR_TO_PIXEL_ROW, CHAR_TO_PIXEL_COL, CHAR_TO_PIXEL_WIDTH) - (CHAR_TO_PIXEL_HEIGHT, PIXEL_TO_CHAR_ROW, PIXEL_TO_CHAR_COL) - (PIXEL_TO_CHAR_WIDTH, PIXEL_TO_CHAR_HEIGHT): Move to frame.h - and renamed [see frame.h changes]. - - * xterm.c: Make (several) trivial substitutions for renamed and - new macros in dispextern.h, frame.h and window.h. - (x_draw_glyph_string_box): Adapt to per-window fringes and scroll-bars. - (scroll_run): Adapt to new fringe position. - (glyph_rect): Use window coordinates returned from - window_from_coordinates rather than frame_to_window_pixel_xy. - (XTset_vertical_scroll_bar): Adapt to per-window fringes and - scroll-bars. - (handle_one_xevent): Simplify a USE_GTK conditional. - (x_clip_to_row): Remove superfluous whole_line_p arg and code - (fringes are now inside margins, i.e. always in the clipping area). - All callers changed. - (x_new_font): Set FRAME_COLUMN_WIDTH and FRAME_LINE_HEIGHT - directly, then call compute_fringe_widths. Don't call - frame_update_line_height. - - * w32term.h (struct w32_output): Move members left_pos, top_pos, - border_width, pixel_height, pixel_width, line_height, - internal_border_width, vertical_scroll_bar_extra, - left_fringe_width, right_fringe_width, fringe_cols, - fringes_extra, win_gravity, size_hint_flags, want_fullscreen, - x_pixels_diff, and y_pixels_diff to struct frame (frame.h). - (FRAME_INTERNAL_BORDER_WIDTH, FRAME_LINE_HEIGHT): Move to frame.h. - (FRAME_DEFAULT_FONT_WIDTH): Remove macro. - (PIXEL_WIDTH, PIXEL_HEIGHT) - (FRAME_X_FRINGE_COLS, FRAME_X_FRINGE_WIDTH) - (FRAME_X_LEFT_FRINGE_WIDTH, FRAME_X_RIGHT_FRINGE_WIDTH): Move to - frame.h and renamed [see frame.h changes]. - (CHAR_TO_PIXEL_ROW, CHAR_TO_PIXEL_COL, CHAR_TO_PIXEL_WIDTH) - (CHAR_TO_PIXEL_HEIGHT, PIXEL_TO_CHAR_ROW, PIXEL_TO_CHAR_COL) - (PIXEL_TO_CHAR_WIDTH, PIXEL_TO_CHAR_HEIGHT): Move to frame.h - and renamed [see frame.h changes]. - - * w32term.c: Make (several) trivial substitutions for renamed and - new macros in dispextern.h, frame.h and window.h. - (x_draw_glyph_string_box): Adapt to per-window fringes and scroll-bars. - (glyph_rect): Use window coordinates returned from - window_from_coordinates rather than frame_to_window_pixel_xy. - (XTset_vertical_scroll_bar): Adapt to per-window fringes and - scroll-bars. - (w32_clip_to_row): Remove superfluous whole_line_p arg and code - (fringes are now inside margins, i.e. always in the clipping area). - All callers changed. - (x_new_font): Set FRAME_COLUMN_WIDTH and FRAME_LINE_HEIGHT - directly, then call compute_fringe_widths. Don't call - frame_update_line_height. - - * w32console.c: Make (few) trivial substitutions for renamed and - new macros in dispextern.h, frame.h and window.h. - - * w32fns.c: Make (many) trivial substitutions for renamed and - new macros in dispextern.h, frame.h and window.h. - - * w32menu.c: Make (few) trivial substitutions for renamed and - new macros in dispextern.h, frame.h and window.h. - - * macterm.h (struct mac_output): Move members left_pos, top_pos, - border_width, pixel_height, pixel_width, line_height, - internal_border_width, vertical_scroll_bar_extra, - left_fringe_width, right_fringe_width, fringe_cols, - fringes_extra, win_gravity, size_hint_flags, want_fullscreen, - x_pixels_diff, y_pixels_diff to struct frame (frame.h). - (FRAME_INTERNAL_BORDER_WIDTH, FRAME_LINE_HEIGHT): Move to frame.h. - (FRAME_DEFAULT_FONT_WIDTH): Remove macro. - (PIXEL_WIDTH, PIXEL_HEIGHT) - (FRAME_X_FRINGE_COLS, FRAME_X_FRINGE_WIDTH) - (FRAME_X_LEFT_FRINGE_WIDTH, FRAME_X_RIGHT_FRINGE_WIDTH): Move to - frame.h and renamed [see frame.h changes]. - (CHAR_TO_PIXEL_ROW, CHAR_TO_PIXEL_COL, CHAR_TO_PIXEL_WIDTH) - (CHAR_TO_PIXEL_HEIGHT, PIXEL_TO_CHAR_ROW, PIXEL_TO_CHAR_COL) - (PIXEL_TO_CHAR_WIDTH, PIXEL_TO_CHAR_HEIGHT): Move to frame.h - and renamed [see frame.h changes]. - - * macterm.c: Make (several) trivial substitutions for renamed and - new macros in dispextern.h, frame.h and window.h. - (x_draw_glyph_string_box): Adapt to per-window fringes and scroll-bars. - (glyph_rect): Use window coordinates returned from - window_from_coordinates rather than frame_to_window_pixel_xy. - (XTset_vertical_scroll_bar): Adapt to per-window fringes and - scroll-bars. - (x_clip_to_row): Remove superfluous whole_line_p arg and code - (fringes are now inside margins, i.e. always in the clipping area). - All callers changed. - (x_new_font): Set FRAME_COLUMN_WIDTH and FRAME_LINE_HEIGHT - directly, then call compute_fringe_widths. Don't call - frame_update_line_height. - - * macfns.c: Make (several) trivial substitutions for renamed and - new macros in dispextern.h, frame.h and window.h. - (x_real_positions): Set f->x_pixels_diff and f->y_pixels_diff to 0. - - * macmenu.c: Make (few) trivial substitutions for renamed and - new macros in dispextern.h, frame.h and window.h. - - * msdos.h (struct x_output): Remove members left_pos, top_pos, - and line_height, and use corresponding new members in struct - frame. All uses changed. - (FRAME_LINE_HEIGHT, FRAME_INTERNAL_BORDER_WIDTH): Remove macros; - superseeded by corresponding macros in frame.h. - - * msdos.c: Make (several) trivial substitutions for renamed and - new macros in dispextern.h, frame.h and window.h. - (IT_note_mouse_highlight): Use updated window coordinates returned - by window_from_coordinates, rather than adjusting them locally. - (internal_terminal_init): No need to initialize line_height here; - it now defaults to 1. - -2003-05-24 Stefan Monnier <monnier@cs.yale.edu> - - * keyboard.c (read_key_sequence): Adjust fkey and keytran when - dropping `down' events. - -2003-05-24 Andreas Schwab <schwab@suse.de> - - * coding.c (find_safe_codings): Fix last change. - -2003-05-24 Istvan Marko <mi@imarko.dhs.org> (tiny change) - - * xfns.c (x_window): Fix typo from 2003-05-21 change. - -2003-05-23 Stefan Monnier <monnier@cs.yale.edu> - - * xdisp.c (display_mode_element): Increase max depth. - Simplify the error handling code. Use a different error string - for the case where we hit the depth limit. - - * lisp.h (Vfundamental_mode_abbrev_table): Don't declare. - - * buffer.c (reset_buffer_local_variables): Remove redundant setting. - -2003-05-21 Stefan Monnier <monnier@cs.yale.edu> - - * intervals.c (get_local_map): Don't get char-property of previous - point any more: get_pos_property already does it and better. - -2003-05-21 Dave Love <fx@gnu.org> - - [Merged from unicode branch.] - - * xfns.c (x_window, x_window): Use use_xim. - - * xterm.c (use_xim): Initialize. - (xim_open_dpy, xim_initialize, xim_close_dpy): Use use_xim. - (x_term_init): Maybe set use_xim. - - * xterm.h (use_xim) [HAVE_X_I18N]: Declare. - -2003-05-21 Jason Rumney <jasonr@gnu.org> - - * unexw32.c (_start): Remove _fmode initialization. - - * emacs.c (main) [WINDOWSNT]: Move it here. - -2003-05-20 Dave Love <fx@gnu.org> - - * s/gnu-linux.h (MAIL_USE_FLOCK): Make it conditional. - -2003-05-19 Richard M. Stallman <rms@gnu.org> - - * xfaces.c (Finternal_set_lisp_face_attribute): Handle Qunspecified - as value for QCfont attribute. - (realize_default_face): lface should already exist; crash if not. - Specify 0 for FORCE_P when calling set_lface_from_font_name. - - * frame.c (Fignore_event): Doc fix. - -2003-05-19 Kenichi Handa <handa@m17n.org> - - * coding.c (decode_coding_string): Handle post-read-conversion - even if the coding doesn't require decoding. - -2003-05-18 Richard M. Stallman <rms@gnu.org> - - * callproc.c (Fcall_process_region): Doc fix. - -2003-05-17 Stefan Monnier <monnier@cs.yale.edu> - - * lread.c (Fload): Print a message if package is obsolete. - - * window.c (Fselect_window): Add optional `norecord' arg. - (select_window_1): Fold into Fselect_window. - (select_window_norecord): New function. - (temp_output_buffer_show): Use it. Preserve current buffer. - - * window.h (Fselect_window): Update declaration. - - * window.c (delete_window, Fother_window, Fset_window_configuration): - * minibuf.c (read_minibuf): - * macterm.c (x_new_focus_frame): - * frame.c (do_switch_frame, Fset_frame_selected_window, Fdelete_frame): - * callint.c (Fcall_interactively): - * xterm.c (x_new_focus_frame): Pass nil as new arg to Fselect_window. - - * buffer.c (Fpop_to_buffer): Pass norecord to Fselect_window. - -2003-05-17 David Kastrup <dak@gnu.org> - - * process.c (read_process_output): Back out change from 2003-03-09. - -2003-05-17 Stefan Monnier <monnier@cs.yale.edu> - - * editfns.c (get_pos_property): Don't assume that `object' = nil. - - * textprop.c (text_property_stickiness): New arg `buffer'. - - * intervals.h (text_property_stickiness): New arg `buffer'. - (get_pos_property): Declare. - - * intervals.c (get_local_map): Use get_pos_property, to obey - stickiness and empty overlays. - (create_root_interval, graft_intervals_into_buffer): Use BEG. - (merge_properties, intervals_equal, merge_properties_sticky): - Use XCAR, XCDR. - (adjust_for_invis_intang): Pass new arg to text_property_stickiness. - -2003-05-17 Richard M. Stallman <rms@gnu.org> - - * minibuf.c (read_minibuf): If buffer is empty, record the default - in the history. - (Fminibuffer_complete_word): When deleting the overlap, take account - of its real position. - - * fns.c (map_char_table): Fix previous change. - - * syntax.c (find_defun_start): - When open_paren_in_column_0_is_defun_start, - return beginning of buffer. - - * lisp.h (map_char_table): Declare added arg. - - * fns.c (map_char_table): New arg TABLE gets the master table. - All calls changed. - Process default and inheritance, resorting to Faref if necessary. - - * keymap.c (Fset_keymap_parent, map_keymap, Fcopy_keymap) - (Faccessible_keymaps): Pass new arg to map_char_table. - - * fontset.c (Ffontset_info): Pass new arg to map_char_table. - - * casetab.c (set_case_table): Pass new arg to map_char_table. - - * data.c (let_shadows_buffer_binding_p): Make target of p volatile. - - * lisp.h (specbinding_func): New typedef. - (struct specbinding): Use specbinding_func, to put the `volatile' - in the right place. - - * alloc.c (Fgarbage_collect): Cast pointers into specpdl - to avoid GCC warning. - -2003-05-16 Ralph Schleicher <rs@nunatak.allgaeu.org> - - * fileio.c (Fdelete_file): Handle symlinks pointing to directories. - -2003-05-15 Stefan Monnier <monnier@cs.yale.edu> - - * keyboard.c (apply_modifiers): Don't fill the other cache. - -2003-05-14 Stefan Monnier <monnier@cs.yale.edu> - - * .gdbinit-union: New file, for USE_LISP_UNION_TYPE users. - - * window.h (Qwindowp, Qwindow_live_p, Vwindow_list) - (Fwindow_end, Fselected_window, Fdelete_window, Fwindow_buffer) - (Fget_buffer_window, Fsave_window_excursion, Fsplit_window) - (Fset_window_configuration, Fcurrent_window_configuration) - (compare_window_configurations, Fcoordinates_in_window_p, Fwindow_at) - (Fpos_visible_in_window_p, mark_window_cursors_off) - (window_internal_height, window_internal_width, Frecenter) - (Fscroll_other_window, Fset_window_start, temp_output_buffer_show) - (replace_buffer_in_all_windows, init_window_once, init_window) - (syms_of_window, keys_of_window): Move from lisp.h. - * lisp.h: Move window.c declarations to window.h. - - * bytecode.c: Include window.h. - * emacs.c: Include window.h. - - * keyboard.c (make_lispy_event): Apply modifiers to multibyte-char key. - (keyremap): Add `parent' field. - (keyremap_step): Use it. Remove `parent' argument. - (read_key_sequence): Setup and use the new `parent' field. - -2003-05-11 Stefan Monnier <monnier@cs.yale.edu> - - * keyboard.c (adjust_point_for_property): Ensure termination. - -2003-05-10 Stefan Monnier <monnier@cs.yale.edu> - - * keyboard.c (follow_key): Remove dead variable `did_meta'. - (access_keymap_keyremap, keyremap_step): New funs, extracted from the - duplicated handling of function-key-map and key-translation-map - in read_key_sequence. - (read_key_sequence): Use them. - - * keyboard.c (adjust_point_for_property): Try harder to move point - to the non-sticky end of an invisible property. - - * xdisp.c (single_display_prop_intangible_p): Make `space' display - property intangible as well. - -2003-05-10 Andreas Schwab <schwab@suse.de> - - * xmenu.c (single_menu_item): Change last parameter to void* to - avoid warning. - -2003-05-09 Richard M. Stallman <rms@gnu.org> - - * print.c (Fprin1_to_string): Instead of gcpro, set abort_on_gc. - Bind Qinhibit_modification_hooks to t so there will be no GC. - Rename local `tem' to `save_deactivate_mark'. - - * eval.c (specpdl_ptr): Declare volatile. - (unbind_to): Copy the whole binding and decrement specpdl_ptr - before doing the work of unbinding it. - - * lisp.h (struct specbinding): Declare elements volatile. - (specpdl_ptr): Declare volatile. - - * Makefile.in (alloca.o): Specify -DDO_BLOCK_INPUT in compiling. - - * alloca.c: Test DO_BLOCK_INPUT rather than `emacs' - for use of BLOCK_INPUT and inclusion of lisp.h and blockinput.h. - -2003-05-08 Dave Love <fx@gnu.org> - - * coding.c (Vlast_coding_system_used): Doc fix. - -2003-05-07 Jason Rumney <jasonr@gnu.org> - - * fileio.c (Ffile_symlink_p): Let handlers handle symlinks even - when system does not support them. - -2003-05-05 Stefan Monnier <monnier@cs.yale.edu> - - * fileio.c (Qwrite_region_annotate_functions): New var. - (build_annotations): Use it to process the global part of the hook. - (syms_of_fileio): Init and staticpro it. - - * keyboard.c (safe_run_hooks_error): Display a message instead of - silently ignoring the error. - -2003-05-03 Stefan Monnier <monnier@cs.yale.edu> - - * keyboard.c (input_available_signal): Mark static. - (menu_bar_items): Use map_keymap. - (menu_bar_one_keymap): Remove. - (menu_bar_item): Adjust arglist (for use in map_keymap). - Properly hide a second binding when not both are keymaps. - - * xmenu.c (struct skp): New struct, to pass args through map_keymap. - (single_keymap_panes): Use it and map_keymap. - (single_menu_item): Use skp as well. - - * keymap.h (map_keymap_function_t): New type. - (map_keymap): Declare. - - * keymap.c (map_keymap_item, map_keymap_char_table_item, map_keymap) - (map_keymap_call, Fmap_keymap): New functions. - (syms_of_keymap): Defsubr map-keymap. - -2003-05-02 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (create_dialog, make_widget_for_menu_item) - (make_menu_item, create_menus, xg_update_menu_item): Don't call - ..._with_mnemonic functions for menu items. - -2003-05-01 Kenichi Handa <handa@m17n.org> - - * coding.c (coding_system_accept_latin_extra_p): Delete this - function. - (find_safe_codings): Pay attention to - the property tranlsation-table-for-encode of each codings. - (syms_of_coding): Give Qtranslation_table the extra slot number 2. - -2003-05-01 Stefan Monnier <monnier@cs.yale.edu> - - * eval.c (Funwind_protect): Use func=Fprogn rather than symbol=Qnil. - -2003-04-30 Stefan Monnier <monnier@cs.yale.edu> - - * eval.c (unbind_to): Don't handle symbol = Qnil any more. - - * lisp.h (CHECK): Wrap args in parenthesis. - (specbind): Fix doc: symbol = Qnil is not supported any more. - - * bytecode.c (Fbyte_code) <unwind-protect>: - Use Fprogn rather than 0 and Qnil. - - * keyboard.c (parse_modifiers_uncached): Parse `down', `drag', - `double', and `triple' modifiers as well. - -2003-04-30 Richard M. Stallman <rms@gnu.org> - - * keyboard.c (echo_char): Don't clear out a dash that follows a space. - - * alloc.c (abort_on_gc): New variable. - (Fgarbage_collect): Abort if abort_on_gc is set. - - * lisp.h (abort_on_gc): Add decl. - - * eval.c (Fsignal): Clear abort_on_gc. - - * editfns.c (Fformat): Set abort_on_gc during first scan of format. - Reinit FORMAT_START and END before second scan. - - * xdisp.c (move_it_vertically_backward): Do the final big else - even if nlines is 0. - - * xdisp.c (redisplay_internal): Finish the per-frame loop - even if redisplay is suspended by input. - -2003-04-24 Andrew Choi <akochoi@shaw.ca> - - * macterm.c (x_list_fonts): Return all fonts that match if - maxnames = -1. - -2003-04-25 Kenichi Handa <handa@m17n.org> - - * syntax.c (skip_chars): Fix previous change. - -2003-04-24 Kenichi Handa <handa@m17n.org> - - * syntax.c (skip_chars): Make the code faster by using the common - technique of *p, *stop, and *endp. - -2003-04-23 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xdisp.c (update_tool_bar): BLOCK_INPUT before calling - tool_bar_items so GTK tool bar expose callback does not access items - being updated. - -2003-04-19 Stefan Monnier <monnier@cs.yale.edu> - - * eval.c (Fapply): Undo last change and add a comment about why. - -2003-04-18 Miles Bader <miles@gnu.org> - - * data.c (Faset): Calculate nbytes earlier, to satisfy the now - pickier PARSE_MULTIBYTE_SEQ. - -2003-04-17 Stefan Monnier <monnier@cs.yale.edu> - - * eval.c (For, Fand, Fprogn, un_autoload, do_autoload): - Use XCDR, XCAR, CONSP. - (Fdefmacro): Fix docstring. Use XCAR, XCDR. - (Fapply): Remove unnecessary GCPRO. - - * doc.c (Fsubstitute_command_keys): Remove spurious casts. - - * charset.h (PARSE_MULTIBYTE_SEQ): Pretend `length' is used. - - * buffer.h: Don't hardcode BEG==1. - - * abbrev.c (Fdefine_abbrev_table): Use XCAR, XCDR. - -2003-04-16 Richard M. Stallman <rms@gnu.org> - - * xdisp.c (try_window, try_window_reusing_current_matrix): - When at end of window, set window_end_pos to Z-ZV. - - * buffer.c (Foverlay_recenter): Doc fix. - -2003-04-14 Stefan Monnier <monnier@cs.yale.edu> - - * dispnew.c (Fsit_For): Support XEmacs-style arg list. - -2003-04-14 Andrew Choi <akochoi@shaw.ca> - - * macterm.c (mac_check_for_quit_char): Don't check more often than - once a second. - -2003-04-11 Stefan Monnier <monnier@cs.yale.edu> - - * keyboard.c (kbd_buffer_get_event): Don't handle SELECT_WINDOW_EVENT - specially, so that they can't hide an implicit switch-frame event. - (make_lispy_event): Handle SELECT_WINDOW_EVENT. - (head_table): Use switch-frame as event_kind for select-window. - (keys_of_keyboard): Don't bind [select-window] in special-event-map. - - * editfns.c (Fformat): Lisp_Object/int mixup. - (format2): Remove unused var numargs. - -2003-04-11 Kenichi Handa <handa@m17n.org> - - * fileio.c (Vafter_insert_file_adjust_coding_function): Delete. - (Qafter_insert_file_set_coding): New variable. - (syms_of_fileio): Initialize and staticpro it. Delete declaration - for after-insert-file-adjust-coding-function. - (Finsert_file_contents): Call Qafter_insert_file_set_coding - instead of Vafter_insert_file_adjust_coding_function. - -2003-04-11 Kenichi Handa <handa@m17n.org> - - * lisp.h (temp_echo_area_glyphs): Adjust prototype. - - * minibuf.c (temp_echo_area_glyphs): Change the arg to Lisp - string. Callers changed. - -2003-04-10 Kenichi Handa <handa@m17n.org> - - * fileio.c (Vafter_insert_file_adjust_coding_function): New variable. - (syms_of_fileio): Declare it as a lisp variable. - (Finsert_file_contents): - Call Vafter_insert_file_adjust_coding_function before calling - decode-format. - -2003-04-09 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.c (xg_scroll_callback): Call gtk_range_get_adjustment to - get GtkAdjustment as widget now is a GtkRange. - - * gtkutil.c (xg_create_scroll_bar): Connect to value-changed on - GtkRange to avoid memory leak. - -2003-04-09 Kenichi Handa <handa@m17n.org> - - * xfaces.c (Vface_font_rescale_alist): New variable. - (struct font_name): New member rescale_ratio. - (font_rescale_ratio): New function. - (split_font_name): If NUMERIC_P is nonzero, set font->rescale_ratio. - (better_font_p): On comparing point sized, pay attention to - recale_ratio member of fonts. - (build_scalable_font_name): Reflect font->rescale_ratio in the - font name. - (syms_of_xfaces): Declare Vface_font_rescale_alist as a Lisp variable. - - * lread.c (read1): Before calling index, check if the 2nd - arguemnt is in ASCII range. - -2003-04-08 Richard M. Stallman <rms@gnu.org> - - * fileio.c (Ffile_symlink_p): Doc fix. - - * editfns.c (Fformat): Translate positions of text properties - in the format string to apply them to the result. - - * fileio.c (Finsert_file_contents): Doc fix. - (syms_of_fileio) <after-insert-file-functions>: Doc fix. - -2003-04-08 Ivan Zakharyaschev <imz@altlinux.org> (tiny change) - - * lread.c (openp): Get the Qfile_exists_p handler for STRING, not FN. - -2003-04-08 Steven Tamm <steventamm@mac.com> - - * mac.c (init_mac_osx_environment): Switch libexec and bin so - that self-contained application finds libexec files. - -2003-04-08 Kenichi Handa <handa@m17n.org> - - * coding.c (code_convert_region_unwind): - Set Vlast_coding_system_used to the argument. - (code_convert_region): If post-read-conversion function changed - the value of last-coding-sytem, keep the new value in - coding->symbol so that it won't be overridden. - (run_pre_post_conversion_on_str): Likewise. - (coding_system_accept_latin_extra_p): New function. - (find_safe_codings): Pay attention to characters registered in - latin-extra-code-table. - -2003-04-07 Thien-Thi Nguyen <ttn@gnu.org> - - * Makefile.in (md5.o): Add missing dependency info. - -2003-04-06 Richard M. Stallman <rms@gnu.org> - - * xselect.c (x_handle_selection_request): Move UNGCPRO to very end. - - * marker.c (verify_bytepos): New function. - - * intervals.c (set_intervals_multibyte_1): When becoming - multibyte, adjust right and left child sizes to a whole set of - characters. If an interval gets zero total-length, delete it. - If an interval consists of just its children, delete one of them. - - * intervals.h (CHECK_TOTAL_LENGTH): New macro. - * intervals.c: Add many calls to CHECK_TOTAL_LENGTH. - - * alloc.c (VALIDATE_LISP_STORAGE): Macro deleted. - All calls deleted. - (lisp_malloc): Do the work here directly. - -2003-04-06 Gareth Jones <emacs@referential.org.uk> (tiny change) - - * fns.c (Flength): Return SUB_CHAR_TABLE_ORDINARY_SLOTS for sub - char tables. - -2003-04-04 Kenichi Handa <handa@m17n.org> - - * editfns.c (Fformat): Use a copy of FORMAT string so that we can - destructively change "%S" to "%s". - -2003-04-03 Miles Bader <miles@gnu.org> - - * xfaces.c (choose_face_font): Make sure *NEEDS_OVERSTRIKE is - always set. - -2003-04-01 Dave Love <fx@gnu.org> - - * xfns.c (xpm_lookup_color): Grok "opaque". - -2003-03-31 Andrew Choi <akochoi@shaw.ca> - - * frame.c (x_report_frame_params) [HAVE_CARBON]: Do not report - parent window ID. - - * macfns.c (syms_of_macfns): Remove call to init_x_parm_symbols. - - * macterm.h (struct mac_output): Define x_pixels_diff and - y_pixels_diff. - -2003-03-31 Juanma Barranquero <lektu@terra.es> - - * makefile.w32-in ($(BLD)/frame.$(O)): Add dependency on - blockinput.h and files included from it. - -2003-03-31 Kim F. Storm <storm@cua.dk> - - The following changes consolidates the common code related to - frame-parameter handling from the xfns.c, w32fns.c, and macfns.c - files into frame.c. - - * frame.c: Include blockinput.h. - (Vx_resource_name, Vx_resource_class, Qx_frame_parameter) - (Qx_resource_name, Qface_set_after_frame_default): Define vars here. - (Qauto_raise, Qauto_lower, ...): Define all frame parameter - related vars here. - (struct frame_parm_table, frame_parms): New table for describing - frame parameters and their associated Q-variable. - The order of the parameters corresponds to the sequence of the - frame_parm_handlers table in redisplay_interface. - (x_fullscreen_move, x_set_frame_parameters) - (x_report_frame_params, x_set_fullscreen, x_set_line_spacing) - (x_set_screen_gamma, x_set_font, x_set_fringe_width) - (x_set_border_width, x_set_internal_border_width, x_set_visibility) - (x_set_autoraise, x_set_autolower, x_set_unsplittable) - (x_set_vertical_scroll_bars, x_set_scroll_bar_width, x_icon_type): - Generic functions for processing of frame parameters. - (validate_x_resource_name, xrdb_get_resource, Fx_get_resource) - (display_x_get_resource, x_get_resource_string): Functions for - generic access to X resources. - (x_get_arg, x_frame_get_arg, x_frame_get_and_record_arg) - (x_default_parameter, Fx_parse_geometry): Functions for generic - access to frame parameters. - (x_figure_window_size): Generic calculation of frame size. - Fixed to add space needed for tool bar. Also setup size_hint_flags. - (syms_of_frame): Intern and staticpro frame parameter variables. - Defvar_lisp Vx_resource_class and Vx_resource_name here. - Defsubr Sx_get_resource and Sx_parse_geometry. - - * frame.h (Qauto_raise, Qauto_lower, ...): Declare extern all frame - parameter related vars defined in frame.c. - (EMACS_CLASS): Define here. - (enum FULLSCREEN_*): Define here. - (x_set_scroll_bar_default_width, x_wm_set_icon_position) - (x_set_offset, x_new_font, x_new_fontset): Add prototypes. - (x_fullscreen_adjust, x_set_frame_parameters, x_report_frame_params) - (x_set_fullscreen, x_set_line_spacing, x_set_screen_gamma, x_set_font) - (x_set_fringe_width, x_set_border_width, x_set_internal_border_width) - (x_set_visibility, x_set_autoraise, x_set_autolower) - (x_set_unsplittable, x_set_vertical_scroll_bars) - (x_set_scroll_bar_width, x_icon_type, validate_x_resource_name) - (x_figure_window_size): Add prototypes. - - * dispextern.h (frame_parm_handler): New typedef. - (struct redisplay_interface): New member frame_parm_handlers. - (enum resource_types): Move declaration here. - (x_get_arg, x_frame_get_arg, x_frame_get_and_record_arg) - (x_default_parameter): Add prototypes. - - * window.c: Remove extern decl for frame parameter vars. - (change_window_heights): New generic function; - replaces x_change_window_heights. All users changed. - - * window.h (change_window_heights): Add prototype. - - * xfaces.c: Remove extern decl for frame parameter vars. - - * xterm.h (EMACS_CLASS): Remove. Use generic define. - (struct w32_display_info): Fix type of xrdb member. - (enum FULLSCREEN_*): Remove. - Remove prototypes for generic functions (in frame.h). - - * xfns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame - parameters now defined in frame.h and frame.c. - (Vx_resource_name): Remove. Use generic var. - (enum x_frame_parms): Remove (bogus, unused enum). - (check_x_display_info): Make non-static (for frame.c). - (struct x_frame_parm_table, x_frame_parms): Remove. - (init_x_parm_symbols, x_set_frame_parameters, x_report_frame_params) - (x_set_line_spacing, x_set_screen_gamma, x_icon_type, x_set_font) - (x_set_border_width, x_set_internal_border_width, x_set_visibility) - (x_change_window_heights, x_set_autoraise, x_set_autolower) - (x_set_vertical_scroll_bars, x_set_scroll_bar_width) - (validate_x_resource_name, Fx_get_resource, x_get_resource_string) - (x_default_parameter, Fx_parse_geometry, x_figure_window_size): - Remove. Use generic functions instead. - (enum resource_types): Remove. - (x_set_scroll_bar_default_width): New global function (for frame.c). - (Fx_create_frame): Depend on x_figure_window_size to add space for - toolbar and setup size_hint_flags. - (x_frame_parm_handlers): New table for redisplay_interface. - (syms_of_xfns): Don't intern/staticpro removed vars. - - * xterm.c: Remove unnecessary extern declarations. - (x_fullscreen_adjust): Remove. Use generic instead. - (x_redisplay_interface): Add x_frame_parm_handlers member. - - * w32gui.h (XrmDatabase): New (dummy) typedef. - - * w32term.h (EMACS_CLASS): Remove. Use generic define. - (struct w32_display_info): Fix type of xrdb member. - (enum FULLSCREEN_*): Remove. - (x_fullscreen_adjust): Remove prototype. - - * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame - parameters now defined in frame.h and frame.c. - (Vx_resource_name): Remove. Use generic var. - (enum x_frame_parms): Remove (bogus, unused enum). - (check_x_display_info): Make non-static (for frame.c). - (struct x_frame_parm_table, x_frame_parms): Remove. - (init_x_parm_symbols, x_set_frame_parameters, x_report_frame_params) - (x_set_line_spacing, x_set_screen_gamma, x_icon_type, x_set_font) - (x_set_border_width, x_set_internal_border_width, x_set_visibility) - (x_change_window_heights, x_set_autoraise, x_set_autolower) - (x_set_vertical_scroll_bars, x_set_scroll_bar_width) - (validate_x_resource_name, Fx_get_resource, x_get_resource_string) - (x_default_parameter, Fx_parse_geometry, x_figure_window_size): - Remove. Use generic functions instead. - (enum resource_types): Remove. - (x_set_scroll_bar_default_width): New global function (for frame.c). - (Fx_create_frame): Depend on x_figure_window_size to add space for - toolbar and setup size_hint_flags. - (w32_frame_parm_handlers): New table for redisplay_interface. - (syms_of_w32fns): Don't intern/staticpro removed vars. - - * w32term.c: Remove unnecessary extern declarations. - (x_fullscreen_adjust): Remove. Use generic instead. - (x_redisplay_interface): Add w32_frame_parm_handlers member. - - * w32reg.c (x_get_string_resource): Use XrmDatabase. - - * macgui.h (XrmDatabase): New (dummy) typedef. - - * macterm.h (EMACS_CLASS): Remove. - (struct mac_display_info): Add xrdb member. - (struct mac_output): Add want_fullscreen member. - - * macfns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame - parameters now defined in frame.h and frame.c. - (Vx_resource_name): Remove. Use generic var. - (check_x_display_info): Make non-static (for frame.c). - (struct x_frame_parm_table, x_frame_parms): Remove. - (init_x_parm_symbols, x_set_frame_parameters, x_report_frame_params) - (x_set_line_spacing, x_set_screen_gamma, x_icon_type, x_set_font) - (x_set_border_width, x_set_internal_border_width, x_set_visibility) - (x_change_window_heights, x_set_autoraise, x_set_autolower) - (x_set_vertical_scroll_bars, x_set_scroll_bar_width) - (validate_x_resource_name, Fx_get_resource, x_get_resource_string) - (x_default_parameter, Fx_parse_geometry, x_figure_window_size): - Remove. Use generic functions instead. - (enum resource_types): Remove. - (x_set_scroll_bar_default_width): New global function (for frame.c). - (mac_frame_parm_handlers): New table for redisplay_interface. - (syms_of_macfns): Don't intern/staticpro removed vars. - - * macterm.c: Remove unnecessary extern declarations. - (x_redisplay_interface): Add mac_frame_parm_handlers member. - - * Makefile.in (frame.o): Add dependency on blockinput.h and files - included from it (atimer.h and systime.h). - -2003-03-30 Andreas Schwab <schwab@suse.de> - - * xdisp.c (x_insert_glyphs): Fix swapped width and height - parameters for shift_glyphs_for_insert. - - * macterm.c (x_redisplay_interface): Add missing entry for - draw_vertical_window_border. - -2003-03-29 Kai Gro,A_(Bjohann <kai.grossjohann@gmx.net> - - * fileio.c (Fexpand_file_name): In the no-handler case, after - expanding, look again for a handler and invoke it. This is needed - for filenames like "/foo/../user@host:/bar/../baz" -- the first - expansion produces "/user@host:/bar/../baz" which needs to be - expanded again for the finame result "/user@host:/baz". - -2003-03-28 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (xg_tool_bar_item_expose_callback): Reduce size - of area to be redrawn for better performance. - -2003-03-28 Stefan Monnier <monnier@cs.yale.edu> - - * xterm.c (take_vertical_position_into_account): Remove. - (xt_action_hook): Call set_vertical_scroll_bar if needed. - (XM_SB_MIN, XM_SB_RANGE): Remove (min is now set to 0). - (xm_scroll_callback, x_create_toolkit_scroll_bar) - (x_set_toolkit_scroll_bar_thumb): Simplify. - (x_scroll_bar_expose): Only compile if !USE_TOOLKIT_SCROLL_BARS. - (XTread_socket): Remove unused var. - (x_make_frame_invisible): Replace goto with else. - - * xdisp.c (set_vertical_scroll_bar): New fun. - (redisplay_window): Use it. - -2003-03-26 Richard M. Stallman <rms@gnu.org> - - * xdisp.c (update_tool_bar): Recompute tool bar if - update_mode_lines is set. Set w->update_mode_line - only if the tool bar contents actually change. - (update_menu_bar): Undo previous change. - -2003-03-26 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (xg_resize_widgets): Don't call xg_frame_cleared. - (xg_frame_set_char_size): Calculate scroll bar width before frame - width. Call SET_FRAME_GARBAGED and cancel_mouse_face. - (xg_separator_p): Check for all documented separator types. - (xg_update_scrollbar_pos): Variable gheight not needed, use height. - (update_frame_tool_bar): Don't call gdk_window_process_all_updates. - - * xdisp.c (update_menu_bar): Set w->update_mode_line to Qt - so tool bar gets updated. - -2003-03-26 Stefan Monnier <monnier@cs.yale.edu> - - * data.c (store_symval_forwarding): Re-instate part of the code - that was deleted with too much enthusiasm. - -2003-03-25 Stefan Monnier <monnier@cs.yale.edu> - - * data.c (store_symval_forwarding): Delete special read-only - hack for type == -1, since we now use ->constant instead. - (Fkill_local_variable): Don't use XBUFFER if it can be nil. - - * buffer.c (overlays_in): Declare static. - (syms_of_buffer) <enable-multibyte-characters>: Use the symbol's - `constant' field rather than the variable's `type' field. - -2003-03-24 Andrew Choi <akochoi@shaw.ca> - - * config.in [MAC_OSX]: Do not redefine bcopy, bzero, and bcmp. - - * dispextern.h [HAVE_CARBON]: Include Carbon.h. - - * fns.c [MAC_OSX]: Do not redefine vector. - - * keyboard.c [MAC_OSX]: Handle SIGINT with interrupt_signal. - - * macgui.h: Remove definition of No_Cursor. - - * macterm.h: Include Carbon.h. Replace (struct Cursor *) by Cursor. - - * xdisp.c: Define No_Cursor. - (x_write_glyphs, notice_overwritten_cursor) - (draw_phys_cursor_glyph, note_mode_line_or_margin_highlight) - (note_mouse_highlight): Remove Mac-specific code. - (note_mouse_highlight): Use bcmp instead of == to compare Cursors. - -2003-03-24 John Paul Wallington <jpw@gnu.org> - - * xdisp.c (redisplay_window): If mini window's buffer is not - empty, then redisplay it like other windows. - -2003-03-23 Kim F. Storm <storm@cua.dk> - - * w32term.c (w32_draw_window_cursor): Fix last change. - -2003-03-23 Kenichi Handa <handa@m17n.org> - - * alloc.c (make_string_from_bytes, make_specified_string): - Add `const' for the arg CONTENTS. - - * lisp.h (make_string_from_bytes, make_specified_string): - Prototypes adjusted. - -2003-03-23 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xdisp.c (get_glyph_string_clip_rect): Remove ; at end of #endif. - - * gtkutil.h: Take two more arguments to xg_update_scrollbar_pos. - (XG_SB_RANGE): New define. - - * gtkutil.c (xg_fixed_handle_expose): New function. - (xg_create_frame_widgets): Call xg_fixed_handle_expose for - expose events. - (xg_update_scrollbar_pos): Take two more arguments, left and width - of scroll bar including borders. - Clear left and right part outside scroll bar separately as some - themes have bars that are not an even number of pixels. - Don't set reallocate_redraws, don't call - gdk_window_process_all_updates. - (xg_set_toolkit_scroll_bar_thumb): Upper value is fixed, - so no need to change it. Calculate size and value with XG_SB_RANGE. - - * xterm.c (x_scroll_bar_create, XTset_vertical_scroll_bar): - Pass left and width of scroll bar including borders to - xg_update_scrollbar_pos. - -2003-03-22 Thien-Thi Nguyen <ttn@gnu.org> - - * Makefile.in: Make sure space precedes end-of-line backslashes. - -2003-03-22 Kim F. Storm <storm@cua.dk> - - * xdisp.c (pixel_to_glyph_coords, glyph_to_pixel_coords): - Add generic versions here. Remove system specific versions - defined elsewhere. - - * dispextern.h (pixel_to_glyph_coords, glyph_to_pixel_coords): - Add prototypes. - - * xterm.h (STORE_NATIVE_RECT): New macro. - -2003-03-21 Kim F. Storm <storm@cua.dk> - - * xdisp.c (get_glyph_string_clip_rect): - Use FRAME_INTERNAL_BORDER_WIDTH. - - * dispextern.h (struct redisplay_interface): Add active_p - argument to draw_window_cursor member. All uses changed. - -2003-03-21 Kim F. Storm <storm@cua.dk> - - The following changes consolidate code related to writing and - inserting glyphs, exposing frame, the tool bar, the mouse face, - the output cursor, and help echo from xterm.c, w32term.c and - macterm.c into xdisp.c. It also generalizes the use of the - window_part enum instead of using numeric values throughout. - - * xdisp.c: Consolidate gui-independent code here. - Include keymap.h. - (Qhelp_echo): Import. - (mouse_autoselect_window, x_stretch_cursor_p): Declare here. - (help_echo_string, help_echo_window, help_echo_object) - (previous_help_echo_string, help_echo_pos): Declare here. - (output_cursor, last_mouse_frame, last_tool_bar_item): Declare here. - (estimate_mode_line_height): Define here. Handle windowing - systems directly (without using estimate_mode_line_height_hook). - (x_y_to_hpos_vpos, get_tool_bar_item, note_tool_bar_highlight): - (update_window_cursor, update_cursor_in_window_tree) - (fast_find_position, fast_find_string_pos) - (note_mode_line_highlight, note_mode_line_or_margin_highlight) - (expose_area, expose_line, expose_overlaps, expose_window) - (expose_window_tree, phys_cursor_in_rect_p): New generic versions; - declared static as they are only used locally in xdisp.c. - (draw_glyphs): Rename from x_draw_glyphs and make static. - (tool_bar_item_info, notice_overwritten_cursor): Make static. - (frame_to_window_pixel_xy, get_glyph_string_clip_rect) - (set_output_cursor, x_cursor_to, handle_tool_bar_click) - (x_write_glyphs, x_insert_glyphs, x_clear_end_of_line): - (x_fix_overlapping_area, draw_phys_cursor_glyph, erase_phys_cursor) - (display_and_set_cursor, x_update_cursor, x_clear_cursor) - (show_mouse_face, clear_mouse_face, cursor_in_mouse_face_p) - (note_mouse_highlight, x_clear_window_mouse_face) - (cancel_mouse_face, x_draw_vertical_border, expose_frame) - (x_intersect_rectangles): New generic functions for use by xdisp.c - and GUI front-ends. - (syms_of_xdisp): Initialize and staticpro help_echo* variables. - Defvar_bool "x-streach-cursor" and "mouse-autoselect-window" here. - - * dispextern.h (Display_Info): Generic typedef for *_display_info. - (NativeRectangle): Generic typedef for rectangle type. - (enum window_part): Move here from window.c. - (struct redisplay_interface): New members flush_display_optional, - define_frame_cursor, clear_frame_area, draw_window_cursor, - draw_vertical_window_border, shift_glyphs_for_insert. - Rename member clear_mouse_face to clear_window_mouse_face. - (estimate_mode_line_height_hook): Remove hook. - (auto_raise_tool_bar_buttons_p): Don't declare extern. - (tool_bar_item_info): Remove prototype. - (help_echo_string, help_echo_window, help_echo_object) - (previous_help_echo_string, help_echo_pos) - (last_mouse_frame, last_tool_bar_item, mouse_autoselect_window): - (x_stretch_cursor_p, output_cursor): Declare extern. - (x_draw_glyphs, notice_overwritten_cursor): Remove prototypes. - (x_write_glyphs), x_insert_glyphs, x_clear_end_of_line) - (x_fix_overlapping_area, draw_phys_cursor_glyph, erase_phys_cursor) - (display_and_set_cursor, set_output_cursor, x_cursor_to) - (x_update_cursor, x_clear_cursor, x_draw_vertical_border) - (frame_to_window_pixel_xy, get_glyph_string_clip_rect) - (note_mouse_highlight, x_clear_window_mouse_face, cancel_mouse_face) - (handle_tool_bar_click, clear_mouse_face, show_mouse_face) - (cursor_in_mouse_face_p, expose_frame, x_intersect_rectangles): - Add prototypes. - (mode_line_string, marginal_area_string): Fix prototypes. - - * window.c (enum window_part): Move to dispextern.h. - (coordinates_in_window): Use enum window_part member names - instead of numbers to describe return value. - (struct check_window_data): Change part member to window_part. - (check_window_containing): Return window_part unaltered. - (window_from_coordinates): Change part arg from int to enum - window_part. Allow part arg to be null. All users changed. - - * window.h (window_from_coordinates): Fix prototype. - - * term.c (estimate_mode_line_height): Move to xdisp.c. - - * keyboard.c (make_lispy_event): Use enum window_part. - - * dispnew.c (mode_line_string, marginal_area_string): Use enum - window_part instead of int in arg list. Users changed. - - * xterm.h (No_Cursor): Declare as None for X. - (struct mac_output): Replace member cross_cursor by hand_cursor. - - * xterm.c: Remove consolidated defines and code. - (BETWEEN): Remove unused macro. - (x_draw_vertical_window_border, x_shift_glyphs_for_insert) - (x_define_frame_cursor, x_clear_frame_area) - (x_draw_window_cursor): New X-specific functions for RIF. - (x_redisplay_interface): Add new members. - - * xfns.c: Setup and use hand_cursor instead of cross_cursor. - - * w32term.h (struct w32_output): Remove cross_cursor member. - - * w32term.c: Remove consolidated defines and code. - (BETWEEN): Remove unused macro. - (w32_draw_vertical_window_border, w32_shift_glyphs_for_insert) - (w32_define_frame_cursor, w32_clear_frame_area) - (w32_draw_window_cursor): New W32-specific functions for RIF. - (w32_redisplay_interface): Add new members. - - * w32gui.h (No_Cursor): Define as 0 for W32. - (XRectangle): Add X compatible rectangle type. - (NativeRectangle): Declare as RECT for W32. - (CONVERT_TO_XRECT, CONVERT_FROM_XRECT, STORE_NATIVE_RECT): New macros. - - * w32fns.c: Remove setup of cross_cursor (already has hand_cursor). - - * w32console.c: Remove consolidated defines and code. - - * msdos.h (Display_Info): Add generic typedef. - - * msdos.c: Remove consolidated defines and code. - (IT_note_mouse_highlight, dos_rawgetc): Use enum window_part. - - * macterm.h (struct mac_output): Replace member cross_cursor by - hand_cursor. - (activate_scroll_bars, deactivate_scroll_bars): Add prototypes. - - * macterm.c: Remove consolidated defines and code. - (BETWEEN): Remove unused macro. - (mac_draw_vertical_window_border, mac_shift_glyphs_for_insert) - (mac_define_frame_cursor, mac_clear_frame_area) - (mac_draw_window_cursor): New Mac-specific functions for RIF. - (x_redisplay_interface): Add new members. - - * macgui.h (No_Cursor): Define as 0 for Mac. - (XRectangle): Add X compatible rectangle type. - (NativeRectangle): Declare as Rect for Mac. - (CONVERT_TO_XRECT, CONVERT_FROM_XRECT, STORE_NATIVE_RECT): New macros. - - * macfns.c (x_set_mouse_color): Setup hand_cursor. - (x_set_cursor_color): Use x_display_and_set_cursor. - - * Makefile.in (xdisp.o): Add dependency on blockinput.h and files - included from it. Add dependency on keymap.h. - - * makefile.w32-in (xdisp.o): Add dependency on keymap.h. - -2003-03-21 Kenichi Handa <handa@m17n.org> - - * fileio.c (Fexpand_file_name): Fix previous change. - -2003-03-19 Kenichi Handa <handa@m17n.org> - - * fileio.c (Ffile_name_directory): Reconstruct file name by - make_specified_string. - (Ffile_name_nondirectory, Ffile_name_as_directory) - (Fdirectory_file_name, Fexpand_file_name) - (Fsubstitute_in_file_name): Likewise. - (Fread_file_name): Compare decoded homedir with DIR and - DEFAULT_FILENAME. - - * alloc.c (make_specified_string): If NCHARS is negative, count - the number of characters. - -2003-03-18 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (xg_frame_cleared): Call gtk_widget_queue_draw for - all widgets. - - * gtkutil.h: Removed xg_ignore_next_thumb. - -2003-03-18 Kenichi Handa <handa@m17n.org> - - * coding.c (Vchar_coding_system_table): Remove this variable. - (Vcoding_system_safe_chars): New variable. - (intersection): Remove this function. - (find_safe_codings): Don't use Vchar_coding_system_table, but try - all codings in SAFE_CODINGS. - (Ffind_coding_systems_region_internal): Adjust for the change of - find_safe_codings. Get generic coding systems from - Vcoding_system_safe_chars. - (Fdefine_coding_system_internal): New function. - (syms_of_coding): Defsubr Sdefine_coding_system_internal. - Initialize and staticpro Vcoding_system_safe_chars. - -2003-03-18 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (xg_set_toolkit_scroll_bar_thumb): Check if new values - equal old values before updating. - - * xterm.c (xg_scroll_callback): Remove xg_ignore_next_thumb. - - * gtkutil.c (xg_initialize): Remove xg_ignore_next_thumb. - -2003-03-17 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c: Removed handle_fixed_child, struct xg_last_sb_pos. - (xg_resize_widgets): Don't call foreach(handle_fixed_child). - (xg_gtk_scroll_destroy): Remove free of struct xg_last_sb_pos. - (scroll_bar_button_cb): Set bar->dragging to nil on button release. - (xg_create_scroll_bar): Pass bar to button event callback. - (xg_find_top_left_in_fixed): New function. - (xg_update_scrollbar_pos): Don't call gdk_window_clear on - whole scroll bar area. Get old position with - xg_find_top_left_in_fixed, calculate and only clear needed areas. - (xg_set_toolkit_scroll_bar_thumb): Do not adjust scroll bar if - dragging is in progress. Calculate whole as for Motif. - Remove code that saved last values. Call gtk_range functions to - set scroll bar sizes. - - * gtkutil.h: Removed xg_ignore_next_thumb. - -2003-03-17 Juanma Barranquero <lektu@terra.es> - - * makefile.w32-in ($(BLD)/xdisp.$(O)): Add dependency on blockinput.h - and files included from it. - -2003-03-18 Stefan Monnier <monnier@cs.yale.edu> - - * keymap.c (accessible_keymaps_1): Break cycles but without preventing - multiple occurrences of the same keymap under different prefixes. - (Faccessible_keymaps): Remove code redundant since 1994-08-03T07:39:00Z!rms@gnu.org. - -2003-03-16 Jason Rumney <jasonr@gnu.org> - - * w32gui.h: Use HDC for Display. - - * w32term.c (w32_encode_char): Prevent double-byte chars from - crashing Emacs. - - * w32fns.c (jpeg_load, png_load, slurp_file): Read image files - as binary. - -2003-03-16 Juanma Barranquero <lektu@terra.es> - - * xdisp.c (x_produce_glyphs): Use FRAME_BASELINE_OFFSET. - -2003-03-16 Kim F. Storm <storm@cua.dk> - - The following changes consolidate some of the gui-independent - parts of the processing and drawing of "glyph strings" from - xterm.c, w32term.c, and macterm.c into xdisp.c. - - * dispextern.h (struct glyph): Reduce face_id member from 22 to - 21 bits (this reduces number of faces from 4M to 2M). - Replace W32 specific w32_font_type member (2 bits) by generic - font_type member (3 bits) for portability. - (FONT_TYPE_UNKNOWN): New define, default for font_type member. - (enum draw_glyphs_face): Define here. - (struct glyph_string): Define here. Merge W32 and X versions. - (struct redisplay_interface): New members per_char_metric, - encode_char, compute_glyph_string_overhangs, draw_glyph_string. - (VCENTER_BASELINE_OFFSET): Define here. - (dump_glyph_string, x_get_glyph_overhangs, x_produce_glyphs) - (x_draw_glyphs, notice_overwritten_cursor): Declare prototypes here. - - * xdisp.c: Consolidate gui-independent "glyph string" code here. - (dump_glyph_string): Moved here. - (init_glyph_string, append_glyph_string_lists, append_glyph_string) - (prepend_glyph_string_lists, get_glyph_face_and_encoding) - (fill_composite_glyph_string, fill_glyph_string) - (fill_image_glyph_string, fill_stretch_glyph_string) - (left_overwritten, left_overwriting, right_overwritten) - (right_overwriting, get_char_face_and_encoding) - (set_glyph_string_background_width, compute_overhangs_and_x) - (append_glyph, append_composite_glyph, produce_image_glyph) - (take_vertical_position_into_account, append_stretch_glyph) - (produce_stretch_glyph): New generic functions (based on X version). - Call platform specific functions through rif. - (INIT_GLYPH_STRING): New macro, hides W32 details. - (BUILD_STRETCH_GLYPH_STRING, BUILD_IMAGE_GLYPH_STRING) - (BUILD_CHAR_GLYPH_STRINGS, BUILD_COMPOSITE_GLYPH_STRING) - (BUILD_GLYPH_STRINGS): Generic macros (based on X version). - (x_draw_glyphs, x_get_glyph_overhangs, x_produce_glyphs) - (notice_overwritten_cursor): - Generic functions exported to platform modules. Users changed. - - * xterm.h (FONT_DESCENT, FRAME_X_OUTPUT, FRAME_BASELINE_OFFSET) - (FONT_TYPE_FOR_UNIBYTE, FONT_TYPE_FOR_MULTIBYTE) - (STORE_XCHAR2B, XCHAR2B_BYTE1, XCHAR2B_BYTE2): - New macros for consolidated code. - - * xterm.c: Remove consolidated defines and code. - (x_per_char_metric, x_encode_char) - (x_compute_glyph_string_overhangs): Adapt to RIF requirements. - (x_redisplay_interface): Add new members. - - * w32gui.h (Display): Add dummy typedef for consolidation. - (XChar2b): Define alias for wchar_t for consolidation. - (STORE_XCHAR2B, XCHAR2B_BYTE1, XCHAR2B_BYTE2): New macros. - - * w32term.h (FRAME_X_OUTPUT, FRAME_X_WINDOW, FRAME_X_DISPLAY) - (FONT_TYPE_FOR_UNIBYTE, FONT_TYPE_FOR_MULTIBYTE): - New macros for consolidation. - - * w32term.c: Remove consolidated defines and code. - (BUILD_WCHAR_T, BYTE1, BYTE2): Macros removed; callers changed - to use STORE_XCHAR2B, XCHAR2B_BYTE1, XCHAR2B_BYTE2 instead. - (w32_per_char_metric): Change font_type arg to int for RIF. - (w32_encode_char): Return int according to RIF requirements. - (w32_compute_glyph_string_overhangs): Adapt to RIF. - (w32_get_glyph_overhangs): New function for RIF. Uses generic - x_get_glyph_overhangs. - (w32_redisplay_interface): Add new members. - - * macgui.h (XChar2b): Move typedef here for consolidation. - (STORE_XCHAR2B, XCHAR2B_BYTE1, XCHAR2B_BYTE2): New macros. - - * macterm.h (FRAME_X_OUTPUT, FRAME_X_WINDOW, FRAME_X_DISPLAY): - (FONT_TYPE_FOR_UNIBYTE, FONT_TYPE_FOR_MULTIBYTE): New macros for - consolidation. - - * macterm.c: Remove consolidated defines and code. - (mac_per_char_metric): New function for RIF. - (mac_encode_char): Adapt to new RIF requirements. - (mac_compute_glyph_string_overhangs): Adapt for RIF. - (x_redisplay_interface): Add new members. - -2003-03-15 Stefan Monnier <monnier@cs.yale.edu> - - * keymap.c (Vmenu_events): New var. - (syms_of_keymap): Initialize it. - (where_is_internal): Check more carefully what is a menu event. - -2003-03-14 Richard M. Stallman <rms@gnu.org> - - * lread.c (read1): After #!, exit loop on eof. - -2003-03-14 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.h: Add declaration for xg_frame_cleared. - - * xterm.c (x_clear_frame): Call xg_frame_cleared for GTK. - - * gtkutil.c (struct xg_last_sb_pos): New structure. - (handle_fixed_child): New function. - (xg_resize_widgets): Call handle_fixed_child on all scroll bar widgets - and force a redraw on them. - (xg_gtk_scroll_destroy): Free struct xg_last_sb_pos also. - (xg_create_scroll_bar): Add struct xg_last_sb_pos to scroll bar - so we can avoid unneeded redraws. - (xg_update_scrollbar_pos): Invalidate data in xg_last_sb_pos - and force a redraw on the scroll bar. - (xg_set_toolkit_scroll_bar_thumb): Do not change/redraw scroll bar - if xg_last_sb_pos shows the positions are up to date. - (xg_frame_cleared): New function. - -2003-03-13 Kenichi Handa <handa@m17n.org> - - * coding.c (Fdetect_coding_region): Fix docstring. - (Fdetect_coding_string): Fix docstring. - -2003-03-13 Andreas Schwab <schwab@suse.de> - - * gtkutil.c: Add prototype for create_menus. - - * data.c (long_to_cons): Fix type of top. - - * xselect.c (selection_data_to_lisp_data): Use int instead of - long for an integer of size 4. - - * gtkutil.c (xg_update_frame_menubar): Add missing return value. - (xg_tool_bar_help_callback): Likewise. - -2003-03-12 Andreas Schwab <schwab@suse.de> - - * xterm.c (x_term_init) [USE_GTK]: Fix typo. - -2003-03-12 Kim F. Storm <storm@cua.dk> - - The following changes consolidate the fringe handling from - xterm.c, w32term.c, and macterm.c into xdisp.c. - - * xdisp.c: Consolidate fringe handling code here. - (left_bits, right_bits, continued_bits, continuation_bits) - (ov_bits, zv_bits): Define fringe bitmaps. - (fringe_bitmaps): New array holding fringe bitmaps. - (draw_fringe_bitmap): Draw a specific bitmap; call display - specific drawing routine via rif->draw_fringe_bitmap. - (draw_row_fringe_bitmaps): Generic replacement for - x_draw_row_fringe_bitmaps; all callers changed. - (compute_fringe_widths): Generic replacement for - x_compute_fringe_widths; all callers changed. - - * dispextern.h (enum fringe_bitmap_type): Define here. - (struct fringe_bitmap, struct draw_fringe_bitmap_params): New. - (fringe_bitmaps): Declare extern. - (struct redisplay_interface): New member draw_fringe_bitmap. - (draw_row_fringe_bitmaps, compute_fringe_widths): Declare extern. - - * xterm.c: Remove generic fringe code. - (x_draw_fringe_bitmap): Only perform actual fringe drawing. - (x_redisplay_interface): Add x_draw_fringe_bitmap member. - - * w32term.c: Remove generic fringe code. - (w32_draw_fringe_bitmap): Only perform actual fringe drawing. - (w32_redisplay_interface): Add w32_draw_fringe_bitmap member. - - * macterm.c: Remove generic fringe code. - (x_draw_fringe_bitmap): Only perform actual fringe drawing. - (x_redisplay_interface): Add x_draw_fringe_bitmap member. - -2003-03-11 Stefan Monnier <monnier@cs.yale.edu> - - * print.c (Fprin1_to_string): Return unibyte string if possible. - -2003-03-09 David Kastrup <dak@gnu.org> - - * process.c (read_process_output): We have allocated enough space - for readmax and carryover, so actually use the alloted space. - -2003-03-09 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * keyboard.c (make_lispy_event): Extend mouse_syms if needed for - toolkit scrollbar click. - - * xterm.c (x_window_to_scroll_bar): Call xg_get_scroll_id_for_window - for USE_GTK. - (x_scroll_bar_handle_click): Use this function for toolkit scrollbars - also. - (handle_one_xevent): ButtonPress/Release: If event is for a toolkit - scrollbar and control is pressed, call x_scroll_bar_handle_click. - - * gtkutil.h (xg_get_scroll_id_for_window): Declare. - - * gtkutil.c (xg_get_scroll_id_for_window): New function. - (xg_tool_bar_item_expose_callback): New function. - (xg_tool_bar_expose_callback): Call update_frame_tool_bar. - (xg_create_tool_bar): Connect xg_tool_bar_expose_callback to expose - on the tool bar widget. - (update_frame_tool_bar): Connect xg_tool_bar_item_expose_callback - to expose on the tool bar item widgets. - -2003-03-08 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (update_frame_tool_bar): Compare pixmap ID instead of - struct image* when deciding to update (struct image* may have been - deleted from the image cache). - - * xterm.c (handle_one_xevent): Pass ReparentNotify to Xt even if - the event isn't for a frame (i.e. for dialogs). - -2003-03-07 Kenichi Handa <handa@m17n.org> - - * coding.c (CODING_ADD_COMPOSITION_COMPONENT): If the number of - composition components reaches the limit, terminate composing. - (COMPOSITION_OK): New macro. - (detect_coding_iso2022): Use it if an escape sequence for - composition is found. - (coding_restore_composition): Adjust the number of composition - components if it is not sane. - -2003-03-06 Juanma Barranquero <lektu@terra.es> - - * w32term.h (struct w32_display_info): Add xrdb member to support - passing resources via -xrm on Windows. - - * w32term.c (w32_make_rdb): New function. - (w32_term_init): Use it to initialize xrdb member of w32_display_info - struct. Delete leftover code. - - * w32fns.c (Fx_get_resource, x_get_resource_string): Pass xrdb to check - for resources passed on the command line. - - * w32reg.c (w32_get_rdb_resource): New function. - (x_get_string_resource): Use it, so resources passed with -xrm - supercede the ones in the registry. - -2003-03-04 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.c (x_detect_focus_change): Call x_any_window_to_frame - instead of x_top_window_to_frame. - -2003-03-03 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xsmfns.c (smc_save_yourself_CB): Add --no-splash to options - when restarting Emacs. - -2003-03-03 Richard M. Stallman <rms@gnu.org> - - * buffer.c (Fkill_buffer): Use Frun_hook_with_args_until_failure - to run kill-buffer-query-functions. - (Qkill_buffer_query_functions): New var. - (syms_of_buffer): Init and staticpro it. - -2003-03-02 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.h (XSync): Define as gdk_window_process_all_updates for GTK. - -2003-02-25 Kim F. Storm <storm@cua.dk> - - * xdisp.c (redisplay_window): Fix infinite loop in redisplay. - If centering point failed to make whole line visible and vscroll - is non-zero, disable vscroll and try centering point again. - - * lread.c (read1): Accept `single space' syntax like (? x). - -2003-02-25 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * keyboard.c (cancel_hourglass_unwind): Surround with - #ifdef HAVE_X_WINDOWS. - -2003-02-25 Kenichi Handa <handa@m17n.org> - - * buffer.c (Fset_buffer_multibyte): Pay attention to the buffer - process only when "subprocesses" is defined. - -2003-02-24 Stefan Monnier <monnier@cs.yale.edu> - - * syntax.c (back_comment): Only check nestedness of 2nd char if needed. - -2003-02-24 Juanma Barranquero <lektu@terra.es> - - * callint.c (fix_command): Declare as static void and move before - Fcall_interactively. - - * xdisp.c (Qwhen): Declare external; it's now defined in callint.c. - (syms_of_xdisp): Don't initialize Qwhen. - -2003-02-23 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * keyboard.c (cancel_hourglass_unwind): New function. - (command_loop_1): Cancel hourglass with unwind-protect. - -2003-02-23 Richard M. Stallman <rms@gnu.org> - - * callint.c (fix_command): New subroutine, from Fcall_interactively. - Detect (when ... (region-beginning)) etc. - (Fcall_interactively): Call fix_command. - (Qif, Qwhen): New variables. - (syms_of_callint): Init and staticpro them. - - * regex.c (print_partial_compiled_pattern): Output to stderr. - -2003-02-23 Kai Gro,A_(Bjohann <kai.grossjohann@uni-duisburg.de> - - * dired.c (directory_files_internal): Don't expand directory. - (Fdirectory_files, Fdirectory_files_and_attributes): Do it here - instead. From Lars Hansen <larsh@math.ku.dk>. - -2003-02-22 Stefan Monnier <monnier@cs.yale.edu> - - * fns.c (string_to_multibyte): Remove unused var i. - (Flanginfo): Fix int/Lisp_Object mixup. - (void_call2): New fun. - (Fmap_char_table): Use it in place of call2. - - * xfaces.c (x_face_list_fonts): Fix int/Lisp_Object mixup. - - * macros.c (Fstart_kbd_macro): Remove redundant assignment. - - * keymap.c (copy_keymap_1): Make it static. - - * alloc.c (Fgarbage_collect): Don't use XSETFLOAT. - -2003-02-22 David Ponce <david@dponce.com> - - * lread.c (Fload): Don't check STRING_MULTIBYTE. - -2003-02-21 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * process.h: Removed subtty field from struct Lisp_Process. - - * process.c (create_process): Remove setting of subtty. - (emacs_get_tty_pgrp): New function. - (Fprocess_running_child_p, process_send_signal): - Call emacs_get_tty_pgrp instead of ioctl. - (process_send_signal): Call EMACS_KILLPG if ioctl TIOCSIGSEND fails. - -2003-02-21 Kai Gro,A_(Bjohann <kai.grossjohann@uni-duisburg.de> - - * keymap.c (Fdefine_key): Doc fix. - -2003-02-21 Juanma Barranquero <lektu@terra.es> - - Port of patch for RC by Klaus Zeitler <kzeitler@lucent.com>. - - * s/hpux10.h: Define POLL_INTERRUPTED_SYS_CALL, not - POLLING_PROBLEM_IN_SELECT. - - * s/hpux11.h: Include hpux10-20.h instead of hpux10.h. - Delete #undef of POLLING_PROBLEM_IN_SELECT. - - * s/hpux10-20.h: New file. - - * process.c (wait_reading_process_input): - Use POLL_INTERRUPTED_SYS_CALL, not POLLING_PROBLEM_IN_SELECT. - -2003-02-20 Kenichi Handa <handa@m17n.org> - - * fontset.c (check_fontset_name): If NAME is nil, return the - default fontset. - (override_font_info): New function. - (Fset_fontset_font): Document that NAME nil means the default fontset. - (Ffontset_info): If FONTSET is not the default fontset, merge - FONTSET onto the copy of the default fontset, and work on that - copy. Document that NAME nil means the default fontset. - (Ffontset_font): Document that NAME nil means the default fontset. - - * process.c (setup_process_coding_systems): If the process's - in/out descriptor is -1, do nothing. - -2003-02-19 Andreas Schwab <schwab@suse.de> - - * lisp.h (Fcancel_kbd_macro_events, Fstring_to_multibyte): - Add prototypes. - -2003-02-19 Kenichi Handa <handa@m17n.org> - - * xfaces.c (try_alternative_families): Try all scalable fonts if - Vscalable_fonts_allowed is not Qt. - -2003-02-19 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xfaces.c (x_face_list_fonts): Set *pfonts to 0 if no fonts found. - -2003-02-18 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.c (x_list_fonts): If maxnames is less than 0, get all font - names. - - * xfaces.c (x_face_list_fonts): Allocate struct font_name here. - (sorted_font_list): Move allocation of struct font_name to - x_face_list_fonts. - (Fx_font_family_list): Set font-list-limit to -1 to get all font names. - (Fx_list_fonts): Set maxnames to -1 to get all font names. - -2003-02-18 Kim F. Storm <storm@cua.dk> - - * lread.c (read1): Fix last change. - "`" is not always special. Allow "?" after a character constant. - -2003-02-18 Andrew Choi <akochoi@shaw.ca> - - * unexmacosx.c (copy_data_segment): Also copy __cfstring section. - -2003-02-18 Andreas Schwab <schwab@suse.de> - - * window.c (window_scroll_pixel_based): Move outside a - multi-glyph character before setting new window start. - - * xdisp.c (in_display_vector_p): New function. - * dispextern.h (in_display_vector_p): Declare. - -2003-02-18 Kim F. Storm <storm@cua.dk> - - * lread.c (read1): Fix and relax read syntax. - Recognize "[", ";", "#", and "?" after a dotted-pair dot. - Only recognize "," after dotted-pair dot if inside backquote. - Never include "`" or "," (inside backquote) in a symbol. - Allow dotted-pair dot after a character constant. - Allow "`" and "," (inside backquote) after a character constant. - -2003-02-17 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (xg_tool_bar_expose_callback): New function. - (xg_create_tool_bar): Force style of tool bar to be horizontal with - icons. Set name of tool bar to emacs-toolbar. - (update_frame_tool_bar): Connect expose event to - xg_tool_bar_expose_callback. - -2003-02-17 Richard M. Stallman <rms@gnu.org> - - * keyboard.c (this_command_key_count_reset): New variable. - Initiatize to 0 where this_command_key_count is set. - (read_char): Save and restore this_command_key_count_reset - around input method code. - (read_char): If this_command_key_count_reset, echo reread commands. - (Freset_this_command_lengths): Set this_command_key_count_reset to 1. - -2003-02-17 Kenichi Handa <handa@m17n.org> - - * fns.c (string_to_multibyte): Always return a multibyte string. - -2003-02-16 Jason Rumney <jasonr@gnu.org> - - * w32fns.c (w32_list_bdf_fonts, w32_list_fonts): - Negative max_fonts parameter means list all. - -2003-02-14 Dave Love <fx@gnu.org> - - * fns.c (Flanginfo): Doc fix. - -2003-02-13 Kim F. Storm <storm@cua.dk> - - * lread.c (read_escape): Interpret \s as a SPACE character, except - for \s-X in a character constant which still is the super modifier. - (read1): Signal an `invalid read syntax' error if a character - constant is immediately followed by a digit or symbol character. - - * search.c (Fmatch_data): Doc fix. Explicitly state that - match-data is undefined if last search failed. - - * keymap.c (Fcommand_remapping): Rename from Fremap_command. - All uses changed. - -2003-02-12 Juanma Barranquero <lektu@terra.es> - - * eval.c (Fdefmacro): Fix typo. - -2003-02-12 Kim F. Storm <storm@cua.dk> - - * macros.c (Fstart_kbd_macro): If appending, and last keyboard - macro is a string, convert meta modifiers in string when copying - the string into a vector. - -2003-02-11 Kim F. Storm <storm@cua.dk> - - * keymap.c (Fremap_command): Return nil if arg is not a symbol. - -2003-02-11 Kenichi Handa <handa@m17n.org> - - * Makefile.in (lisp, shortlisp): Add malayalam.el and tamil.el. - -2003-02-10 Kim F. Storm <storm@cua.dk> - - * process.c: Doc fixes. - (syms_of_process): Add `:' prefix to QCfilter_multibyte. - -2003-02-10 Kenichi Handa <handa@m17n.org> - - * fns.c (Fstring_to_multibyte): Fix typo in the docstring. - - * process.c (QCfilter_multibyte): New variable. - (setup_process_coding_systems): New function. - (Fset_process_buffer, Fset_process_filter): - Call setup_process_coding_systems. - (Fstart_process): Initialize the member `filter_multibyte' of - struct Lisp_Process. - (create_process): Call setup_process_coding_systems. - (Fmake_network_process): New keyward `:filter-multibyte'. - Initialize the member `filter_multibyte' of struct Lisp_Process. - Call setup_process_coding_systems. - (server_accept_connection): Call setup_process_coding_systems. - (read_process_output): If the process has a filter, decide the - multibyteness of a string to given to the filter by - `filter_multibyte' member of the process. If the process doesn't - have a filter and the result of conversion is unibyte, use - Fstring_to_multibyte (not Fstring_make_multibyte) to get the - multibyte form. - (Fset_process_coding_system): Call setup_process_coding_systems. - (Fset_process_filter_multibyte): New function. - (Fprocess_filter_multibyte_p): New function. - (syms_of_process): Intern and staticpro QCfilter_multibyte. - Defsubr Sset_process_filter_multibyte and - Sprocess_filter_multibyte_p. - - * process.h (struct Lisp_Process): New member filter_multibyte. - - * lisp.h (setup_process_coding_systems): Add prototype. - - * buffer.c (Fset_buffer_multibyte): If the current buffer has a - process, update coding systems for the process. - -2003-02-09 Kenichi Handa <handa@m17n.org> - - * fns.c (string_to_multibyte): New function. - (Fstring_to_multibyte): New function. - (syms_of_fns): Defsubr it. - -2003-02-08 Andreas Schwab <schwab@suse.de> - - * Makefile.in (EXEEXT): Define to @EXEEXT@ and use this variable - instead of the substitution. - -2003-02-08 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.c (x_make_frame_visible): Call gtk_window_deiconify. - - * xmenu.c (menu_position_func): Adjust menu popup position so that - the menu is fully visible. - -2003-02-07 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.c (x_text_icon, x_raise_frame, x_lower_frame) - (x_make_frame_invisible, x_wm_set_icon_position): - Use FRAME_OUTER_WINDOW instead of ifdef X_TOOLKIT/else/endif. - - * xfns.c (x_set_name, x_set_title): Ditto. - -2003-02-04 Richard M. Stallman <rms@gnu.org> - - * keyboard.c (echo_now): Update before_command_echo_length. - (Freset_this_command_lengths): Reset this_command_key_count etc. - immediately rather than arranging to do it later. - (before_command_key_count_1, before_command_echo_length_1) - (before_command_restore_flag): Vars deleted. - (add_command_key): Don't handle before_command_restore_flag. - (read_char, record_menu_key): Don't update before_command_key_count or - before_command_echo_length. - (read_char): Don't handle before_command_restore_flag. - - * keyboard.c (command_loop_1): Don't call adjust_point_for_property - in direct-output clauses if it wouldn't be called in the ordinary case. - -2003-02-04 Kim F. Storm <storm@cua.dk> - - * keyboard.c (syms_of_keyboard) <this-original-command>: Doc fix. - -2003-02-02 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (remove_from_container): Copying list is not needed. - (xg_update_menubar, xg_update_menu_item, xg_update_submenu) - (xg_modify_menubar_widgets, update_frame_tool_bar): Call g_list_free - on list returned from gtk_container_get_children to avoid memory leak. - -2003-02-01 Jason Rumney <jasonr@gnu.org> - - * w32fns.c (w32_create_pixmap_from_bitmap_data): Use alloca for - local malloc. - [HAVE_XPM]: Avoid clashes with XColor, XImage and Pixel - definitions in xpm.h. - (init_xpm_functions): New function. - (xpm_load): Sync with xfns.c. Adapt for Windows version of libXpm. - (init_external_image_libraries): Try to load libXpm.dll. - - * fileio.c (Fcopy_file) [WINDOWSNT]: Reverse logic for setting - timestamp. - -2003-01-31 Dave Love <fx@gnu.org> - - * syntax.c (Fskip_chars_forward) - (open-paren-in-column-0-is-defun-start): Doc fix. - -2003-01-31 Joe Buehler <jhpb@draco.hekimian.com> - - * fileio.c: Support // at start of name for Cygwin (just added proper - preprocessor tests). - - * keyboard.c: Port to Cygwin (just added proper preprocessor tests). - - * Makefile.in: Use @EXEEXT@ for Cygwin. - - * mem-limits.h: Added ifdef to define BSD4_2 for Cygwin. - - * s/cygwin.h: Added for Cygwin port. - -2003-01-31 Juanma Barranquero <lektu@terra.es> - - * w32fns.c (DrawText): Kludge to avoid a redefinition on Windows - when including gif_lib.h. - (init_gif_functions, init_tiff_functions): New functions. - (gif_load, tiff_load): Sync with xfns.c version. Adjust colors for - Windows. Disable color table lookups. Call library functions - through pointers determined at runtime. - (init_external_image_libraries): Try to load libungif.dll and - libtiff.dll. - -2003-01-31 Kenichi Handa <handa@m17n.org> - - * xdisp.c (SKIP_GLYPHS): New macro. - (set_cursor_from_row): Skip all glyphs that comes from overlay string. - -2003-01-30 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (free_frame_tool_bar): Remove debug printf. - -2003-01-30 Dave Love <fx@gnu.org> - - * alloc.c (Vgc_elapsed, gcs_done): New variables. - (Fgarbage_collect): Use them. - (init_alloc, syms_of_alloc): Set them up. - -2003-01-30 Juanma Barranquero <lektu@terra.es> - - * w32fns.c (init_external_image_libraries): Add missing operator. - -2003-01-29 Jason Rumney <jasonr@gnu.org> - - * w32fns.c (init_external_image_libraries): Allow jpeg-62.dll as - an alternative name for jpeg.dll. - -2003-01-29 Kenichi Handa <handa@m17n.org> - - * xdisp.c (set_cursor_from_row): Pay attention to string display - properties. - -2003-01-28 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de> - - * macterm.c (keycode_to_xkeysym_table): Add <tab>, <backspace>, - <escape>. - (keycode_to_xkeysym_table): Reformat and add more comments. - (XTread_socket): Drop special case for backspace. - -2003-01-28 Andrew Choi <akochoi@shaw.ca> - - * macfns.c (x_to_mac_color): Correct the order for parsing the RGB - values in old-style RGB specs. - -2003-01-27 Juanma Barranquero <lektu@terra.es> - - * w32fns.c (init_external_image_libraries): Try alternate names for the - jpeg dll. - -2003-01-27 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (create_dialog, xg_separator_p) - (xg_item_label_same_p, xg_update_menu_item): Check for NULL string - before calling strcmp or strlen. - -2003-01-26 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (update_frame_tool_bar): Call prepare_image_for_display - and handle image load failure. - -2003-01-26 Jason Rumney <jasonr@gnu.org> - - * w32fns.c (init_jpeg_functions, jpeg_resync_to_restart_wrapper): - New functions. - (jpeg_load): Sync with xfns.c version. Adjust colors for Windows. - Disable color table lookups. Call jpeg library functions - through pointers determined at runtime. - (init_external_image_libraries): Try to load jpeg.dll. - -2003-01-25 Richard M. Stallman <rms@gnu.org> - - * lisp.h: Declare format2 instead of format1. - - * fileio.c (barf_or_query_if_file_exists): - Call format2 instead of format1. - - * editfns.c (format2): New function, replaces format1 - but takes exactly two Lisp Objects as format args. - - * buffer.c (Fkill_buffer): Call format2 instead of format1. - -2003-01-25 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.h: Change to return value of x_dispatch_event to int. - - * xterm.c (x_filter_event): New function. - (event_handler_gdk, XTread_socket): Call x_filter_event. - (x_dispatch_event): Change to return value of finish. - (event_handler_gdk): Use return value from x_dispatch_event. - - * xfns.c (x_window): Call create_frame_xic for GTK version to - initialize input methods. - - * gtkutil.h: Add (void) prototypes. - - * gtkutil.c (create_menus): Remove code that puts the help menu to - the right. - -2003-01-25 Jason Rumney <jasonr@gnu.org> - - * w32fns.c (XPutPixel): Handle monochrome images; used for masks. - [HAVE_PNG]: Sync with xfns.c version. - (png_load): Adjust colors for Windows. Use Windows - bitmaps. Disable color table lookups. - (DEF_IMGLIB_FN, LOAD_IMGLIB_FN): New macros. - (init_png_functions): New function. - (png_read_from_memory, png_load): Call png library functions - through pointers determined at runtime. - (QCloader, QCbounding_box, QCpt_width, QCpt_height): Declare. - (init_external_image_libraries): New function. - (init_xfns): Call it. - -2003-01-24 Andreas Schwab <schwab@suse.de> - - * minibuf.c (Fminibuffer_message): Verify type of parameter. - -2003-01-24 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (xg_initialize): Initialize id_to_widget here instead - of static initializer. - -2003-01-24 Dave Love <fx@gnu.org> - - * s/gnu-linux.h (GC_SETJMP_WORKS, GC_MARK_STACK): Define for more - architectures. - - * alloc.c (mark_stack) [!GC_LISP_OBJECT_ALIGNMENT && __GNUC__]: - Use __alignof__. - -2003-01-24 Kenichi Handa <handa@m17n.org> - - * keyboard.c (adjust_point_for_property): New second arg MODIFIED. - It it is nonzero, don't pretend that an invisible area doesn't exist. - (command_loop_1): Call adjust_point_for_property with proper - second arg. - -2003-01-22 Jason Rumney <jasonr@gnu.org> - - Sync changes with xterm.c and xfns.c. - - * w32term.c (x_draw_glyph_string_foreground) - (x_draw_composite_glyph_string_foreground): Implement overstriking. - - * w32term.c (x_write_glyphs): Clear phys_cursor_on_p if current - phys_cursor's hpos is overwritten. This is still not completely - correct, as it doesn't really make sense to use hpos at all to - get the cursor glyph (as that is relative to the width of the - characters on the line, which may have changed during the update). - - * w32term.c (notice_overwritten_cursor): Handle the special case - of the cursor being in the first blank non-text line at the - end of a window. - - * w32term.c (x_draw_hollow_cursor, x_draw_bar_cursor) - (x_draw_phys_cursor_glyph): Set phys_cursor_width here. - Compute from the x position returned by x_draw_glyphs. - - (x_display_and_set_cursor): Don't set phys_cursor_width here, - except for NO_CURSOR and system caret, to make phys_cursor_width - contain what its name suggests. - (notice_overwritten_cursor): Consider the cursor image erased if - the output area intersects the cursor image in y-direction. - - * w32term.c (note_mode_line_or_margin_highlight): Rename from - note_mode_line_highlight and extend. - - * w32term.c (last_window): New variable. - (w32_read_socket) <WM_MOUSEMOVE>: Generate SELECT_WINDOW_EVENTs. - (note_mouse_movement): Remove reimplemented code in #if 0. - - * w32fns.c (x_set_cursor_type): Set cursor_type_changed, - not update_mode_lines, and always set it to 1. - -2003-01-21 Jason Rumney <jasonr@gnu.org> - - * w32fns.c (IDC_HAND): Define it if system headers don't. - -2003-01-21 KOBAYASHI Yasuhiro <kobayays@otsukakj.co.jp> - - * w32term.h (struct w32_output): New member hand_cursor. - (WM_EMACS_SETCURSOR): New message definition. - - * w32term.c (note_mode_line_highlight): Delete #if 0 to enable - function w32_define_cursor. - (note_mouse_highlight): Initialize, setup cursor accoding to mouse - position, change member name output_data.x to output_data.w32 and - add function w32_define_cursor. - (show_mouse_face): Delete #if 0 to enable function w32_define_cursor - and change member name output_data.x to output_data.w32. - (w32_initialize_display_info): - Setup dpyinfo->vertical_scroll_bar_cursor. - - * w32fns.c (Vx_hand_shape): New variable. - (w32_wnd_proc): Add message entries for WM_SETCURSOR and - WM_EMACS_SETCURSOR. - (x-create-frame): Setup Cursor types. - -2003-01-21 David Ponce <david@dponce.com> - - * w32term.c (w32_encode_char): For DIM=1 charset, set - ccl->reg[2] to -1 before calling ccl_driver. - (Sync. with xterm.c x_encode_char change by Kenichi Handa - <handa@m17n.org> on 2002-09-30.) - (w32_draw_relief_rect): Declare all args. - (w32_define_cursor): New. - - * w32fns.c (w32_load_cursor): New function. - (w32_init_class): Use it. - (x_put_x_image): Declare all args. - -2003-01-21 Richard Dawe <rich@phekda.freeserve.co.uk> - - * Makefile.in (ALL_CFLAGS): Include MYCPPFLAGS, not MYCPPFLAG. - -2003-01-21 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c: Must include stdio.h before termhooks.h. - -2003-01-21 Dave Love <fx@gnu.org> - - * alloc.c (Fgc_status): Print zombie list. - (mark_maybe_object) [GC_MARK_STACK==GC_USE_GCPROS_CHECK_ZOMBIES]: - Fix assignment of zombies. - (Fgarbage_collect) [GC_MARK_STACK==GC_USE_GCPROS_CHECK_ZOMBIES]: - Don't take car of non-cons. - - * s/sol2-5.h (GC_SETJMP_WORKS, GC_MARK_STACK): Define. - - * s/sunos4-0.h (GC_SETJMP_WORKS, GC_MARK_STACK): Define. - -2003-01-20 David Ponce <david@dponce.com> - - * w32menu.c (digest_single_submenu): Declare all args. - - Sync with 2002-12-23 Richard M. Stallman <rms@gnu.org> - changes in xmenu.c: - - (parse_single_submenu): Use individual keymap's prompt - string as pane name, if there is one. - (set_frame_menubar): Save menu_items_n_panes from each call to - parse_single_submenu and use it when calling digest_single_submenu. - -2003-01-20 Steven Tamm <steventamm@mac.com> - - * macterm.c (XTread_socket): Check for valid, visible window - before sending a scroll-wheel event. - -2003-01-20 Richard M. Stallman <rms@gnu.org> - - * xdisp.c (redisplay_window): If mini window's buffer is not - a minibuffer, then redisplay it like other windows. - -2003-01-20 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * gtkutil.c (xg_create_frame_widgets): Check if there is an - external tool bar before setting tool bar height. - -2003-01-19 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.c (handle_one_xevent): Surround popup_activated - with #ifdef:s for non-toolkit version. - - * Makefile.in (XOBJ): Add gtkutil.o if USE_GTK. - (gtkutil.o): New file. - (TOOLKIT_DEFINES): Set to -DUSE_GTK if HAVE_GTK. - (LIBW): Set to @GTK_LIBS@ if USE_GTK. - - * gtkutil.c: New file for GTK version. - - * gtkutil.h: New file for GTK version. - - * xterm.h: Add xt_or_gtk_widget. - Include gtk files for USE_GTK. - (struct x_output): Add toolbar_height. - (struct x_output): Add GTK widgets and Gdk size_hints. - (GTK_WIDGET_TO_X_WIN, FRAME_GTK_OUTER_WIDGET, FRAME_GTK_WIDGET) - (FRAME_OUTER_WINDOW): New macros for USE_GTK. - (FRAME_OUTER_TO_INNER_DIFF_Y): Add FRAME_TOOLBAR_HEIGHT to calculation. - - * xterm.c: Include gtkutil.h for USE_GTK. - (free_frame_menubar): Declare extern void for USE_GTK. - (note_mouse_highlight): Check popup_activated for USE_GTK. - (xt_action_hook): Don't compile if USE_GTK. - (x_scroll_bar_to_input_event): Use CurrentTime for USE_GTK. - (xg_scroll_callback): New function. - (x_create_toolkit_scroll_bar): Call xg_create_scroll_bar for USE_GTK. - (x_set_toolkit_scroll_bar_thumb): Call xg_set_toolkit_scroll_bar_thumb - for USE_GTK. - (x_scroll_bar_create): Call xg_update_scrollbar_pos and - xg_show_scroll_bar for USE_GTK. - (x_scroll_bar_remove): Call xg_remove_scroll_bar for USE_GTK. - (XTset_vertical_scroll_bar): Call xg_update_scrollbar_pos for USE_GTK. - (event_handler_gdk): New function for USE_GTK. - (handle_one_xevent): Call xg_resize_widgets for USE_GTK. - (handle_one_xevent): Make sure widget is mapped before - calling x_real_positions for USE_GTK. - (XTread_socket): Add GTK event loop for USE_GTK. - (x_set_window_size): Call xg_frame_set_char_size for USE_GTK. - (x_make_frame_visible): Call gtk_widget_show_all for USE_GTK. - (x_make_frame_invisible): Call gtk_widget_hide for USE_GTK. - (x_iconify_frame): Add code for USE_GTK. - (x_free_frame_resources): Call gtk_widget_destroy for USE_GTK. - (x_wm_set_size_hint): Only compile if not USE_GTK. GTK version - is in gtkutil.c. - (x_term_init): Add initialization for GTK. - (syms_of_xterm): Set Vx_toolkit_scroll_bars for USE_GTK. - - * xmenu.c: Include gtkutil.h for USE_GTK. - (Fx_popup_menu): Use current position if x and y are nil. - (single_menu_item, single_menu_item, Fx_popup_dialog): - Check for USE_GTK. - (popup_widget_loop): New function for USE_GTK. - (x_activate_menubar): Add code for USE_GTK. - (popup_activate_callback, popup_deactivate_callback) - (menu_highlight_callback, menubar_selection_callback): - Add USE_GTK versions. - (update_frame_menubar): Call xg_update_frame_menubar for USE_GTK. - (set_frame_menubar): Call xg_modify_menubar_widgets for USE_GTK. - (free_frame_menubar): Only compile if not USE_GTK. GTK version - is in gtkutil.c. - (popup_selection_callback): New version for USE_GTK. - (create_and_show_popup_menu): New fuction, one USE_GTK version and - one USE_X_TOOLKIT version. - (xmenu_show): Call create_and_show_popup_menu. - (dialog_selection_callback): New version for USE_GTK. - (create_and_show_dialog): New fuction, one USE_GTK version and - one USE_X_TOOLKIT version. - (xdialog_show): Call create_and_show_dialog. - - * xfns.c: Include gtkutil for USE_GTK. - (x_window_to_frame, x_any_window_to_frame) - (x_non_menubar_window_to_frame, x_menubar_window_to_frame) - (x_top_window_to_frame): Add code for USE_GTK. - (x_set_background_color): Call xg_set_background_color for GTK. - (x_set_menu_bar_lines): Check for USE_GTK. - (x_set_tool_bar_lines): Call update_frame_tool_bar for USE_GTK. - (x_set_name, x_set_title): Call gtk_window_set_title for USE_GTK. - (x_window): Call xg_create_frame_widgets for USE_GTK. - (Fx_create_frame): Check for USE_GTK. - (Fx_file_dialog): New implementation for USE_GTK. - - * xdisp.c: Add check for USE_GTK for extern void set_frame_menubar. - (update_menu_bar): Add check for USE_GTK. - (update_tool_bar): Add check for USE_GTK and external tool bar. - (redisplay_tool_bar): Add check for USE_GTK and external tool bar. - (redisplay_internal): Add check for USE_GTK and popup_activated. - (redisplay_window): Add check for USE_GTK and FRAME_EXTERNAL_MENU_BAR. - (redisplay_window): Add check for USE_GTK and FRAME_EXTERNAL_TOOL_BAR. - (display_menu_bar): Add check for USE_GTK. - - * lisp.h (Vx_resource_name): Declare extern. - - * keyboard.c (kbd_buffer_get_event): Check MENU_BAR_ACTIVATE_EVENT - for USE_GTK. - (make_lispy_event): Check MENU_BAR_EVENT for USE_GTK. - - * frame.h (struct frame): Add external_tool_bar. Check for USE_GTK. - (FRAME_EXTERNAL_TOOL_BAR): New macro. - (FRAME_EXTERNAL_MENU_BAR): Check for USE_GTK. - - * fileio.c (Fread_file_name): Add check for USE_GTK. - - * dispnew.c (adjust_frame_glyphs_for_window_redisplay): - Add check for USE_GTK. - - * config.in: Added HAVE_GTK. - - * alloc.c (Fgarbage_collect): Call xg_mark_data for GTK. - -2003-01-18 Stefan Monnier <monnier@cs.yale.edu> - - * charset.h (Funibyte_char_to_multibyte): Export. - -2003-01-18 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xmenu.c (mouse_position_for_popup): New function. - (Fx_popup_menu): Call mouse_position_for_popup for X and - mouse_position_hook for others. - -2003-01-17 Kim F. Storm <storm@cua.dk> - - * editfns.c (Finsert): Mention `string-make-multibyte' and - `string-as-multibyte' in doc string. - -2003-01-17 Kenichi Handa <handa@m17n.org> - - * fontset.c (syms_of_fontset): Setup Vfont_encoding_alist here. - - * editfns.c (Fformat): Convert an unibyte char argument that is - formatted by "%c" to multibyte if the total result must be a - multibyte string. - -2003-01-16 Kim F. Storm <storm@cua.dk> - - * process.c (set-process-filter): Document unibyte/multibyte-ness - of string argument. - -2003-01-16 Kenichi Handa <handa@m17n.org> - - * charset.h (NEXT_CHAR_BOUNDARY, PREV_CHAR_BOUNDARY): New macros. - - * regex.c (GET_CHAR_BEFORE_2): Use PREV_CHAR_BOUNDARY. - (re_search_2): Likewise. - -2003-01-15 Kenichi Handa <handa@m17n.org> - - * xdisp.c (message_dolog): Fix bug of the case that *Message* - buffer is unibyte. - -2003-01-15 Francesco Potort,Al(B <pot@gnu.org> - - * fns.c (Fsubstring): Clarify doc string. - - * textprop.c (Ftext_properties_at, Fnext_char_property_change) - (Fprevious_char_property_change) - (Fnext_single_char_property_change) - (Fprevious_single_char_property_change, Fnext_property_change) - (Fnext_single_property_change, Fprevious_property_change) - (Fprevious_single_property_change, Fadd_text_properties) - (Fput_text_property, Fset_text_properties) - (Fremove_text_properties, Fremove_list_of_text_properties) - (Ftext_property_any, Ftext_property_not_all): Clarify doc strings. - -2003-01-14 Kim F. Storm <storm@cua.dk> - - * process.h (struct Lisp_Process): New member plist replaces old - member private_vars. All uses changed. - - * process.c: Reworked 2003-01-12 change -- call a plist a plist! - (QCplist): Rename from QCvars. Change all uses. - (Fprocess_plist): Replaces Fprocess_variable. Simplified. - (Fset_process_plist): Replaces Fset_process_variable. Simplify. - (syms_of_process): Intern, staticpro, defsubr these. - (Fmake_network_process): Describe :plist arg. Remove :vars arg. - -2003-01-14 Francesco Potort,Al(B <pot@gnu.org> - - * m/delta.h: Remove (obsolete). - -2003-01-13 Francesco Potort,Al(B <pot@gnu.org> - - * fileio.c (Fdelete_directory, Fdelete_file): Document the - behaviour in front of symlinks. - (Fdelete_file): Raise an error on directories. - -2003-01-13 Dave Love <fx@gnu.org> - - * fns.c (Freverse): Use QUIT. - -2003-01-13 Richard M. Stallman <rms@gnu.org> - - * minibuf.c (minibuffer_completion_contents): - Error if point is inside prompt. - - * keyboard.c (command_loop_1): Don't redisplay directly - if there's a post-command-hook. - - * fileio.c (syms_of_fileio) <directory-sep-char>: Doc fix. - (Fdo_auto_save): Add gcpros around Ffile_name_directory. - -2003-01-12 Kim F. Storm <storm@cua.dk> - - * process.h (struct Lisp_Process): New member private_vars. - - * process.c (QCvars): New variable. - (syms_of_process): Intern and staticpro it. - (Fset_process_contact): Removed function. - (Fprocess_variable, Fset_process_variable): New functions. - (syms_of_process): Defsubr them. - (Fstart_process): Initialize private_vars plist to nil. - (Fmake_network_process): New arg :vars to setup the private - variables for new network process. - (server_accept_connection): Copy server's private variables to - client process. - - * alloc.c (pure_alloc): Fixed 2003-01-10 changed (caused spurious - crashes). Code rewritten and simplified. Now directly aligns the - pointer and recalculates pure_bytes_used, rather than aligning the - size and adjusting the pointer. - -2003-01-11 Kim F. Storm <storm@cua.dk> - - * process.c (Fset_process_contact): New function. - (syms_of_process): defsubr it. - (make-network-process): Update doc. - -2003-01-10 Andreas Schwab <schwab@suse.de> - - * alloc.c (pure_alloc): Correct alignment for Lisp_Floats. - Reported by Berthold Gunreben <b.gunreben@web.de>. - -2003-01-10 Dave Love <fx@gnu.org> - - * composite.c (syms_of_composite): Make composition_hash_table weak. - -2003-01-09 Kim F. Storm <storm@cua.dk> - - * process.c (Fmake_network_process): Convert new port number - to host byte order for `:service t' case. From Mario Lang. - -2003-01-08 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xfns.c (Fx_file_dialog): Call XtAppNextEvent and x_dispatch_event - instead of XtAppProcessEvent. - - * xterm.c (handle_one_xevent): New function. - (x_dispatch_event): New function. - (XTread_socket): Call handle_one_xevent. - - * xterm.h (FRAME_OUTER_TO_INNER_DIFF_X/Y): New. - - * xmenu.c (Fx_popup_menu): If popping up at mouse position, - call XQueryPointer to get coordinates. - (popup_get_selection): Do not set popup_activated_flag to zero, - let popup_deactivate_callback do that. Needed for Motif. - Call x_dispatch_event instead of XtDispatchEvent. - (xmenu_show): Calculate root coordinate from frame top/left position. - -2003-01-08 Kim F. Storm <storm@cua.dk> - - * process.c (server_accept_connection): Fix recording of new - connection's local address in :local property of contact info. - (Fmake_network_process): Record local network address for new - client processes in :local property of contact info. - (format-network-address): Add arg OMIT-PORT. Change callers. - -2003-01-07 Dave Love <fx@gnu.org> - - * Makefile.in (fns.o): Depend on coding.h. - -2003-01-06 Dave Love <fx@gnu.org> - - * fns.c: Include coding.h. Use POINTER_TYPE*, not void*. - (Vlocale_coding_system): Declare. - (Qcodeset, Qdays, Qmonths, Qpaper): New. - (Flanginfo): New. - (syms_of_fns): Initialize new stuff. - -2003-01-07 Markus Rost <rost@math.ohio-state.edu> - - * minibuf.c (Fread_variable): Doc fix. - - * eval.c (Fuser_variable_p): Doc change. For custom variables, - use the same test as for custom-variable-p. - -2003-01-05 Richard M. Stallman <rms@gnu.org> - - * xdisp.c (try_scrolling): New arg LAST_LINE_MISFIT. - Count LAST_LINE_MISFIT in scroll margin for end of window. - Move label too_near_end before setting SCROLL_MARGIN_POS. - Set LAST_LINE_MISFIT before jumping there. - - * xdisp.c (try_scrolling): Calculate amount_to_scroll better in - scroll_conservatively case. If scrolling that much doesn't change - STARTP, move it down one line. - - * xdisp.c (redisplay_window): Pass last_line_misfit arg to - try_scrolling. Make it 1 after make_cursor_line_fully_visible fails. - - * xdisp.c (setup_echo_area_for_printing): Kill Emacs if no - selected frame. - - * keymap.c (apropos_predicate, apropos_accumulate): Make them static. - (syms_of_keymap): Staticpro them. - (Fapropos_internal): Initialize them and clear them out. - Don't GCPRO them. - - * buffer.c (syms_of_buffer) <scroll-up|down-aggressively>: Doc fixes. - - * lisp.h: New misc type Lisp_Save_Value. - (enum Lisp_Misc_Type): Add Lisp_Misc_Save_Value. - (XSAVE_VALUE): New macro. - (struct Lisp_Save_Value): New data type. - (union Lisp_Misc): Add u_save_value alternative. - (make_save_value): Declare. - - * alloc.c (make_save_value): New function. - - * xterm.c (x_catch_errors): Save dpy using make_save_value. - (x_catch_errors_unwind): Call XSync. - -2003-01-01 Richard M. Stallman <rms@gnu.org> - - * window.c (window_scroll_pixel_based): Partially undo last change. - - * keyboard.c (command_loop_1): Call adjust_point_for_property - in direct action cases for Qforward_char and Qbackward_char. - Set already_adjusted so it won't be done twice. - -2002-12-30 Richard Dawe <rich@phekda.freeserve.co.uk> - - * src/config.in (!HAVE_SIZE_T): Fix order of arguments in - type definition of size_t. - -2003-01-02 Steven Tamm <steventamm@mac.com> - - * macterm.c (syms_of_macterm): Provide the feature "mac-carbon" to - distinguish Carbon GUI builds from X11 builds on darwin. - -2002-12-30 Steven Tamm <steventamm@mac.com> - - * macterm.c (syms_of_macterm): Set mac-wheel-button-is-mouse-2 - to default to t. - -2002-12-29 Francesco Potort,Al(B <pot@gnu.org> - - * data.c (Fstring_to_number, Fminus): Better English in doc strings. - -2002-12-28 Steven Tamm <steventamm@mac.com> - - * Makefile.in (macosx-bundle): Fix Mac OS X/Carbon port to - allow building in a different directory than source. Uses some - GNU Make extensions, but there is no other make on Mac OS X. - -2002-12-26 Francesco Potort,Al(B <pot@gnu.org> - - * data.c (Fmakunbound, Ffmakunbound, Fmake_variable_buffer_local) - (Fsetq_default, Fmake_local_variable, Fkill_local_variable) - (Fmake_variable_frame_local, Faset, Fnumber_to_string, Fminus) - (Fstring_to_number): Mention the returned value in the doc strings. - -2002-12-23 Richard M. Stallman <rms@gnu.org> - - * buffer.c (syms_of_buffer) <scroll-up-aggressively> - <scroll-down-aggressively>: Doc fix. - - * xmenu.c (parse_single_submenu): Use individual keymap's prompt - string as pane name, if there is one. - (set_frame_menubar): Save menu_items_n_panes from each call to - parse_single_submenu and use it when calling digest_single_submenu. - - * window.c (window_scroll_pixel_based): Fix check for reaching BEGV. - Don't try to make last line fully visible if it is past end of window. - -2002-12-22 Steven Tamm <steventamm@mac.com> - - * macmenu.c (MIN_POPUP_SUBMENU_ID): Add. - (mac_menu_show): Add support for hierarchical popup menus. - (add_menu_item): Remove indentation support. - (fill_submenu, fill_menu): Create hierarchical menus - instead of using indentation. - -2002-12-22 Richard M. Stallman <rms@gnu.org> - - * xdisp.c (try_cursor_movement): Don't call try_window here. - (redisplay_window): Never redisplay minibuffer when inactive. - - * window.c (select_window_1): Undo 9/21 change. - -2002-12-22 Steven Tamm <steventamm@mac.com> - - * macterm.c (XTread_socket): Call KeyTranslate for control and - meta to deal correctly shifted non-alpha characters, like C-S-5 - being treated like C-%. Do not look for shift key to deal - with masking off control-key with mac-reverse-ctrl-meta. - -2002-12-21 Richard M. Stallman <rms@gnu.org> - - * xmenu.c (popup_get_selection): Now static. New arg DO_TIMERS. - If it is non-nil, run timers. Use an unwind-protect to requeue - the events that were read ahead. - (popup_get_selection_unwind): New subroutine. - (popup_get_selection_queue): File-scope variable now holds that queue. - (xmenu_show): Pass 0 for DO_TIMERS to popup_get_selection. - (xdialog_show): Pass 1 for DO_TIMERS to popup_get_selection. - Use an unwind-protect to pop down the dialog box. - (xdialog_show_unwind): New subroutine implements that. - - * xdisp.c (row_containing_pos): Change exit test using last_y. - (try_window_id): Abort if row_containing_pos returns null. - - * lread.c (load_error_handler): New function. - (Fload): Handle errors in Fsubstitute_in_file_name. - Don't expect Fsignal to return. - - * eval.c: Errors and throws work right with interrupt blocking. - (struct catchtag): New elt interrupt_input_blocked. - (unwind_to_catch): Restore interrupt_input_blocked from saved value. - (internal_catch, Fcondition_case, internal_condition_case) - (internal_condition_case_1, internal_condition_case_2): Save it. - (Fsignal): Don't do TOTALLY_UNBLOCK_INPUT. - - * editfns.c (Fformat): Add parens. - - * dired.c (file_name_completion): Fix that change. - Delete special quit-handling code; just use QUIT. - -2002-12-21 Tak Ota <Takaaki.Ota@am.sony.com> - - * dired.c (file_name_completion): Close directory on error - just as in directory_files_internal. - -2002-12-19 David Kastrup <David.Kastrup@t-online.de> - - * window.c (Fset_window_configuration): Set old_point to correct - value when new_current_buffer == current_buffer. - -2002-12-17 Ben Key <bkey1@tampabay.rr.com> - - Revisited my earlier fix for the following entry in etc/PROBLEMS: - "Emacs built on Windows 9x/ME crashes at startup on Windows XP, - or Emacs builtpart of on XP crashes at startup on Windows 9x/ME." - - These changes were in part based upon suggestions made by Peter - 'Luna' Runestig [peter@runestig.com]. - - * w32.c (g_b_init_is_windows_9x, g_b_init_open_process_token) - (g_b_init_get_token_information, g_b_init_lookup_account_sid) - (g_b_init_get_sid_identifier_authority ): Add several static - global variables. - - * w32.c (globals_of_w32): New function. Used to initialize those - global variables that must always be initialized on startup even - when the global variable initialized is non zero. Its primary - purpose at this time is to set the global variables - g_b_init_is_windows_9x, g_b_init_open_process_token, - g_b_init_get_token_information, g_b_init_lookup_account_sid, and - g_b_init_get_sid_identifier_authority to 0 on startup. - Called from main. - - * w32.c (is_windows_9x): Perform initialization only if - g_b_init_is_windows_9x is equal to 0. On initialization set - g_b_init_is_windows_9x equal to 1. - - * w32.c (open_process_token): Perform initialization only if - g_b_init_open_process_token is equal to 0. On initialization set - g_b_init_open_process_token equal to 1. - - * w32.c (get_token_information): Perform initialization only if - g_b_init_get_token_information is equal to 0. On initialization - set g_b_init_get_token_information equal to 1. - - * w32.c (lookup_account_sid): Perform initialization only if - g_b_init_lookup_account_sid is equal to 0. On initialization - set g_b_init_lookup_account_sid equal to 1. - - * w32.c (get_sid_identifier_authority): Perform initialization - only if g_b_init_get_sid_identifier_authority is equal to 0. - On initialization set g_b_init_get_sid_identifier_authority equal to 1. - - * w32fns.c (globals_of_w32fns): New function. Used to initialize - those global variables that must always be initialized on startup - even when the global variable initialized is non zero. - Its primary purpose at this time is to initialize the global variable - track_mouse_event_fn. - - * w32fns.c (w32_wnd_proc): Remove initialization of - track_mouse_event_fn from the handler for the WM_SETFOCUS message. - - * w32fns.c (syms_of_w32fns): Call globals_of_w32fns. - - * w32menu.c (globals_of_w32menu): New function. Used to - initialize those global variables that must always be initialized - on startup even when the global variable initialized is non zero. - Its primary purpose at this time is to initialize the global - variables get_menu_item_info and set_menu_item_info. - - * w32menu.c (initialize_frame_menubar): Remove initialization of - get_menu_item_info and set_menu_item_info. - - * w32menu.c (syms_of_w32menu): Call globals_of_w32menu. - - * w32.h (globals_of_w32, globals_of_w32fns, globals_of_w32menu): - Declare them. - - * emacs.c (main): Call globals_of_w32 prior to calling - init_environment if WINDOWSNT is defined. Call globals_of_w32fns - and globals_of_w32menu if initialized is non zero and HAVE_NTGUI - is defined. - - * w32term.c (x_update_window_begin): Fix Windows API error - detected by BoundsChecker. Test to determine if - w32_system_caret_hwnd is NULL prior to attempting to use - SendMessage to send the WM_EMACS_HIDE_CARET message to it. - - * w32term.c (x_update_window_end): Fix Windows API error - detected by BoundsChecker. Test to determine if - w32_system_caret_hwnd is NULL prior to attempting to use - SendMessage to send the WM_EMACS_SHOW_CARET message to it. - -2002-12-17 Kenichi Handa <handa@m17n.org> - - * coding.c (coding_system_require_warning): New variable. - (syms_of_coding): DEFVAR it. - - * coding.h (coding_system_require_warning): Extern it. - - * fileio.c (choose_write_coding_system): Even if - Vcoding_system_for_write is non-nil, if - coding_system_require_warning is nonzero, call - Vselect_safe_coding_system_function. - -2002-12-17 Markus Rost <rost@math.ohio-state.edu> - - * Makefile.in (lisp, shortlisp): Add cus-face and timer. - (lisp): Add font-core. - -2002-12-13 Stefan Monnier <monnier@cs.yale.edu> - - * textprop.c (text_read_only): New arg `propval'. - (get_char_property_and_overlay): Remove unused var `next_overlay'. - (verify_interval_modification): Use text_read_only's new arg. - -2002-12-13 Kenichi Handa <handa@m17n.org> - - * coding.c (Funencodable_char_position): Set pend correctly. - -2002-12-12 Jason Rumney <jasonr@gnu.org> - - * w32term.c (last_mousemove_x, last_mousemove_y): New variables. - (w32_read_socket) <WM_MOUSEMOVE>: Use them to detect non-movement. - Be more careful about when help_events are generated. - -2002-12-12 Steven Tamm <steventamm@mac.com> - - * macterm.c (mac_check_for_quit_char): Correctly set the - modifiers of the event to 0. - * mac.c (sys_select): Duplicate rfds before calling select to - ensure that rfds survive the while loop. - -2002-12-11 Kim F. Storm <storm@cua.dk> - - * xdisp.c (try_window_id): Don't call set_cursor_from_row if - row_containing_pos returned NULL. - -2002-12-10 Steven Tamm <steventamm@mac.com> - - * mac.c (sys_read): Fix sys_read to not call select if IO is - non-blocking. - (sys_select): Fix sys_select to not use a timeout larger than - the one given. - -2002-12-10 Juanma Barranquero <lektu@terra.es> - - * editfns.c (Fformat): Use alloca, not _alloca. - -2002-12-09 Richard M. Stallman <rms@gnu.org> - - * buffer.c (Fget_buffer_create): Call Qucs_set_table_for_input - as the last thing. - -2002-12-09 Dave Love <fx@gnu.org> - - * s/sol2-8.h: Removed. (Not necessary.) - -2002-12-09 Matthew Swift <swift@alum.mit.edu> - - * editfns.c (Fformat): Handle precision in string conversion - specifiers like libc functions do (ie, print at most that many - characters). - -2002-12-08 Richard M. Stallman <rms@gnu.org> - - * xdisp.c (row_containing_pos): Check more carefully - whether charpos is really in the row before returning it. - -2002-12-07 Steven Tamm <steventamm@mac.com> - - * sysdep.c (emacs_read) [HAVE_CARBON]: Have emacs_read use sys_read. - - * eval.c (Feval) [HAVE_CARBON]: Calls mac_check_for_quit_char at - each stack frame. This may change as it could be time consuming. - - * macterm.c (mac_check_for_quit_char, quit_char_comp) - (init_quit_char_handler, mac_determine_quit_char_modifiers) - (mac_initialize): Add code to check for pressing of quit_char - in the OS event queue. - - * mac.c (sys_select): Call mac_check_for_quit_char every second - while blocking on select. - - * mac.c (sys_read): Use sys_select to test for input first - before calling read, to allow C-g to break. - -2002-12-07 Richard M. Stallman <rms@gnu.org> - - * minibuf.c (Fcompleting_read): Doc fix. - - * lread.c (syms_of_lread) <load-history>: Doc fix. - - * fileio.c (Fcopy_file): Set immediate_quit around emacs_open call. - - * eval.c (Fdefun, Fdefmacro): Record in load-history redefining an - autoload. - - * data.c (Fdefalias): Record in load-history redefining an autoload. - - * alloca.c: Undo ifdef change accidentally made on 12-04. - -2002-12-06 Francesco Potort,Al(B <pot@gnu.org> - - * xfns.c (png_load): Avoid double gamma correction for PNG images. - -2002-12-04 Richard M. Stallman <rms@gnu.org> - - * sysdep.c (fcntl.h): Test only HAVE_FCNTL_H. - - * fileio.c (fcntl.h): Test only HAVE_FCNTL_H. - - * alloca.c: Don't use #error. - -2002-12-03 Dave Love <fx@gnu.org> - - * buffer.c (Qucs_set_table_for_input): New. - (Fget_buffer_create): Use it. - (Qset_buffer_major_mode_hook): Deleted. - (Fset_buffer_major_mode): Revert previous change. - (init_buffer_once): Intern ucs-set-table-for-input. - (syms_of_buffer): Delete Qset_buffer_major_mode_hook. - Add &Qucs_set_table_for_input. - -2002-12-03 Andreas Schwab <schwab@suse.de> - - * callint.c (Fcall_interactively): Use next_event only if less - than key_count. - -2002-12-02 Andrew Choi <akochoi@shaw.ca> - - * macmenu.c (add_menu_item, fill_menubar): Truncate menu item - names to 255 characters. - - * macterm.c (XTread_socket): If all frames have been collapsed, - expand the first one before handling drag-and-drop events. - - * s/darwin.h (GETPGRP_NO_ARG): Delete. Replaced by GETPGRP_VOID, - which is detected by autoconf. - -2002-12-01 Steven Tamm <steventamm@mac.com> - - * unexmacosx.c (copy_twolevelhints, dump_it): Now corrects the - offset in two hints table to allow prebinding to be redone and - allow the executable to be stripped. - -2002-11-29 Dave Love <fx@gnu.org> - - * fns.c (Frequire): Don't call LOADHIST_ATTACH if feature was - already provided. - -2002-11-29 Richard M. Stallman <rms@gnu.org> - - * xdisp.c (start_display): Check more intelligently for - whether the line is continued. - (move_it_vertically_backward): Clear it->continuation_lines_width. - -2002-11-28 Dave Love <fx@gnu.org> - - * s/amdahl.h, s/unipl5-0.h, m/sgi3000.h, s/3700.h, s/alliant-2800.h: - * s/alliant.h, s/altos.h: Deleted. (Unused/empty.) - -2002-11-27 Steven Tamm <steventamm@mac.com> - - * fns.c (Frequire): Change nesting allowance from 2 to 3 to cause - more descriptive error output from lread.c:Fload upon most require - cycles during boostrapping. - -2002-11-27 Jason Rumney <jasonr@gnu.org> - - * fileio.c (Finsert_file_contents): Give a more appropriate error - for files bigger than 2Gb when off_t is 32 bit. - - * dired.c (Ffile_attributes): Don't return negative file sizes for - files bigger than 2Gb when off_t is 32 bit. - -2002-11-27 Dave Love <fx@gnu.org> - - * s/irix6-0.h (GC_SETJMP_WORKS, GC_MARK_STACK): Define. - - * systty.h: Don't conditionally define GETPGRP_NO_ARG. - Test GETPGRP_VOID instead. - [BSD_TERMIOS]: Remove definitions (never used). - - * s/osf5-0.h (WAIT_USE_INT, SYS_SIGLIST_DECLARED, sys_siglist): - Don't define. - (GC_SETJMP_WORKS, GC_MARK_STACK): Define. - - * m/mips.h (WORDS_BIG_ENDIAN): Define conditionally. - -2002-11-25 Jason Rumney <jasonr@gnu.org> - - * w32.c (sys_write): Avoid non-blocking mode, which is not fully - supported. - -2002-11-25 Dave Love <fx@gnu.org> - - * unexalpha.c (update_dynamic_symbols): Cast arg of fatal_unexec. - - * Makefile.in (TEMACS_LDFLAGS): Update last change. - -2002-11-25 Andreas Schwab <schwab@suse.de> - - * m/ia64.h: Restore `#ifndef NOT_C_CODE' deleted by last change. - -2002-11-24 Steven Tamm <steventamm@mac.com> - - * unexmacosx.c (unexec_realloc): Use malloc_default_zone to - determine the size of pointers alloced in unexed space instead - of using possibly invalid emacs_zone pointers. This fixes the - binary incompatibility problems caused by updates to libSystem.B. - -2002-11-24 Richard M. Stallman <rms@gnu.org> - - * search.c (Fstring_match): Doc fix. - - * callint.c (Fcall_interactively): If a command fails because - `*' detects a read-only buffer, but RECORD_FLAG is set, - record it anyway if the args don't actually do tty input. - -2002-11-22 Dave Love <fx@gnu.org> - - * sysdep.c (stuff_char) [PROTOTYPES]: Provide ISO C arglist. - - * keyboard.c (interrupt_signal): Provide forward declaration. - (kbd_buffer_store_event): Don't declare interrupt_signal. - - * xdisp.c (store_frame_title_char) [PROTOTYPES]: Provide ISO C arglist. - -2002-11-21 Richard M. Stallman <rms@gnu.org> - - * eval.c (interactive_p): Skip any number of bytecode - and special form frames, in any order. - -2002-11-20 Jason Rumney <jasonr@gnu.org> - - * w32fns.c (convert_mono_to_color_image): New function. - (xbm_load, xbm_load_image): Use it when foreground or background - is explicitly set. - -2002-11-19 Dave Love <fx@gnu.org> - - * s/usg5-4.h, sco4.h (bcopy, bzero, bcmp): Don't define. - -2002-11-18 Jason Rumney <jasonr@gnu.org> - - * w32fns.c (x_build_heuristic_mask): Filter palette info from color. - (XPutPixel): Swap blue and red. - (xpm_format, pbm_format, png_format, jpeg_format, tiff_format) - (gif_format, gs_format): Use IMAGE_ASCENT_VALUE. - (xpm_image_p, pbm_image_p, png_image_p, jpeg_image_p) - (tiff_image_p, gif_image_p, gs_image_p): Don't check ascent. - -2002-11-18 Dave Love <fx@gnu.org> - - * m/orion105.h (HAVE_ALLOCA): Don't define. - - * m/m68k.h, m/arm.h, mtekxd88.h, m/tower32v3.h: Don't define alloca. - - * m/intel386.h: Don't include alloca.h or define alloca. - - * m/ia64.h: Don't include alloca.h, stdlib.h. Don't declare - malloc, realloc, calloc. - - * m/hp800.h, m/sr2k.h, m/ns16000.h, m/wicat.h (bcopy, bzero) - (bcmp): Don't define. - - * m/delta.h (bcopy, bzero, bcmp, alloca): Don't define. - - * m/amdahl.h: Don't define LIB_STANDARD. - - * m/alpha.h: Move OSF1 stuff from here to s/osf1.h. - - * s/osf1.h: Move OSF1 stuff from m/alpha.h to here. - - * s/irix4-0.h, s/irix5-0.h, m/powerpcle.h, m/sparc.h: - Don't include alloca.h. - - * s/aix3-2.h (HAVE_FSYNC): Don't define. - - * regex.c (_GNU_SOURCE): Don't define. - - * process.c (_GNU_SOURCE): Don't define. - - * fileio.c (_GNU_SOURCE, HAVE_FSYNC): Don't define. - -2002-11-18 Markus Rost <rost@math.ohio-state.edu> - - * s/sol2-8.h: Include sol2-6.h. - -2002-11-18 Miles Bader <miles@gnu.org> - - * dispextern.h (struct face): Add `overstrike' field. - * xterm.c (x_draw_glyph_string_foreground) - (x_draw_composite_glyph_string_foreground): Implement overstriking. - * xfaces.c (load_face_font): Set `face->overstrike' based on - result from choose_face_font. - (best_matching_font, choose_face_font): Add `needs_overstrike' - argument, and use it to return whether overstriking is desirable - for this face/font combo. - (set_font_frame_param): Pass new argument to choose_face_font. - -2002-11-17 Ben Key <BKey1@tampabay.rr.com> - - This change is my fix for the following entry in etc/PROBLEMS: - "Emacs built on Windows 9x/ME crashes at startup on Windows XP, - or Emacs builtpart of on XP crashes at startup on Windows 9x/ME." - - * w32.c: Added wrapper functions around the win32 API functions - OpenProcessToken, GetTokenInformation, LookupAccountSid, and - GetSidIdentifierAuthority. These wrapper functions serve two - purposes: - 1. They ensure that the wrapped function can never be called - when Emacs is running on an operating system on which they are - not supported (Microsoft Windows 95 / 98 / ME). - 2. They call the wrapped functions via function pointers rather - than calling them directly. This avoids taking advantage of the - undocumented fact that although these functions are not supported - in the 9x branch of Microsoft Windows, the functions do exist in - the version of advapi32.dll that is found in the 9x branch of - Microsoft Windows. - - * w32.c (init_user_info): Replace the calls to the win32 API - functions OpenProcessToken, GetTokenInformation, LookupAccountSid, - and GetSidIdentifierAuthority with calls to the newly added - wrapper functions. - - * w32.h: Added extern declarations for the following functions: - syms_of_w32term, syms_of_w32fns, syms_of_w32select, - syms_of_w32menu, and void syms_of_fontset. - - * w32fns.c (w32_wnd_proc): Add code to reinitialize the - function pointer track_mouse_event_fn in the handler for the - WM_SETFOCUS message. - - * w32menu.c (initialize_frame_menubar): Add code to - reinitialize the function pointers set_menu_item_info and - get_menu_item_info. - -2002-11-17 Ben Key <BKey1@tampabay.rr.com> - - * sound.c: Added a partial implementation of play-sound-internal - for Microsoft Windows. Added various #ifdef / #else / #endif - code blocks to separate the code that will compile under - Microsoft Windows from the code that is specific to GNU/Linux. - Moved several blocks of code around to make this separation of code - into Windows compatible and GNU/Linux compatible code blocks easier. - - * makefile.w32-in: Include sound.c and link with WinMM.lib. - - * s/ms-w32.h: Defined the symbol HAVE_SOUND so that the newly - added support for play-sound-internal under Windows would be - included in the build of Emacs. - -2002-11-16 Jason Rumney <jasonr@gnu.org> - - * w32fns.c (w32_load_system_font): Don't disable Cleartype. - - * w32term.c (w32_get_glyph_string_clip_rect): Clip cursor tightly. - -2002-11-15 Stefan Monnier <monnier@cs.yale.edu> - - * keyboard.c (command_loop_1): Fix int/Lisp_Object mixup. - (adjust_point_for_property): Move out of display and invisible even if - we were already inside before (in case a property was added while - we weren't looking). Be more careful when handling invisible props. - Skip invisible text as if it really wasn't there at all. - -2002-11-15 Jason Rumney <jasonr@gnu.org> - - * w32term.c (x_draw_image_foreground) - (w32_draw_image_foreground_1): Use standard copy and invert - operations to draw images. - - * w32fns.c (x_create_x_image_and_pixmap): Fill in palette for - depth of 1. - (xbm_read_bitmap_data): Invert bits as xbm is read in. - (XPutPixel): Don't invert bits here. - -2002-11-15 Jason Rumney <jasonr@gnu.org> - - * w32term.c (x_draw_image_foreground, x_draw_image_glyph_string) - (w32_draw_image_foreground_1): Handle image masks. - (x_draw_image_glyph_string): Don't BitBlt transparently. - - * w32fns.c (w32_defined_color): Adjust RGB values for Emacs. - (x_from_xcolors): Adjust RGB values for W32. - (image_background, image_background_transparent) - (postprocess_image, x_to_xcolors, x_disable_image) - (x_build_heuristic_mask): Adapt for W32 and enable. - (x_create_x_image_and_pixmap): Mark images with palettes as such. - (xbm_load): Remove unused variable. - -2002-11-14 Richard M. Stallman <rms@gnu.org> - - * buffer.c (syms_of_buffer): Doc fix. - -2002-11-14 Dave Love <fx@gnu.org> - - * alloc.c (SETJMP_WILL_NOT_WORK): Add note. - - * xterm.c (x_draw_relief_rect, x_draw_box_rect, x_update_cursor): - * xmenu.c (unuse_menu_items, digest_single_submenu): - * xfns.c (x_put_x_image): - * xdisp.c (message2_nolog, set_message): - * undo.c (record_point): - * terminfo.c (tparam): - * syntax.c (scan_sexps_forward): - * scroll.c (calculate_scrolling, calculate_direct_scrolling): - * composite.c (update_compositions): - * cm.c (calccost, cmgoto): - * charset.c (c_string_width): Declare all args (per C99). - - * frame.h (get_specified_cursor_type, get_window_cursor_type): Declare. - - * lisp.h (get_specified_cursor_type, get_window_cursor_type): - Don't declare. - - * emacs.c (main) [!VMS]: Avoid third arg. - - * fns.c (Fcopy_sequence): Doc fix. - (Fmap_char_table): Cast `call2'. - -2002-11-14 Francesco Potort,Al(B <pot@gnu.org> - - * s/sol2-8.h: New file. - -2002-11-14 Kim F. Storm <storm@cua.dk> - - * buffer.c (syms_of_buffer) <mode-line-format>: Document symbol - dependency on `risky-local-variable' and the :propertize form. - -2002-11-12 Stefan Monnier <monnier@cs.yale.edu> - - * fns.c (Fmap_char_table): Don't use map_char_table's function arg. - - * syntax.c (scan_sexps_forward): Undo last patch. - Use a more obvious fix: check eob before updating the syntax table. - -2002-11-09 Stefan Monnier <monnier@cs.yale.edu> - - * syntax.c (scan_sexps_forward): Update syntax table before reading - a char rather than after so we don't update the table past eob. - -2002-11-09 Dave Love <fx@gnu.org> - - * buffer.c (Fset_buffer_major_mode): Fix last change. - - * regex.c (regexec): Fix pmatch declaration. - - * cmds.c (Fself_insert_command): Apply Vtranslation_table_for_input. - - * keyboard.c (command_loop_1): Apply Vtranslation_table_for_input - to self-inserting characters. - (syms_of_keyboard) <keyboard-translate-table>: Doc fix. - - * coding.c (Vtranslation_table_for_input): New. - (syms_of_coding): DEFVAR it. - -2002-11-08 Juanma Barranquero <lektu@terra.es> - - * w32term.c (w32_draw_fringe_bitmap): Remove unused local variable - window. - -2002-11-08 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * process.c (Fformat_network_address): Remove unused locals p, - cp, and i. - -2002-11-06 Dave Love <fx@gnu.org> - - * buffer.c (Qset_buffer_major_mode_hook): New. - (Fset_buffer_major_mode): Use it. - -2002-11-06 Richard M. Stallman <rms@gnu.org> - - * xterm.c (x_term_init): Use turn_on_atimers, not start_polling - and stop_polling. - - * process.c (wait_reading_process_input): - Test POLLING_PROBLEM_IN_SELECT, not hpux. - Avoid initialization for auto Lisp_Object var. - - * s/hpux11.h (POLLING_PROBLEM_IN_SELECT): Add #undef. - - * s/hpux10.h (POLLING_PROBLEM_IN_SELECT): Defined. - -2002-11-05 Richard M. Stallman <rms@gnu.org> - - * s/sol2-5.h (BROKEN_SIGIO): Turn off the #undef. - - * callint.c (Fcall_interactively): New local filter_specs. - (Fcall_interactively): Check for progn as well as let. - Add a gcpro. - (Qprogn): New variable. - (syms_of_callint): Staticpro and init Qprogn. - -2002-11-04 John Paul Wallington <jpw@shootybangbang.com> - - * lread.c (Feval_buffer): Doc fix. - -2002-11-04 Dave Love <fx@gnu.org> - - * keyboard.c (read_char): Always translate iff - Vkeyboard_translate_table is a char table and c is valid. - - * xterm.c (XTread_socket): Check Lisp types for Vx_keysym_table - and fix C types. - -2002-11-03 Stefan Monnier <monnier@cs.yale.edu> - - * xdisp.c (single_display_prop_intangible_p): Strings are intangible. - - * editfns.c (get_pos_property): Don't hardcode Qfield. - - * keyboard.c (adjust_point_for_property): Handle `display' prop on - overlays. Also handle `invisible' prop. - -2002-11-02 Stefan Monnier <monnier@cs.yale.edu> - - * coding.c (decode_coding_emacs_mule, decode_coding_iso2022) - (decode_coding_sjis_big5, decode_eol): Allow lone \r in DOS EOL. - -2002-11-01 Andreas Schwab <schwab@suse.de> - - * editfns.c (Fmessage): Revert last change to properly handle %%. - -2002-11-01 Stefan Monnier <monnier@cs.yale.edu> - - * xmenu.c (unuse_menu_items): New fun. - (menu_items_inuse): New var. - (syms_of_xmenu): Initialize it. - (init_menu_items): Use it to detect re-entrance. - (Fx_popup_menu, Fx_popup_dialog, set_frame_menubar): Reset when done. - (Fx_popup_menu): Remove spurious XSETFRAME. - - * editfns.c (find_field): Make an exception for nil fields. - -2002-11-01 Dave Love <fx@gnu.org> - - * m/gec63.h: Deleted. - -2002-10-31 Dave Love <fx@gnu.org> - - * xterm.c (XTread_socket): Fix last change. - (xaw_scroll_callback): Cast call_data to long to avoid warning. - -2002-10-31 Stefan Monnier <monnier@cs.yale.edu> - - * process.c (Fformat_network_address): Fix int/Lisp_Object mixup. - -2002-10-30 Stefan Monnier <monnier@cs.yale.edu> - - * editfns.c (overlays_around, get_pos_property): New funs. - (find_field): Use them. - Also be careful not to modify POS before its last use. - (Fmessage): Don't Fformat if there's nothing to format. - -2002-10-30 Dave Love <fx@gnu.org> - - * process.c [HAVE_SYS_WAIT]: Include sys/wait.h. - [HAVE_PTY_H]; Include pty.h. - - * lread.c (Fload) <!load_dangerous_libraries>: Close fd. - - * xterm.c (Qeql): Declare. - (Vx_keysym_table): New. - (syms_of_xterm): Initialize it. - (XTread_socket): Use it. Deal with ASCII keysyms. - (XSetIMValues) [HAVE_X11R6]: Prototype. - - * keyboard.c (lispy_accent_codes, lispy_accent_keys): Extended. - (lispy_kana_keys): Comment out. - (make_lispy_event) [XK_kana_A]: Comment out. - (modify_event_symbol) <sizeof (long) == sizeof (EMACS_INT)>: - Fix sprintf call. - - * s/osf5-0.h (C_SWITCH_SYSTEM): Revert last change (fixed by - regexp.h change). - (TERMINFO, LIBS_TERMCAP): Define. - - * s/usg5-4.h (bcopy, bzero): Define conditional on HAVE_BCOPY. - (bcmp): Define conditional on HAVE_BCMP. - (NO_SIOCTL_H): Don't define. - (TIOCSIGSEND): Don't make conditional on IRIX6. - - * s/sol2-5.h: Don't include strings.h. - (bcopy, bzero, bcmp) [HAVE_BCOPY]: Don't undef. - - * s/irix6-0.h (IRIX6): Don't define. - (bcopy, bcmp, bzero): Don't undef. - - * s/irix6-5.h: Don't include strings.h. - (IRIX6): Don't define. - (bcopy, bcmp, bzero): Don't undef. - - * syntax.c (Fforward_comment): Doc fix. - -2002-10-29 Kim F. Storm <storm@cua.dk> - - * process.c (Fsignal_process): Allow PROCESS to be specified by - name in addition to pid (as integer or string). - -2002-10-28 Harald Maier <Harald.Maier.BW@t-online.de> (tiny change) - - * w32heap.c: Don't redefine _heap_init and _heap_term on MSVC 7 build - environments. - -2002-10-27 Kim F. Storm <storm@cua.dk> - - * xterm.c (note_mouse_highlight): Don't use mouse-face if hidden. - - * w32term.c (note_mouse_highlight): Don't use mouse-face if hidden. - - * msdos.c (IT_note_mouse_highlight): Don't use mouse-face if hidden. - - * macterm.c (note_mouse_highlight): Don't use mouse-face if hidden. - -2002-10-26 Richard M. Stallman <rms@gnu.org> - - * editfns.c (Fformat): Detect invalid format letters for floats. - -2002-10-25 Kenichi Handa <handa@m17n.org> - - * xfns.c (x_set_name): Encode by Qcompound_text unconditionally. - (x_set_title): Likewise. - -2002-10-25 Juanma Barranquero <lektu@terra.es> - - * macgui.h: - * w32gui.h: Remove definition of XColor. - - * dispextern.h [!HAVE_X_WINDOWS]: Define XColor. - -2002-10-24 Kim F. Storm <storm@cua.dk> - - * xdisp.c (get_window_cursor_type): New arg ACTIVE_CURSOR. - Callers changed (supply dummy arg). - - * lisp.h (get_window_cursor_type): Update prototype. - - * w32term.c (x_display_and_set_cursor): Get active_cursor from - get_window_cursor_type to track system caret. - -2002-10-24 Kim F. Storm <storm@cua.dk> - - * process.c (Fformat_network_address): New function. - (syms_of_process): Defsubr it. - (list_processes_1): Use it to format :local/:remote address if - service/host is not set; before Emacs would crash in that case. - (Fmake_network_process): Don't use Ffind_operation_coding_system - to setup coding system if host or service is not set. - -2002-10-23 Juanma Barranquero <lektu@terra.es> - - Patch suggested by Jay Finger <jay_finger@hotmail.com>. - - * w32term.c (w32_term_init): Pass XColor to w32_define_color, not - COLORREF. - - * macgui.h: - * w32gui.h: Add definition of XColor. - - * macfns.c: - * w32fns.c: - * xfaces.c: Remove definition of XColor. - -2002-10-22 Stefan Monnier <monnier@cs.yale.edu> - - * xfns.c (x_set_name, x_set_title): `icon.value' has unsigned char. - - * window.c (window_loop): For GET_LRU_WINDOW and GET_LARGEST_WINDOW>, - Only ignore truly dedicated windows. For UNSHOW_BUFFER, delete the - window if it is dedicated. - (Fshrink_window): Add preserve_before as was done for enlarge_window. - (Vspecial_display_function): Update docstring. - - * buffer.c (assoc_ignore_text_properties, Fother_buffer, Fkill_buffer) - (call_overlay_mod_hooks): Use CONSP and XCAR/XCDR. - (Fget_buffer_create, advance_to_char_boundary): Use BEG and BEG_BYTE. - -2002-10-21 Stefan Monnier <monnier@cs.yale.edu> - - * casefiddle.c (casify_region): Don't treat a prefix char as part - of a word when at the beginning. - -2002-10-17 Juanma Barranquero <lektu@terra.es> - - * lread.c (syms_of_lread): Fix typos. - -2002-10-17 Dave Love <fx@gnu.org> - - * Makefile.in (TEMACS_LDFLAGS): Add trailing comment. - -2002-10-16 Richard M. Stallman <rms@gnu.org> - - * fileio.c (Fcopy_file): Fix backward test of KEEP_TIME. - -2002-10-14 Juanma Barranquero <lektu@terra.es> - - * w16select.c (syms_of_win16select): Fix docstring for - `selection-coding-system'. - - * w32select.c (syms_of_w32select): Likewise. - -2002-10-14 Stefan Monnier <monnier@cs.yale.edu> - - * syntax.c (scan_lists): Don't get fooled by a symbol ending with - a backslash-quoted char. - (scan_lists, scan_sexps_forward): Pacify the compiler. - -2002-10-13 Richard M. Stallman <rms@gnu.org> - - * window.c (window_scroll): Set immediate_quit. - - * print.c (print): When backquote form is the car of a list, - output in old style. Use old_backquote_output to output all - comma forms inside it in old style too. - - * buffer.h (struct buffer): Move `undo_list' down below `name'. - -2002-10-11 Markus Rost <rost@math.ohio-state.edu> - - * emacs.c (syms_of_emacs) <kill-emacs-hook>: Doc fix (not run in - batch mode). - - * lread.c (Fload): Doc fix (load-suffixes). - -2002-10-10 Steven Tamm <steventamm@mac.com> - - * macterm.c (syms_of_macterm, mac_get_mouse_btn): - Reverse functionality of mac-wheel-button-is-mouse-2 to be correct. - Also switch the default to Qnil from Qt. - -2002-10-08 Kenichi Handa <handa@m17n.org> - - * coding.c (code_convert_region): When we need more GAP for - conversion, pay attention to the case that coding->produced is not - greater than coding->consumed. - -2002-10-07 Richard M. Stallman <rms@gnu.org> - - * unexelf.c (unexec): Redo 9/16 change, but only if IRIX6_5. - -2002-10-06 Andrew Choi <akochoi@shaw.ca> - - * macmenu.c (mac_menu_show): Add j to count menu items; match - menu_item_selection to it to find selected item. - -2002-10-06 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.c (XTread_socket): Fix from 2002-10-03 didn't cover all - cases. The correct fix is to pass ReparentNotify to Xt. - The shell widget interprets ConfigureNotify differently depending - on if it has been reparented or not. - -2002-10-05 Markus Rost <rost@math.ohio-state.edu> - - * editfns.c (Fformat_time_string): Doc fix. - -2002-10-05 John Paul Wallington <jpw@shootybangbang.com> - - * fns.c (Flength): Doc fix. - -2002-10-04 Stefan Monnier <monnier@cs.yale.edu> - - * keyboard.c (keyremap): New struct. - (read_key_sequence): Use it: globally replace keytran_foo with - keytran.foo and fkey_foo with fkey.foo. Rename temp vars - keytran_next and fkey_next to just `next'. - -2002-10-04 Steven Tamm <steventamm@mac.com> - - * macterm.c (keycode_to_xkeysym_table): Change return to be - treated like an X keysym. - -2002-10-03 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.c (XTread_socket): For ConfigureNotify, with x and y == 0, - and USE_MOTIF, call XTranslateCoordinates to get the real x and y. - This is to also handle x/y changes that occur because of a resize. - -2002-10-02 John Paul Wallington <jpw@shootybangbang.com> - - * frame.c (Vdelete_frame_functions): New variable. - (syms_of_frame): Initialize and defvar it. - (Fdelete_frame): Use it instead of delete-frame-hook. Don't run - it when frame's `tooltip' parameter is non-nil. - - * xfns.c (x_create_tip_frame): Set `tooltip' frame parameter to t. - - * w32fns.c (x_create_tip_frame): Likewise. - - * macfns.c (x_create_tip_frame): Likewise. - -2002-09-30 Kenichi Handa <handa@m17n.org> - - * xterm.c (x_encode_char): For DIM=1 charset, set ccl->reg[2] to - -1 before calling ccl_driver. - - * coding.c (decode_coding_emacs_mule): Check coding->cmp_data. - Only when it is non-nil, handle composition sequence. - (setup_coding_system) <0>: Don't force composition handling. - - * Makefile.in (lisp, shortlisp): Add utf-16.elc. - -2002-09-29 Richard M. Stallman <rms@gnu.org> - - * search.c (Freplace_match): Adjust match data for the substitution - just made in the buffer. - - * xdisp.c (STOP_POLLING, RESUME_POLLING): New macros. - (redisplay_internal): Use them. Do RESUME_POLLING at end of function. - -2002-09-27 Richard M. Stallman <rms@gnu.org> - - * keyboard.c (STOP_POLLING, RESUME_POLLING): New macros. - (read_char): Use them. Do all exits thru the end of the function. - -2002-09-27 Kenichi Handa <handa@etl.go.jp> - - * xfaces.c (try_font_list): Pay attention to the case that FAMILY - is nil. - -2002-09-26 Richard M. Stallman <rms@gnu.org> - - * regex.h (__restrict_arr): Don't define if already defined. - - * coding.c (run_pre_post_conversion_on_str): - Save and restore Vdeactivate_mark. - -2002-09-26 John Paul Wallington <jpw@shootybangbang.com> - - * minibuf.c (Fminibufferp): Add an optional `buffer' argument. - -2002-09-26 Kenichi Handa <handa@etl.go.jp> - - * xfaces.c (try_font_list): New arg PREFER_FACE_FAMILY. If it is - nonzero, try face's family at first. Otherwise try FAMILY at first. - (choose_face_font): If C is a single byte char or latin-1, call - try_font_list with PREFER_FACE_FAMILY 1. - -2002-09-21 Richard M. Stallman <rms@gnu.org> - - * window.c (select_window_1): Don't select frame. - Set frame's selected window only when frame itself is selected. - (Fselect_window): Doc fix. - -2002-09-18 Kim F. Storm <storm@cua.dk> - - * process.c (make-network-process): Doc fix (there is no - network-server-log-function hook). - -2002-09-18 Richard M. Stallman <rms@gnu.org> - - * print.c (print): Clear out the unused parts of Vprint_number_table. - (syms_of_print): Doc fix for `print-number-table'. - - * unexelf.c (unexec): Undo previous change. - -2002-09-17 Andreas Schwab <schwab@suse.de> - - * m/alpha.h [LINUX]: Don't define DATA_START. - -2002-09-16 Dave Love <fx@gnu.org> - - * unexelf.c (unexec): Deal with .got, reinstating change from - 25-08-1999. - -2002-09-13 Richard M. Stallman <rms@gnu.org> - - * s/sol2-6.h (UNEXEC): Comment out definition. - - * unexsol.c (unexec): Don't downcase first letter of error msg. - - * xfaces.c (Fcolor_supported_p): Just one arg is required. - -2002-09-12 Markus Rost <rost@math.ohio-state.edu> - - * unexsol.c: Include buffer.h, charset.h, coding.h. - -2002-09-11 Richard M. Stallman <rms@gnu.org> - - * unexsol.c: Don't use report_file_error; do it by hand - using dlerror. - - * process.c (wait_reading_process_input, both versions): - Before calling turn_on_atimers, call stop_polling. - - * emacs.c (syms_of_emacs) <command-line-args>: Doc fix. - - * xdisp.c (try_scrolling): If after make_cursor_line_fully_visible - we go to too_near_end, call clear_glyph_matrix. - (redisplay_window): After make_cursor_line_fully_visible, - call clear_glyph_matrix and bypass `goto done'. - - * xfns.c (x_report_frame_params): If FRAME_SCROLL_BAR_PIXEL_WIDTH is 0 - and we have non-toolkit scroll bars, return nil for scroll-bar-width. - -2002-09-10 Richard M. Stallman <rms@gnu.org> - - * fileio.c (Fdo_auto_save): Catch error making directory. - Only call push_message if we need to. - At the same time, make an unwind-protect to pop it. - Rename local message_p to old_message_p. - (do_auto_save_make_dir, do_auto_save_eh): New functions. - (do_auto_save_unwind): Don't call pop_message. - - * lisp.h (pop_message_unwind): Renamed from push_message_unwind. - - * keyboard.c (Fexecute_extended_command): Use pop_message_unwind. - - * alloc.c (Fgarbage_collect): Use pop_message_unwind. - - * xdisp.c (pop_message_unwind): Renamed from push_message_unwind. - -2002-09-10 Stefan Monnier <monnier@cs.yale.edu> - - * regex.c (DISCARD_FAILURE_REG_OR_COUNT): Delete. - (CHECK_INFINITE_LOOP): Don't pop anything: just set `cycle' to 1. - (re_match_2_internal): Be more careful with infinite loops. - -2002-09-10 Kim F. Storm <storm@cua.dk> - - * macros.c (end_kbd_macro): New function. - (Fend_kbd_macro): Use it. - - * macros.h (end_kbd_macro): Declare extern. - - * keyboard.c (Fdiscard_input): If defining keyboard macro, - end and save it instead of discarding it. - -2002-09-09 Markus Rost <rost@math.ohio-state.edu> - - * s/sol2-6.h: Fix typo. Add comment. - -2002-09-09 Richard M. Stallman <rms@gnu.org> - - * regex.c (regnum_t): Use signed int, not unsigned int. - - * s/sol2-6.h: New file. - - * s/sol2-5.h (UNEXEC): Definition deleted. - -2002-09-08 Kim F. Storm <storm@cua.dk> - - * macros.c (executing_macro_index): Change type to EMACS_INT. - (syms_of_macros): DEFVAR_INT it (needed by kmacro). - - * macros.h (executing_macro_index): Change type to EMACS_INT. - -2002-09-06 Richard M. Stallman <rms@gnu.org> - - * casetab.c (set_case_table): Make canon table point to eqv table. - -2002-09-06 Juanma Barranquero <lektu@terra.es> - - * coding.c (syms_of_coding): Fix spacing. - - * composite.c (Fcompose_region_internal) - (Fcompose_string_internal): Likewise. - - * data.c (Flsh): Likewise. - - * fontset.c (Fset_fontset_font): Likewise. - - * macfns.c (Fx_server_max_request_size): Likewise. - - * w16select.c (syms_of_win16select): Likewise. - - * w32select.c (syms_of_w32select): Likewise. - - * xselect.c (syms_of_xselect): Likewise. - -2002-09-05 Richard M. Stallman <rms@gnu.org> - - * regex.c (set_image_of_range_1): In no-TRANSLATE case, - call EXTEND_RANGE_TABLE and return a proper value. - (set_image_of_range): Don't call set_image_of_range_1 - if no TRANSLATE or if range includes all of Latin-1. - Only call it for the Latin-1 part of the range. - For other cases, make two separate ranges, - one for the original specified characters and one for - their case-conversions. - -2002-09-04 Richard M. Stallman <rms@gnu.org> - - * s/sol2-5.h (UNEXEC): Use unexsol.o. - - * window.c (displayed_window_lines): Correct for one-off bug - in HEIGHT on non-window displays. - - * regex.c (set_image_of_range_1): New function. - (set_image_of_range): Use set_image_of_range_1 for Latin-1. - Return a value to indicate running out of memory. - (SET_RANGE_TABLE_WORK_AREA): Check value from set_image_of_range. - (extend_range_table_work_area): New subroutine. - (EXTEND_RANGE_TABLE): Replaces EXTEND_RANGE_TABLE_WORK_AREA. - Different calling conventions, and used from set_image_of_range{,_1}. - (IMMEDIATE_QUIT_CHECK): Definitions moved. - -2002-09-04 Juanma Barranquero <lektu@terra.es> - - * makefile.w32-in: All dependencies updated. - -2002-09-01 Richard M. Stallman <rms@gnu.org> - - * unexsol.c: New file. - - * xfns.c (Qbox): Declare external, don't define. - - * xdisp.c (redisplay_window) <force-start case>: - If point is on semi-visible last line, reposition - it at previous line. - - * alloc.c (display_malloc_warning): Use display-warning. - (malloc_warning_1): Function deleted. - - * alloc.c [ALLOC_DEBUG]: #undef INLINE. - - * lread.c (read1): Handle #! by skipping the line. - -2002-08-31 Richard M. Stallman <rms@gnu.org> - - * Makefile.in (TEMACS_LDFLAGS): Renamed from ALL_LDFLAGS. - Don't include LDFLAGS. - (temacs): Pass LDFLAGS separately, and not via YMF_PASS_LDFLAGS. - -2002-08-31 Eli Zaretskii <eliz@is.elta.co.il> - - * xdisp.c (get_window_cursor_type): Don't use x_highlight_frame - member of x_display_info unless we compile for some window system. - -2002-08-31 Kim F. Storm <storm@cua.dk> - - * xdisp.c (Valternate_cursor_type, Qalternate_cursor_type): Removed. - (get_window_cursor_type): Don't use them. - (syms_of_xdisp): Remove intern, staticpro, and defvar for them. - -2002-08-30 Kenichi Handa <handa@etl.go.jp> - - * xdisp.c (get_next_display_element): Fix previous change. - -2002-08-30 Andrew Choi <akochoi@shaw.ca> - - * macterm.c (expose_overlaps): New function (merge code from xterm.c). - (expose_window): Use it to fix the display of overlapping - rows (merge code from xterm.c). - - * macfns.c (Qbox): Add extern declaration. - -2002-08-30 Juanma Barranquero <lektu@terra.es> - - * w32fns.c (Qbox): Make extern. - (syms_of_w32fns): Remove initialization of Qbox. - -2002-08-30 Rune Kleveland <runekl@viewpoint.no> (tiny change) - - * xfns.c (Fx_open_connection): Fix error message. - -2002-08-30 Kim F. Storm <storm@cua.dk> - - The following changes consolidates the handling of the cursor - type in xdisp.c, moving duplicate code and functionality from - xfns.c, xterm.c, w32fns.c, w32term.c, macfns.c, and macterm.c. - - * frame.h (enum text_cursor_kinds): Consolidated here. - Added DEFAULT_CURSOR value. - (struct frame) <desired_cursor, cursor_width> - <blink_off_cursor, blink_off_cursor_width>: New fields. - Consolidated from output_x, output_w32 and output_mac structs. - (FRAME_DESIRED_CURSOR, FRAME_CURSOR_WIDTH, FRAME_BLINK_OFF_CURSOR) - (FRAME_BLINK_OFF_CURSOR_WIDTH): Macros consolidated here. - - * xdisp.c (Qbar, Qhbar, Qbox, Qhollow, Vblink_cursor_alist): - Variables consolidated here. - (Valternate_cursor_type, Qalternate_cursor_type): New variables. - (Vcursor_in_non_selected_windows): Renamed from - cursor_in_non_selected_windows and changed to Lisp_Object. - (syms_of_xdisp): Define and staticpro new and moved variables. - (get_specified_cursor_type): Renamed from x_specified_cursor_type; - consolidated here. Recognize Qhollow setting. - (set_frame_cursor_types): New function to set frame cursor types - based on the frame parameters. - (get_window_cursor_type): New function to calculate new cursor - type and width for the specified window. Based on duplicated - code consolidated here. - Enhancements: cursor-in-non-selected-windows may be a cursor type, - check buffer-local alternate-cursor-type and blink-cursor-alist - before using built-in blink off methods. - - * dispextern.h (cursor_in_non_selected_windows): Extern removed. - - * lisp.h (Qcursor_in_non_selected_windows): Extern removed. - (get_specified_cursor_type, get_window_cursor_type) - (set_frame_cursor_types): Added prototypes. - - * macfns.c (x_specified_cursor_type): Removed. - (x_set_cursor_type): Use set_frame_cursor_types. - (Qbar, Qbox): Removed. - (syms_of_macfns): Don't intern or staticpro them. - - * macterm.c (x_specified_cursor_type): Remove prototype. - (x_draw_bar_cursor): Use FRAME_CURSOR_WIDTH. - (x_display_and_set_cursor): Use get_window_cursor_type. - Remove unused local variables cursor_non_selected, active_cursor. - Redraw cursor if hbar cursor width changes. - (make_mac_frame): Set FRAME_DESIRED_CURSOR. - - * macterm.h (enum text_cursor_kinds): Removed. - (struct output_mac) <current_cursor, desired_cursor, cursor_width> - <blink_off_cursor, blink_off_cursor_width>: Members removed. - (FRAME_DESIRED_CURSOR): Macro removed. - - * w32fns.c (Vblink_cursor_alist): Removed. - (Qbar, Qhbar, Qbox, Qhollow): Removed. - (syms_of_w32fns): Don't intern, staticpro, or define them. - (x_specified_cursor_type): Removed. - (x_set_cursor_type): Use set_frame_cursor_types. - - * w32term.c (x_specified_cursor_type): Remove prototype. - (x_draw_bar_cursor): Use FRAME_CURSOR_WIDTH. - (x_display_and_set_cursor): Use get_window_cursor_type. - Remove unused local variables cursor_off_state. - Redraw cursor if hbar cursor width changes. - Changed all occurrences of w32_highlight_frame to x_highlight_frame. - - * w32term.h (enum text_cursor_kinds): Removed. - (struct output_w32) <current_cursor, desired_cursor, cursor_width> - <blink_off_cursor, blink_off_cursor_width>: Members removed. - (FRAME_DESIRED_CURSOR, FRAME_CURSOR_WIDTH, FRAME_BLINK_OFF_CURSOR) - (FRAME_BLINK_OFF_CURSOR_WIDTH): Macros removed. - (struct w32_display_info) <x_highlight_frame>: Renamed member from - w32_highlight_frame. - - * xfns.c (Vblink_cursor_alist): Removed. - (Qbar, Qhbar, Qbox, Qhollow): Removed. - (syms_of_xfns): Don't intern, staticpro, or define them. - (x_specified_cursor_type): Removed. - (x_set_cursor_type): Use set_frame_cursor_types. - - * xterm.c (x_specified_cursor_type): Remove prototype. - (x_draw_bar_cursor): Use FRAME_CURSOR_WIDTH. - (x_display_and_set_cursor): Use get_window_cursor_type. - Remove unused local variables cursor_off_state. - Redraw cursor if hbar cursor width changes. - - * xterm.h (enum text_cursor_kinds): Removed. - (struct output_x) <current_cursor, desired_cursor, cursor_width> - <blink_off_cursor, blink_off_cursor_width>: Members removed. - (FRAME_DESIRED_CURSOR, FRAME_CURSOR_WIDTH, FRAME_BLINK_OFF_CURSOR) - (FRAME_BLINK_OFF_CURSOR_WIDTH): Macros removed. - (x_specified_cursor_type): Remove prototype. - -2002-08-28 Richard M. Stallman <rms@gnu.org> - - * w32fns.c (x_set_cursor_type): Set FRAME_BLINK_OFF_CURSOR and - FRAME_BLINK_OFF_CURSOR_WIDTH using defaults and Vblink_cursor_alist. - (Vblink_cursor_alist): New variable. - (syms_of_w32fns): Initialize and defvar it. - (x_specified_cursor_type): Recognize Qbox for filled box. - Exceptions are hollow boxes. - (Qbox, Qhollow): New variables. - (syms_of_w32fns): Initialize and staticpro them. - - * w32term.h (FRAME_BLINK_OFF_CURSOR, FRAME_BLINK_OFF_CURSOR_WIDTH): - New macros. - (struct w32_output): New fields blink_off_cursor, - blink_off_cursor_width. - (FRAME_CURSOR_WIDTH): New macro. - - * w32term.c (x_display_and_set_cursor): Use FRAME_BLINK_OFF_CURSOR - and FRAME_BLINK_OFF_CURSOR_WIDTH for blinking cursor off. - - * w32term.c (x_display_and_set_cursor): Check FRAME_CURSOR_WIDTH - for bar cursor. - - * w32term.c (expose_overlaps): New function. - (expose_window): Use it to fix the display of overlapping rows. - -2002-08-28 Simon Josefsson <jas@extundo.com> - - * xfns.c (Fx_open_connection): Improve help when X connection - fails, xhost is insecure and xauth is better. - -2002-08-28 Juanma Barranquero <lektu@terra.es> - - * makefile.w32-in: Add missing dependencies on w32term.h and - composite.h. - - * emacs.c (USAGE1): Add missing newline. - -2002-08-27 Andrew Choi <akochoi@shaw.ca> - - * s/darwin.h [HAVE_LIBNCURSES]: Define HAVE_TERMINFO. - -2002-08-27 Richard M. Stallman <rms@gnu.org> - - * xfns.c (x_set_cursor_type): Set FRAME_BLINK_OFF_CURSOR and - FRAME_BLINK_OFF_CURSOR_WIDTH using defaults and Vblink_cursor_alist. - (Vblink_cursor_alist): New variable. - (syms_of_xfns): Initialize and defvar it. - (x_specified_cursor_type): Recognize Qbox for filled box. - Exceptions are hollow boxes. - (Qbox, Qhollow): New variables. - (syms_of_xfns): Initialize and staticpro them. - - * xterm.h (FRAME_BLINK_OFF_CURSOR, FRAME_BLINK_OFF_CURSOR_WIDTH): - New macros. - (struct x_output): New fields blink_off_cursor, blink_off_cursor_width. - - * xterm.c (x_display_and_set_cursor): Use FRAME_BLINK_OFF_CURSOR - and FRAME_BLINK_OFF_CURSOR_WIDTH for blinking cursor off. - - * emacs.c (main): Handle --script. - (USAGE1): Mention --script. - (standard_args): Define sort order for --script. - -2002-08-27 Gerd Moellmann <gerd.moellmann@t-online.de> - - * xdisp.c (redisplay_updating_p): Variable removed. - (inhibit_free_realized_faces, Qinhibit_free_realized_faces): - New variables. - (init_iterator): Don't free realized faces if - inhibit_free_realized_faces is set. - (redisplay_internal): Bind Qinhibit_free_realized_faces to nil. - (syms_of_xdisp): DEFVAR_BOOL inhibit-free-realized-faces, - initialize Qinhibit_free_realized_faces. - - * dispextern.h (PRODUCE_GLYPHS): Set inhibit_free_realized_faces - when iterator is adding glyphs to a glyph matrix. - -2002-08-27 Kenichi Handa <handa@etl.go.jp> - - * xdisp.c (get_next_display_element): In unibyte case, don't use - octal form for such eight-bit characters that can be converted to - multibyte char. - -2002-08-26 Kim F. Storm <storm@cua.dk> - - * frame.c (make_terminal_frame) [CANNOT_DUMP]: Initialize - foreground and background colors. From Joe Buehler. - -2002-08-26 Miles Bader <miles@gnu.org> - - * bytecode.c (Fbyte_code): Fsub1 can GC, so protect it. - -2002-08-25 Andrew Choi <akochoi@shaw.ca> - - * emacs.c (main): Call init_mac_osx_environment if HAVE_CARBON is - defined instead of MAC_OSX. - - * s/darwin.h (select): Define select to sys_select only if - HAVE_CARBON is defined. - (HAVE_WORKING_VFORK): #undef it. Define vfork to fork. - (DONT_REOPEN_PTY): #def it. - - * macterm.c (XTread_socket): Remove code to call - SendEventToEventTarget for keys with command modifiers when - mac_command_key_is_meta is nil. - -2002-08-24 Andreas Schwab <schwab@suse.de> - - * eval.c (Fdefvar): Fix last change. - -2002-08-23 Richard M. Stallman <rms@gnu.org> - - * eval.c (Fdefvar, Fdefconst, Fdefvaralias): - Record variables in load history as (defvar . VAR). - (Fdefvar): Don't record in load history if no initial value. - (Qdefvar): New variable. - (syms_of_eval): Init and staticpro it. - - * lread.c (syms_of_lread): Doc fix. - (build_load_history): Use Fmember to see if a definition - is already in the Vload_history element. - - * process.c (Fstart_process): Remove /: from program name. - - * emacs.c (decode_env_path): Don't add /: if file name handler - has a `safe-magic' property. - - * callproc.c (Fcall_process): Remove /: from program name. - -2002-08-23 Stefan Monnier <monnier@cs.yale.edu> - - * regex.c (PATFETCH): Remove the translating fetch. - (PATFETCH_RAW): Rename to PATFETCH. - (set_image_of_range): New fun. - (SET_RANGE_TABLE_WORK_AREA): Use it. - (regex_compile): Don't translate the pattern chars so eagerly. - Only do it when inserting an `exactn' bytecode or when handling - a char-range. - (mutually_exclusive_p): Avoid empty statement. - -2002-08-22 Kim F. Storm <storm@cua.dk> - - * xdisp.c (redisplay_window): Do not `goto try_to_scroll' when we - end up on a partially visible line; this reverts a specific part - of the 2002-07-07 change by Richard M. Stallman to "fix" a nasty - display error which has been reported several times now. - However it introduces the problem that changes was supposed to fix. - See my comments in the source if you want to debug this further. - -2002-08-20 Kenichi Handa <handa@etl.go.jp> - - * abbrev.c (Fexpand_abbrev): Fix for the multibyte case. - -2002-08-19 Eli Zaretskii <eliz@is.elta.co.il> - - * msdos.c (croak): Add `void' to definition. - - * sysdep.c (request_sigio, unrequest_sigio) [MSDOS]: - Don't define them, they are defined in msdos.c. - - * mem-limits.h [MSDOS]: Declare etext. - - * fileio.c (Ffile_name_directory) [DOS_NT]: Don't declare `beg' - `const' since CORRECT_DIR_SEPS modifies its target. - -2002-08-19 Kim F. Storm <storm@cua.dk> - - * keyboard.c (Fclear_this_command_keys): Add optional arg - KEEP-RECORD to avoid clearing lossage when we just want to clear - the current key sequence (kmacro needs this). - -2002-08-19 Kenichi Handa <handa@localhost> - - * composite.c (run_composition_function): Call FUNC if it is fboundp. - - * composite.h (COMPOSITION_MODIFICATION_FUNC): If PROP is not a - cons, return Qnil. - -2002-08-17 Richard M. Stallman <rms@gnu.org> - - * s/sol2-5.h (BROKEN_SIGIO): Add #undef. - - * sysdep.c [!VMS]: Include sys/files.h. - - * editfns.c (save_restriction_restore): Defend from unchained marker. - - * buffer.c (overlays_at): Handle extending vec uniformly. - (overlays_in): Handle extending vec from length 0 as in overlays_at. - -2002-08-15 Andrew Choi <akochoi@shaw.ca> - - * mac.c (init_mac_osx_environment): New function. - - * emacs.c (main) [MAC_OSX]: Call init_mac_osx_environment. - -2002-08-14 Kim F. Storm <storm@cua.dk> - - * macros.c (Fstart_kbd_macro): Added NO-EXEC argument to inhibit - executing macro before appending to it (when used from Lisp). - (Fexecute_kbd_macro): Added LOOPFUNC argument to supply function - which is called prior to each iteration of macro (for kmacro.el). - (Fend_kbd_macro, Fcall_last_kbd_macro): Likewise. - - * lisp.h (Fexecute_kbd_macro): Update prototype. - - * keyboard.c (Fcommand_execute): Update call to Fexecute_kbd_macro. - -2002-08-14 Kenichi Handa <handa@etl.go.jp> - - * xselect.c (QUTF8_STRING): New variable. - (symbol_to_x_atom): Pay attention to QUTF8_STRING. - (x_atom_to_symbol): Likewise. - (x_get_local_selection): New argument local_request. If it is - nonzero, call handler_fn with the second arg nil. - (x_handle_selection_request): Call x_get_local_selection with - local_request 0. - (lisp_data_to_selection_data): Don't encode the string here. - (Fx_get_selection_internal): Call x_get_local_selection with - local_request 1. - (syms_of_xselect): Intern and staticpro QUTF8_STRING. - - * xterm.c (x_term_init): Initialize dpyinfo->Xatom_UTF8_STRING. - - * xterm.h (struct x_display_info): New member Xatom_UTF8_STRING. - -2002-08-13 Richard M. Stallman <rms@gnu.org> - - * minibuf.c (Fminibufferp): New function. - (syms_of_minibuf): Defsubr it. - (Fminibuffer_prompt_end): Handle non-minibuffers specially. - -2002-08-13 Gerd Moellmann <gerd.moellmann@t-online.de> - - * coding.c (Funencodable_char_position): Lisp_Object/int mixup. - -2002-08-12 Richard M. Stallman <rms@gnu.org> - - * syswait.h: Only the include of sys/wait.h tests HAVE_SYS_WAIT_H. - [!VMS] (WCOREDUMP, WEXITSTATUS, WIFEXITED, WIFSTOPPED, WIFSIGNALED) - (WSTOPSIG, WTERMSIG): Define each one independently if not defined - already. - - * buffer.c (syms_of_buffer) <fill-column>: Doc fix. - -2002-08-11 Andrew Choi <akochoi@shaw.ca> - - * macterm.c (XTmouse_position): Check wp with is_emacs_window. - (Vmac_pass_command_to_system): New variable. - (Vmac_pass_control_to_system): New variable. - (do_mouse_moved): Check wp with is_emacs_window. - (XTread_socket): Check window_ptr with is_emacs_window. - Call FrontNonFloatingWindow instead of FrontWindow. Send keydown - events back to Mac Toolbox for processing, depending on values of - Vmac_pass_command_to_system and Vmac_pass_control_to_system. - (syms_of_macterm): DEFVAR_LISP Vmac_pass_command_to_system and - Vmac_pass_control_to_system. - -2002-08-10 Kenichi Handa <handa@etl.go.jp> - - * coding.c (unencodable_char_position): New function. - (Funencodable_char_position): New function. - (syms_of_coding): Defsubr Funencodable_char_position. - -2002-08-10 Andrew Choi <akochoi@shaw.ca> - - * mac.c (sys_select) [MAC_OSX]: New function. - - * macterm.c (MakeMeTheFrontProcess): New function. - (mac_initialize): Call MakeMeTheFrontProcess. - - * s/darwin.h: Define select to sys_select. - -2002-08-09 Richard M. Stallman <rms@gnu.org> - - * keyboard.c (make_lispy_event): Test WINDOWSNT, not WINDOWS_NT. - -2002-08-09 Gerd Moellmann <gerd.moellmann@t-online.de> - - * xdisp.c (forward_to_next_line_start): Return 0 when reaching the - end of the buffer. - -2002-08-08 Ken Raeburn <raeburn@gnu.org> - - * coding.c (Ffind_operation_coding_system): Fix Lisp_Object/int mixup. - - * puresize.h (BASE_PURESIZE): Increase to 910000. - -2002-08-08 Kenichi Handa <handa@etl.go.jp> - - * coding.c (Ffind_operation_coding_system): For write-region, if - VISIT is a filename, make it the target. - -2002-08-07 Richard M. Stallman <rms@gnu.org> - - * alloc.c (mark_object): Detect long lists for debugging. - (mark_object_loop_halt): New variable. - - * s/hpux10.h (C_SWITCH_SYSTEM): #undef it. - - * data.c (Fmake_variable_frame_local): Doc fix. - -2002-08-01 David Ponce <david@dponce.com> - - * w32menu.c (local_heap, local_alloc, local_free): New macros. - (malloc_widget_value, free_widget_value) - (w32_free_submenu_strings): Use them. - - (push_submenu_start, push_submenu_end, push_left_right_boundary) - (push_menu_pane, push_menu_item, single_keymap_panes) - (single_menu_item, Fx_popup_menu, menubar_selection_callback) - (single_submenu, set_frame_menubar) - (w32_menu_show, w32_dialog_show): Use AREF, ASET, ASIZE. - - (Fx_popup_menu): Don't show pop up menu until preceding one is - actually cleaned up. Moved UNGCPRO outside #ifdef HAVE_MENUS block. - - * w32menu.c: Changes adapted from xmenu.c - (set_frame_menubar): First parse all submenus, - then make widget_value trees from them. - Don't allocate any widget_value objects - until we are done with the parsing. - (parse_single_submenu): New function. - (digest_single_submenu): New function. - (single_submenu): Function deleted, replaced by those two. - -2002-08-04 Andrew Choi <akochoi@shaw.ca> - - * macterm.c (XTread_socket): Check that FrontNonFloatingWindow - returns a valid window pointer before proceeding for keyDown and - autoKey events. - -2002-08-03 Andrew Choi <akochoi@shaw.ca> - - * macterm.c (USE_CARBON_EVENTS): New macro. - (macCtrlKey, macShiftKey, macMetaKey, macAltKey): New macros. - (x_iconify_frame): Call CollapseWindow. - (Vmac_reverse_ctrl_meta): New variable. - (Vmac_wheel_button_is_mouse_2): New variable. - (init_mac_drag_n_drop): New function. - (mac_do_receive_drag): New function. - (mac_handle_service_event): New function. - (init_service_handler): New function. - (mac_to_emacs_modifiers): New function. - (mac_event_to_emacs_modifiers): New function. - (mac_get_mouse_btn): New function. - (mac_convert_event_ref): New function. - (XTread_socket) [USE_CARBON_EVENTS]: Call ReceiveNextEvent, - SendEventToEventTarget, mac_event_to_emacs_modifiers, and - mac_get_mouse_btn. - (mac_initialize): Call init_mac_drag_n_drop and init_service_handler. - - * keyboard.c: Define Qmouse_wheel, mouse_wheel_syms, and - lispy_mouse_wheel_names for MAC_OSX as well as for WINDOWS_NT. - (kbd_buffer_get_event): Set used_mouse_menu for MENU_BAR_EVENT and - TOOL_BAR_EVENT for MAC_OS as well. - (make_lispy_event): Handle MOUSE_WHEEL_EVENT for MAC_OSX as well - as for WINDOWS_NT. - (syms_of_keyboard): Initialize Qmouse_wheel for MAC_OSX. - - * termhooks.h (event_kind): Define MOUSE_WHEEL_EVENT also for MAC_OSX. - -2002-08-03 Gerd Moellmann <gerd.moellmann@t-online.de> - - * xdisp.c (forward_to_next_line_start): Fix a condition that - lead to a newline being skipped. - -2002-08-02 Andrew Choi <akochoi@shaw.ca> - - * mac.c (syms_of_mac): Defsubr Sx_selection_exists_p. - -2002-08-01 Richard M. Stallman <rms@gnu.org> - - * Makefile.in (SOME_MACHINE_OBJECTS): Add fontset.o. - -2002-07-31 Andrew Choi <akochoi@shaw.ca> - - * macfns.c: #undef init_process before #define-ing it. - - * s/darwin.h: Define MAC_OS, SYMS_SYSTEM, and OTHER_FILES only if - HAVE_CARBON is defined. - -2002-07-31 Richard M. Stallman <rms@gnu.org> - - * xmenu.c (set_frame_menubar): First parse all submenus, - then make widget_value trees from them. - Don't allocate any widget_value objects - until we are done with the parsing. - (parse_single_submenu): New function. - (digest_single_submenu): New function. - (single_submenu): Function deleted, replaced by those two. - -2002-07-30 Juanma Barranquero <lektu@terra.es> - - * w32proc.c (syms_of_ntproc): Fix docstring of - `w32-get-true-file-attributes'. - -2002-07-28 Richard M. Stallman <rms@gnu.org> - - * s/hpux8.h (HPUX8): Define this before including hpux.h. - (HAVE_SYS_WAIT_H): #define deleted; we let Autoconf decide. - - * s/hpux.h (HAVE_SYS_WAIT_H): The #undef is conditional on HPUX8. - - * keyboard.c (make_lispy_event): - Use #ifdef to test USE_TOOLKIT_SCROLL_BARS. - Explicitly clear up_modifier in event->modifiers. - -2002-07-27 Richard M. Stallman <rms@gnu.org> - - * xterm.h (FRAME_CURSOR_WIDTH): New macro. - - * xterm.c (x_display_and_set_cursor): Check FRAME_CURSOR_WIDTH - for bar cursor. - -2002-07-26 Kenichi Handa <handa@etl.go.jp> - - * coding.c (detect_coding_iso2022): While checking a byte sequence - for CODING_CATEGORY_MASK_ISO_8_2, if we read one extra byte, check - it in the normal loop. - -2002-07-24 Gerd Moellmann <gerd.moellmann@t-online.de> - - * xterm.c (expose_overlaps): New function. - (expose_window): Use it to fix the display of overlapping rows. - - * xdisp.c (unwind_redisplay): Clear redisplay_updating_p. - -2002-07-23 Ken Raeburn <raeburn@gnu.org> - - * lisp.h (XPNTR): Use NO_UNION_TYPE version for union as well, - since it only depends on XUINT. - - * m/alpha.h (BITS_PER_LONG, BITS_PER_EMACS_INT, EMACS_INT, - EMACS_UINT, SPECIAL_EMACS_INT, DATA_SEG_BITS, - PNTR_COMPARISON_TYPE, VALBITS, MARKBIT, XINT, XUINT, XPNTR): - Macros deleted. - - * mem-limits.h (start_of_data): If DATA_START is defined, prefer - its value over other approaches. - * sysdep.c (start_of_data): Don't define the function if a macro - form has been defined. - -2002-07-23 Gerd Moellmann <gerd.moellmann@t-online.de> - - * xdisp.c (redisplay_updating_p): New variable. - (init_iterator): Don't free realized faces when - redisplay_updating_p is set. - (redisplay_internal): Set redisplay_updating_p while updating - the display. - -2002-07-23 Richard M. Stallman <rms@gnu.org> - - * editfns.c (Fmessage): Treat "" like nil. - -2002-07-23 Kenichi Handa <handa@etl.go.jp> - - * xdisp.c (face_before_or_after_it_pos): - Call FETCH_MULTIBYTE_CHAR with byte postion, not char position. - -2002-07-22 Juanma Barranquero <lektu@terra.es> - - * callproc.c (init_callproc) [DOS_NT]: - Initialize Vshared_game_score_directory to nil. - (syms_of_callproc) [DOS_NT]: Likewise. - -2002-07-22 Gerd Moellmann <gerd.moellmann@t-online.de> - - * xdisp.c (display_line): Replace an abort with xassert. - -2002-07-21 Richard M. Stallman <rms@gnu.org> - - * xdisp.c (redisplay_window): Don't test BEG_UNCHANGED - and END_UNCHANGED when setting buffer_unchanged_p. - Use current_matrix_up_to_date_p to decide whether to use - try_cursor_movement. - - * config.in (HAVE_SHARED_GAME_DIR): Undef deleted. - - * epaths.in (PATH_GAME): New macro, edited by ../Makefile.in. - - * callproc.c (init_callproc): Set up Vshared_game_score_directory. - Set to nil if dir does not exist. - (syms_of_callproc): Init unconditionally and simply. - - * buffer.c (Fbuffer_list): Doc fix. - -2002-07-21 Ken Raeburn <raeburn@gnu.org> - - * sysdep.c (end_of_text, end_of_data): Unused functions deleted. - - * buffer.c (mmap_realloc): When shrinking, make sure number of - pages to unmap is rounded towards zero. - - * m/mips-siemens.h (XSETUINT, XSETPNTR): Unused macros deleted. - (XSETINT): Deleted. - - * m/att3b.h (XINT): Don't define. - (VALBITS, VALMASK, XTYPE): Deleted. - (DATA_SEG_BITS): Define. - * m/gec63.h (VALBITS, VALAMASK, XTYPE, XSETTYPE, XPNTR, XSET, - ARRAY_MARK_FLAG): Deleted. - (DATA_SEG_BITS): Define. - * m/pfa50.h (VALBITS, VALMASK, XTYPE): Deleted. - (DATA_SEG_BITS): Define. - -2002-07-20 Richard M. Stallman <rms@gnu.org> - - * print.c (print_error_message): New args CONTEXT and CALLER. - Calls changed. - - * lisp.h (print_error_message): Declare new args. - - * keyboard.c (cmd_error_internal): Pass Vsignaling_function - and CONTEXT to print_error_message, don't print them here. - For a Quit, don't use Vsignaling_function. - Call message_log_maybe_newline. - - * Makefile.in (xsmfns.o): Don't depend on lisp.h. - -2002-07-20 Kim F. Storm <storm@cua.dk> - - * xdisp.c (redisplay_window): Test MODIFF to set buffer_unchanged_p. - -2002-07-19 Ken Raeburn <raeburn@gnu.org> - - * bytecode.c (struct byte_stack): Pointers into byte string now - point to const. - * callproc.c (Fcall_process): Make NEW_ARGV array hold pointer to - const. - * charset.h (BCOPY_SHORT): Source pointer now points to const. - * coding.c (encode_eol, detect_coding, detect_eol): - (decode_coding, encode_coding, detect_coding_system): - Source strings now treated as const. - (decode_coding_string, encode_coding_string): Use STRING_COPYIN to - modify Lisp string contents. - * coding.h (decode_coding, encode_coding, detect_coding, - detect_eol): Declarations updated. - * composite.c (compose_chars_in_text): Treat Lisp string contents - as const. - * dispnew.c (safe_bcopy): Source pointer now points to const. - * lisp.h (STRING_COPYIN): New macro. - (detect_coding_system, safe_bcopy, temp_output_buffer_setup): - (internal_with_output_to_temp_buffer): Declarations updated. - * print.c (temp_output_buffer_setup): - (internal_with_output_to_temp_buffer): Buffer name argument is now - pointer to const. - * sound.c (struct sound_device): Function pointer field "write" - buffer argument now points to const. - (vox_write): Buffer argument points to const. - * syntax.c (Fstring_to_syntax, skip_chars): Treat Lisp string - contents as const. - * sysdep.c (emacs_write): Buffer pointer now const. - * term.c (encode_terminal_code): Buffer pointer now const. - * xfaces.c (may_use_scalable_font_p): Argument now points to const. - (x_face_list_fonts, x_update_menu_appearance): - (hash_string_case_insensitive): Treat Lisp string contents as const. - -2002-07-19 Juanma Barranquero <lektu@terra.es> - - * xdisp.c (syms_of_xdisp): Remove redundant deprecation info. - - * fileio.c (syms_of_fileio): Likewise. - (Ffile_name_as_directory): Fix argument name in docstring. - (file_name_as_directory): Use literal '/' instead of DIRECTORY_SEP. - -2002-07-18 Richard M. Stallman <rms@gnu.org> - - * data.c (Fdefalias): Doc fix. - -2002-07-17 Dave Love <fx@gnu.org> - - * intervals.h (text_property_stickiness): Use P_. - - * ccl.c: Remove `emacs' conditionals. - (ccl_backtrace_table): Fix size spec. - (ccl_driver): Fix type errors. - -2002-07-16 Ken Raeburn <raeburn@gnu.org> - - * alloc.c (xstrdup, make_string, make_unibyte_string) - (make_multibyte_string, build_string): String pointer args now - point to const. - * charset.c (find_charset_in_text, c_string_width): - (chars_in_text, multibyte_chars_in_text, parse_str_as_multibyte): - * fileio.c (report_file_error): - * insdel.c (copy_text, count_size_as_multibyte, insert_1): - (count_combining_before, count_combining_after, insert_1_both): - (insert, insert_and_inherit, insert_string): - (insert_before_markers, insert_before_markers_and_inherit): - * lread.c (intern, oblookup, hash_string): - * minibuf.c (temp_echo_area_glyphs): - * search.c (fast_c_string_match_ignore_case): - * sysdep.c (emacs_open, set_file_times): - * xfaces.c (xstricmp): - * xdisp.c (store_frame_title, string_char_and_length): - (message_dolog, message2, message2_nolog, set_message): Likewise. - (set_message_1): Cast message string argument to const pointer. - * editfns.c (general_insert_function): Insertion function now - takes pointer to const for input data. - * charset.h (find_charset_in_text, c_string_width): - (parse_str_as_multibyte): Declarations updated. - * dispextern.h (xstricmp): Declaration updated. - * lisp.h (chars_in_text, multibyte_chars_in_text, copy_text): - (count_size_as_multibyte, count_combining_before): - (count_combining_after, insert_1, insert_1_both, message_dolog): - (insert, insert_and_inherit, insert_before_markers) - (insert_before_markers_and_inherit, set_message, message2): - (message2_dolog, build_string, make_string, make_unibyte_string): - (make_multibyte_string, intern, oblookup, report_file_error): - (fast_c_string_match_ignore_case, temp_echo_area_glyphs): - (emacs_open, xstrdup): Declarations updated. - * systime.h (set_file_times): Declaration updated. - - * charset.c (find_charset_in_text, lisp_string_width): Use const - for pointer to lisp string data. - * charset.h (FETCH_STRING_CHAR_ADVANCE): - (FETCH_STRING_CHAR_ADVANCE_NO_CHECK): - * coding.c (Ffind_coding_systems_region_interval): - * fileio.c (Ffile_name_directory, Ffile_name_nondirectory): - (Fmake_directory_internal, Fdelete_directory): - (Ffile_name_absolute_p, Fwrite_region, double_dollars): - * fontset.c (font_family_registry, fs_query_fontset): - (list_fontsets): - * frame.c (Fframe_parameter): - * keyboard.c (cmd_error_internal): - * keymap.c (Fdescribe_buffer_bindings): - * lread.c (complete_filename_p, openp): - * minibuf.c (Fminibuffer_complete_word): - * xdisp.c (string_pos_nchars_ahead, init_from_display_pos): - (face_before_or_after_it_pos, next_element_from_string): - (get_overlay_arrow_glyph_row, display_mode_element): - (decode_mode_spec_coding): - * xterm.c (same_x_server): Likewise. - - * buffer.c (reset_buffer_local_variables): Delete "#if 0" - settings of non-existent fields. - - * editfns.c (Fstring_to_char): Don't use XSTRING/XSETSTRING to - copy a lisp value. - - * lread.c (Fintern_soft): Use string macros instead of - Lisp_String fields. - * keyboard.c (echo_char, parse_modifiers_uncached): - (parse_solitary_modifier, Fexecute_extended_command): Likewise. - * textprop.c (validate_interval_range, interval_of): Likewise. - - * fontset.c (Fset_fontset_font): Use SDATA instead of XSTRING()->data. - - * charset.h (FETCH_STRING_CHAR_ADVANCE) - (FETCH_STRING_CHAR_ADVANCE_NO_CHECK): Use SBYTES instead of - XSTRING()->size_byte. - - * lisp.h (SDATA, SREF): Produce rvalue. - (SSET): New macro. - * alloc.c (make_event_array): Use SSET for storing into a string. - * buffer.c (Fother_buffer): Use SREF when retrieving a byte from - a string. - * casefiddle.c (casify_object): Use SSET. - * charset.h (FETCH_STRING_CHAR_ADVANCE) - (FETCH_STRING_CHAR_ADVANCE_NO_CHECK): Use SDATA when getting - address of string contents. - * data.c (Faref): Use SDATA. - (Faset): Use SDATA, SSET. - * dired.c (directory_files_internal): Use SSET. - * fileio.c (Fmake_symbolic_link, Fexpand_file_name): Use SSET. - (Fread_file_name): Use SREF, SSET. - * fns.c (concat): Use SSET. - (concat, Fdelete): Use SDATA. - * insdel.c (insert_from_string_1): Use SDATA. - * keyboard.c (Fevent_convert_list): Use SREF. - * lread.c (Fload): Use SDATA, SSET. - * macfns.c (validate_x_resource_name): Use SSET. - * process.c (status_message): Use SSET. - * search.c (wordify): Use SDATA. - (Freplace_match): Use SREF. - * w32fns.c (validate_x_resource_name): Use SSET. - * xfns.c (validate_x_resource_name): Use SSET. - * xterm.c (x_catch_errors, x_clear_errors): Use SSET. - -2002-07-16 Richard M. Stallman <rms@gnu.org> - - * s/hpux11.h (USG_SUBTTY_WORKS): Defined. - - * xdisp.c (reconsider_clip_changes): - Don't test prevent_redisplay_optimizations_p. - (redisplay_internal): Test prevent_redisplay_optimizations_p - along with clip_changed in some cases. - (try_window_id): Likewise. - (redisplay_window): New local var buffer_unchanged_p. - - * keyboard.c (cmd_error) [HAVE_X_WINDOWS]: Maybe call cancel_houglass. - - * process.c (create_process): Test USG_SUBTTY_WORKS. - (process_send_signal): Clean up handling of GID. - Detect errors in ioctls meant to set GID. - - * window.c (temp_output_buffer_show): - Don't set prevent_redisplay_optimizations_p. - -2002-07-15 Juanma Barranquero <lektu@terra.es> - - * eval.c (Fdefvaralias): Add docstring argument. - -2002-07-15 Ken Raeburn <raeburn@gnu.org> - - * lisp.h (STRING_INTERVALS): Produce rvalue. - (STRING_SET_INTERVALS): New macro. - * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): Use it. - * fns.c (Fstring_as_multibyte): Likewise. - * intervals.c (balance_possible_root_interval, delete_interval) - (create_root_interval, copy_intervals_to_string): Likewise. - * textprop.c (set_text_properties): Likewise. Use NULL_INTERVAL - instead of 0. - -2002-07-14 Ken Raeburn <raeburn@gnu.org> - - * lisp.h (STRING_SET_CHARS): New macro. - (SCHARS, SBYTES): Produce rvalues. - * dired.c (directory_files_internal): Use STRING_SET_CHARS. - * fns.c (concat): Likewise. - * lread.c (read_vector): Likewise. - - * lisp.h (SMBP): Delete. All uses changed to STRING_MULTIBYTE. - (STRING_SET_UNIBYTE): New macro. - (SET_STRING_BYTES): Delete. Callers (all of which supplied a - length of -1) changed to use STRING_SET_UNIBYTE. - * abbrev.c, alloc.c, buffer.c, bytecode.c, callint.c, callproc.c, - casefiddle.c, category.c, ccl.c, charset.c, charset.h, coding.c, - composite.c, data.c, dired.c, dispnew.c, disptab.h, doc.c, - dosfns.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fn.c, - fontset.c, frame.c, indent.c, insdel.c, intervals.c, keyboard.c, - keymap.c, lread.c, mac.c, macfns.c, macmenu.c, macterm.c, - minibuf.c, msdos.c, print.c, process.c, search.c, sound.c, - sunfns.c, syntax.c, syntax.h, sysdep.c, textprop.c, undo.c, - w16select.c, w32.c, w32fns.c, w32menu.c, w32proc.c, w32select.c, - w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, - xselect.c, xsmfns.c, xterm.c: Most uses of XSTRING combined with - STRING_BYTES or indirection changed to SCHARS, SBYTES, - STRING_INTERVALS, SREF, SDATA; explicit size_byte references left - unchanged for now. - -2002-07-13 Kim F. Storm <storm@cua.dk> - - * keyboard.c (command_loop_1): Invert check on Vmemory_full. - -2002-07-12 Richard M. Stallman <rms@gnu.org> - - * fileio.c (Fwrite_region): Doc fix. - - * print.c (print_error_message): Don't handle Vsignaling_function here. - - * keyboard.c (cmd_error_internal): Handle Vsignaling_function here. - (command_loop_1): Avoid certain actions after memory-full error. - - * eval.c (Fsignal): Don't call cancel_hourglass. - For a memory-full error, don't call Vsignal_hook_function - and don't set Vsignaling_function. - - * process.c (process_send_signal): Add abort call. - -2002-07-11 Markus Rost <rost@math.ohio-state.edu> - - * keymap.c (Fkey_binding): Fix typo. - -2002-07-11 Richard M. Stallman <rms@gnu.org> - - * alloc.c (Vmemory_full): New variable. - (Vmemory_signal_data): Rename from memory_signal_data. - Uses changed. - (syms_of_alloc): Defvar them. - (memory_full, buffer_memory_full): Set Vmemory_full. - - * lisp.h (Vmemory_full): Add declaration. - (current_column, indented_beyond_p): Change declaration. - - * indent.c (last_known_column): Declare as double, not float. - (current_column, current_column_1, string_display_width) - (position_indentation): Return `double'. - (indented_beyond_p): Arg `column' is `double'. Callers changed. - - * xdisp.c (message_dolog): Do nothing if Vmemory_full is non-nil. - (back_to_previous_visible_line_start) - (reseat_at_next_visible_line_start, next_element_from_buffer): - Use `double', not `float', when calling indented_beyond_p. - - * s/hpux11.h (BROKEN_SA_RESTART): Define. - - * sysdep.c (sys_signal): Test BROKEN_SA_RESTART. - -2002-07-11 Juanma Barranquero <lektu@terra.es> - - * alloc.c, buffer.c, bytecode.c, callint.c, callproc.c, coding.c, - * composite.c, dired.c, dispnew.c, editfns.c, emacs.c, eval.c, - * fileio.c, fns.c, insdel.c, keyboard.c, keymap.c, lread.c, macfns.c, - * macmenu.c, macros.c, minibuf.c, print.c, process.c, sound.c, - * textprop.c, w32fns.c, w32menu.c, window.c, xfaces.c, xfns.c, - * xmenu.c, xselect.c, xterm.c: Use SPECPDL_INDEX wherever makes sense. - -2002-07-10 Juanma Barranquero <lektu@terra.es> - - * lisp.h (SPECPDL_INDEX): Rename from BINDING_STACK_SIZE. - All callers changed. - -2002-07-09 Stefan Monnier <monnier@cs.yale.edu> - - * data.c (Fdefalias): Add an optional `docstring' argument. - (set_internal, Fsetq_default): Use XCAR/XCDR. - - * composite.c (HASH_VALUE, HASH_KEY): - * ccl.c (HASH_VALUE): Remove (it's in lisp.h now). - -2002-07-09 Kenichi Handa <handa@etl.go.jp> - - * callproc.c (Fcall_process): Fix previous change. - -2002-07-07 Stefan Monnier <monnier@cs.yale.edu> - - * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion): - Add support for hash-tables. - (Ftry_completion): Return t even if the string appears multiple times. - - * fns.c (Fnconc): Use XCDR. - (Fprovide): Use CONSP and XCDR. - (HASH_KEY, HASH_VALUE, HASH_NEXT, HASH_HASH, HASH_INDEX) - (HASH_TABLE_SIZE): Delete: moved to lisp.h. - (Fmake_hash_table): Accept `:size nil'. - (Fmakehash): Delete: moved to subr.el. - (syms_of_fns): Don't defsubr makehash. - - * lisp.h (HASH_KEY, HASH_VALUE, HASH_NEXT, HASH_HASH, HASH_INDEX) - (HASH_TABLE_SIZE): Move from fns.c. - -2002-07-07 Richard M. Stallman <rms@gnu.org> - - * xdisp.c (make_cursor_line_fully_visible): Don't try short scrolls. - Instead just return 0 when there is something to be done. - (try_scrolling): If make_cursor_line_fully_visible returns 0, - retry scrolling as if cursor were off the bottom. - (try_cursor_movement): If make_cursor_line_fully_visible returns 0, - return CURSOR_MOVEMENT_MUST_SCROLL. - (redisplay_window): If make_cursor_line_fully_visible returns 0, - go to try_to_scroll. - - * buffer.c (Fbuffer_local_value): Store current value into its binding - so we get the up-to-date value for the binding that is loaded. - - * eval.c (Fdefmacro): Doc fix. - -2002-07-05 Dave Love <fx@gnu.org> - - * keyboard.c (read_key_sequence): Set initial_idleness_start_time - correctly. - - * ccl.c (Vtranslation_hash_table_vector, GET_HASH_TABLE) - (HASH_VALUE, CCL_LookupIntConstTbl, CCL_LookupCharConstTbl): New. - (ccl_driver): Add cases for CCL_LookupIntConstTbl, - CCL_LookupCharConstTbl. - (syms_of_ccl): Defvar translation-hash-table-vector. - -2002-07-05 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * xdisp.c: Remove unused variable `face'. - -2002-07-04 Juanma Barranquero <lektu@terra.es> - - * keyboard.c (post_command_idle_hook): Remove redundant (and inexact) - obsolescence information. - -2002-07-03 Andrew Choi <akochoi@shaw.ca> - - * macterm.c (x_list_fonts): Fix comment. Cache fonts matching - pattern. Search cache first. - (init_font_name_table): Also add entry for jisx0201.1976-0 coding - for Japanese font. - (XLoadQueryFont): Use it. - -2002-07-02 Richard M. Stallman <rms@gnu.org> - - * keymap.c (Fdefine_key): Doc fix. - - * xterm.c (x_term_init): Turn off polling around XtOpenDisplay. - -2002-07-02 Juanma Barranquero <lektu@terra.es> - - * keymap.c (syms_of_keymap): Fix typo. - -2002-07-01 Andrew Choi <akochoi@shaw.ca> - - * s/darwin.h: Define POSIX_SIGNALS. - - * macterm.c (do_ae_open_documents) [MAC_OSX]: Call FSpMakeFSRef - and FSRefMakePath to convert FSSpec returned with Apple Event to - Posix pathname. - (mac_initialize) [TARGET_API_MAC_CARBON]: - Call init_required_apple_events and disable the `Quit' menu item - provided automatically by the Carbon Toolbox. - -2002-07-01 Dave Love <fx@gnu.org> - - * keyboard.c (kbd_buffer_store_event): Fix interrupt_signal decl - for K&R. - - * xterm.c: Fix prototype for K&R. - - * term.c (costs_set): Declare static, non-initialized for pcc. - -2002-07-01 Richard M. Stallman <rms@gnu.org> - - * keyboard.c (timer_last_idleness_start_time): New variable. - (timer_start_idle): Set that. - (read_key_sequence): Use that to reset timer_idleness_start_time - to previous value. - - * window.c (Frecenter): With arg, set optional_new_start. - - * xdisp.c (redisplay_internal): Make optional_new_start really work. - - * minibuf.c (Fminibuffer_complete_and_exit): Move to end of - buffer for completion. - -2002-06-29 Ken Raeburn <raeburn@gnu.org> - - * xdisp.c (store_mode_line_string): Lisp_Object/int mixup. - -2002-06-28 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * keyboard.c (readable_filtered_events): New function that filters - FOCUS_IN_EVENT depending on parameter. - (readable_events): Calls readable_filtered_events, not filtering - FOCUS_IN_EVENT. - (get_filtered_input_pending): New function, filtering parameter passed - to readable_filtered_events. - (get_input_pending): Calls get_filtered_input_pending, not filtering - FOCUS_IN_EVENT. - (Finput_pending_p): Calls get_filtered_input_pending, DO filter - FOCUS_IN_EVENT. - - * xterm.h (struct x_output): Add focus_state. - - * xterm.c (x_focus_changed): New function. - (x_detect_focus_change): New function. - (XTread_socket): Call x_detect_focus_change for FocusIn/FocusOut - EnterNotify and LeaveNotify to track X focus changes. - -2002-06-28 Andreas Schwab <schwab@suse.de> - - * lisp.h: Remove duplicate declaration of code_convert_string_norecord. - -2002-06-27 Kim F. Storm <storm@cua.dk> - - * xdisp.c (mode_line_string_list, mode_line_string_face) - (mode_line_string_face_prop): New variables. - (store_mode_line_string): New function. - (display_mode_element): Use store_mode_line_string to - add mode-line string elements to mode_line_string_list - when mode_line_string_list is non-nil. - (Fformat_mode_line): Now returns propertized string by - default. New arg NO-PROPS to ignore properties. - (decode_mode_spec): Only add two dashes for %- in propertized - mode-line string. - (syms_of_xdisp): Init and staticpro mode_line_string_list. - -2002-06-27 Stefan Monnier <monnier@cs.yale.edu> - - * minibuf.c (minibuffer_completion_contents): Add return type. - -2002-06-27 Juanma Barranquero <lektu@terra.es> - - * charset.c (Fchar_bytes): Remove obsolescence info from docstring. - -2002-06-26 Juanma Barranquero <lektu@terra.es> - - * fileio.c (read_file_name_cleanup): Add missing return. - -2002-06-26 Richard M. Stallman <rms@gnu.org> - - * window.c (Frecenter): Don't set force_start flag. - - * minibuf.c (do_completion, Fminibuffer_complete_word) - (Fminibuffer_completion_help): Complete just the text before point. - (minibuffer_completion_contents): New function. - - * buffer.c (Fbury_buffer): Use frames_discard_buffer. - - * frame.c (frames_bury_buffer): Function deleted. - -2002-06-25 Miles Bader <miles@gnu.org> - - * callint.c (Fcall_interactively): When checking to see if doprnt hit - the end of callint_message, allow for a terminating '\0'. - -2002-06-24 Juanma Barranquero <lektu@terra.es> - - * w32select.c: Include composite.h. - - * w16select.c: Likewise. - -2002-06-24 Kenichi Handa <handa@etl.go.jp> - - * callproc.c (Fcall_process): If code detection is necessary, - call detect_coding directly here. - - * coding.c (detect_eol): Preserve coding->cmp_data. - - * w16select.c (Fw16_get_clipboard_data): - * w32fns.c (w32_to_x_font): - * w32select.c (Fw32_get_clipboard_data): - * xselect.c (selection_data_to_lisp_data): - * xterm.c (XTread_socket): Disable composition handling. - -2002-06-24 Stefan Monnier <monnier@cs.yale.edu> - - * print.c (temp_output_buffer_setup): Kill all local variables. - -2002-06-22 Stefan Monnier <monnier@cs.yale.edu> - - * lread.c (Fread): Remove redundant and imprecise declaration. - - * xfns.c (check_x_display_info): Use check_x_frame. - - * .gdbinit (xprintsym): Use the new `xname' field. - (xsymbol): Use it. - -2002-06-22 Jason Rumney <jasonr@gnu.org> - - * w32fns.c (file_dialog_callback): New function. - (Fx_file_dialog): Allow selecting directories as well as files. - -2002-06-21 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * m/pmax.h (START_FILES): Define START_FILES for NetBSD and - OpenBSD. Add support for mipseb-*-netbsd* machines. - -2002-06-17 Andrew Choi <akochoi@shaw.ca> - - * macterm.c (mac_scroll_area): Set foreground and backcolor to - black and white before scrolling. Restore frame background and - foreground color after scrolling. - (do_window_update): Call XClearWindow before calling expose_frame. - (make_mac_frame): Don't set FRAME_BACKGROUND_PIXEL and - FRAME_FOREGROUND_PIXEL of frame. - - * macterm.c (XTread_socket): If Vmac_command_key_is_meta is nil, - test Mac command key as <ALT> key. - -2002-06-17 Stefan Monnier <monnier@cs.yale.edu> - - * window.c (Fset_window_configuration): Lisp_Object/int mixup. - - * keyboard.c (read_key_sequence): Be more careful with first_unbound. - Lookup keys in function-key-map immediately so that key-translation-map - can be applied earlier. - Remove function_key_possible and key_translation_possible, replaced - by checking `keytran_start < t'. - - * .gdbinit (xsymbol): Use the new `xname' field. - -2002-06-17 Andrew Choi <akochoi@shaw.ca> - - * macterm.c (XTread_socket): If Vmac_command_key_is_meta is nil, - test Mac command key as <ALT> key. - - * mac.c (do_applescript): Call initialize_applescript if necessary - when first called. Dispose of result_desc only when there is no error. - (Fdo_applescript): Use %d format specifier instead of %ld. - -2002-06-16 Andrew Choi <akochoi@shaw.ca> - - * macterm.c (XTread_socket): Call FrontNonFloatingWindow instead - of FrontWindow for cases keyDown and autoKey. - - * fontset.c (syms_of_fontset) [MAC_OS]: Set ASCII font of - Vdefault_fontset to Monaco with mac-roman coding. - - * mac.c, macfns.c, macmenu.c, macterm.c: Undefine and redefine - init_process before and after inclusion of Carbon/Carbon.h, resp. - - * macterm.c (x_new_font): Set font for normal_gc, reverse_gc, and - cursor_gc. - (add_font_name_table_entry): New function. - (init_font_name_table): Use add_font_name_table_entry; add italic, - bold, and bold-italic entries for truetype fonts. - - * xfaces.c (init_frame_faces) [MAC_OS]: Call realize_basic_faces - for Mac too. - (try_font_list) [MAC_OS]: If no font matches given registry, try - fonts with any registry matching face_family. - (realize_x_face) [MAC_OS]: Remove old ad-hoc fix to load font here. - - * s/darwin.h: If autoconf detects the Ncurses library, define - LIBS_TERMCAP to -lncurses to use it. - -2002-06-16 Eli Zaretskii <eliz@is.elta.co.il> - - * strftime.c [__hpux]: Include sys/_mbstate_t.h. - -2002-06-15 Richard M. Stallman <rms@gnu.org> - - * window.c (Fset_window_configuration): Explicitly preserve - the point value that new_current_buffer had at the start. - -2002-06-14 Juanma Barranquero <lektu@terra.es> - - * composite.c (Fcompose_region_internal, Fcompose_string_internal): - Fix typos. - -2002-06-14 Kim F. Storm <storm@cua.dk> - - * insdel.c (insert_1_both, insert_from_string_1) - (insert_from_buffer_1): Recalculate END_UNCHANGED in case the - insert happened in the end_unchanged region. Otherwise, the - redisplay may be confused and duplicate the last line in the - buffer [seen after save-buffer when require-final-newline==t]. - -2002-06-13 Jason Rumney <jasonr@gnu.org> - - * w32.c (init_environment): Remove EMACSLOCKDIR. - (stat): Swap _S_IFDIR and _S_IFREG. - -2002-06-13 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * keyboard.c, macterm.c, macmenu.c, msdos.c, sysdep.c - * termhooks.h, xmenu.c, xsmfns.c, xterm.h, xterm.c, w32term.c, - * w32menu.c, w32inevt.c: Rename enum event_kind as follows: - ascii_keystroke to ASCII_KEYSTROKE_EVENT, multibyte_char_keystroke - to MULTIBYTE_CHAR_KEYSTROKE_EVENT, non_ascii_keystroke to - NON_ASCII_KEYSTROKE_EVENT, timer_event to TIMER_EVENT, mouse_click - to MOUSE_CLICK_EVENT, mouse_wheel to MOUSE_WHEEL_EVENT, - language_change_event to LANGUAGE_CHANGE_EVENT, scroll_bar_click - to SCROLL_BAR_CLICK_EVENT, w32_scroll_bar_click to - W32_SCROLL_BAR_CLICK_EVENT, selection_request_event to - SELECTION_REQUEST_EVENT, selection_clear_event to - SELECTION_CLEAR_EVENT, buffer_switch_event to BUFFER_SWITCH_EVENT, - delete_window_event to DELETE_WINDOW_EVENT, iconify_event to - ICONIFY_EVENT, deiconify_event to DEICONIFY_EVENT, - menu_bar_activate_event to MENU_BAR_ACTIVATE_EVENT, drag_n_drop to - DRAG_N_DROP_EVENT, save_session_event to SAVE_SESSION_EVENT and - no_event to NO_EVENT. - -2002-06-12 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * macmenu.c: Remove declaration of Qmouse_click and Qevent_kind. - -2002-06-12 Stefan Monnier <monnier@cs.yale.edu> - - * intervals.c (textget): Don't forget to `return'. - (lookup_char_property): Use XCAR/XCDR. - -2002-06-12 Juanma Barranquero <lektu@terra.es> - - * xdisp.c (Fformat_mode_line): Fix typo. - -2002-06-12 Kim F. Storm <storm@cua.dk> - - * xdisp.c (Fformat_mode_line): New function. - (frame_title_buf, frame_title_buf_end, frame_title_ptr) - (store_frame_title_char, store_frame_title): Use unconditionally. - (init_xdisp): Defsubr Fformat_mode_line. - Initialize frame_title_buf etc. unconditionally. - -2002-06-11 Stefan Monnier <monnier@cs.yale.edu> - - * keyboard.c (read_key_sequence): - Remove prev_(fkey|keytran}_(map|start|end) since we don't want to pass - things through those maps after downcasing events. - Enforce that keytran_end <= fkey_start, i.e. that key-translation-map - applies after function-key-map. - Make sure that keytran can be done in the middle in the sequence. - Be careful not to throw away events past the one we downcase. - - * lread.c (read_integer): Remove unused var `tem'. - (read1): Fix int/Lisp_Object mixup. - - * xfaces.c (tty_lookup_color): Type bool/Lisp_Object mismatch fixed. - -2002-06-11 Richard M. Stallman <rms@gnu.org> - - * keyboard.c (readable_events): Ignore any number of - FOCUS_IN_EVENT events and return 0 if nothing else in buffer. - -2002-06-09 Miles Bader <miles@gnu.org> - - * xfaces.c (Ftty_supports_face_attributes_p): New function. - (parse_rgb_list, tty_lookup_color): New functions. - (tty_defined_color): Use `tty_lookup_color' to do all the work. - (color_distance, Fcolor_distance): New functions. - (TTY_SAME_COLOR_THRESHOLD): New macro. - (Qtty_color_standard_values): New variable. - (syms_of_xfaces): Initialize new vars & functions. - -2002-06-08 Colin Walters <walters@verbum.org> - - * textprop.c (Vchar_property_alias_alist): New variable. - (syms_of_textprop) <Vchar_property_alias_alist>: DEFVAR_LISP. - - * intervals.c (lookup_char_property): New function for looking up - overlay and text properties, created from textget. - (textget): Use it. - - * intervals.h (lookup_char_property): Declare. - (Vchar_property_alias_alist): Declare. - - * buffer.c (Foverlay_get): Use lookup_char_property. - -2002-06-07 Sam Steingold <sds@gnu.org> - - * xselect.c (lisp_data_to_selection_data): Fix last change: - *data_ret is not a Lisp string, while unibyte_string is. - -2002-06-07 Eli Zaretskii <eliz@is.elta.co.il> - - * xselect.c (lisp_data_to_selection_data): Fix last change: - set size_ret. - -2002-06-07 Andreas Schwab <schwab@suse.de> - - * m/amdx86-64.h: New file. - -2002-06-05 Eli Zaretskii <eliz@is.elta.co.il> - - * fns.c (Fstring_make_unibyte): Doc fix. - - * xselect.c (lisp_data_to_selection_data): If the requested type - is STRING, call string_make_unibyte to encode the selected text - as a string. - - * window.c (Fset_window_hscroll): Doc fix. - -2002-06-05 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * fileio.c (choose_write_coding_system): - Call select-safe-coding-system properly. - -2002-06-03 Richard M. Stallman <rms@gnu.org> - - * xdisp.c (message_with_string): Error if STRING is not a string. - - * fns.c (md5): Pass FILE arg to Vselect_safe_coding_system_function. - - * fileio.c (choose_write_coding_system): Pass FILE arg to - Vselect_safe_coding_system_function. - -2002-06-03 Ken Raeburn <raeburn@gnu.org> - - * buffer.c (fix_overlays_before): Fix list-walking bug in 05-19 change. - -2002-06-02 Thien-Thi Nguyen <ttn@gnu.org> - - * bytecode.c (Fbyte_code): Cast `current_column' return value to int. - * cmds.c (Fdelete_backward_char, internal_self_insert): Likewise. - * keymap.c (describe_command): Likewise. - * minibuf.c (read_minibuf): Likewise. - - * xdisp.c (redisplay_internal, redisplay_window, decode_mode_spec): - Cast `current_column' return value to int. - (back_to_previous_visible_line_start) - (reseat_at_next_visible_line_start, next_element_from_buffer): - Cast `indented_beyond_p' 3rd arg to float. - - * indent.c (last_known_column): Now a float. - (current_column_1, position_indentation, current_column) - (string_display_width): Return float. - (Fcurrent_column): Cast `current_column' return value to int. - (Fcurrent_indentation): Cast `position_indentation' retval to int. - (indented_beyond_p): Third arg now a float. - (compute_motion, vmotion): Cast `indented_beyond_p' 3rd arg to float. - - * lisp.h (current_column): Now returns float. - (indented_beyond_p): 3rd arg now a float. - -2002-05-31 Eli Zaretskii <eliz@is.elta.co.il> - - * xfns.c (x_encode_text): Return stringp non-NULL if coding_system - is Qcompound_text_with_extensions. - - * xselect.c (lisp_data_to_selection_data): Always set selection - type as string if x_encode_text returns streingp non-NULL. - - * s/netbsd.h: Include /usr/pkg in the run time shared library path. - -2002-05-30 Richard M. Stallman <rms@gnu.org> - - * window.c (Fset_window_configuration): Correct the handling - of point in current buffer, to work with multiple windows. - -2002-05-29 Colin Walters <walters@verbum.org> - - * lread.c (Fread_from_string): Don't depend on order of evaluation - for C function parameters. - -2002-05-28 Richard M. Stallman <rms@gnu.org> - - * xterm.c (x_display_and_set_cursor): Change the cursor in the same - way for blinked-off state and for a nonselected window. - - * window.c (window_scroll_pixel_based): Don't call Fbolp; - instead, see if the new start pos is at beginning of line. - - * fileio.c (Fwrite_region): If START is a string, don't - make any annotations. - - * eval.c (syms_of_eval): Doc fix. - -2002-05-28 Colin Walters <walters@debian.org> - - * emacs.c (USAGE1): Add --no-splash. - (standard_args): Ditto. - -2002-05-28 Colin Walters <walters@gnu.org> - - * lread.c (readchar_count): New variable. - (readchar): Increment it. - (unreadchar): Decrement it. - (read_multibyte): Decrement it. - (Vread_with_symbol_positions): New variable. - (Vread_symbol_positions_list): New variable. - (read_internal_start): New function, created from Fread and - Fread_from_string. Handle Vread_symbol_positions_list and - Vread_with_symbol_positions. - (readevalloop, Fread, Fread_from_string): Use it. - (read1): Use readchar_count to add symbol positions to - Vread_symbol_positions_list if Vread_with_symbol_positions is non-nil. - (syms_of_lread): DEFVAR_LISP and initialize them. - - * lread.c (read0, read1, read_list, read_vector, read_multibyte) - (substitute_object_recurse, substitute_object_in_subtree) - (substitute_in_interval): Prototype. - (read_multibyte): Return c if it's less than zero. - -2002-05-28 Kim F. Storm <storm@cua.dk> - - * fileio.c (Fread_file_name_internal): Added brute-force - speed up for using predicate file-directory-p. - -2002-05-28 Kim F. Storm <storm@cua.dk> - - * fileio.c (Vread_file_name_function, Vread_file_name_predicate): - New variables. - (syms_of_fileio): DEFVAR_LISP them. - (read_file_name_cleanup): New unwind function. - (Fread_file_name_internal): Only return completions satifying - Vread_file_name_predicate. Temporarily unwind protect and rebind - default-directory while checking completions against the predicate. - (Fread_file_name): Added PREDICATE argument. Specbind it to - Vread_file_name_predicate during completion. - Call Vread_file_name_function to read the file name if non-nil. - - * lisp.h (Fread_file_name): Now has 6 args. - - * callint.c (Fcall_interactively) <"D">: Supply Qfile_directory_p - predicate for Fread_file_name when reading directory name. - Supply Qnil for predicate in other calls to Fread_file_name. - -2002-05-26 Miles Bader <miles@gnu.org> - - * term.c (tty_capable_p): New function. - * dispextern.h (tty_capable_p): New function declaration. - (TTY_CAP_INVERSE, TTY_CAP_UNDERLINE, TTY_CAP_BOLD, TTY_CAP_DIM) - (TTY_CAP_BLINK, TTY_CAP_ALT_CHARSET): New macros. - -2002-05-23 Stefan Monnier <monnier@cs.yale.edu> - - * fileio.c (read_non_regular, Finsert_file_contents): Use BEG_BYTE. - (Finsert_file_contents, build_annotations): Use XCAR, XCDR. - (Vwrite_region_annotate_functions): Docstring fix. - -2002-05-23 Kim F. Storm <storm@cua.dk> - - * xterm.c (x_write_glyphs): Clear phys_cursor_on_p if current - phys_cursor's hpos is overwritten. This is still not completely - correct, as it doesn't really make sense to use hpos at all to - get the cursor glyph (as that is relative to the width of the - characters on the line, which may have changed during the update). - -2002-05-22 Jason Rumney <jasonr@gnu.org> - - * w32fns.c (enumfont_t): Remove tail, make pattern a normal - Lisp_Object. - (enum_font_cb2, enum_font_maybe_add_to_list, w32_list_fonts): - Use modified enumfont_t struct. - - * w32term.h (text_cursor_kinds): New enumeration member HBAR_CURSOR. - - * w32term.c (x_draw_bar_cursor): New argument KIND; callers changed. - Handle the `hbar' cursor type. - (x_display_and_set_cursor): Handle the HBAR_CURSOR case. - - * w32fns.c (Qhbar): New variable. - (x_specified_cursor_type): Use it. - -2002-05-21 Ken Raeburn <raeburn@gnu.org> - - * w32fns.c (enum_font_maybe_add_to_list): Use XCDR_AS_LVALUE for - now, when the address is needed. - -2002-05-21 Colin Walters <walters@gnu.org> - - * Makefile.in (shortlisp): Add font-core.el. - -2002-05-20 Richard M. Stallman <rms@gnu.org> - - * buffer.c (syms_of_buffer) <cursor-type>: Doc fix. - - * keyboard.c (read_char_minibuf_menu_prompt): Don't list - equivalent key bindings here. - -2002-05-20 Ken Raeburn <raeburn@gnu.org> - - Change symbol structure to contain a lisp object for the symbol - name: - * lisp.h (struct Lisp_Symbol): Replace field "name" with a lisp - object field named "xname". - (SYMBOL_NAME): New macro. - * abbrev.c (write_abbrev): Use SYMBOL_NAME instead of XSYMBOL and - name field. - * alloc.c (Fmake_symbol): Set symbol xname field instead of name. - (mark_object, gc_sweep): Use symbol xname field and XSTRING - instead of name field. - * buffer.c (buffer_slot_type_mismatch): Use XSTRING and - SYMBOL_NAME instead of XSYMBOL and name field. - * callint.c (Fcall_interactively): Use XSTRING and SYMBOL_NAME - instead of XSYMBOL and name field. - * charset.c (Fdefine_charset, Fdeclare_equiv_charset): Use XSTRING - and SYMBOL_NAME instead of XSYMBOL and name field. - * coding.c (Fread_coding_system, code_convert_region1) - (code_convert_string1, code_convert_string_norecord) - (Ffind_operation_coding_system): Use SYMBOL_NAME instead of - XSYMBOL and name field. - * data.c (Fkeywordp, Fsymbol_name, store_symval_forwarding) - (Fmake_variable_buffer_local, Fmake_local_variable) - (Fmake_variable_frame_local): Use SYMBOL_NAME and XSTRING instead - of XSYMBOL and name field. - * editfns.c (Fformat): Use SYMBOL_NAME and XSTRING instead of - XSYMBOL and name field. - * emacs.c (shut_down_emacs) [#if 0]: Use SYMBOL_NAME and XSTRING - instead of XSYMBOL and name field. - * eval.c (do_autoload): Use SYMBOL_NAME and XSTRING instead of - XSYMBOL and name field. - * fns.c (Fstring_equal, Fstring_lessp, Frequire, sxhash): - Use SYMBOL_NAME and XSTRING instead of XSYMBOL and name field. - * fontset.c (Fset_fontset_font): Use SYMBOL_NAME and XSTRING - instead of XSYMBOL and name field. - * keyboard.c (echo_char, record_char, parse_modifiers_uncached) - (parse_modifiers, apply_modifiers, Fevent_convert_list) - (parse_solitary_modifier, Fexecute_extended_command): - Use SYMBOL_NAME and XSTRING instead of XSYMBOL and name field. - * keymap.c (silly_event_symbol_error, Fsingle_key_description) - (Fdescribe_buffer_bindings): Use SYMBOL_NAME and XSTRING instead - of XSYMBOL and name field. - (describe_command, describe_translation): Use SYMBOL_NAME and - assignment instead of XSYMBOL and name field and XSETSTRING. - * lread.c (Fintern_soft, oblookup): Use SYMBOL_NAME and XSTRING - instead of XSYMBOL and name field. - (Funintern): Use SYMBOL_NAME and assignment instead of XSYMBOL and - name field and XSETSTRING. - * macfns.c (parse_image_spec): Use SYMBOL_NAME and XSTRING instead - of XSYMBOL and name field. - * minibuf.c (Fread_command, Fread_variable): Use SYMBOL_NAME and - assignment instead of XSYMBOL and name field and XSETSTRING. - * print.c (print_error_message, print_object): Use SYMBOL_NAME and - XSTRING instead of XSYMBOL and name field. - * process.c (set_socket_options, Fsignal_process): Use SYMBOL_NAME - and XSTRING instead of XSYMBOL and name field. - * w32fns.c (parse_image_spec, w32_parse_hot_key): Use SYMBOL_NAME - and XSTRING instead of XSYMBOL and name field. - * xfaces.c (merge_face_vector_with_property): Use SYMBOL_NAME and - XSTRING instead of XSYMBOL and name field. - * xfns.c (parse_image_spec): Use SYMBOL_NAME and XSTRING instead - of XSYMBOL and name field. - * xselect.c (symbol_to_x_atom, x_get_foreign_selection): - Use SYMBOL_NAME and XSTRING instead of XSYMBOL and name field. - -2002-05-19 Ken Raeburn <raeburn@gnu.org> - - * lisp.h (LISP_MAKE_RVALUE): Delete disabled version, making XCAR - and XCDR real rvalues in most configurations. - - * buffer.c (fix_overlays_in_range, fix_overlays_before): - Don't take the address of the cdr part of a cons cell; instead, track - the parent cell and call XSETCDR, or set the variable for the head - of the list if we haven't started down the list yet. - -2002-05-19 Richard M. Stallman <rms@gnu.org> - - * doc.c (reread_doc_file): Don't ask for confirmation. - -2002-05-18 Jason Rumney <jasonr@gnu.org> - - * w32fns.c (w32_create_pixmap_from_bitmap_data): New function. - (xbm_load_image): Use it. - (xbm_load): Ditto. - (xbm_read_bitmap_data): Reverted to xfns.c version. - From David Ponce <david@dponce.com>. - -2002-05-17 Eli Zaretskii <eliz@is.elta.co.il> - - * msdos.c (sig_suspender, sigprocmask): Don't define for DJGPP - 2.02 and later. - -2002-05-16 Juanma Barranquero <lektu@terra.es> - - * keyboard.c (Fthis_command_keys, Fthis_command_keys_vector): Fix typo. - -2002-05-15 Stefan Monnier <monnier@cs.yale.edu> - - * keyboard.c (read_char_x_menu_prompt): Use an equivalent but more - meaningful test. - (read_char_minibuf_menu_prompt): Fix typo. - -2002-05-15 Eli Zaretskii <eliz@is.elta.co.il> - - * eval.c (Fcommandp): Doc fix. - -2002-05-13 Stefan Monnier <monnier@cs.yale.edu> - - * keymap.c (keymap_parent): New fun, extracted from Fkeymap_parent. - (Fkeymap_parent, keymap_memberp, fix_submap_inheritance): Use it. - (Fset_keymap_parent): Gcpro a bit more. - (access_keymap): Gcpro around meta_map call and around the main loop. - (get_keyelt): Gcpro when following indirect references. - (copy_keymap_item): New fun, extracted from Fcopy_keymap. - (copy_keymap_1, Fcopy_keymap): Use it. Don't copy the parent map. - (Fdefine_key, Flookup_key): Gcpro before calling get_keymap. - Remove useless ad-hoc remap code. - -2002-05-13 Richard M. Stallman <rms@gnu.org> - - * search.c (search_buffer): Give up boyer moore search if inverse - translation change charset_base. - -2002-05-12 Eli Zaretskii <eliz@is.elta.co.il> - - * coding.c (decode_coding) <coding_type_ccl>: If a lone CR - characters is carried over from the previous block of text, adjust - coding->produced to account for the extra character. - -2002-05-11 Andreas Schwab <schwab@suse.de> - - * coding.c (intersection): Keep the elements of the returned list - in the same order as in the first list. - -2002-05-11 Kim F. Storm <storm@cua.dk> - - * keymap.c (current_minor_maps): Fix resizing of cmm_maps; - only update cmm_size if realloc actually succeeds. - Testing with initial size of 2 elements revealed that using - realloc on GNU/Linux would cause a random trap in xmalloc - later on, so I rewrote the code to use malloc/bcopy/free instead - of realloc. - -2002-05-10 Jason Rumney <jasonr@gnu.org> - - * w32fns.c (enum_font_cb2): Avoid DBCS raster fonts. - -2002-05-10 Eli Zaretskii <eliz@is.elta.co.il> - - * coding.c (encode_coding_sjis_big5): Enclose bitwise AND in - parens, to ensure correct evaluation order. - -2002-05-10 Kim F. Storm <storm@cua.dk> - - * keymap.c (Vemulation_mode_map_alists): New variable. - (syms_of_keymap): DEFVAR_LISP it. - (current_minor_maps): Process keymap alists in that list before - minor-mode-overriding-map-alist and minor-mode-map-alist. - -2002-05-09 Richard M. Stallman <rms@gnu.org> - - * search.c (Freplace_match): Doc fix. - -2002-05-09 Kim F. Storm <storm@cua.dk> - - * macterm.c (x_draw_image_foreground, x_draw_image_foreground_1): - Enlarge cursor rectangle drawn around image with non-zero relief. - - * w32term.c (x_draw_image_foreground, w32_draw_image_foreground_1): - Enlarge cursor rectangle drawn around image with non-zero relief. - - * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1): - Enlarge cursor rectangle drawn around image with non-zero relief. - -2002-05-07 Eli Zaretskii <eliz@is.elta.co.il> - - * xselect.c (lisp_data_to_selection_data): Don't set selection - type if comes from the Lisp object's car. If the selection - contains a pure ASCII text, always return QSTRING as its type. - -2002-05-06 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * mac.c (mac-cut-function): Doc fix. - -2002-05-05 Richard M. Stallman <rms@gnu.org> - - * s/gnu.h [DOUG_LEA_MALLOC] (REL_ALLOC): Undefine it. - -2002-05-04 Jason Rumney <jasonr@gnu.org> - - * keyboard.c (make_lispy_event) <mouse-wheel>: Set count to 1 - for event-click-count. - - * process.c (init_process): Only add server subfeature if we can - use non-blocking I/O. - -2002-05-04 Andrew Choi <akochoi@shaw.ca> - - * macterm.c (XTread_socket): Call WaitNextEvent once instead of - repeatedly. - -2002-05-03 Jason Rumney <jasonr@gnu.org> - - * process.c (Fmake_network_process): Only support server sockets - when we can make them non-blocking. - - * s/ms-w32.h (HAVE_SELECT): Define. - - * w32.h (FILE_NDELAY): New flag. - - * w32.c (sys_getpeername, fcntl): New functions. - (_sys_read_ahead): Temporarily block on non-blocking sockets. - - * w32proc.c: Include sys/file.h. - -2002-05-03 Colin Walters <walters@verbum.org> - - * callproc.c (Vgame_score_directory): Renamed to - Vshared_game_score_directory. - -2002-04-30 Richard M. Stallman <rms@gnu.org> - - * s/gnu.h [emacs]: Include stdio.h. - (GNU_LIBRARY_PENDING_OUTPUT_COUNT): New definition, conditional. - - * eval.c (do_autoload): Error if called while preparing to dump. - - * fns.c (Frequire): Error if need to load while preparing to dump. - -2002-04-28 Colin Walters <walters@verbum.org> - - * callproc.c (Vgame_score_directory) [!HAVE_SHARED_GAME_DIR]: - Default to "~/.emacs.d/games". - -2002-04-29 Stefan Monnier <monnier@cs.yale.edu> - - * lread.c (openp): Change arg exec_only to predicate. - (build_load_history): Use XCAR/XCDR. - (Flocate_file_internal): New fun. - (syms_of_lread): Defsubr it. - (Fload): Update call to openp. - - * lisp.h (openp): Update prototype. - - * xfns.c (x_create_bitmap_from_file, x_find_image_file): - * w32proc.c (sys_spawnve): - * w32fns.c (x_create_bitmap_from_file, x_find_image_file): - * w32.c (check_windows_init_file): - * sound.c (Fplay_sound_internal): - * process.c (Fstart_process): - * macfns.c (x_create_bitmap_from_file, x_find_image_file): - * mac.c (run_mac_command): - * emacs.c (init_cmdargs): - * callproc.c (Fcall_process): Update call to openp. - - * textprop.c (remove_properties): Don't use XCAR without CONSP. - - * xterm.c (XTread_socket): Disable the Xutf8LookupString code. - -2002-04-29 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * dispextern.h (DEFAULT_TOOL_BAR_BUTTON_MARGIN) - (DEFAULT_TOOL_BAR_BUTTON_RELIEF): Change default values. - -2002-04-28 Richard M. Stallman <rms@gnu.org> - - * minibuf.c (Fall_completions, Ftry_completion): New arg to Fcommandp. - - * eval.c (Fcommandp): New arg for_call_interactively. - * lisp.h (Fcommandp): Declare new arg. - -2002-04-28 Jason Rumney <jasonr@gnu.org> - - * w32proc.c (syms_of_w32proc): Get true file attributes by default. - - * w32.c (stat, fstat): Use file index information to generate - inodes for directories where available. - -2002-04-26 Andrew Choi <akochoi@shaw.ca> - - * Makefile.in (C_SWITCH_SYSTEM_TEMACS): Add. - [HAVE_CARBON]: Include Mac object files. - - * alloc.c, callproc.c, dispextern.h, dispnew.c, emacs.c, - fontset.c, frame.c, frame.h, keyboard.c, sysdep.c, term.c, - termcap.c, window.c, xdisp.c, xfaces.c: Use macros MAC_OS8, - MAC_OSX, and MAC_OS instead of macintosh. - - * editfns.c [MAC_OS8]: Include stdio.h. - - * emacs.c [MAC_OS8]: Call mac_initialize instead of x_term_init. - - * fontset.c [MAC_OS]: Set Vdefault_fontset to ETL Fixed instead of - Apple Monaco. - - * process.c (QCfamily, QCfilte): Declare extern. - (wait_reading_process_input) [MAC_OSX]: Clear bit for stdin before - calling select. - - * termcap.c [MAC_OSX]: Don't define tgetnum, PC, tputs, and tgetent. - - * tparam.c [MAC_OSX]: Don't define BC and UP. - - * config.in [HAVE_CARBON]: Add. - - * mac.c, macgui.h, macfns.c, macmenu.c, macterm.c, macterm.h: - Move here from mac/src and mac/inc. - - * s/darwin.h, m/powermac.h, unexmacosx.c: New files. - -2002-04-26 Gerd Moellmann <gerd@gnu.org> - - * xterm.c (x_draw_phys_cursor_glyph): Undo last change. - Compute phys_cursor_width from the x position returned - by x_draw_glyhs, which is cheaper. - (x_display_and_set_cursor): Compute the buffer-local value - of `cursor-in-non-selected-windows' only when needed. - -2002-04-25 Gerd Moellmann <gerd@gnu.org> - - * xterm.c (x_draw_phys_cursor_glyph): Take into account that a box - cursor on a stretch glyph has a width that depends on - x_stretch_cursor_p. - -2002-04-25 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * abbrev.c (abbrev-start-location): Doc fix. - - * indent.c (Fvertical_motion): Fix last change. - -2002-04-25 Gerd Moellmann <gerd@gnu.org> - - * indent.c (Fvertical_motion): Move to the start of the line - containing PT before moving up or down. - -2002-04-24 Gerd Moellmann <gerd@gnu.org> - - * dispnew.c (update_text_area): Set phys_cursor_on_p to 0 in the - case of writing a whole row, more or less analogous to the case of - writing only parts of a row. - - * xterm.c (x_display_and_set_cursor): Set phys_cursor_width to - 0 for NO_CURSOR. - - * xterm.c (notice_overwritten_cursor): Fix an off by 1 error. - -2002-04-23 Colin Walters <walters@verbum.org> - - * buffer.c (syms_of_buffer): Doc fix. - -2002-04-23 Gerd Moellmann <gerd@gnu.org> - - * xterm.c (notice_overwritten_cursor): Handle the special case - of the cursor being in the first blank non-text line at the - end of a window. - - * xterm.c (x_draw_hollow_cursor, x_draw_bar_cursor) - (x_draw_phys_cursor_glyph): Set phys_cursor_width here. - (x_display_and_set_cursor): Don't set phys_cursor_width here, for - bar cursors only, to make phys_cursor_width contain what its name - suggests. - (notice_overwritten_cursor): Consider the cursor image erased if - the output area intersects the cursor image in y-direction. - -2002-04-23 Simon Marshall <simon@gnu.org> - - * xfns.c (x_set_mouse_color): Change default for cross_cursor - to XC_hand2. - -2002-04-23 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * xdisp.c: Remove unused global variable `minibuf_prompt_pixel_width'. - -2002-04-22 Kim F. Storm <storm@cua.dk> - - * textprop.c (remove_properties): Fixed trap for malformed plist. - -2002-04-22 Richard M. Stallman <rms@gnu.org> - - * cmds.c (Fend_of_line): Handle intangible text in mid line. - - * window.c (make_window): Initialize height_fixed_p, - last_cursor_off_p, and p->cursor_off_p slots. - -2002-04-20 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * fns.c (use-dialog-box): Doc fix. - -2002-04-19 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * xterm.c (note_mode_line_or_margin_highlight): Remove unused - variables `row', `i' and `area'. - (XTread_socket) <KeyPress>: Pass KeyPress events when in menu to - toolkit library. - -2002-04-19 Stefan Monnier <monnier@cs.yale.edu> - - * xfaces.c (clear_font_table): Don't free the default font of - a frame even if it's on another display. - (Finternal_set_lisp_face_attribute): Don't use XFRAME on something - that could be Qt. - -2002-04-19 Juanma Barranquero <lektu@terra.es> - - * indent.c (Fmove_to_column): Remove unused local variable - `next_boundary_byte'. - (current_column_1): Likewise. - -2002-04-19 Eli Zaretskii <eliz@is.elta.co.il> - - * msdos.c (Qhbar): New variable. - (syms_of_msdos): Intern and staticpro it. - (IT_set_cursor_type, IT_set_frame_parameters): Handle the `hbar' - cursor type. - -2002-04-19 Dave Lambert <dlambert@acm.org> - - Theses change implement an underscore-like (`hbar') cursor. - - * xterm.h (text_cursor_kinds): New enumeration member HBAR_CURSOR. - - * xterm.c (x_draw_bar_cursor): New argument KIND; callers changed. - Handle the `hbar' cursor type. - (x_display_and_set_cursor): Handle the HBAR_CURSOR case. - - * xfns.c (Qhbar): New variable. - (syms_of_xfns): Intern and staticpro it. - (x_specified_cursor_type): Handle `hbar' cursor. - - * s/sol2-5.h (bcopy, bzero, bcmp): Define only if HAVE_BCOPY is - not defined. - -2002-04-18 Richard M. Stallman <rms@gnu.org> - - * textprop.c (remove_properties): New arg LIST allows scanning - either a list or a plist. - (interval_has_some_properties_list): New function, like - interval_has_some_properties using list instead of plist. - All callers changed. - (Fremove_list_of_text_properties): New function. - (syms_of_textprop): Defsubr it. - -2002-04-17 Eli Zaretskii <eliz@is.elta.co.il> - - * s/sol2.h (HAVE_LIBKSTAT): Define only if not already defined. - -2002-04-17 Juanma Barranquero <lektu@terra.es> - - * indent.c (Fmove_to_column): Remove unused local variable `end_byte'. - -2002-04-17 Eli Zaretskii <eliz@is.elta.co.il> - - * window.c (coordinates_in_window): Don't report on margin area - if its width is zero. - -2002-04-16 Jason Rumney <jasonr@gnu.org> - - * w32fns.c (Fx_file_dialog): Decode file name before using. - - * w32term.c (construct_drag_n_drop): Likewise. - -2002-04-16 Eli Zaretskii <eliz@is.elta.co.il> - - * puresize.h (BASE_PURESIZE): Increase to 830000, since we now - store load-history in pure space. - - * s/msdos.h (SYSTEM_PURESIZE_EXTRA): Reduce to 50000. - -2002-04-16 Stefan Monnier <monnier@cs.yale.edu> - - * xterm.c (Qlatin_1, Qutf_8): New vars. - (syms_of_xterm): Initialize them. - (XTread_socket): Eliminate incorrect optimization that tried to avoid - decoding the output of X*LookupString. - Always use latin-1 to decode the output of XLookupString. - Try Xutf8LookupString if XmbLookupString failed. - - * region-cache.c (new_region_cache): Use BEG. - -2002-04-16 Gerd Moellmann <gerd@gnu.org> - - * buffer.c (MMAP_ALLOCATED_P): New macro to be set from system - configuration files. - (mmap_enlarge): Enlarge mapped regions only if MMAP_ALLOCATED_P - returns 0. - -2002-04-15 Andreas Schwab <schwab@suse.de> - - * config.in: Regenerated using autoheader. - - * m/7300.h, m/acorn.h, m/alliant-2800.h, m/alliant.h, m/alpha.h, - m/altos.h, m/amdahl.h, m/apollo.h, m/arm.h, m/att3b.h, m/aviion.h, - m/celerity.h, m/clipper.h, m/cnvrgnt.h, m/convex.h, m/cydra5.h, - m/delta.h, m/delta88k.h, m/dpx2.h, m/elxsi.h, m/gec63.h, - m/gould.h, m/hp800.h, m/hp9000s300.h, m/i860.h, m/ia64.h, - m/ibmps2-aix.h, m/ibmrs6000.h, m/ibmrt-aix.h, m/ibmrt.h, - m/ibms390.h, m/intel386.h, m/iris4d.h, m/irist.h, m/isi-ov.h, - m/m68k.h, m/macppc.h, m/masscomp.h, m/mg1.h, m/mips-siemens.h, - m/mips.h, m/news-r6.h, m/news.h, m/next.h, m/nh3000.h, m/nh4000.h - m/ns32000.h, m/orion.h, m/pfa50.h, m/plexus.h, m/pmax.h, - m/powerpcle.h, m/pyrmips.h, m/sequent-ptx.h, m/sequent.h, - m/sparc.h, m/sr2k.h, m/symmetry.h, m/tad68k.h, m/tahoe.h, - m/targon31.h, m/tek4300.h, m/tekxd88.h, m/template.h, m/tower32.h, - m/tower32v3.h, m/ustation.h, m/vax.h, m/wicat.h, m/windowsnt.h, - m/xps100.h, s/aix3-2.h, s/aix4-2.h, s/irix4-0.h, s/irix5-0.h, - s/sco5.h, s/unixware.h: Don't set HAVE_ALLOCA, C_ALLOCA and - STACK_DIRECTION, now set by autoconf. - -2002-04-14 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * dispnew.c (marginal_area_string): Sort arguments. - - * dispextern.h (marginal_area_string): Add prototype. - -2002-04-13 Richard M. Stallman <rms@gnu.org> - - * fileio.c (Finsert_file_contents): - Don't call temp_output_buffer_setup--do just part, by hand. - - * coding.c (run_pre_post_conversion_on_str): - Don't call temp_output_buffer_setup--do just part, by hand. - - * keyboard.c (command_loop_1): Don't call start_hourglass - or cancel_hourglass when executing a macro. - - * marker.c (count_markers): New function. - - * xdisp.c (display_mode_element): Don't let mode_line_proptrans_alist - grow without limit. Move recently used elements to the front. - -2002-04-13 Eli Zaretskii <eliz@is.elta.co.il> - - * unexelf.c (unexec) [__sgi]: Undo the change from 2002-01-20. - -2002-04-12 Gerd Moellmann <gerd@gnu.org> - - * xdisp.c (sync_frame_with_window_matrix_rows): Don't give frame - rows marginal areas. - (Fdump_frame_glyph_matrix) [GLYPH_DEBUG]: New function. - (syms_of_xdisp) [GLYPH_DEBUG]: Defsubr it. - - * dispnew.c (marginal_area_string): Check that glyph row is enabled. - -2002-04-12 Dave Love <fx@gnu.org> - - * dispnew.c (marginal_area_string): New. - - * window.c (window_part): Add ON_LEFT_MARGIN, ON_RIGHT_MARGIN. - (Qleft_margin, Qright_margin): Declare. - (coordinates_in_window, (Fcoordinates_in_window_p): Deal with margins. - - * xterm.c (note_mode_line_or_margin_highlight): Renamed from - note_mode_line_highlight and extended. - - * keyboard.c (Qleft_margin, Qright_margin): Declare. - (make_lispy_event): Deal with mouse events in margins. - -2002-04-12 Stefan Monnier <monnier@cs.yale.edu> - - * msdos.c (dos_rawgetc): Use a single event for HELP_EVENT. - - * keyboard.c (command_loop_1): Turn off transient-mark-mode rather - than deactivating the mark if tmm is set to `lambda'. - (gen_help_event, kbd_buffer_store_help_event, kbd_buffer_get_event): - Use a single event for HELP_EVENT. - (Fexecute_extended_command): Save last_point_position. - -2002-04-12 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * lisp.h (Fpropertize): Add prototype. - - * fns.c (Fy_or_n_p): Use `minibuffer-prompt' face for prompt. - -2002-04-10 Colin Walters <walters@verbum.org> - - * config.in: Add HAVE_SHARED_GAME_DIR. - - * callproc.c (Vgame_score_directory): New variable. - (syms_of_callproc) <Vgame_score_directory>: DEFVAR_LISP. - -2002-04-10 Richard M. Stallman <rms@gnu.org> - - * puresize.h (BASE_PURESIZE): Reduce again to avoid big excess. - -2002-04-09 Stefan Monnier <monnier@cs.yale.edu> - - * minibuf.c (read_minibuf): Use empty_string. - (Ftry_completion): Allow lambda forms and lists of strings for `alist'. - Short-circuit the search as soon as it "failed". - (Fall_completions): Allow lambda forms and lists of strings for alist. - (Fcompleting_read): Set Qminibuffer_completion_confirm to nil - when require_match is nil. - (Ftest_completion): Rename from `test_completion' and export to elisp. - Call the predicate also when alist is a list. - Obey Vcompletion_regexp_list. - (do_completion, Fminibuffer_complete_and_exit): Use it. - (Fassoc_string): Rename from `assoc_for_completion'. - Allow list of strings as well and export to elisp. - -2002-04-08 Stefan Monnier <monnier@cs.yale.edu> - - * puresize.h (BASE_PURESIZE): Increase to 900KB. - -2002-04-08 Juanma Barranquero <lektu@terra.es> - - * w32.c (sys_accept): Don't hide variable `s'. - -2002-04-05 Gerd Moellmann <gerd@gnu.org> - - * callint.c (Fcall_interactively): Use INTEGERP instead of - NUMBERP for checking Vhistory_length. - -2002-04-05 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * sound.c (Fplay_sound_internal): Renamed from Fplay_sound. - Doc fix to reflect it. - -2002-04-04 Richard M. Stallman <rms@gnu.org> - - * xdisp.c (display_mode_element): New arg RISKY. - Disregard text props found or specified within a variable - that isn't marked risky-local-variable. - (Qrisky_local_variable): New variable. - (syms_of_xdisp): Init and staticpro it. - -2002-04-04 Stefan Monnier <monnier@cs.yale.edu> - - * undo.c (record_point): New fun. - (record_delete, record_insert): Use it. - -2002-04-03 Juanma Barranquero <lektu@terra.es> - - * doc.c (Fdocumentation): Add missing parentheses. - (Fdocumentation_property): Likewise. - -2002-04-03 Stefan Monnier <monnier@cs.yale.edu> - - * doc.c (Fdocumentation, Fdocumentation_property): When the doc - data is 0, just return nil. - -2002-04-03 Eli Zaretskii <eliz@is.elta.co.il> - - * msdos.c (syms_of_msdos): Fix last change with - mouse_autoselect_window. - -2002-04-03 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * w32term.c, xterm.c, msdos.c: Rename autoselect_window_p to - mouse_autoselect_window. - -2002-04-02 Stefan Monnier <monnier@cs.yale.edu> - - * keyboard.c (make_lispy_event): Handle unknown keysyms together - with system-specific keysyms. Use it also for unknown function keys. - - * doc.c (reread_doc_file): Return whether reload was attempted. - (Fdocumentation, Fdocumentation_property): Don't try to reload - if the doc is 0 and only ask once. - - * Makefile.in (lisp, shortlisp): Add ucs-tables.elc. - -2002-04-02 Eli Zaretskii <eliz@is.elta.co.il> - - * keyboard.c (read_char): If the event was Qselect_window, - restore timer_idleness_start_time to its previous value. - - * msdos.c (dos_rawgetc): Generate SELECT_WINDOW_EVENTs when required. - -2002-04-01 Stefan Monnier <monnier@cs.yale.edu> - - * region-cache.c (new_region_cache): Use BEG. - - * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): - Use BEG and BEG_BYTE. - - * doc.c (get_doc_string): Return nil if the location is wrong. - (reread_doc_file): New fun. - (Fdocumentation, Fdocumentation_property): - Call it if get_doc_string fails. - (Fsnarf_documentation): Make it work for a dumped Emacs. - - * charset.h (DEC_POS, BUF_DEC_POS): Use BEG_BYTE. - Bound the search with MAX_MULTIBYTE_LENGTH to avoid pathological case. - - * charset.c (Fstring): Allow 0 arguments. - - * xterm.c (XTread_socket): Fix int/Lisp_Object confusion. - - * process.c (DATAGRAM_CONN_P, list_processes_1) - (Fprocess_datagram_address, Fset_process_datagram_address) - (Fset_network_process_options, server_accept_connection): - Fix some int/Lisp_Object confusions (thank you union types). - -2002-04-01 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * msdos.c: Rename x_autoselect_window_p to autoselect_window_p. - - * w32term.c: Likewise. - (note_mouse_movement): Put code for x_autoselect_window_p in #if 0. - - * keyboard.c (Qselect_window): New symbol. - (head_table): Use it. - (keys_of_keyboard): Bound select-window event to handle-select-window. - (kbd_buffer_get_event): Make a Lisp event from SELECT_WINDOW_EVENT. - - * xterm.c: Rename x_autoselect_window_p to autoselect_window_p. - (last_window): New variable. - (XTread_socket): Generate SELECT_WINDOW_EVENTs. - (note_mouse_movement): Remove reimplemented code in #if 0. - (XTread_socket): Generate SELECT_WINDOW_EVENTs only for - Emacs windows. - - * termhooks.h (enum event_kind): New event type `SELECT_WINDOW_EVENT'. - -2002-03-31 Gerd Moellmann <gerd@gnu.org> - - * xterm.c (x_get_char_face_and_encoding): Add parameter DISPLAY_P. - Callers changed. - -2002-03-30 Richard M. Stallman <rms@gnu.org> - - * window.c (window_scroll_pixel_based): Exit the move_it_by_lines - loop whenever it stops making progress. - - * widget.c (set_frame_size): Don't call change_frame_size. - -2002-03-30 Gerd Moellmann <gerd@gnu.org> - - * dispnew.c (direct_output_for_insert): - Call mark_window_display_accurate. - -2002-03-29 Jason Rumney <jasonr@gnu.org> - - * w32term.c (w32_draw_relief_rect): Fix calculations of line lengths. - -2002-03-29 Eli Zaretskii <eliz@is.elta.co.il> - - * Makefile.in (lread.o): Depend on coding.h. - - * lread.c (openp, Fload): Encode the file name before passing it - to `stat', `access', and `emacs_open'. - (openp): GCPRO the encoded file name. Don't recompute Lisp - strings unnecessarily. - -2002-03-29 Kim F. Storm <storm@cua.dk> - - * fns.c (Flax_plist_put): Doc fix. - -2002-03-28 Miles Bader <miles@gnu.org> - - * process.c (DATAGRAM_CONN_P): Make sure PROC is really a process. - -2002-03-27 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * process.c (set-network-process-options): Add usage. - (make-network-process): Doc fix. - -2002-03-26 Eli Zaretskii <eliz@is.elta.co.il> - - * emacs.c (Fdump_emacs): Fix a typo in "command-line-processed". - -2002-03-26 Richard M. Stallman <rms@gnu.org> - - * fns.c (Fsubstring_no_properties): New function. - (Flax_plist_get, Flax_plist_put): New functions. - (syms_of_fns): defsubr them. - - * xdisp.c (update_menu_bar): Test only update_mode_lines; - don't test or alter w->update_mode_line. - - * window.c (Fdisplay_buffer): Doc fix. - -2002-03-24 Richard M. Stallman <rms@gnu.org> - - * regex.c (GET_UNSIGNED_NUMBER): Give proper error for spaces. - -2002-03-24 Gerd Moellmann <gerd@gnu.org> - - * eval.c (Qdeclare, Vmacro_declaration_function): New variables. - (Fdefmacro): Handle `(declare ...)'. - (syms_of_eval) <Qdeclare>: Initialize and staticpro. - (syms_of_eval) <Vmacro_declaration_function>: DEFVAR_LISP. - -2002-03-24 Jason Rumney <jasonr@gnu.org> - - * w32fns.c (xbm_scan, xbm_load_image, xbm_read_bitmap_data) - (xbm_file_p): Add prototypes. - (xbm_format, xbm_image_p): Sync with xfns.c. - (reflect_byte): New function. - (xbm_read_bitmap_data): Sync with xfns.c, adapt for Windows. - (xbm_load_image): Create bitmaps with a depth of 1. - (init_xfns): Enable XBM images. - -2002-03-23 Jason Rumney <jasonr@gnu.org> - - * w32term.c (w32_handle_tool_bar_click): Detect up and down events - correctly. Do not pass up_modifier to keyboard buffer. - - * w32fns.c [HAVE_IMAGES, HAVE_PBM]: Remove conditionals. - -2002-03-22 Stefan Monnier <monnier@cs.yale.edu> - - * Makefile.in (bootstrapclean): New target. - (bootstrap-temacs, bootstrap-doc): Remove. - (bootstrap-emacs): Use a bog-standard `temacs'. - Don't bother to build a DOC file. - - * sysdep.c (wait_for_termination): Use sigsuspend rather than sigpause. - - * emacs.c (main): Handle --unibyte, --multibyte, and --no-loadup - in temacs even if !CANNOT_DUMP. - (standard_args): Keep --no-loadup even if !CANNOT_DUMP. - - * alloc.c (check_pure_size): Only output a warning. - -2002-03-22 Jason Rumney <jasonr@gnu.org> - - * w32fns.c (Fx_create_frame): Enable tool-bar when images are - supported. - - * w32term.c (zv_bits): Declare as short, for word alignment. - (w32_read_socket) <WM_XBUTTONUP>: Fix last change. - (syms_of_w32term): Define x-use-underline-position-properties. - - * w32fns.c (x_set_cursor_color): Set cursor_gc as well. - (clear_image_cache): Block input, fix logic, clear matrices in - all frames that share this cache. - -2002-03-22 Eli Zaretskii <eliz@is.elta.co.il> - - * emacs.c (main): Update the Copyright year in the blurb printed - by "emacs --version". - - * xdisp.c (message_with_string): Fix syntax of a call to GCPRO2. - - * xterm.c (XTread_socket): If XK_ISO_Lock and - XK_ISO_Last_Group_Lock are defined, handle keysyms between - XK_ISO_Lock and XK_ISO_Last_Group_Lock similarly to Mode_switch. - -2002-03-21 Kim F. Storm <storm@cua.dk> - - * keyboard.c (menu_bar_items): Mostly undo 2002-02-20 patch, so - menu-bar bindings in keymap and local-map properties _are_ used. - But try keymap property first in accordance with 2002-01-03 patch. - Added comment describing why this is not always reliable. - (tool_bar_items): Ditto for tool-bar. - -2002-03-21 Jason Rumney <jasonr@gnu.org> - - * w32fns.c (x_clear_image_1): Disable color table code. - -2002-03-21 Kim F. Storm <storm@cua.dk> - - * lisp.h (DEFUN) [USE_NONANSI_DEFUN]: The 2001-10-17 patch - removed the wrong version of the DEFUN macro; fixed it. - - * fns.c (Ffeaturep): Allow subfeature to be a list (test using - Fmember rather than Fmemq). - (Fprovide): Check that subfeatures is a list. - - * process.c (QCfeature, QCdatagram): Removed variables. - (QCtype, Qdatagram): New variables. - (network_process_featurep): Removed function. - (Fmake_network_process): Removed :feature check. - Use :type 'datagram instead of :datagram t to create a datagram - socket. This allows us to add other connection types (e.g. raw - sockets) later in a consistent manner. - (init_process) [subprocess, HAVE_SOCKETS]: Provide list of - supported subfeatures for feature make-network-process. - (syms_of_process) [subprocess]: Remove QCfeature and QCdatagram. - Intern and staticpro QCtype and Qdatagram. - (syms_of_process) [!subprocess]: Intern and staticpro QCtype. - - * xfns.c (QCtype): Remove duplicate declaration and - initialization (is now declared in process.c). - - * w32fns.c (QCtype): Remove duplicate declaration and - initialization (is now declared in process.c). - -2002-03-21 Richard M. Stallman <rms@gnu.org> - - * regex.c (DISCARD_FAILURE_REG_OR_COUNT): New macro. - (CHECK_INFINITE_LOOP): Use DISCARD_FAILURE_REG_OR_COUNT - when jumping to `fail' to avoid undoing reg changes in the - last iteration of the loop. - (GET_UNSIGNED_NUMBER): Skip spaces around the number. - - * Makefile.in (dispnew.o, sysdep.o, xdisp.o, xselect.o, alloc.o): - Depend on process.h. - -2002-03-20 Jason Rumney <jasonr@gnu.org> - - Most of the following changes are still conditional on HAVE_IMAGES - which is not set by default on Windows. - - * emacs.c (main) [WINDOWSNT]: Call init_xfns. - - * w32fns.c (x_set_cursor_color): Set foreground of cursor, not frame. - (Fimage_size, Fimage_mask_p, XPutPixel): New functions. - (four_corners_best, x_clear_image_1, x_clear_image) - (x_alloc_image_color, postprocess_image) - (x_create_x_image_and_pixmap, x_destroy_x_image, xbm_load_image) - (x_from_x_colors, x_disable_image, pbm_load): Adapt for Windows. - (init_xfns, syms_of_w32fns): Initialize image functions and constants. - - * w32gui.h (struct XImage): Define. - - * w32term.c (w32_read_socket) <WM_XBUTTONUP>: Use XFASTINT to - extract mouse co-ordinates. - -2002-03-20 Jason Rumney <jasonr@gnu.org> - - * w32.c (init_winsock): Dynamically load new server and UDP - socket functions. - (socket_to_fd): New function. - (sys_socket): Use it. - (sys_setsockopt, sys_listen, sys_getsockname, sys_accept) - (sys_recvfrom, sys_sendto): New wrapper functions. - - * process.c (QCfamily, QCfilter): Remove duplicate declaration - and initialization. - - * makefile.w32-in (LIBS): Remove $(WSOCK32). - -2002-03-20 Eli Zaretskii <eliz@is.elta.co.il> - - * process.c (conv_sockaddr_to_lisp, conv_lisp_to_sockaddr): - Don't use "sun" as a variable, it's a predefined constant on Sun - machines. - -2002-03-20 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * bytecode.c (Fbyte_code): Revert last change. - -2002-03-19 Kim F. Storm <storm@cua.dk> - - * makefile.w32-in (LIBS): Add $(WSOCK32). - From David Ponce <dponce@voila.fr>. - -2002-03-18 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * process.c (wait_reading_process_input): Move variables `pname' - and `pnamelen' down where they are used. - - * bytecode.c (Fbyte_code): Discard unused computed value to - prevent gcc warning. - - * lisp.h (Fplist_member): Add prototype. - -2002-03-18 Kim F. Storm <storm@cua.dk> - - * config.in: Add HAVE_SENDTO, HAVE_RECVFROM, HAVE_SETSOCKOPT, - HAVE_GETSOCKOPT, HAVE_GETPEERNAME, HAVE_GETSOCKNAME, and HAVE_SYS_UN_H. - - * process.c: Define HAVE_LOCAL_SOCKETS based on HAVE_SYS_UN_H. - Remove explicit GNU_LINUX settings for datagram support. - -2002-03-18 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * process.c (Fmake_network_process): Remove unused variable `sa'. - Doc fix. Add usage:. - (set_socket_options): Remove unused variables `optnum' and `opttype'. - -2002-03-17 Richard M. Stallman <rms@gnu.org> - - * xdisp.c (cursor_type_changed): New variable. - (redisplay_internal): Redisplay all windows if cursor_type_changed. - Clear it when clearing windows_or_buffers_changed. - (try_cursor_movement, redisplay_window, try_window_id) - (try_window_reusing_current_matrix): Test cursor_type_changed - along with windows_or_buffers_changed. - - * window.h (cursor_type_changed): New variable. - - * xfns.c (x_set_cursor_type): Set cursor_type_changed, - not update_mode_lines, and always set it to 1. - - * xdisp.c (clear_garbaged_frames): Don't set windows_or_buffers_changed - if no frames needed redrawing. - -2002-03-17 Kim F. Storm <storm@cua.dk> - - The following changes add support for network server processes, - datagram connections, and local (unix) sockets. - - * process.h (struct Lisp_Process): New member log. - Doc fix: Member command used to indicate stopped network process. - Doc fix: Member childp contains plist for network process. - Doc fix: Member kill_without_query is inverse of query-on-exit flag. - - * process.c (Qlocal, QCname, QCbuffer, QChost, QCservice, QCfamily) - (QClocal, QCremote, QCserver, QCdatagram, QCnowait, QCnoquery, QCstop) - (QCcoding, QCoptions, QCfilter, QCsentinel, QClog, QCfeature): New - variables. - (NETCONN1_P): New macro. - (DATAGRAM_SOCKETS): New conditional symbol. - (datagram_address): New array. - (DATAGRAM_CONN_P, DATAGRAM_CHAN_P): New macros. - (status_message): Use concat3. - (Fprocess_status): Add `listen' status to doc string. Return - `stop' for a stopped network process. - (Fset_process_buffer): Update contact plist for network process. - (Fset_process_filter): Ditto. Don't enable input for stopped - network processes. Server must listen, even if filter is t. - (Fset_process_query_on_exit_flag, Fprocess_query_on_exit_flag): - New functions. - (Fprocess_kill_without_query): Removed. Now defined in simple.el. - (Fprocess_contact): Added KEY argument. Handle datagrams. - (list_processes_1): Optionally show only processes with the query - on exit flag set. Dynamically adjust column widths. Omit tty - column if not needed. Report stopped network processes. Identify - server and datagram network processes. - (Flist_processes): New optional arg `query-only'. - (conv_sockaddr_to_lisp, get_lisp_to_sockaddr_size) - (conv_lisp_to_sockaddr, set_socket_options) - (network_process_featurep, unwind_request_sigio): New helper - functions. - (Fprocess_datagram_address, Fset_process_datagram_address): - (Fset_network_process_options): New lisp functions. - (Fopen_network_stream): Removed. Now defined in simple.el. - (Fmake_network_process): New lisp function. Code is based on - previous Fopen_network_stream, but heavily reworked with new - property list based argument list, support for datagrams, server - processes, and local sockets in addition to old client-only - functionality. - (server_accept_connection): New function. - (wait_reading_process_input): Use it to handle incoming connects. - Do not enable input on a new connection if process is stopped. - (read_process_output): Handle datagram sockets. Use 2k buffer for - them. - (send_process): Handle datagram sockets. - (Fstop_process, Fcontinue_process): Apply to network processes. A - stopped network process is indicated by setting command field to t. - (Fprocess_send_eof): No-op if datagram connection. - (Fstatus_notify): Don't read input for a stream server socket or a - stopped network process. - (init_process): Initialize datagram_address array. - (syms_of_process): Intern and staticpro new variables, defsubr new - functions. - -2002-03-16 Jason Rumney <jasonr@gnu.org> - - * w32fns.c (w32_to_all_x_charsets): Return correct type in - startup case. - -2002-03-16 Richard M. Stallman <rms@gnu.org> - - * xdisp.c (redisplay_internal, redisplay_windows): - Use list_of_error to call internal_condition_case_1. - (safe_eval, safe_call): Pass Qt to internal_condition_case_{1,2} - so as to catch all errors with no possibility of debugger redisplay. - (list_of_error): New variable. - (syms_of_xdisp): Init and staticpro it. - - * print.c (print_object): Delete `\ ' from printed rep of frame. - -2002-03-15 Eli Zaretskii <eliz@is.elta.co.il> - - * msdos.c (dos_rawgetc): Disable the x-autoselect-window feature, - until its implementation is fixed. - -2002-03-14 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * xfns.c (png_load): Remove unused variable `gamma_str'. - -2002-03-14 Richard M. Stallman <rms@gnu.org> - - * xfns.c (x_real_positions): Handle failure in XQueryTree. - -2002-03-14 Miles Bader <miles@gnu.org> - - * intervals.c (adjust_for_invis_intang): New function. - (set_point_both): Use `adjust_for_invis_intang' to do most of the - work for dealing with invisible+intangible regions. Do so before - and after both forward and backward movements, to handle both - front-sticky and rear-sticky cases. - * textprop.c (text_property_stickiness): Function moved here from - `editfns.c'. - * intervals.h (text_property_stickiness): New declaration. - * editfns.c (char_property_eq): Function removed. - (text_property_stickiness): Function moved to `textprop.c'. - -2002-03-13 Jason Rumney <jasonr@gnu.org> - - * config.in: Add STRFTIME_NO_POSIX2. - - * strftime.c (my_strftime) [STRFTIME_NO_POSIX2]: Handle %h, %EX - and %OX when underlying strftime does not. - -2002-03-13 Stefan Monnier <monnier@cs.yale.edu> - - * xterm.c (x_set_toolkit_scroll_bar_thumb) <USE_MOTIF>: - Use a fixed-size thumb (based on an ad-hoc estimate of 30 chars per - line) to avoid annoying flicker. - (xm_scroll_callback): Get rid of the now unnecessary kludge. - (XTread_socket): Mark it static. - - * xdisp.c (display_mode_element): Fix int/Lisp_Object mixup. - -2002-03-13 Kim F. Storm <storm@cua.dk> - - * puresize.h (BASE_PURESIZE): Increase to 775000. - -2002-03-12 Juanma Barranquero <lektu@terra.es> - - * editfns.c (syms_of_editfns): Fix typo. - -2002-03-12 Gerd Moellmann <gerd@gnu.org> - - * xsmfns.c: Include stdio.h because termhooks.h needs it. - Include termopt.h for interrupt_input. - -2002-03-11 Andreas Schwab <schwab@suse.de> - - * coding.c (syms_of_coding) <file-coding-system-alist>: Doc fix. - -2002-03-11 Gerd Moellmann <gerd@gnu.org> - - * xterm.c (note_mouse_movement): Put code for - x_autoselect_window_p in #if 0. - - * lread.c (Fload): Don't assume that message_with_string uses the - string it is given like a C string. - -2002-03-10 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.h (x_session_check_input, x_session_initialize): Declare. - - * xterm.c (XTread_socket): Add call to x_session_check_input and - x_session_have_connection. - (x_initialize): Add call to x_session_initialize. - - * termhooks.h (enum event_kind): Add save_session_event. - - * keyboard.c: Add Emacs event save_session_event. - - * emacs.c (main): Add call to syms_of_xsmfns. - - * lisp.h (syms_of_xsmfns): Declare extern. - - * config.in: Add HAVE_X_SM. - - * Makefile.in (LIBXT): Add -lSM -lICE - if HAVE_X_SM and not USE_X_TOOLKIT. - (XOBJ): New file xsmfns.c added. - - * xsmfns.c: New file for X session management. - -2002-03-09 Jason Rumney <jasonr@gnu.org> - - * fileio.c (Fcopy_file) [WINDOWS_NT]: Ensure file is not - read-only when setting modified time. - -2002-03-08 Gerd Moellmann <gerd@gnu.org> - - * xdisp.c (move_it_vertically_backward): At the end of the function, - when moving forward by lines, treat terminal frames specially. - - * keyboard.c (echo_char): Make sure to add a separator between - keys even if echo_dash hasn't been called. - - * xdisp.c: Use new string macros. - (update_echo_area): Pass number of bytes to message3 instead of - number of chars. - (set_message_1): Don't access a string's size_byte directly. - (decode_mode_spec_coding): Use number of bytes of eoltype string - instead number of chars. - - * lisp.h (SREF, SDATA, SCHARS, SBYTES, SMBP): New macros. - -2002-03-08 Juanma Barranquero <lektu@terra.es> - - * w32fns.c (Fx_display_color_cells): Force 24+ bit color depths to - 24-bit. - -2002-03-06 Jason Rumney <jasonr@gnu.org> - - * w32term.c (x_draw_hollow_cursor): Draw same size as block cursor. - -2002-03-06 Gerd Moellmann <gerd@gnu.org> - - * keyboard.c (echo_prompt, echo_char, echo_dash, echo_now) - (cancel_echoing, echo_length, echo_truncate): Changed to - work with new kboard definition. - (echo_now): Use message3_nolog instead of message2_nolog. - - * alloc.c (mark_kboards): Mark echo_string. - - * keyboard.h (ECHOBUFSIZE): Removed. - (struct kboard): Member echoptr removed, member echobuf renamed - to echo_string. - - * xdisp.c (message_with_string): Use Fformat instead of doprnt and - message3 instead of message2 to display the message using STRING's - text properties. - -2002-03-05 Andreas Schwab <schwab@suse.de> - - * xdisp.c (hscroll_margin): Change to EMACS_INT. - -2002-03-05 Per Abrahamsen <abraham@dina.kvl.dk> - - * frame.c (default-frame-alist): Explain that setting it doesn't - affect existing frames. - -2002-03-05 Stefan Monnier <monnier@cs.yale.edu> - - * indent.c (skip_invisible): Fix my brain fart. - - * dispnew.c (sit_for): Don't wait if executing a kbd macro. - -2002-03-04 Stefan Monnier <monnier@cs.yale.edu> - - * dosfns.c, dosfns.h, dispnew.c, dispextern.h, commands.h, charset.c, - * alloc.c, abbrev.c, emacs.c, eval.c, keyboard.c, keyboard.h, - * lisp.h, lread.c, sysdep.c, termcap.c, termchar.h, w32term.c, - * window.c, xdisp.c, xselect.c, xterm.c: Change defvar_int definition - and variables to use EMACS_INT instead of just int. - - * buffer.c (syms_of_buffer): Allow non-string `mode-name'. - -2002-03-04 Eli Zaretskii <eliz@is.elta.co.il> - - * sysdep.c (sys_subshell) [MSDOS]: If PWD is set in the - environment, pass it down with corrected value. - -2002-03-04 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * lread.c (read_filtered_event): Do not call start_hourglass - before returning. - -2002-03-04 Juanma Barranquero <lektu@terra.es> - - * w32term.c (x_display_and_set_cursor): Fix typo. - -2002-03-03 Richard M. Stallman <rms@gnu.org> - - * fileio.c (Fmake_temp_name): Doc fix. - -2002-03-03 Gary Wong <gtw@gnu.org> - - * termcap.c [!emacs]: Replace ospeed for building standalone - libtermcap, for binary compatibility. - - * tparam.c [!emacs]: Move #define of bcopy to after string.h. - -2002-03-03 Richard M. Stallman <rms@gnu.org> - - * xrdb.c (file_p): Rename arg `path' to `filename'. - - * abbrev.c (Fexpand_abbrev): Increment plist as use count - only if it is an integer. - - * xfns.c (png_load): Set screen_gamma based on f->gamma. - If png_get_sRGB gives an answer, call png_set_gamma - using the default image gamma value. - - * lread.c (read1): When reading from a file, default string to - multibyte only if it has some multibyte characters. - - * print.c (print_object): Output multibyte chars 128...255 - using \x even if ! print_escape_multibyte. - - * xdisp.c (display_mode_element): Move the places where - bytepos, charpos, this, and lisp_string are set. - Use lisp_string to set bytepos. - - * xdisp.c (redisplay_internal): - Call clear_image_cache only if HAVE_WINDOW_SYSTEM. - - * xdisp.c (display_mode_element): Merge properties specified with - :propertize onto those that come with the string. - -2002-03-03 Eli Zaretskii <eliz@is.elta.co.il> - - * xdisp.c (syms_of_xdisp) <auto-hscroll-mode>: Renamed from - automatic-hscrolling. Users changed. - <hscroll-margin>: Renamed from automatic-hscroll-margin. - Users changed. - <hscroll-step>: Renamed from automatic-hscroll-step. Users changed. - -2002-03-02 Eli Zaretskii <eliz@is.elta.co.il> - - * buffer.c (syms_of_buffer) <buffer-file-coding-system>: Doc fix. - -2002-03-02 Kim F. Storm <storm@cua.dk> - - * window.c (Fminibuffer_selected_window): New function. - (syms_of_window): Defsubr it. - -2002-03-01 Kim F. Storm <storm@cua.dk> - - * window.h (struct window): New member phys_cursor_width. - - * window.c (make_window, replace_window): Init phys_cursor_width. - - * xterm.c (x_display_and_set_cursor): Blink box cursor using - hollow box cursor. Blink bar cursor using 1 pixel wide bar. - - * w32term.c (x_display_and_set_cursor): Blink box cursor using - hollow box cursor. Blink bar cursor using 1 pixel wide bar. - - * lisp.h (GCPRO6): New macro. - - * process.c (Fopen_network_stream): Use GCPRO6. - -2002-03-01 Kim F. Storm <storm@cua.dk> - - * process.c (Qconnect, Qfailed): New variables. - (syms_of_process): Intern and staticpro them. - (Fprocess_status): Document connect and failed return values. - [NON_BLOCKING_CONNECT]: New conditional. - (connect_wait_mask, num_pending_connects): New variables. - (status_message): Convert Qfailed status. - (Fopen_network_stream): Added support for non-blocking connect. - New optional args: filter, sentinel, non_blocking. Doc updated. - [HAVE_GETADDRINFO, !HAVE_GETADDRINFO]: Merged common code. - (deactivate_process): Handle pending non-blocking connect. - (wait_reading_process_input): Poll for status of non-blocking - connects. Exec sentinel directly when connect succeeds. - (status_notify): Don't read process output if not yet connected. - -2002-02-28 Kim F. Storm <storm@cua.dk> - - * window.c (minibuf_selected_window): Renamed from - Vminibuf_selected_window. Users changed. - (syms_of_window): Staticpro it. - -2002-02-26 Kim F. Storm <storm@cua.dk> - - The following changes add a new Vminibuf_selected_window variable - which is similar to Vminibuf_scroll_window, but which is only set - on entry to the minibuffer (from a non-minibuffer window): - - * window.c (Vminibuf_selected_window): New variable. - (struct save_window_data): New member minibuf_selected_window. - (Fset_window_configuration): Restore Vminibuf_selected_window. - (Fcurrent_window_configuration): Save Vminibuf_selected_window. - Set minibuf_scroll_window member to nil if minibuf_level is 0. - (compare_window_configurations): Compare minibuf_selected_window. - - * window.h (Vminibuf_selected_window): Declare extern. - - * minibuf.c (read_minibuf): Set Vminibuf_selected_window on first - entry to minibuffer or on entry from a non-minibuffer window. - - * dispextern.h (CURRENT_MODE_LINE_FACE_ID_3): Compare with - Vminibuf_selected_window instead of Vminibuf_scroll_window. - - * xdisp.c (init_iterator): Compare with Vminibuf_selected_window - instead of Vminibuf_scroll_window when deciding in which window - the region should be highlighted. Consequently, the region remains - highlighteded even when a completion buffer is also displayed. - -2002-02-26 Eli Zaretskii <eliz@is.elta.co.il> - - * fileio.c (Fsubstitute_in_file_name): Fix the change from 2002-02-08. - - * xselect.c (Qcompound_text_with_extensions): Renamed from - Qcompound_text_no_extensions. - (lisp_data_to_selection_data, syms_of_xselect): Use the new name. - -2002-02-26 Juanma Barranquero <lektu@terra.es> - - * w32proc.c (syms_of_ntproc): Doc fix. - -2002-02-24 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * intervals.h: Include "dispextern.h" unconditionally. - -2002-02-24 Jason Rumney <jasonr@gnu.org> - - * Makefile.in (WINNT_SUPPORT) [WINDOWSNT]: Add w32-vars.elc - and disp-table.elc. - (lisp): Add emacs-lisp/backquote.elc. - -2002-02-24 Kim F. Storm <storm@cua.dk> - - * keymap.c (Flookup_key): Fix problem in 2001-12-28 patch: - The validation of the event type was too strict as it didn't - allow string events; buffer names are used in bindings for - menu-bar-select-buffer (see `menu-bar-update-buffers'). - -2002-02-23 Kim F. Storm <storm@cua.dk> - - The following changes rework my patch of 2002-02-06 which - added command remapping by entering the commands directly into - the keymaps. Now, command remapping uses an explicit `remap' - prefix in the keymaps, i.e. [remap COMMAND]. - - * keymap.c (Qremap, remap_command_vector): New variables. - (is_command_symbol): Remove function. - (Fdefine_key): No longer accept a symbol for KEY. - Added validation of [remap COMMAND] argument for KEY. - The DEF is no longer required to be a symbol when remapping a command. - (Fremap_command): New function to remap command through keymaps. - (Flookup_key): Perform command remapping initiated by - Fremap_command directly for speed. - (Fkey_binding): Use Fremap_command for command remapping. - (where_is_internal): Handle new command remapping representation. - (syms_of_keymap): Intern Qremap, initialize remap_command_vector, - staticpro them. Defsubr Fremap_command. - - * keymap.h (Fremap_command): Declare extern. - (is_command_symbol): Remove extern. - - * keyboard.c (command_loop_1): Use Fremap_command for command - remapping; now try command remapping for all symbols. - -2002-02-23 Eli Zaretskii <eliz@is.elta.co.il> - - * coding.h (run_pre_post_conversion_on_str): Add prototype. - -2002-02-23 Jason Rumney <jasonr@gnu.org> - - * w32select.c (Fw32_set_clipboard_data): Run pre-write-conversion - on the string before encoding it. - (Fw32_get_clipboard_data): Run post-read-conversion on the string - after decoding it. - - * w32fns.c (w32_wnd_proc) <WM_TIMER>: Fix last change. - -2002-02-23 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * w32term.c (enter_timestamp): Remove unused static variable to - prevent warning. - - * xterm.c (enter_timestamp): Put in #if 0 to prevent warning. - -2002-02-23 Eli Zaretskii <eliz@is.elta.co.il> - - * w16select.c (Fw16_get_clipboard_data): Fix last change. - - * xselect.c (selection_data_to_lisp_data): Fix last change. - -2002-02-22 Jason Rumney <jasonr@gnu.org> - - * w32term.h (struct w32_output): New member menu_command_in_progress. - - * w32menu.c (menubar_selection_callback): Free the menu and - clear the menu_command_in_progress flag. - - * w32fns.c (mouse_move_timer, mouse_button_timer): Initialize. - (menu_free_timer): New variable. - (MENU_FREE_ID, MENU_FREE_DELAY): New constants. - (w32_wnd_proc) <WM_TIMER>: Handle menu_free_timer. - <WM_EXITMENULOOP>: Delay before freeing menu. Do nothing if a - menu command is in progress. - <WM_COMMAND>: Set the menu_command_in_progress flag. - Kill any menu_free_timer that is running. - - * w32term.c (w32_text_out): Renamed from W32_TEXTOUT. - Call ExtTextOutA rather than ExtTextOut. - -2002-02-22 Eli Zaretskii <eliz@gnu.org> - - * puresize.h (BASE_PURESIZE): Increase to 755000. - -2002-02-22 Eli Zaretskii <eliz@is.elta.co.il> - - * w16select.c (Fw16_set_clipboard_data): Run pre-write-conversion - on the string before encoding it. - (Fw16_get_clipboard_data): Run post-read-conversion on the string - after decoding it. - -2002-02-22 Eli Zaretskii <eliz@is.elta.co.il> - - Support for ICCCM Extended Segments in X selections: - - * xselect.c <Qcompound_text_no_extensions>: New variable. - (syms_of_xselect): Intern and staticpro it. - (selection_data_to_lisp_data): Run post-read-conversion on decoded - selection text. - (lisp_data_to_selection_data): If next-selection-coding-system is - compound-text-no-extensions, set the type of selection to be - compound-text. - - * xterm.h (x_encode_text): Update prototype. - - * xfns.c (x_encode_text): Accept additional arg SELECTIONP; all - callers changed. If SELECTIONP is non-zero, run the - pre-write-conversion function before encoding the selection text. - -2002-02-21 Kim F. Storm <storm@cua.dk> - - * frame.c (syms_of_frame): Change mouse-highlight default to t. - - * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]: - Correct composing of language-change event. - -2002-02-20 Kim F. Storm <storm@cua.dk> - - * keyboard.c (menu_bar_items): Don't include keymap or local-map - bindings at PT when building menu (the menu is not updated often - enough for this to work reliable). - (tool_bar_items): Likewise. - (current_active_maps): Removed unused (and buggy) function. - -2002-02-20 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * xfns.c (gif_load): Use correct width and height for GIF images. - -2002-02-19 Eli Zaretskii <eliz@is.elta.co.il> - - * floatfns.c (Fatan): Accept an optional second arg and call - atan2 if passed 2 args. - -2002-02-18 Jason Rumney <jasonr@gnu.org> - - * w32term.c (glyph_rect): Determine the row and glyph more precisely. - -2002-02-17 Jason Rumney <jasonr@gnu.org> - - * w32term.c (x_autoselect_window_p): New variable. - (syms_of_w32term): DEFVAR_BOOL and initialize it. - (note_mouse_movement): Use it. - - * w32fns.c (w32_load_system_font): Never set fonts_changed_p to zero. - - * w32bdf.c (w32_load_bdf_font): Maybe set fonts_changed_p. - - * w32fns.c (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): - New variables. - (syms_of_w32fns): Intern and staticpro them. - (x_frame_parms) <"fullscreen">: New parameter. - (x_fullscreen_move, x_set_fullscreen): New functions. - (x_set_frame_parameters): Support Qfullscreen. - (x_real_positions): Save x/y_pixels_diff frame params. - (x_figure_window_size): Support full-screen frames. - (Fx_create_frame): Default the fullscreen parameter. - - * w32term.c (x_check_fullscreen, x_check_fullscreen_move) - (x_fullscreen_adjust): New functions. - (w32_read_socket) <WM_WINDOWPOSCHANGED>: Don't resize to - fullscreen. Call x_check_fullscreen_move, and set the - want_fullscreen member of output_data.w32 - <WM_ACTIVATE, WM_ACTIVATEAPP>: Call x_check_fullscreen. - - * w32term.h: New enum for FULLSCREEN_* constants. - (struct w32_output): New members want_fullscreen, x_pixels_diff, - y_pixels_diff, x_pixels_outer_diff, and y_pixels_outer_diff. - (x-fullscreen-adjust): New prototype. - -2002-02-17 Kim F. Storm <storm@cua.dk> - - * frame.c (Vmouse_highlight): New variable. - (syms_of_frame): DEFVAR_LISP it. - - * frame.h (Vmouse_highlight): Declare extern. - - * xterm.h (struct x_display_info): Add mouse_face_hidden. - - * xterm.c (disable_mouse_highlight): Removed variable. - (note_mouse_highlight): Don't highlight if Vmouse_highlight is nil. - (show_mouse_face): Don't show highlight if mouse_face_hidden is set. - (XTread_socket): Turn mouse_face_hidden off after mouse movement, - and on after keyboard input. - (x_term_init): Initialize mouse_face_hidden. - - * msdos.h (struct display_info): Add mouse_face_hidden. - - * msdos.c (disable_mouse_highlight): Removed variable. - (show_mouse_face): Don't show highlight if mouse_face_hidden is set. - (IT_note_mouse_highlight): Don't highlight if Vmouse_highlight is nil. - (internal_terminal_init): Initialize mouse_face_hidden. - (dos_rawgetc): Turn mouse_face_hidden off after mouse movement, - and on after keyboard input. - - * w32term.h (struct w32_display_info): Add mouse_face_hidden. - - * w32term.c (disable_mouse_highlight): Removed variable. - (note_mouse_highlight): Disable highlight if Vmouse_highlight is nil. - (show_mouse_face): Don't show highlight if mouse_face_hidden is set. - (w32_read_socket): Turn mouse_face_hidden off after mouse movement, - and on after keyboard input. - (w32_initialize_display_info): Initialize mouse_face_hidden. - -2002-02-16 Eli Zaretskii <eliz@is.elta.co.il> - - * msdos.c (last_mouse_window): New variable. - (dos_rawgetc): Fix last change--if the mouse is in the same window - as recorded in last_mouse_window, don't select this window. - - * Makefile.in (lisp, shortlisp): Use cus-start.elc, not cus-start.el. - - * msdos.c (x_autoselect_window_p): New variable. - (syms_of_msdos): Defvar it. - (dos_rawgetc): If x_autoselect_window_p is set, select the window in - which the last mouse movement occured, unless it is already selected. - - * xdisp.c (automatic_hscroll_margin, Vautomatic_hscroll_step): - New variables. - (syms_of_xdisp): DEVFAR them. - (hscroll_window_tree): Use automatic_hscroll_margin and - Vautomatic_hscroll_step to compute the amount of window scrolling. - -2002-02-16 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * xterm.c (x-autoselect-window): New variable. - (note_mouse_movement): Use it. - - * keyboard.c: Do not include "systime.h" twice. - -2002-02-15 Andreas Schwab <schwab@suse.de> - - * puresize.h (PURESIZE_RATIO): Increase to 9/5. - - * alloc.c (NSTATICS): Increase to 1280. - -2002-02-15 Kai Gro,A_(Bjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> - - * alloc.c (NSTATICS): Bump to 1026. - - * xterm.c (Vx_alt_keysym, Vx_hyper_keysym, Vx_meta_keysym) - (Vx_super_keysym): New variables. - (syms_of_xterm): DEFVAR_LISP them. - (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Use the - variables to determine which keys to use for the various modifiers. - -2002-02-13 Kim F. Storm <storm@cua.dk> - - * window.c (Vmode_line_in_non_selected_windows): Removed. - (mode_line_in_non_selected_windows): New variable. - (syms_of_window): DEFVAR_BOOL it. - - * dispextern.h (CURRENT_MODE_LINE_FACE_ID_3): - Use mode_line_in_non_selected_windows. - (mode_line_in_non_selected_windows): Declare extern. - (Vmode_line_in_non_selected_windows): Removed extern. - -2002-02-13 Richard M. Stallman <rms@gnu.org> - - * keyboard.c (Fthis_command_keys, Fthis_command_keys_vector) - (Fthis_single_command_keys, Fthis_single_command_raw_keys) - (Fclear_this_command_keys): Doc fixes. - - * xfaces.c (Finternal_make_lisp_face, Finternal_copy_lisp_face) - (update_face_from_frame_parameter): Increment face_change_count - and windows_or_buffers_changed to force redisplay using changed faces. - - * xdisp.c (QCpropertize): New variable. - (mode_line_proptrans_alist): New variable. - (display_mode_element): New arg PROPS; all calls changed. - Implement this, for strings. - Handle literal output of strings by sharing the - main-line code for strings, using local var `literal'. - Handle :propertize feature. - (syms_of_xdisp): Initialze and staticpro QCpropertize and - mode_line_proptrans_alist. - -2002-02-11 Kim F. Storm <storm@cua.dk> - - * window.c (Vmode_line_in_non_selected_windows): New variable. - (syms_of_window): DEFVAR_LISP it. - - * dispextern.h (CURRENT_MODE_LINE_FACE_ID_3): New macro. - (CURRENT_MODE_LINE_FACE_ID): Use it. - (Vmode_line_in_non_selected_windows): Declare extern. - - * xdisp.c (display_mode_lines): Use CURRENT_MODE_LINE_FACE_ID_3 - to get mode line face. - -2002-02-11 Eli Zaretskii <eliz@is.elta.co.il> - - * msdos.c (Vx_bitmap_file_path, x_stretch_cursor_p): Remove these - variables; cus-start.el doesn't need them anymore. - -2002-02-09 Kim F. Storm <storm@cua.dk> - - * insdel.c (make_gap_smaller): Preserve BEG_UNCHANGED during gap - reduction. This fixes a display problem where stray newlines were - inserted in the window (corrected by C-l). Clarified code (IMHO). - -2002-02-09 Eli Zaretskii <eliz@is.elta.co.il> - - * dispextern.h (CURRENT_MODE_LINE_FACE_ID): Fix last change. - - * xdisp.c (display_mode_lines): Fix last change. - -2002-02-09 Jason Rumney <jasonr@gnu.org> - - * w32fns.c (enum_font_cb2): Don't let charsets unknown to Windows - match each other. - (w32_load_system_font): Prevent Cleartype fonts from loading. - (Fx_show_tip): Ensure tip frames are above other topmost windows. - -2002-02-09 Kim F. Storm <storm@cua.dk> - - * dispextern.h (CURRENT_MODE_LINE_FACE_ID): New macro. - (CURRENT_MODE_LINE_HEIGHT): Use it. - (enum face_id): Add MODE_LINE_INACTIVE_FACE_ID. - - * xdisp.c (window_box_height): Use CURRENT_MODE_LINE_FACE_ID. - (pos_visible_p, handle_face_prop): Likewise. - (display_mode_lines): Likewise, but for the real selected window. - (init_iterator) [row == NULL]: Handle MODE_LINE_INACTIVE_FACE_ID. - - * xfaces.c (Qmode_line_inactive): New face variable for mode-line - in non-selected windows. - (realize_basic_faces): Realize it. - (syms_of_term): Intern and staticpro it. - -2002-02-08 Kim F. Storm <storm@cua.dk> - - * alloc.c (SETJMP_WILL_LIKELY_WORK, SETJMP_WILL_NOT_WORK): - Changed mail addresses to emacs-devel@gnu.org. - -2002-02-08 Eli Zaretskii <eliz@is.elta.co.il> - - * fileio.c (Fsubstitute_in_file_name): If the file name includes - ~user, and there's no such user, don't discard everything before ~user. - - * floatfns.c (Fround): Doc fix. - -2002-02-08 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * sysdep.c (init_system_name): Put unused variable `p' in #if 0. - -2002-02-07 Stefan Monnier <monnier@cs.yale.edu> - - * lisp.h (Fx_file_dialog): Add extern decl (used in fileio.c). - -2002-02-07 Kim F. Storm <storm@cua.dk> - - * keymap.c (where_is_internal): Only check whether definition is - remapped if it fulfills is_command_symbol. - -2002-02-07 Andreas Schwab <schwab@suse.de> - - * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT): Define to 2 for m68k. - - * alloc.c (mark_stack): Don't assume sizeof (Lisp_Object) is 4. - -2002-02-06 Kim F. Storm <storm@cua.dk> - - * keymap.c (Fdefine_key): Allow symbol as KEY argument for - defining command remapping. Doc updated. - (Flookup_key): Remap command through keymap if KEY is a symbol. - (is_command_symbol): New function. - (Fkey_binding): Use it. New optional argument NO-REMAP. - Doc updated. Callers changed. Perform command remapping via - recursive call unless that arg is non-nil. - (where_is_internal): New argument no_remap. Callers changed. - Call recursively to find original key bindings for a remapped - comand unless that arg is non-nil. - (Fwhere_is_internal): New optional argument NO-REMAP. - Doc updated. Callers changed. Pass arg to where_is_internal. - - * keymap.h (Fkey_binding, Fwhere_is_internal): Update prototype. - (is_command_symbol): Add prototype. - - * keyboard.c (Vthis_original_command): New variable. - (syms_of_keyboard): DEFVAR_LISP it. - (command_loop_1): Set it, and perform command remapping. - -2002-02-06 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * keyboard.c (recursive_edit_1): Call cancel_hourglass unconditionally. - -2002-02-06 Jason Rumney <jasonr@gnu.org> - - * w32term.c (w32_native_per_char_metric): Disable 2002-01-20 change. - -2002-02-06 Eli Zaretskii <eliz@is.elta.co.il> - - * charset.c (get_charset_id): Use if-else instead of ?:. - -2002-02-06 Richard M. Stallman <rms@gnu.org> - - * filelock.c (S_ISLNK): Define if not defined. - -2002-02-03 Richard M. Stallman <rms@gnu.org> - - * fileio.c (Fdo_auto_save): Improve "auto save disabled" msg. - - * lread.c (read1): Redesign strategy for force_multibyte and - force_singlebyte. Now is_multibyte records whether read_buffer - is multibyte. Encountering any multibyte character makes it so. - -2002-02-02 Stefan Monnier <monnier@cs.yale.edu> - - * term.c (term_get_fkeys_1): If `k0' and `k;' are both specified and - with the same sequence, map that sequence to f10 rather than f0. - -2002-02-03 Andreas Schwab <schwab@suse.de> - - * s/gnu-linux.h: Check for __mc68000__ instead of __m68k__, the - latter never being defined on GNU/Linux. - -2002-02-02 Eli Zaretskii <eliz@is.elta.co.il> - - * xfaces.c (realize_default_face): Don't set the weight and slant of - the default face to Qnormal, unless these attributes are unspecified. - -2002-02-02 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * keyboard.c (command_loop_1) [HAVE_X_WINDOWS]: - Call cancel_hourglass unconditionally. - - * eval.c (Fsignal): Remove duplicated declaration of - the variable `display_hourglass_p'. - -2002-01-31 Richard M. Stallman <rms@gnu.org> - - * editfns.c (region_limit): Nicer error message. - - * coding.c (decode_composition_emacs_mule): - Give up if NCOMPONENT gets too large to index `component'. - - * callint.c (check_mark): New arg to specify clearer error message. - Callers changed. - -2002-01-27 Richard M. Stallman <rms@gnu.org> - - * minibuf.c (Fcompleting_read): Doc fix. - -2002-01-27 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * minibuf.c (Fread_from_minibuffer, Fread_command, Fread_function) - (Fread_variable, Fread_buffer, minibuffer-completion-confirm): - Fix doc-strings. - -2002-01-26 Richard M. Stallman <rms@gnu.org> - - * buffer.c (syms_of_buffer): Doc fixes for scroll-...-aggressively. - - * xdisp.c (try_scrolling): Exchange uses of scroll_down_aggressively - and scroll_up_aggressively. - -2002-01-26 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * keyboard.c (parse_tool_bar_item): Remove duplicated prototypes. - -2002-01-25 Stefan Monnier <monnier@cs.yale.edu> - - * textprop.c (Fnext_property_change, Fnext_single_property_change) - (Fprevious_property_change, Fprevious_single_property_change): - Stay within the narrowed-buffer boundaries. - -2002-01-25 Eli Zaretskii <eliz@is.elta.co.il> - - * term.c (Ftty_display_color_cells): New function. - (syms_of_term): Defsubr it. - (Ftty_display_color_cells, Ftty_display_color_p): Change the - argument name to DISPLAY. Doc fix. - - * dispextern.h: Add prototype for set_tty_color_mode and - tty_setup_colors. - -2002-01-24 Jason Rumney <jasonr@gnu.org> - - * w32term.c (x_scroll_run): Use ScrollWindowEx in place of BitBlt. - If region left to draw is not what was expected, mark the frame as - garbaged. - - * w32fns.c (w32_wnd_proc) <WM_PAINT>: Initialize update_rect. - Combine the regions returned by BeginPaint and GetUpdateRect. - -2002-01-23 Jason Rumney <jasonr@gnu.org> - - * w32term.c (x_update_window_begin): Only hide caret if - w32_use_visible_system_caret is set. - (x_update_window_end): Only show caret if - w32_use_visible_system_caret is set. - (syms_of_w32term): Handle SystemParametersInfo call failing. - - * w32fns.c (syms_of_w32fns): Initialize w32_visible_system_caret_hwnd. - -2002-01-22 Richard M. Stallman <rms@gnu.org> - - * unexelf.c (unexec): Define n so as to cause compilation error - for the code where people have often written n instead of nn. - - * .gdbinit (hookpost-run): Defined. - -2002-01-22 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xfns.c (x_set_frame_parameters): Typo in previous fix corrected. - -2002-01-21 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xfns.c (x_set_frame_parameters): Just call x_fullscreen_adjust - if fullscreen is being set. - -2002-01-21 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * minibuf.c (Fminibuffer_contents) - (Fminibuffer_contents_no_properties, Fread_from_minibuffer) - (Fread_string, Fread_no_blanks_input, Fcompleting_read): Doc fixes. - -2002-01-21 Richard M. Stallman <rms@gnu.org> - - * window.c (check_frame_size): Fix minimum height calculation. - -2002-01-20 Ken Raeburn <raeburn@gnu.org> - - * dispextern.h (WINDOW_WANTS_MODELINE_P): Use XFASTINT on window - height before comparison. - (WINDOW_WANTS_HEADER_LINE_P): Likewise. - -2002-01-20 Jason Rumney <jasonr@gnu.org> - - * w32term.c (w32_system_caret_width): Remove. - (w32_use_visible_system_caret): New user flag. - (syms_of_w32term): DEFVAR_BOOL it. Initialize based on whether - Windows reports a screen reader running. - (x_update_window_begin): Hide the system caret. - (x_update_window_end): Show the system caret. - (x_display_and_set_cursor): Don't draw a cursor when - w32_use_visible_system_caret is set. Do not adjust width. - - * w32fns.c (w32_visible_system_caret_hwnd): New static variable. - (w32_wnd_proc) <WM_KILL_FOCUS, WM_EMACS_DESTROY_CARET>: Set it. - <WM_EMACS_TRACK_CARET>: Arrange for system caret to be visible if - the user requests it. Use system default width when creating. - <WM_EMACS_HIDE_CARET, WM_EMACS_SHOW_CARET>: Handle new messages. - - * w32term.h (WM_EMACS_SHOW_CARET, WM_EMACS_HIDE_CARET): - New window messages. - -2002-01-20 Richard M. Stallman <rms@gnu.org> - - * window.c (MIN_SAFE_WINDOW_HEIGHT): Value now 1. - -2002-01-20 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * doprnt.c (doprnt1): Fix typos in error call. - -2002-01-20 Eli Zaretskii <eliz@is.elta.co.il> - - * unexelf.c (unexec) [__sgi]: Support the .got sections. - -2002-01-20 Jason Rumney <jasonr@gnu.org> - - * w32term.c (w32_native_per_char_metric): Don't trust the metrics - that Windows returns. If a double check fails, try to guess how - ExtTextOut is going to act. - - * w32fns.c (w32_load_system_font, w32_to_x_charset): Use strnicmp - in place of stricmp. - (w32_list_synthesized_fonts): Removed. - (w32_to_all_x_charsets, enum_font_maybe_add_to_list): New functions. - (struct enumfont_t): New element; list. - (enum_font_cb2): List all style and charset variations of a font. - (Fw32_select_font): New optional argument; include_proportional. - Exclude vertical fonts. Exclude proportional fonts unless - include_proportional is non-nil. - (w32_enable_synthesized_fonts): Change to a boolean. - (Fw32_send_sys_command): Doc fix. - -2002-01-19 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * dispnew.c (update_frame): Move the variable `tem' to the block - where it is used. - -2002-01-19 Jason Rumney <jasonr@gnu.org> - - * w32fns.c (Fx_create_frame): Bind redisplay-dont-pause around - call to face-set-after-frame-default. - -2002-01-18 Richard M. Stallman <rms@gnu.org> - - * dispextern.h (WINDOW_WANTS_MODELINE_P): Check window height > 1. - (WINDOW_WANTS_HEADER_LINE_P): Check window height provides room. - -2002-01-17 Richard M. Stallman <rms@gnu.org> - - * window.c (enlarge_window): When exceeding size of parent, - directly delete all the siblings instead of trying to resize it. - -2002-01-17 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * term.c (set_tty_color_mode): Remove unused variable `tem'. - -2002-01-16 Henrik Enberg <henrik@enberg.org> - - * lread.c (init_lread): Move the installed-lisp dirs later in the path. - -2002-01-16 Kim F. Storm <storm@cua.dk> - - * xterm.c (x_erase_phys_cursor): Don't erase cursor if cursor row - is invisible. This can happen if cursor is on top line of a - window, and we switch to a buffer with a header line. - - * w32term.c (x_erase_phys_cursor): Ditto. - -2002-01-16 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * xterm.c (XTread_socket) [!USE_X_TOOLKIT]: Compute the value of - `dont_resize' only when used. - - * xdisp.c: Remove forgotten extern declaration of `Qimage'. - -2002-01-15 Eli Zaretskii <eliz@is.elta.co.il> - - * xdisp.c (display_mode_element): When computing charpos, depend - on multibyteness of elt, not the text in field. - -2002-01-15 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * buffer.c (Fkill_all_local_variables): - Increment `update_mode_lines' only once. - -2002-01-14 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * lisp.h (adjust_after_replace_noundo) - (Fupdate_coding_systems_internal): Add prototypes. - - * sound.c (Fplay_sound): Initialize header_size also for :data case. - -2002-01-14 Eli Zaretskii <eliz@is.elta.co.il> - - Support for the --color command-line argument and tty-color-mode - frame parameter: - - * term.c (tty_default_color_capabilities, tty_setup_colors) - (set_tty_color_mode): New functions. - (term_init): Call tty_default_color_capabilities. - (Qtty_color_mode_alist): New variable. - (syms_of_term): Intern and staticpro it. - - * frame.c (store_frame_param): Call set_tty_color_mode for termcap - frames. - (do_switch_frame): For termcap frames, switch the tty - color mode as specified by the frame's parameters. - (Qtty_color_mode): New variable. - (syms_of_frame): Intern and staticpro it. - - * emacs.c (USAGE2): Add the --color option. - (standard_args): Ditto. - -2002-01-13 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - - * xterm.h (struct x_output): New members want_fullscreen, - x_pixels_diff, y_pixels_diff, x_pixels_outer_diff, and - y_pixels_outer_diff. - New enum for FULLSCREEN_* constants. - (FRAME_OUTER_WINDOW): Handle the case where output_data.x->widget - is NULL. - (x_fullscreen_adjust): Add prototype. - - * emacs.c (USAGE2): Add the new full-screen arguments. - (standard_args): Ditto. - - * xfns.c (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): - New variables. - (syms_of_xfns): Intern and staticpro them. - (x_frame_parms) <"fullscreen">: New parameter. - (x_fullscreen_move, x_set_fullscreen): New functions. - (x_set_frame_parameters): Support for Qfullscreen. - (x_real_positions): More accurate computation of the frame position. - (x_figure_window_size): Support full-screen frames. - (Fx_create_frame): Default the fullscreen parameter. - - * xterm.c (x_check_fullscreen, x_fullscreen_adjust): New functions. - (XTread_socket) <Expose>: Call x_check_fullscreen. - <ConfigureNotify>: Don't resize to fullscreen. - Call x_check_fullscreen_move, and set the want_fullscreen member of - output_data.x. - -2002-01-13 Jason Rumney <jasonr@gnu.org> - - * w32term.h (WM_XBUTTONDOWN, WM_XBUTTONUP): New window messages - for mice with more than 3 buttons. - - * w32term.c (parse_button): New parameter xbutton. Callers changed. - (w32_read_socket): Handle new "XBUTTON" messages. - - * w32fns.c (w32_pass_extra_mouse_buttons_to_system): New user option. - (syms_of_w32fns): DEFVAR_BOOL it. - (w32_wnd_proc): Handle new "XBUTTON" messages. - -2002-01-13 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * keyboard.c (read_key_sequence): Remove unused variable `extra_maps'. - -2002-01-13 Andreas Schwab <schwab@suse.de> - - * xterm.c (x_load_font): Never set fonts_changed_p to zero. - -2002-01-12 Andreas Schwab <schwab@suse.de> - - * .gdbinit (xbuffer): Remove address operator since data is now a - pointer. - -2002-01-11 Richard M. Stallman <rms@gnu.org> - - * insdel.c (adjust_after_replace_noundo): New function. - - * coding.c (code_convert_region): Don't copy old text if undo disabled. - -2002-01-09 Jason Rumney <jasonr@gnu.org> - - * xdisp.c (x_consider_frame_title): Don't count the tooltip frame - when checking for multiple frames. - -2002-01-08 Richard M. Stallman <rms@gnu.org> - - * window.c (delete_window): Rewrite the code for changing the - selected window to handle the case where WINDOW is not a leaf. - -2002-01-07 Eli Zaretskii <eliz@is.elta.co.il> - - * process.c (send_process): Set src_multibyte to 1 after the call - top setup_coding_system, not before the call. - -2002-01-07 Jason Rumney <jasonr@gnu.org> - - * xmenu.c (set_frame_menubar, xmenu_show): - (xdialog_show): Initialize wv->help to Qnil. - - * w32menu.c (single_submenu, set_frame_menubar, w32_menu_show): - (w32_dialog_show): Initialize wv->help to Qnil. - -2002-01-06 Jason Rumney <jasonr@gnu.org> - - * xmenu.c (single_submenu): Initialize wv->help to Qnil. - - * w32menu.c (w32_menu_display_help): Revert last change. - - * xmenu.c (menu_highlight_callback): Revert last change. - -2002-01-06 Andreas Schwab <schwab@suse.de> - - * insdel.c (make_gap_larger): Make sure buffer size does not - overflow range of int. - -2002-01-05 Jason Rumney <jasonr@gnu.org> - - * w32term.c (x_draw_glyphs): Don't call notice_overwritten_cursor if - OVERLAPS_P. - - * w32menu.c (w32_menu_display_help): Hide any tooltip window. - - * w32fns.c (compute_tip_xy): If tooltip won't fit on the screen - to the left or to the right of the pointer, put it against - the left screen edge. - (x_frame_parms): Add missing braces around initializer. - - * w32term.c (x_setup_relief_colors): Don't compute an image's - background color if it doesn't have a Pixmap. - (notice_overwritten_cursor): Don't depend on - output_cursor and updated_area. Compare pixel coordinates with - window's cursor pixel coordinates. - (x_draw_glyphs, x_clear_end_of_line, show_mouse_face): - Call notice_overwritten_cursor with new arg list. - (show_mouse_face): Fix bug setting a row's mouse_face_p flag - unconditionally. - (x_draw_image_relief): Use predefined macro instead of - constant when the value of `tool_bar_button_relief' is negative. - - * w32term.c (x_display_and_set_cursor): Fix PostMessage arg types. - -2002-01-04 Richard M. Stallman <rms@gnu.org> - - * xmenu.c (menu_highlight_callback): Hide any tooltip window. - -2002-01-03 Richard M. Stallman <rms@gnu.org> - - * keymap.c (Fcurrent_active_maps): Put the `keymap' property map first. - (Fkey_binding): Try the `keymap' property map first. - (Fdescribe_buffer_bindings): Show `keymap' property bindings before - minor mode bindings. - -2002-01-03 Kim F. Storm <storm@cua.dk> - - * keyboard.c (read_key_sequence): Fix cast of submaps arg to bcopy. - -2002-01-02 Richard M. Stallman <rms@gnu.org> - - * keyboard.c (read_key_sequence): Handle the keymap property - before minor mode maps. - - * editfns.c (Fformat): Update thissize from field_width - based on the actual width, in the string case. - -2002-01-01 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * charset.h (UNIBYTE_STR_AS_MULTIBYTE_P): Parenthesize assignment - when used as truth value to prevent gcc warnings. - - * sysdep.c, unexapollo.c, w32.c, w32bdf.c, w32heap.c, w32inevt.c, - * w32proc.c: Include <config.h>. - -2002-01-01 Andreas Schwab <schwab@suse.de> - - * eval.c (max_specpdl_size, max_lisp_eval_depth): Define as int, - not EMACS_INT, to make them compatible with DEFVAR_INT. - * lisp.h (max_specpdl_size): Adjust declaration. - -2002-01-01 Richard M. Stallman <rms@gnu.org> - - * print.c (print_object): Test print_escape_nonascii only for - unibyte strings. - (PRINTPREPARE): Once again bind Qprint_escape_nonascii - when outputting to a multibyte buffer. - -2001-12-29 Richard M. Stallman <rms@gnu.org> - - * print.c (print_object): In multibyte string, use hex escapes. - Use octal only for unibyte strings. - (PRINTPREPARE): Don't ever set Qprint_escape_nonascii. - - * lread.c (read_escape): New arg BYTEREP for reporting whether - escape forces unibyte or multibyte. - (read1): When reading a string, take note of that info. - -2001-12-29 Ken Raeburn <raeburn@gnu.org> - - * abbrev.c (Fexpand_abbrev): Use NILP instead of implicit zero - comparison to test lisp value returned by Fget. - -2001-12-29 Richard M. Stallman <rms@gnu.org> - - * lisp.h (max_specpdl_size): Add declaration. - - * fileio.c (Fdo_auto_save): If NO_MESSAGE, don't call push_message. - - * keymap.c (silly_event_symbol_error): New subrtn, from Fdefine_key. - Handle modifier bits. Correct typo in error message. - -2001-12-28 Richard M. Stallman <rms@gnu.org> - - * abbrev.c: Use the plist of an abbrev for multiple params if nec. - (Fdefine_abbrev): New arg SYSTEM-FLAG for a system abbrev. - (Fdefine_global_abbrev, Fdefine_mode_abbrev): - Update calls to Fdefine_abbrev. - (write_abbrev): Update for changed data format. - Don't list "system" abbrevs. - (Fexpand_abbrev): Update use count with new data format. - (describe_abbrev): Update for changed data format. - (Fdefine_abbrev_table): Handle the new SYSTEM-FLAG. - - * config.in (HAVE_MBSINIT): Add #undef. - - * strftime.c (mbsinit): Define as no-op if not available. - - * s/sco5.h (LIBX11_SYSTEM) [MOTIF]: Add -lgen. - (sigprocmask_set): Conditionalize decl on ! NOT_C_CODE. - - * keymap.c (Flookup_key): Error message if key has wrong data type. - (Fdefine_key): Add error message for trying to bind [DEL], [RET], etc. - (exclude_key): New variable. - -2001-12-28 Gerd Moellmann <gerd@gnu.org> - - * xterm.c (x_setup_relief_colors): Don't compute an image's - background color if it doesn't have a Pixmap. - - * xterm.c (notice_overwritten_cursor): Don't depend on - output_cursor and updated_area. Compare pixel coordinates with - window's cursor pixel coordinates. - (x_draw_glyphs, x_clear_end_of_line, show_mouse_face): - Call notice_overwritten_cursor with new arg list. - (show_mouse_face): Fix bug setting a row's mouse_face_p flag - unconditionally. - - * xdisp.c (try_scrolling) <PT below scroll margin>: Add the - height of the cursor line to the amount to scroll. - -2001-12-27 Richard M. Stallman <rms@gnu.org> - - * intervals.c (set_point_both): The position after an invisible, - intangible character is not an acceptable stopping point. - -2001-12-27 Ken Raeburn <raeburn@gnu.org> - - * window.c (enlarge_window): In new preserve_before code, convert - CURBEG from lisp object to integer before doing arithmetic. - -2001-12-27 Richard M. Stallman <rms@gnu.org> - - * bytecode.c (Fbyte_code): Undo previous change. - -2001-12-26 Kim F. Storm <storm@cua.dk> - - * keyboard.c (record_char): Ignore duplicate help-echo events only - separated by mouse-movement. When tracking mouse, only record - first and last mouse-movement event in same window. - Don't record mouse-movement events in keyboard macros. - -2001-12-25 Richard M. Stallman <rms@gnu.org> - - * window.c (enlarge_window): New arg PRESERVE_BEFORE. Callers changed. - (Fenlarge_window): New arg PRESERVE_BEFORE. - - * bytecode.c (Fbyte_code): Use Fstring_make_unibyte - instead of Fstring_as_unibyte. - -2001-12-22 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - The following changes remove mocklisp support: - - * mocklisp.h, mocklisp.c: Files removed. - - * lisp.h: Remove declarations of variables `Vmocklisp_arguments', - `Qmocklisp' and `Qmocklisp_arguments'. - Remove prototype of syms_of_mocklisp. - - * makefile.nt, makefile.w32-in, Makefile.in: Remove mocklisp files. - - * callint.c: Do not include mocklisp.h. - (Fcall_interactively): Do not test for mocklisp case. - - * eval.c: Remove variables `Qmocklisp_arguments', - `Vmocklisp_arguments' and `Qmocklisp'. Remove prototype of ml_apply. - (Fprogn, Fwhile, Fcommandp, Feval, Ffuncall, funcall_lambda): - Do not test for mocklisp case. - (Fwhile): Remove unused variable `tem'. - (syms_of_eval): Remove variable `moclisp-arguments'. - - * data.c (wrong_type_argument): Remove mocklisp case. - - * doc.c (Fdocumentation): Remove mocklisp case. - - * emacs.c (main): Do not call syms_of_mocklisp. - -2001-12-21 Richard M. Stallman <rms@gnu.org> - - * xfns.c (compute_tip_xy): If tooltip won't fit on the screen - to the left or to the right of the pointer, put it against - the left screen edge. - -2001-12-21 Eli Zaretskii <eliz@is.elta.co.il> - - * Makefile.in (distclean): Remove .gdbinit if we are building - outside the source tree. - -2001-12-19 Eli Zaretskii <eliz@is.elta.co.il> - - * w32.c (emacs_root_dir): New function. - - * msdos.c (emacs_root_dir): New function. - - * fileio.c (Fexpand_file_name) [DOS_NT]: Use the root directory - of the current drive as the fallback for default_directory. - - * dired.c (file_name_completion): Run the elements of - completion-ignored-extensions through ENCODE_FILE. - - * lisp.h (scmp): Remove prototype, since it's now a static - function private to dired.c. - -2001-12-18 Richard M. Stallman <rms@gnu.org> - - * dired.c (scmp): Function moved from minibuf.c. - Delete multibyte handling--used only on encoded strings. - - * minibuf.c (scmp): Function moved to dired.c. - - * fns.c (merge): Add QUIT call. - -2001-12-18 Dave Love <fx@gnu.org> - - * Makefile.in (lisp, shortlisp): Add language/utf-8-lang.el, - language/georgian.el. - -2001-12-18 Eli Zaretskii <eliz@is.elta.co.il> - - * Makefile.in (lisp, shortlisp): Synchronize with changes to - lisp/Makefile.in:DONTCOMPILE. - -2001-12-18 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * xdisp.c (window_box_height): Do not return negative values. - From Gerd Moellmann <gerd@gnu.org>. - - * keyboard.c (head_table): Add missing braces around initializer. - - * term.c (keys): Likewise. - - * xfns.c (x_frame_parms, visual_classes): Likewise. - -2001-12-17 Sam Steingold <sds@gnu.org> - - * coding.c (DECODE_COMPOSITION_END): Fixed a typo in the last - patch (COMPOSING_P, not COMPOSING). - -2001-12-17 Richard M. Stallman <rms@gnu.org> - - * editfns.c (Fcompare_buffer_substrings): Add QUIT to main loop. - - * coding.c (code_convert_region): Update coding->cmp_data->char_offset - before calling decode_coding. - - * charset.c (Fdefine_charset): Call Fupdate_coding_systems_internal. - - * coding.c (DECODE_COMPOSITION_END): Check for ! COMPOSING_P (coding) - instead of only for COMPOSITION_DISABLED. - -2001-12-16 Richard M. Stallman <rms@gnu.org> - - * alloc.c (pure_alloc): After overflow, allocate just a small block. - - * Makefile.in (xmenu.o, xterm.o, fontset.o): Depend on buffer.h. - - * buffer.h (struct buffer): New field `display_error_modiff'. - * buffer.c (reset_buffer): Initialize `display_error_modiff'. - - * window.c (Frecenter): Clear display_error_modiff field. - - * xdisp.c (redisplay_window_0, redisplay_window_1): New functions. - Call redisplay_window, but not if display_error_modiff field says no. - (redisplay_window_error): New function. - (displayed_buffer): New variable. - (redisplay_internal, redisplay_windows): Call the new functions - instead of redisplay_window directly. - -2001-12-15 Richard M. Stallman <rms@gnu.org> - - * keyboard.c (syms_of_keyboard) <double-click-fuzz>: Doc fix. - -2001-12-14 Andrew Innes <andrewi@gnu.org> - - * makefile.w32-in (EMACSLOADPATH): Define. - ($(EMACS)): Run `list-load-path-shadows' after dumping Emacs. - (bootstrap-temacs): Remove dependency on bootstrap-clean. - -2001-12-13 Eli Zaretskii <eliz@is.elta.co.il> - - * xfns.c (x_report_frame_params): Make the scroll-bar-width frame - parameter have a numeric value all the time. - - * w32fns.c (x_report_frame_params): Likewise. - -2001-12-12 Richard M. Stallman <rms@gnu.org> - - * fileio.c (Fwrite_region): Doc fix. - - * xdisp.c (CLEAR_FACE_CACHE_COUNT): Redefine as 500. - (redisplay_internal): Call clear_image_cache only for window terminals. - -2001-12-12 Gerd Moellmann <gerd@gnu.org> - - * xdisp.c (move_it_vertically_backward): Change heuristic - for the case that we didn't move far enough initially. - - * window.c (Frecenter): Simplify computation in the case of window - system frames and ARG < 0; use window_box_height. - -2001-12-11 Richard M. Stallman <rms@gnu.org> - - * Makefile.in, mem-limits.h, dispnew.c, emacs.c, fileio.c: - * process.c, sysdep.c, unexec.c: Test GNU_LINUX, not LINUX. - -2001-12-11 Andrew Innes <andrewi@gnu.org> - - * insdel.c (make_gap) [DOUG_LEA_MALLOC]: Call make_gap_smaller if - arg is negative. - -2001-12-11 Richard M. Stallman <rms@gnu.org> - - * m/hp800.h: Split the __hpux conditional into the parts - that are right for GNU/Linux too and the parts that are not. - Use the former if GNU_LINUX. - (HAVE_ALLOCA, LOAD_AVE_TYPE, LOAD_AVE_CVT): New defs for GNU/Linux. - - * s/gnu-linux.h (GNU_LINUX): Defined. - -2001-12-11 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * macros.c, msdos.c, w16select.c: Change doc-string comments to - `new style' [w/`doc:' keyword]. - -2001-12-10 Jason Rumney <jasonr@gnu.org> - - * w32menu.c (w32_free_submenu_strings): Clear menu item struct - before using. - -2001-12-09 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * dosfns.c: Change doc-string comments to `new style' [w/`doc:' - keyword]. - -2001-12-09 Eli Zaretskii <eliz@is.elta.co.il> - - * dosfns.c (dos-display-scancodes, dos-decimal): Doc fix. - - * s/hpux10.h (srand48): Don't undefine. - -2001-12-09 Jason Rumney <jasonr@gnu.org> - - * w32menu.c (_widget_value): Make `help' field a Lisp_Object. - Add comment to explain where the struct came from. - (single_submenu, w32_menu_show): Set `help' field as Lisp_Object. - (add_menu_item): Process pop-up menus first to avoid memory leak. - (add_menu_item, w32_menu_display_help): Use `help' field as - Lisp_Object. - (w32_free_submenu_strings): Only free owner-drawn strings. - -2001-12-09 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * COPYING: Moved back. - - * charset.c (char_to_string_1, translate_char, Fdefine_charset): - Add parentheses around && within ||. - - * indent.c (compute_motion): Likewise. - - * intervals.c (merge_properties_sticky): Likewise. - - * coding.c (setup_coding_system, shrink_encoding_region) - (Fdecode_sjis_char): Likewise. - -2001-12-07 Andreas Schwab <schwab@suse.de> - - * xdisp.c (display_mode_element): Don't read past end of string if - it ends with '%'. - - * alloc.c (inhibit_garbage_collection): Don't exceed value an int - can hold. - - * data.c (Vmost_positive_fixnum, Vmost_negative_fixnum): - Rename from most_positive_fixnum and most_negative_fixnum, resp., and - type changed to Lisp_Object. - (syms_of_data): DEFVAR_LISP them. - -2001-12-07 Richard M. Stallman <rms@gnu.org> - - * callproc.c (init_callproc): Set Vdata_directory based on the source - location whenever Emacs was run uninstalled. - -2001-12-06 Paul Eggert <eggert@twinsun.com> - - * config.in (HAVE_WORKING_VFORK): New #undefs. - * process.c (create_process): - Use HAVE_WORKING_VFORK, not HAVE_VFORK. - * m/cnvrgnt.h (HAVE_VFORK): Remove #define. - * m/ibm370aix.h (HAVE_VFORK): Remove #undef. - * m/ibmps2-aix.h (HAVE_VFORK): Remove #define. - * m/intel386.h (HAVE_VFORK): Likewise. - * m/mips-siemens.h (HAVE_VFORK): Likewise. - * m/mips.h (HAVE_VFORK): Likewise. - * s/freebsd.h (vfork): Remove #define. - * s/lynxos.h (HAVE_VFORK): Remove #undef. - * s/usg5-4-2.h: Fix comment about vfork. - -2001-12-06 Richard M. Stallman <rms@gnu.org> - - * s/hpux10.h (random): Add undef. - (HAVE_RANDOM): Define it just once. - -2001-12-06 Stefan Monnier <monnier@cs.yale.edu> - - * eval.c: Undo last change: the standard syntax is not wanted. - -2001-12-06 Eli Zaretskii <eliz@is.elta.co.il> - - * xterm.c (x_free_frame_resources) [USE_X_TOOLKIT]: Remove all the - scroll bars of the frame before deleting the frame itself. If the - frame has a widget, delete the frame with XtDestroyWidget, and do - not call XDestroyWindow before that. - -2001-12-06 Kim F. Storm <storm@cua.dk> - - * xfns.c (x_report_frame_params): Return actual fringe widths. - - * w32fns.c (x_report_frame_params): Return actual fringe widths. - -2001-12-05 Andrew Innes <andrewi@gnu.org> - - * alloc.c (Fgarbage_collect): Shrink buffer gaps that are - excessively large. - - * insdel.c (make_gap_larger): New function. - (make_gap_smaller): New function. - (make_gap) [USE_MMAP_FOR_BUFFERS || REL_ALLOC]: - Call make_gap_smaller if arg is negative. - -2001-12-04 Stefan Monnier <monnier@cs.yale.edu> - - * keyboard.c (kbd_buffer_store_event): Fix interrupt_signal prototype. - Pass a dummy argument when calling interrupt_signal. - (parse_menu_item): Mark disabled items before checking for empty def. - (read_char_minibuf_menu_prompt): Make safety more visible. - (read_key_sequence): Add a `first_unbound' variable. - Use it to detect C-c ESC ESC ESC ESC ... cases and drop the - unbound prefix as soon as we can detect it. - - * doc.c (Fsnarf_documentation): Add prototype. - (get_doc_string): Handle negative arguments. - (Fdocumentation): Use AREF and ASIZE. - Move the calls to get_doc_string to a single place. - Don't confuse an interactive-spec for a docstring reference. - (Fdocumentation_property): Take advantage of the fact that - get_doc_string now ignores the sign of the docstring position. - - * eval.c: Use standard syntax for usage in docstrings. - -2001-12-03 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * xdisp.c (syms_of_xdisp): Make `tool-bar-button-relief' an option. - -2001-12-02 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * xterm.c (x_draw_image_relief): Use predefined macro instead of - constant when the value of `tool_bar_button_relief' is negative. - -2001-12-02 Richard M. Stallman <rms@gnu.org> - - * xmenu.c (menu_highlight_callback): Use `help' field as Lisp_Object. - (single_submenu, xmenu_show): Set `help' field as Lisp_Object. - - * fileio.c (read_non_regular): Delete Fsignal call. - -2001-12-01 Stefan Monnier <monnier@cs.yale.edu> - - * lisp.h (run_hook_list_with_args): Undo last change. - -2001-12-01 Gerd Moellmann <gerd@gnu.org> - - * xterm.c (x_draw_fringe_bitmap): Always undo clipping. - -2001-12-01 Jason Rumney <jasonr@gnu.org> - - * window.c (Qleft_fringe, Qright_fringe): Remove. Now in frame.c. - - * w32term.h (WM_MOUSELEAVE, TME_LEAVE, TRACKMOUSEEVENT) - [!WM_MOUSELEAVE]: Define. - - * w32menu.c (current_popup_menu, get_menu_item_info): - (set_menu_item_info): New vars. - (set_frame_menubar): Doc fix clarifying GC interaction with menus. - (w32_menu_show): Set current_popup_menu. - (add_menu_item): Allocate new strings for owner-drawn menu items - and help strings. - Use owner-draw for disabled menu items again. - (w32_menu_display_help): Ignore owner-drawn items and popup menus. - (w32_free_submenu_strings, w32_free_menu_strings): New functions. - - * w32fns.c (trackmouse_window, track_mouse_event_fn): New vars. - (w32_wnd_proc) <WM_MOUSEMOVE>: Notice when mouse enters frame. - <WM_EXITMENULOOP>: Free menu strings. - <WM_MOUSELEAVE>: Stop tracking mouse. - (x_create_tip_frame): Specify no minibuffer, modeline or fringes. - - * w32term.c (w32_read_socket) <WM_MOUSELEAVE>: Cancel help echo - and mouse face. - -2001-12-01 Kim F. Storm <storm@cua.dk> - - The following changes add left-fringe and right-fringe - frame parameters to adjust fringe widths, or remove one or - both fringes. - - * frame.h (struct frame): Remove trunc_area_pixel_width and - trunc_area_cols fields. - (Qleft_fringe, Qright_fringe): Declare. - (FRAME_RIGHT_FRINGE_WIDTH): New macro. - - * frame.c (Qleft_fringe, Qright_fringe): New vars. - (syms_of_frame): Initialize them. - - * window.c (coordinates_in_window): Handle separate left and right - fringe widths. - - * xterm.h (struct x_output): Add left_fringe_width, right_fringe_width, - and fringe_cols fields. - (FRAME_FRINGE_BITMAP_WIDTH, FRAME_FRINGE_BITMAP_HEIGHT): Remove macros. - (FRAME_X_FRINGE_COLS): Use fringe_cols field. - (FRAME_X_FRINGE_WIDTH): Use fringes_extra field. - (FRAME_X_LEFT_FRINGE_WIDTH): Use left_fringe_width field. - (FRAME_X_RIGHT_FRINGE_WIDTH): Use right_fringe_width field. - (x_compute_fringe_widths): Add prototype. - - * xterm.c (zv_height, zv_bits, zv_period): Changed zv bitmap to - fill fringe evenly with small dashes. - (x_draw_fringe_bitmap): Clear background if necessary. Align and - clip the new ZV bitmap to avoid jitter between rows. - (x_draw_row_fringe_bitmaps): Rely on x_draw_fringe_bitmap to clear - background. Don't draw fringe bitmaps if fringe width is zero. - (x_compute_fringe_widths): New function. - (x_new_font, x_set_window_size_1): Use it. - - * xfns.c (x_frame_parms): Add `left-fringe' and `right-fringe' parms. - (x_set_frame_parameters): Process `font' parameter before other - parameters as fringe widths depend on it. - (x_set_fringe_width): New function. - (x_figure_window_size): Use x_compute_fringe_widths. - (Fx_create_frame): Process `left-fringe' and `right-fringe' frame - parameters. - - * widget.c (set_frame_size): Use x_compute_fringe_widths. - (EmacsFrameSetCharSize): Ditto. - - * w32term.h: Merged changes from xterm.h. - * w32term.c: Merged changes from xterm.c. - * w32fns.c: Merged changes from xfns.c. - -2001-11-29 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * COPYING: Removed. - -2001-11-29 Dave Love <fx@gnu.org> - - * coding.c (syms_of_coding) <Qchar_coding_system>: Give it an - extra extra slot. - (detect_coding_mask): Fix call of detect_coding_iso2022. - -2001-11-29 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * fileio.c (file-name-coding-system) - (default-file-name-coding-system): Doc fix (links to referenced - variables added). - -2001-11-28 Stefan Monnier <monnier@cs.yale.edu> - - * lisp.h (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5): - Add dummy uses of gcproN variables. - - * category.c (describe_category, describe_category_1) - (Fdescribe_categories): Remove. (Moved to lisp/help-fns.el.) - (syms_of_category): Don't defsubr Sdescribe_categories. - -2001-11-28 Richard M. Stallman <rms@gnu.org> - - * fileio.c (Ffind_file_name_handler): Avoid initializer for `result'. - - * Makefile.in (lispdir): New variable, referring to build dir. - (TAGS-LISP): Find Makefile in $(lispdir), not $(lispsource). - -2001-11-28 Andrew Innes <andrewi@gnu.org> - - * w32menu.c (w32_menu_display_help): Actually add the new argument - OWNER. - -2001-11-28 Jason Rumney <jasonr@gnu.org> - - * w32menu.c (add_menu_item): Do not use owner-draw for disabled - menu items. From David Ponce <dponce@wanadoo.fr>. - (w32_dialog_show) [HAVE_DIALOGS]: Compile whole function - conditionally. - (w32_menu_display_help): New argument OWNER. Rewritten to store a - help event in the owner frame's keyboard buffer. - - * w32fns.c (w32_wnd_proc) <WM_MENUSELECT>: Display help directly. - (Fx_show_tip): Don't subtract last width from row width. - - * w32term.c (w32_read_socket) <WM_MENUSELECT>: Remove. - (w32_read_socket): Use EQ to compare frames. - -2001-11-28 Gerd Moellmann <gerd@gnu.org> - - * xterm.c (x_draw_glyphs): Don't call notice_overwritten_cursor if - OVERLAPS_P. - -2001-11-28 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * xdisp.c (message_dolog): Remove unused variables `gcpro2', - `gcpro3' and `gcpro4'. - - * coding.c (decode_coding_string): Remove unused variable `gcpro1'. - -2001-11-28 Stefan Monnier <monnier@cs.yale.edu> - - * ccl.c: Use AREF and ASIZE. - -2001-11-27 Stefan Monnier <monnier@cs.yale.edu> - - * lisp.h (run_hook_list_with_args): Remove. - (LIST_END_P): Fix call to wrong_type_argument. - (make_fixnum_or_float): Use EMACS_INT rather than int. - -2001-11-26 Stefan Monnier <monnier@cs.yale.edu> - - * syntax.c (syms_of_syntax): Remove defsubr of Sdescribe_syntax. - (describe_syntax, describe_syntax_1, Fdescribe_syntax): Remove. - - * eval.c: Use AREF and ASIZE. - (Ffetch_bytecode): Add the file name to the error message. - - * fileio.c (Ffind_file_name_handler): Give precedence to handlers - which match the end of the file-name. - (Fsubstitute_in_file_name): Don't signal an error if $ENVVAR - is not a valid env var, but leave it as is instead. - - * keymap.c (access_keymap): Handle t bindings like nil bindings. - Make nil bindings in char-tables transparent. - (store_in_keymap): Turn a nil binding into a t binding for char-tables. - -2001-11-26 Richard M. Stallman <rms@gnu.org> - - * textprop.c (set_text_properties_1): Allow START, END in either order. - Do nothing if range is empty. - - * Makefile.in (mallocobj): Simplify logic using auxiliary vars. - - * Makefile.in (mostlyclean): Delete bootstrap-emacs here. - (clean): Not here. - -2001-11-25 Stefan Monnier <monnier@cs.yale.edu> - - * textprop.c (set_text_properties_1): Clearly mark that the - interval should not be empty. - - * intervals.c (graft_intervals_into_buffer): - Don't call set_text_properties_1 on an empty interval. - -2001-11-25 Richard M. Stallman <rms@gnu.org> - - * unexelf.c (unexec): Index by n, not nn, when checking for ".sbss". - - * callproc.c (Fcall_process): When we make a bigger buffer for bufptr, - don't lose the data in it. - -2001-11-25 Juanma Barranquero <lektu@terra.es> - - * abbrev.c (Fexpand_abbrev): Use Frun_hooks instead of Vrun_hooks. - - * buffer.c (Fkill_buffer): Likewise. - - * print.c (temp_output_buffer_setup): Likewise. - -2001-11-25 Stefan Monnier <monnier@cs.yale.edu> - - * xfaces.c (merge_face_heights): Coerce back to int explicitly. - -2001-11-25 Eli Zaretskii <eliz@is.elta.co.il> - - * window.c (Fset_window_vscroll): Doc fix. From Kalle Olavi - Niemitalo <kon@iki.fi>. - -2001-11-25 Jason Rumney <jasonr@gnu.org> - - * w32term.h (FRAME_X_FRINGE_COLS): No fringe on tip frames. - - * w32fns.c (x_create_tip_frame): Set frame's fringes_extra to 0. - (Fx_show_tip): Block input during frame creation. - (Fx_show_tip, Fx_hide_tip): Enable. - -2001-11-24 Richard M. Stallman <rms@gnu.org> - - * lread.c (Fload): Detect recursive load error for more than 3 - nestings of the same file. - (Vrecursive_load_depth_limit): Variable deleted. - (syms_of_lread) <recursive-load-depth-limit>: Variable deleted. - -2001-11-24 Jason Rumney <jasonr@gnu.org> - - * xfns.c (compute_tip_xy): Initialize root_x and root_y from - mouse position if either left or top is not specified. - - * w32fns.c (w32_wnd_proc) <WM_MENUSELECT>: Revert last change. - <WM_WINDOWPOSCHANGING>: Let tip frames resize without restriction. - (my_create_tip_window, Fx_show_tip): Adjust size for external border. - (my_create_tip_window): Assign tip_window. - (x_create_tip_frame): Use same defaults as X. - (compute_tip_xy): Remove unused variable. Use full screen width. - (Fx_show_tip): Do not double height. Call ShowWindow directly. - - * w32term.c (x_after_update_window_line): Doc fix. - (w32_read_socket): Doc fix. Avoid SET_FRAME_GARBAGED for tip - frames. - <WM_SHOWWINDOW>: Redo mouse highlight when hiding tip frame. - - * xdisp.c (prepare_menu_bars) [HAVE_WINDOW_SYSTEM]: Use tip_frame - for all Windowed systems. - -2001-11-23 Eli Zaretskii <eliz@is.elta.co.il> - - * msdos.c (IT_clear_screen): If the frame's faces are not yet - realized, use the initial screen colors to clear the screen. - -2001-11-23 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * textprop.c (Fset_text_properties): Remove unused variables - `unchanged', `prev_changed', `s' and `len'. - - * search.c (Freplace_match): Remove unused variable `inslen'. - - * keymap.c (access_keymap): Remove unused variables `c1' and `c2'. - -2001-11-22 Jason Rumney <jasonr@gnu.org> - - * w32fns.c (x_window_to_frame): Remove irrelevant TODO comment. - (w32_wnd_proc) <WM_MENUSELECT>: Show help echo directly. - (my_create_tip_window): New function. - (x_create_tip_frame, compute_tip_xy): Adapt for Windows. - (Fx_show_tip, Fx_hide_tip) [TEST_TOOLTIPS]: Adapt for Windows. - -2001-11-20 Jason Rumney <jasonr@gnu.org> - - * coding.h (Vw32_system_coding_system) [WINDOWSNT]: Remove. - (ENCODE_SYSTEM, DECODE_SYSTEM) [WINDOWSNT]: Use Vlocale_coding_system. - - * w32fns.c (Vw32_system_coding_system): Remove. - (w32_to_x_font, x_to_w32_font): Use Vlocale_coding_system. - -2001-11-19 Stefan Monnier <monnier@cs.yale.edu> - - * fileio.c (Fwrite_region): Move choose_write_coding_system to - after build_annotations. - - * syntax.c (describe_syntax): Add dummy arg. - (describe_syntax_1): Update call to describe_vector. - - * category.c (describe_category): Add dummy arg. - (describe_category_1): Update call to describe_vector. - - * keymap.c (Fdescribe_vector): Add `describer' parameter. - (describe_command, describe_translation): Add dummy second param. - (describe_map): Call elt_describer with two arguments. - (describe_vector_princ): Add `fun' parameter. - Call it instead of the hardcoded `princ'. - (describe_vector): Add arg `args'. - Pass it as a new second argument to elt_describer. - - * keymap.h (describe_vector): Update prototype. - - * frame.c: Don't include keymap.h any more. - (keys_of_frame): Remove. - - * lisp.h (keys_of_frame): Remove declaration. - - * emacs.c (main): Don't call `keys_of_frame' any more. - -2001-11-14 Andreas Schwab <schwab@suse.de> - - * unexelf.c [!defined MAP_ANON]: Define MAP_ANON to MAP_ANONYMOUS - if defined, 0 otherwise. - (MAP_FAILED): Define if not defined and use it to test mmap failure. - (unexec) [!MAP_ANON]: Use /dev/zero as file to map. - -2001-11-19 Richard M. Stallman <rms@gnu.org> - - * indent.c (current_column_1): Fix handling of scan_bytes for mb chars. - -2001-11-18 Jason Rumney <jasonr@gnu.org> - - * w32term.c (note_mouse_highlight): Fix type of variable `ignore'. - (x_draw_bar_cursor): If the background color of the glyph under - the cursor equals the frame's cursor color, use the glyph's - foreground color for drawing the bar cursor. - (x_after_update_window_line): Clear internal border in different - circumstances. - (w32_set_vertical_scroll_bar): Check for width and height > 0. - (w32_draw_relief_rect): Correct relief by 1 pixel. - (x_set_glyph_string_background_width): - Set extends_to_end_of_line_p if the row's fill_line_p is set and - drawing the last glyph with DRAW_IMAGE_{RAISED,SUNKEN}. - (x_display_and_set_cursor): If cursor_in_echo_area, use NO_CURSOR - if cursor_in_non_selected_windows is false. - (show_mouse_face): Clean up. Recognize overwritten cursor differently. - (x_draw_glyphs): Remove parameters REAL_START and REAL_END. - Notice if cursor gets overwritten. - (notice_overwritten_cursor): Renamed from - note_overwritten_text_cursor. Rewritten to take glyph widths - into account, and to take X positions as parameters. - (x_draw_phys_cursor_glyph): Save state of w->phys_cursor_on_p - around call to x_draw_glyphs. - (x_setup_relief_colors): Use `IMAGE_BACKGROUND' and - `IMAGE_BACKGROUND_TRANSPARENT' to calculate the correct background - color to use for image glyph reliefs. - (x_draw_image_relief): Accept zero tool_bar_button_relief. - (glyph_rect): Remove unused variable `area'. - - * w32fns.c (x_set_frame_parameters): Avoid infinite recursion for - some items. - (x_set_internal_border_width): Set frame garbaged when window - doesn't exist yet. - (Fx_create_frame): Accept zero tool_bar_button_relief. - (x_clear_image_1, four_corners_best, image_background) - (image_background_transparent): New functions. - (xpm_format, png_format, jpeg_format, tiff_format, gif_format) - (gs_format): Add `:background' entry. - (lookup_image): Set IMG's background color if specified. - (pbm_load, xbm_load_image, png_load): Set IMG's background field - when appropriate. - (x_clear_image_1): Reset `background_valid' and - `background_transparent_valid' fields. - (x_build_heuristic_mask): Use IMAGE_BACKGROUND instead of - calculating it here. Set IMG's background_transparent field. - (enum xpm_keyword_index): Add XPM_BACKGROUND. - (enum png_keyword_index): Add PNG_BACKGROUND. - (enum jpeg_keyword_index): Add JPEG_BACKGROUND. - (enum tiff_keyword_index): Add TIFF_BACKGROUND. - (enum gif_keyword_index): Add GIF_BACKGROUND. - (enum gs_keyword_index): Add GS_BACKGROUND. - (pbm_load, png_load, jpeg_load, tiff_load, gif_load): - Pre-calculate image background color where necessary. - (x_create_x_image_and_pixmap, xbm_load, gs_load): - Use display info's n_cbits entry for screen depth. - (Fx_show_tip): Remove unused variables `buffer', `top', - `left', `max_width' and `max_height'. - - * w32menu.c (w32_menu_show, push_menu_pane): Doc fixes. - -2001-11-18 Gerd Moellmann <gerd@gnu.org> - - * puresize.h (BASE_PURESIZE): Increase to 750000. - -2001-11-18 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * frame.c (Fframe_live_p): Doc fix. - -2001-11-18 Richard M. Stallman <rms@gnu.org> - - * xdisp.c (message_dolog_marker1, message_dolog_marker2) - (message_dolog_marker3): New static variables hold three markers. - (syms_of_xdisp): Initialize and staticpro them. - (message_dolog): Use message_dolog_marker1..3 instead of - allocating markers each time. Unchain them when done. - -2001-11-17 Richard M. Stallman <rms@gnu.org> - - * doc.c (Fsnarf_documentation): Doc fix. - -2001-11-17 Andreas Schwab <schwab@suse.de> - - * xterm.c (note_mouse_highlight): Fix type of variable `ignore'. - -2001-11-17 Richard M. Stallman <rms@gnu.org> - - * fileio.c (Fwrite_region): Avoid initializer for Lisp_Object. - -2001-11-17 Jason Rumney <jasonr@gnu.org> - - * xterm.c (notice_overwritten_cursor): Take care of end < 0 case. - -2001-11-17 Gerd Moellmann <gerd@gnu.org> - - * xdisp.c (tool_bar_item_info): Avoid calling Fget_text_property - with invalid position. - -2001-11-16 Richard M. Stallman <rms@gnu.org> - - * syswait.h: Delete conditionals for HPUX7, ISC 4.1, and convex. - - * s/isc4-1.h (HAVE_SYS_WAIT_H): Add #undef. - * s/hpux.h (HAVE_SYS_WAIT_H): Add #undef. - * s/hpux8.h (HAVE_SYS_WAIT_H): Define it. - - * m/convex.h (HAVE_SYS_WAIT_H): Add #undef. - -2001-11-16 Stefan Monnier <monnier@cs.yale.edu> - - * fileio.c (build_annotations): Split off the tail. - (build_annotations_2): New fun. Extracted from build_annotations. - (Fwrite_region): Split the call to build_annotations into two - calls to build_annotations and build_annotations_2. - -2001-11-16 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * sysdep.c (wait_for_kbd_input) [VMS]: Do not call - clear_waiting_for_input with argument. - - * xterm.h (x_update_cursor): Remove duplicated prototype. - - * keyboard.h (clear_waiting_for_input): Remove duplicated prototype. - - * xterm.c (waiting_for_input): Remove unnecessary declaration. - - * data.c (Ftimes, Fquo, Frem, Fmod): Doc fix. - -2001-11-16 Stefan Monnier <monnier@cs.yale.edu> - - * fileio.c (choose_write_coding_system): New fun, extracted - from Fwrite_region. - (Fwrite_region): Use it. - - * eval.c (max_specpdl_size, max_lisp_eval_depth): Use EMACS_INT. - (funcall_lambda, run_hook_with_args): Make static and add prototype. - (ml_apply, find_handler_clause): Add prototype. - -2001-11-16 Eli Zaretskii <eliz@gnu.org> - - * config.in: Add #undef HAVE_COFF_H. - - * unexec.c (coff.h): Don't include unless HAVE_COFF_H is defined. - Required for ISC 4.1. - -2001-11-16 Eli Zaretskii <eliz@is.elta.co.il> - - * syswait.h (HAVE_SYS_WAIT_H): Undef for ISC 4.1. Reported by - Andrew Wiseman <a.wiseman@btclick.com>. - -2001-11-16 Kim F. Storm <storm@cua.dk> - - The following changes are made to clean up the various internal - references to the fringes to actually use the term `fringe' for - them. Previously, they were called `flags areas', `bitmap areas', - `left/right side of windows', or implicitly as `flags' or - `bitmaps': - - * dispextern.h (FRINGE_FACE_ID): Renamed from BITMAP_AREA_FACE_ID. - Comments fixed. Use renamed symbols. - - * dispnew.c: Comment fix. Use renamed symbols. - - * frame.h (FRAME_FRINGE_COLS): Renamed from FRAME_FLAGS_AREA_COLS. - (FRAME_FRINGE_WIDTH): Renamed from FRAME_FLAGS_AREA_WIDTH. - (FRAME_LEFT_FRINGE_WIDTH): Renamed from FRAME_LEFT_FLAGS_AREA_WIDTH. - - * msdos.c: Comment fix. - - * w32fns.c: Use renamed symbols. - - * w32term.c: Comment fixes. Use renamed symbols. - (fringe_bitmap_type): Renamed from bitmap_type. - (NO_FRINGE_BITMAP): Renamed from NO_BITMAP. - (w32_draw_fringe_bitmap): Renamed from w32_draw_bitmap. - (x_draw_row_fringe_bitmaps): Renamed from x_draw_row_bitmaps. - - * w32term.h: Comment fixes. Use renamed symbols. - (fringes_extra): Renamed from flags_areas_extra. - (FRAME_FRINGE_BITMAP_WIDTH): Renamed from FRAME_FLAGS_BITMAP_WIDTH. - (FRAME_FRINGE_BITMAP_HEIGHT): Renamed from FRAME_FLAGS_BITMAP_HEIGHT. - (FRAME_X_FRINGE_COLS): Renamed from FRAME_X_FLAGS_AREA_COLS. - (FRAME_X_FRINGE_WIDTH): Renamed from FRAME_X_FLAGS_AREA_WIDTH. - (FRAME_X_LEFT_FRINGE_WIDTH): - Renamed from FRAME_X_LEFT_FLAGS_AREA_WIDTH. - (FRAME_X_RIGHT_FRINGE_WIDTH): - Renamed from FRAME_X_RIGHT_FLAGS_AREA_WIDTH. - - * widget.c: Use renamed symbols. - - * window.c: Comment fixes. Use renamed symbols. - (coordinates-in-window-p): Doc fix. - - * xdisp.c: Comment fixes. Use renamed symbols. - - * xfaces.c (realize_basic_faces): Use FRINGE_FACE_ID. - - * xfns.c: Use renamed symbols. - - * xterm.c: Comment fixes. Use renamed symbols. - (fringe_bitmap_type): Renamed from bitmap_type. - (NO_FRINGE_BITMAP): Renamed from NO_BITMAP. - (x_draw_fringe_bitmap): Renamed from x_draw_bitmap. - (x_draw_row_fringe_bitmaps): Renamed from x_draw_row_bitmaps. - - * xterm.h: Comment fixes. Use renamed symbols. - (fringes_extra): Renamed from flags_areas_extra. - (FRAME_FRINGE_BITMAP_WIDTH): Renamed from FRAME_FLAGS_BITMAP_WIDTH. - (FRAME_FRINGE_BITMAP_HEIGHT): Renamed from FRAME_FLAGS_BITMAP_HEIGHT. - (FRAME_X_FRINGE_COLS): Renamed from FRAME_X_FLAGS_AREA_COLS. - (FRAME_X_FRINGE_WIDTH): Renamed from FRAME_X_FLAGS_AREA_WIDTH. - (FRAME_X_LEFT_FRINGE_WIDTH): - Renamed from FRAME_X_LEFT_FLAGS_AREA_WIDTH. - (FRAME_X_RIGHT_FRINGE_WIDTH): - Renamed from FRAME_X_RIGHT_FLAGS_AREA_WIDTH. - -2001-11-15 Jason Rumney <jasonr@gnu.org> - - * w32menu.c (add-menu-item): Make help_echo and radio buttons - work for most menu items. From David Ponce - <david.ponce@wanadoo.fr>. - -2001-11-15 Gerd Moellmann <gerd@gnu.org> - - * xfns.c (x_set_frame_parameters): Revert change of 2001-11-07. - Some x_set_* function expect to be called even if old and new - value are equal. - - * xdisp.c (build_desired_tool_bar_string): Accept zero - tool_bar_button_relief. - - * xfns.c (Fx_create_frame): Accept zero tool_bar_button_relief. - - * xterm.c (x_draw_image_relief): Accept zero tool_bar_button_relief. - - * xterm.c (x_draw_bar_cursor): If the background color of the - glyph under the cursor equals the frame's cursor color, use - the glyph's foreground color for drawing the bar cursor. - - * dispnew.c (direct_output_forward_char): Fix character/byte - position comparison. - -2001-11-15 Miles Bader <miles@gnu.org> - - * editfns.c (find_field): Add BEG_LIMIT and END_LIMIT parameters. - (Fdelete_field, Ffield_string, Ffield_string_no_properties): - Update arguments to find_field. - (Ffield_beginning, Ffield_end): Add LIMIT param, pass to find_field. - (Fconstrain_to_field): Use LIMIT arg to shorten search time. - * lisp.h (Ffield_beginning, Ffield_end): Update EXFUN decl. - * minibuf.c (Fminibuffer_prompt_end): Update args to Ffield_end. - -2001-11-14 Richard M. Stallman <rms@gnu.org> - - * editfns.c (Fpropertize): Allow call with 1 arg. - - * dispextern.h (image_background, image_background_transparent): - Conditionalize on HAVE_X_WINDOWS. - -2001-11-13 Richard M. Stallman <rms@gnu.org> - - * print.c (Fprin1_to_string): Doc fix. - - * sunfns.c (Fsun_change_cursor_icon): Doc fix. - - * floatfns.c (Fceiling, Ffloor): Doc fixes. - - * filelock.c (Funlock_buffer, Ffile_locked_p): Doc fixes. - - * fileio.c (Ffile_accessible_directory_p): Doc fix. - - * eval.c (syms_of_eval): Doc fix. - - * coding.c (syms_of_coding): Doc fix. - - * doc.c (Fsnarf_documentation): Doc fix. - - * dispnew.c (syms_of_display): Doc fix. - - * category.c (Fget_unused_category): Doc fix. - - * buffer.c (syms_of_buffer): Doc fixes. - -2001-11-14 Eli Zaretskii <eliz@is.elta.co.il> - - * print.c (prin1, print): Doc fix. - -2001-11-14 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * fontset.h: Remove declarations of variables - `Vhighlight_wrong_size_font' and `Vclip_large_size_font'. - - * fontset.c: Remove variables `Vhighlight_wrong_size_font' and - `Vclip_large_size_font'. - -2001-11-13 Jason Rumney <jasonr@gnu.org> - - * w32fns.c: Doc fix. - -2001-11-13 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * xfaces.c (Fface_attributes_as_vector): Doc fix. - - * fns.c: Doc fix. - - * emacs.c: Doc fix. - - * coding.c: Doc fix. - - * cmds.c, composite.c, dired.c, doc.c, filelock.c, floatfns.c, - * fontset.c, insdel.c, keymap.c: Change doc-string comments to - `new style' [w/`doc:' keyword]. - -2001-11-12 Richard M. Stallman <rms@gnu.org> - - * xterm.c (XTread_socket): Don't update focus for EnterNotify or - LeaveNotify events. Only FocusIn and FocusOut do that now. - (x_display_and_set_cursor): Do display hollow cursors in active - minibuffer windows when they are not selected. - -2001-11-12 Jason Rumney <jasonr@gnu.org> - - * w32console.c, w32fns.c, w32menu.c, w32proc.c, w32select.c, - * w32term.c: Change doc-string comments to `new style' - [w/`doc:' keyword]. Doc fixes. - - * w32fns.c: Don't define max. - (Fx_open_connection): Only execute once. - -2001-11-12 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * ccl.c: Change macros to use do-while block instead of if-else. - Use braces to follow GNU Coding Standards. - -2001-11-11 Richard M. Stallman <rms@gnu.org> - - * sysdep.c (child_setup_tty): Don't clear ICRNL or INLCR. - - * lread.c (read_escape): Use end_of_file_error for reporting eof. - - * insdel.c (replace_range): Use adjust_markers_for_replace - instead of adjust_markers_for_delete and adjust_markers_for_insert. - - * intervals.h (set_text_properties, set_text_properties_1): Declare. - - * textprop.c (set_text_properties_1): New subroutine - broken out of set_text_properties. - (set_text_properties): Use set_text_properties_1. - - * intervals.c (graft_intervals_into_buffer): - Use set_text_properties_1 to clear out properties. - - * search.c (Freplace_match): Use replace_range to insert - and delete. Don't request property inheritance from - surrounding text. - -2001-11-10 Jason Rumney <jasonr@gnu.org> - - * w32fns.c (enum_font_cb2): Use leading @ on face name to detect - vertical fonts. Allow them if face name is explicitly specified. - Do not give up if we find a font that cannot be converted to an xlfd. - -2001-11-10 Gerd Moellmann <gerd@gnu.org> - - * unexelf.c (unexec): Use mmap/munmap to allocate buffers - instead of malloc/free. - -2001-11-09 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * xfaces.c (merge_face_vectors): Use braces to follow GNU - Coding Standards. - (Finternal_set_lisp_face_attribute): Likewise. - - * buffer.c (Fbury_buffer): Likewise. - - * indent.c (current_column_1): Remove unused variable `prev_col'. - - * coding.c (encode_coding): Use precomputed value of `src'. - (encode_coding): Remove unused variable `src_end'. - (code_convert_region): Remove unused variables `count'. - -2001-11-07 Jason Rumney <jasonr@gnu.org> - - * w32term.c (x_display_and_set_cursor): Do not move system caret - if cursor_glyph is NULL. - -2001-11-07 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * keymap.c (access_keymap): Fix compilation error. - -2001-11-07 Miles Bader <miles@gnu.org> - - * xfns.c (x_set_frame_parameters): Avoid infinite recursion. - -2001-11-07 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * intervals.c (graft_intervals_into_buffer): - Remove #ifdef'd-out code. - (graft_intervals_into_buffer): Remove unused variable `middle'. - - * lread.c (Feval_region): Remove obsolete #ifdef'd-out - code (eval-current-buffer). - Change doc-string comments to `new style' [w/`doc:' keyword]. - -2001-11-06 Richard M. Stallman <rms@gnu.org> - - * keymap.c (access_keymap): Don't use initializers on Lisp_Object. - -2001-11-06 Stefan Monnier <monnier@cs.yale.edu> - - * lread.c (read1): Fix behavior with nested backquoting. - - * keyboard.c (make_lispy_event): Check integerness and fix - Lisp_Object/int mixup. - -2001-11-06 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * fns.c (copy_hash_table): Remove unused variable `v'. - - * fontset.c (fontset_font_pattern): Remove unused variable - `family_registry'. - - * indent.c (current_column_1): Remove unused variable `prev_col'. - -2001-11-05 Richard M. Stallman <rms@gnu.org> - - * m/news-risc.h (BROKEN_PROTOTYPES): Defined. - - * buffer.c (Fkill_buffer): Don't delete auto save file - if buffer is modified. - -2001-11-05 Andrew Innes <andrewi@gnu.org> - - * w32proc.c (Fw32_set_keyboard_layout): Use CHECK_NUMBER_CAR and - CHECK_NUMBER_CDR. - -2001-11-05 Richard M. Stallman <rms@gnu.org> - - * unexelf.c (unexec): Minor changes; clean up comments. - -2001-11-05 Sam Steingold <sds@gnu.org> - - * w32term.c (x_display_and_set_cursor): Fix w32 compilation error. - -2001-11-05 Andreas Schwab <schwab@suse.de> - - * sound.c (sound_perror): Save errno from being clobbered. - -2001-11-05 Dale Hagglund <rdh@yottayotta.com> - - * unexelf.c (unexec): Don't use `mmap'. Instead, read and write - the program image directly. - -2001-11-05 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * buffer.h (Fbuffer_local_value): Add prototype. - -2001-11-04 Richard M. Stallman <rms@gnu.org> - - * buffer.c (Fbuffer_local_value): Remove extra args from CHECK_SYMBOL - and CHECK_BUFFER. - - * keyboard.c (read_char): Use Fcar and Fcdr, not Fnth. - (record_char): Likewise. - - * keyboard.c (make_lispy_event): Don't insist a drag event must - move to a different buffer position. Instead, check for moving at - least double_click_fuzz. - - * fns.c (Fmake_hash_table): Use XCAR and XCDR, not Fnth and Flength. - - * keyboard.c (echo-area-clear-hook): Undo Oct 29 change. - - * indent.c (current_column_1, Fmove_to_column): Separate the code - for display-table glyphs from the code for buffer text, to fix - bugs in the former. - -2001-11-04 Michael Welsh Duggan <md5i@cs.cmu.edu> - - * buffer.c (Fbuffer_local_value): New function. - (syms_of_buffer): Defsubr it. - - * xterm.c, w32term.c (x_display_and_set_cursor): Use buffer-local - value of `cursor-in-non-selected-windows'. - - * lisp.h (Qcursor_in_non_selected_windows): New declaration. - * xdisp.c (Qcursor_in_non_selected_windows): New variable. - (syms_of_xdisp): Initialize it. - -2001-11-04 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * xfns.c (Fx_create_frame): Doc fix. - - * coding.c: Change doc-string comments to `new style' [w/`doc:' - keyword]. - - * eval.c (top_level_value, top_level_set): Remove commented and - #ifdef'd-out code. - (Fdefvar): Fix usage in doc-string. - -2001-11-03 Richard M. Stallman <rms@gnu.org> - - * xfns.c: Include unistd.h, if it exists. - - * editfns.c: Move the include of ctype.h after unistd.h. - - * gmalloc.c: Test BROKEN_PROTOTYPES. - -2001-11-03 Ken Raeburn <raeburn@gnu.org> - - * lisp.h (CHECK_STRING_CAR): New macro. - * lread.c (Fload): Use XSETCARFASTINT, XSETCDRFASTINT instead of - treating XCAR and XCDR as lvalues. - (openp): Use CHECK_STRING_CAR. - (read_list): Use XSETCDR instead of treating XCDR as lvalue. - -2001-11-03 Eli Zaretskii <eliz@is.elta.co.il> - - * s/sco5.h (sigprocmask_set): Declare as extern SIGMASKTYPE. - (SIGMASKTYPE): Define. - - * syssignal.h (sigunblock): Don't define if already defined. - -2001-11-02 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * eval.c (debugger_may_continue, Vdebug_ignored_errors) - (call_debugger, Fcondition_case, skip_debugger, unbind_to): - Fix typos in comments. - - * mocklisp.c (Fml_defun, Fml_while, Fml_substr): Remove commented - and #ifdef'd-out code. - Fix and reindent comments. - - * mocklisp.h: Remove comment which is a copy of comment in mocklisp.c. - - * category.h (CHECK_CATEGORY, CHECK_CATEGORY_SET): Remove unused - argument `i' in macros. - - * frame.h (CHECK_FRAME, CHECK_LIVE_FRAME): Remove unused argument - `i' in macros. - - * lisp.h (CHECK_STRING_OR_BUFFER, CHECK_HASH_TABLE, CHECK_LIST) - (CHECK_STRING, CHECK_CONS, CHECK_SYMBOL, CHECK_CHAR_TABLE) - (CHECK_VECTOR, CHECK_VECTOR_OR_CHAR_TABLE, CHECK_BUFFER) - (CHECK_WINDOW, CHECK_LIVE_WINDOW, CHECK_PROCESS, CHECK_NUMBER) - (CHECK_NATNUM, CHECK_MARKER, CHECK_NUMBER_COERCE_MARKER) - (CHECK_FLOAT, CHECK_NUMBER_OR_FLOAT) - (CHECK_NUMBER_OR_FLOAT_COERCE_MARKER, CHECK_OVERLAY) - (CHECK_NUMBER_CAR, CHECK_NUMBER_CDR): Remove unused argument `i' - in macros. - - * abbrev.c, alloc.c, buffer.c, bytecode.c, callint.c, callproc.c, - * casefiddle.c, category.c, ccl.c, charset.c, cmds.c, coding.c, - * composite.c, data.c, dired.c, dispnew.c, doc.c, dosfns.c, emacs.c, - * eval.c, fileio.c, filelock.c, fns.c, fontset.c, frame.c, frame.h, - * indent.c, keyboard.c, keymap.c, lread.c, macros.c, marker.c, - * minibuf.c, mocklisp.c, msdos.c, print.c, process.c, search.c, - * sunfns.c, syntax.c, textprop.c, undo.c, w16select.c, w32console.c, - * w32fns.c, w32menu.c, w32proc.c, w32select.c, window.c, xdisp.c, - * xfaces.c, xmenu.c, xselect.c: Update usage of CHECK_ macros - (remove unused second argument). - -2001-11-02 Stefan Monnier <monnier@cs.yale.edu> - - * syntax.c (describe_syntax): New wrapper. - (Finternal_describe_syntax_value): Rename from describe_syntax. - Don't insert space at front and \n at the end. - (syms_of_syntax): Defsubr Sinternal_describe_syntax_value. - - * regex.c (re_wctype): Try to fix some warnings. - (regcomp, regexec): Don't forget the __restrict. - -2001-11-02 Richard M. Stallman <rms@gnu.org> - - * textprop.c (Fget_char_property): Doc fix. - -2001-11-02 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * process.c (Fstart_process): Add usage to doc-string. - - * data.c (Fsetq_default): Ditto. - - * callint.c (Finteractive): Ditto. - -2001-11-01 Stefan Monnier <monnier@cs.yale.edu> - - * macros.c: Don't include keymap.h any more. - -2001-11-01 Richard M. Stallman <rms@gnu.org> - - * data.c (Fmake_local_variable): Doc fix. - - * eval.c (Frun_hooks, Frun_hook_with_args_until_failure): Doc fix. - (Frun_hook_with_args_until_success, Frun_hook_with_args): Doc fix. - - * keymap.c (Fdescribe_buffer_bindings): Print character property - bindings along with or instead of the buffer local map. - Make the overriding maps override what they should. - -2001-11-01 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * window.c (grow_mini_window): Fix typo in comment. - -2001-11-01 Gerd Moellmann <gerd@gnu.org> - - * xterm.c (x_scroll_bar_create): Check for width and height > 0. - (XTset_vertical_scroll_bar): Likewise. - - * xfns.c (x_build_heuristic_mask): Use four_corners_best - instead of IMAGE_BACKGROUND. - - * xfns.c (four_corners_best): Reindent. - - * xfaces.c (Finternal_set_lisp_face_attribute_from_resource): - Handle :box so that it is possible to specify sexprs. - -2001-10-31 Eli Zaretskii <eliz@is.elta.co.il> - - * s/hpux11.h: New file. - -2001-10-31 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * emacs.c (USAGE1): Show command line option --no-window-system - instead of --no-windows in usage. - (standard_args): Rename --no-windows to --no-window-system. - (bug_reporting_address): Follow Emacs coding conventions. - - * eval.c (Fcommandp): Doc fix. - Change doc-string comments to `new style' [w/`doc:' keyword]. - - * frame.c (Fframe_live_p): Doc fix. - - * buffer.c (selective-display-ellipses): Doc fix. - -2001-10-31 Gerd Moellmann <gerd@gnu.org> - - * lread.c (to_multibyte): Fix computation of new read_buffer_size. - - * xfaces.c (realize_x_face): If C is not a single-byte character, - set the face's colors_copied_bitwise_p instead of the defaulted_p - members which have a different meaning. - (free_face_colors): Do nothing for a face whose colors have been - copied bitwise. - - * dispextern.h (struct face) <colors_copied_bitwise_p>: New member. - -2001-10-31 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * marker.c, mocklisp.c: Change doc-string comments to `new style' - [w/`doc:' keyword]. - -2001-10-31 Gerd Moellmann <gerd@gnu.org> - - * fns.c (require_unwind): Return Lisp_Object. - -2001-10-31 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * keyboard.c (lucid-menu-bar-dirty-flag): Doc fix. - (last-input-char): Revert doc-string to be the same as the - doc-string of `last-input-event'. - - * xdisp.c: Fix typos in comments. - -2001-10-31 Gerd Moellmann <gerd@gnu.org> - - * window.c (grow_mini_window): Handle case that the root - window is already smaller than the nominal mininum height. - -2001-10-30 Stefan Monnier <monnier@cs.yale.edu> - - * emacs.c (main): Don't call keys_of_macros any more. - - * lisp.h (keys_of_macros): Remove. - - * macros.c (keys_of_macros): Remove. - - * xfaces.c (Fface_attribute_relative_p): Declare args. - -2001-10-30 Jason Rumney <jasonr@gnu.org> - - * w32fns.c (w32_to_x_charset): Increase size of XLFD charset buffer. - (enum_font_cb2): Ignore fonts with vertical orientation. - -2001-10-30 Richard M. Stallman <rms@gnu.org> - - * keyboard.c (Finput_pending_p): Doc fix. - -2001-10-30 Gerd Moellmann <gerd@gnu.org> - - * xterm.c (x_after_update_window_line): Don't run the code - clearing in borders for rows whose visible height is 0. - - * xdisp.c (clear_garbaged_frames): Redraw the frame only if its - resized_p flag is set. If not set, use the much less flickering - method previously used. - - * dispnew.c (change_frame_size_1): Set frame's resized_p. - - * frame.h (struct frame) <resized_p>: New member. - - * lread.c (to_multibyte): Ensure read_buffer is at least twice - as large as the number of bytes to convert. - - * lread.c (to_multibyte): New function. - (read1): Use it. - -2001-10-30 Eli Zaretskii <eliz@is.elta.co.il> - - * msdos.h (FRAME_LINE_HEIGHT): Define (it's used by xmenu.c). - -2001-10-30 Gerd Moellmann <gerd@gnu.org> - - * xterm.c (x_draw_relief_rect): Correct bottom relief by 1 pixel. - (x_set_glyph_string_background_width): Set extends_to_end_of_line_p - if the row's fill_line_p is set and drawing the last glyph with - DRAW_IMAGE_{RAISED,SUNKEN}. - - * xdisp.c (clear_garbaged_frames): Call Fredraw_frame. - -2001-10-29 Stefan Monnier <monnier@cs.yale.edu> - - * xmenu.c: Include coding.h and charset.h. - (Fx_popup_menu): Use FRAME_PTR and FRAME_FONT and FRAME_LINE_HEIGHT. - (Fx_popup_dialog): Use FRAME_PTR and enum scroll_bar_part. - (single_submenu, xmenu_show): Use ENCODE_SYSTEM. - Explicitly set wv->help. Use `TRUE' rather than `True'. - (menu_help_callback): Use empty_string. - - * w32menu.c (Fx_popup_menu): Explicitly init f, xpos, and ypos. - (Fx_popup_dialog): Explicitly init f. - (w32_menu_display_help): Use empty_string. - -2001-10-29 Richard M. Stallman <rms@gnu.org> - - * fns.c (Frequire): Detect recursive try to require the same - feature 3 or more levels deep, and get error. - (require_unwind): New subroutine. - (require_nesting_list): New variable. - (syms_of_fns): Init and staticpro it. - - * print.c (print_object): Clarify indication of insertion type. - -2001-10-29 Eli Zaretskii <eliz@is.elta.co.il> - - * coding.c (syms_of_coding): Document that locale-coding-system is - used for decoding input on X. - - * window.c (Fscroll_left, Fscroll_right): Doc fix. - -2001-10-29 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * keyboard.c (Finput_pending_p): Fix typo in doc-string. - (echo-area-clear-hook): Properly DEFVAR_LISP and staticpro it. - -2001-10-29 Gerd Moellmann <gerd@gnu.org> - - * xterm.c (x_display_and_set_cursor): If cursor_in_echo_area, - use NO_CURSOR if cursor_in_non_selected_windows is false. - - * xfaces.c (Fface_font): Use UNSPECIFIEDP instead of NILP for - the slant attribute if FRAME is t. - - * xfns.c (x_set_internal_border_width): Set frame garbaged - when X window doesn't exist yet. - - * xterm.c (x_after_update_window_line): Clear internal border - in different circumstances. - - * xterm.c (XTread_socket) <KeyPress>: Don't use - STRING_CHAR_AND_LENGTH if nchars == nbytes. From Kenichi Handa - <handa@etl.go.jp>. - -2001-10-28 Eli Zaretskii <eliz@is.elta.co.il> - - * m/ibms390.h: New file. From Adam Thornton - <athornton@sinenomine.net>. - -2001-10-28 Gerd Moellmann <gerd@gnu.org> - - * xfns.c (x_build_heuristic_mask): Use x_alloc_image_color. - - * xfns.c (x_build_heuristic_mask): Fix a bug not incrementing - a loop counter. - -2001-10-28 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * emacs.c: Use argv[0] instead of "emacs" when -t was specified. - - * keyboard.c: Change doc-string comments to `new style' [w/`doc:' - keyword]. - Fix typos in comments. - - * emacs.c (bug_reporting_address): New function. - Use it when displaying usage message. - - * minibuf.c (read_minibuf): Remove unused external declaration of - variable `Qread_only'. - - * keymap.c (access_keymap): Remove unused variable `charset'. - -2001-10-28 Miles Bader <miles@gnu.org> - - * xfaces.c (merge_face_heights): Handle TO being relative as well. - Remove #ifdef'd-out code. - (Fface_attribute_relative_p, Fmerge_face_attribute): New functions. - (syms_of_xfaces): Initialize them. - -2001-10-27 Jason Rumney <jasonr@gnu.org> - - * w32fns.c (w32_wnd_proc) <WM_KILLFOCUS>: Destroy the system caret. - <WM_EMACS_DESTROY_CARET, WM_EMACS_TRACK_CARET>: Track cursor - position using the system caret. - - * w32term.c (w32_system_caret_hwnd, w32_system_caret_width) - (w32_system_caret_height, w32_system_caret_x) - (w32_system_caret_y): New variables for tracking system caret. - (w32_initialize): Initialize them. - (x_display_and_set_cursor): Make system caret follow the active cursor. - - * w32term.h (WM_EMACS_TRACK_CARET, WM_EMACS_DESTROY_CARET): - New messages types. - - * w32term.c (note_mouse_highlight): Clear old help_echo. - -2001-10-27 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * xterm.c: Fix typo in a comment. - - * emacs.c: Fix typos in comments. - Remove unnecessary spaces. - Change doc-string comments to `new style' [w/`doc:' keyword]. - (USAGE2): Fix typos in usage string. - - * xterm.c: Fix typo in a comment. - - * lisp.h (gdb_lisp_params): Remove code in #if 0 which is now in - emacs.c. - -2001-10-27 Gerd Moellmann <gerd@gnu.org> - - * xdisp.c (move_it_vertically_backward): Use 2/3 line_height - instead of 1/2 line_height in the heuristic for skipping - farther backward when target_y was not reached. - - * sound.c (sound_perror): Unblock SIGIO, turn on atimers. - Display errno only if non-zero. - (sound_warning): New function. - (vox_configure): Don't treat failing to set sample rate as error. - (various places): Improve error messages. - -2001-10-26 Eli Zaretskii <eliz@is.elta.co.il> - - * fileio.c (Faccess_file): Run the argument filename through - Fexpand_file_name, before using it. - - * dispnew.c (syms_of_display) <visible-bell>: Add a reference to - ring-bell-function. Suggested by Alf-Ivar Holm <alfh@ifi.uio.no> - -2001-10-26 Gerd Moellmann <gerd@gnu.org> - - * insdel.c (insert_1_both): Do nothing if NCHARS == 0. - - * xterm.c (XTset_vertical_scroll_bar) [!USE_TOOLKIT_SCROLL_BARS]: - Fix clearing in the case of scroll bars on the right. - -2001-10-26 Juanma Barranquero <lektu@terra.es> - - * w32gui.h (XImage): Add a dummy typedef. - -2001-10-26 Gerd Moellmann <gerd@gnu.org> - - * xfns.c (XScreenNumberOfScreen): Fix struct to pointer comparison. - -2001-10-25 Eli Zaretskii <eliz@is.elta.co.il> - - * frame.c (Fframe_parameter): Fix last change. - - * fileio.c: Revert last change (which removed old commented-out - version of expand-file-name). Add a comment that explains why - this old version should not be removed. - -2001-10-25 Gerd Moellmann <gerd@gnu.org> - - * frame.c (Fframe_parameter): Fix a bug whereby some - ``artificial'' frame parameters, like `minibuffer' were not - obtained by calling Fframe_parameters. - - * xterm.c (show_mouse_face): Clean up. Recognize overwritten - cursor differently. - - * xdisp.c (move_it_vertically_backward): Compute line height - differently. Add heuristic to try to be more compatible to 20.x. - -2001-10-25 Stefan Monnier <monnier@cs.yale.edu> - - * lisp.h (make_fixnum_or_float): Coerce double to int explicitly. - - * editfns.c (text_property_stickiness): Fix Lisp_Object used as - boolean. - -2001-10-25 Miles Bader <miles@gnu.org> - - * xfns.c (png_load): Make sure SPECIFIED_BG is a string. - BG is a pointer to a structure, not a structure. - (gif_format, png_format): Add missing commas. - -2001-10-24 Richard M. Stallman <rms@gnu.org> - - * xfaces.c (Fface_attributes_as_vector): New function. - (syms_of_xfaces): Defsubr it. - -2001-10-24 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * dispnew.c (sync_window_with_frame_matrix_rows): Remove unused - variable `area'. - -2001-10-25 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * search.c (scan_newline): Remove unused variable `selective_display'. - -2001-10-25 Miles Bader <miles@gnu.org> - - * dispextern.h (struct image): Add `background', - `background_valid', and `background_transparent' fields. - (image_background, image_background_transparent): New declarations. - (IMAGE_BACKGROUND, IMAGE_BACKGROUND_TRANSPARENT): New macros. - * xfns.c (image_background, image_background_transparent) - (four_corners_best): New functions. - (xpm_format, png_format, jpeg_format, tiff_format, gif_format) - (gs_format): Add `:background' entry. - (lookup_image): Set IMG's background color if specified. - (pbm_load, xbm_load_image, png_load): Set IMG's background field - when appropriate. - (x_clear_image_1): Reset `background_valid' and - `background_transparent_valid' fields. - (x_build_heuristic_mask): Use IMAGE_BACKGROUND instead of - calculating it here. Set IMG's background_transparent field. - (enum xpm_keyword_index): Add XPM_BACKGROUND. - (enum png_keyword_index): Add PNG_BACKGROUND. - (enum jpeg_keyword_index): Add JPEG_BACKGROUND. - (enum tiff_keyword_index): Add TIFF_BACKGROUND. - (enum gif_keyword_index): Add GIF_BACKGROUND. - (enum gs_keyword_index): Add GS_BACKGROUND. - (pbm_load, png_load, jpeg_load, tiff_load, gif_load): - Pre-calculate image background color where necessary. - * xterm.c (x_setup_relief_colors): Use `IMAGE_BACKGROUND' and - `IMAGE_BACKGROUND_TRANSPARENT' to calculate the correct background - color to use for image glyph reliefs. - -2001-10-24 Gerd Moellmann <gerd@gnu.org> - - * xterm.c (x_draw_glyphs): Don't check for cursor overwriting - in full-width rows. - - * xterm.c (XTset_vertical_scroll_bar) [!USE_TOOLKIT_SCROLL_BARS]: - Fix clearing of area not covered by scroll bar. - -2001-10-24 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * xterm.c (x_insert_glyphs): Remove unused variables `real_end' - and `real_start'. - (x_draw_image_foreground): Remove unused variables `mask' and `xgcv'. - (glyph_rect): Remove unused variable `area'. - -2001-10-24 Gerd Moellmann <gerd@gnu.org> - - * xdisp.c: Change #ifdef GLYPH_DEBUG to #if. - - * xdisp.c (try_window_reusing_current_matrix): Use row_containing_pos. - (row_containing_pos): Take additional argument DY. - Treat rows ending in middle of char differently. - (display_line): Handle tabs on window systems differently. - - * xterm.c, w32term.c (fast_find_position): Call row_containing_pos - with additional argument. - - * dispextern.h (row_containing_pos): Adjust prototype. - - * xdisp.c (inhibit_try_window_id, inhibit_try_window_reusing) - (inhibit_try_cursor_movement) [GLYPH_DEBUG]: New variables. - (try_window_id, try_window_reusing_current_matrix) - (try_cursor_movement) [GLYPH_DEBUG]: Don't run if inhibited. - (syms_of_xdisp) [GLYPH_DEBUG]: DEFVAR_BOOL the variables. - -2001-10-24 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * xmenu.c: Spell the name of Emacs properly (GNU Emacs instead of - gnuemacs). - (HAVE_BOXES): Fix typo in comment. - (push_menu_pane): Fix typo in comment. - - * xdisp.c (display_prop_string_p): Remove unused local declaration - of `Qwhen'. - (single_display_prop_string_p): Remove unused local declarations - of `Qwhen' and `Qmargin'. - (string_buffer_position): Remove unused variable `around'. - (store_frame_title): Remove unused variable `width'. - - * window.c: Don't define max. - (coordinates_in_window): Remove unused variable `uy'. - - * widget.c: Don't define max. - - * process.c: Don't define max. - (create_process): Remove unused variable `buffer'. - -2001-10-23 Gerd Moellmann <gerd@gnu.org> - - * xfaces.c (Finternal_set_lisp_face_attribute): Fix compilation error. - -2001-10-23 Eli Zaretskii <eliz@is.elta.co.il> - - * xfaces.c (Finternal_set_lisp_face_attribute) - [HAVE_WINDOW_SYSTEM]: Don't do anything for QCfont unless the - frame is on a windowed display. - -2001-10-23 Gerd Moellmann <gerd@gnu.org> - - * dispnew.c (sync_window_with_frame_matrix_rows): - Fix handling of windows which aren't full-width, fix handling - of marginal areas. - - * lread.c (syms_of_lread) <recursive-load-depth-limit>: Raise to 50. - -2001-10-23 Andreas Schwab <schwab@suse.de> - - * m/macppc.h [LINUX]: Undef LD_SWITCH_SYSTEM_TEMACS and override - LD_SWITCH_MACHINE_TEMACS with "-Xlinker -znocombreloc". - -2001-10-23 Gerd Moellmann <gerd@gnu.org> - - * xterm.c (x_draw_glyphs): Remove parameters READ_START and - REAL_END. Notice if cursor gets overwritten. - (notice_overwritten_cursor): Take X positions as parameters. - (x_draw_phys_cursor_glyph): Save state of w->phys_cursor_on_p - around call to x_draw_glyphs. - -2001-10-23 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * syntax.c (modify-syntax-entry): Fix argument names (use CHAR - instead of C) and usage. - - * editfns.c (char-to-string): Fix argument names (use CHAR instead - of C) and usage. - - * xfns.c (Fx_show_tip): Remove unused variables `buffer', `top', - `left', `max_width' and `max_height'. - -2001-10-23 Gerd Moellmann <gerd@gnu.org> - - * xdisp.c (display_line): For a tab continued to the next line, - set row's ends_in_middle_of_char_p. - -2001-10-22 Gerd Moellmann <gerd@gnu.org> - - * xdisp.c (display_line): Fix computation of continuation lines - width for TABs. - -2001-10-22 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * xdisp.c (build_desired_tool_bar_string): Remove unused variable - `Qlaplace'. - - * fileio.c: Remove unused code. - -2001-10-22 Miles Bader <miles@gnu.org> - - * lisp.h (DEFVAR_LISP, DEFVAR_LISP_NOPRO, DEFVAR_BOOL) - (DEFVAR_INT, DEFVAR_PER_BUFFER, DEFVAR_KBOARD): - Remove `DOC_STRINGS_IN_COMMENTS' cases. - -2001-10-21 Jason Rumney <jasonr@gnu.org> - - * w32term.c (x_erase_phys_cursor): Remove inverse_p again. - -2001-10-21 Eli Zaretskii <eliz@is.elta.co.il> - - * mocklisp.c (Fml_if, Fml_provide_prefix_argument) - (Finsert_string): Avoid the multi-line string literals warning. - -2001-10-22 Miles Bader <miles@gnu.org> - - * doc.c (Vhelp_manyarg_func_alist): Variable removed. - (Fdocumentation): Don't use it. - (syms_of_doc): Don't initialize it. - - * keyboard.c (Ftrack_mouse): Add usage: string to doc string. - * print.c (Fwith_output_to_temp_buffer): Likewise. - * window.c (Fsave_window_excursion): Likewise. - * editfns.c (Fsave_excursion, Fsave_current_buffer) - (Fsave_restriction): Likewise. - * eval.c (Frun_hooks, Frun_hook_with_args) - (Frun_hook_with_args_until_failure) - (Frun_hook_with_args_until_success, Ffuncall, For, Fand, Fif) - (Fcond, Fprogn, Fprog1, Fprog2, Fsetq, Fquote, Ffunction, Fdefun) - (Fdefmacro, Fdefvar, Fdefconst, FletX, Flet, Fwhile, Fcatch) - (Funwind_protect, Fcondition_case): Likewise. - * coding.c (Ffind_operation_coding_system): Likewise. - * keyboard.c (Ftrack_mouse): Likewise. - -2001-10-21 Miles Bader <miles@gnu.org> - - * fns.c (Fappend, Fconcat, Fvconcat, Fnconc, Fwidget_apply) - (Fmake_hash_table): Add usage: string to doc string. - * editfns.c (Finsert, Finsert_and_inherit, Finsert_before_markers) - (Fmessage, Fmessage_box, Fmessage_or_box, Fpropertize, Fformat) - (Fencode_time, Finsert_and_inherit_before_markers): Likewise. - * mocklisp.c (Finsert_string, Fml_if, Fml_provide_prefix_argument) - (Fml_prefix_argument_loop): Likewise. - -2001-10-21 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * fileio.c (Finsert_file_contents): Remove unused variable `gap_size'. - - * sysdep.c (init_sys_modes): Change doc-string comments to `new - style' [w/`doc:' keyword]. - - * data.c, fileio.c, indent.c, print.c, search.c, sound.c, - * sunfns.c, textprop.c, undo.c, xselect.c: Change doc-string - comments to `new style' [w/`doc:' keyword]. - -2001-10-21 Jason Rumney <jasonr@gnu.org> - - * w32fns.c (Fx_file_dialog): Pass a filter to GetOpenFileName. - - * w32term.c (remember_mouse_glyph): New function. - (w32_mouse_position): Use it. - (note_mouse_movement): If the mouse moved off the glyph, remember - its new position. - - * w32term.h (struct w32_output): Correct spelling of x_compatible. - (w32_display_info): Add mouse_face_overlay. - - * w32term.c (notice_overwritten_cursor): Renamed from - note_overwritten_text_cursor. Rewritten to take glyph widths into - account. - (x_y_to_hpos_vpos): Add parameter BUFFER_ONLY_P. - (fast_find_string_pos): New function. - (fast_find_position): Return the correct vpos. Add parameter - STOP. In the final row, stop before glyphs having STOP as object. - Don't consider glyphs that are not from a buffer. - (fast_find_position) [0]: Add a presumably more correct version - for after 21.1. - (expose_window_tree, expose_frame): Don't compute intersections here. - (expose_window): Do it here instead. - (expose_window_tree, expose_window, expose_line): Return 1 when - overwriting mouse-face. - (expose_window): If W is the window currently being updated, mark - the frame garbaged. - (expose_frame): If mouse-face was overwritten, redo it. - (x_use_underline_position_properties): New variable. - (syms_of_xterm): DEFVAR_BOOL it. - (x_draw_glyph_string): Add comment to use it in future. - (x_draw_glyph_string): Restore clipping after drawing box. - Fix a computation of the underline position. - (w32_get_glyph_string_clip_rect): Minor cleanup. - (x_fill_stretch_glyph_string): Remove an assertion. - (x_produce_glyphs): Don't convert multibyte characters - to unibyte characters in unibyte buffers. - (cursor_in_mouse_face_p): New function. - (x_draw_stretch_glyph_string): Use it to choose a different GC - when drawing a cursor within highlighted text. Don't draw - background again if it has already been drawn. - (x_draw_glyph_string_box): Don't draw a full-width - box just because the glyph row's full_width_p flag is set. - (x_draw_glyphs): Fix computation of rightmost x for - full-width rows. - (x_dump_glyph_string): Put in #if GLYPH_DEBUG. - (w32_draw_relief_rect): Extend left shadow to the bottom and left; - change bottom shadow accordingly. Some cleanup. - (x_update_window_end): Handle overwritten mouse face - also for tool bar windows. - (show_mouse_face): Set the glyph row's mouse_face_p flag also when - DRAW is DRAW_IMAGE_RAISED. - (clear_mouse_face): Return 1 if text with mouse face was - actually redrawn. Make the function static. - Reset dpyinfo->mouse_face_overlay otherwise note_mouse_highlight might - optimize away highlighting if we pass over that same overlay again. - (note_mouse_highlight): Call mouse_face_overlay_overlaps - to detect a case where we have to highlight a different region - despite not having left the currently highlighted region. - Set mouse_face_overlay in the x_display_info. Avoid changing the - mouse pointer shape when show_mouse_face has already done it, or - there is no need. Handle mouse-face and help-echo in strings. - (glyph_rect): New function. - (w32_mouse_position): Use it to raise the threshold for mouse - movement event generation. - (w32_initialize_display_info): Initialize the x_display_info's - mouse_face_overlay. - (w32_set_vertical_scroll_bar): Don't clear a zero height - or width area. - (w32_set_vertical_scroll_bar, x_scroll_bar_create): Don't configure - a widget to zero height. - - * w32menu.c (single_submenu, w32_menu_show) [!HAVE_MULTILINGUAL_MENU]: - Protect unibyte strings created by replacing their multibyte - equivalents in menu_items. - (w32_menu_show): Don't overwrite an item's name with its key - description in case the description is a multibyte string. - (single_submenu): Some cleanup. - - * w32fns.c (x_laplace_read_row, x_laplace_write_row): Removed. - (postprocess_image): New function. - (lookup_image): Call it for all image types except PostScript. - (x_kill_gs_process): Call postprocess_image. - (tiff_error_handler, tiff_warning_handler): New functions. - (tiff_load): Install them as handlers. - (x_kill_gs_process): Recognize if someone has cleared the image - cache under us. - (valid_image_p): Protect better against invalid image - specifications. Previous code could signal an error. - (Fx_hide_tip, Fshow_tip): Doc fix. - (Fv_max_tooltip_size): New variable. - (syns_of_xfns): DEFVAR_LISP it. - (Fx_show_tip): Add parameter TEXT. Set the tip frame's root - window buffer to *tip* right after creating the frame. Set frame's - window_width. Use a maximum tooltip size specified by - Vx_max_tooltip_size, if that has valid contents. - (compute_tip_xy): Add parameters WIDTH and HEIGHT. - Make sure the tooltip is completely visible. - (x_create_tip_frame): Set tooltip buffer's truncate-lines to nil. - (Fx_create_frame): Adjust the frame's height for presence - of the tool bar before calling x_figure_window_size. - (x_set_tool_bar_lines): Clear the tool bar window's current matrix - when the window gets smaller. - (x_set_foreground_color): Set frame's cursor_pixel. - (x_set_foreground_color, x_set_background_color): Cleaned up. - (x_set_font): Handle case of x_new_fontset returning the same name - as before, although there was a change in fontsets. - -2001-10-21 Miles Bader <miles@gnu.org> - - * data.c (Fplus, Fminus, Fmax, Ftimes, Fquo, Flogand, Flogior) - (Flogxor): Add usage: string to doc string. - * charset.c (Fstring): Likewise. - * callproc.c (Fcall_process_region, Fcall_process): Likewise. - * alloc.c (Fmake_byte_code, Fvector, Flist): Likewise. - -2001-10-21 Pavel Jan,Am(Bk <Pavel@Janik.cz> - - * buffer.c: Reindent DEFUNs and DEFVARs with doc: keywords. - - * alloc.c: Reindent DEFUNs with doc: keywords. - - * abbrev.c (Finsert_abbrev_table_description): Reindent. - - * frame.c: Change doc-string comments to `new style' [w/`doc:' - keyword]. - -See ChangeLog.9 for earlier changes. +See ChangeLog.10 for earlier changes. ;; Local Variables: ;; coding: iso-2022-7bit ;; add-log-time-zone-rule: t ;; End: - Copyright (C) 2001, 2002, 2003, 2004, 2005, - 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2007 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -29074,4 +2448,4 @@ See ChangeLog.9 for earlier changes. Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -;;; arch-tag: 5dcc435f-4038-4141-b3bf-5be51cd76bd4 +;; arch-tag: dfb6ad96-1550-4905-9e53-d2059ee84c40 diff --git a/src/ChangeLog.10 b/src/ChangeLog.10 new file mode 100644 index 00000000000..f0e0f191b9a --- /dev/null +++ b/src/ChangeLog.10 @@ -0,0 +1,27934 @@ +2007-04-24 Chong Yidong <cyd@stupidchicken.com> + + * Branch for 22.1. + +2007-04-24 Chong Yidong <cyd@stupidchicken.com> + + * xdisp.c (redisplay_window): Use BEG_UNCHANGED and END_UNCHANGED + values of the actual window. + +2007-04-23 Richard Stallman <rms@gnu.org> + + * process.c (Fstart_process): Doc fix. + +2007-04-23 Eli Zaretskii <eliz@gnu.org> + + * process.c (Fstart_process): Doc fix. + +2007-04-22 Richard Stallman <rms@gnu.org> + + * abbrev.c (Fdefine_abbrev): Doc fix. + + * keymap.c (Fdefine_key): Minor doc fix. + +2007-04-21 Glenn Morris <rgm@gnu.org> + + * keymap.c (Fdefine_key): Fix info ref in doc string. + +2007-04-20 Glenn Morris <rgm@gnu.org> + + * sysdep.c (init_system_name): Don't accept localhost.localdomain. + +2007-04-19 Juanma Barranquero <lekktu@gmail.com> + + * minibuf.c (Fminibuffer_contents, Fminibuffer_contents_no_properties) + (Fminibuffer_completion_contents, Fdelete_minibuffer_contents): + Doc fixes. + +2007-04-16 Chong Yidong <cyd@stupidchicken.com> + + * dispnew.c (adjust_frame_glyphs_for_frame_redisplay): + Set garbaged flag in presence of window margins. + (showing_window_margins_p): New function. + + * xdisp.c (cursor_row_p): Only end row on newline if it's a + display string. Suggested by Lennart Borgman. + +2007-04-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * alloc.c (mem_insert): Set min_heap_address and max_heap_address + if they are not yet initialized. + +2007-04-15 Chong Yidong <cyd@stupidchicken.com> + + * xdisp.c (redisplay_window): When deciding whether or not to + recenter, don't use the reset values of BEG_UNCHANGED and + END_UNCHANGED. + +2007-04-13 Kim F. Storm <storm@cua.dk> + + * buffer.c (Fkill_buffer): gcpro BUF during kill_buffer_processes + and check that buffer is still alive upon return. + +2007-04-13 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c [!TARGET_API_MAC_CARBON]: Include Displays.h. + (mac_screen_config_changed): New variable. + (mac_handle_dm_notification, init_dm_notification_handler) + (mac_get_screen_info): New functions. + [MAC_OS8] (main): Call init_dm_notification_handler. + (mac_initialize) [MAC_OSX]: Likewise. + (XTread_socket): Call mac_get_screen_info if screen config changed. + (mac_initialized): Make static. + (mac_initialize_display_info): Remove function. + (mac_term_init): Call mac_get_screen_info. Add partial contents of + mac_initialize_display_info. + +2007-04-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * mac.c (xrm_get_preference_database, Fmac_get_preference) + [TARGET_API_MAC_CARBON]: Use CFPreferencesAppSynchronize. + + * macterm.c [TARGET_API_MAC_CARBON] (mac_post_mouse_moved_event): + Use GetGlobalMouse instead of GetMouse and LocalToGlobal. + (mac_initialize_display_info) [MAC_OSX]: Use CGRectZero. + (mac_initialize_display_info) [!MAC_OSX]: dpyinfo->height and + dpyinfo->width are those of whole screen. + +2007-04-10 Chong Yidong <cyd@stupidchicken.com> + + * xdisp.c (note_mode_line_or_margin_highlight): Don't decrement + glyph pointer before start of glyph row. + +2007-04-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * s/darwin.h (__restrict, struct kboard): Remove outdated workarounds. + (C_SWITCH_SYSTEM): Remove `-I../mac/src'. + +2007-04-09 Martin Rudalics <rudalics@gmx.at> + + * indent.c (Fmove_to_column): Set next_boundary with correct start pt. + +2007-04-08 Richard Stallman <rms@gnu.org> + + * xdisp.c (syms_of_xdisp) <message-log-max>: Default 100. + +2007-04-07 Chong Yidong <cyd@stupidchicken.com> + + * editfns.c (Ftranspose_regions): Validate interval before setting + text properties. + +2007-04-03 Eli Zaretskii <eliz@gnu.org> + + * emacs.c (main): Fix instructions for building Emacs for profiling. + +2007-04-03 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (xg_update_menubar): Call g_list_next after moving + menu bar item. + +2007-04-02 Juanma Barranquero <lekktu@gmail.com> + + * print.c (Fprin1_to_string): Use macro SPECPDL_INDEX. + +2007-04-01 Chong Yidong <cyd@stupidchicken.com> + + * keymap.c (Fcommand_remapping): New optional argument. + (where_is_internal): Use new keymaps argument. + (Fkey_binding): Caller changed. + + * keyboard.c (command_loop_1): Caller changed. + +2007-03-31 Eli Zaretskii <eliz@gnu.org> + + * window.c (Fget_lru_window): Doc fix. + +2007-03-30 Chong Yidong <cyd@stupidchicken.com> + + * undo.c (Fprimitive_undo): Give clearer error message when trying + to change text properties outside accessible part of buffer. + +2007-03-29 Kim F. Storm <storm@cua.dk> + + * process.c (wait_reading_process_output) [HAVE_PTYS]: + When EIO happens, clear channel from descriptor masks before raising + SIGCHLD signal to avoid busy loop between read and sigchld_handler. + (sigchld_handler): Remove sleep (2007-03-11 & 2007-03-26 changes). + +2007-03-29 Juanma Barranquero <lekktu@gmail.com> + + * buffer.c (Fset_buffer_major_mode): Check that BUFFER is valid. + + * process.c (Fformat_network_address): Return nil when the + argument vector contains invalid values. + +2007-03-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * gmalloc.c [HAVE_GTK_AND_PTHREAD]: Define USE_PTHREAD. + [USE_PTHREAD]: Include pthread.h. + (malloc_init_once_control, _malloc_mutex) [USE_PTHREAD]: New variables. + (malloc_initialize_1): New function created from __malloc_initialize. + (__malloc_initialize): Use it. + (LOCK, UNLOCK): New macros to make malloc etc. thread safe. + (_malloc_internal, _free_internal, _realloc_internal): Use them. + + * lread.c (readchar): Extend BLOCK_INPUT block to ferror/clearerr. + +2007-03-27 Juanma Barranquero <lekktu@gmail.com> + + * process.c (Fformat_network_address): Make args array big enough + to format IPv6 addresses. + +2007-03-27 Glenn Morris <rgm@gnu.org> + + * m/hp800.h: Restore HP-UX support (removed 2007-01-29). + +2007-03-26 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macfns.c (Fx_display_mm_height, Fx_display_mm_width): Scale whole + screen size in pixels by millimeters per pixel of main display. + + * macselect.c (get_scrap_target_type_list, x_own_selection): + Move assignments outside predicate macros. + (Vselection_converter_alist): Doc fix. + + * macterm.c (create_text_encoding_info_alist): Move assignments + outside predicate macros. + (mac_initialize_display_info) [MAC_OSX]: dpyinfo->height and + dpyinfo->width are those of whole screen. + +2007-03-26 Sam Steingold <sds@gnu.org> + + * process.c (sigchld_handler): Delay by 1ms instead of 1s to + alleviate sluggishness (the original problem is still fixed). + +2007-03-25 Kim F. Storm <storm@cua.dk> + + * intervals.c (merge_properties): Use explicit loop instead of + Fplist_member to avoid QUIT. Don't use Fcdr. + (intervals_equal): Likewise. Rewrite loop to perform length check + on the fly rather than calling Flength. Don't use Fcar. + +2007-03-24 Eli Zaretskii <eliz@gnu.org> + + * editfns.c (Fgoto_char): Doc fix. + + * indent.c (Findent_to): Doc fix. + +2007-03-24 Chong Yidong <cyd@stupidchicken.com> + + * editfns.c (Ftranspose_regions): Use set_text_properties_1 + instead of Fset_text_properties to avoid GC. Signal after change. + +2007-03-24 Eli Zaretskii <eliz@gnu.org> + + * xfns.c (Fx_show_tip): Doc fix. + + * macfns.c (Fx_show_tip): Doc fix. + + * w32fns.c (Fx_show_tip): Doc fix. + +2007-03-23 Kim F. Storm <storm@cua.dk> + + * intervals.c (merge_properties, intervals_equal): + Use Fplist_member instead of Fmemq to find properties. + +2007-03-23 Glenn Morris <rgm@gnu.org> + + * unexhp9k800.c: Restore file with clarified legal status. + * m/sr2k.h: Restore since dependency unexhp9k800.c is restored. + +2007-03-22 Chong Yidong <cyd@stupidchicken.com> + + * widget.c (EmacsFrameSetCharSize): Catch X errors. + +2007-03-22 Kenichi Handa <handa@m17n.org> + + * fileio.c (Fcopy_file): Call barf_or_query_if_file_exists with + non-encoded file name. + (Frename_file): Likewise. + (Fadd_name_to_file): Likewise. + (Fmake_symbolic_link): Likewise. + +2007-03-20 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * Makefile.in (alloca.o, gtkutil.o): Depend on systime.h. + (dired.o, editfns.o, fileio.o, msdos.o): Depend on atimer.h. + (dosfns.o, window.o, fns.o, macselect.o): Depend on atimer.h and + systime.h. + (term.o, print.o, lread.o): Depend on blockinput.h, atimer.h, and + systime.h. + (macfns.o): Remove duplicate dependency on systime.h. + + * dispnew.c (Fopen_termscript): Add BLOCK_INPUT around fclose. + (Fsend_string_to_terminal): Add BLOCK_INPUT around fwrite. + + * fileio.c (do_auto_save_unwind): Add BLOCK_INPUT around fclose. + (Fdo_auto_save): Add BLOCK_INPUT around fwrite. + + * keyboard.c (record_char): Add BLOCK_INPUT around fwrite. + (Fopen_dribble_file): Add BLOCK_INPUT around fclose. + + * lread.c: Include blockinput.h. + (readchar, Fget_file_char): Add BLOCK_INPUT around getc. + (unreadchar): Add BLOCK_INPUT around ungetc. + (load_unwind): Add BLOCK_INPUT around fclose. + + * print.c: Include blockinput.h. + (Fredirect_debugging_output): Add BLOCK_INPUT around fclose. + + * process.c (Fmake_network_process) [HAVE_GETADDRINFO]: + Clear immediate_quit before calling freeaddrinfo. + Add BLOCK_INPUT around freeaddrinfo. + + * term.c: Include blockinput.h. + (write_glyphs, insert_glyphs): Add BLOCK_INPUT around fwrite. + +2007-03-19 Richard Stallman <rms@gnu.org> + + * keyboard.c (NUM_RECENT_KEYS): Bump up to 300. + + * buffer.c (syms_of_buffer): Doc fix. + +2007-03-18 Chong Yidong <cyd@stupidchicken.com> + + * image.c (pbm_load): Signal error for invalid image size. + +2007-03-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c (note_mouse_movement): Don't return immediately for + LeaveNotify case. + + * macmenu.c (popup_activated_flag): New variable. + (x_activate_menubar, mac_menu_show): Set it during menu tracking. + (popup_activated): New function. + + * xdisp.c (redisplay_internal, note_mouse_highlight): + Check popup_activated for MAC_OS. + +2007-03-17 Juanma Barranquero <lekktu@gmail.com> + + * buffer.c (syms_of_buffer) <buffer-display-table>: Doc fix. + Reported by Nikolaj Schumacher <n_schumacher@web.de>. + +2007-03-17 Richard Stallman <rms@gnu.org> + + * dired.c (file_name_completion): gcpro NAME. + +2007-03-17 Chong Yidong <cyd@stupidchicken.com> + + * xdisp.c (try_window_id): Increment matrix positions if the + buffer's byte count has increased, but not the character count. + +2007-03-12 Andreas Schwab <schwab@suse.de> + + * lisp.h: Declare check_obarray. + + * process.c (Fdelete_process): Properly handle deletion of first + element of deleted_pid_list. + (create_process): Declare pid as pid_t. + +2007-03-12 Kim F. Storm <storm@cua.dk> + + * process.c (sigchld_handler): Change type of pid to pid_t. + Scan deleted_pid_list explicitly to avoid using Fmember which don't + know about mark bits and make_fixnum_or_float which may malloc. + Reported by Andreas Schwab. + + * keyboard.c (read_key_sequence): Store original event into keybuf + when replaying sequence with local keymap(s) from string. + +2007-03-12 Glenn Morris <rgm@gnu.org> + + * editfns.c (Fdecode_time, Fencode_time): Doc fix ("daylight + savings" to "daylight saving"). + +2007-03-11 Sam Steingold <sds@gnu.org> + + * process.c (sigchld_handler): Sleep before wait3 to avoid a busyloop. + +2007-03-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macfns.c (Fx_server_vendor): Change vendor string to "Apple Inc.". + +2007-03-10 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c [USE_CARBON_EVENTS] (mac_handle_mouse_event): + Ignore mouse wheel movement on title bar or tool bar. + +2007-03-10 Chong Yidong <cyd@stupidchicken.com> + + * keyboard.c (help_form_saved_window_configs): New var. + (read_char_help_form_unwind): New function. + (read_char): Don't restore window configuration if a mouse click + arrives while the help form is being displayed. + +2007-03-10 Kim F. Storm <storm@cua.dk> + + * xdisp.c (redisplay_window): Don't automatically select a new window + start for a contination line during mouse-click. + +2007-03-09 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.c (handle_one_xevent): Ignore buttons > 3 for the tool bar. + +2007-03-09 Juanma Barranquero <lekktu@gmail.com> + + * keymap.c (Fdescribe_buffer_bindings): Check that BUFFER is valid. + +2007-03-08 Richard Stallman <rms@gnu.org> + + * keyboard.c (syms_of_keyboard): Doc fix. + +2007-03-08 Chong Yidong <cyd@stupidchicken.com> + + * minibuf.c (Ftry_completion): Don't short circuit if + completion-ignore-case is non-nil. + +2007-03-07 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macfns.c (mac_set_scroll_bar_width, mac_frame_parm_handlers): + Undo 2006-03-06 changes. + + * macterm.c (XTset_vertical_scroll_bar) [MAC_OSX]: Don't show scroll + bar if its width is smaller than that of Aqua small scroll bar. + +2007-03-07 Stefan Monnier <monnier@iro.umontreal.ca> + + * minibuf.c (read_minibuf): Bind inhibit-read-only a bit longer so as + to handle correctly prompts with read-only property. + +2007-03-06 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * sound.c (wav_play): Check header->data_length to see how much we + shall read. + (alsa_period_size): Convert ALSA period size in frames to bytes. + (alsa_write): Return if frames is zero. + +2007-03-06 Kenichi Handa <handa@m17n.org> + + * xselect.c (Vselection_coding_system): Documentation improved. + +2007-03-05 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c (x_scroll_bar_create, XTread_socket): Replace #if + USE_TOOLKIT_SCROLL_BARS with #ifdef USE_TOOLKIT_SCROLL_BARS. + (x_set_window_size): Call SET_FRAME_GARBAGED. Clear window if + internal border width has changed. + + * macterm.h (struct mac_output): New member `internal_border_width'. + +2007-03-04 Richard Stallman <rms@gnu.org> + + * window.c (Fdisplay_buffer): Doc fix. + +2007-03-03 Glenn Morris <rgm@gnu.org> + + * Makefile.in: Don't clear out LIB_X11_LIB, since XFT_LIBS does + not include -lX11 on Solaris. + +2007-03-02 Stuart D. Herring <herring@lanl.gov> + + * keymap.c (Fkey_binding): Don't consider one-element lists as events. + +2007-03-01 Kenichi Handa <handa@m17n.org> + + * process.c (send_process_object): Check the process status and + signal an error if something is wrong. + +2007-02-28 Chong Yidong <cyd@stupidchicken.com> + + * insdel.c (Fcombine_after_change_execute): Return nil if + combine_after_change_buffer has been invalidated. + +2007-02-25 Dan Nicolaescu <dann@ics.uci.edu> + + * m/xtensa.h: New file. + +2007-02-24 Nick Roberts <nickrob@snap.net.nz> + + * .gdbinit (xprintstr): Ensure GDB (> 6.6) prints symbol name + as strings and not character arrays. + +2007-02-24 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c [USE_TOOLKIT_SCROLL_BARS] (x_scroll_bar_handle_drag) + (x_set_toolkit_scroll_bar_thumb): Add bar->min_handle as margin to + scroll bar handle size in order to avoid `scroll backward' problem. + (x_scroll_bar_create, XTset_vertical_scroll_bar) + [USE_TOOLKIT_SCROLL_BARS]: Initialize bar->min_handle. + + * macterm.h (struct scroll_bar) [USE_TOOLKIT_SCROLL_BARS]: + New member `min_handle'. + +2007-02-23 Kim F. Storm <storm@cua.dk> + + * print.c (print): Reset print_number_index if Vprint_number_table + is nil. + +2007-02-23 Eli Zaretskii <eliz@gnu.org> + + * w32.c (stat, get_long_basename, is_unc_volume): Use _mbspbrk + instead of strpbrk. + +2007-02-23 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macmenu.c (mac_menu_show): Call unbind_to early. Use variable + `menu_item_selection' as in W32 version. + [TARGET_API_MAC_CARBON] (mac_handle_dialog_event): Add explicit + braces to avoid ambiguous `else'. + + * macterm.c (mac_display_info_for_display): Remove function. + (mac_flush_display_optional) [USE_CG_DRAWING]: New function. + (x_redisplay_interface) [USE_CG_DRAWING]: Set it as handler for + flush_display_optional. + [USE_TOOLKIT_SCROLL_BARS] (x_scroll_bar_handle_press): + New argument MOUSE_POS. All uses changed. Set bar->dragging to + negative integer if scroll bar handle is pressed. + [USE_TOOLKIT_SCROLL_BARS] (x_scroll_bar_handle_release): + Negative bar->dragging means scroll bar handle is not dragged. + [USE_TOOLKIT_SCROLL_BARS] (x_scroll_bar_handle_drag): Get initial + offset of scroll bar handle from negative bar->dragging. + (XTread_socket) [USE_TOOLKIT_SCROLL_BARS]: Modifiers for scroll + bar click is compared against mapped one. Set down/up_modifier + for scroll bar click event with control key. + + * macterm.h (x_display_info_for_display): Remove extern. + (SCROLL_BAR_UNPACK, SET_SCROLL_BAR_CONTROL_HANDLE): Don't limit + value to be unpacked to 32-bit on LP64 model. + +2007-02-23 Kenichi Handa <handa@m17n.org> + + * process.c (send_process_object_unwind): New function. + (send_process_object): New function. + (Fprocess_send_region): Call send_process_object. + (Fprocess_send_string): Likewise. + +2007-02-22 Jason Rumney <jasonr@gnu.org> + + * w32menu.c (w32_menu_show): Mark the frame's menu as inactive + when popup menu finishes. + + * w32fns.c (menubar_in_use): New flag. + (w32_wnd_proc) <WM_INITMENU, WM_EXITMENULOOP, WM_TIMER, WM_COMMAND>: + Use it. + + * w32menu.c (Fx_popup_menu): Don't free menu strings here. + (w32_menu_show): Do it here instead. + + * w32fns.c (w32_wnd_proc) <WM_INITMENU>: Set menubar_active frame + parameter. + + * w32menu.c (current_popup_menu): Make available globally. + (menubar_selection_callback): Free menu strings before pushing the + menu event into the keyboard buffer. Remove menu_command_in_progress. + + * w32fns.c (current_popup_menu): Use from w32menu.c. + (w32_wnd_proc) <WM_EXITMENULOOP, WM_TIMER>: Use menubar_active + and current_popup_menu to determine whether a menubar menu has + been cancelled. + + * w32term.h (w32_output): Remove menu_command_in_progress. + +2007-02-22 Kim F. Storm <storm@cua.dk> + + * dispnew.c (update_frame, update_single_window): Set force_p here if + redisplay_dont_pause is set or Vredisplay_preemption_period is nil... + (update_window, update_frame_1): ... instead of here. + (update_text_area): Clear mouse face on header lines. + +2007-02-21 Kim F. Storm <storm@cua.dk> + + * minibuf.c (Fassoc_string): Doc fix. Allow symbol for KEY too. + +2007-02-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c (WINDOW_RESOURCE, TERM_WINDOW_RESOURCE): Remove macros. + [USE_MAC_TSM] (mac_handle_text_input_event): Remove unused variable + `mapped_modifiers'. + (XTread_socket) [MAC_OS_X_VERSION_MAX_ALLOWED >= 1020]: Use Keyboard + Layout Services routines to get current Unicode keyboard layout. + +2007-02-20 Chong Yidong <cyd@stupidchicken.com> + + * frame.c (x_set_screen_gamma): Apply gamma value to the frame's + bgcolor. + +2007-02-19 Kim F. Storm <storm@cua.dk> + + * minibuf.c (Fassoc_string): Allow symbols as keys. + + * w32term.c (w32_set_scroll_bar_thumb): Don't resize scroll-bar + handle while dragging, except when we get close to eob. + Fix position and size calculations so we don't scroll backwards + just by clicking on the handle. + +2007-02-17 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * Makefile.in (${emacsapp}Contents/Resources/Emacs.rsrc) + [HAVE_CARBON]: Remove target. + (macosx-app) [HAVE_CARBON]: Don't depend on it. + +2007-02-17 Juanma Barranquero <lekktu@gmail.com> + + * callproc.c (syms_of_callproc) <doc-directory>: + <configure-info-directory>: + (Fgetenv_internal): Fix typos in docstrings. + + * doc.c (Fsubstitute_command_keys): Fix typo in docstring. + +2007-02-16 Andreas Schwab <schwab@suse.de> + + * frame.c (Fmodify_frame_parameters): Return a value. + + * editfns.c (Fformat): Add support for '+' flag. + * doprnt.c (doprnt1): Likewise. Fix overflow checking. + +2007-02-14 Chong Yidong <cyd@stupidchicken.com> + + * s/umips.h: Unused file removed. + +2007-02-14 Juanma Barranquero <lekktu@gmail.com> + + * xfaces.c (Fcolor_distance): Don't continue checking a color for + errors after it has been correctly parsed as an RGB list. + +2007-02-14 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.c (do_ewmh_fullscreen): Also check for _NET_WM_STATE_FULLSCREEN. + +2007-02-13 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macfns.c (Fx_focus_frame): Move current process to foreground if + it is not. + [TARGET_API_MAC_CARBON] (Fx_file_dialog): Replace #if MAC_OSX with + #ifdef MAC_OSX. + (Fmac_set_font_panel_visible_p) [USE_MAC_FONT_PANEL]: Rename from + Fmac_set_font_panel_visibility. All uses changed. Rename argument + VISIBLE to FLAG. + + * macterm.c (MakeMeTheFrontProcess) [MAC_OSX]: Remove function. + (mac_initialize) [MAC_OSX]: Call SetFrontProcess instead of + MakeMeTheFrontProcess. + +2007-02-12 Chong Yidong <cyd@stupidchicken.com> + + * frame.c (x_set_screen_gamma): Clear face cache. + +2007-02-11 Juanma Barranquero <lekktu@gmail.com> + + * buffer.c (Fgenerate_new_buffer_name, Fbuffer_modified_tick): + Reflow docstrings. + +2007-02-10 Eli Zaretskii <eliz@gnu.org> + + * window.c (Fwindow_height, Fwindow_hscroll) + (Fwindow_redisplay_end_trigger, Fwindow_point, Fwindow_start) + (Fwindow_end, Fwindow_display_table, Fwindow_text_height): + Document the effect of WINDOW arg being nil. + +2007-02-08 Kim F. Storm <storm@cua.dk> + + * minibuf.c (read_minibuf): Fix 2007-01-30 change. + Use Qlambda as interim value of Vminibuffer_completing_file_name. + (Fcompleting_read): Use non-filename maps if value is Qlambda (or Qnil). + (syms_of_minibuf) <minibuffer-completing-file-name>: Document lambda. + +2007-02-07 Juanma Barranquero <lekktu@gmail.com> + + * makefile.w32-in ($(TRES)): Use literal "../nt/emacs.rc" instead + of $(ALL_DEPS). + +2007-02-07 Eli Zaretskii <eliz@gnu.org> + + * makefile.w32-in ($(TRES)): Depend on stamp_BLD, since $(TRES) is + put into $(BLD). + +2007-02-06 Chong Yidong <cyd@stupidchicken.com> + + * frame.c (Fmodify_frame_parameters): Don't bind + Qinhibit_default_face_x_resources, which has no effect. + (Qinhibit_default_face_x_resources): Symbol deleted. + +2007-02-03 Eli Zaretskii <eliz@gnu.org> + + * indent.c (Fmove_to_column): Document that the argument COLUMN is + taken from prefix numeric argument. + +2007-02-03 Juanma Barranquero <lekktu@gmail.com> + + * lread.c (syms_of_lread) <load-history>: Doc fix. + +2007-01-29 Andreas Seltenreich <uwi7@rz.uni-karlsruhe.de> (tiny change) + + * xterm.c [!USE_TOOLKIT_SCROLL_BARS] (x_scroll_bar_expose): + Use the foreground color of the scroll-bar face when drawing + the scroll-bar's border. + +2007-02-02 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.c (do_ewmh_fullscreen): Check that what != NULL before + calling wm_supports. + +2007-02-01 Juanma Barranquero <lekktu@gmail.com> + + * lread.c (syms_of_lread) <user-init-file>: Doc fix. + Wording by Eli Zaretskii. + +2007-01-31 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (update_frame_tool_bar): Initialize h/vmargin to 0. + +2007-01-30 Richard Stallman <rms@gnu.org> + + * minibuf.c (read_minibuf): + Save and clear Vminibuffer_completing_file_name. + (read_minibuf_unwind): Restore it. + (Vminibuffer_completion_table, Qminibuffer_completion_table) + (Vminibuffer_completion_predicate, Qminibuffer_completion_predicate) + (Vminibuffer_completion_confirm, Qminibuffer_completion_confirm) + (Vminibuffer_completing_file_name): Definitions moved up. + +2007-01-29 Chong Yidong <cyd@stupidchicken.com> + + * m/hp800.h: Restore, removing HP-UX support. + +2007-01-29 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * Makefile.in: Use a variable, XFT_LIBS, instead #define LIB_X11_LIB. + +2007-01-28 Richard Stallman <rms@gnu.org> + + * minibuf.c (Ftry_completion, Fall_completions) + (Fcompleting_read, Ftest_completion): + Rename arg ALIST or TABLE to COLLECTION. + +2007-01-27 Chong Yidong <cyd@stupidchicken.com> + + * unexhp9k800.c: Remove due to lack of legal papers. + + * m/sr2k.h, m/hp800.h: Remove due to dependence on above. + +2007-01-27 Eli Zaretskii <eliz@gnu.org> + + * keyboard.c (Fthis_command_keys, Fthis_command_keys_vector): Doc fix. + + * minibuf.c (Fcompleting_read): Doc fix. + +2007-01-26 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (xg_initialize): Call XftInit if HAVE_XFT. + + * Makefile.in: Use XFT_LIBS if defined. + +2007-01-26 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * alloc.c (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Use + BLOCK_INPUT/UNBLOCK_INPUT. + + * blockinput.h (interrupt_input_blocked): Declare volatile. + + * keyboard.c (interrupt_input_blocked): Declare volatile. + + * syssignal.h (SIGNAL_THREAD_CHECK): Use pthread_equal. + +2007-01-24 Kim F. Storm <storm@cua.dk> + + * keymap.c (describe_map): Don't consider prefix keys to be shadowed. + +2007-01-23 Juanma Barranquero <lekktu@gmail.com> + + * editfns.c (Finsert_char): Doc fix. + (Fget_internal_run_time, Fdecode_time): Fix typos in docstrings. + +2007-01-22 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macselect.c [TARGET_API_MAC_CARBON] (mac_do_receive_drag): + Don't pass keyboard modifiers to mac_store_drag_event, but put + them as kEventParamKeyModifiers Apple event parameter. + +2007-01-21 Chong Yidong <cyd@stupidchicken.com> + + * xdisp.c (try_window): Revert previous change. + + * dispnew.c (update_text_area): Revert 2006-09-17 change. + Always redraw non-mode-line rows with mouse-face. + +2007-01-20 Chong Yidong <cyd@stupidchicken.com> + + * xdisp.c (try_window): Clear mouse-face highlights first. + + * window.c (set_window_buffer): Revert 2006-11-22 change. + +2007-01-20 Eli Zaretskii <eliz@gnu.org> + + * .gdbinit (ppt, xtype, xmisctype, xint, xptr, xmarker, xframe) + (xbuffer, xcons, xcar, xcdr): Fix doc strings. + +2007-01-20 Chong Yidong <cyd@stupidchicken.com> + + * keyboard.c (read_key_sequence): Extract local map only if the + given position is in an accessible buffer region. + +2007-01-19 Nick Roberts <nickrob@snap.net.nz> + + * .gdbinit: Reformat documentation so that first sentence + displays properly with "help user-defined" (like apropos). + +2007-01-18 Bruno Haible <bruno@clisp.org> (tiny change) + + * epaths.in: Move PATH_DOC from local/info to local/share/info. + +2007-01-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macmenu.c (create_and_show_dialog) [TARGET_API_MAC_CARBON]: + Create movable modal window instead of movable alert window. + (create_and_show_dialog) [!MAC_OSX]: Use DeactivateControl instead + of DisableControl. + + * macselect.c (Fmac_resume_apple_event): Set error number when + descriptor type of reply is non-null. + +2007-01-14 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macmenu.c (create_and_show_dialog) [TARGET_API_MAC_CARBON]: + Use DisableControl for disabled items. Set default button to first + enabled one. Use icon of application in execution. + +2007-01-13 Eli Zaretskii <eliz@gnu.org> + + * process.c (Fdelete_process, Fprocess_id, sigchld_handler): + Copy PID into EMACS_INT to avoid GCC warnings. + + * fns.c (maybe_resize_hash_table): Copy new size of hash table + into EMACS_INT to avoid GCC warnings. + + * editfns.c (Fuser_uid, Fuser_real_uid): Copy values returned by + geteuid and getuid into EMACS_INT to avoid GCC warnings. + + * dired.c (Ffile_attributes): Fix last change. + +2007-01-12 Eli Zaretskii <eliz@gnu.org> + + * dired.c (Ffile_attributes): Copy some members of `struct stat' + into int's to avoid GCC warnings about limited range of short in + arguments to FIXNUM_OVERFLOW_P. + +2007-01-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macmenu.c (HAVE_DIALOGS): Define if TARGET_API_MAC_CARBON. + (mac_handle_dialog_event, install_dialog_event_handler) + (create_and_show_dialog) [TARGET_API_MAC_CARBON]: New functions. + (DIALOG_LEFT_MARGIN, DIALOG_TOP_MARGIN, DIALOG_RIGHT_MARGIN) + (DIALOG_BOTTOM_MARGIN, DIALOG_MIN_INNER_WIDTH) + (DIALOG_MAX_INNER_WIDTH, DIALOG_BUTTON_BUTTON_HORIZONTAL_SPACE) + (DIALOG_BUTTON_BUTTON_VERTICAL_SPACE, DIALOG_BUTTON_MIN_WIDTH) + (DIALOG_TEXT_MIN_HEIGHT, DIALOG_TEXT_BUTTONS_VERTICAL_SPACE) + (DIALOG_ICON_WIDTH, DIALOG_ICON_HEIGHT, DIALOG_ICON_LEFT_MARGIN) + (DIALOG_ICON_TOP_MARGIN) [TARGET_API_MAC_CARBON]: New macros. + (mac_dialog) [TARGET_API_MAC_CARBON]: Remove function. + (mac_dialog_show) [TARGET_API_MAC_CARBON]: Use create_and_show_dialog. + + * macterm.c (x_free_frame_resources) [USE_CG_DRAWING]: + Call mac_prepare_for_quickdraw. + (quit_char, make_ctrl_char) [TARGET_API_MAC_CARBON]: Move externs + outside #ifdef MAC_OSX. + (mac_quit_char_key_p) [TARGET_API_MAC_CARBON]: Move function + outside #ifdef MAC_OSX. + (mac_check_bundle) [MAC_OSX]: Remove unused function. + + * macterm.h (mac_quit_char_key_p): Move extern outside #ifdef MAC_OSX. + (HOURGLASS_WIDTH, HOURGLASS_HEIGHT): Parenthesize definitions. + +2007-01-11 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * alloc.c (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Use pthread_equal, + block/unblock SIGIO. + +2007-01-10 Stefan Monnier <monnier@iro.umontreal.ca> + + * editfns.c (Fformat): Allow integer-format to work with floats of size + larger than most-positive-fixnum (but still smaller than MAXINT). + + * dired.c (Ffile_attributes): Use floats for large uids/gids. + +2007-01-09 Eli Zaretskii <eliz@gnu.org> + + * emacs.c (syms_of_emacs) <path-separator>: Doc fix. + +2007-01-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * callproc.c (Fcall_process_region) [HAVE_MKSTEMP]: Add BLOCK_INPUT + around mkstemp. + + * image.c (XDrawLine) [MAC_OS]: Remove macro. + (XCreateGC_pixmap) [!HAVE_NTGUI]: Likewise. + (x_disable_image) [!HAVE_NTGUI]: Use XCreateGC instead of + XCreateGC_pixmap. + + * macgui.h (Display): Typedef to opaque type. + + * macmenu.c (mac_dialog_modal_filter) [MAC_OSX]: New function. + (Fx_popup_dialog) [MAC_OSX]: Use standard alert if called from + Fmessage_box, Fyes_or_no_p, or Fy_or_n_p. + [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030] (menu_quit_handler): + Use mac_quit_char_key_p. + + * macterm.c (XDrawLine): Rename from mac_draw_line_to_pixmap. + (XCreateGC): Change type of 2nd argument to void *. + (XFreeGC) [USE_CG_DRAWING && MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]: + Fix last change. + (mac_to_emacs_modifiers): Change return type to int. + [USE_CARBON_EVENTS] (mac_event_to_emacs_modifiers): Likewise. + (mac_mapped_modifiers): New function. + (XTread_socket): Use it. + [USE_TSM] (mac_handle_text_input_event): Likewise. + (do_window_update) [USE_CG_DRAWING]: Call mac_prepare_for_quickdraw. + (mac_quit_char_modifiers, mac_quit_char_keycode) [MAC_OSX]: + Remove variables. + (mac_determine_quit_char_modifiers, init_quit_char_handler) + [MAC_OSX]: Remove functions. + (make_ctrl_char) [MAC_OSX]: Add extern. + (mac_quit_char_key_p) [MAC_OSX]: New function. + (mac_initialize) [MAC_OSX]: Don't call init_quit_char_handler. + + * macterm.h (FONT_MAX_WIDTH): Remove unused macro. + (XCreateGC): Change type in extern. + (XDrawLine): Rename from mac_draw_line_to_pixmap. + (mac_quit_char_key_p) [MAC_OSX]: Add extern. + +2007-01-08 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * keyboard.c (init_keyboard): Initialize interrupt_input_blocked and + interrupt_input_pending. + + * xterm.h (x_display_info): New: net_supported_atoms, + nr_net_supported_atoms and net_supported_window. + + * xterm.c (last_user_time): New variable. + (handle_one_xevent): Set last_user_time from events that have Time. + Set net_supported_window to 0 when reparented. + (wm_supports): New function. + (do_ewmh_fullscreen): Use wm_supports to check for _NET_WM_STATE. + (x_term_init): Initialize net_supported_atoms, nr_net_supported_atoms + and net_supported_window. + +2007-01-05 Kim F. Storm <storm@cua.dk> + + * indent.c (Fvertical_motion): Fix it overshoot check for overlay + strings without embedded newlines immediately followed by newline. + +2007-01-05 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * editfns.c (Fformat_time_string, Fdecode_time, Fencode_time) + (Fcurrent_time_string, Fcurrent_time_zone): Add BLOCK_INPUT around + gmtime/localtime/emacs_memftimeu/mktime. + + * mac.c (Fmac_set_file_creator): Use MAC_EMACS_CREATOR_CODE + instead of 'EMAx'. + [!MAC_OSX] (sys_open, sys_creat, sys_fopen): Likewise. + + * macgui.h (struct _XGC) [USE_CG_DRAWING + && MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]: New members cg_fore_color + and cg_back_color. + + * macmenu.c (Vshow_help_function) [TARGET_API_MAC_CARBON]: Add extern. + (restore_show_help_function, menu_target_item_handler) + [TARGET_API_MAC_CARBON]: New functions. + (install_menu_target_item_handler): New function. + (add_menu_item) [TARGET_API_MAC_CARBON]: Set help string as menu + item property. + + * macterm.c (CG_SET_FILL_COLOR_MAYBE_WITH_CGCOLOR) + (CG_SET_FILL_COLOR_WITH_GC_FOREGROUND) + (CG_SET_FILL_COLOR_WITH_GC_BACKGROUND) + (CG_SET_STROKE_COLOR_MAYBE_WITH_CGCOLOR) + (CG_SET_STROKE_COLOR_WITH_GC_FOREGROUND): New macros. + (mac_cg_color_space_rgb) [USE_CG_DRAWING]: New variable. + (mac_cg_color_black) [USE_CG_DRAWING + && MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]: New variable. + (init_cg_color) [USE_CG_DRAWING]: New function. + (mac_draw_line, mac_draw_rectangle) [USE_CG_DRAWING]: Use + CG_SET_STROKE_COLOR_WITH_GC_FOREGROUND instead of CG_SET_STROKE_COLOR. + (mac_erase_rectangle, mac_clear_window, mac_draw_cg_image) + (mac_fill_rectangle, mac_draw_image_string_cg) [USE_CG_DRAWING]: + Use CG_SET_FILL_COLOR_WITH_GC_FOREGROUND or + CG_SET_FILL_COLOR_WITH_GC_BACKGROUND instead of CG_SET_FILL_COLOR. + (mac_draw_string_common) [MAC_OSX && USE_ATSUI]: Likewise. + (XCreateGC, XFreeGC, XSetForeground, XSetBackground) [USE_CG_DRAWING + && MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]: Use gc->cg_fore_color and/or + gc->cg_back_color. + (install_drag_handler, remove_drag_handler): Make extern. + (install_menu_target_item_handler): Add extern. + (install_window_handler): Call install_menu_target_item_handler. + [MAC_OS8] (main): Use MAC_EMACS_CREATOR_CODE instead of 'EMAx'. + (mac_initialize) [USE_CG_DRAWING]: Call init_cg_color. + + * macterm.h (MAC_EMACS_CREATOR_CODE): New enumerator. + +2007-01-04 Juanma Barranquero <lekktu@gmail.com> + + * window.c (Fwindow_end): Fix use of >= operator. + +2007-01-03 Richard Stallman <rms@gnu.org> + + * window.c (Fwindow_end): Check BUF_OVERLAY_MODIFF like BUF_MODIFF. + +2007-01-02 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.h (xg_menu_item_cb_data_): Remove highlight_id and + unhighlight_id. + + * gtkutil.c (menuitem_highlight_callback): Invoked widget is the + parent of the menu item. Get menu item widget from event. + (xg_create_one_menuitem, xg_update_menu_item): highlight_id and + unhighlight_id has been removed. + (create_menus): Connect enter/leave-notify-event to the menu instead + of individual items. + +2006-12-31 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (update_frame_tool_bar): Connect create-menu-proxy with + xg_tool_bar_menu_proxy. + (xg_tool_bar_menu_proxy): New function. + (xg_tool_bar_proxy_callback): New function. + +2006-12-30 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (xg_tool_bar_button_cb): Save last modifier on widget. + (xg_tool_bar_callback): Remove check for button. + (update_frame_tool_bar): Put an event box in the tool bar and a button + in the event box. Attach enter/leave-notify-event to the event box. + +2006-12-30 Richard Stallman <rms@gnu.org> + + * keymap.c (Fdefine_key): Doc fix. + +2006-12-29 Kim F. Storm <storm@cua.dk> + + * frame.h (struct frame): New member minimize_tool_bar_window_p. + + * xdisp.c (auto_resize_tool_bars_p): Replace with ... + (Vauto_resize_tool_bars): ... this. + (syms_of_xdisp): DEFVAR_LISP and initialize it. Update doc string + to describe new value `grow-only', and use of C-l. + (display_tool_bar_line): Only use default face for border below + toolbar if not grow-only (to get acceptable visual appearence). + Explicitly set visible_height for empty toolbar lines. + (redisplay_tool_bar): Handle `grow-only' setting. Check and clear + minimize_tool_bar_window_p flag. + + * window.c (Frecenter): Set minimize_tool_bar_window_p flag + when called without arg to redraw with minimum toolbar height. + Update doc string. + +2006-12-29 Jason Rumney <jasonr@gnu.org> + + * s/ms-w32.h (tzname): Do not define in msvc8. + (utime): Do not define in msvc8. + + * regex.c (regerror): Change parameter name err_code. + +2006-12-26 Richard Stallman <rms@gnu.org> + + * search.c (Fsearch_forward): Doc fix. + + * callint.c (Finteractive): Doc fix. + +2006-12-25 Kim F. Storm <storm@cua.dk> + + * s/ms-w32.h (BROKEN_DATAGRAM_SOCKETS): Define it. + +2006-12-23 Eli Zaretskii <eliz@gnu.org> + + * keyboard.c (some_mouse_moved): Fix last change. + +2006-12-22 Eli Zaretskii <eliz@gnu.org> + + * callproc.c (syms_of_callproc) <shell-file-name>: Doc fix. + +2006-12-22 Mark Davies <mark@mcs.vuw.ac.nz> + + * m/amdx86-64.h, m/hp800.h: Add support for NetBSD. + * m/sh3el.h: New file. + +2006-12-22 Eli Zaretskii <eliz@gnu.org> + + * makefile.w32-in (emacs, temacs): Depend on stamp_BLD instead of + $(BLD). + ($(OBJ0) $(OBJ1) $(WIN32OBJ)): New dependency on stamp_BLD. + (bootstrap-temacs): Pass $(XMFLAGS) to sub-make. + ($(OBJ0) $(OBJ1) $(WIN32OBJ)): Add lastfile.$(O) and firstfile.$(O). + (clean): Delete stamp_BLD. + +2006-12-22 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macfns.c (mac_update_title_bar) [TARGET_API_MAC_CARBON]: + Call mac_update_proxy_icon also when buffer modification flag changed. + [TARGET_API_MAC_CARBON] (mac_update_proxy_icon): Don't update alias, + but compare FSRef/FSSpec of resolved alias. + +2006-12-21 Kim F. Storm <storm@cua.dk> + + * w32.c (_sys_wait_accept): Fix handle leak. + +2006-12-20 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * sound.c: Include <alsa/asoundlib.h> if ALSA_SUBDIR_INCLUDE is + defined. + +2006-12-20 Kim F. Storm <storm@cua.dk> + + * s/ms-w32.h (BROKEN_NON_BLOCKING_CONNECT): Define it. + +2006-12-19 Juanma Barranquero <lekktu@gmail.com> + + * keyboard.c (syms_of_keyboard) <double-click-time>: + * mac.c (Fmac_code_convert_string): + * search.c (Fsearch_forward): Doc fixes. + +2006-12-19 Kim F. Storm <storm@cua.dk> + + Rework 2006-12-04 change. A SIGUSR1 (SIGUSR2) signal now generates + a sigusr1 event instead of [signal usr1] sequence, and signal events + are now supposed to be handled via special-event-map. + + * keyboard.c (kbd_buffer_store_event_hold): Undo 2006-12-04 change. + (make_lispy_event): Don't generate Qsignal prefix for code 0. + Abort if signal code is unknown. + (store_user_signal_events): Don't make Qsignal prefix (code 0). + (Qsignal): Move declaration back to process.c. + (syms_of_keyboard): Don't intern or staticpro it here. + + * process.c (Qsignal): Declare here. + (syms_of_process): Intern or staticpro it. + + * emacs.c (main): Rename user signals to sigusr1 and sigusr2. + + * .gdbinit: Pass on SIGUSR1 and SIGUSR2 to Emacs. + +2006-12-19 Juanma Barranquero <lekktu@gmail.com> + + * buffer.c (syms_of_buffer) <buffer-display-table>: + <scroll-up-aggressively, scroll-down-aggressively>: Doc fixes. + +2006-12-17 Richard Stallman <rms@gnu.org> + + * fileio.c (Fread_file_name_internal): Pass Vread_file_name_predicate + to Ffile_name_completion. + + * dired.c (file_name_completion): New arg PREDICATE. Some cleanup. + (Ffile_name_completion): New arg PREDICATE. + +2006-12-17 Juanma Barranquero <lekktu@gmail.com> + + * buffer.c (Fkill_buffer): Doc fix. + (syms_of_buffer) <kill-buffer-query-functions>: Doc fix. + +2006-12-16 Juanma Barranquero <lekktu@gmail.com> + + * minibuf.c (Ftry_completion): Check that obarray buckets are symbols. + +2006-12-16 Eli Zaretskii <eliz@gnu.org> + + * w32fns.c (w32-window-exists-p): New function. + (syms_of_w32fns): Defsubr it. + + * prefix-args.c [STDC_HEADERS]: Include stdlib.h. + +2006-12-16 Juanma Barranquero <lekktu@gmail.com> + + * minibuf.c (Ftry_completion): Use `check_obarray' if ALIST is a vector. + +2006-12-15 Eli Zaretskii <eliz@gnu.org> + + * emacs.c (USAGE3): Clarify documentation of --color. + +2006-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * mac.c (wakeup_from_rne_enabled_p) [TARGET_API_MAC_CARBON]: + New variable. + (ENABLE_WAKEUP_FROM_RNE, DISABLE_WAKEUP_FROM_RNE): New macros. + [!MAC_OSX] (select): Use them. + [MAC_OSX] (select_and_poll_event, sys_select): Likewise. + (mac_wakeup_from_rne) [TARGET_API_MAC_CARBON]: New function. + + * macfns.c (mac_atsu_font_face_attributes) [USE_ATSUI]: Add extern. + (Fmac_atsu_font_face_attributes) [USE_ATSUI]: New function. + (syms_of_macfns) [USE_ATSUI]: Defsubr it. + + * macselect.c [TARGET_API_MAC_CARBON] (mac_do_receive_drag): + Use mac_wakeup_from_rne instead of mac_post_mouse_moved_event. + + * macterm.c (mac_query_char_extents) [USE_ATSUI]: Don't call + ATSUGetGlyphBounds if not necessary. + (Vmac_atsu_font_table) [USE_ATSUI]: Remove variable. + (syms_of_macterm) [USE_ATSUI]: Don't defvar it. + (fm_get_style_from_font, atsu_find_font_from_family_name) + (atsu_find_font_family_name, mac_atsu_font_face_attributes) + [USE_ATSUI]: New functions. + (init_font_name_table) [USE_ATSUI]: Use atsu_find_font_family_name. + (mac_load_query_font) [USE_ATSUI]: Use atsu_find_font_from_family_name. + Don't get metrics for Latin-1 right half characters. + (mac_load_query_font): Don't load font if space width is not positive. + [TARGET_API_MAC_CARBON] (mac_store_event_ref_as_apple_event): + Use mac_wakeup_from_rne instead of mac_post_mouse_moved_event. + (XTread_socket): Call SelectWindow when unfocused frame is clicked. + + * macterm.h (mac_wakeup_from_rne) [TARGET_API_MAC_CARBON]: Add extern. + +2006-12-15 Kim F. Storm <storm@cua.dk> + + * keyboard.c (ignore_mouse_drag_p): New global var. + (some_mouse_moved): Return 0 if it is non-zero. + (make_lispy_event): Generate click event on mouse up if + ignore_mouse_drag_p is non-zero, even if mouse moved. + Clear ignore_mouse_drag_p on mouse down/up. + + * xdisp.c (redisplay_window): Set ignore_mouse_drag_p if tool-bar + is resized to avoid generating a mouse drag event. + +2006-12-14 Juanma Barranquero <lekktu@gmail.com> + + * w32fns.c (w32_wnd_proc): Force non-tooltip frames to respect the + minimum tracking size. Remove non-working old hack to do the same. + +2006-12-14 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * emacs.c (handle_user_signal): Move function to keyboard.c. + (main): Use add_user_signal for SIGUSR1 and SIGUSR2. + + * keyboard.c (make_lispy_event): Use find_user_signal_name. + (read_avail_input): Store pending user signal events. + (struct user_signal_info): New struct. + (user_signals): New variable. + (add_user_signal, store_user_signal_events) + (find_user_signal_name): New functions. + (handle_user_signal): Move function from emacs.c. Don't store + USER_SIGNAL_EVENT here, but increment number of pending signals. + + * keyboard.h (add_user_signals): Add extern. + +2006-12-11 Juanma Barranquero <lekktu@gmail.com> + + * buffer.c (syms_of_buffer) <cursor-in-non-selected-windows>: + <default-scroll-up-aggressively, default-scroll-down-aggressively>: + <line-spacing, left-margin>: Doc fixes. + + * xdisp.c (syms_of_xdisp) <mode-line-inverse-video>: Doc fix. + +2006-12-10 Kim F. Storm <storm@cua.dk> + + * xdisp.c (show_mouse_face): Never use text cursor in tool-bar. + +2006-12-10 Juanma Barranquero <lekktu@gmail.com> + + * abbrev.c (syms_of_abbrev) <last-abbrev-text>: + * buffer.c (syms_of_buffer) <default-major-mode>: + * keymap.c (Flookup_key): + * lread.c (Feval_buffer, Feval_region): + * macterm.c (syms_of_macterm) <x-use-underline-position-properties>: + <x-underline-at-descent-line, mac-emulate-three-button-mouse>: + * marker.c (Fmarker_insertion_type): + * minibuf.c (syms_of_minibuf) <minibuffer-completion-table>: + * msdos.c (syms_of_msdos) <delete-exited-processes>: + * w32term.c (syms_of_w32term) <x-use-underline-position-properties>: + <x-underline-at-descent-line>: + * xdisp.c (format-mode-line): + * xterm.c (syms_of_xterm) <x-use-underline-position-properties>: + <x-underline-at-descent-line>: Doc fixes. + +2006-12-10 Andreas Schwab <schwab@suse.de> + + * systime.h (EMACS_GET_TIME): Remove check for + HAVE_STRUCT_TIMEZONE which is never defined. + +2006-12-10 Alan Mackenzie <acm@muc.de> + + * syntax.c (Fpartial_parse_sexp): Correct Docco: Elt 8 of the + result is now neither the last elt nor optional for OLDSTATE. + +2006-12-09 Eli Zaretskii <eliz@gnu.org> + + * process.c (Fsignal_process): Doc fix. Use XFLOAT_DATA to + extract the process ID from a Lisp float. + +2006-12-09 Chong Yidong <cyd@stupidchicken.com> + + * xterm.c (XTframe_raise_lower): Comment out _NET_ACTIVE_WINDOW code. + +2006-12-08 Eli Zaretskii <eliz@gnu.org> + + * frame.h (PIX_TYPE): Redefine as `unsigned long', for 64-bit + platforms where long is 64-bit. + + * msdos.h (PIX_TYPE): Redefine as `unsigned long'. + +2006-12-08 NAKAJI Hiroyuki <nakaji@jp.freebsd.org> (tiny change) + + * m/amdx86-64.h: Add support for Solaris 10 on x86-64. + +2006-12-08 Kenichi Handa <handa@m17n.org> + + * xterm.c (x_query_font): Use xstricmp instead off strcasecmp. + +2006-12-08 Juanma Barranquero <lekktu@gmail.com> + + * emacs.c (syms_of_emacs) <system-type>: Doc fix. + +2006-12-07 Kim F. Storm <storm@cua.dk> + + * process.c (parse_signal): Use xstricmp instead of strcasecmp. + (Fsignal_process): Don't use strncasecmp. + +2006-12-05 Glenn Morris <rgm@gnu.org> + + * abbrev.c (Qforce): New Lisp_Object. + (Fdefine_abbrev): Do not overwrite non-system abbrevs with system + abbrevs, unless 'force is applied. + (syms_of_abbrev): Add Qforce. + +2006-12-04 Kim F. Storm <storm@cua.dk> + + * process.c (parse_signal): Rename macro from handle_signal. + (Fsignal_process): Also accept lower-case variants of signal + names (to align with signal names generated by Emacs itself). + + * emacs.c (handle_USR1_signal, handle_USR2_signal): Replace by... + (handle_user_signal): ... this, which generates two USER_SIGNAL_EVENTs + first with code == 0 [signal] and one with code == sig number. + (main): Use it as handler for SIGUR1 and SIGUSR2. + + * keyboard.c (kbd_buffer_store_event_hold): Don't throw-on-input + if first event in [signal xxx] sequence. + (lispy_user_signals, Qusr1_signal, Qusr2_signal): Remove. + (syms_of_keyboard): Don't intern and staticpro them. + (Qsignal): Declare here. + (syms_of_keyboard): Intern and staticpro it. + (make_lispy_event): Use it. Intern symbols on the fly for other + USER_SIGNAL_EVENTs events. + + * process.c (Qsignal): Declare extern. + (syms_of_process): Don't intern/staticpro it here. + + * process.c (read_process_output): Abort if carryover < 0. + +2006-12-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * config.in: Regenerate. + + * fileio.c [__NetBSD__]: Don't define `unix'. + (Funix_sync, syms_of_fileio): Use `#ifdef HAVE_SYNC' instead of + `#ifdef unix'. + +2006-12-04 Glenn Morris <rgm@gnu.org> + + * Makefile.in (version): New variable, set by configure. + (bootstrapclean, mostlyclean): Also remove emacs-${version}. + +2006-12-03 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (update_frame_tool_bar): Handle modifying a toolbar item + without an image. + +2006-12-01 Eli Zaretskii <eliz@gnu.org> + + * w32fns.c (Fw32_shell_execute): Doc fix. + +2006-11-30 Chong Yidong <cyd@stupidchicken.com> + + * xdisp.c (move_it_to): Correctly count tab glyphs for continued + lines ending in tab. + +2006-11-30 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.c (x_raise_frame): Move setting of _NET_ACTIVE_WINDOW + property ... + (XTframe_raise_lower): ... to here. + +2006-11-30 Kenichi Handa <handa@m17n.org> + + * regex.c (regex_compile): Fix previous change. + +2006-11-29 Juanma Barranquero <lekktu@gmail.com> + + * sound.c (Fplay_sound_internal): Remove spurious newline in docstring. + +2006-11-28 Chong Yidong <cyd@stupidchicken.com> + + * config.in: Regenerate. + +2006-11-28 Kenichi Handa <handa@m17n.org> + + * regex.c (regex_compile): Don't call SET_LIST_BIT with a + multibyte character. + +2006-11-27 Chong Yidong <cyd@stupidchicken.com> + + * s/aix4-2.h: Undefine _NO_PROTO. Suggested by Joe Buehler. + +2006-11-27 Kim F. Storm <storm@cua.dk> + + * window.c (set_window_buffer): Refactor recent changes. + +2006-11-27 Jason Rumney <jasonr@gnu.org> + + * w32term.c (w32_msg_worker): Declare correctly. + (w32_initialize): Don't cast w32_msg_worker. + + * w32fns.c (w32_msg_worker): Define as WINAPI and arg as void pointer. + +2006-11-26 Chong Yidong <cyd@stupidchicken.com> + + * m/amdx86-64.h: Look for standard libs in /usr/lib64 only if that + directory exists. + +2006-11-25 Eli Zaretskii <eliz@gnu.org> + + * w16select.c (Fw16_set_clipboard_data): Fix the call to sit_for + as per the calling sequence change on 2006-07-11. + +2006-11-25 Chong Yidong <cyd@stupidchicken.com> + + * window.c (set_window_buffer): Use BLOCK_INPUT. + +2006-11-24 Juanma Barranquero <lekktu@gmail.com> + + * fns.c (substring_both): Add missing address operator. + +2006-11-24 Stefan Monnier <monnier@iro.umontreal.ca> + + * fns.c: Use AREF/ASIZE macros. + (concat): Provide the full ANSI prototype. + +2006-11-24 Juanma Barranquero <lekktu@gmail.com> + + * buffer.c (syms_of_buffer) <buffer-undo-list>: Doc fix. + +2006-11-23 William Smith <William.Smith@global360.com> (tiny change) + + * strftime.c (HAVE_SYS__MBSTATE_T_H): Fix typo. + +2006-11-22 Alfred M. Szmidt <ams@gnu.org> (tiny change) + + * s/openbsd.h (LD_SWITCH_SYSTEM): Remove /usr/pkg/lib and + /usr/pkg/lib from the library search path. + (LD_SWITCH_X_DEFAULT): New macro. + +2006-11-22 Chong Yidong <cyd@stupidchicken.com> + + * window.c (set_window_buffer): Clear mouse highlight if it is in + this window. + +2006-11-21 Chong Yidong <cyd@stupidchicken.com> + + * xfaces.c (realize_default_face): Check if the default font name + exists on this display before trying to use it. + +2006-11-21 Richard Stallman <rms@gnu.org> + + * fileio.c: Break line before &&, not after. + +2006-11-20 Eli Zaretskii <eliz@gnu.org> + + * fns.c (concat) [!__GNUC__]: Add prototype. + +2006-11-20 Kenichi Handa <handa@m17n.org> + + * fileio.c (Fread_file_name_internal): Use SBYTES (not SCHARS) to + check the tailing slash of a filename. + +2006-11-20 KOBAYASHI Yasuhiro <kobayays@otsukakj.co.jp> (tiny change) + + * indent.c (Fvertical_motion): Include composition in the case of + overshoot expected. + +2006-11-19 Andreas Schwab <schwab@gnu.org> + + * xfaces.c (Fdisplay_supports_face_attributes_p): Initialize supports. + + * xmenu.c (Fx_popup_menu): Initialize selection. + +2006-11-18 Andreas Schwab <schwab@suse.de> + + * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Update call to mark_memory. + +2006-11-17 Tetsurou Okazaki <okazaki@be.to> (tiny change) + + * xterm.c (do_ewmh_fullscreen): Declare variable before XSETFRAME + to avoid gcc 2.96 error. + +2006-11-17 NIIMI Satoshi <sa2c@sa2c.net> (tiny change) + + * search.c (simple_search): In the loop of backward searching, + check also the byte position against the limit. + +2006-11-14 Romain Francoise <romain@orebokech.com> + + * minibuf.c (Fcompleting_read): Fix typo in docstring. + +2006-11-14 Kenichi Handa <handa@m17n.org> + + * coding.c (code_convert_region): Initialize coding->heading_ascii. + (decode_coding_string, code_convert_region): Likewise. + +2006-11-14 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * config.in: Regenerate. + + * macfns.c (Fx_display_mm_height, Fx_display_mm_width) + [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 + && MAC_OS_X_VERSION_MIN_REQUIRED == 1020]: Check if + CGDisplayScreenSize is available. + + * macmenu.c (menu_quit_handler, install_menu_quit_handler): + Replace `#ifdef HAVE_CANCELMENUTRACKING' with + `#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030'. + (install_menu_quit_handler) [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 + && MAC_OS_X_VERSION_MIN_REQUIRED == 1020]: Check if + CancelMenuTracking is available. + + * macterm.c [USE_CG_TEXT_DRAWING] (mac_draw_image_string_cg) + [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 + && MAC_OS_X_VERSION_MIN_REQUIRED == 1020]: Check if + CGContextShowGlyphsWithAdvances is available. + +2006-11-13 Jason Rumney <jasonr@gnu.org> + + * s/ms-w32.h: Define HAVE_INET_SOCKETS. + +2006-11-13 Nozomu Ando <nand@mac.com> + + * alloc.c (mark_memory): New argument OFFSET. All uses changed. + Fix address calculations for case END < START. + (mark_stack): Impose Lisp_Object alignment on jmp_buf. + +2006-11-12 Juanma Barranquero <lekktu@gmail.com> + + * coding.c (Fencode_sjis_char, Fencode_big5_char): + Improve argument/docstring consistency. + + * editfns.c (Fmessage): Doc fixes. + + * process.c (syms_of_process) <delete-exited-processes>: Doc fix. + +2006-11-12 Chong Yidong <cyd@stupidchicken.com> + + * xmenu.c (popup_activated): Define outside HAVE_MENUS. + +2006-11-12 Romain Francoise <romain@orebokech.com> + + * xselect.c (selection-coding-system): Fix docstring. + +2006-11-12 Juanma Barranquero <lekktu@gmail.com> + + * category.c (Fchar_category_set): Improve arg/docstring consistency. + + * data.c (Flogxor): + * fns.c (Frandom, Flength, Fsafe_length, Fstring_bytes) + (Fstring_equal, Fcompare_strings, Fstring_lessp, Fcopy_sequence) + (Fstring_make_unibyte): Fix typos in docstrings. + +2006-11-10 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.h (struct x_display_info): Fix indentation. + + * xterm.c (do_ewmh_fullscreen, XTfullscreen_hook): New functions. + (x_check_fullscreen): Call do_ewmh_fullscreen. + (x_initialize): Set fullscreen_hook to XTfullscreen_hook. + + * frame.c (x_set_fullscreen): Call fullscreen_hook if set. + + * term.c: Define fullscreen_hook. + (syms_of_term): Initialize fullscreen_hook to NULL. + + * termhooks.h: Add fullscreen_hook. + +2006-11-08 Juanma Barranquero <lekktu@gmail.com> + + * bytecode.c (Fbyte_code): + * data.c (Fmakunbound): Use SYMBOL_CONSTANT_P macro. + +2006-11-06 Juanma Barranquero <lekktu@gmail.com> + + * lread.c (syms_of_lread): + * xsmfns.c (syms_of_xsmfns): Fix typo in docstring. + +2006-11-06 Martin Rudalics <rudalics@gmx.at> + + * macmenu.c (Fmenu_or_popup_active_p): Define outside HAVE_MENUS. + + * w32menu.c (Fmenu_or_popup_active_p): Define outside HAVE_MENUS. + Return nil if building without menus. + + * xmenu.c (Fmenu_or_popup_active_p): Define outside HAVE_MENUS. + Return nil if building without menus. + +2006-11-05 Mark Davies <mark@mcs.vuw.ac.nz> (tiny change) + + * s/netbsd.h (POSIX_SIGNALS): Define. + +2006-11-05 Martin Rudalics <rudalics@gmx.at> + + * macmenu.c (Fmenu_or_popup_active_p): New function. + (syms_of_macmenu): Defsubr it. + + * w32menu.c (Fmenu_or_popup_active_p): New function. + (syms_of_w32menu): Defsubr it. + (popup_activated_flag, popup_activated): Remove. + + * xdisp.c (note_mouse_highlight) [HAVE_NTGUI]: Don't bother to + check popup_activated. + + * xmenu.c (Fmenu_or_popup_active_p): New function. + (syms_of_xmenu): Defsubr it. + +2006-11-05 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * unexmacosx.c (malloc_cookie): Remove unused variable. + (region_list_head, region_list_tail, lca, nlc, infile_lc_highest_addr) + (text_seg_lowest_offset, mh, curr_header_offset, infd, outfd) + (emacs_zone, data_segment_old_fileoff, data_segment_scp) + (num_unexec_regions, unexec_regions): Make variables static. + (print_regions, find_emacs_zone_regions): Make static. + (unexec_region_info): New typedef. + (unexec_regions): Change type from vm_range_t[] to unexec_region_info[]. + All uses changed. + (unexec_regions_recorder): Subtract size of trailing null pages from + filesize. Show filesize. + (unexec_regions_merge): Don't merge if null pages of preceding region + is not too small. Use long format in printf. + (copy_segment, copy_data_segment): Show filesize. + (copy_data_segment): Write filesize bytes of region data. + Adjust filesize in segment command accordingly. + (dump_it): Use long format in printf. + +2006-11-05 Juanma Barranquero <lekktu@gmail.com> + + * dosfns.c (Finsert_startup_screen): + * fns.c (Ffeaturep, syms_of_fns): + * frame.c (syms_of_frame): Fix typos in docstrings. + + * unexcw.c (unexec): Fix typo in output message. + +2006-11-04 Ralf Angeli <angeli@caeruleus.net> + + * w32fns.c (w32_createwindow): Remove code for handling -geometry + command line option and `initial-frame-alist' which is superfluous + after the last change to `w32_createwindow'. + +2006-11-04 Slawomir Nowaczyk <slawek@cs.lth.se> (tiny change) + + * w32proc.c (sys_wait): Only wait for processes with fd<0. + Others should be handled by sys_select instead. Fixes problems + with (progn (start-process "" nil "ls") (call-process "ls")). + +2006-11-04 Giorgos Keramidas <keramida@ceid.upatras.gr> (tiny change) + + * xmenu.c (Fmenu_bar_open): Declare variable before BLOCK_INPUT to + avoid gcc 2.95 error. + +2006-11-04 Chong Yidong <cyd@stupidchicken.com> + + * gtkutil.c (update_frame_tool_bar): If icon image is invalid and + wicon is null, insert an empty button. + +2006-11-03 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.c (x_raise_frame): Send _NET_ACTIVE_WINDOW when raising the + window. + +2006-11-02 Juanma Barranquero <lekktu@gmail.com> + + * emacs.c (Fkill_emacs): Fix typo in docstring. + +2006-11-02 Nozomu Ando <nand@mac.com> + + * unexmacosx.c (mach_header, segment_command, vm_region, section) + [_LP64]: New defines. + (VM_REGION_BASIC_INFO_COUNT, VM_REGION_BASIC_INFO, LC_SEGMENT) + (MH_MAGIC) [_LP64]: Redefine. + (delta): Remove variable. + (curr_file_offset, pagesize): New variables. + (ROUNDUP_TO_PAGE_BOUNDARY): New macro. + (data_segment_old_fileoff): Initialize explicitly. + (print_region, unexec_regions_recorder, print_load_command_name) + (copy_segment, copy_data_segment): Use long format in printf. + (MAX_UNEXEC_REGIONS): Increase to 400. + (unexec_regions_recorder): Don't warn too many regions here. + (find_emacs_zone_regions): Warn too many regions here. + (print_load_command_name) [_LP64]: Show correct load command name. + (copy_segment, copy_data_segment): Use variable `curr_file_offset'. + Show starting virtual memory address. Don't show ending file offset. + (copy_symtab, copy_dysymtab, copy_twolevelhints): New argument DELTA. + (dump_it): Use new local variable `linkedit_delta' and pass to them. + Error if trying to handle multiple DATA segments. + (unexec): Initialize variable `pagesize'. + +2006-11-01 Juanma Barranquero <lekktu@gmail.com> + + * eval.c (Fcatch): Doc fix. + +2006-10-31 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * image.c [MAC_OS] (image_load_qt_1, xpm_scan, xpm_make_color_table_v) + (xpm_put_color_table_v, xpm_get_color_table_v, xpm_make_color_table_h) + (xpm_put_color_table_h, xpm_get_color_table_h, xpm_str_to_color_key) + (xpm_load_image): Add const qualifier to arguments. + [MAC_OS] (xpm_color_key_strings): Make static const. + + * mac.c (create_apple_event_from_event_ref) + (create_apple_event_from_drag_ref, skip_white_space, parse_comment) + (parse_include_file, parse_binding, parse_component) + (parse_resource_name, parse_value, parse_resource_line) + (xrm_merge_string_database, xrm_get_resource) + (xrm_get_preference_database): Add const qualifier to arguments. + [MAC_OSX] (sys_select): Make variable `context' static const. + + * macfns.c (mac_color_map): Make static const. + (mac_color_map_lookup): Add const qualifier to arguments. + + * macmenu.c (install_menu_quit_handler): Make variable `typesList' + static const. + (name_is_separator): Add const qualifier to arguments. + + * macselect.c (init_service_handler): Make variable `specs' static + const. + + * macterm.c (mac_create_bitmap_from_bitmap_data): Make variable + `swap_nibbles' static const. + (atsu_get_text_layout_with_text_ptr): Make variables `lengths', + `tags', `sizes', `values' static const. + (mac_draw_string_common): Make variables `context' static. + Make variables `tags', `sizes', and `values' static const. + (pcm_get_status, x_detect_focus_change, x_scroll_bar_handle_click) + (xlfdpat_create, xlfdpat_block_match_1, xlfdpat_match) + (mac_to_x_fontname, parse_x_font_name, add_mac_font_name) + (mac_do_list_fonts, is_fully_specified_xlfd, do_grow_window) + (mac_store_event_ref_as_apple_event, mac_make_rdb): Add const + qualifier to arguments. + (xlfd_scalable_fields, keycode_to_xkeysym_table) + (fn_keycode_to_keycode_table): Make static const. + (mac_load_query_font): Make variables `tags', `sizes', `values', + `types', and `selectors' static const. + (mac_handle_command_event, mac_handle_window_event): + Make variables `names' and `types' static const. + (init_command_handler, install_window_handler): Make variables + `specs*' static const. + (mac_handle_font_event, mac_handle_text_input_event) + (mac_store_service_event): Make variables `names' and `types' + const. Make variables `names_*' and `types_*' static const. + + * macterm.h (create_apple_event_from_event_ref) + (create_apple_event_from_drag_ref, xrm_merge_string_database) + (xrm_get_resource, xrm_get_preference_database): Add const + qualifier to arguments in externs. + +2006-10-31 Kenichi Handa <handa@m17n.org> + + * xfns.c (xic_create_xfontset): Fix previous change. + +2006-10-30 Chong Yidong <cyd@stupidchicken.com> + + * s/openbsd.h (LD_SWITCH_SYSTEM): Add /usr/pkg/lib and + /usr/pkg/lib to library search path. + +2006-10-29 Mark Davies <mark@mcs.vuw.ac.nz> (tiny change) + + * ralloc.c (relinquish): Use a long for excess space counter to + handle 64-bit case correctly. + +2006-10-29 Jeramey Crawford <jeramey@jeramey.com> + + * m/amdx86-64.h: Add defines for OpenBSD x86-64. + +2006-10-29 Juanma Barranquero <lekktu@gmail.com> + + * window.c (Fdisplay_buffer): Fix typo in docstring. + +2006-10-27 Ben North <ben@redfrontdoor.org> (tiny change) + + * w32term.c (x_draw_glyph_string_foreground): Set background mode + to TRANSPARENT before using overstrike to simulate bold faces. + + * xfaces.c (best_matching_font): Fix logic to decide whether to + use overstriking to simulate bold-face (it was reversed). + +2006-10-23 Kim F. Storm <storm@cua.dk> + + * xdisp.c (remember_mouse_glyph): Do nothing if glyphs are not + initialized. + + * keyboard.c (read_char): Make an element (t . EVENT) in + unread-command-events add EVENT to the current command's key sequence. + (syms_of_keyboard) <unread-command-events>: Update doc. + +2006-10-21 Richard Stallman <rms@gnu.org> + + * minibuf.c (Vread_expression_map): Define here. + (Qread_expression_history): New variable. + (syms_of_minibuf): Initialize them. + (Feval_minibuffer): Use Vread_expression_map and + Qread_expression_history. + +2006-10-21 Kenichi Handa <handa@m17n.org> + + * xfns.c (xic_create_fontsetname): If ADSTYLE field is not a wild + card, change it to "*". + (xic_create_xfontset): Call XCreateFontSet for each single + fontname in fontsetname. + +2006-10-19 Chong Yidong <cyd@stupidchicken.com> + + * callint.c (callint_message): Convert to a Lisp string. + (syms_of_callint): Initialize it. + (callint_message_size): Var deleted. + (Fcall_interactively): Use Fformat instead of doprnt to construct + prompt string. + +2006-10-19 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * xdisp.c (display_mode_line): Clear enabled_p flag on mode-line row. + +2006-10-19 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macfns.c (Vmac_carbon_version_string) [TARGET_API_MAC_CARBON]: + New variable. + (syms_of_macfns) [TARGET_API_MAC_CARBON]: Defvar it. + +2006-10-19 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xselect.c (x_handle_selection_request): If the converted_selection + is nil or XCDR (converted_selection) is nil, decline the request. + +2006-10-16 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (get_utf8_string): Remove warnings with casts. + (xg_tool_bar_button_cb): Ditto. + (xg_tool_bar_callback): Ditto. + +2006-10-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * dispnew.c (adjust_frame_glyphs_for_frame_redisplay): Remove unused + variable ch_dim. + (adjust_frame_glyphs_for_window_redisplay): Likewise. Don't allocate + menu bar window matrices on non-X systems. + + * mac.c (Fmac_get_preference, Fmac_code_convert_string): Add GCPROs. + + * macterm.c (mac_query_char_extents): Don't return glyph ID if layout + adjustment is needed. + (mac_load_query_font): Check if width and height are positive. + +2006-10-14 Richard Stallman <rms@gnu.org> + + * sysdep.c (init_sys_modes): Delete DEFVAR_LISP in the wrong place. + +2006-10-13 Chong Yidong <cyd@stupidchicken.com> + + * xdisp.c (decode_mode_spec): Ignore %c and %l constructs in frame + title. + +2006-10-12 Chong Yidong <cyd@stupidchicken.com> + + * keymap.c (Fkey_binding): Check Lisp_Object types before doing + XCAR and XINT. + +2006-10-12 Romain Francoise <romain@orebokech.com> + + * image.c (xbm_read_bitmap_data): Delete extra semicolon. + +2006-10-10 Stefan Monnier <monnier@iro.umontreal.ca> + + * eval.c: Include xterm.h for x_fully_uncatch_errors and friends. + + * dispextern.h: Declare x_create_bitmap_from_xpm_data. + + * xterm.c (x_check_expected_move): Remove unused var `count'. + + * xmenu.c (syms_of_xmenu): Use Ffset rather than Fdefalias, since + Fdefalias is not declared in any *.h file. + +2006-10-09 Chong Yidong <cyd@stupidchicken.com> + + * dispnew.c (sit_for): Sit forever if TIMEOUT is t. + + * keyboard.c (command_loop_1): Handle non-number values of + `minibuffer-message-timeout'. + (Fexecute_extended_command): Fix typo. + + * minibuf.c (temp_echo_area_glyphs): Sit for + `minibuffer-message-timeout' seconds. + +2006-10-08 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c (mac_draw_image_string, mac_draw_image_string_16): + Add argument OVERSTRIKE_P. + (mac_draw_string_common, mac_draw_image_string_cg): Likewise. + Support overstrike. + (mac_draw_string, mac_draw_string_16): Remove functions. + (x_draw_glyph_string_foreground): Use overstrike when needed. + (x_draw_composite_glyph_string_foreground): Likewise. + Use mac_draw_image_string_16 instead of mac_draw_string_16. + (mac_load_query_font): Rename from XLoadQueryFont. Take argument + F instead of DPY. All uses changed. Don't save/restore font. + +2006-10-07 Ralf Angeli <angeli@caeruleus.net> + + * w32fns.c (w32_createwindow): Honour left and top positions if + supplied explicitly. + +2006-10-06 Kim F. Storm <storm@cua.dk> + + * xdisp.c (pos_visible_p): Fix value when EOB is visible. + +2006-10-05 Chong Yidong <cyd@stupidchicken.com> + + * frame.c (Qinhibit_face_set_after_frame_default): New var. + (syms_of_frame): Initialize it. + (x_set_frame_parameters): Avoid resetting :font attributes to the + new-frame defaults. + +2006-10-03 Stefan Monnier <monnier@iro.umontreal.ca> + + * lisp.h (clear_regexp_cache): Declare. + + * search.c (compile_pattern): Only check `cp->syntax_table' if needed. + (compile_pattern_1): Remember `used_syntax' in `cp->syntax_table'. + (clear_regexp_cache): Only flush those regexps which depend on + a syntax-table. + + * regex.c (regex_compile): Set the new `used_syntax' bit. + + * regex.h: Remove file local variables. + (struct re_pattern_buffer): New field `used_syntax'. + +2006-10-03 Kim F. Storm <storm@cua.dk> + + * process.c (list_processes_1): Run sentinels before removing dead + processes. Also remove `closed' network connections. + +2006-10-01 Stefan Monnier <monnier@iro.umontreal.ca> + + * xdisp.c (handle_fontified_prop): Don't fontify at EOB. + +2006-09-30 Eli Zaretskii <eliz@gnu.org> + + * config.in: Regenerated. + +2006-09-29 Juri Linkov <juri@jurta.org> + + * buffer.c (syms_of_buffer): Reorder coding systems in the + docstring of %z to the real order displayed in the modeline. + +2006-09-28 Stefan Monnier <monnier@iro.umontreal.ca> + + * keymap.c (Fdefine_key): Yet another int/Lisp_Object mixup (YAILOM). + +2006-09-26 Chong Yidong <cyd@stupidchicken.com> + + * indent.c (Fvertical_motion): Do move back if the Lisp string + being displayed contains newlines. + +2006-09-26 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c (mac_compute_glyph_string_overhangs, XLoadQueryFont) + [USE_CG_DRAWING]: Call mac_prepare_for_quickdraw before QDTextBounds. + +2006-09-26 Kenichi Handa <handa@m17n.org> + + * keymap.c (Fsingle_key_description): For an invalid char, return + "Invalid char code NNNNN". + +2006-09-25 Chong Yidong <cyd@stupidchicken.com> + + * callint.c (Fcall_interactively): Doc fix. + +2006-09-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c (x_underline_at_descent_line): New variable. + (syms_of_macterm): DEFVAR_BOOL it. + (x_draw_glyph_string): Use it. + (XLoadQueryFont): Calculate min_bounds.descent and max_bounds.descent. + +2006-09-25 Kenichi Handa <handa@m17n.org> + + * keymap.c (Fsingle_key_description): Return unique names for + generic characters. + +2006-09-24 Richard Stallman <rms@gnu.org> + + * search.c (compile_pattern_1): Don't BLOCK_INPUT. + +2006-09-24 Eli Zaretskii <eliz@gnu.org> + + * makefile.w32-in ($(BLD)/fns.$(O), $(BLD)/w32proc.$(O)): + Depend on nt/inc/langinfo.h and nt/inc/nl_types.h. + + * w32proc.c (nl_langinfo): New function. + + * w32fns.c (w32-pass-alt-to-system, w32-alt-is-meta) + (w32-pass-lwindow-to-system, w32-enable-num-lock) + (w32-enable-caps-lock, w32-scroll-lock-modifier) + (w32-lwindow-modifier, w32-rwindow-modifier) + (w32-apps-modifier, w32-mouse-button-tolerance): Doc fix. + +2006-09-23 Juanma Barranquero <lekktu@gmail.com> + + * minibuf.c (Finternal_complete_buffer, Fread_minibuffer) + (Fdisplay_completion_list): Fix typos in docstrings. + +2006-09-23 Romain Francoise <romain@orebokech.com> + + * s/gnu-linux.h (MAIL_USE_FLOCK): Check for HAVE_LIBLOCKFILE too. + +2006-09-23 Kenichi Handa <handa@m17n.org> + + * keymap.c (Fmap_keymap): Docstring mentions about generic character. + +2006-09-22 Stefan Monnier <monnier@iro.umontreal.ca> + + * regex.c (analyse_first): For eight-bit-control chars, mark both the + char's value and its leading byte in the fastmap. + (re_search_2): When fast-scanning without translation, be careful to + check that we only match the leading byte of a multibyte char. + + * charset.h (PREV_CHAR_BOUNDARY): Make it work from within a char's + byte sequence. + (AT_CHAR_BOUNDARY): New macro. + +2006-09-22 Kenichi Handa <handa@m17n.org> + + * fns.c (optimize_sub_char_table): Don't optimize a sub-char-table + whose default value is non-nil. + +2006-09-22 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (xg_get_file_with_chooser): Only show C-l help for + Gtk+ versions < 2.10. + + * xfns.c (syms_of_xfns): Fix typo in help text for + x-gtk-file-dialog-help-text. + +2006-09-21 Kim F. Storm <storm@cua.dk> + + * fns.c (Fmemq): Refill doc string. + (Fmemql): New defun, like memq but using eql. + (syms_of_fns): Defsubr it. + +2006-09-20 Kim F. Storm <storm@cua.dk> + + * xdisp.c (pos_visible_p): CHARPOS < 0 means return info for + last visible glyph in window. + + * window.c (Fset_window_hscroll, Fwindow_line_height): + Doc fix. Use "off-window" instead of "off-screen". + (Fpos_visible_in_window_p): Likewise. + If POS is t, return info for last visible glyph in window. + +2006-09-19 Chong Yidong <cyd@stupidchicken.com> + + * search.c (struct regexp_cache): New entry syntax_table. + (compile_pattern_1): Set it. + (syms_of_search): Initialize it. + (compile_pattern): Require the syntax_table entry of the cache + element to match the current syntax table entry. + +2006-09-19 Stefan Monnier <monnier@iro.umontreal.ca> + + * window.c (Fwindow_end): Fix recent change. + +2006-09-19 Kim F. Storm <storm@cua.dk> + + * window.c (Fset_window_hscroll, Fpos_visible_in_window_p): + Doc fix. Use "off-screen" instead of "invisible". + (Fwindow_line_height): Make line numbers 0-based. Make line arg + optional; if nil, use current cursor row. Handle text terminals + properly. Return nil if non-interactive or pseudo-window. + +2006-09-19 Stefan Monnier <monnier@iro.umontreal.ca> + + * keymap.c: Include alloca.h if available. + (Fkey_binding): Only use AREF after checking it's a vector. + Remove unused var `window'. + +2006-09-19 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * emacs.c (shut_down_emacs) [!subprocesses]: Don't set + inhibit_sentinels. + + * mac.c [!MAC_OSX] (select): Fix argument name. + + * macmenu.c (enum mac_menu_kind, min_menu_id): New enumerator and + menu ID for Apple menu. + (menubar_selection_callback): Remove function. + (find_and_call_menu_selection): New function from xmenu.c. + (x_activate_menubar): Use it. + (set_frame_menubar): Don't use f->output_data.mac->menubar_active. + + * macterm.c (menubar_selection_callback): Remove extern. + (M_APPLE): Change to 234. + (do_apple_menu) [!TARGET_API_MAC_CARBON]: Make non-static. + (do_menu_choice): Remove function. + + * macterm.h (struct mac_output): Remove member menubar_active. + (do_menu_choice): Remove extern. + (do_apple_menu) [!TARGET_API_MAC_CARBON]: Add extern. + +2006-09-18 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xfns.c (syms_of_xfns): Rename x_gtk_show_chooser_help_text to + x_gtk_file_dialog_help_text. + + * gtkutil.c (xg_uses_old_file_dialog): Rename x-use-old-gtk-file-dialog + to x-gtk-use-old-file-dialog. + (xg_get_file_with_chooser): Rename x_gtk_show_chooser_help_text to + x_gtk_file_dialog_help_text. + + * xfns.c (syms_of_xfns): Ditto. + +2006-09-18 Kim F. Storm <storm@cua.dk> + + * window.c (Fwindow_line_visibility): Remove. + (Fwindow_line_height): New defun replacing it. + (syms_of_window): Defsubr it. + +2006-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * mac.c (SELECT_USE_CFSOCKET) [MAC_OSX]: Set default to 1. + [MAC_OSX] (sys_select) [SELECT_USE_CFSOCKET]: Fix pointer type. + +2006-09-17 Jay Belanger <belanger@truman.edu> + + * gmalloc.c: + * md5.c: + * md5.h: + * strftime.c: Replace "GNU Library General Public License" by "GNU + General Public License" throughout. + +2006-09-17 Kim F. Storm <storm@cua.dk> + + * dispnew.c (update_text_area): Undo 2000-07-18 change. + Always redrawing whole row if line has mouse-face in it causes + excessive flickering of the mode line. + +2006-09-17 Chong Yidong <cyd@stupidchicken.com> + + * search.c (clear_regexp_cache): New function. + + * syntax.c (Fmodify_syntax_entry): Clear regexp cache. + +2006-09-16 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (xg_get_file_with_chooser): + Check x-gtk-show-chooser-help-text before adding the help text. + + * xfns.c (syms_of_xfns): New variable: x-gtk-show-chooser-help-text. + + * gtkutil.c (get_utf8_string): Try harder to convert to UTF8. Gtk+ + will simply crash if we fail. + +2006-09-16 Richard Stallman <rms@gnu.org> + + * regex.c (re_compile_pattern): Set gl_state.current_syntax_table. + +2006-09-15 Kim F. Storm <storm@cua.dk> + + * window.c (Fwindow_line_visibility): New defun for line-move-partial. + (syms_of_window): Defsubr it. + (Fwindow_end): Use window's buffer rather than current buffer. + +2006-09-15 Jay Belanger <belanger@truman.edu> + + * COPYING: Replace "Library Public License" by "Lesser Public + License" throughout. + +2006-09-15 David Kastrup <dak@gnu.org> + + * Makefile.in (keymap.o): Add "keymap.h" and "window.h" dependencies. + + * keymap.c: include "window.h". + (Fcommand_remapping): New optional POSITION argument. + (Fkey_binding): New optional POSITION argument. Completely rework + handling of mouse clicks to get the same order of keymaps as + `read-key-sequence' and heed POSITION. Also temporarily switch + buffers to location of mouse click and back. + + * keyboard.c (command_loop_1): Adjust call of `Fcommand_remapping' + for additional argument. + (parse_menu_item): Adjust call of `Fkey_binding' for additional + argument. + (read_key_sequence): If there are both `local-map' and `keymap' + text properties at some buffer position, heed both. + + * keymap.h: Declare additional optional arguments of + `Fcommand_remapping' and `Fkey_binding'. + +2006-09-15 Juanma Barranquero <lekktu@gmail.com> + + * indent.c (Fcurrent_column, Findent_to): Fix typos in docstring. + +2006-09-14 Andreas Schwab <schwab@suse.de> + + * print.c: Whitespace fixup. + +2006-09-14 Kim F. Storm <storm@cua.dk> + + * xdisp.c (produce_image_glyph): Automatically crop wide images at + right window edge so we can draw the cursor on the same row to + avoid confusing redisplay by placing the cursor outside the visible + window area. + +2006-09-13 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * xterm.c (x_initialize): Don't install Xt event timer here. + (x_timeout_atimer_activated_flag): New var. + (x_activate_timeout_atimer): New function to install Xt timer. + (x_send_scroll_bar_event, x_process_timeouts): Use it. + + * xmenu.c (x_menu_set_in_use, popup_activate_callback) + (create_and_show_popup_menu, create_and_show_dialog): Use it. + + * xterm.h (x_activate_timeout_atimer): Add prototype. + +2006-09-13 Richard Stallman <rms@gnu.org> + + * print.c (print_string): When printcharfun is t, + copy string contents and call strout on the copy. + + * keyboard.c (read_char): If end_time specified, don't put the + event into this_command_keys. + (read_key_sequence): If Voverriding_terminal_local_map is specified, + don't check Voverriding_local_map at all. + +2006-09-12 Stefan Monnier <monnier@iro.umontreal.ca> + + * textprop.c (Fnext_property_change, Fnext_single_property_change) + (Fprevious_property_change, Fprevious_single_property_change): + Avoid changing limit, so we can correctly catch the case where the + property is constant up to limit. + +2006-09-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macfns.c (mac_window) [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]: + * macterm.c (XTread_socket) [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]: + Undo 2006-09-08 change. + +2006-09-11 Chong Yidong <cyd@stupidchicken.com> + + * keymap.c (Fkey_binding): Use string position for string objects. + +2006-09-11 Kim F. Storm <storm@cua.dk> + + * keymap.c (Fkey_binding): Fix last change. + + * editfns.c (Fmessage): Recommend using (message "%s" ...). + +2006-09-10 Chong Yidong <cyd@stupidchicken.com> + + * keymap.c (Fkey_binding): Check for local keymap for mouse click + events. + +2006-09-10 Kim F. Storm <storm@cua.dk> + + * keyboard.c (Finput_pending_p): Check Vunread_input_method_events + and Vunread_post_input_method_events. + + * dispnew.c (Fredisplay): Document return value. + +2006-09-10 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xfns.c (Fx_close_connection): Call xg_display_close when USE_GTK. + + * gtkutil.c (xg_display_close): Always change default display if needed, + check for < Gtk+ version 2.10 before calling gdk_display_close. + +2006-09-10 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * mac.c [MAC_OSX] (sys_select): Check argument `nfds' more rigidly. + Make variable `ofds' static. Remove variable `maxfd'. + + * macfns.c (Fx_file_dialog): Remove unused variable `f'. + Call check_mac. + + * macmenu.c (Vmenu_updating_frame, syms_of_macmenu): + * w32menu.c (Vmenu_updating_frame, syms_of_w32menu): + Apply 2006-09-08 change for xmenu.c. + + * xfns.c (Fx_file_dialog): Call check_x. + +2006-09-10 Kim F. Storm <storm@cua.dk> + + * xdisp.c (get_window_cursor_type): Use hollow cursor on + non-transparent images. + +2006-09-09 Eli Zaretskii <eliz@gnu.org> + + * editfns.c (Fsystem_name): Mention "host" in the doc string. + (syms_of_editfns) <system-name>: Likewise. + +2006-09-08 Martin Rudalics <rudalics@gmx.at> + + * xdisp.c (mouse_autoselect_window): Remove. + (Vmouse_autoselect_window): New variable. DEFVAR_LISP it. + + * dispextern.h (mouse_autoselect_window): Remove extern. + (Vmouse_autoselect_window): Add extern. + + * macterm.c (XTread_socket): Test Vmouse_autoselect_window + instead of mouse_autoselect_window. + + * msdos.c (dos_rawgetc): Likewise. + + * w32term.c (w32_read_socket): Likewise. + + * xterm.c (handle_one_xevent): Likewise. + +2006-09-08 Richard Stallman <rms@gnu.org> + + * xdisp.c (Vmenu_updating_frame): Define here. + (syms_of_xdisp): DEFVAR it here. + (update_menu_bar): Always return hooks_run. + Set Vmenu_updating_frame. + + * xdisp.c (redisplay_internal): Test Vinhibit_redisplay + before calculating SELECTED_FRAME. + + * xmenu.c (Vmenu_updating_frame): Don't define here. + (syms_of_xmenu): Don't DEFVAR it here. + + * xterm.c (x_error_quitter): For BadName error, just return. + + * eval.c (find_handler_clause): Give up on debugger if INPUT_BLOCKED_P. + + * casetab.c (init_casetab_once): Call set_case_table. + + * emacs.c (shut_down_emacs): Set inhibit_sentinels. + + * process.c (inhibit_sentinels): New variable. + (exec_sentinel): Test inhibit_sentinels. + (init_process): Initialize it. + + * process.h (inhibit_sentinels): Add decl. + + * search.c (looking_at_1, string_match_1, search_command): + Make syntax table's canon table point to eqv table. + +2006-09-08 Andreas Schwab <schwab@suse.de> + + * print.c (strout): Fix whitespace. + +2006-09-08 Kim F. Storm <storm@cua.dk> + + * xterm.c (x_draw_glyph_string): Fix 2006-08-24 change. + +2006-09-08 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * mac.c [!MAC_OSX]: Don't include keyboard.h. + [!MAC_OSX] (select): Try detect_input_pending before ReceiveNextEvent + in the same BLOCK_INPUT block, in case that some input has already + been read asynchronously. Pretend to be interrupted by a signal + if some input is available. + [MAC_OSX] (select_and_poll_event, sys_select): Likewise. + (SELECT_POLLING_PERIOD_USEC) [SELECT_USE_CFSOCKET]: Change to 100000. + Now used for ReceiveNextEvent timeout instead of select timeout. + (EVENT_CLASS_SOCK) [SELECT_USE_CFSOCKET]: Remove macro. + [SELECT_USE_CFSOCKET] (socket_callback): Add non-blocking connect + support. Quit event loop. + [MAC_OSX] (sys_select) [SELECT_USE_CFSOCKET]: Add non-blocking + connect support. Reuse previously allocated CFRunLoopSource. + (Fmac_process_hi_command) [TARGET_API_MAC_CARBON]: New function. + (syms_of_mac) [TARGET_API_MAC_CARBON]: Defsubr it. + + * macfns.c (mac_window) [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]: + Specify kWindowAsyncDragAttribute. + + * macterm.c (mac_handle_origin_change, mac_handle_size_change) + (mac_get_ideal_size): New functions. + (x_set_offset, x_set_window_size, x_make_frame_visible) + (do_zoom_window, mac_handle_window_event, XTread_socket): Use them. + (install_window_handler, mac_handle_window_event) + [USE_CARBON_EVENTS]: Handle kEventWindowGetIdealSize and + kEventWindowBoundsChanged. + (XTread_socket) [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]: Don't call + DragWindow. + +2006-09-07 Andreas Schwab <schwab@suse.de> + + * m/ibms390x.h (START_FILES, LIB_STANDARD): Override to + use lib64 instead of lib. + +2006-09-06 Stefan Monnier <monnier@iro.umontreal.ca> + + * Makefile.in: Avoid double quotes when possible. + +2006-09-06 Kenichi Handa <handa@m17n.org> + + * editfns.c (Fformat_time_string): Use make_unibyte_string to make + a Lisp string from the result of emacs_memftimeu call. + +2006-09-06 Kim F. Storm <storm@cua.dk> + + * xdisp.c (pos_visible_p): Remove exact_mode_line_heights_p arg; + so calculate heights even when pos-visible-in-window-p is called + with partially = t. Don't overshoot last_visible_y in move_it_to. + Return row height and row number in new rowh and vpos args. + (cursor_row_fully_visible_p): First line is always "fully visible". + (try_window): Don't clear matrix if vscrolled. + + * lisp.h (pos_visible_p): Update prototype. + + * window.c (Fpos_visible_in_window_p): Adapt to new pos_visible_p. + Return row height and row number for partially visible rows. + Modify return value to a 2 element list for fully visible rows and + 6 for partially visible row. + (window_scroll_pixel_based): Use pos_visible_p directly instead of + Fpos_visible_in_window_p. Fix auto vscrolling for partially + visible lines. Only vscroll backwards if already vscrolled + forwards. Unconditionally vscroll forwards if PT is first (and + only) line. Set new window start instead of scrolling at + start/end of tall line. + +2006-09-05 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c (install_window_handler, mac_handle_window_event) + [USE_CARBON_EVENTS]: Handle kEventWindowClose. + [USE_MAC_TSM] (mac_handle_text_input_event): Set modifiers for + ASCII keystroke event. + +2006-09-04 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (xg_get_file_with_chooser): Don't mention specific keys in + the file chooser message. Only call gtk_file_chooser_set_current_name + when action is SAVE. + +2006-09-04 Andreas Schwab <schwab@suse.de> + + * Makefile.in: Double all single and back quotes in C-style + comments to help fontifier. + +2006-09-03 Jason Rumney <jasonr@gnu.org> + + * w32.c (shutdown_handler): New function to exit cleanly on shutdown. + (globals_of_w32): Register it as a signal handler. + +2006-09-02 Juri Linkov <juri@jurta.org> + + * marker.c (Fmarker_position): Doc fix. + +2006-09-03 Eli Zaretskii <eliz@gnu.org> + + * window.c (syms_of_window) <split-height-threshold>: + <window-min-height, window-min-width>: Doc fix. + +2006-09-02 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (xg_get_file_with_chooser): Change file chooser message + for writing files. Call gtk_file_chooser_set_current_name to keep + default filename. + + * minibuf.c (Finternal_complete_buffer): Move after DEFUN:s it calls. + +2006-09-02 Jindrich Makovicka <makovick@gmail.com> (tiny change) + + * fns.c (concat) [__GNUC__]: Declare with + `__attribute__((noinline))'. + + * eval.c (apply1, call2) [__GNUC__]: Declare with + `__attribute__((noinline))'. + +2006-09-02 Stuart D. Herring <herring@lanl.gov> + + * minibuf.c (Finternal_complete_buffer): New function. + (syms_of_minibuf): Defsubr it. + (Fread_buffer): Use it, instead of Vbuffer_alist. + +2006-09-01 Martin Rudalics <rudalics@gmx.at> + + * buffer.h (struct buffer_text): New field chars_modiff. + (CHARS_MODIFF, BUF_CHARS_MODIFF): New macros. + * buffer.c (Fbuffer_chars_modified_tick): New function returning + value of BUF_CHARS_MODIFF. + (syms_of_buffer): Defsubr it. + (Fget_buffer_create): Initialize BUF_CHARS_MODIFF. + * insdel.c (modify_region): New argument preserve_chars_modiff. + Set CHARS_MODIFF to MODIFF provided preserve_chars_modiff is zero. + (insert_1_both, insert_from_string_1, insert_from_buffer_1) + (adjust_after_replace, adjust_after_replace_noundo) + (replace_range, replace_range_2, del_range_2): Reset CHARS_MODIFF. + * lisp.h (modify_region): Add fourth argument in extern. + * casefiddle.c (casify_region): Call modify_region with fourth + argument zero to assert that CHARS_MODIFF is updated. + * editfns.c (Fsubst_char_in_region, Ftranslate_region_internal) + (Ftranspose_regions): Likewise. + * textprop.c (Fadd_text_properties, Fset_text_properties) + (Fremove_text_properties, Fremove_list_of_text_properties): + Call modify_region with fourth argument 1 to avoid that + CHARS_MODIFF is updated. + +2006-08-31 Richard Stallman <rms@gnu.org> + + * editfns.c (Fformat): Don't sign-extend for %o or %x. + +2006-08-29 Chong Yidong <cyd@stupidchicken.com> + + * indent.c (Fvertical_motion): Don't move back if we were + displaying a Lisp string, either. + +2006-08-28 Kim F. Storm <storm@cua.dk> + + * xdisp.c (get_window_cursor_type) [!HAVE_WINDOW_SYSTEM]: + Don't attempt to replace cursor on image glyphs. + +2006-08-28 Kenichi Handa <handa@m17n.org> + + * coding.c (Fdetect_coding_region, Fdetect_coding_string): + Fix docstring about ISO-2022 control characters. + +2006-08-28 Kim F. Storm <storm@cua.dk> + + * xdisp.c (get_window_cursor_type): Replace BOX cursor on images + with a hollow box cursor if image is larger than 32x32 (or the default + frame font if that is bigger). Replace any other cursor on images + with hollow box cursor, as redisplay doesn't support bar and hbar + cursors on images. + +2006-08-27 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * alloc.c (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Undo previous + change. Move mutex lock/unlock operations inside BLOCK_INPUT. + + * dired.c (directory_files_internal_unwind, directory_files_internal) + (file_name_completion): Add BLOCK_INPUT around opendir/closedir. + + * image.c [MAC_OS] (image_load_qt_1): Use ComponentResult instead + of OSErr. + + * keyboard.c (in_sighandler): Remove variable. + (Fcurrent_idle_time): Add missing `doc:'. + (input_available_signal, init_keyboard): Undo previous change. + + * keyboard.h (in_sighandler): Remove extern. + + * mac.c (create_apple_event_from_event_ref, select) + (Fmac_get_file_creator, Fmac_get_file_type, Fmac_set_file_creator) + (Fmac_set_file_type, cfstring_create_normalized) + (mac_get_system_locale, select_and_poll_event, sys_select): + Use OSStatus instead of OSErr. + + * macfns.c [TARGET_API_MAC_CARBON] (mac_update_proxy_icon): + Don't use FRAME_FILE_NAME. Use (FS)UpdateAlias. + (Fx_create_frame): Apply 2006-07-03 for xfns.c. + + * macselect.c (get_scrap_from_symbol, clear_scrap, put_scrap_string) + (put_scrap_private_timestamp, scrap_has_target_type, get_scrap_string) + (get_scrap_private_timestamp, get_scrap_target_type_list) + (x_own_selection, x_get_foreign_selection) + (Fx_disown_selection_internal, Fx_selection_owner_p) + (Fx_selection_exists_p): Use OSStatus instead of OSErr. + + * macterm.c (mac_draw_string_common, mac_query_char_extents) + (x_iconify_frame, XLoadQueryFont, install_window_handler) + (mac_handle_command_event, init_command_handler, init_menu_bar): + Use OSStatus instead of OSErr. + (x_free_frame_resources) [TARGET_API_MAC_CARBON]: Don't use + FRAME_FILE_NAME. + (x_query_font): Apply 2006-08-04 change for xterm.c. + (Qhi_command): Rename from Qhicommand. All uses changed. + + * macterm.h (struct mac_output) [TARGET_API_MAC_CARBON]: Remove member + file_name. + (FRAME_FILE_NAME): Remove macro. + (install_window_handler, create_apple_event_from_event_ref): + Return OSStatus instead of OSErr. + +2006-08-26 Kim F. Storm <storm@cua.dk> + + * buffer.c (Fset_buffer_multibyte): + * editfns.c (Fcurrent_time, Fget_internal_run_time): + * macfns.c (Fxw_color_values): + * w32fns.c (Fxw_color_values): + * xfns.c (Fxw_color_values): Simplify; use list3. + + * fileio.c (Fmake_directory_internal, Fdelete_directory) + (Fdelete_file): Simplify; use list1. + (Frename_file, Fadd_name_to_file, Fmake_symbolic_link): + Simplify; remove NO_ARG_ARRAY stuff, use list2. + +2006-08-25 Richard Stallman <rms@gnu.org> + + * buffer.c (Fswitch_to_buffer): Fix previous change. + +2006-08-25 Kim F. Storm <storm@cua.dk> + + * keyboard.c (Fcurrent_idle_time): Simplify. + +2006-08-25 Richard Stallman <rms@gnu.org> + + * fns.c (sxhash_string): Rotate properly; don't lose bits. + +2006-08-24 Francesc Rocher <francesc.rocher@gmail.com> + + * xdisp.c (overline_margin): New variable. + (x_produce_glyphs): Use it. + (syms_of_xdisp): DEFVAR_INT it. + + * xterm.c (x_underline_at_descent_line): New variable. + (syms_of_xterm): DEFVAR_BOOL it. + (x_draw_glyph_string): Use it. + Draw underline and overline up to the end of line if the face + extends to the end of line. + + * macterm.c: Likewise. + + * w32term.c: Likewise. + +2006-08-24 Nick Roberts <nickrob@snap.net.nz> + + * buffer.c (Fswitch_to_buffer): Move buffer to front of + buffer-alist if necessary. + +2006-08-22 Kim F. Storm <storm@cua.dk> + + * xdisp.c (update_tool_bar): Redisplay toolbar also when only + number of items changes. + +2006-08-22 Stefan Monnier <monnier@iro.umontreal.ca> + + * buffer.c (Fset_buffer_multibyte): Record proper undo entry. + +2006-08-21 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * keyboard.c: Clarify difference between in_sighandler and + handling_signal. + +2006-08-21 Kim F. Storm <storm@cua.dk> + + * macterm.c (x_draw_stretch_glyph_string): + * w32term.c (x_draw_stretch_glyph_string): + * xterm.c (x_draw_stretch_glyph_string): It is ok to draw a + stretch glyph in left marginal areas on header and mode lines. + +2006-08-21 Kenichi Handa <handa@m17n.org> + + * keyboard.c (syms_of_keyboard): Docstring of + Vunread_post_input_method_events and Vunread_input_method_events + fixed. + +2006-08-20 Chong Yidong <cyd@stupidchicken.com> + + * keyboard.c (show_help_echo): Preserve mouse movement flag if + tracking mouse. + +2006-08-20 Richard Stallman <rms@gnu.org> + + * xfaces.c (load_pixmap): Add quotes in error message. + + * keyboard.c (Fcurrent_idle_time): New function. + (syms_of_keyboard): defsubr it. + +2006-08-18 Nick Roberts <nickrob@snap.net.nz> + + * window.c (Fset_window_fringes): Do nothing on a tty. + (Fwindow_fringes): Put ? operator after the line break. + +2006-08-16 Andreas Schwab <schwab@suse.de> + + * print.c (debug_output_compilation_hack): Fix return type. + +2006-08-16 Richard Stallman <rms@gnu.org> + + * print.c (debug_output_compilation_hack): New function. + +2006-08-16 Kenichi Handa <handa@m17n.org> + + * fileio.c (choose_write_coding_system): Use LF for end-of-line + in auto-saving. + +2006-08-15 Chong Yidong <cyd@stupidchicken.com> + + * keyboard.c (read_char): Don't change idle timer state at all if + end_time is supplied. + +2006-08-15 Kenichi Handa <handa@m17n.org> + + * coding.c (ONE_MORE_BYTE_CHECK_MULTIBYTE): New arg RET. If SRC + is exhausted, return with RET. + (detect_coding_emacs_mule, detect_coding_iso2022) + (detect_coding_sjis, detect_coding_big5, detect_coding_utf_8) + (detect_coding_utf_16, detect_coding_ccl): Adjusted for the above + change. + +2006-08-14 Chong Yidong <cyd@stupidchicken.com> + + * keyboard.c (read_char): Don't reset idle timers if a time limit + is supplied. + +2006-08-14 Kim F. Storm <storm@cua.dk> + + * .gdbinit (pitx): Print iterator position. + Limit stack dump in case iterator is not initialized. + +2006-08-12 Eli Zaretskii <eliz@gnu.org> + + * frame.c (Fmouse_position, Fmouse_pixel_position) + (Fset_mouse_position, Fset_mouse_pixel_position): Doc fix. + +2006-08-11 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xselect.c (Fx_register_dnd_atom): New function. + (syms_of_xselect): Defsubr it. + (x_handle_dnd_message): Check that message_type is in + dpyinfo->x_dnd_atoms before generating lisp event. + + * xterm.h (struct x_display_info): Add x_dnd_atoms* to keep track + of drag and drop Atoms. + + * xterm.c (x_term_init): Initialize dpyinfo->x_dnd_atoms*. + +2006-08-10 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * keyboard.c: Define in_sighandler. + (input_available_signal): Set in_sighandler. + (init_keyboard): Initialize in_sighandler. + + * keyboard.h: Declare in_sighandler. + + * alloc.c (UNBLOCK_INPUT_ALLOC, BLOCK_INPUT_ALLOC): Use in_sighandler + to check if mutex should be locked or not. + +2006-08-09 Richard Stallman <rms@gnu.org> + + * keyboard.c (keyremap_step): No-op if fkey->parent = nil. + (read_key_sequence): Always start fkey.start and fkey.end at 0, + and likewise for keytran. + +2006-08-09 Kenichi Handa <handa@m17n.org> + + * coding.c (syms_of_coding): Improve the docstring + of file-coding-system-alist. + +2006-08-07 Andreas Schwab <schwab@suse.de> + + * puresize.h (BASE_PURESIZE): Increase to 1120000. + +2006-08-06 Chong Yidong <cyd@stupidchicken.com> + + * buffer.c (Vchange_major_mode_hook, Qchange_major_mode_hook): New vars. + (Fkill_all_local_variables): Use it. + (syms_of_buffer): Defvar it. + +2006-08-05 Eli Zaretskii <eliz@gnu.org> + + * w32.c (w32_valid_pointer_p): New function. + + * w32.h: Add prototype for w32_valid_pointer_p. + + * alloc.c: Include w32.h. + (valid_lisp_object_p) [WINDOWSNT]: Call w32_valid_pointer_p to do + the job. + + * keyboard.c (kbd_buffer_get_event): Return Qnil when current time + is exactly equal to end_time, not only when it is past that. + +2006-08-04 Chong Yidong <cyd@stupidchicken.com> + + * keyboard.c (read_char): Rebalance specpdl after receiving jump. + + * process.c: Reapply 2006-08-01 change. + +2006-08-04 Eli Zaretskii <eliz@gnu.org> + + * w32fns.c (w32_query_font): Fix last change: use stricmp. + +2006-08-04 Stefan Monnier <monnier@iro.umontreal.ca> + + * editfns.c (Fsubst_char_in_region): Redo the setup work after running + the before-change-functions since they may have altered the buffer. + +2006-08-04 Ralf Angeli <angeli@caeruleus.net> + + * w32fns.c (w32_createwindow): Handle -geometry command line option + and the geometry settings in the Registry. + +2006-08-04 Kenichi Handa <handa@m17n.org> + + * w32fns.c (w32_query_font): Compare names by ignoring case. + + * xterm.c (x_query_font): Compare names by ignoring case. + +2006-08-03 Jason Rumney <jasonr@gnu.org> + + * w32menu.c (w32_menu_show, w32_dialog_show): Call Fsignal to quit + when no option selected. + +2006-08-03 Chong Yidong <cyd@stupidchicken.com> + + * process.c: Revert last change. + +2006-08-01 Kim F. Storm <storm@cua.dk> + + * process.c (wait_reading_process_output_unwind): New function. + Restores waiting_for_user_input_p to saved value. + (wait_reading_process_output): Unwind protect waiting_for_user_input_p + instead of save/restore old value on stack. + +2006-07-30 Thien-Thi Nguyen <ttn@gnu.org> + + * editfns.c: Undo 2006-06-27 change. + +2006-07-29 Eli Zaretskii <eliz@gnu.org> + + * coding.c (Ffind_operation_coding_system): Revert the change from + 2006-05-29. + + * alloc.c [WINDOWSNT]: Include fcntl.h, to fix last change. + +2006-07-28 Richard Stallman <rms@gnu.org> + + * xfaces.c (lookup_named_face, Fdisplay_supports_face_attributes_p): + Add conditional aborts for clarity. + + * xdisp.c (update_menu_bar): New arg HOOKS_RUN. Callers changed. + Used to avoid running the hooks over and over for each frame. + (prepare_menu_bars): Pass value from update_menu_bar + as HOOKS_RUN of next call. + + * keyboard.c (safe_run_hooks_1): Don't crash if Vrun_hooks is nil. + +2006-07-28 Kim F. Storm <storm@cua.dk> + + * alloc.c (valid_pointer_p): New function (from valid_lisp_object_p). + (valid_lisp_object_p): Use it to check for valid SUBRP obj. + +2006-07-26 Chong Yidong <cyd@stupidchicken.com> + + * keyboard.c (read_char): New arg END_TIME specifying timeout. + All callers changed. Turn off echoing if END_TIME is non-NULL. + (kbd_buffer_get_event): New arg END_TIME. + + * lread.c (read_filtered_event): New arg SECONDS to wait until. + (Fread_char, Fread_event, Fread_char_exclusive): New arg SECONDS. + + * lisp.h: Update read-char, read-event, and read_filtered_event + prototypes. + + * keyboard.h: Include systime.h. Update read_char prototype. + +2006-07-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * alloc.c (find_string_data_in_pure): New function. + (make_pure_string): Use it to reuse existing string data if possible. + + * puresize.h (BASE_PURESIZE): Decrease to 1102000. + +2006-07-22 Stefan Monnier <monnier@iro.umontreal.ca> + + * keymap.c (Fdefine_key): If the key binding definition looks like an + XEmacs-style key sequence, convert it to Emacs's format. + +2006-07-22 Ralf Angeli <angeli@caeruleus.net> + + * w32fns.c (w32_createwindow): If `left' and/or `top' frame + parameters are bound to some values, use that instead of + CW_USEDEFAULT. + +2006-07-21 Eli Zaretskii <eliz@gnu.org> + + * w32.c (convert_time): Use explicit long double constants to + ensure long double arithmetics is used throughout. + +2006-07-20 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp): New vars. + (init_alloc_once): Initialize them. + (pure_alloc): Allocate non-Lisp objects from the end of pure storage + without alignment. + + * puresize.h (BASE_PURESIZE): Decrease to 1141000. + +2006-07-18 Francis Litterio <franl@world.std.com> + + * w32term.c (x_calc_absolute_position): Fix frame positioning + with negative X/Y coordinates. + +2006-07-18 Dan Nicolaescu <dann@ics.uci.edu> + + * xterm.c (x_connection_closed, x_error_quitter): Mark as NO_RETURN. + + * textprop.c (text_read_only): Likewise. + + * lread.c (end_of_file_error): Likewise. + + * lisp.h (circular_list_error, memory_full, buffer_memory_full): + Likewise. + + * eval.c (unwind_to_catch): Likewise. + + * buffer.h (buffer_slot_type_mismatch): Likewise. + +2006-07-18 Kim F. Storm <storm@cua.dk> + + Cleanup Fsignal calls that never returns; now only use it for Qquit. + + * eval.c (xsignal): New func. Like Fsignal, but marked no-return. + (xsignal0, xsignal1, xsignal2, xsignal3): New no-return functions. + (signal_error): New no-return function (from xfaces.c). + (Fthrow): Use xsignal2 instead of Fsignal + abort. + (error): Use xsignal1 instead of Fsignal + abort. + (FletX, Flet, grow_specpdl): Use signal_error. + (Feval, Ffuncall, funcall_lambda): Use xsignal1, xsignal2. + + * alloc.c (buffer_memory_full, memory_full): Use xsignal. Remove loop. + (list1): New function. + + * lisp.h (list1): Add EXFUN. + (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error): + Add prototypes. Mark them as no-return. + + * buffer.c (Fbuffer_local_value, Fbarf_if_buffer_read_only): + Use xsignal1. + + * callint.c (check_mark): Use xsignal0. + + * casefiddle.c (casify_object): wrong_type_argument is no-return. + + * cmds.c (Fforward_char, Fdelete_char): Use xsignal0. + + * coding.c (Fcheck_coding_system): Use xsignal1. Remove loop. + (Fdefine_coding_system_internal): Use xsignal1. + + * data.c (circular_list_error): Use xsignal. + (wrong_type_argument): Use xsignal2. Don't care about return value. + (args_out_of_range, args_out_of_range_3): Use xsignal2, xsignal3. + Remove loop around Fsignal. + (indirect_variable, Fsymbol_value, set_internal, Fdefault_value) + (indirect_function, Findirect_function, Fstring_to_number) + (Fmakunbound, Ffmakunbound, Fsymbol_function, Ffset): Use xsignal1. + (arith_driver, float_arith_driver, Frem, Fmod, arith_error): + Use xsignal0. + + * doc.c (Fdocumentation): Use xsignal1. + + * editfns.c (region_limit, Fget_internal_run_time): Use xsignal0. + + * fileio.c (report_file_error): Use xsignal. + (barf_or_query_if_file_exists, Fcopy_file, Fdelete_file) + (Finsert_file_contents): Use xsignal2. + (syms_of_fileio): Use list2, list3. + + * floatfns.c (arith_error, range_error, domain_error): Use xsignal2. + (range_error2, domain_error2): Use xsignal3. + (rounding_driver, fmod_float): Use xsignal0. + (float_error): Use xsignal1. + (matherr): Use xsignal. + + * fns.c (Flength): wrong_type_argument is no-return. + (hashfn_user_defined, Fmake_hash_table): Use signal_error. + (Fmd5): Use xsignal1. + + * frame.c (x_set_line_spacing, x_set_screen_gamma): Use signal_error. + + * keyboard.c (recursive_edit_1): Use xsignal1. + + * keymap.c (Fmap_keymap): Use xsignal1. + + * lread.c (Fload): Use xsignal2, signal_error. + (end_of_file_error): Use xsignal0, xsignal1. + (read0): Use xsignal1. + (invalid_syntax): New error function marked no-return. + (read_integer, read1, read_list): Use it. + + * macselect.c (x_get_local_selection): Use signal_error. + + * msdos.c (Fmsdos_set_mouse_buttons): Use xsignal2. + + * search.c (compile_pattern_1): Use xsignal1. + (signal_failure): Remove (was only called once). + (search_command): Use xsignal1 instead of signal_failure. + + * syntax.c (scan_lists): Use xsignal3. + + * textprop.c (text_read_only): Use xsignal0, xsignal1. + + * unexsol.c (unexec): Use xsignal. + + * window.c (window_scroll_pixel_based, window_scroll_line_based): + Use xsignal0. + + * xfaces.c (signal_error): Move to eval.c. + (resolve_face_name): Use xsignal1. + + * xfns.c (x_decode_color): Use signal_error. + + * xselect.c (x_get_local_selection, copy_multiple_data) + (x_get_window_property_as_lisp_data) + (lisp_data_to_selection_data, CHECK_CUT_BUFFER) + (Fx_get_cut_buffer_internal): Use signal_error. + +2006-07-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c (XTread_socket): Undo previous change. + +2006-07-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c (keycode_to_xkeysym): Remove function. All uses now + directly lookup keycode_to_xkeysym_table. + [USE_MAC_TSM] (mac_handle_text_input_event): Don't construct + ASCII_KEYSTROKE_EVENT for non-zero keycode_to_xkeysym_table entries. + (XTread_socket): Use character codes to construct keypad key events. + (mac_initialize_display_info) [MAC_OSX]: Use CGDisplaySamplesPerPixel. + (x_delete_display): Apply 2006-07-04 change for xterm.c. + +2006-07-17 Richard Stallman <rms@gnu.org> + + * keyboard.c (Vcommand_error_function): New variable. + (syms_of_keyboard): Defvar it. + (cmd_error_internal): Simplify, and handle Vcommand_error_function. + + * dispnew.c (init_display): Mention DISPLAY as well as TERM in err msg. + +2006-07-17 Kim F. Storm <storm@cua.dk> + + * xdisp.c (handle_single_display_spec): Ensure the right value of + it->position is saved by push_it. + (pop_it): Restore it->object for GET_FROM_BUFFER and GET_FROM_STRING. + (reseat_1): Don't setup it->object twice. + (set_iterator_to_next): No need to set it->object after pop_it. + (move_it_to): Explicitly check to see if last move reached to_charpos. + +2006-07-17 Thien-Thi Nguyen <ttn@gnu.org> + + * xdisp.c (display_mode_line): Preserve match data. + +2006-07-14 Kim F. Storm <storm@cua.dk> + + * w32.c (pfn_WSACreateEvent, pfn_WSACloseEvent): New func ptrs. + (init_winsock): Load them. Use ws2_32.dll. + (sys_listen): Undo last change. Just set FILE_LISTEN flag. + (sys_accept): Undo last change. Instead, set child status to + STATUS_READ_ACKNOWLEDGED and reset char_avail event so next + sys_select will wakeup the reader thread. + (_sys_wait_accept): New function used by reader thread to wait for + an incoming connection on a server socket. + + * w32.h (_sys_read_ahead, _sys_wait_accept): Add prototypes. + + * w32proc.c (reader_thread): Use _sys_wait_accept to wait on a + server socket (FILE_LISTEN flag). + +2006-07-14 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * sound.c (alsa_init): Call snd_pcm_close after successful snd_pcm_open. + +2006-07-14 Kim F. Storm <storm@cua.dk> + + * w32.c: Fix high cpu load for server sockets. + (pfn_WSAEventSelect): New function ptr. + (init_winsock): Load it. + (sys_listen): Set FILE_LISTEN flag. Set event mask for socket's + char_avail event object to FD_ACCEPT. + (sys_accept): Check FILE_LISTEN flag. Set event mask on new + socket's char_avail event object to FD_READ|FD_CLOSE. + + * w32.h (FILE_LISTEN): New filedesc flag value. + +2006-07-13 Kim F. Storm <storm@cua.dk> + + * bytecode.c (Fbyte_code): Use CAR, CDR for Bcar, Bcdr. + Use CAR_SAFE, CDR_SAFE for Bcar_safe, Bcdr_safe. + Simplify loops and use CAR for Bnth and Belt. + + * data.c (Findirect_function): Optimize for no indirection. + + * eval.c (Fthrow): Remove loop around Fsignal. + (Feval, Fapply, Ffuncall): Optimize for no function indirection. + Use original function name in all signaled errors. + Simplify Fsignal calls (no return). + (funcall_lambda): Simplify Fsignal calls (no return). + +2006-07-13 Andreas Schwab <schwab@suse.de> + + * syntax.c (scan_sexps_forward): Use EMACS_INT for out_bytepos and + out_charpos. + +2006-07-13 Kenichi Handa <handa@m17n.org> + + * editfns.c (Fformat): Fix calculation of text property positions + of format string. + +2006-07-12 Kim F. Storm <storm@cua.dk> + + * lisp.h (CHECK_TYPE): New macro for generic type checking. + (CAR_SAFE, CDR_SAFE): New macros. + (ARRAYP, CHECK_ARRAY): New macros. + (CHECK_VECTOR_OR_STRING, CHECK_SUBR): New macros. + (CHECK_WINDOW_CONFIGURATION): New macro. + (CHECK_LIST_CONS, CHECK_LIST_END): New checks for list traversal. + (CHECK_STRING_OR_BUFFER, CHECK_HASH_TABLE, CHECK_LIST) + (CHECK_STRING, CHECK_STRING_CAR, CHECK_CONS, CHECK_SYMBOL) + (CHECK_CHAR_TABLE, CHECK_VECTOR, CHECK_VECTOR_OR_CHAR_TABLE) + (CHECK_BUFFER, CHECK_WINDOW, CHECK_LIVE_WINDOW, CHECK_PROCESS) + (CHECK_NUMBER, CHECK_NATNUM, CHECK_MARKER, CHECK_OVERLAY) + (CHECK_NUMBER_COERCE_MARKER, CHECK_FLOAT, CHECK_NUMBER_OR_FLOAT) + (CHECK_NUMBER_OR_FLOAT_COERCE_MARKER): Use CHECK_TYPE. + + * category.h (CHECK_CATEGORY, CHECK_CATEGORY_SET): + * frame.h (CHECK_FRAME, CHECK_LIVE_FRAME): Use CHECK_TYPE. + + * callint.c (Fcall_interactively): + * casefiddle.c (casify_object): + * editfns.c (general_insert_function): + * fns.c (Flength, Felt, Ffillarray): + * data.c (Fcar, Fcdr): Remove loop around wrong_type_argument. + + * data.c (wrong_type_argument): Remove loop around Fsignal. + (Farrayp, Fsequencep): Use ARRAYP. + (Fcar): Use CAR. + (Fcar_safe): Use CAR_SAFE. + (Fcdr): Use CDR. + (Fcdr_safe): Use CDR_SAFE. + (Fsetcar, Fsetcdr): Use CHECK_CONS. + (Fsubr_arity, Fsubr_name): Use CHECK_SUBR. + (Faset): Use CHECK_ARRAY. + + * fns.c (Felt): Use CHECK_ARRAY. + (concat): Use CHECK_NUMBER. + (Fsubstring, substring_both): Use CHECK_VECTOR_OR_STRING. + (Fmemq): Use CHECK_LIST. + (Fassq, Fassoc, Frassq, Frassoc): Use CAR. + (assq_no_quit): Use CAR_SAFE. + (Fnthcdr, Fmember, Fdelq, Fdelete, Fnreverse, Fnconc): + Use CHECK_LIST_CONS. + (Freverse, Fplist_get, Flax_plist_get): Use CHECK_LIST_END. + + * bytecode.c (Fbyte_code): Use CHECK_VECTOR. + + * casetab.c (check_case_table): + * category.c (check_category_table): + * marker.c (Fcopy_marker): + * syntax.c (check_syntax_table): + * xfaces.c (load_pixmap): Use CHECK_TYPE. + + * fns.c (Fcopy_sequence, concat): + * fringe.c (Fdefine_fringe_bitmap): + * lread.c (check_obarray): Cleanup wrong_type_argument use. + + * keyboard.c (access_keymap_keyremap): Use ARRAYP. + + * keymap.c (Fdefine_key, Flookup_key): + * macros.c (Fstart_kbd_macro): Use CHECK_VECTOR_OR_STRING. + + * mac.c (Fmac_get_preference): Use CHECK_LIST_END. + + * search.c (Fset_match_data): Use CHECK_LIST. + + * sunfns.c (sun_item_create): Use CHECK_LIST_CONS. + + * window.c (Fwindow_configuration_frame, Fset_window_configuration): + (compare_window_configurations): Use CHECK_WINDOW_CONFIGURATION. + +2006-07-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * Makefile.in (dired.o, editfns.o, fileio.o): Depend on blockinput.h. + + * dired.c: Include blockinput.h. + (Ffile_attributes): Add BLOCK_INPUT around getpwuid/getgrgid. + + * editfns.c: Include blockinput.h. + (Fuser_login_name, Fuser_full_name): Add BLOCK_INPUT around + getpwuid/getpwnam. + + * fileio.c: Include blockinput.h. + (Fexpand_file_name, search_embedded_absfilename): Add BLOCK_INPUT + around getpwnam. + (search_embedded_absfilename): Remove spurious xfree. + +2006-07-11 Kim F. Storm <storm@cua.dk> + + * dispnew.c (sit_for): Reduce number of args from 5 to 3. + Now just one TIMEOUT arg that can be a Lisp float or Lisp int. + Combine args DISPLAY and INITIAL_DISPLAY into one arg DO_DISPLAY. + Signal error if TIMEOUT is not a number. + Undo 2006-06-14 change for non-preemptive display if TIMEOUT < 0. + The rework of sit_for args also fixes several incorrect Qt args + which should have been 1. + (Fredisplay): Pass 1 instead of Qt to swallow_events and + detect_input_pending_run_timers. + + * lisp.h (sit_for): Update prototype. + (Fredisplay): Add EXFUN. + + * dispextern.h (sit_for): Remove prototype. + + * callint.c (Fcall_interactively): + * minibuf.c (temp_echo_area_glyphs): + * keyboard.c (command_loop_1, read_char, Fexecute_extended_command): + * fileio.c (Fdo_auto_save): Update/simplify sit_for calls. + +2006-07-11 Stefan Monnier <monnier@iro.umontreal.ca> + + * syntax.c (forw_comment): Also use EMACS_INT for buffer positions. + +2006-07-11 Kim F. Storm <storm@cua.dk> + + * dispnew.c (Fredisplay): Add FORCE argument to force redisplay when + input is available. Fix test for redisplay_dont_pause non-nil. + Specbind redisplay-dont-pause to t if FORCE non-nil. + +2006-07-10 Chong Yidong <cyd@stupidchicken.com> + + * puresize.h (BASE_PURESIZE): Increment to 1211000. + + * dispnew.c (Fredisplay): New function, equivalent to (sit-for 0). + (Fsit_for): Function deleted. + + * keyboard.c (command_loop_1, Fexecute_extended_command): + Call sit_for instead of Fsit_for. + + * minibuf.c (temp_echo_area_glyphs): Likewise. + +2006-07-09 Stefan Monnier <monnier@iro.umontreal.ca> + + * syntax.c (Fforward_comment): Revert the reversion. + (back_comment, scan_lists): Also use EMACS_INT for buffer positions. + +2006-07-09 John Paul Wallington <jpw@pobox.com> + + * syntax.c (Fforward_comment): Revert previous change. + +2006-07-09 Kim F. Storm <storm@cua.dk> + + * window.c (Fforce_window_update): Doc fix. + +2006-07-08 Stephen Gildea <gildea@stop.mail-abuse.org> + + * fileio.c (do_auto_save_make_dir): Make the auto-save-list-file + directory unreadable for better user privacy. + +2006-07-07 Stefan Monnier <monnier@iro.umontreal.ca> + + * syntax.c (Fforward_comment): Fix int-32 vs EMACS_INT-64 mixup. + + * lread.c (read_filtered_event): Remove `register' qualifier because it + causes compilation problem with gcc-4.0.2-20051125 on amd64. + (readevalloop): Remove unused var `bpos'. + Yet another int/Lisp_Object mixup (YAILOM). + +2006-07-07 Eli Zaretskii <eliz@gnu.org> + + * keyboard.c (Fexecute_extended_command): Mention the argument + PREFIXARG in the doc string. + +2006-07-07 Kim F. Storm <storm@cua.dk> + + * fringe.c (Fdefine_fringe_bitmap): Doc fix. + +2006-07-05 Chong Yidong <cyd@stupidchicken.com> + + * insdel.c (prepare_to_modify_buffer): For an indirect buffer, do + clash detection using the base buffer. + + * puresize.h (BASE_PURESIZE): Increment to 1210500. + +2006-07-04 Kim F. Storm <storm@cua.dk> + + * xterm.c (x_delete_display): Don't free or derefence NULL pointers. + +2006-07-04 Kenichi Handa <handa@m17n.org> + + * fontset.c (Fset_overriding_fontspec_internal): Check if we need + to update Voverriding_fontspec_alist. + +2006-07-03 Richard Stallman <rms@gnu.org> + + * xfns.c (Fx_create_frame): Move unwind_create_frame setup down. + + * xfaces.c (Fface_attribute_relative_p): Doc fix. + + * textprop.c (Fget_char_property_and_overlay): Doc fix. + + * eval.c (Fdefvaralias): Doc fix. + +2006-07-03 Kim F. Storm <storm@cua.dk> + + * dispnew.c (sit_for): Fix preempt condition. + +2006-07-02 Stefan Monnier <monnier@iro.umontreal.ca> + + * lread.c (read_filtered_event): Treat select-window just like + switch-frame. + +2006-07-02 Kim F. Storm <storm@cua.dk> + + * xdisp.c (display_tool_bar_line): Skip glyphs which are too big + to ever fit the tool-bar, + (MAX_FRAME_TOOL_BAR_HEIGHT): New macro. + (tool_bar_lines_needed): Use unused mode-line row as temp_row. + (redisplay_tool_bar): Only clear desired matrix if we actually + change the tool-bar window height. Only try to make the tool-bar + window bigger if there is actually room for it. + +2006-06-30 Ralf Angeli <angeli@caeruleus.net> + + * w32term.c (x_make_frame_visible): Use SystemParametersInfo with + SPI_GETWORKAREA to find the dimensions of the screen work area, + and adjust vertical position of the frame in order to avoid being + covered by the task bar. + + * w32fns.c (w32_createwindow): Use CW_USEDEFAULT instead of + f->left_pos and SH_SHOW instead of f->top_pos in the call to + CreateWindow. Record the actual position in f->left_pos and + f->top_pos. + +2006-06-30 John Paul Wallington <jpw@pobox.com> + + * w32console.c (syms_of_ntterm) <w32-use-full-screen-buffer>: + Doc fix - default value has changed. + +2006-06-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * mac.c [!TARGET_API_MAC_CARBON]: Don't include FixMath.h or Scrap.h. + + * macfns.c (Fx_create_frame): Apply 2006-06-24 change for xfns.c. + + * macgui.h (USE_MAC_TSM) [TARGET_API_MAC_CARBON]: Set default to 1. + + * macterm.c (Qeql): Add extern. + (x_set_mouse_pixel_position) [MAC_OSX]: Use CGWarpMouseCursorPosition. + (fm_style_face_attributes_alist) [USE_ATSUI]: New variable. + (syms_of_macterm) [USE_ATSUI]: Initialize and staticpro it. + Change keys of Vmac_atsu_font_table from strings to numbers. + (fm_style_to_face_attributes) [USE_ATSUI]: New function. + (init_font_name_table) [USE_ATSUI]: Use it. + (saved_ts_script_language_on_focus) [USE_MAC_TSM]: New variable. + (syms_of_macterm) [USE_MAC_TSM]: Initialize and staticpro it. + [USE_MAC_TSM] (mac_tsm_resume): Restore script and language codes + only when saved_ts_script_language_on_focus coincides with + Vmac_ts_script_language_on_focus. + [USE_MAC_TSM] (mac_tsm_suspend): Save value of + Vmac_ts_script_language_on_focus to saved_ts_script_language_on_focus. + (XTread_socket) [USE_MAC_TSM]: Add Mac OS Classic support. + [USE_MAC_TSM] (mac_handle_text_input_event, init_tsm): Likewise. + +2006-06-27 Chong Yidong <cyd@stupidchicken.com> + + * editfns.c (Fdelete_field, Ffield_string, Ffield_beginning) + (Ffield_string_no_properties, Ffield_end): Mention + args-out-of-range error condition in docstring. + +2006-06-27 Kim F. Storm <storm@cua.dk> + + * xdisp.c (handle_composition_prop): Set stop_charpos before push_it. + +2006-06-25 Kim F. Storm <storm@cua.dk> + + * s/gnu-linux.h (SIGNALS_VIA_CHARACTERS): Define for Linux kernel + version 2.4 and later. + +2006-06-24 Chong Yidong <cyd@stupidchicken.com> + + * xfns.c (Fx_create_frame): Set font parameter directly instead of + using x_default_parameter, since x_get_args clears the parm alist. + +2006-06-24 Eli Zaretskii <eliz@gnu.org> + + * dired.c (directory_files_internal) [WINDOWSNT]: Find files + case-insensitively. + +2006-06-24 Aidan Kehoe <kehoea@parhasard.net> + + * lread.c (read_escape): When an unknown Unicode code point is + encountered as a string or character escape, signal an error. + +2006-06-23 Kim F. Storm <storm@cua.dk> + + * .gdbinit (pitx): Dump iterator stack. + + * xdisp.c (handle_composition_prop): Push iterator on stack. + (set_iterator_to_next): Pop iterator at end of composition. + +2006-06-23 Martin Rudalics <rudalics@gmx.at> + + * fileio.c (Frename_file) [DOS_NT]: Don't try to move directory to + itself on DOS_NT platforms, if the old and new names are identical + but for the letter-case. + +2006-06-21 Kim F. Storm <storm@cua.dk> + + * dispextern.h (struct it): Add `position' member to iterator stack. + Rename `pos' member to `current'. Rearrange and add comments. + + * xdisp.c (handle_stop): Set it->ignore_overlay_strings_at_pos_p + if we get any overlays. + (set_cursor_from_row): Don't clobber `end' if we rescan from + start_string. + (push_it, pop_it): Save it->position. + +2006-06-19 Richard Stallman <rms@gnu.org> + + * window.c (size_window): New arg FIRST_ONLY. All callers changed. + (adjust_window_trailing_edge): Specially compute FIRST_PARALLEL + for the case of a top-level window and the following minibuffer. + Don't exit because of no `next' when there is a parent. + Use the FIRST_ONLY feature when resizing following windows. + + * syntax.c (init_syntax_once): Give most control chars' syntax Spunct. + +2006-06-17 Kim F. Storm <storm@cua.dk> + + * dispnew.c (update_frame): Check for input pending on entry. + (update_window, update_frame_1): Break loop if input is detected. + +2006-06-16 Francis Litterio <flitterio@gmail.com> + + * xterm.c (x_check_expected_move, handle_one_xevent) + (x_set_offset, x_check_fullscreen): Extensive changes to make + frame positioning deterministic under X. + + * xterm.h (x_output): Add members left_before_move and + top_before_move. Removed members expected_left and expected_top. + +2006-06-16 Kim F. Storm <storm@cua.dk> + + * dispextern.h (struct it): Add union to iterator stack to save + image, composition, and stretch specific paramters. + + * xdisp.c (next_overlay_string): Fix assert. + (push_it, pop_it): Handle composition and stretch specific values. + Only handle it->slice in image (for now). + (back_to_previous_visible_line_start): Continue search if newline is + part of a compisition. Simplify. + (reseat_1): Set it->object to buffer. + (set_iterator_to_next): Set it->object to string or buffer, when + setting it->method to GET_FROM_STRING or GET_FROM_BUFFER. + (next_element_from_composition): Set it->object to buffer if not + from string. + (set_cursor_from_row): Only save start of string if not already + done to handle multiple strings in a row. + + * .gdbinit (pitx): Show composition parameters. + (pgx, pg): New commands to print a glyph structure. + (pgi, pgn): New commands to print specific/next glyph. + (pgrowx, pgrow): New commands to print all glyphs in a row. + +2006-06-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macfns.c (Fx_display_mm_height, Fx_display_mm_width) + [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]: Use CGDisplayScreenSize. + + * macterm.c (do_app_resume, do_app_suspend): Remove functions. + (mac_tsm_resume, mac_tsm_suspend) [USE_MAC_TSM]: New functions. + (mac_handle_window_event, XTread_socket) [USE_MAC_TSM]: Use them. + (Vmac_ts_script_language_on_focus) [USE_MAC_TSM]: New variable. + (syms_of_macterm) [USE_MAC_TSM]: Defvar it. + (saved_ts_language, saved_ts_component) [USE_MAC_TSM]: New variables. + (mac_initialize_display_info) [MAC_OSX]: Use Quartz Display + Services functions to get size of main display in pixels. + +2006-06-14 Chong Yidong <cyd@stupidchicken.com> + + * xdisp.c (back_to_previous_visible_line_start): + Reset it->continuation_lines_width. + +2006-06-14 Richard Stallman <rms@gnu.org> + + * eval.c (Fdefconst): Mark variable as risky. + + * callproc.c (Fcall_process): Doc fix. + + * window.c (adjust_window_trailing_edge): Don't break out of the loop + because there's no next window, if there are parallel windows. + Do break out when WINDOW is nil. + +2006-06-14 Kim F. Storm <storm@cua.dk> + + * dispextern.h (IT_STACK_SIZE): New macro specifying size of + iterator stack (instead of hardcoded number). Increase from 2 to + 4 to make room for propertized overlay strings before and after a + display string, image or composition. + (struct it): Add image_id and method members to iterator stack. + + * xdisp.c (init_from_display_pos): Don't set it->method and + overlay_string_index after pop_it. Add asserts. + (handle_stop): Look for overlay strings around a display string, + image, or composition. Handle properties on those strings. + (next_overlay_string): Don't set string, pos or method after pop_it. + (get_overlay_strings_1): Split from get_overlay_strings; don't + modify it if no overlay strings are found. + (get_overlay_strings): Use get_overlay_strings_1. Always set + it->string and it->method. + (push_it): Push it->image_id and it->method. Push it->object + instead of it->string if method is GET_FROM_IMAGE. + (pop_it): Pop it->image_id and it->method. Ppo it->object + instead of it->string if method is GET_FROM_IMAGE. + Reset it->current.string_pos if popped it->string is nil. + (reseat_1): Remove comment dated 19 May 2003. It expressed doubt + whether a given change was correct; but the change is correct. + Clear it->string_from_display_prop_p. + (set_iterator_to_next): Rely on it->method and it->image_id from + iterator stack, instead of setting them explicitly after pop_it. + + * dispnew.c (sit_for): Undo 2006-06-01 change. Instead, a + negative time forces redisplay even when input is available. + (Fsit_for): Doc fix. + +2006-06-13 Kim F. Storm <storm@cua.dk> + + * dispnew.c: Modify preemptive redisplay to be based on periodic + checks for input. + (PERIODIC_PREEMPTION_CHECKING): Define to 1 iff EMACS_HAS_USECS. + (Vredisplay_preemption_period): New variable. + (syms_of_display): DEFVAR_LISP and initialize it. + (preemption_period, preemption_next_check): New variables. + (update_frame, update_single_window): Initialize them based on + Vredisplay_preemption_period if !force_p. + (update_window, update_frame_1): Use them to determine when to + check for input. + +2006-06-03 Aidan Kehoe <kehoea@parhasard.net> + + * lread.c (read_escape): Provide a Unicode character escape + syntax; \u followed by exactly four or \U followed by exactly + eight hex digits in a comment or string is read as a Unicode + character with that code point. + +2006-06-09 Eli Zaretskii <eliz@gnu.org> + + * window.c (window_scroll_pixel_based): Signal "Beginning of + buffer" when scroll-down at the beginning of an empty buffer. + +2006-06-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c [USE_MAC_TSM] (mac_handle_text_input_event): + Exclude 0x7f from ASCII range. + +2006-06-05 Jason Rumney <jasonr@gnu.org> + + * w32term.c (w32_set_scroll_bar_thumb, x_scroll_bar_create) + (w32_set_vertical_scroll_bar, w32_scroll_bar_handle_click) + (x_scroll_bar_report_motion): Remove workarounds for + versions of Windows NT < 3.51. + [!SIF_ALL]: Remove. + (pfnSetScrollInfo, pfnGetScrollInfo): Remove. + (w32_initialize): Don't dynamically load Get/SetScrollInfo. + +2006-06-04 David Kastrup <dak@gnu.org> + + * dispnew.c: Mention `redisplay-dont-pause' in doc string of + `sit-for'. + +2006-06-03 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macfns.c (x_set_icon_name): Apply 2006-06-02 change for xfns.c. + + * macgui.h (USE_MAC_TSM): Set default to 1 on Mac OS X. + + * macterm.c (tsm_document_id) [USE_MAC_TSM]: New variable. + (Qtext_input, Qupdate_active_input_area, Qunicode_for_key_event) + [USE_MAC_TSM]: Likewise. + (syms_of_macterm) [USE_MAC_TSM]: Intern and staticpro them. + (Qbefore_string) [USE_MAC_TSM]: Add extern. + (do_app_resume, do_app_suspend) [USE_MAC_TSM]: Call + ActivateTSMDocument/DeactivateTSMDocument. + (mac_store_event_ref_as_apple_event): Call mac_post_mouse_moved_event. + (mac_handle_window_event) [USE_MAC_TSM]: Handle + kEventWindowFocusAcquired/kEventWindowFocusRelinquish. + (mac_handle_text_input_event) [USE_MAC_TSM]: New function. + (install_window_handler) [USE_MAC_TSM]: Install it. Register + kEventWindowFocusAcquired/kEventWindowFocusRelinquish. + (keycode_to_xkeysym_table): Add entry for f16. + (XTread_socket) [USE_MAC_TSM]: Set/reset read_socket_inev + before/after passing keystroke event to toolbox dispatcher. + (init_tsm) [USE_MAC_TSM]: New function. + (mac_initialize) [USE_MAC_TSM]: Call it. + (Vmac_ts_active_input_overlay) [USE_MAC_TSM]: New defvar. + + * macterm.h (EVENT_PARAM_TEXT_INPUT_SEQUENCE_NUMBER): New enumerator. + +2006-06-02 John Paul Wallington <jpw@gnu.org> + + * xfns.c (x_set_name_internal): Set icon to `text', derived from + name, when frame's icon_name isn't a string rather than only when + it is nil. + +2006-06-03 Eli Zaretskii <eliz@gnu.org> + + * w32fns.c (x_set_icon_name): Don't use arg if it's not a string + and not nil. + +2006-06-02 Chong Yidong <cyd@stupidchicken.com> + + * xfns.c (x_set_icon_name): No-op if arg is non-nil and not a + string. + +2006-06-02 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * xdisp.c (next_element_from_composition): Set it->object to + it->string if composition is coming from string. + (set_cursor_from_row): Don't return 0 unless row displays a + continued line. + (dump_glyph): Dump composite glyph. + +2006-06-02 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (menu_nav_ended): Check that menubar_widget is not NULL. + +2006-06-01 Richard Stallman <rms@gnu.org> + + * window.c (Fsplit_window): Doc fix. + +2006-06-01 Micha,Ak(Bl Cadilhac <michael.cadilhac@lrde.org> + + * process.c (deleted_pid_list): New variable to store the pids + of deleted processes. Declare it only if SIGCHLD is defined. + (init_process): Initialize it. + (syms_of_process): Staticpro it. + (Fdelete_process): Add pid of the deleted process to it. Check after + the addition and before the kill if the process is already stopped, + in which case it is deleted from the list and not killed. + (sigchld_handler): Define it only if SIGCHLD is. Search the process + that signaled Emacs in `deleted_pid_list' before `Vprocess_alist'. + Original idea by Stefan Monnier. + +2006-06-01 Kim F. Storm <storm@cua.dk> + + * dispnew.c (sit_for): Perform redisplay even if input is pending + when redisplay-dont-pause is non-nil. + +2006-06-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c (mac_handle_visibility_change): Set buf.arg to Qnil. + (XTread_socket): Remove obsolete comment. + +2006-06-01 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xmenu.c (syms_of_xmenu): Make accelerate-menu an alias for + menu-bar-open. + +2006-06-01 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xmenu.c (Fmenu_bar_open, syms_of_xmenu): Change menu-bar-start to + menu-bar-open. + + * gtkutil.c (menu_nav_ended): Change x-menu-bar-start to menu-bar-open. + +2006-05-31 Juri Linkov <juri@jurta.org> + + * minibuf.c (Vhistory_add_new_input): New variable. + (read_minibuf): Use it. + (syms_of_minibuf) <history-add-new-input>: New Lisp variable. + (syms_of_minibuf) <history-delete-duplicates>: Doc fix. + +2006-05-31 Kim F. Storm <storm@cua.dk> + + * process.c (select_wrapper): Add wrapper around select to work around + "incomplete backtrace" bug in gdb 5.3, when emacs is stopped inside + select called from wait_reading_process_output. + +2006-05-30 Andreas Schwab <schwab@suse.de> + + * xmenu.c (Fmenu_bar_start): Return a value. + +2006-05-30 Richard Stallman <rms@gnu.org> + + * coding.c (Ffind_operation_coding_system): Doc fix. + +2006-05-30 Eli Zaretskii <eliz@gnu.org> + + * w32term.c (x_draw_hollow_cursor): Fix last change. + +2006-05-29 Kim F. Storm <storm@cua.dk> + + * w32term.c (x_draw_stretch_glyph_string): Fix last change. + +2006-05-29 Eli Zaretskii <eliz@gnu.org> + + * coding.c (Ffind_operation_coding_system): Doc fix. + +2006-05-29 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macfns.c [USE_MAC_FONT_PANEL] (Fmac_set_font_panel_visibility): + Call mac_set_font_info_for_selection if font panel is made visible. + + * macterm.c (font_panel_shown_p) [USE_MAC_FONT_PANEL]: New variable. + (mac_font_panel_visible_p, mac_show_hide_font_panel) + [USE_MAC_FONT_PANEL]: New functions. + [USE_MAC_FONT_PANEL] (mac_set_font_info_for_selection): + Return immediately if font panel is not visible. + + * macterm.h (mac_font_panel_visible_p, mac_show_hide_font_panel): + Add externs. + +2006-05-29 Dan Nicolaescu <dann@ics.uci.edu> + + * search.c (matcher_overflow): Mark as NO_RETURN. + + * xterm.c (x_connection_closed): Likewise. + + * sysdep.c (croak): Likewise. + + * sound.c (sound_perror, alsa_sound_perror): Likewise. + + * lisp.h (die, nsberror): Likewise. + +2006-05-29 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * sound.c (alsa_open, alsa_configure, alsa_write): + Move assignment to err out of if-statement. + + * gtkutil.c (menu_nav_ended): New function. + (create_menus): Connect menu_nav_ended to "selection-done" to fix + grabs. + + * xmenu.c (Fmenu_bar_start): New function for USE_GTK and USE_X_TOOLKIT. + +2006-05-28 Dan Nicolaescu <dann@ics.uci.edu> + + * charset.h (invalid_character): Mark as NO_RETURN. + +2006-05-29 Kenichi Handa <handa@m17n.org> + + * coding.c (Ffind_operation_coding_system): Call a function by + safe_call1 instead of call1. + +2006-05-28 Stefan Monnier <monnier@iro.umontreal.ca> + + * window.c (struct saved_window): Add `dedicated'. + (Fset_window_configuration, save_window_save): Save/restore the + `dedicated' flag. + +2006-05-28 Kim F. Storm <storm@cua.dk> + + * xdisp.c (set_cursor_from_row): If cursor cannot be set in row, + don't update w->cursor and return 0. Return 1 on success. + (try_cursor_movement): Repeat set_cursor_from_row on successive rows + until it succeeds. + + * dispextern.h (set_cursor_from_row): Update prototype. + +2006-05-28 Kim F. Storm <storm@cua.dk> + + * xdisp.c (get_phys_cursor_geometry): Return computed x and y through + parameters. Adjust x and width in case cursor in on a partially + visible stretch glyph on the left edge. + (erase_phys_cursor): Don't erase into left fringe/margin in case + previous cursor glyph is a partially visible stretch glyph on left. + + * dispextern.h (get_phys_cursor_geometry): Update prototype. + + * xterm.c (x_draw_stretch_glyph_string): Fix problems with invisible + cursor and erasing cursor on partially visible stretch glyph on left. + (x_draw_hollow_cursor): Compute x via get_phys_cursor_geometry. + + * macterm.c: Likewise. + + * w32term.c: Likewise. + +2006-05-27 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macselect.c (mac_handle_apple_event): + Return errAEEventNotHandled if key binding is not found. + +2006-05-26 Eli Zaretskii <eliz@gnu.org> + + * emacs.c (main) [PROFILING]: Enable also for __MINGW32__. + [__MINGW32__]: MinGW-specific declaration of `etext'. + + * w32heap.c (etext, edata): Remove unused definitions. + +2006-05-26 Chong Yidong <cyd@stupidchicken.com> + + * fileio.c (Fcopy_file): Delete argument MUSTBENEW. + Incorporate the exclusive file-opening functionality into the behavior + when OK-IF-ALREADY-EXISTS is nil. + (Frename_file): Call Fcopy_file without MUSTBENEW argument. + +2006-05-26 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * sound.c (alsa_configure): Move get period/buffer_size after + setting hwparams. + +2006-05-26 Kenichi Handa <handa@m17n.org> + + * coding.c (Ffind_operation_coding_system): Allow (FILENAME + . BUFFER) in TARGET. + +2006-05-25 Chong Yidong <cyd@stupidchicken.com> + + * image.c (png_load): Don't call fclose on NULL. + +2006-05-25 Luc Teirlinck <teirllm@auburn.edu> + + * fns.c (Fyes_or_no_p): + * callint.c (Fcall_interactively): Fread_from_minibuffer now takes + only seven args. + +2006-05-25 Juri Linkov <juri@jurta.org> + + * lisp.h (Fread_from_minibuffer): Decrement number of args. + + * minibuf.c (read_minibuf): Remove arg KEEP_ALL. Callers changed. + (Fread_from_minibuffer): Remove arg KEEP_ALL. Callers changed. + + * buffer.c (mode-line-format): Fix docstring. + +2006-05-25 Richard Stallman <rms@gnu.org> + + * emacs.c (main, Fdump_emacs): Don't test __linux or __linux__. + +2006-05-24 Luc Teirlinck <teirllm@auburn.edu> + + * puresize.h (BASE_PURESIZE): Increase to 1210000. + +2006-05-24 Alan Mackenzie <acm@muc.de> + + * lread.c (Vload_history): Enhance doc-string to say that the file + is the absolute truename of the loaded file. + + * lread.c (Vafter_load_alist): doc-string: state that an element + now has a regexp to match file names, not a file name as such. + + * lread.c (readevalloop): Call file-truename on the name for + load-history, except at preloading time. + + * lread.c (Fload): At preloading time, preserve the extension of + the filename which goes into load-history. New var hist_file_name. + + * lread.c (Fload): Do eval-after-load stuff by calling the lisp + function do-after-load-evaluation. + +2006-05-24 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * mac.c (ae_attr_table): New variable. + (syms_of_mac): Intern and staticpro its elements. + (mac_aelist_to_lisp): Also convert Apple event attributes. + (mac_ae_put_lisp): New function. + (create_apple_event_from_event_ref) [MAC_OSX]: Use typeUTF8Text. + + * macfns.c (Fx_server_version): Use gestaltSystemVersionMajor etc. + + * macselect.c (Qemacs_suspension_id): New variable. + (syms_of_macselect): Intern and staticpro it. + (struct suspended_ae_info): New struct. + (deferred_apple_events, defer_apple_events) + (Fmac_process_deferred_apple_events): Use it. + (suspended_apple_events): New variable. + (mac_handle_apple_event_1): New function. + (mac_handle_apple_event): Use it. Don't process previously + suspended events. + (cleanup_suspended_apple_events, get_suspension_id) + (cleanup_all_suspended_apple_events): New functions. + (init_apple_event_handler): Call cleanup_all_suspended_apple_events + at exit. + (Fmac_cleanup_expired_apple_events, Fmac_ae_set_reply_parameter) + (Fmac_resume_apple_event): New defuns. + (syms_of_macselect): Defsubr them. + + * macterm.c (fn_keycode_to_keycode_table, XTread_socket) [MAC_OSX]: + Fix last change. Don't map `fn' modifier if pressed with F1 ... F12. + + * macterm.h (TYPE_FILE_NAME): Change from macro to enumerator. + (KEY_EMACS_SUSPENSION_ID_ATTR): New enumerator. + (keyReplyRequestedAttr) [MAC_OS_X_VERSION_MAX_ALLOWED < 1030]: Likewise. + (gestaltSystemVersionMajor, gestaltSystemVersionMinor) + (gestaltSystemVersionBugFix) [MAC_OS_X_VERSION_MAX_ALLOWED < 1040]: + Likewise. + (typeUTF8Text, kEventParamWindowMouseLocation) + [MAC_OSX && MAC_OS_X_VERSION_MAX_ALLOWED < 1020]: Likewise. + (x_get_focus_frame, mac_ae_put_lisp): Add externs. + +2006-05-23 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c (fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove. + (fn_keycode_to_keycode_table) [MAC_OSX]: New variable. + (mac_set_unicode_keystroke_event) [TARGET_API_MAC_CARBON]: New function. + (XTread_socket) [TARGET_API_MAC_CARBON]: Use it. + (XTread_socket) [MAC_OSX]: Try 'uchr' Unicode keyboard-layout + resource to backtranslate key with modifiers. + (XTread_socket): Don't set read_socket_inev around AEProcessAppleEvent. + +2006-05-23 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.c: Remove declarations already in xterm.h. + + * xterm.h: Add extern declarations for x_clear_errors, + x_fully_uncatch_errors, x_catching_errors and + x_alloc_lighter_color_for_widget. Remove duplicated declarations. + +2006-05-21 Richard Stallman <rms@gnu.org> + + * xfaces.c (best_matching_font): Abort for best == NULL + before we start to use it. + + * buffer.c (syms_of_buffer, Fmake_overlay): Doc fixes. + +2006-05-20 Kim F. Storm <storm@cua.dk> + + * xfaces.c (best_matching_font): Fix crash in 2006-05-17 change. + +2006-05-20 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c (convert_fn_keycode): Fix last change. + +2006-05-19 Eli Zaretskii <eliz@gnu.org> + + * w32.c (init_environment): Perform the processing of environment + variables on a copy of default variables and their values, not on + the original. Simplify code that calls ExpandEnvironmentStrings + and make buf1[] and buf2[] more visible for easier debugging. + +2006-05-19 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * frame.c (x_set_border_width): Remove #ifndef MAC_OS. + + * image.c [MAC_OS] (gif_load): Allocate Lisp string first. + + * macfns.c (Fx_focus_frame): Don't check dpyinfo->x_focus_frame. + + * macterm.c (XTread_socket) [TARGET_API_MAC_CARBON && MAC_OSX]: + Forward keyUp events to toolbox_dispatcher. + + * window.c (foreach_window): Check WINDOWP (FRAME_ROOT_WINDOW (f)). + +2006-05-18 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * config.in: Regenerated (HAVE_ALSA). + + * sound.c (alsa_sound_perror, alsa_open, alsa_period_size) + (alsa_configure, alsa_close, alsa_choose_format, alsa_write) + (snd_error_quiet, alsa_init): New functions. + (vox_init): Return 0 if unable to open device. + (Fplay_sound_internal): Test for alsa first and use vox (oss) as + a fallback. + (struct sound_device): Add period_size. + (wav_play, au_play): Use period_size if set. + + * Makefile.in (CFLAGS_SOUND): New flags for ALSA. + (ALL_CFLAGS): Add CFLAGS_SOUND. + +2006-05-18 Kenichi Handa <handa@m17n.org> + + * callproc.c (Fcall_process): Reject encoding arguments by + ascii-incompatible coding systems (e.g. utf-16). + + * coding.c (Qascii_incompatible): New variable. + (syms_of_coding): Setup Qascii_incompatible. + (setup_coding_system): Be sure to initialize coding->common_flags. + Check `ascii-incompatible' property of the coding system. + + * coding.h (CODING_ASCII_INCOMPATIBLE_MASK): New macro. + +2006-05-18 Kim F. Storm <storm@cua.dk> + + * xdisp.c (display_tool_bar_line): Restore entire tool-bar + geometry when backtracking in case last image doesn't fit on line. + +2006-05-18 MIYOSHI Masanori <miyoshi@meadowy.org> (tiny change) + + * xdisp.c (display_tool_bar_line): Don't adjust tool-bar height by + more than height of one frame default line. + +2006-05-17 Richard Stallman <rms@gnu.org> + + * xfaces.c (better_font_p): Any font beats no font. + (best_matching_font): Simplify based on above change. + + * buffer.c (Fprevious_overlay_change, Fnext_overlay_change): Doc fixes. + +2006-05-16 Kim F. Storm <storm@cua.dk> + + * xterm.c (handle_one_xevent): Check that f is not NULL before + calling x_kill_gs_process. + +2006-05-14 Richard Stallman <rms@gnu.org> + + * textprop.c (Fnext_single_char_property_change) + (Fprevious_single_char_property_change): Don't allow returning + value beyond LIMIT in any cases. + (Fnext_char_property_change, Fprevious_char_property_change): Doc fix. + + * intervals.c (get_local_map): Abort if POSITION outside BEGV, ZV. + +2006-05-14 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.c (handle_one_xevent): Check that f is not NULL before + calling _XEditResCheckMessages. + +2006-05-14 Kim F. Storm <storm@cua.dk> + + * xterm.c (handle_one_xevent): Fix crash in 2006-03-24 change. + +2006-05-13 Eli Zaretskii <eliz@gnu.org> + + * frame.c (x_set_border_width): Fix error message to say "frame", + not "window". + + * Makefile.in (SOME_MACHINE_LISP): Add fringe.elc. + +2006-05-12 Chong Yidong <cyd@stupidchicken.com> + + * intervals.c (set_point_both): Fix mixup before before and after + in variable names. + + * editfns.c (Fline_beginning_position): Inhibit point-motion hooks + while setting point temporarily. + +2006-05-11 Richard Stallman <rms@gnu.org> + + * lread.c (readevalloop): Abort if START non-nil for non-buffer input. + +2006-05-11 Kim F. Storm <storm@cua.dk> + + * xdisp.c (redisplay_tool_bar): Handle large tool-bar-border values. + +2006-05-11 Kenichi Handa <handa@m17n.org> + + * fileio.c (Finsert_file_contents): Fix for the case of IO error + while handling replace operation. + +2006-05-10 Kenichi Handa <handa@m17n.org> + + * xfaces.c (realize_default_face) [HAVE_X_WINDOWS]: If the font + chosen for the default face was different from the frame font, + adjust the frame font. + +2006-05-10 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * image.c (Qduration) [MAC_OS]: Undo previous change. + (syms_of_image) [MAC_OS]: Likewise. + [MAC_OS] (gif_load): Emulate Graphic Control Extension block. + + * macfns.c (x_to_mac_color): Fix shift amount change. + (mac_set_font) [USE_MAC_FONT_PANEL]: Use x_get_focus_frame. + [USE_MAC_FONT_PANEL] (Fmac_set_font_panel_visibility): Doc fix. + + * macselect.c (Vmac_service_selection) [MAC_OSX]: Rename from + Vmac_services_selection. All uses changed. + (mac_store_service_event): Rename from mac_store_services_event in + extern and calls. + + * macterm.c (Qservice) [MAC_OSX]: Rename from Qservices. All uses + changed. + [MAC_OSX] (mac_store_service_event): Rename from + mac_store_services_event. All callers changed. + [USE_MAC_FONT_PANEL] (mac_set_font_info_for_selection): Add args + FACE_ID and C. All callers changed. + (x_free_frame_resources) [USE_MAC_FONT_PANEL]: Call + mac_set_font_info_for_selection when focus frame is destroyed. + (XTread_socket): Revert to FrontNonFloatingWindow/FrontWindow. + + * macterm.h (mac_set_font_info_for_selection): Add 2nd and 3rd + args in extern. + +2006-05-09 Chong Yidong <cyd@stupidchicken.com> + + * keymap.c (describe_map): Avoid generating duplicate entries if + the shadowed binding has the same definition. + +2006-05-09 Kenichi Handa <handa@m17n.org> + + * keymap.c (push_key_description): Handle invalid character key. + +2006-05-08 Kenichi Handa <handa@m17n.org> + + * callproc.c (Fcall_process): Use system_eol_type for encoding + arguments if eol_type is not yet decided. + + * coding.h (system_eol_type): Extern it. + + * coding.c (setup_coding_system): For invalid coding-system, set + coding->eol_type to CODING_EOL_UNDECIDED. + (encode_coding): Cancel previous change. + (shrink_encoding_region): Likewise. + (code_convert_region1): Likewise. + (code_convert_string1): Likewise. + (code_convert_string_norecord): Likewise. + + * fileio.c (choose_write_coding_system): Use system_eol_type for + encoding if eol_type is not yet decided. + + * process.c (setup_process_coding_systems): Use system_eol_type + for encoding if eol_type is not yet decided. + (read_process_output): Likewise. + (send_process): Likewise. + +2006-05-07 Juanma Barranquero <lekktu@gmail.com> + + * minibuf.c (syms_of_minibuf) <history-length>: Fix typo in doc. + +2006-05-07 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * mac.c (Fmac_clear_font_name_table): Move defun to macfns.c. + (syms_of_mac): Likewise for defsubr. + + * macfns.c (mac_set_font): New function. + (mac_frame_parm_handlers, syms_of_macfns): Replace x_set_font with it. + (mac_window) [TARGET_API_MAC_CARBON && MAC_OSX]: Specify + kWindowToolbarButtonAttribute when creating window. + (Fmac_clear_font_name_table): Move from macfns.c. + (syms_of_macfns): Likewise for defsubr. + [USE_MAC_FONT_PANEL] (Fmac_set_font_panel_visibility): New defun. + (syms_of_macfns) [USE_MAC_FONT_PANEL]: Defsubr it. + + * macgui.h (USE_MAC_FONT_PANEL): Define to 1 if USE_ATSUI is set + and build is done on Mac OS X 10.2 and later. + + * macselect.c (mac_do_receive_drag): Remove unused variable `index'. + (mac_store_services_event): Change return type in extern. + + * macterm.c (XLoadQueryFont) [USE_ATSUI]: Set font->mac_fontnum to + FMFontFamily value. + [USE_MAC_FONT_PANEL] (mac_set_font_info_for_selection): New function. + (x_new_focus_frame) [USE_MAC_FONT_PANEL]: Use it. + (QCfamily, QCweight, QCslant, Qnormal, Qbold, Qitalic): Add extern. + (QWindow) [MAC_OSX]: Likewise. + (Qfont) [USE_MAC_FONT_PANEL]: Likewise. + (Vmac_atsu_font_table) [USE_ATSUI]: New variable. + (syms_of_macterm) [USE_ATSUI]: Defvar it. + (Qtoolbar_switch_mode) [MAC_OSX]: New variable. + (Qpanel_closed, Qselection) [USE_MAC_FONT_PANEL]: Likewise. + (syms_of_macterm): Intern and staticpro them. + (init_font_name_table) [USE_ATSUI]: Add data to Vmac_atsu_font_table. + [TARGET_API_MAC_CARBON] (mac_store_event_ref_as_apple_event): + New function. + [USE_CARBON_EVENTS] (mac_handle_command_event): Use it. + [MAC_OSX] (mac_store_services_event): Likewise. + [USE_CARBON_EVENTS] (mac_handle_window_event) [MAC_OSX]: Handle + kEventWindowToolbarSwitchMode event. + (install_window_handler) [USE_CARBON_EVENTS && MAC_OSX]: Register it. + [MAC_OSX] (mac_store_services_event): Change return type to OSStatus. + [USE_MAC_FONT_PANEL] (mac_handle_font_event): New function. + (install_window_handler) [USE_MAC_FONT_PANEL]: Install it. + (XTread_socket): Select window on mouse click if x_focus_frame is NULL. + + * macterm.h (mac_set_font_info_for_selection): Add extern. + +2006-05-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * image.c (Qduration) [MAC_OS]: New variable. + (syms_of_image) [MAC_OS]: Intern and staticpro it. + [MAC_OS] (gif_load): Save image extension data in img->data.lisp_val. + [MAC_OSX] (image_load_quartz2d): Use cfstring_create_with_utf8_cstring + instead of cfstring_create_with_string. + +2006-05-06 Kim F. Storm <storm@cua.dk> + + * .gdbinit (xframe): Print frame name. + (xlist): New command to print a list (max 10 elements). + (xpr): Print lisp object of any type. + (pitx): Print it->pixel_width. + +2006-05-05 Kenichi Handa <handa@m17n.org> + + * xdisp.c (handle_composition_prop): Fix for the case of empty + composition component. + +2006-05-05 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * keyboard.c (make_lispy_event) [MAC_OS]: Get Apple event info + from event->arg. + + * termhooks.h (enum event_kind) [MAC_OS]: Update comment for + MAC_APPLE_EVENT. + + * macterm.h (mac_make_lispy_event_code): Remove extern. + (mac_post_mouse_moved_event): Add extern. + (mac_aelist_to_lisp, mac_aedesc_to_lisp): Change arg 1 to + `const AEDesc *' in externs. + (create_apple_event_from_drag_ref) [TARGET_API_MAC_CARBON]: New extern. + + * mac.c (mac_aelist_to_lisp, mac_aedesc_to_lisp): Change arg 1 to + `const AEDesc *'. + [TARGET_API_MAC_CARBON] (create_apple_event): New function. + [TARGET_API_MAC_CARBON] (create_apple_event_from_event_ref): Use it. + Use xrealloc instead of repeated xmalloc/xfree. + [TARGET_API_MAC_CARBON] (create_apple_event_from_drag_ref): + New function. + + * macmenu.c (restore_menu_items, cleanup_popup_menu): Return a value. + + * macselect.c: Update copyright year. + (mac_store_apple_event): Change return type to void in extern. + (mac_handle_apple_event): Don't get return value from + mac_store_apple_event. + [TARGET_API_MAC_CARBON] (Vmac_dnd_known_types): New variable. + (syms_of_macselect) [TARGET_API_MAC_CARBON]: Defvar it. + [TARGET_API_MAC_CARBON] (mac_do_track_drag): Move function from + macterm.c. Use Vmac_dnd_known_types as acceptable flavors. + [TARGET_API_MAC_CARBON] (mac_do_receive_drag): Likewise. New + implementation using create_apple_event_from_drag_ref. + [TARGET_API_MAC_CARBON] (mac_do_track_dragUPP) + (mac_do_receive_dragUPP): Move variables from macterm.c. + (install_drag_handler, remove_drag_handler): New functions. + + * macterm.c (XTread_socket) [TARGET_API_MAC_CARBON]: Try window + path select also for proxy icon click. + [TARGET_API_MAC_CARBON] (mac_post_mouse_moved_event): New function. + [USE_TOOLKIT_SCROLL_BARS] (scroll_bar_timer_callback): Use it. + (xlfdpat_create): Remove unused label `error' and trailing sentences. + (mac_do_track_drag, mac_do_receive_drag): Move functions to macselect.c. + (mac_do_track_dragUPP, mac_do_receive_dragUPP): Move variables to + macselect.c. + (install_drag_handler, remove_drag_handler): Add extern. + (mac_store_apple_event): Change return type to void. All uses changed. + Create Lisp object from Apple event and store it into input event. + (mac_make_lispy_event_code): Remove function. + [TARGET_API_MAC_CARBON] (mac_store_drag_event): New function. + (install_window_handler): Call install_drag_handler. + (remove_window_handler): Call remove_drag_handler. + +2006-05-03 Richard Stallman <rms@gnu.org> + + * sound.c (Fplay_sound_internal): Dynamically allocate + current_sound_device and current_sound. + (sound_cleanup): Free them. + + * minibuf.c (read_minibuf): Don't use read_minibuf_noninteractive + when inside a keyboard macro. + +2006-05-02 Andreas Schwab <schwab@suse.de> + + * xmenu.c (restore_menu_items): Return a value. + +2006-05-01 Martin Rudalics <rudalics@gmx.at> + + * syntax.c (Fforward_comment): Detect generic comment at beginning of + buffer when moving backwards. + +2006-05-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * dispnew.c (update_window): Don't set changed_p when mode/header + line is updated. + + * xdisp.c (prepare_menu_bars) [MAC_OS]: Call mac_update_title_bar. + (get_glyph_face_and_encoding, get_char_face_and_encoding): + Don't distinguish known faces from others. + + * mac.c (mac_coerce_file_name_ptr): Try typeFSRef if coercion + through typeFileURL failed. + + * macfns.c (mac_update_title_bar): New function. + [TARGET_API_MAC_CARBON] (mac_update_proxy_icon): New function. + (show_hourglass, hide_hourglass) [USE_CG_DRAWING]: + Call mac_prepare_for_quickdraw. + + * macgui.h (USE_ATSUI): Set default to 1 if MAC_OSX is defined. + (USE_CG_DRAWING): Don't define if compiled on Mac OS X 10.1. + (enum pcm_status): New enum. + (XCHARSTRUCTROW_CHAR_VALID_P, XCHARSTRUCTROW_SET_CHAR_VALID) + (XCharStructRow): Remove. Now validity is represented by + non-negativeness of sum of ascent and descent. + (struct MacFontStruct): Change type of member `rows'. + (struct _XGC) [USE_CG_DRAWING]: Add member `clip_rects'. + + * macterm.c (mac_draw_line, mac_draw_line_to_pixmap): + Adjust endpoints of strictly horizontal/vertical lines. + (mac_set_clip_rectangles) [USE_CG_DRAWING]: Set clip_rects. + (pcm_init, pcm_get_status): New functions. + (x_per_char_metric, XLoadQueryFont): Use them instead of + XCharStructRow and related macros. + (x_draw_relief_rect): Don't adjust arguments of mac_draw_line. + (x_free_frame_resources) [TARGET_API_MAC_CARBON]: Free FRAME_FILE_NAME. + (XTread_socket) [TARGET_API_MAC_CARBON]: Handle proxy icon drag + and window path pop-up menu on title bar. + (mac_use_core_graphics) [USE_CG_DRAWING]: Set default to 1. + + * macterm.h (mac_update_title_bar): Add extern. + (struct mac_output) [TARGET_API_MAC_CARBON]: New member `file_name'. + (FRAME_FILE_NAME): New macro. + + * unexmacosx.c (unexec): Error if trying unexec from dumped executable. + +2006-04-30 Richard Stallman <rms@gnu.org> + + * keymap.c (Fdefine_key): Improve error message + when KEY begins with a non-prefix key. + +2006-04-30 Martin Rudalics <rudalics@gmx.at> + + * syntax.c (Fforward_comment): Don't forget to break out of the loop + when we skipped backward over a generic comment. + +2006-04-27 Nick Roberts <nickrob@snap.net.nz> + + * .gdbinit (pp1, pv1): Only print value as expression is now + printed out by gud-print. + (pv1): Correct doc string. + +2006-04-26 Stefan Monnier <monnier@iro.umontreal.ca> + + * keymap.c (store_in_keymap): Change `def' arg to not be `register'. + Seems to trigger a bug in gcc-amd64 4.0.2 20051125 (Red Hat 4.0.2-8): + keymap.c:895: error: address of register variable `def' requested. + +2006-04-26 Jason Rumney <jasonr@gnu.org> + + * w32term.c (construct_mouse_wheel): Handle negative coordinates. + + * w32fns.c (w32_wnd_proc) <WM_LBUTTONDOWN, WM_RBUTTONDOWN>: + <WM_LBUTTONUP, WM_RBUTTONUP>: Call signal_user_input in the cases + where we preempt mouse_button_timer. + +2006-04-25 Miles Bader <miles@gnu.org> + + * editfns.c (Ffield_beginning, find_field): Undo change of 2006-04-23. + +2006-04-24 Stefan Monnier <monnier@iro.umontreal.ca> + + * process.h: Include headers for pid_t. + +2006-04-24 Kim F. Storm <storm@cua.dk> + + * xdisp.c (fill_stretch_glyph_string): Set s->nchars = 1 for code which + does last_glyph=s->first_glyph+s->nchars-1, e.g. if stretch has relief. + (produce_stretch_glyph): Assume that face box height and width is + already included in stretch glyph size so caller doesn't have to + consider the extra space otherwise added (fixes problem in ses.el). + + * frame.c (x_set_font): Clear f->n_tool_bar_rows and current frame + matrices to force recalculation of tool-bar height after font change. + + * xdisp.c (tool_bar_lines_needed): New local `temp_row' for clarity. + Clear it when done, so we don't accidentally draw a second copy of + the tool-bar after resetting f->n_tool_bar_rows. + (redisplay_tool_bar): Update tool-bar-lines frame parameter whenever + we recalculate f->n_tool_bar_rows. + +2006-04-23 Lars Hansen <larsh@soem.dk> + + * editfns.c (find_field): Fix comment. + (Ffield_beginning): Fix bug when POS is at field beginning. + +2006-04-22 Eli Zaretskii <eliz@gnu.org> + + * puresize.h (BASE_PURESIZE): Increase to 1205000. + +2006-04-21 Kim F. Storm <storm@cua.dk> + + * xdisp.c (redisplay_window): Fix last change. Don't recenter if + window start is at BEGV. + + * dispextern.h (struct image): New member `corners'. + (TOP_CORNER, LEFT_CORNER, BOT_CORNER, RIGHT_CORNER): New macros. + + * image.c (four_corners_best): New arg CORNERS specifies what pixels + to look at in case image has margin. + (x_create_bitmap_mask): Pass NULL for CORNERS to four_corners_best. + (image_background, image_background_transparent) + (x_build_heuristic_mask): Pass img->corners to four_corners_best. + (gif_load): Set img->corners according to image's margin spec. + Use img->corners values directly where applicable. + Save image extension data in img->data.lisp_val. + (gif_clear_image): New function to free img->data.lisp_val. + (gif_type): Use it instead of generic x_clear_image. + (Fimage_extension_data): New defun. + (syms_of_image): Defsubr it. + +2006-04-21 John Sullivan <john@wjsullivan.net> (tiny change) + + * window.c (Fdisplay_buffer): Doc fix. + +2006-04-21 Eli Zaretskii <eliz@gnu.org> + + * s/ms-w32.h (SYSTEM_PURESIZE_EXTRA): Increase to 25000. + +2006-04-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * image.c [MAC_OS] (xpm_load_image): Fill in background field + while we have ximg handy. + + * macmenu.c (restore_menu_items, save_menu_items): New functions + from xmenu.c. + (set_frame_menubar, digest_single_submenu): Apply 2006-04-18 + changes for xmenu.c. + + * macterm.c (x_per_char_metric): Return NULL if glyph width is 0. + (add_mac_font_name): New function. + (init_font_name_table): Use it. Adopt the first found font from + those having the same family name. + +2006-04-21 Nick Roberts <nickrob@snap.net.nz> + + * xdisp.c (note_mouse_highlight): Use build_string. + +2006-04-20 Lars Hansen <larsh@soem.dk> + + * textprop.c (Fremove_list_of_text_properties): + Ensure modify_region is called only when buffer is modified and that + signal_after_change is allways called in that case. + + * print.c (PRINTFINISH): Call signal_after_change. + +2006-04-20 Kim F. Storm <storm@cua.dk> + + * xdisp.c (redisplay_window): Fix last change. + + * xdisp.c (redisplay_window): If current window start is not at the + beginning of a line, select a new window start if buffer is modified + and window start is in the modified region, but the first change is + before window start. + +2006-04-18 Richard Stallman <rms@gnu.org> + + * xmenu.c (restore_menu_items, save_menu_items): New fns. + (set_frame_menubar): Use save_menu_items. Save updated vector in + the frame before unwinding it. Don't use unuse_menu_items. + Don't use discard_menu_items. + (digest_single_submenu): Abort if an item is not in a pane. + (init_menu_items): Put the error check at the top. + + * keymap.c (describe_map): Make "shadowed" warning more verbose. + + * window.c (adjust_window_trailing_edge): Correctly distinguish + series vs parallel cases, even when window has no parent. + + * abbrev.c (record_symbol): New function. + (Finsert_abbrev_table_description): Sort the abbrevs alphabetically. + +2006-04-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * image.c (x_create_bitmap_from_data) [MAC_OS]: Don't check return + value of xmalloc. + + * mac.c (mac_coerce_file_name_ptr, mac_coerce_file_name_desc) + (create_apple_event_from_event_ref, xrm_get_preference_database) + (cfstring_create_normalized): Don't check return value of xmalloc. + + * macselect.c (get_scrap_target_type_list, defer_apple_events) + (copy_scrap_flavor_data, mac_handle_service_event): Don't check + return value of xmalloc/xrealloc. + + * macterm.c (XCreateGC, x_per_char_metric, xlfdpat_create) + (init_font_name_table, init_font_name_table, mac_do_list_fonts) + (XLoadQueryFont, mac_store_apple_event): Don't check return value + of xmalloc. + +2006-04-17 Kim F. Storm <storm@cua.dk> + + * window.c (coordinates_in_window): On the vertical border, + calculate the row number measured from the top of the window, not + the top of the frame. + (window_loop): Test w->dedicated with !NILP instead of EQ Qt. + (window_scroll_pixel_based): Fix off-by-one bug in 2002-12-23 change. + +2006-04-16 Eli Zaretskii <eliz@gnu.org> + + * s/ms-w32.h (SYSTEM_PURESIZE_EXTRA): Reduce to 24000. + +2006-04-16 Romain Francoise <romain@orebokech.com> + + * puresize.h (BASE_PURESIZE): Decrement back to 1200000. + +2006-04-16 Andreas Schwab <schwab@suse.de> + + * puresize.h (PURESIZE_RATIO): Reduce to 10/6. + +2006-04-15 Romain Francoise <romain@orebokech.com> + + * puresize.h (BASE_PURESIZE): Increment to 1210000. + +2006-04-13 Micha,Ak(Bl Cadilhac <michael.cadilhac@lrde.org> + + * print.c (Fprin1_to_string): Mention in the `doc' that the + behavior is modified by `print-level' and `print-length'. + +2006-04-13 Kenichi Handa <handa@m17n.org> + + * coding.c (setup_coding_system): If eol-type is not yet decided + and system_eol_type is not LF, set CODING_REQUIRE_ENCODING_MASK. + If coding_system is nil, return 0. + (code_convert_region1): Even if coding_system is nil, don't skip + conversion if system_eol_type is not LF. + (code_convert_string1): Likewise. + (code_convert_string_norecord): Likewise. + +2006-04-13 Kenichi Handa <handa@m17n.org> + + * coding.c (setup_coding_system): Fix previous change. + (encode_coding): If eol_type is not yet decided, use system_eol_type. + (shrink_encoding_region): If eol_type is not yet decided and + system_eol_type is not LF, don't shrink. + +2006-04-13 Nick Roberts <nickrob@snap.net.nz> + + * xdisp.c (note_mouse_highlight): Add help echo for dragging vertical + line. + +2006-04-12 Richard Stallman <rms@gnu.org> + + * keyboard.c (read_key_sequence): Explicitly avoid keybuf[-1]. + + * process.c (conv_lisp_to_sockaddr): If FAMILY unknown, just return. + (Fprocess_send_eof): Abort if fail to open null device. + +2006-04-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * fns.c [HAVE_MENUS && MAC_OS]: Include macterm.h. + + * image.c [MAC_OS] (xpm_load_image): Add parentheses around + assignment used as truth value. Add explicit braces to avoid + ambiguous `else'. + [MAC_OS] (gif_load): Remove unused variable `gcpro1'. + + * lisp.h (syms_of_fontset, Fset_fontset_font): Put extern and + EXFUN in #ifdef HAVE_WINDOW_SYSTEM. + (syms_of_xfns, syms_of_xsmfns, syms_of_xselect, syms_of_xterm): + Put externs in #ifdef HAVE_X_WINDOWS. + (syms_of_macfns, syms_of_macselect, syms_of_macterm) + (syms_of_macmenu, syms_of_mac) [MAC_OS]: Add externs. + (init_mac_osx_environment) [MAC_OSX]: Add extern. + + * mac.c (init_process): Remove undef. + (select) [MAC_OSX]: Undefine before including sysselect.h. + (posix_pathname_to_fsspec, fsspec_to_posix_pathname) [MAC_OSX]: + Remove functions and prototypes. + (parse_value): Add parentheses around + inside shift. + (path_from_vol_dir_name): Make static. + (get_temp_dir_name): Remove unused variables `cpb' and `dir_name'. + [!MAC_OSX] (get_path_to_system_folder): Likewise. + (Fmac_get_file_creator, Fmac_get_file_type): Remove unused + variable `cCode'. + (Fmac_coerce_ae_data): Remove unused variables `fref' and `fs'. + (Fmac_get_preference): Add explicit braces to avoid ambiguous `else'. + + * macfns.c (x_to_mac_color): Remove unused variable `tail'. + (x_set_mouse_color): Remove unused variable `dpy'. + (Fx_create_frame): Remove unused variable `x_frame_count'. + (Fx_server_version): Add explicit braces to avoid ambiguous `else'. + (x_sync): Move from macterm.c. + (Fx_file_dialog): Remove unused variable `default_filter_index'. + + * macmenu.c (min_menu_id): Make element type explicit. + + * macselect.c (get_flavor_type_from_symbol): Remove unused + variable `val'. + (get_scrap_private_timestamp, x_get_foreign_selection) + (copy_scrap_flavor_data): Add explicit braces to avoid ambiguous `else'. + (Fmac_process_deferred_apple_events): Remove unused variables + `keyword', `reply', `apple_event', `count', and `err'. + + * macterm.c: Don't include gnu.h. + (x_io_error_quitter, x_draw_image_foreground_1): Remove prototypes. + (x_sync): Move to macfns.c. + [USE_CG_DRAWING] (mac_define_fringe_bitmap): Remove unused + variable `mask_bits'. + (mac_compute_glyph_string_overhangs): Avoid ambiguous `else'. + (x_draw_image_glyph_string): Remove unused variable `pixmap'. + (x_mac_to_emacs_modifiers): Remove function. + (XTset_vertical_scroll_bar, mac_handle_visibility_change) + (x_make_frame_visible, xlfdpat_create, mac_handle_command_event): + Add explicit braces to avoid ambiguous `else'. + (x_make_frame_visible): Remove unused variables `type', + `original_top', and `original_left'. + (mac_do_list_fonts, XTread_socket): Add parentheses around && within ||. + (x_load_font): Remove unused variables `full_name', and `value'. + (do_get_menus, do_init_managers, do_check_ram_size) [!MAC_OS8]: + Remove functions. + (do_zoom_window): Reorganize variables with respect to conditionals. + (init_command_handler): Remove unused variable `err'. + [MAC_OSX] (mac_check_bundle): Remove unused variable `child'. + + * macterm.h (x_set_mouse_position, x_set_mouse_pixel_position) + (x_make_frame_invisible, x_iconify_frame, x_free_frame_resources) + (x_destroy_window, x_wm_set_size_hint, x_delete_display, XFreeGC) + (do_menu_choice, have_menus_p, x_real_positions) + (x_set_menu_bar_lines, x_pixel_width, x_pixel_height, x_char_width) + (x_char_height, x_sync, x_set_tool_bar_lines, x_activate_menubar) + (free_frame_menubar): Add externs. + + * unexmacosx.c: Include config.h before using HAVE_MALLOC_MALLOC_H. + (malloc, realloc, free): Add undefs. + (read_load_commands): Remove unused variable `n' and `j'. + (copy_data_segment): Remove unused variable `r'. + + * xdisp.c (get_glyph_string_clip_rects): Add parentheses around && + within ||. Add explicit braces to avoid ambiguous `else'. + (dump_glyph_row): Remove label for `inverse_p' from legend. + + * xfaces.c (Finternal_merge_in_global_face, try_font_list): + Add explicit braces to avoid ambiguous `else'. + +2006-04-11 Micha,Ak(Bl Cadilhac <michael.cadilhac@lrde.org> + + * dispnew.c (init_display): Don't init X display if the user asked + for a non-X display. + +2006-04-12 Kenichi Handa <handa@m17n.org> + + * coding.c (setup_coding_system): Use system_eol_type for default + coding->eol_type. + +2006-04-11 Dan Nicolaescu <dann@ics.uci.edu> + + * lisp.h (wrong_type_argument): Mark as NO_RETURN. + + * data.c (wrong_type_argument): Try to avoid compiler warnings due + to the fact the function is now marked as NO_RETURN. + +2006-04-10 Eli Zaretskii <eliz@gnu.org> + + * s/ms-w32.h (pid_t) [_MSC_VER]: New typedef. + +2006-04-10 Romain Francoise <romain@orebokech.com> + + * xrdb.c (gethomedir): Use xstrdup. + +2006-04-10 Andreas Schwab <schwab@suse.de> + + * xrdb.c (gethomedir): Make sure to always return a pointer that + can be passed to free. + +2006-04-09 Richard Stallman <rms@gnu.org> + + * lisp.h (Fkill_emacs): Undo previous change. + +2006-04-08 Richard Stallman <rms@gnu.org> + + * search.c (boyer_moore): Test ch >= 0400, not >. + +2006-04-09 Dan Nicolaescu <dann@ics.uci.edu> + + * puresize.h (pure_write_error): Mark as NO_RETURN. + + * lisp.h (args_out_of_range, args_out_of_range_3, Fkill_emacs): + Likewise. + +2006-04-08 Eli Zaretskii <eliz@gnu.org> + + * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Ignore mouse movements + if a menu is active on this frame. + +2006-04-08 Dan Nicolaescu <dann@ics.uci.edu> + + * lisp.h (report_file_error): Mark as NO_RETURN. + +2006-04-08 Eli Zaretskii <eliz@gnu.org> + + * alloc.c [STDC_HEADERS]: Include stddef.h. + + * lisp.h (PSEUDOVECSIZE): Fix last change. + +2006-04-08 Stefan Monnier <monnier@iro.umontreal.ca> + + * process.h (struct Lisp_Process): Replace Lisp_Objects `pid', + `raw_status_high', and `raw_status_low' with plain integers, and move + them to the end of the structure. + + * alloc.c (allocate_process): Use PSEUDOVECSIZE to initialize the + pseudovector's size field so only the Lisp_Object fields get GC'd. + + * process.c (update_status, make_process, Fdelete_process) + (Fprocess_status, list_processes_1, start_process_unwind) + (create_process, Fmake_network_process, server_accept_connection) + (wait_reading_process_output, send_process, Fprocess_running_child_p) + (process_send_signal, proc_encode_coding_system, Fprocess_send_eof) + (sigchld_handler, status_notify): Adjust to new non-Lisp fields for + `pid' and `raw_status'. + (Fprocess_id, Fsignal_process): Same, and additionally use floats when + representing PIDs that are larger than most-positive-fixnum. + + * keymap.c (describe_map): Only use XINT if we checked INTEGERP. + + * lisp.h (OFFSETOF, PSEUDOVECSIZE): New macros. + +2006-04-08 Eli Zaretskii <eliz@gnu.org> + + * w32fns.c (Fx_show_tip): Add 3 to the 5th arg of SetWindowPos. + +2006-04-03 Paul Eggert <eggert@cs.ucla.edu> + + * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): New macro, identical to + ../lib-src/b2m.c and ../lib-src/editfns.c. + (Fcurrent_time_string): Use it. + Document that the year might not consume 4 columns if it's outside + the range 1000-9999. + Check for asctime failure. + Don't assume that the output string length is always exactly 24. + +2006-04-03 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c (XTread_socket): Initialize variable `f' before its use. + +2006-04-03 Kenichi Handa <handa@m17n.org> + + * image.c: Include "charset.h" and "coding.h". + (x_find_image_file): Return an encoded file name. + +2006-04-01 Eli Zaretskii <eliz@gnu.org> + + * configure: Regenerated. + +2006-03-31 Kenichi Handa <handa@m17n.org> + + * xfns.c (xg_set_icon): Delete superfluous UNGCPRO. + +2006-03-30 Dan Nicolaescu <dann@ics.uci.edu> + + * xdisp.c (syms_of_xdisp): Fix variable name. + +2006-03-30 Kenichi Handa <handa@m17n.org> + + * xterm.c (x_term_init): Delete superfluous UNGCPRO. + +2006-03-29 Juanma Barranquero <lekktu@gmail.com> + + * keyboard.c (process_tool_bar_item): Reorder dummy args. + +2006-03-29 Stefan Monnier <monnier@iro.umontreal.ca> + + * keyboard.c (tool_bar_items): Use map_keymap. + (process_tool_bar_item): Add dummy args to fit the required interface. + +2006-03-25 Eli Zaretskii <eliz@gnu.org> + + * .gdbinit (pr, pp, pp1, pv, pv1): Force print_output_debug_flag + to zero before calling debug_print or safe_debug_print. + + * print.c (print_output_debug_flag): New global variable. + (Fexternal_debugging_output) [WINDOWSNT]: Don't call + OutputDebugString if print_output_debug_flag is zero. + +2006-03-24 Paul Eggert <eggert@cs.ucla.edu> + + * editfns.c (TM_YEAR_BASE): Move up, so the changes below can use it. + (Fdecode_time, Fencode_time): Use TM_YEAR_BASE instead of 1900. + (Fdecode_time): Cast tm_year to EMACS_INT. + (Fcurrent_time_string): Report an invalid time specification if + the argument is invalid. Also, check for out-of-range time stamps. + +2006-03-24 Kim F. Storm <storm@cua.dk> + + * xterm.c (handle_one_xevent): + * w32term.c (w32_read_socket): + * macterm.c (XTread_socket): Don't let key-press clear mouse face + on in toolbar window if mouse-highlight is an integer. + + * fns.c (sxhash_list): Include last non-nil CDR in hash. + +2006-03-24 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macmenu.c (enum mac_menu_kind): New enum. + (min_menu_id): New variable. + (POPUP_SUBMENU_ID, MIN_POPUP_SUBMENU_ID, MIN_MENU_ID) + (MIN_SUBMENU_ID): Remove defines. All uses are replaced with + min_menu_id and enumerators in enum mac_menu_kind. + (fill_menu, dispose_menus, install_menu_quit_handler): New arg KIND. + All uses changed. Add range check for menu ID. + (fill_menubar): Add range check for menu ID. + [HAVE_CANCELMENUTRACKING] (menu_quit_handler): Check error code of + GetEventParameter. + (set_frame_menubar, mac_menu_show): Call install_menu_quit_handler + for each menu kind. + +2006-03-22 Kim F. Storm <storm@cua.dk> + + * xdisp.c: Undo 2006-03-21 change. + + * term.c: Define aliases for append_glyph and produce_stretch_glyph + when `static' is defined to avoid name clash with those in xdisp.c. + + * process.c (Faccept_process_output): Fix to comply with lisp + reference. Change arg "timeout" to "seconds" and allow both + integer and float value. Change arg "timeout-msec" to "millisec" + and interpret" as milliseconds rather than microseconds. Fix doc + string accordingly. + +2006-03-21 Ken Raeburn <raeburn@raeburn.org> + + * xdisp.c (store_next_glyph): Rename from append_glyph. + (generate_stretch_glyph): Rename from produce_stretch_glyph. + All callers changed accordingly. + +2006-03-21 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.c: x_session_initialized new variable. + (x_term_init): Use x_session_initialized to check if + x_session_initialize should be called. + (x_initialize): Initialize x_session_initialized. + +2006-03-21 Kim F. Storm <storm@cua.dk> + + * fringe.c (draw_fringe_bitmap): Don't calculate default overlay arrow + bitmap here, but ... + (update_window_fringes): ... here, so we can test if it has changed. + +2006-03-20 Andreas Schwab <schwab@suse.de> + + * dispnew.c (init_display): Check DISPLAY here. + + * emacs.c (main): Don't check here. + + * xterm.c (x_display_ok): Don't use DISPLAY env var. + +2006-03-20 Stefan Monnier <monnier@iro.umontreal.ca> + + * window.c (window_scroll_pixel_based): Yet another int/Lisp_Object + mixup (YAILOM). + +2006-03-20 Eli Zaretskii <eliz@gnu.org> + + * emacs.c (main): Fix last change. + +2006-03-20 Kenichi Handa <handa@m17n.org> + + * fileio.c (Fwrite_region): Set visit_file to Qnil before GCPRO it. + + * keymap.c (map_keymap): Set tail to Qnil before GCPRO it. + + * xfns.c (xg_set_icon): Remove unnecessary GCPRO. + + * xterm.c (x_term_init): Remove unnecessary GCPRO. + +2006-03-19 Kim F. Storm <storm@cua.dk> + + * xdisp.c (set_cursor_from_row): Fix cursor property on overlay string, + so it doesn't associate overlay string with following glyph by default. + Allow integer property value to specify explicit number of buffer + positions associate with overlay string. + +2006-03-18 Chong Yidong <cyd@stupidchicken.com> + + * xterm.c (x_display_ok): Fix minor bug and compilation warnings. + +2006-03-18 Nozomu Ando <nand@mac.com> + + * m/pmax.h (BROKEN_NOCOMBRELOC) [__NetBSD__]: Define. + (LIB_STANDARD, START_FILES) [__NetBSD__]: Don't define. + (START_FILES, RUN_TIME_REMAP, UNEXEC) [__NetBSD__, __OpenBSD__]: + Don't redefine. + + * m/mips.h: Don't use unexmips on NetBSD. + (LIBS_MACHINE): Move definition lower, so it doesn't use + LD_SWITCH_MACHINE, START_FILES, LIB_STANDARD, LIBS_TERMCAP, + C_SWITCH_MACHINE, and C_DEBUG_SWITCH. + + * unexelf.c [BROKEN_NOCOMBRELOC]: Include assert.h. + (unexec) [BROKEN_NOCOMBRELOC]: Handle platforms whose nocombreloc + option is broken (e.g., MIPS/NetBSD). + +2006-03-18 Craig McDaniel <craigmcd@gmail.com> (tiny change) + + * sheap.c (STATIC_HEAP_SIZE): Enlarge STATIC_HEAP_SIZE to 12MB. + Remove the HAVE_X_WINDOWS conditional. + +2006-03-18 Vivek Dasmohapatra <vivek@etla.org> (tiny change) + + * emacs.c (main): If user asks for a display that is unavailable, + simulate -nw. + + * xterm.c (x_display_ok): New function. + + * xterm.h: Add prototype for x_display_ok. + +2006-03-18 Eli Zaretskii <eliz@gnu.org> + + * w32fns.c (Fw32_select_font): Doc fix. + +2006-03-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * image.c [MAC_OS] (XPutPixel, XGetPixel) + [!WORDS_BIG_ENDIAN && USE_CG_DRAWING]: Don't use specialized + version when depth is 32. + (mac_create_cg_image_from_image) [MAC_OS && USE_CG_DRAWING]: + New function. + (prepare_image_for_display) [MAC_OS && USE_CG_DRAWING]: Use it. + (x_clear_image_1) [MAC_OS && USE_CG_DRAWING]: Release CGImage. + + * macterm.c (XCreatePixmap) [!WORDS_BIG_ENDIAN && USE_CG_DRAWING]: + Create GWorld in ARGB pixel format. + (mac_copy_area, mac_copy_area_with_mask) [USE_CG_DRAWING]: + Remove functions. + (x_draw_image_foreground) [USE_CG_DRAWING]: Use mac_draw_cg_image + instead of mac_copy_area/mac_copy_area_with_mask. + +2006-03-15 Kim F. Storm <storm@cua.dk> + + * xdisp.c (extend_face_to_end_of_line): Always add space glyph to + empty row. Fixes memory corruption revealed by 2006-03-02 change. + (display_tool_bar_line): Skip empty tool-bar line if HEIGHT < 0. + (tool_bar_lines_needed): Fix tool-bar display in case the tool-bar + width is exactly the same as the window width. Don't count a final + empty tool-bar line (pass HEIGHT = -1 to display_tool_bar_line). + +2006-03-15 Juanma Barranquero <lekktu@gmail.com> + + * fringe.c (w32_init_fringe, w32_reset_fringes): Revert to being + conditional on HAVE_NTGUI, not WINDOWS_NT. + +2006-03-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * dispextern.h (mac_init_fringe) [MAC_OS]: Add prototype. + + * fringe.c (mac_init_fringe) [MAC_OS]: New function. + + * macterm.c (mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe. + (max_fringe_bmp, fringe_bmp) [USE_CG_DRAWING]: New variables. + (mac_define_fringe_bitmap, mac_destroy_fringe_bitmap) + (mac_draw_cg_image) [USE_CG_DRAWING]: New functions. + (mac_draw_bitmap) [USE_CG_DRAWING]: Remove function. + (x_draw_fringe_bitmap) [USE_CG_DRAWING]: Use mac_draw_cg_image + instead of mac_draw_bitmap. + (x_redisplay_interface) [USE_CG_DRAWING]: Set handlers for + define_fringe_bitmap and destroy_fringe_bitmap. + +2006-03-14 Chong Yidong <cyd@stupidchicken.com> + + * xterm.c (x_uncatch_errors): Block input for entire function. + +2006-03-12 Jason Rumney <jasonr@gnu.org> + + * w32fns.c (Fx_create_frame): Remove call to + Qface_set_after_frame_default (from xfns.c 2003-05-26). + + * w32menu.c (Fx_popup_menu): Call w32_free_menu_strings when + finished with the menu. + + * w32term.c: Sync 2005-10-24 xterm.c changes. + (last_mouse_glyph_frame): New var. + (note_mouse_movement): Say mouse moved if current frame differs + from last_mouse_glyph_frame, and update last_mouse_glyph_frame. + (w32_mouse_position): Set last_mouse_glyph_frame. + Remove OLD_REDISPLAY_CODE block. + +2006-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macgui.h [USE_ATSUI && MAC_OSX]: Define USE_CG_TEXT_DRAWING to 1. + + * macterm.h (struct mac_output) [USE_CG_DRAWING]: New member cg_context. + (mac_prepare_for_quickdraw) [USE_CG_DRAWING]: Add prototype. + + * mac.c (sys_select) [USE_CG_DRAWING]: Call mac_prepare_for_quickdraw. + + * macfns.c (x_create_tip_frame): Apply 2006-03-11 change for xfns.c. + + * macterm.c (mac_draw_rectangle, x_draw_glyph_string_foreground) + (x_draw_composite_glyph_string_foreground) + (x_draw_image_foreground): Undo previous changes. + (x_draw_hollow_cursor): Likewise. Subtract 1 from the last + argument of mac_draw_rectangle. + (CG_SET_FILL_COLOR, CG_SET_STROKE_COLOR): New macros. + (mac_draw_string_common, mac_draw_image_string_cg): Use them. + (FRAME_CG_CONTEXT) [USE_CG_DRAWING]: New macro. + (mac_begin_cg_clip, mac_end_cg_clip, mac_prepare_for_quickdraw) + [USE_CG_DRAWING]: New functions. + (mac_draw_line, mac_erase_rectangle, mac_clear_window) + (mac_fill_rectangle, mac_draw_rectangle, mac_draw_string_common) + (mac_draw_image_string_cg) [USE_CG_DRAWING]: Add Quartz 2D drawing part. + (mac_draw_bitmap, mac_invert_rectangle, mac_draw_string_common) + (mac_copy_area, mac_scroll_area, x_scroll_bar_create) + (x_scroll_bar_remove, XTset_vertical_scroll_bar, x_set_window_size) + (XTread_socket) [USE_CG_DRAWING]: Call mac_prepare_for_quickdraw. + +2006-03-12 L$,1 q(Brentey K,Aa(Broly <lorentey@elte.hu> + + * xfns.c (x_icon): Disable redundant call to `x_wm_set_window_state'. + +2006-03-11 Jason Rumney <jasonr@gnu.org> + + * w32fns.c (signal_user_input): New function. + (post_character_message): Use it for keyboard input. + (w32_msg_pump): Use it for mouse input. + +2006-03-11 Luc Teirlinck <teirllm@auburn.edu> + + * window.c: Rename preserve_y to window_scroll_pixel_based_preserve_y. + (window_scroll_pixel_based, syms_of_window): Adapt to above change. + +2006-03-11 Eli Zaretskii <eliz@gnu.org> + + * w32fns.c (w32_wnd_proc): Ignore middle and extra button events + if a menu is already active (the menubar_active flag is on). + +2006-03-11 David Ponce <david@dponce.com> + + * xfns.c (x_create_tip_frame): Preserve received parms by copying them. + +2006-03-11 Eli Zaretskii <eliz@gnu.org> + + * w32term.c: Add x_fully_uncatch_errors and x_catching_errors to + the list of unused display error handling functions. + + * eval.c (unwind_to_catch): Call x_fully_uncatch_errors only if + HAVE_X_WINDOWS. + (internal_condition_case, internal_condition_case_1) + (internal_condition_case_2): Call x_catching_errors only if + HAVE_X_WINDOWS. + + * vm-limit.c [HAVE_GETRLIMIT]: Don't define unconditionally. + Don't include sys/resource.h unless defined. + +2006-03-11 Richard Stallman <rms@gnu.org> + + * keymap.c (describe_map): Shorten string to indicate shadowed binding. + + * vm-limit.c (get_lim_data, lim_data, data_space_start): + Move from mem-limits.h. + (enum warnlevel): New data type. + (check_memory_limits): Rewrite the logic about warnings. + Use standard `struct rlimit'. Check return values for nonsense. + (memory_warnings): Always clear lim_data. + + * mem-limits.h (get_lim_data, lim_data, data_space_start): + Move to vm-limit.c. + + * xterm.c (x_fully_uncatch_errors, x_catching_errors): New functions. + + * eval.c (unwind_to_catch): Call x_fully_uncatch_errors. + (internal_condition_case_1, internal_condition_case_2): + Abort if within unclosed x_catch_errors. + +2006-03-11 Romain Francoise <romain@orebokech.com> + + * process.c (Vprocess_adaptive_read_buffering): Doc fix. + +2006-03-11 Giorgos Keramidas <keramida@ceid.upatras.gr> (tiny change) + + * lisp.h: Remove duplicate prototypes. Make the prototype of + getloadavg be conditioned on HAVE_GETLOADAVG being undefined. + +2006-03-11 Eli Zaretskii <eliz@gnu.org> + + * xterm.c (x_draw_hollow_cursor): Subtract 1 from the last + argument of XDrawRectangle. + + * xdisp.c (get_phys_cursor_geometry): Don't decrease height by 1. + + * macterm.c (mac_draw_rectangle): Don't add 1 to width and height. + (x_draw_glyph_string_foreground) + (x_draw_composite_glyph_string_foreground) + (x_draw_image_foreground): Don't subtract 1 from width and height + arguments to mac_draw_rectangle. + (x_draw_hollow_cursor): Add 1 to w->phys_cursor_width. + +2006-03-10 Kim F. Storm <storm@cua.dk> + + * alloc.c (USE_POSIX_MEMALIGN): Fix last change. + +2006-03-09 Stefan Monnier <monnier@iro.umontreal.ca> + + * alloc.c (USE_POSIX_MEMALIGN): New macro. + (ABLOCKS_BASE, lisp_align_malloc, lisp_align_free): Use it. + +2006-03-09 Kenichi Handa <handa@m17n.org> + + * coding.c (DECODE_EMACS_MULE_COMPOSITION_CHAR): Fix decoding + ASCII component of a composition. + +2006-03-08 Luc Teirlinck <teirllm@auburn.edu> + + * window.c: Declare preserve_y as a static global variable. + (window_scroll_pixel_based): No longer declare preserve_y; + it is global now. + (syms_of_window): Set preserve_y to -1. + +2006-03-08 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * image.c [MAC_OS] (XPutPixel): Set alpha channel bits if pixmap + depth is 32. + [MAC_OS] (XGetPixel): Strip off alpha channel bits if pixmap + depth is 32. + +2006-03-06 Chong Yidong <cyd@stupidchicken.com> + + * xdisp.c (handle_invisible_prop): Don't update it->position with + a buffer position if we're in a display string. + +2006-03-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.h (MAC_AQUA_VERTICAL_SCROLL_BAR_WIDTH) + (MAC_AQUA_SMALL_VERTICAL_SCROLL_BAR_WIDTH): New defines. + + * macfns.c (x_default_scroll_bar_color_parameter) + (x_set_scroll_bar_foreground, x_set_scroll_bar_background): + Remove unnecessary prototypes. + (x_set_scroll_bar_default_width): + Use MAC_AQUA_VERTICAL_SCROLL_BAR_WIDTH. + (mac_set_scroll_bar_width): New function. + (mac_frame_parm_handlers): Set it as handler for scroll-bar-width. + + * macterm.c (get_control_part_bounds): Fix type of return value. + (x_set_toolkit_scroll_bar_thumb, x_scroll_bar_create) + (XTset_vertical_scroll_bar) [USE_TOOLKIT_SCROLL_BARS]: Don't show + scroll bar if it is not tall enough to display scroll bar thumb. + [USE_CARBON_EVENTS] (mac_convert_event_ref) + (mac_handle_command_event, mac_handle_window_event) + (mac_handle_mouse_event): Check error code of GetEventParameter. + (convert_fn_keycode) [MAC_OSX]: Likewise. + +2006-03-05 Andreas Schwab <schwab@suse.de> + + * xselect.c (x_catch_errors_unwind): Fix missing return value. + +2006-03-02 Kim F. Storm <storm@cua.dk> + + * frame.h (struct frame): New member n_tool_bar_rows. + + * xdisp.c: Minimize the unpleasent visual impact of the requirement + that non-toolkit tool-bars must occupy an integral number of screen + lines, by distributing the rows evenly over the tool-bar screen area. + (Vtool_bar_border): New variable. + (syms_of_xdisp): DEFVAR_LISP it. + (display_tool_bar_line): Add HEIGHT arg for desired row height. + Make tool-bar row the desired height. Use default face for border + below tool-bar. + (tool_bar_lines_needed): Add N_ROWS arg. Use it to return number of + actual tool-bar rows. + (redisplay_tool_bar): Calculate f->n_tool_bar_rows initially. + Adjust the height of the tool-bar rows to fill tool-bar screen area. + (redisplay_tool_bar): Calculate f->n_tool_bar_rows when tool-bar area + is resized. + +2006-03-01 Luc Teirlinck <teirllm@auburn.edu> + + * search.c (Fregexp_quote): Do not precede a literal `]' with two + backslashes to try to make clear that it has a literal meaning; it + does not do that. (It could close a character alternative + containing a backslash.) + +2006-02-28 Chong Yidong <cyd@stupidchicken.com> + + * xselect.c (x_catch_errors_unwind): New function. + (x_reply_selection_request): Put x_uncatch_errors in an unwind. + (Fx_get_atom_name): Call x_uncatch_errors earlier. + + * window.c (Qscroll_up, Qscroll_down): New syms. + (window_scroll_pixel_based): Make preserve_y static to avoid + getting point stuck when scrolling 1 line. + +2006-02-26 Chong Yidong <cyd@stupidchicken.com> + + * xterm.h, xterm.c (x_uncatch_errors): Delete unneccessary argument. + + * xterm.c (x_load_font, x_term_init, XTmouse_position) + (handle_one_xevent, x_connection_closed, x_list_fonts): + No arg for x_uncatch_errors. + + * xselect.c (x_own_selection, x_decline_selection_request) + (x_reply_selection_request, x_get_foreign_selection) + (Fx_get_atom_name, Fx_send_client_event): Likewise. + + * xfns.c (x_real_positions, x_set_mouse_color, Fx_focus_frame): + Likewise. + +2006-02-26 Luc Teirlinck <teirllm@auburn.edu> + + * lread.c: Declare Vload_file_rep_suffixes instead of + deleted variable default_suffixes. + (Fget_load_suffixes): New function. + (Fload): Use Fget_load_suffixes and Vload_file_rep_suffixes. + No longer use deleted variable default_suffixes. Update docstring. + (syms_of_lread): defsubr Sget_load_suffixes. + Expand `load-suffixes' docstring. + Delete default_suffixes and DEFVAR_LISP the new variable + `load-file-rep-suffixes'. + + * w32.c (check_windows_init_file): Use Fget_load_suffixes instead + of Vload_suffixes. + + * lisp.h: EXFUN Fget_load_suffixes. + Extern Vload_file_rep_suffixes. + + * eval.c (specpdl_ptr): Remove volatile qualifier for consistency + with lisp.h. + +2006-02-26 Stefan Monnier <monnier@iro.umontreal.ca> + + * lisp.h (struct specbinding, specpdl_ptr): Remove the volatile + qualifier which was trying to avoid the bug that was fixed by + yesterday's changes to xterm.c. + +2006-02-25 Chong Yidong <cyd@stupidchicken.com> + + * xterm.h (x_catch_errors) Return value changed to void. + (x_uncatch_errors): Delete unused count argument. + + * xterm.c (x_catch_errors): Don't use record_unwind_protect, since + it can be called in a signal handler. + (x_catch_errors_unwind): Function deleted. + (x_uncatch_errors): Deallocate last x_error_message_stack struct. + (x_check_errors): Call x_uncatch_errors before signalling error. + + (x_load_font, x_term_init, XTmouse_position, handle_one_xevent) + (x_connection_closed, x_list_fonts): Use new versions of + x_catch_errors and x_uncatch_errors. + + * xselect.c (x_own_selection, x_decline_selection_request) + (x_reply_selection_request, x_get_foreign_selection) + (Fx_get_atom_name, Fx_send_client_event): Likewise. + + * xfns.c (x_real_positions, x_set_mouse_color, Fx_focus_frame): + Likewise. + + * eval.c (record_unwind_protect): Add an assertion. + +2006-02-25 Stefan Monnier <monnier@iro.umontreal.ca> + + * process.c (Fmake_network_process): Init the process's mark. + +2006-02-25 Kim F. Storm <storm@cua.dk> + + * buffer.c (modify_overlay): Force redisplay if we modify an + overlay at the end of the buffer. + +2006-02-24 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (xg_get_image_for_pixmap): If x_find_image_file returns + nil the image file has been removed, in that case use the (cached) + pixmap. + +2006-02-24 Kenichi Handa <handa@m17n.org> + + * fileio.c (Finsert_file_contents): When a text is replaced + partially, be sure to set point before the inserted characters. + +2006-02-23 Zhang Wei <id.brep@gmail.com> (tiny change) + + * xfns.c (Fx_file_dialog): Return a decoded file name. + +2006-02-23 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * dispnew.c (update_text_area): Avoid needless redraw of rightmost + glyph whose face is extended to the text area end. + + * macterm.c (x_set_toolkit_scroll_bar_thumb): Don't set control + values if control is not visible or values are not changed. + +2006-02-22 Stefan Monnier <monnier@iro.umontreal.ca> + + * window.c (Fwindow_list): Check `window' before doing XWINDOW. + The default `window' should not be "on a different frame". + +2006-02-22 Kim F. Storm <storm@cua.dk> + + * indent.c (Fvertical_motion): Only try to move back if we can. + +2006-02-22 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macgui.h (struct _XGC) [!MAC_OSX || !USE_ATSUI]: New member + n_clip_rects. + + * macmenu.c (digest_single_submenu): Apply 2006-02-19 change for + xmenu.c. + + * macterm.c (GC_CLIP_REGION): Remove macro. + (mac_begin_clip, mac_end_clip): Take arg GC instead of REGION. + All uses changed. Don't do clipping if n_clip_rects is zero. + (mac_set_clip_rectangles): Use xassert instead of abort. + Set n_clip_rects. Don't make clip_region empty when number of + clipping rectangles is zero. + (mac_reset_clip_rectangles): Set n_clip_rects directly instead of + calling mac_set_clip_rectangles. + (x_set_toolkit_scroll_bar_thumb): Temporarily hide scroll bar to + avoid multiple redraws. + +2006-02-22 Kim F. Storm <storm@cua.dk> + + * fringe.c (draw_fringe_bitmap): Fix overlay-arrow display. + +2006-02-21 Kim F. Storm <storm@cua.dk> + + * fringe.c (syms_of_fringe) <fringe-bitmaps>: Doc fix. + +2006-02-21 Zhang Wei <brep@newsmth.org> + + * xfns.c (Fx_file_dialog, Motif and GTK): DECODE_FILE before + returning it. + +2006-02-21 Giorgos Keramidas <keramida@ceid.upatras.gr> (tiny change) + + * fringe.c (horizontal_bar_bits): Rename from `horisontal_bar_bits'. + (standard_bitmaps): Use it. + +2006-02-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c (mac_draw_string_common): Remove arg MODE. New arg + BG_WIDTH. All uses changed. Draw background if BG_WIDTH is not zero. + (mac_draw_image_string, mac_draw_image_string_16): New arg BG_WIDTH. + [USE_CG_TEXT_DRAWING] (mac_draw_image_string_cg): Rename from + mac_draw_string_cg. New arg BG_WIDTH. All uses changed. + Draw background if BG_WIDTH is not zero. Use float constants as + divisors instead of double. Use alloca instead of xmalloc/xfree. + (x_draw_glyph_string_background, x_draw_glyph_string_foreground) + [!MAC_OS8 || USE_ATSUI]: Background may be drawn using + mac_draw_image_string* functions. + (XLoadQueryFont) [MAC_OS8 && USE_ATSUI]: Don't adjust heights of + some fonts when srcCopy text transfer mode might be used. + (mac_begin_clip, mac_end_clip): Check if region is empty. + (mac_set_clip_rectangles): When resetting clip region, make it + empty instead of disposing of it. + +2006-02-20 Kim F. Storm <storm@cua.dk> + + * Makefile.in: Add fringe.elc to WINDOW_SUPPORT. + + * buffer.h (struct buffer): New members fringe_indicator_alist and + fringe_cursor_alist. + + * buffer.c (init_buffer_once): Set dummy default values for + fringe-indicator-alist and fringe-cursor-alist. The proper + default values are set by pre-loading fringe.el. + (syms_of_buffer): defvar_per_buffer new fringe-indicator-alist and + fringe-cursor-alist buffer-local variables and defvar_lisp_nopro + corresponding default- variables. + + * fringe.c (enum fringe_bitmap_type): Remove. Change all uses + to use `int'. + (NO_FRINGE_BITMAP, UNDEF_FRINGE_BITMAP, MAX_STANDARD_FRINGE_BITMAPS): + Define explicitly. + (Qtruncation, Qcontinuation, Qempty_line, Qtop_bottom) + (Qhollow_small): New variables. + (syms_of_fringe): Intern and staticpro them. + (question_mark_bits): Rename from unknown_bits. + (left_curly_arrow_bits): Rename from continuation_bits. + (right_curly_arrow_bits): Rename from continued_bits. + (left_triangle_bits): Rename from ov_bits. + (right_triangle_bits): Add. + (filled_rectangle_bits): Rename from filled_box_cursor_bits. + (hollow_rectangle_bits): Rename from hollow_box_cursor_bits. + (filled_square_bits): Add. + (vertical_bar_bits): Rename from bar_cursor_bits. + (horizontal_bar_bits): Rename from hbar_cursor_bits. + (empty_line_bits): Rename from zv_bits. + (standard_bitmaps): Update to use new names. + (draw_fringe_bitmap_1): Make static. + (get_logical_cursor_bitmap, get_logical_fringe_bitmap): New functions + to map from logical cursors and indicators to physical bitmaps. + (draw_fringe_bitmap): Resolve fringe cursor and overlay-arrow + bitmaps using symbol names instead of bitmap numbers. + (update_window_fringes): Use logical indicator symbol names + instead of bitmap numbers for logical. Add bitmap cache. + (LEFT_FRINGE, RIGHT_FRINGE): New helper macros. + +2006-02-20 Chong Yidong <cyd@stupidchicken.com> + + * regex.c: Revert 2006-02-19 change. + (xmalloc, xrealloc): Define these when not linked to Emacs. + Redefine malloc -> xmalloc, realloc -> xrealloc as in Emacs case. + +2006-02-19 Luc Teirlinck <teirllm@auburn.edu> + + * regex.c (extend_range_table_work_area): Fix typo. + +2006-02-19 Richard M. Stallman <rms@gnu.org> + + * xterm.c (x_catch_errors): Use xmalloc. + + * regex.c (extend_range_table_work_area): Call xmalloc and xrealloc. + (regex_compile): Likewise. + (regcomp): Use xmalloc. + + * gtkutil.c (malloc_widget_value): Use xmalloc. + + * vm-limit.c [HAVE_GETRLIMIT]: Include sys/resource.h. + (check_memory_limits) [HAVE_GETRLIMIT]: Use getrlimit. + + * xmenu.c (digest_single_submenu): When pane_string is empty, + do initialize save_wv. + +2006-02-19 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * xdisp.c (update_menu_bar) [MAC_OS]: Don't set + w->update_mode_line if arg F is not the selected frame. + + * macmenu.c (popup_activated_flag, submenu_id) + (next_menubar_widget_id): Remove variables. + (initialize_frame_menubar): Remove function. + (pop_down_menu, mac_menu_show): Simplify save value. + (dispose_menus): New function. + (pop_down_menu, fill_menubar): Use it. + (fill_submenu): Remove function. All uses changed to fill_menu. + (add_menu_item): Remove args SUBMENU and FORCE_DISABLE. New arg + POS. Don't call SetMenuItemHierarchicalID here. + (fill_menu): Add arg SUBMENU_ID. Return submenu_id that is to be + used next. Call SetMenuItemHierarchicalID here. + (fill_menubar): Add arg DEEP_P. All uses changed. Clean up menu + objects if needed. Reuse existing menu bar titles if possible. + (set_frame_menubar): Don't clean up menu objects here. + +2006-02-18 Chong Yidong <cyd@stupidchicken.com> + + * window.c (window_min_size_1): Ensure room for the scroll bar and + fringes. + +2006-02-17 Romain Francoise <romain@orebokech.com> + + * puresize.h (BASE_PURESIZE): Increment to 1200000. + +2006-02-17 Stefan Monnier <monnier@iro.umontreal.ca> + + * alloc.c (Fmake_symbol): Comment-out left-over assert from before the + addition of the BLOCK_INPUTs. + +2006-02-17 Juanma Barranquero <lekktu@gmail.com> + + * window.c (Fset_window_scroll_bars): Doc fix. + +2006-02-17 Kenichi Handa <handa@m17n.org> + + * xdisp.c (display_mode_element): Call display_string with correct + PREC arg (which must be a number of characters, not column width). + +2006-02-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * frame.c (x_get_arg): Clear out PARAM in ALIST also on Mac. + + * macfns.c (x_set_menu_bar_lines): Menu bar is always shown on Mac. + + * macmenu.c (set_frame_menubar): Don't call DrawMenuBar. + +2006-02-14 Richard M. Stallman <rms@gnu.org> + + * frame.c (x_get_arg): Clear out all occurrences of PARAM in ALIST. + + * m/ibms390x.h: New file. + +2006-02-14 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (xg_tool_bar_detach_callback): Set show-arrow to the + value of x-gtk-whole-detached-tool-bar. + (xg_tool_bar_attach_callback): Set show-arrow to TRUE. + + * xfns.c (syms_of_xfns): New variable: x-gtk-whole-detached-tool-bar. + +2006-02-14 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.c (x_x_to_emacs_modifiers): Make non-static. + + * xterm.h: Declare x_x_to_emacs_modifiers. + + * gtkutil.c (xg_tool_bar_button_cb): New function. + (xg_tool_bar_callback): Call x_x_to_emacs_modifiers to + store modifiers in event. + (update_frame_tool_bar): Connect button-release-event to + xg_tool_bar_button_cb. + +2006-02-13 Richard M. Stallman <rms@gnu.org> + + * .gdbinit (xwindow): Update the code to show the window box. + +2006-02-13 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.c (note_mouse_movement): Check for NULL FRAME_X_OUTPUT (frame). + +2006-02-12 Richard M. Stallman <rms@gnu.org> + + * cmds.c (internal_self_insert): Handle weird auto-fill-function. + +2006-02-11 Eli Zaretskii <eliz@gnu.org> + + * keyboard.c (Venable_disabled_menus_and_buttons): New variable. + (syms_of_keyboard): DEVFAR_LISP and initialize it. + (parse_tool_bar_item, parse_menu_item): If that variable is + non-nil, don't disable menu items and tool-bar buttons. + +2006-02-11 Juanma Barranquero <lekktu@gmail.com> + + * doc.c (Fsubstitute_command_keys): Doc fix. + +2006-02-10 Thien-Thi Nguyen <ttn@gnu.org> + + * data.c (Findirect_function): Rewrite docstring. + Fix omission bug: Declare new arg NOERROR. + +2006-02-10 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macfns.c (x_set_mouse_color): Don't call rif->define_frame_cursor + if window_desc is not set yet. + (Fx_create_frame): Remove variable x_frame_name. Apply 2005-12-07 + and 2006-01-26 changes for xfns.c. Call x_iconify_frame if frame + parameter `visibility' is `icon'. + (Fx_create_frame, x_create_tip_frame): Use "fontset-standard" + instead of "fontset-mac". + (Fx_focus_frame): New defun. + (syms_of_macfns): Defsubr it. + + * macterm.c (mac_define_frame_cursor): Don't change pointer shape + for unfocused frame. + (x_raise_frame): Call BringToFront instead of SelectWindow. + (x_lower_frame): Use NULL instead of nil. + (x_make_frame_visible): Don't call SelectWindow. + (XTread_socket): Increment handling_signal at the start, decrement + it at the end. + [USE_CG_TEXT_DRAWING] (init_cg_text_anti_aliasing_threshold): Use + CFPreferencesGetAppIntegerValue instead of Fmac_get_preference. + +2006-02-10 Kim F. Storm <storm@cua.dk> + + * data.c (Findirect_function): Add NOERROR arg. All callers changed + to pass Qnil for NOERROR. + + * keymap.c (current_minor_maps_error): Remove. + (current_minor_maps): Pass Qt for NOERROR to Findirect_function + instead of using internal_condition_case_1+current_minor_maps_error. + +2006-02-09 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.c (handle_one_xevent): Must note mouse movement even for nil + frames for GTK, in that case it is the tool bar. This is so that + highlighted text get reset properly. + +2006-02-09 Juanma Barranquero <lekktu@gmail.com> + + * alloc.c (Fmake_bool_vector, Fpurecopy): Doc fixes. + +2006-02-08 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * window.c (adjust_window_trailing_edge): Check that shrinking + does not set a window to size zero or less. + +2006-02-08 Miles Bader <miles@gnu.org> + + * editfns.c (Fconstrain_to_field): Use Fget_char_property instead + of Fget_text_property (other field functions work with overlays as + well as text-properties). + +2006-02-07 Kenichi Handa <handa@m17n.org> + + * dispextern.h (unibyte_display_via_language_environment): Extern it. + + * xterm.h (unibyte_display_via_language_environment): + * w32term.h (unibyte_display_via_language_environment): + * macterm.h (unibyte_display_via_language_environment): Delete extern. + +2006-02-07 Kenichi Handa <handa@m17n.org> + + * term.c (append_glyph): Refer to it->char_to_display instead of it->c. + (produce_glyphs): Set the character to print in + it->char_to_display. Handle unibyte-display-via-language-environment. + (produce_stretch_glyph): Set character to print in it->char_to_display. + +2006-02-06 Kenichi Handa <handa@m17n.org> + + * lread.c (openp): Initialize encoded_fn before GCPRO it. + +2006-02-05 Ken Raeburn <raeburn@raeburn.org> + + * editfns.c (Fconstrain_to_field): Fix int/Lisp_Object mixup. + + * lisp.h (XPNTR) [!NO_UNION_TYPE && !HAVE_SHM && !DATA_SEG_BITS]: + Cast bitfield value to EMACS_INT, to suppress gcc warning. + + * xrdb.c (malloc, realloc, free) [emacs]: Undefine macros before + defining. + +2006-02-03 Kim F. Storm <storm@cua.dk> + + * xdisp.c: Cache last merged escape glyph face. + (last_escape_glyph_frame, last_escape_glyph_face_id) + (last_escape_glyph_merged_face_id): New variables. + (get_next_display_element): Use/update them. + (redisplay_internal): Reset them before redisplay. + + * xdisp.c (set_iterator_to_next): Optimize 2004-12-13 fix. + Only recheck faces after displaying ellipsis. + +2006-02-02 Kenichi Handa <handa@m17n.org> + + * coding.c (decode_composition_emacs_mule): Fix handling of + incorrect format data. + +2006-01-31 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (update_frame_tool_bar): Use new tool bar function + gtk_toolbar_insert() so we can have tool bars of different sizes. + +2006-01-30 Luc Teirlinck <teirllm@auburn.edu> + + * data.c (Flistp): Doc fix. + +2006-01-30 Juanma Barranquero <lekktu@gmail.com> + + * window.c (Fother_window, Fwindow_vscroll, Fset_window_vscroll): + Fix typos in docstrings. + +2006-01-28 Luc Teirlinck <teirllm@auburn.edu> + + * data.c (Fcar, Fcdr): Add links to Elisp manual to the docstrings. + +2006-01-27 Chong Yidong <cyd@stupidchicken.com> + + * alloc.c (make_interval, allocate_string) + (allocate_string_data, make_float, Fcons, allocate_vectorlike) + (Fmake_symbol, allocate_misc): Use BLOCK_INPUT when accessing + global variables. + +2006-01-27 Eli Zaretskii <eliz@gnu.org> + + * dired.c (DIRENTRY_NONEMPTY) [__CYGWIN__]: Don't use d_ino; use + the MSDOS definition. + +2006-01-26 Richard M. Stallman <rms@gnu.org> + + * alloc.c (check_pure_size): Make overflow message an "error message". + + * keymap.c (Fmap_keymap): Doc fix. + + * xfns.c (Fx_create_frame): Put all specified parms into f->param_alist + unless they were cleared out. + + * frame.c (x_get_arg): "Clear out" the parm in ALIST if found there. + +2006-01-26 L$,1 q(Brentey K,Aa(Broly <lorentey@elte.hu> + + * editfns.c (Fconstrain_to_field): Fix behaviour on field boundaries. + (find_field): Set before_field to after_field when pos is at BEGV. + (Fline_beginning_position, Fline_end_position): + Clarify confusing doc string. + + * cmds.c (Fbeginning_of_line, Fend_of_line): Clarify confusing doc + string. + +2006-01-26 Kenichi Handa <handa@m17n.org> + + * callproc.c (Fcall_process): GCPRO error_file. Encode infile, + current_dir, and error_file. On reporting an error, decode them + back. + +2006-01-24 Stefan Monnier <monnier@iro.umontreal.ca> + + * regex.c (IMMEDIATE_QUIT_CHECK): Use it with SYNC_INPUT as well. + (re_match_2_internal) <on_failure_jump, on_failure_jump_smart>: + Don't check for quit, since any loop will go through fail or jump. + +2006-01-24 Chong Yidong <cyd@stupidchicken.com> + + * alloc.c (allocate_string_data): Update next_free immediately, to + reduce risk of memory clobberage. + +2006-01-24 L$,1 q(Brentey K,Aa(Broly <lorentey@elte.hu> + + * xdisp.c (handle_invisible_prop): Set it->position to fix cursor + display when point moves across an ellipsis. If there are + adjacent invisible texts, don't lose the second one's ellipsis. + (x_produce_glyphs): Doc fix. + +2006-01-23 Stefan Monnier <monnier@iro.umontreal.ca> + + * xterm.c (x_catch_errors_unwind): Yet another int/Lisp_Object mixup. + +2006-01-23 Kim F. Storm <storm@cua.dk> + + * xdisp.c (handle_single_display_spec): Fix handling of space + property on char from string: set *position rather than + it->current.pos. + (produce_stretch_glyph): Reduce width of stretch glyphs so they + don't get wider than the window (unless truncate-lines is on). + +2006-01-22 Stefan Monnier <monnier@iro.umontreal.ca> + + * xterm.c: Avoid allocating Lisp data from a signal handler. + (x_error_message): New var to replace x_error_message_string. + (x_error_catcher, x_catch_errors, x_catch_errors_unwind) + (x_check_errors, x_had_errors_p, x_clear_errors, x_error_handler) + (syms_of_xterm): Use it instead of x_error_message_string. + + * alloc.c (lisp_align_free): Add an assertion. + (make_interval, allocate_string, make_float, Fcons, Fmake_symbol) + (allocate_misc): If ENABLE_CHECKING is on, check we're not called from + a signal handler. + +2006-01-21 Luc Teirlinck <teirllm@auburn.edu> + + * dired.c (syms_of_dired) <completion-ignored-extensions>: Doc fix. + +2006-01-21 Romain Francoise <romain@orebokech.com> + + * xdisp.c (get_window_cursor_type): Fix last change. + Update copyright year. + +2006-01-20 Eli Zaretskii <eliz@gnu.org> + + * lread.c (Fload): Don't leak the file descriptor returned by + openp if we are going to signal an error. + + * w32.c (sys_close): If FD is outside [0..MAXDESC) limits, pass it + directly to _close. + (sys_dup): Protect against new_fd larger than fd_info[] can handle. + (sys_read): If FD is outside [0..MAXDESC) limits, pass it directly + to _read. + (sys_write): If FD is outside [0..MAXDESC) limits, pass it + directly to _write. + + * .gdbinit: Don't dereference Vsystem_type's Lisp_Symbol pointer + if it is NULL. + +2006-01-20 Kenichi Handa <handa@m17n.org> + + * puresize.h (BASE_PURESIZE): Increment to 1190000. + +2006-01-19 Chong Yidong <cyd@stupidchicken.com> + + * xdisp.c (get_window_cursor_type): Use cursor type specified by + the selected buffer for the echo area too. + +2006-01-19 Richard M. Stallman <rms@gnu.org> + + * keymap.c (Fmap_keymap): Doc fix. + + * s/irix6-5.h (GC_SETJMP_WORKS, GC_MARK_STACK): New definitions. + + * keyboard.c (echo_char): Don't omit the space between first two + echoed chars. + + * minibuf.c (read_minibuf): Fix previous change. + +2006-01-19 Kenichi Handa <handa@m17n.org> + + * xterm.c (handle_one_xevent): Handle keysyms 0x1000000..0x10000FF. + +2006-01-17 Richard M. Stallman <rms@gnu.org> + + * frame.c (x_frame_get_and_record_arg): Don't record Qunbound + value in f->param_alist. + +2006-01-15 Andreas Schwab <schwab@suse.de> + + * search.c (Freplace_match): Use UPPERCASEP instead of !NOCASEP. + +2006-01-13 Richard M. Stallman <rms@gnu.org> + + * Makefile.in: Define new macro WINDOW_SUPPORT. + (lisp): Use it. + (SOME_MACHINE_LISP): Add conditionally loaded files. + +2006-01-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c [USE_ATSUI] (atsu_get_text_layout_with_text_ptr) + [MAC_OS_X_VERSION_MAX_ALLOWED >= 1020]: Specify kATSLineUseQDRendering. + (XLoadQueryFont) [USE_ATSUI]: Display diacritical marks in + decomposed form. + + * process.c [HAVE_INTTYPES_H]: Include inttypes.h. + (ifflag_table): Fix typo (IFF_OACTIV -> IFF_OACTIVE). + (Fnetwork_interface_info): Use HAVE_STRUCT_IFREQ_IFR_NETMASK + macro. Also try member ifr_addr when getting netmask. + +2006-01-10 Stefan Monnier <monnier@iro.umontreal.ca> + + * fileio.c (Fexpand_file_name): Remove redundant tests. + Fix elimination of // so that it doesn't prevent elimination of an + immediately following /. or /.. + +2006-01-09 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (xg_toggle_notify_cb): New function. + (xg_toggle_visibility_cb): Move setting of x_gtk_show_hidden_files to + xg_toggle_notify_cb. + (xg_get_file_with_chooser): Add callback to xg_toggle_notify_cb when + parameter value changes so the toggle button gets updated. + +2006-01-06 Nick Roberts <nickrob@snap.net.nz> + + * .gdbinit: Fix typo. + +2006-01-05 Eli Zaretskii <eliz@gnu.org> + + * .gdbinit: Fix last change. + +2006-01-05 Kim F. Storm <storm@cua.dk> + + * process.c (Fmake_network_process): Use AF_INET instead of + AF_UNSPEC when AF_INET6 is not defined. + +2006-01-05 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * mac.c (mac_coerce_file_name_ptr, mac_coerce_file_name_desc): + Don't check that the other type is known file-related one. + + * macfns.c (Fx_server_version): Use gestaltSystemVersionMajor, + gestaltSystemVersionMinor, and gestaltSystemVersionBugFix on Mac + OS X 10.4 and later. + +2006-01-04 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (xg_get_image_for_pixmap): If the image is from a file, + let GTK do all image processing. Importing Emacs own pixmaps to GTK + looks bad for inactive tool bar items with some Gnome themes. + +2006-01-04 Eli Zaretskii <eliz@gnu.org> + + * .gdbinit: Avoid a warning message when x_error_quitter is not + compiled in. + + * process.c [WINDOWSNT]: Undef AF_INET6 to disable IPv6 support + for w32. + +2006-01-04 Kim F. Storm <storm@cua.dk> + + * process.c: Add IPv6 support. + (Qipv4, Qipv6): New vars. + (syms_of_process): Intern and staticpro them. + (Fformat_network_address): Handle 9 or 8 element vector as IPv6 address + with or without port number. Handle 4 element vector as IPv4 address + without port number. + (conv_sockaddr_to_lisp, get_lisp_to_sockaddr_size) + (conv_lisp_to_sockaddr): Handle IPv6 addresses. + (Fmake_network_process): Use :family 'ipv4 and 'ipv6 to explicitly + request that address family only. :family nil or omitted means to + determine address family from the specified :host and :service. + (ifflag_table): Add missing OpenBSD IFF_ flags. + (server_accept_connection): Handle IPv6 addresses. + (init_process): Add (:family ipv4) and (:family ipv6) sub-features. + + * .gdbinit: Undo last change. Instead, look at Vsystem_type to + determine which breakpoints to set. + +2006-01-03 Stefan Monnier <monnier@iro.umontreal.ca> + + * keymap.c (describe_map_compare): Yet another int/Lisp_Object mixup. + + * window.h (Fwindow_minibuffer_p): Declare (for use in minibuf.c). + +2006-01-03 Romain Francoise <romain@orebokech.com> + + * emacs.c (main): Update copyright year. + +2006-01-03 Ken Raeburn <raeburn@gnu.org> + + * callproc.c (delete_temp_file): Bind file-name-handler-alist to + nil for the call to internal_delete_file. + +2006-01-01 Ken Raeburn <raeburn@gnu.org> + + * callproc.c (Fcall_process_region): Bind file-name-handler-alist + to nil for the call to Fwrite_region. + +2005-12-31 Richard M. Stallman <rms@gnu.org> + + * minibuf.c (read_minibuf): Clear out all other minibuffer windows. + +2005-12-31 Eli Zaretskii <eliz@gnu.org> + + * emacs.c (gdb_pvec_type): A dummy variable for GDB's sake. + +2005-12-30 Luc Teirlinck <teirllm@auburn.edu> + + * textprop.c (set_text_properties): Reword description of return value. + Return Qnil if caller wants to remove all text properties from a + string and the string already has no intervals. + +2005-12-30 Stefan Monnier <monnier@iro.umontreal.ca> + + * term.c (visible_cursor): New boolean var. + (set_terminal_modes, tty_show_cursor): Use "vs" or "ve" depending on + visible_cursor. + (syms_of_term): Export the new var as "visible-cursor". + +2005-12-30 Eli Zaretskii <eliz@gnu.org> + + * .gdbinit: Tell users not to worry about GDB warnings that some + functions do not exist in the binary. + +2005-12-30 Andreas Schwab <schwab@suse.de> + + * process.c (Fnetwork_interface_info): Correctly terminate the + loop over ifflag_table. + +2005-12-29 Richard M. Stallman <rms@gnu.org> + + * lread.c (readevalloop): Test for reading a whole buffer + before actually reading anything. Handle all cases, including + START = END = nil and an already-narrowed buffer. + Convert END to a marker if it is a number. + + * keymap.c (describe_map): Put sparse map elements into an array, + sort them, then output a sequence of identical bindings on one line. + (struct describe_map_elt): New data type. + (describe_map_compare): New function. + +2005-12-28 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (xg_get_file_with_chooser): Change message shown + in file chooser. + +2005-12-27 Richard M. Stallman <rms@gnu.org> + + * lread.c (readevalloop): Set PT and ZV in the proper buffer, + not the current one. + + * minibuf.c (Fminibuffer_message): Doc fix. + (read_minibuf): Set current_buffer->enable_multibyte_characters sooner. + + * eval.c (do_autoload): Ignore elements of Vautoload_queue + where car is not symbol. + +2005-12-27 Kenichi Handa <handa@m17n.org> + + * charset.c (lisp_string_width): Check multibyteness of STRING. + +2005-12-27 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xfns.c (x_show_hidden_files): New variable. + (syms_of_xfns): Defvar it. + + * gtkutil.c (xg_toggle_visibility_cb): New function. + (xg_get_file_with_chooser): Add toggle hidden files and a message + to the new file chooser dialog. Show hidden files if + x_show_hidden_files is non-zero. + +2005-12-26 Richard M. Stallman <rms@gnu.org> + + * keyboard.h: Undo previous change. + + * Makefile.in (undo.o): Undo previous change. + + * undo.c: Undo previous change. + +2005-12-26 Luc Teirlinck <teirllm@auburn.edu> + + * keyboard.h: extern last_point_position_window. + + * undo.c: include keyboard.h. + + * Makefile.in (undo.o): Depend on keyboard.h. + +2005-12-26 Richard M. Stallman <rms@gnu.org> + + * commands.h (last_point_position_window): Declare. + + * undo.c: Depend on window.h. + (record_point): Save old point from the correct window. + + * keyboard.c (last_point_position_window): New variable. + (command_loop_1): Set last_point_position_window. + (syms_of_keyboard): Init it. + + * Makefile.in (undo.o): Depend on window.h. + +2005-12-25 Richard M. Stallman <rms@gnu.org> + + * eval.c (un_autoload): Expect (0 . OFEATURES) in Vautoload_queue + to undo a `provide'. + + * fns.c (Fprovide): Store (0 . OFEATURES) in Vautoload_queue. + +2005-12-25 Giorgos Keramidas <keramida@ceid.upatras.gr> + + * m/amdx86-64.h [__FreeBSD__] (START_FILES, LIB_STANDARD): + define for FreeBSD on this platform. + +2005-12-24 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.h (TYPE_FILE_NAME): New define. + (posix_pathname_to_fsspec, fsspec_to_posix_pathname): Remove externs. + + * mac.c (posix_pathname_to_fsspec, fsspec_to_posix_pathname): + Add prototypes. Make static. + (mac_aedesc_to_lisp): Initialize err to noErr. + (mac_coerce_file_name_ptr, mac_coerce_file_name_desc) + (init_coercion_handler): New functions. + (Fmac_coerce_ae_data): Use coercion of Apple event data for + translation from/to file names. + + * macterm.c: Don't include sys/param.h. + (init_coercion_handler): Add extern. + [MAC_OS8] (main): Call init_coercion_handler. + (mac_initialize) [MAC_OSX]: Likewise. + [TARGET_API_MAC_CARBON] (mac_do_receive_drag): Use coercion of + Apple event data for translation from/to file names. + + * macfns.c [TARGET_API_MAC_CARBON] (Fx_file_dialog): Likewise. + + * image.c [MAC_OS] (find_image_fsspec): Likewise. + +2005-12-23 Martin Rudalics <rudalics@gmx.at> + + * insdel.c (insert, insert_and_inherit, insert_before_markers) + (insert_before_markers_and_inherit): Make sure FROM is correct + when `after-change-functions' are called. + +2005-12-23 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xfns.c (Fx_uses_old_gtk_dialog): New function. + + * gtkutil.c (xg_uses_old_file_dialog): New function. + (xg_get_file_name): Use xg_uses_old_file_dialog. + + * gtkutil.h: Declare xg_uses_old_file_dialog. + +2005-12-22 Richard M. Stallman <rms@gnu.org> + + * xmenu.c (xmenu_show): Call inhibit_garbage_collection. + +2005-12-22 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * mac.c (Fmac_coerce_ae_data) [MAC_OSX]: Fix memory leak. + + * macgui.h (XCharStruct): Remove member `valid_p'. + (STORE_XCHARSTRUCT): Don't set member `valid_p'. + (XCharStructRow): New typedef. + (XCHARSTRUCTROW_CHAR_VALID_P, XCHARSTRUCTROW_SET_CHAR_VALID): + New macros. + (struct MacFontStruct): Add member `bounds'. Remove member + `per_char'. All uses for QuichDraw Text fonts are changed to + `bounds.per_char'. ATSUI font bounds are represented as an array + `bounds.rows' of XCharStructRow's, each of which consists of a + bitmap of valid entries and an array of char bounds. + + * macterm.c (mac_per_char_metric): Add prototype. + (x_per_char_metric) [USE_CG_TEXT_DRAWING]: Remove prototype. + (mac_query_char_extents): New function. + (x_per_char_metric): Use it. + (XLoadQueryFont): Likewise. Consolidate min/max_bounds calculations. + [USE_CG_TEXT_DRAWING] (mac_draw_string_cg): + Use mac_per_char_metric instead of x_per_char_metric. + (mac_text_extents_16): New function. + (mac_compute_glyph_string_overhangs): Use it. + (mac_unload_font): Free member `bounds' in struct MacFontStruct. + +2005-12-21 Stefan Monnier <monnier@iro.umontreal.ca> + + * minibuf.c (Fdisplay_completion_list): Use XCAR/XCDR. + (Fminibuffer_completion_help): Remove duplicates before display. + +2005-12-21 L$,1 q(Brentey K,Aa(Broly <lorentey@elte.hu> + + * print.c (print_preprocess): Don't lose print_depth levels while + iterating. + +2005-12-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macmenu.c (Qmac_apple_event): Add extern. + (set_frame_menubar, mac_menu_show keymp_panes) + (single_keymap_panes, list_of_panes, list_of_item) + (single_menu_item): Add argument types to prototypes. + (mac_dialog_show) [HAVE_DIALOGS]: Likewise. + (struct skp): New struct (from xmenu.c). + (single_keymap_panes, single_menu_item, list_of_panes) + (list_of_item): Sync with xmenu.c. + (Fx_popup_menu, Fx_popup_dialog): Likewise. Don't get window from + POSITION if it is mac-apple-event event. + (menubar_selection_callback): Don't use menu_command_in_progress. + (set_frame_menubar): First parse all submenus, then make + widget_value trees from them. Don't allocate any widget_value + objects until we are done with the parsing. + (parse_single_submenu, digest_single_submenu): New functions. + (single_submenu): Function deleted, replaced by those two. + (install_menu_quit_handler) [HAVE_CANCELMENUTRACKING]: Don't create + or dispose of EventHandlerUPP. Install hander to all submenus. + (mac_menu_show) [!HAVE_MULTILINGUAL_MENU]: Use ENCODE_MENU_STRING + instead of ENCODE_SYSTEM. + (free_frame_menubar, fill_submenu, fill_menu): Don't use NULL for + integer values. + [HAVE_DIALOGS] (mac_dialog_show): Sync with xdialog_show (in xmenu.c). + (add_menu_item) [TARGET_API_MAC_CARBON]: Use CFString functions to + format menu item string. Don't use NULL for integer value. + + * macterm.h (struct mac_output): Remove unused member + menu_command_in_progress. + +2005-12-20 Juri Linkov <juri@jurta.org> + + * xmenu.c (Fx_popup_menu): Set Vmenu_updating_frame to f if + position is non-nil, else set it to nil. + + * macmenu.c (Fx_popup_menu): Add `else' to set + Vmenu_updating_frame to nil only if position is nil. + + * w32menu.c (Fx_popup_menu): Add `else' to set + Vmenu_updating_frame to nil only if position is nil. + +2005-12-19 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * keyboard.c (make_lispy_event): Drag-and-drop items are now + stored in member `args' of struct input_event. + + * termhooks.h (struct input_event): Fix comment for DRAG_N_DROP_EVENT. + + * xselect.c (x_handle_dnd_message): Drag-and-drop items are now + stored in member `args' of struct input_event. + + * w32term.c (construct_drag_n_drop): Likewise. + + * macterm.c (mac_do_receive_drag): Likewise. + (x_use_underline_position_properties): Undo 2005-07-13 change. + (syms_of_macterm) <x-use-underline-position-properties>: Likewise. + (mac_use_core_graphics, mac_wheel_button_is_mouse_2) + (mac_pass_command_to_system, mac_pass_control_to_system): + New boolean variables renamed from Lisp_Object ones + Vmac_use_core_graphics, Vmac_wheel_button_is_mouse_2, + Vmac_pass_command_to_system, and Vmac_pass_control_to_system. + All uses changed. + (syms_of_macterm): DEFVAR_BOOL them. Remove previous DEFVAR_LISPs. + Make them user options. + (mac_handle_command_event, mac_store_services_event): + Call create_apple_event_from_event_ref without 5th argument. + (backtranslate_modified_keycode): Mask off modifier keys that are + mapped to some Emacs modifiers before passing it to KeyTranslate. + (syms_of_macterm): Make variables `mac-emulate-three-button-mouse', + `mac-wheel-button-is-mouse-2', and `mac-*-modifier' user options. + Fix docstrings of `mac-*-modifier'. + + * mac.c (create_apple_event_from_event_ref): Remove arg `types'. + (do_applescript): Change argument types to Lisp_Object. + All uses changed. + + * macterm.h (create_apple_event_from_event_ref): Remove 5th + argument from extern. + +2005-12-18 Dan Nicolaescu <dann@ics.uci.edu> + + * xfns.c (Fx_backspace_delete_keys_p): In case we cannot determine + the answer, return `lambda', not nil. + +2005-12-17 Eli Zaretskii <eliz@gnu.org> + + * makefile.w32-in (bootstrap-temacs): Warn that parts of commands + enclosed in $(ARGQUOTE)s should not be split between two lines, as + that will break with GNU Make >3.80, when sh.exe is used and + arg quoting is with '..'. + +2005-12-17 Chong Yidong <cyd@stupidchicken.com> + + * print.c (print_preprocess): Just signal an error if print_depth + is exceeded. + +2005-12-17 Eli Zaretskii <eliz@gnu.org> + + * .gdbinit: Set a breakpoint on w32_abort. + +2005-12-16 Juri Linkov <juri@jurta.org> + + * minibuf.c (Fminibuffer_completion_contents): New Lisp function + created from minibuffer_completion_contents. + (minibuffer_completion_contents): Remove. + (do_completion, Fminibuffer_complete_word) + (Fminibuffer_completion_help): Replace minibuffer_completion_contents + with Fminibuffer_completion_contents. + (syms_of_minibuf): Add Sminibuffer_completion_contents. + (Fdisplay_completion_list): Doc fix. + (display_completion_list_1): Use `nil' for second arg of + `Fdisplay_completion_list'. + +2005-12-14 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xfns.c (compute_tip_xy): Handle negative dx and dy. + + * w32fns.c (compute_tip_xy): Ditto. + + * macfns.c (compute_tip_xy): Ditto. + +2005-12-14 Chong Yidong <cyd@stupidchicken.com> + + * print.c (print_preprocess): Go to a deeper print_depth to avoid + print_object loop. + +2005-12-14 Kyotaro HORIGUCHI <horiguti@meadowy.org> (tiny change) + + * coding.c (code_convert_region_unwind): GCPRO arg. + +2005-12-12 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xfns.c (compute_tip_xy): Calculate root_y the same way as root_x, + i.e. dy is offset from top of frame instead of bottom. + + * macfns.c (compute_tip_xy): Ditto. + + * w32fns.c (compute_tip_xy): Ditto. + + * gtkutil.c (SSDATA): New macro to remove compiler warnings. + (xg_get_image_for_pixmap, xg_create_frame_widgets) + (xg_get_file_with_chooser): Use SSDATA instead of SDATA. + + * xmenu.c (menubar_selection_callback): Do nothing if the callback + is for an unselected radio menu item. + +2005-12-11 Richard M. Stallman <rms@gnu.org> + + * xdisp.c (syms_of_xdisp) <blink-cursor-alist>: Doc fix. + + * lisp.h [! NO_UNION_TYPE] (EQ): Use == so args are computed just once. + + * keymap.c (Fset_keymap_parent, store_in_keymap): Use CHECK_IMPURE. + (Flookup_key): Doc fix. + (syms_of_keymap) <function-key-map>: Doc fix. + + * fns.c (Frequire): Treat evaluating from a source file + like loading the file. + + * floatfns.c (Flog): Doc fix. + + * fileio.c (Finsert_file_contents): Set Vdeactivate_mark + when we change the buffer. + +2005-12-11 Juri Linkov <juri@jurta.org> + + * minibuf.c (display_completion_list_1): + Call `minibuffer_completion_contents' instead of using `nil' as + second arg of `Fdisplay_completion_list'. + (keys_of_minibuf): Unbind SPC in + Vminibuffer_local_filename_completion_map (see also related + change on 2005-12-06). + +2005-12-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * emacs.c (main) [MAC_OS8]: Undo previous change. + + * macselect.c (syms_of_macselect) <mac-apple-event-map>: + Initialize to nil. Keymap is now created in lisp/term/mac-win.el. + +2005-12-10 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * Makefile.in (macselect.o): Depend on keymap.h. + + * emacs.c (main) [MAC_OS8]: Call syms_of_keymap before + syms_of_macselect. + + * image.c (init_image) [MAC_OS]: Don't call EnterMovies. + [!HAVE_GIF && MAC_OS] (gif_load): Call EnterMovies. + + * keyboard.c (Qmac_apple_event) [MAC_OS]: New variable. + (syms_of_keyboard) [MAC_OS]: Initialize it. + (make_lispy_event) [MAC_OS]: Build lisp event for MAC_APPLE_EVENT. + + * mac.c (Qundecoded_file_name): New variable. + (syms_of_mac): Initialize it. + (mac_aelist_to_lisp, mac_aedesc_to_lisp): New functions. + [TARGET_API_MAC_CARBON] (create_apple_event_from_event_ref): New fun. + (Fmac_coerce_ae_data): New defun. + (syms_of_mac): Defsubr it. + + * macselect.c: Include keymap.h. + (mac_ready_for_apple_events): New variable. + (Vmac_apple_event_map, Qmac_apple_event_class) + (Qmac_apple_event_id): New variables. + (syms_of_macselect): Initialize them. + (Qundefined, mac_store_apple_event): Add externs. + (struct apple_event_binding): New struct. + (find_event_binding_fun, find_event_binding) + (mac_find_apple_event_spec, defer_apple_events) + (mac_handle_apple_event, init_apple_event_handler) + (copy_scrap_flavor_data): New functions. + (Fmac_process_deferred_apple_events): New defun. + (syms_of_macselect): Defsubr it. + (mac_store_services_event): Fix extern. + (mac_handle_service_event): Don't allocate Lisp objects during + asynchronous input processing. Use mac_store_services_event + instead of mac_store_application_menu_event. + + * macterm.c (Qmac_ready_for_drag_n_drop, Qapplication, Qabout) + (Qpreferences): Remove variables. + (syms_of_macterm): Don't initialize them. + (Qhicommand) [USE_CARBON_EVENTS]: New variable. + (syms_of_macterm) [USE_CARBON_EVENTS]: Initialize it. + (init_required_apple_events, do_ae_open_application) + (do_ae_print_documents, do_ae_open_documents) + (do_ae_quit_application): Remove functions and prototypes. + (mac_ready_for_apple_events, Qundefined, init_apple_event_handler) + (mac_find_apple_event_spec): Add externs. + (mac_store_application_menu_event): Remove function. + (mac_store_apple_event, mac_make_lispy_event_code): New functions. + (mac_handle_command_event): Create Apple event from Carbon event. + Use mac_store_apple_event instead of mac_store_application_menu_event. + [MAC_OSX] (mac_store_services_event): Likewise. + (struct SelectionRange, SelectionRange): Remove struct and typedef. + [MAC_OS8] (main): Call init_apple_event_handler instead of + init_required_apple_events. + (mac_initialize) [MAC_OSX]: Likewise. + [!USE_CARBON_EVENTS] (mac_wait_next_event): + Use mac_ready_for_apple_events instead of Qmac_ready_for_drag_n_drop. + + * macterm.h (mac_make_lispy_event_code, mac_aedesc_to_lisp): + Add externs. + (create_apple_event_from_event_ref) [TARGET_API_MAC_CARBON]: Likewise. + (Fmac_get_preference): Add EXFUN. + + * termhooks.h (enum event_kind) [MAC_OS]: Add new MAC_APPLE_EVENT + event. + +2005-12-09 Richard M. Stallman <rms@gnu.org> + + * xfns.c (Fx_create_frame): Reinstate previous change. + +2005-12-09 Eli Zaretskii <eliz@gnu.org> + + * w32fns.c (w32_abort) [__GNUC__]: Add instructions for attaching + GDB to the abort dialog. + +2005-12-09 Kyotaro HORIGUCHI <horiguti@meadowy.org> (tiny change) + + * indent.c (Fvertical_motion): Force move if starting on + stretch glyph. + +2005-12-08 Richard M. Stallman <rms@gnu.org> + + * lread.c (read_escape) <\s>: Don't treat strings specially. + + * xfns.c (Fx_create_frame): Comment out previous change. + +2005-12-07 L$,1 q(Brentey K,Aa(Broly <lorentey@elte.hu> + + * xfns.c (Fx_create_frame): Initialize Vdefault_minibuffer_frame, + when needed. + +2005-12-06 Stefan Monnier <monnier@iro.umontreal.ca> + + * minibuf.c (keys_of_minibuf): Just unbind SPC in + Vminibuffer_local_filename_completion_map rather than forcing it + explicitly to the same binding as the global map. + +2005-12-06 Ken Raeburn <raeburn@gnu.org> + + * buffer.c (Fkill_buffer): Avoid dangerous side effects in NILP args. + * bytecode.c (Fbyte_code): Likewise. + * fileio.c (internal_delete_file, Fread_file_name_internal): Likewise. + * minibuf.c (Fminibuffer_complete_and_exit): Likewise. + * undo.c (truncate_undo_list): Likewise. + +2005-12-05 Richard M. Stallman <rms@gnu.org> + + * window.c (enlarge_window): Eliminate arg preserve_before. + Assume it is 0. All callers changed. + (Fenlarge_window, Fshrink_window): Likewise. + +2005-12-02 Eli Zaretskii <eliz@gnu.org> + + * w32fns.c (compute_tip_xy): Put tip above pointer if it doesn't + fit below. + +2005-12-02 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.h: Add prototype for xg_set_icon_from_xpm_data. + + * xfns.c (x_real_positions): int ign => unsigned int. + (xg_set_icon_from_xpm_data): Remove unused variable err. + (x_set_name_internal, Fx_create_frame, xg_set_icon): Add cast + to remove compiler warning. + (compute_tip_xy): Put tip above pointer if it doesn't fit below. + +2005-12-02 David Reitter <david.reitter@gmail.com> + + * minibuf.c (Fcompleting_read): If Vminibuffer_completing_file_name is + non-nil, use the new keymaps Vminibuffer_local_filename_completion_map + and Vminibuffer_local_must_match_filename_map keymaps. + (keys_of_minibuf): Bind SPC in the new file-name completion keymaps. + + * keymap.c (Vminibuffer_local_filename_completion_map) + (Vminibuffer_local_must_match_filename_map): New variables. + (syms_of_keymap): DEFVAR_LISP them, initialize them, and set their + parent to be Vminibuffer_local_completion_map and + Vminibuffer_local_must_match_map, respectively. + + * commands.h (Vminibuffer_local_filename_completion_map) + (Vminibuffer_local_must_match_filename_map): Declare the new keymaps. + +2005-12-01 Stefan Monnier <monnier@iro.umontreal.ca> + + * window.c (Fset_window_configuration): Don't accidentally copy the + window-point of one window to another. + +2005-11-30 L$,1 q(Brentey K,Aa(Broly <lorentey@elte.hu> + + * buffer.c (Fpop_to_buffer): Remove superfluous call to record_buffer. + +2005-11-30 Kim F. Storm <storm@cua.dk> + + * alloc.c: Include fcntl.h. Define O_WRONLY if not defined. + (valid_lisp_object_p) [!GC_MARK_STACK]: Validate pointer by + passing it to `emacs_write'. + +2005-11-29 Ari Roponen <arjuropo@cc.jyu.fi> (tiny change) + + * atimer.c (stop_other_atimers): Fix loop to correctly compute `prev'. + +2005-11-27 Richard M. Stallman <rms@gnu.org> + + * window.c (adjust_window_trailing_edge): New function. + (Fadjust_window_trailing_edge): New function. + (syms_of_window): Defsubr it. + (window_deletion_count): New variable. + (delete_window): Update window_deletion_count. + +2005-11-26 Eli Zaretskii <eliz@gnu.org> + + * minibuf.c (syms_of_minibuf): Mention the extension of + `completion-auto-help's meaning by complete.el. + +2005-11-26 Henrik Enberg <henrik.enberg@telia.com> + + * xfaces.c (Finternal_set_lisp_face_attribute_from_resource): + Handle :inherit property as a lisp expression. + +2005-11-24 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c (Qcontrol): Rename from Qctrl. All uses changed. + (syms_of_macterm): Staticpro Qcontrol, Qmeta, Qalt, Qhyper, + Qsuper, and Qmodifier_value. + (Vmac_control_modifier, Vmac_option_modifier) + (Vmac_command_modifier, Vmac_function_modifier) + (Vmac_emulate_three_button_mouse, Vmac_wheel_button_is_mouse_2) + (Vmac_pass_command_to_system, Vmac_pass_control_to_system) + (Vmac_charset_info_alist): Doc fixes. + +2005-11-23 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * emacs.c (main) [MAC_OSX]: Change working directory to home + directory if `-psn_*' option is specified. + + * mac.c (DECODE_UTF_8): Remove macro. + [TARGET_API_MAC_CARBON] (cfstring_to_lisp_nodecode): New function + created from cfstring_to_lisp. + [TARGET_API_MAC_CARBON] (cfstring_to_lisp): Use it. + (xrm_get_preference_database) [TARGET_API_MAC_CARBON]: Likewise. + + * macterm.h (cfstring_to_lisp_nodecode) [TARGET_API_MAC_CARBON]: + Add prototype. + +2005-11-21 Ken Raeburn <raeburn@gnu.org> + + * keymap.c (shadow_lookup): Use make_number to pass a number to + Fsubstring. + +2005-11-21 Juri Linkov <juri@jurta.org> + + * puresize.h (BASE_PURESIZE): Increment to 1180000. + +2005-11-20 Chong Yidong <cyd@stupidchicken.com> + + * xfaces.c (Finternal_set_lisp_face_attribute): + Use :ignore-defface for new frame defaults when `unspecified' is + supplied. + (Finternal_get_lisp_face_attribute): Hide :ignore-defface. + (merge_face_vectors): Don't do :ignore-defface overwriting here. + (Finternal_merge_in_global_face): Do it here. + +2005-11-20 Juri Linkov <juri@jurta.org> + + * charset.c (invalid_character): Use Lisp-readable syntax + for octal and hex. Reorder decimal, octal and hex values. + +2005-11-20 Nick Roberts <nickrob@snap.net.nz> + + * lisp.h: Use typedef when Lisp_Object is EMACS_INT so that + this type is recognised when debugging. + +2005-11-19 Andreas Schwab <schwab@suse.de> + + * .gdbinit (nextcons, xcdr, xfloat): Update for changes in + Lisp_Cons and Lisp_Float. + +2005-11-19 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c [USE_CG_TEXT_DRAWING] (cg_text_anti_aliasing_threshold): + New variable. + [USE_CG_TEXT_DRAWING] (init_cg_text_anti_aliasing_threshold): New fun. + (init_font_name_table) [USE_ATSUI && USE_CG_TEXT_DRAWING]: Use it. + [USE_CG_TEXT_DRAWING] (mac_draw_string_cg): Don't do antialiasing if + font size is smaller than or equal to cg_text_anti_aliasing_threshold. + +2005-11-17 Chong Yidong <cyd@stupidchicken.com> + + * image.c (x_create_bitmap_from_xpm_data): Free attributes on fail. + + * xfaces.c (Qignore_defface): New variable. + (syms_of_xfaces): Provide `:ignore-defface'. + (IGNORE_DEFFACE_P): New macro. + (check_lface_attrs, lface_fully_specified_p) + (Finternal_set_lisp_face_attribute) + (Fface_attribute_relative_p, Fmerge_face_attribute): + Handle Qignore_defface as a possible value. + (merge_face_vectors): The merged face is `unspecified' if the + mergee specifies `:ignore-defface'. + +2005-11-16 Stefan Monnier <monnier@iro.umontreal.ca> + + * lread.c (readevalloop): Add missing GCPROs. + +2005-11-16 Chong Yidong <cyd@stupidchicken.com> + + * xfns.c (xg_set_icon_from_xpm_data): New function. + + * gnu.h (gnu_xpm_bits): Rename from gnu_bits. + (gnu_xbm_bits): Rename from gnu_bits (xbm version). + + * xterm.c (x_bitmap_icon): Use the xpm if available. + + * image.c (x_create_bitmap_from_xpm_data): New function. + (x_create_bitmap_from_xpm_data): Initialize XpmAttributes. + +2005-11-15 Luc Teirlinck <teirllm@auburn.edu> + + * Makefile.in (lisp, shortlisp): Add rfn-eshadow. + +2005-11-16 Nick Roberts <nickrob@snap.net.nz> + + * .gdbinit: Make SIGTSTP work like SIGINT normally does. + +2005-11-15 Andreas Schwab <schwab@suse.de> + + * lisp.h (struct Lisp_Cons): Make cdr a union. + (XCDR_AS_LVALUE): Adjust. + (struct Lisp_Float): Make data a union. + (XFLOAT_DATA): Adjust. + + * alloc.c (free_float): Make free list chaining aliasing-safe. + (make_float): Likewise. + (free_cons): Likewise. + (Fcons): Likewise. + (check_cons_list): Likewise. + (Fmake_symbol): Likewise. + (allocate_misc): Likewise. + (free_misc): Likewise. + (gc_sweep): Likewise. + +2005-11-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * mac.c (HASHKEY_QUERY_CACHE): New define. + (xrm_create_database, xrm_q_put_resource): Empty query cache. + (xrm_get_resource): Use query cache. + + * image.c (init_image) [MAC_OS]: Don't call EnterMovies if + inhibit_window_system is set. + +2005-11-13 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macgui.h (USE_CG_TEXT_DRAWING): New define. + (struct MacFontStruct) [USE_CG_TEXT_DRAWING]: New members cg_font + and cg_glyphs. + + * macterm.c [USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function. + (x_draw_glyph_string_foreground) [USE_CG_TEXT_DRAWING]: Use it. + (XLoadQueryFont) [USE_CG_TEXT_DRAWING]: Set members cg_font and + cg_glyphs in struct MacFontStruct if synthesized bold or italic is + not used and font substitution never occurs for ASCII and Latin-1 + characters. + (XLoadQueryFont): Maximum and minimum metrics are now those among + ASCII characters. + (XLoadQueryFont) [!MAC_OS8 || USE_ATSUI]: Apply WebKit-style + height adjustments for Courier, Helvetica, and Times. + + * s/darwin.h (LIBS_CARBON) [!HAVE_CARBON]: Remove `-framework Carbon'. + +2005-11-11 David Reitter <david.reitter@gmail.com> + + * macterm.c (syms_of_macterm): Remove macCtrlKey, macShiftKey, + macMetaKey, macAltKey. Introduce Qctrl, Qmeta, + Vmac_control_modifier / mac-control-modifier, + Vmac_option_modifier / mac-option-modifier, + Vmac_command_modifier / mac-command-modifier. + (mac_to_emacs_modifiers): Use the new style modifier + variables. Return UInt32 (modifiers are longs now.) + (backtranslate_modified_keycode): New function (refactoring). + (XTread_socket): Use new modifier variables and refactored function. + (mac_determine_quit_char_modifiers): Remove macMetaKey (there is + no dedicated meta key. Not in use anyway.) + (convert_fn_keycode): Map Fn-keys to their original keycode + using a table (english keyboard only). + +2005-11-11 Kim F. Storm <storm@cua.dk> + + * .gdbinit (pitx): Fix output format if n_overlay_strings > 0. + Add post hook to "backtrace" to always dump lisp call stack to + increase chance of people sending it to us when reporting bugs. + + * doc.c (Fsubstitute_command_keys): Doc fix. + + * dispextern.h (struct it): New member ignore_overlay_strings_at_pos_p. + + * xdisp.c (handle_stop): Skip overlay string handling if + ignore_overlay_strings_at_pos_p is set. + (set_iterator_to_next): At end of display vector, set + ignore_overlay_strings_at_pos_p if dpvec came from an overlay + string, so we skip those overlay strings at current pos. + +2005-11-10 Lars Hansen <larsh@soem.dk> + + * fileio.c (file-regular-p): Doc fix. + +2005-11-10 Kim F. Storm <storm@cua.dk> + + * alloc.c (valid_lisp_object_p): New function to validate that + an object is really a valid Lisp_Object. + + * lisp.h (valid_lisp_object_p): Add prototype. + + * print.c (safe_debug_print): New function to be called from gdb + to print Lisp objects; use valid_lisp_object_p to avoid crashing + if user tries to print something which is not a Lisp object. + + * .gdbinit (pp, pp1): Use safe_debug_print. + (pv, pv1): New commands to print value of a lisp variable. + +2005-11-10 Nick Roberts <nickrob@snap.net.nz> + + * .gdbinit (pp1): New user-defined function. + +2005-11-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * image.c [MAC_OSX] (image_load_quartz2d): Fix memory leak. + + * mac.c [MAC_OSX] (init_mac_osx_environment): Reinitialize locale + related variables for dumped executable. + + * unexmacosx.c (unexec_write_zero): New function. + (copy_data_segment): Clear uninitialized local variables in + statically linked libraries. + + * s/darwin.h (C_SWITCH_SYSTEM): Remove -fno-common. + +2005-11-09 Juri Linkov <juri@jurta.org> + + * keymap.c (shadow_lookup): If Flookup_key returns a number, + call it again with a sub-key-sequence, and if its return value + is non-nil (sub-key is bound), return nil. + +2005-11-08 Kim F. Storm <storm@cua.dk> + + * process.c (Fsignal_process): Recognize signal names with and + without SIG prefix, e.g. SIGHUP and HUP. + + * search.c (search_buffer): No need to initialize base_pat. + +2005-11-04 Stefan Monnier <monnier@iro.umontreal.ca> + + * window.c (Fget_lru_window, Fget_largest_window, window_loop): + Don't abuse the `mini' arg. Use the `obj' arg instead. + +2005-11-04 Kim F. Storm <storm@cua.dk> + + * xdisp.c (show_mouse_face): Clear mouse face to eol. + +2005-11-03 Dan Nicolaescu <dann@ics.uci.edu> + + * Makefile.in (lisp, shortlisp): Add emacs-lisp/syntax.elc, + font-lock.elc and jit-lock.elc. + +2005-11-03 Richard M. Stallman <rms@gnu.org> + + * window.c (Fenlarge_window): Rename SIDE to HORIZONTAL. + (enlarge_window): Rename WIDTHFLAG to HORIZ_FLAG. + (CURBEG, CURSIZE): Use HORIZ_FLAG instead of WIDTHFLAG. + + * sheap.c (STATIC_HEAP_SIZE): Increment both definitions. + + * alloc.c (refill_memory_reserve): Move decl out of conditionals. + +2005-11-03 Stefan Monnier <monnier@iro.umontreal.ca> + + * window.c (Fdisplay_buffer): Fix last change to not use + a dedicated window. + +2005-11-01 Kim F. Storm <storm@cua.dk> + + * fringe.c (update_window_fringes): Undo 2005-10-27 change. + Instead, rotate the bottom angle bitmap 180 degrees to indicate + that the bottom row does not end in a newline. + +2005-11-01 Andreas Schwab <schwab@suse.de> + + * unexelf.c (unexec): Handle .plt section in BSS segment. + +2005-11-01 Stefan Monnier <monnier@iro.umontreal.ca> + + * lread.c (readevalloop): Yet another int/Lisp_Object mixup (YAILOM). + + * window.c (window_loop): For LRU and LARGEST, let the `mini' argument + determine whether to consider dedicated windows as well. + (Fget_lru_window, Fget_largest_window): Add `dedicated' argument. + (Fdisplay_buffer): Do consider dedicated windows in those cases where + we will split the window rather than reuse it. + Don't try to use windows on other displays. + +2005-10-31 Dan Nicolaescu <dann@ics.uci.edu> + + * puresize.h (BASE_PURESIZE): Increment to 1170000. + +2005-10-31 Romain Francoise <romain@orebokech.com> + + * macfns.c: Update copyright year. + * m/gould.h: Likewise. + +2005-10-30 Kim F. Storm <storm@cua.dk> + + * xdisp.c (display_line): Restore it->current_x and call + extend_face_to_end_of_line when last glyph doesn't fit on line. + (set_glyph_string_background_width): Remove specific tests here + to see if face background should extend to end of line. Simplify. + +2005-10-30 Richard M. Stallman <rms@gnu.org> + + * alloc.c (BYTES_USED): Use uordblks, not arena. + (bytes_used_when_reconsidered): New variable. + (emacs_blocked_free): Set that. + +2005-10-29 Chong Yidong <cyd@stupidchicken.com> + + * alloc.c (emacs_blocked_free): Fix typo. + +2005-10-29 Richard M. Stallman <rms@gnu.org> + + * data.c (Fmake_variable_frame_local): Doc fix. + + * xdisp.c (handle_fontified_prop): Do nothing if memory full. + (format_mode_line_unwind_data): New arg SAVE_PROPTRANS + controls whether to save and restore mode_line_proptrans_alist. + Callers changed. + (unwind_format_mode_line): Work with that feature. + (redisplay_internal): Don't call prepare_menu_bars if memory full. + (move_elt_to_front): New function. + (display_mode_element): Use move_elt_to_front. + Don't bother munging text props on a null string. + Delete obsolete elts from mode_line_proptrans_alist. + (decode_mode_spec): Test Vmemory_full, not spare_memory. + (Fformat_mode_line): Clear mode_line_proptrans_alist after saving. + + * lisp.h (memory_full_cons_threshold): Declare. + (internal_lisp_condition_case): Declare. + + * alloc.c (syms_of_alloc) <memory-full>: Doc fix. + (Fmemory_full_p): Function deleted. + (syms_of_alloc): Don't defsubr it. + (memory_full_cons_threshold): New variable. + (spare_memory): Now a vector of 7 elts. + (buffer_memory_full): Don't set Vmemory_full here. + (xfree): Don't try to refill here. + (emacs_blocked_free): Record BYTES_USED in local var. + (memory_full): Now free all the slots in spare_memory. + (refill_memory_reserve): Allocate each slot in spare_memory. + (init_alloc_once): Call refill_memory_reserve. + + * keyboard.c (command_loop_1): Don't set Vmemory_full here. + + * eval.c (internal_lisp_condition_case): New function. + (Fcondition_case): Use internal_lisp_condition_case. + (Feval): Test Vmemory_full and memory_full_cons_threshold. + (Ffuncall): Likewise. + + * bytecode.c (Fbyte_code): Use internal_lisp_condition_case. + +2005-10-29 Stefan Monnier <monnier@iro.umontreal.ca> + + * syntax.c (Fparse_partial_sexp): Fix docstring. + +2005-10-28 Romain Francoise <romain@orebokech.com> + + * puresize.h (BASE_PURESIZE): Increment to 1130000. + +2005-10-28 Richard M. Stallman <rms@gnu.org> + + * xfns.c (syms_of_xfns): Provide `x' as feature. + + * xdisp.c (decode_mode_spec): Define %e to indicate memory full. + + * editfns.c (Fformat): Don't include string padding + between info[n].start and info[n].end. + + * alloc.c (spare_memory): No longer static. + (xfree) [!SYSTEM_MALLOC]: Call refill_memory_reserve. + + * puresize.h (BASE_PURESIZE): Increment to 1120000. + +2005-10-27 Chong Yidong <cyd@stupidchicken.com> + + * data.c (Fmake_variable_frame_local): Add clarification to docstring. + + * fringe.c (update_window_fringes): Handle case where buffer ends + with a newline. + +2005-10-27 Kenichi Handa <handa@m17n.org> + + * coding.h (DECODE_SYSTEM): Fix argument name; name->str. + +2005-10-24 Kenichi Handa <handa@m17n.org> + + * charset.h (charset_mule_unicode_0100_24ff) + (charset_mule_unicode_2500_33ff, charset_mule_unicode_e000_ffff): + Extern them. + + * charset.c (charset_mule_unicode_0100_24ff) + (charset_mule_unicode_2500_33ff, charset_mule_unicode_e000_ffff): + New variables. + (Fsetup_special_charsets): Initialize them. + + * xterm.c (handle_one_xevent): Handle keysyms directly mapped to + supported Unicode characters. + +2005-10-25 Jason Rumney <jasonr@gnu.org> + + * w32fns.c (w32_to_x_font): Avoid forcing font widths. + +2005-10-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * image.c [MAC_OS] (image_load_qt_1): Check image size. + Use GraphicsImportGetImageDescription instead of + GraphicsImportGetNaturalBounds. + [MAC_OSX] (image_load_quartz2d): Check image size. + [MAC_OS] (xpm_load_image): Likewise. + + * macterm.c (last_mouse_glyph_frame): New var. + (note_mouse_movement): Say mouse moved if current frame differs + from last_mouse_glyph_frame, and update last_mouse_glyph_frame. + (XTmouse_position): Set last_mouse_glyph_frame. + (XTread_socket): Clear last_mouse_glyph_frame on mouse up/down event. + (mac_draw_string_common) [USE_ATSUI && WORDS_BIG_ENDIAN]: Fix typo. + Use EndianU16_BtoN. + (mac_draw_string_common) [MAC_OSX]: Don't use ATSUClearLayoutControls. + (x_per_char_metric, XLoadQueryFont) + [MAC_OS_X_VERSION_MAX_ALLOWED < 1020]: Use device origins to get + glyph bounds. + (mac_to_x_fontname, mac_do_list_fonts) + (mac_initialize_display_info): Change screen resolutions to 72dpi. + +2005-10-25 Masatake YAMATO <jet@gyve.org> + + * minibuf.c (Fdisplay_completion_list): Small doc fix. + +2005-10-24 Kim F. Storm <storm@cua.dk> + + * xterm.c: Undo 2005-10-23 change. + (last_mouse_glyph_frame): New var. + (note_mouse_movement): Say mouse moved if current frame differs + from last_mouse_glyph_frame, and update last_mouse_glyph_frame. + (XTmouse_position): Set last_mouse_glyph_frame. + (handle_one_xevent): Clear last_mouse_glyph_frame [instead of + last_mouse_glyph] on mouse up/down event. + + * editfns.c (Fcompare_buffer_substrings): Fix last change. + +2005-10-23 Stefan Monnier <monnier@iro.umontreal.ca> + + * editfns.c (Fcompare_buffer_substrings): Handle multibyte chars. + +2005-10-23 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.c (note_mouse_movement): Always call note_mouse_highlight + so tool tips don't interfere with press on tool bar button. + +2005-10-23 Richard M. Stallman <rms@gnu.org> + + * casetab.c (Fset_case_table): Doc fix. + + * lread.c (build_load_history): Replace STREAM arg with ENTIRE. + (readevalloop): Compute ENTIRE properly. + (syms_of_lread) <load-history>: Doc fix. + +2005-10-21 Richard M. Stallman <rms@gnu.org> + + * lread.c (Fload): Simplify gcpro structure. + Gcpro FOUND as well as FILE, but not EFOUND. + Unless preloading, record FOUND instead of FILE in Vload_history. + Rename repeat local FILE to MSG_FILE. + (syms_of_lread) <load-history>: Doc fix. + +2005-10-21 Kenichi Handa <handa@m17n.org> + + * search.c (boyer_moore): Add parens to fix and/or precedence bug. + +2005-10-20 Kim F. Storm <storm@cua.dk> + + * buffer.c (clone_per_buffer_values): Remove unused var tem. + (init_buffer): Remove unused vars dotstat, pwdstat. + + * ccl.c (check_ccl_update): Remove unused var vp. + + * fileio.c (auto_save_error): Call SAFE_FREE. + + * fns.c (Fchar_table_range): Remove unused var i. + + * minibuf.c (display_completion_list_1): New wrapper function + for Fdisplay_completion_list. + (Fminibuffer_completion_help): Use it. + + * term.c (encode_terminal_code): Remove unused var src_start. + + * window.c (Fwindow_tree): Remove unused var alist. + + * xterm.c (x_calc_absolute_position): Remove unused vars win_x, win_y. + +2005-10-20 Aubrey Jaffer <agj@alum.mit.edu> (tiny change) + + * unexelf.c (unexec): Fix calls to `fatal' with less than 3 arguments. + +2005-10-20 Olli Savia <ops@iki.fi> (tiny change) + + * syssignal.h [__Lynx__]: Undef SIGPOLL along with SIGIO. + +2005-10-20 Andreas Schwab <schwab@suse.de> + + * minibuf.c (Fdisplay_completion_list): Doc fix. + +2005-10-19 Kim F. Storm <storm@cua.dk> + + * image.c (check_image_size): Handle integer Vmax_image_size value + directly as max pixel value. Use default frame size for null frame. + (syms_of_image) <max-image-size>: Describe integer value. + +2005-10-19 Romain Francoise <romain@orebokech.com> + + * emacs.c (main): Update copyright year. + +2005-10-18 Chong Yidong <cyd@stupidchicken.com> + + * image.c (Vmax_image_size): New variable. + (check_image_size): New function. + (xbm_read_bitmap_data, pbm_load, png_load, jpeg_load, tiff_load) + (gif_load, gs_load): Use it. + (lookup_image): Try loading again if previous load failed. + (xbm_read_bitmap_data): Add a new argument, a pointer to the frame + to display in, NULL if none. + (xbm_load_image, xbm_file_p): Pass xbm_read_bitmap_data the new + argument. + +2005-10-18 Richard M. Stallman <rms@gnu.org> + + * search.c (Fstring_match): Doc fix. + +2005-10-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c (note_mouse_movement): Use PtInRect. + (XTread_socket): Also ignore mouse motion just before a button + release event. Don't process button release event when mouse is + not grabbed. + +2005-10-16 Masatake YAMATO <jet@gyve.org> + + * minibuf.c (Fdisplay_completion_list): Add new optional + argument COMMON_SUBSTRING. Bind `completion-common-substring' + to the optional argument during running `completion-setup-hook'. + +2005-10-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * mac.c [TARGET_API_MAC_CARBON] (get_cfstring_encoding_from_lisp): + Allow nil as argument. + [TARGET_API_MAC_CARBON] (Fmac_code_convert_string): Regard nil + for encoding arguments as UTF-16 in native byte order, no BOM. + + * macfns.c (Fx_create_frame): Add debugging code. + (Fx_show_tip): Set frame pixel width and height. + + * macterm.c (MAC_WINDOW_NORMAL_GC): Remove macro. + (FRAME_NORMAL_GC): New macro. + (mac_draw_line, mac_clear_area, mac_clear_window) + (mac_fill_rectangle, mac_draw_string, mac_draw_string_16) + (mac_draw_image_string, mac_draw_image_string_16): Rename from + XDrawLine, XClearArea, XClearWindow, XFillRectangle, XDrawString, + XDrawString16, XDrawImageString, and XDrawImageString16, respectively. + All uses changed. + (mac_draw_line, mac_erase_rectangle, mac_clear_area) + (mac_clear_window, mac_draw_bitmap, mac_draw_rectangle) + (mac_invert_rectangle, mac_draw_string_common, mac_draw_string) + (mac_draw_string_16, mac_draw_image_string) + (mac_draw_image_string_16, mac_copy_area, mac_copy_area_with_mask) + (mac_scroll_area): Drawing functions now take frame as destination. + All uses changed. + (mac_draw_string_common): Get port height with FRAME_PIXEL_HEIGHT. + (x_draw_fringe_bitmap): Set clipping area in face->gc. + + * macterm.h (mac_clear_area): Add extern. + +2005-10-14 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c (note_mouse_movement, XTread_socket): Apply 2005-10-14 + changes for xterm.c. + + * w32term.c (note_mouse_movement, w32_read_socket): Likewise. + +2005-10-14 Kenichi Handa <handa@m17n.org> + + * search.c (search_buffer): Give up BM search on case-fold-search + if one of a target character has a case-equivalence of different + charset even if that target charcter is an ASCII. + + * casefiddle.c (casify_object): Fix for the case that case + conversion change the byte length. + +2005-10-14 Kim F. Storm <storm@cua.dk> + + * xterm.c (note_mouse_movement): Return 1 if mouse moved; 0 otherwise. + (handle_one_xevent): Only clear help_echo_string; restore it if + note_mouse_movement didn't record any mouse movement. + + * xdisp.c (pos_visible_p): Convert w->hscroll to pixels before use. + (remember_mouse_glyph): Clear RECT if mouse is over an image glyph. + + * keyboard.c (make_lispy_position): Adjust wx for left margin if + ON_TEXT. + (Fposn_at_x_y): Fix calculation of x coordinate. + (Fposn_at_point): Return nil if point is hscrolled out of view. + +2005-10-13 Andreas Schwab <schwab@suse.de> + + * sysdep.c (request_sigio, unrequest_sigio): Do nothing in + non-interactive mode. + +2005-10-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * xterm.c, w32term.c, macterm.c (note_mouse_movement): Undo last change. + +2005-10-12 Kim F. Storm <storm@cua.dk> + + * xterm.c (handle_one_xevent): Clear last_mouse_glyph on mouse up/down. + +2005-10-12 Romain Francoise <romain@orebokech.com> + + * buffer.c (init_buffer): Rename `rc' to `len' for clarity. + +2005-10-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * xdisp.c (remember_mouse_glyph): Use MATRIX_BOTTOM_TEXT_ROW to + get end of text rows. Obtain header-line/mode-line rows directly. + + * xterm.c, w32term.c, macterm.c (note_mouse_movement): + Restore help_echo_string if mouse is moved inside last_mouse_glyph. + +2005-10-12 Kim F. Storm <storm@cua.dk> + + * xdisp.c (remember_mouse_glyph): New generic version based on + glyph_rect and remember_mouse_glyph from xterm.c enhanced to + properly handle all different window areas. + + * dispextern.h (remember_mouse_glyph): Add prototype. + + * xterm.c (glyph_rect, remember_mouse_glyph): Remove X versions. + (note_mouse_movement, XTmouse_position): Use generic + remember_mouse_glyph, add last_mouse_glyph arg. + + * w32term.c (note_mouse_movement): Fix last_mouse_glyph check. + (glyph_rect, remember_mouse_glyph): Remove w32 specific versions. + (note_mouse_movement, w32_mouse_position): Use generic + remember_mouse_glyph, add last_mouse_glyph arg. + + * macterm.c (note_mouse_movement): Add call to remember_mouse_glyph. + (glyph_rect, remember_mouse_glyph): Remove mac specific versions. + (XTmouse_position): Adapt to use generic remember_mouse_glyph + instead of pixel_to_glyph_coords. + + * window.c (coordinates_in_window): Fix x position for ON_RIGHT_MARGIN. + Fix x position for ON_TEXT when left margin width > 0. + +2005-10-11 Kim F. Storm <storm@cua.dk> + + * window.c (coordinates_in_window): Fix y position for ON_SCROLL_BAR. + + * keyboard.c (make_lispy_position): Fix buffer calculations for + mouse click or movement in right fringe and the margins. + +2005-10-11 Juanma Barranquero <lekktu@gmail.com> + + * image.c (fn_jpeg_stdio_src): Don't define it. + (init_jpeg_functions): Don't initialize `fn_jpeg_stdio_src'. + (our_common_init_source): Rename from `our_init_source'. + (our_common_term_source): Rename from `our_term_source'. + (our_memory_fill_input_buffer): Rename from + `our_fill_input_buffer'. + (our_memory_skip_input_data): Rename from `our_skip_input_data'. + (jpeg_memory_src): Use the new names. + (struct jpeg_stdio_mgr): New struct. + (JPEG_STDIO_BUFFER_SIZE): New constant. + (our_stdio_fill_input_buffer, our_stdio_skip_input_data) + (jpeg_file_src): New functions. + (jpeg_load): Use `jpeg_file_src' instead of `fn_jpeg_stdio_src'. + +2005-10-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c (PER_CHAR_METRIC): Remove unused macro. + (fm_font_family_alist): New variable. + (syms_of_macterm): Initialize and staticpro it. + (decode_mac_font_name): Replace '-' in family name with '_' if it + occurs just once. Lower family name. + (parse_x_font_name): Rename from x_font_name_to_mac_font_name. + All uses changed. Remove argument MF and code conversion for it. + Add argument SIZE. Rename argument MF_DECODED to FAMILY, and CS + to CHARSET. Parse font size. Lower family name. Return integer + value for status of parsing. + (init_font_name_table) [USE_ATSUI]: Use decode_mac_font_name. + Don't use Fdowncase because family name is already lowered by + decode_mac_font_name. + (init_font_name_table): Always call decode_mac_font_name. + Add pair of family name and its reference to fm_font_family_alist. + (mac_clear_font_name_table): Clear fm_font_family_alist. + (XLoadQueryFont): Move font size parsing part to parse_x_font_name. + Lookup fm_font_family_alist to get font family reference. + (XLoadQueryFont) [USE_ATSUI]: Don't use Fdowncase because family + name is already lowered by parse_x_font_name. + +2005-10-11 Kim F. Storm <storm@cua.dk> + + * xterm.c (glyph_rect): Return 0 if position is outside text area. + + * keyboard.c (make_lispy_position): Fix buffer position calculation for + mouse click or movement in fringe. + +2005-10-10 Jason Rumney <jasonr@gnu.org> + + * xterm.c (remember_mouse_glyph): New function. + (note_mouse_movement): Use it to remember the current glyph if changed. + (XTmouse_position): Fix calculation of fake glyph under mouse. + Move code to calculate glyph under mouse into remember_mouse_glyph. + +2005-10-10 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * emacs.c (USAGE3, standard_args): -nb => -nbi. + +2005-10-10 Juanma Barranquero <lekktu@gmail.com> + + * frame.c (Fredirect_frame_focus): Fix typos in docstring. + (next_frame, prev_frame, set_term_frame_name): Make static. + + * window.c (Fwindow_tree): Fix spelling. + +2005-10-09 Romain Francoise <romain@orebokech.com> + + * window.c (Fwindow_end): Don't try to redisplay if non-interactive. + +2005-10-09 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * emacs.c (standard_args): Remove options -i, -itype, --icon-type. + Add options -nb, --no-bitmap-icon. + + * xfns.c (Fx_create_frame): Make bitmapIcon have default on. + +2005-10-08 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macgui.h (MAX_CLIP_RECTS): New define. + (struct _XGC): New member clip_region. + (struct _XGC) [MAC_OSX && USE_ATSUI]: New members n_clip_rects and + clip_rects. + + * macterm.c (GC_CLIP_REGION): New macro. + (saved_port_clip_region): New variable. + (mac_begin_clip, mac_end_clip): New functions. + (XDrawLine, mac_erase_rectangle, mac_draw_bitmap, XFillRectangle) + (mac_draw_rectangle, mac_draw_string_common, mac_copy_area) + (mac_copy_area_with_mask, mac_scroll_area): Use them. + (mac_set_clip_rectangle, mac_reset_clipping): Remove functions. + [USE_ATSUI] (atsu_get_text_layout_with_text_ptr) + [MAC_OS_X_VERSION_MAX_ALLOWED < 1020]: Specify kATSLineFractDisable. + (mac_draw_string_common) [MAC_OSX && USE_ATSUI]: Clip to clipping + rectangles stored in gc. + (XFreeGC): Dispose of clipping region. + (mac_set_clip_rectangles, mac_reset_clip_rectangles): New functions. + (x_draw_fringe_bitmap, x_set_glyph_string_clipping) + (x_draw_relief_rect, x_draw_box_rect, x_draw_stretch_glyph_string) + (x_draw_glyph_string, x_clip_to_row, x_draw_hollow_cursor) + (x_draw_bar_cursor): Use them. + (x_set_glyph_string_clipping): Use get_glyph_string_clip_rects to + get multiple clipping rectangles. + + * macterm.h (mac_term_init): Add types to extern. + (struct mac_output): Remove members mWP and pending_menu_activation. + Put members scroll_bar_foreground_pixel and + scroll_bar_background_pixel in #if 0. + (FRAME_MAC_WINDOW, FRAME_X_WINDOW): Use window_desc. + + * xfaces.c (x_create_gc, x_free_gc) [MAC_OS]: Add BLOCK_INPUT. + Add debugging code. + +2005-10-08 Kim F. Storm <storm@cua.dk> + + * window.c (window_tree, Fwindow_tree): Rename fns added 2005-10-04. + +2005-10-07 Kim F. Storm <storm@cua.dk> + + * dispnew.c (redraw_overlapped_rows, redraw_overlapping_rows) + [!HAVE_WINDOW_SYSTEM]: Don't declare them... + (update_window) [!HAVE_WINDOW_SYSTEM]: ...and don't call them. + +2005-10-07 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * dispextern.h (struct glyph_string): Rename member for_overlaps_p + to for_overlaps. Now occupy 3 bits. + (OVERLAPS_PRED, OVERLAPS_SUCC, OVERLAPS_BOTH) + (OVERLAPS_ERASED_CURSOR): New defines. + (struct redisplay_interface): Add new OVERLAPS arg to member + fix_overlapping_area. + (x_fix_overlapping_area): Add new OVERLAPS arg. + (get_glyph_string_clip_rects): Add extern. + + * dispnew.c (redraw_overlapping_rows): + Call rif->fix_overlapping_area with new OVERLAPS arg as redrawn part. + + * xdisp.c: Rename member for_overlaps_p in struct glyph_string to + for_overlaps. + (get_glyph_string_clip_rects): New function created from + get_glyph_string_clip_rect. Set clipping rectangles according to the + value of for_overlaps. Enable to store multiple clipping rectangles. + (get_glyph_string_clip_rect): Use get_glyph_string_clip_rects. + (fill_composite_glyph_string, fill_glyph_string, draw_glyphs): + Rename argument OVERLAPS_P to OVERLAPS. All uses in macros changed. + (x_fix_overlapping_area): Add OVERLAPS arg. Pass it to draw_glyphs. + (draw_phys_cursor_glyph): Set width of erased cursor to use it for + calculating clipping rectangles later. Call x_fix_overlapping_area + with new OVERLAPS arg to draw only erased cursor area. + (expose_overlaps): Call x_fix_overlapping_area with new OVERLAPS arg + to draw overlaps in both preceding and succeeding rows. + + * xterm.c, w32term.c, macterm.c: Rename member for_overlaps_p in + struct glyph_string to for_overlaps. + +2005-10-04 Richard M. Stallman <rms@gnu.org> + + * alloc.c (refill_memory_reserve): Conditionalize the body, + not the function's existence. + +2005-10-04 Kim F. Storm <storm@cua.dk> + + * window.c (window_split_tree): New function. + (Fwindow_split_tree): New defun. + (syms_of_window): Defsubr it. + +2005-10-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c (mac_invert_rectangle): New function. + (XTflash): Use it. + +2005-10-04 Stefan Monnier <monnier@iro.umontreal.ca> + + * regex.h (re_char): Don't expose it in the interface. + (re_set_whitespace_regexp): Adjust the arg's type to not use it. + + * regex.c (re_char): Move it back here. + (re_set_whitespace_regexp): Change the arg's type to not use it. + + * keyboard.c (make_lispy_event): If point has moved between down and up + event, make it a drag, not a click, to mirror what + mouse-drag-region expects. + +2005-10-02 Dan Nicolaescu <dann@ics.uci.edu> + + * lisp.h (fatal): Undo previous change. + * term.c (fatal): Undo previous change. + +2005-10-01 Richard M. Stallman <rms@gnu.org> + + * xfaces.c (face_color_gray_p): Colors close to black count as gray. + +2005-10-01 Kim F. Storm <storm@cua.dk> + + * xdisp.c (try_window): Skip scroll-margin check if ZV is visible. + +2005-10-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * keyboard.c (init_keyboard) [MAC_OSX]: Don't install SIGINT handler. + + * macfns.c (start_hourglass): Apply 2005-05-07 change for xfns.c. + (x_create_tip_frame) [GLYPH_DEBUG]: Uncomment debugging code. + (Fx_create_frame, x_create_tip_frame) [USE_ATSUI]: + Try ATSUI-compatible 12pt Monaco font first. + + * macgui.h (struct _XCharStruct): New member valid_p. + (STORE_XCHARSTRUCT): Set valid_p. + (struct MacFontStruct) [USE_ATSUI]: New member mac_style. + + * macterm.c (mac_draw_string_common, x_per_char_metric) + (mac_compute_glyph_string_overhangs, init_font_name_table) + (XLoadQueryFont, mac_unload_font) [USE_ATSUI]: Add ATSUI support. + (atsu_get_text_layout_with_text_ptr) [USE_ATSUI]: New function. + (x_draw_glyph_string_background) + (x_draw_glyph_string_foreground) [MAC_OS8 && USE_ATSUI]: Don't use + XDrawImageString. Always draw background and foreground separately. + (x_draw_glyph_string_foreground) [USE_ATSUI]: Don't use 8-bit + functions for one-byte chars when using ATSUI-compatible fonts. + (atsu_font_id_hash) [USE_ATSUI]: New variable. + (syms_of_macterm) [USE_ATSUI]: Initialize and staticpro it. + (XLoadQueryFont): Set min_byte1, max_byte1, min_char_or_byte2, and + max_char_or_byte2 more in detail. + (quit_char_comp, mac_check_for_quit_char) [MAC_OSX]: Remove functions. + +2005-09-30 Dan Nicolaescu <dann@ics.uci.edu> + + * image.c (slurp_file, xbm_read_bitmap_data): Cast to the correct type. + * xterm.c (handle_one_xevent, handle_one_xevent): Likewise. + + * unexelf.c (fatal): Fix prototype. + + * term.c (fatal): Implement using varargs. + + * regex.c (re_char): Move typedef ... + * regex.h (re_char): ... here. + (re_iswctype, re_wctype, re_set_whitespace_regexp): New prototypes. + + * emacs.c (malloc_set_state): Fix return type. + (endif): Fix type. + + * lisp.h (fatal): Add argument types. + + * dispextern.h (fatal): Delete prototype. + + * systime.h (make_time): Prototype moved from ... + * editfns.c (make_time): ... here. + + * editfns.c: Move systime.h include after lisp.h. + * dired.c: + * xsmfns.c: + * process.c: Likewise. + + * alloc.c (old_malloc_hook, old_realloc_hook, old_realloc_hook): + Add parameter types. + (__malloc_hook, __realloc_hook, __free_hook): Fix prototypes. + (emacs_blocked_free): Change definition to match __free_hook. + (emacs_blocked_malloc): Change definition to match __malloc_hook. + (emacs_blocked_realloc): Change definition to match __realloc_hook. + +2005-09-30 Romain Francoise <romain@orebokech.com> + + * minibuf.c (Fread_buffer): Follow convention for reading from the + minibuffer with a default value. Doc fix. + +2005-09-29 Juri Linkov <juri@jurta.org> + + * editfns.c (Fmessage, Fmessage_box, Fmessage_or_box): + Rename argument name `string' to `format-string'. + (Fformat): Doc fix. + +2005-09-28 Kim F. Storm <storm@cua.dk> + + * image.c (gif_load): Fix size of allocated image buffer + for images where a sub-image may be larger than the image's + total height/width specifications. + +2005-09-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macgui.h (struct _XCharStruct): Each member now takes short value. + +2005-09-27 Dan Nicolaescu <dann@ics.uci.edu> + + * xfaces.c (lookup_derived_face): Add parameter type. + + * xdisp.c (cursor_row_fully_visible_p): Add parameter type. + + * marker.c (verify_bytepos): Add parameter type. + + * process.c (get_operating_system_release): Move prototype ... + + * systime.h (get_operating_system_release): ... here. + + * xterm.c (handle_one_xevent): Refer to union field to match the + type required by the function definition. + (set_vertical_scroll_bar): Move prototype ... + + * xterm.h: ... here. + + * fns.c (internal_equal, seed_random): Fix prototypes. + (internal_equal): Add missing parameter. + +2005-09-25 Richard M. Stallman <rms@gnu.org> + + * keyboard.c (update_menu_bindings): Variable deleted. + (syms_of_keyboard): Don't defvar it. + (parse_menu_item): Don't test it. + +2005-09-23 Richard M. Stallman <rms@gnu.org> + + * editfns.c (Fformat): Explicitly test for end of format string + and don't use `index'. + +2005-09-23 Dan Nicolaescu <dann@ics.uci.edu> + + * s/aix4-2.h (BROKEN_GET_CURRENT_DIR_NAME): + Define BROKEN_GET_CURRENT_DIR_NAME. + + * sysdep.c (get_current_dir_name): Also define if + BROKEN_GET_CURRENT_DIR_NAME. + + * m/ibmrs6000.h: Test for USG5, not USG5_4. + +2005-09-22 Kim F. Storm <storm@cua.dk> + + * xdisp.c (message_dolog): Add warning about GC and Lisp strings. + (message2): Fix commentary. Ok to use alloca'ed memory. + Still not ok to use Lisp string data (because of GC). + (set_message): Add comment why GC cannot happen. + +2005-09-22 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c (xlfdpat_block_match_1): Fix assertion. + (init_font_name_table) [TARGET_API_MAC_CARBON]: Don't add style + variants for a scalable font multiple times. + +2005-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * process.c (create_process) [RTU || UNIPLUS || DONT_REOPEN_PTY]: + Setup slave tty options before forking. + +2005-09-20 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (xg_set_geometry): Do a gtk_window_move if program + positions have been set for the frame (as is done for frames in + special-display-buffer-names). + +2005-09-19 Kim F. Storm <storm@cua.dk> + + * editfns.c (Fformat): Don't scan past end of format string that + ends in %. Reported by Johan Bockg,Ae(Brd. + +2005-09-18 Andreas Schwab <schwab@suse.de> + + * window.h (struct window): Remove height_fixed_p, no longer set. + + * window.c (make_window): Don't initialize height_fixed_p. + (window_fixed_size_p): Don't use it. + +2005-09-18 John Paul Wallington <jpw@pobox.com> + + * data.c (Fdefalias): Signal an error if SYMBOL is not a symbol. + +2005-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * Makefile.in (SOME_MACHINE_OBJECTS): Undo previous change. + + * macfns.c (image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]: + New variables. + [TARGET_API_MAC_CARBON] (Fx_file_dialog): Don't allow multiple + file selection. + + * sysdep.c [MAC_OS8]: Don't include stdlib.h. Include sys/param.h. + +2005-09-17 Eli Zaretskii <eliz@gnu.org> + + * Makefile.in (XMENU_OBJ) [!HAVE_CARBON]: Reinstate variable. + (obj): Use XMENU_OBJ, not a literal xmenu.o. + +2005-09-16 Romain Francoise <romain@orebokech.com> + + * fileio.c (syms_of_fileio) <write-region-inhibit-fsync>: Doc fix. + +2005-09-15 Richard M. Stallman <rms@gnu.org> + + * xdisp.c (overlay_arrow_at_row): Add HAVE_WINDOW_SYSTEM conditional. + (display_mode_element): Instead of `lisp_string' and `this', + record `offset' and increment that. + `last_offset' replaces `last'. + + * Makefile.in (XMENU_OBJ): Variable deleted. + (obj): Use xmenu.o unconditionally. + (SOME_MACHINE_OBJECTS): Delete xmenu.o. + + * emacs.c (main): Don't conditionalize syms_of_xmenu on HAVE_XMENU. + +2005-09-15 Kim F. Storm <storm@cua.dk> + + * xdisp.c (move_it_vertically): Don't try to fetch byte BEGV-1. + (reseat_at_next_visible_line_start): Likewise (in xassert). + +2005-09-14 Romain Francoise <romain@orebokech.com> + + * fileio.c (write_region_inhibit_fsync): New variable. + (Fwrite_region): Use it to skip call to fsync. + (syms_of_fileio): Initialize it. + +2005-09-14 Kenichi Handa <handa@m17n.org> + + * coding.c (code_convert_region_unwind): Argument format changed. + (run_pre_post_conversion_on_str): If pre-write-conversion function + changed the current buffer, delete the new buffer. + (run_pre_write_conversin_on_c_str): Likewise. + + * fileio.c (Fexpand_file_name): Check multibyteness of + default_directory. + +2005-09-13 Kenichi Handa <handa@m17n.org> + + * composite.c (compose_chars_in_text): Delete it. + + * composite.h (compose_chars_in_text): Delete extern. + +2005-09-13 Kim F. Storm <storm@cua.dk> + + * print.c (print_error_message): Fix last change. + +2005-09-12 Kim F. Storm <storm@cua.dk> + + * composite.c (compose_chars_in_text): Fix setup of `pend'. + Unconditionally reload `ptr' and `pend' after eval. + + * xdisp.c (message3): Pass copy of lisp string to message_dolog. + + * print.c (print_error_message): Pass copy of caller name to + message_dolog. + + * fileio.c (auto_save_error): Pass copy of lisp string to message2. + +2005-09-12 Kenichi Handa <handa@m17n.org> + + * xdisp.c (display_mode_element): Be sure to make variables THIS + and LISP_STRING point into a string data of ELT. + +2005-09-12 Kim F. Storm <storm@cua.dk> + + * editfns.c (Ftranslate_region_internal): Reload `tt' after + signal_after_change that may have GC'ed. + (Fmessage, Fmessage_box, Fmessage_or_box): Doc fix. + + * keymap.c (Fdescribe_buffer_bindings): Reload `translate' + after insert while runs signal_after_change. + + * minibuf.c (Fminibuffer_complete_word): Move `completion_string' + declaration to where it is used. + + * w32.c (check_windows_init_file): Fix allocation of error buffer. + + * xfns.c (x_encode_text): Declare static. Add FREEP arg. + (x_set_name_internal): Call x_encode_text with new FREEP arg to + know if xfree is needed instead of guessing. + + * xterm.h (x_encode_text): Remove prototype. + +2005-09-11 Chris Prince <cprince@gmail.com> (tiny change) + + * w32term.c (x_bitmap_icon): Load small icons too. + +2005-09-10 Romain Francoise <romain@orebokech.com> + + * buffer.c (init_buffer): Grow buffer to add directory separator + and terminal zero. Fix typos. + +2005-09-10 Eli Zaretskii <eliz@gnu.org> + + * buffer.c (init_buffer): Fix error message for failed call to + get_current_dir_name. + (get_current_dir_name): Remove prototype. + + * xsmfns.c (get_current_dir_name): Remove prototype. + + * lisp.h (get_current_dir_name) [!HAVE_GET_CURRENT_DIR_NAME]: + Add prototype. + + * sysdep.c [WINDOWSNT]: Add prototype for getwd. + Don't #undef NULL after including blockinput.h. + + * config.in: Regenerated. + +2005-09-10 Giuseppe Scrivano <gscrivano@gmail.com> + + Remove the MAXPATHLEN limitations: + + * sysdep.c (get_current_dir_name) [!HAVE_GET_CURRENT_DIR_NAME]: + New function. + + * buffer.c (init_buffer): Use it. + + * xsmfns.c (smc_save_yourself_CB): Ditto. + +2005-09-09 Kim F. Storm <storm@cua.dk> + + * doc.c (Fsubstitute_command_keys): Lookup key binding for + commands that are remapped from some other command. + + * xdisp.c (try_window_reusing_current_matrix): Clear mode_line_p + flag in disabled rows below the window. + + * frame.h (struct frame): New member updated_p. + + * xdisp.c (redisplay_internal): Mark updated frames in new updated_p + member. Remove local `updated' array and associated variables. + +2005-09-07 Kim F. Storm <storm@cua.dk> + + * xdisp.c (handle_display_prop): Respect overlay window property. + + * xdisp.c (try_window): Remove superfluous cursor_height calculation. + Fixes crash reported by YAMAMOTO Mitsuharu. + +2005-09-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c (struct xlfdpat_block, struct xlfdpat): New structs. + (xlfdpat_destroy, xlfdpat_create, xlfdpat_exact_p) + (xlfdpat_block_match_1, xlfdpat_match): New functions. + (xlfdpat_block_match): New macro. + (mac_to_x_fontname): Don't use tolower for non-ASCII characters. + (x_font_name_to_mac_font_name): Set coding.dst_multibyte to 0. + (add_font_name_table_entry): Increase font_name_table_size more + rapidly. + (mac_c_string_match): Remove function. + (mac_do_list_fonts): Use XLFD pattern match instead of regular + expression match. + + * xfaces.c (xstrlwr): Don't use tolower for non-ASCII characters. + +2005-09-03 Richard M. Stallman <rms@gnu.org> + + * xdisp.c (redisplay_internal): Make UPDATED as long as needed. + (move_it_in_display_line_to): Stop after last char on line even + on a windowing terminal, if that's the specified stop position. + + * fns.c (Fsort): Doc fix. + + * editfns.c (Fpropertize): Don't insist that properties be symbols. + +2005-09-02 Stefan Monnier <monnier@iro.umontreal.ca> + + * dired.c (directory_files_internal_unwind, directory_files_internal) + (file_name_completion): Use a Save_Value object rather than a cons of + two 16bit ints to store the DIR*. + (directory_files_internal, file_name_completion): Handle both EINTR and + EAGAIN consistently after `readdir'. + +2005-09-01 Stefan Monnier <monnier@iro.umontreal.ca> + + * intervals.c (update_interval): Add position info in error. + + * dispnew.c (window_to_frame_hpos, update_window): + Avoid gcc warning about unused variable `f'. + +2005-08-31 Jason Rumney <jasonr@gnu.org> + + * w32menu.c (add_menu_item): If unicode_append_menu returns an + error, revert to using AppendMenu. + +2005-08-31 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * image.c (PIX_MASK_DRAW, PIX_MASK_RETAIN): Remove argument. + All uses changed. + [MAC_OS] (XPutPixel, XGetPixel): Add efficient versions for common + cases. + (x_create_x_image_and_pixmap) [MAC_OS]: Don't call x_destroy_x_image. + [MAC_OS] (find_image_fsspec) [!MAC_OSX]: Don't use FSRef. + Use posix_pathname_to_fsspec. + [MAC_OS] (xpm_load_image): Fill in background_transparent field + while we have mask. + + * macgui.h [!TARGET_API_MAC_CARBON] (GetPixDepth): New define. + + * macterm.h (PIX_MASK_DRAW, PIX_MASK_RETAIN): Move defines to image.c. + +2005-08-29 Stefan Monnier <monnier@iro.umontreal.ca> + + * syntax.c (update_syntax_table): Properly reproduce the special +1 + setting of e_property at the end of the buffer when bumping into the + INTERVALS_AT_ONCE limit. + +2005-08-27 Eli Zaretskii <eliz@gnu.org> + + * emacs.c (USAGE1): Fix the description of the -Q option. + +2005-08-26 Stefan Monnier <monnier@iro.umontreal.ca> + + * xdisp.c (pos_visible_p): Yet another int/Lisp_Object mixup (YAILOM). + +2005-08-26 Kim F. Storm <storm@cua.dk> + + * xdisp.c (resize_mini_window): Fix 2005-08-20 change. + Don't move PT to new window start. + +2005-08-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * keyboard.c (kbd_buffer_get_event) [MAC_OS]: Make events for + ICONIFY/DEICONIFY_EVENT. + + * macterm.c (mac_copy_area, mac_copy_area_with_mask): + Restore background color. + (mac_handle_visibility_change): New function. + (x_make_frame_invisible, x_iconify_frame) + (XTread_socket) [!USE_CARBON_EVENTS]: Use it. + [USE_CARBON_EVENTS] (mac_handle_window_event) + (install_window_handler): Handle visibility change events. + (x_make_frame_visible): Don't reposition window if it is iconified + or asked for visible before. Select and uncollapse window when it + is made visible. + (x_make_frame_invisible): Don't reset x_highlight_frame. + (x_iconify_frame): Likewise. Make invisible frame visible before + it is iconified. + (read_socket_inev): Move variable outside #if USE_CARBON_EVENTS. + (do_window_update): Don't change visibility of invisible frame. + +2005-08-22 Juri Linkov <juri@jurta.org> + + * term.c (turn_on_face): Check for TS_set_foreground and + TS_set_background depending on standout_mode. Simplify. + +2005-08-21 Kim F. Storm <storm@cua.dk> + + * fringe.c (update_window_fringes): Only put TOP and BOTTOM + bitmaps on fully visible rows. + + * fringe.c (update_window_fringes): Replace FORCE_P arg with + KEEP_CURRENT_P arg; if non-zero, don't update current row fringes, + and return 0. + + * xdisp.c (redisplay_window): Call update_window_fringes with + KEEP_CURRENT_P non-0 if we are going to refresh fringes later. + +2005-08-20 Richard M. Stallman <rms@gnu.org> + + * xdisp.c (display_echo_area_1): Get display start pos from w->start. + (resize_mini_window): Set w->start, and PT, so as to display the tail + end of the buffer, if it doesn't all fit. + +2005-08-18 Kim F. Storm <storm@cua.dk> + + * xdisp.c (calc_pixel_width_or_height): Use actual display + resolution when available instead of Vdisplay_pixels_per_inch. + +2005-08-17 Kim F. Storm <storm@cua.dk> + + * xdisp.c (pos_visible_p): Adjust X value if window is hscrolled. + + * dispnew.c (buffer_posn_from_coords): Check that target row is + within matrix. + +2005-08-16 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.c (x_wm_set_icon_pixmap): Move GTK specific code to + xg_set_frame_icon and call it. + + * gtkutil.c (xg_set_frame_icon): New function. + + * gtkutil.h (xg_set_frame_icon): Declare it. + +2005-08-16 Kim F. Storm <storm@cua.dk> + + * dispnew.c (increment_row_positions): Skip non-enabled rows. + + * window.c (SAVED_WINDOW_VECTOR_SIZE): Remove dangerous define. + (Fcurrent_window_configuration): Use VECSIZE macro instead. + +2005-08-15 Richard M. Stallman <rms@gnu.org> + + * xdisp.c (message3_nolog): Clear echo_message_buffer. + +2005-08-15 Kim F. Storm <storm@cua.dk> + + * lisp.h (QUIT) [!SYNC_INPUT]: Throw t to Vthrow_on_input. + + * process.c (deactivate_process, status_notify, read_process_output) + (update_status, status_convert, decode_status, allocate_pty) + (make_process, remove_process, list_processes_1) + (create_process_1, unwind_request_sigio, read_process_output) + (send_process, keyboard_bit_set): Declare static. + (Fdelete_process): Simplify. Pass process to status_notify, so we + don't try to read output from it. + (status_notify): New arg deleting_process--don't try to read + output from that process. + + * lisp.h (deactivate_process, status_notify, read_process_output): + Remove prototypes. + +2005-08-14 Richard M. Stallman <rms@gnu.org> + + * image.c (syms_of_image): Init Qxbm, Qpbm before calling + define_image_type. + +2005-08-13 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (xg_get_pixbuf_from_pix_and_mask): New function. + (xg_get_image_for_pixmap): Move some code to + xg_get_pixbuf_from_pix_and_mask, and call it. + + * gtkutil.h (xg_get_pixbuf_from_pix_and_mask): Declare. + + * xterm.c (x_wm_set_icon_pixmap): Call xg_get_pixbuf_from_pix_and_mask + to get an GTK icon and set it with GTK functions to avoid having GTK + override an icon set with just X functions. + +2005-08-11 Richard M. Stallman <rms@gnu.org> + + * image.c (syms_of_image): Init image_types here, and call + define_image_type. + (init_image): Not here. + +2005-08-09 Richard M. Stallman <rms@gnu.org> + + * bytecode.c (BYTE_CODE_QUIT): Throw t to Vthrow_on_input. + + * lisp.h (QUIT): Throw t to Vthrow_on_input. + +2005-08-09 Thien-Thi Nguyen <ttn@gnu.org> + + * floatfns.c (Fexpt): Use floats for negative exponent. + +2005-08-08 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (xg_modify_menubar_widgets): Remove semicolon that + should not be there, causing menu display errors with GTK 2.6.9. + +2005-08-07 Richard M. Stallman <rms@gnu.org> + + * floatfns.c (Fexpt): Undo previous change. + + * dispnew.c (Fframe_or_buffer_changed_p): Take an arg + so it can be used with various state vectors. + + * emacs.c (endif): Convert -script into -scriptload. + (standard_args): Add -scriptload. Allow -basic-display with one dash. + + * fns.c (syms_of_fns): Add `emacs' to features. + + * term.c (set_terminal_modes): If no TS_termcap_modes string, + output newlines to scroll the old screen contents off the screen. + +2005-08-06 Thien-Thi Nguyen <ttn@gnu.org> + + * floatfns.c (Fexpt): Use floats for negative exponent. + Reported by D Goel. + +2005-08-02 Richard M. Stallman <rms@gnu.org> + + * frame.c (Fframe_char_width): Doc fix. + +2005-07-30 Juanma Barranquero <lekktu@gmail.com> + + * xdisp.c (syms_of_xdisp) <redisplay-end-trigger-functions>: + Defvar it. + +2005-07-28 Juanma Barranquero <lekktu@gmail.com> + + * w32fns.c (my_set_window_pos, my_show_window): Don't declare. + (my_create_window, my_create_tip_window): Make static. + + * w32term.c (my_show_window, my_set_window_pos, my_set_focus) + (my_set_foreground_window, my_destroy_window): Make static. + +2005-07-26 Paul Eggert <eggert@cs.ucla.edu> + + Merge gnulib getopt implementation into Emacs. + + * s/cygwin.h (C_SWITCH_SYSTEM): Remove, since gettext.h is + now part of lib-src. + +2005-07-26 Stefan Monnier <monnier@iro.umontreal.ca> + + * eval.c (Fdefvar): Allow (defvar enable-multibyte-characters). + +2005-07-25 Jason Rumney <jasonr@gnu.org> + + * w32menu.c (w32_menu_display_help): Suppress tooltip when + navigating menus with the keyboard. + +2005-07-23 Richard M. Stallman <rms@gnu.org> + + * insdel.c (syms_of_insdel): staticpro combine_after_change_buffer. + + * bytecode.c (MAYBE_GC): Test gc_cons_threshold and + gc_relative_threshold, one by one. + + * keyboard.c (read_char): Test gc_cons_threshold. + (syms_of_keyboard): staticpro Qecho_area_clear_hook. + + * eval.c (Feval, Ffuncall): Test gc_cons_threshold and + gc_relative_threshold, one by one. + + * alloc.c (gc_cons_threshold): Not static. + (gc_cons_combined_threshold): Var deleted. + (gc_relative_threshold): New variable. + (Fgarbage_collect, init_alloc_once): Compute gc_relative_threshold + instead of gc_cons_combined_threshold. + + * lisp.h (gc_cons_threshold, gc_relative_threshold): Declare. + (gc_cons_combined_threshold): Declaration deleted. + +2005-07-23 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * mac.c: Don't include stdlib.h or string.h. + (Fdo_applescript, Fmac_file_name_to_posix) + (Fmac_file_name_to_posix): Doc fixes. + [TARGET_API_MAC_CARBON] (Fmac_get_preference) + (Fmac_code_convert_string): Likewise. + [MAC_OSX] (init_mac_osx_environment): Fall back on terminal mode + if the executable is not contained in a bundle. + + * macfns.c: Don't include stdlib.h or string.h. Include atimer.h. + (gray_width, gray_height): Remove defines. + (gray_bits, gray_bitmap_width, gray_bitmap_height) + (gray_bitmap_bits): Remove variables. + (lispy_function_keys): Remove extern. + (free_frame_menubar): Add extern. + (x_window_to_frame): Remove function. + (unwind_create_tip_frame): Add declaration. + (x_set_name_internal): New function. + (x_set_name, x_set_title): Use it. + (Fx_create_frame, Fx_display_grayscale_p, Fx_display_pixel_width) + (Fx_display_pixel_height, Fx_display_planes) + (Fx_display_color_cells, Fx_server_max_request_size) + (Fx_server_vendor, Fx_server_version, Fx_display_screens) + (Fx_display_mm_height, Fx_display_mm_width) + (Fx_display_backing_store, Fx_display_visual_class) + (Fx_display_save_under, Fx_synchronize, Fx_show_tip): Doc fixes. + + * macmenu.c (Fx_popup_menu, Fx_popup_dialog): Doc fixes. + + * macselect.c (Fx_own_selection_internal): Follow error conventions. + (Fx_get_selection_internal, Fx_selection_owner_p) + (Fx_selection_exists_p): Doc fixes. + (syms_of_macselect) <selection-converter-alist>: Likewise. + +2005-07-21 Juanma Barranquero <lekktu@gmail.com> + + * buffer.c (syms_of_buffer) <cursor-type>: Doc fix. + + * ccl.c (Fregister_ccl_program): Fix typos in docstring. + (Fccl_execute_on_string): Likewise; add usage info. + + * composite.c (Fcompose_region_internal) + (Fcompose_string_internal): + Improve argument/docstring consistency. + + * minibuf.c (Fminibuffer_prompt_end, Feval_minibuffer): + Fix typos in docstrings. + + * textprop.c (Fnext_char_property_change) + (Fprevious_char_property_change): Doc fixes. + + * window.c (Fset_window_margins, Fset_window_fringes): + Improve argument/docstring consistency. + + * xfaces.c (Finternal_lisp_face_p): Doc fix. + +2005-07-21 Andreas Schwab <schwab@suse.de> + + * eval.c (restore_stack_limits): Return a value. + +2005-07-20 Juanma Barranquero <lekktu@gmail.com> + + * eval.c (Fdefvar): Doc fix. + +2005-07-20 Kim F. Storm <storm@cua.dk> + + * fileio.c (Fdo_auto_save, do_auto_save_unwind): + Use make_save_value to unwind protect stream. + + * lread.c (Fload, load_unwind): + Use make_save_value to unwind protect stream. + +2005-07-19 Juanma Barranquero <lekktu@gmail.com> + + * eval.c (Fprog2, Fcalled_interactively_p), + (syms_of_eval) <debug-on-quit>: Doc fixes. + (syms_of_eval) <max-specpdl-size>: + (Finteractive_p): Fix typos in docstrings. + +2005-07-19 Kim F. Storm <storm@cua.dk> + + * w32fns.c (Vx_hand_shape): Variable removed. + (syms_of_w32fns): Intern and staticpro Qw32_charset_default. + +2005-07-19 Kenichi Handa <handa@m17n.org> + + * fns.c (Fstring_as_multibyte): Escape backslashes in the docstring. + +2005-07-18 Stefan Monnier <monnier@iro.umontreal.ca> + + * buffer.h (Fgenerate_new_buffer_name): Declare (for use in coding.c). + +2005-07-18 Kim F. Storm <storm@cua.dk> + + * frame.h (struct frame): New member already_hscrolled_p. + + * xdisp.c (redisplay_internal): Only try to hscroll each frame once + to avoid redisplay looping hscrolling back and forth ad infinitum. + +2005-07-18 Juri Linkov <juri@jurta.org> + + * buffer.c (scroll-up-aggressively, scroll-down-aggressively): + * keymap.c (Fminor_mode_key_binding): + * macterm.c (mac-emulate-three-button-mouse): + Delete duplicate duplicate words. + +2005-07-18 Ken Raeburn <raeburn@gnu.org> + + * minibuf.c (Ftest_completion): Fix odd syntax in test. + +2005-07-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macfns.c (x_set_cursor_color): Use XSetBackground and XSetForeground. + + * macgui.h (struct _XGC): New struct. + (GC): Use it. + (GCForeground, GCBackground, GCFont): Use X11 mask values. + (XCreateGC, XParseGeometry): Move externs to macterm.h. + + * macterm.c (x_bitmap_icon, x_make_frame_visible): Remove declarations. + (XSetFont): Add declaration. + (mac_set_forecolor, mac_set_backcolor, mac_set_colors): + Remove functions. + (GC_FORE_COLOR, GC_BACK_COLOR, GC_FONT, MAC_WINDOW_NORMAL_GC): + New defines. + (XDrawLine, mac_draw_line_to_pixmap, XClearWindow) + (mac_draw_bitmap, XCreatePixmapFromBitmapData, XFillRectangle) + (mac_draw_rectangle, mac_draw_string_common, mac_scroll_area): + Use them. + (mac_erase_rectangle): New function. + (XClearArea, x_draw_fringe_bitmap, x_clear_glyph_string_rect) + (x_draw_stretch_glyph_string): Use it. + (XChangeGC, XCreateGC, XGetGCValues, XSetForeground) + (XSetBackground, XSetFont): Adjust for new GC implementation. + (x_draw_fringe_bitmap, x_draw_box_rect): Use GC to set colors. + (XTset_vertical_scroll_bar): Clear area under scroll bar. + + * macterm.h (struct mac_display_info): Change types of + scratch_cursor_gc black_relief.gc, and white_relief.gc to GC. + (XCreateGC, XParseGeometry): Move externs from macgui.h. + + * xfaces.c [MAC_OS] (XCreateGC): Remove extern. + +2005-07-16 Richard M. Stallman <rms@gnu.org> + + * buffer.c (Fmake_overlay): Doc fix. + +2005-07-16 Eli Zaretskii <eliz@gnu.org> + + * w32proc.c (syms_of_ntproc): staticpro Qhigh, Qlow, + Vw32_valid_locale_ids, and Vw32_valid_codepages. + +2005-07-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * mac.c [TARGET_API_MAC_CARBON] (Fmac_code_convert_string): + Use Fstring_as_unibyte instead of string_make_unibyte. + +2005-07-15 Richard M. Stallman <rms@gnu.org> + + * xdisp.c (select_frame_for_redisplay): Use find_symbol_value. + +2005-07-15 Kim F. Storm <storm@cua.dk> + + * xdisp.c: Fix redisplay loop in last change. + (IT_POS_VALID_AFTER_MOVE_P): New macro. + (move_it_vertically_backward, move_it_by_lines): Use it. + +2005-07-14 Jason Rumney <jasonr@gnu.org> + + * w32.c (init_environment): Default HOME directory to user's + appdata directory if possible. + +2005-07-14 Kim F. Storm <storm@cua.dk> + + * .gdbinit (pitx): Fix output format. Print string charpos. + + * lread.c (syms_of_lread): Initialize seen_list. + + * search.c (syms_of_search): Staticpro searchbuf.whitespace_regexp. + + * syntax.c (syms_of_syntax): Staticpro lisp objects in gl_state. + Staticpro re_match_object. + +2005-07-14 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macselect.c (get_scrap_target_type_list): Avoid NULL pointer + dereference. + + * macterm.c (mac_window_to_frame): Remove duplicate define. + +2005-07-14 Kenichi Handa <handa@m17n.org> + + * coding.c (code_convert_region_unwind): ARG is changed to a cons. + (code_convert_region): Adjust for the above change. + (set_conversion_work_buffer): If the work buffer is already in + use, generate a new buffer and return it. Otherwise return Qnil. + (run_pre_post_conversion_on_str): Adjust for the above change. + (run_pre_write_conversin_on_c_str): Likewise. + +2005-07-13 Kim F. Storm <storm@cua.dk> + + * xdisp.c (start_display): Don't reseat to next visible line start + if current start position is in a string or image. + (move_it_vertically_backward): Be sure to move out of strings and + images when moving it2 forward. + (move_it_by_lines): When moving forward, move to next buffer + position if we end up in a string or image. When moving backward, + count rows moved over when moving to start of current row in case + row starts in middle of a string or image. Also move further + backward if we end up in a string or image. + (try_cursor_movement): If overlay string spans multiple lines, + move backward to set cursor on start of an overlay string. + (cursor_row_p): Row is ok if cursor is at newline from string, but + string starts on this line (so we always position cursor at start + of string). + + * indent.c (Fvertical_motion): If start position is on an image, + don't move back if we move too far (that's almost certain to happen). + + * xdisp.c (cursor_row_fully_visible_p): Allow partially visible + row in minibuffer windows. + (try_window): Don't check margins in minibuffer windows. + +2005-07-13 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c: Don't include stdlib.h or composite.h. + (x_use_underline_position_properties, last_mouse_press_frame) + (x_noop_count, Qvendor_specific_keysyms): Remove unused variables. + (syms_of_macterm, mac_initialize): Don't initialize them. + (waiting_for_input, initial_argv, initial_argc) + (Vcommand_line_args, Vx_no_window_manager, errno, window_scroll) + (set_frame_menubar, path_from_vol_dir_name): Remove externs. + (extra_keyboard_modifiers): Fix type in extern. + (x_window_to_frame, x_window_to_scroll_bar): Remove declarations. + (x_scroll_bar_report_motion): Add argument types to declaration. + (mac_compute_glyph_string_overhangs): Add declaration. + (disable_mouse_highlight): Remove unused variable. + [USE_TOOLKIT_SCROLL_BARS] (construct_scroll_bar_click) + (x_scroll_bar_handle_press, x_scroll_bar_handle_release) + (x_scroll_bar_handle_drag): Remove argument `timestamp'. + All callers changed. + [USE_TOOLKIT_SCROLL_BARS] (construct_scroll_bar_click): Don't set + timestamp. + [USE_CARBON_EVENTS] (mac_handle_mouse_event): Likewise. + (x_scroll_bar_create, XTset_vertical_scroll_bar): Show scroll bar + only when its width is less than the height. + (XTredeem_scroll_bar): Sync with xterm.c. + (font_name_table, font_name_table_size, font_name_count): + Make static. + (drag_and_drop_file_list): Remove variable. Previous use is now + local to function. + (do_ae_open_documents): Move DRAG_N_DROP event construction part + from XTread_socket. + (XTread_socket): Consolidate setting of event timestamp. + Move DRAG_N_DROP event construction part to do_ae_open_documents. + Support extra_keyboard_modifiers. + + * xfaces.c (try_font_list) [MAC_OS]: Try font family name + beginning with that for ASCII. + +2005-07-13 Stefan Monnier <monnier@iro.umontreal.ca> + + * alloc.c (gc_cons_combined_threshold, Vgc_cons_percentage): New vars. + (Fgarbage_collect, init_alloc_once): Set gc_cons_combined_threshold. + (syms_of_alloc): Declare gc-cons-percentage. + + * eval.c (Feval, Ffuncall): + * keyboard.c (read_char): + * bytecode.c (MAYBE_GC): Use gc_cons_combined_threshold. + + * lisp.h (gc_cons_combined_threshold): Declare. + +2005-07-12 Kim F. Storm <storm@cua.dk> + + * coding.c (Qprocess_argument): + * coding.h (Qprocess_argument): Remove unused var. + + * xselect.c (intern): Remove dup. intern and staticpro for QTIMESTAMP. + +2005-07-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * mac.c [!TARGET_API_MAC_CARBON]: Include charset.h, coding.h, and + Endian.h. + [!MAC_OSX] (fchmod, fchown): New functions. + (mac_get_code_from_arg): Don't accept Lisp integer as argument. + Use SBYTES and EndianU32_BtoN. + (mac_get_object_from_code): Return 4 byte string even if argument + is 0. Use make_unibyte_string and EndianU32_NtoB. + (Fmac_get_file_creator, Fmac_get_file_type, Fmac_set_file_creator) + (Fmac_set_file_type): Fix documents and argument declarations. + Don't specify kFSCatInfoNodeFlags. Support Mac OS Classic. + +2005-07-11 Stefan Monnier <monnier@iro.umontreal.ca> + + * window.c (Frecenter): Yet another int/Lisp_Object mixup (YAILOM). + +2005-07-11 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xfaces.c (x_update_menu_appearance): Use fontSet resource for + Lucid if X_I18N, font otherwise. + +2005-07-10 Steven Tamm <steventamm@mac.com> + + * mac.c (Fmac_get_file_type, Fmac_get_file_creator): Add. + (Fmac_set_file_type, Fmac_set_file_creator): Add. + (mac_get_object_from_code, mac_get_code_from_arg): Add. + +2005-07-10 Richard M. Stallman <rms@gnu.org> + + * lread.c (Qeval_buffer_list, Veval_buffer_list): New vars. + (syms_of_lread): Set up eval-buffer-list. + (Feval_buffer, Feval_region): Bind eval-buffer-list. + +2005-07-08 Richard M. Stallman <rms@gnu.org> + + * eval.c (Fdefvar): Allow defvaring a constant to itself quoted. + +2005-07-08 Kim F. Storm <storm@cua.dk> + + * keyboard.c (menu_bar_items): Don't GCPRO menu_bar_items_vector here. + (syms_of_keyboard): Initialize and staticpro menu_bar_items_vector. + +2005-07-07 Kim F. Storm <storm@cua.dk> + + * window.c (Frecenter): Fix last change (set iarg before use). + +2005-07-06 Richard M. Stallman <rms@gnu.org> + + * window.c (Frecenter): When arg is inside the scroll margin, + move it out of the margin. + +2005-07-06 Jason Rumney <jasonr@gnu.org> + + * w32console.c (initialize_w32_display): Detect when the console + dimensions are insane, and default to 80x25 instead. + (w32_use_full_screen_buffer): Default to nil. + +2005-07-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c (mac_draw_vertical_window_border): Use foreground of + VERTICAL_BORDER_FACE_ID for vertical border line. + (mac_encode_char): Call check_ccl_update in advance. + (mac_to_x_fontname, x_font_name_to_mac_font_name) + (init_font_name_table, mac_do_list_fonts, XLoadQueryFont): + Don't assume that font family length is less than 32. + (x_compute_min_glyph_bounds): Make static. + (x_load_font): Never set fonts_changed_p to zero. + +2005-07-04 Lute Kamstra <lute@gnu.org> + + * Update FSF's address in GPL notices. + +2005-07-03 Richard M. Stallman <rms@gnu.org> + + * xdisp.c (try_window): Fix previous change in how it handles + a partially-visible line or one only partly past the margin. + + * window.c (window_scroll_pixel_based): Take account + of this_scroll_margin when finding point when scrolling up. + +2005-06-29 Ralf Angeli <angeli@iwi.uni-sb.de> + + * window.c (window_scroll_pixel_based, window_scroll_line_based): + Handle `scroll-preserve-screen-position' non-nil, non-t specially. + (syms_of_window) <scroll-preserve-screen-position>: Doc fix. + +2005-07-02 Juri Linkov <juri@jurta.org> + + * w32term.c (w32_draw_vertical_window_border): Use foreground of + VERTICAL_BORDER_FACE_ID for vertical border line. + +2005-07-02 Eli Zaretskii <eliz@gnu.org> + + * fileio.c (Fcopy_file): Rearrange the code that calls fchown and + fchmod so that chmod doesn't get called on MSDOS before the file + is closed. + +2005-07-01 Jason Rumney <jasonr@gnu.org> + + * w32term.c (cleartype_active): New flag for enabling sub-pixel + workaround. + (w32_initialize): Initialize it. + (w32_native_per_char_metric): Allow a couple of extra pixels when + Cleartype is active. + + * w32term.c (w32_initialize): Move check for screen reader here + from syms_of_w32term. + +2005-06-30 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.c (handle_one_xevent): bzero compose_status when nbytes + is not zero. + +2005-07-01 Masatake YAMATO <jet@gyve.org> + + * emacs.c (main): Passing ADD_NO_RANDOMIZE to `personality'. + +2005-06-30 Juri Linkov <juri@jurta.org> + + * xdisp.c (x_draw_vertical_border): If left fringe is not present + decrease x coord of vertical border by 1 pixel to not occupy text + area of the right window. + + * xterm.c (x_draw_vertical_window_border): Use foreground of + VERTICAL_BORDER_FACE_ID for vertical border line. + + * term.c (turn_on_face): In standout mode apply specified + fg to bg, and specified bg to fg (this makes the logic of + inversion on terminal consistent with X). + +2005-06-29 Juanma Barranquero <lekktu@gmail.com> + + * eval.c (user_variable_p_eh): New function. + (Fuser_variable_p): Use it. Clarify docstring. + Return t for aliases of user options, nil for alias loops. + +2005-06-27 Richard M. Stallman <rms@gnu.org> + + * eval.c (Fdefvar): Improve error message. + +2005-06-27 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c [USE_CARBON_EVENTS] (mac_convert_event_ref): Fix last + change. + +2005-06-27 Juanma Barranquero <lekktu@gmail.com> + + * eval.c (Fdefvar): Don't try to set constant symbols. + +2005-06-25 Richard M. Stallman <rms@gnu.org> + + * macfns.c (Fx_show_tip): Pass new arg to try_window. + + * w32fns.c (Fx_show_tip): Pass new arg to try_window. + + * xfns.c (Fx_show_tip): Pass new arg to try_window. + + * xdisp.c (try_window): New arg CHECK_MARGINS. Calls changed. + (redisplay_window): Handle try_window reporting point in scroll margin. + + * dispextern.h (try_window): Declare new arg. + + * fileio.c (Fcopy_file): New arg PRESERVE_UID_GID. + Use fchmod to copy the file modes. + (Frename_file): Don't copy UID and GID here; + instead, specify t for PRESERVE_UID_GID when calling Fcopy_file. + + * eval.c (call_debugger): Take full care of extending stack limits + to make space for the debugger, and restore the change afterward. + Bind debug-on-error to nil. + (restore_stack_limits): New subroutine. + (Fsignal): Extend specpdl bound along with eval depth bound, + for calling edebug. Don't do either one, for calling debugger. + (find_handler_clause): Don't bind debug-on-error here. + Don't unbind anything either. + Temporarily advance max_specpdl_size for calling + internal_with_output_to_temp_buffer. + (grow_specpdl): Don't alter max_specpdl_size before signaling + an error. + (syms_of_eval) <max-specpdl-size>: Doc fix. + + * lread.c (read1): 0.0e+NaN should make a "positive" NaN. + +2005-06-24 Eli Zaretskii <eliz@gnu.org> + + * fileio.c (Frename_file): Undo last change: no need to ifdef away + chown on DOS_NT platforms. + + * w32.c (sys_chown): New function. + + * s/ms-w32.h (chown): New; define to sys_chown. + +2005-06-24 Juanma Barranquero <lekktu@gmail.com> + + * xdisp.c (syms_of_xdisp) <nobreak-char-display>: Doc fix. + (syms_of_xdisp) <void-text-area-pointer>: Doc fix. + + * fileio.c (Frename_file)[!DOS_NT]: Don't call chown on MSDOS/Windows. + +2005-06-23 Richard M. Stallman <rms@gnu.org> + + * xdisp.c (get_next_display_element): Finish reversing the tests of + Vnobreak_char_display. + + * xdisp.c (Vnobreak_char_display): Rename from Vshow_nonbreak_escape. + All uses changed. + (Qnobreak_space): Rename from Qno_break_space. All uses changed. + (syms_of_xdisp): Define nobreak-char-display and nobreak-space. + + * fileio.c (Frename_file): Preserve owner and group, if possible, + when copying. + +2005-06-23 Juanma Barranquero <lekktu@gmail.com> + + * abbrev.c (Funexpand_abbrev): + * category.c (Fmake_category_set): + * dispnew.c (Fsleep_for, Fsit_for): + * editfns.c (Fsubst_char_in_region): + * eval.c (Fdefvar, Fdefconst, Feval, Ffuncall): + * frame.c (make_frame_without_minibuffer): + * lread.c (read_vector): + * macfns.c (check_x_frame): + * process.c (Fstop_process, Fcontinue_process): + * search.c (Freplace_match): + * syntax.c (Fstring_to_syntax): + * w32fns.c (check_x_frame, check_x_display_info): + * xfaces.c (x_supports_face_attributes_p): + * xselect.c (Fx_own_selection_internal): Follow error conventions. + + * image.c (fn_png_init_io): Don't define it. + (init_png_functions) [HAVE_NTGUI]: Don't initialize fn_png_init_io. + (png_read_from_file): New function, based on png_read_from_memory. + (png_load): Use it, instead of fn_png_init_io. + +2005-06-23 Kim F. Storm <storm@cua.dk> + + * search.c (Fmatch_data): Remove evaporate option. + (Fset_match_data): Do not mention evaporate option in doc string. + Add commentary explaining evaporate arg (for internal use only). + (unwind_set_match_data): Add comment on evaporate use. + +2005-06-22 Miles Bader <miles@gnu.org> + + * xfaces.c (Qvertical_border): Rename from `Qvertical_divider'. + (realize_basic_faces, syms_of_xfaces): Update references to it. + * dispextern.h (enum face_id): Rename `VERTICAL_DIVIDER_FACE_ID' + to `VERTICAL_BORDER_FACE_ID'. + * dispnew.c (build_frame_matrix_from_leaf_window): Update references. + +2005-06-21 Juri Linkov <juri@jurta.org> + + * dispextern.h: Add extern Qframe_set_background_mode. + + * xfaces.c: Rename obsolete function Qframe_update_face_colors to + Qframe_set_background_mode. + + * frame.c (Fmodify_frame_parameters): + Call frame-set-background-mode after changing the background color + on non-window non-dos branch. + +2005-06-21 Juanma Barranquero <lekktu@gmail.com> + + * fns.c (Fchar_table_range): + * process.c (Fmake_network_process): Fix spellings. + +2005-06-20 Kim F. Storm <storm@cua.dk> + + * fns.c (Fsort): Doc fix. + +2005-06-20 Miles Bader <miles@gnu.org> + + * xfaces.c (Qvertical_divider): New variable. + (realize_basic_faces): Realize its face. + (syms_of_xfaces): Initialize it. + + * dispextern.h (enum face_id): Add `VERTICAL_DIVIDER_FACE_ID'. + + * dispnew.c (build_frame_matrix_from_leaf_window): Display vertical + window-separator on ttys using `vertical-divider' face by default. + +2005-06-17 Richard M. Stallman <rms@gnu.org> + + * xdisp.c (get_next_display_element): + Reverse test of Vshow_nonbreak_escape. + + * term.c (produce_special_glyphs): Use spec_glyph_lookup_face. + (Ftty_no_underline): New function. + (syms_of_term): defsubr it. + + * keyboard.c (read_char): Call restore_getcjmp after jump occurs. + + * dispnew.c (spec_glyph_lookup_face): New function. + (build_frame_matrix_from_leaf_window): Use it. + + * dispextern.h (spec_glyph_lookup_face): Add declaration. + + * buffer.c (syms_of_buffer) <cursor-type>: Doc fix. + +2005-06-12 Richard M. Stallman <rms@gnu.org> + + * keyboard.c (read_char): After catching a longjmp, + call restore_getcjmp. + +2005-06-17 Juanma Barranquero <lekktu@gmail.com> + + * xselect.c (lisp_data_to_selection_data): Fix spelling. + +2005-06-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c (mac_compute_glyph_string_overhangs): Don't set + overhangs unless the given glyph type is noncomposite CHAR_GLYPH. + [USE_CARBON_EVENTS] (mac_convert_event_ref): Convert dead key down + events. + (XTread_socket): Don't pass keyboard events with the option + modifier to the system when Vmac_command_key_is_meta is nil or + Vmac_option_modifier is non-nil. + [USE_CARBON_EVENTS] (read_socket_inev): New variable. + [USE_CARBON_EVENTS] (init_command_handler): Fix argument. + [USE_CARBON_EVENTS] (mac_handle_mouse_event): New Carbon event + handler function. + (install_window_handler) [USE_CARBON_EVENTS]: Install it. + (XTread_socket) [USE_CARBON_EVENTS]: Move mouse wheel event + handler part to mac_handle_mouse_event. + +2005-06-14 Juanma Barranquero <lekktu@gmail.com> + + * eval.c (Fdefvaralias): Rename arguments SYMBOL and ALIASED to + NEW-ALIAS and BASE-VARIABLE, respectively. + +2005-06-13 Stefan Monnier <monnier@iro.umontreal.ca> + + * xdisp.c (note_mode_line_or_margin_highlight): Lisp_Object/int mixup. + (get_phys_cursor_geometry, format_mode_line_unwind_data) + (get_line_height_property, x_produce_glyphs): Remove unused vars. + + * coding.c (run_pre_post_conversion_on_str): Remove unused var `buf'. + +2005-06-13 Eli Zaretskii <eliz@gnu.org> + + * w32term.c (x_use_underline_position_properties): New variable. + (x_draw_glyph_string): Remind in a comment to change doc string of + x-use-underline-position-properties if/when underline positioning + is implemented. + (syms_of_w32term): DEFVAR_BOOL x-use-underline-position-properties, + and initialize it to nil. + +2005-06-12 Jason Rumney <jasonr@gnu.org> + + * w32fns.c (NEWOPENFILENAME): New struct. + (Fx_file_dialog): Use it to trick the system into giving us up to + date dialogs on systems that are documented to support it. + Do not set OFN_FILEMUSTEXIST flag if looking for a directory. + +2005-06-12 Eli Zaretskii <eliz@gnu.org> + + * w32fns.c (w32_abort): Use the MB_YESNO dialog instead of + MB_ABORTRETRYIGNORE. Never return, even if DebugBreak does. + +2005-06-11 Eli Zaretskii <eliz@gnu.org> + + * image.c (x_create_x_image_and_pixmap) [HAVE_NTGUI]: Cast 4th arg + to CreateDIBSection to avoid a compiler warning. + (pbm_load): Cast 3rd arg to IMAGE_BACKGROUND to avoid a compiler + warning. + (png_load): Cast return values of fn_png_create_read_struct and + fn_png_create_info_struct, to avoid compiler warnings on W32. + Cast 3rd arg to IMAGE_BACKGROUND and image_background_transparent + to avoid compiler warnings. + (jpeg_load): Cast return value of fn_jpeg_std_error to avoid a + compiler warning on W32. Cast 3rd arg to IMAGE_BACKGROUND to + avoid a compiler warning. + (tiff_load): Cast return values of fn_TIFFOpen and + fn_TIFFClientOpen to avoid compiler warning on W32. Cast 3rd arg + to IMAGE_BACKGROUND to avoid a compiler warning. + (gif_load): Cast return values of fn_DGifOpenFileName and + fn_DGifOpen to avoid compiler warnings on W32. Cast 3rd arg to + IMAGE_BACKGROUND to avoid a compiler warning. + (DrawText) [HAVE_NTGUI || MAC_OS]: If already defined, undef + before redefining. + + * w32bdf.c (create_offscreen_bitmap): Cast `bitsp' to `void **' in + the call to CreateDIBSection, to avoid a compiler warning. + +2005-06-11 Jason Rumney <jasonr@gnu.org> + + * w32fns.c (Fx_file_dialog): Unblock input before falling back to + minibuffer. + * macfns.c (Fx_file_dialog): Likewise. + +2005-06-10 Eli Zaretskii <eliz@gnu.org> + + * makefile.w32-in ($(TEMACS)): Depend on addsection.exe. + +2005-06-10 Juanma Barranquero <lekktu@gmail.com> + + * process.c (syms_of_process) [ADAPTIVE_READ_BUFFERING]: + * w32fns.c (syms_of_w32fns): Fix spellings. + +2005-06-10 Eli Zaretskii <eliz@gnu.org> + + * unexw32.c (COPY_CHUNK, COPY_PROC_CHUNK): Add a new argument + `verbose'; print diagnostic messages only if it is non-zero. + All callers changed to pass a zero value unless DEBUG_DUMP is defined + in the environment. + (copy_executable_and_dump_data): Print section names with %.8s. + +2005-06-10 Masatake YAMATO <jet@gyve.org> + + * xdisp.c (note_mode_line_or_margin_highlight): Call clear_mouse_face + when mouse_face is not given. + +2005-06-09 Luc Teirlinck <teirllm@auburn.edu> + + * window.c (Fselect_window): Adapt call to Fselect_frame. + + * lisp.h: Update EXFUN of Fselect_frame. + + * keyboard.c (command_loop_1): Adapt call to Fselect_frame. + + * frame.c (Fhandle_switch_frame, Fselect_frame): Delete unused arg + no_enter. + (Fset_mouse_position, Fset_mouse_pixel_position, Ficonify_frame): + Adapt to above change. + +2005-06-10 Juanma Barranquero <lekktu@gmail.com> + + * fns.c (Fmemq, Fmaphash): Doc fixes. + +2005-06-09 Juanma Barranquero <lekktu@gmail.com> + + * xfaces.c (Fdisplay_supports_face_attributes_p): + Fix typo in docstring. + +2005-06-08 Steven Tamm <steventamm@mac.com> + + * unexmacosx.c (copy_data_segment): Copy __la_sym_ptr2 section + used by gcc4 on intel mac. + +2005-06-09 Kim F. Storm <storm@cua.dk> + + * search.c (Fmatch_data): Add optional RESEAT arg. Unchain markers + in REUSE list if non-nil; free them if equal to evaporate. + (Fset_match_data): Add optional RESEAT arg. Unchain markers in LIST + if non-nil; free them if equal to evaporate. Use XCAR/XCDR. + (restore_search_regs): Rename from restore_match_data. Uses changed. + (unwind_set_match_data): New function. + (record_unwind_save_match_data): New function like save-match-data. + + * lisp.h (Fmatch_data, Fset_match_data): Fix EXFUN. + (record_unwind_save_match_data): Add prototype. + (restore_search_regs): Rename from restore_match_data. + + * composite.c (compose_chars_in_text): + * eval.c (do_autoload): + * macmenu.c (set_frame_menubar): + * process.c (read_process_output, exec_sentinel): + * xmenu.c (set_frame_menubar): + * xdisp.c (prepare_menu_bars, update_menu_bar, update_tool_bar): + * w32menu.c (set_frame_menubar): + Use record_unwind_save_match_data. + +2005-06-08 Richard M. Stallman <rms@gnu.org> + + * xdisp.c (get_next_display_element): Alter previous change: + Distinguish Vshow_nonbreak_escape = t or not t. + For t, use escape_glyph once again, as before previous change. + Use space or hyphen for display, instead of the non-ASCII char. + (syms_of_xdisp) <show-nonbreak-escape>: Doc fix. + + * process.c (Fstart_process): Don't touch command_channel_p slot. + + * process.h (struct process): Delete command_channel_p. + +2005-06-07 Masatake YAMATO <jet@gyve.org> + + * xdisp.c (note_mode_line_or_margin_highlight): + Check the overlapping of re-rendering area to avoid flickering. + (note_mouse_highlight): Call clear_mouse_face if PART + is not ON_MODE_LINE nor ON_HEADER_LINE. + +2005-06-07 Kim F. Storm <storm@cua.dk> + + * process.c: Improve commentary for adaptive read buffering. + +2005-06-06 Stefan Monnier <monnier@iro.umontreal.ca> + + * xterm.c (x_create_toolkit_scroll_bar): Use XtNarrowScrollbars + if available. + +2005-06-06 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * macmenu.c (menu_quit_handler, install_menu_quit_handler): + New functions for popping down menus on C-g. + (set_frame_menubar, mac_menu_show): Call install_menu_quit_handler. + + * macterm.c: Make mac_quit_char_modifiers and mac_quit_char_keycode + non-static. + + * config.in: Add HAVE_CANCELMENUTRACKING. + +2005-06-06 Eli Zaretskii <eliz@gnu.org> + + * w32heap.h (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_PTR): Remove macros. + + * unexw32.c (RVA_TO_PTR): Move here from w32heap.h. + + * w32proc.c (RVA_TO_PTR): New macro. + + * w32heap.c (RVA_TO_PTR): No need to #undef now. + + * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/w32select.$(O)): + Depend on w32heap.h. + +2005-06-06 Luc Teirlinck <teirllm@auburn.edu> + + * keyboard.c (command_loop_1): Update Vthis_original_command. + +2005-06-06 Richard M. Stallman <rms@gnu.org> + + * xmenu.c (popup_get_selection): Undo previous change. + +2005-06-06 Juri Linkov <juri@jurta.org> + + * xdisp.c (Qno_break_space): New variable. + (syms_of_xdisp): Initialize it. + (get_next_display_element): Add no-break space and soft hypen + codes for iso8859-2 and iso8859-5. Don't add `\' for them. + Use `no-break-space' face for no-break spaces. + +2005-06-06 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * window.c (delete_window): Handle the case where a h/vchild has + a h/vchild. + +2005-06-05 Eli Zaretskii <eliz@gnu.org> + + * w32.c (sys_setsockopt): Change arg 4 to `const void *'. In the + call to pfn_setsockopt, cast optval to `const char *'. + +2005-06-04 Eli Zaretskii <eliz@gnu.org> + + * w32.c (gettimeofday): Use struct _timeb, not struct timeb. + (open_unc_volume): Cast return value of map_w32_filename, to avoid + compiler warnings. + + * s/ms-w32.h (fileno): Don't define if already defined. + + * emacs.c: Include w32heap.h, to avoid compiler warning about sbrk. + + * makefile.w32-in (DOC): Define to point to the generated DOC-X. + +2005-06-04 Richard M. Stallman <rms@gnu.org> + + * xmenu.c (popup_get_selection): Click not in menu deactivates menu. + +2005-06-04 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * macmenu.c (cleanup_popup_menu): New function. + (Fx_popup_menu): Unwind protect cleanup_popup_menu in case + mac_menu_show Quit:s. + (mac_menu_show): Quit on cancel if not popped up on click (i.e. + a dialog). + +2005-06-04 Kim F. Storm <storm@cua.dk> + + * coding.c (decode_coding_string): Handle CODING_FINISH_INTERRUPT. + + * callproc.c (Fcall_process): Don't use alloca to gradually + increase size of buf, as it effectively uses twice the necessary + space on the stack. Instead, pre-allocate buf of full size, and + gradually increase the read size. + + * bytecode.c (BYTE_CODE_QUIT): Check Vthrow_on_input. + + * eval.c (unbind_to): Preserve value of Vquit_flag. + + * xterm.c (handle_one_xevent): Also ignore mouse motion just + before a button release event. + +2005-06-03 Juanma Barranquero <lekktu@gmail.com> + + * xfaces.c (Finternal_lisp_face_equal_p): Really report + on faces in a frame, if the argument FRAME is non-nil. + Improve argument/docstring consistency. + +2005-06-02 Kim F. Storm <storm@cua.dk> + + * xdisp.c (MODE_LINE_NOPROP_LEN): New macro. + (x_consider_frame_title, Fformat_mode_line): Save offset into + mode_line_noprop_buf rather than pointer, in case buffer is relocated. + +2005-06-01 Kim F. Storm <storm@cua.dk> + + * fns.c (mapcar1): Maybe exit loop if original sequence was modified. + +2005-06-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c (mac_to_x_fontname, mac_do_list_fonts): Set XLFD + resolution fields for scalable fonts to 0. + + * xfaces.c (build_scalable_font_name): Round pixel size to the + nearest integer. + +2005-06-01 Kim F. Storm <storm@cua.dk> + + * xdisp.c (display_mode_line): Support nested calls to redisplay + and format-mode-line. Set mode_line_target to MODE_LINE_DISPLAY. + +2005-05-31 Stefan Monnier <monnier@iro.umontreal.ca> + + * fileio.c (Finsert_file_contents): + * xdisp.c (note_mode_line_or_margin_highlight): Lisp_Object/int mixup. + +2005-05-31 Kim F. Storm <storm@cua.dk> + + * xdisp.c (mode_line_noprop_buf, mode_line_noprop_buf_end) + (mode_line_noprop_ptr): Rename from frame_title_*. + (store_mode_line_noprop_char): Rename from store_frame_title_char. + (store_mode_line_noprop): Rename from store_frame_title. + (mode_line_target): New enum to specify current output target + for mode line formatting. + (display_mode_element): Test it rather than frame_title_ptr and + mode_line_string_list to determine where output should go. + (mode_line_proptrans_alist, mode_line_string_alist): Make static. + (Vmode_line_unwind_vector): New variable. + (format_mode_line_unwind_data, unwind_format_mode_line): + New functions for unwind protection in mode line formatting. + (x_consider_frame_title): Use them and new local var 'title_start' + to support nested calls to format-mode-line and redisplay. + Set mode_line_target to MODE_LINE_TITLE. + (Fformat_mode_line): Use them and new local var 'string_start' to + support nested calls to format-mode-line and redisplay. + Set mode_line_target to MODE_LINE_NOPROP or MODE_LINE_STRING. + Don't trim trailing dashes. + (decode_mode_spec): Don't make infinite number of trailing dashes + for MODE_LINE_NOPROP and MODE_LINE_STRING targets. + (syms_of_xdisp): Initialize and staticpro mode_line_string_face, + mode_line_string_face_prop, and Vmode_line_unwind_vector. + (init_xdisp): Initialize mode_line_noprop_ptr to start of _buf. + Initialize mode_line_target to MODE_LINE_DISPLAY. + +2005-05-29 Richard M. Stallman <rms@gnu.org> + + * buffer.c (Fbuffer_local_value): Call indirect_variable. + +2005-05-28 Masatake YAMATO <jet@gyve.org> + + * xdisp.c (note_mode_line_or_margin_highlight): Change the + pointer to a hand cursor when hoovering over a mouse-face. + +2005-05-27 Kenichi Handa <handa@m17n.org> + + * xterm.c (x_encode_char): Call check_ccl_update in advance. + + * ccl.c: Now an element of Vccl_program_table is a vector of + length 4, not 3. + (ccl_get_compiled_code): New arg idx. Caller changed. + Adjust for the change of Vccl_program_table. + (setup_ccl_program): Adjust for the change of Vccl_program_table. + (check_ccl_update): New function. + (Fregister_ccl_program): Use ASET to set an element of a vector. + Adjusted for the change of Vccl_program_table. + + * ccl.h (struct ccl_program): New member idx. + (check_ccl_update): Extern it. + +2005-05-27 Juanma Barranquero <lekktu@gmail.com> + + * image.c (Vimage_library_alist): Move from image.el. + (syms_of_image): Defvar it. + (lookup_image_type): Use it. + + * buffer.c (Fbuffer_local_value): Make argument name match its use + in docstring. + +2005-05-26 Juanma Barranquero <lekktu@gmail.com> + + * keyboard.c (Frecursive_edit): Fix typo in docstring. + (Fposn_at_x_y): Make argument name match its use in docstring. + +2005-05-26 Lute Kamstra <lute@gnu.org> + + * eval.c (Frun_hooks): Mention run-mode-hooks in docstring. + +2005-05-24 Masatake YAMATO <jet@gyve.org> + + * xdisp.c (note_mode_line_or_margin_highlight): Use b and e + as loop sentinels. + +2005-05-24 Nick Roberts <nickrob@snap.net.nz> + + * xmenu.c (Fx_popup_dialog): Add a third boolean argument to + select frame title ("Question"/"Information"). + (xdialog_show): Use it. + + * macmenu.c (Fx_popup_dialog, mac_dialog_show): As for xmenu.c. + + * w32menu.c (Fx_popup_dialog, w32_dialog_show): As for xmenu.c. + + * fns.c (Fyes_or_no_p, Fy_or_n_p): Call Fx_popup_dialog with + a third argument (Qnil). + + * lisp.h: x-popup-dialog can have three arguments. + + * editfns.c (Fmessage_box): Use "Information" for frame title. + +2005-05-23 Thien-Thi Nguyen <ttn@gnu.org> + + * termcap.c [VMS]: Include <starlet.h>. + +2005-05-23 Masatake YAMATO <jet@gyve.org> + + * xdisp.c (note_mode_line_or_margin_highlight): Add code + for mouse-face. Change the type of the first argument from `window' + to `Lisp_Object'. + (note_mouse_highlight): Call note_mode_line_or_margin_highlight with + window instead of w. + +2005-05-22 Andreas Schwab <schwab@suse.de> + + * process.c (send_process): Move misplaced volatile. + +2005-05-21 Richard M. Stallman <rms@gnu.org> + + * xdisp.c (display_mode_element): If we're processing a list and + padding is specified, put it after the last element. + +2005-05-21 Eli Zaretskii <eliz@gnu.org> + + * fileio.c (Fexpand_file_name) [DOS_NT]: Don't try to support + "superroot" on DOS_NT systems. + +2005-05-21 David Hunter <hunterd42@comcast.net> (tiny change) + + * process.c (send_process): Restore the SIGPIPE handler if we + catch a SIGPIPE. + +2005-05-20 Juanma Barranquero <lekktu@gmail.com> + + * image.c (lookup_image, png_read_from_memory): Remove hacks (and + misleading comments). + (DEF_IMGLIB_FN): Use C calling convention for image libraries. + +2005-05-20 KOBAYASHI Yasuhiro <kobayays@otsukakj.co.jp> + + * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges): + Correct the right value. + +2005-05-19 Nick Roberts <nickrob@snap.net.nz> + + * keyboard.c (syms_of_keyboard): Remove Lisp variables + post-command-idle-hook and post-command-idle-delay. + (command_loop_1): Don't try to execute post-command-idle-hook. + +2005-05-16 Kim F. Storm <storm@cua.dk> + + * xdisp.c (handle_display_prop): Handle empty replacement. + (handle_single_display_spec): Return -1 for empty replacement. + + * keyboard.c (adjust_point_for_property): Skip empty overlay string. + + * .gdbinit (pitx): Print more info about iterator. + +2005-05-16 Andreas Schwab <schwab@suse.de> + + * unexmacosx.c (unexec_realloc): Move declarations before statements. + +2005-05-14 Richard M. Stallman <rms@gnu.org> + + * xdisp.c (message3): Call cancel_echoing. + + * alloc.c (Fmemory_full_p): New function. + (syms_of_alloc): defsubr it. + + * process.c (send_process_trap): Unblock SIGPIPE. + (send_process): Reset SIGPIPE handler before reporting error. + +2005-05-14 Nick Roberts <nickrob@snap.net.nz> + + * emacs.c (syms_of_emacs): Fix doc string for system-type. + +2005-05-13 Richard M. Stallman <rms@gnu.org> + + * fileio.c (Ffind_file_name_handler): Handle lambda-exp as handler. + (Finsert_file_contents): If we read 0 bytes from a special file, + unlock the visited file if we locked it. + (Fmake_symbolic_link, Frecent_auto_save_p): Doc fixes. + (Ffile_exists_p, Ffile_symlink_p): Doc fixes. + +2005-05-13 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * emacs.c (main) [MAC_OS8]: Call init_atimer before mac_term_init. + + * keyboard.c (readable_events) [USE_TOOLKIT_SCROLL_BARS]: + Regard toolkit scroll bar thumb drag events as squeezable and prevent + redisplay from being paused by them. + + * mac.c [!MAC_OSX]: Include keyboard.h and syssignal.h. + [!MAC_OSX] (target_ticks): Remove variable. + [!MAC_OSX] (check_alarm, pause, index): Remove functions. + [!MAC_OSX && __MRC__] (sys_strftime): Likewise. + [!MAC_OSX] (select): If fd 0 is not set in rfds and some input + event occurs before timeout, behave as if the function were interrupted. + [!MAC_OSX] (sigblock, sigsetmask, alarm): Simulate SIGALRM + handling using Time Manager routines. + [!MAC_OSX] (mac_atimer_task, mac_atimer_qlink, signal_mask): + New variables. + [!MAC_OSX] (mac_atimer_handler, set_mac_atimer, remove_mac_atimer) + (setitimer): New functions. + + * macfns.c, macmenu.c: Don't include signal.h. + + * macterm.c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds): + Rename from get_control_part_bound. All callers changed. + (x_scroll_bar_clear): New function. + (x_clear_frame): Use it. + (XTset_vertical_scroll_bar): Don't call Draw1Control. + (x_scroll_bar_handle_click): Change type of second argument from + int to ControlPartCode. + (check_alarm): Remove declaration. + (XTread_socket) [!TARGET_API_MAC_CARBON]: Don't call it. + (XTread_socket): Use ControlPartCode instead of SInt16. + +2005-05-13 Nozomu Ando <nand@mac.com> + + * unexmacosx.c: Include assert.h. + (MACOSX_MALLOC_MULT16): New define. + [MACOSX_MALLOC_MULT16] (ptr_in_unexec_regions): Determine whether + ptr is in unexec regions by checking it is multiple of 16. + (unexec_malloc_header_t): New typedef. + (unexec_malloc, unexec_realloc, unexec_free): Store and use + allocated size information in unexec_malloc_header. + +2005-05-10 Richard M. Stallman <rms@gnu.org> + + * xterm.c (noinclude): Add #undef. + + * image.c, xfns.c, xmenu.c: Don't include signal.h. + +2005-05-09 Juanma Barranquero <lekktu@gmail.com> + + * fileio.c (Fexpand_file_name, Frename_file, Fadd_name_to_file) + (Fmake_symbolic_link, Faccess_file, Frecent_auto_save_p): + Doc fixes. + + * dired.c (Ffile_name_completion): Make argument name + match its use in docstring. + +2005-05-08 Luc Teirlinck <teirllm@auburn.edu> + + * eval.c (Fdefvaralias): Remove any pre-existing + variable-documentation property of the alias. + +2005-05-07 Thien-Thi Nguyen <ttn@gnu.org> + + * xfns.c (start_hourglass): Do nothing when running on a tty. + +2005-05-07 Juanma Barranquero <lekktu@gmail.com> + + * fns.c (Fchar_table_range): Fix typos in docstring. + +2005-05-06 Stefan Monnier <monnier@iro.umontreal.ca> + + * fns.c (Fchar_table_range): Yet Another Int/Lisp_Object Mixup. + +2005-05-06 Eli Zaretskii <eliz@gnu.org> + + * lread.c (Flocate_file_internal): Doc fix. + + * Makefile.in (lisp, shortlisp): Add jka-cmpr-hook.elc. + +2005-05-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macselect.c (x_own_selection): Accept Lisp string as result of + selection converter function. + (x_clear_frame_selections): Don't call x-lost-selection-functions + if Emacs is not owner of the selection. + (Vmac_services_selection): Put variable and initialization in + #ifdef MAC_OSX. + (syms_of_macselect) [MAC_OSX]: Set default value of + Vmac_services_selection to PRIMARY. + + * macterm.c (toolkit_scroll_bar_interaction): Remove unused variable. + (mac_handle_tool_bar_click): Remove unused function and declaration. + [USE_TOOLKIT_SCROLL_BARS] (scroll_bar_timer_callback) + (install_scroll_bar_timer, set_scroll_bar_timer) + (control_part_code_to_scroll_bar_part, construct_scroll_bar_click) + (get_control_part_bound, x_scroll_bar_handle_press) + (x_scroll_bar_handle_release, x_scroll_bar_handle_drag) + (x_set_toolkit_scroll_bar_thumb): New functions and declarations. + [USE_TOOLKIT_SCROLL_BARS] (last_scroll_bar_part, scroll_bar_timer) + (scroll_bar_timer_event_posted_p): New variables. + [USE_TOOLKIT_SCROLL_BARS] (SCROLL_BAR_FIRST_DELAY) + (SCROLL_BAR_CONTINUOUS_DELAY): New macros. + (x_scroll_bar_create): Set control reference with NewControl. + (x_scroll_bar_create) [USE_TOOLKIT_SCROLL_BARS]: + Initialize track_top and track_height to nil. + (x_scroll_bar_set_handle, x_scroll_bar_note_movement): + Put functions in #ifndef USE_TOOLKIT_SCROLL_BARS. + (XTset_vertical_scroll_bar): Don't make space between scroll bar + and associated window. + (XTset_vertical_scroll_bar) [MAC_OSX]: Get scroll bar area width + from window config. + (XTset_vertical_scroll_bar) [USE_TOOLKIT_SCROLL_BARS]: + Set track_top and track_height to nil when scroll bar size is changed. + Recalculate them if they are nil. + (XTread_socket) [MAC_OSX]: Use control kind to determine if the + clicked control is a scroll bar. + (XTread_socket) [USE_TOOLKIT_SCROLL_BARS]: Use toolkit scroll bar + event handler functions. Don't add modifiers to scroll bar click + events. Call scroll bar release handler when window is deactivated. + (mac_initialize): Remove unused code for X toolkit. + (syms_of_macterm) [!USE_TOOLKIT_SCROLL_BARS]: + Initialize Vx_toolkit_scroll_bars to nil. + + * macterm.h (struct scroll_bar) [USE_TOOLKIT_SCROLL_BARS]: + New members track_top and track_height. + + * sysselect.h [DARWIN || MAC_OSX]: Temporarily undefine + init_process when including sys/select.h. + +2005-05-05 Luc Teirlinck <teirllm@auburn.edu> + + * eval.c (Fdefvaralias): Doc fix. + + * xmenu.c (Fx_popup_menu, Fx_popup_dialog): Doc fixes. + +2005-05-05 Kim F. Storm <storm@cua.dk> + + * buffer.c (init_buffer_once): Set cursor_in_non_selected_windows + default value. + (syms_of_buffer): Add default-cursor-in-non-selected-windows. + Fix type of cursor-in-non-selected-windows. + +2005-05-03 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * mac.c: #undef init_process so not to conflict with system headers. + +2005-05-02 Richard M. Stallman <rms@gnu.org> + + * buffer.c (syms_of_buffer): Define cursor-in-non-selected-windows. + + * buffer.h (struct buffer): Add cursor_in_non_selected_windows slot. + + * xdisp.c (Vcursor_in_non_selected_windows) + (Qcursor_in_non_selected_windows): Vars deleted. + (syms_of_xdisp): Don't initialize them. + (get_window_cursor_type): Use cursor_in_non_selected_windows + buffer slot. + +2005-05-02 Kim F. Storm <storm@cua.dk> + + * macros.c (executing_kbd_macro_index): Rename from + executing_macro_index. All uses changed. + (executing_kbd_macro_iterations): Rename from + executing_macro_iterations. All uses changed. + (executing_kbd_macro): Rename from executing_macro. + All uses changed. + (syms_of_macros): Rename Lisp var executing-macro-index to + executing-kbd-macro-index. + + * xdisp.c (move_it_in_display_line_to): Fix last change. + +2005-05-01 Luc Teirlinck <teirllm@auburn.edu> + + * xmenu.c (Fx_popup_menu): Doc fix. + + * charset.c (syms_of_charset): Delete defsubr for Schars_in_region. + +2005-05-02 Jason Rumney <jasonr@gnu.org> + + * emacs.c (USAGE3, USAGE4): Keep strings below 2048 bytes. + +2005-05-02 Nozomu Ando <nand@mac.com> + + * sysselect.h: Fix typo. + +2005-05-02 Nick Roberts <nickrob@snap.net.nz> + + * charset.c (Fchars_in_region): Remove as obsolete. + +2005-05-01 Kim F. Storm <storm@cua.dk> + + * xdisp.c (move_it_in_display_line_to): Stop if we move beyond + TO_CHARPOS. This may happen if last glyphs was an image or stretch + glyph. + +2005-05-01 Luc Teirlinck <teirllm@auburn.edu> + + * dispnew.c (sit_for): Vexecuting_macro -> Vexecuting_kbd_macro. + +2005-05-01 Richard M. Stallman <rms@gnu.org> + + * xmenu.c [not HAVE_X_TOOLKIT] (xmenu_show): + If user cancels the menu, quit unless FOR_CLICK. + + * macros.c (Vexecuting_kbd_macro): Rename from Vexecuting_macro. + All uses changed. + (syms_of_macros): Define only executing-kbd-macro, not executing-macro. + * keyboard.c: Change Vexecuting_macro to Vexecuting_kbd_macro. + * macros.h (Vexecuting_kbd_macro): Declare instead of Vexecuting_macro. + * commands.h (Vexecuting_kbd_macro): Likewise. + +2005-05-01 Thien-Thi Nguyen <ttn@gnu.org> + + * sysdep.c (get_frame_size) [VMS]: Use a fresh i/o channel. + +2005-04-30 Richard M. Stallman <rms@gnu.org> + + * fileio.c (Ffind_file_name_handler): Handle the `operations' + property of the file name handler. + (Qoperations): New variable. + (syms_of_fileio): Initialize and staticpro it. + + * xdisp.c (set_message_1): Delete xassert. + +2005-04-29 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * mac.c: Don't include time.h. Include sysselect.h after systime.h. + + * macfns.c (Fx_server_version): Add BLOCK_INPUT around Gestalt. + + * macgui.h [HAVE_CARBON && MAC_OSX]: Don't undefine/define mktime + before/after including Carbon.h if there is a working mktime. + +2005-04-28 Kim F. Storm <storm@cua.dk> + + * xfaces.c (resolve_face_name): Add arg SIGNAL_P. Calls changed. + Fix cyclic alias check. If alias loop is detected, signal + circular-list error if SIGNAL_P, and return Qdefault if !SIGNAL_P. + +2005-04-28 Lute Kamstra <lute@gnu.org> + + * eval.c (do_autoload): Record only autoloads in the autoload + property of symbols. + +2005-04-28 Nick Roberts <nickrob@snap.net.nz> + + * emacs.c (USAGE1): Add --basic-display and --quick options. + +2005-04-27 Kim F. Storm <storm@cua.dk> + + * data.c (syms_of_data) Staticpro Qcyclic_variable_indirection. + +2005-04-26 Richard M. Stallman <rms@gnu.org> + + * window.c (Fsame_window_p, Fspecial_display_p): Doc fixes. + (syms_of_window): Doc fixes. + + * indent.c (Fvertical_motion): Undo previous change. + +2005-04-26 Kenichi Handa <handa@m17n.org> + + * fns.c (char_table_range): New function. + (Fchar_table_range): Signal an error if characters in the range + have inconsistent values. Don't check the parent. + +2005-04-25 Kenichi Handa <handa@m17n.org> + + * fontset.c (fontset_set): Fix previous change. + +2005-04-24 Richard M. Stallman <rms@gnu.org> + + * indent.c (Fvertical_motion): Bind fontification-functions to nil. + +2005-04-24 Eli Zaretskii <eliz@gnu.org> + + * regex.c (re_search_2, re_match_2_internal): Convert second arg + of RE_TRANSLATE to int, to shut up GCC warnings. + + * fileio.c (Fcopy_file): Doc fix. + [MSDOS]: Fix call to emacs_open: buffer_file_type not defined and + not needed. + +2005-04-24 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * Makefile.in [HAVE_CARBON] (MAC_OBJ): Add macselect.o. + (SOME_MACHINE_OBJECTS): Likewise. + (mac.o): Depend on ccl.h. + (macselect.o): New target. + + * emacs.c (main) [MAC_OS8 || MAC_OSX && HAVE_CARBON]: + Call syms_of_macselect. + + * frame.c (Fdelete_frame) [MAC_OS]: Call x_clear_frame_selections. + + * mac.c [!TARGET_API_MAC_CARBON]: Don't include charset.h or coding.h. + (QCLIPBOARD): Remove variable. + (syms_of_mac): Don't initialize it. + (Fmac_paste_function, Fmac_cut_function, Fx_selection_exists_p): + Remove functions. + (syms_of_mac): Don't defsubr them. + [TARGET_API_MAC_CARBON] (Qmime_charset, QNFD, QNFKD, QNFC, QNFKC) + (QHFS_plus_D, QHFS_plus_C): New variables. + (syms_of_mac) [TARGET_API_MAC_CARBON]: Initialize them. + [TARGET_API_MAC_CARBON] (get_cfstring_encoding_from_lisp) + (cfstring_create_normalized): New functions. + [TARGET_API_MAC_CARBON] (Fmac_code_convert_string): Likewise. + (syms_of_mac) [TARGET_API_MAC_CARBON]: Defsubr it. + + * macterm.c (handling_window_update, terminate_flag): + Remove variables. + (do_window_update, do_ae_quit_application, XTread_socket): + Don't use them. + (WNE_SLEEP_AT_SUSPEND, WNE_SLEEP_AT_RESUME): Don't define. + [USE_CARBON_EVENTS && MAC_OSX] (mac_handle_service_event) + (init_service_handler): Move to macselect.c. Remove declarations. + [USE_CARBON_EVENTS && MAC_OSX] (init_service_handler): Add extern. + (Qapplication, Qabout): New variables. + (syms_of_mac): Initialize them. + [USE_CARBON_EVENTS && MAC_OSX] (Qpreferences, Qservices, Qpaste) + (Qperform): New variables. + (syms_of_mac) [USE_CARBON_EVENTS && MAC_OSX]: Initialize them. + (do_get_menus) [TARGET_API_MAC_CARBON]: Don't call AppendResMenu. + (do_menu_choice): Unhighlight menu bar also when menu_id is 0. + (mac_store_application_menu_event, init_menu_bar): New functions. + [USE_CARBON_EVENTS] (mac_handle_command_event) + (init_command_handler): New functions. + (mac_handle_window_event): Return noErr on window update event. + (do_ae_quit_application): Call mac_store_application_menu_event. + (mac_initialize) [USE_CARBON_EVENTS]: Call init_command_handler + and init_menu_bar. + + * macterm.h (x_clear_frame_selections): Add extern. + + * macselect.c: New file for selection processing on Mac OS. + +2005-04-23 Richard M. Stallman <rms@gnu.org> + + * fileio.c (Fcopy_file): New arg MUSTBENEW. + (Frename_file): Pass new arg to Fcopy_file. + + * window.c (window_size_fixed): Variable deleted. + (syms_of_window): Initialize window-size-fixed to nil. + But don't DEFVAR window_size_fixed. + +2005-04-23 Andreas Schwab <schwab@suse.de> + + * m/macppc.h (LD_SWITCH_MACHINE) [LINUX]: Don't define. + (START_FILES, LIB_STANDARD) [LINUX && _ARCH_PPC64]: Override to + use lib64 instead of lib. + (_LP64) [_ARCH_PPC64]: Define if not defined. + +2005-04-23 David Hunter <hunterd42@comcast.net> (tiny change) + + * s/ms-w32.h (HAVE_PWD_H): Define. + +2005-04-22 Kenichi Handa <handa@m17n.org> + + * fns.c (copy_sub_char_table): Explicitly copy the default value + of the sub-chartable. + + * fontset.c (fontset_set): When a sub-chartable is created, + explicitly sets the defalt value. + +2005-04-22 Kim F. Storm <storm@cua.dk> + + * fns.c (Fplist_get): Replace by Fsafe_plist_get. + (Fsafe_plist_get): Rename to Fplist_get. + (Fsafe_get): Remove, as Fget now uses safe Fplist_get. + (defsubr): Remove defsubr for Fsafe_plist_get and Fsafe_get. + + * lisp.h (Fsafe_plist_get, Fsafe_get): Remove EXFUN. + + * xdisp.c (store_mode_line_string, produce_stretch_glyph) + (note_mode_line_or_margin_highlight, note_mouse_highlight): + Use Fplist_get instead of Fsafe_plist_get. + + * xfaces.c (resolve_face_name): Use Fget instead of Fsafe_get. + +2005-04-21 Miles Bader <miles@gnu.org> + + * xdisp.c (dump_glyph_row): Don't display overlay_arrow_p field. + +2005-04-20 Thien-Thi Nguyen <ttn@gnu.org> + + * sysdep.c: Remove reference to defunct vms-pwd.h. + * dired.c: Likewise. Also, for pwd.h, use HAVE_PWD_H, not !VMS. + * editfns.c, fileio.c, filelock.c, sysdep.c, xrdb.c: Likewise. + + * config.in: Regenerate. + +2005-04-20 Kenichi Handa <handa@m17n.org> + + * lisp.h (CHAR_TABLE_DEFAULT_SLOT_ASCII): New macro. + (CHAR_TABLE_DEFAULT_SLOT_8_BIT_CONTROL): New macro. + (CHAR_TABLE_DEFAULT_SLOT_8_BIT_GRAPHIC): New macro. + + * alloc.c (make_sub_char_table): Argument changed to initial + value of the slots. + + * data.c (Faref): Handle special slots used as default values of + ascii, eight-bit-control, eight-bit-control. Don't ignore a + default value set for a group of characters. + (Faset): Signal an error if IDXVAL is not a valid character code. + Make a sub-chartable with correct initial value. + + * fns.c (Fset_char_table_range): Don't set slots used as default + values for ascii, eight-bit-control, eight-bit-graphic. + Don't call Faref with charset-id. + (Fset_char_table_default): Document how to treat normal character + argument. Handle special slots used as default values of ascii, + eight-bit-control, eight-bit-control. Make a sub chartable if + necessary. + +2005-04-20 Kenichi Handa <handa@m17n.org> + + * search.c (boyer_moore): Fix previous change. + +2005-04-19 Kim F. Storm <storm@cua.dk> + + * xdisp.c (setup_for_ellipsis): Reset saved_face_id to use default + face unless last visible char and first invisible char have the + same face. Also use default face if saved_face_id is undefined. + +2005-04-19 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macgui.h (MacFontStruct): Remove member `fontname'. Add member + `full_name'. + [TARGET_API_MAC_CARBON] (MacFontStruct): Use type int for + mac_scriptcode member. + + * macterm.c (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables. + (syms_of_mac): Don't initialize them. + (Vmac_charset_info_alist): New variable. + (syms_of_mac): Defvar it. + (create_text_encoding_info_alist): New function. + (decode_mac_font_name, mac_to_x_fontname) + (x_font_name_to_mac_font_name, init_font_name_table): Don't hard + code the correspondence among XLFD charsets, Mac script codes, and + Emacs coding systems. Use Vmac_charset_info_alist and result of + create_text_encoding_info_alist instead. + (init_font_name_table) [TARGET_API_MAC_CARBON]: Use Font Manager + routines also on Mac OS Classic. + (init_font_name_table) [!TARGET_API_MAC_CARBON]: + Use add_font_name_table_entry. + (mac_do_list_fonts): Regard 0 in XLFD scaleble fields as + specified. Derive unspecified scalable fields from specified one. + (x_list_fonts): Consider Valternate_fontname_alist. + (kDefaultFontSize): Change value from 9 to 12. + (XLoadQueryFont): Get decoded font family, font face, and charset + from x_font_name_to_mac_font_name. Set full name of loaded font. + (mac_unload_font): Free `full_name' member. + (x_load_font): Don't try XLoadQueryFont if x_list_fonts returns + NULL. Copy full_name member of struct MacFontStruct to that of + struct font_info. + +2005-04-19 Kim F. Storm <storm@cua.dk> + + * xdisp.c (handle_stop): Set saved_face_id to current face if + selective_display_ellipsis_p so ellipsis will be shown in same + face as preceding text. + (setup_for_ellipsis): Don't set saved_face_id here. + (next_element_from_display_vector): Default to saved_face_id. + + * fns.c (Fsafe_get): New function. + (syms_of_fns): Defsubr it. + + * lisp.h (Fsafe_get): EXFUN it. + + * xfaces.c (resolve_face_name): Use Fsafe_get to avoid redisplay + loops in case of bad face property lists. Limit number of face + alias lookups to 10 (in case of face alias loops). + +2005-04-18 Kim F. Storm <storm@cua.dk> + + * dispextern.h (struct glyph_row): New member overlay_arrow_bitmap. + It replaces the corresponding member from struct window, as a + window may now show multiple overlay arrows. + Remove member overlay_arrow_p, superseeded by overlay_arrow_bitmap. + + * dispnew.c (row_equal_p, update_window_line, scrolling_window): + Compare overlay_arrow_bitmap than overlay_arrow_p members. + + * fringe.c (draw_fringe_bitmap): Use overlay_arrow_bitmap from row + rather than from window. + (update_window_fringes): Compare overlay_arrow_bitmap rather than + overlay_arrow_p members. + (Ffringe_bitmaps_at_pos): Return fringe overlay_arrow_bitmap name + if not default. + + * window.h (struct window): Remove member overlay_arrow_bitmap. + + * window.c (make_window): Don't initialize overlay_arrow_bitmap. + + * xdisp.c (overlay_arrow_string_or_property): Remove PBITMAP arg. + Calls changed. Don't check for overlay-arrow-bitmap property here. + (overlay_arrow_at_row): Remove PBITMAP arg. Instead, if left + fringe is present, return Lisp integer for bitmap (or -1 for default). + Fix value of overlay-arrow-bitmap property to be a symbol, use + lookup_fringe_bitmap to parse it. + (display_line): Change call to overlay_arrow_at_row. Store integer + return value as overlay bitmap in row rather than window. + Only show overlay arrow if row displays text, or if no other overlay + arrow is seen in window (if overlay marker is at point-max). + +2005-04-18 Thien-Thi Nguyen <ttn@gnu.org> + + * xfaces.c (realize_x_face) [!HAVE_WINDOW_SYSTEM]: Return NULL. + +2005-04-18 Lute Kamstra <lute@gnu.org> + + * lread.c (Vloads_in_progress): Static. + * fns.c (Vloads_in_progress): Remove extern. + (load_in_progress): Add extern. + (Frequire): Use load_in_progress instead of Vloads_in_progress. + +2005-04-18 Thien-Thi Nguyen <ttn@gnu.org> + + * xmenu.c (Fx_popup_menu): Initialize error_name to NULL. + +2005-04-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c (XTread_socket): Don't beep on keyboard input even if + no frame is visible. + +2005-04-16 Dan Nicolaescu <dann@ics.uci.edu> + + * term.c (struct keys): Add support for shifted keys. + +2005-04-16 Richard M. Stallman <rms@gnu.org> + + * xdisp.c (with_echo_area_buffer): Delete WHICH < 0 case. + (set_message): Call with_echo_area_buffer with WHICH = 0. + (set_message_1): Erase the echo area buffer first thing. + (echo_area_display): Don't clear echo_message_buffer. + +2005-04-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * Makefile.in (mac.o): Depend on charset.h and coding.h. + + * mac.c: Include charset.h and coding.h. + [TARGET_API_MAC_CARBON] (Qutf_8): Remove extern. + [TARGET_API_MAC_CARBON] (cfstring_create_with_string): New function. + [TARGET_API_MAC_CARBON] (Fmac_get_preference): Use it. + + * macfns.c [TARGET_API_MAC_CARBON] (Fx_file_dialog): Likewise. + + * image.c [MAC_OSX] (image_load_quartz2d): Likewise. + + * macterm.c (x_autoselect_window_p): Remove variable. + (last_window): New variable. + (XTreassert_line_highlight, x_change_line_highlight): + Remove declarations. + (mac_focus_changed, x_detect_focus_change): New functions and + declarations. + (XTextExtents16, front_emacs_window): Remove function. + (mac_focus_frame): New function. + (XTmouse_position, do_menu_choice, do_zoom_window, XTread_socket) + (mac_check_for_quit_char): Use it instead of front_emacs_window. + (x_scroll_bar_report_motion): Obtain window from control owner. + (x_make_frame_invisible): Set window manager size hint. + (do_mouse_moved): Remove function. + (XTread_socket): Move its contents here. Generate select-window + event on mouse movement if needed. Use x_detect_focus_change on + activate/deactivate events. Don't deiconify frame or invalidate + window rectangle when dnd items are dropped. + Don't activate/deactivate root control. + (frame_highlight, frame_unhighlight): Activate/deactivate root + control here. + (syms_of_macterm): Delete DEFVAR_BOOL for x_autoselect_window_p. + + * macterm.h (cfstring_create_with_string) [TARGET_API_MAC_CARBON]: + New extern. + +2005-04-15 Luc Teirlinck <teirllm@auburn.edu> + + * Makefile.in: Define new macro TOOLTIP_SUPPORT. + (lisp): Use it. + (SOME_MACHINE_LISP): Add tooltip. + +2005-04-14 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * mac.c [!TARGET_API_MAC_CARBON]: Include MacLocales.h. + Don't include TextEncodingConverter.h. + (mac_system_script_code, Vmac_system_locale): New variables. + (syms_of_mac): Defvar them. + (mac_get_system_locale): New function. + + * macfns.c (x_set_name, x_set_title) [!TARGET_API_MAC_CARBON]: + Use ENCODE_SYSTEM to encode title bar string. + (x_create_tip_frame): Apply 2005-03-18 change for xfns.c. + (Fx_file_dialog) [TARGET_API_MAC_CARBON && !MAC_OSX]: + Use CFStringGetSystemEncoding to get system default string encoding. + + * macterm.c [!TARGET_API_MAC_CARBON]: Don't include + TextEncodingConverter.h. + +2005-04-13 Steven Tamm <steventamm@mac.com> + + * macterm.c (syms_of_macterm): Remove redundant definition of + mac-pass-control-to-system. + +2005-04-12 Stefan Monnier <monnier@iro.umontreal.ca> + + * window.c (Fset_window_configuration): Be careful when you choose + among several possible points for the new_current_buffer. + +2005-04-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * keyboard.c (poll_for_input) [SYNC_INPUT]: Don't call + poll_for_input_1. Set interrupt_input_pending to 1 instead. + (Qlanguage_change) [MAC_OS]: New variable. + (syms_of_keyboard) [MAC_OS]: Intern and staticpro it. + (kbd_buffer_get_event) [MAC_OS]: Make event for LANGUAGE_CHANGE_EVENT. + + * macterm.c (mac_keyboard_text_encoding) + (current_mac_keyboard_text_encoding): Remove variables. + (XTread_socket): Store language-change event if keyboard script change + is detected. Don't convert input to `mac_keyboard_text_encoding'. + (syms_of_macterm): Delete DEFVAR_INT for mac-keyboard-text-encoding. + + * termhooks.h (enum event_kind) [MAC_OS]: Add LANGUAGE_CHANGE_EVENT. + +2005-04-10 Richard M. Stallman <rms@gnu.org> + + * emacs.c (standard_args): Rename --bare-bones to --quick. + Add -D aka --basic-display. + + * buffer.c (Fmake_indirect_buffer): Clear out some local variables. + +2005-04-09 Richard M. Stallman <rms@gnu.org> + + * keymap.c (where_is_internal): Convert a string used as event type + into "(any string)". + + * lread.c (Vloads_in_progress): Not static. + * fns.c (Vloads_in_progress): Add extern. + (Frequire): Don't do LOADHIST_ATTACH if Vloads_in_progress is nil. + +2005-04-09 Thien-Thi Nguyen <ttn@surf.glug.org> + + * dispnew.c (mirror_line_dance): Avoid crash if W2 is null. + +2005-04-09 Lute Kamstra <lute@gnu.org> + + * print.c (PRINTPREPARE): Check if the marker PRINTCHARFUN is + within the accessible part of the buffer. + +2005-04-09 Kim F. Storm <storm@cua.dk> + + * lread.c (readevalloop): Add args START and END as region in + current buffer to read. Callers changed. + When specified, narrow to this region only when reading, + not during eval. Track next point to read from during eval. + Also restore point to "real" buffer position before eval. + (Feval_region): Don't save excursion and restriction here, and + don't narrow to region. Just pass region to readevalloop. + Note: Point is now preserved even when PRINTFLAG is nil. + +2005-04-08 Kim F. Storm <storm@cua.dk> + + * xdisp.c (syms_of_xdisp): Init overlay-arrow-string to "=>". + +2005-04-06 Kim F. Storm <storm@cua.dk> + + * emacs.c (standard_args): Add -Q, --bare-bones, -bare-bones. + +2005-04-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * mac.c (cfdate_to_lisp): Add `const' for variable `epoch_gdate'. + (Fmac_get_preference): Doc fix. + + * macfns.c (Fx_create_frame, x_create_tip_frame): + Add "fontset-mac" to fallback font/fontsets. + +2005-04-04 Kim F. Storm <storm@cua.dk> + + * alloc.c (Fgarbage_collect): Call CHECK_CONS_LIST before and after gc. + + * eval.c (Ffuncall): Always call CHECK_CONS_LIST on entry. + Call it again after autoload. + +2005-04-02 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * alloc.c (allocate_string_data): Call BLOCK_INPUT before calling + mallopt. + + * ralloc.c (r_alloc_init): Ditto. + +2005-04-01 Kenichi Handa <handa@m17n.org> + + * lisp.h (Vascii_upcase_table, Vascii_canon_table) + (Vascii_eqv_table): Extern them. + + * casetab.c (set_case_table): If standard is nonzero, setup + Vascii_upcase_table, Vascii_canon_table, and Vascii_eqv_table. + + * search.c (looking_at_1): Use current_buffer->case_canon_table, + not DOWNCASE_TABLE. + (string_match_1): Likewise. + (fast_c_string_match_ignore_case): Use Vascii_canon_table, not + Vascii_downcase_table. + (fast_string_match_ignore_case): Likewise. + (search_buffer): Fix checking of boyer-moore usability. + (boyer_moore): Calculate translate_prev_byte1/2/3 in advance. + No need of tranlating characters in PAT. Fix calculation of + simple_translate. + +2005-03-31 Stefan Monnier <monnier@iro.umontreal.ca> + + * xterm.c [HAVE_XAW3D]: Include ThreeD.h for XtNbeNiceToColormap. + (x_create_toolkit_scroll_bar): Test XtNbeNiceToColormap before using it. + Use XtNtopShadowPixel and XtNbottomShadowPixel. + (x_set_toolkit_scroll_bar_thumb): Remove ugly old hack that didn't + really work and that breaks with some versions of Xaw3d. + +2005-03-31 Kenichi Handa <handa@m17n.org> + + * coding.c (syms_of_coding): Fix previous change. + +2005-03-30 Stefan Monnier <monnier@iro.umontreal.ca> + + * fileio.c (search_embedded_absfilename): Fix last change. + +2005-03-25 Kenichi Handa <handa@m17n.org> + + * coding.c (syms_of_coding): Suggest to use set-coding-category in + the docstring of coding-category-list. + +2005-03-31 Kim F. Storm <storm@cua.dk> + + * keyboard.c (Qmouse_fixup_help_message): New var. + (syms_of_keyboard): Intern and staticpro it. + (show_help_echo): Apply mouse-fixup-help-message to help string. + +2005-03-30 Kim F. Storm <storm@cua.dk> + + * xdisp.c (display_line): Allow multiple overlay arrows in window. + +2005-03-28 Stefan Monnier <monnier@iro.umontreal.ca> + + * fileio.c (Fexpand_file_name): Use IS_DEVICE_SEP. + (file_name_absolute_p): New fun, extracted from Ffile_name_absolute_p. + (Ffile_name_absolute_p): Use it. + (search_embedded_absfilename): New fun, extracted from + Fsubstitute_in_file_name. Use file_name_absolute_p. + Free the pw data after use. + (Fsubstitute_in_file_name): Use it. + After cutting a prefix, re-check file-name-handler. + +2005-03-26 Lennart Borgman <lennart.borgman.073@student.lu.se> + + * w32term.h (x_output): Add focus_state. + + * w32term.c (x_focus_changed, w32_detect_focus_change): New functions. + (w32_read_socket) <WM_SETFOCUS>: Call w32_detect_focus_change. + +2005-03-25 Stefan Monnier <monnier@iro.umontreal.ca> + + * minibuf.c (Fminibuffer_complete_and_exit, Fself_insert_and_exit): + Use Fexit_minibuffer. + (Fexit_minibuffer): Mark it as no-return, deactivate the mark. + +2005-03-24 Stefan Monnier <monnier@iro.umontreal.ca> + + * dired.c (Ffile_attributes): Add a missing gcpro. + + * alloc.c (make_number): The arg can be bigger than `int'. + * lisp.h (make_number): Make prototype more precise. + + * process.c, dired.c (Vfile_name_coding_system) + (Vdefault_file_name_coding_system): + * callproc.c (Vdoc_file_name, Vfile_name_coding_system) + (Vdefault_file_name_coding_system): Remove unused declarations. + +2005-03-24 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xmenu.c (create_and_show_popup_menu): Just remove menu and return + if it failed to pop up (Gnome "show pointer on ctrl" option makes + menus fail to pop up). + +2005-03-24 Stefan Monnier <monnier@iro.umontreal.ca> + + * xdisp.c (get_next_display_element): Also use `\ ' & `\-' for latin-9. + Just prepend a backslash without replacing the NBSP by an SPC. + +2005-03-22 Kim F. Storm <storm@cua.dk> + + * xfaces.c (lookup_derived_face): Add arg SIGNAL_P. + * dispextern.h (lookup_derived_face): Fix prototype. + * msdos.c (XMenuActivate): Fix call to lookup_derived_face. + + * xdisp.c (handle_single_display_spec): Derive left-fringe and + right-fringe face from fringe face. + + * fringe.c (draw_fringe_bitmap_1, Fset_fringe_bitmap_face): + Derive face from fringe face. + +2005-03-22 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xrdb.c (x_load_resources): Undo previous change (2005-03-18). + +2005-03-22 David Kastrup <dak@gnu.org> + + * textprop.c (Fnext_char_property_change) + (Fprevious_char_property_change): Allow marker as limit. + (Fnext_single_char_property_change) + (Fprevious_single_char_property_change): Check that limit is a + number in strings. + (Fnext_single_char_property_change): Coerce position to integer. + (Fprevious_single_char_property_change): Same here. + +2005-03-21 Thien-Thi Nguyen <ttn@gnu.org> + + * s/openbsd.h (LD_SWITCH_SYSTEM_tmp): Define if undefined. + +2005-03-19 Stefan Monnier <monnier@iro.umontreal.ca> + + * frame.c (Fignore_event): Remove. + (syms_of_frame): Don't defsubr it. + + * keyboard.c (keys_of_keyboard): Just use `ignore' instead of the + redundant `ignore-event'. + +2005-03-19 Eli Zaretskii <eliz@gnu.org> + + * unexec.c (write_segment, unexec): Move these functions to avoid + forward references (which cause errors with "gcc -gcoff"). + +2005-03-18 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xfns.c (x_create_tip_frame): Remove setting of Vx_resource_name so + that it doesn't become "tooltip". The specbind is enough. + + * xrdb.c (x_load_resources): Use different char *helv when I18N + is present. + +2005-03-17 Kenichi Handa <handa@m17n.org> + + * coding.c (syms_of_coding): Docstring of coding-category-list fixed. + +2005-03-17 Stefan Monnier <monnier@iro.umontreal.ca> + + * xfaces.c (x_update_menu_appearance) [HAVE_X_I18N]: + Use xic_create_fontsetname even for non-Motif menus. + Don't forget to free the fontsetname. + + * xfns.c (xic_create_fontsetname): Add a final catch-all font pattern. + +2005-03-17 Richard M. Stallman <rms@gnu.org> + + * dispnew.c (mirror_line_dance): Set W2 according to FRAME_FROM. + + * fileio.c (Fcopy_file, Frename_file, Fadd_name_to_file) + (Fmake_symbolic_link): Use G to read the new file name. + + * callint.c (Finteractive): Document G option. + (Fcall_interactively): Implement G option. + + * buffer.c (buffer_lisp_local_variables): New function, + broken out from Fbuffer_local_variables. + (clone_per_buffer_values): Use buffer_lisp_local_variables. + +2005-03-17 Stefan Monnier <monnier@iro.umontreal.ca> + + * xfns.c (xic_create_fontsetname): Add `motif' argument. + Always return a freshly allocated string. + (xic_create_xfontset): Adjust call. + + * xfaces.c (x_update_menu_appearance) [USE_MOTIF]: + Use xic_create_fontsetname to create a fontset so utf-8 locales work. + (dump_realized_face): Fix warning. + + * emacs.c (Fkill_emacs): YAILOM. + + * frame.c (Fignore_event): Fix ancient obscure C-u handling bug. + +2005-03-17 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * mac.c (HASHKEY_TERMINAL): Remove. + (HASHKEY_MAX_NID): New macro. + (xrm_q_get_resource_1): Rename from xrm_q_get_resource. Add extra + argument. + (xrm_q_get_resource): Call xrm_q_get_resource_1 with extra argument. + (xrm_create_database, xrm_q_put_resource) + (xrm_merge_string_database, xrm_q_get_resource_1) + (xrm_q_get_resource): Change resource database representation so + that it may not use multiple hash tables for a single database. + [TARGET_API_MAC_CARBON] (xrm_cfproperty_list_to_value): YAILOM. + +2005-03-16 Stefan Monnier <monnier@iro.umontreal.ca> + + * xmenu.c (ENCODE_MENU_STRING) [HAVE_X_I18N]: Use ENCODE_SYSTEM. + + * coding.h (ENCODE_SYSTEM, DECODE_SYSTEM) [!WINDOWSNT]: Use the + locale-coding-system, as was already done for WINDOWSNT. + + * keyboard.c (read_char): Only do the 7-bit-meta -> 27-bit-meta + translation for chars in the 0-255 range. + +2005-03-16 Lute Kamstra <lute@gnu.org> + + * floatfns.c (Ffloor): Doc fix. + +2005-03-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * mac.c: Include macterm.h instead of directly including Carbon.h. + [TARGET_API_MAC_CARBON] (Qstring, Qnumber, Qboolean, Qdate, Qdata) + (Qarray, Qdictionary): New variables. + (syms_of_mac) [TARGET_API_MAC_CARBON]: Initialize them. + [TARGET_API_MAC_CARBON] (Qutf_8): Add extern. + [TARGET_API_MAC_CARBON] (DECODE_UTF_8): New macro. + [TARGET_API_MAC_CARBON] (struct cfdict_context): New struct used + in callback for CFDictionaryApplyFunction. + [TARGET_API_MAC_CARBON] (cfdata_to_lisp, cfstring_to_lisp) + (cfnumber_to_lisp, cfdate_to_lisp, cfboolean_to_lisp) + (cfobject_desc_to_lisp, cfdictionary_add_to_list) + (cfdictionary_puthash, cfproperty_list_to_lisp): New functions. + [TARGET_API_MAC_CARBON] (Fmac_get_preference): New function. + (syms_of_mac) [TARGET_API_MAC_CARBON]: Defsubr it. + (P, LOOSE_BINDING, SINGLE_COMPONENT, HASHKEY_TERMINAL): New macro. + (skip_white_space, parse_comment, parse_include_file) + (parse_binding, parse_component, parse_resource_name, parse_value) + (parse_resource_line, xrm_create_database, xrm_q_put_resource) + (xrm_merge_string_database, xrm_q_get_resource, xrm_get_resource) + (xrm_cfproperty_list_to_value, xrm_get_preference_database): + New functions. + + * macfns.c (mac_get_rdb_resource): Remove function. + (x_get_string_resource): Use xrm_get_resource. + + * macgui.h (XrmDatabase): Typedef to Lisp_Object. + + * macterm.c (x_list_fonts): FONT-LIST-CACHE is now cadr part of + name_list_element. + (mac_make_rdb): Create resource database from preferences and + argument string. + (mac_term_init): Save resource database to cddr part of + name_list_element. + + * macterm.h (xrm_merge_string_database, xrm_get_resource) + (xrm_get_preference_database): Add externs. + [TARGET_API_MAC_CARBON] (cfdata_to_lisp, cfstring_to_lisp) + (cfnumber_to_lisp, cfdate_to_lisp, cfboolean_to_lisp) + (cfobject_desc_to_lisp, cfproperty_list_to_lisp): Likewise. + + * process.c (init_process): Change `#ifdef DARWIN' to `#if + defined (DARWIN) || defined (MAC_OSX)'. + + * s/darwin.h (DARWIN): Don't define. + +2005-03-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macfns.c (Qhyper, Qsuper, Qmeta, Qalt, Qctrl, Qcontrol, Qshift): + Remove unused variables. + (syms_of_macfns): Don't initialize them. Likewise for + Qface_set_after_frame_default. Defvar and initialize + Vx_window_horizontal_drag_shape. + (x_set_mouse_color): Change mouse pointer shape. + (mac_window) [!MAC_OSX]: Create root control. + (Fx_create_frame): Remove initializations of mouse pointer shapes. + (hourglass_started): New function (from xfns.c). + (start_hourglass, cancel_hourglass): Put function body in #ifdef + MAC_OSX. + (show_hourglass) [TARGET_API_MAC_CARBON]: Create progress + indicator for each non-tooltip frame if needed, and show it. + (hide_hourglass) [TARGET_API_MAC_CARBON]: Hide progress indicators. + + * macgui.h [!TARGET_API_MAC_CARBON]: Include Appearance.h and + Controls.h. Use ThemeCursor instead of CursHandle. + + * macterm.c (activate_scroll_bars, deactivate_scroll_bars): + Remove functions and declarations. + (mac_set_colors): Take argument for saving background color. + All callers changed. + (XDrawLine, XClearArea, mac_draw_bitmap, XFillRectangle) + (mac_draw_rectangle, mac_draw_string_common): Save and Restore + background color. + (x_update_end, mac_do_track_drag): Don't reset background color. + (mac_define_frame_cursor) [!TARGET_API_MAC_CARBON]: + Use SetThemeCursor. + (x_set_window_size) [TARGET_API_MAC_CARBON]: Move progress + indicator control to the upper-right corner of the window. + (arrow_cursor) [!TARGET_API_MAC_CARBON]: Remove variable. + (do_init_managers) [!TARGET_API_MAC_CARBON]: Don't initialize it. + (do_window_update): Update controls after updating content area. + (mac_handle_window_event): Remove unused extern. + (XTread_socket): Check both control handle and control part code + to determine whether a scroll bar is clicked. Activate/deactivate + root control instead of contained scroll bar controls. + (make_mac_terminal_frame): Use ThemeCursor constants. + + * macterm.h (struct mac_output) [TARGET_API_MAC_CARBON]: + New member hourglass_control. + (HOURGLASS_WIDTH, HOURGLASS_HEIGHT): New defines. + (activate_scroll_bars, deactivate_scroll_bars): Remove declarations. + +2005-03-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c (keycode_to_xkeysym_table): Change mapping so that it + coincides with that in Apple X11 except `clear', `enter' on + laptops, and fn + `enter' on laptops. + +2005-03-12 Stefan Monnier <monnier@iro.umontreal.ca> + + * xmenu.c (ENCODE_MENU_STRING): Explicitly use string_make_unibyte. + (list_of_panes, list_of_items, Fx_popup_menu): Use XCAR/XCDR. + (digest_single_submenu, xmenu_show): Use ENCODE_MENU_STRING. + + * xfns.c (xic_defaut_fontset): New constant. + (xic_create_fontsetname): New function. + Extracted from create_frame_xic. Try to generate a slightly + better fontset. + (xic_create_xfontset): Use it. + (create_frame_xic): Simplify. + +2005-03-11 Stefan Monnier <monnier@iro.umontreal.ca> + + * fileio.c (Fmake_symbolic_link): Fix last change. + +2005-03-11 Richard M. Stallman <rms@gnu.org> + + * fileio.c (Frename_file, Fadd_name_to_file) + (Fmake_symbolic_link): If NEWNAME or LINKNAME is a directory, + expand the basename of FILE relative to it. + +2005-03-11 Kenichi Handa <handa@m17n.org> + + * fileio.c (Finsert_file_contents): Call Fcheck_coding_system + before calling setup_coding_system so that autoloading of a coding + system work. + +2005-03-10 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xfns.c (hourglass_started): New function. + + * dispextern.h: Declare hourglass_started. + + * keyboard.c (Fexecute_extended_command): Restart hourglass + after call to Fcompleting_read if already started. + + * gtkutil.c (xg_update_scrollbar_pos): Call x_sync so that the + GTK main loop is entered in xterm.c, thus doing the redraw. + +2005-03-10 Kim F. Storm <storm@cua.dk> + + * xdisp.c (pos_visible_p): Fix X value in last line of buffer. + +2005-03-08 Kenichi Handa <handa@m17n.org> + + * frame.c (x_set_font): Call set_default_ascii_font if an + available font is found. + + * fontset.c (set_default_ascii_font): New function. + (syms_of_fontset): Don't set FONTSET_ASCII (Vdefault_fontset) here. + + * fontset.h (set_default_ascii_font): Extern it. + +2005-03-07 Kim F. Storm <storm@cua.dk> + + * xdisp.c (CLEAR_IMAGE_CACHE_COUNT): New const. + (clear_image_cache_count): New var. + (redisplay_internal): Don't clear face and image caches in the + middle of redisplay; do it afterwards. + + * blockinput.h (TOTALLY_UNBLOCK_INPUT): Avoid dangling else. + + * xdisp.c (notice_overwritten_cursor): Check that phys_cursor.vpos + is valid. If not, clear phys_cursor_on_p and return. + +2005-03-07 Andreas Schwab <schwab@suse.de> + + * blockinput.h (UNBLOCK_INPUT_TO): Always call UNBLOCK_INPUT. + +2005-03-06 Richard M. Stallman <rms@gnu.org> + + * keyboard.c (Ftop_level): Let Fthrow deal with UNBLOCK_INPUT. + + * eval.c (unwind_to_catch): Use UNBLOCK_INPUT_TO. + (Feval, Ffuncall): Use CHECK_CONS_LIST. + + * lisp.h (CHECK_CONS_LIST): New macro (two definitions). + + * blockinput.h (UNBLOCK_INPUT_TO): New macro. + (TOTALLY_UNBLOCK_INPUT): Handle a pending signal if any. + +2005-03-05 Juri Linkov <juri@jurta.org> + + * emacs.c (USAGE1): Replace Info node name "command arguments" + with "emacs invocation". + (USAGE3): Fix usage of `--color=MODE' which actually doesn't + allow arguments `--color' and `MODE' to be separated by space. + Add --no-blinking-cursor, -nbc. + (standard_args): Add -nbc, --no-blinking-cursor. + +2005-03-04 Thien-Thi Nguyen <ttn@gnu.org> + + * s/vms.h: Define NO_HYPHENS_IN_FILENAMES. + * s/vms4-4.h, s/vms5-5.h: Undefine NO_HYPHENS_IN_FILENAMES. + * fileio.c (Fexpand_file_name) [VMS]: + Use NO_HYPHENS_IN_FILENAMES, not VMS4_4. + * doc.c (munge_doc_file_name) [VMS]: Likewise. + (Fsnarf_documentation): Call munge_doc_file_name. + +2005-03-04 Thien-Thi Nguyen <ttn@gnu.org> + + * s/vms.h (FILE_SYSTEM_CASE): New macro. + * fileio.c (Fexpand_file_name) [VMS]: Don't upcase the name + "manually"; this is now handled generally via FILE_SYSTEM_CASE. + +2005-03-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * emacs.c (main): Change `#ifdef HAVE_CARBON' to `#if + defined (MAC_OSX) && defined (HAVE_CARBON)'. + + * image.c [!MAC_OSX && TARGET_API_MAC_CARBON]: Include QuickTime.h. + + * mac.c [!MAC_OSX && HAVE_CARBON]: Include Carbon.h. + [!MAC_OSX] (select) [TARGET_API_MAC_CARBON]: Use ReceiveNextEvent. + (posix_pathname_to_fsspec, fsspec_to_posix_pathname): New functions. + (mac_clear_font_name_table): Move extern to macterm.h. + + * macfns.c (install_window_handler): Move extern to macterm.h. + (Fx_file_dialog): Check STRINGP (default_filename) to see it is + valid. Don't check !NILP (dir) because it is already checked with + CHECK_STRING. + (Fx_file_dialog) [!MAC_OSX]: Use FSSpec instead of FSRef for + specifying the default location and obtaining the selected filename. + + * macgui.h [!MAC_OSX && HAVE_CARBON]: Include Carbon.h. + + * macmenu.c [TARGET_API_MAC_CARBON]: Don't include headers that + are included via Carbon.h. + + * macterm.c [TARGET_API_MAC_CARBON && !MAC_OSX]: + Define USE_CARBON_EVENTS to 1. + (qd) [__MRC__ && TARGET_API_MAC_CARBON]: Don't declare. + (x_free_frame_resources): Call remove_window_handler for + non-tooltip windows. + [TARGET_API_MAC_CARBON]: Don't include headers that are included + via Carbon.h. + [TARGET_API_MAC_CARBON] (mac_do_track_dragUPP) + (mac_do_receive_dragUPP): New variables. + (mac_handle_service_event, init_service_handler): Put declarations + and definitions in #ifdef MAC_OSX. + (install_window_handler) [TARGET_API_MAC_CARBON]: Create UPPs for + drag-and-drop handler functions and register them. + (remove_window_handler): New function. + (do_ae_open_documents, mac_do_receive_drag) [!MAC_OSX]: + Use fsspec_to_posix_pathname. + (main): Change #if !TARGET_API_MAC_CARBON to #ifdef MAC_OS8. + (XTread_socket) [!MAC_OSX]: Don't pass keyboard events to TSM. + [MAC_OS8] (make_mac_terminal_frame) [TARGET_API_MAC_CARBON]: + Set default cursors. + (mac_initialize) [USE_CARBON_EVENTS && !MAC_OSX]: Don't call + init_service_handler or init_quit_char_handler. + (mac_initialize) [!MAC_OSX]: Don't call MakeMeTheFrontProcess. + + * macterm.h (install_window_handler, remove_window_handler) + (posix_pathname_to_fsspec, fsspec_to_posix_pathname) + (mac_clear_font_name_table): New externs. + +2005-03-03 Thien-Thi Nguyen <ttn@gnu.org> + + * fileio.c (FILE_SYSTEM_CASE): Define macro if not already defined. + (Ffile_name_directory): Use FILE_SYSTEM_CASE unconditionally. + (Fexpand_file_name): Likewise. + +2005-03-03 Thien-Thi Nguyen <ttn@gnu.org> + + * emacs.c (Fkill_emacs): Use EXIT_SUCCESS; + no longer special-case VMS. Add bogus return value. + +2005-03-02 Kim F. Storm <storm@cua.dk> + + * dispextern.h (XASSERTS): Define to 0 if not already defined. + (xassert) [!XASSERTS]: Define dummy version. + +2005-03-02 Kim F. Storm <storm@cua.dk> + + * xdisp.c (redisplay_window): YABX (yet another bogus xassert). + Reported by David Kastrup. + +2005-03-01 Ehud Karni <ehud@unix.mvs.co.il> + + * xdisp.c (get_next_display_element): Fix control and escape + glyph from display vector. + +2005-03-01 Stefan Monnier <monnier@iro.umontreal.ca> + + * keyboard.c (Fposn_at_x_y): Check integerness of X and Y. + +2005-02-27 Richard M. Stallman <rms@gnu.org> + + * xdisp.c (fast_find_position): Rename END to BEG. + (syms_of_xdisp) <menu-bar-update-hook>: Doc fix. + +2005-02-27 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (xg_resize_outer_widget): Remove unneeded call to + gtk_window_resize and x_wm_set_size_hint. + +2005-02-25 Kim F. Storm <storm@cua.dk> + + * dispextern.h (OVERLAY_STRING_CHUNK_SIZE): Increase from 3 to 16. + + * xdisp.c (init_from_display_pos): Don't read past end of + it->overlay_strings array. + +2005-02-25 Stephan Stahl <stahl@eos.franken.de> (tiny change) + + * buffer.c (syms_of_buffer): Fix typo. + +2005-02-23 Lute Kamstra <lute@gnu.org> + + * buffer.c (Foverlay_buffer): Doc fix. + +2005-02-22 Kim F. Storm <storm@cua.dk> + + * minibuf.c (Ftry_completion, Fall_completions): Allow both string + and symbol keys in alists and hash tables. + + * xdisp.c (fast_find_position): Fix search for start of overlay. + +2005-02-21 Kim F. Storm <storm@cua.dk> + + * window.c (window_scroll_pixel_based): When scrolling backwards, + handle partial visible line at end of window even when we hit PT. + +2005-02-21 Stefan Monnier <monnier@iro.umontreal.ca> + + * keymap.h: Declare Fcurrent_active_maps, used in doc.c. + +2005-02-21 Kim F. Storm <storm@cua.dk> + + * xdisp.c (move_it_vertically_backward): Eliminate two xasserts. + I think those asserts are bogus if buffer contains invisible text + or images. + +2005-02-21 David Kastrup <dak@gnu.org> + + * gtkutil.c (xg_create_frame_widgets): UNBLOCK_INPUT on error. + +2005-02-20 Kim F. Storm <storm@cua.dk> + + * xdisp.c (pos_visible_p): Be sure to move to the specified + position. Always get the full ascent / descent of the + corresponding row, to return reliable rtop and rbot values. + (back_to_previous_visible_line_start): Fix 2005-01-18 change. + Must look one character back, as back_to_previous_line_start + returns position after the newline. + (move_it_vertically_backward): Fix heuristic for when to move further + back in case line_height * 2/3 is larger than window height. + (cursor_row_fully_visible_p): Rename make_cursor_line_fully_visible_p + as it does not do anything anymore. Add arg current_matrix_p to + use current matrix rather than desired matrix when set. + (try_cursor_movement): Don't scroll to make cursor row fully + visible if cursor didn't move. This avoids unexpected recentering + in case of blinking cursor or accepting process output. + Use current matrix to check cursor row visibility. + (redisplay_window): Fix whether to recenter or move to top in case + cursor line is taller than window height. + (find_first_unchanged_at_end_row): Stop search if we reach a row + which not enabled (instead of abort). + +2005-02-18 Kim F. Storm <storm@cua.dk> + + * xfaces.c (Finternal_set_lisp_face_attribute): Allow :color property + to be nil in a :box attribute value list; customize prints that + as lisp value when no box color is specified. + + * .gdbinit (pitx, pit): Pretty print display iterator. + (prowx, prow): Pretty print glyph row. + (pcursorx, pcursor): Pretty print a window cursor. + (pwinx, pwin): Pretty print struct window. + +2005-02-18 Stefan Monnier <monnier@iro.umontreal.ca> + + * alloc.c (BLOCK_BYTES): Harmless typo. + +2005-02-17 Andreas Schwab <schwab@suse.de> + + * xfns.c (hack_wm_protocols): Use correct type for last parameter + of XGetWindowProperty to avoid aliasing issues. + (Fx_window_property): Likewise. + + * xselect.c (Fx_disown_selection_internal): Use union of struct + input_event and struct selection_input_event to avoid aliasing issues. + + * xterm.c (handle_one_xevent): Use union of struct input_event and + struct selection_input_event to avoid aliasing issues. + (SET_SAVED_MENU_EVENT): Adapt reference to inev. + +2005-02-17 Kim F. Storm <storm@cua.dk> + + * dispextern.h (enum it_method): New enum. + (GET_FROM_*): Its members. + (struct it): Change member method from function pointer to enum. + + * xdisp.c (check_it, init_from_display_pos, handle_stop) + (setup_for_ellipsis, handle_single_display_spec) + (handle_composition_prop, next_overlay_string) + (get_overlay_strings, reseat_1, reseat_to_string) + (next_element_from_ellipsis, BUFFER_POS_REACHED_P) + (in_display_vector_p, display_line, get_next_display_element): + Change it->method from function pointer to enum. + (get_next_element): New array to map it->method to function. + (get_next_display_element): Use it. + (set_iterator_to_next): Use switch instead of if/else chain. + +2005-02-15 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de> + + * w32select.c: Summary: Thorough rework to implement Unicode + clipboard operations and delayed rendering. + + Drop last_clipboard_text and related code, keep track of + ownership via clipboard_owner instead. Drop old #if0 sections. + + (DEFAULT_LCID, ANSICP, OEMCP, QUNICODE, QANSICP, QOEMCP) + (clipboard_owner, modifying_clipboard, cfg_coding_system) + (cfg_codepage, cfg_lcid, cfg_clipboard_type, current_text) + (current_coding_system, current_requires_encoding) + (current_num_nls, current_clipboard_type, current_lcid): + New static variables. + + (convert_to_handle_as_ascii, convert_to_handle_as_coded) + (render, render_all, run_protected, lisp_error_handler) + (owner_callback, create_owner, setup_config) + (enum_locale_callback, cp_from_locale, coding_from_cp): + New local functions. + + (term_w32select, globals_of_w32select): New global functions. + + (Fw32_set_clipboard_data): Ignore parameter FRAME, use + clipboard_owner instead. Use delayed rendering and provide + all text formats. Provide CF_LOCALE if necessary. + + (Fw32_get_clipboard_data): Handle CF_UNICODETEXT and + CF_LOCALE. Fall back to CF_TEXT, if CF_UNICODETEXT is not + available. Force DOS line-ends for decoding. + + (Fx_selection_exists_p): Handle CF_UNICODETEXT. + + (syms_of_w32select): Init and register new variables. + + * w32.h: Add prototypes for globals_of_w32select and + term_w32select. Make the neighboring K&R declarations into + prototypes, too. + + * emacs.c: Include w32.h to get function prototypes. + (main): Call globals_of_w32select. + + * w32.c (term_ntproc): Call term_w32select. + + * s/ms-w32.h: Guard MSC-specific #pragmas with an #ifdef. + +2005-02-16 Kim F. Storm <storm@cua.dk> + + * xdisp.c (BUFFER_POS_REACHED_P): Return true if pos reached and + at end of display vector. + +2005-02-15 Richard M. Stallman <rms@gnu.org> + + * xdisp.c (get_next_display_element): Fix escape-glyph criterion + for mode and header lines. + + * lread.c (syms_of_lread) <user-init-file>: Doc fix. + + * keymap.h (describe_map_tree): Change decl. + + * keyboard.c (command_loop_1): Always use safe_run_hooks + to run Qdeferred_action_function. + + * keymap.c (describe_map_tree): New arg MENTION_SHADOW. Calls changed. + (describe_map, describe_vector): Likewise. When it's 1, + don't omit shadowed bindings, instead mark them as shadowed. + + * doc.c (Fsubstitute_command_keys): Compute list of shadowing maps + for describe_map_tree. Pass 1 for MENTION_SHADOW. + + * data.c (Fsetq_default): Allow no arg case. + +2005-02-14 Kenichi Handa <handa@m17n.org> + + * coding.c (encode_coding_string): Always return a unibyte string. + If NOCOPY is nonzero and there's no need of encoding, make STR + unibyte directly. + + * xselect.c (lisp_data_to_selection_data): If OBJ is a non-ASCII + multibyte string, signal an error instead of aborting. + +2005-02-12 Dan Nicolaescu <dann@ics.uci.edu> + + * keyboard.c: If HAVE_FCNTL_H include fcntl.h. + +2005-02-12 Kim F. Storm <storm@cua.dk> + + * xdisp.c (expose_window): Don't fix overlaps for mode lines. + +2005-02-10 Kim F. Storm <storm@cua.dk> + + * xdisp.c (try_window_id): Set first_unchanged_at_end_row to NULL + if it moves outside window or it doesn't display text. + +2005-02-09 Kim F. Storm <storm@cua.dk> + + * undo.c (Fprimitive_undo): Check that undo function does not + switch buffer. + +2005-02-08 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xselect.c (selection_data_to_lisp_data): For the special case + type == XA_ATOM, data contains array of int, not array of Atom. + (x_property_data_to_lisp, selection_data_to_lisp_data): + Comment update: data must be array of int for format == 32. + +2005-02-08 Stefan Monnier <monnier@iro.umontreal.ca> + + * undo.c (Fprimitive_undo): Check veracity of delta,start,end. + +2005-02-07 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xfns.c (Fx_change_window_property): Use long array when format is 32. + (Fx_window_property): If format is 32 and long is bigger than 32 bits, + convert long array returned from XGetWindowProperty to an int array. + (x_set_tool_bar_lines): Check that width and height is greater than + zero before clearing area. + + * xselect.c (x_reply_selection_request): Pass long array to + XChangeProperty so that 64 bit longs are handeled correctly. + (x_get_window_property): If format is 32 and long is bigger than 32 + bits convert data from XGetWindowProperty from long array to int array. + (lisp_data_to_selection_data): When the input is a vector and the + format is 32, allocate a long array even if long is bigger than 32 bits. + (x_fill_property_data): Use char, short and long as the man page + for XChangeProperty specifies. This way the data returned is OK for + both 32 and 64 bit machines. + (x_handle_dnd_message): Calculate size correctly even for 64 bit + machines. + (Fx_send_client_event): Undo change from 2005-02-05, + x_fill_property_data now handles that case. + + * xfns.c (Fx_backspace_delete_keys_p): Add comment about the + reason for the approach in the code. + +2005-02-07 Kim F. Storm <storm@cua.dk> + + * undo.c (Fprimitive_undo): Record max one dummmy apply element. + +2005-02-06 Richard M. Stallman <rms@gnu.org> + + * eval.c (Frun_hook_with_args) + (Frun_hook_with_args_until_success) + (Frun_hook_with_args_until_failure): Doc fixes. + +2005-02-05 Andreas Schwab <schwab@suse.de> + + * sysdep.c (sys_subshell): Properly terminate execlp argument list. + +2005-02-05 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xselect.c (Fx_send_client_event, x_handle_dnd_message): Handle + the longs in a XClientMessageEvent correctly when long is 64 bits. + +2005-02-05 Eli Zaretskii <eliz@gnu.org> + + * xfaces.c (face_color_supported_p): Use HAVE_WINDOW_SYSTEM + instead of HAVE_X_WINDOWS, for non-X windowed sessions. + +2005-02-03 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xmenu.c (menubar_selection_callback): Force out GTK buffered + events so the menu event comes after them. This is to prevent sit-for + from exiting on buffered events directly after a menu selection, + lisp code for Help => About Emacs uses sit-for. + + * gtkutil.c (create_menus): Connect selection-done event instead of + the deactivate event to deactivate_cb. This will make the last + leave event come before the call to deactivate_cb, so the leave + event does not make sit-for exit after a menu selection. + +2005-02-03 Kim F. Storm <storm@cua.dk> + + * dispnew.c (build_frame_matrix_from_leaf_window) + [!GLYPH_DEBUG]: Fix xassert. + + * xfaces.c (x_free_gc) [!GLYPH_DEBUG]: Fix xassert. + + * xfns.c (unwind_create_frame) [!GLYPH_DEBUG]: Fix xassert. + +2005-02-03 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * mac.c: Use MAC_OS_X_VERSION_MAX_ALLOWED to conditionalize by + the compiling OS version. + + * macfns.c (x_create_tip_frame): Likewise. + + * macterm.c (mac_draw_string_common, x_make_frame_visible): Likewise. + +2005-02-03 Richard M. Stallman <rms@gnu.org> + + * xterm.c (x_error_quitter): On GCC 3 and up, specify noinline. + + * xdisp.c (echo_area_display): Clear echo_message_buffer. + + * buffer.c (Fbury_buffer): Doc fix. + +2005-02-02 Steven Tamm <steventamm@mac.com> + + * macfns.c (unwind_create_frame): Fix compile error due to + xassert being uncondition, but predicate is. + * dispnew.c (update_window): Fix compile error due to + xassert being uncondition, but predicate is. + +2005-02-02 Miles Bader <miles@gnu.org> + + * dispextern.h (xassert): Enable unconditionally. + +2005-02-02 Kim F. Storm <storm@cua.dk> + + * undo.c (Fprimitive_undo): Fix dummy apply undo entry. + +2005-02-02 Kenichi Handa <handa@m17n.org> + + * casefiddle.c (casify_object): Enable changing characters of + different byte length. + (casify_region): Fix loop condition, args to replace_range_2, and + update opoint_byte. + + * insdel.c (replace_range_2): Fix bugs in adjusting markers and point. + +2005-02-01 Kim F. Storm <storm@cua.dk> + + * xdisp.c (back_to_previous_visible_line_start): Reset iterator + stack before calling handle_display_prop. + +2005-01-31 Kim F. Storm <storm@cua.dk> + + * undo.c (Qapply): New lisp var. + (syms_of_undo): Intern and staticpro it. + (Fprimitive_undo): Support formats (apply FUNNAME . ARGS) and + (apply DELTA BEG END FUNNAME . ARGS) instead of (FUNNAME . ARGS). + + * buffer.c (syms_of_buffer) <buffer-undo-list>: Doc fix. + +2005-01-30 Jesper Harder <harder@phys.au.dk> + + * macterm.c (syms_of_macterm) <mac-reverse-ctrl-meta> + <mac-emulate-three-button-mouse>: Fix docstring indentation. + +2005-01-29 Luc Teirlinck <teirllm@auburn.edu> + + * undo.c (syms_of_undo) <undo-outer-limit>: Doc update. + Increase value to 3 Meg. + +2005-01-29 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xfns.c (show_hourglass): Use FRAME_X_WINDOW as parent for GTK, + button events are not received otherwise. + +2005-01-29 Richard M. Stallman <rms@gnu.org> + + * buffer.c (syms_of_buffer) <buffer-undo-list>: Doc fix. + + * undo.c (Fprimitive_undo): Handle (FUNNAME . ARGS) by calling FUNNAME. + +2005-01-28 Stefan Monnier <monnier@iro.umontreal.ca> + + * keymap.c (access_keymap): YAILOM. + +2005-01-27 Kim F. Storm <storm@cua.dk> + + * xdisp.c (get_phys_cursor_geometry): New function to calculate + phys cursor position and size for hollow cursor. Position is + aligned with get_glyph_string_clip_rect and ensures that a hollow + cursor is shown, even when the actual glyph is not visible. + + * dispextern.h (get_phys_cursor_geometry): Add prototype. + + * xterm.c (x_clip_to_row): Ensure y >= 0. + (x_draw_hollow_cursor): Use get_phys_cursor_geometry. + + * w32term.c (x_draw_hollow_cursor): Use get_phys_cursor_geometry. + + * macterm.c (x_draw_hollow_cursor): Use get_phys_cursor_geometry. + +2005-01-27 Stefan Monnier <monnier@iro.umontreal.ca> + + * xterm.c (x_error_quitter): Add a prototype. Make it static again. + +2005-01-27 Kim F. Storm <storm@cua.dk> + + * xdisp.c (get_glyph_string_clip_rect): Always show a cursor + glyph, even when row is only partially visible and actual cursor + position is not visible. + +2005-01-24 Richard M. Stallman <rms@gnu.org> + + * xterm.c (x_error_quitter): No longer static, and moved after + x_error_handler. + +2005-01-24 Kim F. Storm <storm@cua.dk> + + * xdisp.c (move_it_by_lines): If we move forward after going too + far back, cancel move if end position is same as start position. + +2005-01-24 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * dispextern.h (struct glyph_string): New members clip_head and + clip_tail. + + * xdisp.c (get_glyph_string_clip_rect): Restrict horizontal clip + region to the area between clip_head and clip_tail. + (draw_glyphs): Record the area that need to be actually redrawn to + the new variables clip_head and clip_tail when there are + overhangs. Set values of these variables to the corresponding + members in struct glyph_string. Refine x coordinates for + notice_overwritten_cursor using clip_head and clip_tail. + + * macgui.h (STORE_XCHARSETSTRUCT): New macro. + + * macterm.c (mac_compute_glyph_string_overhangs): Implement with + QDTextBounds. + (x_draw_glyph_string): Don't fill the background of the successor + of a glyph with a right overhang if the successor will draw a cursor. + (XLoadQueryFont): Obtain font metrics using QDTextBounds. + (x_redisplay_interface): Add entry for compute_glyph_string_overhangs. + +2005-01-24 Kim F. Storm <storm@cua.dk> + + * window.c (window_scroll_pixel_based): Fix scrolling in the wrong + direction if window height was smaller than next-screen-context-lines. + Now always scroll at least one line in the requested direction. + Ensure that we actually do scroll backwards when requested to do so. + + * xdisp.c (redisplay_window): Only try to make cursor line fully + visible once (to avoid redisplay loop). + +2005-01-23 Kim F. Storm <storm@cua.dk> + + * window.c (Fpos_visible_in_window_p): Simplify return value for + partially visible rows. + (window_scroll_pixel_based): Adapt to that change. + + * window.c (window_scroll_pixel_based): Force moving to next line + if scrolling doesn't move start point, e.g. if looking at tall image. + + * xdisp.c (pos_visible_p): Return 0 if non-interactive. + Clear last_height before calling line_bottom_y to get real height. + Fix calculation of y. + +2005-01-22 Steven Tamm <steventamm@mac.com> + + * s/darwin.h: Removed PTY_ITERATION from here. + (DARWIN): Define. + + * process.c (init_process): Default process-connection-type to + nil on darwin 6 or less, t if it is 7 or higher. This way the + broken pty behavior is still allowed on darwin 6 for interactive + processes for people that know what they are doing. + +2005-01-22 Kim F. Storm <storm@cua.dk> + + * window.c (auto_window_vscroll_p): New boolean. + (syms_of_window): DEFVAR_BOOL it. + (Fpos_visible_in_window_p): Extend return value to include RTOP + and RBOT values if FULLY is nil. + (window_scroll_pixel_based): Adjust vscroll for partially visible + rows if auto_window_vscroll_p is set. + (Fset_window_vscroll): Do nothing if vscroll is not modified. + + * xdisp.c (pos_visible_p): Replace FULLY arg by RTOP and RBOT args + to return number of partially invisible pixels at top and bottom + of the dislay row at POS. + + * lisp.h (pos_visible_p): Fix prototype. + +2005-01-21 Richard M. Stallman <rms@gnu.org> + + * fileio.c (Fcopy_file): Doc fix. + +2005-01-21 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (xg_tool_bar_detach_callback): Remove unused variable bw. + (xg_get_file_name): Move declaration ofx_use_old_gtk_file_dialog to + start of function for older compilers. + +2005-01-20 Richard M. Stallman <rms@gnu.org> + + * editfns.c (Fmessage): If arg is "", return "" (as before). + + * keymap.c (access_keymap): Protect from bad value of meta_prefix_char. + + * .gdbinit (xgetptr, xgetint, xgettype): Copy $arg0 into a temp + variable. + +2005-01-20 Steven Tamm <steventamm@mac.com> + + * editfns.c (Voperating_system_release): Add. + (init_editfns): Assign new variable operating-system-release + based on call to uname if available. + (get_operating_system_release): Add function to + allow c-level access to operating system release. + + * config.h: Regenerated. + + * s/darwin.h (PTY_ITERATION): Don't allow PTYs on darwin 6 or less. + (MIN_PTY_KERNEL_VERSION): Define minimum kernel version for + using ptys as '7'. + +2005-01-20 Kim F. Storm <storm@cua.dk> + + * alloc.c (STRING_MARKED_P, VECTOR_MARKED_P): Return boolean. + + * xterm.c (x_draw_glyph_string_box): Fix last_x for full width rows. + Thanks to Chong Yidong <cyd@stupidchicken.com> for debugging this. + + * macterm.c (x_draw_glyph_string_box): Likewise. + + * w32term.c (x_draw_glyph_string_box): Likewise. + + * indent.c (Fvertical_motion): Temporarily disable selective display. + +2005-01-19 Kim F. Storm <storm@cua.dk> + + * xdisp.c (note_mode_line_or_margin_highlight): Fix :pointer + image property. + + * fns.c (sweep_weak_table): Advance prev pointer when we keep a pair. + +2005-01-18 Kim F. Storm <storm@cua.dk> + + * xdisp.c (fast_find_position): Backtrack to find first row if + charpos is inside a display overlay that spans multiple lines. + +2005-01-18 Kenichi Handa <handa@m17n.org> + + * coding.c (decode_coding_iso2022): Translate invalid codes if + translation-table is specified. + +2005-01-18 Kim F. Storm <storm@cua.dk> + + * xdisp.c (back_to_previous_visible_line_start): Undo 2004-12-28 + change. If handle_display_prop indicates newline is replaced by + image or text, move back to start of relevant overlay or interval + and continue scan from there. Simplify. + +2005-01-17 Kim F. Storm <storm@cua.dk> + + * dispnew.c (mode_line_string, marginal_area_string): + Fix off-by-one error in search for glyph. + +2005-01-16 Kim F. Storm <storm@cua.dk> + + * macterm.c (syms_of_macterm) <mac-allow-anti-aliasing>: Doc fix. + +2005-01-16 Steven Tamm <steventamm@mac.com> + + * macterm.c (mac_to_x_fontname): Remove spurious argument. + +2005-01-16 Andreas Schwab <schwab@suse.de> + + * macterm.c (mac_draw_string_common): Fix compilation on OSX 10.1. + +2005-01-16 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * fringe.c (Fdefine_fringe_bitmap, init_fringe): When assigning + fringe_faces, cast result from xmalloc/xrealloc to Lisp_Object *. + +2005-01-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * keyboard.c (READABLE_EVENTS_DO_TIMERS_NOW) + (READABLE_EVENTS_FILTER_EVENTS, READABLE_EVENTS_IGNORE_SQUEEZABLES): + New flags for readable_events. + (get_filtered_input_pending, readable_filtered_events): Remove. + (tracking_off): Call readable_events and get_input_pending with + flag READABLE_EVENTS_DO_TIMERS_NOW. + (readable_events): Move code from old readable_filtered_events here, + but check new READABLE_EVENTS_* in argument flags instead of previous + two boolean arguments do_timers_now and filter_events. + If we are doing mouse tracking and the mouse moved, return only if + READABLE_EVENTS_IGNORE_SQUEEZABLES is not set in flags. + (swallow_events): Call get_input_pending with flag + READABLE_EVENTS_DO_TIMERS_NOW. + (get_input_pending): Move code from old get_filtered_input_pending + here. Replace boolean arguments do_timers_now, filter_events with + flags, and pass flags to readable_events. Document new + READABLE_EVENTS_* flags. + (detect_input_pending_ignore_squeezables): New function. + (detect_input_pending_run_timers): Call get_input_pending with flag + READABLE_EVENTS_DO_TIMERS_NOW. + (Finput_pending_p): Call get_input_pending with flags + READABLE_EVENTS_DO_TIMERS_NOW and READABLE_EVENTS_FILTER_EVENTS. + + * dispnew.c (update_window, update_frame_1): Replace calls to + detect_input_pending with detect_input_pending_ignore_squeezables + so that redisplay is not paused if the event queue contains only + mouse movements. + + * lisp.h: Declare detect_input_pending_ignore_squeezables. + +2005-01-15 Steven Tamm <steventamm@mac.com> + + * macterm.c (Vmac_use_core_graphics): Declare variable for + mac-allow-anti-aliasing. + (syms_of_macterm): DEFVAR_LISP and initialize it. + (mac_draw_string_common): Use core graphics text rendering if + mac-allow-anti-aliasing is enabled. + + * macfns.c (Fx_file_dialog): Save As dialog includes only the + file name in the text box. + +2005-01-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macfns.c (x_set_foreground_color, x_set_background_color): + Sync with xfns.c. + (mac_window, x_create_tip_frame): Use XSetWindowBackground. + * macterm.c (XSetBackground, XSetWindowBackground): New functions. + * macterm.h (XSetBackground, XSetWindowBackground): Add externs. + +2005-01-14 Kim F. Storm <storm@cua.dk> + + * keyboard.c (Fposn_at_x_y): Add optional arg WHOLE. + +2005-01-13 Richard M. Stallman <rms@gnu.org> + + * keymap.c (Fcurrent_active_maps): Ignore Voverriding_local_map + if Voverriding_terminal_local_map is non-nil. + + * keyboard.c (syms_of_keyboard): Doc fix. + +2005-01-13 Kim F. Storm <storm@cua.dk> + + * xdisp.c (Fformat_mode_line): Fix last change. Remove NO_PROPS arg + (specify 0 for FACE instead). Reorder arg list. Doc fix. + +2005-01-12 Richard M. Stallman <rms@gnu.org> + + * xdisp.c (Fformat_mode_line): New arg FACE specifies a default + face property for characters that don't specify one. + + * fns.c (Frequire): Record in load-history unconditionally. + +2005-01-10 Kim F. Storm <storm@cua.dk> + + * dispextern.h (merge_faces): Rename from merge_into_realized_face. + + * xfaces.c (merge_faces): Rename from merge_into_realized_face. + Callers changed. + Add support to merge with lisp face id too (if face_name is t). + + * xdisp.c (get_next_display_element, next_element_from_display_vector): + Don't lookup lface_id from display table glyphs here; instead use + merge_faces to merge the lisp face id into current face. + +2005-01-09 Kim F. Storm <storm@cua.dk> + + * dispextern.h (struct it): New member dpvec_face_id. + (merge_into_realized_face): Add prototype. + + * xfaces.c (merge_into_realized_face): New function. Used to + merge escape-glyph face or face from display table into current face. + + * xdisp.c (Vshow_nonbreak_escape): New lisp var. + (syms_of_xdisp): DEFVAR_LISP it. + (escape_glyph_face): Remove var. + (redisplay_window): Don't initialize it. + (setup_for_ellipsis, get_next_display_element): + Set it->dpvec_face_id to -1. + (get_next_display_element): Test Vshow_nonbreak_escape. + Do not setup escape_glyph_face. + Properly merge escape-glyph face or face from display table with + current face for escape and control characters. + Set it->dpvec_face_id to relevant face id instead of adding it to each + element of display vector. + (next_element_from_display_vector): If it->dpvec_face_id is set, + use that instead of lface_id from glyph itself. + +2005-01-08 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.h (struct x_output): New member, toolbar_detached. + + * gtkutil.c (xg_create_frame_widgets): Set initial tool bar height to + 38. + (xg_tool_bar_detach_callback): Set toolbar_detached to 1. + (xg_tool_bar_attach_callback): Set toolbar_detached to 0. + (xg_create_tool_bar): Initialize toolbar_detached. + (update_frame_tool_bar): Only set FRAME_TOOLBAR_HEIGHT (f) if + toolbar_detached is zero. + +2005-01-07 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xmenu.c (create_and_show_popup_menu): Pass zero as button to + gtk_menu_popup if not for_click, so callbacks for the menu are called. + + * gtkutil.c (xg_gtk_scroll_destroy, xg_create_scroll_bar) + (xg_tool_bar_callback, xg_tool_bar_help_callback) + (update_frame_tool_bar): Cast to EMACS_INT to avoid compiler warning. + + * xselect.c (x_get_foreign_selection, x_fill_property_data) + (Fx_get_atom_name, Fx_send_client_event): Replace XFLOAT with + XFLOAT_DATA to get extract number from Lisp object. + +2005-01-07 Kim F. Storm <storm@cua.dk> + + * xdisp.c (set_iterator_to_next): Fix 2004-12-13 change. + Set stop_charpos to current charpos instead of 0. + +2005-01-06 Nick Roberts <nickrob@snap.net.nz> + + * xdisp.c (Fformat_mode_line): First arg now required. + +2005-01-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c (XLoadQueryFont): Correctly handle 0 size + font widths that are returned from some Japanese fonts. + +2005-01-06 Kim F. Storm <storm@cua.dk> + + * fringe.c (fringe_faces): Change to Lisp_Object pointer. + (draw_fringe_bitmap_1): Lookup user defined fringe faces here. + (destroy_fringe_bitmap): Set fringe_faces element to nil. + (Fdefine_fringe_bitmap, init_fringe): Change allocation of + fringe_faces array and init elements to nil. + (Fset_fringe_bitmap_face): Set fringe_faces to face name instead of + non-persistent face id. + (mark_fringe_data): New function for GC. + + * alloc.c (mark_fringe_data): Declare extern. + (Fgarbage_collect): Call mark_fringe_data. + + * alloc.c (overrun_check_free): Invalidate freed memory if + XMALLOC_CLEAR_FREE_MEMORY is defined. + +2005-01-05 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macfns.c: Include sys/param.h. + [TARGET_API_MAC_CARBON] (mac_nav_event_callback): New declaration + and function. + [TARGET_API_MAC_CARBON] (Fx_file_dialog): Use MAXPATHLEN for size + of filename string. Set event callback function when creating + dialog boxes. Add code conversions for filenames. Don't dispose + of apple event descriptor record if failed to create it. + + * macterm.c: Include sys/param.h. + [USE_CARBON_EVENTS] (mac_handle_window_event): Add handler for + kEventWindowUpdate. + (install_window_handler) [USE_CARBON_EVENTS]: Register it. + (do_ae_open_documents) [TARGET_API_MAC_CARBON]: Get FSRef instead + of FSSpec from apple event descriptor record. + (do_ae_open_documents) [TARGET_API_MAC_CARBON]: Use MAXPATHLEN for + size of filename string. + [TARGET_API_MAC_CARBON] (mac_do_receive_drag): Likewise. + [TARGET_API_MAC_CARBON] (mac_do_receive_drag): Return error when a + file dialog is in action. + [TARGET_API_MAC_CARBON] (mac_do_track_drag): Likewise. + Reject only when there are no filename items. Set background color + before (un)highlighting the window below the dragged items. + (XTread_socket) [USE_CARBON_EVENTS]: Don't call do_window_update. + +2005-01-05 Romain Francoise <romain@orebokech.com> + + * term.c (encode_terminal_code): Fix buffer size computation. + +2005-01-04 Richard M. Stallman <rms@gnu.org> + + * xdisp.c (Fformat_mode_line): Doc fix. + +2005-01-04 Stefan Monnier <monnier@iro.umontreal.ca> + + * alloc.c (refill_memory_reserve): Move. + (emacs_blocked_free, emacs_blocked_malloc, emacs_blocked_realloc) + (reset_malloc_hooks, uninterrupt_malloc) [SYNC_INPUT]: Don't define. + +2005-01-03 Richard M. Stallman <rms@gnu.org> + + * window.c (window_scroll_pixel_based): Don't correct preserve_y + for CURRENT_HEADER_LINE_HEIGHT when moving backwards. + +2005-01-03 Jason Rumney <jasonr@gnu.org> + + * w32bdf.c (w32_load_bdf_font): Set fontp->average_width and + fontp->space_width to FONT_WIDTH so they are valid. + + * w32fns.c (w32_load_system_font): Set FONT_WIDTH to maximum, not + average width. Set fontp->average_width and fontp->space_width to + their appropriate values. + + * w32term.c (x_new_font): Set FRAME_COLUMN_WIDTH to + fontp->average_width, not FONT_WIDTH. Set FRAME_SPACE_WIDTH to + fontp->space_width. + +2005-01-03 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c (x_new_font): Set FRAME_SPACE_WIDTH. + (x_font_min_bounds, XLoadQueryFont): Use the correct font width + metrics for max and min bounds. + (x_load_font): Correctly calculate average font width metrics. + +2005-01-02 Richard M. Stallman <rms@gnu.org> + + * alloc.c (Fgarbage_collect): Don't truncate_undo_list on dead buffers. + +2004-12-31 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.c (handle_one_xevent): Clear area in expose event for GTK. + +2004-12-31 Richard M. Stallman <rms@gnu.org> + + * xdisp.c (setup_for_ellipsis, get_next_display_element): + Set it->ellipsis_p to 1 or 0. + (display_line): Record whether row ends in mid-ellipsis. + (set_cursor_from_row): If ends in ellipsis, find start of it. + (cursor_row_p): If PT's at the end of the ellipsis the row + ends within, don't display cursor on this row. + + * dispextern.h (struct it): New element ellipsis_p. + (struct glyph_row): New element ends_in_ellipsis_p. + + * xdisp.c (BUFFER_POS_REACHED_P): We haven't reached the specified + position if we're reading from something other than the buffer. + + * window.c (window_scroll_pixel_based): Only look at + Vscroll_preserve_screen_position if the old PT can't be kept. + (syms_of_window) <scroll-preserve-screen-position>: Doc fix. + +2004-12-30 Kim F. Storm <storm@cua.dk> + + * xdisp.c (get_line_height_property): New function extracted from + original calc_line_height_property. + (calc_line_height_property): Rework. Handle t and (nil . ratio). + (x_produce_glyphs): Use them to handle line-height and + line-spacing according to new height spec. + (Qtotal): Remove. + (syms_of_xdisp): Remove intern and staticpro for Qtotal. + +2004-12-30 Kenichi Handa <handa@m17n.org> + + * fileio.c (Finsert_file_contents): Don't use + current_buffer->buffer_file_coding_system even if REPLACE is + non-nil. Call Qafter_insert_file_set_coding with the second arg VISIT. + + * fontset.h (struct font_info): New members space_width and + average_width. + + * frame.h (struct frame): New member space_width. + (FRAME_SPACE_WIDTH): New macro. + + * xterm.h (struct x_display_info): New member Xatom_AVERAGE_WIDTH. + + * xterm.c (x_new_font): Set FRAME_COLUMN_WIDTH to + fontp->average_width, not FONT_WIDTH. Set FRAME_SPACE_WIDTH to + fontp->space_width. + (x_load_font): Calculate fontp->space_width and fontp->average_width. + (x_term_init): Initialize dpyinfo->Xatom_AVERAGE_WIDTH. + + * xdisp.c (x_produce_glyphs): Calculate tab width by + FRAME_SPACE_WIDTH, not FRAME_COLUMN_WIDTH. + +2004-12-29 Sanghyuk Suh <han9kin@mac.com> + + * macterm.c (SelectionRange): Add Xcode position apple event struct. + (do_ae_open_documents): Handle Xcode-style file position open events. + +2004-12-29 Luc Teirlinck <teirllm@auburn.edu> + + * buffer.c (syms_of_buffer) <vertical-scroll-bar>: Correct typo. + +2004-12-29 Richard M. Stallman <rms@gnu.org> + + * buffer.c (syms_of_buffer) <vertical-scroll-bar>: Doc fix. + +2004-12-29 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macfns.c (install_window_handler): Modify extern to return OSErr + value. + (mac_window): Handle return value of install_window_handler. + + * macterm.c (reflect_byte): Remove function. + (mac_create_bitmap_from_bitmap_data): Don't call reflect_byte. + Lookup table instead. + (mac_do_font_lists): Simplify calculation of the longest + nonspecial string. + (init_mac_drag_n_drop): Remove function and declaration. + (mac_initialize) [TARGET_API_MAC_CARBON]: Don't call + init_mac_drag_n_drop. + (mac_do_track_drag): New function and declaration. + (install_window_handler): Return OSErr value. + (install_window_handler) [TARGET_API_MAC_CARBON]: + Register handlers for tracking/receiving drag-and-drop items. + (do_ae_open_documents): Generate unibyte strings for filenames. + (mac_do_receive_drag) [TARGET_API_MAC_CARBON]: Likewise. + Reject only non-filename items. Set event modifiers, and return value. + +2004-12-28 Dan Nicolaescu <dann@ics.uci.edu> + + * coding.c (decode_coding): Fix previous change. + +2004-12-28 Richard M. Stallman <rms@gnu.org> + + * xdisp.c (back_to_previous_visible_line_start): + Don't call handle_display_prop. + +2004-12-28 Dan Nicolaescu <dann@ics.uci.edu> + + * coding.c (decode_coding_XXX, decode_composition_emacs_mule) + (decode_coding_emacs_mule, encode_coding_emacs_mule) + (decode_coding_iso2022, encode_designation_at_bol) + (encode_coding_iso2022, decode_coding_sjis_big5, decode_eol) + (decode_coding): Constify arguments and local vars. + +2004-12-27 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xmenu.c (popup_get_selection): Only pop down dialogs + on C-g and Escape. + (popup_get_selection): Remove parameter down_on_keypress. + (create_and_show_popup_menu, create_and_show_dialog): + Remove parameter down_on_keypress to popup_get_selection. + +2004-12-27 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * dispextern.h: Change HAVE_CARBON to MAC_OS. + (struct glyph_string): Likewise. + + * emacs.c (main) [MAC_OS8]: Call mac_term_init instead of + mac_initialize. + + * fileio.c (Fnext_read_file_uses_dialog_p, Fread_file_name): + Change TARGET_API_MAC_CARBON to HAVE_CARBON. + + * fns.c (vector): Change MAC_OSX to MAC_OS. + + * frame.c (x_set_frame_parameters, x_report_frame_params) + (x_set_fullscreen): Remove #ifndef HAVE_CARBON. + (x_set_border_width, Vdefault_frame_scroll_bars): + Change HAVE_CARBON to MAC_OS. + + * image.c [MAC_OS]: Include sys/stat.h. + [MAC_OS && !MAC_OSX]: Include sys/param.h, ImageCompression.h, and + QuickTimeComponents.h. + + * mac.c [!MAC_OSX] (mac_wait_next_event): Add extern. + [!MAC_OSX] (select): Use mac_wait_next_event. + [!MAC_OSX] (run_mac_command): Change EXEC_SUFFIXES to Vexec_suffixes. + [!MAC_OSX] (select, run_mac_command): Change `#ifdef + TARGET_API_MAC_CARBON' to `#if TARGET_API_MAC_CARBON'. + (mac_clear_font_name_table): Add extern. + (Fmac_clear_font_name_table): New defun. + (syms_of_mac): Defsubr it. + [MAC_OSX] (SELECT_POLLING_PERIOD_USEC): New define. + [MAC_OSX] (select_and_poll_event): New function. + [MAC_OSX] (sys_select): Use it. + [MAC_OSX && SELECT_USE_CFSOCKET] (socket_callback): New function. + [MAC_OSX && SELECT_USE_CFSOCKET] + (SELECT_TIMEOUT_THRESHOLD_RUNLOOP, EVENT_CLASS_SOCK): New defines. + [MAC_OSX] (sys_select) [SELECT_USE_CFSOCKET]: Use CFSocket and + RunLoop for simultaneously monitoring two kinds of inputs, window + events and process outputs, without periodically polling. + + * macfns.c (mac_initialized): Remove extern. + (stricmp): Put in #if 0. All callers changed to use xstricmp in + xfaces.c. + (strnicmp): Decrement `n' at the end of each loop, not the beginning. + (check_mac): Use the term "Mac native windows" instead of "Mac OS". + (check_x_display_info, x_display_info_for_name): Sync with xfns.c. + (mac_get_rdb_resource): New function (from w32reg.c). + (x_get_string_resource): Use it. + (install_window_handler): Add extern. + (mac_window): New function. + (Fx_create_frame): Use it instead of make_mac_frame. + Set parameter for Qfullscreen. Call x_wm_set_size_hint. + (Fx_open_connection, Fx_close_connection): New defuns. + (syms_of_macfns): Defsubr them. + (x_create_tip_frame) [TARGET_API_MAC_CARBON]: + Add kWindowNoUpdatesAttribute to the window attribute. + (x_create_tip_frame) [!TARGET_API_MAC_CARBON]: Use NewCWindow. + (x_create_tip_frame): Don't call ShowWindow. + (Fx_show_tip): Call ShowWindow. + (Fx_file_dialog): Change `#ifdef TARGET_API_MAC_CARBON' to `#if + TARGET_API_MAC_CARBON'. + (mac_frame_parm_handlers): Set handlers for Qfullscreen. + (syms_of_macfns) [MAC_OSX]: Initialize mac_in_use to 0. + + * macgui.h [!MAC_OSX]: Don't include Controls.h. Include Windows.h. + (Window): Typedef to WindowPtr and move outside `#if + TARGET_API_MAC_CARBON'. + (XSizeHints): New struct. + + * macterm.c (x_update_begin, x_update_end) + [TARGET_API_MAC_CARBON]: Disable screen updates during update of a + frame. + (x_draw_glyph_string_background, x_draw_glyph_string_foreground) + [MAC_OS8]: Use XDrawImageString/XDrawImageString16. + (construct_mouse_click): Put in #if 0. + (x_check_fullscreen, x_check_fullscreen_move): Remove decls. + (x_scroll_bar_create, x_scroll_bar_handle_click): Change `#ifdef + TARGET_API_MAC_CARBON' to `#if TARGET_API_MAC_CARBON'. + (activate_scroll_bars, deactivate_scroll_bars) + [!TARGET_API_MAC_CARBON]: Use ActivateControl/DeactivateControl. + (x_make_frame_visible) [TARGET_API_MAC_CARBON]: Reposition window + if the position is neither user-specified nor program-specified. + (x_free_frame_resources): Free size_hints. + (x_wm_set_size_hint): Allocate size_hints if needed. Set size_hints. + (mac_clear_font_name_table): New function. + (mac_do_list_fonts): Initialize font_name_table if needed. + (x_list_fonts): Don't initialize font_name_table. Add BLOCK_INPUT + around mac_do_list_fonts. + (mac_unload_font): New function. + (x_load_font): Add BLOCK_INPUT around XLoadQueryFont. + (init_mac_drag_n_drop, mac_do_receive_drag): Enclose declarations + and definitions with #if TARGET_API_MAC_CARBON. + [USE_CARBON_EVENTS] (mac_handle_window_event): Add decl. + (install_window_handler): Add decl. + (do_window_update): Add BeginUpdate/EndUpdate for the tooltip + window. Use UpdateControls. Get the rectangle that should be + updated and restrict the target of expose_frame to it. + (do_grow_window): Set minimum height/width according to size_hints. + (do_grow_window) [TARGET_API_MAC_CARBON]: Use ResizeWindow. + (do_zoom_window): Don't use x_set_window_size. + [USE_CARBON_EVENTS] (mac_handle_window_event): New function. + (install_window_handler): New function. + [!USE_CARBON_EVENTS] (mouse_region): New variable. + [!USE_CARBON_EVENTS] (mac_wait_next_event): New function. + (XTread_socket) [USE_CARBON_EVENTS]: Move call to + GetEventDispatcherTarget inside BLOCK_INPUT. + (XTread_socket) [!USE_CARBON_EVENTS]: Use mac_wait_next_event. + Update mouse_region when mouse is moved. + (make_mac_frame): Remove. + (make_mac_terminal_frame): Put in #ifdef MAC_OS8. + Initialize mouse pointer shapes. Change values of f->left_pos and + f->top_pos. Don't use make_mac_frame. Use NewCWindow. + Don't call ShowWindow. + (mac_initialize_display_info) [MAC_OSX]: Create mac_id_name from + Vinvocation_name and Vsystem_name. + (mac_make_rdb): New function (from w32term.c). + (mac_term_init): Use it. Add BLOCK_INPUT. Error if display has + already been opened. Don't pass argument to + mac_initialize_display_info. Don't set dpyinfo->height/width. + Add entries to x_display_list and x_display_name_list. + (x_delete_display): New function. + (mac_initialize): Don't call mac_initialize_display_info. + (syms_of_macterm) [!MAC_OSX]: Don't call Fprovide. + + * macterm.h (check_mac): Add extern. + (struct mac_output): New member size_hints. + (FRAME_SIZE_HINTS): New macro. + (mac_unload_font): Add extern. + + * xdisp.c (expose_window, expose_frame): Remove kludges for Mac. + + * xfaces.c (clear_font_table) [MAC_OS]: Call mac_unload_font. + +2004-12-27 Richard M. Stallman <rms@gnu.org> + + * buffer.c (Fbuffer_disable_undo): Delete (move to simple.el). + (syms_of_buffer): Don't defsubr it. + + * process.c (list_processes_1): Set undo_list instead + of calling Fbuffer_disable_undo. + + * xdisp.c (single_display_spec_string_p): Rename from + single_display_prop_string_p. + (single_display_spec_intangible_p): Rename from + single_display_prop_intangible_p. + (handle_single_display_spec): Rename from handle_single_display_prop. + Rewritten to be easier to understand. + + Change in load-history format. Functions now get (defun . NAME), + and variables get just NAME. + + * data.c (Fdefalias): Use (defun . FN_NAME) in LOADHIST_ATTACH. + + * eval.c (Fdefun, Fdefmacro): Use (defun . FN_NAME) in LOADHIST_ATTACH. + (Fdefvaralias, Fdefvar, Fdefconst): Use just SYM in LOADHIST_ATTACH. + (Qdefvar): Var deleted. + (syms_of_eval): Don't initialze it. + + * lread.c (syms_of_lread) <load-history>: Doc fix. + +2004-12-27 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xmenu.c (popup_get_selection): Pop down on C-g. + (set_frame_menubar): Install translations for Lucid/Motif/Lesstif that + pops down menu on C-g. + (xdialog_show): If dialog popped down and no button in the dialog was + pushed, call Fsignal to quit. + (xmenu_show): In no toolkit version, if menu returns NO_SELECT call + Fsignal to quit. + + * xfns.c (Fx_file_dialog): Motif/Lesstif version: Pop down on C-g. + + * gtkutil.c (xg_initialize): Install bindings for C-g so that + dialogs and menus pop down. + +2004-12-27 Kenichi Handa <handa@m17n.org> + + * coding.c (code_convert_region): Fix calculation of `ratio'. + +2004-12-25 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (update_frame_tool_bar): Make the value of + tool-bar-button-margin control margins of images in tool bar. + + * alloc.c (check_depth): New variable. + (overrun_check_malloc, overrun_check_realloc): Only add + overhead and write check pattern if check_depth is 1 (to handle + recursive calls). Increase/decrease check_depth in entry/exit. + (overrun_check_free): Only check for overhead if check_depth is 1. + Increase/decrease check_depth in entry/exit. + +2004-12-23 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * keyboard.c (input_available_signal): Call SIGNAL_THREAD_CHECK + before touching input_available_clear_time, to avoid accessing it + from multiple threads. + +2004-12-23 Jason Rumney <jasonr@gnu.org> + + * image.c (__WIN32__) [HAVE_NTGUI]: Define for correct behaviour + of JPEG library. + +2004-12-22 Richard M. Stallman <rms@gnu.org> + + * emacs.c (main): If batch mode, set Vundo_outer_limit to nil. + + * lisp.h (Vundo_outer_limit): Fix decl. + + * undo.c (Vundo_outer_limit): Replaces undo_outer_limit. + Uses changed. + (syms_of_undo): Initialize appropriately. + (truncate_undo_list): If it's nil, there's no limit. + +2004-12-22 Kenichi Handa <handa@m17n.org> + + * xselect.c (Fx_get_cut_buffer_internal): Return a unibyte string. + +2004-12-21 Richard M. Stallman <rms@gnu.org> + + * eval.c (unwind_to_catch): Clear immediate_quit. + + * xdisp.c (get_next_display_element): Display codes 8a0 and 8ad + specially as `\ ' and `\-'. + + * keyboard.c (kbd_buffer_store_event_hold): + In the code for while-no-input, handle immediate_quit. + + * alloc.c (Fgarbage_collect): Update call to truncate_undo_list. + Call that at the very start. + (undo_limit, undo_strong_limit, undo_outer_limit): Move to undo.c. + (syms_of_alloc): Don't define undo-limit, + undo-strong-limit and undo-outer-limit here. + + * undo.c (truncate_undo_list): Return void. + Take just one argument, the buffer. + Make it current, and inhibit recursive GC. + Access and update the undo list directly; return void. + Refer to the undo...limit variables directly. + Test undo_outer_limit only after counting the whole current command. + When it's exceeded, call the function in undo-outer-limit-function. + (undo_limit, undo_strong_limit, undo_outer_limit): From alloc.c. + (Vundo_outer_limit_function): New variable. + (syms_of_undo): Define undo-limit, undo-strong-limit + and undo-outer-limit here, and undo-outer-limit-function. + Doc fixes. + + * lisp.h (truncate_undo_list): Update decl. + +2004-12-21 Piet van Oostrum <piet@cs.uu.nl> + + * fileio.c (Fread_file_name): Delete duplicates in + file-name-history when history_delete_duplicates is true. + +2004-12-20 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c (mac_do_list_fonts): Fix memory leak. + +2004-12-20 Richard M. Stallman <rms@gnu.org> + + * regex.c (re_match_2_internal) <symend, wordend>: + Fix calls to UPDATE_SYNTAX_TABLE_FORWARD. + +2004-12-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c (endif, x_font_name_to_mac_font_name): + Use maccentraleurroman instead of maccentraleuropean + (mac_c_string_match, mac_do_list_fonts): Speed up font search by + quickly finding a specific font without needing regexps. + +2004-12-15 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * syssignal.h: Declare main_thread. + (SIGNAL_THREAD_CHECK): New macro. + + * keyboard.c (input_available_signal): Move thread checking code + to macro SIGNAL_THREAD_CHECK and call that macro. + (interrupt_signal): Call SIGNAL_THREAD_CHECK. + + * alloc.c (uninterrupt_malloc): Move main_thread to emacs.c. + + * emacs.c: Define main_thread. + (main): Initialize main_thread. + (handle_USR1_signal, handle_USR2_signal, fatal_error_signal) + (memory_warning_signal): Call SIGNAL_THREAD_CHECK. + + * floatfns.c (float_error): Call SIGNAL_THREAD_CHECK. + + * dispnew.c (window_change_signal): Call SIGNAL_THREAD_CHECK. + + * sysdep.c (select_alarm): Call SIGNAL_THREAD_CHECK. + + * process.c (send_process_trap, sigchld_handler): + Call SIGNAL_THREAD_CHECK. + + * data.c (arith_error): Call SIGNAL_THREAD_CHECK. + + * atimer.c (alarm_signal_handler): Call SIGNAL_THREAD_CHECK. + + * xterm.c (xg_scroll_callback): Update XG_LAST_SB_DATA before + returning when xg_ignore_gtk_scrollbar is true. + +2004-12-14 Kim F. Storm <storm@cua.dk> + + * keyboard.c (read_char): Save and restore echo_string when + handling input method. + +2004-12-13 Richard M. Stallman <rms@gnu.org> + + * eval.c (syms_of_eval) <quit-flag>: Doc fix. + + * keyboard.c (Vthrow_on_input): New variable. + (syms_of_keyboard): Defvar and initialize it. + (kbd_buffer_store_event_hold): Handle Vthrow_on_input. + + * lisp.h (QUIT): Check for Vthrow_on_input. + (Vthrow_on_input): Declare it. + +2004-12-13 Kim F. Storm <storm@cua.dk> + + * xdisp.c (set_iterator_to_next): Reset stop_charpos after display + vector. + +2004-12-12 Richard M. Stallman <rms@gnu.org> + + * indent.c (Fvertical_motion): Call move_it_by_lines even if LINES = 0. + + * minibuf.c (Fall_completions): Add var `zero' and use it in loop. + (Ftry_completion): Really use outer `zero'; eliminate inner one. + +2004-12-12 Kenichi Handa <handa@m17n.org> + + * term.c (encode_terminal_code): Fix previous change. + +2004-12-11 Stefan Monnier <monnier@iro.umontreal.ca> + + * keyboard.c (handle_async_input): Remove pthread mutex handling. + (input_available_signal): Move pthread thingy to !SYNC_INPUT branch. + + * syntax.c (Fforward_word): Avoid non-idempotent side-effects + in macro arguments. + + * minibuf.c (Ftry_completion, Fall_completions): Don't use + XFASTINT blindly. + + * emacs.c (main, Fdump_emacs): Don't touch malloc hooks if SYNC_INPUT. + +2004-12-11 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * w32term.c (x_calc_absolute_position): Remove calculation of + difference between inner and outer window. Don't subtract difference + for left and top calculations. + + * xterm.c (x_calc_absolute_position): Don't subtract outer_pixel_diff + for left and top calculations. Remove call to x_real_positions. + [Bug report by Drew Adams in November.] + (x_check_expected_move): Do not set change_gravity to 1 when calling + x_set_offset. + +2004-12-08 Richard M. Stallman <rms@gnu.org> + + * xdisp.c (get_next_display_element): Use `escape-glyph' for + control chars and escaped octal codes. + (Qescape_glyph): New variable. + (syms_of_xdisp): Initialize it. + (escape_glyph_face): New variable. + (redisplay_window): Initialize it. + +2004-12-07 Paul Eggert <eggert@cs.ucla.edu> + + * image.c (our_fill_input_buffer, jpeg_load, CHECK_LIB_AVAILABLE) + (init_image): Use 1 rather than TRUE. TRUE's not always defined. + +2004-12-07 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * emacs.c (Fdump_emacs): Add ! defined (SYSTEM_MALLOC) around + reset_malloc_hooks. + + * keyboard.c (handle_async_input, input_available_signal): + Add ! defined (SYSTEM_MALLOC) around thread code. + + * alloc.c: Add comment about the reason for (UN)BLOCK_INPUT_ALLOC. + +2004-12-07 Stefan Monnier <monnier@iro.umontreal.ca> + + * eval.c (init_eval_once): Increase max_specpdl_size to 1000. + + * config.in: Regenerate. + +2004-12-07 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xmenu.c (Fx_popup_menu): Correct documentation about position. + (xmenu_show): Do not call XTranslateCoordinates. Adjust position + if not given by a mouse click to correspond with x-popup-menu + documentation. + + * config.in: Regenerate. + + * gtkutil.c: Include signal.h and syssignal.h. + (xg_get_file_name): Block and unblock __SIGRTMIN if defined. + + * alloc.c: If HAVE_GTK_AND_PTHREAD, include pthread.h, + new variables main_thread and alloc_mutex, + define (UN)BLOCK_INPUT_ALLOC to use alloc_mutex to protect + emacs_blocked_* calls and only do (UN)BLOCK_INPUT in the main thread. + If not HAVE_GTK_AND_PTHREAD, (UN)BLOCK_INPUT_ALLOC is the same + as (UN)BLOCK_INPUT. + (emacs_blocked_free, emacs_blocked_malloc) + (emacs_blocked_realloc): Use (UN)BLOCK_INPUT_ALLOC. + (uninterrupt_malloc): Initialize main_thread and alloc_mutex. + (reset_malloc_hooks): New function. + + * lisp.h: Declare reset_malloc_hooks. + + * emacs.c (Fdump_emacs): Call reset_malloc_hooks. + + * keyboard.c: Conditionally include pthread.h. + (handle_async_input, input_available_signalt): If not in the main + thread, block signal, send signal to main thread and return. + + * gtkutil.c (xg_get_file_with_chooser): Handle local files only. + Set current folder in file chooser if default_filename is a directory. + +2004-12-05 Stefan Monnier <monnier@iro.umontreal.ca> + + * regex.c (GET_UNSIGNED_NUMBER): Signal an error when reaching the end. + Remove redundant correctness checks. + (regex_compile): Fix up error codes for \{..\} expressions. + +2004-12-05 Richard M. Stallman <rms@gnu.org> + + * regex.c (regex_compile): Fix end-of-pattern case for space. + +2004-12-03 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.h (cfstring_create_with_utf8_cstring): Add prototype. + * mac.c (cfstring_create_with_utf8_cstring): Add to prevent + crashes with invalid characters. + * macmenu.c (add_menu_item): Use it. + * image.c (image_load_quartz2d): Likewise. + * macfns.c (x_set_name, x_set_title): Likewise. + (Fx_file_dialog): Likewise. Use constant CFRefs instead of + creating them each time for labels. + +2004-12-02 Richard M. Stallman <rms@gnu.org> + + * config.in (RE_TRANSLATE_P): If make_number is not a macro, + don't use it here. + + * eval.c (Fcalled_interactively_p): Don't check INTERACTIVE. + (interactive_p): Skip Scalled_interactively_p frames + like Sinteractive_p frames. + (unwind_to_catch): Clear handling_signal. + + * data.c (Fmake_variable_buffer_local): Doc fix. + (Fmake_local_variable): Doc fix. + + * insdel.c (insert_from_string_before_markers) + (insert_from_string): Don't modify buffer on empty insertion. + + * window.c (Fget_lru_window, Fget_largest_window): Doc fixes. + +2004-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macmenu.c (add_menu_item): Fallback on MacRoman if encoding + menu text as UTF8 fails. + +2004-12-01 Kim F. Storm <storm@cua.dk> + + * alloc.c: Add commentary for last change. + (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): New macros to handle + sizeof(size_t) != 4. + (overrun_check_malloc, overrun_check_realloc, overrun_check_free): + Use them. Also clear header and trailer of freed memory. + (GC_STRING_OVERRUN_COOKIE_SIZE): Rename from GC_STRING_EXTRA. + (string_overrun_cookie): Rename from string_overrun_pattern. + (GC_STRING_EXTRA): Define from GC_STRING_OVERRUN_COOKIE_SIZE. + +2004-12-01 Andreas Schwab <schwab@suse.de> + + * lisp.h: Declare string_to_multibyte. + +2004-12-01 Kenichi Handa <handa@m17n.org> + + * w32console.c (w32con_write_glyphs): Decide coding here. + Adjusted for the change of encode_terminal_code. + + * term.c (encode_terminal_code): Don't make it "static". + +2004-11-30 Kenichi Handa <handa@m17n.org> + + * term.c (encode_terminal_buf, encode_terminal_bufsize): New variables. + (encode_terminal_code): Argument changed. Encode all + characters at once, and return a pointer to the result of encoding. + (write_glyphs): Decide coding here. Adjusted for the above change. + (insert_glyphs): Likewise. + (term_init): Initialize encode_terminal_bufsize to 0. + + * coding.c (Vcode_conversion_workbuf_name): New variable. + (syms_of_coding): Initialize and staticpro it. + (set_conversion_work_buffer): New function. + (run_pre_post_conversion_on_str): Use it. + (run_pre_write_conversin_on_c_str): New function. + + * coding.h (run_pre_write_conversin_on_c_str): Extern it. + +2004-11-30 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * keyboard.c: Don't undef SIGIO + * s/darwin.h (NO_SOCK_SIGIO): Define NO_SOCK_SIGIO on carbon + * Makefile.in (mac.o): Depend on blockinput.h and atimer.h. + (macfns.o): Don't depend on ccl.h. + * macfns.c (mac_frame_parm_handlers): Set handlers for + Qleft_fringe and Qright_fringe. + * macterm.c (mac_fill_rectangle_to_pixmap) + (mac_draw_rectangle_to_pixmap, mac_copy_area_to_pixmap) + (mac_copy_area_with_mask_to_pixmap, x_draw_image_foreground_1): + Put in #if 0. + (mac_scroll_area) [TARGET_API_MAC_CARBON]: Use ScrollWindowRect. + (x_flush) [TARGET_API_MAC_CARBON]: Don't traverse frames. + (XFlush) [TARGET_API_MAC_CARBON]: Define to an empty replacement. + (x_draw_glyph_string_background, x_draw_glyph_string_foreground) + [!MAC_OS8]: Added ifdef'd out code for os8. Don't use + XDrawImageString. Always draw background and foreground separately. + (x_draw_image_foreground): Use clipping instead of computing the + intersection rectangle. + (x_draw_image_glyph_string): Don't draw an image with mask to a + pixmap. + (x_redisplay_interface): Set flush_display_optional member to 0. + (XTread_socket): Correctly reset the TEConverter + object. + +2004-11-30 Kim F. Storm <storm@cua.dk> + + * lisp.h: New defines to enable buffer overrun checking. + (GC_CHECK_STRING_OVERRUN, GC_CHECK_STRING_FREE_LIST) + (XMALLOC_OVERRUN_CHECK, GC_CHECK_CONS_LIST): Add. + + * alloc.c: Add more checks for buffer overruns. + (XMALLOC_OVERRUN_CHECK_SIZE, xmalloc_overrun_check_header) + xmalloc_overrun_check_trailer, overrun_check_malloc) + overrun_check_realloc, overrun_check_free): Add. + (GC_STRING_EXTRA, string_overrun_pattern): Add. + (check_sblock, allocate_string_data, compact_small_strings): + Set and check string_overrun_pattern if GC_CHECK_STRING_OVERRUN. + (check_cons_list): Condition on GC_CHECK_CONS_LIST. + (check_string_free_list): Add. + (allocate_string, sweep_strings): Call check_string_free_list. + + * emacs.c (malloc_initialize_hook): Don't free malloc_state_ptr if + XMALLOC_OVERRUN_CHECK to avoid crash during load. + +2004-11-29 Kim F. Storm <storm@cua.dk> + + * fns.c (concat): Use SAFE_ALLOCA. + +2004-11-29 Stefan Monnier <monnier@iro.umontreal.ca> + + * sysdep.c (emacs_write): Don't use QUIT. + +2004-11-29 Kenichi Handa <handa@m17n.org> + + * buffer.c (init_buffer): Set current_buffer->directory to a + multibyte string made by string_to_multibyte. + + * emacs.c (init_cmdargs): Set unibyte strings in Vcommand_line_args. + +2004-11-27 Andreas Schwab <schwab@suse.de> + + * alloc.c (mark_stack): Call GC_MARK_SECONDARY_STACK if defined. + + * s/gnu-linux.h: Enable no-op gcpros on ia64. + (GC_MARK_SECONDARY_STACK) [__ia64__]: Define. + + * filelock.c (lock_file_1): Call get_boot_time early. + Increase buffer size. + +2004-11-27 Eli Zaretskii <eliz@gnu.org> + + * lisp.h (DECL_ALIGN): Define non-trivially only if NO_DECL_ALIGN + is not defined. + +2004-11-27 Kim F. Storm <storm@cua.dk> + + * search.c (syms_of_search) <search-spaces-regexp>: Move 'doc:' + marker out of doc string. + +2004-11-26 Stefan Monnier <monnier@iro.umontreal.ca> + + * s/darwin.h (POSIX_SIGNALS): Undo the removal of 2002-08-25, + which was not mentioned in the log. + +2004-11-26 Kim F. Storm <storm@cua.dk> + + * fringe.c (update_window_fringes): Prefer truncation bitmaps over + angle bitmaps at top/bottom line. + + * xdisp.c: Undo recent changes for restoring saved_face_id. Instead, + set it when it->method is set to next_element_from_display_vector. + (setup_for_ellipsis): Add LEN argument. Callers changed. + Set it->saved_face_id. + (get_next_display_element): Use loop instead of recursion. + Set it->saved_face_id. Combine duplicate code for ctr chars. + (next_element_from_display_vector): Do not set it->saved_face_id. + (next_element_from_ellipsis): Use setup_for_ellipsis. + +2004-11-26 Eli Zaretskii <eliz@gnu.org> + + * eval.c (Fdefvar): Declare pdl from last change as `volatile' to + prevent compiler warnings. + +2004-11-25 Stefan Monnier <monnier@iro.umontreal.ca> + + * keyboard.c (command_loop_1): Print a message describing the key + the user just pressed when this key has no binding. + + * sysdep.c (sys_signal): Don't use SA_RESTART if SYNC_INPUT is set. + (emacs_open, emacs_read, emacs_write): Check QUIT when interrupted. + + * lread.c (readchar): Check QUIT when `getc' is interrupted. + +2004-11-24 Richard M. Stallman <rms@gnu.org> + + * coding.c (run_pre_post_conversion_on_str): Bind Qinhibit_read_only. + + * buffer.c (syms_of_buffer) <indicate-buffer-boundaries>: Doc fix. + +2004-11-24 Kim F. Storm <storm@cua.dk> + + * xdisp.c (move_it_in_display_line_to, display_line): + Restore saved_face_id also when truncate-lines or hscrolled. + +2004-11-23 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (xg_get_file_name): Rename use-old-gtk-file-dialog to + x-use-old-gtk-file-dialog. + + * xfns.c: Define x_use_old_gtk_file_dialog. + (syms_of_xfns): Rename use-old-gtk-file-dialog to x-... Move it + outside ifdef USE_GTK. + +2004-11-23 Stefan Monnier <monnier@iro.umontreal.ca> + + * coding.h (ENCODE_FILE, DECODE_FILE, ENCODE_SYSTEM, DECODE_SYSTEM): + Don't use XFASTINT blindly. + + * config.in (RE_TRANSLATE_P): Don't use XFASTINT blindly. + + * indent.c (skip_invisible): Avoid non-idempotent side-effects + in macro arguments. + + * keymap.c (Flookup_key): Check INTEGERP before XINT. + + * lread.c (oblookup): Don't use XFASTINT blindly. + + * window.c (Fset_window_scroll_bars): Don't use XINT if it isn't int. + (decode_next_window_args, window_loop): Don't use XFASTINT blindly. + +2004-11-23 Kim F. Storm <storm@cua.dk> + + * dispextern.h (MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P) + (MATRIX_ROW_STARTS_IN_MIDDLE_OF_CHAR_P): Not if dpvec_index is zero. + + * xfaces.c (lookup_named_face): Add signal_p arg. Return -1 if + signal_p is zero and face name is unknown. + (Fx_list_fonts): Don't signal error in lookup_named_face. + (Fface_font): Signal error in lookup_named_face. + (ascii_face_of_lisp_face): Likewise. + + * dispextern.h (lookup_named_face): Fix prototype. + + * xdisp.c (handle_single_display_prop): Don't signal error in + lookup_named_face for unknown fringe face name. + (highlight_trailing_whitespace): Don't signal error in + lookup_named_face if trailing-whitespace face unknown. + (calc_line_height_property): Don't signal error in + lookup_named_face if specified face name is unknown. + + * fringe.c (update_window_fringes): Show top row indicator if + window has header-line. Don't show arrow at bob and eob + if the boundary indicators are not used. + (Fset_fringe_bitmap_face): Signal error in lookup_named_face. + + * window.c (set_window_buffer): Clear display_error_modiff. + +2004-11-22 Kim F. Storm <storm@cua.dk> + + * fringe.c (update_window_fringes): Provide sensible fall-back + value for non-nil indicate-buffer-boundaries setting. + +2004-11-22 Markus Rost <rost@ias.edu> + + * minibuf.c (Fminibuffer_complete_and_exit): Fix previous change. + +2004-11-22 Stefan Monnier <monnier@iro.umontreal.ca> + + * eval.c (Fdefvar): Warn when var is let-bound but globally void. + +2004-11-21 Kim F. Storm <storm@cua.dk> + + * xdisp.c (erase_phys_cursor): Clear hollow cursor inside TEXT_AREA. + + * xterm.c (x_clip_to_row): Add area arg. Callers changed. + (x_draw_hollow_cursor, x_draw_bar_cursor): Clip to TEXT_AREA. + + * w32term.c (w32_clip_to_row): Add area arg. Callers changed. + (x_draw_hollow_cursor, x_draw_bar_cursor): Clip to TEXT_AREA. + + * macterm.c (x_clip_to_row): Add area arg. Callers changed. + (x_draw_hollow_cursor, x_draw_bar_cursor): Clip to TEXT_AREA. + + * xdisp.c (move_it_in_display_line_to, display_line): + Restore saved_face_id if overflow-newline-into-fringe is enabled and + line is continued before or in middle of element from display vector. + + * indent.c (Fvertical_motion): Fix last change. Use another + method to detect if iterator moved too far ahead after reseat. + + * xdisp.c (IT_EXPAND_MATRIX_WIDTH): New macro. Do not + expand matrix width for overflow in zero-width area. + (append_glyph, append_composite_glyph, produce_image_glyph) + (append_stretch_glyph): Use it to avoid loop in redisplay. + (note_mode_line_or_margin_highlight): Don't let help-echo from + string override help-echo from image map. + +2004-11-20 Luc Teirlinck <teirllm@auburn.edu> + + * fns.c (Fyes_or_no_p): Call Fread_from_minibuffer with extra argument. + * callint.c (Fcall_interactively): Ditto. + +2004-11-20 Stefan Monnier <monnier@iro.umontreal.ca> + + * minibuf.c (Fminibuffer_complete_and_exit): + Fixup the case of the completed value, for case-indep completion. + +2004-11-20 Richard M. Stallman <rms@gnu.org> + + * lisp.h (Fread_from_minibuffer): Add arg in decl. + + * minibuf.c (read_minibuf): New arg KEEP_ALL. Callers changed. + (Fread_from_minibuffer): New arg KEEP_ALL. Callers changed. + + * search.c (Vsearch_spaces_regexp): + Rename from Vsearch_whitespace_regexp. All uses changed. + +2004-11-20 Thien-Thi Nguyen <ttn@gnu.org> + + * eval.c (init_eval_once): Increase `max_specpdl_size' to 650. + +2004-11-19 Richard M. Stallman <rms@gnu.org> + + * search.c (Vsearch_whitespace_regexp): New variable. + (syms_of_search): Defvar it. + (compile_pattern_1): Call re_set_whitespace_regexp with it. + (search_buffer): No regexp is trivial if Vsearch_whitespace_regexp + is non-nil. + (struct regexp_cache): New element whitespace_regexp. + (syms_of_search): Initialize whitespace_regexp elements. + (compile_pattern): Compare whitespace_regexp elements. + (compile_pattern_1): Set whitespace_regexp elements. + + * regex.c (regex_compile): Substitute whitespace_regexp + for spaces, if it is nonzero. + (whitespace_regexp): New variable. + (re_set_whitespace_regexp): New function. + +2004-11-19 Kim F. Storm <storm@cua.dk> + + * indent.c (Fvertical_motion): Fix last change. + +2004-11-18 Kim F. Storm <storm@cua.dk> + + * indent.c (Fvertical_motion): Undo 2004-11-16 change. + Instead, move back again if reseating moves too far ahead. + +2004-11-17 Luc Teirlinck <teirllm@auburn.edu> + + * xdisp.c (message3): Call clear_message. + +2004-11-17 Kim F. Storm <storm@cua.dk> + + * xdisp.c (erase_phys_cursor): Adjust cursor row visible height. + +2004-11-16 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (xg_get_file_name): Typo in HAVE_GTK_FILE_SELECTION_NEW. + + * xmenu.c (x_menu_in_use): Remove. + (x_menu_set_in_use): Also set popup_activated_flag. + + * xfns.c (Fx_file_dialog): Call popup_activated instead of + x_menu_in_use. Call x_menu_set_in_use in Motif version also. + + * xterm.h (x_menu_in_use): Remove. + +2004-11-16 Richard M. Stallman <rms@gnu.org> + + * keymap.c (Fmap_keymap): New arg SORT-FIRST. + Use map-keymap-internal to implement that. + + * indent.c (Fvertical_motion): In batch mode, use vmotion directly. + +2004-11-16 Stefan Monnier <monnier@iro.umontreal.ca> + + * xdisp.c (get_glyph_string_clip_rect, init_glyph_string): Check it's + a window before using XWINDOW. + + * window.c (make_window, Fselect_window, make_dummy_parent) + (save_window_save): + * frame.c (make_frame): + * fns.c (concat): Avoid side-effects inside XSETFASTINT's arguments. + + * lisp.h (NILP): Use EQ rather than XFASTINT. + +2004-11-16 Kim F. Storm <storm@cua.dk> + + * fringe.c (Fdefine_fringe_bitmap): Always set 'h'. Simplify. + + * indent.c (Fvertical_motion): Fix last change. Only reseat when + moving backwards. + +2004-11-16 Luc Teirlinck <teirllm@auburn.edu> + + * dispextern.h: Extern reseat_at_previous_visible_line_start. + +2004-11-16 Kenichi Handa <handa@m17n.org> + + * xdisp.c (display_mode_element): Fix previous change (calculate + end position of substring to display correctly). + +2004-11-16 Kim F. Storm <storm@cua.dk> + + * keyboard.c (Fposn_at_point): Remove extra */ after doc string. + Reported by Andrew M. Scott. + +2004-11-15 Kim F. Storm <storm@cua.dk> + + * fns.c (Fsafe_plist_get): New defun. + (syms_of_fns): Defsubr it. + + * lisp.h (Fsafe_plist_get): Add EXFUN. + + * xdisp.c (store_mode_line_string, produce_stretch_glyph): + Use Fsafe_plist_get. + (note_mode_line_or_margin_highlight, note_mouse_highlight): + Fix image map element parsing. Use Fsafe_plist_get. + +2004-11-15 Richard M. Stallman <rms@gnu.org> + + * xdisp.c (get_next_display_element): Fix previous change. + +2004-11-14 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * window.c (shrink_windows): Handle special case of one window left + when trying to shrink the final reminder. Grow windows if + total_removed is less than total_shrink. + + * xmenu.c (pop_down_menu): Remove global variable current_menu, + extract pointer from arg with XSAVE_VALUE. + (create_and_show_popup_menu, create_and_show_dialog, xmenu_show): + Construct arg to record_unwind_protect with make_save_value. + +2004-11-13 Richard M. Stallman <rms@gnu.org> + + * xdisp.c (reseat_at_previous_visible_line_start): No longer static. + (get_next_display_element): Fix previous change to apply only to \n. + + * indent.c (Fvertical_motion): Scan to PT from start of line to + make iterator consistent. + + * minibuf.c (syms_of_minibuf) <completion-ignore-case>: Doc fix. + +2004-11-14 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (pop_down_file_dialog): Add BLOCK_INPUT. + + * xfns.c (Fx_file_dialog): Call x_menu_in_use and x_menu_set_in_use. + Record unwind with clean_up_file_dialog. + + * xterm.h (x_menu_in_use, x_menu_set_in_use, x_menu_wait_for_event): + Declare. + + * xmenu.c (x_menu_in_use, x_menu_set_in_use): New functions. + +2004-11-13 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (xg_file_sel_ok, xg_file_sel_cancel) + (xg_file_sel_destroy): Remove. + (xg_file_response_cb, pop_down_file_dialog) + (xg_get_file_name_from_chooser, xg_get_file_name_from_selector): + New functions. + (xg_get_file_with_chooser, xg_get_file_with_selection): + Take new arg func, set it to xg_get_file_name_from_chooser/selector. + Move common code to xg_get_file_name. Return widget created. + (xg_get_file_name): Set name, transient for, modal and destroy + with parent here. Connect response signal to xg_file_response_cb, + connect delete-event to gtk_true. Record pop_down_file_dialog + for unwind. Do event loop and call x_menu_wait_for_event in loop. + (xg_create_widget): Make dialogs modal. + + * xmenu.c (unuse_menu_items, pop_down_menu): Arg is of type + Lisp_Object. + (popup_get_selection): Move unwind protect ... + (create_and_show_popup_menu, create_and_show_dialog): ... to here. + Move destroy of widget to pop_down_menu. + (popup_widget_loop): Move unwind protect ... + (create_and_show_popup_menu, create_and_show_dialog): ... to here. + Move destroy of widget to pop_down_menu. + (pop_down_menu): BLOCK_INPUT and destroy widget/window. + (xmenu_show): Record unwind pop_down_menu. Move XMenuDestroy, + x_mouse_leave and grabbed = 0 to pop_down_menu. + +2004-11-13 Kim F. Storm <storm@cua.dk> + + * xdisp.c (make_cursor_line_fully_visible_p): New variable. + (syms_of_xdisp): DEFVAR_BOOL it. + (make_cursor_line_fully_visible, try_cursor_movement) + (try_window_id): Use it. + +2004-11-12 Kim F. Storm <storm@cua.dk> + + * dispextern.h (struct glyph_row): New member extra_line_spacing. + (struct it): New member max_extra_line_spacing. + (MR_PARTIALLY_VISIBLE, MR_PARTIALLY_VISIBLE_AT_TOP) + (MR_PARTIALLY_VISIBLE_AT_BOTTOM): New helper macros. + (MATRIX_ROW_PARTIALLY_VISIBLE_P): Fix to return false if invisible + part of last line is only extra line spacing (so the text on the + line is fully visible). Use helper macros. + Add W arg (to use them). All callers changed. + (MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P) + (MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P): Use helper macros. + + * window.c (window_scroll_pixel_based, Frecenter): + Use move_it_vertically_backward directly. + (Frecenter): Fix calculation of new start pos for negative arg. + Before, the new start pos was sometimes chosen too far back, so + the last line became only partially visible, and thus would be + either only semi-visible or automatically scrolled to the middle + of the window by redisplay. + + * xdisp.c (init_iterator): Clear it.max_extra_line_spacing. + (move_it_vertically_backward): Don't recure to move further back. + (move_it_vertically): Remove superfluous condition. + (move_it_by_lines): Clear last_height when moved 0 lines. + (resize_mini_window): Use it.max_extra_line_spacing. + (display_tool_bar_line): Clear row->extra_line_spacing. + (try_scrolling): Use move_it_vertically_backward directly. + (redisplay_window): Likewise. + (compute_line_metrics): Set row->extra_line_spacing. + (display_line, display_string): Likewise. + (x_produce_glyphs): Update it->max_extra_line_spacing. + + * xmenu.c (pop_down_menu): Return nil. + +2004-11-12 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xmenu.c (x_menu_wait_for_event): New function. + (popup_get_selection, popup_widget_loop): Call x_menu_wait_for_event + to handle timers. + (popup_widget_loop): Add argument do_timers. + (create_and_show_popup_menu, create_and_show_dialog): Pass 1 for + do_timers to popup_widget_loop. + (xmenu_show): Call XMenuActivateSetWaitFunction so that + x_menu_wait_for_event is called by XMenuActivate. + (create_and_show_popup_menu): Pass 1 for do_timers to + popup_get_selection. + (pop_down_menu): New function. + (popup_get_selection, popup_widget_loop): Unwind protect to + pop_down_menu. + (popup_widget_loop): Add argument widget. + (create_and_show_popup_menu, create_and_show_dialog): Pass new + argument widget to popup_widget_loop. + +2004-11-10 Stefan Monnier <monnier@iro.umontreal.ca> + + * keymap.c (Fkeymap_prompt): Accept symbol keymaps. + +2004-11-09 Kim F. Storm <storm@cua.dk> + + * xselect.c: Include <sys/types.h> and <unistd.h> (for getpid). + Fix various comments referring to XEvents instead of input events. + (x_queue_event): Fix format strings. + (x_stop_queuing_selection_requests): Likewise. + + * xdisp.c (produce_image_glyph): Remove unused variable 'face_ascent'. + (pint2hrstr): Add extra braces to silence compiler. + + * print.c (print_object): Fix format string. + + * lread.c (read1): Fix next_char matching. + + * lisp.h (Fdelete): Add EXFUN. + (replace_range_2): Add prototype. + + * keyboard.c (read_avail_input): Remove unused variable 'discard'. + + * intervals.h (NULL_INTERVAL_P): Add separate version when + ENABLE_CHECKING is not defined to silence compiler. + (compare_string_intervals): Add prototype. + + * fringe.c (destroy_fringe_bitmap): Fix return type. + (Ffringe_bitmaps_at_pos): Remove unused var 'old_buffer'. + + * emacs.c (Fdump_emacs): Fix format string. + + * doc.c: Include <ctype.h>. + (Fsubstitute_command_keys): Remove unused variable 'firstkey'. + + * data.c (store_symval_forwarding): Remove unused variables. + + * callint.c (Fcall_interactively): Remove unused variable 'funcar'. + +2004-11-09 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * Makefile.in (stamp-oldxmenu): If HAVE_GTK, don't add dependencies + to ${OLDXMENU}. + +2004-11-09 Kim F. Storm <storm@cua.dk> + + * process.c (Fmake_network_process): Remove kludge for interrupted + connects on BSD. If connect is interrupted, just close socket and + start over rather than sleeping and retry with same socket. + +2004-11-09 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * .cvsignore: Add buildobj.lst. + + * doc.c: New variable Vbuild_files. + (Fsnarf_documentation): If Vbuild_files is nil, populate it with + file names from buildobj.lst. Only attach docstrings from files + that are in Vbuild_files. + (syms_of_doc): Defvar Vbuild_files. + + * Makefile.in (SOME_MACHINE_OBJECTS): Add fringe.o, image.o + and w32*.o. + (temacs${EXEEXT}): Generate buildobj.lst when temacs is linked. + (mostlyclean): Rm buildobj.lst. + + * makefile.w32-in ($(TEMACS)): Generate buildobj.lst when temacs + is linked. + +2004-11-09 Kim F. Storm <storm@cua.dk> + + * fringe.c (update_window_fringes): Update fringe bitmaps if + cur and row ends_at_zv_p differs. If bitmaps of a row is updated, + also update previous row to get rid of misc. artifacts. + +2004-11-08 Kim F. Storm <storm@cua.dk> + + * xdisp.c (fast_find_position): Fix start pos if header line present. + (note_mouse_highlight): Clear mouse face if we move out of text area. + +2004-11-08 Eli Zaretskii <eliz@gnu.org> + + * editfns.c: Move #include "systime.h" before <sys/resource.h>. + Don't include <sys/time.h> explicitly. + Include <stdio.h> unconditionally, not just on MacOS. + +2004-11-08 Kenichi Handa <handa@m17n.org> + + * fontset.c (fontset_pattern_regexp): Cancel my previous change; + don't pay attention to '\' before '*'. + (fontset_pattern_regexp): Change the meaning of the second arg. + (Fnew_fontset): Call fs_query_fontset, not Fquery_fontset. + (check_fontset_name): Try NAME as literal at first, and if it + failes, try NAME as pattern. + +2004-11-07 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * emacs.c (Fdump_emacs): Only output warning on GNU/Linux. + +2004-11-07 Andreas Schwab <schwab@suse.de> + + * lisp.h (Fmsdos_downcase_filename): Declare. + * dired.c (Fmsdos_downcase_filename): Don't declare here. + * fileio.c: Likewise. + +2004-11-07 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * dosfns.c (Fdos_memget, Fdos_memput): Use integer variable offs in + comparisons with integers instead of Lisp_Object address. + (Fmsdos_set_keyboard): Declare argument allkeys. + + * msdos.c (IT_set_frame_parameters): Use EQ, not ==, for Lisp_Object:s. + + * dired.c (Fmsdos_downcase_filename): Declare extern on MSDOS to avoid + int/Lisp_Object mixup. + + * fileio.c: Ditto. + +2004-11-06 Steven Tamm <steventamm@mac.com> + + * editfns.c: Need to include sys/time.h before resource.h on darwin. + +2004-11-06 Richard M. Stallman <rms@gnu.org> + + * callint.c (Fcall_interactively): Avoid reusing EVENT for other data. + + * xfaces.c (merge_named_face): GCPRO the face_name in the + named_merge_point struct that we make. + (merge_face_heights): Eliminate GCPRO arg. All callers changed. + + * keyboard.c (command_loop_1): Change Vtransient_mark_mode + before deciding whether to inactivate mark. + +2004-11-06 Lars Brinkhoff <lars@nocrew.org> + + * config.in: Regenerate (add HAVE_GETRUSAGE). + * editfns.c (Fget_internal_run_time): New function. + (syms_of_data): Defsubr it. + * fns.c (sxhash): As far as possible, merge calculation of + hash code for symbols and strings. + +2004-11-06 Eli Zaretskii <eliz@gnu.org> + + * frame.c (syms_of_frame): Fix the example in the doc string. + +2004-11-06 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * eval.c (Feval): Remove check for INPUT_BLOCKED_P. + + * xmenu.c (popup_get_selection, create_and_show_popup_menu) + (create_and_show_dialog): Revert change from 2004-10-31. + +2004-11-05 Luc Teirlinck <teirllm@auburn.edu> + + * macros.c (syms_of_macros) <defining-kbd-macro>: Doc fix. + +2004-11-05 Kim F. Storm <storm@cua.dk> + + * print.c (print_object): Print Lisp_Misc_Save_Value objects. + + * fileio.c (Ffile_modes): Doc fix. + (auto_save_1): Check for Ffile_modes nil value. + +2004-11-05 Kim F. Storm <storm@cua.dk> + + * xselect.c (struct selection_event_queue, selection_queue) + (x_queue_selection_requests, x_queue_event) + (x_start_queuing_selection_requests) + (x_stop_queuing_selection_requests): Add new queue for selection + input events to replace previous XEvent queue in xterm.c. + (queue_selection_requests_unwind): Adapt to new queue. + (x_reply_selection_request): Adapt to new queue. + Unexpect wait_object in case of x errors (memory leak). + (x_handle_selection_request, x_handle_selection_clear): Make static. + (x_handle_selection_event): New function. May queue selection events. + (wait_for_property_change_unwind): Use save_value instead of cons. + Clear property_change_reply_object. + (wait_for_property_change): Abort if already waiting. + Use save_value instead of cons for unwind data. + (x_handle_property_notify): Skip events already arrived, but don't + free them, as "arrived" field is checked by wait_for_property_change, + and it will be freed by unwind or explicit unexpect_property_change. + (x_get_foreign_selection): Add to new queue. + (receive_incremental_selection): Don't unexpect wait_object when done + as it has already been freed by previous wait_for_property_change. + + * xterm.h (x_start_queuing_selection_requests) + (x_stop_queuing_selection_requests, x_handle_selection_request) + (x_handle_selection_clear): Remove prototypes. + (x_handle_selection_event): Add prototype. + + * xterm.c (handle_one_xevent): Don't queue X selection events + here, it may be too late if we start queuing after we have already + stored some selection events into the kbd buffer. + (struct selection_event_queue, queue, x_queue_selection_requests) + (x_queue_event, x_unqueue_events, x_start_queuing_selection_requests) + (x_stop_queuing_selection_requests): Remove/move to xselect.c. + (x_catch_errors_unwind): Block input around final XSync. + + * keyboard.h (kbd_buffer_unget_event): Add prototype. + + * keyboard.c (kbd_buffer_store_event_hold): Remove obsolete code. + (kbd_buffer_unget_event): New function. + (kbd_buffer_get_event, swallow_events): Combine SELECTION events + and use x_handle_selection_event. + (mark_kboards): Don't mark x and y of SELECTION_CLEAR_EVENT. + +2004-11-05 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xselect.c (TRACE3): New debug macro. + (x_reply_selection_request): Use it. + (receive_incremental_selection): In call to TRACE0, the name of + a symbol is in xname. + +2004-11-05 Kim F. Storm <storm@cua.dk> + + * fontset.c (fontset_pattern_regexp): Use unsigned char. + +2004-11-04 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * fileio.c (Fnext_read_file_uses_dialog_p): New function. + + * gtkutil.h (use_old_gtk_file_dialog): Declare. + + * gtkutil.c: Make use_old_gtk_file_dialog non-static. + (xg_initialize): Move DEFVAR_BOOL for use_old_gtk_file_dialog ... + * xfns.c (syms_of_xfns): ... to here. + + * gtkutil.c (xg_get_file_with_chooser): Expand DEFAULT_FILENAME if + it doesn't start with /. + +2004-11-04 Kenichi Handa <handa@m17n.org> + + * fontset.c (fontset_pattern_regexp): If '*' is preceded by '\', + treat it as a literal character. + +2004-11-03 Kim F. Storm <storm@cua.dk> + + * .gdbinit (ppt): New function. + +2004-11-02 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.c (x_window_to_scroll_bar): Only call + xg_get_scroll_id_for_window if toolkit scroll bars are used. + + * gtkutil.c (xg_get_file_with_chooser): Use GTK_STOCK_OK instead + of save. + +2004-11-02 Andreas Schwab <schwab@suse.de> + + * window.c (Fscroll_right): Fix last change. + +2004-11-02 Kim F. Storm <storm@cua.dk> + + * Makefile.in (callproc.o): Depend on blockinput.h, atimer.h, systime.h. + +2004-11-02 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * callproc.c (Fcall_process): Block input around vfork. + +2004-11-02 Kim F. Storm <storm@cua.dk> + + * eval.c (Fcalled_interactively_p): Rename from Fcall_interactive_p. + (syms_of_eval): Defsubr it. + +2004-11-02 Richard M. Stallman <rms@gnu.org> + + * insdel.c (replace_range_2): New function. + + * casefiddle.c (casify_region): Handle changes in byte-length + using replace_range_2. + + * emacs.c (USAGE3): Delete --horizontal-scroll-bars, -hb. + + * xdisp.c (back_to_previous_visible_line_start): + Subtract 1 from pos when checking previous newline for invisibility. + + * window.c (window_scroll_pixel_based): Update preserve_y + for header line if any. + (Fscroll_left, Fscroll_right): Don't call interactive_p; + use a new second argument instead. + + * eval.c (Fcall_interactive_p): New function. + (interactive_p): Don't test INTERACTIVE here. + (Finteractive_p): Doc fix. + + * eval.c (Feval): Abort if INPUT_BLOCKED_P. + +2004-11-02 KOBAYASHI Yasuhiro <kobayays@otsukakj.co.jp> + + * w32fns.c (w32_font_match): Use fast_string_match_ignore_case for + comparing font names. + +2004-11-02 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * fileio.c (Fread_file_name): Pass Qt as fifth parameter to + Fx_file_dialog if only directories should be read. + + * lisp.h: Fx_file_dialog takes 5 parameters. + + * xfns.c (Fx_file_dialog): Both Motif and GTK version: + Add parameter only_dir_p. + In Motif version, don't put DEFAULT_FILENAME in filter part of the + dialog, just text field part. Do not add DEFAULT_FILENAME + to list of files if it isn't there. + In GTK version, pass only_dir_p parameter to xg_get_file_name. + + * macfns.c (Fx_file_dialog): Add parameter only_dir_p. + Check only_dir_p instead of comparing prompt to "Dired". When using + a save dialog, add option kNavDontConfirmReplacement, change title + to "Enter name", change text for save button to "Ok". + + * w32fns.c (Fx_file_dialog): Add parameter only_dir_p. + Check only_dir_p instead of comparing prompt to "Dired". + + * gtkutil.c (xg_get_file_with_chooser, xg_get_file_with_selection): + New functions, only defined ifdef HAVE_GTK_FILE_CHOOSER_DIALOG_NEW + and HAVE_GTK_FILE_SELECTION_NEW respectively. + (xg_get_file_name): Add parameter only_dir_p. + Call xg_get_file_with_chooser or xg_get_file_with_selection + depending on HAVE_GTK_FILE* and the value of use_old_gtk_file_dialog. + (xg_initialize): New DEFVAR_BOOL use_old_gtk_file_dialog. + + * gtkutil.h (xg_get_file_name): Add parameter only_dir_p. + + * config.in: Rebuild (added HAVE_GTK_FILE_*). + +2004-11-01 Kim F. Storm <storm@cua.dk> + + * process.c (connect_wait_mask, num_pending_connects): + Only declare and use them if NON_BLOCKING_CONNECT is defined. + (init_process): Initialize them if NON_BLOCKING_CONNECT defined. + (IF_NON_BLOCKING_CONNECT): New helper macro. + (wait_reading_process_output): Only declare and use local vars + Connecting and check_connect when NON_BLOCKING_CONNECT is defined. + +2004-11-01 Andy Petrusenco <Igrek@star-sw.com> (tiny change) + + * w32term.c (x_scroll_run): Delete region objects after use. + +2004-10-31 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xmenu.c: Add prototypes for forward function declarations. + (popup_get_selection): Remove parameter do_timers, remove call to + timer_check. + (create_and_show_popup_menu, create_and_show_dialog): + Remove parameter do_timers from call to popup_get_selection. + + * xdisp.c (update_tool_bar): Pass a copy of f->tool_bar_items to + tool_bar_items and assign the result to f->tool_bar_items if + not equal. Move BLOCK/UNBLOCK_INPUT from around call to + tool_bar_items to assignment of result. + + * atimer.c (alarm_signal_handler): Do not call set_alarm if + pending_atimers is non-zero. + +2004-10-31 Kim F. Storm <storm@cua.dk> + + * dispnew.c (margin_glyphs_to_reserve): Don't use ncols_scale_factor. + +2004-10-28 Will <will@glozer.net> + + * macterm.c: Allow user to assign key modifiers to the Mac Option + key via a 'mac-option-modifier' variable. + +2004-10-28 Stefan Monnier <monnier@iro.umontreal.ca> + + * xselect.c (Vx_lost_selection_functions, Vx_sent_selection_functions): + Rename from Vx_lost_selection_hooks and Vx_sent_selection_hooks. + (x_handle_selection_request, x_handle_selection_clear) + (x_clear_frame_selections, syms_of_xselect): Adjust accordingly. + +2004-10-28 Richard M. Stallman <rms@gnu.org> + + * w32fns.c (Fx_server_vendor, Fx_server_version): Doc fixes. + + * xfns.c (Fx_server_vendor, Fx_server_version): Doc fixes. + +2004-10-27 Stefan Monnier <monnier@iro.umontreal.ca> + + * syntax.c (scan_sexps_forward): Give precedence to a 2-char + comment-starter over a 1-char one. + +2004-10-27 Richard M. Stallman <rms@gnu.org> + + * xdisp.c (get_next_display_element): In mode lines, + treat newline and tab like other control characters. + + * editfns.c (Fmessage): Doc fix. + + * indent.c (vmotion): When moving up, check the newline before. + Make prevline an int, not a Lisp_Object. + +2004-10-27 Kim F. Storm <storm@cua.dk> + + * editfns.c (Fformat): Allocate discarded table with SAFE_ALLOCA. + Only allocate info and discarded tables once. + + * lisp.h (USE_SAFE_ALLOCA): Add and init sa_must_free integer. + (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Increment it when malloc is used. + (SAFE_FREE): Test it to determine if we need to unwind to free. + Remove size arg. All users changed. + (SAFE_FREE_LISP): Remove. All users changed to use SAFE_FREE. + +2004-10-26 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c: Put empty line between comment and function body. + (xg_destroy_widgets): Rename from remove_from_container. + Just destroy all widgets in list. Argument wcont removed. + (xg_update_menubar, xg_update_submenu): Call xg_destroy_widgets + instead of remove_from_container. + (xg_display_close, xg_create_tool_bar, update_frame_tool_bar) + (free_frame_tool_bar): Add comment. + + * xfns.c (xic_create_xfontset): Check that FRAME_XIC_BASE_FONTNAME + is not NULL before strcmp. + +2004-10-26 Kim F. Storm <storm@cua.dk> + + * callint.c (Fcall_interactively): Add 'U' code to get the + up-event discarded by a previous 'k' or 'K' argument. + +2004-10-26 David Kastrup <dak@gnu.org> + + * buffer.c (syms_of_buffer): Fix a few typos. + +2004-10-26 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xsmfns.c: Put empty line between comment and function body. + Use two spaces before comment end. + +2004-10-25 Kenichi Handa <handa@m17n.org> + + * fontset.c (fontset_pattern_regexp): Optimize for the case that + PATTERN is full XLFD. + +2004-10-24 Kenichi Handa <handa@m17n.org> + + * regex.h (enum reg_errcode_t): New value REG_ERANGEX. + + * regex.c (re_error_msgid): Add an entry for REG_ERANGEX. + (regex_compile): Return REG_ERANGEX if appropriate. + +2004-10-22 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xfns.c (xic_create_xfontset): Initialize missing_list to NULL. + +2004-10-21 K,Aa(Broly L$,1 q(Brentey <lorentey@elte.hu> + + * xterm.h (x_output): New member `xic_base_fontname'. + (FRAME_XIC_BASE_FONTNAME): New macro. + (xic_free_xfontset): Declare. + + * xfns.c (xic_create_xfontset): Share fontsets between frames + based on base_fontname. + (xic_free_xfontset): New function. + (free_frame_xic): Use it. + (xic_set_xfontset): Ditto. + + * xterm.c (xim_destroy_callback): Ditto. + +2004-10-20 B. Anyos <banyos@freemail.hu> (tiny change) + + * w32term.c (x_draw_glyph_string): Use overline_color for overlines. + +2004-10-20 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.h (XSync): If USE_GTK, define XSync as process_all and then + XSync. + + * emacs.c (my_heap_start, heap_bss_diff, MAX_HEAP_BSS_DIFF): + New variables and constant. + (main): Calculate heap_bss_diff. If we are dumping and the + heap_bss_diff is greater than MAX_HEAP_BSS_DIFF, set PER_LINUX32 + and exec ourself again. + (Fdump_emacs): If heap_bss_diff is greater than MAX_HEAP_BSS_DIFF + print a warning. + + * lastfile.c: Make my_endbss and my_endbss_static available on all + platforms. + + * Makefile.in (RUN_TEMACS): Remove @SETARCH@. + * config.in (HAVE_PERSONALITY_LINUX32): Regenerate. + +2004-10-19 Luc Teirlinck <teirllm@auburn.edu> + + * data.c (Flocal_variable_if_set_p): Doc fix. + +2004-10-19 Jason Rumney <jasonr@gnu.org> + + * w32.c (init_environment): Set emacs_dir correctly when running + emacs from the build directory. + +2004-10-19 Richard M. Stallman <rms@gnu.org> + + * editfns.c (Fdelete_and_extract_region): + If region is empty, return null string. + +2004-10-19 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.h (xg_update_scrollbar_pos): Remove arguments real_left + and canon_width. + (xg_frame_cleared): Remove. + + * gtkutil.c (xg_frame_cleared, xg_fixed_handle_expose) + (xg_find_top_left_in_fixed): Remove. + (xg_create_scroll_bar): Put an event box widget between + the scroll bar widget and the edit widget. + (xg_show_scroll_bar): Show the parent widget (the event box). + (xg_remove_scroll_bar): Destroy parent (the event box) also. + (xg_update_scrollbar_pos): Remove arguments real_left and canon_width. + Move the parent (the event box) widget inside the fixed widget. + Move window clear to xterm.c. + + * gtkutil.h (xg_frame_cleared): Remove. + + * xterm.c (x_clear_frame): Remove call to xg_frame_cleared + (x_scroll_bar_create, XTset_vertical_scroll_bar): + Remove arguments left and width to xg_update_scrollbar_pos. + (XTset_vertical_scroll_bar): Do x_clear_area for USE_GTK also. + +2004-10-19 Kenichi Handa <handa@m17n.org> + + * xdisp.c (display_mode_element): Fix display of wide chars. + +2004-10-18 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (xg_update_scrollbar_pos): Change XClearWindow to + gdk_window_clear and move gdk_window_process_all_updates after + clear so events are sent to the X server in correct order. + +2004-10-18 Kenichi Handa <handa@m17n.org> + + * fontset.c (fs_load_font): Use fast_string_match_ignore_case for + comparing font names. + (fs_query_fontset): Use fast_string_match for comparing fontset names. + (list_fontsets): Likewise. + + * search.c (fast_string_match_ignore_case): New function. + + * lisp.h (fast_string_match_ignore_case): Extern it. + +2004-10-17 Kim F. Storm <storm@cua.dk> + + * xdisp.c (overlay_arrow_at_row): Return overlay string rather + than bitmap if there is not left fringe. + (get_overlay_arrow_glyph_row): Also used on windows system. + (display_line): Display overlay string if no left fringe. + +2004-10-16 Jason Rumney <jasonr@gnu.org> + + * w32fns.c (w32_font_match): Encode font name being matched. + +2004-10-16 Richard M. Stallman <rms@gnu.org> + + * window.c (Fspecial_display_p): Doc fix. + +2004-10-15 Stefan Monnier <monnier@iro.umontreal.ca> + + * doc.c (Fsubstitute_command_keys): Fix remap-handling. + Don't ignore menus, because where-is-internal already does it for us. + +2004-10-15 Kim F. Storm <storm@cua.dk> + + * xdisp.c (redisplay_window): Only update fringes and vertical + border on window frames. + +2004-10-14 Andreas Schwab <schwab@suse.de> + + * m/ia64.h (DATA_SEG_BITS): Don't define. + +2004-10-14 Kim F. Storm <storm@cua.dk> + + * xterm.h: Include Xutil.h after keysym.h to work around bug + in some X versions. + +2004-10-13 Stefan Monnier <monnier@iro.umontreal.ca> + + * fns.c (map_char_table): Add missing gcpros. + +2004-10-13 Stefan Monnier <monnier@iro.umontreal.ca> + + * keymap.c (get_keymap): An autoload form is not a keymap. + + * textprop.c (syms_of_textprop): Make `syntax-table' nonsticky. + +2004-10-13 Kim F. Storm <storm@cua.dk> + + * callproc.c (Fcall_process): Simplify handling of display arg. + Resume `display_on_the_fly' once a coding system is determined. + + * xdisp.c (redisplay_preserve_echo_area): Fix last change. + +2004-10-12 Kim F. Storm <storm@cua.dk> + + * xdisp.c (redisplay_preserve_echo_area): Flush display in case + caller, such as call-process, is not going to poll for input. + (calc_line_height_property): Handle case where it->object is nil. + + * xterm.c (x_redisplay_interface): Fix flush_display_optional. + +2004-10-12 Kenichi Handa <handa@m17n.org> + + * xdisp.c (get_next_display_element): + If unibyte_display_via_language_environment is zero, display 8-bit + chars in octal in unibyte buffer. + +2004-10-12 Kim F. Storm <storm@cua.dk> + + * doc.c (Fsubstitute_command_keys): Ignore remappings unless there + are no ordinary bindings. + +2004-10-11 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xfns.c (syms_of_xfns): Defsubr x-file-dialog for GTK also. + +2004-10-10 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c (x_raise_frame): Add BLOCK_INPUT around SelectWindow. + (x_lower_frame): Add BLOCK_INPUT around SendBehind. + (make_mac_frame): Add BLOCK_INPUT around the making of a + terminal frame. + (mac_initialize): Add BLOCK_INPUT around carbon initialization. + * macgui.h (mktime): Use emacs_mktime. + * macfns.c (Fx_file_dialog): Add BLOCK_INPUT around more code. + Make a cancel file-open dialog be like C-g. + * mac.c (mktime): Use emacs_mktime. + (Fdo_applescript): Add BLOCK_INPUT around do_applescript. + (Fmac_paste_function): Add better error handling for carbon cut/paste. + +2004-10-10 Kim F. Storm <storm@cua.dk> + + * keyboard.c (timer_resume_idle): New function to resume idle + timer without resetting timers on the idle list. + (read_char): Use timer_resume_idle. Remove local var last_idle_start. + (timer_start_idle, timer_stop_idle): Declare static. + (read_key_sequence): Use timer_resume_idle instead of timer_start_idle. + + * keyboard.h (timer_start_idle, timer_stop_idle): Remove prototypes. + +2004-10-08 Steven Tamm <steventamm@mac.com> + + * config.in (HAVE_MALLOC_MALLOC_H): Regenerate. + * macterm.c (mac_check_for_quit_char): Remove warning for using + NULL where 0 should be used. + * unexmacosx.c: Use malloc/malloc.h on Tiger instead of + objc/malloc.h + * mac.c: Include time.h for Tiger compatibility. + +2004-10-07 Kim F. Storm <storm@cua.dk> + + * xdisp.c (redisplay_window): Fix flicker on vertical line between + windows. Update vertical line after drawing window fringes, but + only if actually drawing any bitmaps--or there is no fringe. + + * xterm.c (x_update_window_end): Likewise. + * macterm.c (x_update_window_end): Likewise. + * w32term.c (x_update_window_end): Likewise. + + * fringe.c (draw_window_fringes): Return value now indicates if + any fringe bitmaps were redrawn (or there are no fringes). + + * dispextern.h (draw_window_fringes): Update prototype. + +2004-10-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macfns.c (mac_get_window_bounds): Add extern. + (x_real_positions): Use mac_get_window_bounds. + + * macmenu.c (update_submenu_strings): Apply 2004-09-07 change for + xmenu.c (YAILOM). + + * macterm.c [!MAC_OSX]: Include Windows.h. + (front_emacs_window): Rename from mac_front_window. All uses + changed. Return the frontmost non-tooltip emacs window. + (mac_get_window_bounds): New function. + (x_calc_absolute_position): Use the difference of width and height + between the inner and outer window. + (x_set_offset): Specify window position by the coordinae of the + outer window. Adjust the position if the title bar is completely + outside the screen. + (app_is_suspended, app_sleep_time): Remove unused variables. + (do_app_resume, do_app_suspend): Remove their contents because + window-activate/deactivate events will do the job. + (do_zoom_window): Remove unused variables. Make compliant to the + standard way of zooming. Set f->left_pos and f->top_pos. + (XTread_socket): Don't use argument `expected'. Don't use + FrontWindow to determine the clicked window. Exclude unprocessed + mouseUp cases in the early stage. Add parentheses to fix operator + precedence. + (XTread_socket) [TARGET_API_MAC_CARBON]: Don't specify drag area. + +2004-10-05 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * config.in: Regenerate. + + * Makefile.in (RUN_TEMACS): Check HAVE_RANDOM_HEAPSTART instead of + HAVE_EXECSHIELD. + +2004-10-05 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.c (x_find_modifier_meanings): Ignore any Super or Hyper for + a row if Alt or Meta has been found for that row. Also stop scanning + for Keysyms for that row. + +2004-10-04 Kim F. Storm <storm@cua.dk> + + * fringe.c (Ffringe_bitmaps_at_pos): Change return value from cons + to list. Include overlay arrow bitmap in return value. + + * xterm.c (XTset_vertical_scroll_bar): Improve handling of scroll + bars with fractional column width. If scroll bar separates two + windows, move it towards the window it belongs to. Only update + the padding area below the scroll bar widget when necessary, + i.e. when scroll bar widget is created, moved, or resized. + + * xdisp.c (define_frame_cursor1): Do not change frame cursor + while tracking/dragging mouse. + (x_draw_vertical_border): Do not draw line if frame has scroll bars. + + * window.c (coordinates_in_window): Relax check for cursor + on vertial border between mode lines. + (Fset_window_fringes): Do not allow negative widths. + (Fset_window_scroll_bars): Likewise. + + * .gdbinit (pp): Shorthand for p ARG + pr. + (ff): New command: flush frame updates (X only). + +2004-10-03 Michael Albinus <michael.albinus@gmx.de> + + * fileio.c (auto_save_1) Call Ffile_modes for remote files. + +2004-09-30 Kenichi Handa <handa@m17n.org> + + * process.c (send_process): Free composition data. + + * fileio.c (Finsert_file_contents): Free composition data. + + * coding.c (code_convert_region): Don't skip ASCIIs if there are + compositions to encode. + (encode_coding_string): Likewise. Free composition data. + +2004-09-30 Florian Weimer <fw@deneb.enyo.de> + + * coding.c (code_convert_region): Free composition data. + +2004-09-29 Kim F. Storm <storm@cua.dk> + + * fringe.c: Remove limit on number of bitmaps. + (fringe_bitmaps, fringe_faces): Change to pointers. + (max_fringe_bitmaps): New var. + (Fdefine_fringe_bitmap): Expand fringe_bitmaps and fringe_faces. + (init_fringe): Allocate fringe_bitmaps and fringe_faces. + + * dispextern.h (FRINGE_ID_BITS): Increase to 16 bits (64K bitmaps). + (struct glyph_row): Reorder fringe_bitmap related fields. + (struct it): Likewise. + + * w32term.c (fringe_bmp): Change to pointer. + (max_fringe_bmp): New var. + (w32_define_fringe_bitmap): Expand fringe_bmp. + (w32_draw_fringe_bitmap): Check max_fringe_bmp. + (w32_destroy_fringe_bitmap): Likewise. + +2004-09-29 Kim F. Storm <storm@cua.dk> + + * fringe.c: Simplify last change. + (lookup_fringe_bitmap): New function. + (valid_fringe_bitmap_p, resolve_fringe_bitmap): Remove. + (Fdestroy_fringe_bitmap): Use lookup_fringe_bitmap. + Keep standard bitmaps in Vfringe_bitmaps. + (Fdefine_fringe_bitmap): Use lookup_fringe_bitmap. + (Fset_fringe_bitmap_face): Likewise. + + * dispextern.h (lookup_fringe_bitmap): Add prototype. + (valid_fringe_bitmap_p): Remove prototype. + + * xdisp.c (handle_single_display_prop): Use lookup_fringe_bitmap. + +2004-09-29 Kim F. Storm <storm@cua.dk> + + * fringe.c (destroy_fringe_bitmap, init_fringe_bitmap) + (w32_init_fringe, w32_reset_fringes): Fix bootstrap (NULL rif). + + * dispextern.h (valid_fringe_bitmap_p): Fix prototype. + + * fringe.c (Vfringe_bitmaps): New variable. + (syms_of_fringe): DEFVAR_LISP it. + (valid_fringe_bitmap_p): Rename from valid_fringe_bitmap_id_p. + Change arg to Lisp_Object and fail if not an integer. + (get_fringe_bitmap_name, resolve_fringe_bitmap) + (destroy_fringe_bitmap): New functions. + (Fdestroy_fringe_bitmap): Change arg to bitmap symbol. + Use destroy_fringe_bitmap. Remove symbol from Vfringe_bitmaps and + clear its fringe property. + (init_fringe_bitmap): Use destroy_fringe_bitmap instead of + Fdestroy_fringe_bitmap. + (Fdefine_fringe_bitmap): Add BITMAP arg specifying new or existing + bitmap symbol; remove WHICH arg. Add symbol to Vfringe_bitmaps + and set fringe property. Signal error if no free slots. + (Fset_fringe_bitmap_face): Change arg to bitmap symbol. + (Ffringe_bitmaps_at_pos): Return bitmap symbols instead of numbers. + + * xdisp.c (handle_single_display_prop): Fringe bitmaps are now + symbols with a fringe property. + +2004-09-27 Kim F. Storm <storm@cua.dk> + + * buffer.c (syms_of_buffer) <indicate-buffer-boundaries>: + Doc fix. Format may now be a symbol or alist, not a cons. + + * fringe.c (update_window_fringes): Handle new formats of + indicate-buffer-boundaries (symbol or alist). No longer + allow a simple cons. + (Ffringe_bitmaps_at_pos): Use nil value for no bitmap. + +2004-09-25 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * config.in: Rebuild. + +2004-09-24 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * config.in: Rebuild. + + * Makefile.in: Run setarch i386 ./temacs if exec-shield is present. + +2004-09-18 Stefan Monnier <monnier@iro.umontreal.ca> + + * xterm.c (x_term_init): Work around a bug in some X servers. + +2004-09-18 Richard M. Stallman <rms@gnu.org> + + * buffer.c (syms_of_buffer) <default-major-mode>: Doc fix. + + * xdisp.c (try_window_reusing_current_matrix): + Handle the case where we reach the old displayed text, + out of sync with the old line boundary. + +2004-09-14 Stefan Monnier <monnier@iro.umontreal.ca> + + * fileio.c (Finsert_file_contents): Fix case of replacement in a + narrowed buffer. + +2004-09-14 Kim F. Storm <storm@cua.dk> + + * puresize.h (PURESIZE_RATIO): Define based on BITS_PER_EMACS_INT. + + * xfaces.c (Qface_no_inherit): New var. + (syms_of_xfaces): Intern and staticpro it. + (Finternal_make_lisp_face, Finternal_set_lisp_face_attribute) + (Finternal_copy_lisp_face, update_face_from_frame_parameter): + Don't increment face_change_count when face has non-nil + face-no-inherit property. + +2004-09-13 Stefan Monnier <monnier@iro.umontreal.ca> + + * bytecode.c (BYTE_CODE_QUIT): Add missing AFTER_POTENTIAL_GC. + (Fbyte_code): Remove dead code after `wrong_type_argument'. + + * alloc.c (Fgarbage_collect): Mark keyboards, gtk data, and specpdl + before doing the mark_stack_check_gcpros since they're not on the stack. + +2004-09-12 Kim F. Storm <storm@cua.dk> + + * editfns.c (Fformat): Handle format strings with multiple text + properties. Reverse text property list from the format string, + so the positions are in increasing order. + +2004-09-10 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xselect.c (x_reply_selection_request): XSync and UNBLOCK before + x_uncatch_errors so that possible protocol errors are delivered. + +2004-09-10 Eli Zaretskii <eliz@gnu.org> + + * Makefile.in (msdos.o): Depend on buffer.h, commands.h, and + blockinput.h. + (dosfns.o): Depend on blockinput.h, window.h, dispextern.h, + charset.h, and coding.h + (w16select.o): Depend on buffer.h, charset.h, coding.h, and composite.h. + (term.o): Depend on window.h and keymap.h. + (abbrev.o): Depend on syntax.h. + (callint.o): Depend on keymap.h. + (casefiddle.o): Depend on charset.h and keymap.h. + (category.o): Depend on keymap.h. + (coding.o): Depend on dispextern.h. + (cmds.o): Depend on keyboard.h and keymap.h. + (dispnew.o): Depend on indent.h and intervals.h. + (doc.o): Depend on keymap.h. + (editfns.o): Depend on frame.h. + (emacs.o): Depend on dispextern.h. + (fileio.o): Don't depend on ccl.h. + (filelock.o): Depend on charset.h and coding.h. + (frame.o): Depend on w32term.h and macterm.h. + (insdel.o): Depend on region-cache.h. + (keyboard.o): Depend on keymap.h, w32term.h, and macterm.h. + (minibuf.o): Depend on $(INTERVALS_SRC) and keymap.h. + (search.o): Depend on $(INTERVALS_SRC). + (syntax.o): Depend on keymap.h, regex.h, and $(INTERVALS_SRC). + (window.o): Depend on keymap.h, blockinput.h, $(INTERVALS_SRC), + xterm.h, w32term.h, and macterm.h. + (xdisp.o): Depend on keyboard.h, $(INTERVALS_SRC), xterm.h, + w32term.h, and macterm.h. + (xfaces.o): Depend on keyboard.h, $(INTERVALS_SRC), + region-cache.h, xterm.h, w32term.h, and macterm.h. + (bytecode.o): Depend on dispextern.h, frame.h, and xterm.h. + (data.o): Depend on frame.h. + (fns.o): Depend on keymap.h, xterm.h, and blockinput.h. + (print.o): Depend on termchar.h and $(INTERVALS_SRC). + (lread.o): Depend on $(INTERVALS_SRC), termhooks.h, and coding.h. + (intervals.o): Depend on keymap.h. + + * msdos.c (msdos_set_cursor_shape, IT_display_cursor): + Add debugging print-out to termscript. + +2004-09-09 Richard M. Stallman <rms@gnu.org> + + * xdisp.c (decode_mode_spec): Use current buffer for most purposes. + +2004-09-08 Richard M. Stallman <rms@gnu.org> + + * window.c (Fset_window_buffer): Doc fix. + + * xdisp.c (Fformat_mode_line): New arg BUFFER says which buffer to use. + +2004-09-08 Dan Nicolaescu <dann@ics.uci.edu> + + * minibuf.c (history_delete_duplicates): New variable. + (read_minibuf): Use it. + (syms_of_minibuf): Create the corresponding lisp variable. + +2004-09-08 Kim F. Storm <storm@cua.dk> + + * xdisp.c (set_cursor_from_row): Also look at 'cursor' property in + overlay just before point. + +2004-09-07 Luc Teirlinck <teirllm@auburn.edu> + + * buffer.h (struct buffer): Add auto_save_file_format field. + * buffer.c (reset_buffer, init_buffer_once): + Handle auto_save_file_format field. + (syms_of_buffer): Add DEFVAR_PER_BUFFER for + `buffer-auto-save-file-format'. + * fileio.c: Delete declaration for removed Vauto_save_file_format. + (build_annotations): Adapt to replacement of + `auto-save-file-format' with the new buffer-local variable + `buffer-auto-save-file-format'. + (syms_of_fileio): Delete DEFVAR_LISP for auto-save-file-format. + +2004-09-07 Jason Rumney <jasonr@gnu.org> + + * w32term.h (AppendMenuW_Proc): Move declaration from w32menu.c. + + * w32fns.c (w32_wnd_proc) <WM_MEASUREITEM, WM_DRAWITEM>: + Handle Unicode menu titles. + +2004-09-07 Kim F. Storm <storm@cua.dk> + + * xdisp.c (set_cursor_from_row): Fix last change. Only use 'cursor' + property from text property or overlay strings at point. + +2004-09-07 Stefan Monnier <monnier@iro.umontreal.ca> + + * xmenu.c (update_submenu_strings): YAILOM. + (set_frame_menubar): Make sure last_i is initialized. + +2004-09-03 Jason Rumney <jasonr@gnu.org> + + * w32menu.c (_widget_value): Add lname and lkey. + (digest_single_submenu): Set lname and lkey in widget_value + instead of name and key. + (update_submenu_strings): New function. + (set_frame_menubar): Remove call to inhibit_garbage_collection, + call update_submenu_strings. + + * w32menu.c (globals_of_w32menu): Check for Unicode API. + (digest_single_submenu, w32_menu_show): Encode menu strings as + UTF-8 if Unicode API is available. + (utf8to16): New function. + (add_menu_item): Use it when calling Unicode API. + +2004-09-03 Kim F. Storm <storm@cua.dk> + + * xdisp.c (set_cursor_from_row): Look for non-nil `cursor' property + in overlay or text-property strings; set cursor on corresponding + glyph rather than at end of the string. + +2004-09-02 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macfns.c (x_real_positions): Save the current window port and + set a new one before obtaining the global coordinate. + Use FRAME_MAC_WINDOW. + (x_set_name, x_set_title): Encode title to UTF8. + Use SetWindowTitleWithCFString. + (Fx_server_version): Get correct OS version. + + * macmenu.c (add_menu_item): Remove unused variable `i'. + Don't let separator items destroy refence constants of other menu items. + + * macterm.c (x_update_end): Move SetPortWindowPort to inside + BLOCK_INPUT. + (x_set_offset): Use FRAME_MAC_WINDOW. + + * xdisp.c (note_mouse_highlight): Set the mouse pointer shape to + nontext_cursor if it is on a scroll bar. + + * s/darwin.h (LIBS_CARBON): New define to specify libraries for + Carbon support. + (LD_SWITCH_SYSTEM_TEMACS): Don't link with unused libstdc++. + Use LIBS_CARBON. + +2004-09-02 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xfns.c (x_set_name_internal): New function. Check if we shall call + xfree before ENCODE_UTF_8. + (x_set_name, x_set_title): Call x_set_name_internal. + +2004-08-31 NAKAMURA Toshikazu <nr-tkz@nifty.com> (tiny change) + + * w32fns.c (w32_load_font): If a BDF font is already loaded, do not + reload it. + +2004-08-30 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * macmenu.c (_widget_value): Add lname and lkey. + (single_submenu): Set lname and lkey in widget_value + instead of name and key. + (update_submenu_strings): New function. + (set_frame_menubar): Remove call to inhibit_garbage_collection, + call update_submenu_strings. + + * xmenu.c (digest_single_submenu): Set lname and lkey in widget_value + instead of name and key. + (update_submenu_strings): New function. + (set_frame_menubar): Remove call to inhibit_garbage_collection, + call update_submenu_strings. + + * gtkutil.h (_widget_value): Added lname and lkey. + +2004-08-30 Steven Tamm <steventamm@mac.com> + + * macmenu.c (mac_menu_show): Remove shadowing of menu variable + by using different names for inner loop variables. + +2004-08-27 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xmenu.c (set_frame_menubar): Reintroduce inhibit_garbage_collection + from 2002-07-15T00:01:34Z!raeburn@raeburn.org so that strings from ENCODE_UTF_8 isn't GC:ed before used. + + * gtkutil.c (xg_create_frame_widgets): Compensate for tool bar when + tool bar items is 0. + +2004-08-26 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macmenu.c (ENCODE_MENU_STRING): Added to handle multibyte + strings in menu items. + (single_submenu): Use ENCODE_MENU_STRING + (mac_menu_show): Use ENCODE_MENU_STRING. Reset grabbed because + button release isn't passed to event loop + (add_menu_item): Use SetMenuItemWithCFString. + +2004-08-26 Steven Tamm <steventamm@mac.com> + + * fileio.c (Fread_file_name): Call x_file_dialog on carbon on + tool-bar/menu click. + * macfns.c (Fx_file_dialog): Implement using NavServices. + +2004-08-24 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.c (x_catch_errors_unwind): Do not XSync if display has closed. + + * xfns.c (x_window_to_frame, x_any_window_to_frame) + (x_non_menubar_window_to_frame, x_menubar_window_to_frame) + (x_top_window_to_frame): Return 0 if wdesc is None. + +2004-08-22 Richard M. Stallman <rms@gnu.org> + + * process.c (process_send_signal) [SIGNALS_VIA_CHARACTERS, + HAVE_TERMIOS]: If there's no char for this signal, drop through + and use system calls. + + * bytecode.c (Fbyte_code) <unwind-protect>: Cannot GC. + +2004-08-20 Kim F. Storm <storm@cua.dk> + + * process.c (wait_reading_process_output): Rename from + wait_reading_process_input. All uses changed. + (wait_reading_process_output_1): Rename from + wait_reading_process_input_1. All uses changed. + + * dispnew.c (Fsleep_for): Remove obsolete code. + +2004-08-20 Kenichi Handa <handa@m17n.org> + + * syntax.c (skip_chars): Fix for unibyte case. + +2004-08-19 Stefan Monnier <monnier@iro.umontreal.ca> + + * syntax.c (char_quoted): Mixup byte/char pos. + (back_comment): Fixup globals in all cases. + +2004-08-19 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xfns.c (x_set_name, x_set_title): Encode title to UTF8 before + passing it to gtk_window_set_title. + +2004-08-19 Kim F. Storm <storm@cua.dk> + + * process.c (wait_reading_process_input): Clean up. + Add wait_for_cell, wait_proc, and just_wait_proc args + to avoid overloading `read_kbd' and `do_display' args. + Change read_kbd arg to int. All callers changed. + + * process.c (process_send_signal): Use CDISABLE. + + * sysdep.c (child_setup_tty, init_sys_modes): Use CDISABLE. + +2004-08-18 Kim F. Storm <storm@cua.dk> + + * process.c (Faccept_process_output): Add arg JUST-THIS-ONE; + forward to wait_reading_process_input via DO_DISPLAY arg. + (wait_reading_process_input): If DO_DISPLAY < 0 for a process + object, only process output from that process; also inhibit + running timers if DO_DISPLAY==-2. + +2004-08-17 Kim F. Storm <storm@cua.dk> + + * process.c (process_send_signal): Fix last change--use + _POSIX_VDISABLE instead of CVDISABLE when available. + +2004-08-16 Richard M. Stallman <rms@gnu.org> + + * sysdep.c (child_setup_tty) [SIGNALS_VIA_CHARACTERS]: + Set VQUIT and VINTR chars to the standard ones if they are unset. + [AIX]: Don't do that here. And don't force VINTR to standard + when SIGNALS_VIA_CHARACTERS. + + * process.c (process_send_signal) + [SIGNALS_VIA_CHARACTERS, HAVE_TERMIOS]: Clean up. + Do nothing if the character is CVDISABLE. + + * xfaces.c (merge_face_ref): Specifying `unspecified' is a no-op. + + * intervals.c (move_if_not_intangible): + Force POSITION to be between BEGV and ZV. + +2004-08-14 John Paul Wallington <jpw@gnu.org> + + * buffer.c (Frestore_buffer_modified_p): Doc fix. + + * fileio.c (Fread_file_name): Doc fix. + + * minibuf.c (syms_of_minibuf) <completion-ignore-case>: Doc fix. + +2004-08-09 Luc Teirlinck <teirllm@auburn.edu> + + * keymap.c (Fmake_keymap, Fmap_keymap, Fwhere_is_internal): Doc fixes. + +2004-08-08 Luc Teirlinck <teirllm@auburn.edu> + + * keyboard.c: Declare Qdisabled_command_function instead of + Qdisabled_command_hook. + (Fcommand_execute): Use Qdisabled_command_function instead of + Qdisabled_command_hook. + (syms_of_keyboard): Ditto. + +2004-08-07 Luc Teirlinck <teirllm@auburn.edu> + + * keymap.c (Flocal_key_binding, Fglobal_key_binding) + (syms_of_keymap) <key-translation-map>: Doc fixes. + +2004-08-07 Stefan Monnier <monnier@iro.umontreal.ca> + + * window.c (window_list_1): YAILOM. + + * fileio.c (make_temp_name): Handle multibyte prefixes. + +2004-08-06 Luc Teirlinck <teirllm@auburn.edu> + + * keyboard.c (syms_of_keyboard) <overriding-terminal-local-map>: + Doc fix. + +2004-08-03 Kenichi Handa <handa@m17n.org> + + * coding.c (decode_coding_string): Adjust coding->consumed, and + etc. with shrinked_bytes. + +2004-08-03 Kim F. Storm <storm@cua.dk> + + * indent.c (compute_motion): Fix check for full width window + in non-window case. Do not count left truncation glyph on + window systems. + +2004-08-02 Luc Teirlinck <teirllm@auburn.edu> + + * data.c (Finteractive_form): Doc fix. + +2004-08-02 Kim F. Storm <storm@cua.dk> + + * indent.c (compute_motion): Use actual window width if WIDTH is -1, + properly accounting for continuation glyph on non-window systems. + (Fcompute_motion): Use actual window width if WIDTH is nil, and + actual window width/height if TOPOS is nil, properly accounting for + continuation glyphs on non-window systems, and optional header lines. + (vmotion): Let compute_motion calculate actual window width. + + * window.c (window_scroll_line_based): Let compute_motion + calculate actual window width. + +2004-08-02 Kim F. Storm <storm@cua.dk> + + * process.c (read_process_output): Use whole read buffer. + Don't trigger adaptive read buffering on errors. + +2004-07-31 Luc Teirlinck <teirllm@auburn.edu> + + * keymap.c (Fset_keymap_parent, Fdefine_prefix_command): Doc fixes. + + * keyboard.c (syms_of_keyboard) <disable-point-adjustment>: Doc fix. + + * callint.c (Fcall_interactively): Doc fix. + +2004-07-30 Richard M. Stallman <rms@gnu.org> + + * abbrev.c (Fexpand_abbrev): Undo previous change. + +2004-07-30 Kim F. Storm <storm@cua.dk> + + * editfns.c (Fformat): Allocate extra (dummy) element in info. + +2004-07-28 Luc Teirlinck <teirllm@auburn.edu> + + * eval.c (Fdefvar, Fdefconst): Doc fixes. + +2004-07-27 Kim F. Storm <storm@cua.dk> + + * xdisp.c (move_it_in_display_line_to): Check BUFFER_POS_REACHED_P after + we have ensured that the glyph fits on the current line (or returned + MOVE_LINE_CONTINUED otherwise). + +2004-07-26 Kim F. Storm <storm@cua.dk> + + * xdisp.c (move_it_in_display_line_to): If overflow-newline-into-fringe + is enabled, return MOVE_LINE_CONTINUED rather than MOVE_POS_MATCH_OR_ZV + if target position is at end of display line but char is not a newline. + +2004-07-25 Richard M. Stallman <rms@gnu.org> + + * window.c (coordinates_in_window): Return ON_SCROLL_BAR + instead of ON_VERTICAL_BORDER, when on scroll bar. + (Fcoordinates_in_window_p): Handle ON_SCROLL_BAR--return nil. + + * dispextern.h (enum window_part): Add ON_SCROLL_BAR. + + * window.c (Fcoordinates_in_window_p): + Take account of FRAME_INTERNAL_BORDER_WIDTH. + + * alloc.c (check_cons_list): New function (contents commented out). + +2004-07-24 Luc Teirlinck <teirllm@auburn.edu> + + * xfaces.c (Fcolor_supported_p): Doc fix. + + * frame.c (Fselect_frame, Fset_frame_selected_window) + (Fframe_visible_p, Fraise_frame): Doc fixes. + +2004-07-24 Richard M. Stallman <rms@gnu.org> + + * keyboard.h (not_single_kboard_state): Declare. + + * fileio.c (Fwrite_region): Doc fix. + + * window.c (Fwindow_at): Take account of FRAME_INTERNAL_BORDER_WIDTH. + + * abbrev.c (Fexpand_abbrev): Run Qpre_abbrev_expand_hook + only when a real abbrev is present. + + * xfns.c (x_icon_verify): New function. + (Fx_create_frame): Use it. + +2004-07-22 Barry Fishman <barry_fishman@att.net> (tiny change) + + * s/gnu-linux.h: Use GC_MARK_STACK if __amd64__ is defined. + +2004-07-21 Kim F. Storm <storm@cua.dk> + + * window.h (struct glyph_matrix): New members nrows_scale_factor + and ncols_scale_factor. + + * window.c (make_window): Initialize nrows_scale_factor and + ncols_scale_factor members. + + * dispnew.c (margin_glyphs_to_reserve): Apply ncols_scale_factor. + (allocate_matrices_for_frame_redisplay): Fix left/right margin mix-up. + (required_matrix_height): Apply nrows_scale_factor. + (required_matrix_width): Apply ncols_scale_factor. + + * xdisp.c (display_line): Increment nrows_scale_factor and set + fonts_changed_p if past last allocated row. + (append_glyph, append_composite_glyph, produce_image_glyph) + (append_stretch_glyph): Increment ncols_scale_factor and set + fonts_changed_p if current area is full. + +2004-07-21 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * widget.c (EmacsFrameDestroy): Don't abort if normal_gc is 0. + +2004-07-19 Luc Teirlinck <teirllm@auburn.edu> + + * window.c (Fpos_visible_in_window_p, Fset_window_hscroll) + (Fwindow_inside_pixel_edges, Fwindow_end, Fset_window_point) + (Fset_window_start, Fscroll_up, Fscroll_down) + (Fother_window_for_scrolling, Fscroll_other_window) + (Fsave_window_excursion, Fset_window_vscroll) + (syms_of_window) <window-size-fixed>: Doc fixes. + +2004-07-19 KOBAYASHI Yasuhiro <kobayays@otsukakj.co.jp> + + * w32fns.c (Fx_file_dialog): Use ENCODE_FILE instead of + ENCODE_SYSTEM for filenames. + +2004-07-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * mac.c (sys_select): Block input around call to + ReceiveNextEvent to prevent breakage. Correctly handle + blocking on event queue only by calling ReceiveNextEvent + instead of select (since GUI events aren't on an fd). + (sys_read): Remove function + * sysdep.c: Remove redefine of read to sys_read if HAVE_CARBON. + +2004-07-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * mac.c (sys_select): Redo sys_select to use alarm-based + polling instead of 1 sec timeouts (like solaris). + + * macterm.c (x_make_frame_visible): Comment in polling on + frame creation. + + * keyboard.c: Undef SIGIO on Carbon. + + * atimer.c (alarm_signal_handler): Call alarm handlers after + scheduling. + + * eval.c (Feval): Remove quit_char test. + + * process.c (wait_reading_process_input): Remove clearing + stdin for select call on process input. + +2004-07-18 Luc Teirlinck <teirllm@auburn.edu> + + * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Correct + capitalization error in docstring. + +2004-07-17 Juanma Barranquero <lektu@terra.es> + + * keyboard.c (not_single_kboard_state): Do nothing unless + MULTI_KBOARD is defined. + +2004-07-17 Richard M. Stallman <rms@gnu.org> + + * window.c (coordinates_in_window): Inside the window but outside + its box to the L or R, return ON_VERTICAL_BORDER. + (window_list_1): Rotate the list to start with WINDOW. + + * print.c (print_preprocess): Test for print_depth at limit + before entering in being_printed. + + * keyboard.c (not_single_kboard_state): New function. + (stuff_buffered_input): Now no-op only if no SIGTSTP. + + * frame.c (Fdelete_frame): If we're in single_bboard_state on + this kboard, and we delete its last frame, go to any_kboard_state. + + * buffer.c (syms_of_buffer) <transient-mark-mode>: Doc fix. + +2004-07-15 KOBAYASHI Yasuhiro <kobayays@otsukakj.co.jp> + + * w32fns.c (Fx_file_dialog): Encode strings in system coding + system before passing them to OS functions for display. + +2004-07-15 David Kastrup <dak@gnu.org> + + * search.c (syms_of_search): Staticpro `saved_last_thing_searched'. + Apparently fixes an abort condition. + +2004-07-14 Luc Teirlinck <teirllm@auburn.edu> + + * fileio.c (Fvisited_file_modtime): Return a list of two integers, + instead of a cons. + +2004-07-14 K,Aa(Broly L$,1 q(Brentey <lorentey@elte.hu> + + * keyboard.c (echo_dash): Do nothing if there already is a dash + at the end of the echo string. + +2004-07-12 Kim F. Storm <storm@cua.dk> + + * alloc.c (mark_object): Only look at Lisp_Misc_Save_Value + if GC_MARK_STACK. + +2004-07-10 Luc Teirlinck <teirllm@auburn.edu> + + * buffer.c (Fswitch_to_buffer, Fpop_to_buffer): Doc fixes. + + * window.c (Fwindow_buffer, Fother_window, Fget_lru_window) + (Fget_largest_window, Fget_buffer_window, Fdelete_windows_on) + (Freplace_buffer_in_windows, Fset_window_buffer) + (Fselect-window, Fdisplay-buffer, Fsplit_window): Doc fixes. + (syms_of_window): Expand docstring of `display-buffer-function'. + +2004-07-09 Luc Teirlinck <teirllm@auburn.edu> + + * editfns.c (Ffloat_time, Fformat_time_string, Fdecode_time) + (Fcurrent_time_string, Fcurrent_time_zone): Mention in docstrings + that time values of the type (HIGH . LOW) are considered obsolete. + +2004-07-06 Luc Teirlinck <teirllm@auburn.edu> + + * keyboard.c (syms_of_keyboard): Fix `keyboard-translate-table' + docstring. + + * fns.c (Fclear_string): Declare `len' before call to CHECK_STRING. + +2004-07-06 John Paul Wallington <jpw@gnu.org> + + * eval.c (Fdefmacro): Signal an error if NAME is not a symbol. + + * fns.c (Fclear_string): Signal an error if STRING is not a string. + +2004-07-05 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * macterm.c (mac_initialize_display_info): Use CGGetActiveDisplayList + instead of CGMainDisplayID (only in OSX 10.2 and later). + +2004-07-04 John Paul Wallington <jpw@gnu.org> + + * fileio.c (read_file_name_completion_ignore_case): New variable. + (syms_of_fileio): Declare and initialise it. + (Fread_file_name): Bind `completion-ignore-case' to respect it. + +2004-07-03 Eli Zaretskii <eliz@gnu.org> + + * msdos.c (dos_rawgetc): Use make_number to produce Lisp objects + for event.x and event.y. + +2004-07-01 Kenichi Handa <handa@m17n.org> + + * w32select.c (Fw32_set_clipboard_data): Update `nbytes' correctly + after getting a new string by pre-write-conversion. + +2004-06-30 Stefan Monnier <monnier@iro.umontreal.ca> + + * xterm.c (x_detect_focus_change): Remove unused var `nr_events'. + (x_calc_absolute_position): Remove unused var `child'. + + * xfaces.c (x_supports_face_attributes_p) + (Fdisplay_supports_face_attributes_p): YAILOM. + (tty_supports_face_attributes_p): Remove unused var `i'. + + * syntax.c (skip_chars): Remove unused labels fwd_unibyte_ok and + back_unibyte_ok. + + * search.c (match_limit, Fmatch_data, Fset_match_data): YAILOM. + + * fontset.c (Fset_fontset_font): Remove unused vars `family' and + `registry'. + + * Makefile.in (${etc}DOC): Fix file name of make-docfile. + +2004-06-30 Andreas Schwab <schwab@suse.de> + + * image.c (CHECK_LIB_AVAILABLE): Add third parameter LIBRARIES. + (Finit_image_library): Pass LIBRARIES through to + CHECK_LIB_AVAILABLE. Declare parameters. Doc fix. + (lookup_image_type): Pass Qnil as second argument to + Finit_image_library. + + * lisp.h (Finit_image_library): Declare. + +2004-06-29 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c (do_window_activate, do_window_deactivate): Remove. + (XTread_socket): Send mouse button events to the toolbox + dispatcher even when the mouse is grabbed. Don't process window + activate events for non-Emacs windows. Replace function calls to + do_window_activate and do_window_deactivate with their contents. + Reset mouse grabbing status when a window is deactivated. + +2004-06-29 Steven Tamm <steventamm@mac.com> + + * macterm.c (mac_get_emulated_btn) + (mac_event_to_emacs_modifiers): Fix emulated mouse button + support to correctly mask out modifiers. + +2004-06-29 David Kastrup <dak@gnu.org> + + * search.c (Fset_match_data): Allow buffer before end of list + which can happen if set-match-data is using a pre-consed list. + +2004-06-28 Steven Tamm <steventamm@mac.com> + + * macterm.c (XTread_socket): Correctly set the frame position + after the window is moved. + +2004-06-28 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (xg_get_image_for_pixmap): Call g_object_unref on + gpix and gmask just before return to avoid memory leak. + (xg_get_image_for_pixmap): Add workaround for monochrome displays + so insensitive and activated icons look ok. + +2004-06-27 Jason Rumney <jasonr@gnu.org> + + * w32fns.c (file_dialog_callback): Disable edit control if set + to directories only on CDN_INITDONE message. + (Fx_file_dialog): Default to directories only when prompt starts + with "Dired". + +2004-06-25 Kim F. Storm <storm@cua.dk> + + * alloc.c (allocate_misc): Update total_free_markers. + (free_misc): New function. + (safe_alloca_unwind, free_marker): Use it. + + * lisp.h (free_misc): Add prototype. + + * fns.c (Fmapconcat, Fmapcar): Remove superfluous GCPROs. + +2004-06-24 Richard M. Stallman <rms@gnu.org> + + * emacs.c (Vsignal_USR1_hook, Vsignal_USR2_hook): Definitions deleted. + (syms_of_emacs): Lisp variables deleted. + +2004-06-23 David Kastrup <dak@gnu.org> + + * search.c (Freplace_match): Adjust the match-data more thoroughly + when replacing strings in the buffer. + (Fmatch_data): When INTEGERS is non-nil and the last match was in + a buffer, add the buffer as last element to the match data. + (Fset_match_data): If an additional element of the match-data is a + buffer, restore it to last_thing_searched. + (save_search_regs): Save last_thing_searched as part of the match data. + (restore_match_data): Restore it again. + +2004-06-23 Luc Teirlinck <teirllm@auburn.edu> + + * keymap.c (Ftext_char_description): Doc fix. + * doc.c (Fsnarf_documentation): Doc fix. + +2004-06-22 Kim F. Storm <storm@cua.dk> + + * fns.c (Fmapcar, Fmapconcat): GCPRO the args array. + + * lisp.h (struct Lisp_Save_Value): New member dogc. + (SAFE_ALLOCA_LISP): Change second arg to number of elements. + Set dogc member in Lisp_Save_Value object so it will be GC'ed. + (SAFE_FREE_LISP): New macro. + + * alloc.c (safe_alloca_unwind): Clear dogc and pointer members. + (make_save_value): Init new dogc member. + (mark_object): Mark Lisp_Save_Value pointer array if dogc is set. + + * fns.c (Fmapconcat, Fmapcar): Use new SAFE_ALLOCA_LISP and + SAFE_FREE_LISP macros. + +2004-06-22 Kim F. Storm <storm@cua.dk> + + * lisp.h (SAFE_ALLOCA_LISP): New macro to allocate Lisp_Objects. + Temporarily inhibits GC if memory is xmalloc'ed, as the Lisp_Objects + in that memory area are unknown to GC. Add comments. + + * fns.c (Fmapconcat, Fmapcar): Use SAFE_ALLOCA_LISP. + +2004-06-21 Kim F. Storm <storm@cua.dk> + + * lisp.h (MAX_ALLOCA): Define here. + (safe_alloca_unwind): Add prototype. + (USE_SAFE_ALLOCA, SAFE_ALLOCA, SAFE_FREE): New macros. + + * alloc.c (safe_alloca_unwind): New function. + + * casefiddle.c (casify_object): Use SAFE_ALLOCA. + + * charset.c (Fstring): Use SAFE_ALLOCA. + + * coding.c (MAX_ALLOCA): Remove define. + + * data.c (MAX_ALLOCA): Remove define. + (Faset): Use SAFE_ALLOCA. + + * editfns.c (Fformat, Ftranspose_regions): Use SAFE_ALLOCA. + + * fns.c (string_make_multibyte, string_to_multibyte) + (string_make_unibyte, Fmapconcat, Fmapcar): Use SAFE_ALLOCA. + (MAX_ALLOCA): Remove define. + (Fbase64_encode_region, Fbase64_encode_string) + (Fbase64_decode_region, Fbase64_decode_string): Use SAFE_ALLOCA. + (Fbase64_encode_region, Fbase64_encode_string): Fix potential + memory leak if encoding fails. + + * xdisp.c (add_to_log): Use SAFE_ALLOCA. + +2004-06-21 Eli Zaretskii <eliz@gnu.org> + + * print.c (Fwith_output_to_temp_buffer): Doc fix. + +2004-06-20 Richard M. Stallman <rms@gnu.org> + + * xfaces.c (Finternal_copy_lisp_face): Small cleanup; doc fix. + + * search.c (match_limit): Cleaner err msg when no match data available. + + * window.c (syms_of_window): Doc fix. + + * keyboard.c (command_loop_1): Handle values `only' and `identity' + for Vtransient_mark_mode. + + * buffer.c (syms_of_buffer): Doc fix. + +2004-06-21 David Kastrup <dak@gnu.org> + + * minibuf.c (Ftry_completion, Fall_completions): Do lazy binding + and unbinding of `case-fold-search' according to + `completion-ignore-case' around calls of string-match and + predicates, respectively. Should give satisfactory performance + in all relevant cases. + +2004-06-17 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.c (x_draw_image_foreground_1): Subtract slice.x/y from + clip_x/y_origin. + + * fns.c (string_to_multibyte): Use xmalloc/xfree instead of alloca. + + * macfns.c (Fx_display_color_cells): Do not limit return value to 256. + + * macterm.c (mac_initialize_display_info): Initialize n_planes correctly + on Mac OSX. + +2004-06-16 Luc Teirlinck <teirllm@auburn.edu> + + * buffer.c (syms_of_buffer): Clarify `fill-column' docstring. + +2004-06-16 Kim F. Storm <storm@cua.dk> + + * dispextern.h (Vimage_types): Remove extern. + +2004-06-16 Miles Bader <miles@gnu.org> + + * image.c (lookup_image_type): Initialize image type if necessary. + +2004-06-15 Kim F. Storm <storm@cua.dk> + + * xdisp.c (try_cursor_movement): Exclude header line from scroll + margin at top of window. + (try_window_reusing_current_matrix): Calculate proper cursor position + after scrolling up with non-zero scroll margin, as the old cursor + position corresponds to value of PT before executing this command. + (try_window_id): Consider scroll margin at bottom of window too; + otherwise we fail to scroll when hl-line-mode is enabled. + + * syntax.c (skip_chars): Only recognize [:class:] when it has the + proper format and class is a lower-case word. + +2004-06-14 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (xg_get_image_for_pixmap): New function. + (xg_get_gdk_pixmap_and_mask): Remove. + (update_frame_tool_bar): Call xg_get_image_for_pixmap instead of + xg_get_gdk_pixmap_and_mask. + + * xterm.h (struct x_display_info): Typo in comment fixed. + +2004-06-14 Juanma Barranquero <lektu@terra.es> + + * dispextern.h (Vimage_types): Make it conditional on + HAVE_WINDOW_SYSTEM. + + * image.c (Vimage_types): Move from xdisp.c. + (Vimage_type_cache): New variable. + (define_image_type): New argument indicating whether an image + library was loaded; cache loaded status and return t on success, + nil otherwise. + (CACHE_IMAGE_TYPE, ADD_IMAGE_TYPE): New macros. + (w32_delayed_load): New function to load an image library from a + list of possible filenames. + (init_xpm_functions, init_png_functions, init_jpeg_functions) + (init_tiff_functions, init_gif_functions): Use `w32_delayed_load'. + (CHECK_LIB_AVAILABLE): Call `define_image_library' with new argument. + (Finit_image_library): New function, extracted from `init_image'. + Try to initialize an image library on demand and cache whether we + were successful or not. + (syms_of_image): Initialize `Vimage_types' and + `Vimage_type_cache'. Add recognized image types to Vimage_types. + Export `init-image-library'. + (init_image): Remove initialization of all image types, except xbm + and pbm. + + * xdisp.c (Vimage_types): Delete (moved to image.c). + +2004-06-14 Andreas Schwab <schwab@suse.de> + + * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion): + Avoid calling specbind when completion-regexp-list is empty. + +2004-06-13 Richard M. Stallman <rms@gnu.org> + + * regex.h (CHAR_CLASS_MAX_LENGTH, re_wctype_t, re_wchar_t) + (re_wctype, re_iswctype, re_wctype_to_bit): + Non-function definitions moved here from regex.c. + + * regex.c (re_wctype, re_iswctype): Function defs longer static. + (CHAR_CLASS_MAX_LENGTH, re_wctype_t, re_wchar_t) + (re_wctype, re_iswctype, re_wctype_to_bit): + Non-function definitions moved to regex.h. + + * window.c (Fselect_window): Doc fix. + + * syntax.c: Include regex.h. + (skip_chars): New arg HANDLE_ISO_CLASSES. Callers changed. + If requested, make a list of classes, then check the scanned + chars for membership in them. + (in_classes): New function. + Doc fix. + + * keyboard.c (cmd_error): Don't call any_kboard_state + if inside a recursive edit level. + +2004-06-13 K,Aa(Broly L$,1 q(Brentey <lorentey@elte.hu> + + * keyboard.c (command_loop): Call any_kboard_state before + command_loop_2 when at top level. + +2004-06-13 Andreas Schwab <schwab@suse.de> + + * print.c (print_object): Always use %ld for printing EMACS_INT. + + * keyboard.c (cancel_hourglass_unwind): Return a value. + (modify_event_symbol): Always use %ld for printing EMACS_INT. + (Fexecute_extended_command): Likewise. + + * syntax.h (SYNTAX_ENTRY_FOLLOW_PARENT): Rename local variable to + avoid clashes. + (SYNTAX): Likewise. + (SYNTAX_WITH_FLAGS): Likewise. + (SYNTAX_MATCH): Likewise. + + * syntax.c (char_quoted): Avoid warning about undefined operation. + (find_defun_start): Likewise. + (scan_lists): Likewise. + (INC_FROM): Likewise. + (scan_sexps_forward): Likewise. + + * image.c: Include <ctype.h>. + + * xfaces.c (face_attr_equal_p): Declare parameters. + +2004-06-13 Kenichi Handa <handa@m17n.org> + + * ccl.c (CCL_READ_CHAR): If hit EOF, set REG to -1. + +2004-06-12 Matthew Mundell <matt@mundell.ukfsn.org> + + * eval.c (Fdefun): Signal an error if NAME is not a symbol. + +2004-06-12 Kenichi Handa <handa@m17n.org> + + * ccl.c (CCL_CALL_FOR_MAP_INSTRUCTION): Save eof_ic in + ccl_prog_stack_struct and update it. + (CCL_INVALID_CMD): If CCL_DEBUG is defined, call ccl_debug_hook. + (CCL_READ_CHAR): Get instruction counter from eof_ic, not from + ccl->eof_ic on EOF. + (ccl_debug_hook): New function. + (struct ccl_prog_stack): New member eof_ic. + (ccl_driver): Handle EOF in subrountine call correctly. + +2004-06-11 Kenichi Handa <handa@m17n.org> + + * coding.c (encode_coding_string): Check CODING_FINISH_INTERRUPT. + +2004-06-11 Kim F. Storm <storm@cua.dk> + + * emacs.c (shut_down_emacs): Inhibit redisplay during shutdown. + +2004-06-11 Juanma Barranquero <lektu@terra.es> + + * keyboard.c (Fposn_at_point): Doc fix. + +2004-06-11 David Kastrup <dak@gnu.org> + + * search.c (match_limit): Don't flag an error if match-data + exceeding the allocated search_regs.num_regs gets requested, just + return Qnil. + +2004-06-08 Miles Bader <miles@gnu.org> + + * xfaces.c (push_named_merge_point): Return 0 when a cycle is detected. + +2004-06-07 Juanma Barranquero <lektu@terra.es> + + * editfns.c (Fuser_login_name, Ffloat_time, Fencode_time) + (Fcurrent_time_string, Fcurrent_time_zone) + (Finsert_buffer_substring, Ftranspose_regions): Doc fixes. + +2004-06-07 Miles Bader <miles@gnu.org> + + * xfaces.c (struct named_merge_point): New type. + (push_named_merge_point): New function. + (merge_named_face): New function. + (merge_face_ref, face_at_buffer_position, face_at_string_position): + Use `merge_named_face'. + (merge_face_inheritance): Function removed. + (merge_face_ref): Rename from `merge_face_vector_with_property'. + Add new `err_msgs' and `named_merge_points' args. Return error + status. Only print error messages if ERR_MSGS is true. Don't try to + do :inherit attribute validation. + (merge_face_heights): Handle `unspecified' in both directions. + (merge_face_vectors): Rename `cycle_check' arg to `named_merge_points'. + Call `merge_face_ref' instead of `merge_face_inheritance'. + (Fdisplay_supports_face_attributes_p, Fface_attributes_as_vector) + (compute_char_face, face_at_buffer_position) + (face_at_string_position): Call `merge_face_ref' instead of + `merge_face_vector_with_property'. + +2004-06-07 Kenichi Handa <handa@m17n.org> + + * coding.c (find_safe_codings): Check NILP (safe_codings) only at + the necessary places. + +2004-06-07 Kim F. Storm <storm@cua.dk> + + * process.c (Fdelete_process): Undo 2004-05-28 change. + Instead, call status_notify also for network process. + (status_message): Use process instead of status as arg. + Give messages "deleted" or "connection broken by remote peer" for + an exited network process. + (status_notify): Change call to status_message. + (read_process_output): Increase readmax to 4096. Do not increase + buffer size for datagram channels (default is now large enough). + +2004-06-06 Steven Tamm <tamm@Steven-Tamms-Computer.local> + + * macfns.c (x_create_tip_frame): Fix Mac OS X 10.1 compilation + problem due to newly defined variable. + +2004-06-06 Miles Bader <miles@gnu.org> + + * xfaces.c (Fdisplay_supports_face_attributes_p): Give up + immediately if non-interactive or not initialized. + +2004-06-05 Richard M. Stallman <rms@gnu.org> + + * minibuf.c (Fcompleting_read): Doc fix. + +2004-06-05 Andreas Schwab <schwab@suse.de> + + * macfns.c (x_create_tip_frame): Fix declaration after statement. + +2004-06-05 Juanma Barranquero <lektu@terra.es> + + * keymap.c (Fdescribe_vector): Fix docstring. + (Fkey_description, Fglobal_key_binding): Fix typo in docstring. + +2004-06-05 Miles Bader <miles@gnu.org> + + * xfaces.c (tty_supports_face_attributes_p): Make sure the specified + attributes have different values than the default face. + +2004-06-04 Eli Zaretskii <eliz@gnu.org> + + * xfaces.c (x_supports_face_attributes_p): Make this function + conditional on HAVE_WINDOW_SYSTEM. + (Fdisplay_supports_face_attributes_p) [HAVE_WINDOW_SYSTEM]: + Don't call x_supports_face_attributes_p if it was not compiled in. + +2004-06-04 Miles Bader <miles@gnu.org> + + * xfaces.c (tty_supports_face_attributes_p): New function, mostly + from Ftty_supports_face_attributes_p. + (x_supports_face_attributes_p): New function. + (Ftty_supports_face_attributes_p): Function deleted. + (Fdisplay_supports_face_attributes_p): New function. + (syms_of_xfaces): Initialize Sdisplay_supports_face_attributes_p. + (face_attr_equal_p): New function. + (lface_equal_p): Use it. + +2004-06-03 Juanma Barranquero <lektu@terra.es> + + * w32fns.c (Fx_display_grayscale_p, Fw32_send_sys_command) + (Vw32_color_map): Fix typo in docstring. + (Fx_create_frame, Fw32_find_bdf_fonts, Fx_show_tip) + (Fw32_unregister_hot_key, Fw32_reconstruct_hot_key): + Make argument names match their use in docstring. + +2004-06-02 Juanma Barranquero <lektu@terra.es> + + Work around bugs/problems with MinGW builds of graphics libraries + called from MSVC builds of Emacs. + + * image.c (lookup_image): Make pointer to img static. + (png_read_from_memory): Disable "global" optimization. + +2004-06-01 Stefan Monnier <monnier@iro.umontreal.ca> + + * eval.c (Fcondition_case): Fix usage. Simplify. + + * mem-limits.h (EXCEEDS_LISP_PTR) [USE_LSB_TAG]: Never true. + +2004-05-29 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macfns.c: Don't include ccl.h. + [MAC_OSX]: Don't include QuickTime/QuickTime.h. + [!MAC_OSX]: Don't include alloca.h, Windows.h, Gestalt.h, or + TextUtils.h. + (Fx_create_frame): Sync with xfns.c. Initialize cursor descriptors. + (Fx_display_mm_height, Fx_display_mm_width): Calculate length from + display height/width. + (compute_tip_xy, Vx_max_tooltip_size): Declare. + (unwind_create_tip_frame, compute_tip_xy): New functions. + (x_create_tip_frame, Fx_show_tip, Fx_hide_tip): Sync with xfns.c. + (syms_of_macfns): Initialize Qcancel_timer, Vx_max_tooltip_size, + and last_show_tip_args. + + * macgui.h [!MAC_OSX]: Include Gestalt.h. + (Cursor, No_Cursor): New defines. + [!TARGET_API_MAC_CARBON] (SetPortWindowPort): New compatibility macro. + [!TARGET_API_MAC_CARBON] (arrow_cursor): Declare. + + * macmenu.c (mac_menu_show, mac_dialog): Use SetPortWindowPort. + + * macterm.c: Don't include Gestalt.h. + (enum mouse_tracking_type, mouse_tracking_in_progress): Remove. + (XDrawLine, XClearArea, XClearWindow, mac_draw_bitmap) + (mac_set_clip_rectangle, mac_reset_clipping, XCreatePixmap) + (XFillRectangle, mac_draw_rectangle, mac_draw_string_common) + (mac_copy_area, mac_copy_area_with_mask, x_update_end) + (construct_mouse_click, XTmouse_position) + (x_scroll_bar_report_motion, x_calc_absolute_position) + (do_mouse_moved, do_zoom_window, mac_do_receive_drag) + (XTread_socket, make_mac_frame): Use SetPortWindowPort. + (note_mouse_movement): Clear the mouse face and reset the pointer + shape when the pointer goes outside the frame without grabbing. + (mac_front_window): New function. + (mac_window_to_frame): New macro. + (XTmouse_position, x_scroll_bar_report_motion, do_window_update) + (do_window_activate, do_window_deactivate, do_app_resume) + (do_app_suspend, do_mouse_moved, do_menu_choice, do_grow_window) + (do_zoom_window, mac_do_receive_drag, XTread_socket) + (mac_check_for_quit_char): Use mac_front_window and/or + mac_window_to_frame. + (x_scroll_bar_handle_click): Set `(PORTION . WHOLE)' part in a + scroll-bar click event. + (mac_define_frame_cursor): Change the pointer shape. + (x_free_frame_resources): Reset tip_window to NULL when it is + disposed of. + [!TARGET_API_MAC_CARBON] (arrow_cursor): New variable. + [!TARGET_API_MAC_CARBON] (do_init_managers): Initialize arrow_cursor. + (do_window_update): Don't do anything if the updated window is the + tooltip window. + (do_mouse_moved): Handle mouse movement events here (previously in + XTread_socket). Clear the mouse face if + dpyinfo->mouse_face_hidden is set. + (do_os_event, do_events): Remove (now in XTread_socket). + (XTread_socket): Immediately return if interrupt_input_blocked. + Loop until all the events in the queue are processed. + Rearrange codes for mouse grabbing. Add tooltip support. Include the + contents of do_os_event and do_events. Remove mouse movement + handling (now in do_mouse_moved). Add the case where + Vmouse_highlight has an integer value. + (NewMacWindow): Remove. + (make_mac_frame): Do what NewMacWindow previously did. Don't do + excess initializations. + (make_mac_terminal_frame): Previous initializations in + make_mac_frame are moved here. + (mac_initialize_display_info): + Initialize dpyinfo->mouse_face_overlay and dpyinfo->mouse_face_hidden. + + * xdisp.c [MAC_OS] (No_Cursor): Remove variable. + (define_frame_cursor1): Don't treat HAVE_CARBON as a special case. + +2004-05-29 Richard M. Stallman <rms@gnu.org> + + * lisp.h (truncate_undo_list): Update decl. + + * alloc.c (undo_outer_limit): New variable. + (syms_of_alloc): Defvar it. + (Fgarbage_collect): Pass undo_outer_limit to truncate_undo_list. + + * undo.c (truncate_undo_list): New arg LIMITSIZE. + + * alloc.c (lisp_align_malloc): Check for base == 0 + regardless of HAVE_POSIX_MEMALIGN. + Clean up HAVE_POSIX_MEMALIGN handling of `err'. + +2004-05-28 Stefan Monnier <monnier@iro.umontreal.ca> + + * alloc.c: Undo Kim's recent changes and fix the same bug differently. + (marker_blocks_pending_free): Remove. + (Fgarbage_collect): Sweep after cleaning up undo-lists. + Mark the undo lists after claning them up. + Don't free block in marker_blocks_pending_free. + (mark_buffer): Don't mark undo_list. + (gc_sweep): Sweep hash-tables and strings first. + Do free marker blocks that are empty. + +2004-05-28 Jim Blandy <jimb@redhat.com> + + * regex.c (print_partial_compiled_pattern): Add missing 'break' + after 'case wordend'. For symbeg and symend, print to stderr, + like the other cases. + +2004-05-28 Noah Friedman <friedman@splode.com> + + * process.c (Fdelete_process): Do not call remove_process. + +2004-05-28 Stefan Monnier <monnier@iro.umontreal.ca> + + * alloc.c (struct backtrace): Remove. + (Fgarbage_collect): Use the new mark_backtrace. + + * eval.c (mark_backtrace): New function. + + * minibuf.c (run_exit_minibuf_hook): New function. + (read_minibuf_unwind): Don't run exit-minibuffer-hook any more. + (read_minibuf): Use separate unwind handler to run exit-minibuf-hook. + +2004-05-27 Kim F. Storm <storm@cua.dk> + + * xdisp.c (back_to_previous_visible_line_start): Skip backwards + over display properties, e.g. images, that replace buffer text. + +2004-05-25 Kim F. Storm <storm@cua.dk> + + * alloc.c (marker_blocks_pending_free): New var. + (gc_sweep): Store free marker blocks on that list. + (Fgarbage_collect): Free them after undo-list cleanup. + + * process.c (wait_reading_process_input): Check connect_wait_mask + before actually accepting connection in case it has already been + accepted due to recursion. + +2004-05-23 K,Aa(Broly L$,1 q(Brentey <lorentey@elte.hu> + + * coding.c (Fset_safe_terminal_coding_system_internal): + Set suppress_error in safe_terminal_coding, not terminal_coding. + +2004-05-22 Richard M. Stallman <rms@gnu.org> + + * alloc.c (Fmake_string): Doc fix. + + * buffer.c (clone_per_buffer_values): Copy the alist of local vars, + and the alist pairs too. + + * casefiddle.c (casify_object): Return OBJ unchanged if not real char. + + * emacs.c (main): Update copyright year. + + * fileio.c (Fread_file_name): Expand DIR if not absolute. + + * insdel.c (del_range_2, replace_range): Don't write an anchor + if the gap is empty. + + * xdisp.c (try_scrolling): If scroll-up-aggressively or + scroll-down-aggressively is small but positive, put point + near the screen edge. + +2004-05-22 Juanma Barranquero <lektu@terra.es> + + * keymap.c (Fdefine_key): Doc fix. + +2004-05-22 Kim F. Storm <storm@cua.dk> + + * alloc.c (struct backtrace): Add debug_on_exit member. + (Fgarbage_collect): Clear out buffer undo_list markers after gc_sweep. + Identify those markers as Lisp_Misc_Free objects. Clear car and cdr of + the removed cons cells. + (mark_object): Undo previous change - disallow Lisp_Misc_Free objects. + (gc_sweep): Clear cons_blocks before sweeping strings, so we don't have + any cons cells pointing to unallocated stings. + Do not lisp_free any marker blocks, as there may still be pointers + to them from buffer undo lists at this stage of GC. + + * keyboard.c (struct backtrace): Add debug_on_exit member. + (Fcommand_execute): Clear it. + +2004-05-20 Luc Teirlinck <teirllm@auburn.edu> + + * intervals.c (lookup_char_property): Do not prematurely return nil. + +2004-05-19 Jim Blandy <jimb@redhat.com> + + Add support for new '\_<' and '\_>' regexp operators, matching the + beginning and end of symbols. + + * regex.c (enum syntaxcode): Add Ssymbol. + (init_syntax_once): Set the syntax for '_' to Ssymbol, not Sword. + (re_opcode_t): New opcodes `symbeg' and `symend'. + (print_partial_compiled_pattern): Print the new opcodes properly. + (regex_compile): Parse the new operators. + (analyse_first): Skip sym(beg|end) (they match only the empty string). + (mutually_exclusive_p): `symend' is mutually exclusive with \s_ and + \sw; `symbeg' is mutually exclusive with \S_ and \Sw. + (re_match_2_internal): Match symbeg and symend. + + * search.c (trivial_regexp_p): \_ is no longer a trivial regexp. + +2004-05-19 Kim F. Storm <storm@cua.dk> + + * .gdbinit (xsymbol): Fix last change. + +2004-05-18 Stefan Monnier <monnier@iro.umontreal.ca> + + * .gdbinit (xprintstr): New fun. + (xstring, xprintsym): Use it. + + * w32proc.c (create_child): Use INTMASK. + + * alloc.c (Fgarbage_collect): Do all the marking before flushing + unmarked elements of the undo list. + +2004-05-18 David Ponce <david@dponce.com> + + * print.c (print): Reset print_depth before to call print_object. + +2004-05-18 Jason Rumney <jasonr@gnu.org> + + * w32console.c: Prefix RIF functions with w32con_ to avoid + namespace clash with functions in term.c and w32term.c. + + * w32menu.c (add_menu_item, w32_menu_display_help) + [USE_LISP_UNION_TYPE]: Cast from Lisp_Object using i member. + + * w32term.h (display_x_get_resource, vga_stdcolor_name): Add prototype. + +2004-05-18 Eli Zaretskii <eliz@gnu.org> + + * lisp.h (DECL_ALIGN): Remove restriction on MS-DOS systems. + + * msdos.c (syms_of_msdos): Initialize dos-unsupported-char-glyph + with make_number. + (IT_write_glyphs): Extract glyph from dos-unsupported-char-glyph + with XINT. + +2004-05-18 Kim F. Storm <storm@cua.dk> + + * blockinput.h (INPUT_BLOCKED_P): New macros. + + * keyboard.c (Frecursive_edit): Return immediately if input blocked. + (Ftop_level): Unblock input if blocked. + + * buffer.h (GET_OVERLAYS_AT): New macro. + * msdos.c (IT_note_mouse_highlight): Use it. + * textprop.c (get_char_property_and_overlay): Use it. + * xdisp.c (next_overlay_change, note_mouse_highlight): Use it. + * xfaces.c (face_at_buffer_position): Use it. + + * print.c (print_object): Increase buf size. + +2004-05-17 Jason Rumney <jasonr@gnu.org> + + * w32fns.c (Fw32_register_hot_key, Fw32_unregister_hot_key) + (Fw32_toggle_lock_key) [USE_LISP_UNION_TYPE]: Cast from + Lisp_Object using i member. + (w32_quit_key): Rename from Vw32_quit_key, and make an int. + (syms_of_w32fns, globals_of_w32fns): Use Lisp_Object and int + consistently. + + * w32proc.c (create_child): Use make_number instead of masking pid. + + * w32fns.c (w32_color_map_lookup): Return a Lisp_Object. + (x_to_w32_charset, w32_to_x_charset, w32_to_all_x_charsets): + Use EQ to compare Lisp_Objects. + (w32_parse_hot_key): Use int for lisp_modifiers consistently. + + * w32term.c (w32_num_mouse_buttons): Rename from + Vw32_num_mouse_buttons and make it an int. + + * w32.c (init_environment): Use it. + + * w32fns.c (w32_wnd_proc): Likewise. + + * w32proc.c (w32_pipe_read_delay): Rename from + Vw32_pipe_read_delay and make it an int. + + * w32.c (_sys_read_ahead): Use it. + + * lisp.h (egetenv) [USE_CRT_DLL]: Remove condition. + + * w32proc.c (create_child) [USE_LSB_TAG]: Don't try to mask pid. + + * w32inevt.c (w32_console_mouse_position, do_mouse_event) + (key_event): Don't mix Lisp_Object and int. + + * w32heap.c (init_heap) [USE_LSB_TAG]: Don't check heap location. + + * keyboard.c (kbd_buffer_get_event): Don't use event->code and + modifiers in language change event. + +2004-05-17 Kim F. Storm <storm@cua.dk> + + * alloc.c (mark_object): Ignore Lisp_Misc_Free objects. + Such objects may be freed markers which still exist on an undo list. + +2004-05-16 Juanma Barranquero <lektu@terra.es> + + * data.c (Fset_default): Make argument names match their use in + docstring. + +2004-05-15 Andreas Schwab <schwab@suse.de> + + * emacs.c (gdb_array_mark_flag): Define. + * .gdbinit: Mask off gdb_array_mark_flag from vector sizes. + +2004-05-15 Eli Zaretskii <eliz@gnu.org> + + * lisp.h (DECL_ALIGN) [MSDOS]: Don't define DECL_ALIGN to use + __attribute__((__aligned__)), so that USE_LSB_TAG would not become + defined for the MS-DOS build. + +2004-05-14 Stefan Monnier <monnier@iro.umontreal.ca> + + * w32fns.c (Fw32_define_rgb_color): Avoid XSET. + +2004-05-14 Kenichi Handa <handa@m17n.org> + + * ccl.c (Fccl_execute_on_string): Fix setting elements of STATUS. + +2004-05-14 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * lisp.h (Vx_resource_name, Vx_resource_class): Move from xfns.c + section to frame.c section. + (Fxw_display_color_p, Fx_file_dialog): Declare if + HAVE_WINDOW_SYSTEM defined. + + * macfns.c (Fx_create_frame): Fix int/Lisp_Object mixup. + + * macmenu.c (set_frame_menubar): Use NILP to test a lisp value. + + * macterm.c (mac_get_emulated_btn, mac_event_to_emacs_modifiers) + (mac_get_mouse_btn): Use NILP and EQ to test/compare lisp values. + (XTread_socket): Fix int/Lisp_Object mixup. + (mac_check_for_quit_char): Fix pointer/Lisp_Object mixup. + + * macterm.h (struct frame, struct face, struct image) + (display_x_get_resource, Fx_display_color_p) + (Fx_display_grayscale_p, Fx_display_planes, x_free_gcs): + Add prototypes. + +2004-05-14 Kim F. Storm <storm@cua.dk> + + * process.c (wait_reading_process_input): Make reentrant. + Make Available and Connecting non-static. Save and restore value + of waiting_for_user_input_p. + +2004-05-13 Kim F. Storm <storm@cua.dk> + + * keyboard.c (mark_kboards): Don't mark x and y members + that are overloaded in selection request events. + +2004-05-13 Stefan Monnier <monnier@iro.umontreal.ca> + + * lisp.h (USE_LSB_TAG): Make it the default when it is known to work. + +2004-05-13 Glenn Morris <gmorris@ast.cam.ac.uk> + + * window.c (Fdisplay_buffer, Fsplit_window) + (split-height-threshold): Doc fix. + +2004-05-13 Juanma Barranquero <lektu@terra.es> + + * xfaces.c (Ftty_supports_face_attributes_p) + (Finternal_copy_lisp_face): Fix typo in docstring. + (Finternal_get_lisp_face_attribute): Fix docstring. + +2004-05-12 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xfns.c (syms_of_xfns): Provide x-toolkit also for GTK. + +2004-05-11 Steven Tamm <steventamm@mac.com> + + * macfns.c (Fx_create_frame): Default to using tool-bar by + setting tool-bar-lines to 1 in default-frame-alist. + +2004-05-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * image.c (xpm_scan, xpm_make_color_table_v, xpm_put_color_table_v) + (xpm_get_color_table_v, xpm_make_color_table_h) + (xpm_put_color_table_h, xpm_get_color_table_h) + (xpm_str_to_color_key, xpm_load_image, xpm_load) + (syms_of_image): Support XPM on Carbon Emacs. Does not + depend on libXpm, but only supports XPM version 3 without extensions. + +2004-05-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c (x_flush, XTframe_up_to_date): Use FRAME_MAC_P + instead of FRAME_X_P. + +2004-05-11 Kim F. Storm <storm@cua.dk> + + * process.c (read_process_output): Grow decoding_buf when needed; + this could cause a crash in allocate_string and compact_small_strings. + +2004-04-29 Jim Blandy <jimb@redhat.com> + + * regex.c (mutually_exclusive_p): In 'case wordbeg', compare op2 + against proper opcode. + +2004-05-10 Juanma Barranquero <lektu@terra.es> + + * process.c (Fstart_process): Fix docstring. + + * charset.c (Fget_unused_iso_final_char): Fix typos in docstring. + (Fchar_bytes, Fchar_width, Fstring_width, Fchar_direction) + (Fsplit_char, Fchar_charset): Make argument names match their use + in docstring. + +2004-05-10 Richard M. Stallman <rms@gnu.org> + + * print.c (print_preprocess): Use being_printed, loop_count and + halftail to detect overdeep nesting and cyclic cdr chains. + +2004-05-10 Andreas Schwab <schwab@suse.de> + + * lisp.h (Fmake_symbolic_link): Declare. + + * fileio.c (Frename_file): Remove extra argument in call to + Fmake_symbolic_link. + +2004-05-10 Kim F. Storm <storm@cua.dk> + + * xdisp.c (calc_line_height_property): Use string position when + object is a string. + +2004-05-10 Kenichi Handa <handa@m17n.org> + + * print.c (temp_output_buffer_setup): Bind inhibit-read-only and + inhibit-modification-hooks to t temporarily before calling + Ferase_buffer. + + * xfns.c (x_create_tip_frame): Bind inhibit-read-only and + inhibit-modification-hooks to t temporarily before calling + Ferase_buffer. + + * w32fns.c (x_create_tip_frame): Bind inhibit-read-only and + inhibit-modification-hooks to t temporarily before calling + Ferase_buffer. + + * fns.c (count_combining): Delete it. + (concat): Don't check combining bytes. + +2004-05-09 Jason Rumney <jasonr@gnu.org> + + * w32fns.c (Vw32_ansi_code_page): New Lisp variable. + (globals_of_w32fns): Set it. + +2004-05-09 Piet van Oostrum <piet@cs.uu.nl> + + * data.c (Fquo): Simplify. + +2004-05-08 Peter Whaite <emacs@whaite.ca> (tiny change) + + * data.c (Fquo): If any argument is float, do the computation in + floating point. + +2004-05-08 Juanma Barranquero <lektu@terra.es> + + * process.c (Fwaiting_for_user_input_p, Fmake_network_process) + (Fset_process_query_on_exit_flag, Vprocess_adaptive_read_buffering): + Fix spelling of Emacs on docstring. + (Fset_process_coding_system, Fprocess_coding_system) + (Fset_process_filter_multibyte, Fprocess_filter_multibyte_p): + Make argument names match their use in docstring. + (Fprocess_id, Fprocess_query_on_exit_flag, Finterrupt_process): + Fix docstring. + + * editfns.c (Finsert_buffer_substring): Make argument names match their + use in docstring. + + * syntax.c (Fmodify_syntax_entry): Fix docstring. + +2004-05-07 Steven Tamm <steventamm@mac.com> + + * macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT + around call to ReceiveEvent to avoid certain crashes. + +2004-05-07 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c (mac_draw_line_to_pixmap, XCreatePixmapFromBitmapData) + (mac_fill_rectangle_to_pixmap, mac_draw_rectangle_to_pixmap) + (mac_copy_area_to_pixmap, mac_copy_area_with_mask_to_pixmap): + Save/restore the current graphics port and device handle when + drawing into an offscreen graphics world. + + * image.c [MAC_OS] (XPutPixel, XGetPixel, image_load_qt_1) + (gif_load): Likewise. + +2004-05-07 Juanma Barranquero <lektu@terra.es> + + * window.c (Fset_window_buffer): Fix docstring. + +2004-05-06 Thien-Thi Nguyen <ttn@gnu.org> + + * emacs.c (main) [VMS]: Fix var ref. + +2004-05-06 Romain Francoise <romain@orebokech.com> + + * data.c (Fsetq_default): Fix docstring. + +2004-05-06 Jason Rumney <jasonr@gnu.org> + + * image.c (Display) [HAVE_NTGUI]: Redefine while loading xpm.h + to avoid name clash. + +2004-05-04 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * fileio.c (barf_or_query_if_file_exists): Use lstat. + (Frename_file): Handle renaming of symlinks across file systems. + (Frename_file): Put symlink handling inside #ifdef S_IFLNK. + +2004-05-04 Kim F. Storm <storm@cua.dk> + + * xdisp.c (Qtotal): New var. + (syms_of_xdisp): Intern and staticpro it. + (calc_line_height_property): New arg total. Set it if + line-spacing property has format (total . VALUE). + (x_produce_glyphs): Ignore line-spacing if line-height is 0. + Handle total line-spacing property. + +2004-05-03 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (xg_update_scrollbar_pos): Call XClearWindow to clear + "under" scroll bar when size/position changes. + +2004-05-03 Jason Rumney <jasonr@gnu.org> + + * makefile.nt: Remove. + +2004-05-02 Eli Zaretskii <eliz@gnu.org> + + * syntax.h (SET_RAW_SYNTAX_ENTRY, SYNTAX_ENTRY_INT): + Avoid compiler warnings. + + * Makefile.in (region-cache.o): Depend on config.h. + +2004-05-02 Romain Francoise <romain@orebokech.com> + + * indent.c (compute_motion): Save vpos in prev_vpos when dealing + with continuation lines, too. + +2004-05-02 Thien-Thi Nguyen <ttn@gnu.org> + + * syssignal.h (init_signals): Move decl outside `#ifdef POSIX_SIGNALS'. + +2004-05-01 Stefan Monnier <monnier@iro.umontreal.ca> + + * xdisp.c (calc_line_height_property): YAILOM (yet another + int/Lisp_Object mixup). + +2004-05-01 Eli Zaretskii <eliz@gnu.org> + + * msdos.c (top-level): Add "#pragma pack(0)" after <dir.h>, to + undo bad effect of pack(4) in some versions of system headers. + +2004-05-01 Jason Rumney <jasonr@gnu.org> + + * w32term.c (x_draw_hollow_cursor): Sync with xterm.c. + +2004-04-30 Kim F. Storm <storm@cua.dk> + + * buffer.c (syms_of_buffer) <line-spacing>: Allow float value. + (syms_of_buffer) <cursor-type>: Doc fix. + + * dispextern.h (struct it): Remove member use_default_face. + Add members override_ascent, override_descent, override_boff. + + * xdisp.c (init_iterator): Handle line-spacing float value. + Initialize override_ascent member. + (append_space_for_newline): Reset override_ascent. + Remove use_default_face. + (calc_line_height_property): New function to calculate value of + line-height and line-spacing properties. Look at overlays, too. + Set override_ascent, override_descent, override_boff members when + using another face than the current face. Float values are now + relative to the frame default font, by default; accept a cons + of ratio and face name to specify value relative to a specific face. + (x_produce_glyphs): Use calc_line_height_property. + Use override_ascent etc. when set to handle different face heights. + A negative line-spacing property value is interpreted as a total + line height, rather than inter-line spacing. + (note_mouse_highlight): Allocate room for 40 overlays initially. + +2004-04-29 Stefan Monnier <monnier@iro.umontreal.ca> + + * data.c (Fsubr_name): New fun. + (syms_of_data): Defsubr it. + +2004-04-29 Kim F. Storm <storm@cua.dk> + + * xdisp.c (null_glyph_slice): New var. + (append_glyph, append_composite_glyph, append_stretch_glyph): + Use it to initialize glyph slice. + +2004-04-27 Stefan Monnier <monnier@iro.umontreal.ca> + + * xdisp.c (x_produce_glyphs): Fix the proverbial int/Lisp_Object mixup. + (on_hot_spot_p): Make sure we always return a value. + (Flookup_image_map): Remove unused var ix and iy. + (note_mode_line_or_margin_highlight): Remove unused var `image'. + +2004-04-27 Eli Zaretskii <eliz@gnu.org> + + * msdos.c (init_environment): If one of the TMP... environment + variables is set to a drive letter without a trailing slash, + append a slash. + +2004-04-27 Matthew Mundell <matt@mundell.ukfsn.org> + + * editfns.c (lisp_time_argument): Provide externally. + + * fileio.c (Fset_file_times): New function. + (syms_of_fileio): Intern and staticpro it. + +2004-04-27 Kim F. Storm <storm@cua.dk> + + * xdisp.c (x_produce_glyphs): Fix last change; handle newline in + header line strings. + + * dispextern.h (struct it): New member use_default_face. + + * xdisp.c (Qline_height): New variable. + (syms_of_xdisp): Intern and staticpro it. + (append_space_for_newline): Partially undo 2004-04-25 change; + add default_face_p arg, and restore callers. + Clear it->use_default_face after use. + (x_produce_glyphs): Set default font for ascii char if + it->use_default_font is set. Change line-spacing property to set + just extra line spacing. Handle new line-height property. + +2004-04-26 Andreas Schwab <schwab@suse.de> + + * print.c (print_object): Print non-ascii characters in bool + vector representation as octal escapes. + + * lisp.h (BOOL_VECTOR_BITS_PER_CHAR): Define. + * print.c (print_object): Use it instead of BITS_PER_CHAR for + bool vectors. + * lread.c (read1): Likewise. + * alloc.c (Fmake_bool_vector): Likewise. + * data.c (Faref, Faset): Likewise. + * fns.c (Fcopy_sequence, concat, internal_equal, Ffillarray) + (mapcar1): Likewise. + +2004-04-26 Steven Tamm <tamm@Steven-Tamms-Computer.local> + + * lread.c (init_lread): Fix typo in HAVE_CARBON test logic. + +2004-04-26 Miles Bader <miles@gnu.org> + + * lisp.h (CYCLE_CHECK): Macro moved from xfaces.c. + +2004-04-26 Juanma Barranquero <lektu@terra.es> + + * buffer.c (Fpop_to_buffer): Fix docstring. + +2004-04-26 Steven Tamm <steventamm@mac.com> + + * lread.c (init_lread): Don't display missing lisp directory + warnings with Carbon Emacs because self-contained bundled Emacs + may be built without correct installation path. + +2004-04-25 Kim F. Storm <storm@cua.dk> + + * macterm.c (x_draw_hollow_cursor): Fix height of box for narrow lines. + + * xterm.c (x_draw_hollow_cursor): Fix height of box for narrow lines. + + * xdisp.c (append_space_for_newline): Rename from append_space. + Remove DEFAULT_FACE_P arg; always use current face. Callers changed. + (x_produce_glyphs): Handle line-spacing property on newline char. + If value is t, adjust ascent and descent to fit current row height. + If value is an integer or float, set extra_line_spacing to integer + value, or to float value x current line height. + +2004-04-23 Kenichi Handa <handa@m17n.org> + + * fontset.c (Finternal_char_font): If POSITION is nil, return + font for displaying CH with the default face. + +2004-04-23 Juanma Barranquero <lektu@terra.es> + + * makefile.w32-in: Add "-*- makefile -*-" mode tag. + +2004-04-21 Stefan Monnier <monnier@iro.umontreal.ca> + + * lisp.h (XINT) [EXPLICIT_SIGN_EXTEND && !NO_UNION_TYPE]: + Don't make assumptions about the relative place of i and val. + (EQ) [!NO_UNION_TYPE]: Don't forget to check the type match as well. + +2004-04-21 Kim F. Storm <storm@cua.dk> + + * dispextern.h (struct glyph_slice): New struct. + (struct glyph): New member slice. + (GLYPH_SLICE_EQUAL_P): New macro. + (GLYPH_EQUAL_P): Use it. + (struct glyph_string): New member slice. + (struct it_slice): New struct. + (struct it): New member slice, add member to stack too. + New member constrain_row_ascent_descent_p. + (image_ascent): Add prototype. + + * dispnew.c (buffer_posn_from_coords): Return full image width + and height even for image slices (posn is relative to full image). + (marginal_area_string): Adjust x0,y0 for image slice. + + * image.c (image_ascent): Add slice arg; calculate ascent for + image slice (or full image). + + * keyboard.c (Fposn_at_x_y, Fposn_at_point): New defuns. + (syms_of_keyboard): Defsubr them. + + * lisp.h (pos_visible_p): Fix prototype. + + * macterm.c (x_draw_relief_rect): Add top_p and bot_p args. + (x_draw_glyph_string_box): Fix call to x_draw_relief_rect. + (x_draw_image_foreground, x_draw_image_relief) + (x_draw_image_foreground_1, x_draw_image_glyph_string): + Draw sliced images. + + * w32term.c (w32_draw_relief_rect): Add top_p and bot_p args. + (x_draw_glyph_string_box): Fix call to x_draw_relief_rect. + (x_draw_image_foreground, x_draw_image_relief) + (w32_draw_image_foreground_1, x_draw_image_glyph_string): + Draw sliced images. + + * w32term.h (image_ascent): Remove prototype. + + * window.c (Fpos_visible_in_window_p): Return pixel position if + PARTIALLY arg is non-nil. Simplify. Doc fix. + (Fwindow_vscroll, Fset_window_vscroll): Add optional PIXEL_P arg + to return/set vscroll in pixels. + + * window.h (Fwindow_vscroll, Fset_window_vscroll): Fix EXFUN. + + * xdisp.c (Qslice): New variable. + (syms_of_xdisp): Intern and staticpro it. + (pos_visible_p): Return pixel position in new x and y args. + (init_iterator): Reset it->slice info. + (handle_display_prop): Parse (slice ...) property. + (push_it, pop_it): Save/restore slice info. + (make_cursor_line_fully_visible): Fix 2004-04-14 change. Do not + force repositioning of tall row if window is vscrolled, as that + would reset vscroll. + (append_space): Set it->constrain_row_ascent_descent_p to avoid + increasing row height if row is non-empty. + (fill_image_glyph_string): Copy slice info. + (take_vertical_position_into_account): Simplify. + (produce_image_glyph): Handle iterator slice info, setup glyph + slice info. Do not force minimum line height. + (x_produce_glyphs): If it->constrain_row_ascent_descent_p is set, + do not increase height (ascent/descent) of non-empty row when + adding normal character glyph; instead reduce glyph ascent/descent + appropriately; if row is higher than current glyph, adjust glyph + descent/ascent to reposition glyph within the existing row. + Likewise, when char is newline, only set ascent/descent if row is + currently empty. + (note_mouse_highlight): Handle hotspots with sliced image. + + * xterm.c (x_draw_relief_rect): Add top_p and bot_p args. + (x_draw_glyph_string_box): Fix call to x_draw_relief_rect. + (x_draw_image_foreground, x_draw_image_relief) + (x_draw_image_foreground_1, x_draw_image_glyph_string): + Draw sliced images. + + * xterm.h (image_ascent): Remove prototype. + +2004-04-20 Stefan Monnier <monnier@iro.umontreal.ca> + + * keymap.c (Fkey_description): Fix the usual int/Lisp_Object mixup. + +2004-04-20 John Paul Wallington <jpw@gnu.org> + + * fns.c (Fassoc, Feql): Fix indentation. + + * fontset.c (regularize_fontname): Rename from regulalize_fontname. + +2004-04-19 John Paul Wallington <jpw@gnu.org> + + * fns.c (Feql): New function. + (syms_of_fns): Defsubr it. + +2004-04-18 Jason Rumney <jasonr@gnu.org> + + * w32select.c (Fw32_set_clipboard_data): Get sequence number + after closing the clipboard. + +2004-04-16 Luc Teirlinck <teirllm@auburn.edu> + + * buffer.c (Fbuffer_base_buffer): Doc fix. + +2004-04-17 Kim F. Storm <storm@cua.dk> + + * keymap.c (Fkey_description): Add optional PREFIX arg. + Combine prefix with KEYS to make up the full key sequence to describe. + Correlate meta_prefix_char and following (simple) key to describe + as meta modifier. All callers changed. + (describe_map): Rename arg `keys' to `prefix'. Remove local + `elt_prefix' var. Use Fkey_description with prefix instead of + elt_prefix combined with Fsingle_key_description. + (describe_vector): Declare static. Replace arg `elt_prefix' with + `prefix'. Add KEYMAP_P arg. Add local var `elt_prefix'; use it + if !KEYMAP_P. Use Fkey_description with prefix instead of + Fsingle_key_description. + + * keymap.h (Fkey_description): Fix prototype. + (describe_vector): Remove prototype. + + * xdisp.c (update_overlay_arrows): Fix handling of up_to_date < 0. + + * image.c (PNG_BG_COLOR_SHIFT): Remove. + (png_load): Fix calculation of transparent background color on X + and W32 platforms. + +2004-04-16 Juanma Barranquero <lektu@terra.es> + + * xdisp.c (try_scrolling): Make sure `scroll-conservatively' is + not too large before computing how much to scroll. + +2004-04-15 Stefan Monnier <monnier@iro.umontreal.ca> + + * dired.c (Ffile_attributes): Don't pass extra nil arg to file-handler. + +2004-04-14 Luc Teirlinck <teirllm@auburn.edu> + + * fileio.c (Fverify_visited_file_modtime, Fvisited_file_modtime): + Add hyperlink to Elisp manual to the docstring. + +2004-04-14 Stefan Monnier <monnier@iro.umontreal.ca> + + * callint.c (fix_command): Use XDCR. + +2004-04-14 Nick Roberts <nick@nick.uklinux.net> + + * window.c (Fget_lru_window): Doc fix. + +2004-04-14 Kim F. Storm <storm@cua.dk> + + * editfns.c (Fformat): Fix allocation size of precision array. + + * dispnew.c (update_window): Only set changed_p if + scrolling_window actually did scroll. + (scrolling_window): Only return 1 if we actually did scroll. + + * xdisp.c (get_glyph_string_clip_rect): Fix reduction of cursor + height to glyph height when cursor row is not fully visible. + (make_cursor_line_fully_visible): Add FORCE_P arg to return + failure in case row is higher than window. Callers changed. + (try_scrolling): Fix loop in scrolling if last_line_misfit (from Gerd). + Try to scroll partially visible, higher-than-window cursor row. + (redisplay_window): Always try to scroll partially visible, + higher-than-window cursor row - both initially and again with + centering_position = 0. + Clear desired matrix before retrying with centering_position = 0. + +2004-04-13 Stefan Monnier <monnier@iro.umontreal.ca> + + * syntax.c (scan_lists): Simplify backward string scan. + Fix off-by-one boundary check for string and comment fences. + +2004-04-13 Joe Buehler <jbuehler@hekimian.com> + + * sheap.c, unexcw.c: New files. + +2004-04-12 Luc Teirlinck <teirllm@auburn.edu> + + * buffer.c (Fmake_indirect_buffer): Throw an error if the intended + base buffer has been killed. Correct the error message if the + base buffer does not exist. + +2004-04-12 Joe Buehler <jbuehler@hekimian.com> + + * s/cygwin.h: Changes for Cygwin unexec() support, changes in + Cygwin itself. Add support for Xaw3d scrollbars. + + * puresize.h: Set up PURE_P() for Cygwin unexec() support. + + * lastfile.c: Define my_endbss[] for Cygwin unexec() support. + + * gmalloc.c (__default_morecore): Use bss_sbrk(), not __sbrk(), + before Cygwin unexec. + + * Makefile.in: Link changes for Cygwin unexec() support. + +2004-04-12 Andreas Schwab <schwab@suse.de> + + * buffer.c (Fmake_indirect_buffer): Check that NAME is a string. + +2004-04-11 Luc Teirlinck <teirllm@auburn.edu> + + * buffer.c (Fgenerate_new_buffer_name): Return NAME argument if + IGNORE argument equals NAME. Doc fix. + +2004-04-11 Masatake YAMATO <jet@gyve.org> + + * buffer.c (fix_start_end_in_overlays): Make overlays + empty if they are backwards. + +2004-04-09 Stefan Monnier <monnier@iro.umontreal.ca> + + * xfaces.c (face_color_supported_p): Fix compilation without X11. + +2004-04-07 Stefan Monnier <monnier@iro.umontreal.ca> + + * doc.c (Fsnarf_documentation): Ignore new file name entries. + +2004-04-06 Kim F. Storm <storm@cua.dk> + + * msdos.c (clear_mouse_face): Only clear mouse highlight if not hidden. + (dos_rawgetc): Set mouse_face_hidden after clearing highlight. + + * w32term.c (w32_read_socket): Set mouse_face_hidden after + clearing highlight. + + * xdisp.c (clear_mouse_face): Only clear mouse highlight if not hidden. + + * xterm.c (handle_one_xevent): Set mouse_face_hidden after + clearing highlight. + + * indent.c (vmotion): Do not reserve one column for continuation + marks on window frames. + +2004-04-04 Eli Zaretskii <eliz@gnu.org> + + * charset.h (SINGLE_BYTE_CHAR_P): Fix macro to avoid warnings + from GCC. + +2004-04-03 Stefan Monnier <monnier@iro.umontreal.ca> + + * .gdbinit-union: Remove. + + * .gdbinit: Make it work for USE_LSB_TAG and !NO_LISP_UNION. + (xgetptr, xgetint, xgettype): New funs. Use them everywhere. + ($nonvalbits): Remove. + ($valmask): Set it by calling xreload to avoid redundancy. + + * emacs.c (gdb_use_union, gdb_use_lsb): New vars. + (gdb_emacs_intbits): Remove. + +2004-03-31 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * data.c (Fbyteorder): Make test work even if unsigned is not 4 bytes. + +2004-03-30 Kenichi Handa <handa@m17n.org> + + * editfns.c (Fformat): Fix initialization of the array info. + +2004-03-30 Kim F. Storm <storm@cua.dk> + + * xterm.c (x_mouse_click_focus_ignore_position): New var. + (syms_of_xterm): DEFVAR_BOOL it. + (ignore_next_mouse_click_timeout): New var. + (handle_one_xevent): Clear it on KeyPress, set it on EnterNotify. + Use it to filter mouse clicks following focus event. + +2004-03-29 David Ponce <david@dponce.com> + + * callint.c (Fcall_interactively): Fix last change. + +2004-03-28 Stefan Monnier <monnier@iro.umontreal.ca> + + * eval.c (Fcommandp): Simplify. + + * data.c (Finteractive_form): Rename from Fsubr_interactive_form. + Extend to handle all kinds of functions. + + * lisp.h (Finteractive_form): Declare. + + * callint.c (Fcall_interactively): Use it. + +2004-03-26 Kim F. Storm <storm@cua.dk> + + * xdisp.c (syms_of_xdisp): Include `void-variable' in list_of_error + to catch errors in calc_pixel_width_or_height during redisplay. + +2004-03-26 Masatake YAMATO <jet@gyve.org> + + * buffer.c (fix_start_end_in_overlays): Rename fix_overlays_in_range. + + * lisp.h (fix_start_end_in_overlays): Likewise. + + * insdel.c (adjust_markers_for_insert): Call fix_start_end_in_overlays. + + * editfns.c (Ftranspose_regions): Likewise. + +2004-03-20 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.c (handle_one_xevent): Do not pass key press events to GTK. + +2004-03-19 Richard M. Stallman <rms@gnu.org> + + * s/sol2-6.h: Delete previous change. + +2004-03-19 Kim F. Storm <storm@cua.dk> + + * xdisp.c (move_it_in_display_line_to): Fix MOVE_TO_POS case when + to_charpos corresponds to newline in right fringe. Use local + BUFFER_POS_REACHED_P macro. + +2004-03-19 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xdisp.c (calc_pixel_width_or_height): Add ifdef HAVE_WINDOW_SYSTEM + to compile on non-window system. + +2004-03-19 Kim F. Storm <storm@cua.dk> + + * dispextern.h (calc_pixel_width_or_height): Add prototype. + + * image.c (Qcenter): Move to xdisp.c. + + * xdisp.c (Qcenter): Declare here. + (syms_of_xdisp): Intern and staticpro it. + (handle_single_display_prop): Allow space display property on all + platforms. + (display_mode_line): Set mode_line_p before displaying line. + (calc_pixel_width_or_height): Declare extern. Add separate :align-to + handling. Remove complex cases for fringes and scroll-bars. + Add left, right, and center alignment positions. Add text (area) + width/height. Return width or height for image specs. + (produce_stretch_glyph): Improve handling of :align-to. Is now + relative to left of text area by default, but other base offsets + can be specified -- also for text lines. + + * term.c (produce_glyphs): Handle IT_STRETCH. + (produce_stretch_glyph): New function to handle space width and + align-to display properties on non-window systems. + +2004-03-17 Stefan Monnier <monnier@iro.umontreal.ca> + + * fileio.c (Fread_file_name): Set completion-ignore-case for + case-insensitive systems. + +2004-03-14 Masatake YAMATO <jet@gyve.org> + + * xdisp.c (note_mode_line_or_margin_highlight): Accept HEADER_LINE + when keymap and cursor are setup. + +2004-03-14 Steven Tamm <steventamm@mac.com> + + * Makefile.in (XMENU_OBJ) [HAVE_CARBON]: Do not include xmenu.o. + +2004-03-14 Kim F. Storm <storm@cua.dk> + + * dispextern.h (x_find_image_file): Add prototype. + + * image.c (x_find_image_file): Make extern. + + * xfns.c (x_find_image_file): Remove prototype. + +2004-03-13 Eli Zaretskii <eliz@gnu.org> + + * Makefile.in (XMENU_OBJ): Include xmenu.o if HAVE_MENUS is defined. + + * emacs.c (main): Call syms_of_xmenu only if HAVE_MENUS is defined. + +2004-03-12 Richard M. Stallman <rms@gnu.org> + + * fns.c (internal_equal): New arg PROPS controls comparing + text properties. All callers changed. + (Fequal_including_properties): New function. + (syms_of_fns): defsubr it. + +2004-03-12 Kim F. Storm <storm@cua.dk> + + Fix image support on MAC. From YAMAMOTO Mitsuharu. + + * dispextern.h (XImagePtr, XImagePtr_or_DC): Add typedefs. + (image_background, image_background_transparent): Fix prototypes. + + * image.c (XImagePtr, XImagePtr_or_DC): Move typedefs to dispextern.h. + + * macfns.c (x_list_fonts, x_get_font_info, x_load_font) + (x_query_font, x_find_ccl_program, x_set_window_size) + (x_make_frame_visible, mac_initialize, XCreatePixmap) + (XCreatePixmapFromBitmapData, XFreePixmap, XSetForeground) + (mac_draw_line_to_pixmap): Move prototypes to macterm.h. + + * macterm.h (x_list_fonts, x_get_font_info, x_load_font) + (x_query_font, x_find_ccl_program, x_set_window_size) + (x_make_frame_visible, mac_initialize, XCreatePixmap) + (XCreatePixmapFromBitmapData, XFreePixmap, XSetForeground) + (mac_draw_line_to_pixmap): Add prototypes. + +2004-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c (XTread_socket): Fix mouse click on tool bar. + +2004-03-11 Kim F. Storm <storm@cua.dk> + + * dispextern.h: Move image related prototypes from xfns.c section + to image.c. Condition them by HAVE_WINDOW_SYSTEM rather than + HAVE_X_WINDOWS. + + * Makefile.in (XOBJ): Consolidate into one list. Add image.o. + Move gtkutil.o to new GTK_OBJ list. + (XMENU_OBJ) [HAVE_MENUS]: Move declaration to proper place. + (GTK_OBJ) [USE_GTK]: New declaration. + (obj): Add $(GTK_OBJ) to list. + +2004-03-11 Steven Tamm <steventamm@mac.com> + + * image.c [MAC_OSX]: Include sys/stat.h. + + * macfns.c (syms_of_macfns): Remove definitions of things now + defined in image.c. + +2004-03-11 Kim F. Storm <storm@cua.dk> + + The following changes consolidates the identical/similar image + support code previously found in xfns.c, w32fns.c, and macfns.c + into a new file image.c. + + * makefile.w32-in (OBJ1): Add image.o. + ($(BLD)/image.$(O)): Add dependencies. + + * Makefile.in (XOBJ, MAC_OBJ): Add image.o. + (image.o): Add dependencies. + + * image.c: New file with consolidated image support code. + (COLOR_TABLE_SUPPORT): New define to control whether + color table support is available (X only). + (Bitmap_Record): Common name for x_bitmap_record, + w32_bitmap_record, and mac_bitmap_record. + (XImagePtr): Common name for pointer to XImage or equivalent. + (XImagePtr_or_DC): New type to simplify code sharing; equivalent + to XImagePtr on X+MAC, and to HDC on W32. + (GET_PIXEL): Wrapper for XGetPixel or equivalent. + (NO_PIXMAP): Common name for "None" or equivalent. + (PNG_BG_COLOR_SHIFT): Bits to shift PNG background colors. + (RGB_PIXEL_COLOR): Common type for an integer "pixel color" value. + (PIX_MASK_RETAIN, PIX_MASK_DRAW): Portability macros (from macfns.c). + (FRAME_X_VISUAL, x_defined_color, DefaultDepthOfScreen): + Define with suitable equivalents on W32 and MAC for code sharing. + (XDrawLine): Define on MAC for code sharing. + (Destroy_Image, Free_Pixmap): Wrappers for code sharing. + (IF_LIB_AVAILABLE): Macro to simplify code sharing. + (Vx_bitmap_file_path, Vimage_cache_eviction_delay) + (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap) + (x_reference_bitmap, x_create_bitmap_from_data) + (x_create_bitmap_from_file, x_destroy_bitmap) + (x_destroy_all_bitmaps, x_create_bitmap_mask) + (XGetImage, XPutPixel, XGetPixel, XDestroyImage) + (QCascent, QCmargin, QCrelief, QCconversion, QCcolor_symbols) + (QCheuristic_mask, QCindex, QCmatrix, QCcolor_adjustment, QCmask) + (Qlaplace, Qemboss, Qedge_detection, Qheuristic, Qcenter) + (define_image_type, lookup_image_type, valid_image_p) + (image_error, enum image_value_type, struct image_keyword) + (parse_image_spec, image_spec_value, Fimage_size, Fimage_mask_p) + (make_image, free_image, prepare_image_for_display, image_ascent) + (four_corners_best, image_background, image_background_transparent) + (x_clear_image_1, x_clear_image, x_alloc_image_color) + (make_image_cache, free_image_cache, clear_image_cache) + (Fclear_image_cache, postprocess_image, lookup_image, cache_image) + (forall_images_in_image_cache, x_create_x_image_and_pixmap) + (x_destroy_x_image, x_put_x_image, x_find_image_file, slurp_file) + (find_image_fsspec, image_load_qt_1, image_load_quicktime) + (init_image_func_pointer, image_load_quartz2d) + (struct ct_color, init_color_table, free_color_table) + (lookup_rgb_color, lookup_pixel_color, colors_in_color_table) + (cross_disabled_images, x_to_xcolors, x_from_xcolors) + (x_detect_edges, x_emboss, x_laplace, x_edge_detection) + (x_disable_image, x_build_heuristic_mask) + (XBM support, XPM support, PBM support, PNG support, JPEG support) + (TIFF support, GIF support, Ghostscript support): Consolidate image + code from xfns.c, w32fns.c, and macfns.c. + (syms_of_image): Consolidate image related symbol setup here. + (init_image): Consolidate image related initializations here. + + * emacs.c (main) [HAVE_WINDOW_SYSTEM]: Add calls to syms_of_image + and init_image. Remove call to init_xfns. + + * macterm.h (struct mac_bitmap_record): Add file member. + Not currently used, but simplifies code sharing. + + * macfns.c (Vx_bitmap_file_path, Vimage_cache_eviction_delay) + (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap) + (x_reference_bitmap, x_create_bitmap_from_data) + (x_create_bitmap_from_file, x_destroy_bitmap) + (x_destroy_all_bitmaps, x_create_bitmap_mask) + (XGetImage, XPutPixel, XGetPixel, XDestroyImage) + (QCascent, QCmargin, QCrelief, QCconversion, QCcolor_symbols) + (QCheuristic_mask, QCindex, QCmatrix, QCcolor_adjustment, QCmask) + (Qlaplace, Qemboss, Qedge_detection, Qheuristic, Qcenter) + (define_image_type, lookup_image_type, valid_image_p) + (image_error, enum image_value_type, struct image_keyword) + (parse_image_spec, image_spec_value, Fimage_size, Fimage_mask_p) + (make_image, free_image, prepare_image_for_display, image_ascent) + (four_corners_best, image_background, image_background_transparent) + (x_clear_image_1, x_clear_image, x_alloc_image_color) + (make_image_cache, free_image_cache, clear_image_cache) + (Fclear_image_cache, postprocess_image, lookup_image, cache_image) + (forall_images_in_image_cache, x_create_x_image_and_pixmap) + (x_destroy_x_image, x_put_x_image, x_find_image_file, slurp_file) + (find_image_fsspec, image_load_qt_1, image_load_quicktime) + (init_image_func_pointer, image_load_quartz2d) + (struct ct_color, init_color_table, free_color_table) + (lookup_rgb_color, lookup_pixel_color, colors_in_color_table) + (cross_disabled_images, x_to_xcolors, x_from_xcolors) + (x_detect_edges, x_emboss, x_laplace, x_edge_detection) + (x_disable_image, x_build_heuristic_mask) + (XBM support, XPM support, PBM support, PNG support, JPEG support) + (TIFF support, GIF support, Ghostscript support): Merge with image + code from xfns.c and macfns.c into image.c. + (syms_of_xfns): Move image related symbols to image.c. + (init_external_image_libraries, init_xfns): Remove; initialization + moved to init_image in image.c. + + * w32fns.c (Vx_bitmap_file_path, Vimage_cache_eviction_delay) + (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap) + (x_reference_bitmap, x_create_bitmap_from_data) + (x_create_bitmap_from_file, x_destroy_bitmap) + (x_destroy_all_bitmaps, x_create_bitmap_mask) + (QCascent, QCmargin, QCrelief, QCconversion, QCcolor_symbols) + (QCheuristic_mask, QCindex, QCmatrix, QCcolor_adjustment, QCmask) + (Qlaplace, Qemboss, Qedge_detection, Qheuristic, Qcenter) + (define_image_type, lookup_image_type, valid_image_p) + (image_error, enum image_value_type, struct image_keyword) + (parse_image_spec, image_spec_value, Fimage_size, Fimage_mask_p) + (make_image, free_image, prepare_image_for_display, image_ascent) + (four_corners_best, image_background, image_background_transparent) + (x_clear_image_1, x_clear_image, x_alloc_image_color) + (make_image_cache, free_image_cache, clear_image_cache) + (Fclear_image_cache, postprocess_image, lookup_image, cache_image) + (forall_images_in_image_cache, x_create_x_image_and_pixmap) + (x_destroy_x_image, x_put_x_image, x_find_image_file, slurp_file) + (struct ct_color, init_color_table, free_color_table) + (lookup_rgb_color, lookup_pixel_color, colors_in_color_table) + (cross_disabled_images, x_to_xcolors, x_from_xcolors) + (x_detect_edges, x_emboss, x_laplace, x_edge_detection) + (x_disable_image, x_build_heuristic_mask) + (XBM support, XPM support, PBM support, PNG support, JPEG support) + (TIFF support, GIF support, Ghostscript support): Merge with image + code from xfns.c and macfns.c into image.c. + (syms_of_xfns): Move image related symbols to image.c. + (init_external_image_libraries, init_xfns): Remove; initialization + moved to init_image in image.c. + + * xfns.c (Vx_bitmap_file_path, Vimage_cache_eviction_delay) + (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap) + (x_reference_bitmap, x_create_bitmap_from_data) + (x_create_bitmap_from_file, x_destroy_bitmap) + (x_destroy_all_bitmaps, x_create_bitmap_mask) + (QCascent, QCmargin, QCrelief, QCconversion, QCcolor_symbols) + (QCheuristic_mask, QCindex, QCmatrix, QCcolor_adjustment, QCmask) + (Qlaplace, Qemboss, Qedge_detection, Qheuristic, Qcenter) + (define_image_type, lookup_image_type, valid_image_p) + (image_error, enum image_value_type, struct image_keyword) + (parse_image_spec, image_spec_value, Fimage_size, Fimage_mask_p) + (make_image, free_image, prepare_image_for_display, image_ascent) + (four_corners_best, image_background, image_background_transparent) + (x_clear_image_1, x_clear_image, x_alloc_image_color) + (make_image_cache, free_image_cache, clear_image_cache) + (Fclear_image_cache, postprocess_image, lookup_image, cache_image) + (forall_images_in_image_cache, x_create_x_image_and_pixmap) + (x_destroy_x_image, x_put_x_image, x_find_image_file, slurp_file) + (struct ct_color, init_color_table, free_color_table) + (lookup_rgb_color, lookup_pixel_color, colors_in_color_table) + (cross_disabled_images, x_to_xcolors, x_from_xcolors) + (x_detect_edges, x_emboss, x_laplace, x_edge_detection) + (x_disable_image, x_build_heuristic_mask) + (XBM support, XPM support, PBM support, PNG support, JPEG support) + (TIFF support, GIF support, Ghostscript support): Merge with + w32fns.c and macfns.c image code into image.c. + (syms_of_xfns): Move image related symbols to image.c. + (init_xfns): Remove; initialization moved to init_image in image.c. + + * lisp.h (syms_of_image, init_image): Add protoypes. + (init_xfns): Remove prototype. + + * dispextern.h (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap) + (x_reference_bitmap, x_create_bitmap_from_data) + (x_create_bitmap_from_file, x_destroy_bitmap) + (x_create_bitmap_mask): Move prototypes from dispextern.h. + (gamma_correct) [MAC_OS]: Add prototype. + + * xterm.h (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap) + (x_reference_bitmap, x_create_bitmap_from_data) + (x_create_bitmap_from_file, x_destroy_bitmap) + (x_create_bitmap_mask): Move prototypes to dispextern.h. + +2004-03-09 Kenichi Handa <handa@etlken2> + + * coding.c (decode_coding_emacs_mule): Handle insufficent source + correctly. + +2004-03-04 Richard M. Stallman <rms@gnu.org> + + * s/sol2-6.h (LD_SWITCH_SYSTEM_TEMACS): New definition. + + * window.c (Fdisplay_buffer): Doc fix. + + * buffer.c (Fpop_to_buffer): Doc fix. + +2004-03-03 Kim F. Storm <storm@cua.dk> + + * xdisp.c (display_line): Fix call to get_overlay_arrow_glyph_row. + +2004-03-02 Stefan Monnier <monnier@iro.umontreal.ca> + + * editfns.c (Ftranslate_region): Lisp_Object/int mixup. + +2004-03-02 Richard M. Stallman <rms@gnu.org> + + * indent.c (compute_motion): Save vpos in prev_vpos, like hpos etc. + +2004-03-02 Kenichi Handa <handa@m17n.org> + + * doc.c (Fsubstitute_command_keys): Fix counding bytes. + +2004-03-02 Kim F. Storm <storm@cua.dk> + + * window.h (struct window): New member overlay_arrow_bitmap. + + * window.c (make_window): Initialize overlay_arrow_bitmap. + + * xdisp.c (Voverlay_arrow_variable_list): New variable to properly + implement and integrate multiple overlay arrows with redisplay. + (syms_of_xdisp): DEFVAR_LISP and initialize it. + (last_arrow_position, last_arrow_string): Replace by properties. + (Qlast_arrow_position, Qlast_arrow_string) + (Qoverlay_arrow_string, Qoverlay_arrow_bitmap): New variables. + (syms_of_xdisp): Intern and staticpro them. + (overlay_arrow_string_or_property, update_overlay_arrows) + (overlay_arrow_in_current_buffer_p, overlay_arrows_changed_p) + (overlay_arrow_at_row): New functions for multiple overlay arrows. + (redisplay_internal): Use them instead of directly accessing + Voverlay_arrow_position etc. for multiple overlay arrows. + (mark_window_display_accurate): Use update_overlay_arrows. + (try_cursor_movement): Use overlay_arrow_in_current_buffer_p. + (try_window_id): Use overlay_arrows_changed_p. + (get_overlay_arrow_glyph_row): Add overlay_arrow_string arg. + (display_line): Use overlay_arrow_at_row to check multiple + overlay arrows, and get relevant overlay-arrow-string and + overlay-arrow-bitmap. Set w->overlay_arrow_bitmap accordingly. + (produce_image_glyph): Set pixel_width = 0 for fringe bitmap. + (syms_of_xdisp): Remove last_arrow_position and last_arrow_string. + + * fringe.c (draw_fringe_bitmap): Use w->overlay_arrow_bitmap if set. + (update_window_fringes): Remove unused code. + +2004-03-01 Jason Rumney <jasonr@gnu.org> + + * w32term.c (w32_read_socket): Fix last change to ButtonPress handling. + +2004-03-01 Juanma Barranquero <lektu@terra.es> + + * fringe.c (Fdefine_fringe_bitmap): Fix typo in docstring. + + * makefile.w32-in ($(BLD)/fringe.$(O)): Add dependencies. + +2004-03-01 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xfns.c (Fx_display_color_cells): Use number of planes to calculate + how many colors can be displayed. + +2004-03-01 Kenichi Handa <handa@m17n.org> + + * editfns.c (Ftranslate_region): Handle multibyte chars in TABLE + correctly. + +2004-02-28 Kim F. Storm <storm@cua.dk> + + * dispnew.c (update_window): Update header line also if there are + no other changes in window (move code after set_cursor label). + + * lisp.h (mark_window_display_accurate): Remove prototype. + + * window.c (window_loop, Fforce_window_update): Force mode line + updates by setting prevent_redisplay_optimizations_p and + update_mode_lines. + +2004-02-28 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xfns.c (x_window): Fix indentation. + + * xterm.c (x_calc_absolute_position): Call x_real_positions + to get WM window sizes and use those to calculate position. + (x_set_offset): Remove code commented out. + +2004-02-28 Miles Bader <miles@gnu.org> + + * keyboard.c (adjust_point_for_property): #ifdef-out dodgy xassert. + +2004-02-28 Kim F. Storm <storm@cua.dk> + + * keyboard.c (kbd_buffer_store_event_hold): New function to store + an event into kbd fifo, but with special handling of quit event; + a quit event is saved for later, and further events are discarded + until the saved quit event has been processed. + (kbd_buffer_store_event): Use kbd_buffer_store_event_hold. + (gen_help_event): Store help event in kbd fifo. + (NREAD_INPUT_EVENTS): Remove. + (read_avail_input): Adapt to new read_socket_hook interface. + Remove allocation and initialization of local input_event buffer, + as read_socket_hook stores events directly in fifo. Allocate and + initialize local hold_quit event to handle postponed quit event + (and store it if set by kbd_buffer_store_event_hold). + + * keyboard.h (kbd_buffer_store_event_hold): Add prototype. + (gen_help_event): Fix prototype. + + * macterm.c (XTread_socket): Remove bufp_r and + numcharsp args. Add hold_quit arg. + Rework to use just one, local, inev input_event. Store inev + directly in fifo using kbd_buffer_store_event_hold. + + * sysdep.c (BUFFER_SIZE_FACTOR): Remove. + (read_input_waiting): Adapt to new read_socket_hook interface. + Remove allocation and initialization of local input_event buffer, + as read_socket_hook stores events directly in fifo. Allocate and + initialize local hold_quit event to handle postponed quit event + (and store it if set by kbd_buffer_store_event_hold). + + * term.c (read_socket_hook): Fix arg list. + + * termhooks.h (read_socket_hook): Fix prototype. + + * w32inevt.c (w32_console_read_socket): Remove bufp_r and + numcharsp args. Add hold_quit arg. + Rework to use just one, local, inev input_event. Store inev + directly in fifo using kbd_buffer_store_event_hold. + + * w32inevt.h (w32_console_mouse_position): Fix prototype. + + * w32term.c (w32_read_socket): Remove bufp_r and numcharsp args. + Add hold_quit arg. Rework to use just one, local, inev + input_event. Store inev directly in fifo using + kbd_buffer_store_event_hold. Update count in one place. + Postpone call to gen_help_event until inev is stored; use new + local do_help for this. + Remove local emacs_event in handing of ButtonPress event; just use + inev instead (so no reason to copy it later). + + * xsmfns.c (x_session_check_input): Remove numchars arg. + + * xterm.c (x_focus_changed, x_detect_focus_change): + Remove numchars arg. Always store event into bufp arg. + Return nothing. Callers changed accordingly. + (glyph_rect): Simplify. + (STORE_KEYSYM_FOR_DEBUG): New macro. + (SET_SAVED_MENU_EVENT): Use inev instead of bufp, etc. + (current_bufp, current_numcharsp) [USE_GTK]: Remove. + (current_hold_quit) [USE_GTK]: Add. + (event_handler_gdk): Adapt to new handle_one_xevent. + (handle_one_xevent): Remove bufp_r and numcharsp args. + Add hold_quit arg. Rework to use just one, local, inev + input_event. Store inev directly in fifo using + kbd_buffer_store_event_hold. Update count in one place. + Postpone call to gen_help_event until inev is stored; use new + local do_help for this. + Simplify handling of keysyms (consolidate common code). Fix bug + where count was updated with nchars instead of nbytes. + Remove local emacs_event in handing of ButtonPress event; just use + inev instead (so no reason to copy it later). + Remove `out' label. Rename label `ret' to `done'; add various + `goto done' to clarify code flow in deeply nested blocks. + (x_dispatch_event): Simplify as handle_one_xevent now calls + kbd_buffer_store_event itself. + (XTread_socket): Remove bufp_r and numcharsp args. Add hold_quit + arg. Call handle_one_xevent with new arglist. Store event from + x_session_check_input in fifo. + [USE_GTK]: Setup current_hold_quit. + Decrement handling_signal before unblocking input. + (x_initialize) [USE_GTK]: Initialize current_count. + + * xterm.h (x_session_check_input): Fix prototype. + +2004-02-26 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * s/darwin.h (LD_SWITCH_SYSTEM_TEMACS): Add `-framework QuickTime'. + + * dispextern.h [MAC_OSX]: Do not include Carbon/Carbon.h (now in + macgui.h). + + * emacs.c (main) [HAVE_CARBON]: Call init_xfns. + + * macgui.h [MAC_OSX]: Include Carbon/Carbon.h. + (mktime, DEBUG, Z, free, malloc, realloc, max, min) + (init_process) [MAC_OSX]: Avoid conflicts with Carbon/Carbon.h. + [!MAC_OSX]: Include QDOffscreen.h and Controls.h. + (INFINITY) [MAC_OSX]: Avoid conflict with definition in math.h. + (Bitmap): Remove typedef. + (Pixmap): Change int to GWorldPtr. + + * macmenu.c [MAC_OSX]: Don't include Carbon/Carbon.h (now in macgui.h). + + * macterm.h [MAC_OSX]: Don't include Carbon/Carbon.h (now in macgui.h). + (RED16_FROM_ULONG, GREEN16_FROM_ULONG, BLUE16_FROM_ULONG): + New #define to extract 16-bit depth color components from unsigned + long representation. + (PIX_MASK_DRAW, PIX_MASK_RETAIN): New #define to represent pixel + colors used for masks. + (struct mac_display_info): Add color_p. Remove n_cbits. + + * macfns.c: Include sys/types.h and sys/stat.h. + [MAC_OSX]: Do not include Carbon/Carbon.h (now in macgui.h). + Include QuickTime/QuickTime.h. + (XCreatePixmap, XCreatePixmapFromBitmapData, XFreePixmap) + (XSetForeground, mac_draw_line_to_pixmap): Add externs for + functions defined in macterm.c. + (XImagePtr): New typedef. Corresponds to XImage * in xfns.c. + (ZPixmap): New #define for compatibility with xfns.c. + (XGetImage, XPutPixel, XGetPixel, XDestroyImage) + (x_create_x_image_and_pixmap, x_destroy_x_image, x_put_x_image) + (find_image_fsspec, image_load_qt_1, image_load_quicktime): + New functions. + (four_corners_best, x_create_x_image_and_pixmap) + (x_destroy_x_image, unwind_create_frame, x_disable_image) + (x_edge_detection, init_color_table, colors_in_color_table) + (lookup_rgb_color, lookup_pixel_color, postprocess_image) + (x_put_x_image, slurp_file, xbm_scan, xbm_load, xbm_load_image) + (xbm_image_p, xbm_read_bitmap_data, xbm_file_p, x_to_xcolors) + (x_from_xcolors, x_detect_edges): New declarations (from xfns.c). + (mac_color_map_lookup, x_to_mac_color): Fix Lisp_Object/unsigned + long mixup. + (mac_defined_color, x_to_x_colors): Use RED16_FROM_ULONG etc. + (x_decode_color): Don't use n_cbits (in struct mac_display_info). + (x_set_foreground_color, x_set_cursor_color): Sync with w32fns.c. + (x_set_cursor_type, Fxw_color_values, valid_image_p) + (image_value_type, parse_image_spec, image_ascent, x_clear_image) + (x_alloc_image_color, clear_image_cache, lookup_image) + (x_find_image_file, xbm_read_bitmap_file_data) + (enum xbm_keyword_index, xbm_format, xbm_image_p, xbm_scan) + (xbm_read_bitmap_data, xbm_load, pbm_image_p, pbm_scan_number) + (enum pbm_keyword_index, pbm_format, enum png_keyword_index) + (png_format, png_image_p, enum jpeg_keyword_index, jpeg_format) + (jpeg_image_p, enum tiff_keyword_index, tiff_format, tiff_image_p) + (enum gif_keyword_index, gif_format, gif_image_p): Sync with xfns.c. + (x_make_gc): Sync with xfns.c. Enclose unused `border_tile' with + #if 0. + (x_free_gcs): Sync with xfns.c. Enclose unused `border_tile' with + #if 0. Free white_relief.gc and black_relief.gc. + (unwind_create_frame, x_emboss, x_laplace, x_edge_detection): + New functions (from xfns.c). + (Fx_create_frame): Record unwind_create_frame. + (Fxw_display_color_p): Use dpyinfo->color_p. + (Fx_display_grayscale_p, Fx_display_planes): Don't use + dpyinfo->n_cbits. + (Fx_display_color_cells): Use dpyinfo->n_planes; + (QCmatrix, QCcolor_adjustment, QCmask, Qemboss, Qedge_detection) + (Qheuristic, cross_disabled_images, emboss_matrix) + (laplace_matrix): New variables (from xfns.c). + (Fimage_size, Fimage_mask_p, four_corners_best, image_background) + (x_clear_image_1, postprocess_image, slurp_file, xbm_load_image) + (xbm_file_p, x_to_xcolors, x_from_xcolors, x_detect_edges) + (image_background_transparent): New function (from xfns.c). + Use PIX_MASK_DRAW/PIX_MASK_RETAIN. + (image_load_quicktime): Add declaration. + [MAC_OSX] (image_load_quartz2d): Likewise. + [MAC_OSX] (CGImageCreateWithPNGDataProviderProcType): New typedef. + [MAC_OSX] (MyCGImageCreateWithPNGDataProvider): New variable. + [MAC_OSX] (init_image_func_pointer, image_load_quartz2d): New funs. + (xbm_load_image_from_file, x_laplace_read_row) + (x_laplace_write_row, pbm_read_file): Remove functions. + [HAVE_XPM] (enum xpm_keyword_index, xpm_format, xpm_image_p) + (xpm_load): Sync with xfns.c (although XPM is not supported yet). + (colors_in_color_table): Sync with xfns.c (although not used). + (lookup_rgb_color): Don't lookup color table. Just do gamma + correction. + (COLOR_INTENSITY): New #define (from xfns.c). + (x_disable_image): New function (from xfns.c). + Use PIX_MASK_DRAW/PIX_MASK_RETAIN. + (x_build_heuristic_mask): Sync with xfns.c. + Use PIX_MASK_DRAW/PIX_MASK_RETAIN. + (HAVE_PBM): Remove #ifdef. + (pbm_load): Sync with xfns.c. Set img->width and img->height + before IMAGE_BACKGROUND. + (png_image_p, png_load): Don't enclose declarations with #if HAVE_PNG. + (Qpng, enum png_keyword_index, png_format, png_type, png_image_p): + Don't enclose with #if HAVE_PNG. + [!HAVE_PNG] (png_load) [MAC_OSX]: Use image_load_quartz2d if a + symbol _CGImageCreateWithPNGDataProvider is defined. + Otherwise use image_load_quicktime. + [!HAVE_PNG] (png_load) [!MAC_OSX]: Use image_load_quicktime. + [HAVE_PNG] (png_load): Sync with xfns.c. + Use PIX_MASK_DRAW/PIX_MASK_RETAIN. + (jpeg_image_p, jpeg_load): Don't enclose declarations with #if + HAVE_JPEG. + (Qjpeg, enum jpeg_keyword_index, jpeg_format, jpeg_type) + (jpeg_image_p): Don't enclose with #if HAVE_JPEG. + [!HAVE_JPEG] (jpeg_load) [MAC_OSX]: Use image_load_quartz2d. + [!HAVE_JPEG] (jpeg_load) [!MAC_OSX]: Use image_load_quicktime. + [HAVE_JPEG] (jpeg_load): Sync with xfns.c. + (tiff_image_p, tiff_load): Don't enclose declarations with #if + HAVE_TIFF. + (Qtiff, enum tiff_keyword_index, tiff_format, tiff_type) + (tiff_image_p): Don't enclose with #if HAVE_TIFF. + [!HAVE_TIFF] (tiff_load): Use image_load_quicktime. + [HAVE_TIFF] (tiff_error_handler, tiff_warning_handler): + New functions (from xfns.c). + [HAVE_TIFF] (tiff_load): Sync with xfns.c. + (gif_image_p, gif_load): Don't enclose declarations with #if HAVE_GIF. + (Qgif, enum gif_keyword_index, gif_format, gif_type, gif_image_p): + Don't enclose with #if HAVE_GIF. + [!HAVE_GIF] (gif_load): Use Quicktime Movie Toolbox if it is + animated gif. Otherwise use image_load_quicktime. + [HAVE_GIF] (gif_lib.h): Temporarily define DrawText as + gif_DrawText to avoid conflict with QuickdrawText.h. + [HAVE_GIF] (gif_load): Sync with xfns.c. + (enum gs_keyword_index, gs_format, gs_image_p, gs_load) + [HAVE_GHOSTSCRIPT] (x_kill_gs_process): Sync with xfns.c (although + Ghostscript is not supported yet). + (syms_of_macfns): Initialize Qemboss, Qedge_detection, Qheuristic, + QCmatrix, QCcolor_adjustment, and QCmask. Add DEFVAR_BOOL + cross_disabled_images (from xfns.c). Remove #if 0 for supported + image types. Remove #if HAVE_JPEG, HAVE_TIFF, HAVE_GIF, and + HAVE_PNG. Add defsubr for Simage_size and Simage_mask_p. + (init_xfns): Remove #if HAVE_JPEG, HAVE_TIFF, HAVE_GIF, and + HAVE_PNG. Call EnterMovies to support animated gifs. + Call init_image_func_pointer to bind a symbol + _CGImageCreateWithPNGDataProvider if it is defined. + + * macterm.c [MAC_OSX]: Don't include Carbon/Carbon.h (now in macgui.h). + (x_draw_bar_cursor): Sync declaration with xterm.c. + (XFreePixmap, mac_draw_rectangle_to_pixmap, mac_copy_area) + (mac_copy_area_to_pixmap): Implementation with GWorld (offscreen + graphics). + (mac_set_forecolor, mac_set_backcolor): Use RED16_FROM_ULONG etc. + (mac_draw_line_to_pixmap, XCreatePixmap) + (XCreatePixmapFromBitmapData, mac_fill_rectangle_to_pixmap) + (mac_copy_area_with_mask, mac_copy_area_with_mask_to_pixmap): + New functions. + (mac_draw_bitmap) [TARGET_API_MAC_CARBON]: + Use GetPortBitMapForCopyBits instead of the cast to Bitmap *. + Cast bits to char *. + (reflect_byte): New function (from w32fns.c). + (mac_create_bitmap_from_bitmap_data): Use it and don't stuff bits + due to byte alignment. + (mac_scroll_area) [TARGET_API_MAC_CARBON]: + Use GetPortBitMapForCopyBits instead of the cast to Bitmap *. + (XSetForeground): Remove static (now used in macfns.c). + (HIGHLIGHT_COLOR_DARK_BOOST_LIMIT): New #define (from w32term.c). + (mac_alloc_lighter_color, x_destroy_window): Sync with w32term.c. + (x_setup_relief_color, x_setup_relief_colors, x_draw_box_rect) + (x_draw_glyph_string_box, x_draw_image_foreground) + (x_draw_image_foreground_1, x_draw_image_glyph_string) + (x_draw_stretch_glyph_string, x_draw_glyph_string) + (x_draw_hollow_cursor, x_draw_bar_cursor, mac_draw_window_cursor): + Sync with xterm.c. + (x_draw_relief_rect): Sync with xterm.c. Make 1 pixel shorter + than the xterm.c version when a strictly horizontal or vertical + line is drawn. + (XTset_terminal_window): Add static. + (x_make_frame_visible): Add UNBLOCK_INPUT. + (x_free_frame_resources): New funcion (from xterm.c). + (XTread_socket): Call handle_tool_bar_click if mouse up/down event + occurs in tool bar area. + (mac_initialize_display_info): Remove dpyinfo->n_cbits. + Set dpyinfo->color_p. Determine dpyinfo->n_planes using HasDepth. + Initialize image cache. + (stricmp, wildstrieq, mac_font_pattern_match, mac_font_match): + Enclose unused functions with #if 0. + (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): New variables. + (decode_mac_font_name): New function to apply code conversions + from a mac font name to an XLFD font name according to its script code. + (x_font_name_to_mac_font_name): Apply code conversion from an XLFD + font name to a mac font name according to REGISTRY and ENCODING fields. + (init_font_name_table) [TARGET_API_MAC_CARBON]: Don't use a font + whose name starts with `.'. + (init_font_name_table): Use decode_mac_font_name. Add both + jisx0208.1983-sjis and jisx0201.1976-0 entries if the script code + of a font is smJapanese. + (mac_do_list_fonts): New function to list fonts that match a given + pattern. + (x_list_fonts, XLoadQueryFont): Use it. + (XLoadQueryFont): Set rbearing field for each variable width + character to avoid needless redraw. + (syms_of_macterm): Initialize Qbig5, Qcn_gb, Qsjis, and Qeuc_kr. + +2004-02-26 Kim F. Storm <storm@cua.dk> + + * keyboard.c (NREAD_INPUT_EVENTS): Temporarily increase to 512 + as read_socket_hook handler on X aborts if buffer is too small + and W32 handler doesn't always check buffer limit. + + * xdisp.c (handle_single_display_prop): Handle left-fringe and + right-fringe similar to a display margin image. Specifically, + the characters having the fringe prop are no longer shown, and + we use IT_IMAGE/next_element_from_image with image_id = -1 to + do this. Set fringe bitmap face_id in it->face_id. + (produce_image_glyph): Handle image_id < 0 as "no image" case, but + still realize it->face (i.e. the fringe bitmap face). + +2004-02-25 Miles Bader <miles@gnu.org> + + * xdisp.c (check_it): Check string/string_pos consistency. + (init_iterator): Initialize string-related fields properly. + +2004-02-11 Miles Bader <miles@gnu.org> + + * xdisp.c (produce_image_glyph): Force negative descents to zero. + +2004-02-10 Miles Bader <miles@gnu.org> + + * xfns.c (lookup_image): Remove xassert(!interrupt_input_blocked); + BLOCK_INPUT can be nested, so it doesn't make much sense. + +2004-02-24 Michael Mauger <mmaug@yahoo.com> + + * w32fns.c (slurp_file, xbm_scan, xbm_load_image) + (xbm_read_bitmap_data): Use unsigned char for image data. + +2004-02-23 Luc Teirlinck <teirllm@auburn.edu> + + * abbrev.c (Finsert_abbrev_table_description): Doc fix. + +2004-02-22 Jason Rumney <jasonr@gnu.org> + + * w32term.c (w32_draw_fringe_bitmap): Draw overlaid bitmaps + correctly over other bitmaps. + +2004-02-21 Eli Zaretskii <eliz@gnu.org> + + * emacs.c (USAGE1): Split into two halves. + (USAGE2): Second half of the old USAGE1. + (USAGE3): Rename from USAGE2. + (USAGE4): Rename from USAGE3. + +2004-02-21 Juri Linkov <juri@jurta.org> + + * emacs.c (USAGE1): Add --no-desktop. Move --display from USAGE2. + Fix --multibyte. Move --help, --version to USAGE2. Add alias + --file. Fix -f, -l. Sort options. Untabify. + (USAGE2): Add -hb. Fix --name, --title. Sort options. Untabify. + +2004-02-19 Luc Teirlinck <teirllm@auburn.edu> + + * category.c (Fdefine_category, Fcategory_docstring) + (Fget_unused_category, Fset_category_table) + (Fcategory_set_mnemonics): Doc fixes. + +2004-02-20 Kim F. Storm <storm@cua.dk> + + * keyboard.c: Undo 2004-02-16 and 2004-02-17 changes. + The following changes are relative to the 2004-01-21 revision. + (NREAD_INPUT_EVENTS): Define as max number of input events to read + in one call to read_socket_hook. Value is 8. + (read_avail_input): Separate and rework handling of read_socket_hook + and non-read_socket_hook cases. Use smaller input_event buffer + in read_socket_hook case, and repeat if full buffer is read. + Use new local variable 'discard' to skip input after C-g. + In non-read_socket_hook case, just use a single input_event, and + call kbd_buffer_store_event on the fly for each character. + +2004-02-19 Stefan Monnier <monnier@iro.umontreal.ca> + + * lisp.h (union Lisp_Object): Give a more precise type for `type'. + Remove unused `gu' alternative. + +2004-02-19 Andreas Schwab <schwab@suse.de> + + * fringe.c (Fdefine_fringe_bitmap): Use && instead of & to avoid + warning. + +2004-02-18 Kim F. Storm <storm@cua.dk> + + * xdisp.c (get_window_cursor_type, display_and_set_cursor): + Fix last change. + +2004-02-17 Kim F. Storm <storm@cua.dk> + + * xdisp.c (fast_find_position): Fix return value of new version; + it was inverted compared to the 21.1 version. + (get_window_cursor_type): Don't look at glyph if NULL. + (display_and_set_cursor): Set glyph to NULL if cursor in fringe. + + * keyboard.c: Rework previous change; it didn't consider that the + buf array was allocated on the stack. + (prev_read): Remove variable. + (read_avail_input_buf): New static event buffer array. + (in_read_avail_input): New static variable to handle re-entrancy. + (read_avail_input): Change buf to pinter to read_avail_input_buf. + Use in_read_avail_input to handle re-entrance; when re-entered, + fully initialize and use tmp_buf array instead of read_avail_input_buf. + Do not initialize read_avail_input_buf in full here; instead assume it + is always cleared on entry. To ensure that, we clear (just) the + entries that were used before we return. + (init_keyboard): Initialize read_avail_input_buf here. + +2004-02-16 Jesper Harder <harder@ifa.au.dk> + + * cmds.c (Fend_of_line): Doc fix. + +2004-02-16 Dmitry Antipov <dmantipov@yandex.ru> (tiny change) + + * keyboard.c (prev_read): New static variable. + (read_avail_input): Use it to zero out only those slots in buf[] + that were used last time we were called. + +2004-02-16 Eli Zaretskii <eliz@gnu.org> + + * Makefile.in (obj): Move fringe.o from here... + (XOBJ, MAC_OBJ): ...to here. + +2004-02-16 Stephen Eglen <stephen@gnu.org> + + * fringe.c (init_fringe_bitmap): Define j in MAC_OS code. + +2004-02-15 Stefan Monnier <monnier@iro.umontreal.ca> + + * data.c (Fbyteorder): + * fringe.c (Fdefine_fringe_bitmap): + * xdisp.c (handle_single_display_prop): + * xselect.c (x_handle_dnd_message): Lisp_Object/int mixup. + +2004-02-16 Jason Rumney <jasonr@gnu.org> + + * w32term.c (w32_draw_fringe_bitmap): Handle overlay fringe bitmaps. + +2004-02-15 Steven Tamm <steventamm@mac.com> + + * macterm.c (Vmac_emulate_three_button_mouse): New variable for + controlling emulation of a three button mouse with option and + command keys. + (Qreverse, mac_get_enumlated_btn): Handle the emulation. + (mac_event_to_emacs_modifiers, XTread_socket): Ditto. + +2004-02-15 Kim F. Storm <storm@cua.dk> + + * buffer.c (syms_of_buffer): Doc fix for indicate-buffer-boundaries. + + * fringe.c (init_fringe_bitmap) [MAC_OS, WORDS_BIG_ENDIAN]: + Perform byte-swapping. + +2004-02-14 Kim F. Storm <storm@cua.dk> + + * dispextern.h (struct draw_fringe_bitmap_params): Change member + bits from char to short to facilitate wider bitmaps. + (struct redisplay_interface): Fix prototype of define_fringe_bitmap + member. + + * fringe.c (struct fringe_bitmap): Change member bits from char to + short to facilitate 16 bits wide bitmaps. Modify all standard + bitmaps accordingly. + (BYTES_PER_BITMAP_ROW, STANDARD_BITMAP_HEIGHT): New macros. + (FRBITS): Use STANDARD_BITMAP_HEIGHT instead of just sizeof. + (draw_fringe_bitmap): Ditto. + (init_fringe_bitmap) [MAC_OS]: Don't bitswap. + (init_fringe_bitmap) [HAVE_X_WINDOWS]: Enhance bitswapping to + handle up to 16 bits wide bitmaps. + (Fdefine_fringe_bitmap): Doc fix. Handle wider bitmaps. + (Ffringe_bitmaps_at_pos): Add missing arg declarations. + + * macterm.c (mac_draw_bitmap): Handle 16 bits wide bitmaps directly. + (x_draw_fringe_bitmap): Use enhanced mac_draw_bitmap, so we no longer + need to call mac_create_bitmap_from_bitmap_data and mac_free_bitmap. + + * w32term.c (w32_define_fringe_bitmap): Bitmaps are now 16 bits wide, + so it is no longer necessary to expand them here. + + * xterm.c (x_draw_fringe_bitmap): Handle wider bitmaps (max 16 bits). + +2004-02-12 Kim F. Storm <storm@cua.dk> + + * window.c (Fwindow_fringes): Doc fix. + +2004-02-10 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xselect.c (x_get_foreign_selection): Add new optional parameter + time_stamp. + (Fx_get_selection_internal): Ditto, pass time_stamp to + x_get_foreign_selection. + + * data.c (Fbyteorder): New function. + +2004-02-09 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * atimer.c: Move include stdio.h to same place as in other files. + + * region-cache.c: Ditto. + + * sysdep.c: Ditto. + + * xfaces.c: Ditto. + +2004-02-09 Sam Steingold <sds@gnu.org> + + * w32term.c (w32_draw_fringe_bitmap): Fix a typo in the last patch. + +2004-02-09 Kim F. Storm <storm@cua.dk> + + * fringe.c: New file. Move original fringe related declarations + and code from dispextern.h and xdisp.c here. + Rework code to support user defined fringe bitmaps, redefining + standard bitmaps, ability to overlay user defined bitmap with + overlay arrow bitmap, and add faces to bitmaps. + (Voverflow_newline_into_fringe): Declare here. + (enum fringe_bitmap_align): New enum. + (..._bits): All bitmaps are now defined without bitswapping; that + is now done in init_fringe_once (if necessary). + (standard_bitmaps): New array with specifications for the + standard fringe bitmaps. + (fringe_faces): New array. + (valid_fringe_bitmap_id_p): New function. + (draw_fringe_bitmap_1): Rename from draw_fringe_bitmap. + (draw_fringe_bitmap): New function which draws fringe bitmap, + possibly overlaying bitmap with cursor in right fringe or the + overlay arrow in the left fringe. + (update_window_fringes): Do not handle overlay arrow here. + Compare and copy fringe bitmap faces. + (init_fringe_bitmap): New function. + (Fdefine_fringe_bitmap, Fdestroy_fringe_bitmap): New DEFUNs to + define and destroy user defined fringe bitmaps. + (Fset_fringe_bitmap_face): New DEFUN to set face for a fringe bitmap. + (Ffringe_bitmaps_at_pos): New DEFUN to read current fringe bitmaps. + (syms_of_fringe): New function. Defsubr new DEFUNs. + DEFVAR_LISP Voverflow_newline_into_fringe. + (init_fringe_once, init_fringe): New functions. + (w32_init_fringe, w32_reset_fringes) [WINDOWS_NT]: New functions. + + * Makefile.in (obj): Add fringe.o. + (fringe.o): New dependencies. + + * dispextern.h (FRINGE_ID_BITS): New definition for number of + bits allocated to hold a fringe number. Increase number of bits + from 4 to 8 to allow user defined fringe bitmaps. + (struct glyph_row, struct it): New members left_user_fringe_bitmap, + left_user_fringe_face_id, right_user_fringe_bitmap, + right_user_fringe_face_id. + (enum fringe_bitmap_type, struct fringe_bitmap, fringe_bitmaps): + Move to new file fringe.c. + (MAX_FRINGE_BITMAPS): Define here. + (struct draw_fringe_bitmap_params): New members bits, cursor_p, + and overlay_p. Change member which to int. + (struct redisplay_interface): New members define_fringe_bitmap + and destroy_fringe_bitmap. + (valid_fringe_bitmap_id_p): Add prototype. + (w32_init_fringe, w32_reset_fringes) [WINDOWS_NT]: Add prototypes. + + * dispnew.c (row_equal_p): Compare fringe bitmap faces and overlay + arrows. + (update_frame): Do flush_display if force_flush_display_p to + ensure display (specifically fringes) are updated in a timely + manner when resizing the frame by dragging the mouse. + (update_window_line): Update row if overlay arrow changed. + (scrolling_window): Redraw fringe bitmaps if fringe bitmap faces + or overlay arrow changed. + + * emacs.c (main) [HAVE_WINDOW_SYSTEM]: Call init_fringe_once, + syms_of_fringe, and init_fringe. + + * frame.h (struct frame): New member force_flush_display_p. + + * lisp.h (syms_of_fringe, init_fringe, init_fringe_once): + Add prototypes. + + * macterm.c (mac_draw_bitmap): Add overlay_p arg. + (x_draw_fringe_bitmap): Handle overlayed fringe bitmaps; + thanks to YAMAMOTO Mitsuharu for advice on how to do this. + Use cursor color for displaying cursor in fringe. + (x_redisplay_interface): Add null handlers for + define_fringe_bitmap and destroy_fringe_bitmap functions. + + * w32term.c (w32_draw_fringe_bitmap): Copy unadapted code from + xterm.c to handle overlayed fringe bitmaps and to use cursor color + for displaying cursor in fringe. + (w32_define_fringe_bitmap, w32_destroy_fringe_bitmap): New W32 + specific functions to define and destroy fringe bitmaps in fringe_bmp. + (w32_redisplay_interface): Add them to redisplay_interface. + (w32_term_init): Call w32_init_fringe instead of explicitly + defining fringe bitmaps in fringe_bmp array. + (x_delete_display): Call w32_reset_fringes instead of explicitly + destroying fringe bitmaps in fringe_bmp array. + + * xdisp.c (Voverflow_newline_into_fringe, syms_of_xdisp) + (left_bits, right_bits, up_arrow_bits, down_arrow_bits) + (continued_bits, continuation_bits, ov_bits, first_line_bits) + (last_line_bits, filled_box_cursor_bits, hollow_box_cursor_bits) + (bar_cursor_bits, hbar_cursor_bits, zv_bits, hollow_square_bits) + (fringe_bitmaps, draw_fringe_bitmap, draw_row_fringe_bitmaps) + (draw_window_fringes, compute_fringe_widths, update_window_fringes): + Move fringe handling vars and code to new file fringe.c. + (handle_display_prop): Handle left-fringe and right-fringe + display properties; store user fringe bitmaps in iterator. + (move_it_in_display_line_to): Handle cursor in fringe at eob. + (clear_garbaged_frames): Set force_flush_display_p if resized. + (redisplay_window): Redraw fringe bitmaps if not just_this_one_p. + (display_line): Handle cursor in fringe at eob. + (display_line): Set row user fringe bitmaps from iterator. + + * xterm.c (x_draw_fringe_bitmap): Handle overlayed fringe bitmaps. + Use cursor color for displaying cursor in fringe. + (x_redisplay_interface): Add null handlers for + define_fringe_bitmap and destroy_fringe_bitmap functions. + +2004-02-07 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * macfns.c (Fx_change_window_property): Make doc string and + parameters same as for X version. + + * w32fns.c (Fx_change_window_property): Ditto. + +2004-02-07 Kim F. Storm <storm@cua.dk> + + * xdisp.c (hscroll_window_tree): Position cursor near to right + margin in hscrolled window when jumping to end of line (rather + than centering cursor). + + * process.c (wait_reading_process_input): Don't do adaptive read + buffering if waiting for a specific process. + +2004-02-05 Luc Teirlinck <teirllm@auburn.edu> + + * minibuf.c (Fminibufferp, Fread_from_minibuffer) + (Fread_minibuffer, Feval_minibuffer) + (Fread_string, Fread_no_blanks_input) + (Fcompleting_read): Doc fixes. + (syms_of_minibuf): Doc fixes for minibuffer-completion-table and + completion-regexp-list. Define Qcase_fold_search and staticpro it. + (read_minibuf): Fix initial comment. + (Ftry_completion, Fall_completions, Ftest_completion): Bind + case-fold-search to the value of completion-ignore-case when + checking completion-regexp-list. + (Fdisplay_completion_list): Make it handle arguments that are + symbols. Doc fix. + +2004-02-05 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.h: Add declaration of free_frame_menubar. + + * xfns.c (x_create_bitmap_mask): Removed unused variable depth. + (x_set_menu_bar_lines): Added ! defined USE_GTK for olines. + (Fx_change_window_property): Add declaration of parameters type and + format. Remove unused variable cons. + + * xselect.c: Include stdio.h. + +2004-02-05 Kenichi Handa <handa@m17n.org> + + * fns.c (Fset_char_table_range): Fix previous change. + + * buffer.c (Fset_buffer_multibyte): Fix docstring. + +2004-02-04 Luc Teirlinck <teirllm@auburn.edu> + + * editfns.c (Fchar_after, Fchar_before): Doc fixes. + +2004-02-04 Stefan Monnier <monnier@iro.umontreal.ca> + + * keymap.c (Vmouse_events): Rename from Vmenu_events. + (syms_of_keymap): Add mouse-[45], header-line, and mode-line to it. + +2004-02-04 Kenichi Handa <handa@m17n.org> + + * fns.c (Fset_char_table_range): Handle charsets ascii, + eight-bit-control, and eight-bit-graphic correctly. + +2004-02-03 Jason Rumney <jasonr@gnu.org> + + * w32select.c (Fw32_set_clipboard_data): Make coding iso2022 safe. + + * w32fns.c (x_to_w32_font): Likewise. + +2004-02-03 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.h: Add x_handle_dnd_message, x_check_property_data, + x_fill_property_data, x_property_data_to_lisp and check_x_display_info. + + * xterm.c (handle_one_xevent): Call x_handle_dnd_message for + ClientMessages. + + * xselect.c: Include termhooks.h and X11/Xproto.h. + (x_check_property_data, x_fill_property_data) + (x_property_data_to_lisp, mouse_position_for_drop) + (Fx_get_atom_name, x_handle_dnd_message): New functions for DND support. + (Fx_send_client_event): Move here from xfns.c. + (syms_of_xselect): Add Sx_get_atom_name and Sx_send_client_message. + + * xfns.c (x-send-client-message): Move to xselect.c. + (Fx_change_window_property): Add optional arguments TYPE, FORMAT and + OUTER_P. + (Fx_window_property): Add optional arguments TYPE, SOURCE, DELETE_P, + VECTOR_RET_P. Handle AnyPropertyType. Call x_property_data_to_lisp + if vector_ret_p is true. + (syms_of_xfns): Sx_send_client_message moved to xselect.c. + +2004-02-02 Eli Zaretskii <eliz@gnu.org> + + * fileio.c (Fcopy_file): If NEWNAME is a directory, expand the + basename of FILE relative to it, not FILE itself. + +2004-02-02 Kenichi Handa <handa@m17n.org> + + * coding.c (coding_restore_composition): Check invalid + composition data more rigidly. + +2004-01-30 Luc Teirlinck <teirllm@auburn.edu> + + * fileio.c (Fread_file_name_internal): Correctly handle the case + where insert-default-directory is nil. + (Fread_file_name): Always return an empty string if the user exits + with an empty minibuffer. Adapt the docstring accordingly. + (syms_of_fileio): Adapt the docstring of insert-default-directory + to the change in Fread_file_name. + +2004-01-29 Eli Zaretskii <eliz@gnu.org> + + * alloca.c [!alloca]: Fix the prototype for xfree. + +2004-01-29 Kenichi Handa <handa@m17n.org> + + * fns.c (string_char_to_byte): Optimize for ASCII only string. + (string_byte_to_char): Likewise. + +2004-01-28 Peter Runestig <peter@runestig.com> + + * makefile.w32-in, w32fns.c: Add `default-printer-name' function. + +2004-01-27 Steven Tamm <steventamm@mac.com> + + * unexmacosx.c (unexec_copy): Do not copy more than was + requested to prevent overwriting during unexec. + +2004-01-27 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * process.c (sigchld_handler): Add comment about not calling malloc. + + * process.h: Add extern to synch_process_termsig. + +2004-01-27 Steven Tamm <steventamm@mac.com> + + * macterm.c (make_mac_frame, make_mac_terminal_frame): + Move setting of scroll bars from make_mac_frame to + make_mac_terminal_frame to prevent clobbering of scroll-bar-mode. + +2004-01-26 Richard M. Stallman <rms@gnu.org> + + * search.c (Freplace_match): Handle nonexistent + back-references properly. + +2004-01-03 Richard M. Stallman <rms@gnu.org> + + * window.c (decode_any_window): New function. + (Fwindow_height, Fwindow_width, Fwindow_edges) + (Fwindow_pixel_edges, Fwindow_inside_edges) + (Fwindow_inside_pixel_edges): Use decode_any_window. + +2004-01-27 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * process.h: synch_process_termsig new variable. + + * callproc.c: Define synch_process_termsig. + (Fcall_process): Initiate synch_process_termsig to zero and + check if non-zero and get signal name after subprocess has ended. + + * process.c (sigchld_handler): Set synch_process_termsig + if terminated by a signal. synch_process_death setting removed. + + * sysdep.c (mkdir, rmdir): Also check synch_process_termsig. + +2004-01-26 Andreas Schwab <schwab@suse.de> + + * print.c (print_preprocess): Declare size as EMACS_INT to not + lose bits. + (print_object): Likewise. + * alloc.c (Fpurecopy): Likewise. + +2004-01-25 Luc Teirlinck <teirllm@auburn.edu> + + * window.c (Fwindow_minibuffer_p): Doc fix. + +2004-01-24 Jonathan Yavner <jyavner@member.fsf.org> + + * editfns.c (Fformat): Make both passes accept the same set of flags. + +2004-01-23 Kenichi Handa <handa@m17n.org> + + * fns.c (Fmd5): If OBJECT is a buffer different from the current + one, set buffer to OBJECT temporarily. + +2004-01-21 Stefan Monnier <monnier@iro.umontreal.ca> + + * keyboard.c (kbd_buffer_gcpro): Remove. + (kbd_buffer_store_event, clear_event, Fdiscard_input) + (stuff_buffered_input, init_keyboard, syms_of_keyboard): + Don't initialize and/or maintain the variable any more. It was made + redundant by my commit of 2003-06-15. + + * lisp.h [USE_LSB_TAG && !DECL_ALIGN]: Signal an error. + +2004-01-21 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * lisp.h: Add undef DECL_ALIGN. + +2004-01-21 Stefan Monnier <monnier@iro.umontreal.ca> + + * process.c (wait_reading_process_input) [SYNC_INPUT]: + Check interrupt_input_pending explicitly. + + * lisp.h (QUIT) [SYNC_INPUT]: Check interrupt_input_pending as well. + + * keyboard.c (handle_async_input): New fun, + extracted from input_available_signal. + (input_available_signal, reinvoke_input_signal): Use it. + +2004-01-20 Stefan Monnier <monnier@iro.umontreal.ca> + + * buffer.c (buffer_defaults, buffer_local_symbols): Use DECL_ALIGN. + + * lisp.h [USE_LSB_TAG]: Add definitions for Lisp_Object value + manipulation macros for when tags are in the lower bits. + (struct Lisp_Free) [USE_LSB_TAG]: Add padding. + (DECL_ALIGN): New macro. + (DEFUN): Use it. + + * lisp.h [ENABLE_CHECKING]: Don't force union type. + + * s/darwin.h (__attribute__): Remove outdated workaround. + + * macterm.c (main) [USE_LSB_TAG]: Don't range check the ram. + + * alloc.c (lisp_malloc, lisp_align_malloc) [USE_LSB_TAG]: + Don't check range of malloc address. + (pure_alloc) [USE_LSB_TAG]: Enforce alignment. + + * process.c (wait_reading_process_input): Lisp_Object/int mixup. + + * dired.c (Ffile_attributes): Lisp_Object/int mixup. + +2004-01-19 Kenichi Handa <handa@m17n.org> + + * fontset.c (fontset_font_pattern): Fix previous change. + +2004-01-16 Miles Bader <miles@gnu.ai.mit.edu> + + * xdisp.c (Voverflow_newline_into_fringe) + (move_it_in_display_line_to, redisplay_internal) + (update_window_fringes, redisplay_window, display_line, window): + Add `#ifdef HAVE_WINDOW_SYSTEM' around fringe-drawing stuff, so + that it compiles without a window-system. + * dispnew.c (direct_output_for_insert, update_window): Likewise. + +2004-01-16 Kim F. Storm <storm@cua.dk> + + * buffer.h (struct buffer): New member indicate_buffer_boundaries. + + * buffer.c (init_buffer_once): Set buffer_defaults and + buffer_local_flags for indicate_buffer_boundaries. + (syms_of_buffer): Defvar_per_buffer it, and defvar_lisp_nopro + default- variable for it. + + * dispextern.h (struct glyph_row): New members left_fringe_bitmap, + right_fringe_bitmap, redraw_fringe_bitmaps_p for new fringe handling. + New members exact_window_width_line_p and cursor_in_fringe_p for + overflowing newlines into right fringe. + New members indicate_bob_p, indicate_top_line_p, indicate_eob_p, + and indicate_bottom_line_p for buffer boundaries and scrolling. + (enum fringe_bitmap_type): Add UP_ARROW_BITMAP, DOWN_ARROW_BITMAP, + FIRST_LINE_BITMAP, LAST_LINE_BITMAP, FILLED_BOX_CURSOR_BITMAP, + HOLLOW_BOX_CURSOR_BITMAP, BAR_CURSOR_BITMAP, HBAR_CURSOR_BITMAP, + and HOLLOW_SQUARE_BITMAP. + (draw_fringe_bitmap, draw_window_fringes, update_window_fringes): + Add prototypes. + + * dispnew.c (row_equal_p, update_window_line): Compare fringe bitmaps + instead of related indicator fields. + Compare exact_window_width_line_p and cursor_in_mouse_face_p indicators. + (direct_output_for_insert): Handle exact width lines like + contined lines. Call update_window_fringes. + (update_window): Call update_window_fringes. + (scrolling_window): Don't skip desired rows with changed bitmaps. + Check if fringe bitmaps changes when assigning scrolled rows. + + * xdisp.c (Voverflow_newline_into_fringe): New variable. + (IT_OVERFLOW_NEWLINE_INTO_FRINGE): New macro. + (move_it_in_display_line_to): Overflow newline into fringe for + rows that are exactly as wide as the window. + (up_arrow_bits, down_arrow_bits, first_line_bits, last_line_bits) + (filled_box_cursor_bits, hollow_box_cursor_bits, bar_cursor_bits) + (hbar_cursor_bits, hollow_square_bits): New fringe bitmaps. + (fringe_bitmaps): Add new bitmaps. + (draw_fringe_bitmap): Make extern. Remove WHICH arg. + Select proper bitmap for cursor in fringe when appropriate. + Handle alignment of bitmap to top or bottom of row. + (draw_row_fringe_bitmaps): Don't select bitmaps here; that is now + done by update_window_fringes. + (update_window_fringes, draw_window_fringes): New functions. + (redisplay_internal): Call update_window_fringes in case only + cursor row is updated. + (redisplay_window): Call update_window_fringes. + Explicitly call draw_window_fringes if redisplay was done using + the current matrix or the overlay arrow is in the window. + (try_window_reusing_current_matrix): Mark scrolled rows for + fringe update (to update buffer-boundaries / scrolling icons). + (find_last_unchanged_at_beg_row): Handle exact width lines line + continued lines. + (display_line): Overflow newline into fringe for rows that are + exactly as wide as the window. Don't append space for newline + in this case. + (notice_overwritten_cursor): Explicitly clear cursor bitmap + in fringe as if it had been overwritten. + (erase_phys_cursor): Erase cursor bitmap in fringe. + (syms_of_xdisp): Mark show-trailing-whitespace and + void-text-area-pointer as user options. + DEFVAR_LISP Voverflow_newline_into_fringe. Enable by default. + + * xterm.c (x_update_window_end): Call draw_window_fringes. + (x_after_update_window_line): Just set redraw_fringe_bitmaps_p + in row instead of actually drawing fringe bitmaps. + (x_draw_fringe_bitmap): Handle bottom aligned bitmaps. + (x_draw_window_cursor): Draw cursor in fringe. + + * w32term.c (x_update_window_end): Call draw_window_fringes. + (x_after_update_window_line): Just set redraw_fringe_bitmaps_p + in row instead of actually drawing fringe bitmaps. + (w32_draw_fringe_bitmap): Handle bottom aligned bitmaps. + (w32_draw_window_cursor): Draw cursor in fringe. + + * macterm.c (x_update_window_end): Call draw_window_fringes. + (x_after_update_window_line): Just set redraw_fringe_bitmaps_p + in row instead of actually drawing fringe bitmaps. + (x_draw_fringe_bitmap): Handle bottom aligned bitmaps. + (mac_draw_window_cursor): Draw cursor in fringe. + +2004-01-16 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.c (handle_one_xevent): Don't handle characters that are part + of an old style (XLookupString) compose sequence. + +2004-01-15 Kenichi Handa <handa@m17n.org> + + * search.c (Freplace_match): Use make_multibyte_string or + make_unibyte_string according to the buffer multibyteness. + +2004-01-14 Stefan Monnier <monnier@iro.umontreal.ca> + + * alloc.c (struct interval_block, struct string_block) + (struct symbol_block, struct marker_block, live_string_p) + (live_cons_p, live_symbol_p, live_float_p, live_misc_p): + Better preserve alignment for objects in blocks. + (FLOAT_BLOCK_SIZE): Adjust for possible alignment padding. + + * lread.c (defvar_per_buffer): Remove dead declaration. + + * macterm.c (do_check_ram_size): Don't hardcode the lisp address + space size. + +2004-01-12 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xmenu.c (popup_get_selection): Check new parameter down_on_keypress + if a key press should pop down. Only pop down if a key is pressed + outside the menu/dialog. + (create_and_show_popup_menu): Pass 0 for down_on_keypress to + popup_get_selection. + (create_and_show_dialog): Pass 1 for down_on_keypress to + popup_get_selection. + +2004-01-11 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * alloc.c (allocate_vectorlike): Surround calls to mallopt with + BLOCK/UNBLOCK_INPUT. + +2004-01-08 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xmenu.c (Fx_popup_dialog): Add an Ok button if no buttons are + specified. + +2004-01-08 Kenichi Handa <handa@m17n.org> + + * editfns.c (Fformat): Fix '&' to '&&'. + +2004-01-08 Andreas Schwab <schwab@suse.de> + + * print.c (print_preprocess) <case Lisp_Vectorlike>: Only mask + size if PSEUDOVECTOR_FLAG is set. + +2004-01-07 Kenichi Handa <handa@m17n.org> + + * charset.c (Fdeclare_equiv_charset): Fix docstring. + + * fontset.c (fontset_ref_via_base): Fix previous change. + +2004-01-07 Kim F. Storm <storm@cua.dk> + + * process.c (read_process_output): Only activate adaptive + buffering if we read less than 256 bytes at a time. + +2004-01-06 Kim F. Storm <storm@cua.dk> + + * dispnew.c (buffer_posn_from_coords): Return both buffer/string + object and image object. Return glyph width and height. + (mode_line_string, marginal_area_string): Ditto. + + * dispextern.h (buffer_posn_from_coords, mode_line_string) + (marginal_area_string): Fix prototypes. + + * keyboard.h (POSN_POSN, POSN_SET_POSN): Rename macros from + POSN_BUFFER_POSN and POSN_SET_BUFFER_POSN. All uses changed. + (POSN_INBUFFER_P, POSN_BUFFER_POSN): New macros. + + * keyboard.c (make_lispy_position): Use modified mode_line_string, + buffer_posn_from_coords, and marginal_area_string functions to + include both string object and image object in the lispy position. + Also add actual glyph width and height to position. + (read_key_sequence): Use real buffer position from mouse + event to find keymap property even when click is in marginal area. + + * xdisp.c (note_mode_line_or_margin_highlight): Use modified + mode_line_string and marginal_area_string functions to handle + both string object and image object properties. + +2004-01-06 Andreas Schwab <schwab@suse.de> + + * syntax.c (skip_chars): Treat '-' at end of string as ordinary + character. + +2004-01-02 Andreas Schwab <schwab@suse.de> + + * macterm.c (emacs_options, x_initialized, same_x_server): + Remove unused (and duplicated) definitions. + +2004-01-02 Kim F. Storm <storm@cua.dk> + + * process.h (struct Lisp_Process): New members for adaptive read + buffering: adaptive_read_buffering, read_output_delay, and + read_output_skip. + + * process.c (ADAPTIVE_READ_BUFFERING): New conditional. + (READ_OUTPUT_DELAY_INCREMENT, READ_OUTPUT_DELAY_MAX) + (READ_OUTPUT_DELAY_MAX_MAX): New constants. + (process_output_delay_count, process_output_skip): New vars. + (Vprocess_adaptive_read_buffering): New variable. + (make_process): Initialize adaptive read buffering members. + (Fstart_process): Set adaptive_read_buffering member. + (deactivate_process): Cleanup adaptive read buffering. + (wait_reading_process_input): Temporarily omit delayed + subprocesses from the set of file descriptors to read from; + adjust the select timeout if we skipped any subprocesses. + (read_process_output): Increase adaptive read buffering delay if + we read less than a full buffer; reduce delay when we read a + full buffer. + (send_process): Simplify using local Lisp_Process var. + Reset adaptive read buffering delay after write. + (init_process): Initialize process_output_delay_count and + process_output_skip. + (syms_of_process): DEFVAR_LISP Vprocess_adaptive_read_buffering. + +2004-01-01 Jason Rumney <jasonr@gnu.org> + + * w32term.c (w32_text_out): Use s->font, for consistency with callers. + +2003-12-30 Luc Teirlinck <teirllm@auburn.edu> + + * print.c (Ferror_message_string): Add hyperlink in the docstring + to the definition of `signal' in the Elisp manual. + * eval.c (Fsignal): Ditto. + +2003-12-29 James Clark <jjc@jclark.com> + + * fns.c (internal_equal): Return t for two NaN arguments. + +2003-12-29 Richard M. Stallman <rms@gnu.org> + + * data.c (store_symval_forwarding): Handle setting + default-fill-column, etc., by changing the value in + buffers that use the default. + + * minibuf.c (Fset_minibuffer_window): Doc fix. + + * fileio.c (choose_write_coding_system): Ignore auto_saving + if using the visited file for auto saves. + (Fwrite_region): Don't update SAVE_MODIFF + if auto-saving in visited file. + +2003-12-29 Kenichi Handa <handa@m17n.org> + + * dispextern.h (face_font_available_p): Extern it. + + * fontset.c (Voverriding_fontspec_alist): New variable. + (lookup_overriding_fontspec): New function. + (fontset_ref_via_base): Call lookup_overriding_fontspec if necessary. + (fontset_font_pattern): Likewise. + (regulalize_fontname): New function. + (Fset_fontset_font): Call regulalize_fontname. + (Fset_overriding_fontspec_internal): New function. + (syms_of_fontset): Initialize and staticpro Voverriding_fontspec_alist. + Defsubr Sset_overriding_fontspec_internal. + + * xfaces.c (face_font_available_p): New function. + +2003-12-28 Richard M. Stallman <rms@gnu.org> + + * buffer.c (Fother_buffer): Don't crash if BUF is nil + or if its name is nil. + + * buffer.c (Fkill_buffer): Don't delete auto-save file + if it's the same as the visited file. + +2003-12-28 Luc Teirlinck <teirllm@auburn.edu> + + * coding.c (Fcheck_coding_system): Doc fix. + +2003-12-28 Kim F. Storm <storm@cua.dk> + + * Makefile.in (eval.o): Depend on dispextern.h. + + * dispnew.c (buffer_posn_from_coords): Fix calculation of dy for + image glyph using image's ascent. + (mode_line_string): Return image glyph as object clicked on. + Adjust y0 for image glyph using image's ascent. + + * dispextern.h (FACE_ID_BITS, MAX_FACE_ID): New defines. + (struct glyph): New members, ascent and descent. Used to save + this glyph's ascent and descent, instead of having. + (struct glyph): Declare member face_id using FACE_ID_BITS. + (find_hot_spot): Add prototype. + + * keyboard.c (Qimage): Remove extern (now in lisp.h). + (QCmap): Declare extern. + (make_lispy_position): When position is inside image hot-spot, + use hot-spot element's id as posn element. + + * lisp.h (IMAGEP): New macro to test for image object type. + (Qimage): Declare extern. + + * macfns.c (Qimage): Remove extern (now in lisp.h). + (valid_image_p, parse_image_spec): Use IMAGEP macro. + + * macterm.c (Qface, Qmouse_face): Remove unused externs. + + * w32fns.c (Qimage): Remove extern (now in lisp.h). + (valid_image_p, parse_image_spec): Use IMAGEP macro. + + * w32menu.c (Qmouse_click, Qevent_kind): Remove unused externs. + + * w32term.c (Qface, Qmouse_face): Remove unused externs. + + * xdisp.c (Qarrow, Qhand, Qtext, Qpointer): New variables for + pointer types. + (Qrelative_width, Qalign_to): Remove unused variables. + (Vvoid_text_area_pointer): Replace Vshow_text_cursor_in_void. + (QCmap, QCpointer, Qrect, Qcircle, Qpoly): New variables for image + maps. + (x_y_to_hpos_vpos): Return glyph relative coordinates through new + dx and dy args. Remove buffer_only_p arg (always 0). Simplify + code accordingly. + (get_glyph_string_clip_rect): Draw cursor using glyph's rather + than row's ascent and height, to get sensible height on tall rows. + (build_desired_tool_bar_string): Remove Qimage extern. + (get_tool_bar_item): Fix call to x_y_to_hpos_vpos. + (produce_image_glyph): Adjust it.ascent to minimum row ascent if + image glyph is alone on the last line. + (append_glyph, append_composite_glyph, produce_image_glyph) + (append_stretch_glyph): Set glyph's ascent and descent. + (on_hot_spot_p): New function to check if position is inside an + rectangular, circular, or polygon-shaped image hot-spot, + (find_hot_spot): New function to search for image hot-spot. + (Flookup_image_map): New defun to search for image hot-spot. + (define_frame_cursor1): New aux function to determine frame + pointer. + (note_mode_line_or_margin_highlight, note_mouse_highlight): Handle + `pointer' text property and :pointer image property to control + frame pointer shape. Detect image hot-spots for pointer and + help_echo properties. Use define_frame_cursor1. + (note_mouse_highlight): Use Vvoid_text_area_pointer. + (syms_of_xdisp): Defsubr new defun. Intern and staticpro new + variables. DEFVAR_LISP Vvoid_text_area_pointer instead of + Vshow_text_cursor_in_void. + + * xfaces.c (cache_face): Abort if c->size exceeds MAX_FACE_ID. + + * xfns.c (x_set_mouse_color): Remove bogus x_check_errors call. + (Qimage): Remove extern (now in lisp.h). + (valid_image_p, parse_image_spec): Use IMAGEP macro. + + * xmenu.c (show_help_event): Remove unused code. + + * xterm.c (Qface, Qmouse_face): Remove unused externs. + (x_draw_hollow_cursor): Draw cursor using glyph's rather than + row's ascent and descent, to get a sensible height on tall rows. + +2003-12-25 Luc Teirlinck <teirllm@auburn.edu> + + * minibuf.c (Fcompleting_read): Undo previous change. + +2003-12-25 Lars Hansen <larsh@math.ku.dk> + + * dired.c (Fdirectory_files, Fdirectory_files_and_attributes): + Arguments GCPRO'ed in call to file name handler. + +2003-12-25 Thien-Thi Nguyen <ttn@gnu.org> + + * termcap.c (tgetst1): Scan for "%pN"; if all + N are continuous in [1,9], remove all "%pN". + +2003-12-24 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (xg_frame_set_char_size): Call x_wm_set_size_hint. + + * xfaces.c (lface_fully_specified_p): Take into account that + MAC OS always have unspecified stipple. + +2003-12-24 Thien-Thi Nguyen <ttn@gnu.org> + + * tparam.c (tparam1): Add handling for `%pN', which + means use param N for the next substitution. + +2003-12-24 Thien-Thi Nguyen <ttn@gnu.org> + + * xfaces.c (Fcolor_gray_p): Fix omission bug: + In case `frame' is nil, consult the selected frame. + (Fcolor_supported_p): Likewise. + +2003-12-23 Luc Teirlinck <teirllm@auburn.edu> + + * fns.c (Frandom, Fstring_make_multibyte, Fset_char_table_range): + Doc fixes. + + * minibuf.c (read_minibuf): Allow INITIAL to be a cons of a string + and an integer. Adapt the introductory comment accordingly. + (Fread_from_minibuffer): Delete code moved into read_minibuf. + Doc fix. + (Fread_minibuffer, Fread_no_blanks_input): Adapt to changes in + read_minibuf. + (Fcompleting_read): Delete code moved into read_minibuf. + (Ftest_completion): Make it handle obarrays and hash tables correctly. + +2003-12-03 Kenichi Handa <handa@m17n.org> + + * coding.c (decode_coding_iso2022): Fix for preserving UTF-8 + encoding sequence. + +2003-12-01 Kenichi Handa <handa@m17n.org> + + * composite.c (syms_of_composite): Don't make the compostion hash + table week. + +2003-11-30 Luc Teirlinck <teirllm@auburn.edu> + + * intervals.h: Add EXFUN for Fget_char_property_and_overlay. + * textprop.c (Fget_char_property_and_overlay): New function. + (syms_of_textprop): Defsubr it. + +2003-11-29 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * dispnew.c (buffer_posn_from_coords): Add ifdef HAVE_WINDOW_SYSTEM + to compile on terminal configuration. + + * fileio.c (Fread_file_name): Check use_file_dialog also before + calling Fx_file_dialog. + + * fns.c (use_file_dialog): New variable. + (syms_of_fns): DEFVAR_BOOL use-file-dialog. + +2003-11-29 Kim F. Storm <storm@cua.dk> + + * msdos.c (Qcursor_type, Qbar, Qhbar): Declare extern. + (syms_of_msdos): Don't intern and staticpro them. + +2003-11-27 Kim F. Storm <storm@cua.dk> + + * dispnew.c (buffer_posn_from_coords): Calculate and return pixel + coordinates relative to glyph at posn. If glyph is an image, + return that as object at posn. Callers changed. + (mode_line_string, marginal_area_string): Calculate and return + pixel coordinates relative to glyph. Callers changed. + + * dispextern.h (buffer_posn_from_coords, mode_line_string) + (marginal_area_string): Fix prototypes. + (window_box_left_offset, window_box_right_offset): Add prototypes. + + * frame.h (get_specified_cursor_type, get_window_cursor_type): + Remove prototypes. + + * keyboard.h (EVENT_CLICK_COUNT, POSN_SCROLLBAR_PART): Fix defines. + + * keyboard.c (make_lispy_position): Add x and y coordinates + relative to the current glyph as 7th element of position. + If glyph is an image, return it in the object element. + (read_key_sequence): Skip checks for keymap property in cases + where POSN_STRING is not a string (e.g. an image). + + * xdisp.c (Vdisplay_pixels_per_inch): New variable. + (Vshow_text_cursor_in_void): New variable. + (glyph_to_pixel_coords): Don't use negative hpos. + (x_y_to_hpos_vpos): Fix for partially visible first glyph. + (append_stretch_glyph): Change ascent arg to be actual value + in pixels rather than ratio to height. Callers changed. + (calc_pixel_width_or_height): New aux function, implementing + pixel based artihmetic for glyph widths and heights. + (produce_stretch_glyph): Use calc_pixel_width_or_height for + :width, :height, :align-to, and :ascent, thus allowing these to + be specified in pixels as well as multiples of characters. + Don't produce stretch glyphs with zero width or height. + (get_specified_cursor_type): Declare static. + (get_window_cursor_type): Declare static. Add glyph arg to be + able to know when cursor is on an image; always substitute + hollow-box cursor for filled-box cursor on images, to avoid + negative images and flicker when blinking the cursor. + (display_and_set_cursor): Pass glyph to get_window_cursor_type. + (note_mode_line_or_margin_highlight): Use non-text cursor rather + than vertical scroll-bar cursor in display margins. + (note_mouse_highlight): Use non-text cursor rather than text + cursor in fringes and over images in the text area. + Use non-text cursor when mouse pointer is outside editable text, + i.e. in the void after end-of-line or end-of-buffer; this was + already done for W32, but is now standard for all systems -- + user can toggle show-text-cursor-in-void to get old behaviour. + (syms_of_xdisp): DEFVAR_LISP Vshow_text_cursor_in_void and + Vdisplay_pixels_per_inch. + +2003-11-25 Andreas Schwab <schwab@suse.de> + + * fns.c (internal_equal) <case Lisp_Vectorlike>: Declare size as + EMACS_INT to not lose bits. + (Ffillarray): Don't set bits beyond the size of a bool vector. + +2003-11-25 Kim F. Storm <storm@cua.dk> + + * print.c (Fredirect_debugging_output) [!GNU_LINUX]: Do not + define this defun on systems that cannot use stderr as lvalue. + +2003-11-24 Gerd Moellmann <gerd@gnu.org> + + * s/freebsd.h (LD_SWITCH_SYSTEM_TEMACS) + [__FreeBSD_version >= 500042]: Define as -znocombreloc because + ld's default is incompatible with unexec. + +2003-11-23 Kim F. Storm <storm@cua.dk> + + * window.c (enum window_loop): Add REDISPLAY_BUFFER_WINDOWS. + (window_loop): Handle REDISPLAY_BUFFER_WINDOWS. + (Fforce_window_update): New defun. + (syms_of_window): Defsubr it. + (Fset_window_margins, Fset_window_fringes): Doc fix. + + * print.c (Fredirect_debugging_output): New defun. + (syms_of_print): Defsubr it. + +2003-11-22 Luc Teirlinck <teirllm@auburn.edu> + + * fns.c (Fset_char_table_parent): Doc fix. + +2003-11-22 Kim F. Storm <storm@cua.dk> + + * dispnew.c (buffer_posn_from_coords): Return actual row/column + for glyph clicked on, rather than (unused) pixel positions. + (mode_line_string, marginal_area_string): Change X and Y args to + pointers for returning actual row/column for glyph clicked on. + Simplify and optimize loops. + + * dispextern.h (mode_line_string, marginal_area_string): + Update prototypes. + + * keyboard.c (make_lispy_position): New function for generating + mouse click positions from frame and pixel coordinates. + Enhanced to return buffer position and actual row/column for + events outside the text area using updated mode_line_string and + marginal_area_string functions. + Return left-fringe and right-fringe clicks as such, rather than + clicks in text area. + (make_lispy_event) [USE_X_TOOLKIT, USE_GTK]: Don't call + pixel_to_glyph_coords, as we never use the results. + (make_lispy_event): Use make_lispy_position for MOUSE_CLICK_EVENT, + WHEEL_EVENT, and DRAG_N_DROP_EVENT to replace redundant code. + Eliminate unused code in WHEEL_EVENT handling. + (make_lispy_movement): Use make_lispy_position. + + * window.c (coordinates_in_window): Remove redundant tests. + Fix returned X pixel value for left-margin. + + * xdisp.c (note_mode_line_or_margin_highlight): Adapt to new + mode_line_string and marginal_area_string parameters. + +2003-11-22 Lars Hansen <larsh@math.ku.dk> + + * w32.c (struct the_group, getgrgid): Add. + * mac.c (struct my_group, getgrgid): Add. + +2003-11-21 Luc Teirlinck <teirllm@auburn.edu> + + * fns.c (Fassq, Fassoc, Frassq, Frassoc): Doc fixes. + +2003-11-21 Lars Hansen <larsh@math.ku.dk> + + * dired.c (Ffile_attributes): Add parameter ID-FORMAT and + include in call to file name handler. Optionally translate numeric + UID and GID to strings. Update docstring. + (directory_files_internal): Add parameter ID-FORMAT. + (Fdirectory_files_and_attributes): Add parameter ID-FORMAT and + include in call to file name handler and call to + directory_files_internal. Update Docstring. + (Fdirectory_files): Add dummy parameter in call to + directory_files_internal. + * lisp.h (Qinteger): Add. + (Qinteger_or_floatp, Qinteger_or_float_or_marker_p): Remove. + (Ffile_attributes): Add parameter. + * data.c (Qinteger): Export. + +2003-11-21 Luc Teirlinck <teirllm@auburn.edu> + + * fns.c (Freverse, Fnreverse): Doc fixes. + +2003-11-19 Kim F. Storm <storm@cua.dk> + + * xdisp.c (init_iterator): Initialize it->start to position + before reseating (in case start position is invisible). + (init_to_row_start): Set it->start to row-start. + (redisplay_window): Accept optional_new_start if start position + is invisible (in which case IT_CHARPOS overshoots PT). + (display_line): Setup row->start from it->start (rather than + it->current which is wrong if first char on line is invisible). + When done, reseat it->start to it->current (= start of next row). + (expose_area): Fix exposure of text area when first char (e.g. TAB) + is only partially visible. + + * dispextern.h (struct it): New member start. + +2003-11-17 Stefan Monnier <monnier@iro.umontreal.ca> + + * alloc.c (make_float, Fcons): Clear the markbit at init time. + (make_float, Fcons, Fmake_symbol, allocate_misc): Move the increment + of block_index outside of the macro call. + (Fgarbage_collect): Remove null code. + + * m/amdx86-64.h: Don't redefine XPNTR. + + * keyboard.c (parse_modifiers, apply_modifiers): Use INTMASK instead + of VALMASK. + + * fns.c (hashfn_eq, hashfn_eql, hashfn_equal, hash_put) + (sxhash_string, sxhash): Use INTMASK instead of VALMASK. + (maybe_resize_hash_table): Use MOST_POSITIVE_FIXNUM. + + * lisp.h (VALMASK): Only define for non-union type. + (MARKBIT): Remove. + (ARRAY_MARK_FLAG): Use previous value of MARKBIT. + (XTYPE): Define unconditionally. + (XSETTYPE): Remove one more remnant. + (EQ): Define differently for the union and non-union cases. + (INTMASK): New bit mask. + (struct Lisp_Marker): Move down to prepare for upcoming patch. + (GC_EQ): Delegate to EQ. + + * coding.c (coding_restore_composition): Lisp_Object/int mixup. + +2003-11-17 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.c (x_window_to_scroll_bar): Move check of display to + where window_id is compared. + +2003-11-17 Kim F. Storm <storm@cua.dk> + + * dispextern.h (struct it): New member first_vpos. + + * xdisp.c (start_display): Set it->first_vpos. + (try_window_id): Use first_vpos to start display in first _text_ + line if no reusable lines at start of window with header line. + +2003-11-16 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * w32fns.c (XPutPixel): + * w32bdf.c (w32_init_bdf_font): + * sunfns.c (sel_read): + * process.c (Fmake_network_process): + * frame.c (store_frame_param): + * fontset.c (Fset_fontset_font): + * emacs.c (shut_down_emacs): + * ccl.c (ccl_driver): Remove period at end of error message. + + * config.in: Regenerate. + + * xfns.c (x_window_to_frame, x_any_window_to_frame) + (x_non_menubar_window_to_frame, x_menubar_window_to_frame) + (x_top_window_to_frame): Add Display* argument to xg_win_to_widget. + (x_create_bitmap_mask, xg_set_icon, create_frame_xic) + (xic_set_statusarea, x_window, gif_load): Formatting adjustments. + + * xterm.h (struct x_display_info): New field xg_cursor for GTK. + + * xterm.c: Add Display * to x_window_to_scroll_bar declaration. + (XTmouse_position, handle_one_xevent): Pass Display* to + x_window_to_scroll_bar. + (x_window_to_scroll_bar): Take a Display* argument. + Check that display for frame is equal to Display* argument. + (event_handler_gdk): Remove current_dpyinfo. Get dpyinfo from + x_display_info_for_display instead. Use Display in xev instead + of GDK_DISPLAY. + (x_dispatch_event): Call x_display_info_for_display. + (XTread_socket): Move GTK part out of loop. current_dpyinfo removed. + (x_connection_closed): Call xg_display_close for GTK. + (x_term_init): Call xg_display_open for additional displays. + Initiate dpyinfo->xg_cursor with call to xg_create_default_cursor + for GTK. + + * xmenu.c (single_menu_item, mouse_position_for_popup) + (x_activate_menubar): Formatting adjustments. + + * xdisp.c (update_tool_bar, redisplay_tool_bar): Formatting + adjustments. + + * gtkutil.c (xg_get_gdk_display, xg_set_screen, xg_display_open) + (xg_display_close, xg_create_default_cursor) + (xg_get_gdk_pixmap_and_mask): New functions for multiple display + handling. + (xg_left_ptr_cursor): Remove. + (xg_set_cursor): Change cursor to GdkCursor*. Do not create + cursor here. + (xg_win_to_widget): Take Display* argument, call + gdk_xid_table_lookup_for_display. + (xg_create_frame_widgets, xg_get_file_name, create_menus) + (xg_create_widget, xg_modify_menubar_widgets): Call xg_set_screen. + (xg_create_widget, xg_create_scroll_bar): Use xg_cursor + in FRAME_X_DISPLAY_INFO. + (xg_get_scroll_id_for_window): Take Display* argument. + (update_frame_tool_bar): Call xg_get_gdk_pixmap_and_mask. + (xg_initialize): Remove xg_left_ptr_cursor. + + * gtkutil.h (xg_get_scroll_id_for_window, xg_win_to_widget): Add + Display* argument. + (xg_display_open, xg_display_close, xg_create_default_cursor): Declare. + +2003-11-14 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.c (x_detect_focus_change): Do not change focus frame for + Enter/LeaveNotify if the current focus frame has explicit focus. + +2003-11-14 Kim F. Storm <storm@cua.dk> + + * dispnew.c (update_text_area): Fix redisplay error when hscroll + is active and first glyph is only partially visible. + +2003-11-13 Kenichi Handa <handa@m17n.org> + + * xdisp.c (select_frame_for_redisplay): New function. + (redisplay_internal): Record also selected_frame for + unwind_redisplay. Call select_frame_for_redisplay before + redrawing each frame. + (unwind_redisplay): Argument changed to a cons. + +2003-11-12 Luc Teirlinck <teirllm@auburn.edu> + + * fns.c (Fstring_to_multibyte): Doc fix. + +2003-11-11 Kenichi Handa <handa@m17n.org> + + * xterm.c (x_list_fonts): Fix excluding of auto-scaled fonts. + +2003-11-09 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xfns.c (x_window): Set XtNx and XtNy in shell widget for + program specified positions. + +2003-11-08 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.c (XAW_ARROW_SCROLLBARS): Define it for Xaw 1.5E. + +2003-11-08 Kenichi Handa <handa@m17n.org> + + * Makefile.in (lisp): Add kannada.el. + (shortlisp): Likewise. + +2003-11-07 Kenichi Handa <handa@m17n.org> + + * coding.c (coding_allocate_composition_data): + Reset coding->composing to COMPOSITION_NO. + (coding_restore_composition): Detect invalid composition data. + Give Fstring and Fvector a Lispy integer, not C int. + +2003-11-05 Stefan Monnier <monnier@iro.umontreal.ca> + + * floatfns.c (Flogb): Don't use VALMASK. + + * m/amdx86-64.h (VALBITS, XINT, XUINT): Remove. + * m/ia64.h (VALBITS, XINT, XUINT): Remove. + + * lisp.h (XINT): Move the cast to clarify what is going on. + (GCTYPEMASK, XSETTYPE): Remove. + (XGCTYPE): Make it an alias of XTYPE. + +2003-11-03 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.c (x_term_init): Fix formatting. + +2003-11-02 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.h (xg_have_tear_offs): Declare. + (xg_keep_popup, xg_did_tearoff): Remove. + + * gtkutil.c: Remove variable xg_did_tearoff. + (xg_have_tear_offs): New function. + (tearoff_remove): Just decrease xg_detached_menus. + (tearoff_activate): Increase xg_detached_menus and call + tearoff_remove when tearoff is removed. + (xg_keep_popup): Remove function. + (create_menus): Give add_tearoff_p as argument to recursive + call to create_menus. + (xg_create_widget): Use variables instead of multiple + strcmp. Tell create_menus to create tear off only for + menu bar menus. + (xg_update_menubar): Change title for a detached menu also. + (xg_modify_menubar_widgets): Always call xg_update_menubar, regardless + of deep_p. + (xg_initialize): Initialize xg_detached_menus, remove + initialization of xg_did_tearoff. + + * xmenu.c (set_frame_menubar): For GTK, set deep_p if + xg_have_tear_offs returns non-zero. + (create_and_show_popup_menu): Remove setting of xg_did_tearoff and + call to xg_keep_popup. + +2003-11-01 Andrew Choi <akochoi@shaw.ca> + + * macterm.c (XTread_socket): Handle menubar selection and grow + window only for mouseDown events. + +2003-10-31 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.c (x_term_init): For GTK part, increase x_initialized + to check for more than one display. Use error instead of return 0. + +2003-10-31 Andrew Choi <akochoi@shaw.ca> + + * unexmacosx.c (unrelocate): New function (contributed by Nozomu Ando). + (copy_dysymtab): Call it. + +2003-10-31 Luc Teirlinck <teirllm@auburn.edu> + + * eval.c (Fdefvaralias): Doc fix. + +2003-10-26 Luc Teirlinck <teirllm@auburn.edu> + + * data.c (Fsetplist): Doc fix. + +2003-10-14 Lute Kamstra <lute@gnu.org> + + * window.c (Fset_window_fringes): Clarify docstring. + +2003-10-14 Kim F. Storm <storm@cua.dk> + + * window.c (Fset_window_margins): Simplify arg checking. + +2003-10-13 Richard M. Stallman <rms@gnu.org> + + * regex.c (MAX_BUF_SIZE): Reduce to 2**15. + (print_partial_compiled_pattern): Replace assert with a printout. + (skip_noops, mutually_exclusive_p): Change args, values to re_char *. + + * alloc.c (lisp_align_malloc): If BASE is 0, call memory_full. + + * window.c (Fset_window_margins): Allow only integers as args. + (syms_of_window) <special-display-buffer-names, + special-display-regexps>: Doc fixes. + +2003-10-13 Lute Kamstra <lute@gnu.org> + + * window.c (Fset_window_fringes): Elaborate docstring. + +2003-10-12 Andrew Choi <akochoi@shaw.ca> + + * macterm.c (XTread_socket): Call DragWindow only for mouseDown events. + + * s/darwin.h (GC_MARK_STACK): Define. + +2003-10-12 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * window.c (shrink_windows): New function. + (size_window): Call shrink_windows to calculate window sizes when + shrinking frame with more than one window. + +2003-10-12 Kim F. Storm <storm@cua.dk> + + * xdisp.c (compute_fringe_widths): Doc fix. + +2003-10-08 Kenichi Handa <handa@m17n.org> + + * coding.c (Fcoding_system_p): Return t for auto-loading coding system. + +2003-10-07 Kenichi Handa <handa@m17n.org> + + * coding.c (Qcoding_system_define_form): New variable. + (syms_of_coding): Intern and staticpro it. + (Fcheck_coding_system): Try to autoload the definition of + CODING-SYSTEM. + +2003-10-05 Luc Teirlinck <teirllm@auburn.edu> + + * fns.c (Frequire): Doc fix. + +2003-10-05 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xfns.c (Fx_send_client_event): New function as a base for + manipulating extended window manager hints. + (Fx_send_client_event): Remove unused variable s. + + * w32term.c (w32_read_socket): Remove call to x_check_fullscreen_move, + that function is removed. + + * xterm.c (x_set_offset): Use move_offset_left/top instead of + x/y_pixels_outer_diff. + (x_check_expected_move): Calculate move_offset_left/top. + + * xterm.h (struct x_output): New members: move_offset_top/left. + + * frame.c (x_set_frame_parameters): Remove x_fullscreen_move, + call x_set_offset directly. + + * frame.h (enum): FULLSCREEN_MOVE_WAIT removed. + + * frame.c (Fdelete_frame): Free decode_mode_spec_buffer. + + * xterm.c (x_delete_display): Free font names and font_encoder + in dpyinfo->font_table. + + * xfns.c (Fx_close_connection): Only call XFreeFont here. + Move xfree of font names to x_delete_display. + + * xterm.h (struct x_display_info): New member, wm_type. + (struct x_output): New members, expected_top/left and + check_expected_move. + + * xterm.c (handle_one_xevent): Reset wm_type when ReparentNotify + is received. + (handle_one_xevent): Rename x_check_expected_move from + x_check_fullscreen_move. + (x_set_offset): Only add WM decoration sizes to modified_top/left + for X_WMTYPE_A. Set check_expected_move when WM type is unknown. + (x_check_expected_move): Rename from x_check_fullscreen_move. + Removed fullscreen specific code. Use check_expected_move, + expected_left/top instead. Also, set wm_type. + (x_term_init): Initialize wm_type to unknown. + + * frame.c (x_fullscreen_move): Remove addition of WM decoration + sizes to move_x/y. + +2003-10-03 Kenichi Handa <handa@m17n.org> + + * macterm.c (x_load_font): Clear all members of FONTP before start + filling them. + +2003-10-02 Kenichi Handa <handa@m17n.org> + + * fontset.c (fs_load_font): Don't set fontp->font_encoder to NULL + before calling find_ccl_program_func. Call find_ccl_program_func + only when fontp->font_encoder is not NULL. + + * xterm.c (x_load_font): Clear all members of FONTP before start + filling them. + +2003-10-03 John Paul Wallington <jpw@gnu.org> + + * keymap.c (map_keymap): Don't abort when binding is a vector. + +2003-10-02 Jason Rumney <jasonr@gnu.org> + + * makefile.w32-in (emacs.o, coding.o, bytecode.o): + Sync dependencies with Makefile.in. + (alloca.o): Remove. + + * w32fns.c (w32_load_system_font): Clear all members of FONTP before + filling them. + + * w32bdf.c (w32_load_bdf_font): Likewise. + +2003-09-30 Richard M. Stallman <rms@gnu.org> + + * term.c (set_tty_color_mode): Calculate current_mode_spec + regardless of value of VAL. + + * intervals.c (graft_intervals_into_buffer): + Set BUF_INTERVALS (buffer)->up_obj when appropriate. + Handle over_used when splitting UNDER. + +2003-09-30 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * regex.c (regex_compile): Free the stack when returning from function. + +2003-09-28 Kenichi Handa <handa@m17n.org> + + * fontset.c (Finternal_char_font): Change return value to + cons (FONT-NAME . GLYPH-CODE). + +2003-09-28 Eli Zaretskii <eliz@gnu.org> + + * term.c (tty_setup_colors): Treat any negative argument as -1. + +2003-09-27 Gaute B Strokkenes <biggaute@uwc.net> (tiny change) + + * process.c (send_process): Delete unused temp_buf. + +2003-09-26 Dave Love <fx@gnu.org> + + * xterm.c (x_bitmap_mask): Declare. + +2003-09-25 Dave Love <fx@gnu.org> + + * Makefile.in (fns.o): Depend on md5.h. + +2003-09-25 Kim F. Storm <storm@cua.dk> + + * window.c (set_window_buffer): Fix redisplay problems when + switching between buffers with different display margin widths. + +2003-09-23 Kim F. Storm <storm@cua.dk> + + * process.c (set_socket_option): Fix :bindtodevice option. + (Fset_network_process_option): Update process contact list when + setting option succeeds. + (Fmake_network_process): Doc fix. + +2003-09-23 Dave Love <fx@gnu.org> + + * process.c (Fnetwork_interface_info): Use HAVE_STRUCT_IFREQ... macros. + +2003-09-22 Eli Zaretskii <eliz@gnu.org> + + * term.c (set_tty_color_mode): Use INTEGERP to test whether a + color mode is an integer number (it could be -1). + +2003-09-22 Richard M. Stallman <rms@gnu.org> + + * intervals.c (graft_intervals_into_buffer): Correct the main loop + in the case where OVER is longer than UNDER. + +2003-09-22 Masatake YAMATO <jet@gyve.org> + + * window.c (Fset_window_scroll_bars): Validate the value of + `vertical_type'. + +2003-09-21 Kim F. Storm <storm@cua.dk> + + * frame.c (Vdefault_frame_scroll_bars): New variable. + (x_set_vertical_scroll_bars): Use it instead of hardcoded values. + (syms_of_frame): DEFVAR_LISP it, and initialize according to + window-system default scroll bar position. + + * window.c (Fwindow_scroll_bars): Doc fix. + +2003-09-19 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.c (x_set_offset): Take window manager decorations into account. + +2003-09-19 Richard M. Stallman <rms@gnu.org> + + * atimer.h: Don't include lisp.h. + (P_): Define it here (as well as elsewhere). + + * print.c (Fprin1_to_string): Move the PRINTPREPARE + later, so that PRINTFINISH won't unbind Qinhibit_modification_hooks. + + * data.c (Fvariable_binding_locus): New function. + (syms_of_data): defsubr it. + (Flocal_variable_p): Delete duplicate call to indirect_variable. + +2003-09-18 Dave Love <fx@gnu.org> + + * alloc.c (GC_MALLOC_CHECK): Move conditional undef after lisp.h. + + * process.c (Fnetwork_interface_info): Fix type error. + (Fnetwork_interface_list): Doc fix. + (read_process_output, read_process_output): Delete unused var. + +2003-09-17 Kim F. Storm <storm@cua.dk> + + * process.c (Fnetwork_interface_list, Fnetwork_interface_info): + Require HAVE_NET_IF_H and HAVE_SYS_IOCTL_H to include these fns. + (Fnetwork_interface_info): Check that ifreq struct has required + fields before accessing them; this requires that those fields are + defined as macros, which may be too restrictive on some platforms, + but it is better than failing on other platforms. + (syms_of_process): Only defsubr above fns when included. + +2003-09-17 Dave Love <fx@gnu.org> + + * unexalpha.c: Don't include varargs.h. + +2003-09-17 Kim F. Storm <storm@cua.dk> + + * process.c (Fset_process_sentinel): Add sentinel to childp plist + for network process. + (socket_options): Add `:' prefix to option names. Add optbit field. + (set_socket_option): Remove no_error arg and special handling of s < 0. + Return 1<<optbit for known option, 0 for unknown. + Do not interpret 0 as false for boolean option (only nil). + Pass failed option and value to report_file_error. + (Fset_network_process_options): Replace by Fset_network_process_option. + (Fset_network_process_option): New function to set just one option. + (Fmake_network_process): Allow :coding arg to be a cons. + Allow :server arg to be an integer specifying backlog size. + Remove :options arg, and allow options to be specified directly + as :KEY, VALUE pairs. Parse these options before binding socket. + As before, :reuseaddr t is default for a server process, but this + can now be disabled by specifying :reuseaddr nil. + (Fnetwork_interface_info): Rename from Fget_network_interface_info. + (init_process): Availability of network options is now checked with + simpler syntax (featurep 'make-network-process :OPTION); use loop to + setup features. + (syms_of_process): Fix defsubr's for the replaced functions. + +2003-09-16 Dave Love <fx@gnu.org> + + * Makefile.in: Depend on coding.h. + +2003-09-14 Kim F. Storm <storm@cua.dk> + + * process.c [HAVE_SOCKETS]: Include sys/ioctl.h and net/if.h. + (Fnetwork_interface_list, Fget_network_interface_info): New defuns. + (syms_of_process): Defsubr them. + + * config.in: Regenerate. + +2003-09-12 Stefan Monnier <monnier@iro.umontreal.ca> + + * m/sr2k.h (XMARKBIT, XUNMARK): Remove. + * m/news-r6.h (XUNMARK): Remove. + * m/mips.h (XUNMARK): Remove. + * m/mips-siemens.h (XUNMARK): Remove. + * m/iris4d.h (XUNMARK): Remove. + * m/hp800.h (XMARKBIT, XUNMARK): Remove. + +2003-09-11 Stefan Monnier <monnier@iro.umontreal.ca> + + * lisp.h (VALBITS): Don't remove 1 for the markbit. + (union Lisp_Object): Use unsigned int for types. Remove markbit. + (MARKBIT): Remove 1 from VALBITS so we still use same old val. + (XTYPE): Use unsigned right-shift. + (XMARKBIT, XMARK, XUNMARK): Remove. + + * alloc.c (init_intervals, init_symbol, init_marker): + Don't preallocate anything. + (Fgarbage_collect, mark_object): Ignore the markbit. + + * bytecode.c (mark_byte_stack, unmark_byte_stack): Ignore the markbit. + +2003-09-08 Lute Kamstra <lute@gnu.org> + + * xdisp.c (pint2hrstr): New function. + (decode_mode_spec): Add `%i' and `%I' specs. + * buffer.c (syms_of_buffer): Document `%i' and `%I' constructs + for `mode-line-format'. + +2003-09-07 Andreas Schwab <schwab@suse.de> + + * alloc.c: Use long instead of int when casting ABLOCKS_BUSY to + avoid warning. + +2003-09-07 Eli Zaretskii <eliz@gnu.org> + + * editfns.c (region_limit): Support any non-zero value of BEGINNINGP. + +2003-09-03 Kim F. Storm <storm@cua.dk> + + * xdisp.c (get_window_cursor_type): Partially undo 2002-03-01 + change (superseded by 2002-08-30 change); the default blink-off + cursor is now again "no cursor". + +2003-09-01 Jason Rumney <jasonr@gnu.org> + + * makefile.w32-in (alloca.o): Remove. + (coding.o): Depend on intervals.h + (emacs.o, bytecode.o): Depend on window.h. + +2003-09-01 Dave Love <fx@gnu.org> + + * Makefile.in (alloca.o): Remove commands. + (coding.o): Depend on intervals.h composite.h window.h. + (emacs.o): Depend on window.h keyboard.h keymap.h. + (gtkutil.o): Depend on keyboard.h charset.h coding.h. + (bytecode.o): Depend on window.h. + +2003-08-31 Jason Rumney <jasonr@gnu.org> + + * w32term.c (w32_per_char_metric): Allow cached metrics to be + returned even when font_type is unknown. + + * xdisp.c (init_iterator): Remove old WINDOWSNT conditional. + +2003-08-30 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.c (x_term_init): Initialize new fields in x_display_info. + + * xterm.h (struct x_display_info): Add red/green/blue_bits and + *_offset. + + * xfns.c (lookup_rgb_color): Use new fields in x_display_info to + calculate pixel value. + +2003-08-29 Gerd Moellmann <gerd.moellmann@t-online.de> + + * xdisp.c (redisplay_internal): Fix change of 2003-04-30. + Don't tell redisplay display is accurate when it's actually been + paused for pending input. + +2003-08-29 Richard M. Stallman <rms@gnu.org> + + * dispnew.c (adjust_glyph_matrix): Call window_box + whenever W is nonzero. + + * data.c (Fmake_variable_buffer_local, Fmake_local_variable) + (Fkill_local_variable, Fmake_variable_frame_local) + (Flocal_variable_p, Flocal_variable_if_set_p): + Use indirect_variable to trace thru variable aliases. + + * config.in: Updated. + + * callint.c (Fcall_interactively): Save and restore + Vthis_command, Vthis_original_command, real_this_command, + and current_kboard->Vlast_command. + + * abbrev.c (Fexpand_abbrev): Insert before deleting. + +2003-08-29 Gerd Moellmann <gerd@gnu.org> + + * xfns.c (lookup_rgb_color): Handle TrueColor visuals specially. + +2003-08-28 David Abrahams <dave@boost-consulting.com> (tiny change) + + * coding.c (decode_coding_iso2022): Initialize local variable c2. + (decode_coding_sjis_big5): Likewise. + +2003-08-27 Jason Rumney <jasonr@gnu.org> + + * w32.c (sys_pipe): Protect against file descriptor overflow. + + * w32fns.c (syms_of_w32fns): Remove non-existent functions. + + * w32term.c (w32_read_socket): Fix WM_MOUSEWHEEL assignment. + +2003-08-26 Terje Rosten <terjeros@phys.ntnu.no> + + * xfns.c (Vgtk_version_string): New variable. + (syms_of_xfns): DEFVAR_LISP it. Provide gtk. + +2003-08-24 Eli Zaretskii <eliz@gnu.org> + + * term.c (term_init): Remove `const' from buffer_size's declaration. + + * Makefile.in (msdos.o): Depend on intervals.h. + + * msdos.c: Include intervals.h, since STRING_INTERVALS requires that. + +2003-08-21 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.h (struct x_display_info): New fields: client_leader_window + and Xatom_wm_client_leader. + + * xterm.c (x_initialize): Move call to x_session_initialize to ... + (x_term_init): ... here. Initialize client_leader fields in dpyinfo. + + * xsmfns.c (create_client_leader_window): New function. + (x_session_initialize): Call create_client_leader_window, take + dpyinfo as argument. + + * xfns.c (Fx_create_frame): Set property WM_CLIENT_LEADER. + + * Makefile.in (xsmfns.o): Add more depenedencies. + +2003-08-21 Dave Love <fx@gnu.org> + + * m/iris4d.h: Use _MIPS_SZLONG, not _LP64. + +2003-08-21 Kenichi Handa <handa@m17n.org> + + * term.c (term_init): Fix previous change; don't rely on the + length of `buffer' if TERMINFO is defined. + +2003-08-20 Dave Love <fx@gnu.org> + + * atimer.h: Include lisp.h. + + * lisp.h (EMACS_LISP_H): New. + (popup_activated_flag): Don't declare. + + * alloca.c: Some merging with gnulib. Change logic and doc + concerning (x)malloc/(x)free -- no longer Emacs-specific. + [DO_BLOCK_INPUT]: Don't include lisp.h. + (xmalloc, xfree): Declare. + (malloc): Don't declare. + + * Makefile.in (LWLIB_OPTIONS): Remove (unused). + (alloca.o): Remove obsolete stuff concerning alloca.s. Depend on + atimer.h, blockinput.h. + + * alloc.c (lisp_align_malloc): Change type of `aligned'. + + * alloca.s: Remove. + +2003-08-19 Gerd Moellmann <gerd@gnu.org> + + * s/freebsd.h [__FreeBSD_version >= 400000]: Define TERMINFO, + use -lncurses. + + * term.c (term_init): Use a buffer of size 4096 for tgetent since + FreeBSD returns something longer than 2044. Abort if the end of + the buffer is overwritten. + +2003-08-19 Miles Bader <miles@gnu.org> + + * xterm.c (x_term_init): Correctly use result of Ffile_readable_p. + +2003-08-19 Gerd Moellmann <gerd@gnu.org> + + * alloc.c (lisp_align_malloc): Check for memory full when + allocating ablocks, which also avoids freeing a pointer into an + ablocks structure. + + * puresize.h (BASE_PURESIZE): Increase to 1100000. + + * buffer.c (Fmove_overlay): Set overlay's next pointer unconditionally. + +2003-08-16 Richard M. Stallman <rms@gnu.org> + + * editfns.c (Fencode_time): Doc fix. + +2003-08-16 David Ponce <david@dponce.com> + + * fileio.c (Fwrite_region): Fix conditional expression to issue + the right message. + +2003-08-16 Juri Linkov <juri@jurta.org> + + * syntax.c (Fforward_word): Argument changed to optional. + Set default value to 1. + +2003-08-15 Kenichi Handa <handa@m17n.org> + + * xfaces.c (better_font_p): Prefer a real scalable font; i.e. not + what autoscaled. + (best_matching_font): Once we find a better scalable font, set + non_scalable_has_exact_height_p to 1. + (try_font_list): Call try_alternative_families to try any family + with the given registry. + +2003-08-09 Andreas Schwab <schwab@suse.de> + + * alloc.c (mark_object): Handle Lisp_Misc_Save_Value. + + * print.c (print_string): Fix printing of multibyte string with + nontrivial printcharfun. + +2003-07-31 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xfns.c (xg_set_icon): Rewrite to compile with GTK 2.0 and 2.2. + + * xterm.c (x_bitmap_icon): Return if xg_set_icon succeeds. + +2003-07-31 Kenichi Handa <handa@m17n.org> + + * process.c (read_process_output): Return the actually read bytes + instead of the result of decoding. + +2003-07-31 Kenichi Handa <handa@m17n.org> + + * xterm.h (struct x_bitmap_record): New member have_mask. + + * xfns.c (x_create_bitmap_from_data): Initialize have_mask member + to 0. + (x_create_bitmap_from_file): Likewise. + (x_destroy_bitmap): Check have_mask member before freeing a mask. + (x_destroy_all_bitmaps): Likewise. + (x_create_bitmap_mask): Set have_mask member to 1. + +2003-07-30 Richard M. Stallman <rms@gnu.org> + + * Makefile.in (CFLAGS) [!OPTIMIZE]: Undo previous change. + +2003-07-29 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (xg_mark_data): Update calls to mark_object. + +2003-07-29 Richard M. Stallman <rms@gnu.org> + + * xterm.c (xim_open_dpy, xim_initialize, xim_close_dpy): + Conditionalize XIM code on HAVE_XIM. + + * fns.c (Fclear_string): New function. + (syms_of_fns): defsubr it. + +2003-07-28 KOBAYASHI Yasuhiro <kobayays@otsukakj.co.jp> + + * xfns.c (xic_set_preeditarea): Add the left fringe width to spot.x. + +2003-07-22 Stefan Monnier <monnier@cs.yale.edu> + + * xfns.c: Don't check HAVE_PNG_H: autoconf doesn't seem to find it. + + * buffer.c (delete_all_overlays): New function. + * buffer.h (delete_all_overlays): Declare. + * coding.c (run_pre_post_conversion_on_str): + * print.c (temp_output_buffer_setup): + * fileio.c (Finsert_file_contents): + * minibuf.c (get_minibuffer): Use it. + +2003-07-22 Andrew Choi <akochoi@shaw.ca> + + * unexmacosx.c (unexec_regions_sort_compare): + (unexec_regions_merge): New functions. Sort and merge unexec + regions before dumping them. + +2003-07-22 Dave Love <fx@gnu.org> + + * xfns.c [HAVE_PNG]: Consider both png.h and libpng/png.h. + +2003-07-21 Stefan Monnier <monnier@cs.yale.edu> + + * alloc.c (MARK_STRING, UNMARK_STRING, STRING_MARKED_P) + (GC_STRING_CHARS, string_bytes): Use ARRAY_MARK_FLAG rather than + MARKBIT as the gcmarkbit for strings. + +2003-07-21 Richard M. Stallman <rms@gnu.org> + + * s/openbsd.h (LD_SWITCH_SYSTEM_TEMACS): Add undef. + + * fns.c (Flocale_info): Rename from Flanginfo. Doc fixes. + (syms_of_fns): Corresponding change. + + * alloc.c (syms_of_alloc): Doc fixes. + +2003-07-20 Han Boetes <han@mijncomputer.nl> (tiny change) + + * s/netbsd.h: Use -Wl syntax. + +2003-07-17 Richard M. Stallman <rms@gnu.org> + + * xterm.c (xim_initialize): Redo 6/24 change. + +2003-07-15 Stefan Monnier <monnier@cs.yale.edu> + + * buffer.c (copy_overlays): Use EMACS_INT for positions. + (Fswitch_to_buffer): Don't signal an error when switching to the same + buffer in a dedicated window. + + * alloc.c: Use bitmaps for cons, as was done for floats. + (init_float, init_cons): Let the normal code allocate the first block. + (CONS_BLOCK_SIZE): Redefine based on BLOCK_BYTES and bitmap size. + (CONS_BLOCK, CONS_INDEX, CONS_MARKED_P, CONS_MARK, CONS_UNMARK): + New macros. + (struct cons_block): Move conses to the beginning. Add gcmarkbits. + (Fcons): Use lisp_align_malloc and CONS_UNMARK. + (live_cons_p): Check the pointer is not past the `conses' array. + (mark_maybe_object, mark_maybe_pointer): Use CONS_MARKED_P. + (mark_object, mark_buffer): Use CONS_MARKED_P and CONS_MARK. + (survives_gc_p): Use CONS_MARKED_P and simplify. + (gc_sweep): Use CONS_MARKED_P, CONS_UNMARK, and lisp_align_free. + +2003-07-13 Paul Eggert <eggert@twinsun.com> + + GCC 3.3 (sparc) no longer puts "int foo = 0;" into data; it + puts it into BSS instead, at least on Solaris 8 and 9. + This is a valid optimization, and it may occur on other platforms, + so Emacs should not assume that initializing a static variable to + zero puts it into data. + * alloc.c (pure, staticvec): + Initialize these arrays to nonzero, so that they're not + put into BSS by that optimization. + +2003-07-13 Stefan Monnier <monnier@cs.yale.edu> + + * alloc.c (BLOCK_PADDING): Rename from ABLOCKS_PADDING. Update users. + (lisp_align_malloc): Use posix_memalign is available. + (ABLOCKS_BASE): Use HAVE_POSIX_MEMALIGN as an optimization. + (STRING_BLOCK_SIZE): Rename from STRINGS_IN_STRING_BLOCK + for consistency. Update users. + +2003-07-13 Richard M. Stallman <rms@gnu.org> + + * s/netbsd.h (START_FILES_1, END_FILES_1): Always define them. + +2003-07-13 Terje Rosten <terjeros@phys.ntnu.no> + + * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap): Modify to add mask, + and use the Gtk+ function gtk_window_icon_from_file if available. + + * xfns.c (x_bitmap_mask, x_create_bitmap_mask): New functions to + handle mask of bitmaps. + (x_allocate_bitmap_record, x_destroy_bitmap): Modify to handle the + mask property. + (xg_set_icon): New function, wrapper for gtk_window_icon_from_file. + + * xterm.h (xg_set_icon): New function. + +2003-07-12 Paul Eggert <eggert@twinsun.com> + + * unexelf.c (unexec): Consider a section to precede the .bss + section if its addresses overlap that of .bss. + +2003-07-12 Richard M. Stallman <rms@gnu.org> + + * Makefile.in (CFLAGS) [!OPTIMIZE]: Set CFLAGS to -g. + + * config.in (HAVE_CRTIN): Add #undef. + (INLINE): Really inline only if OPTIMIZE is defined. + + * s/netbsd.h (START_FILES, LIB_STANDARD): Use START_FILES_1, + END_FILES_1. + (START_FILES_1, END_FILES_1): New macros (conditional). + (LD_SWITCH_SYSTEM_TEMACS): Define. + + * s/openbsd.h: Don't include bsd4-3.h. + (TERMINFO): Define. + (LIBS_TERMCAP): Define. + (LD_SWITCH_SYSTEM): Define (two definitions). + + * xfns.c: Include libpng/png.h instead of png.h. + +2003-07-11 Andreas Schwab <schwab@suse.de> + + * buffer.c (modify_overlay): Update prototype. + * lisp.h (adjust_overlays_for_insert, adjust_overlays_for_delete): + Likewise. + +2003-07-09 Stefan Monnier <monnier@cs.yale.edu> + + * lisp.h (VALBITS): Define in terms of GCTYPEBITS. + (struct interval): Move to intervals.h. + (struct Lisp_Marker): Use EMACS_INT for position info. + (forward_point): Remove prototype of defunct function. + (Qmodification_hooks, Qrear_nonsticky, Fnext_property_change) + (Fget_text_property, Fset_text_properties, Ftext_propertes_not_all) + (syms_of_textprop, set_text_properties): Remove prototypes that are + already in intervals.h. + + * intervals.h (struct interval): Move from lisp.h. + Use EMACS_INT for position and size info. + + * coding.c: Include intervals.h for Fset_text_properties. + + * buffer.h (struct buffer_text, struct buffer): Use EMACS_INT for + position and length information. + +2003-07-09 Stefan Monnier <monnier@cs.yale.edu> + + * buffer.h (struct buffer_text, struct buffer): Use EMACS_INT for + position and length information. + +2003-07-09 Stefan Monnier <monnier@cs.yale.edu> + + Change overlays_after and overlays_before so the overlays themselves + are linked into lists, rather than using cons cells. After all each + Lisp_Misc already occupies 5 words, so we can add a `next' field to + Lisp_Overlay for free and save up one cons cell per overlay (not + to mention one indirection when traversing the list of overlay). + + * lisp.h (struct Lisp_Overlay): New field `next'. + + * buffer.h (struct buffer): Change overlays_before and overlays_after + from Lisp lists of overlays to pointers to overlays. + + * buffer.c (overlay_strings, recenter_overlay_lists): + Fix typo in eassert in last commit. + (unchain_overlay): New function. + (add_overlay_mod_hooklist): Use AREF. + (copy_overlays, reset_buffer, overlays_at, overlays_in) + (overlay_touches_p, overlay_strings, recenter_overlay_lists) + (fix_overlays_in_range, fix_overlays_before, Fmake_overlay) + (Fmove_overlay, Fdelete_overlay, Foverlay_lists) + (report_overlay_modification, evaporate_overlays, init_buffer_once): + Adjust to new type of overlays_(before|after). + + * alloc.c (mark_object): Mark the new `next' field of overlays. + (mark_buffer): Manually mark the overlays_(after|before) fields. + + * coding.c (run_pre_post_conversion_on_str): + * editfns.c (overlays_around): + * xdisp.c (load_overlay_strings): + * fileio.c (Finsert_file_contents): + * indent.c (current_column): + * insdel.c (signal_before_change, signal_after_change): + * intervals.c (set_point_both): + * print.c (temp_output_buffer_setup): Use new type for + overlays_(before|after). + +2003-07-08 Stefan Monnier <monnier@cs.yale.edu> + + * buffer.c (report_overlay_modification): Don't run hooks while + traversing the list of overlays. + + * buffer.h (struct buffer): Use an int for overlay_center. + (overlays_at, evaporate_overlays, recenter_overlay_lists) + (overlay_strings, fix_overlays_before): Use EMACS_INT for positions. + + * buffer.c (reset_buffer, recenter_overlay_lists) + (adjust_overlays_for_insert, adjust_overlays_for_delete) + (fix_overlays_in_range, Fmake_overlay, Fmove_overlay) + (evaporate_overlays, init_buffer_once): Update use of overlay_center. + (overlays_at, evaporate_overlays, recenter_overlay_lists) + (overlay_strings, fix_overlays_before): Use EMACS_INT for positions. + + * xdisp.c (fast_find_position): Remove unused var. + + * cmds.c (Qexpand_abbrev): New sym. + (syms_of_cmds): Initialize it. + (internal_self_insert): Use it to call expand-abbrev. + +2003-07-09 Kim F. Storm <storm@cua.dk> + + * xterm.c (use_xim) [!USE_XIM]: Default to disable XIM if Emacs + was configured with --without-xim. + (x_term_init) [!USE_XIM]: Use `useXIM' resource to turn on XIM. + +2003-07-07 Richard M. Stallman <rms@gnu.org> + + * xdisp.c (reseat_1): Set it->area to TEXT_AREA. + + * alloc.c (Fgarbage_collect): Doc fix. + +2003-07-07 Nozomu Ando <nand@mac.com> + + * buffer.c (Fkill_buffer): Clear charpos cache if necessary. + +2003-07-06 Stefan Monnier <monnier@cs.yale.edu> + + * minibuf.c (read_minibuf): UNGCPRO before returning. + (Ftry_completion, Fall_completions): Doc fix. + + * alloc.c (live_float_p): Check that p is not past the `floats' array, + now that `floats' is not the last element of the struct any more. + +2003-07-06 Jason Rumney <jasonr@gnu.org> + + * w32term.h (ClipboardSequence_Proc): New type. + + * w32fns.c (clipboard_sequence_fn): New variable. + (globals_of_w32fns): Initialize it. + + * w32select.c (last_clipboard_sequence_number): New variable. + (Fw32_set_clipboard_data, Fw32_get_clipboard_data): Use sequence + number if possible. + +2003-07-06 Stefan Monnier <monnier@cs.yale.edu> + + * m/amdx86-64.h (MARKBIT): + * m/ia64.h (MARKBIT): Remove definition since lisp.h does not compare + MARKBIT and ARRAY_MARK_FLAG any more. + + * m/hp800.h (XSETMARKBIT): + * m/sr2k.h (XSETMARKBIT): + * lisp.h (XSETMARKBIT): Remove unused macro. + + * lisp.h (mark_object): Change prototype. + + * alloc.c (mark_object): Change arg *Lisp_Object -> Lisp_Object. + (last_marked): Change accordingly. + (mark_interval, mark_maybe_object, mark_maybe_pointer) + (Fgarbage_collect, mark_glyph_matrix, mark_face_cache, mark_image) + (mark_buffer): Update calls to mark_object. + + * bytecode.c (mark_byte_stack): + * fns.c (sweep_weak_table): + * keyboard.c (mark_kboards): Update calls to mark_object. + +2003-07-06 Jason Rumney <jasonr@gnu.org> + + * alloc.c (struct ablock): Only include padding when there is some. + +2003-07-04 Stefan Monnier <monnier@cs.yale.edu> + + * alloc.c (ALIGN): Add casts to simplify usage. + (BLOCK_ALIGN, BLOCK_BYTES, ABLOCKS_PADDING, ABLOCKS_SIZE) + (ABLOCKS_BYTES, ABLOCK_ABASE, ABLOCKS_BUSY, ABLOCKS_BASE): New macros. + (struct ablock, struct ablocks): New types. + (free_ablock): New global var. + (lisp_align_malloc, lisp_align_free): New functions. + (FLOAT_BLOCK_SIZE): Redefine in terms of BLOCK_BYTES. + (struct float_block): Reorder and add gcmarkbits. + (GETMARKBIT, SETMARKBIT, UNSETMARKBIT, FLOAT_BLOCK, FLOAT_INDEX) + (FLOAT_MARKED_P, FLOAT_MARK, FLOAT_UNMARK): New macros. + (init_float, make_float): Use lisp_align_malloc. + (free_float, live_float_p): Don't use `type' any more. + (make_float): Use FLOAT_UNMARK to access to mark bit. + (mark_maybe_object, mark_maybe_pointer, survives_gc_p): + Use FLOAT_MARKED_P to access the mark bit. + (pure_alloc): Simplify use of ALIGN. + (mark_object): Use FLOAT_MARK to access the mark bit. + (gc_sweep): Use new macros to access the float's mark bit. + (init_alloc_once): Init free_ablock. + + * lisp.h (struct Lisp_Float): Remove unused field `type'. + +2003-06-27 Stefan Monnier <monnier@cs.yale.edu> + + * alloc.c (VECTOR_MARK, VECTOR_UNMARK, VECTOR_MARKED_P): New macros. + (GC_STRING_BYTES): Don't mask markbit (it's only used on `size'). + (allocate_buffer): Move. + (string_bytes): Don't mask markbit of `size_byte'. + (mark_maybe_object, mark_maybe_pointer, Fgarbage_collect) + (mark_object, mark_buffer, survives_gc_p, gc_sweep): + Use the `size' field of buffers (rather than the `name' field) for + the mark bit, as is done for all other vectorlike objects. + Use the new macros to access the mark bit of vectorlike objects. + +2003-06-26 Richard M. Stallman <rms@gnu.org> + + * puresize.h (BASE_PURESIZE): Increment base size. + + * xdisp.c (fast_find_position): Enable Gerd's new definition. + + * xterm.c (xim_initialize): Undo previous change. + +2003-06-26 Stefan Monnier <monnier@cs.yale.edu> + + * alloc.c (survives_gc_p): Simplify. + + * buffer.c (set_buffer_internal_1): Test CONSP for lists. + + * window.c (Fset_window_dedicated_p): Simplify. + (display_buffer_1): Don't raise the win from which minibuf was entered. + (temp_output_buffer_show): Don't assume BEG == 1. Simplify. + (Fminibuffer_selected_window): Simplify. + + * buffer.h (struct buffer_text): Lisp_Object `markers' => Lisp_Marker. + + * lisp.h (unchain_marker): Lisp_Object arg => Lisp_Marker. + (struct Lisp_Marker): Lisp_Object `chain' => Lisp_Marker `next'. + + * insdel.c (check_markers, adjust_markers_for_delete) + (adjust_markers_for_insert, adjust_markers_for_replace) + (prepare_to_modify_buffer, RESTORE_VALUE): + * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos) + (Fset_marker, set_marker_restricted, set_marker_both, unchain_marker) + (set_marker_restricted_both, Fbuffer_has_markers_at, count_markers): + * alloc.c (Fmake_marker, free_marker, gc_sweep): + * buffer.c (Fget_buffer_create, Fkill_buffer, Fset_buffer_multibyte): + * editfns.c (save_excursion_restore, transpose_markers): + * window.c (delete_window): + * xdisp.c (message_dolog): Update for new types. + +2003-06-26 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xfaces.c (set_font_frame_param): Set default_face_done_p to zero. + (realize_default_face): Use default_face_done_p for the force_p + argument to set_lface_from_font_name. Set default_face_done_p to one. + + * frame.c (make_frame): Initialize default_face_done_p. + + * frame.h (struct frame): Add default_face_done_p. + + * config.in: Add XRegisterIMInstantiateCallback_arg6 so it + will be defined. + +2003-06-25 Stefan Monnier <monnier@cs.yale.edu> + + * alloc.c (make_interval, Fmake_symbol, allocate_misc): + Initialize the new field `gcmarkbit'. + (mark_interval, MARK_INTERVAL_TREE): Use the new `gcmarkbit' field. + (mark_interval_tree): Don't mark the tree separately from the nodes. + (UNMARK_BALANCE_INTERVALS): Don't unmark the tree. + (mark_maybe_object, mark_maybe_pointer, Fgarbage_collect) + (mark_object, survives_gc_p, gc_sweep): Use new `gcmarkbit' fields. + + * lisp.h (struct interval, struct Lisp_Symbol, struct Lisp_Free) + (struct Lisp_Marker, struct Lisp_Intfwd, struct Lisp_Boolfwd) + (struct Lisp_Kboard_Objfwd, struct Lisp_Save_Value) + (struct Lisp_Buffer_Local_Value, struct Lisp_Overlay) + (struct Lisp_Objfwd, struct Lisp_Buffer_Objfwd): Add `gcmarkbit' field. + +2003-06-24 Dave Love <fx@gnu.org> + + * xterm.c (xim_initialize): Use XRegisterIMInstantiateCallback_arg6. + + * strftime.c: Test HAVE_SYS__MBSTATE_H, not __hpux. Merge changes + from gnulib. + +2003-06-21 Richard M. Stallman <rms@gnu.org> + + * fileio.c (Fwrite_region): Alternate messages + for append and partial write. + + * keyboard.c (read_key_sequence): When converting upcase fn key to + downcase, update fkey and keytran so `backspace' gets translated. + + * keyboard.c (read_avail_input): Don't signal SIGHUP in batch mode. + + * process.c (wait_reading_process_input): Don't signal SIGIO + in batch mode. + +2003-06-17 Kenichi Handa <handa@m17n.org> + + * Makefile.in (xselect.o): Don't depend on charset.h, coding.h, + composite.h. + + * xselect.c: Don't include charset.h, coding.h, composite.h. + (Qforeign_selection): New variable. + (syms_of_xselect): Intern and static it. + (selection_data_to_lisp_data): Return a unibyte string made from + data with `foreign-selection' text property. + +2003-06-15 Stefan Monnier <monnier@cs.yale.edu> + + * termhooks.h (EVENT_INIT): New macro. + + * keyboard.c (mark_kboards): Move from alloc.c. Mark kbd_buffer. + + * alloc.c (mark_kboards): Move to keyboard.c. + + * keyboard.c (record_asynch_buffer_change, read_avail_input): + * xterm.c (x_dispatch_event): + * xmenu.c (find_and_call_menu_selection): + * xdisp.c (handle_tool_bar_click): + * w32menu.c (menubar_selection_callback): + * sysdep.c (kbd_input_ast, read_input_waiting): + * msdos.c (dos_rawgetc): + * macterm.c (mac_check_for_quit_char): + * macmenu.c (menubar_selection_callback): + * gtkutil.c (xg_tool_bar_callback): Don't pass uninitialized + data to kbd_buffer_store_event. + +2003-06-15 Kim F. Storm <storm@cua.dk> + + * xdisp.c (x_fix_overlapping_area): Always use area relative X + to fix redisplay problem with tall characters (such as ,AC(B). + +2003-06-13 Kai Gro,A_(Bjohann <kai.grossjohann@gmx.net> + + * fileio.c (Fcopy_file): Doc fix: copies file modes, too. + +2003-06-12 Kenichi Handa <handa@m17n.org> + + * fileio.c (Fwrite_region): Save and restore restriction. + +2003-06-12 Dave Love <fx@gnu.org> + + * alloca.c (alloca): Declare arg as size_t. + + * sysdep.c: Remove redundant include of unistd.h, stdlib.h. + Use HAVE_DECL_SYS_SIGLIST, not SYS_SIGLIST_DECLARED. + +2003-06-11 Dave Love <fx@gnu.org> + + * search.c (shrink_regexp_cache): Use xrealloc. + (syms_of_search): Use xmalloc. + +2003-06-10 Kim F. Storm <storm@cua.dk> + + * xdisp.c (phys_cursor_in_rect_p): Fix 2003-05-24 change. + Adjust phys_cursor.x to be relative to window box, rather than + text area before checking -- to ensure cursor is redrawn when + exposing window. + Note: This also fixes a similar (older) bug if display margins + are present. + +2003-06-06 Kenichi Handa <handa@m17n.org> + + * coding.c (encoding_buffer_size): If coding->type is + coding_type_ccl, double magnification on CRLF encoding. + +2003-06-06 Jason Rumney <jasonr@gnu.org> + + * w32reg.c (SYSTEM_DEFAULT_RESOURCES): New constant. + (w32_get_string_resource): Try SYSTEM_DEFAULT_RESOURCES last. + + * xfaces.c (Finternal_face_x_get_resource): Do it on Windows and + Mac too. + +2003-06-05 Dave Love <fx@gnu.org> + + * strftime.c: Merge changes from gnulib. + + * mktime.c (__mktime_internal): Merge changes from gnulib + involving year 69 and dst2. + + Changes to merge with gnulib version and be consistent with the + autoconf test: + + * getloadavg.c: Set NLIST_STRUCT from HAVE_NLIST_H. + Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not NLIST_NAME_UNION. + [HAVE_LOCALE_H]: Include locale.h. + (getloadavg) [HAVE_SETLOCALE]: Run sscanf in C locale. + +2003-06-05 Kim F. Storm <storm@cua.dk> + + * window.c (coordinates_in_window): Convert X and Y to window + relative coordinates inside mode-line and header-line parts. + Convert X and Y to margin area relative coordinates inside left + and right display margin parts. + +2003-06-05 Jason Rumney <jasonr@gnu.org> + + * w32fns.c (add_system_logical_colors_to_map): New function. + (Fx_open_connection): Use it. + +2003-06-04 Stefan Monnier <monnier@cs.yale.edu> + + * process.c (allocate_pty): Revert part of the previous patch. + (Faccept_process_output): Simplify. + +2003-06-04 Jason Rumney <jasonr@gnu.org> + + * termhooks.h (enum event_kind): Remove MOUSE_WHEEL_EVENT. + + * keyboard.c (Qmouse_wheel, mouse_wheel_syms) + (lispy_mouse_wheel_names): Remove. + (syms_of_keyboard): Remove Qmouse_wheel and mouse_wheel_syms. + Always define drag_and_drop_syms. + + * macterm.c (XTread_socket): Map mouse wheel events to Emacs + WHEEL_EVENT events. + +2003-06-03 Stefan Monnier <monnier@cs.yale.edu> + + * xdisp.c (update_tool_bar): Add missing UNGCPRO. + + * buffer.c (init_buffer_once): Make kill-buffer-hook permanent-local. + +2003-06-03 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (make_menu_item): Make sure we don't crash on a NULL + menu item label. + +2003-06-03 Richard M. Stallman <rms@gnu.org> + + * window.c (Fwindow_edges): Doc fix. + (Fwindow_pixel_edges, Fwindow_inside_edges) + (Fwindow_inside_pixel_edges): New functions. + (syms_of_window): defsubr them. + + * window.h (WINDOW_LEFT_FRINGE_COLS, WINDOW_RIGHT_FRINGE_COLS) + (WINDOW_MODE_LINE_LINES, WINDOW_HEADER_LINE_LINES): New macros. + +2003-06-02 Stefan Monnier <monnier@cs.yale.edu> + + * dispnew.c (Fsit_for): Don't lie about the number of args. + +2003-06-02 Dave Love <fx@gnu.org> + + * callproc.c: Use HAVE_FCNTL_H, not USG5. + (syms_of_callproc) <process-environment>: Doc fix. + + * doc.c: Use HAVE_FCNTL_H, not USG5. + + * xfaces.c (font_rescale_ratio): Fix for K&R. + + * termcap.c: Use HAVE_FCNTL_H, not _POSIX_VERSION. + + * mem-limits.h: Use HAVE_SYS_RESOURCE_H, HAVE_SYS_VLIMIT_H. + + * lread.c [HAVE_FCNTL_H]: Include fcntl.h. + + * gtkutil.c: Include keyboard.h, charset.h, coding.h. + (xg_create_frame_widgets): Use ENCODE_UTF_8. + + * xterm.c (Qutf_8): Move to coding.c. + + * xmenu.c (ENCODE_MENU_STRING): New. + (list_of_panes, list_of_items, digest_single_submenu, xmenu_show): + Use it. + + * coding.h (ENCODE_UTF_8): New. + (Qutf_8): Declare. + + * coding.c (Qutf_8): New. + (syms_of_coding): Intern it. + + * fns.c: Doc fixes. + +2003-06-02 Kenichi Handa <handa@m17n.org> + + * buffer.c (Fset_buffer_multibyte): Fix previous change. + +2003-06-01 Stefan Monnier <monnier@cs.yale.edu> + + * lread.c (openp): Make sure STR is a string. + +2003-06-01 David Ponce <david@dponce.com> + + * termhooks.h (enum event_kind): Add new WHEEL_EVENT event. + Declare MOUSE_WHEEL_EVENT only if MAC_OSX defined. + + * keyboard.c (Qmouse_wheel): Declare only if MAC_OSX defined. + (mouse_wheel_syms, lispy_mouse_wheel_names): Likewise. + (discard_mouse_events): Discard WHEEL_EVENT events too. + (lispy_wheel_names, wheel_syms): New. + (syms_of_keyboard): Init and staticpro `wheel_syms'. Init and + staticpro `Qmouse_wheel' and `mouse_wheel_syms' only if MAC_OSX defined. + (make_lispy_event): Add WHEEL_EVENT handler. + + * w32term.c (construct_mouse_wheel): Construct WHEEL_EVENT. + (w32_read_socket): Map w32 WM_MOUSEWHEEL events to Emacs + WHEEL_EVENT events. + +2003-05-31 John Paul Wallington <jpw@gnu.org> + + * Makefile.in (lisp, shortlisp): byte-run, float-sup, map-ynp, and + timer are in lisp/emacs-lisp. + +2003-05-31 Kenichi Handa <handa@m17n.org> + + * buffer.c (Fset_buffer_multibyte): Correctly recover a narrowed + region when a buffer is changed to unibyte. + + * charset.h (VALID_LEADING_CODE_P): New macro. + (UNIBYTE_STR_AS_MULTIBYTE_P): Check more rigidly. + + * coding.c (DECODE_EMACS_MULE_COMPOSITION_CHAR): If coding->flags + is nonzero, accept multibyte form of eight-bit-control chars. + (decode_composition_emacs_mule): Likewise. + (decode_coding_emacs_mule): Likewise. + (encode_coding_emacs_mule): If coding->flags is nonzero, produce + multibyte form of eight-bit-control chars. + + * fileio.c (Qauto_save_coding, auto_save_coding): New variables. + (Finsert_file_contents): If coding-system-for-read is bound to + Qauto_save_coding, use the coding system emacs-mule with special + setting for recovering a file. + (choose_write_coding_system): On auto saving, use the coding + system emacs-mule with special setting for auto saving. + (syms_of_fileio) <Qauto_save_coding>: Intern and staticpro it. + +2003-05-30 Kenichi Handa <handa@m17n.org> + + * coding.c (ccl_coding_driver): Set ccl->eight_bit_control + properly before calling ccl_driver. + + * ccl.h (struct ccl_program) <eight_bit_control>: Comment fixed. + + * ccl.c (CCL_WRITE_CHAR): Increment extra_bytes only when it is nonzero. + (ccl_driver): Initialize extra_bytes to ccl->eight_bit_control. + (setup_ccl_program): Initialize ccl->eight_bit_control to zero. + +2003-05-29 Glenn Morris <gmorris@ast.cam.ac.uk> + + * xfaces.c (realize_default_face): Do not abort if lface is + non-existent - reverts change from 2003-05-19. + +2003-05-29 Kenichi Handa <handa@m17n.org> + + * coding.c (decode_coding_iso2022): Pay attention to the byte + sequence of CTEXT extended segment, and retain those bytes as is. + +2003-05-28 Kenichi Handa <handa@m17n.org> + + * coding.c (ENCODE_UNSAFE_CHARACTER): Adjust for the name change + of CODING_REPLACEMENT_CHARACTER. + (decode_coding_iso2022): If CODING_FLAG_ISO_SAFE, set + CODING_MODE_INHIBIT_UNENCODABLE_CHAR flag in coding->mode, and + check this flag on encoding. + (encode_coding_sjis_big5): + Check CODING_MODE_INHIBIT_UNENCODABLE_CHAR flag of coding->mode. + (Fset_terminal_coding_system_internal): + Set CODING_MODE_INHIBIT_UNENCODABLE_CHAR flag in terminal_coding.mode + instead of setting CODING_FLAG_ISO_SAFE flag in terminal_coding.flags. + + * coding.h (CODING_REPLACEMENT_CHARACTER): Rename from + CODING_INHIBIT_CHARACTER_SUBSTITUTION. + (CODING_MODE_INHIBIT_UNENCODABLE_CHAR): New macro. + +2003-05-28 Richard M. Stallman <rms@gnu.org> + + * print.c (syms_of_print) <print-escape-nonascii>: Doc fix. + + * eval.c (unbind_to): Move init of this_binding to separate statement. + +2003-05-28 Kim F. Storm <storm@cua.dk> + + * xdisp.c (expose_window): Fix error in calculation of + window relative coordinates of area to redisplay. + +2003-05-27 Jason Rumney <jasonr@gnu.org> + + * w32term.c (GET_WHEEL_DELTA_WPARAM): New macro. + +2003-05-27 David Ponce <david@dponce.com> + + Handle W32 mouse wheel events as mouse click events, like in X. + + * keyboard.c (make_lispy_event) [WINDOWSNT]: Don't handle + MOUSE_WHEEL_EVENT anymore. + + * w32term.c (construct_mouse_wheel): Result is a MOUSE_CLICK_EVENT. + Scrolling down/up the mouse wheel is respectively mapped to mouse + button 4 and 5. + (w32_read_socket): Map w32 WM_MOUSEWHEEL events to Emacs + MOUSE_CLICK_EVENT events. Forward w32 MSH_MOUSEWHEEL events as + WM_MOUSEWHEEL events. + +2003-05-27 Andreas Schwab <schwab@suse.de> + + * buffer.c (syms_of_buffer) <default-direction-reversed>: Doc fix. + + * xdisp.c (try_window_id): Avoid aborting if PT is inside a + partially visible line. + + * alloc.c (Fgarbage_collect): Fix last change. + +2003-05-26 John Paul Wallington <jpw@gnu.org> + + * xfns.c (Fx_create_frame): Don't call Qface_set_after_frame_default. + +2003-05-25 Stefan Monnier <monnier@cs.yale.edu> + + * window.c (Fset_window_buffer): Add type of `keep_margins'. + (Fset_window_fringes, Fset_window_scroll_bars): Declare before use. + + * window.h (window_box_text_cols): Declare. + + * xdisp.c (window_text_bottom_y, draw_row_fringe_bitmaps) + (x_draw_vertical_border): Remove unused var `f'. + + * xfaces.c (build_scalable_font_name): Remove `unused var + pixel_size' warning. + + * xfns.c (png_load): Remove `unused vars intent, image_gamma' warning. + + * unexelf.c (unexec): Remove `unused var n' warning. + + * strftime.c (my_strftime_localtime_r): Remove `defined but + unused' warning. + + * process.c (allocate_pty): Remove `unused var stb' and + `cp might be used uninitialized' warnings. + + * dispnew.c (mode_line_string): Remove unused var `f'. + + * coding.c (find_safe_codings): Remove unused var `i'. + + * bytecode.c (Fbyte_code): Remove `unused val' warning. + + * buffer.c (Fkill_buffer): Remove unused var `list'. + + * alloc.c (Fgarbage_collect): Remove `unused var tail' warning. + +2003-05-25 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * frame.c (make_frame): Condition want_fullscreen with + HAVE_WINDOW_SYSTEM. + +2003-05-25 Juanma Barranquero <lektu@terra.es> + + * window.c (Fset_window_scroll_bars): Fix typo in argument name. + (Fwindow_scroll_bars): Fix typo in docstring. + +2003-05-24 Kim F. Storm <storm@cua.dk> + + The following changes serve several purposes: + + 1) Swap the position of fringes and display margins in windows, i.e. + the fringes are now displayed between the margins and the text area + (by default). + + 2) Allow fringe and scroll bar parameters to be set per-buffer and + per-window (like display margins). Such settings are now stored + in window configurations, preserved when frames are resized, and + copied when windows are split vertically or horizontally. + Several bugs related to display margins have been fixed. + + 3) Consistently use FRAME_FONT and FRAME_FONTSET macros. + + 4) Use FRAME_COLUMN_WIDTH (f) consistently throughout the code + rather than FRAME_WIDTH (FRAME_FONT (f)). + + 5) Introduce a consistent naming of variables, members and macros + depending on whether their value is measured in pixels or in + canonical columns/lines. Pixel dimensions are named *_width and + *_height, while canonical columns/lines are named *_cols and + *_lines. Pixel positions are named *_x and *_y, while column/line + positions are named *_col and *_line. + + 6) Consolidate more of the X, W32, and MAC gui code by moving + common data into struct frame, and generalize it for the non-gui + case by using suitable defaults. + + 7) Cleanup and consolidate the macros controlling frame and window + layout into frame.h and window.h, and generalize the use of the + various window_box_* functions (enhanced to handle the new fringe + position and the per-window fringe and scroll bar settings). + + * frame.h (struct frame): Rename members height to text_lines, + width to text_cols, window_height to total_lines, window_width to + total_cols, new_height to new_text_lines, new_width to + new_text_cols. All uses changed. + (struct frame): New members which consolidate common members of + x_output, w32_output, and mac_output structures: left_pos, + top_pos, pixel_height, pixel_width, x_pixels_diff, y_pixels_diff, + win_gravity, size_hint_flags, border_width, internal_border_width, + line_height, fringe_cols, left_fringe_width, right_fringe_width, + want_fullscreen. All uses changed. + (struct frame): New member column_width contaning the canonical + column width, analogue to line_height. All uses changed. + (struct frame): Rename members scroll_bar_pixel_width to + config_scroll_bar_width, and scroll_bar_cols to + config_scroll_bar_cols. All uses changed. + (struct frame): New member scroll_bar_actual_width which + consolidates and renames the vertical_scroll_bar_extra member of + x_output, w32_output, and mac_output structures. All uses changed. + (FRAME_PIXEL_HEIGHT): Rename from PIXEL_HEIGHT and moved + from x/w32/macterm.h files. All uses changed. Also change code + which referred to f->output_data...->pixel_height. + (FRAME_PIXEL_WIDTH): Rename from PIXEL_WIDTH and moved + from x/w32/macterm.h files. All uses changed. Also change code + which referred to f->output_data...->pixel_width. + (FRAME_LINES): Rename from FRAME_HEIGHT. All uses changed. + Also change code which referred to f->height. + (FRAME_COLS): Rename from FRAME_WIDTH. All uses changed. + Also change code which referred to f->width. + (FRAME_NEW_HEIGHT, FRAME_NEW_WIDTH): Remove macros; change uses + to update new_text_lines and new_text_cols members directly. + (FRAME_CONFIG_SCROLL_BAR_WIDTH): Rename from + FRAME_SCROLL_BAR_PIXEL_WIDTH. All uses changed. + (FRAME_CONFIG_SCROLL_BAR_COLS): Rename from + FRAME_SCROLL_BAR_COLS. All uses changed. + (FRAME_LEFT_SCROLL_BAR_COLS, FRAME_RIGHT_SCROLL_BAR_COLS): + Rename from FRAME_LEFT_SCROLL_BAR_WIDTH and + FRAME_RIGHT_SCROLL_BAR_WIDTH, resp. All uses changed. + (FRAME_SCROLL_BAR_AREA_WIDTH, FRAME_LEFT_SCROLL_BAR_AREA_WIDTH) + (FRAME_RIGHT_SCROLL_BAR_AREA_WIDTH): New macros. + (FRAME_TOTAL_COLS): Rename from FRAME_WINDOW_WIDTH. + (SET_FRAME_COLS): Rename from SET_FRAME_WIDTH. + (FRAME_TOTAL_COLS_ARG): Rename from FRAME_WINDOW_WIDTH_ARG. + (WINDOW_VERTICAL_SCROLL_BAR_COLUMN): Remove unused macro. + (WINDOW_VERTICAL_SCROLL_BAR_HEIGHT): Remove unused macro. + (FRAME_LINE_HEIGHT): Rename from CANON_Y_UNIT. + Unconditionally return line_height member (it now has proper value + also for non-window frames). + (FRAME_COLUMN_WIDTH): Rename from CANON_X_UNIT. Unconditionally + return new column_width member (rather than the default font width). + (FRAME_FRINGE_COLS, FRAME_LEFT_FRINGE_WIDTH) + (FRAME_RIGHT_FRINGE_WIDTH): Rename from FRAME_X_... and moved + from x/w32/macterm.h files. Unconditionally return corresponding + member of frame structure (they now have proper values also for + non-window frames). + (FRAME_TOTAL_FRINGE_WIDTH): Rename from FRAME_FRINGE_WIDTH. + Calculate return value from left and right widths. + (FRAME_INTERNAL_BORDER_WIDTH): Unconditionally return + internal_border_width member (has proper value for non-window frame). + (FRAME_PIXEL_X_FROM_CANON_X): Rename from PIXEL_X_FROM_CANON_X. + (FRAME_PIXEL_Y_FROM_CANON_Y): Rename from PIXEL_Y_FROM_CANON_Y. + (FRAME_CANON_X_FROM_PIXEL_X): Rename from CANON_X_FROM_PIXEL_X. + (FRAME_CANON_Y_FROM_PIXEL_Y): Rename from CANON_Y_FROM_PIXEL_Y. + (FRAME_LINE_TO_PIXEL_Y): Rename from CHAR_TO_PIXEL_ROW, + consolidated from xterm.h, macterm.h, and w32term.h. + (FRAME_COL_TO_PIXEL_X): Rename from CHAR_TO_PIXEL_COL, + consolidated from xterm.h, macterm.h, and w32term.h. + (FRAME_TEXT_COLS_TO_PIXEL_WIDTH): Rename from + CHAR_TO_PIXEL_WIDTH consolidated from x/mac/w32term.h. + (FRAME_TEXT_LINES_TO_PIXEL_HEIGHT): Rename from + CHAR_TO_PIXEL_HEIGHT consolidated from x/mac/w32term.h. + (FRAME_PIXEL_Y_TO_LINE): Rename from PIXEL_TO_CHAR_ROW + consolidated from x/mac/w32term.h. + (FRAME_PIXEL_X_TO_COL): Rename from PIXEL_TO_CHAR_COL + consolidated from x/mac/w32term.h. + (FRAME_PIXEL_WIDTH_TO_TEXT_COLS): Rename from + PIXEL_TO_CHAR_WIDTH consolidated from x/mac/w32term.h. + (FRAME_PIXEL_HEIGHT_TO_TEXT_LINES): Rename from + PIXEL_TO_CHAR_HEIGHT consolidated from x/mac/w32term.h. + + * window.h (struct window): Rename members left to left_col, + top to top_line, height to total_lines, width to total_cols, + left_margin_width to left_margin_cols, right_margin_width to + right_margin_cols, orig_height to orig_total_lines, orig_top to + orig_top_line. All uses changed. + (struct window): New members left_fringe_width, right_fringe_width, + fringes_outside_margins, scroll_bar_width, vertical_scroll_bar_type. + (WINDOW_XFRAME, WINDOW_FRAME_COLUMN_WIDTH, WINDOW_FRAME_LINE_HEIGHT): + New macros primarily used to simplify other macros. + (WINDOW_TOTAL_COLS): New macro. Change relevant code that + referred to XINT (w->width). + (WINDOW_TOTAL_LINES): New macro. Change relevant code that + referred to XINT (w->height). + (WINDOW_TOTAL_WIDTH): New macro. Change relevant code that + referred to XINT (w->width) * canon_x_unit. + (WINDOW_TOTAL_HEIGHT): New macro. Change relevant code that + referred to XINT (w->height) * canon_y_unit. + (WINDOW_LEFT_EDGE_COL): New macro. Change relevant code that + referred to XINT (w->left). + (WINDOW_RIGHT_EDGE_COL): Rename from WINDOW_RIGHT_EDGE. Change + all uses and code that referred to XINT (w->left) + XINT (w->width). + (WINDOW_TOP_EDGE_LINE): New macro. Change relevant code that + referred to XINT (w->top). + (WINDOW_BOTTOM_EDGE_LINE): New macro. Change relevant code that + referred to XINT (w->top) + XINT (w->height). + (WINDOW_LEFT_EDGE_X): New macro. Change relevant code that + referred to XINT (w->left) * canon_x_unit. + (WINDOW_RIGHT_EDGE_X): New macro. Change relevant code that + referred to (XINT (w->left) + XINT (w->width)) * canon_x_unit. + (WINDOW_TOP_EDGE_Y): New macro. Change relevant code that + referred to XINT (w->top) * canon_y_unit. + (WINDOW_BOTTOM_EDGE_Y): New macro. Change relevant code that + referred to (XINT (w->top) + XINT (w->height)) * canon_y_unit. + (WINDOW_LEFTMOST_P): New macro. + (WINDOW_BOX_LEFT_EDGE_COL): Rename from WINDOW_LEFT_MARGIN. + All uses changed. + (WINDOW_BOX_RIGHT_EDGE_COL): Rename from WINDOW_RIGHT_MARGIN. + All uses changed. + (WINDOW_BOX_LEFT_EDGE_X): Rename from + WINDOW_DISPLAY_LEFT_EDGE_PIXEL_X, moved from dispextern.h. + Do not exclude left fringe width. + (WINDOW_BOX_RIGHT_EDGE_X): Rename from + WINDOW_DISPLAY_RIGHT_EDGE_PIXEL_X, moved from dispextern.h. + Do not exclude fringe widths. + (WINDOW_LEFT_FRINGE_WIDTH, WINDOW_RIGHT_FRINGE_WIDTH) + (WINDOW_FRINGE_COLS, WINDOW_TOTAL_FRINGE_WIDTH): New macros. + Change relevant code that referred to FRAME_LEFT_FRINGE_WIDTH, + FRAME_RIGHT_FRINGE_WIDTH, FRAME_FRINGE_COLS, and + FRAME_TOTAL_FRINGE_WIDTH to allow per-window fringe settings. + (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS): New macro. + (WINDOW_VERTICAL_SCROLL_BAR_TYPE, WINDOW_HAS_VERTICAL_SCROLL_BAR) + (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT) + (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT) + (WINDOW_CONFIG_SCROLL_BAR_WIDTH, WINDOW_CONFIG_SCROLL_BAR_COLS): + New macros. Change code which referenced corresponding + FRAME_VERTICAL_SCROLL_BAR_TYPE, FRAME_HAS_VERTICAL_SCROLL_BARS, + FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT, + FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT, + FRAME_SCROLL_BAR_PIXEL_WIDTH, and FRAME_SCROLL_BAR_COLS macros to + allow per-window scroll-bar settings. + (WINDOW_LEFT_SCROLL_BAR_COLS, WINDOW_RIGHT_SCROLL_BAR_COLS): New macros. + (WINDOW_LEFT_SCROLL_BAR_AREA_WIDTH): New macro. Change code that + referred to FRAME_LEFT_SCROLL_BAR_WIDTH. + (WINDOW_RIGHT_SCROLL_BAR_AREA_WIDTH): New macro. Change code + that referred to FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT and + FRAME_SCROLL_BAR_WIDTH. + (WINDOW_SCROLL_BAR_COLS, WINDOW_SCROLL_BAR_AREA_WIDTH) + (WINDOW_SCROLL_BAR_AREA_X): New macros. + (WINDOW_HEADER_LINE_HEIGHT): Rename from + WINDOW_DISPLAY_HEADER_LINE_HEIGHT, moved from dispextern.h. + (WINDOW_BOX_HEIGHT_NO_MODE_LINE): Rename from + WINDOW_DISPLAY_HEIGHT_NO_MODE_LINE, moved from dispextern.h. + (WINDOW_BOX_TEXT_HEIGHT): Rename from + WINDOW_DISPLAY_PIXEL_WIDTH, moved from dispextern.h. + (WINDOW_TO_FRAME_PIXEL_X, WINDOW_TO_FRAME_PIXEL_Y) + (FRAME_TO_WINDOW_PIXEL_X, FRAME_TO_WINDOW_PIXEL_Y) + (WINDOW_TEXT_TO_FRAME_PIXEL_X): Move here from dispextern.h. + (WINDOW_LEFT_MARGIN_WIDTH): Rename from + WINDOW_DISPLAY_LEFT_AREA_PIXEL_WIDTH, moved from dispextern.h. + (WINDOW_RIGHT_MARGIN_WIDTH): Rename from + WINDOW_DISPLAY_RIGHT_AREA_PIXEL_WIDTH, moved from dispextern.h. + (window_from_coordinates): Update prototype. + (Fset_window_buffer): Update EXFUN. + (set_window_buffer): Update prototype. + + * dispextern.h (struct glyph_matrix): Rename members window_left_x + to window_left_col, window_top_y to window_top_line. All uses + changed. + (FRAME_INTERNAL_BORDER_WIDTH_SAFE): Remove macro; can now safely + use FRAME_INTERNAL_BORDER_WIDTH macro instead as + internal_border_width is now set to 0 for non-window frames. + (WINDOW_DISPLAY_PIXEL_WIDTH, WINDOW_DISPLAY_PIXEL_HEIGHT) + (WINDOW_DISPLAY_MODE_LINE_HEIGHT, WINDOW_DISPLAY_HEADER_LINE_HEIGHT) + (WINDOW_DISPLAY_HEIGHT_NO_MODE_LINE, WINDOW_DISPLAY_TEXT_HEIGHT) + (WINDOW_DISPLAY_LEFT_EDGE_PIXEL_X, WINDOW_DISPLAY_RIGHT_EDGE_PIXEL_X) + (WINDOW_DISPLAY_TOP_EDGE_PIXEL_Y, WINDOW_DISPLAY_BOTTOM_EDGE_PIXEL_Y) + (WINDOW_TO_FRAME_PIXEL_X, WINDOW_TO_FRAME_PIXEL_Y) + (FRAME_TO_WINDOW_PIXEL_X, FRAME_TO_WINDOW_PIXEL_Y) + (WINDOW_DISPLAY_LEFT_AREA_PIXEL_WIDTH) + (WINDOW_DISPLAY_RIGHT_AREA_PIXEL_WIDTH, WINDOW_WANTS_MODELINE_P): + Move to window.h and renamed [see window.h changes]. + (WINDOW_AREA_TO_FRAME_PIXEL_X, WINDOW_AREA_PIXEL_WIDTH) + (WINDOW_DISPLAY_TEXT_AREA_PIXEL_WIDTH): Remove macros. + (WINDOW_WANTS_MODELINE_P, WINDOW_WANTS_HEADER_LINE_P): + Use WINDOW_TOTAL_LINES. + (frame_update_line_height): Remove prototype. + + * buffer.h (struct buffer): Rename members measured in columns: + left_margin_width to left_margin_cols, right_margin_width to + right_margin_cols. All uses changed. + New members left_fringe_width, right_fringe_width, + fringes_outside_margins for per-buffer fringe settings. + New members scroll_bar_width and vertical_scroll_bar_type for + per-buffer scroll bar settings. + + * buffer.c (init_buffer_once): Set buffer_defaults and + buffer_local_flags for new buffer-local variables + left_fringe_width, right_fringe_width, fringes_outside_margins, + scroll_bar_width, and vertical_scroll_bar_type. + (syms_of_buffer): Defvar_per_buffer them, and defvar_lisp_nopro + default-* variables for them. + + * dispnew.c: Make (many) trivial substitutions for renamed and + new macros in dispextern.h, frame.h and window.h. + (mode_line_string): No need to adjust width for mode lines, as it + is already adjusted by the caller. + (marginal_area_string): Handle fringes inside/outside margins. + + * frame.c: Make (many) trivial substitutions for renamed and + new macros in dispextern.h, frame.h and window.h. + (make_frame): Initialize left_fringe_width, right_fringe_width, + fringe_cols, scroll_bar_actual_width, border_width, + internal_border_width, column_width, line_height, x_pixels_diff, + y_pixels_diff, want_fullscreen, size_hint_flags, and win_gravity + members with values suitable for a non-window frames. + + * gtkutil.c: Make (many) trivial substitutions for renamed and + new macros in dispextern.h, frame.h and window.h. + + * indent.c: Make (few) trivial substitutions for renamed and + new macros in dispextern.h, frame.h and window.h. + + * keyboard.c: Make (many) trivial substitutions for renamed and + new macros in dispextern.h, frame.h and window.h. + (make_lispy_event): Use window positions returned from + window_from_coordinates when constructing the lisp event for + MOUSE_CLICK_EVENT and DRAG_N_DROP_EVENT, rather than calculating + (incorrect) values locally. + (make_lispy_movement): Use window positions returned from + window_from_coordinates when constructing the lisp event, rather + than calculating (incorrect) values locally. + + * scroll.c: Make (some) trivial substitutions for renamed and + new macros in dispextern.h, frame.h and window.h. + + * sunfns.c (Fsun_menu_internal): Adapt to per-window fringes and + scroll-bars. + + * sysdep.c: Make (few) trivial substitutions for renamed and + new macros in dispextern.h, frame.h and window.h. + + * term.c: Make (some) trivial substitutions for renamed and + new macros in dispextern.h, frame.h and window.h. + + * widget.c: Make (few) trivial substitutions for renamed and + new macros in dispextern.h, frame.h and window.h. + + * window.c: Make (many) trivial substitutions for renamed and + new macros in dispextern.h, frame.h and window.h. + (make_window): Initialize new members + left_margin_cols, right_margin_cols, left_fringe_width, + right_fringe_width, fringes_outside_margins, scroll_bar_width, + and vertical_scroll_bar_type. + (coordinates_in_window): Adapt to new fringe/margin positions + and per-window fringes and scroll-bars. + Fix bug related to incorrectly adjusting coordinates by + frame's internal_border_width (the effect normally negible since + the internal_border_width is typically 0 or 1 pixel, but very + noticeable for an internal_border_width of e.g. 25 pixels). + Upon successful return (other than ON_NOTHING), the coordinates + are now always properly converted to window relative for the + given display element. + (window_from_coordinates): Add new parameters wx and wy to + return the window relative x and y position in the returned + window and part. A null arg means, don't return the position. + All callers changed. + (adjust_window_margins): New function which may reduce the width + of the display margins if a window's text area is too small after + resizing or splitting windows. + (size_window): Fix bug that did not account for display margin + widths when checking the minimum width of a window; use + adjust_window_margins. + (set_window_buffer): Call Fset_window_fringes and + Fset_window_scroll_bars to setup per-window elements. + Add new arg KEEP_MARGINS_P. Non-nil means to keep window's + existing display margin, fringe widths, and scroll bar settings + (e.g. after splitting a window or resizing the frame). + All callers changed. + (Fset_window_buffer): New arg KEEP_MARGINS. All callers changed. + (Fsplit_window): Duplicate original window's display margin, + fringe, and scroll-bar settings; then call Fset_window_buffer with + KEEP_MARGINS non-nil. This fixes a bug which caused a split + window to only preserve the display margins in one of the windows. + When splitting horizontally, call adjust_window_margins on both + windows to ensure that the text area of the new windows is non too + narrow. This fixes a bug which could cause Emacs to trap if the + width of the split window was less than the width of the display + margins. + (window_box_text_cols): Rename from window_internal_width. + All uses changed. Adapt to per-window fringes and scroll bars. + Fix bug that caused vertical separator to be subtracted also on + window frames. Fix another bug that did not reduce the returned + value by the columns used for display margins. + (window_scroll_line_based): Fix bug related to scrolling too much + when display margins are present (implicitly fixed by the fix to + window_box_text_cols). + (scroll_left, scroll_right): Fix bug related to scrolling too far + by default when display margins are present (implicitly fixed by + the fix to window_box_text_cols). + (struct saved_window): Rename members left to left_col, top to + top_line, width to total_cols, height to total_lines, orig_top to + orig_top_line, orig_height to orig_total_lines. All uses changed. + New members left_margin_cols, right_margin_cols, + left_fringe_width, right_fringe_width, fringes_outside_margins, + scroll_bar_width, and vertical_scroll_bar_type for saving + per-window display elements. + (Fset_window_configuration): Restore display margins, fringes, + and scroll bar settings. This fixes a bug which caused display + margins to be discarded when saving and restoring a window + configuration. + (save_window_save): Save display margins, fringes, and scroll bar + settings. This fixes a bug which caused display margins to be + discarded when saving and restoring a window configuration. + (Fset_window_margins): Do nothing if display margins are not + really changed. Otherwise, call adjust_window_margins to ensure + the text area doesn't get too narrow. This fixes a bug which + could cause Emacs to trap if setting display margins wider than + the width of the window. + (Fset_window_fringes): New defun to allow user to specifically set + this window's fringe widths and position vs. display margins. + (Fwindow_fringes): New defun to return window's actual fringe settings. + (Fset_window_scroll_bars): New defun to allow user to specifically + set this window's scroll bar width and position. + (Fwindow_scroll_bars): New defun to return window's actual scroll + bar settings. + (compare_window_configurations): Also compare display margins, + fringes, and scroll bar settings. + (syms_of_window): Defsubr new defuns for fringe and scroll bars. + + * xdisp.c: Make (many) trivial substitutions for renamed and + new macros in dispextern.h, frame.h and window.h. + (window_box_width): Adapt to per-window fringes and scroll bars, + and new fringe vs. display margin position. Note that returned + value is no longer guaranteed to be a whole multiple of the frame + column width, since per-window fringes may now be any width. + (window_box_left_offset): New function like window_box_left, but + value is relative to left border of window (rather than frame). + (window_box_right_offset): New function like window_box_right, + but value is relative to left border of window. + (window_box_left): Adapt to per-window fringes and scroll bars, + and new fringe vs. display margin position. Simplify by using + WINDOW_LEFT_EDGE_X and window_box_left_offset. + (window_box): Allow null args for unnecessary return values; + change/simplify relevant callers. + (x_y_to_hpos_vpos): Adapt to per-window fringes and scroll bars, + and new fringe vs. display margin position. + Use window_box_left_offset and window_box_right_offset + (get_glyph_string_clip_rect): Adapt to per-window fringes and + scroll bars, and new fringe vs. display margin position. + Use WINDOW_LEFT_EDGE_X and WINDOW_TOTAL_WIDTH. + (draw_fringe_bitmap): Rework to handle per-window fringes and new + fringe vs. display margin position. + (hscroll_window_tree): Use window_box_width instead of window_box. + (redisplay_window): Adapt to per-window scroll bars. + (draw_glyphs): Rework to handle per-window fringes and scroll + bars, and new fringe vs. display margin position. + Use WINDOW_LEFT_EDGE_X, WINDOW_TOTAL_WIDTH, and window_box_left. + (x_clear_end_of_line): Adapt to per-window fringes and scroll + bars, and new fringe vs. display margin position. Fix bug which + increased total width of full_width rows by width of scroll bars + although window's total width already includes that. + (x_fix_overlapping_area): Simplify using window_box_left_offset. + (expose_area): Simplify using window_box_left_offset. + (x_draw_vertical_border): Handle per-window scroll bar settings, + mixing windows with left, right and no scroll bars. + + * xfaces.c [WINDOWSNT]: Move redefinition of FONT_WIDTH macro to + where it's used in x_list_fonts (for clarity). + (frame_update_line_height): Remove unused function; functionality + is now done directly when setting the default font in x_set_font. + + * xfns.c: Make (many) trivial substitutions for renamed and + new macros in dispextern.h, frame.h and window.h. + + * xmenu.c: Make (some) trivial substitutions for renamed and + new macros in dispextern.h, frame.h and window.h. + + * xterm.h (struct x_output): Move members left_pos, top_pos, + border_width, pixel_height, pixel_width, line_height, + internal_border_width, vertical_scroll_bar_extra, + left_fringe_width, right_fringe_width, fringe_cols, + fringes_extra, win_gravity, size_hint_flags, want_fullscreen, + x_pixels_diff, and y_pixels_diff to struct frame (frame.h). + (FRAME_INTERNAL_BORDER_WIDTH, FRAME_LINE_HEIGHT): Move to frame.h. + (FRAME_DEFAULT_FONT_WIDTH): Remove macro. + (PIXEL_WIDTH, PIXEL_HEIGHT) + (FRAME_X_FRINGE_COLS, FRAME_X_FRINGE_WIDTH) + (FRAME_X_LEFT_FRINGE_WIDTH, FRAME_X_RIGHT_FRINGE_WIDTH): Move to + frame.h and renamed [see frame.h changes]. + (CHAR_TO_PIXEL_ROW, CHAR_TO_PIXEL_COL, CHAR_TO_PIXEL_WIDTH) + (CHAR_TO_PIXEL_HEIGHT, PIXEL_TO_CHAR_ROW, PIXEL_TO_CHAR_COL) + (PIXEL_TO_CHAR_WIDTH, PIXEL_TO_CHAR_HEIGHT): Move to frame.h + and renamed [see frame.h changes]. + + * xterm.c: Make (several) trivial substitutions for renamed and + new macros in dispextern.h, frame.h and window.h. + (x_draw_glyph_string_box): Adapt to per-window fringes and scroll-bars. + (scroll_run): Adapt to new fringe position. + (glyph_rect): Use window coordinates returned from + window_from_coordinates rather than frame_to_window_pixel_xy. + (XTset_vertical_scroll_bar): Adapt to per-window fringes and + scroll-bars. + (handle_one_xevent): Simplify a USE_GTK conditional. + (x_clip_to_row): Remove superfluous whole_line_p arg and code + (fringes are now inside margins, i.e. always in the clipping area). + All callers changed. + (x_new_font): Set FRAME_COLUMN_WIDTH and FRAME_LINE_HEIGHT + directly, then call compute_fringe_widths. Don't call + frame_update_line_height. + + * w32term.h (struct w32_output): Move members left_pos, top_pos, + border_width, pixel_height, pixel_width, line_height, + internal_border_width, vertical_scroll_bar_extra, + left_fringe_width, right_fringe_width, fringe_cols, + fringes_extra, win_gravity, size_hint_flags, want_fullscreen, + x_pixels_diff, and y_pixels_diff to struct frame (frame.h). + (FRAME_INTERNAL_BORDER_WIDTH, FRAME_LINE_HEIGHT): Move to frame.h. + (FRAME_DEFAULT_FONT_WIDTH): Remove macro. + (PIXEL_WIDTH, PIXEL_HEIGHT) + (FRAME_X_FRINGE_COLS, FRAME_X_FRINGE_WIDTH) + (FRAME_X_LEFT_FRINGE_WIDTH, FRAME_X_RIGHT_FRINGE_WIDTH): Move to + frame.h and renamed [see frame.h changes]. + (CHAR_TO_PIXEL_ROW, CHAR_TO_PIXEL_COL, CHAR_TO_PIXEL_WIDTH) + (CHAR_TO_PIXEL_HEIGHT, PIXEL_TO_CHAR_ROW, PIXEL_TO_CHAR_COL) + (PIXEL_TO_CHAR_WIDTH, PIXEL_TO_CHAR_HEIGHT): Move to frame.h + and renamed [see frame.h changes]. + + * w32term.c: Make (several) trivial substitutions for renamed and + new macros in dispextern.h, frame.h and window.h. + (x_draw_glyph_string_box): Adapt to per-window fringes and scroll-bars. + (glyph_rect): Use window coordinates returned from + window_from_coordinates rather than frame_to_window_pixel_xy. + (XTset_vertical_scroll_bar): Adapt to per-window fringes and + scroll-bars. + (w32_clip_to_row): Remove superfluous whole_line_p arg and code + (fringes are now inside margins, i.e. always in the clipping area). + All callers changed. + (x_new_font): Set FRAME_COLUMN_WIDTH and FRAME_LINE_HEIGHT + directly, then call compute_fringe_widths. Don't call + frame_update_line_height. + + * w32console.c: Make (few) trivial substitutions for renamed and + new macros in dispextern.h, frame.h and window.h. + + * w32fns.c: Make (many) trivial substitutions for renamed and + new macros in dispextern.h, frame.h and window.h. + + * w32menu.c: Make (few) trivial substitutions for renamed and + new macros in dispextern.h, frame.h and window.h. + + * macterm.h (struct mac_output): Move members left_pos, top_pos, + border_width, pixel_height, pixel_width, line_height, + internal_border_width, vertical_scroll_bar_extra, + left_fringe_width, right_fringe_width, fringe_cols, + fringes_extra, win_gravity, size_hint_flags, want_fullscreen, + x_pixels_diff, y_pixels_diff to struct frame (frame.h). + (FRAME_INTERNAL_BORDER_WIDTH, FRAME_LINE_HEIGHT): Move to frame.h. + (FRAME_DEFAULT_FONT_WIDTH): Remove macro. + (PIXEL_WIDTH, PIXEL_HEIGHT) + (FRAME_X_FRINGE_COLS, FRAME_X_FRINGE_WIDTH) + (FRAME_X_LEFT_FRINGE_WIDTH, FRAME_X_RIGHT_FRINGE_WIDTH): Move to + frame.h and renamed [see frame.h changes]. + (CHAR_TO_PIXEL_ROW, CHAR_TO_PIXEL_COL, CHAR_TO_PIXEL_WIDTH) + (CHAR_TO_PIXEL_HEIGHT, PIXEL_TO_CHAR_ROW, PIXEL_TO_CHAR_COL) + (PIXEL_TO_CHAR_WIDTH, PIXEL_TO_CHAR_HEIGHT): Move to frame.h + and renamed [see frame.h changes]. + + * macterm.c: Make (several) trivial substitutions for renamed and + new macros in dispextern.h, frame.h and window.h. + (x_draw_glyph_string_box): Adapt to per-window fringes and scroll-bars. + (glyph_rect): Use window coordinates returned from + window_from_coordinates rather than frame_to_window_pixel_xy. + (XTset_vertical_scroll_bar): Adapt to per-window fringes and + scroll-bars. + (x_clip_to_row): Remove superfluous whole_line_p arg and code + (fringes are now inside margins, i.e. always in the clipping area). + All callers changed. + (x_new_font): Set FRAME_COLUMN_WIDTH and FRAME_LINE_HEIGHT + directly, then call compute_fringe_widths. Don't call + frame_update_line_height. + + * macfns.c: Make (several) trivial substitutions for renamed and + new macros in dispextern.h, frame.h and window.h. + (x_real_positions): Set f->x_pixels_diff and f->y_pixels_diff to 0. + + * macmenu.c: Make (few) trivial substitutions for renamed and + new macros in dispextern.h, frame.h and window.h. + + * msdos.h (struct x_output): Remove members left_pos, top_pos, + and line_height, and use corresponding new members in struct + frame. All uses changed. + (FRAME_LINE_HEIGHT, FRAME_INTERNAL_BORDER_WIDTH): Remove macros; + superseeded by corresponding macros in frame.h. + + * msdos.c: Make (several) trivial substitutions for renamed and + new macros in dispextern.h, frame.h and window.h. + (IT_note_mouse_highlight): Use updated window coordinates returned + by window_from_coordinates, rather than adjusting them locally. + (internal_terminal_init): No need to initialize line_height here; + it now defaults to 1. + +2003-05-24 Stefan Monnier <monnier@cs.yale.edu> + + * keyboard.c (read_key_sequence): Adjust fkey and keytran when + dropping `down' events. + +2003-05-24 Andreas Schwab <schwab@suse.de> + + * coding.c (find_safe_codings): Fix last change. + +2003-05-24 Istvan Marko <mi@imarko.dhs.org> (tiny change) + + * xfns.c (x_window): Fix typo from 2003-05-21 change. + +2003-05-23 Stefan Monnier <monnier@cs.yale.edu> + + * xdisp.c (display_mode_element): Increase max depth. + Simplify the error handling code. Use a different error string + for the case where we hit the depth limit. + + * lisp.h (Vfundamental_mode_abbrev_table): Don't declare. + + * buffer.c (reset_buffer_local_variables): Remove redundant setting. + +2003-05-21 Stefan Monnier <monnier@cs.yale.edu> + + * intervals.c (get_local_map): Don't get char-property of previous + point any more: get_pos_property already does it and better. + +2003-05-21 Dave Love <fx@gnu.org> + + [Merged from unicode branch.] + + * xfns.c (x_window, x_window): Use use_xim. + + * xterm.c (use_xim): Initialize. + (xim_open_dpy, xim_initialize, xim_close_dpy): Use use_xim. + (x_term_init): Maybe set use_xim. + + * xterm.h (use_xim) [HAVE_X_I18N]: Declare. + +2003-05-21 Jason Rumney <jasonr@gnu.org> + + * unexw32.c (_start): Remove _fmode initialization. + + * emacs.c (main) [WINDOWSNT]: Move it here. + +2003-05-20 Dave Love <fx@gnu.org> + + * s/gnu-linux.h (MAIL_USE_FLOCK): Make it conditional. + +2003-05-19 Richard M. Stallman <rms@gnu.org> + + * xfaces.c (Finternal_set_lisp_face_attribute): Handle Qunspecified + as value for QCfont attribute. + (realize_default_face): lface should already exist; crash if not. + Specify 0 for FORCE_P when calling set_lface_from_font_name. + + * frame.c (Fignore_event): Doc fix. + +2003-05-19 Kenichi Handa <handa@m17n.org> + + * coding.c (decode_coding_string): Handle post-read-conversion + even if the coding doesn't require decoding. + +2003-05-18 Richard M. Stallman <rms@gnu.org> + + * callproc.c (Fcall_process_region): Doc fix. + +2003-05-17 Stefan Monnier <monnier@cs.yale.edu> + + * lread.c (Fload): Print a message if package is obsolete. + + * window.c (Fselect_window): Add optional `norecord' arg. + (select_window_1): Fold into Fselect_window. + (select_window_norecord): New function. + (temp_output_buffer_show): Use it. Preserve current buffer. + + * window.h (Fselect_window): Update declaration. + + * window.c (delete_window, Fother_window, Fset_window_configuration): + * minibuf.c (read_minibuf): + * macterm.c (x_new_focus_frame): + * frame.c (do_switch_frame, Fset_frame_selected_window, Fdelete_frame): + * callint.c (Fcall_interactively): + * xterm.c (x_new_focus_frame): Pass nil as new arg to Fselect_window. + + * buffer.c (Fpop_to_buffer): Pass norecord to Fselect_window. + +2003-05-17 David Kastrup <dak@gnu.org> + + * process.c (read_process_output): Back out change from 2003-03-09. + +2003-05-17 Stefan Monnier <monnier@cs.yale.edu> + + * editfns.c (get_pos_property): Don't assume that `object' = nil. + + * textprop.c (text_property_stickiness): New arg `buffer'. + + * intervals.h (text_property_stickiness): New arg `buffer'. + (get_pos_property): Declare. + + * intervals.c (get_local_map): Use get_pos_property, to obey + stickiness and empty overlays. + (create_root_interval, graft_intervals_into_buffer): Use BEG. + (merge_properties, intervals_equal, merge_properties_sticky): + Use XCAR, XCDR. + (adjust_for_invis_intang): Pass new arg to text_property_stickiness. + +2003-05-17 Richard M. Stallman <rms@gnu.org> + + * minibuf.c (read_minibuf): If buffer is empty, record the default + in the history. + (Fminibuffer_complete_word): When deleting the overlap, take account + of its real position. + + * fns.c (map_char_table): Fix previous change. + + * syntax.c (find_defun_start): + When open_paren_in_column_0_is_defun_start, + return beginning of buffer. + + * lisp.h (map_char_table): Declare added arg. + + * fns.c (map_char_table): New arg TABLE gets the master table. + All calls changed. + Process default and inheritance, resorting to Faref if necessary. + + * keymap.c (Fset_keymap_parent, map_keymap, Fcopy_keymap) + (Faccessible_keymaps): Pass new arg to map_char_table. + + * fontset.c (Ffontset_info): Pass new arg to map_char_table. + + * casetab.c (set_case_table): Pass new arg to map_char_table. + + * data.c (let_shadows_buffer_binding_p): Make target of p volatile. + + * lisp.h (specbinding_func): New typedef. + (struct specbinding): Use specbinding_func, to put the `volatile' + in the right place. + + * alloc.c (Fgarbage_collect): Cast pointers into specpdl + to avoid GCC warning. + +2003-05-16 Ralph Schleicher <rs@nunatak.allgaeu.org> + + * fileio.c (Fdelete_file): Handle symlinks pointing to directories. + +2003-05-15 Stefan Monnier <monnier@cs.yale.edu> + + * keyboard.c (apply_modifiers): Don't fill the other cache. + +2003-05-14 Stefan Monnier <monnier@cs.yale.edu> + + * .gdbinit-union: New file, for USE_LISP_UNION_TYPE users. + + * window.h (Qwindowp, Qwindow_live_p, Vwindow_list) + (Fwindow_end, Fselected_window, Fdelete_window, Fwindow_buffer) + (Fget_buffer_window, Fsave_window_excursion, Fsplit_window) + (Fset_window_configuration, Fcurrent_window_configuration) + (compare_window_configurations, Fcoordinates_in_window_p, Fwindow_at) + (Fpos_visible_in_window_p, mark_window_cursors_off) + (window_internal_height, window_internal_width, Frecenter) + (Fscroll_other_window, Fset_window_start, temp_output_buffer_show) + (replace_buffer_in_all_windows, init_window_once, init_window) + (syms_of_window, keys_of_window): Move from lisp.h. + * lisp.h: Move window.c declarations to window.h. + + * bytecode.c: Include window.h. + * emacs.c: Include window.h. + + * keyboard.c (make_lispy_event): Apply modifiers to multibyte-char key. + (keyremap): Add `parent' field. + (keyremap_step): Use it. Remove `parent' argument. + (read_key_sequence): Setup and use the new `parent' field. + +2003-05-11 Stefan Monnier <monnier@cs.yale.edu> + + * keyboard.c (adjust_point_for_property): Ensure termination. + +2003-05-10 Stefan Monnier <monnier@cs.yale.edu> + + * keyboard.c (follow_key): Remove dead variable `did_meta'. + (access_keymap_keyremap, keyremap_step): New funs, extracted from the + duplicated handling of function-key-map and key-translation-map + in read_key_sequence. + (read_key_sequence): Use them. + + * keyboard.c (adjust_point_for_property): Try harder to move point + to the non-sticky end of an invisible property. + + * xdisp.c (single_display_prop_intangible_p): Make `space' display + property intangible as well. + +2003-05-10 Andreas Schwab <schwab@suse.de> + + * xmenu.c (single_menu_item): Change last parameter to void* to + avoid warning. + +2003-05-09 Richard M. Stallman <rms@gnu.org> + + * print.c (Fprin1_to_string): Instead of gcpro, set abort_on_gc. + Bind Qinhibit_modification_hooks to t so there will be no GC. + Rename local `tem' to `save_deactivate_mark'. + + * eval.c (specpdl_ptr): Declare volatile. + (unbind_to): Copy the whole binding and decrement specpdl_ptr + before doing the work of unbinding it. + + * lisp.h (struct specbinding): Declare elements volatile. + (specpdl_ptr): Declare volatile. + + * Makefile.in (alloca.o): Specify -DDO_BLOCK_INPUT in compiling. + + * alloca.c: Test DO_BLOCK_INPUT rather than `emacs' + for use of BLOCK_INPUT and inclusion of lisp.h and blockinput.h. + +2003-05-08 Dave Love <fx@gnu.org> + + * coding.c (Vlast_coding_system_used): Doc fix. + +2003-05-07 Jason Rumney <jasonr@gnu.org> + + * fileio.c (Ffile_symlink_p): Let handlers handle symlinks even + when system does not support them. + +2003-05-05 Stefan Monnier <monnier@cs.yale.edu> + + * fileio.c (Qwrite_region_annotate_functions): New var. + (build_annotations): Use it to process the global part of the hook. + (syms_of_fileio): Init and staticpro it. + + * keyboard.c (safe_run_hooks_error): Display a message instead of + silently ignoring the error. + +2003-05-03 Stefan Monnier <monnier@cs.yale.edu> + + * keyboard.c (input_available_signal): Mark static. + (menu_bar_items): Use map_keymap. + (menu_bar_one_keymap): Remove. + (menu_bar_item): Adjust arglist (for use in map_keymap). + Properly hide a second binding when not both are keymaps. + + * xmenu.c (struct skp): New struct, to pass args through map_keymap. + (single_keymap_panes): Use it and map_keymap. + (single_menu_item): Use skp as well. + + * keymap.h (map_keymap_function_t): New type. + (map_keymap): Declare. + + * keymap.c (map_keymap_item, map_keymap_char_table_item, map_keymap) + (map_keymap_call, Fmap_keymap): New functions. + (syms_of_keymap): Defsubr map-keymap. + +2003-05-02 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (create_dialog, make_widget_for_menu_item) + (make_menu_item, create_menus, xg_update_menu_item): Don't call + ..._with_mnemonic functions for menu items. + +2003-05-01 Kenichi Handa <handa@m17n.org> + + * coding.c (coding_system_accept_latin_extra_p): Delete this + function. + (find_safe_codings): Pay attention to + the property tranlsation-table-for-encode of each codings. + (syms_of_coding): Give Qtranslation_table the extra slot number 2. + +2003-05-01 Stefan Monnier <monnier@cs.yale.edu> + + * eval.c (Funwind_protect): Use func=Fprogn rather than symbol=Qnil. + +2003-04-30 Stefan Monnier <monnier@cs.yale.edu> + + * eval.c (unbind_to): Don't handle symbol = Qnil any more. + + * lisp.h (CHECK): Wrap args in parenthesis. + (specbind): Fix doc: symbol = Qnil is not supported any more. + + * bytecode.c (Fbyte_code) <unwind-protect>: + Use Fprogn rather than 0 and Qnil. + + * keyboard.c (parse_modifiers_uncached): Parse `down', `drag', + `double', and `triple' modifiers as well. + +2003-04-30 Richard M. Stallman <rms@gnu.org> + + * keyboard.c (echo_char): Don't clear out a dash that follows a space. + + * alloc.c (abort_on_gc): New variable. + (Fgarbage_collect): Abort if abort_on_gc is set. + + * lisp.h (abort_on_gc): Add decl. + + * eval.c (Fsignal): Clear abort_on_gc. + + * editfns.c (Fformat): Set abort_on_gc during first scan of format. + Reinit FORMAT_START and END before second scan. + + * xdisp.c (move_it_vertically_backward): Do the final big else + even if nlines is 0. + + * xdisp.c (redisplay_internal): Finish the per-frame loop + even if redisplay is suspended by input. + +2003-04-24 Andrew Choi <akochoi@shaw.ca> + + * macterm.c (x_list_fonts): Return all fonts that match if + maxnames = -1. + +2003-04-25 Kenichi Handa <handa@m17n.org> + + * syntax.c (skip_chars): Fix previous change. + +2003-04-24 Kenichi Handa <handa@m17n.org> + + * syntax.c (skip_chars): Make the code faster by using the common + technique of *p, *stop, and *endp. + +2003-04-23 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xdisp.c (update_tool_bar): BLOCK_INPUT before calling + tool_bar_items so GTK tool bar expose callback does not access items + being updated. + +2003-04-19 Stefan Monnier <monnier@cs.yale.edu> + + * eval.c (Fapply): Undo last change and add a comment about why. + +2003-04-18 Miles Bader <miles@gnu.org> + + * data.c (Faset): Calculate nbytes earlier, to satisfy the now + pickier PARSE_MULTIBYTE_SEQ. + +2003-04-17 Stefan Monnier <monnier@cs.yale.edu> + + * eval.c (For, Fand, Fprogn, un_autoload, do_autoload): + Use XCDR, XCAR, CONSP. + (Fdefmacro): Fix docstring. Use XCAR, XCDR. + (Fapply): Remove unnecessary GCPRO. + + * doc.c (Fsubstitute_command_keys): Remove spurious casts. + + * charset.h (PARSE_MULTIBYTE_SEQ): Pretend `length' is used. + + * buffer.h: Don't hardcode BEG==1. + + * abbrev.c (Fdefine_abbrev_table): Use XCAR, XCDR. + +2003-04-16 Richard M. Stallman <rms@gnu.org> + + * xdisp.c (try_window, try_window_reusing_current_matrix): + When at end of window, set window_end_pos to Z-ZV. + + * buffer.c (Foverlay_recenter): Doc fix. + +2003-04-14 Stefan Monnier <monnier@cs.yale.edu> + + * dispnew.c (Fsit_For): Support XEmacs-style arg list. + +2003-04-14 Andrew Choi <akochoi@shaw.ca> + + * macterm.c (mac_check_for_quit_char): Don't check more often than + once a second. + +2003-04-11 Stefan Monnier <monnier@cs.yale.edu> + + * keyboard.c (kbd_buffer_get_event): Don't handle SELECT_WINDOW_EVENT + specially, so that they can't hide an implicit switch-frame event. + (make_lispy_event): Handle SELECT_WINDOW_EVENT. + (head_table): Use switch-frame as event_kind for select-window. + (keys_of_keyboard): Don't bind [select-window] in special-event-map. + + * editfns.c (Fformat): Lisp_Object/int mixup. + (format2): Remove unused var numargs. + +2003-04-11 Kenichi Handa <handa@m17n.org> + + * fileio.c (Vafter_insert_file_adjust_coding_function): Delete. + (Qafter_insert_file_set_coding): New variable. + (syms_of_fileio): Initialize and staticpro it. Delete declaration + for after-insert-file-adjust-coding-function. + (Finsert_file_contents): Call Qafter_insert_file_set_coding + instead of Vafter_insert_file_adjust_coding_function. + +2003-04-11 Kenichi Handa <handa@m17n.org> + + * lisp.h (temp_echo_area_glyphs): Adjust prototype. + + * minibuf.c (temp_echo_area_glyphs): Change the arg to Lisp + string. Callers changed. + +2003-04-10 Kenichi Handa <handa@m17n.org> + + * fileio.c (Vafter_insert_file_adjust_coding_function): New variable. + (syms_of_fileio): Declare it as a lisp variable. + (Finsert_file_contents): + Call Vafter_insert_file_adjust_coding_function before calling + decode-format. + +2003-04-09 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.c (xg_scroll_callback): Call gtk_range_get_adjustment to + get GtkAdjustment as widget now is a GtkRange. + + * gtkutil.c (xg_create_scroll_bar): Connect to value-changed on + GtkRange to avoid memory leak. + +2003-04-09 Kenichi Handa <handa@m17n.org> + + * xfaces.c (Vface_font_rescale_alist): New variable. + (struct font_name): New member rescale_ratio. + (font_rescale_ratio): New function. + (split_font_name): If NUMERIC_P is nonzero, set font->rescale_ratio. + (better_font_p): On comparing point sized, pay attention to + recale_ratio member of fonts. + (build_scalable_font_name): Reflect font->rescale_ratio in the + font name. + (syms_of_xfaces): Declare Vface_font_rescale_alist as a Lisp variable. + + * lread.c (read1): Before calling index, check if the 2nd + arguemnt is in ASCII range. + +2003-04-08 Richard M. Stallman <rms@gnu.org> + + * fileio.c (Ffile_symlink_p): Doc fix. + + * editfns.c (Fformat): Translate positions of text properties + in the format string to apply them to the result. + + * fileio.c (Finsert_file_contents): Doc fix. + (syms_of_fileio) <after-insert-file-functions>: Doc fix. + +2003-04-08 Ivan Zakharyaschev <imz@altlinux.org> (tiny change) + + * lread.c (openp): Get the Qfile_exists_p handler for STRING, not FN. + +2003-04-08 Steven Tamm <steventamm@mac.com> + + * mac.c (init_mac_osx_environment): Switch libexec and bin so + that self-contained application finds libexec files. + +2003-04-08 Kenichi Handa <handa@m17n.org> + + * coding.c (code_convert_region_unwind): + Set Vlast_coding_system_used to the argument. + (code_convert_region): If post-read-conversion function changed + the value of last-coding-sytem, keep the new value in + coding->symbol so that it won't be overridden. + (run_pre_post_conversion_on_str): Likewise. + (coding_system_accept_latin_extra_p): New function. + (find_safe_codings): Pay attention to characters registered in + latin-extra-code-table. + +2003-04-07 Thien-Thi Nguyen <ttn@gnu.org> + + * Makefile.in (md5.o): Add missing dependency info. + +2003-04-06 Richard M. Stallman <rms@gnu.org> + + * xselect.c (x_handle_selection_request): Move UNGCPRO to very end. + + * marker.c (verify_bytepos): New function. + + * intervals.c (set_intervals_multibyte_1): When becoming + multibyte, adjust right and left child sizes to a whole set of + characters. If an interval gets zero total-length, delete it. + If an interval consists of just its children, delete one of them. + + * intervals.h (CHECK_TOTAL_LENGTH): New macro. + * intervals.c: Add many calls to CHECK_TOTAL_LENGTH. + + * alloc.c (VALIDATE_LISP_STORAGE): Macro deleted. + All calls deleted. + (lisp_malloc): Do the work here directly. + +2003-04-06 Gareth Jones <emacs@referential.org.uk> (tiny change) + + * fns.c (Flength): Return SUB_CHAR_TABLE_ORDINARY_SLOTS for sub + char tables. + +2003-04-04 Kenichi Handa <handa@m17n.org> + + * editfns.c (Fformat): Use a copy of FORMAT string so that we can + destructively change "%S" to "%s". + +2003-04-03 Miles Bader <miles@gnu.org> + + * xfaces.c (choose_face_font): Make sure *NEEDS_OVERSTRIKE is + always set. + +2003-04-01 Dave Love <fx@gnu.org> + + * xfns.c (xpm_lookup_color): Grok "opaque". + +2003-03-31 Andrew Choi <akochoi@shaw.ca> + + * frame.c (x_report_frame_params) [HAVE_CARBON]: Do not report + parent window ID. + + * macfns.c (syms_of_macfns): Remove call to init_x_parm_symbols. + + * macterm.h (struct mac_output): Define x_pixels_diff and + y_pixels_diff. + +2003-03-31 Juanma Barranquero <lektu@terra.es> + + * makefile.w32-in ($(BLD)/frame.$(O)): Add dependency on + blockinput.h and files included from it. + +2003-03-31 Kim F. Storm <storm@cua.dk> + + The following changes consolidates the common code related to + frame-parameter handling from the xfns.c, w32fns.c, and macfns.c + files into frame.c. + + * frame.c: Include blockinput.h. + (Vx_resource_name, Vx_resource_class, Qx_frame_parameter) + (Qx_resource_name, Qface_set_after_frame_default): Define vars here. + (Qauto_raise, Qauto_lower, ...): Define all frame parameter + related vars here. + (struct frame_parm_table, frame_parms): New table for describing + frame parameters and their associated Q-variable. + The order of the parameters corresponds to the sequence of the + frame_parm_handlers table in redisplay_interface. + (x_fullscreen_move, x_set_frame_parameters) + (x_report_frame_params, x_set_fullscreen, x_set_line_spacing) + (x_set_screen_gamma, x_set_font, x_set_fringe_width) + (x_set_border_width, x_set_internal_border_width, x_set_visibility) + (x_set_autoraise, x_set_autolower, x_set_unsplittable) + (x_set_vertical_scroll_bars, x_set_scroll_bar_width, x_icon_type): + Generic functions for processing of frame parameters. + (validate_x_resource_name, xrdb_get_resource, Fx_get_resource) + (display_x_get_resource, x_get_resource_string): Functions for + generic access to X resources. + (x_get_arg, x_frame_get_arg, x_frame_get_and_record_arg) + (x_default_parameter, Fx_parse_geometry): Functions for generic + access to frame parameters. + (x_figure_window_size): Generic calculation of frame size. + Fixed to add space needed for tool bar. Also setup size_hint_flags. + (syms_of_frame): Intern and staticpro frame parameter variables. + Defvar_lisp Vx_resource_class and Vx_resource_name here. + Defsubr Sx_get_resource and Sx_parse_geometry. + + * frame.h (Qauto_raise, Qauto_lower, ...): Declare extern all frame + parameter related vars defined in frame.c. + (EMACS_CLASS): Define here. + (enum FULLSCREEN_*): Define here. + (x_set_scroll_bar_default_width, x_wm_set_icon_position) + (x_set_offset, x_new_font, x_new_fontset): Add prototypes. + (x_fullscreen_adjust, x_set_frame_parameters, x_report_frame_params) + (x_set_fullscreen, x_set_line_spacing, x_set_screen_gamma, x_set_font) + (x_set_fringe_width, x_set_border_width, x_set_internal_border_width) + (x_set_visibility, x_set_autoraise, x_set_autolower) + (x_set_unsplittable, x_set_vertical_scroll_bars) + (x_set_scroll_bar_width, x_icon_type, validate_x_resource_name) + (x_figure_window_size): Add prototypes. + + * dispextern.h (frame_parm_handler): New typedef. + (struct redisplay_interface): New member frame_parm_handlers. + (enum resource_types): Move declaration here. + (x_get_arg, x_frame_get_arg, x_frame_get_and_record_arg) + (x_default_parameter): Add prototypes. + + * window.c: Remove extern decl for frame parameter vars. + (change_window_heights): New generic function; + replaces x_change_window_heights. All users changed. + + * window.h (change_window_heights): Add prototype. + + * xfaces.c: Remove extern decl for frame parameter vars. + + * xterm.h (EMACS_CLASS): Remove. Use generic define. + (struct w32_display_info): Fix type of xrdb member. + (enum FULLSCREEN_*): Remove. + Remove prototypes for generic functions (in frame.h). + + * xfns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame + parameters now defined in frame.h and frame.c. + (Vx_resource_name): Remove. Use generic var. + (enum x_frame_parms): Remove (bogus, unused enum). + (check_x_display_info): Make non-static (for frame.c). + (struct x_frame_parm_table, x_frame_parms): Remove. + (init_x_parm_symbols, x_set_frame_parameters, x_report_frame_params) + (x_set_line_spacing, x_set_screen_gamma, x_icon_type, x_set_font) + (x_set_border_width, x_set_internal_border_width, x_set_visibility) + (x_change_window_heights, x_set_autoraise, x_set_autolower) + (x_set_vertical_scroll_bars, x_set_scroll_bar_width) + (validate_x_resource_name, Fx_get_resource, x_get_resource_string) + (x_default_parameter, Fx_parse_geometry, x_figure_window_size): + Remove. Use generic functions instead. + (enum resource_types): Remove. + (x_set_scroll_bar_default_width): New global function (for frame.c). + (Fx_create_frame): Depend on x_figure_window_size to add space for + toolbar and setup size_hint_flags. + (x_frame_parm_handlers): New table for redisplay_interface. + (syms_of_xfns): Don't intern/staticpro removed vars. + + * xterm.c: Remove unnecessary extern declarations. + (x_fullscreen_adjust): Remove. Use generic instead. + (x_redisplay_interface): Add x_frame_parm_handlers member. + + * w32gui.h (XrmDatabase): New (dummy) typedef. + + * w32term.h (EMACS_CLASS): Remove. Use generic define. + (struct w32_display_info): Fix type of xrdb member. + (enum FULLSCREEN_*): Remove. + (x_fullscreen_adjust): Remove prototype. + + * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame + parameters now defined in frame.h and frame.c. + (Vx_resource_name): Remove. Use generic var. + (enum x_frame_parms): Remove (bogus, unused enum). + (check_x_display_info): Make non-static (for frame.c). + (struct x_frame_parm_table, x_frame_parms): Remove. + (init_x_parm_symbols, x_set_frame_parameters, x_report_frame_params) + (x_set_line_spacing, x_set_screen_gamma, x_icon_type, x_set_font) + (x_set_border_width, x_set_internal_border_width, x_set_visibility) + (x_change_window_heights, x_set_autoraise, x_set_autolower) + (x_set_vertical_scroll_bars, x_set_scroll_bar_width) + (validate_x_resource_name, Fx_get_resource, x_get_resource_string) + (x_default_parameter, Fx_parse_geometry, x_figure_window_size): + Remove. Use generic functions instead. + (enum resource_types): Remove. + (x_set_scroll_bar_default_width): New global function (for frame.c). + (Fx_create_frame): Depend on x_figure_window_size to add space for + toolbar and setup size_hint_flags. + (w32_frame_parm_handlers): New table for redisplay_interface. + (syms_of_w32fns): Don't intern/staticpro removed vars. + + * w32term.c: Remove unnecessary extern declarations. + (x_fullscreen_adjust): Remove. Use generic instead. + (x_redisplay_interface): Add w32_frame_parm_handlers member. + + * w32reg.c (x_get_string_resource): Use XrmDatabase. + + * macgui.h (XrmDatabase): New (dummy) typedef. + + * macterm.h (EMACS_CLASS): Remove. + (struct mac_display_info): Add xrdb member. + (struct mac_output): Add want_fullscreen member. + + * macfns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame + parameters now defined in frame.h and frame.c. + (Vx_resource_name): Remove. Use generic var. + (check_x_display_info): Make non-static (for frame.c). + (struct x_frame_parm_table, x_frame_parms): Remove. + (init_x_parm_symbols, x_set_frame_parameters, x_report_frame_params) + (x_set_line_spacing, x_set_screen_gamma, x_icon_type, x_set_font) + (x_set_border_width, x_set_internal_border_width, x_set_visibility) + (x_change_window_heights, x_set_autoraise, x_set_autolower) + (x_set_vertical_scroll_bars, x_set_scroll_bar_width) + (validate_x_resource_name, Fx_get_resource, x_get_resource_string) + (x_default_parameter, Fx_parse_geometry, x_figure_window_size): + Remove. Use generic functions instead. + (enum resource_types): Remove. + (x_set_scroll_bar_default_width): New global function (for frame.c). + (mac_frame_parm_handlers): New table for redisplay_interface. + (syms_of_macfns): Don't intern/staticpro removed vars. + + * macterm.c: Remove unnecessary extern declarations. + (x_redisplay_interface): Add mac_frame_parm_handlers member. + + * Makefile.in (frame.o): Add dependency on blockinput.h and files + included from it (atimer.h and systime.h). + +2003-03-30 Andreas Schwab <schwab@suse.de> + + * xdisp.c (x_insert_glyphs): Fix swapped width and height + parameters for shift_glyphs_for_insert. + + * macterm.c (x_redisplay_interface): Add missing entry for + draw_vertical_window_border. + +2003-03-29 Kai Gro,A_(Bjohann <kai.grossjohann@gmx.net> + + * fileio.c (Fexpand_file_name): In the no-handler case, after + expanding, look again for a handler and invoke it. This is needed + for filenames like "/foo/../user@host:/bar/../baz" -- the first + expansion produces "/user@host:/bar/../baz" which needs to be + expanded again for the finame result "/user@host:/baz". + +2003-03-28 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (xg_tool_bar_item_expose_callback): Reduce size + of area to be redrawn for better performance. + +2003-03-28 Stefan Monnier <monnier@cs.yale.edu> + + * xterm.c (take_vertical_position_into_account): Remove. + (xt_action_hook): Call set_vertical_scroll_bar if needed. + (XM_SB_MIN, XM_SB_RANGE): Remove (min is now set to 0). + (xm_scroll_callback, x_create_toolkit_scroll_bar) + (x_set_toolkit_scroll_bar_thumb): Simplify. + (x_scroll_bar_expose): Only compile if !USE_TOOLKIT_SCROLL_BARS. + (XTread_socket): Remove unused var. + (x_make_frame_invisible): Replace goto with else. + + * xdisp.c (set_vertical_scroll_bar): New fun. + (redisplay_window): Use it. + +2003-03-26 Richard M. Stallman <rms@gnu.org> + + * xdisp.c (update_tool_bar): Recompute tool bar if + update_mode_lines is set. Set w->update_mode_line + only if the tool bar contents actually change. + (update_menu_bar): Undo previous change. + +2003-03-26 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (xg_resize_widgets): Don't call xg_frame_cleared. + (xg_frame_set_char_size): Calculate scroll bar width before frame + width. Call SET_FRAME_GARBAGED and cancel_mouse_face. + (xg_separator_p): Check for all documented separator types. + (xg_update_scrollbar_pos): Variable gheight not needed, use height. + (update_frame_tool_bar): Don't call gdk_window_process_all_updates. + + * xdisp.c (update_menu_bar): Set w->update_mode_line to Qt + so tool bar gets updated. + +2003-03-26 Stefan Monnier <monnier@cs.yale.edu> + + * data.c (store_symval_forwarding): Re-instate part of the code + that was deleted with too much enthusiasm. + +2003-03-25 Stefan Monnier <monnier@cs.yale.edu> + + * data.c (store_symval_forwarding): Delete special read-only + hack for type == -1, since we now use ->constant instead. + (Fkill_local_variable): Don't use XBUFFER if it can be nil. + + * buffer.c (overlays_in): Declare static. + (syms_of_buffer) <enable-multibyte-characters>: Use the symbol's + `constant' field rather than the variable's `type' field. + +2003-03-24 Andrew Choi <akochoi@shaw.ca> + + * config.in [MAC_OSX]: Do not redefine bcopy, bzero, and bcmp. + + * dispextern.h [HAVE_CARBON]: Include Carbon.h. + + * fns.c [MAC_OSX]: Do not redefine vector. + + * keyboard.c [MAC_OSX]: Handle SIGINT with interrupt_signal. + + * macgui.h: Remove definition of No_Cursor. + + * macterm.h: Include Carbon.h. Replace (struct Cursor *) by Cursor. + + * xdisp.c: Define No_Cursor. + (x_write_glyphs, notice_overwritten_cursor) + (draw_phys_cursor_glyph, note_mode_line_or_margin_highlight) + (note_mouse_highlight): Remove Mac-specific code. + (note_mouse_highlight): Use bcmp instead of == to compare Cursors. + +2003-03-24 John Paul Wallington <jpw@gnu.org> + + * xdisp.c (redisplay_window): If mini window's buffer is not + empty, then redisplay it like other windows. + +2003-03-23 Kim F. Storm <storm@cua.dk> + + * w32term.c (w32_draw_window_cursor): Fix last change. + +2003-03-23 Kenichi Handa <handa@m17n.org> + + * alloc.c (make_string_from_bytes, make_specified_string): + Add `const' for the arg CONTENTS. + + * lisp.h (make_string_from_bytes, make_specified_string): + Prototypes adjusted. + +2003-03-23 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xdisp.c (get_glyph_string_clip_rect): Remove ; at end of #endif. + + * gtkutil.h: Take two more arguments to xg_update_scrollbar_pos. + (XG_SB_RANGE): New define. + + * gtkutil.c (xg_fixed_handle_expose): New function. + (xg_create_frame_widgets): Call xg_fixed_handle_expose for + expose events. + (xg_update_scrollbar_pos): Take two more arguments, left and width + of scroll bar including borders. + Clear left and right part outside scroll bar separately as some + themes have bars that are not an even number of pixels. + Don't set reallocate_redraws, don't call + gdk_window_process_all_updates. + (xg_set_toolkit_scroll_bar_thumb): Upper value is fixed, + so no need to change it. Calculate size and value with XG_SB_RANGE. + + * xterm.c (x_scroll_bar_create, XTset_vertical_scroll_bar): + Pass left and width of scroll bar including borders to + xg_update_scrollbar_pos. + +2003-03-22 Thien-Thi Nguyen <ttn@gnu.org> + + * Makefile.in: Make sure space precedes end-of-line backslashes. + +2003-03-22 Kim F. Storm <storm@cua.dk> + + * xdisp.c (pixel_to_glyph_coords, glyph_to_pixel_coords): + Add generic versions here. Remove system specific versions + defined elsewhere. + + * dispextern.h (pixel_to_glyph_coords, glyph_to_pixel_coords): + Add prototypes. + + * xterm.h (STORE_NATIVE_RECT): New macro. + +2003-03-21 Kim F. Storm <storm@cua.dk> + + * xdisp.c (get_glyph_string_clip_rect): + Use FRAME_INTERNAL_BORDER_WIDTH. + + * dispextern.h (struct redisplay_interface): Add active_p + argument to draw_window_cursor member. All uses changed. + +2003-03-21 Kim F. Storm <storm@cua.dk> + + The following changes consolidate code related to writing and + inserting glyphs, exposing frame, the tool bar, the mouse face, + the output cursor, and help echo from xterm.c, w32term.c and + macterm.c into xdisp.c. It also generalizes the use of the + window_part enum instead of using numeric values throughout. + + * xdisp.c: Consolidate gui-independent code here. + Include keymap.h. + (Qhelp_echo): Import. + (mouse_autoselect_window, x_stretch_cursor_p): Declare here. + (help_echo_string, help_echo_window, help_echo_object) + (previous_help_echo_string, help_echo_pos): Declare here. + (output_cursor, last_mouse_frame, last_tool_bar_item): Declare here. + (estimate_mode_line_height): Define here. Handle windowing + systems directly (without using estimate_mode_line_height_hook). + (x_y_to_hpos_vpos, get_tool_bar_item, note_tool_bar_highlight): + (update_window_cursor, update_cursor_in_window_tree) + (fast_find_position, fast_find_string_pos) + (note_mode_line_highlight, note_mode_line_or_margin_highlight) + (expose_area, expose_line, expose_overlaps, expose_window) + (expose_window_tree, phys_cursor_in_rect_p): New generic versions; + declared static as they are only used locally in xdisp.c. + (draw_glyphs): Rename from x_draw_glyphs and make static. + (tool_bar_item_info, notice_overwritten_cursor): Make static. + (frame_to_window_pixel_xy, get_glyph_string_clip_rect) + (set_output_cursor, x_cursor_to, handle_tool_bar_click) + (x_write_glyphs, x_insert_glyphs, x_clear_end_of_line): + (x_fix_overlapping_area, draw_phys_cursor_glyph, erase_phys_cursor) + (display_and_set_cursor, x_update_cursor, x_clear_cursor) + (show_mouse_face, clear_mouse_face, cursor_in_mouse_face_p) + (note_mouse_highlight, x_clear_window_mouse_face) + (cancel_mouse_face, x_draw_vertical_border, expose_frame) + (x_intersect_rectangles): New generic functions for use by xdisp.c + and GUI front-ends. + (syms_of_xdisp): Initialize and staticpro help_echo* variables. + Defvar_bool "x-streach-cursor" and "mouse-autoselect-window" here. + + * dispextern.h (Display_Info): Generic typedef for *_display_info. + (NativeRectangle): Generic typedef for rectangle type. + (enum window_part): Move here from window.c. + (struct redisplay_interface): New members flush_display_optional, + define_frame_cursor, clear_frame_area, draw_window_cursor, + draw_vertical_window_border, shift_glyphs_for_insert. + Rename member clear_mouse_face to clear_window_mouse_face. + (estimate_mode_line_height_hook): Remove hook. + (auto_raise_tool_bar_buttons_p): Don't declare extern. + (tool_bar_item_info): Remove prototype. + (help_echo_string, help_echo_window, help_echo_object) + (previous_help_echo_string, help_echo_pos) + (last_mouse_frame, last_tool_bar_item, mouse_autoselect_window): + (x_stretch_cursor_p, output_cursor): Declare extern. + (x_draw_glyphs, notice_overwritten_cursor): Remove prototypes. + (x_write_glyphs), x_insert_glyphs, x_clear_end_of_line) + (x_fix_overlapping_area, draw_phys_cursor_glyph, erase_phys_cursor) + (display_and_set_cursor, set_output_cursor, x_cursor_to) + (x_update_cursor, x_clear_cursor, x_draw_vertical_border) + (frame_to_window_pixel_xy, get_glyph_string_clip_rect) + (note_mouse_highlight, x_clear_window_mouse_face, cancel_mouse_face) + (handle_tool_bar_click, clear_mouse_face, show_mouse_face) + (cursor_in_mouse_face_p, expose_frame, x_intersect_rectangles): + Add prototypes. + (mode_line_string, marginal_area_string): Fix prototypes. + + * window.c (enum window_part): Move to dispextern.h. + (coordinates_in_window): Use enum window_part member names + instead of numbers to describe return value. + (struct check_window_data): Change part member to window_part. + (check_window_containing): Return window_part unaltered. + (window_from_coordinates): Change part arg from int to enum + window_part. Allow part arg to be null. All users changed. + + * window.h (window_from_coordinates): Fix prototype. + + * term.c (estimate_mode_line_height): Move to xdisp.c. + + * keyboard.c (make_lispy_event): Use enum window_part. + + * dispnew.c (mode_line_string, marginal_area_string): Use enum + window_part instead of int in arg list. Users changed. + + * xterm.h (No_Cursor): Declare as None for X. + (struct mac_output): Replace member cross_cursor by hand_cursor. + + * xterm.c: Remove consolidated defines and code. + (BETWEEN): Remove unused macro. + (x_draw_vertical_window_border, x_shift_glyphs_for_insert) + (x_define_frame_cursor, x_clear_frame_area) + (x_draw_window_cursor): New X-specific functions for RIF. + (x_redisplay_interface): Add new members. + + * xfns.c: Setup and use hand_cursor instead of cross_cursor. + + * w32term.h (struct w32_output): Remove cross_cursor member. + + * w32term.c: Remove consolidated defines and code. + (BETWEEN): Remove unused macro. + (w32_draw_vertical_window_border, w32_shift_glyphs_for_insert) + (w32_define_frame_cursor, w32_clear_frame_area) + (w32_draw_window_cursor): New W32-specific functions for RIF. + (w32_redisplay_interface): Add new members. + + * w32gui.h (No_Cursor): Define as 0 for W32. + (XRectangle): Add X compatible rectangle type. + (NativeRectangle): Declare as RECT for W32. + (CONVERT_TO_XRECT, CONVERT_FROM_XRECT, STORE_NATIVE_RECT): New macros. + + * w32fns.c: Remove setup of cross_cursor (already has hand_cursor). + + * w32console.c: Remove consolidated defines and code. + + * msdos.h (Display_Info): Add generic typedef. + + * msdos.c: Remove consolidated defines and code. + (IT_note_mouse_highlight, dos_rawgetc): Use enum window_part. + + * macterm.h (struct mac_output): Replace member cross_cursor by + hand_cursor. + (activate_scroll_bars, deactivate_scroll_bars): Add prototypes. + + * macterm.c: Remove consolidated defines and code. + (BETWEEN): Remove unused macro. + (mac_draw_vertical_window_border, mac_shift_glyphs_for_insert) + (mac_define_frame_cursor, mac_clear_frame_area) + (mac_draw_window_cursor): New Mac-specific functions for RIF. + (x_redisplay_interface): Add new members. + + * macgui.h (No_Cursor): Define as 0 for Mac. + (XRectangle): Add X compatible rectangle type. + (NativeRectangle): Declare as Rect for Mac. + (CONVERT_TO_XRECT, CONVERT_FROM_XRECT, STORE_NATIVE_RECT): New macros. + + * macfns.c (x_set_mouse_color): Setup hand_cursor. + (x_set_cursor_color): Use x_display_and_set_cursor. + + * Makefile.in (xdisp.o): Add dependency on blockinput.h and files + included from it. Add dependency on keymap.h. + + * makefile.w32-in (xdisp.o): Add dependency on keymap.h. + +2003-03-21 Kenichi Handa <handa@m17n.org> + + * fileio.c (Fexpand_file_name): Fix previous change. + +2003-03-19 Kenichi Handa <handa@m17n.org> + + * fileio.c (Ffile_name_directory): Reconstruct file name by + make_specified_string. + (Ffile_name_nondirectory, Ffile_name_as_directory) + (Fdirectory_file_name, Fexpand_file_name) + (Fsubstitute_in_file_name): Likewise. + (Fread_file_name): Compare decoded homedir with DIR and + DEFAULT_FILENAME. + + * alloc.c (make_specified_string): If NCHARS is negative, count + the number of characters. + +2003-03-18 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (xg_frame_cleared): Call gtk_widget_queue_draw for + all widgets. + + * gtkutil.h: Removed xg_ignore_next_thumb. + +2003-03-18 Kenichi Handa <handa@m17n.org> + + * coding.c (Vchar_coding_system_table): Remove this variable. + (Vcoding_system_safe_chars): New variable. + (intersection): Remove this function. + (find_safe_codings): Don't use Vchar_coding_system_table, but try + all codings in SAFE_CODINGS. + (Ffind_coding_systems_region_internal): Adjust for the change of + find_safe_codings. Get generic coding systems from + Vcoding_system_safe_chars. + (Fdefine_coding_system_internal): New function. + (syms_of_coding): Defsubr Sdefine_coding_system_internal. + Initialize and staticpro Vcoding_system_safe_chars. + +2003-03-18 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (xg_set_toolkit_scroll_bar_thumb): Check if new values + equal old values before updating. + + * xterm.c (xg_scroll_callback): Remove xg_ignore_next_thumb. + + * gtkutil.c (xg_initialize): Remove xg_ignore_next_thumb. + +2003-03-17 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c: Removed handle_fixed_child, struct xg_last_sb_pos. + (xg_resize_widgets): Don't call foreach(handle_fixed_child). + (xg_gtk_scroll_destroy): Remove free of struct xg_last_sb_pos. + (scroll_bar_button_cb): Set bar->dragging to nil on button release. + (xg_create_scroll_bar): Pass bar to button event callback. + (xg_find_top_left_in_fixed): New function. + (xg_update_scrollbar_pos): Don't call gdk_window_clear on + whole scroll bar area. Get old position with + xg_find_top_left_in_fixed, calculate and only clear needed areas. + (xg_set_toolkit_scroll_bar_thumb): Do not adjust scroll bar if + dragging is in progress. Calculate whole as for Motif. + Remove code that saved last values. Call gtk_range functions to + set scroll bar sizes. + + * gtkutil.h: Removed xg_ignore_next_thumb. + +2003-03-17 Juanma Barranquero <lektu@terra.es> + + * makefile.w32-in ($(BLD)/xdisp.$(O)): Add dependency on blockinput.h + and files included from it. + +2003-03-18 Stefan Monnier <monnier@cs.yale.edu> + + * keymap.c (accessible_keymaps_1): Break cycles but without preventing + multiple occurrences of the same keymap under different prefixes. + (Faccessible_keymaps): Remove code redundant since 1994-08-03T07:39:00Z!rms@gnu.org. + +2003-03-16 Jason Rumney <jasonr@gnu.org> + + * w32gui.h: Use HDC for Display. + + * w32term.c (w32_encode_char): Prevent double-byte chars from + crashing Emacs. + + * w32fns.c (jpeg_load, png_load, slurp_file): Read image files + as binary. + +2003-03-16 Juanma Barranquero <lektu@terra.es> + + * xdisp.c (x_produce_glyphs): Use FRAME_BASELINE_OFFSET. + +2003-03-16 Kim F. Storm <storm@cua.dk> + + The following changes consolidate some of the gui-independent + parts of the processing and drawing of "glyph strings" from + xterm.c, w32term.c, and macterm.c into xdisp.c. + + * dispextern.h (struct glyph): Reduce face_id member from 22 to + 21 bits (this reduces number of faces from 4M to 2M). + Replace W32 specific w32_font_type member (2 bits) by generic + font_type member (3 bits) for portability. + (FONT_TYPE_UNKNOWN): New define, default for font_type member. + (enum draw_glyphs_face): Define here. + (struct glyph_string): Define here. Merge W32 and X versions. + (struct redisplay_interface): New members per_char_metric, + encode_char, compute_glyph_string_overhangs, draw_glyph_string. + (VCENTER_BASELINE_OFFSET): Define here. + (dump_glyph_string, x_get_glyph_overhangs, x_produce_glyphs) + (x_draw_glyphs, notice_overwritten_cursor): Declare prototypes here. + + * xdisp.c: Consolidate gui-independent "glyph string" code here. + (dump_glyph_string): Moved here. + (init_glyph_string, append_glyph_string_lists, append_glyph_string) + (prepend_glyph_string_lists, get_glyph_face_and_encoding) + (fill_composite_glyph_string, fill_glyph_string) + (fill_image_glyph_string, fill_stretch_glyph_string) + (left_overwritten, left_overwriting, right_overwritten) + (right_overwriting, get_char_face_and_encoding) + (set_glyph_string_background_width, compute_overhangs_and_x) + (append_glyph, append_composite_glyph, produce_image_glyph) + (take_vertical_position_into_account, append_stretch_glyph) + (produce_stretch_glyph): New generic functions (based on X version). + Call platform specific functions through rif. + (INIT_GLYPH_STRING): New macro, hides W32 details. + (BUILD_STRETCH_GLYPH_STRING, BUILD_IMAGE_GLYPH_STRING) + (BUILD_CHAR_GLYPH_STRINGS, BUILD_COMPOSITE_GLYPH_STRING) + (BUILD_GLYPH_STRINGS): Generic macros (based on X version). + (x_draw_glyphs, x_get_glyph_overhangs, x_produce_glyphs) + (notice_overwritten_cursor): + Generic functions exported to platform modules. Users changed. + + * xterm.h (FONT_DESCENT, FRAME_X_OUTPUT, FRAME_BASELINE_OFFSET) + (FONT_TYPE_FOR_UNIBYTE, FONT_TYPE_FOR_MULTIBYTE) + (STORE_XCHAR2B, XCHAR2B_BYTE1, XCHAR2B_BYTE2): + New macros for consolidated code. + + * xterm.c: Remove consolidated defines and code. + (x_per_char_metric, x_encode_char) + (x_compute_glyph_string_overhangs): Adapt to RIF requirements. + (x_redisplay_interface): Add new members. + + * w32gui.h (Display): Add dummy typedef for consolidation. + (XChar2b): Define alias for wchar_t for consolidation. + (STORE_XCHAR2B, XCHAR2B_BYTE1, XCHAR2B_BYTE2): New macros. + + * w32term.h (FRAME_X_OUTPUT, FRAME_X_WINDOW, FRAME_X_DISPLAY) + (FONT_TYPE_FOR_UNIBYTE, FONT_TYPE_FOR_MULTIBYTE): + New macros for consolidation. + + * w32term.c: Remove consolidated defines and code. + (BUILD_WCHAR_T, BYTE1, BYTE2): Macros removed; callers changed + to use STORE_XCHAR2B, XCHAR2B_BYTE1, XCHAR2B_BYTE2 instead. + (w32_per_char_metric): Change font_type arg to int for RIF. + (w32_encode_char): Return int according to RIF requirements. + (w32_compute_glyph_string_overhangs): Adapt to RIF. + (w32_get_glyph_overhangs): New function for RIF. Uses generic + x_get_glyph_overhangs. + (w32_redisplay_interface): Add new members. + + * macgui.h (XChar2b): Move typedef here for consolidation. + (STORE_XCHAR2B, XCHAR2B_BYTE1, XCHAR2B_BYTE2): New macros. + + * macterm.h (FRAME_X_OUTPUT, FRAME_X_WINDOW, FRAME_X_DISPLAY): + (FONT_TYPE_FOR_UNIBYTE, FONT_TYPE_FOR_MULTIBYTE): New macros for + consolidation. + + * macterm.c: Remove consolidated defines and code. + (mac_per_char_metric): New function for RIF. + (mac_encode_char): Adapt to new RIF requirements. + (mac_compute_glyph_string_overhangs): Adapt for RIF. + (x_redisplay_interface): Add new members. + +2003-03-15 Stefan Monnier <monnier@cs.yale.edu> + + * keymap.c (Vmenu_events): New var. + (syms_of_keymap): Initialize it. + (where_is_internal): Check more carefully what is a menu event. + +2003-03-14 Richard M. Stallman <rms@gnu.org> + + * lread.c (read1): After #!, exit loop on eof. + +2003-03-14 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.h: Add declaration for xg_frame_cleared. + + * xterm.c (x_clear_frame): Call xg_frame_cleared for GTK. + + * gtkutil.c (struct xg_last_sb_pos): New structure. + (handle_fixed_child): New function. + (xg_resize_widgets): Call handle_fixed_child on all scroll bar widgets + and force a redraw on them. + (xg_gtk_scroll_destroy): Free struct xg_last_sb_pos also. + (xg_create_scroll_bar): Add struct xg_last_sb_pos to scroll bar + so we can avoid unneeded redraws. + (xg_update_scrollbar_pos): Invalidate data in xg_last_sb_pos + and force a redraw on the scroll bar. + (xg_set_toolkit_scroll_bar_thumb): Do not change/redraw scroll bar + if xg_last_sb_pos shows the positions are up to date. + (xg_frame_cleared): New function. + +2003-03-13 Kenichi Handa <handa@m17n.org> + + * coding.c (Fdetect_coding_region): Fix docstring. + (Fdetect_coding_string): Fix docstring. + +2003-03-13 Andreas Schwab <schwab@suse.de> + + * gtkutil.c: Add prototype for create_menus. + + * data.c (long_to_cons): Fix type of top. + + * xselect.c (selection_data_to_lisp_data): Use int instead of + long for an integer of size 4. + + * gtkutil.c (xg_update_frame_menubar): Add missing return value. + (xg_tool_bar_help_callback): Likewise. + +2003-03-12 Andreas Schwab <schwab@suse.de> + + * xterm.c (x_term_init) [USE_GTK]: Fix typo. + +2003-03-12 Kim F. Storm <storm@cua.dk> + + The following changes consolidate the fringe handling from + xterm.c, w32term.c, and macterm.c into xdisp.c. + + * xdisp.c: Consolidate fringe handling code here. + (left_bits, right_bits, continued_bits, continuation_bits) + (ov_bits, zv_bits): Define fringe bitmaps. + (fringe_bitmaps): New array holding fringe bitmaps. + (draw_fringe_bitmap): Draw a specific bitmap; call display + specific drawing routine via rif->draw_fringe_bitmap. + (draw_row_fringe_bitmaps): Generic replacement for + x_draw_row_fringe_bitmaps; all callers changed. + (compute_fringe_widths): Generic replacement for + x_compute_fringe_widths; all callers changed. + + * dispextern.h (enum fringe_bitmap_type): Define here. + (struct fringe_bitmap, struct draw_fringe_bitmap_params): New. + (fringe_bitmaps): Declare extern. + (struct redisplay_interface): New member draw_fringe_bitmap. + (draw_row_fringe_bitmaps, compute_fringe_widths): Declare extern. + + * xterm.c: Remove generic fringe code. + (x_draw_fringe_bitmap): Only perform actual fringe drawing. + (x_redisplay_interface): Add x_draw_fringe_bitmap member. + + * w32term.c: Remove generic fringe code. + (w32_draw_fringe_bitmap): Only perform actual fringe drawing. + (w32_redisplay_interface): Add w32_draw_fringe_bitmap member. + + * macterm.c: Remove generic fringe code. + (x_draw_fringe_bitmap): Only perform actual fringe drawing. + (x_redisplay_interface): Add x_draw_fringe_bitmap member. + +2003-03-11 Stefan Monnier <monnier@cs.yale.edu> + + * print.c (Fprin1_to_string): Return unibyte string if possible. + +2003-03-09 David Kastrup <dak@gnu.org> + + * process.c (read_process_output): We have allocated enough space + for readmax and carryover, so actually use the alloted space. + +2003-03-09 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * keyboard.c (make_lispy_event): Extend mouse_syms if needed for + toolkit scrollbar click. + + * xterm.c (x_window_to_scroll_bar): Call xg_get_scroll_id_for_window + for USE_GTK. + (x_scroll_bar_handle_click): Use this function for toolkit scrollbars + also. + (handle_one_xevent): ButtonPress/Release: If event is for a toolkit + scrollbar and control is pressed, call x_scroll_bar_handle_click. + + * gtkutil.h (xg_get_scroll_id_for_window): Declare. + + * gtkutil.c (xg_get_scroll_id_for_window): New function. + (xg_tool_bar_item_expose_callback): New function. + (xg_tool_bar_expose_callback): Call update_frame_tool_bar. + (xg_create_tool_bar): Connect xg_tool_bar_expose_callback to expose + on the tool bar widget. + (update_frame_tool_bar): Connect xg_tool_bar_item_expose_callback + to expose on the tool bar item widgets. + +2003-03-08 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (update_frame_tool_bar): Compare pixmap ID instead of + struct image* when deciding to update (struct image* may have been + deleted from the image cache). + + * xterm.c (handle_one_xevent): Pass ReparentNotify to Xt even if + the event isn't for a frame (i.e. for dialogs). + +2003-03-07 Kenichi Handa <handa@m17n.org> + + * coding.c (CODING_ADD_COMPOSITION_COMPONENT): If the number of + composition components reaches the limit, terminate composing. + (COMPOSITION_OK): New macro. + (detect_coding_iso2022): Use it if an escape sequence for + composition is found. + (coding_restore_composition): Adjust the number of composition + components if it is not sane. + +2003-03-06 Juanma Barranquero <lektu@terra.es> + + * w32term.h (struct w32_display_info): Add xrdb member to support + passing resources via -xrm on Windows. + + * w32term.c (w32_make_rdb): New function. + (w32_term_init): Use it to initialize xrdb member of w32_display_info + struct. Delete leftover code. + + * w32fns.c (Fx_get_resource, x_get_resource_string): Pass xrdb to check + for resources passed on the command line. + + * w32reg.c (w32_get_rdb_resource): New function. + (x_get_string_resource): Use it, so resources passed with -xrm + supercede the ones in the registry. + +2003-03-04 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.c (x_detect_focus_change): Call x_any_window_to_frame + instead of x_top_window_to_frame. + +2003-03-03 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xsmfns.c (smc_save_yourself_CB): Add --no-splash to options + when restarting Emacs. + +2003-03-03 Richard M. Stallman <rms@gnu.org> + + * buffer.c (Fkill_buffer): Use Frun_hook_with_args_until_failure + to run kill-buffer-query-functions. + (Qkill_buffer_query_functions): New var. + (syms_of_buffer): Init and staticpro it. + +2003-03-02 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.h (XSync): Define as gdk_window_process_all_updates for GTK. + +2003-02-25 Kim F. Storm <storm@cua.dk> + + * xdisp.c (redisplay_window): Fix infinite loop in redisplay. + If centering point failed to make whole line visible and vscroll + is non-zero, disable vscroll and try centering point again. + + * lread.c (read1): Accept `single space' syntax like (? x). + +2003-02-25 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * keyboard.c (cancel_hourglass_unwind): Surround with + #ifdef HAVE_X_WINDOWS. + +2003-02-25 Kenichi Handa <handa@m17n.org> + + * buffer.c (Fset_buffer_multibyte): Pay attention to the buffer + process only when "subprocesses" is defined. + +2003-02-24 Stefan Monnier <monnier@cs.yale.edu> + + * syntax.c (back_comment): Only check nestedness of 2nd char if needed. + +2003-02-24 Juanma Barranquero <lektu@terra.es> + + * callint.c (fix_command): Declare as static void and move before + Fcall_interactively. + + * xdisp.c (Qwhen): Declare external; it's now defined in callint.c. + (syms_of_xdisp): Don't initialize Qwhen. + +2003-02-23 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * keyboard.c (cancel_hourglass_unwind): New function. + (command_loop_1): Cancel hourglass with unwind-protect. + +2003-02-23 Richard M. Stallman <rms@gnu.org> + + * callint.c (fix_command): New subroutine, from Fcall_interactively. + Detect (when ... (region-beginning)) etc. + (Fcall_interactively): Call fix_command. + (Qif, Qwhen): New variables. + (syms_of_callint): Init and staticpro them. + + * regex.c (print_partial_compiled_pattern): Output to stderr. + +2003-02-23 Kai Gro,A_(Bjohann <kai.grossjohann@uni-duisburg.de> + + * dired.c (directory_files_internal): Don't expand directory. + (Fdirectory_files, Fdirectory_files_and_attributes): Do it here + instead. From Lars Hansen <larsh@math.ku.dk>. + +2003-02-22 Stefan Monnier <monnier@cs.yale.edu> + + * fns.c (string_to_multibyte): Remove unused var i. + (Flanginfo): Fix int/Lisp_Object mixup. + (void_call2): New fun. + (Fmap_char_table): Use it in place of call2. + + * xfaces.c (x_face_list_fonts): Fix int/Lisp_Object mixup. + + * macros.c (Fstart_kbd_macro): Remove redundant assignment. + + * keymap.c (copy_keymap_1): Make it static. + + * alloc.c (Fgarbage_collect): Don't use XSETFLOAT. + +2003-02-22 David Ponce <david@dponce.com> + + * lread.c (Fload): Don't check STRING_MULTIBYTE. + +2003-02-21 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * process.h: Removed subtty field from struct Lisp_Process. + + * process.c (create_process): Remove setting of subtty. + (emacs_get_tty_pgrp): New function. + (Fprocess_running_child_p, process_send_signal): + Call emacs_get_tty_pgrp instead of ioctl. + (process_send_signal): Call EMACS_KILLPG if ioctl TIOCSIGSEND fails. + +2003-02-21 Kai Gro,A_(Bjohann <kai.grossjohann@uni-duisburg.de> + + * keymap.c (Fdefine_key): Doc fix. + +2003-02-21 Juanma Barranquero <lektu@terra.es> + + Port of patch for RC by Klaus Zeitler <kzeitler@lucent.com>. + + * s/hpux10.h: Define POLL_INTERRUPTED_SYS_CALL, not + POLLING_PROBLEM_IN_SELECT. + + * s/hpux11.h: Include hpux10-20.h instead of hpux10.h. + Delete #undef of POLLING_PROBLEM_IN_SELECT. + + * s/hpux10-20.h: New file. + + * process.c (wait_reading_process_input): + Use POLL_INTERRUPTED_SYS_CALL, not POLLING_PROBLEM_IN_SELECT. + +2003-02-20 Kenichi Handa <handa@m17n.org> + + * fontset.c (check_fontset_name): If NAME is nil, return the + default fontset. + (override_font_info): New function. + (Fset_fontset_font): Document that NAME nil means the default fontset. + (Ffontset_info): If FONTSET is not the default fontset, merge + FONTSET onto the copy of the default fontset, and work on that + copy. Document that NAME nil means the default fontset. + (Ffontset_font): Document that NAME nil means the default fontset. + + * process.c (setup_process_coding_systems): If the process's + in/out descriptor is -1, do nothing. + +2003-02-19 Andreas Schwab <schwab@suse.de> + + * lisp.h (Fcancel_kbd_macro_events, Fstring_to_multibyte): + Add prototypes. + +2003-02-19 Kenichi Handa <handa@m17n.org> + + * xfaces.c (try_alternative_families): Try all scalable fonts if + Vscalable_fonts_allowed is not Qt. + +2003-02-19 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xfaces.c (x_face_list_fonts): Set *pfonts to 0 if no fonts found. + +2003-02-18 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.c (x_list_fonts): If maxnames is less than 0, get all font + names. + + * xfaces.c (x_face_list_fonts): Allocate struct font_name here. + (sorted_font_list): Move allocation of struct font_name to + x_face_list_fonts. + (Fx_font_family_list): Set font-list-limit to -1 to get all font names. + (Fx_list_fonts): Set maxnames to -1 to get all font names. + +2003-02-18 Kim F. Storm <storm@cua.dk> + + * lread.c (read1): Fix last change. + "`" is not always special. Allow "?" after a character constant. + +2003-02-18 Andrew Choi <akochoi@shaw.ca> + + * unexmacosx.c (copy_data_segment): Also copy __cfstring section. + +2003-02-18 Andreas Schwab <schwab@suse.de> + + * window.c (window_scroll_pixel_based): Move outside a + multi-glyph character before setting new window start. + + * xdisp.c (in_display_vector_p): New function. + * dispextern.h (in_display_vector_p): Declare. + +2003-02-18 Kim F. Storm <storm@cua.dk> + + * lread.c (read1): Fix and relax read syntax. + Recognize "[", ";", "#", and "?" after a dotted-pair dot. + Only recognize "," after dotted-pair dot if inside backquote. + Never include "`" or "," (inside backquote) in a symbol. + Allow dotted-pair dot after a character constant. + Allow "`" and "," (inside backquote) after a character constant. + +2003-02-17 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (xg_tool_bar_expose_callback): New function. + (xg_create_tool_bar): Force style of tool bar to be horizontal with + icons. Set name of tool bar to emacs-toolbar. + (update_frame_tool_bar): Connect expose event to + xg_tool_bar_expose_callback. + +2003-02-17 Richard M. Stallman <rms@gnu.org> + + * keyboard.c (this_command_key_count_reset): New variable. + Initiatize to 0 where this_command_key_count is set. + (read_char): Save and restore this_command_key_count_reset + around input method code. + (read_char): If this_command_key_count_reset, echo reread commands. + (Freset_this_command_lengths): Set this_command_key_count_reset to 1. + +2003-02-17 Kenichi Handa <handa@m17n.org> + + * fns.c (string_to_multibyte): Always return a multibyte string. + +2003-02-16 Jason Rumney <jasonr@gnu.org> + + * w32fns.c (w32_list_bdf_fonts, w32_list_fonts): + Negative max_fonts parameter means list all. + +2003-02-14 Dave Love <fx@gnu.org> + + * fns.c (Flanginfo): Doc fix. + +2003-02-13 Kim F. Storm <storm@cua.dk> + + * lread.c (read_escape): Interpret \s as a SPACE character, except + for \s-X in a character constant which still is the super modifier. + (read1): Signal an `invalid read syntax' error if a character + constant is immediately followed by a digit or symbol character. + + * search.c (Fmatch_data): Doc fix. Explicitly state that + match-data is undefined if last search failed. + + * keymap.c (Fcommand_remapping): Rename from Fremap_command. + All uses changed. + +2003-02-12 Juanma Barranquero <lektu@terra.es> + + * eval.c (Fdefmacro): Fix typo. + +2003-02-12 Kim F. Storm <storm@cua.dk> + + * macros.c (Fstart_kbd_macro): If appending, and last keyboard + macro is a string, convert meta modifiers in string when copying + the string into a vector. + +2003-02-11 Kim F. Storm <storm@cua.dk> + + * keymap.c (Fremap_command): Return nil if arg is not a symbol. + +2003-02-11 Kenichi Handa <handa@m17n.org> + + * Makefile.in (lisp, shortlisp): Add malayalam.el and tamil.el. + +2003-02-10 Kim F. Storm <storm@cua.dk> + + * process.c: Doc fixes. + (syms_of_process): Add `:' prefix to QCfilter_multibyte. + +2003-02-10 Kenichi Handa <handa@m17n.org> + + * fns.c (Fstring_to_multibyte): Fix typo in the docstring. + + * process.c (QCfilter_multibyte): New variable. + (setup_process_coding_systems): New function. + (Fset_process_buffer, Fset_process_filter): + Call setup_process_coding_systems. + (Fstart_process): Initialize the member `filter_multibyte' of + struct Lisp_Process. + (create_process): Call setup_process_coding_systems. + (Fmake_network_process): New keyward `:filter-multibyte'. + Initialize the member `filter_multibyte' of struct Lisp_Process. + Call setup_process_coding_systems. + (server_accept_connection): Call setup_process_coding_systems. + (read_process_output): If the process has a filter, decide the + multibyteness of a string to given to the filter by + `filter_multibyte' member of the process. If the process doesn't + have a filter and the result of conversion is unibyte, use + Fstring_to_multibyte (not Fstring_make_multibyte) to get the + multibyte form. + (Fset_process_coding_system): Call setup_process_coding_systems. + (Fset_process_filter_multibyte): New function. + (Fprocess_filter_multibyte_p): New function. + (syms_of_process): Intern and staticpro QCfilter_multibyte. + Defsubr Sset_process_filter_multibyte and + Sprocess_filter_multibyte_p. + + * process.h (struct Lisp_Process): New member filter_multibyte. + + * lisp.h (setup_process_coding_systems): Add prototype. + + * buffer.c (Fset_buffer_multibyte): If the current buffer has a + process, update coding systems for the process. + +2003-02-09 Kenichi Handa <handa@m17n.org> + + * fns.c (string_to_multibyte): New function. + (Fstring_to_multibyte): New function. + (syms_of_fns): Defsubr it. + +2003-02-08 Andreas Schwab <schwab@suse.de> + + * Makefile.in (EXEEXT): Define to @EXEEXT@ and use this variable + instead of the substitution. + +2003-02-08 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.c (x_make_frame_visible): Call gtk_window_deiconify. + + * xmenu.c (menu_position_func): Adjust menu popup position so that + the menu is fully visible. + +2003-02-07 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.c (x_text_icon, x_raise_frame, x_lower_frame) + (x_make_frame_invisible, x_wm_set_icon_position): + Use FRAME_OUTER_WINDOW instead of ifdef X_TOOLKIT/else/endif. + + * xfns.c (x_set_name, x_set_title): Ditto. + +2003-02-04 Richard M. Stallman <rms@gnu.org> + + * keyboard.c (echo_now): Update before_command_echo_length. + (Freset_this_command_lengths): Reset this_command_key_count etc. + immediately rather than arranging to do it later. + (before_command_key_count_1, before_command_echo_length_1) + (before_command_restore_flag): Vars deleted. + (add_command_key): Don't handle before_command_restore_flag. + (read_char, record_menu_key): Don't update before_command_key_count or + before_command_echo_length. + (read_char): Don't handle before_command_restore_flag. + + * keyboard.c (command_loop_1): Don't call adjust_point_for_property + in direct-output clauses if it wouldn't be called in the ordinary case. + +2003-02-04 Kim F. Storm <storm@cua.dk> + + * keyboard.c (syms_of_keyboard) <this-original-command>: Doc fix. + +2003-02-02 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (remove_from_container): Copying list is not needed. + (xg_update_menubar, xg_update_menu_item, xg_update_submenu) + (xg_modify_menubar_widgets, update_frame_tool_bar): Call g_list_free + on list returned from gtk_container_get_children to avoid memory leak. + +2003-02-01 Jason Rumney <jasonr@gnu.org> + + * w32fns.c (w32_create_pixmap_from_bitmap_data): Use alloca for + local malloc. + [HAVE_XPM]: Avoid clashes with XColor, XImage and Pixel + definitions in xpm.h. + (init_xpm_functions): New function. + (xpm_load): Sync with xfns.c. Adapt for Windows version of libXpm. + (init_external_image_libraries): Try to load libXpm.dll. + + * fileio.c (Fcopy_file) [WINDOWSNT]: Reverse logic for setting + timestamp. + +2003-01-31 Dave Love <fx@gnu.org> + + * syntax.c (Fskip_chars_forward) + (open-paren-in-column-0-is-defun-start): Doc fix. + +2003-01-31 Joe Buehler <jhpb@draco.hekimian.com> + + * fileio.c: Support // at start of name for Cygwin (just added proper + preprocessor tests). + + * keyboard.c: Port to Cygwin (just added proper preprocessor tests). + + * Makefile.in: Use @EXEEXT@ for Cygwin. + + * mem-limits.h: Added ifdef to define BSD4_2 for Cygwin. + + * s/cygwin.h: Added for Cygwin port. + +2003-01-31 Juanma Barranquero <lektu@terra.es> + + * w32fns.c (DrawText): Kludge to avoid a redefinition on Windows + when including gif_lib.h. + (init_gif_functions, init_tiff_functions): New functions. + (gif_load, tiff_load): Sync with xfns.c version. Adjust colors for + Windows. Disable color table lookups. Call library functions + through pointers determined at runtime. + (init_external_image_libraries): Try to load libungif.dll and + libtiff.dll. + +2003-01-31 Kenichi Handa <handa@m17n.org> + + * xdisp.c (SKIP_GLYPHS): New macro. + (set_cursor_from_row): Skip all glyphs that comes from overlay string. + +2003-01-30 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (free_frame_tool_bar): Remove debug printf. + +2003-01-30 Dave Love <fx@gnu.org> + + * alloc.c (Vgc_elapsed, gcs_done): New variables. + (Fgarbage_collect): Use them. + (init_alloc, syms_of_alloc): Set them up. + +2003-01-30 Juanma Barranquero <lektu@terra.es> + + * w32fns.c (init_external_image_libraries): Add missing operator. + +2003-01-29 Jason Rumney <jasonr@gnu.org> + + * w32fns.c (init_external_image_libraries): Allow jpeg-62.dll as + an alternative name for jpeg.dll. + +2003-01-29 Kenichi Handa <handa@m17n.org> + + * xdisp.c (set_cursor_from_row): Pay attention to string display + properties. + +2003-01-28 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de> + + * macterm.c (keycode_to_xkeysym_table): Add <tab>, <backspace>, + <escape>. + (keycode_to_xkeysym_table): Reformat and add more comments. + (XTread_socket): Drop special case for backspace. + +2003-01-28 Andrew Choi <akochoi@shaw.ca> + + * macfns.c (x_to_mac_color): Correct the order for parsing the RGB + values in old-style RGB specs. + +2003-01-27 Juanma Barranquero <lektu@terra.es> + + * w32fns.c (init_external_image_libraries): Try alternate names for the + jpeg dll. + +2003-01-27 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (create_dialog, xg_separator_p) + (xg_item_label_same_p, xg_update_menu_item): Check for NULL string + before calling strcmp or strlen. + +2003-01-26 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (update_frame_tool_bar): Call prepare_image_for_display + and handle image load failure. + +2003-01-26 Jason Rumney <jasonr@gnu.org> + + * w32fns.c (init_jpeg_functions, jpeg_resync_to_restart_wrapper): + New functions. + (jpeg_load): Sync with xfns.c version. Adjust colors for Windows. + Disable color table lookups. Call jpeg library functions + through pointers determined at runtime. + (init_external_image_libraries): Try to load jpeg.dll. + +2003-01-25 Richard M. Stallman <rms@gnu.org> + + * lisp.h: Declare format2 instead of format1. + + * fileio.c (barf_or_query_if_file_exists): + Call format2 instead of format1. + + * editfns.c (format2): New function, replaces format1 + but takes exactly two Lisp Objects as format args. + + * buffer.c (Fkill_buffer): Call format2 instead of format1. + +2003-01-25 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.h: Change to return value of x_dispatch_event to int. + + * xterm.c (x_filter_event): New function. + (event_handler_gdk, XTread_socket): Call x_filter_event. + (x_dispatch_event): Change to return value of finish. + (event_handler_gdk): Use return value from x_dispatch_event. + + * xfns.c (x_window): Call create_frame_xic for GTK version to + initialize input methods. + + * gtkutil.h: Add (void) prototypes. + + * gtkutil.c (create_menus): Remove code that puts the help menu to + the right. + +2003-01-25 Jason Rumney <jasonr@gnu.org> + + * w32fns.c (XPutPixel): Handle monochrome images; used for masks. + [HAVE_PNG]: Sync with xfns.c version. + (png_load): Adjust colors for Windows. Use Windows + bitmaps. Disable color table lookups. + (DEF_IMGLIB_FN, LOAD_IMGLIB_FN): New macros. + (init_png_functions): New function. + (png_read_from_memory, png_load): Call png library functions + through pointers determined at runtime. + (QCloader, QCbounding_box, QCpt_width, QCpt_height): Declare. + (init_external_image_libraries): New function. + (init_xfns): Call it. + +2003-01-24 Andreas Schwab <schwab@suse.de> + + * minibuf.c (Fminibuffer_message): Verify type of parameter. + +2003-01-24 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (xg_initialize): Initialize id_to_widget here instead + of static initializer. + +2003-01-24 Dave Love <fx@gnu.org> + + * s/gnu-linux.h (GC_SETJMP_WORKS, GC_MARK_STACK): Define for more + architectures. + + * alloc.c (mark_stack) [!GC_LISP_OBJECT_ALIGNMENT && __GNUC__]: + Use __alignof__. + +2003-01-24 Kenichi Handa <handa@m17n.org> + + * keyboard.c (adjust_point_for_property): New second arg MODIFIED. + It it is nonzero, don't pretend that an invisible area doesn't exist. + (command_loop_1): Call adjust_point_for_property with proper + second arg. + +2003-01-22 Jason Rumney <jasonr@gnu.org> + + Sync changes with xterm.c and xfns.c. + + * w32term.c (x_draw_glyph_string_foreground) + (x_draw_composite_glyph_string_foreground): Implement overstriking. + + * w32term.c (x_write_glyphs): Clear phys_cursor_on_p if current + phys_cursor's hpos is overwritten. This is still not completely + correct, as it doesn't really make sense to use hpos at all to + get the cursor glyph (as that is relative to the width of the + characters on the line, which may have changed during the update). + + * w32term.c (notice_overwritten_cursor): Handle the special case + of the cursor being in the first blank non-text line at the + end of a window. + + * w32term.c (x_draw_hollow_cursor, x_draw_bar_cursor) + (x_draw_phys_cursor_glyph): Set phys_cursor_width here. + Compute from the x position returned by x_draw_glyphs. + + (x_display_and_set_cursor): Don't set phys_cursor_width here, + except for NO_CURSOR and system caret, to make phys_cursor_width + contain what its name suggests. + (notice_overwritten_cursor): Consider the cursor image erased if + the output area intersects the cursor image in y-direction. + + * w32term.c (note_mode_line_or_margin_highlight): Rename from + note_mode_line_highlight and extend. + + * w32term.c (last_window): New variable. + (w32_read_socket) <WM_MOUSEMOVE>: Generate SELECT_WINDOW_EVENTs. + (note_mouse_movement): Remove reimplemented code in #if 0. + + * w32fns.c (x_set_cursor_type): Set cursor_type_changed, + not update_mode_lines, and always set it to 1. + +2003-01-21 Jason Rumney <jasonr@gnu.org> + + * w32fns.c (IDC_HAND): Define it if system headers don't. + +2003-01-21 KOBAYASHI Yasuhiro <kobayays@otsukakj.co.jp> + + * w32term.h (struct w32_output): New member hand_cursor. + (WM_EMACS_SETCURSOR): New message definition. + + * w32term.c (note_mode_line_highlight): Delete #if 0 to enable + function w32_define_cursor. + (note_mouse_highlight): Initialize, setup cursor accoding to mouse + position, change member name output_data.x to output_data.w32 and + add function w32_define_cursor. + (show_mouse_face): Delete #if 0 to enable function w32_define_cursor + and change member name output_data.x to output_data.w32. + (w32_initialize_display_info): + Setup dpyinfo->vertical_scroll_bar_cursor. + + * w32fns.c (Vx_hand_shape): New variable. + (w32_wnd_proc): Add message entries for WM_SETCURSOR and + WM_EMACS_SETCURSOR. + (x-create-frame): Setup Cursor types. + +2003-01-21 David Ponce <david@dponce.com> + + * w32term.c (w32_encode_char): For DIM=1 charset, set + ccl->reg[2] to -1 before calling ccl_driver. + (Sync. with xterm.c x_encode_char change by Kenichi Handa + <handa@m17n.org> on 2002-09-30.) + (w32_draw_relief_rect): Declare all args. + (w32_define_cursor): New. + + * w32fns.c (w32_load_cursor): New function. + (w32_init_class): Use it. + (x_put_x_image): Declare all args. + +2003-01-21 Richard Dawe <rich@phekda.freeserve.co.uk> + + * Makefile.in (ALL_CFLAGS): Include MYCPPFLAGS, not MYCPPFLAG. + +2003-01-21 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c: Must include stdio.h before termhooks.h. + +2003-01-21 Dave Love <fx@gnu.org> + + * alloc.c (Fgc_status): Print zombie list. + (mark_maybe_object) [GC_MARK_STACK==GC_USE_GCPROS_CHECK_ZOMBIES]: + Fix assignment of zombies. + (Fgarbage_collect) [GC_MARK_STACK==GC_USE_GCPROS_CHECK_ZOMBIES]: + Don't take car of non-cons. + + * s/sol2-5.h (GC_SETJMP_WORKS, GC_MARK_STACK): Define. + + * s/sunos4-0.h (GC_SETJMP_WORKS, GC_MARK_STACK): Define. + +2003-01-20 David Ponce <david@dponce.com> + + * w32menu.c (digest_single_submenu): Declare all args. + + Sync with 2002-12-23 Richard M. Stallman <rms@gnu.org> + changes in xmenu.c: + + (parse_single_submenu): Use individual keymap's prompt + string as pane name, if there is one. + (set_frame_menubar): Save menu_items_n_panes from each call to + parse_single_submenu and use it when calling digest_single_submenu. + +2003-01-20 Steven Tamm <steventamm@mac.com> + + * macterm.c (XTread_socket): Check for valid, visible window + before sending a scroll-wheel event. + +2003-01-20 Richard M. Stallman <rms@gnu.org> + + * xdisp.c (redisplay_window): If mini window's buffer is not + a minibuffer, then redisplay it like other windows. + +2003-01-20 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (xg_create_frame_widgets): Check if there is an + external tool bar before setting tool bar height. + +2003-01-19 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.c (handle_one_xevent): Surround popup_activated + with #ifdef:s for non-toolkit version. + + * Makefile.in (XOBJ): Add gtkutil.o if USE_GTK. + (gtkutil.o): New file. + (TOOLKIT_DEFINES): Set to -DUSE_GTK if HAVE_GTK. + (LIBW): Set to @GTK_LIBS@ if USE_GTK. + + * gtkutil.c: New file for GTK version. + + * gtkutil.h: New file for GTK version. + + * xterm.h: Add xt_or_gtk_widget. + Include gtk files for USE_GTK. + (struct x_output): Add toolbar_height. + (struct x_output): Add GTK widgets and Gdk size_hints. + (GTK_WIDGET_TO_X_WIN, FRAME_GTK_OUTER_WIDGET, FRAME_GTK_WIDGET) + (FRAME_OUTER_WINDOW): New macros for USE_GTK. + (FRAME_OUTER_TO_INNER_DIFF_Y): Add FRAME_TOOLBAR_HEIGHT to calculation. + + * xterm.c: Include gtkutil.h for USE_GTK. + (free_frame_menubar): Declare extern void for USE_GTK. + (note_mouse_highlight): Check popup_activated for USE_GTK. + (xt_action_hook): Don't compile if USE_GTK. + (x_scroll_bar_to_input_event): Use CurrentTime for USE_GTK. + (xg_scroll_callback): New function. + (x_create_toolkit_scroll_bar): Call xg_create_scroll_bar for USE_GTK. + (x_set_toolkit_scroll_bar_thumb): Call xg_set_toolkit_scroll_bar_thumb + for USE_GTK. + (x_scroll_bar_create): Call xg_update_scrollbar_pos and + xg_show_scroll_bar for USE_GTK. + (x_scroll_bar_remove): Call xg_remove_scroll_bar for USE_GTK. + (XTset_vertical_scroll_bar): Call xg_update_scrollbar_pos for USE_GTK. + (event_handler_gdk): New function for USE_GTK. + (handle_one_xevent): Call xg_resize_widgets for USE_GTK. + (handle_one_xevent): Make sure widget is mapped before + calling x_real_positions for USE_GTK. + (XTread_socket): Add GTK event loop for USE_GTK. + (x_set_window_size): Call xg_frame_set_char_size for USE_GTK. + (x_make_frame_visible): Call gtk_widget_show_all for USE_GTK. + (x_make_frame_invisible): Call gtk_widget_hide for USE_GTK. + (x_iconify_frame): Add code for USE_GTK. + (x_free_frame_resources): Call gtk_widget_destroy for USE_GTK. + (x_wm_set_size_hint): Only compile if not USE_GTK. GTK version + is in gtkutil.c. + (x_term_init): Add initialization for GTK. + (syms_of_xterm): Set Vx_toolkit_scroll_bars for USE_GTK. + + * xmenu.c: Include gtkutil.h for USE_GTK. + (Fx_popup_menu): Use current position if x and y are nil. + (single_menu_item, single_menu_item, Fx_popup_dialog): + Check for USE_GTK. + (popup_widget_loop): New function for USE_GTK. + (x_activate_menubar): Add code for USE_GTK. + (popup_activate_callback, popup_deactivate_callback) + (menu_highlight_callback, menubar_selection_callback): + Add USE_GTK versions. + (update_frame_menubar): Call xg_update_frame_menubar for USE_GTK. + (set_frame_menubar): Call xg_modify_menubar_widgets for USE_GTK. + (free_frame_menubar): Only compile if not USE_GTK. GTK version + is in gtkutil.c. + (popup_selection_callback): New version for USE_GTK. + (create_and_show_popup_menu): New fuction, one USE_GTK version and + one USE_X_TOOLKIT version. + (xmenu_show): Call create_and_show_popup_menu. + (dialog_selection_callback): New version for USE_GTK. + (create_and_show_dialog): New fuction, one USE_GTK version and + one USE_X_TOOLKIT version. + (xdialog_show): Call create_and_show_dialog. + + * xfns.c: Include gtkutil for USE_GTK. + (x_window_to_frame, x_any_window_to_frame) + (x_non_menubar_window_to_frame, x_menubar_window_to_frame) + (x_top_window_to_frame): Add code for USE_GTK. + (x_set_background_color): Call xg_set_background_color for GTK. + (x_set_menu_bar_lines): Check for USE_GTK. + (x_set_tool_bar_lines): Call update_frame_tool_bar for USE_GTK. + (x_set_name, x_set_title): Call gtk_window_set_title for USE_GTK. + (x_window): Call xg_create_frame_widgets for USE_GTK. + (Fx_create_frame): Check for USE_GTK. + (Fx_file_dialog): New implementation for USE_GTK. + + * xdisp.c: Add check for USE_GTK for extern void set_frame_menubar. + (update_menu_bar): Add check for USE_GTK. + (update_tool_bar): Add check for USE_GTK and external tool bar. + (redisplay_tool_bar): Add check for USE_GTK and external tool bar. + (redisplay_internal): Add check for USE_GTK and popup_activated. + (redisplay_window): Add check for USE_GTK and FRAME_EXTERNAL_MENU_BAR. + (redisplay_window): Add check for USE_GTK and FRAME_EXTERNAL_TOOL_BAR. + (display_menu_bar): Add check for USE_GTK. + + * lisp.h (Vx_resource_name): Declare extern. + + * keyboard.c (kbd_buffer_get_event): Check MENU_BAR_ACTIVATE_EVENT + for USE_GTK. + (make_lispy_event): Check MENU_BAR_EVENT for USE_GTK. + + * frame.h (struct frame): Add external_tool_bar. Check for USE_GTK. + (FRAME_EXTERNAL_TOOL_BAR): New macro. + (FRAME_EXTERNAL_MENU_BAR): Check for USE_GTK. + + * fileio.c (Fread_file_name): Add check for USE_GTK. + + * dispnew.c (adjust_frame_glyphs_for_window_redisplay): + Add check for USE_GTK. + + * config.in: Added HAVE_GTK. + + * alloc.c (Fgarbage_collect): Call xg_mark_data for GTK. + +2003-01-18 Stefan Monnier <monnier@cs.yale.edu> + + * charset.h (Funibyte_char_to_multibyte): Export. + +2003-01-18 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xmenu.c (mouse_position_for_popup): New function. + (Fx_popup_menu): Call mouse_position_for_popup for X and + mouse_position_hook for others. + +2003-01-17 Kim F. Storm <storm@cua.dk> + + * editfns.c (Finsert): Mention `string-make-multibyte' and + `string-as-multibyte' in doc string. + +2003-01-17 Kenichi Handa <handa@m17n.org> + + * fontset.c (syms_of_fontset): Setup Vfont_encoding_alist here. + + * editfns.c (Fformat): Convert an unibyte char argument that is + formatted by "%c" to multibyte if the total result must be a + multibyte string. + +2003-01-16 Kim F. Storm <storm@cua.dk> + + * process.c (set-process-filter): Document unibyte/multibyte-ness + of string argument. + +2003-01-16 Kenichi Handa <handa@m17n.org> + + * charset.h (NEXT_CHAR_BOUNDARY, PREV_CHAR_BOUNDARY): New macros. + + * regex.c (GET_CHAR_BEFORE_2): Use PREV_CHAR_BOUNDARY. + (re_search_2): Likewise. + +2003-01-15 Kenichi Handa <handa@m17n.org> + + * xdisp.c (message_dolog): Fix bug of the case that *Message* + buffer is unibyte. + +2003-01-15 Francesco Potort,Al(B <pot@gnu.org> + + * fns.c (Fsubstring): Clarify doc string. + + * textprop.c (Ftext_properties_at, Fnext_char_property_change) + (Fprevious_char_property_change) + (Fnext_single_char_property_change) + (Fprevious_single_char_property_change, Fnext_property_change) + (Fnext_single_property_change, Fprevious_property_change) + (Fprevious_single_property_change, Fadd_text_properties) + (Fput_text_property, Fset_text_properties) + (Fremove_text_properties, Fremove_list_of_text_properties) + (Ftext_property_any, Ftext_property_not_all): Clarify doc strings. + +2003-01-14 Kim F. Storm <storm@cua.dk> + + * process.h (struct Lisp_Process): New member plist replaces old + member private_vars. All uses changed. + + * process.c: Reworked 2003-01-12 change -- call a plist a plist! + (QCplist): Rename from QCvars. Change all uses. + (Fprocess_plist): Replaces Fprocess_variable. Simplified. + (Fset_process_plist): Replaces Fset_process_variable. Simplify. + (syms_of_process): Intern, staticpro, defsubr these. + (Fmake_network_process): Describe :plist arg. Remove :vars arg. + +2003-01-14 Francesco Potort,Al(B <pot@gnu.org> + + * m/delta.h: Remove (obsolete). + +2003-01-13 Francesco Potort,Al(B <pot@gnu.org> + + * fileio.c (Fdelete_directory, Fdelete_file): Document the + behaviour in front of symlinks. + (Fdelete_file): Raise an error on directories. + +2003-01-13 Dave Love <fx@gnu.org> + + * fns.c (Freverse): Use QUIT. + +2003-01-13 Richard M. Stallman <rms@gnu.org> + + * minibuf.c (minibuffer_completion_contents): + Error if point is inside prompt. + + * keyboard.c (command_loop_1): Don't redisplay directly + if there's a post-command-hook. + + * fileio.c (syms_of_fileio) <directory-sep-char>: Doc fix. + (Fdo_auto_save): Add gcpros around Ffile_name_directory. + +2003-01-12 Kim F. Storm <storm@cua.dk> + + * process.h (struct Lisp_Process): New member private_vars. + + * process.c (QCvars): New variable. + (syms_of_process): Intern and staticpro it. + (Fset_process_contact): Removed function. + (Fprocess_variable, Fset_process_variable): New functions. + (syms_of_process): Defsubr them. + (Fstart_process): Initialize private_vars plist to nil. + (Fmake_network_process): New arg :vars to setup the private + variables for new network process. + (server_accept_connection): Copy server's private variables to + client process. + + * alloc.c (pure_alloc): Fixed 2003-01-10 changed (caused spurious + crashes). Code rewritten and simplified. Now directly aligns the + pointer and recalculates pure_bytes_used, rather than aligning the + size and adjusting the pointer. + +2003-01-11 Kim F. Storm <storm@cua.dk> + + * process.c (Fset_process_contact): New function. + (syms_of_process): defsubr it. + (make-network-process): Update doc. + +2003-01-10 Andreas Schwab <schwab@suse.de> + + * alloc.c (pure_alloc): Correct alignment for Lisp_Floats. + Reported by Berthold Gunreben <b.gunreben@web.de>. + +2003-01-10 Dave Love <fx@gnu.org> + + * composite.c (syms_of_composite): Make composition_hash_table weak. + +2003-01-09 Kim F. Storm <storm@cua.dk> + + * process.c (Fmake_network_process): Convert new port number + to host byte order for `:service t' case. From Mario Lang. + +2003-01-08 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xfns.c (Fx_file_dialog): Call XtAppNextEvent and x_dispatch_event + instead of XtAppProcessEvent. + + * xterm.c (handle_one_xevent): New function. + (x_dispatch_event): New function. + (XTread_socket): Call handle_one_xevent. + + * xterm.h (FRAME_OUTER_TO_INNER_DIFF_X/Y): New. + + * xmenu.c (Fx_popup_menu): If popping up at mouse position, + call XQueryPointer to get coordinates. + (popup_get_selection): Do not set popup_activated_flag to zero, + let popup_deactivate_callback do that. Needed for Motif. + Call x_dispatch_event instead of XtDispatchEvent. + (xmenu_show): Calculate root coordinate from frame top/left position. + +2003-01-08 Kim F. Storm <storm@cua.dk> + + * process.c (server_accept_connection): Fix recording of new + connection's local address in :local property of contact info. + (Fmake_network_process): Record local network address for new + client processes in :local property of contact info. + (format-network-address): Add arg OMIT-PORT. Change callers. + +2003-01-07 Dave Love <fx@gnu.org> + + * Makefile.in (fns.o): Depend on coding.h. + +2003-01-06 Dave Love <fx@gnu.org> + + * fns.c: Include coding.h. Use POINTER_TYPE*, not void*. + (Vlocale_coding_system): Declare. + (Qcodeset, Qdays, Qmonths, Qpaper): New. + (Flanginfo): New. + (syms_of_fns): Initialize new stuff. + +2003-01-07 Markus Rost <rost@math.ohio-state.edu> + + * minibuf.c (Fread_variable): Doc fix. + + * eval.c (Fuser_variable_p): Doc change. For custom variables, + use the same test as for custom-variable-p. + +2003-01-05 Richard M. Stallman <rms@gnu.org> + + * xdisp.c (try_scrolling): New arg LAST_LINE_MISFIT. + Count LAST_LINE_MISFIT in scroll margin for end of window. + Move label too_near_end before setting SCROLL_MARGIN_POS. + Set LAST_LINE_MISFIT before jumping there. + + * xdisp.c (try_scrolling): Calculate amount_to_scroll better in + scroll_conservatively case. If scrolling that much doesn't change + STARTP, move it down one line. + + * xdisp.c (redisplay_window): Pass last_line_misfit arg to + try_scrolling. Make it 1 after make_cursor_line_fully_visible fails. + + * xdisp.c (setup_echo_area_for_printing): Kill Emacs if no + selected frame. + + * keymap.c (apropos_predicate, apropos_accumulate): Make them static. + (syms_of_keymap): Staticpro them. + (Fapropos_internal): Initialize them and clear them out. + Don't GCPRO them. + + * buffer.c (syms_of_buffer) <scroll-up|down-aggressively>: Doc fixes. + + * lisp.h: New misc type Lisp_Save_Value. + (enum Lisp_Misc_Type): Add Lisp_Misc_Save_Value. + (XSAVE_VALUE): New macro. + (struct Lisp_Save_Value): New data type. + (union Lisp_Misc): Add u_save_value alternative. + (make_save_value): Declare. + + * alloc.c (make_save_value): New function. + + * xterm.c (x_catch_errors): Save dpy using make_save_value. + (x_catch_errors_unwind): Call XSync. + +2003-01-01 Richard M. Stallman <rms@gnu.org> + + * window.c (window_scroll_pixel_based): Partially undo last change. + + * keyboard.c (command_loop_1): Call adjust_point_for_property + in direct action cases for Qforward_char and Qbackward_char. + Set already_adjusted so it won't be done twice. + +2002-12-30 Richard Dawe <rich@phekda.freeserve.co.uk> + + * src/config.in (!HAVE_SIZE_T): Fix order of arguments in + type definition of size_t. + +2003-01-02 Steven Tamm <steventamm@mac.com> + + * macterm.c (syms_of_macterm): Provide the feature "mac-carbon" to + distinguish Carbon GUI builds from X11 builds on darwin. + +2002-12-30 Steven Tamm <steventamm@mac.com> + + * macterm.c (syms_of_macterm): Set mac-wheel-button-is-mouse-2 + to default to t. + +2002-12-29 Francesco Potort,Al(B <pot@gnu.org> + + * data.c (Fstring_to_number, Fminus): Better English in doc strings. + +2002-12-28 Steven Tamm <steventamm@mac.com> + + * Makefile.in (macosx-bundle): Fix Mac OS X/Carbon port to + allow building in a different directory than source. Uses some + GNU Make extensions, but there is no other make on Mac OS X. + +2002-12-26 Francesco Potort,Al(B <pot@gnu.org> + + * data.c (Fmakunbound, Ffmakunbound, Fmake_variable_buffer_local) + (Fsetq_default, Fmake_local_variable, Fkill_local_variable) + (Fmake_variable_frame_local, Faset, Fnumber_to_string, Fminus) + (Fstring_to_number): Mention the returned value in the doc strings. + +2002-12-23 Richard M. Stallman <rms@gnu.org> + + * buffer.c (syms_of_buffer) <scroll-up-aggressively> + <scroll-down-aggressively>: Doc fix. + + * xmenu.c (parse_single_submenu): Use individual keymap's prompt + string as pane name, if there is one. + (set_frame_menubar): Save menu_items_n_panes from each call to + parse_single_submenu and use it when calling digest_single_submenu. + + * window.c (window_scroll_pixel_based): Fix check for reaching BEGV. + Don't try to make last line fully visible if it is past end of window. + +2002-12-22 Steven Tamm <steventamm@mac.com> + + * macmenu.c (MIN_POPUP_SUBMENU_ID): Add. + (mac_menu_show): Add support for hierarchical popup menus. + (add_menu_item): Remove indentation support. + (fill_submenu, fill_menu): Create hierarchical menus + instead of using indentation. + +2002-12-22 Richard M. Stallman <rms@gnu.org> + + * xdisp.c (try_cursor_movement): Don't call try_window here. + (redisplay_window): Never redisplay minibuffer when inactive. + + * window.c (select_window_1): Undo 9/21 change. + +2002-12-22 Steven Tamm <steventamm@mac.com> + + * macterm.c (XTread_socket): Call KeyTranslate for control and + meta to deal correctly shifted non-alpha characters, like C-S-5 + being treated like C-%. Do not look for shift key to deal + with masking off control-key with mac-reverse-ctrl-meta. + +2002-12-21 Richard M. Stallman <rms@gnu.org> + + * xmenu.c (popup_get_selection): Now static. New arg DO_TIMERS. + If it is non-nil, run timers. Use an unwind-protect to requeue + the events that were read ahead. + (popup_get_selection_unwind): New subroutine. + (popup_get_selection_queue): File-scope variable now holds that queue. + (xmenu_show): Pass 0 for DO_TIMERS to popup_get_selection. + (xdialog_show): Pass 1 for DO_TIMERS to popup_get_selection. + Use an unwind-protect to pop down the dialog box. + (xdialog_show_unwind): New subroutine implements that. + + * xdisp.c (row_containing_pos): Change exit test using last_y. + (try_window_id): Abort if row_containing_pos returns null. + + * lread.c (load_error_handler): New function. + (Fload): Handle errors in Fsubstitute_in_file_name. + Don't expect Fsignal to return. + + * eval.c: Errors and throws work right with interrupt blocking. + (struct catchtag): New elt interrupt_input_blocked. + (unwind_to_catch): Restore interrupt_input_blocked from saved value. + (internal_catch, Fcondition_case, internal_condition_case) + (internal_condition_case_1, internal_condition_case_2): Save it. + (Fsignal): Don't do TOTALLY_UNBLOCK_INPUT. + + * editfns.c (Fformat): Add parens. + + * dired.c (file_name_completion): Fix that change. + Delete special quit-handling code; just use QUIT. + +2002-12-21 Tak Ota <Takaaki.Ota@am.sony.com> + + * dired.c (file_name_completion): Close directory on error + just as in directory_files_internal. + +2002-12-19 David Kastrup <David.Kastrup@t-online.de> + + * window.c (Fset_window_configuration): Set old_point to correct + value when new_current_buffer == current_buffer. + +2002-12-17 Ben Key <bkey1@tampabay.rr.com> + + Revisited my earlier fix for the following entry in etc/PROBLEMS: + "Emacs built on Windows 9x/ME crashes at startup on Windows XP, + or Emacs builtpart of on XP crashes at startup on Windows 9x/ME." + + These changes were in part based upon suggestions made by Peter + 'Luna' Runestig [peter@runestig.com]. + + * w32.c (g_b_init_is_windows_9x, g_b_init_open_process_token) + (g_b_init_get_token_information, g_b_init_lookup_account_sid) + (g_b_init_get_sid_identifier_authority ): Add several static + global variables. + + * w32.c (globals_of_w32): New function. Used to initialize those + global variables that must always be initialized on startup even + when the global variable initialized is non zero. Its primary + purpose at this time is to set the global variables + g_b_init_is_windows_9x, g_b_init_open_process_token, + g_b_init_get_token_information, g_b_init_lookup_account_sid, and + g_b_init_get_sid_identifier_authority to 0 on startup. + Called from main. + + * w32.c (is_windows_9x): Perform initialization only if + g_b_init_is_windows_9x is equal to 0. On initialization set + g_b_init_is_windows_9x equal to 1. + + * w32.c (open_process_token): Perform initialization only if + g_b_init_open_process_token is equal to 0. On initialization set + g_b_init_open_process_token equal to 1. + + * w32.c (get_token_information): Perform initialization only if + g_b_init_get_token_information is equal to 0. On initialization + set g_b_init_get_token_information equal to 1. + + * w32.c (lookup_account_sid): Perform initialization only if + g_b_init_lookup_account_sid is equal to 0. On initialization + set g_b_init_lookup_account_sid equal to 1. + + * w32.c (get_sid_identifier_authority): Perform initialization + only if g_b_init_get_sid_identifier_authority is equal to 0. + On initialization set g_b_init_get_sid_identifier_authority equal to 1. + + * w32fns.c (globals_of_w32fns): New function. Used to initialize + those global variables that must always be initialized on startup + even when the global variable initialized is non zero. + Its primary purpose at this time is to initialize the global variable + track_mouse_event_fn. + + * w32fns.c (w32_wnd_proc): Remove initialization of + track_mouse_event_fn from the handler for the WM_SETFOCUS message. + + * w32fns.c (syms_of_w32fns): Call globals_of_w32fns. + + * w32menu.c (globals_of_w32menu): New function. Used to + initialize those global variables that must always be initialized + on startup even when the global variable initialized is non zero. + Its primary purpose at this time is to initialize the global + variables get_menu_item_info and set_menu_item_info. + + * w32menu.c (initialize_frame_menubar): Remove initialization of + get_menu_item_info and set_menu_item_info. + + * w32menu.c (syms_of_w32menu): Call globals_of_w32menu. + + * w32.h (globals_of_w32, globals_of_w32fns, globals_of_w32menu): + Declare them. + + * emacs.c (main): Call globals_of_w32 prior to calling + init_environment if WINDOWSNT is defined. Call globals_of_w32fns + and globals_of_w32menu if initialized is non zero and HAVE_NTGUI + is defined. + + * w32term.c (x_update_window_begin): Fix Windows API error + detected by BoundsChecker. Test to determine if + w32_system_caret_hwnd is NULL prior to attempting to use + SendMessage to send the WM_EMACS_HIDE_CARET message to it. + + * w32term.c (x_update_window_end): Fix Windows API error + detected by BoundsChecker. Test to determine if + w32_system_caret_hwnd is NULL prior to attempting to use + SendMessage to send the WM_EMACS_SHOW_CARET message to it. + +2002-12-17 Kenichi Handa <handa@m17n.org> + + * coding.c (coding_system_require_warning): New variable. + (syms_of_coding): DEFVAR it. + + * coding.h (coding_system_require_warning): Extern it. + + * fileio.c (choose_write_coding_system): Even if + Vcoding_system_for_write is non-nil, if + coding_system_require_warning is nonzero, call + Vselect_safe_coding_system_function. + +2002-12-17 Markus Rost <rost@math.ohio-state.edu> + + * Makefile.in (lisp, shortlisp): Add cus-face and timer. + (lisp): Add font-core. + +2002-12-13 Stefan Monnier <monnier@cs.yale.edu> + + * textprop.c (text_read_only): New arg `propval'. + (get_char_property_and_overlay): Remove unused var `next_overlay'. + (verify_interval_modification): Use text_read_only's new arg. + +2002-12-13 Kenichi Handa <handa@m17n.org> + + * coding.c (Funencodable_char_position): Set pend correctly. + +2002-12-12 Jason Rumney <jasonr@gnu.org> + + * w32term.c (last_mousemove_x, last_mousemove_y): New variables. + (w32_read_socket) <WM_MOUSEMOVE>: Use them to detect non-movement. + Be more careful about when help_events are generated. + +2002-12-12 Steven Tamm <steventamm@mac.com> + + * macterm.c (mac_check_for_quit_char): Correctly set the + modifiers of the event to 0. + * mac.c (sys_select): Duplicate rfds before calling select to + ensure that rfds survive the while loop. + +2002-12-11 Kim F. Storm <storm@cua.dk> + + * xdisp.c (try_window_id): Don't call set_cursor_from_row if + row_containing_pos returned NULL. + +2002-12-10 Steven Tamm <steventamm@mac.com> + + * mac.c (sys_read): Fix sys_read to not call select if IO is + non-blocking. + (sys_select): Fix sys_select to not use a timeout larger than + the one given. + +2002-12-10 Juanma Barranquero <lektu@terra.es> + + * editfns.c (Fformat): Use alloca, not _alloca. + +2002-12-09 Richard M. Stallman <rms@gnu.org> + + * buffer.c (Fget_buffer_create): Call Qucs_set_table_for_input + as the last thing. + +2002-12-09 Dave Love <fx@gnu.org> + + * s/sol2-8.h: Removed. (Not necessary.) + +2002-12-09 Matthew Swift <swift@alum.mit.edu> + + * editfns.c (Fformat): Handle precision in string conversion + specifiers like libc functions do (ie, print at most that many + characters). + +2002-12-08 Richard M. Stallman <rms@gnu.org> + + * xdisp.c (row_containing_pos): Check more carefully + whether charpos is really in the row before returning it. + +2002-12-07 Steven Tamm <steventamm@mac.com> + + * sysdep.c (emacs_read) [HAVE_CARBON]: Have emacs_read use sys_read. + + * eval.c (Feval) [HAVE_CARBON]: Calls mac_check_for_quit_char at + each stack frame. This may change as it could be time consuming. + + * macterm.c (mac_check_for_quit_char, quit_char_comp) + (init_quit_char_handler, mac_determine_quit_char_modifiers) + (mac_initialize): Add code to check for pressing of quit_char + in the OS event queue. + + * mac.c (sys_select): Call mac_check_for_quit_char every second + while blocking on select. + + * mac.c (sys_read): Use sys_select to test for input first + before calling read, to allow C-g to break. + +2002-12-07 Richard M. Stallman <rms@gnu.org> + + * minibuf.c (Fcompleting_read): Doc fix. + + * lread.c (syms_of_lread) <load-history>: Doc fix. + + * fileio.c (Fcopy_file): Set immediate_quit around emacs_open call. + + * eval.c (Fdefun, Fdefmacro): Record in load-history redefining an + autoload. + + * data.c (Fdefalias): Record in load-history redefining an autoload. + + * alloca.c: Undo ifdef change accidentally made on 12-04. + +2002-12-06 Francesco Potort,Al(B <pot@gnu.org> + + * xfns.c (png_load): Avoid double gamma correction for PNG images. + +2002-12-04 Richard M. Stallman <rms@gnu.org> + + * sysdep.c (fcntl.h): Test only HAVE_FCNTL_H. + + * fileio.c (fcntl.h): Test only HAVE_FCNTL_H. + + * alloca.c: Don't use #error. + +2002-12-03 Dave Love <fx@gnu.org> + + * buffer.c (Qucs_set_table_for_input): New. + (Fget_buffer_create): Use it. + (Qset_buffer_major_mode_hook): Deleted. + (Fset_buffer_major_mode): Revert previous change. + (init_buffer_once): Intern ucs-set-table-for-input. + (syms_of_buffer): Delete Qset_buffer_major_mode_hook. + Add &Qucs_set_table_for_input. + +2002-12-03 Andreas Schwab <schwab@suse.de> + + * callint.c (Fcall_interactively): Use next_event only if less + than key_count. + +2002-12-02 Andrew Choi <akochoi@shaw.ca> + + * macmenu.c (add_menu_item, fill_menubar): Truncate menu item + names to 255 characters. + + * macterm.c (XTread_socket): If all frames have been collapsed, + expand the first one before handling drag-and-drop events. + + * s/darwin.h (GETPGRP_NO_ARG): Delete. Replaced by GETPGRP_VOID, + which is detected by autoconf. + +2002-12-01 Steven Tamm <steventamm@mac.com> + + * unexmacosx.c (copy_twolevelhints, dump_it): Now corrects the + offset in two hints table to allow prebinding to be redone and + allow the executable to be stripped. + +2002-11-29 Dave Love <fx@gnu.org> + + * fns.c (Frequire): Don't call LOADHIST_ATTACH if feature was + already provided. + +2002-11-29 Richard M. Stallman <rms@gnu.org> + + * xdisp.c (start_display): Check more intelligently for + whether the line is continued. + (move_it_vertically_backward): Clear it->continuation_lines_width. + +2002-11-28 Dave Love <fx@gnu.org> + + * s/amdahl.h, s/unipl5-0.h, m/sgi3000.h, s/3700.h, s/alliant-2800.h: + * s/alliant.h, s/altos.h: Deleted. (Unused/empty.) + +2002-11-27 Steven Tamm <steventamm@mac.com> + + * fns.c (Frequire): Change nesting allowance from 2 to 3 to cause + more descriptive error output from lread.c:Fload upon most require + cycles during boostrapping. + +2002-11-27 Jason Rumney <jasonr@gnu.org> + + * fileio.c (Finsert_file_contents): Give a more appropriate error + for files bigger than 2Gb when off_t is 32 bit. + + * dired.c (Ffile_attributes): Don't return negative file sizes for + files bigger than 2Gb when off_t is 32 bit. + +2002-11-27 Dave Love <fx@gnu.org> + + * s/irix6-0.h (GC_SETJMP_WORKS, GC_MARK_STACK): Define. + + * systty.h: Don't conditionally define GETPGRP_NO_ARG. + Test GETPGRP_VOID instead. + [BSD_TERMIOS]: Remove definitions (never used). + + * s/osf5-0.h (WAIT_USE_INT, SYS_SIGLIST_DECLARED, sys_siglist): + Don't define. + (GC_SETJMP_WORKS, GC_MARK_STACK): Define. + + * m/mips.h (WORDS_BIG_ENDIAN): Define conditionally. + +2002-11-25 Jason Rumney <jasonr@gnu.org> + + * w32.c (sys_write): Avoid non-blocking mode, which is not fully + supported. + +2002-11-25 Dave Love <fx@gnu.org> + + * unexalpha.c (update_dynamic_symbols): Cast arg of fatal_unexec. + + * Makefile.in (TEMACS_LDFLAGS): Update last change. + +2002-11-25 Andreas Schwab <schwab@suse.de> + + * m/ia64.h: Restore `#ifndef NOT_C_CODE' deleted by last change. + +2002-11-24 Steven Tamm <steventamm@mac.com> + + * unexmacosx.c (unexec_realloc): Use malloc_default_zone to + determine the size of pointers alloced in unexed space instead + of using possibly invalid emacs_zone pointers. This fixes the + binary incompatibility problems caused by updates to libSystem.B. + +2002-11-24 Richard M. Stallman <rms@gnu.org> + + * search.c (Fstring_match): Doc fix. + + * callint.c (Fcall_interactively): If a command fails because + `*' detects a read-only buffer, but RECORD_FLAG is set, + record it anyway if the args don't actually do tty input. + +2002-11-22 Dave Love <fx@gnu.org> + + * sysdep.c (stuff_char) [PROTOTYPES]: Provide ISO C arglist. + + * keyboard.c (interrupt_signal): Provide forward declaration. + (kbd_buffer_store_event): Don't declare interrupt_signal. + + * xdisp.c (store_frame_title_char) [PROTOTYPES]: Provide ISO C arglist. + +2002-11-21 Richard M. Stallman <rms@gnu.org> + + * eval.c (interactive_p): Skip any number of bytecode + and special form frames, in any order. + +2002-11-20 Jason Rumney <jasonr@gnu.org> + + * w32fns.c (convert_mono_to_color_image): New function. + (xbm_load, xbm_load_image): Use it when foreground or background + is explicitly set. + +2002-11-19 Dave Love <fx@gnu.org> + + * s/usg5-4.h, sco4.h (bcopy, bzero, bcmp): Don't define. + +2002-11-18 Jason Rumney <jasonr@gnu.org> + + * w32fns.c (x_build_heuristic_mask): Filter palette info from color. + (XPutPixel): Swap blue and red. + (xpm_format, pbm_format, png_format, jpeg_format, tiff_format) + (gif_format, gs_format): Use IMAGE_ASCENT_VALUE. + (xpm_image_p, pbm_image_p, png_image_p, jpeg_image_p) + (tiff_image_p, gif_image_p, gs_image_p): Don't check ascent. + +2002-11-18 Dave Love <fx@gnu.org> + + * m/orion105.h (HAVE_ALLOCA): Don't define. + + * m/m68k.h, m/arm.h, mtekxd88.h, m/tower32v3.h: Don't define alloca. + + * m/intel386.h: Don't include alloca.h or define alloca. + + * m/ia64.h: Don't include alloca.h, stdlib.h. Don't declare + malloc, realloc, calloc. + + * m/hp800.h, m/sr2k.h, m/ns16000.h, m/wicat.h (bcopy, bzero) + (bcmp): Don't define. + + * m/delta.h (bcopy, bzero, bcmp, alloca): Don't define. + + * m/amdahl.h: Don't define LIB_STANDARD. + + * m/alpha.h: Move OSF1 stuff from here to s/osf1.h. + + * s/osf1.h: Move OSF1 stuff from m/alpha.h to here. + + * s/irix4-0.h, s/irix5-0.h, m/powerpcle.h, m/sparc.h: + Don't include alloca.h. + + * s/aix3-2.h (HAVE_FSYNC): Don't define. + + * regex.c (_GNU_SOURCE): Don't define. + + * process.c (_GNU_SOURCE): Don't define. + + * fileio.c (_GNU_SOURCE, HAVE_FSYNC): Don't define. + +2002-11-18 Markus Rost <rost@math.ohio-state.edu> + + * s/sol2-8.h: Include sol2-6.h. + +2002-11-18 Miles Bader <miles@gnu.org> + + * dispextern.h (struct face): Add `overstrike' field. + * xterm.c (x_draw_glyph_string_foreground) + (x_draw_composite_glyph_string_foreground): Implement overstriking. + * xfaces.c (load_face_font): Set `face->overstrike' based on + result from choose_face_font. + (best_matching_font, choose_face_font): Add `needs_overstrike' + argument, and use it to return whether overstriking is desirable + for this face/font combo. + (set_font_frame_param): Pass new argument to choose_face_font. + +2002-11-17 Ben Key <BKey1@tampabay.rr.com> + + This change is my fix for the following entry in etc/PROBLEMS: + "Emacs built on Windows 9x/ME crashes at startup on Windows XP, + or Emacs builtpart of on XP crashes at startup on Windows 9x/ME." + + * w32.c: Added wrapper functions around the win32 API functions + OpenProcessToken, GetTokenInformation, LookupAccountSid, and + GetSidIdentifierAuthority. These wrapper functions serve two + purposes: + 1. They ensure that the wrapped function can never be called + when Emacs is running on an operating system on which they are + not supported (Microsoft Windows 95 / 98 / ME). + 2. They call the wrapped functions via function pointers rather + than calling them directly. This avoids taking advantage of the + undocumented fact that although these functions are not supported + in the 9x branch of Microsoft Windows, the functions do exist in + the version of advapi32.dll that is found in the 9x branch of + Microsoft Windows. + + * w32.c (init_user_info): Replace the calls to the win32 API + functions OpenProcessToken, GetTokenInformation, LookupAccountSid, + and GetSidIdentifierAuthority with calls to the newly added + wrapper functions. + + * w32.h: Added extern declarations for the following functions: + syms_of_w32term, syms_of_w32fns, syms_of_w32select, + syms_of_w32menu, and void syms_of_fontset. + + * w32fns.c (w32_wnd_proc): Add code to reinitialize the + function pointer track_mouse_event_fn in the handler for the + WM_SETFOCUS message. + + * w32menu.c (initialize_frame_menubar): Add code to + reinitialize the function pointers set_menu_item_info and + get_menu_item_info. + +2002-11-17 Ben Key <BKey1@tampabay.rr.com> + + * sound.c: Added a partial implementation of play-sound-internal + for Microsoft Windows. Added various #ifdef / #else / #endif + code blocks to separate the code that will compile under + Microsoft Windows from the code that is specific to GNU/Linux. + Moved several blocks of code around to make this separation of code + into Windows compatible and GNU/Linux compatible code blocks easier. + + * makefile.w32-in: Include sound.c and link with WinMM.lib. + + * s/ms-w32.h: Defined the symbol HAVE_SOUND so that the newly + added support for play-sound-internal under Windows would be + included in the build of Emacs. + +2002-11-16 Jason Rumney <jasonr@gnu.org> + + * w32fns.c (w32_load_system_font): Don't disable Cleartype. + + * w32term.c (w32_get_glyph_string_clip_rect): Clip cursor tightly. + +2002-11-15 Stefan Monnier <monnier@cs.yale.edu> + + * keyboard.c (command_loop_1): Fix int/Lisp_Object mixup. + (adjust_point_for_property): Move out of display and invisible even if + we were already inside before (in case a property was added while + we weren't looking). Be more careful when handling invisible props. + Skip invisible text as if it really wasn't there at all. + +2002-11-15 Jason Rumney <jasonr@gnu.org> + + * w32term.c (x_draw_image_foreground) + (w32_draw_image_foreground_1): Use standard copy and invert + operations to draw images. + + * w32fns.c (x_create_x_image_and_pixmap): Fill in palette for + depth of 1. + (xbm_read_bitmap_data): Invert bits as xbm is read in. + (XPutPixel): Don't invert bits here. + +2002-11-15 Jason Rumney <jasonr@gnu.org> + + * w32term.c (x_draw_image_foreground, x_draw_image_glyph_string) + (w32_draw_image_foreground_1): Handle image masks. + (x_draw_image_glyph_string): Don't BitBlt transparently. + + * w32fns.c (w32_defined_color): Adjust RGB values for Emacs. + (x_from_xcolors): Adjust RGB values for W32. + (image_background, image_background_transparent) + (postprocess_image, x_to_xcolors, x_disable_image) + (x_build_heuristic_mask): Adapt for W32 and enable. + (x_create_x_image_and_pixmap): Mark images with palettes as such. + (xbm_load): Remove unused variable. + +2002-11-14 Richard M. Stallman <rms@gnu.org> + + * buffer.c (syms_of_buffer): Doc fix. + +2002-11-14 Dave Love <fx@gnu.org> + + * alloc.c (SETJMP_WILL_NOT_WORK): Add note. + + * xterm.c (x_draw_relief_rect, x_draw_box_rect, x_update_cursor): + * xmenu.c (unuse_menu_items, digest_single_submenu): + * xfns.c (x_put_x_image): + * xdisp.c (message2_nolog, set_message): + * undo.c (record_point): + * terminfo.c (tparam): + * syntax.c (scan_sexps_forward): + * scroll.c (calculate_scrolling, calculate_direct_scrolling): + * composite.c (update_compositions): + * cm.c (calccost, cmgoto): + * charset.c (c_string_width): Declare all args (per C99). + + * frame.h (get_specified_cursor_type, get_window_cursor_type): Declare. + + * lisp.h (get_specified_cursor_type, get_window_cursor_type): + Don't declare. + + * emacs.c (main) [!VMS]: Avoid third arg. + + * fns.c (Fcopy_sequence): Doc fix. + (Fmap_char_table): Cast `call2'. + +2002-11-14 Francesco Potort,Al(B <pot@gnu.org> + + * s/sol2-8.h: New file. + +2002-11-14 Kim F. Storm <storm@cua.dk> + + * buffer.c (syms_of_buffer) <mode-line-format>: Document symbol + dependency on `risky-local-variable' and the :propertize form. + +2002-11-12 Stefan Monnier <monnier@cs.yale.edu> + + * fns.c (Fmap_char_table): Don't use map_char_table's function arg. + + * syntax.c (scan_sexps_forward): Undo last patch. + Use a more obvious fix: check eob before updating the syntax table. + +2002-11-09 Stefan Monnier <monnier@cs.yale.edu> + + * syntax.c (scan_sexps_forward): Update syntax table before reading + a char rather than after so we don't update the table past eob. + +2002-11-09 Dave Love <fx@gnu.org> + + * buffer.c (Fset_buffer_major_mode): Fix last change. + + * regex.c (regexec): Fix pmatch declaration. + + * cmds.c (Fself_insert_command): Apply Vtranslation_table_for_input. + + * keyboard.c (command_loop_1): Apply Vtranslation_table_for_input + to self-inserting characters. + (syms_of_keyboard) <keyboard-translate-table>: Doc fix. + + * coding.c (Vtranslation_table_for_input): New. + (syms_of_coding): DEFVAR it. + +2002-11-08 Juanma Barranquero <lektu@terra.es> + + * w32term.c (w32_draw_fringe_bitmap): Remove unused local variable + window. + +2002-11-08 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * process.c (Fformat_network_address): Remove unused locals p, + cp, and i. + +2002-11-06 Dave Love <fx@gnu.org> + + * buffer.c (Qset_buffer_major_mode_hook): New. + (Fset_buffer_major_mode): Use it. + +2002-11-06 Richard M. Stallman <rms@gnu.org> + + * xterm.c (x_term_init): Use turn_on_atimers, not start_polling + and stop_polling. + + * process.c (wait_reading_process_input): + Test POLLING_PROBLEM_IN_SELECT, not hpux. + Avoid initialization for auto Lisp_Object var. + + * s/hpux11.h (POLLING_PROBLEM_IN_SELECT): Add #undef. + + * s/hpux10.h (POLLING_PROBLEM_IN_SELECT): Defined. + +2002-11-05 Richard M. Stallman <rms@gnu.org> + + * s/sol2-5.h (BROKEN_SIGIO): Turn off the #undef. + + * callint.c (Fcall_interactively): New local filter_specs. + (Fcall_interactively): Check for progn as well as let. + Add a gcpro. + (Qprogn): New variable. + (syms_of_callint): Staticpro and init Qprogn. + +2002-11-04 John Paul Wallington <jpw@shootybangbang.com> + + * lread.c (Feval_buffer): Doc fix. + +2002-11-04 Dave Love <fx@gnu.org> + + * keyboard.c (read_char): Always translate iff + Vkeyboard_translate_table is a char table and c is valid. + + * xterm.c (XTread_socket): Check Lisp types for Vx_keysym_table + and fix C types. + +2002-11-03 Stefan Monnier <monnier@cs.yale.edu> + + * xdisp.c (single_display_prop_intangible_p): Strings are intangible. + + * editfns.c (get_pos_property): Don't hardcode Qfield. + + * keyboard.c (adjust_point_for_property): Handle `display' prop on + overlays. Also handle `invisible' prop. + +2002-11-02 Stefan Monnier <monnier@cs.yale.edu> + + * coding.c (decode_coding_emacs_mule, decode_coding_iso2022) + (decode_coding_sjis_big5, decode_eol): Allow lone \r in DOS EOL. + +2002-11-01 Andreas Schwab <schwab@suse.de> + + * editfns.c (Fmessage): Revert last change to properly handle %%. + +2002-11-01 Stefan Monnier <monnier@cs.yale.edu> + + * xmenu.c (unuse_menu_items): New fun. + (menu_items_inuse): New var. + (syms_of_xmenu): Initialize it. + (init_menu_items): Use it to detect re-entrance. + (Fx_popup_menu, Fx_popup_dialog, set_frame_menubar): Reset when done. + (Fx_popup_menu): Remove spurious XSETFRAME. + + * editfns.c (find_field): Make an exception for nil fields. + +2002-11-01 Dave Love <fx@gnu.org> + + * m/gec63.h: Deleted. + +2002-10-31 Dave Love <fx@gnu.org> + + * xterm.c (XTread_socket): Fix last change. + (xaw_scroll_callback): Cast call_data to long to avoid warning. + +2002-10-31 Stefan Monnier <monnier@cs.yale.edu> + + * process.c (Fformat_network_address): Fix int/Lisp_Object mixup. + +2002-10-30 Stefan Monnier <monnier@cs.yale.edu> + + * editfns.c (overlays_around, get_pos_property): New funs. + (find_field): Use them. + Also be careful not to modify POS before its last use. + (Fmessage): Don't Fformat if there's nothing to format. + +2002-10-30 Dave Love <fx@gnu.org> + + * process.c [HAVE_SYS_WAIT]: Include sys/wait.h. + [HAVE_PTY_H]; Include pty.h. + + * lread.c (Fload) <!load_dangerous_libraries>: Close fd. + + * xterm.c (Qeql): Declare. + (Vx_keysym_table): New. + (syms_of_xterm): Initialize it. + (XTread_socket): Use it. Deal with ASCII keysyms. + (XSetIMValues) [HAVE_X11R6]: Prototype. + + * keyboard.c (lispy_accent_codes, lispy_accent_keys): Extended. + (lispy_kana_keys): Comment out. + (make_lispy_event) [XK_kana_A]: Comment out. + (modify_event_symbol) <sizeof (long) == sizeof (EMACS_INT)>: + Fix sprintf call. + + * s/osf5-0.h (C_SWITCH_SYSTEM): Revert last change (fixed by + regexp.h change). + (TERMINFO, LIBS_TERMCAP): Define. + + * s/usg5-4.h (bcopy, bzero): Define conditional on HAVE_BCOPY. + (bcmp): Define conditional on HAVE_BCMP. + (NO_SIOCTL_H): Don't define. + (TIOCSIGSEND): Don't make conditional on IRIX6. + + * s/sol2-5.h: Don't include strings.h. + (bcopy, bzero, bcmp) [HAVE_BCOPY]: Don't undef. + + * s/irix6-0.h (IRIX6): Don't define. + (bcopy, bcmp, bzero): Don't undef. + + * s/irix6-5.h: Don't include strings.h. + (IRIX6): Don't define. + (bcopy, bcmp, bzero): Don't undef. + + * syntax.c (Fforward_comment): Doc fix. + +2002-10-29 Kim F. Storm <storm@cua.dk> + + * process.c (Fsignal_process): Allow PROCESS to be specified by + name in addition to pid (as integer or string). + +2002-10-28 Harald Maier <Harald.Maier.BW@t-online.de> (tiny change) + + * w32heap.c: Don't redefine _heap_init and _heap_term on MSVC 7 build + environments. + +2002-10-27 Kim F. Storm <storm@cua.dk> + + * xterm.c (note_mouse_highlight): Don't use mouse-face if hidden. + + * w32term.c (note_mouse_highlight): Don't use mouse-face if hidden. + + * msdos.c (IT_note_mouse_highlight): Don't use mouse-face if hidden. + + * macterm.c (note_mouse_highlight): Don't use mouse-face if hidden. + +2002-10-26 Richard M. Stallman <rms@gnu.org> + + * editfns.c (Fformat): Detect invalid format letters for floats. + +2002-10-25 Kenichi Handa <handa@m17n.org> + + * xfns.c (x_set_name): Encode by Qcompound_text unconditionally. + (x_set_title): Likewise. + +2002-10-25 Juanma Barranquero <lektu@terra.es> + + * macgui.h: + * w32gui.h: Remove definition of XColor. + + * dispextern.h [!HAVE_X_WINDOWS]: Define XColor. + +2002-10-24 Kim F. Storm <storm@cua.dk> + + * xdisp.c (get_window_cursor_type): New arg ACTIVE_CURSOR. + Callers changed (supply dummy arg). + + * lisp.h (get_window_cursor_type): Update prototype. + + * w32term.c (x_display_and_set_cursor): Get active_cursor from + get_window_cursor_type to track system caret. + +2002-10-24 Kim F. Storm <storm@cua.dk> + + * process.c (Fformat_network_address): New function. + (syms_of_process): Defsubr it. + (list_processes_1): Use it to format :local/:remote address if + service/host is not set; before Emacs would crash in that case. + (Fmake_network_process): Don't use Ffind_operation_coding_system + to setup coding system if host or service is not set. + +2002-10-23 Juanma Barranquero <lektu@terra.es> + + Patch suggested by Jay Finger <jay_finger@hotmail.com>. + + * w32term.c (w32_term_init): Pass XColor to w32_define_color, not + COLORREF. + + * macgui.h: + * w32gui.h: Add definition of XColor. + + * macfns.c: + * w32fns.c: + * xfaces.c: Remove definition of XColor. + +2002-10-22 Stefan Monnier <monnier@cs.yale.edu> + + * xfns.c (x_set_name, x_set_title): `icon.value' has unsigned char. + + * window.c (window_loop): For GET_LRU_WINDOW and GET_LARGEST_WINDOW>, + Only ignore truly dedicated windows. For UNSHOW_BUFFER, delete the + window if it is dedicated. + (Fshrink_window): Add preserve_before as was done for enlarge_window. + (Vspecial_display_function): Update docstring. + + * buffer.c (assoc_ignore_text_properties, Fother_buffer, Fkill_buffer) + (call_overlay_mod_hooks): Use CONSP and XCAR/XCDR. + (Fget_buffer_create, advance_to_char_boundary): Use BEG and BEG_BYTE. + +2002-10-21 Stefan Monnier <monnier@cs.yale.edu> + + * casefiddle.c (casify_region): Don't treat a prefix char as part + of a word when at the beginning. + +2002-10-17 Juanma Barranquero <lektu@terra.es> + + * lread.c (syms_of_lread): Fix typos. + +2002-10-17 Dave Love <fx@gnu.org> + + * Makefile.in (TEMACS_LDFLAGS): Add trailing comment. + +2002-10-16 Richard M. Stallman <rms@gnu.org> + + * fileio.c (Fcopy_file): Fix backward test of KEEP_TIME. + +2002-10-14 Juanma Barranquero <lektu@terra.es> + + * w16select.c (syms_of_win16select): Fix docstring for + `selection-coding-system'. + + * w32select.c (syms_of_w32select): Likewise. + +2002-10-14 Stefan Monnier <monnier@cs.yale.edu> + + * syntax.c (scan_lists): Don't get fooled by a symbol ending with + a backslash-quoted char. + (scan_lists, scan_sexps_forward): Pacify the compiler. + +2002-10-13 Richard M. Stallman <rms@gnu.org> + + * window.c (window_scroll): Set immediate_quit. + + * print.c (print): When backquote form is the car of a list, + output in old style. Use old_backquote_output to output all + comma forms inside it in old style too. + + * buffer.h (struct buffer): Move `undo_list' down below `name'. + +2002-10-11 Markus Rost <rost@math.ohio-state.edu> + + * emacs.c (syms_of_emacs) <kill-emacs-hook>: Doc fix (not run in + batch mode). + + * lread.c (Fload): Doc fix (load-suffixes). + +2002-10-10 Steven Tamm <steventamm@mac.com> + + * macterm.c (syms_of_macterm, mac_get_mouse_btn): + Reverse functionality of mac-wheel-button-is-mouse-2 to be correct. + Also switch the default to Qnil from Qt. + +2002-10-08 Kenichi Handa <handa@m17n.org> + + * coding.c (code_convert_region): When we need more GAP for + conversion, pay attention to the case that coding->produced is not + greater than coding->consumed. + +2002-10-07 Richard M. Stallman <rms@gnu.org> + + * unexelf.c (unexec): Redo 9/16 change, but only if IRIX6_5. + +2002-10-06 Andrew Choi <akochoi@shaw.ca> + + * macmenu.c (mac_menu_show): Add j to count menu items; match + menu_item_selection to it to find selected item. + +2002-10-06 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.c (XTread_socket): Fix from 2002-10-03 didn't cover all + cases. The correct fix is to pass ReparentNotify to Xt. + The shell widget interprets ConfigureNotify differently depending + on if it has been reparented or not. + +2002-10-05 Markus Rost <rost@math.ohio-state.edu> + + * editfns.c (Fformat_time_string): Doc fix. + +2002-10-05 John Paul Wallington <jpw@shootybangbang.com> + + * fns.c (Flength): Doc fix. + +2002-10-04 Stefan Monnier <monnier@cs.yale.edu> + + * keyboard.c (keyremap): New struct. + (read_key_sequence): Use it: globally replace keytran_foo with + keytran.foo and fkey_foo with fkey.foo. Rename temp vars + keytran_next and fkey_next to just `next'. + +2002-10-04 Steven Tamm <steventamm@mac.com> + + * macterm.c (keycode_to_xkeysym_table): Change return to be + treated like an X keysym. + +2002-10-03 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.c (XTread_socket): For ConfigureNotify, with x and y == 0, + and USE_MOTIF, call XTranslateCoordinates to get the real x and y. + This is to also handle x/y changes that occur because of a resize. + +2002-10-02 John Paul Wallington <jpw@shootybangbang.com> + + * frame.c (Vdelete_frame_functions): New variable. + (syms_of_frame): Initialize and defvar it. + (Fdelete_frame): Use it instead of delete-frame-hook. Don't run + it when frame's `tooltip' parameter is non-nil. + + * xfns.c (x_create_tip_frame): Set `tooltip' frame parameter to t. + + * w32fns.c (x_create_tip_frame): Likewise. + + * macfns.c (x_create_tip_frame): Likewise. + +2002-09-30 Kenichi Handa <handa@m17n.org> + + * xterm.c (x_encode_char): For DIM=1 charset, set ccl->reg[2] to + -1 before calling ccl_driver. + + * coding.c (decode_coding_emacs_mule): Check coding->cmp_data. + Only when it is non-nil, handle composition sequence. + (setup_coding_system) <0>: Don't force composition handling. + + * Makefile.in (lisp, shortlisp): Add utf-16.elc. + +2002-09-29 Richard M. Stallman <rms@gnu.org> + + * search.c (Freplace_match): Adjust match data for the substitution + just made in the buffer. + + * xdisp.c (STOP_POLLING, RESUME_POLLING): New macros. + (redisplay_internal): Use them. Do RESUME_POLLING at end of function. + +2002-09-27 Richard M. Stallman <rms@gnu.org> + + * keyboard.c (STOP_POLLING, RESUME_POLLING): New macros. + (read_char): Use them. Do all exits thru the end of the function. + +2002-09-27 Kenichi Handa <handa@etl.go.jp> + + * xfaces.c (try_font_list): Pay attention to the case that FAMILY + is nil. + +2002-09-26 Richard M. Stallman <rms@gnu.org> + + * regex.h (__restrict_arr): Don't define if already defined. + + * coding.c (run_pre_post_conversion_on_str): + Save and restore Vdeactivate_mark. + +2002-09-26 John Paul Wallington <jpw@shootybangbang.com> + + * minibuf.c (Fminibufferp): Add an optional `buffer' argument. + +2002-09-26 Kenichi Handa <handa@etl.go.jp> + + * xfaces.c (try_font_list): New arg PREFER_FACE_FAMILY. If it is + nonzero, try face's family at first. Otherwise try FAMILY at first. + (choose_face_font): If C is a single byte char or latin-1, call + try_font_list with PREFER_FACE_FAMILY 1. + +2002-09-21 Richard M. Stallman <rms@gnu.org> + + * window.c (select_window_1): Don't select frame. + Set frame's selected window only when frame itself is selected. + (Fselect_window): Doc fix. + +2002-09-18 Kim F. Storm <storm@cua.dk> + + * process.c (make-network-process): Doc fix (there is no + network-server-log-function hook). + +2002-09-18 Richard M. Stallman <rms@gnu.org> + + * print.c (print): Clear out the unused parts of Vprint_number_table. + (syms_of_print): Doc fix for `print-number-table'. + + * unexelf.c (unexec): Undo previous change. + +2002-09-17 Andreas Schwab <schwab@suse.de> + + * m/alpha.h [LINUX]: Don't define DATA_START. + +2002-09-16 Dave Love <fx@gnu.org> + + * unexelf.c (unexec): Deal with .got, reinstating change from + 25-08-1999. + +2002-09-13 Richard M. Stallman <rms@gnu.org> + + * s/sol2-6.h (UNEXEC): Comment out definition. + + * unexsol.c (unexec): Don't downcase first letter of error msg. + + * xfaces.c (Fcolor_supported_p): Just one arg is required. + +2002-09-12 Markus Rost <rost@math.ohio-state.edu> + + * unexsol.c: Include buffer.h, charset.h, coding.h. + +2002-09-11 Richard M. Stallman <rms@gnu.org> + + * unexsol.c: Don't use report_file_error; do it by hand + using dlerror. + + * process.c (wait_reading_process_input, both versions): + Before calling turn_on_atimers, call stop_polling. + + * emacs.c (syms_of_emacs) <command-line-args>: Doc fix. + + * xdisp.c (try_scrolling): If after make_cursor_line_fully_visible + we go to too_near_end, call clear_glyph_matrix. + (redisplay_window): After make_cursor_line_fully_visible, + call clear_glyph_matrix and bypass `goto done'. + + * xfns.c (x_report_frame_params): If FRAME_SCROLL_BAR_PIXEL_WIDTH is 0 + and we have non-toolkit scroll bars, return nil for scroll-bar-width. + +2002-09-10 Richard M. Stallman <rms@gnu.org> + + * fileio.c (Fdo_auto_save): Catch error making directory. + Only call push_message if we need to. + At the same time, make an unwind-protect to pop it. + Rename local message_p to old_message_p. + (do_auto_save_make_dir, do_auto_save_eh): New functions. + (do_auto_save_unwind): Don't call pop_message. + + * lisp.h (pop_message_unwind): Renamed from push_message_unwind. + + * keyboard.c (Fexecute_extended_command): Use pop_message_unwind. + + * alloc.c (Fgarbage_collect): Use pop_message_unwind. + + * xdisp.c (pop_message_unwind): Renamed from push_message_unwind. + +2002-09-10 Stefan Monnier <monnier@cs.yale.edu> + + * regex.c (DISCARD_FAILURE_REG_OR_COUNT): Delete. + (CHECK_INFINITE_LOOP): Don't pop anything: just set `cycle' to 1. + (re_match_2_internal): Be more careful with infinite loops. + +2002-09-10 Kim F. Storm <storm@cua.dk> + + * macros.c (end_kbd_macro): New function. + (Fend_kbd_macro): Use it. + + * macros.h (end_kbd_macro): Declare extern. + + * keyboard.c (Fdiscard_input): If defining keyboard macro, + end and save it instead of discarding it. + +2002-09-09 Markus Rost <rost@math.ohio-state.edu> + + * s/sol2-6.h: Fix typo. Add comment. + +2002-09-09 Richard M. Stallman <rms@gnu.org> + + * regex.c (regnum_t): Use signed int, not unsigned int. + + * s/sol2-6.h: New file. + + * s/sol2-5.h (UNEXEC): Definition deleted. + +2002-09-08 Kim F. Storm <storm@cua.dk> + + * macros.c (executing_macro_index): Change type to EMACS_INT. + (syms_of_macros): DEFVAR_INT it (needed by kmacro). + + * macros.h (executing_macro_index): Change type to EMACS_INT. + +2002-09-06 Richard M. Stallman <rms@gnu.org> + + * casetab.c (set_case_table): Make canon table point to eqv table. + +2002-09-06 Juanma Barranquero <lektu@terra.es> + + * coding.c (syms_of_coding): Fix spacing. + + * composite.c (Fcompose_region_internal) + (Fcompose_string_internal): Likewise. + + * data.c (Flsh): Likewise. + + * fontset.c (Fset_fontset_font): Likewise. + + * macfns.c (Fx_server_max_request_size): Likewise. + + * w16select.c (syms_of_win16select): Likewise. + + * w32select.c (syms_of_w32select): Likewise. + + * xselect.c (syms_of_xselect): Likewise. + +2002-09-05 Richard M. Stallman <rms@gnu.org> + + * regex.c (set_image_of_range_1): In no-TRANSLATE case, + call EXTEND_RANGE_TABLE and return a proper value. + (set_image_of_range): Don't call set_image_of_range_1 + if no TRANSLATE or if range includes all of Latin-1. + Only call it for the Latin-1 part of the range. + For other cases, make two separate ranges, + one for the original specified characters and one for + their case-conversions. + +2002-09-04 Richard M. Stallman <rms@gnu.org> + + * s/sol2-5.h (UNEXEC): Use unexsol.o. + + * window.c (displayed_window_lines): Correct for one-off bug + in HEIGHT on non-window displays. + + * regex.c (set_image_of_range_1): New function. + (set_image_of_range): Use set_image_of_range_1 for Latin-1. + Return a value to indicate running out of memory. + (SET_RANGE_TABLE_WORK_AREA): Check value from set_image_of_range. + (extend_range_table_work_area): New subroutine. + (EXTEND_RANGE_TABLE): Replaces EXTEND_RANGE_TABLE_WORK_AREA. + Different calling conventions, and used from set_image_of_range{,_1}. + (IMMEDIATE_QUIT_CHECK): Definitions moved. + +2002-09-04 Juanma Barranquero <lektu@terra.es> + + * makefile.w32-in: All dependencies updated. + +2002-09-01 Richard M. Stallman <rms@gnu.org> + + * unexsol.c: New file. + + * xfns.c (Qbox): Declare external, don't define. + + * xdisp.c (redisplay_window) <force-start case>: + If point is on semi-visible last line, reposition + it at previous line. + + * alloc.c (display_malloc_warning): Use display-warning. + (malloc_warning_1): Function deleted. + + * alloc.c [ALLOC_DEBUG]: #undef INLINE. + + * lread.c (read1): Handle #! by skipping the line. + +2002-08-31 Richard M. Stallman <rms@gnu.org> + + * Makefile.in (TEMACS_LDFLAGS): Renamed from ALL_LDFLAGS. + Don't include LDFLAGS. + (temacs): Pass LDFLAGS separately, and not via YMF_PASS_LDFLAGS. + +2002-08-31 Eli Zaretskii <eliz@is.elta.co.il> + + * xdisp.c (get_window_cursor_type): Don't use x_highlight_frame + member of x_display_info unless we compile for some window system. + +2002-08-31 Kim F. Storm <storm@cua.dk> + + * xdisp.c (Valternate_cursor_type, Qalternate_cursor_type): Removed. + (get_window_cursor_type): Don't use them. + (syms_of_xdisp): Remove intern, staticpro, and defvar for them. + +2002-08-30 Kenichi Handa <handa@etl.go.jp> + + * xdisp.c (get_next_display_element): Fix previous change. + +2002-08-30 Andrew Choi <akochoi@shaw.ca> + + * macterm.c (expose_overlaps): New function (merge code from xterm.c). + (expose_window): Use it to fix the display of overlapping + rows (merge code from xterm.c). + + * macfns.c (Qbox): Add extern declaration. + +2002-08-30 Juanma Barranquero <lektu@terra.es> + + * w32fns.c (Qbox): Make extern. + (syms_of_w32fns): Remove initialization of Qbox. + +2002-08-30 Rune Kleveland <runekl@viewpoint.no> (tiny change) + + * xfns.c (Fx_open_connection): Fix error message. + +2002-08-30 Kim F. Storm <storm@cua.dk> + + The following changes consolidates the handling of the cursor + type in xdisp.c, moving duplicate code and functionality from + xfns.c, xterm.c, w32fns.c, w32term.c, macfns.c, and macterm.c. + + * frame.h (enum text_cursor_kinds): Consolidated here. + Added DEFAULT_CURSOR value. + (struct frame) <desired_cursor, cursor_width> + <blink_off_cursor, blink_off_cursor_width>: New fields. + Consolidated from output_x, output_w32 and output_mac structs. + (FRAME_DESIRED_CURSOR, FRAME_CURSOR_WIDTH, FRAME_BLINK_OFF_CURSOR) + (FRAME_BLINK_OFF_CURSOR_WIDTH): Macros consolidated here. + + * xdisp.c (Qbar, Qhbar, Qbox, Qhollow, Vblink_cursor_alist): + Variables consolidated here. + (Valternate_cursor_type, Qalternate_cursor_type): New variables. + (Vcursor_in_non_selected_windows): Renamed from + cursor_in_non_selected_windows and changed to Lisp_Object. + (syms_of_xdisp): Define and staticpro new and moved variables. + (get_specified_cursor_type): Renamed from x_specified_cursor_type; + consolidated here. Recognize Qhollow setting. + (set_frame_cursor_types): New function to set frame cursor types + based on the frame parameters. + (get_window_cursor_type): New function to calculate new cursor + type and width for the specified window. Based on duplicated + code consolidated here. + Enhancements: cursor-in-non-selected-windows may be a cursor type, + check buffer-local alternate-cursor-type and blink-cursor-alist + before using built-in blink off methods. + + * dispextern.h (cursor_in_non_selected_windows): Extern removed. + + * lisp.h (Qcursor_in_non_selected_windows): Extern removed. + (get_specified_cursor_type, get_window_cursor_type) + (set_frame_cursor_types): Added prototypes. + + * macfns.c (x_specified_cursor_type): Removed. + (x_set_cursor_type): Use set_frame_cursor_types. + (Qbar, Qbox): Removed. + (syms_of_macfns): Don't intern or staticpro them. + + * macterm.c (x_specified_cursor_type): Remove prototype. + (x_draw_bar_cursor): Use FRAME_CURSOR_WIDTH. + (x_display_and_set_cursor): Use get_window_cursor_type. + Remove unused local variables cursor_non_selected, active_cursor. + Redraw cursor if hbar cursor width changes. + (make_mac_frame): Set FRAME_DESIRED_CURSOR. + + * macterm.h (enum text_cursor_kinds): Removed. + (struct output_mac) <current_cursor, desired_cursor, cursor_width> + <blink_off_cursor, blink_off_cursor_width>: Members removed. + (FRAME_DESIRED_CURSOR): Macro removed. + + * w32fns.c (Vblink_cursor_alist): Removed. + (Qbar, Qhbar, Qbox, Qhollow): Removed. + (syms_of_w32fns): Don't intern, staticpro, or define them. + (x_specified_cursor_type): Removed. + (x_set_cursor_type): Use set_frame_cursor_types. + + * w32term.c (x_specified_cursor_type): Remove prototype. + (x_draw_bar_cursor): Use FRAME_CURSOR_WIDTH. + (x_display_and_set_cursor): Use get_window_cursor_type. + Remove unused local variables cursor_off_state. + Redraw cursor if hbar cursor width changes. + Changed all occurrences of w32_highlight_frame to x_highlight_frame. + + * w32term.h (enum text_cursor_kinds): Removed. + (struct output_w32) <current_cursor, desired_cursor, cursor_width> + <blink_off_cursor, blink_off_cursor_width>: Members removed. + (FRAME_DESIRED_CURSOR, FRAME_CURSOR_WIDTH, FRAME_BLINK_OFF_CURSOR) + (FRAME_BLINK_OFF_CURSOR_WIDTH): Macros removed. + (struct w32_display_info) <x_highlight_frame>: Renamed member from + w32_highlight_frame. + + * xfns.c (Vblink_cursor_alist): Removed. + (Qbar, Qhbar, Qbox, Qhollow): Removed. + (syms_of_xfns): Don't intern, staticpro, or define them. + (x_specified_cursor_type): Removed. + (x_set_cursor_type): Use set_frame_cursor_types. + + * xterm.c (x_specified_cursor_type): Remove prototype. + (x_draw_bar_cursor): Use FRAME_CURSOR_WIDTH. + (x_display_and_set_cursor): Use get_window_cursor_type. + Remove unused local variables cursor_off_state. + Redraw cursor if hbar cursor width changes. + + * xterm.h (enum text_cursor_kinds): Removed. + (struct output_x) <current_cursor, desired_cursor, cursor_width> + <blink_off_cursor, blink_off_cursor_width>: Members removed. + (FRAME_DESIRED_CURSOR, FRAME_CURSOR_WIDTH, FRAME_BLINK_OFF_CURSOR) + (FRAME_BLINK_OFF_CURSOR_WIDTH): Macros removed. + (x_specified_cursor_type): Remove prototype. + +2002-08-28 Richard M. Stallman <rms@gnu.org> + + * w32fns.c (x_set_cursor_type): Set FRAME_BLINK_OFF_CURSOR and + FRAME_BLINK_OFF_CURSOR_WIDTH using defaults and Vblink_cursor_alist. + (Vblink_cursor_alist): New variable. + (syms_of_w32fns): Initialize and defvar it. + (x_specified_cursor_type): Recognize Qbox for filled box. + Exceptions are hollow boxes. + (Qbox, Qhollow): New variables. + (syms_of_w32fns): Initialize and staticpro them. + + * w32term.h (FRAME_BLINK_OFF_CURSOR, FRAME_BLINK_OFF_CURSOR_WIDTH): + New macros. + (struct w32_output): New fields blink_off_cursor, + blink_off_cursor_width. + (FRAME_CURSOR_WIDTH): New macro. + + * w32term.c (x_display_and_set_cursor): Use FRAME_BLINK_OFF_CURSOR + and FRAME_BLINK_OFF_CURSOR_WIDTH for blinking cursor off. + + * w32term.c (x_display_and_set_cursor): Check FRAME_CURSOR_WIDTH + for bar cursor. + + * w32term.c (expose_overlaps): New function. + (expose_window): Use it to fix the display of overlapping rows. + +2002-08-28 Simon Josefsson <jas@extundo.com> + + * xfns.c (Fx_open_connection): Improve help when X connection + fails, xhost is insecure and xauth is better. + +2002-08-28 Juanma Barranquero <lektu@terra.es> + + * makefile.w32-in: Add missing dependencies on w32term.h and + composite.h. + + * emacs.c (USAGE1): Add missing newline. + +2002-08-27 Andrew Choi <akochoi@shaw.ca> + + * s/darwin.h [HAVE_LIBNCURSES]: Define HAVE_TERMINFO. + +2002-08-27 Richard M. Stallman <rms@gnu.org> + + * xfns.c (x_set_cursor_type): Set FRAME_BLINK_OFF_CURSOR and + FRAME_BLINK_OFF_CURSOR_WIDTH using defaults and Vblink_cursor_alist. + (Vblink_cursor_alist): New variable. + (syms_of_xfns): Initialize and defvar it. + (x_specified_cursor_type): Recognize Qbox for filled box. + Exceptions are hollow boxes. + (Qbox, Qhollow): New variables. + (syms_of_xfns): Initialize and staticpro them. + + * xterm.h (FRAME_BLINK_OFF_CURSOR, FRAME_BLINK_OFF_CURSOR_WIDTH): + New macros. + (struct x_output): New fields blink_off_cursor, blink_off_cursor_width. + + * xterm.c (x_display_and_set_cursor): Use FRAME_BLINK_OFF_CURSOR + and FRAME_BLINK_OFF_CURSOR_WIDTH for blinking cursor off. + + * emacs.c (main): Handle --script. + (USAGE1): Mention --script. + (standard_args): Define sort order for --script. + +2002-08-27 Gerd Moellmann <gerd.moellmann@t-online.de> + + * xdisp.c (redisplay_updating_p): Variable removed. + (inhibit_free_realized_faces, Qinhibit_free_realized_faces): + New variables. + (init_iterator): Don't free realized faces if + inhibit_free_realized_faces is set. + (redisplay_internal): Bind Qinhibit_free_realized_faces to nil. + (syms_of_xdisp): DEFVAR_BOOL inhibit-free-realized-faces, + initialize Qinhibit_free_realized_faces. + + * dispextern.h (PRODUCE_GLYPHS): Set inhibit_free_realized_faces + when iterator is adding glyphs to a glyph matrix. + +2002-08-27 Kenichi Handa <handa@etl.go.jp> + + * xdisp.c (get_next_display_element): In unibyte case, don't use + octal form for such eight-bit characters that can be converted to + multibyte char. + +2002-08-26 Kim F. Storm <storm@cua.dk> + + * frame.c (make_terminal_frame) [CANNOT_DUMP]: Initialize + foreground and background colors. From Joe Buehler. + +2002-08-26 Miles Bader <miles@gnu.org> + + * bytecode.c (Fbyte_code): Fsub1 can GC, so protect it. + +2002-08-25 Andrew Choi <akochoi@shaw.ca> + + * emacs.c (main): Call init_mac_osx_environment if HAVE_CARBON is + defined instead of MAC_OSX. + + * s/darwin.h (select): Define select to sys_select only if + HAVE_CARBON is defined. + (HAVE_WORKING_VFORK): #undef it. Define vfork to fork. + (DONT_REOPEN_PTY): #def it. + + * macterm.c (XTread_socket): Remove code to call + SendEventToEventTarget for keys with command modifiers when + mac_command_key_is_meta is nil. + +2002-08-24 Andreas Schwab <schwab@suse.de> + + * eval.c (Fdefvar): Fix last change. + +2002-08-23 Richard M. Stallman <rms@gnu.org> + + * eval.c (Fdefvar, Fdefconst, Fdefvaralias): + Record variables in load history as (defvar . VAR). + (Fdefvar): Don't record in load history if no initial value. + (Qdefvar): New variable. + (syms_of_eval): Init and staticpro it. + + * lread.c (syms_of_lread): Doc fix. + (build_load_history): Use Fmember to see if a definition + is already in the Vload_history element. + + * process.c (Fstart_process): Remove /: from program name. + + * emacs.c (decode_env_path): Don't add /: if file name handler + has a `safe-magic' property. + + * callproc.c (Fcall_process): Remove /: from program name. + +2002-08-23 Stefan Monnier <monnier@cs.yale.edu> + + * regex.c (PATFETCH): Remove the translating fetch. + (PATFETCH_RAW): Rename to PATFETCH. + (set_image_of_range): New fun. + (SET_RANGE_TABLE_WORK_AREA): Use it. + (regex_compile): Don't translate the pattern chars so eagerly. + Only do it when inserting an `exactn' bytecode or when handling + a char-range. + (mutually_exclusive_p): Avoid empty statement. + +2002-08-22 Kim F. Storm <storm@cua.dk> + + * xdisp.c (redisplay_window): Do not `goto try_to_scroll' when we + end up on a partially visible line; this reverts a specific part + of the 2002-07-07 change by Richard M. Stallman to "fix" a nasty + display error which has been reported several times now. + However it introduces the problem that changes was supposed to fix. + See my comments in the source if you want to debug this further. + +2002-08-20 Kenichi Handa <handa@etl.go.jp> + + * abbrev.c (Fexpand_abbrev): Fix for the multibyte case. + +2002-08-19 Eli Zaretskii <eliz@is.elta.co.il> + + * msdos.c (croak): Add `void' to definition. + + * sysdep.c (request_sigio, unrequest_sigio) [MSDOS]: + Don't define them, they are defined in msdos.c. + + * mem-limits.h [MSDOS]: Declare etext. + + * fileio.c (Ffile_name_directory) [DOS_NT]: Don't declare `beg' + `const' since CORRECT_DIR_SEPS modifies its target. + +2002-08-19 Kim F. Storm <storm@cua.dk> + + * keyboard.c (Fclear_this_command_keys): Add optional arg + KEEP-RECORD to avoid clearing lossage when we just want to clear + the current key sequence (kmacro needs this). + +2002-08-19 Kenichi Handa <handa@localhost> + + * composite.c (run_composition_function): Call FUNC if it is fboundp. + + * composite.h (COMPOSITION_MODIFICATION_FUNC): If PROP is not a + cons, return Qnil. + +2002-08-17 Richard M. Stallman <rms@gnu.org> + + * s/sol2-5.h (BROKEN_SIGIO): Add #undef. + + * sysdep.c [!VMS]: Include sys/files.h. + + * editfns.c (save_restriction_restore): Defend from unchained marker. + + * buffer.c (overlays_at): Handle extending vec uniformly. + (overlays_in): Handle extending vec from length 0 as in overlays_at. + +2002-08-15 Andrew Choi <akochoi@shaw.ca> + + * mac.c (init_mac_osx_environment): New function. + + * emacs.c (main) [MAC_OSX]: Call init_mac_osx_environment. + +2002-08-14 Kim F. Storm <storm@cua.dk> + + * macros.c (Fstart_kbd_macro): Added NO-EXEC argument to inhibit + executing macro before appending to it (when used from Lisp). + (Fexecute_kbd_macro): Added LOOPFUNC argument to supply function + which is called prior to each iteration of macro (for kmacro.el). + (Fend_kbd_macro, Fcall_last_kbd_macro): Likewise. + + * lisp.h (Fexecute_kbd_macro): Update prototype. + + * keyboard.c (Fcommand_execute): Update call to Fexecute_kbd_macro. + +2002-08-14 Kenichi Handa <handa@etl.go.jp> + + * xselect.c (QUTF8_STRING): New variable. + (symbol_to_x_atom): Pay attention to QUTF8_STRING. + (x_atom_to_symbol): Likewise. + (x_get_local_selection): New argument local_request. If it is + nonzero, call handler_fn with the second arg nil. + (x_handle_selection_request): Call x_get_local_selection with + local_request 0. + (lisp_data_to_selection_data): Don't encode the string here. + (Fx_get_selection_internal): Call x_get_local_selection with + local_request 1. + (syms_of_xselect): Intern and staticpro QUTF8_STRING. + + * xterm.c (x_term_init): Initialize dpyinfo->Xatom_UTF8_STRING. + + * xterm.h (struct x_display_info): New member Xatom_UTF8_STRING. + +2002-08-13 Richard M. Stallman <rms@gnu.org> + + * minibuf.c (Fminibufferp): New function. + (syms_of_minibuf): Defsubr it. + (Fminibuffer_prompt_end): Handle non-minibuffers specially. + +2002-08-13 Gerd Moellmann <gerd.moellmann@t-online.de> + + * coding.c (Funencodable_char_position): Lisp_Object/int mixup. + +2002-08-12 Richard M. Stallman <rms@gnu.org> + + * syswait.h: Only the include of sys/wait.h tests HAVE_SYS_WAIT_H. + [!VMS] (WCOREDUMP, WEXITSTATUS, WIFEXITED, WIFSTOPPED, WIFSIGNALED) + (WSTOPSIG, WTERMSIG): Define each one independently if not defined + already. + + * buffer.c (syms_of_buffer) <fill-column>: Doc fix. + +2002-08-11 Andrew Choi <akochoi@shaw.ca> + + * macterm.c (XTmouse_position): Check wp with is_emacs_window. + (Vmac_pass_command_to_system): New variable. + (Vmac_pass_control_to_system): New variable. + (do_mouse_moved): Check wp with is_emacs_window. + (XTread_socket): Check window_ptr with is_emacs_window. + Call FrontNonFloatingWindow instead of FrontWindow. Send keydown + events back to Mac Toolbox for processing, depending on values of + Vmac_pass_command_to_system and Vmac_pass_control_to_system. + (syms_of_macterm): DEFVAR_LISP Vmac_pass_command_to_system and + Vmac_pass_control_to_system. + +2002-08-10 Kenichi Handa <handa@etl.go.jp> + + * coding.c (unencodable_char_position): New function. + (Funencodable_char_position): New function. + (syms_of_coding): Defsubr Funencodable_char_position. + +2002-08-10 Andrew Choi <akochoi@shaw.ca> + + * mac.c (sys_select) [MAC_OSX]: New function. + + * macterm.c (MakeMeTheFrontProcess): New function. + (mac_initialize): Call MakeMeTheFrontProcess. + + * s/darwin.h: Define select to sys_select. + +2002-08-09 Richard M. Stallman <rms@gnu.org> + + * keyboard.c (make_lispy_event): Test WINDOWSNT, not WINDOWS_NT. + +2002-08-09 Gerd Moellmann <gerd.moellmann@t-online.de> + + * xdisp.c (forward_to_next_line_start): Return 0 when reaching the + end of the buffer. + +2002-08-08 Ken Raeburn <raeburn@gnu.org> + + * coding.c (Ffind_operation_coding_system): Fix Lisp_Object/int mixup. + + * puresize.h (BASE_PURESIZE): Increase to 910000. + +2002-08-08 Kenichi Handa <handa@etl.go.jp> + + * coding.c (Ffind_operation_coding_system): For write-region, if + VISIT is a filename, make it the target. + +2002-08-07 Richard M. Stallman <rms@gnu.org> + + * alloc.c (mark_object): Detect long lists for debugging. + (mark_object_loop_halt): New variable. + + * s/hpux10.h (C_SWITCH_SYSTEM): #undef it. + + * data.c (Fmake_variable_frame_local): Doc fix. + +2002-08-01 David Ponce <david@dponce.com> + + * w32menu.c (local_heap, local_alloc, local_free): New macros. + (malloc_widget_value, free_widget_value) + (w32_free_submenu_strings): Use them. + + (push_submenu_start, push_submenu_end, push_left_right_boundary) + (push_menu_pane, push_menu_item, single_keymap_panes) + (single_menu_item, Fx_popup_menu, menubar_selection_callback) + (single_submenu, set_frame_menubar) + (w32_menu_show, w32_dialog_show): Use AREF, ASET, ASIZE. + + (Fx_popup_menu): Don't show pop up menu until preceding one is + actually cleaned up. Moved UNGCPRO outside #ifdef HAVE_MENUS block. + + * w32menu.c: Changes adapted from xmenu.c + (set_frame_menubar): First parse all submenus, + then make widget_value trees from them. + Don't allocate any widget_value objects + until we are done with the parsing. + (parse_single_submenu): New function. + (digest_single_submenu): New function. + (single_submenu): Function deleted, replaced by those two. + +2002-08-04 Andrew Choi <akochoi@shaw.ca> + + * macterm.c (XTread_socket): Check that FrontNonFloatingWindow + returns a valid window pointer before proceeding for keyDown and + autoKey events. + +2002-08-03 Andrew Choi <akochoi@shaw.ca> + + * macterm.c (USE_CARBON_EVENTS): New macro. + (macCtrlKey, macShiftKey, macMetaKey, macAltKey): New macros. + (x_iconify_frame): Call CollapseWindow. + (Vmac_reverse_ctrl_meta): New variable. + (Vmac_wheel_button_is_mouse_2): New variable. + (init_mac_drag_n_drop): New function. + (mac_do_receive_drag): New function. + (mac_handle_service_event): New function. + (init_service_handler): New function. + (mac_to_emacs_modifiers): New function. + (mac_event_to_emacs_modifiers): New function. + (mac_get_mouse_btn): New function. + (mac_convert_event_ref): New function. + (XTread_socket) [USE_CARBON_EVENTS]: Call ReceiveNextEvent, + SendEventToEventTarget, mac_event_to_emacs_modifiers, and + mac_get_mouse_btn. + (mac_initialize): Call init_mac_drag_n_drop and init_service_handler. + + * keyboard.c: Define Qmouse_wheel, mouse_wheel_syms, and + lispy_mouse_wheel_names for MAC_OSX as well as for WINDOWS_NT. + (kbd_buffer_get_event): Set used_mouse_menu for MENU_BAR_EVENT and + TOOL_BAR_EVENT for MAC_OS as well. + (make_lispy_event): Handle MOUSE_WHEEL_EVENT for MAC_OSX as well + as for WINDOWS_NT. + (syms_of_keyboard): Initialize Qmouse_wheel for MAC_OSX. + + * termhooks.h (event_kind): Define MOUSE_WHEEL_EVENT also for MAC_OSX. + +2002-08-03 Gerd Moellmann <gerd.moellmann@t-online.de> + + * xdisp.c (forward_to_next_line_start): Fix a condition that + lead to a newline being skipped. + +2002-08-02 Andrew Choi <akochoi@shaw.ca> + + * mac.c (syms_of_mac): Defsubr Sx_selection_exists_p. + +2002-08-01 Richard M. Stallman <rms@gnu.org> + + * Makefile.in (SOME_MACHINE_OBJECTS): Add fontset.o. + +2002-07-31 Andrew Choi <akochoi@shaw.ca> + + * macfns.c: #undef init_process before #define-ing it. + + * s/darwin.h: Define MAC_OS, SYMS_SYSTEM, and OTHER_FILES only if + HAVE_CARBON is defined. + +2002-07-31 Richard M. Stallman <rms@gnu.org> + + * xmenu.c (set_frame_menubar): First parse all submenus, + then make widget_value trees from them. + Don't allocate any widget_value objects + until we are done with the parsing. + (parse_single_submenu): New function. + (digest_single_submenu): New function. + (single_submenu): Function deleted, replaced by those two. + +2002-07-30 Juanma Barranquero <lektu@terra.es> + + * w32proc.c (syms_of_ntproc): Fix docstring of + `w32-get-true-file-attributes'. + +2002-07-28 Richard M. Stallman <rms@gnu.org> + + * s/hpux8.h (HPUX8): Define this before including hpux.h. + (HAVE_SYS_WAIT_H): #define deleted; we let Autoconf decide. + + * s/hpux.h (HAVE_SYS_WAIT_H): The #undef is conditional on HPUX8. + + * keyboard.c (make_lispy_event): + Use #ifdef to test USE_TOOLKIT_SCROLL_BARS. + Explicitly clear up_modifier in event->modifiers. + +2002-07-27 Richard M. Stallman <rms@gnu.org> + + * xterm.h (FRAME_CURSOR_WIDTH): New macro. + + * xterm.c (x_display_and_set_cursor): Check FRAME_CURSOR_WIDTH + for bar cursor. + +2002-07-26 Kenichi Handa <handa@etl.go.jp> + + * coding.c (detect_coding_iso2022): While checking a byte sequence + for CODING_CATEGORY_MASK_ISO_8_2, if we read one extra byte, check + it in the normal loop. + +2002-07-24 Gerd Moellmann <gerd.moellmann@t-online.de> + + * xterm.c (expose_overlaps): New function. + (expose_window): Use it to fix the display of overlapping rows. + + * xdisp.c (unwind_redisplay): Clear redisplay_updating_p. + +2002-07-23 Ken Raeburn <raeburn@gnu.org> + + * lisp.h (XPNTR): Use NO_UNION_TYPE version for union as well, + since it only depends on XUINT. + + * m/alpha.h (BITS_PER_LONG, BITS_PER_EMACS_INT, EMACS_INT, + EMACS_UINT, SPECIAL_EMACS_INT, DATA_SEG_BITS, + PNTR_COMPARISON_TYPE, VALBITS, MARKBIT, XINT, XUINT, XPNTR): + Macros deleted. + + * mem-limits.h (start_of_data): If DATA_START is defined, prefer + its value over other approaches. + * sysdep.c (start_of_data): Don't define the function if a macro + form has been defined. + +2002-07-23 Gerd Moellmann <gerd.moellmann@t-online.de> + + * xdisp.c (redisplay_updating_p): New variable. + (init_iterator): Don't free realized faces when + redisplay_updating_p is set. + (redisplay_internal): Set redisplay_updating_p while updating + the display. + +2002-07-23 Richard M. Stallman <rms@gnu.org> + + * editfns.c (Fmessage): Treat "" like nil. + +2002-07-23 Kenichi Handa <handa@etl.go.jp> + + * xdisp.c (face_before_or_after_it_pos): + Call FETCH_MULTIBYTE_CHAR with byte postion, not char position. + +2002-07-22 Juanma Barranquero <lektu@terra.es> + + * callproc.c (init_callproc) [DOS_NT]: + Initialize Vshared_game_score_directory to nil. + (syms_of_callproc) [DOS_NT]: Likewise. + +2002-07-22 Gerd Moellmann <gerd.moellmann@t-online.de> + + * xdisp.c (display_line): Replace an abort with xassert. + +2002-07-21 Richard M. Stallman <rms@gnu.org> + + * xdisp.c (redisplay_window): Don't test BEG_UNCHANGED + and END_UNCHANGED when setting buffer_unchanged_p. + Use current_matrix_up_to_date_p to decide whether to use + try_cursor_movement. + + * config.in (HAVE_SHARED_GAME_DIR): Undef deleted. + + * epaths.in (PATH_GAME): New macro, edited by ../Makefile.in. + + * callproc.c (init_callproc): Set up Vshared_game_score_directory. + Set to nil if dir does not exist. + (syms_of_callproc): Init unconditionally and simply. + + * buffer.c (Fbuffer_list): Doc fix. + +2002-07-21 Ken Raeburn <raeburn@gnu.org> + + * sysdep.c (end_of_text, end_of_data): Unused functions deleted. + + * buffer.c (mmap_realloc): When shrinking, make sure number of + pages to unmap is rounded towards zero. + + * m/mips-siemens.h (XSETUINT, XSETPNTR): Unused macros deleted. + (XSETINT): Deleted. + + * m/att3b.h (XINT): Don't define. + (VALBITS, VALMASK, XTYPE): Deleted. + (DATA_SEG_BITS): Define. + * m/gec63.h (VALBITS, VALAMASK, XTYPE, XSETTYPE, XPNTR, XSET, + ARRAY_MARK_FLAG): Deleted. + (DATA_SEG_BITS): Define. + * m/pfa50.h (VALBITS, VALMASK, XTYPE): Deleted. + (DATA_SEG_BITS): Define. + +2002-07-20 Richard M. Stallman <rms@gnu.org> + + * print.c (print_error_message): New args CONTEXT and CALLER. + Calls changed. + + * lisp.h (print_error_message): Declare new args. + + * keyboard.c (cmd_error_internal): Pass Vsignaling_function + and CONTEXT to print_error_message, don't print them here. + For a Quit, don't use Vsignaling_function. + Call message_log_maybe_newline. + + * Makefile.in (xsmfns.o): Don't depend on lisp.h. + +2002-07-20 Kim F. Storm <storm@cua.dk> + + * xdisp.c (redisplay_window): Test MODIFF to set buffer_unchanged_p. + +2002-07-19 Ken Raeburn <raeburn@gnu.org> + + * bytecode.c (struct byte_stack): Pointers into byte string now + point to const. + * callproc.c (Fcall_process): Make NEW_ARGV array hold pointer to + const. + * charset.h (BCOPY_SHORT): Source pointer now points to const. + * coding.c (encode_eol, detect_coding, detect_eol): + (decode_coding, encode_coding, detect_coding_system): + Source strings now treated as const. + (decode_coding_string, encode_coding_string): Use STRING_COPYIN to + modify Lisp string contents. + * coding.h (decode_coding, encode_coding, detect_coding, + detect_eol): Declarations updated. + * composite.c (compose_chars_in_text): Treat Lisp string contents + as const. + * dispnew.c (safe_bcopy): Source pointer now points to const. + * lisp.h (STRING_COPYIN): New macro. + (detect_coding_system, safe_bcopy, temp_output_buffer_setup): + (internal_with_output_to_temp_buffer): Declarations updated. + * print.c (temp_output_buffer_setup): + (internal_with_output_to_temp_buffer): Buffer name argument is now + pointer to const. + * sound.c (struct sound_device): Function pointer field "write" + buffer argument now points to const. + (vox_write): Buffer argument points to const. + * syntax.c (Fstring_to_syntax, skip_chars): Treat Lisp string + contents as const. + * sysdep.c (emacs_write): Buffer pointer now const. + * term.c (encode_terminal_code): Buffer pointer now const. + * xfaces.c (may_use_scalable_font_p): Argument now points to const. + (x_face_list_fonts, x_update_menu_appearance): + (hash_string_case_insensitive): Treat Lisp string contents as const. + +2002-07-19 Juanma Barranquero <lektu@terra.es> + + * xdisp.c (syms_of_xdisp): Remove redundant deprecation info. + + * fileio.c (syms_of_fileio): Likewise. + (Ffile_name_as_directory): Fix argument name in docstring. + (file_name_as_directory): Use literal '/' instead of DIRECTORY_SEP. + +2002-07-18 Richard M. Stallman <rms@gnu.org> + + * data.c (Fdefalias): Doc fix. + +2002-07-17 Dave Love <fx@gnu.org> + + * intervals.h (text_property_stickiness): Use P_. + + * ccl.c: Remove `emacs' conditionals. + (ccl_backtrace_table): Fix size spec. + (ccl_driver): Fix type errors. + +2002-07-16 Ken Raeburn <raeburn@gnu.org> + + * alloc.c (xstrdup, make_string, make_unibyte_string) + (make_multibyte_string, build_string): String pointer args now + point to const. + * charset.c (find_charset_in_text, c_string_width): + (chars_in_text, multibyte_chars_in_text, parse_str_as_multibyte): + * fileio.c (report_file_error): + * insdel.c (copy_text, count_size_as_multibyte, insert_1): + (count_combining_before, count_combining_after, insert_1_both): + (insert, insert_and_inherit, insert_string): + (insert_before_markers, insert_before_markers_and_inherit): + * lread.c (intern, oblookup, hash_string): + * minibuf.c (temp_echo_area_glyphs): + * search.c (fast_c_string_match_ignore_case): + * sysdep.c (emacs_open, set_file_times): + * xfaces.c (xstricmp): + * xdisp.c (store_frame_title, string_char_and_length): + (message_dolog, message2, message2_nolog, set_message): Likewise. + (set_message_1): Cast message string argument to const pointer. + * editfns.c (general_insert_function): Insertion function now + takes pointer to const for input data. + * charset.h (find_charset_in_text, c_string_width): + (parse_str_as_multibyte): Declarations updated. + * dispextern.h (xstricmp): Declaration updated. + * lisp.h (chars_in_text, multibyte_chars_in_text, copy_text): + (count_size_as_multibyte, count_combining_before): + (count_combining_after, insert_1, insert_1_both, message_dolog): + (insert, insert_and_inherit, insert_before_markers) + (insert_before_markers_and_inherit, set_message, message2): + (message2_dolog, build_string, make_string, make_unibyte_string): + (make_multibyte_string, intern, oblookup, report_file_error): + (fast_c_string_match_ignore_case, temp_echo_area_glyphs): + (emacs_open, xstrdup): Declarations updated. + * systime.h (set_file_times): Declaration updated. + + * charset.c (find_charset_in_text, lisp_string_width): Use const + for pointer to lisp string data. + * charset.h (FETCH_STRING_CHAR_ADVANCE): + (FETCH_STRING_CHAR_ADVANCE_NO_CHECK): + * coding.c (Ffind_coding_systems_region_interval): + * fileio.c (Ffile_name_directory, Ffile_name_nondirectory): + (Fmake_directory_internal, Fdelete_directory): + (Ffile_name_absolute_p, Fwrite_region, double_dollars): + * fontset.c (font_family_registry, fs_query_fontset): + (list_fontsets): + * frame.c (Fframe_parameter): + * keyboard.c (cmd_error_internal): + * keymap.c (Fdescribe_buffer_bindings): + * lread.c (complete_filename_p, openp): + * minibuf.c (Fminibuffer_complete_word): + * xdisp.c (string_pos_nchars_ahead, init_from_display_pos): + (face_before_or_after_it_pos, next_element_from_string): + (get_overlay_arrow_glyph_row, display_mode_element): + (decode_mode_spec_coding): + * xterm.c (same_x_server): Likewise. + + * buffer.c (reset_buffer_local_variables): Delete "#if 0" + settings of non-existent fields. + + * editfns.c (Fstring_to_char): Don't use XSTRING/XSETSTRING to + copy a lisp value. + + * lread.c (Fintern_soft): Use string macros instead of + Lisp_String fields. + * keyboard.c (echo_char, parse_modifiers_uncached): + (parse_solitary_modifier, Fexecute_extended_command): Likewise. + * textprop.c (validate_interval_range, interval_of): Likewise. + + * fontset.c (Fset_fontset_font): Use SDATA instead of XSTRING()->data. + + * charset.h (FETCH_STRING_CHAR_ADVANCE) + (FETCH_STRING_CHAR_ADVANCE_NO_CHECK): Use SBYTES instead of + XSTRING()->size_byte. + + * lisp.h (SDATA, SREF): Produce rvalue. + (SSET): New macro. + * alloc.c (make_event_array): Use SSET for storing into a string. + * buffer.c (Fother_buffer): Use SREF when retrieving a byte from + a string. + * casefiddle.c (casify_object): Use SSET. + * charset.h (FETCH_STRING_CHAR_ADVANCE) + (FETCH_STRING_CHAR_ADVANCE_NO_CHECK): Use SDATA when getting + address of string contents. + * data.c (Faref): Use SDATA. + (Faset): Use SDATA, SSET. + * dired.c (directory_files_internal): Use SSET. + * fileio.c (Fmake_symbolic_link, Fexpand_file_name): Use SSET. + (Fread_file_name): Use SREF, SSET. + * fns.c (concat): Use SSET. + (concat, Fdelete): Use SDATA. + * insdel.c (insert_from_string_1): Use SDATA. + * keyboard.c (Fevent_convert_list): Use SREF. + * lread.c (Fload): Use SDATA, SSET. + * macfns.c (validate_x_resource_name): Use SSET. + * process.c (status_message): Use SSET. + * search.c (wordify): Use SDATA. + (Freplace_match): Use SREF. + * w32fns.c (validate_x_resource_name): Use SSET. + * xfns.c (validate_x_resource_name): Use SSET. + * xterm.c (x_catch_errors, x_clear_errors): Use SSET. + +2002-07-16 Richard M. Stallman <rms@gnu.org> + + * s/hpux11.h (USG_SUBTTY_WORKS): Defined. + + * xdisp.c (reconsider_clip_changes): + Don't test prevent_redisplay_optimizations_p. + (redisplay_internal): Test prevent_redisplay_optimizations_p + along with clip_changed in some cases. + (try_window_id): Likewise. + (redisplay_window): New local var buffer_unchanged_p. + + * keyboard.c (cmd_error) [HAVE_X_WINDOWS]: Maybe call cancel_houglass. + + * process.c (create_process): Test USG_SUBTTY_WORKS. + (process_send_signal): Clean up handling of GID. + Detect errors in ioctls meant to set GID. + + * window.c (temp_output_buffer_show): + Don't set prevent_redisplay_optimizations_p. + +2002-07-15 Juanma Barranquero <lektu@terra.es> + + * eval.c (Fdefvaralias): Add docstring argument. + +2002-07-15 Ken Raeburn <raeburn@gnu.org> + + * lisp.h (STRING_INTERVALS): Produce rvalue. + (STRING_SET_INTERVALS): New macro. + * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): Use it. + * fns.c (Fstring_as_multibyte): Likewise. + * intervals.c (balance_possible_root_interval, delete_interval) + (create_root_interval, copy_intervals_to_string): Likewise. + * textprop.c (set_text_properties): Likewise. Use NULL_INTERVAL + instead of 0. + +2002-07-14 Ken Raeburn <raeburn@gnu.org> + + * lisp.h (STRING_SET_CHARS): New macro. + (SCHARS, SBYTES): Produce rvalues. + * dired.c (directory_files_internal): Use STRING_SET_CHARS. + * fns.c (concat): Likewise. + * lread.c (read_vector): Likewise. + + * lisp.h (SMBP): Delete. All uses changed to STRING_MULTIBYTE. + (STRING_SET_UNIBYTE): New macro. + (SET_STRING_BYTES): Delete. Callers (all of which supplied a + length of -1) changed to use STRING_SET_UNIBYTE. + * abbrev.c, alloc.c, buffer.c, bytecode.c, callint.c, callproc.c, + casefiddle.c, category.c, ccl.c, charset.c, charset.h, coding.c, + composite.c, data.c, dired.c, dispnew.c, disptab.h, doc.c, + dosfns.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fn.c, + fontset.c, frame.c, indent.c, insdel.c, intervals.c, keyboard.c, + keymap.c, lread.c, mac.c, macfns.c, macmenu.c, macterm.c, + minibuf.c, msdos.c, print.c, process.c, search.c, sound.c, + sunfns.c, syntax.c, syntax.h, sysdep.c, textprop.c, undo.c, + w16select.c, w32.c, w32fns.c, w32menu.c, w32proc.c, w32select.c, + w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, + xselect.c, xsmfns.c, xterm.c: Most uses of XSTRING combined with + STRING_BYTES or indirection changed to SCHARS, SBYTES, + STRING_INTERVALS, SREF, SDATA; explicit size_byte references left + unchanged for now. + +2002-07-13 Kim F. Storm <storm@cua.dk> + + * keyboard.c (command_loop_1): Invert check on Vmemory_full. + +2002-07-12 Richard M. Stallman <rms@gnu.org> + + * fileio.c (Fwrite_region): Doc fix. + + * print.c (print_error_message): Don't handle Vsignaling_function here. + + * keyboard.c (cmd_error_internal): Handle Vsignaling_function here. + (command_loop_1): Avoid certain actions after memory-full error. + + * eval.c (Fsignal): Don't call cancel_hourglass. + For a memory-full error, don't call Vsignal_hook_function + and don't set Vsignaling_function. + + * process.c (process_send_signal): Add abort call. + +2002-07-11 Markus Rost <rost@math.ohio-state.edu> + + * keymap.c (Fkey_binding): Fix typo. + +2002-07-11 Richard M. Stallman <rms@gnu.org> + + * alloc.c (Vmemory_full): New variable. + (Vmemory_signal_data): Rename from memory_signal_data. + Uses changed. + (syms_of_alloc): Defvar them. + (memory_full, buffer_memory_full): Set Vmemory_full. + + * lisp.h (Vmemory_full): Add declaration. + (current_column, indented_beyond_p): Change declaration. + + * indent.c (last_known_column): Declare as double, not float. + (current_column, current_column_1, string_display_width) + (position_indentation): Return `double'. + (indented_beyond_p): Arg `column' is `double'. Callers changed. + + * xdisp.c (message_dolog): Do nothing if Vmemory_full is non-nil. + (back_to_previous_visible_line_start) + (reseat_at_next_visible_line_start, next_element_from_buffer): + Use `double', not `float', when calling indented_beyond_p. + + * s/hpux11.h (BROKEN_SA_RESTART): Define. + + * sysdep.c (sys_signal): Test BROKEN_SA_RESTART. + +2002-07-11 Juanma Barranquero <lektu@terra.es> + + * alloc.c, buffer.c, bytecode.c, callint.c, callproc.c, coding.c, + * composite.c, dired.c, dispnew.c, editfns.c, emacs.c, eval.c, + * fileio.c, fns.c, insdel.c, keyboard.c, keymap.c, lread.c, macfns.c, + * macmenu.c, macros.c, minibuf.c, print.c, process.c, sound.c, + * textprop.c, w32fns.c, w32menu.c, window.c, xfaces.c, xfns.c, + * xmenu.c, xselect.c, xterm.c: Use SPECPDL_INDEX wherever makes sense. + +2002-07-10 Juanma Barranquero <lektu@terra.es> + + * lisp.h (SPECPDL_INDEX): Rename from BINDING_STACK_SIZE. + All callers changed. + +2002-07-09 Stefan Monnier <monnier@cs.yale.edu> + + * data.c (Fdefalias): Add an optional `docstring' argument. + (set_internal, Fsetq_default): Use XCAR/XCDR. + + * composite.c (HASH_VALUE, HASH_KEY): + * ccl.c (HASH_VALUE): Remove (it's in lisp.h now). + +2002-07-09 Kenichi Handa <handa@etl.go.jp> + + * callproc.c (Fcall_process): Fix previous change. + +2002-07-07 Stefan Monnier <monnier@cs.yale.edu> + + * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion): + Add support for hash-tables. + (Ftry_completion): Return t even if the string appears multiple times. + + * fns.c (Fnconc): Use XCDR. + (Fprovide): Use CONSP and XCDR. + (HASH_KEY, HASH_VALUE, HASH_NEXT, HASH_HASH, HASH_INDEX) + (HASH_TABLE_SIZE): Delete: moved to lisp.h. + (Fmake_hash_table): Accept `:size nil'. + (Fmakehash): Delete: moved to subr.el. + (syms_of_fns): Don't defsubr makehash. + + * lisp.h (HASH_KEY, HASH_VALUE, HASH_NEXT, HASH_HASH, HASH_INDEX) + (HASH_TABLE_SIZE): Move from fns.c. + +2002-07-07 Richard M. Stallman <rms@gnu.org> + + * xdisp.c (make_cursor_line_fully_visible): Don't try short scrolls. + Instead just return 0 when there is something to be done. + (try_scrolling): If make_cursor_line_fully_visible returns 0, + retry scrolling as if cursor were off the bottom. + (try_cursor_movement): If make_cursor_line_fully_visible returns 0, + return CURSOR_MOVEMENT_MUST_SCROLL. + (redisplay_window): If make_cursor_line_fully_visible returns 0, + go to try_to_scroll. + + * buffer.c (Fbuffer_local_value): Store current value into its binding + so we get the up-to-date value for the binding that is loaded. + + * eval.c (Fdefmacro): Doc fix. + +2002-07-05 Dave Love <fx@gnu.org> + + * keyboard.c (read_key_sequence): Set initial_idleness_start_time + correctly. + + * ccl.c (Vtranslation_hash_table_vector, GET_HASH_TABLE) + (HASH_VALUE, CCL_LookupIntConstTbl, CCL_LookupCharConstTbl): New. + (ccl_driver): Add cases for CCL_LookupIntConstTbl, + CCL_LookupCharConstTbl. + (syms_of_ccl): Defvar translation-hash-table-vector. + +2002-07-05 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * xdisp.c: Remove unused variable `face'. + +2002-07-04 Juanma Barranquero <lektu@terra.es> + + * keyboard.c (post_command_idle_hook): Remove redundant (and inexact) + obsolescence information. + +2002-07-03 Andrew Choi <akochoi@shaw.ca> + + * macterm.c (x_list_fonts): Fix comment. Cache fonts matching + pattern. Search cache first. + (init_font_name_table): Also add entry for jisx0201.1976-0 coding + for Japanese font. + (XLoadQueryFont): Use it. + +2002-07-02 Richard M. Stallman <rms@gnu.org> + + * keymap.c (Fdefine_key): Doc fix. + + * xterm.c (x_term_init): Turn off polling around XtOpenDisplay. + +2002-07-02 Juanma Barranquero <lektu@terra.es> + + * keymap.c (syms_of_keymap): Fix typo. + +2002-07-01 Andrew Choi <akochoi@shaw.ca> + + * s/darwin.h: Define POSIX_SIGNALS. + + * macterm.c (do_ae_open_documents) [MAC_OSX]: Call FSpMakeFSRef + and FSRefMakePath to convert FSSpec returned with Apple Event to + Posix pathname. + (mac_initialize) [TARGET_API_MAC_CARBON]: + Call init_required_apple_events and disable the `Quit' menu item + provided automatically by the Carbon Toolbox. + +2002-07-01 Dave Love <fx@gnu.org> + + * keyboard.c (kbd_buffer_store_event): Fix interrupt_signal decl + for K&R. + + * xterm.c: Fix prototype for K&R. + + * term.c (costs_set): Declare static, non-initialized for pcc. + +2002-07-01 Richard M. Stallman <rms@gnu.org> + + * keyboard.c (timer_last_idleness_start_time): New variable. + (timer_start_idle): Set that. + (read_key_sequence): Use that to reset timer_idleness_start_time + to previous value. + + * window.c (Frecenter): With arg, set optional_new_start. + + * xdisp.c (redisplay_internal): Make optional_new_start really work. + + * minibuf.c (Fminibuffer_complete_and_exit): Move to end of + buffer for completion. + +2002-06-29 Ken Raeburn <raeburn@gnu.org> + + * xdisp.c (store_mode_line_string): Lisp_Object/int mixup. + +2002-06-28 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * keyboard.c (readable_filtered_events): New function that filters + FOCUS_IN_EVENT depending on parameter. + (readable_events): Calls readable_filtered_events, not filtering + FOCUS_IN_EVENT. + (get_filtered_input_pending): New function, filtering parameter passed + to readable_filtered_events. + (get_input_pending): Calls get_filtered_input_pending, not filtering + FOCUS_IN_EVENT. + (Finput_pending_p): Calls get_filtered_input_pending, DO filter + FOCUS_IN_EVENT. + + * xterm.h (struct x_output): Add focus_state. + + * xterm.c (x_focus_changed): New function. + (x_detect_focus_change): New function. + (XTread_socket): Call x_detect_focus_change for FocusIn/FocusOut + EnterNotify and LeaveNotify to track X focus changes. + +2002-06-28 Andreas Schwab <schwab@suse.de> + + * lisp.h: Remove duplicate declaration of code_convert_string_norecord. + +2002-06-27 Kim F. Storm <storm@cua.dk> + + * xdisp.c (mode_line_string_list, mode_line_string_face) + (mode_line_string_face_prop): New variables. + (store_mode_line_string): New function. + (display_mode_element): Use store_mode_line_string to + add mode-line string elements to mode_line_string_list + when mode_line_string_list is non-nil. + (Fformat_mode_line): Now returns propertized string by + default. New arg NO-PROPS to ignore properties. + (decode_mode_spec): Only add two dashes for %- in propertized + mode-line string. + (syms_of_xdisp): Init and staticpro mode_line_string_list. + +2002-06-27 Stefan Monnier <monnier@cs.yale.edu> + + * minibuf.c (minibuffer_completion_contents): Add return type. + +2002-06-27 Juanma Barranquero <lektu@terra.es> + + * charset.c (Fchar_bytes): Remove obsolescence info from docstring. + +2002-06-26 Juanma Barranquero <lektu@terra.es> + + * fileio.c (read_file_name_cleanup): Add missing return. + +2002-06-26 Richard M. Stallman <rms@gnu.org> + + * window.c (Frecenter): Don't set force_start flag. + + * minibuf.c (do_completion, Fminibuffer_complete_word) + (Fminibuffer_completion_help): Complete just the text before point. + (minibuffer_completion_contents): New function. + + * buffer.c (Fbury_buffer): Use frames_discard_buffer. + + * frame.c (frames_bury_buffer): Function deleted. + +2002-06-25 Miles Bader <miles@gnu.org> + + * callint.c (Fcall_interactively): When checking to see if doprnt hit + the end of callint_message, allow for a terminating '\0'. + +2002-06-24 Juanma Barranquero <lektu@terra.es> + + * w32select.c: Include composite.h. + + * w16select.c: Likewise. + +2002-06-24 Kenichi Handa <handa@etl.go.jp> + + * callproc.c (Fcall_process): If code detection is necessary, + call detect_coding directly here. + + * coding.c (detect_eol): Preserve coding->cmp_data. + + * w16select.c (Fw16_get_clipboard_data): + * w32fns.c (w32_to_x_font): + * w32select.c (Fw32_get_clipboard_data): + * xselect.c (selection_data_to_lisp_data): + * xterm.c (XTread_socket): Disable composition handling. + +2002-06-24 Stefan Monnier <monnier@cs.yale.edu> + + * print.c (temp_output_buffer_setup): Kill all local variables. + +2002-06-22 Stefan Monnier <monnier@cs.yale.edu> + + * lread.c (Fread): Remove redundant and imprecise declaration. + + * xfns.c (check_x_display_info): Use check_x_frame. + + * .gdbinit (xprintsym): Use the new `xname' field. + (xsymbol): Use it. + +2002-06-22 Jason Rumney <jasonr@gnu.org> + + * w32fns.c (file_dialog_callback): New function. + (Fx_file_dialog): Allow selecting directories as well as files. + +2002-06-21 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * m/pmax.h (START_FILES): Define START_FILES for NetBSD and + OpenBSD. Add support for mipseb-*-netbsd* machines. + +2002-06-17 Andrew Choi <akochoi@shaw.ca> + + * macterm.c (mac_scroll_area): Set foreground and backcolor to + black and white before scrolling. Restore frame background and + foreground color after scrolling. + (do_window_update): Call XClearWindow before calling expose_frame. + (make_mac_frame): Don't set FRAME_BACKGROUND_PIXEL and + FRAME_FOREGROUND_PIXEL of frame. + + * macterm.c (XTread_socket): If Vmac_command_key_is_meta is nil, + test Mac command key as <ALT> key. + +2002-06-17 Stefan Monnier <monnier@cs.yale.edu> + + * window.c (Fset_window_configuration): Lisp_Object/int mixup. + + * keyboard.c (read_key_sequence): Be more careful with first_unbound. + Lookup keys in function-key-map immediately so that key-translation-map + can be applied earlier. + Remove function_key_possible and key_translation_possible, replaced + by checking `keytran_start < t'. + + * .gdbinit (xsymbol): Use the new `xname' field. + +2002-06-17 Andrew Choi <akochoi@shaw.ca> + + * macterm.c (XTread_socket): If Vmac_command_key_is_meta is nil, + test Mac command key as <ALT> key. + + * mac.c (do_applescript): Call initialize_applescript if necessary + when first called. Dispose of result_desc only when there is no error. + (Fdo_applescript): Use %d format specifier instead of %ld. + +2002-06-16 Andrew Choi <akochoi@shaw.ca> + + * macterm.c (XTread_socket): Call FrontNonFloatingWindow instead + of FrontWindow for cases keyDown and autoKey. + + * fontset.c (syms_of_fontset) [MAC_OS]: Set ASCII font of + Vdefault_fontset to Monaco with mac-roman coding. + + * mac.c, macfns.c, macmenu.c, macterm.c: Undefine and redefine + init_process before and after inclusion of Carbon/Carbon.h, resp. + + * macterm.c (x_new_font): Set font for normal_gc, reverse_gc, and + cursor_gc. + (add_font_name_table_entry): New function. + (init_font_name_table): Use add_font_name_table_entry; add italic, + bold, and bold-italic entries for truetype fonts. + + * xfaces.c (init_frame_faces) [MAC_OS]: Call realize_basic_faces + for Mac too. + (try_font_list) [MAC_OS]: If no font matches given registry, try + fonts with any registry matching face_family. + (realize_x_face) [MAC_OS]: Remove old ad-hoc fix to load font here. + + * s/darwin.h: If autoconf detects the Ncurses library, define + LIBS_TERMCAP to -lncurses to use it. + +2002-06-16 Eli Zaretskii <eliz@is.elta.co.il> + + * strftime.c [__hpux]: Include sys/_mbstate_t.h. + +2002-06-15 Richard M. Stallman <rms@gnu.org> + + * window.c (Fset_window_configuration): Explicitly preserve + the point value that new_current_buffer had at the start. + +2002-06-14 Juanma Barranquero <lektu@terra.es> + + * composite.c (Fcompose_region_internal, Fcompose_string_internal): + Fix typos. + +2002-06-14 Kim F. Storm <storm@cua.dk> + + * insdel.c (insert_1_both, insert_from_string_1) + (insert_from_buffer_1): Recalculate END_UNCHANGED in case the + insert happened in the end_unchanged region. Otherwise, the + redisplay may be confused and duplicate the last line in the + buffer [seen after save-buffer when require-final-newline==t]. + +2002-06-13 Jason Rumney <jasonr@gnu.org> + + * w32.c (init_environment): Remove EMACSLOCKDIR. + (stat): Swap _S_IFDIR and _S_IFREG. + +2002-06-13 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * keyboard.c, macterm.c, macmenu.c, msdos.c, sysdep.c + * termhooks.h, xmenu.c, xsmfns.c, xterm.h, xterm.c, w32term.c, + * w32menu.c, w32inevt.c: Rename enum event_kind as follows: + ascii_keystroke to ASCII_KEYSTROKE_EVENT, multibyte_char_keystroke + to MULTIBYTE_CHAR_KEYSTROKE_EVENT, non_ascii_keystroke to + NON_ASCII_KEYSTROKE_EVENT, timer_event to TIMER_EVENT, mouse_click + to MOUSE_CLICK_EVENT, mouse_wheel to MOUSE_WHEEL_EVENT, + language_change_event to LANGUAGE_CHANGE_EVENT, scroll_bar_click + to SCROLL_BAR_CLICK_EVENT, w32_scroll_bar_click to + W32_SCROLL_BAR_CLICK_EVENT, selection_request_event to + SELECTION_REQUEST_EVENT, selection_clear_event to + SELECTION_CLEAR_EVENT, buffer_switch_event to BUFFER_SWITCH_EVENT, + delete_window_event to DELETE_WINDOW_EVENT, iconify_event to + ICONIFY_EVENT, deiconify_event to DEICONIFY_EVENT, + menu_bar_activate_event to MENU_BAR_ACTIVATE_EVENT, drag_n_drop to + DRAG_N_DROP_EVENT, save_session_event to SAVE_SESSION_EVENT and + no_event to NO_EVENT. + +2002-06-12 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * macmenu.c: Remove declaration of Qmouse_click and Qevent_kind. + +2002-06-12 Stefan Monnier <monnier@cs.yale.edu> + + * intervals.c (textget): Don't forget to `return'. + (lookup_char_property): Use XCAR/XCDR. + +2002-06-12 Juanma Barranquero <lektu@terra.es> + + * xdisp.c (Fformat_mode_line): Fix typo. + +2002-06-12 Kim F. Storm <storm@cua.dk> + + * xdisp.c (Fformat_mode_line): New function. + (frame_title_buf, frame_title_buf_end, frame_title_ptr) + (store_frame_title_char, store_frame_title): Use unconditionally. + (init_xdisp): Defsubr Fformat_mode_line. + Initialize frame_title_buf etc. unconditionally. + +2002-06-11 Stefan Monnier <monnier@cs.yale.edu> + + * keyboard.c (read_key_sequence): + Remove prev_(fkey|keytran}_(map|start|end) since we don't want to pass + things through those maps after downcasing events. + Enforce that keytran_end <= fkey_start, i.e. that key-translation-map + applies after function-key-map. + Make sure that keytran can be done in the middle in the sequence. + Be careful not to throw away events past the one we downcase. + + * lread.c (read_integer): Remove unused var `tem'. + (read1): Fix int/Lisp_Object mixup. + + * xfaces.c (tty_lookup_color): Type bool/Lisp_Object mismatch fixed. + +2002-06-11 Richard M. Stallman <rms@gnu.org> + + * keyboard.c (readable_events): Ignore any number of + FOCUS_IN_EVENT events and return 0 if nothing else in buffer. + +2002-06-09 Miles Bader <miles@gnu.org> + + * xfaces.c (Ftty_supports_face_attributes_p): New function. + (parse_rgb_list, tty_lookup_color): New functions. + (tty_defined_color): Use `tty_lookup_color' to do all the work. + (color_distance, Fcolor_distance): New functions. + (TTY_SAME_COLOR_THRESHOLD): New macro. + (Qtty_color_standard_values): New variable. + (syms_of_xfaces): Initialize new vars & functions. + +2002-06-08 Colin Walters <walters@verbum.org> + + * textprop.c (Vchar_property_alias_alist): New variable. + (syms_of_textprop) <Vchar_property_alias_alist>: DEFVAR_LISP. + + * intervals.c (lookup_char_property): New function for looking up + overlay and text properties, created from textget. + (textget): Use it. + + * intervals.h (lookup_char_property): Declare. + (Vchar_property_alias_alist): Declare. + + * buffer.c (Foverlay_get): Use lookup_char_property. + +2002-06-07 Sam Steingold <sds@gnu.org> + + * xselect.c (lisp_data_to_selection_data): Fix last change: + *data_ret is not a Lisp string, while unibyte_string is. + +2002-06-07 Eli Zaretskii <eliz@is.elta.co.il> + + * xselect.c (lisp_data_to_selection_data): Fix last change: + set size_ret. + +2002-06-07 Andreas Schwab <schwab@suse.de> + + * m/amdx86-64.h: New file. + +2002-06-05 Eli Zaretskii <eliz@is.elta.co.il> + + * fns.c (Fstring_make_unibyte): Doc fix. + + * xselect.c (lisp_data_to_selection_data): If the requested type + is STRING, call string_make_unibyte to encode the selected text + as a string. + + * window.c (Fset_window_hscroll): Doc fix. + +2002-06-05 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * fileio.c (choose_write_coding_system): + Call select-safe-coding-system properly. + +2002-06-03 Richard M. Stallman <rms@gnu.org> + + * xdisp.c (message_with_string): Error if STRING is not a string. + + * fns.c (md5): Pass FILE arg to Vselect_safe_coding_system_function. + + * fileio.c (choose_write_coding_system): Pass FILE arg to + Vselect_safe_coding_system_function. + +2002-06-03 Ken Raeburn <raeburn@gnu.org> + + * buffer.c (fix_overlays_before): Fix list-walking bug in 05-19 change. + +2002-06-02 Thien-Thi Nguyen <ttn@gnu.org> + + * bytecode.c (Fbyte_code): Cast `current_column' return value to int. + * cmds.c (Fdelete_backward_char, internal_self_insert): Likewise. + * keymap.c (describe_command): Likewise. + * minibuf.c (read_minibuf): Likewise. + + * xdisp.c (redisplay_internal, redisplay_window, decode_mode_spec): + Cast `current_column' return value to int. + (back_to_previous_visible_line_start) + (reseat_at_next_visible_line_start, next_element_from_buffer): + Cast `indented_beyond_p' 3rd arg to float. + + * indent.c (last_known_column): Now a float. + (current_column_1, position_indentation, current_column) + (string_display_width): Return float. + (Fcurrent_column): Cast `current_column' return value to int. + (Fcurrent_indentation): Cast `position_indentation' retval to int. + (indented_beyond_p): Third arg now a float. + (compute_motion, vmotion): Cast `indented_beyond_p' 3rd arg to float. + + * lisp.h (current_column): Now returns float. + (indented_beyond_p): 3rd arg now a float. + +2002-05-31 Eli Zaretskii <eliz@is.elta.co.il> + + * xfns.c (x_encode_text): Return stringp non-NULL if coding_system + is Qcompound_text_with_extensions. + + * xselect.c (lisp_data_to_selection_data): Always set selection + type as string if x_encode_text returns streingp non-NULL. + + * s/netbsd.h: Include /usr/pkg in the run time shared library path. + +2002-05-30 Richard M. Stallman <rms@gnu.org> + + * window.c (Fset_window_configuration): Correct the handling + of point in current buffer, to work with multiple windows. + +2002-05-29 Colin Walters <walters@verbum.org> + + * lread.c (Fread_from_string): Don't depend on order of evaluation + for C function parameters. + +2002-05-28 Richard M. Stallman <rms@gnu.org> + + * xterm.c (x_display_and_set_cursor): Change the cursor in the same + way for blinked-off state and for a nonselected window. + + * window.c (window_scroll_pixel_based): Don't call Fbolp; + instead, see if the new start pos is at beginning of line. + + * fileio.c (Fwrite_region): If START is a string, don't + make any annotations. + + * eval.c (syms_of_eval): Doc fix. + +2002-05-28 Colin Walters <walters@debian.org> + + * emacs.c (USAGE1): Add --no-splash. + (standard_args): Ditto. + +2002-05-28 Colin Walters <walters@gnu.org> + + * lread.c (readchar_count): New variable. + (readchar): Increment it. + (unreadchar): Decrement it. + (read_multibyte): Decrement it. + (Vread_with_symbol_positions): New variable. + (Vread_symbol_positions_list): New variable. + (read_internal_start): New function, created from Fread and + Fread_from_string. Handle Vread_symbol_positions_list and + Vread_with_symbol_positions. + (readevalloop, Fread, Fread_from_string): Use it. + (read1): Use readchar_count to add symbol positions to + Vread_symbol_positions_list if Vread_with_symbol_positions is non-nil. + (syms_of_lread): DEFVAR_LISP and initialize them. + + * lread.c (read0, read1, read_list, read_vector, read_multibyte) + (substitute_object_recurse, substitute_object_in_subtree) + (substitute_in_interval): Prototype. + (read_multibyte): Return c if it's less than zero. + +2002-05-28 Kim F. Storm <storm@cua.dk> + + * fileio.c (Fread_file_name_internal): Added brute-force + speed up for using predicate file-directory-p. + +2002-05-28 Kim F. Storm <storm@cua.dk> + + * fileio.c (Vread_file_name_function, Vread_file_name_predicate): + New variables. + (syms_of_fileio): DEFVAR_LISP them. + (read_file_name_cleanup): New unwind function. + (Fread_file_name_internal): Only return completions satifying + Vread_file_name_predicate. Temporarily unwind protect and rebind + default-directory while checking completions against the predicate. + (Fread_file_name): Added PREDICATE argument. Specbind it to + Vread_file_name_predicate during completion. + Call Vread_file_name_function to read the file name if non-nil. + + * lisp.h (Fread_file_name): Now has 6 args. + + * callint.c (Fcall_interactively) <"D">: Supply Qfile_directory_p + predicate for Fread_file_name when reading directory name. + Supply Qnil for predicate in other calls to Fread_file_name. + +2002-05-26 Miles Bader <miles@gnu.org> + + * term.c (tty_capable_p): New function. + * dispextern.h (tty_capable_p): New function declaration. + (TTY_CAP_INVERSE, TTY_CAP_UNDERLINE, TTY_CAP_BOLD, TTY_CAP_DIM) + (TTY_CAP_BLINK, TTY_CAP_ALT_CHARSET): New macros. + +2002-05-23 Stefan Monnier <monnier@cs.yale.edu> + + * fileio.c (read_non_regular, Finsert_file_contents): Use BEG_BYTE. + (Finsert_file_contents, build_annotations): Use XCAR, XCDR. + (Vwrite_region_annotate_functions): Docstring fix. + +2002-05-23 Kim F. Storm <storm@cua.dk> + + * xterm.c (x_write_glyphs): Clear phys_cursor_on_p if current + phys_cursor's hpos is overwritten. This is still not completely + correct, as it doesn't really make sense to use hpos at all to + get the cursor glyph (as that is relative to the width of the + characters on the line, which may have changed during the update). + +2002-05-22 Jason Rumney <jasonr@gnu.org> + + * w32fns.c (enumfont_t): Remove tail, make pattern a normal + Lisp_Object. + (enum_font_cb2, enum_font_maybe_add_to_list, w32_list_fonts): + Use modified enumfont_t struct. + + * w32term.h (text_cursor_kinds): New enumeration member HBAR_CURSOR. + + * w32term.c (x_draw_bar_cursor): New argument KIND; callers changed. + Handle the `hbar' cursor type. + (x_display_and_set_cursor): Handle the HBAR_CURSOR case. + + * w32fns.c (Qhbar): New variable. + (x_specified_cursor_type): Use it. + +2002-05-21 Ken Raeburn <raeburn@gnu.org> + + * w32fns.c (enum_font_maybe_add_to_list): Use XCDR_AS_LVALUE for + now, when the address is needed. + +2002-05-21 Colin Walters <walters@gnu.org> + + * Makefile.in (shortlisp): Add font-core.el. + +2002-05-20 Richard M. Stallman <rms@gnu.org> + + * buffer.c (syms_of_buffer) <cursor-type>: Doc fix. + + * keyboard.c (read_char_minibuf_menu_prompt): Don't list + equivalent key bindings here. + +2002-05-20 Ken Raeburn <raeburn@gnu.org> + + Change symbol structure to contain a lisp object for the symbol + name: + * lisp.h (struct Lisp_Symbol): Replace field "name" with a lisp + object field named "xname". + (SYMBOL_NAME): New macro. + * abbrev.c (write_abbrev): Use SYMBOL_NAME instead of XSYMBOL and + name field. + * alloc.c (Fmake_symbol): Set symbol xname field instead of name. + (mark_object, gc_sweep): Use symbol xname field and XSTRING + instead of name field. + * buffer.c (buffer_slot_type_mismatch): Use XSTRING and + SYMBOL_NAME instead of XSYMBOL and name field. + * callint.c (Fcall_interactively): Use XSTRING and SYMBOL_NAME + instead of XSYMBOL and name field. + * charset.c (Fdefine_charset, Fdeclare_equiv_charset): Use XSTRING + and SYMBOL_NAME instead of XSYMBOL and name field. + * coding.c (Fread_coding_system, code_convert_region1) + (code_convert_string1, code_convert_string_norecord) + (Ffind_operation_coding_system): Use SYMBOL_NAME instead of + XSYMBOL and name field. + * data.c (Fkeywordp, Fsymbol_name, store_symval_forwarding) + (Fmake_variable_buffer_local, Fmake_local_variable) + (Fmake_variable_frame_local): Use SYMBOL_NAME and XSTRING instead + of XSYMBOL and name field. + * editfns.c (Fformat): Use SYMBOL_NAME and XSTRING instead of + XSYMBOL and name field. + * emacs.c (shut_down_emacs) [#if 0]: Use SYMBOL_NAME and XSTRING + instead of XSYMBOL and name field. + * eval.c (do_autoload): Use SYMBOL_NAME and XSTRING instead of + XSYMBOL and name field. + * fns.c (Fstring_equal, Fstring_lessp, Frequire, sxhash): + Use SYMBOL_NAME and XSTRING instead of XSYMBOL and name field. + * fontset.c (Fset_fontset_font): Use SYMBOL_NAME and XSTRING + instead of XSYMBOL and name field. + * keyboard.c (echo_char, record_char, parse_modifiers_uncached) + (parse_modifiers, apply_modifiers, Fevent_convert_list) + (parse_solitary_modifier, Fexecute_extended_command): + Use SYMBOL_NAME and XSTRING instead of XSYMBOL and name field. + * keymap.c (silly_event_symbol_error, Fsingle_key_description) + (Fdescribe_buffer_bindings): Use SYMBOL_NAME and XSTRING instead + of XSYMBOL and name field. + (describe_command, describe_translation): Use SYMBOL_NAME and + assignment instead of XSYMBOL and name field and XSETSTRING. + * lread.c (Fintern_soft, oblookup): Use SYMBOL_NAME and XSTRING + instead of XSYMBOL and name field. + (Funintern): Use SYMBOL_NAME and assignment instead of XSYMBOL and + name field and XSETSTRING. + * macfns.c (parse_image_spec): Use SYMBOL_NAME and XSTRING instead + of XSYMBOL and name field. + * minibuf.c (Fread_command, Fread_variable): Use SYMBOL_NAME and + assignment instead of XSYMBOL and name field and XSETSTRING. + * print.c (print_error_message, print_object): Use SYMBOL_NAME and + XSTRING instead of XSYMBOL and name field. + * process.c (set_socket_options, Fsignal_process): Use SYMBOL_NAME + and XSTRING instead of XSYMBOL and name field. + * w32fns.c (parse_image_spec, w32_parse_hot_key): Use SYMBOL_NAME + and XSTRING instead of XSYMBOL and name field. + * xfaces.c (merge_face_vector_with_property): Use SYMBOL_NAME and + XSTRING instead of XSYMBOL and name field. + * xfns.c (parse_image_spec): Use SYMBOL_NAME and XSTRING instead + of XSYMBOL and name field. + * xselect.c (symbol_to_x_atom, x_get_foreign_selection): + Use SYMBOL_NAME and XSTRING instead of XSYMBOL and name field. + +2002-05-19 Ken Raeburn <raeburn@gnu.org> + + * lisp.h (LISP_MAKE_RVALUE): Delete disabled version, making XCAR + and XCDR real rvalues in most configurations. + + * buffer.c (fix_overlays_in_range, fix_overlays_before): + Don't take the address of the cdr part of a cons cell; instead, track + the parent cell and call XSETCDR, or set the variable for the head + of the list if we haven't started down the list yet. + +2002-05-19 Richard M. Stallman <rms@gnu.org> + + * doc.c (reread_doc_file): Don't ask for confirmation. + +2002-05-18 Jason Rumney <jasonr@gnu.org> + + * w32fns.c (w32_create_pixmap_from_bitmap_data): New function. + (xbm_load_image): Use it. + (xbm_load): Ditto. + (xbm_read_bitmap_data): Reverted to xfns.c version. + From David Ponce <david@dponce.com>. + +2002-05-17 Eli Zaretskii <eliz@is.elta.co.il> + + * msdos.c (sig_suspender, sigprocmask): Don't define for DJGPP + 2.02 and later. + +2002-05-16 Juanma Barranquero <lektu@terra.es> + + * keyboard.c (Fthis_command_keys, Fthis_command_keys_vector): Fix typo. + +2002-05-15 Stefan Monnier <monnier@cs.yale.edu> + + * keyboard.c (read_char_x_menu_prompt): Use an equivalent but more + meaningful test. + (read_char_minibuf_menu_prompt): Fix typo. + +2002-05-15 Eli Zaretskii <eliz@is.elta.co.il> + + * eval.c (Fcommandp): Doc fix. + +2002-05-13 Stefan Monnier <monnier@cs.yale.edu> + + * keymap.c (keymap_parent): New fun, extracted from Fkeymap_parent. + (Fkeymap_parent, keymap_memberp, fix_submap_inheritance): Use it. + (Fset_keymap_parent): Gcpro a bit more. + (access_keymap): Gcpro around meta_map call and around the main loop. + (get_keyelt): Gcpro when following indirect references. + (copy_keymap_item): New fun, extracted from Fcopy_keymap. + (copy_keymap_1, Fcopy_keymap): Use it. Don't copy the parent map. + (Fdefine_key, Flookup_key): Gcpro before calling get_keymap. + Remove useless ad-hoc remap code. + +2002-05-13 Richard M. Stallman <rms@gnu.org> + + * search.c (search_buffer): Give up boyer moore search if inverse + translation change charset_base. + +2002-05-12 Eli Zaretskii <eliz@is.elta.co.il> + + * coding.c (decode_coding) <coding_type_ccl>: If a lone CR + characters is carried over from the previous block of text, adjust + coding->produced to account for the extra character. + +2002-05-11 Andreas Schwab <schwab@suse.de> + + * coding.c (intersection): Keep the elements of the returned list + in the same order as in the first list. + +2002-05-11 Kim F. Storm <storm@cua.dk> + + * keymap.c (current_minor_maps): Fix resizing of cmm_maps; + only update cmm_size if realloc actually succeeds. + Testing with initial size of 2 elements revealed that using + realloc on GNU/Linux would cause a random trap in xmalloc + later on, so I rewrote the code to use malloc/bcopy/free instead + of realloc. + +2002-05-10 Jason Rumney <jasonr@gnu.org> + + * w32fns.c (enum_font_cb2): Avoid DBCS raster fonts. + +2002-05-10 Eli Zaretskii <eliz@is.elta.co.il> + + * coding.c (encode_coding_sjis_big5): Enclose bitwise AND in + parens, to ensure correct evaluation order. + +2002-05-10 Kim F. Storm <storm@cua.dk> + + * keymap.c (Vemulation_mode_map_alists): New variable. + (syms_of_keymap): DEFVAR_LISP it. + (current_minor_maps): Process keymap alists in that list before + minor-mode-overriding-map-alist and minor-mode-map-alist. + +2002-05-09 Richard M. Stallman <rms@gnu.org> + + * search.c (Freplace_match): Doc fix. + +2002-05-09 Kim F. Storm <storm@cua.dk> + + * macterm.c (x_draw_image_foreground, x_draw_image_foreground_1): + Enlarge cursor rectangle drawn around image with non-zero relief. + + * w32term.c (x_draw_image_foreground, w32_draw_image_foreground_1): + Enlarge cursor rectangle drawn around image with non-zero relief. + + * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1): + Enlarge cursor rectangle drawn around image with non-zero relief. + +2002-05-07 Eli Zaretskii <eliz@is.elta.co.il> + + * xselect.c (lisp_data_to_selection_data): Don't set selection + type if comes from the Lisp object's car. If the selection + contains a pure ASCII text, always return QSTRING as its type. + +2002-05-06 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * mac.c (mac-cut-function): Doc fix. + +2002-05-05 Richard M. Stallman <rms@gnu.org> + + * s/gnu.h [DOUG_LEA_MALLOC] (REL_ALLOC): Undefine it. + +2002-05-04 Jason Rumney <jasonr@gnu.org> + + * keyboard.c (make_lispy_event) <mouse-wheel>: Set count to 1 + for event-click-count. + + * process.c (init_process): Only add server subfeature if we can + use non-blocking I/O. + +2002-05-04 Andrew Choi <akochoi@shaw.ca> + + * macterm.c (XTread_socket): Call WaitNextEvent once instead of + repeatedly. + +2002-05-03 Jason Rumney <jasonr@gnu.org> + + * process.c (Fmake_network_process): Only support server sockets + when we can make them non-blocking. + + * s/ms-w32.h (HAVE_SELECT): Define. + + * w32.h (FILE_NDELAY): New flag. + + * w32.c (sys_getpeername, fcntl): New functions. + (_sys_read_ahead): Temporarily block on non-blocking sockets. + + * w32proc.c: Include sys/file.h. + +2002-05-03 Colin Walters <walters@verbum.org> + + * callproc.c (Vgame_score_directory): Renamed to + Vshared_game_score_directory. + +2002-04-30 Richard M. Stallman <rms@gnu.org> + + * s/gnu.h [emacs]: Include stdio.h. + (GNU_LIBRARY_PENDING_OUTPUT_COUNT): New definition, conditional. + + * eval.c (do_autoload): Error if called while preparing to dump. + + * fns.c (Frequire): Error if need to load while preparing to dump. + +2002-04-28 Colin Walters <walters@verbum.org> + + * callproc.c (Vgame_score_directory) [!HAVE_SHARED_GAME_DIR]: + Default to "~/.emacs.d/games". + +2002-04-29 Stefan Monnier <monnier@cs.yale.edu> + + * lread.c (openp): Change arg exec_only to predicate. + (build_load_history): Use XCAR/XCDR. + (Flocate_file_internal): New fun. + (syms_of_lread): Defsubr it. + (Fload): Update call to openp. + + * lisp.h (openp): Update prototype. + + * xfns.c (x_create_bitmap_from_file, x_find_image_file): + * w32proc.c (sys_spawnve): + * w32fns.c (x_create_bitmap_from_file, x_find_image_file): + * w32.c (check_windows_init_file): + * sound.c (Fplay_sound_internal): + * process.c (Fstart_process): + * macfns.c (x_create_bitmap_from_file, x_find_image_file): + * mac.c (run_mac_command): + * emacs.c (init_cmdargs): + * callproc.c (Fcall_process): Update call to openp. + + * textprop.c (remove_properties): Don't use XCAR without CONSP. + + * xterm.c (XTread_socket): Disable the Xutf8LookupString code. + +2002-04-29 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * dispextern.h (DEFAULT_TOOL_BAR_BUTTON_MARGIN) + (DEFAULT_TOOL_BAR_BUTTON_RELIEF): Change default values. + +2002-04-28 Richard M. Stallman <rms@gnu.org> + + * minibuf.c (Fall_completions, Ftry_completion): New arg to Fcommandp. + + * eval.c (Fcommandp): New arg for_call_interactively. + * lisp.h (Fcommandp): Declare new arg. + +2002-04-28 Jason Rumney <jasonr@gnu.org> + + * w32proc.c (syms_of_w32proc): Get true file attributes by default. + + * w32.c (stat, fstat): Use file index information to generate + inodes for directories where available. + +2002-04-26 Andrew Choi <akochoi@shaw.ca> + + * Makefile.in (C_SWITCH_SYSTEM_TEMACS): Add. + [HAVE_CARBON]: Include Mac object files. + + * alloc.c, callproc.c, dispextern.h, dispnew.c, emacs.c, + fontset.c, frame.c, frame.h, keyboard.c, sysdep.c, term.c, + termcap.c, window.c, xdisp.c, xfaces.c: Use macros MAC_OS8, + MAC_OSX, and MAC_OS instead of macintosh. + + * editfns.c [MAC_OS8]: Include stdio.h. + + * emacs.c [MAC_OS8]: Call mac_initialize instead of x_term_init. + + * fontset.c [MAC_OS]: Set Vdefault_fontset to ETL Fixed instead of + Apple Monaco. + + * process.c (QCfamily, QCfilte): Declare extern. + (wait_reading_process_input) [MAC_OSX]: Clear bit for stdin before + calling select. + + * termcap.c [MAC_OSX]: Don't define tgetnum, PC, tputs, and tgetent. + + * tparam.c [MAC_OSX]: Don't define BC and UP. + + * config.in [HAVE_CARBON]: Add. + + * mac.c, macgui.h, macfns.c, macmenu.c, macterm.c, macterm.h: + Move here from mac/src and mac/inc. + + * s/darwin.h, m/powermac.h, unexmacosx.c: New files. + +2002-04-26 Gerd Moellmann <gerd@gnu.org> + + * xterm.c (x_draw_phys_cursor_glyph): Undo last change. + Compute phys_cursor_width from the x position returned + by x_draw_glyhs, which is cheaper. + (x_display_and_set_cursor): Compute the buffer-local value + of `cursor-in-non-selected-windows' only when needed. + +2002-04-25 Gerd Moellmann <gerd@gnu.org> + + * xterm.c (x_draw_phys_cursor_glyph): Take into account that a box + cursor on a stretch glyph has a width that depends on + x_stretch_cursor_p. + +2002-04-25 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * abbrev.c (abbrev-start-location): Doc fix. + + * indent.c (Fvertical_motion): Fix last change. + +2002-04-25 Gerd Moellmann <gerd@gnu.org> + + * indent.c (Fvertical_motion): Move to the start of the line + containing PT before moving up or down. + +2002-04-24 Gerd Moellmann <gerd@gnu.org> + + * dispnew.c (update_text_area): Set phys_cursor_on_p to 0 in the + case of writing a whole row, more or less analogous to the case of + writing only parts of a row. + + * xterm.c (x_display_and_set_cursor): Set phys_cursor_width to + 0 for NO_CURSOR. + + * xterm.c (notice_overwritten_cursor): Fix an off by 1 error. + +2002-04-23 Colin Walters <walters@verbum.org> + + * buffer.c (syms_of_buffer): Doc fix. + +2002-04-23 Gerd Moellmann <gerd@gnu.org> + + * xterm.c (notice_overwritten_cursor): Handle the special case + of the cursor being in the first blank non-text line at the + end of a window. + + * xterm.c (x_draw_hollow_cursor, x_draw_bar_cursor) + (x_draw_phys_cursor_glyph): Set phys_cursor_width here. + (x_display_and_set_cursor): Don't set phys_cursor_width here, for + bar cursors only, to make phys_cursor_width contain what its name + suggests. + (notice_overwritten_cursor): Consider the cursor image erased if + the output area intersects the cursor image in y-direction. + +2002-04-23 Simon Marshall <simon@gnu.org> + + * xfns.c (x_set_mouse_color): Change default for cross_cursor + to XC_hand2. + +2002-04-23 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * xdisp.c: Remove unused global variable `minibuf_prompt_pixel_width'. + +2002-04-22 Kim F. Storm <storm@cua.dk> + + * textprop.c (remove_properties): Fixed trap for malformed plist. + +2002-04-22 Richard M. Stallman <rms@gnu.org> + + * cmds.c (Fend_of_line): Handle intangible text in mid line. + + * window.c (make_window): Initialize height_fixed_p, + last_cursor_off_p, and p->cursor_off_p slots. + +2002-04-20 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * fns.c (use-dialog-box): Doc fix. + +2002-04-19 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * xterm.c (note_mode_line_or_margin_highlight): Remove unused + variables `row', `i' and `area'. + (XTread_socket) <KeyPress>: Pass KeyPress events when in menu to + toolkit library. + +2002-04-19 Stefan Monnier <monnier@cs.yale.edu> + + * xfaces.c (clear_font_table): Don't free the default font of + a frame even if it's on another display. + (Finternal_set_lisp_face_attribute): Don't use XFRAME on something + that could be Qt. + +2002-04-19 Juanma Barranquero <lektu@terra.es> + + * indent.c (Fmove_to_column): Remove unused local variable + `next_boundary_byte'. + (current_column_1): Likewise. + +2002-04-19 Eli Zaretskii <eliz@is.elta.co.il> + + * msdos.c (Qhbar): New variable. + (syms_of_msdos): Intern and staticpro it. + (IT_set_cursor_type, IT_set_frame_parameters): Handle the `hbar' + cursor type. + +2002-04-19 Dave Lambert <dlambert@acm.org> + + Theses change implement an underscore-like (`hbar') cursor. + + * xterm.h (text_cursor_kinds): New enumeration member HBAR_CURSOR. + + * xterm.c (x_draw_bar_cursor): New argument KIND; callers changed. + Handle the `hbar' cursor type. + (x_display_and_set_cursor): Handle the HBAR_CURSOR case. + + * xfns.c (Qhbar): New variable. + (syms_of_xfns): Intern and staticpro it. + (x_specified_cursor_type): Handle `hbar' cursor. + + * s/sol2-5.h (bcopy, bzero, bcmp): Define only if HAVE_BCOPY is + not defined. + +2002-04-18 Richard M. Stallman <rms@gnu.org> + + * textprop.c (remove_properties): New arg LIST allows scanning + either a list or a plist. + (interval_has_some_properties_list): New function, like + interval_has_some_properties using list instead of plist. + All callers changed. + (Fremove_list_of_text_properties): New function. + (syms_of_textprop): Defsubr it. + +2002-04-17 Eli Zaretskii <eliz@is.elta.co.il> + + * s/sol2.h (HAVE_LIBKSTAT): Define only if not already defined. + +2002-04-17 Juanma Barranquero <lektu@terra.es> + + * indent.c (Fmove_to_column): Remove unused local variable `end_byte'. + +2002-04-17 Eli Zaretskii <eliz@is.elta.co.il> + + * window.c (coordinates_in_window): Don't report on margin area + if its width is zero. + +2002-04-16 Jason Rumney <jasonr@gnu.org> + + * w32fns.c (Fx_file_dialog): Decode file name before using. + + * w32term.c (construct_drag_n_drop): Likewise. + +2002-04-16 Eli Zaretskii <eliz@is.elta.co.il> + + * puresize.h (BASE_PURESIZE): Increase to 830000, since we now + store load-history in pure space. + + * s/msdos.h (SYSTEM_PURESIZE_EXTRA): Reduce to 50000. + +2002-04-16 Stefan Monnier <monnier@cs.yale.edu> + + * xterm.c (Qlatin_1, Qutf_8): New vars. + (syms_of_xterm): Initialize them. + (XTread_socket): Eliminate incorrect optimization that tried to avoid + decoding the output of X*LookupString. + Always use latin-1 to decode the output of XLookupString. + Try Xutf8LookupString if XmbLookupString failed. + + * region-cache.c (new_region_cache): Use BEG. + +2002-04-16 Gerd Moellmann <gerd@gnu.org> + + * buffer.c (MMAP_ALLOCATED_P): New macro to be set from system + configuration files. + (mmap_enlarge): Enlarge mapped regions only if MMAP_ALLOCATED_P + returns 0. + +2002-04-15 Andreas Schwab <schwab@suse.de> + + * config.in: Regenerated using autoheader. + + * m/7300.h, m/acorn.h, m/alliant-2800.h, m/alliant.h, m/alpha.h, + m/altos.h, m/amdahl.h, m/apollo.h, m/arm.h, m/att3b.h, m/aviion.h, + m/celerity.h, m/clipper.h, m/cnvrgnt.h, m/convex.h, m/cydra5.h, + m/delta.h, m/delta88k.h, m/dpx2.h, m/elxsi.h, m/gec63.h, + m/gould.h, m/hp800.h, m/hp9000s300.h, m/i860.h, m/ia64.h, + m/ibmps2-aix.h, m/ibmrs6000.h, m/ibmrt-aix.h, m/ibmrt.h, + m/ibms390.h, m/intel386.h, m/iris4d.h, m/irist.h, m/isi-ov.h, + m/m68k.h, m/macppc.h, m/masscomp.h, m/mg1.h, m/mips-siemens.h, + m/mips.h, m/news-r6.h, m/news.h, m/next.h, m/nh3000.h, m/nh4000.h + m/ns32000.h, m/orion.h, m/pfa50.h, m/plexus.h, m/pmax.h, + m/powerpcle.h, m/pyrmips.h, m/sequent-ptx.h, m/sequent.h, + m/sparc.h, m/sr2k.h, m/symmetry.h, m/tad68k.h, m/tahoe.h, + m/targon31.h, m/tek4300.h, m/tekxd88.h, m/template.h, m/tower32.h, + m/tower32v3.h, m/ustation.h, m/vax.h, m/wicat.h, m/windowsnt.h, + m/xps100.h, s/aix3-2.h, s/aix4-2.h, s/irix4-0.h, s/irix5-0.h, + s/sco5.h, s/unixware.h: Don't set HAVE_ALLOCA, C_ALLOCA and + STACK_DIRECTION, now set by autoconf. + +2002-04-14 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * dispnew.c (marginal_area_string): Sort arguments. + + * dispextern.h (marginal_area_string): Add prototype. + +2002-04-13 Richard M. Stallman <rms@gnu.org> + + * fileio.c (Finsert_file_contents): + Don't call temp_output_buffer_setup--do just part, by hand. + + * coding.c (run_pre_post_conversion_on_str): + Don't call temp_output_buffer_setup--do just part, by hand. + + * keyboard.c (command_loop_1): Don't call start_hourglass + or cancel_hourglass when executing a macro. + + * marker.c (count_markers): New function. + + * xdisp.c (display_mode_element): Don't let mode_line_proptrans_alist + grow without limit. Move recently used elements to the front. + +2002-04-13 Eli Zaretskii <eliz@is.elta.co.il> + + * unexelf.c (unexec) [__sgi]: Undo the change from 2002-01-20. + +2002-04-12 Gerd Moellmann <gerd@gnu.org> + + * xdisp.c (sync_frame_with_window_matrix_rows): Don't give frame + rows marginal areas. + (Fdump_frame_glyph_matrix) [GLYPH_DEBUG]: New function. + (syms_of_xdisp) [GLYPH_DEBUG]: Defsubr it. + + * dispnew.c (marginal_area_string): Check that glyph row is enabled. + +2002-04-12 Dave Love <fx@gnu.org> + + * dispnew.c (marginal_area_string): New. + + * window.c (window_part): Add ON_LEFT_MARGIN, ON_RIGHT_MARGIN. + (Qleft_margin, Qright_margin): Declare. + (coordinates_in_window, (Fcoordinates_in_window_p): Deal with margins. + + * xterm.c (note_mode_line_or_margin_highlight): Renamed from + note_mode_line_highlight and extended. + + * keyboard.c (Qleft_margin, Qright_margin): Declare. + (make_lispy_event): Deal with mouse events in margins. + +2002-04-12 Stefan Monnier <monnier@cs.yale.edu> + + * msdos.c (dos_rawgetc): Use a single event for HELP_EVENT. + + * keyboard.c (command_loop_1): Turn off transient-mark-mode rather + than deactivating the mark if tmm is set to `lambda'. + (gen_help_event, kbd_buffer_store_help_event, kbd_buffer_get_event): + Use a single event for HELP_EVENT. + (Fexecute_extended_command): Save last_point_position. + +2002-04-12 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * lisp.h (Fpropertize): Add prototype. + + * fns.c (Fy_or_n_p): Use `minibuffer-prompt' face for prompt. + +2002-04-10 Colin Walters <walters@verbum.org> + + * config.in: Add HAVE_SHARED_GAME_DIR. + + * callproc.c (Vgame_score_directory): New variable. + (syms_of_callproc) <Vgame_score_directory>: DEFVAR_LISP. + +2002-04-10 Richard M. Stallman <rms@gnu.org> + + * puresize.h (BASE_PURESIZE): Reduce again to avoid big excess. + +2002-04-09 Stefan Monnier <monnier@cs.yale.edu> + + * minibuf.c (read_minibuf): Use empty_string. + (Ftry_completion): Allow lambda forms and lists of strings for `alist'. + Short-circuit the search as soon as it "failed". + (Fall_completions): Allow lambda forms and lists of strings for alist. + (Fcompleting_read): Set Qminibuffer_completion_confirm to nil + when require_match is nil. + (Ftest_completion): Rename from `test_completion' and export to elisp. + Call the predicate also when alist is a list. + Obey Vcompletion_regexp_list. + (do_completion, Fminibuffer_complete_and_exit): Use it. + (Fassoc_string): Rename from `assoc_for_completion'. + Allow list of strings as well and export to elisp. + +2002-04-08 Stefan Monnier <monnier@cs.yale.edu> + + * puresize.h (BASE_PURESIZE): Increase to 900KB. + +2002-04-08 Juanma Barranquero <lektu@terra.es> + + * w32.c (sys_accept): Don't hide variable `s'. + +2002-04-05 Gerd Moellmann <gerd@gnu.org> + + * callint.c (Fcall_interactively): Use INTEGERP instead of + NUMBERP for checking Vhistory_length. + +2002-04-05 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * sound.c (Fplay_sound_internal): Renamed from Fplay_sound. + Doc fix to reflect it. + +2002-04-04 Richard M. Stallman <rms@gnu.org> + + * xdisp.c (display_mode_element): New arg RISKY. + Disregard text props found or specified within a variable + that isn't marked risky-local-variable. + (Qrisky_local_variable): New variable. + (syms_of_xdisp): Init and staticpro it. + +2002-04-04 Stefan Monnier <monnier@cs.yale.edu> + + * undo.c (record_point): New fun. + (record_delete, record_insert): Use it. + +2002-04-03 Juanma Barranquero <lektu@terra.es> + + * doc.c (Fdocumentation): Add missing parentheses. + (Fdocumentation_property): Likewise. + +2002-04-03 Stefan Monnier <monnier@cs.yale.edu> + + * doc.c (Fdocumentation, Fdocumentation_property): When the doc + data is 0, just return nil. + +2002-04-03 Eli Zaretskii <eliz@is.elta.co.il> + + * msdos.c (syms_of_msdos): Fix last change with + mouse_autoselect_window. + +2002-04-03 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * w32term.c, xterm.c, msdos.c: Rename autoselect_window_p to + mouse_autoselect_window. + +2002-04-02 Stefan Monnier <monnier@cs.yale.edu> + + * keyboard.c (make_lispy_event): Handle unknown keysyms together + with system-specific keysyms. Use it also for unknown function keys. + + * doc.c (reread_doc_file): Return whether reload was attempted. + (Fdocumentation, Fdocumentation_property): Don't try to reload + if the doc is 0 and only ask once. + + * Makefile.in (lisp, shortlisp): Add ucs-tables.elc. + +2002-04-02 Eli Zaretskii <eliz@is.elta.co.il> + + * keyboard.c (read_char): If the event was Qselect_window, + restore timer_idleness_start_time to its previous value. + + * msdos.c (dos_rawgetc): Generate SELECT_WINDOW_EVENTs when required. + +2002-04-01 Stefan Monnier <monnier@cs.yale.edu> + + * region-cache.c (new_region_cache): Use BEG. + + * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): + Use BEG and BEG_BYTE. + + * doc.c (get_doc_string): Return nil if the location is wrong. + (reread_doc_file): New fun. + (Fdocumentation, Fdocumentation_property): + Call it if get_doc_string fails. + (Fsnarf_documentation): Make it work for a dumped Emacs. + + * charset.h (DEC_POS, BUF_DEC_POS): Use BEG_BYTE. + Bound the search with MAX_MULTIBYTE_LENGTH to avoid pathological case. + + * charset.c (Fstring): Allow 0 arguments. + + * xterm.c (XTread_socket): Fix int/Lisp_Object confusion. + + * process.c (DATAGRAM_CONN_P, list_processes_1) + (Fprocess_datagram_address, Fset_process_datagram_address) + (Fset_network_process_options, server_accept_connection): + Fix some int/Lisp_Object confusions (thank you union types). + +2002-04-01 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * msdos.c: Rename x_autoselect_window_p to autoselect_window_p. + + * w32term.c: Likewise. + (note_mouse_movement): Put code for x_autoselect_window_p in #if 0. + + * keyboard.c (Qselect_window): New symbol. + (head_table): Use it. + (keys_of_keyboard): Bound select-window event to handle-select-window. + (kbd_buffer_get_event): Make a Lisp event from SELECT_WINDOW_EVENT. + + * xterm.c: Rename x_autoselect_window_p to autoselect_window_p. + (last_window): New variable. + (XTread_socket): Generate SELECT_WINDOW_EVENTs. + (note_mouse_movement): Remove reimplemented code in #if 0. + (XTread_socket): Generate SELECT_WINDOW_EVENTs only for + Emacs windows. + + * termhooks.h (enum event_kind): New event type `SELECT_WINDOW_EVENT'. + +2002-03-31 Gerd Moellmann <gerd@gnu.org> + + * xterm.c (x_get_char_face_and_encoding): Add parameter DISPLAY_P. + Callers changed. + +2002-03-30 Richard M. Stallman <rms@gnu.org> + + * window.c (window_scroll_pixel_based): Exit the move_it_by_lines + loop whenever it stops making progress. + + * widget.c (set_frame_size): Don't call change_frame_size. + +2002-03-30 Gerd Moellmann <gerd@gnu.org> + + * dispnew.c (direct_output_for_insert): + Call mark_window_display_accurate. + +2002-03-29 Jason Rumney <jasonr@gnu.org> + + * w32term.c (w32_draw_relief_rect): Fix calculations of line lengths. + +2002-03-29 Eli Zaretskii <eliz@is.elta.co.il> + + * Makefile.in (lread.o): Depend on coding.h. + + * lread.c (openp, Fload): Encode the file name before passing it + to `stat', `access', and `emacs_open'. + (openp): GCPRO the encoded file name. Don't recompute Lisp + strings unnecessarily. + +2002-03-29 Kim F. Storm <storm@cua.dk> + + * fns.c (Flax_plist_put): Doc fix. + +2002-03-28 Miles Bader <miles@gnu.org> + + * process.c (DATAGRAM_CONN_P): Make sure PROC is really a process. + +2002-03-27 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * process.c (set-network-process-options): Add usage. + (make-network-process): Doc fix. + +2002-03-26 Eli Zaretskii <eliz@is.elta.co.il> + + * emacs.c (Fdump_emacs): Fix a typo in "command-line-processed". + +2002-03-26 Richard M. Stallman <rms@gnu.org> + + * fns.c (Fsubstring_no_properties): New function. + (Flax_plist_get, Flax_plist_put): New functions. + (syms_of_fns): defsubr them. + + * xdisp.c (update_menu_bar): Test only update_mode_lines; + don't test or alter w->update_mode_line. + + * window.c (Fdisplay_buffer): Doc fix. + +2002-03-24 Richard M. Stallman <rms@gnu.org> + + * regex.c (GET_UNSIGNED_NUMBER): Give proper error for spaces. + +2002-03-24 Gerd Moellmann <gerd@gnu.org> + + * eval.c (Qdeclare, Vmacro_declaration_function): New variables. + (Fdefmacro): Handle `(declare ...)'. + (syms_of_eval) <Qdeclare>: Initialize and staticpro. + (syms_of_eval) <Vmacro_declaration_function>: DEFVAR_LISP. + +2002-03-24 Jason Rumney <jasonr@gnu.org> + + * w32fns.c (xbm_scan, xbm_load_image, xbm_read_bitmap_data) + (xbm_file_p): Add prototypes. + (xbm_format, xbm_image_p): Sync with xfns.c. + (reflect_byte): New function. + (xbm_read_bitmap_data): Sync with xfns.c, adapt for Windows. + (xbm_load_image): Create bitmaps with a depth of 1. + (init_xfns): Enable XBM images. + +2002-03-23 Jason Rumney <jasonr@gnu.org> + + * w32term.c (w32_handle_tool_bar_click): Detect up and down events + correctly. Do not pass up_modifier to keyboard buffer. + + * w32fns.c [HAVE_IMAGES, HAVE_PBM]: Remove conditionals. + +2002-03-22 Stefan Monnier <monnier@cs.yale.edu> + + * Makefile.in (bootstrapclean): New target. + (bootstrap-temacs, bootstrap-doc): Remove. + (bootstrap-emacs): Use a bog-standard `temacs'. + Don't bother to build a DOC file. + + * sysdep.c (wait_for_termination): Use sigsuspend rather than sigpause. + + * emacs.c (main): Handle --unibyte, --multibyte, and --no-loadup + in temacs even if !CANNOT_DUMP. + (standard_args): Keep --no-loadup even if !CANNOT_DUMP. + + * alloc.c (check_pure_size): Only output a warning. + +2002-03-22 Jason Rumney <jasonr@gnu.org> + + * w32fns.c (Fx_create_frame): Enable tool-bar when images are + supported. + + * w32term.c (zv_bits): Declare as short, for word alignment. + (w32_read_socket) <WM_XBUTTONUP>: Fix last change. + (syms_of_w32term): Define x-use-underline-position-properties. + + * w32fns.c (x_set_cursor_color): Set cursor_gc as well. + (clear_image_cache): Block input, fix logic, clear matrices in + all frames that share this cache. + +2002-03-22 Eli Zaretskii <eliz@is.elta.co.il> + + * emacs.c (main): Update the Copyright year in the blurb printed + by "emacs --version". + + * xdisp.c (message_with_string): Fix syntax of a call to GCPRO2. + + * xterm.c (XTread_socket): If XK_ISO_Lock and + XK_ISO_Last_Group_Lock are defined, handle keysyms between + XK_ISO_Lock and XK_ISO_Last_Group_Lock similarly to Mode_switch. + +2002-03-21 Kim F. Storm <storm@cua.dk> + + * keyboard.c (menu_bar_items): Mostly undo 2002-02-20 patch, so + menu-bar bindings in keymap and local-map properties _are_ used. + But try keymap property first in accordance with 2002-01-03 patch. + Added comment describing why this is not always reliable. + (tool_bar_items): Ditto for tool-bar. + +2002-03-21 Jason Rumney <jasonr@gnu.org> + + * w32fns.c (x_clear_image_1): Disable color table code. + +2002-03-21 Kim F. Storm <storm@cua.dk> + + * lisp.h (DEFUN) [USE_NONANSI_DEFUN]: The 2001-10-17 patch + removed the wrong version of the DEFUN macro; fixed it. + + * fns.c (Ffeaturep): Allow subfeature to be a list (test using + Fmember rather than Fmemq). + (Fprovide): Check that subfeatures is a list. + + * process.c (QCfeature, QCdatagram): Removed variables. + (QCtype, Qdatagram): New variables. + (network_process_featurep): Removed function. + (Fmake_network_process): Removed :feature check. + Use :type 'datagram instead of :datagram t to create a datagram + socket. This allows us to add other connection types (e.g. raw + sockets) later in a consistent manner. + (init_process) [subprocess, HAVE_SOCKETS]: Provide list of + supported subfeatures for feature make-network-process. + (syms_of_process) [subprocess]: Remove QCfeature and QCdatagram. + Intern and staticpro QCtype and Qdatagram. + (syms_of_process) [!subprocess]: Intern and staticpro QCtype. + + * xfns.c (QCtype): Remove duplicate declaration and + initialization (is now declared in process.c). + + * w32fns.c (QCtype): Remove duplicate declaration and + initialization (is now declared in process.c). + +2002-03-21 Richard M. Stallman <rms@gnu.org> + + * regex.c (DISCARD_FAILURE_REG_OR_COUNT): New macro. + (CHECK_INFINITE_LOOP): Use DISCARD_FAILURE_REG_OR_COUNT + when jumping to `fail' to avoid undoing reg changes in the + last iteration of the loop. + (GET_UNSIGNED_NUMBER): Skip spaces around the number. + + * Makefile.in (dispnew.o, sysdep.o, xdisp.o, xselect.o, alloc.o): + Depend on process.h. + +2002-03-20 Jason Rumney <jasonr@gnu.org> + + Most of the following changes are still conditional on HAVE_IMAGES + which is not set by default on Windows. + + * emacs.c (main) [WINDOWSNT]: Call init_xfns. + + * w32fns.c (x_set_cursor_color): Set foreground of cursor, not frame. + (Fimage_size, Fimage_mask_p, XPutPixel): New functions. + (four_corners_best, x_clear_image_1, x_clear_image) + (x_alloc_image_color, postprocess_image) + (x_create_x_image_and_pixmap, x_destroy_x_image, xbm_load_image) + (x_from_x_colors, x_disable_image, pbm_load): Adapt for Windows. + (init_xfns, syms_of_w32fns): Initialize image functions and constants. + + * w32gui.h (struct XImage): Define. + + * w32term.c (w32_read_socket) <WM_XBUTTONUP>: Use XFASTINT to + extract mouse co-ordinates. + +2002-03-20 Jason Rumney <jasonr@gnu.org> + + * w32.c (init_winsock): Dynamically load new server and UDP + socket functions. + (socket_to_fd): New function. + (sys_socket): Use it. + (sys_setsockopt, sys_listen, sys_getsockname, sys_accept) + (sys_recvfrom, sys_sendto): New wrapper functions. + + * process.c (QCfamily, QCfilter): Remove duplicate declaration + and initialization. + + * makefile.w32-in (LIBS): Remove $(WSOCK32). + +2002-03-20 Eli Zaretskii <eliz@is.elta.co.il> + + * process.c (conv_sockaddr_to_lisp, conv_lisp_to_sockaddr): + Don't use "sun" as a variable, it's a predefined constant on Sun + machines. + +2002-03-20 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * bytecode.c (Fbyte_code): Revert last change. + +2002-03-19 Kim F. Storm <storm@cua.dk> + + * makefile.w32-in (LIBS): Add $(WSOCK32). + From David Ponce <dponce@voila.fr>. + +2002-03-18 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * process.c (wait_reading_process_input): Move variables `pname' + and `pnamelen' down where they are used. + + * bytecode.c (Fbyte_code): Discard unused computed value to + prevent gcc warning. + + * lisp.h (Fplist_member): Add prototype. + +2002-03-18 Kim F. Storm <storm@cua.dk> + + * config.in: Add HAVE_SENDTO, HAVE_RECVFROM, HAVE_SETSOCKOPT, + HAVE_GETSOCKOPT, HAVE_GETPEERNAME, HAVE_GETSOCKNAME, and HAVE_SYS_UN_H. + + * process.c: Define HAVE_LOCAL_SOCKETS based on HAVE_SYS_UN_H. + Remove explicit GNU_LINUX settings for datagram support. + +2002-03-18 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * process.c (Fmake_network_process): Remove unused variable `sa'. + Doc fix. Add usage:. + (set_socket_options): Remove unused variables `optnum' and `opttype'. + +2002-03-17 Richard M. Stallman <rms@gnu.org> + + * xdisp.c (cursor_type_changed): New variable. + (redisplay_internal): Redisplay all windows if cursor_type_changed. + Clear it when clearing windows_or_buffers_changed. + (try_cursor_movement, redisplay_window, try_window_id) + (try_window_reusing_current_matrix): Test cursor_type_changed + along with windows_or_buffers_changed. + + * window.h (cursor_type_changed): New variable. + + * xfns.c (x_set_cursor_type): Set cursor_type_changed, + not update_mode_lines, and always set it to 1. + + * xdisp.c (clear_garbaged_frames): Don't set windows_or_buffers_changed + if no frames needed redrawing. + +2002-03-17 Kim F. Storm <storm@cua.dk> + + The following changes add support for network server processes, + datagram connections, and local (unix) sockets. + + * process.h (struct Lisp_Process): New member log. + Doc fix: Member command used to indicate stopped network process. + Doc fix: Member childp contains plist for network process. + Doc fix: Member kill_without_query is inverse of query-on-exit flag. + + * process.c (Qlocal, QCname, QCbuffer, QChost, QCservice, QCfamily) + (QClocal, QCremote, QCserver, QCdatagram, QCnowait, QCnoquery, QCstop) + (QCcoding, QCoptions, QCfilter, QCsentinel, QClog, QCfeature): New + variables. + (NETCONN1_P): New macro. + (DATAGRAM_SOCKETS): New conditional symbol. + (datagram_address): New array. + (DATAGRAM_CONN_P, DATAGRAM_CHAN_P): New macros. + (status_message): Use concat3. + (Fprocess_status): Add `listen' status to doc string. Return + `stop' for a stopped network process. + (Fset_process_buffer): Update contact plist for network process. + (Fset_process_filter): Ditto. Don't enable input for stopped + network processes. Server must listen, even if filter is t. + (Fset_process_query_on_exit_flag, Fprocess_query_on_exit_flag): + New functions. + (Fprocess_kill_without_query): Removed. Now defined in simple.el. + (Fprocess_contact): Added KEY argument. Handle datagrams. + (list_processes_1): Optionally show only processes with the query + on exit flag set. Dynamically adjust column widths. Omit tty + column if not needed. Report stopped network processes. Identify + server and datagram network processes. + (Flist_processes): New optional arg `query-only'. + (conv_sockaddr_to_lisp, get_lisp_to_sockaddr_size) + (conv_lisp_to_sockaddr, set_socket_options) + (network_process_featurep, unwind_request_sigio): New helper + functions. + (Fprocess_datagram_address, Fset_process_datagram_address): + (Fset_network_process_options): New lisp functions. + (Fopen_network_stream): Removed. Now defined in simple.el. + (Fmake_network_process): New lisp function. Code is based on + previous Fopen_network_stream, but heavily reworked with new + property list based argument list, support for datagrams, server + processes, and local sockets in addition to old client-only + functionality. + (server_accept_connection): New function. + (wait_reading_process_input): Use it to handle incoming connects. + Do not enable input on a new connection if process is stopped. + (read_process_output): Handle datagram sockets. Use 2k buffer for + them. + (send_process): Handle datagram sockets. + (Fstop_process, Fcontinue_process): Apply to network processes. A + stopped network process is indicated by setting command field to t. + (Fprocess_send_eof): No-op if datagram connection. + (Fstatus_notify): Don't read input for a stream server socket or a + stopped network process. + (init_process): Initialize datagram_address array. + (syms_of_process): Intern and staticpro new variables, defsubr new + functions. + +2002-03-16 Jason Rumney <jasonr@gnu.org> + + * w32fns.c (w32_to_all_x_charsets): Return correct type in + startup case. + +2002-03-16 Richard M. Stallman <rms@gnu.org> + + * xdisp.c (redisplay_internal, redisplay_windows): + Use list_of_error to call internal_condition_case_1. + (safe_eval, safe_call): Pass Qt to internal_condition_case_{1,2} + so as to catch all errors with no possibility of debugger redisplay. + (list_of_error): New variable. + (syms_of_xdisp): Init and staticpro it. + + * print.c (print_object): Delete `\ ' from printed rep of frame. + +2002-03-15 Eli Zaretskii <eliz@is.elta.co.il> + + * msdos.c (dos_rawgetc): Disable the x-autoselect-window feature, + until its implementation is fixed. + +2002-03-14 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * xfns.c (png_load): Remove unused variable `gamma_str'. + +2002-03-14 Richard M. Stallman <rms@gnu.org> + + * xfns.c (x_real_positions): Handle failure in XQueryTree. + +2002-03-14 Miles Bader <miles@gnu.org> + + * intervals.c (adjust_for_invis_intang): New function. + (set_point_both): Use `adjust_for_invis_intang' to do most of the + work for dealing with invisible+intangible regions. Do so before + and after both forward and backward movements, to handle both + front-sticky and rear-sticky cases. + * textprop.c (text_property_stickiness): Function moved here from + `editfns.c'. + * intervals.h (text_property_stickiness): New declaration. + * editfns.c (char_property_eq): Function removed. + (text_property_stickiness): Function moved to `textprop.c'. + +2002-03-13 Jason Rumney <jasonr@gnu.org> + + * config.in: Add STRFTIME_NO_POSIX2. + + * strftime.c (my_strftime) [STRFTIME_NO_POSIX2]: Handle %h, %EX + and %OX when underlying strftime does not. + +2002-03-13 Stefan Monnier <monnier@cs.yale.edu> + + * xterm.c (x_set_toolkit_scroll_bar_thumb) <USE_MOTIF>: + Use a fixed-size thumb (based on an ad-hoc estimate of 30 chars per + line) to avoid annoying flicker. + (xm_scroll_callback): Get rid of the now unnecessary kludge. + (XTread_socket): Mark it static. + + * xdisp.c (display_mode_element): Fix int/Lisp_Object mixup. + +2002-03-13 Kim F. Storm <storm@cua.dk> + + * puresize.h (BASE_PURESIZE): Increase to 775000. + +2002-03-12 Juanma Barranquero <lektu@terra.es> + + * editfns.c (syms_of_editfns): Fix typo. + +2002-03-12 Gerd Moellmann <gerd@gnu.org> + + * xsmfns.c: Include stdio.h because termhooks.h needs it. + Include termopt.h for interrupt_input. + +2002-03-11 Andreas Schwab <schwab@suse.de> + + * coding.c (syms_of_coding) <file-coding-system-alist>: Doc fix. + +2002-03-11 Gerd Moellmann <gerd@gnu.org> + + * xterm.c (note_mouse_movement): Put code for + x_autoselect_window_p in #if 0. + + * lread.c (Fload): Don't assume that message_with_string uses the + string it is given like a C string. + +2002-03-10 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.h (x_session_check_input, x_session_initialize): Declare. + + * xterm.c (XTread_socket): Add call to x_session_check_input and + x_session_have_connection. + (x_initialize): Add call to x_session_initialize. + + * termhooks.h (enum event_kind): Add save_session_event. + + * keyboard.c: Add Emacs event save_session_event. + + * emacs.c (main): Add call to syms_of_xsmfns. + + * lisp.h (syms_of_xsmfns): Declare extern. + + * config.in: Add HAVE_X_SM. + + * Makefile.in (LIBXT): Add -lSM -lICE + if HAVE_X_SM and not USE_X_TOOLKIT. + (XOBJ): New file xsmfns.c added. + + * xsmfns.c: New file for X session management. + +2002-03-09 Jason Rumney <jasonr@gnu.org> + + * fileio.c (Fcopy_file) [WINDOWS_NT]: Ensure file is not + read-only when setting modified time. + +2002-03-08 Gerd Moellmann <gerd@gnu.org> + + * xdisp.c (move_it_vertically_backward): At the end of the function, + when moving forward by lines, treat terminal frames specially. + + * keyboard.c (echo_char): Make sure to add a separator between + keys even if echo_dash hasn't been called. + + * xdisp.c: Use new string macros. + (update_echo_area): Pass number of bytes to message3 instead of + number of chars. + (set_message_1): Don't access a string's size_byte directly. + (decode_mode_spec_coding): Use number of bytes of eoltype string + instead number of chars. + + * lisp.h (SREF, SDATA, SCHARS, SBYTES, SMBP): New macros. + +2002-03-08 Juanma Barranquero <lektu@terra.es> + + * w32fns.c (Fx_display_color_cells): Force 24+ bit color depths to + 24-bit. + +2002-03-06 Jason Rumney <jasonr@gnu.org> + + * w32term.c (x_draw_hollow_cursor): Draw same size as block cursor. + +2002-03-06 Gerd Moellmann <gerd@gnu.org> + + * keyboard.c (echo_prompt, echo_char, echo_dash, echo_now) + (cancel_echoing, echo_length, echo_truncate): Changed to + work with new kboard definition. + (echo_now): Use message3_nolog instead of message2_nolog. + + * alloc.c (mark_kboards): Mark echo_string. + + * keyboard.h (ECHOBUFSIZE): Removed. + (struct kboard): Member echoptr removed, member echobuf renamed + to echo_string. + + * xdisp.c (message_with_string): Use Fformat instead of doprnt and + message3 instead of message2 to display the message using STRING's + text properties. + +2002-03-05 Andreas Schwab <schwab@suse.de> + + * xdisp.c (hscroll_margin): Change to EMACS_INT. + +2002-03-05 Per Abrahamsen <abraham@dina.kvl.dk> + + * frame.c (default-frame-alist): Explain that setting it doesn't + affect existing frames. + +2002-03-05 Stefan Monnier <monnier@cs.yale.edu> + + * indent.c (skip_invisible): Fix my brain fart. + + * dispnew.c (sit_for): Don't wait if executing a kbd macro. + +2002-03-04 Stefan Monnier <monnier@cs.yale.edu> + + * dosfns.c, dosfns.h, dispnew.c, dispextern.h, commands.h, charset.c, + * alloc.c, abbrev.c, emacs.c, eval.c, keyboard.c, keyboard.h, + * lisp.h, lread.c, sysdep.c, termcap.c, termchar.h, w32term.c, + * window.c, xdisp.c, xselect.c, xterm.c: Change defvar_int definition + and variables to use EMACS_INT instead of just int. + + * buffer.c (syms_of_buffer): Allow non-string `mode-name'. + +2002-03-04 Eli Zaretskii <eliz@is.elta.co.il> + + * sysdep.c (sys_subshell) [MSDOS]: If PWD is set in the + environment, pass it down with corrected value. + +2002-03-04 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * lread.c (read_filtered_event): Do not call start_hourglass + before returning. + +2002-03-04 Juanma Barranquero <lektu@terra.es> + + * w32term.c (x_display_and_set_cursor): Fix typo. + +2002-03-03 Richard M. Stallman <rms@gnu.org> + + * fileio.c (Fmake_temp_name): Doc fix. + +2002-03-03 Gary Wong <gtw@gnu.org> + + * termcap.c [!emacs]: Replace ospeed for building standalone + libtermcap, for binary compatibility. + + * tparam.c [!emacs]: Move #define of bcopy to after string.h. + +2002-03-03 Richard M. Stallman <rms@gnu.org> + + * xrdb.c (file_p): Rename arg `path' to `filename'. + + * abbrev.c (Fexpand_abbrev): Increment plist as use count + only if it is an integer. + + * xfns.c (png_load): Set screen_gamma based on f->gamma. + If png_get_sRGB gives an answer, call png_set_gamma + using the default image gamma value. + + * lread.c (read1): When reading from a file, default string to + multibyte only if it has some multibyte characters. + + * print.c (print_object): Output multibyte chars 128...255 + using \x even if ! print_escape_multibyte. + + * xdisp.c (display_mode_element): Move the places where + bytepos, charpos, this, and lisp_string are set. + Use lisp_string to set bytepos. + + * xdisp.c (redisplay_internal): + Call clear_image_cache only if HAVE_WINDOW_SYSTEM. + + * xdisp.c (display_mode_element): Merge properties specified with + :propertize onto those that come with the string. + +2002-03-03 Eli Zaretskii <eliz@is.elta.co.il> + + * xdisp.c (syms_of_xdisp) <auto-hscroll-mode>: Renamed from + automatic-hscrolling. Users changed. + <hscroll-margin>: Renamed from automatic-hscroll-margin. + Users changed. + <hscroll-step>: Renamed from automatic-hscroll-step. Users changed. + +2002-03-02 Eli Zaretskii <eliz@is.elta.co.il> + + * buffer.c (syms_of_buffer) <buffer-file-coding-system>: Doc fix. + +2002-03-02 Kim F. Storm <storm@cua.dk> + + * window.c (Fminibuffer_selected_window): New function. + (syms_of_window): Defsubr it. + +2002-03-01 Kim F. Storm <storm@cua.dk> + + * window.h (struct window): New member phys_cursor_width. + + * window.c (make_window, replace_window): Init phys_cursor_width. + + * xterm.c (x_display_and_set_cursor): Blink box cursor using + hollow box cursor. Blink bar cursor using 1 pixel wide bar. + + * w32term.c (x_display_and_set_cursor): Blink box cursor using + hollow box cursor. Blink bar cursor using 1 pixel wide bar. + + * lisp.h (GCPRO6): New macro. + + * process.c (Fopen_network_stream): Use GCPRO6. + +2002-03-01 Kim F. Storm <storm@cua.dk> + + * process.c (Qconnect, Qfailed): New variables. + (syms_of_process): Intern and staticpro them. + (Fprocess_status): Document connect and failed return values. + [NON_BLOCKING_CONNECT]: New conditional. + (connect_wait_mask, num_pending_connects): New variables. + (status_message): Convert Qfailed status. + (Fopen_network_stream): Added support for non-blocking connect. + New optional args: filter, sentinel, non_blocking. Doc updated. + [HAVE_GETADDRINFO, !HAVE_GETADDRINFO]: Merged common code. + (deactivate_process): Handle pending non-blocking connect. + (wait_reading_process_input): Poll for status of non-blocking + connects. Exec sentinel directly when connect succeeds. + (status_notify): Don't read process output if not yet connected. + +2002-02-28 Kim F. Storm <storm@cua.dk> + + * window.c (minibuf_selected_window): Renamed from + Vminibuf_selected_window. Users changed. + (syms_of_window): Staticpro it. + +2002-02-26 Kim F. Storm <storm@cua.dk> + + The following changes add a new Vminibuf_selected_window variable + which is similar to Vminibuf_scroll_window, but which is only set + on entry to the minibuffer (from a non-minibuffer window): + + * window.c (Vminibuf_selected_window): New variable. + (struct save_window_data): New member minibuf_selected_window. + (Fset_window_configuration): Restore Vminibuf_selected_window. + (Fcurrent_window_configuration): Save Vminibuf_selected_window. + Set minibuf_scroll_window member to nil if minibuf_level is 0. + (compare_window_configurations): Compare minibuf_selected_window. + + * window.h (Vminibuf_selected_window): Declare extern. + + * minibuf.c (read_minibuf): Set Vminibuf_selected_window on first + entry to minibuffer or on entry from a non-minibuffer window. + + * dispextern.h (CURRENT_MODE_LINE_FACE_ID_3): Compare with + Vminibuf_selected_window instead of Vminibuf_scroll_window. + + * xdisp.c (init_iterator): Compare with Vminibuf_selected_window + instead of Vminibuf_scroll_window when deciding in which window + the region should be highlighted. Consequently, the region remains + highlighteded even when a completion buffer is also displayed. + +2002-02-26 Eli Zaretskii <eliz@is.elta.co.il> + + * fileio.c (Fsubstitute_in_file_name): Fix the change from 2002-02-08. + + * xselect.c (Qcompound_text_with_extensions): Renamed from + Qcompound_text_no_extensions. + (lisp_data_to_selection_data, syms_of_xselect): Use the new name. + +2002-02-26 Juanma Barranquero <lektu@terra.es> + + * w32proc.c (syms_of_ntproc): Doc fix. + +2002-02-24 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * intervals.h: Include "dispextern.h" unconditionally. + +2002-02-24 Jason Rumney <jasonr@gnu.org> + + * Makefile.in (WINNT_SUPPORT) [WINDOWSNT]: Add w32-vars.elc + and disp-table.elc. + (lisp): Add emacs-lisp/backquote.elc. + +2002-02-24 Kim F. Storm <storm@cua.dk> + + * keymap.c (Flookup_key): Fix problem in 2001-12-28 patch: + The validation of the event type was too strict as it didn't + allow string events; buffer names are used in bindings for + menu-bar-select-buffer (see `menu-bar-update-buffers'). + +2002-02-23 Kim F. Storm <storm@cua.dk> + + The following changes rework my patch of 2002-02-06 which + added command remapping by entering the commands directly into + the keymaps. Now, command remapping uses an explicit `remap' + prefix in the keymaps, i.e. [remap COMMAND]. + + * keymap.c (Qremap, remap_command_vector): New variables. + (is_command_symbol): Remove function. + (Fdefine_key): No longer accept a symbol for KEY. + Added validation of [remap COMMAND] argument for KEY. + The DEF is no longer required to be a symbol when remapping a command. + (Fremap_command): New function to remap command through keymaps. + (Flookup_key): Perform command remapping initiated by + Fremap_command directly for speed. + (Fkey_binding): Use Fremap_command for command remapping. + (where_is_internal): Handle new command remapping representation. + (syms_of_keymap): Intern Qremap, initialize remap_command_vector, + staticpro them. Defsubr Fremap_command. + + * keymap.h (Fremap_command): Declare extern. + (is_command_symbol): Remove extern. + + * keyboard.c (command_loop_1): Use Fremap_command for command + remapping; now try command remapping for all symbols. + +2002-02-23 Eli Zaretskii <eliz@is.elta.co.il> + + * coding.h (run_pre_post_conversion_on_str): Add prototype. + +2002-02-23 Jason Rumney <jasonr@gnu.org> + + * w32select.c (Fw32_set_clipboard_data): Run pre-write-conversion + on the string before encoding it. + (Fw32_get_clipboard_data): Run post-read-conversion on the string + after decoding it. + + * w32fns.c (w32_wnd_proc) <WM_TIMER>: Fix last change. + +2002-02-23 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * w32term.c (enter_timestamp): Remove unused static variable to + prevent warning. + + * xterm.c (enter_timestamp): Put in #if 0 to prevent warning. + +2002-02-23 Eli Zaretskii <eliz@is.elta.co.il> + + * w16select.c (Fw16_get_clipboard_data): Fix last change. + + * xselect.c (selection_data_to_lisp_data): Fix last change. + +2002-02-22 Jason Rumney <jasonr@gnu.org> + + * w32term.h (struct w32_output): New member menu_command_in_progress. + + * w32menu.c (menubar_selection_callback): Free the menu and + clear the menu_command_in_progress flag. + + * w32fns.c (mouse_move_timer, mouse_button_timer): Initialize. + (menu_free_timer): New variable. + (MENU_FREE_ID, MENU_FREE_DELAY): New constants. + (w32_wnd_proc) <WM_TIMER>: Handle menu_free_timer. + <WM_EXITMENULOOP>: Delay before freeing menu. Do nothing if a + menu command is in progress. + <WM_COMMAND>: Set the menu_command_in_progress flag. + Kill any menu_free_timer that is running. + + * w32term.c (w32_text_out): Renamed from W32_TEXTOUT. + Call ExtTextOutA rather than ExtTextOut. + +2002-02-22 Eli Zaretskii <eliz@gnu.org> + + * puresize.h (BASE_PURESIZE): Increase to 755000. + +2002-02-22 Eli Zaretskii <eliz@is.elta.co.il> + + * w16select.c (Fw16_set_clipboard_data): Run pre-write-conversion + on the string before encoding it. + (Fw16_get_clipboard_data): Run post-read-conversion on the string + after decoding it. + +2002-02-22 Eli Zaretskii <eliz@is.elta.co.il> + + Support for ICCCM Extended Segments in X selections: + + * xselect.c <Qcompound_text_no_extensions>: New variable. + (syms_of_xselect): Intern and staticpro it. + (selection_data_to_lisp_data): Run post-read-conversion on decoded + selection text. + (lisp_data_to_selection_data): If next-selection-coding-system is + compound-text-no-extensions, set the type of selection to be + compound-text. + + * xterm.h (x_encode_text): Update prototype. + + * xfns.c (x_encode_text): Accept additional arg SELECTIONP; all + callers changed. If SELECTIONP is non-zero, run the + pre-write-conversion function before encoding the selection text. + +2002-02-21 Kim F. Storm <storm@cua.dk> + + * frame.c (syms_of_frame): Change mouse-highlight default to t. + + * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]: + Correct composing of language-change event. + +2002-02-20 Kim F. Storm <storm@cua.dk> + + * keyboard.c (menu_bar_items): Don't include keymap or local-map + bindings at PT when building menu (the menu is not updated often + enough for this to work reliable). + (tool_bar_items): Likewise. + (current_active_maps): Removed unused (and buggy) function. + +2002-02-20 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * xfns.c (gif_load): Use correct width and height for GIF images. + +2002-02-19 Eli Zaretskii <eliz@is.elta.co.il> + + * floatfns.c (Fatan): Accept an optional second arg and call + atan2 if passed 2 args. + +2002-02-18 Jason Rumney <jasonr@gnu.org> + + * w32term.c (glyph_rect): Determine the row and glyph more precisely. + +2002-02-17 Jason Rumney <jasonr@gnu.org> + + * w32term.c (x_autoselect_window_p): New variable. + (syms_of_w32term): DEFVAR_BOOL and initialize it. + (note_mouse_movement): Use it. + + * w32fns.c (w32_load_system_font): Never set fonts_changed_p to zero. + + * w32bdf.c (w32_load_bdf_font): Maybe set fonts_changed_p. + + * w32fns.c (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): + New variables. + (syms_of_w32fns): Intern and staticpro them. + (x_frame_parms) <"fullscreen">: New parameter. + (x_fullscreen_move, x_set_fullscreen): New functions. + (x_set_frame_parameters): Support Qfullscreen. + (x_real_positions): Save x/y_pixels_diff frame params. + (x_figure_window_size): Support full-screen frames. + (Fx_create_frame): Default the fullscreen parameter. + + * w32term.c (x_check_fullscreen, x_check_fullscreen_move) + (x_fullscreen_adjust): New functions. + (w32_read_socket) <WM_WINDOWPOSCHANGED>: Don't resize to + fullscreen. Call x_check_fullscreen_move, and set the + want_fullscreen member of output_data.w32 + <WM_ACTIVATE, WM_ACTIVATEAPP>: Call x_check_fullscreen. + + * w32term.h: New enum for FULLSCREEN_* constants. + (struct w32_output): New members want_fullscreen, x_pixels_diff, + y_pixels_diff, x_pixels_outer_diff, and y_pixels_outer_diff. + (x-fullscreen-adjust): New prototype. + +2002-02-17 Kim F. Storm <storm@cua.dk> + + * frame.c (Vmouse_highlight): New variable. + (syms_of_frame): DEFVAR_LISP it. + + * frame.h (Vmouse_highlight): Declare extern. + + * xterm.h (struct x_display_info): Add mouse_face_hidden. + + * xterm.c (disable_mouse_highlight): Removed variable. + (note_mouse_highlight): Don't highlight if Vmouse_highlight is nil. + (show_mouse_face): Don't show highlight if mouse_face_hidden is set. + (XTread_socket): Turn mouse_face_hidden off after mouse movement, + and on after keyboard input. + (x_term_init): Initialize mouse_face_hidden. + + * msdos.h (struct display_info): Add mouse_face_hidden. + + * msdos.c (disable_mouse_highlight): Removed variable. + (show_mouse_face): Don't show highlight if mouse_face_hidden is set. + (IT_note_mouse_highlight): Don't highlight if Vmouse_highlight is nil. + (internal_terminal_init): Initialize mouse_face_hidden. + (dos_rawgetc): Turn mouse_face_hidden off after mouse movement, + and on after keyboard input. + + * w32term.h (struct w32_display_info): Add mouse_face_hidden. + + * w32term.c (disable_mouse_highlight): Removed variable. + (note_mouse_highlight): Disable highlight if Vmouse_highlight is nil. + (show_mouse_face): Don't show highlight if mouse_face_hidden is set. + (w32_read_socket): Turn mouse_face_hidden off after mouse movement, + and on after keyboard input. + (w32_initialize_display_info): Initialize mouse_face_hidden. + +2002-02-16 Eli Zaretskii <eliz@is.elta.co.il> + + * msdos.c (last_mouse_window): New variable. + (dos_rawgetc): Fix last change--if the mouse is in the same window + as recorded in last_mouse_window, don't select this window. + + * Makefile.in (lisp, shortlisp): Use cus-start.elc, not cus-start.el. + + * msdos.c (x_autoselect_window_p): New variable. + (syms_of_msdos): Defvar it. + (dos_rawgetc): If x_autoselect_window_p is set, select the window in + which the last mouse movement occured, unless it is already selected. + + * xdisp.c (automatic_hscroll_margin, Vautomatic_hscroll_step): + New variables. + (syms_of_xdisp): DEVFAR them. + (hscroll_window_tree): Use automatic_hscroll_margin and + Vautomatic_hscroll_step to compute the amount of window scrolling. + +2002-02-16 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * xterm.c (x-autoselect-window): New variable. + (note_mouse_movement): Use it. + + * keyboard.c: Do not include "systime.h" twice. + +2002-02-15 Andreas Schwab <schwab@suse.de> + + * puresize.h (PURESIZE_RATIO): Increase to 9/5. + + * alloc.c (NSTATICS): Increase to 1280. + +2002-02-15 Kai Gro,A_(Bjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> + + * alloc.c (NSTATICS): Bump to 1026. + + * xterm.c (Vx_alt_keysym, Vx_hyper_keysym, Vx_meta_keysym) + (Vx_super_keysym): New variables. + (syms_of_xterm): DEFVAR_LISP them. + (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Use the + variables to determine which keys to use for the various modifiers. + +2002-02-13 Kim F. Storm <storm@cua.dk> + + * window.c (Vmode_line_in_non_selected_windows): Removed. + (mode_line_in_non_selected_windows): New variable. + (syms_of_window): DEFVAR_BOOL it. + + * dispextern.h (CURRENT_MODE_LINE_FACE_ID_3): + Use mode_line_in_non_selected_windows. + (mode_line_in_non_selected_windows): Declare extern. + (Vmode_line_in_non_selected_windows): Removed extern. + +2002-02-13 Richard M. Stallman <rms@gnu.org> + + * keyboard.c (Fthis_command_keys, Fthis_command_keys_vector) + (Fthis_single_command_keys, Fthis_single_command_raw_keys) + (Fclear_this_command_keys): Doc fixes. + + * xfaces.c (Finternal_make_lisp_face, Finternal_copy_lisp_face) + (update_face_from_frame_parameter): Increment face_change_count + and windows_or_buffers_changed to force redisplay using changed faces. + + * xdisp.c (QCpropertize): New variable. + (mode_line_proptrans_alist): New variable. + (display_mode_element): New arg PROPS; all calls changed. + Implement this, for strings. + Handle literal output of strings by sharing the + main-line code for strings, using local var `literal'. + Handle :propertize feature. + (syms_of_xdisp): Initialze and staticpro QCpropertize and + mode_line_proptrans_alist. + +2002-02-11 Kim F. Storm <storm@cua.dk> + + * window.c (Vmode_line_in_non_selected_windows): New variable. + (syms_of_window): DEFVAR_LISP it. + + * dispextern.h (CURRENT_MODE_LINE_FACE_ID_3): New macro. + (CURRENT_MODE_LINE_FACE_ID): Use it. + (Vmode_line_in_non_selected_windows): Declare extern. + + * xdisp.c (display_mode_lines): Use CURRENT_MODE_LINE_FACE_ID_3 + to get mode line face. + +2002-02-11 Eli Zaretskii <eliz@is.elta.co.il> + + * msdos.c (Vx_bitmap_file_path, x_stretch_cursor_p): Remove these + variables; cus-start.el doesn't need them anymore. + +2002-02-09 Kim F. Storm <storm@cua.dk> + + * insdel.c (make_gap_smaller): Preserve BEG_UNCHANGED during gap + reduction. This fixes a display problem where stray newlines were + inserted in the window (corrected by C-l). Clarified code (IMHO). + +2002-02-09 Eli Zaretskii <eliz@is.elta.co.il> + + * dispextern.h (CURRENT_MODE_LINE_FACE_ID): Fix last change. + + * xdisp.c (display_mode_lines): Fix last change. + +2002-02-09 Jason Rumney <jasonr@gnu.org> + + * w32fns.c (enum_font_cb2): Don't let charsets unknown to Windows + match each other. + (w32_load_system_font): Prevent Cleartype fonts from loading. + (Fx_show_tip): Ensure tip frames are above other topmost windows. + +2002-02-09 Kim F. Storm <storm@cua.dk> + + * dispextern.h (CURRENT_MODE_LINE_FACE_ID): New macro. + (CURRENT_MODE_LINE_HEIGHT): Use it. + (enum face_id): Add MODE_LINE_INACTIVE_FACE_ID. + + * xdisp.c (window_box_height): Use CURRENT_MODE_LINE_FACE_ID. + (pos_visible_p, handle_face_prop): Likewise. + (display_mode_lines): Likewise, but for the real selected window. + (init_iterator) [row == NULL]: Handle MODE_LINE_INACTIVE_FACE_ID. + + * xfaces.c (Qmode_line_inactive): New face variable for mode-line + in non-selected windows. + (realize_basic_faces): Realize it. + (syms_of_term): Intern and staticpro it. + +2002-02-08 Kim F. Storm <storm@cua.dk> + + * alloc.c (SETJMP_WILL_LIKELY_WORK, SETJMP_WILL_NOT_WORK): + Changed mail addresses to emacs-devel@gnu.org. + +2002-02-08 Eli Zaretskii <eliz@is.elta.co.il> + + * fileio.c (Fsubstitute_in_file_name): If the file name includes + ~user, and there's no such user, don't discard everything before ~user. + + * floatfns.c (Fround): Doc fix. + +2002-02-08 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * sysdep.c (init_system_name): Put unused variable `p' in #if 0. + +2002-02-07 Stefan Monnier <monnier@cs.yale.edu> + + * lisp.h (Fx_file_dialog): Add extern decl (used in fileio.c). + +2002-02-07 Kim F. Storm <storm@cua.dk> + + * keymap.c (where_is_internal): Only check whether definition is + remapped if it fulfills is_command_symbol. + +2002-02-07 Andreas Schwab <schwab@suse.de> + + * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT): Define to 2 for m68k. + + * alloc.c (mark_stack): Don't assume sizeof (Lisp_Object) is 4. + +2002-02-06 Kim F. Storm <storm@cua.dk> + + * keymap.c (Fdefine_key): Allow symbol as KEY argument for + defining command remapping. Doc updated. + (Flookup_key): Remap command through keymap if KEY is a symbol. + (is_command_symbol): New function. + (Fkey_binding): Use it. New optional argument NO-REMAP. + Doc updated. Callers changed. Perform command remapping via + recursive call unless that arg is non-nil. + (where_is_internal): New argument no_remap. Callers changed. + Call recursively to find original key bindings for a remapped + comand unless that arg is non-nil. + (Fwhere_is_internal): New optional argument NO-REMAP. + Doc updated. Callers changed. Pass arg to where_is_internal. + + * keymap.h (Fkey_binding, Fwhere_is_internal): Update prototype. + (is_command_symbol): Add prototype. + + * keyboard.c (Vthis_original_command): New variable. + (syms_of_keyboard): DEFVAR_LISP it. + (command_loop_1): Set it, and perform command remapping. + +2002-02-06 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * keyboard.c (recursive_edit_1): Call cancel_hourglass unconditionally. + +2002-02-06 Jason Rumney <jasonr@gnu.org> + + * w32term.c (w32_native_per_char_metric): Disable 2002-01-20 change. + +2002-02-06 Eli Zaretskii <eliz@is.elta.co.il> + + * charset.c (get_charset_id): Use if-else instead of ?:. + +2002-02-06 Richard M. Stallman <rms@gnu.org> + + * filelock.c (S_ISLNK): Define if not defined. + +2002-02-03 Richard M. Stallman <rms@gnu.org> + + * fileio.c (Fdo_auto_save): Improve "auto save disabled" msg. + + * lread.c (read1): Redesign strategy for force_multibyte and + force_singlebyte. Now is_multibyte records whether read_buffer + is multibyte. Encountering any multibyte character makes it so. + +2002-02-02 Stefan Monnier <monnier@cs.yale.edu> + + * term.c (term_get_fkeys_1): If `k0' and `k;' are both specified and + with the same sequence, map that sequence to f10 rather than f0. + +2002-02-03 Andreas Schwab <schwab@suse.de> + + * s/gnu-linux.h: Check for __mc68000__ instead of __m68k__, the + latter never being defined on GNU/Linux. + +2002-02-02 Eli Zaretskii <eliz@is.elta.co.il> + + * xfaces.c (realize_default_face): Don't set the weight and slant of + the default face to Qnormal, unless these attributes are unspecified. + +2002-02-02 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * keyboard.c (command_loop_1) [HAVE_X_WINDOWS]: + Call cancel_hourglass unconditionally. + + * eval.c (Fsignal): Remove duplicated declaration of + the variable `display_hourglass_p'. + +2002-01-31 Richard M. Stallman <rms@gnu.org> + + * editfns.c (region_limit): Nicer error message. + + * coding.c (decode_composition_emacs_mule): + Give up if NCOMPONENT gets too large to index `component'. + + * callint.c (check_mark): New arg to specify clearer error message. + Callers changed. + +2002-01-27 Richard M. Stallman <rms@gnu.org> + + * minibuf.c (Fcompleting_read): Doc fix. + +2002-01-27 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * minibuf.c (Fread_from_minibuffer, Fread_command, Fread_function) + (Fread_variable, Fread_buffer, minibuffer-completion-confirm): + Fix doc-strings. + +2002-01-26 Richard M. Stallman <rms@gnu.org> + + * buffer.c (syms_of_buffer): Doc fixes for scroll-...-aggressively. + + * xdisp.c (try_scrolling): Exchange uses of scroll_down_aggressively + and scroll_up_aggressively. + +2002-01-26 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * keyboard.c (parse_tool_bar_item): Remove duplicated prototypes. + +2002-01-25 Stefan Monnier <monnier@cs.yale.edu> + + * textprop.c (Fnext_property_change, Fnext_single_property_change) + (Fprevious_property_change, Fprevious_single_property_change): + Stay within the narrowed-buffer boundaries. + +2002-01-25 Eli Zaretskii <eliz@is.elta.co.il> + + * term.c (Ftty_display_color_cells): New function. + (syms_of_term): Defsubr it. + (Ftty_display_color_cells, Ftty_display_color_p): Change the + argument name to DISPLAY. Doc fix. + + * dispextern.h: Add prototype for set_tty_color_mode and + tty_setup_colors. + +2002-01-24 Jason Rumney <jasonr@gnu.org> + + * w32term.c (x_scroll_run): Use ScrollWindowEx in place of BitBlt. + If region left to draw is not what was expected, mark the frame as + garbaged. + + * w32fns.c (w32_wnd_proc) <WM_PAINT>: Initialize update_rect. + Combine the regions returned by BeginPaint and GetUpdateRect. + +2002-01-23 Jason Rumney <jasonr@gnu.org> + + * w32term.c (x_update_window_begin): Only hide caret if + w32_use_visible_system_caret is set. + (x_update_window_end): Only show caret if + w32_use_visible_system_caret is set. + (syms_of_w32term): Handle SystemParametersInfo call failing. + + * w32fns.c (syms_of_w32fns): Initialize w32_visible_system_caret_hwnd. + +2002-01-22 Richard M. Stallman <rms@gnu.org> + + * unexelf.c (unexec): Define n so as to cause compilation error + for the code where people have often written n instead of nn. + + * .gdbinit (hookpost-run): Defined. + +2002-01-22 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xfns.c (x_set_frame_parameters): Typo in previous fix corrected. + +2002-01-21 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xfns.c (x_set_frame_parameters): Just call x_fullscreen_adjust + if fullscreen is being set. + +2002-01-21 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * minibuf.c (Fminibuffer_contents) + (Fminibuffer_contents_no_properties, Fread_from_minibuffer) + (Fread_string, Fread_no_blanks_input, Fcompleting_read): Doc fixes. + +2002-01-21 Richard M. Stallman <rms@gnu.org> + + * window.c (check_frame_size): Fix minimum height calculation. + +2002-01-20 Ken Raeburn <raeburn@gnu.org> + + * dispextern.h (WINDOW_WANTS_MODELINE_P): Use XFASTINT on window + height before comparison. + (WINDOW_WANTS_HEADER_LINE_P): Likewise. + +2002-01-20 Jason Rumney <jasonr@gnu.org> + + * w32term.c (w32_system_caret_width): Remove. + (w32_use_visible_system_caret): New user flag. + (syms_of_w32term): DEFVAR_BOOL it. Initialize based on whether + Windows reports a screen reader running. + (x_update_window_begin): Hide the system caret. + (x_update_window_end): Show the system caret. + (x_display_and_set_cursor): Don't draw a cursor when + w32_use_visible_system_caret is set. Do not adjust width. + + * w32fns.c (w32_visible_system_caret_hwnd): New static variable. + (w32_wnd_proc) <WM_KILL_FOCUS, WM_EMACS_DESTROY_CARET>: Set it. + <WM_EMACS_TRACK_CARET>: Arrange for system caret to be visible if + the user requests it. Use system default width when creating. + <WM_EMACS_HIDE_CARET, WM_EMACS_SHOW_CARET>: Handle new messages. + + * w32term.h (WM_EMACS_SHOW_CARET, WM_EMACS_HIDE_CARET): + New window messages. + +2002-01-20 Richard M. Stallman <rms@gnu.org> + + * window.c (MIN_SAFE_WINDOW_HEIGHT): Value now 1. + +2002-01-20 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * doprnt.c (doprnt1): Fix typos in error call. + +2002-01-20 Eli Zaretskii <eliz@is.elta.co.il> + + * unexelf.c (unexec) [__sgi]: Support the .got sections. + +2002-01-20 Jason Rumney <jasonr@gnu.org> + + * w32term.c (w32_native_per_char_metric): Don't trust the metrics + that Windows returns. If a double check fails, try to guess how + ExtTextOut is going to act. + + * w32fns.c (w32_load_system_font, w32_to_x_charset): Use strnicmp + in place of stricmp. + (w32_list_synthesized_fonts): Removed. + (w32_to_all_x_charsets, enum_font_maybe_add_to_list): New functions. + (struct enumfont_t): New element; list. + (enum_font_cb2): List all style and charset variations of a font. + (Fw32_select_font): New optional argument; include_proportional. + Exclude vertical fonts. Exclude proportional fonts unless + include_proportional is non-nil. + (w32_enable_synthesized_fonts): Change to a boolean. + (Fw32_send_sys_command): Doc fix. + +2002-01-19 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * dispnew.c (update_frame): Move the variable `tem' to the block + where it is used. + +2002-01-19 Jason Rumney <jasonr@gnu.org> + + * w32fns.c (Fx_create_frame): Bind redisplay-dont-pause around + call to face-set-after-frame-default. + +2002-01-18 Richard M. Stallman <rms@gnu.org> + + * dispextern.h (WINDOW_WANTS_MODELINE_P): Check window height > 1. + (WINDOW_WANTS_HEADER_LINE_P): Check window height provides room. + +2002-01-17 Richard M. Stallman <rms@gnu.org> + + * window.c (enlarge_window): When exceeding size of parent, + directly delete all the siblings instead of trying to resize it. + +2002-01-17 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * term.c (set_tty_color_mode): Remove unused variable `tem'. + +2002-01-16 Henrik Enberg <henrik@enberg.org> + + * lread.c (init_lread): Move the installed-lisp dirs later in the path. + +2002-01-16 Kim F. Storm <storm@cua.dk> + + * xterm.c (x_erase_phys_cursor): Don't erase cursor if cursor row + is invisible. This can happen if cursor is on top line of a + window, and we switch to a buffer with a header line. + + * w32term.c (x_erase_phys_cursor): Ditto. + +2002-01-16 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * xterm.c (XTread_socket) [!USE_X_TOOLKIT]: Compute the value of + `dont_resize' only when used. + + * xdisp.c: Remove forgotten extern declaration of `Qimage'. + +2002-01-15 Eli Zaretskii <eliz@is.elta.co.il> + + * xdisp.c (display_mode_element): When computing charpos, depend + on multibyteness of elt, not the text in field. + +2002-01-15 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * buffer.c (Fkill_all_local_variables): + Increment `update_mode_lines' only once. + +2002-01-14 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * lisp.h (adjust_after_replace_noundo) + (Fupdate_coding_systems_internal): Add prototypes. + + * sound.c (Fplay_sound): Initialize header_size also for :data case. + +2002-01-14 Eli Zaretskii <eliz@is.elta.co.il> + + Support for the --color command-line argument and tty-color-mode + frame parameter: + + * term.c (tty_default_color_capabilities, tty_setup_colors) + (set_tty_color_mode): New functions. + (term_init): Call tty_default_color_capabilities. + (Qtty_color_mode_alist): New variable. + (syms_of_term): Intern and staticpro it. + + * frame.c (store_frame_param): Call set_tty_color_mode for termcap + frames. + (do_switch_frame): For termcap frames, switch the tty + color mode as specified by the frame's parameters. + (Qtty_color_mode): New variable. + (syms_of_frame): Intern and staticpro it. + + * emacs.c (USAGE2): Add the --color option. + (standard_args): Ditto. + +2002-01-13 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.h (struct x_output): New members want_fullscreen, + x_pixels_diff, y_pixels_diff, x_pixels_outer_diff, and + y_pixels_outer_diff. + New enum for FULLSCREEN_* constants. + (FRAME_OUTER_WINDOW): Handle the case where output_data.x->widget + is NULL. + (x_fullscreen_adjust): Add prototype. + + * emacs.c (USAGE2): Add the new full-screen arguments. + (standard_args): Ditto. + + * xfns.c (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): + New variables. + (syms_of_xfns): Intern and staticpro them. + (x_frame_parms) <"fullscreen">: New parameter. + (x_fullscreen_move, x_set_fullscreen): New functions. + (x_set_frame_parameters): Support for Qfullscreen. + (x_real_positions): More accurate computation of the frame position. + (x_figure_window_size): Support full-screen frames. + (Fx_create_frame): Default the fullscreen parameter. + + * xterm.c (x_check_fullscreen, x_fullscreen_adjust): New functions. + (XTread_socket) <Expose>: Call x_check_fullscreen. + <ConfigureNotify>: Don't resize to fullscreen. + Call x_check_fullscreen_move, and set the want_fullscreen member of + output_data.x. + +2002-01-13 Jason Rumney <jasonr@gnu.org> + + * w32term.h (WM_XBUTTONDOWN, WM_XBUTTONUP): New window messages + for mice with more than 3 buttons. + + * w32term.c (parse_button): New parameter xbutton. Callers changed. + (w32_read_socket): Handle new "XBUTTON" messages. + + * w32fns.c (w32_pass_extra_mouse_buttons_to_system): New user option. + (syms_of_w32fns): DEFVAR_BOOL it. + (w32_wnd_proc): Handle new "XBUTTON" messages. + +2002-01-13 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * keyboard.c (read_key_sequence): Remove unused variable `extra_maps'. + +2002-01-13 Andreas Schwab <schwab@suse.de> + + * xterm.c (x_load_font): Never set fonts_changed_p to zero. + +2002-01-12 Andreas Schwab <schwab@suse.de> + + * .gdbinit (xbuffer): Remove address operator since data is now a + pointer. + +2002-01-11 Richard M. Stallman <rms@gnu.org> + + * insdel.c (adjust_after_replace_noundo): New function. + + * coding.c (code_convert_region): Don't copy old text if undo disabled. + +2002-01-09 Jason Rumney <jasonr@gnu.org> + + * xdisp.c (x_consider_frame_title): Don't count the tooltip frame + when checking for multiple frames. + +2002-01-08 Richard M. Stallman <rms@gnu.org> + + * window.c (delete_window): Rewrite the code for changing the + selected window to handle the case where WINDOW is not a leaf. + +2002-01-07 Eli Zaretskii <eliz@is.elta.co.il> + + * process.c (send_process): Set src_multibyte to 1 after the call + top setup_coding_system, not before the call. + +2002-01-07 Jason Rumney <jasonr@gnu.org> + + * xmenu.c (set_frame_menubar, xmenu_show): + (xdialog_show): Initialize wv->help to Qnil. + + * w32menu.c (single_submenu, set_frame_menubar, w32_menu_show): + (w32_dialog_show): Initialize wv->help to Qnil. + +2002-01-06 Jason Rumney <jasonr@gnu.org> + + * xmenu.c (single_submenu): Initialize wv->help to Qnil. + + * w32menu.c (w32_menu_display_help): Revert last change. + + * xmenu.c (menu_highlight_callback): Revert last change. + +2002-01-06 Andreas Schwab <schwab@suse.de> + + * insdel.c (make_gap_larger): Make sure buffer size does not + overflow range of int. + +2002-01-05 Jason Rumney <jasonr@gnu.org> + + * w32term.c (x_draw_glyphs): Don't call notice_overwritten_cursor if + OVERLAPS_P. + + * w32menu.c (w32_menu_display_help): Hide any tooltip window. + + * w32fns.c (compute_tip_xy): If tooltip won't fit on the screen + to the left or to the right of the pointer, put it against + the left screen edge. + (x_frame_parms): Add missing braces around initializer. + + * w32term.c (x_setup_relief_colors): Don't compute an image's + background color if it doesn't have a Pixmap. + (notice_overwritten_cursor): Don't depend on + output_cursor and updated_area. Compare pixel coordinates with + window's cursor pixel coordinates. + (x_draw_glyphs, x_clear_end_of_line, show_mouse_face): + Call notice_overwritten_cursor with new arg list. + (show_mouse_face): Fix bug setting a row's mouse_face_p flag + unconditionally. + (x_draw_image_relief): Use predefined macro instead of + constant when the value of `tool_bar_button_relief' is negative. + + * w32term.c (x_display_and_set_cursor): Fix PostMessage arg types. + +2002-01-04 Richard M. Stallman <rms@gnu.org> + + * xmenu.c (menu_highlight_callback): Hide any tooltip window. + +2002-01-03 Richard M. Stallman <rms@gnu.org> + + * keymap.c (Fcurrent_active_maps): Put the `keymap' property map first. + (Fkey_binding): Try the `keymap' property map first. + (Fdescribe_buffer_bindings): Show `keymap' property bindings before + minor mode bindings. + +2002-01-03 Kim F. Storm <storm@cua.dk> + + * keyboard.c (read_key_sequence): Fix cast of submaps arg to bcopy. + +2002-01-02 Richard M. Stallman <rms@gnu.org> + + * keyboard.c (read_key_sequence): Handle the keymap property + before minor mode maps. + + * editfns.c (Fformat): Update thissize from field_width + based on the actual width, in the string case. + +2002-01-01 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * charset.h (UNIBYTE_STR_AS_MULTIBYTE_P): Parenthesize assignment + when used as truth value to prevent gcc warnings. + + * sysdep.c, unexapollo.c, w32.c, w32bdf.c, w32heap.c, w32inevt.c, + * w32proc.c: Include <config.h>. + +2002-01-01 Andreas Schwab <schwab@suse.de> + + * eval.c (max_specpdl_size, max_lisp_eval_depth): Define as int, + not EMACS_INT, to make them compatible with DEFVAR_INT. + * lisp.h (max_specpdl_size): Adjust declaration. + +2002-01-01 Richard M. Stallman <rms@gnu.org> + + * print.c (print_object): Test print_escape_nonascii only for + unibyte strings. + (PRINTPREPARE): Once again bind Qprint_escape_nonascii + when outputting to a multibyte buffer. + +2001-12-29 Richard M. Stallman <rms@gnu.org> + + * print.c (print_object): In multibyte string, use hex escapes. + Use octal only for unibyte strings. + (PRINTPREPARE): Don't ever set Qprint_escape_nonascii. + + * lread.c (read_escape): New arg BYTEREP for reporting whether + escape forces unibyte or multibyte. + (read1): When reading a string, take note of that info. + +2001-12-29 Ken Raeburn <raeburn@gnu.org> + + * abbrev.c (Fexpand_abbrev): Use NILP instead of implicit zero + comparison to test lisp value returned by Fget. + +2001-12-29 Richard M. Stallman <rms@gnu.org> + + * lisp.h (max_specpdl_size): Add declaration. + + * fileio.c (Fdo_auto_save): If NO_MESSAGE, don't call push_message. + + * keymap.c (silly_event_symbol_error): New subrtn, from Fdefine_key. + Handle modifier bits. Correct typo in error message. + +2001-12-28 Richard M. Stallman <rms@gnu.org> + + * abbrev.c: Use the plist of an abbrev for multiple params if nec. + (Fdefine_abbrev): New arg SYSTEM-FLAG for a system abbrev. + (Fdefine_global_abbrev, Fdefine_mode_abbrev): + Update calls to Fdefine_abbrev. + (write_abbrev): Update for changed data format. + Don't list "system" abbrevs. + (Fexpand_abbrev): Update use count with new data format. + (describe_abbrev): Update for changed data format. + (Fdefine_abbrev_table): Handle the new SYSTEM-FLAG. + + * config.in (HAVE_MBSINIT): Add #undef. + + * strftime.c (mbsinit): Define as no-op if not available. + + * s/sco5.h (LIBX11_SYSTEM) [MOTIF]: Add -lgen. + (sigprocmask_set): Conditionalize decl on ! NOT_C_CODE. + + * keymap.c (Flookup_key): Error message if key has wrong data type. + (Fdefine_key): Add error message for trying to bind [DEL], [RET], etc. + (exclude_key): New variable. + +2001-12-28 Gerd Moellmann <gerd@gnu.org> + + * xterm.c (x_setup_relief_colors): Don't compute an image's + background color if it doesn't have a Pixmap. + + * xterm.c (notice_overwritten_cursor): Don't depend on + output_cursor and updated_area. Compare pixel coordinates with + window's cursor pixel coordinates. + (x_draw_glyphs, x_clear_end_of_line, show_mouse_face): + Call notice_overwritten_cursor with new arg list. + (show_mouse_face): Fix bug setting a row's mouse_face_p flag + unconditionally. + + * xdisp.c (try_scrolling) <PT below scroll margin>: Add the + height of the cursor line to the amount to scroll. + +2001-12-27 Richard M. Stallman <rms@gnu.org> + + * intervals.c (set_point_both): The position after an invisible, + intangible character is not an acceptable stopping point. + +2001-12-27 Ken Raeburn <raeburn@gnu.org> + + * window.c (enlarge_window): In new preserve_before code, convert + CURBEG from lisp object to integer before doing arithmetic. + +2001-12-27 Richard M. Stallman <rms@gnu.org> + + * bytecode.c (Fbyte_code): Undo previous change. + +2001-12-26 Kim F. Storm <storm@cua.dk> + + * keyboard.c (record_char): Ignore duplicate help-echo events only + separated by mouse-movement. When tracking mouse, only record + first and last mouse-movement event in same window. + Don't record mouse-movement events in keyboard macros. + +2001-12-25 Richard M. Stallman <rms@gnu.org> + + * window.c (enlarge_window): New arg PRESERVE_BEFORE. Callers changed. + (Fenlarge_window): New arg PRESERVE_BEFORE. + + * bytecode.c (Fbyte_code): Use Fstring_make_unibyte + instead of Fstring_as_unibyte. + +2001-12-22 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + The following changes remove mocklisp support: + + * mocklisp.h, mocklisp.c: Files removed. + + * lisp.h: Remove declarations of variables `Vmocklisp_arguments', + `Qmocklisp' and `Qmocklisp_arguments'. + Remove prototype of syms_of_mocklisp. + + * makefile.nt, makefile.w32-in, Makefile.in: Remove mocklisp files. + + * callint.c: Do not include mocklisp.h. + (Fcall_interactively): Do not test for mocklisp case. + + * eval.c: Remove variables `Qmocklisp_arguments', + `Vmocklisp_arguments' and `Qmocklisp'. Remove prototype of ml_apply. + (Fprogn, Fwhile, Fcommandp, Feval, Ffuncall, funcall_lambda): + Do not test for mocklisp case. + (Fwhile): Remove unused variable `tem'. + (syms_of_eval): Remove variable `moclisp-arguments'. + + * data.c (wrong_type_argument): Remove mocklisp case. + + * doc.c (Fdocumentation): Remove mocklisp case. + + * emacs.c (main): Do not call syms_of_mocklisp. + +2001-12-21 Richard M. Stallman <rms@gnu.org> + + * xfns.c (compute_tip_xy): If tooltip won't fit on the screen + to the left or to the right of the pointer, put it against + the left screen edge. + +2001-12-21 Eli Zaretskii <eliz@is.elta.co.il> + + * Makefile.in (distclean): Remove .gdbinit if we are building + outside the source tree. + +2001-12-19 Eli Zaretskii <eliz@is.elta.co.il> + + * w32.c (emacs_root_dir): New function. + + * msdos.c (emacs_root_dir): New function. + + * fileio.c (Fexpand_file_name) [DOS_NT]: Use the root directory + of the current drive as the fallback for default_directory. + + * dired.c (file_name_completion): Run the elements of + completion-ignored-extensions through ENCODE_FILE. + + * lisp.h (scmp): Remove prototype, since it's now a static + function private to dired.c. + +2001-12-18 Richard M. Stallman <rms@gnu.org> + + * dired.c (scmp): Function moved from minibuf.c. + Delete multibyte handling--used only on encoded strings. + + * minibuf.c (scmp): Function moved to dired.c. + + * fns.c (merge): Add QUIT call. + +2001-12-18 Dave Love <fx@gnu.org> + + * Makefile.in (lisp, shortlisp): Add language/utf-8-lang.el, + language/georgian.el. + +2001-12-18 Eli Zaretskii <eliz@is.elta.co.il> + + * Makefile.in (lisp, shortlisp): Synchronize with changes to + lisp/Makefile.in:DONTCOMPILE. + +2001-12-18 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * xdisp.c (window_box_height): Do not return negative values. + From Gerd Moellmann <gerd@gnu.org>. + + * keyboard.c (head_table): Add missing braces around initializer. + + * term.c (keys): Likewise. + + * xfns.c (x_frame_parms, visual_classes): Likewise. + +2001-12-17 Sam Steingold <sds@gnu.org> + + * coding.c (DECODE_COMPOSITION_END): Fixed a typo in the last + patch (COMPOSING_P, not COMPOSING). + +2001-12-17 Richard M. Stallman <rms@gnu.org> + + * editfns.c (Fcompare_buffer_substrings): Add QUIT to main loop. + + * coding.c (code_convert_region): Update coding->cmp_data->char_offset + before calling decode_coding. + + * charset.c (Fdefine_charset): Call Fupdate_coding_systems_internal. + + * coding.c (DECODE_COMPOSITION_END): Check for ! COMPOSING_P (coding) + instead of only for COMPOSITION_DISABLED. + +2001-12-16 Richard M. Stallman <rms@gnu.org> + + * alloc.c (pure_alloc): After overflow, allocate just a small block. + + * Makefile.in (xmenu.o, xterm.o, fontset.o): Depend on buffer.h. + + * buffer.h (struct buffer): New field `display_error_modiff'. + * buffer.c (reset_buffer): Initialize `display_error_modiff'. + + * window.c (Frecenter): Clear display_error_modiff field. + + * xdisp.c (redisplay_window_0, redisplay_window_1): New functions. + Call redisplay_window, but not if display_error_modiff field says no. + (redisplay_window_error): New function. + (displayed_buffer): New variable. + (redisplay_internal, redisplay_windows): Call the new functions + instead of redisplay_window directly. + +2001-12-15 Richard M. Stallman <rms@gnu.org> + + * keyboard.c (syms_of_keyboard) <double-click-fuzz>: Doc fix. + +2001-12-14 Andrew Innes <andrewi@gnu.org> + + * makefile.w32-in (EMACSLOADPATH): Define. + ($(EMACS)): Run `list-load-path-shadows' after dumping Emacs. + (bootstrap-temacs): Remove dependency on bootstrap-clean. + +2001-12-13 Eli Zaretskii <eliz@is.elta.co.il> + + * xfns.c (x_report_frame_params): Make the scroll-bar-width frame + parameter have a numeric value all the time. + + * w32fns.c (x_report_frame_params): Likewise. + +2001-12-12 Richard M. Stallman <rms@gnu.org> + + * fileio.c (Fwrite_region): Doc fix. + + * xdisp.c (CLEAR_FACE_CACHE_COUNT): Redefine as 500. + (redisplay_internal): Call clear_image_cache only for window terminals. + +2001-12-12 Gerd Moellmann <gerd@gnu.org> + + * xdisp.c (move_it_vertically_backward): Change heuristic + for the case that we didn't move far enough initially. + + * window.c (Frecenter): Simplify computation in the case of window + system frames and ARG < 0; use window_box_height. + +2001-12-11 Richard M. Stallman <rms@gnu.org> + + * Makefile.in, mem-limits.h, dispnew.c, emacs.c, fileio.c: + * process.c, sysdep.c, unexec.c: Test GNU_LINUX, not LINUX. + +2001-12-11 Andrew Innes <andrewi@gnu.org> + + * insdel.c (make_gap) [DOUG_LEA_MALLOC]: Call make_gap_smaller if + arg is negative. + +2001-12-11 Richard M. Stallman <rms@gnu.org> + + * m/hp800.h: Split the __hpux conditional into the parts + that are right for GNU/Linux too and the parts that are not. + Use the former if GNU_LINUX. + (HAVE_ALLOCA, LOAD_AVE_TYPE, LOAD_AVE_CVT): New defs for GNU/Linux. + + * s/gnu-linux.h (GNU_LINUX): Defined. + +2001-12-11 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * macros.c, msdos.c, w16select.c: Change doc-string comments to + `new style' [w/`doc:' keyword]. + +2001-12-10 Jason Rumney <jasonr@gnu.org> + + * w32menu.c (w32_free_submenu_strings): Clear menu item struct + before using. + +2001-12-09 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * dosfns.c: Change doc-string comments to `new style' [w/`doc:' + keyword]. + +2001-12-09 Eli Zaretskii <eliz@is.elta.co.il> + + * dosfns.c (dos-display-scancodes, dos-decimal): Doc fix. + + * s/hpux10.h (srand48): Don't undefine. + +2001-12-09 Jason Rumney <jasonr@gnu.org> + + * w32menu.c (_widget_value): Make `help' field a Lisp_Object. + Add comment to explain where the struct came from. + (single_submenu, w32_menu_show): Set `help' field as Lisp_Object. + (add_menu_item): Process pop-up menus first to avoid memory leak. + (add_menu_item, w32_menu_display_help): Use `help' field as + Lisp_Object. + (w32_free_submenu_strings): Only free owner-drawn strings. + +2001-12-09 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * COPYING: Moved back. + + * charset.c (char_to_string_1, translate_char, Fdefine_charset): + Add parentheses around && within ||. + + * indent.c (compute_motion): Likewise. + + * intervals.c (merge_properties_sticky): Likewise. + + * coding.c (setup_coding_system, shrink_encoding_region) + (Fdecode_sjis_char): Likewise. + +2001-12-07 Andreas Schwab <schwab@suse.de> + + * xdisp.c (display_mode_element): Don't read past end of string if + it ends with '%'. + + * alloc.c (inhibit_garbage_collection): Don't exceed value an int + can hold. + + * data.c (Vmost_positive_fixnum, Vmost_negative_fixnum): + Rename from most_positive_fixnum and most_negative_fixnum, resp., and + type changed to Lisp_Object. + (syms_of_data): DEFVAR_LISP them. + +2001-12-07 Richard M. Stallman <rms@gnu.org> + + * callproc.c (init_callproc): Set Vdata_directory based on the source + location whenever Emacs was run uninstalled. + +2001-12-06 Paul Eggert <eggert@twinsun.com> + + * config.in (HAVE_WORKING_VFORK): New #undefs. + * process.c (create_process): + Use HAVE_WORKING_VFORK, not HAVE_VFORK. + * m/cnvrgnt.h (HAVE_VFORK): Remove #define. + * m/ibm370aix.h (HAVE_VFORK): Remove #undef. + * m/ibmps2-aix.h (HAVE_VFORK): Remove #define. + * m/intel386.h (HAVE_VFORK): Likewise. + * m/mips-siemens.h (HAVE_VFORK): Likewise. + * m/mips.h (HAVE_VFORK): Likewise. + * s/freebsd.h (vfork): Remove #define. + * s/lynxos.h (HAVE_VFORK): Remove #undef. + * s/usg5-4-2.h: Fix comment about vfork. + +2001-12-06 Richard M. Stallman <rms@gnu.org> + + * s/hpux10.h (random): Add undef. + (HAVE_RANDOM): Define it just once. + +2001-12-06 Stefan Monnier <monnier@cs.yale.edu> + + * eval.c: Undo last change: the standard syntax is not wanted. + +2001-12-06 Eli Zaretskii <eliz@is.elta.co.il> + + * xterm.c (x_free_frame_resources) [USE_X_TOOLKIT]: Remove all the + scroll bars of the frame before deleting the frame itself. If the + frame has a widget, delete the frame with XtDestroyWidget, and do + not call XDestroyWindow before that. + +2001-12-06 Kim F. Storm <storm@cua.dk> + + * xfns.c (x_report_frame_params): Return actual fringe widths. + + * w32fns.c (x_report_frame_params): Return actual fringe widths. + +2001-12-05 Andrew Innes <andrewi@gnu.org> + + * alloc.c (Fgarbage_collect): Shrink buffer gaps that are + excessively large. + + * insdel.c (make_gap_larger): New function. + (make_gap_smaller): New function. + (make_gap) [USE_MMAP_FOR_BUFFERS || REL_ALLOC]: + Call make_gap_smaller if arg is negative. + +2001-12-04 Stefan Monnier <monnier@cs.yale.edu> + + * keyboard.c (kbd_buffer_store_event): Fix interrupt_signal prototype. + Pass a dummy argument when calling interrupt_signal. + (parse_menu_item): Mark disabled items before checking for empty def. + (read_char_minibuf_menu_prompt): Make safety more visible. + (read_key_sequence): Add a `first_unbound' variable. + Use it to detect C-c ESC ESC ESC ESC ... cases and drop the + unbound prefix as soon as we can detect it. + + * doc.c (Fsnarf_documentation): Add prototype. + (get_doc_string): Handle negative arguments. + (Fdocumentation): Use AREF and ASIZE. + Move the calls to get_doc_string to a single place. + Don't confuse an interactive-spec for a docstring reference. + (Fdocumentation_property): Take advantage of the fact that + get_doc_string now ignores the sign of the docstring position. + + * eval.c: Use standard syntax for usage in docstrings. + +2001-12-03 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * xdisp.c (syms_of_xdisp): Make `tool-bar-button-relief' an option. + +2001-12-02 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * xterm.c (x_draw_image_relief): Use predefined macro instead of + constant when the value of `tool_bar_button_relief' is negative. + +2001-12-02 Richard M. Stallman <rms@gnu.org> + + * xmenu.c (menu_highlight_callback): Use `help' field as Lisp_Object. + (single_submenu, xmenu_show): Set `help' field as Lisp_Object. + + * fileio.c (read_non_regular): Delete Fsignal call. + +2001-12-01 Stefan Monnier <monnier@cs.yale.edu> + + * lisp.h (run_hook_list_with_args): Undo last change. + +2001-12-01 Gerd Moellmann <gerd@gnu.org> + + * xterm.c (x_draw_fringe_bitmap): Always undo clipping. + +2001-12-01 Jason Rumney <jasonr@gnu.org> + + * window.c (Qleft_fringe, Qright_fringe): Remove. Now in frame.c. + + * w32term.h (WM_MOUSELEAVE, TME_LEAVE, TRACKMOUSEEVENT) + [!WM_MOUSELEAVE]: Define. + + * w32menu.c (current_popup_menu, get_menu_item_info): + (set_menu_item_info): New vars. + (set_frame_menubar): Doc fix clarifying GC interaction with menus. + (w32_menu_show): Set current_popup_menu. + (add_menu_item): Allocate new strings for owner-drawn menu items + and help strings. + Use owner-draw for disabled menu items again. + (w32_menu_display_help): Ignore owner-drawn items and popup menus. + (w32_free_submenu_strings, w32_free_menu_strings): New functions. + + * w32fns.c (trackmouse_window, track_mouse_event_fn): New vars. + (w32_wnd_proc) <WM_MOUSEMOVE>: Notice when mouse enters frame. + <WM_EXITMENULOOP>: Free menu strings. + <WM_MOUSELEAVE>: Stop tracking mouse. + (x_create_tip_frame): Specify no minibuffer, modeline or fringes. + + * w32term.c (w32_read_socket) <WM_MOUSELEAVE>: Cancel help echo + and mouse face. + +2001-12-01 Kim F. Storm <storm@cua.dk> + + The following changes add left-fringe and right-fringe + frame parameters to adjust fringe widths, or remove one or + both fringes. + + * frame.h (struct frame): Remove trunc_area_pixel_width and + trunc_area_cols fields. + (Qleft_fringe, Qright_fringe): Declare. + (FRAME_RIGHT_FRINGE_WIDTH): New macro. + + * frame.c (Qleft_fringe, Qright_fringe): New vars. + (syms_of_frame): Initialize them. + + * window.c (coordinates_in_window): Handle separate left and right + fringe widths. + + * xterm.h (struct x_output): Add left_fringe_width, right_fringe_width, + and fringe_cols fields. + (FRAME_FRINGE_BITMAP_WIDTH, FRAME_FRINGE_BITMAP_HEIGHT): Remove macros. + (FRAME_X_FRINGE_COLS): Use fringe_cols field. + (FRAME_X_FRINGE_WIDTH): Use fringes_extra field. + (FRAME_X_LEFT_FRINGE_WIDTH): Use left_fringe_width field. + (FRAME_X_RIGHT_FRINGE_WIDTH): Use right_fringe_width field. + (x_compute_fringe_widths): Add prototype. + + * xterm.c (zv_height, zv_bits, zv_period): Changed zv bitmap to + fill fringe evenly with small dashes. + (x_draw_fringe_bitmap): Clear background if necessary. Align and + clip the new ZV bitmap to avoid jitter between rows. + (x_draw_row_fringe_bitmaps): Rely on x_draw_fringe_bitmap to clear + background. Don't draw fringe bitmaps if fringe width is zero. + (x_compute_fringe_widths): New function. + (x_new_font, x_set_window_size_1): Use it. + + * xfns.c (x_frame_parms): Add `left-fringe' and `right-fringe' parms. + (x_set_frame_parameters): Process `font' parameter before other + parameters as fringe widths depend on it. + (x_set_fringe_width): New function. + (x_figure_window_size): Use x_compute_fringe_widths. + (Fx_create_frame): Process `left-fringe' and `right-fringe' frame + parameters. + + * widget.c (set_frame_size): Use x_compute_fringe_widths. + (EmacsFrameSetCharSize): Ditto. + + * w32term.h: Merged changes from xterm.h. + * w32term.c: Merged changes from xterm.c. + * w32fns.c: Merged changes from xfns.c. + +2001-11-29 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * COPYING: Removed. + +2001-11-29 Dave Love <fx@gnu.org> + + * coding.c (syms_of_coding) <Qchar_coding_system>: Give it an + extra extra slot. + (detect_coding_mask): Fix call of detect_coding_iso2022. + +2001-11-29 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * fileio.c (file-name-coding-system) + (default-file-name-coding-system): Doc fix (links to referenced + variables added). + +2001-11-28 Stefan Monnier <monnier@cs.yale.edu> + + * lisp.h (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5): + Add dummy uses of gcproN variables. + + * category.c (describe_category, describe_category_1) + (Fdescribe_categories): Remove. (Moved to lisp/help-fns.el.) + (syms_of_category): Don't defsubr Sdescribe_categories. + +2001-11-28 Richard M. Stallman <rms@gnu.org> + + * fileio.c (Ffind_file_name_handler): Avoid initializer for `result'. + + * Makefile.in (lispdir): New variable, referring to build dir. + (TAGS-LISP): Find Makefile in $(lispdir), not $(lispsource). + +2001-11-28 Andrew Innes <andrewi@gnu.org> + + * w32menu.c (w32_menu_display_help): Actually add the new argument + OWNER. + +2001-11-28 Jason Rumney <jasonr@gnu.org> + + * w32menu.c (add_menu_item): Do not use owner-draw for disabled + menu items. From David Ponce <dponce@wanadoo.fr>. + (w32_dialog_show) [HAVE_DIALOGS]: Compile whole function + conditionally. + (w32_menu_display_help): New argument OWNER. Rewritten to store a + help event in the owner frame's keyboard buffer. + + * w32fns.c (w32_wnd_proc) <WM_MENUSELECT>: Display help directly. + (Fx_show_tip): Don't subtract last width from row width. + + * w32term.c (w32_read_socket) <WM_MENUSELECT>: Remove. + (w32_read_socket): Use EQ to compare frames. + +2001-11-28 Gerd Moellmann <gerd@gnu.org> + + * xterm.c (x_draw_glyphs): Don't call notice_overwritten_cursor if + OVERLAPS_P. + +2001-11-28 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * xdisp.c (message_dolog): Remove unused variables `gcpro2', + `gcpro3' and `gcpro4'. + + * coding.c (decode_coding_string): Remove unused variable `gcpro1'. + +2001-11-28 Stefan Monnier <monnier@cs.yale.edu> + + * ccl.c: Use AREF and ASIZE. + +2001-11-27 Stefan Monnier <monnier@cs.yale.edu> + + * lisp.h (run_hook_list_with_args): Remove. + (LIST_END_P): Fix call to wrong_type_argument. + (make_fixnum_or_float): Use EMACS_INT rather than int. + +2001-11-26 Stefan Monnier <monnier@cs.yale.edu> + + * syntax.c (syms_of_syntax): Remove defsubr of Sdescribe_syntax. + (describe_syntax, describe_syntax_1, Fdescribe_syntax): Remove. + + * eval.c: Use AREF and ASIZE. + (Ffetch_bytecode): Add the file name to the error message. + + * fileio.c (Ffind_file_name_handler): Give precedence to handlers + which match the end of the file-name. + (Fsubstitute_in_file_name): Don't signal an error if $ENVVAR + is not a valid env var, but leave it as is instead. + + * keymap.c (access_keymap): Handle t bindings like nil bindings. + Make nil bindings in char-tables transparent. + (store_in_keymap): Turn a nil binding into a t binding for char-tables. + +2001-11-26 Richard M. Stallman <rms@gnu.org> + + * textprop.c (set_text_properties_1): Allow START, END in either order. + Do nothing if range is empty. + + * Makefile.in (mallocobj): Simplify logic using auxiliary vars. + + * Makefile.in (mostlyclean): Delete bootstrap-emacs here. + (clean): Not here. + +2001-11-25 Stefan Monnier <monnier@cs.yale.edu> + + * textprop.c (set_text_properties_1): Clearly mark that the + interval should not be empty. + + * intervals.c (graft_intervals_into_buffer): + Don't call set_text_properties_1 on an empty interval. + +2001-11-25 Richard M. Stallman <rms@gnu.org> + + * unexelf.c (unexec): Index by n, not nn, when checking for ".sbss". + + * callproc.c (Fcall_process): When we make a bigger buffer for bufptr, + don't lose the data in it. + +2001-11-25 Juanma Barranquero <lektu@terra.es> + + * abbrev.c (Fexpand_abbrev): Use Frun_hooks instead of Vrun_hooks. + + * buffer.c (Fkill_buffer): Likewise. + + * print.c (temp_output_buffer_setup): Likewise. + +2001-11-25 Stefan Monnier <monnier@cs.yale.edu> + + * xfaces.c (merge_face_heights): Coerce back to int explicitly. + +2001-11-25 Eli Zaretskii <eliz@is.elta.co.il> + + * window.c (Fset_window_vscroll): Doc fix. From Kalle Olavi + Niemitalo <kon@iki.fi>. + +2001-11-25 Jason Rumney <jasonr@gnu.org> + + * w32term.h (FRAME_X_FRINGE_COLS): No fringe on tip frames. + + * w32fns.c (x_create_tip_frame): Set frame's fringes_extra to 0. + (Fx_show_tip): Block input during frame creation. + (Fx_show_tip, Fx_hide_tip): Enable. + +2001-11-24 Richard M. Stallman <rms@gnu.org> + + * lread.c (Fload): Detect recursive load error for more than 3 + nestings of the same file. + (Vrecursive_load_depth_limit): Variable deleted. + (syms_of_lread) <recursive-load-depth-limit>: Variable deleted. + +2001-11-24 Jason Rumney <jasonr@gnu.org> + + * xfns.c (compute_tip_xy): Initialize root_x and root_y from + mouse position if either left or top is not specified. + + * w32fns.c (w32_wnd_proc) <WM_MENUSELECT>: Revert last change. + <WM_WINDOWPOSCHANGING>: Let tip frames resize without restriction. + (my_create_tip_window, Fx_show_tip): Adjust size for external border. + (my_create_tip_window): Assign tip_window. + (x_create_tip_frame): Use same defaults as X. + (compute_tip_xy): Remove unused variable. Use full screen width. + (Fx_show_tip): Do not double height. Call ShowWindow directly. + + * w32term.c (x_after_update_window_line): Doc fix. + (w32_read_socket): Doc fix. Avoid SET_FRAME_GARBAGED for tip + frames. + <WM_SHOWWINDOW>: Redo mouse highlight when hiding tip frame. + + * xdisp.c (prepare_menu_bars) [HAVE_WINDOW_SYSTEM]: Use tip_frame + for all Windowed systems. + +2001-11-23 Eli Zaretskii <eliz@is.elta.co.il> + + * msdos.c (IT_clear_screen): If the frame's faces are not yet + realized, use the initial screen colors to clear the screen. + +2001-11-23 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * textprop.c (Fset_text_properties): Remove unused variables + `unchanged', `prev_changed', `s' and `len'. + + * search.c (Freplace_match): Remove unused variable `inslen'. + + * keymap.c (access_keymap): Remove unused variables `c1' and `c2'. + +2001-11-22 Jason Rumney <jasonr@gnu.org> + + * w32fns.c (x_window_to_frame): Remove irrelevant TODO comment. + (w32_wnd_proc) <WM_MENUSELECT>: Show help echo directly. + (my_create_tip_window): New function. + (x_create_tip_frame, compute_tip_xy): Adapt for Windows. + (Fx_show_tip, Fx_hide_tip) [TEST_TOOLTIPS]: Adapt for Windows. + +2001-11-20 Jason Rumney <jasonr@gnu.org> + + * coding.h (Vw32_system_coding_system) [WINDOWSNT]: Remove. + (ENCODE_SYSTEM, DECODE_SYSTEM) [WINDOWSNT]: Use Vlocale_coding_system. + + * w32fns.c (Vw32_system_coding_system): Remove. + (w32_to_x_font, x_to_w32_font): Use Vlocale_coding_system. + +2001-11-19 Stefan Monnier <monnier@cs.yale.edu> + + * fileio.c (Fwrite_region): Move choose_write_coding_system to + after build_annotations. + + * syntax.c (describe_syntax): Add dummy arg. + (describe_syntax_1): Update call to describe_vector. + + * category.c (describe_category): Add dummy arg. + (describe_category_1): Update call to describe_vector. + + * keymap.c (Fdescribe_vector): Add `describer' parameter. + (describe_command, describe_translation): Add dummy second param. + (describe_map): Call elt_describer with two arguments. + (describe_vector_princ): Add `fun' parameter. + Call it instead of the hardcoded `princ'. + (describe_vector): Add arg `args'. + Pass it as a new second argument to elt_describer. + + * keymap.h (describe_vector): Update prototype. + + * frame.c: Don't include keymap.h any more. + (keys_of_frame): Remove. + + * lisp.h (keys_of_frame): Remove declaration. + + * emacs.c (main): Don't call `keys_of_frame' any more. + +2001-11-14 Andreas Schwab <schwab@suse.de> + + * unexelf.c [!defined MAP_ANON]: Define MAP_ANON to MAP_ANONYMOUS + if defined, 0 otherwise. + (MAP_FAILED): Define if not defined and use it to test mmap failure. + (unexec) [!MAP_ANON]: Use /dev/zero as file to map. + +2001-11-19 Richard M. Stallman <rms@gnu.org> + + * indent.c (current_column_1): Fix handling of scan_bytes for mb chars. + +2001-11-18 Jason Rumney <jasonr@gnu.org> + + * w32term.c (note_mouse_highlight): Fix type of variable `ignore'. + (x_draw_bar_cursor): If the background color of the glyph under + the cursor equals the frame's cursor color, use the glyph's + foreground color for drawing the bar cursor. + (x_after_update_window_line): Clear internal border in different + circumstances. + (w32_set_vertical_scroll_bar): Check for width and height > 0. + (w32_draw_relief_rect): Correct relief by 1 pixel. + (x_set_glyph_string_background_width): + Set extends_to_end_of_line_p if the row's fill_line_p is set and + drawing the last glyph with DRAW_IMAGE_{RAISED,SUNKEN}. + (x_display_and_set_cursor): If cursor_in_echo_area, use NO_CURSOR + if cursor_in_non_selected_windows is false. + (show_mouse_face): Clean up. Recognize overwritten cursor differently. + (x_draw_glyphs): Remove parameters REAL_START and REAL_END. + Notice if cursor gets overwritten. + (notice_overwritten_cursor): Renamed from + note_overwritten_text_cursor. Rewritten to take glyph widths + into account, and to take X positions as parameters. + (x_draw_phys_cursor_glyph): Save state of w->phys_cursor_on_p + around call to x_draw_glyphs. + (x_setup_relief_colors): Use `IMAGE_BACKGROUND' and + `IMAGE_BACKGROUND_TRANSPARENT' to calculate the correct background + color to use for image glyph reliefs. + (x_draw_image_relief): Accept zero tool_bar_button_relief. + (glyph_rect): Remove unused variable `area'. + + * w32fns.c (x_set_frame_parameters): Avoid infinite recursion for + some items. + (x_set_internal_border_width): Set frame garbaged when window + doesn't exist yet. + (Fx_create_frame): Accept zero tool_bar_button_relief. + (x_clear_image_1, four_corners_best, image_background) + (image_background_transparent): New functions. + (xpm_format, png_format, jpeg_format, tiff_format, gif_format) + (gs_format): Add `:background' entry. + (lookup_image): Set IMG's background color if specified. + (pbm_load, xbm_load_image, png_load): Set IMG's background field + when appropriate. + (x_clear_image_1): Reset `background_valid' and + `background_transparent_valid' fields. + (x_build_heuristic_mask): Use IMAGE_BACKGROUND instead of + calculating it here. Set IMG's background_transparent field. + (enum xpm_keyword_index): Add XPM_BACKGROUND. + (enum png_keyword_index): Add PNG_BACKGROUND. + (enum jpeg_keyword_index): Add JPEG_BACKGROUND. + (enum tiff_keyword_index): Add TIFF_BACKGROUND. + (enum gif_keyword_index): Add GIF_BACKGROUND. + (enum gs_keyword_index): Add GS_BACKGROUND. + (pbm_load, png_load, jpeg_load, tiff_load, gif_load): + Pre-calculate image background color where necessary. + (x_create_x_image_and_pixmap, xbm_load, gs_load): + Use display info's n_cbits entry for screen depth. + (Fx_show_tip): Remove unused variables `buffer', `top', + `left', `max_width' and `max_height'. + + * w32menu.c (w32_menu_show, push_menu_pane): Doc fixes. + +2001-11-18 Gerd Moellmann <gerd@gnu.org> + + * puresize.h (BASE_PURESIZE): Increase to 750000. + +2001-11-18 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * frame.c (Fframe_live_p): Doc fix. + +2001-11-18 Richard M. Stallman <rms@gnu.org> + + * xdisp.c (message_dolog_marker1, message_dolog_marker2) + (message_dolog_marker3): New static variables hold three markers. + (syms_of_xdisp): Initialize and staticpro them. + (message_dolog): Use message_dolog_marker1..3 instead of + allocating markers each time. Unchain them when done. + +2001-11-17 Richard M. Stallman <rms@gnu.org> + + * doc.c (Fsnarf_documentation): Doc fix. + +2001-11-17 Andreas Schwab <schwab@suse.de> + + * xterm.c (note_mouse_highlight): Fix type of variable `ignore'. + +2001-11-17 Richard M. Stallman <rms@gnu.org> + + * fileio.c (Fwrite_region): Avoid initializer for Lisp_Object. + +2001-11-17 Jason Rumney <jasonr@gnu.org> + + * xterm.c (notice_overwritten_cursor): Take care of end < 0 case. + +2001-11-17 Gerd Moellmann <gerd@gnu.org> + + * xdisp.c (tool_bar_item_info): Avoid calling Fget_text_property + with invalid position. + +2001-11-16 Richard M. Stallman <rms@gnu.org> + + * syswait.h: Delete conditionals for HPUX7, ISC 4.1, and convex. + + * s/isc4-1.h (HAVE_SYS_WAIT_H): Add #undef. + * s/hpux.h (HAVE_SYS_WAIT_H): Add #undef. + * s/hpux8.h (HAVE_SYS_WAIT_H): Define it. + + * m/convex.h (HAVE_SYS_WAIT_H): Add #undef. + +2001-11-16 Stefan Monnier <monnier@cs.yale.edu> + + * fileio.c (build_annotations): Split off the tail. + (build_annotations_2): New fun. Extracted from build_annotations. + (Fwrite_region): Split the call to build_annotations into two + calls to build_annotations and build_annotations_2. + +2001-11-16 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * sysdep.c (wait_for_kbd_input) [VMS]: Do not call + clear_waiting_for_input with argument. + + * xterm.h (x_update_cursor): Remove duplicated prototype. + + * keyboard.h (clear_waiting_for_input): Remove duplicated prototype. + + * xterm.c (waiting_for_input): Remove unnecessary declaration. + + * data.c (Ftimes, Fquo, Frem, Fmod): Doc fix. + +2001-11-16 Stefan Monnier <monnier@cs.yale.edu> + + * fileio.c (choose_write_coding_system): New fun, extracted + from Fwrite_region. + (Fwrite_region): Use it. + + * eval.c (max_specpdl_size, max_lisp_eval_depth): Use EMACS_INT. + (funcall_lambda, run_hook_with_args): Make static and add prototype. + (ml_apply, find_handler_clause): Add prototype. + +2001-11-16 Eli Zaretskii <eliz@gnu.org> + + * config.in: Add #undef HAVE_COFF_H. + + * unexec.c (coff.h): Don't include unless HAVE_COFF_H is defined. + Required for ISC 4.1. + +2001-11-16 Eli Zaretskii <eliz@is.elta.co.il> + + * syswait.h (HAVE_SYS_WAIT_H): Undef for ISC 4.1. Reported by + Andrew Wiseman <a.wiseman@btclick.com>. + +2001-11-16 Kim F. Storm <storm@cua.dk> + + The following changes are made to clean up the various internal + references to the fringes to actually use the term `fringe' for + them. Previously, they were called `flags areas', `bitmap areas', + `left/right side of windows', or implicitly as `flags' or + `bitmaps': + + * dispextern.h (FRINGE_FACE_ID): Renamed from BITMAP_AREA_FACE_ID. + Comments fixed. Use renamed symbols. + + * dispnew.c: Comment fix. Use renamed symbols. + + * frame.h (FRAME_FRINGE_COLS): Renamed from FRAME_FLAGS_AREA_COLS. + (FRAME_FRINGE_WIDTH): Renamed from FRAME_FLAGS_AREA_WIDTH. + (FRAME_LEFT_FRINGE_WIDTH): Renamed from FRAME_LEFT_FLAGS_AREA_WIDTH. + + * msdos.c: Comment fix. + + * w32fns.c: Use renamed symbols. + + * w32term.c: Comment fixes. Use renamed symbols. + (fringe_bitmap_type): Renamed from bitmap_type. + (NO_FRINGE_BITMAP): Renamed from NO_BITMAP. + (w32_draw_fringe_bitmap): Renamed from w32_draw_bitmap. + (x_draw_row_fringe_bitmaps): Renamed from x_draw_row_bitmaps. + + * w32term.h: Comment fixes. Use renamed symbols. + (fringes_extra): Renamed from flags_areas_extra. + (FRAME_FRINGE_BITMAP_WIDTH): Renamed from FRAME_FLAGS_BITMAP_WIDTH. + (FRAME_FRINGE_BITMAP_HEIGHT): Renamed from FRAME_FLAGS_BITMAP_HEIGHT. + (FRAME_X_FRINGE_COLS): Renamed from FRAME_X_FLAGS_AREA_COLS. + (FRAME_X_FRINGE_WIDTH): Renamed from FRAME_X_FLAGS_AREA_WIDTH. + (FRAME_X_LEFT_FRINGE_WIDTH): + Renamed from FRAME_X_LEFT_FLAGS_AREA_WIDTH. + (FRAME_X_RIGHT_FRINGE_WIDTH): + Renamed from FRAME_X_RIGHT_FLAGS_AREA_WIDTH. + + * widget.c: Use renamed symbols. + + * window.c: Comment fixes. Use renamed symbols. + (coordinates-in-window-p): Doc fix. + + * xdisp.c: Comment fixes. Use renamed symbols. + + * xfaces.c (realize_basic_faces): Use FRINGE_FACE_ID. + + * xfns.c: Use renamed symbols. + + * xterm.c: Comment fixes. Use renamed symbols. + (fringe_bitmap_type): Renamed from bitmap_type. + (NO_FRINGE_BITMAP): Renamed from NO_BITMAP. + (x_draw_fringe_bitmap): Renamed from x_draw_bitmap. + (x_draw_row_fringe_bitmaps): Renamed from x_draw_row_bitmaps. + + * xterm.h: Comment fixes. Use renamed symbols. + (fringes_extra): Renamed from flags_areas_extra. + (FRAME_FRINGE_BITMAP_WIDTH): Renamed from FRAME_FLAGS_BITMAP_WIDTH. + (FRAME_FRINGE_BITMAP_HEIGHT): Renamed from FRAME_FLAGS_BITMAP_HEIGHT. + (FRAME_X_FRINGE_COLS): Renamed from FRAME_X_FLAGS_AREA_COLS. + (FRAME_X_FRINGE_WIDTH): Renamed from FRAME_X_FLAGS_AREA_WIDTH. + (FRAME_X_LEFT_FRINGE_WIDTH): + Renamed from FRAME_X_LEFT_FLAGS_AREA_WIDTH. + (FRAME_X_RIGHT_FRINGE_WIDTH): + Renamed from FRAME_X_RIGHT_FLAGS_AREA_WIDTH. + +2001-11-15 Jason Rumney <jasonr@gnu.org> + + * w32menu.c (add-menu-item): Make help_echo and radio buttons + work for most menu items. From David Ponce + <david.ponce@wanadoo.fr>. + +2001-11-15 Gerd Moellmann <gerd@gnu.org> + + * xfns.c (x_set_frame_parameters): Revert change of 2001-11-07. + Some x_set_* function expect to be called even if old and new + value are equal. + + * xdisp.c (build_desired_tool_bar_string): Accept zero + tool_bar_button_relief. + + * xfns.c (Fx_create_frame): Accept zero tool_bar_button_relief. + + * xterm.c (x_draw_image_relief): Accept zero tool_bar_button_relief. + + * xterm.c (x_draw_bar_cursor): If the background color of the + glyph under the cursor equals the frame's cursor color, use + the glyph's foreground color for drawing the bar cursor. + + * dispnew.c (direct_output_forward_char): Fix character/byte + position comparison. + +2001-11-15 Miles Bader <miles@gnu.org> + + * editfns.c (find_field): Add BEG_LIMIT and END_LIMIT parameters. + (Fdelete_field, Ffield_string, Ffield_string_no_properties): + Update arguments to find_field. + (Ffield_beginning, Ffield_end): Add LIMIT param, pass to find_field. + (Fconstrain_to_field): Use LIMIT arg to shorten search time. + * lisp.h (Ffield_beginning, Ffield_end): Update EXFUN decl. + * minibuf.c (Fminibuffer_prompt_end): Update args to Ffield_end. + +2001-11-14 Richard M. Stallman <rms@gnu.org> + + * editfns.c (Fpropertize): Allow call with 1 arg. + + * dispextern.h (image_background, image_background_transparent): + Conditionalize on HAVE_X_WINDOWS. + +2001-11-13 Richard M. Stallman <rms@gnu.org> + + * print.c (Fprin1_to_string): Doc fix. + + * sunfns.c (Fsun_change_cursor_icon): Doc fix. + + * floatfns.c (Fceiling, Ffloor): Doc fixes. + + * filelock.c (Funlock_buffer, Ffile_locked_p): Doc fixes. + + * fileio.c (Ffile_accessible_directory_p): Doc fix. + + * eval.c (syms_of_eval): Doc fix. + + * coding.c (syms_of_coding): Doc fix. + + * doc.c (Fsnarf_documentation): Doc fix. + + * dispnew.c (syms_of_display): Doc fix. + + * category.c (Fget_unused_category): Doc fix. + + * buffer.c (syms_of_buffer): Doc fixes. + +2001-11-14 Eli Zaretskii <eliz@is.elta.co.il> + + * print.c (prin1, print): Doc fix. + +2001-11-14 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * fontset.h: Remove declarations of variables + `Vhighlight_wrong_size_font' and `Vclip_large_size_font'. + + * fontset.c: Remove variables `Vhighlight_wrong_size_font' and + `Vclip_large_size_font'. + +2001-11-13 Jason Rumney <jasonr@gnu.org> + + * w32fns.c: Doc fix. + +2001-11-13 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * xfaces.c (Fface_attributes_as_vector): Doc fix. + + * fns.c: Doc fix. + + * emacs.c: Doc fix. + + * coding.c: Doc fix. + + * cmds.c, composite.c, dired.c, doc.c, filelock.c, floatfns.c, + * fontset.c, insdel.c, keymap.c: Change doc-string comments to + `new style' [w/`doc:' keyword]. + +2001-11-12 Richard M. Stallman <rms@gnu.org> + + * xterm.c (XTread_socket): Don't update focus for EnterNotify or + LeaveNotify events. Only FocusIn and FocusOut do that now. + (x_display_and_set_cursor): Do display hollow cursors in active + minibuffer windows when they are not selected. + +2001-11-12 Jason Rumney <jasonr@gnu.org> + + * w32console.c, w32fns.c, w32menu.c, w32proc.c, w32select.c, + * w32term.c: Change doc-string comments to `new style' + [w/`doc:' keyword]. Doc fixes. + + * w32fns.c: Don't define max. + (Fx_open_connection): Only execute once. + +2001-11-12 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * ccl.c: Change macros to use do-while block instead of if-else. + Use braces to follow GNU Coding Standards. + +2001-11-11 Richard M. Stallman <rms@gnu.org> + + * sysdep.c (child_setup_tty): Don't clear ICRNL or INLCR. + + * lread.c (read_escape): Use end_of_file_error for reporting eof. + + * insdel.c (replace_range): Use adjust_markers_for_replace + instead of adjust_markers_for_delete and adjust_markers_for_insert. + + * intervals.h (set_text_properties, set_text_properties_1): Declare. + + * textprop.c (set_text_properties_1): New subroutine + broken out of set_text_properties. + (set_text_properties): Use set_text_properties_1. + + * intervals.c (graft_intervals_into_buffer): + Use set_text_properties_1 to clear out properties. + + * search.c (Freplace_match): Use replace_range to insert + and delete. Don't request property inheritance from + surrounding text. + +2001-11-10 Jason Rumney <jasonr@gnu.org> + + * w32fns.c (enum_font_cb2): Use leading @ on face name to detect + vertical fonts. Allow them if face name is explicitly specified. + Do not give up if we find a font that cannot be converted to an xlfd. + +2001-11-10 Gerd Moellmann <gerd@gnu.org> + + * unexelf.c (unexec): Use mmap/munmap to allocate buffers + instead of malloc/free. + +2001-11-09 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * xfaces.c (merge_face_vectors): Use braces to follow GNU + Coding Standards. + (Finternal_set_lisp_face_attribute): Likewise. + + * buffer.c (Fbury_buffer): Likewise. + + * indent.c (current_column_1): Remove unused variable `prev_col'. + + * coding.c (encode_coding): Use precomputed value of `src'. + (encode_coding): Remove unused variable `src_end'. + (code_convert_region): Remove unused variables `count'. + +2001-11-07 Jason Rumney <jasonr@gnu.org> + + * w32term.c (x_display_and_set_cursor): Do not move system caret + if cursor_glyph is NULL. + +2001-11-07 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * keymap.c (access_keymap): Fix compilation error. + +2001-11-07 Miles Bader <miles@gnu.org> + + * xfns.c (x_set_frame_parameters): Avoid infinite recursion. + +2001-11-07 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * intervals.c (graft_intervals_into_buffer): + Remove #ifdef'd-out code. + (graft_intervals_into_buffer): Remove unused variable `middle'. + + * lread.c (Feval_region): Remove obsolete #ifdef'd-out + code (eval-current-buffer). + Change doc-string comments to `new style' [w/`doc:' keyword]. + +2001-11-06 Richard M. Stallman <rms@gnu.org> + + * keymap.c (access_keymap): Don't use initializers on Lisp_Object. + +2001-11-06 Stefan Monnier <monnier@cs.yale.edu> + + * lread.c (read1): Fix behavior with nested backquoting. + + * keyboard.c (make_lispy_event): Check integerness and fix + Lisp_Object/int mixup. + +2001-11-06 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * fns.c (copy_hash_table): Remove unused variable `v'. + + * fontset.c (fontset_font_pattern): Remove unused variable + `family_registry'. + + * indent.c (current_column_1): Remove unused variable `prev_col'. + +2001-11-05 Richard M. Stallman <rms@gnu.org> + + * m/news-risc.h (BROKEN_PROTOTYPES): Defined. + + * buffer.c (Fkill_buffer): Don't delete auto save file + if buffer is modified. + +2001-11-05 Andrew Innes <andrewi@gnu.org> + + * w32proc.c (Fw32_set_keyboard_layout): Use CHECK_NUMBER_CAR and + CHECK_NUMBER_CDR. + +2001-11-05 Richard M. Stallman <rms@gnu.org> + + * unexelf.c (unexec): Minor changes; clean up comments. + +2001-11-05 Sam Steingold <sds@gnu.org> + + * w32term.c (x_display_and_set_cursor): Fix w32 compilation error. + +2001-11-05 Andreas Schwab <schwab@suse.de> + + * sound.c (sound_perror): Save errno from being clobbered. + +2001-11-05 Dale Hagglund <rdh@yottayotta.com> + + * unexelf.c (unexec): Don't use `mmap'. Instead, read and write + the program image directly. + +2001-11-05 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * buffer.h (Fbuffer_local_value): Add prototype. + +2001-11-04 Richard M. Stallman <rms@gnu.org> + + * buffer.c (Fbuffer_local_value): Remove extra args from CHECK_SYMBOL + and CHECK_BUFFER. + + * keyboard.c (read_char): Use Fcar and Fcdr, not Fnth. + (record_char): Likewise. + + * keyboard.c (make_lispy_event): Don't insist a drag event must + move to a different buffer position. Instead, check for moving at + least double_click_fuzz. + + * fns.c (Fmake_hash_table): Use XCAR and XCDR, not Fnth and Flength. + + * keyboard.c (echo-area-clear-hook): Undo Oct 29 change. + + * indent.c (current_column_1, Fmove_to_column): Separate the code + for display-table glyphs from the code for buffer text, to fix + bugs in the former. + +2001-11-04 Michael Welsh Duggan <md5i@cs.cmu.edu> + + * buffer.c (Fbuffer_local_value): New function. + (syms_of_buffer): Defsubr it. + + * xterm.c, w32term.c (x_display_and_set_cursor): Use buffer-local + value of `cursor-in-non-selected-windows'. + + * lisp.h (Qcursor_in_non_selected_windows): New declaration. + * xdisp.c (Qcursor_in_non_selected_windows): New variable. + (syms_of_xdisp): Initialize it. + +2001-11-04 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * xfns.c (Fx_create_frame): Doc fix. + + * coding.c: Change doc-string comments to `new style' [w/`doc:' + keyword]. + + * eval.c (top_level_value, top_level_set): Remove commented and + #ifdef'd-out code. + (Fdefvar): Fix usage in doc-string. + +2001-11-03 Richard M. Stallman <rms@gnu.org> + + * xfns.c: Include unistd.h, if it exists. + + * editfns.c: Move the include of ctype.h after unistd.h. + + * gmalloc.c: Test BROKEN_PROTOTYPES. + +2001-11-03 Ken Raeburn <raeburn@gnu.org> + + * lisp.h (CHECK_STRING_CAR): New macro. + * lread.c (Fload): Use XSETCARFASTINT, XSETCDRFASTINT instead of + treating XCAR and XCDR as lvalues. + (openp): Use CHECK_STRING_CAR. + (read_list): Use XSETCDR instead of treating XCDR as lvalue. + +2001-11-03 Eli Zaretskii <eliz@is.elta.co.il> + + * s/sco5.h (sigprocmask_set): Declare as extern SIGMASKTYPE. + (SIGMASKTYPE): Define. + + * syssignal.h (sigunblock): Don't define if already defined. + +2001-11-02 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * eval.c (debugger_may_continue, Vdebug_ignored_errors) + (call_debugger, Fcondition_case, skip_debugger, unbind_to): + Fix typos in comments. + + * mocklisp.c (Fml_defun, Fml_while, Fml_substr): Remove commented + and #ifdef'd-out code. + Fix and reindent comments. + + * mocklisp.h: Remove comment which is a copy of comment in mocklisp.c. + + * category.h (CHECK_CATEGORY, CHECK_CATEGORY_SET): Remove unused + argument `i' in macros. + + * frame.h (CHECK_FRAME, CHECK_LIVE_FRAME): Remove unused argument + `i' in macros. + + * lisp.h (CHECK_STRING_OR_BUFFER, CHECK_HASH_TABLE, CHECK_LIST) + (CHECK_STRING, CHECK_CONS, CHECK_SYMBOL, CHECK_CHAR_TABLE) + (CHECK_VECTOR, CHECK_VECTOR_OR_CHAR_TABLE, CHECK_BUFFER) + (CHECK_WINDOW, CHECK_LIVE_WINDOW, CHECK_PROCESS, CHECK_NUMBER) + (CHECK_NATNUM, CHECK_MARKER, CHECK_NUMBER_COERCE_MARKER) + (CHECK_FLOAT, CHECK_NUMBER_OR_FLOAT) + (CHECK_NUMBER_OR_FLOAT_COERCE_MARKER, CHECK_OVERLAY) + (CHECK_NUMBER_CAR, CHECK_NUMBER_CDR): Remove unused argument `i' + in macros. + + * abbrev.c, alloc.c, buffer.c, bytecode.c, callint.c, callproc.c, + * casefiddle.c, category.c, ccl.c, charset.c, cmds.c, coding.c, + * composite.c, data.c, dired.c, dispnew.c, doc.c, dosfns.c, emacs.c, + * eval.c, fileio.c, filelock.c, fns.c, fontset.c, frame.c, frame.h, + * indent.c, keyboard.c, keymap.c, lread.c, macros.c, marker.c, + * minibuf.c, mocklisp.c, msdos.c, print.c, process.c, search.c, + * sunfns.c, syntax.c, textprop.c, undo.c, w16select.c, w32console.c, + * w32fns.c, w32menu.c, w32proc.c, w32select.c, window.c, xdisp.c, + * xfaces.c, xmenu.c, xselect.c: Update usage of CHECK_ macros + (remove unused second argument). + +2001-11-02 Stefan Monnier <monnier@cs.yale.edu> + + * syntax.c (describe_syntax): New wrapper. + (Finternal_describe_syntax_value): Rename from describe_syntax. + Don't insert space at front and \n at the end. + (syms_of_syntax): Defsubr Sinternal_describe_syntax_value. + + * regex.c (re_wctype): Try to fix some warnings. + (regcomp, regexec): Don't forget the __restrict. + +2001-11-02 Richard M. Stallman <rms@gnu.org> + + * textprop.c (Fget_char_property): Doc fix. + +2001-11-02 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * process.c (Fstart_process): Add usage to doc-string. + + * data.c (Fsetq_default): Ditto. + + * callint.c (Finteractive): Ditto. + +2001-11-01 Stefan Monnier <monnier@cs.yale.edu> + + * macros.c: Don't include keymap.h any more. + +2001-11-01 Richard M. Stallman <rms@gnu.org> + + * data.c (Fmake_local_variable): Doc fix. + + * eval.c (Frun_hooks, Frun_hook_with_args_until_failure): Doc fix. + (Frun_hook_with_args_until_success, Frun_hook_with_args): Doc fix. + + * keymap.c (Fdescribe_buffer_bindings): Print character property + bindings along with or instead of the buffer local map. + Make the overriding maps override what they should. + +2001-11-01 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * window.c (grow_mini_window): Fix typo in comment. + +2001-11-01 Gerd Moellmann <gerd@gnu.org> + + * xterm.c (x_scroll_bar_create): Check for width and height > 0. + (XTset_vertical_scroll_bar): Likewise. + + * xfns.c (x_build_heuristic_mask): Use four_corners_best + instead of IMAGE_BACKGROUND. + + * xfns.c (four_corners_best): Reindent. + + * xfaces.c (Finternal_set_lisp_face_attribute_from_resource): + Handle :box so that it is possible to specify sexprs. + +2001-10-31 Eli Zaretskii <eliz@is.elta.co.il> + + * s/hpux11.h: New file. + +2001-10-31 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * emacs.c (USAGE1): Show command line option --no-window-system + instead of --no-windows in usage. + (standard_args): Rename --no-windows to --no-window-system. + (bug_reporting_address): Follow Emacs coding conventions. + + * eval.c (Fcommandp): Doc fix. + Change doc-string comments to `new style' [w/`doc:' keyword]. + + * frame.c (Fframe_live_p): Doc fix. + + * buffer.c (selective-display-ellipses): Doc fix. + +2001-10-31 Gerd Moellmann <gerd@gnu.org> + + * lread.c (to_multibyte): Fix computation of new read_buffer_size. + + * xfaces.c (realize_x_face): If C is not a single-byte character, + set the face's colors_copied_bitwise_p instead of the defaulted_p + members which have a different meaning. + (free_face_colors): Do nothing for a face whose colors have been + copied bitwise. + + * dispextern.h (struct face) <colors_copied_bitwise_p>: New member. + +2001-10-31 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * marker.c, mocklisp.c: Change doc-string comments to `new style' + [w/`doc:' keyword]. + +2001-10-31 Gerd Moellmann <gerd@gnu.org> + + * fns.c (require_unwind): Return Lisp_Object. + +2001-10-31 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * keyboard.c (lucid-menu-bar-dirty-flag): Doc fix. + (last-input-char): Revert doc-string to be the same as the + doc-string of `last-input-event'. + + * xdisp.c: Fix typos in comments. + +2001-10-31 Gerd Moellmann <gerd@gnu.org> + + * window.c (grow_mini_window): Handle case that the root + window is already smaller than the nominal mininum height. + +2001-10-30 Stefan Monnier <monnier@cs.yale.edu> + + * emacs.c (main): Don't call keys_of_macros any more. + + * lisp.h (keys_of_macros): Remove. + + * macros.c (keys_of_macros): Remove. + + * xfaces.c (Fface_attribute_relative_p): Declare args. + +2001-10-30 Jason Rumney <jasonr@gnu.org> + + * w32fns.c (w32_to_x_charset): Increase size of XLFD charset buffer. + (enum_font_cb2): Ignore fonts with vertical orientation. + +2001-10-30 Richard M. Stallman <rms@gnu.org> + + * keyboard.c (Finput_pending_p): Doc fix. + +2001-10-30 Gerd Moellmann <gerd@gnu.org> + + * xterm.c (x_after_update_window_line): Don't run the code + clearing in borders for rows whose visible height is 0. + + * xdisp.c (clear_garbaged_frames): Redraw the frame only if its + resized_p flag is set. If not set, use the much less flickering + method previously used. + + * dispnew.c (change_frame_size_1): Set frame's resized_p. + + * frame.h (struct frame) <resized_p>: New member. + + * lread.c (to_multibyte): Ensure read_buffer is at least twice + as large as the number of bytes to convert. + + * lread.c (to_multibyte): New function. + (read1): Use it. + +2001-10-30 Eli Zaretskii <eliz@is.elta.co.il> + + * msdos.h (FRAME_LINE_HEIGHT): Define (it's used by xmenu.c). + +2001-10-30 Gerd Moellmann <gerd@gnu.org> + + * xterm.c (x_draw_relief_rect): Correct bottom relief by 1 pixel. + (x_set_glyph_string_background_width): Set extends_to_end_of_line_p + if the row's fill_line_p is set and drawing the last glyph with + DRAW_IMAGE_{RAISED,SUNKEN}. + + * xdisp.c (clear_garbaged_frames): Call Fredraw_frame. + +2001-10-29 Stefan Monnier <monnier@cs.yale.edu> + + * xmenu.c: Include coding.h and charset.h. + (Fx_popup_menu): Use FRAME_PTR and FRAME_FONT and FRAME_LINE_HEIGHT. + (Fx_popup_dialog): Use FRAME_PTR and enum scroll_bar_part. + (single_submenu, xmenu_show): Use ENCODE_SYSTEM. + Explicitly set wv->help. Use `TRUE' rather than `True'. + (menu_help_callback): Use empty_string. + + * w32menu.c (Fx_popup_menu): Explicitly init f, xpos, and ypos. + (Fx_popup_dialog): Explicitly init f. + (w32_menu_display_help): Use empty_string. + +2001-10-29 Richard M. Stallman <rms@gnu.org> + + * fns.c (Frequire): Detect recursive try to require the same + feature 3 or more levels deep, and get error. + (require_unwind): New subroutine. + (require_nesting_list): New variable. + (syms_of_fns): Init and staticpro it. + + * print.c (print_object): Clarify indication of insertion type. + +2001-10-29 Eli Zaretskii <eliz@is.elta.co.il> + + * coding.c (syms_of_coding): Document that locale-coding-system is + used for decoding input on X. + + * window.c (Fscroll_left, Fscroll_right): Doc fix. + +2001-10-29 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * keyboard.c (Finput_pending_p): Fix typo in doc-string. + (echo-area-clear-hook): Properly DEFVAR_LISP and staticpro it. + +2001-10-29 Gerd Moellmann <gerd@gnu.org> + + * xterm.c (x_display_and_set_cursor): If cursor_in_echo_area, + use NO_CURSOR if cursor_in_non_selected_windows is false. + + * xfaces.c (Fface_font): Use UNSPECIFIEDP instead of NILP for + the slant attribute if FRAME is t. + + * xfns.c (x_set_internal_border_width): Set frame garbaged + when X window doesn't exist yet. + + * xterm.c (x_after_update_window_line): Clear internal border + in different circumstances. + + * xterm.c (XTread_socket) <KeyPress>: Don't use + STRING_CHAR_AND_LENGTH if nchars == nbytes. From Kenichi Handa + <handa@etl.go.jp>. + +2001-10-28 Eli Zaretskii <eliz@is.elta.co.il> + + * m/ibms390.h: New file. From Adam Thornton + <athornton@sinenomine.net>. + +2001-10-28 Gerd Moellmann <gerd@gnu.org> + + * xfns.c (x_build_heuristic_mask): Use x_alloc_image_color. + + * xfns.c (x_build_heuristic_mask): Fix a bug not incrementing + a loop counter. + +2001-10-28 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * emacs.c: Use argv[0] instead of "emacs" when -t was specified. + + * keyboard.c: Change doc-string comments to `new style' [w/`doc:' + keyword]. + Fix typos in comments. + + * emacs.c (bug_reporting_address): New function. + Use it when displaying usage message. + + * minibuf.c (read_minibuf): Remove unused external declaration of + variable `Qread_only'. + + * keymap.c (access_keymap): Remove unused variable `charset'. + +2001-10-28 Miles Bader <miles@gnu.org> + + * xfaces.c (merge_face_heights): Handle TO being relative as well. + Remove #ifdef'd-out code. + (Fface_attribute_relative_p, Fmerge_face_attribute): New functions. + (syms_of_xfaces): Initialize them. + +2001-10-27 Jason Rumney <jasonr@gnu.org> + + * w32fns.c (w32_wnd_proc) <WM_KILLFOCUS>: Destroy the system caret. + <WM_EMACS_DESTROY_CARET, WM_EMACS_TRACK_CARET>: Track cursor + position using the system caret. + + * w32term.c (w32_system_caret_hwnd, w32_system_caret_width) + (w32_system_caret_height, w32_system_caret_x) + (w32_system_caret_y): New variables for tracking system caret. + (w32_initialize): Initialize them. + (x_display_and_set_cursor): Make system caret follow the active cursor. + + * w32term.h (WM_EMACS_TRACK_CARET, WM_EMACS_DESTROY_CARET): + New messages types. + + * w32term.c (note_mouse_highlight): Clear old help_echo. + +2001-10-27 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * xterm.c: Fix typo in a comment. + + * emacs.c: Fix typos in comments. + Remove unnecessary spaces. + Change doc-string comments to `new style' [w/`doc:' keyword]. + (USAGE2): Fix typos in usage string. + + * xterm.c: Fix typo in a comment. + + * lisp.h (gdb_lisp_params): Remove code in #if 0 which is now in + emacs.c. + +2001-10-27 Gerd Moellmann <gerd@gnu.org> + + * xdisp.c (move_it_vertically_backward): Use 2/3 line_height + instead of 1/2 line_height in the heuristic for skipping + farther backward when target_y was not reached. + + * sound.c (sound_perror): Unblock SIGIO, turn on atimers. + Display errno only if non-zero. + (sound_warning): New function. + (vox_configure): Don't treat failing to set sample rate as error. + (various places): Improve error messages. + +2001-10-26 Eli Zaretskii <eliz@is.elta.co.il> + + * fileio.c (Faccess_file): Run the argument filename through + Fexpand_file_name, before using it. + + * dispnew.c (syms_of_display) <visible-bell>: Add a reference to + ring-bell-function. Suggested by Alf-Ivar Holm <alfh@ifi.uio.no> + +2001-10-26 Gerd Moellmann <gerd@gnu.org> + + * insdel.c (insert_1_both): Do nothing if NCHARS == 0. + + * xterm.c (XTset_vertical_scroll_bar) [!USE_TOOLKIT_SCROLL_BARS]: + Fix clearing in the case of scroll bars on the right. + +2001-10-26 Juanma Barranquero <lektu@terra.es> + + * w32gui.h (XImage): Add a dummy typedef. + +2001-10-26 Gerd Moellmann <gerd@gnu.org> + + * xfns.c (XScreenNumberOfScreen): Fix struct to pointer comparison. + +2001-10-25 Eli Zaretskii <eliz@is.elta.co.il> + + * frame.c (Fframe_parameter): Fix last change. + + * fileio.c: Revert last change (which removed old commented-out + version of expand-file-name). Add a comment that explains why + this old version should not be removed. + +2001-10-25 Gerd Moellmann <gerd@gnu.org> + + * frame.c (Fframe_parameter): Fix a bug whereby some + ``artificial'' frame parameters, like `minibuffer' were not + obtained by calling Fframe_parameters. + + * xterm.c (show_mouse_face): Clean up. Recognize overwritten + cursor differently. + + * xdisp.c (move_it_vertically_backward): Compute line height + differently. Add heuristic to try to be more compatible to 20.x. + +2001-10-25 Stefan Monnier <monnier@cs.yale.edu> + + * lisp.h (make_fixnum_or_float): Coerce double to int explicitly. + + * editfns.c (text_property_stickiness): Fix Lisp_Object used as + boolean. + +2001-10-25 Miles Bader <miles@gnu.org> + + * xfns.c (png_load): Make sure SPECIFIED_BG is a string. + BG is a pointer to a structure, not a structure. + (gif_format, png_format): Add missing commas. + +2001-10-24 Richard M. Stallman <rms@gnu.org> + + * xfaces.c (Fface_attributes_as_vector): New function. + (syms_of_xfaces): Defsubr it. + +2001-10-24 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * dispnew.c (sync_window_with_frame_matrix_rows): Remove unused + variable `area'. + +2001-10-25 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * search.c (scan_newline): Remove unused variable `selective_display'. + +2001-10-25 Miles Bader <miles@gnu.org> + + * dispextern.h (struct image): Add `background', + `background_valid', and `background_transparent' fields. + (image_background, image_background_transparent): New declarations. + (IMAGE_BACKGROUND, IMAGE_BACKGROUND_TRANSPARENT): New macros. + * xfns.c (image_background, image_background_transparent) + (four_corners_best): New functions. + (xpm_format, png_format, jpeg_format, tiff_format, gif_format) + (gs_format): Add `:background' entry. + (lookup_image): Set IMG's background color if specified. + (pbm_load, xbm_load_image, png_load): Set IMG's background field + when appropriate. + (x_clear_image_1): Reset `background_valid' and + `background_transparent_valid' fields. + (x_build_heuristic_mask): Use IMAGE_BACKGROUND instead of + calculating it here. Set IMG's background_transparent field. + (enum xpm_keyword_index): Add XPM_BACKGROUND. + (enum png_keyword_index): Add PNG_BACKGROUND. + (enum jpeg_keyword_index): Add JPEG_BACKGROUND. + (enum tiff_keyword_index): Add TIFF_BACKGROUND. + (enum gif_keyword_index): Add GIF_BACKGROUND. + (enum gs_keyword_index): Add GS_BACKGROUND. + (pbm_load, png_load, jpeg_load, tiff_load, gif_load): + Pre-calculate image background color where necessary. + * xterm.c (x_setup_relief_colors): Use `IMAGE_BACKGROUND' and + `IMAGE_BACKGROUND_TRANSPARENT' to calculate the correct background + color to use for image glyph reliefs. + +2001-10-24 Gerd Moellmann <gerd@gnu.org> + + * xterm.c (x_draw_glyphs): Don't check for cursor overwriting + in full-width rows. + + * xterm.c (XTset_vertical_scroll_bar) [!USE_TOOLKIT_SCROLL_BARS]: + Fix clearing of area not covered by scroll bar. + +2001-10-24 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * xterm.c (x_insert_glyphs): Remove unused variables `real_end' + and `real_start'. + (x_draw_image_foreground): Remove unused variables `mask' and `xgcv'. + (glyph_rect): Remove unused variable `area'. + +2001-10-24 Gerd Moellmann <gerd@gnu.org> + + * xdisp.c: Change #ifdef GLYPH_DEBUG to #if. + + * xdisp.c (try_window_reusing_current_matrix): Use row_containing_pos. + (row_containing_pos): Take additional argument DY. + Treat rows ending in middle of char differently. + (display_line): Handle tabs on window systems differently. + + * xterm.c, w32term.c (fast_find_position): Call row_containing_pos + with additional argument. + + * dispextern.h (row_containing_pos): Adjust prototype. + + * xdisp.c (inhibit_try_window_id, inhibit_try_window_reusing) + (inhibit_try_cursor_movement) [GLYPH_DEBUG]: New variables. + (try_window_id, try_window_reusing_current_matrix) + (try_cursor_movement) [GLYPH_DEBUG]: Don't run if inhibited. + (syms_of_xdisp) [GLYPH_DEBUG]: DEFVAR_BOOL the variables. + +2001-10-24 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * xmenu.c: Spell the name of Emacs properly (GNU Emacs instead of + gnuemacs). + (HAVE_BOXES): Fix typo in comment. + (push_menu_pane): Fix typo in comment. + + * xdisp.c (display_prop_string_p): Remove unused local declaration + of `Qwhen'. + (single_display_prop_string_p): Remove unused local declarations + of `Qwhen' and `Qmargin'. + (string_buffer_position): Remove unused variable `around'. + (store_frame_title): Remove unused variable `width'. + + * window.c: Don't define max. + (coordinates_in_window): Remove unused variable `uy'. + + * widget.c: Don't define max. + + * process.c: Don't define max. + (create_process): Remove unused variable `buffer'. + +2001-10-23 Gerd Moellmann <gerd@gnu.org> + + * xfaces.c (Finternal_set_lisp_face_attribute): Fix compilation error. + +2001-10-23 Eli Zaretskii <eliz@is.elta.co.il> + + * xfaces.c (Finternal_set_lisp_face_attribute) + [HAVE_WINDOW_SYSTEM]: Don't do anything for QCfont unless the + frame is on a windowed display. + +2001-10-23 Gerd Moellmann <gerd@gnu.org> + + * dispnew.c (sync_window_with_frame_matrix_rows): + Fix handling of windows which aren't full-width, fix handling + of marginal areas. + + * lread.c (syms_of_lread) <recursive-load-depth-limit>: Raise to 50. + +2001-10-23 Andreas Schwab <schwab@suse.de> + + * m/macppc.h [LINUX]: Undef LD_SWITCH_SYSTEM_TEMACS and override + LD_SWITCH_MACHINE_TEMACS with "-Xlinker -znocombreloc". + +2001-10-23 Gerd Moellmann <gerd@gnu.org> + + * xterm.c (x_draw_glyphs): Remove parameters READ_START and + REAL_END. Notice if cursor gets overwritten. + (notice_overwritten_cursor): Take X positions as parameters. + (x_draw_phys_cursor_glyph): Save state of w->phys_cursor_on_p + around call to x_draw_glyphs. + +2001-10-23 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * syntax.c (modify-syntax-entry): Fix argument names (use CHAR + instead of C) and usage. + + * editfns.c (char-to-string): Fix argument names (use CHAR instead + of C) and usage. + + * xfns.c (Fx_show_tip): Remove unused variables `buffer', `top', + `left', `max_width' and `max_height'. + +2001-10-23 Gerd Moellmann <gerd@gnu.org> + + * xdisp.c (display_line): For a tab continued to the next line, + set row's ends_in_middle_of_char_p. + +2001-10-22 Gerd Moellmann <gerd@gnu.org> + + * xdisp.c (display_line): Fix computation of continuation lines + width for TABs. + +2001-10-22 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * xdisp.c (build_desired_tool_bar_string): Remove unused variable + `Qlaplace'. + + * fileio.c: Remove unused code. + +2001-10-22 Miles Bader <miles@gnu.org> + + * lisp.h (DEFVAR_LISP, DEFVAR_LISP_NOPRO, DEFVAR_BOOL) + (DEFVAR_INT, DEFVAR_PER_BUFFER, DEFVAR_KBOARD): + Remove `DOC_STRINGS_IN_COMMENTS' cases. + +2001-10-21 Jason Rumney <jasonr@gnu.org> + + * w32term.c (x_erase_phys_cursor): Remove inverse_p again. + +2001-10-21 Eli Zaretskii <eliz@is.elta.co.il> + + * mocklisp.c (Fml_if, Fml_provide_prefix_argument) + (Finsert_string): Avoid the multi-line string literals warning. + +2001-10-22 Miles Bader <miles@gnu.org> + + * doc.c (Vhelp_manyarg_func_alist): Variable removed. + (Fdocumentation): Don't use it. + (syms_of_doc): Don't initialize it. + + * keyboard.c (Ftrack_mouse): Add usage: string to doc string. + * print.c (Fwith_output_to_temp_buffer): Likewise. + * window.c (Fsave_window_excursion): Likewise. + * editfns.c (Fsave_excursion, Fsave_current_buffer) + (Fsave_restriction): Likewise. + * eval.c (Frun_hooks, Frun_hook_with_args) + (Frun_hook_with_args_until_failure) + (Frun_hook_with_args_until_success, Ffuncall, For, Fand, Fif) + (Fcond, Fprogn, Fprog1, Fprog2, Fsetq, Fquote, Ffunction, Fdefun) + (Fdefmacro, Fdefvar, Fdefconst, FletX, Flet, Fwhile, Fcatch) + (Funwind_protect, Fcondition_case): Likewise. + * coding.c (Ffind_operation_coding_system): Likewise. + * keyboard.c (Ftrack_mouse): Likewise. + +2001-10-21 Miles Bader <miles@gnu.org> + + * fns.c (Fappend, Fconcat, Fvconcat, Fnconc, Fwidget_apply) + (Fmake_hash_table): Add usage: string to doc string. + * editfns.c (Finsert, Finsert_and_inherit, Finsert_before_markers) + (Fmessage, Fmessage_box, Fmessage_or_box, Fpropertize, Fformat) + (Fencode_time, Finsert_and_inherit_before_markers): Likewise. + * mocklisp.c (Finsert_string, Fml_if, Fml_provide_prefix_argument) + (Fml_prefix_argument_loop): Likewise. + +2001-10-21 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * fileio.c (Finsert_file_contents): Remove unused variable `gap_size'. + + * sysdep.c (init_sys_modes): Change doc-string comments to `new + style' [w/`doc:' keyword]. + + * data.c, fileio.c, indent.c, print.c, search.c, sound.c, + * sunfns.c, textprop.c, undo.c, xselect.c: Change doc-string + comments to `new style' [w/`doc:' keyword]. + +2001-10-21 Jason Rumney <jasonr@gnu.org> + + * w32fns.c (Fx_file_dialog): Pass a filter to GetOpenFileName. + + * w32term.c (remember_mouse_glyph): New function. + (w32_mouse_position): Use it. + (note_mouse_movement): If the mouse moved off the glyph, remember + its new position. + + * w32term.h (struct w32_output): Correct spelling of x_compatible. + (w32_display_info): Add mouse_face_overlay. + + * w32term.c (notice_overwritten_cursor): Renamed from + note_overwritten_text_cursor. Rewritten to take glyph widths into + account. + (x_y_to_hpos_vpos): Add parameter BUFFER_ONLY_P. + (fast_find_string_pos): New function. + (fast_find_position): Return the correct vpos. Add parameter + STOP. In the final row, stop before glyphs having STOP as object. + Don't consider glyphs that are not from a buffer. + (fast_find_position) [0]: Add a presumably more correct version + for after 21.1. + (expose_window_tree, expose_frame): Don't compute intersections here. + (expose_window): Do it here instead. + (expose_window_tree, expose_window, expose_line): Return 1 when + overwriting mouse-face. + (expose_window): If W is the window currently being updated, mark + the frame garbaged. + (expose_frame): If mouse-face was overwritten, redo it. + (x_use_underline_position_properties): New variable. + (syms_of_xterm): DEFVAR_BOOL it. + (x_draw_glyph_string): Add comment to use it in future. + (x_draw_glyph_string): Restore clipping after drawing box. + Fix a computation of the underline position. + (w32_get_glyph_string_clip_rect): Minor cleanup. + (x_fill_stretch_glyph_string): Remove an assertion. + (x_produce_glyphs): Don't convert multibyte characters + to unibyte characters in unibyte buffers. + (cursor_in_mouse_face_p): New function. + (x_draw_stretch_glyph_string): Use it to choose a different GC + when drawing a cursor within highlighted text. Don't draw + background again if it has already been drawn. + (x_draw_glyph_string_box): Don't draw a full-width + box just because the glyph row's full_width_p flag is set. + (x_draw_glyphs): Fix computation of rightmost x for + full-width rows. + (x_dump_glyph_string): Put in #if GLYPH_DEBUG. + (w32_draw_relief_rect): Extend left shadow to the bottom and left; + change bottom shadow accordingly. Some cleanup. + (x_update_window_end): Handle overwritten mouse face + also for tool bar windows. + (show_mouse_face): Set the glyph row's mouse_face_p flag also when + DRAW is DRAW_IMAGE_RAISED. + (clear_mouse_face): Return 1 if text with mouse face was + actually redrawn. Make the function static. + Reset dpyinfo->mouse_face_overlay otherwise note_mouse_highlight might + optimize away highlighting if we pass over that same overlay again. + (note_mouse_highlight): Call mouse_face_overlay_overlaps + to detect a case where we have to highlight a different region + despite not having left the currently highlighted region. + Set mouse_face_overlay in the x_display_info. Avoid changing the + mouse pointer shape when show_mouse_face has already done it, or + there is no need. Handle mouse-face and help-echo in strings. + (glyph_rect): New function. + (w32_mouse_position): Use it to raise the threshold for mouse + movement event generation. + (w32_initialize_display_info): Initialize the x_display_info's + mouse_face_overlay. + (w32_set_vertical_scroll_bar): Don't clear a zero height + or width area. + (w32_set_vertical_scroll_bar, x_scroll_bar_create): Don't configure + a widget to zero height. + + * w32menu.c (single_submenu, w32_menu_show) [!HAVE_MULTILINGUAL_MENU]: + Protect unibyte strings created by replacing their multibyte + equivalents in menu_items. + (w32_menu_show): Don't overwrite an item's name with its key + description in case the description is a multibyte string. + (single_submenu): Some cleanup. + + * w32fns.c (x_laplace_read_row, x_laplace_write_row): Removed. + (postprocess_image): New function. + (lookup_image): Call it for all image types except PostScript. + (x_kill_gs_process): Call postprocess_image. + (tiff_error_handler, tiff_warning_handler): New functions. + (tiff_load): Install them as handlers. + (x_kill_gs_process): Recognize if someone has cleared the image + cache under us. + (valid_image_p): Protect better against invalid image + specifications. Previous code could signal an error. + (Fx_hide_tip, Fshow_tip): Doc fix. + (Fv_max_tooltip_size): New variable. + (syns_of_xfns): DEFVAR_LISP it. + (Fx_show_tip): Add parameter TEXT. Set the tip frame's root + window buffer to *tip* right after creating the frame. Set frame's + window_width. Use a maximum tooltip size specified by + Vx_max_tooltip_size, if that has valid contents. + (compute_tip_xy): Add parameters WIDTH and HEIGHT. + Make sure the tooltip is completely visible. + (x_create_tip_frame): Set tooltip buffer's truncate-lines to nil. + (Fx_create_frame): Adjust the frame's height for presence + of the tool bar before calling x_figure_window_size. + (x_set_tool_bar_lines): Clear the tool bar window's current matrix + when the window gets smaller. + (x_set_foreground_color): Set frame's cursor_pixel. + (x_set_foreground_color, x_set_background_color): Cleaned up. + (x_set_font): Handle case of x_new_fontset returning the same name + as before, although there was a change in fontsets. + +2001-10-21 Miles Bader <miles@gnu.org> + + * data.c (Fplus, Fminus, Fmax, Ftimes, Fquo, Flogand, Flogior) + (Flogxor): Add usage: string to doc string. + * charset.c (Fstring): Likewise. + * callproc.c (Fcall_process_region, Fcall_process): Likewise. + * alloc.c (Fmake_byte_code, Fvector, Flist): Likewise. + +2001-10-21 Pavel Jan,Am(Bk <Pavel@Janik.cz> + + * buffer.c: Reindent DEFUNs and DEFVARs with doc: keywords. + + * alloc.c: Reindent DEFUNs with doc: keywords. + + * abbrev.c (Finsert_abbrev_table_description): Reindent. + + * frame.c: Change doc-string comments to `new style' [w/`doc:' + keyword]. + +See ChangeLog.9 for earlier changes. + +;; Local Variables: +;; coding: iso-2022-7bit +;; add-log-time-zone-rule: t +;; End: + + Copyright (C) 2001, 2002, 2003, 2004, 2005, + 2006, 2007 Free Software Foundation, Inc. + + This file is part of GNU Emacs. + + GNU Emacs is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + GNU Emacs is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Emacs; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. + +;;; arch-tag: 5dcc435f-4038-4141-b3bf-5be51cd76bd4 diff --git a/src/Makefile.in b/src/Makefile.in index 217e9846e23..f968fcf4599 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -76,12 +76,6 @@ SHELL=/bin/sh #define NOT_C_CODE #include "config.h" -/* We will not really call alloca; - do not let the file name alloca.c get messed up. */ -#ifdef alloca -#undef alloca -#endif - /* Do not let the file name mktime.c get messed up. */ #ifdef mktime #undef mktime @@ -613,7 +607,7 @@ FONTOBJ = font.o whose initialized data areas should be dumped as pure by dump-emacs. */ obj= dispnew.o frame.o scroll.o xdisp.o $(XMENU_OBJ) window.o \ charset.o coding.o category.o ccl.o character.o chartab.o \ - cm.o term.o xfaces.o $(XOBJ) $(GTK_OBJ)\ + cm.o term.o terminal.o xfaces.o $(XOBJ) $(GTK_OBJ)\ emacs.o keyboard.o macros.o keymap.o sysdep.o \ buffer.o filelock.o insdel.o marker.o \ minibuf.o fileio.o dired.o filemode.o \ @@ -668,12 +662,6 @@ mallocobj = $(gmallocobj) $(rallocobj) vm-limit.o #endif /* SYSTEM_MALLOC */ -#ifndef HAVE_ALLOCA -allocaobj = alloca.o -#else -allocaobj = -#endif - #ifdef USE_X_TOOLKIT widgetobj= widget.o #else /* not USE_X_TOOLKIT */ @@ -685,9 +673,9 @@ widgetobj= should not be told about. */ #ifdef CYGWIN /* Cygwin differs because of its unexec(). */ -otherobj= $(termcapobj) $(gmallocobj) $(rallocobj) lastfile.o vm-limit.o $(allocaobj) $(widgetobj) $(LIBOBJS) +otherobj= $(termcapobj) $(gmallocobj) $(rallocobj) lastfile.o vm-limit.o $(widgetobj) $(LIBOBJS) #else -otherobj= $(termcapobj) lastfile.o $(mallocobj) $(allocaobj) $(widgetobj) $(LIBOBJS) +otherobj= $(termcapobj) lastfile.o $(mallocobj) $(widgetobj) $(LIBOBJS) #endif #ifdef HAVE_MOUSE @@ -946,7 +934,9 @@ SOME_MACHINE_LISP = ${dotdot}/lisp/mouse.elc \ ${dotdot}/lisp/x-dnd.elc \ ${dotdot}/lisp/international/ccl.elc \ ${dotdot}/lisp/international/codepage.elc \ - ${dotdot}/lisp/international/fontset.elc + ${dotdot}/lisp/international/fontset.elc \ + ${dotdot}/lisp/mouse.elc \ + ${dotdot}/lisp/term/x-win.elc /* Construct full set of libraries to be linked. Note that SunOS needs -lm to come before -lc; otherwise, you get @@ -1106,12 +1096,6 @@ stamp-oldxmenu: @echo "Please run the `configure' script again." exit 1 -/* Some machines have alloca built-in. - They should define HAVE_ALLOCA. - Some use the C version in alloca.c (these define C_ALLOCA in config.h). - */ -alloca.o: alloca.c blockinput.h atimer.h systime.h - /* Nearly all the following files depend on lisp.h, but it is not included as a dependency because it is so often changed in ways that do not require any recompilation @@ -1126,7 +1110,7 @@ callint.o: callint.c window.h commands.h buffer.h keymap.h \ keyboard.h dispextern.h $(config_h) callproc.o: callproc.c epaths.h buffer.h commands.h $(config_h) \ process.h systty.h syssignal.h character.h coding.h ccl.h msdos.h \ - composite.h w32.h blockinput.h atimer.h systime.h + composite.h w32.h blockinput.h atimer.h systime.h frame.h termhooks.h casefiddle.o: casefiddle.c syntax.h commands.h buffer.h character.h \ composite.h \ charset.h keymap.h $(config_h) @@ -1140,8 +1124,8 @@ charset.o: charset.c charset.h character.h buffer.h coding.h composite.h \ disptab.h $(config_h) chartab.o: charset.h character.h $(config.h) coding.o: coding.c coding.h ccl.h buffer.h character.h charset.h intervals.h composite.h \ - window.h dispextern.h $(config_h) -cm.o: cm.c cm.h termhooks.h $(config_h) + window.h dispextern.h frame.h termhooks.h $(config_h) +cm.o: cm.c frame.h cm.h termhooks.h termchar.h $(config_h) cmds.o: cmds.c syntax.h buffer.h character.h commands.h window.h $(config_h) \ msdos.h dispextern.h keyboard.h keymap.h pre-crt0.o: pre-crt0.c @@ -1171,13 +1155,13 @@ filelock.o: filelock.c buffer.h character.h charset.h coding.h systime.h \ filemode.o: filemode.c $(config_h) frame.o: frame.c xterm.h window.h frame.h termhooks.h commands.h keyboard.h \ blockinput.h atimer.h systime.h buffer.h character.h fontset.h \ - msdos.h dosfns.h dispextern.h w32term.h macterm.h $(config_h) -fringe.o: fringe.c dispextern.h frame.h window.h buffer.h $(config_h) + msdos.h dosfns.h dispextern.h w32term.h macterm.h termchar.h $(config_h) +fringe.o: fringe.c dispextern.h frame.h window.h buffer.h termhook.h $(config_h) font.o: font.c dispextern.h frame.h window.h ccl.h character.h charset.h \ font.h $(config_h) ftfont.o: dispextern.h frame.h character.h charset.h font.h $(config_h) fontset.o: dispextern.h fontset.h fontset.c ccl.h buffer.h character.h \ - charset.h frame.h keyboard.h $(FONTSRC) $(config_h) + charset.h frame.h keyboard.h termhooks.h $(FONTSRC) $(config_h) getloadavg.o: getloadavg.c $(config_h) image.o: image.c frame.h window.h dispextern.h blockinput.h atimer.h \ systime.h xterm.h w32term.h w32gui.h macterm.h macgui.h $(config_h) @@ -1188,7 +1172,7 @@ insdel.o: insdel.c window.h buffer.h $(INTERVAL_SRC) blockinput.h character.h \ dispextern.h atimer.h systime.h region-cache.h $(config_h) keyboard.o: keyboard.c termchar.h termhooks.h termopts.h buffer.h character.h \ commands.h frame.h window.h macros.h disptab.h keyboard.h syssignal.h \ - systty.h systime.h dispextern.h syntax.h $(INTERVAL_SRC) blockinput.h \ + systime.h dispextern.h syntax.h $(INTERVAL_SRC) blockinput.h \ atimer.h xterm.h puresize.h msdos.h keymap.h w32term.h macterm.h $(config_h) keymap.o: keymap.c buffer.h commands.h keyboard.h termhooks.h blockinput.h \ atimer.h systime.h puresize.h character.h intervals.h keymap.h window.h \ @@ -1203,7 +1187,8 @@ vm-limit.o: vm-limit.c mem-limits.h $(config_h) marker.o: marker.c buffer.h character.h $(config_h) md5.o: md5.c md5.h $(config_h) minibuf.o: minibuf.c syntax.h dispextern.h frame.h window.h keyboard.h \ - buffer.h commands.h character.h msdos.h $(INTERVAL_SRC) keymap.h $(config_h) + buffer.h commands.h character.h msdos.h $(INTERVAL_SRC) keymap.h \ + terhooks.h $(config_h) mktime.o: mktime.c $(config_h) msdos.o: msdos.c msdos.h dosfns.h systime.h termhooks.h dispextern.h frame.h \ termopts.h termchar.h character.h coding.h ccl.h disptab.h window.h \ @@ -1216,7 +1201,7 @@ regex.o: regex.c syntax.h buffer.h $(config_h) regex.h category.h character.h \ charset.h region-cache.o: region-cache.c buffer.h region-cache.h $(config_h) scroll.o: scroll.c termchar.h dispextern.h frame.h msdos.h keyboard.h \ - $(config_h) + termhooks.h $(config_h) search.o: search.c regex.h commands.h buffer.h region-cache.h syntax.h \ blockinput.h atimer.h systime.h category.h character.h charset.h \ composite.h $(INTERVAL_SRC) \ @@ -1226,11 +1211,13 @@ syntax.o: syntax.c syntax.h buffer.h commands.h category.h character.h \ composite.h keymap.h regex.h $(INTERVAL_SRC) $(config_h) sysdep.o: sysdep.c syssignal.h systty.h systime.h syswait.h blockinput.h \ process.h dispextern.h termhooks.h termchar.h termopts.h \ - frame.h atimer.h window.h msdos.h dosfns.h keyboard.h $(config_h) + frame.h atimer.h window.h msdos.h dosfns.h keyboard.h cm.h $(config_h) term.o: term.c termchar.h termhooks.h termopts.h $(config_h) cm.h frame.h \ disptab.h dispextern.h keyboard.h character.h charset.h coding.h ccl.h \ msdos.h window.h keymap.h blockinput.h atimer.h systime.h termcap.o: termcap.c $(config_h) +terminal.o: terminal.c frame.h termchar.h termhooks.h charset.h coding.h \ + keyboard.h $(config_h) terminfo.o: terminfo.c $(config_h) tparam.o: tparam.c $(config_h) undo.o: undo.c buffer.h commands.h window.h $(config_h) @@ -1243,7 +1230,7 @@ w16select.o: w16select.c dispextern.h frame.h blockinput.h atimer.h systime.h \ widget.o: widget.c xterm.h frame.h dispextern.h widgetprv.h \ $(srcdir)/../lwlib/lwlib.h $(config_h) window.o: window.c indent.h commands.h frame.h window.h buffer.h termchar.h \ - termhooks.h disptab.h keyboard.h dispextern.h msdos.h composite.h \ + disptab.h keyboard.h dispextern.h msdos.h composite.h \ keymap.h blockinput.h atimer.h systime.h $(INTERVAL_SRC) \ xterm.h w32term.h macterm.h $(config_h) xdisp.o: xdisp.c macros.h commands.h process.h indent.h buffer.h dispextern.h \ @@ -1254,11 +1241,11 @@ xdisp.o: xdisp.c macros.h commands.h process.h indent.h buffer.h dispextern.h \ xfaces.o: xfaces.c dispextern.h frame.h xterm.h buffer.h blockinput.h \ window.h character.h charset.h msdos.h dosfns.h composite.h atimer.h \ systime.h keyboard.h fontset.h w32term.h macterm.h $(INTERVAL_SRC) \ - $(FONTSRC) $(config_h) + termchar.h termhooks.h $(FONTSRC) $(config_h) xfns.o: xfns.c buffer.h frame.h window.h keyboard.h xterm.h dispextern.h \ $(srcdir)/../lwlib/lwlib.h blockinput.h atimer.h systime.h epaths.h \ character.h charset.h coding.h gtkutil.h $(config_h) termhooks.h \ - fontset.h $(FONTSRC) + fontset.h termchar.h $(FONTSRC) xfont.o: dispextern.h xterm.h frame.h blockinput.h character.h charset.h \ font.h $(config_h) xftfont.o: dispextern.h xterm.h frame.h blockinput.h character.h charset.h \ @@ -1273,7 +1260,7 @@ xterm.o: xterm.c xterm.h termhooks.h termopts.h termchar.h window.h buffer.h \ keyboard.h gnu.h character.h charset.h ccl.h fontset.h composite.h \ coding.h process.h gtkutil.h $(FONTSRC) $(config_h) xselect.o: xselect.c process.h dispextern.h frame.h xterm.h blockinput.h \ - buffer.h atimer.h systime.h $(config_h) + buffer.h atimer.h systime.h termhooks.h $(config_h) xrdb.o: xrdb.c $(config_h) epaths.h xsmfns.o: xsmfns.c $(config_h) systime.h sysselect.h termhooks.h xterm.h \ lisp.h termopts.h @@ -1293,13 +1280,13 @@ alloc.o: alloc.c process.h frame.h window.h buffer.h puresize.h syssignal.h key bytecode.o: bytecode.c buffer.h syntax.h character.h window.h dispextern.h \ frame.h xterm.h $(config_h) data.o: data.c buffer.h puresize.h character.h syssignal.h keyboard.h frame.h \ - $(config_h) + termhooks.h $(config_h) eval.o: eval.c commands.h keyboard.h blockinput.h atimer.h systime.h \ dispextern.h $(config_h) floatfns.o: floatfns.c $(config_h) fns.o: fns.c commands.h $(config_h) frame.h buffer.h character.h keyboard.h \ keymap.h frame.h window.h dispextern.h $(INTERVAL_SRC) coding.h md5.h \ - blockinput.h atimer.h systime.h xterm.h + blockinput.h atimer.h systime.h xterm.h termhooks.h print.o: print.c process.h frame.h window.h buffer.h keyboard.h character.h \ $(config_h) dispextern.h termchar.h $(INTERVAL_SRC) msdos.h composite.h \ blockinput.h atimer.h systime.h @@ -1318,12 +1305,12 @@ composite.o: composite.c buffer.h character.h $(INTERVAL_SRC) $(config_h) OTHER_FILES and OBJECTS_MACHINE select which of these should be compiled. */ -sunfns.o: sunfns.c buffer.h window.h dispextern.h $(config_h) +sunfns.o: sunfns.c buffer.h window.h dispextern.h termhooks.h $(config_h) #ifdef HAVE_CARBON abbrev.o buffer.o callint.o cmds.o dispnew.o editfns.o fileio.o frame.o \ fontset.o indent.o insdel.o keyboard.o macros.o minibuf.o msdos.o process.o \ - scroll.o sysdep.o term.o widget.o window.o xdisp.o xfaces.o xfns.o xmenu.o \ + scroll.o sysdep.o term.o terminal.o widget.o window.o xdisp.o xfaces.o xfns.o xmenu.o \ xterm.o xselect.o sound.o: macgui.h mac.o: mac.c process.h sysselect.h blockinput.h atimer.h systime.h charset.h \ coding.h ccl.h $(config_h) @@ -1364,8 +1351,6 @@ ${emacsapp}Contents/MacOS/Emacs: emacs${EXEEXT} cd ${emacsapp}Contents/MacOS/; cp ../../../../src/emacs${EXEEXT} Emacs${EXEEXT} #endif -${libsrc}emacstool${EXEEXT}: ${libsrc}emacstool.c - cd ${libsrc}; ${MAKE} ${MFLAGS} emacstool${EXEEXT} bootstrapclean: rm -f bootstrap-emacs${EXEEXT} emacs-${version}${EXEEXT} mostlyclean: @@ -1391,17 +1376,6 @@ versionclean: extraclean: distclean -rm -f *~ \#* m/?*~ s/?*~ -/* The rule for the [sm] files has to be written a little funny to - avoid looking like a C comment to CPP. */ -SOURCES = *.[ch] [sm]/?* COPYING Makefile.in \ - config.in epaths.in README COPYING ChangeLog vms.pp-trans -unlock: - chmod u+w $(SOURCES) - -relock: - chmod -w $(SOURCES) - chmod +w epaths.h - /* Arrange to make a tags table TAGS-LISP for ../lisp, plus TAGS for the C files, which includes ../lisp/TAGS by reference. */ diff --git a/src/abbrev.c b/src/abbrev.c index a58c4ecbfb9..bed7f73d1c3 100644 --- a/src/abbrev.c +++ b/src/abbrev.c @@ -775,9 +775,6 @@ Calling `expand-abbrev' sets this to nil. */); Trying to expand an abbrev in any other buffer clears `abbrev-start-location'. */); Vabbrev_start_location_buffer = Qnil; - DEFVAR_PER_BUFFER ("local-abbrev-table", ¤t_buffer->abbrev_table, Qnil, - doc: /* Local (mode-specific) abbrev table of current buffer. */); - DEFVAR_BOOL ("abbrevs-changed", &abbrevs_changed, doc: /* Set non-nil by defining or altering any word abbrevs. This causes `save-some-buffers' to offer to save the abbrevs. */); diff --git a/src/alloc.c b/src/alloc.c index 2e88afc00ac..fccdf2a88a7 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -55,6 +55,7 @@ Boston, MA 02110-1301, USA. */ #include "blockinput.h" #include "character.h" #include "syssignal.h" +#include "termhooks.h" /* For struct terminal. */ #include <setjmp.h> /* GC_MALLOC_CHECK defined means perform validity checks of malloc'd @@ -341,7 +342,9 @@ Lisp_Object Vgc_elapsed; /* accumulated elapsed time in GC */ EMACS_INT gcs_done; /* accumulated GCs */ static void mark_buffer P_ ((Lisp_Object)); +static void mark_terminals P_ ((void)); extern void mark_kboards P_ ((void)); +extern void mark_ttys P_ ((void)); extern void mark_backtrace P_ ((void)); static void gc_sweep P_ ((void)); static void mark_glyph_matrix P_ ((struct glyph_matrix *)); @@ -373,14 +376,11 @@ enum mem_type MEM_TYPE_MISC, MEM_TYPE_SYMBOL, MEM_TYPE_FLOAT, - /* Keep the following vector-like types together, with - MEM_TYPE_WINDOW being the last, and MEM_TYPE_VECTOR the - first. Or change the code of live_vector_p, for instance. */ - MEM_TYPE_VECTOR, - MEM_TYPE_PROCESS, - MEM_TYPE_HASH_TABLE, - MEM_TYPE_FRAME, - MEM_TYPE_WINDOW + /* We used to keep separate mem_types for subtypes of vectors such as + process, hash_table, frame, terminal, and window, but we never made + use of the distinction, so it only caused source-code complexity + and runtime slowdown. Minor but pointless. */ + MEM_TYPE_VECTORLIKE }; static POINTER_TYPE *lisp_align_malloc P_ ((size_t, enum mem_type)); @@ -467,7 +467,7 @@ static struct mem_node mem_z; #define MEM_NIL &mem_z static POINTER_TYPE *lisp_malloc P_ ((size_t, enum mem_type)); -static struct Lisp_Vector *allocate_vectorlike P_ ((EMACS_INT, enum mem_type)); +static struct Lisp_Vector *allocate_vectorlike P_ ((EMACS_INT)); static void lisp_free P_ ((POINTER_TYPE *)); static void mark_stack P_ ((void)); static int live_vector_p P_ ((struct mem_node *, void *)); @@ -743,6 +743,15 @@ overrun_check_free (block) #define free overrun_check_free #endif +#ifdef SYNC_INPUT +/* When using SYNC_INPUT, we don't call malloc from a signal handler, so + there's no need to block input around malloc. */ +#define MALLOC_BLOCK_INPUT ((void)0) +#define MALLOC_UNBLOCK_INPUT ((void)0) +#else +#define MALLOC_BLOCK_INPUT BLOCK_INPUT +#define MALLOC_UNBLOCK_INPUT UNBLOCK_INPUT +#endif /* Like malloc but check for no memory and block interrupt input.. */ @@ -752,9 +761,9 @@ xmalloc (size) { register POINTER_TYPE *val; - BLOCK_INPUT; + MALLOC_BLOCK_INPUT; val = (POINTER_TYPE *) malloc (size); - UNBLOCK_INPUT; + MALLOC_UNBLOCK_INPUT; if (!val && size) memory_full (); @@ -771,14 +780,14 @@ xrealloc (block, size) { register POINTER_TYPE *val; - BLOCK_INPUT; + MALLOC_BLOCK_INPUT; /* We must call malloc explicitly when BLOCK is 0, since some reallocs don't do this. */ if (! block) val = (POINTER_TYPE *) malloc (size); else val = (POINTER_TYPE *) realloc (block, size); - UNBLOCK_INPUT; + MALLOC_UNBLOCK_INPUT; if (!val && size) memory_full (); return val; @@ -791,9 +800,9 @@ void xfree (block) POINTER_TYPE *block; { - BLOCK_INPUT; + MALLOC_BLOCK_INPUT; free (block); - UNBLOCK_INPUT; + MALLOC_UNBLOCK_INPUT; /* We don't call refill_memory_reserve here because that duplicates doing so in emacs_blocked_free and the criterion should go there. */ @@ -844,7 +853,7 @@ lisp_malloc (nbytes, type) { register void *val; - BLOCK_INPUT; + MALLOC_BLOCK_INPUT; #ifdef GC_MALLOC_CHECK allocated_mem_type = type; @@ -874,7 +883,7 @@ lisp_malloc (nbytes, type) mem_insert (val, (char *) val + nbytes, type); #endif - UNBLOCK_INPUT; + MALLOC_UNBLOCK_INPUT; if (!val && nbytes) memory_full (); return val; @@ -887,12 +896,12 @@ static void lisp_free (block) POINTER_TYPE *block; { - BLOCK_INPUT; + MALLOC_BLOCK_INPUT; free (block); #if GC_MARK_STACK && !defined GC_MALLOC_CHECK mem_delete (mem_find (block)); #endif - UNBLOCK_INPUT; + MALLOC_UNBLOCK_INPUT; } /* Allocation of aligned blocks of memory to store Lisp data. */ @@ -993,7 +1002,7 @@ lisp_align_malloc (nbytes, type) eassert (nbytes <= BLOCK_BYTES); - BLOCK_INPUT; + MALLOC_BLOCK_INPUT; #ifdef GC_MALLOC_CHECK allocated_mem_type = type; @@ -1025,7 +1034,7 @@ lisp_align_malloc (nbytes, type) if (base == 0) { - UNBLOCK_INPUT; + MALLOC_UNBLOCK_INPUT; memory_full (); } @@ -1051,7 +1060,7 @@ lisp_align_malloc (nbytes, type) { lisp_malloc_loser = base; free (base); - UNBLOCK_INPUT; + MALLOC_UNBLOCK_INPUT; memory_full (); } } @@ -1084,7 +1093,7 @@ lisp_align_malloc (nbytes, type) mem_insert (val, (char *) val + nbytes, type); #endif - UNBLOCK_INPUT; + MALLOC_UNBLOCK_INPUT; if (!val && nbytes) memory_full (); @@ -1099,7 +1108,7 @@ lisp_align_free (block) struct ablock *ablock = block; struct ablocks *abase = ABLOCK_ABASE (ablock); - BLOCK_INPUT; + MALLOC_BLOCK_INPUT; #if GC_MARK_STACK && !defined GC_MALLOC_CHECK mem_delete (mem_find (block)); #endif @@ -1132,7 +1141,7 @@ lisp_align_free (block) #endif free (ABLOCKS_BASE (abase)); } - UNBLOCK_INPUT; + MALLOC_UNBLOCK_INPUT; } /* Return a new buffer structure allocated from the heap with @@ -1161,6 +1170,8 @@ allocate_buffer () can use GNU malloc. */ #ifndef SYNC_INPUT +/* When using SYNC_INPUT, we don't call malloc from a signal handler, so + there's no need to block input around malloc. */ #ifndef DOUG_LEA_MALLOC extern void * (*__malloc_hook) P_ ((size_t, const void *)); @@ -1234,7 +1245,8 @@ emacs_blocked_malloc (size, ptr) BLOCK_INPUT_ALLOC; __malloc_hook = old_malloc_hook; #ifdef DOUG_LEA_MALLOC - mallopt (M_TOP_PAD, malloc_hysteresis * 4096); + /* Segfaults on my system. --lorentey */ + /* mallopt (M_TOP_PAD, malloc_hysteresis * 4096); */ #else __malloc_extra_blocks = malloc_hysteresis; #endif @@ -1340,9 +1352,9 @@ emacs_blocked_realloc (ptr, size, ptr2) void reset_malloc_hooks () { - __free_hook = 0; - __malloc_hook = 0; - __realloc_hook = 0; + __free_hook = old_free_hook; + __malloc_hook = old_malloc_hook; + __realloc_hook = old_realloc_hook; } #endif /* HAVE_GTK_AND_PTHREAD */ @@ -1444,9 +1456,7 @@ make_interval () /* eassert (!handling_signal); */ -#ifndef SYNC_INPUT - BLOCK_INPUT; -#endif + MALLOC_BLOCK_INPUT; if (interval_free_list) { @@ -1470,9 +1480,7 @@ make_interval () val = &interval_block->intervals[interval_block_index++]; } -#ifndef SYNC_INPUT - UNBLOCK_INPUT; -#endif + MALLOC_UNBLOCK_INPUT; consing_since_gc += sizeof (struct interval); intervals_consed++; @@ -1875,9 +1883,7 @@ allocate_string () /* eassert (!handling_signal); */ -#ifndef SYNC_INPUT - BLOCK_INPUT; -#endif + MALLOC_BLOCK_INPUT; /* If the free-list is empty, allocate a new string_block, and add all the Lisp_Strings in it to the free-list. */ @@ -1908,9 +1914,7 @@ allocate_string () s = string_free_list; string_free_list = NEXT_FREE_LISP_STRING (s); -#ifndef SYNC_INPUT - UNBLOCK_INPUT; -#endif + MALLOC_UNBLOCK_INPUT; /* Probably not strictly necessary, but play it safe. */ bzero (s, sizeof *s); @@ -1962,9 +1966,7 @@ allocate_string_data (s, nchars, nbytes) old_data = s->data ? SDATA_OF_STRING (s) : NULL; old_nbytes = GC_STRING_BYTES (s); -#ifndef SYNC_INPUT - BLOCK_INPUT; -#endif + MALLOC_BLOCK_INPUT; if (nbytes > LARGE_STRING_BYTES) { @@ -1980,18 +1982,14 @@ allocate_string_data (s, nchars, nbytes) mmap'ed data typically have an address towards the top of the address space, which won't fit into an EMACS_INT (at least on 32-bit systems with the current tagging scheme). --fx */ - BLOCK_INPUT; mallopt (M_MMAP_MAX, 0); - UNBLOCK_INPUT; #endif b = (struct sblock *) lisp_malloc (size + GC_STRING_EXTRA, MEM_TYPE_NON_LISP); #ifdef DOUG_LEA_MALLOC /* Back to a reasonable maximum of mmap'ed areas. */ - BLOCK_INPUT; mallopt (M_MMAP_MAX, MMAP_MAX_AREAS); - UNBLOCK_INPUT; #endif b->next_free = &b->first_data; @@ -2022,9 +2020,7 @@ allocate_string_data (s, nchars, nbytes) data = b->next_free; b->next_free = (struct sdata *) ((char *) data + needed + GC_STRING_EXTRA); -#ifndef SYNC_INPUT - UNBLOCK_INPUT; -#endif + MALLOC_UNBLOCK_INPUT; data->string = s; s->data = SDATA_DATA (data); @@ -2342,11 +2338,13 @@ LENGTH must be a number. INIT matters only in whether it is t or nil. */) /* We must allocate one more elements than LENGTH_IN_ELTS for the slot `size' of the struct Lisp_Bool_Vector. */ val = Fmake_vector (make_number (length_in_elts + 1), Qnil); - p = XBOOL_VECTOR (val); /* Get rid of any bits that would cause confusion. */ - p->vector_size = 0; - XSETBOOL_VECTOR (val, p); + XVECTOR (val)->size = 0; /* No Lisp_Object to trace in there. */ + /* Use XVECTOR (val) rather than `p' because p->size is not TRT. */ + XSETPVECTYPE (XVECTOR (val), PVEC_BOOL_VECTOR); + + p = XBOOL_VECTOR (val); p->size = XFASTINT (length); real_init = (NILP (init) ? 0 : -1); @@ -2355,7 +2353,7 @@ LENGTH must be a number. INIT matters only in whether it is t or nil. */) /* Clear the extraneous bits in the last byte. */ if (XINT (length) != length_in_chars * BOOL_VECTOR_BITS_PER_CHAR) - XBOOL_VECTOR (val)->data[length_in_chars - 1] + p->data[length_in_chars - 1] &= (1 << (XINT (length) % BOOL_VECTOR_BITS_PER_CHAR)) - 1; return val; @@ -2613,9 +2611,7 @@ make_float (float_value) /* eassert (!handling_signal); */ -#ifndef SYNC_INPUT - BLOCK_INPUT; -#endif + MALLOC_BLOCK_INPUT; if (float_free_list) { @@ -2642,9 +2638,7 @@ make_float (float_value) float_block_index++; } -#ifndef SYNC_INPUT - UNBLOCK_INPUT; -#endif + MALLOC_UNBLOCK_INPUT; XFLOAT_DATA (val) = float_value; eassert (!FLOAT_MARKED_P (XFLOAT (val))); @@ -2742,9 +2736,7 @@ DEFUN ("cons", Fcons, Scons, 2, 2, 0, /* eassert (!handling_signal); */ -#ifndef SYNC_INPUT - BLOCK_INPUT; -#endif + MALLOC_BLOCK_INPUT; if (cons_free_list) { @@ -2770,9 +2762,7 @@ DEFUN ("cons", Fcons, Scons, 2, 2, 0, cons_block_index++; } -#ifndef SYNC_INPUT - UNBLOCK_INPUT; -#endif + MALLOC_UNBLOCK_INPUT; XSETCAR (val, car); XSETCDR (val, cdr); @@ -2922,48 +2912,39 @@ int n_vectors; with room for LEN Lisp_Objects. */ static struct Lisp_Vector * -allocate_vectorlike (len, type) +allocate_vectorlike (len) EMACS_INT len; - enum mem_type type; { struct Lisp_Vector *p; size_t nbytes; + MALLOC_BLOCK_INPUT; + #ifdef DOUG_LEA_MALLOC /* Prevent mmap'ing the chunk. Lisp data may not be mmap'ed because mapped region contents are not preserved in a dumped Emacs. */ - BLOCK_INPUT; mallopt (M_MMAP_MAX, 0); - UNBLOCK_INPUT; #endif /* This gets triggered by code which I haven't bothered to fix. --Stef */ /* eassert (!handling_signal); */ nbytes = sizeof *p + (len - 1) * sizeof p->contents[0]; - p = (struct Lisp_Vector *) lisp_malloc (nbytes, type); + p = (struct Lisp_Vector *) lisp_malloc (nbytes, MEM_TYPE_VECTORLIKE); #ifdef DOUG_LEA_MALLOC /* Back to a reasonable maximum of mmap'ed areas. */ - BLOCK_INPUT; mallopt (M_MMAP_MAX, MMAP_MAX_AREAS); - UNBLOCK_INPUT; #endif consing_since_gc += nbytes; vector_cells_consed += len; -#ifndef SYNC_INPUT - BLOCK_INPUT; -#endif - p->next = all_vectors; all_vectors = p; -#ifndef SYNC_INPUT - UNBLOCK_INPUT; -#endif + MALLOC_UNBLOCK_INPUT; ++n_vectors; return p; @@ -2976,7 +2957,7 @@ struct Lisp_Vector * allocate_vector (nslots) EMACS_INT nslots; { - struct Lisp_Vector *v = allocate_vectorlike (nslots, MEM_TYPE_VECTOR); + struct Lisp_Vector *v = allocate_vectorlike (nslots); v->size = nslots; return v; } @@ -2984,74 +2965,78 @@ allocate_vector (nslots) /* Allocate other vector-like structures. */ -struct Lisp_Hash_Table * -allocate_hash_table () +static struct Lisp_Vector * +allocate_pseudovector (memlen, lisplen, tag) + int memlen, lisplen; + EMACS_INT tag; { - EMACS_INT len = VECSIZE (struct Lisp_Hash_Table); - struct Lisp_Vector *v = allocate_vectorlike (len, MEM_TYPE_HASH_TABLE); + struct Lisp_Vector *v = allocate_vectorlike (memlen); EMACS_INT i; - v->size = len; - for (i = 0; i < len; ++i) + /* Only the first lisplen slots will be traced normally by the GC. */ + v->size = lisplen; + for (i = 0; i < lisplen; ++i) v->contents[i] = Qnil; - return (struct Lisp_Hash_Table *) v; + XSETPVECTYPE (v, tag); /* Add the appropriate tag. */ + return v; +} +#define ALLOCATE_PSEUDOVECTOR(typ,field,tag) \ + ((typ*) \ + allocate_pseudovector \ + (VECSIZE (typ), PSEUDOVECSIZE (typ, field), tag)) + +struct Lisp_Hash_Table * +allocate_hash_table (void) +{ + return ALLOCATE_PSEUDOVECTOR (struct Lisp_Hash_Table, count, PVEC_HASH_TABLE); } struct window * allocate_window () { - EMACS_INT len = VECSIZE (struct window); - struct Lisp_Vector *v = allocate_vectorlike (len, MEM_TYPE_WINDOW); - EMACS_INT i; + return ALLOCATE_PSEUDOVECTOR(struct window, current_matrix, PVEC_WINDOW); +} - for (i = 0; i < len; ++i) - v->contents[i] = Qnil; - v->size = len; - return (struct window *) v; -} +struct terminal * +allocate_terminal () +{ + struct terminal *t = ALLOCATE_PSEUDOVECTOR (struct terminal, + next_terminal, PVEC_TERMINAL); + /* Zero out the non-GC'd fields. FIXME: This should be made unnecessary. */ + bzero (&(t->next_terminal), + ((char*)(t+1)) - ((char*)&(t->next_terminal))); + return t; +} struct frame * allocate_frame () { - EMACS_INT len = VECSIZE (struct frame); - struct Lisp_Vector *v = allocate_vectorlike (len, MEM_TYPE_FRAME); - EMACS_INT i; - - for (i = 0; i < len; ++i) - v->contents[i] = make_number (0); - v->size = len; - return (struct frame *) v; + struct frame *f = ALLOCATE_PSEUDOVECTOR (struct frame, + face_cache, PVEC_FRAME); + /* Zero out the non-GC'd fields. FIXME: This should be made unnecessary. */ + bzero (&(f->face_cache), + ((char*)(f+1)) - ((char*)&(f->face_cache))); + return f; } struct Lisp_Process * allocate_process () { - /* Memory-footprint of the object in nb of Lisp_Object fields. */ - EMACS_INT memlen = VECSIZE (struct Lisp_Process); - /* Size if we only count the actual Lisp_Object fields (which need to be - traced by the GC). */ - EMACS_INT lisplen = PSEUDOVECSIZE (struct Lisp_Process, pid); - struct Lisp_Vector *v = allocate_vectorlike (memlen, MEM_TYPE_PROCESS); - EMACS_INT i; - - for (i = 0; i < lisplen; ++i) - v->contents[i] = Qnil; - v->size = lisplen; - - return (struct Lisp_Process *) v; + return ALLOCATE_PSEUDOVECTOR (struct Lisp_Process, pid, PVEC_PROCESS); } +/* Only used for PVEC_WINDOW_CONFIGURATION. */ struct Lisp_Vector * allocate_other_vector (len) EMACS_INT len; { - struct Lisp_Vector *v = allocate_vectorlike (len, MEM_TYPE_VECTOR); + struct Lisp_Vector *v = allocate_vectorlike (len); EMACS_INT i; for (i = 0; i < len; ++i) @@ -3085,6 +3070,51 @@ See also the function `vector'. */) } +DEFUN ("make-char-table", Fmake_char_table, Smake_char_table, 1, 2, 0, + doc: /* Return a newly created char-table, with purpose PURPOSE. +Each element is initialized to INIT, which defaults to nil. +PURPOSE should be a symbol which has a `char-table-extra-slots' property. +The property's value should be an integer between 0 and 10. */) + (purpose, init) + register Lisp_Object purpose, init; +{ + Lisp_Object vector; + Lisp_Object n; + CHECK_SYMBOL (purpose); + n = Fget (purpose, Qchar_table_extra_slots); + CHECK_NUMBER (n); + if (XINT (n) < 0 || XINT (n) > 10) + args_out_of_range (n, Qnil); + /* Add 2 to the size for the defalt and parent slots. */ + vector = Fmake_vector (make_number (CHAR_TABLE_STANDARD_SLOTS + XINT (n)), + init); + XSETPVECTYPE (XVECTOR (vector), PVEC_CHAR_TABLE); + XCHAR_TABLE (vector)->top = Qt; + XCHAR_TABLE (vector)->parent = Qnil; + XCHAR_TABLE (vector)->purpose = purpose; + XSETCHAR_TABLE (vector, XCHAR_TABLE (vector)); + return vector; +} + + +/* Return a newly created sub char table with slots initialized by INIT. + Since a sub char table does not appear as a top level Emacs Lisp + object, we don't need a Lisp interface to make it. */ + +Lisp_Object +make_sub_char_table (init) + Lisp_Object init; +{ + Lisp_Object vector + = Fmake_vector (make_number (SUB_CHAR_TABLE_STANDARD_SLOTS), init); + XSETPVECTYPE (XVECTOR (vector), PVEC_CHAR_TABLE); + XCHAR_TABLE (vector)->top = Qnil; + XCHAR_TABLE (vector)->defalt = Qnil; + XSETCHAR_TABLE (vector, XCHAR_TABLE (vector)); + return vector; +} + + DEFUN ("vector", Fvector, Svector, 0, MANY, 0, doc: /* Return a newly created vector with specified arguments as elements. Any number of arguments, even zero arguments, are allowed. @@ -3142,6 +3172,7 @@ usage: (make-byte-code ARGLIST BYTE-CODE CONSTANTS DEPTH &optional DOCSTRING INT args[index] = Fpurecopy (args[index]); p->contents[index] = args[index]; } + XSETPVECTYPE (p, PVEC_COMPILED); XSETCOMPILED (val, p); return val; } @@ -3206,9 +3237,7 @@ Its value and function definition are void, and its property list is nil. */) /* eassert (!handling_signal); */ -#ifndef SYNC_INPUT - BLOCK_INPUT; -#endif + MALLOC_BLOCK_INPUT; if (symbol_free_list) { @@ -3231,9 +3260,7 @@ Its value and function definition are void, and its property list is nil. */) symbol_block_index++; } -#ifndef SYNC_INPUT - UNBLOCK_INPUT; -#endif + MALLOC_UNBLOCK_INPUT; p = XSYMBOL (val); p->xname = name; @@ -3296,9 +3323,7 @@ allocate_misc () /* eassert (!handling_signal); */ -#ifndef SYNC_INPUT - BLOCK_INPUT; -#endif + MALLOC_BLOCK_INPUT; if (marker_free_list) { @@ -3322,9 +3347,7 @@ allocate_misc () marker_block_index++; } -#ifndef SYNC_INPUT - UNBLOCK_INPUT; -#endif + MALLOC_UNBLOCK_INPUT; --total_free_markers; consing_since_gc += sizeof (union Lisp_Misc); @@ -4070,9 +4093,7 @@ live_vector_p (m, p) struct mem_node *m; void *p; { - return (p == m->start - && m->type >= MEM_TYPE_VECTOR - && m->type <= MEM_TYPE_WINDOW); + return (p == m->start && m->type == MEM_TYPE_VECTORLIKE); } @@ -4270,11 +4291,7 @@ mark_maybe_pointer (p) XSETFLOAT (obj, p); break; - case MEM_TYPE_VECTOR: - case MEM_TYPE_PROCESS: - case MEM_TYPE_HASH_TABLE: - case MEM_TYPE_FRAME: - case MEM_TYPE_WINDOW: + case MEM_TYPE_VECTORLIKE: if (live_vector_p (m, p)) { Lisp_Object tem; @@ -4674,11 +4691,7 @@ valid_lisp_object_p (obj) case MEM_TYPE_FLOAT: return live_float_p (m, p); - case MEM_TYPE_VECTOR: - case MEM_TYPE_PROCESS: - case MEM_TYPE_HASH_TABLE: - case MEM_TYPE_FRAME: - case MEM_TYPE_WINDOW: + case MEM_TYPE_VECTORLIKE: return live_vector_p (m, p); default: @@ -5128,7 +5141,9 @@ returns nil, because real GC can't be done. */) mark_object (bind->symbol); mark_object (bind->old_value); } + mark_terminals (); mark_kboards (); + mark_ttys (); #ifdef USE_GTK { @@ -5415,6 +5430,29 @@ int last_marked_index; Normally this is zero and the check never goes off. */ int mark_object_loop_halt; +/* Return non-zero if the object was not yet marked. */ +static int +mark_vectorlike (ptr) + struct Lisp_Vector *ptr; +{ + register EMACS_INT size = ptr->size; + register int i; + + if (VECTOR_MARKED_P (ptr)) + return 0; /* Already marked */ + VECTOR_MARK (ptr); /* Else mark it */ + if (size & PSEUDOVECTOR_FLAG) + size &= PSEUDOVECTOR_SIZE_MASK; + + /* Note that this size is not the memory-footprint size, but only + the number of Lisp_Object fields that we should trace. + The distinction is used e.g. by Lisp_Process which places extra + non-Lisp_Object fields at the end of the structure. */ + for (i = 0; i < size; i++) /* and then mark its elements */ + mark_object (ptr->contents[i]); + return 1; +} + void mark_object (arg) Lisp_Object arg; @@ -5544,129 +5582,46 @@ mark_object (arg) else if (FRAMEP (obj)) { register struct frame *ptr = XFRAME (obj); - - if (VECTOR_MARKED_P (ptr)) break; /* Already marked */ - VECTOR_MARK (ptr); /* Else mark it */ - - CHECK_LIVE (live_vector_p); - mark_object (ptr->name); - mark_object (ptr->icon_name); - mark_object (ptr->title); - mark_object (ptr->focus_frame); - mark_object (ptr->selected_window); - mark_object (ptr->minibuffer_window); - mark_object (ptr->param_alist); - mark_object (ptr->scroll_bars); - mark_object (ptr->condemned_scroll_bars); - mark_object (ptr->menu_bar_items); - mark_object (ptr->face_alist); - mark_object (ptr->menu_bar_vector); - mark_object (ptr->buffer_predicate); - mark_object (ptr->buffer_list); - mark_object (ptr->menu_bar_window); - mark_object (ptr->tool_bar_window); - mark_face_cache (ptr->face_cache); + if (mark_vectorlike (XVECTOR (obj))) + { + mark_face_cache (ptr->face_cache); #ifdef HAVE_WINDOW_SYSTEM - mark_image_cache (ptr); - mark_object (ptr->tool_bar_items); - mark_object (ptr->desired_tool_bar_string); - mark_object (ptr->current_tool_bar_string); + mark_image_cache (ptr); #endif /* HAVE_WINDOW_SYSTEM */ - } - else if (BOOL_VECTOR_P (obj)) - { - register struct Lisp_Vector *ptr = XVECTOR (obj); - - if (VECTOR_MARKED_P (ptr)) - break; /* Already marked */ - CHECK_LIVE (live_vector_p); - VECTOR_MARK (ptr); /* Else mark it */ + } } else if (WINDOWP (obj)) { register struct Lisp_Vector *ptr = XVECTOR (obj); struct window *w = XWINDOW (obj); - register int i; - - /* Stop if already marked. */ - if (VECTOR_MARKED_P (ptr)) - break; - - /* Mark it. */ - CHECK_LIVE (live_vector_p); - VECTOR_MARK (ptr); - - /* There is no Lisp data above The member CURRENT_MATRIX in - struct WINDOW. Stop marking when that slot is reached. */ - for (i = 0; - (char *) &ptr->contents[i] < (char *) &w->current_matrix; - i++) - mark_object (ptr->contents[i]); - - /* Mark glyphs for leaf windows. Marking window matrices is - sufficient because frame matrices use the same glyph - memory. */ - if (NILP (w->hchild) - && NILP (w->vchild) - && w->current_matrix) + if (mark_vectorlike (ptr)) { - mark_glyph_matrix (w->current_matrix); - mark_glyph_matrix (w->desired_matrix); + /* Mark glyphs for leaf windows. Marking window matrices is + sufficient because frame matrices use the same glyph + memory. */ + if (NILP (w->hchild) + && NILP (w->vchild) + && w->current_matrix) + { + mark_glyph_matrix (w->current_matrix); + mark_glyph_matrix (w->desired_matrix); + } } } else if (HASH_TABLE_P (obj)) { struct Lisp_Hash_Table *h = XHASH_TABLE (obj); - - /* Stop if already marked. */ - if (VECTOR_MARKED_P (h)) - break; - - /* Mark it. */ - CHECK_LIVE (live_vector_p); - VECTOR_MARK (h); - - /* Mark contents. */ - /* Do not mark next_free or next_weak. - Being in the next_weak chain - should not keep the hash table alive. - No need to mark `count' since it is an integer. */ - mark_object (h->test); - mark_object (h->weak); - mark_object (h->rehash_size); - mark_object (h->rehash_threshold); - mark_object (h->hash); - mark_object (h->next); - mark_object (h->index); - mark_object (h->user_hash_function); - mark_object (h->user_cmp_function); - - /* If hash table is not weak, mark all keys and values. - For weak tables, mark only the vector. */ - if (NILP (h->weak)) - mark_object (h->key_and_value); - else - VECTOR_MARK (XVECTOR (h->key_and_value)); + if (mark_vectorlike ((struct Lisp_Vector *)h)) + { /* If hash table is not weak, mark all keys and values. + For weak tables, mark only the vector. */ + if (NILP (h->weak)) + mark_object (h->key_and_value); + else + VECTOR_MARK (XVECTOR (h->key_and_value)); + } } else - { - register struct Lisp_Vector *ptr = XVECTOR (obj); - register EMACS_INT size = ptr->size; - register int i; - - if (VECTOR_MARKED_P (ptr)) break; /* Already marked */ - CHECK_LIVE (live_vector_p); - VECTOR_MARK (ptr); /* Else mark it */ - if (size & PSEUDOVECTOR_FLAG) - size &= PSEUDOVECTOR_SIZE_MASK; - - /* Note that this size is not the memory-footprint size, but only - the number of Lisp_Object fields that we should trace. - The distinction is used e.g. by Lisp_Process which places extra - non-Lisp_Object fields at the end of the structure. */ - for (i = 0; i < size; i++) /* and then mark its elements */ - mark_object (ptr->contents[i]); - } + mark_vectorlike (XVECTOR (obj)); break; case Lisp_Symbol: @@ -5857,6 +5812,21 @@ mark_buffer (buf) } } +/* Mark the Lisp pointers in the terminal objects. + Called by the Fgarbage_collector. */ + +static void +mark_terminals (void) +{ + struct terminal *t; + for (t = terminal_list; t; t = t->next_terminal) + { + eassert (t->name != NULL); + mark_vectorlike ((struct Lisp_Vector *)t); + } +} + + /* Value is non-zero if OBJ will survive the current GC because it's either marked or does not need to be marked to survive. */ @@ -5932,23 +5902,51 @@ gc_sweep () for (cblk = cons_block; cblk; cblk = *cprev) { - register int i; + register int i = 0; int this_free = 0; - for (i = 0; i < lim; i++) - if (!CONS_MARKED_P (&cblk->conses[i])) - { - this_free++; - cblk->conses[i].u.chain = cons_free_list; - cons_free_list = &cblk->conses[i]; + int ilim = (lim + BITS_PER_INT - 1) / BITS_PER_INT; + + /* Scan the mark bits an int at a time. */ + for (i = 0; i <= ilim; i++) + { + if (cblk->gcmarkbits[i] == -1) + { + /* Fast path - all cons cells for this int are marked. */ + cblk->gcmarkbits[i] = 0; + num_used += BITS_PER_INT; + } + else + { + /* Some cons cells for this int are not marked. + Find which ones, and free them. */ + int start, pos, stop; + + start = i * BITS_PER_INT; + stop = lim - start; + if (stop > BITS_PER_INT) + stop = BITS_PER_INT; + stop += start; + + for (pos = start; pos < stop; pos++) + { + if (!CONS_MARKED_P (&cblk->conses[pos])) + { + this_free++; + cblk->conses[pos].u.chain = cons_free_list; + cons_free_list = &cblk->conses[pos]; #if GC_MARK_STACK - cons_free_list->car = Vdead; + cons_free_list->car = Vdead; #endif - } - else - { - num_used++; - CONS_UNMARK (&cblk->conses[i]); - } + } + else + { + num_used++; + CONS_UNMARK (&cblk->conses[pos]); + } + } + } + } + lim = CONS_BLOCK_SIZE; /* If this block contains only free conses and we have already seen more than two blocks worth of free conses then deallocate diff --git a/src/alloca.c b/src/alloca.c deleted file mode 100644 index e8c8319adc4..00000000000 --- a/src/alloca.c +++ /dev/null @@ -1,517 +0,0 @@ -/* alloca.c -- allocate automatically reclaimed memory - (Mostly) portable public-domain implementation -- D A Gwyn - - NOTE: The canonical source of this file is maintained with gnulib. - Bugs can be reported to bug-gnulib@gnu.org. - - This implementation of the PWB library alloca function, - which is used to allocate space off the run-time stack so - that it is automatically reclaimed upon procedure exit, - was inspired by discussions with J. Q. Johnson of Cornell. - J.Otto Tennant <jot@cray.com> contributed the Cray support. - - There are some preprocessor constants that can - be defined when compiling for your specific system, for - improved efficiency; however, the defaults should be okay. - - The general concept of this implementation is to keep - track of all alloca-allocated blocks, and reclaim any - that are found to be deeper in the stack than the current - invocation. This heuristic does not reclaim storage as - soon as it becomes invalid, but it will do so eventually. - - As a special case, alloca(0) reclaims storage without - allocating any. It is a good idea to use alloca(0) in - your main control loop, etc. to force garbage collection. */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#ifdef HAVE_STRING_H -# include <string.h> -#endif -#ifdef HAVE_STDLIB_H -# include <stdlib.h> -#endif - -#ifdef DO_BLOCK_INPUT -# include "blockinput.h" -#endif - -/* If compiling with GCC 2, this file's not needed. */ -#if !defined (__GNUC__) || __GNUC__ < 2 - -/* If someone has defined alloca as a macro, - there must be some other way alloca is supposed to work. */ -# ifndef alloca - -# ifdef emacs -# ifdef static -/* actually, only want this if static is defined as "" - -- this is for usg, in which emacs must undefine static - in order to make unexec workable - */ -# ifndef STACK_DIRECTION -you -lose --- must know STACK_DIRECTION at compile-time -/* Using #error here is not wise since this file should work for - old and obscure compilers. - - As far as I know, using it is OK if it's indented -- at least for - pcc-based processors. -- fx */ -# endif /* STACK_DIRECTION undefined */ -# endif /* static */ -# endif /* emacs */ - -/* If your stack is a linked list of frames, you have to - provide an "address metric" ADDRESS_FUNCTION macro. */ - -# if defined (CRAY) && defined (CRAY_STACKSEG_END) -long i00afunc (); -# define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg)) -# else -# define ADDRESS_FUNCTION(arg) &(arg) -# endif - -# ifndef POINTER_TYPE -# ifdef __STDC__ -# define POINTER_TYPE void -# else -# define POINTER_TYPE char -# endif -# endif -typedef POINTER_TYPE *pointer; - -# ifndef NULL -# define NULL 0 -# endif - -/* The Emacs executable needs alloca to call xmalloc, because ordinary - malloc isn't protected from input signals. xmalloc also checks for - out-of-memory errors, so we should use it generally. - - Callers below should use malloc. */ - -# undef malloc -# define malloc xmalloc -# undef free -# define free xfree - -void *xmalloc _P ((size_t)); -void xfree _P ((void *)); - -/* Define STACK_DIRECTION if you know the direction of stack - growth for your system; otherwise it will be automatically - deduced at run-time. - - STACK_DIRECTION > 0 => grows toward higher addresses - STACK_DIRECTION < 0 => grows toward lower addresses - STACK_DIRECTION = 0 => direction of growth unknown */ - -# ifndef STACK_DIRECTION -# define STACK_DIRECTION 0 /* Direction unknown. */ -# endif - -# if STACK_DIRECTION != 0 - -# define STACK_DIR STACK_DIRECTION /* Known at compile-time. */ - -# else /* STACK_DIRECTION == 0; need run-time code. */ - -static int stack_dir; /* 1 or -1 once known. */ -# define STACK_DIR stack_dir - -static void -find_stack_direction () -{ - static char *addr = NULL; /* Address of first `dummy', once known. */ - auto char dummy; /* To get stack address. */ - - if (addr == NULL) - { /* Initial entry. */ - addr = ADDRESS_FUNCTION (dummy); - - find_stack_direction (); /* Recurse once. */ - } - else - { - /* Second entry. */ - if (ADDRESS_FUNCTION (dummy) > addr) - stack_dir = 1; /* Stack grew upward. */ - else - stack_dir = -1; /* Stack grew downward. */ - } -} - -# endif /* STACK_DIRECTION == 0 */ - -/* An "alloca header" is used to: - (a) chain together all alloca'ed blocks; - (b) keep track of stack depth. - - It is very important that sizeof(header) agree with malloc - alignment chunk size. The following default should work okay. */ - -# ifndef ALIGN_SIZE -# define ALIGN_SIZE sizeof(double) -# endif - -typedef union hdr -{ - char align[ALIGN_SIZE]; /* To force sizeof(header). */ - struct - { - union hdr *next; /* For chaining headers. */ - char *deep; /* For stack depth measure. */ - } h; -} header; - -static header *last_alloca_header = NULL; /* -> last alloca header. */ - -/* Return a pointer to at least SIZE bytes of storage, - which will be automatically reclaimed upon exit from - the procedure that called alloca. Originally, this space - was supposed to be taken from the current stack frame of the - caller, but that method cannot be made to work for some - implementations of C, for example under Gould's UTX/32. */ - -pointer -alloca (size) - size_t size; -{ - auto char probe; /* Probes stack depth: */ - register char *depth = ADDRESS_FUNCTION (probe); - -# if STACK_DIRECTION == 0 - if (STACK_DIR == 0) /* Unknown growth direction. */ - find_stack_direction (); -# endif - - /* Reclaim garbage, defined as all alloca'd storage that - was allocated from deeper in the stack than currently. */ - - { - register header *hp; /* Traverses linked list. */ - -# ifdef DO_BLOCK_INPUT - BLOCK_INPUT; -# endif - - for (hp = last_alloca_header; hp != NULL;) - if ((STACK_DIR > 0 && hp->h.deep > depth) - || (STACK_DIR < 0 && hp->h.deep < depth)) - { - register header *np = hp->h.next; - - free ((pointer) hp); /* Collect garbage. */ - - hp = np; /* -> next header. */ - } - else - break; /* Rest are not deeper. */ - - last_alloca_header = hp; /* -> last valid storage. */ - -# ifdef DO_BLOCK_INPUT - UNBLOCK_INPUT; -# endif - } - - if (size == 0) - return NULL; /* No allocation required. */ - - /* Allocate combined header + user data storage. */ - - { - /* Address of header. */ - register pointer new = malloc (sizeof (header) + size); - - if (new == 0) - abort(); - - ((header *) new)->h.next = last_alloca_header; - ((header *) new)->h.deep = depth; - - last_alloca_header = (header *) new; - - /* User storage begins just after header. */ - - return (pointer) ((char *) new + sizeof (header)); - } -} - -# if defined (CRAY) && defined (CRAY_STACKSEG_END) - -# ifdef DEBUG_I00AFUNC -# include <stdio.h> -# endif - -# ifndef CRAY_STACK -# define CRAY_STACK -# ifndef CRAY2 -/* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */ -struct stack_control_header - { - long shgrow:32; /* Number of times stack has grown. */ - long shaseg:32; /* Size of increments to stack. */ - long shhwm:32; /* High water mark of stack. */ - long shsize:32; /* Current size of stack (all segments). */ - }; - -/* The stack segment linkage control information occurs at - the high-address end of a stack segment. (The stack - grows from low addresses to high addresses.) The initial - part of the stack segment linkage control information is - 0200 (octal) words. This provides for register storage - for the routine which overflows the stack. */ - -struct stack_segment_linkage - { - long ss[0200]; /* 0200 overflow words. */ - long sssize:32; /* Number of words in this segment. */ - long ssbase:32; /* Offset to stack base. */ - long:32; - long sspseg:32; /* Offset to linkage control of previous - segment of stack. */ - long:32; - long sstcpt:32; /* Pointer to task common address block. */ - long sscsnm; /* Private control structure number for - microtasking. */ - long ssusr1; /* Reserved for user. */ - long ssusr2; /* Reserved for user. */ - long sstpid; /* Process ID for pid based multi-tasking. */ - long ssgvup; /* Pointer to multitasking thread giveup. */ - long sscray[7]; /* Reserved for Cray Research. */ - long ssa0; - long ssa1; - long ssa2; - long ssa3; - long ssa4; - long ssa5; - long ssa6; - long ssa7; - long sss0; - long sss1; - long sss2; - long sss3; - long sss4; - long sss5; - long sss6; - long sss7; - }; - -# else /* CRAY2 */ -/* The following structure defines the vector of words - returned by the STKSTAT library routine. */ -struct stk_stat - { - long now; /* Current total stack size. */ - long maxc; /* Amount of contiguous space which would - be required to satisfy the maximum - stack demand to date. */ - long high_water; /* Stack high-water mark. */ - long overflows; /* Number of stack overflow ($STKOFEN) calls. */ - long hits; /* Number of internal buffer hits. */ - long extends; /* Number of block extensions. */ - long stko_mallocs; /* Block allocations by $STKOFEN. */ - long underflows; /* Number of stack underflow calls ($STKRETN). */ - long stko_free; /* Number of deallocations by $STKRETN. */ - long stkm_free; /* Number of deallocations by $STKMRET. */ - long segments; /* Current number of stack segments. */ - long maxs; /* Maximum number of stack segments so far. */ - long pad_size; /* Stack pad size. */ - long current_address; /* Current stack segment address. */ - long current_size; /* Current stack segment size. This - number is actually corrupted by STKSTAT to - include the fifteen word trailer area. */ - long initial_address; /* Address of initial segment. */ - long initial_size; /* Size of initial segment. */ - }; - -/* The following structure describes the data structure which trails - any stack segment. I think that the description in 'asdef' is - out of date. I only describe the parts that I am sure about. */ - -struct stk_trailer - { - long this_address; /* Address of this block. */ - long this_size; /* Size of this block (does not include - this trailer). */ - long unknown2; - long unknown3; - long link; /* Address of trailer block of previous - segment. */ - long unknown5; - long unknown6; - long unknown7; - long unknown8; - long unknown9; - long unknown10; - long unknown11; - long unknown12; - long unknown13; - long unknown14; - }; - -# endif /* CRAY2 */ -# endif /* not CRAY_STACK */ - -# ifdef CRAY2 -/* Determine a "stack measure" for an arbitrary ADDRESS. - I doubt that "lint" will like this much. */ - -static long -i00afunc (long *address) -{ - struct stk_stat status; - struct stk_trailer *trailer; - long *block, size; - long result = 0; - - /* We want to iterate through all of the segments. The first - step is to get the stack status structure. We could do this - more quickly and more directly, perhaps, by referencing the - $LM00 common block, but I know that this works. */ - - STKSTAT (&status); - - /* Set up the iteration. */ - - trailer = (struct stk_trailer *) (status.current_address - + status.current_size - - 15); - - /* There must be at least one stack segment. Therefore it is - a fatal error if "trailer" is null. */ - - if (trailer == 0) - abort (); - - /* Discard segments that do not contain our argument address. */ - - while (trailer != 0) - { - block = (long *) trailer->this_address; - size = trailer->this_size; - if (block == 0 || size == 0) - abort (); - trailer = (struct stk_trailer *) trailer->link; - if ((block <= address) && (address < (block + size))) - break; - } - - /* Set the result to the offset in this segment and add the sizes - of all predecessor segments. */ - - result = address - block; - - if (trailer == 0) - { - return result; - } - - do - { - if (trailer->this_size <= 0) - abort (); - result += trailer->this_size; - trailer = (struct stk_trailer *) trailer->link; - } - while (trailer != 0); - - /* We are done. Note that if you present a bogus address (one - not in any segment), you will get a different number back, formed - from subtracting the address of the first block. This is probably - not what you want. */ - - return (result); -} - -# else /* not CRAY2 */ -/* Stack address function for a CRAY-1, CRAY X-MP, or CRAY Y-MP. - Determine the number of the cell within the stack, - given the address of the cell. The purpose of this - routine is to linearize, in some sense, stack addresses - for alloca. */ - -static long -i00afunc (long address) -{ - long stkl = 0; - - long size, pseg, this_segment, stack; - long result = 0; - - struct stack_segment_linkage *ssptr; - - /* Register B67 contains the address of the end of the - current stack segment. If you (as a subprogram) store - your registers on the stack and find that you are past - the contents of B67, you have overflowed the segment. - - B67 also points to the stack segment linkage control - area, which is what we are really interested in. */ - - stkl = CRAY_STACKSEG_END (); - ssptr = (struct stack_segment_linkage *) stkl; - - /* If one subtracts 'size' from the end of the segment, - one has the address of the first word of the segment. - - If this is not the first segment, 'pseg' will be - nonzero. */ - - pseg = ssptr->sspseg; - size = ssptr->sssize; - - this_segment = stkl - size; - - /* It is possible that calling this routine itself caused - a stack overflow. Discard stack segments which do not - contain the target address. */ - - while (!(this_segment <= address && address <= stkl)) - { -# ifdef DEBUG_I00AFUNC - fprintf (stderr, "%011o %011o %011o\n", this_segment, address, stkl); -# endif - if (pseg == 0) - break; - stkl = stkl - pseg; - ssptr = (struct stack_segment_linkage *) stkl; - size = ssptr->sssize; - pseg = ssptr->sspseg; - this_segment = stkl - size; - } - - result = address - this_segment; - - /* If you subtract pseg from the current end of the stack, - you get the address of the previous stack segment's end. - This seems a little convoluted to me, but I'll bet you save - a cycle somewhere. */ - - while (pseg != 0) - { -# ifdef DEBUG_I00AFUNC - fprintf (stderr, "%011o %011o\n", pseg, size); -# endif - stkl = stkl - pseg; - ssptr = (struct stack_segment_linkage *) stkl; - size = ssptr->sssize; - pseg = ssptr->sspseg; - result += size; - } - return (result); -} - -# endif /* not CRAY2 */ -# endif /* CRAY */ - -# endif /* no alloca */ -#endif /* not GCC version 2 */ - -/* arch-tag: 5c9901c8-3cd4-453e-bd66-d9035a175ee3 - (do not change this comment) */ diff --git a/src/buffer.c b/src/buffer.c index 3a2b9460c17..237c549df8b 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -216,25 +216,38 @@ frame parameter come first, followed by the rest of the buffers. */) (frame) Lisp_Object frame; { - Lisp_Object framelist, general; + Lisp_Object general; general = Fmapcar (Qcdr, Vbuffer_alist); if (FRAMEP (frame)) { - Lisp_Object tail; + Lisp_Object framelist, prevlist, tail; + Lisp_Object args[3]; CHECK_FRAME (frame); framelist = Fcopy_sequence (XFRAME (frame)->buffer_list); + prevlist = Fnreverse (Fcopy_sequence (XFRAME (frame)->buried_buffer_list)); - /* Remove from GENERAL any buffer that duplicates one in FRAMELIST. */ + /* Remove from GENERAL any buffer that duplicates one in + FRAMELIST or PREVLIST. */ tail = framelist; - while (! NILP (tail)) + while (CONSP (tail)) { general = Fdelq (XCAR (tail), general); tail = XCDR (tail); } - return nconc2 (framelist, general); + tail = prevlist; + while (CONSP (tail)) + { + general = Fdelq (XCAR (tail), general); + tail = XCDR (tail); + } + + args[0] = framelist; + args[1] = general; + args[2] = prevlist; + return Fnconc (3, args); } return general; @@ -417,6 +430,7 @@ The value is never nil. */) b->name = name; /* Put this in the alist of all live buffers. */ + XSETPVECTYPE (b, PVEC_BUFFER); XSETBUFFER (buf, b); Vbuffer_alist = nconc2 (Vbuffer_alist, Fcons (Fcons (name, buf), Qnil)); @@ -1584,6 +1598,23 @@ record_buffer (buf) XSETCDR (link, Vbuffer_alist); Vbuffer_alist = link; + /* Effectively do a delq on buried_buffer_list. */ + + prev = Qnil; + for (link = XFRAME (frame)->buried_buffer_list; CONSP (link); + link = XCDR (link)) + { + if (EQ (XCAR (link), buf)) + { + if (NILP (prev)) + XFRAME (frame)->buried_buffer_list = XCDR (link); + else + XSETCDR (prev, XCDR (XCDR (prev))); + break; + } + prev = link; + } + /* Now move this buffer to the front of frame_buffer_list also. */ prev = Qnil; @@ -2066,10 +2097,10 @@ selected window if it is displayed there. */) XSETCDR (link, Qnil); Vbuffer_alist = nconc2 (Vbuffer_alist, link); - /* Removing BUFFER from frame-specific lists - has the effect of putting BUFFER at the end - of the combined list in each frame. */ - frames_discard_buffer (buffer); + XFRAME (selected_frame)->buffer_list + = Fdelq (buffer, XFRAME (selected_frame)->buffer_list); + XFRAME (selected_frame)->buried_buffer_list + = Fcons (buffer, Fdelq (buffer, XFRAME (selected_frame)->buried_buffer_list)); } return Qnil; @@ -3953,7 +3984,7 @@ OVERLAY. */) DEFUN ("overlays-at", Foverlays_at, Soverlays_at, 1, 1, 0, - doc: /* Return a list of the overlays that contain position POS. */) + doc: /* Return a list of the overlays that contain the character at POS. */) (pos) Lisp_Object pos; { @@ -5022,7 +5053,9 @@ init_buffer_once () buffer_local_symbols.text = &buffer_local_symbols.own_text; BUF_INTERVALS (&buffer_defaults) = 0; BUF_INTERVALS (&buffer_local_symbols) = 0; + XSETPVECTYPE (&buffer_defaults, PVEC_BUFFER); XSETBUFFER (Vbuffer_defaults, &buffer_defaults); + XSETPVECTYPE (&buffer_local_symbols, PVEC_BUFFER); XSETBUFFER (Vbuffer_local_symbols, &buffer_local_symbols); /* Set up the default values of various buffer slots. */ @@ -5261,6 +5294,46 @@ init_buffer () free (pwd); } +/* Similar to defvar_lisp but define a variable whose value is the Lisp + Object stored in the current buffer. address is the address of the slot + in the buffer that is current now. */ + +/* TYPE is nil for a general Lisp variable. + An integer specifies a type; then only LIsp values + with that type code are allowed (except that nil is allowed too). + LNAME is the LIsp-level variable name. + VNAME is the name of the buffer slot. + DOC is a dummy where you write the doc string as a comment. */ +#define DEFVAR_PER_BUFFER(lname, vname, type, doc) \ + defvar_per_buffer (lname, vname, type, 0) + +static void +defvar_per_buffer (namestring, address, type, doc) + char *namestring; + Lisp_Object *address; + Lisp_Object type; + char *doc; +{ + Lisp_Object sym, val; + int offset; + + sym = intern (namestring); + val = allocate_misc (); + offset = (char *)address - (char *)current_buffer; + + XMISCTYPE (val) = Lisp_Misc_Buffer_Objfwd; + XBUFFER_OBJFWD (val)->offset = offset; + SET_SYMBOL_VALUE (sym, val); + PER_BUFFER_SYMBOL (offset) = sym; + PER_BUFFER_TYPE (offset) = type; + + if (PER_BUFFER_IDX (offset) == 0) + /* Did a DEFVAR_PER_BUFFER without initializing the corresponding + slot of buffer_local_flags */ + abort (); +} + + /* initialize the buffer routines */ void syms_of_buffer () @@ -5546,6 +5619,9 @@ its hooks should not expect certain variables such as Qnil, doc: /* Pretty name of current buffer's major mode (a string). */); + DEFVAR_PER_BUFFER ("local-abbrev-table", ¤t_buffer->abbrev_table, Qnil, + doc: /* Local (mode-specific) abbrev table of current buffer. */); + DEFVAR_PER_BUFFER ("abbrev-mode", ¤t_buffer->abbrev_mode, Qnil, doc: /* Non-nil turns on automatic expansion of abbrevs as they are inserted. */); diff --git a/src/buffer.h b/src/buffer.h index 3935a675c42..d9e82d62b17 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -464,7 +464,7 @@ struct buffer Check out mark_buffer (alloc.c) to see why. */ - EMACS_INT size; + EMACS_UINT size; /* Next buffer, in chain of all buffers including killed buffers. This chain is used only for garbage collection, in order to diff --git a/src/callint.c b/src/callint.c index 9b3535474c0..a19c424c899 100644 --- a/src/callint.c +++ b/src/callint.c @@ -263,7 +263,6 @@ invoke it. If KEYS is omitted or nil, the return value of Lisp_Object function, record_flag, keys; { Lisp_Object *args, *visargs; - Lisp_Object fun; Lisp_Object specs; Lisp_Object filter_specs; Lisp_Object teml; @@ -317,8 +316,6 @@ invoke it. If KEYS is omitted or nil, the return value of else enable = Qnil; - fun = indirect_function (function); - specs = Qnil; string = 0; /* The idea of FILTER_SPECS is to provide away to @@ -329,37 +326,19 @@ invoke it. If KEYS is omitted or nil, the return value of /* If k or K discard an up-event, save it here so it can be retrieved with U */ up_event = Qnil; - /* Decode the kind of function. Either handle it and return, - or go to `lose' if not interactive, or set either STRING or SPECS. */ - - if (SUBRP (fun)) - { - string = (unsigned char *) XSUBR (fun)->prompt; - if (!string) - { - lose: - wrong_type_argument (Qcommandp, function); - } - } - else if (COMPILEDP (fun)) - { - if ((XVECTOR (fun)->size & PSEUDOVECTOR_SIZE_MASK) <= COMPILED_INTERACTIVE) - goto lose; - specs = XVECTOR (fun)->contents[COMPILED_INTERACTIVE]; - } - else - { - Lisp_Object form; - GCPRO2 (function, prefix_arg); - form = Finteractive_form (function); - UNGCPRO; - if (CONSP (form)) - specs = filter_specs = Fcar (XCDR (form)); - else - goto lose; - } + /* Set SPECS to the interactive form, or barf if not interactive. */ + { + Lisp_Object form; + GCPRO2 (function, prefix_arg); + form = Finteractive_form (function); + UNGCPRO; + if (CONSP (form)) + specs = filter_specs = Fcar (XCDR (form)); + else + wrong_type_argument (Qcommandp, function); + } - /* If either SPECS or STRING is set to a string, use it. */ + /* If SPECS is set to a string, use it as an interactive prompt. */ if (STRINGP (specs)) { /* Make a copy of string so that if a GC relocates specs, @@ -368,7 +347,7 @@ invoke it. If KEYS is omitted or nil, the return value of bcopy (SDATA (specs), string, SBYTES (specs) + 1); } - else if (string == 0) + else { Lisp_Object input; i = num_input_events; @@ -402,8 +381,8 @@ invoke it. If KEYS is omitted or nil, the return value of real_this_command= save_real_this_command; current_kboard->Vlast_command = save_last_command; - single_kboard_state (); - return apply1 (function, specs); + temporarily_switch_to_single_kboard (NULL); + return unbind_to (speccount, apply1 (function, specs)); } /* Here if function specifies a string to control parsing the defaults */ @@ -854,12 +833,11 @@ invoke it. If KEYS is omitted or nil, the return value of real_this_command= save_real_this_command; current_kboard->Vlast_command = save_last_command; - single_kboard_state (); - { Lisp_Object val; specbind (Qcommand_debug_status, Qnil); + temporarily_switch_to_single_kboard (NULL); val = Ffuncall (count + 1, args); UNGCPRO; return unbind_to (speccount, val); diff --git a/src/callproc.c b/src/callproc.c index d86113cfdba..5560f32173c 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -84,6 +84,8 @@ extern int errno; #include "syssignal.h" #include "systty.h" #include "blockinput.h" +#include "frame.h" +#include "termhooks.h" #ifdef MSDOS #include "msdos.h" @@ -111,7 +113,7 @@ Lisp_Object Vtemp_file_name_pattern; Lisp_Object Vshell_file_name; -Lisp_Object Vprocess_environment; +Lisp_Object Vprocess_environment, Vinitial_environment; #ifdef DOS_NT Lisp_Object Qbuffer_file_type; @@ -130,6 +132,7 @@ int synch_process_termsig; /* If synch_process_death is zero, this is exit code of synchronous subprocess. */ int synch_process_retcode; + /* Clean up when exiting Fcall_process. On MSDOS, delete the temporary file on any kind of termination. @@ -138,6 +141,8 @@ int synch_process_retcode; /* Nonzero if this is termination due to exit. */ static int call_process_exited; +EXFUN (Fgetenv_internal, 2); + #ifndef VMS /* VMS version is in vmsproc.c. */ static Lisp_Object @@ -1069,6 +1074,40 @@ usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &r static int relocate_fd (); +static char ** +add_env (char **env, char **new_env, char *string) +{ + char **ep; + int ok = 1; + if (string == NULL) + return new_env; + + /* See if this string duplicates any string already in the env. + If so, don't put it in. + When an env var has multiple definitions, + we keep the definition that comes first in process-environment. */ + for (ep = env; ok && ep != new_env; ep++) + { + char *p = *ep, *q = string; + while (ok) + { + if (*q != *p) + break; + if (*q == 0) + /* The string is a lone variable name; keep it for now, we + will remove it later. It is a placeholder for a + variable that is not to be included in the environment. */ + break; + if (*q == '=') + ok = 0; + p++, q++; + } + } + if (ok) + *new_env++ = string; + return new_env; +} + /* This is the last thing run in a newly forked inferior either synchronous or asynchronous. Copy descriptors IN, OUT and ERR as descriptors 0, 1 and 2. @@ -1124,9 +1163,10 @@ child_setup (in, out, err, new_argv, set_pgrp, current_dir) /* Note that use of alloca is always safe here. It's obvious for systems that do not have true vfork or that have true (stack) alloca. - If using vfork and C_ALLOCA it is safe because that changes - the superior's static variables as if the superior had done alloca - and will be cleaned up in the usual way. */ + If using vfork and C_ALLOCA (when Emacs used to include + src/alloca.c) it is safe because that changes the superior's + static variables as if the superior had done alloca and will be + cleaned up in the usual way. */ { register char *temp; register int i; @@ -1170,57 +1210,80 @@ child_setup (in, out, err, new_argv, set_pgrp, current_dir) temp[--i] = 0; } - /* Set `env' to a vector of the strings in Vprocess_environment. */ + /* Set `env' to a vector of the strings in the environment. */ { register Lisp_Object tem; register char **new_env; + char **p, **q; register int new_length; - + Lisp_Object display = Qnil; + new_length = 0; + for (tem = Vprocess_environment; - CONSP (tem) && STRINGP (XCAR (tem)); - tem = XCDR (tem)) - new_length++; + CONSP (tem) && STRINGP (XCAR (tem)); + tem = XCDR (tem)) + { + if (strncmp (SDATA (XCAR (tem)), "DISPLAY", 7) == 0 + && (SDATA (XCAR (tem)) [7] == '\0' + || SDATA (XCAR (tem)) [7] == '=')) + /* DISPLAY is specified in process-environment. */ + display = Qt; + new_length++; + } + + /* If not provided yet, use the frame's DISPLAY. */ + if (NILP (display)) + { + Lisp_Object tmp = Fframe_parameter (selected_frame, Qdisplay); + if (!STRINGP (tmp) && CONSP (Vinitial_environment)) + /* If still not found, Look for DISPLAY in Vinitial_environment. */ + tmp = Fgetenv_internal (build_string ("DISPLAY"), + Vinitial_environment); + if (STRINGP (tmp)) + { + display = tmp; + new_length++; + } + } /* new_length + 2 to include PWD and terminating 0. */ env = new_env = (char **) alloca ((new_length + 2) * sizeof (char *)); - /* If we have a PWD envvar, pass one down, but with corrected value. */ - if (getenv ("PWD")) + if (egetenv ("PWD")) *new_env++ = pwd_var; + + if (STRINGP (display)) + { + int vlen = strlen ("DISPLAY=") + strlen (SDATA (display)) + 1; + char *vdata = (char *) alloca (vlen); + strcpy (vdata, "DISPLAY="); + strcat (vdata, SDATA (display)); + new_env = add_env (env, new_env, vdata); + } - /* Copy the Vprocess_environment strings into new_env. */ + /* Overrides. */ for (tem = Vprocess_environment; CONSP (tem) && STRINGP (XCAR (tem)); tem = XCDR (tem)) + new_env = add_env (env, new_env, SDATA (XCAR (tem))); + + *new_env = 0; + + /* Remove variable names without values. */ + p = q = env; + while (*p != 0) { - char **ep = env; - char *string = (char *) SDATA (XCAR (tem)); - /* See if this string duplicates any string already in the env. - If so, don't put it in. - When an env var has multiple definitions, - we keep the definition that comes first in process-environment. */ - for (; ep != new_env; ep++) - { - char *p = *ep, *q = string; - while (1) - { - if (*q == 0) - /* The string is malformed; might as well drop it. */ - goto duplicate; - if (*q != *p) - break; - if (*q == '=') - goto duplicate; - p++, q++; - } - } - *new_env++ = string; - duplicate: ; + while (*q != 0 && strchr (*q, '=') == NULL) + *q++; + *p = *q++; + if (*p != 0) + p++; } - *new_env = 0; } + + #ifdef WINDOWSNT prepare_standard_handles (in, out, err, handles); set_process_dir (SDATA (current_dir)); @@ -1334,22 +1397,18 @@ relocate_fd (fd, minfd) } static int -getenv_internal (var, varlen, value, valuelen) +getenv_internal_1 (var, varlen, value, valuelen, env) char *var; int varlen; char **value; int *valuelen; + Lisp_Object env; { - Lisp_Object scan; - - for (scan = Vprocess_environment; CONSP (scan); scan = XCDR (scan)) + for (; CONSP (env); env = XCDR (env)) { - Lisp_Object entry; - - entry = XCAR (scan); + Lisp_Object entry = XCAR (env); if (STRINGP (entry) - && SBYTES (entry) > varlen - && SREF (entry, varlen) == '=' + && SBYTES (entry) >= varlen #ifdef WINDOWSNT /* NT environment variables are case insensitive. */ && ! strnicmp (SDATA (entry), var, varlen) @@ -1358,35 +1417,95 @@ getenv_internal (var, varlen, value, valuelen) #endif /* not WINDOWSNT */ ) { - *value = (char *) SDATA (entry) + (varlen + 1); - *valuelen = SBYTES (entry) - (varlen + 1); + if (SBYTES (entry) > varlen && SREF (entry, varlen) == '=') + { + *value = (char *) SDATA (entry) + (varlen + 1); + *valuelen = SBYTES (entry) - (varlen + 1); + return 1; + } + else if (SBYTES (entry) == varlen) + { + /* Lone variable names in Vprocess_environment mean that + variable should be removed from the environment. */ + *value = NULL; + return 1; + } + } + } + return 0; +} + +static int +getenv_internal (var, varlen, value, valuelen, frame) + char *var; + int varlen; + char **value; + int *valuelen; + Lisp_Object frame; +{ + /* Try to find VAR in Vprocess_environment first. */ + if (getenv_internal_1 (var, varlen, value, valuelen, + Vprocess_environment)) + return *value ? 1 : 0; + + /* For DISPLAY try to get the values from the frame or the initial env. */ + if (strcmp (var, "DISPLAY") == 0) + { + Lisp_Object display + = Fframe_parameter (NILP (frame) ? selected_frame : frame, Qdisplay); + if (STRINGP (display)) + { + *value = (char *) SDATA (display); + *valuelen = SBYTES (display); return 1; } + /* If still not found, Look for DISPLAY in Vinitial_environment. */ + if (getenv_internal_1 (var, varlen, value, valuelen, + Vinitial_environment)) + return *value ? 1 : 0; } return 0; } -DEFUN ("getenv-internal", Fgetenv_internal, Sgetenv_internal, 1, 1, 0, - doc: /* Return the value of environment variable VAR, as a string. -VAR should be a string. Value is nil if VAR is undefined in the environment. -This function consults the variable `process-environment' for its value. */) - (var) - Lisp_Object var; +DEFUN ("getenv-internal", Fgetenv_internal, Sgetenv_internal, 1, 2, 0, + doc: /* Get the value of environment variable VARIABLE. +VARIABLE should be a string. Value is nil if VARIABLE is undefined in +the environment. Otherwise, value is a string. + +This function searches `process-environment' for VARIABLE. If it is +not found there, then it continues the search in the environment list +of the selected frame. + +If optional parameter ENV is a list, then search this list instead of +`process-environment', and return t when encountering a negative entry. + +If it is a frame, then this function will ignore `process-environment' and +will simply look up the variable in that frame's environment. */) + (variable, env) + Lisp_Object variable, env; { char *value; int valuelen; - CHECK_STRING (var); - if (getenv_internal (SDATA (var), SBYTES (var), - &value, &valuelen)) + CHECK_STRING (variable); + if (CONSP (env)) + { + if (getenv_internal_1 (SDATA (variable), SBYTES (variable), + &value, &valuelen, env)) + return value ? make_string (value, valuelen) : Qt; + else + return Qnil; + } + else if (getenv_internal (SDATA (variable), SBYTES (variable), + &value, &valuelen, env)) return make_string (value, valuelen); else return Qnil; } -/* A version of getenv that consults process_environment, easily - callable from C. */ +/* A version of getenv that consults the Lisp environment lists, + easily callable from C. */ char * egetenv (var) char *var; @@ -1394,7 +1513,7 @@ egetenv (var) char *value; int valuelen; - if (getenv_internal (var, strlen (var), &value, &valuelen)) + if (getenv_internal (var, strlen (var), &value, &valuelen, Qnil)) return value; else return 0; @@ -1517,8 +1636,8 @@ init_callproc () { char *dir = getenv ("TMPDIR"); Vtemp_file_name_pattern - = Fexpand_file_name (build_string ("emacsXXXXXX"), - build_string (dir)); + = Fexpand_file_name (build_string ("emacsXXXXXX"), + build_string (dir)); } else Vtemp_file_name_pattern = build_string ("/tmp/emacsXXXXXX"); @@ -1534,17 +1653,21 @@ init_callproc () } void -set_process_environment () +set_initial_environment () { register char **envp; - - Vprocess_environment = Qnil; #ifndef CANNOT_DUMP if (initialized) #endif - for (envp = environ; *envp; envp++) - Vprocess_environment = Fcons (build_string (*envp), - Vprocess_environment); + { + for (envp = environ; *envp; envp++) + Vprocess_environment = Fcons (build_string (*envp), + Vprocess_environment); + store_frame_param (SELECTED_FRAME(), Qenvironment, Vprocess_environment); + /* Ideally, the `copy' shouldn't be necessary, but it seems it's frequent + to use `delete' and friends on process-environment. */ + Vinitial_environment = Fcopy_sequence (Vprocess_environment); + } } void @@ -1603,16 +1726,34 @@ If this variable is nil, then Emacs is unable to use a shared directory. */); This is used by `call-process-region'. */); /* This variable is initialized in init_callproc. */ + DEFVAR_LISP ("initial-environment", &Vinitial_environment, + doc: /* List of environment variables inherited from the parent process. +Each element should be a string of the form ENVVARNAME=VALUE. +The elements must normally be decoded (using `locale-coding-system') for use. */); + Vinitial_environment = Qnil; + DEFVAR_LISP ("process-environment", &Vprocess_environment, - doc: /* List of environment variables for subprocesses to inherit. + doc: /* List of overridden environment variables for subprocesses to inherit. Each element should be a string of the form ENVVARNAME=VALUE. + +Entries in this list take precedence to those in the frame-local +environments. Therefore, let-binding `process-environment' is an easy +way to temporarily change the value of an environment variable, +irrespective of where it comes from. To use `process-environment' to +remove an environment variable, include only its name in the list, +without "=VALUE". + +This variable is set to nil when Emacs starts. + If multiple entries define the same variable, the first one always takes precedence. -The environment which Emacs inherits is placed in this variable -when Emacs starts. + Non-ASCII characters are encoded according to the initial value of -`locale-coding-system', i.e. the elements must normally be decoded for use. +`locale-coding-system', i.e. the elements must normally be decoded for +use. + See `setenv' and `getenv'. */); + Vprocess_environment = Qnil; #ifndef VMS defsubr (&Scall_process); @@ -23,8 +23,13 @@ Boston, MA 02110-1301, USA. */ #include <config.h> #include <stdio.h> + +#include "lisp.h" +#include "frame.h" #include "cm.h" #include "termhooks.h" +#include "termchar.h" + /* For now, don't try to include termcap.h. On some systems, configure finds a non-standard termcap.h that the main build @@ -53,13 +58,16 @@ evalcost (c) return c; } +/* The terminal to use for low-level output. */ +struct tty_display_info *current_tty; + int cmputc (c) char c; { - if (termscript) - fputc (c & 0177, termscript); - putchar (c & 0177); + if (current_tty->termscript) + putc (c & 0177, current_tty->termscript); + putc (c & 0177, current_tty->output); return c; } @@ -72,9 +80,9 @@ cmputc (c) */ static -at (row, col) { - curY = row; - curX = col; +at (tty, row, col) { + curY (tty) = row; + curX (tty) = col; } /* @@ -82,8 +90,8 @@ at (row, col) { */ static -addcol (n) { - curX += n; +addcol (tty, n) { + curX (tty) += n; /* * If cursor hit edge of screen, what happened? @@ -93,21 +101,21 @@ addcol (n) { * of the last line. */ - if (curX == Wcm.cm_cols) { + if (curX (tty) == tty->Wcm->cm_cols) { /* * Well, if magicwrap, still there, past the edge of the * screen (!). If autowrap, on the col 0 of the next line. * Otherwise on last column. */ - if (Wcm.cm_magicwrap) + if (tty->Wcm->cm_magicwrap) ; /* "limbo" */ - else if (Wcm.cm_autowrap) { - curX = 0; - curY++; /* Beware end of screen! */ + else if (tty->Wcm->cm_autowrap) { + curX (tty) = 0; + curY (tty) ++; /* Beware end of screen! */ } else - curX--; + curX (tty)--; } } #endif @@ -123,20 +131,20 @@ addcol (n) { * after we reach the last column; this takes us to a known state. */ void -cmcheckmagic () +cmcheckmagic (struct tty_display_info *tty) { - if (curX == FrameCols) + if (curX (tty) == FrameCols (tty)) { - if (!MagicWrap || curY >= FrameRows - 1) + if (!MagicWrap (tty) || curY (tty) >= FrameRows (tty) - 1) abort (); - if (termscript) - putc ('\r', termscript); - putchar ('\r'); - if (termscript) - putc ('\n', termscript); - putchar ('\n'); - curX = 0; - curY++; + if (tty->termscript) + putc ('\r', tty->termscript); + putc ('\r', tty->output); + if (tty->termscript) + putc ('\n', tty->termscript); + putc ('\n', tty->output); + curX (tty) = 0; + curY (tty)++; } } @@ -148,21 +156,21 @@ cmcheckmagic () */ void -cmcostinit () +cmcostinit (struct tty_display_info *tty) { char *p; #define COST(x,e) (x ? (cost = 0, tputs (x, 1, e), cost) : BIG) #define CMCOST(x,e) ((x == 0) ? BIG : (p = tgoto(x, 0, 0), COST(p ,e))) - Wcm.cc_up = COST (Wcm.cm_up, evalcost); - Wcm.cc_down = COST (Wcm.cm_down, evalcost); - Wcm.cc_left = COST (Wcm.cm_left, evalcost); - Wcm.cc_right = COST (Wcm.cm_right, evalcost); - Wcm.cc_home = COST (Wcm.cm_home, evalcost); - Wcm.cc_cr = COST (Wcm.cm_cr, evalcost); - Wcm.cc_ll = COST (Wcm.cm_ll, evalcost); - Wcm.cc_tab = Wcm.cm_tabwidth ? COST (Wcm.cm_tab, evalcost) : BIG; + tty->Wcm->cc_up = COST (tty->Wcm->cm_up, evalcost); + tty->Wcm->cc_down = COST (tty->Wcm->cm_down, evalcost); + tty->Wcm->cc_left = COST (tty->Wcm->cm_left, evalcost); + tty->Wcm->cc_right = COST (tty->Wcm->cm_right, evalcost); + tty->Wcm->cc_home = COST (tty->Wcm->cm_home, evalcost); + tty->Wcm->cc_cr = COST (tty->Wcm->cm_cr, evalcost); + tty->Wcm->cc_ll = COST (tty->Wcm->cm_ll, evalcost); + tty->Wcm->cc_tab = tty->Wcm->cm_tabwidth ? COST (tty->Wcm->cm_tab, evalcost) : BIG; /* * These last three are actually minimum costs. When (if) they are @@ -173,9 +181,9 @@ cmcostinit () * cursor motion seem to take straight numeric values. --ACT) */ - Wcm.cc_abs = CMCOST (Wcm.cm_abs, evalcost); - Wcm.cc_habs = CMCOST (Wcm.cm_habs, evalcost); - Wcm.cc_vabs = CMCOST (Wcm.cm_vabs, evalcost); + tty->Wcm->cc_abs = CMCOST (tty->Wcm->cm_abs, evalcost); + tty->Wcm->cc_habs = CMCOST (tty->Wcm->cm_habs, evalcost); + tty->Wcm->cc_vabs = CMCOST (tty->Wcm->cm_vabs, evalcost); #undef CMCOST #undef COST @@ -188,8 +196,8 @@ cmcostinit () */ static int -calccost (srcy, srcx, dsty, dstx, doit) - int srcy, srcx, dsty, dstx, doit; +calccost (struct tty_display_info *tty, + int srcy, int srcx, int dsty, int dstx, int doit) { register int deltay, deltax, @@ -206,16 +214,16 @@ calccost (srcy, srcx, dsty, dstx, doit) don't believe the cursor position: give up here and force use of absolute positioning. */ - if (curX == Wcm.cm_cols) + if (curX (tty) == tty->Wcm->cm_cols) goto fail; totalcost = 0; if ((deltay = dsty - srcy) == 0) goto x; if (deltay < 0) - p = Wcm.cm_up, c = Wcm.cc_up, deltay = -deltay; + p = tty->Wcm->cm_up, c = tty->Wcm->cc_up, deltay = -deltay; else - p = Wcm.cm_down, c = Wcm.cc_down; + p = tty->Wcm->cm_down, c = tty->Wcm->cc_down; if (c == BIG) { /* caint get thar from here */ if (doit) printf ("OOPS"); @@ -224,16 +232,16 @@ calccost (srcy, srcx, dsty, dstx, doit) totalcost = c * deltay; if (doit) while (--deltay >= 0) - tputs (p, 1, cmputc); + emacs_tputs (tty, p, 1, cmputc); x: if ((deltax = dstx - srcx) == 0) goto done; if (deltax < 0) { - p = Wcm.cm_left, c = Wcm.cc_left, deltax = -deltax; + p = tty->Wcm->cm_left, c = tty->Wcm->cc_left, deltax = -deltax; goto dodelta; /* skip all the tab junk */ } /* Tabs (the toughie) */ - if (Wcm.cc_tab >= BIG || !Wcm.cm_usetabs) + if (tty->Wcm->cc_tab >= BIG || !tty->Wcm->cm_usetabs) goto olddelta; /* forget it! */ /* @@ -244,12 +252,12 @@ x: * we will put into tabx (for ntabs) and tab2x (for n2tabs)). */ - ntabs = (deltax + srcx % Wcm.cm_tabwidth) / Wcm.cm_tabwidth; + ntabs = (deltax + srcx % tty->Wcm->cm_tabwidth) / tty->Wcm->cm_tabwidth; n2tabs = ntabs + 1; - tabx = (srcx / Wcm.cm_tabwidth + ntabs) * Wcm.cm_tabwidth; - tab2x = tabx + Wcm.cm_tabwidth; + tabx = (srcx / tty->Wcm->cm_tabwidth + ntabs) * tty->Wcm->cm_tabwidth; + tab2x = tabx + tty->Wcm->cm_tabwidth; - if (tab2x >= Wcm.cm_cols) /* too far (past edge) */ + if (tab2x >= tty->Wcm->cm_cols) /* too far (past edge) */ n2tabs = 0; /* @@ -257,12 +265,12 @@ x: * for using n2tabs, then pick the minimum. */ - /* cost for ntabs + cost for right motion */ - tabcost = ntabs ? ntabs * Wcm.cc_tab + (dstx - tabx) * Wcm.cc_right + /* cost for ntabs + cost for right motion */ + tabcost = ntabs ? ntabs * tty->Wcm->cc_tab + (dstx - tabx) * tty->Wcm->cc_right : BIG; - /* cost for n2tabs + cost for left motion */ - c = n2tabs ? n2tabs * Wcm.cc_tab + (tab2x - dstx) * Wcm.cc_left + /* cost for n2tabs + cost for left motion */ + c = n2tabs ? n2tabs * tty->Wcm->cc_tab + (tab2x - dstx) * tty->Wcm->cc_left : BIG; if (c < tabcost) /* then cheaper to overshoot & back up */ @@ -275,11 +283,11 @@ x: * See if tabcost is less than just moving right */ - if (tabcost < (deltax * Wcm.cc_right)) { + if (tabcost < (deltax * tty->Wcm->cc_right)) { totalcost += tabcost; /* use the tabs */ if (doit) while (--ntabs >= 0) - tputs (Wcm.cm_tab, 1, cmputc); + emacs_tputs (tty, tty->Wcm->cm_tab, 1, cmputc); srcx = tabx; } @@ -292,9 +300,9 @@ newdelta: goto done; olddelta: if (deltax > 0) - p = Wcm.cm_right, c = Wcm.cc_right; + p = tty->Wcm->cm_right, c = tty->Wcm->cc_right; else - p = Wcm.cm_left, c = Wcm.cc_left, deltax = -deltax; + p = tty->Wcm->cm_left, c = tty->Wcm->cc_left, deltax = -deltax; dodelta: if (c == BIG) { /* caint get thar from here */ @@ -306,7 +314,7 @@ fail: totalcost += c * deltax; if (doit) while (--deltax >= 0) - tputs (p, 1, cmputc); + emacs_tputs (tty, p, 1, cmputc); done: return totalcost; } @@ -324,7 +332,8 @@ losecursor () #define USECR 3 void -cmgoto (row, col) +cmgoto (tty, row, col) + struct tty_display_info *tty; int row, col; { int homecost, @@ -337,47 +346,47 @@ cmgoto (row, col) *dcm; /* First the degenerate case */ - if (row == curY && col == curX) /* already there */ + if (row == curY (tty) && col == curX (tty)) /* already there */ return; - if (curY >= 0 && curX >= 0) + if (curY (tty) >= 0 && curX (tty) >= 0) { /* We may have quick ways to go to the upper-left, bottom-left, * start-of-line, or start-of-next-line. Or it might be best to * start where we are. Examine the options, and pick the cheapest. */ - relcost = calccost (curY, curX, row, col, 0); + relcost = calccost (tty, curY (tty), curX (tty), row, col, 0); use = USEREL; - if ((homecost = Wcm.cc_home) < BIG) - homecost += calccost (0, 0, row, col, 0); + if ((homecost = tty->Wcm->cc_home) < BIG) + homecost += calccost (tty, 0, 0, row, col, 0); if (homecost < relcost) - relcost = homecost, use = USEHOME; - if ((llcost = Wcm.cc_ll) < BIG) - llcost += calccost (Wcm.cm_rows - 1, 0, row, col, 0); + relcost = homecost, use = USEHOME; + if ((llcost = tty->Wcm->cc_ll) < BIG) + llcost += calccost (tty, tty->Wcm->cm_rows - 1, 0, row, col, 0); if (llcost < relcost) - relcost = llcost, use = USELL; - if ((crcost = Wcm.cc_cr) < BIG) { - if (Wcm.cm_autolf) - if (curY + 1 >= Wcm.cm_rows) - crcost = BIG; + relcost = llcost, use = USELL; + if ((crcost = tty->Wcm->cc_cr) < BIG) { + if (tty->Wcm->cm_autolf) + if (curY (tty) + 1 >= tty->Wcm->cm_rows) + crcost = BIG; else - crcost += calccost (curY + 1, 0, row, col, 0); + crcost += calccost (tty, curY (tty) + 1, 0, row, col, 0); else - crcost += calccost (curY, 0, row, col, 0); + crcost += calccost (tty, curY (tty), 0, row, col, 0); } if (crcost < relcost) relcost = crcost, use = USECR; - directcost = Wcm.cc_abs, dcm = Wcm.cm_abs; - if (row == curY && Wcm.cc_habs < BIG) - directcost = Wcm.cc_habs, dcm = Wcm.cm_habs; - else if (col == curX && Wcm.cc_vabs < BIG) - directcost = Wcm.cc_vabs, dcm = Wcm.cm_vabs; + directcost = tty->Wcm->cc_abs, dcm = tty->Wcm->cm_abs; + if (row == curY (tty) && tty->Wcm->cc_habs < BIG) + directcost = tty->Wcm->cc_habs, dcm = tty->Wcm->cm_habs; + else if (col == curX (tty) && tty->Wcm->cc_vabs < BIG) + directcost = tty->Wcm->cc_vabs, dcm = tty->Wcm->cm_vabs; } else { directcost = 0, relcost = 100000; - dcm = Wcm.cm_abs; + dcm = tty->Wcm->cm_abs; } /* @@ -388,13 +397,14 @@ cmgoto (row, col) { /* compute REAL direct cost */ cost = 0; - p = dcm == Wcm.cm_habs ? tgoto (dcm, row, col) : - tgoto (dcm, col, row); - tputs (p, 1, evalcost); + p = (dcm == tty->Wcm->cm_habs + ? tgoto (dcm, row, col) + : tgoto (dcm, col, row)); + emacs_tputs (tty, p, 1, evalcost); if (cost <= relcost) { /* really is cheaper */ - tputs (p, 1, cmputc); - curY = row, curX = col; + emacs_tputs (tty, p, 1, cmputc); + curY (tty) = row, curX (tty) = col; return; } } @@ -402,25 +412,25 @@ cmgoto (row, col) switch (use) { case USEHOME: - tputs (Wcm.cm_home, 1, cmputc); - curY = 0, curX = 0; + emacs_tputs (tty, tty->Wcm->cm_home, 1, cmputc); + curY (tty) = 0, curX (tty) = 0; break; case USELL: - tputs (Wcm.cm_ll, 1, cmputc); - curY = Wcm.cm_rows - 1, curX = 0; + emacs_tputs (tty, tty->Wcm->cm_ll, 1, cmputc); + curY (tty) = tty->Wcm->cm_rows - 1, curX (tty) = 0; break; case USECR: - tputs (Wcm.cm_cr, 1, cmputc); - if (Wcm.cm_autolf) - curY++; - curX = 0; + emacs_tputs (tty, tty->Wcm->cm_cr, 1, cmputc); + if (tty->Wcm->cm_autolf) + curY (tty)++; + curX (tty) = 0; break; } - (void) calccost (curY, curX, row, col, 1); - curY = row, curX = col; + (void) calccost (tty, curY (tty), curX (tty), row, col, 1); + curY (tty) = row, curX (tty) = col; } /* Clear out all terminal info. @@ -428,9 +438,9 @@ cmgoto (row, col) */ void -Wcm_clear () +Wcm_clear (struct tty_display_info *tty) { - bzero (&Wcm, sizeof Wcm); + bzero (tty->Wcm, sizeof (struct cm)); UP = 0; BC = 0; } @@ -443,21 +453,21 @@ Wcm_clear () */ int -Wcm_init () +Wcm_init (struct tty_display_info *tty) { #if 0 - if (Wcm.cm_abs && !Wcm.cm_ds) + if (tty->Wcm->cm_abs && !tty->Wcm->cm_ds) return 0; #endif - if (Wcm.cm_abs) + if (tty->Wcm->cm_abs) return 0; /* Require up and left, and, if no absolute, down and right */ - if (!Wcm.cm_up || !Wcm.cm_left) + if (!tty->Wcm->cm_up || !tty->Wcm->cm_left) return - 1; - if (!Wcm.cm_abs && (!Wcm.cm_down || !Wcm.cm_right)) + if (!tty->Wcm->cm_abs && (!tty->Wcm->cm_down || !tty->Wcm->cm_right)) return - 1; /* Check that we know the size of the screen.... */ - if (Wcm.cm_rows <= 0 || Wcm.cm_cols <= 0) + if (tty->Wcm->cm_rows <= 0 || tty->Wcm->cm_cols <= 0) return - 2; return 0; } @@ -99,76 +99,78 @@ struct cm int cc_vabs; }; -extern struct cm Wcm; /* Terminal capabilities */ extern char PC; /* Pad character */ /* Shorthand */ #ifndef NoCMShortHand -#define curY Wcm.cm_curY -#define curX Wcm.cm_curX -#define Up Wcm.cm_up -#define Down Wcm.cm_down -#define Left Wcm.cm_left -#define Right Wcm.cm_right -#define Tab Wcm.cm_tab -#define BackTab Wcm.cm_backtab -#define TabWidth Wcm.cm_tabwidth -#define CR Wcm.cm_cr -#define Home Wcm.cm_home -#define LastLine Wcm.cm_ll -#define AbsPosition Wcm.cm_abs -#define ColPosition Wcm.cm_habs -#define RowPosition Wcm.cm_vabs -#define MultiUp Wcm.cm_multiup -#define MultiDown Wcm.cm_multidown -#define MultiLeft Wcm.cm_multileft -#define MultiRight Wcm.cm_multiright -#define AutoWrap Wcm.cm_autowrap -#define MagicWrap Wcm.cm_magicwrap -#define UseTabs Wcm.cm_usetabs -#define FrameRows Wcm.cm_rows -#define FrameCols Wcm.cm_cols - -#define UpCost Wcm.cc_up -#define DownCost Wcm.cc_down -#define LeftCost Wcm.cc_left -#define RightCost Wcm.cc_right -#define HomeCost Wcm.cc_home -#define CRCost Wcm.cc_cr -#define LastLineCost Wcm.cc_ll -#define TabCost Wcm.cc_tab -#define BackTabCost Wcm.cc_backtab -#define AbsPositionCost Wcm.cc_abs -#define ColPositionCost Wcm.cc_habs -#define RowPositionCost Wcm.cc_vabs -#define MultiUpCost Wcm.cc_multiup -#define MultiDownCost Wcm.cc_multidown -#define MultiLeftCost Wcm.cc_multileft -#define MultiRightCost Wcm.cc_multiright +#define curY(tty) (tty)->Wcm->cm_curY +#define curX(tty) (tty)->Wcm->cm_curX +#define Up(tty) (tty)->Wcm->cm_up +#define Down(tty) (tty)->Wcm->cm_down +#define Left(tty) (tty)->Wcm->cm_left +#define Right(tty) (tty)->Wcm->cm_right +#define Tab(tty) (tty)->Wcm->cm_tab +#define BackTab(tty) (tty)->Wcm->cm_backtab +#define TabWidth(tty) (tty)->Wcm->cm_tabwidth +#define CR(tty) (tty)->Wcm->cm_cr +#define Home(tty) (tty)->Wcm->cm_home +#define LastLine(tty) (tty)->Wcm->cm_ll +#define AbsPosition(tty) (tty)->Wcm->cm_abs +#define ColPosition(tty) (tty)->Wcm->cm_habs +#define RowPosition(tty) (tty)->Wcm->cm_vabs +#define MultiUp(tty) (tty)->Wcm->cm_multiup +#define MultiDown(tty) (tty)->Wcm->cm_multidown +#define MultiLeft(tty) (tty)->Wcm->cm_multileft +#define MultiRight(tty) (tty)->Wcm->cm_multiright +#define AutoWrap(tty) (tty)->Wcm->cm_autowrap +#define MagicWrap(tty) (tty)->Wcm->cm_magicwrap +#define UseTabs(tty) (tty)->Wcm->cm_usetabs +#define FrameRows(tty) (tty)->Wcm->cm_rows +#define FrameCols(tty) (tty)->Wcm->cm_cols + +#define UpCost(tty) (tty)->Wcm->cc_up +#define DownCost(tty) (tty)->Wcm->cc_down +#define LeftCost(tty) (tty)->Wcm->cc_left +#define RightCost(tty) (tty)->Wcm->cc_right +#define HomeCost(tty) (tty)->Wcm->cc_home +#define CRCost(tty) (tty)->Wcm->cc_cr +#define LastLineCost(tty) (tty)->Wcm->cc_ll +#define TabCost(tty) (tty)->Wcm->cc_tab +#define BackTabCost(tty) (tty)->Wcm->cc_backtab +#define AbsPositionCost(tty) (tty)->Wcm->cc_abs +#define ColPositionCost(tty) (tty)->Wcm->cc_habs +#define RowPositionCost(tty) (tty)->Wcm->cc_vabs +#define MultiUpCost(tty) (tty)->Wcm->cc_multiup +#define MultiDownCost(tty) (tty)->Wcm->cc_multidown +#define MultiLeftCost(tty) (tty)->Wcm->cc_multileft +#define MultiRightCost(tty) (tty)->Wcm->cc_multiright #endif -#define cmat(row,col) (curY = (row), curX = (col)) -#define cmplus(n) \ - { \ - if ((curX += (n)) >= FrameCols && !MagicWrap) \ - { \ - if (Wcm.cm_losewrap) losecursor (); \ - else if (AutoWrap) curX = 0, curY++; \ - else curX--; \ - } \ +#define cmat(tty,row,col) (curY(tty) = (row), curX(tty) = (col)) +#define cmplus(tty,n) \ + { \ + if ((curX (tty) += (n)) >= FrameCols (tty) && !MagicWrap (tty)) \ + { \ + if ((tty)->Wcm->cm_losewrap) losecursor (tty); \ + else if (AutoWrap (tty)) curX (tty) = 0, curY (tty)++; \ + else curX (tty)--; \ + } \ } -#define losecursor() (curX = -1, curY = -1) +#define losecursor(tty) (curX(tty) = -1, curY(tty) = -1) extern int cost; extern int evalcost (); -extern void cmcheckmagic (); -extern int cmputc (); -extern void cmcostinit (); -extern void cmgoto (); -extern void Wcm_clear (); -extern int Wcm_init (); +#define emacs_tputs(tty, str, affcnt, putc) (current_tty = (tty), tputs (str, affcnt, putc)) + +extern struct tty_display_info *current_tty; +extern void cmcheckmagic P_ ((struct tty_display_info *)); +extern int cmputc P_ ((int)); +extern void cmcostinit P_ ((struct tty_display_info *)); +extern void cmgoto P_ ((struct tty_display_info *, int, int)); +extern void Wcm_clear P_ ((struct tty_display_info *)); +extern int Wcm_init P_ ((struct tty_display_info *)); /* arch-tag: acc1535a-7136-49d6-b22d-9bc85702251b (do not change this comment) */ diff --git a/src/coding.c b/src/coding.c index 20c6c000c7d..8ab5a1107aa 100644 --- a/src/coding.c +++ b/src/coding.c @@ -300,6 +300,8 @@ encode_coding_XXX (coding) #include "composite.h" #include "coding.h" #include "window.h" +#include "frame.h" +#include "termhooks.h" Lisp_Object Vcoding_system_hash_table; @@ -381,15 +383,12 @@ int inhibit_iso_escape_detection; /* Flag to make buffer-file-coding-system inherit from process-coding. */ int inherit_process_coding_system; -/* Coding system to be used to encode text for terminal display. */ -struct coding_system terminal_coding; - /* Coding system to be used to encode text for terminal display when terminal coding system is nil. */ struct coding_system safe_terminal_coding; -/* Coding system of what is sent from terminal keyboard. */ -struct coding_system keyboard_coding; +/* Default coding system to be used to write a file. */ +struct coding_system default_buffer_file_coding; Lisp_Object Vfile_coding_system_alist; Lisp_Object Vprocess_coding_system_alist; @@ -8286,23 +8285,22 @@ Return the corresponding character code in Big5. */) } -DEFUN ("set-terminal-coding-system-internal", - Fset_terminal_coding_system_internal, - Sset_terminal_coding_system_internal, 1, 1, 0, +DEFUN ("set-terminal-coding-system-internal", Fset_terminal_coding_system_internal, + Sset_terminal_coding_system_internal, 1, 2, 0, doc: /* Internal use only. */) - (coding_system) + (coding_system, terminal) Lisp_Object coding_system; + Lisp_Object terminal; { + struct coding_system *terminal_coding = TERMINAL_TERMINAL_CODING (get_terminal (terminal, 1)); CHECK_SYMBOL (coding_system); - setup_coding_system (Fcheck_coding_system (coding_system), - &terminal_coding); - + setup_coding_system (Fcheck_coding_system (coding_system), terminal_coding); /* We had better not send unsafe characters to terminal. */ - terminal_coding.mode |= CODING_MODE_SAFE_ENCODING; + terminal_coding->mode |= CODING_MODE_SAFE_ENCODING; /* Characer composition should be disabled. */ - terminal_coding.common_flags &= ~CODING_ANNOTATE_COMPOSITION_MASK; - terminal_coding.src_multibyte = 1; - terminal_coding.dst_multibyte = 0; + terminal_coding->common_flags &= ~CODING_ANNOTATE_COMPOSITION_MASK; + terminal_coding->src_multibyte = 1; + terminal_coding->dst_multibyte = 0; return Qnil; } @@ -8323,30 +8321,35 @@ DEFUN ("set-safe-terminal-coding-system-internal", return Qnil; } -DEFUN ("terminal-coding-system", - Fterminal_coding_system, Sterminal_coding_system, 0, 0, 0, - doc: /* Return coding system specified for terminal output. */) - () +DEFUN ("terminal-coding-system", Fterminal_coding_system, + Sterminal_coding_system, 0, 1, 0, + doc: /* Return coding system specified for terminal output on the given terminal. +TERMINAL may be a terminal id, a frame, or nil for the selected +frame's terminal device. */) + (terminal) + Lisp_Object terminal; { Lisp_Object coding_system; - coding_system = CODING_ID_NAME (terminal_coding.id); + coding_system = TERMINAL_TERMINAL_CODING (get_terminal (terminal, 1))->symbol; /* For backward compatibility, return nil if it is `undecided'. */ return (! EQ (coding_system, Qundecided) ? coding_system : Qnil); } -DEFUN ("set-keyboard-coding-system-internal", - Fset_keyboard_coding_system_internal, - Sset_keyboard_coding_system_internal, 1, 1, 0, +DEFUN ("set-keyboard-coding-system-internal", Fset_keyboard_coding_system_internal, + Sset_keyboard_coding_system_internal, 1, 2, 0, doc: /* Internal use only. */) - (coding_system) + (coding_system, terminal) Lisp_Object coding_system; + Lisp_Object terminal; { + struct terminal *t = get_terminal (terminal, 1); CHECK_SYMBOL (coding_system); setup_coding_system (Fcheck_coding_system (coding_system), - &keyboard_coding); + TERMINAL_KEYBOARD_CODING (t)); /* Characer composition should be disabled. */ - keyboard_coding.common_flags &= ~CODING_ANNOTATE_COMPOSITION_MASK; + TERMINAL_KEYBOARD_CODING (t)->common_flags + &= ~CODING_ANNOTATE_COMPOSITION_MASK; return Qnil; } diff --git a/src/coding.h b/src/coding.h index 134402f3256..573632abb9b 100644 --- a/src/coding.h +++ b/src/coding.h @@ -742,19 +742,12 @@ extern Lisp_Object Vlocale_coding_system; the subprocess output. */ extern int inherit_process_coding_system; -/* Coding-system to be used for encoding terminal output. This - structure contains information of a coding-system specified by the - function `set-terminal-coding-system'. */ -extern struct coding_system terminal_coding; - /* Coding system to be used to encode text for terminal display when terminal coding system is nil. */ extern struct coding_system safe_terminal_coding; -/* Coding-system of what is sent from terminal keyboard. This - structure contains information of a coding-system specified by the - function `set-keyboard-coding-system'. */ -extern struct coding_system keyboard_coding; +/* Default coding system to be used to write a file. */ +extern struct coding_system default_buffer_file_coding; /* Default coding systems used for process I/O. */ extern Lisp_Object Vdefault_process_coding_system; diff --git a/src/config.in b/src/config.in index f2636c50626..60be3c22003 100644 --- a/src/config.in +++ b/src/config.in @@ -941,6 +941,13 @@ Boston, MA 02110-1301, USA. */ #define HAVE_MOUSE #endif +/* Multi-tty support relies on MULTI_KBOARD. It seems safe to turn it + on unconditionally. Note that src/s/darwin.h disables this at + present. */ +#ifndef MULTI_KBOARD +#define MULTI_KBOARD +#endif + /* If we're using the Carbon API on Mac OS X, define a few more variables as well. */ #ifdef HAVE_CARBON diff --git a/src/data.c b/src/data.c index b262f6e2b92..6439686dcd9 100644 --- a/src/data.c +++ b/src/data.c @@ -30,6 +30,7 @@ Boston, MA 02110-1301, USA. */ #include "keyboard.h" #include "frame.h" #include "syssignal.h" +#include "termhooks.h" /* For FRAME_KBOARD reference in y-or-n-p. */ #ifdef STDC_HEADERS #include <float.h> @@ -769,8 +770,11 @@ Value, if non-nil, is a list \(interactive SPEC). */) if (SUBRP (fun)) { - if (XSUBR (fun)->prompt) - return list2 (Qinteractive, build_string (XSUBR (fun)->prompt)); + char *spec = XSUBR (fun)->intspec; + if (spec) + return list2 (Qinteractive, + (*spec != '(') ? build_string (spec) : + Fcar (Fread_from_string (build_string (spec), Qnil, Qnil))); } else if (COMPILEDP (fun)) { @@ -873,7 +877,18 @@ do_symval_forwarding (valcontents) case Lisp_Misc_Kboard_Objfwd: offset = XKBOARD_OBJFWD (valcontents)->offset; - return *(Lisp_Object *)(offset + (char *)current_kboard); + /* We used to simply use current_kboard here, but from Lisp + code, it's value is often unexpected. It seems nicer to + allow constructions like this to work as intuitively expected: + + (with-selected-frame frame + (define-key local-function-map "\eOP" [f1])) + + On the other hand, this affects the semantics of + last-command and real-last-command, and people may rely on + that. I took a quick look at the Lisp codebase, and I + don't think anything will break. --lorentey */ + return *(Lisp_Object *)(offset + (char *)FRAME_KBOARD (SELECTED_FRAME ())); } return valcontents; } @@ -961,7 +976,7 @@ store_symval_forwarding (symbol, valcontents, newval, buf) case Lisp_Misc_Kboard_Objfwd: { - char *base = (char *) current_kboard; + char *base = (char *) FRAME_KBOARD (SELECTED_FRAME ()); char *p = base + XKBOARD_OBJFWD (valcontents)->offset; *(Lisp_Object *) p = newval; } @@ -1107,7 +1122,7 @@ find_symbol_value (symbol) case Lisp_Misc_Kboard_Objfwd: return *(Lisp_Object *)(XKBOARD_OBJFWD (valcontents)->offset - + (char *)current_kboard); + + (char *)FRAME_KBOARD (SELECTED_FRAME ())); } } @@ -1868,6 +1883,51 @@ If the current binding is global (the default), the value is nil. */) return Qnil; } + +/* This code is disabled now that we use the selected frame to return + keyboard-local-values. */ +#if 0 +extern struct terminal *get_terminal P_ ((Lisp_Object display, int)); + +DEFUN ("terminal-local-value", Fterminal_local_value, Sterminal_local_value, 2, 2, 0, + doc: /* Return the terminal-local value of SYMBOL on TERMINAL. +If SYMBOL is not a terminal-local variable, then return its normal +value, like `symbol-value'. + +TERMINAL may be a terminal id, a frame, or nil (meaning the +selected frame's terminal device). */) + (symbol, terminal) + Lisp_Object symbol; + Lisp_Object terminal; +{ + Lisp_Object result; + struct terminal *t = get_terminal (terminal, 1); + push_kboard (t->kboard); + result = Fsymbol_value (symbol); + pop_kboard (); + return result; +} + +DEFUN ("set-terminal-local-value", Fset_terminal_local_value, Sset_terminal_local_value, 3, 3, 0, + doc: /* Set the terminal-local binding of SYMBOL on TERMINAL to VALUE. +If VARIABLE is not a terminal-local variable, then set its normal +binding, like `set'. + +TERMINAL may be a terminal id, a frame, or nil (meaning the +selected frame's terminal device). */) + (symbol, terminal, value) + Lisp_Object symbol; + Lisp_Object terminal; + Lisp_Object value; +{ + Lisp_Object result; + struct terminal *t = get_terminal (terminal, 1); + push_kboard (d->kboard); + result = Fset (symbol, value); + pop_kboard (); + return result; +} +#endif /* Find the function at the end of a chain of symbol function indirections. */ @@ -3173,6 +3233,10 @@ syms_of_data () defsubr (&Slocal_variable_p); defsubr (&Slocal_variable_if_set_p); defsubr (&Svariable_binding_locus); +#if 0 /* XXX Remove this. --lorentey */ + defsubr (&Sterminal_local_value); + defsubr (&Sset_terminal_local_value); +#endif defsubr (&Saref); defsubr (&Saset); defsubr (&Snumber_to_string); diff --git a/src/dispextern.h b/src/dispextern.h index 6241b5aa2c5..1ba2955fcb9 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -1033,13 +1033,8 @@ extern int fonts_changed_p; extern struct glyph space_glyph; -/* Frame being updated by update_window/update_frame. */ - -extern struct frame *updating_frame; - /* Window being updated by update_window. This is non-null as long as - update_window has not finished, and null otherwise. It's role is - analogous to updating_frame. */ + update_window has not finished, and null otherwise. */ extern struct window *updated_window; @@ -1367,7 +1362,7 @@ struct glyph_string DESCENT = FONT->descent HEIGHT = FONT_HEIGHT (FONT) F_DESCENT = (FRAME_FONT (F)->descent - - F->output_data.x->baseline_offset) + - F->terminal->output_data.x->baseline_offset) F_HEIGHT = FRAME_LINE_HEIGHT (F) */ @@ -2199,16 +2194,16 @@ struct it /* Call produce_glyphs or produce_glyphs_hook, if set. Shortcut to avoid the function call overhead. */ -#define PRODUCE_GLYPHS(IT) \ - do { \ - extern int inhibit_free_realized_faces; \ - if (rif != NULL) \ - rif->produce_glyphs ((IT)); \ - else \ - produce_glyphs ((IT)); \ - if ((IT)->glyph_row != NULL) \ - inhibit_free_realized_faces = 1; \ - } while (0) +#define PRODUCE_GLYPHS(IT) \ + do { \ + extern int inhibit_free_realized_faces; \ + if (FRAME_RIF ((IT)->f) != NULL) \ + FRAME_RIF ((IT)->f)->produce_glyphs ((IT)); \ + else \ + produce_glyphs ((IT)); \ + if ((IT)->glyph_row != NULL) \ + inhibit_free_realized_faces = 1; \ + } while (0) /* Bit-flags indicating what operation move_it_to should perform. */ @@ -2384,10 +2379,6 @@ struct redisplay_interface #endif /* HAVE_WINDOW_SYSTEM */ }; -/* The current interface for window-based redisplay. */ - -extern struct redisplay_interface *rif; - /*********************************************************************** Images @@ -2691,8 +2682,6 @@ void init_iterator_to_row_start P_ ((struct it *, struct window *, struct glyph_row *)); int get_next_display_element P_ ((struct it *)); void set_iterator_to_next P_ ((struct it *, int)); -void produce_glyphs P_ ((struct it *)); -void produce_special_glyphs P_ ((struct it *, enum display_element_type)); void start_display P_ ((struct it *, struct window *, struct text_pos)); void move_it_to P_ ((struct it *, int, int, int, int, int)); void move_it_vertically P_ ((struct it *, int)); @@ -2790,11 +2779,11 @@ int update_window_fringes P_ ((struct window *, int)); void compute_fringe_widths P_ ((struct frame *, int)); #ifdef WINDOWS_NT -void w32_init_fringe P_ ((void)); +void w32_init_fringe P_ ((struct redisplay_interface *)); void w32_reset_fringes P_ ((void)); #endif #ifdef MAC_OS -void mac_init_fringe P_ ((void)); +void mac_init_fringe P_ ((struct redisplay_interface *)); #endif /* Defined in image.c */ @@ -2839,11 +2828,11 @@ int image_ascent P_ ((struct image *, struct face *, struct glyph_slice *)); /* Defined in sysdep.c */ -void get_frame_size P_ ((int *, int *)); +void get_tty_size P_ ((int, int *, int *)); void request_sigio P_ ((void)); void unrequest_sigio P_ ((void)); -int tabs_safe_p P_ ((void)); -void init_baud_rate P_ ((void)); +int tabs_safe_p P_ ((int)); +void init_baud_rate P_ ((int)); void init_sigio P_ ((int)); /* Defined in xfaces.c */ @@ -2986,8 +2975,6 @@ void clear_glyph_row P_ ((struct glyph_row *)); void prepare_desired_row P_ ((struct glyph_row *)); int line_hash_code P_ ((struct glyph_row *)); void set_window_update_flags P_ ((struct window *, int)); -void write_glyphs P_ ((struct glyph *, int)); -void insert_glyphs P_ ((struct glyph *, int)); void redraw_frame P_ ((struct frame *)); void redraw_garbaged_frames P_ ((void)); int scroll_cost P_ ((struct frame *, int, int, int)); @@ -3004,31 +2991,44 @@ void syms_of_display P_ ((void)); extern Lisp_Object Qredisplay_dont_pause; GLYPH spec_glyph_lookup_face P_ ((struct window *, GLYPH)); -/* Defined in term.c */ +/* Defined in terminal.c */ -extern void ring_bell P_ ((void)); -extern void set_terminal_modes P_ ((void)); -extern void reset_terminal_modes P_ ((void)); +extern void ring_bell P_ ((struct frame *)); extern void update_begin P_ ((struct frame *)); extern void update_end P_ ((struct frame *)); -extern void set_terminal_window P_ ((int)); -extern void set_scroll_region P_ ((int, int)); -extern void turn_off_insert P_ ((void)); -extern void turn_off_highlight P_ ((void)); -extern void background_highlight P_ ((void)); -extern void clear_frame P_ ((void)); -extern void clear_end_of_line P_ ((int)); -extern void clear_end_of_line_raw P_ ((int)); -extern void delete_glyphs P_ ((int)); -extern void ins_del_lines P_ ((int, int)); +extern void set_terminal_window P_ ((struct frame *, int)); +extern void cursor_to P_ ((struct frame *, int, int)); +extern void raw_cursor_to P_ ((struct frame *, int, int)); +extern void clear_to_end P_ ((struct frame *)); +extern void clear_frame P_ ((struct frame *)); +extern void clear_end_of_line P_ ((struct frame *, int)); +extern void write_glyphs P_ ((struct frame *, struct glyph *, int)); +extern void insert_glyphs P_ ((struct frame *, struct glyph *, int)); +extern void delete_glyphs P_ ((struct frame *, int)); +extern void ins_del_lines P_ ((struct frame *, int, int)); + +extern struct terminal *init_initial_terminal P_ ((void)); + + +/* Defined in term.c */ + +extern void tty_set_terminal_modes P_ ((struct terminal *)); +extern void tty_reset_terminal_modes P_ ((struct terminal *)); +extern void tty_turn_off_insert P_ ((struct tty_display_info *)); +extern void tty_turn_off_highlight P_ ((struct tty_display_info *)); extern int string_cost P_ ((char *)); extern int per_line_cost P_ ((char *)); extern void calculate_costs P_ ((struct frame *)); +extern void produce_glyphs P_ ((struct it *)); +extern void produce_special_glyphs P_ ((struct it *, enum display_element_type)); +extern int tty_capable_p P_ ((struct tty_display_info *, unsigned, unsigned long, unsigned long)); extern void set_tty_color_mode P_ ((struct frame *, Lisp_Object)); -extern void tty_setup_colors P_ ((int)); -extern void term_init P_ ((char *)); -void cursor_to P_ ((int, int)); -extern int tty_capable_p P_ ((struct frame *, unsigned, unsigned long, unsigned long)); +extern struct terminal *get_tty_terminal P_ ((Lisp_Object, int)); +extern struct terminal *get_named_tty P_ ((char *)); +EXFUN (Ftty_type, 1); +extern void create_tty_output P_ ((struct frame *)); +extern struct terminal *init_tty P_ ((char *, char *, int)); + /* Defined in scroll.c */ diff --git a/src/dispnew.c b/src/dispnew.c index 02d0663b560..ab2c1518dce 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -32,7 +32,6 @@ Boston, MA 02110-1301, USA. */ #include "lisp.h" #include "termchar.h" #include "termopts.h" -#include "termhooks.h" /* cm.h must come after dispextern.h on Windows. */ #include "dispextern.h" #include "cm.h" @@ -40,6 +39,7 @@ Boston, MA 02110-1301, USA. */ #include "character.h" #include "keyboard.h" #include "frame.h" +#include "termhooks.h" #include "window.h" #include "commands.h" #include "disptab.h" @@ -238,9 +238,9 @@ int inverse_video; EMACS_INT baud_rate; /* Either nil or a symbol naming the window system under which Emacs - is running. */ + creates the first frame. */ -Lisp_Object Vwindow_system; +Lisp_Object Vinitial_window_system; /* Version number of X windows: 10, 11 or nil. */ @@ -282,14 +282,6 @@ Lisp_Object selected_frame; struct frame *last_nonminibuf_frame; -/* Stdio stream being used for copy of all output. */ - -FILE *termscript; - -/* Structure for info on cursor positioning. */ - -struct cm Wcm; - /* 1 means SIGWINCH happened when not safe. */ int delayed_size_change; @@ -328,11 +320,6 @@ int glyph_pool_count; static struct frame *frame_matrix_frame; -/* Current interface for window-based redisplay. Set from init_xterm. - A null value means we are not using window-based redisplay. */ - -struct redisplay_interface *rif; - /* Non-zero means that fonts have been loaded since the last glyph matrix adjustments. Redisplay must stop, and glyph matrices must be adjusted when this flag becomes non-zero during display. The @@ -1423,7 +1410,7 @@ line_hash_code (row) { int c = glyph->u.ch; int face_id = glyph->face_id; - if (must_write_spaces) + if (FRAME_MUST_WRITE_SPACES (SELECTED_FRAME ())) /* XXX Is SELECTED_FRAME OK here? */ c -= SPACEGLYPH; hash = (((hash << 4) + (hash >> 24)) & 0x0fffffff) + c; hash = (((hash << 4) + (hash >> 24)) & 0x0fffffff) + face_id; @@ -1455,7 +1442,7 @@ line_draw_cost (matrix, vpos) int glyph_table_len = GLYPH_TABLE_LENGTH; /* Ignore trailing and leading spaces if we can. */ - if (!must_write_spaces) + if (!FRAME_MUST_WRITE_SPACES (SELECTED_FRAME ())) /* XXX Is SELECTED_FRAME OK here? */ { /* Skip from the end over trailing spaces. */ while (end > beg && CHAR_GLYPH_SPACE_P (*(end - 1))) @@ -1671,8 +1658,10 @@ realloc_glyph_pool (pool, matrix_dim) #if GLYPH_DEBUG -/* Flush standard output. This is sometimes useful to call from - the debugger. */ +/* Flush standard output. This is sometimes useful to call from the debugger. + XXX Maybe this should be changed to flush the current terminal instead of + stdout. +*/ void flush_stdout () @@ -3393,12 +3382,15 @@ DEFUN ("redraw-frame", Fredraw_frame, Sredraw_frame, 1, 1, 0, return Qnil; update_begin (f); +#ifdef MSDOS if (FRAME_MSDOS_P (f)) - set_terminal_modes (); - clear_frame (); + set_terminal_modes (FRAME_TERMINAL (f)); +#endif + clear_frame (f); clear_current_matrices (f); update_end (f); - fflush (stdout); + if (FRAME_TERMCAP_P (f)) + fflush (FRAME_TTY (f)->output); windows_or_buffers_changed++; /* Mark all windows as inaccurate, so that every window will have its redisplay done. */ @@ -3539,7 +3531,7 @@ direct_output_for_insert (g) /* If we can't insert glyphs, we can use this method only at the end of a line. */ - if (!char_ins_del_ok) + if (!FRAME_CHAR_INS_DEL_OK (f)) if (PT != ZV && FETCH_BYTE (PT_BYTE) != '\n') return 0; @@ -3689,24 +3681,24 @@ direct_output_for_insert (g) updated_row = glyph_row; updated_area = TEXT_AREA; update_begin (f); - if (rif) + if (FRAME_RIF (f)) { - rif->update_window_begin_hook (w); + FRAME_RIF (f)->update_window_begin_hook (w); if (glyphs == end - n /* In front of a space added by append_space. */ || (glyphs == end - n - 1 && (end - n)->charpos <= 0)) - rif->write_glyphs (glyphs, n); + FRAME_RIF (f)->write_glyphs (glyphs, n); else - rif->insert_glyphs (glyphs, n); + FRAME_RIF (f)->insert_glyphs (glyphs, n); } else { if (glyphs == end - n) - write_glyphs (glyphs, n); + write_glyphs (f, glyphs, n); else - insert_glyphs (glyphs, n); + insert_glyphs (f, glyphs, n); } w->cursor.hpos += n; @@ -3719,8 +3711,8 @@ direct_output_for_insert (g) a frame matrix is used, cursor_to expects frame coordinates, and the X and Y parameters are not used. */ if (window_redisplay_p) - rif->cursor_to (w->cursor.vpos, w->cursor.hpos, - w->cursor.y, w->cursor.x); + FRAME_RIF (f)->cursor_to (w->cursor.vpos, w->cursor.hpos, + w->cursor.y, w->cursor.x); else { int x, y; @@ -3729,18 +3721,19 @@ direct_output_for_insert (g) ? XFASTINT (w->left_margin_cols) : 0)); y = WINDOW_TO_FRAME_VPOS (w, w->cursor.vpos); - cursor_to (y, x); + cursor_to (f, y, x); } #ifdef HAVE_WINDOW_SYSTEM update_window_fringes (w, 0); #endif - if (rif) - rif->update_window_end_hook (w, 1, 0); + if (FRAME_RIF (f)) + FRAME_RIF (f)->update_window_end_hook (w, 1, 0); update_end (f); updated_row = NULL; - fflush (stdout); + if (FRAME_TERMCAP_P (f)) + fflush (FRAME_TTY (f)->output); TRACE ((stderr, "direct output for insert\n")); mark_window_display_accurate (it.window, 1); @@ -3818,8 +3811,8 @@ direct_output_forward_char (n) && w->cursor.hpos < w->desired_matrix->matrix_w); if (FRAME_WINDOW_P (f)) - rif->cursor_to (w->cursor.vpos, w->cursor.hpos, - w->cursor.y, w->cursor.x); + FRAME_RIF (f)->cursor_to (w->cursor.vpos, w->cursor.hpos, + w->cursor.y, w->cursor.x); else { int x, y; @@ -3828,10 +3821,11 @@ direct_output_forward_char (n) ? XFASTINT (w->left_margin_cols) : 0)); y = WINDOW_TO_FRAME_VPOS (w, w->cursor.vpos); - cursor_to (y, x); + cursor_to (f, y, x); } - fflush (stdout); + if (FRAME_TERMCAP_P (f)) + fflush (FRAME_TTY (f)->output); redisplay_performed_directly_p = 1; return 1; } @@ -3930,14 +3924,14 @@ update_frame (f, force_p, inhibit_hairy_id_p) update_end (f); /* This flush is a performance bottleneck under X, - and it doesn't seem to be necessary anyway (in general). + and it doesn't seem to be necessary anyway (in general). It is necessary when resizing the window with the mouse, or - at least the fringes are not redrawn in a timely manner. ++kfs */ + at least the fringes are not redrawn in a timely manner. ++kfs */ if (f->force_flush_display_p) - { - rif->flush_display (f); - f->force_flush_display_p = 0; - } + { + FRAME_RIF (f)->flush_display (f); + f->force_flush_display_p = 0; + } } else { @@ -3953,9 +3947,12 @@ update_frame (f, force_p, inhibit_hairy_id_p) paused_p = update_frame_1 (f, force_p, inhibit_hairy_id_p); update_end (f); - if (termscript) - fflush (termscript); - fflush (stdout); + if (FRAME_TERMCAP_P (f)) + { + if (FRAME_TTY (f)->termscript) + fflush (FRAME_TTY (f)->termscript); + fflush (FRAME_TTY (f)->output); + } /* Check window matrices for lost pointers. */ #if GLYPH_DEBUG @@ -4060,7 +4057,8 @@ redraw_overlapped_rows (w, yb) int yb; { int i; - + struct frame *f = XFRAME (WINDOW_FRAME (w)); + /* If rows overlapping others have been changed, the rows being overlapped have to be redrawn. This won't draw lines that have already been drawn in update_window_line because overlapped_p in @@ -4083,10 +4081,12 @@ redraw_overlapped_rows (w, yb) { updated_row = row; updated_area = area; - rif->cursor_to (i, 0, row->y, area == TEXT_AREA ? row->x : 0); + FRAME_RIF (f)->cursor_to (i, 0, row->y, + area == TEXT_AREA ? row->x : 0); if (row->used[area]) - rif->write_glyphs (row->glyphs[area], row->used[area]); - rif->clear_end_of_line (-1); + FRAME_RIF (f)->write_glyphs (row->glyphs[area], + row->used[area]); + FRAME_RIF (f)->clear_end_of_line (-1); } row->overlapped_p = 0; @@ -4108,7 +4108,8 @@ redraw_overlapping_rows (w, yb) { int i, bottom_y; struct glyph_row *row; - + struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w))); + for (i = 0; i < w->current_matrix->nrows; ++i) { row = w->current_matrix->rows + i; @@ -4199,10 +4200,10 @@ update_window (w, force_p) #endif extern int input_pending; extern Lisp_Object do_mouse_tracking; + struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w))); #if GLYPH_DEBUG /* Check that W's frame doesn't have glyph matrices. */ xassert (FRAME_WINDOW_P (XFRAME (WINDOW_FRAME (w)))); - xassert (updating_frame != NULL); #endif /* Check pending input the first time so that we can quickly return. */ @@ -4387,6 +4388,7 @@ update_marginal_area (w, area, vpos) int area, vpos; { struct glyph_row *desired_row = MATRIX_ROW (w->desired_matrix, vpos); + struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w))); /* Let functions in xterm.c know what area subsequent X positions will be relative to. */ @@ -4412,6 +4414,7 @@ update_text_area (w, vpos) { struct glyph_row *current_row = MATRIX_ROW (w->current_matrix, vpos); struct glyph_row *desired_row = MATRIX_ROW (w->desired_matrix, vpos); + struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w))); int changed_p = 0; /* Let functions in xterm.c know what area subsequent X positions @@ -4647,6 +4650,7 @@ update_window_line (w, vpos, mouse_face_overwritten_p) { struct glyph_row *current_row = MATRIX_ROW (w->current_matrix, vpos); struct glyph_row *desired_row = MATRIX_ROW (w->desired_matrix, vpos); + struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w))); int changed_p = 0; /* Set the row being updated. This is important to let xterm.c @@ -4715,6 +4719,7 @@ set_window_cursor_after_update (w) struct window *w; { struct frame *f = XFRAME (w->frame); + struct redisplay_interface *rif = FRAME_RIF (f); int cx, cy, vpos, hpos; /* Not intended for frame matrix updates. */ @@ -4938,6 +4943,7 @@ scrolling_window (w, header_line_p) int i, j, first_old, first_new, last_old, last_new; int nruns, nbytes, n, run_idx; struct row_entry *entry; + struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w))); /* Skip over rows equal at the start. */ for (i = header_line_p ? 1 : 0; i < current_matrix->nrows - 1; ++i) @@ -5262,7 +5268,7 @@ update_frame_1 (f, force_p, inhibit_id_p) #endif /* If we cannot insert/delete lines, it's no use trying it. */ - if (!line_ins_del_ok) + if (!FRAME_LINE_INS_DEL_OK (f)) inhibit_id_p = 1; /* See if any of the desired lines are enabled; don't compute for @@ -5290,18 +5296,18 @@ update_frame_1 (f, force_p, inhibit_id_p) Also flush out if likely to have more than 1k buffered otherwise. I'm told that some telnet connections get really screwed by more than 1k output at once. */ - int outq = PENDING_OUTPUT_COUNT (stdout); + int outq = PENDING_OUTPUT_COUNT (FRAME_TTY (f)->output); if (outq > 900 || (outq > 20 && ((i - 1) % preempt_count == 0))) { - fflush (stdout); + fflush (FRAME_TTY (f)->output); if (preempt_count == 1) { #ifdef EMACS_OUTQSIZE if (EMACS_OUTQSIZE (0, &outq) < 0) /* Probably not a tty. Ignore the error and reset the outq count. */ - outq = PENDING_OUTPUT_COUNT (stdout); + outq = PENDING_OUTPUT_COUNT (FRAME_TTY (f->output)); #endif outq *= 10; if (baud_rate <= outq && baud_rate > 0) @@ -5404,7 +5410,7 @@ update_frame_1 (f, force_p, inhibit_id_p) } } - cursor_to (row, col); + cursor_to (f, row, col); } else { @@ -5426,7 +5432,7 @@ update_frame_1 (f, force_p, inhibit_id_p) x += XFASTINT (w->left_margin_cols); /* x = max (min (x, FRAME_TOTAL_COLS (f) - 1), 0); */ - cursor_to (y, x); + cursor_to (f, y, x); } } } @@ -5495,21 +5501,23 @@ scrolling (frame) } /* If changed lines are few, don't allow preemption, don't scroll. */ - if ((!scroll_region_ok && changed_lines < baud_rate / 2400) + if ((!FRAME_SCROLL_REGION_OK (frame) + && changed_lines < baud_rate / 2400) || unchanged_at_bottom == FRAME_LINES (frame)) return 1; window_size = (FRAME_LINES (frame) - unchanged_at_top - unchanged_at_bottom); - if (scroll_region_ok) + if (FRAME_SCROLL_REGION_OK (frame)) free_at_end_vpos -= unchanged_at_bottom; - else if (memory_below_frame) + else if (FRAME_MEMORY_BELOW_FRAME (frame)) free_at_end_vpos = -1; /* If large window, fast terminal and few lines in common between current frame and desired frame, don't bother with i/d calc. */ - if (!scroll_region_ok && window_size >= 18 && baud_rate > 2400 + if (!FRAME_SCROLL_REGION_OK (frame) + && window_size >= 18 && baud_rate > 2400 && (window_size >= 10 * scrolling_max_lines_saved (unchanged_at_top, FRAME_LINES (frame) - unchanged_at_bottom, @@ -5589,7 +5597,7 @@ update_frame_line (f, vpos) struct glyph_row *current_row = MATRIX_ROW (current_matrix, vpos); struct glyph_row *desired_row = MATRIX_ROW (desired_matrix, vpos); int must_write_whole_line_p; - int write_spaces_p = must_write_spaces; + int write_spaces_p = FRAME_MUST_WRITE_SPACES (f); int colored_spaces_p = (FACE_FROM_ID (f, DEFAULT_FACE_ID)->background != FACE_TTY_DEFAULT_BG_COLOR); @@ -5640,8 +5648,8 @@ update_frame_line (f, vpos) /* Write the contents of the desired line. */ if (nlen) { - cursor_to (vpos, 0); - write_glyphs (nbody, nlen); + cursor_to (f, vpos, 0); + write_glyphs (f, nbody, nlen); } /* Don't call clear_end_of_line if we already wrote the whole @@ -5649,13 +5657,13 @@ update_frame_line (f, vpos) case but in the line below. */ if (nlen < FRAME_TOTAL_COLS (f)) { - cursor_to (vpos, nlen); - clear_end_of_line (FRAME_TOTAL_COLS (f)); + cursor_to (f, vpos, nlen); + clear_end_of_line (f, FRAME_TOTAL_COLS (f)); } else /* Make sure we are in the right row, otherwise cursor movement with cmgoto might use `ch' in the wrong row. */ - cursor_to (vpos, 0); + cursor_to (f, vpos, 0); make_current (desired_matrix, current_matrix, vpos); return; @@ -5668,7 +5676,7 @@ update_frame_line (f, vpos) nlen--; /* If there's no i/d char, quickly do the best we can without it. */ - if (!char_ins_del_ok) + if (!FRAME_CHAR_INS_DEL_OK (f)) { int i, j; @@ -5687,8 +5695,8 @@ update_frame_line (f, vpos) ++j; /* Output this run of non-matching chars. */ - cursor_to (vpos, i); - write_glyphs (nbody + i, j - i); + cursor_to (f, vpos, i); + write_glyphs (f, nbody + i, j - i); i = j - 1; /* Now find the next non-match. */ @@ -5698,8 +5706,8 @@ update_frame_line (f, vpos) /* Clear the rest of the line, or the non-clear part of it. */ if (olen > nlen) { - cursor_to (vpos, nlen); - clear_end_of_line (olen); + cursor_to (f, vpos, nlen); + clear_end_of_line (f, olen); } /* Make current row = desired row. */ @@ -5721,8 +5729,8 @@ update_frame_line (f, vpos) if (nlen > nsp) { - cursor_to (vpos, nsp); - write_glyphs (nbody + nsp, nlen - nsp); + cursor_to (f, vpos, nsp); + write_glyphs (f, nbody + nsp, nlen - nsp); } /* Exchange contents between current_frame and new_frame. */ @@ -5771,7 +5779,8 @@ update_frame_line (f, vpos) tem = (nlen - nsp) - (olen - osp); if (endmatch && tem - && (!char_ins_del_ok || endmatch <= char_ins_del_cost (f)[tem])) + && (!FRAME_CHAR_INS_DEL_OK (f) + || endmatch <= char_ins_del_cost (f)[tem])) endmatch = 0; /* nsp - osp is the distance to insert or delete. @@ -5780,7 +5789,7 @@ update_frame_line (f, vpos) Is it worth it? */ if (nsp != osp - && (!char_ins_del_ok + && (!FRAME_CHAR_INS_DEL_OK (f) || begmatch + endmatch <= char_ins_del_cost (f)[nsp - osp])) { begmatch = 0; @@ -5793,8 +5802,8 @@ update_frame_line (f, vpos) if (osp > nsp) { - cursor_to (vpos, nsp); - delete_glyphs (osp - nsp); + cursor_to (f, vpos, nsp); + delete_glyphs (f, osp - nsp); } else if (nsp > osp) { @@ -5803,12 +5812,12 @@ update_frame_line (f, vpos) must delete first to avoid losing data in the insert */ if (endmatch && nlen < olen + nsp - osp) { - cursor_to (vpos, nlen - endmatch + osp - nsp); - delete_glyphs (olen + nsp - osp - nlen); + cursor_to (f, vpos, nlen - endmatch + osp - nsp); + delete_glyphs (f, olen + nsp - osp - nlen); olen = nlen - (nsp - osp); } - cursor_to (vpos, osp); - insert_glyphs (0, nsp - osp); + cursor_to (f, vpos, osp); + insert_glyphs (f, 0, nsp - osp); } olen += nsp - osp; @@ -5829,8 +5838,8 @@ update_frame_line (f, vpos) unnecessary cursor movement. */ if (nlen - tem > 0) { - cursor_to (vpos, nsp + begmatch); - write_glyphs (nbody + nsp + begmatch, nlen - tem); + cursor_to (f, vpos, nsp + begmatch); + write_glyphs (f, nbody + nsp + begmatch, nlen - tem); } } else if (nlen > olen) @@ -5845,27 +5854,27 @@ update_frame_line (f, vpos) int out = olen - tem; /* Columns to be overwritten originally. */ int del; - cursor_to (vpos, nsp + begmatch); + cursor_to (f, vpos, nsp + begmatch); /* Calculate columns we can actually overwrite. */ while (CHAR_GLYPH_PADDING_P (nbody[nsp + begmatch + out])) out--; - write_glyphs (nbody + nsp + begmatch, out); + write_glyphs (f, nbody + nsp + begmatch, out); /* If we left columns to be overwritten, we must delete them. */ del = olen - tem - out; if (del > 0) - delete_glyphs (del); + delete_glyphs (f, del); /* At last, we insert columns not yet written out. */ - insert_glyphs (nbody + nsp + begmatch + out, nlen - olen + del); + insert_glyphs (f, nbody + nsp + begmatch + out, nlen - olen + del); olen = nlen; } else if (olen > nlen) { - cursor_to (vpos, nsp + begmatch); - write_glyphs (nbody + nsp + begmatch, nlen - tem); - delete_glyphs (olen - nlen); + cursor_to (f, vpos, nsp + begmatch); + write_glyphs (f, nbody + nsp + begmatch, nlen - tem); + delete_glyphs (f, olen - nlen); olen = nlen; } } @@ -5874,8 +5883,8 @@ update_frame_line (f, vpos) /* If any unerased characters remain after the new line, erase them. */ if (olen > nlen) { - cursor_to (vpos, nlen); - clear_end_of_line (olen); + cursor_to (f, vpos, nlen); + clear_end_of_line (f, olen); } /* Exchange contents between current_frame and new_frame. */ @@ -6172,31 +6181,34 @@ window_change_signal (signalnum) /* If we don't have an argument, */ #endif int old_errno = errno; + struct tty_display_info *tty; + signal (SIGWINCH, window_change_signal); SIGNAL_THREAD_CHECK (signalnum); - get_frame_size (&width, &height); - - /* The frame size change obviously applies to a termcap-controlled - frame. Find such a frame in the list, and assume it's the only - one (since the redisplay code always writes to stdout, not a - FILE * specified in the frame structure). Record the new size, - but don't reallocate the data structures now. Let that be done - later outside of the signal handler. */ + /* The frame size change obviously applies to a single + termcap-controlled terminal, but we can't decide which. + Therefore, we resize the frames corresponding to each tty. + */ + for (tty = tty_list; tty; tty = tty->next) { - { - Lisp_Object tail, frame; + if (! tty->term_initted) + continue; - FOR_EACH_FRAME (tail, frame) - { - if (FRAME_TERMCAP_P (XFRAME (frame))) - { - change_frame_size (XFRAME (frame), height, width, 0, 1, 0); - break; - } - } + get_tty_size (fileno (tty->input), &width, &height); + + if (width > 5 && height > 2) { + Lisp_Object tail, frame; + + FOR_EACH_FRAME (tail, frame) + if (FRAME_TERMCAP_P (XFRAME (frame)) && FRAME_TTY (XFRAME (frame)) == tty) + /* Record the new sizes, but don't reallocate the data + structures now. Let that be done later outside of the + signal handler. */ + change_frame_size (XFRAME (frame), height, width, 0, 1, 0); + } } - + errno = old_errno; } #endif /* SIGWINCH */ @@ -6250,10 +6262,11 @@ change_frame_size (f, newheight, newwidth, pretend, delay, safe) { Lisp_Object tail, frame; - if (! FRAME_WINDOW_P (f)) + if (FRAME_MSDOS_P (f)) { - /* When using termcap, or on MS-DOS, all frames use - the same screen, so a change in size affects all frames. */ + /* On MS-DOS, all frames use the same screen, so a change in + size affects all frames. Termcap now supports multiple + ttys. */ FOR_EACH_FRAME (tail, frame) if (! FRAME_WINDOW_P (XFRAME (frame))) change_frame_size_1 (XFRAME (frame), newheight, newwidth, @@ -6333,7 +6346,7 @@ change_frame_size_1 (f, newheight, newwidth, pretend, delay, safe) newheight - FRAME_TOP_MARGIN (f), 0); if (FRAME_TERMCAP_P (f) && !pretend) - FrameRows = newheight; + FrameRows (FRAME_TTY (f)) = newheight; } if (new_frame_total_cols != FRAME_TOTAL_COLS (f)) @@ -6343,7 +6356,7 @@ change_frame_size_1 (f, newheight, newwidth, pretend, delay, safe) set_window_width (FRAME_MINIBUF_WINDOW (f), new_frame_total_cols, 0); if (FRAME_TERMCAP_P (f) && !pretend) - FrameCols = newwidth; + FrameCols (FRAME_TTY (f)) = newwidth; if (WINDOWP (f->tool_bar_window)) XSETFASTINT (XWINDOW (f->tool_bar_window)->total_cols, newwidth); @@ -6393,19 +6406,26 @@ FILE = nil means just close any termscript file currently open. */) (file) Lisp_Object file; { - if (termscript != 0) - { - BLOCK_INPUT; - fclose (termscript); - UNBLOCK_INPUT; - } - termscript = 0; + struct tty_display_info *tty; + + if (! FRAME_TERMCAP_P (SELECTED_FRAME ())) + error ("Current frame is not on a tty device"); + + tty = CURTTY (); + + if (tty->termscript != 0) + { + BLOCK_INPUT; + fclose (tty->termscript); + UNBLOCK_INPUT; + } + tty->termscript = 0; if (! NILP (file)) { file = Fexpand_file_name (file, Qnil); - termscript = fopen (SDATA (file), "w"); - if (termscript == 0) + tty->termscript = fopen (SDATA (file), "w"); + if (tty->termscript == 0) report_file_error ("Opening termscript", Fcons (file, Qnil)); } return Qnil; @@ -6413,23 +6433,36 @@ FILE = nil means just close any termscript file currently open. */) DEFUN ("send-string-to-terminal", Fsend_string_to_terminal, - Ssend_string_to_terminal, 1, 1, 0, + Ssend_string_to_terminal, 1, 2, 0, doc: /* Send STRING to the terminal without alteration. -Control characters in STRING will have terminal-dependent effects. */) - (string) +Control characters in STRING will have terminal-dependent effects. + +Optional parameter TERMINAL specifies the tty terminal device to use. +It may be a terminal id, a frame, or nil for the terminal used by the +currently selected frame. */) + (string, terminal) Lisp_Object string; + Lisp_Object terminal; { + struct terminal *t = get_tty_terminal (terminal, 1); + struct tty_display_info *tty; + /* ??? Perhaps we should do something special for multibyte strings here. */ CHECK_STRING (string); BLOCK_INPUT; - fwrite (SDATA (string), 1, SBYTES (string), stdout); - fflush (stdout); - if (termscript) + + if (!t) + error ("Unknown terminal device"); + + tty = t->display_info.tty; + + if (tty->termscript) { - fwrite (SDATA (string), 1, SBYTES (string), - termscript); - fflush (termscript); + fwrite (SDATA (string), 1, SBYTES (string), tty->termscript); + fflush (tty->termscript); } + fwrite (SDATA (string), 1, SBYTES (string), tty->output); + fflush (tty->output); UNBLOCK_INPUT; return Qnil; } @@ -6447,8 +6480,7 @@ terminate any keyboard macro currently executing. */) if (noninteractive) putchar (07); else - ring_bell (); - fflush (stdout); + ring_bell (XFRAME (selected_frame)); } else bitch_at_user (); @@ -6464,8 +6496,7 @@ bitch_at_user () else if (!INTERACTIVE) /* Stop executing a keyboard macro. */ error ("Keyboard macro terminated by a command ringing the bell"); else - ring_bell (); - fflush (stdout); + ring_bell (XFRAME (selected_frame)); } @@ -6748,8 +6779,6 @@ pass nil for VARIABLE. */) Initialization ***********************************************************************/ -char *terminal_type; - /* Initialization done when Emacs fork is started, before doing stty. Determine terminal type and set terminal_driver. Then invoke its decoding routine to set up variables in the terminal package. */ @@ -6757,6 +6786,8 @@ char *terminal_type; void init_display () { + char *terminal_type; + #ifdef HAVE_X_WINDOWS extern int display_arg; #endif @@ -6766,14 +6797,23 @@ init_display () SET_CHAR_GLYPH_FROM_GLYPH (space_glyph, ' '); space_glyph.charpos = -1; - meta_key = 0; inverse_video = 0; cursor_in_echo_area = 0; terminal_type = (char *) 0; /* Now is the time to initialize this; it's used by init_sys_modes during startup. */ - Vwindow_system = Qnil; + Vinitial_window_system = Qnil; + + /* SIGWINCH needs to be handled no matter what display we start + with. Otherwise newly opened tty frames will not resize + automatically. */ +#ifdef SIGWINCH +#ifndef CANNOT_DUMP + if (initialized) +#endif /* CANNOT_DUMP */ + signal (SIGWINCH, window_change_signal); +#endif /* SIGWINCH */ /* If the user wants to use a window system, we shouldn't bother initializing the terminal. This is especially important when the @@ -6809,7 +6849,7 @@ init_display () #endif ) { - Vwindow_system = intern ("x"); + Vinitial_window_system = intern ("x"); #ifdef HAVE_X11 Vwindow_system_version = make_number (11); #else @@ -6829,7 +6869,7 @@ init_display () #ifdef HAVE_NTGUI if (!inhibit_window_system) { - Vwindow_system = intern ("w32"); + Vinitial_window_system = intern ("w32"); Vwindow_system_version = make_number (1); adjust_frame_glyphs_initially (); return; @@ -6839,7 +6879,7 @@ init_display () #ifdef MAC_OS if (!inhibit_window_system) { - Vwindow_system = intern ("mac"); + Vinitial_window_system = intern ("mac"); Vwindow_system_version = make_number (1); adjust_frame_glyphs_initially (); return; @@ -6891,8 +6931,38 @@ For types not defined in VMS, use define emacs_term \"TYPE\".\n\ } #endif /* VMS */ - term_init (terminal_type); - + { + struct terminal *t; + struct frame *f = XFRAME (selected_frame); + + /* Open a display on the controlling tty. */ + t = init_tty (0, terminal_type, 1); /* Errors are fatal. */ + + /* Convert the initial frame to use the new display. */ + if (f->output_method != output_initial) + abort (); + f->output_method = t->type; + f->terminal = t; + + t->reference_count++; + t->display_info.tty->top_frame = selected_frame; + change_frame_size (XFRAME (selected_frame), + FrameRows (t->display_info.tty), + FrameCols (t->display_info.tty), 0, 0, 1); + + /* Delete the initial terminal. */ + if (--initial_terminal->reference_count == 0 + && initial_terminal->delete_terminal_hook) + (*initial_terminal->delete_terminal_hook) (initial_terminal); + + /* Update frame parameters to reflect the new type. */ + Fmodify_frame_parameters (selected_frame, Fcons (Fcons (Qwindow_system, Qnil), Qnil)); + Fmodify_frame_parameters + (selected_frame, Fcons (Fcons (Qtty_type, + Ftty_type (selected_frame)), Qnil)); + Fmodify_frame_parameters (selected_frame, Fcons (Fcons (Qtty, Qnil), Qnil)); + } + { struct frame *sf = SELECTED_FRAME (); int width = FRAME_TOTAL_COLS (sf); @@ -6909,13 +6979,6 @@ For types not defined in VMS, use define emacs_term \"TYPE\".\n\ adjust_frame_glyphs_initially (); calculate_costs (XFRAME (selected_frame)); -#ifdef SIGWINCH -#ifndef CANNOT_DUMP - if (initialized) -#endif /* CANNOT_DUMP */ - signal (SIGWINCH, window_change_signal); -#endif /* SIGWINCH */ - /* Set up faces of the initial terminal frame of a dumped Emacs. */ if (initialized && !noninteractive @@ -6926,7 +6989,7 @@ For types not defined in VMS, use define emacs_term \"TYPE\".\n\ and internal_terminal_init. */ && (strcmp (terminal_type, "internal") != 0 || inhibit_window_system) #endif - && NILP (Vwindow_system)) + && NILP (Vinitial_window_system)) { /* For the initial frame, we don't have any way of knowing what are the foreground and background colors of the terminal. */ @@ -7038,8 +7101,8 @@ A non-nil value is useful if the terminal can automatically preserve Emacs's frame display when you reenter Emacs. It is up to you to set this variable if your terminal can do that. */); - DEFVAR_LISP ("window-system", &Vwindow_system, - doc: /* Name of window system that Emacs is displaying through. + DEFVAR_LISP ("initial-window-system", &Vinitial_window_system, + doc: /* Name of the window system that Emacs uses for the first frame. The value is a symbol--for instance, `x' for X windows. The value is nil if Emacs is using a text-only terminal. */); @@ -7082,7 +7145,7 @@ If nil, never pre-empt redisplay. */); if (noninteractive) #endif { - Vwindow_system = Qnil; + Vinitial_window_system = Qnil; Vwindow_system_version = Qnil; } } diff --git a/src/emacs.c b/src/emacs.c index dc3055f8b1d..dfe950631b1 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -57,6 +57,7 @@ Boston, MA 02110-1301, USA. */ #include "blockinput.h" #include "syssignal.h" #include "process.h" +#include "frame.h" #include "termhooks.h" #include "keyboard.h" #include "keymap.h" @@ -214,7 +215,7 @@ static unsigned long heap_bss_diff; #ifdef HAVE_WINDOW_SYSTEM -extern Lisp_Object Vwindow_system; +extern Lisp_Object Vinitial_window_system; #endif /* HAVE_WINDOW_SYSTEM */ extern Lisp_Object Vauto_save_list_file_name; @@ -1300,6 +1301,9 @@ main (argc, argv faces, and the face implementation uses some symbols as face names. */ syms_of_xfaces (); + /* XXX syms_of_keyboard uses some symbols in keymap.c. It would + be better to arrange things not to have this dependency. */ + syms_of_keymap (); /* Call syms_of_keyboard before init_window_once because keyboard sets up symbols that include some face names that the X support will want to use. This can happen when @@ -1510,10 +1514,10 @@ main (argc, argv /* egetenv is a pretty low-level facility, which may get called in many circumstances; it seems flimsy to put off initializing it until calling init_callproc. */ - set_process_environment (); + set_initial_environment (); /* AIX crashes are reported in system versions 3.2.3 and 3.2.4 - if this is not done. Do it after set_process_environment so that we - don't pollute Vprocess_environment. */ + if this is not done. Do it after set_global_environment so that we + don't pollute Vglobal_environment. */ /* Setting LANG here will defeat the startup locale processing... */ #ifdef AIX3_2 putenv ("LANG=C"); @@ -1586,7 +1590,7 @@ main (argc, argv #endif /* CLASH_DETECTION */ syms_of_indent (); syms_of_insdel (); - syms_of_keymap (); + /* syms_of_keymap (); */ syms_of_macros (); syms_of_marker (); syms_of_minibuf (); @@ -1597,6 +1601,7 @@ main (argc, argv syms_of_frame (); #endif syms_of_syntax (); + syms_of_terminal (); syms_of_term (); syms_of_undo (); #ifdef HAVE_SOUND @@ -1686,13 +1691,7 @@ main (argc, argv init_charset (); - if (!noninteractive) - { -#ifdef VMS - init_vms_input ();/* init_display calls get_frame_size, that needs this. */ -#endif /* VMS */ - init_display (); /* Determine terminal type. init_sys_modes uses results. */ - } + init_process (); /* init_display uses add_keyboard_wait_descriptor. */ #ifndef MAC_OS8 /* Called before init_window_once for Mac OS Classic. */ init_keyboard (); /* This too must precede init_sys_modes. */ @@ -1700,7 +1699,13 @@ main (argc, argv #ifdef VMS init_vmsproc (); /* And this too. */ #endif /* VMS */ - init_sys_modes (); /* Init system terminal modes (RAW or CBREAK, etc.). */ + if (!noninteractive) + { +#ifdef VMS + init_vms_input ();/* init_display calls get_tty_size, that needs this. */ +#endif /* VMS */ + init_display (); /* Determine terminal type. Calls init_sys_modes. */ + } init_fns (); init_xdisp (); #ifdef HAVE_WINDOW_SYSTEM @@ -1713,7 +1718,6 @@ main (argc, argv #ifdef VMS init_vmsfns (); #endif /* VMS */ - init_process (); #ifdef HAVE_SOUND init_sound (); #endif @@ -1844,7 +1848,6 @@ struct standard_args standard_args[] = { "-q", "--no-init-file", 50, 0 }, { "-no-init-file", 0, 50, 0 }, { "-no-site-file", "--no-site-file", 40, 0 }, - { "-no-splash", "--no-splash", 40, 0 }, { "-u", "--user", 30, 1 }, { "-user", 0, 30, 1 }, { "-debug-init", "--debug-init", 20, 0 }, @@ -1879,6 +1882,8 @@ struct standard_args standard_args[] = { "-hb", "--horizontal-scroll-bars", 5, 0 }, { "-vb", "--vertical-scroll-bars", 5, 0 }, { "-color", "--color", 5, 0}, + { "-no-splash", "--no-splash", 3, 0 }, + { "-no-desktop", "--no-desktop", 3, 0 }, /* These have the same priority as ordinary file name args, so they are not reordered with respect to those. */ { "-L", "--directory", 0, 1 }, @@ -2128,15 +2133,14 @@ shut_down_emacs (sig, no_x, stuff) if (EMACS_GET_TTY_PGRP (0, &tpgrp) != -1 && tpgrp == pgrp) { - fflush (stdout); - reset_sys_modes (); + reset_all_sys_modes (); if (sig && sig != SIGTERM) fprintf (stderr, "Fatal error (%d)", sig); } } #else fflush (stdout); - reset_sys_modes (); + reset_all_sys_modes (); #endif stuff_buffered_input (stuff); @@ -2158,9 +2162,9 @@ shut_down_emacs (sig, no_x, stuff) #if 0 /* This triggers a bug in XCloseDisplay and is not needed. */ #ifdef HAVE_X_WINDOWS /* It's not safe to call intern here. Maybe we are crashing. */ - if (!noninteractive && SYMBOLP (Vwindow_system) - && SCHARS (SYMBOL_NAME (Vwindow_system)) == 1 - && SREF (SYMBOL_NAME (Vwindow_system), 0) == 'x' + if (!noninteractive && SYMBOLP (Vinitial_window_system) + && SCHARS (SYMBOL_NAME (Vinitial_window_system)) == 1 + && SREF (SYMBOL_NAME (Vinitial_window_system), 0) == 'x' && ! no_x) Fx_close_current_connection (); #endif /* HAVE_X_WINDOWS */ diff --git a/src/eval.c b/src/eval.c index 20be847f273..77abe5046db 100644 --- a/src/eval.c +++ b/src/eval.c @@ -1280,8 +1280,12 @@ unwind_to_catch (catch, value) #if HAVE_X_WINDOWS /* If x_catch_errors was done, turn it off now. (First we give unbind_to a chance to do that.) */ +#if 0 /* This would disable x_catch_errors after x_connection_closed. + * The catch must remain in effect during that delicate + * state. --lorentey */ x_fully_uncatch_errors (); #endif +#endif byte_stack_list = catch->byte_stack; gcprolist = catch->gcpro; @@ -1351,14 +1355,15 @@ if CONDITION-NAME is one of the error's condition names. If an error happens, the first applicable handler is run. The car of a handler may be a list of condition names -instead of a single condition name. +instead of a single condition name. Then it handles all of them. -When a handler handles an error, -control returns to the condition-case and the handler BODY... is executed -with VAR bound to (SIGNALED-CONDITIONS . SIGNAL-DATA). -VAR may be nil; then you do not get access to the signal information. +When a handler handles an error, control returns to the `condition-case' +and it executes the handler's BODY... +with VAR bound to (SIGNALED-CONDITIONS . SIGNAL-DATA) from the error. +(If VAR is nil, the handler can't access that information.) +Then the value of the last BODY form is returned from the `condition-case' +expression. -The value of the last BODY form is returned from the condition-case. See also the function `signal' for more info. usage: (condition-case VAR BODYFORM &rest HANDLERS) */) (args) @@ -2068,7 +2073,7 @@ then strings and vectors are not accepted. */) /* Emacs primitives are interactive if their DEFUN specifies an interactive spec. */ if (SUBRP (fun)) - return XSUBR (fun)->prompt ? Qt : if_prop; + return XSUBR (fun)->intspec ? Qt : if_prop; /* Bytecode objects are interactive if they are long enough to have an element whose index is COMPILED_INTERACTIVE, which is @@ -2192,7 +2197,7 @@ do_autoload (fundef, funname) /* Value saved here is to be restored into Vautoload_queue. */ record_unwind_protect (un_autoload, Vautoload_queue); Vautoload_queue = Qt; - Fload (Fcar (Fcdr (fundef)), Qnil, noninteractive ? Qt : Qnil, Qnil, Qt); + Fload (Fcar (Fcdr (fundef)), Qnil, Qt, Qnil, Qt); /* Save the old autoloads, in case we ever do an unload. */ queue = Vautoload_queue; diff --git a/src/fileio.c b/src/fileio.c index 58c3e75111c..c9b6462e4a0 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -78,6 +78,8 @@ extern int errno; #include "coding.h" #include "window.h" #include "blockinput.h" +#include "frame.h" +#include "dispextern.h" #ifdef WINDOWSNT #define NOMINMAX 1 @@ -3438,7 +3440,9 @@ Return nil, if file does not exist or is not accessible. */) return make_number (st.st_mode & 07777); } -DEFUN ("set-file-modes", Fset_file_modes, Sset_file_modes, 2, 2, 0, +DEFUN ("set-file-modes", Fset_file_modes, Sset_file_modes, 2, 2, + "(let ((file (read-file-name \"File: \"))) \ + (list file (read-file-modes nil file)))", doc: /* Set mode bits of file named FILENAME to MODE (an integer). Only the 12 low bits of MODE are used. */) (filename, mode) @@ -5299,8 +5303,10 @@ This does code conversion according to the value of it, and that means the fsync here is not crucial for autosave files. */ if (!auto_saving && !write_region_inhibit_fsync && fsync (desc) < 0) { - /* If fsync fails with EINTR, don't treat that as serious. */ - if (errno != EINTR) + /* If fsync fails with EINTR, don't treat that as serious. Also + ignore EINVAL which happens when fsync is not supported on this + file. */ + if (errno != EINTR && errno != EINVAL) failure = 1, save_errno = errno; } #endif @@ -5741,7 +5747,7 @@ auto_save_error (error) char *msgbuf; USE_SAFE_ALLOCA; - ring_bell (); + ring_bell (XFRAME (selected_frame)); args[0] = build_string ("Auto-saving %s: %s"); args[1] = current_buffer->name; @@ -6303,7 +6309,7 @@ and `read-file-name-function'. */) /* If dir starts with user's homedir, change that to ~. */ homedir = (char *) egetenv ("HOME"); #ifdef DOS_NT - /* homedir can be NULL in temacs, since Vprocess_environment is not + /* homedir can be NULL in temacs, since Vglobal_environment is not yet set up. We shouldn't crash in that case. */ if (homedir != 0) { diff --git a/src/floatfns.c b/src/floatfns.c index 6ad9b95686e..a20f7981bf0 100644 --- a/src/floatfns.c +++ b/src/floatfns.c @@ -454,7 +454,7 @@ DEFUN ("expt", Fexpt, Sexpt, 2, 2, 0, (arg1, arg2) register Lisp_Object arg1, arg2; { - double f1, f2; + double f1, f2, f3; CHECK_NUMBER_OR_FLOAT (arg1); CHECK_NUMBER_OR_FLOAT (arg2); @@ -500,8 +500,11 @@ DEFUN ("expt", Fexpt, Sexpt, 2, 2, 0, else if ((f1 == 0.0 && f2 < 0.0) || (f1 < 0 && f2 != floor(f2))) domain_error2 ("expt", arg1, arg2); #endif - IN_FLOAT2 (f1 = pow (f1, f2), "expt", arg1, arg2); - return make_float (f1); + IN_FLOAT2 (f3 = pow (f1, f2), "expt", arg1, arg2); + /* Check for overflow in the result. */ + if (f1 != 0.0 && f3 == 0.0) + range_error ("expt", arg1); + return make_float (f3); } DEFUN ("log", Flog, Slog, 1, 2, 0, diff --git a/src/fns.c b/src/fns.c index 67f3a38055d..9f7e422d757 100644 --- a/src/fns.c +++ b/src/fns.c @@ -1995,7 +1995,7 @@ The PLIST is modified by side effects. */) prev = tail; QUIT; } - newcell = Fcons (prop, Fcons (val, Qnil)); + newcell = Fcons (prop, Fcons (val, NILP (prev) ? plist : XCDR (XCDR (prev)))); if (NILP (prev)) return newcell; else @@ -2603,7 +2603,8 @@ is nil and `use-dialog-box' is non-nil. */) { #ifdef HAVE_MENUS - if ((NILP (last_nonmenu_event) || CONSP (last_nonmenu_event)) + if (FRAME_WINDOW_P (SELECTED_FRAME ()) + && (NILP (last_nonmenu_event) || CONSP (last_nonmenu_event)) && use_dialog_box && have_menus_p ()) { @@ -2642,6 +2643,7 @@ is nil and `use-dialog-box' is non-nil. */) Fraise_frame (mini_frame); } + temporarily_switch_to_single_kboard (SELECTED_FRAME ()); obj = read_filtered_event (1, 0, 0, 0, Qnil); cursor_in_echo_area = 0; /* If we need to quit, quit with cursor_in_echo_area = 0. */ @@ -2734,7 +2736,8 @@ is nil, and `use-dialog-box' is non-nil. */) CHECK_STRING (prompt); #ifdef HAVE_MENUS - if ((NILP (last_nonmenu_event) || CONSP (last_nonmenu_event)) + if (FRAME_WINDOW_P (SELECTED_FRAME ()) + && (NILP (last_nonmenu_event) || CONSP (last_nonmenu_event)) && use_dialog_box && have_menus_p ()) { @@ -3968,7 +3971,7 @@ make_hash_table (test, size, rehash_size, rehash_threshold, weak, h->weak = weak; h->rehash_threshold = rehash_threshold; h->rehash_size = rehash_size; - h->count = make_number (0); + h->count = 0; h->key_and_value = Fmake_vector (make_number (2 * sz), Qnil); h->hash = Fmake_vector (size, Qnil); h->next = Fmake_vector (size, Qnil); @@ -4148,7 +4151,7 @@ hash_put (h, key, value, hash) /* Increment count after resizing because resizing may fail. */ maybe_resize_hash_table (h); - h->count = make_number (XFASTINT (h->count) + 1); + h->count++; /* Store key/value in the key_and_value vector. */ i = XFASTINT (h->next_free); @@ -4204,8 +4207,8 @@ hash_remove (h, key) HASH_KEY (h, i) = HASH_VALUE (h, i) = HASH_HASH (h, i) = Qnil; HASH_NEXT (h, i) = h->next_free; h->next_free = make_number (i); - h->count = make_number (XFASTINT (h->count) - 1); - xassert (XINT (h->count) >= 0); + h->count--; + xassert (h->count >= 0); break; } else @@ -4223,7 +4226,7 @@ void hash_clear (h) struct Lisp_Hash_Table *h; { - if (XFASTINT (h->count) > 0) + if (h->count > 0) { int i, size = HASH_TABLE_SIZE (h); @@ -4239,7 +4242,7 @@ hash_clear (h) AREF (h->index, i) = Qnil; h->next_free = make_number (0); - h->count = make_number (0); + h->count = 0; } } @@ -4309,7 +4312,7 @@ sweep_weak_table (h, remove_entries_p) HASH_KEY (h, i) = HASH_VALUE (h, i) = Qnil; HASH_HASH (h, i) = Qnil; - h->count = make_number (XFASTINT (h->count) - 1); + h->count--; } else { @@ -4375,7 +4378,7 @@ sweep_weak_hash_tables () if (h->size & ARRAY_MARK_FLAG) { /* TABLE is marked as used. Sweep its contents. */ - if (XFASTINT (h->count) > 0) + if (h->count > 0) sweep_weak_table (h, 1); /* Add table to the list of used weak hash tables. */ @@ -4710,7 +4713,7 @@ DEFUN ("hash-table-count", Fhash_table_count, Shash_table_count, 1, 1, 0, (table) Lisp_Object table; { - return check_hash_table (table)->count; + return make_number (check_hash_table (table)->count); } diff --git a/src/fontset.c b/src/fontset.c index 47a682cc975..9b9fc79b918 100644 --- a/src/fontset.c +++ b/src/fontset.c @@ -55,6 +55,7 @@ Boston, MA 02110-1301, USA. */ #ifdef MAC_OS #include "macterm.h" #endif +#include "termhooks.h" #ifdef USE_FONT_BACKEND #include "font.h" @@ -2144,7 +2145,7 @@ DEFUN ("internal-char-font", Finternal_char_font, Sinternal_char_font, 1, 2, 0, return (Fcons (AREF (rfont_def, 3), Qnil)); STORE_XCHAR2B (&char2b, ((code >> 8) & 0xFF), (code & 0xFF)); fontp = (*get_font_info_func) (f, XINT (AREF (rfont_def, 1))); - rif->encode_char (c, &char2b, fontp, charset, NULL); + FRAME_RIF (f)->encode_char (c, &char2b, fontp, charset, NULL); code = (XCHAR2B_BYTE1 (&char2b) << 8) | XCHAR2B_BYTE2 (&char2b); return (Fcons (AREF (rfont_def, 3), make_number (code))); } diff --git a/src/frame.c b/src/frame.c index 7f89adb66df..8314ad7a398 100644 --- a/src/frame.c +++ b/src/frame.c @@ -42,6 +42,7 @@ Boston, MA 02110-1301, USA. */ #include "fontset.h" #endif #include "blockinput.h" +#include "termchar.h" #include "termhooks.h" #include "dispextern.h" #include "window.h" @@ -78,6 +79,8 @@ Lisp_Object Qbackground_mode; Lisp_Object Qx_frame_parameter; Lisp_Object Qx_resource_name; +Lisp_Object Qterminal; +Lisp_Object Qterminal_live_p; /* Frame parameters (set or reported). */ @@ -107,8 +110,11 @@ Lisp_Object Qtitle, Qname; Lisp_Object Qunsplittable; Lisp_Object Qmenu_bar_lines, Qtool_bar_lines; Lisp_Object Qleft_fringe, Qright_fringe; -Lisp_Object Qbuffer_predicate, Qbuffer_list; +Lisp_Object Qbuffer_predicate, Qbuffer_list, Qburied_buffer_list; Lisp_Object Qtty_color_mode; +Lisp_Object Qtty, Qtty_type; +Lisp_Object Qwindow_system; +Lisp_Object Qenvironment; Lisp_Object Qfullscreen, Qfullwidth, Qfullheight, Qfullboth; #ifdef USE_FONT_BACKEND @@ -118,18 +124,19 @@ Lisp_Object Qfont_backend; Lisp_Object Qinhibit_face_set_after_frame_default; Lisp_Object Qface_set_after_frame_default; - Lisp_Object Vterminal_frame; Lisp_Object Vdefault_frame_alist; Lisp_Object Vdefault_frame_scroll_bars; Lisp_Object Vmouse_position_function; Lisp_Object Vmouse_highlight; Lisp_Object Vdelete_frame_functions; + +int focus_follows_mouse; static void set_menu_bar_lines_1 (window, n) - Lisp_Object window; - int n; + Lisp_Object window; + int n; { struct window *w = XWINDOW (window); @@ -187,8 +194,6 @@ set_menu_bar_lines (f, value, oldval) Lisp_Object Vemacs_iconified; Lisp_Object Vframe_list; -struct x_output tty_display; - extern Lisp_Object Vminibuffer_list; extern Lisp_Object get_minibuffer (); extern Lisp_Object Fhandle_switch_frame (); @@ -210,6 +215,7 @@ See also `frame-live-p'. */) return Qnil; switch (XFRAME (object)->output_method) { + case output_initial: /* The initial frame is like a termcap frame. */ case output_termcap: return Qt; case output_x_window: @@ -228,7 +234,7 @@ See also `frame-live-p'. */) DEFUN ("frame-live-p", Fframe_live_p, Sframe_live_p, 1, 1, 0, doc: /* Return non-nil if OBJECT is a frame which has not been deleted. Value is nil if OBJECT is not a live frame. If object is a live -frame, the return value indicates what sort of output device it is +frame, the return value indicates what sort of terminal device it is displayed on. See the documentation of `framep' for possible return values. */) (object) @@ -240,6 +246,30 @@ return values. */) : Qnil); } +DEFUN ("window-system", Fwindow_system, Swindow_system, 0, 1, 0, + doc: /* The name of the window system that FRAME is displaying through. +The value is a symbol---for instance, 'x' for X windows. +The value is nil if Emacs is using a text-only terminal. + +FRAME defaults to the currently selected frame. */) + (frame) + Lisp_Object frame; +{ + Lisp_Object type; + if (NILP (frame)) + frame = selected_frame; + + type = Fframep (frame); + + if (NILP (type)) + wrong_type_argument (Qframep, frame); + + if (EQ (type, Qt)) + return Qnil; + else + return type; +} + struct frame * make_frame (mini_p) int mini_p; @@ -283,9 +313,7 @@ make_frame (mini_p) f->menu_bar_items_used = 0; f->buffer_predicate = Qnil; f->buffer_list = Qnil; -#ifdef MULTI_KBOARD - f->kboard = initial_kboard; -#endif + f->buried_buffer_list = Qnil; f->namebuf = 0; f->title = Qnil; f->menu_bar_window = Qnil; @@ -408,8 +436,8 @@ make_frame_without_minibuffer (mini_window, kb, display) #ifdef MULTI_KBOARD if (!NILP (mini_window) - && XFRAME (XWINDOW (mini_window)->frame)->kboard != kb) - error ("Frame and minibuffer must be on the same display"); + && FRAME_KBOARD (XFRAME (XWINDOW (mini_window)->frame)) != kb) + error ("Frame and minibuffer must be on the same terminal"); #endif /* Make a frame containing just a root window. */ @@ -485,18 +513,19 @@ make_minibuffer_frame () } #endif /* HAVE_WINDOW_SYSTEM */ -/* Construct a frame that refers to the terminal (stdin and stdout). */ +/* Construct a frame that refers to a terminal. */ -static int terminal_frame_count; +static int tty_frame_count; struct frame * -make_terminal_frame () +make_initial_frame (void) { - register struct frame *f; + struct frame *f; + struct terminal *terminal; Lisp_Object frame; - char name[20]; #ifdef MULTI_KBOARD + /* Create the initial keyboard. */ if (!initial_kboard) { initial_kboard = (KBOARD *) xmalloc (sizeof (KBOARD)); @@ -510,13 +539,51 @@ make_terminal_frame () if (! (NILP (Vframe_list) || CONSP (Vframe_list))) Vframe_list = Qnil; + terminal = init_initial_terminal (); + + f = make_frame (1); + XSETFRAME (frame, f); + + Vframe_list = Fcons (frame, Vframe_list); + + tty_frame_count = 1; + f->name = build_string ("F1"); + + f->visible = 1; + f->async_visible = 1; + + f->output_method = terminal->type; + f->terminal = terminal; + f->terminal->reference_count++; + f->output_data.nothing = 0; + + FRAME_FOREGROUND_PIXEL (f) = FACE_TTY_DEFAULT_FG_COLOR; + FRAME_BACKGROUND_PIXEL (f) = FACE_TTY_DEFAULT_BG_COLOR; + + FRAME_CAN_HAVE_SCROLL_BARS (f) = 0; + FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_none; + + return f; +} + + +struct frame * +make_terminal_frame (struct terminal *terminal) +{ + register struct frame *f; + Lisp_Object frame; + char name[20]; + + if (!terminal->name) + error ("Terminal is not live, can't create new frames on it"); + f = make_frame (1); XSETFRAME (frame, f); Vframe_list = Fcons (frame, Vframe_list); - terminal_frame_count++; - sprintf (name, "F%d", terminal_frame_count); + tty_frame_count++; + sprintf (name, "F%d", tty_frame_count); f->name = build_string (name); f->visible = 1; /* FRAME_SET_VISIBLE wd set frame_garbaged. */ @@ -536,30 +603,44 @@ make_terminal_frame () for the black color. Other frames all inherit their pixels from what's already in the_only_x_display. */ if ((!FRAMEP (selected_frame) || !FRAME_LIVE_P (XFRAME (selected_frame))) - && f->output_data.x->background_pixel == 0 - && f->output_data.x->foreground_pixel == 0) + && FRAME_BACKGROUND_PIXEL (f) == 0 + && FRAME_FOREGROUND_PIXEL (f) == 0) { - f->output_data.x->background_pixel = FACE_TTY_DEFAULT_BG_COLOR; - f->output_data.x->foreground_pixel = FACE_TTY_DEFAULT_FG_COLOR; + FRAME_BACKGROUND_PIXEL (f) = FACE_TTY_DEFAULT_BG_COLOR; + FRAME_FOREGROUND_PIXEL (f) = FACE_TTY_DEFAULT_FG_COLOR; } } else f->output_method = output_termcap; #else -#ifdef WINDOWSNT - f->output_method = output_termcap; - f->output_data.x = &tty_display; -#else #ifdef MAC_OS8 make_mac_terminal_frame (f); #else - f->output_data.x = &tty_display; + { + f->output_method = output_termcap; + f->terminal = terminal; + f->terminal->reference_count++; + create_tty_output (f); + + FRAME_FOREGROUND_PIXEL (f) = FACE_TTY_DEFAULT_FG_COLOR; + FRAME_BACKGROUND_PIXEL (f) = FACE_TTY_DEFAULT_BG_COLOR; + + FRAME_CAN_HAVE_SCROLL_BARS (f) = 0; + FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_none; + + /* Set the top frame to the newly created frame. */ + if (FRAMEP (FRAME_TTY (f)->top_frame) + && FRAME_LIVE_P (XFRAME (FRAME_TTY (f)->top_frame))) + XFRAME (FRAME_TTY (f)->top_frame)->async_visible = 2; /* obscured */ + + FRAME_TTY (f)->top_frame = frame; + } + #ifdef CANNOT_DUMP FRAME_FOREGROUND_PIXEL(f) = FACE_TTY_DEFAULT_FG_COLOR; FRAME_BACKGROUND_PIXEL(f) = FACE_TTY_DEFAULT_BG_COLOR; #endif #endif /* MAC_OS8 */ -#endif /* WINDOWSNT */ #endif /* MSDOS */ if (!noninteractive) @@ -568,18 +649,55 @@ make_terminal_frame () return f; } +/* Get a suitable value for frame parameter PARAMETER for a newly + created frame, based on (1) the user-supplied frame parameter + alist SUPPLIED_PARMS, (2) CURRENT_VALUE, and finally, if all else + fails, (3) Vdefault_frame_alist. */ + +static Lisp_Object +get_future_frame_param (Lisp_Object parameter, + Lisp_Object supplied_parms, + char *current_value) +{ + Lisp_Object result; + + result = Fassq (parameter, supplied_parms); + if (NILP (result)) + result = Fassq (parameter, XFRAME (selected_frame)->param_alist); + if (NILP (result) && current_value != NULL) + result = build_string (current_value); + if (NILP (result)) + result = Fassq (parameter, Vdefault_frame_alist); + if (!NILP (result) && !STRINGP (result)) + result = XCDR (result); + if (NILP (result) || !STRINGP (result)) + result = Qnil; + + return result; +} + DEFUN ("make-terminal-frame", Fmake_terminal_frame, Smake_terminal_frame, 1, 1, 0, - doc: /* Create an additional terminal frame. -You can create multiple frames on a text-only terminal in this way. -Only the selected terminal frame is actually displayed. + doc: /* Create an additional terminal frame, possibly on another terminal. This function takes one argument, an alist specifying frame parameters. -In practice, generally you don't need to specify any parameters. -Note that changing the size of one terminal frame automatically affects all. */) + +You can create multiple frames on a single text-only terminal, but +only one of them (the selected terminal frame) is actually displayed. + +In practice, generally you don't need to specify any parameters, +except when you want to create a new frame on another terminal. +In that case, the `tty' parameter specifies the device file to open, +and the `tty-type' parameter specifies the terminal type. Example: + + (make-terminal-frame '((tty . "/dev/pts/5") (tty-type . "xterm"))) + +Note that changing the size of one terminal frame automatically +affects all frames on the same terminal device. */) (parms) Lisp_Object parms; { struct frame *f; + struct terminal *t = NULL; Lisp_Object frame, tem; struct frame *sf = SELECTED_FRAME (); @@ -589,25 +707,84 @@ Note that changing the size of one terminal frame automatically affects all. */ abort (); #else /* not MSDOS */ -#ifdef MAC_OS +#if 0 /* #ifdef MAC_OS */ + /* This can happen for multi-tty when using both terminal frames and + Carbon frames. */ if (sf->output_method != output_mac) error ("Not running on a Macintosh screen; cannot make a new Macintosh frame"); #else +#if 0 /* This should work now! */ if (sf->output_method != output_termcap) error ("Not using an ASCII terminal now; cannot make a new ASCII frame"); #endif +#endif #endif /* not MSDOS */ + + { + Lisp_Object terminal; + + terminal = Fassq (Qterminal, parms); + if (!NILP (terminal)) + { + terminal = XCDR (terminal); + t = get_terminal (terminal, 1); + } + } + + if (!t) + { + char *name = 0, *type = 0; + Lisp_Object tty, tty_type; + + tty = get_future_frame_param + (Qtty, parms, (FRAME_TERMCAP_P (XFRAME (selected_frame)) + ? FRAME_TTY (XFRAME (selected_frame))->name + : NULL)); + if (!NILP (tty)) + { + name = (char *) alloca (SBYTES (tty) + 1); + strncpy (name, SDATA (tty), SBYTES (tty)); + name[SBYTES (tty)] = 0; + } + + tty_type = get_future_frame_param + (Qtty_type, parms, (FRAME_TERMCAP_P (XFRAME (selected_frame)) + ? FRAME_TTY (XFRAME (selected_frame))->type + : NULL)); + if (!NILP (tty_type)) + { + type = (char *) alloca (SBYTES (tty_type) + 1); + strncpy (type, SDATA (tty_type), SBYTES (tty_type)); + type[SBYTES (tty_type)] = 0; + } + + t = init_tty (name, type, 0); /* Errors are not fatal. */ + } - f = make_terminal_frame (); + f = make_terminal_frame (t); - change_frame_size (f, FRAME_LINES (sf), - FRAME_COLS (sf), 0, 0, 0); + { + int width, height; + get_tty_size (fileno (FRAME_TTY (f)->input), &width, &height); + change_frame_size (f, height, width, 0, 0, 0); + } + adjust_glyphs (f); calculate_costs (f); XSETFRAME (frame, f); Fmodify_frame_parameters (frame, Vdefault_frame_alist); Fmodify_frame_parameters (frame, parms); - + Fmodify_frame_parameters (frame, Fcons (Fcons (Qwindow_system, Qnil), Qnil)); + Fmodify_frame_parameters (frame, Fcons (Fcons (Qtty_type, + build_string (t->display_info.tty->type)), + Qnil)); + if (t->display_info.tty->name != NULL) + Fmodify_frame_parameters (frame, Fcons (Fcons (Qtty, + build_string (t->display_info.tty->name)), + Qnil)); + else + Fmodify_frame_parameters (frame, Fcons (Fcons (Qtty, Qnil), Qnil)); + /* Make the frame face alist be frame-specific, so that each frame could change its face definitions independently. */ f->face_alist = Fcopy_alist (sf->face_alist); @@ -630,7 +807,7 @@ Note that changing the size of one terminal frame automatically affects all. */ frame's focus to FRAME instead. FOR_DELETION non-zero means that the selected frame is being - deleted, which includes the possibility that the frame's display + deleted, which includes the possibility that the frame's terminal is dead. */ Lisp_Object @@ -705,6 +882,15 @@ do_switch_frame (frame, track, for_deletion) if (!for_deletion && FRAME_HAS_MINIBUF_P (sf)) resize_mini_window (XWINDOW (FRAME_MINIBUF_WINDOW (sf)), 1); + if (FRAME_TERMCAP_P (XFRAME (selected_frame)) + && FRAME_TERMCAP_P (XFRAME (frame)) + && FRAME_TTY (XFRAME (selected_frame)) == FRAME_TTY (XFRAME (frame))) + { + XFRAME (selected_frame)->async_visible = 2; /* obscured */ + XFRAME (frame)->async_visible = 1; + FRAME_TTY (XFRAME (frame))->top_frame = frame; + } + selected_frame = frame; if (! FRAME_MINIBUF_ONLY_P (XFRAME (selected_frame))) last_nonminibuf_frame = XFRAME (selected_frame); @@ -888,6 +1074,7 @@ If FRAME is the selected frame, this makes WINDOW the selected window. */) return XFRAME (frame)->selected_window = window; } + DEFUN ("frame-list", Fframe_list, Sframe_list, 0, 0, 0, @@ -935,7 +1122,10 @@ next_frame (frame, minibuf) f = XCAR (tail); if (passed - && FRAME_KBOARD (XFRAME (f)) == FRAME_KBOARD (XFRAME (frame))) + && ((!FRAME_TERMCAP_P (XFRAME (f)) && !FRAME_TERMCAP_P (XFRAME (frame)) + && FRAME_KBOARD (XFRAME (f)) == FRAME_KBOARD (XFRAME (frame))) + || (FRAME_TERMCAP_P (XFRAME (f)) && FRAME_TERMCAP_P (XFRAME (frame)) + && FRAME_TTY (XFRAME (f)) == FRAME_TTY (XFRAME (frame))))) { /* Decide whether this frame is eligible to be returned. */ @@ -1012,7 +1202,10 @@ prev_frame (frame, minibuf) if (EQ (frame, f) && !NILP (prev)) return prev; - if (FRAME_KBOARD (XFRAME (f)) == FRAME_KBOARD (XFRAME (frame))) + if ((!FRAME_TERMCAP_P (XFRAME (f)) && !FRAME_TERMCAP_P (XFRAME (frame)) + && FRAME_KBOARD (XFRAME (f)) == FRAME_KBOARD (XFRAME (frame))) + || (FRAME_TERMCAP_P (XFRAME (f)) && FRAME_TERMCAP_P (XFRAME (frame)) + && FRAME_TTY (XFRAME (f)) == FRAME_TTY (XFRAME (frame)))) { /* Decide whether this frame is eligible to be returned, according to minibuf. */ @@ -1146,6 +1339,14 @@ other_visible_frames (f) return 1; } +/* Error handler for `delete-frame-functions'. */ +static Lisp_Object +delete_frame_handler (Lisp_Object arg) +{ + add_to_log ("Error during `delete-frame': %s", arg, Qnil); + return Qnil; +} + DEFUN ("delete-frame", Fdelete_frame, Sdelete_frame, 0, 2, "", doc: /* Delete FRAME, permanently eliminating it from use. If omitted, FRAME defaults to the selected frame. @@ -1161,6 +1362,8 @@ The functions are run with one arg, the frame to be deleted. */) { struct frame *f; struct frame *sf = SELECTED_FRAME (); + struct kboard *kb; + int minibuffer_selected; if (EQ (frame, Qnil)) @@ -1219,11 +1422,22 @@ The functions are run with one arg, the frame to be deleted. */) && NILP (Fframe_parameter (frame, intern ("tooltip")))) { Lisp_Object args[2]; + struct gcpro gcpro1, gcpro2; + + /* Don't let a rogue function in `delete-frame-functions' + prevent the frame deletion. */ + GCPRO2 (args[0], args[1]); args[0] = intern ("delete-frame-functions"); args[1] = frame; - Frun_hook_with_args (2, args); + internal_condition_case_2 (Frun_hook_with_args, 2, args, + Qt, delete_frame_handler); + UNGCPRO; } + /* The hook may sometimes (indirectly) cause the frame to be deleted. */ + if (! FRAME_LIVE_P (f)) + return Qnil; + minibuffer_selected = EQ (minibuf_window, selected_window); /* Don't let the frame remain selected. */ @@ -1239,7 +1453,7 @@ The functions are run with one arg, the frame to be deleted. */) { FOR_EACH_FRAME (tail, frame1) { - if (! EQ (frame, frame1)) + if (! EQ (frame, frame1) && FRAME_LIVE_P (XFRAME (frame1))) break; } } @@ -1265,6 +1479,24 @@ The functions are run with one arg, the frame to be deleted. */) if (EQ (f->minibuffer_window, echo_area_window)) echo_area_window = sf->minibuffer_window; + /* Don't allow other frames to refer to a deleted frame in their + 'environment parameter. */ + { + Lisp_Object tail, frame1; + Lisp_Object env = get_frame_param (XFRAME (frame), Qenvironment); + FOR_EACH_FRAME (tail, frame1) + { + if (EQ (frame, frame1) || !FRAME_LIVE_P (XFRAME (frame1))) + continue; + if (EQ (frame, get_frame_param (XFRAME (frame1), Qenvironment))) + { + store_frame_param (XFRAME (frame1), Qenvironment, env); + if (!FRAMEP (env)) + env = frame1; + } + } + } + /* Clear any X selections for this frame. */ #ifdef HAVE_X_WINDOWS if (FRAME_X_P (f)) @@ -1305,18 +1537,36 @@ The functions are run with one arg, the frame to be deleted. */) xfree (FRAME_MESSAGE_BUF (f)); /* Since some events are handled at the interrupt level, we may get - an event for f at any time; if we zero out the frame's display + an event for f at any time; if we zero out the frame's terminal now, then we may trip up the event-handling code. Instead, we'll - promise that the display of the frame must be valid until we have - called the window-system-dependent frame destruction routine. */ + promise that the terminal of the frame must be valid until we + have called the window-system-dependent frame destruction + routine. */ - /* I think this should be done with a hook. */ -#ifdef HAVE_WINDOW_SYSTEM - if (FRAME_WINDOW_P (f)) - x_destroy_window (f); -#endif + if (FRAME_TERMINAL (f)->delete_frame_hook) + (*FRAME_TERMINAL (f)->delete_frame_hook) (f); - f->output_data.nothing = 0; + { + struct terminal *terminal = FRAME_TERMINAL (f); + f->output_data.nothing = 0; + f->terminal = 0; /* Now the frame is dead. */ + + /* If needed, delete the terminal that this frame was on. + (This must be done after the frame is killed.) */ + terminal->reference_count--; + if (terminal->reference_count == 0) + { + kb = NULL; + if (terminal->delete_terminal_hook) + (*terminal->delete_terminal_hook) (terminal); + else + delete_terminal (terminal); + } +#ifdef MULTI_KBOARD + else + kb = terminal->kboard; +#endif + } /* If we've deleted the last_nonminibuf_frame, then try to find another one. */ @@ -1341,38 +1591,39 @@ The functions are run with one arg, the frame to be deleted. */) /* If there's no other frame on the same kboard, get out of single-kboard state if we're in it for this kboard. */ - { - Lisp_Object frames; - /* Some frame we found on the same kboard, or nil if there are none. */ - Lisp_Object frame_on_same_kboard; + if (kb != NULL) + { + Lisp_Object frames; + /* Some frame we found on the same kboard, or nil if there are none. */ + Lisp_Object frame_on_same_kboard; - frame_on_same_kboard = Qnil; + frame_on_same_kboard = Qnil; - for (frames = Vframe_list; - CONSP (frames); - frames = XCDR (frames)) - { - Lisp_Object this; - struct frame *f1; + for (frames = Vframe_list; + CONSP (frames); + frames = XCDR (frames)) + { + Lisp_Object this; + struct frame *f1; - this = XCAR (frames); - if (!FRAMEP (this)) - abort (); - f1 = XFRAME (this); + this = XCAR (frames); + if (!FRAMEP (this)) + abort (); + f1 = XFRAME (this); - if (FRAME_KBOARD (f) == FRAME_KBOARD (f1)) - frame_on_same_kboard = this; - } + if (kb == FRAME_KBOARD (f1)) + frame_on_same_kboard = this; + } - if (NILP (frame_on_same_kboard)) - not_single_kboard_state (FRAME_KBOARD (f)); - } + if (NILP (frame_on_same_kboard)) + not_single_kboard_state (kb); + } /* If we've deleted this keyboard's default_minibuffer_frame, try to find another one. Prefer minibuffer-only frames, but also notice frames with other windows. */ - if (EQ (frame, FRAME_KBOARD (f)->Vdefault_minibuffer_frame)) + if (kb != NULL && EQ (frame, kb->Vdefault_minibuffer_frame)) { Lisp_Object frames; @@ -1398,7 +1649,7 @@ The functions are run with one arg, the frame to be deleted. */) /* Consider only frames on the same kboard and only those with minibuffers. */ - if (FRAME_KBOARD (f) == FRAME_KBOARD (f1) + if (kb == FRAME_KBOARD (f1) && FRAME_HAS_MINIBUF_P (f1)) { frame_with_minibuf = this; @@ -1406,7 +1657,7 @@ The functions are run with one arg, the frame to be deleted. */) break; } - if (FRAME_KBOARD (f) == FRAME_KBOARD (f1)) + if (kb == FRAME_KBOARD (f1)) frame_on_same_kboard = this; } @@ -1421,11 +1672,11 @@ The functions are run with one arg, the frame to be deleted. */) if (NILP (frame_with_minibuf)) abort (); - FRAME_KBOARD (f)->Vdefault_minibuffer_frame = frame_with_minibuf; + kb->Vdefault_minibuffer_frame = frame_with_minibuf; } else /* No frames left on this kboard--say no minibuffer either. */ - FRAME_KBOARD (f)->Vdefault_minibuffer_frame = Qnil; + kb->Vdefault_minibuffer_frame = Qnil; } /* Cause frame titles to update--necessary if we now have just one frame. */ @@ -1462,11 +1713,11 @@ and returns whatever that function returns. */) #if defined (HAVE_MOUSE) || defined (HAVE_GPM) /* It's okay for the hook to refrain from storing anything. */ - if (mouse_position_hook) - (*mouse_position_hook) (&f, -1, - &lispy_dummy, &party_dummy, - &x, &y, - &long_dummy); + if (FRAME_TERMINAL (f)->mouse_position_hook) + (*FRAME_TERMINAL (f)->mouse_position_hook) (&f, -1, + &lispy_dummy, &party_dummy, + &x, &y, + &long_dummy); if (! NILP (x)) { col = XINT (x); @@ -1506,11 +1757,11 @@ and nil for X and Y. */) #if defined (HAVE_MOUSE) || defined (HAVE_GPM) /* It's okay for the hook to refrain from storing anything. */ - if (mouse_position_hook) - (*mouse_position_hook) (&f, -1, - &lispy_dummy, &party_dummy, - &x, &y, - &long_dummy); + if (FRAME_TERMINAL (f)->mouse_position_hook) + (*FRAME_TERMINAL (f)->mouse_position_hook) (&f, -1, + &lispy_dummy, &party_dummy, + &x, &y, + &long_dummy); #endif XSETFRAME (lispy_dummy, f); return Fcons (lispy_dummy, Fcons (x, y)); @@ -1797,16 +2048,19 @@ doesn't support multiple overlapping frames, this function does nothing. */) (frame) Lisp_Object frame; { + struct frame *f; if (NILP (frame)) frame = selected_frame; CHECK_LIVE_FRAME (frame); + f = XFRAME (frame); + /* Do like the documentation says. */ Fmake_frame_visible (frame); - if (frame_raise_lower_hook) - (*frame_raise_lower_hook) (XFRAME (frame), 1); + if (FRAME_TERMINAL (f)->frame_raise_lower_hook) + (*FRAME_TERMINAL (f)->frame_raise_lower_hook) (f, 1); return Qnil; } @@ -1820,13 +2074,17 @@ doesn't support multiple overlapping frames, this function does nothing. */) (frame) Lisp_Object frame; { + struct frame *f; + if (NILP (frame)) frame = selected_frame; CHECK_LIVE_FRAME (frame); - if (frame_raise_lower_hook) - (*frame_raise_lower_hook) (XFRAME (frame), 0); + f = XFRAME (frame); + + if (FRAME_TERMINAL (f)->frame_raise_lower_hook) + (*FRAME_TERMINAL (f)->frame_raise_lower_hook) (f, 0); return Qnil; } @@ -1860,6 +2118,8 @@ The redirection lasts until `redirect-frame-focus' is called to change it. */) (frame, focus_frame) Lisp_Object frame, focus_frame; { + struct frame *f; + /* Note that we don't check for a live frame here. It's reasonable to redirect the focus of a frame you're about to delete, if you know what other frame should receive those keystrokes. */ @@ -1868,10 +2128,12 @@ The redirection lasts until `redirect-frame-focus' is called to change it. */) if (! NILP (focus_frame)) CHECK_LIVE_FRAME (focus_frame); - XFRAME (frame)->focus_frame = focus_frame; + f = XFRAME (frame); + + f->focus_frame = focus_frame; - if (frame_rehighlight_hook) - (*frame_rehighlight_hook) (XFRAME (frame)); + if (FRAME_TERMINAL (f)->frame_rehighlight_hook) + (*FRAME_TERMINAL (f)->frame_rehighlight_hook) (f); return Qnil; } @@ -1933,7 +2195,7 @@ set_frame_buffer_list (frame, list) XFRAME (frame)->buffer_list = list; } -/* Discard BUFFER from the buffer-list of each frame. */ +/* Discard BUFFER from the buffer-list and buried-buffer-list of each frame. */ void frames_discard_buffer (buffer) @@ -1945,6 +2207,8 @@ frames_discard_buffer (buffer) { XFRAME (frame)->buffer_list = Fdelq (buffer, XFRAME (frame)->buffer_list); + XFRAME (frame)->buried_buffer_list + = Fdelq (buffer, XFRAME (frame)->buried_buffer_list); } } @@ -2003,8 +2267,8 @@ set_term_frame_name (f, name) SBYTES (f->name))) return; - terminal_frame_count++; - sprintf (namebuf, "F%d", terminal_frame_count); + tty_frame_count++; + sprintf (namebuf, "F%d", tty_frame_count); name = build_string (namebuf); } else @@ -2032,13 +2296,18 @@ store_frame_param (f, prop, val) { register Lisp_Object old_alist_elt; - /* The buffer-alist parameter is stored in a special place and is - not in the alist. */ + /* The buffer-list parameters are stored in a special place and not + in the alist. */ if (EQ (prop, Qbuffer_list)) { f->buffer_list = val; return; } + if (EQ (prop, Qburied_buffer_list)) + { + f->buried_buffer_list = val; + return; + } /* If PROP is a symbol which is supposed to have frame-local values, and it is set up based on this frame, switch to the global @@ -2051,6 +2320,7 @@ store_frame_param (f, prop, val) if ((BUFFER_LOCAL_VALUEP (valcontents) || SOME_BUFFER_LOCAL_VALUEP (valcontents)) && XBUFFER_LOCAL_VALUE (valcontents)->check_frame + && XBUFFER_LOCAL_VALUE (valcontents)->found_for_frame && XFRAME (XBUFFER_LOCAL_VALUE (valcontents)->frame) == f) swap_in_global_binding (prop); } @@ -2133,7 +2403,7 @@ If FRAME is omitted, return information on the currently selected frame. */) unspecified and reversed, take the frame's background pixel for foreground and vice versa. */ elt = Fassq (Qforeground_color, alist); - if (!NILP (elt) && CONSP (elt) && STRINGP (XCDR (elt))) + if (CONSP (elt) && STRINGP (XCDR (elt))) { if (strncmp (SDATA (XCDR (elt)), unspecified_bg, @@ -2147,7 +2417,7 @@ If FRAME is omitted, return information on the currently selected frame. */) else store_in_alist (&alist, Qforeground_color, tty_color_name (f, fg)); elt = Fassq (Qbackground_color, alist); - if (!NILP (elt) && CONSP (elt) && STRINGP (XCDR (elt))) + if (CONSP (elt) && STRINGP (XCDR (elt))) { if (strncmp (SDATA (XCDR (elt)), unspecified_fg, @@ -2178,6 +2448,7 @@ If FRAME is omitted, return information on the currently selected frame. */) : FRAME_MINIBUF_WINDOW (f))); store_in_alist (&alist, Qunsplittable, (FRAME_NO_SPLIT_P (f) ? Qt : Qnil)); store_in_alist (&alist, Qbuffer_list, frame_buffer_list (frame)); + store_in_alist (&alist, Qburied_buffer_list, XFRAME (frame)->buried_buffer_list); /* I think this should be done with a hook. */ #ifdef HAVE_WINDOW_SYSTEM @@ -2345,9 +2616,45 @@ enabled such bindings for that variable with `make-variable-frame-local'. */) call1 (Qframe_set_background_mode, frame); } } - return Qnil; } + +DEFUN ("frame-with-environment", Fframe_with_environment, Sframe_with_environment, 0, 1, 0, + doc: /* Return the frame that has the environment variable list for FRAME. + +The frame-local environment variable list is normally shared between +frames that were created in the same Emacsclient session. The +environment list is stored in a single frame's 'environment parameter; +the other frames' 'environment parameter is set to this frame. This +function follows the chain of 'environment references to reach the +frame that stores the actual local environment list, and returns that +frame. */) + (frame) + Lisp_Object frame; +{ + Lisp_Object hare, tortoise; + + if (NILP (frame)) + frame = selected_frame; + CHECK_FRAME (frame); + + hare = tortoise = get_frame_param (XFRAME (frame), Qenvironment); + while (!NILP (hare) && FRAMEP (hare)) + { + frame = hare; + hare = get_frame_param (XFRAME (hare), Qenvironment); + if (NILP (hare) || !FRAMEP (hare)) + break; + frame = hare; + hare = get_frame_param (XFRAME (hare), Qenvironment); + tortoise = get_frame_param (XFRAME (tortoise), Qenvironment); + if (EQ (hare, tortoise)) + error ("Cyclic frame-local environment indirection"); + } + + return frame; +} + DEFUN ("frame-char-height", Fframe_char_height, Sframe_char_height, 0, 1, 0, @@ -2767,9 +3074,8 @@ x_set_frame_parameters (f, alist) if (NATNUMP (param_index) && (XFASTINT (param_index) < sizeof (frame_parms)/sizeof (frame_parms[0])) - && rif->frame_parm_handlers[XINT (param_index)]) - (*(rif->frame_parm_handlers[XINT (param_index)])) (f, val, old_value); - + && FRAME_RIF (f)->frame_parm_handlers[XINT (param_index)]) + (*(FRAME_RIF (f)->frame_parm_handlers[XINT (param_index)])) (f, val, old_value); unbind_to (count, Qnil); } } @@ -2783,9 +3089,9 @@ x_set_frame_parameters (f, alist) prop = parms[i]; val = values[i]; - if (EQ (prop, Qwidth) && NUMBERP (val)) + if (EQ (prop, Qwidth) && NATNUMP (val)) width = XFASTINT (val); - else if (EQ (prop, Qheight) && NUMBERP (val)) + else if (EQ (prop, Qheight) && NATNUMP (val)) height = XFASTINT (val); else if (EQ (prop, Qtop)) top = val; @@ -2813,8 +3119,8 @@ x_set_frame_parameters (f, alist) if (NATNUMP (param_index) && (XFASTINT (param_index) < sizeof (frame_parms)/sizeof (frame_parms[0])) - && rif->frame_parm_handlers[XINT (param_index)]) - (*(rif->frame_parm_handlers[XINT (param_index)])) (f, val, old_value); + && FRAME_RIF (f)->frame_parm_handlers[XINT (param_index)]) + (*(FRAME_RIF (f)->frame_parm_handlers[XINT (param_index)])) (f, val, old_value); } } @@ -3052,8 +3358,8 @@ x_set_fullscreen (f, new_value, old_value) else if (EQ (new_value, Qfullheight)) f->want_fullscreen = FULLSCREEN_HEIGHT; - if (fullscreen_hook != NULL) - fullscreen_hook (f); + if (FRAME_TERMINAL (f)->fullscreen_hook != NULL) + FRAME_TERMINAL (f)->fullscreen_hook (f); } @@ -3102,9 +3408,9 @@ x_set_screen_gamma (f, new_value, old_value) if (NATNUMP (index) && (XFASTINT (index) < sizeof (frame_parms)/sizeof (frame_parms[0])) - && rif->frame_parm_handlers[XFASTINT (index)]) - (*(rif->frame_parm_handlers[XFASTINT (index)])) - (f, bgcolor, Qnil); + && FRAME_RIF (f)->frame_parm_handlers[XFASTINT (index)]) + (*FRAME_RIF (f)->frame_parm_handlers[XFASTINT (index)]) + (f, bgcolor, Qnil); } Fclear_face_cache (Qnil); @@ -4135,12 +4441,22 @@ syms_of_frame () staticpro (&Qbuffer_predicate); Qbuffer_list = intern ("buffer-list"); staticpro (&Qbuffer_list); + Qburied_buffer_list = intern ("buried-buffer-list"); + staticpro (&Qburied_buffer_list); Qdisplay_type = intern ("display-type"); staticpro (&Qdisplay_type); Qbackground_mode = intern ("background-mode"); staticpro (&Qbackground_mode); Qtty_color_mode = intern ("tty-color-mode"); staticpro (&Qtty_color_mode); + Qtty = intern ("tty"); + staticpro (&Qtty); + Qtty_type = intern ("tty-type"); + staticpro (&Qtty_type); + Qwindow_system = intern ("window-system"); + staticpro (&Qwindow_system); + Qenvironment = intern ("environment"); + staticpro (&Qenvironment); Qface_set_after_frame_default = intern ("face-set-after-frame-default"); staticpro (&Qface_set_after_frame_default); @@ -4161,6 +4477,11 @@ syms_of_frame () Qx_frame_parameter = intern ("x-frame-parameter"); staticpro (&Qx_frame_parameter); + Qterminal = intern ("terminal"); + staticpro (&Qterminal); + Qterminal_live_p = intern ("terminal-live-p"); + staticpro (&Qterminal_live_p); + { int i; @@ -4209,6 +4530,7 @@ These may be set in your init file, like this: These override values given in window system configuration data, including X Windows' defaults database. For values specific to the first Emacs frame, see `initial-frame-alist'. +For window-system specific values, see `window-system-default-frame-alist'. For values specific to the separate minibuffer frame, see `minibuffer-frame-alist'. The `menu-bar-lines' element of the list controls whether new frames @@ -4230,7 +4552,7 @@ Setting this variable does not affect existing frames, only new ones. */); #endif DEFVAR_LISP ("terminal-frame", &Vterminal_frame, - doc: /* The initial frame-object, which represents Emacs's stdout. */); + doc: /* The initial frame-object, which represents Emacs's stdout. */); DEFVAR_LISP ("emacs-iconified", &Vemacs_iconified, doc: /* Non-nil if all of Emacs is iconified and frame updates are not needed. */); @@ -4255,7 +4577,14 @@ when the mouse is over clickable text. */); DEFVAR_LISP ("delete-frame-functions", &Vdelete_frame_functions, doc: /* Functions to be run before deleting a frame. The functions are run with one arg, the frame to be deleted. -See `delete-frame'. */); +See `delete-frame'. + +Note that functions in this list may be called twice on the same +frame. In the second invocation, the frame is already deleted, and +the function should do nothing. (You can use `frame-live-p' to check +for this.) This wrinkle happens when an earlier function in +`delete-frame-functions' (indirectly) calls delete-frame +recursively. */); Vdelete_frame_functions = Qnil; DEFVAR_KBOARD ("default-minibuffer-frame", Vdefault_minibuffer_frame, @@ -4273,11 +4602,27 @@ displayed. This variable is local to the current terminal and cannot be buffer-local. */); + DEFVAR_BOOL ("focus-follows-mouse", &focus_follows_mouse, + doc: /* Non-nil if window system changes focus when you move the mouse. +You should set this variable to tell Emacs how your window manager +handles focus, since there is no way in general for Emacs to find out +automatically. */); +#ifdef HAVE_WINDOW_SYSTEM +#if defined(HAVE_NTGUI) || defined(MAC_OS) + focus_follows_mouse = 0; +#else + focus_follows_mouse = 1; +#endif +#else + focus_follows_mouse = 0; +#endif + staticpro (&Vframe_list); defsubr (&Sactive_minibuffer_window); defsubr (&Sframep); defsubr (&Sframe_live_p); + defsubr (&Swindow_system); defsubr (&Smake_terminal_frame); defsubr (&Shandle_switch_frame); defsubr (&Sselect_frame); @@ -4311,6 +4656,7 @@ This variable is local to the current terminal and cannot be buffer-local. */); defsubr (&Sframe_parameters); defsubr (&Sframe_parameter); defsubr (&Smodify_frame_parameters); + defsubr (&Sframe_with_environment); defsubr (&Sframe_char_height); defsubr (&Sframe_char_width); defsubr (&Sframe_pixel_height); diff --git a/src/frame.h b/src/frame.h index 245b4aa3eb3..e48dd646da3 100644 --- a/src/frame.h +++ b/src/frame.h @@ -29,9 +29,7 @@ Boston, MA 02110-1301, USA. */ /* Miscellanea. */ -/* Nonzero means don't assume anything about current contents of - actual terminal frame */ - +/* Nonzero means there is at least one garbaged frame. */ extern int frame_garbaged; /* Nonzero means FRAME_MESSAGE_BUF (selected_frame) is being used by @@ -39,11 +37,17 @@ extern int frame_garbaged; extern int message_buf_print; +/* Nonzero means window system changes focus when moving the + mouse. */ + +extern int focus_follows_mouse; + /* The structure representing a frame. */ enum output_method { + output_initial, output_termcap, output_x_window, output_msdos_raw, @@ -68,30 +72,10 @@ enum text_cursor_kinds HBAR_CURSOR }; -#if !defined(MSDOS) && !defined(WINDOWSNT) && !defined(MAC_OS) - -#if !defined(HAVE_X_WINDOWS) - -#define PIX_TYPE unsigned long - -/* A (mostly empty) x_output structure definition for building Emacs - on Unix and GNU/Linux without X support. */ -struct x_output -{ - PIX_TYPE background_pixel; - PIX_TYPE foreground_pixel; -}; - -#endif /* ! HAVE_X_WINDOWS */ - - -#define FRAME_FOREGROUND_PIXEL(f) ((f)->output_data.x->foreground_pixel) -#define FRAME_BACKGROUND_PIXEL(f) ((f)->output_data.x->background_pixel) - -/* A structure describing a termcap frame display. */ -extern struct x_output tty_display; +#define FRAME_FOREGROUND_PIXEL(f) ((f)->foreground_pixel) +#define FRAME_BACKGROUND_PIXEL(f) ((f)->background_pixel) -#endif /* ! MSDOS && ! WINDOWSNT && ! MAC_OS */ +struct terminal; #ifdef USE_FONT_BACKEND struct font_driver_list; @@ -99,11 +83,10 @@ struct font_driver_list; struct frame { - EMACS_INT size; + EMACS_UINT size; struct Lisp_Vector *next; /* All Lisp_Object components must come first. - Only EMACS_INT values can be intermixed with them. That ensures they are all aligned normally. */ /* Name of this frame: a Lisp string. It is used for looking up resources, @@ -157,7 +140,7 @@ struct frame Actually, we don't specify exactly what is stored here at all; the scroll bar implementation code can use it to store anything it likes. This field is marked by the garbage collector. It is here - instead of in the `display' structure so that the garbage + instead of in the `device' structure so that the garbage collector doesn't need to look inside the window-system-dependent structure. */ Lisp_Object scroll_bars; @@ -177,8 +160,6 @@ struct frame For the format of the data, see extensive comments in xmenu.c. Only the X toolkit version uses this. */ Lisp_Object menu_bar_vector; - /* Number of elements in the vector that have meaningful data. */ - EMACS_INT menu_bar_items_used; /* Predicate for selecting buffers for other-buffer. */ Lisp_Object buffer_predicate; @@ -186,6 +167,10 @@ struct frame /* List of buffers viewed in this frame, for other-buffer. */ Lisp_Object buffer_list; + /* List of buffers that were viewed, then buried in this frame. The + most recently buried buffer is first. For last-buffer. */ + Lisp_Object buried_buffer_list; + /* A dummy window used to display menu bars under X when no X toolkit support is available. */ Lisp_Object menu_bar_window; @@ -199,11 +184,14 @@ struct frame /* Desired and current contents displayed in tool_bar_window. */ Lisp_Object desired_tool_bar_string, current_tool_bar_string; - /* beyond here, there should be no more Lisp_Object components. */ + /* Beyond here, there should be no more Lisp_Object components. */ /* Cache of realized faces. */ struct face_cache *face_cache; + /* Number of elements in `menu_bar_vector' that have meaningful data. */ + EMACS_INT menu_bar_items_used; + /* A buffer to hold the frame's name. We can't use the Lisp string's pointer (`name', above) because it might get relocated. */ char *namebuf; @@ -290,20 +278,24 @@ struct frame /* Canonical Y unit. Height of a line, in pixels. */ int line_height; - /* The output method says how the contents of this frame - are displayed. It could be using termcap, or using an X window. */ + /* The output method says how the contents of this frame are + displayed. It could be using termcap, or using an X window. + This must be the same as the terminal->type. */ enum output_method output_method; - /* A structure of auxiliary data used for displaying the contents. - struct x_output is used for X window frames; - it is defined in xterm.h. - struct w32_output is used for W32 window frames; - it is defined in w32term.h. */ + /* The terminal device that this frame uses. If this is NULL, then + the frame has been deleted. */ + struct terminal *terminal; + + /* Device-dependent, frame-local auxiliary data used for displaying + the contents. When the frame is deleted, this data is deleted as + well. */ union output_data { - struct x_output *x; - struct w32_output *w32; - struct mac_output *mac; + struct tty_output *tty; /* termchar.h */ + struct x_output *x; /* xterm.h */ + struct w32_output *w32; /* w32term.h */ + struct mac_output *mac; /* macterm.h */ EMACS_INT nothing; } output_data; @@ -323,13 +315,6 @@ struct frame /* The extra width (in pixels) currently allotted for fringes. */ int left_fringe_width, right_fringe_width; -#ifdef MULTI_KBOARD - /* A pointer to the kboard structure associated with this frame. - For termcap frames, this points to initial_kboard. For X frames, - it will be the same as display.x->display_info->kboard. */ - struct kboard *kboard; -#endif - /* See FULLSCREEN_ enum below */ int want_fullscreen; @@ -353,13 +338,13 @@ struct frame frame becomes visible again, it must be marked as garbaged. The FRAME_SAMPLE_VISIBILITY macro takes care of this. - On Windows NT/9X, to avoid wasting effort updating visible frames - that are actually completely obscured by other windows on the - display, we bend the meaning of visible slightly: if greater than - 1, then the frame is obscured - we still consider it to be - "visible" as seen from lisp, but we don't bother updating it. We - must take care to garbage the frame when it ceaces to be obscured - though. Note that these semantics are only used on NT/9X. + On ttys and on Windows NT/9X, to avoid wasting effort updating + visible frames that are actually completely obscured by other + windows on the display, we bend the meaning of visible slightly: + if greater than 1, then the frame is obscured - we still consider + it to be "visible" as seen from lisp, but we don't bother + updating it. We must take care to garbage the frame when it + ceaces to be obscured though. iconified is nonzero if the frame is currently iconified. @@ -453,7 +438,7 @@ struct frame /* The baud rate that was used to calculate costs for this frame. */ int cost_calculation_baud_rate; - /* Nonzero if the mouse has moved on this display + /* Nonzero if the mouse has moved on this display device since the last time we checked. */ char mouse_moved; @@ -473,6 +458,10 @@ struct frame update_frame, usually after resizing the frame. */ unsigned force_flush_display_p : 1; + /* All display backends seem to need these two pixel values. */ + unsigned long background_pixel; + unsigned long foreground_pixel; + /* Set to non-zero if the default face for the frame has been realized. Reset to zero whenever the default face changes. Used to see the difference between a font change and face change. */ @@ -491,7 +480,7 @@ struct frame }; #ifdef MULTI_KBOARD -#define FRAME_KBOARD(f) ((f)->kboard) +#define FRAME_KBOARD(f) ((f)->terminal->kboard) #else #define FRAME_KBOARD(f) (&the_only_kboard) #endif @@ -505,6 +494,7 @@ typedef struct frame *FRAME_PTR; #define WINDOW_FRAME(w) (w)->frame /* Test a frame for particular kinds of display methods. */ +#define FRAME_INITIAL_P(f) ((f)->output_method == output_initial) #define FRAME_TERMCAP_P(f) ((f)->output_method == output_termcap) #define FRAME_X_P(f) ((f)->output_method == output_x_window) #define FRAME_W32_P(f) ((f)->output_method == output_w32) @@ -528,7 +518,7 @@ typedef struct frame *FRAME_PTR; #endif /* Nonzero if frame F is still alive (not deleted). */ -#define FRAME_LIVE_P(f) ((f)->output_data.nothing != 0) +#define FRAME_LIVE_P(f) ((f)->terminal != 0) /* Nonzero if frame F is a minibuffer-only frame. */ #define FRAME_MINIBUF_ONLY_P(f) \ @@ -768,7 +758,10 @@ typedef struct frame *FRAME_PTR; Also, if a frame used to be invisible, but has just become visible, it must be marked as garbaged, since redisplay hasn't been keeping - up its contents. */ + up its contents. + + Note that a tty frame is visible if and only if it is the topmost + frame. */ #define FRAME_SAMPLE_VISIBILITY(f) \ (((f)->async_visible && (f)->visible != (f)->async_visible) ? \ @@ -801,10 +794,14 @@ typedef struct frame *FRAME_PTR; extern Lisp_Object Qframep, Qframe_live_p; +extern Lisp_Object Qtty, Qtty_type; +extern Lisp_Object Qterminal, Qterminal_live_p; +extern Lisp_Object Qenvironment; extern struct frame *last_nonminibuf_frame; -extern struct frame *make_terminal_frame P_ ((void)); +extern struct frame *make_initial_frame P_ ((void)); +extern struct frame *make_terminal_frame P_ ((struct terminal *)); extern struct frame *make_frame P_ ((int)); #ifdef HAVE_WINDOW_SYSTEM extern struct frame *make_minibuffer_frame P_ ((void)); @@ -1004,7 +1001,7 @@ extern Lisp_Object selected_frame; extern Lisp_Object Qauto_raise, Qauto_lower; extern Lisp_Object Qborder_color, Qborder_width; -extern Lisp_Object Qbuffer_predicate, Qbuffer_list; +extern Lisp_Object Qbuffer_predicate, Qbuffer_list, Qburied_buffer_list; extern Lisp_Object Qcursor_color, Qcursor_type; extern Lisp_Object Qfont; extern Lisp_Object Qbackground_color, Qforeground_color; @@ -1037,6 +1034,8 @@ extern Lisp_Object Qx_resource_name; extern Lisp_Object Qleft, Qright, Qtop, Qbox; extern Lisp_Object Qdisplay; +extern Lisp_Object Qwindow_system; + #ifdef HAVE_WINDOW_SYSTEM /* The class of this X application. */ @@ -1049,7 +1048,7 @@ enum FULLSCREEN_WIDTH = 1, FULLSCREEN_HEIGHT = 2, FULLSCREEN_BOTH = 3, - FULLSCREEN_WAIT = 4, + FULLSCREEN_WAIT = 4 }; diff --git a/src/fringe.c b/src/fringe.c index 9f1089f71cd..f24ab34f429 100644 --- a/src/fringe.c +++ b/src/fringe.c @@ -29,6 +29,7 @@ Boston, MA 02110-1301, USA. */ #include "dispextern.h" #include "buffer.h" #include "blockinput.h" +#include "termhooks.h" #ifdef HAVE_WINDOW_SYSTEM @@ -686,7 +687,7 @@ draw_fringe_bitmap_1 (w, row, left_p, overlay, which) break; } - rif->draw_fringe_bitmap (w, row, &p); + FRAME_RIF (f)->draw_fringe_bitmap (w, row, &p); } static int @@ -1278,6 +1279,8 @@ destroy_fringe_bitmap (n) fbp = &fringe_bitmaps[n]; if (*fbp && (*fbp)->dynamic) { + /* XXX Is SELECTED_FRAME OK here? */ + struct redisplay_interface *rif = FRAME_RIF (SELECTED_FRAME ()); if (rif && rif->destroy_fringe_bitmap) rif->destroy_fringe_bitmap (n); xfree (*fbp); @@ -1327,6 +1330,14 @@ If BITMAP overrides a standard fringe bitmap, the original bitmap is restored. On W32 and MAC (little endian), there's no need to do this. */ +#if defined (HAVE_X_WINDOWS) +static unsigned char swap_nibble[16] = { + 0x0, 0x8, 0x4, 0xc, /* 0000 1000 0100 1100 */ + 0x2, 0xa, 0x6, 0xe, /* 0010 1010 0110 1110 */ + 0x1, 0x9, 0x5, 0xd, /* 0001 1001 0101 1101 */ + 0x3, 0xb, 0x7, 0xf}; /* 0011 1011 0111 1111 */ +#endif /* HAVE_X_WINDOWS */ + void init_fringe_bitmap (which, fb, once_p) int which; @@ -1336,11 +1347,6 @@ init_fringe_bitmap (which, fb, once_p) if (once_p || fb->dynamic) { #if defined (HAVE_X_WINDOWS) - static unsigned char swap_nibble[16] - = { 0x0, 0x8, 0x4, 0xc, /* 0000 1000 0100 1100 */ - 0x2, 0xa, 0x6, 0xe, /* 0010 1010 0110 1110 */ - 0x1, 0x9, 0x5, 0xd, /* 0001 1001 0101 1101 */ - 0x3, 0xb, 0x7, 0xf }; /* 0011 1011 0111 1111 */ unsigned short *bits = fb->bits; int j; @@ -1383,6 +1389,9 @@ init_fringe_bitmap (which, fb, once_p) if (!once_p) { + /* XXX Is SELECTED_FRAME OK here? */ + struct redisplay_interface *rif = FRAME_RIF (SELECTED_FRAME ()); + destroy_fringe_bitmap (which); if (rif && rif->define_fringe_bitmap) @@ -1693,10 +1702,11 @@ init_fringe () void #ifdef HAVE_NTGUI -w32_init_fringe () +w32_init_fringe (rif) #else /* MAC_OS */ -mac_init_fringe () +mac_init_fringe (rif) #endif + struct redisplay_interface *rif; { int bt; @@ -1717,6 +1727,7 @@ w32_reset_fringes () { /* Destroy row bitmaps. */ int bt; + struct redisplay_interface *rif = FRAME_RIF (SELECTED_FRAME ()); if (!rif) return; diff --git a/src/gtkutil.c b/src/gtkutil.c index 9fb011de919..81ef09b7ec4 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -51,6 +51,13 @@ Boston, MA 02110-1301, USA. */ #ifdef HAVE_GTK_MULTIDISPLAY +/* Gtk does not work well without any display open. Emacs may close + all its displays. In that case, keep a display around just for + the purpose of having one. */ + +static GdkDisplay *gdpy_def; + + /* Return the GdkDisplay that corresponds to the X display DPY. */ static GdkDisplay * @@ -147,9 +154,15 @@ xg_display_close (Display *dpy) break; } - if (! new_dpy) return; /* Emacs will exit anyway. */ + if (new_dpy) + gdpy_new = gdk_x11_lookup_xdisplay (new_dpy); + else + { + if (!gdpy_def) + gdpy_def = gdk_display_open (gdk_display_get_name (gdpy)); + gdpy_new = gdpy_def; + } - gdpy_new = gdk_x11_lookup_xdisplay (new_dpy); gdk_display_manager_set_default_display (gdk_display_manager_get (), gdpy_new); } @@ -336,6 +349,8 @@ xg_get_image_for_pixmap (f, img, widget, old_widget) GdkPixmap *gpix; GdkPixmap *gmask; GdkDisplay *gdpy; + GdkColormap *cmap; + GdkPixbuf *icon_buf; /* If we have a file, let GTK do all the image handling. This seems to be the only way to make insensitive and activated icons @@ -366,32 +381,24 @@ xg_get_image_for_pixmap (f, img, widget, old_widget) gpix = gdk_pixmap_foreign_new_for_display (gdpy, img->pixmap); gmask = img->mask ? gdk_pixmap_foreign_new_for_display (gdpy, img->mask) : 0; - if (x_screen_planes (f) > 8 || x_screen_planes (f) == 1) - { - if (! old_widget) - old_widget = GTK_IMAGE (gtk_image_new_from_pixmap (gpix, gmask)); - else - gtk_image_set_from_pixmap (old_widget, gpix, gmask); - } + /* This is a workaround to make icons look good on pseudo color + displays. Apparently GTK expects the images to have an alpha + channel. If they don't, insensitive and activated icons will + look bad. This workaround does not work on monochrome displays, + and is strictly not needed on true color/static color displays (i.e. + 16 bits and higher). But we do it anyway so we get a pixbuf that is + not associated with the img->pixmap. The img->pixmap may be removed + by clearing the image cache and then the tool bar redraw fails, since + Gtk+ assumes the pixmap is always there. */ + cmap = gtk_widget_get_colormap (widget); + icon_buf = xg_get_pixbuf_from_pix_and_mask (gpix, gmask, cmap); + + if (! old_widget) + old_widget = GTK_IMAGE (gtk_image_new_from_pixbuf (icon_buf)); else - { - - /* This is a workaround to make icons look good on pseudo color - displays. Apparently GTK expects the images to have an alpha - channel. If they don't, insensitive and activated icons will - look bad. This workaround does not work on monochrome displays, - and is not needed on true color/static color displays (i.e. - 16 bits and higher). */ - GdkColormap *cmap = gtk_widget_get_colormap (widget); - GdkPixbuf *icon_buf = xg_get_pixbuf_from_pix_and_mask (gpix, gmask, cmap); - - if (! old_widget) - old_widget = GTK_IMAGE (gtk_image_new_from_pixbuf (icon_buf)); - else - gtk_image_set_from_pixbuf (old_widget, icon_buf); + gtk_image_set_from_pixbuf (old_widget, icon_buf); - g_object_unref (G_OBJECT (icon_buf)); - } + g_object_unref (G_OBJECT (icon_buf)); g_object_unref (G_OBJECT (gpix)); if (gmask) g_object_unref (G_OBJECT (gmask)); @@ -874,7 +881,7 @@ xg_create_frame_widgets (f) /* Since GTK clears its window by filling with the background color, we must keep X and GTK background in sync. */ - xg_pix_to_gcolor (wfixed, f->output_data.x->background_pixel, &bg); + xg_pix_to_gcolor (wfixed, FRAME_BACKGROUND_PIXEL (f), &bg); gtk_widget_modify_bg (wfixed, GTK_STATE_NORMAL, &bg); /* Also, do not let any background pixmap to be set, this looks very @@ -1412,8 +1419,8 @@ xg_get_file_with_chooser (f, prompt, default_filename, { Lisp_Object file; struct gcpro gcpro1; - GCPRO1 (file); char *utf8_filename; + GCPRO1 (file); file = build_string (default_filename); @@ -1780,19 +1787,19 @@ menu_destroy_callback (w, client_data) UNGRAB_P is TRUE if this is an ungrab, FALSE if it is a grab. CLIENT_DATA is NULL (not used). */ +/* Keep track of total number of grabs. */ +static int menu_grab_callback_cnt; + static void menu_grab_callback (GtkWidget *widget, gboolean ungrab_p, gpointer client_data) { - /* Keep track of total number of grabs. */ - static int cnt; - - if (ungrab_p) cnt--; - else cnt++; + if (ungrab_p) menu_grab_callback_cnt--; + else menu_grab_callback_cnt++; - if (cnt > 0 && ! xg_timer) xg_start_timer (); - else if (cnt == 0 && xg_timer) xg_stop_timer (); + if (menu_grab_callback_cnt > 0 && ! xg_timer) xg_start_timer (); + else if (menu_grab_callback_cnt == 0 && xg_timer) xg_stop_timer (); } /* Make a GTK widget that contains both UTF8_LABEL and UTF8_KEY (both @@ -1890,6 +1897,24 @@ make_menu_item (utf8_label, utf8_key, item, group) /* Return non-zero if LABEL specifies a separator (GTK only has one separator type) */ +static char* separator_names[] = { + "space", + "no-line", + "single-line", + "double-line", + "single-dashed-line", + "double-dashed-line", + "shadow-etched-in", + "shadow-etched-out", + "shadow-etched-in-dash", + "shadow-etched-out-dash", + "shadow-double-etched-in", + "shadow-double-etched-out", + "shadow-double-etched-in-dash", + "shadow-double-etched-out-dash", + 0, +}; + static int xg_separator_p (char *label) { @@ -1898,24 +1923,6 @@ xg_separator_p (char *label) && strncmp (label, "--", 2) == 0 && label[2] != '-') { - static char* separator_names[] = { - "space", - "no-line", - "single-line", - "double-line", - "single-dashed-line", - "double-dashed-line", - "shadow-etched-in", - "shadow-etched-out", - "shadow-etched-in-dash", - "shadow-etched-out-dash", - "shadow-double-etched-in", - "shadow-double-etched-out", - "shadow-double-etched-in-dash", - "shadow-double-etched-out-dash", - 0, - }; - int i; label += 2; @@ -2043,7 +2050,7 @@ xg_create_one_menuitem (item, f, select_cb, highlight_cb, cl_data, group) return w; } -/* Callback called when keyboard traversal (started by menu-bar-open) ends. +/* Callback called when keyboard traversal (started by x-menu-bar-open) ends. WMENU is the menu for which traversal has been done. DATA points to the frame for WMENU. We must release grabs, some bad interaction between GTK and Emacs makes the menus keep the grabs. */ @@ -3346,6 +3353,10 @@ xg_set_toolkit_scroll_bar_thumb (bar, portion, position, whole) the GtkImage with a new image. */ #define XG_TOOL_BAR_STOCK_NAME "emacs-tool-bar-stock-name" +/* As above, but this is used for named theme widgets, as opposed to + stock items. */ +#define XG_TOOL_BAR_ICON_NAME "emacs-tool-bar-icon-name" + /* Callback function invoked when a tool bar item is pressed. W is the button widget in the tool bar that got pressed, CLIENT_DATA is an integer that is the index of the button in the @@ -3635,25 +3646,6 @@ xg_tool_bar_item_expose_callback (w, event, client_data) #define PROP(IDX) AREF (f->tool_bar_items, i * TOOL_BAR_ITEM_NSLOTS + (IDX)) -/* This callback is called when a tool bar shall be redrawn. - We need to update the images in case the image cache - has deleted the pixmaps used in the tool bar. - W is the GtkToolbar to be redrawn. - EVENT is the expose event for W. - CLIENT_DATA is pointing to the frame for this tool bar. - - Returns FALSE to tell GTK to keep processing this event. */ - -static gboolean -xg_tool_bar_expose_callback (w, event, client_data) - GtkWidget *w; - GdkEventExpose *event; - gpointer client_data; -{ - FRAME_PTR f = (FRAME_PTR) client_data; - SET_FRAME_GARBAGED (f); - return FALSE; -} /* Create a tool bar for frame F. */ @@ -3695,10 +3687,6 @@ xg_create_tool_bar (f) G_CALLBACK (xg_tool_bar_detach_callback), f); g_signal_connect (G_OBJECT (x->handlebox_widget), "child-attached", G_CALLBACK (xg_tool_bar_attach_callback), f); - g_signal_connect (G_OBJECT (x->toolbar_widget), - "expose-event", - G_CALLBACK (xg_tool_bar_expose_callback), - f); gtk_widget_show_all (x->handlebox_widget); @@ -3809,8 +3797,9 @@ update_frame_tool_bar (f) Lisp_Object stock; GtkStockItem stock_item; char *stock_name = NULL; + char *icon_name = NULL; Lisp_Object rtl; - GtkWidget *wbutton; + GtkWidget *wbutton = NULL; GtkWidget *weventbox; Lisp_Object func = intern ("x-gtk-map-stock"); @@ -3834,13 +3823,33 @@ update_frame_tool_bar (f) if (EQ (Qt, Ffboundp (func))) stock = call1 (func, file_for_image (image)); - if (! NILP (stock) && STRINGP (stock) - && gtk_stock_lookup (SSDATA (stock), &stock_item)) + if (! NILP (stock) && STRINGP (stock)) { stock_name = SSDATA (stock); - icon_size = gtk_toolbar_get_icon_size (wtoolbar); + if (stock_name[0] == 'n' && stock_name[1] == ':') + { + GdkScreen *screen = gtk_widget_get_screen (GTK_WIDGET (wtoolbar)); + GtkIconTheme *icon_theme = gtk_icon_theme_get_for_screen (screen); + + icon_name = stock_name + 2; + stock_name = NULL; + stock = Qnil; + + if (! gtk_icon_theme_has_icon (icon_theme, icon_name)) + icon_name = NULL; + else + icon_size = gtk_toolbar_get_icon_size (wtoolbar); + } + else if (gtk_stock_lookup (SSDATA (stock), &stock_item)) + icon_size = gtk_toolbar_get_icon_size (wtoolbar); + else + { + stock = Qnil; + stock_name = NULL; + } } - else + + if (stock_name == NULL && icon_name == NULL) { /* No stock image, or stock item not known. Try regular image. */ @@ -3905,6 +3914,13 @@ update_frame_tool_bar (f) (gpointer) xstrdup (stock_name), (GDestroyNotify) xfree); } + else if (icon_name) + { + w = gtk_image_new_from_icon_name (icon_name, icon_size); + g_object_set_data_full (G_OBJECT (w), XG_TOOL_BAR_ICON_NAME, + (gpointer) xstrdup (icon_name), + (GDestroyNotify) xfree); + } else { w = xg_get_image_for_pixmap (f, img, x->widget, NULL); @@ -3980,6 +3996,8 @@ update_frame_tool_bar (f) XG_TOOL_BAR_IMAGE_DATA); gpointer old_stock_name = g_object_get_data (G_OBJECT (wimage), XG_TOOL_BAR_STOCK_NAME); + gpointer old_icon_name = g_object_get_data (G_OBJECT (wimage), + XG_TOOL_BAR_ICON_NAME); if (stock_name && (! old_stock_name || strcmp (old_stock_name, stock_name) != 0)) { @@ -3990,6 +4008,20 @@ update_frame_tool_bar (f) (GDestroyNotify) xfree); g_object_set_data (G_OBJECT (wimage), XG_TOOL_BAR_IMAGE_DATA, NULL); + g_object_set_data (G_OBJECT (wimage), XG_TOOL_BAR_ICON_NAME, NULL); + } + else if (icon_name && + (! old_icon_name || strcmp (old_icon_name, icon_name) != 0)) + { + gtk_image_set_from_icon_name (GTK_IMAGE (wimage), + icon_name, icon_size); + g_object_set_data_full (G_OBJECT (wimage), XG_TOOL_BAR_ICON_NAME, + (gpointer) xstrdup (icon_name), + (GDestroyNotify) xfree); + g_object_set_data (G_OBJECT (wimage), XG_TOOL_BAR_IMAGE_DATA, + NULL); + g_object_set_data (G_OBJECT (wimage), XG_TOOL_BAR_STOCK_NAME, + NULL); } else if (img && old_img != img->pixmap) { @@ -3999,6 +4031,7 @@ update_frame_tool_bar (f) g_object_set_data (G_OBJECT (wimage), XG_TOOL_BAR_STOCK_NAME, NULL); + g_object_set_data (G_OBJECT (wimage), XG_TOOL_BAR_ICON_NAME, NULL); } gtk_misc_set_padding (GTK_MISC (wimage), hmargin, vmargin); @@ -4071,6 +4104,8 @@ xg_initialize () we keep it permanently linked in. */ XftInit (0); #endif + + gdpy_def = NULL; xg_ignore_gtk_scrollbar = 0; xg_detached_menus = 0; xg_menu_cb_list.prev = xg_menu_cb_list.next = diff --git a/src/image.c b/src/image.c index 54c01cf36b3..16826c425fa 100644 --- a/src/image.c +++ b/src/image.c @@ -532,7 +532,7 @@ x_create_bitmap_from_file (f, file) /* Free bitmap B. */ static void -Free_Bitmap_Record (dpyinfo, bm) +free_bitmap_record (dpyinfo, bm) Display_Info *dpyinfo; Bitmap_Record *bm; { @@ -574,7 +574,7 @@ x_destroy_bitmap (f, id) if (--bm->refcount == 0) { BLOCK_INPUT; - Free_Bitmap_Record (dpyinfo, bm); + free_bitmap_record (dpyinfo, bm); UNBLOCK_INPUT; } } @@ -591,7 +591,7 @@ x_destroy_all_bitmaps (dpyinfo) for (i = 0; i < dpyinfo->bitmaps_last; i++, bm++) if (bm->refcount > 0) - Free_Bitmap_Record (dpyinfo, bm); + free_bitmap_record (dpyinfo, bm); dpyinfo->bitmaps_last = 0; } @@ -1710,9 +1710,9 @@ free_image_cache (f) /* Clear image cache of frame F. FORCE_P non-zero means free all images. FORCE_P zero means clear only images that haven't been displayed for some time. Should be called from time to time to - reduce the number of loaded images. If image-eviction-seconds is - non-nil, this frees images in the cache which weren't displayed for - at least that many seconds. */ + reduce the number of loaded images. If image-cache-eviction-delay + is non-nil, this frees images in the cache which weren't displayed + for at least that many seconds. */ void clear_image_cache (f, force_p) @@ -1905,6 +1905,7 @@ lookup_image (f, spec) struct frame *f; Lisp_Object spec; { + struct image_cache *c; struct image *img; unsigned hash; struct gcpro gcpro1; @@ -1915,6 +1916,8 @@ lookup_image (f, spec) xassert (FRAME_WINDOW_P (f)); xassert (valid_image_p (spec)); + c = FRAME_X_IMAGE_CACHE (f); + GCPRO1 (spec); /* Look up SPEC in the hash table of the image cache. */ @@ -2374,7 +2377,7 @@ x_find_image_file (file) Vx_bitmap_file_path); GCPRO2 (file_found, search_path); - /* Try to find FILE in data-directory, then x-bitmap-file-path. */ + /* Try to find FILE in data-directory/images, then x-bitmap-file-path. */ fd = openp (search_path, file, Qnil, &file_found, Qnil); if (fd == -1) @@ -2883,7 +2886,7 @@ enum xbm_token 3. a vector of strings or bool-vectors, one for each line of the bitmap. - 4. A string containing an in-memory XBM file. WIDTH and HEIGHT + 4. a string containing an in-memory XBM file. WIDTH and HEIGHT may not be specified in this case because they are defined in the XBM file. @@ -4280,7 +4283,7 @@ xpm_scan (s, end, beg, len) return XPM_TK_EOF; } -/* Functions for color table lookup in XPM data. A Key is a string +/* Functions for color table lookup in XPM data. A key is a string specifying the color of each pixel in XPM data. A value is either an integer that specifies a pixel color, Qt that specifies transparency, or Qnil for the unspecified color. If the length of @@ -6343,7 +6346,7 @@ png_load (f, img) simple transparency, we prefer a clipping mask. */ if (!transparent_p) { - png_color_16 *image_bg; + /* png_color_16 *image_bg; */ Lisp_Object specified_bg = image_spec_value (img->spec, QCbackground, NULL); @@ -6774,18 +6777,19 @@ our_common_term_source (cinfo) whenever more data is needed. We read the whole image in one step, so this only adds a fake end of input marker at the end. */ +static JOCTET our_memory_buffer[2]; + static boolean our_memory_fill_input_buffer (cinfo) j_decompress_ptr cinfo; { /* Insert a fake EOI marker. */ struct jpeg_source_mgr *src = cinfo->src; - static JOCTET buffer[2]; - buffer[0] = (JOCTET) 0xFF; - buffer[1] = (JOCTET) JPEG_EOI; + our_memory_buffer[0] = (JOCTET) 0xFF; + our_memory_buffer[1] = (JOCTET) JPEG_EOI; - src->next_input_byte = buffer; + src->next_input_byte = our_memory_buffer; src->bytes_in_buffer = 2; return 1; } @@ -7755,6 +7759,9 @@ gif_read_from_memory (file, buf, len) /* Load GIF image IMG for use on frame F. Value is non-zero if successful. */ +static int interlace_start[] = {0, 4, 2, 1}; +static int interlace_increment[] = {8, 8, 4, 2}; + static int gif_load (f, img) struct frame *f; @@ -7883,13 +7890,14 @@ gif_load (f, img) init_color_table (); bzero (pixel_colors, sizeof pixel_colors); - for (i = 0; i < gif_color_map->ColorCount; ++i) - { - int r = gif_color_map->Colors[i].Red << 8; - int g = gif_color_map->Colors[i].Green << 8; - int b = gif_color_map->Colors[i].Blue << 8; - pixel_colors[i] = lookup_rgb_color (f, r, g, b); - } + if (gif_color_map) + for (i = 0; i < gif_color_map->ColorCount; ++i) + { + int r = gif_color_map->Colors[i].Red << 8; + int g = gif_color_map->Colors[i].Green << 8; + int b = gif_color_map->Colors[i].Blue << 8; + pixel_colors[i] = lookup_rgb_color (f, r, g, b); + } #ifdef COLOR_TABLE_SUPPORT img->colors = colors_in_color_table (&img->ncolors); @@ -7924,8 +7932,6 @@ gif_load (f, img) if (gif->SavedImages[ino].ImageDesc.Interlace) { - static int interlace_start[] = {0, 4, 2, 1}; - static int interlace_increment[] = {8, 8, 4, 2}; int pass; int row = interlace_start[0]; @@ -8436,16 +8442,16 @@ svg_load (f, img) return success_p; } -/* svg_load_image is a helper function for svg_load, which does the actual - loading given contents and size, apart from frame and image - structures, passed from svg_load. +/* svg_load_image is a helper function for svg_load, which does the + actual loading given contents and size, apart from frame and image + structures, passed from svg_load. - Uses librsvg to do most of the image processing. + Uses librsvg to do most of the image processing. - Returns non-zero when sucessful. */ + Returns non-zero when successful. */ static int svg_load_image (f, img, contents, size) - /* Pointer to emacs frame sturcture. */ + /* Pointer to emacs frame structure. */ struct frame *f; /* Pointer to emacs image structure. */ struct image *img; @@ -8555,8 +8561,8 @@ svg_load_image (f, img, contents, size) /* This loop handles opacity values, since Emacs assumes non-transparent images. Each pixel must be "flattened" by - calculating he resulting color, given the transparency of the - pixel, and the image background color. */ + calculating the resulting color, given the transparency of the + pixel, and the image background color. */ for (y = 0; y < height; ++y) { for (x = 0; x < width; ++x) @@ -9039,7 +9045,7 @@ syms_of_image () defining the supported image types. */ DEFVAR_LISP ("image-types", &Vimage_types, doc: /* List of potentially supported image types. -Each element of the list is a symbol for a image type, like 'jpeg or 'png. +Each element of the list is a symbol for an image type, like 'jpeg or 'png. To check whether it is really supported, use `image-type-available-p'. */); Vimage_types = Qnil; diff --git a/src/indent.c b/src/indent.c index 95afa031485..2a4fe1e5e72 100644 --- a/src/indent.c +++ b/src/indent.c @@ -20,6 +20,8 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include <config.h> +#include <stdio.h> + #include "lisp.h" #include "buffer.h" #include "character.h" @@ -51,7 +53,7 @@ double last_known_column; /* Value of point when current_column was called. */ -int last_known_column_point; +EMACS_INT last_known_column_point; /* Value of MODIFF when current_column was called. */ @@ -63,7 +65,7 @@ static double position_indentation P_ ((int)); /* Cache of beginning of line found by the last call of current_column. */ -int current_column_bol_cache; +static EMACS_INT current_column_bol_cache; /* Get the display table to use for the current buffer. */ @@ -212,16 +214,17 @@ width_run_cache_on_off () characters immediately following, then *NEXT_BOUNDARY_P will equal the return value. */ -int +EMACS_INT skip_invisible (pos, next_boundary_p, to, window) - int pos; - int *next_boundary_p; - int to; + EMACS_INT pos; + EMACS_INT *next_boundary_p; + EMACS_INT to; Lisp_Object window; { Lisp_Object prop, position, overlay_limit, proplimit; Lisp_Object buffer, tmp; - int end, inv_p; + EMACS_INT end; + int inv_p; XSETFASTINT (position, pos); XSETBUFFER (buffer, current_buffer); @@ -508,16 +511,16 @@ current_column () static double current_column_1 () { - register int tab_width = XINT (current_buffer->tab_width); + register EMACS_INT tab_width = XINT (current_buffer->tab_width); register int ctl_arrow = !NILP (current_buffer->ctl_arrow); register struct Lisp_Char_Table *dp = buffer_display_table (); int multibyte = !NILP (current_buffer->enable_multibyte_characters); /* Start the scan at the beginning of this line with column number 0. */ - register int col = 0; - int scan, scan_byte; - int next_boundary; - int opoint = PT, opoint_byte = PT_BYTE; + register EMACS_INT col = 0; + EMACS_INT scan, scan_byte; + EMACS_INT next_boundary; + EMACS_INT opoint = PT, opoint_byte = PT_BYTE; scan_newline (PT, PT_BYTE, BEGV, BEGV_BYTE, -1, 1); current_column_bol_cache = PT; @@ -806,13 +809,13 @@ static double position_indentation (pos_byte) register int pos_byte; { - register int column = 0; - register int tab_width = XINT (current_buffer->tab_width); + register EMACS_INT column = 0; + register EMACS_INT tab_width = XINT (current_buffer->tab_width); register unsigned char *p; register unsigned char *stop; unsigned char *start; - int next_boundary_byte = pos_byte; - int ceiling = next_boundary_byte; + EMACS_INT next_boundary_byte = pos_byte; + EMACS_INT ceiling = next_boundary_byte; if (tab_width <= 0 || tab_width > 1000) tab_width = 8; @@ -827,7 +830,7 @@ position_indentation (pos_byte) { while (p == stop) { - int stop_pos_byte; + EMACS_INT stop_pos_byte; /* If we have updated P, set POS_BYTE to match. The first time we enter the loop, POS_BYTE is already right. */ @@ -838,8 +841,8 @@ position_indentation (pos_byte) return column; if (pos_byte == next_boundary_byte) { - int next_boundary; - int pos = BYTE_TO_CHAR (pos_byte); + EMACS_INT next_boundary; + EMACS_INT pos = BYTE_TO_CHAR (pos_byte); pos = skip_invisible (pos, &next_boundary, ZV, Qnil); pos_byte = CHAR_TO_BYTE (pos); next_boundary_byte = CHAR_TO_BYTE (next_boundary); @@ -930,19 +933,19 @@ The return value is the current column. */) (column, force) Lisp_Object column, force; { - register int pos; - register int col = current_column (); - register int goal; - register int end; + register EMACS_INT pos; + register EMACS_INT col = current_column (); + register EMACS_INT goal; + register EMACS_INT end; register int tab_width = XINT (current_buffer->tab_width); register int ctl_arrow = !NILP (current_buffer->ctl_arrow); register struct Lisp_Char_Table *dp = buffer_display_table (); register int multibyte = !NILP (current_buffer->enable_multibyte_characters); Lisp_Object val; - int prev_col = 0; + EMACS_INT prev_col = 0; int c = 0; - int next_boundary, pos_byte; + EMACS_INT next_boundary, pos_byte; if (tab_width <= 0 || tab_width > 1000) tab_width = 8; CHECK_NATNUM (column); @@ -968,7 +971,7 @@ The return value is the current column. */) { while (pos == next_boundary) { - int prev = pos; + EMACS_INT prev = pos; pos = skip_invisible (pos, &next_boundary, end, Qnil); if (pos != prev) pos_byte = CHAR_TO_BYTE (pos); @@ -1088,7 +1091,7 @@ The return value is the current column. */) and scan through it again. */ if (!NILP (force) && col > goal && c == '\t' && prev_col < goal) { - int goal_pt, goal_pt_byte; + EMACS_INT goal_pt, goal_pt_byte; /* Insert spaces in front of the tab to reach GOAL. Do this first so that a marker at the end of the tab gets @@ -1188,19 +1191,19 @@ struct position val_compute_motion; struct position * compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width, hscroll, tab_offset, win) - int from, fromvpos, fromhpos, to, tovpos, tohpos; + EMACS_INT from, fromvpos, fromhpos, to, tovpos, tohpos; int did_motion; - register int width; - int hscroll, tab_offset; + EMACS_INT width; + EMACS_INT hscroll, tab_offset; struct window *win; { - register int hpos = fromhpos; - register int vpos = fromvpos; + register EMACS_INT hpos = fromhpos; + register EMACS_INT vpos = fromvpos; - register int pos; - int pos_byte; + register EMACS_INT pos; + EMACS_INT pos_byte; register int c = 0; - register int tab_width = XFASTINT (current_buffer->tab_width); + register EMACS_INT tab_width = XFASTINT (current_buffer->tab_width); register int ctl_arrow = !NILP (current_buffer->ctl_arrow); register struct Lisp_Char_Table *dp = window_display_table (win); int selective @@ -1212,33 +1215,33 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width, ? XVECTOR (DISP_INVIS_VECTOR (dp))->size : 0); /* The next location where the `invisible' property changes, or an overlay starts or ends. */ - int next_boundary = from; + EMACS_INT next_boundary = from; /* For computing runs of characters with similar widths. Invariant: width_run_width is zero, or all the characters from width_run_start to width_run_end have a fixed width of width_run_width. */ - int width_run_start = from; - int width_run_end = from; - int width_run_width = 0; + EMACS_INT width_run_start = from; + EMACS_INT width_run_end = from; + EMACS_INT width_run_width = 0; Lisp_Object *width_table; Lisp_Object buffer; /* The next buffer pos where we should consult the width run cache. */ - int next_width_run = from; + EMACS_INT next_width_run = from; Lisp_Object window; int multibyte = !NILP (current_buffer->enable_multibyte_characters); /* If previous char scanned was a wide character, this is the column where it ended. Otherwise, this is 0. */ - int wide_column_end_hpos = 0; - int prev_pos; /* Previous buffer position. */ - int prev_pos_byte; /* Previous buffer position. */ - int prev_hpos = 0; - int prev_vpos = 0; - int contin_hpos; /* HPOS of last column of continued line. */ - int prev_tab_offset; /* Previous tab offset. */ - int continuation_glyph_width; + EMACS_INT wide_column_end_hpos = 0; + EMACS_INT prev_pos; /* Previous buffer position. */ + EMACS_INT prev_pos_byte; /* Previous buffer position. */ + EMACS_INT prev_hpos = 0; + EMACS_INT prev_vpos = 0; + EMACS_INT contin_hpos; /* HPOS of last column of continued line. */ + EMACS_INT prev_tab_offset; /* Previous tab offset. */ + EMACS_INT continuation_glyph_width; XSETBUFFER (buffer, current_buffer); XSETWINDOW (window, win); @@ -1284,8 +1287,8 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width, { while (pos == next_boundary) { - int pos_here = pos; - int newpos; + EMACS_INT pos_here = pos; + EMACS_INT newpos; /* Don't skip invisible if we are already at the margin. */ if (vpos > tovpos || (vpos == tovpos && hpos >= tohpos)) @@ -1883,23 +1886,23 @@ struct position val_vmotion; struct position * vmotion (from, vtarget, w) - register int from, vtarget; + register EMACS_INT from, vtarget; struct window *w; { - int hscroll = XINT (w->hscroll); + EMACS_INT hscroll = XINT (w->hscroll); struct position pos; /* vpos is cumulative vertical position, changed as from is changed */ register int vpos = 0; - int prevline; - register int first; - int from_byte; - int lmargin = hscroll > 0 ? 1 - hscroll : 0; + EMACS_INT prevline; + register EMACS_INT first; + EMACS_INT from_byte; + EMACS_INT lmargin = hscroll > 0 ? 1 - hscroll : 0; int selective = (INTEGERP (current_buffer->selective_display) ? XINT (current_buffer->selective_display) : !NILP (current_buffer->selective_display) ? -1 : 0); Lisp_Object window; - int start_hpos = 0; + EMACS_INT start_hpos = 0; int did_motion; /* This is the object we use for fetching character properties. */ Lisp_Object text_prop_object; diff --git a/src/indent.h b/src/indent.h index 2e873769603..95cf23aaef1 100644 --- a/src/indent.h +++ b/src/indent.h @@ -39,25 +39,31 @@ Boston, MA 02110-1301, USA. */ struct position { - int bufpos; - int bytepos; - int hpos; - int vpos; - int prevhpos; - int contin; + EMACS_INT bufpos; + EMACS_INT bytepos; + EMACS_INT hpos; + EMACS_INT vpos; + EMACS_INT prevhpos; + EMACS_INT contin; /* Number of characters we have already handled from the before and after strings at this position. */ - int ovstring_chars_done; - int tab_offset; + EMACS_INT ovstring_chars_done; + EMACS_INT tab_offset; }; -struct position *compute_motion P_ ((int, int, int, int, int, int, int, - int, int, int, struct window *)); -struct position *vmotion P_ ((int, int, struct window *)); -int skip_invisible P_ ((int, int *, int, Lisp_Object)); +struct position *compute_motion P_ ((EMACS_INT from, EMACS_INT fromvpos, + EMACS_INT fromhpos, int did_motion, + EMACS_INT to, EMACS_INT tovpos, + EMACS_INT tohpos, + EMACS_INT width, EMACS_INT hscroll, + EMACS_INT tab_offset, struct window *)); +struct position *vmotion P_ ((EMACS_INT from, EMACS_INT vtarget, + struct window *)); +EMACS_INT skip_invisible P_ ((EMACS_INT pos, EMACS_INT *next_boundary_p, + EMACS_INT to, Lisp_Object window)); /* Value of point when current_column was called */ -extern int last_known_column_point; +extern EMACS_INT last_known_column_point; /* Functions for dealing with the column cache. */ diff --git a/src/insdel.c b/src/insdel.c index 059a3c47d1b..0b10534db2f 100644 --- a/src/insdel.c +++ b/src/insdel.c @@ -415,13 +415,8 @@ adjust_markers_for_insert (from, from_byte, to, to_byte, before_markers) for (m = BUF_MARKERS (current_buffer); m; m = m->next) { - /* In a single-byte buffer, a marker's two positions must be - equal. */ - if (Z == Z_BYTE) - { - if (m->charpos != m->bytepos) - abort (); - } + eassert (m->bytepos >= m->charpos + && m->bytepos - m->charpos <= Z_BYTE - Z); if (m->bytepos == from_byte) { @@ -468,9 +463,7 @@ adjust_point (nchars, nbytes) BUF_PT_BYTE (current_buffer) += nbytes; /* In a single-byte buffer, the two positions must be equal. */ - if (ZV == ZV_BYTE - && PT != PT_BYTE) - abort (); + eassert (PT_BYTE >= PT && PT_BYTE - PT <= ZV_BYTE - ZV); } /* Adjust markers for a replacement of a text at FROM (FROM_BYTE) of diff --git a/src/keyboard.c b/src/keyboard.c index d202fc4fc9a..d64091db506 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -23,13 +23,13 @@ Boston, MA 02110-1301, USA. */ #include <config.h> #include <signal.h> #include <stdio.h> +#include "lisp.h" #include "termchar.h" #include "termopts.h" -#include "lisp.h" +#include "frame.h" #include "termhooks.h" #include "macros.h" #include "keyboard.h" -#include "frame.h" #include "window.h" #include "commands.h" #include "buffer.h" @@ -59,7 +59,6 @@ Boston, MA 02110-1301, USA. */ #endif /* not MSDOS */ #include "syssignal.h" -#include "systty.h" #include <sys/types.h> #ifdef HAVE_UNISTD_H @@ -97,9 +96,6 @@ volatile int interrupt_input_blocked; int interrupt_input_pending; -/* File descriptor to use for input. */ -extern int input_fd; - #ifdef HAVE_WINDOW_SYSTEM /* Make all keyboard buffers much bigger when using X windows. */ #ifdef MAC_OS8 @@ -112,8 +108,6 @@ extern int input_fd; #define KBD_BUFFER_SIZE 4096 #endif /* No X-windows */ -#define abs(x) ((x) >= 0 ? (x) : -(x)) - /* Following definition copied from eval.c */ struct backtrace @@ -425,16 +419,6 @@ Lisp_Object Vecho_keystrokes; /* Form to evaluate (if non-nil) when Emacs is started. */ Lisp_Object Vtop_level; -/* User-supplied table to translate input characters. */ -Lisp_Object Vkeyboard_translate_table; - -/* Keymap mapping ASCII function key sequences onto their preferred forms. */ -extern Lisp_Object Vfunction_key_map; - -/* Another keymap that maps key sequences into key sequences. - This one takes precedence over ordinary definitions. */ -extern Lisp_Object Vkey_translation_map; - /* If non-nil, this implements the current input method. */ Lisp_Object Vinput_method_function; Lisp_Object Qinput_method_function; @@ -458,6 +442,12 @@ Lisp_Object Qpre_command_hook, Vpre_command_hook; Lisp_Object Qpost_command_hook, Vpost_command_hook; Lisp_Object Qcommand_hook_internal, Vcommand_hook_internal; +/* Parent keymap of terminal-local function-key-map instances. */ +Lisp_Object Vfunction_key_map; + +/* Keymap of key translations that can override keymaps. */ +Lisp_Object Vkey_translation_map; + /* List of deferred actions to be performed at a later time. The precise format isn't relevant here; we just check whether it is nil. */ Lisp_Object Vdeferred_action_list; @@ -475,11 +465,6 @@ FILE *dribble; /* Nonzero if input is available. */ int input_pending; -/* 1 if should obey 0200 bit in input chars as "Meta", 2 if should - keep 0200 bit in input chars. 0 to ignore the 0200 bit. */ - -int meta_key; - extern char *pending_malloc_warning; /* Circular buffer for pre-read keyboard input. */ @@ -609,9 +594,6 @@ int interrupt_input; /* Nonzero while interrupts are temporarily deferred during redisplay. */ int interrupts_deferred; -/* Nonzero means use ^S/^Q for flow control. */ -int flow_control; - /* Allow m- file to inhibit use of FIONREAD. */ #ifdef BROKEN_FIONREAD #undef FIONREAD @@ -694,8 +676,11 @@ static void save_getcjmp (); static void restore_getcjmp P_ ((jmp_buf)); static Lisp_Object apply_modifiers P_ ((int, Lisp_Object)); static void clear_event P_ ((struct input_event *)); -static void any_kboard_state P_ ((void)); +#ifdef MULTI_KBOARD +static Lisp_Object restore_kboard_configuration P_ ((Lisp_Object)); +#endif static SIGTYPE interrupt_signal P_ ((int signalnum)); +static void handle_interrupt P_ ((void)); static void timer_start_idle P_ ((void)); static void timer_stop_idle P_ ((void)); static void timer_resume_idle P_ ((void)); @@ -1061,24 +1046,20 @@ This function is called by the editor initialization to begin editing. */) like it is done in the splash screen display, we have to make sure that we restore single_kboard as command_loop_1 would have done if it were left normally. */ - record_unwind_protect (recursive_edit_unwind, - Fcons (buffer, single_kboard ? Qt : Qnil)); + if (command_loop_level > 0) + temporarily_switch_to_single_kboard (SELECTED_FRAME ()); + record_unwind_protect (recursive_edit_unwind, buffer); recursive_edit_1 (); return unbind_to (count, Qnil); } Lisp_Object -recursive_edit_unwind (info) - Lisp_Object info; +recursive_edit_unwind (buffer) + Lisp_Object buffer; { - if (BUFFERP (XCAR (info))) - Fset_buffer (XCAR (info)); - - if (NILP (XCDR (info))) - any_kboard_state (); - else - single_kboard_state (); + if (BUFFERP (buffer)) + Fset_buffer (buffer); command_loop_level--; update_mode_lines = 1; @@ -1086,6 +1067,8 @@ recursive_edit_unwind (info) } +#if 0 /* These two functions are now replaced with + temporarily_switch_to_single_kboard. */ static void any_kboard_state () { @@ -1116,6 +1099,7 @@ single_kboard_state () single_kboard = 1; #endif } +#endif /* If we're in single_kboard state for kboard KBOARD, get out of it. */ @@ -1143,8 +1127,8 @@ struct kboard_stack static struct kboard_stack *kboard_stack; void -push_frame_kboard (f) - FRAME_PTR f; +push_kboard (k) + struct kboard *k; { #ifdef MULTI_KBOARD struct kboard_stack *p @@ -1154,20 +1138,110 @@ push_frame_kboard (f) p->kboard = current_kboard; kboard_stack = p; - current_kboard = FRAME_KBOARD (f); + current_kboard = k; #endif } void -pop_frame_kboard () +pop_kboard () { #ifdef MULTI_KBOARD + struct terminal *t; struct kboard_stack *p = kboard_stack; - current_kboard = p->kboard; + int found = 0; + for (t = terminal_list; t; t = t->next_terminal) + { + if (t->kboard == p->kboard) + { + current_kboard = p->kboard; + found = 1; + break; + } + } + if (!found) + { + /* The terminal we remembered has been deleted. */ + current_kboard = FRAME_KBOARD (SELECTED_FRAME ()); + single_kboard = 0; + } kboard_stack = p->next; xfree (p); #endif } + +/* Switch to single_kboard mode, making current_kboard the only KBOARD + from which further input is accepted. If F is non-nil, set its + KBOARD as the current keyboard. + + This function uses record_unwind_protect to return to the previous + state later. + + If Emacs is already in single_kboard mode, and F's keyboard is + locked, then this function will throw an errow. */ + +void +temporarily_switch_to_single_kboard (f) + struct frame *f; +{ +#ifdef MULTI_KBOARD + int was_locked = single_kboard; + if (was_locked) + { + if (f != NULL && FRAME_KBOARD (f) != current_kboard) + /* We can not switch keyboards while in single_kboard mode. + In rare cases, Lisp code may call `recursive-edit' (or + `read-minibuffer' or `y-or-n-p') after it switched to a + locked frame. For example, this is likely to happen + when server.el connects to a new terminal while Emacs is in + single_kboard mode. It is best to throw an error instead + of presenting the user with a frozen screen. */ + error ("Terminal %d is locked, cannot read from it", + FRAME_TERMINAL (f)->id); + else + /* This call is unnecessary, but helps + `restore_kboard_configuration' discover if somebody changed + `current_kboard' behind our back. */ + push_kboard (current_kboard); + } + else if (f != NULL) + current_kboard = FRAME_KBOARD (f); + single_kboard = 1; + record_unwind_protect (restore_kboard_configuration, + (was_locked ? Qt : Qnil)); +#endif +} + +#if 0 /* This function is not needed anymore. */ +void +record_single_kboard_state () +{ + if (single_kboard) + push_kboard (current_kboard); + record_unwind_protect (restore_kboard_configuration, + (single_kboard ? Qt : Qnil)); +} +#endif + +#ifdef MULTI_KBOARD +static Lisp_Object +restore_kboard_configuration (was_locked) + Lisp_Object was_locked; +{ + if (NILP (was_locked)) + single_kboard = 0; + else + { + struct kboard *prev = current_kboard; + single_kboard = 1; + pop_kboard (); + /* The pop should not change the kboard. */ + if (single_kboard && current_kboard != prev) + abort (); + } + return Qnil; +} +#endif + /* Handle errors that are not handled at inner levels by printing an error message and returning to the editor command loop. */ @@ -1215,10 +1289,12 @@ cmd_error (data) Vquit_flag = Qnil; Vinhibit_quit = Qnil; +#if 0 /* This shouldn't be necessary anymore. --lorentey */ #ifdef MULTI_KBOARD if (command_loop_level == 0 && minibuf_level == 0) any_kboard_state (); #endif +#endif return make_number (0); } @@ -1254,11 +1330,7 @@ cmd_error_internal (data, context) /* If the window system or terminal frame hasn't been initialized yet, or we're not interactive, write the message to stderr and exit. */ else if (!sf->glyphs_initialized_p - /* This is the case of the frame dumped with Emacs, when we're - running under a window system. */ - || (!NILP (Vwindow_system) - && !inhibit_window_system - && FRAME_TERMCAP_P (sf)) + || FRAME_INITIAL_P (sf) || noninteractive) { print_error_message (data, Qexternal_debugging_output, @@ -1301,10 +1373,12 @@ command_loop () while (1) { internal_catch (Qtop_level, top_level_1, Qnil); - /* Reset single_kboard in case top-level set it while - evaluating an -f option, or we are stuck there for some - other reason. */ - any_kboard_state (); +#if 0 /* This shouldn't be necessary anymore. --lorentey */ + /* Reset single_kboard in case top-level set it while + evaluating an -f option, or we are stuck there for some + other reason. */ + any_kboard_state (); +#endif internal_catch (Qtop_level, command_loop_2, Qnil); executing_kbd_macro = Qnil; @@ -1499,10 +1573,12 @@ command_loop_1 () int no_direct; int prev_modiff = 0; struct buffer *prev_buffer = NULL; +#if 0 /* This shouldn't be necessary anymore. --lorentey */ #ifdef MULTI_KBOARD int was_locked = single_kboard; #endif - int already_adjusted; +#endif + int already_adjusted = 0; current_kboard->Vprefix_arg = Qnil; current_kboard->Vlast_prefix_arg = Qnil; @@ -1536,6 +1612,8 @@ command_loop_1 () /* Do this after running Vpost_command_hook, for consistency. */ current_kboard->Vlast_command = Vthis_command; current_kboard->Vreal_last_command = real_this_command; + if (!CONSP (last_command_char)) + current_kboard->Vlast_repeatable_command = real_this_command; while (1) { @@ -1587,11 +1665,6 @@ command_loop_1 () } } -#ifdef C_ALLOCA - alloca (0); /* Cause a garbage collection now */ - /* Since we can free the most stuff here. */ -#endif /* C_ALLOCA */ - #if 0 /* Select the frame that the last event came from. Usually, switch-frame events will take care of this, but if some lisp @@ -1916,6 +1989,8 @@ command_loop_1 () { current_kboard->Vlast_command = Vthis_command; current_kboard->Vreal_last_command = real_this_command; + if (!CONSP (last_command_char)) + current_kboard->Vlast_repeatable_command = real_this_command; cancel_echoing (); this_command_key_count = 0; this_command_key_count_reset = 0; @@ -1961,10 +2036,11 @@ command_loop_1 () if (!NILP (current_kboard->defining_kbd_macro) && NILP (current_kboard->Vprefix_arg)) finalize_kbd_macro_chars (); - +#if 0 /* This shouldn't be necessary anymore. --lorentey */ #ifdef MULTI_KBOARD if (!was_locked) - any_kboard_state (); + any_kboard_state (); +#endif #endif } } @@ -2203,7 +2279,10 @@ void start_polling () { #ifdef POLL_FOR_INPUT - if (read_socket_hook && !interrupt_input) + /* XXX This condition was (read_socket_hook && !interrupt_input), + but read_socket_hook is not global anymore. Let's pretend that + it's always set. */ + if (!interrupt_input) { /* Turn alarm handling on unconditionally. It might have been turned off in process.c. */ @@ -2237,7 +2316,10 @@ int input_polling_used () { #ifdef POLL_FOR_INPUT - return read_socket_hook && !interrupt_input; + /* XXX This condition was (read_socket_hook && !interrupt_input), + but read_socket_hook is not global anymore. Let's pretend that + it's always set. */ + return !interrupt_input; #else return 0; #endif @@ -2249,7 +2331,10 @@ void stop_polling () { #ifdef POLL_FOR_INPUT - if (read_socket_hook && !interrupt_input) + /* XXX This condition was (read_socket_hook && !interrupt_input), + but read_socket_hook is not global anymore. Let's pretend that + it's always set. */ + if (!interrupt_input) ++poll_suppress_count; #endif } @@ -2461,10 +2546,6 @@ read_char_help_form_unwind (arg) return Qnil; } -#ifdef MULTI_KBOARD -static jmp_buf wrong_kboard_jmpbuf; -#endif - #define STOP_POLLING \ do { if (! polling_stopped_here) stop_polling (); \ polling_stopped_here = 1; } while (0) @@ -2491,6 +2572,9 @@ do { if (polling_stopped_here) start_polling (); \ if we used a mouse menu to read the input, or zero otherwise. If USED_MOUSE_MENU is null, we don't dereference it. + Value is -2 when we find input on another keyboard. A second call + to read_char will read it. + If END_TIME is non-null, it is a pointer to an EMACS_TIME specifying the maximum time to wait until. If no input arrives by that time, stop waiting and return nil. @@ -2517,6 +2601,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) volatile int reread; struct gcpro gcpro1, gcpro2; int polling_stopped_here = 0; + struct kboard *orig_kboard = current_kboard; also_record = Qnil; @@ -2731,6 +2816,10 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) && !detect_input_pending_run_timers (0)) { c = read_char_minibuf_menu_prompt (commandflag, nmaps, maps); + + if (INTEGERP (c) && XINT (c) == -2) + return c; /* wrong_kboard_jmpbuf */ + if (! NILP (c)) { key_already_recorded = 1; @@ -2747,6 +2836,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) jmpcount = SPECPDL_INDEX (); if (_setjmp (local_getcjmp)) { + /* Handle quits while reading the keyboard. */ /* We must have saved the outer value of getcjmp here, so restore it now. */ restore_getcjmp (save_jump); @@ -2784,7 +2874,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) /* This is going to exit from read_char so we had better get rid of this frame's stuff. */ UNGCPRO; - longjmp (wrong_kboard_jmpbuf, 1); + return make_number (-2); /* wrong_kboard_jmpbuf */ } } #endif @@ -2921,6 +3011,19 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) } } + /* Notify the caller if an autosave hook, or a timer, sentinel or + filter in the sit_for calls above have changed the current + kboard. This could happen if they use the minibuffer or start a + recursive edit, like the fancy splash screen in server.el's + filter. If this longjmp wasn't here, read_key_sequence would + interpret the next key sequence using the wrong translation + tables and function keymaps. */ + if (NILP (c) && current_kboard != orig_kboard) + { + UNGCPRO; + return make_number (-2); /* wrong_kboard_jmpbuf */ + } + /* If this has become non-nil here, it has been set by a timer or sentinel or filter. */ if (CONSP (Vunread_command_events)) @@ -2969,7 +3072,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) /* This is going to exit from read_char so we had better get rid of this frame's stuff. */ UNGCPRO; - longjmp (wrong_kboard_jmpbuf, 1); + return make_number (-2); /* wrong_kboard_jmpbuf */ } } #endif @@ -3025,7 +3128,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) /* This is going to exit from read_char so we had better get rid of this frame's stuff. */ UNGCPRO; - longjmp (wrong_kboard_jmpbuf, 1); + return make_number (-2); } #endif } @@ -3080,8 +3183,12 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) if (!NILP (tem)) { +#if 0 /* This shouldn't be necessary anymore. --lorentey */ int was_locked = single_kboard; - + int count = SPECPDL_INDEX (); + record_single_kboard_state (); +#endif + last_input_char = c; Fcommand_execute (tem, Qnil, Fvector (1, &last_input_char), Qt); @@ -3092,9 +3199,12 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) example banishing the mouse under mouse-avoidance-mode. */ timer_resume_idle (); +#if 0 /* This shouldn't be necessary anymore. --lorentey */ /* Resume allowing input from any kboard, if that was true before. */ if (!was_locked) any_kboard_state (); + unbind_to (count, Qnil); +#endif goto retry; } @@ -3106,15 +3216,15 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) if (XINT (c) == -1) goto exit; - if ((STRINGP (Vkeyboard_translate_table) - && SCHARS (Vkeyboard_translate_table) > (unsigned) XFASTINT (c)) - || (VECTORP (Vkeyboard_translate_table) - && XVECTOR (Vkeyboard_translate_table)->size > (unsigned) XFASTINT (c)) - || (CHAR_TABLE_P (Vkeyboard_translate_table) + if ((STRINGP (current_kboard->Vkeyboard_translate_table) + && SCHARS (current_kboard->Vkeyboard_translate_table) > (unsigned) XFASTINT (c)) + || (VECTORP (current_kboard->Vkeyboard_translate_table) + && XVECTOR (current_kboard->Vkeyboard_translate_table)->size > (unsigned) XFASTINT (c)) + || (CHAR_TABLE_P (current_kboard->Vkeyboard_translate_table) && CHARACTERP (c))) { Lisp_Object d; - d = Faref (Vkeyboard_translate_table, c); + d = Faref (current_kboard->Vkeyboard_translate_table, c); /* nil in keyboard-translate-table means no translation. */ if (!NILP (d)) c = d; @@ -3734,12 +3844,10 @@ kbd_buffer_store_event_hold (event, hold_quit) if (c == quit_char) { #ifdef MULTI_KBOARD - KBOARD *kb; + KBOARD *kb = FRAME_KBOARD (XFRAME (event->frame_or_window)); struct input_event *sp; - if (single_kboard - && (kb = FRAME_KBOARD (XFRAME (event->frame_or_window)), - kb != current_kboard)) + if (single_kboard && kb != current_kboard) { kb->kbd_queue = Fcons (make_lispy_switch_frame (event->frame_or_window), @@ -3782,7 +3890,7 @@ kbd_buffer_store_event_hold (event, hold_quit) } last_event_timestamp = event->timestamp; - interrupt_signal (0 /* dummy */); + handle_interrupt (); return; } @@ -3915,6 +4023,7 @@ discard_mouse_events () if (sp->kind == MOUSE_CLICK_EVENT || sp->kind == WHEEL_EVENT + || sp->kind == HORIZ_WHEEL_EVENT #ifdef WINDOWSNT || sp->kind == W32_SCROLL_BAR_CLICK_EVENT #endif @@ -3993,6 +4102,12 @@ kbd_buffer_get_event (kbp, used_mouse_menu, end_time) /* Wait until there is input available. */ for (;;) { + /* Break loop if there's an unread command event. Needed in + moused window autoselection which uses a timer to insert such + events. */ + if (CONSP (Vunread_command_events)) + break; + if (kbd_fetch_ptr != kbd_store_ptr) break; #if defined (HAVE_MOUSE) || defined (HAVE_GPM) @@ -4264,11 +4379,15 @@ kbd_buffer_get_event (kbp, used_mouse_menu, end_time) unsigned long time; *kbp = current_kboard; - /* Note that this uses F to determine which display to look at. + /* Note that this uses F to determine which terminal to look at. If there is no valid info, it does not store anything so x remains nil. */ x = Qnil; - (*mouse_position_hook) (&f, 0, &bar_window, &part, &x, &y, &time); + + /* XXX Can f or mouse_position_hook be NULL here? */ + if (f && FRAME_TERMINAL (f)->mouse_position_hook) + (*FRAME_TERMINAL (f)->mouse_position_hook) (&f, 0, &bar_window, + &part, &x, &y, &time); obj = Qnil; @@ -4565,10 +4684,14 @@ timer_check (do_it_now) { if (NILP (vector[0])) { - int was_locked = single_kboard; int count = SPECPDL_INDEX (); Lisp_Object old_deactivate_mark = Vdeactivate_mark; +#if 0 /* This shouldn't be necessary anymore. --lorentey */ + /* On unbind_to, resume allowing input from any kboard, if that + was true before. */ + record_single_kboard_state (); +#endif /* Mark the timer as triggered to prevent problems if the lisp code fails to reschedule it right. */ vector[0] = Qt; @@ -4580,10 +4703,6 @@ timer_check (do_it_now) timers_run++; unbind_to (count, Qnil); - /* Resume allowing input from any kboard, if that was true before. */ - if (!was_locked) - any_kboard_state (); - /* Since we have handled the event, we don't need to tell the caller to wake up and do it. */ } @@ -5089,7 +5208,7 @@ Lisp_Object Vlispy_mouse_stem; static char *lispy_wheel_names[] = { - "wheel-up", "wheel-down" + "wheel-up", "wheel-down", "wheel-left", "wheel-right" }; /* drag-n-drop events are generated when a set of selected files are @@ -5726,6 +5845,7 @@ make_lispy_event (event) } case WHEEL_EVENT: + case HORIZ_WHEEL_EVENT: { Lisp_Object position; Lisp_Object head; @@ -5810,6 +5930,9 @@ make_lispy_event (event) the up_modifier set. */ abort (); + if (event->kind == HORIZ_WHEEL_EVENT) + symbol_num += 2; + /* Get the symbol we should use for the wheel event. */ head = modify_event_symbol (symbol_num, event->modifiers, @@ -6544,8 +6667,8 @@ modify_event_symbol (symbol_num, modifiers, symbol_kind, name_alist_or_stem, { int len = SBYTES (name_alist_or_stem); char *buf = (char *) alloca (len + 50); - sprintf (buf, "%s-%ld", SDATA (name_alist_or_stem), - (long) XINT (symbol_int) + 1); + sprintf (buf, "%s-%ld", SDATA (name_alist_or_stem), + (long) XINT (symbol_int) + 1); value = intern (buf); } else if (name_table != 0 && name_table[symbol_num]) @@ -6810,7 +6933,10 @@ gobble_input (expected) } else #ifdef POLL_FOR_INPUT - if (read_socket_hook && !interrupt_input && poll_suppress_count == 0) + /* XXX This condition was (read_socket_hook && !interrupt_input), + but read_socket_hook is not global anymore. Let's pretend that + it's always set. */ + if (!interrupt_input && poll_suppress_count == 0) { SIGMASKTYPE mask; mask = sigblock (sigmask (SIGALRM)); @@ -6887,170 +7013,241 @@ static int read_avail_input (expected) int expected; { - register int i; int nread = 0; + int err = 0; + struct terminal *t; /* Store pending user signal events, if any. */ if (store_user_signal_events ()) expected = 0; - if (read_socket_hook) + /* Loop through the available terminals, and call their input hooks. */ + t = terminal_list; + while (t) { - int nr; - struct input_event hold_quit; + struct terminal *next = t->next_terminal; - EVENT_INIT (hold_quit); - hold_quit.kind = NO_EVENT; + if (t->read_socket_hook) + { + int nr; + struct input_event hold_quit; + + EVENT_INIT (hold_quit); + hold_quit.kind = NO_EVENT; + + /* No need for FIONREAD or fcntl; just say don't wait. */ + while (nr = (*t->read_socket_hook) (t, expected, &hold_quit), nr > 0) + { + nread += nr; + expected = 0; + } + + if (nr == -1) /* Not OK to read input now. */ + { + err = 1; + } + else if (nr == -2) /* Non-transient error. */ + { + /* The terminal device terminated; it should be closed. */ + + /* Kill Emacs if this was our last terminal. */ + if (!terminal_list->next_terminal) + /* Formerly simply reported no input, but that + sometimes led to a failure of Emacs to terminate. + SIGHUP seems appropriate if we can't reach the + terminal. */ + /* ??? Is it really right to send the signal just to + this process rather than to the whole process + group? Perhaps on systems with FIONREAD Emacs is + alone in its group. */ + kill (getpid (), SIGHUP); + + /* XXX Is calling delete_terminal safe here? It calls Fdelete_frame. */ + if (t->delete_terminal_hook) + (*t->delete_terminal_hook) (t); + else + delete_terminal (t); + } + + if (hold_quit.kind != NO_EVENT) + kbd_buffer_store_event (&hold_quit); + } - /* No need for FIONREAD or fcntl; just say don't wait. */ - while (nr = (*read_socket_hook) (input_fd, expected, &hold_quit), nr > 0) - { - nread += nr; - expected = 0; - } - if (hold_quit.kind != NO_EVENT) - kbd_buffer_store_event (&hold_quit); + t = next; } - else - { - /* Using KBD_BUFFER_SIZE - 1 here avoids reading more than - the kbd_buffer can really hold. That may prevent loss - of characters on some systems when input is stuffed at us. */ - unsigned char cbuf[KBD_BUFFER_SIZE - 1]; - int n_to_read; - /* Determine how many characters we should *try* to read. */ + if (err && !nread) + nread = -1; + + return nread; +} + +/* This is the tty way of reading available input. + + Note that each terminal device has its own `struct terminal' object, + and so this function is called once for each individual termcap + terminal. The first parameter indicates which terminal to read from. */ + +int +tty_read_avail_input (struct terminal *terminal, + int expected, + struct input_event *hold_quit) +{ + /* Using KBD_BUFFER_SIZE - 1 here avoids reading more than + the kbd_buffer can really hold. That may prevent loss + of characters on some systems when input is stuffed at us. */ + unsigned char cbuf[KBD_BUFFER_SIZE - 1]; + int n_to_read, i; + struct tty_display_info *tty = terminal->display_info.tty; + int nread = 0; + + if (!terminal->name) /* Don't read from a dead terminal. */ + return; + + if (terminal->type != output_termcap) + abort (); + + /* XXX I think the following code should be moved to separate hook + functions in system-dependent files. */ #ifdef WINDOWSNT - return 0; + return 0; #else /* not WINDOWSNT */ #ifdef MSDOS - n_to_read = dos_keysns (); - if (n_to_read == 0) - return 0; + n_to_read = dos_keysns (); + if (n_to_read == 0) + return 0; + + cbuf[0] = dos_keyread (); + nread = 1; + #else /* not MSDOS */ + + if (! tty->term_initted) /* In case we get called during bootstrap. */ + return 0; + + if (! tty->input) + return 0; /* The terminal is suspended. */ + #ifdef HAVE_GPM - if (term_gpm) - { - Gpm_Event event; - struct input_event hold_quit; - int gpm; + if (gpm_tty == tty) + { + Gpm_Event event; + struct input_event hold_quit; + int gpm; - EVENT_INIT (hold_quit); - hold_quit.kind = NO_EVENT; + EVENT_INIT (hold_quit); + hold_quit.kind = NO_EVENT; - while (gpm = Gpm_GetEvent (&event), gpm == 1) { - nread += handle_one_term_event (&event, &hold_quit); - } - if (hold_quit.kind != NO_EVENT) - kbd_buffer_store_event (&hold_quit); - if (nread) - return nread; - } + while (gpm = Gpm_GetEvent (&event), gpm == 1) { + nread += handle_one_term_event (tty, &event, &hold_quit); + } + if (hold_quit.kind != NO_EVENT) + kbd_buffer_store_event (&hold_quit); + if (nread) + return nread; + } #endif /* HAVE_GPM */ -#ifdef FIONREAD - /* Find out how much input is available. */ - if (ioctl (input_fd, FIONREAD, &n_to_read) < 0) - /* Formerly simply reported no input, but that sometimes led to - a failure of Emacs to terminate. - SIGHUP seems appropriate if we can't reach the terminal. */ - /* ??? Is it really right to send the signal just to this process - rather than to the whole process group? - Perhaps on systems with FIONREAD Emacs is alone in its group. */ - { - if (! noninteractive) - kill (getpid (), SIGHUP); - else - n_to_read = 0; - } - if (n_to_read == 0) - return 0; - if (n_to_read > sizeof cbuf) - n_to_read = sizeof cbuf; +/* Determine how many characters we should *try* to read. */ +#ifdef FIONREAD + /* Find out how much input is available. */ + if (ioctl (fileno (tty->input), FIONREAD, &n_to_read) < 0) + { + if (! noninteractive) + return -2; /* Close this terminal. */ + else + n_to_read = 0; + } + if (n_to_read == 0) + return 0; + if (n_to_read > sizeof cbuf) + n_to_read = sizeof cbuf; #else /* no FIONREAD */ #if defined (USG) || defined (DGUX) || defined(CYGWIN) - /* Read some input if available, but don't wait. */ - n_to_read = sizeof cbuf; - fcntl (input_fd, F_SETFL, O_NDELAY); + /* Read some input if available, but don't wait. */ + n_to_read = sizeof cbuf; + fcntl (fileno (tty->input), F_SETFL, O_NDELAY); #else - you lose; + you lose; #endif #endif -#endif /* not MSDOS */ -#endif /* not WINDOWSNT */ - /* Now read; for one reason or another, this will not block. - NREAD is set to the number of chars read. */ - do - { -#ifdef MSDOS - cbuf[0] = dos_keyread (); - nread = 1; -#else - nread = emacs_read (input_fd, cbuf, n_to_read); -#endif - /* POSIX infers that processes which are not in the session leader's - process group won't get SIGHUP's at logout time. BSDI adheres to - this part standard and returns -1 from read (0) with errno==EIO - when the control tty is taken away. - Jeffrey Honig <jch@bsdi.com> says this is generally safe. */ - if (nread == -1 && errno == EIO) - kill (0, SIGHUP); + /* Now read; for one reason or another, this will not block. + NREAD is set to the number of chars read. */ + do + { + nread = emacs_read (fileno (tty->input), cbuf, n_to_read); + /* POSIX infers that processes which are not in the session leader's + process group won't get SIGHUP's at logout time. BSDI adheres to + this part standard and returns -1 from read (0) with errno==EIO + when the control tty is taken away. + Jeffrey Honig <jch@bsdi.com> says this is generally safe. */ + if (nread == -1 && errno == EIO) + return -2; /* Close this terminal. */ #if defined (AIX) && (! defined (aix386) && defined (_BSD)) - /* The kernel sometimes fails to deliver SIGHUP for ptys. - This looks incorrect, but it isn't, because _BSD causes - O_NDELAY to be defined in fcntl.h as O_NONBLOCK, - and that causes a value other than 0 when there is no input. */ - if (nread == 0) - kill (0, SIGHUP); -#endif - } - while ( - /* We used to retry the read if it was interrupted. - But this does the wrong thing when O_NDELAY causes - an EAGAIN error. Does anybody know of a situation - where a retry is actually needed? */ + /* The kernel sometimes fails to deliver SIGHUP for ptys. + This looks incorrect, but it isn't, because _BSD causes + O_NDELAY to be defined in fcntl.h as O_NONBLOCK, + and that causes a value other than 0 when there is no input. */ + if (nread == 0) + return -2; /* Close this terminal. */ +#endif + } + while ( + /* We used to retry the read if it was interrupted. + But this does the wrong thing when O_NDELAY causes + an EAGAIN error. Does anybody know of a situation + where a retry is actually needed? */ #if 0 - nread < 0 && (errno == EAGAIN + nread < 0 && (errno == EAGAIN #ifdef EFAULT - || errno == EFAULT + || errno == EFAULT #endif #ifdef EBADSLT - || errno == EBADSLT + || errno == EBADSLT #endif - ) + ) #else - 0 + 0 #endif - ); + ); #ifndef FIONREAD #if defined (USG) || defined (DGUX) || defined (CYGWIN) - fcntl (input_fd, F_SETFL, 0); + fcntl (fileno (tty->input), F_SETFL, 0); #endif /* USG or DGUX or CYGWIN */ #endif /* no FIONREAD */ - for (i = 0; i < nread; i++) - { - struct input_event buf; - EVENT_INIT (buf); - buf.kind = ASCII_KEYSTROKE_EVENT; - buf.modifiers = 0; - if (meta_key == 1 && (cbuf[i] & 0x80)) - buf.modifiers = meta_modifier; - if (meta_key != 2) - cbuf[i] &= ~0x80; - - buf.code = cbuf[i]; - buf.frame_or_window = selected_frame; - buf.arg = Qnil; - - kbd_buffer_store_event (&buf); - /* Don't look at input that follows a C-g too closely. - This reduces lossage due to autorepeat on C-g. */ - if (buf.kind == ASCII_KEYSTROKE_EVENT - && buf.code == quit_char) - break; - } + + if (nread <= 0) + return nread; + +#endif /* not MSDOS */ +#endif /* not WINDOWSNT */ + + for (i = 0; i < nread; i++) + { + struct input_event buf; + EVENT_INIT (buf); + buf.kind = ASCII_KEYSTROKE_EVENT; + buf.modifiers = 0; + if (tty->meta_key == 1 && (cbuf[i] & 0x80)) + buf.modifiers = meta_modifier; + if (tty->meta_key != 2) + cbuf[i] &= ~0x80; + + buf.code = cbuf[i]; + /* Set the frame corresponding to the active tty. Note that the + value of selected_frame is not reliable here, redisplay tends + to temporarily change it. */ + buf.frame_or_window = tty->top_frame; + buf.arg = Qnil; + + kbd_buffer_store_event (&buf); + /* Don't look at input that follows a C-g too closely. + This reduces lossage due to autorepeat on C-g. */ + if (buf.kind == ASCII_KEYSTROKE_EVENT + && buf.code == quit_char) + break; } return nread; @@ -8632,6 +8829,8 @@ read_char_minibuf_menu_prompt (commandflag, nmaps, maps) if (!INTEGERP (obj)) return obj; + else if (XINT (obj) == -2) + return obj; else ch = XINT (obj); @@ -8942,8 +9141,8 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, key's again in Vfunction_key_map. */ volatile keyremap fkey; - /* Likewise, for key_translation_map. */ - volatile keyremap keytran; + /* Likewise, for key_translation_map and input-decode-map. */ + volatile keyremap keytran, indec; /* If we receive a `switch-frame' or `select-window' event in the middle of a key sequence, we put it off for later. @@ -8978,11 +9177,7 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, last_nonmenu_event = Qnil; delayed_switch_frame = Qnil; - fkey.map = fkey.parent = Vfunction_key_map; - keytran.map = keytran.parent = Vkey_translation_map; - fkey.start = fkey.end = 0; - keytran.start = keytran.end = 0; - + if (INTERACTIVE) { if (!NILP (prompt)) @@ -9022,6 +9217,15 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, keybuf[0..mock_input] holds the sequence we should reread. */ replay_sequence: + /* We may switch keyboards between rescans, so we need to + reinitialize fkey and keytran before each replay. */ + indec.map = indec.parent = current_kboard->Vinput_decode_map; + fkey.map = fkey.parent = current_kboard->Vlocal_function_key_map; + keytran.map = keytran.parent = Vkey_translation_map; + indec.start = indec.end = 0; + fkey.start = fkey.end = 0; + keytran.start = keytran.end = 0; + starting_buffer = current_buffer; first_unbound = bufsize + 1; @@ -9107,7 +9311,7 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, Thus, if ESC O a has a function-key-map translation and ESC o has a binding, don't return after ESC O, so that we can translate ESC O plus the next character. */ - : (fkey.start < t || keytran.start < t)) + : (/* indec.start < t || fkey.start < t || */ keytran.start < t)) { Lisp_Object key; int used_mouse_menu = 0; @@ -9125,13 +9329,17 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, just one key. */ volatile int echo_local_start, keys_local_start, local_first_binding; - eassert (fkey.end == t || (fkey.end > t && fkey.end <= mock_input)); + eassert (indec.end == t || (indec.end > t && indec.end <= mock_input)); + eassert (indec.start <= indec.end); eassert (fkey.start <= fkey.end); eassert (keytran.start <= keytran.end); - /* key-translation-map is applied *after* function-key-map. */ + /* key-translation-map is applied *after* function-key-map + which is itself applied *after* input-decode-map. */ + eassert (fkey.end <= indec.start); eassert (keytran.end <= fkey.start); - if (first_unbound < fkey.start && first_unbound < keytran.start) + if (/* first_unbound < indec.start && first_unbound < fkey.start && */ + first_unbound < keytran.start) { /* The prefix upto first_unbound has no binding and has no translation left to do either, so we know it's unbound. If we don't stop now, we risk staying here indefinitely @@ -9141,6 +9349,8 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, for (i = first_unbound + 1; i < t; i++) keybuf[i - first_unbound - 1] = keybuf[i]; mock_input = t - first_unbound - 1; + indec.end = indec.start -= first_unbound + 1; + indec.map = indec.parent; fkey.end = fkey.start -= first_unbound + 1; fkey.map = fkey.parent; keytran.end = keytran.start -= first_unbound + 1; @@ -9186,8 +9396,28 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, #ifdef MULTI_KBOARD KBOARD *interrupted_kboard = current_kboard; struct frame *interrupted_frame = SELECTED_FRAME (); - if (setjmp (wrong_kboard_jmpbuf)) +#endif + key = read_char (NILP (prompt), nmaps, + (Lisp_Object *) submaps, last_nonmenu_event, + &used_mouse_menu, NULL); +#ifdef MULTI_KBOARD + if (INTEGERP (key) && XINT (key) == -2) /* wrong_kboard_jmpbuf */ { + int found = 0; + struct kboard *k; + + for (k = all_kboards; k; k = k->next_kboard) + if (k == interrupted_kboard) + found = 1; + + if (!found) + { + /* Don't touch interrupted_kboard when it's been + deleted. */ + delayed_switch_frame = Qnil; + goto replay_sequence; + } + if (!NILP (delayed_switch_frame)) { interrupted_kboard->kbd_queue @@ -9195,6 +9425,7 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, interrupted_kboard->kbd_queue); delayed_switch_frame = Qnil; } + while (t > 0) interrupted_kboard->kbd_queue = Fcons (keybuf[--t], interrupted_kboard->kbd_queue); @@ -9219,9 +9450,6 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, goto replay_sequence; } #endif - key = read_char (NILP (prompt), nmaps, - (Lisp_Object *) submaps, last_nonmenu_event, - &used_mouse_menu, NULL); } /* read_char returns t when it shows a menu and the user rejects it. @@ -9548,15 +9776,15 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, /* This is needed for the following scenario: event 0: a down-event that gets dropped by calling replay_key. event 1: some normal prefix like C-h. - After event 0, first_unbound is 0, after event 1 fkey.start - and keytran.start are both 1, so when we see that C-h is bound, - we need to update first_unbound. */ + After event 0, first_unbound is 0, after event 1 indec.start, + fkey.start, and keytran.start are all 1, so when we see that + C-h is bound, we need to update first_unbound. */ first_unbound = max (t + 1, first_unbound); else { Lisp_Object head; - /* Remember the position to put an upper bound on fkey.start. */ + /* Remember the position to put an upper bound on indec.start. */ first_unbound = min (t, first_unbound); head = EVENT_HEAD (key); @@ -9641,21 +9869,27 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, /* If mock_input > t + 1, the above simplification will actually end up dropping keys on the floor. This is probably OK for now, but even - if mock_input <= t + 1, we need to adjust fkey - and keytran. + if mock_input <= t + 1, we need to adjust indec, + fkey, and keytran. Typical case [header-line down-mouse-N]: mock_input = 2, t = 1, fkey.end = 1, last_real_key_start = 0. */ - if (fkey.end > last_real_key_start) + if (indec.end > last_real_key_start) { - fkey.end = fkey.start - = min (last_real_key_start, fkey.start); - fkey.map = fkey.parent; - if (keytran.end > last_real_key_start) + indec.end = indec.start + = min (last_real_key_start, indec.start); + indec.map = indec.parent; + if (fkey.end > last_real_key_start) { - keytran.end = keytran.start - = min (last_real_key_start, keytran.start); - keytran.map = keytran.parent; + fkey.end = fkey.start + = min (last_real_key_start, fkey.start); + fkey.map = fkey.parent; + if (keytran.end > last_real_key_start) + { + keytran.end = keytran.start + = min (last_real_key_start, keytran.start); + keytran.map = keytran.parent; + } } } if (t == last_real_key_start) @@ -9709,8 +9943,28 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, /* Record what part of this_command_keys is the current key sequence. */ this_single_command_key_start = this_command_key_count - t; - if (first_binding < nmaps && NILP (submaps[first_binding])) + /* Look for this sequence in input-decode-map. + Scan from indec.end until we find a bound suffix. */ + while (indec.end < t) + { + struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; + int done, diff; + + GCPRO4 (indec.map, fkey.map, keytran.map, delayed_switch_frame); + done = keyremap_step (keybuf, bufsize, &indec, max (t, mock_input), + 1, &diff, prompt); + UNGCPRO; + if (done) + { + mock_input = diff + max (t, mock_input); + goto replay_sequence; + } + } + + if (first_binding < nmaps && NILP (submaps[first_binding]) + && indec.start >= t) /* There is a binding and it's not a prefix. + (and it doesn't have any input-decode-map translation pending). There is thus no function-key in this sequence. Moving fkey.start is important in this case to allow keytran.start to go over the sequence before we return (since we keep the @@ -9723,12 +9977,12 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, /* If the sequence is unbound, see if we can hang a function key off the end of it. */ /* Continue scan from fkey.end until we find a bound suffix. */ - while (fkey.end < t) + while (fkey.end < indec.start) { - struct gcpro gcpro1, gcpro2, gcpro3; + struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; int done, diff; - GCPRO3 (fkey.map, keytran.map, delayed_switch_frame); + GCPRO4 (indec.map, fkey.map, keytran.map, delayed_switch_frame); done = keyremap_step (keybuf, bufsize, &fkey, max (t, mock_input), /* If there's a binding (i.e. @@ -9740,6 +9994,10 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, if (done) { mock_input = diff + max (t, mock_input); + /* Adjust the input-decode-map counters. */ + indec.end += diff; + indec.start += diff; + goto replay_sequence; } } @@ -9748,17 +10006,19 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, Scan from keytran.end until we find a bound suffix. */ while (keytran.end < fkey.start) { - struct gcpro gcpro1, gcpro2, gcpro3; + struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; int done, diff; - GCPRO3 (fkey.map, keytran.map, delayed_switch_frame); + GCPRO4 (indec.map, fkey.map, keytran.map, delayed_switch_frame); done = keyremap_step (keybuf, bufsize, &keytran, max (t, mock_input), 1, &diff, prompt); UNGCPRO; if (done) { mock_input = diff + max (t, mock_input); - /* Adjust the function-key-map counters. */ + /* Adjust the function-key-map and input-decode-map counters. */ + indec.end += diff; + indec.start += diff; fkey.end += diff; fkey.start += diff; @@ -9771,7 +10031,7 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, and is an upper case letter use the corresponding lower-case letter instead. */ if (first_binding >= nmaps - && fkey.start >= t && keytran.start >= t + && /* indec.start >= t && fkey.start >= t && */ keytran.start >= t && INTEGERP (key) && ((CHARACTERP (make_number (XINT (key) & ~CHAR_MODIFIER_MASK)) && UPPERCASEP (XINT (key) & ~CHAR_MODIFIER_MASK)) @@ -9801,7 +10061,7 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, and is a shifted function key, use the corresponding unshifted function key instead. */ if (first_binding >= nmaps - && fkey.start >= t && keytran.start >= t + && /* indec.start >= t && fkey.start >= t && */ keytran.start >= t && SYMBOLP (key)) { Lisp_Object breakdown; @@ -9822,9 +10082,6 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, keybuf[t - 1] = new_key; mock_input = max (t, mock_input); - fkey.start = fkey.end = 0; - keytran.start = keytran.end = 0; - goto replay_sequence; } } @@ -10332,8 +10589,12 @@ detect_input_pending_run_timers (do_display) from an idle timer function. The symptom of the bug is that the cursor sometimes doesn't become visible until the next X event is processed. --gerd. */ - if (rif) - rif->flush_display (NULL); + { + Lisp_Object tail, frame; + FOR_EACH_FRAME (tail, frame) + if (FRAME_RIF (XFRAME (frame))) + FRAME_RIF (XFRAME (frame))->flush_display (XFRAME (frame)); + } } return input_pending; @@ -10585,6 +10846,9 @@ On such systems, Emacs starts a subshell instead of suspending. */) int width, height; struct gcpro gcpro1; + if (tty_list && tty_list->next) + error ("There are other tty frames open; close them before suspending Emacs"); + if (!NILP (stuffstring)) CHECK_STRING (stuffstring); @@ -10593,11 +10857,11 @@ On such systems, Emacs starts a subshell instead of suspending. */) call1 (Vrun_hooks, intern ("suspend-hook")); GCPRO1 (stuffstring); - get_frame_size (&old_width, &old_height); - reset_sys_modes (); + get_tty_size (fileno (CURTTY ()->input), &old_width, &old_height); + reset_all_sys_modes (); /* sys_suspend can get an error if it tries to fork a subshell and the system resources aren't available for that. */ - record_unwind_protect ((Lisp_Object (*) P_ ((Lisp_Object))) init_sys_modes, + record_unwind_protect ((Lisp_Object (*) P_ ((Lisp_Object))) init_all_sys_modes, Qnil); stuff_buffered_input (stuffstring); if (cannot_suspend) @@ -10609,7 +10873,7 @@ On such systems, Emacs starts a subshell instead of suspending. */) /* Check if terminal/window size has changed. Note that this is not useful when we are running directly with a window system; but suspend should be disabled in that case. */ - get_frame_size (&width, &height); + get_tty_size (fileno (CURTTY ()->input), &width, &height); if (width != old_width || height != old_height) change_frame_size (SELECTED_FRAME (), height, width, 0, 0, 0); @@ -10669,10 +10933,10 @@ set_waiting_for_input (time_to_clear) { input_available_clear_time = time_to_clear; - /* Tell interrupt_signal to throw back to read_char, */ + /* Tell handle_interrupt to throw back to read_char, */ waiting_for_input = 1; - /* If interrupt_signal was called before and buffered a C-g, + /* If handle_interrupt was called before and buffered a C-g, make it run again now, to avoid timing error. */ if (!NILP (Vquit_flag)) quit_throw_to_read_char (); @@ -10681,48 +10945,82 @@ set_waiting_for_input (time_to_clear) void clear_waiting_for_input () { - /* Tell interrupt_signal not to throw back to read_char, */ + /* Tell handle_interrupt not to throw back to read_char, */ waiting_for_input = 0; input_available_clear_time = 0; } -/* This routine is called at interrupt level in response to C-g. - - If interrupt_input, this is the handler for SIGINT. Otherwise, it - is called from kbd_buffer_store_event, in handling SIGIO or - SIGTINT. +/* The SIGINT handler. - If `waiting_for_input' is non zero, then unless `echoing' is - nonzero, immediately throw back to read_char. - - Otherwise it sets the Lisp variable quit-flag not-nil. This causes - eval to throw, when it gets a chance. If quit-flag is already - non-nil, it stops the job right away. */ + If we have a frame on the controlling tty, we assume that the + SIGINT was generated by C-g, so we call handle_interrupt. + Otherwise, the handler kills Emacs. */ static SIGTYPE interrupt_signal (signalnum) /* If we don't have an argument, */ int signalnum; /* some compilers complain in signal calls. */ { - char c; /* Must preserve main program's value of errno. */ int old_errno = errno; - struct frame *sf = SELECTED_FRAME (); + struct terminal *terminal; #if defined (USG) && !defined (POSIX_SIGNALS) - if (!read_socket_hook && NILP (Vwindow_system)) - { - /* USG systems forget handlers when they are used; - must reestablish each time */ - signal (SIGINT, interrupt_signal); - signal (SIGQUIT, interrupt_signal); - } + /* USG systems forget handlers when they are used; + must reestablish each time */ + signal (SIGINT, interrupt_signal); + signal (SIGQUIT, interrupt_signal); #endif /* USG */ SIGNAL_THREAD_CHECK (signalnum); + + /* See if we have an active terminal on our controlling tty. */ + terminal = get_named_tty ("/dev/tty"); + if (!terminal) + { + /* If there are no frames there, let's pretend that we are a + well-behaving UN*X program and quit. */ + Fkill_emacs (Qnil); + } + else + { + /* Otherwise, the SIGINT was probably generated by C-g. */ + + /* Set internal_last_event_frame to the top frame of the + controlling tty, if we have a frame there. We disable the + interrupt key on secondary ttys, so the SIGINT must have come + from the controlling tty. */ + internal_last_event_frame = terminal->display_info.tty->top_frame; + + handle_interrupt (); + } + + errno = old_errno; +} + +/* This routine is called at interrupt level in response to C-g. + + It is called from the SIGINT handler or kbd_buffer_store_event. + + If `waiting_for_input' is non zero, then unless `echoing' is + nonzero, immediately throw back to read_char. + + Otherwise it sets the Lisp variable quit-flag not-nil. This causes + eval to throw, when it gets a chance. If quit-flag is already + non-nil, it stops the job right away. */ + +static void +handle_interrupt () +{ + char c; + cancel_echoing (); + /* XXX This code needs to be revised for multi-tty support. */ if (!NILP (Vquit_flag) - && (FRAME_TERMCAP_P (sf) || FRAME_MSDOS_P (sf))) +#ifndef MSDOS + && get_named_tty ("/dev/tty") +#endif + ) { /* If SIGINT isn't blocked, don't let us be interrupted by another SIGINT, it might be harmful due to non-reentrancy @@ -10730,7 +11028,7 @@ interrupt_signal (signalnum) /* If we don't have an argument, */ sigblock (sigmask (SIGINT)); fflush (stdout); - reset_sys_modes (); + reset_all_sys_modes (); #ifdef SIGTSTP /* Support possible in later USG versions */ /* @@ -10809,7 +11107,7 @@ interrupt_signal (signalnum) /* If we don't have an argument, */ printf ("Continuing...\n"); #endif /* not MSDOS */ fflush (stdout); - init_sys_modes (); + init_all_sys_modes (); sigfree (); } else @@ -10837,9 +11135,7 @@ interrupt_signal (signalnum) /* If we don't have an argument, */ } if (waiting_for_input && !echoing) - quit_throw_to_read_char (); - - errno = old_errno; + quit_throw_to_read_char (); } /* Handle a C-g by making read_char return C-g. */ @@ -10872,75 +11168,203 @@ quit_throw_to_read_char () _longjmp (getcjmp, 1); } -DEFUN ("set-input-mode", Fset_input_mode, Sset_input_mode, 3, 4, 0, - doc: /* Set mode of reading keyboard input. -First arg INTERRUPT non-nil means use input interrupts; - nil means use CBREAK mode. -Second arg FLOW non-nil means use ^S/^Q flow control for output to terminal - (no effect except in CBREAK mode). -Third arg META t means accept 8-bit input (for a Meta key). - META nil means ignore the top bit, on the assumption it is parity. - Otherwise, accept 8-bit input and don't use the top bit for Meta. -Optional fourth arg QUIT if non-nil specifies character to use for quitting. +DEFUN ("set-input-interrupt-mode", Fset_input_interrupt_mode, Sset_input_interrupt_mode, 1, 1, 0, + doc: /* Set interrupt mode of reading keyboard input. +If INTERRUPT is non-nil, Emacs will use input interrupts; +otherwise Emacs uses CBREAK mode. + See also `current-input-mode'. */) - (interrupt, flow, meta, quit) - Lisp_Object interrupt, flow, meta, quit; + (interrupt) + Lisp_Object interrupt; { - if (!NILP (quit) - && (!INTEGERP (quit) || XINT (quit) < 0 || XINT (quit) > 0400)) - error ("set-input-mode: QUIT must be an ASCII character"); - -#ifdef POLL_FOR_INPUT - stop_polling (); -#endif - -#ifndef DOS_NT - /* this causes startup screen to be restored and messes with the mouse */ - reset_sys_modes (); -#endif - + int new_interrupt_input; #ifdef SIGIO /* Note SIGIO has been undef'd if FIONREAD is missing. */ - if (read_socket_hook) +#ifdef HAVE_X_WINDOWS + if (x_display_list != NULL) { /* When using X, don't give the user a real choice, because we haven't implemented the mechanisms to support it. */ #ifdef NO_SOCK_SIGIO - interrupt_input = 0; + new_interrupt_input = 0; #else /* not NO_SOCK_SIGIO */ - interrupt_input = 1; + new_interrupt_input = 1; #endif /* NO_SOCK_SIGIO */ } else - interrupt_input = !NILP (interrupt); +#endif + new_interrupt_input = !NILP (interrupt); #else /* not SIGIO */ - interrupt_input = 0; + new_interrupt_input = 0; #endif /* not SIGIO */ /* Our VMS input only works by interrupts, as of now. */ #ifdef VMS - interrupt_input = 1; + new_interrupt_input = 1; #endif - flow_control = !NILP (flow); + if (new_interrupt_input != interrupt_input) + { +#ifdef POLL_FOR_INPUT + stop_polling (); +#endif +#ifndef DOS_NT + /* this causes startup screen to be restored and messes with the mouse */ + reset_all_sys_modes (); +#endif + interrupt_input = new_interrupt_input; +#ifndef DOS_NT + init_all_sys_modes (); +#endif + +#ifdef POLL_FOR_INPUT + poll_suppress_count = 1; + start_polling (); +#endif + } + return Qnil; +} + +DEFUN ("set-output-flow-control", Fset_output_flow_control, Sset_output_flow_control, 1, 2, 0, + doc: /* Enable or disable ^S/^Q flow control for output to TERMINAL. +If FLOW is non-nil, flow control is enabled and you cannot use C-s or +C-q in key sequences. + +This setting only has an effect on tty terminals and only when +Emacs reads input in CBREAK mode; see `set-input-interrupt-mode'. + +See also `current-input-mode'. */) + (flow, terminal) + Lisp_Object flow, terminal; +{ + struct terminal *t = get_terminal (terminal, 1); + struct tty_display_info *tty; + if (t == NULL || t->type != output_termcap) + return Qnil; + tty = t->display_info.tty; + + if (tty->flow_control != !NILP (flow)) + { +#ifndef DOS_NT + /* this causes startup screen to be restored and messes with the mouse */ + reset_sys_modes (tty); +#endif + + tty->flow_control = !NILP (flow); + +#ifndef DOS_NT + init_sys_modes (tty); +#endif + } + return Qnil; +} + +DEFUN ("set-input-meta-mode", Fset_input_meta_mode, Sset_input_meta_mode, 1, 2, 0, + doc: /* Enable or disable 8-bit input on TERMINAL. +If META is t, Emacs will accept 8-bit input, and interpret the 8th +bit as the Meta modifier. + +If META is nil, Emacs will ignore the top bit, on the assumption it is +parity. + +Otherwise, Emacs will accept and pass through 8-bit input without +specially interpreting the top bit. + +This setting only has an effect on tty terminal devices. + +Optional parameter TERMINAL specifies the tty terminal device to use. +It may be a terminal id, a frame, or nil for the terminal used by the +currently selected frame. + +See also `current-input-mode'. */) + (meta, terminal) + Lisp_Object meta, terminal; +{ + struct terminal *t = get_terminal (terminal, 1); + struct tty_display_info *tty; + int new_meta; + + if (t == NULL || t->type != output_termcap) + return Qnil; + tty = t->display_info.tty; + if (NILP (meta)) - meta_key = 0; + new_meta = 0; else if (EQ (meta, Qt)) - meta_key = 1; + new_meta = 1; else - meta_key = 2; - if (!NILP (quit)) - /* Don't let this value be out of range. */ - quit_char = XINT (quit) & (meta_key ? 0377 : 0177); + new_meta = 2; + if (tty->meta_key != new_meta) + { #ifndef DOS_NT - init_sys_modes (); + /* this causes startup screen to be restored and messes with the mouse */ + reset_sys_modes (tty); #endif -#ifdef POLL_FOR_INPUT - poll_suppress_count = 1; - start_polling (); + tty->meta_key = new_meta; + +#ifndef DOS_NT + init_sys_modes (tty); #endif + } + return Qnil; +} + +DEFUN ("set-quit-char", Fset_quit_char, Sset_quit_char, 1, 1, 0, + doc: /* Specify character used for quitting. +QUIT must be an ASCII character. + +This function only has an effect on the controlling tty of the Emacs +process. + +See also `current-input-mode'. */) + (quit) + Lisp_Object quit; +{ + struct terminal *t = get_named_tty ("/dev/tty"); + struct tty_display_info *tty; + if (t == NULL || t->type != output_termcap) + return Qnil; + tty = t->display_info.tty; + + if (NILP (quit) || !INTEGERP (quit) || XINT (quit) < 0 || XINT (quit) > 0400) + error ("QUIT must be an ASCII character"); + +#ifndef DOS_NT + /* this causes startup screen to be restored and messes with the mouse */ + reset_sys_modes (tty); +#endif + + /* Don't let this value be out of range. */ + quit_char = XINT (quit) & (tty->meta_key == 0 ? 0177 : 0377); + +#ifndef DOS_NT + init_sys_modes (tty); +#endif + + return Qnil; +} + +DEFUN ("set-input-mode", Fset_input_mode, Sset_input_mode, 3, 4, 0, + doc: /* Set mode of reading keyboard input. +First arg INTERRUPT non-nil means use input interrupts; + nil means use CBREAK mode. +Second arg FLOW non-nil means use ^S/^Q flow control for output to terminal + (no effect except in CBREAK mode). +Third arg META t means accept 8-bit input (for a Meta key). + META nil means ignore the top bit, on the assumption it is parity. + Otherwise, accept 8-bit input and don't use the top bit for Meta. +Optional fourth arg QUIT if non-nil specifies character to use for quitting. +See also `current-input-mode'. */) + (interrupt, flow, meta, quit) + Lisp_Object interrupt, flow, meta, quit; +{ + Fset_input_interrupt_mode (interrupt); + Fset_output_flow_control (flow, Qnil); + Fset_input_meta_mode (meta, Qnil); + if (!NILP (quit)) + Fset_quit_char (quit); return Qnil; } @@ -10961,10 +11385,21 @@ The elements of this list correspond to the arguments of () { Lisp_Object val[4]; + struct frame *sf = XFRAME (selected_frame); val[0] = interrupt_input ? Qt : Qnil; - val[1] = flow_control ? Qt : Qnil; - val[2] = meta_key == 2 ? make_number (0) : meta_key == 1 ? Qt : Qnil; + if (FRAME_TERMCAP_P (sf)) + { + val[1] = FRAME_TTY (sf)->flow_control ? Qt : Qnil; + val[2] = (FRAME_TTY (sf)->meta_key == 2 + ? make_number (0) + : (CURTTY ()->meta_key == 1 ? Qt : Qnil)); + } + else + { + val[1] = Qnil; + val[2] = Qt; + } XSETFASTINT (val[3], quit_char); return Flist (sizeof (val) / sizeof (val[0]), val); @@ -11056,6 +11491,8 @@ init_kboard (kb) kb->Voverriding_terminal_local_map = Qnil; kb->Vlast_command = Qnil; kb->Vreal_last_command = Qnil; + kb->Vkeyboard_translate_table = Qnil; + kb->Vlast_repeatable_command = Qnil; kb->Vprefix_arg = Qnil; kb->Vlast_prefix_arg = Qnil; kb->kbd_queue = Qnil; @@ -11070,6 +11507,9 @@ init_kboard (kb) kb->reference_count = 0; kb->Vsystem_key_alist = Qnil; kb->system_key_syms = Qnil; + kb->Vinput_decode_map = Fmake_sparse_keymap (Qnil); + kb->Vlocal_function_key_map = Fmake_sparse_keymap (Qnil); + Fset_keymap_parent (kb->Vlocal_function_key_map, Vfunction_key_map); kb->Vdefault_minibuffer_frame = Qnil; } @@ -11106,7 +11546,8 @@ delete_kboard (kb) && FRAMEP (selected_frame) && FRAME_LIVE_P (XFRAME (selected_frame))) { - current_kboard = XFRAME (selected_frame)->kboard; + current_kboard = FRAME_KBOARD (XFRAME (selected_frame)); + single_kboard = 0; if (current_kboard == kb) abort (); } @@ -11149,8 +11590,14 @@ init_keyboard () wipe_kboard (current_kboard); init_kboard (current_kboard); - if (!noninteractive && !read_socket_hook && NILP (Vwindow_system)) + if (!noninteractive) { + /* Before multi-tty support, these handlers used to be installed + only if the current session was a tty session. Now an Emacs + session may have multiple display types, so we always handle + SIGINT. There is special code in interrupt_signal to exit + Emacs on SIGINT when there are no termcap frames on the + controlling terminal. */ signal (SIGINT, interrupt_signal); #if defined (HAVE_TERMIO) || defined (HAVE_TERMIOS) /* For systems with SysV TERMIO, C-g is set up for both SIGINT and @@ -11397,7 +11844,7 @@ syms_of_keyboard () staticpro (&button_down_location); mouse_syms = Fmake_vector (make_number (1), Qnil); staticpro (&mouse_syms); - wheel_syms = Fmake_vector (make_number (2), Qnil); + wheel_syms = Fmake_vector (make_number (4), Qnil); staticpro (&wheel_syms); { @@ -11475,6 +11922,10 @@ syms_of_keyboard () defsubr (&Stop_level); defsubr (&Sdiscard_input); defsubr (&Sopen_dribble_file); + defsubr (&Sset_input_interrupt_mode); + defsubr (&Sset_output_flow_control); + defsubr (&Sset_input_meta_mode); + defsubr (&Sset_quit_char); defsubr (&Sset_input_mode); defsubr (&Scurrent_input_mode); defsubr (&Sexecute_extended_command); @@ -11541,11 +11992,19 @@ In other words, the present command is the event that made the previous command exit. The value `kill-region' is special; it means that the previous command -was a kill command. */); +was a kill command. + +`last-command' has a separate binding for each terminal device. +See Info node `(elisp)Multiple displays'. */); DEFVAR_KBOARD ("real-last-command", Vreal_last_command, doc: /* Same as `last-command', but never altered by Lisp code. */); + DEFVAR_KBOARD ("last-repeatable-command", Vlast_repeatable_command, + doc: /* Last command that may be repeated. +The last command executed that was not bound to an input event. +This is the command `repeat' will try to repeat. */); + DEFVAR_LISP ("this-command", &Vthis_command, doc: /* The command now being executed. The command can set this variable; whatever is put here @@ -11653,8 +12112,8 @@ for that character after that prefix key. */); Useful to set before you dump a modified Emacs. */); Vtop_level = Qnil; - DEFVAR_LISP ("keyboard-translate-table", &Vkeyboard_translate_table, - doc: /* Translate table for keyboard input, or nil. + DEFVAR_KBOARD ("keyboard-translate-table", Vkeyboard_translate_table, + doc: /* Translate table for local keyboard input, or nil. If non-nil, the value should be a char-table. Each character read from the keyboard is looked up in this char-table. If the value found there is non-nil, then it is used instead of the actual input character. @@ -11664,8 +12123,10 @@ If it is a string or vector of length N, character codes N and up are left untranslated. In a vector, an element which is nil means "no translation". This is applied to the characters supplied to input methods, not their -output. See also `translation-table-for-input'. */); - Vkeyboard_translate_table = Qnil; +output. See also `translation-table-for-input'. + +This variable has a separate binding for each terminal. See Info node +`(elisp)Multiple displays'. */); DEFVAR_BOOL ("cannot-suspend", &cannot_suspend, doc: /* Non-nil means to always spawn a subshell instead of suspending. @@ -11750,7 +12211,11 @@ buffer's local map, and the minor mode keymaps and text property keymaps. It also replaces `overriding-local-map'. This variable is intended to let commands such as `universal-argument' -set up a different keymap for reading the next command. */); +set up a different keymap for reading the next command. + +`overriding-terminal-local-map' has a separate binding for each +terminal device. +See Info node `(elisp)Multiple displays'. */); DEFVAR_LISP ("overriding-local-map", &Voverriding_local_map, doc: /* Keymap that overrides all other local keymaps. @@ -11775,7 +12240,73 @@ and the minor mode maps regardless of `overriding-local-map'. */); doc: /* Alist of system-specific X windows key symbols. Each element should have the form (N . SYMBOL) where N is the numeric keysym code (sans the \"system-specific\" bit 1<<28) -and SYMBOL is its name. */); +and SYMBOL is its name. + +`system-key-alist' has a separate binding for each terminal device. +See Info node `(elisp)Multiple displays'. */); + + DEFVAR_KBOARD ("local-function-key-map", Vlocal_function_key_map, + doc: /* Keymap that translates key sequences to key sequences during input. +This is used mainly for mapping key sequences into some preferred +key events (symbols). + +The `read-key-sequence' function replaces any subsequence bound by +`local-function-key-map' with its binding. More precisely, when the +active keymaps have no binding for the current key sequence but +`local-function-key-map' binds a suffix of the sequence to a vector or +string, `read-key-sequence' replaces the matching suffix with its +binding, and continues with the new sequence. + +If the binding is a function, it is called with one argument (the prompt) +and its return value (a key sequence) is used. + +The events that come from bindings in `local-function-key-map' are not +themselves looked up in `local-function-key-map'. + +For example, suppose `local-function-key-map' binds `ESC O P' to [f1]. +Typing `ESC O P' to `read-key-sequence' would return [f1]. Typing +`C-x ESC O P' would return [?\\C-x f1]. If [f1] were a prefix key, +typing `ESC O P x' would return [f1 x]. + +`local-function-key-map' has a separate binding for each terminal +device. See Info node `(elisp)Multiple displays'. If you need to +define a binding on all terminals, change `function-key-map' +instead. Initially, `local-function-key-map' is an empty keymap that +has `function-key-map' as its parent on all terminal devices. */); + + DEFVAR_KBOARD ("input-decode-map", Vinput_decode_map, + doc: /* Keymap that decodes input escape sequences. +This is used mainly for mapping ASCII function key sequences into +real Emacs function key events (symbols). + +The `read-key-sequence' function replaces any subsequence bound by +`local-function-key-map' with its binding. Contrary to `function-key-map', +this map applies its rebinding regardless of the presence of an ordinary +binding. So it is more like `key-translation-map' except that it applies +before `function-key-map' rather than after. + +If the binding is a function, it is called with one argument (the prompt) +and its return value (a key sequence) is used. + +The events that come from bindings in `input-decode-map' are not +themselves looked up in `input-decode-map'. + +This variable is keyboard-local. */); + + DEFVAR_LISP ("function-key-map", &Vfunction_key_map, + doc: /* The parent keymap of all `local-function-key-map' instances. +Function key definitions that apply to all terminal devices should go +here. If a mapping is defined in both the current +`local-function-key-map' binding and this variable, then the local +definition will take precendence. */); + Vfunction_key_map = Fmake_sparse_keymap (Qnil); + + DEFVAR_LISP ("key-translation-map", &Vkey_translation_map, + doc: /* Keymap of key translations that can override keymaps. +This keymap works like `function-key-map', but comes after that, +and its non-prefix bindings override ordinary bindings. +Another difference is that it is global rather than keyboard-local. */); + Vkey_translation_map = Fmake_sparse_keymap (Qnil); DEFVAR_LISP ("deferred-action-list", &Vdeferred_action_list, doc: /* List of deferred actions to be performed at a later time. @@ -11944,6 +12475,8 @@ mark_kboards () mark_object (kb->Voverriding_terminal_local_map); mark_object (kb->Vlast_command); mark_object (kb->Vreal_last_command); + mark_object (kb->Vkeyboard_translate_table); + mark_object (kb->Vlast_repeatable_command); mark_object (kb->Vprefix_arg); mark_object (kb->Vlast_prefix_arg); mark_object (kb->kbd_queue); @@ -11951,6 +12484,8 @@ mark_kboards () mark_object (kb->Vlast_kbd_macro); mark_object (kb->Vsystem_key_alist); mark_object (kb->system_key_syms); + mark_object (kb->Vinput_decode_map); + mark_object (kb->Vlocal_function_key_map); mark_object (kb->Vdefault_minibuffer_frame); mark_object (kb->echo_string); } diff --git a/src/keyboard.h b/src/keyboard.h index 15e55ad4e67..ae135b30b77 100644 --- a/src/keyboard.h +++ b/src/keyboard.h @@ -23,8 +23,9 @@ Boston, MA 02110-1301, USA. */ /* Length of echobuf field in each KBOARD. */ -/* Each KBOARD represents one logical input stream from which Emacs gets input. - If we are using an ordinary terminal, it has one KBOARD object. +/* Each KBOARD represents one logical input stream from which Emacs + gets input. If we are using ordinary terminals, it has one KBOARD + object for each terminal device. Usually each X display screen has its own KBOARD, but when two of them are on the same X server, we assume they share a keyboard and give them one KBOARD in common. @@ -83,6 +84,12 @@ struct kboard other commands. */ Lisp_Object Vreal_last_command; + /* User-supplied table to translate input characters through. */ + Lisp_Object Vkeyboard_translate_table; + + /* Last command that may be repeated by `repeat'. */ + Lisp_Object Vlast_repeatable_command; + /* The prefix argument for the next command, in raw form. */ Lisp_Object Vprefix_arg; @@ -123,6 +130,15 @@ struct kboard /* Cache for modify_event_symbol. */ Lisp_Object system_key_syms; + /* Keymap mapping keys to alternative preferred forms. + See the DEFVAR for more documentation. */ + Lisp_Object Vlocal_function_key_map; + + /* Keymap mapping ASCII function key sequences onto their preferred + forms. Initialized by the terminal-specific lisp files. See the + DEFVAR for more documentation. */ + Lisp_Object Vinput_decode_map; + /* Minibufferless frames on this display use this frame's minibuffer. */ Lisp_Object Vdefault_minibuffer_frame; @@ -155,7 +171,7 @@ struct kboard }; #ifdef MULTI_KBOARD -/* Temporarily used before a frame has been opened, and for termcap frames */ +/* Temporarily used before a frame has been opened. */ extern KBOARD *initial_kboard; /* In the single-kboard state, this is the kboard @@ -190,10 +206,6 @@ extern EMACS_INT num_nonmacro_input_events; /* Nonzero means polling for input is temporarily suppressed. */ extern int poll_suppress_count; -/* Keymap mapping ASCII function key sequences onto their preferred forms. - Initialized by the terminal-specific lisp files. */ -extern Lisp_Object Vfunction_key_map; - /* Vector holding the key sequence that invoked the current command. It is reused for each command, and it may be longer than the current sequence; this_command_key_count indicates how many elements @@ -301,18 +313,24 @@ extern Lisp_Object parse_modifiers P_ ((Lisp_Object)); extern Lisp_Object reorder_modifiers P_ ((Lisp_Object)); extern Lisp_Object read_char P_ ((int, int, Lisp_Object *, Lisp_Object, int *, EMACS_TIME *)); -/* User-supplied string to translate input characters through. */ -extern Lisp_Object Vkeyboard_translate_table; + + +/* Parent keymap of terminal-local function-key-map instances. */ +extern Lisp_Object Vfunction_key_map; + +/* Keymap of key translations that can override keymaps. */ +extern Lisp_Object Vkey_translation_map; extern int parse_menu_item P_ ((Lisp_Object, int, int)); extern void echo_now P_ ((void)); extern void init_kboard P_ ((KBOARD *)); extern void delete_kboard P_ ((KBOARD *)); -extern void single_kboard_state P_ ((void)); extern void not_single_kboard_state P_ ((KBOARD *)); +extern void push_kboard P_ ((struct kboard *)); extern void push_frame_kboard P_ ((struct frame *)); -extern void pop_frame_kboard P_ ((void)); +extern void pop_kboard P_ ((void)); +extern void temporarily_switch_to_single_kboard P_ ((struct frame *)); extern void record_asynch_buffer_change P_ ((void)); extern SIGTYPE input_poll_signal P_ ((int)); extern void start_polling P_ ((void)); @@ -346,5 +364,8 @@ extern Lisp_Object menu_item_eval_property P_ ((Lisp_Object)); extern int kbd_buffer_events_waiting P_ ((int)); extern void add_user_signals P_ ((int, const char *)); +extern int tty_read_avail_input P_ ((struct terminal *, int, + struct input_event *)); + /* arch-tag: 769cbade-1ba9-4950-b886-db265b061aa3 (do not change this comment) */ diff --git a/src/keymap.c b/src/keymap.c index 7f329cc9a1a..b6243594beb 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -32,6 +32,7 @@ Boston, MA 02110-1301, USA. */ #include "character.h" #include "charset.h" #include "keyboard.h" +#include "frame.h" #include "termhooks.h" #include "blockinput.h" #include "puresize.h" @@ -91,14 +92,6 @@ Lisp_Object Vminor_mode_overriding_map_alist; /* List of emulation mode keymap alists. */ Lisp_Object Vemulation_mode_map_alists; -/* Keymap mapping ASCII function key sequences onto their preferred forms. - Initialized by the terminal-specific lisp files. See DEFVAR for more - documentation. */ -Lisp_Object Vfunction_key_map; - -/* Keymap mapping ASCII function key sequences onto their preferred forms. */ -Lisp_Object Vkey_translation_map; - /* A list of all commands given new bindings since a certain time when nil was stored here. This is used to speed up recomputation of menu key equivalents @@ -2977,11 +2970,11 @@ You type Translation\n\ outbuf = Fcurrent_buffer (); /* Report on alternates for keys. */ - if (STRINGP (Vkeyboard_translate_table) && !NILP (prefix)) + if (STRINGP (current_kboard->Vkeyboard_translate_table) && !NILP (prefix)) { int c; - const unsigned char *translate = SDATA (Vkeyboard_translate_table); - int translate_len = SCHARS (Vkeyboard_translate_table); + const unsigned char *translate = SDATA (current_kboard->Vkeyboard_translate_table); + int translate_len = SCHARS (current_kboard->Vkeyboard_translate_table); for (c = 0; c < translate_len; c++) if (translate[c] != c) @@ -3004,7 +2997,7 @@ You type Translation\n\ insert ("\n", 1); /* Insert calls signal_after_change which may GC. */ - translate = SDATA (Vkeyboard_translate_table); + translate = SDATA (current_kboard->Vkeyboard_translate_table); } insert ("\n", 1); @@ -3100,10 +3093,15 @@ You type Translation\n\ "\f\nGlobal Bindings", nomenu, 0, 1, 0); /* Print the function-key-map translations under this prefix. */ - if (!NILP (Vfunction_key_map)) - describe_map_tree (Vfunction_key_map, 0, Qnil, prefix, + if (!NILP (current_kboard->Vlocal_function_key_map)) + describe_map_tree (current_kboard->Vlocal_function_key_map, 0, Qnil, prefix, "\f\nFunction key map translations", nomenu, 1, 0, 0); + /* Print the input-decode-map translations under this prefix. */ + if (!NILP (current_kboard->Vinput_decode_map)) + describe_map_tree (current_kboard->Vinput_decode_map, 0, Qnil, prefix, + "\f\nInput decoding map translations", nomenu, 1, 0, 0); + UNGCPRO; return Qnil; } @@ -3923,37 +3921,6 @@ the same way. The "active" keymaps in each alist are used before `minor-mode-map-alist' and `minor-mode-overriding-map-alist'. */); Vemulation_mode_map_alists = Qnil; - - DEFVAR_LISP ("function-key-map", &Vfunction_key_map, - doc: /* Keymap that translates key sequences to key sequences during input. -This is used mainly for mapping ASCII function key sequences into -real Emacs function key events (symbols). - -The `read-key-sequence' function replaces any subsequence bound by -`function-key-map' with its binding. More precisely, when the active -keymaps have no binding for the current key sequence but -`function-key-map' binds a suffix of the sequence to a vector or string, -`read-key-sequence' replaces the matching suffix with its binding, and -continues with the new sequence. - -If the binding is a function, it is called with one argument (the prompt) -and its return value (a key sequence) is used. - -The events that come from bindings in `function-key-map' are not -themselves looked up in `function-key-map'. - -For example, suppose `function-key-map' binds `ESC O P' to [f1]. -Typing `ESC O P' to `read-key-sequence' would return [f1]. Typing -`C-x ESC O P' would return [?\\C-x f1]. If [f1] were a prefix -key, typing `ESC O P x' would return [f1 x]. */); - Vfunction_key_map = Fmake_sparse_keymap (Qnil); - - DEFVAR_LISP ("key-translation-map", &Vkey_translation_map, - doc: /* Keymap of key translations that can override keymaps. -This keymap works like `function-key-map', but comes after that, -and its non-prefix bindings override ordinary bindings. */); - Vkey_translation_map = Qnil; - staticpro (&Vmouse_events); Vmouse_events = Fcons (intern ("menu-bar"), Fcons (intern ("tool-bar"), diff --git a/src/keymap.h b/src/keymap.h index 1a51de705be..3268967089a 100644 --- a/src/keymap.h +++ b/src/keymap.h @@ -38,6 +38,7 @@ EXFUN (Fcurrent_active_maps, 2); extern Lisp_Object access_keymap P_ ((Lisp_Object, Lisp_Object, int, int, int)); extern Lisp_Object get_keyelt P_ ((Lisp_Object, int)); extern Lisp_Object get_keymap P_ ((Lisp_Object, int, int)); +EXFUN (Fset_keymap_parent, 2); extern void describe_map_tree P_ ((Lisp_Object, int, Lisp_Object, Lisp_Object, char *, int, int, int, int)); extern int current_minor_maps P_ ((Lisp_Object **, Lisp_Object **)); diff --git a/src/lisp.h b/src/lisp.h index c047355b21c..578cc3a6410 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -113,6 +113,57 @@ extern void die P_((const char *, const char *, int)) NO_RETURN; #define eassert(cond) CHECK(cond,"assertion failed") #endif #endif /* ENABLE_CHECKING */ + +/***** Select the tagging scheme. *****/ +/* There are basically two options that control the tagging scheme: + - NO_UNION_TYPE says that Lisp_Object should be an integer instead + of a union. + - USE_LSB_TAG means that we can assume the least 3 bits of pointers are + always 0, and we can thus use them to hold tag bits, without + restricting our addressing space. + + If USE_LSB_TAG is not set, then we use the top 3 bits for tagging, thus + restricting our possible address range. Currently USE_LSB_TAG is not + allowed together with a union. This is not due to any fundamental + technical (or political ;-) problem: nobody wrote the code to do it yet. + + USE_LSB_TAG not only requires the least 3 bits of pointers returned by + malloc to be 0 but also needs to be able to impose a mult-of-8 alignment + on the few static Lisp_Objects used: all the defsubr as well + as the two special buffers buffer_defaults and buffer_local_symbols. */ + +/* First, try and define DECL_ALIGN(type,var) which declares a static + variable VAR of type TYPE with the added requirement that it be + TYPEBITS-aligned. */ +#ifndef NO_DECL_ALIGN +# ifndef DECL_ALIGN +/* What compiler directive should we use for non-gcc compilers? -stef */ +# if defined (__GNUC__) +# define DECL_ALIGN(type, var) \ + type __attribute__ ((__aligned__ (1 << GCTYPEBITS))) var +# endif +# endif +#endif + +/* Let's USE_LSB_TAG on systems where we know malloc returns mult-of-8. */ +#if defined GNU_MALLOC || defined DOUG_LEA_MALLOC || defined __GLIBC__ || defined MAC_OSX +/* We also need to be able to specify mult-of-8 alignment on static vars. */ +# if defined DECL_ALIGN +/* We currently do not support USE_LSB_TAG with a union Lisp_Object. */ +# if defined NO_UNION_TYPE +# define USE_LSB_TAG +# endif +# endif +#endif + +/* If we cannot use 8-byte alignment, make DECL_ALIGN a no-op. */ +#ifndef DECL_ALIGN +# ifdef USE_LSB_TAG +# error "USE_LSB_TAG used without defining DECL_ALIGN" +# endif +# define DECL_ALIGN(type, var) type var +#endif + /* Define the fundamental Lisp data structures. */ @@ -194,7 +245,7 @@ union Lisp_Object { /* Used for comparing two Lisp_Objects; also, positive integers can be accessed fast this way. */ - EMACS_INT i; + EMACS_UINT i; struct { @@ -216,7 +267,7 @@ union Lisp_Object { /* Used for comparing two Lisp_Objects; also, positive integers can be accessed fast this way. */ - EMACS_INT i; + EMACS_UINT i; struct { @@ -247,34 +298,29 @@ LISP_MAKE_RVALUE (Lisp_Object o) #define LISP_MAKE_RVALUE(o) (o) #endif -#endif /* NO_UNION_TYPE */ - +#else /* NO_UNION_TYPE */ /* If union type is not wanted, define Lisp_Object as just a number. */ -#ifdef NO_UNION_TYPE typedef EMACS_INT Lisp_Object; #define LISP_MAKE_RVALUE(o) (0+(o)) #endif /* NO_UNION_TYPE */ -/* Two flags that are set during GC. On some machines, these flags - are defined differently by the m- file. */ - /* In the size word of a vector, this bit means the vector has been marked. */ -#ifndef ARRAY_MARK_FLAG -#define ARRAY_MARK_FLAG ((EMACS_INT) ((EMACS_UINT) 1 << (VALBITS + GCTYPEBITS - 1))) -#endif /* no ARRAY_MARK_FLAG */ +#define ARRAY_MARK_FLAG ((EMACS_UINT) 1 << (BITS_PER_EMACS_INT - 1)) /* In the size word of a struct Lisp_Vector, this bit means it's really some other vector-like object. */ -#ifndef PSEUDOVECTOR_FLAG -#define PSEUDOVECTOR_FLAG ((ARRAY_MARK_FLAG >> 1) & ~ARRAY_MARK_FLAG) -#endif +#define PSEUDOVECTOR_FLAG ((ARRAY_MARK_FLAG >> 1)) /* In a pseudovector, the size field actually contains a word with one PSEUDOVECTOR_FLAG bit set, and exactly one of the following bits to - indicate the actual type. */ + indicate the actual type. + We use a bitset, even tho only one of the bits can be set at any + particular time just so as to be able to use micro-optimizations such as + testing membership of a particular subset of pseudovectors in Fequal. + It is not crucial, but there are plenty of bits here, so why not do it? */ enum pvec_type { PVEC_NORMAL_VECTOR = 0, @@ -288,8 +334,9 @@ enum pvec_type PVEC_BOOL_VECTOR = 0x10000, PVEC_BUFFER = 0x20000, PVEC_HASH_TABLE = 0x40000, - PVEC_SUB_CHAR_TABLE = 0x80000, - PVEC_TYPE_MASK = 0x0ffe00 + PVEC_TERMINAL = 0x80000, + PVEC_SUB_CHAR_TABLE = 0x100000, + PVEC_TYPE_MASK = 0x1ffe00 #if 0 /* This is used to make the value of PSEUDOVECTOR_FLAG available to GDB. It doesn't work on OS Alpha. Moved to a variable in @@ -309,63 +356,15 @@ enum pvec_type of bool vectors. This should not vary across implementations. */ #define BOOL_VECTOR_BITS_PER_CHAR 8 -/***** Select the tagging scheme. *****/ -/* There are basically two options that control the tagging scheme: - - NO_UNION_TYPE says that Lisp_Object should be an integer instead - of a union. - - USE_LSB_TAG means that we can assume the least 3 bits of pointers are - always 0, and we can thus use them to hold tag bits, without - restricting our addressing space. - - If USE_LSB_TAG is not set, then we use the top 3 bits for tagging, thus - restricting our possible address range. Currently USE_LSB_TAG is not - allowed together with a union. This is not due to any fundamental - technical (or political ;-) problem: nobody wrote the code to do it yet. - - USE_LSB_TAG not only requires the least 3 bits of pointers returned by - malloc to be 0 but also needs to be able to impose a mult-of-8 alignment - on the few static Lisp_Objects used: all the defsubr as well - as the two special buffers buffer_defaults and buffer_local_symbols. */ - -/* First, try and define DECL_ALIGN(type,var) which declares a static - variable VAR of type TYPE with the added requirement that it be - TYPEBITS-aligned. */ -#ifndef NO_DECL_ALIGN -# ifndef DECL_ALIGN -/* What compiler directive should we use for non-gcc compilers? -stef */ -# if defined (__GNUC__) -# define DECL_ALIGN(type, var) \ - type __attribute__ ((__aligned__ (1 << GCTYPEBITS))) var -# endif -# endif -#endif - -/* Let's USE_LSB_TAG on systems where we know malloc returns mult-of-8. */ -#if defined GNU_MALLOC || defined DOUG_LEA_MALLOC || defined __GLIBC__ || defined MAC_OSX -/* We also need to be able to specify mult-of-8 alignment on static vars. */ -# if defined DECL_ALIGN -/* We currently do not support USE_LSB_TAG with a union Lisp_Object. */ -# if defined NO_UNION_TYPE -# define USE_LSB_TAG -# endif -# endif -#endif - -/* If we cannot use 8-byte alignment, make DECL_ALIGN a no-op. */ -#ifndef DECL_ALIGN -# ifdef USE_LSB_TAG -# error "USE_LSB_TAG used without defining DECL_ALIGN" -# endif -# define DECL_ALIGN(type, var) type var -#endif - - /* These macros extract various sorts of values from a Lisp_Object. For example, if tem is a Lisp_Object whose type is Lisp_Cons, XCONS (tem) is the struct Lisp_Cons * pointing to the memory for that cons. */ #ifdef NO_UNION_TYPE +/* Return a perfect hash of the Lisp_Object representation. */ +#define XHASH(a) (a) + #ifdef USE_LSB_TAG #define TYPEMASK ((((EMACS_INT) 1) << GCTYPEBITS) - 1) @@ -427,10 +426,10 @@ enum pvec_type #endif /* not USE_LSB_TAG */ -#define EQ(x, y) ((x) == (y)) - #else /* not NO_UNION_TYPE */ +#define XHASH(a) ((a).i) + #define XTYPE(a) ((enum Lisp_Type) (a).u.type) /* For integers known to be positive, XFASTINT provides fast retrieval @@ -459,10 +458,10 @@ enum pvec_type extern Lisp_Object make_number P_ ((EMACS_INT)); #endif -#define EQ(x, y) ((x).i == (y).i) - #endif /* NO_UNION_TYPE */ +#define EQ(x, y) (XHASH (x) == XHASH (y)) + #ifndef XPNTR #ifdef HAVE_SHM /* In this representation, data is found in two widely separated segments. */ @@ -528,11 +527,12 @@ extern size_t pure_size; #define XPROCESS(a) (eassert (PROCESSP(a)),(struct Lisp_Process *) XPNTR(a)) #define XWINDOW(a) (eassert (WINDOWP(a)),(struct window *) XPNTR(a)) +#define XTERMINAL(a) (eassert (TERMINALP(a)),(struct terminal *) XPNTR(a)) #define XSUBR(a) (eassert (SUBRP(a)),(struct Lisp_Subr *) XPNTR(a)) #define XBUFFER(a) (eassert (BUFFERP(a)),(struct buffer *) XPNTR(a)) -#define XCHAR_TABLE(a) ((struct Lisp_Char_Table *) XPNTR(a)) -#define XSUB_CHAR_TABLE(a) ((struct Lisp_Sub_Char_Table *) XPNTR(a)) -#define XBOOL_VECTOR(a) ((struct Lisp_Bool_Vector *) XPNTR(a)) +#define XCHAR_TABLE(a) (eassert (CHAR_TABLE_P (a)), (struct Lisp_Char_Table *) XPNTR(a)) +#define XSUB_CHAR_TABLE(a) (eassert (SUB_CHAR_TABLE_P (a)), (struct Lisp_Sub_Char_Table *) XPNTR(a)) +#define XBOOL_VECTOR(a) (eassert (BOOL_VECTOR_P (a)), (struct Lisp_Bool_Vector *) XPNTR(a)) /* Construct a Lisp_Object from a value or address. */ @@ -550,12 +550,16 @@ extern size_t pure_size; /* Pseudovector types. */ +#define XSETPVECTYPE(v,code) ((v)->size |= PSEUDOVECTOR_FLAG | (code)) #define XSETPSEUDOVECTOR(a, b, code) \ - (XSETVECTOR (a, b), XVECTOR (a)->size |= PSEUDOVECTOR_FLAG | (code)) + (XSETVECTOR (a, b), \ + eassert ((XVECTOR (a)->size & (PSEUDOVECTOR_FLAG | PVEC_TYPE_MASK)) \ + == (PSEUDOVECTOR_FLAG | (code)))) #define XSETWINDOW_CONFIGURATION(a, b) \ (XSETPSEUDOVECTOR (a, b, PVEC_WINDOW_CONFIGURATION)) #define XSETPROCESS(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_PROCESS)) #define XSETWINDOW(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_WINDOW)) +#define XSETTERMINAL(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_TERMINAL)) #define XSETSUBR(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_SUBR)) #define XSETCOMPILED(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_COMPILED)) #define XSETBUFFER(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_BUFFER)) @@ -571,9 +575,9 @@ extern size_t pure_size; /* Convenience macros for dealing with Lisp strings. */ -#define SREF(string, index) (XSTRING (string)->data[index] + 0) -#define SSET(string, index, new) (XSTRING (string)->data[index] = (new)) #define SDATA(string) (XSTRING (string)->data + 0) +#define SREF(string, index) (SDATA (string)[index] + 0) +#define SSET(string, index, new) (SDATA (string)[index] = (new)) #define SCHARS(string) (XSTRING (string)->size + 0) #define SBYTES(string) (STRING_BYTES (XSTRING (string)) + 0) @@ -581,7 +585,7 @@ extern size_t pure_size; (XSTRING (string)->size = (newsize)) #define STRING_COPYIN(string, index, new, count) \ - bcopy (new, XSTRING (string)->data + index, count) + bcopy (new, SDATA (string) + index, count) /* Type checking. */ @@ -723,7 +727,7 @@ struct Lisp_String struct Lisp_Vector { - EMACS_INT size; + EMACS_UINT size; struct Lisp_Vector *next; Lisp_Object contents[1]; }; @@ -799,10 +803,10 @@ struct Lisp_Sub_Char_Table; struct Lisp_Char_Table { /* This is the vector's size field, which also holds the - pseudovector type information. It holds the size, too. The size - counts the defalt, parent, purpose, ascii, contents, and extras - slots. */ - EMACS_INT size; + pseudovector type information. It holds the size, too. + The size counts the defalt, parent, purpose, ascii, + contents, and extras slots. */ + EMACS_UINT size; struct Lisp_Vector *next; /* This holds a default value, @@ -854,10 +858,10 @@ struct Lisp_Bool_Vector { /* This is the vector's size field. It doesn't have the real size, just the subtype information. */ - EMACS_INT vector_size; + EMACS_UINT vector_size; struct Lisp_Vector *next; /* This is the size in bits. */ - EMACS_INT size; + EMACS_UINT size; /* This contains the actual bits, packed into bytes. */ unsigned char data[1]; }; @@ -872,11 +876,11 @@ struct Lisp_Bool_Vector struct Lisp_Subr { - EMACS_INT size; + EMACS_UINT size; Lisp_Object (*function) (); short min_args, max_args; char *symbol_name; - char *prompt; + char *intspec; char *doc; }; @@ -983,7 +987,7 @@ struct Lisp_Symbol struct Lisp_Hash_Table { /* Vector fields. The hash table code doesn't refer to these. */ - EMACS_INT size; + EMACS_UINT size; struct Lisp_Vector *vec_next; /* Function used to compare keys. */ @@ -1002,13 +1006,6 @@ struct Lisp_Hash_Table ratio, a float. */ Lisp_Object rehash_threshold; - /* Number of key/value entries in the table. */ - Lisp_Object count; - - /* Vector of keys and values. The key of item I is found at index - 2 * I, the value is found at index 2 * I + 1. */ - Lisp_Object key_and_value; - /* Vector of hash codes.. If hash[I] is nil, this means that that entry I is unused. */ Lisp_Object hash; @@ -1032,6 +1029,18 @@ struct Lisp_Hash_Table /* User-supplied key comparison function, or nil. */ Lisp_Object user_cmp_function; + /* Only the fields above are traced normally by the GC. The ones below + `count'. are special and are either ignored by the GC or traced in + a special way (e.g. because of weakness). */ + + /* Number of key/value entries in the table. */ + unsigned int count; + + /* Vector of keys and values. The key of item I is found at index + 2 * I, the value is found at index 2 * I + 1. + This is gc_marked specially if the table is weak. */ + Lisp_Object key_and_value; + /* Next weak hash table if this is a weak hash table. The head of the list is in weak_hash_tables. */ struct Lisp_Hash_Table *next_weak; @@ -1107,8 +1116,16 @@ struct Lisp_Marker /* 1 means normal insertion at the marker's position leaves the marker after the inserted text. */ unsigned int insertion_type : 1; - /* This is the buffer that the marker points into, - or 0 if it points nowhere. */ + /* This is the buffer that the marker points into, or 0 if it points nowhere. + Note: a chain of markers can contain markers pointing into different + buffers (the chain is per buffer_text rather than per buffer, so it's + shared between indirect buffers). */ + /* This is used for (other than NULL-checking): + - Fmarker_buffer + - Fset_marker: check eq(oldbuf, newbuf) to avoid unchain+rechain. + - unchain_marker: to find the list from which to unchain. + - Fkill_buffer: to unchain the markers of current indirect buffer. + */ struct buffer *buffer; /* The remaining fields are meaningless in a marker that @@ -1116,6 +1133,8 @@ struct Lisp_Marker /* For markers that point somewhere, this is used to chain of all the markers in a given buffer. */ + /* We could remove it and use an array in buffer_text instead. + That would also allow to preserve it ordered. */ struct Lisp_Marker *next; /* This is the char position where the marker points. */ EMACS_INT charpos; @@ -1213,6 +1232,10 @@ struct Lisp_Buffer_Local_Value unsigned int found_for_frame : 1; Lisp_Object realvalue; /* The buffer and frame for which the loaded binding was found. */ + /* Having both is only needed if we want to allow variables that are + both buffer local and frame local (in which case, we currently give + precedence to the buffer-local binding). I don't think such + a combination is desirable. --Stef */ Lisp_Object buffer, frame; /* A cons cell, (LOADED-BINDING . DEFAULT-VALUE). @@ -1364,34 +1387,6 @@ typedef unsigned char UCHAR; We need one more byte for string terminator `\0'. */ #define KEY_DESCRIPTION_SIZE ((2 * 6) + 1 + (CHARACTERBITS / 3) + 1 + 1) -#ifdef USE_X_TOOLKIT -#ifdef NO_UNION_TYPE -/* Use this for turning a (void *) into a Lisp_Object, as when the - Lisp_Object is passed into a toolkit callback function. */ -#define VOID_TO_LISP(larg,varg) \ - do { ((larg) = ((Lisp_Object) (varg))); } while (0) -#define CVOID_TO_LISP VOID_TO_LISP - -/* Use this for turning a Lisp_Object into a (void *), as when the - Lisp_Object is passed into a toolkit callback function. */ -#define LISP_TO_VOID(larg) ((void *) (larg)) -#define LISP_TO_CVOID(varg) ((const void *) (larg)) - -#else /* not NO_UNION_TYPE */ -/* Use this for turning a (void *) into a Lisp_Object, as when the - Lisp_Object is passed into a toolkit callback function. */ -#define VOID_TO_LISP(larg,varg) \ - do { ((larg).v = (void *) (varg)); } while (0) -#define CVOID_TO_LISP(larg,varg) \ - do { ((larg).cv = (const void *) (varg)); } while (0) - -/* Use this for turning a Lisp_Object into a (void *), as when the - Lisp_Object is passed into a toolkit callback function. */ -#define LISP_TO_VOID(larg) ((larg).v) -#define LISP_TO_CVOID(larg) ((larg).cv) -#endif /* not NO_UNION_TYPE */ -#endif /* USE_X_TOOLKIT */ - /* The glyph datatype, used to represent characters on the display. */ @@ -1471,6 +1466,7 @@ typedef unsigned char UCHAR; #define WINDOW_CONFIGURATIONP(x) PSEUDOVECTORP (x, PVEC_WINDOW_CONFIGURATION) #define PROCESSP(x) PSEUDOVECTORP (x, PVEC_PROCESS) #define WINDOWP(x) PSEUDOVECTORP (x, PVEC_WINDOW) +#define TERMINALP(x) PSEUDOVECTORP (x, PVEC_TERMINAL) #define SUBRP(x) PSEUDOVECTORP (x, PVEC_SUBR) #define COMPILEDP(x) PSEUDOVECTORP (x, PVEC_COMPILED) #define BUFFERP(x) PSEUDOVECTORP (x, PVEC_BUFFER) @@ -1628,30 +1624,33 @@ typedef unsigned char UCHAR; followed by the address of a vector of Lisp_Objects which contains the argument values. UNEVALLED means pass the list of unevaluated arguments - `prompt' says how to read arguments for an interactive call. - See the doc string for `interactive'. + `intspec' says how interactive arguments are to be fetched. + If the string starts with a `(', `intspec' is evaluated and the resulting + list is the list of arguments. + If it's a string that doesn't start with `(', the value should follow + the one of the doc string for `interactive'. A null string means call interactively with no arguments. `doc' is documentation for the user. */ #if (!defined (__STDC__) && !defined (PROTOTYPES)) \ || defined (USE_NONANSI_DEFUN) -#define DEFUN(lname, fnname, sname, minargs, maxargs, prompt, doc) \ +#define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc) \ Lisp_Object fnname (); \ DECL_ALIGN (struct Lisp_Subr, sname) = \ { PVEC_SUBR | (sizeof (struct Lisp_Subr) / sizeof (EMACS_INT)), \ - fnname, minargs, maxargs, lname, prompt, 0}; \ + fnname, minargs, maxargs, lname, intspec, 0}; \ Lisp_Object fnname #else /* This version of DEFUN declares a function prototype with the right arguments, so we can catch errors with maxargs at compile-time. */ -#define DEFUN(lname, fnname, sname, minargs, maxargs, prompt, doc) \ +#define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc) \ Lisp_Object fnname DEFUN_ARGS_ ## maxargs ; \ DECL_ALIGN (struct Lisp_Subr, sname) = \ { PVEC_SUBR | (sizeof (struct Lisp_Subr) / sizeof (EMACS_INT)), \ - fnname, minargs, maxargs, lname, prompt, 0}; \ + fnname, minargs, maxargs, lname, intspec, 0}; \ Lisp_Object fnname /* Note that the weird token-substitution semantics of ANSI C makes @@ -1692,7 +1691,6 @@ extern void defvar_lisp P_ ((char *, Lisp_Object *)); extern void defvar_lisp_nopro P_ ((char *, Lisp_Object *)); extern void defvar_bool P_ ((char *, int *)); extern void defvar_int P_ ((char *, EMACS_INT *)); -extern void defvar_per_buffer P_ ((char *, Lisp_Object *, Lisp_Object, char *)); extern void defvar_kboard P_ ((char *, int)); /* Macros we use to define forwarded Lisp variables. @@ -1703,15 +1701,6 @@ extern void defvar_kboard P_ ((char *, int)); #define DEFVAR_BOOL(lname, vname, doc) defvar_bool (lname, vname) #define DEFVAR_INT(lname, vname, doc) defvar_int (lname, vname) -/* TYPE is nil for a general Lisp variable. - An integer specifies a type; then only LIsp values - with that type code are allowed (except that nil is allowed too). - LNAME is the LIsp-level variable name. - VNAME is the name of the buffer slot. - DOC is a dummy where you write the doc string as a comment. */ -#define DEFVAR_PER_BUFFER(lname, vname, type, doc) \ - defvar_per_buffer (lname, vname, type, 0) - #define DEFVAR_KBOARD(lname, vname, doc) \ defvar_kboard (lname, \ (int)((char *)(¤t_kboard->vname) \ @@ -2558,6 +2547,7 @@ extern struct Lisp_Hash_Table *allocate_hash_table P_ ((void)); extern struct window *allocate_window P_ ((void)); extern struct frame *allocate_frame P_ ((void)); extern struct Lisp_Process *allocate_process P_ ((void)); +extern struct terminal *allocate_terminal P_ ((void)); extern int gc_in_progress; extern int abort_on_gc; extern Lisp_Object make_float P_ ((double)); @@ -2979,6 +2969,10 @@ extern Lisp_Object Qvertical_scroll_bar; extern void discard_mouse_events P_ ((void)); EXFUN (Fevent_convert_list, 1); EXFUN (Fread_key_sequence, 5); +EXFUN (Fset_input_interrupt_mode, 1); +EXFUN (Fset_output_flow_control, 2); +EXFUN (Fset_input_meta_mode, 2); +EXFUN (Fset_quit_char, 1); EXFUN (Fset_input_mode, 4); extern int detect_input_pending P_ ((void)); extern int detect_input_pending_ignore_squeezables P_ ((void)); @@ -2992,6 +2986,7 @@ extern void init_keyboard P_ ((void)); extern void syms_of_keyboard P_ ((void)); extern void keys_of_keyboard P_ ((void)); extern char *push_key_description P_ ((unsigned int, char *, int)); +extern void add_user_signal P_ ((int sig, const char *name)); /* defined in indent.c */ @@ -3034,6 +3029,7 @@ EXFUN (Fvisible_frame_list, 0); EXFUN (Fframe_parameter, 2); EXFUN (Fframe_parameters, 1); EXFUN (Fmodify_frame_parameters, 2); +EXFUN (Fframe_with_environment, 1); EXFUN (Fset_frame_height, 3); EXFUN (Fset_frame_width, 3); EXFUN (Fset_frame_size, 3); @@ -3102,7 +3098,7 @@ EXFUN (Fcall_process, MANY); extern int child_setup P_ ((int, int, int, char **, int, Lisp_Object)); extern void init_callproc_1 P_ ((void)); extern void init_callproc P_ ((void)); -extern void set_process_environment P_ ((void)); +extern void set_initial_environment P_ ((void)); extern void syms_of_callproc P_ ((void)); /* defined in doc.c */ @@ -3165,28 +3161,31 @@ EXFUN (Fx_popup_menu, 2); EXFUN (Fx_popup_dialog, 3); extern void syms_of_xmenu P_ ((void)); +/* defined in termchar.h */ +struct tty_display_info; + +/* defined in termhooks.h */ +struct terminal; + /* defined in sysdep.c */ #ifndef HAVE_GET_CURRENT_DIR_NAME extern char *get_current_dir_name P_ ((void)); #endif extern void stuff_char P_ ((char c)); extern void init_sigio P_ ((int)); -extern void request_sigio P_ ((void)); -extern void unrequest_sigio P_ ((void)); -extern void reset_sys_modes P_ ((void)); extern void sys_subshell P_ ((void)); extern void sys_suspend P_ ((void)); extern void discard_tty_input P_ ((void)); -extern void init_sys_modes P_ ((void)); -extern void get_frame_size P_ ((int *, int *)); +extern void init_sys_modes P_ ((struct tty_display_info *)); +extern void reset_sys_modes P_ ((struct tty_display_info *)); +extern void init_all_sys_modes P_ ((void)); +extern void reset_all_sys_modes P_ ((void)); extern void wait_for_termination P_ ((int)); extern void flush_pending_output P_ ((int)); extern void child_setup_tty P_ ((int)); extern void setup_pty P_ ((int)); extern int set_window_size P_ ((int, int, int)); extern void create_process P_ ((Lisp_Object, char **, Lisp_Object)); -extern int tabs_safe_p P_ ((void)); -extern void init_baud_rate P_ ((void)); extern int emacs_open P_ ((const char *, int, int)); extern int emacs_close P_ ((int)); extern int emacs_read P_ ((int, char *, unsigned int)); @@ -3222,6 +3221,9 @@ extern void syms_of_dired P_ ((void)); extern void syms_of_term P_ ((void)); extern void fatal () NO_RETURN; +/* Defined in terminal.c */ +extern void syms_of_terminal P_ ((void)); + #ifdef HAVE_WINDOW_SYSTEM /* Defined in fontset.c */ extern void syms_of_fontset P_ ((void)); @@ -3367,6 +3369,11 @@ extern Lisp_Object Vdirectory_sep_char; #define min(a, b) ((a) < (b) ? (a) : (b)) #define max(a, b) ((a) > (b) ? (a) : (b)) +/* Make sure we have abs defined */ +#if !defined(abs) +#define abs(x) ((x) < 0 ? -(x) : (x)) +#endif + /* Return a fixnum or float, depending on whether VAL fits in a Lisp fixnum. */ diff --git a/src/lread.c b/src/lread.c index 6bec084c5c6..bccdf28b059 100644 --- a/src/lread.c +++ b/src/lread.c @@ -27,6 +27,7 @@ Boston, MA 02110-1301, USA. */ #include <sys/stat.h> #include <sys/file.h> #include <errno.h> +#include <setjmp.h> #include "lisp.h" #include "intervals.h" #include "buffer.h" @@ -36,6 +37,7 @@ Boston, MA 02110-1301, USA. */ #include <epaths.h> #include "commands.h" #include "keyboard.h" +#include "frame.h" #include "termhooks.h" #include "coding.h" #include "blockinput.h" @@ -627,8 +629,6 @@ static void substitute_in_interval P_ ((INTERVAL, Lisp_Object)); /* Get a character from the tty. */ -extern Lisp_Object read_char (); - /* Read input events until we get one that's acceptable for our purposes. If NO_SWITCH_FRAME is non-zero, switch-frame events are stashed @@ -680,10 +680,12 @@ read_filtered_event (no_switch_frame, ascii_required, error_nonascii, EMACS_ADD_TIME (end_time, end_time, wait_time); } - /* Read until we get an acceptable event. */ +/* Read until we get an acceptable event. */ retry: - val = read_char (0, 0, 0, (input_method ? Qnil : Qt), 0, - NUMBERP (seconds) ? &end_time : NULL); + do + val = read_char (0, 0, 0, (input_method ? Qnil : Qt), 0, + NUMBERP (seconds) ? &end_time : NULL); + while (INTEGERP (val) && XINT (val) == -2); /* wrong_kboard_jmpbuf */ if (BUFFERP (val)) goto retry; @@ -824,7 +826,7 @@ DEFUN ("get-file-char", Fget_file_char, Sget_file_char, 0, 0, 0, /* Value is a version number of byte compiled code if the file - asswociated with file descriptor FD is a compiled Lisp file that's + associated with file descriptor FD is a compiled Lisp file that's safe to load. Only files compiled with Emacs are safe to load. Files compiled with XEmacs can lead to a crash in Fbyte_code because of an incompatible change in the byte compiler. */ @@ -890,7 +892,7 @@ load_warn_old_style_backquotes (file) if (!NILP (Vold_style_backquotes)) { Lisp_Object args[2]; - args[0] = build_string ("!! File %s uses old-style backquotes !!"); + args[0] = build_string ("Loading `%s': old-style backquotes detected!"); args[1] = file; Fmessage (2, args); } @@ -923,7 +925,7 @@ DEFUN ("load", Fload, Sload, 1, 5, 0, doc: /* Execute a file of Lisp code named FILE. First try FILE with `.elc' appended, then try with `.el', then try FILE unmodified (the exact suffixes in the exact order are -determined by `load-suffixes'). Environment variable references in +determined by `load-suffixes'). Environment variable references in FILE are replaced with their values by calling `substitute-in-file-name'. This function searches the directories in `load-path'. @@ -1098,7 +1100,7 @@ Return t if the file exists and loads successfully. */) version = -1; - /* Check fore the presence of old-style quotes and warn about them. */ + /* Check for the presence of old-style quotes and warn about them. */ specbind (Qold_style_backquotes, Qnil); record_unwind_protect (load_warn_old_style_backquotes, file); @@ -2832,7 +2834,7 @@ read1 (readcharfun, pch, first_in_list) } default: default_label: - if (c <= 040) goto retry; + if (c <= 040) goto retry; if (c == 0x8a0) /* NBSP */ goto retry; { @@ -3802,6 +3804,7 @@ defsubr (sname) { Lisp_Object sym; sym = intern (sname->symbol_name); + XSETPVECTYPE (sname, PVEC_SUBR); XSETSUBR (XSYMBOL (sym)->function, sname); } @@ -3876,37 +3879,6 @@ defvar_lisp (namestring, address) staticpro (address); } -/* Similar but define a variable whose value is the Lisp Object stored in - the current buffer. address is the address of the slot in the buffer - that is current now. */ - -void -defvar_per_buffer (namestring, address, type, doc) - char *namestring; - Lisp_Object *address; - Lisp_Object type; - char *doc; -{ - Lisp_Object sym, val; - int offset; - - sym = intern (namestring); - val = allocate_misc (); - offset = (char *)address - (char *)current_buffer; - - XMISCTYPE (val) = Lisp_Misc_Buffer_Objfwd; - XBUFFER_OBJFWD (val)->offset = offset; - SET_SYMBOL_VALUE (sym, val); - PER_BUFFER_SYMBOL (offset) = sym; - PER_BUFFER_TYPE (offset) = type; - - if (PER_BUFFER_IDX (offset) == 0) - /* Did a DEFVAR_PER_BUFFER without initializing the corresponding - slot of buffer_local_flags */ - abort (); -} - - /* Similar but define a variable whose value is the Lisp Object stored at a particular offset in the current kboard object. */ @@ -4003,7 +3975,7 @@ init_lread () Vload_path = Fcons (tem, Vload_path); } - /* Add site-list under the installation dir, if it exists. */ + /* Add site-lisp under the installation dir, if it exists. */ tem = Fexpand_file_name (build_string ("site-lisp"), Vinstallation_directory); tem1 = Ffile_exists_p (tem); @@ -4063,7 +4035,7 @@ init_lread () /* NORMAL refers to the lisp dir in the source directory. */ /* We used to add ../lisp at the front here, but that caused trouble because it was copied from dump_path - into Vload_path, aboe, when Vinstallation_directory was non-nil. + into Vload_path, above, when Vinstallation_directory was non-nil. It should be unnecessary. */ Vload_path = decode_env_path (0, normal); dump_path = Vload_path; @@ -4122,7 +4094,7 @@ init_lread () } /* Print a warning, using format string FORMAT, that directory DIRNAME - does not exist. Print it on stderr and put it in *Message*. */ + does not exist. Print it on stderr and put it in *Messages*. */ void dir_warning (format, dirname) diff --git a/src/m/ibms390x.h b/src/m/ibms390x.h index 64ede365d0c..0dafe59000b 100644 --- a/src/m/ibms390x.h +++ b/src/m/ibms390x.h @@ -22,7 +22,7 @@ Boston, MA 02110-1301, USA. */ into ibms390.h. */ -/* The following line tells the configuration script what sort of +/* The following line tells the configuration script what sort of operating system this machine is likely to run. USUAL-OPSYS="<name of system .h file here, without the s- or .h>" @@ -97,14 +97,10 @@ NOTE-END */ #define VIRT_ADDR_VARIES -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ +/* Define HAVE_ALLOCA to say that the system provides a properly + working alloca function and it should be used. Undefine it if an + assembler-language alloca in the file alloca.s should be used. */ -#undef C_ALLOCA #define HAVE_ALLOCA /* Define NO_REMAP if memory segmentation makes it not work well @@ -144,11 +140,6 @@ NOTE-END */ #define VALBITS 60 -/* This definition of MARKBIT is necessary because of the comparison of - ARRAY_MARK_FLAG and MARKBIT in an #if in lisp.h, which cpp doesn't like. */ - -#define MARKBIT 0x8000000000000000L - #define LINKER $(CC) -nostdlib /* Define XINT and XUINT so that they can take arguments of type int */ diff --git a/src/m/sh3el.h b/src/m/sh3el.h index eefcccea6de..77f6dc12c23 100644 --- a/src/m/sh3el.h +++ b/src/m/sh3el.h @@ -19,7 +19,7 @@ the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* The following line tells the configuration script what sort of +/* The following line tells the configuration script what sort of operating system this machine is likely to run. USUAL-OPSYS="<name of system .h file here, without the s- or .h>" */ @@ -79,14 +79,11 @@ Boston, MA 02111-1307, USA. */ #define VIRT_ADDR_VARIES -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly +/* Define HAVE_ALLOCA to say that the system provides a properly working alloca function and it should be used. - Define neither one if an assembler-language alloca + Undefine it if an assembler-language alloca in the file alloca.s should be used. */ -/* #define C_ALLOCA */ #define HAVE_ALLOCA /* Define NO_REMAP if memory segmentation makes it not work well diff --git a/src/macfns.c b/src/macfns.c index 2cfdc9f17c6..71eae699f9a 100644 --- a/src/macfns.c +++ b/src/macfns.c @@ -107,7 +107,6 @@ extern Lisp_Object Vwindow_system_version; int image_cache_refcount, dpyinfo_refcount; #endif - #if 0 /* Use xstricmp instead. */ /* compare two strings ignoring case */ @@ -1367,11 +1366,11 @@ x_set_mouse_color (f, arg, oldval) Cursor cursor, nontext_cursor, mode_cursor, hand_cursor; Cursor hourglass_cursor, horizontal_drag_cursor; unsigned long pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f)); - unsigned long mask_color = x->background_pixel; + unsigned long mask_color = FRAME_BACKGROUND_PIXEL (f); /* Don't let pointers be invisible. */ if (mask_color == pixel) - pixel = x->foreground_pixel; + pixel = FRAME_FOREGROUND_PIXEL (f); f->output_data.mac->mouse_pixel = pixel; @@ -1444,7 +1443,7 @@ x_set_mouse_color (f, arg, oldval) BLOCK_INPUT; if (FRAME_MAC_WINDOW (f) != 0) - rif->define_frame_cursor (f, cursor); + FRAME_TERMINAL (f)->rif->define_frame_cursor (f, cursor); f->output_data.mac->text_cursor = cursor; f->output_data.mac->nontext_cursor = nontext_cursor; @@ -1724,10 +1723,8 @@ x_set_tool_bar_lines (f, value, oldval) below the menu bar. */ if (FRAME_MAC_WINDOW (f) && FRAME_TOOL_BAR_LINES (f) == 0) { - updating_frame = f; - clear_frame (); + clear_frame (f); clear_current_matrices (f); - updating_frame = NULL; } /* If the tool bar gets smaller, the internal border below it @@ -2253,8 +2250,10 @@ XParseGeometry (string, x, y, width, height) /* Create and set up the Mac window for frame F. */ static void -mac_window (f) +mac_window (f, window_prompting, minibuffer_only) struct frame *f; + long window_prompting; + int minibuffer_only; { Rect r; @@ -2427,8 +2426,8 @@ x_make_gc (f) = (XCreatePixmapFromBitmapData (FRAME_X_DISPLAY (f), FRAME_X_DISPLAY_INFO (f)->root_window, gray_bits, gray_width, gray_height, - f->output_data.x->foreground_pixel, - f->output_data.x->background_pixel, + FRAME_FOREGROUND_PIXEL (f), + FRAME_BACKGROUND_PIXEL (f), DefaultDepth (FRAME_X_DISPLAY (f), FRAME_X_SCREEN_NUMBER (f)))); #endif @@ -2523,15 +2522,15 @@ DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame, 1, 1, 0, doc: /* Make a new window, which is called a "frame" in Emacs terms. Returns an Emacs frame object. -ALIST is an alist of frame parameters. +PARAMETERS is an alist of frame parameters. If the parameters specify that the frame should not have a minibuffer, and do not specify a specific minibuffer window to use, then `default-minibuffer-frame' must be a frame whose minibuffer can be shared by the new frame. This function is an internal primitive--use `make-frame' instead. */) - (parms) - Lisp_Object parms; + (parameters) + Lisp_Object parameters; { struct frame *f; Lisp_Object frame, tem; @@ -2548,23 +2547,21 @@ This function is an internal primitive--use `make-frame' instead. */) check_mac (); - parms = Fcopy_alist (parms); - /* Use this general default value to start with until we know if this frame has a specified name. */ Vx_resource_name = Vinvocation_name; - display = mac_get_arg (parms, Qdisplay, 0, 0, RES_TYPE_STRING); + display = mac_get_arg (parameters, Qdisplay, 0, 0, RES_TYPE_STRING); if (EQ (display, Qunbound)) display = Qnil; dpyinfo = check_x_display_info (display); #ifdef MULTI_KBOARD - kb = dpyinfo->kboard; + kb = dpyinfo->terminal->kboard; #else kb = &the_only_kboard; #endif - name = mac_get_arg (parms, Qname, "name", "Name", RES_TYPE_STRING); + name = mac_get_arg (parameters, Qname, "name", "Name", RES_TYPE_STRING); if (!STRINGP (name) && ! EQ (name, Qunbound) && ! NILP (name)) @@ -2574,7 +2571,7 @@ This function is an internal primitive--use `make-frame' instead. */) Vx_resource_name = name; /* See if parent window is specified. */ - parent = mac_get_arg (parms, Qparent_id, NULL, NULL, RES_TYPE_NUMBER); + parent = mac_get_arg (parameters, Qparent_id, NULL, NULL, RES_TYPE_NUMBER); if (EQ (parent, Qunbound)) parent = Qnil; if (! NILP (parent)) @@ -2584,8 +2581,8 @@ This function is an internal primitive--use `make-frame' instead. */) /* No need to protect DISPLAY because that's not used after passing it to make_frame_without_minibuffer. */ frame = Qnil; - GCPRO4 (parms, parent, name, frame); - tem = mac_get_arg (parms, Qminibuffer, "minibuffer", "Minibuffer", + GCPRO4 (parameters, parent, name, frame); + tem = mac_get_arg (parameters, Qminibuffer, "minibuffer", "Minibuffer", RES_TYPE_SYMBOL); if (EQ (tem, Qnone) || NILP (tem)) f = make_frame_without_minibuffer (Qnil, kb, display); @@ -2604,20 +2601,24 @@ This function is an internal primitive--use `make-frame' instead. */) /* Note that X Windows does support scroll bars. */ FRAME_CAN_HAVE_SCROLL_BARS (f) = 1; + f->terminal = dpyinfo->terminal; + f->terminal->reference_count++; + f->output_method = output_mac; f->output_data.mac = (struct mac_output *) xmalloc (sizeof (struct mac_output)); bzero (f->output_data.mac, sizeof (struct mac_output)); FRAME_FONTSET (f) = -1; + record_unwind_protect (unwind_create_frame, frame); f->icon_name - = mac_get_arg (parms, Qicon_name, "iconName", "Title", RES_TYPE_STRING); + = mac_get_arg (parameters, Qicon_name, "iconName", "Title", RES_TYPE_STRING); if (! STRINGP (f->icon_name)) f->icon_name = Qnil; -/* FRAME_MAC_DISPLAY_INFO (f) = dpyinfo; */ + /* XXX Is this needed? */ + /*FRAME_MAC_DISPLAY_INFO (f) = dpyinfo;*/ /* With FRAME_MAC_DISPLAY_INFO set up, this unwind-protect is safe. */ - record_unwind_protect (unwind_create_frame, frame); #if GLYPH_DEBUG image_cache_refcount = FRAME_X_IMAGE_CACHE (f)->refcount; dpyinfo_refcount = dpyinfo->reference_count; @@ -2659,7 +2660,7 @@ This function is an internal primitive--use `make-frame' instead. */) { Lisp_Object font; - font = mac_get_arg (parms, Qfont, "font", "Font", RES_TYPE_STRING); + font = mac_get_arg (parameters, Qfont, "font", "Font", RES_TYPE_STRING); BLOCK_INPUT; /* First, try whatever font the caller has specified. */ @@ -2671,7 +2672,6 @@ This function is an internal primitive--use `make-frame' instead. */) else font = x_new_font (f, SDATA (font)); } - /* Try out a font which we hope has bold and italic variations. */ #if USE_ATSUI if (! STRINGP (font)) @@ -2690,48 +2690,50 @@ This function is an internal primitive--use `make-frame' instead. */) error ("Cannot find any usable font"); UNBLOCK_INPUT; - x_set_frame_parameters (f, Fcons (Fcons (Qfont, font), Qnil)); + x_default_parameter (f, parameters, Qfont, font, + "font", "Font", RES_TYPE_STRING); } - x_default_parameter (f, parms, Qborder_width, make_number (0), + /* XXX Shouldn't this be borderWidth, not borderwidth ?*/ + x_default_parameter (f, parameters, Qborder_width, make_number (0), "borderwidth", "BorderWidth", RES_TYPE_NUMBER); /* This defaults to 2 in order to match xterm. We recognize either internalBorderWidth or internalBorder (which is what xterm calls it). */ - if (NILP (Fassq (Qinternal_border_width, parms))) + if (NILP (Fassq (Qinternal_border_width, parameters))) { Lisp_Object value; - value = mac_get_arg (parms, Qinternal_border_width, + value = mac_get_arg (parameters, Qinternal_border_width, "internalBorder", "InternalBorder", RES_TYPE_NUMBER); if (! EQ (value, Qunbound)) - parms = Fcons (Fcons (Qinternal_border_width, value), - parms); + parameters = Fcons (Fcons (Qinternal_border_width, value), + parameters); } /* Default internalBorderWidth to 0 on Windows to match other programs. */ - x_default_parameter (f, parms, Qinternal_border_width, make_number (0), + x_default_parameter (f, parameters, Qinternal_border_width, make_number (0), "internalBorderWidth", "InternalBorder", RES_TYPE_NUMBER); - x_default_parameter (f, parms, Qvertical_scroll_bars, Qright, + x_default_parameter (f, parameters, Qvertical_scroll_bars, Qright, "verticalScrollBars", "ScrollBars", RES_TYPE_SYMBOL); /* Also do the stuff which must be set before the window exists. */ - x_default_parameter (f, parms, Qforeground_color, build_string ("black"), + x_default_parameter (f, parameters, Qforeground_color, build_string ("black"), "foreground", "Foreground", RES_TYPE_STRING); - x_default_parameter (f, parms, Qbackground_color, build_string ("white"), + x_default_parameter (f, parameters, Qbackground_color, build_string ("white"), "background", "Background", RES_TYPE_STRING); - x_default_parameter (f, parms, Qmouse_color, build_string ("black"), + x_default_parameter (f, parameters, Qmouse_color, build_string ("black"), "pointerColor", "Foreground", RES_TYPE_STRING); - x_default_parameter (f, parms, Qcursor_color, build_string ("black"), + x_default_parameter (f, parameters, Qcursor_color, build_string ("black"), "cursorColor", "Foreground", RES_TYPE_STRING); - x_default_parameter (f, parms, Qborder_color, build_string ("black"), + x_default_parameter (f, parameters, Qborder_color, build_string ("black"), "borderColor", "BorderColor", RES_TYPE_STRING); - x_default_parameter (f, parms, Qscreen_gamma, Qnil, + x_default_parameter (f, parameters, Qscreen_gamma, Qnil, "screenGamma", "ScreenGamma", RES_TYPE_FLOAT); - x_default_parameter (f, parms, Qline_spacing, Qnil, + x_default_parameter (f, parameters, Qline_spacing, Qnil, "lineSpacing", "LineSpacing", RES_TYPE_NUMBER); - x_default_parameter (f, parms, Qleft_fringe, Qnil, + x_default_parameter (f, parameters, Qleft_fringe, Qnil, "leftFringe", "LeftFringe", RES_TYPE_NUMBER); - x_default_parameter (f, parms, Qright_fringe, Qnil, + x_default_parameter (f, parameters, Qright_fringe, Qnil, "rightFringe", "RightFringe", RES_TYPE_NUMBER); @@ -2743,29 +2745,29 @@ This function is an internal primitive--use `make-frame' instead. */) happen. */ init_frame_faces (f); - x_default_parameter (f, parms, Qmenu_bar_lines, make_number (1), + x_default_parameter (f, parameters, Qmenu_bar_lines, make_number (1), "menuBar", "MenuBar", RES_TYPE_NUMBER); - x_default_parameter (f, parms, Qtool_bar_lines, make_number (1), - "toolBar", "ToolBar", RES_TYPE_NUMBER); - x_default_parameter (f, parms, Qbuffer_predicate, Qnil, - "bufferPredicate", "BufferPredicate", - RES_TYPE_SYMBOL); - x_default_parameter (f, parms, Qtitle, Qnil, + x_default_parameter (f, parameters, Qtool_bar_lines, make_number (1), + "toolBar", "ToolBar", RES_TYPE_NUMBER); + + x_default_parameter (f, parameters, Qbuffer_predicate, Qnil, + "bufferPredicate", "BufferPredicate", RES_TYPE_SYMBOL); + x_default_parameter (f, parameters, Qtitle, Qnil, "title", "Title", RES_TYPE_STRING); - x_default_parameter (f, parms, Qfullscreen, Qnil, + x_default_parameter (f, parameters, Qfullscreen, Qnil, "fullscreen", "Fullscreen", RES_TYPE_SYMBOL); f->output_data.mac->parent_desc = FRAME_MAC_DISPLAY_INFO (f)->root_window; /* Compute the size of the window. */ - window_prompting = x_figure_window_size (f, parms, 1); + window_prompting = x_figure_window_size (f, parameters, 1); - tem = mac_get_arg (parms, Qunsplittable, 0, 0, RES_TYPE_BOOLEAN); + tem = mac_get_arg (parameters, Qunsplittable, 0, 0, RES_TYPE_BOOLEAN); f->no_split = minibuffer_only || EQ (tem, Qt); - mac_window (f); + mac_window (f, window_prompting, minibuffer_only); + x_icon (f, parameters); - x_icon (f, parms); x_make_gc (f); /* Now consider the frame official. */ @@ -2774,18 +2776,17 @@ This function is an internal primitive--use `make-frame' instead. */) /* We need to do this after creating the window, so that the icon-creation functions can say whose icon they're describing. */ - x_default_parameter (f, parms, Qicon_type, Qnil, + x_default_parameter (f, parameters, Qicon_type, Qnil, "bitmapIcon", "BitmapIcon", RES_TYPE_SYMBOL); - x_default_parameter (f, parms, Qauto_raise, Qnil, + x_default_parameter (f, parameters, Qauto_raise, Qnil, "autoRaise", "AutoRaiseLower", RES_TYPE_BOOLEAN); - x_default_parameter (f, parms, Qauto_lower, Qnil, + x_default_parameter (f, parameters, Qauto_lower, Qnil, "autoLower", "AutoRaiseLower", RES_TYPE_BOOLEAN); - x_default_parameter (f, parms, Qcursor_type, Qbox, + x_default_parameter (f, parameters, Qcursor_type, Qbox, "cursorType", "CursorType", RES_TYPE_SYMBOL); - x_default_parameter (f, parms, Qscroll_bar_width, Qnil, - "scrollBarWidth", "ScrollBarWidth", - RES_TYPE_NUMBER); + x_default_parameter (f, parameters, Qscroll_bar_width, Qnil, + "scrollBarWidth", "ScrollBarWidth", RES_TYPE_NUMBER); /* Dimensions, especially FRAME_LINES (f), must be done via change_frame_size. Change will not be effected unless different from the current @@ -2793,8 +2794,8 @@ This function is an internal primitive--use `make-frame' instead. */) width = FRAME_COLS (f); height = FRAME_LINES (f); - SET_FRAME_COLS (f, 0); FRAME_LINES (f) = 0; + SET_FRAME_COLS (f, 0); change_frame_size (f, height, width, 1, 0, 0); /* Tell the server what size and position, etc, we want, and how @@ -2811,7 +2812,7 @@ This function is an internal primitive--use `make-frame' instead. */) { Lisp_Object visibility; - visibility = mac_get_arg (parms, Qvisibility, 0, 0, RES_TYPE_SYMBOL); + visibility = mac_get_arg (parameters, Qvisibility, 0, 0, RES_TYPE_SYMBOL); if (EQ (visibility, Qunbound)) visibility = Qt; @@ -2833,10 +2834,12 @@ This function is an internal primitive--use `make-frame' instead. */) /* All remaining specified parameters, which have not been "used" by x_get_arg and friends, now go in the misc. alist of the frame. */ - for (tem = parms; !NILP (tem); tem = XCDR (tem)) + for (tem = parameters; !NILP (tem); tem = XCDR (tem)) if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem)))) f->param_alist = Fcons (XCAR (tem), f->param_alist); + store_frame_param (f, Qwindow_system, Qmac); + UNGCPRO; /* Make sure windows on this frame appear in calls to next-window @@ -3299,9 +3302,6 @@ x_display_info_for_name (name) CHECK_STRING (name); - if (! EQ (Vwindow_system, intern ("mac"))) - error ("Not using Mac native windows"); - for (dpyinfo = &one_mac_display_info, names = x_display_name_list; dpyinfo; dpyinfo = dpyinfo->next, names = XCDR (names)) @@ -3346,9 +3346,6 @@ terminate Emacs if we can't open the connection. */) if (! NILP (xrm_string)) CHECK_STRING (xrm_string); - if (! EQ (Vwindow_system, intern ("mac"))) - error ("Not using Mac native windows"); - if (! NILP (xrm_string)) xrm_option = (unsigned char *) SDATA (xrm_string); else @@ -3611,10 +3608,6 @@ start_hourglass () EMACS_TIME delay; int secs, usecs = 0; - /* Don't bother for ttys. */ - if (NILP (Vwindow_system)) - return; - cancel_hourglass (); if (INTEGERP (Vhourglass_delay) @@ -3827,7 +3820,7 @@ x_create_tip_frame (dpyinfo, parms, text) parms = Fcopy_alist (parms); #ifdef MULTI_KBOARD - kb = dpyinfo->kboard; + kb = dpyinfo->terminal->kboard; #else kb = &the_only_kboard; #endif diff --git a/src/macmenu.c b/src/macmenu.c index 883a8463c2d..8305c89ee68 100644 --- a/src/macmenu.c +++ b/src/macmenu.c @@ -26,10 +26,10 @@ Boston, MA 02110-1301, USA. */ #include <stdio.h> #include "lisp.h" +#include "frame.h" #include "termhooks.h" #include "keyboard.h" #include "keymap.h" -#include "frame.h" #include "window.h" #include "blockinput.h" #include "buffer.h" @@ -720,8 +720,8 @@ no quit occurs and `x-popup-menu' returns nil. */) enum scroll_bar_part part; unsigned long time; - if (mouse_position_hook) - (*mouse_position_hook) (&new_f, 1, &bar_window, + if (FRAME_TERMINAL (new_f)->mouse_position_hook) + (*FRAME_TERMINAL (new_f)->mouse_position_hook) (&new_f, 1, &bar_window, &part, &x, &y, &time); if (new_f != 0) XSETFRAME (window, new_f); diff --git a/src/macterm.c b/src/macterm.c index 734bf52e180..ed7411615f5 100644 --- a/src/macterm.c +++ b/src/macterm.c @@ -228,14 +228,14 @@ void x_raise_frame P_ ((struct frame *)); void x_set_window_size P_ ((struct frame *, int, int, int)); void x_wm_set_window_state P_ ((struct frame *, int)); void x_wm_set_icon_pixmap P_ ((struct frame *, int)); -void mac_initialize P_ ((void)); +static void mac_initialize P_ ((void)); static void x_font_min_bounds P_ ((XFontStruct *, int *, int *)); static int x_compute_min_glyph_bounds P_ ((struct frame *)); static void x_update_end P_ ((struct frame *)); static void XTframe_up_to_date P_ ((struct frame *)); -static void XTset_terminal_modes P_ ((void)); -static void XTreset_terminal_modes P_ ((void)); -static void x_clear_frame P_ ((void)); +static void XTset_terminal_modes P_ ((struct terminal *)); +static void XTreset_terminal_modes P_ ((struct terminal *)); +static void x_clear_frame P_ ((struct frame *)); static void frame_highlight P_ ((struct frame *)); static void frame_unhighlight P_ ((struct frame *)); static void x_new_focus_frame P_ ((struct x_display_info *, struct frame *)); @@ -263,6 +263,8 @@ static void x_scroll_bar_report_motion P_ ((struct frame **, Lisp_Object *, static int is_emacs_window P_ ((WindowRef)); static XCharStruct *mac_per_char_metric P_ ((XFontStruct *, XChar2b *, int)); static void XSetFont P_ ((Display *, GC, XFontStruct *)); +static struct terminal *mac_create_terminal P_ ((struct mac_display_info *dpyinfo)); + #define GC_FORE_COLOR(gc) (&(gc)->fore_color) #define GC_BACK_COLOR(gc) (&(gc)->back_color) @@ -2360,6 +2362,9 @@ mac_define_fringe_bitmap (which, bits, h, wd) for (i = 0; i < h; i++) bits[i] = ~bits[i]; + + BLOCK_INPUT; + provider = CGDataProviderCreateWithData (NULL, bits, sizeof (unsigned short) * h, NULL); if (provider) @@ -2369,6 +2374,8 @@ mac_define_fringe_bitmap (which, bits, h, wd) provider, NULL, 0); CGDataProviderRelease (provider); } + + UNBLOCK_INPUT; } static void @@ -2379,7 +2386,11 @@ mac_destroy_fringe_bitmap (which) return; if (fringe_bmp[which]) - CGImageRelease (fringe_bmp[which]); + { + BLOCK_INPUT; + CGImageRelease (fringe_bmp[which]); + UNBLOCK_INPUT; + } fringe_bmp[which] = 0; } #endif @@ -2391,7 +2402,7 @@ mac_destroy_fringe_bitmap (which) rarely happens). */ static void -XTset_terminal_modes () +XTset_terminal_modes (struct terminal *t) { } @@ -2399,7 +2410,7 @@ XTset_terminal_modes () the windows go away, and suspending requires no action. */ static void -XTreset_terminal_modes () +XTreset_terminal_modes (struct terminal *t) { } @@ -4049,15 +4060,8 @@ x_delete_glyphs (n) frame. Otherwise clear the selected frame. */ static void -x_clear_frame () +x_clear_frame (struct frame *f) { - struct frame *f; - - if (updating_frame) - f = updating_frame; - else - f = SELECTED_FRAME (); - /* Clearing the frame will erase any cursor, so mark them all as no longer visible. */ mark_window_cursors_off (XWINDOW (FRAME_ROOT_WINDOW (f))); @@ -4575,7 +4579,7 @@ note_mouse_movement (frame, pos) clear_mouse_face (dpyinfo); dpyinfo->mouse_face_mouse_frame = 0; if (!dpyinfo->grabbed) - rif->define_frame_cursor (frame, + FRAME_RIF (frame)->define_frame_cursor (frame, frame->output_data.mac->nontext_cursor); } @@ -8781,7 +8785,7 @@ mac_load_query_font (f, fontname) font_id = atsu_find_font_from_family_name (family); if (font_id == kATSUInvalidFontID) - return; + return NULL; size_fixed = Long2Fix (size); bold_p = (fontface & bold) != 0; italic_p = (fontface & italic) != 0; @@ -12174,7 +12178,13 @@ XTread_socket (sd, expected, hold_quit) will be selected only when it is active. */ if (WINDOWP (window) && !EQ (window, last_window) - && !EQ (window, selected_window)) + && !EQ (window, selected_window) + /* For click-to-focus window managers + create event iff we don't leave the + selected frame. */ + && (focus_follows_mouse + || (EQ (XWINDOW (window)->frame, + XWINDOW (selected_window)->frame)))) { inev.kind = SELECT_WINDOW_EVENT; inev.frame_or_window = window; @@ -12552,6 +12562,7 @@ mac_term_init (display_name, xrm_option, resource_name) char *resource_name; { struct mac_display_info *dpyinfo; + struct terminal *terminal; BLOCK_INPUT; @@ -12567,6 +12578,13 @@ mac_term_init (display_name, xrm_option, resource_name) dpyinfo = &one_mac_display_info; bzero (dpyinfo, sizeof (*dpyinfo)); + terminal = mac_create_terminal (dpyinfo); + + /* Set the name of the terminal. */ + terminal->name = (char *) xmalloc (SBYTES (display_name) + 1); + strncpy (terminal->name, SDATA (display_name), SBYTES (display_name)); + terminal->name[SBYTES (display_name)] = 0; + #ifdef MAC_OSX dpyinfo->mac_id_name = (char *) xmalloc (SCHARS (Vinvocation_name) @@ -12608,6 +12626,10 @@ mac_term_init (display_name, xrm_option, resource_name) x_display_name_list); dpyinfo->name_list_element = XCAR (x_display_name_list); +#if USE_CG_DRAWING + mac_init_fringe (terminal->rif); +#endif + UNBLOCK_INPUT; return dpyinfo; @@ -12768,44 +12790,72 @@ static struct redisplay_interface x_redisplay_interface = mac_shift_glyphs_for_insert }; -void +static struct terminal * +mac_create_terminal (struct mac_display_info *dpyinfo) +{ + struct terminal *terminal; + + terminal = create_terminal (); + + terminal->type = output_mac; + terminal->display_info.mac = dpyinfo; + dpyinfo->terminal = terminal; + + terminal->clear_frame_hook = x_clear_frame; + terminal->ins_del_lines_hook = x_ins_del_lines; + terminal->delete_glyphs_hook = x_delete_glyphs; + terminal->ring_bell_hook = XTring_bell; + terminal->reset_terminal_modes_hook = XTreset_terminal_modes; + terminal->set_terminal_modes_hook = XTset_terminal_modes; + terminal->update_begin_hook = x_update_begin; + terminal->update_end_hook = x_update_end; + terminal->set_terminal_window_hook = XTset_terminal_window; + terminal->read_socket_hook = XTread_socket; + terminal->frame_up_to_date_hook = XTframe_up_to_date; + terminal->mouse_position_hook = XTmouse_position; + terminal->frame_rehighlight_hook = XTframe_rehighlight; + terminal->frame_raise_lower_hook = XTframe_raise_lower; + /* terminal->fullscreen_hook = XTfullscreen_hook; */ + terminal->set_vertical_scroll_bar_hook = XTset_vertical_scroll_bar; + terminal->condemn_scroll_bars_hook = XTcondemn_scroll_bars; + terminal->redeem_scroll_bar_hook = XTredeem_scroll_bar; + terminal->judge_scroll_bars_hook = XTjudge_scroll_bars; + terminal->delete_frame_hook = x_destroy_window; + /* terminal->delete_terminal_hook = x_delete_terminal; */ + + terminal->rif = &x_redisplay_interface; +#if 0 + TTY_SCROLL_REGION_OK (CURTTY ()) = 1; /* we'll scroll partial frames */ + TTY_CHAR_INS_DEL_OK (CURTTY ()) = 1; + TTY_LINE_INS_DEL_OK (CURTTY ()) = 1; /* we'll just blt 'em */ + TTY_FAST_CLEAR_END_OF_LINE (CURTTY ()) = 1; /* X does this well */ + TTY_MEMORY_BELOW_FRAME (CURTTY ()) = 0; /* we don't remember what + scrolls off the + bottom */ +#else + terminal->scroll_region_ok = 1; /* We'll scroll partial frames. */ + terminal->char_ins_del_ok = 1; + terminal->line_ins_del_ok = 1; /* We'll just blt 'em. */ + terminal->fast_clear_end_of_line = 1; /* X does this well. */ + terminal->memory_below_frame = 0; /* We don't remember what scrolls + off the bottom. */ + +#endif + + return terminal; +} + +static void mac_initialize () { - rif = &x_redisplay_interface; - - clear_frame_hook = x_clear_frame; - ins_del_lines_hook = x_ins_del_lines; - delete_glyphs_hook = x_delete_glyphs; - ring_bell_hook = XTring_bell; - reset_terminal_modes_hook = XTreset_terminal_modes; - set_terminal_modes_hook = XTset_terminal_modes; - update_begin_hook = x_update_begin; - update_end_hook = x_update_end; - set_terminal_window_hook = XTset_terminal_window; - read_socket_hook = XTread_socket; - frame_up_to_date_hook = XTframe_up_to_date; - mouse_position_hook = XTmouse_position; - frame_rehighlight_hook = XTframe_rehighlight; - frame_raise_lower_hook = XTframe_raise_lower; - - set_vertical_scroll_bar_hook = XTset_vertical_scroll_bar; - condemn_scroll_bars_hook = XTcondemn_scroll_bars; - redeem_scroll_bar_hook = XTredeem_scroll_bar; - judge_scroll_bars_hook = XTjudge_scroll_bars; - - scroll_region_ok = 1; /* we'll scroll partial frames */ - char_ins_del_ok = 1; - line_ins_del_ok = 1; /* we'll just blt 'em */ - fast_clear_end_of_line = 1; /* X does this well */ - memory_below_frame = 0; /* we don't remember what scrolls - off the bottom */ + baud_rate = 19200; last_tool_bar_item = -1; any_help_event_p = 0; /* Try to use interrupt input; if we can't, then start polling. */ - Fset_input_mode (Qt, Qnil, Qt, Qnil); + Fset_input_interrupt_mode (Qt); BLOCK_INPUT; @@ -12837,11 +12887,10 @@ mac_initialize () #if USE_CG_DRAWING init_cg_color (); - - mac_init_fringe (); #endif UNBLOCK_INPUT; + } diff --git a/src/macterm.h b/src/macterm.h index 8a85e714ab5..f319adeb659 100644 --- a/src/macterm.h +++ b/src/macterm.h @@ -64,6 +64,9 @@ struct mac_display_info /* Chain of all mac_display_info structures. */ struct mac_display_info *next; + /* The generic display parameters corresponding to this X display. */ + struct terminal *terminal; + /* This is a cons cell of the form (NAME . FONT-LIST-CACHE). The same cons cell also appears in x_display_name_list. */ Lisp_Object name_list_element; @@ -358,9 +361,6 @@ typedef struct mac_output mac_output; #define FRAME_MAC_WINDOW(f) ((f)->output_data.mac->window_desc) #define FRAME_X_WINDOW(f) ((f)->output_data.mac->window_desc) -#define FRAME_FOREGROUND_PIXEL(f) ((f)->output_data.x->foreground_pixel) -#define FRAME_BACKGROUND_PIXEL(f) ((f)->output_data.x->background_pixel) - #define FRAME_FONT(f) ((f)->output_data.mac->font) #define FRAME_FONTSET(f) ((f)->output_data.mac->fontset) @@ -636,7 +636,6 @@ extern void x_free_frame_resources P_ ((struct frame *)); extern void x_destroy_window P_ ((struct frame *)); extern void x_wm_set_size_hint P_ ((struct frame *, long, int)); extern void x_delete_display P_ ((struct x_display_info *)); -extern void mac_initialize P_ ((void)); extern Pixmap XCreatePixmap P_ ((Display *, WindowRef, unsigned int, unsigned int, unsigned int)); extern Pixmap XCreatePixmapFromBitmapData P_ ((Display *, WindowRef, char *, diff --git a/src/makefile.w32-in b/src/makefile.w32-in index df42d0a08d4..296c10c4208 100644 --- a/src/makefile.w32-in +++ b/src/makefile.w32-in @@ -125,7 +125,8 @@ OBJ1 = $(BLD)/abbrev.$(O) \ $(BLD)/ccl.$(O) \ $(BLD)/fontset.$(O) \ $(BLD)/fringe.$(O) \ - $(BLD)/image.$(O) + $(BLD)/image.$(O) \ + $(BLD)/terminal.$(O) WIN32OBJ = $(BLD)/w32term.$(O) \ @@ -156,6 +157,7 @@ LIBS = $(TLIB0) \ $(SHELL32) \ $(WINSPOOL) \ $(OLE32) \ + $(COMCTL32) \ $(libc) # @@ -393,6 +395,8 @@ $(BLD)/callproc.$(O) : \ $(SRC)/process.h \ $(SRC)/syssignal.h \ $(SRC)/systty.h \ + $(SRC)/frame.h \ + $(SRC)/termhooks.h \ $(SRC)/w32.h $(BLD)/casefiddle.$(O) : \ @@ -508,6 +512,8 @@ $(BLD)/coding.$(O) : \ $(SRC)/composite.h \ $(SRC)/dispextern.h \ $(SRC)/intervals.h \ + $(SRC)/frame.h \ + $(SRC)/termhooks.h \ $(SRC)/w32bdf.h \ $(SRC)/w32gui.h \ $(SRC)/window.h @@ -537,7 +543,8 @@ $(BLD)/data.$(O) : \ $(SRC)/frame.h \ $(SRC)/keyboard.h \ $(SRC)/puresize.h \ - $(SRC)/syssignal.h + $(SRC)/syssignal.h \ + $(SRC)/termhooks.h $(BLD)/dired.$(O) : \ $(SRC)/dired.c \ @@ -748,6 +755,7 @@ $(BLD)/fns.$(O) : \ $(SRC)/keymap.h \ $(SRC)/md5.h \ $(SRC)/systime.h \ + $(SRC)/termhooks.h \ $(SRC)/w32bdf.h \ $(SRC)/w32gui.h \ $(SRC)/window.h @@ -779,6 +787,7 @@ $(BLD)/fontset.$(O) : \ $(SRC)/fontset.h \ $(SRC)/frame.h \ $(SRC)/keyboard.h \ + $(SRC)/termhooks.h \ $(SRC)/w32bdf.h \ $(SRC)/w32gui.h \ $(SRC)/window.h @@ -799,6 +808,7 @@ $(BLD)/frame.$(O) : \ $(SRC)/frame.h \ $(SRC)/keyboard.h \ $(SRC)/systime.h \ + $(SRC)/termchar.h \ $(SRC)/termhooks.h \ $(SRC)/w32bdf.h \ $(SRC)/w32gui.h \ @@ -972,6 +982,7 @@ $(BLD)/lread.$(O) : \ $(EMACS_ROOT)/src/config.h \ $(EMACS_ROOT)/nt/inc/sys/file.h \ $(EMACS_ROOT)/src/epaths.h \ + $(SRC)/blockinput.h \ $(SRC)/buffer.h \ $(SRC)/ccl.h \ $(SRC)/character.h \ @@ -1029,6 +1040,7 @@ $(BLD)/minibuf.$(O) : \ $(SRC)/keyboard.h \ $(SRC)/keymap.h \ $(SRC)/syntax.h \ + $(SRC)/termhooks.h \ $(SRC)/w32bdf.h \ $(SRC)/w32gui.h \ $(SRC)/window.h @@ -1195,6 +1207,7 @@ $(BLD)/scroll.$(O) : \ $(SRC)/frame.h \ $(SRC)/keyboard.h \ $(SRC)/termchar.h \ + $(SRC)/termhooks.h \ $(SRC)/w32bdf.h \ $(SRC)/w32gui.h \ $(SRC)/window.h @@ -1263,6 +1276,7 @@ $(BLD)/sysdep.$(O) : \ $(EMACS_ROOT)/nt/inc/sys/file.h \ $(SRC)/atimer.h \ $(SRC)/blockinput.h \ + $(SRC)/cm.h \ $(SRC)/dispextern.h \ $(SRC)/frame.h \ $(SRC)/keyboard.h \ @@ -1309,6 +1323,18 @@ $(BLD)/termcap.$(O) : \ $(EMACS_ROOT)/src/config.h \ $(EMACS_ROOT)/nt/inc/sys/file.h +$(BLD)/terminal.$(O) : \ + $(SRC)/terminal.c \ + $(EMACS_ROOT)/src/s/ms-w32.h \ + $(EMACS_ROOT)/src/m/intel386.h \ + $(EMACS_ROOT)/src/config.h \ + $(SRC)/charset.h \ + $(SRC)/coding.h \ + $(SRC)/frame.h \ + $(SRC)/keyboard.h \ + $(SRC)/termchar.h \ + $(SRC)/termhooks.h + $(BLD)/textprop.$(O) : \ $(SRC)/textprop.c \ $(EMACS_ROOT)/src/s/ms-w32.h \ @@ -1426,6 +1452,8 @@ $(BLD)/xfaces.$(O): \ $(SRC)/intervals.h \ $(SRC)/keyboard.h \ $(SRC)/systime.h \ + $(SRC)/termchar.h \ + $(SRC)/termhooks.h \ $(SRC)/w32bdf.h \ $(SRC)/w32gui.h \ $(SRC)/w32term.h \ diff --git a/src/marker.c b/src/marker.c index 6a7652c8ce9..d054ef91e79 100644 --- a/src/marker.c +++ b/src/marker.c @@ -452,9 +452,12 @@ Returns nil if MARKER points into a dead buffer. */) if (XMARKER (marker)->buffer) { XSETBUFFER (buf, XMARKER (marker)->buffer); - /* Return marker's buffer only if it is not dead. */ - if (!NILP (XBUFFER (buf)->name)) - return buf; + /* If the buffer is dead, we're in trouble: the buffer pointer here + does not preserve the buffer from being GC'd (it's weak), so + markers have to be unlinked from their buffer as soon as the buffer + is killed. */ + eassert (!NILP (XBUFFER (buf)->name)); + return buf; } return Qnil; } diff --git a/src/minibuf.c b/src/minibuf.c index 74220d0c7cb..39d2f8e17be 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -35,6 +35,7 @@ Boston, MA 02110-1301, USA. */ #include "syntax.h" #include "intervals.h" #include "keymap.h" +#include "termhooks.h" extern int quit_char; @@ -491,7 +492,6 @@ read_minibuf (map, initial, prompt, backup_n, expflag, if (EQ (Vminibuffer_completing_file_name, Qlambda)) Vminibuffer_completing_file_name = Qnil; - single_kboard_state (); #ifdef HAVE_X_WINDOWS if (display_hourglass_p) cancel_hourglass (); @@ -575,6 +575,8 @@ read_minibuf (map, initial, prompt, backup_n, expflag, if (minibuffer_auto_raise) Fraise_frame (mini_frame); + temporarily_switch_to_single_kboard (XFRAME (mini_frame)); + /* We have to do this after saving the window configuration since that is what restores the current buffer. */ @@ -758,8 +760,12 @@ read_minibuf (map, initial, prompt, backup_n, expflag, XWINDOW (minibuf_window)->cursor.x = 0; XWINDOW (minibuf_window)->must_be_updated_p = 1; update_frame (XFRAME (selected_frame), 1, 1); - if (rif && rif->flush_display) - rif->flush_display (XFRAME (XWINDOW (minibuf_window)->frame)); + { + struct frame *f = XFRAME (XWINDOW (minibuf_window)->frame); + struct redisplay_interface *rif = FRAME_RIF (f); + if (rif && rif->flush_display) + rif->flush_display (f); + } } /* Make minibuffer contents into a string. */ diff --git a/src/msdos.c b/src/msdos.c index c01755b2790..02bd2748b8f 100644 --- a/src/msdos.c +++ b/src/msdos.c @@ -508,8 +508,8 @@ ScreenVisualBell (void) { /* This creates an xor-mask that will swap the default fore- and background colors. */ - do_visible_bell (((the_only_x_display.foreground_pixel - ^ the_only_x_display.background_pixel) + do_visible_bell (((FRAME_FOREGROUND_PIXEL (SELECTED_FRAME ()) + ^ FRAME_BACKGROUND_PIXEL (SELECTED_FRAME ())) * 0x11) & 0x7f); } #endif @@ -2531,8 +2531,8 @@ internal_terminal_init () initial_screen_colors[0] = initial_screen_colors[1] = -1; bzero (&the_only_x_display, sizeof the_only_x_display); - the_only_x_display.background_pixel = 7; /* White */ - the_only_x_display.foreground_pixel = 0; /* Black */ + FRAME_BACKGROUND_PIXEL (SELECTED_FRAME ()) = 7; /* White */ + FRAME_FOREGROUND_PIXEL (SELECTED_FRAME ()) = 0; /* Black */ bright_bg (); colors = getenv ("EMACSCOLORS"); if (colors && strlen (colors) >= 2) @@ -2543,13 +2543,13 @@ internal_terminal_init () else if (isxdigit (colors[0])) colors[0] -= (isupper (colors[0]) ? 'A' : 'a') - 10; if (colors[0] >= 0 && colors[0] < 16) - the_only_x_display.foreground_pixel = colors[0]; + FRAME_FOREGROUND_PIXEL (SELECTED_FRAME ()) = colors[0]; if (isdigit (colors[1])) colors[1] -= '0'; else if (isxdigit (colors[1])) colors[1] -= (isupper (colors[1]) ? 'A' : 'a') - 10; if (colors[1] >= 0 && colors[1] < 16) - the_only_x_display.background_pixel = colors[1]; + FRAME_BACKGROUND_PIXEL (SELECTED_FRAME ()) = colors[1]; } the_only_x_display.font = (XFontStruct *)1; /* must *not* be zero */ the_only_x_display.display_info.mouse_face_mouse_frame = NULL; @@ -2583,7 +2583,7 @@ internal_terminal_init () set_terminal_modes_hook = IT_set_terminal_modes; reset_terminal_modes_hook = IT_reset_terminal_modes; set_terminal_window_hook = IT_set_terminal_window; - char_ins_del_ok = 0; + TTY_CHAR_INS_DEL_OK (CURTTY ()) = 0; #endif } @@ -3393,7 +3393,13 @@ dos_rawgetc () it is active. */ if (WINDOWP (mouse_window) && !EQ (mouse_window, last_mouse_window) - && !EQ (mouse_window, selected_window)) + && !EQ (window, selected_window) + /* For click-to-focus window managers + create event iff we don't leave the + selected frame. */ + && (focus_follows_mouse + || (EQ (XWINDOW (window)->frame, + XWINDOW (selected_window)->frame)))) { event.kind = SELECT_WINDOW_EVENT; event.frame_or_window = mouse_window; @@ -4880,7 +4886,7 @@ croak (badfunc) char *badfunc; { fprintf (stderr, "%s not yet implemented\r\n", badfunc); - reset_sys_modes (); + reset_all_sys_modes (); exit (1); } diff --git a/src/prefix-args.c b/src/prefix-args.c index adf2743ba21..16d7b7dba17 100644 --- a/src/prefix-args.c +++ b/src/prefix-args.c @@ -53,6 +53,7 @@ Boston, MA 02110-1301, USA. */ #endif #include <stdio.h> +#include <stdlib.h> int main (argc, argv) diff --git a/src/print.c b/src/print.c index 86fd93a5b30..edd22abc038 100644 --- a/src/print.c +++ b/src/print.c @@ -35,6 +35,7 @@ Boston, MA 02110-1301, USA. */ #include "termchar.h" #include "intervals.h" #include "blockinput.h" +#include "termhooks.h" /* For struct terminal. */ Lisp_Object Vstandard_output, Qstandard_output; @@ -1024,11 +1025,7 @@ safe_debug_print (arg) else fprintf (stderr, "#<%s_LISP_OBJECT 0x%08lx>\r\n", !valid ? "INVALID" : "SOME", -#ifdef NO_UNION_TYPE - (unsigned long) arg -#else - (unsigned long) arg.i -#endif + (unsigned long) XHASH (arg) ); } @@ -1388,10 +1385,10 @@ print_preprocess (obj) for (i = 0; i < print_number_index; i++) if (EQ (PRINT_NUMBER_OBJECT (Vprint_number_table, i), obj)) { - /* OBJ appears more than once. Let's remember that. */ + /* OBJ appears more than once. Let's remember that. */ PRINT_NUMBER_STATUS (Vprint_number_table, i) = Qt; print_depth--; - return; + return; } /* OBJ is not yet recorded. Let's add to the table. */ @@ -2063,6 +2060,19 @@ print_object (obj, printcharfun, escapeflag) } PRINTCHAR ('>'); } + else if (TERMINALP (obj)) + { + struct terminal *t = XTERMINAL (obj); + strout ("#<terminal ", -1, -1, printcharfun, 0); + sprintf (buf, "%d", t->id); + strout (buf, -1, -1, printcharfun, 0); + if (t->name) + { + strout (" on ", -1, -1, printcharfun, 0); + strout (t->name, -1, -1, printcharfun, 0); + } + PRINTCHAR ('>'); + } else if (HASH_TABLE_P (obj)) { struct Lisp_Hash_Table *h = XHASH_TABLE (obj); @@ -2075,7 +2085,7 @@ print_object (obj, printcharfun, escapeflag) PRINTCHAR (' '); strout (SDATA (SYMBOL_NAME (h->weak)), -1, -1, printcharfun, 0); PRINTCHAR (' '); - sprintf (buf, "%ld/%ld", (long) XFASTINT (h->count), + sprintf (buf, "%ld/%ld", (long) h->count, (long) XVECTOR (h->next)->size); strout (buf, -1, -1, printcharfun, 0); } diff --git a/src/process.c b/src/process.c index 9e9ef6d0772..d94e6d13866 100644 --- a/src/process.c +++ b/src/process.c @@ -130,11 +130,11 @@ Boston, MA 02110-1301, USA. */ #include "character.h" #include "coding.h" #include "process.h" +#include "frame.h" #include "termhooks.h" #include "termopts.h" #include "commands.h" #include "keyboard.h" -#include "frame.h" #include "blockinput.h" #include "dispextern.h" #include "composite.h" @@ -2720,7 +2720,9 @@ host, and only clients connecting to that address will be accepted. :service SERVICE -- SERVICE is name of the service desired, or an integer specifying a port number to connect to. If SERVICE is t, -a random port number is selected for the server. +a random port number is selected for the server. (If Emacs was +compiled with getaddrinfo, a port number can also be specified as a +string, e.g. "80", as well as an integer. This is not portable.) :type TYPE -- TYPE is the type of connection. The default (nil) is a stream type connection, `datagram' creates a datagram type connection. @@ -3156,6 +3158,10 @@ usage: (make-network-process &rest ARGS) */) open_socket: +#ifdef __ultrix__ + /* Previously this was compiled unconditionally, but that seems + unnecessary on modern systems, and `unrequest_sigio' was a noop + under X anyway. --lorentey */ /* Kernel bugs (on Ultrix at least) cause lossage (not just EINTR) when connect is interrupted. So let's not let it get interrupted. Note we do not turn off polling, because polling is only used @@ -3172,6 +3178,7 @@ usage: (make-network-process &rest ARGS) */) record_unwind_protect (unwind_request_sigio, Qnil); unrequest_sigio (); } +#endif /* Do this in case we never enter the for-loop below. */ count1 = SPECPDL_INDEX (); @@ -6862,20 +6869,12 @@ DEFUN ("process-filter-multibyte-p", Fprocess_filter_multibyte_p, -/* The first time this is called, assume keyboard input comes from DESC - instead of from where we used to expect it. - Subsequent calls mean assume input keyboard can come from DESC - in addition to other places. */ - -static int add_keyboard_wait_descriptor_called_flag; +/* Add DESC to the set of keyboard input descriptors. */ void add_keyboard_wait_descriptor (desc) int desc; { - if (! add_keyboard_wait_descriptor_called_flag) - FD_CLR (0, &input_wait_mask); - add_keyboard_wait_descriptor_called_flag = 1; FD_SET (desc, &input_wait_mask); FD_SET (desc, &non_process_wait_mask); if (desc > max_keyboard_desc) @@ -6981,7 +6980,12 @@ init_process () process_output_skip = 0; #endif + /* Don't do this, it caused infinite select loops. The display + method should call add_keyboard_wait_descriptor on stdin if it + needs that. */ +#if 0 FD_SET (0, &input_wait_mask); +#endif Vprocess_alist = Qnil; #ifdef SIGCHLD diff --git a/src/process.h b/src/process.h index eaed95fe4b7..c1b1bc01e37 100644 --- a/src/process.h +++ b/src/process.h @@ -34,7 +34,7 @@ Boston, MA 02110-1301, USA. */ struct Lisp_Process { - EMACS_INT size; + EMACS_UINT size; struct Lisp_Vector *v_next; /* Name of subprocess terminal. */ Lisp_Object tty_name; diff --git a/src/puresize.h b/src/puresize.h index 8ce51dbfd8b..4b88283d8dd 100644 --- a/src/puresize.h +++ b/src/puresize.h @@ -43,7 +43,7 @@ Boston, MA 02110-1301, USA. */ #endif #ifndef BASE_PURESIZE -#define BASE_PURESIZE (1140000 + SYSTEM_PURESIZE_EXTRA + SITELOAD_PURESIZE_EXTRA) +#define BASE_PURESIZE (1164000 + SYSTEM_PURESIZE_EXTRA + SITELOAD_PURESIZE_EXTRA) #endif /* Increase BASE_PURESIZE by a ratio depending on the machine's word size. */ diff --git a/src/regex.c b/src/regex.c index 0858378c6e4..a0d6b945cf1 100644 --- a/src/regex.c +++ b/src/regex.c @@ -1398,18 +1398,12 @@ static const char *re_error_msgid[] = /* Normally, this is fine. */ #define MATCH_MAY_ALLOCATE -/* When using GNU C, we are not REALLY using the C alloca, no matter - what config.h may say. So don't take precautions for it. */ -#ifdef __GNUC__ -# undef C_ALLOCA -#endif - /* The match routines may not allocate if (1) they would do it with malloc and (2) it's not safe for them to use malloc. Note that if REL_ALLOC is defined, matching would not use malloc for the failure stack, but we would still use it for the register vectors; so REL_ALLOC should not affect this. */ -#if (defined C_ALLOCA || defined REGEX_MALLOC) && defined emacs +#if defined REGEX_MALLOC && defined emacs # undef MATCH_MAY_ALLOCATE #endif @@ -4635,11 +4629,6 @@ re_search_2 (bufp, str1, size1, str2, size2, startpos, range, regs, stop) val = re_match_2_internal (bufp, string1, size1, string2, size2, startpos, regs, stop); -#ifndef REGEX_MALLOC -# ifdef C_ALLOCA - alloca (0); -# endif -#endif if (val >= 0) return startpos; @@ -5076,9 +5065,6 @@ re_match (bufp, string, size, pos, regs) { int result = re_match_2_internal (bufp, NULL, 0, (re_char*) string, size, pos, regs, size); -# if defined C_ALLOCA && !defined REGEX_MALLOC - alloca (0); -# endif return result; } WEAK_ALIAS (__re_match, re_match) @@ -5124,9 +5110,6 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) result = re_match_2_internal (bufp, (re_char*) string1, size1, (re_char*) string2, size2, pos, regs, stop); -#if defined C_ALLOCA && !defined REGEX_MALLOC - alloca (0); -#endif return result; } WEAK_ALIAS (__re_match_2, re_match_2) diff --git a/src/s/cygwin.h b/src/s/cygwin.h index 3c0d9c410a0..1785c7c6c76 100644 --- a/src/s/cygwin.h +++ b/src/s/cygwin.h @@ -140,6 +140,12 @@ Boston, MA 02110-1301, USA. */ change their controlling terminal */ #define vfork fork +/* This should work (at least when compiling with gcc). But I have no way + or intention to verify or even test it. If you encounter a problem with + it, feel free to change this setting, but please add a comment here about + why it needed to be changed. */ +#define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS + /* the end */ /* arch-tag: 5ae7ba00-83b0-4ab3-806a-3e845779191b diff --git a/src/s/darwin.h b/src/s/darwin.h index 183aecaf5d8..6bfa0e95106 100644 --- a/src/s/darwin.h +++ b/src/s/darwin.h @@ -50,6 +50,12 @@ Boston, MA 02110-1301, USA. */ #ifdef MAC_OSX #ifdef HAVE_CARBON #define MAC_OS +/* We need a little extra space, see ../../lisp/loadup.el. */ +#define SYSTEM_PURESIZE_EXTRA 30000 + +/* XXX The MULTI_KBOARD support does not work yet on this platform. */ +#undef MULTI_KBOARD + #endif #endif diff --git a/src/s/hpux.h b/src/s/hpux.h index 5f407a661e1..62427ba98a6 100644 --- a/src/s/hpux.h +++ b/src/s/hpux.h @@ -167,9 +167,15 @@ Boston, MA 02110-1301, USA. */ /* USG systems tend to put everything declared static into the initialized data area, which becomes pure after dumping Emacs. - Foil this. Emacs carefully avoids static vars inside functions. */ + Foil this. Emacs carefully avoids static vars inside functions. + http://lists.gnu.org/archive/html/emacs-devel/2007-09/msg00368.html + As of at least HPUX 11.11 (2000), it seems this workaround is no + longer needed. Try uncommenting the following if you have problems + on older versions. */ -#define static +/* This is unnecessary in HPUX versions 10.20, 11.0, 11.11, 11.23. */ + +/* #define static */ /* Define extra libraries to load. This should have -lBSD, but that library is said to make diff --git a/src/s/ms-w32.h b/src/s/ms-w32.h index a5898410b3b..5a297a4ee80 100644 --- a/src/s/ms-w32.h +++ b/src/s/ms-w32.h @@ -302,6 +302,8 @@ Boston, MA 02110-1301, USA. */ #define HAVE_MOUSE 1 #define HAVE_H_ERRNO 1 +#define MULTI_KBOARD 1 + #ifdef HAVE_NTGUI #define HAVE_WINDOW_SYSTEM 1 #define HAVE_FACES 1 @@ -480,7 +482,7 @@ extern char *get_emacs_configuration_options (void); /* We need a little extra space, see ../../lisp/loadup.el. The number below comes from 23923 bytes worth (as of 2006-04) of w32-specific files loaded by loadup.el, plus 1K spare. */ -#define SYSTEM_PURESIZE_EXTRA 25000 +#define SYSTEM_PURESIZE_EXTRA 50000 /* For unexec to work on Alpha systems, we need to put Emacs' initialized data into a separate section from the CRT initialized diff --git a/src/scroll.c b/src/scroll.c index 48a40fe23d2..5a59c69003e 100644 --- a/src/scroll.c +++ b/src/scroll.c @@ -23,12 +23,13 @@ Boston, MA 02110-1301, USA. */ #include <config.h> #include <stdio.h> #include <string.h> -#include "termchar.h" #include "lisp.h" +#include "termchar.h" #include "dispextern.h" #include "keyboard.h" #include "frame.h" #include "window.h" +#include "termhooks.h" /* All costs measured in characters. So no cost can exceed the area of a frame, measured in characters. @@ -58,10 +59,12 @@ struct matrix_elt unsigned char writecount; }; -static void do_direct_scrolling P_ ((struct glyph_matrix *, +static void do_direct_scrolling P_ ((struct frame *, + struct glyph_matrix *, struct matrix_elt *, int, int)); -static void do_scrolling P_ ((struct glyph_matrix *, +static void do_scrolling P_ ((struct frame *, + struct glyph_matrix *, struct matrix_elt *, int, int)); @@ -101,7 +104,8 @@ calculate_scrolling (frame, matrix, window_size, lines_below, register struct matrix_elt *p, *p1; register int cost, cost1; - int lines_moved = window_size + (scroll_region_ok ? 0 : lines_below); + int lines_moved = window_size + + (FRAME_SCROLL_REGION_OK (frame) ? 0 : lines_below); /* first_insert_cost[I] is the cost of doing the first insert-line at the i'th line of the lines we are considering, where I is origin 1 (as it is below). */ @@ -241,7 +245,8 @@ calculate_scrolling (frame, matrix, window_size, lines_below, of lines. */ static void -do_scrolling (current_matrix, matrix, window_size, unchanged_at_top) +do_scrolling (frame, current_matrix, matrix, window_size, unchanged_at_top) + struct frame *frame; struct glyph_matrix *current_matrix; struct matrix_elt *matrix; int window_size; @@ -308,12 +313,12 @@ do_scrolling (current_matrix, matrix, window_size, unchanged_at_top) /* Set the terminal window, if not done already. */ if (! terminal_window_p) { - set_terminal_window (window_size + unchanged_at_top); + set_terminal_window (frame, window_size + unchanged_at_top); terminal_window_p = 1; } /* Delete lines on the terminal. */ - ins_del_lines (j + unchanged_at_top, - p->deletecount); + ins_del_lines (frame, j + unchanged_at_top, - p->deletecount); } else { @@ -338,7 +343,7 @@ do_scrolling (current_matrix, matrix, window_size, unchanged_at_top) /* Set the terminal window if not yet done. */ if (!terminal_window_p) { - set_terminal_window (window_size + unchanged_at_top); + set_terminal_window (frame, window_size + unchanged_at_top); terminal_window_p = 1; } @@ -347,7 +352,7 @@ do_scrolling (current_matrix, matrix, window_size, unchanged_at_top) --queue; /* Do the deletion on the terminal. */ - ins_del_lines (queue->pos, queue->count); + ins_del_lines (frame, queue->pos, queue->count); /* All lines in the range deleted become empty in the glyph matrix. Assign to them glyph rows that are not retained. @@ -380,7 +385,7 @@ do_scrolling (current_matrix, matrix, window_size, unchanged_at_top) CHECK_MATRIX (current_matrix); if (terminal_window_p) - set_terminal_window (0); + set_terminal_window (frame, 0); } @@ -467,7 +472,8 @@ calculate_direct_scrolling (frame, matrix, window_size, lines_below, /* Overhead of setting the scroll window, plus the extra cost cost of scrolling by a distance of one. The extra cost is added once for consistency with the cost vectors */ - scroll_overhead = scroll_region_cost + extra_cost; + scroll_overhead + = FRAME_SCROLL_REGION_COST (frame) + extra_cost; /* initialize the top left corner of the matrix */ matrix->writecost = 0; @@ -650,8 +656,9 @@ calculate_direct_scrolling (frame, matrix, window_size, lines_below, the cost matrix for this approach is constructed. */ static void -do_direct_scrolling (current_matrix, cost_matrix, window_size, - unchanged_at_top) +do_direct_scrolling (frame, current_matrix, cost_matrix, + window_size, unchanged_at_top) + struct frame *frame; struct glyph_matrix *current_matrix; struct matrix_elt *cost_matrix; int window_size; @@ -742,9 +749,9 @@ do_direct_scrolling (current_matrix, cost_matrix, window_size, if (i > j) { /* Immediately insert lines */ - set_terminal_window (i + unchanged_at_top); + set_terminal_window (frame, i + unchanged_at_top); terminal_window_p = 1; - ins_del_lines (j - n_to_write + unchanged_at_top, i - j); + ins_del_lines (frame, j - n_to_write + unchanged_at_top, i - j); } else if (i < j) { @@ -774,9 +781,9 @@ do_direct_scrolling (current_matrix, cost_matrix, window_size, --queue; if (queue->count) { - set_terminal_window (queue->window); + set_terminal_window (frame, queue->window); terminal_window_p = 1; - ins_del_lines (queue->pos, queue->count); + ins_del_lines (frame, queue->pos, queue->count); } else { @@ -799,7 +806,7 @@ do_direct_scrolling (current_matrix, cost_matrix, window_size, copy_from, retained_p); if (terminal_window_p) - set_terminal_window (0); + set_terminal_window (frame, 0); } @@ -819,13 +826,13 @@ scrolling_1 (frame, window_size, unchanged_at_top, unchanged_at_bottom, matrix = ((struct matrix_elt *) alloca ((window_size + 1) * (window_size + 1) * sizeof *matrix)); - if (scroll_region_ok) + if (FRAME_SCROLL_REGION_OK (frame)) { calculate_direct_scrolling (frame, matrix, window_size, unchanged_at_bottom, draw_cost, old_draw_cost, old_hash, new_hash, free_at_end); - do_direct_scrolling (frame->current_matrix, + do_direct_scrolling (frame, frame->current_matrix, matrix, window_size, unchanged_at_top); } else @@ -833,7 +840,8 @@ scrolling_1 (frame, window_size, unchanged_at_top, unchanged_at_bottom, calculate_scrolling (frame, matrix, window_size, unchanged_at_bottom, draw_cost, old_hash, new_hash, free_at_end); - do_scrolling (frame->current_matrix, matrix, window_size, + do_scrolling (frame, + frame->current_matrix, matrix, window_size, unchanged_at_top); } } @@ -915,7 +923,7 @@ scroll_cost (frame, from, to, amount) if (amount == 0) return 0; - if (! scroll_region_ok) + if (! FRAME_SCROLL_REGION_OK (frame)) limit = height; else if (amount > 0) limit += amount; diff --git a/src/search.c b/src/search.c index edcf315b2cd..aff998b154b 100644 --- a/src/search.c +++ b/src/search.c @@ -1675,12 +1675,8 @@ boyer_moore (n, base_pat, len, len_byte, trt, inverse_trt, int translate_prev_byte3 = 0; int translate_prev_byte4 = 0; -#ifdef C_ALLOCA - int BM_tab_space[0400]; - BM_tab = &BM_tab_space[0]; -#else BM_tab = (int *) alloca (0400 * sizeof (int)); -#endif + /* The general approach is that we are going to maintain that we know */ /* the first (closest to the present position, in whatever direction */ /* we're searching) character that could possibly be the last */ diff --git a/src/sound.c b/src/sound.c index 8b1bda8d6ef..0873fe8b82f 100644 --- a/src/sound.c +++ b/src/sound.c @@ -97,7 +97,6 @@ Boston, MA 02110-1301, USA. */ #endif /* WINDOWSNT */ /* BEGIN: Common Definitions */ -#define abs(X) ((X) < 0 ? -(X) : (X)) /* Symbols. */ diff --git a/src/sysdep.c b/src/sysdep.c index f2170dabed7..35a107f34cf 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -46,6 +46,12 @@ extern void srandom P_ ((unsigned int)); #endif #endif +/* The w32 build defines select stuff in w32.h, which is included by + sys/select.h (included below). */ +#ifndef WINDOWSNT +#include "sysselect.h" +#endif + #include "blockinput.h" #ifdef MAC_OS8 @@ -176,6 +182,7 @@ extern int quit_char; #include "termopts.h" #include "dispextern.h" #include "process.h" +#include "cm.h" /* for reset_sys_modes */ #ifdef WINDOWSNT #include <direct.h> @@ -239,16 +246,11 @@ static int baud_convert[] = int emacs_ospeed; -/* The file descriptor for Emacs's input terminal. - Under Unix, this is normally zero except when using X; - under VMS, we place the input channel number here. */ -int input_fd; - void croak P_ ((char *)) NO_RETURN; #ifdef AIXHFT -void hft_init (); -void hft_reset (); +void hft_init P_ ((struct tty_display_info *)); +void hft_reset P_ ((struct tty_display_info *)); #endif /* Temporary used by `sigblock' when defined in terms of signprocmask. */ @@ -331,16 +333,7 @@ get_current_dir_name () #endif -/* Specify a different file descriptor for further input operations. */ - -void -change_input_fd (fd) - int fd; -{ - input_fd = fd; -} - -/* Discard pending input on descriptor input_fd. */ +/* Discard pending input on all input descriptors. */ void discard_tty_input () @@ -351,54 +344,61 @@ discard_tty_input () if (noninteractive) return; - /* Discarding input is not safe when the input could contain - replies from the X server. So don't do it. */ - if (read_socket_hook) - return; - #ifdef VMS end_kbd_input (); - SYS$QIOW (0, input_fd, IO$_READVBLK|IO$M_PURGE, input_iosb, 0, 0, + SYS$QIOW (0, fileno (CURTTY()->input), IO$_READVBLK|IO$M_PURGE, input_iosb, 0, 0, &buf.main, 0, 0, terminator_mask, 0, 0); queue_kbd_input (); #else /* not VMS */ #ifdef APOLLO { - int zero = 0; - ioctl (input_fd, TIOCFLUSH, &zero); + struct tty_display_info *tty; + for (tty = tty_list; tty; tty = tty->next) + { + int zero = 0; + if (tty->input) + ioctl (fileno (tty->input), TIOCFLUSH, &zero); + } } #else /* not Apollo */ #ifdef MSDOS /* Demacs 1.1.1 91/10/16 HIRANO Satoshi */ while (dos_keyread () != -1) ; #else /* not MSDOS */ - EMACS_GET_TTY (input_fd, &buf); - EMACS_SET_TTY (input_fd, &buf, 0); + { + struct tty_display_info *tty; + for (tty = tty_list; tty; tty = tty->next) + { + if (tty->input) /* Is the device suspended? */ + { + EMACS_GET_TTY (fileno (tty->input), &buf); + EMACS_SET_TTY (fileno (tty->input), &buf, 0); + } + } + } #endif /* not MSDOS */ #endif /* not Apollo */ #endif /* not VMS */ #endif /* not WINDOWSNT */ } + #ifdef SIGTSTP /* Arrange for character C to be read as the next input from - the terminal. */ + the terminal. + XXX What if we have multiple ttys? +*/ void -#ifdef PROTOTYPES stuff_char (char c) -#else -stuff_char (c) - char c; -#endif { - if (read_socket_hook) + if (! FRAME_TERMCAP_P (SELECTED_FRAME ())) return; /* Should perhaps error if in batch mode */ #ifdef TIOCSTI - ioctl (input_fd, TIOCSTI, &c); + ioctl (fileno (CURTTY()->input), TIOCSTI, &c); #else /* no TIOCSTI */ error ("Cannot stuff terminal input characters in this version of Unix"); #endif /* no TIOCSTI */ @@ -407,7 +407,7 @@ stuff_char (c) #endif /* SIGTSTP */ void -init_baud_rate () +init_baud_rate (int fd) { if (noninteractive) emacs_ospeed = 0; @@ -422,7 +422,7 @@ init_baud_rate () #ifdef VMS struct sensemode sg; - SYS$QIOW (0, input_fd, IO$_SENSEMODE, &sg, 0, 0, + SYS$QIOW (0, fd, IO$_SENSEMODE, &sg, 0, 0, &sg.class, 12, 0, 0, 0, 0 ); emacs_ospeed = sg.xmit_baud; #else /* not VMS */ @@ -430,7 +430,7 @@ init_baud_rate () struct termios sg; sg.c_cflag = B9600; - tcgetattr (input_fd, &sg); + tcgetattr (fd, &sg); emacs_ospeed = cfgetospeed (&sg); #if defined (USE_GETOBAUD) && defined (getobaud) /* m88k-motorola-sysv3 needs this (ghazi@noc.rutgers.edu) 9/1/94. */ @@ -443,16 +443,16 @@ init_baud_rate () sg.c_cflag = B9600; #ifdef HAVE_TCATTR - tcgetattr (input_fd, &sg); + tcgetattr (fd, &sg); #else - ioctl (input_fd, TCGETA, &sg); + ioctl (fd, TCGETA, &sg); #endif emacs_ospeed = sg.c_cflag & CBAUD; #else /* neither VMS nor TERMIOS nor TERMIO */ struct sgttyb sg; sg.sg_ospeed = B9600; - if (ioctl (input_fd, TIOCGETP, &sg) < 0) + if (ioctl (fd, TIOCGETP, &sg) < 0) abort (); emacs_ospeed = sg.sg_ospeed; #endif /* not HAVE_TERMIO */ @@ -468,6 +468,7 @@ init_baud_rate () baud_rate = 1200; } + /*ARGSUSED*/ void set_exclusive_use (fd) @@ -729,7 +730,7 @@ child_setup_tty (out) #ifdef BSD4_1 if (interrupt_input) - reset_sigio (); + reset_sigio (0); #endif /* BSD4_1 */ #ifdef RTU { @@ -986,53 +987,86 @@ restore_signal_handlers (saved_handlers) } } +#ifndef SIGIO +/* If SIGIO is broken, don't do anything. */ +void +init_sigio (int fd) +{ +} + +void +reset_sigio (int fd) +{ +} + +void +request_sigio (void) +{ +} + +void +unrequest_sigio (void) +{ +} + +#else #ifdef F_SETFL -int old_fcntl_flags; +int old_fcntl_flags[MAXDESC]; void init_sigio (fd) int fd; { #ifdef FASYNC - old_fcntl_flags = fcntl (fd, F_GETFL, 0) & ~FASYNC; - fcntl (fd, F_SETFL, old_fcntl_flags | FASYNC); + old_fcntl_flags[fd] = fcntl (fd, F_GETFL, 0) & ~FASYNC; + fcntl (fd, F_SETFL, old_fcntl_flags[fd] | FASYNC); #endif interrupts_deferred = 0; } void -reset_sigio () +reset_sigio (fd) + int fd; { - unrequest_sigio (); +#ifdef FASYNC + fcntl (fd, F_SETFL, old_fcntl_flags[fd]); +#endif } #ifdef FASYNC /* F_SETFL does not imply existence of FASYNC */ +/* XXX Uhm, FASYNC is not used anymore here. */ +/* XXX Yeah, but you need it for SIGIO, don't you? */ void request_sigio () { - if (noninteractive || read_socket_hook) + if (noninteractive) return; #ifdef SIGWINCH sigunblock (sigmask (SIGWINCH)); #endif - fcntl (input_fd, F_SETFL, old_fcntl_flags | FASYNC); + sigunblock (sigmask (SIGIO)); interrupts_deferred = 0; } void -unrequest_sigio () -{ - if (noninteractive || read_socket_hook) +unrequest_sigio (void) +{ + if (noninteractive) return; +#if 0 /* XXX What's wrong with blocking SIGIO under X? */ + if (x_display_list) + return; +#endif + #ifdef SIGWINCH sigblock (sigmask (SIGWINCH)); #endif - fcntl (input_fd, F_SETFL, old_fcntl_flags); + sigblock (sigmask (SIGIO)); interrupts_deferred = 1; } @@ -1047,7 +1081,8 @@ request_sigio () if (noninteractive || read_socket_hook) return; - ioctl (input_fd, FIOASYNC, &on); + /* XXX CURTTY() is bogus here. */ + ioctl (fileno (CURTTY ()->input), FIOASYNC, &on); interrupts_deferred = 0; } @@ -1059,7 +1094,8 @@ unrequest_sigio () if (noninteractive || read_socket_hook) return; - ioctl (input_fd, FIOASYNC, &off); + /* XXX CURTTY() is bogus here. */ + ioctl (fileno (CURTTY ()->input), FIOASYNC, &off); interrupts_deferred = 1; } @@ -1080,7 +1116,7 @@ request_sigio () sigemptyset (&st); sigaddset (&st, SIGIO); - ioctl (input_fd, FIOASYNC, &on); + ioctl (0, FIOASYNC, &on); /* XXX This fails for multiple ttys. */ interrupts_deferred = 0; sigprocmask (SIG_UNBLOCK, &st, (sigset_t *)0); } @@ -1093,7 +1129,7 @@ unrequest_sigio () if (noninteractive || read_socket_hook) return; - ioctl (input_fd, FIOASYNC, &off); + ioctl (0, FIOASYNC, &off); /* XXX This fails for multiple ttys. */ interrupts_deferred = 1; } @@ -1123,6 +1159,7 @@ unrequest_sigio () #endif /* STRIDE */ #endif /* FASYNC */ #endif /* F_SETFL */ +#endif /* SIGIO */ /* Saving and restoring the process group of Emacs's terminal. */ @@ -1145,30 +1182,39 @@ unrequest_sigio () the tty's pgroup just like any other terminal setting. If inherited_group was not the tty's pgroup, then we'll get a SIGTTmumble when we try to change the tty's pgroup, and a CONT if - it goes foreground in the future, which is what should happen. */ + it goes foreground in the future, which is what should happen. + + This variable is initialized in emacs.c. */ int inherited_pgroup; -/* Split off the foreground process group to Emacs alone. - When we are in the foreground, but not started in our own process - group, redirect the TTY to point to our own process group. We need - to be in our own process group to receive SIGIO properly. */ -void -narrow_foreground_group () +/* Split off the foreground process group to Emacs alone. When we are + in the foreground, but not started in our own process group, + redirect the tty device handle FD to point to our own process + group. We need to be in our own process group to receive SIGIO + properly. */ +static void +narrow_foreground_group (int fd) { int me = getpid (); setpgrp (0, inherited_pgroup); +#if 0 + /* XXX inherited_pgroup should not be zero here, but GTK seems to + mess this up. */ + if (! inherited_pgroup) + abort (); /* Should not happen. */ +#endif if (inherited_pgroup != me) - EMACS_SET_TTY_PGRP (input_fd, &me); + EMACS_SET_TTY_PGRP (fd, &me); /* XXX This only works on the controlling tty. */ setpgrp (0, me); } /* Set the tty to our original foreground group. */ -void -widen_foreground_group () +static void +widen_foreground_group (int fd) { if (inherited_pgroup != getpid ()) - EMACS_SET_TTY_PGRP (input_fd, &inherited_pgroup); + EMACS_SET_TTY_PGRP (fd, &inherited_pgroup); setpgrp (0, inherited_pgroup); } @@ -1326,14 +1372,6 @@ emacs_set_tty (fd, settings, flushp) } -/* The initial tty mode bits */ -struct emacs_tty old_tty; - -/* 1 if we have been through init_sys_modes. */ -int term_initted; - -/* 1 if outer tty status has been recorded. */ -int old_tty_valid; #ifdef BSD4_1 /* BSD 4.1 needs to keep track of the lmode bits in order to start @@ -1343,7 +1381,7 @@ int lmode; #ifndef F_SETOWN_BUG #ifdef F_SETOWN -int old_fcntl_owner; +int old_fcntl_owner[MAXDESC]; #endif /* F_SETOWN */ #endif /* F_SETOWN_BUG */ @@ -1368,8 +1406,22 @@ static struct ltchars new_ltchars = {-1,-1,-1,-1,-1,-1}; static struct tchars new_tchars = {-1,-1,-1,-1,-1,-1}; #endif +/* Initialize the terminal mode on all tty devices that are currently + open. */ + void -init_sys_modes () +init_all_sys_modes (void) +{ + struct tty_display_info *tty; + for (tty = tty_list; tty; tty = tty->next) + init_sys_modes (tty); +} + +/* Initialize the terminal mode on the given tty device. */ + +void +init_sys_modes (tty_out) + struct tty_display_info *tty_out; { struct emacs_tty tty; @@ -1385,6 +1437,9 @@ init_sys_modes () if (noninteractive) return; + if (!tty_out->output) + return; /* The tty is suspended. */ + #ifdef VMS if (!input_ef) input_ef = get_kbd_event_flag (); @@ -1415,269 +1470,291 @@ init_sys_modes () #ifndef VMS4_4 sys_access_reinit (); #endif -#endif /* not VMS */ +#endif /* VMS */ #ifdef BSD_PGRPS - if (! read_socket_hook && EQ (Vwindow_system, Qnil)) - narrow_foreground_group (); +#if 0 + /* read_socket_hook is not global anymore. I think doing this + unconditionally will not cause any problems. */ + if (! read_socket_hook && EQ (Vinitial_window_system, Qnil)) #endif - -#ifdef HAVE_WINDOW_SYSTEM - /* Emacs' window system on MSDOG uses the `internal terminal' and therefore - needs the initialization code below. */ - if (!read_socket_hook && EQ (Vwindow_system, Qnil)) + narrow_foreground_group (fileno (tty_out->input)); #endif - { - EMACS_GET_TTY (input_fd, &old_tty); - old_tty_valid = 1; + if (! tty_out->old_tty) + tty_out->old_tty = (struct emacs_tty *) xmalloc (sizeof (struct emacs_tty)); + + EMACS_GET_TTY (fileno (tty_out->input), tty_out->old_tty); - tty = old_tty; + tty = *tty_out->old_tty; #if defined (HAVE_TERMIO) || defined (HAVE_TERMIOS) - XSETINT (Vtty_erase_char, old_tty.main.c_cc[VERASE]); + XSETINT (Vtty_erase_char, tty.main.c_cc[VERASE]); #ifdef DGUX - /* This allows meta to be sent on 8th bit. */ - tty.main.c_iflag &= ~INPCK; /* don't check input for parity */ + /* This allows meta to be sent on 8th bit. */ + tty.main.c_iflag &= ~INPCK; /* don't check input for parity */ #endif - tty.main.c_iflag |= (IGNBRK); /* Ignore break condition */ - tty.main.c_iflag &= ~ICRNL; /* Disable map of CR to NL on input */ + tty.main.c_iflag |= (IGNBRK); /* Ignore break condition */ + tty.main.c_iflag &= ~ICRNL; /* Disable map of CR to NL on input */ #ifdef INLCR /* I'm just being cautious, since I can't check how widespread INLCR is--rms. */ - tty.main.c_iflag &= ~INLCR; /* Disable map of NL to CR on input */ + tty.main.c_iflag &= ~INLCR; /* Disable map of NL to CR on input */ #endif #ifdef ISTRIP - tty.main.c_iflag &= ~ISTRIP; /* don't strip 8th bit on input */ + tty.main.c_iflag &= ~ISTRIP; /* don't strip 8th bit on input */ #endif - tty.main.c_lflag &= ~ECHO; /* Disable echo */ - tty.main.c_lflag &= ~ICANON; /* Disable erase/kill processing */ + tty.main.c_lflag &= ~ECHO; /* Disable echo */ + tty.main.c_lflag &= ~ICANON; /* Disable erase/kill processing */ #ifdef IEXTEN - tty.main.c_lflag &= ~IEXTEN; /* Disable other editing characters. */ + tty.main.c_lflag &= ~IEXTEN; /* Disable other editing characters. */ #endif - tty.main.c_lflag |= ISIG; /* Enable signals */ - if (flow_control) - { - tty.main.c_iflag |= IXON; /* Enable start/stop output control */ + tty.main.c_lflag |= ISIG; /* Enable signals */ + if (tty_out->flow_control) + { + tty.main.c_iflag |= IXON; /* Enable start/stop output control */ #ifdef IXANY - tty.main.c_iflag &= ~IXANY; + tty.main.c_iflag &= ~IXANY; #endif /* IXANY */ - } - else - tty.main.c_iflag &= ~IXON; /* Disable start/stop output control */ - tty.main.c_oflag &= ~ONLCR; /* Disable map of NL to CR-NL - on output */ - tty.main.c_oflag &= ~TAB3; /* Disable tab expansion */ + } + else + tty.main.c_iflag &= ~IXON; /* Disable start/stop output control */ + tty.main.c_oflag &= ~ONLCR; /* Disable map of NL to CR-NL + on output */ + tty.main.c_oflag &= ~TAB3; /* Disable tab expansion */ #ifdef CS8 - if (meta_key) - { - tty.main.c_cflag |= CS8; /* allow 8th bit on input */ - tty.main.c_cflag &= ~PARENB;/* Don't check parity */ - } + if (tty_out->meta_key) + { + tty.main.c_cflag |= CS8; /* allow 8th bit on input */ + tty.main.c_cflag &= ~PARENB;/* Don't check parity */ + } #endif + if (tty_out->input == stdin) + { tty.main.c_cc[VINTR] = quit_char; /* C-g (usually) gives SIGINT */ /* Set up C-g for both SIGQUIT and SIGINT. - We don't know which we will get, but we handle both alike - so which one it really gives us does not matter. */ + We don't know which we will get, but we handle both alike + so which one it really gives us does not matter. */ tty.main.c_cc[VQUIT] = quit_char; - tty.main.c_cc[VMIN] = 1; /* Input should wait for at least 1 char */ - tty.main.c_cc[VTIME] = 0; /* no matter how long that takes. */ + } + else + { + /* We normally don't get interrupt or quit signals from tty + devices other than our controlling terminal; therefore, + we must handle C-g as normal input. Unfortunately, this + means that the interrupt and quit feature must be + disabled on secondary ttys, or we would not even see the + keypress. + + Note that even though emacsclient could have special code + to pass SIGINT to Emacs, we should _not_ enable + interrupt/quit keys for emacsclient frames. This means + that we can't break out of loops in C code from a + secondary tty frame, but we can always decide what + display the C-g came from, which is more important from a + usability point of view. (Consider the case when two + people work together using the same Emacs instance.) */ + tty.main.c_cc[VINTR] = CDISABLE; + tty.main.c_cc[VQUIT] = CDISABLE; + } + tty.main.c_cc[VMIN] = 1; /* Input should wait for at least 1 char */ + tty.main.c_cc[VTIME] = 0; /* no matter how long that takes. */ #ifdef VSWTCH - tty.main.c_cc[VSWTCH] = CDISABLE; /* Turn off shell layering use + tty.main.c_cc[VSWTCH] = CDISABLE; /* Turn off shell layering use of C-z */ #endif /* VSWTCH */ - + #if defined (mips) || defined (HAVE_TCATTR) #ifdef VSUSP - tty.main.c_cc[VSUSP] = CDISABLE; /* Turn off mips handling of C-z. */ + tty.main.c_cc[VSUSP] = CDISABLE; /* Turn off mips handling of C-z. */ #endif /* VSUSP */ #ifdef V_DSUSP - tty.main.c_cc[V_DSUSP] = CDISABLE; /* Turn off mips handling of C-y. */ + tty.main.c_cc[V_DSUSP] = CDISABLE; /* Turn off mips handling of C-y. */ #endif /* V_DSUSP */ #ifdef VDSUSP /* Some systems have VDSUSP, some have V_DSUSP. */ - tty.main.c_cc[VDSUSP] = CDISABLE; + tty.main.c_cc[VDSUSP] = CDISABLE; #endif /* VDSUSP */ #ifdef VLNEXT - tty.main.c_cc[VLNEXT] = CDISABLE; + tty.main.c_cc[VLNEXT] = CDISABLE; #endif /* VLNEXT */ #ifdef VREPRINT - tty.main.c_cc[VREPRINT] = CDISABLE; + tty.main.c_cc[VREPRINT] = CDISABLE; #endif /* VREPRINT */ #ifdef VWERASE - tty.main.c_cc[VWERASE] = CDISABLE; + tty.main.c_cc[VWERASE] = CDISABLE; #endif /* VWERASE */ #ifdef VDISCARD - tty.main.c_cc[VDISCARD] = CDISABLE; + tty.main.c_cc[VDISCARD] = CDISABLE; #endif /* VDISCARD */ - if (flow_control) - { + if (tty_out->flow_control) + { #ifdef VSTART - tty.main.c_cc[VSTART] = '\021'; + tty.main.c_cc[VSTART] = '\021'; #endif /* VSTART */ #ifdef VSTOP - tty.main.c_cc[VSTOP] = '\023'; + tty.main.c_cc[VSTOP] = '\023'; #endif /* VSTOP */ - } - else - { + } + else + { #ifdef VSTART - tty.main.c_cc[VSTART] = CDISABLE; + tty.main.c_cc[VSTART] = CDISABLE; #endif /* VSTART */ #ifdef VSTOP - tty.main.c_cc[VSTOP] = CDISABLE; + tty.main.c_cc[VSTOP] = CDISABLE; #endif /* VSTOP */ - } + } #endif /* mips or HAVE_TCATTR */ #ifdef SET_LINE_DISCIPLINE - /* Need to explicitly request TERMIODISC line discipline or - Ultrix's termios does not work correctly. */ - tty.main.c_line = SET_LINE_DISCIPLINE; + /* Need to explicitly request TERMIODISC line discipline or + Ultrix's termios does not work correctly. */ + tty.main.c_line = SET_LINE_DISCIPLINE; #endif #ifdef AIX #ifndef IBMR2AIX - /* AIX enhanced edit loses NULs, so disable it. */ - tty.main.c_line = 0; - tty.main.c_iflag &= ~ASCEDIT; + /* AIX enhanced edit loses NULs, so disable it. */ + tty.main.c_line = 0; + tty.main.c_iflag &= ~ASCEDIT; #else - tty.main.c_cc[VSTRT] = CDISABLE; - tty.main.c_cc[VSTOP] = CDISABLE; - tty.main.c_cc[VSUSP] = CDISABLE; - tty.main.c_cc[VDSUSP] = CDISABLE; + tty.main.c_cc[VSTRT] = CDISABLE; + tty.main.c_cc[VSTOP] = CDISABLE; + tty.main.c_cc[VSUSP] = CDISABLE; + tty.main.c_cc[VDSUSP] = CDISABLE; #endif /* IBMR2AIX */ - if (flow_control) - { + if (tty_out->flow_control) + { #ifdef VSTART - tty.main.c_cc[VSTART] = '\021'; + tty.main.c_cc[VSTART] = '\021'; #endif /* VSTART */ #ifdef VSTOP - tty.main.c_cc[VSTOP] = '\023'; + tty.main.c_cc[VSTOP] = '\023'; #endif /* VSTOP */ - } - /* Also, PTY overloads NUL and BREAK. - don't ignore break, but don't signal either, so it looks like NUL. - This really serves a purpose only if running in an XTERM window - or via TELNET or the like, but does no harm elsewhere. */ - tty.main.c_iflag &= ~IGNBRK; - tty.main.c_iflag &= ~BRKINT; + } + /* Also, PTY overloads NUL and BREAK. + don't ignore break, but don't signal either, so it looks like NUL. + This really serves a purpose only if running in an XTERM window + or via TELNET or the like, but does no harm elsewhere. */ + tty.main.c_iflag &= ~IGNBRK; + tty.main.c_iflag &= ~BRKINT; #endif #else /* if not HAVE_TERMIO */ #ifdef VMS - tty.main.tt_char |= TT$M_NOECHO; - if (meta_key) - tty.main.tt_char |= TT$M_EIGHTBIT; - if (flow_control) - tty.main.tt_char |= TT$M_TTSYNC; - else - tty.main.tt_char &= ~TT$M_TTSYNC; - tty.main.tt2_char |= TT2$M_PASTHRU | TT2$M_XON; + tty.main.tt_char |= TT$M_NOECHO; + if (meta_key) + tty.main.tt_char |= TT$M_EIGHTBIT; + if (tty_out->flow_control) + tty.main.tt_char |= TT$M_TTSYNC; + else + tty.main.tt_char &= ~TT$M_TTSYNC; + tty.main.tt2_char |= TT2$M_PASTHRU | TT2$M_XON; #else /* not VMS (BSD, that is) */ #ifndef DOS_NT - XSETINT (Vtty_erase_char, tty.main.sg_erase); - tty.main.sg_flags &= ~(ECHO | CRMOD | XTABS); - if (meta_key) - tty.main.sg_flags |= ANYP; - tty.main.sg_flags |= interrupt_input ? RAW : CBREAK; + XSETINT (Vtty_erase_char, tty.main.sg_erase); + tty.main.sg_flags &= ~(ECHO | CRMOD | XTABS); + if (meta_key) + tty.main.sg_flags |= ANYP; + tty.main.sg_flags |= interrupt_input ? RAW : CBREAK; #endif /* not DOS_NT */ #endif /* not VMS (BSD, that is) */ #endif /* not HAVE_TERMIO */ - /* If going to use CBREAK mode, we must request C-g to interrupt - and turn off start and stop chars, etc. If not going to use - CBREAK mode, do this anyway so as to turn off local flow - control for user coming over network on 4.2; in this case, - only t_stopc and t_startc really matter. */ + /* If going to use CBREAK mode, we must request C-g to interrupt + and turn off start and stop chars, etc. If not going to use + CBREAK mode, do this anyway so as to turn off local flow + control for user coming over network on 4.2; in this case, + only t_stopc and t_startc really matter. */ #ifndef HAVE_TERMIO #ifdef HAVE_TCHARS - /* Note: if not using CBREAK mode, it makes no difference how we - set this */ - tty.tchars = new_tchars; - tty.tchars.t_intrc = quit_char; - if (flow_control) - { - tty.tchars.t_startc = '\021'; - tty.tchars.t_stopc = '\023'; - } - - tty.lmode = LDECCTQ | LLITOUT | LPASS8 | LNOFLSH | old_tty.lmode; + /* Note: if not using CBREAK mode, it makes no difference how we + set this */ + tty.tchars = new_tchars; + tty.tchars.t_intrc = quit_char; + if (tty_out->flow_control) + { + tty.tchars.t_startc = '\021'; + tty.tchars.t_stopc = '\023'; + } + + tty.lmode = LDECCTQ | LLITOUT | LPASS8 | LNOFLSH | tty_out->old_tty.lmode; #ifdef ultrix - /* Under Ultrix 4.2a, leaving this out doesn't seem to hurt - anything, and leaving it in breaks the meta key. Go figure. */ - tty.lmode &= ~LLITOUT; + /* Under Ultrix 4.2a, leaving this out doesn't seem to hurt + anything, and leaving it in breaks the meta key. Go figure. */ + tty.lmode &= ~LLITOUT; #endif - + #ifdef BSD4_1 - lmode = tty.lmode; + lmode = tty.lmode; #endif #endif /* HAVE_TCHARS */ #endif /* not HAVE_TERMIO */ #ifdef HAVE_LTCHARS - tty.ltchars = new_ltchars; + tty.ltchars = new_ltchars; #endif /* HAVE_LTCHARS */ #ifdef MSDOS /* Demacs 1.1.2 91/10/20 Manabu Higashida, MW Aug 1993 */ - if (!term_initted) - internal_terminal_init (); - dos_ttraw (); + if (!tty_out->term_initted) + internal_terminal_init (); + dos_ttraw (); #endif - EMACS_SET_TTY (input_fd, &tty, 0); + EMACS_SET_TTY (fileno (tty_out->input), &tty, 0); - /* This code added to insure that, if flow-control is not to be used, - we have an unlocked terminal at the start. */ + /* This code added to insure that, if flow-control is not to be used, + we have an unlocked terminal at the start. */ #ifdef TCXONC - if (!flow_control) ioctl (input_fd, TCXONC, 1); + if (!tty_out->flow_control) ioctl (fileno (tty_out->input), TCXONC, 1); #endif #ifndef APOLLO #ifdef TIOCSTART - if (!flow_control) ioctl (input_fd, TIOCSTART, 0); + if (!tty_out->flow_control) ioctl (fileno (tty_out->input), TIOCSTART, 0); #endif #endif #if defined (HAVE_TERMIOS) || defined (HPUX9) #ifdef TCOON - if (!flow_control) tcflow (input_fd, TCOON); + if (!tty_out->flow_control) tcflow (fileno (tty_out->input), TCOON); #endif #endif #ifdef AIXHFT - hft_init (); + hft_init (tty_out); #ifdef IBMR2AIX - { - /* IBM's HFT device usually thinks a ^J should be LF/CR. We need it - to be only LF. This is the way that is done. */ - struct termio tty; - - if (ioctl (1, HFTGETID, &tty) != -1) - write (1, "\033[20l", 5); - } + { + /* IBM's HFT device usually thinks a ^J should be LF/CR. We need it + to be only LF. This is the way that is done. */ + struct termio tty; + + if (ioctl (1, HFTGETID, &tty) != -1) + write (1, "\033[20l", 5); + } #endif #endif /* AIXHFT */ #ifdef VMS /* Appears to do nothing when in PASTHRU mode. - SYS$QIOW (0, input_fd, IO$_SETMODE|IO$M_OUTBAND, 0, 0, 0, + SYS$QIOW (0, fileno (tty_out->input), IO$_SETMODE|IO$M_OUTBAND, 0, 0, 0, interrupt_signal, oob_chars, 0, 0, 0, 0); */ - queue_kbd_input (0); + queue_kbd_input (0); #endif /* VMS */ - } #ifdef F_SETFL #ifndef F_SETOWN_BUG #ifdef F_GETOWN /* F_SETFL does not imply existence of F_GETOWN */ - if (interrupt_input - && ! read_socket_hook && EQ (Vwindow_system, Qnil)) + if (interrupt_input) { - old_fcntl_owner = fcntl (input_fd, F_GETOWN, 0); - fcntl (input_fd, F_SETOWN, getpid ()); - init_sigio (input_fd); + old_fcntl_owner[fileno (tty_out->input)] = + fcntl (fileno (tty_out->input), F_GETOWN, 0); + fcntl (fileno (tty_out->input), F_SETOWN, getpid ()); + init_sigio (fileno (tty_out->input)); #ifdef HAVE_GPM - if (term_gpm) + if (gpm_tty == tty_out) { + /* Arrange for mouse events to give us SIGIO signals. */ fcntl (gpm_fd, F_SETOWN, getpid ()); fcntl (gpm_fd, F_SETFL, fcntl (gpm_fd, F_GETFL, 0) | O_NONBLOCK); init_sigio (gpm_fd); @@ -1690,7 +1767,7 @@ init_sys_modes () #ifdef BSD4_1 if (interrupt_input) - init_sigio (input_fd); + init_sigio (fileno (tty_out->input)); #endif #ifdef VMS /* VMS sometimes has this symbol but lacks setvbuf. */ @@ -1700,53 +1777,57 @@ init_sys_modes () /* This symbol is defined on recent USG systems. Someone says without this call USG won't really buffer the file even with a call to setbuf. */ - setvbuf (stdout, (char *) _sobuf, _IOFBF, sizeof _sobuf); + setvbuf (tty_out->output, (char *) _sobuf, _IOFBF, sizeof _sobuf); #else - setbuf (stdout, (char *) _sobuf); + setbuf (tty_out->output, (char *) _sobuf); #endif -#ifdef HAVE_WINDOW_SYSTEM - /* Emacs' window system on MSDOG uses the `internal terminal' and therefore - needs the initialization code below. */ - if (EQ (Vwindow_system, Qnil) -#ifndef WINDOWSNT - /* When running in tty mode on NT/Win95, we have a read_socket - hook, but still need the rest of the initialization code below. */ - && (! read_socket_hook) -#endif - ) -#endif - set_terminal_modes (); - if (!term_initted - && FRAMEP (Vterminal_frame) - && FRAME_TERMCAP_P (XFRAME (Vterminal_frame))) - init_frame_faces (XFRAME (Vterminal_frame)); + if (tty_out->terminal->set_terminal_modes_hook) + tty_out->terminal->set_terminal_modes_hook (tty_out->terminal); - if (term_initted && no_redraw_on_reenter) + if (!tty_out->term_initted) { + Lisp_Object tail, frame; + FOR_EACH_FRAME (tail, frame) + { + /* XXX This needs to be revised. */ + if (FRAME_TERMCAP_P (XFRAME (frame)) + && FRAME_TTY (XFRAME (frame)) == tty_out) + init_frame_faces (XFRAME (frame)); + } + } + + if (tty_out->term_initted && no_redraw_on_reenter) + { + /* XXX This seems wrong on multi-tty. */ if (display_completed) direct_output_forward_char (0); } else { + Lisp_Object tail, frame; frame_garbaged = 1; - if (FRAMEP (Vterminal_frame)) - FRAME_GARBAGED_P (XFRAME (Vterminal_frame)) = 1; + FOR_EACH_FRAME (tail, frame) + { + if (FRAME_TERMCAP_P (XFRAME (frame)) + && FRAME_TTY (XFRAME (frame)) == tty_out) + FRAME_GARBAGED_P (XFRAME (frame)) = 1; + } } - term_initted = 1; + tty_out->term_initted = 1; } /* Return nonzero if safe to use tabs in output. At the time this is called, init_sys_modes has not been done yet. */ int -tabs_safe_p () +tabs_safe_p (int fd) { - struct emacs_tty tty; + struct emacs_tty etty; - EMACS_GET_TTY (input_fd, &tty); - return EMACS_TTY_TABS_OK (&tty); + EMACS_GET_TTY (fd, &etty); + return EMACS_TTY_TABS_OK (&etty); } /* Get terminal size from system. @@ -1754,8 +1835,7 @@ tabs_safe_p () We store 0 if there's no valid information. */ void -get_frame_size (widthp, heightp) - int *widthp, *heightp; +get_tty_size (int fd, int *widthp, int *heightp) { #ifdef TIOCGWINSZ @@ -1763,7 +1843,7 @@ get_frame_size (widthp, heightp) /* BSD-style. */ struct winsize size; - if (ioctl (input_fd, TIOCGWINSZ, &size) == -1) + if (ioctl (fd, TIOCGWINSZ, &size) == -1) *widthp = *heightp = 0; else { @@ -1777,7 +1857,7 @@ get_frame_size (widthp, heightp) /* SunOS - style. */ struct ttysize size; - if (ioctl (input_fd, TIOCGSIZE, &size) == -1) + if (ioctl (fd, TIOCGSIZE, &size) == -1) *widthp = *heightp = 0; else { @@ -1809,7 +1889,6 @@ get_frame_size (widthp, heightp) *widthp = 0; *heightp = 0; #endif - #endif /* not VMS */ #endif /* not SunOS-style */ #endif /* not BSD-style */ @@ -1853,37 +1932,58 @@ set_window_size (fd, height, width) } -/* Prepare the terminal for exiting Emacs; move the cursor to the - bottom of the frame, turn off interrupt-driven I/O, etc. */ + +/* Prepare all terminal devices for exiting Emacs. */ + void -reset_sys_modes () +reset_all_sys_modes (void) { - struct frame *sf; + struct tty_display_info *tty; + for (tty = tty_list; tty; tty = tty->next) + reset_sys_modes (tty); +} + +/* Prepare the terminal for closing it; move the cursor to the + bottom of the frame, turn off interrupt-driven I/O, etc. */ +void +reset_sys_modes (tty_out) + struct tty_display_info *tty_out; +{ if (noninteractive) { fflush (stdout); return; } - if (!term_initted) + if (!tty_out->term_initted) return; -#ifdef HAVE_WINDOW_SYSTEM - /* Emacs' window system on MSDOG uses the `internal terminal' and therefore - needs the clean-up code below. */ - if (!EQ (Vwindow_system, Qnil) -#ifndef WINDOWSNT - /* When running in tty mode on NT/Win95, we have a read_socket - hook, but still need the rest of the clean-up code below. */ - || read_socket_hook -#endif - ) - return; -#endif - sf = SELECTED_FRAME (); - cursor_to (FRAME_LINES (sf) - 1, 0); - clear_end_of_line (FRAME_COLS (sf)); - /* clear_end_of_line may move the cursor */ - cursor_to (FRAME_LINES (sf) - 1, 0); + + if (!tty_out->output) + return; /* The tty is suspended. */ + + /* Go to and clear the last line of the terminal. */ + + cmgoto (tty_out, FrameRows (tty_out) - 1, 0); + + /* Code adapted from tty_clear_end_of_line. */ + if (tty_out->TS_clr_line) + { + emacs_tputs (tty_out, tty_out->TS_clr_line, 1, cmputc); + } + else + { /* have to do it the hard way */ + int i; + tty_turn_off_insert (tty_out); + + for (i = curX (tty_out); i < FrameCols (tty_out) - 1; i++) + { + fputc (' ', tty_out->output); + } + } + + cmgoto (tty_out, FrameRows (tty_out) - 1, 0); + fflush (tty_out->output); + #if defined (IBMR2AIX) && defined (AIXHFT) { /* HFT devices normally use ^J as a LF/CR. We forced it to @@ -1895,12 +1995,13 @@ reset_sys_modes () } #endif - reset_terminal_modes (); - fflush (stdout); + if (tty_out->terminal->reset_terminal_modes_hook) + tty_out->terminal->reset_terminal_modes_hook (tty_out->terminal); + #ifdef BSD_SYSTEM #ifndef BSD4_1 /* Avoid possible loss of output when changing terminal modes. */ - fsync (fileno (stdout)); + fsync (fileno (tty_out->output)); #endif #endif @@ -1909,22 +2010,25 @@ reset_sys_modes () #ifdef F_SETOWN /* F_SETFL does not imply existence of F_SETOWN */ if (interrupt_input) { - reset_sigio (); - fcntl (input_fd, F_SETOWN, old_fcntl_owner); + reset_sigio (fileno (tty_out->input)); + fcntl (fileno (tty_out->input), F_SETOWN, + old_fcntl_owner[fileno (tty_out->input)]); } #endif /* F_SETOWN */ #endif /* F_SETOWN_BUG */ #ifdef O_NDELAY - fcntl (input_fd, F_SETFL, fcntl (input_fd, F_GETFL, 0) & ~O_NDELAY); + fcntl (fileno (tty_out->input), F_SETFL, + fcntl (fileno (tty_out->input), F_GETFL, 0) & ~O_NDELAY); #endif #endif /* F_SETFL */ #ifdef BSD4_1 if (interrupt_input) - reset_sigio (); + reset_sigio (fileno (tty_out->input)); #endif /* BSD4_1 */ - if (old_tty_valid) - while (EMACS_SET_TTY (input_fd, &old_tty, 0) < 0 && errno == EINTR) + if (tty_out->old_tty) + while (EMACS_SET_TTY (fileno (tty_out->input), + tty_out->old_tty, 0) < 0 && errno == EINTR) ; #ifdef MSDOS /* Demacs 1.1.2 91/10/20 Manabu Higashida */ @@ -1935,7 +2039,7 @@ reset_sys_modes () /* Ultrix's termios *ignores* any line discipline except TERMIODISC. A different old line discipline is therefore not restored, yet. Restore the old line discipline by hand. */ - ioctl (0, TIOCSETD, &old_tty.main.c_line); + ioctl (0, TIOCSETD, &tty_out->old_tty.main.c_line); #endif #ifdef AIXHFT @@ -1943,7 +2047,7 @@ reset_sys_modes () #endif #ifdef BSD_PGRPS - widen_foreground_group (); + widen_foreground_group (fileno (tty_out->input)); #endif } @@ -2008,9 +2112,9 @@ init_vms_input () { int status; - if (input_fd == 0) + if (fileno (CURTTY ()->input)) == 0) { - status = SYS$ASSIGN (&input_dsc, &input_fd, 0, 0); + status = SYS$ASSIGN (&input_dsc, &fileno (CURTTY ()->input)), 0, 0); if (! (status & 1)) LIB$STOP (status); } @@ -2021,7 +2125,7 @@ init_vms_input () void stop_vms_input () { - return SYS$DASSGN (input_fd); + return SYS$DASSGN (fileno (CURTTY ()->input))); } short input_buffer; @@ -2037,7 +2141,7 @@ queue_kbd_input () waiting_for_ast = 0; stop_input = 0; - status = SYS$QIO (0, input_fd, IO$_READVBLK, + status = SYS$QIO (0, fileno (CURTTY()->input), IO$_READVBLK, &input_iosb, kbd_input_ast, 1, &input_buffer, 1, 0, terminator_mask, 0, 0); } @@ -2154,7 +2258,7 @@ end_kbd_input () #endif if (LIB$AST_IN_PROG ()) /* Don't wait if suspending from kbd_buffer_store_event! */ { - SYS$CANCEL (input_fd); + SYS$CANCEL (fileno (CURTTY()->input)); return; } @@ -2163,7 +2267,7 @@ end_kbd_input () SYS$CLREF (input_ef); waiting_for_ast = 1; stop_input = 1; - SYS$CANCEL (input_fd); + SYS$CANCEL (fileno (CURTTY()->input)); SYS$SETAST (1); SYS$WAITFR (input_ef); waiting_for_ast = 0; @@ -2225,7 +2329,8 @@ init_sigio (fd) request_sigio (); } -reset_sigio () +reset_sigio (fd) + int fd; { unrequest_sigio (); } @@ -2567,7 +2672,9 @@ sys_select (nfds, rfds, wfds, efds, timeout) SELECT_TYPE *rfds, *wfds, *efds; EMACS_TIME *timeout; { - int ravail = 0; + /* XXX This needs to be updated for multi-tty support. Is there + anybody who needs to emulate select these days? */ + int ravail = 0; SELECT_TYPE orfds; int timeoutval; int *local_timeout; @@ -2582,7 +2689,7 @@ sys_select (nfds, rfds, wfds, efds, timeout) #if defined (HAVE_SELECT) && defined (HAVE_X_WINDOWS) /* If we're using X, then the native select will work; we only need the emulation for non-X usage. */ - if (!NILP (Vwindow_system)) + if (!NILP (Vinitial_window_system)) return select (nfds, rfds, wfds, efds, timeout); #endif timeoutval = timeout ? EMACS_SECS (*timeout) : 100000; @@ -2699,6 +2806,8 @@ sys_select (nfds, rfds, wfds, efds, timeout) void read_input_waiting () { + /* XXX This needs to be updated for multi-tty support. Is there + anybody who needs to emulate select these days? */ int nread, i; extern int quit_char; @@ -2752,6 +2861,10 @@ read_input_waiting () } } +#if !defined (HAVE_SELECT) || defined (BROKEN_SELECT_NON_X) +#define select sys_select +#endif + #endif /* not HAVE_SELECT */ #endif /* not VMS */ #endif /* not MSDOS */ @@ -2768,12 +2881,13 @@ init_sigio (fd) } void -reset_sigio () +reset_sigio (fd) + int fd; { if (noninteractive) return; lmode = ~LINTRUP & lmode; - ioctl (0, TIOCLSET, &lmode); + ioctl (fd, TIOCLSET, &lmode); } void @@ -3229,7 +3343,7 @@ sys_getenv (name) #undef abort sys_abort () { - reset_sys_modes (); + reset_all_sys_modes (); LIB$SIGNAL (SS$_DEBUG); } #endif /* abort */ @@ -3556,7 +3670,7 @@ croak (badfunc) char *badfunc; { printf ("%s not yet implemented\r\n", badfunc); - reset_sys_modes (); + reset_all_sys_modes (); exit (1); } @@ -5143,7 +5257,7 @@ croak (badfunc) char *badfunc; { printf ("%s not yet implemented\r\n", badfunc); - reset_sys_modes (); + reset_all_sys_modes (); exit (1); } @@ -5165,7 +5279,7 @@ srandom (seed) /* Called from init_sys_modes. */ void -hft_init () +hft_init (struct tty_display_info *tty_out) { int junk; @@ -5211,15 +5325,12 @@ hft_init () keymap.hfkey[1].hf_char = 127; hftctl (0, HFSKBD, &buf); } - /* The HFT system on AIX doesn't optimize for scrolling, so it's really ugly - at times. */ - line_ins_del_ok = char_ins_del_ok = 0; } /* Reset the rubout key to backspace. */ void -hft_reset () +hft_reset (struct tty_display_info *tty_out) { struct hfbuf buf; struct hfkeymap keymap; diff --git a/src/syssignal.h b/src/syssignal.h index b52e2dd4b95..72ac1ed7f62 100644 --- a/src/syssignal.h +++ b/src/syssignal.h @@ -33,6 +33,7 @@ extern pthread_t main_thread; indicate that SIGIO doesn't work by #undef-ing SIGIO. If this file #includes <signal.h>, then that will re-#define SIGIO and confuse things. */ +/* XXX This is not correct anymore, there is a BROKEN_SIGIO macro. */ #define SIGMASKTYPE sigset_t diff --git a/src/term.c b/src/term.c index 88e120d6d66..b84cea0ee36 100644 --- a/src/term.c +++ b/src/term.c @@ -25,10 +25,20 @@ Boston, MA 02110-1301, USA. */ #include <stdio.h> #include <ctype.h> #include <string.h> +#include <errno.h> +#include <sys/file.h> + #ifdef HAVE_UNISTD_H #include <unistd.h> #endif +#if HAVE_TERMIOS_H +#include <termios.h> /* For TIOCNOTTY. */ +#endif + +#include <signal.h> + +#include "lisp.h" #include "termchar.h" #include "termopts.h" #include "lisp.h" @@ -45,6 +55,8 @@ Boston, MA 02110-1301, USA. */ #include "window.h" #include "keymap.h" #include "blockinput.h" +#include "syssignal.h" +#include "systty.h" #include "intervals.h" /* For now, don't try to include termcap.h. On some systems, @@ -68,220 +80,74 @@ extern int tgetnum P_ ((char *id)); #include "macterm.h" #endif -static void turn_on_face P_ ((struct frame *, int face_id)); -static void turn_off_face P_ ((struct frame *, int face_id)); -static void tty_show_cursor P_ ((void)); -static void tty_hide_cursor P_ ((void)); - -#define OUTPUT(a) \ - tputs (a, (int) (FRAME_LINES (XFRAME (selected_frame)) - curY), cmputc) -#define OUTPUT1(a) tputs (a, 1, cmputc) -#define OUTPUTL(a, lines) tputs (a, lines, cmputc) - -#define OUTPUT_IF(a) \ - do { \ - if (a) \ - tputs (a, (int) (FRAME_LINES (XFRAME (selected_frame)) \ - - curY), cmputc); \ - } while (0) - -#define OUTPUT1_IF(a) do { if (a) tputs (a, 1, cmputc); } while (0) - -/* Display space properties */ +#ifndef O_RDWR +#define O_RDWR 2 +#endif -extern Lisp_Object Qspace, QCalign_to, QCwidth; +#ifndef O_NOCTTY +#define O_NOCTTY 0 +#endif -/* Function to use to ring the bell. */ +/* The name of the default console device. */ +#ifdef WINDOWSNT +#define DEV_TTY "CONOUT$" +#else +#define DEV_TTY "/dev/tty" +#endif -Lisp_Object Vring_bell_function; +static void tty_set_scroll_region P_ ((struct frame *f, int start, int stop)); +static void turn_on_face P_ ((struct frame *, int face_id)); +static void turn_off_face P_ ((struct frame *, int face_id)); +static void tty_show_cursor P_ ((struct tty_display_info *)); +static void tty_hide_cursor P_ ((struct tty_display_info *)); +static void tty_background_highlight P_ ((struct tty_display_info *tty)); +static void clear_tty_hooks P_ ((struct terminal *terminal)); +static void set_tty_hooks P_ ((struct terminal *terminal)); +static void dissociate_if_controlling_tty P_ ((int fd)); +static void delete_tty P_ ((struct terminal *)); + +#define OUTPUT(tty, a) \ + emacs_tputs ((tty), a, \ + (int) (FRAME_LINES (XFRAME (selected_frame)) \ + - curY (tty)), \ + cmputc) + +#define OUTPUT1(tty, a) emacs_tputs ((tty), a, 1, cmputc) +#define OUTPUTL(tty, a, lines) emacs_tputs ((tty), a, lines, cmputc) + +#define OUTPUT_IF(tty, a) \ + do { \ + if (a) \ + emacs_tputs ((tty), a, \ + (int) (FRAME_LINES (XFRAME (selected_frame)) \ + - curY (tty) ), \ + cmputc); \ + } while (0) + +#define OUTPUT1_IF(tty, a) do { if (a) emacs_tputs ((tty), a, 1, cmputc); } while (0) /* If true, use "vs", otherwise use "ve" to make the cursor visible. */ static int visible_cursor; -/* Terminal characteristics that higher levels want to look at. - These are all extern'd in termchar.h */ - -int must_write_spaces; /* Nonzero means spaces in the text - must actually be output; can't just skip - over some columns to leave them blank. */ -int min_padding_speed; /* Speed below which no padding necessary */ - -int line_ins_del_ok; /* Terminal can insert and delete lines */ -int char_ins_del_ok; /* Terminal can insert and delete chars */ -int scroll_region_ok; /* Terminal supports setting the - scroll window */ -int scroll_region_cost; /* Cost of setting a scroll window, - measured in characters */ -int memory_below_frame; /* Terminal remembers lines - scrolled off bottom */ -int fast_clear_end_of_line; /* Terminal has a `ce' string */ - -/* Nonzero means no need to redraw the entire frame on resuming - a suspended Emacs. This is useful on terminals with multiple pages, - where one page is used for Emacs and another for all else. */ - -int no_redraw_on_reenter; - -/* Hook functions that you can set to snap out the functions in this file. - These are all extern'd in termhooks.h */ - -void (*cursor_to_hook) P_ ((int, int)); -void (*raw_cursor_to_hook) P_ ((int, int)); -void (*clear_to_end_hook) P_ ((void)); -void (*clear_frame_hook) P_ ((void)); -void (*clear_end_of_line_hook) P_ ((int)); - -void (*ins_del_lines_hook) P_ ((int, int)); +/* Display space properties */ -void (*delete_glyphs_hook) P_ ((int)); +extern Lisp_Object Qspace, QCalign_to, QCwidth; -void (*ring_bell_hook) P_ ((void)); +/* Functions to call after suspending a tty. */ +Lisp_Object Vsuspend_tty_functions; -void (*reset_terminal_modes_hook) P_ ((void)); -void (*set_terminal_modes_hook) P_ ((void)); -void (*update_begin_hook) P_ ((struct frame *)); -void (*update_end_hook) P_ ((struct frame *)); -void (*set_terminal_window_hook) P_ ((int)); -void (*insert_glyphs_hook) P_ ((struct glyph *, int)); -void (*write_glyphs_hook) P_ ((struct glyph *, int)); -void (*delete_glyphs_hook) P_ ((int)); +/* Functions to call after resuming a tty. */ +Lisp_Object Vresume_tty_functions; -int (*read_socket_hook) P_ ((int, int, struct input_event *)); +/* Chain of all tty device parameters. */ +struct tty_display_info *tty_list; -void (*frame_up_to_date_hook) P_ ((struct frame *)); - -void (*mouse_position_hook) P_ ((FRAME_PTR *f, int insist, - Lisp_Object *bar_window, - enum scroll_bar_part *part, - Lisp_Object *x, - Lisp_Object *y, - unsigned long *time)); - -/* When reading from a minibuffer in a different frame, Emacs wants - to shift the highlight from the selected frame to the mini-buffer's - frame; under X, this means it lies about where the focus is. - This hook tells the window system code to re-decide where to put - the highlight. */ - -void (*frame_rehighlight_hook) P_ ((FRAME_PTR f)); - -/* If we're displaying frames using a window system that can stack - frames on top of each other, this hook allows you to bring a frame - to the front, or bury it behind all the other windows. If this - hook is zero, that means the device we're displaying on doesn't - support overlapping frames, so there's no need to raise or lower - anything. - - If RAISE is non-zero, F is brought to the front, before all other - windows. If RAISE is zero, F is sent to the back, behind all other - windows. */ - -void (*frame_raise_lower_hook) P_ ((FRAME_PTR f, int raise)); - -/* If the value of the frame parameter changed, whis hook is called. - For example, if going from fullscreen to not fullscreen this hook - may do something OS dependent, like extended window manager hints on X11. */ -void (*fullscreen_hook) P_ ((struct frame *f)); - -/* Set the vertical scroll bar for WINDOW to have its upper left corner - at (TOP, LEFT), and be LENGTH rows high. Set its handle to - indicate that we are displaying PORTION characters out of a total - of WHOLE characters, starting at POSITION. If WINDOW doesn't yet - have a scroll bar, create one for it. */ - -void (*set_vertical_scroll_bar_hook) - P_ ((struct window *window, - int portion, int whole, int position)); - - -/* The following three hooks are used when we're doing a thorough - redisplay of the frame. We don't explicitly know which scroll bars - are going to be deleted, because keeping track of when windows go - away is a real pain - can you say set-window-configuration? - Instead, we just assert at the beginning of redisplay that *all* - scroll bars are to be removed, and then save scroll bars from the - fiery pit when we actually redisplay their window. */ - -/* Arrange for all scroll bars on FRAME to be removed at the next call - to `*judge_scroll_bars_hook'. A scroll bar may be spared if - `*redeem_scroll_bar_hook' is applied to its window before the judgment. - - This should be applied to each frame each time its window tree is - redisplayed, even if it is not displaying scroll bars at the moment; - if the HAS_SCROLL_BARS flag has just been turned off, only calling - this and the judge_scroll_bars_hook will get rid of them. - - If non-zero, this hook should be safe to apply to any frame, - whether or not it can support scroll bars, and whether or not it is - currently displaying them. */ - -void (*condemn_scroll_bars_hook) P_ ((FRAME_PTR frame)); - -/* Unmark WINDOW's scroll bar for deletion in this judgement cycle. - Note that it's okay to redeem a scroll bar that is not condemned. */ - -void (*redeem_scroll_bar_hook) P_ ((struct window *window)); - -/* Remove all scroll bars on FRAME that haven't been saved since the - last call to `*condemn_scroll_bars_hook'. - - This should be applied to each frame after each time its window - tree is redisplayed, even if it is not displaying scroll bars at the - moment; if the HAS_SCROLL_BARS flag has just been turned off, only - calling this and condemn_scroll_bars_hook will get rid of them. - - If non-zero, this hook should be safe to apply to any frame, - whether or not it can support scroll bars, and whether or not it is - currently displaying them. */ - -void (*judge_scroll_bars_hook) P_ ((FRAME_PTR FRAME)); - -/* Strings, numbers and flags taken from the termcap entry. */ - -char *TS_ins_line; /* "al" */ -char *TS_ins_multi_lines; /* "AL" (one parameter, # lines to insert) */ -char *TS_bell; /* "bl" */ -char *TS_clr_to_bottom; /* "cd" */ -char *TS_clr_line; /* "ce", clear to end of line */ -char *TS_clr_frame; /* "cl" */ -char *TS_set_scroll_region; /* "cs" (2 params, first line and last line) */ -char *TS_set_scroll_region_1; /* "cS" (4 params: total lines, - lines above scroll region, lines below it, - total lines again) */ -char *TS_del_char; /* "dc" */ -char *TS_del_multi_chars; /* "DC" (one parameter, # chars to delete) */ -char *TS_del_line; /* "dl" */ -char *TS_del_multi_lines; /* "DL" (one parameter, # lines to delete) */ -char *TS_delete_mode; /* "dm", enter character-delete mode */ -char *TS_end_delete_mode; /* "ed", leave character-delete mode */ -char *TS_end_insert_mode; /* "ei", leave character-insert mode */ -char *TS_ins_char; /* "ic" */ -char *TS_ins_multi_chars; /* "IC" (one parameter, # chars to insert) */ -char *TS_insert_mode; /* "im", enter character-insert mode */ -char *TS_pad_inserted_char; /* "ip". Just padding, no commands. */ -char *TS_end_keypad_mode; /* "ke" */ -char *TS_keypad_mode; /* "ks" */ -char *TS_pad_char; /* "pc", char to use as padding */ -char *TS_repeat; /* "rp" (2 params, # times to repeat - and character to be repeated) */ -char *TS_end_standout_mode; /* "se" */ -char *TS_fwd_scroll; /* "sf" */ -char *TS_standout_mode; /* "so" */ -char *TS_rev_scroll; /* "sr" */ -char *TS_end_termcap_modes; /* "te" */ -char *TS_termcap_modes; /* "ti" */ -char *TS_visible_bell; /* "vb" */ -char *TS_cursor_normal; /* "ve" */ -char *TS_cursor_visible; /* "vs" */ -char *TS_cursor_invisible; /* "vi" */ -char *TS_set_window; /* "wi" (4 params, start and end of window, - each as vpos and hpos) */ - -/* Value of the "NC" (no_color_video) capability, or 0 if not - present. */ - -static int TN_no_color_video; +/* Nonzero means no need to redraw the entire frame on resuming a + suspended Emacs. This is useful on terminals with multiple + pages, where one page is used for Emacs and another for all + else. */ +int no_redraw_on_reenter; /* Meaning of bits in no_color_video. Each bit set means that the corresponding attribute cannot be combined with colors. */ @@ -299,68 +165,6 @@ enum no_color_bit NC_ALT_CHARSET = 1 << 8 }; -/* "md" -- turn on bold (extra bright mode). */ - -char *TS_enter_bold_mode; - -/* "mh" -- turn on half-bright mode. */ - -char *TS_enter_dim_mode; - -/* "mb" -- enter blinking mode. */ - -char *TS_enter_blink_mode; - -/* "mr" -- enter reverse video mode. */ - -char *TS_enter_reverse_mode; - -/* "us"/"ue" -- start/end underlining. */ - -char *TS_exit_underline_mode, *TS_enter_underline_mode; - -/* "as"/"ae" -- start/end alternate character set. Not really - supported, yet. */ - -char *TS_enter_alt_charset_mode, *TS_exit_alt_charset_mode; - -/* "me" -- switch appearances off. */ - -char *TS_exit_attribute_mode; - -/* "Co" -- number of colors. */ - -int TN_max_colors; - -/* "pa" -- max. number of color pairs on screen. Not handled yet. - Could be a problem if not equal to TN_max_colors * TN_max_colors. */ - -int TN_max_pairs; - -/* "op" -- SVr4 set default pair to its original value. */ - -char *TS_orig_pair; - -/* "AF"/"AB" or "Sf"/"Sb"-- set ANSI or SVr4 foreground/background color. - 1 param, the color index. */ - -char *TS_set_foreground, *TS_set_background; - -int TF_hazeltine; /* termcap hz flag. */ -int TF_insmode_motion; /* termcap mi flag: can move while in insert mode. */ -int TF_standout_motion; /* termcap mi flag: can move while in standout mode. */ -int TF_underscore; /* termcap ul flag: _ underlines if over-struck on - non-blank position. Must clear before writing _. */ -int TF_teleray; /* termcap xt flag: many weird consequences. - For t1061. */ - -static int RPov; /* # chars to start a TS_repeat */ - -static int delete_in_insert_mode; /* delete mode == insert mode */ - -static int se_is_so; /* 1 if same string both enters and leaves - standout mode */ - /* internal state */ /* The largest frame width in any call to calculate_costs. */ @@ -371,57 +175,27 @@ int max_frame_cols; int max_frame_lines; -static int costs_set; /* Nonzero if costs have been calculated. */ - -int insert_mode; /* Nonzero when in insert mode. */ -int standout_mode; /* Nonzero when in standout mode. */ - -/* Size of window specified by higher levels. - This is the number of lines, from the top of frame downwards, - which can participate in insert-line/delete-line operations. - - Effectively it excludes the bottom frame_lines - specified_window_size - lines from those operations. */ - -int specified_window; - -/* Frame currently being redisplayed; 0 if not currently redisplaying. - (Direct output does not count). */ - -FRAME_PTR updating_frame; +/* Non-zero if we have dropped our controlling tty and therefore + should not open a frame on stdout. */ +static int no_controlling_tty; /* Provided for lisp packages. */ static int system_uses_terminfo; -/* Flag used in tty_show/hide_cursor. */ - -static int tty_cursor_hidden; - char *tparam (); extern char *tgetstr (); - -static void term_clear_mouse_face (); -static void term_mouse_highlight (struct frame *f, int x, int y); -#ifdef WINDOWSNT -/* We aren't X windows, but we aren't termcap either. This makes me - uncertain as to what value to use for frame.output_method. For - this file, we'll define FRAME_TERMCAP_P to be zero so that our - output hooks get called instead of the termcap functions. Probably - the best long-term solution is to define an output_windows_nt... */ - -#undef FRAME_TERMCAP_P -#define FRAME_TERMCAP_P(_f_) 0 -#endif /* WINDOWSNT */ - #ifdef HAVE_GPM #include <sys/fcntl.h> -/* Nonzero means mouse is enabled on Linux console. */ -int term_gpm = 0; +static void term_clear_mouse_face (); +static void term_mouse_highlight (struct frame *f, int x, int y); + +/* The device for which we have enabled gpm support (or NULL). */ +struct tty_display_info *gpm_tty = NULL; /* These variables describe the range of text currently shown in its mouse-face, together with the window they apply to. As long as @@ -431,199 +205,180 @@ int term_gpm = 0; static int mouse_face_beg_row, mouse_face_beg_col; static int mouse_face_end_row, mouse_face_end_col; static int mouse_face_past_end; -static Lisp_Object Qmouse_face_window; +static Lisp_Object mouse_face_window; static int mouse_face_face_id; static int pos_x, pos_y; static int last_mouse_x, last_mouse_y; #endif /* HAVE_GPM */ -void -ring_bell () -{ - if (!NILP (Vring_bell_function)) - { - Lisp_Object function; - - /* Temporarily set the global variable to nil - so that if we get an error, it stays nil - and we don't call it over and over. +/* Ring the bell on a tty. */ - We don't specbind it, because that would carefully - restore the bad value if there's an error - and make the loop of errors happen anyway. */ - - function = Vring_bell_function; - Vring_bell_function = Qnil; - - call0 (function); +static void +tty_ring_bell (struct frame *f) +{ + struct tty_display_info *tty = FRAME_TTY (f); - Vring_bell_function = function; + if (tty->output) + { + OUTPUT (tty, (tty->TS_visible_bell && visible_bell + ? tty->TS_visible_bell + : tty->TS_bell)); + fflush (tty->output); } - else if (!FRAME_TERMCAP_P (XFRAME (selected_frame))) - (*ring_bell_hook) (); - else - OUTPUT (TS_visible_bell && visible_bell ? TS_visible_bell : TS_bell); } +/* Set up termcap modes for Emacs. */ + void -set_terminal_modes () +tty_set_terminal_modes (struct terminal *terminal) { - if (FRAME_TERMCAP_P (XFRAME (selected_frame))) + struct tty_display_info *tty = terminal->display_info.tty; + + if (tty->output) { - if (TS_termcap_modes) - OUTPUT (TS_termcap_modes); + if (tty->TS_termcap_modes) + OUTPUT (tty, tty->TS_termcap_modes); else - { - /* Output enough newlines to scroll all the old screen contents - off the screen, so it won't be overwritten and lost. */ - int i; - for (i = 0; i < FRAME_LINES (XFRAME (selected_frame)); i++) - putchar ('\n'); - } - - OUTPUT_IF (visible_cursor ? TS_cursor_visible : TS_cursor_normal); - OUTPUT_IF (TS_keypad_mode); - losecursor (); + { + /* Output enough newlines to scroll all the old screen contents + off the screen, so it won't be overwritten and lost. */ + int i; + current_tty = tty; + for (i = 0; i < FRAME_LINES (XFRAME (selected_frame)); i++) + cmputc ('\n'); + } + + OUTPUT_IF (tty, tty->TS_termcap_modes); + OUTPUT_IF (tty, visible_cursor ? tty->TS_cursor_visible : tty->TS_cursor_normal); + OUTPUT_IF (tty, tty->TS_keypad_mode); + losecursor (tty); + fflush (tty->output); } - else - (*set_terminal_modes_hook) (); } +/* Reset termcap modes before exiting Emacs. */ + void -reset_terminal_modes () +tty_reset_terminal_modes (struct terminal *terminal) { - if (FRAME_TERMCAP_P (XFRAME (selected_frame))) + struct tty_display_info *tty = terminal->display_info.tty; + + if (tty->output) { - turn_off_highlight (); - turn_off_insert (); - OUTPUT_IF (TS_end_keypad_mode); - OUTPUT_IF (TS_cursor_normal); - OUTPUT_IF (TS_end_termcap_modes); - OUTPUT_IF (TS_orig_pair); + tty_turn_off_highlight (tty); + tty_turn_off_insert (tty); + OUTPUT_IF (tty, tty->TS_end_keypad_mode); + OUTPUT_IF (tty, tty->TS_cursor_normal); + OUTPUT_IF (tty, tty->TS_end_termcap_modes); + OUTPUT_IF (tty, tty->TS_orig_pair); /* Output raw CR so kernel can track the cursor hpos. */ + current_tty = tty; cmputc ('\r'); + fflush (tty->output); } - else if (reset_terminal_modes_hook) - (*reset_terminal_modes_hook) (); } -void -update_begin (f) - struct frame *f; -{ - updating_frame = f; - if (!FRAME_TERMCAP_P (f)) - update_begin_hook (f); -} +/* Flag the end of a display update on a termcap terminal. */ -void -update_end (f) - struct frame *f; +static void +tty_update_end (struct frame *f) { - if (FRAME_TERMCAP_P (f)) - { - if (!XWINDOW (selected_window)->cursor_off_p) - tty_show_cursor (); - turn_off_insert (); - background_highlight (); - } - else - update_end_hook (f); + struct tty_display_info *tty = FRAME_TTY (f); - updating_frame = NULL; + if (!XWINDOW (selected_window)->cursor_off_p) + tty_show_cursor (tty); + tty_turn_off_insert (tty); + tty_background_highlight (tty); } -void -set_terminal_window (size) - int size; +/* The implementation of set_terminal_window for termcap frames. */ + +static void +tty_set_terminal_window (struct frame *f, int size) { - if (FRAME_TERMCAP_P (updating_frame)) - { - specified_window = size ? size : FRAME_LINES (updating_frame); - if (scroll_region_ok) - set_scroll_region (0, specified_window); - } - else - set_terminal_window_hook (size); + struct tty_display_info *tty = FRAME_TTY (f); + + tty->specified_window = size ? size : FRAME_LINES (f); + if (FRAME_SCROLL_REGION_OK (f)) + tty_set_scroll_region (f, 0, tty->specified_window); } -void -set_scroll_region (start, stop) - int start, stop; +static void +tty_set_scroll_region (struct frame *f, int start, int stop) { char *buf; - struct frame *sf = XFRAME (selected_frame); - - if (TS_set_scroll_region) - buf = tparam (TS_set_scroll_region, 0, 0, start, stop - 1); - else if (TS_set_scroll_region_1) - buf = tparam (TS_set_scroll_region_1, 0, 0, - FRAME_LINES (sf), start, - FRAME_LINES (sf) - stop, - FRAME_LINES (sf)); + struct tty_display_info *tty = FRAME_TTY (f); + + if (tty->TS_set_scroll_region) + buf = tparam (tty->TS_set_scroll_region, 0, 0, start, stop - 1); + else if (tty->TS_set_scroll_region_1) + buf = tparam (tty->TS_set_scroll_region_1, 0, 0, + FRAME_LINES (f), start, + FRAME_LINES (f) - stop, + FRAME_LINES (f)); else - buf = tparam (TS_set_window, 0, 0, start, 0, stop, FRAME_COLS (sf)); + buf = tparam (tty->TS_set_window, 0, 0, start, 0, stop, FRAME_COLS (f)); - OUTPUT (buf); + OUTPUT (tty, buf); xfree (buf); - losecursor (); + losecursor (tty); } static void -turn_on_insert () +tty_turn_on_insert (struct tty_display_info *tty) { - if (!insert_mode) - OUTPUT (TS_insert_mode); - insert_mode = 1; + if (!tty->insert_mode) + OUTPUT (tty, tty->TS_insert_mode); + tty->insert_mode = 1; } void -turn_off_insert () +tty_turn_off_insert (struct tty_display_info *tty) { - if (insert_mode) - OUTPUT (TS_end_insert_mode); - insert_mode = 0; + if (tty->insert_mode) + OUTPUT (tty, tty->TS_end_insert_mode); + tty->insert_mode = 0; } /* Handle highlighting. */ void -turn_off_highlight () +tty_turn_off_highlight (struct tty_display_info *tty) { - if (standout_mode) - OUTPUT_IF (TS_end_standout_mode); - standout_mode = 0; + if (tty->standout_mode) + OUTPUT_IF (tty, tty->TS_end_standout_mode); + tty->standout_mode = 0; } static void -turn_on_highlight () +tty_turn_on_highlight (struct tty_display_info *tty) { - if (!standout_mode) - OUTPUT_IF (TS_standout_mode); - standout_mode = 1; + if (!tty->standout_mode) + OUTPUT_IF (tty, tty->TS_standout_mode); + tty->standout_mode = 1; } static void -toggle_highlight () +tty_toggle_highlight (struct tty_display_info *tty) { - if (standout_mode) - turn_off_highlight (); + if (tty->standout_mode) + tty_turn_off_highlight (tty); else - turn_on_highlight (); + tty_turn_on_highlight (tty); } /* Make cursor invisible. */ static void -tty_hide_cursor () +tty_hide_cursor (struct tty_display_info *tty) { - if (tty_cursor_hidden == 0) + if (tty->cursor_hidden == 0) { - tty_cursor_hidden = 1; - OUTPUT_IF (TS_cursor_invisible); + tty->cursor_hidden = 1; + OUTPUT_IF (tty, tty->TS_cursor_invisible); } } @@ -631,14 +386,14 @@ tty_hide_cursor () /* Ensure that cursor is visible. */ static void -tty_show_cursor () +tty_show_cursor (struct tty_display_info *tty) { - if (tty_cursor_hidden) + if (tty->cursor_hidden) { - tty_cursor_hidden = 0; - OUTPUT_IF (TS_cursor_normal); + tty->cursor_hidden = 0; + OUTPUT_IF (tty, tty->TS_cursor_normal); if (visible_cursor) - OUTPUT_IF (TS_cursor_visible); + OUTPUT_IF (tty, tty->TS_cursor_visible); } } @@ -647,180 +402,151 @@ tty_show_cursor () empty space inside windows. What this is, depends on the user option inverse-video. */ -void -background_highlight () +static void +tty_background_highlight (struct tty_display_info *tty) { if (inverse_video) - turn_on_highlight (); + tty_turn_on_highlight (tty); else - turn_off_highlight (); + tty_turn_off_highlight (tty); } /* Set standout mode to the mode specified for the text to be output. */ static void -highlight_if_desired () +tty_highlight_if_desired (struct tty_display_info *tty) { if (inverse_video) - turn_on_highlight (); + tty_turn_on_highlight (tty); else - turn_off_highlight (); + tty_turn_off_highlight (tty); } /* Move cursor to row/column position VPOS/HPOS. HPOS/VPOS are frame-relative coordinates. */ -void -cursor_to (vpos, hpos) - int vpos, hpos; +static void +tty_cursor_to (struct frame *f, int vpos, int hpos) { - struct frame *f = updating_frame ? updating_frame : XFRAME (selected_frame); - - if (! FRAME_TERMCAP_P (f) && cursor_to_hook) - { - (*cursor_to_hook) (vpos, hpos); - return; - } + struct tty_display_info *tty = FRAME_TTY (f); /* Detect the case where we are called from reset_sys_modes and the costs have never been calculated. Do nothing. */ - if (! costs_set) + if (! tty->costs_set) return; - if (curY == vpos && curX == hpos) + if (curY (tty) == vpos + && curX (tty) == hpos) return; - if (!TF_standout_motion) - background_highlight (); - if (!TF_insmode_motion) - turn_off_insert (); - cmgoto (vpos, hpos); + if (!tty->TF_standout_motion) + tty_background_highlight (tty); + if (!tty->TF_insmode_motion) + tty_turn_off_insert (tty); + cmgoto (tty, vpos, hpos); } /* Similar but don't take any account of the wasted characters. */ -void -raw_cursor_to (row, col) - int row, col; +static void +tty_raw_cursor_to (struct frame *f, int row, int col) { - struct frame *f = updating_frame ? updating_frame : XFRAME (selected_frame); - if (! FRAME_TERMCAP_P (f)) - { - (*raw_cursor_to_hook) (row, col); - return; - } - if (curY == row && curX == col) + struct tty_display_info *tty = FRAME_TTY (f); + + if (curY (tty) == row + && curX (tty) == col) return; - if (!TF_standout_motion) - background_highlight (); - if (!TF_insmode_motion) - turn_off_insert (); - cmgoto (row, col); + if (!tty->TF_standout_motion) + tty_background_highlight (tty); + if (!tty->TF_insmode_motion) + tty_turn_off_insert (tty); + cmgoto (tty, row, col); } /* Erase operations */ -/* clear from cursor to end of frame */ -void -clear_to_end () +/* Clear from cursor to end of frame on a termcap device. */ + +static void +tty_clear_to_end (struct frame *f) { register int i; + struct tty_display_info *tty = FRAME_TTY (f); - if (clear_to_end_hook && ! FRAME_TERMCAP_P (updating_frame)) + if (tty->TS_clr_to_bottom) { - (*clear_to_end_hook) (); - return; - } - if (TS_clr_to_bottom) - { - background_highlight (); - OUTPUT (TS_clr_to_bottom); + tty_background_highlight (tty); + OUTPUT (tty, tty->TS_clr_to_bottom); } else { - for (i = curY; i < FRAME_LINES (XFRAME (selected_frame)); i++) + for (i = curY (tty); i < FRAME_LINES (f); i++) { - cursor_to (i, 0); - clear_end_of_line (FRAME_COLS (XFRAME (selected_frame))); + cursor_to (f, i, 0); + clear_end_of_line (f, FRAME_COLS (f)); } } } -/* Clear entire frame */ +/* Clear an entire termcap frame. */ -void -clear_frame () +static void +tty_clear_frame (struct frame *f) { - struct frame *sf = XFRAME (selected_frame); + struct tty_display_info *tty = FRAME_TTY (f); - if (clear_frame_hook - && ! FRAME_TERMCAP_P ((updating_frame ? updating_frame : sf))) - { - (*clear_frame_hook) (); - return; - } - if (TS_clr_frame) + if (tty->TS_clr_frame) { - background_highlight (); - OUTPUT (TS_clr_frame); - cmat (0, 0); + tty_background_highlight (tty); + OUTPUT (tty, tty->TS_clr_frame); + cmat (tty, 0, 0); } else { - cursor_to (0, 0); - clear_to_end (); + cursor_to (f, 0, 0); + clear_to_end (f); } } -/* Clear from cursor to end of line. - Assume that the line is already clear starting at column first_unused_hpos. +/* An implementation of clear_end_of_line for termcap frames. Note that the cursor may be moved, on terminals lacking a `ce' string. */ -void -clear_end_of_line (first_unused_hpos) - int first_unused_hpos; +static void +tty_clear_end_of_line (struct frame *f, int first_unused_hpos) { register int i; - - if (clear_end_of_line_hook - && ! FRAME_TERMCAP_P ((updating_frame - ? updating_frame - : XFRAME (selected_frame)))) - { - (*clear_end_of_line_hook) (first_unused_hpos); - return; - } + struct tty_display_info *tty = FRAME_TTY (f); /* Detect the case where we are called from reset_sys_modes and the costs have never been calculated. Do nothing. */ - if (! costs_set) + if (! tty->costs_set) return; - if (curX >= first_unused_hpos) + if (curX (tty) >= first_unused_hpos) return; - background_highlight (); - if (TS_clr_line) + tty_background_highlight (tty); + if (tty->TS_clr_line) { - OUTPUT1 (TS_clr_line); + OUTPUT1 (tty, tty->TS_clr_line); } else { /* have to do it the hard way */ - struct frame *sf = XFRAME (selected_frame); - turn_off_insert (); + tty_turn_off_insert (tty); /* Do not write in last row last col with Auto-wrap on. */ - if (AutoWrap && curY == FRAME_LINES (sf) - 1 - && first_unused_hpos == FRAME_COLS (sf)) + if (AutoWrap (tty) + && curY (tty) == FrameRows (tty) - 1 + && first_unused_hpos == FrameCols (tty)) first_unused_hpos--; - for (i = curX; i < first_unused_hpos; i++) + for (i = curX (tty); i < first_unused_hpos; i++) { - if (termscript) - fputc (' ', termscript); - putchar (' '); + if (tty->termscript) + fputc (' ', tty->termscript); + fputc (' ', tty->output); } - cmplus (first_unused_hpos - curX); + cmplus (tty, first_unused_hpos - curX (tty)); } } @@ -1005,44 +731,37 @@ encode_terminal_code (src, src_len, coding) } -void -write_glyphs (string, len) - register struct glyph *string; - register int len; + +/* An implementation of write_glyphs for termcap frames. */ + +static void +tty_write_glyphs (struct frame *f, struct glyph *string, int len) { - int produced, consumed; - struct frame *sf = XFRAME (selected_frame); - struct frame *f = updating_frame ? updating_frame : sf; unsigned char *conversion_buffer; struct coding_system *coding; - if (write_glyphs_hook - && ! FRAME_TERMCAP_P (f)) - { - (*write_glyphs_hook) (string, len); - return; - } + struct tty_display_info *tty = FRAME_TTY (f); - turn_off_insert (); - tty_hide_cursor (); + tty_turn_off_insert (tty); + tty_hide_cursor (tty); /* Don't dare write in last column of bottom line, if Auto-Wrap, since that would scroll the whole frame on some terminals. */ - if (AutoWrap - && curY + 1 == FRAME_LINES (sf) - && (curX + len) == FRAME_COLS (sf)) + if (AutoWrap (tty) + && curY (tty) + 1 == FRAME_LINES (f) + && (curX (tty) + len) == FRAME_COLS (f)) len --; if (len <= 0) return; - cmplus (len); + cmplus (tty, len); /* If terminal_coding does any conversion, use it, otherwise use safe_terminal_coding. We can't use CODING_REQUIRE_ENCODING here because it always return 1 if the member src_multibyte is 1. */ - coding = (terminal_coding.common_flags & CODING_REQUIRE_ENCODING_MASK - ? &terminal_coding : &safe_terminal_coding); + coding = (FRAME_TERMINAL_CODING (f)->common_flags & CODING_REQUIRE_ENCODING_MASK + ? FRAME_TERMINAL_CODING (f) : &safe_terminal_coding); /* The mode bit CODING_MODE_LAST_BLOCK should be set to 1 only at the tail. */ coding->mode &= ~CODING_MODE_LAST_BLOCK; @@ -1058,7 +777,7 @@ write_glyphs (string, len) break; /* Turn appearance modes of the face of the run on. */ - highlight_if_desired (); + tty_highlight_if_desired (tty); turn_on_face (f, face_id); if (n == len) @@ -1068,11 +787,11 @@ write_glyphs (string, len) if (coding->produced > 0) { BLOCK_INPUT; - fwrite (conversion_buffer, 1, coding->produced, stdout); - if (ferror (stdout)) - clearerr (stdout); - if (termscript) - fwrite (conversion_buffer, 1, coding->produced, termscript); + fwrite (conversion_buffer, 1, coding->produced, tty->output); + if (ferror (tty->output)) + clearerr (tty->output); + if (tty->termscript) + fwrite (conversion_buffer, 1, coding->produced, tty->termscript); UNBLOCK_INPUT; } len -= n; @@ -1080,49 +799,51 @@ write_glyphs (string, len) /* Turn appearance modes off. */ turn_off_face (f, face_id); - turn_off_highlight (); + tty_turn_off_highlight (tty); } - cmcheckmagic (); + cmcheckmagic (tty); } -void -write_glyphs_with_face (string, len, face_id) +#ifdef HAVE_GPM /* Only used by GPM code. */ + +static void +tty_write_glyphs_with_face (f, string, len, face_id) + register struct frame *f; register struct glyph *string; register int len, face_id; { - struct frame *sf = XFRAME (selected_frame); - struct frame *f = updating_frame ? updating_frame : sf; unsigned char *conversion_buffer; struct coding_system *coding; - turn_off_insert (); - tty_hide_cursor (); + struct tty_display_info *tty = FRAME_TTY (f); + + tty_turn_off_insert (tty); + tty_hide_cursor (tty); /* Don't dare write in last column of bottom line, if Auto-Wrap, since that would scroll the whole frame on some terminals. */ - if (AutoWrap - && curY + 1 == FRAME_LINES (sf) - && (curX + len) == FRAME_COLS (sf)) + if (AutoWrap (tty) + && curY (tty) + 1 == FRAME_LINES (f) + && (curX (tty) + len) == FRAME_COLS (f)) len --; if (len <= 0) return; - cmplus (len); + cmplus (tty, len); /* If terminal_coding does any conversion, use it, otherwise use safe_terminal_coding. We can't use CODING_REQUIRE_ENCODING here because it always return 1 if the member src_multibyte is 1. */ - coding = (terminal_coding.common_flags & CODING_REQUIRE_ENCODING_MASK - ? &terminal_coding : &safe_terminal_coding); + coding = (FRAME_TERMINAL_CODING (f)->common_flags & CODING_REQUIRE_ENCODING_MASK + ? FRAME_TERMINAL_CODING (f) : &safe_terminal_coding); /* The mode bit CODING_MODE_LAST_BLOCK should be set to 1 only at the tail. */ coding->mode &= ~CODING_MODE_LAST_BLOCK; - /* Turn appearance modes of the face. */ - highlight_if_desired (); + tty_highlight_if_desired (tty); turn_on_face (f, face_id); coding->mode |= CODING_MODE_LAST_BLOCK; @@ -1130,59 +851,47 @@ write_glyphs_with_face (string, len, face_id) if (coding->produced > 0) { BLOCK_INPUT; - fwrite (conversion_buffer, 1, coding->produced, stdout); - if (ferror (stdout)) - clearerr (stdout); - if (termscript) - fwrite (conversion_buffer, 1, coding->produced, termscript); + fwrite (conversion_buffer, 1, coding->produced, tty->output); + if (ferror (tty->output)) + clearerr (tty->output); + if (tty->termscript) + fwrite (conversion_buffer, 1, coding->produced, tty->termscript); UNBLOCK_INPUT; } /* Turn appearance modes off. */ turn_off_face (f, face_id); - turn_off_highlight (); + tty_turn_off_highlight (tty); - cmcheckmagic (); + cmcheckmagic (tty); } +#endif -/* If start is zero, insert blanks instead of a string at start */ +/* An implementation of insert_glyphs for termcap frames. */ -void -insert_glyphs (start, len) - register struct glyph *start; - register int len; +static void +tty_insert_glyphs (struct frame *f, struct glyph *start, int len) { char *buf; struct glyph *glyph = NULL; - struct frame *f, *sf; unsigned char *conversion_buffer; unsigned char space[1]; struct coding_system *coding; - if (len <= 0) - return; - - if (insert_glyphs_hook) - { - (*insert_glyphs_hook) (start, len); - return; - } + struct tty_display_info *tty = FRAME_TTY (f); - sf = XFRAME (selected_frame); - f = updating_frame ? updating_frame : sf; - - if (TS_ins_multi_chars) + if (tty->TS_ins_multi_chars) { - buf = tparam (TS_ins_multi_chars, 0, 0, len); - OUTPUT1 (buf); + buf = tparam (tty->TS_ins_multi_chars, 0, 0, len); + OUTPUT1 (tty, buf); xfree (buf); if (start) - write_glyphs (start, len); + write_glyphs (f, start, len); return; } - turn_on_insert (); - cmplus (len); + tty_turn_on_insert (tty); + cmplus (tty, len); if (! start) space[0] = SPACEGLYPH; @@ -1190,15 +899,15 @@ insert_glyphs (start, len) /* If terminal_coding does any conversion, use it, otherwise use safe_terminal_coding. We can't use CODING_REQUIRE_ENCODING here because it always return 1 if the member src_multibyte is 1. */ - coding = (terminal_coding.common_flags & CODING_REQUIRE_ENCODING_MASK - ? &terminal_coding : &safe_terminal_coding); + coding = (FRAME_TERMINAL_CODING (f)->common_flags & CODING_REQUIRE_ENCODING_MASK + ? FRAME_TERMINAL_CODING (f) : &safe_terminal_coding); /* The mode bit CODING_MODE_LAST_BLOCK should be set to 1 only at the tail. */ coding->mode &= ~CODING_MODE_LAST_BLOCK; while (len-- > 0) { - OUTPUT1_IF (TS_ins_char); + OUTPUT1_IF (tty, tty->TS_ins_char); if (!start) { conversion_buffer = space; @@ -1206,7 +915,7 @@ insert_glyphs (start, len) } else { - highlight_if_desired (); + tty_highlight_if_desired (tty); turn_on_face (f, start->face_id); glyph = start; ++start; @@ -1214,7 +923,7 @@ insert_glyphs (start, len) occupies more than one column. */ while (len && CHAR_GLYPH_PADDING_P (*start)) { - OUTPUT1_IF (TS_ins_char); + OUTPUT1_IF (tty, tty->TS_ins_char); start++, len--; } @@ -1222,89 +931,77 @@ insert_glyphs (start, len) /* This is the last glyph. */ coding->mode |= CODING_MODE_LAST_BLOCK; - conversion_buffer = encode_terminal_code (glyph, 1, coding); + conversion_buffer = encode_terminal_code (glyph, 1, coding); } if (coding->produced > 0) { BLOCK_INPUT; - fwrite (conversion_buffer, 1, coding->produced, stdout); - if (ferror (stdout)) - clearerr (stdout); - if (termscript) - fwrite (conversion_buffer, 1, coding->produced, termscript); + fwrite (conversion_buffer, 1, coding->produced, tty->output); + if (ferror (tty->output)) + clearerr (tty->output); + if (tty->termscript) + fwrite (conversion_buffer, 1, coding->produced, tty->termscript); UNBLOCK_INPUT; } - OUTPUT1_IF (TS_pad_inserted_char); + OUTPUT1_IF (tty, tty->TS_pad_inserted_char); if (start) { turn_off_face (f, glyph->face_id); - turn_off_highlight (); + tty_turn_off_highlight (tty); } } - cmcheckmagic (); + cmcheckmagic (tty); } -void -delete_glyphs (n) - register int n; +/* An implementation of delete_glyphs for termcap frames. */ + +static void +tty_delete_glyphs (struct frame *f, int n) { char *buf; register int i; - if (delete_glyphs_hook && ! FRAME_TERMCAP_P (updating_frame)) - { - (*delete_glyphs_hook) (n); - return; - } + struct tty_display_info *tty = FRAME_TTY (f); - if (delete_in_insert_mode) + if (tty->delete_in_insert_mode) { - turn_on_insert (); + tty_turn_on_insert (tty); } else { - turn_off_insert (); - OUTPUT_IF (TS_delete_mode); + tty_turn_off_insert (tty); + OUTPUT_IF (tty, tty->TS_delete_mode); } - if (TS_del_multi_chars) + if (tty->TS_del_multi_chars) { - buf = tparam (TS_del_multi_chars, 0, 0, n); - OUTPUT1 (buf); + buf = tparam (tty->TS_del_multi_chars, 0, 0, n); + OUTPUT1 (tty, buf); xfree (buf); } else for (i = 0; i < n; i++) - OUTPUT1 (TS_del_char); - if (!delete_in_insert_mode) - OUTPUT_IF (TS_end_delete_mode); + OUTPUT1 (tty, tty->TS_del_char); + if (!tty->delete_in_insert_mode) + OUTPUT_IF (tty, tty->TS_end_delete_mode); } -/* Insert N lines at vpos VPOS. If N is negative, delete -N lines. */ +/* An implementation of ins_del_lines for termcap frames. */ -void -ins_del_lines (vpos, n) - int vpos, n; +static void +tty_ins_del_lines (struct frame *f, int vpos, int n) { - char *multi = n > 0 ? TS_ins_multi_lines : TS_del_multi_lines; - char *single = n > 0 ? TS_ins_line : TS_del_line; - char *scroll = n > 0 ? TS_rev_scroll : TS_fwd_scroll; - struct frame *sf; + struct tty_display_info *tty = FRAME_TTY (f); + char *multi = n > 0 ? tty->TS_ins_multi_lines : tty->TS_del_multi_lines; + char *single = n > 0 ? tty->TS_ins_line : tty->TS_del_line; + char *scroll = n > 0 ? tty->TS_rev_scroll : tty->TS_fwd_scroll; register int i = n > 0 ? n : -n; register char *buf; - if (ins_del_lines_hook && ! FRAME_TERMCAP_P (updating_frame)) - { - (*ins_del_lines_hook) (vpos, n); - return; - } - - sf = XFRAME (selected_frame); - /* If the lines below the insertion are being pushed into the end of the window, this is the same as clearing; and we know the lines are already clear, since the matching @@ -1312,45 +1009,49 @@ ins_del_lines (vpos, n) /* If the lines below the deletion are blank lines coming out of the end of the window, don't bother, as there will be a matching inslines later that will flush them. */ - if (scroll_region_ok && vpos + i >= specified_window) + if (FRAME_SCROLL_REGION_OK (f) + && vpos + i >= tty->specified_window) return; - if (!memory_below_frame && vpos + i >= FRAME_LINES (sf)) + if (!FRAME_MEMORY_BELOW_FRAME (f) + && vpos + i >= FRAME_LINES (f)) return; - + if (multi) { - raw_cursor_to (vpos, 0); - background_highlight (); + raw_cursor_to (f, vpos, 0); + tty_background_highlight (tty); buf = tparam (multi, 0, 0, i); - OUTPUT (buf); + OUTPUT (tty, buf); xfree (buf); } else if (single) { - raw_cursor_to (vpos, 0); - background_highlight (); + raw_cursor_to (f, vpos, 0); + tty_background_highlight (tty); while (--i >= 0) - OUTPUT (single); - if (TF_teleray) - curX = 0; + OUTPUT (tty, single); + if (tty->TF_teleray) + curX (tty) = 0; } else { - set_scroll_region (vpos, specified_window); + tty_set_scroll_region (f, vpos, tty->specified_window); if (n < 0) - raw_cursor_to (specified_window - 1, 0); + raw_cursor_to (f, tty->specified_window - 1, 0); else - raw_cursor_to (vpos, 0); - background_highlight (); + raw_cursor_to (f, vpos, 0); + tty_background_highlight (tty); while (--i >= 0) - OUTPUTL (scroll, specified_window - vpos); - set_scroll_region (0, specified_window); + OUTPUTL (tty, scroll, tty->specified_window - vpos); + tty_set_scroll_region (f, 0, tty->specified_window); } - - if (!scroll_region_ok && memory_below_frame && n < 0) + + if (!FRAME_SCROLL_REGION_OK (f) + && FRAME_MEMORY_BELOW_FRAME (f) + && n < 0) { - cursor_to (FRAME_LINES (sf) + n, 0); - clear_to_end (); + cursor_to (f, FRAME_LINES (f) + n, 0); + clear_to_end (f); } } @@ -1358,8 +1059,7 @@ ins_del_lines (vpos, n) not counting any line-dependent padding. */ int -string_cost (str) - char *str; +string_cost (char *str) { cost = 0; if (str) @@ -1371,8 +1071,7 @@ string_cost (str) counting any line-dependent padding at one line. */ static int -string_cost_one_line (str) - char *str; +string_cost_one_line (char *str) { cost = 0; if (str) @@ -1384,8 +1083,7 @@ string_cost_one_line (str) in tenths of characters. */ int -per_line_cost (str) - register char *str; +per_line_cost (char *str) { cost = 0; if (str) @@ -1408,26 +1106,26 @@ int *char_ins_del_vector; /* ARGSUSED */ static void -calculate_ins_del_char_costs (frame) - FRAME_PTR frame; +calculate_ins_del_char_costs (struct frame *f) { + struct tty_display_info *tty = FRAME_TTY (f); int ins_startup_cost, del_startup_cost; int ins_cost_per_char, del_cost_per_char; register int i; register int *p; - if (TS_ins_multi_chars) + if (tty->TS_ins_multi_chars) { ins_cost_per_char = 0; - ins_startup_cost = string_cost_one_line (TS_ins_multi_chars); + ins_startup_cost = string_cost_one_line (tty->TS_ins_multi_chars); } - else if (TS_ins_char || TS_pad_inserted_char - || (TS_insert_mode && TS_end_insert_mode)) + else if (tty->TS_ins_char || tty->TS_pad_inserted_char + || (tty->TS_insert_mode && tty->TS_end_insert_mode)) { - ins_startup_cost = (30 * (string_cost (TS_insert_mode) - + string_cost (TS_end_insert_mode))) / 100; - ins_cost_per_char = (string_cost_one_line (TS_ins_char) - + string_cost_one_line (TS_pad_inserted_char)); + ins_startup_cost = (30 * (string_cost (tty->TS_insert_mode) + + string_cost (tty->TS_end_insert_mode))) / 100; + ins_cost_per_char = (string_cost_one_line (tty->TS_ins_char) + + string_cost_one_line (tty->TS_pad_inserted_char)); } else { @@ -1435,18 +1133,18 @@ calculate_ins_del_char_costs (frame) ins_cost_per_char = 0; } - if (TS_del_multi_chars) + if (tty->TS_del_multi_chars) { del_cost_per_char = 0; - del_startup_cost = string_cost_one_line (TS_del_multi_chars); + del_startup_cost = string_cost_one_line (tty->TS_del_multi_chars); } - else if (TS_del_char) + else if (tty->TS_del_char) { - del_startup_cost = (string_cost (TS_delete_mode) - + string_cost (TS_end_delete_mode)); - if (delete_in_insert_mode) + del_startup_cost = (string_cost (tty->TS_delete_mode) + + string_cost (tty->TS_end_delete_mode)); + if (tty->delete_in_insert_mode) del_startup_cost /= 2; - del_cost_per_char = string_cost_one_line (TS_del_char); + del_cost_per_char = string_cost_one_line (tty->TS_del_char); } else { @@ -1455,75 +1153,80 @@ calculate_ins_del_char_costs (frame) } /* Delete costs are at negative offsets */ - p = &char_ins_del_cost (frame)[0]; - for (i = FRAME_COLS (frame); --i >= 0;) + p = &char_ins_del_cost (f)[0]; + for (i = FRAME_COLS (f); --i >= 0;) *--p = (del_startup_cost += del_cost_per_char); /* Doing nothing is free */ - p = &char_ins_del_cost (frame)[0]; + p = &char_ins_del_cost (f)[0]; *p++ = 0; /* Insert costs are at positive offsets */ - for (i = FRAME_COLS (frame); --i >= 0;) + for (i = FRAME_COLS (f); --i >= 0;) *p++ = (ins_startup_cost += ins_cost_per_char); } void -calculate_costs (frame) - FRAME_PTR frame; +calculate_costs (struct frame *frame) { - register char *f = (TS_set_scroll_region - ? TS_set_scroll_region - : TS_set_scroll_region_1); - FRAME_COST_BAUD_RATE (frame) = baud_rate; - scroll_region_cost = string_cost (f); + if (FRAME_TERMCAP_P (frame)) + { + struct tty_display_info *tty = FRAME_TTY (frame); + register char *f = (tty->TS_set_scroll_region + ? tty->TS_set_scroll_region + : tty->TS_set_scroll_region_1); - /* These variables are only used for terminal stuff. They are allocated - once for the terminal frame of X-windows emacs, but not used afterwards. + FRAME_SCROLL_REGION_COST (frame) = string_cost (f); - char_ins_del_vector (i.e., char_ins_del_cost) isn't used because - X turns off char_ins_del_ok. */ + tty->costs_set = 1; - max_frame_lines = max (max_frame_lines, FRAME_LINES (frame)); - max_frame_cols = max (max_frame_cols, FRAME_COLS (frame)); + /* These variables are only used for terminal stuff. They are + allocated once for the terminal frame of X-windows emacs, but not + used afterwards. - costs_set = 1; + char_ins_del_vector (i.e., char_ins_del_cost) isn't used because + X turns off char_ins_del_ok. */ - if (char_ins_del_vector != 0) - char_ins_del_vector - = (int *) xrealloc (char_ins_del_vector, - (sizeof (int) - + 2 * max_frame_cols * sizeof (int))); - else - char_ins_del_vector - = (int *) xmalloc (sizeof (int) - + 2 * max_frame_cols * sizeof (int)); - - bzero (char_ins_del_vector, (sizeof (int) - + 2 * max_frame_cols * sizeof (int))); - - if (f && (!TS_ins_line && !TS_del_line)) - do_line_insertion_deletion_costs (frame, - TS_rev_scroll, TS_ins_multi_lines, - TS_fwd_scroll, TS_del_multi_lines, - f, f, 1); - else - do_line_insertion_deletion_costs (frame, - TS_ins_line, TS_ins_multi_lines, - TS_del_line, TS_del_multi_lines, - 0, 0, 1); + max_frame_lines = max (max_frame_lines, FRAME_LINES (frame)); + max_frame_cols = max (max_frame_cols, FRAME_COLS (frame)); - calculate_ins_del_char_costs (frame); + if (char_ins_del_vector != 0) + char_ins_del_vector + = (int *) xrealloc (char_ins_del_vector, + (sizeof (int) + + 2 * max_frame_cols * sizeof (int))); + else + char_ins_del_vector + = (int *) xmalloc (sizeof (int) + + 2 * max_frame_cols * sizeof (int)); - /* Don't use TS_repeat if its padding is worse than sending the chars */ - if (TS_repeat && per_line_cost (TS_repeat) * baud_rate < 9000) - RPov = string_cost (TS_repeat); - else - RPov = FRAME_COLS (frame) * 2; + bzero (char_ins_del_vector, (sizeof (int) + + 2 * max_frame_cols * sizeof (int))); - cmcostinit (); /* set up cursor motion costs */ + + if (f && (!tty->TS_ins_line && !tty->TS_del_line)) + do_line_insertion_deletion_costs (frame, + tty->TS_rev_scroll, tty->TS_ins_multi_lines, + tty->TS_fwd_scroll, tty->TS_del_multi_lines, + f, f, 1); + else + do_line_insertion_deletion_costs (frame, + tty->TS_ins_line, tty->TS_ins_multi_lines, + tty->TS_del_line, tty->TS_del_multi_lines, + 0, 0, 1); + + calculate_ins_del_char_costs (frame); + + /* Don't use TS_repeat if its padding is worse than sending the chars */ + if (tty->TS_repeat && per_line_cost (tty->TS_repeat) * baud_rate < 9000) + tty->RPov = string_cost (tty->TS_repeat); + else + tty->RPov = FRAME_COLS (frame) * 2; + + cmcostinit (FRAME_TTY (frame)); /* set up cursor motion costs */ + } } struct fkey_table { @@ -1633,16 +1336,18 @@ static struct fkey_table keys[] = {"!3", "S-undo"} /*shifted undo key*/ }; -static char **term_get_fkeys_arg; +static char **term_get_fkeys_address; +static KBOARD *term_get_fkeys_kboard; static Lisp_Object term_get_fkeys_1 (); -/* Find the escape codes sent by the function keys for Vfunction_key_map. +/* Find the escape codes sent by the function keys for Vinput_decode_map. This function scans the termcap function key sequence entries, and - adds entries to Vfunction_key_map for each function key it finds. */ + adds entries to Vinput_decode_map for each function key it finds. */ -void -term_get_fkeys (address) +static void +term_get_fkeys (address, kboard) char **address; + KBOARD *kboard; { /* We run the body of the function (term_get_fkeys_1) and ignore all Lisp errors during the call. The only errors should be from Fdefine_key @@ -1653,7 +1358,8 @@ term_get_fkeys (address) refusing to run at all on such a terminal. */ extern Lisp_Object Fidentity (); - term_get_fkeys_arg = address; + term_get_fkeys_address = address; + term_get_fkeys_kboard = kboard; internal_condition_case (term_get_fkeys_1, Qerror, Fidentity); } @@ -1662,17 +1368,18 @@ term_get_fkeys_1 () { int i; - char **address = term_get_fkeys_arg; - + char **address = term_get_fkeys_address; + KBOARD *kboard = term_get_fkeys_kboard; + /* This can happen if CANNOT_DUMP or with strange options. */ - if (!initialized) - Vfunction_key_map = Fmake_sparse_keymap (Qnil); + if (!KEYMAPP (kboard->Vinput_decode_map)) + kboard->Vinput_decode_map = Fmake_sparse_keymap (Qnil); for (i = 0; i < (sizeof (keys)/sizeof (keys[0])); i++) { char *sequence = tgetstr (keys[i].cap, address); if (sequence) - Fdefine_key (Vfunction_key_map, build_string (sequence), + Fdefine_key (kboard->Vinput_decode_map, build_string (sequence), Fmake_vector (make_number (1), intern (keys[i].name))); } @@ -1692,13 +1399,13 @@ term_get_fkeys_1 () if (k0) /* Define f0 first, so that f10 takes precedence in case the key sequences happens to be the same. */ - Fdefine_key (Vfunction_key_map, build_string (k0), + Fdefine_key (kboard->Vinput_decode_map, build_string (k0), Fmake_vector (make_number (1), intern ("f0"))); - Fdefine_key (Vfunction_key_map, build_string (k_semi), + Fdefine_key (kboard->Vinput_decode_map, build_string (k_semi), Fmake_vector (make_number (1), intern ("f10"))); } else if (k0) - Fdefine_key (Vfunction_key_map, build_string (k0), + Fdefine_key (kboard->Vinput_decode_map, build_string (k0), Fmake_vector (make_number (1), intern (k0_name))); } @@ -1721,7 +1428,7 @@ term_get_fkeys_1 () if (sequence) { sprintf (fkey, "f%d", i); - Fdefine_key (Vfunction_key_map, build_string (sequence), + Fdefine_key (kboard->Vinput_decode_map, build_string (sequence), Fmake_vector (make_number (1), intern (fkey))); } @@ -1737,10 +1444,10 @@ term_get_fkeys_1 () if (!tgetstr (cap1, address)) \ { \ char *sequence = tgetstr (cap2, address); \ - if (sequence) \ - Fdefine_key (Vfunction_key_map, build_string (sequence), \ - Fmake_vector (make_number (1), \ - intern (sym))); \ + if (sequence) \ + Fdefine_key (kboard->Vinput_decode_map, build_string (sequence), \ + Fmake_vector (make_number (1), \ + intern (sym))); \ } /* if there's no key_next keycap, map key_npage to `next' keysym */ @@ -2142,10 +1849,10 @@ produce_special_glyphs (it, what) from them. Some display attributes may not be used together with color; the termcap capability `NC' specifies which ones. */ -#define MAY_USE_WITH_COLORS_P(ATTR) \ - (TN_max_colors > 0 \ - ? (TN_no_color_video & (ATTR)) == 0 \ - : 1) +#define MAY_USE_WITH_COLORS_P(tty, ATTR) \ + (tty->TN_max_colors > 0 \ + ? (tty->TN_no_color_video & (ATTR)) == 0 \ + : 1) /* Turn appearances of face FACE_ID on tty frame F on. FACE_ID is a realized face ID number, in the face cache. */ @@ -2158,12 +1865,13 @@ turn_on_face (f, face_id) struct face *face = FACE_FROM_ID (f, face_id); long fg = face->foreground; long bg = face->background; + struct tty_display_info *tty = FRAME_TTY (f); /* Do this first because TS_end_standout_mode may be the same as TS_exit_attribute_mode, which turns all appearances off. */ - if (MAY_USE_WITH_COLORS_P (NC_REVERSE)) + if (MAY_USE_WITH_COLORS_P (tty, NC_REVERSE)) { - if (TN_max_colors > 0) + if (tty->TN_max_colors > 0) { if (fg >= 0 && bg >= 0) { @@ -2177,13 +1885,13 @@ turn_on_face (f, face_id) { if (fg == FACE_TTY_DEFAULT_FG_COLOR || bg == FACE_TTY_DEFAULT_BG_COLOR) - toggle_highlight (); + tty_toggle_highlight (tty); } else { if (fg == FACE_TTY_DEFAULT_BG_COLOR || bg == FACE_TTY_DEFAULT_FG_COLOR) - toggle_highlight (); + tty_toggle_highlight (tty); } } else @@ -2194,55 +1902,55 @@ turn_on_face (f, face_id) { if (fg == FACE_TTY_DEFAULT_FG_COLOR || bg == FACE_TTY_DEFAULT_BG_COLOR) - toggle_highlight (); + tty_toggle_highlight (tty); } else { if (fg == FACE_TTY_DEFAULT_BG_COLOR || bg == FACE_TTY_DEFAULT_FG_COLOR) - toggle_highlight (); + tty_toggle_highlight (tty); } } } if (face->tty_bold_p) { - if (MAY_USE_WITH_COLORS_P (NC_BOLD)) - OUTPUT1_IF (TS_enter_bold_mode); + if (MAY_USE_WITH_COLORS_P (tty, NC_BOLD)) + OUTPUT1_IF (tty, tty->TS_enter_bold_mode); } else if (face->tty_dim_p) - if (MAY_USE_WITH_COLORS_P (NC_DIM)) - OUTPUT1_IF (TS_enter_dim_mode); + if (MAY_USE_WITH_COLORS_P (tty, NC_DIM)) + OUTPUT1_IF (tty, tty->TS_enter_dim_mode); /* Alternate charset and blinking not yet used. */ if (face->tty_alt_charset_p - && MAY_USE_WITH_COLORS_P (NC_ALT_CHARSET)) - OUTPUT1_IF (TS_enter_alt_charset_mode); + && MAY_USE_WITH_COLORS_P (tty, NC_ALT_CHARSET)) + OUTPUT1_IF (tty, tty->TS_enter_alt_charset_mode); if (face->tty_blinking_p - && MAY_USE_WITH_COLORS_P (NC_BLINK)) - OUTPUT1_IF (TS_enter_blink_mode); + && MAY_USE_WITH_COLORS_P (tty, NC_BLINK)) + OUTPUT1_IF (tty, tty->TS_enter_blink_mode); - if (face->tty_underline_p && MAY_USE_WITH_COLORS_P (NC_UNDERLINE)) - OUTPUT1_IF (TS_enter_underline_mode); + if (face->tty_underline_p && MAY_USE_WITH_COLORS_P (tty, NC_UNDERLINE)) + OUTPUT1_IF (tty, tty->TS_enter_underline_mode); - if (TN_max_colors > 0) + if (tty->TN_max_colors > 0) { char *ts, *p; - ts = standout_mode ? TS_set_background : TS_set_foreground; + ts = tty->standout_mode ? tty->TS_set_background : tty->TS_set_foreground; if (fg >= 0 && ts) { - p = tparam (ts, NULL, 0, (int) fg); - OUTPUT (p); + p = tparam (ts, NULL, 0, (int) fg); + OUTPUT (tty, p); xfree (p); } - ts = standout_mode ? TS_set_foreground : TS_set_background; + ts = tty->standout_mode ? tty->TS_set_foreground : tty->TS_set_background; if (bg >= 0 && ts) { - p = tparam (ts, NULL, 0, (int) bg); - OUTPUT (p); + p = tparam (ts, NULL, 0, (int) bg); + OUTPUT (tty, p); xfree (p); } } @@ -2257,10 +1965,11 @@ turn_off_face (f, face_id) int face_id; { struct face *face = FACE_FROM_ID (f, face_id); + struct tty_display_info *tty = FRAME_TTY (f); xassert (face != NULL); - if (TS_exit_attribute_mode) + if (tty->TS_exit_attribute_mode) { /* Capability "me" will turn off appearance modes double-bright, half-bright, reverse-video, standout, underline. It may or @@ -2272,32 +1981,32 @@ turn_off_face (f, face_id) || face->tty_blinking_p || face->tty_underline_p) { - OUTPUT1_IF (TS_exit_attribute_mode); - if (strcmp (TS_exit_attribute_mode, TS_end_standout_mode) == 0) - standout_mode = 0; + OUTPUT1_IF (tty, tty->TS_exit_attribute_mode); + if (strcmp (tty->TS_exit_attribute_mode, tty->TS_end_standout_mode) == 0) + tty->standout_mode = 0; } if (face->tty_alt_charset_p) - OUTPUT_IF (TS_exit_alt_charset_mode); + OUTPUT_IF (tty, tty->TS_exit_alt_charset_mode); } else { /* If we don't have "me" we can only have those appearances that have exit sequences defined. */ if (face->tty_alt_charset_p) - OUTPUT_IF (TS_exit_alt_charset_mode); + OUTPUT_IF (tty, tty->TS_exit_alt_charset_mode); if (face->tty_underline_p) - OUTPUT_IF (TS_exit_underline_mode); + OUTPUT_IF (tty, tty->TS_exit_underline_mode); } /* Switch back to default colors. */ - if (TN_max_colors > 0 + if (tty->TN_max_colors > 0 && ((face->foreground != FACE_TTY_DEFAULT_COLOR && face->foreground != FACE_TTY_DEFAULT_FG_COLOR) || (face->background != FACE_TTY_DEFAULT_COLOR && face->background != FACE_TTY_DEFAULT_BG_COLOR))) - OUTPUT1_IF (TS_orig_pair); + OUTPUT1_IF (tty, tty->TS_orig_pair); } @@ -2306,46 +2015,61 @@ turn_off_face (f, face_id) colors FG and BG. */ int -tty_capable_p (f, caps, fg, bg) - struct frame *f; +tty_capable_p (tty, caps, fg, bg) + struct tty_display_info *tty; unsigned caps; unsigned long fg, bg; { -#define TTY_CAPABLE_P_TRY(cap, TS, NC_bit) \ - if ((caps & (cap)) && (!(TS) || !MAY_USE_WITH_COLORS_P(NC_bit))) \ +#define TTY_CAPABLE_P_TRY(tty, cap, TS, NC_bit) \ + if ((caps & (cap)) && (!(TS) || !MAY_USE_WITH_COLORS_P(tty, NC_bit))) \ return 0; - TTY_CAPABLE_P_TRY (TTY_CAP_INVERSE, TS_standout_mode, NC_REVERSE); - TTY_CAPABLE_P_TRY (TTY_CAP_UNDERLINE, TS_enter_underline_mode, NC_UNDERLINE); - TTY_CAPABLE_P_TRY (TTY_CAP_BOLD, TS_enter_bold_mode, NC_BOLD); - TTY_CAPABLE_P_TRY (TTY_CAP_DIM, TS_enter_dim_mode, NC_DIM); - TTY_CAPABLE_P_TRY (TTY_CAP_BLINK, TS_enter_blink_mode, NC_BLINK); - TTY_CAPABLE_P_TRY (TTY_CAP_ALT_CHARSET, TS_enter_alt_charset_mode, NC_ALT_CHARSET); + TTY_CAPABLE_P_TRY (tty, TTY_CAP_INVERSE, tty->TS_standout_mode, NC_REVERSE); + TTY_CAPABLE_P_TRY (tty, TTY_CAP_UNDERLINE, tty->TS_enter_underline_mode, NC_UNDERLINE); + TTY_CAPABLE_P_TRY (tty, TTY_CAP_BOLD, tty->TS_enter_bold_mode, NC_BOLD); + TTY_CAPABLE_P_TRY (tty, TTY_CAP_DIM, tty->TS_enter_dim_mode, NC_DIM); + TTY_CAPABLE_P_TRY (tty, TTY_CAP_BLINK, tty->TS_enter_blink_mode, NC_BLINK); + TTY_CAPABLE_P_TRY (tty, TTY_CAP_ALT_CHARSET, tty->TS_enter_alt_charset_mode, NC_ALT_CHARSET); /* We can do it! */ return 1; } - /* Return non-zero if the terminal is capable to display colors. */ DEFUN ("tty-display-color-p", Ftty_display_color_p, Stty_display_color_p, 0, 1, 0, - doc: /* Return non-nil if TTY can display colors on DISPLAY. */) - (display) - Lisp_Object display; + doc: /* Return non-nil if the tty device TERMINAL can display colors. + +TERMINAL can be a terminal id, a frame or nil (meaning the selected +frame's terminal). This function always returns nil if TERMINAL +is not on a tty device. */) + (terminal) + Lisp_Object terminal; { - return TN_max_colors > 0 ? Qt : Qnil; + struct terminal *t = get_tty_terminal (terminal, 0); + if (!t) + return Qnil; + else + return t->display_info.tty->TN_max_colors > 0 ? Qt : Qnil; } /* Return the number of supported colors. */ DEFUN ("tty-display-color-cells", Ftty_display_color_cells, Stty_display_color_cells, 0, 1, 0, - doc: /* Return the number of colors supported by TTY on DISPLAY. */) - (display) - Lisp_Object display; + doc: /* Return the number of colors supported by the tty device TERMINAL. + +TERMINAL can be a terminal id, a frame or nil (meaning the selected +frame's terminal). This function always returns 0 if TERMINAL +is not on a tty device. */) + (terminal) + Lisp_Object terminal; { - return make_number (TN_max_colors); + struct terminal *t = get_tty_terminal (terminal, 0); + if (!t) + return make_number (0); + else + return make_number (t->display_info.tty->TN_max_colors); } #ifndef WINDOWSNT @@ -2363,48 +2087,46 @@ static char *default_set_background; /* Save or restore the default color-related capabilities of this terminal. */ static void -tty_default_color_capabilities (save) - int save; +tty_default_color_capabilities (struct tty_display_info *tty, int save) { if (save) { if (default_orig_pair) xfree (default_orig_pair); - default_orig_pair = TS_orig_pair ? xstrdup (TS_orig_pair) : NULL; + default_orig_pair = tty->TS_orig_pair ? xstrdup (tty->TS_orig_pair) : NULL; if (default_set_foreground) xfree (default_set_foreground); - default_set_foreground = TS_set_foreground ? xstrdup (TS_set_foreground) + default_set_foreground = tty->TS_set_foreground ? xstrdup (tty->TS_set_foreground) : NULL; if (default_set_background) xfree (default_set_background); - default_set_background = TS_set_background ? xstrdup (TS_set_background) + default_set_background = tty->TS_set_background ? xstrdup (tty->TS_set_background) : NULL; - default_max_colors = TN_max_colors; - default_max_pairs = TN_max_pairs; - default_no_color_video = TN_no_color_video; + default_max_colors = tty->TN_max_colors; + default_max_pairs = tty->TN_max_pairs; + default_no_color_video = tty->TN_no_color_video; } else { - TS_orig_pair = default_orig_pair; - TS_set_foreground = default_set_foreground; - TS_set_background = default_set_background; - TN_max_colors = default_max_colors; - TN_max_pairs = default_max_pairs; - TN_no_color_video = default_no_color_video; + tty->TS_orig_pair = default_orig_pair; + tty->TS_set_foreground = default_set_foreground; + tty->TS_set_background = default_set_background; + tty->TN_max_colors = default_max_colors; + tty->TN_max_pairs = default_max_pairs; + tty->TN_no_color_video = default_no_color_video; } } /* Setup one of the standard tty color schemes according to MODE. MODE's value is generally the number of colors which we want to support; zero means set up for the default capabilities, the ones - we saw at term_init time; -1 means turn off color support. */ -void -tty_setup_colors (mode) - int mode; + we saw at init_tty time; -1 means turn off color support. */ +static void +tty_setup_colors (struct tty_display_info *tty, int mode) { /* Canonicalize all negative values of MODE. */ if (mode < -1) @@ -2413,27 +2135,27 @@ tty_setup_colors (mode) switch (mode) { case -1: /* no colors at all */ - TN_max_colors = 0; - TN_max_pairs = 0; - TN_no_color_video = 0; - TS_set_foreground = TS_set_background = TS_orig_pair = NULL; + tty->TN_max_colors = 0; + tty->TN_max_pairs = 0; + tty->TN_no_color_video = 0; + tty->TS_set_foreground = tty->TS_set_background = tty->TS_orig_pair = NULL; break; case 0: /* default colors, if any */ default: - tty_default_color_capabilities (0); + tty_default_color_capabilities (tty, 0); break; case 8: /* 8 standard ANSI colors */ - TS_orig_pair = "\033[0m"; + tty->TS_orig_pair = "\033[0m"; #ifdef TERMINFO - TS_set_foreground = "\033[3%p1%dm"; - TS_set_background = "\033[4%p1%dm"; + tty->TS_set_foreground = "\033[3%p1%dm"; + tty->TS_set_background = "\033[4%p1%dm"; #else - TS_set_foreground = "\033[3%dm"; - TS_set_background = "\033[4%dm"; + tty->TS_set_foreground = "\033[3%dm"; + tty->TS_set_background = "\033[4%dm"; #endif - TN_max_colors = 8; - TN_max_pairs = 64; - TN_no_color_video = 0; + tty->TN_max_colors = 8; + tty->TN_max_pairs = 64; + tty->TN_no_color_video = 0; break; } } @@ -2484,7 +2206,7 @@ set_tty_color_mode (f, val) if (mode != old_mode) { - tty_setup_colors (mode); + tty_setup_colors (FRAME_TTY (f), mode); /* This recomputes all the faces given the new color definitions. */ call0 (intern ("tty-set-up-initial-frame-faces")); @@ -2495,6 +2217,241 @@ set_tty_color_mode (f, val) #endif /* !WINDOWSNT */ + +/* Return the tty display object specified by TERMINAL. */ + +struct terminal * +get_tty_terminal (Lisp_Object terminal, int throw) +{ + struct terminal *t = get_terminal (terminal, throw); + + if (t && t->type != output_termcap) + { + if (throw) + error ("Device %d is not a termcap terminal device", t->id); + else + return NULL; + } + + return t; +} + +/* Return an active termcap device that uses the tty device with the + given name. + + This function ignores suspended devices. + + Returns NULL if the named terminal device is not opened. */ + +struct terminal * +get_named_tty (name) + char *name; +{ + struct terminal *t; + + if (!name) + abort (); + + for (t = terminal_list; t; t = t->next_terminal) + { + if (t->type == output_termcap + && !strcmp (t->display_info.tty->name, name) + && TERMINAL_ACTIVE_P (t)) + return t; + } + + return 0; +} + + +DEFUN ("tty-type", Ftty_type, Stty_type, 0, 1, 0, + doc: /* Return the type of the tty device that TERMINAL uses. +Returns nil if TERMINAL is not on a tty device. + +TERMINAL can be a terminal id, a frame or nil (meaning the selected +frame's terminal). */) + (terminal) + Lisp_Object terminal; +{ + struct terminal *t = get_terminal (terminal, 1); + + if (t->type != output_termcap) + return Qnil; + + if (t->display_info.tty->type) + return build_string (t->display_info.tty->type); + else + return Qnil; +} + +DEFUN ("controlling-tty-p", Fcontrolling_tty_p, Scontrolling_tty_p, 0, 1, 0, + doc: /* Return non-nil if TERMINAL is on the controlling tty of the Emacs process. + +TERMINAL can be a terminal id, a frame or nil (meaning the selected +frame's terminal). This function always returns nil if TERMINAL +is not on a tty device. */) + (terminal) + Lisp_Object terminal; +{ + struct terminal *t = get_terminal (terminal, 1); + + if (t->type != output_termcap || strcmp (t->display_info.tty->name, DEV_TTY)) + return Qnil; + else + return Qt; +} + +DEFUN ("tty-no-underline", Ftty_no_underline, Stty_no_underline, 0, 1, 0, + doc: /* Declare that the tty used by TERMINAL does not handle underlining. +This is used to override the terminfo data, for certain terminals that +do not really do underlining, but say that they do. This function has +no effect if used on a non-tty terminal. + +TERMINAL can be a terminal id, a frame or nil (meaning the selected +frame's terminal). This function always returns nil if TERMINAL +is not on a tty device. */) + (terminal) + Lisp_Object terminal; +{ + struct terminal *t = get_terminal (terminal, 1); + + if (t->type == output_termcap) + t->display_info.tty->TS_enter_underline_mode = 0; + return Qnil; +} + + + +DEFUN ("suspend-tty", Fsuspend_tty, Ssuspend_tty, 0, 1, 0, + doc: /* Suspend the terminal device TTY. + +The device is restored to its default state, and Emacs ceases all +access to the tty device. Frames that use the device are not deleted, +but input is not read from them and if they change, their display is +not updated. + +TTY may be a terminal id, a frame, or nil for the terminal device of +the currently selected frame. + +This function runs `suspend-tty-functions' after suspending the +device. The functions are run with one arg, the id of the suspended +terminal device. + +`suspend-tty' does nothing if it is called on a device that is already +suspended. + +A suspended tty may be resumed by calling `resume-tty' on it. */) + (tty) + Lisp_Object tty; +{ + struct terminal *t = get_tty_terminal (tty, 1); + FILE *f; + + if (!t) + error ("Unknown tty device"); + + f = t->display_info.tty->input; + + if (f) + { + /* First run `suspend-tty-functions' and then clean up the tty + state because `suspend-tty-functions' might need to change + the tty state. */ + if (!NILP (Vrun_hooks)) + { + Lisp_Object args[2]; + args[0] = intern ("suspend-tty-functions"); + XSETTERMINAL (args[1], t); + Frun_hook_with_args (2, args); + } + + reset_sys_modes (t->display_info.tty); + + delete_keyboard_wait_descriptor (fileno (f)); + + fclose (f); + if (f != t->display_info.tty->output) + fclose (t->display_info.tty->output); + + t->display_info.tty->input = 0; + t->display_info.tty->output = 0; + + if (FRAMEP (t->display_info.tty->top_frame)) + FRAME_SET_VISIBLE (XFRAME (t->display_info.tty->top_frame), 0); + + } + + /* Clear display hooks to prevent further output. */ + clear_tty_hooks (t); + + return Qnil; +} + +DEFUN ("resume-tty", Fresume_tty, Sresume_tty, 0, 1, 0, + doc: /* Resume the previously suspended terminal device TTY. +The terminal is opened and reinitialized. Frames that are on the +suspended terminal are revived. + +It is an error to resume a terminal while another terminal is active +on the same device. + +This function runs `resume-tty-functions' after resuming the terminal. +The functions are run with one arg, the id of the resumed terminal +device. + +`resume-tty' does nothing if it is called on a device that is not +suspended. + +TTY may be a terminal id, a frame, or nil for the terminal device of +the currently selected frame. */) + (tty) + Lisp_Object tty; +{ + struct terminal *t = get_tty_terminal (tty, 1); + int fd; + + if (!t) + error ("Unknown tty device"); + + if (!t->display_info.tty->input) + { + if (get_named_tty (t->display_info.tty->name)) + error ("Cannot resume display while another display is active on the same device"); + + fd = emacs_open (t->display_info.tty->name, O_RDWR | O_NOCTTY, 0); + + if (fd == -1) + error ("Can not reopen tty device %s: %s", t->display_info.tty->name, strerror (errno)); + + if (strcmp (t->display_info.tty->name, DEV_TTY)) + dissociate_if_controlling_tty (fd); + + t->display_info.tty->output = fdopen (fd, "w+"); + t->display_info.tty->input = t->display_info.tty->output; + + add_keyboard_wait_descriptor (fd); + + if (FRAMEP (t->display_info.tty->top_frame)) + FRAME_SET_VISIBLE (XFRAME (t->display_info.tty->top_frame), 1); + + init_sys_modes (t->display_info.tty); + + /* Run `resume-tty-functions'. */ + if (!NILP (Vrun_hooks)) + { + Lisp_Object args[2]; + args[0] = intern ("resume-tty-functions"); + XSETTERMINAL (args[1], t); + Frun_hook_with_args (2, args); + } + } + + set_tty_hooks (t); + + return Qnil; +} + + /*********************************************************************** Mouse ***********************************************************************/ @@ -2517,10 +2474,13 @@ term_mouse_moveto (int x, int y) static void term_show_mouse_face (enum draw_glyphs_face draw) { - struct window *w = XWINDOW (Qmouse_face_window); + struct window *w = XWINDOW (mouse_face_window); int save_x, save_y; int i; + struct frame *f = XFRAME (w->frame); + struct tty_display_info *tty = FRAME_TTY (f); + if (/* If window is in the process of being destroyed, don't bother to do anything. */ w->current_matrix != NULL @@ -2533,8 +2493,8 @@ term_show_mouse_face (enum draw_glyphs_face draw) the highlight region. */ /* Save current cursor co-ordinates */ - save_y = curY; - save_x = curX; + save_y = curY (tty); + save_x = curX (tty); /* Note that mouse_face_beg_row etc. are window relative. */ for (i = mouse_face_beg_row; i <= mouse_face_end_row; i++) @@ -2576,29 +2536,29 @@ term_show_mouse_face (enum draw_glyphs_face draw) pos_x = row->used[LEFT_MARGIN_AREA] + start_hpos + WINDOW_LEFT_EDGE_X (w); - cursor_to (pos_y, pos_x); + cursor_to (f, pos_y, pos_x); if (draw == DRAW_MOUSE_FACE) { - write_glyphs_with_face (row->glyphs[TEXT_AREA] + start_hpos, + tty_write_glyphs_with_face (f, row->glyphs[TEXT_AREA] + start_hpos, nglyphs, mouse_face_face_id); } else /* draw == DRAW_NORMAL_TEXT */ - write_glyphs (row->glyphs[TEXT_AREA] + start_hpos, nglyphs); + write_glyphs (f, row->glyphs[TEXT_AREA] + start_hpos, nglyphs); } - cursor_to (save_y, save_x); + cursor_to (f, save_y, save_x); } } static void term_clear_mouse_face () { - if (!NILP (Qmouse_face_window)) + if (!NILP (mouse_face_window)) term_show_mouse_face (DRAW_NORMAL_TEXT); mouse_face_beg_row = mouse_face_beg_col = -1; mouse_face_end_row = mouse_face_end_col = -1; - Qmouse_face_window = Qnil; + mouse_face_window = Qnil; } /* Find the glyph matrix position of buffer position POS in window W. @@ -2695,7 +2655,7 @@ term_mouse_highlight (struct frame *f, int x, int y) if (!WINDOWP (window)) return; - if (!EQ (window, Qmouse_face_window)) + if (!EQ (window, mouse_face_window)) term_clear_mouse_face (); w = XWINDOW (window); @@ -2778,7 +2738,7 @@ term_mouse_highlight (struct frame *f, int x, int y) noverlays = sort_overlays (overlay_vec, noverlays, w); /* Check mouse-face highlighting. */ - if (!(EQ (window, Qmouse_face_window) + if (!(EQ (window, mouse_face_window) && y >= mouse_face_beg_row && y <= mouse_face_end_row && (y > mouse_face_beg_row @@ -2828,7 +2788,7 @@ term_mouse_highlight (struct frame *f, int x, int y) = !fast_find_position (w, XFASTINT (after), &mouse_face_end_col, &mouse_face_end_row); - Qmouse_face_window = window; + mouse_face_window = window; mouse_face_face_id = face_at_buffer_position (w, pos, 0, 0, @@ -2863,7 +2823,7 @@ term_mouse_highlight (struct frame *f, int x, int y) = !fast_find_position (w, XFASTINT (after), &mouse_face_end_col, &mouse_face_end_row); - Qmouse_face_window = window; + mouse_face_window = window; mouse_face_face_id = face_at_buffer_position (w, pos, 0, 0, @@ -3036,10 +2996,9 @@ term_mouse_click (struct input_event *result, Gpm_Event *event, } int -handle_one_term_event (Gpm_Event *event, struct input_event* hold_quit) +handle_one_term_event (struct tty_display_info *tty, Gpm_Event *event, struct input_event* hold_quit) { - struct frame *f = SELECTED_FRAME (); - int fd; + struct frame *f = XFRAME (tty->top_frame); struct input_event ie; int do_help = 0; int count = 0; @@ -3049,24 +3008,10 @@ handle_one_term_event (Gpm_Event *event, struct input_event* hold_quit) ie.arg = Qnil; if (event->type & (GPM_MOVE | GPM_DRAG)) { - unsigned char buf[6 * sizeof (short)]; - unsigned short *arg = (unsigned short *) buf + 1; - const char *name; - previous_help_echo_string = help_echo_string; help_echo_string = Qnil; - /* Display mouse pointer */ - buf[sizeof(short) - 1] = 2; /* set selection */ - - arg[0] = arg[2] = (unsigned short) event->x + gpm_zerobased; - arg[1] = arg[3] = (unsigned short) event->y + gpm_zerobased; - arg[4] = (unsigned short) 3; - - name = ttyname (0); - fd = open (name, O_WRONLY); - ioctl (fd, TIOCLINUX, buf + sizeof (short) - 1); - close (fd); + Gpm_DrawPointer (event->x, event->y, fileno (tty->output)); if (!term_mouse_movement (f, event)) help_echo_string = previous_help_echo_string; @@ -3109,13 +3054,25 @@ handle_one_term_event (Gpm_Event *event, struct input_event* hold_quit) return count; } -DEFUN ("term-open-connection", Fterm_open_connection, Sterm_open_connection, +DEFUN ("gpm-mouse-start", Fgpm_mouse_start, Sgpm_mouse_start, 0, 0, 0, - doc: /* Open a connection to Gpm. */) + doc: /* Open a connection to Gpm. +Gpm-mouse can only be activated for one tty at a time. */) () { + struct frame *f = SELECTED_FRAME (); + struct tty_display_info *tty + = ((f)->output_method == output_termcap + ? (f)->terminal->display_info.tty : NULL); Gpm_Connect connection; + if (!tty) + error ("Gpm-mouse only works in the GNU/Linux console"); + if (gpm_tty == tty) + return Qnil; /* Already activated, nothing to do. */ + if (gpm_tty) + error ("Gpm-mouse can only be activated for one tty at a time"); + connection.eventMask = ~0; connection.defaultMask = ~GPM_HARD; connection.maxMod = ~0; @@ -3123,26 +3080,38 @@ DEFUN ("term-open-connection", Fterm_open_connection, Sterm_open_connection, gpm_zerobased = 1; if (Gpm_Open (&connection, 0) < 0) - return Qnil; + error ("Gpm-mouse failed to connect to the gpm daemon"); else { - term_gpm = 1; - reset_sys_modes (); - init_sys_modes (); + gpm_tty = tty; + /* `init_sys_modes' arranges for mouse movements sent through gpm_fd + to generate SIGIOs. Apparently we need to call reset_sys_modes + before calling init_sys_modes. */ + reset_sys_modes (tty); + init_sys_modes (tty); add_gpm_wait_descriptor (gpm_fd); - return Qt; + return Qnil; } } -DEFUN ("term-close-connection", Fterm_close_connection, Sterm_close_connection, +DEFUN ("gpm-mouse-stop", Fgpm_mouse_stop, Sgpm_mouse_stop, 0, 0, 0, doc: /* Close a connection to Gpm. */) () { - delete_gpm_wait_descriptor (gpm_fd); - while (Gpm_Close()); /* close all the stack */ - term_gpm = 0; - return Qnil; + struct frame *f = SELECTED_FRAME (); + struct tty_display_info *tty + = ((f)->output_method == output_termcap + ? (f)->terminal->display_info.tty : NULL); + + if (!tty || gpm_tty != tty) + return Qnil; /* Not activated on this terminal, nothing to do. */ + + if (gpm_fd >= 0) + delete_gpm_wait_descriptor (gpm_fd); + while (Gpm_Close()); /* close all the stack */ + gpm_tty = NULL; + return Qnil; } #endif /* HAVE_GPM */ @@ -3151,87 +3120,359 @@ DEFUN ("term-close-connection", Fterm_close_connection, Sterm_close_connection, Initialization ***********************************************************************/ +/* Initialize the tty-dependent part of frame F. The frame must + already have its device initialized. */ + void -term_init (terminal_type) - char *terminal_type; +create_tty_output (struct frame *f) +{ + struct tty_output *t; + + if (! FRAME_TERMCAP_P (f)) + abort (); + + t = xmalloc (sizeof (struct tty_output)); + bzero (t, sizeof (struct tty_output)); + + t->display_info = FRAME_TERMINAL (f)->display_info.tty; + + f->output_data.tty = t; +} + +/* Delete the tty-dependent part of frame F. */ + +static void +delete_tty_output (struct frame *f) +{ + if (! FRAME_TERMCAP_P (f)) + abort (); + + xfree (f->output_data.tty); +} + + +/* Reset the hooks in TERMINAL. */ + +static void +clear_tty_hooks (struct terminal *terminal) +{ + terminal->rif = 0; + terminal->cursor_to_hook = 0; + terminal->raw_cursor_to_hook = 0; + terminal->clear_to_end_hook = 0; + terminal->clear_frame_hook = 0; + terminal->clear_end_of_line_hook = 0; + terminal->ins_del_lines_hook = 0; + terminal->insert_glyphs_hook = 0; + terminal->write_glyphs_hook = 0; + terminal->delete_glyphs_hook = 0; + terminal->ring_bell_hook = 0; + terminal->reset_terminal_modes_hook = 0; + terminal->set_terminal_modes_hook = 0; + terminal->update_begin_hook = 0; + terminal->update_end_hook = 0; + terminal->set_terminal_window_hook = 0; + terminal->mouse_position_hook = 0; + terminal->frame_rehighlight_hook = 0; + terminal->frame_raise_lower_hook = 0; + terminal->fullscreen_hook = 0; + terminal->set_vertical_scroll_bar_hook = 0; + terminal->condemn_scroll_bars_hook = 0; + terminal->redeem_scroll_bar_hook = 0; + terminal->judge_scroll_bars_hook = 0; + terminal->read_socket_hook = 0; + terminal->frame_up_to_date_hook = 0; + + /* Leave these two set, or suspended frames are not deleted + correctly. */ + terminal->delete_frame_hook = &delete_tty_output; + terminal->delete_terminal_hook = &delete_tty; +} + +/* Initialize hooks in TERMINAL with the values needed for a tty. */ + +static void +set_tty_hooks (struct terminal *terminal) +{ + terminal->rif = 0; /* ttys don't support window-based redisplay. */ + + terminal->cursor_to_hook = &tty_cursor_to; + terminal->raw_cursor_to_hook = &tty_raw_cursor_to; + + terminal->clear_to_end_hook = &tty_clear_to_end; + terminal->clear_frame_hook = &tty_clear_frame; + terminal->clear_end_of_line_hook = &tty_clear_end_of_line; + + terminal->ins_del_lines_hook = &tty_ins_del_lines; + + terminal->insert_glyphs_hook = &tty_insert_glyphs; + terminal->write_glyphs_hook = &tty_write_glyphs; + terminal->delete_glyphs_hook = &tty_delete_glyphs; + + terminal->ring_bell_hook = &tty_ring_bell; + + terminal->reset_terminal_modes_hook = &tty_reset_terminal_modes; + terminal->set_terminal_modes_hook = &tty_set_terminal_modes; + terminal->update_begin_hook = 0; /* Not needed. */ + terminal->update_end_hook = &tty_update_end; + terminal->set_terminal_window_hook = &tty_set_terminal_window; + + terminal->mouse_position_hook = 0; /* Not needed. */ + terminal->frame_rehighlight_hook = 0; /* Not needed. */ + terminal->frame_raise_lower_hook = 0; /* Not needed. */ + + terminal->set_vertical_scroll_bar_hook = 0; /* Not needed. */ + terminal->condemn_scroll_bars_hook = 0; /* Not needed. */ + terminal->redeem_scroll_bar_hook = 0; /* Not needed. */ + terminal->judge_scroll_bars_hook = 0; /* Not needed. */ + + terminal->read_socket_hook = &tty_read_avail_input; /* keyboard.c */ + terminal->frame_up_to_date_hook = 0; /* Not needed. */ + + terminal->delete_frame_hook = &delete_tty_output; + terminal->delete_terminal_hook = &delete_tty; +} + +/* Drop the controlling terminal if fd is the same device. */ +static void +dissociate_if_controlling_tty (int fd) +{ +#ifndef WINDOWSNT + int pgid; + EMACS_GET_TTY_PGRP (fd, &pgid); /* If tcgetpgrp succeeds, fd is the ctty. */ + if (pgid != -1) + { +#if defined (USG) && !defined (BSD_PGRPS) + setpgrp (); + no_controlling_tty = 1; +#elif defined (CYGWIN) + setsid (); + no_controlling_tty = 1; +#else +#ifdef TIOCNOTTY /* Try BSD ioctls. */ + sigblock (sigmask (SIGTTOU)); + fd = emacs_open (DEV_TTY, O_RDWR, 0); + if (fd != -1 && ioctl (fd, TIOCNOTTY, 0) != -1) + { + no_controlling_tty = 1; + } + if (fd != -1) + emacs_close (fd); + sigunblock (sigmask (SIGTTOU)); +#else + /* Unknown system. */ + croak (); +#endif /* ! TIOCNOTTY */ +#endif /* ! USG */ + } +#endif /* !WINDOWSNT */ +} + +static void maybe_fatal(); + +/* Create a termcap display on the tty device with the given name and + type. + + If NAME is NULL, then use the controlling tty, i.e., "/dev/tty". + Otherwise NAME should be a path to the tty device file, + e.g. "/dev/pts/7". + + TERMINAL_TYPE is the termcap type of the device, e.g. "vt100". + + If MUST_SUCCEED is true, then all errors are fatal. */ + +struct terminal * +init_tty (char *name, char *terminal_type, int must_succeed) { - char *area; + char *area = NULL; char **address = &area; char *buffer = NULL; int buffer_size = 4096; - register char *p; + register char *p = NULL; int status; - struct frame *sf = XFRAME (selected_frame); + struct tty_display_info *tty = NULL; + struct terminal *terminal = NULL; + int ctty = 0; /* 1 if asked to open controlling tty. */ + + if (!terminal_type) + maybe_fatal (must_succeed, 0, 0, + "Unknown terminal type", + "Unknown terminal type"); + + if (name == NULL) + name = DEV_TTY; + if (!strcmp (name, DEV_TTY)) + ctty = 1; + + /* If we already have a terminal on the given device, use that. If + all such terminals are suspended, create a new one instead. */ + /* XXX Perhaps this should be made explicit by having init_tty + always create a new terminal and separating terminal and frame + creation on Lisp level. */ + terminal = get_named_tty (name); + if (terminal) + return terminal; + + terminal = create_terminal (); + tty = (struct tty_display_info *) xmalloc (sizeof (struct tty_display_info)); + bzero (tty, sizeof (struct tty_display_info)); + tty->next = tty_list; + tty_list = tty; + + terminal->type = output_termcap; + terminal->display_info.tty = tty; + tty->terminal = terminal; + + tty->Wcm = (struct cm *) xmalloc (sizeof (struct cm)); + Wcm_clear (tty); + +#ifndef WINDOWSNT + set_tty_hooks (terminal); + + { + int fd; + FILE *file; + +#ifdef O_IGNORE_CTTY + if (!ctty) + /* Open the terminal device. Don't recognize it as our + controlling terminal, and don't make it the controlling tty + if we don't have one at the moment. */ + fd = emacs_open (name, O_RDWR | O_IGNORE_CTTY | O_NOCTTY, 0); + else +#else + /* Alas, O_IGNORE_CTTY is a GNU extension that seems to be only + defined on Hurd. On other systems, we need to explicitly + dissociate ourselves from the controlling tty when we want to + open a frame on the same terminal. */ + fd = emacs_open (name, O_RDWR | O_NOCTTY, 0); +#endif /* O_IGNORE_CTTY */ + + if (fd < 0) + maybe_fatal (must_succeed, buffer, terminal, + "Could not open file: %s", + "Could not open file: %s", + name); + if (!isatty (fd)) + { + close (fd); + maybe_fatal (must_succeed, buffer, terminal, + "Not a tty device: %s", + "Not a tty device: %s", + name); + } + +#ifndef O_IGNORE_CTTY + if (!ctty) + dissociate_if_controlling_tty (fd); +#endif + + file = fdopen (fd, "w+"); + tty->name = xstrdup (name); + terminal->name = xstrdup (name); + tty->input = file; + tty->output = file; + } + + tty->type = xstrdup (terminal_type); + + add_keyboard_wait_descriptor (fileno (tty->input)); + +#endif encode_terminal_src_size = 0; encode_terminal_dst_size = 0; #ifdef HAVE_GPM - mouse_position_hook = term_mouse_position; - Qmouse_face_window = Qnil; + terminal->mouse_position_hook = term_mouse_position; + mouse_face_window = Qnil; #endif #ifdef WINDOWSNT - initialize_w32_display (); + initialize_w32_display (terminal); + /* The following two are inaccessible from w32console.c. */ + terminal->delete_frame_hook = &delete_tty_output; + terminal->delete_terminal_hook = &delete_tty; - Wcm_clear (); + tty->name = xstrdup (name); + terminal->name = xstrdup (name); + tty->type = xstrdup (terminal_type); - area = (char *) xmalloc (2044); + tty->output = stdout; + tty->input = stdin; + add_keyboard_wait_descriptor (0); - FrameRows = FRAME_LINES (sf); - FrameCols = FRAME_COLS (sf); - specified_window = FRAME_LINES (sf); + Wcm_clear (tty); - delete_in_insert_mode = 1; + { + struct frame *f = XFRAME (selected_frame); + + FrameRows (tty) = FRAME_LINES (f); + FrameCols (tty) = FRAME_COLS (f); + tty->specified_window = FRAME_LINES (f); - UseTabs = 0; - scroll_region_ok = 0; + FRAME_CAN_HAVE_SCROLL_BARS (f) = 0; + FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_none; + } + tty->delete_in_insert_mode = 1; - /* Seems to insert lines when it's not supposed to, messing - up the display. In doing a trace, it didn't seem to be - called much, so I don't think we're losing anything by - turning it off. */ + UseTabs (tty) = 0; + terminal->scroll_region_ok = 0; - line_ins_del_ok = 0; - char_ins_del_ok = 1; + /* Seems to insert lines when it's not supposed to, messing up the + display. In doing a trace, it didn't seem to be called much, so I + don't think we're losing anything by turning it off. */ + terminal->line_ins_del_ok = 0; + terminal->char_ins_del_ok = 1; baud_rate = 19200; - FRAME_CAN_HAVE_SCROLL_BARS (sf) = 0; - FRAME_VERTICAL_SCROLL_BAR_TYPE (sf) = vertical_scroll_bar_none; - TN_max_colors = 16; /* Required to be non-zero for tty-display-color-p */ + tty->TN_max_colors = 16; /* Required to be non-zero for tty-display-color-p */ - return; #else /* not WINDOWSNT */ - Wcm_clear (); + Wcm_clear (tty); buffer = (char *) xmalloc (buffer_size); + + /* On some systems, tgetent tries to access the controlling + terminal. */ + sigblock (sigmask (SIGTTOU)); status = tgetent (buffer, terminal_type); + sigunblock (sigmask (SIGTTOU)); + if (status < 0) { #ifdef TERMINFO - fatal ("Cannot open terminfo database file"); + maybe_fatal (must_succeed, buffer, terminal, + "Cannot open terminfo database file", + "Cannot open terminfo database file"); #else - fatal ("Cannot open termcap database file"); + maybe_fatal (must_succeed, buffer, terminal, + "Cannot open termcap database file", + "Cannot open termcap database file"); #endif } if (status == 0) { #ifdef TERMINFO - fatal ("Terminal type %s is not defined.\n\ + maybe_fatal (must_succeed, buffer, terminal, + "Terminal type %s is not defined", + "Terminal type %s is not defined.\n\ If that is not the actual type of terminal you have,\n\ use the Bourne shell command `TERM=... export TERM' (C-shell:\n\ `setenv TERM ...') to specify the correct type. It may be necessary\n\ to do `unset TERMINFO' (C-shell: `unsetenv TERMINFO') as well.", - terminal_type); + terminal_type); #else - fatal ("Terminal type %s is not defined.\n\ + maybe_fatal (must_succeed, buffer, terminal, + "Terminal type %s is not defined", + "Terminal type %s is not defined.\n\ If that is not the actual type of terminal you have,\n\ use the Bourne shell command `TERM=... export TERM' (C-shell:\n\ `setenv TERM ...') to specify the correct type. It may be necessary\n\ to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.", - terminal_type); + terminal_type); #endif } @@ -3242,219 +3483,237 @@ to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.", #endif area = (char *) xmalloc (buffer_size); - TS_ins_line = tgetstr ("al", address); - TS_ins_multi_lines = tgetstr ("AL", address); - TS_bell = tgetstr ("bl", address); - BackTab = tgetstr ("bt", address); - TS_clr_to_bottom = tgetstr ("cd", address); - TS_clr_line = tgetstr ("ce", address); - TS_clr_frame = tgetstr ("cl", address); - ColPosition = NULL; /* tgetstr ("ch", address); */ - AbsPosition = tgetstr ("cm", address); - CR = tgetstr ("cr", address); - TS_set_scroll_region = tgetstr ("cs", address); - TS_set_scroll_region_1 = tgetstr ("cS", address); - RowPosition = tgetstr ("cv", address); - TS_del_char = tgetstr ("dc", address); - TS_del_multi_chars = tgetstr ("DC", address); - TS_del_line = tgetstr ("dl", address); - TS_del_multi_lines = tgetstr ("DL", address); - TS_delete_mode = tgetstr ("dm", address); - TS_end_delete_mode = tgetstr ("ed", address); - TS_end_insert_mode = tgetstr ("ei", address); - Home = tgetstr ("ho", address); - TS_ins_char = tgetstr ("ic", address); - TS_ins_multi_chars = tgetstr ("IC", address); - TS_insert_mode = tgetstr ("im", address); - TS_pad_inserted_char = tgetstr ("ip", address); - TS_end_keypad_mode = tgetstr ("ke", address); - TS_keypad_mode = tgetstr ("ks", address); - LastLine = tgetstr ("ll", address); - Right = tgetstr ("nd", address); - Down = tgetstr ("do", address); - if (!Down) - Down = tgetstr ("nl", address); /* Obsolete name for "do" */ + tty->TS_ins_line = tgetstr ("al", address); + tty->TS_ins_multi_lines = tgetstr ("AL", address); + tty->TS_bell = tgetstr ("bl", address); + BackTab (tty) = tgetstr ("bt", address); + tty->TS_clr_to_bottom = tgetstr ("cd", address); + tty->TS_clr_line = tgetstr ("ce", address); + tty->TS_clr_frame = tgetstr ("cl", address); + ColPosition (tty) = NULL; /* tgetstr ("ch", address); */ + AbsPosition (tty) = tgetstr ("cm", address); + CR (tty) = tgetstr ("cr", address); + tty->TS_set_scroll_region = tgetstr ("cs", address); + tty->TS_set_scroll_region_1 = tgetstr ("cS", address); + RowPosition (tty) = tgetstr ("cv", address); + tty->TS_del_char = tgetstr ("dc", address); + tty->TS_del_multi_chars = tgetstr ("DC", address); + tty->TS_del_line = tgetstr ("dl", address); + tty->TS_del_multi_lines = tgetstr ("DL", address); + tty->TS_delete_mode = tgetstr ("dm", address); + tty->TS_end_delete_mode = tgetstr ("ed", address); + tty->TS_end_insert_mode = tgetstr ("ei", address); + Home (tty) = tgetstr ("ho", address); + tty->TS_ins_char = tgetstr ("ic", address); + tty->TS_ins_multi_chars = tgetstr ("IC", address); + tty->TS_insert_mode = tgetstr ("im", address); + tty->TS_pad_inserted_char = tgetstr ("ip", address); + tty->TS_end_keypad_mode = tgetstr ("ke", address); + tty->TS_keypad_mode = tgetstr ("ks", address); + LastLine (tty) = tgetstr ("ll", address); + Right (tty) = tgetstr ("nd", address); + Down (tty) = tgetstr ("do", address); + if (!Down (tty)) + Down (tty) = tgetstr ("nl", address); /* Obsolete name for "do" */ #ifdef VMS /* VMS puts a carriage return before each linefeed, so it is not safe to use linefeeds. */ - if (Down && Down[0] == '\n' && Down[1] == '\0') - Down = 0; + if (Down (tty) && Down (tty)[0] == '\n' && Down (tty)[1] == '\0') + Down (tty) = 0; #endif /* VMS */ if (tgetflag ("bs")) - Left = "\b"; /* can't possibly be longer! */ + Left (tty) = "\b"; /* can't possibly be longer! */ else /* (Actually, "bs" is obsolete...) */ - Left = tgetstr ("le", address); - if (!Left) - Left = tgetstr ("bc", address); /* Obsolete name for "le" */ - TS_pad_char = tgetstr ("pc", address); - TS_repeat = tgetstr ("rp", address); - TS_end_standout_mode = tgetstr ("se", address); - TS_fwd_scroll = tgetstr ("sf", address); - TS_standout_mode = tgetstr ("so", address); - TS_rev_scroll = tgetstr ("sr", address); - Wcm.cm_tab = tgetstr ("ta", address); - TS_end_termcap_modes = tgetstr ("te", address); - TS_termcap_modes = tgetstr ("ti", address); - Up = tgetstr ("up", address); - TS_visible_bell = tgetstr ("vb", address); - TS_cursor_normal = tgetstr ("ve", address); - TS_cursor_visible = tgetstr ("vs", address); - TS_cursor_invisible = tgetstr ("vi", address); - TS_set_window = tgetstr ("wi", address); - - TS_enter_underline_mode = tgetstr ("us", address); - TS_exit_underline_mode = tgetstr ("ue", address); - TS_enter_bold_mode = tgetstr ("md", address); - TS_enter_dim_mode = tgetstr ("mh", address); - TS_enter_blink_mode = tgetstr ("mb", address); - TS_enter_reverse_mode = tgetstr ("mr", address); - TS_enter_alt_charset_mode = tgetstr ("as", address); - TS_exit_alt_charset_mode = tgetstr ("ae", address); - TS_exit_attribute_mode = tgetstr ("me", address); - - MultiUp = tgetstr ("UP", address); - MultiDown = tgetstr ("DO", address); - MultiLeft = tgetstr ("LE", address); - MultiRight = tgetstr ("RI", address); + Left (tty) = tgetstr ("le", address); + if (!Left (tty)) + Left (tty) = tgetstr ("bc", address); /* Obsolete name for "le" */ + tty->TS_pad_char = tgetstr ("pc", address); + tty->TS_repeat = tgetstr ("rp", address); + tty->TS_end_standout_mode = tgetstr ("se", address); + tty->TS_fwd_scroll = tgetstr ("sf", address); + tty->TS_standout_mode = tgetstr ("so", address); + tty->TS_rev_scroll = tgetstr ("sr", address); + tty->Wcm->cm_tab = tgetstr ("ta", address); + tty->TS_end_termcap_modes = tgetstr ("te", address); + tty->TS_termcap_modes = tgetstr ("ti", address); + Up (tty) = tgetstr ("up", address); + tty->TS_visible_bell = tgetstr ("vb", address); + tty->TS_cursor_normal = tgetstr ("ve", address); + tty->TS_cursor_visible = tgetstr ("vs", address); + tty->TS_cursor_invisible = tgetstr ("vi", address); + tty->TS_set_window = tgetstr ("wi", address); + + tty->TS_enter_underline_mode = tgetstr ("us", address); + tty->TS_exit_underline_mode = tgetstr ("ue", address); + tty->TS_enter_bold_mode = tgetstr ("md", address); + tty->TS_enter_dim_mode = tgetstr ("mh", address); + tty->TS_enter_blink_mode = tgetstr ("mb", address); + tty->TS_enter_reverse_mode = tgetstr ("mr", address); + tty->TS_enter_alt_charset_mode = tgetstr ("as", address); + tty->TS_exit_alt_charset_mode = tgetstr ("ae", address); + tty->TS_exit_attribute_mode = tgetstr ("me", address); + + MultiUp (tty) = tgetstr ("UP", address); + MultiDown (tty) = tgetstr ("DO", address); + MultiLeft (tty) = tgetstr ("LE", address); + MultiRight (tty) = tgetstr ("RI", address); /* SVr4/ANSI color suppert. If "op" isn't available, don't support color because we can't switch back to the default foreground and background. */ - TS_orig_pair = tgetstr ("op", address); - if (TS_orig_pair) + tty->TS_orig_pair = tgetstr ("op", address); + if (tty->TS_orig_pair) { - TS_set_foreground = tgetstr ("AF", address); - TS_set_background = tgetstr ("AB", address); - if (!TS_set_foreground) + tty->TS_set_foreground = tgetstr ("AF", address); + tty->TS_set_background = tgetstr ("AB", address); + if (!tty->TS_set_foreground) { /* SVr4. */ - TS_set_foreground = tgetstr ("Sf", address); - TS_set_background = tgetstr ("Sb", address); + tty->TS_set_foreground = tgetstr ("Sf", address); + tty->TS_set_background = tgetstr ("Sb", address); } - TN_max_colors = tgetnum ("Co"); - TN_max_pairs = tgetnum ("pa"); + tty->TN_max_colors = tgetnum ("Co"); + tty->TN_max_pairs = tgetnum ("pa"); - TN_no_color_video = tgetnum ("NC"); - if (TN_no_color_video == -1) - TN_no_color_video = 0; + tty->TN_no_color_video = tgetnum ("NC"); + if (tty->TN_no_color_video == -1) + tty->TN_no_color_video = 0; } - tty_default_color_capabilities (1); + tty_default_color_capabilities (tty, 1); - MagicWrap = tgetflag ("xn"); + MagicWrap (tty) = tgetflag ("xn"); /* Since we make MagicWrap terminals look like AutoWrap, we need to have the former flag imply the latter. */ - AutoWrap = MagicWrap || tgetflag ("am"); - memory_below_frame = tgetflag ("db"); - TF_hazeltine = tgetflag ("hz"); - must_write_spaces = tgetflag ("in"); - meta_key = tgetflag ("km") || tgetflag ("MT"); - TF_insmode_motion = tgetflag ("mi"); - TF_standout_motion = tgetflag ("ms"); - TF_underscore = tgetflag ("ul"); - TF_teleray = tgetflag ("xt"); - - term_get_fkeys (address); + AutoWrap (tty) = MagicWrap (tty) || tgetflag ("am"); + terminal->memory_below_frame = tgetflag ("db"); + tty->TF_hazeltine = tgetflag ("hz"); + terminal->must_write_spaces = tgetflag ("in"); + tty->meta_key = tgetflag ("km") || tgetflag ("MT"); + tty->TF_insmode_motion = tgetflag ("mi"); + tty->TF_standout_motion = tgetflag ("ms"); + tty->TF_underscore = tgetflag ("ul"); + tty->TF_teleray = tgetflag ("xt"); + +#endif /* !WINDOWSNT */ +#ifdef MULTI_KBOARD + terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD)); + init_kboard (terminal->kboard); + terminal->kboard->next_kboard = all_kboards; + all_kboards = terminal->kboard; + terminal->kboard->reference_count++; + /* Don't let the initial kboard remain current longer than necessary. + That would cause problems if a file loaded on startup tries to + prompt in the mini-buffer. */ + if (current_kboard == initial_kboard) + current_kboard = terminal->kboard; +#ifndef WINDOWSNT + term_get_fkeys (address, terminal->kboard); +#endif +#endif +#ifndef WINDOWSNT /* Get frame size from system, or else from termcap. */ { int height, width; - get_frame_size (&width, &height); - FRAME_COLS (sf) = width; - FRAME_LINES (sf) = height; + get_tty_size (fileno (tty->input), &width, &height); + FrameCols (tty) = width; + FrameRows (tty) = height; } - if (FRAME_COLS (sf) <= 0) - SET_FRAME_COLS (sf, tgetnum ("co")); - else - /* Keep width and external_width consistent */ - SET_FRAME_COLS (sf, FRAME_COLS (sf)); - if (FRAME_LINES (sf) <= 0) - FRAME_LINES (sf) = tgetnum ("li"); + if (FrameCols (tty) <= 0) + FrameCols (tty) = tgetnum ("co"); + if (FrameRows (tty) <= 0) + FrameRows (tty) = tgetnum ("li"); - if (FRAME_LINES (sf) < 3 || FRAME_COLS (sf) < 3) - fatal ("Screen size %dx%d is too small", - FRAME_LINES (sf), FRAME_COLS (sf)); + if (FrameRows (tty) < 3 || FrameCols (tty) < 3) + maybe_fatal (must_succeed, NULL, terminal, + "Screen size %dx%d is too small" + "Screen size %dx%d is too small", + FrameCols (tty), FrameRows (tty)); - min_padding_speed = tgetnum ("pb"); - TabWidth = tgetnum ("tw"); +#if 0 /* This is not used anywhere. */ + tty->terminal->min_padding_speed = tgetnum ("pb"); +#endif + + TabWidth (tty) = tgetnum ("tw"); #ifdef VMS /* These capabilities commonly use ^J. I don't know why, but sending them on VMS does not work; it causes following spaces to be lost, sometimes. For now, the simplest fix is to avoid using these capabilities ever. */ - if (Down && Down[0] == '\n') - Down = 0; + if (Down (tty) && Down (tty)[0] == '\n') + Down (tty) = 0; #endif /* VMS */ - if (!TS_bell) - TS_bell = "\07"; + if (!tty->TS_bell) + tty->TS_bell = "\07"; - if (!TS_fwd_scroll) - TS_fwd_scroll = Down; + if (!tty->TS_fwd_scroll) + tty->TS_fwd_scroll = Down (tty); - PC = TS_pad_char ? *TS_pad_char : 0; + PC = tty->TS_pad_char ? *tty->TS_pad_char : 0; - if (TabWidth < 0) - TabWidth = 8; + if (TabWidth (tty) < 0) + TabWidth (tty) = 8; /* Turned off since /etc/termcap seems to have :ta= for most terminals and newer termcap doc does not seem to say there is a default. - if (!Wcm.cm_tab) - Wcm.cm_tab = "\t"; + if (!tty->Wcm->cm_tab) + tty->Wcm->cm_tab = "\t"; */ /* We don't support standout modes that use `magic cookies', so turn off any that do. */ - if (TS_standout_mode && tgetnum ("sg") >= 0) + if (tty->TS_standout_mode && tgetnum ("sg") >= 0) { - TS_standout_mode = 0; - TS_end_standout_mode = 0; + tty->TS_standout_mode = 0; + tty->TS_end_standout_mode = 0; } - if (TS_enter_underline_mode && tgetnum ("ug") >= 0) + if (tty->TS_enter_underline_mode && tgetnum ("ug") >= 0) { - TS_enter_underline_mode = 0; - TS_exit_underline_mode = 0; + tty->TS_enter_underline_mode = 0; + tty->TS_exit_underline_mode = 0; } /* If there's no standout mode, try to use underlining instead. */ - if (TS_standout_mode == 0) + if (tty->TS_standout_mode == 0) { - TS_standout_mode = TS_enter_underline_mode; - TS_end_standout_mode = TS_exit_underline_mode; + tty->TS_standout_mode = tty->TS_enter_underline_mode; + tty->TS_end_standout_mode = tty->TS_exit_underline_mode; } /* If no `se' string, try using a `me' string instead. If that fails, we can't use standout mode at all. */ - if (TS_end_standout_mode == 0) + if (tty->TS_end_standout_mode == 0) { char *s = tgetstr ("me", address); if (s != 0) - TS_end_standout_mode = s; + tty->TS_end_standout_mode = s; else - TS_standout_mode = 0; + tty->TS_standout_mode = 0; } - if (TF_teleray) + if (tty->TF_teleray) { - Wcm.cm_tab = 0; + tty->Wcm->cm_tab = 0; /* We can't support standout mode, because it uses magic cookies. */ - TS_standout_mode = 0; + tty->TS_standout_mode = 0; /* But that means we cannot rely on ^M to go to column zero! */ - CR = 0; + CR (tty) = 0; /* LF can't be trusted either -- can alter hpos */ /* if move at column 0 thru a line with TS_standout_mode */ - Down = 0; + Down (tty) = 0; } /* Special handling for certain terminal types known to need it */ if (!strcmp (terminal_type, "supdup")) { - memory_below_frame = 1; - Wcm.cm_losewrap = 1; + terminal->memory_below_frame = 1; + tty->Wcm->cm_losewrap = 1; } if (!strncmp (terminal_type, "c10", 3) || !strcmp (terminal_type, "perq")) @@ -3471,102 +3730,140 @@ to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.", It would be simpler if the :wi string could go in the termcap entry, but it can't because it is not fully valid. If it were in the termcap entry, it would confuse other programs. */ - if (!TS_set_window) + if (!tty->TS_set_window) { - p = TS_termcap_modes; + p = tty->TS_termcap_modes; while (*p && strcmp (p, "\033v ")) p++; if (*p) - TS_set_window = "\033v%C %C %C %C "; + tty->TS_set_window = "\033v%C %C %C %C "; } /* Termcap entry often fails to have :in: flag */ - must_write_spaces = 1; + terminal->must_write_spaces = 1; /* :ti string typically fails to have \E^G! in it */ /* This limits scope of insert-char to one line. */ - strcpy (area, TS_termcap_modes); + strcpy (area, tty->TS_termcap_modes); strcat (area, "\033\007!"); - TS_termcap_modes = area; + tty->TS_termcap_modes = area; area += strlen (area) + 1; - p = AbsPosition; + p = AbsPosition (tty); /* Change all %+ parameters to %C, to handle - values above 96 correctly for the C100. */ + values above 96 correctly for the C100. */ while (*p) - { - if (p[0] == '%' && p[1] == '+') - p[1] = 'C'; - p++; - } + { + if (p[0] == '%' && p[1] == '+') + p[1] = 'C'; + p++; + } } - FrameRows = FRAME_LINES (sf); - FrameCols = FRAME_COLS (sf); - specified_window = FRAME_LINES (sf); + tty->specified_window = FrameRows (tty); - if (Wcm_init () == -1) /* can't do cursor motion */ + if (Wcm_init (tty) == -1) /* can't do cursor motion */ + { + maybe_fatal (must_succeed, NULL, terminal, + "Terminal type \"%s\" is not powerful enough to run Emacs", #ifdef VMS - fatal ("Terminal type \"%s\" is not powerful enough to run Emacs.\n\ + "Terminal type \"%s\" is not powerful enough to run Emacs.\n\ It lacks the ability to position the cursor.\n\ If that is not the actual type of terminal you have, use either the\n\ DCL command `SET TERMINAL/DEVICE= ...' for DEC-compatible terminals,\n\ or `define EMACS_TERM \"terminal type\"' for non-DEC terminals.", - terminal_type); #else /* not VMS */ # ifdef TERMINFO - fatal ("Terminal type \"%s\" is not powerful enough to run Emacs.\n\ + "Terminal type \"%s\" is not powerful enough to run Emacs.\n\ It lacks the ability to position the cursor.\n\ If that is not the actual type of terminal you have,\n\ use the Bourne shell command `TERM=... export TERM' (C-shell:\n\ `setenv TERM ...') to specify the correct type. It may be necessary\n\ to do `unset TERMINFO' (C-shell: `unsetenv TERMINFO') as well.", - terminal_type); # else /* TERMCAP */ - fatal ("Terminal type \"%s\" is not powerful enough to run Emacs.\n\ + "Terminal type \"%s\" is not powerful enough to run Emacs.\n\ It lacks the ability to position the cursor.\n\ If that is not the actual type of terminal you have,\n\ use the Bourne shell command `TERM=... export TERM' (C-shell:\n\ `setenv TERM ...') to specify the correct type. It may be necessary\n\ to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.", - terminal_type); # endif /* TERMINFO */ #endif /*VMS */ - if (FRAME_LINES (sf) <= 0 - || FRAME_COLS (sf) <= 0) - fatal ("The frame size has not been specified"); + terminal_type); + } + + if (FrameRows (tty) <= 0 || FrameCols (tty) <= 0) + maybe_fatal (must_succeed, NULL, terminal, + "Could not determine the frame size", + "Could not determine the frame size"); - delete_in_insert_mode - = TS_delete_mode && TS_insert_mode - && !strcmp (TS_delete_mode, TS_insert_mode); + tty->delete_in_insert_mode + = tty->TS_delete_mode && tty->TS_insert_mode + && !strcmp (tty->TS_delete_mode, tty->TS_insert_mode); - se_is_so = (TS_standout_mode - && TS_end_standout_mode - && !strcmp (TS_standout_mode, TS_end_standout_mode)); + tty->se_is_so = (tty->TS_standout_mode + && tty->TS_end_standout_mode + && !strcmp (tty->TS_standout_mode, tty->TS_end_standout_mode)); - UseTabs = tabs_safe_p () && TabWidth == 8; + UseTabs (tty) = tabs_safe_p (fileno (tty->input)) && TabWidth (tty) == 8; - scroll_region_ok - = (Wcm.cm_abs - && (TS_set_window || TS_set_scroll_region || TS_set_scroll_region_1)); + terminal->scroll_region_ok + = (tty->Wcm->cm_abs + && (tty->TS_set_window || tty->TS_set_scroll_region || tty->TS_set_scroll_region_1)); - line_ins_del_ok = (((TS_ins_line || TS_ins_multi_lines) - && (TS_del_line || TS_del_multi_lines)) - || (scroll_region_ok && TS_fwd_scroll && TS_rev_scroll)); + terminal->line_ins_del_ok + = (((tty->TS_ins_line || tty->TS_ins_multi_lines) + && (tty->TS_del_line || tty->TS_del_multi_lines)) + || (terminal->scroll_region_ok + && tty->TS_fwd_scroll && tty->TS_rev_scroll)); - char_ins_del_ok = ((TS_ins_char || TS_insert_mode - || TS_pad_inserted_char || TS_ins_multi_chars) - && (TS_del_char || TS_del_multi_chars)); + terminal->char_ins_del_ok + = ((tty->TS_ins_char || tty->TS_insert_mode + || tty->TS_pad_inserted_char || tty->TS_ins_multi_chars) + && (tty->TS_del_char || tty->TS_del_multi_chars)); - fast_clear_end_of_line = TS_clr_line != 0; + terminal->fast_clear_end_of_line = tty->TS_clr_line != 0; - init_baud_rate (); - if (read_socket_hook) /* Baudrate is somewhat */ - /* meaningless in this case */ - baud_rate = 9600; + init_baud_rate (fileno (tty->input)); - FRAME_CAN_HAVE_SCROLL_BARS (sf) = 0; - FRAME_VERTICAL_SCROLL_BAR_TYPE (sf) = vertical_scroll_bar_none; -#endif /* WINDOWSNT */ +#ifdef AIXHFT + /* The HFT system on AIX doesn't optimize for scrolling, so it's + really ugly at times. */ + terminal->line_ins_del_ok = 0; + terminal->char_ins_del_ok = 0; +#endif + + /* Don't do this. I think termcap may still need the buffer. */ + /* xfree (buffer); */ + +#endif /* not WINDOWSNT */ + + /* Init system terminal modes (RAW or CBREAK, etc.). */ + init_sys_modes (tty); + + return terminal; +} + +/* Auxiliary error-handling function for init_tty. + Free BUFFER and delete TERMINAL, then call error or fatal + with str1 or str2, respectively, according to MUST_SUCCEED. */ - xfree (buffer); +static void +maybe_fatal (must_succeed, buffer, terminal, str1, str2, arg1, arg2) + int must_succeed; + char *buffer; + struct terminal *terminal; + char *str1, *str2, *arg1, *arg2; +{ + if (buffer) + xfree (buffer); + + if (terminal) + delete_tty (terminal); + + if (must_succeed) + fatal (str2, arg1, arg2); + else + error (str1, arg1, arg2); + + abort (); } /* VARARGS 1 */ @@ -3581,16 +3878,105 @@ fatal (str, arg1, arg2) exit (1); } -DEFUN ("tty-no-underline", Ftty_no_underline, Stty_no_underline, 0, 0, 0, - doc: /* Declare that this terminal does not handle underlining. -This is used to override the terminfo data, for certain terminals that -do not really do underlining, but say that they do. */) - () + + +/* Delete the given tty terminal, closing all frames on it. */ + +static void +delete_tty (struct terminal *terminal) { - TS_enter_underline_mode = 0; - return Qnil; + struct tty_display_info *tty; + Lisp_Object tail, frame; + int last_terminal; + + /* Protect against recursive calls. Fdelete_frame in + delete_terminal calls us back when it deletes our last frame. */ + if (!terminal->name) + return; + + if (terminal->type != output_termcap) + abort (); + + tty = terminal->display_info.tty; + + last_terminal = 1; + FOR_EACH_FRAME (tail, frame) + { + struct frame *f = XFRAME (frame); + if (FRAME_LIVE_P (f) && (!FRAME_TERMCAP_P (f) || FRAME_TTY (f) != tty)) + { + last_terminal = 0; + break; + } + } + if (last_terminal) + error ("Attempt to delete the sole terminal device with live frames"); + + if (tty == tty_list) + tty_list = tty->next; + else + { + struct tty_display_info *p; + for (p = tty_list; p && p->next != tty; p = p->next) + ; + + if (! p) + /* This should not happen. */ + abort (); + + p->next = tty->next; + tty->next = 0; + } + + /* reset_sys_modes needs a valid device, so this call needs to be + before delete_terminal. */ + reset_sys_modes (tty); + + delete_terminal (terminal); + + if (tty->name) + xfree (tty->name); + + if (tty->type) + xfree (tty->type); + + if (tty->input) + { + delete_keyboard_wait_descriptor (fileno (tty->input)); + if (tty->input != stdin) + fclose (tty->input); + } + if (tty->output && tty->output != stdout && tty->output != tty->input) + fclose (tty->output); + if (tty->termscript) + fclose (tty->termscript); + + if (tty->old_tty) + xfree (tty->old_tty); + + if (tty->Wcm) + xfree (tty->Wcm); + + bzero (tty, sizeof (struct tty_display_info)); + xfree (tty); +} + + + +/* Mark the pointers in the tty_display_info objects. + Called by the Fgarbage_collector. */ + +void +mark_ttys (void) +{ + struct tty_display_info *tty; + + for (tty = tty_list; tty; tty = tty->next) + mark_object (tty->top_frame); } + + void syms_of_term () { @@ -3603,10 +3989,18 @@ This variable can be used by terminal emulator packages. */); system_uses_terminfo = 0; #endif - DEFVAR_LISP ("ring-bell-function", &Vring_bell_function, - doc: /* Non-nil means call this function to ring the bell. -The function should accept no arguments. */); - Vring_bell_function = Qnil; + DEFVAR_LISP ("suspend-tty-functions", &Vsuspend_tty_functions, + doc: /* Functions to be run after suspending a tty. +The functions are run with one argument, the terminal id to be suspended. +See `suspend-tty'. */); + Vsuspend_tty_functions = Qnil; + + + DEFVAR_LISP ("resume-tty-functions", &Vresume_tty_functions, + doc: /* Functions to be run after resuming a tty. +The functions are run with one argument, the terminal id that was revived. +See `resume-tty'. */); + Vresume_tty_functions = Qnil; DEFVAR_BOOL ("visible-cursor", &visible_cursor, doc: /* Non-nil means to make the cursor very visible. @@ -3618,15 +4012,19 @@ bigger, or it may make it blink, or it may do nothing at all. */); defsubr (&Stty_display_color_p); defsubr (&Stty_display_color_cells); defsubr (&Stty_no_underline); + defsubr (&Stty_type); + defsubr (&Scontrolling_tty_p); + defsubr (&Ssuspend_tty); + defsubr (&Sresume_tty); #ifdef HAVE_GPM - defsubr (&Sterm_open_connection); - defsubr (&Sterm_close_connection); + defsubr (&Sgpm_mouse_start); + defsubr (&Sgpm_mouse_stop); - staticpro (&Qmouse_face_window); + staticpro (&mouse_face_window); #endif /* HAVE_GPM */ - - fullscreen_hook = NULL; } + + /* arch-tag: 498e7449-6f2e-45e2-91dd-b7d4ca488193 (do not change this comment) */ diff --git a/src/termchar.h b/src/termchar.h index c4bf2adb0bd..381210fd658 100644 --- a/src/termchar.h +++ b/src/termchar.h @@ -19,32 +19,185 @@ along with GNU Emacs; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/* Each termcap frame points to its own struct tty_output object in + the output_data.tty field. The tty_output structure contains the + information that is specific to termcap frames. */ -/* extern EMACS_INT baud_rate; */ /* Output speed in baud */ -extern int must_write_spaces; /* Nonzero means spaces in the text - must actually be output; can't just skip - over some columns to leave them blank. */ -extern int min_padding_speed; /* Speed below which no padding necessary */ -extern int fast_clear_end_of_line; /* Nonzero means terminal has - command for this */ - -extern int line_ins_del_ok; /* Terminal can insert and delete lines */ -extern int char_ins_del_ok; /* Terminal can insert and delete chars */ -extern int scroll_region_ok; /* Terminal supports setting the scroll - window */ -extern int scroll_region_cost; /* Cost of setting the scroll window, - measured in characters */ -extern int memory_below_frame; /* Terminal remembers lines scrolled - off bottom */ -extern int fast_clear_end_of_line; /* Terminal has a `ce' string */ - -extern int dont_calculate_costs; /* Nonzero means don't bother computing - various cost tables; we won't use them. */ - -/* Nonzero means no need to redraw the entire frame on resuming - a suspended Emacs. This is useful on terminals with multiple pages, - where one page is used for Emacs and another for all else. */ -extern int no_redraw_on_reenter; +struct tty_output +{ + /* The Emacs structure for the tty device this frame is on. */ + struct tty_display_info *display_info; + + /* There is nothing else here at the moment... */ +}; + +/* Parameters that are shared between frames on the same tty device. */ + +struct tty_display_info +{ + struct tty_display_info *next; /* Chain of all tty devices. */ + + char *name; /* The name of the device file or 0 if + stdin/stdout. */ + char *type; /* The type of the tty. */ + + /* Input/output */ + + FILE *input; /* The stream to be used for terminal input. + NULL if the terminal is suspended. */ + FILE *output; /* The stream to be used for terminal output. + NULL if the terminal is suspended. */ + + FILE *termscript; /* If nonzero, send all terminal output + characters to this stream also. */ + + struct emacs_tty *old_tty; /* The initial tty mode bits */ + + int term_initted; /* 1 if we have been through init_sys_modes. */ + + + int reference_count; /* Number of frames that are on this display. */ + + struct terminal *terminal; /* Points back to the generic terminal + structure. This is sometimes handy. */ + + /* Info on cursor positioning. */ + struct cm *Wcm; + + /* Redisplay. */ + + Lisp_Object top_frame; /* The topmost frame on this tty. */ + + /* The previous frame we displayed on this tty. */ + struct frame *previous_frame; + + /* Strings, numbers and flags taken from the termcap entry. */ + + char *TS_ins_line; /* "al" */ + char *TS_ins_multi_lines; /* "AL" (one parameter, # lines to insert) */ + char *TS_bell; /* "bl" */ + char *TS_clr_to_bottom; /* "cd" */ + char *TS_clr_line; /* "ce", clear to end of line */ + char *TS_clr_frame; /* "cl" */ + char *TS_set_scroll_region; /* "cs" (2 params, first line and last line) */ + char *TS_set_scroll_region_1; /* "cS" (4 params: total lines, + lines above scroll region, lines below it, + total lines again) */ + char *TS_del_char; /* "dc" */ + char *TS_del_multi_chars; /* "DC" (one parameter, # chars to delete) */ + char *TS_del_line; /* "dl" */ + char *TS_del_multi_lines; /* "DL" (one parameter, # lines to delete) */ + char *TS_delete_mode; /* "dm", enter character-delete mode */ + char *TS_end_delete_mode; /* "ed", leave character-delete mode */ + char *TS_end_insert_mode; /* "ei", leave character-insert mode */ + char *TS_ins_char; /* "ic" */ + char *TS_ins_multi_chars; /* "IC" (one parameter, # chars to insert) */ + char *TS_insert_mode; /* "im", enter character-insert mode */ + char *TS_pad_inserted_char; /* "ip". Just padding, no commands. */ + char *TS_end_keypad_mode; /* "ke" */ + char *TS_keypad_mode; /* "ks" */ + char *TS_pad_char; /* "pc", char to use as padding */ + char *TS_repeat; /* "rp" (2 params, # times to repeat + and character to be repeated) */ + char *TS_end_standout_mode; /* "se" */ + char *TS_fwd_scroll; /* "sf" */ + char *TS_standout_mode; /* "so" */ + char *TS_rev_scroll; /* "sr" */ + char *TS_end_termcap_modes; /* "te" */ + char *TS_termcap_modes; /* "ti" */ + char *TS_visible_bell; /* "vb" */ + char *TS_cursor_normal; /* "ve" */ + char *TS_cursor_visible; /* "vs" */ + char *TS_cursor_invisible; /* "vi" */ + char *TS_set_window; /* "wi" (4 params, start and end of window, + each as vpos and hpos) */ + + char *TS_enter_bold_mode; /* "md" -- turn on bold (extra bright mode). */ + char *TS_enter_dim_mode; /* "mh" -- turn on half-bright mode. */ + char *TS_enter_blink_mode; /* "mb" -- enter blinking mode. */ + char *TS_enter_reverse_mode; /* "mr" -- enter reverse video mode. */ + char *TS_exit_underline_mode; /* "us" -- start underlining. */ + char *TS_enter_underline_mode; /* "ue" -- end underlining. */ + + /* "as"/"ae" -- start/end alternate character set. Not really + supported, yet. */ + char *TS_enter_alt_charset_mode; + char *TS_exit_alt_charset_mode; + + char *TS_exit_attribute_mode; /* "me" -- switch appearances off. */ + + /* Value of the "NC" (no_color_video) capability, or 0 if not present. */ + int TN_no_color_video; + + int TN_max_colors; /* "Co" -- number of colors. */ + + /* "pa" -- max. number of color pairs on screen. Not handled yet. + Could be a problem if not equal to TN_max_colors * TN_max_colors. */ + int TN_max_pairs; + + /* "op" -- SVr4 set default pair to its original value. */ + char *TS_orig_pair; + + /* "AF"/"AB" or "Sf"/"Sb"-- set ANSI or SVr4 foreground/background color. + 1 param, the color index. */ + char *TS_set_foreground; + char *TS_set_background; + + int TF_hazeltine; /* termcap hz flag. */ + int TF_insmode_motion; /* termcap mi flag: can move while in insert mode. */ + int TF_standout_motion; /* termcap mi flag: can move while in standout mode. */ + int TF_underscore; /* termcap ul flag: _ underlines if over-struck on + non-blank position. Must clear before writing _. */ + int TF_teleray; /* termcap xt flag: many weird consequences. + For t1061. */ + + int RPov; /* # chars to start a TS_repeat */ + + int delete_in_insert_mode; /* delete mode == insert mode */ + + int se_is_so; /* 1 if same string both enters and leaves + standout mode */ + + int costs_set; /* Nonzero if costs have been calculated. */ + + int insert_mode; /* Nonzero when in insert mode. */ + int standout_mode; /* Nonzero when in standout mode. */ + + + + /* 1 if should obey 0200 bit in input chars as "Meta", 2 if should + keep 0200 bit in input chars. 0 to ignore the 0200 bit. */ + + int meta_key; + + /* Size of window specified by higher levels. + This is the number of lines, from the top of frame downwards, + which can participate in insert-line/delete-line operations. + + Effectively it excludes the bottom frame_lines - specified_window_size + lines from those operations. */ + + int specified_window; + + /* Flag used in tty_show/hide_cursor. */ + + int cursor_hidden; + + /* Nonzero means use ^S/^Q for flow control. */ + int flow_control; + +}; + +/* A chain of structures for all tty devices currently in use. */ +extern struct tty_display_info *tty_list; + + +#define FRAME_TTY(f) \ + ((f)->output_method == output_termcap \ + ? (f)->terminal->display_info.tty \ + : (abort(), (struct tty_display_info *) 0)) + +#define CURTTY() FRAME_TTY (SELECTED_FRAME()) /* arch-tag: bf9f0d49-842b-42fb-9348-ec8759b27193 (do not change this comment) */ diff --git a/src/termhooks.h b/src/termhooks.h index eb074608e19..4d8fb8a861b 100644 --- a/src/termhooks.h +++ b/src/termhooks.h @@ -1,7 +1,6 @@ -/* Hooks by which low level terminal operations - can be made to call other routines. - Copyright (C) 1985, 1986, 1993, 1994, 2001, 2002, 2003, 2004, - 2005, 2006, 2007 Free Software Foundation, Inc. +/* Parameters and display hooks for terminal devices. + Copyright (C) 1985, 1986, 1993, 1994, 2002, 2003, 2004, + 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -26,40 +25,11 @@ Boston, MA 02110-1301, USA. */ struct glyph; struct frame; -/* If nonzero, send all terminal output characters to this stream also. */ -extern FILE *termscript; - /* Only use prototypes when lisp.h has been included. */ #ifndef P_ #define P_(X) () #endif -/* Text display hooks. */ - -extern void (*cursor_to_hook) P_ ((int vpos, int hpos)); -extern void (*raw_cursor_to_hook) P_ ((int, int)); - -extern void (*clear_to_end_hook) P_ ((void)); -extern void (*clear_frame_hook) P_ ((void)); -extern void (*clear_end_of_line_hook) P_ ((int)); - -extern void (*ins_del_lines_hook) P_ ((int, int)); - -extern void (*insert_glyphs_hook) P_ ((struct glyph *s, int n)); -extern void (*write_glyphs_hook) P_ ((struct glyph *s, int n)); -extern void (*delete_glyphs_hook) P_ ((int)); - -extern void (*ring_bell_hook) P_ ((void)); - -extern void (*reset_terminal_modes_hook) P_ ((void)); -extern void (*set_terminal_modes_hook) P_ ((void)); -extern void (*update_begin_hook) P_ ((struct frame *)); -extern void (*update_end_hook) P_ ((struct frame *)); -extern void (*set_terminal_window_hook) P_ ((int)); - - - -/* Multi-frame and mouse support hooks. */ enum scroll_bar_part { scroll_bar_above_handle, @@ -73,131 +43,12 @@ enum scroll_bar_part { scroll_bar_move_ratio }; -/* Return the current position of the mouse. - - Set *f to the frame the mouse is in, or zero if the mouse is in no - Emacs frame. If it is set to zero, all the other arguments are - garbage. - - If the motion started in a scroll bar, set *bar_window to the - scroll bar's window, *part to the part the mouse is currently over, - *x to the position of the mouse along the scroll bar, and *y to the - overall length of the scroll bar. - - Otherwise, set *bar_window to Qnil, and *x and *y to the column and - row of the character cell the mouse is over. - - Set *time to the time the mouse was at the returned position. - - This should clear mouse_moved until the next motion - event arrives. */ -extern void (*mouse_position_hook) P_ ((struct frame **f, int, - Lisp_Object *bar_window, - enum scroll_bar_part *part, - Lisp_Object *x, - Lisp_Object *y, - unsigned long *time)); - -/* The window system handling code should set this if the mouse has - moved since the last call to the mouse_position_hook. Calling that - hook should clear this. */ -extern int mouse_moved; - -/* When a frame's focus redirection is changed, this hook tells the - window system code to re-decide where to put the highlight. Under - X, this means that Emacs lies about where the focus is. */ -extern void (*frame_rehighlight_hook) P_ ((struct frame *)); - -/* If we're displaying frames using a window system that can stack - frames on top of each other, this hook allows you to bring a frame - to the front, or bury it behind all the other windows. If this - hook is zero, that means the device we're displaying on doesn't - support overlapping frames, so there's no need to raise or lower - anything. - - If RAISE is non-zero, F is brought to the front, before all other - windows. If RAISE is zero, F is sent to the back, behind all other - windows. */ -extern void (*frame_raise_lower_hook) P_ ((struct frame *f, int raise)); - /* If the value of the frame parameter changed, whis hook is called. For example, if going from fullscreen to not fullscreen this hook may do something OS dependent, like extended window manager hints on X11. */ extern void (*fullscreen_hook) P_ ((struct frame *f)); -/* Scroll bar hooks. */ - -/* The representation of scroll bars is determined by the code which - implements them, except for one thing: they must be represented by - lisp objects. This allows us to place references to them in - Lisp_Windows without worrying about those references becoming - dangling references when the scroll bar is destroyed. - - The window-system-independent portion of Emacs just refers to - scroll bars via their windows, and never looks inside the scroll bar - representation; it always uses hook functions to do all the - scroll bar manipulation it needs. - - The `vertical_scroll_bar' field of a Lisp_Window refers to that - window's scroll bar, or is nil if the window doesn't have a - scroll bar. - - The `scroll_bars' and `condemned_scroll_bars' fields of a Lisp_Frame - are free for use by the scroll bar implementation in any way it sees - fit. They are marked by the garbage collector. */ - - -/* Set the vertical scroll bar for WINDOW to have its upper left corner - at (TOP, LEFT), and be LENGTH rows high. Set its handle to - indicate that we are displaying PORTION characters out of a total - of WHOLE characters, starting at POSITION. If WINDOW doesn't yet - have a scroll bar, create one for it. */ -extern void (*set_vertical_scroll_bar_hook) - P_ ((struct window *window, - int portion, int whole, int position)); - - -/* The following three hooks are used when we're doing a thorough - redisplay of the frame. We don't explicitly know which scroll bars - are going to be deleted, because keeping track of when windows go - away is a real pain - can you say set-window-configuration? - Instead, we just assert at the beginning of redisplay that *all* - scroll bars are to be removed, and then save scroll bars from the - fiery pit when we actually redisplay their window. */ - -/* Arrange for all scroll bars on FRAME to be removed at the next call - to `*judge_scroll_bars_hook'. A scroll bar may be spared if - `*redeem_scroll_bar_hook' is applied to its window before the judgement. - - This should be applied to each frame each time its window tree is - redisplayed, even if it is not displaying scroll bars at the moment; - if the HAS_SCROLL_BARS flag has just been turned off, only calling - this and the judge_scroll_bars_hook will get rid of them. - - If non-zero, this hook should be safe to apply to any frame, - whether or not it can support scroll bars, and whether or not it is - currently displaying them. */ -extern void (*condemn_scroll_bars_hook) P_ ((struct frame *frame)); - -/* Unmark WINDOW's scroll bar for deletion in this judgement cycle. - Note that it's okay to redeem a scroll bar that is not condemned. */ -extern void (*redeem_scroll_bar_hook) P_ ((struct window *window)); - -/* Remove all scroll bars on FRAME that haven't been saved since the - last call to `*condemn_scroll_bars_hook'. - - This should be applied to each frame after each time its window - tree is redisplayed, even if it is not displaying scroll bars at the - moment; if the HAS_SCROLL_BARS flag has just been turned off, only - calling this and condemn_scroll_bars_hook will get rid of them. - - If non-zero, this hook should be safe to apply to any frame, - whether or not it can support scroll bars, and whether or not it is - currently displaying them. */ -extern void (*judge_scroll_bars_hook) P_ ((struct frame *FRAME)); - - /* Input queue declarations and hooks. */ /* Expedient hack: only provide the below definitions to files that @@ -258,6 +109,9 @@ enum event_kind the wheel event occurred in. .timestamp gives a timestamp (in milliseconds) for the event. */ + HORIZ_WHEEL_EVENT, /* A wheel event generated by a second + horizontal wheel that is present on some + mice. See WHEEL_EVENT. */ #if defined (WINDOWSNT) || defined (MAC_OS) LANGUAGE_CHANGE_EVENT, /* A LANGUAGE_CHANGE_EVENT is generated on WINDOWSNT or Mac OS @@ -331,7 +185,7 @@ enum event_kind /* Queued from XTread_socket when session manager sends save yourself before shutdown. */ - SAVE_SESSION_EVENT, + SAVE_SESSION_EVENT #ifdef MAC_OS /* Generated when an Apple event, a HICommand event, or a Services @@ -340,11 +194,11 @@ enum event_kind symbols, respectively. Member `arg' is a Lisp object converted from the received Apple event. Parameters for non-Apple events are converted to those in Apple events. */ - MAC_APPLE_EVENT, + , MAC_APPLE_EVENT #endif #ifdef HAVE_GPM - GPM_CLICK_EVENT + , GPM_CLICK_EVENT #endif }; @@ -394,13 +248,6 @@ struct input_event #define EVENT_INIT(event) bzero (&(event), sizeof (struct input_event)) -/* Called to read input events. */ -extern int (*read_socket_hook) P_ ((int, int, struct input_event *)); - -/* Called when a frame's display becomes entirely up to date. */ -extern void (*frame_up_to_date_hook) P_ ((struct frame *)); - - /* Bits in the modifiers member of the input_event structure. Note that reorder_modifiers assumes that the bits are in canonical order. @@ -452,14 +299,350 @@ enum { #ifdef HAVE_GPM #include <gpm.h> -extern int handle_one_term_event (Gpm_Event *, struct input_event *); +extern int handle_one_term_event (struct tty_display_info *, Gpm_Event *, struct input_event *); extern void term_mouse_moveto (int, int); -/* Nonzero means mouse is enabled on Linux console */ -extern int term_gpm; +/* The device for which we have enabled gpm support. */ +extern struct tty_display_info *gpm_tty; +#endif + +#endif /* CONSP */ + + +struct mac_display_info; +struct w32_display_info; + +/* Terminal-local parameters. */ +struct terminal +{ + /* The first two fields are really the header of a vector */ + /* The terminal code does not refer to them. */ + EMACS_UINT size; + struct Lisp_Vector *vec_next; + + /* Parameter alist of this terminal. */ + Lisp_Object param_alist; + + /* All fields before `next_terminal' should be Lisp_Object and are traced + by the GC. All fields afterwards are ignored by the GC. */ + + /* Chain of all terminal devices. */ + struct terminal *next_terminal; + + /* Unique id for this terminal device. */ + int id; + + /* The number of frames that are on this terminal. */ + int reference_count; + + /* The type of the terminal device. */ + enum output_method type; + + /* The name of the terminal device. Do not use this to uniquely + identify a terminal; the same device may be opened multiple + times. */ + char *name; + +#ifdef MULTI_KBOARD + /* The terminal's keyboard object. */ + struct kboard *kboard; +#endif + + /* Device-type dependent data shared amongst all frames on this terminal. */ + union display_info + { + struct tty_display_info *tty; /* termchar.h */ + struct x_display_info *x; /* xterm.h */ + struct w32_display_info *w32; /* w32term.h */ + struct mac_display_info *mac; /* macterm.h */ + } display_info; + + + /* Coding-system to be used for encoding terminal output. This + structure contains information of a coding-system specified by + the function `set-terminal-coding-system'. Also see + `safe_terminal_coding' in coding.h. */ + struct coding_system *terminal_coding; + + /* Coding-system of what is sent from terminal keyboard. This + structure contains information of a coding-system specified by + the function `set-keyboard-coding-system'. */ + struct coding_system *keyboard_coding; + + /* Terminal characteristics. */ + /* XXX Are these really used on non-termcap displays? */ + + int must_write_spaces; /* Nonzero means spaces in the text must + actually be output; can't just skip over + some columns to leave them blank. */ + int fast_clear_end_of_line; /* Nonzero means terminal has a `ce' string */ + + int line_ins_del_ok; /* Terminal can insert and delete lines */ + int char_ins_del_ok; /* Terminal can insert and delete chars */ + int scroll_region_ok; /* Terminal supports setting the scroll + window */ + int scroll_region_cost; /* Cost of setting the scroll window, + measured in characters. */ + int memory_below_frame; /* Terminal remembers lines scrolled + off bottom */ + +#if 0 /* These are not used anywhere. */ + /* EMACS_INT baud_rate; */ /* Output speed in baud */ + int min_padding_speed; /* Speed below which no padding necessary. */ + int dont_calculate_costs; /* Nonzero means don't bother computing + various cost tables; we won't use them. */ #endif + + /* Window-based redisplay interface for this device (0 for tty + devices). */ + struct redisplay_interface *rif; + + /* Frame-based redisplay interface. */ + + /* Text display hooks. */ + + void (*cursor_to_hook) P_ ((struct frame *f, int vpos, int hpos)); + void (*raw_cursor_to_hook) P_ ((struct frame *, int, int)); + + void (*clear_to_end_hook) P_ ((struct frame *)); + void (*clear_frame_hook) P_ ((struct frame *)); + void (*clear_end_of_line_hook) P_ ((struct frame *, int)); + + void (*ins_del_lines_hook) P_ ((struct frame *f, int, int)); + + void (*insert_glyphs_hook) P_ ((struct frame *f, struct glyph *s, int n)); + void (*write_glyphs_hook) P_ ((struct frame *f, struct glyph *s, int n)); + void (*delete_glyphs_hook) P_ ((struct frame *, int)); + + void (*ring_bell_hook) P_ ((struct frame *f)); + + void (*reset_terminal_modes_hook) P_ ((struct terminal *)); + void (*set_terminal_modes_hook) P_ ((struct terminal *)); + + void (*update_begin_hook) P_ ((struct frame *)); + void (*update_end_hook) P_ ((struct frame *)); + void (*set_terminal_window_hook) P_ ((struct frame *, int)); + + /* Multi-frame and mouse support hooks. */ + + /* Return the current position of the mouse. + + Set *f to the frame the mouse is in, or zero if the mouse is in no + Emacs frame. If it is set to zero, all the other arguments are + garbage. + + If the motion started in a scroll bar, set *bar_window to the + scroll bar's window, *part to the part the mouse is currently over, + *x to the position of the mouse along the scroll bar, and *y to the + overall length of the scroll bar. + + Otherwise, set *bar_window to Qnil, and *x and *y to the column and + row of the character cell the mouse is over. + + Set *time to the time the mouse was at the returned position. + + This should clear mouse_moved until the next motion + event arrives. */ + void (*mouse_position_hook) P_ ((struct frame **f, int, + Lisp_Object *bar_window, + enum scroll_bar_part *part, + Lisp_Object *x, + Lisp_Object *y, + unsigned long *time)); + + /* The window system handling code should set this if the mouse has + moved since the last call to the mouse_position_hook. Calling that + hook should clear this. */ + int mouse_moved; + + /* When a frame's focus redirection is changed, this hook tells the + window system code to re-decide where to put the highlight. Under + X, this means that Emacs lies about where the focus is. */ + void (*frame_rehighlight_hook) P_ ((struct frame *)); + + /* If we're displaying frames using a window system that can stack + frames on top of each other, this hook allows you to bring a frame + to the front, or bury it behind all the other windows. If this + hook is zero, that means the terminal we're displaying on doesn't + support overlapping frames, so there's no need to raise or lower + anything. + + If RAISE is non-zero, F is brought to the front, before all other + windows. If RAISE is zero, F is sent to the back, behind all other + windows. */ + void (*frame_raise_lower_hook) P_ ((struct frame *f, int raise)); + + /* If the value of the frame parameter changed, whis hook is called. + For example, if going from fullscreen to not fullscreen this hook + may do something OS dependent, like extended window manager hints on X11. */ + void (*fullscreen_hook) P_ ((struct frame *f)); + + + /* Scroll bar hooks. */ + + /* The representation of scroll bars is determined by the code which + implements them, except for one thing: they must be represented by + lisp objects. This allows us to place references to them in + Lisp_Windows without worrying about those references becoming + dangling references when the scroll bar is destroyed. + + The window-system-independent portion of Emacs just refers to + scroll bars via their windows, and never looks inside the scroll bar + representation; it always uses hook functions to do all the + scroll bar manipulation it needs. + + The `vertical_scroll_bar' field of a Lisp_Window refers to that + window's scroll bar, or is nil if the window doesn't have a + scroll bar. + + The `scroll_bars' and `condemned_scroll_bars' fields of a Lisp_Frame + are free for use by the scroll bar implementation in any way it sees + fit. They are marked by the garbage collector. */ + + + /* Set the vertical scroll bar for WINDOW to have its upper left corner + at (TOP, LEFT), and be LENGTH rows high. Set its handle to + indicate that we are displaying PORTION characters out of a total + of WHOLE characters, starting at POSITION. If WINDOW doesn't yet + have a scroll bar, create one for it. */ + void (*set_vertical_scroll_bar_hook) P_ ((struct window *window, + int portion, int whole, + int position)); + + + /* The following three hooks are used when we're doing a thorough + redisplay of the frame. We don't explicitly know which scroll bars + are going to be deleted, because keeping track of when windows go + away is a real pain - can you say set-window-configuration? + Instead, we just assert at the beginning of redisplay that *all* + scroll bars are to be removed, and then save scroll bars from the + fiery pit when we actually redisplay their window. */ + + /* Arrange for all scroll bars on FRAME to be removed at the next call + to `*judge_scroll_bars_hook'. A scroll bar may be spared if + `*redeem_scroll_bar_hook' is applied to its window before the judgement. + + This should be applied to each frame each time its window tree is + redisplayed, even if it is not displaying scroll bars at the moment; + if the HAS_SCROLL_BARS flag has just been turned off, only calling + this and the judge_scroll_bars_hook will get rid of them. + + If non-zero, this hook should be safe to apply to any frame, + whether or not it can support scroll bars, and whether or not it is + currently displaying them. */ + void (*condemn_scroll_bars_hook) P_ ((struct frame *frame)); + + /* Unmark WINDOW's scroll bar for deletion in this judgement cycle. + Note that it's okay to redeem a scroll bar that is not condemned. */ + void (*redeem_scroll_bar_hook) P_ ((struct window *window)); + + /* Remove all scroll bars on FRAME that haven't been saved since the + last call to `*condemn_scroll_bars_hook'. + + This should be applied to each frame after each time its window + tree is redisplayed, even if it is not displaying scroll bars at the + moment; if the HAS_SCROLL_BARS flag has just been turned off, only + calling this and condemn_scroll_bars_hook will get rid of them. + + If non-zero, this hook should be safe to apply to any frame, + whether or not it can support scroll bars, and whether or not it is + currently displaying them. */ + void (*judge_scroll_bars_hook) P_ ((struct frame *FRAME)); + + + /* Called to read input events. + + TERMINAL indicates which terminal device to read from. Input + events should be read into BUF, the size of which is given in + SIZE. EXPECTED is non-zero if the caller suspects that new input + is available. + + A positive return value indicates that that many input events + where read into BUF. + Zero means no events were immediately available. + A value of -1 means a transient read error, while -2 indicates + that the device was closed (hangup), and it should be deleted. + + XXX Please note that a non-zero value of EXPECTED only means that + there is available input on at least one of the currently opened + terminal devices -- but not necessarily on this device. + Therefore, in most cases EXPECTED should be simply ignored. + + XXX This documentation needs to be updated. */ + int (*read_socket_hook) P_ ((struct terminal *terminal, + int expected, + struct input_event *hold_quit)); + + /* Called when a frame's display becomes entirely up to date. */ + void (*frame_up_to_date_hook) P_ ((struct frame *)); + + + /* Called to delete the device-specific portions of a frame that is + on this terminal device. */ + void (*delete_frame_hook) P_ ((struct frame *)); + + /* Called after the last frame on this terminal is deleted, or when + the display device was closed (hangup). + + If this is NULL, then the generic delete_terminal is called + instead. Otherwise the hook must call delete_terminal itself. + + The hook must check for and close any live frames that are still + on the terminal. Fdelete_frame ensures that there are no live + frames on the terminal when it calls this hook, so infinite + recursion is prevented. */ + void (*delete_terminal_hook) P_ ((struct terminal *)); +}; + + +/* Chain of all terminal devices currently in use. */ +extern struct terminal *terminal_list; + +#define FRAME_MUST_WRITE_SPACES(f) ((f)->terminal->must_write_spaces) +#define FRAME_FAST_CLEAR_END_OF_LINE(f) ((f)->terminal->fast_clear_end_of_line) +#define FRAME_LINE_INS_DEL_OK(f) ((f)->terminal->line_ins_del_ok) +#define FRAME_CHAR_INS_DEL_OK(f) ((f)->terminal->char_ins_del_ok) +#define FRAME_SCROLL_REGION_OK(f) ((f)->terminal->scroll_region_ok) +#define FRAME_SCROLL_REGION_COST(f) ((f)->terminal->scroll_region_cost) +#define FRAME_MEMORY_BELOW_FRAME(f) ((f)->terminal->memory_below_frame) + +#define FRAME_TERMINAL_CODING(f) ((f)->terminal->terminal_coding) +#define FRAME_KEYBOARD_CODING(f) ((f)->terminal->keyboard_coding) + +#define TERMINAL_TERMINAL_CODING(d) ((d)->terminal_coding) +#define TERMINAL_KEYBOARD_CODING(d) ((d)->keyboard_coding) + +#define FRAME_RIF(f) ((f)->terminal->rif) + +#define FRAME_TERMINAL(f) ((f)->terminal) + +/* FRAME_WINDOW_P tests whether the frame is a window, and is + defined to be the predicate for the window system being used. */ + +#ifdef HAVE_X_WINDOWS +#define FRAME_WINDOW_P(f) FRAME_X_P (f) #endif +#ifdef HAVE_NTGUI +#define FRAME_WINDOW_P(f) FRAME_W32_P (f) +#endif +#ifdef MAC_OS +#define FRAME_WINDOW_P(f) FRAME_MAC_P (f) +#endif +#ifndef FRAME_WINDOW_P +#define FRAME_WINDOW_P(f) (0) +#endif + +/* Return true if the terminal device is not suspended. */ +#define TERMINAL_ACTIVE_P(d) ((d)->type != output_termcap || (d)->display_info.tty->input) + +extern Lisp_Object get_terminal_param P_ ((struct terminal *, Lisp_Object)); +extern struct terminal *get_terminal P_ ((Lisp_Object terminal, int)); +extern struct terminal *create_terminal P_ ((void)); +extern void delete_terminal P_ ((struct terminal *)); + +/* The initial terminal device, created by initial_term_init. */ +extern struct terminal *initial_terminal; /* arch-tag: 33a00ecc-52b5-4186-a410-8801ac9f087d (do not change this comment) */ diff --git a/src/terminal.c b/src/terminal.c new file mode 100644 index 00000000000..46ffb3c2dc8 --- /dev/null +++ b/src/terminal.c @@ -0,0 +1,566 @@ +/* Functions related to terminal devices. + Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. + +This file is part of GNU Emacs. + +GNU Emacs is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3, or (at your option) +any later version. + +GNU Emacs is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Emacs; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#include <config.h> +#include <stdio.h> + +#include "lisp.h" +#include "frame.h" +#include "termchar.h" +#include "termhooks.h" +#include "charset.h" +#include "coding.h" +#include "keyboard.h" + +/* Chain of all terminals currently in use. */ +struct terminal *terminal_list; + +/* The first unallocated terminal id. */ +static int next_terminal_id; + +/* The initial terminal device, created by initial_term_init. */ +struct terminal *initial_terminal; + +/* Function to use to ring the bell. */ +Lisp_Object Vring_bell_function; + +static void delete_initial_terminal P_ ((struct terminal *)); + + + +void +ring_bell (struct frame *f) +{ + if (!NILP (Vring_bell_function)) + { + Lisp_Object function; + + /* Temporarily set the global variable to nil + so that if we get an error, it stays nil + and we don't call it over and over. + + We don't specbind it, because that would carefully + restore the bad value if there's an error + and make the loop of errors happen anyway. */ + + function = Vring_bell_function; + Vring_bell_function = Qnil; + + call0 (function); + + Vring_bell_function = function; + } + else if (FRAME_TERMINAL (f)->ring_bell_hook) + (*FRAME_TERMINAL (f)->ring_bell_hook) (f); +} + +void +update_begin (struct frame *f) +{ + if (FRAME_TERMINAL (f)->update_begin_hook) + (*FRAME_TERMINAL (f)->update_begin_hook) (f); +} + +void +update_end (struct frame *f) +{ + if (FRAME_TERMINAL (f)->update_end_hook) + (*FRAME_TERMINAL (f)->update_end_hook) (f); +} + +/* Specify how many text lines, from the top of the window, + should be affected by insert-lines and delete-lines operations. + This, and those operations, are used only within an update + that is bounded by calls to update_begin and update_end. */ + +void +set_terminal_window (struct frame *f, int size) +{ + if (FRAME_TERMINAL (f)->set_terminal_window_hook) + (*FRAME_TERMINAL (f)->set_terminal_window_hook) (f, size); +} + +/* Move cursor to row/column position VPOS/HPOS. HPOS/VPOS are + frame-relative coordinates. */ + +void +cursor_to (struct frame *f, int vpos, int hpos) +{ + if (FRAME_TERMINAL (f)->cursor_to_hook) + (*FRAME_TERMINAL (f)->cursor_to_hook) (f, vpos, hpos); +} + +/* Similar but don't take any account of the wasted characters. */ + +void +raw_cursor_to (struct frame *f, int row, int col) +{ + if (FRAME_TERMINAL (f)->raw_cursor_to_hook) + (*FRAME_TERMINAL (f)->raw_cursor_to_hook) (f, row, col); +} + +/* Erase operations */ + +/* Clear from cursor to end of frame. */ +void +clear_to_end (struct frame *f) +{ + if (FRAME_TERMINAL (f)->clear_to_end_hook) + (*FRAME_TERMINAL (f)->clear_to_end_hook) (f); +} + +/* Clear entire frame */ + +void +clear_frame (struct frame *f) +{ + if (FRAME_TERMINAL (f)->clear_frame_hook) + (*FRAME_TERMINAL (f)->clear_frame_hook) (f); +} + +/* Clear from cursor to end of line. + Assume that the line is already clear starting at column first_unused_hpos. + + Note that the cursor may be moved, on terminals lacking a `ce' string. */ + +void +clear_end_of_line (struct frame *f, int first_unused_hpos) +{ + if (FRAME_TERMINAL (f)->clear_end_of_line_hook) + (*FRAME_TERMINAL (f)->clear_end_of_line_hook) (f, first_unused_hpos); +} + +/* Output LEN glyphs starting at STRING at the nominal cursor position. + Advance the nominal cursor over the text. */ + +void +write_glyphs (struct frame *f, struct glyph *string, int len) +{ + if (FRAME_TERMINAL (f)->write_glyphs_hook) + (*FRAME_TERMINAL (f)->write_glyphs_hook) (f, string, len); +} + +/* Insert LEN glyphs from START at the nominal cursor position. + + If start is zero, insert blanks instead of a string at start */ + +void +insert_glyphs (struct frame *f, struct glyph *start, int len) +{ + if (len <= 0) + return; + + if (FRAME_TERMINAL (f)->insert_glyphs_hook) + (*FRAME_TERMINAL (f)->insert_glyphs_hook) (f, start, len); +} + +/* Delete N glyphs at the nominal cursor position. */ + +void +delete_glyphs (struct frame *f, int n) +{ + if (FRAME_TERMINAL (f)->delete_glyphs_hook) + (*FRAME_TERMINAL (f)->delete_glyphs_hook) (f, n); +} + +/* Insert N lines at vpos VPOS. If N is negative, delete -N lines. */ + +void +ins_del_lines (struct frame *f, int vpos, int n) +{ + if (FRAME_TERMINAL (f)->ins_del_lines_hook) + (*FRAME_TERMINAL (f)->ins_del_lines_hook) (f, vpos, n); +} + + + + +/* Return the terminal object specified by TERMINAL. TERMINAL may be a + terminal id, a frame, or nil for the terminal device of the current + frame. If THROW is zero, return NULL for failure, otherwise throw + an error. */ + +struct terminal * +get_terminal (Lisp_Object terminal, int throw) +{ + struct terminal *result = NULL; + + if (NILP (terminal)) + terminal = selected_frame; + + if (TERMINALP (terminal)) + result = XTERMINAL (terminal); + + else if (FRAMEP (terminal)) + { + result = FRAME_TERMINAL (XFRAME (terminal)); + } + + if (result && !result->name) + result = NULL; + + if (result == NULL && throw) + wrong_type_argument (Qterminal_live_p, terminal); + + return result; +} + + + +/* Create a new terminal object and add it to the terminal list. */ + +struct terminal * +create_terminal (void) +{ + struct terminal *terminal = allocate_terminal (); + + terminal->name = NULL; + terminal->next_terminal = terminal_list; + terminal_list = terminal; + + terminal->id = next_terminal_id++; + + terminal->keyboard_coding = + (struct coding_system *) xmalloc (sizeof (struct coding_system)); + terminal->terminal_coding = + (struct coding_system *) xmalloc (sizeof (struct coding_system)); + + setup_coding_system (Qnil, terminal->keyboard_coding); + setup_coding_system (Qnil, terminal->terminal_coding); + + terminal->param_alist = Qnil; + return terminal; +} + +/* Low-level function to close all frames on a terminal, remove it + from the terminal list and free its memory. */ + +void +delete_terminal (struct terminal *terminal) +{ + struct terminal **tp; + Lisp_Object tail, frame; + + /* Protect against recursive calls. Fdelete_frame calls the + delete_terminal_hook when we delete our last frame. */ + if (!terminal->name) + return; + xfree (terminal->name); + terminal->name = NULL; + + /* Check for live frames that are still on this terminal. */ + FOR_EACH_FRAME (tail, frame) + { + struct frame *f = XFRAME (frame); + if (FRAME_LIVE_P (f) && f->terminal == terminal) + { + Fdelete_frame (frame, Qt); + } + } + + for (tp = &terminal_list; *tp != terminal; tp = &(*tp)->next_terminal) + if (! *tp) + abort (); + *tp = terminal->next_terminal; + + xfree (terminal->keyboard_coding); + terminal->keyboard_coding = NULL; + xfree (terminal->terminal_coding); + terminal->terminal_coding = NULL; + +#ifdef MULTI_KBOARD + if (terminal->kboard && --terminal->kboard->reference_count == 0) + { + delete_kboard (terminal->kboard); + terminal->kboard = NULL; + } +#endif +} + +DEFUN ("delete-terminal", Fdelete_terminal, Sdelete_terminal, 0, 2, 0, + doc: /* Delete TERMINAL by deleting all frames on it and closing the terminal. +TERMINAL may be a terminal id, a frame, or nil (meaning the selected +frame's terminal). + +Normally, you may not delete a display if all other displays are suspended, +but if the second argument FORCE is non-nil, you may do so. */) + (terminal, force) + Lisp_Object terminal, force; +{ + struct terminal *t, *p; + + t = get_terminal (terminal, 0); + + if (!t) + return Qnil; + + p = terminal_list; + while (p && (p == t || !TERMINAL_ACTIVE_P (p))) + p = p->next_terminal; + + if (NILP (force) && !p) + error ("Attempt to delete the sole active display terminal"); + + if (t->delete_terminal_hook) + (*t->delete_terminal_hook) (t); + else + delete_terminal (t); + + return Qnil; +} + + +DEFUN ("frame-terminal", Fframe_terminal, Sframe_terminal, 0, 1, 0, + doc: /* Return the terminal that FRAME is displayed on. +If FRAME is nil, the selected frame is used. + +The terminal device is represented by its integer identifier. */) + (frame) + Lisp_Object frame; +{ + struct terminal *t; + + if (NILP (frame)) + frame = selected_frame; + + CHECK_LIVE_FRAME (frame); + + t = FRAME_TERMINAL (XFRAME (frame)); + + if (!t) + return Qnil; + else + { + Lisp_Object terminal; + XSETTERMINAL (terminal, t); + return terminal; + } +} + +DEFUN ("terminal-live-p", Fterminal_live_p, Sterminal_live_p, 1, 1, 0, + doc: /* Return non-nil if OBJECT is a terminal which has not been deleted. +Value is nil if OBJECT is not a live display terminal. +If object is a live display terminal, the return value indicates what +sort of output terminal it uses. See the documentation of `framep' for +possible return values. */) + (object) + Lisp_Object object; +{ + struct terminal *t; + + t = get_terminal (object, 0); + + if (!t) + return Qnil; + + switch (t->type) + { + case output_initial: /* The initial frame is like a termcap frame. */ + case output_termcap: + return Qt; + case output_x_window: + return Qx; + case output_w32: + return Qw32; + case output_msdos_raw: + return Qpc; + case output_mac: + return Qmac; + default: + abort (); + } +} + +DEFUN ("terminal-list", Fterminal_list, Sterminal_list, 0, 0, 0, + doc: /* Return a list of all terminal devices. */) + () +{ + Lisp_Object terminal, terminals = Qnil; + struct terminal *t; + + for (t = terminal_list; t; t = t->next_terminal) + { + XSETTERMINAL (terminal, t); + terminals = Fcons (terminal, terminals); + } + + return terminals; +} + +DEFUN ("terminal-name", Fterminal_name, Sterminal_name, 0, 1, 0, + doc: /* Return the name of the terminal device TERMINAL. +It is not guaranteed that the returned value is unique among opened devices. + +TERMINAL may be a terminal id, a frame, or nil (meaning the +selected frame's terminal). */) + (terminal) + Lisp_Object terminal; +{ + struct terminal *t + = TERMINALP (terminal) ? XTERMINAL (terminal) : get_terminal (terminal, 1); + + return t->name ? build_string (t->name) : Qnil; +} + + + +/* Return the value of terminal parameter PARAM in terminal T. */ +Lisp_Object +get_terminal_param (t, param) + struct terminal *t; + Lisp_Object param; +{ + Lisp_Object tem = Fassq (param, t->param_alist); + if (EQ (tem, Qnil)) + return tem; + return Fcdr (tem); +} + +/* Set the value of terminal parameter PARAMETER in terminal D to VALUE. + Return the previous value. */ + +Lisp_Object +store_terminal_param (t, parameter, value) + struct terminal *t; + Lisp_Object parameter; + Lisp_Object value; +{ + Lisp_Object old_alist_elt = Fassq (parameter, t->param_alist); + if (EQ (old_alist_elt, Qnil)) + { + t->param_alist = Fcons (Fcons (parameter, value), t->param_alist); + return Qnil; + } + else + { + Lisp_Object result = Fcdr (old_alist_elt); + Fsetcdr (old_alist_elt, value); + return result; + } +} + + +DEFUN ("terminal-parameters", Fterminal_parameters, Sterminal_parameters, 0, 1, 0, + doc: /* Return the parameter-alist of terminal TERMINAL. +The value is a list of elements of the form (PARM . VALUE), where PARM +is a symbol. + +TERMINAL can be a terminal id, a frame or nil (meaning the selected +frame's terminal). */) + (terminal) + Lisp_Object terminal; +{ + struct terminal *t + = TERMINALP (terminal) ? XTERMINAL (terminal) : get_terminal (terminal, 1); + return Fcopy_alist (t->param_alist); +} + +DEFUN ("terminal-parameter", Fterminal_parameter, Sterminal_parameter, 2, 2, 0, + doc: /* Return TERMINAL's value for parameter PARAMETER. +TERMINAL can be a terminal id, a frame or nil (meaning the selected +frame's terminal). */) + (terminal, parameter) + Lisp_Object terminal; + Lisp_Object parameter; +{ + Lisp_Object value; + struct terminal *t + = TERMINALP (terminal) ? XTERMINAL (terminal) : get_terminal (terminal, 1); + CHECK_SYMBOL (parameter); + value = Fcdr (Fassq (parameter, t->param_alist)); + return value; +} + +DEFUN ("set-terminal-parameter", Fset_terminal_parameter, + Sset_terminal_parameter, 3, 3, 0, + doc: /* Set TERMINAL's value for parameter PARAMETER to VALUE. +Return the previous value of PARAMETER. + +TERMINAL can be a terminal id, a frame or nil (meaning the selected +frame's terminal). */) + (terminal, parameter, value) + Lisp_Object terminal; + Lisp_Object parameter; + Lisp_Object value; +{ + struct terminal *t + = TERMINALP (terminal) ? XTERMINAL (terminal) : get_terminal (terminal, 1); + return store_terminal_param (t, parameter, value); +} + + + +/* Create the bootstrap display terminal for the initial frame. + Returns a terminal of type output_initial. */ + +struct terminal * +init_initial_terminal (void) +{ + if (initialized || terminal_list || tty_list) + abort (); + + initial_terminal = create_terminal (); + initial_terminal->type = output_initial; + initial_terminal->name = xstrdup ("initial_terminal"); +#ifdef MULTI_KBOARD + initial_terminal->kboard = initial_kboard; +#endif + initial_terminal->delete_terminal_hook = &delete_initial_terminal; + /* All other hooks are NULL. */ + + return initial_terminal; +} + +/* Deletes the bootstrap terminal device. + Called through delete_terminal_hook. */ + +static void +delete_initial_terminal (struct terminal *terminal) +{ + if (terminal != initial_terminal) + abort (); + + delete_terminal (terminal); + initial_terminal = NULL; +} + +void +syms_of_terminal () +{ + + DEFVAR_LISP ("ring-bell-function", &Vring_bell_function, + doc: /* Non-nil means call this function to ring the bell. +The function should accept no arguments. */); + Vring_bell_function = Qnil; + + defsubr (&Sdelete_terminal); + defsubr (&Sframe_terminal); + defsubr (&Sterminal_live_p); + defsubr (&Sterminal_list); + defsubr (&Sterminal_name); + defsubr (&Sterminal_parameters); + defsubr (&Sterminal_parameter); + defsubr (&Sset_terminal_parameter); + + Fprovide (intern ("multi-tty"), Qnil); +} + +/* arch-tag: e9af6f27-b483-47dc-bb1a-730c1c5cab03 + (do not change this comment) */ diff --git a/src/termopts.h b/src/termopts.h index 210236017d5..5946666654c 100644 --- a/src/termopts.h +++ b/src/termopts.h @@ -41,5 +41,10 @@ extern int meta_key; /* Nonzero means truncate lines in all windows less wide than the frame */ extern int truncate_partial_width_windows; +/* Nonzero means no need to redraw the entire frame on resuming a suspended + Emacs. This is useful on terminals with multiple pages, where one page is + used for Emacs and another for all else. */ +extern int no_redraw_on_reenter; + /* arch-tag: 35d4d284-dc1a-4fff-97fa-0154a21aebdb (do not change this comment) */ diff --git a/src/w32.c b/src/w32.c index d7e95aac7d1..500e85733b2 100644 --- a/src/w32.c +++ b/src/w32.c @@ -904,18 +904,6 @@ alarm (int seconds) return 0; } -void -unrequest_sigio (void) -{ - return; -} - -void -request_sigio (void) -{ - return; -} - #define REG_ROOT "SOFTWARE\\GNU\\Emacs" LPBYTE @@ -939,6 +927,7 @@ w32_get_resource (key, lpdwtype) && (lpvalue = (LPBYTE) xmalloc (cbData)) != NULL && RegQueryValueEx (hrootkey, key, NULL, lpdwtype, lpvalue, &cbData) == ERROR_SUCCESS) { + RegCloseKey (hrootkey); return (lpvalue); } @@ -955,6 +944,7 @@ w32_get_resource (key, lpdwtype) && (lpvalue = (LPBYTE) xmalloc (cbData)) != NULL && RegQueryValueEx (hrootkey, key, NULL, lpdwtype, lpvalue, &cbData) == ERROR_SUCCESS) { + RegCloseKey (hrootkey); return (lpvalue); } diff --git a/src/w32console.c b/src/w32console.c index f828808caf1..72411d7d4be 100644 --- a/src/w32console.c +++ b/src/w32console.c @@ -35,11 +35,12 @@ Boston, MA 02110-1301, USA. #include "character.h" #include "coding.h" #include "disptab.h" -#include "termhooks.h" -#include "dispextern.h" /* Disable features in frame.h that require a Window System. */ #undef HAVE_WINDOW_SYSTEM #include "frame.h" +#include "termhooks.h" +#include "termchar.h" +#include "dispextern.h" #include "w32inevt.h" /* from window.c */ @@ -51,21 +52,17 @@ extern int detect_input_pending (); /* from sysdep.c */ extern int read_input_pending (); -extern struct frame * updating_frame; -extern int meta_key; - -static void w32con_move_cursor (int row, int col); -static void w32con_clear_to_end (void); -static void w32con_clear_frame (void); -static void w32con_clear_end_of_line (int); -static void w32con_ins_del_lines (int vpos, int n); -static void w32con_insert_glyphs (struct glyph *start, int len); -static void w32con_write_glyphs (struct glyph *string, int len); -static void w32con_delete_glyphs (int n); -void w32_sys_ring_bell (void); -static void w32con_reset_terminal_modes (void); -static void w32con_set_terminal_modes (void); -static void w32con_set_terminal_window (int size); +static void w32con_move_cursor (struct frame *f, int row, int col); +static void w32con_clear_to_end (struct frame *f); +static void w32con_clear_frame (struct frame *f); +static void w32con_clear_end_of_line (struct frame *f, int); +static void w32con_ins_del_lines (struct frame *f, int vpos, int n); +static void w32con_insert_glyphs (struct frame *f, struct glyph *start, int len); +static void w32con_write_glyphs (struct frame *f, struct glyph *string, int len); +static void w32con_delete_glyphs (struct frame *f, int n); +static void w32con_reset_terminal_modes (struct terminal *t); +static void w32con_set_terminal_modes (struct terminal *t); +static void w32con_set_terminal_window (struct frame *f, int size); static void w32con_update_begin (struct frame * f); static void w32con_update_end (struct frame * f); static WORD w32_face_attributes (struct frame *f, int face_id); @@ -99,38 +96,31 @@ ctrl_c_handler (unsigned long type) && (type == CTRL_C_EVENT || type == CTRL_BREAK_EVENT)); } -/* If we're updating a frame, use it as the current frame - Otherwise, use the selected frame. */ -#define PICK_FRAME() (updating_frame ? updating_frame : SELECTED_FRAME ()) -/* Move the cursor to (row, col). */ +/* Move the cursor to (ROW, COL) on FRAME. */ static void -w32con_move_cursor (int row, int col) +w32con_move_cursor (struct frame *f, int row, int col) { cursor_coords.X = col; cursor_coords.Y = row; - if (updating_frame == (struct frame *) NULL) - { - SetConsoleCursorPosition (cur_screen, cursor_coords); - } + /* TODO: for multi-tty support, cur_screen should be replaced with a + reference to the terminal for this frame. */ + SetConsoleCursorPosition (cur_screen, cursor_coords); } /* Clear from cursor to end of screen. */ static void -w32con_clear_to_end (void) +w32con_clear_to_end (struct frame *f) { - struct frame * f = PICK_FRAME (); - - w32con_clear_end_of_line (FRAME_COLS (f) - 1); - w32con_ins_del_lines (cursor_coords.Y, FRAME_LINES (f) - cursor_coords.Y - 1); + w32con_clear_end_of_line (f, FRAME_COLS (f) - 1); + w32con_ins_del_lines (f, cursor_coords.Y, FRAME_LINES (f) - cursor_coords.Y - 1); } /* Clear the frame. */ static void -w32con_clear_frame (void) +w32con_clear_frame (struct frame *f) { - struct frame * f = PICK_FRAME (); COORD dest; int n; DWORD r; @@ -145,7 +135,7 @@ w32con_clear_frame (void) FillConsoleOutputAttribute (cur_screen, char_attr_normal, n, dest, &r); FillConsoleOutputCharacter (cur_screen, ' ', n, dest, &r); - w32con_move_cursor (0, 0); + w32con_move_cursor (f, 0, 0); } @@ -154,7 +144,7 @@ static BOOL ceol_initialized = FALSE; /* Clear from Cursor to end (what's "standout marker"?). */ static void -w32con_clear_end_of_line (int end) +w32con_clear_end_of_line (struct frame *f, int end) { if (!ceol_initialized) { @@ -165,18 +155,17 @@ w32con_clear_end_of_line (int end) } ceol_initialized = TRUE; } - w32con_write_glyphs (glyph_base, end - cursor_coords.X); /* fencepost ? */ + w32con_write_glyphs (f, glyph_base, end - cursor_coords.X); /* fencepost ? */ } /* Insert n lines at vpos. if n is negative delete -n lines. */ static void -w32con_ins_del_lines (int vpos, int n) +w32con_ins_del_lines (struct frame *f, int vpos, int n) { int i, nb; SMALL_RECT scroll; COORD dest; CHAR_INFO fill; - struct frame * f = PICK_FRAME (); if (n < 0) { @@ -213,8 +202,8 @@ w32con_ins_del_lines (int vpos, int n) { for (i = scroll.Bottom; i < dest.Y; i++) { - w32con_move_cursor (i, 0); - w32con_clear_end_of_line (FRAME_COLS (f)); + w32con_move_cursor (f, i, 0); + w32con_clear_end_of_line (f, FRAME_COLS (f)); } } } @@ -226,8 +215,8 @@ w32con_ins_del_lines (int vpos, int n) { for (i = nb; i < scroll.Top; i++) { - w32con_move_cursor (i, 0); - w32con_clear_end_of_line (FRAME_COLS (f)); + w32con_move_cursor (f, i, 0); + w32con_clear_end_of_line (f, FRAME_COLS (f)); } } } @@ -242,14 +231,13 @@ w32con_ins_del_lines (int vpos, int n) #define RIGHT 0 static void -scroll_line (int dist, int direction) +scroll_line (struct frame *f, int dist, int direction) { /* The idea here is to implement a horizontal scroll in one line to implement delete and half of insert. */ SMALL_RECT scroll; COORD dest; CHAR_INFO fill; - struct frame * f = PICK_FRAME (); scroll.Top = cursor_coords.Y; scroll.Bottom = cursor_coords.Y; @@ -277,9 +265,9 @@ scroll_line (int dist, int direction) /* If start is zero insert blanks instead of a string at start ?. */ static void -w32con_insert_glyphs (register struct glyph *start, register int len) +w32con_insert_glyphs (struct frame *f, register struct glyph *start, register int len) { - scroll_line (len, RIGHT); + scroll_line (f, len, RIGHT); /* Move len chars to the right starting at cursor_coords, fill with blanks */ if (start) @@ -287,11 +275,11 @@ w32con_insert_glyphs (register struct glyph *start, register int len) /* Print the first len characters of start, cursor_coords.X adjusted by write_glyphs. */ - w32con_write_glyphs (start, len); + w32con_write_glyphs (f, start, len); } else { - w32con_clear_end_of_line (cursor_coords.X + len); + w32con_clear_end_of_line (f, cursor_coords.X + len); } } @@ -299,11 +287,11 @@ extern unsigned char *encode_terminal_code P_ ((struct glyph *, int, struct coding_system *)); static void -w32con_write_glyphs (register struct glyph *string, register int len) +w32con_write_glyphs (struct frame *f, register struct glyph *string, + register int len) { int produced, consumed; DWORD r; - struct frame * f = PICK_FRAME (); WORD char_attr; unsigned char *conversion_buffer; struct coding_system *coding; @@ -314,11 +302,11 @@ w32con_write_glyphs (register struct glyph *string, register int len) /* If terminal_coding does any conversion, use it, otherwise use safe_terminal_coding. We can't use CODING_REQUIRE_ENCODING here because it always return 1 if the member src_multibyte is 1. */ - coding = (terminal_coding.common_flags & CODING_REQUIRE_ENCODING_MASK - ? &terminal_coding : &safe_terminal_coding); + coding = (FRAME_TERMINAL_CODING (f)->common_flags & CODING_REQUIRE_ENCODING_MASK + ? FRAME_TERMINAL_CODING (f) : &safe_terminal_coding); /* The mode bit CODING_MODE_LAST_BLOCK should be set to 1 only at the tail. */ - terminal_coding.mode &= ~CODING_MODE_LAST_BLOCK; + coding->mode &= ~CODING_MODE_LAST_BLOCK; while (len > 0) { @@ -360,7 +348,7 @@ w32con_write_glyphs (register struct glyph *string, register int len) } cursor_coords.X += coding->produced; - w32con_move_cursor (cursor_coords.Y, cursor_coords.X); + w32con_move_cursor (f, cursor_coords.Y, cursor_coords.X); } len -= n; string += n; @@ -369,20 +357,20 @@ w32con_write_glyphs (register struct glyph *string, register int len) static void -w32con_delete_glyphs (int n) +w32con_delete_glyphs (struct frame *f, int n) { /* delete chars means scroll chars from cursor_coords.X + n to cursor_coords.X, anything beyond the edge of the screen should come out empty... */ - scroll_line (n, LEFT); + scroll_line (f, n, LEFT); } static unsigned int sound_type = 0xFFFFFFFF; #define MB_EMACS_SILENT (0xFFFFFFFF - 1) void -w32_sys_ring_bell (void) +w32_sys_ring_bell (struct frame *f) { if (sound_type == 0xFFFFFFFF) { @@ -428,7 +416,7 @@ SOUND is nil to use the normal beep. */) } static void -w32con_reset_terminal_modes (void) +w32con_reset_terminal_modes (struct terminal *t) { #ifdef USE_SEPARATE_SCREEN SetConsoleActiveScreenBuffer (prev_screen); @@ -439,7 +427,7 @@ w32con_reset_terminal_modes (void) } static void -w32con_set_terminal_modes (void) +w32con_set_terminal_modes (struct terminal *t) { CONSOLE_CURSOR_INFO cci; @@ -473,7 +461,7 @@ w32con_update_end (struct frame * f) } static void -w32con_set_terminal_window (int size) +w32con_set_terminal_window (struct frame *f, int size) { } @@ -547,28 +535,38 @@ vga_stdcolor_name (int idx) typedef int (*term_hook) (); void -initialize_w32_display (void) +initialize_w32_display (struct terminal *term) { CONSOLE_SCREEN_BUFFER_INFO info; - cursor_to_hook = w32con_move_cursor; - raw_cursor_to_hook = w32con_move_cursor; - clear_to_end_hook = w32con_clear_to_end; - clear_frame_hook = w32con_clear_frame; - clear_end_of_line_hook = w32con_clear_end_of_line; - ins_del_lines_hook = w32con_ins_del_lines; - insert_glyphs_hook = w32con_insert_glyphs; - write_glyphs_hook = w32con_write_glyphs; - delete_glyphs_hook = w32con_delete_glyphs; - ring_bell_hook = w32_sys_ring_bell; - reset_terminal_modes_hook = w32con_reset_terminal_modes; - set_terminal_modes_hook = w32con_set_terminal_modes; - set_terminal_window_hook = w32con_set_terminal_window; - update_begin_hook = w32con_update_begin; - update_end_hook = w32con_update_end; - - read_socket_hook = w32_console_read_socket; - mouse_position_hook = w32_console_mouse_position; + term->rif = 0; /* No window based redisplay on the console. */ + term->cursor_to_hook = w32con_move_cursor; + term->raw_cursor_to_hook = w32con_move_cursor; + term->clear_to_end_hook = w32con_clear_to_end; + term->clear_frame_hook = w32con_clear_frame; + term->clear_end_of_line_hook = w32con_clear_end_of_line; + term->ins_del_lines_hook = w32con_ins_del_lines; + term->insert_glyphs_hook = w32con_insert_glyphs; + term->write_glyphs_hook = w32con_write_glyphs; + term->delete_glyphs_hook = w32con_delete_glyphs; + term->ring_bell_hook = w32_sys_ring_bell; + term->reset_terminal_modes_hook = w32con_reset_terminal_modes; + term->set_terminal_modes_hook = w32con_set_terminal_modes; + term->set_terminal_window_hook = w32con_set_terminal_window; + term->update_begin_hook = w32con_update_begin; + term->update_end_hook = w32con_update_end; + + term->read_socket_hook = w32_console_read_socket; + term->mouse_position_hook = w32_console_mouse_position; + + /* The following are not used on the console. */ + term->frame_rehighlight_hook = 0; + term->frame_raise_lower_hook = 0; + term->set_vertical_scroll_bar_hook = 0; + term->condemn_scroll_bars_hook = 0; + term->redeem_scroll_bar_hook = 0; + term->judge_scroll_bars_hook = 0; + term->frame_up_to_date_hook = 0; /* Initialize interrupt_handle. */ init_crit (); @@ -633,7 +631,6 @@ initialize_w32_display (void) GetConsoleScreenBufferInfo (cur_screen, &info); - meta_key = 1; char_attr_normal = info.wAttributes; /* Determine if the info returned by GetConsoleScreenBufferInfo @@ -674,6 +671,7 @@ initialize_w32_display (void) } + DEFUN ("set-screen-color", Fset_screen_color, Sset_screen_color, 2, 2, 0, doc: /* Set screen colors. */) (foreground, background) diff --git a/src/w32fns.c b/src/w32fns.c index 6c2beae7d92..1fbde99f306 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -49,6 +49,7 @@ Boston, MA 02110-1301, USA. */ #include "bitmaps/gray.xbm" +#include <commctrl.h> #include <commdlg.h> #include <shellapi.h> #include <ctype.h> @@ -1823,10 +1824,8 @@ x_set_tool_bar_lines (f, value, oldval) below the menu bar. */ if (FRAME_W32_WINDOW (f) && FRAME_TOOL_BAR_LINES (f) == 0) { - updating_frame = f; - clear_frame (); + clear_frame (f); clear_current_matrices (f); - updating_frame = NULL; } /* If the tool bar gets smaller, the internal border below it @@ -3389,16 +3388,20 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) return 0; case WM_MOUSEWHEEL: + case WM_DROPFILES: wmsg.dwModifiers = w32_get_modifiers (); my_post_msg (&wmsg, hwnd, msg, wParam, lParam); signal_user_input (); return 0; - case WM_DROPFILES: + case WM_MOUSEHWHEEL: wmsg.dwModifiers = w32_get_modifiers (); my_post_msg (&wmsg, hwnd, msg, wParam, lParam); signal_user_input (); - return 0; + /* Non-zero must be returned when WM_MOUSEHWHEEL messages are + handled, to prevent the system trying to handle it by faking + scroll bar events. */ + return 1; case WM_TIMER: /* Flush out saved messages if necessary. */ @@ -4216,7 +4219,7 @@ This function is an internal primitive--use `make-frame' instead. */) display = Qnil; dpyinfo = check_x_display_info (display); #ifdef MULTI_KBOARD - kb = dpyinfo->kboard; + kb = dpyinfo->terminal->kboard; #else kb = &the_only_kboard; #endif @@ -4264,6 +4267,9 @@ This function is an internal primitive--use `make-frame' instead. */) /* By default, make scrollbars the system standard width. */ FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = GetSystemMetrics (SM_CXVSCROLL); + f->terminal = dpyinfo->terminal; + f->terminal->reference_count++; + f->output_method = output_w32; f->output_data.w32 = (struct w32_output *) xmalloc (sizeof (struct w32_output)); @@ -4498,6 +4504,22 @@ This function is an internal primitive--use `make-frame' instead. */) /* Must have been Qnil. */ ; } + + /* Initialize `default-minibuffer-frame' in case this is the first + frame on this terminal. */ + if (FRAME_HAS_MINIBUF_P (f) + && (!FRAMEP (kb->Vdefault_minibuffer_frame) + || !FRAME_LIVE_P (XFRAME (kb->Vdefault_minibuffer_frame)))) + kb->Vdefault_minibuffer_frame = frame; + + /* All remaining specified parameters, which have not been "used" + by x_get_arg and friends, now go in the misc. alist of the frame. */ + for (tem = parameters; !NILP (tem); tem = XCDR (tem)) + if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem)))) + f->param_alist = Fcons (XCAR (tem), f->param_alist); + + store_frame_param (f, Qwindow_system, Qw32); + UNGCPRO; /* Make sure windows on this frame appear in calls to next-window @@ -4523,7 +4545,7 @@ x_get_focus_frame (frame) return xfocus; } -DEFUN ("w32-focus-frame", Fw32_focus_frame, Sw32_focus_frame, 1, 1, 0, +DEFUN ("x-focus-frame", Fx_focus_frame, Sx_focus_frame, 1, 1, 0, doc: /* Give FRAME input focus, raising to foreground if necessary. */) (frame) Lisp_Object frame; @@ -6836,8 +6858,10 @@ terminate Emacs if we can't open the connection. */) if (! NILP (xrm_string)) CHECK_STRING (xrm_string); +#if 0 if (! EQ (Vwindow_system, intern ("w32"))) error ("Not using Microsoft Windows"); +#endif /* Allow color mapping to be defined externally; first look in user's HOME directory, then in Emacs etc dir for a file called rgb.txt. */ @@ -7339,7 +7363,7 @@ x_create_tip_frame (dpyinfo, parms, text) Vx_resource_name = Vinvocation_name; #ifdef MULTI_KBOARD - kb = dpyinfo->kboard; + kb = dpyinfo->terminal->kboard; #else kb = &the_only_kboard; #endif @@ -7377,6 +7401,8 @@ x_create_tip_frame (dpyinfo, parms, text) the frame is live, as per FRAME_LIVE_P. If we get a signal from this point on, x_destroy_window might screw up reference counts etc. */ + f->terminal = dpyinfo->terminal; + f->terminal->reference_count++; f->output_method = output_w32; f->output_data.w32 = (struct w32_output *) xmalloc (sizeof (struct w32_output)); @@ -7560,6 +7586,8 @@ x_create_tip_frame (dpyinfo, parms, text) Qnil)); } + Fmodify_frame_parameters (frame, Fcons (Fcons (Qwindow_system, Qw32), Qnil)); + f->no_split = 1; UNGCPRO; @@ -9106,10 +9134,10 @@ versions of Windows) characters. */); defsubr (&Sx_close_connection); defsubr (&Sx_display_list); defsubr (&Sx_synchronize); + defsubr (&Sx_focus_frame); /* W32 specific functions */ - defsubr (&Sw32_focus_frame); defsubr (&Sw32_select_font); defsubr (&Sw32_define_rgb_color); defsubr (&Sw32_default_color_map); @@ -9184,6 +9212,9 @@ void globals_of_w32fns () &w32_ansi_code_page, doc: /* The ANSI code page used by the system. */); w32_ansi_code_page = GetACP (); + + /* MessageBox does not work without this when linked to comctl32.dll 6.0. */ + InitCommonControls (); } #undef abort diff --git a/src/w32inevt.c b/src/w32inevt.c index fa2d34c2998..17cfd384400 100644 --- a/src/w32inevt.c +++ b/src/w32inevt.c @@ -643,7 +643,9 @@ maybe_generate_resize_event () } int -w32_console_read_socket (int sd, int expected, struct input_event *hold_quit) +w32_console_read_socket (struct terminal *terminal, + int expected, + struct input_event *hold_quit) { BOOL no_events = TRUE; int nev, ret = 0, add; diff --git a/src/w32inevt.h b/src/w32inevt.h index 53f36e3a348..08d85a0b2e4 100644 --- a/src/w32inevt.h +++ b/src/w32inevt.h @@ -22,7 +22,7 @@ Boston, MA 02110-1301, USA. */ #ifndef EMACS_W32INEVT_H #define EMACS_W32INEVT_H -extern int w32_console_read_socket (int sd, int numchars, +extern int w32_console_read_socket (struct terminal *term, int numchars, struct input_event *hold_quit); extern void w32_console_mouse_position (FRAME_PTR *f, int insist, Lisp_Object *bar_window, diff --git a/src/w32menu.c b/src/w32menu.c index 22389eea2ac..d4c92d4dcd5 100644 --- a/src/w32menu.c +++ b/src/w32menu.c @@ -20,15 +20,16 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include <config.h> -#include <signal.h> +#include <signal.h> #include <stdio.h> #include <mbstring.h> + #include "lisp.h" -#include "termhooks.h" #include "keyboard.h" #include "keymap.h" #include "frame.h" +#include "termhooks.h" #include "window.h" #include "blockinput.h" #include "buffer.h" @@ -675,8 +676,8 @@ cached information about equivalent key sequences. */) enum scroll_bar_part part; unsigned long time; - if (mouse_position_hook) - (*mouse_position_hook) (&new_f, 1, &bar_window, + if (FRAME_TERMINAL (new_f)->mouse_position_hook) + (*FRAME_TERMINAL (new_f)->mouse_position_hook) (&new_f, 1, &bar_window, &part, &x, &y, &time); if (new_f != 0) XSETFRAME (window, new_f); diff --git a/src/w32proc.c b/src/w32proc.c index c625c1b1fef..6c5f9b89f77 100644 --- a/src/w32proc.c +++ b/src/w32proc.c @@ -217,12 +217,18 @@ delete_child (child_process *cp) /* let the thread exit cleanly if possible */ cp->status = STATUS_READ_ERROR; SetEvent (cp->char_consumed); +#if 0 + /* We used to forceably terminate the thread here, but it + is normally unnecessary, and in abnormal cases, the worst that + will happen is we have an extra idle thread hanging around + waiting for the zombie process. */ if (WaitForSingleObject (cp->thrd, 1000) != WAIT_OBJECT_0) { DebPrint (("delete_child.WaitForSingleObject (thread) failed " "with %lu for fd %ld\n", GetLastError (), cp->fd)); TerminateThread (cp->thrd, 0); } +#endif } CloseHandle (cp->thrd); cp->thrd = NULL; diff --git a/src/w32term.c b/src/w32term.c index 9ba602fe7ca..a7fca780d3c 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -64,8 +64,6 @@ Boston, MA 02110-1301, USA. */ #include "font.h" #endif /* USE_FONT_BACKEND */ -#define abs(x) ((x) < 0 ? -(x) : (x)) - /* Fringe bitmaps. */ @@ -265,9 +263,9 @@ static void x_font_min_bounds P_ ((XFontStruct *, int *, int *)); int x_compute_min_glyph_bounds P_ ((struct frame *)); static void x_update_end P_ ((struct frame *)); static void w32_frame_up_to_date P_ ((struct frame *)); -static void w32_set_terminal_modes P_ ((void)); -static void w32_reset_terminal_modes P_ ((void)); -static void x_clear_frame P_ ((void)); +static void w32_set_terminal_modes P_ ((struct terminal *)); +static void w32_reset_terminal_modes P_ ((struct terminal *)); +static void x_clear_frame P_ ((struct frame *)); static void frame_highlight P_ ((struct frame *)); static void frame_unhighlight P_ ((struct frame *)); static void x_new_focus_frame P_ ((struct w32_display_info *, @@ -879,7 +877,7 @@ w32_destroy_fringe_bitmap (which) rarely happens). */ static void -w32_set_terminal_modes (void) +w32_set_terminal_modes (struct terminal *term) { } @@ -887,7 +885,7 @@ w32_set_terminal_modes (void) the W32 windows go away, and suspending requires no action. */ static void -w32_reset_terminal_modes (void) +w32_reset_terminal_modes (struct terminal *term) { } @@ -3016,7 +3014,7 @@ x_draw_glyph_string (s) } else { - w32_fill_area (s->f, s->hdc, s->face->underline_color, s->x, + w32_fill_area (s->f, s->hdc, s->face->strike_through_color, s->x, s->y + dy, s->width, h); } } @@ -3109,16 +3107,10 @@ w32_shift_glyphs_for_insert (f, x, y, width, height, shift_by) for X frames. */ static void -x_delete_glyphs (n) +x_delete_glyphs (f, n) + struct frame *f; register int n; { - struct frame *f; - - if (updating_frame) - f = updating_frame; - else - f = SELECTED_FRAME (); - if (! FRAME_W32_P (f)) return; @@ -3130,15 +3122,8 @@ x_delete_glyphs (n) frame. Otherwise clear the selected frame. */ static void -x_clear_frame () +x_clear_frame (struct frame *f) { - struct frame *f; - - if (updating_frame) - f = updating_frame; - else - f = SELECTED_FRAME (); - if (! FRAME_W32_P (f)) return; @@ -3165,18 +3150,14 @@ x_clear_frame () /* Make audible bell. */ static void -w32_ring_bell (void) +w32_ring_bell (struct frame *f) { - struct frame *f; - - f = SELECTED_FRAME (); - BLOCK_INPUT; if (FRAME_W32_P (f) && visible_bell) { int i; - HWND hwnd = FRAME_W32_WINDOW (SELECTED_FRAME ()); + HWND hwnd = FRAME_W32_WINDOW (f); for (i = 0; i < 5; i++) { @@ -3186,7 +3167,7 @@ w32_ring_bell (void) FlashWindow (hwnd, FALSE); } else - w32_sys_ring_bell (); + w32_sys_ring_bell (f); UNBLOCK_INPUT; } @@ -3213,16 +3194,10 @@ w32_set_terminal_window (n) lines or deleting -N lines at vertical position VPOS. */ static void -x_ins_del_lines (vpos, n) +x_ins_del_lines (f, vpos, n) + struct frame *f; int vpos, n; { - struct frame *f; - - if (updating_frame) - f = updating_frame; - else - f = SELECTED_FRAME (); - if (! FRAME_W32_P (f)) return; @@ -3627,7 +3602,8 @@ construct_mouse_wheel (result, msg, f) POINT p; int delta; - result->kind = WHEEL_EVENT; + result->kind = msg->msg.message == WM_MOUSEHWHEEL ? HORIZ_WHEEL_EVENT + : WHEEL_EVENT; result->code = 0; result->timestamp = msg->msg.time; @@ -4859,7 +4835,13 @@ w32_read_socket (sd, expected, hold_quit) only when it is active. */ if (WINDOWP(window) && !EQ (window, last_window) - && !EQ (window, selected_window)) + && !EQ (window, selected_window) + /* For click-to-focus window managers + create event iff we don't leave the + selected frame. */ + && (focus_follows_mouse + || (EQ (XWINDOW (window)->frame, + XWINDOW (selected_window)->frame)))) { inev.kind = SELECT_WINDOW_EVENT; inev.frame_or_window = window; @@ -4964,6 +4946,7 @@ w32_read_socket (sd, expected, hold_quit) } case WM_MOUSEWHEEL: + case WM_MOUSEHWHEEL: { if (dpyinfo->grabbed && last_mouse_frame && FRAME_LIVE_P (last_mouse_frame)) @@ -6478,8 +6461,8 @@ x_free_frame_resources (f) free_frame_menubar (f); - unload_color (f, f->output_data.x->foreground_pixel); - unload_color (f, f->output_data.x->background_pixel); + unload_color (f, FRAME_FOREGROUND_PIXEL (f)); + unload_color (f, FRAME_BACKGROUND_PIXEL (f)); unload_color (f, f->output_data.w32->cursor_pixel); unload_color (f, f->output_data.w32->cursor_foreground_pixel); unload_color (f, f->output_data.w32->border_pixel); @@ -6518,14 +6501,13 @@ x_free_frame_resources (f) /* Destroy the window of frame F. */ - +void x_destroy_window (f) struct frame *f; { struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f); x_free_frame_resources (f); - dpyinfo->reference_count--; } @@ -6785,6 +6767,132 @@ w32_make_rdb (xrm_option) return buffer; } +void +x_flush (struct frame * f) +{ /* Nothing to do */ } + + +extern frame_parm_handler w32_frame_parm_handlers[]; + +static struct redisplay_interface w32_redisplay_interface = +{ + w32_frame_parm_handlers, + x_produce_glyphs, + x_write_glyphs, + x_insert_glyphs, + x_clear_end_of_line, + x_scroll_run, + x_after_update_window_line, + x_update_window_begin, + x_update_window_end, + x_cursor_to, + x_flush, + 0, /* flush_display_optional */ + x_clear_window_mouse_face, + w32_get_glyph_overhangs, + x_fix_overlapping_area, + w32_draw_fringe_bitmap, + w32_define_fringe_bitmap, + w32_destroy_fringe_bitmap, + w32_per_char_metric, + w32_encode_char, + NULL, /* w32_compute_glyph_string_overhangs */ + x_draw_glyph_string, + w32_define_frame_cursor, + w32_clear_frame_area, + w32_draw_window_cursor, + w32_draw_vertical_window_border, + w32_shift_glyphs_for_insert +}; + +static void x_delete_terminal (struct terminal *term); + +static struct terminal * +w32_create_terminal (struct w32_display_info *dpyinfo) +{ + struct terminal *terminal; + + terminal = create_terminal (); + + terminal->type = output_w32; + terminal->display_info.w32 = dpyinfo; + dpyinfo->terminal = terminal; + + /* MSVC does not type K&R functions with no arguments correctly, and + so we must explicitly cast them. */ + terminal->clear_frame_hook = x_clear_frame; + terminal->ins_del_lines_hook = x_ins_del_lines; + terminal->delete_glyphs_hook = x_delete_glyphs; + terminal->ring_bell_hook = w32_ring_bell; + terminal->reset_terminal_modes_hook = w32_reset_terminal_modes; + terminal->set_terminal_modes_hook = w32_set_terminal_modes; + terminal->update_begin_hook = x_update_begin; + terminal->update_end_hook = x_update_end; + terminal->set_terminal_window_hook = w32_set_terminal_window; + terminal->read_socket_hook = w32_read_socket; + terminal->frame_up_to_date_hook = w32_frame_up_to_date; + terminal->mouse_position_hook = w32_mouse_position; + terminal->frame_rehighlight_hook = w32_frame_rehighlight; + terminal->frame_raise_lower_hook = w32_frame_raise_lower; + // terminal->fullscreen_hook = XTfullscreen_hook; + terminal->set_vertical_scroll_bar_hook = w32_set_vertical_scroll_bar; + terminal->condemn_scroll_bars_hook = w32_condemn_scroll_bars; + terminal->redeem_scroll_bar_hook = w32_redeem_scroll_bar; + terminal->judge_scroll_bars_hook = w32_judge_scroll_bars; + + terminal->delete_frame_hook = x_destroy_window; + terminal->delete_terminal_hook = x_delete_terminal; + + terminal->rif = &w32_redisplay_interface; + terminal->scroll_region_ok = 1; /* We'll scroll partial frames. */ + terminal->char_ins_del_ok = 1; + terminal->line_ins_del_ok = 1; /* We'll just blt 'em. */ + terminal->fast_clear_end_of_line = 1; /* X does this well. */ + terminal->memory_below_frame = 0; /* We don't remember what scrolls + off the bottom. */ + +#ifdef MULTI_KBOARD + /* We don't yet support separate terminals on W32, so don't try to share + keyboards between virtual terminals that are on the same physical + terminal like X does. */ + terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD)); + init_kboard (terminal->kboard); + terminal->kboard->next_kboard = all_kboards; + all_kboards = terminal->kboard; + /* Don't let the initial kboard remain current longer than necessary. + That would cause problems if a file loaded on startup tries to + prompt in the mini-buffer. */ + if (current_kboard == initial_kboard) + current_kboard = terminal->kboard; + terminal->kboard->reference_count++; +#endif + + return terminal; +} + +static void +x_delete_terminal (struct terminal *terminal) +{ + struct w32_display_info *dpyinfo = terminal->display_info.w32; + int i; + + /* Protect against recursive calls. Fdelete_frame in + delete_terminal calls us back when it deletes our last frame. */ + if (!terminal->name) + return; + + BLOCK_INPUT; + /* Free the fonts in the font table. */ + for (i = 0; i < dpyinfo->n_fonts; i++) + if (dpyinfo->font_table[i].name) + { + DeleteObject (((XFontStruct*)(dpyinfo->font_table[i].font))->hfont); + } + + x_delete_display (dpyinfo); + UNBLOCK_INPUT; +} + struct w32_display_info * w32_term_init (display_name, xrm_option, resource_name) Lisp_Object display_name; @@ -6792,6 +6900,7 @@ w32_term_init (display_name, xrm_option, resource_name) char *resource_name; { struct w32_display_info *dpyinfo; + struct terminal *terminal; HDC hdc; BLOCK_INPUT; @@ -6805,6 +6914,12 @@ w32_term_init (display_name, xrm_option, resource_name) w32_initialize_display_info (display_name); dpyinfo = &one_w32_display_info; + terminal = w32_create_terminal (dpyinfo); + + /* Set the name of the terminal. */ + terminal->name = (char *) xmalloc (SBYTES (display_name) + 1); + strncpy (terminal->name, SDATA (display_name), SBYTES (display_name)); + terminal->name[SBYTES (display_name)] = 0; dpyinfo->xrdb = xrm_option ? w32_make_rdb (xrm_option) : NULL; @@ -6834,6 +6949,9 @@ w32_term_init (display_name, xrm_option, resource_name) w32_defined_color (0, "black", &color, 1); } + /* Add the default keyboard. */ + add_keyboard_wait_descriptor (0); + /* Create Fringe Bitmaps and store them for later use. On W32, bitmaps are all unsigned short, as Windows requires @@ -6841,7 +6959,7 @@ w32_term_init (display_name, xrm_option, resource_name) horizontally reflected compared to how they appear on X, so we need to bitswap and convert to unsigned shorts before creating the bitmaps. */ - w32_init_fringe (); + w32_init_fringe (terminal->rif); #ifndef F_SETOWN_BUG #ifdef F_SETOWN @@ -6865,7 +6983,6 @@ w32_term_init (display_name, xrm_option, resource_name) } /* Get rid of display DPYINFO, assuming all frames are already gone. */ - void x_delete_display (dpyinfo) struct w32_display_info *dpyinfo; @@ -6916,73 +7033,9 @@ x_delete_display (dpyinfo) DWORD WINAPI w32_msg_worker (void * arg); -void -x_flush (struct frame * f) -{ /* Nothing to do */ } - -extern frame_parm_handler w32_frame_parm_handlers[]; - -static struct redisplay_interface w32_redisplay_interface = -{ - w32_frame_parm_handlers, - x_produce_glyphs, - x_write_glyphs, - x_insert_glyphs, - x_clear_end_of_line, - x_scroll_run, - x_after_update_window_line, - x_update_window_begin, - x_update_window_end, - x_cursor_to, - x_flush, - 0, /* flush_display_optional */ - x_clear_window_mouse_face, - w32_get_glyph_overhangs, - x_fix_overlapping_area, - w32_draw_fringe_bitmap, - w32_define_fringe_bitmap, - w32_destroy_fringe_bitmap, - w32_per_char_metric, - w32_encode_char, - NULL, /* w32_compute_glyph_string_overhangs */ - x_draw_glyph_string, - w32_define_frame_cursor, - w32_clear_frame_area, - w32_draw_window_cursor, - w32_draw_vertical_window_border, - w32_shift_glyphs_for_insert -}; - static void w32_initialize () { - rif = &w32_redisplay_interface; - - /* MSVC does not type K&R functions with no arguments correctly, and - so we must explicitly cast them. */ - clear_frame_hook = (void (*)(void)) x_clear_frame; - ring_bell_hook = (void (*)(void)) w32_ring_bell; - update_begin_hook = x_update_begin; - update_end_hook = x_update_end; - - read_socket_hook = w32_read_socket; - - frame_up_to_date_hook = w32_frame_up_to_date; - - mouse_position_hook = w32_mouse_position; - frame_rehighlight_hook = w32_frame_rehighlight; - frame_raise_lower_hook = w32_frame_raise_lower; - set_vertical_scroll_bar_hook = w32_set_vertical_scroll_bar; - condemn_scroll_bars_hook = w32_condemn_scroll_bars; - redeem_scroll_bar_hook = w32_redeem_scroll_bar; - judge_scroll_bars_hook = w32_judge_scroll_bars; - - scroll_region_ok = 1; /* we'll scroll partial frames */ - char_ins_del_ok = 1; - line_ins_del_ok = 1; /* we'll just blt 'em */ - fast_clear_end_of_line = 1; /* X does this well */ - memory_below_frame = 0; /* we don't remember what scrolls - off the bottom */ baud_rate = 19200; w32_system_caret_hwnd = NULL; diff --git a/src/w32term.h b/src/w32term.h index cea3110ff8f..f5aff57622e 100644 --- a/src/w32term.h +++ b/src/w32term.h @@ -100,6 +100,9 @@ struct w32_display_info /* Chain of all w32_display_info structures. */ struct w32_display_info *next; + /* The generic display parameters corresponding to this w32 display. */ + struct terminal *terminal; + /* This is a cons cell of the form (NAME . FONT-LIST-CACHE). The same cons cell also appears in x_display_name_list. */ Lisp_Object name_list_element; @@ -274,8 +277,10 @@ extern Lisp_Object x_get_font_repertory P_ ((struct frame *, diffs between X and w32 code. */ struct x_output { +#if 0 /* These are also defined in struct frame. Use that instead. */ PIX_TYPE background_pixel; PIX_TYPE foreground_pixel; +#endif /* Keep track of focus. May be EXPLICIT if we received a FocusIn for this frame, or IMPLICIT if we received an EnterNotify. @@ -411,8 +416,6 @@ extern struct w32_output w32term_display; #define FRAME_W32_WINDOW(f) ((f)->output_data.w32->window_desc) #define FRAME_X_WINDOW(f) ((f)->output_data.w32->window_desc) -#define FRAME_FOREGROUND_PIXEL(f) ((f)->output_data.x->foreground_pixel) -#define FRAME_BACKGROUND_PIXEL(f) ((f)->output_data.x->background_pixel) #define FRAME_FONT(f) ((f)->output_data.w32->font) #define FRAME_FONTSET(f) ((f)->output_data.w32->fontset) #define FRAME_BASELINE_OFFSET(f) ((f)->output_data.w32->baseline_offset) @@ -600,10 +603,10 @@ do { \ } while (0) #define w32_clear_rect(f,hdc,lprect) \ -w32_fill_rect (f,hdc,f->output_data.x->background_pixel,lprect) + w32_fill_rect (f, hdc, FRAME_BACKGROUND_PIXEL (f), lprect) #define w32_clear_area(f,hdc,px,py,nx,ny) \ -w32_fill_area (f,hdc,f->output_data.x->background_pixel,px,py,nx,ny) + w32_fill_area (f, hdc, FRAME_BACKGROUND_PIXEL (f), px, py, nx, ny) extern struct font_info *w32_load_font (); extern void w32_unload_font (); @@ -619,6 +622,9 @@ extern void w32_unload_font (); #define WM_XBUTTONDOWN (WM_MOUSEWHEEL + 1) #define WM_XBUTTONUP (WM_MOUSEWHEEL + 2) #endif /* WM_XBUTTONDOWN */ +#ifndef WM_MOUSEHWHEEL +#define WM_MOUSEHWHEEL (WM_MOUSEWHEEL + 4) +#endif /* WM_MOUSEHWHEEL */ #define WM_EMACS_START (WM_USER + 1) #define WM_EMACS_KILL (WM_EMACS_START + 0) @@ -698,6 +704,9 @@ extern void wait_for_sync (); extern BOOL parse_button (); +extern void w32_sys_ring_bell (struct frame *f); +extern void x_delete_display (struct w32_display_info *dpyinfo); + /* Keypad command key support. W32 doesn't have virtual keys defined for the function keys on the keypad (they are mapped to the standard fuction keys), so we define our own. */ diff --git a/src/widget.c b/src/widget.c index 714da205a67..c76cce9e328 100644 --- a/src/widget.c +++ b/src/widget.c @@ -659,10 +659,10 @@ update_from_various_frame_slots (ew) struct x_output *x = f->output_data.x; ew->core.height = FRAME_PIXEL_HEIGHT (f) - x->menubar_height; ew->core.width = FRAME_PIXEL_WIDTH (f); - ew->core.background_pixel = x->background_pixel; + ew->core.background_pixel = FRAME_BACKGROUND_PIXEL (f); ew->emacs_frame.internal_border_width = f->internal_border_width; ew->emacs_frame.font = x->font; - ew->emacs_frame.foreground_pixel = x->foreground_pixel; + ew->emacs_frame.foreground_pixel = FRAME_FOREGROUND_PIXEL (f); ew->emacs_frame.cursor_color = x->cursor_pixel; ew->core.border_pixel = x->border_pixel; } diff --git a/src/window.c b/src/window.c index 43ea423dd9d..c51649679da 100644 --- a/src/window.c +++ b/src/window.c @@ -21,6 +21,8 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include <config.h> +#include <stdio.h> + #include "lisp.h" #include "buffer.h" #include "keyboard.h" @@ -34,6 +36,7 @@ Boston, MA 02110-1301, USA. */ #include "dispextern.h" #include "blockinput.h" #include "intervals.h" +#include "termhooks.h" /* For FRAME_TERMINAL. */ #ifdef HAVE_X_WINDOWS #include "xterm.h" @@ -190,6 +193,10 @@ Lisp_Object Qtemp_buffer_show_hook; EMACS_INT split_height_threshold; +/* How to split windows (horizontally/vertically/hybrid). */ + +Lisp_Object Vsplit_window_preferred_function; + /* Number of lines of continuity in scrolling by screenfuls. */ EMACS_INT next_screen_context_lines; @@ -1788,12 +1795,28 @@ candidate_window_p (window, owindow, minibuf, all_frames) else if (EQ (all_frames, Qvisible)) { FRAME_SAMPLE_VISIBILITY (f); - candidate_p = FRAME_VISIBLE_P (f); + candidate_p = FRAME_VISIBLE_P (f) + && (FRAME_TERMINAL (XFRAME (w->frame)) + == FRAME_TERMINAL (XFRAME (selected_frame))); + } else if (INTEGERP (all_frames) && XINT (all_frames) == 0) { FRAME_SAMPLE_VISIBILITY (f); - candidate_p = FRAME_VISIBLE_P (f) || FRAME_ICONIFIED_P (f); + candidate_p = (FRAME_VISIBLE_P (f) || FRAME_ICONIFIED_P (f) +#ifdef HAVE_X_WINDOWS + /* Yuck!! If we've just created the frame and the + window-manager requested the user to place it + manually, the window may still not be considered + `visible'. I'd argue it should be at least + something like `iconified', but don't know how to do + that yet. --Stef */ + || (FRAME_X_P (f) && f->output_data.x->asked_for_visible + && !f->output_data.x->has_been_visible) +#endif + ) + && (FRAME_TERMINAL (XFRAME (w->frame)) + == FRAME_TERMINAL (XFRAME (selected_frame))); } else if (WINDOWP (all_frames)) candidate_p = (EQ (FRAME_MINIBUF_WINDOW (f), all_frames) @@ -2162,8 +2185,10 @@ window_loop (type, obj, mini, frames) if (NILP (best_window)) best_window = window; else if (EQ (window, selected_window)) - /* For compatibility with 20.x, prefer to return - selected-window. */ + /* Prefer to return selected-window. */ + RETURN_UNGCPRO (window); + else if (EQ (Fwindow_frame (window), selected_frame)) + /* Prefer windows on the current frame. */ best_window = window; } break; @@ -3445,6 +3470,22 @@ selects the buffer of the selected window before each command. */) if (EQ (window, selected_window)) return window; + sf = SELECTED_FRAME (); + if (XFRAME (WINDOW_FRAME (w)) != sf) + { + XFRAME (WINDOW_FRAME (w))->selected_window = window; + /* Use this rather than Fhandle_switch_frame + so that FRAME_FOCUS_FRAME is moved appropriately as we + move around in the state where a minibuffer in a separate + frame is active. */ + Fselect_frame (WINDOW_FRAME (w)); + /* Fselect_frame called us back so we've done all the work already. */ + eassert (EQ (window, selected_window)); + return window; + } + else + sf->selected_window = window; + /* Store the current buffer's actual point into the old selected window. It belongs to that window, and when the window is not selected, must be in the window. */ @@ -3458,18 +3499,6 @@ selects the buffer of the selected window before each command. */) } selected_window = window; - sf = SELECTED_FRAME (); - if (XFRAME (WINDOW_FRAME (w)) != sf) - { - XFRAME (WINDOW_FRAME (w))->selected_window = window; - /* Use this rather than Fhandle_switch_frame - so that FRAME_FOCUS_FRAME is moved appropriately as we - move around in the state where a minibuffer in a separate - frame is active. */ - Fselect_frame (WINDOW_FRAME (w)); - } - else - sf->selected_window = window; if (NILP (norecord)) record_buffer (w->buffer); @@ -3649,7 +3678,7 @@ If `even-window-heights' is non-nil, window heights will be evened out if displaying the buffer causes two vertically adjacent windows to be displayed. */) (buffer, not_this_window, frame) - register Lisp_Object buffer, not_this_window, frame; + Lisp_Object buffer, not_this_window, frame; { register Lisp_Object window, tem, swp; struct frame *f; @@ -3721,6 +3750,8 @@ displayed. */) || !NILP (XWINDOW (FRAME_ROOT_WINDOW (f))->dedicated)) { Lisp_Object frames; + struct gcpro gcpro1; + GCPRO1 (buffer); frames = Qnil; if (FRAME_MINIBUF_ONLY_P (f)) @@ -3752,26 +3783,26 @@ displayed. */) if (!NILP (window) && ! FRAME_NO_SPLIT_P (XFRAME (XWINDOW (window)->frame)) && WINDOW_FULL_WIDTH_P (XWINDOW (window)) - && (window_height (window) >= split_height_threshold - || (NILP (XWINDOW (window)->parent))) + && (window_height (window) >= split_height_threshold + || (NILP (XWINDOW (window)->parent))) && (window_height (window) >= (2 * window_min_size_2 (XWINDOW (window), 0)))) - window = Fsplit_window (window, Qnil, Qnil); + window = call1 (Vsplit_window_preferred_function, window); else { Lisp_Object upper, other; window = Fget_lru_window (frames, Qt); - /* If the LRU window is tall enough, and either eligible for splitting - and selected or the only window, split it. */ + /* If the LRU window is tall enough, and either eligible for + splitting and selected or the only window, split it. */ if (!NILP (window) && ! FRAME_NO_SPLIT_P (XFRAME (XWINDOW (window)->frame)) - && ((EQ (window, selected_window) - && window_height (window) >= split_height_threshold) - || (NILP (XWINDOW (window)->parent))) - && (window_height (window) - >= (2 * window_min_size_2 (XWINDOW (window), 0)))) - window = Fsplit_window (window, Qnil, Qnil); + && ((EQ (window, selected_window) + && window_height (window) >= split_height_threshold) + || (NILP (XWINDOW (window)->parent))) + && (window_height (window) + >= (2 * window_min_size_2 (XWINDOW (window), 0)))) + window = call1 (Vsplit_window_preferred_function, window); else window = Fget_lru_window (frames, Qnil); /* If Fget_lru_window returned nil, try other approaches. */ @@ -3817,6 +3848,7 @@ displayed. */) 0); } } + UNGCPRO; } else window = Fget_lru_window (Qnil, Qnil); @@ -6017,7 +6049,7 @@ zero means top of window, negative means relative to bottom of window. */) struct save_window_data { - EMACS_INT size_from_Lisp_Vector_struct; + EMACS_UINT size; struct Lisp_Vector *next_from_Lisp_Vector_struct; Lisp_Object frame_cols, frame_lines, frame_menu_bar_lines; Lisp_Object frame_tool_bar_lines; @@ -6040,7 +6072,7 @@ struct save_window_data struct saved_window { /* these first two must agree with struct Lisp_Vector in lisp.h */ - EMACS_INT size_from_Lisp_Vector_struct; + EMACS_UINT size; struct Lisp_Vector *next_from_Lisp_Vector_struct; Lisp_Object window; @@ -6631,6 +6663,7 @@ redirection (see `redirect-frame-focus'). */) n_windows = count_windows (XWINDOW (FRAME_ROOT_WINDOW (f))); vec = allocate_other_vector (VECSIZE (struct save_window_data)); + XSETPVECTYPE (vec, PVEC_WINDOW_CONFIGURATION); data = (struct save_window_data *)vec; XSETFASTINT (data->frame_cols, FRAME_COLS (f)); @@ -7102,11 +7135,12 @@ freeze_window_start (w, freeze_p) struct window *w; void *freeze_p; { - if (w == XWINDOW (selected_window) - || MINI_WINDOW_P (w) - || (MINI_WINDOW_P (XWINDOW (selected_window)) - && ! NILP (Vminibuf_scroll_window) - && w == XWINDOW (Vminibuf_scroll_window))) + if (MINI_WINDOW_P (w) + || (WINDOWP (selected_window) /* Can be nil in corner cases. */ + && (w == XWINDOW (selected_window) + || (MINI_WINDOW_P (XWINDOW (selected_window)) + && ! NILP (Vminibuf_scroll_window) + && w == XWINDOW (Vminibuf_scroll_window))))) freeze_p = NULL; w->frozen_window_start_p = freeze_p != NULL; @@ -7269,7 +7303,7 @@ and scrolling positions. */) void init_window_once () { - struct frame *f = make_terminal_frame (); + struct frame *f = make_initial_frame (); XSETFRAME (selected_frame, f); Vterminal_frame = selected_frame; minibuf_window = f->minibuffer_window; @@ -7488,6 +7522,15 @@ by `display-buffer'. The value is in line units. If there is only one window, it is split regardless of this value. */); split_height_threshold = 500; + DEFVAR_LISP ("split-window-preferred-function", + &Vsplit_window_preferred_function, + doc: /* Function to use to split a window. +This is used by `display-buffer' to allow the user to choose whether +to split windows horizontally or vertically or some mix of the two. +It is called with a window as single argument and should split it in two +and return the new window. */); + Vsplit_window_preferred_function = intern ("split-window"); + DEFVAR_INT ("window-min-height", &window_min_height, doc: /* *Delete any window less than this tall (including its mode line). The value is in line units. */); diff --git a/src/window.h b/src/window.h index ea8965392c4..3b9107acaa2 100644 --- a/src/window.h +++ b/src/window.h @@ -92,7 +92,7 @@ struct window { /* The first two fields are really the header of a vector */ /* The window code does not refer to them. */ - EMACS_INT size; + EMACS_UINT size; struct Lisp_Vector *vec_next; /* The frame this window is on. */ Lisp_Object frame; @@ -744,7 +744,7 @@ extern Lisp_Object Vminibuf_scroll_window; /* Nil or a symbol naming the window system under which emacs is running ('x is the only current possibility) */ -extern Lisp_Object Vwindow_system; +extern Lisp_Object Vinitial_window_system; /* Version number of X windows: 10, 11 or nil. */ diff --git a/src/xdisp.c b/src/xdisp.c index 3a85ef9dd29..e146fde4c16 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -587,21 +587,12 @@ Lisp_Object Vmessage_log_max; static Lisp_Object Vmessages_buffer_name; -/* Index 0 is the buffer that holds the current (desired) echo area message, - or nil if none is desired right now. - - Index 1 is the buffer that holds the previously displayed echo area message, - or nil to indicate no message. This is normally what's on the screen now. - - These two can point to the same buffer. That happens when the last - message output by the user (or made by echoing) has been displayed. */ +/* Current, index 0, and last displayed echo area message. Either + buffers from echo_buffers, or nil to indicate no message. */ Lisp_Object echo_area_buffer[2]; -/* Permanent pointers to the two buffers that are used for echo area - purposes. Once the two buffers are made, and their pointers are - placed here, these two slots remain unchanged unless those buffers - need to be created afresh. */ +/* The buffers referenced from echo_area_buffer. */ static Lisp_Object echo_buffer[2]; @@ -822,10 +813,6 @@ static int clear_face_cache_count; static int clear_image_cache_count; #endif -/* Record the previous terminal frame we displayed. */ - -static struct frame *previous_terminal_frame; - /* Non-zero while redisplay_internal is in progress. */ int redisplaying_p; @@ -2525,7 +2512,7 @@ init_iterator (it, w, charpos, bytepos, row, base_face_id) XSETWINDOW (it->window, w); it->w = w; it->f = XFRAME (w->frame); - + /* Extra space between lines (on window systems only). */ if (base_face_id == DEFAULT_FACE_ID && FRAME_WINDOW_P (it->f)) @@ -2542,9 +2529,9 @@ init_iterator (it, w, charpos, bytepos, row, base_face_id) /* If realized faces have been removed, e.g. because of face attribute changes of named faces, recompute them. When running - in batch mode, the face cache of Vterminal_frame is null. If + in batch mode, the face cache of the initial frame is null. If we happen to get called, make a dummy face cache. */ - if (noninteractive && FRAME_FACE_CACHE (it->f) == NULL) + if (FRAME_FACE_CACHE (it->f) == NULL) init_frame_faces (it->f); if (FRAME_FACE_CACHE (it->f)->used == 0) recompute_basic_faces (it->f); @@ -3639,7 +3626,8 @@ handle_invisible_prop (it) } else { - int invis_p, newpos, next_stop, start_charpos; + int invis_p; + EMACS_INT newpos, next_stop, start_charpos; Lisp_Object pos, prop, overlay; /* First of all, is there invisible text at this position? */ @@ -3969,7 +3957,7 @@ handle_single_display_spec (it, spec, object, position, && EQ (XCAR (spec), Qheight) && CONSP (XCDR (spec))) { - if (FRAME_TERMCAP_P (it->f) || FRAME_MSDOS_P (it->f)) + if (!FRAME_WINDOW_P (it->f)) return 0; it->font_height = XCAR (XCDR (spec)); @@ -4035,7 +4023,7 @@ handle_single_display_spec (it, spec, object, position, && EQ (XCAR (spec), Qspace_width) && CONSP (XCDR (spec))) { - if (FRAME_TERMCAP_P (it->f) || FRAME_MSDOS_P (it->f)) + if (!FRAME_WINDOW_P (it->f)) return 0; value = XCAR (XCDR (spec)); @@ -4051,7 +4039,7 @@ handle_single_display_spec (it, spec, object, position, { Lisp_Object tem; - if (FRAME_TERMCAP_P (it->f) || FRAME_MSDOS_P (it->f)) + if (!FRAME_WINDOW_P (it->f)) return 0; if (tem = XCDR (spec), CONSP (tem)) @@ -4077,7 +4065,7 @@ handle_single_display_spec (it, spec, object, position, && EQ (XCAR (spec), Qraise) && CONSP (XCDR (spec))) { - if (FRAME_TERMCAP_P (it->f) || FRAME_MSDOS_P (it->f)) + if (!FRAME_WINDOW_P (it->f)) return 0; #ifdef HAVE_WINDOW_SYSTEM @@ -4118,7 +4106,7 @@ handle_single_display_spec (it, spec, object, position, int face_id = DEFAULT_FACE_ID; int fringe_bitmap; - if (FRAME_TERMCAP_P (it->f) || FRAME_MSDOS_P (it->f)) + if (!FRAME_WINDOW_P (it->f)) /* If we return here, POSITION has been advanced across the text with this property. */ return 0; @@ -4167,7 +4155,7 @@ handle_single_display_spec (it, spec, object, position, it->left_user_fringe_face_id = face_id; } else - { + { it->right_user_fringe_bitmap = fringe_bitmap; it->right_user_fringe_face_id = face_id; } @@ -4212,9 +4200,9 @@ handle_single_display_spec (it, spec, object, position, valid_p = (STRINGP (value) #ifdef HAVE_WINDOW_SYSTEM - || (!FRAME_TERMCAP_P (it->f) && valid_image_p (value)) + || (FRAME_WINDOW_P (it->f) && valid_image_p (value)) #endif /* not HAVE_WINDOW_SYSTEM */ - || (CONSP (value) && EQ (XCAR (value), Qspace))); + || (CONSP (value) && EQ (XCAR (value), Qspace))); if (valid_p && !display_replaced_before_p) { @@ -4284,7 +4272,7 @@ handle_single_display_spec (it, spec, object, position, } -/* Check if SPEC is a display specification value whose text should be +/* Check if SPEC is a display sub-property value whose text should be treated as intangible. */ static int @@ -7695,8 +7683,8 @@ message2_nolog (m, nbytes, multibyte) do_pending_window_change (0); echo_area_display (1); do_pending_window_change (0); - if (frame_up_to_date_hook != 0 && ! gc_in_progress) - (*frame_up_to_date_hook) (f); + if (FRAME_TERMINAL (f)->frame_up_to_date_hook != 0 && ! gc_in_progress) + (*FRAME_TERMINAL (f)->frame_up_to_date_hook) (f); } } @@ -7799,8 +7787,8 @@ message3_nolog (m, nbytes, multibyte) do_pending_window_change (0); echo_area_display (1); do_pending_window_change (0); - if (frame_up_to_date_hook != 0 && ! gc_in_progress) - (*frame_up_to_date_hook) (f); + if (FRAME_TERMINAL (f)->frame_up_to_date_hook != 0 && ! gc_in_progress) + (*FRAME_TERMINAL (f)->frame_up_to_date_hook) (f); } } @@ -8038,6 +8026,10 @@ ensure_echo_area_buffers () WHICH > 0 means use echo_area_buffer[1]. If that is nil, choose a suitable buffer from echo_buffer[] and clear it. + If WHICH < 0, set echo_area_buffer[1] to echo_area_buffer[0], so + that the current message becomes the last displayed one, make + choose a suitable buffer for echo_area_buffer[0], and clear it. + Value is what FN returns. */ static int @@ -8062,6 +8054,17 @@ with_echo_area_buffer (w, which, fn, a1, a2, a3, a4) this_one = 0, the_other = 1; else if (which > 0) this_one = 1, the_other = 0; + else + { + this_one = 0, the_other = 1; + clear_buffer_p = 1; + + /* We need a fresh one in case the current echo buffer equals + the one containing the last displayed echo area message. */ + if (!NILP (echo_area_buffer[this_one]) + && EQ (echo_area_buffer[this_one], echo_area_buffer[the_other])) + echo_area_buffer[this_one] = Qnil; + } /* Choose a suitable buffer from echo_buffer[] is we don't have one. */ @@ -8699,7 +8702,7 @@ set_message (s, string, nbytes, multibyte_p) = ((s && multibyte_p) || (STRINGP (string) && STRING_MULTIBYTE (string))); - with_echo_area_buffer (0, 0, set_message_1, + with_echo_area_buffer (0, -1, set_message_1, (EMACS_INT) s, string, nbytes, multibyte_p); message_buf_print = 0; help_echo_showing_p = 0; @@ -8729,7 +8732,6 @@ set_message_1 (a1, a2, nbytes, multibyte_p) /* Insert new message at BEG. */ TEMP_SET_PT_BOTH (BEG, BEG_BYTE); - Ferase_buffer (); if (STRINGP (string)) { @@ -8826,11 +8828,11 @@ clear_garbaged_frames () { Lisp_Object tail, frame; int changed_count = 0; - + FOR_EACH_FRAME (tail, frame) { struct frame *f = XFRAME (frame); - + if (FRAME_VISIBLE_P (f) && FRAME_GARBAGED_P (f)) { if (f->resized_p) @@ -8844,7 +8846,7 @@ clear_garbaged_frames () f->resized_p = 0; } } - + frame_garbaged = 0; if (changed_count) ++windows_or_buffers_changed; @@ -8877,11 +8879,10 @@ echo_area_display (update_frame_p) /* The terminal frame is used as the first Emacs frame on the Mac OS. */ #ifndef MAC_OS8 #ifdef HAVE_WINDOW_SYSTEM - /* When Emacs starts, selected_frame may be a visible terminal - frame, even if we run under a window system. If we let this - through, a message would be displayed on the terminal. */ - if (EQ (selected_frame, Vterminal_frame) - && !NILP (Vwindow_system)) + /* When Emacs starts, selected_frame may be the initial terminal + frame. If we let this through, a message would be displayed on + the terminal. */ + if (FRAME_INITIAL_P (XFRAME (selected_frame))) return 0; #endif /* HAVE_WINDOW_SYSTEM */ #endif @@ -8932,7 +8933,7 @@ echo_area_display (update_frame_p) Can do with a display update of the echo area, unless we displayed some mode lines. */ update_single_window (w, 1); - rif->flush_display (f); + FRAME_RIF (f)->flush_display (f); } else update_frame (f, 1, 1); @@ -8947,8 +8948,10 @@ echo_area_display (update_frame_p) else if (!EQ (mini_window, selected_window)) windows_or_buffers_changed++; - /* The current message is now also the last one displayed. */ + /* Last displayed message is now the current message. */ echo_area_buffer[1] = echo_area_buffer[0]; + /* Inform read_char that we're not echoing. */ + echo_message_buffer = Qnil; /* Prevent redisplay optimization in redisplay_internal by resetting this_line_start_pos. This is done because the mini-buffer now @@ -9502,8 +9505,8 @@ x_cursor_to (vpos, hpos, y, x) { BLOCK_INPUT; display_and_set_cursor (w, 1, hpos, vpos, x, y); - if (rif->flush_display_optional) - rif->flush_display_optional (SELECTED_FRAME ()); + if (FRAME_RIF (SELECTED_FRAME ())->flush_display_optional) + FRAME_RIF (SELECTED_FRAME ())->flush_display_optional (SELECTED_FRAME ()); UNBLOCK_INPUT; } } @@ -10955,6 +10958,8 @@ select_frame_for_redisplay (frame) Lisp_Object tail, sym, val; Lisp_Object old = selected_frame; + xassert (FRAMEP (frame) && FRAME_LIVE_P (XFRAME (frame))); + selected_frame = frame; for (tail = XFRAME (frame)->param_alist; CONSP (tail); tail = XCDR (tail)) @@ -11011,6 +11016,7 @@ redisplay_internal (preserve_echo_area) int count, count1; struct frame *sf; int polling_stopped_here = 0; + Lisp_Object old_frame = selected_frame; /* Non-zero means redisplay has to consider all windows on all frames. Zero means, only selected_window is considered. */ @@ -11072,6 +11078,14 @@ redisplay_internal (preserve_echo_area) } retry: + if (!EQ (old_frame, selected_frame) + && FRAME_LIVE_P (XFRAME (old_frame))) + /* When running redisplay, we play a bit fast-and-loose and allow e.g. + selected_frame and selected_window to be temporarily out-of-sync so + when we come back here via `goto retry', we need to resync because we + may need to run Elisp code (via prepare_menu_bars). */ + select_frame_for_redisplay (old_frame); + pause = 0; reconsider_clip_changes (w, current_buffer); last_escape_glyph_frame = NULL; @@ -11092,17 +11106,16 @@ redisplay_internal (preserve_echo_area) if (face_change_count) ++windows_or_buffers_changed; - if (! FRAME_WINDOW_P (sf) - && previous_terminal_frame != sf) + if (FRAME_TERMCAP_P (sf) + && FRAME_TTY (sf)->previous_frame != sf) { - /* Since frames on an ASCII terminal share the same display - area, displaying a different frame means redisplay the whole - thing. */ + /* Since frames on a single ASCII terminal share the same + display area, displaying a different frame means redisplay + the whole thing. */ windows_or_buffers_changed++; SET_FRAME_GARBAGED (sf); - XSETFRAME (Vterminal_frame, sf); + FRAME_TTY (sf)->previous_frame = sf; } - previous_terminal_frame = sf; /* Set the visible flags for all frames. Do this before checking for resized or garbaged frames; they want to know if their frames @@ -11124,6 +11137,7 @@ redisplay_internal (preserve_echo_area) } } + /* Notice any pending interrupt request to change frame size. */ do_pending_window_change (1); @@ -11485,7 +11499,7 @@ redisplay_internal (preserve_echo_area) { struct frame *f = XFRAME (frame); - if (FRAME_WINDOW_P (f) || f == sf) + if (FRAME_WINDOW_P (f) || FRAME_TERMCAP_P (f) || f == sf) { if (! EQ (frame, selected_frame)) /* Select the frame, for the sake of frame-local @@ -11494,16 +11508,16 @@ redisplay_internal (preserve_echo_area) /* Mark all the scroll bars to be removed; we'll redeem the ones we want when we redisplay their windows. */ - if (condemn_scroll_bars_hook) - condemn_scroll_bars_hook (f); + if (FRAME_TERMINAL (f)->condemn_scroll_bars_hook) + FRAME_TERMINAL (f)->condemn_scroll_bars_hook (f); if (FRAME_VISIBLE_P (f) && !FRAME_OBSCURED_P (f)) redisplay_windows (FRAME_ROOT_WINDOW (f)); /* Any scroll bars which redisplay_windows should have nuked should now go away. */ - if (judge_scroll_bars_hook) - judge_scroll_bars_hook (f); + if (FRAME_TERMINAL (f)->judge_scroll_bars_hook) + FRAME_TERMINAL (f)->judge_scroll_bars_hook (f); /* If fonts changed, display again. */ /* ??? rms: I suspect it is a mistake to jump all the way @@ -11550,12 +11564,12 @@ redisplay_internal (preserve_echo_area) FOR_EACH_FRAME (tail, frame) { struct frame *f = XFRAME (frame); - if (f->updated_p) - { - mark_window_display_accurate (f->root_window, 1); - if (frame_up_to_date_hook) - frame_up_to_date_hook (f); - } + if (f->updated_p) + { + mark_window_display_accurate (f->root_window, 1); + if (FRAME_TERMINAL (f)->frame_up_to_date_hook) + FRAME_TERMINAL (f)->frame_up_to_date_hook (f); + } } } } @@ -11640,8 +11654,8 @@ redisplay_internal (preserve_echo_area) /* Say overlay arrows are up to date. */ update_overlay_arrows (1); - if (frame_up_to_date_hook != 0) - frame_up_to_date_hook (sf); + if (FRAME_TERMINAL (sf)->frame_up_to_date_hook != 0) + FRAME_TERMINAL (sf)->frame_up_to_date_hook (sf); } update_mode_lines = 0; @@ -11751,8 +11765,9 @@ redisplay_preserve_echo_area (from_where) else redisplay_internal (1); - if (rif != NULL && rif->flush_display_optional) - rif->flush_display_optional (NULL); + if (FRAME_RIF (SELECTED_FRAME ()) != NULL + && FRAME_RIF (SELECTED_FRAME ())->flush_display_optional) + FRAME_RIF (SELECTED_FRAME ())->flush_display_optional (NULL); } @@ -11760,7 +11775,8 @@ redisplay_preserve_echo_area (from_where) redisplay_internal. Reset redisplaying_p to the value it had before redisplay_internal was called, and clear prevent_freeing_realized_faces_p. It also selects the previously - selected frame. */ + selected frame, unless it has been deleted (by an X connection + failure during redisplay, for example). */ static Lisp_Object unwind_redisplay (val) @@ -11771,7 +11787,8 @@ unwind_redisplay (val) old_redisplaying_p = XCAR (val); redisplaying_p = XFASTINT (old_redisplaying_p); old_frame = XCDR (val); - if (! EQ (old_frame, selected_frame)) + if (! EQ (old_frame, selected_frame) + && FRAME_LIVE_P (XFRAME (old_frame))) select_frame_for_redisplay (old_frame); return Qnil; } @@ -12909,7 +12926,9 @@ set_vertical_scroll_bar (w) start = end = whole = 0; /* Indicate what this scroll bar ought to be displaying now. */ - set_vertical_scroll_bar_hook (w, end - start, whole, start); + if (FRAME_TERMINAL (XFRAME (w->frame))->set_vertical_scroll_bar_hook) + (*FRAME_TERMINAL (XFRAME (w->frame))->set_vertical_scroll_bar_hook) + (w, end - start, whole, start); } @@ -13628,20 +13647,22 @@ redisplay_window (window, just_this_one_p) display_menu_bar (w); #ifdef HAVE_WINDOW_SYSTEM + if (FRAME_WINDOW_P (f)) + { #if defined (USE_GTK) || USE_MAC_TOOLBAR - redisplay_tool_bar_p = FRAME_EXTERNAL_TOOL_BAR (f); + redisplay_tool_bar_p = FRAME_EXTERNAL_TOOL_BAR (f); #else - redisplay_tool_bar_p = WINDOWP (f->tool_bar_window) - && (FRAME_TOOL_BAR_LINES (f) > 0 - || !NILP (Vauto_resize_tool_bars)); - + redisplay_tool_bar_p = WINDOWP (f->tool_bar_window) + && (FRAME_TOOL_BAR_LINES (f) > 0 + || !NILP (Vauto_resize_tool_bars)); #endif - if (redisplay_tool_bar_p && redisplay_tool_bar (f)) - { - extern int ignore_mouse_drag_p; - ignore_mouse_drag_p = 1; - } + if (redisplay_tool_bar_p && redisplay_tool_bar (f)) + { + extern int ignore_mouse_drag_p; + ignore_mouse_drag_p = 1; + } + } #endif } @@ -13675,7 +13696,8 @@ redisplay_window (window, just_this_one_p) /* Note that we actually used the scroll bar attached to this window, so it shouldn't be deleted at the end of redisplay. */ - redeem_scroll_bar_hook (w); + if (FRAME_TERMINAL (f)->redeem_scroll_bar_hook) + (*FRAME_TERMINAL (f)->redeem_scroll_bar_hook) (w); } /* Restore current_buffer and value of point in it. */ @@ -13944,10 +13966,10 @@ try_window_reusing_current_matrix (w) if (run.height > 0 && run.current_y != run.desired_y) { update_begin (f); - rif->update_window_begin_hook (w); - rif->clear_window_mouse_face (w); - rif->scroll_run_hook (w, &run); - rif->update_window_end_hook (w, 0, 0); + FRAME_RIF (f)->update_window_begin_hook (w); + FRAME_RIF (f)->clear_window_mouse_face (w); + FRAME_RIF (f)->scroll_run_hook (w, &run); + FRAME_RIF (f)->update_window_end_hook (w, 0, 0); update_end (f); } @@ -14116,10 +14138,10 @@ try_window_reusing_current_matrix (w) if (run.height) { update_begin (f); - rif->update_window_begin_hook (w); - rif->clear_window_mouse_face (w); - rif->scroll_run_hook (w, &run); - rif->update_window_end_hook (w, 0, 0); + FRAME_RIF (f)->update_window_begin_hook (w); + FRAME_RIF (f)->clear_window_mouse_face (w); + FRAME_RIF (f)->scroll_run_hook (w, &run); + FRAME_RIF (f)->update_window_end_hook (w, 0, 0); update_end (f); } @@ -14569,7 +14591,7 @@ try_window_id (w) /* Window must either use window-based redisplay or be full width. */ if (!FRAME_WINDOW_P (f) - && (!line_ins_del_ok + && (!FRAME_LINE_INS_DEL_OK (f) || !WINDOW_FULL_WIDTH_P (w))) GIVE_UP (4); @@ -14978,10 +15000,10 @@ try_window_id (w) if (FRAME_WINDOW_P (f)) { - rif->update_window_begin_hook (w); - rif->clear_window_mouse_face (w); - rif->scroll_run_hook (w, &run); - rif->update_window_end_hook (w, 0, 0); + FRAME_RIF (f)->update_window_begin_hook (w); + FRAME_RIF (f)->clear_window_mouse_face (w); + FRAME_RIF (f)->scroll_run_hook (w, &run); + FRAME_RIF (f)->update_window_end_hook (w, 0, 0); } else { @@ -14999,36 +15021,36 @@ try_window_id (w) { /* Scroll last_unchanged_at_beg_row to the end of the window down dvpos lines. */ - set_terminal_window (end); + set_terminal_window (f, end); /* On dumb terminals delete dvpos lines at the end before inserting dvpos empty lines. */ - if (!scroll_region_ok) - ins_del_lines (end - dvpos, -dvpos); + if (!FRAME_SCROLL_REGION_OK (f)) + ins_del_lines (f, end - dvpos, -dvpos); /* Insert dvpos empty lines in front of last_unchanged_at_beg_row. */ - ins_del_lines (from, dvpos); + ins_del_lines (f, from, dvpos); } else if (dvpos < 0) { /* Scroll up last_unchanged_at_beg_vpos to the end of the window to last_unchanged_at_beg_vpos - |dvpos|. */ - set_terminal_window (end); + set_terminal_window (f, end); /* Delete dvpos lines in front of last_unchanged_at_beg_vpos. ins_del_lines will set the cursor to the given vpos and emit |dvpos| delete line sequences. */ - ins_del_lines (from + dvpos, dvpos); + ins_del_lines (f, from + dvpos, dvpos); /* On a dumb terminal insert dvpos empty lines at the end. */ - if (!scroll_region_ok) - ins_del_lines (end + dvpos, -dvpos); + if (!FRAME_SCROLL_REGION_OK (f)) + ins_del_lines (f, end + dvpos, -dvpos); } - set_terminal_window (0); + set_terminal_window (f, 0); } update_end (f); @@ -16602,7 +16624,7 @@ display_menu_bar (w) /* Don't do all this for graphical frames. */ #ifdef HAVE_NTGUI - if (!NILP (Vwindow_system)) + if (FRAME_W32_P (f)) return; #endif #if defined (USE_X_TOOLKIT) || defined (USE_GTK) @@ -16833,10 +16855,10 @@ display_mode_line (w, face_id, format) /* Temporarily make frame's keyboard the current kboard so that kboard-local variables in the mode_line_format will get the right values. */ - push_frame_kboard (it.f); + push_kboard (FRAME_KBOARD (it.f)); record_unwind_save_match_data (); display_mode_element (&it, 0, 0, 0, format, Qnil, 0); - pop_frame_kboard (); + pop_kboard (); unbind_to (count, Qnil); @@ -17551,9 +17573,9 @@ are the selected window and the window's buffer). */) = (NILP (face) ? Qnil : Fcons (Qface, Fcons (face, Qnil))); } - push_frame_kboard (it.f); + push_kboard (FRAME_KBOARD (it.f)); display_mode_element (&it, 0, 0, 0, format, Qnil, 0); - pop_frame_kboard (); + pop_kboard (); if (no_props) { @@ -18704,6 +18726,8 @@ calc_pixel_width_or_height (res, it, prop, font, width_p, align_to) if (NILP (prop)) return OK_PIXELS (0); + xassert (FRAME_LIVE_P (it->f)); + if (SYMBOLP (prop)) { if (SCHARS (SYMBOL_NAME (prop)) == 2) @@ -18820,7 +18844,8 @@ calc_pixel_width_or_height (res, it, prop, font, width_p, align_to) if (SYMBOLP (car)) { #ifdef HAVE_WINDOW_SYSTEM - if (valid_image_p (prop)) + if (FRAME_WINDOW_P (it->f) + && valid_image_p (prop)) { int id = lookup_image (it->f, prop); struct image *img = IMAGE_FROM_ID (it->f, id); @@ -19070,7 +19095,7 @@ get_char_face_and_encoding (f, c, face_id, char2b, multibyte_p, display_p) else STORE_XCHAR2B (char2b, (code >> 8), (code & 0xFF)); /* Maybe encode the character in *CHAR2B. */ - rif->encode_char (c, char2b, font_info, charset, NULL); + FRAME_RIF (f)->encode_char (c, char2b, font_info, charset, NULL); } /* Make sure X resources of the face are allocated. */ @@ -19151,8 +19176,8 @@ get_glyph_face_and_encoding (f, glyph, char2b, two_byte_p) if (CHARSET_ID (charset) != charset_ascii) { glyph->font_type - = rif->encode_char (glyph->u.ch, char2b, font_info, charset, - two_byte_p); + = FRAME_RIF (f)->encode_char (glyph->u.ch, char2b, font_info, + charset, two_byte_p); } } } @@ -19407,7 +19432,8 @@ fill_stretch_glyph_string (s, row, area, start, end) } static XCharStruct * -get_per_char_metric (font, font_info, char2b, font_type) +get_per_char_metric (f, font, font_info, char2b, font_type) + struct frame *f; XFontStruct *font; struct font_info *font_info; XChar2b *char2b; @@ -19433,7 +19459,7 @@ get_per_char_metric (font, font_info, char2b, font_type) return &pcm_value; } #endif /* USE_FONT_BACKEND */ - return rif->per_char_metric (font, char2b, font_type); + return FRAME_RIF (f)->per_char_metric (font, char2b, font_type); } /* EXPORT for RIF: @@ -19461,7 +19487,7 @@ x_get_glyph_overhangs (glyph, f, left, right) font = face->font; font_info = FONT_INFO_FROM_FACE (f, face); if (font /* ++KFS: Should this be font_info ? */ - && (pcm = get_per_char_metric (font, font_info, &char2b, glyph->font_type))) + && (pcm = get_per_char_metric (f, font, font_info, &char2b, glyph->font_type))) { if (pcm->rbearing > pcm->width) *right = pcm->rbearing - pcm->width; @@ -19589,6 +19615,70 @@ right_overwriting (s) } +/* Get face and two-byte form of character C in face FACE_ID on frame + F. The encoding of C is returned in *CHAR2B. MULTIBYTE_P non-zero + means we want to display multibyte text. DISPLAY_P non-zero means + make sure that X resources for the face returned are allocated. + Value is a pointer to a realized face that is ready for display if + DISPLAY_P is non-zero. */ + +static INLINE struct face * +get_char_face_and_encoding (f, c, face_id, char2b, multibyte_p, display_p) + struct frame *f; + int c, face_id; + XChar2b *char2b; + int multibyte_p, display_p; +{ + struct face *face = FACE_FROM_ID (f, face_id); + + if (!multibyte_p) + { + /* Unibyte case. We don't have to encode, but we have to make + sure to use a face suitable for unibyte. */ + STORE_XCHAR2B (char2b, 0, c); + face_id = FACE_FOR_CHAR (f, face, c); + face = FACE_FROM_ID (f, face_id); + } + else if (c < 128) + { + /* Case of ASCII in a face known to fit ASCII. */ + STORE_XCHAR2B (char2b, 0, c); + } + else + { + int c1, c2, charset; + + /* Split characters into bytes. If c2 is -1 afterwards, C is + really a one-byte character so that byte1 is zero. */ + SPLIT_CHAR (c, charset, c1, c2); + if (c2 > 0) + STORE_XCHAR2B (char2b, c1, c2); + else + STORE_XCHAR2B (char2b, 0, c1); + + /* Maybe encode the character in *CHAR2B. */ + if (face->font != NULL) + { + struct font_info *font_info + = FONT_INFO_FROM_ID (f, face->font_info_id); + if (font_info) + FRAME_RIF (f)->encode_char (c, char2b, font_info, 0); + } + } + + /* Make sure X resources of the face are allocated. */ +#ifdef HAVE_X_WINDOWS + if (display_p) +#endif + { + xassert (face != NULL); + PREPARE_FACE_FOR_DISPLAY (f, face); + } + + return face; +} + + /* Set background width of glyph string S. START is the index of the first glyph following S. LAST_X is the right-most x-position + 1 in the drawing area. */ @@ -19635,8 +19725,8 @@ compute_overhangs_and_x (s, x, backward_p) { while (s) { - if (rif->compute_glyph_string_overhangs) - rif->compute_glyph_string_overhangs (s); + if (FRAME_RIF (s->f)->compute_glyph_string_overhangs) + FRAME_RIF (s->f)->compute_glyph_string_overhangs (s); x -= s->width; s->x = x; s = s->prev; @@ -19646,8 +19736,8 @@ compute_overhangs_and_x (s, x, backward_p) { while (s) { - if (rif->compute_glyph_string_overhangs) - rif->compute_glyph_string_overhangs (s); + if (FRAME_RIF (s->f)->compute_glyph_string_overhangs) + FRAME_RIF (s->f)->compute_glyph_string_overhangs (s); s->x = x; x += s->width; s = s->next; @@ -19923,9 +20013,9 @@ draw_glyphs (w, x, row, area, start, end, hl, overlaps) struct glyph_string *h, *t; /* Compute overhangs for all glyph strings. */ - if (rif->compute_glyph_string_overhangs) + if (FRAME_RIF (f)->compute_glyph_string_overhangs) for (s = head; s; s = s->next) - rif->compute_glyph_string_overhangs (s); + FRAME_RIF (f)->compute_glyph_string_overhangs (s); /* Prepend glyph strings for glyphs in front of the first glyph string that are overwritten because of the first glyph @@ -20004,7 +20094,7 @@ draw_glyphs (w, x, row, area, start, end, hl, overlaps) /* Draw all strings. */ for (s = head; s; s = s->next) - rif->draw_glyph_string (s); + FRAME_RIF (f)->draw_glyph_string (s); if (area == TEXT_AREA && !row->full_width_p @@ -20693,20 +20783,20 @@ x_produce_glyphs (it) it->nglyphs = 1; - pcm = get_per_char_metric (font, font_info, &char2b, - FONT_TYPE_FOR_UNIBYTE (font, it->char_to_display)); - - if (it->override_ascent >= 0) - { - it->ascent = it->override_ascent; - it->descent = it->override_descent; - boff = it->override_boff; - } - else - { - it->ascent = FONT_BASE (font) + boff; - it->descent = FONT_DESCENT (font) - boff; - } + pcm = get_per_char_metric (it->f, font, font_info, &char2b, + FONT_TYPE_FOR_UNIBYTE (font, it->char_to_display)); + + if (it->override_ascent >= 0) + { + it->ascent = it->override_ascent; + it->descent = it->override_descent; + boff = it->override_boff; + } + else + { + it->ascent = FONT_BASE (font) + boff; + it->descent = FONT_DESCENT (font) - boff; + } if (pcm) { @@ -20924,8 +21014,8 @@ x_produce_glyphs (it) multiplying the width of font by the width of the character. */ - pcm = get_per_char_metric (font, font_info, &char2b, - FONT_TYPE_FOR_MULTIBYTE (font, it->c)); + pcm = get_per_char_metric (it->f, font, font_info, &char2b, + FONT_TYPE_FOR_MULTIBYTE (font, it->c)); if (font_not_found_p || !pcm) { @@ -21073,7 +21163,7 @@ x_produce_glyphs (it) { get_char_face_and_encoding (it->f, c, it->face_id, &char2b, it->multibyte_p, 0); - pcm = get_per_char_metric (font, font_info, &char2b, + pcm = get_per_char_metric (it->f, font, font_info, &char2b, FONT_TYPE_FOR_MULTIBYTE (font, c)); } @@ -21140,7 +21230,7 @@ x_produce_glyphs (it) this_boff = VCENTER_BASELINE_OFFSET (font, it->f) - boff; get_char_face_and_encoding (it->f, ch, face_id, &char2b, it->multibyte_p, 0); - pcm = get_per_char_metric (font, font_info, &char2b, + pcm = get_per_char_metric (it->f, font, font_info, &char2b, FONT_TYPE_FOR_MULTIBYTE (font, ch)); } @@ -21417,8 +21507,8 @@ x_insert_glyphs (start, len) frame_x = window_box_left (w, updated_area) + output_cursor.x; frame_y = WINDOW_TO_FRAME_PIXEL_Y (w, output_cursor.y); - rif->shift_glyphs_for_insert (f, frame_x, frame_y, shifted_region_width, - line_height, shift_by_width); + FRAME_RIF (f)->shift_glyphs_for_insert (f, frame_x, frame_y, shifted_region_width, + line_height, shift_by_width); /* Write the glyphs. */ hpos = start - row->glyphs[updated_area]; @@ -21500,8 +21590,8 @@ x_clear_end_of_line (to_x) if (to_x > from_x && to_y > from_y) { BLOCK_INPUT; - rif->clear_frame_area (f, from_x, from_y, - to_x - from_x, to_y - from_y); + FRAME_RIF (f)->clear_frame_area (f, from_x, from_y, + to_x - from_x, to_y - from_y); UNBLOCK_INPUT; } } @@ -21644,7 +21734,7 @@ get_window_cursor_type (w, glyph, width, active_cursor) non_selected = 1; } - /* Nonselected window or nonselected frame. */ + /* Detect a nonselected window or nonselected frame. */ else if (w != XWINDOW (f->selected_window) #ifdef HAVE_WINDOW_SYSTEM || f != FRAME_X_DISPLAY_INFO (f)->x_highlight_frame @@ -21663,13 +21753,6 @@ get_window_cursor_type (w, glyph, width, active_cursor) if (NILP (b->cursor_type)) return NO_CURSOR; - /* Use cursor-in-non-selected-windows for non-selected window or frame. */ - if (non_selected) - { - alt_cursor = b->cursor_in_non_selected_windows; - return get_specified_cursor_type (alt_cursor, width); - } - /* Get the normal cursor type for this window. */ if (EQ (b->cursor_type, Qt)) { @@ -21679,6 +21762,21 @@ get_window_cursor_type (w, glyph, width, active_cursor) else cursor_type = get_specified_cursor_type (b->cursor_type, width); + /* Use cursor-in-non-selected-windows instead + for non-selected window or frame. */ + if (non_selected) + { + alt_cursor = b->cursor_in_non_selected_windows; + if (!EQ (Qt, alt_cursor)) + return get_specified_cursor_type (alt_cursor, width); + /* t means modify the normal cursor type. */ + if (cursor_type == FILLED_BOX_CURSOR) + cursor_type = HOLLOW_BOX_CURSOR; + else if (cursor_type == BAR_CURSOR && *width > 1) + --*width; + return cursor_type; + } + /* Use normal cursor if not blinked off. */ if (!w->cursor_off_p) { @@ -22014,7 +22112,7 @@ erase_phys_cursor (w) x = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, max (x, left_x)); if (width > 0) - rif->clear_frame_area (f, x, y, width, cursor_row->visible_height); + FRAME_RIF (f)->clear_frame_area (f, x, y, width, cursor_row->visible_height); } /* Erase the cursor by redrawing the character underneath it. */ @@ -22111,9 +22209,9 @@ display_and_set_cursor (w, on, hpos, vpos, x, y) w->phys_cursor.vpos = vpos; } - rif->draw_window_cursor (w, glyph_row, x, y, - new_cursor_type, new_cursor_width, - on, active_cursor); + FRAME_RIF (f)->draw_window_cursor (w, glyph_row, x, y, + new_cursor_type, new_cursor_width, + on, active_cursor); } @@ -22262,11 +22360,11 @@ show_mouse_face (dpyinfo, draw) /* Change the mouse cursor. */ if (draw == DRAW_NORMAL_TEXT && !EQ (dpyinfo->mouse_face_window, f->tool_bar_window)) - rif->define_frame_cursor (f, FRAME_X_OUTPUT (f)->text_cursor); + FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->text_cursor); else if (draw == DRAW_MOUSE_FACE) - rif->define_frame_cursor (f, FRAME_X_OUTPUT (f)->hand_cursor); + FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->hand_cursor); else - rif->define_frame_cursor (f, FRAME_X_OUTPUT (f)->nontext_cursor); + FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->nontext_cursor); } /* EXPORT: @@ -22705,7 +22803,6 @@ on_hot_spot_p (hot_spot, x, y) return inside; } } - /* If we don't understand the format, pretend we're not in the hot-spot. */ return 0; } @@ -22785,7 +22882,7 @@ define_frame_cursor1 (f, cursor, pointer) } if (cursor != No_Cursor) - rif->define_frame_cursor (f, cursor); + FRAME_RIF (f)->define_frame_cursor (f, cursor); } /* Take proper action when mouse has moved to the mode or header line @@ -23756,8 +23853,8 @@ phys_cursor_in_rect_p (w, r) I assume the effect is the same -- and this is portable. */ return x_intersect_rectangles (&cr, r, &result); } - else - return 0; + /* If we don't understand the format, pretend we're not in the hot-spot. */ + return 0; } @@ -23769,6 +23866,8 @@ void x_draw_vertical_border (w) struct window *w; { + struct frame *f = XFRAME (WINDOW_FRAME (w)); + /* We could do better, if we knew what type of scroll-bar the adjacent windows (on either side) have... But we don't :-( However, I think this works ok. ++KFS 2003-04-25 */ @@ -23789,9 +23888,9 @@ x_draw_vertical_border (w) y1 -= 1; if (WINDOW_LEFT_FRINGE_WIDTH (w) == 0) - x1 -= 1; + x1 -= 1; - rif->draw_vertical_window_border (w, x1, y0, y1); + FRAME_RIF (f)->draw_vertical_window_border (w, x1, y0, y1); } else if (!WINDOW_LEFTMOST_P (w) && !WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w)) @@ -23802,9 +23901,9 @@ x_draw_vertical_border (w) y1 -= 1; if (WINDOW_LEFT_FRINGE_WIDTH (w) == 0) - x0 -= 1; + x0 -= 1; - rif->draw_vertical_window_border (w, x0, y0, y1); + FRAME_RIF (f)->draw_vertical_window_border (w, x0, y0, y1); } } @@ -24500,7 +24599,10 @@ Any other value means to autoselect window instantaneously when the mouse pointer enters it. Autoselection selects the minibuffer only if it is active, and never -unselects the minibuffer if it is active. */); +unselects the minibuffer if it is active. + +When customizing this variable make sure that the actual value of +`focus-follows-mouse' matches the behavior of your window manager. */); Vmouse_autoselect_window = Qnil; DEFVAR_LISP ("auto-resize-tool-bars", &Vauto_resize_tool_bars, diff --git a/src/xfaces.c b/src/xfaces.c index c21d0a1cd50..298e9e52d55 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -197,12 +197,14 @@ Boston, MA 02110-1301, USA. */ #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> +#include <stdio.h> /* This needs to be before termchar.h */ #include "lisp.h" #include "character.h" #include "charset.h" #include "keyboard.h" #include "frame.h" +#include "termhooks.h" #ifdef HAVE_WINDOW_SYSTEM #include "fontset.h" @@ -245,6 +247,7 @@ Boston, MA 02110-1301, USA. */ #include "blockinput.h" #include "window.h" #include "intervals.h" +#include "termchar.h" #ifdef HAVE_WINDOW_SYSTEM #ifdef USE_FONT_BACKEND @@ -273,8 +276,6 @@ Boston, MA 02110-1301, USA. */ #include <ctype.h> -#define abs(X) ((X) < 0 ? -(X) : (X)) - /* Number of pt per inch (from the TeXbook). */ #define PT_PER_INCH 72.27 @@ -751,10 +752,9 @@ x_free_gc (f, gc) struct frame *f; GC gc; { - BLOCK_INPUT; + eassert (interrupt_input_blocked); IF_DEBUG (xassert (--ngcs >= 0)); XFreeGC (FRAME_X_DISPLAY (f), gc); - UNBLOCK_INPUT; } #endif /* HAVE_X_WINDOWS */ @@ -784,10 +784,8 @@ x_free_gc (f, gc) struct frame *f; GC gc; { - BLOCK_INPUT; IF_DEBUG (xassert (--ngcs >= 0)); xfree (gc); - UNBLOCK_INPUT; } #endif /* WINDOWSNT */ @@ -814,10 +812,9 @@ x_free_gc (f, gc) struct frame *f; GC gc; { - BLOCK_INPUT; + eassert (interrupt_input_blocked); IF_DEBUG (xassert (--ngcs >= 0)); XFreeGC (FRAME_MAC_DISPLAY (f), gc); - UNBLOCK_INPUT; } #endif /* MAC_OS */ @@ -1269,8 +1266,10 @@ load_face_font (f, face) face->overstrike = needs_overstrike; if (face->gc) { + BLOCK_INPUT; x_free_gc (f, face->gc); face->gc = 0; + UNBLOCK_INPUT; } } else @@ -3347,6 +3346,22 @@ push_named_merge_point (struct named_merge_point *new_named_merge_point, +#if 0 /* Seems to be unused. */ +static Lisp_Object +internal_resolve_face_name (nargs, args) + int nargs; + Lisp_Object *args; +{ + return Fget (args[0], args[1]); +} + +static Lisp_Object +resolve_face_name_error (ignore) + Lisp_Object ignore; +{ + return Qnil; +} +#endif /* Resolve face name FACE_NAME. If FACE_NAME is a string, intern it to make it a symbol. If FACE_NAME is an alias for another face, @@ -5561,8 +5576,10 @@ free_realized_face (f, face) if (enable_font_backend && face->font_info) font_done_for_face (f, face); #endif /* USE_FONT_BACKEND */ + BLOCK_INPUT; x_free_gc (f, face->gc); face->gc = 0; + UNBLOCK_INPUT; } free_face_colors (f, face); @@ -5734,8 +5751,10 @@ clear_face_gcs (c) if (enable_font_backend && face->font_info) font_done_for_face (c->f, face); #endif /* USE_FONT_BACKEND */ + BLOCK_INPUT; x_free_gc (c->f, face->gc); face->gc = 0; + UNBLOCK_INPUT; } } #endif /* HAVE_WINDOW_SYSTEM */ @@ -6470,7 +6489,7 @@ tty_supports_face_attributes_p (f, attrs, def_face) val = attrs[LFACE_INVERSE_INDEX]; if (!UNSPECIFIEDP (val)) { - if (face_attr_equal_p (val, def_attrs[LFACE_UNDERLINE_INDEX])) + if (face_attr_equal_p (val, def_attrs[LFACE_INVERSE_INDEX])) return 0; /* same as default */ else test_caps |= TTY_CAP_INVERSE; @@ -6513,7 +6532,7 @@ tty_supports_face_attributes_p (f, attrs, def_face) bg = attrs[LFACE_BACKGROUND_INDEX]; if (STRINGP (bg)) { - Lisp_Object def_bg = def_attrs[LFACE_FOREGROUND_INDEX]; + Lisp_Object def_bg = def_attrs[LFACE_BACKGROUND_INDEX]; if (face_attr_equal_p (bg, def_bg)) return 0; /* same as default */ @@ -6551,7 +6570,7 @@ tty_supports_face_attributes_p (f, attrs, def_face) /* See if the capabilities we selected above are supported, with the given colors. */ if (test_caps != 0 && - ! tty_capable_p (f, test_caps, fg_tty_color.pixel, bg_tty_color.pixel)) + ! tty_capable_p (FRAME_TTY (f), test_caps, fg_tty_color.pixel, bg_tty_color.pixel)) return 0; @@ -7394,7 +7413,8 @@ realize_basic_faces (f) { FRAME_FACE_CACHE (f)->menu_face_changed_p = 0; #ifdef USE_X_TOOLKIT - x_update_menu_appearance (f); + if (FRAME_WINDOW_P (f)) + x_update_menu_appearance (f); #endif } @@ -7496,7 +7516,7 @@ realize_default_face (f) LFACE_FOREGROUND (lface) = XCDR (color); else if (FRAME_WINDOW_P (f)) return 0; - else if (FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f)) + else if (FRAME_INITIAL_P (f) || FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f)) LFACE_FOREGROUND (lface) = build_string (unspecified_fg); else abort (); @@ -7511,7 +7531,7 @@ realize_default_face (f) LFACE_BACKGROUND (lface) = XCDR (color); else if (FRAME_WINDOW_P (f)) return 0; - else if (FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f)) + else if (FRAME_INITIAL_P (f) || FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f)) LFACE_BACKGROUND (lface) = build_string (unspecified_bg); else abort (); @@ -7528,17 +7548,17 @@ realize_default_face (f) #ifdef HAVE_WINDOW_SYSTEM #ifdef HAVE_X_WINDOWS - if (face->font != FRAME_FONT (f)) + if (FRAME_X_P (f) && face->font != FRAME_FONT (f)) { /* This can happen when making a frame on a display that does - not support the default font. */ + not support the default font. */ if (!face->font) - return 0; - + return 0; + /* Otherwise, the font specified for the frame was not - acceptable as a font for the default face (perhaps because - auto-scaled fonts are rejected), so we must adjust the frame - font. */ + acceptable as a font for the default face (perhaps because + auto-scaled fonts are rejected), so we must adjust the frame + font. */ x_set_font (f, build_string (face->font_name), Qnil); } #endif /* HAVE_X_WINDOWS */ @@ -7614,6 +7634,11 @@ realize_face (cache, attrs, former_face_id) face = realize_x_face (cache, attrs); else if (FRAME_TERMCAP_P (cache->f) || FRAME_MSDOS_P (cache->f)) face = realize_tty_face (cache, attrs); + else if (FRAME_INITIAL_P (cache->f)) + { + /* Create a dummy face. */ + face = make_realized_face (attrs); + } else abort (); diff --git a/src/xfns.c b/src/xfns.c index 52cbd758d88..54d637d859b 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -48,6 +48,7 @@ Boston, MA 02110-1301, USA. */ #include "systime.h" #include "termhooks.h" #include "atimer.h" +#include "termchar.h" #ifdef USE_FONT_BACKEND #include "font.h" @@ -260,17 +261,18 @@ check_x_frame (frame) return f; } -/* Let the user specify an X display with a frame. +/* Let the user specify an X display with a Lisp object. + OBJECT may be nil, a frame or a terminal id. nil stands for the selected frame--or, if that is not an X frame, the first X display on the list. */ struct x_display_info * -check_x_display_info (frame) - Lisp_Object frame; +check_x_display_info (object) + Lisp_Object object; { struct x_display_info *dpyinfo = NULL; - if (NILP (frame)) + if (NILP (object)) { struct frame *sf = XFRAME (selected_frame); @@ -281,11 +283,20 @@ check_x_display_info (frame) else error ("X windows are not in use or not initialized"); } - else if (STRINGP (frame)) - dpyinfo = x_display_info_for_name (frame); + else if (INTEGERP (object)) + { + struct terminal *t = get_terminal (object, 1); + + if (t->type != output_x_window) + error ("Terminal %d is not an X display", XINT (object)); + + dpyinfo = t->display_info.x; + } + else if (STRINGP (object)) + dpyinfo = x_display_info_for_name (object); else { - FRAME_PTR f = check_x_frame (frame); + FRAME_PTR f = check_x_frame (object); dpyinfo = FRAME_X_DISPLAY_INFO (f); } @@ -868,8 +879,8 @@ x_set_foreground_color (f, arg, oldval) unsigned long fg, old_fg; fg = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f)); - old_fg = x->foreground_pixel; - x->foreground_pixel = fg; + old_fg = FRAME_FOREGROUND_PIXEL (f); + FRAME_FOREGROUND_PIXEL (f) = fg; if (FRAME_X_WINDOW (f) != 0) { @@ -906,8 +917,8 @@ x_set_background_color (f, arg, oldval) unsigned long bg; bg = x_decode_color (f, arg, WHITE_PIX_DEFAULT (f)); - unload_color (f, x->background_pixel); - x->background_pixel = bg; + unload_color (f, FRAME_BACKGROUND_PIXEL (f)); + FRAME_BACKGROUND_PIXEL (f) = bg; if (FRAME_X_WINDOW (f) != 0) { @@ -955,13 +966,13 @@ x_set_mouse_color (f, arg, oldval) Cursor cursor, nontext_cursor, mode_cursor, hand_cursor; Cursor hourglass_cursor, horizontal_drag_cursor; unsigned long pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f)); - unsigned long mask_color = x->background_pixel; + unsigned long mask_color = FRAME_BACKGROUND_PIXEL (f); /* Don't let pointers be invisible. */ if (mask_color == pixel) { x_free_colors (f, &pixel, 1); - pixel = x_copy_color (f, x->foreground_pixel); + pixel = x_copy_color (f, FRAME_FOREGROUND_PIXEL (f)); } unload_color (f, x->mouse_pixel); @@ -1104,13 +1115,13 @@ x_set_cursor_color (f, arg, oldval) fore_pixel_allocated_p = 1; } else - fore_pixel = x->background_pixel; + fore_pixel = FRAME_BACKGROUND_PIXEL (f); pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f)); pixel_allocated_p = 1; /* Make sure that the cursor color differs from the background color. */ - if (pixel == x->background_pixel) + if (pixel == FRAME_BACKGROUND_PIXEL (f)) { if (pixel_allocated_p) { @@ -1126,7 +1137,7 @@ x_set_cursor_color (f, arg, oldval) x_free_colors (f, &fore_pixel, 1); fore_pixel_allocated_p = 0; } - fore_pixel = x->background_pixel; + fore_pixel = FRAME_BACKGROUND_PIXEL (f); } } @@ -1411,10 +1422,8 @@ x_set_tool_bar_lines (f, value, oldval) below the menu bar. */ if (FRAME_X_WINDOW (f) && FRAME_TOOL_BAR_LINES (f) == 0) { - updating_frame = f; - clear_frame (); + clear_frame (f); clear_current_matrices (f); - updating_frame = NULL; } /* If the tool bar gets smaller, the internal border below it @@ -1465,10 +1474,10 @@ x_set_scroll_bar_foreground (f, value, oldval) if (FRAME_X_WINDOW (f) && FRAME_VISIBLE_P (f)) { /* Remove all scroll bars because they have wrong colors. */ - if (condemn_scroll_bars_hook) - (*condemn_scroll_bars_hook) (f); - if (judge_scroll_bars_hook) - (*judge_scroll_bars_hook) (f); + if (FRAME_TERMINAL (f)->condemn_scroll_bars_hook) + (*FRAME_TERMINAL (f)->condemn_scroll_bars_hook) (f); + if (FRAME_TERMINAL (f)->judge_scroll_bars_hook) + (*FRAME_TERMINAL (f)->judge_scroll_bars_hook) (f); update_face_from_frame_parameter (f, Qscroll_bar_foreground, value); redraw_frame (f); @@ -1514,10 +1523,10 @@ x_set_scroll_bar_background (f, value, oldval) if (FRAME_X_WINDOW (f) && FRAME_VISIBLE_P (f)) { /* Remove all scroll bars because they have wrong colors. */ - if (condemn_scroll_bars_hook) - (*condemn_scroll_bars_hook) (f); - if (judge_scroll_bars_hook) - (*judge_scroll_bars_hook) (f); + if (FRAME_TERMINAL (f)->condemn_scroll_bars_hook) + (*FRAME_TERMINAL (f)->condemn_scroll_bars_hook) (f); + if (FRAME_TERMINAL (f)->judge_scroll_bars_hook) + (*FRAME_TERMINAL (f)->judge_scroll_bars_hook) (f); update_face_from_frame_parameter (f, Qscroll_bar_background, value); redraw_frame (f); @@ -2875,7 +2884,7 @@ x_window (f) XSetWindowAttributes attributes; unsigned long attribute_mask; - attributes.background_pixel = f->output_data.x->background_pixel; + attributes.background_pixel = FRAME_BACKGROUND_PIXEL (f); attributes.border_pixel = f->output_data.x->border_pixel; attributes.bit_gravity = StaticGravity; attributes.backing_store = NotUseful; @@ -3002,7 +3011,9 @@ x_icon (f, parms) Lisp_Object parms; { Lisp_Object icon_x, icon_y; +#if 0 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); +#endif /* Set the position of the icon. Note that twm groups all icons in an icon window. */ @@ -3063,8 +3074,8 @@ x_make_gc (f) /* Normal video */ gc_values.font = FRAME_FONT (f)->fid; - gc_values.foreground = f->output_data.x->foreground_pixel; - gc_values.background = f->output_data.x->background_pixel; + gc_values.foreground = FRAME_FOREGROUND_PIXEL (f); + gc_values.background = FRAME_BACKGROUND_PIXEL (f); gc_values.line_width = 0; /* Means 1 using fast algorithm. */ f->output_data.x->normal_gc = XCreateGC (FRAME_X_DISPLAY (f), @@ -3073,8 +3084,8 @@ x_make_gc (f) &gc_values); /* Reverse video style. */ - gc_values.foreground = f->output_data.x->background_pixel; - gc_values.background = f->output_data.x->foreground_pixel; + gc_values.foreground = FRAME_BACKGROUND_PIXEL (f); + gc_values.background = FRAME_FOREGROUND_PIXEL (f); f->output_data.x->reverse_gc = XCreateGC (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), @@ -3082,7 +3093,7 @@ x_make_gc (f) &gc_values); /* Cursor has cursor-color background, background-color foreground. */ - gc_values.foreground = f->output_data.x->background_pixel; + gc_values.foreground = FRAME_BACKGROUND_PIXEL (f); gc_values.background = f->output_data.x->cursor_pixel; gc_values.fill_style = FillOpaqueStippled; gc_values.stipple @@ -3106,8 +3117,8 @@ x_make_gc (f) = (XCreatePixmapFromBitmapData (FRAME_X_DISPLAY (f), FRAME_X_DISPLAY_INFO (f)->root_window, gray_bits, gray_width, gray_height, - f->output_data.x->foreground_pixel, - f->output_data.x->background_pixel, + FRAME_FOREGROUND_PIXEL (f), + FRAME_BACKGROUND_PIXEL (f), DefaultDepth (FRAME_X_DISPLAY (f), FRAME_X_SCREEN_NUMBER (f)))); UNBLOCK_INPUT; @@ -3162,6 +3173,12 @@ unwind_create_frame (frame) { struct frame *f = XFRAME (frame); + /* If frame is already dead, nothing to do. This can happen if the + display is disconnected after the frame has become official, but + before x_create_frame removes the unwind protect. */ + if (!FRAME_LIVE_P (f)) + return Qnil; + /* If frame is ``official'', nothing to do. */ if (!CONSP (Vframe_list) || !EQ (XCAR (Vframe_list), frame)) { @@ -3248,24 +3265,27 @@ This function is an internal primitive--use `make-frame' instead. */) Lisp_Object parent; struct kboard *kb; - check_x (); - parms = Fcopy_alist (parms); /* Use this general default value to start with until we know if this frame has a specified name. */ Vx_resource_name = Vinvocation_name; - display = x_get_arg (dpyinfo, parms, Qdisplay, 0, 0, RES_TYPE_STRING); + display = x_get_arg (dpyinfo, parms, Qterminal, 0, 0, RES_TYPE_NUMBER); + if (EQ (display, Qunbound)) + display = x_get_arg (dpyinfo, parms, Qdisplay, 0, 0, RES_TYPE_STRING); if (EQ (display, Qunbound)) display = Qnil; dpyinfo = check_x_display_info (display); #ifdef MULTI_KBOARD - kb = dpyinfo->kboard; + kb = dpyinfo->terminal->kboard; #else kb = &the_only_kboard; #endif + if (!dpyinfo->terminal->name) + error ("Terminal is not live, can't create new frames on it"); + name = x_get_arg (dpyinfo, parms, Qname, "name", "Name", RES_TYPE_STRING); if (!STRINGP (name) && ! EQ (name, Qunbound) @@ -3306,6 +3326,9 @@ This function is an internal primitive--use `make-frame' instead. */) /* Note that X Windows does support scroll bars. */ FRAME_CAN_HAVE_SCROLL_BARS (f) = 1; + f->terminal = dpyinfo->terminal; + f->terminal->reference_count++; + f->output_method = output_x_window; f->output_data.x = (struct x_output *) xmalloc (sizeof (struct x_output)); bzero (f->output_data.x, sizeof (struct x_output)); @@ -3332,9 +3355,6 @@ This function is an internal primitive--use `make-frame' instead. */) image_cache_refcount = FRAME_X_IMAGE_CACHE (f)->refcount; dpyinfo_refcount = dpyinfo->reference_count; #endif /* GLYPH_DEBUG */ -#ifdef MULTI_KBOARD - FRAME_KBOARD (f) = kb; -#endif /* These colors will be set anyway later, but it's important to get the color reference counts right, so initialize them! */ @@ -3345,8 +3365,8 @@ This function is an internal primitive--use `make-frame' instead. */) /* Function x_decode_color can signal an error. Make sure to initialize color slots so that we won't try to free colors we haven't allocated. */ - f->output_data.x->foreground_pixel = -1; - f->output_data.x->background_pixel = -1; + FRAME_FOREGROUND_PIXEL (f) = -1; + FRAME_BACKGROUND_PIXEL (f) = -1; f->output_data.x->cursor_pixel = -1; f->output_data.x->cursor_foreground_pixel = -1; f->output_data.x->border_pixel = -1; @@ -3354,9 +3374,9 @@ This function is an internal primitive--use `make-frame' instead. */) black = build_string ("black"); GCPRO1 (black); - f->output_data.x->foreground_pixel + FRAME_FOREGROUND_PIXEL (f) = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); - f->output_data.x->background_pixel + FRAME_BACKGROUND_PIXEL (f) = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); f->output_data.x->cursor_pixel = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); @@ -3655,7 +3675,7 @@ else } /* Initialize `default-minibuffer-frame' in case this is the first - frame on this display device. */ + frame on this terminal. */ if (FRAME_HAS_MINIBUF_P (f) && (!FRAMEP (kb->Vdefault_minibuffer_frame) || !FRAME_LIVE_P (XFRAME (kb->Vdefault_minibuffer_frame)))) @@ -3667,6 +3687,8 @@ else if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem)))) f->param_alist = Fcons (XCAR (tem), f->param_alist); + store_frame_param (f, Qwindow_system, Qx); + UNGCPRO; /* Make sure windows on this frame appear in calls to next-window @@ -3761,10 +3783,10 @@ DEFUN ("xw-color-values", Fxw_color_values, Sxw_color_values, 1, 2, 0, DEFUN ("xw-display-color-p", Fxw_display_color_p, Sxw_display_color_p, 0, 1, 0, doc: /* Internal function called by `display-color-p', which see. */) - (display) - Lisp_Object display; + (terminal) + Lisp_Object terminal; { - struct x_display_info *dpyinfo = check_x_display_info (display); + struct x_display_info *dpyinfo = check_x_display_info (terminal); if (dpyinfo->n_planes <= 2) return Qnil; @@ -3786,13 +3808,13 @@ DEFUN ("x-display-grayscale-p", Fx_display_grayscale_p, Sx_display_grayscale_p, 0, 1, 0, doc: /* Return t if the X display supports shades of gray. Note that color displays do support shades of gray. -The optional argument DISPLAY specifies which display to ask about. -DISPLAY should be either a frame or a display name (a string). +The optional argument TERMINAL specifies which display to ask about. +TERMINAL should be a terminal id, a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) - Lisp_Object display; + (terminal) + Lisp_Object terminal; { - struct x_display_info *dpyinfo = check_x_display_info (display); + struct x_display_info *dpyinfo = check_x_display_info (terminal); if (dpyinfo->n_planes <= 1) return Qnil; @@ -3814,56 +3836,56 @@ If omitted or nil, that stands for the selected frame's display. */) DEFUN ("x-display-pixel-width", Fx_display_pixel_width, Sx_display_pixel_width, 0, 1, 0, - doc: /* Returns the width in pixels of the X display DISPLAY. -The optional argument DISPLAY specifies which display to ask about. -DISPLAY should be either a frame or a display name (a string). + doc: /* Returns the width in pixels of the X display TERMINAL. +The optional argument TERMINAL specifies which display to ask about. +TERMINAL should be a terminal id, a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) - Lisp_Object display; + (terminal) + Lisp_Object terminal; { - struct x_display_info *dpyinfo = check_x_display_info (display); + struct x_display_info *dpyinfo = check_x_display_info (terminal); return make_number (dpyinfo->width); } DEFUN ("x-display-pixel-height", Fx_display_pixel_height, Sx_display_pixel_height, 0, 1, 0, - doc: /* Returns the height in pixels of the X display DISPLAY. -The optional argument DISPLAY specifies which display to ask about. -DISPLAY should be either a frame or a display name (a string). + doc: /* Returns the height in pixels of the X display TERMINAL. +The optional argument TERMINAL specifies which display to ask about. +TERMINAL should be a terminal id, a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) - Lisp_Object display; + (terminal) + Lisp_Object terminal; { - struct x_display_info *dpyinfo = check_x_display_info (display); + struct x_display_info *dpyinfo = check_x_display_info (terminal); return make_number (dpyinfo->height); } DEFUN ("x-display-planes", Fx_display_planes, Sx_display_planes, 0, 1, 0, - doc: /* Returns the number of bitplanes of the X display DISPLAY. -The optional argument DISPLAY specifies which display to ask about. -DISPLAY should be either a frame or a display name (a string). + doc: /* Returns the number of bitplanes of the X display TERMINAL. +The optional argument TERMINAL specifies which display to ask about. +TERMINAL should be a terminal id, a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) - Lisp_Object display; + (terminal) + Lisp_Object terminal; { - struct x_display_info *dpyinfo = check_x_display_info (display); + struct x_display_info *dpyinfo = check_x_display_info (terminal); return make_number (dpyinfo->n_planes); } DEFUN ("x-display-color-cells", Fx_display_color_cells, Sx_display_color_cells, 0, 1, 0, - doc: /* Returns the number of color cells of the X display DISPLAY. -The optional argument DISPLAY specifies which display to ask about. -DISPLAY should be either a frame or a display name (a string). + doc: /* Returns the number of color cells of the X display TERMINAL. +The optional argument TERMINAL specifies which display to ask about. +TERMINAL should be a terminal id, a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) - Lisp_Object display; + (terminal) + Lisp_Object terminal; { - struct x_display_info *dpyinfo = check_x_display_info (display); + struct x_display_info *dpyinfo = check_x_display_info (terminal); int nr_planes = DisplayPlanes (dpyinfo->display, XScreenNumberOfScreen (dpyinfo->screen)); @@ -3881,29 +3903,29 @@ If omitted or nil, that stands for the selected frame's display. */) DEFUN ("x-server-max-request-size", Fx_server_max_request_size, Sx_server_max_request_size, 0, 1, 0, - doc: /* Returns the maximum request size of the X server of display DISPLAY. -The optional argument DISPLAY specifies which display to ask about. -DISPLAY should be either a frame or a display name (a string). + doc: /* Returns the maximum request size of the X server of display TERMINAL. +The optional argument TERMINAL specifies which display to ask about. +TERMINAL should be a terminal id, a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) - Lisp_Object display; + (terminal) + Lisp_Object terminal; { - struct x_display_info *dpyinfo = check_x_display_info (display); + struct x_display_info *dpyinfo = check_x_display_info (terminal); return make_number (MAXREQUEST (dpyinfo->display)); } DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0, - doc: /* Returns the "vendor ID" string of the X server of display DISPLAY. + doc: /* Returns the "vendor ID" string of the X server of display TERMINAL. \(Labelling every distributor as a "vendor" embodies the false assumption that operating systems cannot be developed and distributed noncommercially.) -The optional argument DISPLAY specifies which display to ask about. -DISPLAY should be either a frame or a display name (a string). +The optional argument TERMINAL specifies which display to ask about. +TERMINAL should be a terminal id, a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) - Lisp_Object display; + (terminal) + Lisp_Object terminal; { - struct x_display_info *dpyinfo = check_x_display_info (display); + struct x_display_info *dpyinfo = check_x_display_info (terminal); char *vendor = ServerVendor (dpyinfo->display); if (! vendor) vendor = ""; @@ -3911,18 +3933,18 @@ If omitted or nil, that stands for the selected frame's display. */) } DEFUN ("x-server-version", Fx_server_version, Sx_server_version, 0, 1, 0, - doc: /* Returns the version numbers of the X server of display DISPLAY. + doc: /* Returns the version numbers of the X server of display TERMINAL. The value is a list of three integers: the major and minor version numbers of the X Protocol in use, and the distributor-specific release number. See also the function `x-server-vendor'. -The optional argument DISPLAY specifies which display to ask about. -DISPLAY should be either a frame or a display name (a string). +The optional argument TERMINAL specifies which display to ask about. +TERMINAL should be a terminal id, a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) - Lisp_Object display; + (terminal) + Lisp_Object terminal; { - struct x_display_info *dpyinfo = check_x_display_info (display); + struct x_display_info *dpyinfo = check_x_display_info (terminal); Display *dpy = dpyinfo->display; return Fcons (make_number (ProtocolVersion (dpy)), @@ -3931,55 +3953,55 @@ If omitted or nil, that stands for the selected frame's display. */) } DEFUN ("x-display-screens", Fx_display_screens, Sx_display_screens, 0, 1, 0, - doc: /* Return the number of screens on the X server of display DISPLAY. -The optional argument DISPLAY specifies which display to ask about. -DISPLAY should be either a frame or a display name (a string). + doc: /* Return the number of screens on the X server of display TERMINAL. +The optional argument TERMINAL specifies which display to ask about. +TERMINAL should be a terminal id, a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) - Lisp_Object display; + (terminal) + Lisp_Object terminal; { - struct x_display_info *dpyinfo = check_x_display_info (display); + struct x_display_info *dpyinfo = check_x_display_info (terminal); return make_number (ScreenCount (dpyinfo->display)); } DEFUN ("x-display-mm-height", Fx_display_mm_height, Sx_display_mm_height, 0, 1, 0, - doc: /* Return the height in millimeters of the X display DISPLAY. -The optional argument DISPLAY specifies which display to ask about. -DISPLAY should be either a frame or a display name (a string). + doc: /* Return the height in millimeters of the X display TERMINAL. +The optional argument TERMINAL specifies which display to ask about. +TERMINAL should be a terminal id, a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) - Lisp_Object display; + (terminal) + Lisp_Object terminal; { - struct x_display_info *dpyinfo = check_x_display_info (display); + struct x_display_info *dpyinfo = check_x_display_info (terminal); return make_number (HeightMMOfScreen (dpyinfo->screen)); } DEFUN ("x-display-mm-width", Fx_display_mm_width, Sx_display_mm_width, 0, 1, 0, - doc: /* Return the width in millimeters of the X display DISPLAY. -The optional argument DISPLAY specifies which display to ask about. -DISPLAY should be either a frame or a display name (a string). + doc: /* Return the width in millimeters of the X display TERMINAL. +The optional argument TERMINAL specifies which display to ask about. +TERMINAL should be a terminal id, a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) - Lisp_Object display; + (terminal) + Lisp_Object terminal; { - struct x_display_info *dpyinfo = check_x_display_info (display); + struct x_display_info *dpyinfo = check_x_display_info (terminal); return make_number (WidthMMOfScreen (dpyinfo->screen)); } DEFUN ("x-display-backing-store", Fx_display_backing_store, Sx_display_backing_store, 0, 1, 0, - doc: /* Returns an indication of whether X display DISPLAY does backing store. + doc: /* Returns an indication of whether X display TERMINAL does backing store. The value may be `always', `when-mapped', or `not-useful'. -The optional argument DISPLAY specifies which display to ask about. -DISPLAY should be either a frame or a display name (a string). +The optional argument TERMINAL specifies which display to ask about. +TERMINAL should be a terminal id, a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) - Lisp_Object display; + (terminal) + Lisp_Object terminal; { - struct x_display_info *dpyinfo = check_x_display_info (display); + struct x_display_info *dpyinfo = check_x_display_info (terminal); Lisp_Object result; switch (DoesBackingStore (dpyinfo->screen)) @@ -4006,17 +4028,17 @@ If omitted or nil, that stands for the selected frame's display. */) DEFUN ("x-display-visual-class", Fx_display_visual_class, Sx_display_visual_class, 0, 1, 0, - doc: /* Return the visual class of the X display DISPLAY. + doc: /* Return the visual class of the X display TERMINAL. The value is one of the symbols `static-gray', `gray-scale', `static-color', `pseudo-color', `true-color', or `direct-color'. -The optional argument DISPLAY specifies which display to ask about. -DISPLAY should be either a frame or a display name (a string). +The optional argument TERMINAL specifies which display to ask about. +TERMINAL should a terminal id, a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) - Lisp_Object display; + (terminal) + Lisp_Object terminal; { - struct x_display_info *dpyinfo = check_x_display_info (display); + struct x_display_info *dpyinfo = check_x_display_info (terminal); Lisp_Object result; switch (dpyinfo->visual->class) @@ -4049,14 +4071,14 @@ If omitted or nil, that stands for the selected frame's display. */) DEFUN ("x-display-save-under", Fx_display_save_under, Sx_display_save_under, 0, 1, 0, - doc: /* Returns t if the X display DISPLAY supports the save-under feature. -The optional argument DISPLAY specifies which display to ask about. -DISPLAY should be either a frame or a display name (a string). + doc: /* Returns t if the X display TERMINAL supports the save-under feature. +The optional argument TERMINAL specifies which display to ask about. +TERMINAL should be a terminal id, a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) - Lisp_Object display; + (terminal) + Lisp_Object terminal; { - struct x_display_info *dpyinfo = check_x_display_info (display); + struct x_display_info *dpyinfo = check_x_display_info (terminal); if (DoesSaveUnders (dpyinfo->screen) == True) return Qt; @@ -4237,8 +4259,10 @@ x_display_info_for_name (name) CHECK_STRING (name); - if (! EQ (Vwindow_system, intern ("x"))) - error ("Not using X Windows"); +#if 0 + if (! EQ (Vinitial_window_system, intern ("x"))) + error ("Not using X Windows"); /* That doesn't stop us anymore. */ +#endif for (dpyinfo = x_display_list, names = x_display_name_list; dpyinfo; @@ -4285,8 +4309,10 @@ terminate Emacs if we can't open the connection. */) if (! NILP (xrm_string)) CHECK_STRING (xrm_string); - if (! EQ (Vwindow_system, intern ("x"))) - error ("Not using X Windows"); +#if 0 + if (! EQ (Vinitial_window_system, intern ("x"))) + error ("Not using X Windows"); /* That doesn't stop us anymore. */ +#endif if (! NILP (xrm_string)) xrm_option = (unsigned char *) SDATA (xrm_string); @@ -4321,41 +4347,19 @@ An insecure way to solve the problem may be to use `xhost'.\n", DEFUN ("x-close-connection", Fx_close_connection, Sx_close_connection, 1, 1, 0, - doc: /* Close the connection to DISPLAY's X server. -For DISPLAY, specify either a frame or a display name (a string). -If DISPLAY is nil, that stands for the selected frame's display. */) - (display) - Lisp_Object display; + doc: /* Close the connection to TERMINAL's X server. +For TERMINAL, specify a terminal id, a frame or a display name (a +string). If TERMINAL is nil, that stands for the selected frame's +terminal. */) + (terminal) + Lisp_Object terminal; { - struct x_display_info *dpyinfo = check_x_display_info (display); - int i; + struct x_display_info *dpyinfo = check_x_display_info (terminal); if (dpyinfo->reference_count > 0) error ("Display still has frames on it"); - BLOCK_INPUT; - /* Free the fonts in the font table. */ - for (i = 0; i < dpyinfo->n_fonts; i++) - if (dpyinfo->font_table[i].name) - { - XFreeFont (dpyinfo->display, dpyinfo->font_table[i].font); - } - - x_destroy_all_bitmaps (dpyinfo); - XSetCloseDownMode (dpyinfo->display, DestroyAll); - -#ifdef USE_GTK - xg_display_close (dpyinfo->display); -#else -#ifdef USE_X_TOOLKIT - XtCloseDisplay (dpyinfo->display); -#else - XCloseDisplay (dpyinfo->display); -#endif -#endif /* ! USE_GTK */ - - x_delete_display (dpyinfo); - UNBLOCK_INPUT; + x_delete_terminal (dpyinfo->terminal); return Qnil; } @@ -4379,13 +4383,13 @@ If ON is nil, allow buffering of requests. Turning on synchronization prohibits the Xlib routines from buffering requests and seriously degrades performance, but makes debugging much easier. -The optional second argument DISPLAY specifies which display to act on. -DISPLAY should be either a frame or a display name (a string). -If DISPLAY is omitted or nil, that stands for the selected frame's display. */) - (on, display) - Lisp_Object display, on; +The optional second argument TERMINAL specifies which display to act on. +TERMINAL should be a terminal id, a frame or a display name (a string). +If TERMINAL is omitted or nil, that stands for the selected frame's display. */) + (on, terminal) + Lisp_Object terminal, on; { - struct x_display_info *dpyinfo = check_x_display_info (display); + struct x_display_info *dpyinfo = check_x_display_info (terminal); XSynchronize (dpyinfo->display, !EQ (on, Qnil)); @@ -4689,10 +4693,6 @@ start_hourglass () EMACS_TIME delay; int secs, usecs = 0; - /* Don't bother for ttys. */ - if (NILP (Vwindow_system)) - return; - cancel_hourglass (); if (INTEGERP (Vhourglass_delay) @@ -4904,20 +4904,16 @@ x_create_tip_frame (dpyinfo, parms, text) int width, height; int count = SPECPDL_INDEX (); struct gcpro gcpro1, gcpro2, gcpro3; - struct kboard *kb; int face_change_count_before = face_change_count; Lisp_Object buffer; struct buffer *old_buffer; check_x (); - parms = Fcopy_alist (parms); + if (!dpyinfo->terminal->name) + error ("Terminal is not live, can't create new frames on it"); -#ifdef MULTI_KBOARD - kb = dpyinfo->kboard; -#else - kb = &the_only_kboard; -#endif + parms = Fcopy_alist (parms); /* Get the name of the frame to use for resource lookup. */ name = x_get_arg (dpyinfo, parms, Qname, "name", "Name", RES_TYPE_STRING); @@ -4945,6 +4941,9 @@ x_create_tip_frame (dpyinfo, parms, text) FRAME_CAN_HAVE_SCROLL_BARS (f) = 0; record_unwind_protect (unwind_create_tip_frame, frame); + f->terminal = dpyinfo->terminal; + f->terminal->reference_count++; + /* By setting the output method, we're essentially saying that the frame is live, as per FRAME_LIVE_P. If we get a signal from this point on, x_destroy_window might screw up reference @@ -4966,9 +4965,6 @@ x_create_tip_frame (dpyinfo, parms, text) image_cache_refcount = FRAME_X_IMAGE_CACHE (f)->refcount; dpyinfo_refcount = dpyinfo->reference_count; #endif /* GLYPH_DEBUG */ -#ifdef MULTI_KBOARD - FRAME_KBOARD (f) = kb; -#endif f->output_data.x->parent_desc = FRAME_X_DISPLAY_INFO (f)->root_window; f->output_data.x->explicit_parent = 0; @@ -4978,11 +4974,21 @@ x_create_tip_frame (dpyinfo, parms, text) Lisp_Object black; struct gcpro gcpro1; + /* Function x_decode_color can signal an error. Make + sure to initialize color slots so that we won't try + to free colors we haven't allocated. */ + FRAME_FOREGROUND_PIXEL (f) = -1; + FRAME_BACKGROUND_PIXEL (f) = -1; + f->output_data.x->cursor_pixel = -1; + f->output_data.x->cursor_foreground_pixel = -1; + f->output_data.x->border_pixel = -1; + f->output_data.x->mouse_pixel = -1; + black = build_string ("black"); GCPRO1 (black); - f->output_data.x->foreground_pixel + FRAME_FOREGROUND_PIXEL (f) = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); - f->output_data.x->background_pixel + FRAME_BACKGROUND_PIXEL (f) = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); f->output_data.x->cursor_pixel = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); @@ -5194,6 +5200,8 @@ else Qnil)); } + Fmodify_frame_parameters (frame, Fcons (Fcons (Qwindow_system, Qx), Qnil)); + f->no_split = 1; UNGCPRO; diff --git a/src/xmenu.c b/src/xmenu.c index d4973243787..4e7f07c375a 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -41,10 +41,10 @@ Boston, MA 02110-1301, USA. */ #include <stdio.h> #include "lisp.h" -#include "termhooks.h" #include "keyboard.h" #include "keymap.h" #include "frame.h" +#include "termhooks.h" #include "window.h" #include "blockinput.h" #include "buffer.h" @@ -745,6 +745,9 @@ mouse_position_for_popup (f, x, y) Window root, dummy_window; int dummy; + if (! FRAME_X_P (f)) + abort (); + BLOCK_INPUT; XQueryPointer (FRAME_X_DISPLAY (f), @@ -940,6 +943,9 @@ no quit occurs and `x-popup-menu' returns nil. */) xpos += XINT (x); ypos += XINT (y); + if (! FRAME_X_P (f)) + error ("Can not put X menu on non-X terminal"); + XSETFRAME (Vmenu_updating_frame, f); } else @@ -1128,6 +1134,9 @@ for instance using the window manager, then this produces a quit and but I don't want to make one now. */ CHECK_WINDOW (window); + if (! FRAME_X_P (f)) + error ("Can not put X dialog on non-X terminal"); + #if ! defined (USE_X_TOOLKIT) && ! defined (USE_GTK) /* Display a menu with these alternatives in the middle of frame F. */ @@ -1309,7 +1318,7 @@ popup_get_selection (initial_event, dpyinfo, id, do_timers) } } -DEFUN ("menu-bar-open", Fmenu_bar_open, Smenu_bar_open, 0, 1, "i", +DEFUN ("x-menu-bar-open-internal", Fx_menu_bar_open_internal, Sx_menu_bar_open_internal, 0, 1, "i", doc: /* Start key navigation of the menu bar in FRAME. This initially opens the first menu bar item and you can then navigate with the arrow keys, select a menu entry with the return key or cancel with the @@ -1388,7 +1397,7 @@ If FRAME is nil or not given, use the selected frame. */) #ifdef USE_GTK -DEFUN ("menu-bar-open", Fmenu_bar_open, Smenu_bar_open, 0, 1, "i", +DEFUN ("x-menu-bar-open-internal", Fx_menu_bar_open_internal, Sx_menu_bar_open_internal, 0, 1, "i", doc: /* Start key navigation of the menu bar in FRAME. This initially opens the first menu bar item and you can then navigate with the arrow keys, select a menu entry with the return key or cancel with the @@ -1464,6 +1473,9 @@ void x_activate_menubar (f) FRAME_PTR f; { + if (! FRAME_X_P (f)) + abort (); + if (!f->output_data.x->saved_menu_event->type) return; @@ -2098,9 +2110,14 @@ update_frame_menubar (f) #ifdef USE_GTK return xg_update_frame_menubar (f); #else - struct x_output *x = f->output_data.x; + struct x_output *x; int columns, rows; + if (! FRAME_X_P (f)) + abort (); + + x = f->output_data.x; + if (!x->menubar_widget || XtIsManaged (x->menubar_widget)) return 0; @@ -2146,7 +2163,7 @@ set_frame_menubar (f, first_time, deep_p) int first_time; int deep_p; { - xt_or_gtk_widget menubar_widget = f->output_data.x->menubar_widget; + xt_or_gtk_widget menubar_widget; #ifdef USE_X_TOOLKIT LWLIB_ID id; #endif @@ -2156,6 +2173,10 @@ set_frame_menubar (f, first_time, deep_p) int *submenu_start, *submenu_end; int *submenu_top_level_items, *submenu_n_panes; + if (! FRAME_X_P (f)) + abort (); + + menubar_widget = f->output_data.x->menubar_widget; XSETFRAME (Vmenu_updating_frame, f); @@ -2508,6 +2529,9 @@ free_frame_menubar (f) { Widget menubar_widget; + if (! FRAME_X_P (f)) + abort (); + menubar_widget = f->output_data.x->menubar_widget; f->output_data.x->menubar_height = 0; @@ -2660,6 +2684,9 @@ create_and_show_popup_menu (f, first_wv, x, y, for_click) struct next_popup_x_y popup_x_y; int specpdl_count = SPECPDL_INDEX (); + if (! FRAME_X_P (f)) + abort (); + xg_crazy_callback_abort = 1; menu = xg_create_widget ("popup", first_wv->name, f, first_wv, G_CALLBACK (popup_selection_callback), @@ -2768,6 +2795,9 @@ create_and_show_popup_menu (f, first_wv, x, y, for_click) LWLIB_ID menu_id; Widget menu; + if (! FRAME_X_P (f)) + abort (); + menu_id = widget_id_tick++; menu = lw_create_widget ("popup", first_wv->name, menu_id, first_wv, f->output_data.x->widget, 1, 0, @@ -2844,6 +2874,9 @@ xmenu_show (f, x, y, for_click, keymaps, title, error) int first_pane; + if (! FRAME_X_P (f)) + abort (); + *error = NULL; if (menu_items_used <= MENU_ITEMS_PANE_LENGTH) @@ -3126,6 +3159,9 @@ create_and_show_dialog (f, first_wv) { GtkWidget *menu; + if (! FRAME_X_P (f)) + abort (); + menu = xg_create_widget ("dialog", first_wv->name, f, first_wv, G_CALLBACK (dialog_selection_callback), G_CALLBACK (popup_deactivate_callback), @@ -3175,6 +3211,9 @@ create_and_show_dialog (f, first_wv) { LWLIB_ID dialog_id; + if (!FRAME_X_P (f)) + abort(); + dialog_id = widget_id_tick++; lw_create_widget (first_wv->name, "dialog", dialog_id, first_wv, f->output_data.x->widget, 1, 0, @@ -3227,6 +3266,9 @@ xdialog_show (f, keymaps, title, header, error_name) /* 1 means we've seen the boundary between left-hand elts and right-hand. */ int boundary_seen = 0; + if (! FRAME_X_P (f)) + abort (); + *error_name = NULL; if (menu_items_n_panes > 1) @@ -3502,6 +3544,9 @@ xmenu_show (f, x, y, for_click, keymaps, title, error) unsigned int dummy_uint; int specpdl_count = SPECPDL_INDEX (); + if (! FRAME_X_P (f)) + abort (); + *error = 0; if (menu_items_n_panes == 0) return Qnil; @@ -3610,13 +3655,6 @@ xmenu_show (f, x, y, for_click, keymaps, title, error) if (!NILP (descrip)) { int gap = maxwidth - SBYTES (item_name); -#ifdef C_ALLOCA - Lisp_Object spacer; - spacer = Fmake_string (make_number (gap), make_number (' ')); - item_name = concat2 (item_name, spacer); - item_name = concat2 (item_name, descrip); - item_data = SDATA (item_name); -#else /* if alloca is fast, use that to make the space, to reduce gc needs. */ item_data @@ -3629,7 +3667,6 @@ xmenu_show (f, x, y, for_click, keymaps, title, error) bcopy (SDATA (descrip), item_data + j, SBYTES (descrip)); item_data[j + SBYTES (descrip)] = 0; -#endif } else item_data = SDATA (item_name); @@ -3806,8 +3843,9 @@ syms_of_xmenu () defsubr (&Smenu_or_popup_active_p); #if defined (USE_GTK) || defined (USE_X_TOOLKIT) - defsubr (&Smenu_bar_open); - Ffset (intern ("accelerate-menu"), intern (Smenu_bar_open.symbol_name)); + defsubr (&Sx_menu_bar_open_internal); + Ffset (intern ("accelerate-menu"), + intern (Sx_menu_bar_open_internal.symbol_name)); #endif #ifdef HAVE_MENUS diff --git a/src/xselect.c b/src/xselect.c index 33468f0d63a..d71ac42aa7c 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -398,12 +398,19 @@ x_own_selection (selection_name, selection_value) Lisp_Object selection_name, selection_value; { struct frame *sf = SELECTED_FRAME (); - Window selecting_window = FRAME_X_WINDOW (sf); - Display *display = FRAME_X_DISPLAY (sf); + Window selecting_window; + Display *display; Time time = last_event_timestamp; Atom selection_atom; - struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (sf); + struct x_display_info *dpyinfo; + + if (! FRAME_X_P (sf)) + return; + selecting_window = FRAME_X_WINDOW (sf); + display = FRAME_X_DISPLAY (sf); + dpyinfo = FRAME_X_DISPLAY_INFO (sf); + CHECK_SYMBOL (selection_name); selection_atom = symbol_to_x_atom (dpyinfo, display, selection_name); @@ -671,7 +678,8 @@ some_frame_on_display (dpyinfo) FOR_EACH_FRAME (list, frame) { - if (FRAME_X_DISPLAY_INFO (XFRAME (frame)) == dpyinfo) + if (FRAME_X_P (XFRAME (frame)) + && FRAME_X_DISPLAY_INFO (XFRAME (frame)) == dpyinfo) return frame; } @@ -683,6 +691,10 @@ some_frame_on_display (dpyinfo) DATA and SIZE describe the data to send, already converted. FORMAT is the unit-size (in bits) of the data to be transmitted. */ +#ifdef TRACE_SELECTION +static int x_reply_selection_request_cnt; +#endif /* TRACE_SELECTION */ + static void x_reply_selection_request (event, format, data, size, type) struct input_event *event; @@ -721,10 +733,9 @@ x_reply_selection_request (event, format, data, size, type) #ifdef TRACE_SELECTION { - static int cnt; char *sel = XGetAtomName (display, reply.selection); char *tgt = XGetAtomName (display, reply.target); - TRACE3 ("%s, target %s (%d)", sel, tgt, ++cnt); + TRACE3 ("%s, target %s (%d)", sel, tgt, ++x_reply_selection_request_cnt); if (sel) XFree (sel); if (tgt) XFree (tgt); } @@ -1014,6 +1025,7 @@ x_handle_selection_clear (event) TRACE0 ("x_handle_selection_clear"); +#ifdef MULTI_KBOARD /* If the new selection owner is also Emacs, don't clear the new selection. */ BLOCK_INPUT; @@ -1021,7 +1033,7 @@ x_handle_selection_clear (event) to see if this Emacs job now owns the selection through that display. */ for (t_dpyinfo = x_display_list; t_dpyinfo; t_dpyinfo = t_dpyinfo->next) - if (t_dpyinfo->kboard == dpyinfo->kboard) + if (t_dpyinfo->terminal->kboard == dpyinfo->terminal->kboard) { Window owner_window = XGetSelectionOwner (t_dpyinfo->display, selection); @@ -1032,7 +1044,8 @@ x_handle_selection_clear (event) } } UNBLOCK_INPUT; - +#endif + selection_symbol = x_atom_to_symbol (display, selection); local_selection_data = assq_no_quit (selection_symbol, Vselection_alist); @@ -1380,17 +1393,26 @@ x_get_foreign_selection (selection_symbol, target_type, time_stamp) Lisp_Object selection_symbol, target_type, time_stamp; { struct frame *sf = SELECTED_FRAME (); - Window requestor_window = FRAME_X_WINDOW (sf); - Display *display = FRAME_X_DISPLAY (sf); - struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (sf); + Window requestor_window; + Display *display; + struct x_display_info *dpyinfo; Time requestor_time = last_event_timestamp; - Atom target_property = dpyinfo->Xatom_EMACS_TMP; - Atom selection_atom = symbol_to_x_atom (dpyinfo, display, selection_symbol); + Atom target_property; + Atom selection_atom; Atom type_atom; int secs, usecs; int count = SPECPDL_INDEX (); Lisp_Object frame; + if (! FRAME_X_P (sf)) + return Qnil; + + requestor_window = FRAME_X_WINDOW (sf); + display = FRAME_X_DISPLAY (sf); + dpyinfo = FRAME_X_DISPLAY_INFO (sf); + target_property = dpyinfo->Xatom_EMACS_TMP; + selection_atom = symbol_to_x_atom (dpyinfo, display, selection_symbol); + if (CONSP (target_type)) type_atom = symbol_to_x_atom (dpyinfo, display, XCAR (target_type)); else @@ -2206,6 +2228,9 @@ Disowning it means there is no such selection. */) struct frame *sf = SELECTED_FRAME (); check_x (); + if (! FRAME_X_P (sf)) + return Qnil; + display = FRAME_X_DISPLAY (sf); dpyinfo = FRAME_X_DISPLAY_INFO (sf); CHECK_SYMBOL (selection); @@ -2367,6 +2392,10 @@ DEFUN ("x-get-cut-buffer-internal", Fx_get_cut_buffer_internal, struct frame *sf = SELECTED_FRAME (); check_x (); + + if (! FRAME_X_P (sf)) + return Qnil; + display = FRAME_X_DISPLAY (sf); dpyinfo = FRAME_X_DISPLAY_INFO (sf); window = RootWindow (display, 0); /* Cut buffers are on screen 0 */ @@ -2407,6 +2436,10 @@ DEFUN ("x-store-cut-buffer-internal", Fx_store_cut_buffer_internal, struct frame *sf = SELECTED_FRAME (); check_x (); + + if (! FRAME_X_P (sf)) + return Qnil; + display = FRAME_X_DISPLAY (sf); window = RootWindow (display, 0); /* Cut buffers are on screen 0 */ @@ -2463,8 +2496,12 @@ Positive means shift the values forward, negative means backward. */) Atom props[8]; Display *display; struct frame *sf = SELECTED_FRAME (); - + check_x (); + + if (! FRAME_X_P (sf)) + return Qnil; + display = FRAME_X_DISPLAY (sf); window = RootWindow (display, 0); /* Cut buffers are on screen 0 */ CHECK_NUMBER (n); diff --git a/src/xsmfns.c b/src/xsmfns.c index 1211c55eb03..77abf3b5072 100644 --- a/src/xsmfns.c +++ b/src/xsmfns.c @@ -48,6 +48,7 @@ Boston, MA 02110-1301, USA. */ #include "lisp.h" #include "systime.h" #include "sysselect.h" +#include "frame.h" #include "termhooks.h" #include "termopts.h" #include "xterm.h" @@ -510,6 +511,14 @@ x_session_initialize (dpyinfo) } } +/* Ensure that the session manager is not contacted again. */ + +void +x_session_close () +{ + ice_fd = -1; +} + DEFUN ("handle-save-session", Fhandle_save_session, Shandle_save_session, 1, 1, "e", diff --git a/src/xterm.c b/src/xterm.c index ca2e16398d6..363d2183ee5 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -54,7 +54,6 @@ Boston, MA 02110-1301, USA. */ #include <sys/ioctl.h> #endif /* ! defined (BSD_SYSTEM) */ -#include "systty.h" #include "systime.h" #ifndef INCLUDED_FCNTL @@ -160,8 +159,6 @@ extern void _XEditResCheckMessages (); #endif #endif -#define abs(x) ((x) < 0 ? -(x) : (x)) - /* Default to using XIM if available. */ #ifdef USE_XIM int use_xim = 1; @@ -327,6 +324,10 @@ static Lisp_Object Qalt, Qhyper, Qmeta, Qsuper, Qmodifier_value; static Lisp_Object Qvendor_specific_keysyms; static Lisp_Object Qlatin_1; +/* Used in x_flush. */ + +extern Lisp_Object Vinhibit_redisplay; + extern XrmDatabase x_load_resources P_ ((Display *, char *, char *, char *)); extern int x_bitmap_mask P_ ((FRAME_PTR, int)); @@ -336,13 +337,15 @@ static const XColor *x_color_cells P_ ((Display *, int *)); static void x_update_window_end P_ ((struct window *, int, int)); static int x_io_error_quitter P_ ((Display *)); +static struct terminal *x_create_terminal P_ ((struct x_display_info *)); +void x_delete_terminal P_ ((struct terminal *)); static void x_font_min_bounds P_ ((XFontStruct *, int *, int *)); static int x_compute_min_glyph_bounds P_ ((struct frame *)); static void x_update_end P_ ((struct frame *)); static void XTframe_up_to_date P_ ((struct frame *)); -static void XTset_terminal_modes P_ ((void)); -static void XTreset_terminal_modes P_ ((void)); -static void x_clear_frame P_ ((void)); +static void XTset_terminal_modes P_ ((struct terminal *)); +static void XTreset_terminal_modes P_ ((struct terminal *)); +static void x_clear_frame P_ ((struct frame *)); static void frame_highlight P_ ((struct frame *)); static void frame_unhighlight P_ ((struct frame *)); static void x_new_focus_frame P_ ((struct x_display_info *, struct frame *)); @@ -382,12 +385,18 @@ static void x_flush (f) struct frame *f; { + /* Don't call XFlush when it is not safe to redisplay; the X + connection may be broken. */ + if (!NILP (Vinhibit_redisplay)) + return; + BLOCK_INPUT; if (f == NULL) { Lisp_Object rest, frame; FOR_EACH_FRAME (rest, frame) - x_flush (XFRAME (frame)); + if (FRAME_X_P (XFRAME (frame))) + x_flush (XFRAME (frame)); } else if (FRAME_X_P (f)) XFlush (FRAME_X_DISPLAY (f)); @@ -848,7 +857,7 @@ x_draw_fringe_bitmap (w, row, p) rarely happens). */ static void -XTset_terminal_modes () +XTset_terminal_modes (struct terminal *terminal) { } @@ -856,7 +865,7 @@ XTset_terminal_modes () the X-windows go away, and suspending requires no action. */ static void -XTreset_terminal_modes () +XTreset_terminal_modes (struct terminal *terminal) { } @@ -1621,7 +1630,8 @@ x_frame_of_widget (widget) for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail)) if (FRAMEP (XCAR (tail)) && (f = XFRAME (XCAR (tail)), - (f->output_data.nothing != 1 + (FRAME_X_P (f) + && f->output_data.nothing != 1 && FRAME_X_DISPLAY_INFO (f) == dpyinfo)) && f->output_data.x->widget == widget) return f; @@ -3092,7 +3102,8 @@ x_shift_glyphs_for_insert (f, x, y, width, height, shift_by) for X frames. */ static void -x_delete_glyphs (n) +x_delete_glyphs (f, n) + struct frame *f; register int n; { abort (); @@ -3115,19 +3126,11 @@ x_clear_area (dpy, window, x, y, width, height, exposures) } -/* Clear entire frame. If updating_frame is non-null, clear that - frame. Otherwise clear the selected frame. */ +/* Clear an entire frame. */ static void -x_clear_frame () +x_clear_frame (struct frame *f) { - struct frame *f; - - if (updating_frame) - f = updating_frame; - else - f = SELECTED_FRAME (); - /* Clearing the frame will erase any cursor, so mark them all as no longer visible. */ mark_window_cursors_off (XWINDOW (FRAME_ROOT_WINDOW (f))); @@ -3206,8 +3209,8 @@ XTflash (f) XGCValues values; values.function = GXxor; - values.foreground = (f->output_data.x->foreground_pixel - ^ f->output_data.x->background_pixel); + values.foreground = (FRAME_FOREGROUND_PIXEL (f) + ^ FRAME_BACKGROUND_PIXEL (f)); gc = XCreateGC (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), GCFunction | GCForeground, &values); @@ -3373,7 +3376,8 @@ XTset_terminal_window (n) lines or deleting -N lines at vertical position VPOS. */ static void -x_ins_del_lines (vpos, n) +x_ins_del_lines (f, vpos, n) + struct frame *f; int vpos, n; { abort (); @@ -4010,7 +4014,8 @@ XTmouse_position (fp, insist, bar_window, part, x, y, time) /* Clear the mouse-moved flag for every frame on this display. */ FOR_EACH_FRAME (tail, frame) - if (FRAME_X_DISPLAY (XFRAME (frame)) == FRAME_X_DISPLAY (*fp)) + if (FRAME_X_P (XFRAME (frame)) + && FRAME_X_DISPLAY (XFRAME (frame)) == FRAME_X_DISPLAY (*fp)) XFRAME (frame)->mouse_moved = 0; last_mouse_scroll_bar = Qnil; @@ -4197,6 +4202,9 @@ x_window_to_scroll_bar (display, window_id) if (! FRAMEP (frame)) abort (); + if (! FRAME_X_P (XFRAME (frame))) + continue; + /* Scan this frame's scroll bar list for a scroll bar with the right window ID. */ condemned = FRAME_CONDEMNED_SCROLL_BARS (XFRAME (frame)); @@ -4229,11 +4237,14 @@ x_window_to_menu_bar (window) for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail)) { - Lisp_Object frame = XCAR (tail); - Widget menu_bar = XFRAME (frame)->output_data.x->menubar_widget; + if (FRAME_X_P (XFRAME (XCAR (tail)))) + { + Lisp_Object frame = XCAR (tail); + Widget menu_bar = XFRAME (frame)->output_data.x->menubar_widget; - if (menu_bar && xlwmenu_window_p (menu_bar, window)) - return menu_bar; + if (menu_bar && xlwmenu_window_p (menu_bar, window)) + return menu_bar; + } } return NULL; @@ -5041,7 +5052,7 @@ x_scroll_bar_create (w, top, left, width, height) a.background_pixel = f->output_data.x->scroll_bar_background_pixel; if (a.background_pixel == -1) - a.background_pixel = f->output_data.x->background_pixel; + a.background_pixel = FRAME_BACKGROUND_PIXEL (f); a.event_mask = (ButtonPressMask | ButtonReleaseMask | ButtonMotionMask | PointerMotionHintMask @@ -5218,7 +5229,7 @@ x_scroll_bar_set_handle (bar, start, end, rebuild) /* Restore the foreground color of the GC if we changed it above. */ if (f->output_data.x->scroll_bar_foreground_pixel != -1) XSetForeground (FRAME_X_DISPLAY (f), gc, - f->output_data.x->foreground_pixel); + FRAME_FOREGROUND_PIXEL (f)); /* Draw the empty space below the handle. Note that we can't clear zero-height areas; that means "clear to end of window." */ @@ -5620,7 +5631,7 @@ x_scroll_bar_expose (bar, event) /* Restore the foreground color of the GC if we changed it above. */ if (f->output_data.x->scroll_bar_foreground_pixel != -1) XSetForeground (FRAME_X_DISPLAY (f), gc, - f->output_data.x->foreground_pixel); + FRAME_FOREGROUND_PIXEL (f)); UNBLOCK_INPUT; @@ -6020,7 +6031,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) int count = 0; int do_help = 0; int nbytes = 0; - struct frame *f; + struct frame *f = NULL; struct coding_system coding; XEvent event = *eventp; @@ -6596,19 +6607,19 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) bzero (&compose_status, sizeof (compose_status)); orig_keysym = keysym; - /* Common for all keysym input events. */ - XSETFRAME (inev.ie.frame_or_window, f); - inev.ie.modifiers - = x_x_to_emacs_modifiers (FRAME_X_DISPLAY_INFO (f), modifiers); - inev.ie.timestamp = event.xkey.time; - - /* First deal with keysyms which have defined - translations to characters. */ - if (keysym >= 32 && keysym < 128) - /* Avoid explicitly decoding each ASCII character. */ - { - inev.ie.kind = ASCII_KEYSTROKE_EVENT; - inev.ie.code = keysym; + /* Common for all keysym input events. */ + XSETFRAME (inev.ie.frame_or_window, f); + inev.ie.modifiers + = x_x_to_emacs_modifiers (FRAME_X_DISPLAY_INFO (f), modifiers); + inev.ie.timestamp = event.xkey.time; + + /* First deal with keysyms which have defined + translations to characters. */ + if (keysym >= 32 && keysym < 128) + /* Avoid explicitly decoding each ASCII character. */ + { + inev.ie.kind = ASCII_KEYSTROKE_EVENT; + inev.ie.code = keysym; goto done_keysym; } @@ -6626,18 +6637,18 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) /* Now non-ASCII. */ if (HASH_TABLE_P (Vx_keysym_table) && (NATNUMP (c = Fgethash (make_number (keysym), - Vx_keysym_table, - Qnil)))) - { - inev.ie.kind = (SINGLE_BYTE_CHAR_P (XFASTINT (c)) - ? ASCII_KEYSTROKE_EVENT - : MULTIBYTE_CHAR_KEYSTROKE_EVENT); - inev.ie.code = XFASTINT (c); - goto done_keysym; - } - - /* Random non-modifier sorts of keysyms. */ - if (((keysym >= XK_BackSpace && keysym <= XK_Escape) + Vx_keysym_table, + Qnil)))) + { + inev.ie.kind = (SINGLE_BYTE_CHAR_P (XFASTINT (c)) + ? ASCII_KEYSTROKE_EVENT + : MULTIBYTE_CHAR_KEYSTROKE_EVENT); + inev.ie.code = XFASTINT (c); + goto done_keysym; + } + + /* Random non-modifier sorts of keysyms. */ + if (((keysym >= XK_BackSpace && keysym <= XK_Escape) || keysym == XK_Delete #ifdef XK_ISO_Left_Tab || (keysym >= XK_ISO_Left_Tab @@ -6766,20 +6777,32 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) copy_bufptr = coding.destination; } - /* Convert the input data to a sequence of - character events. */ - for (i = 0; i < nbytes; i += len) - { - if (nchars == nbytes) - c = copy_bufptr[i], len = 1; - else - c = STRING_CHAR_AND_LENGTH (copy_bufptr + i, - nbytes - i, len); - inev.ie.kind = (SINGLE_BYTE_CHAR_P (c) - ? ASCII_KEYSTROKE_EVENT - : MULTIBYTE_CHAR_KEYSTROKE_EVENT); - inev.ie.code = c; - kbd_buffer_store_event_hold (&inev.ie, hold_quit); + require = decoding_buffer_size (&coding, nbytes); + p = (unsigned char *) alloca (require); + coding.mode |= CODING_MODE_LAST_BLOCK; + /* We explicitly disable composition handling because + key data should not contain any composition sequence. */ + coding.composing = COMPOSITION_DISABLED; + decode_coding (&coding, copy_bufptr, p, nbytes, require); + nbytes = coding.produced; + nchars = coding.produced_char; + copy_bufptr = p; + + /* Convert the input data to a sequence of + character events. */ + for (i = 0; i < nbytes; i += len) + { + if (nchars == nbytes) + c = copy_bufptr[i], len = 1; + else + c = STRING_CHAR_AND_LENGTH (copy_bufptr + i, + nbytes - i, len); + inev.ie.kind = (SINGLE_BYTE_CHAR_P (c) + ? ASCII_KEYSTROKE_EVENT + : MULTIBYTE_CHAR_KEYSTROKE_EVENT); + inev.ie.code = c; + kbd_buffer_store_event_hold (&inev.ie, hold_quit); + } } /* Previous code updated count by nchars rather than nbytes, @@ -6846,7 +6869,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) /* We may get an EnterNotify on the buttons in the toolbar. In that case we moved out of any highlighted area and need to note this. */ if (!f && last_mouse_glyph_frame) - note_mouse_movement (last_mouse_glyph_frame, &event); + note_mouse_movement (last_mouse_glyph_frame, &event.xmotion); #endif goto OTHER; @@ -6879,7 +6902,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) #ifdef USE_GTK /* See comment in EnterNotify above */ else if (last_mouse_glyph_frame) - note_mouse_movement (last_mouse_glyph_frame, &event); + note_mouse_movement (last_mouse_glyph_frame, &event.xmotion); #endif goto OTHER; @@ -6922,7 +6945,13 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) will be selected only when it is active. */ if (WINDOWP (window) && !EQ (window, last_window) - && !EQ (window, selected_window)) + && !EQ (window, selected_window) + /* For click-to-focus window managers + create event iff we don't leave the + selected frame. */ + && (focus_follows_mouse + || (EQ (XWINDOW (window)->frame, + XWINDOW (selected_window)->frame)))) { inev.ie.kind = SELECT_WINDOW_EVENT; inev.ie.frame_or_window = window; @@ -7282,8 +7311,8 @@ x_dispatch_event (event, display) EXPECTED is nonzero if the caller knows input is available. */ static int -XTread_socket (sd, expected, hold_quit) - register int sd; +XTread_socket (terminal, expected, hold_quit) + struct terminal *terminal; int expected; struct input_event *hold_quit; { @@ -7306,6 +7335,31 @@ XTread_socket (sd, expected, hold_quit) ++handling_signal; +#ifdef HAVE_X_SM + /* Only check session manager input for the primary display. */ + if (terminal->id == 1 && x_session_have_connection ()) + { + struct input_event inev; + BLOCK_INPUT; + /* We don't need to EVENT_INIT (inev) here, as + x_session_check_input copies an entire input_event. */ + if (x_session_check_input (&inev)) + { + kbd_buffer_store_event_hold (&inev, hold_quit); + count++; + } + UNBLOCK_INPUT; + } +#endif + + /* For debugging, this gives a way to fake an I/O error. */ + if (terminal->display_info.x == XTread_socket_fake_io_error) + { + XTread_socket_fake_io_error = 0; + x_io_error_quitter (dpyinfo->display); + } + +#if 0 /* This loop is a noop now. */ /* Find the display we are supposed to read input for. It's the one communicating on descriptor SD. */ for (dpyinfo = x_display_list; dpyinfo; dpyinfo = dpyinfo->next) @@ -7336,52 +7390,31 @@ XTread_socket (sd, expected, hold_quit) #endif /* HAVE_SELECT */ #endif /* SIGIO */ #endif - - /* For debugging, this gives a way to fake an I/O error. */ - if (dpyinfo == XTread_socket_fake_io_error) - { - XTread_socket_fake_io_error = 0; - x_io_error_quitter (dpyinfo->display); - } - -#ifdef HAVE_X_SM - { - struct input_event inev; - BLOCK_INPUT; - /* We don't need to EVENT_INIT (inev) here, as - x_session_check_input copies an entire input_event. */ - if (x_session_check_input (&inev)) - { - kbd_buffer_store_event_hold (&inev, hold_quit); - count++; - } - UNBLOCK_INPUT; - } + } #endif #ifndef USE_GTK - while (XPending (dpyinfo->display)) - { - int finish; + while (XPending (terminal->display_info.x->display)) + { + int finish; - XNextEvent (dpyinfo->display, &event); + XNextEvent (terminal->display_info.x->display, &event); #ifdef HAVE_X_I18N - /* Filter events for the current X input method. */ - if (x_filter_event (dpyinfo, &event)) - break; + /* Filter events for the current X input method. */ + if (x_filter_event (terminal->display_info.x, &event)) + break; #endif - event_found = 1; + event_found = 1; - count += handle_one_xevent (dpyinfo, &event, &finish, hold_quit); + count += handle_one_xevent (terminal->display_info.x, + &event, &finish, hold_quit); - if (finish == X_EVENT_GOTO_OUT) - goto out; - } -#endif /* not USE_GTK */ + if (finish == X_EVENT_GOTO_OUT) + goto out; } -#ifdef USE_GTK +#else /* USE_GTK */ /* For GTK we must use the GTK event loop. But XEvents gets passed to our filter function above, and then to the big event switch. @@ -7692,8 +7725,7 @@ x_draw_window_cursor (w, glyph_row, x, y, cursor_type, cursor_width, on_p, activ } #ifndef XFlush - if (updating_frame != f) - XFlush (FRAME_X_DISPLAY (f)); + XFlush (FRAME_X_DISPLAY (f)); #endif } @@ -7931,6 +7963,8 @@ x_clear_errors (dpy) x_error_message->string[0] = 0; } +#if 0 /* See comment in unwind_to_catch why calling this is a bad + * idea. --lorentey */ /* Close off all unclosed x_catch_errors calls. */ void @@ -7939,6 +7973,7 @@ x_fully_uncatch_errors () while (x_error_message) x_uncatch_errors (); } +#endif /* Nonzero if x_catch_errors has been done and not yet canceled. */ @@ -8004,6 +8039,7 @@ x_connection_closed (dpy, error_message) { struct x_display_info *dpyinfo = x_display_info_for_display (dpy); Lisp_Object frame, tail; + int index = SPECPDL_INDEX (); error_msg = (char *) alloca (strlen (error_message) + 1); strcpy (error_msg, error_message); @@ -8015,6 +8051,44 @@ x_connection_closed (dpy, error_message) the original message here. */ x_catch_errors (dpy); + /* Inhibit redisplay while frames are being deleted. */ + specbind (Qinhibit_redisplay, Qt); + + if (dpyinfo) + { + /* Protect display from being closed when we delete the last + frame on it. */ + dpyinfo->reference_count++; + dpyinfo->terminal->reference_count++; + } + + /* First delete frames whose mini-buffers are on frames + that are on the dead display. */ + FOR_EACH_FRAME (tail, frame) + { + Lisp_Object minibuf_frame; + minibuf_frame + = WINDOW_FRAME (XWINDOW (FRAME_MINIBUF_WINDOW (XFRAME (frame)))); + if (FRAME_X_P (XFRAME (frame)) + && FRAME_X_P (XFRAME (minibuf_frame)) + && ! EQ (frame, minibuf_frame) + && FRAME_X_DISPLAY_INFO (XFRAME (minibuf_frame)) == dpyinfo) + Fdelete_frame (frame, Qt); + } + + /* Now delete all remaining frames on the dead display. + We are now sure none of these is used as the mini-buffer + for another frame that we need to delete. */ + FOR_EACH_FRAME (tail, frame) + if (FRAME_X_P (XFRAME (frame)) + && FRAME_X_DISPLAY_INFO (XFRAME (frame)) == dpyinfo) + { + /* Set this to t so that Fdelete_frame won't get confused + trying to find a replacement. */ + FRAME_KBOARD (XFRAME (frame))->Vdefault_minibuffer_frame = Qt; + Fdelete_frame (frame, Qt); + } + /* We have to close the display to inform Xt that it doesn't exist anymore. If we don't, Xt will continue to wait for events from the display. As a consequence, a sequence of @@ -8047,43 +8121,23 @@ x_connection_closed (dpy, error_message) xg_display_close (dpyinfo->display); #endif - /* Indicate that this display is dead. */ if (dpyinfo) - dpyinfo->display = 0; - - /* First delete frames whose mini-buffers are on frames - that are on the dead display. */ - FOR_EACH_FRAME (tail, frame) { - Lisp_Object minibuf_frame; - minibuf_frame - = WINDOW_FRAME (XWINDOW (FRAME_MINIBUF_WINDOW (XFRAME (frame)))); - if (FRAME_X_P (XFRAME (frame)) - && FRAME_X_P (XFRAME (minibuf_frame)) - && ! EQ (frame, minibuf_frame) - && FRAME_X_DISPLAY_INFO (XFRAME (minibuf_frame)) == dpyinfo) - Fdelete_frame (frame, Qt); - } + /* Indicate that this display is dead. */ + dpyinfo->display = 0; - /* Now delete all remaining frames on the dead display. - We are now sure none of these is used as the mini-buffer - for another frame that we need to delete. */ - FOR_EACH_FRAME (tail, frame) - if (FRAME_X_P (XFRAME (frame)) - && FRAME_X_DISPLAY_INFO (XFRAME (frame)) == dpyinfo) - { - /* Set this to t so that Fdelete_frame won't get confused - trying to find a replacement. */ - FRAME_KBOARD (XFRAME (frame))->Vdefault_minibuffer_frame = Qt; - Fdelete_frame (frame, Qt); - } + dpyinfo->reference_count--; + dpyinfo->terminal->reference_count--; + if (dpyinfo->reference_count != 0) + /* We have just closed all frames on this display. */ + abort (); - if (dpyinfo) - x_delete_display (dpyinfo); + x_delete_display (dpyinfo); + } x_uncatch_errors (); - if (x_display_list == 0) + if (terminal_list == 0) { fprintf (stderr, "%s\n", error_msg); shut_down_emacs (0, 0, Qnil); @@ -8097,6 +8151,7 @@ x_connection_closed (dpy, error_message) sigunblock (sigmask (SIGALRM)); TOTALLY_UNBLOCK_INPUT; + unbind_to (index, Qnil); clear_waiting_for_input (); error ("%s", error_msg); } @@ -8386,7 +8441,7 @@ xim_destroy_callback (xim, client_data, call_data) FOR_EACH_FRAME (tail, frame) { struct frame *f = XFRAME (frame); - if (FRAME_X_DISPLAY_INFO (f) == dpyinfo) + if (FRAME_X_P (f) && FRAME_X_DISPLAY_INFO (f) == dpyinfo) { FRAME_XIC (f) = NULL; xic_free_xfontset (f); @@ -8485,7 +8540,8 @@ xim_instantiate_callback (display, client_data, call_data) { struct frame *f = XFRAME (frame); - if (FRAME_X_DISPLAY_INFO (f) == xim_inst->dpyinfo) + if (FRAME_X_P (f) + && FRAME_X_DISPLAY_INFO (f) == xim_inst->dpyinfo) if (FRAME_XIC (f) == NULL) { create_frame_xic (f); @@ -9709,8 +9765,8 @@ x_free_frame_resources (f) XDestroyWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f)); #endif /* !USE_X_TOOLKIT */ - unload_color (f, f->output_data.x->foreground_pixel); - unload_color (f, f->output_data.x->background_pixel); + unload_color (f, FRAME_FOREGROUND_PIXEL (f)); + unload_color (f, FRAME_BACKGROUND_PIXEL (f)); unload_color (f, f->output_data.x->cursor_pixel); unload_color (f, f->output_data.x->cursor_foreground_pixel); unload_color (f, f->output_data.x->border_pixel); @@ -11008,9 +11064,12 @@ get_bits_and_offset (mask, bits, offset) *bits = nr; } +/* Return 1 if display DISPLAY is available for use, 0 otherwise. + But don't permanently open it, just test its availability. */ + int x_display_ok (display) - const char * display; + const char *display; { int dpy_ok = 1; Display *dpy; @@ -11023,6 +11082,10 @@ x_display_ok (display) return dpy_ok; } +/* Open a connection to X display DISPLAY_NAME, and return + the structure that describes the open display. + If we cannot contact the display, return null. */ + struct x_display_info * x_term_init (display_name, xrm_option, resource_name) Lisp_Object display_name; @@ -11031,6 +11094,7 @@ x_term_init (display_name, xrm_option, resource_name) { int connection; Display *dpy; + struct terminal *terminal; struct x_display_info *dpyinfo; XrmDatabase xrdb; @@ -11042,6 +11106,9 @@ x_term_init (display_name, xrm_option, resource_name) ++x_initialized; } + if (! x_display_ok (SDATA (display_name))) + error ("Display %s can't be opened", SDATA (display_name)); + #ifdef USE_GTK { #define NUM_ARGV 10 @@ -11050,14 +11117,21 @@ x_term_init (display_name, xrm_option, resource_name) char **argv2 = argv; GdkAtom atom; +#ifndef HAVE_GTK_MULTIDISPLAY + if (!EQ (Vinitial_window_system, intern ("x"))) + error ("Sorry, you cannot connect to X servers with the GTK toolkit"); +#endif + if (x_initialized++ > 1) { +#ifdef HAVE_GTK_MULTIDISPLAY /* Opening another display. If xg_display_open returns less than zero, we are probably on GTK 2.0, which can only handle one display. GTK 2.2 or later can handle more than one. */ if (xg_display_open (SDATA (display_name), &dpy) < 0) +#endif error ("Sorry, this version of GTK can only handle one display"); - } + } else { for (argc = 0; argc < NUM_ARGV; ++argc) @@ -11161,6 +11235,8 @@ x_term_init (display_name, xrm_option, resource_name) dpyinfo = (struct x_display_info *) xmalloc (sizeof (struct x_display_info)); bzero (dpyinfo, sizeof *dpyinfo); + terminal = x_create_terminal (dpyinfo); + #ifdef MULTI_KBOARD { struct x_display_info *share; @@ -11172,30 +11248,30 @@ x_term_init (display_name, xrm_option, resource_name) SDATA (display_name))) break; if (share) - dpyinfo->kboard = share->kboard; + terminal->kboard = share->terminal->kboard; else { - dpyinfo->kboard = (KBOARD *) xmalloc (sizeof (KBOARD)); - init_kboard (dpyinfo->kboard); + terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD)); + init_kboard (terminal->kboard); if (!EQ (XSYMBOL (Qvendor_specific_keysyms)->function, Qunbound)) { char *vendor = ServerVendor (dpy); UNBLOCK_INPUT; - dpyinfo->kboard->Vsystem_key_alist + terminal->kboard->Vsystem_key_alist = call1 (Qvendor_specific_keysyms, vendor ? build_string (vendor) : empty_unibyte_string); BLOCK_INPUT; } - dpyinfo->kboard->next_kboard = all_kboards; - all_kboards = dpyinfo->kboard; + terminal->kboard->next_kboard = all_kboards; + all_kboards = terminal->kboard; /* Don't let the initial kboard remain current longer than necessary. That would cause problems if a file loaded on startup tries to prompt in the mini-buffer. */ if (current_kboard == initial_kboard) - current_kboard = dpyinfo->kboard; + current_kboard = terminal->kboard; } - dpyinfo->kboard->reference_count++; + terminal->kboard->reference_count++; } #endif @@ -11210,6 +11286,11 @@ x_term_init (display_name, xrm_option, resource_name) dpyinfo->display = dpy; + /* Set the name of the terminal. */ + terminal->name = (char *) xmalloc (SBYTES (display_name) + 1); + strncpy (terminal->name, SDATA (display_name), SBYTES (display_name)); + terminal->name[SBYTES (display_name)] = 0; + #if 0 XSetAfterFunction (x_current_display, x_trace_wire); #endif /* ! 0 */ @@ -11505,8 +11586,10 @@ x_term_init (display_name, xrm_option, resource_name) } #ifdef HAVE_X_SM - /* Only do this for the first display. */ - if (!x_session_initialized++) + /* Only do this for the very first display in the Emacs session. + Ignore X session management when Emacs was first started on a + tty. */ + if (terminal->id == 1) x_session_initialize (dpyinfo); #endif @@ -11515,7 +11598,7 @@ x_term_init (display_name, xrm_option, resource_name) return dpyinfo; } -/* Get rid of display DPYINFO, assuming all frames are already gone, +/* Get rid of display DPYINFO, deleting all frames on it, and without sending any more commands to the X server. */ void @@ -11523,6 +11606,21 @@ x_delete_display (dpyinfo) struct x_display_info *dpyinfo; { int i; + struct terminal *t; + + /* Close all frames and delete the generic struct terminal for this + X display. */ + for (t = terminal_list; t; t = t->next_terminal) + if (t->type == output_x_window && t->display_info.x == dpyinfo) + { +#ifdef HAVE_X_SM + /* Close X session management when we close its display. */ + if (t->id == 1 && x_session_have_connection ()) + x_session_close(); +#endif + delete_terminal (t); + break; + } delete_keyboard_wait_descriptor (dpyinfo->connection); @@ -11566,10 +11664,6 @@ x_delete_display (dpyinfo) XrmDestroyDatabase (dpyinfo->xrdb); #endif #endif -#ifdef MULTI_KBOARD - if (--dpyinfo->kboard->reference_count == 0) - delete_kboard (dpyinfo->kboard); -#endif #ifdef HAVE_X_I18N if (dpyinfo->xim) xim_close_dpy (dpyinfo); @@ -11651,71 +11745,131 @@ x_activate_timeout_atimer () extern frame_parm_handler x_frame_parm_handlers[]; static struct redisplay_interface x_redisplay_interface = -{ - x_frame_parm_handlers, - x_produce_glyphs, - x_write_glyphs, - x_insert_glyphs, - x_clear_end_of_line, - x_scroll_run, - x_after_update_window_line, - x_update_window_begin, - x_update_window_end, - x_cursor_to, - x_flush, + { + x_frame_parm_handlers, + x_produce_glyphs, + x_write_glyphs, + x_insert_glyphs, + x_clear_end_of_line, + x_scroll_run, + x_after_update_window_line, + x_update_window_begin, + x_update_window_end, + x_cursor_to, + x_flush, #ifdef XFlush - x_flush, + x_flush, #else - 0, /* flush_display_optional */ -#endif - x_clear_window_mouse_face, - x_get_glyph_overhangs, - x_fix_overlapping_area, - x_draw_fringe_bitmap, - 0, /* define_fringe_bitmap */ - 0, /* destroy_fringe_bitmap */ - x_per_char_metric, - x_encode_char, - x_compute_glyph_string_overhangs, - x_draw_glyph_string, - x_define_frame_cursor, - x_clear_frame_area, - x_draw_window_cursor, - x_draw_vertical_window_border, - x_shift_glyphs_for_insert -}; + 0, /* flush_display_optional */ +#endif + x_clear_window_mouse_face, + x_get_glyph_overhangs, + x_fix_overlapping_area, + x_draw_fringe_bitmap, + 0, /* define_fringe_bitmap */ + 0, /* destroy_fringe_bitmap */ + x_per_char_metric, + x_encode_char, + x_compute_glyph_string_overhangs, + x_draw_glyph_string, + x_define_frame_cursor, + x_clear_frame_area, + x_draw_window_cursor, + x_draw_vertical_window_border, + x_shift_glyphs_for_insert + }; + + +/* This function is called when the last frame on a display is deleted. */ +void +x_delete_terminal (struct terminal *terminal) +{ + struct x_display_info *dpyinfo = terminal->display_info.x; + int i; + + /* Protect against recursive calls. Fdelete_frame in + delete_terminal calls us back when it deletes our last frame. */ + if (!terminal->name) + return; + + BLOCK_INPUT; + /* Free the fonts in the font table. */ + for (i = 0; i < dpyinfo->n_fonts; i++) + if (dpyinfo->font_table[i].name) + { + XFreeFont (dpyinfo->display, dpyinfo->font_table[i].font); + } + + x_destroy_all_bitmaps (dpyinfo); + XSetCloseDownMode (dpyinfo->display, DestroyAll); + +#ifdef USE_GTK + xg_display_close (dpyinfo->display); +#else +#ifdef USE_X_TOOLKIT + XtCloseDisplay (dpyinfo->display); +#else + XCloseDisplay (dpyinfo->display); +#endif +#endif /* ! USE_GTK */ + + x_delete_display (dpyinfo); + UNBLOCK_INPUT; +} + +/* Create a struct terminal, initialize it with the X11 specific + functions and make DISPLAY->TERMINAL point to it. */ + +static struct terminal * +x_create_terminal (struct x_display_info *dpyinfo) +{ + struct terminal *terminal; + + terminal = create_terminal (); + + terminal->type = output_x_window; + terminal->display_info.x = dpyinfo; + dpyinfo->terminal = terminal; + + /* kboard is initialized in x_term_init. */ + + terminal->clear_frame_hook = x_clear_frame; + terminal->ins_del_lines_hook = x_ins_del_lines; + terminal->delete_glyphs_hook = x_delete_glyphs; + terminal->ring_bell_hook = XTring_bell; + terminal->reset_terminal_modes_hook = XTreset_terminal_modes; + terminal->set_terminal_modes_hook = XTset_terminal_modes; + terminal->update_begin_hook = x_update_begin; + terminal->update_end_hook = x_update_end; + terminal->set_terminal_window_hook = XTset_terminal_window; + terminal->read_socket_hook = XTread_socket; + terminal->frame_up_to_date_hook = XTframe_up_to_date; + terminal->mouse_position_hook = XTmouse_position; + terminal->frame_rehighlight_hook = XTframe_rehighlight; + terminal->frame_raise_lower_hook = XTframe_raise_lower; + terminal->fullscreen_hook = XTfullscreen_hook; + terminal->set_vertical_scroll_bar_hook = XTset_vertical_scroll_bar; + terminal->condemn_scroll_bars_hook = XTcondemn_scroll_bars; + terminal->redeem_scroll_bar_hook = XTredeem_scroll_bar; + terminal->judge_scroll_bars_hook = XTjudge_scroll_bars; + + terminal->delete_frame_hook = x_destroy_window; + terminal->delete_terminal_hook = x_delete_terminal; + + terminal->rif = &x_redisplay_interface; + terminal->scroll_region_ok = 1; /* We'll scroll partial frames. */ + terminal->char_ins_del_ok = 1; + terminal->line_ins_del_ok = 1; /* We'll just blt 'em. */ + terminal->fast_clear_end_of_line = 1; /* X does this well. */ + terminal->memory_below_frame = 0; /* We don't remember what scrolls + off the bottom. */ + + return terminal; +} void x_initialize () { - rif = &x_redisplay_interface; - - clear_frame_hook = x_clear_frame; - ins_del_lines_hook = x_ins_del_lines; - delete_glyphs_hook = x_delete_glyphs; - ring_bell_hook = XTring_bell; - reset_terminal_modes_hook = XTreset_terminal_modes; - set_terminal_modes_hook = XTset_terminal_modes; - update_begin_hook = x_update_begin; - update_end_hook = x_update_end; - set_terminal_window_hook = XTset_terminal_window; - read_socket_hook = XTread_socket; - frame_up_to_date_hook = XTframe_up_to_date; - mouse_position_hook = XTmouse_position; - frame_rehighlight_hook = XTframe_rehighlight; - frame_raise_lower_hook = XTframe_raise_lower; - set_vertical_scroll_bar_hook = XTset_vertical_scroll_bar; - condemn_scroll_bars_hook = XTcondemn_scroll_bars; - redeem_scroll_bar_hook = XTredeem_scroll_bar; - judge_scroll_bars_hook = XTjudge_scroll_bars; - fullscreen_hook = XTfullscreen_hook; - - scroll_region_ok = 1; /* we'll scroll partial frames */ - char_ins_del_ok = 1; - line_ins_del_ok = 1; /* we'll just blt 'em */ - fast_clear_end_of_line = 1; /* X does this well */ - memory_below_frame = 0; /* we don't remember what scrolls - off the bottom */ baud_rate = 19200; x_noop_count = 0; @@ -11731,7 +11885,7 @@ x_initialize () #endif /* Try to use interrupt input; if we can't, then start polling. */ - Fset_input_mode (Qt, Qnil, Qt, Qnil); + Fset_input_interrupt_mode (Qt); #ifdef USE_X_TOOLKIT XtToolkitInitialize (); @@ -11762,9 +11916,11 @@ x_initialize () XSetIOErrorHandler (x_io_error_quitter); /* Disable Window Change signals; they are handled by X events. */ +#if 0 /* Don't. We may want to open tty frames later. */ #ifdef SIGWINCH signal (SIGWINCH, SIG_DFL); #endif /* SIGWINCH */ +#endif signal (SIGPIPE, x_connection_signal); } diff --git a/src/xterm.h b/src/xterm.h index 0480b0c8053..ad522c1dd75 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -149,6 +149,9 @@ struct x_display_info /* Chain of all x_display_info structures. */ struct x_display_info *next; + /* The generic display parameters corresponding to this X display. */ + struct terminal *terminal; + /* Connection number (normally a file descriptor number). */ int connection; @@ -327,9 +330,6 @@ struct x_display_info /* Atom used in toolkit scroll bar client messages. */ Atom Xatom_Scrollbar; -#ifdef MULTI_KBOARD - struct kboard *kboard; -#endif int cut_buffers_initialized; /* Whether we're sure they all exist */ /* The frame (if any) which has the X window that has keyboard focus. @@ -539,8 +539,10 @@ struct x_output /* Pixel values used for various purposes. border_pixel may be -1 meaning use a gray tile. */ +#if 0 /* These are also defined in struct frame. Use that instead. */ unsigned long background_pixel; unsigned long foreground_pixel; +#endif unsigned long cursor_pixel; unsigned long border_pixel; unsigned long mouse_pixel; @@ -1001,7 +1003,6 @@ extern int x_had_errors_p P_ ((Display *)); extern int x_catching_errors P_ ((void)); extern void x_uncatch_errors P_ ((void)); extern void x_clear_errors P_ ((Display *)); -extern void x_fully_uncatch_errors P_ ((void)); extern void x_set_window_size P_ ((struct frame *, int, int, int)); extern void x_set_mouse_position P_ ((struct frame *, int, int)); extern void x_set_mouse_pixel_position P_ ((struct frame *, int, int)); @@ -1017,6 +1018,7 @@ extern void x_wm_set_size_hint P_ ((struct frame *, long, int)); extern void x_wm_set_window_state P_ ((struct frame *, int)); extern void x_wm_set_icon_pixmap P_ ((struct frame *, int)); extern void x_delete_display P_ ((struct x_display_info *)); +extern void x_delete_terminal P_ ((struct terminal *terminal)); extern void x_initialize P_ ((void)); extern unsigned long x_copy_color P_ ((struct frame *, unsigned long)); #ifdef USE_X_TOOLKIT @@ -1117,6 +1119,7 @@ extern void widget_store_internal_border P_ ((Widget)); extern void x_session_initialize P_ ((struct x_display_info *dpyinfo)); extern int x_session_check_input P_ ((struct input_event *bufp)); extern int x_session_have_connection P_ ((void)); +extern void x_session_close P_ ((void)); #endif #define FONT_TYPE_FOR_UNIBYTE(font, ch) 0 |