1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Merged from

Patches applied:

 * emacs@sv.gnu.org/emacs--devo--0--patch-188
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-189
   Merge from gnus--rel--5.10

 * emacs@sv.gnu.org/emacs--devo--0--patch-190
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-191
   Undo incorrect merge of etc/images/README from Gnus 5.10

 * emacs@sv.gnu.org/emacs--devo--0--patch-192
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-193
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-194
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-195
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-196
   Merge from gnus--rel--5.10

 * emacs@sv.gnu.org/emacs--devo--0--patch-197
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-198
   Merge from gnus--rel--5.10

 * emacs@sv.gnu.org/emacs--devo--0--patch-199
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-200
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-201
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-202
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-203
   Merge from gnus--rel--5.10

 * emacs@sv.gnu.org/emacs--devo--0--patch-204
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-205
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-206
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-73
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-74
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-75
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-76
   Update from CVS: README: Addition from 5.10.6 tar ball.

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-77
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-78
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-79
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-80
   Update from CVS

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-547
This commit is contained in:
Karoly Lorentey 2006-04-10 14:52:24 +00:00
commit e349ae3b6b
108 changed files with 9647 additions and 8602 deletions

View file

@ -1,3 +1,18 @@
2006-04-01 Eli Zaretskii <eliz@gnu.org>
* configure: Regenerated.
2006-04-01 Emanuele Giaquinta <emanuele.giaquinta@gmail.com> (tiny change)
* configure.in (HAVE_XAW3D): Disable Xaw3d check if
--without-toolkit-scroll-bars was specified.
2006-04-01 Christoph Bauer <Christoph.Bauer@lms-gmbh.de> (tiny change)
* configure.in (hppa*-hp-hpux1[1-9]*): Add
-D_INCLUDE__STDC_A1_SOURCE to CFLAGS. Update Copyright years
written to src/config.in.
2006-03-18 Claudio Fontana <claudio@gnu.org>
* Makefile.in (INFO_FILES): New variable, contains all Info file names.

View file

@ -260,7 +260,7 @@ availability).
If `--with-x-toolkit=gtk' is specified, you can tell configure where
to search for GTK by specifying `--with-pkg-config-prog=PATH' where
PATH is the pathname to pkg-config. Note that GTK version 2.0 or
PATH is the pathname to pkg-config. Note that GTK version 2.4 or
newer is required for Emacs.
The `--with-gcc' option specifies that the build process should

3
configure vendored
View file

@ -2093,6 +2093,7 @@ _ACEOF
;;
hppa*-hp-hpux1[1-9]* )
machine=hp800 opsys=hpux11
CFLAGS="-D_INCLUDE__STDC_A1_SOURCE $CFLAGS"
;;
hppa*-*-linux-gnu* )
@ -11230,7 +11231,7 @@ fi
### Is -lXaw3d available?
HAVE_XAW3D=no
if test "${HAVE_X11}" = "yes"; then
if test "${USE_X_TOOLKIT}" != "none"; then
if test "${USE_X_TOOLKIT}" != "none" && test "${with_toolkit_scroll_bars}" != "no"; then
echo "$as_me:$LINENO: checking for X11/Xaw3d/Scrollbar.h" >&5
echo $ECHO_N "checking for X11/Xaw3d/Scrollbar.h... $ECHO_C" >&6
if test "${ac_cv_header_X11_Xaw3d_Scrollbar_h+set}" = set; then

View file

@ -611,6 +611,7 @@ dnl see the `changequote' comment above.
;;
hppa*-hp-hpux1[1-9]* )
machine=hp800 opsys=hpux11
CFLAGS="-D_INCLUDE__STDC_A1_SOURCE $CFLAGS"
;;
hppa*-*-linux-gnu* )
@ -2182,7 +2183,7 @@ fi
### Is -lXaw3d available?
HAVE_XAW3D=no
if test "${HAVE_X11}" = "yes"; then
if test "${USE_X_TOOLKIT}" != "none"; then
if test "${USE_X_TOOLKIT}" != "none" && test "${with_toolkit_scroll_bars}" != "no"; then
dnl Fixme: determine what Scrollbar.h needs to avoid compilation
dnl errors from the test without the `-'.
AC_CHECK_HEADER(X11/Xaw3d/Scrollbar.h,
@ -2843,7 +2844,7 @@ if test "${REL_ALLOC}" = "yes" ; then
fi
AH_TOP([/* GNU Emacs site configuration template file.
Copyright (C) 1988, 1993, 1994, 1999, 2000, 2002, 2004
Copyright (C) 1988, 1993, 1994, 1999, 2000, 2002, 2004, 2005, 2006
Free Software Foundation, Inc.
This file is part of GNU Emacs.

View file

@ -1,3 +1,7 @@
2006-04-07 Reiner Steib <Reiner.Steib@gmx.de>
* NEWS: Add string-or-null-p.
2006-03-28 Bill Wohler <wohler@newt.com>
* images/README: Update with following information.

View file

@ -3469,6 +3469,15 @@ the command `undefined'. (In earlier Emacs versions, it used
:propertize and :eval forms in the value of a variable whose
`risky-local-variable' property is nil.
---
The function `comint-send-input' now accepts 3 optional arguments:
(comint-send-input &optional no-newline artificial)
Callers sending input not from the user should use bind the 3rd
argument `artificial' to a non-nil value, to prevent Emacs from
deleting the part of subprocess output that matches the input.
---
** Support for Mocklisp has been removed.
@ -3615,6 +3624,11 @@ This is useful in packages that can be preloaded.
If it is non-nil, the function lists only faces matching this regexp.
+++
*** New function `string-or-null-p'.
Return t if OBJECT is a string or nil. Otherwise, return nil.
** Lisp code indentation features:
+++

View file

@ -9,6 +9,12 @@ to the FSF.
* Small but important fixes needed in existing features:
** Make vc-checkin avoid reverting the buffer if has not changed after
the checkin. Comparing (md5 BUFFER) to (md5 FILE) should be enough.
** Make vc-annotate show place the cursor in the annotate buffer at the
same line as the current buffer.
** buffer-offer-save should be a permanent local.
** revert-buffer should eliminate overlays and the mark.

69
etc/images/redo.xpm Normal file
View file

@ -0,0 +1,69 @@
/* XPM */
static char * stock_redo_xpm[] = {
"24 24 42 1",
" c None",
". c #000000",
"+ c #939A8D",
"@ c #BAD09D",
"# c #92998C",
"$ c #818F71",
"% c #ADBDA0",
"& c #C2D5AA",
"* c #D1DFBE",
"= c #BED2A3",
"- c #99A28F",
"; c #A8BCA6",
"> c #D5E1C6",
", c #CDDCBC",
"' c #D2E0BF",
") c #C5D7AE",
"! c #919889",
"~ c #8C9A7F",
"{ c #D4E0C5",
"] c #D3E0C1",
"^ c #BFD3A6",
"/ c #9BAA87",
"( c #B5C3A9",
"_ c #92AD62",
": c #7C9B40",
"< c #59702D",
"[ c #7F8E6B",
"} c #C8D9B2",
"| c #85A24D",
"1 c #53692A",
"2 c #A4B690",
"3 c #9BB572",
"4 c #6D8839",
"5 c #95A77E",
"6 c #8BA859",
"7 c #657255",
"8 c #98AF74",
"9 c #AFC394",
"0 c #6D7A5B",
"a c #9CAF84",
"b c #748261",
"c c #879772",
" ",
" ",
" ",
" . ",
" .. ",
" .+. ",
" ....@#. ",
" .$%&*=@-. ",
" .;>,')@@@!. ",
" .~{]*^@@@@@/. ",
" .(>_::::::<. ",
" .[}|::::::1. ",
" .23:<...:1. ",
" .@:4. .<. ",
" .@:.. .. ",
" .56. . ",
" .78. ",
" .9. ",
" .0a. ",
" .bc. ",
" ... ",
" ",
" ",
" "};

View file

@ -1,3 +1,13 @@
2006-04-02 Paul Eggert <eggert@cs.ucla.edu>
* b2m.c (main): Don't include <limits.h>.
(TM_YEAR_BASE): New macro.
(TM_YEAR_IN_ASCTIME_RANGE): Don't define if already defined, so
that s/ files can override this. Use the more-conservative range
1000-9999.
(main): Check for asctime returning NULL.
* fakemail.c: Likewise.
2006-03-27 Paul Eggert <eggert@cs.ucla.edu>
* b2m.c: Include <limits.h>.

View file

@ -1,3 +1,3 @@
This directory contains the source code for the architecture-dependent
files that go in ${archlibdir}. At present, these are mostly utility
programs used by Emacs.
programs used by GNU Emacs.

View file

@ -26,7 +26,6 @@
#undef static
#endif
#include <limits.h>
#include <stdio.h>
#include <time.h>
#include <sys/types.h>
@ -45,15 +44,13 @@
typedef int logical;
/* True if TM_YEAR is a struct tm's tm_year value that is acceptable
to asctime. Glibc asctime returns a useful string unless TM_YEAR
is nearly INT_MAX, but the C Standard lets C libraries overrun a
buffer if TM_YEAR needs more than 4 bytes. */
#ifdef __GLIBC__
# define TM_YEAR_IN_ASCTIME_RANGE(tm_year) ((tm_year) <= INT_MAX - 1900)
#else
#define TM_YEAR_BASE 1900
/* Nonzero if TM_YEAR is a struct tm's tm_year value that causes
asctime to have well-defined behavior. */
#ifndef TM_YEAR_IN_ASCTIME_RANGE
# define TM_YEAR_IN_ASCTIME_RANGE(tm_year) \
(-999 - 1900 <= (tm_year) && (tm_year) <= 9999 - 1900)
(1000 - TM_YEAR_BASE <= (tm_year) && (tm_year) <= 9999 - TM_YEAR_BASE)
#endif
/*
@ -148,9 +145,9 @@ main (argc, argv)
Don't use 'ctime', as that might dump core if the hardware clock
is set to a bizarre value. */
tm = localtime (&ltoday);
if (! (tm && TM_YEAR_IN_ASCTIME_RANGE (tm->tm_year)))
if (! (tm && TM_YEAR_IN_ASCTIME_RANGE (tm->tm_year)
&& (today = asctime (tm))))
fatal ("current time is out of range");
today = asctime (tm);
data.size = 200;
data.buffer = xnew (200, char);

View file

@ -53,7 +53,6 @@ main ()
#include "ntlib.h"
#endif
#include <limits.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
@ -71,15 +70,13 @@ main ()
#define true 1
#define false 0
/* True if TM_YEAR is a struct tm's tm_year value that is acceptable
to asctime. Glibc asctime returns a useful string unless TM_YEAR
is nearly INT_MAX, but the C Standard lets C libraries overrun a
buffer if TM_YEAR needs more than 4 bytes. */
#ifdef __GLIBC__
# define TM_YEAR_IN_ASCTIME_RANGE(tm_year) ((tm_year) <= INT_MAX - 1900)
#else
#define TM_YEAR_BASE 1900
/* Nonzero if TM_YEAR is a struct tm's tm_year value that causes
asctime to have well-defined behavior. */
#ifndef TM_YEAR_IN_ASCTIME_RANGE
# define TM_YEAR_IN_ASCTIME_RANGE(tm_year) \
(-999 - 1900 <= (tm_year) && (tm_year) <= 9999 - 1900)
(1000 - TM_YEAR_BASE <= (tm_year) && (tm_year) <= 9999 - TM_YEAR_BASE)
#endif
/* Various lists */
@ -378,9 +375,9 @@ make_file_preface ()
Don't use 'ctime', as that might dump core if the hardware clock
is set to a bizarre value. */
tm = localtime (&idiotic_interface);
if (! (tm && TM_YEAR_IN_ASCTIME_RANGE (tm->tm_year)))
if (! (tm && TM_YEAR_IN_ASCTIME_RANGE (tm->tm_year)
&& (the_date = asctime (tm))))
fatal ("current time is out of range", 0);
the_date = asctime (tm);
/* the_date has an unwanted newline at the end */
date_length = strlen (the_date) - 1;
the_date[date_length] = '\0';

View file

@ -1,3 +1,374 @@
2006-04-09 Richard Stallman <rms@gnu.org>
* mail/rmail.el (rmail-mime-charset-pattern): Ignore format and delsp
specs while looking for charset.
* textmodes/picture.el (picture-mode-exit): Run picture-mode-exit-hook.
* play/landmark.el (lm-font-lock-face-O, lm-font-lock-face-X):
Make them faces.
(lm-font-lock-keywords): Update appropriately.
2006-04-10 Kim F. Storm <storm@cua.dk>
* simple.el (filter-buffer-substring): Add NOPROPS arg, so
it can also replace buffer-substring-no-properties.
* emulation/cua-base.el (cua-delete-region, cua-paste)
(cua-repeat-replace-region): Use filter-buffer-substring.
* emulation/cua-gmrk.el (cua-copy-region-to-global-mark)
(cua-cut-region-to-global-mark): Likewise.
* emulation/cua-rect.el (cua--extract-rectangle)
(cua-incr-rectangle, cua--rectangle-aux-replace): Likewise.
2006-04-09 Roland Winkler <Roland.Winkler@physik.uni-erlangen.de>
* textmodes/bibtex.el (bibtex-entry-update): New optional arg
entry-type. Add field delimiters to numerical fields if they are
not present.
2006-04-09 Roland Winkler <Roland.Winkler@physik.uni-erlangen.de>
* textmodes/bibtex.el (bibtex-find-text-internal): Add new element
string-const to return value.
(bibtex-remove-delimiters): Use it.
2006-04-08 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/bytecomp.el (byte-compile-form): Don't call
cl-byte-compile-compiler-macro unless it exists.
2006-04-08 Eli Zaretskii <eliz@gnu.org>
* files.el (hack-local-variables-confirm) <offer-save>:
Clarify message text. Suggested by Ralf Angeli.
2006-04-08 Michael Cadilhac <michael.cadilhac@lrde.org> (tiny change)
* rect.el (kill-rectangle): Don't barf if `kill-read-only-ok' is set.
(delete-extract-rectangle-line): Use `filter-buffer-substring'
instead of `buffer-substring' and `delete-region'. (Most of the
code actually copied from `kill-region'.)
2006-04-08 Ryan Yeske <rcyeske@gmail.com>
* rcirc.el (rcirc-default-server): Rename from rcirc-server.
(rcirc-default-port): Rename from rcirc-port.
(rcirc-default-nick): Rename from rcirc-nick.
(rcirc-default-user-name): Rename from rcirc-user-name.
(rcirc-default-user-full-name): Rename from rcirc-user-full-name.
(rcirc-low-priority-flag): New variable.
(rcirc-decode-coding-system): New defcustom.
(rcirc-encode-coding-system): New defcustom.
(rcirc-coding-system-alist): New defcustom.
(rcirc-multiline-major-mode): New defcustom.
(rcirc-nick): New internal variable.
(rcirc-process): Remove variable.
(rcirc-server-buffer): New variable.
(rcirc): Update to use rcirc-default-* variables above.
(rcirc-connect): Do not add window-configuration-hook-here.
(rcirc-server): New internal variable.
(rcirc-connect): Do not send keepalive pings if
rcirc-keepalive-seconds is nil.
(with-rcirc-server-buffer): New macro.
(rcirc-send-string): Encode with rcirc-encode-coding-system.
(rcirc-server-name): Rename from rcirc-server.
(rcirc-buffer-process): New function.
(rcirc-buffer-nick): New function.
(rcirc-buffer-target): Remove function.
(set-rcirc-decode-coding-system, set-rcirc-encode-coding-system):
New commands.
(rcirc-mode-map): Change binding of C-c C-l to
rcirc-toggle-low-priority.
(rcirc-mode): Initialize coding system based on
rcirc-coding-system-alist. New change-major-mode-hook to part the
channel on a mode change. Make kill-buffer-hook buffer-local.
(rcirc-change-major-mode-hook): New function.
(rcirc-clean-up-buffer): Rename from rcirc-kill-buffer-hook-1.
(rcirc-last-post-time): New variable.
(rcirc-process-message): Store the last time user posted a message
to this target.
(rcirc-multiline-minor-mode): New mode.
(rcirc-multiline-minor-mode-map): New mode map.
(rcirc-edit-multiline): Put multiline-edit buffer in
rcirc-multiline-major-mode along with rcirc-multiline-minor-mode.
(rcirc-print): Any line starting with an ignored nick will be
ignored.
(rcirc-print): Decode using rcirc-decode-coding-system.
(rcirc-track-minor-mode): Update global-mode-string when disabling
this mode.
(minor-mode-alist): add LowPri indicator.
(rcirc-toggle-low-priority): New function.
(rcirc-last-non-irc-buffer): Prefix arg now no means switch to
next lowpriority buffer with activity.
(rcirc-record-activity): Sort buffers in rcirc-activity by the
last time the user posted a message in to the target.
(rcirc-update-activity-string): New formatting for low priority
buffers.
(rcirc-split-activity): New function.
(rcirc-handler-PART, rcirc-handler-KICK)
(rcirc-handler-PART-or-KICK): Kick responses are printed properly.
(rcirc-nick-away-alist): New variable.
(rcirc-handler-301): New handler. Away messages are printed once
per change.
2006-04-08 Eli Zaretskii <eliz@gnu.org>
* info.el (Info-follow-nearest-node): Doc fix.
* international/mule-cmds.el (set-locale-environment): Make sure
the coding-system preferred by the locale's language has the same
EOL conversion type as the original buffer-file-coding-system.
(locale-language-names): Add a few MS Windows language codes.
2006-04-07 Richard Stallman <rms@gnu.org>
* simple.el (eval-expression): Doc fix.
* emacs-lisp/lisp-mode.el (eval-print-last-sexp, eval-last-sexp)
(eval-defun): Doc fixes.
2006-04-07 Reiner Steib <Reiner.Steib@gmx.de>
* pgg-gpg.el: Revert to revision 1.8 to allow the use of
gpg-agent.
2006-04-07 Nick Roberts <nickrob@snap.net.nz>
* progmodes/gdb-ui.el (gdb-init-2): Set current filename using
GDB list command without argument for greater generality.
2006-04-06 Reiner Steib <Reiner.Steib@gmx.de>
* subr.el (string-or-null-p): New function.
* textmodes/paragraphs.el (sentence-end): Use string-or-null-p.
* textmodes/ispell.el (ispell-local-dictionary): Use
string-or-null-p.
* files.el: Update comment about safe-local-variable declarations.
2006-04-06 J.D. Smith <jdsmith@as.arizona.edu>
* progmodes/idlwave.el: Updated to IDLWAVE version 6.0. See
idlwave.org.
* progmodes/idlw-shell.el: Updated to IDLWAVE version 6.0. See
idlwave.org. Includes code to obsolete idlw-rinfo.el.
* progmodes/idlw-help.el: Updated to IDLWAVE version 6.0. See
idlwave.org.
* progmodes/idlw-complete-structtag.el: Updated to IDLWAVE
version 6.0 (minimal changes). See idlwave.org.
* progmodes/idlw-toolbar.el: Updated to IDLWAVE version
6.0 (minimal changes). See idlwave.org.
* progmodes/idlw-rinfo.el: File obsoleted and removed.
2006-04-06 Romain Francoise <romain@orebokech.com>
* pgg-gpg.el: Sync back with Gnus 5.10, reverting changes that add
symmetric encryption features and a new asynchronous interface to
GnuPG. This new version is version 1.4, plus whitespace changes.
2006-04-06 Reiner Steib <Reiner.Steib@gmx.de>
* files.el: Move some `safe-local-variable' declarations to the
respective files.
* textmodes/ispell.el (ispell-check-comments)
(ispell-local-dictionary): Mark as safe.
* abbrev.el (abbrev-mode): Mark as safe.
* add-log.el (change-log-default-name): Mark as safe.
* textmodes/reftex-vars.el (reftex-vref-is-default)
(reftex-fref-is-default, reftex-level-indent)
(reftex-guess-label-type): Mark as safe.
* textmodes/fill.el (colon-double-space): Mark as safe.
* textmodes/paragraphs.el (paragraph-start, paragraph-separate)
(sentence-end-double-space, sentence-end-without-period)
(sentence-end-without-space, sentence-end, sentence-end-base)
(page-delimiter, paragraph-ignore-fill-prefix): Mark as safe.
2006-04-06 Kim F. Storm <storm@cua.dk>
* ido.el (ido-mode): Remove ido-ignore-unc-host-regexps from
the :set-after list.
(ido-downcase-unc-hosts): New user option. Default on.
(ido-ignore-unc-host-regexps): Don't reset ido-unc-hosts-cache
when it is set, as regexps are now applied on the fly.
(ido-unc-hosts): Keep all known hosts in ido-unc-hosts-cache.
Make C-a DTRT--filter hosts through ido-ignore-unc-host-regexps
on the fly, but only when ido-process-ignore-lists is set.
Do case insensitive filtering if ido-downcase-unc-hosts is set.
Only downcase names if ido-downcase-unc-hosts is set.
2006-04-06 Juanma Barranquero <lekktu@gmail.com>
* ido.el (ido-unc-hosts-cache): Fix typo in docstring.
* woman.el (WoMan-xref-man-page): Fix call to `substring'.
2006-04-05 Kim F. Storm <storm@cua.dk>
* ido.el (ido-mode): Set after ido-unc-hosts and
ido-ignore-unc-host-regexps.
(ido-save-history): Save ido-unc-hosts-cache.
(ido-load-history): Load ido-unc-hosts-cache.
(ido-reread-directory): Refresh unc hosts cache in // dir.
* startup.el (fancy-splash-screens): Set emulation-mode-map-alists
to nil while displaying slash screen.
2006-04-05 Daiki Ueno <ueno@unixuser.org>
* pgg-gpg.el (pgg-gpg-encrypt-region, pgg-gpg-sign-region): Wait
for BEGIN_SIGNING too, new in GnuPG 1.4.3.
2006-04-05 Kenichi Handa <handa@m17n.org>
* international/characters.el: Setup cases of Latin, Greek, and
Cyrillic characters in CJK charsets.
2006-03-29 Daiki Ueno <ueno@unixuser.org>
* pgg-gpg.el (pgg-gpg-start-process): Don't bind
default-enable-multibyte-characters. This reverts the change from
revision 6.17 which is no longer necessary because the passphrase
is sent separately now. GnuPG messages are unreadable under
multibyte locales with default-enable-multibyte-characters set to
nil.
2006-04-04 Andreas Schwab <schwab@suse.de>
* files.el: Mark `left-margin', `byte-compile-dynamic-docstrings'
and `byte-compile-warnings' as `safe-local-variable'.
2006-04-04 Dan Nicolaescu <dann@ics.uci.edu>
* man.el (Man-mode-map): Restore the \r binding.
(Man-abstract-xref-man-page): If Man-target-string is a function,
call it.
(Man-highlight-references): Use Man-default-man-entry to get the
target. Deal with xrefs too.
(Man-highlight-references0): Don't call the target function.
* woman.el (WoMan-xref-man-page): Strip the section number, woman
cannot deal with it.
2006-04-04 Daiki Ueno <ueno@unixuser.org>
* pgg-gpg.el: Clean up process buffers every time gpg processes
complete.
2006-04-04 Kenichi Handa <handa@m17n.org>
* sort.el (sort-build-lists): Don't bind inhibit-field-text-motion
here.
(sort-lines, sort-numeric-fields, sort-fields, sort-columns):
Temporarily bind inhibit-field-text-motion to t.
2006-04-03 Stefan Monnier <monnier@iro.umontreal.ca>
* startup.el (normal-splash-screen): Only set mode-line-format in the
splash buffer, so as not to interfere when debugging the code.
Ignore errors when switching buffer.
2006-04-03 Romain Francoise <romain@orebokech.com>
* dired.el (dired-dnd-protocol-alist): Fix typo.
2006-04-03 Reiner Steib <Reiner.Steib@gmx.de>
* savehist.el (savehist): Add :version.
(savehist-ignored-variables): New variable.
(savehist-minibuffer-hook): Don't save variables listed in
`savehist-ignored-variables'.
* dired.el (dired-dnd-protocol-alist): Mention that change does
only apply to new buffers in doc string.
2006-04-03 Lennart Borgman <lennart.borgman.073@student.lu.se> (tiny change)
* recentf.el (recentf-open-files-item): Include newline in button
field, so opening a file will work, when the point is at the end
of the file name. Allow, for example, to [i]search a file by
extension and just push RET to open it.
2006-04-03 Daiki Ueno <ueno@unixuser.org>
* pgg-gpg.el (pgg-gpg-process-filter)
(pgg-gpg-wait-for-completion): Check if buffer is alive.
* pgg-gpg.el (pgg-gpg-process-sentinel): Don't remove GNUPG:
lines, temporary fix.
2006-04-02 Dan Nicolaescu <dann@ics.uci.edu>
* ibuf-macs.el (define-ibuffer-column): Document the new parameter.
2006-04-02 Richard Stallman <rms@gnu.org>
* progmodes/compile.el (compilation-message-face): Make it defcustom.
2006-04-02 Dan Nicolaescu <dann@ics.uci.edu>
* ibuf-macs.el (define-ibuffer-column): Add a new key:
header-mouse-map.
* ibuffer.el (ibuffer-name-header-map, ibuffer-size-header-map)
(ibuffer-mode-header-map): New keymaps.
(ibuffer-update-title-and-summary): Enable mouse face highlighting
and keybindings for column headers.
(name,size,mode) <define-ibuffer-column>: Add a header-mouse-map
property.
2006-04-02 Drew Adams <drew.adams@oracle.com> (tiny change)
* speedbar.el (speedbar-after-create-hook): Doc fix.
2006-04-02 Michael Ernst <mernst@alum.mit.edu>
* shell.el (shell-directory-tracker)
(shell-dynamic-complete-command): Doc fixes.
2006-04-01 Matt Hodges <MPHodges@member.fsf.org>
* pcomplete.el (pcomplete-show-completions): Recognize TAB on text
terminals.
2006-04-01 Kim F. Storm <storm@cua.dk>
* ido.el (ido-unc-hosts-cache): New defvar.
(ido-unc-hosts): If value of defcustom is a function, call it to
get list of UNC hosts. Add function-item choices to specify
ido-unc-hosts-net-view or user function.
(ido-ignore-unc-host-regexps): New defcustom.
(ido-unc-hosts-net-view, ido-unc-hosts): New functions.
(ido-is-unc-root, ido-is-unc-host, ido-file-name-all-completions)
(ido-exhibit): Call ido-unc-hosts to get list of UNC hosts.
2006-03-13 Stefan Monnier <monnier@iro.umontreal.ca>
* pcvs-util.el (cvs-insert-strings): Fix bug with strings longer than
wwidth.
2006-03-31 Juanma Barranquero <lekktu@gmail.com>
* ido.el (ido-cache-unc-host-shares-time, ido-report-no-match)
(ido-max-work-file-list, ido-switch-buffer)
(ido-read-file-name-as-directory-commands):
Fix typos in docstrings.
2006-03-30 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
* term/mac-win.el (mac-system-coding-system): Define and use after
@ -24,8 +395,7 @@
2006-03-27 Carsten Dominik <dominik@science.uva.nl>
* textmodes/org.el (org-get-level-face): Fix bug with level
counting.
* textmodes/org.el (org-get-level-face): Fix bug with level counting.
2006-03-26 Andreas Schwab <schwab@suse.de>
@ -60,8 +430,8 @@
(cua--init-keymaps): Use it instead of fixed C-return.
(cua-mode): Set after it.
* emulation/cua-rect.el (cua--init-rectangles): Use
cua-rectangle-mark-key instead of fixed C-return.
* emulation/cua-rect.el (cua--init-rectangles):
Use cua-rectangle-mark-key instead of fixed C-return.
2006-03-25 Nick Roberts <nickrob@snap.net.nz>
@ -97,8 +467,7 @@
* progmodes/gdb-ui.el (gdb-continuation): Declare earlier to
prevent compiler warnings.
(gdb-stopped): Check for gud-last-last-frame (case: signal).
(breakpoint-disabled): Make lighter for contrast with overlay
arrow.
(breakpoint-disabled): Make lighter for contrast with overlay arrow.
(gdb-assembler-custom): Use hollow-right-triangle for assembler
buffer too.
@ -433,11 +802,6 @@
* tree-widget.el (tree-widget-themes-load-path)
(tree-widget-themes-directory, tree-widget-theme): Doc fix.
2006-03-13 Stefan Monnier <monnier@iro.umontreal.ca>
* pcvs-util.el (cvs-insert-strings): Fix bug with strings longer than
wwidth.
2006-03-13 Ryan Yeske <rcyeske@gmail.com>
* net/rcirc.el (rcirc) <defgroup>: Add link to manual.
@ -1028,7 +1392,7 @@
(org-format-org-table-html, org-format-table-table-html):
Fix typos in docstrings.
12006-02-23 Carsten Dominik <dominik@science.uva.nl>
2006-02-23 Carsten Dominik <dominik@science.uva.nl>
* textmodes/org.el (org-cleaned-string-for-export)
(org-solidify-link-text): New function.
@ -6340,7 +6704,7 @@
2005-11-24 Carsten Dominik <dominik@science.uva.nl>
* textmodes/org.el (org-export-plain-list-max-depth): Renamed from
* textmodes/org.el (org-export-plain-list-max-depth): Rename from
`org-export-local-list-max-depth'. Change default value to 3.
(org-auto-renumber-ordered-lists)
(org-plain-list-ordered-item-terminator): New options.
@ -15187,7 +15551,7 @@
* add-log.el (change-log-font-lock-keywords): Make the regexp for
date lines stricter.
2005-06-10 Zhang Wei <id.brep@gmail.com> (tiny change)
2005-06-10 Zhang Wei <id.brep@gmail.com>
* term/x-win.el (x-clipboard-yank): Use x-selection-value instead
of x-get-selection.

View file

@ -58,6 +58,7 @@ Interactively, use the command `abbrev-mode'
to enable or disable Abbrev mode in the current buffer."
:type 'boolean
:group 'abbrev-mode)
;;;###autoload(put 'abbrev-mode 'safe-local-variable t)
(defvar edit-abbrevs-map

View file

@ -45,6 +45,8 @@
:type '(choice (const :tag "default" nil)
string)
:group 'change-log)
(put 'change-log-default-name 'safe-local-variable
(lambda (a) (or (stringp a) (null a))))
(defcustom change-log-mode-hook nil
"Normal hook run by `change-log-mode'."

View file

@ -206,7 +206,8 @@ with the buffer narrowed to the listing."
("^file:" . dired-dnd-handle-local-file))
"The functions to call when a drop in `dired-mode' is made.
See `dnd-protocol-alist' for more information. When nil, behave
as in other buffers."
as in other buffers. Changing this option is effective only for
new dired buffers."
:type '(choice (repeat (cons (regexp) (function)))
(const :tag "Behave as in other buffers" nil))
:version "22.1"

View file

@ -2765,9 +2765,15 @@ If FORM is a lambda or a macro, byte-compile it as a function."
(byte-compile-warn "`%s' used from Lisp code\n\
That command is designed for interactive use only" fn))
(if (and handler
(or (not (byte-compile-version-cond
byte-compile-compatibility))
(not (get (get fn 'byte-opcode) 'emacs19-opcode))))
;; Make sure that function exists. This is important
;; for CL compiler macros since the symbol may be
;; `cl-byte-compile-compiler-macro' but if CL isn't
;; loaded, this function doesn't exist.
(or (not (memq handler '(cl-byte-compile-compiler-macro)))
(fboundp handler))
(not (and (byte-compile-version-cond
byte-compile-compatibility)
(get (get fn 'byte-opcode) 'emacs19-opcode))))
(funcall handler form)
(when (memq 'callargs byte-compile-warnings)
(if (memq fn '(custom-declare-group custom-declare-variable custom-declare-face))

View file

@ -443,6 +443,9 @@ if that value is non-nil.")
(defun eval-print-last-sexp ()
"Evaluate sexp before point; print value into current buffer.
If `eval-expression-debug-on-error' is non-nil, which is the default,
this command arranges for all errors to enter the debugger.
Note that printing the result is controlled by the variables
`eval-expression-print-length' and `eval-expression-print-level',
which see."
@ -614,7 +617,10 @@ With argument, print output into current buffer."
(defun eval-last-sexp (eval-last-sexp-arg-internal)
"Evaluate sexp before point; print value in minibuffer.
Interactively, with prefix argument, print output into current buffer."
Interactively, with prefix argument, print output into current buffer.
If `eval-expression-debug-on-error' is non-nil, which is the default,
this command arranges for all errors to enter the debugger."
(interactive "P")
(if (null eval-expression-debug-on-error)
(eval-last-sexp-1 eval-last-sexp-arg-internal)
@ -722,6 +728,9 @@ expression even if the variable already has some other value.
\(Normally `defvar' and `defcustom' do not alter the value if there
already is one.)
If `eval-expression-debug-on-error' is non-nil, which is the default,
this command arranges for all errors to enter the debugger.
With a prefix argument, instrument the code for Edebug.
If acting on a `defun' for FUNCTION, and the function was

View file

@ -769,7 +769,7 @@ Save a copy in register 0 if `cua-delete-copy-to-register-0' is non-nil."
(let ((start (mark)) (end (point)))
(or (<= start end)
(setq start (prog1 end (setq end start))))
(setq cua--last-deleted-region-text (buffer-substring start end))
(setq cua--last-deleted-region-text (filter-buffer-substring start end))
(if cua-delete-copy-to-register-0
(set-register ?0 cua--last-deleted-region-text))
(delete-region start end)
@ -858,7 +858,7 @@ If global mark is active, copy from register or one character."
(if regtxt
(cua--insert-at-global-mark regtxt)
(when (not (eobp))
(cua--insert-at-global-mark (buffer-substring (point) (+ (point) count)))
(cua--insert-at-global-mark (filter-buffer-substring (point) (+ (point) count)))
(forward-char count))))
(buffer-read-only
(message "Cannot paste into a read-only buffer"))
@ -875,7 +875,7 @@ If global mark is active, copy from register or one character."
(setq paste-lines (cua--delete-rectangle))
(if (= paste-lines 1)
(setq paste-lines nil))) ;; paste all
(if (string= (buffer-substring (point) (mark))
(if (string= (filter-buffer-substring (point) (mark))
(car kill-ring))
(current-kill 1))
(cua-delete-region)))
@ -950,7 +950,7 @@ of text."
(setq s (car u) e (cdr u)))))))
(setq cua--repeat-replace-text
(cond ((and s e (<= s e) (= s (mark t)))
(buffer-substring-no-properties s e))
(filter-buffer-substring s e nil t))
((and (null s) (eq u elt)) ;; nothing inserted
"")
(t

View file

@ -143,7 +143,7 @@ With prefix argument, don't jump to global mark when cancelling it."
(let ((src-buf (current-buffer)))
(save-excursion
(if (equal (marker-buffer cua--global-mark-marker) src-buf)
(let ((text (buffer-substring-no-properties start end)))
(let ((text (filter-buffer-substring start end nil t)))
(goto-char (marker-position cua--global-mark-marker))
(insert text))
(set-buffer (marker-buffer cua--global-mark-marker))
@ -167,7 +167,7 @@ With prefix argument, don't jump to global mark when cancelling it."
(if (and (< start (marker-position cua--global-mark-marker))
(< (marker-position cua--global-mark-marker) end))
(message "Can't move region into itself")
(let ((text (buffer-substring-no-properties start end))
(let ((text (filter-buffer-substring start end nil t))
(p1 (copy-marker start))
(p2 (copy-marker end)))
(goto-char (marker-position cua--global-mark-marker))

View file

@ -631,7 +631,7 @@ If command is repeated at same position, delete the rectangle."
(if (not (cua--rectangle-virtual-edges))
(cua--rectangle-operation nil nil nil nil nil ; do not tabify
'(lambda (s e l r)
(setq rect (cons (buffer-substring-no-properties s e) rect))))
(setq rect (cons (filter-buffer-substring s e nil t) rect))))
(cua--rectangle-operation nil 1 nil nil nil ; do not tabify
'(lambda (s e l r v)
(let ((copy t) (bs 0) (as 0) row)
@ -649,7 +649,7 @@ If command is repeated at same position, delete the rectangle."
(setq as (- r (max (current-column) l))
e (point)))
(setq row (if (and copy (> e s))
(buffer-substring-no-properties s e)
(filter-buffer-substring s e nil t)
""))
(when (> bs 0)
(setq row (concat (make-string bs ?\s) row)))
@ -1127,12 +1127,12 @@ The length of STRING need not be the same as the rectangle width."
'(lambda (s e l r)
(cond
((re-search-forward "0x\\([0-9a-fA-F]+\\)" e t)
(let* ((txt (buffer-substring-no-properties (match-beginning 1) (match-end 1)))
(let* ((txt (filter-buffer-substring (match-beginning 1) (match-end 1) nil t))
(n (string-to-number txt 16))
(fmt (format "0x%%0%dx" (length txt))))
(replace-match (format fmt (+ n increment)))))
((re-search-forward "\\( *-?[0-9]+\\)" e t)
(let* ((txt (buffer-substring-no-properties (match-beginning 1) (match-end 1)))
(let* ((txt (filter-buffer-substring (match-beginning 1) (match-end 1) nil t))
(prefix (if (= (aref txt 0) ?0) "0" ""))
(n (string-to-number txt 10))
(fmt (format "%%%s%dd" prefix (length txt))))
@ -1213,7 +1213,7 @@ The numbers are formatted according to the FORMAT string."
(when replace
(goto-char (point-min))
(while (not (eobp))
(setq z (cons (buffer-substring (point) (line-end-position)) z))
(setq z (cons (filter-buffer-substring (point) (line-end-position)) z))
(forward-line 1))))
(if (not cua--debug)
(kill-buffer auxbuf))

View file

@ -197,7 +197,7 @@
* erc.el (erc-version-string): Release ERC 5.1.1.
2006-02-03 Zhang Wei <id.brep@gmail.com> (tiny change)
2006-02-03 Zhang Wei <id.brep@gmail.com>
* erc.el (erc-version-string): Don't hard-code Emacs version.
(erc-version): Use emacs-version.

View file

@ -2323,40 +2323,44 @@ asking you for confirmation."
;; Safe local variables:
;;
;; For variables defined by minor modes, put the safety declarations
;; here, not in the file defining the minor mode (when Emacs visits a
;; file specifying that local variable, the minor mode file may not be
;; loaded yet). For variables defined by major modes, the safety
;; declarations can go into the major mode's file, since that will be
;; loaded before file variables are processed.
;; For variables defined by major modes, the safety declarations can go into
;; the major mode's file, since that will be loaded before file variables are
;; processed.
;;
;; For variables defined by minor modes, put the safety declarations in the
;; file defining the minor mode after the defcustom/defvar using an autoload
;; cookie, e.g.:
;;
;; ;;;###autoload(put 'variable 'safe-local-variable 'stringp)
;;
;; Otherwise, when Emacs visits a file specifying that local variable, the
;; minor mode file may not be loaded yet.
;;
;; For variables defined in the C source code the declaration should go here:
;; FIXME: Some variables should be moved according to the rules above.
(let ((string-or-null (lambda (a) (or (stringp a) (null a)))))
(eval
`(mapc (lambda (pair)
(put (car pair) 'safe-local-variable (cdr pair)))
'((byte-compile-dynamic . t)
(byte-compile-dynamic-docstrings . t)
(byte-compile-warnings . t)
(c-basic-offset . integerp)
(c-file-style . stringp)
(c-indent-level . integerp)
(comment-column . integerp)
(compile-command . ,string-or-null)
(compile-command . string-or-null-p)
(fill-column . integerp)
(fill-prefix . ,string-or-null)
(fill-prefix . string-or-null-p)
(indent-tabs-mode . t)
(ispell-check-comments . (lambda (a)
(memq a '(nil t exclusive))))
(ispell-local-dictionary . ,string-or-null)
(kept-new-versions . integerp)
(left-margin . t)
(no-byte-compile . t)
(no-update-autoloads . t)
(outline-regexp . ,string-or-null)
(page-delimiter . ,string-or-null)
(paragraph-start . ,string-or-null)
(paragraph-separate . ,string-or-null)
(sentence-end . ,string-or-null)
(sentence-end-double-space . t)
(tab-width . integerp)
(truncate-lines . t)
(outline-regexp . string-or-null-p)
(tab-width . integerp) ;; C source code
(truncate-lines . t) ;; C source code
(version-control . t)))))
(put 'c-set-style 'safe-local-eval-function t)
@ -2389,8 +2393,8 @@ y -- to apply the local variables list.
n -- to ignore the local variables list.")
(if offer-save
(insert "
! -- to apply the local variables list, and mark these values (*) as
safe (in the future, they can be set automatically.)\n\n")
! -- to apply the local variables list, and permanently mark these
values (*) as safe (in the future, they will be set automatically.)\n\n")
(insert "\n\n"))
(dolist (elt vars)
(cond ((member elt unsafe-vars)

View file

@ -1,3 +1,18 @@
2006-04-06 Reiner Steib <Reiner.Steib@gmx.de>
* gnus-fun.el (gnus): Require it for gnus-directory.
2006-04-04 Andreas Seltenreich <uwi7@rz.uni-karlsruhe.de>
* nnweb.el (nnweb-google-create-mapping): Update regexp. Some
whitespace was matched into the url, which broke browsing hits
> 100 when mm-url-use-external was nil.
2006-03-31 Reiner Steib <Reiner.Steib@gmx.de>
* gnus-group.el (gnus-group-update-tool-bar): Add :initialize and
:set.
2006-03-23 Katsumi Yamaoka <yamaoka@jpl.org>
* mml.el (mml-insert-mime): Ignore cached contents of
@ -2132,6 +2147,10 @@
* nnrss.el (nnrss-fetch): Signal an error if w3-parse-buffer also
failed.
2005-04-06 Joakim Verona <joakim@verona.se> (tiny change)
* nnrss.el (nnrss-read-group-data): Fix off-by-one error.
2005-04-06 Jesper Harder <harder@ifa.au.dk>
* mm-util.el (mm-subst-char-in-string): Support inplace.
@ -2142,9 +2161,8 @@
(nnrss-request-delete-group): Use nnrss-make-filename.
(nnrss-read-server-data): Use nnrss-make-filename; use load.
(nnrss-save-server-data): Use nnrss-make-filename; use gnus-prin1.
(nnrss-read-group-data): Fix off-by-one error. From Joakim Verona
<joakim@verona.se>; hash on description if link is missing; use
nnrss-make-filename; use load.
(nnrss-read-group-data): hash on description if link is missing;
use nnrss-make-filename; use load.
(nnrss-save-group-data): Use nnrss-make-filename; use gnus-prin1.
(nnrss-make-filename): New function.
(nnrss-close): New function.
@ -2293,11 +2311,10 @@
* nnmaildir.el (nnmaildir-request-accept-article):
Use `nnheader-cancel-timer' for compatibility with current XEmacs.
2005-03-13 Steve Youngs <steve@sxemacs.org>
2005-03-13 Andrey Slusar <anrays@gmail.com> (tiny change)
* gnus.el: Don't try and mark `gnus-agent-save-groups' as an
autoloaded function.
From: Andrey Slusar <anrays@gmail.com>.
2005-03-13 Steve Youngs <steve@sxemacs.org>
@ -2659,6 +2676,11 @@
article buffer with a draft file. This is a temporary measure
against the 2004-08-22 change to gnus-article-edit-mode.
2004-11-02 From Ilya N. Golubev <gin@mo.msk.ru>.
* mm-util.el (mm-mime-mule-charset-alist): Add the windows-1251
entry.
2004-11-02 Katsumi Yamaoka <yamaoka@jpl.org>
* html2text.el (html2text-get-attr): Remove unused argument `tag'.
@ -2667,11 +2689,9 @@
* mm-util.el (mm-enrich-utf-8-by-mule-ucs): Fix cleaning of
after-load-alist.
* mm-util.el (mm-mime-mule-charset-alist): Add the windows-1251
entry. From Ilya N. Golubev <gin@mo.msk.ru>.
(mm-enrich-utf-8-by-mule-ucs): New function run when Mule-UCS is
loaded under XEmacs.
(): Don't make duplicated entries in mm-mime-mule-charset-alist.
* mm-util.el (mm-enrich-utf-8-by-mule-ucs): New function run when
Mule-UCS is loaded under XEmacs.
(mm-mime-mule-charset-alist): Avoid duplicated entries.
* mm-util.el (mm-coding-system-p): Return a coding-system.
(mm-mime-mule-charset-alist): Use shift_jis instead of
@ -3277,6 +3297,10 @@
* mm-decode.el (mm-copy-to-buffer): Don't use set-buffer-multibyte.
2004-09-26 Christian Neukirchen <chneukirchen@yahoo.de> (tiny change)
* mm-util.el (mm-image-load-path): Handle nil in load-path.
2004-09-26 Jesper Harder <harder@ifa.au.dk>
* gnus-msg.el (gnus-post-news): Use blank Newsgroups line if
@ -3306,9 +3330,6 @@
* gnus-cache.el (gnus-cache-save-buffers): Check if buffer is
alive. Reported by Laurent Martelli <laurent@aopsys.com>.
* mm-util.el (mm-image-load-path): Handle nil in load-path.
From Christian Neukirchen <chneukirchen@yahoo.de>.
* html2text.el (html2text-replace-list): Add &amp; and &apos;.
* nnheader.el (nnheader-max-head-length): Increase to 8192.
@ -3532,7 +3553,8 @@
* gnus-sum.el (gnus-summary-insert-subject): Remove list identifiers.
From Hiroshi Fujishima <pooh@nature.tsukuba.ac.jp> (tiny change).
2004-09-03 Hiroshi Fujishima <pooh@nature.tsukuba.ac.jp> (tiny change)
* spam-stat.el (spam-stat-reduce-size): Set spam-stat-dirty.
(spam-stat-save): Accept prefix argument.
@ -3555,7 +3577,7 @@
* pgg-pgp.el (pgg-pgp-verify-region): Clean up.
2004-05-19 Michael Schierl <schierlm-usenet@gmx.de>
2004-05-19 Michael Schierl <schierlm-usenet@gmx.de> (tiny change)
* pgg-pgp.el (pgg-pgp-verify-region): Default when signature
isn't a string.
@ -3674,8 +3696,25 @@
* gnus-agent.el (gnus-agent-restore-gcc): Use ^ and regexp-quote.
* gnus-sum.el (gnus-newsgroup-variables): Doc fix (tiny change).
From Helmut Waitzmann <Helmut.Waitzmann@web.de>.
2004-08-30 Helmut Waitzmann <Helmut.Waitzmann@web.de> (tiny change)
* gnus-sum.el (gnus-newsgroup-variables): Doc fix.
2004-08-26 YAGI Tatsuya <ynyaaa@ybb.ne.jp> (tiny change)
* gnus-art.el (gnus-article-next-page): Fix the way to find a real
end-of-buffer.
2004-08-26 Stefan Wiens <s.wi@gmx.net> (tiny change)
* gnus-sum.el (gnus-read-header): Don't remove a header for the
parent article of a sparse article in the thread hashtb.
2004-08-26 David Hedbor <dhedbor@real.com> (tiny change)
* nnmail.el (nnmail-split-lowercase-expanded): New user option.
(nnmail-expand-newtext): Lowercase expanded entries if
nnmail-split-lowercase-expanded is non-nil.
* gnus-agent.el (gnus-agent-regenerate-group): Activate the group
when the group's active is not available.
@ -3683,8 +3722,6 @@
* gnus-art.el (article-hide-headers): Refer to the values for
gnus-ignored-headers and gnus-visible-headers in the summary
buffer since a user may have set them as group parameters.
(gnus-article-next-page): Fix the way to find a real end-of-buffer
(tiny change). From YAGI Tatsuya <ynyaaa@ybb.ne.jp>.
(gnus-article-read-summary-keys): Restore new window-start and
hscroll to summary window.
(gnus-prev-page-map): Remove duplicated one.
@ -3713,10 +3750,6 @@
* gnus-spec.el (gnus-update-format): Replace pp-to-string with
gnus-pp-to-string.
* gnus-sum.el (gnus-read-header): Don't remove a header for the
parent article of a sparse article in the thread hashtb.
From Stefan Wiens <s.wi@gmx.net>.
* gnus-util.el (gnus-bind-print-variables): New macro.
(gnus-prin1): Use it.
(gnus-prin1-to-string): Use it.
@ -3756,11 +3789,6 @@
(nndoc-rfc822-forward-generate-article): New function.
(nndoc-rfc822-forward-generate-head): New function.
From David Hedbor <dhedbor@real.com>.
* nnmail.el (nnmail-split-lowercase-expanded): New user option.
(nnmail-expand-newtext): Lowercase expanded entries if
nnmail-split-lowercase-expanded is non-nil.
* score-mode.el (gnus-score-pretty-print): Replace pp with gnus-pp.
* webmail.el (webmail-debug): Replace pp with gnus-pp.

View file

@ -32,6 +32,7 @@
(require 'mm-util)
(require 'gnus-ems)
(require 'gnus-util)
(require 'gnus)
(defcustom gnus-x-face-directory (expand-file-name "x-faces" gnus-directory)
"*Directory where X-Face PBM files are stored."

View file

@ -1389,6 +1389,13 @@ if it is a string, only list groups matching REGEXP."
"Force updating the group buffer tool bar."
:group 'gnus-group
:version "22.1"
:initialize 'custom-initialize-default
:set (lambda (symbol value)
(set-default symbol value)
(when (gnus-alive-p)
(with-current-buffer gnus-group-buffer
;; FIXME: Is there a better way to redraw the group buffer?
(gnus-group-get-new-news 0))))
:type 'boolean)
(defun gnus-group-insert-group-line (gnus-tmp-group gnus-tmp-level

View file

@ -415,7 +415,7 @@ Valid types include `google', `dejanews', and `gmane'.")
(goto-char (point-min))
(incf i 100)
(if (or (not (re-search-forward
"<a href=\"\n\\([^>\"]+\\)\"><img src=\"[^\"]+next"
"<a href=\"\n\\([^>\" \n\t]+\\)[^<]*<img src=[^>]+next"
nil t))
(>= i nnweb-max-hits))
(setq more nil)

View file

@ -75,8 +75,8 @@ During evaluation of body, bind `it' to the value returned by TEST."
;; (put 'ibuffer-save-marks 'lisp-indent-function 0)
;;;###autoload
(defmacro* define-ibuffer-column (symbol (&key name inline props
summarizer) &rest body)
(defmacro* define-ibuffer-column (symbol (&key name inline props summarizer
header-mouse-map) &rest body)
"Define a column SYMBOL for use with `ibuffer-formats'.
BODY will be called with `buffer' bound to the buffer object, and
@ -90,6 +90,9 @@ the text, such as `mouse-face'. And SUMMARIZER, if given, is a
function which will be passed a list of all the strings in its column;
it should return a string to display at the bottom.
If HEADER-MOUSE-MAP is given, it will be used as a keymap for the
title of the column.
Note that this macro expands into a `defun' for a function named
ibuffer-make-column-NAME. If INLINE is non-nil, then the form will be
inlined into the compiled format versions. This means that if you
@ -115,6 +118,7 @@ change its definition, you should explicitly call
,(if (stringp name)
name
(capitalize (symbol-name symbol))))
,(if header-mouse-map `(put (quote ,sym) 'header-mouse-map ,header-mouse-map))
,(if summarizer
;; Store the name of the summarizing function.
`(put (quote ,sym) 'ibuffer-column-summarizer

View file

@ -829,6 +829,21 @@ directory, like `default-directory'."
(define-key map (kbd "RET") 'ibuffer-interactive-filter-by-mode)
map))
(defvar ibuffer-name-header-map
(let ((map (make-sparse-keymap)))
(define-key map [(mouse-1)] 'ibuffer-do-sort-by-alphabetic)
map))
(defvar ibuffer-size-header-map
(let ((map (make-sparse-keymap)))
(define-key map [(mouse-1)] 'ibuffer-do-sort-by-size)
map))
(defvar ibuffer-mode-header-map
(let ((map (make-sparse-keymap)))
(define-key map [(mouse-1)] 'ibuffer-do-sort-by-major-mode)
map))
(defvar ibuffer-mode-filter-group-map
(let ((map (make-sparse-keymap)))
(define-key map [(mouse-1)] 'ibuffer-mouse-toggle-mark)
@ -1666,6 +1681,7 @@ If point is on a group name, this function operates on that group."
(define-ibuffer-column name
(:inline t
:header-mouse-map ibuffer-name-header-map
:props
('mouse-face 'highlight 'keymap ibuffer-name-map
'ibuffer-name-column t
@ -1682,6 +1698,7 @@ If point is on a group name, this function operates on that group."
(define-ibuffer-column size
(:inline t
:header-mouse-map ibuffer-size-header-map
:summarizer
(lambda (column-strings)
(let ((total 0))
@ -1695,6 +1712,7 @@ If point is on a group name, this function operates on that group."
(define-ibuffer-column mode
(:inline t
:header-mouse-map ibuffer-mode-header-map
:props
('mouse-face 'highlight
'keymap ibuffer-mode-name-map
@ -2009,12 +2027,18 @@ the value of point at the beginning of the line for that buffer."
(setq min (- min)))
(let* ((name (or (get sym 'ibuffer-column-name)
(error "Unknown column %s in ibuffer-formats" sym)))
(len (length name)))
(if (< len min)
(ibuffer-format-column name
(- min len)
align)
name))))))
(len (length name))
(hmap (get sym 'header-mouse-map))
(strname (if (< len min)
(ibuffer-format-column name
(- min len)
align)
name)))
(when hmap
(setq
strname
(propertize strname 'mouse-face 'highlight 'keymap hmap)))
strname)))))
(add-text-properties opos (point) `(ibuffer-title-header t))
(insert "\n")
;; Add the underlines

View file

@ -360,7 +360,10 @@ use either \\[customize] or the function `ido-mode'."
:initialize 'custom-initialize-set
:require 'ido
:link '(emacs-commentary-link "ido.el")
:set-after '(ido-save-directory-list-file)
:set-after '(ido-save-directory-list-file
;; This will clear ido-unc-hosts-cache, so set it
;; before loading history file.
ido-unc-hosts)
:type '(choice (const :tag "Turn on only buffer" buffer)
(const :tag "Turn on only file" file)
(const :tag "Turn on both buffer and file" both)
@ -630,22 +633,44 @@ equivalent function, e.g. `find-file' rather than `ido-find-file'."
:type '(repeat regexp)
:group 'ido)
(defvar ido-unc-hosts-cache t
"Cached value from `ido-unc-hosts' function.")
(defcustom ido-unc-hosts nil
"*List of known UNC host names to complete after initial //."
:type '(repeat string)
"*List of known UNC host names to complete after initial //.
If value is a function, that function is called to search network for
hosts on first use of UNC path."
:type '(choice (repeat :tag "List of UNC host names" string)
(function-item :tag "Use `NET VIEW'"
:value ido-unc-hosts-net-view)
(function :tag "Your own function"))
:set #'(lambda (symbol value)
(set symbol value)
(setq ido-unc-hosts-cache t))
:group 'ido)
(defcustom ido-downcase-unc-hosts t
"*Non-nil if UNC host names should be downcased."
:type 'boolean
:group 'ido)
(defcustom ido-ignore-unc-host-regexps nil
"*List of regexps matching UNC hosts to ignore.
Case is ignored if `ido-downcase-unc-hosts' is set."
:type '(repeat regexp)
:group 'ido)
(defcustom ido-cache-unc-host-shares-time 8.0
"*Maximum time to cache shares of an UNC host (in hours).
Use C-l in prompt to refresh list.
If zero, unc host shares are not cached."
If zero, UNC host shares are not cached."
:type 'number
:group 'ido)
(defcustom ido-max-work-file-list 10
"*Maximum number of names of recently opened files to record.
This is the list the file names (sans directory) which have most recently
been opened. See `ido-work-file-list' and `ido-save-directory-list-file'."
been opened. See `ido-work-file-list' and `ido-save-directory-list-file'."
:type 'integer
:group 'ido)
@ -891,7 +916,7 @@ Must be set before enabling ido mode."
:group 'ido)
(defcustom ido-read-file-name-as-directory-commands '()
"List of commands which uses read-file-name to read a directory name.
"List of commands which uses `read-file-name' to read a directory name.
When `ido-everywhere' is non-nil, the commands in this list will read
the directory using `ido-read-directory-name'."
:type '(repeat symbol)
@ -988,7 +1013,7 @@ Copied from `icomplete-eoinput'.")
"List of files currently matching `ido-text'.")
(defvar ido-report-no-match t
"Report [No Match] when no completions matches ido-text.")
"Report [No Match] when no completions matches `ido-text'.")
(defvar ido-exit nil
"Flag to monitor how `ido-find-file' exits.
@ -1111,18 +1136,65 @@ it doesn't interfere with other minibuffer usage.")
(pop-to-buffer b t t)
(setq truncate-lines t)))))
(defun ido-unc-hosts (&optional query)
"Return list of UNC host names."
(let ((hosts
(cond
((listp ido-unc-hosts)
ido-unc-hosts) ;; static list or nil
((listp ido-unc-hosts-cache)
ido-unc-hosts-cache) ;; result of net search
((and query (fboundp ido-unc-hosts))
(message (propertize "Searching for UNC hosts..." 'face 'highlight))
(setq ido-unc-hosts-cache (funcall ido-unc-hosts))
(message nil)
ido-unc-hosts-cache)
(query
(setq ido-unc-hosts-cache nil))
(t (fboundp ido-unc-hosts)))))
(when query
(let ((case-fold-search ido-downcase-unc-hosts)
res host re-list re)
(while hosts
(setq host (car hosts)
hosts (cdr hosts)
re-list (and ido-process-ignore-lists
ido-ignore-unc-host-regexps))
(while re-list
(setq re (car re-list)
re-list (cdr re-list))
(if (string-match re host)
(setq re-list nil
host nil)))
(when host
(when ido-downcase-unc-hosts
(setq host (downcase host)))
(setq res (cons host res))))
(setq hosts (sort res #'string<))))
hosts))
(defun ido-unc-hosts-net-view ()
"Query network for list of UNC host names using `NET VIEW'."
(let (hosts)
(with-temp-buffer
(shell-command "net view" t)
(goto-char (point-min))
(while (re-search-forward "^\\\\\\\\\\([[:graph:]]+\\)" nil t)
(setq hosts (cons (match-string 1) hosts))))
hosts))
(defun ido-is-tramp-root (&optional dir)
(and ido-enable-tramp-completion
(string-match "\\`/[^/]+[@:]\\'"
(or dir ido-current-directory))))
(defun ido-is-unc-root (&optional dir)
(and ido-unc-hosts
(and (ido-unc-hosts)
(string-equal "//"
(or dir ido-current-directory))))
(defun ido-is-unc-host (&optional dir)
(and ido-unc-hosts
(and (ido-unc-hosts)
(string-match "\\`//[^/]+/\\'"
(or dir ido-current-directory))))
@ -1221,6 +1293,9 @@ it doesn't interfere with other minibuffer usage.")
(ido-pp 'ido-work-directory-list)
(ido-pp 'ido-work-file-list)
(ido-pp 'ido-dir-file-cache "\n\n ")
(if (listp ido-unc-hosts-cache)
(ido-pp 'ido-unc-hosts-cache)
(insert "\n;; ----- ido-unc-hosts-cache -----\nt\n"))
(insert "\n")
(write-file ido-save-directory-list-file nil))
(kill-buffer buf)))))
@ -1242,7 +1317,8 @@ With prefix argument, reload history unconditionally."
(setq ido-last-directory-list (read (current-buffer))
ido-work-directory-list (read (current-buffer))
ido-work-file-list (read (current-buffer))
ido-dir-file-cache (read (current-buffer)))
ido-dir-file-cache (read (current-buffer))
ido-unc-hosts-cache (read (current-buffer)))
(error nil)))
(kill-buffer buf)))))
(ido-wash-history))
@ -1699,7 +1775,7 @@ With ARG, turn ido speed-up on if arg is positive, off otherwise."
;; the relevant function is called (find-file, write-file, etc).
(defun ido-read-internal (item prompt history &optional default require-match initial)
"Perform the ido-read-buffer and ido-read-file-name functions.
"Perform the `ido-read-buffer' and `ido-read-file-name' functions.
Return the name of a buffer or file selected.
PROMPT is the prompt to give to the user.
DEFAULT if given is the default directory to start with.
@ -2523,7 +2599,9 @@ timestamp has not changed (e.g. with ftp or on Windows)."
(interactive)
(if (and ido-mode (eq ido-cur-item 'file))
(progn
(ido-remove-cached-dir ido-current-directory)
(if (ido-is-unc-root)
(setq ido-unc-hosts-cache t)
(ido-remove-cached-dir ido-current-directory))
(setq ido-text-init ido-text)
(setq ido-rotate-temp t)
(setq ido-exit 'refresh)
@ -3238,7 +3316,7 @@ for first matching file."
(mapcar
(lambda (host)
(if (string-match "/\\'" host) host (concat host "/")))
ido-unc-hosts))
(ido-unc-hosts t)))
((and (numberp ido-max-dir-file-cache) (> ido-max-dir-file-cache 0)
(stringp dir) (> (length dir) 0)
(ido-may-cache-directory dir))
@ -3734,7 +3812,7 @@ default is to show it in the same window, unless it is already visible
in another frame.
As you type in a string, all of the buffers matching the string are
displayed if substring-matching is used \(default). Look at
displayed if substring-matching is used \(default). Look at
`ido-enable-prefix' and `ido-toggle-prefix'. When you have found the
buffer you want, it can then be selected. As you type, most keys have
their normal keybindings, except for the following: \\<ido-buffer-completion-map>
@ -3757,7 +3835,7 @@ in a separate window.
\\[ido-toggle-prefix] Toggle between substring and prefix matching.
\\[ido-toggle-case] Toggle case-sensitive searching of buffer names.
\\[ido-completion-help] Show list of matching buffers in separate window.
\\[ido-enter-find-file] Drop into ido-find-file.
\\[ido-enter-find-file] Drop into `ido-find-file'.
\\[ido-kill-buffer-at-head] Kill buffer at head of buffer list.
\\[ido-toggle-ignore] Toggle ignoring buffers listed in `ido-ignore-buffers'."
(interactive)
@ -4026,7 +4104,7 @@ For details of keybindings, do `\\[describe-function] ido-find-file'."
((and (ido-is-tramp-root) (string-equal contents "/"))
(ido-set-current-directory ido-current-directory contents)
(setq refresh t))
((and ido-unc-hosts (string-equal contents "/")
((and (ido-unc-hosts) (string-equal contents "/")
(let ((ido-enable-tramp-completion nil))
(ido-is-root-directory)))
(ido-set-current-directory "//")

View file

@ -3044,7 +3044,11 @@ At end of the node's text, moves to the next node, or up if none."
(defun Info-follow-nearest-node (&optional fork)
"Follow a node reference near point.
If point is on a reference, follow that reference. Otherwise,
if point is in a menu item description, follow that menu item."
if point is in a menu item description, follow that menu item.
If FORK is non-nil (interactively with a prefix arg), show the node in
a new Info buffer.
If FORK is a string, it is the name to use for the new buffer."
(interactive "P")
(or (Info-try-follow-nearest-node fork)
(when (save-excursion

View file

@ -177,6 +177,17 @@
(modify-category-entry (make-char 'chinese-gb2312 row) ?C)
(setq row (1+ row))))
(let ((tbl (standard-case-table)))
(dotimes (i 26)
(set-case-syntax-pair (make-char 'chinese-gb2312 #x23 (+ #x41 i))
(make-char 'chinese-gb2312 #x23 (+ #x61 i)) tbl))
(dotimes (i 24)
(set-case-syntax-pair (make-char 'chinese-gb2312 #x26 (+ #x21 i))
(make-char 'chinese-gb2312 #x26 (+ #x41 i)) tbl))
(dotimes (i 33)
(set-case-syntax-pair (make-char 'chinese-gb2312 #x27 (+ #x21 i))
(make-char 'chinese-gb2312 #x27 (+ #x51 i)) tbl)))
;; Chinese character set (BIG5)
(let ((from (decode-big5-char #xA141))
@ -217,6 +228,17 @@
(modify-category-entry generic-big5-1-char ?\|)
(modify-category-entry generic-big5-2-char ?\|))
(let ((tbl (standard-case-table)))
(dotimes (i 22)
(set-case-syntax-pair (decode-big5-char (+ #xA2CF i))
(decode-big5-char (+ #xA2CF i 26)) tbl))
(dotimes (i 4)
(set-case-syntax-pair (decode-big5-char (+ #xA2E4 i))
(decode-big5-char (+ #xA340 i)) tbl))
(dotimes (i 24)
(set-case-syntax-pair (decode-big5-char (+ #xA344 i))
(decode-big5-char (+ #xA344 i 24)) tbl)))
;; Chinese character set (CNS11643)
@ -629,6 +651,17 @@
(modify-category-entry (car chars) ?C)
(setq chars (cdr chars))))
(let ((tbl (standard-case-table)))
(dotimes (i 26)
(set-case-syntax-pair (make-char 'japanese-jisx0208 #x23 (+ #x41 i))
(make-char 'japanese-jisx0208 #x23 (+ #x61 i)) tbl))
(dotimes (i 24)
(set-case-syntax-pair (make-char 'japanese-jisx0208 #x26 (+ #x21 i))
(make-char 'japanese-jisx0208 #x26 (+ #x41 i)) tbl))
(dotimes (i 33)
(set-case-syntax-pair (make-char 'japanese-jisx0208 #x27 (+ #x21 i))
(make-char 'japanese-jisx0208 #x27 (+ #x51 i)) tbl)))
;; JISX0212
;; (modify-syntax-entry (make-char 'japanese-jisx0212) "w")
(modify-syntax-entry (make-char 'japanese-jisx0212 33) "_")
@ -674,6 +707,20 @@
(modify-syntax-entry open (format "(%c" close))
(modify-syntax-entry close (format ")%c" open))))
(let ((tbl (standard-case-table)))
(dotimes (i 26)
(set-case-syntax-pair (make-char 'korean-ksc5601 #x23 (+ #x41 i))
(make-char 'korean-ksc5601 #x23 (+ #x61 i)) tbl))
(dotimes (i 10)
(set-case-syntax-pair (make-char 'korean-ksc5601 #x25 (+ #x21 i))
(make-char 'korean-ksc5601 #x25 (+ #x30 i)) tbl))
(dotimes (i 24)
(set-case-syntax-pair (make-char 'korean-ksc5601 #x25 (+ #x41 i))
(make-char 'korean-ksc5601 #x25 (+ #x61 i)) tbl))
(dotimes (i 33)
(set-case-syntax-pair (make-char 'korean-ksc5601 #x2C (+ #x21 i))
(make-char 'korean-ksc5601 #x2C (+ #x51 i)) tbl)))
;; Latin character set (latin-1,2,3,4,5,8,9)
(modify-category-entry (make-char 'latin-iso8859-1) ?l)

View file

@ -2135,6 +2135,7 @@ of `buffer-file-coding-system' set by this function."
("cy" "Welsh" iso-8859-14)
("da" . "Latin-1") ; Danish
("de" "German" iso-8859-1)
; dv Divehi
; dz Bhutani
("el" "Greek" iso-8859-7)
;; Users who specify "en" explicitly typically want Latin-1, not ASCII.
@ -2296,6 +2297,10 @@ of `buffer-file-coding-system' set by this function."
("jp" . "Japanese") ; e.g. MS Windows
("chs" . "Chinese-GB") ; MS Windows Chinese Simplified
("cht" . "Chinese-BIG5") ; MS Windows Chinese Traditional
("gbz" . "UTF-8") ; MS Windows Dari Persian
("div" . "UTF-8") ; MS Windows Divehi (Maldives)
("wee" . "Latin-2") ; MS Windows Lower Sorbian
("wen" . "Latin-2") ; MS Windows Upper Sorbian
))
"Alist of locale regexps vs the corresponding languages and coding systems.
Each element has these form:
@ -2501,6 +2506,8 @@ See also `locale-charset-language-names', `locale-language-names',
(locale-name-match locale locale-language-names))
(charset-language-name
(locale-name-match locale locale-charset-language-names))
(default-eol-type (coding-system-eol-type
default-buffer-file-coding-system))
(coding-system
(or (locale-name-match locale locale-preferred-coding-systems)
(when locale
@ -2521,6 +2528,13 @@ See also `locale-charset-language-names', `locale-language-names',
(if (not language-name)
(setq language-name charset-language-name)))
;; If a specific EOL conversion was specified in the default
;; buffer-file-coding-system, preserve it in the coding system
;; we will be using from now on.
(if (memq default-eol-type '(0 1 2 unix dos mac))
(setq coding-system (coding-system-change-eol-conversion
coding-system default-eol-type)))
(when language-name
;; Set up for this character set. This is now the right way

View file

@ -623,7 +623,9 @@ the variable `rmail-mime-feature'.")
;;;###autoload
(defvar rmail-mime-charset-pattern
"^content-type:[ ]*text/plain;[ \t\n]*charset=\"?\\([^ \t\n\";]+\\)\"?"
(concat "^content-type:[ ]*text/plain;"
"\\(?:[ \t\n]*\\(format\\|delsp\\)=\"?[-a-z0-9]+\"?;\\)*"
"[ \t\n]*charset=\"?\\([^ \t\n\";]+\\)\"?")
"Regexp to match MIME-charset specification in a header of message.
The first parenthesized expression should match the MIME-charset name.")

View file

@ -416,6 +416,9 @@ Otherwise, the value is whatever the function
(define-key Man-mode-map "k" 'Man-kill)
(define-key Man-mode-map "q" 'Man-quit)
(define-key Man-mode-map "m" 'man)
;; Not all the man references get buttons currently. The text in the
;; manual page can contain references to other man pages
(define-key Man-mode-map "\r" 'man-follow)
(define-key Man-mode-map "?" 'describe-mode))
;; buttons
@ -423,10 +426,13 @@ Otherwise, the value is whatever the function
'follow-link t
'help-echo "mouse-2, RET: display this man page"
'func nil
'action (lambda (button) (funcall
(button-get button 'func)
(or (button-get button 'Man-target-string)
(button-label button)))))
'action (lambda (button)
(funcall
(button-get button 'func)
(let ((func (button-get button 'Man-target-string)))
(if func
(if (functionp func) (funcall func) func)
(button-label button))))))
(define-button-type 'Man-xref-man-page
:supertype 'Man-abstract-xref-man-page
@ -929,15 +935,14 @@ default type, `Man-xref-man-page' is used for the buttons."
(setq Man-arguments ""))
(if (string-match "-k " Man-arguments)
(progn
(Man-highlight-references0 nil Man-reference-regexp 1 nil
(Man-highlight-references0 nil Man-reference-regexp 1
'Man-default-man-entry
(or xref-man-type 'Man-xref-man-page))
(Man-highlight-references0 nil Man-apropos-regexp 1
(lambda ()
(format "%s(%s)"
(match-string 1)
(match-string 2)))
'Man-default-man-entry
(or xref-man-type 'Man-xref-man-page)))
(Man-highlight-references0 Man-see-also-regexp Man-reference-regexp 1 nil
(Man-highlight-references0 Man-see-also-regexp Man-reference-regexp 1
'Man-default-man-entry
(or xref-man-type 'Man-xref-man-page))
(Man-highlight-references0 Man-synopsis-regexp Man-header-regexp 0 2
'Man-xref-header-file)
@ -966,7 +971,7 @@ default type, `Man-xref-man-page' is used for the buttons."
((numberp target)
(match-string target))
((functionp target)
(funcall target))
target)
(t nil)))))))
(defun Man-cleanup-manpage (&optional interactive)

View file

@ -1,3 +1,15 @@
2006-04-07 Bill Wohler <wohler@newt.com>
* mh-e.el (mh-path, mh-variant): Define with mh-defcustom and add
:package-version keyword.
2006-03-31 Bill Wohler <wohler@newt.com>
* mh-e.el (mh-strip-package-version): Move before use to avoid
compiler error. Make macro, also to avoid compiler error.
(mh-defface-compat): Incorporate body into mh-face-data and
delete.
2006-03-30 Bill Wohler <wohler@newt.com>
* mh-e.el (mh-defcustom, mh-defface, mh-defgroup): Macros to

View file

@ -644,13 +644,66 @@ Set mark after inserted text."
;;; MH-E Customization Support Routines
;; Shush compiler (Emacs 21 and XEmacs).
(defvar customize-package-emacs-version-alist)
;; Temporary function and data structure used customization.
;; These will be unbound after the options are defined.
(defmacro mh-strip-package-version (args)
"Strip :package-version keyword and its value from ARGS.
In Emacs versions that support the :package-version keyword,
ARGS is returned unchanged."
`(if (boundp 'customize-package-emacs-version-alist)
,args
(let (seen)
(loop for keyword in ,args
if (cond ((eq keyword ':package-version) (setq seen t) nil)
(seen (setq seen nil) nil)
(t t))
collect keyword))))
(defmacro mh-defgroup (symbol members doc &rest args)
"Declare SYMBOL as a customization group containing MEMBERS.
See documentation for `defgroup' for a description of the arguments
SYMBOL, MEMBERS, DOC and ARGS.
This macro is used by Emacs versions that lack the :package-version
keyword, introduced in Emacs 22."
(declare (doc-string 3))
`(defgroup ,symbol ,members ,doc ,@(mh-strip-package-version args)))
(put 'mh-defgroup 'lisp-indent-function 'defun)
(defmacro mh-defcustom (symbol value doc &rest args)
"Declare SYMBOL as a customizable variable that defaults to VALUE.
See documentation for `defcustom' for a description of the arguments
SYMBOL, VALUE, DOC and ARGS.
This macro is used by Emacs versions that lack the :package-version
keyword, introduced in Emacs 22."
(declare (doc-string 3))
`(defcustom ,symbol ,value ,doc ,@(mh-strip-package-version args)))
(put 'mh-defcustom 'lisp-indent-function 'defun)
(defmacro mh-defface (face spec doc &rest args)
"Declare FACE as a customizable face that defaults to SPEC.
See documentation for `defface' for a description of the arguments
FACE, SPEC, DOC and ARGS.
This macro is used by Emacs versions that lack the :package-version
keyword, introduced in Emacs 22."
(declare (doc-string 3))
`(defface ,face ,spec ,doc ,@(mh-strip-package-version args)))
(put 'mh-defface 'lisp-indent-function 'defun)
;;; Variant Support
(defcustom mh-path nil
(mh-defcustom mh-path nil
"*Additional list of directories to search for MH.
See `mh-variant'."
:group 'mh-e
:type '(repeat (directory)))
:type '(repeat (directory))
:package-version '(MH-E "8.0"))
(defun mh-variants ()
"Return a list of installed variants of MH on the system.
@ -859,7 +912,7 @@ finally GNU mailutils."
(mapconcat '(lambda (x) (format "%s" (car x)))
(mh-variants) " or "))))))
(defcustom mh-variant 'autodetect
(mh-defcustom mh-variant 'autodetect
"*Specifies the variant used by MH-E.
The default setting of this option is \"Auto-detect\" which means
@ -884,61 +937,8 @@ necessary and can actually cause problems."
:set (lambda (symbol value)
(set-default symbol value) ;Done in mh-variant-set-variant!
(mh-variant-set value))
:group 'mh-e)
;;; MH-E Customization Support Routines
;; Shush compiler (Emacs 21 and XEmacs).
(defvar customize-package-emacs-version-alist)
;; Temporary function and data structure used customization.
;; These will be unbound after the options are defined.
(defmacro mh-defgroup (symbol members doc &rest args)
"Declare SYMBOL as a customization group containing MEMBERS.
See documentation for `defgroup' for a description of the arguments
SYMBOL, MEMBERS, DOC and ARGS.
This macro is used by Emacs versions that lack the :package-version
keyword, introduced in Emacs 22."
(declare (doc-string 3))
`(defgroup ,symbol ,members ,doc ,@(mh-strip-package-version args)))
(put 'mh-defgroup 'lisp-indent-function 'defun)
(defmacro mh-defcustom (symbol value doc &rest args)
"Declare SYMBOL as a customizable variable that defaults to VALUE.
See documentation for `defcustom' for a description of the arguments
SYMBOL, VALUE, DOC and ARGS.
This macro is used by Emacs versions that lack the :package-version
keyword, introduced in Emacs 22."
(declare (doc-string 3))
`(defcustom ,symbol ,value ,doc ,@(mh-strip-package-version args)))
(put 'mh-defcustom 'lisp-indent-function 'defun)
(defmacro mh-defface (face spec doc &rest args)
"Declare FACE as a customizable face that defaults to SPEC.
See documentation for `defface' for a description of the arguments
FACE, SPEC, DOC and ARGS.
This macro is used by Emacs versions that lack the :package-version
keyword, introduced in Emacs 22."
(declare (doc-string 3))
`(defface ,face ,spec ,doc ,@(mh-strip-package-version args)))
(put 'mh-defface 'lisp-indent-function 'defun)
;;;###autoload
(defun mh-strip-package-version (args)
"Strip :package-version keyword and its value from ARGS.
In Emacs versions that support the :package-version keyword,
ARGS is returned unchanged."
(if (boundp 'customize-package-emacs-version-alist)
args
(let (seen)
(loop for keyword in args
if (cond ((eq keyword ':package-version) (setq seen t) nil)
(seen (setq seen nil) nil)
(t t))
collect keyword))))
:group 'mh-e
:package-version '(MH-E "8.0"))
@ -3117,46 +3117,12 @@ sequence."
(if (boundp 'facemenu-unlisted-faces)
(add-to-list 'facemenu-unlisted-faces "^mh-"))
;; Temporary function and data structure used for defining faces.
;; These will be unbound after the faces are defined.
(defvar mh-min-colors-defined-flag (and (not mh-xemacs-flag)
(>= emacs-major-version 22))
"Non-nil means `defface' supports min-colors display requirement.")
(defun mh-defface-compat (spec)
"Convert SPEC for defface if necessary to run on older platforms.
Modifies SPEC in place and returns it. See `defface' for the spec definition.
When `mh-min-colors-defined-flag' is nil, this function finds
display entries with \"min-colors\" requirements and either
removes the \"min-colors\" requirement or strips the display
entirely if the display does not support the number of specified
colors."
(if mh-min-colors-defined-flag
spec
(let ((cells (mh-display-color-cells))
new-spec)
;; Remove entries with min-colors, or delete them if we have fewer colors
;; than they specify.
(loop for entry in (reverse spec) do
(let ((requirement (if (eq (car entry) t)
nil
(assoc 'min-colors (car entry)))))
(if requirement
(when (>= cells (nth 1 requirement))
(setq new-spec (cons (cons (delq requirement (car entry))
(cdr entry))
new-spec)))
(setq new-spec (cons entry new-spec)))))
new-spec)))
(require 'cus-face)
(defvar mh-inherit-face-flag (assq :inherit custom-face-attributes)
"Non-nil means that the `defface' :inherit keyword is available.
The :inherit keyword is available on all supported versions of
GNU Emacs and XEmacs from at least 21.5.23 on.")
;; To add a new face:
;; 1. Add entry to variable mh-face-data.
;; 2. Create face using mh-defface (which removes min-color spec and
;; :package-version keyword where these are not supported),
;; accessing face data with function mh-face-data.
;; 3. Add inherit argument to function mh-face-data if applicable.
(defvar mh-face-data
'((mh-folder-followup
((((class color) (background light))
@ -3299,19 +3265,61 @@ GNU Emacs and XEmacs from at least 21.5.23 on.")
(((class color) (background dark))
(:foreground "red1" :underline t))
(t
(:underline t))))))
(:underline t)))))
"MH-E face data.
Used by function `mh-face-data' which returns spec that is
consumed by `mh-defface'.")
(require 'cus-face)
(defvar mh-inherit-face-flag (assq :inherit custom-face-attributes)
"Non-nil means that the `defface' :inherit keyword is available.
The :inherit keyword is available on all supported versions of
GNU Emacs and XEmacs from at least 21.5.23 on.")
(defvar mh-min-colors-defined-flag (and (not mh-xemacs-flag)
(>= emacs-major-version 22))
"Non-nil means `defface' supports min-colors display requirement.")
(defun mh-face-data (face &optional inherit)
"Return spec for FACE.
If INHERIT is non-nil and `defface' supports the :inherit
keyword, return INHERIT literally; otherwise, return spec for FACE.
See `defface' for the spec definition.
This isn't a perfect implementation. In the case that
the :inherit keyword is not supported, any additional attributes
in the inherit parameter are not added to the returned spec."
(if (and inherit mh-inherit-face-flag)
inherit
(mh-defface-compat (cadr (assoc face mh-face-data)))))
If INHERIT is non-nil and `defface' supports the :inherit
keyword, return INHERIT literally; otherwise, return spec for
FACE from the variable `mh-face-data'. This isn't a perfect
implementation. In the case that the :inherit keyword is not
supported, any additional attributes in the inherit parameter are
not added to the returned spec.
Furthermore, when `mh-min-colors-defined-flag' is nil, this
function finds display entries with \"min-colors\" requirements
and either removes the \"min-colors\" requirement or strips the
display entirely if the display does not support the number of
specified colors."
(let ((spec
(if (and inherit mh-inherit-face-flag)
inherit
(or (cadr (assq face mh-face-data))
(error "Could not find %s in mh-face-data" face)))))
(if mh-min-colors-defined-flag
spec
(let ((cells (mh-display-color-cells))
new-spec)
;; Remove entries with min-colors, or delete them if we have
;; fewer colors than they specify.
(loop for entry in (reverse spec) do
(let ((requirement (if (eq (car entry) t)
nil
(assq 'min-colors (car entry)))))
(if requirement
(when (>= cells (nth 1 requirement))
(setq new-spec (cons (cons (delq requirement (car entry))
(cdr entry))
new-spec)))
(setq new-spec (cons entry new-spec)))))
new-spec))))
(mh-defface mh-folder-address
(mh-face-data 'mh-folder-subject '((t (:inherit mh-folder-subject))))
@ -3522,9 +3530,9 @@ The background and foreground are used in the image."
;; Get rid of temporary functions and data structures.
(fmakunbound 'mh-defcustom)
(fmakunbound 'mh-defface)
(fmakunbound 'mh-defface-compat)
(fmakunbound 'mh-defgroup)
(fmakunbound 'mh-face-data)
(fmakunbound 'mh-strip-package-version)
(makunbound 'mh-face-data)
(makunbound 'mh-inherit-face-flag)
(makunbound 'mh-min-colors-defined-flag)

File diff suppressed because it is too large Load diff

View file

@ -978,7 +978,9 @@ Typing SPC flushes the help buffer."
(set-window-configuration pcomplete-last-window-config)
(setq pcomplete-last-window-config nil)
(throw 'done nil))
((event-matches-key-specifier-p event 'tab)
((or (event-matches-key-specifier-p event 'tab)
;; Needed on a terminal
(event-matches-key-specifier-p event 9))
(save-selected-window
(select-window (get-buffer-window "*Completions*"))
(if (pos-visible-in-window-p (point-max))

View file

@ -157,10 +157,11 @@ Uses columns to keep the listing readable but compact."
(setq tab-width colwidth)
;; The insertion should be "sensible" no matter what choices were made.
(dolist (str strings)
(unless (bolp) (insert " \t"))
(when (< wwidth (+ (max colwidth (length str)) (current-column)))
(delete-char -2) (insert "\n"))
(insert str)))))
(unless (bolp)
(insert " \t")
(when (< wwidth (+ (max colwidth (length str)) (current-column)))
(delete-char -2) (insert "\n")))
(insert str)))))
(defun cvs-file-to-string (file &optional oneline args)
@ -357,7 +358,8 @@ If ARG is nil toggle the PREFIX's value between its 0th default and nil
and reset the persistence."
(let* ((prefix (symbol-value (cvs-prefix-sym sym)))
(numarg (if (integerp arg) arg 0))
(defs (cvs-flags-defaults prefix)))
;; (defs (cvs-flags-defaults prefix))
)
;; set persistence if requested
(when (> (prefix-numeric-value arg) 9)

View file

@ -4,7 +4,8 @@
;; 2005, 2006 Free Software Foundation, Inc.
;; Author: Daiki Ueno <ueno@unixuser.org>
;; Symmetric encryption support added by: Sascha Wilde <wilde@sha-bang.de>
;; Symmetric encryption and gpg-agent support added by:
;; Sascha Wilde <wilde@sha-bang.de>
;; Created: 1999/10/28
;; Keywords: PGP, OpenPGP, GnuPG
@ -28,6 +29,7 @@
;;; Code:
(eval-when-compile
(require 'cl) ; for gpg macros
(require 'pgg))
(defgroup pgg-gpg ()
@ -58,183 +60,85 @@
(defvar pgg-gpg-user-id nil
"GnuPG ID of your default identity.")
(defvar pgg-gpg-user-id-alist nil
"An alist mapping from key ID to user ID.")
(defvar pgg-gpg-read-point nil)
(defvar pgg-gpg-output-file-name nil)
(defvar pgg-gpg-pending-status-list nil)
(defvar pgg-gpg-key-id nil)
(defvar pgg-gpg-passphrase nil)
(defvar pgg-gpg-debug nil)
(defun pgg-gpg-start-process (args)
(let* ((output-file-name (pgg-make-temp-file "pgg-output"))
(defun pgg-gpg-process-region (start end passphrase program args)
(let* ((use-agent (pgg-gpg-use-agent-p))
(output-file-name (pgg-make-temp-file "pgg-output"))
(args
(append (list "--no-tty"
"--status-fd" "1"
"--command-fd" "0"
"--yes" ; overwrite
"--output" output-file-name)
(if pgg-gpg-use-agent '("--use-agent"))
pgg-gpg-extra-args
args))
(coding-system-for-write 'binary)
(process-connection-type nil)
`("--status-fd" "2"
,@(if use-agent '("--use-agent")
(if passphrase '("--passphrase-fd" "0")))
"--yes" ; overwrite
"--output" ,output-file-name
,@pgg-gpg-extra-args ,@args))
(output-buffer pgg-output-buffer)
(errors-buffer pgg-errors-buffer)
(orig-mode (default-file-modes))
default-enable-multibyte-characters
(buffer (generate-new-buffer " *pgg-gpg*"))
process)
(with-current-buffer buffer
(make-local-variable 'pgg-gpg-read-point)
(setq pgg-gpg-read-point (point-min))
(make-local-variable 'pgg-gpg-output-file-name)
(setq pgg-gpg-output-file-name output-file-name)
(make-local-variable 'pgg-gpg-pending-status-list)
(setq pgg-gpg-pending-status-list nil)
(make-local-variable 'pgg-gpg-key-id)
(setq pgg-gpg-key-id nil)
(make-local-variable 'pgg-gpg-passphrase)
(setq pgg-gpg-passphrase nil))
(process-connection-type nil)
exit-status)
(with-current-buffer (get-buffer-create errors-buffer)
(buffer-disable-undo)
(erase-buffer))
(unwind-protect
(progn
(set-default-file-modes 448)
(setq process
(apply #'start-process "pgg-gpg" buffer pgg-gpg-program args)))
(set-default-file-modes orig-mode))
(set-process-filter process #'pgg-gpg-process-filter)
(set-process-sentinel process #'pgg-gpg-process-sentinel)
process))
(let ((coding-system-for-write 'binary)
(input (buffer-substring-no-properties start end))
(default-enable-multibyte-characters nil))
(with-temp-buffer
(when passphrase
(insert passphrase "\n"))
(insert input)
(setq exit-status
(apply #'call-process-region (point-min) (point-max) program
nil errors-buffer nil args))))
(with-current-buffer (get-buffer-create output-buffer)
(buffer-disable-undo)
(erase-buffer)
(if (file-exists-p output-file-name)
(let ((coding-system-for-read (if pgg-text-mode
'raw-text
'binary)))
(insert-file-contents output-file-name)))
(set-buffer errors-buffer)
(if (not (equal exit-status 0))
(insert (format "\n%s exited abnormally: '%s'\n"
program exit-status)))))
(if (file-exists-p output-file-name)
(delete-file output-file-name))
(set-default-file-modes orig-mode))))
(defun pgg-gpg-process-filter (process input)
(save-excursion
(if pgg-gpg-debug
(save-excursion
(set-buffer (get-buffer-create " *pgg-gpg-debug*"))
(goto-char (point-max))
(insert input)))
(set-buffer (process-buffer process))
(goto-char (point-max))
(insert input)
(goto-char pgg-gpg-read-point)
(beginning-of-line)
(while (looking-at ".*\n") ;the input line is finished
(save-excursion
(if (looking-at "\\[GNUPG:] \\([A-Z_]+\\)\\>.*")
(let* ((status (match-string 1))
(symbol (intern-soft (concat "pgg-gpg-status-" status)))
(entry (member status pgg-gpg-pending-status-list)))
(if entry
(setq pgg-gpg-pending-status-list
(delq (car entry)
pgg-gpg-pending-status-list)))
(if (and symbol
(fboundp symbol))
(funcall symbol process (buffer-substring (match-beginning 1)
(match-end 0)))))))
(forward-line))
(setq pgg-gpg-read-point (point))))
(defun pgg-gpg-possibly-cache-passphrase (passphrase &optional key notruncate)
(if (and passphrase
pgg-cache-passphrase
(progn
(goto-char (point-min))
(re-search-forward "^\\[GNUPG:] \\(GOOD_PASSPHRASE\\>\\)\\|\\(SIG_CREATED\\)" nil t)))
(pgg-add-passphrase-to-cache
(or key
(progn
(goto-char (point-min))
(if (re-search-forward
"^\\[GNUPG:] NEED_PASSPHRASE\\(_PIN\\)? \\w+ ?\\w*" nil t)
(substring (match-string 0) -8))))
passphrase
notruncate)))
(defun pgg-gpg-process-sentinel (process status)
(set-process-filter process nil)
(save-excursion
;; Copy the contents of process-buffer to pgg-errors-buffer.
(set-buffer (get-buffer-create pgg-errors-buffer))
(buffer-disable-undo)
(erase-buffer)
(when (buffer-live-p (process-buffer process))
(insert-buffer-substring (process-buffer process))
(goto-char (point-min))
(delete-matching-lines "^\\[GNUPG:] ")
(goto-char (point-min))
(while (re-search-forward "^gpg: " nil t)
(replace-match "")))
;; Read the contents of the output file to pgg-output-buffer.
(set-buffer (get-buffer-create pgg-output-buffer))
(buffer-disable-undo)
(erase-buffer)
(if (and (equal status "finished\n")
(buffer-live-p (process-buffer process)))
(let ((output-file-name (with-current-buffer (process-buffer process)
pgg-gpg-output-file-name)))
(when (file-exists-p output-file-name)
(let ((coding-system-for-read (if pgg-text-mode
'raw-text
'binary)))
(insert-file-contents output-file-name))
(delete-file output-file-name))))))
(defvar pgg-gpg-all-secret-keys 'unknown)
(defun pgg-gpg-wait-for-status (process status-list)
(with-current-buffer (process-buffer process)
(setq pgg-gpg-pending-status-list status-list)
(while (and (eq (process-status process) 'run)
pgg-gpg-pending-status-list)
(accept-process-output process 1))))
(defun pgg-gpg-wait-for-completion (process &optional status-list)
(process-send-eof process)
(while (eq (process-status process) 'run)
(sit-for 0.1))
(save-excursion
(set-buffer (process-buffer process))
(setq status-list (copy-sequence status-list))
(let ((pointer status-list))
(while pointer
(defun pgg-gpg-lookup-all-secret-keys ()
"Return all secret keys present in secret key ring."
(when (eq pgg-gpg-all-secret-keys 'unknown)
(setq pgg-gpg-all-secret-keys '())
(let ((args (list "--with-colons" "--no-greeting" "--batch"
"--list-secret-keys")))
(with-temp-buffer
(apply #'call-process pgg-gpg-program nil t nil args)
(goto-char (point-min))
(unless (re-search-forward
(concat "^\\[GNUPG:] " (car pointer) "\\>")
nil t)
(setq status-list (delq (car pointer) status-list)))
(setq pointer (cdr pointer))))
(kill-buffer (process-buffer process))
status-list))
(defun pgg-gpg-status-USERID_HINT (process line)
(if (string-match "\\`USERID_HINT \\([^ ]+\\) \\(.*\\)" line)
(let* ((key-id (match-string 1 line))
(user-id (match-string 2 line))
(entry (assoc key-id pgg-gpg-user-id-alist)))
(if entry
(setcdr entry user-id)
(setq pgg-gpg-user-id-alist (cons (cons key-id user-id)
pgg-gpg-user-id-alist))))))
(defun pgg-gpg-status-NEED_PASSPHRASE (process line)
(if (string-match "\\`NEED_PASSPHRASE \\([^ ]+\\)" line)
(setq pgg-gpg-key-id (match-string 1 line))))
(defun pgg-gpg-status-NEED_PASSPHRASE_SYM (process line)
(setq pgg-gpg-key-id 'SYM))
(defun pgg-gpg-status-NEED_PASSPHRASE_PIN (process line)
(setq pgg-gpg-key-id 'PIN))
(defun pgg-gpg-status-GET_HIDDEN (process line)
(let ((entry (assoc pgg-gpg-key-id pgg-gpg-user-id-alist)))
(if (setq pgg-gpg-passphrase
(if (eq pgg-gpg-key-id 'SYM)
(pgg-read-passphrase
"GnuPG passphrase for symmetric encryption: ")
(pgg-read-passphrase
(format "GnuPG passphrase for %s: "
(if entry
(cdr entry)
pgg-gpg-key-id))
(if (eq pgg-gpg-key-id 'PIN)
"PIN"
pgg-gpg-key-id))))
(process-send-string process (concat pgg-gpg-passphrase "\n")))))
(defun pgg-gpg-status-GOOD_PASSPHRASE (process line)
(when (and pgg-gpg-passphrase
(stringp pgg-gpg-key-id))
(pgg-add-passphrase-to-cache pgg-gpg-key-id pgg-gpg-passphrase)
(setq pgg-gpg-passphrase nil)))
(defun pgg-gpg-status-BAD_PASSPHRASE (process line)
(when pgg-gpg-passphrase
(fillarray pgg-gpg-passphrase 0)
(setq pgg-gpg-passphrase nil)))
(while (re-search-forward
"^\\(sec\\|pub\\):[^:]*:[^:]*:[^:]*:\\([^:]*\\)" nil t)
(push (substring (match-string 2) 8)
pgg-gpg-all-secret-keys)))))
pgg-gpg-all-secret-keys)
(defun pgg-gpg-lookup-key (string &optional type)
"Search keys associated with STRING."
@ -248,15 +152,52 @@
nil t)
(substring (match-string 2) 8)))))
(defun pgg-gpg-lookup-key-owner (string &optional all)
"Search keys associated with STRING and return owner of identified key.
The value may be just the bare key id, or it may be a combination of the
user name associated with the key and the key id, with the key id enclosed
in \"<...>\" angle brackets.
Optional ALL non-nil means search all keys, including secret keys."
(let ((args (list "--with-colons" "--no-greeting" "--batch"
(if all "--list-secret-keys" "--list-keys")
string))
(key-regexp (concat "^\\(sec\\|pub\\)"
":[^:]*:[^:]*:[^:]*:\\([^:]*\\):[^:]*"
":[^:]*:[^:]*:[^:]*:\\([^:]*\\):")))
(with-temp-buffer
(apply #'call-process pgg-gpg-program nil t nil args)
(goto-char (point-min))
(if (re-search-forward key-regexp
nil t)
(match-string 3)))))
(defun pgg-gpg-key-id-from-key-owner (key-owner)
(cond ((not key-owner) nil)
;; Extract bare key id from outermost paired angle brackets, if any:
((string-match "[^<]*<\\(.+\\)>[^>]*" key-owner)
(substring key-owner (match-beginning 1)(match-end 1)))
(key-owner)))
(defun pgg-gpg-encrypt-region (start end recipients &optional sign passphrase)
"Encrypt the current region between START and END.
If optional argument SIGN is non-nil, do a combined sign and encrypt."
If optional argument SIGN is non-nil, do a combined sign and encrypt.
If optional PASSPHRASE is not specified, it will be obtained from the
passphrase cache or user."
(let* ((pgg-gpg-user-id (or pgg-gpg-user-id pgg-default-user-id))
(passphrase (or passphrase
(when (and sign (not (pgg-gpg-use-agent-p)))
(pgg-read-passphrase
(format "GnuPG passphrase for %s: "
pgg-gpg-user-id)
pgg-gpg-user-id))))
(args
(append
'("--armor" "--always-trust" "--encrypt")
(if pgg-text-mode '("--textmode"))
(list "--batch" "--armor" "--always-trust" "--encrypt")
(if pgg-text-mode (list "--textmode"))
(if sign (list "--sign" "--local-user" pgg-gpg-user-id))
(if recipients
(apply #'nconc
@ -264,71 +205,178 @@ If optional argument SIGN is non-nil, do a combined sign and encrypt."
(list pgg-gpg-recipient-argument rcpt))
(append recipients
(if pgg-encrypt-for-me
(list pgg-gpg-user-id))))))))
(process (pgg-gpg-start-process args)))
(if (and sign (not pgg-gpg-use-agent))
(pgg-gpg-wait-for-status process '("GOOD_PASSPHRASE")))
(process-send-region process start end)
(pgg-gpg-wait-for-completion process '("SIG_CREATED" "END_ENCRYPTION"))))
(list pgg-gpg-user-id)))))))))
(pgg-gpg-process-region start end passphrase pgg-gpg-program args)
(when sign
(with-current-buffer pgg-errors-buffer
;; Possibly cache passphrase under, e.g. "jas", for future sign.
(pgg-gpg-possibly-cache-passphrase passphrase pgg-gpg-user-id)
;; Possibly cache passphrase under, e.g. B565716F, for future decrypt.
(pgg-gpg-possibly-cache-passphrase passphrase)))
(pgg-process-when-success)))
(defun pgg-gpg-encrypt-symmetric-region (start end &optional passphrase)
"Encrypt the current region between START and END with symmetric cipher."
(let* ((args
(append '("--armor" "--symmetric")
(if pgg-text-mode '("--textmode"))))
(process (pgg-gpg-start-process args)))
(pgg-gpg-wait-for-status process '("BEGIN_ENCRYPTION"))
(process-send-region process start end)
(pgg-gpg-wait-for-completion process '("END_ENCRYPTION"))))
"Encrypt the current region between START and END with symmetric cipher.
If optional PASSPHRASE is not specified, it will be obtained from the
passphrase cache or user."
(let* ((passphrase (or passphrase
(when (not (pgg-gpg-use-agent-p))
(pgg-read-passphrase
"GnuPG passphrase for symmetric encryption: "))))
(args
(append (list "--batch" "--armor" "--symmetric" )
(if pgg-text-mode (list "--textmode")))))
(pgg-gpg-process-region start end passphrase pgg-gpg-program args)
(pgg-process-when-success)))
(defun pgg-gpg-decrypt-region (start end &optional passphrase)
"Decrypt the current region between START and END."
(let* ((args '("--decrypt"))
(process (pgg-gpg-start-process args)))
(process-send-region process start end)
(pgg-gpg-wait-for-status process '("BEGIN_DECRYPTION"))
(pgg-gpg-wait-for-completion process '("GOODSIG" "DECRYPTION_OKAY"))))
"Decrypt the current region between START and END.
If optional PASSPHRASE is not specified, it will be obtained from the
passphrase cache or user."
(let* ((current-buffer (current-buffer))
(message-keys (with-temp-buffer
(insert-buffer-substring current-buffer)
(pgg-decode-armor-region (point-min) (point-max))))
(secret-keys (pgg-gpg-lookup-all-secret-keys))
;; XXX the user is stuck if they need to use the passphrase for
;; any but the first secret key for which the message is
;; encrypted. ideally, we would incrementally give them a
;; chance with subsequent keys each time they fail with one.
(key (pgg-gpg-select-matching-key message-keys secret-keys))
(key-owner (and key (pgg-gpg-lookup-key-owner key t)))
(key-id (pgg-gpg-key-id-from-key-owner key-owner))
(pgg-gpg-user-id (or key-id key
pgg-gpg-user-id pgg-default-user-id))
(passphrase (or passphrase
(when (not (pgg-gpg-use-agent-p))
(pgg-read-passphrase
(format (if (pgg-gpg-symmetric-key-p message-keys)
"Passphrase for symmetric decryption: "
"GnuPG passphrase for %s: ")
(or key-owner "??"))
pgg-gpg-user-id))))
(args '("--batch" "--decrypt")))
(pgg-gpg-process-region start end passphrase pgg-gpg-program args)
(with-current-buffer pgg-errors-buffer
(pgg-gpg-possibly-cache-passphrase passphrase pgg-gpg-user-id)
(goto-char (point-min))
(re-search-forward "^\\[GNUPG:] DECRYPTION_OKAY\\>" nil t))))
;;;###autoload
(defun pgg-gpg-symmetric-key-p (message-keys)
"True if decoded armor MESSAGE-KEYS has symmetric encryption indicator."
(let (result)
(dolist (key message-keys result)
(when (and (eq (car key) 3)
(member '(symmetric-key-algorithm) key))
(setq result key)))))
(defun pgg-gpg-select-matching-key (message-keys secret-keys)
"Choose a key from MESSAGE-KEYS that matches one of the keys in SECRET-KEYS."
(loop for message-key in message-keys
for message-key-id = (and (equal (car message-key) 1)
(cdr (assq 'key-identifier
(cdr message-key))))
for key = (and message-key-id (pgg-lookup-key message-key-id 'encrypt))
when (and key (member key secret-keys)) return key))
(defun pgg-gpg-sign-region (start end &optional cleartext passphrase)
"Make detached signature from text between START and END."
(let* ((pgg-gpg-user-id (or pgg-gpg-user-id pgg-default-user-id))
(passphrase (or passphrase
(when (not (pgg-gpg-use-agent-p))
(pgg-read-passphrase
(format "GnuPG passphrase for %s: "
pgg-gpg-user-id)
pgg-gpg-user-id))))
(args
(append (list (if cleartext "--clearsign" "--detach-sign")
"--armor" "--verbose"
"--armor" "--batch" "--verbose"
"--local-user" pgg-gpg-user-id)
(if pgg-text-mode '("--textmode"))))
(process (pgg-gpg-start-process args)))
(unless pgg-gpg-use-agent
(pgg-gpg-wait-for-status process '("GOOD_PASSPHRASE")))
(process-send-region process start end)
(pgg-gpg-wait-for-completion process '("SIG_CREATED"))))
(if pgg-text-mode (list "--textmode"))))
(inhibit-read-only t)
buffer-read-only)
(pgg-gpg-process-region start end passphrase pgg-gpg-program args)
(with-current-buffer pgg-errors-buffer
;; Possibly cache passphrase under, e.g. "jas", for future sign.
(pgg-gpg-possibly-cache-passphrase passphrase pgg-gpg-user-id)
;; Possibly cache passphrase under, e.g. B565716F, for future decrypt.
(pgg-gpg-possibly-cache-passphrase passphrase))
(pgg-process-when-success)))
(defun pgg-gpg-verify-region (start end &optional signature)
"Verify region between START and END as the detached signature SIGNATURE."
(let ((args '("--verify"))
process)
(let ((args '("--batch" "--verify")))
(when (stringp signature)
(setq args (append args (list signature))))
(setq process (pgg-gpg-start-process (append args '("-"))))
(process-send-region process start end)
(pgg-gpg-wait-for-completion process '("GOODSIG"))))
(setq args (append args '("-")))
(pgg-gpg-process-region start end nil pgg-gpg-program args)
(with-current-buffer pgg-errors-buffer
(goto-char (point-min))
(while (re-search-forward "^gpg: \\(.*\\)\n" nil t)
(with-current-buffer pgg-output-buffer
(insert-buffer-substring pgg-errors-buffer
(match-beginning 1) (match-end 0)))
(delete-region (match-beginning 0) (match-end 0)))
(goto-char (point-min))
(re-search-forward "^\\[GNUPG:] GOODSIG\\>" nil t))))
(defun pgg-gpg-insert-key ()
"Insert public key at point."
(let* ((pgg-gpg-user-id (or pgg-gpg-user-id pgg-default-user-id))
(args (list "--export" "--armor"
pgg-gpg-user-id))
(process (pgg-gpg-start-process args)))
(pgg-gpg-wait-for-completion process)
(args (list "--batch" "--export" "--armor"
pgg-gpg-user-id)))
(pgg-gpg-process-region (point)(point) nil pgg-gpg-program args)
(insert-buffer-substring pgg-output-buffer)))
(defun pgg-gpg-snarf-keys-region (start end)
"Add all public keys in region between START and END to the keyring."
(let* ((args '("--import" "-"))
(process (pgg-gpg-start-process args))
status)
(process-send-region process start end)
(pgg-gpg-wait-for-completion process '("IMPORT_RES"))))
(let ((args '("--import" "--batch" "-")) status)
(pgg-gpg-process-region start end nil pgg-gpg-program args)
(set-buffer pgg-errors-buffer)
(goto-char (point-min))
(when (re-search-forward "^\\[GNUPG:] IMPORT_RES\\>" nil t)
(setq status (buffer-substring (match-end 0)
(progn (end-of-line)(point)))
status (vconcat (mapcar #'string-to-number (split-string status))))
(erase-buffer)
(insert (format "Imported %d key(s).
\tArmor contains %d key(s) [%d bad, %d old].\n"
(+ (aref status 2)
(aref status 10))
(aref status 0)
(aref status 1)
(+ (aref status 4)
(aref status 11)))
(if (zerop (aref status 9))
""
"\tSecret keys are imported.\n")))
(append-to-buffer pgg-output-buffer (point-min)(point-max))
(pgg-process-when-success)))
(defun pgg-gpg-update-agent ()
"Try to connet to gpg-agent and send UPDATESTARTUPTTY."
(if (fboundp 'make-network-process)
(let* ((agent-info (getenv "GPG_AGENT_INFO"))
(socket (and agent-info
(string-match "^\\([^:]*\\)" agent-info)
(match-string 1 agent-info)))
(conn (and socket
(make-network-process :name "gpg-agent-process"
:host 'local :family 'local
:service socket))))
(when (and conn (eq (process-status conn) 'open))
(process-send-string conn "UPDATESTARTUPTTY\n")
(delete-process conn)
t))
;; We can't check, so assume gpg-agent is up.
t))
(defun pgg-gpg-use-agent-p ()
"Return t if `pgg-gpg-use-agent' is t and gpg-agent is available."
(and pgg-gpg-use-agent (pgg-gpg-update-agent)))
(provide 'pgg-gpg)

View file

@ -211,22 +211,24 @@
(defvar lm-emacs-won ()
"*For making font-lock use the winner's face for the line.")
(defvar lm-font-lock-face-O
(if (display-color-p)
(list (facemenu-get-face 'fg:red) 'bold))
"*Face to use for Emacs' O.")
(defface lm-font-lock-face-O '((((class color)) :foreground "red")
(t :weight bold))
"*Face to use for Emacs' O."
:version "22.1"
:group 'lm)
(defvar lm-font-lock-face-X
(if (display-color-p)
(list (facemenu-get-face 'fg:green) 'bold))
"*Face to use for your X.")
(defface lm-font-lock-face-X '((((class color)) :foreground "green")
(t :weight bold))
"*Face to use for your X."
:version "22.1"
:group 'lm)
(defvar lm-font-lock-keywords
'(("O" . lm-font-lock-face-O)
("X" . lm-font-lock-face-X)
'(("O" . 'lm-font-lock-face-O)
("X" . 'lm-font-lock-face-X)
("[-|/\\]" 0 (if lm-emacs-won
lm-font-lock-face-O
lm-font-lock-face-X)))
'lm-font-lock-face-O
'lm-font-lock-face-X)))
"*Font lock rules for Lm.")
(put 'lm-mode 'front-sticky

View file

@ -527,11 +527,14 @@ starting the compilation process.")
:group 'compilation
:version "22.1")
(defvar compilation-message-face 'underline
(defcustom compilation-message-face 'underline
"Face name to use for whole messages.
Faces `compilation-error-face', `compilation-warning-face',
`compilation-info-face', `compilation-line-face' and
`compilation-column-face' get prepended to this, when applicable.")
`compilation-column-face' get prepended to this, when applicable."
:type 'face
:group 'compilation
:version "22.1")
(defvar compilation-error-face 'compilation-error
"Face name to use for file name in error messages.")

View file

@ -571,9 +571,9 @@ With arg, use separate IO iff arg is positive."
'gdb-set-gud-minor-mode-existing-buffers-1))
(setq gdb-locals-font-lock-keywords gdb-locals-font-lock-keywords-2))
;; find source file and compilation directory here
(gdb-enqueue-input (list "server list main\n" 'ignore)) ; C program
(gdb-enqueue-input (list "server list MAIN__\n" 'ignore)) ; Fortran program
;; Find source file and compilation directory here.
;; Works for C, C++, Fortran and Ada but not Java (GDB 6.4)
(gdb-enqueue-input (list "server list\n" 'ignore))
(gdb-enqueue-input (list "server info source\n" 'gdb-source-info))
(run-hooks 'gdba-mode-hook))

View file

@ -1,8 +1,7 @@
;;; idlw-complete-structtag.el --- Completion of structure tags.
;; Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006
;; Free Software Foundation, Inc.
;; Copyright (c) 2001,2002,2003,2004,2005,2006 Free Software Foundation
;; Author: Carsten Dominik <dominik@science.uva.nl>
;; Author: Carsten Dominik <dominik@astro.uva.nl>
;; Maintainer: J.D. Smith <jdsmith@as.arizona.edu>
;; Version: 1.2
;; Keywords: languages
@ -54,10 +53,10 @@
;;
;; INSTALLATION
;; ============
;; Put this file on the emacs load path and load it with the following
;; Put this file on the emacs load path and load it with the following
;; line in your .emacs file:
;;
;; (add-hook 'idlwave-load-hook
;; (add-hook 'idlwave-load-hook
;; (lambda () (require 'idlw-complete-structtag)))
;;
;; DESCRIPTION
@ -88,7 +87,7 @@
;; - You can force an update of the tag list with the usual command
;; to update routine info in IDLWAVE: C-c C-i
(defvar idlwave-completion-help-info)
(require 'idlwave)
;; Some variables to identify the previously used structure
(defvar idlwave-current-tags-var nil)
@ -107,7 +106,7 @@
(add-hook 'idlwave-update-rinfo-hook 'idlwave-structtag-reset)
;;; The main code follows below
(defvar idlwave-completion-help-info)
(defun idlwave-complete-structure-tag ()
"Complete a structure tag.
This works by looking in the current file for a structure assignment to a
@ -146,9 +145,9 @@ an up-to-date completion list."
(not (equal start idlwave-current-tags-completion-pos)))
(idlwave-prepare-structure-tag-completion var))
(setq idlwave-current-tags-completion-pos start)
(setq idlwave-completion-help-info
(setq idlwave-completion-help-info
(list 'idlwave-complete-structure-tag-help))
(idlwave-complete-in-buffer 'structtag 'structtag
(idlwave-complete-in-buffer 'structtag 'structtag
idlwave-current-struct-tags nil
"Select a structure tag" "structure tag")
t) ; we did the completion: return t to skip other completions
@ -167,7 +166,7 @@ an up-to-date completion list."
(if (eq major-mode 'idlwave-shell-mode)
;; OK, we are in the shell, do it dynamically
(progn
(message "preparing shell tags")
(message "preparing shell tags")
;; The following call puts the tags into `idlwave-current-struct-tags'
(idlwave-complete-structure-tag-query-shell var)
;; initialize
@ -189,7 +188,7 @@ an up-to-date completion list."
;; Find possible definitions of the structure.
(while (idlwave-find-structure-definition var nil 'all)
(let ((tags (idlwave-struct-tags)))
(when tags
(when tags
;; initialize
(setq idlwave-sint-structtags nil
idlwave-current-tags-buffer (current-buffer)

View file

@ -1,12 +1,12 @@
;;; idlw-help.el --- HTML Help code for IDLWAVE
;; Copyright (c) 2000 Carsten Dominik
;; Copyright (c) 2001, 2002 J.D. Smith
;; Copyright (c) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
;; Copyright (c) 2003,2004,2005,2006 Free Software Foundation
;;
;; Authors: J.D. Smith <jdsmith@as.arizona.edu>
;; Carsten Dominik <dominik@science.uva.nl>
;; Maintainer: J.D. Smith <jdsmith@as.arizona.edu>
;; Version: 5.7_22
;; Version: 6.0_em22
;; This file is part of GNU Emacs.
@ -36,13 +36,12 @@
;; information, at:
;;
;; http://idlwave.org
;;
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Code:
(defvar browse-url-generic-args)
;;; Code:
(defvar idlwave-help-browse-url-available nil
"Whether browse-url is available")
@ -60,25 +59,32 @@
:group 'idlwave-online-help
:type 'boolean)
(defvar idlwave-html-link-sep
(defvar idlwave-html-link-sep
(if idlwave-html-help-pre-v6 "#" "#wp"))
(defcustom idlwave-html-help-location
(if (memq system-type '(ms-dos windows-nt))
nil
"/usr/local/etc/")
"The directory where the idl_html_help/ dir or idl.chm help file
(Windows only) lives."
(defcustom idlwave-html-system-help-location "help/online_help/"
"The directory, relative to idlwave-system-directory, where the idl
HTML help files live, for IDL 6.2 and later. This location, if found,
is used in preference to the old idlwave-html-help-location."
:group 'idlwave-online-help
:type 'directory)
(defcustom idlwave-help-use-hh nil
"Whether to use the HTMLHelp viewer with idl.chm (Windows only)."
(defcustom idlwave-html-help-location
(if (memq system-type '(ms-dos windows-nt))
nil
"/usr/local/etc/")
"The directory where the idl_html_help/ dir lives. Obsolete for IDL
6.2 or later (see idlwave-html-system-help-location)."
:group 'idlwave-online-help
:type '(choice :tag "use help viewer"
(const :tag "<none>" nil)
(const :tag "hh" 'hh)
(const :tag "keyhh" 'keyhh)))
:type 'directory)
(defvar idlwave-help-use-hh nil
"Obsolete variable.")
(defcustom idlwave-help-use-assistant t
"Whether to use the IDL Assistant as the help browser."
:group 'idlwave-online-help
:type 'boolean)
(defcustom idlwave-help-browser-function browse-url-browser-function
"Function to use to display html help.
@ -91,7 +97,9 @@ Defaults to `browse-url-browser-function', which see."
:group 'idlwave-online-help
:type 'string)
(defcustom idlwave-help-browser-generic-args
(defvar browse-url-generic-args)
(defcustom idlwave-help-browser-generic-args
(if (boundp 'browse-url-generic-args)
browse-url-generic-args "")
"Program args to use if using browse-url-generic-program."
@ -198,7 +206,7 @@ support."
(defvar idlwave-help-activate-links-aggressively nil
"Obsolete variable.")
(defvar idlwave-completion-help-info)
(defvar idlwave-help-frame nil
@ -289,22 +297,39 @@ Here are all keybindings.
(set (make-local-variable 'idlwave-help-def-pos) nil)
(set (make-local-variable 'idlwave-help-args) nil)
(set (make-local-variable 'idlwave-help-in-header) nil)
(run-mode-hooks 'idlwave-help-mode-hook))
(run-hooks 'idlwave-help-mode-hook))
(defvar idlwave-system-directory)
(defun idlwave-html-help-location ()
"Return the help directory where HTML files are, or nil if that is unknown."
(or (and (stringp idlwave-html-help-location)
(> (length idlwave-html-help-location) 0)
(file-directory-p idlwave-html-help-location)
idlwave-html-help-location)
(getenv "IDLWAVE_HELP_LOCATION")
(and (memq system-type '(ms-dos windows-nt)) ; Base it on sysdir
idlwave-help-use-hh
(stringp idlwave-system-directory)
(> (length idlwave-system-directory) 0)
(file-directory-p idlwave-system-directory)
(expand-file-name "HELP" idlwave-system-directory))))
(let ((syshelp-dir (expand-file-name
idlwave-html-system-help-location (idlwave-sys-dir)))
(help-dir (or (and (stringp idlwave-html-help-location)
(> (length idlwave-html-help-location) 0)
idlwave-html-help-location)
(getenv "IDLWAVE_HELP_LOCATION"))))
(if (file-directory-p syshelp-dir)
syshelp-dir
(setq help-dir (expand-file-name "idl_html_help" help-dir))
(if (file-directory-p help-dir) help-dir))))
(defvar idlwave-help-assistant-available nil)
(defun idlwave-help-check-locations ()
;; Check help locations and assistant.
(let ((sys-dir (idlwave-sys-dir))
(help-loc (idlwave-html-help-location)))
(if (or (not (file-directory-p sys-dir))
(not (file-directory-p help-loc)))
(message
"HTML help location not found: try setting `idlwave-system-directory' and/or `idlwave-html-help-location'."))
;; see if we have the assistant
(when (and idlwave-help-use-assistant
(not (eq (idlwave-help-assistant-available) t)))
(message "Cannot locate IDL Assistant, enabling default browser.")
(setq idlwave-help-use-assistant nil)
(unless idlwave-help-browse-url-available
(error "browse-url is not available; install it or IDL Assistant to use HTML help.")))))
(defvar idlwave-current-obj_new-class)
(defvar idlwave-help-diagnostics)
@ -326,7 +351,7 @@ It collects and prints the diagnostics messages."
(setq idlwave-last-context-help-pos marker)
(idlwave-do-context-help1 arg)
(if idlwave-help-diagnostics
(message "%s" (mapconcat 'identity
(message "%s" (mapconcat 'identity
(nreverse idlwave-help-diagnostics)
"; "))))))
@ -339,7 +364,7 @@ It collects and prints the diagnostics messages."
(defun idlwave-do-context-help1 (&optional arg)
"The work-horse version of `idlwave-context-help', which see."
(save-excursion
(if (equal (char-after) ?/)
(if (equal (char-after) ?/)
(forward-char 1)
(if (equal (char-before) ?=)
(backward-char 1)))
@ -349,15 +374,15 @@ It collects and prints the diagnostics messages."
(beg (save-excursion (skip-chars-backward chars) (point)))
(end (save-excursion (skip-chars-forward chars) (point)))
(this-word (buffer-substring-no-properties beg end))
(st-ass (assoc (downcase this-word)
idlwave-help-special-topic-words))
(st-ass (assoc-string this-word
idlwave-help-special-topic-words t))
(classtag (and (string-match "self\\." this-word)
(< beg (- end 4))))
(structtag (and (fboundp 'idlwave-complete-structure-tag)
(string-match "\\`\\([^.]+\\)\\." this-word)
(< beg (- end 4))))
module keyword cw mod1 mod2 mod3)
(if (or arg
(if (or arg
(and (not st-ass)
(not classtag)
(not structtag)
@ -376,15 +401,15 @@ It collects and prints the diagnostics messages."
(setq module (list "init" 'fun (match-string 1 str))
idlwave-current-obj_new-class (match-string 1 str))
)))))
(cond
(cond
(arg (setq mod1 module))
;; A special topic -- only system help
(st-ass (setq mod1 (list (cdr st-ass))))
;; A system variable -- only system help
((string-match
"\\`!\\([a-zA-Z0-9_]+\\)\\(\.\\([A-Za-z0-9_]+\\)\\)?"
((string-match
"\\`!\\([a-zA-Z0-9_]+\\)\\(\.\\([A-Za-z0-9_]+\\)\\)?"
this-word)
(let* ((word (match-string-no-properties 1 this-word))
(entry (assq (idlwave-sintern-sysvar word)
@ -396,10 +421,10 @@ It collects and prints the diagnostics messages."
(cdr (assq 'tags entry))))))
(link (nth 1 (assq 'link entry))))
(if tag-target
(setq link (idlwave-substitute-link-target link
(setq link (idlwave-substitute-link-target link
tag-target)))
(setq mod1 (list link))))
;; An executive command -- only system help
((string-match "^\\.\\([A-Z_]+\\)" this-word)
(let* ((word (match-string 1 this-word))
@ -407,7 +432,7 @@ It collects and prints the diagnostics messages."
word
idlwave-executive-commands-alist t))))
(setq mod1 (list link))))
;; A class -- system OR in-text help (via class__define).
((and (eq cw 'class)
(or (idlwave-in-quote) ; e.g. obj_new
@ -421,28 +446,28 @@ It collects and prints the diagnostics messages."
(name (concat (downcase this-word) "__define"))
(link (nth 1 (assq 'link entry))))
(setq mod1 (list link name 'pro))))
;; A class structure tag (self.BLAH) -- only in-text help available
(classtag
(let ((tag (substring this-word (match-end 0)))
class-with found-in)
(when (setq class-with
(when (setq class-with
(idlwave-class-or-superclass-with-tag
(nth 2 (idlwave-current-routine))
tag))
(setq found-in (idlwave-class-found-in class-with))
(if (assq (idlwave-sintern-class class-with)
(if (assq (idlwave-sintern-class class-with)
idlwave-system-class-info)
(error "No help available for system class tags"))
(setq idlwave-help-do-class-struct-tag t)
(setq mod1 (list nil
(setq mod1 (list nil
(if found-in
(cons (concat found-in "__define") class-with)
(concat class-with "__define"))
'pro
nil ; no class.... it's a procedure!
tag)))))
;; A regular structure tag -- only in text, and if
;; optional `complete-structtag' loaded.
(structtag
@ -453,7 +478,7 @@ It collects and prints the diagnostics messages."
(setq idlwave-help-do-struct-tag
idlwave-structtag-struct-location
mod1 (list nil nil nil nil tag))))
;; A routine keyword -- in text or system help
((and (memq cw '(function-keyword procedure-keyword))
(stringp this-word)
@ -495,7 +520,7 @@ It collects and prints the diagnostics messages."
(setq mod1 (append (list t) module (list keyword))
mod2 (list t this-word 'fun nil)
mod3 (append (list t) module)))))
;; Everything else
(t
(setq mod1 (append (list t) module))))
@ -528,14 +553,14 @@ Needs additional info stored in global `idlwave-completion-help-info'."
word link)
(mouse-set-point ev)
;; See if we can also find help somewhere, e.g. for multiple classes
(setq word (idlwave-this-word))
(if (string= word "")
(error "No help item selected"))
(setq link (get-text-property 0 'link word))
(select-window cw)
(cond
(cond
;; Routine name
((memq what '(procedure function routine))
(setq name word)
@ -546,9 +571,9 @@ Needs additional info stored in global `idlwave-completion-help-info'."
type)))
(setq link t) ; No specific link valid yet
(if sclasses
(setq classes (idlwave-members-only
(setq classes (idlwave-members-only
classes (cons class sclasses))))
(setq class (idlwave-popup-select ev classes
(setq class (idlwave-popup-select ev classes
"Select Class" 'sort))))
;; XXX is this necessary, given all-method-classes?
@ -568,7 +593,7 @@ Needs additional info stored in global `idlwave-completion-help-info'."
type)))
(setq link t) ; Link can't be correct yet
(if sclasses
(setq classes (idlwave-members-only
(setq classes (idlwave-members-only
classes (cons class sclasses))))
(setq class (idlwave-popup-select ev classes
"Select Class" 'sort))
@ -580,14 +605,14 @@ Needs additional info stored in global `idlwave-completion-help-info'."
(if (string= (downcase name) "obj_new")
(setq class idlwave-current-obj_new-class
name "Init"))))
;; Class name
((eq what 'class)
(setq class word
word nil))
;; A special named function to call which sets some of our variables
((and (symbolp what)
((and (symbolp what)
(fboundp what))
(funcall what 'set word))
@ -602,7 +627,7 @@ Needs additional info stored in global `idlwave-completion-help-info'."
"Highlight all completions for which help is available and attach link.
Those words in `idlwave-completion-help-links' have links. The
`idlwave-help-link' face is used for this."
(if idlwave-highlight-help-links-in-completion
(if idlwave-highlight-help-links-in-completion
(with-current-buffer (get-buffer "*Completions*")
(save-excursion
(let* ((case-fold-search t)
@ -618,7 +643,7 @@ Those words in `idlwave-completion-help-links' have links. The
(setq beg (match-beginning 1) end (match-end 1)
word (match-string 1) doit nil)
;; Call special completion function test
(if (and (symbolp what)
(if (and (symbolp what)
(fboundp what))
(setq doit (funcall what 'test word))
;; Look for special link property passed in help-links
@ -649,13 +674,13 @@ Those words in `idlwave-completion-help-links' have links. The
;; Try to select the return frame.
;; This can crash on slow network connections, obviously when
;; we kill the help frame before the return-frame is selected.
;; To protect the workings, we wait for up to one second
;; To protect the workings, we wait for up to one second
;; and check if the return-frame *is* now selected.
;; This is marked "eperimental" since we are not sure when its OK.
(let ((maxtime 1.0) (time 0.) (step 0.1))
(select-frame idlwave-help-return-frame)
(while (and (sit-for step)
(not (eq (selected-frame)
(not (eq (selected-frame)
idlwave-help-return-frame))
(< (setq time (+ time step)) maxtime)))))
(delete-frame idlwave-help-frame))
@ -668,7 +693,7 @@ Those words in `idlwave-completion-help-links' have links. The
(defvar default-toolbar-visible-p)
(defun idlwave-help-display-help-window (&optional pos-or-func)
"Display the help window.
"Display the help window.
Move window start to POS-OR-FUNC, if passed as a position, or call it
if passed as a function. See `idlwave-help-use-dedicated-frame'."
(let ((cw (selected-window))
@ -679,13 +704,13 @@ if passed as a function. See `idlwave-help-use-dedicated-frame'."
(switch-to-buffer buf))
;; Do it in this frame and save the window configuration
(if (not (get-buffer-window buf nil))
(setq idlwave-help-window-configuration
(setq idlwave-help-window-configuration
(current-window-configuration)))
(display-buffer buf nil (selected-frame))
(select-window (get-buffer-window buf)))
(raise-frame)
(if pos-or-func
(if (functionp pos-or-func)
(if pos-or-func
(if (functionp pos-or-func)
(funcall pos-or-func)
(goto-char pos-or-func)
(recenter 0)))
@ -707,31 +732,43 @@ if passed as a function. See `idlwave-help-use-dedicated-frame'."
(select-frame idlwave-help-return-frame)))
(defun idlwave-online-help (link &optional name type class keyword)
"Display HTML or other special help on a certain topic.
"Display HTML or other special help on a certain topic.
Either loads an HTML link, if LINK is non-nil, or gets special-help on
the optional arguments, if any special help is defined. If LINK is
`t', first look up the optional arguments in the routine info list to
see if a link is set for it. Try extra help functions if necessary."
;; Lookup link
(if (eq link t)
(let ((entry (idlwave-best-rinfo-assoc name type class
(if (eq link t)
(let ((entry (idlwave-best-rinfo-assoc name type class
(idlwave-routines) nil t)))
(cond
;; Try keyword link
((and keyword
(setq link (cdr (idlwave-entry-find-keyword entry keyword)))))
;; Default, regular entry link
(t (setq link (idlwave-entry-has-help entry))))))
(if entry
(cond
;; Try keyword link
((and keyword
(setq link (cdr
(idlwave-entry-find-keyword entry keyword)))))
;; Default, regular entry link
(t (setq link (idlwave-entry-has-help entry))))
(if (and
class
;; Check for system class help
(setq entry (assq (idlwave-sintern-class class)
idlwave-system-class-info)
link (nth 1 (assq 'link entry))))
(message
(concat "No routine info for %s"
", falling back on class help.")
(idlwave-make-full-name class name))))))
(cond
;; An explicit link
((stringp link)
((stringp link)
(idlwave-help-html-link link))
;; Any extra help
(idlwave-extra-help-function
(idlwave-help-get-special-help name type class keyword))
;; Nothing worked
(t (idlwave-help-error name type class keyword))))
@ -742,7 +779,7 @@ see if a link is set for it. Try extra help functions if necessary."
(help-pos (save-excursion
(set-buffer (idlwave-help-get-help-buffer))
(let ((buffer-read-only nil))
(funcall idlwave-extra-help-function
(funcall idlwave-extra-help-function
name type class keyword)))))
(if help-pos
(idlwave-help-display-help-window help-pos)
@ -757,36 +794,22 @@ see if a link is set for it. Try extra help functions if necessary."
;(browse-url-generic-args idlwave-help-browser-generic-args)
full-link)
(unless idlwave-help-browse-url-available
(error "browse-url is not available -- install it to use HTML help."))
;; Just a regular file name (+ anchor name)
(unless (and (stringp help-loc)
(file-directory-p help-loc))
(error "Invalid help location."))
(setq full-link (browse-url-file-url (expand-file-name link help-loc)))
(if (and (memq system-type '(ms-dos windows-nt))
idlwave-help-use-hh)
(progn
(setq browse-url-browser-function 'browse-url-generic
full-link (concat (expand-file-name "idl.chm" help-loc)
"::/"
link))
(if (memq 'keyhh idlwave-help-use-hh)
(setq browse-url-generic-program "KEYHH"
browse-url-generic-args '("-IDLWAVE"))
(setq browse-url-generic-program "HH")))
;; Just a regular file name (+ anchor name)
(unless (and (stringp help-loc)
(file-directory-p help-loc))
(error
"Invalid help location; customize `idlwave-html-help-location'."))
(setq full-link (concat
"file://"
(expand-file-name
link
(expand-file-name "idl_html_help" help-loc)))))
;; Select the browser
(cond
(idlwave-help-use-assistant
(idlwave-help-assistant-open-link link))
;; Check for a local browser
(if (or idlwave-help-browser-is-local
(string-match "w3" (symbol-name idlwave-help-browser-function)))
(idlwave-help-display-help-window '(lambda () (browse-url full-link)))
(browse-url full-link))))
((or idlwave-help-browser-is-local
(string-match "w3" (symbol-name idlwave-help-browser-function)))
(idlwave-help-display-help-window '(lambda () (browse-url full-link))))
(t (browse-url full-link)))))
;; A special help routine for source-level syntax help in files.
(defvar idlwave-help-fontify-source-code)
@ -814,7 +837,7 @@ This function can be used as `idlwave-extra-help-function'."
(if class-only ;Help with class? Using "Init" as source.
(setq name "Init"
type 'fun))
(if (not struct-tag)
(if (not struct-tag)
(setq file
(idlwave-routine-source-file
(nth 3 (idlwave-best-rinfo-assoc
@ -827,16 +850,15 @@ This function can be used as `idlwave-extra-help-function'."
(if (or struct-tag (stringp file))
(progn
(setq in-buf ; structure-tag completion is always in current buffer
(if struct-tag
(if struct-tag
idlwave-current-tags-buffer
(idlwave-get-buffer-visiting file)))
;; see if file is in a visited buffer, insert those contents
(if in-buf
(progn
(setq file (buffer-file-name in-buf))
(erase-buffer)
(insert-buffer-substring in-buf)
(goto-char (point-min)))
(erase-buffer)
(insert-buffer-substring in-buf))
(if (file-exists-p file) ;; otherwise just load the file
(progn
(erase-buffer)
@ -850,19 +872,19 @@ This function can be used as `idlwave-extra-help-function'."
;; Try to find a good place to display
(setq def-pos
;; Find the class structure tag if that's what we're after
(cond
(cond
;; Class structure tags: find the class or named structure
;; definition
(class-struct-tag
(save-excursion
(save-excursion
(setq class
(if (string-match "[a-zA-Z0-9]\\(__\\)" name)
(if (string-match "[a-zA-Z0-9]\\(__\\)" name)
(substring name 0 (match-beginning 1))
idlwave-current-tags-class))
(and
(idlwave-find-class-definition class nil real-class)
(idlwave-find-struct-tag keyword))))
;; Generic structure tags: the structure definition
;; location within the file has been recorded in
;; `struct-tag'
@ -872,14 +894,14 @@ This function can be used as `idlwave-extra-help-function'."
(integerp struct-tag)
(goto-char struct-tag)
(idlwave-find-struct-tag keyword))))
;; Just find the routine definition
(t
(if class-only (point-min)
(idlwave-help-find-routine-definition name type class keyword))))
idlwave-help-def-pos def-pos)
(if (and idlwave-help-source-try-header
(if (and idlwave-help-source-try-header
(not (or struct-tag class-struct-tag)))
;; Check if we can find the header
(save-excursion
@ -889,7 +911,7 @@ This function can be used as `idlwave-extra-help-function'."
idlwave-help-in-header header-pos)))
(if (or header-pos def-pos)
(progn
(progn
(if (boundp 'idlwave-help-min-frame-width)
(setq idlwave-help-min-frame-width 80))
(goto-char (or header-pos def-pos)))
@ -903,7 +925,7 @@ This function can be used as `idlwave-extra-help-function'."
KEYWORD is ignored. Returns the point of match if successful, nil otherwise."
(save-excursion
(goto-char (point-max))
(if (re-search-backward
(if (re-search-backward
(concat "^[ \t]*"
(if (eq type 'pro) "pro"
(if (eq type 'fun) "function"
@ -949,22 +971,22 @@ with spaces allowed between the keyword and the following dash or equal sign.
If there is a match, we assume it is the keyword description."
(let* ((case-fold-search t)
(rname (if (stringp class)
(concat
(concat
"\\("
;; Traditional name or class::name
"\\("
"\\(" (regexp-quote (downcase class)) "::\\)?"
(regexp-quote (downcase name))
"\\>\\)"
(concat
(concat
"\\|"
;; class__define or just class
(regexp-quote (downcase class)) "\\(__define\\)?")
"\\)")
(regexp-quote (downcase name))))
;; NAME tag plus the routine name. The new version is from JD.
(name-re (concat
(name-re (concat
"\\(^;+\\*?[ \t]*"
idlwave-help-doclib-name
"\\([ \t]*:\\|[ \t]*$\\)[ \t]*\\(\n;+[ \t]*\\)*"
@ -999,7 +1021,7 @@ If there is a match, we assume it is the keyword description."
(regexp-quote (upcase keyword))
"\\>")))
dstart dend name-pos kwds-pos kwd-pos)
(catch 'exit
(catch 'exit
(save-excursion
(goto-char (point-min))
(while (and (setq dstart (re-search-forward idlwave-doclib-start nil t))
@ -1007,7 +1029,7 @@ If there is a match, we assume it is the keyword description."
;; found a routine header
(goto-char dstart)
(if (setq name-pos (re-search-forward name-re dend t))
(progn
(progn
(if keyword
;; We do need a keyword
(progn
@ -1089,7 +1111,7 @@ When DING is non-nil, ring the bell as well."
(idlwave-help-find-first-header nil)
(setq idlwave-help-in-header nil)
(idlwave-help-toggle-header-match-and-def arg 'top)))
(defun idlwave-help-toggle-header-match-and-def (arg &optional top)
(interactive "P")
(let ((args idlwave-help-args)
@ -1101,7 +1123,7 @@ When DING is non-nil, ring the bell as well."
(setq pos idlwave-help-def-pos))
;; Try to display header
(setq pos (apply 'idlwave-help-find-in-doc-header
(if top
(if top
(list (car args) (nth 1 args) (nth 2 args) nil)
args)))
(if pos
@ -1135,7 +1157,7 @@ Useful when source code is displayed as help. See the option
(font-lock-fontify-buffer))
(set-syntax-table syntax-table)))))
(defun idlwave-help-error (name type class keyword)
(error "Can't find help on %s%s %s"
(or (and (or class name) (idlwave-make-full-name class name))
@ -1191,6 +1213,98 @@ Useful when source code is displayed as help. See the option
(let ((entry (idlwave-best-rinfo-assoc name type class (idlwave-routines))))
(idlwave-entry-has-help entry)))
;;----- Control the IDL Assistant, which shipped with IDL v6.2
(defvar idlwave-help-assistant-process nil)
(defvar idlwave-help-assistant-socket nil)
;; The Windows version does not have a !DIR/bin/* set of front-end
;; scripts, but instead only links directly to bin.x86. As a result,
;; we must pass the -profile argument as well.
(defvar idlwave-help-assistant-command
(if (memq system-type '(ms-dos windows-nt))
"bin/bin.x86/idl_assistant"
"bin/idl_assistant")
"The command, rooted at idlwave-system-directory, which invokes the
IDL assistant.")
(defun idlwave-help-assistant-available ()
(if idlwave-help-assistant-available
(eq idlwave-help-assistant-available t)
(setq idlwave-help-assistant-available
(if (file-executable-p (idlwave-help-assistant-command))
t
'not-available))))
(defun idlwave-help-assistant-command ()
(expand-file-name idlwave-help-assistant-command (idlwave-sys-dir)))
(defun idlwave-help-assistant-start (&optional link)
"Start the IDL Assistant, loading LINK, if passed."
(when (or (not idlwave-help-assistant-socket)
(not (eq (process-status idlwave-help-assistant-socket) 'open)))
(let* ((help-loc (idlwave-html-help-location))
(command (idlwave-help-assistant-command))
(extra-args
(nconc
(if (memq system-type '(ms-dos windows-nt))
`("-profile" ,(expand-file-name "idl.adp" help-loc)))
(if link
`("-file" ,(expand-file-name link help-loc)))))
port)
(if idlwave-help-assistant-socket
(delete-process idlwave-help-assistant-socket))
(setq idlwave-help-assistant-process
(apply 'start-process
"IDL_ASSISTANT_PROC" nil command "-server" extra-args))
(set-process-filter idlwave-help-assistant-process
(lambda (proc string)
(setq port (string-to-number string))))
(unless (accept-process-output idlwave-help-assistant-process 15)
(error "Failed binding IDL_ASSISTANT socket"))
(if (not port)
(error "Unable to open IDL_ASSISTANT.")
(set-process-filter idlwave-help-assistant-process nil)
(setq idlwave-help-assistant-socket
(open-network-stream "IDL_ASSISTANT_SOCK"
nil "localhost" port))
(if (eq (process-status idlwave-help-assistant-socket) 'open)
(process-send-string idlwave-help-assistant-socket
(concat "setHelpPath " help-loc "\n"))
(idlwave-help-assistant-close)
(error "Cannot communicate with IDL_ASSISTANT"))))))
(defun idlwave-help-assistant-raise ()
(idlwave-help-assistant-start)
(process-send-string idlwave-help-assistant-socket "raise\n"))
(defun idlwave-help-assistant-open-link (&optional link)
;; Open a link (file name with anchor, no leading path) in the assistant.
(if link
(let ((file (expand-file-name link (idlwave-html-help-location))))
(idlwave-help-assistant-start link)
(process-send-string idlwave-help-assistant-socket
(concat "openLink " file "\n"))
(string-match "\.html" link)
(process-send-string idlwave-help-assistant-socket
(concat "searchIndexNoOpen "
(substring link 0 (match-beginning 0))
"\n")))
(idlwave-help-assistant-raise)))
(defun idlwave-help-assistant-close ()
(when (and idlwave-help-assistant-process
(eq (process-status idlwave-help-assistant-process) 'run))
(when idlwave-help-assistant-socket
(process-send-string idlwave-help-assistant-socket "quit\n")
(delete-process idlwave-help-assistant-socket))
(stop-process idlwave-help-assistant-process)
(delete-process idlwave-help-assistant-process)
(setq idlwave-help-assistant-socket nil
idlwave-help-assistant-process nil)))
(provide 'idlw-help)
(provide 'idlwave-help)

File diff suppressed because one or more lines are too long

View file

@ -1,12 +1,12 @@
;; idlw-shell.el --- run IDL as an inferior process of Emacs.
;; Copyright (c) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
;; Free Software Foundation, Inc.
;; Free Software Foundation
;; Authors: J.D. Smith <jdsmith@as.arizona.edu>
;; Carsten Dominik <dominik@astro.uva.nl>
;; Chris Chase <chase@att.com>
;; Maintainer: J.D. Smith <jdsmith@as.arizona.edu>
;; Version: 5.7_22
;; Version: 6.0_em22
;; Keywords: processes
;; This file is part of GNU Emacs.
@ -138,6 +138,11 @@ process output is made by surrounding this name with `*'s."
;; (defcustom idlwave-shell-automatic-start...) See idlwave.el
(defcustom idlwave-shell-use-dedicated-window nil
"*Non-nil means, never replace the shell frame with another buffer."
:group 'idlwave-shell-general-setup
:type 'boolean)
(defcustom idlwave-shell-use-dedicated-frame nil
"*Non-nil means, IDLWAVE should use a special frame to display shell buffer."
:group 'idlwave-shell-general-setup
@ -313,8 +318,15 @@ the copious shell traffic to be displayed."
(const :tag "All debug and stepping commands" debug)
(const :tag "Close, window, retall, etc. commands" misc))))
(defcustom idlwave-shell-max-print-length 200
"Maximum number of array elements to print when examining."
:group 'idlwave-shell-command-setup
:type 'integer)
(defcustom idlwave-shell-examine-alist
'(("Print" . "print,___")
`(("Print" . ,(concat "idlwave_print_safe,___,"
(number-to-string
idlwave-shell-max-print-length)))
("Help" . "help,___")
("Structure Help" . "help,___,/STRUCTURE")
("Dimensions" . "print,size(___,/DIMENSIONS)")
@ -322,6 +334,7 @@ the copious shell traffic to be displayed."
("N_Elements" . "print,n_elements(___)")
("All Size Info" . "help,(__IWsz__=size(___,/STRUCTURE)),/STRUCTURE & print,__IWsz__.DIMENSIONS")
("Ptr Valid" . "print,ptr_valid(___)")
("Arg Present" . "print,arg_present(___)")
("Widget Valid" . "print,widget_info(___,/VALID)")
("Widget Geometry" . "help,widget_info(___,/GEOMETRY)"))
"Alist of special examine commands for popup selection.
@ -437,6 +450,11 @@ popup help text on the line."
:group 'idlwave-shell-command-setup
:type 'boolean)
(defcustom idlwave-shell-reset-no-prompt nil
"If non-nil, skip the yes/no prompt when resetting the IDL session."
:group 'idlwave-shell-command-setup
:type 'boolean)
;; Breakpoint Overlays etc
(defgroup idlwave-shell-highlighting-and-faces nil
"Highlighting and Faces used by the IDLWAVE Shell mode."
@ -488,11 +506,11 @@ line where IDL is stopped. See also `idlwave-shell-mark-stop-line'."
(defcustom idlwave-shell-electric-stop-line-face
(prog1
(copy-face 'modeline 'idlwave-shell-electric-stop-line-face)
(set-face-background 'idlwave-shell-electric-stop-line-face
(copy-face 'modeline 'idlwave-shell-electric-stop-line)
(set-face-background 'idlwave-shell-electric-stop-line
idlwave-shell-electric-stop-color)
(condition-case nil
(set-face-foreground 'idlwave-shell-electric-stop-line-face nil)
(set-face-foreground 'idlwave-shell-electric-stop-line nil)
(error nil)))
"*The face for `idlwave-shell-stop-line-overlay' when in electric debug mode.
Allows you to choose the font, color and other properties for the line
@ -553,6 +571,7 @@ lines which have a breakpoint. See also `idlwave-shell-mark-breakpoints'."
"Face for highlighting lines with breakpoints."
:group 'idlwave-shell-highlighting-and-faces))
(defcustom idlwave-shell-expression-face 'secondary-selection
"*The face for `idlwave-shell-expression-overlay'.
Allows you to choose the font, color and other properties for
@ -652,7 +671,7 @@ the directory stack.")
"The overlay for where IDL is currently stopped.")
(defvar idlwave-shell-is-stopped nil)
(defvar idlwave-shell-expression-overlay nil
"The overlay for where IDL is currently stopped.")
"The overlay for the examined expression.")
(defvar idlwave-shell-output-overlay nil
"The overlay for the last IDL output.")
@ -700,10 +719,21 @@ the directory stack.")
(setq idlwave-shell-expression-overlay (make-overlay 1 1))
(overlay-put idlwave-shell-expression-overlay
'face idlwave-shell-expression-face)
(overlay-put idlwave-shell-expression-overlay
'priority 1)
(setq idlwave-shell-output-overlay (make-overlay 1 1))
(overlay-put idlwave-shell-output-overlay
'face idlwave-shell-output-face)
(copy-face idlwave-shell-stop-line-face
'idlwave-shell-pending-stop)
(copy-face idlwave-shell-electric-stop-line-face
'idlwave-shell-pending-electric-stop)
(set-face-background 'idlwave-shell-pending-stop "gray70")
(set-face-background 'idlwave-shell-pending-electric-stop "gray70")
(defvar idlwave-shell-bp-query "help,/breakpoints"
"Command to obtain list of breakpoints")
@ -823,6 +853,7 @@ IDL has currently stepped.")
? Help on expression near point or in region ([C-u ?]).
x Examine expression near point or in region ([C-u x]) with
letter completion of the examine type.
e Prompt for an expression to print.
Miscellaneous:
q Quit - end debugging session and return to the Shell's main level.
@ -998,6 +1029,8 @@ IDL has currently stepped.")
(setq idlwave-shell-default-directory default-directory)
(setq idlwave-shell-hide-output nil)
;; NB: `make-local-hook' needed for older/alternative Emacs compatibility
;; (make-local-hook 'kill-buffer-hook)
(add-hook 'kill-buffer-hook 'idlwave-shell-kill-shell-buffer-confirm
nil 'local)
(add-hook 'kill-buffer-hook 'idlwave-shell-delete-temp-files nil 'local)
@ -1040,6 +1073,8 @@ IDL has currently stepped.")
(set (make-local-variable 'comment-start) ";")
(setq abbrev-mode t)
;; NB: `make-local-hook' needed for older/alternative Emacs compatibility
;; make-local-hook 'post-command-hook)
(add-hook 'post-command-hook 'idlwave-command-hook nil t)
;; Read the command history?
@ -1061,23 +1096,25 @@ IDL has currently stepped.")
(idlwave-shell-send-command
(format "defsysv,'!idlwave_version','%s',1" idlwave-mode-version)
nil 'hide)
;; Get the paths if they weren't read in from file
(if (and (not idlwave-path-alist)
(or (not (stringp idlwave-system-directory))
(eq (length idlwave-system-directory) 0)))
(idlwave-shell-send-command idlwave-shell-path-query
'idlwave-shell-get-path-info
'hide)))
;; Read the paths, and save if they changed
(idlwave-shell-send-command idlwave-shell-path-query
'idlwave-shell-get-path-info
'hide))
(defvar idlwave-system-directory)
(defun idlwave-shell-get-path-info (&optional no-write)
"Get the path lists, writing to file unless NO-WRITE is set."
(let* ((rpl (idlwave-shell-path-filter))
(sysdir (car rpl))
(dirs (cdr rpl))
(old-path-alist idlwave-path-alist))
(old-path-alist idlwave-path-alist)
(old-sys-dir idlwave-system-directory)
path-changed sysdir-changed)
(when sysdir
(setq idlwave-system-directory sysdir)
(put 'idlwave-system-directory 'from-shell t))
(if (setq sysdir-changed
(not (string= idlwave-system-directory old-sys-dir)))
(put 'idlwave-system-directory 'from-shell t)))
;; Preserve any existing flags
(setq idlwave-path-alist
(mapcar (lambda (x)
@ -1086,11 +1123,13 @@ IDL has currently stepped.")
(cons x (cdr old-entry))
(list x))))
dirs))
(put 'idlwave-path-alist 'from-shell t)
(if (setq path-changed (not (equal idlwave-path-alist old-path-alist)))
(put 'idlwave-path-alist 'from-shell t))
(if idlwave-path-alist
(if (and idlwave-auto-write-paths
(not idlwave-library-path)
(not no-write) )
(if (and (not no-write)
idlwave-auto-write-paths
(or sysdir-changed path-changed)
(not idlwave-library-path))
(idlwave-write-paths))
;; Fall back
(setq idlwave-path-alist old-path-alist))))
@ -1199,12 +1238,14 @@ See also the variable `idlwave-shell-prompt-pattern'.
(current-window (selected-window)))
(select-window window)
(goto-char (point-max))
(if idlwave-shell-use-dedicated-window
(set-window-dedicated-p window t))
(select-window current-window)
(if idlwave-shell-ready
(raise-frame (window-frame window)))
(if (eq (selected-frame) (window-frame window))
(select-window window))))
;; Save the paths at the end
;; Save the paths at the end, if they are from the Shell and new.
(add-hook 'idlwave-shell-sentinel-hook
(lambda ()
(if (and
@ -1518,10 +1559,10 @@ and then calls `idlwave-shell-send-command' for any pending commands."
;;; Test/Debug code
; (save-excursion (set-buffer
; (get-buffer-create "*idlwave-shell-output*"))
; (goto-char (point-max))
; (insert "\nSTRING===>\n" string "\n<====\n"))
;(with-current-buffer
; (get-buffer-create "*idlwave-shell-output*")
; (goto-char (point-max))
; (insert "\nReceived STRING\n===>\n" string "\n<====\n"))
;; Check for prompt in current accumulating output
(when (setq idlwave-shell-ready
@ -1536,14 +1577,14 @@ and then calls `idlwave-shell-send-command' for any pending commands."
(re-search-backward idlwave-shell-prompt-pattern nil t)
(goto-char (match-end 0))
(setq idlwave-shell-command-output
(buffer-substring (point-min) (point)))
(buffer-substring-no-properties (point-min) (point)))
(delete-region (point-min) (point)))
(setq idlwave-shell-command-output
(with-current-buffer (process-buffer proc)
(buffer-substring
(buffer-substring-no-properties
(save-excursion
(goto-char (process-mark proc))
(forward-line 0)
(forward-line 0) ; Emacs 21 (beginning-of-line nil)
(point))
comint-last-input-end))))
@ -1570,10 +1611,10 @@ and then calls `idlwave-shell-send-command' for any pending commands."
;; Call the post-command hook
(if (listp idlwave-shell-post-command-hook)
(progn
;(message "Calling list")
;(prin1 idlwave-shell-post-command-hook)
;;(message "Calling list")
;;(prin1 idlwave-shell-post-command-hook)
(eval idlwave-shell-post-command-hook))
;(message "Calling command function")
;;(message "Calling command function")
(funcall idlwave-shell-post-command-hook))
;; Reset to default state for next command.
@ -1668,6 +1709,8 @@ The 5th group is the file name.
All parts may contain linebreaks surrounded by spaces. This is important
in IDL5 which inserts random linebreaks in long module and file names.")
(defvar idlwave-shell-electric-debug-mode) ; defined by easy-mmode
(defun idlwave-shell-scan-for-state ()
"Scan for state info. Looks for messages in output from last IDL
command indicating where IDL has stopped. The types of messages we are
@ -1688,9 +1731,8 @@ the above."
idlwave-shell-command-output)
(string-match idlwave-shell-other-error
idlwave-shell-command-output))
(save-excursion
(set-buffer
(get-buffer-create idlwave-shell-error-buffer))
(with-current-buffer
(get-buffer-create idlwave-shell-error-buffer)
(erase-buffer)
(insert idlwave-shell-command-output)
(goto-char (point-min))
@ -1723,8 +1765,10 @@ the above."
(substring idlwave-shell-command-output (match-end 0))))
(setq idlwave-shell-current-state 'halt)
;; Don't debug trace messages
(idlwave-shell-display-line (idlwave-shell-pc-frame) nil
(if trace 'no-debug)))
(idlwave-shell-display-line
(idlwave-shell-pc-frame) nil
(if trace 'disable
(if idlwave-shell-electric-debug-mode 'force))))
;; Fourth Priority: Breakpoints
((string-match idlwave-shell-break-message
@ -1763,29 +1807,29 @@ the above."
(defun idlwave-shell-parse-line (string &optional skip-main)
"Parse IDL message for the subroutine, file name and line number.
We need to work hard here to remove the stupid line breaks inserted by
IDL5. These line breaks can be right in the middle of procedure
or file names.
It is very difficult to come up with a robust solution. This one seems
to be pretty good though.
Here is in what ways it improves over the previous solution:
1. The procedure name can be split and will be restored.
2. The number can be split. I have never seen this, but who knows.
3. We do not require the `.pro' extension for files.
This function can still break when the file name ends on a end line
and the message line contains an additional line with garbage. Then
the first part of that garbage will be added to the file name.
However, the function checks the existence of the files with and
without this last part - thus the function only breaks if file name
plus garbage match an existing regular file. This is hopefully very
unlikely.
If optional arg SKIP-MAIN is non-nil, don't parse $MAIN$ routine stop
statements."
"Parse IDL message for the subroutine, file name and line number."
;We need to work hard here to remove the stupid line breaks inserted by
;IDL5. These line breaks can be right in the middle of procedure
;or file names.
;It is very difficult to come up with a robust solution. This one seems
;to be pretty good though.
;
;Here is in what ways it improves over the previous solution:
;
;1. The procedure name can be split and will be restored.
;2. The number can be split. I have never seen this, but who knows.
;3. We do not require the `.pro' extension for files.
;
;This function can still break when the file name ends on an end line
;and the message line contains an additional line with garbage. Then
;the first part of that garbage will be added to the file name.
;However, the function checks the existence of the files with and
;without this last part - thus the function only breaks if file name
;plus garbage match an existing regular file. This is hopefully very
;unlikely.
;
;If optional arg SKIP-MAIN is non-nil, don't parse $MAIN$ routine stop
;statements.
(let (number procedure file)
(when (and (not (if skip-main (string-match ":\\s-*\\$MAIN" string)))
@ -1926,14 +1970,17 @@ CLOSE, /ALL
HEAP_GC, /VERBOSE"
;; OBJ_DESTROY, OBJ_VALID() FIXME: should this be added?
(interactive "P")
(message "Resetting IDL")
(setq idlwave-shell-calling-stack-index 0)
(idlwave-shell-send-command "retall" nil hidden)
(idlwave-shell-send-command "widget_control,/reset" nil hidden)
(idlwave-shell-send-command "close,/all" nil hidden)
;; (idlwave-shell-send-command "obj_destroy, obj_valid()" nil hidden)
(idlwave-shell-send-command "heap_gc,/verbose" nil hidden)
(idlwave-shell-display-line nil))
(when (or idlwave-shell-reset-no-prompt
(yes-or-no-p "Really Reset IDL and discard current session? "))
(message "Resetting IDL")
(setq idlwave-shell-calling-stack-index 0)
;; Give widget exit handlers a chance
(idlwave-shell-send-command "retall" nil hidden)
(idlwave-shell-send-command "widget_control,/reset" nil hidden)
(idlwave-shell-send-command "close,/all" nil hidden)
;; (idlwave-shell-send-command "obj_destroy, obj_valid()" nil hidden)
(idlwave-shell-send-command "heap_gc,/verbose" nil hidden)
(idlwave-shell-display-line nil)))
(defun idlwave-shell-path-filter ()
;; Convert the output of the path query into a list of directories
@ -1978,9 +2025,6 @@ HEAP_GC, /VERBOSE"
(message
"Routine Info warning: No match for END line in \n>>>\n%s\n<<<\n"
idlwave-shell-command-output)))
(if (string-match "\\S-" text)
;; Obviously, the pro worked. Make a note that we have it now.
(setq idlwave-idlwave_routine_info-compiled t))
;; Match the output lines
(while (string-match "^IDLWAVE-\\(PRO\\|FUN\\): \\(.*\\)" text start)
(setq start (match-end 0))
@ -2208,7 +2252,6 @@ args of an executive .run, .rnew or .compile."
(looking-at "\\$")))
;; Debugging Commands ------------------------------------------------------
(defvar idlwave-shell-electric-debug-mode) ; defined by easy-mmode
(defun idlwave-shell-redisplay (&optional hide)
"Tries to resync the display with where execution has stopped.
@ -2259,14 +2302,14 @@ overlays."
(setq idlwave-shell-calling-stack-routine
(nth 2 (nth idlwave-shell-calling-stack-index stack)))
;; only edebug if in that mode already
;; force edebug for this frame if we're in that mode already
(idlwave-shell-display-line
(nth idlwave-shell-calling-stack-index stack) nil
(unless idlwave-shell-electric-debug-mode 'no-debug))
(if idlwave-shell-electric-debug-mode 'force))
(message "%s" (or message
(format "In routine %s (stack level %d)"
idlwave-shell-calling-stack-routine
(- idlwave-shell-calling-stack-index))))))
(format "In routine %s (stack level %d)"
idlwave-shell-calling-stack-routine
(- idlwave-shell-calling-stack-index))))))
(defun idlwave-shell-stack-up ()
"Display the source code one step up the calling stack."
@ -2302,30 +2345,38 @@ used. Does nothing if the resulting frame is nil."
"Check that frame is for an existing file."
(file-readable-p (car frame)))
(defvar idlwave-shell-suppress-electric-debug nil)
(defun idlwave-shell-display-line (frame &optional col no-debug)
"Display FRAME file in other window with overlay arrow.
(defun idlwave-shell-stop-line-pending ()
;; Temporarily change the color of the stop line overlay
(if idlwave-shell-stop-line-overlay
(overlay-put idlwave-shell-stop-line-overlay 'face
(if idlwave-shell-electric-debug-mode
'idlwave-shell-pending-electric-stop
'idlwave-shell-pending-stop))))
FRAME is a list of file name, line number, and subroutine name. If
FRAME is nil then remove overlay. If COL is set, move point to that
column in the line. If NO-DEBUG is non-nil, do *not* toggle the electric
debug mode."
(defvar idlwave-shell-suppress-electric-debug nil)
(defun idlwave-shell-display-line (frame &optional col debug)
"display frame file in other window with overlay arrow.
frame is a list of file name, line number, and subroutine name. if
frame is nil then remove overlay. if col is set, move point to that
column in the line. if debug is non-nil, enable the electric debug
mode. if it is 'disable, do not enable no matter what the setting of
'idlwave-shell-automatic-electric-debug'. if it is 'force, enable no
matter what the settings of that variable."
(if (not frame)
;; Remove stop-line overlay from old position
;; remove stop-line overlay from old position
(progn
(setq overlay-arrow-string nil)
(setq idlwave-shell-mode-line-info nil)
(setq idlwave-shell-is-stopped nil)
(if idlwave-shell-stop-line-overlay
(delete-overlay idlwave-shell-stop-line-overlay))
;; Turn off electric debug everywhere, if it's on
(if (and (not no-debug)
idlwave-shell-automatic-electric-debug)
(idlwave-shell-electric-debug-all-off)))
;; turn off electric debug everywhere, if it's on
(idlwave-shell-electric-debug-all-off))
(if (not (idlwave-shell-valid-frame frame))
;; FIXME: errors are dangerous in shell filters. But I think I
;; fixme: errors are dangerous in shell filters. but i think i
;; have never encountered this one.
(error (concat "Invalid frame - unable to access file: " (car frame)))
(error (concat "invalid frame - unable to access file: " (car frame)))
;;;
;;; buffer : the buffer to display a line in.
;;; select-shell: current buffer is the shell.
@ -2339,15 +2390,15 @@ debug mode."
(select-shell (equal (buffer-name) (idlwave-shell-buffer)))
window pos electric)
;; First make sure the shell window is visible
;; first make sure the shell window is visible
(idlwave-display-buffer (idlwave-shell-buffer)
nil (idlwave-shell-shell-frame))
;; Now display the buffer and remember which window it is.
;; now display the buffer and remember which window it is.
(setq window (idlwave-display-buffer buffer
nil (idlwave-shell-source-frame)))
;; Enter the buffer and mark the line
;; enter the buffer and mark the line
(save-excursion
(set-buffer buffer)
(save-restriction
@ -2358,45 +2409,53 @@ debug mode."
(setq idlwave-shell-is-stopped t)
(if idlwave-shell-stop-line-overlay
;; Move overlay
(move-overlay idlwave-shell-stop-line-overlay
(point) (save-excursion (end-of-line) (point))
(current-buffer))
;; Use the arrow instead, but only if marking is wanted.
(progn
;; restore face and move overlay
(overlay-put idlwave-shell-stop-line-overlay 'face
(if idlwave-shell-electric-debug-mode
idlwave-shell-electric-stop-line-face
idlwave-shell-stop-line-face))
(move-overlay idlwave-shell-stop-line-overlay
(point) (save-excursion (end-of-line) (point))
(current-buffer)))
;; use the arrow instead, but only if marking is wanted.
(if idlwave-shell-mark-stop-line
(setq overlay-arrow-string idlwave-shell-overlay-arrow))
(or overlay-arrow-position ; create the marker if necessary
(setq overlay-arrow-position (make-marker)))
(set-marker overlay-arrow-position (point) buffer)))
;; If the point is outside the restriction, widen the buffer.
;; if the point is outside the restriction, widen the buffer.
(if (or (< pos (point-min)) (> pos (point-max)))
(progn
(widen)
(goto-char pos)))
;; If we have the column of the error, move the cursor there.
;; if we have the column of the error, move the cursor there.
(if col (move-to-column col))
(setq pos (point))
;; Enter electric debug mode, if not prohibited and not in
;; enter electric debug mode, if not prohibited and not in
;; it already
(when (and (or
(eq idlwave-shell-automatic-electric-debug t)
(and
(eq idlwave-shell-automatic-electric-debug 'breakpoint)
(not (eq idlwave-shell-current-state 'error))))
(not no-debug)
(not idlwave-shell-suppress-electric-debug)
(not idlwave-shell-electric-debug-mode))
(idlwave-shell-electric-debug-mode)
(setq electric t)))
(when (and (not idlwave-shell-electric-debug-mode)
(or (eq debug 'force)
(and
(not (eq debug 'disable)) ;; explicitly disabled
(or
(eq idlwave-shell-automatic-electric-debug t)
(and
(eq idlwave-shell-automatic-electric-debug
'breakpoint)
(not (eq idlwave-shell-current-state 'error))))
(not idlwave-shell-suppress-electric-debug))))
(idlwave-shell-electric-debug-mode t))
(setq electric idlwave-shell-electric-debug-mode))
;; Make sure pos is really displayed in the window.
(set-window-point window pos)
;; If we came from the shell, go back there. Otherwise select
;; the window where the error is displayed.
;; the window where the error/halt is displayed.
(if (or (and idlwave-shell-electric-zap-to-file electric)
(and (equal (buffer-name) (idlwave-shell-buffer))
(not select-shell)))
@ -2408,6 +2467,7 @@ debug mode."
(interactive "p")
(or (not arg) (< arg 1)
(setq arg 1))
(idlwave-shell-stop-line-pending)
(idlwave-shell-send-command
(concat ".s " (if (integerp arg) (int-to-string arg) arg))
nil (if (idlwave-shell-hide-p 'debug) 'mostly) nil t))
@ -2419,6 +2479,7 @@ Uses IDL's stepover executive command which does not enter called functions."
(interactive "p")
(or (not arg) (< arg 1)
(setq arg 1))
(idlwave-shell-stop-line-pending)
(idlwave-shell-send-command
(concat ".so " (if (integerp arg) (int-to-string arg) arg))
nil (if (idlwave-shell-hide-p 'debug) 'mostly) nil t))
@ -2462,13 +2523,13 @@ the problem with not being able to set the breakpoint."
(beep)
(y-or-n-p
(concat "Okay to recompile file "
(idlwave-shell-bp-get bp 'file) "? ")))
(idlwave-shell-bp-get bp 'file) "?")))
;; Recompile
(progn
;; Clean up before retrying
(idlwave-shell-command-failure)
(idlwave-shell-send-command
(concat ".run " (idlwave-shell-bp-get bp 'file)) nil
(concat ".run \"" (idlwave-shell-bp-get bp 'file) "\"") nil
(if (idlwave-shell-hide-p 'run) 'mostly) nil t)
;; Try setting breakpoint again
(idlwave-shell-set-bp bp))
@ -2496,6 +2557,7 @@ breakpoint can not be set."
(defun idlwave-shell-cont (&optional no-show)
"Continue executing."
(interactive)
(idlwave-shell-stop-line-pending)
(idlwave-shell-send-command ".c" (unless no-show
'(idlwave-shell-redisplay 'hide))
(if (idlwave-shell-hide-p 'debug) 'mostly)
@ -2504,6 +2566,7 @@ breakpoint can not be set."
(defun idlwave-shell-go ()
"Run .GO. This starts the main program of the last compiled file."
(interactive)
(idlwave-shell-stop-line-pending)
(idlwave-shell-send-command ".go" '(idlwave-shell-redisplay 'hide)
(if (idlwave-shell-hide-p 'debug) 'mostly)
nil t))
@ -2511,6 +2574,7 @@ breakpoint can not be set."
(defun idlwave-shell-return ()
"Run .RETURN (continue to next return, but stay in subprogram)."
(interactive)
(idlwave-shell-stop-line-pending)
(idlwave-shell-send-command ".return" '(idlwave-shell-redisplay 'hide)
(if (idlwave-shell-hide-p 'debug) 'mostly)
nil t))
@ -2518,6 +2582,7 @@ breakpoint can not be set."
(defun idlwave-shell-skip ()
"Run .SKIP (skip one line, then step)."
(interactive)
(idlwave-shell-stop-line-pending)
(idlwave-shell-send-command ".skip" '(idlwave-shell-redisplay 'hide)
(if (idlwave-shell-hide-p 'debug) 'mostly)
nil t))
@ -2603,6 +2668,7 @@ If ENABLE is non-nil, enable them instead."
(defun idlwave-shell-to-here ()
"Set a breakpoint with count 1 then continue."
(interactive)
;; temporarily disable all other breakpoints
(let ((disabled (idlwave-shell-enable-all-bp 'disable 'no-update)))
(idlwave-shell-break-here 1 nil nil nil 'no-show)
(idlwave-shell-cont 'no-show)
@ -2739,13 +2805,18 @@ Runs to the last statement and then steps 1 statement. Use the .out command."
`(lambda (event)
"Expansion function for expression examination."
(interactive "e")
(let ((transient-mark-mode t)
(zmacs-regions t)
(tracker (if (featurep 'xemacs)
(if (fboundp 'default-mouse-track-event-is-with-button)
'idlwave-xemacs-hack-mouse-track
'mouse-track)
'mouse-drag-region)))
(let* ((drag-track (fboundp 'mouse-drag-track))
(transient-mark-mode t)
(zmacs-regions t)
(tracker (if (featurep 'xemacs)
(if (fboundp
'default-mouse-track-event-is-with-button)
'idlwave-xemacs-hack-mouse-track
'mouse-track)
;; Emacs 22 no longer completes the drag with
;; mouse-drag-region, without an additional
;; event. mouse-drag-track does so.
(if drag-track 'mouse-drag-track 'mouse-drag-region))))
(funcall tracker event)
(idlwave-shell-print (if (idlwave-region-active-p) '(4) nil)
,help ,ev))))
@ -2756,8 +2827,9 @@ Runs to the last statement and then steps 1 statement. Use the .out command."
t)
(defun idlwave-xemacs-hack-mouse-track (event)
(if (featurep 'xemacs)
(let ((oldfunc (symbol-function 'default-mouse-track-event-is-with-button)))
(if (featurep 'xemacs)
(let ((oldfunc (symbol-function
'default-mouse-track-event-is-with-button)))
(unwind-protect
(progn
(fset 'default-mouse-track-event-is-with-button
@ -2822,6 +2894,11 @@ idlw-shell-examine-alist from which to select the help command text.
If instead COMPLETE-HELP-TYPE is non-nil, choose from
idlw-shell-examine-alist via mini-buffer shortcut key."
(interactive "P")
;; For speed: assume the helper routine hasn't been lost, e.g. with
;; .FULL_RESET_SESSION. We'll recover if necessary
(unless idlwave-idlwave_routine_info-compiled
(idlwave-shell-compile-helper-routines))
(save-excursion
(let* ((process (get-buffer-process (current-buffer)))
(process-mark (if process (process-mark process)))
@ -2831,7 +2908,7 @@ idlw-shell-examine-alist via mini-buffer shortcut key."
(format " [-%d:%s]"
idlwave-shell-calling-stack-index
idlwave-shell-calling-stack-routine)))
expr beg end cmd examine-hook)
expr beg end cmd)
(cond
((equal arg '(16))
(setq expr (read-string "Expression: ")))
@ -2874,10 +2951,6 @@ idlw-shell-examine-alist via mini-buffer shortcut key."
(current-buffer))
(add-hook 'pre-command-hook
'idlwave-shell-delete-expression-overlay))
(setq examine-hook
(if idlwave-shell-separate-examine-output
'idlwave-shell-examine-display
'idlwave-shell-examine-highlight))
(add-hook 'pre-command-hook
'idlwave-shell-delete-output-overlay)
@ -2939,7 +3012,7 @@ idlw-shell-examine-alist via mini-buffer shortcut key."
;;(idlwave-shell-recenter-shell-window)
(idlwave-shell-send-command
cmd
examine-hook
'idlwave-shell-check-compiled-and-display
(if idlwave-shell-separate-examine-output 'hide))))))
(defvar idlwave-shell-examine-window-alist nil
@ -2949,6 +3022,15 @@ idlw-shell-examine-alist via mini-buffer shortcut key."
(define-key idlwave-shell-examine-map "q" 'idlwave-shell-examine-display-quit)
(define-key idlwave-shell-examine-map "c" 'idlwave-shell-examine-display-clear)
(defun idlwave-shell-check-compiled-and-display ()
"Check examine output for warning about undefined procedure/function."
(if (string-match "% Attempt to call undefined" idlwave-shell-command-output)
(idlwave-shell-compile-helper-routines))
(if idlwave-shell-separate-examine-output
(idlwave-shell-examine-display)
(idlwave-shell-examine-highlight)))
(defun idlwave-shell-examine-display ()
"View the examine command output in a separate buffer."
(let (win cur-beg cur-end)
@ -3121,13 +3203,16 @@ HELP can be non-nil for `help,', nil for 'print,' or any string into which
to insert expression in place of the marker ___, e.g.: print,
size(___,/DIMENSIONS)"
(cond
((null help) (concat "print, " expr))
((null help)
(concat "idlwave_print_safe, " expr ","
(number-to-string idlwave-shell-max-print-length)))
((stringp help)
(if (string-match "\\(^\\|[^_]\\)\\(___\\)\\([^_]\\|$\\)" help)
(concat (substring help 0 (match-beginning 2))
expr
(substring help (match-end 2)))))
(t (concat "help, " expr))))
(t
(concat "help, " expr))))
(defun idlwave-shell-examine-highlight ()
@ -3221,7 +3306,8 @@ If there is a prefix argument, display IDL process."
(idlwave-look-at "\\<end\\>")))
(insert "\nend\n"))
(save-buffer 0)))
(idlwave-shell-send-command (concat ".run " idlwave-shell-temp-pro-file)
(idlwave-shell-send-command (concat ".run \""
idlwave-shell-temp-pro-file "\"")
nil
(if (idlwave-shell-hide-p 'run) 'mostly)
nil t)
@ -3822,8 +3908,11 @@ handled by this command."
((eq action 'compile) ".compile ")
((eq action 'batch) "@")
(t (error "Unknown action %s" action)))
idlwave-shell-last-save-and-action-file)
'idlwave-shell-maybe-update-routine-info
"\""
idlwave-shell-last-save-and-action-file
"\"")
`(idlwave-shell-maybe-update-routine-info nil
,idlwave-shell-last-save-and-action-file)
(if (idlwave-shell-hide-p 'run) 'mostly) nil t)
(idlwave-shell-bp-query))
(let ((msg (format "No such file %s"
@ -3831,14 +3920,14 @@ handled by this command."
(setq idlwave-shell-last-save-and-action-file nil)
(error msg))))
(defun idlwave-shell-maybe-update-routine-info (&optional wait)
(defun idlwave-shell-maybe-update-routine-info (&optional wait file)
"Update the routine info if the shell is not stopped at an error."
(if (and (not idlwave-shell-is-stopped)
(or (eq t idlwave-auto-routine-info-updates)
(memq 'compile-buffer idlwave-auto-routine-info-updates))
idlwave-query-shell-for-routine-info
idlwave-routines)
(idlwave-shell-update-routine-info t nil wait)))
(idlwave-shell-update-routine-info t nil wait file)))
(defvar idlwave-shell-sources-query "help,/source,/full"
"IDL command to obtain source files for compiled procedures.")
@ -3983,7 +4072,7 @@ list elements of the form:
(setq idlwave-shell-error-last (point)))
(if frame
(progn
(idlwave-shell-display-line frame col 'no-debug))
(idlwave-shell-display-line frame col 'disable))
(beep)
(message "No more errors."))))
@ -4158,6 +4247,8 @@ Otherwise, just expand the file name."
'idlwave-shell-stack-down)
(define-key idlwave-shell-electric-debug-mode-map "_"
'idlwave-shell-stack-down)
(define-key idlwave-shell-electric-debug-mode-map "e"
'(lambda () (interactive) (idlwave-shell-print '(16))))
(define-key idlwave-shell-electric-debug-mode-map "q" 'idlwave-shell-retall)
(define-key idlwave-shell-electric-debug-mode-map "t"
'(lambda () (interactive) (idlwave-shell-send-command "help,/TRACE")))
@ -4181,9 +4272,11 @@ Otherwise, just expand the file name."
;; session until we return or hit $MAIN$. Cancel this suppression
;; if it's explicitly turned on.
(if idlwave-shell-electric-debug-mode
(setq idlwave-shell-suppress-electric-debug t)
(setq idlwave-shell-suppress-electric-debug nil))
(idlwave-shell-electric-debug-mode))
(progn ;; Turn it off, and make sure it stays off.
(setq idlwave-shell-suppress-electric-debug t)
(idlwave-shell-electric-debug-mode 0))
(setq idlwave-shell-suppress-electric-debug nil)
(idlwave-shell-electric-debug-mode t)))
(defvar idlwave-shell-electric-debug-read-only)
(defvar idlwave-shell-electric-debug-buffers nil)
@ -4196,9 +4289,9 @@ Null prefix argument turns off the mode.
When Electric Debug mode is enabled, the many debugging commands are
available as single key sequences."
nil
" *Debugging*"
idlwave-shell-electric-debug-mode-map)
nil
" *Debugging*"
idlwave-shell-electric-debug-mode-map)
(add-hook
'idlwave-shell-electric-debug-mode-on-hook
@ -4249,7 +4342,7 @@ available as single key sequences."
(when (and (eq major-mode 'idlwave-mode)
buffer-file-name
idlwave-shell-electric-debug-mode)
(idlwave-shell-electric-debug-mode))))))
(idlwave-shell-electric-debug-mode 0))))))
(setq idlwave-shell-electric-debug-buffers nil))
;; Show the help text

View file

@ -1,10 +1,10 @@
;;; idlw-toolbar.el --- a debugging toolbar for IDLWAVE
;; Copyright (c) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
;; Free Software Foundation, Inc.
;; Free Software Foundation
;; Author: Carsten Dominik <dominik@astro.uva.nl>
;; Maintainer: J.D. Smith <jdsmith@as.arizona.edu>
;; Version: 5.7_22
;; Version: 6.0_em22
;; Keywords: processes
;; This file is part of GNU Emacs.
@ -43,8 +43,8 @@
(toolbar-make-button-list image)
(list 'image :type 'xpm :data image)))
(defvar default-toolbar)
(defvar idlwave-toolbar)
(defvar default-toolbar)
(defvar idlwave-toolbar-is-possible)
(if (not (or (and (featurep 'xemacs) ; This is XEmacs

File diff suppressed because it is too large Load diff

View file

@ -1165,7 +1165,7 @@ IGNORE other arguments."
:button-prefix ""
:button-suffix ""
:button-face default
:format "%[%t%]\n"
:format "%[%t\n%]"
:help-echo ,(concat "Open " (cdr menu-element))
:action recentf-open-files-action
,(cdr menu-element))))

View file

@ -141,8 +141,7 @@ the function is called."
;; else
(setq pt (point))
(move-to-column endcol t)
(setcdr lines (cons (buffer-substring pt (point)) (cdr lines)))
(delete-region pt (point)))
(setcdr lines (cons (filter-buffer-substring pt (point) t) (cdr lines))))
))
;; ### NOTE: this is actually the only function that needs to do complicated
@ -233,12 +232,22 @@ When called from a program the rectangle's corners are START and END.
You might prefer to use `delete-extract-rectangle' from a program.
With a prefix (or a FILL) argument, also fill lines where nothing has to be
deleted."
(interactive "*r\nP")
(when buffer-read-only
(setq killed-rectangle (extract-rectangle start end))
(barf-if-buffer-read-only))
(setq killed-rectangle (delete-extract-rectangle start end fill)))
deleted.
If the buffer is read-only, Emacs will beep and refrain from deleting
the rectangle, but put it in the kill ring anyway. This means that
you can use this command to copy text from a read-only buffer.
\(If the variable `kill-read-only-ok' is non-nil, then this won't
even beep.)"
(interactive "r\nP")
(condition-case nil
(setq killed-rectangle (delete-extract-rectangle start end fill))
((buffer-read-only text-read-only)
(setq killed-rectangle (extract-rectangle start end))
(if kill-read-only-ok
(progn (message "Read only text copied to kill ring") nil)
(barf-if-buffer-read-only)
(signal 'text-read-only (list (current-buffer)))))))
;; this one is untouched --dv
;;;###autoload

View file

@ -56,6 +56,7 @@
(defgroup savehist nil
"Save minibuffer history."
:version "22.1"
:group 'minibuffer)
;;;###autoload
@ -91,6 +92,11 @@ minibuffer histories, such as `compile-command' or `kill-ring'."
:type '(repeat variable)
:group 'savehist)
(defcustom savehist-ignored-variables nil ;; '(command-history)
"*List of additional variables not to save."
:type '(repeat variable)
:group 'savehist)
(defcustom savehist-file
(cond
;; Backward compatibility with previous versions of savehist.
@ -371,9 +377,10 @@ trimming of history lists to `history-length' items."
(error nil))))))
(defun savehist-minibuffer-hook ()
;; XEmacs sets minibuffer-history-variable to t to mean "no history
;; is being recorded".
(unless (eq minibuffer-history-variable t)
(unless (or (eq minibuffer-history-variable t)
;; XEmacs sets minibuffer-history-variable to t to mean "no
;; history is being recorded".
(memq minibuffer-history-variable savehist-ignored-variables))
(add-to-list 'savehist-minibuffer-history-variables
minibuffer-history-variable)))

View file

@ -574,7 +574,7 @@ Otherwise, one argument `-i' is passed to the shell.
;;; 2. It cannot infallibly deal with command sequences, though it does well
;;; with these and with ignoring commands forked in another shell with ()s.
;;; 3. More generally, any complex command is going to throw it. Otherwise,
;;; you'd have to build an entire shell interpreter in emacs lisp. Failing
;;; you'd have to build an entire shell interpreter in Emacs Lisp. Failing
;;; that, there's no way to catch shell commands where cd's are buried
;;; inside conditional expressions, aliases, and so forth.
;;;
@ -608,7 +608,7 @@ It watches for cd, pushd and popd commands and sets the buffer's
default directory to track these commands.
You may toggle this tracking on and off with M-x dirtrack-mode.
If emacs gets confused, you can resync with the shell with M-x dirs.
If Emacs gets confused, you can resync with the shell with M-x dirs.
See variables `shell-cd-regexp', `shell-chdrive-regexp', `shell-pushd-regexp',
and `shell-popd-regexp', while `shell-pushd-tohome', `shell-pushd-dextract',
@ -929,7 +929,7 @@ See `shell-command-regexp'."
(defun shell-dynamic-complete-command ()
"Dynamically complete the command at point.
This function is similar to `comint-dynamic-complete-filename', except that it
searches `exec-path' (minus the trailing emacs library path) for completion
searches `exec-path' (minus the trailing Emacs library path) for completion
candidates. Note that this may not be the same as the shell's idea of the
path.

View file

@ -1038,7 +1038,10 @@ display the result of expression evaluation."
Value is also consed on to front of the variable `values'.
Optional argument EVAL-EXPRESSION-INSERT-VALUE, if non-nil, means
insert the result into the current buffer instead of printing it in
the echo area."
the echo area.
If `eval-expression-debug-on-error' is non-nil, which is the default,
this command arranges for all errors to enter the debugger."
(interactive
(list (read-from-minibuffer "Eval: "
nil read-expression-map t
@ -2317,7 +2320,7 @@ return value of `filter-buffer-substring'.
If this variable is nil, no filtering is performed.")
(defun filter-buffer-substring (beg end &optional delete)
(defun filter-buffer-substring (beg end &optional delete noprops)
"Return the buffer substring between BEG and END, after filtering.
The buffer substring is passed through each of the filter
functions in `buffer-substring-filters', and the value from the
@ -2327,21 +2330,36 @@ is nil, the buffer substring is returned unaltered.
If DELETE is non-nil, the text between BEG and END is deleted
from the buffer.
If NOPROPS is non-nil, final string returned does not include
text properties, while the string passed to the filters still
includes text properties from the buffer text.
Point is temporarily set to BEG before calling
`buffer-substring-filters', in case the functions need to know
where the text came from.
This function should be used instead of `buffer-substring' or
`delete-and-extract-region' when you want to allow filtering to
take place. For example, major or minor modes can use
`buffer-substring-filters' to extract characters that are special
to a buffer, and should not be copied into other buffers."
(save-excursion
(goto-char beg)
(let ((string (if delete (delete-and-extract-region beg end)
(buffer-substring beg end))))
(dolist (filter buffer-substring-filters string)
(setq string (funcall filter string))))))
This function should be used instead of `buffer-substring',
`buffer-substring-no-properties', or `delete-and-extract-region'
when you want to allow filtering to take place. For example,
major or minor modes can use `buffer-substring-filters' to
extract characters that are special to a buffer, and should not
be copied into other buffers."
(cond
((or delete buffer-substring-filters)
(save-excursion
(goto-char beg)
(let ((string (if delete (delete-and-extract-region beg end)
(buffer-substring beg end))))
(dolist (filter buffer-substring-filters)
(setq string (funcall filter string)))
(if noprops
(set-text-properties 0 (length string) nil string))
string)))
(noprops
(buffer-substring-no-properties beg end))
(t
(buffer-substring beg end))))
;;;; Window system cut and paste hooks.
@ -3731,7 +3749,7 @@ If point reaches the beginning or end of buffer, it stops there.
To ignore intangibility, bind `inhibit-point-motion-hooks' to t."
(interactive "p")
(or arg (setq arg 1))
(let ((orig (point)))
;; Move by lines, if ARG is not 1 (the default).

View file

@ -121,9 +121,6 @@ it defaults to `<', otherwise it defaults to `string<'."
(defun sort-build-lists (nextrecfun endrecfun startkeyfun endkeyfun)
(let ((sort-lists ())
(start-rec nil)
;; To avoid such functins as `end-of-line' being affected by
;; fields.
(inhibit-field-text-motion t)
done key)
;; Loop over sort records.
;(goto-char (point-min)) -- it is the caller's responsibility to
@ -205,7 +202,9 @@ the sort order."
(save-restriction
(narrow-to-region beg end)
(goto-char (point-min))
(sort-subr reverse 'forward-line 'end-of-line))))
(let ;; To make `end-of-line' and etc. to ignore fields.
((inhibit-field-text-motion t))
(sort-subr reverse 'forward-line 'end-of-line)))))
;;;###autoload
(defun sort-paragraphs (reverse beg end)
@ -271,25 +270,27 @@ With a negative arg, sorts by the ARGth field counted from the right.
Called from a program, there are three arguments:
FIELD, BEG and END. BEG and END specify region to sort."
(interactive "p\nr")
(sort-fields-1 field beg end
(lambda ()
(sort-skip-fields field)
(let* ((case-fold-search t)
(base
(if (looking-at "\\(0x\\)[0-9a-f]\\|\\(0\\)[0-7]")
(cond ((match-beginning 1)
(goto-char (match-end 1))
16)
((match-beginning 2)
(goto-char (match-end 2))
8)
(t nil)))))
(string-to-number (buffer-substring (point)
(save-excursion
(forward-sexp 1)
(point)))
(or base sort-numeric-base))))
nil))
(let ;; To make `end-of-line' and etc. to ignore fields.
((inhibit-field-text-motion t))
(sort-fields-1 field beg end
(lambda ()
(sort-skip-fields field)
(let* ((case-fold-search t)
(base
(if (looking-at "\\(0x\\)[0-9a-f]\\|\\(0\\)[0-7]")
(cond ((match-beginning 1)
(goto-char (match-end 1))
16)
((match-beginning 2)
(goto-char (match-end 2))
8)
(t nil)))))
(string-to-number (buffer-substring (point)
(save-excursion
(forward-sexp 1)
(point)))
(or base sort-numeric-base))))
nil)))
;;;;;###autoload
;;(defun sort-float-fields (field beg end)
@ -322,11 +323,13 @@ FIELD, BEG and END. BEG and END specify region to sort.
The variable `sort-fold-case' determines whether alphabetic case affects
the sort order."
(interactive "p\nr")
(sort-fields-1 field beg end
(function (lambda ()
(sort-skip-fields field)
nil))
(function (lambda () (skip-chars-forward "^ \t\n")))))
(let ;; To make `end-of-line' and etc. to ignore fields.
((inhibit-field-text-motion t))
(sort-fields-1 field beg end
(function (lambda ()
(sort-skip-fields field)
nil))
(function (lambda () (skip-chars-forward "^ \t\n"))))))
(defun sort-fields-1 (field beg end startkeyfun endkeyfun)
(let ((tbl (syntax-table)))
@ -471,7 +474,9 @@ it uses the `sort' utility program, which doesn't understand tabs.
Use \\[untabify] to convert tabs to spaces before sorting."
(interactive "P\nr")
(save-excursion
(let (beg1 end1 col-beg1 col-end1 col-start col-end)
(let ;; To make `end-of-line' and etc. to ignore fields.
((inhibit-field-text-motion t)
beg1 end1 col-beg1 col-end1 col-start col-end)
(goto-char (min beg end))
(setq col-beg1 (current-column))
(beginning-of-line)

View file

@ -503,7 +503,7 @@ hierarchy would be replaced with the new directory."
:type 'hook)
(defcustom speedbar-after-create-hook '(speedbar-frame-reposition-smartly)
"*Hooks called before popping up the speedbar frame."
"*Hooks called after popping up the speedbar frame."
:group 'speedbar
:type 'hook)

View file

@ -1327,6 +1327,7 @@ mouse."
(fancy-splash-outer-buffer (current-buffer))
splash-buffer
(old-minor-mode-map-alist minor-mode-map-alist)
(old-emulation-mode-map-alists emulation-mode-map-alists)
(frame (fancy-splash-frame))
timer)
(save-selected-window
@ -1350,6 +1351,7 @@ mouse."
(setq cursor-type nil
display-hourglass nil
minor-mode-map-alist nil
emulation-mode-map-alists nil
buffer-undo-list t
mode-line-format (propertize "---- %b %-"
'face '(:weight bold))
@ -1361,7 +1363,8 @@ mouse."
(recursive-edit))
(cancel-timer timer)
(setq display-hourglass old-hourglass
minor-mode-map-alist old-minor-mode-map-alist)
minor-mode-map-alist old-minor-mode-map-alist
emulation-mode-map-alists old-emulation-mode-map-alists)
(kill-buffer splash-buffer)
(when (frame-live-p frame)
(select-frame frame)
@ -1401,30 +1404,31 @@ we put it on this frame."
(let ((prev-buffer (current-buffer)))
(unwind-protect
(with-current-buffer (get-buffer-create "GNU Emacs")
(setq mode-line-format (propertize "---- %b %-"
'face '(:weight bold)))
(let ((tab-width 8))
(if pure-space-overflow
(insert "Warning Warning Pure space overflow Warning Warning\n"))
(set (make-local-variable 'tab-width) 8)
(set (make-local-variable 'mode-line-format)
(propertize "---- %b %-" 'face '(:weight bold)))
;; The convention for this piece of code is that
;; each piece of output starts with one or two newlines
;; and does not end with any newlines.
(insert "Welcome to GNU Emacs")
(insert
(if (eq system-type 'gnu/linux)
", one component of the GNU/Linux operating system.\n"
", a part of the GNU operating system.\n"))
(if pure-space-overflow
(insert "Warning Warning Pure space overflow Warning Warning\n"))
(unless (equal (buffer-name prev-buffer) "*scratch*")
(insert (substitute-command-keys
"\nType \\[recenter] to begin editing your file.\n")))
;; The convention for this piece of code is that
;; each piece of output starts with one or two newlines
;; and does not end with any newlines.
(insert "Welcome to GNU Emacs")
(insert
(if (eq system-type 'gnu/linux)
", one component of the GNU/Linux operating system.\n"
", a part of the GNU operating system.\n"))
(if (display-mouse-p)
;; The user can use the mouse to activate menus
;; so give help in terms of menu items.
(progn
(insert "\
(unless (equal (buffer-name prev-buffer) "*scratch*")
(insert (substitute-command-keys
"\nType \\[recenter] to begin editing your file.\n")))
(if (display-mouse-p)
;; The user can use the mouse to activate menus
;; so give help in terms of menu items.
(progn
(insert "\
You can do basic editing with the menu bar and scroll bar using the mouse.
Useful File menu items:
@ -1440,103 +1444,103 @@ Copying Conditions Conditions for redistributing and changing Emacs
Getting New Versions How to obtain the latest version of Emacs
More Manuals / Ordering Manuals How to order printed manuals from the FSF
")
(insert "\n\n" (emacs-version)
"
(insert "\n\n" (emacs-version)
"
Copyright (C) 2006 Free Software Foundation, Inc."))
;; No mouse menus, so give help using kbd commands.
;; No mouse menus, so give help using kbd commands.
;; If keys have their default meanings,
;; use precomputed string to save lots of time.
(if (and (eq (key-binding "\C-h") 'help-command)
(eq (key-binding "\C-xu") 'advertised-undo)
(eq (key-binding "\C-x\C-c") 'save-buffers-kill-terminal)
(eq (key-binding "\C-ht") 'help-with-tutorial)
(eq (key-binding "\C-hi") 'info)
(eq (key-binding "\C-hr") 'info-emacs-manual)
(eq (key-binding "\C-h\C-n") 'view-emacs-news))
(insert "
;; If keys have their default meanings,
;; use precomputed string to save lots of time.
(if (and (eq (key-binding "\C-h") 'help-command)
(eq (key-binding "\C-xu") 'advertised-undo)
(eq (key-binding "\C-x\C-c") 'save-buffers-kill-terminal)
(eq (key-binding "\C-ht") 'help-with-tutorial)
(eq (key-binding "\C-hi") 'info)
(eq (key-binding "\C-hr") 'info-emacs-manual)
(eq (key-binding "\C-h\C-n") 'view-emacs-news))
(insert "
Get help C-h (Hold down CTRL and press h)
Emacs manual C-h r
Emacs tutorial C-h t Undo changes C-x u
Buy manuals C-h C-m Exit Emacs C-x C-c
Browse manuals C-h i")
(insert (substitute-command-keys
(format "\n
(insert (substitute-command-keys
(format "\n
Get help %s
Emacs manual \\[info-emacs-manual]
Emacs tutorial \\[help-with-tutorial]\tUndo changes\t\\[advertised-undo]
Buy manuals \\[view-order-manuals]\tExit Emacs\t\\[save-buffers-kill-terminal]
Browse manuals \\[info]"
(let ((where (where-is-internal
'help-command nil t)))
(if where
(key-description where)
"M-x help"))))))
(let ((where (where-is-internal
'help-command nil t)))
(if where
(key-description where)
"M-x help"))))))
;; Say how to use the menu bar with the keyboard.
(if (and (eq (key-binding "\M-`") 'tmm-menubar)
(eq (key-binding [f10]) 'tmm-menubar))
(insert "
;; Say how to use the menu bar with the keyboard.
(if (and (eq (key-binding "\M-`") 'tmm-menubar)
(eq (key-binding [f10]) 'tmm-menubar))
(insert "
Activate menubar F10 or ESC ` or M-`")
(insert (substitute-command-keys "
(insert (substitute-command-keys "
Activate menubar \\[tmm-menubar]")))
;; Many users seem to have problems with these.
(insert "
;; Many users seem to have problems with these.
(insert "
\(`C-' means use the CTRL key. `M-' means use the Meta (or Alt) key.
If you have no Meta key, you may instead type ESC followed by the character.)")
(insert "\n\n" (emacs-version)
"
(insert "\n\n" (emacs-version)
"
Copyright (C) 2006 Free Software Foundation, Inc.")
(if (and (eq (key-binding "\C-h\C-c") 'describe-copying)
(eq (key-binding "\C-h\C-d") 'describe-distribution)
(eq (key-binding "\C-h\C-w") 'describe-no-warranty))
(insert
"\n
(if (and (eq (key-binding "\C-h\C-c") 'describe-copying)
(eq (key-binding "\C-h\C-d") 'describe-distribution)
(eq (key-binding "\C-h\C-w") 'describe-no-warranty))
(insert
"\n
GNU Emacs comes with ABSOLUTELY NO WARRANTY; type C-h C-w for full details.
Emacs is Free Software--Free as in Freedom--so you can redistribute copies
of Emacs and modify it; type C-h C-c to see the conditions.
Type C-h C-d for information on getting the latest version.")
(insert (substitute-command-keys
"\n
(insert (substitute-command-keys
"\n
GNU Emacs comes with ABSOLUTELY NO WARRANTY; type \\[describe-no-warranty] for full details.
Emacs is Free Software--Free as in Freedom--so you can redistribute copies
of Emacs and modify it; type \\[describe-copying] to see the conditions.
Type \\[describe-distribution] for information on getting the latest version."))))
;; The rest of the startup screen is the same on all
;; kinds of terminals.
;; The rest of the startup screen is the same on all
;; kinds of terminals.
;; Give information on recovering, if there was a crash.
(and auto-save-list-file-prefix
;; Don't signal an error if the
;; directory for auto-save-list files
;; does not yet exist.
(file-directory-p (file-name-directory
auto-save-list-file-prefix))
(directory-files
(file-name-directory auto-save-list-file-prefix)
nil
(concat "\\`"
(regexp-quote (file-name-nondirectory
auto-save-list-file-prefix)))
t)
(insert "\n\nIf an Emacs session crashed recently, "
"type M-x recover-session RET\nto recover"
" the files you were editing."))
;; Give information on recovering, if there was a crash.
(and auto-save-list-file-prefix
;; Don't signal an error if the
;; directory for auto-save-list files
;; does not yet exist.
(file-directory-p (file-name-directory
auto-save-list-file-prefix))
(directory-files
(file-name-directory auto-save-list-file-prefix)
nil
(concat "\\`"
(regexp-quote (file-name-nondirectory
auto-save-list-file-prefix)))
t)
(insert "\n\nIf an Emacs session crashed recently, "
"type M-x recover-session RET\nto recover"
" the files you were editing."))
;; Display the input that we set up in the buffer.
(set-buffer-modified-p nil)
(goto-char (point-min))
(save-window-excursion
(switch-to-buffer (current-buffer))
(sit-for 120))))
;; Unwind ... ensure splash buffer is killed
(kill-buffer "GNU Emacs"))))
;; Display the input that we set up in the buffer.
(set-buffer-modified-p nil)
(goto-char (point-min))
(save-window-excursion
(switch-to-buffer (current-buffer))
(sit-for 120))))
;; Unwind ... ensure splash buffer is killed
(kill-buffer "GNU Emacs"))))
(defun startup-echo-area-message ()

View file

@ -1916,6 +1916,12 @@ a system-dependent default device name is used."
"\\" (substring argument end (1+ end)))
start (1+ end)))
(concat result (substring argument start)))))))
(defun string-or-null-p (object)
"Return t if OBJECT is a string or nil.
Otherwise, return nil."
(or (stringp object) (null object)))
;;;; Support for yanking and text properties.

View file

@ -2856,25 +2856,45 @@ is non-nil."
(bibtex-autofill-entry))
(run-hooks 'bibtex-add-entry-hook)))
(defun bibtex-entry-update ()
(defun bibtex-entry-update (&optional entry-type)
"Update an existing BibTeX entry.
In the BibTeX entry at point, make new fields for those items that may occur
according to `bibtex-field-list', but are not yet present."
(interactive)
according to `bibtex-field-list', but are not yet present.
Also, add field delimiters to numerical fields if they are not present.
If ENTRY-TYPE is non-nil, change first the entry type to ENTRY-TYPE.
When called interactively with a prefix arg, query for a value of ENTRY-TYPE."
(interactive
(list (if current-prefix-arg
(let ((completion-ignore-case t))
(completing-read "New entry type: " bibtex-entry-field-alist
nil t nil 'bibtex-entry-type-history)))))
(save-excursion
(bibtex-beginning-of-entry)
;; For inserting new fields, we use the fact that
;; `bibtex-parse-entry' moves point to the end of the last field.
(let* ((fields-alist (bibtex-parse-entry))
(field-list (bibtex-field-list
(cdr (assoc "=type=" fields-alist)))))
(skip-chars-backward " \t\n")
(dolist (field (car field-list))
(unless (assoc-string (car field) fields-alist t)
(bibtex-make-field field)))
(dolist (field (cdr field-list))
(unless (assoc-string (car field) fields-alist t)
(bibtex-make-optional-field field))))))
(when (looking-at bibtex-entry-maybe-empty-head)
(goto-char (match-end 0))
(if entry-type
(save-excursion
(replace-match (concat "@" entry-type) nil nil nil 1))
(setq entry-type (bibtex-type-in-head)))
(let* ((field-list (bibtex-field-list entry-type))
(required (copy-tree (car field-list)))
(optional (copy-tree (cdr field-list)))
bounds)
(while (setq bounds (bibtex-parse-field))
(let ((fname (bibtex-name-in-field bounds t))
(end (copy-marker (bibtex-end-of-field bounds) t)))
(setq required (delete (assoc-string fname required t) required)
optional (delete (assoc-string fname optional t) optional))
(when (string-match "\\`[0-9]+\\'"
(bibtex-text-in-field-bounds bounds))
(goto-char (bibtex-end-of-text-in-field bounds))
(insert (bibtex-field-right-delimiter))
(goto-char (bibtex-start-of-text-in-field bounds))
(insert (bibtex-field-left-delimiter)))
(goto-char end)))
(skip-chars-backward " \t\n")
(dolist (field required) (bibtex-make-field field))
(dolist (field optional) (bibtex-make-optional-field field))))))
(defun bibtex-parse-entry (&optional content)
"Parse entry at point, return an alist.
@ -3613,17 +3633,20 @@ interactive calls."
(defun bibtex-find-text-internal (&optional noerror subfield comma)
"Find text part of current BibTeX field or entry head.
Return list (NAME START-TEXT END-TEXT END) with field or entry name,
start and end of text and end of field or entry head, or nil if not found.
If optional arg NOERROR is non-nil, an error message is suppressed if text
is not found. If optional arg SUBFIELD is non-nil START-TEXT and END-TEXT
correspond to the current subfield delimited by #.
Return list (NAME START-TEXT END-TEXT END STRING-CONST) with field
or entry name, start and end of text, and end of field or entry head.
STRING-CONST is a flag which is non-nil if current subfield delimited by #
is a BibTeX string constant. Return value is nil if field or entry head
are not found.
If optional arg NOERROR is non-nil, an error message is suppressed
if text is not found. If optional arg SUBFIELD is non-nil START-TEXT
and END-TEXT correspond to the current subfield delimited by #.
Optional arg COMMA is as in `bibtex-enclosing-field'."
(save-excursion
(let ((pnt (point))
(bounds (bibtex-enclosing-field comma t))
(case-fold-search t)
name start-text end-text end failure done no-sub)
name start-text end-text end failure done no-sub string-const)
(bibtex-beginning-of-entry)
(cond (bounds
(setq name (bibtex-name-in-field bounds t)
@ -3667,9 +3690,11 @@ Optional arg COMMA is as in `bibtex-enclosing-field'."
(goto-char start-text)
(while (not done)
(if (or (prog1 (looking-at bibtex-field-const)
(setq end-text (match-end 0)))
(setq end-text (match-end 0)
string-const t))
(prog1 (setq bounds (bibtex-parse-field-string))
(setq end-text (cdr bounds))))
(setq end-text (cdr bounds)
string-const nil)))
(progn
(if (and (<= start-text pnt) (<= pnt end-text))
(setq done t)
@ -3678,7 +3703,7 @@ Optional arg COMMA is as in `bibtex-enclosing-field'."
(setq start-text (goto-char (match-end 0)))))
(setq done t failure t)))))
(cond ((not failure)
(list name start-text end-text end))
(list name start-text end-text end string-const))
((and no-sub (not noerror))
(error "Not on text part of BibTeX field"))
((not noerror) (error "Not on BibTeX field"))))))
@ -3712,13 +3737,10 @@ is as in `bibtex-enclosing-field'. It is t for interactive calls."
Optional arg COMMA is as in `bibtex-enclosing-field'. It is t for
interactive calls."
(interactive (list t))
(let* ((bounds (bibtex-find-text-internal nil t comma))
(start (nth 1 bounds))
(end (nth 2 bounds)))
(if (memq (char-before end) '(?\} ?\"))
(delete-region (1- end) end))
(if (memq (char-after start) '(?\{ ?\"))
(delete-region start (1+ start)))))
(let ((bounds (bibtex-find-text-internal nil t comma)))
(unless (nth 4 bounds)
(delete-region (1- (nth 2 bounds)) (nth 2 bounds))
(delete-region (nth 1 bounds) (1+ (nth 1 bounds))))))
(defun bibtex-kill-field (&optional copy-only comma)
"Kill the entire enclosing BibTeX field.

View file

@ -48,6 +48,7 @@ A value of nil means that any change in indentation starts a new paragraph."
"*Non-nil means put two spaces after a colon when filling."
:type 'boolean
:group 'fill)
;;;###autoload(put 'colon-double-space 'safe-local-variable t)
(defvar fill-paragraph-function nil
"Mode-specific function to fill a paragraph, or nil if there is none.

View file

@ -267,6 +267,7 @@ Warning! Not checking comments, when a comment start is embedded in strings,
may produce undesired results."
:type '(choice (const exclusive) (const :tag "off" nil) (const :tag "on" t))
:group 'ispell)
;;;###autoload(put 'ispell-check-comments 'safe-local-variable (lambda (a) (memq a '(nil t exclusive))))
(defcustom ispell-query-replace-choices nil
"*Corrections made throughout region when non-nil.
@ -461,6 +462,7 @@ is automatically set when defined in the file with either
:type '(choice string
(const :tag "default" nil))
:group 'ispell)
;;;###autoload(put 'ispell-local-dictionary 'safe-local-variable 'string-or-null-p)
(make-variable-buffer-local 'ispell-local-dictionary)

View file

@ -98,6 +98,7 @@ If the variable `use-hard-newlines' is non-nil, then only lines following a
hard newline are considered to match."
:group 'paragraphs
:type 'regexp)
;;;###autoload(put 'paragraph-start 'safe-local-variable 'stringp)
;; paragraph-start requires a hard newline, but paragraph-separate does not:
;; It is assumed that paragraph-separate is distinctive enough to be believed
@ -115,6 +116,7 @@ ensures that the paragraph functions will work equally within a region of
text indented by a margin setting."
:group 'paragraphs
:type 'regexp)
;;;###autoload(put 'paragraph-separate 'safe-local-variable 'stringp)
(defcustom sentence-end-double-space t
"*Non-nil means a single space does not end a sentence.
@ -126,6 +128,7 @@ regexp describing the end of a sentence, when the value of the variable
`sentence-end' is nil. See Info node `(elisp)Standard Regexps'."
:type 'boolean
:group 'fill)
;;;###autoload(put 'sentence-end-double-space 'safe-local-variable t)
(defcustom sentence-end-without-period nil
"*Non-nil means a sentence will end without a period.
@ -137,6 +140,7 @@ regexp describing the end of a sentence, when the value of the variable
`sentence-end' is nil. See Info node `(elisp)Standard Regexps'."
:type 'boolean
:group 'fill)
;;;###autoload(put 'sentence-end-without-period 'safe-local-variable t)
(defcustom sentence-end-without-space
"$B!#!%!)!*$A!##.#?#!$(0!$!%!)!*$(G!$!%!)!*(B"
@ -147,6 +151,7 @@ regexp describing the end of a sentence, when the value of the variable
`sentence-end' is nil. See Info node `(elisp)Standard Regexps'."
:group 'paragraphs
:type 'string)
;;;###autoload(put 'sentence-end-without-space 'safe-local-variable t)
(defcustom sentence-end nil
"*Regexp describing the end of a sentence.
@ -158,12 +163,14 @@ function `sentence-end'. You should always use this function
to obtain the value of this variable."
:group 'paragraphs
:type '(choice regexp (const :tag "Use default value" nil)))
;;;###autoload(put 'sentence-end 'safe-local-variable 'string-or-null-p)
(defcustom sentence-end-base "[.?!][]\"'$B!I$,1r}(B)}]*"
"*Regexp matching the basic end of a sentence, not including following space."
:group 'paragraphs
:type 'string
:version "22.1")
;;;###autoload(put 'sentence-end-base 'safe-local-variable 'stringp)
(defun sentence-end ()
"Return the regexp describing the end of a sentence.
@ -191,12 +198,14 @@ in between. See Info node `(elisp)Standard Regexps'."
"*Regexp describing line-beginnings that separate pages."
:group 'paragraphs
:type 'regexp)
;;;###autoload(put 'page-delimiter 'safe-local-variable t)
(defcustom paragraph-ignore-fill-prefix nil
"*Non-nil means the paragraph commands are not affected by `fill-prefix'.
This is desirable in modes where blank lines are the paragraph delimiters."
:group 'paragraphs
:type 'boolean)
;;;###autoload(put 'paragraph-ignore-fill-prefix 'safe-local-variable t)
(defun forward-paragraph (&optional arg)
"Move forward to end of paragraph.

View file

@ -758,8 +758,9 @@ they are not defaultly assigned to keys."
(defun picture-mode-exit (&optional nostrip)
"Undo `picture-mode' and return to previous major mode.
With no argument strips whitespace from end of every line in Picture buffer
otherwise just return to previous mode."
With no argument, strip whitespace from end of every line in Picture buffer;
otherwise, just return to previous mode.
Runs `picture-mode-exit-hook' at the end."
(interactive "P")
(if (not (eq major-mode 'picture-mode))
(error "You aren't editing a Picture")
@ -769,7 +770,8 @@ With no argument strips whitespace from end of every line in Picture buffer
(setq major-mode picture-mode-old-major-mode)
(kill-local-variable 'tab-stop-list)
(setq truncate-lines picture-mode-old-truncate-lines)
(force-mode-line-update)))
(force-mode-line-update)
(run-hooks 'picture-mode-exit-hook)))
(provide 'picture)

View file

@ -948,6 +948,7 @@ Instead of nil or t, this may also be a string of type letters indicating
the label types for which it should be true."
:group 'reftex-referencing-labels
:type `(choice :tag "\\vref is default macro" ,@reftex-tmp))
;;;###autoload(put 'reftex-vref-is-default 'safe-local-variable t)
(defcustom reftex-fref-is-default nil
"*Non-nil means, the fancyref macro \\fref is used as default.
@ -958,11 +959,13 @@ Instead of nil or t, this may also be a string of type letters indicating
the label types for which it should be true."
:group 'reftex-referencing-labels
:type `(choice :tag "\\fref is default macro" ,@reftex-tmp))
;;;###autoload(put 'reftex-fref-is-default 'safe-local-variable t)
(defcustom reftex-level-indent 2
"*Number of spaces to be used for indentation per section level."
:group 'reftex-referencing-labels
:type 'integer)
;;;###autoload(put 'reftex-level-indent 'safe-local-variable 'integerp)
(defcustom reftex-guess-label-type t
"*Non-nil means, `reftex-reference' will try to guess the label type.
@ -972,6 +975,7 @@ immediately offer the correct label menu - otherwise it will prompt you for
a label type. If you set this variable to nil, RefTeX will always prompt."
:group 'reftex-referencing-labels
:type 'boolean)
;;;###autoload(put 'reftex-guess-label-type 'safe-local-variable t)
(defcustom reftex-format-ref-function nil
"Function which produces the string to insert as a reference.

View file

@ -381,7 +381,7 @@
;; code fragments, general interest, etc.:
;; Jari Aalto <jari.aalto@cs.tpu.fi>
;; Dean Andrews <dean@dra.com>
;; Juanma Barranquero <barranquero@laley-actualidad.es>
;; Juanma Barranquero <lekktu@gmail.com>
;; Karl Berry <kb@cs.umb.edu>
;; Jim Chapman <jchapman@netcomuk.co.uk>
;; Kin Cho <kin@neoscale.com>
@ -426,9 +426,15 @@
(require 'man)
(require 'button)
(define-button-type 'WoMan-xref-man-page
(define-button-type 'WoMan-xref-man-page
:supertype 'Man-abstract-xref-man-page
'func 'woman)
'func (lambda (arg)
(woman
;; `woman' cannot deal with arguments that contain a
;; section name, like close(2), so strip the section name.
(if (string-match Man-reference-regexp arg)
(substring arg 0 (match-end 1))
arg))))
(eval-when-compile ; to avoid compiler warnings
(require 'dired)

View file

@ -1,3 +1,22 @@
2006-04-10 Kim F. Storm <storm@cua.dk>
* text.texi (Buffer Contents): Add NOPROPS arg to
filter-buffer-substring.
2006-04-08 Kevin Ryde <user42@zip.com.au>
* os.texi (Command-Line Arguments): Update xref to emacs manual
"Command Arguments" -> "Emacs Invocation", per change there.
2006-04-08 Thien-Thi Nguyen <ttn@gnu.org>
* display.texi (Other Display Specs): Arrange a @code{DOTTED-LIST} to
be on one line to help makeinfo not render two spaces after the dot.
2006-04-07 Reiner Steib <Reiner.Steib@gmx.de>
* strings.texi (Predicates for Strings): Add string-or-null-p.
2006-03-28 Kim F. Storm <storm@cua.dk>
* processes.texi (Accepting Output): Remove obsolete (and incorrect)

View file

@ -3500,9 +3500,13 @@ not affect the amount of raising or lowering, which is based on the
faces used for the text.
@end table
@c We put all the `@code{(when ...)}' on one line to encourage
@c makeinfo's end-of-sentence heuristics to DTRT. Previously, the dot
@c was at eol; the info file ended up w/ two spaces rendered after it.
You can make any display specification conditional. To do that,
package it in another list of the form @code{(when @var{condition} .
@var{spec})}. Then the specification @var{spec} applies only when
package it in another list of the form
@code{(when @var{condition} . @var{spec})}.
Then the specification @var{spec} applies only when
@var{condition} evaluates to a non-@code{nil} value. During the
evaluation, @code{object} is bound to the string or buffer having the
conditional @code{display} property. @code{position} and

View file

@ -404,8 +404,9 @@ remaining command-line arguments in the variable
arguments is in @code{command-line-args}.)
The command-line arguments are parsed by the @code{command-line-1}
function in the @file{startup.el} file. See also @ref{Command
Arguments, , Command Line Arguments, emacs, The GNU Emacs Manual}.
function in the @file{startup.el} file. See also @ref{Emacs
Invocation, , Command Line Arguments for Emacs Invocation, emacs, The
GNU Emacs Manual}.
@end defvar
@defvar command-line-args

View file

@ -102,6 +102,11 @@ This function returns @code{t} if @var{object} is a string, @code{nil}
otherwise.
@end defun
@defun string-or-null-p object
This function returns @code{t} if @var{object} is a string or nil,
@code{nil} otherwise.
@end defun
@defun char-or-string-p object
This function returns @code{t} if @var{object} is a string or a
character (i.e., an integer), @code{nil} otherwise.

View file

@ -205,7 +205,7 @@ This is like @code{buffer-substring}, except that it does not copy text
properties, just the characters themselves. @xref{Text Properties}.
@end defun
@defun filter-buffer-substring start end &optional delete
@defun filter-buffer-substring start end &optional delete noprops
This function passes the buffer text between @var{start} and @var{end}
through the filter functions specified by the variable
@code{buffer-substring-filters}, and returns the value from the last
@ -217,7 +217,12 @@ If @var{delete} is non-@code{nil}, this function deletes the text
between @var{start} and @var{end} after copying it, like
@code{delete-and-extract-region}.
Lisp code should use this function instead of @code{buffer-substring}
If @var{noprops} is non-@code{nil}, the final string returned does not
include text properties, while the string passed through the filters
still includes text properties from the buffer text.
Lisp code should use this function instead of @code{buffer-substring},
@code{buffer-substring-no-properties},
or @code{delete-and-extract-region} when copying into user-accessible
data structures such as the kill-ring, X clipboard, and registers.
Major and minor modes can add functions to

View file

@ -1,3 +1,138 @@
2006-04-09 Kevin Ryde <user42@zip.com.au>
* org.texi (Formula syntax): Typo in node name of calc-eval xref.
* sending.texi (Mail Sending): In send-mail-function @pxref smtpmail,
put info and printed manual names the right way around.
2006-04-09 Karl Berry <karl@gnu.org>
* msdog.texi, emacs-xtra.texi: move all the MS-DOS material to
emacs-xtra.texi, leaving only MS Windows information.
* building.texi, emacs.texi, frames.texi, gnu.texi, macos.texi,
msdog.texi, mule.texi, trouble.texi: change cross-references and
node names.
* emacs.texi: move @summarycontents and @contents to the beginning
of the file.
2006-04-07 Reiner Steib <Reiner.Steib@gmx.de>
* gnus.texi (Summary Buffer Lines): Add `*'.
2006-04-07 Jochen K,A|(Bpper <jochen@fhi-berlin.mpg.de>
* gnus.texi (Group Parameters): Mention
gnus-permanently-visible-groups.
2006-04-06 Katsumi Yamaoka <yamaoka@jpl.org>
* gnus.texi (Face): Fix typo.
2006-04-05 Reiner Steib <Reiner.Steib@gmx.de>
* gnus.texi (X-Face): Clarify.
(Face): Need Emacs with PNG support.
2006-04-08 Kevin Ryde <user42@zip.com.au>
* text.texi (Fill Commands): fill-nobreak-predicate is now a hook.
2006-04-07 Richard Stallman <rms@gnu.org>
* programs.texi (Comments, Comment Commands, Options for Comments)
(Multi-Line Comments): "Align", not "indent".
(Basic Indent): C-j deletes trailing whitespace before the newline.
2006-04-06 Richard Stallman <rms@gnu.org>
* idlwave.texi: Delete the blocks "not suitable for inclusion with
Emacs".
* programs.texi (Basic Indent): Clarify relationship of C-j to TAB.
2006-04-06 Eli Zaretskii <eliz@gnu.org>
* killing.texi (Rectangles): Add index entry for marking a
rectangle.
2006-04-06 J.D. Smith <jdsmith@as.arizona.edu>
* idlwave.texi: Updated for IDLWAVE version 6.0, factoring out
blocks not suitable for inclusion with Emacs using variable
PARTOFEMACS.
2006-04-05 Richard Stallman <rms@gnu.org>
* emacs.texi (Top): Update subnode menu.
* trouble.texi (Unasked-for Search): Node deleted.
(Lossage): Delete from menu.
2006-04-04 Richard Stallman <rms@gnu.org>
* trouble.texi: Various cleanups.
(Checklist): Don't bother saying how to snail a bug report.
(Emergency Escape): Much rewriting.
(After a Crash): Rename the core dump immediately.
(Total Frustration): Call it a psychotherapist.
(Bug Criteria): Avoid "illegal instruction".
(Sending Patches): We always put the contributor's name in.
* misc.texi (Thumbnails): Minor correction.
2006-04-04 Simon Josefsson <jas@extundo.com>
* gnus.texi (Security): Improve.
2006-04-03 Richard Stallman <rms@gnu.org>
* misc.texi (Thumbnails): Minor cleanup.
2006-04-02 Karl Berry <karl@gnu.org>
* sending.texi (Mail Sending): pxref to Top needs five args.
* texinfo.tex: update to current version (2006-03-21.13).
2006-04-02 Bill Wohler <wohler@newt.com>
* mh-e.texi (Getting Started, Junk, Bug Reports)
(MH FAQ and Support): Fix URLs.
2006-03-31 Romain Francoise <romain@orebokech.com>
* gnus.texi (Virtual Groups): `nnvirtual-always-rescan' defaults
to t, not nil (and has for the past eight years).
2006-03-31 Richard Stallman <rms@gnu.org>
* emacs.texi (Top): Update subnode menu.
* help.texi (Help Mode): Cleanup.
* dired.texi: Many cleanups.
(Dired Deletion): Describe dired-recursive-deletes.
(Operating on Files): dired-create-directory moved.
(Misc Dired Features): Moved to here.
(Tumme): Node moved to misc.texi.
* custom.texi: Many cleanups.
(Minor Modes): Don't mention ISO Accents Mode.
(Examining): Update C-h v output example.
(Hooks): Add index and xref for add-hook.
(Locals): Delete list of vars that are always per-buffer. Rearrange.
(Local Keymaps): Don't mention lisp-mode-map, c-mode-map.
* misc.texi: Many cleanups.
(beginning): Add to summary of topics.
(Shell): Put eshell xref at the end. Remove eshell from table.
(Thumbnails): New node.
2006-03-31 Reiner Steib <Reiner.Steib@gmx.de>
* message.texi, gnus.texi: Bump version to 5.11.
2006-03-29 Reiner Steib <Reiner.Steib@gmx.de>
* gnus.texi (Top): Add comment about version line.
@ -131,6 +266,10 @@
* org.texi (Clean view): Document new startup options.
2006-03-12 Richard Stallman <rms@gnu.org>
* calendar.texi: Various cleanups.
2006-03-11 Bill Wohler <wohler@newt.com>
* mh-e.texi (Preface, More About MH-E, Options, HTML, Folders)

View file

@ -323,7 +323,7 @@ method to conditionalize them.
subprocesses; to work around this lack, @kbd{M-x compile} runs the
compilation command synchronously on MS-DOS. As a consequence, you must
wait until the command finishes before you can do anything else in
Emacs. @xref{MS-DOS}.
Emacs. @xref{MS-DOS,,,emacs-xtra,Specialized Emacs Features}.
@node Grep Searching
@section Searching with Grep under Emacs

View file

@ -7,7 +7,7 @@
@cindex customization
This chapter talks about various topics relevant to adapting the
behavior of Emacs in minor ways.
behavior of Emacs in ways we have anticipated.
@iftex
See @cite{The Emacs Lisp Reference Manual}
@end iftex
@ -15,14 +15,14 @@ See @cite{The Emacs Lisp Reference Manual}
@xref{Top, Emacs Lisp, Emacs Lisp, elisp, The Emacs Lisp
Reference Manual},
@end ifnottex
for how to make more far-reaching changes. @xref{X Resources},
for information on using X resources to customize Emacs.
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
@file{.emacs} or @file{.Xdefaults} that will affect future sessions.
@xref{Init File}. In the customization buffer, when you save
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.
@ -55,17 +55,19 @@ replay sequences of keys.
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 on; for example, @samp{Fill} in the mode line means
that Auto Fill mode is on.
line when they are enabled; for example, @samp{Fill} in the mode line means
that Auto Fill mode is enabled.
Append @code{-mode} to the name of a minor mode to get the name of a
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 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.
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
@ -94,8 +96,8 @@ 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, ISO Accents
mode, Outline minor mode, Overwrite mode, and Binary Overwrite mode.
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
@ -105,9 +107,8 @@ mode}. @xref{Abbrevs}, for full information.
explicitly. Emacs inserts newlines as necessary to prevent lines from
becoming too long. @xref{Filling}.
Auto Save mode causes the contents of a buffer to be saved
periodically to reduce the amount of work you can lose in case of a
system crash. @xref{Auto Save}.
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}.
@ -115,16 +116,18 @@ system crash. @xref{Auto Save}.
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 graphical display that can show multiple fonts.
@xref{Faces}.
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
@ -286,15 +289,15 @@ 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
@samp{[+]}. When the group contents are visible, this button changes to
@samp{[-]}; invoking that hides the group contents.
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 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}.
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.
@ -343,6 +346,8 @@ value:
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
@ -415,8 +420,8 @@ 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 association, another at the beginning and another
at the end, so you can add the new association at any position in the
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)}
@ -469,7 +474,7 @@ and then reset it, which discards the customized value,
you can get the customized value back again with this operation.
@end table
@cindex comments on customized options
@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
@ -494,13 +499,17 @@ buffer according to the setting of the option
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 not visible in the buffer.
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
The customization buffer normally saves customizations in
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
@ -511,8 +520,8 @@ file by calling @code{load}. For example:
(load custom-file)
@end example
You can also use @code{custom-file} to specify different
customization files for different Emacs versions, like this:
You can use @code{custom-file} to specify different customization
files for different Emacs versions, like this:
@example
(cond ((< emacs-major-version 21)
@ -650,9 +659,9 @@ 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 variables, faces, and other groups, all appear
as well (even if not already loaded). However, the subgroups' own
contents are not included.
group, including settings (variables 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
To control more precisely what to customize, you can use @kbd{M-x
@ -663,13 +672,13 @@ 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 customize
new settings and settings whose meanings or default values have
changed. To do this, use @kbd{M-x customize-changed} and
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.
whose definitions have been changed since the specified version,
loading them if necessary.
@findex customize-saved
@findex customize-customized
@ -712,7 +721,7 @@ 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 in your @file{.emacs} file, rather than a
recorded with code in your @file{.emacs} file, rather than a
@file{user-theme.el} file.
@vindex custom-enabled-themes
@ -734,7 +743,7 @@ theme occurring earlier in @code{custom-enabled-themes} takes effect.
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{disabled} any enabled theme with the command @kbd{M-x
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
@ -755,7 +764,7 @@ 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 need a value of a
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
@ -766,11 +775,11 @@ 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---the @dfn{user options}.
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; instead, you set the values, and thereby alter and
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.
@ -808,21 +817,27 @@ C-h v fill-column @key{RET}
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.
Documentation:
*Column beyond which automatic line-wrapping should happen.
Automatically becomes buffer-local when set in any fashion.
Interactively, you can set the buffer local value using C-x f.
You can customize this variable.
@end smallexample
@noindent
The star at the beginning of the documentation indicates that this
variable is a user option. @kbd{C-h v} is not restricted to user
options; it allows any variable name.
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
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,
@ -889,13 +904,11 @@ 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}. You can
specify any valid Lisp function as the hook function, provided it can
handle the proper number of arguments (zero arguments, in the case of
a normal hook). Of course, not every Lisp function is @emph{useful}
in any particular 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:
@ -936,11 +949,12 @@ 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 with @code{remove-hook}, or do
@code{(setq @var{hook-variable} nil)} to remove everything.
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
@ -963,46 +977,41 @@ 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. Further changes in this buffer will not
affect others, and further changes in the global value will not affect this
buffer.
@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} reads the name of a variable and
changes the future behavior of the variable so that it will become local
automatically when 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.
@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 most minor modes, the controlling variable is per buffer.
Emacs contains a number of variables that are always per-buffer.
These include @code{abbrev-mode}, @code{auto-fill-function},
@code{case-fold-search}, @code{comment-column}, @code{ctl-arrow},
@code{fill-column}, @code{fill-prefix}, @code{indent-tabs-mode},
@code{left-margin}, @code{mode-line-format}, @code{overwrite-mode},
@code{selective-display-ellipses}, @code{selective-display},
@code{tab-width}, and @code{truncate-lines}. Some other variables are
always local in every buffer, but they are used for internal
purposes.@refill
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} reads the name of a variable and makes
it 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
@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
@ -1082,9 +1091,9 @@ 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
for this, when Emacs visits a shell script, it looks for local variable
specifications in the @emph{second} line.
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
@ -1108,9 +1117,9 @@ variables list afterward.
;;; End: ***
@end example
As you see, 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
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.
@ -1155,8 +1164,7 @@ as part of their initialization.
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, regardless of how, because they represent user
preferences.
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
@ -1197,10 +1205,10 @@ answer @samp{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 safe
variable/value pairs, Emacs does not ask for confirmation before
setting them. Otherwise, you can tell Emacs to record that all the
variable/value pairs in the file are safe, by typing @kbd{!} at the
@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.
@ -1232,9 +1240,10 @@ is neither @code{t} nor @code{nil}, so normally Emacs does ask for
confirmation about processes @code{eval} variables.
@vindex safe-local-eval-forms
The @code{safe-local-eval-forms} is a customizable list of eval
forms which are safe to eval, so Emacs should not ask for
confirmation to evaluate these 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
@ -1246,7 +1255,7 @@ 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.
name, which usually consists of lower-case letters and hyphens.
@menu
* Keymaps:: Generalities. The global keymap.
@ -1405,19 +1414,6 @@ mode.
in effect, the definitions in its keymap override both the major
mode's local keymap and the global keymap.
@vindex c-mode-map
@vindex lisp-mode-map
The local keymaps for Lisp mode and several other major modes always
exist even when not in use. These are kept in variables named
@code{lisp-mode-map} and so on. For major modes less often used, the
local keymap is normally constructed only when the mode is used for the
first time in a session. This is to save space. If you wish to change
one of these keymaps, you must use the major mode's @dfn{mode
hook}---see below.
All minor mode keymaps are created in advance. There is no way to
defer their creation until the first time the minor mode is enabled.
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
@ -1433,17 +1429,16 @@ 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 ordinary circumstances.
works, but it's good enough for understanding the results in ordinary
circumstances.
@cindex rebinding major mode keys
@findex define-key
To change the local bindings of a major mode, you must change the
mode's local keymap. Normally you must wait until the first time the
mode is used, because most major modes don't create their keymaps until
then. If you want to specify something in your @file{~/.emacs} file to
change a major mode's bindings, you must use the mode's mode hook to
delay the change until the mode is first used.
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
@ -1458,8 +1453,6 @@ to add local bindings (not very useful, we admit) for @kbd{C-c n} and
'forward-paragraph)))
@end example
@xref{Hooks}.
@node Minibuffer Maps
@subsection Minibuffer Keymaps
@ -1545,10 +1538,10 @@ 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; the minibuffer is entered immediately to
read @var{cmd}. But if you type @kbd{C-x}, another character is read;
if that is @kbd{4}, another character is read, and so on. For
example,
@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}
@ -1572,9 +1565,9 @@ 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 and
use @kbd{C-h c}. The documentation of keys in this manual also lists
their command names.
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
@ -1669,8 +1662,8 @@ rewrite the first six examples above to use vectors:
@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.
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{Non-ASCII Rebinding}.
@ -1819,10 +1812,10 @@ because the terminal sends the same character in both cases.
@cindex rebinding non-@acronym{ASCII} keys
@cindex non-@acronym{ASCII} keys, binding
If your keyboard has keys that send non-@acronym{ASCII}
If your keyboard has keys that send non-@acronym{ASCII}
characters, such as accented letters, rebinding these keys
must be done by using a vector like this@footnote{Note that
you should avoid the string syntax for binding
must be done by using a vector like this@footnote{You must
avoid the string syntax for binding
non-@acronym{ASCII} characters, since they will be
interpreted as meta keys. @xref{Strings of Events,,,elisp,
The Emacs Lisp Reference Manual}.}:
@ -1834,11 +1827,11 @@ The Emacs Lisp Reference Manual}.}:
@noindent
Type @kbd{C-q} followed by the key you want to bind, to insert @var{char}.
Since this puts a non-@acronym{ASCII} character in the @file{.emacs},
Since this puts a non-@acronym{ASCII} character in the @file{.emacs},
you should specify a coding system for that file that supports the
character in question. @xref{Init Syntax}.
character in question. @xref{Init Non-ASCII}.
@strong{Warning:} if you change the keyboard encoding, or change
@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, you'll need to edit
the Lisp expression accordingly, to use the character code generated
@ -1980,19 +1973,19 @@ usual to do so.
@subsection Disabling Commands
@cindex disabled command
Disabling a command marks the command as requiring confirmation before it
can be executed. The purpose of disabling a command is to prevent
beginning users from executing it by accident and being confused.
Disabling a command menas it requires confirmation before it can be
executed. The purpose of disabling a command is to prevent users from
executing it by accident and being confused.
An attempt 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 are
asked 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.
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
@ -2013,15 +2006,14 @@ is included in the message displayed when the command is used:
@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
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. This is because editing the init file from
such a session might overwrite the lines you might have on your init
file which enable and disable commands.
@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
@ -2040,7 +2032,7 @@ 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
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.
@ -2048,7 +2040,7 @@ is the one that all commands use, so we call it ``the'' syntax table.
@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 both the string you would have to give to
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.
@ -2176,7 +2168,8 @@ a Meta character, as in @samp{\M-a} for @kbd{Meta-A} or @samp{\M-\C-a} for
@cindex international characters in @file{.emacs}
@cindex non-@acronym{ASCII} characters in @file{.emacs}
If you want to include non-@acronym{ASCII} characters in strings in your init
@anchor{Init Non-ASCII}If you want to include non-@acronym{ASCII}
characters in strings in your init
file, you should consider putting a @w{@samp{-*-coding:
@var{coding-system}-*-}} tag on the first line which states the coding
system used to save your @file{.emacs}, as explained in @ref{Recognize
@ -2241,7 +2234,7 @@ is not what you probably want to do in an init file.
Specify your own email address, if Emacs can't figure it out correctly.
@example
(setq user-mail-address "coon@@yoyodyne.com")
(setq user-mail-address "rumsfeld@@torture.gov")
@end example
Various Emacs packages that need your own email address use the value of

View file

@ -13,11 +13,12 @@ Emacs commands to move around in this buffer, and special Dired commands
to operate on the files listed.
The Dired buffer is ``read-only,'' and inserting text in it is not
useful, so ordinary printing characters such as @kbd{d} and @kbd{x} are
used for special Dired commands. Some Dired commands @dfn{mark} or
@dfn{flag} the @dfn{current file} (that is, the file on the current
line); other commands operate on the marked files or on the flagged
files.
useful, so ordinary printing characters such as @kbd{d} and @kbd{x}
are redefined for special Dired commands. Some Dired commands
@dfn{mark} or @dfn{flag} the @dfn{current file} (that is, the file on
the current line); other commands operate on the marked files or on
the flagged files. You first mark certain files in order to operate
on all of them with on command.
The Dired-X package provides various extra features for Dired mode.
@xref{Top, Dired-X,,dired-x, Dired Extra Version 2 User's Manual}.
@ -40,8 +41,6 @@ files.
* Updating: Dired Updating. Discarding lines for files of no interest.
* Find: Dired and Find. Using `find' to choose the files for Dired.
* Wdired:: Operating on files by editing the Dired buffer.
* Tumme:: Image file and thumbnail viewing and
manipulation from the Dired buffer.
* Misc: Misc Dired Features. Various other features.
@end menu
@ -53,18 +52,20 @@ files.
@vindex dired-listing-switches
To invoke Dired, do @kbd{C-x d} or @kbd{M-x dired}. The command
reads a directory name or wildcard file name pattern as a minibuffer
argument to specify which files to list. @kbd{C-x C-f} given a
argument to specify the files to list. @kbd{C-x C-f} given a
directory name also invokes Dired. Where @code{dired} differs from
@code{list-directory} is that it puts the buffer into Dired mode, so
that the special commands of Dired are available.
The variable @code{dired-listing-switches} specifies the options to
give to @code{ls} for listing the directory; this string @emph{must} contain
@samp{-l}. If you use a numeric prefix argument with the @code{dired}
command, you can specify the @code{ls} switches with the minibuffer
before you enter the directory specification. No matter how they are
specified, the @code{ls} switches should all be short options (that
is, single characters) requiring no arguments.
give to @code{ls} for listing the directory; this string @emph{must}
contain @samp{-l}. If you use a numeric prefix argument with the
@code{dired} command, you can specify the @code{ls} switches with the
minibuffer before you enter the directory specification. No matter
how they are specified, the @code{ls} switches can include short
options (that is, single characters) requiring no arguments, and long
options (starting with @samp{--}) whose arguments are specified with
@samp{=}.
@findex dired-other-window
@kindex C-x 4 d
@ -81,10 +82,9 @@ separate frame to display the Dired buffer.
@kindex C-n @r{(Dired)}
@kindex C-p @r{(Dired)}
All the usual Emacs cursor motion commands are available in Dired
buffers. Some special-purpose cursor motion commands are also
provided. The keys @kbd{C-n} and @kbd{C-p} are redefined to put the
cursor at the beginning of the file name on the line, rather than at the
beginning of the line.
buffers. The keys @kbd{C-n} and @kbd{C-p} are redefined to put the
cursor at the beginning of the file name on the line, rather than at
the beginning of the line.
@kindex SPC @r{(Dired)}
For extra convenience, @key{SPC} and @kbd{n} in Dired are equivalent
@ -121,42 +121,47 @@ Delete the files that are flagged for deletion.
@kindex d @r{(Dired)}
@findex dired-flag-file-deletion
You can flag a file for deletion by moving to the line describing the
file and typing @kbd{d} (@code{dired-flag-file-deletion}). The deletion flag is visible as a @samp{D} at
the beginning of the line. This command moves point to the next line,
so that repeated @kbd{d} commands flag successive files. A numeric
argument serves as a repeat count.
@cindex recursive deletion
@vindex dired-recursive-deletes
The variable @code{dired-recursive-deletes} controls whether the
delete command will delete non-empty directories (including their
contents). The default is to delete only empty directories.
You can flag a file for deletion by moving to the line describing
the file and typing @kbd{d} (@code{dired-flag-file-deletion}). The
deletion flag is visible as a @samp{D} at the beginning of the line.
This command moves point to the next line, so that repeated @kbd{d}
commands flag successive files. A numeric argument serves as a repeat
count.
@kindex u @r{(Dired deletion)}
@kindex DEL @r{(Dired)}
The files are flagged for deletion rather than deleted immediately to
reduce the danger of deleting a file accidentally. Until you direct
Dired to delete the flagged files, you can remove deletion flags using
the commands @kbd{u} and @key{DEL}. @kbd{u} (@code{dired-unmark}) works
just like @kbd{d}, but removes flags rather than making flags.
@key{DEL} (@code{dired-unmark-backward}) moves upward, removing flags;
it is like @kbd{u} with argument @minus{}1.
The reason for flagging files for deletion, rather than deleting
files immediately, is to reduce the danger of deleting a file
accidentally. Until you direct Dired to delete the flagged files, you
can remove deletion flags using the commands @kbd{u} and @key{DEL}.
@kbd{u} (@code{dired-unmark}) works just like @kbd{d}, but removes
flags rather than making flags. @key{DEL}
(@code{dired-unmark-backward}) moves upward, removing flags; it is
like @kbd{u} with argument @minus{}1.
@kindex x @r{(Dired)}
@findex dired-do-flagged-delete
@cindex expunging (Dired)
To delete the flagged files, type @kbd{x} (@code{dired-do-flagged-delete}).
(This is also known as @dfn{expunging}.)
This command first displays a list of all the file names flagged for
deletion, and requests confirmation with @kbd{yes}. If you confirm,
Dired deletes the flagged files, then deletes their lines from the text
of the Dired buffer. The shortened Dired buffer remains selected.
To delete the flagged files, type @kbd{x}
(@code{dired-do-flagged-delete}). (This is also known as
@dfn{expunging}.) This command first displays a list of all the file
names flagged for deletion, and requests confirmation with @kbd{yes}.
If you confirm, Dired deletes the flagged files, then deletes their
lines from the text of the Dired buffer. The Dired buffer, with
somewhat fewer lines, remains selected.
If you answer @kbd{no} or quit with @kbd{C-g} when asked to confirm, you
return immediately to Dired, with the deletion flags still present in
the buffer, and no files actually deleted.
@cindex recursive deletion
@vindex dired-recursive-deletes
You can delete empty directories just like other files, but normally
Dired cannot delete directories that are nonempty. If the variable
@code{dired-recursive-deletes} is non-@code{nil}, then Dired can
delete nonempty directories including all their contents. That can
be somewhat risky.
@node Flagging Many Files
@section Flagging Many Files at Once
@cindex flagging many files for deletion (in Dired)
@ -171,8 +176,8 @@ Flag all backup files (files whose names end with @samp{~}) for deletion
(@pxref{Backup}).
@item &
Flag for deletion all files with certain kinds of names, names that
suggest you could easily create the files again.
Flag for deletion all files with certain kinds of names which suggest
you could easily create those files again.
@item .@: @r{(Period)}
Flag excess numeric backup files for deletion. The oldest and newest
@ -204,14 +209,14 @@ files produced by @TeX{}, @samp{.bak} files, and the @samp{.orig} and
@findex dired-flag-auto-save-files
@cindex deleting auto-save files
@kbd{#} (@code{dired-flag-auto-save-files}) flags for deletion all
files whose names look like auto-save files (@pxref{Auto Save})---that
is, files whose names begin and end with @samp{#}.
files whose names look like auto-save files---that is, files whose
names begin and end with @samp{#}. @xref{Auto Save}.
@kindex ~ @r{(Dired)}
@findex dired-flag-backup-files
@kbd{~} (@code{dired-flag-backup-files}) flags for deletion all files
whose names say they are backup files (@pxref{Backup})---that is, files
whose names end in @samp{~}.
@kbd{~} (@code{dired-flag-backup-files}) flags for deletion all
files whose names say they are backup files---that is, files whose
names end in @samp{~}. @xref{Backup}.
@kindex . @r{(Dired)}
@vindex dired-kept-versions
@ -235,8 +240,9 @@ specify the number of oldest versions of each file to keep.
The @kbd{% d} command flags all files whose names match a specified
regular expression (@code{dired-flag-files-regexp}). Only the
non-directory part of the file name is used in matching. You can use
@samp{^} and @samp{$} to anchor matches. You can exclude subdirectories
by hiding them (@pxref{Hiding Subdirectories}).
@samp{^} and @samp{$} to anchor matches. You can exclude certain
subdirectories from marking by hiding them while you use @kbd{% d}.
@xref{Hiding Subdirectories}.
@node Dired Visiting
@section Visiting Files in Dired
@ -301,8 +307,8 @@ Ops, View File, Miscellaneous File Operations}.
@kindex ^ @r{(Dired)}
@findex dired-up-directory
Visit the parent directory of the current directory
(@code{dired-up-directory}). This is more convenient than moving to
the parent directory's line and typing @kbd{f} there.
(@code{dired-up-directory}). This is equivalent to moving to the line
for @file{..} and typing @kbd{f} there.
@end table
@node Marks vs Flags
@ -311,12 +317,13 @@ the parent directory's line and typing @kbd{f} there.
@cindex marking many files (in Dired)
Instead of flagging a file with @samp{D}, you can @dfn{mark} the
file with some other character (usually @samp{*}). Most Dired
commands to operate on files use the files marked with @samp{*}, the
exception being @kbd{x} which deletes the flagged files.
commands to operate on files use the files marked with @samp{*}. The
only command that operates on flagged flies is @kbd{x}, which expunges
them.
Here are some commands for marking with @samp{*}, or for unmarking or
operating on marks. (@xref{Dired Deletion}, for commands to flag and
unflag files.)
Here are some commands for marking with @samp{*}, for unmarking, and
for operating on marks. (@xref{Dired Deletion}, for commands to flag
and unflag files.)
@table @kbd
@item m
@ -348,7 +355,7 @@ With a numeric argument, unmark all those files.
@kindex * / @r{(Dired)}
@findex dired-mark-directories
@cindex marking subdirectories (in Dired)
Mark with @samp{*} all files which are actually directories, except for
Mark with @samp{*} all files which are directories, except for
@file{.} and @file{..} (@code{dired-mark-directories}). With a numeric
argument, unmark all those files.
@ -455,11 +462,12 @@ This assumes that no files were already marked with @samp{t}.
Mark (with @samp{*}) all files whose names match the regular expression
@var{regexp} (@code{dired-mark-files-regexp}). This command is like
@kbd{% d}, except that it marks files with @samp{*} instead of flagging
with @samp{D}. @xref{Flagging Many Files}.
with @samp{D}.
Only the non-directory part of the file name is used in matching. Use
@samp{^} and @samp{$} to anchor matches. Exclude subdirectories by
hiding them (@pxref{Hiding Subdirectories}).
@samp{^} and @samp{$} to anchor matches. You can exclude
subdirectories by temporarily hiding them (@pxref{Hiding
Subdirectories}).
@item % g @var{regexp} @key{RET}
@findex dired-mark-files-containing-regexp
@ -471,16 +479,21 @@ the regular expression @var{regexp}
@kbd{% m}, except that it searches the file contents instead of the file
name.
@item C-_
@item C-x u
@itemx C-_
@itemx C-/
@kindex C-_ @r{(Dired)}
@findex dired-undo
Undo changes in the Dired buffer, such as adding or removing
marks (@code{dired-undo}). @emph{This command does not revert the
actual file operations, nor recover lost files!} It just undoes
changes in the buffer itself. For example, if used after renaming one
or more files, @code{dired-undo} restores the original names, which
will get the Dired buffer out of sync with the actual contents of the
directory.
changes in the buffer itself.
In some cases, using this after commands that operate on files can
cause trouble. For example, after renaming one or more files,
@code{dired-undo} restores the original names in the Dired buffer,
which gets the Dired buffer out of sync with the actual contents of
the directory.
@end table
@node Operating on Files
@ -490,8 +503,8 @@ directory.
This section describes the basic Dired commands to operate on one file
or several files. All of these commands are capital letters; all of
them use the minibuffer, either to read an argument or to ask for
confirmation, before they act. All of them give you several ways to
specify which files to manipulate:
confirmation, before they act. All of them let you specify the
files to manipulate in these ways:
@itemize @bullet
@item
@ -508,6 +521,10 @@ on all those files.
Otherwise, the command operates on the current file only.
@end itemize
@noindent
Certain other Dired commands, such as @kbd{!} and the @samp{%}
commands, use the same conventions to decide which files to work on.
@vindex dired-dwim-target
@cindex two directories (in Dired)
Commands which ask for a destination directory, such as those which
@ -517,9 +534,7 @@ buffer's default directory, but if the variable @code{dired-dwim-target}
is non-@code{nil}, and if there is another Dired buffer displayed in the
next window, that other buffer's directory is suggested instead.
Here are the file-manipulating commands that operate on files in this
way. (Some other Dired commands, such as @kbd{!} and the @samp{%}
commands, also use these conventions to decide which files to work on.)
Here are the file-manipulating Dired commands that operate on files.
@table @kbd
@findex dired-do-copy
@ -531,15 +546,15 @@ is the directory to copy into, or (if copying a single file) the new
name.
@vindex dired-copy-preserve-time
If @code{dired-copy-preserve-time} is non-@code{nil}, then copying with
this command sets the modification time of the new file to be the same
as that of the old file.
If @code{dired-copy-preserve-time} is non-@code{nil}, then copying
with this command preserves the modification time of the old file in
the copy.
@vindex dired-recursive-copies
@cindex recursive copying
The variable @code{dired-recursive-copies} controls whether
directories are copied recursively. The default is to not copy
recursively, which means that directories cannot be copied.
The variable @code{dired-recursive-copies} controls whether to copy
directories recursively. The default is @code{nil}, which means that
directories cannot be copied.
@item D
@findex dired-do-delete
@ -608,7 +623,8 @@ different places).
@kindex T @r{(Dired)}
@cindex changing file time (in Dired)
@item T @var{timestamp} @key{RET}
Change the time of the specified files (@code{dired-do-touch}).
Touch the specified files (@code{dired-do-touch}). This means
updating their modification times to the present time.
@findex dired-do-print
@kindex P @r{(Dired)}
@ -625,7 +641,7 @@ suitable guess made using the variables @code{lpr-command} and
@cindex compressing files (in Dired)
@item Z
Compress the specified files (@code{dired-do-compress}). If the file
appears to be a compressed file already, it is uncompressed instead.
appears to be a compressed file already, uncompress it instead.
@findex dired-do-load
@kindex L @r{(Dired)}
@ -666,12 +682,6 @@ query replace loop, you can use @kbd{M-,} to resume the scan and replace
more matches. @xref{Tags Search}.
@end table
@kindex + @r{(Dired)}
@findex dired-create-directory
One special file-operation command is @kbd{+}
(@code{dired-create-directory}). This command reads a directory name and
creates the directory if it does not already exist.
@node Shell Commands in Dired
@section Shell Commands in Dired
@cindex shell commands, Dired
@ -679,12 +689,16 @@ creates the directory if it does not already exist.
@findex dired-do-shell-command
@kindex ! @r{(Dired)}
@kindex X @r{(Dired)}
The Dired command @kbd{!} (@code{dired-do-shell-command}) reads a shell
command string in the minibuffer and runs that shell command on all the
specified files. @kbd{X} is a synonym for @kbd{!}. You can specify the
files to operate on in the usual ways for Dired commands
(@pxref{Operating on Files}). There are two ways of applying a shell
command to multiple files:
The Dired command @kbd{!} (@code{dired-do-shell-command}) reads a
shell command string in the minibuffer and runs that shell command on
all the specified files. (@kbd{X} is a synonym for @kbd{!}.) You can
specify the files to operate on in the usual ways for Dired commands
(@pxref{Operating on Files}).
The working directory for the shell command is the top-level directory
of the Dired buffer.
There are two ways of applying a shell command to multiple files:
@itemize @bullet
@item
@ -711,12 +725,12 @@ file.
@item
However, if the command string contains @samp{?} surrounded by
whitespace, the current file name is substituted for @samp{?} (rather
whitespace, the current file name is substituted for @samp{?} (rather
than added at the end). You can use @samp{?} this way more than once
in the command, and the same file name replaces each occurrence.
@end itemize
To iterate over the file names in a more complicated fashion, use an
To iterate over the file names in a more complicated fashion, use an
explicit shell loop. For example, here is how to uuencode each file,
making the output file name by appending @samp{.uu} to the input file
name:
@ -725,11 +739,8 @@ name:
for file in * ; do uuencode "$file" "$file" >"$file".uu; done
@end example
The working directory for the shell command is the top-level directory
of the Dired buffer.
The @kbd{!} command does not attempt to update the Dired buffer to show
new or modified files, because it doesn't really understand shell
The @kbd{!} command does not attempt to update the Dired buffer to
show new or modified files, because it doesn't understand shell
commands, and does not know what files the shell command changed. Use
the @kbd{g} command to update the Dired buffer (@pxref{Dired
Updating}).
@ -738,7 +749,8 @@ Updating}).
@section Transforming File Names in Dired
This section describes Dired commands which alter file names in a
systematic way.
systematic way. Each command operates on some or all of the marked
files, using a new name made by transforming the existing name.
Like the basic Dired file-manipulation commands (@pxref{Operating on
Files}), the commands described here operate either on the next
@ -750,7 +762,7 @@ Flags}.)
@emph{interactively}: they ask you to confirm the operation for each
candidate file. Thus, you can select more files than you actually
need to operate on (e.g., with a regexp that matches many files), and
then refine the selection by typing @kbd{y} or @kbd{n} when the
then filter the selected names by typing @kbd{y} or @kbd{n} when the
command prompts for confirmation.
@table @kbd
@ -787,17 +799,16 @@ in each case computing the new name by regular-expression substitution
from the name of the old file.
@end table
The four regular-expression substitution commands effectively perform
a search-and-replace on the selected file names in the Dired buffer.
They read two arguments: a regular expression @var{from}, and a
substitution pattern @var{to}.
The commands match each ``old'' file name against the regular
expression @var{from}, and then replace the matching part with @var{to}.
You can use @samp{\&} and @samp{\@var{digit}} in @var{to} to refer to
all or part of what the pattern matched in the old file name, as in
@code{replace-regexp} (@pxref{Regexp Replace}). If the regular expression
matches more than once in a file name, only the first match is replaced.
The four regular-expression substitution commands effectively
perform a search-and-replace on the selected file names. They read
two arguments: a regular expression @var{from}, and a substitution
pattern @var{to}; they match each ``old'' file name against
@var{from}, and then replace the matching part with @var{to}. You can
use @samp{\&} and @samp{\@var{digit}} in @var{to} to refer to all or
part of what the pattern matched in the old file name, as in
@code{replace-regexp} (@pxref{Regexp Replace}). If the regular
expression matches more than once in a file name, only the first match
is replaced.
For example, @kbd{% R ^.*$ @key{RET} x-\& @key{RET}} renames each
selected file by prepending @samp{x-} to its name. The inverse of this,
@ -809,15 +820,16 @@ matches that should span the whole filename.)
Normally, the replacement process does not consider the files'
directory names; it operates on the file name within the directory. If
you specify a numeric argument of zero, then replacement affects the
entire absolute file name including directory name. (Non-zero
entire absolute file name including directory name. (A non-zero
argument specifies the number of files to operate on.)
Often you will want to select the set of files to operate on using the
same @var{regexp} that you will use to operate on them. To do this,
mark those files with @kbd{% m @var{regexp} @key{RET}}, then use the
same regular expression in the command to operate on the files. To make
this easier, the @kbd{%} commands to operate on files use the last
regular expression specified in any @kbd{%} command as a default.
You may want to select the set of files to operate on using the same
regexp @var{from} that you will use to operate on them. To do this,
mark those files with @kbd{% m @var{from} @key{RET}}, then use the
same regular expression in the command to operate on the files. To
make this more convenient, the @kbd{%} commands to operate on files
use the last regular expression specified in any @kbd{%} command as a
default.
@node Comparison in Dired
@section File Comparison with Dired
@ -825,19 +837,20 @@ regular expression specified in any @kbd{%} command as a default.
@cindex compare files (in Dired)
Here are two Dired commands that compare specified files using
@code{diff}.
@code{diff}. They show the output in a buffer using Diff mode
(@pxref{Comparing Files}).
@table @kbd
@item =
@findex dired-diff
@kindex = @r{(Dired)}
Compare the current file (the file at point) with another file (the file
at the mark) using the @code{diff} program (@code{dired-diff}). The
file at the mark is the first argument of @code{diff}, and the file at
point is the second argument. Use @kbd{C-@key{SPC}}
Compare the current file (the file at point) with another file (the
file at the mark) using the @code{diff} program (@code{dired-diff}).
The file at the mark is the first argument of @code{diff}, and the
file at point is the second argument. This refers to the ordinary
Emacs mark, not Dired marks; use @kbd{C-@key{SPC}}
(@code{set-mark-command}) to set the mark at the first file's line
(@pxref{Setting Mark}), since @code{dired-diff} ignores the files marked
with the Dired's @kbd{m} command.
(@pxref{Setting Mark}).
@findex dired-backup-diff
@kindex M-= @r{(Dired)}
@ -845,7 +858,7 @@ with the Dired's @kbd{m} command.
Compare the current file with its latest backup file
(@code{dired-backup-diff}). If the current file is itself a backup,
compare it with the file it is a backup of; this way, you can compare
a file with any backup version of your choice.
a file with any one of its backups.
The backup file is the first file given to @code{diff}.
@end table
@ -864,9 +877,8 @@ numeric argument when you run Dired, then you can specify these options
in the minibuffer.) That produces a recursive directory listing showing
all subdirectories at all levels.
But usually all the subdirectories are too many; usually you will
prefer to include specific subdirectories only. You can do this with
the @kbd{i} command:
More often, you will want to show only specific subdirectories. You
can do this with the @kbd{i} command:
@table @kbd
@findex dired-maybe-insert-subdir
@ -950,7 +962,7 @@ Move down to the next directory-file line (@code{dired-prev-dirline}).
@cindex hiding in Dired (Dired)
@dfn{Hiding} a subdirectory means to make it invisible, except for its
header line, via selective display (@pxref{Selective Display}).
header line.
@table @kbd
@item $
@ -974,7 +986,8 @@ subdirectories far away.
subdirectory. For example, the commands to operate on marked files
ignore files in hidden directories even if they are marked. Thus you
can use hiding to temporarily exclude subdirectories from operations
without having to remove the markers.
without having to remove the Dired marks on files in those
subdirectories.
@node Dired Updating
@section Updating the Dired Buffer
@ -990,7 +1003,8 @@ part of the Dired buffer.
Update the entire contents of the Dired buffer (@code{revert-buffer}).
@item l
Update the specified files (@code{dired-do-redisplay}).
Update the specified files (@code{dired-do-redisplay}). You specify the
files for @kbd{l} in the same way as for file operations.
@item k
Delete the specified @emph{file lines}---not the files, just the lines
@ -1034,9 +1048,9 @@ current file as a last resort.
If you use @kbd{k} with a numeric prefix argument to kill the line
for a file that is a directory, which you have inserted in the Dired
buffer as a subdirectory, then this deletes that subdirectory from the
buffer as well. Typing @kbd{C-u k} on the header line for a subdirectory
is another way to delete a subdirectory from the Dired buffer.
buffer as a subdirectory, it deletes that subdirectory from the buffer
as well. Typing @kbd{C-u k} on the header line for a subdirectory
also deletes the subdirectory from the Dired buffer.
The @kbd{g} command brings back any individual lines that you have
killed in this way, but not subdirectories---you must use @kbd{i} to
@ -1068,7 +1082,7 @@ flexibly by using the @code{find} utility to choose the files.
@var{pattern}, and chooses all the files in @var{directory} or its
subdirectories whose individual names match @var{pattern}.
The files thus chosen are displayed in a Dired buffer in which the
The files thus chosen are displayed in a Dired buffer, in which the
ordinary Dired commands are available.
@findex find-grep-dired
@ -1101,10 +1115,10 @@ may need to change the value of this variable.
@cindex file database (locate)
@vindex locate-command
@kbd{M-x locate} provides a similar interface to the @code{locate}
program. @kbd{M-x locate-with-filter} is similar, but keeps only lines
matching a given regular expression.
program. @kbd{M-x locate-with-filter} is similar, but keeps only files
whose names match a given regular expression.
These buffers don't work entirely like ordinary Dired buffers. File
These buffers don't work entirely like ordinary Dired buffers: file
operations work, but do not always automatically update the buffer.
Reverting the buffer with @kbd{g} deletes all inserted subdirectories,
and erases all flags and marks.
@ -1131,104 +1145,26 @@ back to ordinary Dired mode.
Apart from simply renaming files, you can move a file to another
directory by typing in the new file name (either absolute or
relative). To mark a file for deletion, delete the entire filename.
To change the target of a symbolic link, just edit the target name
displayed next to the link name.
To change the target of a symbolic link, edit the link target name
which appears next to the link name.
The rest of the text in the buffer, such as the file sizes and
modification dates, is marked read-only, so you can't edit it.
However, if you set @code{wdired-allow-to-change-permissions} to
@code{t}, the file permission bits can also be edited. For example,
you can change @samp{-rw-r--r--} to @samp{-rw-rw-rw-} to make a file
@code{t}, you can edit the file permissions. For example, you can
change @samp{-rw-r--r--} to @samp{-rw-rw-rw-} to make a file
world-writable. These changes also take effect when you type @kbd{C-c
C-c}.
@node Tumme
@section Thumbnail and image file viewing and manipulation
@cindex tumme mode
Tumme provides for simple viewing of thumbnails of image files. It
provides viewing of the original file, sized or in full size, inside
Emacs or in an external viewer.
Tumme aims to be both easy to use for a beginner but also powerful
and useful to an experienced user.
The quickest way to try out Tumme is to use the command
@code{tumme}. It will prompt for a directory where there are images
files. All images in that directory will get thumbnail files created
for them, and the thumbnails will be displayed in the ``thumbnail
buffer''.
If the directory contains many image files and becayse thumbnails
are created on the fly before they can be displayed, the above command
might take a long time, especially the first time (consecutive
viewings will use the cached thumbnail files). Also, if the number of
image files is higher than @code{tumme-show-all-from-dir-max-files},
the command will be aborted. To work around this you can instead mark
the files you want to look at, using @kbd{m} as usual in Dired, and
then type @kbd{C-t d} (@code{tumme-display-thumbs}).
Regardless of which command you chose to display the thumbnails, a
new buffer will open up, displaying thumbnail images of the files that
were marked in dired. The new buffer will be the active one.
With point in the thumbnail buffer, type @kbd{RET}
(@code{tumme-display-thumbnail-original-image}) to display a sized
version of it in another window. The image will be sized to fit the
window. Use the arrow keys to move around in the buffer. For easy
browing, type @kbd{SPC} (@code{tumme-display-next-thumbnail-original})
to advance and display the next image. Typing @kbd{DEL}
(@code{tumme-display-previous-thumbnail-original}) backs up to the
previous thumbnail and displays that instead.
If you want to see the image in its original size, either provide a
prefix argument (@kbd{C-u}) before pressing @kbd{RET}, or type
@kbd{C-return} (@code{tumme-thumbnail-display-external}) to display
the image in an external viewer. To use the latter,
@code{tumme-external-viewer} must be configured.
If you find in image that you want to delete, type @kbd{d}
(@code{tumme-flag-thumb-original-file}) and the file will be flagged
for deletion in the dired buffer. If you just want visually to delete
the thumbnail image from the thumbnail buffer, type @kbd{C-d}
(@code{tumme-delete-char}).
More advanced features include commands for using ``tags''. ``Tag''
is just another word for ``keyword'', ``label'' or ``category''. In
short, it is meta data used to categorize an image file. Commands
exist to add tags for one or many image files from dired, to mark
files having a certain tag in Dired and to remove tags from files.
The tags put on image files are stored in a database file (currently a
plain text file).
To tag image files, mark them in the dired buffer and type @kbd{C-t
t} (@code{tumme-tag-files}). You will be prompted for a tag. To mark
files having a certain tag, type @kbd{C-t f}
(@code{tumme-mark-tagged-files}). After marking image files with a
certain tag, they can be viewed as explained earlier, by typing
@key{C-t d}.
You can also tag a file from the thumbnail buffer by typing @kbd{t
t} and remove it by typing @kbd{t r}. There is also a special ``tag''
called ``comment'' for each file (it is not a tag in the exact same
sense as the other tags, it is handled slightly different). That is
used to enter a comment or description about the image. You comment a
file from the thumbnail buffer by typing @kbd{c}. You will be
prompted for a comment. Comments can also be added from Dired, and
then also to multiple files at once, by typing @kbd{C-t c}
(@code{tumme-dired-comment-files}).
Tumme also provides simple image manipulation commands, like
rotating thumbnails and original image files. In the thumbnail
buffer, type @kbd{L} to rotate the original image 90 degrees anti
clockwise, and @kbd{R} to rotate it 90 degrees clockwise. This
rotation will be done lossless (the image quality will not be reduced)
and needs an external utility called JpegTRAN to work.
@node Misc Dired Features
@section Other Dired Features
@kindex + @r{(Dired)}
@findex dired-create-directory
An unusual Dired file-operation command is @kbd{+}
(@code{dired-create-directory}). This command reads a directory name,
and creates the directory if it does not already exist.
@cindex Adding to the kill ring in Dired.
@kindex w @r{(Dired)}
@findex dired-copy-filename-as-kill
@ -1236,16 +1172,18 @@ and needs an external utility called JpegTRAN to work.
names of the marked (or next @var{n}) files into the kill ring, as if
you had killed them with @kbd{C-w}. The names are separated by a space.
With a zero prefix argument, this uses the absolute file name of
each marked file. With just @kbd{C-u} as the prefix argument, it uses
file names relative to the Dired buffer's default directory. (This
can still contain slashes if in a subdirectory.) As a special case,
if point is on a directory headerline, @kbd{w} gives you the absolute
name of that directory. Any prefix argument or marked files are
ignored in this case.
The main purpose of this command is so that you can yank the file
names into arguments for other Emacs commands. It also displays what
was pushed onto the kill ring, so you can use it to display the list
of currently marked files in the echo area. With a zero prefix
argument, this uses the absolute file name of each marked file. With
just @kbd{C-u} as the prefix argument, it uses file names relative to
the Dired buffer's default directory. (This can still contain slashes
if in a subdirectory.) As a special case, if point is on a directory
headerline, @kbd{w} gives you the absolute name of that directory.
Any prefix argument or marked files are ignored in this case.
it added to the kill ring, so you can use it to display the list of
currently marked files in the echo area.
@findex dired-compare-directories
The command @kbd{M-x dired-compare-directories} is used to compare

View file

@ -64,6 +64,7 @@ license to the document, as described in section 6 of the license.
* Picture Mode:: Editing pictures made up of characters
using the quarter-plane screen model.
* Fortran:: Fortran mode and its special features.
* MS-DOG::
* Index::
@end menu
@ -2406,6 +2407,687 @@ 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.
@node MS-DOG
@chapter 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'').
Information about Emacs and Microsoft's current operating system
Windows (also known as ``Losedows) is in the main Emacs manual
(@pxref{Emacs and Microsoft Systems,,, emacs, the Emacs Manual}).
If you build Emacs for MS-DOS, the binary will also run on Windows
3.X, Windows NT, Windows 9X/ME, Windows 2000, 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.
@xref{Text and Binary,,,emacs, the Emacs Manual}, for information
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. How to specify the printer 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
@section 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
(@pxref{Quitting,,,emacs, the Emacs Manual}). 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 (@pxref{Emergency Escape,,,emacs, the
Emacs Manual}).
@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
@section 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 (@pxref{Menu Bar,,,emacs, the Emacs Manual}). 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 (@pxref{Mouse References,,,emacs, the Emacs
Manual}) 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 (@pxref{Mouse Commands,,,emacs, the Emacs Manual}).
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
@section 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 (@pxref{Frame
Parameters,,,emacs, the Emacs Manual}) and the
@code{list-faces-display} command (@pxref{Faces,,,emacs, the Emacs
Manual}) 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} (@pxref{Creating Frames,,,emacs, the Emacs
Manual}). 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 (@pxref{Frames,,,emacs, the Emacs Manual}). 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
@section File Names on MS-DOS
@cindex file names under MS-DOS
@cindex init file, default name under MS-DOS
MS-DOS normally uses a backslash, @samp{\}, to separate name units
within a file name, instead of the slash used on other systems. Emacs
on MS-DOS permits use of either slash or backslash, and also knows
about drive letters in file names.
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
(@pxref{Init File,,,emacs, the Emacs Manual}) 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 (@pxref{Backup
Names,,,emacs, the Emacs Manual}) 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, 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
@section Printing and MS-DOS
Printing commands, such as @code{lpr-buffer}
(@pxref{Printing,,,emacs, the Emacs Manual }) and
@code{ps-print-buffer} (@pxref{PostScript,,,emacs, the Emacs Manual})
can work in MS-DOS and MS-Windows 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 and MS-Windows.
@vindex printer-name @r{(MS-DOS)}
If you want to use your local printer, printing on it in the usual DOS
manner, then set the Lisp variable @code{lpr-command} to @code{""} (its
default value) and @code{printer-name} to the name of the printer
port---for example, @code{"PRN"}, the usual local printer port (that's
the default), or @code{"LPT2"}, or @code{"COM1"} for a serial printer.
You can also set @code{printer-name} to a file name, in which case
``printed'' output is actually appended to that file. If you set
@code{printer-name} to @code{"NUL"}, printed output is silently
discarded (sent to the system null device).
On MS-Windows, when the Windows network software is installed, you can
also use a printer shared by another machine by setting
@code{printer-name} to the UNC share name for that printer---for example,
@code{"//joes_pc/hp4si"}. (It doesn't matter whether you use forward
slashes or backslashes here.) To find out the names of shared printers,
run the command @samp{net view} at a DOS command prompt to obtain a list
of servers, and @samp{net view @var{server-name}} to see the names of printers
(and directories) shared by that server. Alternatively, click the
@samp{Network Neighborhood} icon on your desktop, and look for machines
which share their printers via the network.
@cindex @samp{net use}, and printing on MS-Windows
@cindex networked printers (MS-Windows)
If the printer doesn't appear in the output of @samp{net view}, or
if setting @code{printer-name} to the UNC share name doesn't produce a
hardcopy on that printer, you can use the @samp{net use} command to
connect a local print port such as @code{"LPT2"} to the networked
printer. For example, typing @kbd{net use LPT2:
\\joes_pc\hp4si}@footnote{
Note that the @samp{net use} command requires the UNC share name to be
typed with the Windows-style backslashes, while the value of
@code{printer-name} can be set with either forward- or backslashes.}
causes Windows to @dfn{capture} the LPT2 port and redirect the printed
material to the printer connected to the machine @code{joes_pc}.
After this command, setting @code{printer-name} to @code{"LPT2"}
should produce the hardcopy on the networked printer.
With some varieties of Windows network software, you can instruct
Windows to capture a specific printer port such as @code{"LPT2"}, and
redirect it to a networked printer via the @w{@code{Control
Panel->Printers}} applet instead of @samp{net use}.
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}.
If you set @code{printer-name} to a file name, it's best to use an
absolute file name. Emacs changes the working directory according to
the default directory of the current buffer, so if the file name in
@code{printer-name} is relative, you will end up with several such
files, each one in the directory of the buffer from which the printing
was done.
@findex print-buffer @r{(MS-DOS)}
@findex print-region @r{(MS-DOS)}
@vindex lpr-headers-switches @r{(MS-DOS)}
The commands @code{print-buffer} and @code{print-region} call the
@code{pr} program, or use special switches to the @code{lpr} program, to
produce headers on each printed page. MS-DOS and MS-Windows don't
normally have these programs, so by default, the variable
@code{lpr-headers-switches} is set so that the requests to print page
headers are silently ignored. Thus, @code{print-buffer} and
@code{print-region} produce the same output as @code{lpr-buffer} and
@code{lpr-region}, respectively. If you do have a suitable @code{pr}
program (for example, from GNU Textutils), set
@code{lpr-headers-switches} to @code{nil}; Emacs will then call
@code{pr} to produce the page headers, and print the resulting output as
specified by @code{printer-name}.
@vindex print-region-function @r{(MS-DOS)}
@cindex lpr usage under MS-DOS
@vindex lpr-command @r{(MS-DOS)}
@vindex lpr-switches @r{(MS-DOS)}
Finally, if you do have an @code{lpr} work-alike, you can set the
variable @code{lpr-command} to @code{"lpr"}. Then Emacs will use
@code{lpr} for printing, as on other systems. (If the name of the
program isn't @code{lpr}, set @code{lpr-command} to specify where to
find it.) The variable @code{lpr-switches} has its standard meaning
when @code{lpr-command} is not @code{""}. If the variable
@code{printer-name} has a string value, it is used as the value for the
@code{-P} option to @code{lpr}, as on Unix.
@findex ps-print-buffer @r{(MS-DOS)}
@findex ps-spool-buffer @r{(MS-DOS)}
@vindex ps-printer-name @r{(MS-DOS)}
@vindex ps-lpr-command @r{(MS-DOS)}
@vindex ps-lpr-switches @r{(MS-DOS)}
A parallel set of variables, @code{ps-lpr-command},
@code{ps-lpr-switches}, and @code{ps-printer-name} (@pxref{PostScript
Variables,,,emacs, the Emacs Manual}), defines how PostScript files
should be printed. These variables are used in the same way as the
corresponding variables described above for non-PostScript printing.
Thus, the value of @code{ps-printer-name} is used as the name of the
device (or file) to which PostScript output is sent, just as
@code{printer-name} is used for non-PostScript printing. (There are
two distinct sets of variables in case you have two printers attached
to two different ports, and only one of them is a PostScript printer.)
The default value of the variable @code{ps-lpr-command} is @code{""},
which causes PostScript output to be sent to the printer port specified
by @code{ps-printer-name}, but @code{ps-lpr-command} can also be set to
the name of a program which will accept PostScript files. Thus, if you
have a non-PostScript printer, you can set this variable to the name of
a PostScript interpreter program (such as Ghostscript). Any switches
that need to be passed to the interpreter program are specified using
@code{ps-lpr-switches}. (If the value of @code{ps-printer-name} is a
string, it will be added to the list of switches as the value for the
@code{-P} option. This is probably only useful if you are using
@code{lpr}, so when using an interpreter typically you would set
@code{ps-printer-name} to something other than a string so it is
ignored.)
For example, to use Ghostscript for printing on an Epson printer
connected to the @samp{LPT2} port, put this in your @file{_emacs} file:
@example
(setq ps-printer-name t) ; Ghostscript doesn't understand -P
(setq ps-lpr-command "c:/gs/gs386")
(setq ps-lpr-switches '("-q" "-dNOPAUSE"
"-sDEVICE=epson"
"-r240x72"
"-sOutputFile=LPT2"
"-Ic:/gs"))
@end example
@noindent
(This assumes that Ghostscript is installed in the @file{"c:/gs"}
directory.)
@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 and MS-Windows
only.
@node MS-DOS and MULE
@section 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 (@pxref{International,,,emacs,
the Emacs Manual}), 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
(@pxref{Initial Options,,,emacs, the Emacs Manual}), 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\-}. @xref{Mode
Line,,,emacs, the Emacs Manual}. 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 (@pxref{Language
Environments,,,emacs, the Emacs Manual}).
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. @xref{Position
Info,,,emacs, the Emacs Manual}.
@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 (@pxref{Text Coding,,,emacs, the Emacs Manual}).
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
@section 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. @xref{Windows
Processes,,,emacs, the Emacs Manual}.
@cindex printing under MS-DOS
Printing commands, such as @code{lpr-buffer}
(@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}.
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}.
@node Index
@unnumbered Index

View file

@ -73,7 +73,12 @@ Boston, MA 02110-1301 USA
Cover art by Etienne Suvasa.
@end titlepage
@page
@summarycontents
@contents
@ifnottex
@node Top, Distrib, (dir), (dir)
@top The Emacs Editor
@ -122,7 +127,7 @@ and Sending Mail and Registers and Minibuffer.
* Glossary:: The glossary.
* Antinews:: Information about Emacs version 21.
* Mac OS:: Using Emacs in the Mac.
* MS-DOS:: Using Emacs on MS-DOS and Microsoft Windows.
* Emacs and Microsoft Windows:: Using Emacs on Microsoft Windows.
* Manifesto:: What's GNU? Gnu's Not Unix!
* Acknowledgments:: Major contributors to GNU Emacs.
@ -201,6 +206,7 @@ Advanced Features
"recursive editing level".
* Emulation:: Emulating some other editors with Emacs.
* Hyperlinking:: Following links in buffers.
* Thumbnails:: Browsing images using thumbnails.
* Dissociated Press:: Dissociating text for fun.
* Amusements:: Various games and hacks.
* Customization:: Modifying the behavior of Emacs.
@ -800,7 +806,6 @@ Dealing with Emacs Trouble
* Stuck Recursive:: `[...]' in mode line around the parentheses.
* Screen Garbled:: Garbage on the screen.
* Text Garbled:: Garbage in the text.
* Unasked-for Search:: Spontaneous entry to incremental search.
* 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---
@ -855,16 +860,9 @@ Emacs and Mac OS
* Mac Font Specs:: Specifying fonts on Mac.
* Mac Functions:: Mac-specific Lisp functions.
MS-DOS and Windows 95/98/NT
Emacs and Microsoft Windows
* MS-DOS Keyboard:: Keyboard usage on MS-DOS.
* MS-DOS Mouse:: Mouse usage on MS-DOS.
* MS-DOS Display:: Fonts, frames and display size on MS-DOS.
* MS-DOS File Names:: File-name conventions on MS-DOS.
* Text and Binary:: Text files on MS-DOS use CRLF to separate lines.
* MS-DOS Printing:: How to specify the printer on MS-DOS.
* MS-DOS and MULE:: Support for internationalization on MS-DOS.
* MS-DOS Processes:: Running subprocesses on MS-DOS.
* Windows Processes:: Running subprocesses on Windows.
* Windows System Menu:: Controlling what the ALT key does.
@end menu
@ -926,10 +924,10 @@ 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{MS-DOS}, for
information about using Emacs on MS-DOS and Windows. @xref{Mac OS},
for information about using Emacs on Macintosh. We don't try to
describe VMS usage in this manual.
MS-DOS do not support all GNU Emacs features. @xref{Emacs and
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
@ -1604,8 +1602,6 @@ Public License instead of this License.
@unnumbered Concept Index
@printindex cp
@summarycontents
@contents
@bye
@ignore

View file

@ -27,7 +27,7 @@ it terminates all the frames. To delete just one frame, use @kbd{C-x 5
Emacs compiled for MS-DOS emulates some windowing functionality,
so that you can use many of the features described in this chapter.
@xref{MS-DOS Mouse}, for more information.
@xref{MS-DOS Mouse,,,emacs-xtra,Specialized Emacs Features}.
@menu
* Mouse Commands:: Moving, cutting, and pasting, with the mouse.

View file

@ -2,7 +2,7 @@
@c Copyright (C) 1985, 1986, 1987, 1993, 1995, 2002, 2003, 2004,
@c 2005, 2006 Free Software Foundation, Inc.
@ifclear justgnu
@node Manifesto,, MS-DOS, Top
@node Manifesto,, Emacs and Microsoft Windows, Top
@unnumbered The GNU Manifesto
@end ifclear
@ifset justgnu

View file

@ -50,7 +50,7 @@ license to the document, as described in section 6 of the license.
\begin{document}
% Adjust ../Makefile.in if you change the following line:
\newcommand{\gnusversionname}{Gnus v5.10.6}
\newcommand{\gnusversionname}{Gnus v5.11}
\newcommand{\gnuschaptername}{}
\newcommand{\gnussectionname}{}
@ -360,7 +360,7 @@ 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.10.6.
This manual corresponds to Gnus v5.11.
@end ifinfo
@ -2758,6 +2758,9 @@ 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}
@ -3035,8 +3038,9 @@ 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
example:
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
@ -4675,6 +4679,8 @@ article has any children.
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}.
@ -10655,8 +10661,8 @@ or newer is recommended.
@end enumerate
More information on how to set things up can be found in the message
manual (@pxref{Security, ,Security, message, Message Manual}).
The variables that control security functionality on reading messages
include:
@table @code
@item mm-verify-option
@ -10687,6 +10693,15 @@ 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
@ -10707,6 +10722,10 @@ application/pgp-keys; gpg --import --interactive --verbose; needsterminal
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
@ -17540,16 +17559,16 @@ 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} is non-@code{nil},
@code{nnvirtual} will always scan groups for unread articles when
entering a virtual group. If this variable is @code{nil} (which is the
default) 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.
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}
@ -22060,10 +22079,20 @@ readers.
@end iftex
@c @anchor{X-Face}
Decoding an @code{X-Face} header either requires an Emacs that has
Viewing an @code{X-Face} header either requires an Emacs that has
@samp{compface} support (which most XEmacs versions has), or that you
have @samp{compface} installed on your system. If either is true,
Gnus will default to displaying @code{X-Face} headers.
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. 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 from the
ImageMagick package. For external conversion programs look for packages
with names like @code{netpbm}, @code{libgr-progs} and @code{compface}.
The variable that controls this is the
@code{gnus-article-x-face-command} variable. If this variable is a
@ -22072,21 +22101,6 @@ function, this function will be called with the face as the argument.
If the @code{gnus-article-x-face-too-ugly} (which is a regexp) matches
the @code{From} header, the face will not be shown.
The default action under Emacs without image support is to fork off the
@code{display} program@footnote{@code{display} is from the ImageMagick
package. For the @code{uncompface} and @code{icontopbm} programs look
for a package like @code{compface} or @code{faces-xface} on a GNU/Linux
system.} to view the face.
Under XEmacs or Emacs 21+ with suitable image support, the default
action is to display the face before the @code{From} header. (It's
nicer if XEmacs has been compiled with @code{X-Face} support---that
will make display somewhat faster. 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.@footnote{On a GNU/Linux system look for packages with names
like @code{netpbm}, @code{libgr-progs} and @code{compface}.})
(Note: @code{x-face} is used in the variable/function names, not
@code{xface}).
@ -22104,7 +22118,9 @@ default colors are black and white.
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.
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
@ -22151,7 +22167,7 @@ Using the last function would be something like this:
@subsection Face
@cindex face
@c #### FIXME: faces and x-faces'implementations should really be harmonized.
@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
@ -22163,6 +22179,13 @@ 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.

View file

@ -512,11 +512,11 @@ the help text. @key{TAB} (@code{help-next-ref}) moves point down to the
next cross reference. Use @kbd{S-@key{TAB}} to move point up to the
previous cross reference (@code{help-previous-ref}).
To view all documentation about a symbol, whether quoted or not, move
point over the symbol and type @kbd{C-c C-c}
You can view all documentation about any symbol name that appears in
the text, by moving point to the symbol name and typing @kbd{C-c C-c}
(@code{help-follow-symbol}). This shows all available documentation
about the symbol as a variable, function or face. Just like for
quoted cross references, you can use @kbd{C-c C-b} to retrace your steps.
about the symbol as a variable, function and/or face. @kbd{C-c C-b}
works in this case also, to retrace your steps.
@node Misc Help
@section Other Help Commands

File diff suppressed because it is too large Load diff

View file

@ -543,6 +543,7 @@ clear them out, fill them with blanks or text, or delete them. Rectangle
commands are useful with text in multicolumn formats, and for changing
text into or out of such formats.
@cindex mark rectangle
When you must specify a rectangle for a command to work on, you do it
by putting the mark at one corner and point at the opposite corner. The
rectangle thus specified is called the @dfn{region-rectangle} because

View file

@ -2,7 +2,7 @@
@c Copyright (C) 2000, 2001, 2002, 2003, 2004,
@c 2005, 2006 Free Software Foundation, Inc.
@c See file emacs.texi for copying conditions.
@node Mac OS, MS-DOS, Antinews, Top
@node Mac OS, Emacs and Microsoft Windows, Antinews, Top
@appendix Emacs and Mac OS
@cindex Mac OS
@cindex Macintosh

View file

@ -70,7 +70,7 @@ Message mode buffers.
@c Adjust ../Makefile.in if you change the following lines:
Message is distributed with Gnus. The Gnus distribution
@c
corresponding to this manual is Gnus v5.10.6.
corresponding to this manual is Gnus v5.11.
@node Interface

View file

@ -11,9 +11,9 @@
@set VERSION 7.93
@c Edition of the manual. It is either empty for the first edition or
@c has the form ", nth Edition" (without the quotes).
@set EDITION , 5th Edition
@set UPDATED 2006-03-19
@set UPDATE-MONTH March, 2006
@set EDITION , 6th Edition
@set UPDATED 2006-04-02
@set UPDATE-MONTH April, 2006
@c Other variables.
@set MH-BOOK-HOME http://www.ics.uci.edu/~mh/book/mh
@ -591,9 +591,9 @@ actually cause problems.
If you've never run MH before, you need to run @command{install-mh}
from the shell before you continue. This sets up your personal MH
environment@footnote{See the section
@uref{@value{MH-BOOK-HOME}/setup.htm, Setting Up MH} in the MH book.}.
If you don't, you'll be greeted with the error message: @samp{Install
MH and run install-mh before running MH-E}.
@uref{@value{MH-BOOK-HOME}/../overall/setup.htm, Setting Up MH} in the
MH book.}. If you don't, you'll be greeted with the error message:
@samp{Install MH and run install-mh before running MH-E}.
@cindex @samp{Path:} MH profile component
@cindex MH profile
@ -7502,7 +7502,7 @@ Spam program that MH-E should use (default: @samp{Auto-detect}).
@cindex spam filters, Spamassassin
@cindex spam filters, bogofilter
MH-E depends on @uref{http://www.spamassassin.org/, SpamAssassin},
MH-E depends on @uref{http://spamassassin.apache.org/, SpamAssassin},
@uref{http://bogofilter.sourceforge.net/, bogofilter}, or
@uref{http://spamprobe.sourceforge.net/, SpamProbe} to throw the dreck
away. This chapter describes briefly how to configure these programs
@ -7557,7 +7557,7 @@ MH-E can work with.
SpamAssassin is one of the more popular spam filtering programs. Get
it from your local distribution or from the
@uref{http://spamassassin.org/, SpamAssassin web site}.
@uref{http://spamassassin.apache.org/, SpamAssassin web site}.
To use SpamAssassin, add the following recipes to @file{~/.procmailrc}:
@ -8542,12 +8542,12 @@ I also point out some additional sources of information.
@kindex M-x mh-version
Bug reports should be filed at
@uref{https://sourceforge.net/bugs/?group_id=13357, SourceForge}. You
need to be a SourceForge user to submit bug reports, but this is easy
enough to do that it shouldn't be a restriction for you. Please
include the output of @kbd{M-x mh-version} (@pxref{Miscellaneous}) in
any bug report you send unless you're 110% positive we won't ask for
it.
@uref{https://sourceforge.net/tracker/?group_id=13357&atid=113357,
SourceForge}. You need to be a SourceForge user to submit bug reports,
but this is easy enough to do that it shouldn't be a restriction for
you. Please include the output of @kbd{M-x mh-version}
(@pxref{Miscellaneous}) in any bug report you send unless you're 110%
positive we won't ask for it.
@node Mailing Lists, MH FAQ and Support, Bug Reports, Odds and Ends
@appendixsec MH-E Mailing Lists
@ -8577,10 +8577,10 @@ itself which you will find useful.
@cindex support
You can find FAQs on MH-E at the
@uref{https://sourceforge.net/support/?group_id=13357, Support
Requests} page on SourceForge. If you don't find the answer to your
question, file a support request and your question will become a new
FAQ!
@uref{https://sourceforge.net/tracker/?group_id=13357&atid=213357,
Support Requests} page on SourceForge. If you don't find the answer to
your question, file a support request and your question will become a
new FAQ!
@node Getting MH-E, , MH FAQ and Support, Odds and Ends
@appendixsec Getting MH-E

View file

@ -9,9 +9,10 @@
else: reading netnews, running shell commands and shell subprocesses,
using a single shared Emacs for utilities that expect to run an editor
as a subprocess, printing hardcopy, sorting text, narrowing display to
part of the buffer, editing double-column files and binary files, saving
an Emacs session for later resumption, emulating other editors, and
various diversions and amusements.
part of the buffer, editing double-column files and binary files,
saving an Emacs session for later resumption, following hyperlinks,
browsing images, emulating other editors, and various diversions and
amusements.
@end iftex
@ -49,15 +50,15 @@ To start Gnus, type @kbd{M-x gnus @key{RET}}.
@node Buffers of Gnus
@subsection Gnus Buffers
As opposed to most normal Emacs packages, Gnus uses a number of
different buffers to display information and to receive commands. The
three buffers users spend most of their time in are the @dfn{group
buffer}, the @dfn{summary buffer} and the @dfn{article buffer}.
Unlike most Emacs packages, Gnus uses several buffers to display
information and to receive commands. The three Gnus buffers users use
most are the @dfn{group buffer}, the @dfn{summary buffer} and the
@dfn{article buffer}.
The @dfn{group buffer} contains a list of groups. This is the first
buffer Gnus displays when it starts up. It normally displays only the
groups to which you subscribe and that contain unread articles. Use
this buffer to select a specific group.
The @dfn{group buffer} contains a list of newsgroups. This is the
first buffer Gnus displays when it starts up. It normally displays
only the groups to which you subscribe and that contain unread
articles. Use this buffer to select a specific group.
The @dfn{summary buffer} lists one line for each article in a single
group. By default, the author, the subject and the line number are
@ -67,9 +68,10 @@ in the group buffer, and is killed when you exit the group. Use this
buffer to select an article.
The @dfn{article buffer} displays the article. In normal Gnus usage,
you don't select this buffer---all useful article-oriented commands work
in the summary buffer. But you can select the article buffer, and
execute all Gnus commands from that buffer, if you want to.
you see this buffer but you don't select it---all useful
article-oriented commands work in the summary buffer. But you can
select the article buffer, and execute all Gnus commands from that
buffer, if you want to.
@node Gnus Startup
@subsection When Gnus Starts Up
@ -111,9 +113,9 @@ displayed in the article buffer in a large window, below the summary
buffer in its small window.
@end enumerate
Each Gnus buffer has its own special commands; however, the meanings
of any given key in the various Gnus buffers are usually analogous, even
if not identical. Here are commands for the group and summary buffers:
Each Gnus buffer has its own special commands; the meanings of any
given key in the various Gnus buffers are usually analogous, even if
not identical. Here are commands for the group and summary buffers:
@table @kbd
@kindex q @r{(Gnus Group mode)}
@ -315,9 +317,6 @@ processes; it can also run a shell interactively with input and output
to an Emacs buffer named @samp{*shell*} or run a shell inside a terminal
emulator window.
There is a shell implemented entirely in Emacs, documented in a separate
manual. @xref{Top,Eshell,Eshell, eshell, Eshell: The Emacs Shell}.
@table @kbd
@item M-! @var{cmd} @key{RET}
Run the shell command line @var{cmd} and display the output
@ -333,11 +332,12 @@ You can then give commands interactively.
Run a subshell with input and output through an Emacs buffer.
You can then give commands interactively.
Full terminal emulation is available.
@item M-x eshell
@findex eshell
Start the Emacs shell.
@end table
@kbd{M-x eshell} invokes a shell implemented entirely in Emacs. It
is documented in a separate manual. @xref{Top,Eshell,Eshell, eshell,
Eshell: The Emacs Shell}.
@menu
* Single Shell:: How to run one shell command and return.
* Interactive Shell:: Permanent shell taking input via Emacs.
@ -379,37 +379,38 @@ uncompressed equivalent of @file{foo.gz} into the current buffer.
For a synchronous shell command, @code{shell-command} returns the
command's exit status (0 means success), when it is called from a Lisp
program. You do not get any status information for an asynchronous
command, since it hasn't finished yet.
command, since it hasn't finished yet when @code{shell-command} returns.
@kindex M-|
@findex shell-command-on-region
@kbd{M-|} (@code{shell-command-on-region}) is like @kbd{M-!} but
passes the contents of the region as the standard input to the shell
command, instead of no input. If a numeric argument is used, meaning
insert the output in the current buffer, then the old region is deleted
first and the output replaces it as the contents of the region. It
returns the command's exit status when it is called from a Lisp program.
command, instead of no input. With a numeric argument, meaning insert
the output in the current buffer, it deletes the old region and the
output replaces it as the contents of the region. It returns the
command's exit status, like @kbd{M-!}.
One use for @kbd{M-|} is to run @code{gpg} to see what keys are in
the buffer. For instance, if the buffer contains a GPG key, type
@kbd{C-x h M-| gpg @key{RET}} to feed the entire buffer contents
to the @code{gpg} program. That program will ignore everything except
the encoded keys, and will output a list of the keys it contains.
@kbd{C-x h M-| gpg @key{RET}} to feed the entire buffer contents to
the @code{gpg} program. That program will ignore everything except
the encoded keys, and will output a list of the keys the buffer
contains.
@vindex shell-file-name
Both @kbd{M-!} and @kbd{M-|} use @code{shell-file-name} to specify the
shell to use. This variable is initialized based on your @env{SHELL}
environment variable when Emacs is started. If the file name does not
specify a directory, the directories in the list @code{exec-path} are
searched; this list is initialized based on the environment variable
@env{PATH} when Emacs is started. Your @file{.emacs} file can override
either or both of these default initializations.@refill
Both @kbd{M-!} and @kbd{M-|} use @code{shell-file-name} to specify
the shell to use. This variable is initialized based on your
@env{SHELL} environment variable when Emacs is started. If the file
name is relative, Emacs searches the directories in the list
@code{exec-path}; this list is initialized based on the environment
variable @env{PATH} when Emacs is started. Your @file{.emacs} file
can override either or both of these default initializations.
Both @kbd{M-!} and @kbd{M-|} wait for the shell command to complete,
unless you end the command with @samp{&} to make it asynchronous. To
stop waiting, type @kbd{C-g} to quit; that terminates the shell
command with the signal @code{SIGINT}---the same signal that @kbd{C-c}
normally generates in the shell. Emacs waits until the command
normally generates in the shell. Emacs then waits until the command
actually terminates. If the shell command doesn't stop (because it
ignores the @code{SIGINT} signal), type @kbd{C-g} again; this sends
the command a @code{SIGKILL} signal which is impossible to ignore.
@ -422,10 +423,11 @@ buffer regardless of whether it is visible in a window.
@kbd{C-x @key{RET} c} immediately beforehand. @xref{Communication Coding}.
@vindex shell-command-default-error-buffer
Error output from the command is normally intermixed with the regular
output. If you set the variable
@code{shell-command-default-error-buffer} to a string, which is a buffer
name, error output is inserted before point in the buffer of that name.
Error output from these commands is normally intermixed with the
regular output. But if the variable
@code{shell-command-default-error-buffer} has a string as value, and
it's the name of a buffer, @kbd{M-!} and @kbd{M-|} insert error output
before point in that buffer.
@node Interactive Shell
@subsection Interactive Inferior Shell
@ -456,8 +458,8 @@ previous input lines in the buffer. @xref{Faces}.
prefix argument (e.g. @kbd{C-u M-x shell}), which will read a buffer
name and create (or reuse) a subshell in that buffer. You can also
rename the @samp{*shell*} buffer using @kbd{M-x rename-uniquely}, then
create a new @samp{*shell*} buffer using plain @kbd{M-x shell}. All the
subshells in different buffers run independently and in parallel.
create a new @samp{*shell*} buffer using plain @kbd{M-x shell}.
Subshells in different buffers run independently and in parallel.
@vindex explicit-shell-file-name
@cindex environment variables for subshells
@ -479,9 +481,10 @@ from. For example, if you use bash, the file sent to it is
@file{~/.emacs_bash}.
To specify a coding system for the shell, you can use the command
@kbd{C-x @key{RET} c} immediately before @kbd{M-x shell}. You can also
specify a coding system after starting the shell by using @kbd{C-x
@key{RET} p} in the shell buffer. @xref{Communication Coding}.
@kbd{C-x @key{RET} c} immediately before @kbd{M-x shell}. You can
also change the coding system for a running subshell by typing
@kbd{C-x @key{RET} p} in the shell buffer. @xref{Communication
Coding}.
@cindex @env{EMACS} environment variable
Unless the environment variable @env{EMACS} is already defined,
@ -505,10 +508,10 @@ of the special key bindings of Shell mode:
@kindex RET @r{(Shell mode)}
@findex comint-send-input
At end of buffer send line as input; otherwise, copy current line to
end of buffer and send it (@code{comint-send-input}). When a line is
copied, any prompt at the beginning of the line (text output by
programs preceding your input) is omitted. @xref{Shell Prompts}, for
how Shell mode recognizes prompts.
end of buffer and send it (@code{comint-send-input}). Copying a line
in this way omits any prompt at the beginning of the line (text output
by programs preceding your input). @xref{Shell Prompts}, for how
Shell mode recognizes prompts.
@item @key{TAB}
@kindex TAB @r{(Shell mode)}
@ -2185,7 +2188,7 @@ not use it.
key bindings.
@end table
@node Hyperlinking, Dissociated Press, Emulation, Top
@node Hyperlinking, Thumbnails, Emulation, Top
@section Hyperlinking and Navigation Features
@cindex hyperlinking
@ -2351,7 +2354,76 @@ Display a menu of files and URLs mentioned in current buffer, then
find the one you select (@code{ffap-menu}).
@end table
@node Dissociated Press, Amusements, Hyperlinking, Top
@node Thumbnails, Dissociated Press, Hyperlinking, Top
@section Viewing Images as Thumbnails
@cindex tumme mode
@cindex thumbnails
Tumme is a facility for browsing image files. It provides viewing
the images either as thumbnails or in full size, either inside Emacs
or through an external viewer.
To enter Tumme, type @kbd{M-x tumme}. It prompts for a directory;
specify one that has images files. This creates thumbnails for all
the images in that directory, and displays them all in the ``thumbnail
buffer''. This takes a long time if the directory contains many image
files, and it asks for confirmation if the number of image files
exceeds @code{tumme-show-all-from-dir-max-files}.
@kindex C-t d @r{(Tumme)}
@findex tumme-display-thumbs
You can also enter Tumme through Dired. Mark the image files you
want to look at, using @kbd{m} as usual, then type @kbd{C-t d}
(@code{tumme-display-thumbs}). This too creates and switches to
a buffer containing thumbnails, corresponding to the marked files.
With point in the thumbnail buffer, type @kbd{RET}
(@code{tumme-display-thumbnail-original-image}) to display a sized
version of it in another window. This sizes the image to fit the
window. Use the arrow keys to move around in the buffer. For easy
browing, type @kbd{SPC} (@code{tumme-display-next-thumbnail-original})
to advance and display the next image. Typing @kbd{DEL}
(@code{tumme-display-previous-thumbnail-original}) backs up to the
previous thumbnail and displays that instead.
@vindex tumme-external-viewer
To view and the image in its original size, either provide a prefix
argument (@kbd{C-u}) before pressing @kbd{RET}, or type @kbd{C-@key{RET}}
(@code{tumme-thumbnail-display-external}) to display the image in an
external viewer. You must first configure
@code{tumme-external-viewer}.
You can delete images through Tumme also. Type @kbd{d}
(@code{tumme-flag-thumb-original-file}) to flag the image file for
deletion in the Dired buffer. You can also delete the thumbnail image
from the thumbnail buffer with @kbd{C-d} (@code{tumme-delete-char}).
More advanced features include @dfn{image tags}, which are metadata
used to categorize image files. The tags are stored in a plain text
file configured by @code{tumme-db-file}.
To tag image files, mark them in the dired buffer (you can also mark
files in Dired from the thumbnail buffer by typing @kbd{m}) and type
@kbd{C-t t} (@code{tumme-tag-files}). You will be prompted for a tag.
To mark files having a certain tag, type @kbd{C-t f}
(@code{tumme-mark-tagged-files}). After marking image files with a
certain tag, you can use @kbd{C-t d} to view them.
You can also tag a file directly from the thumbnail buffer by typing
@kbd{t t} and you can remove a tag by typing @kbd{t r}. There is also
a special ``tag'' called ``comment'' for each file (it is not a tag in
the exact same sense as the other tags, it is handled slightly
different). That is used to enter a comment or description about the
image. You comment a file from the thumbnail buffer by typing
@kbd{c}. You will be prompted for a comment. Type @kbd{C-t c} to add
a comment from Dired (@code{tumme-dired-comment-files}).
Tumme also provides simple image manipulation. In the thumbnail
buffer, type @kbd{L} to rotate the original image 90 degrees anti
clockwise, and @kbd{R} to rotate it 90 degrees clockwise. This
rotation is lossless, and uses an external utility called JpegTRAN.
@node Dissociated Press, Amusements, Thumbnails, Top
@section Dissociated Press
@findex dissociated-press
@ -2376,12 +2448,13 @@ That is, if it has just output `president' and then decides to jump
to a different point in the file, it might spot the `ent' in `pentagon'
and continue from there, producing `presidentagon'.@footnote{This
dissociword actually appeared during the Vietnam War, when it was very
appropriate.} Long sample texts produce the best results.
appropriate. Bush has made it appropriate again.} Long sample texts
produce the best results.
@cindex againformation
A positive argument to @kbd{M-x dissociated-press} tells it to operate
character by character, and specifies the number of overlap characters. A
negative argument tells it to operate word by word and specifies the number
negative argument tells it to operate word by word, and specifies the number
of overlap words. In this mode, whole words are treated as the elements to
be permuted, rather than characters. No argument is equivalent to an
argument of two. For your againformation, the output goes only into the
@ -2390,13 +2463,13 @@ buffer @samp{*Dissociation*}. The buffer you start with is not changed.
@cindex Markov chain
@cindex ignoriginal
@cindex techniquitous
Dissociated Press produces nearly the same results as a Markov chain
based on a frequency table constructed from the sample text. It is,
however, an independent, ignoriginal invention. Dissociated Press
Dissociated Press produces results fairly like those of a Markov
chain based on a frequency table constructed from the sample text. It
is, however, an independent, ignoriginal invention. Dissociated Press
techniquitously copies several consecutive characters from the sample
between random choices, whereas a Markov chain would choose randomly for
each word or character. This makes for more plausible sounding results,
and runs faster.
between random choices, whereas a Markov chain would choose randomly
for each word or character. This makes for more plausible sounding
results, and runs faster.
@cindex outragedy
@cindex buggestion
@ -2405,7 +2478,7 @@ and runs faster.
@cindex developediment
@cindex userenced
It is a mustatement that too much use of Dissociated Press can be a
developediment to your real work. Sometimes to the point of outragedy.
developediment to your real work, sometimes to the point of outragedy.
And keep dissociwords out of your documentation, if you want it to be well
userenced and properbose. Have fun. Your buggestions are welcome.
@ -2429,7 +2502,7 @@ which plays the game Go Moku with you.
@findex mpuz
@findex 5x5
@cindex puzzles
@kbd{M-x blackbox}, @kbd{M-x mpuz} and @kbd{M-x 5x5} are kinds of puzzles.
@kbd{M-x blackbox}, @kbd{M-x mpuz} and @kbd{M-x 5x5} are puzzles.
@code{blackbox} challenges you to determine the location of objects
inside a box by tomography. @code{mpuz} displays a multiplication
puzzle with letters standing for digits in a code that you must

View file

@ -2,307 +2,28 @@
@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001,
@c 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
@c See file emacs.texi for copying conditions.
@node MS-DOS, Manifesto, Mac OS, Top
@appendix Emacs and Microsoft Systems
@cindex MS-DOG
@node Emacs and Microsoft Windows, Manifesto, Mac OS, Top
@appendix Emacs and Microsoft Windows
@cindex Microsoft Windows
@cindex MS-DOS peculiarities
This section briefly describes the peculiarities of using Emacs on
the MS-DOS ``operating system'' (also known as ``MS-DOG'') and on
Microsoft Windows.
This section describes peculiarities of using Emacs on Microsoft
Windows. Information about Emacs and Microsoft's older MS-DOS
``operating system'' (also known as ``MS-DOG'') is now in a separate
manual (@inforef{MS-DOG,, emacs-xtra}).
If you build Emacs for MS-DOS, the binary will also run on Windows
3.X, Windows NT, Windows 9X/ME, Windows 2000, or OS/2 as a DOS
application; all the of this chapter applies for all of those systems,
if you use an Emacs that was built for MS-DOS.
However, if you want to use Emacs on Windows, you would normally
build Emacs specifically for Windows. If you do that, most of this
chapter does not apply; instead, you get behavior much closer to what
is documented in the rest of the manual, including support for long
file names, multiple frames, scroll bars, mouse menus, and
subprocesses. However, the section on text files and binary files
does still apply. There are also two sections at the end of this
chapter which apply specifically for the Windows version.
Iif you want to use Emacs on Windows, you would normally build Emacs
specifically for Windows. If you do that, the behavior is reasonably
similar to what is documented in the rest of the manual, including
support for long file names, multiple frames, scroll bars, mouse
menus, and subprocesses. However, a few special considerations apply,
and they are described here.
@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.
* Text and Binary:: Text files on MS-DOS use CRLF to separate lines.
* Printing: MS-DOS Printing. How to specify the printer on MS-DOS.
* I18N: MS-DOS and MULE. Support for internationalization on MS-DOS.
* Processes: MS-DOS Processes. Running subprocesses on MS-DOS.
* Text and Binary:: Text files use CRLF to terminate lines.
* Windows Processes:: Running subprocesses on Windows.
* Windows System Menu:: Controlling what the ALT key does.
@end menu
@node MS-DOS Keyboard
@section 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
(@pxref{Quitting}). 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
(@pxref{Emergency Escape}).
@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
@section 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 (@pxref{Menu Bar}). 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 (@pxref{Mouse References}) 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 (@pxref{Mouse Commands}). 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
@section 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 (@pxref{Frame Parameters}) and the
@code{list-faces-display} command (@pxref{Faces}) 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} (@pxref{Creating Frames}). 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 (@pxref{Frames}). 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
@section File Names on MS-DOS
@cindex file names under MS-DOS
@cindex init file, default name under MS-DOS
MS-DOS normally uses a backslash, @samp{\}, to separate name units
within a file name, instead of the slash used on other systems. Emacs
on MS-DOS permits use of either slash or backslash, and also knows
about drive letters in file names.
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 (@pxref{Init
File}) 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 (@pxref{Backup
Names}) 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, 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 Text and Binary
@section Text Files and Binary Files
@cindex text and binary files on MS-DOS/MS-Windows
@ -419,379 +140,6 @@ always writes those files with DOS-style EOLs.
the file-name patterns in @code{file-name-buffer-file-type-alist}, the
EOL conversion is determined by @code{file-name-buffer-file-type-alist}.
@node MS-DOS Printing
@section Printing and MS-DOS
Printing commands, such as @code{lpr-buffer} (@pxref{Printing}) and
@code{ps-print-buffer} (@pxref{PostScript}) can work in MS-DOS and
MS-Windows 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 and MS-Windows.
@vindex printer-name @r{(MS-DOS)}
If you want to use your local printer, printing on it in the usual DOS
manner, then set the Lisp variable @code{lpr-command} to @code{""} (its
default value) and @code{printer-name} to the name of the printer
port---for example, @code{"PRN"}, the usual local printer port (that's
the default), or @code{"LPT2"}, or @code{"COM1"} for a serial printer.
You can also set @code{printer-name} to a file name, in which case
``printed'' output is actually appended to that file. If you set
@code{printer-name} to @code{"NUL"}, printed output is silently
discarded (sent to the system null device).
On MS-Windows, when the Windows network software is installed, you can
also use a printer shared by another machine by setting
@code{printer-name} to the UNC share name for that printer---for example,
@code{"//joes_pc/hp4si"}. (It doesn't matter whether you use forward
slashes or backslashes here.) To find out the names of shared printers,
run the command @samp{net view} at a DOS command prompt to obtain a list
of servers, and @samp{net view @var{server-name}} to see the names of printers
(and directories) shared by that server. Alternatively, click the
@samp{Network Neighborhood} icon on your desktop, and look for machines
which share their printers via the network.
@cindex @samp{net use}, and printing on MS-Windows
@cindex networked printers (MS-Windows)
If the printer doesn't appear in the output of @samp{net view}, or
if setting @code{printer-name} to the UNC share name doesn't produce a
hardcopy on that printer, you can use the @samp{net use} command to
connect a local print port such as @code{"LPT2"} to the networked
printer. For example, typing @kbd{net use LPT2:
\\joes_pc\hp4si}@footnote{
Note that the @samp{net use} command requires the UNC share name to be
typed with the Windows-style backslashes, while the value of
@code{printer-name} can be set with either forward- or backslashes.}
causes Windows to @dfn{capture} the LPT2 port and redirect the printed
material to the printer connected to the machine @code{joes_pc}.
After this command, setting @code{printer-name} to @code{"LPT2"}
should produce the hardcopy on the networked printer.
With some varieties of Windows network software, you can instruct
Windows to capture a specific printer port such as @code{"LPT2"}, and
redirect it to a networked printer via the @w{@code{Control
Panel->Printers}} applet instead of @samp{net use}.
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}.
If you set @code{printer-name} to a file name, it's best to use an
absolute file name. Emacs changes the working directory according to
the default directory of the current buffer, so if the file name in
@code{printer-name} is relative, you will end up with several such
files, each one in the directory of the buffer from which the printing
was done.
@findex print-buffer @r{(MS-DOS)}
@findex print-region @r{(MS-DOS)}
@vindex lpr-headers-switches @r{(MS-DOS)}
The commands @code{print-buffer} and @code{print-region} call the
@code{pr} program, or use special switches to the @code{lpr} program, to
produce headers on each printed page. MS-DOS and MS-Windows don't
normally have these programs, so by default, the variable
@code{lpr-headers-switches} is set so that the requests to print page
headers are silently ignored. Thus, @code{print-buffer} and
@code{print-region} produce the same output as @code{lpr-buffer} and
@code{lpr-region}, respectively. If you do have a suitable @code{pr}
program (for example, from GNU Textutils), set
@code{lpr-headers-switches} to @code{nil}; Emacs will then call
@code{pr} to produce the page headers, and print the resulting output as
specified by @code{printer-name}.
@vindex print-region-function @r{(MS-DOS)}
@cindex lpr usage under MS-DOS
@vindex lpr-command @r{(MS-DOS)}
@vindex lpr-switches @r{(MS-DOS)}
Finally, if you do have an @code{lpr} work-alike, you can set the
variable @code{lpr-command} to @code{"lpr"}. Then Emacs will use
@code{lpr} for printing, as on other systems. (If the name of the
program isn't @code{lpr}, set @code{lpr-command} to specify where to
find it.) The variable @code{lpr-switches} has its standard meaning
when @code{lpr-command} is not @code{""}. If the variable
@code{printer-name} has a string value, it is used as the value for the
@code{-P} option to @code{lpr}, as on Unix.
@findex ps-print-buffer @r{(MS-DOS)}
@findex ps-spool-buffer @r{(MS-DOS)}
@vindex ps-printer-name @r{(MS-DOS)}
@vindex ps-lpr-command @r{(MS-DOS)}
@vindex ps-lpr-switches @r{(MS-DOS)}
A parallel set of variables, @code{ps-lpr-command},
@code{ps-lpr-switches}, and @code{ps-printer-name} (@pxref{PostScript
Variables}), defines how PostScript files should be printed. These
variables are used in the same way as the corresponding variables
described above for non-PostScript printing. Thus, the value of
@code{ps-printer-name} is used as the name of the device (or file) to
which PostScript output is sent, just as @code{printer-name} is used for
non-PostScript printing. (There are two distinct sets of variables in
case you have two printers attached to two different ports, and only one
of them is a PostScript printer.)
The default value of the variable @code{ps-lpr-command} is @code{""},
which causes PostScript output to be sent to the printer port specified
by @code{ps-printer-name}, but @code{ps-lpr-command} can also be set to
the name of a program which will accept PostScript files. Thus, if you
have a non-PostScript printer, you can set this variable to the name of
a PostScript interpreter program (such as Ghostscript). Any switches
that need to be passed to the interpreter program are specified using
@code{ps-lpr-switches}. (If the value of @code{ps-printer-name} is a
string, it will be added to the list of switches as the value for the
@code{-P} option. This is probably only useful if you are using
@code{lpr}, so when using an interpreter typically you would set
@code{ps-printer-name} to something other than a string so it is
ignored.)
For example, to use Ghostscript for printing on an Epson printer
connected to the @samp{LPT2} port, put this in your @file{_emacs} file:
@example
(setq ps-printer-name t) ; Ghostscript doesn't understand -P
(setq ps-lpr-command "c:/gs/gs386")
(setq ps-lpr-switches '("-q" "-dNOPAUSE"
"-sDEVICE=epson"
"-r240x72"
"-sOutputFile=LPT2"
"-Ic:/gs"))
@end example
@noindent
(This assumes that Ghostscript is installed in the @file{"c:/gs"}
directory.)
@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 and MS-Windows
only.
@node MS-DOS and MULE
@section 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 (@pxref{International}), 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
(@pxref{Initial Options}), 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\-}. @xref{Mode Line}.
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 (@pxref{Language Environments}).
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. @xref{Position Info}.
@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 (@pxref{Text Coding}).
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
@section 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. @xref{Windows
Processes}.
@cindex printing under MS-DOS
Printing commands, such as @code{lpr-buffer} (@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}.
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}.
@node Windows Processes
@section Subprocesses on Windows 9X/ME and Windows NT/2K

View file

@ -605,7 +605,7 @@ system; for example, to visit a file encoded in codepage 850, type
@key{RET}}@footnote{
In the MS-DOS port of Emacs, you need to create a @code{cp@var{nnn}}
coding system with @kbd{M-x codepage-setup}, before you can use it.
@xref{MS-DOS and MULE}.}.
@xref{MS-DOS and MULE,,,emacs-extra,Specialized Emacs Features}.}.
In addition to converting various representations of non-@acronym{ASCII}
characters, a coding system can perform end-of-line conversion. Emacs

View file

@ -1064,7 +1064,7 @@ A formula can be any algebraic expression understood by the Emacs
@file{calc} package. Note that @file{calc} has the slightly
non-standard conversion that @samp{/} has lower precedence than
@samp{*}, so that @samp{a/b*c} is interpreted as @samp{a/(b*c)}. Before
evaluation by @code{calc-eval} (@pxref{Calling Calc from Your Lisp
evaluation by @code{calc-eval} (@pxref{Calling Calc from Your
Programs,calc-eval,Calling calc from Your Lisp Programs,calc,GNU Emacs
Calc Manual}), variable substitution takes place:

View file

@ -360,7 +360,8 @@ usual conventions of the language you are editing.
@item @key{TAB}
Adjust indentation of current line.
@item C-j
Equivalent to @key{RET} followed by @key{TAB} (@code{newline-and-indent}).
Insert a newline, then adjust indentation of following line
(@code{newline-and-indent}).
@end table
@kindex TAB @r{(programming modes)}
@ -385,9 +386,11 @@ the characters around it.
@kindex C-j
@findex newline-and-indent
When entering lines of new code, use @kbd{C-j}
(@code{newline-and-indent}), which is equivalent to @key{RET}
followed by @key{TAB}. @kbd{C-j} at the end of a line creates a
blank line and then gives it the appropriate indentation.
(@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
@ -851,7 +854,7 @@ also do spell checking on comments with Flyspell Prog mode
(@pxref{Spelling}).
@menu
* Comment Commands:: Inserting, killing, and indenting 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.
@end menu
@ -859,6 +862,7 @@ also do spell checking on comments with Flyspell Prog mode
@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.
@ -897,11 +901,11 @@ 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 indents the comment start string to a suitable boundary
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-;} reindents it to
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
@ -931,7 +935,7 @@ 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 indenting certain kinds of
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
@ -982,13 +986,13 @@ 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 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.
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
@ -1058,7 +1062,7 @@ 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 indentation for a newly inserted
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

View file

@ -459,9 +459,9 @@ user agent sends mail. It should be set to a function. The default
is @code{sendmail-send-it}, which delivers mail using the Sendmail
installation on the local host. To send mail through a SMTP server,
set it to @code{smtpmail-send-it} and set up the Emacs SMTP library
(@pxref{Top,, Sending mail via SMTP,smtpmail}). A third option is
@code{feedmail-send-it}, see the commentary section of the
@file{feedmail.el} package for more information.
(@pxref{Top,,Emacs SMTP Library, smtpmail, Sending mail via SMTP}). A
third option is @code{feedmail-send-it}, see the commentary section of
the @file{feedmail.el} package for more information.
@node Header Editing
@subsection Mail Header Editing

File diff suppressed because it is too large Load diff

View file

@ -557,11 +557,11 @@ two spaces for the end of a sentence, as explained above. @xref{Sentences}.
fill commands put two spaces after a colon.
@vindex fill-nobreak-predicate
The variable @code{fill-nobreak-predicate} specifies additional
conditions for where line-breaking is allowed. Its value is either
@code{nil} or a Lisp function; the function is called with no
The variable @code{fill-nobreak-predicate} is a hook (an abnormal
hook, @pxref{Hooks}) specifying additional conditions where
line-breaking is not allowed. Each function is called with no
arguments, with point at a place where Emacs is considering breaking
the line. If the function returns a non-@code{nil} value, then that's
the line. If a function returns a non-@code{nil} value, then that's
a bad place to break the line. Two standard functions you can use are
@code{fill-single-word-nobreak-p} (don't break after the first word of
a sentence or before the last) and @code{fill-french-nobreak-p} (don't

View file

@ -34,36 +34,37 @@ Abort all recursive editing levels that are currently executing.
Cancel a previously made change in the buffer contents (@code{undo}).
@end table
There are two ways of canceling commands which are not finished
executing: @dfn{quitting} with @kbd{C-g}, and @dfn{aborting} with
@kbd{C-]} or @kbd{M-x top-level}. Quitting cancels a partially typed
command or one which is already running. Aborting exits a recursive
editing level and cancels the command that invoked the recursive edit.
There are two ways of canceling a command before it has finished:
@dfn{quitting} with @kbd{C-g}, and @dfn{aborting} with @kbd{C-]} or
@kbd{M-x top-level}. Quitting cancels a partially typed command, or
one which is still running. Aborting exits a recursive editing level
and cancels the command that invoked the recursive edit.
(@xref{Recursive Edit}.)
@cindex quitting
@kindex C-g
Quitting with @kbd{C-g} is used for getting rid of a partially typed
Quitting with @kbd{C-g} is the way to get rid of a partially typed
command, or a numeric argument that you don't want. It also stops a
running command in the middle in a relatively safe way, so you can use
it if you accidentally give a command which takes a long time. In
particular, it is safe to quit out of killing; either your text will
@emph{all} still be in the buffer, or it will @emph{all} be in the kill
ring (or maybe both). Quitting an incremental search does special
things documented under searching; in general, it may take two
successive @kbd{C-g} characters to get out of a search
(@pxref{Incremental Search}).
particular, it is safe to quit out of a kill command; either your text
will @emph{all} still be in the buffer, or it will @emph{all} be in
the kill ring, or maybe both. Quitting an incremental search does
special things, documented under searching; it may take two successive
@kbd{C-g} characters to get out of a search (@pxref{Incremental
Search}).
On MS-DOS, the character @kbd{C-@key{BREAK}} serves as a quit character
like @kbd{C-g}. The reason is that it is not feasible, on MS-DOS, to
recognize @kbd{C-g} while a command is running, between interactions
with the user. By contrast, it @emph{is} feasible to recognize
@kbd{C-@key{BREAK}} at all times. @xref{MS-DOS Keyboard}.
@kbd{C-@key{BREAK}} at all times. @xref{MS-DOS Keyboard,,,emacs-xtra,
Specialized Emacs Features}.
@findex keyboard-quit
@kbd{C-g} works by setting the variable @code{quit-flag} to @code{t}
the instant @kbd{C-g} is typed; Emacs Lisp checks this variable
frequently and quits if it is non-@code{nil}. @kbd{C-g} is only
frequently, and quits if it is non-@code{nil}. @kbd{C-g} is only
actually executed as a command if you type it while Emacs is waiting for
input. In that case, the command it runs is @code{keyboard-quit}.
@ -72,15 +73,15 @@ the first @kbd{C-g} is recognized, you activate the ``emergency
escape'' feature and return to the shell. @xref{Emergency Escape}.
@cindex NFS and quitting
There may be times when you cannot quit. When Emacs is waiting for
the operating system to do something, quitting is impossible unless
special pains are taken for the particular system call within Emacs
where the waiting occurs. We have done this for the system calls that
users are likely to want to quit from, but it's possible you will find
another. In one very common case---waiting for file input or output
using NFS---Emacs itself knows how to quit, but many NFS implementations
simply do not allow user programs to stop waiting for NFS when the NFS
server is hung.
There are some situations where you cannot quit. When Emacs is
waiting for the operating system to do something, quitting is
impossible unless special pains are taken for the particular system
call within Emacs where the waiting occurs. We have done this for the
system calls that users are likely to want to quit from, but it's
possible you will a case not handled. In one very common
case---waiting for file input or output using NFS---Emacs itself knows
how to quit, but many NFS implementations simply do not allow user
programs to stop waiting for NFS when the NFS server is hung.
@cindex aborting recursive edit
@findex abort-recursive-edit
@ -96,16 +97,16 @@ recursive edit.
@findex keyboard-escape-quit
@kindex ESC ESC ESC
The command @kbd{@key{ESC} @key{ESC} @key{ESC}}
(@code{keyboard-escape-quit}) can either quit or abort. This key was
defined because @key{ESC} is used to ``get out'' in many PC programs.
It can cancel a prefix argument, clear a selected region, or get out of
a Query Replace, like @kbd{C-g}. It can get out of the minibuffer or a
recursive edit, like @kbd{C-]}. It can also get out of splitting the
frame into multiple windows, like @kbd{C-x 1}. One thing it cannot do,
however, is stop a command that is running. That's because it executes
as an ordinary command, and Emacs doesn't notice it until it is ready
for a command.
The sequence @kbd{@key{ESC} @key{ESC} @key{ESC}}
(@code{keyboard-escape-quit}) can either quit or abort. (We defined
it this way because @key{ESC} means ``get out'' in many PC programs.)
It can cancel a prefix argument, clear a selected region, or get out
of a Query Replace, like @kbd{C-g}. It can get out of the minibuffer
or a recursive edit, like @kbd{C-]}. It can also get out of splitting
the frame into multiple windows, as with @kbd{C-x 1}. One thing it
cannot do, however, is stop a command that is running. That's because
it executes as an ordinary command, and Emacs doesn't notice it until
it is ready for the next command.
@findex top-level
The command @kbd{M-x top-level} is equivalent to ``enough'' @kbd{C-]}
@ -137,7 +138,6 @@ in the Emacs distribution. Type @kbd{C-h C-f} to read the FAQ; type
* Stuck Recursive:: `[...]' in mode line around the parentheses.
* Screen Garbled:: Garbage on the screen.
* Text Garbled:: Garbage in the text.
* Unasked-for Search:: Spontaneous entry to incremental search.
* 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---
@ -181,10 +181,10 @@ isn't.
In all of those cases, the immediate remedy is the same: use the
command @kbd{M-x normal-erase-is-backspace-mode}. This toggles
between the two modes that Emacs supports for handling @key{DEL}, so
if Emacs starts in the wrong mode, it should switch to the right mode.
On a text-only terminal, if you want to ask for help when @key{BS} is
treated as @key{DEL}, use @key{F1}; @kbd{C-?} may also work, if it
sends character code 127.
if Emacs starts in the wrong mode, this should switch to the right
mode. On a text-only terminal, if you want to ask for help when
@key{BS} is treated as @key{DEL}, use @key{F1}; @kbd{C-?} may also
work, if it sends character code 127.
@findex normal-erase-is-backspace-mode
To fix the problem automatically for every Emacs session, you can
@ -244,25 +244,24 @@ the entire screen. If the screen appears correct after this, the
problem was entirely in the previous screen update. (Otherwise, see
the following section.)
Display updating problems often result from an incorrect termcap entry
for the terminal you are using. The file @file{etc/TERMS} in the Emacs
distribution gives the fixes for known problems of this sort.
@file{INSTALL} contains general advice for these problems in one of its
sections. Very likely there is simply insufficient padding for certain
display operations. To investigate the possibility that you have this sort
of problem, try Emacs on another terminal made by a different manufacturer.
If problems happen frequently on one kind of terminal but not another kind,
it is likely to be a bad termcap entry, though it could also be due to a
bug in Emacs that appears for terminals that have or that lack specific
features.
Display updating problems often result from an incorrect terminfo
entry for the terminal you are using. The file @file{etc/TERMS} in
the Emacs distribution gives the fixes for known problems of this
sort. @file{INSTALL} contains general advice for these problems in
one of its sections. To investigate the possibility that you have
this sort of problem, try Emacs on another terminal made by a
different manufacturer. If problems happen frequently on one kind of
terminal but not another kind, it is likely to be a bad terminfo entry,
though it could also be due to a bug in Emacs that appears for
terminals that have or that lack specific features.
@node Text Garbled
@subsection Garbage in the Text
If @kbd{C-l} shows that the text is wrong, try undoing the changes to it
using @kbd{C-x u} until it gets back to a state you consider correct. Also
try @kbd{C-h l} to find out what command you typed to produce the observed
results.
If @kbd{C-l} shows that the text is wrong, first type @kbd{C-h l} to
see what commands you typed to produce the observed results. Then try
undoing the changes step by step using @kbd{C-x u}, until it gets back
to a state you consider correct.
If a large portion of text appears to be missing at the beginning or
end of the buffer, check for the word @samp{Narrow} in the mode line.
@ -270,42 +269,6 @@ If it appears, the text you don't see is probably still present, but
temporarily off-limits. To make it accessible again, type @kbd{C-x n
w}. @xref{Narrowing}.
@node Unasked-for Search
@subsection Spontaneous Entry to Incremental Search
If Emacs spontaneously displays @samp{I-search:} at the bottom of the
screen, it means that the terminal is sending @kbd{C-s} and @kbd{C-q}
according to the poorly designed xon/xoff ``flow control'' protocol.
If this happens to you, your best recourse is to put the terminal in a
mode where it will not use flow control, or give it so much padding that
it will never send a @kbd{C-s}. (One way to increase the amount of
padding is to set the variable @code{baud-rate} to a larger value. Its
value is the terminal output speed, measured in the conventional units
of baud.)
@cindex flow control
@cindex xon-xoff
@findex enable-flow-control
If you don't succeed in turning off flow control, the next best thing
is to tell Emacs to cope with it. To do this, call the function
@code{enable-flow-control}.
@findex enable-flow-control-on
Typically there are particular terminal types with which you must use
flow control. You can conveniently ask for flow control on those
terminal types only, using @code{enable-flow-control-on}. For example,
if you find you must use flow control on VT-100 and H19 terminals, put
the following in your @file{.emacs} file:
@example
(enable-flow-control-on "vt100" "h19")
@end example
When flow control is enabled, you must type @kbd{C-\} to get the
effect of a @kbd{C-s}, and type @kbd{C-^} to get the effect of a
@kbd{C-q}.
@node Memory Full
@subsection Running out of Memory
@cindex memory full
@ -342,12 +305,13 @@ session files, each with its date. You must choose which session to
recover from. Typically the one you want is the most recent one. Move
point to the one you choose, and type @kbd{C-c C-c}.
Then @code{recover-session} asks about each of the files that you were
editing during that session; it asks whether to recover that file. If
you answer @kbd{y} for a file, it shows the dates of that file and its
auto-save file, then asks once again whether to recover that file. For
the second question, you must confirm with @kbd{yes}. If you do, Emacs
visits the file but gets the text from the auto-save file.
Then @code{recover-session} considers each of the files that you
were editing during that session; for each such file, it asks whether
to recover that file. If you answer @kbd{y} for a file, it shows the
dates of that file and its auto-save file, then asks once again
whether to recover that file. For the second question, you must
confirm with @kbd{yes}. If you do, Emacs visits the file but gets the
text from the auto-save file.
When @code{recover-session} is done, the files you've chosen to
recover are present in Emacs buffers. You should then save them. Only
@ -361,6 +325,9 @@ retrieve them from a core dump--provided that a core dump was saved,
and that the Emacs executable was not stripped of its debugging
symbols.
As soon as you get the core dump, rename it to another name such as
@file{core.emacs}, so that another crash won't overwrite it.
To use this script, run @code{gdb} with the file name of your Emacs
executable and the file name of the core dump, e.g. @samp{gdb
/usr/bin/emacs core.emacs}. At the @code{(gdb)} prompt, load the
@ -375,16 +342,18 @@ not make a backup of its old contents.
@node Emergency Escape
@subsection Emergency Escape
Because at times there have been bugs causing Emacs to loop without
checking @code{quit-flag}, a special feature causes Emacs to be suspended
immediately if you type a second @kbd{C-g} while the flag is already set,
so you can always get out of GNU Emacs. Normally Emacs recognizes and
clears @code{quit-flag} (and quits!) quickly enough to prevent this from
happening. (On MS-DOS and compatible systems, type @kbd{C-@key{BREAK}}
twice.)
On text-only terminals, the @dfn{emergency escape} feature suspends
Emacs immediately if you type @kbd{C-g} a second time before Emacs can
actually respond to the first one by quitting. This is so you can
always get out of GNU Emacs no matter how badly it might be hung.
When things are working properly, Emacs recognizes and handles the
first @kbd{C-g} so fast that the second one won't trigger emergency
escape. However, if some problem prevents Emacs from handling the
first @kbd{C-g} properly, then the second one will get you back to the
shell.
When you resume Emacs after a suspension caused by multiple @kbd{C-g}, it
asks two questions before going back to what it had been doing:
When you resume Emacs after a suspension caused by emergency escape,
it asks two questions before going back to what it had been doing:
@example
Auto-save? (y or n)
@ -394,29 +363,31 @@ Abort (and dump core)? (y or n)
@noindent
Answer each one with @kbd{y} or @kbd{n} followed by @key{RET}.
Saying @kbd{y} to @samp{Auto-save?} causes immediate auto-saving of all
modified buffers in which auto-saving is enabled.
Saying @kbd{y} to @samp{Auto-save?} causes immediate auto-saving of
all modified buffers in which auto-saving is enabled. Saying @kbd{n}
skips this.
Saying @kbd{y} to @samp{Abort (and dump core)?} causes an illegal instruction to be
executed, dumping core. This is to enable a wizard to figure out why Emacs
was failing to quit in the first place. Execution does not continue
after a core dump. If you answer @kbd{n}, execution does continue. With
luck, GNU Emacs will ultimately check @code{quit-flag} and quit normally.
If not, and you type another @kbd{C-g}, it is suspended again.
Saying @kbd{y} to @samp{Abort (and dump core)?} causes Emacs to
crash, dumping core. This is to enable a wizard to figure out why
Emacs was failing to quit in the first place. Execution does not
continue after a core dump.
If you answer this question @kbd{n}, Emacs execution resumes. With
luck, Emacs will ultimately do the requested quit. If not, each
subsequent @kbd{C-g} invokes emergency escape again.
If Emacs is not really hung, just slow, you may invoke the double
@kbd{C-g} feature without really meaning to. Then just resume and answer
@kbd{n} to both questions, and you will arrive at your former state.
Presumably the quit you requested will happen soon.
@kbd{C-g} feature without really meaning to. Then just resume and
answer @kbd{n} to both questions, and you will get back to the former
state. The quit you requested will happen by and by.
The double @kbd{C-g} feature is turned off when Emacs is running under
the X Window System, since you can use the window manager to kill Emacs
or to create another window and run another program.
Emergency escape is active only for text terminals. On a graphical
display that supports multiple windows, you can use the window manager
to kill Emacs, or to switch to some other program.
On MS-DOS and compatible systems, the emergency escape feature is
sometimes unavailable, even if you press @kbd{C-@key{BREAK}} twice, when
some system call (MS-DOS or BIOS) hangs, or when Emacs is stuck in a
very tight endless loop (in C code, @strong{not} in Lisp code).
On MS-DOS, you must type @kbd{C-@key{BREAK}} (twice) to cause
emergency escape---but there are cases where it won't work, when
system call hangs or when Emacs is stuck in a tight loop in C code.
@node Total Frustration
@subsection Help for Total Frustration
@ -433,9 +404,9 @@ you.
@findex doctor
Second, type @kbd{M-x doctor @key{RET}}.
The doctor will help you feel better. Each time you say something to
the doctor, you must end it by typing @key{RET} @key{RET}. This lets
the doctor know you are finished.
The Emacs psychotherapist will help you feel better. Each time you
say something to the psychotherapist, you must end it by typing
@key{RET} @key{RET}. This indicates you are finished typing.
@node Bugs, Contributing, Lossage, Top
@section Reporting Bugs
@ -467,9 +438,10 @@ work-around, or give you additional information about related issues.
@node Bug Criteria
@subsection When Is There a Bug
If Emacs executes an illegal instruction, or dies with an operating
system error message that indicates a problem in the program (as opposed to
something like ``disk full''), then it is certainly a bug.
If Emacs accesses an invalid memory location (``segmentation
fault''), or exits with an operating system error message that
indicates a problem in the program (as opposed to something like
``disk full''), then it is certainly a bug.
If Emacs updates the display in a way that does not correspond to what is
in the buffer, then it is certainly a bug. If a command seems to do the
@ -502,9 +474,10 @@ come to such a conclusion out of ignorance of some of the existing
features. It is probably best not to complain about such a problem
until you have checked the documentation in the usual ways, feel
confident that you understand it, and know for certain that what you
want is not available. If you are not sure what the command is
supposed to do after a careful reading of the manual, check the index
and glossary for any terms that may be unclear.
want is not available. Ask other Emacs users, too. If you are not
sure what the command is supposed to do after a careful reading of the
manual, check the index and glossary for any terms that may be
unclear.
If after careful rereading of the manual you still do not understand
what the command should do, that indicates a bug in the manual, which
@ -533,10 +506,10 @@ implemented, they will be useless; meanwhile, lacking the facts, we will
have no real information about the bug.
For example, suppose that you type @kbd{C-x C-f /glorp/baz.ugh
@key{RET}}, visiting a file which (you know) happens to be rather large,
and Emacs displayed @samp{I feel pretty today}. The best way to report
the bug is with a sentence like the preceding one, because it gives all
the facts.
@key{RET}}, visiting a file which (you know) happens to be rather
large, and Emacs displays @samp{I feel pretty today}. The best way to
report the bug is with a sentence like the preceding one, because it
gives all the facts.
A bad way would be to assume that the problem is due to the size of
the file and say, ``I visited a large file, and Emacs displayed @samp{I
@ -559,7 +532,7 @@ characters you typed since starting the Emacs session.
you @emph{know} that it makes no difference which visiting command is used.
Similarly, rather than saying ``if I have three characters on the line,''
say ``after I type @kbd{@key{RET} A B C @key{RET} C-p},'' if that is
the way you entered the text.@refill
the way you entered the text.
So please don't guess any explanations when you report a bug. If you
want to actually @emph{debug} the problem, and report explanations that
@ -591,19 +564,6 @@ in order to ask you for more information. If your data is more than
instead, offer to send it on request, or make it available by ftp and
say where.
If you can't send electronic mail, then mail the bug report on paper
or machine-readable media to this address:
@format
GNU Emacs Bugs
Free Software Foundation
51 Franklin Street, Fifth Floor
Boston, MA 02110-1301 USA
@end format
We do not promise to fix the bug; but if the bug is serious,
or ugly, or easy to fix, chances are we will want to.
@findex report-emacs-bug
A convenient way to send a bug report for Emacs is to use the command
@kbd{M-x report-emacs-bug}. This sets up a mail buffer (@pxref{Sending
@ -658,7 +618,7 @@ The complete text of any files needed to reproduce the bug.
If you can tell us a way to cause the problem without visiting any files,
please do so. This makes it much easier to debug. If you do need files,
make sure you arrange for us to see their exact contents. For example, it
can often matter whether there are spaces at the ends of lines, or a
can matter whether there are spaces at the ends of lines, or a
newline after the last line in the buffer (nothing ought to care whether
the last line is terminated, but try telling the bugs that).
@ -668,7 +628,7 @@ The precise commands we need to type to reproduce the bug.
@findex open-dribble-file
@cindex dribble file
@cindex logging keystrokes
The easy way to record the input to Emacs precisely is to write a
The easy way to record the input to Emacs precisely is to write a
dribble file. To start the file, execute the Lisp expression
@example
@ -705,7 +665,7 @@ Emacs displays the screen for the first time.
Be warned: it is often difficult, and sometimes impossible, to fix a
terminal-dependent bug without access to a terminal of the type that
stimulates the bug.@refill
stimulates the bug.
@item
If non-@acronym{ASCII} text or internationalization is relevant, the locale that
@ -765,7 +725,7 @@ part.
@pindex Edebug
To make a backtrace for the error, use @kbd{M-x toggle-debug-on-error}
before the error happens (that is to say, you must give that command
and then make the bug happen). This causes the error to run the Lisp
and then make the bug happen). This causes the error to start the Lisp
debugger, which shows you a backtrace. Copy the text of the
debugger's backtrace into the bug report. @xref{Debugger,, The Lisp
Debugger, elisp, the Emacs Lisp Reference Manual}, for information on
@ -1028,11 +988,9 @@ new function, all you need to say about it is that it is new. If you
feel that the purpose needs explaining, it probably does---but put the
explanation in comments in the code. It will be more useful there.
Please read the @file{ChangeLog} files in the @file{src} and @file{lisp}
directories to see what sorts of information to put in, and to learn the
style that we use. If you would like your name to appear in the header
line, showing who made the change, send us the header line.
@xref{Change Log}.
Please read the @file{ChangeLog} files in the @file{src} and
@file{lisp} directories to see what sorts of information to put in,
and to learn the style that we use. @xref{Change Log}.
@item
When you write the fix, keep in mind that we can't install a change that
@ -1071,8 +1029,8 @@ rest of Emacs.
The development version of Emacs can be downloaded from the CVS
repository where it is actively maintained by a group of developers.
See the Emacs project page http://savannah.gnu.org/projects/emacs/ for
details.
See the Emacs project page
@url{http://savannah.gnu.org/projects/emacs/} for details.
@node Service, Copying, Contributing, Top
@section How To Get Help with GNU Emacs

View file

@ -1,3 +1,82 @@
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)
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.

View file

@ -23,6 +23,10 @@ Boston, MA 02110-1301, USA. */
#include <stdio.h>
#include <limits.h> /* For CHAR_BIT. */
#ifdef STDC_HEADERS
#include <stddef.h> /* For offsetof, used by PSEUDOVECSIZE. */
#endif
#ifdef ALLOC_DEBUG
#undef INLINE
#endif
@ -3005,13 +3009,17 @@ allocate_frame ()
struct Lisp_Process *
allocate_process ()
{
EMACS_INT len = VECSIZE (struct Lisp_Process);
struct Lisp_Vector *v = allocate_vectorlike (len, MEM_TYPE_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 < len; ++i)
for (i = 0; i < lisplen; ++i)
v->contents[i] = Qnil;
v->size = len;
v->size = lisplen;
return (struct Lisp_Process *) v;
}
@ -5563,6 +5571,10 @@ mark_object (arg)
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]);
}

View file

@ -1,8 +1,8 @@
/* src/config.in. Generated from configure.in by autoheader. */
/* GNU Emacs site configuration template file.
Copyright (C) 1988, 1993, 1994, 1999, 2000, 2002, 2004, 2005,
2006 Free Software Foundation, Inc.
Copyright (C) 1988, 1993, 1994, 1999, 2000, 2002, 2004, 2005, 2006
Free Software Foundation, Inc.
This file is part of GNU Emacs.

View file

@ -74,6 +74,13 @@ extern char **environ;
#define TM_YEAR_BASE 1900
/* Nonzero if TM_YEAR is a struct tm's tm_year value that causes
asctime to have well-defined behavior. */
#ifndef TM_YEAR_IN_ASCTIME_RANGE
# define TM_YEAR_IN_ASCTIME_RANGE(tm_year) \
(1000 - TM_YEAR_BASE <= (tm_year) && (tm_year) <= 9999 - TM_YEAR_BASE)
#endif
extern size_t emacs_strftimeu P_ ((char *, size_t, const char *,
const struct tm *, int));
static int tm_diff P_ ((struct tm *, struct tm *));
@ -1833,7 +1840,8 @@ usage: (encode-time SECOND MINUTE HOUR DAY MONTH YEAR &optional ZONE) */)
DEFUN ("current-time-string", Fcurrent_time_string, Scurrent_time_string, 0, 1, 0,
doc: /* Return the current time, as a human-readable string.
Programs can use this function to decode a time,
since the number of columns in each field is fixed.
since the number of columns in each field is fixed
if the year is in the range 1000-9999.
The format is `Sun Sep 16 01:03:52 1973'.
However, see also the functions `decode-time' and `format-time-string'
which provide a much more powerful and general facility.
@ -1847,31 +1855,23 @@ but this is considered obsolete. */)
Lisp_Object specified_time;
{
time_t value;
char buf[30];
struct tm *tm;
register char *tem;
if (! lisp_time_argument (specified_time, &value, NULL))
error ("Invalid time specification");
/* Do not use ctime, since it has undefined behavior with
out-of-range time stamps. This avoids a core dump triggered by
(current-time-string '(2814749767106 0)) on 64-bit Solaris 8. See
<http://www.opengroup.org/austin/mailarchives/ag/msg09294.html>
for more details about this portability problem. */
/* Convert to a string, checking for out-of-range time stamps.
Don't use 'ctime', as that might dump core if VALUE is out of
range. */
tm = localtime (&value);
/* Checking for out-of-range time stamps avoids buffer overruns that
cause core dump on some systems (e.g., 64-bit Solaris), and also
preserves the historic behavior of always returning a fixed-size
24-character string. */
if (! (tm && -999 - TM_YEAR_BASE <= tm->tm_year
&& tm->tm_year <= 9999 - TM_YEAR_BASE))
if (! (tm && TM_YEAR_IN_ASCTIME_RANGE (tm->tm_year) && (tem = asctime (tm))))
error ("Specified time is not representable");
tem = asctime (tm);
strncpy (buf, tem, 24);
buf[24] = 0;
/* Remove the trailing newline. */
tem[strlen (tem) - 1] = '\0';
return build_string (buf);
return build_string (tem);
}
/* Yield A - B, measured in seconds.

View file

@ -39,6 +39,8 @@ Boston, MA 02110-1301, USA. */
#include "blockinput.h"
#include "systime.h"
#include <epaths.h>
#include "charset.h"
#include "coding.h"
#ifdef HAVE_X_WINDOWS
@ -2248,8 +2250,8 @@ static unsigned char *slurp_file P_ ((char *, int *));
/* Find image file FILE. Look in data-directory, then
x-bitmap-file-path. Value is the full name of the file found, or
nil if not found. */
x-bitmap-file-path. Value is the encoded full name of the file
found, or nil if not found. */
Lisp_Object
x_find_image_file (file)
@ -2269,7 +2271,10 @@ x_find_image_file (file)
if (fd == -1)
file_found = Qnil;
else
close (fd);
{
file_found = ENCODE_FILE (file_found);
close (fd);
}
UNGCPRO;
return file_found;

Some files were not shown because too many files have changed in this diff Show more