aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenichi Handa2012-09-22 11:26:05 +0900
committerKenichi Handa2012-09-22 11:26:05 +0900
commitfa42927fd0ed023ec95a5475ce342429fd8a348d (patch)
tree5f37f88faa47b36dc85d19aedf89f483dc458358
parent3cccbd87267735609a21df50b80b3aad07004555 (diff)
parent58f3a196fcd6c2f8b65e6b6cf1bc377d1a6287aa (diff)
downloademacs-fa42927fd0ed023ec95a5475ce342429fd8a348d.tar.gz
emacs-fa42927fd0ed023ec95a5475ce342429fd8a348d.zip
merge trunk
-rw-r--r--ChangeLog63
-rw-r--r--Makefile.in22
-rw-r--r--admin/CPP-DEFINES2
-rw-r--r--admin/ChangeLog24
-rw-r--r--admin/admin.el96
-rwxr-xr-xautogen.sh2
-rw-r--r--autogen/Makefile.in1
-rw-r--r--autogen/config.in9
-rwxr-xr-xautogen/configure66
-rwxr-xr-xautogen/copy_autogen15
-rw-r--r--configure.ac48
-rw-r--r--doc/emacs/ChangeLog13
-rw-r--r--doc/emacs/building.texi4
-rw-r--r--doc/emacs/killing.texi2
-rw-r--r--doc/emacs/misc.texi4
-rw-r--r--doc/emacs/trouble.texi25
-rw-r--r--doc/lispref/ChangeLog18
-rw-r--r--doc/lispref/customize.texi73
-rw-r--r--doc/lispref/debugging.texi2
-rw-r--r--doc/lispref/display.texi376
-rw-r--r--doc/lispref/elisp.texi2
-rw-r--r--doc/lispref/text.texi11
-rw-r--r--doc/lispref/variables.texi3
-rw-r--r--etc/ChangeLog26
-rw-r--r--etc/NEWS25
-rw-r--r--etc/TODO7
-rw-r--r--etc/refcards/Makefile27
-rw-r--r--etc/refcards/calccard.tex5
-rw-r--r--etc/refcards/cs-dired-ref.tex3
-rw-r--r--etc/refcards/cs-refcard.tex3
-rw-r--r--etc/refcards/cs-survival.tex3
-rw-r--r--etc/refcards/de-refcard.tex3
-rw-r--r--etc/refcards/dired-ref.tex3
-rw-r--r--etc/refcards/emacsver.tex4
-rw-r--r--etc/refcards/fr-dired-ref.tex3
-rw-r--r--etc/refcards/fr-refcard.tex3
-rw-r--r--etc/refcards/fr-survival.tex3
-rw-r--r--etc/refcards/orgcard.tex2
-rw-r--r--etc/refcards/pl-refcard.tex3
-rw-r--r--etc/refcards/pt-br-refcard.tex3
-rw-r--r--etc/refcards/refcard.tex3
-rw-r--r--etc/refcards/sk-dired-ref.tex3
-rw-r--r--etc/refcards/sk-refcard.tex3
-rw-r--r--etc/refcards/sk-survival.tex3
-rw-r--r--etc/refcards/survival.tex3
-rw-r--r--etc/refcards/vipcard.tex2
-rw-r--r--etc/refcards/viperCard.tex2
-rw-r--r--lib-src/ChangeLog5
-rw-r--r--lib-src/ebrowse.c3
-rw-r--r--lib-src/etags.c3
-rw-r--r--lisp/ChangeLog295
-rw-r--r--lisp/align.el7
-rw-r--r--lisp/autoinsert.el2
-rw-r--r--lisp/bookmark.el5
-rw-r--r--lisp/calc/calc-aent.el3
-rw-r--r--lisp/calc/calc-ext.el2
-rw-r--r--lisp/calc/calc-forms.el2
-rw-r--r--lisp/calc/calc-map.el20
-rw-r--r--lisp/calc/calc-store.el3
-rw-r--r--lisp/calc/calc.el45
-rw-r--r--lisp/calendar/calendar.el75
-rw-r--r--lisp/calendar/diary-lib.el24
-rw-r--r--lisp/calendar/holidays.el6
-rw-r--r--lisp/calendar/lunar.el2
-rw-r--r--lisp/calendar/solar.el2
-rw-r--r--lisp/calendar/timeclock.el4
-rw-r--r--lisp/comint.el6
-rw-r--r--lisp/cus-edit.el5
-rw-r--r--lisp/custom.el112
-rw-r--r--lisp/desktop.el2
-rw-r--r--lisp/dired-aux.el101
-rw-r--r--lisp/dired.el62
-rw-r--r--lisp/doc-view.el123
-rw-r--r--lisp/emacs-lisp/byte-run.el2
-rw-r--r--lisp/emacs-lisp/bytecomp.el16
-rw-r--r--lisp/emacs-lisp/cl-lib.el2
-rw-r--r--lisp/emacs-lisp/debug.el10
-rw-r--r--lisp/emacs-lisp/macroexp.el57
-rw-r--r--lisp/emacs-lisp/shadow.el8
-rw-r--r--lisp/emulation/edt-mapper.el4
-rw-r--r--lisp/emulation/edt.el10
-rw-r--r--lisp/emulation/tpu-edt.el6
-rw-r--r--lisp/emulation/tpu-extras.el2
-rw-r--r--lisp/emulation/tpu-mapper.el2
-rw-r--r--lisp/emulation/vi.el2
-rw-r--r--lisp/emulation/viper.el4
-rw-r--r--lisp/epa-mail.el38
-rw-r--r--lisp/erc/ChangeLog6
-rw-r--r--lisp/erc/erc-button.el2
-rw-r--r--lisp/erc/erc-capab.el2
-rw-r--r--lisp/erc/erc-match.el2
-rw-r--r--lisp/erc/erc-netsplit.el2
-rw-r--r--lisp/erc/erc-page.el2
-rw-r--r--lisp/erc/erc-replace.el2
-rw-r--r--lisp/erc/erc-stamp.el2
-rw-r--r--lisp/erc/erc-track.el2
-rw-r--r--lisp/eshell/em-alias.el8
-rw-r--r--lisp/eshell/esh-util.el2
-rw-r--r--lisp/ffap.el4
-rw-r--r--lisp/filesets.el2
-rw-r--r--lisp/flow-ctrl.el2
-rw-r--r--lisp/font-lock.el2
-rw-r--r--lisp/frame.el2
-rw-r--r--lisp/generic-x.el2
-rw-r--r--lisp/gnus/ChangeLog11
-rw-r--r--lisp/gnus/message.el8
-rw-r--r--lisp/gnus/mml.el68
-rw-r--r--lisp/hi-lock.el6
-rw-r--r--lisp/ibuffer.el12
-rw-r--r--lisp/ido.el23
-rw-r--r--lisp/ielm.el2
-rw-r--r--lisp/international/ogonek.el7
-rw-r--r--lisp/isearch.el4
-rw-r--r--lisp/locate.el2
-rw-r--r--lisp/mail/emacsbug.el11
-rw-r--r--lisp/mail/feedmail.el5
-rw-r--r--lisp/mail/mail-hist.el2
-rw-r--r--lisp/mail/mailabbrev.el47
-rw-r--r--lisp/mail/rmail.el11
-rw-r--r--lisp/mail/rmailedit.el2
-rw-r--r--lisp/mail/rmailmm.el35
-rw-r--r--lisp/mail/uce.el2
-rw-r--r--lisp/mouse-copy.el2
-rw-r--r--lisp/mouse-drag.el2
-rw-r--r--lisp/net/ange-ftp.el14
-rw-r--r--lisp/net/browse-url.el3
-rw-r--r--lisp/net/goto-addr.el2
-rw-r--r--lisp/net/newsticker.el2
-rw-r--r--lisp/net/quickurl.el2
-rw-r--r--lisp/net/tramp-cmds.el2
-rw-r--r--lisp/net/webjump.el2
-rw-r--r--lisp/novice.el4
-rw-r--r--lisp/pcmpl-gnu.el3
-rw-r--r--lisp/pcomplete.el9
-rw-r--r--lisp/play/bubbles.el2
-rw-r--r--lisp/play/decipher.el14
-rw-r--r--lisp/play/handwrite.el2
-rw-r--r--lisp/printing.el10
-rw-r--r--lisp/progmodes/antlr-mode.el2
-rw-r--r--lisp/progmodes/cc-styles.el4
-rw-r--r--lisp/progmodes/cmacexp.el2
-rw-r--r--lisp/progmodes/compile.el51
-rw-r--r--lisp/progmodes/ebnf2ps.el4
-rw-r--r--lisp/progmodes/f90.el5
-rw-r--r--lisp/progmodes/grep.el4
-rw-r--r--lisp/progmodes/hideshow.el2
-rw-r--r--lisp/progmodes/idlw-complete-structtag.el4
-rw-r--r--lisp/progmodes/idlw-shell.el8
-rw-r--r--lisp/progmodes/idlwave.el4
-rw-r--r--lisp/progmodes/inf-lisp.el4
-rw-r--r--lisp/progmodes/mixal-mode.el2
-rw-r--r--lisp/progmodes/octave-mod.el4
-rw-r--r--lisp/progmodes/perl-mode.el4
-rw-r--r--lisp/progmodes/prolog.el4
-rw-r--r--lisp/progmodes/ruby-mode.el44
-rw-r--r--lisp/progmodes/sql.el15
-rw-r--r--lisp/progmodes/verilog-mode.el4
-rw-r--r--lisp/ps-print.el2
-rw-r--r--lisp/replace.el96
-rw-r--r--lisp/saveplace.el12
-rw-r--r--lisp/shell.el36
-rw-r--r--lisp/speedbar.el2
-rw-r--r--lisp/startup.el31
-rw-r--r--lisp/strokes.el9
-rw-r--r--lisp/subr.el4
-rw-r--r--lisp/term/iris-ansi.el2
-rw-r--r--lisp/term/lk201.el2
-rw-r--r--lisp/term/rxvt.el2
-rw-r--r--lisp/term/tvi970.el2
-rw-r--r--lisp/term/wyse50.el2
-rw-r--r--lisp/term/xterm.el2
-rw-r--r--lisp/textmodes/flyspell.el6
-rw-r--r--lisp/textmodes/ispell.el5
-rw-r--r--lisp/textmodes/reftex.el4
-rw-r--r--lisp/textmodes/rst.el538
-rw-r--r--lisp/textmodes/sgml-mode.el2
-rw-r--r--lisp/textmodes/table.el10
-rw-r--r--lisp/textmodes/two-column.el5
-rw-r--r--lisp/time-stamp.el4
-rw-r--r--lisp/url/url-methods.el2
-rw-r--r--lisp/vc/diff.el3
-rw-r--r--lisp/vc/pcvs-defs.el4
-rw-r--r--lisp/vc/vc-git.el2
-rw-r--r--lisp/windmove.el2
-rwxr-xr-xmake-dist18
-rw-r--r--nextstep/ChangeLog19
-rw-r--r--nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings6
-rw-r--r--nextstep/Makefile.in67
-rw-r--r--nextstep/templates/Emacs.desktop.in (renamed from nextstep/GNUstep/Emacs.base/Resources/Emacs.desktop)2
-rw-r--r--nextstep/templates/Info-gnustep.plist.in (renamed from nextstep/GNUstep/Emacs.base/Resources/Info-gnustep.plist)6
-rw-r--r--nextstep/templates/Info.plist.in (renamed from nextstep/Cocoa/Emacs.base/Contents/Info.plist)4
-rw-r--r--nextstep/templates/InfoPlist.strings.in6
-rw-r--r--nt/ChangeLog14
-rw-r--r--nt/config.nt9
-rwxr-xr-xnt/configure.bat5
-rw-r--r--src/ChangeLog165
-rw-r--r--src/Makefile.in9
-rw-r--r--src/alloc.c448
-rw-r--r--src/atimer.c9
-rw-r--r--src/bytecode.c3
-rw-r--r--src/callproc.c25
-rw-r--r--src/conf_post.h1
-rw-r--r--src/dispnew.c2
-rw-r--r--src/emacs.c14
-rw-r--r--src/eval.c23
-rw-r--r--src/fileio.c7
-rw-r--r--src/font.c2
-rw-r--r--src/frame.c97
-rw-r--r--src/image.c8
-rw-r--r--src/intervals.c3
-rw-r--r--src/keyboard.c84
-rw-r--r--src/keyboard.h5
-rw-r--r--src/lisp.h13
-rw-r--r--src/ns.mk39
-rw-r--r--src/nsfns.m13
-rw-r--r--src/nsmenu.m5
-rw-r--r--src/nsterm.m14
-rw-r--r--src/process.c41
-rw-r--r--src/ralloc.c12
-rw-r--r--src/regex.c6
-rw-r--r--src/search.c24
-rw-r--r--src/sysdep.c18
-rw-r--r--src/syssignal.h4
-rw-r--r--src/termhooks.h15
-rw-r--r--src/unexmacosx.c21
-rw-r--r--src/w32gui.h3
-rw-r--r--src/w32inevt.c11
-rw-r--r--src/w32inevt.h2
-rw-r--r--src/w32term.c5
-rw-r--r--src/w32xfns.c132
-rw-r--r--src/window.c6
-rw-r--r--src/window.h15
-rw-r--r--src/xdisp.c49
-rw-r--r--src/xterm.c24
-rw-r--r--test/automated/ruby-mode-tests.el16
235 files changed, 2752 insertions, 2246 deletions
diff --git a/ChangeLog b/ChangeLog
index 8dfe5f2746b..30a431363cc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,66 @@
12012-09-19 Tassilo Horn <tsdh@gnu.org>
2
3 * doc/emacs/misc.texi (DocView Slicing): Document new slice from
4 BoundingBox feature.
5
62012-09-18 Jan Djärv <jan.h.d@swipnet.se>
7
8 * configure.ac (HAVE_GTK): Mention if we use GTK2 or GTK3.
9
102012-09-17 Andreas Schwab <schwab@linux-m68k.org>
11
12 * Makefile.in (bootstrap): Revert last change. Run config.status
13 after config.status --recheck, run configure from $(srcdir).
14 (config.status): Run configure from $(srcdir).
15
162012-09-17 Paul Eggert <eggert@cs.ucla.edu>
17
18 * Makefile.in: Fix build error on FreeBSD.
19 ($(MAKEFILE_NAME)): Pass MAKE='$(MAKE)' to config.status's env.
20 Suggested by Wolfgang Jenker in
21 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00430.html>.
22 (MAKE_CONFIG_STATUS): Remove. Remaining use expanded.
23 This undoes part of the 2012-09-10 patch.
24 (bootstrap): Run ./configure, rather than trying to run config.status
25 if it exists. That builds src/epaths.h more reliably.
26 Run autogen/copy_autogen if autogen.sh fails,
27 to create 'configure'; problem reported by Andreas Schwab in
28 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00438.html>.
29 * autogen.sh: Exit with status 1 when failing due to missing tools,
30 reverting the 2012-09-10 change to this file.
31 * autogen/copy_autogen: Fail if one of the subsidiary actions fail.
32 Use 'cp -f' for the build-aux files, since the destinations are
33 typically read-only.
34
35 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
36 * configure.ac (ac_cv_func_vfork_works): Default to 'no' on
37 Solaris 2.4, so that AC_FUNC_VFORK doesn't think vfork works.
38
392012-09-17 Glenn Morris <rgm@gnu.org>
40
41 * configure.ac (copyright): New output variable.
42 (COPYRIGHT): New AC_DEFINE.
43
442012-09-16 Paul Eggert <eggert@cs.ucla.edu>
45
46 Remove configure's --without-sync-input option (Bug#12450).
47 * configure.ac (SYNC_INPUT, BROKEN_SA_RESTART): Remove.
48
492012-09-16 Glenn Morris <rgm@gnu.org>
50
51 Increase compartmentalization of Nextstep builds rules,
52 and store Emacs version number in fewer versioned files.
53 * configure.ac (ns_appsrc): Use relative names.
54 (ns_frag): Remove.
55 (Info-gnustep.plist, Emacs.desktop, Info.plist, InfoPlist.strings)
56 (nextstep/Makefile): Generate these nextstep files.
57 (SUBDIR_MAKEFILES): Add nextstep.
58 * Makefile.in (clean, distclean, bootstrap-clean): Add nextstep.
59 * make-dist (nextstep/templates): Add directory.
60 (nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj): Remove.
61 (nextstep/Cocoa/Emacs.base/Contents)
62 (nextstep, nextstep/GNUstep/Emacs.base/Resources): Update contents.
63
12012-09-15 Paul Eggert <eggert@cs.ucla.edu> 642012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2 65
3 Port better to POSIX hosts lacking _setjmp (Bug#12446). 66 Port better to POSIX hosts lacking _setjmp (Bug#12446).
diff --git a/Makefile.in b/Makefile.in
index 6ed32491a66..7a38abeca1c 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -358,19 +358,17 @@ blessmail: Makefile src FRC
358MAKEFILE_NAME = Makefile 358MAKEFILE_NAME = Makefile
359$(MAKEFILE_NAME): config.status $(srcdir)/src/config.in \ 359$(MAKEFILE_NAME): config.status $(srcdir)/src/config.in \
360 $(srcdir)/Makefile.in $(SUBDIR_MAKEFILES_IN) 360 $(srcdir)/Makefile.in $(SUBDIR_MAKEFILES_IN)
361 ./config.status 361 MAKE='$(MAKE)' ./config.status
362 362
363# Don't erase these files if make is interrupted while refreshing them. 363# Don't erase these files if make is interrupted while refreshing them.
364.PRECIOUS: Makefile config.status 364.PRECIOUS: Makefile config.status
365 365
366MAKE_CONFIG_STATUS = \ 366config.status: ${srcdir}/configure ${srcdir}/lisp/version.el
367 if [ -x ./config.status ]; then \ 367 if [ -x ./config.status ]; then \
368 ./config.status --recheck; \ 368 ./config.status --recheck; \
369 else \ 369 else \
370 ./configure $(CONFIGURE_FLAGS); \ 370 $(srcdir)/configure $(CONFIGURE_FLAGS); \
371 fi 371 fi
372config.status: ${srcdir}/configure ${srcdir}/lisp/version.el
373 $(MAKE_CONFIG_STATUS)
374 372
375AUTOCONF_INPUTS = $(srcdir)/configure.ac $(srcdir)/aclocal.m4 373AUTOCONF_INPUTS = $(srcdir)/configure.ac $(srcdir)/aclocal.m4
376 374
@@ -737,6 +735,7 @@ clean: FRC
737 -(cd doc/lispref && $(MAKE) $(MFLAGS) clean) 735 -(cd doc/lispref && $(MAKE) $(MFLAGS) clean)
738 -(cd doc/lispintro && $(MAKE) $(MFLAGS) clean) 736 -(cd doc/lispintro && $(MAKE) $(MFLAGS) clean)
739 (cd leim; $(MAKE) $(MFLAGS) clean) 737 (cd leim; $(MAKE) $(MFLAGS) clean)
738 (cd nextstep && $(MAKE) $(MFLAGS) clean)
740 739
741### `bootclean' 740### `bootclean'
742### Delete all files that need to be remade for a clean bootstrap. 741### Delete all files that need to be remade for a clean bootstrap.
@@ -763,6 +762,7 @@ distclean: FRC
763 (cd doc/lispintro && $(MAKE) $(MFLAGS) distclean) 762 (cd doc/lispintro && $(MAKE) $(MFLAGS) distclean)
764 (cd leim; $(MAKE) $(MFLAGS) distclean) 763 (cd leim; $(MAKE) $(MFLAGS) distclean)
765 (cd lisp; $(MAKE) $(MFLAGS) distclean) 764 (cd lisp; $(MAKE) $(MFLAGS) distclean)
765 (cd nextstep && $(MAKE) $(MFLAGS) distclean)
766 ${top_distclean} 766 ${top_distclean}
767 767
768### `bootstrap-clean' 768### `bootstrap-clean'
@@ -780,6 +780,7 @@ bootstrap-clean: FRC
780 -(cd doc/lispintro && $(MAKE) $(MFLAGS) maintainer-clean) 780 -(cd doc/lispintro && $(MAKE) $(MFLAGS) maintainer-clean)
781 (cd leim; $(MAKE) $(MFLAGS) maintainer-clean) 781 (cd leim; $(MAKE) $(MFLAGS) maintainer-clean)
782 (cd lisp; $(MAKE) $(MFLAGS) bootstrap-clean) 782 (cd lisp; $(MAKE) $(MFLAGS) bootstrap-clean)
783 (cd nextstep && $(MAKE) $(MFLAGS) maintainer-clean)
783 [ ! -f config.log ] || mv -f config.log config.log~ 784 [ ! -f config.log ] || mv -f config.log config.log~
784 ${top_bootclean} 785 ${top_bootclean}
785 786
@@ -889,12 +890,17 @@ dvi:
889 890
890# Bootstrapping does the following: 891# Bootstrapping does the following:
891# * Remove files to start from a clean slate. 892# * Remove files to start from a clean slate.
892# * Run autogen.sh, but don't worry about exit status 101 (missing tools). 893# * Run autogen.sh, falling back on copy_autogen if autogen.sh fails.
893# * Build Makefile, to build the build procedure itself. 894# * Build Makefile, to build the build procedure itself.
894# * Do the actual build. 895# * Do the actual build.
895bootstrap: bootstrap-clean FRC 896bootstrap: bootstrap-clean FRC
896 cd $(srcdir) && { ./autogen.sh || test $$? -eq 101; } 897 cd $(srcdir) && { ./autogen.sh || autogen/copy_autogen; }
897 $(MAKE_CONFIG_STATUS) 898 if [ -x config.status ]; then \
899 ./config.status --recheck && \
900 ./config.status; \
901 else \
902 $(srcdir)/configure $(CONFIGURE_FLAGS); \
903 fi
898 $(MAKE) $(MFLAGS) info all 904 $(MAKE) $(MFLAGS) info all
899 905
900.PHONY: check-declare 906.PHONY: check-declare
diff --git a/admin/CPP-DEFINES b/admin/CPP-DEFINES
index 834695d6c78..661cde9c43e 100644
--- a/admin/CPP-DEFINES
+++ b/admin/CPP-DEFINES
@@ -90,7 +90,6 @@ BROKEN_GETWD
90BROKEN_GET_CURRENT_DIR_NAME 90BROKEN_GET_CURRENT_DIR_NAME
91BROKEN_NON_BLOCKING_CONNECT 91BROKEN_NON_BLOCKING_CONNECT
92BROKEN_PTY_READ_AFTER_EAGAIN 92BROKEN_PTY_READ_AFTER_EAGAIN
93BROKEN_SA_RESTART
94CLASH_DETECTION 93CLASH_DETECTION
95DATA_SEG_BITS 94DATA_SEG_BITS
96DATA_START 95DATA_START
@@ -434,7 +433,6 @@ PTY_OPEN
434PTY_TTY_NAME_SPRINTF 433PTY_TTY_NAME_SPRINTF
435PURESIZE 434PURESIZE
436RUN_TIME_REMAP 435RUN_TIME_REMAP
437SA_RESTART
438SETPGRP_RELEASES_CTTY 436SETPGRP_RELEASES_CTTY
439SETUP_SLAVE_PTY 437SETUP_SLAVE_PTY
440SIGALRM 438SIGALRM
diff --git a/admin/ChangeLog b/admin/ChangeLog
index 25eed8af5e3..7f30fe8fc0f 100644
--- a/admin/ChangeLog
+++ b/admin/ChangeLog
@@ -1,3 +1,27 @@
12012-09-17 Glenn Morris <rgm@gnu.org>
2
3 * admin.el (add-log-time-format): Declare.
4
5 * admin.el (cusver-scan, cusver-check): Bind local variables.
6
7 * admin.el (set-version): Set major version in
8 etc/refcards/ru-refcard.tex and etc/refcards/emacsver.tex.
9 (set-copyright): In etc/refcards, only change ru-refcard.tex
10 and emacsver.tex.
11
12 * admin.el (set-copyright): No more need to set copyrights for
13 nextstep, or .c files. Add configure.ac and config.nt.
14
152012-09-16 Paul Eggert <eggert@cs.ucla.edu>
16
17 Remove configure's --without-sync-input option (Bug#12450).
18 * CPP-DEFINES (BROKEN_SA_RESTART, SA_RESTART): Remove.
19
202012-09-16 Glenn Morris <rgm@gnu.org>
21
22 * admin.el (set-version): No more need to set nextstep versions.
23 (set-copyright): Update for moved nextstep files.
24
12012-09-13 Paul Eggert <eggert@cs.ucla.edu> 252012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2 26
3 Simplify SIGIO usage (Bug#12408). 27 Simplify SIGIO usage (Bug#12408).
diff --git a/admin/admin.el b/admin/admin.el
index 6d729214bd0..862e5aed6c1 100644
--- a/admin/admin.el
+++ b/admin/admin.el
@@ -26,6 +26,8 @@
26 26
27;;; Code: 27;;; Code:
28 28
29(defvar add-log-time-format) ; in add-log
30
29(defun add-release-logs (root version) 31(defun add-release-logs (root version)
30 "Add \"Version VERSION released.\" change log entries in ROOT. 32 "Add \"Version VERSION released.\" change log entries in ROOT.
31Root must be the root of an Emacs source tree." 33Root must be the root of an Emacs source tree."
@@ -126,39 +128,16 @@ Root must be the root of an Emacs source tree."
126 (set-version-in-file root "nt/emacsclient.rc" comma-space-version 128 (set-version-in-file root "nt/emacsclient.rc" comma-space-version
127 (rx (and "\"ProductVersion\"" (0+ space) ?, 129 (rx (and "\"ProductVersion\"" (0+ space) ?,
128 (0+ space) ?\" (submatch (1+ (in "0-9, "))) 130 (0+ space) ?\" (submatch (1+ (in "0-9, ")))
129 "\\0\"")))) 131 "\\0\"")))
130 ;; nextstep. 132 (when (string-match "\\([0-9]\\{2,\\}\\)" version)
131 (set-version-in-file 133 (setq version (match-string 1 version))
132 root "nextstep/Cocoa/Emacs.base/Contents/Info.plist" 134 (set-version-in-file root "etc/refcards/ru-refcard.tex" version
133 version (rx (and "CFBundleGetInfoString" (1+ anything) "Emacs" (1+ space) 135 "\\\\newcommand{\\\\versionemacs}\\[0\\]\
134 (submatch (1+ (in "0-9.")))))) 136{\\([0-9]\\{2,\\}\\)}.+%.+version of Emacs")
135 (set-version-in-file 137 (set-version-in-file root "etc/refcards/emacsver.tex" version
136 root "nextstep/Cocoa/Emacs.base/Contents/Info.plist" 138 "\\\\def\\\\versionemacs\
137 version (rx (and "CFBundleShortVersionString" (1+ not-newline) ?\n 139{\\([0-9]\\{2,\\}\\)}.+%.+version of Emacs"))))
138 (0+ not-newline) "<string>" (0+ space) 140
139 (submatch (1+ (in "0-9."))))))
140 (set-version-in-file
141 root "nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings"
142 version (rx (and "CFBundleShortVersionString" (0+ space) ?= (0+ space)
143 ?\" (0+ space) "Version" (1+ space)
144 (submatch (1+ (in "0-9."))))))
145 (set-version-in-file
146 root "nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings"
147 version (rx (and "CFBundleGetInfoString" (0+ space) ?= (0+ space)
148 ?\" (0+ space) "Emacs version" (1+ space)
149 (submatch (1+ (in "0-9."))))))
150 (set-version-in-file
151 root "nextstep/GNUstep/Emacs.base/Resources/Info-gnustep.plist"
152 version (rx (and "ApplicationRelease" (0+ space) ?= (0+ space)
153 ?\" (0+ space) (submatch (1+ (in "0-9."))))))
154 (set-version-in-file
155 root "nextstep/GNUstep/Emacs.base/Resources/Info-gnustep.plist"
156 version (rx (and "FullVersionID" (0+ space) ?= (0+ space)
157 ?\" (0+ space) "Emacs" (1+ space)
158 (submatch (1+ (in "0-9."))))))
159 (set-version-in-file
160 root "nextstep/GNUstep/Emacs.base/Resources/Emacs.desktop"
161 version (rx (and "Version=" (submatch (1+ (in "0-9.")))))))
162 141
163;; Note this makes some assumptions about form of short copyright. 142;; Note this makes some assumptions about form of short copyright.
164(defun set-copyright (root copyright) 143(defun set-copyright (root copyright)
@@ -172,45 +151,24 @@ Root must be the root of an Emacs source tree."
172 (format-time-string "%Y"))))) 151 (format-time-string "%Y")))))
173 (unless (file-exists-p (expand-file-name "src/emacs.c" root)) 152 (unless (file-exists-p (expand-file-name "src/emacs.c" root))
174 (error "%s doesn't seem to be the root of an Emacs source tree" root)) 153 (error "%s doesn't seem to be the root of an Emacs source tree" root))
175 (set-version-in-file root "src/emacs.c" copyright 154 (set-version-in-file root "configure.ac" copyright
176 (rx (and "emacs_copyright" (0+ (not (in ?\"))) 155 (rx (and bol "copyright" (0+ (not (in ?\")))
177 ?\" (submatch (1+ (not (in ?\")))) ?\")))
178 (set-version-in-file root "lib-src/ebrowse.c" copyright
179 (rx (and "emacs_copyright" (0+ (not (in ?\")))
180 ?\" (submatch (1+ (not (in ?\")))) ?\")))
181 (set-version-in-file root "lib-src/etags.c" copyright
182 (rx (and "emacs_copyright" (0+ (not (in ?\")))
183 ?\" (submatch (1+ (not (in ?\")))) ?\"))) 156 ?\" (submatch (1+ (not (in ?\")))) ?\")))
157 (set-version-in-file root "nt/config.nt" copyright
158 (rx (and bol "#" (0+ blank) "define" (1+ blank)
159 "COPYRIGHT" (1+ blank)
160 ?\" (submatch (1+ (not (in ?\")))) ?\")))
184 (set-version-in-file root "lib-src/rcs2log" copyright 161 (set-version-in-file root "lib-src/rcs2log" copyright
185 (rx (and "Copyright" (0+ space) ?= (0+ space) 162 (rx (and "Copyright" (0+ space) ?= (0+ space)
186 ?\' (submatch (1+ nonl))))) 163 ?\' (submatch (1+ nonl)))))
187 ;; This one is a nuisance, as it needs to be split over two lines.
188 (string-match "\\(.*[0-9]\\{4\\} *\\)\\(.*\\)" copyright)
189 ;; nextstep.
190 (set-version-in-file
191 root "nextstep/Cocoa/Emacs.base/Contents/Info.plist"
192 copyright (rx (and "CFBundleGetInfoString" (1+ anything) "Emacs" (1+ space)
193 (1+ (in "0-9.")) (1+ space)
194 (submatch (1+ (not (in ?\<)))))))
195 (set-version-in-file
196 root "nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings"
197 copyright (rx (and "NSHumanReadableCopyright" (0+ space) ?\= (0+ space)
198 ?\" (submatch (1+ (not (in ?\")))))))
199 (set-version-in-file
200 root "nextstep/GNUstep/Emacs.base/Resources/Info-gnustep.plist"
201 copyright (rx (and "Copyright" (0+ space) ?\= (0+ space)
202 ?\" (submatch (1+ (not (in ?\")))))))
203 (when (string-match "\\([0-9]\\{4\\}\\)" copyright) 164 (when (string-match "\\([0-9]\\{4\\}\\)" copyright)
204 (setq copyright (match-string 1 copyright)) 165 (setq copyright (match-string 1 copyright))
205 (dolist (file (directory-files (expand-file-name "etc/refcards" root) 166 (set-version-in-file root "etc/refcards/ru-refcard.tex" copyright
206 t "\\.tex\\'")) 167 "\\\\newcommand{\\\\cyear}\\[0\\]\
207 (unless (string-match "gnus-refcard\\.tex" file) 168{\\([0-9]\\{4\\}\\)}.+%.+copyright year")
208 (set-version-in-file 169 (set-version-in-file root "etc/refcards/emacsver.tex" copyright
209 root file copyright 170 "\\\\def\\\\year\
210 (concat (if (string-match "ru-refcard\\.tex" file) 171{\\([0-9]\\{4\\}\\)}.+%.+copyright year")))
211 "\\\\newcommand{\\\\cyear}\\[0\\]{"
212 "\\\\def\\\\year{")
213 "\\([0-9]\\{4\\}\\)}.+%.+copyright year"))))))
214 172
215;;; Various bits of magic for generating the web manuals 173;;; Various bits of magic for generating the web manuals
216 174
@@ -459,7 +417,7 @@ Also generate PostScript output in PS-DEST."
459 (setq done t)) 417 (setq done t))
460 (t 418 (t
461 (if (eobp) 419 (if (eobp)
462 (error "Parse error in %s" f)) 420 (error "Parse error in %s" f)) ; f is bound in manual-html-node
463 (unless open-td 421 (unless open-td
464 (setq done t)))) 422 (setq done t))))
465 (forward-line 1)))) 423 (forward-line 1))))
@@ -491,7 +449,7 @@ If optional argument OLD is non-nil, also scan for defvars."
491 (let ((m (format "Scanning %s..." file)) 449 (let ((m (format "Scanning %s..." file))
492 (re (format "^[ \t]*\\((def%s\\)[ \t\n]" 450 (re (format "^[ \t]*\\((def%s\\)[ \t\n]"
493 (if old "\\(?:custom\\|var\\)" "custom"))) 451 (if old "\\(?:custom\\|var\\)" "custom")))
494 alist var ver) 452 alist var ver form)
495 (message "%s" m) 453 (message "%s" m)
496 (with-temp-buffer 454 (with-temp-buffer
497 (insert-file-contents file) 455 (insert-file-contents file)
@@ -550,7 +508,7 @@ changes (in a non-trivial way). This function does not check for that."
550 (mapcar 508 (mapcar
551 (lambda (file) 509 (lambda (file)
552 (cons file (cusver-scan file))) newfiles))) 510 (cons file (cusver-scan file))) newfiles)))
553 oldcus result thisfile) 511 oldcus result thisfile file)
554 (message "Reading old defcustoms...") 512 (message "Reading old defcustoms...")
555 (dolist (file oldfiles) 513 (dolist (file oldfiles)
556 (setq oldcus (append oldcus (cusver-scan file t)))) 514 (setq oldcus (append oldcus (cusver-scan file t))))
diff --git a/autogen.sh b/autogen.sh
index dc8d53eec97..9cfaa40eee5 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -201,7 +201,7 @@ This is not recommended - see the comments in \`copy_autogen'.
201Please report any problems with this script to bug-gnu-emacs@gnu.org . 201Please report any problems with this script to bug-gnu-emacs@gnu.org .
202EOF 202EOF
203 203
204 exit 101 # Exit status 101 means tools were missing. 204 exit 1
205fi 205fi
206 206
207echo "Your system has the required tools, running autoreconf..." 207echo "Your system has the required tools, running autoreconf..."
diff --git a/autogen/Makefile.in b/autogen/Makefile.in
index dbedb5d12e5..103a2e94ef3 100644
--- a/autogen/Makefile.in
+++ b/autogen/Makefile.in
@@ -787,6 +787,7 @@ builddir = @builddir@
787cache_file = @cache_file@ 787cache_file = @cache_file@
788canonical = @canonical@ 788canonical = @canonical@
789configuration = @configuration@ 789configuration = @configuration@
790copyright = @copyright@
790datadir = @datadir@ 791datadir = @datadir@
791datarootdir = @datarootdir@ 792datarootdir = @datarootdir@
792docdir = @docdir@ 793docdir = @docdir@
diff --git a/autogen/config.in b/autogen/config.in
index 39e948ee228..2f2555c75c9 100644
--- a/autogen/config.in
+++ b/autogen/config.in
@@ -59,9 +59,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
59/* Define on FreeBSD to work around an issue when reading from a PTY. */ 59/* Define on FreeBSD to work around an issue when reading from a PTY. */
60#undef BROKEN_PTY_READ_AFTER_EAGAIN 60#undef BROKEN_PTY_READ_AFTER_EAGAIN
61 61
62/* Define if SA_RESTART should only be used in batch mode. */
63#undef BROKEN_SA_RESTART
64
65/* Define if the system is compatible with BSD 4.2. */ 62/* Define if the system is compatible with BSD 4.2. */
66#undef BSD4_2 63#undef BSD4_2
67 64
@@ -82,6 +79,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
82 his/her Emacs. */ 79 his/her Emacs. */
83#undef CLASH_DETECTION 80#undef CLASH_DETECTION
84 81
82/* Short copyright string for this version of Emacs. */
83#undef COPYRIGHT
84
85/* Define to one of '_getb67', 'GETB67', 'getb67' for Cray-2 and Cray-YMP 85/* Define to one of '_getb67', 'GETB67', 'getb67' for Cray-2 and Cray-YMP
86 systems. This function is required for 'alloca.c' support on those systems. 86 systems. This function is required for 'alloca.c' support on those systems.
87 */ 87 */
@@ -1295,9 +1295,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
1295/* Define to 1 on System V Release 4. */ 1295/* Define to 1 on System V Release 4. */
1296#undef SVR4 1296#undef SVR4
1297 1297
1298/* Process async input synchronously. */
1299#undef SYNC_INPUT
1300
1301/* Define to use system malloc. */ 1298/* Define to use system malloc. */
1302#undef SYSTEM_MALLOC 1299#undef SYSTEM_MALLOC
1303 1300
diff --git a/autogen/configure b/autogen/configure
index 0cbdd7c732a..3c53c7f1538 100755
--- a/autogen/configure
+++ b/autogen/configure
@@ -1143,6 +1143,7 @@ srcdir
1143canonical 1143canonical
1144configuration 1144configuration
1145version 1145version
1146copyright
1146KRB4LIB 1147KRB4LIB
1147DESLIB 1148DESLIB
1148KRB5LIB 1149KRB5LIB
@@ -1330,8 +1331,7 @@ PACKAGE_NAME
1330PATH_SEPARATOR 1331PATH_SEPARATOR
1331SHELL' 1332SHELL'
1332ac_subst_files='deps_frag 1333ac_subst_files='deps_frag
1333lisp_frag 1334lisp_frag'
1334ns_frag'
1335ac_user_opts=' 1335ac_user_opts='
1336enable_option_checking 1336enable_option_checking
1337with_all 1337with_all
@@ -1343,7 +1343,6 @@ with_mmdf
1343with_mail_unlink 1343with_mail_unlink
1344with_mailhost 1344with_mailhost
1345with_sound 1345with_sound
1346with_sync_input
1347with_x_toolkit 1346with_x_toolkit
1348with_wide_int 1347with_wide_int
1349with_xpm 1348with_xpm
@@ -2061,7 +2060,6 @@ Optional Packages:
2061 --with-mailhost=HOSTNAME 2060 --with-mailhost=HOSTNAME
2062 string giving default POP mail host 2061 string giving default POP mail host
2063 --without-sound don't compile with sound support 2062 --without-sound don't compile with sound support
2064 --without-sync-input don't process async input synchronously
2065 --with-x-toolkit=KIT use an X toolkit (KIT one of: yes or gtk, gtk2, 2063 --with-x-toolkit=KIT use an X toolkit (KIT one of: yes or gtk, gtk2,
2066 gtk3, lucid or athena, motif, no) 2064 gtk3, lucid or athena, motif, no)
2067 --with-wide-int prefer wide Emacs integers (typically 62-bit) 2065 --with-wide-int prefer wide Emacs integers (typically 62-bit)
@@ -3933,20 +3931,6 @@ fi
3933 3931
3934 3932
3935 3933
3936# Check whether --with-sync-input was given.
3937if test "${with_sync_input+set}" = set; then :
3938 withval=$with_sync_input;
3939else
3940 with_sync_input=$with_features
3941fi
3942
3943if test "$with_sync_input" = yes; then
3944
3945$as_echo "#define SYNC_INPUT 1" >>confdefs.h
3946
3947fi
3948
3949
3950# Check whether --with-x-toolkit was given. 3934# Check whether --with-x-toolkit was given.
3951if test "${with_x_toolkit+set}" = set; then : 3935if test "${with_x_toolkit+set}" = set; then :
3952 withval=$with_x_toolkit; case "${withval}" in 3936 withval=$with_x_toolkit; case "${withval}" in
@@ -9414,13 +9398,13 @@ if test "${with_ns}" != no; then
9414 ns_appdir=`pwd`/nextstep/Emacs.app 9398 ns_appdir=`pwd`/nextstep/Emacs.app
9415 ns_appbindir=${ns_appdir}/Contents/MacOS 9399 ns_appbindir=${ns_appdir}/Contents/MacOS
9416 ns_appresdir=${ns_appdir}/Contents/Resources 9400 ns_appresdir=${ns_appdir}/Contents/Resources
9417 ns_appsrc=${srcdir}/nextstep/Cocoa/Emacs.base 9401 ns_appsrc=Cocoa/Emacs.base
9418 elif test -f $GNUSTEP_CONFIG_FILE; then 9402 elif test -f $GNUSTEP_CONFIG_FILE; then
9419 NS_IMPL_GNUSTEP=yes 9403 NS_IMPL_GNUSTEP=yes
9420 ns_appdir=`pwd`/nextstep/Emacs.app 9404 ns_appdir=`pwd`/nextstep/Emacs.app
9421 ns_appbindir=${ns_appdir} 9405 ns_appbindir=${ns_appdir}
9422 ns_appresdir=${ns_appdir}/Resources 9406 ns_appresdir=${ns_appdir}/Resources
9423 ns_appsrc=${srcdir}/nextstep/GNUstep/Emacs.base 9407 ns_appsrc=GNUstep/Emacs.base
9424 GNUSTEP_SYSTEM_HEADERS="$(. $GNUSTEP_CONFIG_FILE; echo $GNUSTEP_SYSTEM_HEADERS)" 9408 GNUSTEP_SYSTEM_HEADERS="$(. $GNUSTEP_CONFIG_FILE; echo $GNUSTEP_SYSTEM_HEADERS)"
9425 GNUSTEP_SYSTEM_LIBRARIES="$(. $GNUSTEP_CONFIG_FILE; echo $GNUSTEP_SYSTEM_LIBRARIES)" 9409 GNUSTEP_SYSTEM_LIBRARIES="$(. $GNUSTEP_CONFIG_FILE; echo $GNUSTEP_SYSTEM_LIBRARIES)"
9426 GNUSTEP_LOCAL_HEADERS="$(. $GNUSTEP_CONFIG_FILE; echo $GNUSTEP_LOCAL_HEADERS)" 9410 GNUSTEP_LOCAL_HEADERS="$(. $GNUSTEP_CONFIG_FILE; echo $GNUSTEP_LOCAL_HEADERS)"
@@ -9510,7 +9494,6 @@ fi
9510 9494
9511INSTALL_ARCH_INDEP_EXTRA=install-etc 9495INSTALL_ARCH_INDEP_EXTRA=install-etc
9512ns_self_contained=no 9496ns_self_contained=no
9513ns_frag=/dev/null
9514NS_OBJ= 9497NS_OBJ=
9515NS_OBJC_OBJ= 9498NS_OBJC_OBJ=
9516if test "${HAVE_NS}" = yes; then 9499if test "${HAVE_NS}" = yes; then
@@ -9534,7 +9517,6 @@ if test "${HAVE_NS}" = yes; then
9534 leimdir="\${ns_appresdir}/leim" 9517 leimdir="\${ns_appresdir}/leim"
9535 INSTALL_ARCH_INDEP_EXTRA= 9518 INSTALL_ARCH_INDEP_EXTRA=
9536 fi 9519 fi
9537 ns_frag=$srcdir/src/ns.mk
9538 NS_OBJC_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o" 9520 NS_OBJC_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o"
9539fi 9521fi
9540CFLAGS="$tmp_CFLAGS" 9522CFLAGS="$tmp_CFLAGS"
@@ -9545,7 +9527,6 @@ CPPFLAGS="$tmp_CPPFLAGS"
9545 9527
9546 9528
9547 9529
9548
9549## $window_system is now set to the window system we will 9530## $window_system is now set to the window system we will
9550## ultimately use. 9531## ultimately use.
9551 9532
@@ -10586,6 +10567,7 @@ $as_echo "#define HAVE_GTK3 1" >>confdefs.h
10586 10567
10587 GTK_OBJ=emacsgtkfixed.o 10568 GTK_OBJ=emacsgtkfixed.o
10588 term_header=gtkutil.h 10569 term_header=gtkutil.h
10570 USE_GTK_TOOLKIT="GTK3"
10589 else 10571 else
10590 check_gtk2=yes 10572 check_gtk2=yes
10591 gtk3_pkg_errors="$GTK_PKG_ERRORS " 10573 gtk3_pkg_errors="$GTK_PKG_ERRORS "
@@ -10653,6 +10635,7 @@ $as_echo "no" >&6; }
10653 then 10635 then
10654 as_fn_error "$gtk3_pkg_errors$GTK_PKG_ERRORS" "$LINENO" 5 10636 as_fn_error "$gtk3_pkg_errors$GTK_PKG_ERRORS" "$LINENO" 5
10655 fi 10637 fi
10638 test "$pkg_check_gtk" = "yes" && USE_GTK_TOOLKIT="GTK2"
10656fi 10639fi
10657 10640
10658if test x"$pkg_check_gtk" = xyes; then 10641if test x"$pkg_check_gtk" = xyes; then
@@ -14508,6 +14491,11 @@ else
14508$as_echo "no" >&6; } 14491$as_echo "no" >&6; }
14509fi 14492fi
14510 14493
14494case $canonical in
14495 *-solaris2.4 | *-solaris2.4.*)
14496 : ${ac_cv_func_vfork_works=no};;
14497esac
14498
14511ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" 14499ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default"
14512if test "x$ac_cv_type_pid_t" = x""yes; then : 14500if test "x$ac_cv_type_pid_t" = x""yes; then :
14513 14501
@@ -15767,9 +15755,6 @@ $as_echo "#define G_SLICE_ALWAYS_MALLOC 1" >>confdefs.h
15767 15755
15768 hpux11) 15756 hpux11)
15769 15757
15770$as_echo "#define BROKEN_SA_RESTART 1" >>confdefs.h
15771
15772
15773$as_echo "#define USG_SUBTTY_WORKS 1" >>confdefs.h 15758$as_echo "#define USG_SUBTTY_WORKS 1" >>confdefs.h
15774 15759
15775 ;; 15760 ;;
@@ -15804,6 +15789,14 @@ fi
15804 15789
15805version=$PACKAGE_VERSION 15790version=$PACKAGE_VERSION
15806 15791
15792copyright="Copyright (C) 2012 Free Software Foundation, Inc."
15793
15794cat >>confdefs.h <<_ACEOF
15795#define COPYRIGHT "$copyright"
15796_ACEOF
15797
15798
15799
15807### Specify what sort of things we'll be editing into Makefile and config.h. 15800### Specify what sort of things we'll be editing into Makefile and config.h.
15808### Use configuration here uncanonicalized to avoid exceeding size limits. 15801### Use configuration here uncanonicalized to avoid exceeding size limits.
15809 15802
@@ -24302,7 +24295,7 @@ fi
24302#### It makes printing result more understandable as using GTK sets 24295#### It makes printing result more understandable as using GTK sets
24303#### toolkit_scroll_bars to yes by default. 24296#### toolkit_scroll_bars to yes by default.
24304if test "${HAVE_GTK}" = "yes"; then 24297if test "${HAVE_GTK}" = "yes"; then
24305 USE_X_TOOLKIT=GTK 24298 USE_X_TOOLKIT="$USE_GTK_TOOLKIT"
24306fi 24299fi
24307 24300
24308echo " 24301echo "
@@ -24391,9 +24384,19 @@ test "${prefix}" != NONE &&
24391test "${exec_prefix}" != NONE && 24384test "${exec_prefix}" != NONE &&
24392 exec_prefix=`echo "${exec_prefix}" | sed 's,\([^/]\)/*$,\1,'` 24385 exec_prefix=`echo "${exec_prefix}" | sed 's,\([^/]\)/*$,\1,'`
24393 24386
24394SUBDIR_MAKEFILES="lib/Makefile lib-src/Makefile oldXMenu/Makefile doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile doc/lispref/Makefile src/Makefile lwlib/Makefile lisp/Makefile leim/Makefile" 24387if test "$HAVE_NS" = "yes"; then
24388 if test "$NS_IMPL_GNUSTEP" = yes; then
24389 ac_config_files="$ac_config_files nextstep/GNUstep/Emacs.base/Resources/Info-gnustep.plist:nextstep/templates/Info-gnustep.plist.in nextstep/GNUstep/Emacs.base/Resources/Emacs.desktop:nextstep/templates/Emacs.desktop.in"
24390
24391 else
24392 ac_config_files="$ac_config_files nextstep/Cocoa/Emacs.base/Contents/Info.plist:nextstep/templates/Info.plist.in nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings:nextstep/templates/InfoPlist.strings.in"
24393
24394 fi
24395fi
24396
24397SUBDIR_MAKEFILES="lib/Makefile lib-src/Makefile oldXMenu/Makefile doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile doc/lispref/Makefile src/Makefile lwlib/Makefile lisp/Makefile leim/Makefile nextstep/Makefile"
24395 24398
24396ac_config_files="$ac_config_files Makefile lib/Makefile lib-src/Makefile oldXMenu/Makefile doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile doc/lispref/Makefile src/Makefile lwlib/Makefile lisp/Makefile leim/Makefile" 24399ac_config_files="$ac_config_files Makefile lib/Makefile lib-src/Makefile oldXMenu/Makefile doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile doc/lispref/Makefile src/Makefile lwlib/Makefile lisp/Makefile leim/Makefile nextstep/Makefile"
24397 24400
24398 24401
24399opt_makefile=test/automated/Makefile 24402opt_makefile=test/automated/Makefile
@@ -25233,6 +25236,10 @@ do
25233 case $ac_config_target in 25236 case $ac_config_target in
25234 "src/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/config.h:src/config.in" ;; 25237 "src/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/config.h:src/config.in" ;;
25235 "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; 25238 "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
25239 "nextstep/GNUstep/Emacs.base/Resources/Info-gnustep.plist") CONFIG_FILES="$CONFIG_FILES nextstep/GNUstep/Emacs.base/Resources/Info-gnustep.plist:nextstep/templates/Info-gnustep.plist.in" ;;
25240 "nextstep/GNUstep/Emacs.base/Resources/Emacs.desktop") CONFIG_FILES="$CONFIG_FILES nextstep/GNUstep/Emacs.base/Resources/Emacs.desktop:nextstep/templates/Emacs.desktop.in" ;;
25241 "nextstep/Cocoa/Emacs.base/Contents/Info.plist") CONFIG_FILES="$CONFIG_FILES nextstep/Cocoa/Emacs.base/Contents/Info.plist:nextstep/templates/Info.plist.in" ;;
25242 "nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings") CONFIG_FILES="$CONFIG_FILES nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings:nextstep/templates/InfoPlist.strings.in" ;;
25236 "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; 25243 "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
25237 "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; 25244 "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;;
25238 "lib-src/Makefile") CONFIG_FILES="$CONFIG_FILES lib-src/Makefile" ;; 25245 "lib-src/Makefile") CONFIG_FILES="$CONFIG_FILES lib-src/Makefile" ;;
@@ -25245,6 +25252,7 @@ do
25245 "lwlib/Makefile") CONFIG_FILES="$CONFIG_FILES lwlib/Makefile" ;; 25252 "lwlib/Makefile") CONFIG_FILES="$CONFIG_FILES lwlib/Makefile" ;;
25246 "lisp/Makefile") CONFIG_FILES="$CONFIG_FILES lisp/Makefile" ;; 25253 "lisp/Makefile") CONFIG_FILES="$CONFIG_FILES lisp/Makefile" ;;
25247 "leim/Makefile") CONFIG_FILES="$CONFIG_FILES leim/Makefile" ;; 25254 "leim/Makefile") CONFIG_FILES="$CONFIG_FILES leim/Makefile" ;;
25255 "nextstep/Makefile") CONFIG_FILES="$CONFIG_FILES nextstep/Makefile" ;;
25248 "test/automated/Makefile") CONFIG_FILES="$CONFIG_FILES test/automated/Makefile" ;; 25256 "test/automated/Makefile") CONFIG_FILES="$CONFIG_FILES test/automated/Makefile" ;;
25249 "admin/unidata/Makefile") CONFIG_FILES="$CONFIG_FILES admin/unidata/Makefile" ;; 25257 "admin/unidata/Makefile") CONFIG_FILES="$CONFIG_FILES admin/unidata/Makefile" ;;
25250 "mkdirs") CONFIG_COMMANDS="$CONFIG_COMMANDS mkdirs" ;; 25258 "mkdirs") CONFIG_COMMANDS="$CONFIG_COMMANDS mkdirs" ;;
diff --git a/autogen/copy_autogen b/autogen/copy_autogen
index b6af9b6eb35..8aacd4d399a 100755
--- a/autogen/copy_autogen
+++ b/autogen/copy_autogen
@@ -8,7 +8,7 @@
8## regenerate configure and will fail if you do not have the required 8## regenerate configure and will fail if you do not have the required
9## tools. You will have to run this script again. 9## tools. You will have to run this script again.
10 10
11test -d autogen && cd autogen 11test ! -d autogen || cd autogen || exit
12 12
13if test ! -e config.in; then 13if test ! -e config.in; then
14 echo "Cannot find autogen/ directory." 14 echo "Cannot find autogen/ directory."
@@ -16,11 +16,12 @@ if test ! -e config.in; then
16fi 16fi
17 17
18## Order implied by top-level Makefile's rules, for time-stamps. 18## Order implied by top-level Makefile's rules, for time-stamps.
19cp compile config.guess config.sub depcomp install-sh missing ../build-aux 19cp -f compile config.guess config.sub depcomp install-sh missing \
20cp aclocal.m4 ../ 20 ../build-aux &&
21cp configure ../ 21cp aclocal.m4 ../ &&
22touch ../src/stamp-h.in 22cp configure ../ &&
23cp config.in ../src/ 23touch ../src/stamp-h.in &&
24cp Makefile.in ../lib/ 24cp config.in ../src/ &&
25cp Makefile.in ../lib/ &&
25 26
26echo "You can now run configure" 27echo "You can now run configure"
diff --git a/configure.ac b/configure.ac
index f810c839587..a6462f7959a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -128,11 +128,6 @@ AC_ARG_WITH([mailhost],[AS_HELP_STRING([--with-mailhost=HOSTNAME],
128 128
129OPTION_DEFAULT_ON([sound],[don't compile with sound support]) 129OPTION_DEFAULT_ON([sound],[don't compile with sound support])
130 130
131OPTION_DEFAULT_ON([sync-input],[don't process async input synchronously])
132if test "$with_sync_input" = yes; then
133 AC_DEFINE(SYNC_INPUT, 1, [Process async input synchronously.])
134fi
135
136dnl FIXME currently it is not the last. 131dnl FIXME currently it is not the last.
137dnl This should be the last --with option, because --with-x is 132dnl This should be the last --with option, because --with-x is
138dnl added later on when we find the path of X, and it's best to 133dnl added later on when we find the path of X, and it's best to
@@ -1461,13 +1456,13 @@ if test "${with_ns}" != no; then
1461 ns_appdir=`pwd`/nextstep/Emacs.app 1456 ns_appdir=`pwd`/nextstep/Emacs.app
1462 ns_appbindir=${ns_appdir}/Contents/MacOS 1457 ns_appbindir=${ns_appdir}/Contents/MacOS
1463 ns_appresdir=${ns_appdir}/Contents/Resources 1458 ns_appresdir=${ns_appdir}/Contents/Resources
1464 ns_appsrc=${srcdir}/nextstep/Cocoa/Emacs.base 1459 ns_appsrc=Cocoa/Emacs.base
1465 elif test -f $GNUSTEP_CONFIG_FILE; then 1460 elif test -f $GNUSTEP_CONFIG_FILE; then
1466 NS_IMPL_GNUSTEP=yes 1461 NS_IMPL_GNUSTEP=yes
1467 ns_appdir=`pwd`/nextstep/Emacs.app 1462 ns_appdir=`pwd`/nextstep/Emacs.app
1468 ns_appbindir=${ns_appdir} 1463 ns_appbindir=${ns_appdir}
1469 ns_appresdir=${ns_appdir}/Resources 1464 ns_appresdir=${ns_appdir}/Resources
1470 ns_appsrc=${srcdir}/nextstep/GNUstep/Emacs.base 1465 ns_appsrc=GNUstep/Emacs.base
1471 dnl FIXME sourcing this several times in subshells seems inefficient. 1466 dnl FIXME sourcing this several times in subshells seems inefficient.
1472 GNUSTEP_SYSTEM_HEADERS="$(. $GNUSTEP_CONFIG_FILE; echo $GNUSTEP_SYSTEM_HEADERS)" 1467 GNUSTEP_SYSTEM_HEADERS="$(. $GNUSTEP_CONFIG_FILE; echo $GNUSTEP_SYSTEM_HEADERS)"
1473 GNUSTEP_SYSTEM_LIBRARIES="$(. $GNUSTEP_CONFIG_FILE; echo $GNUSTEP_SYSTEM_LIBRARIES)" 1468 GNUSTEP_SYSTEM_LIBRARIES="$(. $GNUSTEP_CONFIG_FILE; echo $GNUSTEP_SYSTEM_LIBRARIES)"
@@ -1521,7 +1516,6 @@ AC_SUBST(TEMACS_LDFLAGS2)
1521 1516
1522INSTALL_ARCH_INDEP_EXTRA=install-etc 1517INSTALL_ARCH_INDEP_EXTRA=install-etc
1523ns_self_contained=no 1518ns_self_contained=no
1524ns_frag=/dev/null
1525NS_OBJ= 1519NS_OBJ=
1526NS_OBJC_OBJ= 1520NS_OBJC_OBJ=
1527if test "${HAVE_NS}" = yes; then 1521if test "${HAVE_NS}" = yes; then
@@ -1548,7 +1542,6 @@ if test "${HAVE_NS}" = yes; then
1548 leimdir="\${ns_appresdir}/leim" 1542 leimdir="\${ns_appresdir}/leim"
1549 INSTALL_ARCH_INDEP_EXTRA= 1543 INSTALL_ARCH_INDEP_EXTRA=
1550 fi 1544 fi
1551 ns_frag=$srcdir/src/ns.mk
1552 NS_OBJC_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o" 1545 NS_OBJC_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o"
1553fi 1546fi
1554CFLAGS="$tmp_CFLAGS" 1547CFLAGS="$tmp_CFLAGS"
@@ -1558,7 +1551,6 @@ AC_SUBST(ns_self_contained)
1558AC_SUBST(NS_OBJ) 1551AC_SUBST(NS_OBJ)
1559AC_SUBST(NS_OBJC_OBJ) 1552AC_SUBST(NS_OBJC_OBJ)
1560AC_SUBST(LIB_STANDARD) 1553AC_SUBST(LIB_STANDARD)
1561AC_SUBST_FILE(ns_frag)
1562 1554
1563## $window_system is now set to the window system we will 1555## $window_system is now set to the window system we will
1564## ultimately use. 1556## ultimately use.
@@ -1922,6 +1914,7 @@ if test "${with_gtk3}" = "yes" || test "${with_gtk}" = "yes" || test "$USE_X_TOO
1922 AC_DEFINE(HAVE_GTK3, 1, [Define to 1 if using GTK 3 or later.]) 1914 AC_DEFINE(HAVE_GTK3, 1, [Define to 1 if using GTK 3 or later.])
1923 GTK_OBJ=emacsgtkfixed.o 1915 GTK_OBJ=emacsgtkfixed.o
1924 term_header=gtkutil.h 1916 term_header=gtkutil.h
1917 USE_GTK_TOOLKIT="GTK3"
1925 else 1918 else
1926 check_gtk2=yes 1919 check_gtk2=yes
1927 gtk3_pkg_errors="$GTK_PKG_ERRORS " 1920 gtk3_pkg_errors="$GTK_PKG_ERRORS "
@@ -1940,6 +1933,7 @@ if test "${with_gtk2}" = "yes" || test "$check_gtk2" = "yes"; then
1940 then 1933 then
1941 AC_MSG_ERROR($gtk3_pkg_errors$GTK_PKG_ERRORS) 1934 AC_MSG_ERROR($gtk3_pkg_errors$GTK_PKG_ERRORS)
1942 fi 1935 fi
1936 test "$pkg_check_gtk" = "yes" && USE_GTK_TOOLKIT="GTK2"
1943fi 1937fi
1944 1938
1945if test x"$pkg_check_gtk" = xyes; then 1939if test x"$pkg_check_gtk" = xyes; then
@@ -3163,6 +3157,14 @@ else
3163 AC_MSG_RESULT(no) 3157 AC_MSG_RESULT(no)
3164fi 3158fi
3165 3159
3160dnl Check for a Solaris 2.4 vfork bug that Autoconf misses (through 2.69).
3161dnl This can be removed once we assume Autoconf 2.70.
3162case $canonical in
3163 *-solaris2.4 | *-solaris2.4.*)
3164 dnl Disable the Autoconf-generated vfork test.
3165 : ${ac_cv_func_vfork_works=no};;
3166esac
3167
3166AC_FUNC_FORK 3168AC_FUNC_FORK
3167 3169
3168AC_CHECK_FUNCS(snprintf) 3170AC_CHECK_FUNCS(snprintf)
@@ -3952,11 +3954,6 @@ case $opsys in
3952 ;; 3954 ;;
3953 3955
3954 hpux11) 3956 hpux11)
3955 dnl See comments in sysdep.c:sys_signal.
3956 dnl SA_RESTART resets the timeout of `select' on hpux11.
3957 dnl Defining BROKEN_SA_RESTART is not the same as undef'ing SA_RESTART.
3958 AC_DEFINE(BROKEN_SA_RESTART, 1, [Define if SA_RESTART should only
3959 be used in batch mode.])
3960 dnl It works to open the pty's tty in the parent (Emacs), then 3957 dnl It works to open the pty's tty in the parent (Emacs), then
3961 dnl close and reopen it in the child. 3958 dnl close and reopen it in the child.
3962 AC_DEFINE(USG_SUBTTY_WORKS, 1, [Define for USG systems where it 3959 AC_DEFINE(USG_SUBTTY_WORKS, 1, [Define for USG systems where it
@@ -3991,6 +3988,11 @@ fi
3991 3988
3992version=$PACKAGE_VERSION 3989version=$PACKAGE_VERSION
3993 3990
3991copyright="Copyright (C) 2012 Free Software Foundation, Inc."
3992AC_DEFINE_UNQUOTED(COPYRIGHT, ["$copyright"],
3993 [Short copyright string for this version of Emacs.])
3994AC_SUBST(copyright)
3995
3994### Specify what sort of things we'll be editing into Makefile and config.h. 3996### Specify what sort of things we'll be editing into Makefile and config.h.
3995### Use configuration here uncanonicalized to avoid exceeding size limits. 3997### Use configuration here uncanonicalized to avoid exceeding size limits.
3996AC_SUBST(version) 3998AC_SUBST(version)
@@ -4396,7 +4398,7 @@ End:
4396#### It makes printing result more understandable as using GTK sets 4398#### It makes printing result more understandable as using GTK sets
4397#### toolkit_scroll_bars to yes by default. 4399#### toolkit_scroll_bars to yes by default.
4398if test "${HAVE_GTK}" = "yes"; then 4400if test "${HAVE_GTK}" = "yes"; then
4399 USE_X_TOOLKIT=GTK 4401 USE_X_TOOLKIT="$USE_GTK_TOOLKIT"
4400fi 4402fi
4401 4403
4402echo " 4404echo "
@@ -4484,6 +4486,16 @@ fi
4484test "${exec_prefix}" != NONE && 4486test "${exec_prefix}" != NONE &&
4485 exec_prefix=`echo "${exec_prefix}" | sed 's,\([^/]\)/*$,\1,'`] 4487 exec_prefix=`echo "${exec_prefix}" | sed 's,\([^/]\)/*$,\1,'`]
4486 4488
4489if test "$HAVE_NS" = "yes"; then
4490 if test "$NS_IMPL_GNUSTEP" = yes; then
4491 AC_CONFIG_FILES([nextstep/GNUstep/Emacs.base/Resources/Info-gnustep.plist:nextstep/templates/Info-gnustep.plist.in \
4492 nextstep/GNUstep/Emacs.base/Resources/Emacs.desktop:nextstep/templates/Emacs.desktop.in])
4493 else
4494 AC_CONFIG_FILES([nextstep/Cocoa/Emacs.base/Contents/Info.plist:nextstep/templates/Info.plist.in \
4495 nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings:nextstep/templates/InfoPlist.strings.in])
4496 fi
4497fi
4498
4487dnl Obviously there is duplication here wrt $SUBDIR_MAKEFILES. 4499dnl Obviously there is duplication here wrt $SUBDIR_MAKEFILES.
4488dnl You _can_ use that variable in AC_CONFIG_FILES, so long as any directory 4500dnl You _can_ use that variable in AC_CONFIG_FILES, so long as any directory
4489dnl using automake (ie lib/) is explicitly listed and not "hidden" in a variable 4501dnl using automake (ie lib/) is explicitly listed and not "hidden" in a variable
@@ -4492,12 +4504,12 @@ dnl This will work, but you get a config.status that is not quite right
4492dnl (see http://lists.gnu.org/archive/html/bug-autoconf/2008-08/msg00028.html). 4504dnl (see http://lists.gnu.org/archive/html/bug-autoconf/2008-08/msg00028.html).
4493dnl That doesn't have any obvious consequences for Emacs, but on the whole 4505dnl That doesn't have any obvious consequences for Emacs, but on the whole
4494dnl it seems better to just live with the duplication. 4506dnl it seems better to just live with the duplication.
4495SUBDIR_MAKEFILES="lib/Makefile lib-src/Makefile oldXMenu/Makefile doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile doc/lispref/Makefile src/Makefile lwlib/Makefile lisp/Makefile leim/Makefile" 4507SUBDIR_MAKEFILES="lib/Makefile lib-src/Makefile oldXMenu/Makefile doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile doc/lispref/Makefile src/Makefile lwlib/Makefile lisp/Makefile leim/Makefile nextstep/Makefile"
4496 4508
4497AC_CONFIG_FILES([Makefile lib/Makefile lib-src/Makefile oldXMenu/Makefile \ 4509AC_CONFIG_FILES([Makefile lib/Makefile lib-src/Makefile oldXMenu/Makefile \
4498 doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile \ 4510 doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile \
4499 doc/lispref/Makefile src/Makefile lwlib/Makefile lisp/Makefile \ 4511 doc/lispref/Makefile src/Makefile lwlib/Makefile lisp/Makefile \
4500 leim/Makefile]) 4512 leim/Makefile nextstep/Makefile])
4501 4513
4502dnl test/ is not present in release tarfiles. 4514dnl test/ is not present in release tarfiles.
4503opt_makefile=test/automated/Makefile 4515opt_makefile=test/automated/Makefile
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index 508dbbf8021..8d3fc2b3e0c 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,16 @@
12012-09-21 Paul Eggert <eggert@cs.ucla.edu>
2
3 * trouble.texi (Crashing): Document addr2line.
4
52012-09-19 Chong Yidong <cyd@gnu.org>
6
7 * killing.texi (Yanking): Minor clarification (Bug#12469).
8
92012-09-17 Chong Yidong <cyd@gnu.org>
10
11 * building.texi (GDB User Interface Layout): Remove reference to
12 removed variable gdb-use-separate-io-buffer (Bug#12454).
13
12012-09-08 Jambunathan K <kjambunathan@gmail.com> 142012-09-08 Jambunathan K <kjambunathan@gmail.com>
2 15
3 * regs.texi (Text Registers): `C-x r +' can now be used instead of 16 * regs.texi (Text Registers): `C-x r +' can now be used instead of
diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi
index 05ea667e5f7..21948f181fb 100644
--- a/doc/emacs/building.texi
+++ b/doc/emacs/building.texi
@@ -888,10 +888,6 @@ displays the following frame layout:
888@end group 888@end group
889@end smallexample 889@end smallexample
890 890
891 However, if @code{gdb-use-separate-io-buffer} is @code{nil}, the I/O
892buffer does not appear and the primary source buffer occupies the full
893width of the frame.
894
895@findex gdb-restore-windows 891@findex gdb-restore-windows
896@findex gdb-many-windows 892@findex gdb-many-windows
897 If you ever change the window layout, you can restore the ``many 893 If you ever change the window layout, you can restore the ``many
diff --git a/doc/emacs/killing.texi b/doc/emacs/killing.texi
index a034c6168aa..1eb53d0d2ec 100644
--- a/doc/emacs/killing.texi
+++ b/doc/emacs/killing.texi
@@ -289,7 +289,7 @@ e.g. @kbd{C-u 4 C-y} reinserts the fourth most recent kill.
289 289
290 On graphical displays, @kbd{C-y} first checks if another application 290 On graphical displays, @kbd{C-y} first checks if another application
291has placed any text in the system clipboard more recently than the 291has placed any text in the system clipboard more recently than the
292last Emacs kill. If so, it inserts the text in the clipboard instead. 292last Emacs kill. If so, it inserts the clipboard's text instead.
293Thus, Emacs effectively treats ``cut'' or ``copy'' clipboard 293Thus, Emacs effectively treats ``cut'' or ``copy'' clipboard
294operations performed in other applications like Emacs kills, except 294operations performed in other applications like Emacs kills, except
295that they are not recorded in the kill ring. @xref{Cut and Paste}, 295that they are not recorded in the kill ring. @xref{Cut and Paste},
diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi
index 90072d19a69..5d7a51a01f5 100644
--- a/doc/emacs/misc.texi
+++ b/doc/emacs/misc.texi
@@ -411,6 +411,10 @@ m} (@code{doc-view-set-slice-using-mouse}), where you use the mouse to
411select the slice. 411select the slice.
412@c ??? How does this work? 412@c ??? How does this work?
413 413
414 The most convenient way is to set the optimal slice by using
415BoundingBox information automatically determined from the document by
416typing @kbd{s b} (@code{doc-view-set-slice-using-mouse}).
417
414@findex doc-view-reset-slice 418@findex doc-view-reset-slice
415 To cancel the selected slice, type @kbd{s r} 419 To cancel the selected slice, type @kbd{s r}
416(@code{doc-view-reset-slice}). Then DocView shows the entire page 420(@code{doc-view-reset-slice}). Then DocView shows the entire page
diff --git a/doc/emacs/trouble.texi b/doc/emacs/trouble.texi
index 1806339e45d..ad270aec232 100644
--- a/doc/emacs/trouble.texi
+++ b/doc/emacs/trouble.texi
@@ -308,13 +308,26 @@ emacs[0x565151]
308 308
309@noindent 309@noindent
310The number @samp{11} is the system signal number that corresponds to 310The number @samp{11} is the system signal number that corresponds to
311the problem, a segmentation fault here. The hexadecimal program 311the problem, a segmentation fault here. The three dots at the end
312addresses can be useful in debugging sessions. For example, the GDB 312indicate that Emacs suppressed further backtrace entries, in the
313command @samp{list *0x509af6} prints the source-code lines 313interest of brevity.
314corresponding to the @samp{emacs[0x509af6]} entry in the backtrace.
315 314
316The three dots at the end indicate that Emacs suppressed further 315The hexadecimal program addresses can be useful in debugging sessions.
317backtrace entries, in the interest of brevity. 316For example, the GDB command @samp{list *0x509af6} prints the
317source-code lines corresponding to the @samp{emacs[0x509af6]} entry in
318the backtrace. Or, if your system has @command{addr2line}, the
319following shell command outputs a backtrace with source-code line
320numbers:
321
322@example
323sed -n 's/.*\[\(.*\)]$/\1/p' @var{backtrace} |
324 addr2line -Cfip -e @var{bindir}/emacs
325@end example
326
327@noindent
328Here, @var{backtrace} is the name of a text file containing a copy of
329the backtrace, and @var{bindir} is the name of the directory that
330contains the Emacs executable.
318 331
319@node After a Crash 332@node After a Crash
320@subsection Recovery After a Crash 333@subsection Recovery After a Crash
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index ce99c81a912..c29b9e12129 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,21 @@
12012-09-21 Glenn Morris <rgm@gnu.org>
2
3 * debugging.texi (Using Debugger): Fix typo.
4
52012-09-18 Chong Yidong <cyd@gnu.org>
6
7 * display.texi (Faces): Discuss anonymous faces.
8 (Face Attributes): Tweak intro.
9 (Defining Faces): Move after the Face Attributes node. Copyedits.
10 (Displaying Faces): Describe role of inheritance.
11
12 * customize.texi (Customization): Define customization more
13 carefully (Bug#11440).
14 (Common Keywords): Add xref to Constant Variables.
15
16 * variables.texi (Defining Variables): Link to defcustom's node
17 instead of the higher-level Customization chapter.
18
12012-09-11 Paul Eggert <eggert@cs.ucla.edu> 192012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2 20
3 Simplify, document, and port floating-point (Bug#12381). 21 Simplify, document, and port floating-point (Bug#12381).
diff --git a/doc/lispref/customize.texi b/doc/lispref/customize.texi
index 38dfc949264..c9d22851ed2 100644
--- a/doc/lispref/customize.texi
+++ b/doc/lispref/customize.texi
@@ -6,13 +6,30 @@
6@chapter Customization Settings 6@chapter Customization Settings
7 7
8@cindex customization item 8@cindex customization item
9 This chapter describes how to declare customizable variables and 9 Users of Emacs can customize variables and faces without writing
10customization groups for classifying them. We use the term 10Lisp code, by using the Customize interface. @xref{Easy
11@dfn{customization item} to include customizable variables, 11Customization,,, emacs, The GNU Emacs Manual}. This chapter describes
12customization groups, as well as faces. 12how to define @dfn{customization items} that users can interact with
13 13through the Customize interface.
14 @xref{Defining Faces}, for the @code{defface} macro, which is used 14
15for declaring customizable faces. 15 Customization items include customizable variables, which are
16defined with the
17@ifinfo
18@code{defcustom} macro (@pxref{Variable Definitions});
19@end ifinfo
20@ifnotinfo
21@code{defcustom} macro;
22@end ifnotinfo
23customizable faces, which are defined with @code{defface} (described
24separately in @ref{Defining Faces}); and @dfn{customization groups},
25defined with
26@ifinfo
27@code{defgroup} (@pxref{Group Definitions}),
28@end ifinfo
29@ifnotinfo
30@code{defgroup},
31@end ifnotinfo
32which act as containers for groups of related customization items.
16 33
17@menu 34@menu
18* Common Keywords:: Common keyword arguments for all kinds of 35* Common Keywords:: Common keyword arguments for all kinds of
@@ -29,9 +46,10 @@ for declaring customizable faces.
29 46
30@cindex customization keywords 47@cindex customization keywords
31 The customization declarations that we will describe in the next few 48 The customization declarations that we will describe in the next few
32sections (@code{defcustom}, @code{defgroup}, etc.) all accept keyword 49sections---@code{defcustom}, @code{defgroup}, etc.---all accept
33arguments for specifying various information. This section describes 50keyword arguments (@pxref{Constant Variables}) for specifying various
34keywords that apply to all types of customization declarations. 51information. This section describes keywords that apply to all types
52of customization declarations.
35 53
36 All of these keywords, except @code{:tag}, can be used more than once 54 All of these keywords, except @code{:tag}, can be used more than once
37in a given item. Each use of the keyword has an independent effect. 55in a given item. Each use of the keyword has an independent effect.
@@ -188,14 +206,14 @@ choice is the official name of the package, such as MH-E or Gnus.
188@cindex define customization group 206@cindex define customization group
189@cindex customization groups, defining 207@cindex customization groups, defining
190 208
191 Each Emacs Lisp package should have one main customization group which 209 Each Emacs Lisp package should have one main customization group
192contains all the options, faces and other groups in the package. If the 210which contains all the options, faces and other groups in the package.
193package has a small number of options and faces, use just one group and 211If the package has a small number of options and faces, use just one
194put everything in it. When there are more than twelve or so options and 212group and put everything in it. When there are more than twenty or so
195faces, then you should structure them into subgroups, and put the 213options and faces, then you should structure them into subgroups, and
196subgroups under the package's main customization group. It is OK to 214put the subgroups under the package's main customization group. It is
197put some of the options and faces in the package's main group alongside 215OK to put some of the options and faces in the package's main group
198the subgroups. 216alongside the subgroups.
199 217
200 The package's main or only group should be a member of one or more of 218 The package's main or only group should be a member of one or more of
201the standard customization groups. (To display the full list of them, 219the standard customization groups. (To display the full list of them,
@@ -251,7 +269,17 @@ confusing names for options and faces.
251@node Variable Definitions 269@node Variable Definitions
252@section Defining Customization Variables 270@section Defining Customization Variables
253@cindex define customization options 271@cindex define customization options
254@cindex customization variables, how to define 272@cindex customizable variables, how to define
273@cindex user options, how to define
274
275 @dfn{Customizable variables}, also called @dfn{user options}, are
276global Lisp variables whose values can be set through the Customize
277interface. Unlike other global variables, which are defined with
278@code{defvar} (@pxref{Defining Variables}), customizable variables are
279defined using the @code{defcustom} macro. In addition to calling
280@code{defvar} as a subroutine, @code{defcustom} states how the
281variable should be displayed in the Customize interface, the values it
282is allowed to take, etc.
255 283
256@defmac defcustom option standard doc [keyword value]@dots{} 284@defmac defcustom option standard doc [keyword value]@dots{}
257This macro declares @var{option} as a user option (i.e.@: a 285This macro declares @var{option} as a user option (i.e.@: a
@@ -291,13 +319,14 @@ has not been assigned the right value yet. In that case, use
291standard value after Emacs starts up. 319standard value after Emacs starts up.
292@end defmac 320@end defmac
293 321
294 @code{defcustom} accepts the following additional keywords: 322 In addition to the keywords listed in @ref{Common Keywords}, this
323macro accepts the following keywords:
295 324
296@table @code 325@table @code
297@item :type @var{type} 326@item :type @var{type}
298Use @var{type} as the data type for this option. It specifies which 327Use @var{type} as the data type for this option. It specifies which
299values are legitimate, and how to display the value. 328values are legitimate, and how to display the value
300@xref{Customization Types}, for more information. 329(@pxref{Customization Types}).
301 330
302@item :options @var{value-list} 331@item :options @var{value-list}
303@kindex options@r{, @code{defcustom} keyword} 332@kindex options@r{, @code{defcustom} keyword}
diff --git a/doc/lispref/debugging.texi b/doc/lispref/debugging.texi
index 5aeff576d09..2226db942d1 100644
--- a/doc/lispref/debugging.texi
+++ b/doc/lispref/debugging.texi
@@ -331,7 +331,7 @@ variable is temporarily set according to
331non-@code{nil}, @code{debug-on-error} will temporarily be set to 331non-@code{nil}, @code{debug-on-error} will temporarily be set to
332@code{t}. This means that any further errors that occur while doing a 332@code{t}. This means that any further errors that occur while doing a
333debugging session will (by default) trigger another backtrace. If 333debugging session will (by default) trigger another backtrace. If
334this is not want you want, you can either set 334this is not what you want, you can either set
335@code{eval-expression-debug-on-error} to @code{nil}, or set 335@code{eval-expression-debug-on-error} to @code{nil}, or set
336@code{debug-on-error} to @code{nil} in @code{debugger-mode-hook}. 336@code{debug-on-error} to @code{nil} in @code{debugger-mode-hook}.
337 337
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index 64aa891e56b..11a86f3c1c5 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -1863,20 +1863,36 @@ height.
1863 1863
1864 A @dfn{face} is a collection of graphical @dfn{attributes} for 1864 A @dfn{face} is a collection of graphical @dfn{attributes} for
1865displaying text: font, foreground color, background color, optional 1865displaying text: font, foreground color, background color, optional
1866underlining, and so on. Faces control how Emacs displays text in 1866underlining, etc. Faces control how Emacs displays text in buffers,
1867buffers, as well as other parts of the frame such as the mode line. 1867as well as other parts of the frame such as the mode line.
1868@xref{Standard Faces,,, emacs, The GNU Emacs Manual}, for the list of 1868
1869faces Emacs normally comes with. 1869@cindex anonymous face
1870 1870 One way to represent a face is as a property list of attributes,
1871@cindex face id 1871like @code{(:foreground "red" :weight bold)}. For example, you can
1872 For most purposes, you refer to a face in Lisp programs using its 1872assign such an @dfn{anonymous face} as the value of the @code{face}
1873@dfn{face name}, which is usually a Lisp symbol. For backward 1873text property; this causes Emacs to display the underlying text with
1874compatibility, a face name can also be a string, which is equivalent 1874the specified attributes. @xref{Special Properties}.
1875to a Lisp symbol of the same name. 1875
1876@cindex face name
1877 More commonly, a face is referred to via a @dfn{face name}: a Lisp
1878symbol which is associated with a set of face attributes. Named faces
1879are defined using the @code{defface} macro (@pxref{Defining Faces}).
1880Emacs defines several standard named faces; @xref{Standard Faces,,,
1881emacs, The GNU Emacs Manual}.
1882
1883 Many parts of Emacs require named faces, and do not accept anonymous
1884faces. These include the functions documented in @ref{Attribute
1885Functions}, and the variable @code{font-lock-keywords}
1886(@pxref{Search-based Fontification}). Unless otherwise stated, we
1887will use the term @dfn{face} to refer only to named faces.
1888
1889 For backward compatibility, you can also use a string to specify a
1890face name; that is equivalent to a Lisp symbol with the same name.
1876 1891
1877@defun facep object 1892@defun facep object
1878This function returns a non-@code{nil} value if @var{object} is a Lisp 1893This function returns a non-@code{nil} value if @var{object} is a
1879symbol or string that names a face. Otherwise, it returns @code{nil}. 1894named face: a Lisp symbol or string which serves as a face name.
1895Otherwise, it returns @code{nil}.
1880@end defun 1896@end defun
1881 1897
1882 By default, each face name corresponds to the same set of attributes 1898 By default, each face name corresponds to the same set of attributes
@@ -1884,8 +1900,8 @@ in all frames. But you can also assign a face name a special set of
1884attributes in one frame (@pxref{Attribute Functions}). 1900attributes in one frame (@pxref{Attribute Functions}).
1885 1901
1886@menu 1902@menu
1887* Defining Faces:: How to define a face.
1888* Face Attributes:: What is in a face? 1903* Face Attributes:: What is in a face?
1904* Defining Faces:: How to define a face.
1889* Attribute Functions:: Functions to examine and set face attributes. 1905* Attribute Functions:: Functions to examine and set face attributes.
1890* Displaying Faces:: How Emacs combines the faces specified for a character. 1906* Displaying Faces:: How Emacs combines the faces specified for a character.
1891* Face Remapping:: Remapping faces to alternative definitions. 1907* Face Remapping:: Remapping faces to alternative definitions.
@@ -1900,161 +1916,21 @@ attributes in one frame (@pxref{Attribute Functions}).
1900* Low-Level Font:: Lisp representation for character display fonts. 1916* Low-Level Font:: Lisp representation for character display fonts.
1901@end menu 1917@end menu
1902 1918
1903@node Defining Faces
1904@subsection Defining Faces
1905
1906 The @code{defface} macro defines a face and specifies its default
1907appearance. The user can subsequently customize the face using the
1908Customize interface (@pxref{Customization}).
1909
1910@defmac defface face spec doc [keyword value]@dots{}
1911This macro declares @var{face} as a customizable face whose default
1912attributes are given by @var{spec}. You should not quote the symbol
1913@var{face}, and it should not end in @samp{-face} (that would be
1914redundant). The argument @var{doc} is a documentation string for the
1915face. The additional @var{keyword} arguments have the same meanings
1916as in @code{defgroup} and @code{defcustom} (@pxref{Common Keywords}).
1917
1918When @code{defface} executes, it defines the face according to
1919@var{spec}, then uses any customizations that were read from the
1920init file (@pxref{Init File}) to override that specification.
1921
1922When you evaluate a @code{defface} form with @kbd{C-M-x} in Emacs
1923Lisp mode (@code{eval-defun}), a special feature of @code{eval-defun}
1924overrides any customizations of the face. This way, the face reflects
1925exactly what the @code{defface} says.
1926
1927@cindex face specification
1928The @var{spec} argument is a @dfn{face specification}, which states
1929how the face should appear on different kinds of terminals. It should
1930be an alist whose elements each have the form
1931
1932@example
1933(@var{display} . @var{plist})
1934@end example
1935
1936@noindent
1937@var{display} specifies a class of terminals (see below), while
1938@var{plist} is a property list of face attributes and their values,
1939specifying how the face appears on such terminals
1940@iftex
1941(see the next section for details about face attributes).
1942@end iftex
1943@ifnottex
1944(@pxref{Face Attributes}, for details about face attributes).
1945@end ifnottex
1946
1947The @var{display} part of an element of @var{spec} determines which
1948frames the element matches. If more than one element of @var{spec}
1949matches a given frame, the first element that matches is the one used
1950for that frame. There are three possibilities for @var{display}:
1951
1952@table @asis
1953@item @code{default}
1954This element of @var{spec} doesn't match any frames; instead, it
1955specifies defaults that apply to all frames. This element, if used,
1956must be the first element of @var{spec}. Each of the following
1957elements can override any or all of these defaults.
1958
1959@item @code{t}
1960This element of @var{spec} matches all frames. Therefore, any
1961subsequent elements of @var{spec} are never used. Normally
1962@code{t} is used in the last (or only) element of @var{spec}.
1963
1964@item a list
1965If @var{display} is a list, each element should have the form
1966@code{(@var{characteristic} @var{value}@dots{})}. Here
1967@var{characteristic} specifies a way of classifying frames, and the
1968@var{value}s are possible classifications which @var{display} should
1969apply to. Here are the possible values of @var{characteristic}:
1970
1971@table @code
1972@item type
1973The kind of window system the frame uses---either @code{graphic} (any
1974graphics-capable display), @code{x}, @code{pc} (for the MS-DOS console),
1975@code{w32} (for MS Windows 9X/NT/2K/XP), or @code{tty}
1976(a non-graphics-capable display).
1977@xref{Window Systems, window-system}.
1978
1979@item class
1980What kinds of colors the frame supports---either @code{color},
1981@code{grayscale}, or @code{mono}.
1982
1983@item background
1984The kind of background---either @code{light} or @code{dark}.
1985
1986@item min-colors
1987An integer that represents the minimum number of colors the frame
1988should support. This matches a frame if its
1989@code{display-color-cells} value is at least the specified integer.
1990
1991@item supports
1992Whether or not the frame can display the face attributes given in
1993@var{value}@dots{} (@pxref{Face Attributes}). @xref{Display Face
1994Attribute Testing}, for more information on exactly how this testing
1995is done.
1996@end table
1997
1998If an element of @var{display} specifies more than one @var{value} for a
1999given @var{characteristic}, any of those values is acceptable. If
2000@var{display} has more than one element, each element should specify a
2001different @var{characteristic}; then @emph{each} characteristic of the
2002frame must match one of the @var{value}s specified for it in
2003@var{display}.
2004@end table
2005@end defmac
2006
2007 Here's how the standard face @code{highlight} is defined:
2008
2009@example
2010(defface highlight
2011 '((((class color) (min-colors 88) (background light))
2012 :background "darkseagreen2")
2013 (((class color) (min-colors 88) (background dark))
2014 :background "darkolivegreen")
2015 (((class color) (min-colors 16) (background light))
2016 :background "darkseagreen2")
2017 (((class color) (min-colors 16) (background dark))
2018 :background "darkolivegreen")
2019 (((class color) (min-colors 8))
2020 :background "green" :foreground "black")
2021 (t :inverse-video t))
2022 "Basic face for highlighting."
2023 :group 'basic-faces)
2024@end example
2025
2026 Internally, Emacs stores the face's default specification in its
2027@code{face-defface-spec} symbol property (@pxref{Property Lists}).
2028The @code{saved-face} property stores the face specification saved by
2029the user, using the customization buffer; the @code{customized-face}
2030property stores the face specification customized for the current
2031session, but not saved; and the @code{theme-face} property stores an
2032alist associating the active customization settings and Custom themes
2033with their specifications for that face. The face's documentation
2034string is stored in the @code{face-documentation} property. But
2035normally you should not try to set any of these properties directly.
2036@xref{Applying Customizations}, for the @code{custom-set-faces}
2037function, which is used to apply customized face settings.
2038
2039 People are sometimes tempted to create variables whose values
2040specify a face to use. In the vast majority of cases, this is not
2041necessary; it is preferable to simply use faces directly.
2042
2043@node Face Attributes 1919@node Face Attributes
2044@subsection Face Attributes 1920@subsection Face Attributes
2045@cindex face attributes 1921@cindex face attributes
2046 1922
2047 The effect of using a face is determined by a fixed set of @dfn{face 1923 @dfn{Face attributes} determine the visual appearance of a face.
2048attributes}. This table lists all the face attributes, their possible 1924The following table lists all the face attributes, their possible
2049values, and their effects. You can specify more than one face for a 1925values, and their effects.
2050given piece of text; Emacs merges the attributes of all the faces to
2051determine how to display the text. @xref{Displaying Faces}.
2052 1926
2053 In addition to the values given below, each face attribute can also 1927 Apart from the values given below, each face attribute can have the
2054have the value @code{unspecified}. This special value means the face 1928value @code{unspecified}. This special value means that the face
2055doesn't specify that attribute. In face merging, when the first face 1929doesn't specify that attribute directly. An @code{unspecified}
2056fails to specify a particular attribute, the next face gets a chance. 1930attribute tells Emacs to refer instead to a parent face (see the
2057However, the @code{default} face must specify all attributes. 1931description @code{:inherit} attribute below); or, failing that, to an
1932underlying face (@pxref{Displaying Faces}). The @code{default} face
1933must specify all attributes.
2058 1934
2059 Some of these attributes are meaningful only on certain kinds of 1935 Some of these attributes are meaningful only on certain kinds of
2060displays. If your display cannot handle a certain attribute, the 1936displays. If your display cannot handle a certain attribute, the
@@ -2063,7 +1939,7 @@ attribute is ignored.
2063@table @code 1939@table @code
2064@item :family 1940@item :family
2065Font family or fontset (a string). @xref{Fonts,,, emacs, The GNU 1941Font family or fontset (a string). @xref{Fonts,,, emacs, The GNU
2066Emacs Manual}, for more information about font families; the function 1942Emacs Manual}, for more information about font families. The function
2067@code{font-family-list} (see below) returns a list of available family 1943@code{font-family-list} (see below) returns a list of available family
2068names. @xref{Fontsets}, for information about fontsets. 1944names. @xref{Fontsets}, for information about fontsets.
2069 1945
@@ -2083,9 +1959,8 @@ The height of the font. In the simplest case, this is an integer in
2083units of 1/10 point. 1959units of 1/10 point.
2084 1960
2085The value can also be a floating point number or a function, which 1961The value can also be a floating point number or a function, which
2086specifies the height relative to an @dfn{underlying face} (i.e., a 1962specifies the height relative to an @dfn{underlying face}
2087face that has a lower priority in the list described in 1963(@pxref{Displaying Faces}). If the value is a floating point number,
2088@ref{Displaying Faces}). If the value is a floating point number,
2089that specifies the amount by which to scale the height of the 1964that specifies the amount by which to scale the height of the
2090underlying face. If the value is a function, that function is called 1965underlying face. If the value is a function, that function is called
2091with one argument, the height of the underlying face, and returns the 1966with one argument, the height of the underlying face, and returns the
@@ -2261,11 +2136,147 @@ suitable for use with @code{:stipple} (see above). It returns
2261@code{nil} otherwise. 2136@code{nil} otherwise.
2262@end defun 2137@end defun
2263 2138
2139@node Defining Faces
2140@subsection Defining Faces
2141
2142 The usual way to define a face is through the @code{defface} macro.
2143This macro defines a face name, and associates that name with a set of
2144face attributes. It also sets up the face so that the user can
2145customize it via the Customize interface (@pxref{Customization}).
2146
2147@defmac defface face spec doc [keyword value]@dots{}
2148This macro declares @var{face} as a customizable face whose default
2149attributes are given by @var{spec}. You should not quote the symbol
2150@var{face}, and it should not end in @samp{-face} (that would be
2151redundant). The argument @var{doc} is a documentation string for the
2152face. The additional @var{keyword} arguments have the same meanings
2153as in @code{defgroup} and @code{defcustom} (@pxref{Common Keywords}).
2154
2155When @code{defface} executes, it defines the face according to
2156@var{spec}, then uses any customizations that were read from the
2157init file (@pxref{Init File}) to override that specification.
2158
2159When you evaluate a @code{defface} form with @kbd{C-M-x} in Emacs
2160Lisp mode (@code{eval-defun}), a special feature of @code{eval-defun}
2161overrides any customizations of the face. This way, the face reflects
2162exactly what the @code{defface} says.
2163
2164@cindex face specification
2165The @var{spec} argument is a @dfn{face specification}, which states
2166how the face should appear on different kinds of terminals. It should
2167be an alist whose elements each have the form
2168
2169@example
2170(@var{display} . @var{plist})
2171@end example
2172
2173@noindent
2174@var{display} specifies a class of terminals (see below). @var{plist}
2175is a property list of face attributes and their values, specifying how
2176the face appears on such terminals. For backward compatibility, you
2177can also write an element as @code{(@var{display} @var{plist})}.
2178
2179The @var{display} part of an element of @var{spec} determines which
2180terminals the element matches. If more than one element of @var{spec}
2181matches a given terminal, the first element that matches is the one
2182used for that terminal. There are three possibilities for
2183@var{display}:
2184
2185@table @asis
2186@item @code{default}
2187This element of @var{spec} doesn't match any terminal; instead, it
2188specifies defaults that apply to all terminals. This element, if
2189used, must be the first element of @var{spec}. Each of the following
2190elements can override any or all of these defaults.
2191
2192@item @code{t}
2193This element of @var{spec} matches all terminals. Therefore, any
2194subsequent elements of @var{spec} are never used. Normally @code{t}
2195is used in the last (or only) element of @var{spec}.
2196
2197@item a list
2198If @var{display} is a list, each element should have the form
2199@code{(@var{characteristic} @var{value}@dots{})}. Here
2200@var{characteristic} specifies a way of classifying terminals, and the
2201@var{value}s are possible classifications which @var{display} should
2202apply to. Here are the possible values of @var{characteristic}:
2203
2204@table @code
2205@item type
2206The kind of window system the terminal uses---either @code{graphic}
2207(any graphics-capable display), @code{x}, @code{pc} (for the MS-DOS
2208console), @code{w32} (for MS Windows 9X/NT/2K/XP), or @code{tty} (a
2209non-graphics-capable display). @xref{Window Systems, window-system}.
2210
2211@item class
2212What kinds of colors the terminal supports---either @code{color},
2213@code{grayscale}, or @code{mono}.
2214
2215@item background
2216The kind of background---either @code{light} or @code{dark}.
2217
2218@item min-colors
2219An integer that represents the minimum number of colors the terminal
2220should support. This matches a terminal if its
2221@code{display-color-cells} value is at least the specified integer.
2222
2223@item supports
2224Whether or not the terminal can display the face attributes given in
2225@var{value}@dots{} (@pxref{Face Attributes}). @xref{Display Face
2226Attribute Testing}, for more information on exactly how this testing
2227is done.
2228@end table
2229
2230If an element of @var{display} specifies more than one @var{value} for
2231a given @var{characteristic}, any of those values is acceptable. If
2232@var{display} has more than one element, each element should specify a
2233different @var{characteristic}; then @emph{each} characteristic of the
2234terminal must match one of the @var{value}s specified for it in
2235@var{display}.
2236@end table
2237@end defmac
2238
2239 Here's how the standard face @code{highlight} is defined:
2240
2241@example
2242(defface highlight
2243 '((((class color) (min-colors 88) (background light))
2244 :background "darkseagreen2")
2245 (((class color) (min-colors 88) (background dark))
2246 :background "darkolivegreen")
2247 (((class color) (min-colors 16) (background light))
2248 :background "darkseagreen2")
2249 (((class color) (min-colors 16) (background dark))
2250 :background "darkolivegreen")
2251 (((class color) (min-colors 8))
2252 :background "green" :foreground "black")
2253 (t :inverse-video t))
2254 "Basic face for highlighting."
2255 :group 'basic-faces)
2256@end example
2257
2258 Internally, Emacs stores the face's default specification in its
2259@code{face-defface-spec} symbol property (@pxref{Property Lists}).
2260The @code{saved-face} property stores the face specification saved by
2261the user, using the customization buffer; the @code{customized-face}
2262property stores the face specification customized for the current
2263session, but not saved; and the @code{theme-face} property stores an
2264alist associating the active customization settings and Custom themes
2265with their specifications for that face. The face's documentation
2266string is stored in the @code{face-documentation} property. But
2267normally you should not try to set any of these properties directly.
2268@xref{Applying Customizations}, for the @code{custom-set-faces}
2269function, which is used to apply customized face settings.
2270
2271 People are sometimes tempted to create variables whose values
2272specify a face to use. In the vast majority of cases, this is not
2273necessary; it is preferable to simply use faces directly.
2274
2264@node Attribute Functions 2275@node Attribute Functions
2265@subsection Face Attribute Functions 2276@subsection Face Attribute Functions
2266 2277
2267 This section describes the functions for accessing and modifying the 2278 This section describes the functions for accessing and modifying the
2268attributes of an existing face. 2279attributes of an existing named face.
2269 2280
2270@defun set-face-attribute face frame &rest arguments 2281@defun set-face-attribute face frame &rest arguments
2271This function sets one or more attributes of @var{face} for 2282This function sets one or more attributes of @var{face} for
@@ -2467,8 +2478,12 @@ This function returns the @code{:inverse-video} attribute of face @var{face}.
2467@node Displaying Faces 2478@node Displaying Faces
2468@subsection Displaying Faces 2479@subsection Displaying Faces
2469 2480
2470 Here is how Emacs determines the face to use for displaying any 2481 When Emacs displays a given piece of text, the visual appearance of
2471given piece of text: 2482the text may be determined by faces drawn from different sources. If
2483these various sources together specify more than one face for a
2484particular character, Emacs merges the attributes of the various
2485faces. Here is the order in which Emacs merges the faces, from
2486highest to lowest priority:
2472 2487
2473@itemize @bullet 2488@itemize @bullet
2474@item 2489@item
@@ -2482,11 +2497,11 @@ Manual}.
2482 2497
2483@item 2498@item
2484If the text lies within an overlay with a non-@code{nil} @code{face} 2499If the text lies within an overlay with a non-@code{nil} @code{face}
2485property, Emacs applies the face or face attributes specified by that 2500property, Emacs applies the face(s) specified by that property. If
2486property. If the overlay has a @code{mouse-face} property and the 2501the overlay has a @code{mouse-face} property and the mouse is ``near
2487mouse is ``near enough'' to the overlay, Emacs applies the face or 2502enough'' to the overlay, Emacs applies the face or face attributes
2488face attributes specified by the @code{mouse-face} property instead. 2503specified by the @code{mouse-face} property instead. @xref{Overlay
2489@xref{Overlay Properties}. 2504Properties}.
2490 2505
2491When multiple overlays cover one character, an overlay with higher 2506When multiple overlays cover one character, an overlay with higher
2492priority overrides those with lower priority. @xref{Overlays}. 2507priority overrides those with lower priority. @xref{Overlays}.
@@ -2508,11 +2523,12 @@ If any given attribute has not been specified during the preceding
2508steps, Emacs applies the attribute of the @code{default} face. 2523steps, Emacs applies the attribute of the @code{default} face.
2509@end itemize 2524@end itemize
2510 2525
2511 If these various sources together specify more than one face for a 2526 At each stage, if a face has a valid @code{:inherit} attribute,
2512particular character, Emacs merges the attributes of the various faces 2527Emacs treats any attribute with an @code{unspecified} value as having
2513specified. For each attribute, Emacs tries using the above order 2528the corresponding value drawn from the parent face(s). @pxref{Face
2514(i.e.@: first the face of any special glyph; then the face for region 2529Attributes}. Note that the parent face(s) may also leave the
2515highlighting, if appropriate; and so on). 2530attribute unspecified; in that case, the attribute remains unspecified
2531at the next level of face merging.
2516 2532
2517@node Face Remapping 2533@node Face Remapping
2518@subsection Face Remapping 2534@subsection Face Remapping
diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi
index caa5185dec3..db770616820 100644
--- a/doc/lispref/elisp.texi
+++ b/doc/lispref/elisp.texi
@@ -1366,8 +1366,8 @@ Overlays
1366 1366
1367Faces 1367Faces
1368 1368
1369* Defining Faces:: How to define a face.
1370* Face Attributes:: What is in a face? 1369* Face Attributes:: What is in a face?
1370* Defining Faces:: How to define a face.
1371* Attribute Functions:: Functions to examine and set face attributes. 1371* Attribute Functions:: Functions to examine and set face attributes.
1372* Displaying Faces:: How Emacs combines the faces specified for 1372* Displaying Faces:: How Emacs combines the faces specified for
1373 a character. 1373 a character.
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi
index fe7f24e42cd..a5910ea921b 100644
--- a/doc/lispref/text.texi
+++ b/doc/lispref/text.texi
@@ -2999,12 +2999,11 @@ can be the following:
2999A face name (a symbol or string). 2999A face name (a symbol or string).
3000 3000
3001@item 3001@item
3002A property list of face attributes. This has the 3002A property list of face attributes. This has the form (@var{keyword}
3003form (@var{keyword} @var{value} @dots{}), where each @var{keyword} is a 3003@var{value} @dots{}), where each @var{keyword} is a face attribute
3004face attribute name and @var{value} is a meaningful value for that 3004name and @var{value} is a meaningful value for that attribute. With
3005attribute. With this feature, you do not need to create a face each 3005this feature, you do not need to create a face each time you want to
3006time you want to specify a particular attribute for certain text. 3006specify a particular attribute for certain text.
3007@xref{Face Attributes}.
3008 3007
3009@item 3008@item
3010A list of faces. This specifies a face which is an aggregate of the 3009A list of faces. This specifies a face which is an aggregate of the
diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi
index c5b66757ace..1c0abcb8e66 100644
--- a/doc/lispref/variables.texi
+++ b/doc/lispref/variables.texi
@@ -403,7 +403,8 @@ unconditionally initializes the variable, whereas @code{defvar}
403initializes it only if it is originally void. 403initializes it only if it is originally void.
404 404
405 To define a customizable variable, you should use @code{defcustom} 405 To define a customizable variable, you should use @code{defcustom}
406(which calls @code{defvar} as a subroutine). @xref{Customization}. 406(which calls @code{defvar} as a subroutine). @xref{Variable
407Definitions}.
407 408
408@defspec defvar symbol [value [doc-string]] 409@defspec defvar symbol [value [doc-string]]
409This special form defines @var{symbol} as a variable. Note that 410This special form defines @var{symbol} as a variable. Note that
diff --git a/etc/ChangeLog b/etc/ChangeLog
index 66c229eaf78..6f2b178fcd7 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,29 @@
12012-09-17 Glenn Morris <rgm@gnu.org>
2
3 * refcards/emacsver.tex: New file.
4 * refcards/calccard.tex, refcards/cs-dired-ref.tex:
5 * refcards/cs-refcard.tex, refcards/cs-survival.tex:
6 * refcards/de-refcard.tex, refcards/dired-ref.tex:
7 * refcards/emacsver.tex, refcards/fr-dired-ref.tex:
8 * refcards/fr-refcard.tex, refcards/fr-survival.tex:
9 * refcards/orgcard.tex, refcards/pl-refcard.tex:
10 * refcards/pt-br-refcard.tex, refcards/refcard.tex:
11 * refcards/sk-dired-ref.tex, refcards/sk-refcard.tex:
12 * refcards/sk-survival.tex, refcards/survival.tex:
13 * refcards/vipcard.tex, refcards/viperCard.tex: Include emacsver.tex.
14 * refcards/calccard.tex (\emacsversionnumber):
15 Rename to \versionemacs, same as all the other refcards.
16 * refcards/Makefile (ENVADD): New variable.
17 (sk-dired-ref.pdf, sk-survival.pdf, pl-refcard.pdf)
18 (%.pdf, %,dvi, sk-dired-ref.dvi, sk-survival.dvi, pl-refcard.dvi):
19 Depend on emacsver.tex. Add "." to TEXINPUTS for TeX commands.
20
212012-09-16 Paul Eggert <eggert@cs.ucla.edu>
22
23 Remove configure's --without-sync-input option (Bug#12450).
24 * TODO (Make SYNC_INPUT the default): Remove, as the code now
25 behaves as if SYNC_INPUT is always true.
26
12012-09-13 Paul Eggert <eggert@cs.ucla.edu> 272012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2 28
3 Use a more backwards-compatible timer format (Bug#12430). 29 Use a more backwards-compatible timer format (Bug#12430).
diff --git a/etc/NEWS b/etc/NEWS
index 3344158b73c..ccd8a6fe35b 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -419,6 +419,8 @@ the experience for Sphinx users.
419 419
420*** Package version in `rst-version'. 420*** Package version in `rst-version'.
421 421
422*** Support `imenu' and `which-func'.
423
422** New `derived-mode' filter for Ibuffer, bound to `/ M'. 424** New `derived-mode' filter for Ibuffer, bound to `/ M'.
423`/ m' is now bound to filter by used-mode, which used to be bound to `/ M'. 425`/ m' is now bound to filter by used-mode, which used to be bound to `/ M'.
424 426
@@ -439,6 +441,9 @@ Use `Buffer-menu-name-width' and `Buffer-menu-size-width' instead.
439 441
440** Calendar 442** Calendar
441 443
444*** You can customize the header text that appears above each calendar month.
445See the variable `calendar-month-header'.
446
442*** The calendars produced by cal-html include holidays. 447*** The calendars produced by cal-html include holidays.
443Customize cal-html-holidays to change this. 448Customize cal-html-holidays to change this.
444 449
@@ -459,9 +464,17 @@ channel keys found, if any.
459if the command ends in `;' (when operating on multiple files). 464if the command ends in `;' (when operating on multiple files).
460Otherwise, it executes the command on each file in parallel. 465Otherwise, it executes the command on each file in parallel.
461 466
467*** Typing M-n in the minibuffer of `dired-do-chmod', `dired-do-chgrp',
468`dired-do-chown', `dired-do-touch' pulls the file attributes of the
469file at point.
470
471*** When the region is active, `m' (`dired-mark'), `u' (`dired-unmark'),
472`DEL' (`dired-unmark-backward'), `d' (`dired-flag-file-deletion')
473mark/unmark/flag all files in the active region.
474
462*** The minibuffer default for `=' (`dired-diff) has changed. 475*** The minibuffer default for `=' (`dired-diff) has changed.
463It is now the backup file for the file at point, if one exists, rather 476It is now the backup file for the file at point, if one exists.
464than the file at the mark. 477In Transient Mark mode the default is the file at the active mark.
465 478
466*** `M-=' is no longer bound to `dired-backup-diff' in Dired buffers. 479*** `M-=' is no longer bound to `dired-backup-diff' in Dired buffers.
467The global binding for `M-=', `count-words-region' is in effect. 480The global binding for `M-=', `count-words-region' is in effect.
@@ -737,6 +750,14 @@ in Emacs 24.1:
737**** `special-display-function' 750**** `special-display-function'
738**** `display-buffer-function' 751**** `display-buffer-function'
739 752
753** Minibuffer
754
755*** `read-regexp' has a new argument HISTORY; the first argument PROMPT
756of `read-regexp' accepts a string ending with a colon and space, and its
757second argument DEFAULTS can be a list of strings accessible via M-n
758in the minibuffer ahead of other hard-coded useful regexp-related values.
759More commands use `read-regexp' now to read their regexp arguments.
760
740** Completion 761** Completion
741 762
742*** New function `completion-table-with-quoting' to handle completion 763*** New function `completion-table-with-quoting' to handle completion
diff --git a/etc/TODO b/etc/TODO
index 50e3bd64b9d..be0ef95aed2 100644
--- a/etc/TODO
+++ b/etc/TODO
@@ -1229,13 +1229,6 @@ systems for HTML/XML files automatically."
1229 For use by sml-mode, python-mode, tex-mode, scheme-mode, lisp-mode, 1229 For use by sml-mode, python-mode, tex-mode, scheme-mode, lisp-mode,
1230 haskell-mode, tuareg-mode, ... 1230 haskell-mode, tuareg-mode, ...
1231 1231
1232** Make SYNC_INPUT the default. [true since 2008-03-11]
1233 All loops using immediate_quit need to be checked to ensure that
1234 C-g can interrupt them, in case of an infinite loop. Once we
1235 switch to using SYNC_INPUT, we can remove the BLOCK_INPUTs in the
1236 allocation functions (allocate_string etc.) without worrying about
1237 data munging.
1238
1239** Add "link" button class 1232** Add "link" button class
1240 Add a standard button-class named "link", and make all other link-like 1233 Add a standard button-class named "link", and make all other link-like
1241 button classes inherit from it. Set the default face of the "link" button 1234 button classes inherit from it. Set the default face of the "link" button
diff --git a/etc/refcards/Makefile b/etc/refcards/Makefile
index 64e2d8638f8..ef810da6022 100644
--- a/etc/refcards/Makefile
+++ b/etc/refcards/Makefile
@@ -47,26 +47,27 @@ VIPER_CARDS_PDF = vipcard.pdf viperCard.pdf
47viper-cards_pdf: ${VIPER_CARDS_PDF} 47viper-cards_pdf: ${VIPER_CARDS_PDF}
48viper-cards_ps: ${VIPER_CARDS_PDF:.pdf=.ps} 48viper-cards_ps: ${VIPER_CARDS_PDF:.pdf=.ps}
49 49
50ENVADD = TEXINPUTS=".:"
50 51
51## PDF files. 52## PDF files.
52 53
53## The page layouts (a4/letter) are written directly in the .tex files. 54## The page layouts (a4/letter) are written directly in the .tex files.
54 55
55cs-refcard.pdf cs-dired-ref.pdf cs-survival.pdf sk-refcard.pdf \ 56cs-refcard.pdf cs-dired-ref.pdf cs-survival.pdf sk-refcard.pdf \
56sk-dired-ref.pdf sk-survival.pdf: %.pdf: %.tex 57sk-dired-ref.pdf sk-survival.pdf: %.pdf: %.tex emacsver.tex
57 if pdfcsplain --version > /dev/null 2> /dev/null; then \ 58 if pdfcsplain --version > /dev/null 2> /dev/null; then \
58 pdfcsplain $<; \ 59 ${ENVADD} pdfcsplain $<; \
59 else \ 60 else \
60 csplain "\pdfoutput=1\input $<"; \ 61 ${ENVADD} csplain "\pdfoutput=1\input $<"; \
61 fi 62 fi
62 63
63## Some versions of pdfmex seem to create dvi by default, hence output-format. 64## Some versions of pdfmex seem to create dvi by default, hence output-format.
64pl-refcard.pdf: %.pdf: %.tex 65pl-refcard.pdf: %.pdf: %.tex emacsver.tex
65 if ! kpsewhich -format=fmt mex > /dev/null && \ 66 if ! kpsewhich -format=fmt mex > /dev/null && \
66 ! pdfmex --version > /dev/null 2> /dev/null; then \ 67 ! pdfmex --version > /dev/null 2> /dev/null; then \
67 echo "No mex format found."; false; \ 68 echo "No mex format found."; false; \
68 fi 69 fi
69 pdftex -output-format=pdf $< 70 ${ENVADD} pdftex -output-format=pdf $<
70 71
71ru-refcard.pdf: %.pdf: %.tex 72ru-refcard.pdf: %.pdf: %.tex
72 pdflatex $< 73 pdflatex $<
@@ -81,21 +82,21 @@ gnus-booklet.pdf: gnus-refcard.tex gnus-logo.pdf
81 pdflatex -jobname=gnus-booklet '\def\booklettrue{}\def\letterpapertrue{}\input{gnus-refcard}' 82 pdflatex -jobname=gnus-booklet '\def\booklettrue{}\def\letterpapertrue{}\input{gnus-refcard}'
82 83
83## Everything not explicitly listed above. 84## Everything not explicitly listed above.
84%.pdf: %.tex 85%.pdf: %.tex emacsver.tex
85 pdftex $< 86 ${ENVADD} pdftex $<
86 87
87 88
88## dvi files. 89## dvi files.
89 90
90cs-refcard.dvi cs-dired-ref.dvi cs-survival.dvi sk-refcard.dvi \ 91cs-refcard.dvi cs-dired-ref.dvi cs-survival.dvi sk-refcard.dvi \
91sk-dired-ref.dvi sk-survival.dvi: %.dvi: %.tex 92sk-dired-ref.dvi sk-survival.dvi: %.dvi: %.tex emacsver.tex
92 csplain $< 93 ${ENVADD} csplain $<
93 94
94pl-refcard.dvi: %.dvi: %.tex 95pl-refcard.dvi: %.dvi: %.tex emacsver.tex
95 if ! kpsewhich -format=fmt mex > /dev/null; then \ 96 if ! kpsewhich -format=fmt mex > /dev/null; then \
96 echo "No mex format found."; false; \ 97 echo "No mex format found."; false; \
97 fi 98 fi
98 tex $< 99 ${ENVADD} tex $<
99 100
100ru-refcard.dvi gnus-refcard.dvi: %.dvi: %.tex 101ru-refcard.dvi gnus-refcard.dvi: %.dvi: %.tex
101 latex $< 102 latex $<
@@ -105,8 +106,8 @@ gnus-booklet.dvi: gnus-refcard.tex
105 mv gnus-refcard.dvi $@ 106 mv gnus-refcard.dvi $@
106 107
107## Everything not explicitly listed above. 108## Everything not explicitly listed above.
108%.dvi: %.tex 109%.dvi: %.tex emacsver.tex
109 tex $< 110 ${ENVADD} tex $<
110 111
111 112
112## PostScript files. 113## PostScript files.
diff --git a/etc/refcards/calccard.tex b/etc/refcards/calccard.tex
index fd3d45b8da4..04c88befeea 100644
--- a/etc/refcards/calccard.tex
+++ b/etc/refcards/calccard.tex
@@ -63,8 +63,7 @@
63% UUCP: mit-erl!gildea 63% UUCP: mit-erl!gildea
64% Internet: gildea@stop.mail-abuse.org 64% Internet: gildea@stop.mail-abuse.org
65 65
66\def\emacsversionnumber{24} 66\input emacsver.tex
67\def\year{2012} % latest copyright year
68 67
69\def\shortcopyrightnotice{\vskip 1ex plus 2 fill 68\def\shortcopyrightnotice{\vskip 1ex plus 2 fill
70 \centerline{\small \copyright\ \year\ Free Software Foundation, Inc. 69 \centerline{\small \copyright\ \year\ Free Software Foundation, Inc.
@@ -276,7 +275,7 @@ are preserved on all copies.
276 275
277\title{GNU Calc Reference Card} 276\title{GNU Calc Reference Card}
278 277
279\centerline{(for GNU Emacs version \emacsversionnumber)} 278\centerline{(for GNU Emacs version \versionemacs)}
280 279
281\section{Starting and Stopping} 280\section{Starting and Stopping}
282 281
diff --git a/etc/refcards/cs-dired-ref.tex b/etc/refcards/cs-dired-ref.tex
index ee7acaf416d..45867e11d44 100644
--- a/etc/refcards/cs-dired-ref.tex
+++ b/etc/refcards/cs-dired-ref.tex
@@ -41,8 +41,7 @@
41\input pdflayout.sty 41\input pdflayout.sty
42\pdflayout=(0) 42\pdflayout=(0)
43 43
44\def\versionemacs{24} % version of Emacs this is for 44\input emacsver.tex
45\def\year{2012} % latest copyright year
46 45
47% Nothing else needs to be changed. 46% Nothing else needs to be changed.
48 47
diff --git a/etc/refcards/cs-refcard.tex b/etc/refcards/cs-refcard.tex
index d17e5c6ddeb..98842dd08e0 100644
--- a/etc/refcards/cs-refcard.tex
+++ b/etc/refcards/cs-refcard.tex
@@ -59,8 +59,7 @@
59\input pdflayout.sty 59\input pdflayout.sty
60\pdflayout=(0) 60\pdflayout=(0)
61 61
62\def\versionemacs{24} % version of Emacs this is for 62\input emacsver.tex
63\def\year{2012} % latest copyright year
64 63
65% Nothing else needs to be changed. 64% Nothing else needs to be changed.
66 65
diff --git a/etc/refcards/cs-survival.tex b/etc/refcards/cs-survival.tex
index 5aa111c0297..4050cf0a1ab 100644
--- a/etc/refcards/cs-survival.tex
+++ b/etc/refcards/cs-survival.tex
@@ -54,8 +54,7 @@
54% Czech hyphenation rules applied 54% Czech hyphenation rules applied
55\chyph 55\chyph
56 56
57\def\versionemacs{24} % version of Emacs this is for 57\input emacsver.tex
58\def\year{2012} % latest copyright year
59 58
60\def\copyrightnotice{\penalty-1\vfill 59\def\copyrightnotice{\penalty-1\vfill
61 \vbox{\smallfont\baselineskip=0.8\baselineskip\raggedcenter 60 \vbox{\smallfont\baselineskip=0.8\baselineskip\raggedcenter
diff --git a/etc/refcards/de-refcard.tex b/etc/refcards/de-refcard.tex
index ca3141b8390..906895b358a 100644
--- a/etc/refcards/de-refcard.tex
+++ b/etc/refcards/de-refcard.tex
@@ -60,8 +60,7 @@
60\input german.sty 60\input german.sty
61\mdqoff % deactivates the "-char 61\mdqoff % deactivates the "-char
62 62
63\def\versionemacs{24} % version of Emacs this is for 63\input emacsver.tex
64\def\year{2012} % latest copyright year
65 64
66% Nothing else needs to be changed below this line. 65% Nothing else needs to be changed below this line.
67 66
diff --git a/etc/refcards/dired-ref.tex b/etc/refcards/dired-ref.tex
index 9ccf57682ff..b85bef1ce0b 100644
--- a/etc/refcards/dired-ref.tex
+++ b/etc/refcards/dired-ref.tex
@@ -43,8 +43,7 @@
43\input pdflayout.sty 43\input pdflayout.sty
44\pdflayout=(1) 44\pdflayout=(1)
45 45
46\def\versionemacs{24} % version of Emacs this is for 46\input emacsver.tex
47\def\year{2012} % latest copyright year
48 47
49% Nothing else needs to be changed. 48% Nothing else needs to be changed.
50 49
diff --git a/etc/refcards/emacsver.tex b/etc/refcards/emacsver.tex
new file mode 100644
index 00000000000..620ee8ef9e0
--- /dev/null
+++ b/etc/refcards/emacsver.tex
@@ -0,0 +1,4 @@
1%% This file is not generated by configure, because then the provided
2%% pdf files would always appear out-of-date.
3\def\versionemacs{24} % major version of emacs
4\def\year{2012} % latest copyright year
diff --git a/etc/refcards/fr-dired-ref.tex b/etc/refcards/fr-dired-ref.tex
index 2819bbaa25b..457ee2db472 100644
--- a/etc/refcards/fr-dired-ref.tex
+++ b/etc/refcards/fr-dired-ref.tex
@@ -35,8 +35,7 @@
35\input pdflayout.sty 35\input pdflayout.sty
36\pdflayout=(0) 36\pdflayout=(0)
37 37
38\def\versionemacs{24} % version of Emacs this is for 38\input emacsver.tex
39\def\year{2012} % latest copyright year
40 39
41% Nothing else needs to be changed. 40% Nothing else needs to be changed.
42 41
diff --git a/etc/refcards/fr-refcard.tex b/etc/refcards/fr-refcard.tex
index ed82f00a85d..4fe94d79075 100644
--- a/etc/refcards/fr-refcard.tex
+++ b/etc/refcards/fr-refcard.tex
@@ -56,8 +56,7 @@
56\input pdflayout.sty 56\input pdflayout.sty
57\pdflayout=(0l) 57\pdflayout=(0l)
58 58
59\def\versionemacs{24} % version of Emacs this is for 59\input emacsver.tex
60\def\year{2012} % latest copyright year
61 60
62% Nothing else needs to be changed below this line. 61% Nothing else needs to be changed below this line.
63 62
diff --git a/etc/refcards/fr-survival.tex b/etc/refcards/fr-survival.tex
index 1cd9cc4cf05..16d67f6b1cd 100644
--- a/etc/refcards/fr-survival.tex
+++ b/etc/refcards/fr-survival.tex
@@ -49,8 +49,7 @@
49\input pdflayout.sty 49\input pdflayout.sty
50\pdflayout=(0) 50\pdflayout=(0)
51 51
52\def\versionemacs{24} % version of Emacs this is for 52\input emacsver.tex
53\def\year{2012} % latest copyright year
54 53
55\def\copyrightnotice{\penalty-1\vfill 54\def\copyrightnotice{\penalty-1\vfill
56 \vbox{\smallfont\baselineskip=0.8\baselineskip\raggedcenter 55 \vbox{\smallfont\baselineskip=0.8\baselineskip\raggedcenter
diff --git a/etc/refcards/orgcard.tex b/etc/refcards/orgcard.tex
index 3c0584d6db4..60e81f36d3e 100644
--- a/etc/refcards/orgcard.tex
+++ b/etc/refcards/orgcard.tex
@@ -1,7 +1,7 @@
1% Reference Card for Org Mode 1% Reference Card for Org Mode
2\def\orgversionnumber{7.8.11} 2\def\orgversionnumber{7.8.11}
3\def\versionyear{2012} % latest update 3\def\versionyear{2012} % latest update
4\def\year{2012} % latest copyright year 4\input emacsver.tex
5 5
6%**start of header 6%**start of header
7\newcount\columnsperpage 7\newcount\columnsperpage
diff --git a/etc/refcards/pl-refcard.tex b/etc/refcards/pl-refcard.tex
index 9cc6fc6a6cd..db814cfa8c2 100644
--- a/etc/refcards/pl-refcard.tex
+++ b/etc/refcards/pl-refcard.tex
@@ -69,8 +69,7 @@
69\input pdflayout.sty 69\input pdflayout.sty
70\pdflayout=(0) 70\pdflayout=(0)
71 71
72\def\versionemacs{24} % version of Emacs this is for 72\input emacsver.tex
73\def\year{2012} % latest copyright year
74 73
75% Nothing else needs to be changed. 74% Nothing else needs to be changed.
76 75
diff --git a/etc/refcards/pt-br-refcard.tex b/etc/refcards/pt-br-refcard.tex
index c16d5096f30..d3fbe54ce87 100644
--- a/etc/refcards/pt-br-refcard.tex
+++ b/etc/refcards/pt-br-refcard.tex
@@ -62,8 +62,7 @@
62\input pdflayout.sty 62\input pdflayout.sty
63\pdflayout=(0l) 63\pdflayout=(0l)
64 64
65\def\versionemacs{24} % version of Emacs this is for 65\input emacsver.tex
66\def\year{2012} % latest copyright year
67 66
68% Nothing else needs to be changed below this line. 67% Nothing else needs to be changed below this line.
69 68
diff --git a/etc/refcards/refcard.tex b/etc/refcards/refcard.tex
index 70788e8c67b..6ca9856085d 100644
--- a/etc/refcards/refcard.tex
+++ b/etc/refcards/refcard.tex
@@ -63,8 +63,7 @@
63 63
64% Nothing else needs to be changed below this line. 64% Nothing else needs to be changed below this line.
65 65
66\def\versionemacs{24} % version of Emacs this is for 66\input emacsver.tex
67\def\year{2012} % copyright year
68 67
69\def\shortcopyrightnotice{\vskip 1ex plus 2 fill 68\def\shortcopyrightnotice{\vskip 1ex plus 2 fill
70 \centerline{\small \copyright\ \year\ Free Software Foundation, Inc. 69 \centerline{\small \copyright\ \year\ Free Software Foundation, Inc.
diff --git a/etc/refcards/sk-dired-ref.tex b/etc/refcards/sk-dired-ref.tex
index 4b12b0b42eb..50d17409072 100644
--- a/etc/refcards/sk-dired-ref.tex
+++ b/etc/refcards/sk-dired-ref.tex
@@ -42,8 +42,7 @@
42\input pdflayout.sty 42\input pdflayout.sty
43\pdflayout=(0) 43\pdflayout=(0)
44 44
45\def\versionemacs{24} % version of Emacs this is for 45\input emacsver.tex
46\def\year{2012} % latest copyright year
47 46
48% Nothing else needs to be changed. 47% Nothing else needs to be changed.
49 48
diff --git a/etc/refcards/sk-refcard.tex b/etc/refcards/sk-refcard.tex
index 5105e8ca986..e617387fad1 100644
--- a/etc/refcards/sk-refcard.tex
+++ b/etc/refcards/sk-refcard.tex
@@ -60,8 +60,7 @@
60\input pdflayout.sty 60\input pdflayout.sty
61\pdflayout=(0) 61\pdflayout=(0)
62 62
63\def\versionemacs{24} % version of Emacs this is for 63\input emacsver.tex
64\def\year{2012} % latest copyright year
65 64
66% Nothing else needs to be changed. 65% Nothing else needs to be changed.
67 66
diff --git a/etc/refcards/sk-survival.tex b/etc/refcards/sk-survival.tex
index 7597c63f5c7..2e7ac9b9298 100644
--- a/etc/refcards/sk-survival.tex
+++ b/etc/refcards/sk-survival.tex
@@ -55,8 +55,7 @@
55% Slovak hyphenation rules applied 55% Slovak hyphenation rules applied
56\shyph 56\shyph
57 57
58\def\versionemacs{24} % version of Emacs this is for 58\input emacsver.tex
59\def\year{2012} % latest copyright year
60 59
61\def\copyrightnotice{\penalty-1\vfill 60\def\copyrightnotice{\penalty-1\vfill
62 \vbox{\smallfont\baselineskip=0.8\baselineskip\raggedcenter 61 \vbox{\smallfont\baselineskip=0.8\baselineskip\raggedcenter
diff --git a/etc/refcards/survival.tex b/etc/refcards/survival.tex
index 92d178a130a..09151e9801c 100644
--- a/etc/refcards/survival.tex
+++ b/etc/refcards/survival.tex
@@ -44,8 +44,7 @@
44\input pdflayout.sty 44\input pdflayout.sty
45\pdflayout=(1) 45\pdflayout=(1)
46 46
47\def\versionemacs{24} % version of Emacs this is for 47\input emacsver.tex
48\def\year{2012} % latest copyright year
49 48
50\def\copyrightnotice{\penalty-1\vfill 49\def\copyrightnotice{\penalty-1\vfill
51 \vbox{\smallfont\baselineskip=0.8\baselineskip\raggedcenter 50 \vbox{\smallfont\baselineskip=0.8\baselineskip\raggedcenter
diff --git a/etc/refcards/vipcard.tex b/etc/refcards/vipcard.tex
index 13b43dbab73..2a709dc79f2 100644
--- a/etc/refcards/vipcard.tex
+++ b/etc/refcards/vipcard.tex
@@ -49,8 +49,8 @@
49\input pdflayout.sty 49\input pdflayout.sty
50\pdflayout=(1) 50\pdflayout=(1)
51 51
52\input emacsver.tex
52\def\versionemacs{18} % version of Emacs this is for 53\def\versionemacs{18} % version of Emacs this is for
53\def\year{2012} % latest copyright year
54\def\versionvip{3.5} 54\def\versionvip{3.5}
55 55
56% Nothing else needs to be changed. 56% Nothing else needs to be changed.
diff --git a/etc/refcards/viperCard.tex b/etc/refcards/viperCard.tex
index a8694dd3bed..c6ab31cdb83 100644
--- a/etc/refcards/viperCard.tex
+++ b/etc/refcards/viperCard.tex
@@ -52,8 +52,8 @@
52\input pdflayout.sty 52\input pdflayout.sty
53\pdflayout=(1) 53\pdflayout=(1)
54 54
55\input emacsver.tex
55\def\versionemacs{21} % version of Emacs this is for 56\def\versionemacs{21} % version of Emacs this is for
56\def\year{2012} % latest copyright year
57\def\versionxemacs{20} % version of XEmacs this is for 57\def\versionxemacs{20} % version of XEmacs this is for
58\def\versionviper{3.0} % version of Viper this is for 58\def\versionviper{3.0} % version of Viper this is for
59 59
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index f5846657707..3f1e287db34 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,8 @@
12012-09-17 Glenn Morris <rgm@gnu.org>
2
3 * ebrowse.c (version):
4 * etags.c (print_version): Use COPYRIGHT.
5
12012-09-11 Paul Eggert <eggert@cs.ucla.edu> 62012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2 7
3 * pop.c (socket_connection) [HAVE_GETADDRINFO]: 8 * pop.c (socket_connection) [HAVE_GETADDRINFO]:
diff --git a/lib-src/ebrowse.c b/lib-src/ebrowse.c
index f8569fe3747..056ed471fde 100644
--- a/lib-src/ebrowse.c
+++ b/lib-src/ebrowse.c
@@ -3516,8 +3516,7 @@ usage (int error)
3516static _Noreturn void 3516static _Noreturn void
3517version (void) 3517version (void)
3518{ 3518{
3519 /* Makes it easier to update automatically. */ 3519 char emacs_copyright[] = COPYRIGHT;
3520 char emacs_copyright[] = "Copyright (C) 2012 Free Software Foundation, Inc.";
3521 3520
3522 printf ("ebrowse %s\n", VERSION); 3521 printf ("ebrowse %s\n", VERSION);
3523 puts (emacs_copyright); 3522 puts (emacs_copyright);
diff --git a/lib-src/etags.c b/lib-src/etags.c
index e65082de534..ec415e9905f 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -836,8 +836,7 @@ etags --help --lang=ada.");
836static void 836static void
837print_version (void) 837print_version (void)
838{ 838{
839 /* Makes it easier to update automatically. */ 839 char emacs_copyright[] = COPYRIGHT;
840 char emacs_copyright[] = "Copyright (C) 2012 Free Software Foundation, Inc.";
841 840
842 printf ("%s (%s %s)\n", (CTAGS) ? "ctags" : "etags", EMACS_NAME, VERSION); 841 printf ("%s (%s %s)\n", (CTAGS) ? "ctags" : "etags", EMACS_NAME, VERSION);
843 puts (emacs_copyright); 842 puts (emacs_copyright);
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b444761e55c..e6fa549e867 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,13 +1,302 @@
12012-09-21 Leo Liu <sdl.web@gmail.com>
2
3 IDO: Disable match re-ordering for buffer switching.
4 * ido.el (ido-buffer-disable-smart-matches): New variable.
5 (ido-set-matches-1): Use it. (Bug#2042)
6
72012-09-21 Jose Marino <marinoj@nso.edu> (tiny change)
8
9 * progmodes/idlw-shell.el (idlwave-shell-complete-filename):
10 Fix 2011-05-17 change. (Bug#12418)
11
122012-09-21 Leo Liu <sdl.web@gmail.com>
13
14 * subr.el (ignore-errors): Mention with-demoted-errors in doc-string.
15
162012-09-21 Glenn Morris <rgm@gnu.org>
17
18 * emacs-lisp/shadow.el (load-path-shadows-font-lock-keywords):
19 Be more robust about locating simple.el.
20
212012-09-21 Glenn Morris <rgm@gnu.org>
22
23 * mail/emacsbug.el (report-emacs-bug): Trap load-path-shadows errors.
24
252012-09-21 Joel Bion <jpbion@westvi.com> (tiny change)
26
27 * pcmpl-gnu.el (pcmpl-gnu-tarfile-regexp): Add tar.xz. (Bug#12382)
28
292012-09-20 Juri Linkov <juri@jurta.org>
30
31 * replace.el (query-replace-read-from): Use `read-regexp' instead
32 of `read-from-minibuffer' when `regexp-flag' is non-nil.
33 (occur-read-primary-args): Use `read-regexp' instead of
34 `read-string'.
35 (multi-occur-in-matching-buffers): Use `read-regexp' instead of
36 `read-from-minibuffer'.
37 * isearch.el (isearch-occur): Use `read-regexp' instead of
38 `read-string'.
39 * dired.el (dired-read-regexp): Use `read-regexp' instead of
40 `read-from-minibuffer'.
41 * progmodes/grep.el (grep-read-regexp): Use `read-regexp' instead
42 of `read-string'. (Bug#7567)
43
44 * replace.el (read-regexp): Rename DEFAULT-VALUE arg to DEFAULTS
45 and allow accepting a list of strings prepended to a list of
46 standard default values. Doc fix. (Bug#12321)
47
48 * replace.el (read-regexp): Add HISTORY arg. (Bug#7567)
49
50 * replace.el (read-regexp): Don't add ": " when PROMPT already
51 ends with a colon and space. (Bug#12321)
52
532012-09-20 Tassilo Horn <tsdh@gnu.org>
54
55 * doc-view.el (doc-view-display): Better fix for the cl-assertion
56 error.
57
582012-09-20 Stefan Merten <smerten@oekonux.de>
59
60 * rst.el: Integrate support for `imenu' and `which-function'.
61 Fixes feature request bug#11711.
62 (rst-mode): Create `imenu-create-index-function'.
63 (rst-get-stripped-line): Delete after refactoring.
64 (rst-section-tree, rst-section-tree-rec)
65 (rst-section-tree-point): Refactor and document properly.
66 (rst-imenu-find-adornments-for-position)
67 (rst-imenu-convert-cell, rst-imenu-create-index): New
68 function.
69
702012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
71
72 * emacs-lisp/macroexp.el (macroexp--obsolete-warning): New function.
73 (macroexp--expand-all): Use it.
74 (macroexp--funcall-and-return): Remove by folding it into its sole
75 caller (macroexp--warn-and-return).
76 * emacs-lisp/bytecomp.el (byte-compile-warn-obsolete):
77 Use macroexp--obsolete-warning.
78
79 * calc/calc.el: Fix last change by removing the whole chunk, since it
80 was only needed back when Calc was not bundled.
81
822012-09-20 Martin Rudalics <rudalics@gmx.at>
83
84 * emacs-lisp/debug.el (debug): Restore assignment to
85 debugger-old-buffer removed on 2012-09-08.
86
872012-09-20 Juri Linkov <juri@jurta.org>
88
89 * dired-aux.el (dired-diff): Remove (require 'diff) since
90 `diff-latest-backup-file' is now autoloaded.
91
922012-09-20 Chong Yidong <cyd@gnu.org>
93
94 * vc/diff.el (diff-latest-backup-file): Autoload.
95
962012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
97
98 * calc/calc.el: Remove redundant autoload shape check.
99 (sel-mode): Don't defvar.
100 (calc-get-stack-element): Add `sel-mode' arg instead.
101 (calc-top, calc-top-list): Pass it this additional argument.
102 * calc/calc-store.el (calc-store-map):
103 * calc/calc-map.el (calc-apply, calc-reduce, calc-map)
104 (calc-map-equation, calc-outer-product, calc-inner-product):
105 * calc/calc-aent.el (calc-alg-entry): Don't bind sel-mode.
106
107 * emacs-lisp/macroexp.el (macroexp--expand-all): Fix last change.
108
1092012-09-19 Juri Linkov <juri@jurta.org>
110
111 * dired-aux.el (dired-diff): Add (require 'diff) because
112 `diff-latest-backup-file' is not autoloaded.
113 (dired-do-chxxx, dired-do-chmod): Set `no-error-if-not-filep' arg
114 of `dired-get-filename' to t to not report error when there is
115 no default file on the current line.
116
1172012-09-19 Stefan Monnier <monnier@iro.umontreal.ca>
118
119 * emacs-lisp/macroexp.el (macroexp--funcall-if-compiled): Rename from
120 macroexp--eval-if-compile.
121 (macroexp--funcall-and-return, macroexp--warn-and-return): New funs.
122 (macroexp--expand-all): Use them (bug#12371).
123
124 * doc-view.el (doc-view-guess-paper-size)
125 (doc-view-scale-bounding-box): Fix unbound `caddr'.
126
1272012-09-19 Tassilo Horn <tsdh@gnu.org>
128
129 New feature: set optimal slice from BoundingBox information.
130 * doc-view.el (doc-view-mode-map): Add keybinding.
131 (doc-view-menu): Add menu entry.
132 (doc-view-set-slice): Adapt docstring.
133 (doc-view-get-bounding-box, doc-view-guess-paper-size)
134 (doc-view-scale-bounding-box)
135 (doc-view-set-slice-from-bounding-box): New functions.
136 (doc-view-paper-sizes): New defvar.
137
1382012-09-19 Glenn Morris <rgm@gnu.org>
139
140 * emacs-lisp/macroexp.el (byte-compile-warn-obsolete)
141 (byte-compile-log-warning): Autoload. (Bug#12371)
142
143 * calendar/calendar.el (calendar-american-month-header)
144 (calendar-european-month-header, calendar-iso-month-header)
145 (calendar-month-header): New options.
146 (calendar-set-date-style): Set calendar-month-header. Redraw calendar.
147 (calendar-generate-month): Use calendar-month-header. (Bug#9510)
148
1492012-09-19 Jan Djärv <jan.h.d@swipnet.se>
150
151 * startup.el (command-line-ns-option-alist): Add -g and --geometry.
152
1532012-09-18 Juri Linkov <juri@jurta.org>
154
155 * dired-aux.el (dired-diff): Restore original functionality of
156 getting the default value, but keep new feature of using the
157 latest existing backup file (`diff-latest-backup-file').
158
1592012-09-18 Juri Linkov <juri@jurta.org>
160
161 * dired.el (dired-mark): If the region is active in Transient Mark
162 mode, mark all files in the active region. Doc fix.
163 (dired-unmark, dired-flag-file-deletion, dired-unmark-backward):
164 Doc fix. (Bug#10624)
165
1662012-09-18 Juri Linkov <juri@jurta.org>
167
168 * dired-aux.el (dired-do-chxxx, dired-do-chmod): Default file
169 attributes for M-n are pulled from the file at point.
170 (dired-do-chgrp, dired-do-chown, dired-do-touch): Doc fix.
171 Suggested by Drew Adams. (Bug#10624)
172
1732012-09-18 Dmitry Gutov <dgutov@yandex.ru>
174
175 * progmodes/ruby-mode.el (ruby-brace-to-do-end): Don't add extra
176 whitespace after "end".
177 (ruby-do-end-to-brace): Collapse block to one line if it fits
178 within fill-column.
179
1802012-09-18 Martin Rudalics <rudalics@gmx.at>
181
182 * emacs-lisp/debug.el (debugger-bury-or-kill): Fix customization
183 value.
184 (debug): Don't remove debugger window when debugger is expected
185 to be back.
186
1872012-09-18 Chong Yidong <cyd@gnu.org>
188
189 * custom.el (defface): Doc fix.
190
191 * cus-edit.el (custom-unlispify-remove-prefixes): Add warning.
192
1932012-09-18 Martin Blais <blais@furius.ca> (tiny change)
194
195 * progmodes/compile.el (compilation-start): Use compilation-always-kill
196 to initialize query-on-exit; then test that instead (bug#12288).
197
1982012-09-17 Stefan Merten <smerten@oekonux.de>
199
200 * rst.el: Add support for `testcover'.
201 (rst-defcustom-testcover, rst-testcover-add-compose)
202 (rst-testcover-add-1value): New functions.
203 (rst-portable-mark-active-p): Replace by `use-region-p'.
204 (rst-update-section, rst-classify-adornment)
205 (rst-find-title-line): Mark `1value' forms.
206 (rst-classify-adornment): Remove superfluous form.
207 (rst-update-section, rst-get-adornments-around)
208 (rst-adornment-complete-p, rst-get-next-adornment)
209 (rst-adjust, rst-promote-region)
210 (rst-display-adornments-hierarchy, rst-straighten-adornments)
211 (rst-find-pfx-in-region, rst-section-tree-rec)
212 (rst-section-tree-point, rst-toc-insert, rst-toc-insert-node)
213 (rst-toc-node, rst-toc, rst-forward-section)
214 (rst-iterate-leftmost-paragraphs)
215 (rst-iterate-leftmost-paragraphs-2, rst-enumerate-region)
216 (rst-bullet-list-region)
217 (rst-convert-bullets-to-enumeration, rst-font-lock-keywords)
218 (rst-compile-find-conf, rst-compile)
219 (rst-repeat-last-character): Fix style.
220
2212012-09-17 Chong Yidong <cyd@gnu.org>
222
223 * comint.el (comint--complete-file-name-data): Don't add a space
224 if the status is `sole'; that adds a gratuitous space in the
225 completion-cycling case (Bug#12092).
226
227 * pcomplete.el (pcomplete-completions-at-point): Likewise.
228
2292012-09-17 Richard Stallman <rms@gnu.org>
230
231 * mail/rmailmm.el (rmail-mime-toggle-raw): Do rmail-mime-insert
232 only in the mime-shown mode, not in raw mode.
233 (rmail-mime): Toggle off mime by displaying the message without
234 mime processing. (Bug#12305)
235
236 * mail/rmail.el (rmail-retry-failure):
237 Turn off mime processing first. (Bug#12037)
238
239 * epa-mail.el (epa-mail-encrypt): Fix bug when a name has no key.
240
2412012-09-17 Chong Yidong <cyd@gnu.org>
242
243 * shell.el (shell-file-name-chars, shell-file-name-quote-list)
244 (shell-dynamic-complete-functions): Convert to defcustom.
245 (shell-prompt-pattern, shell-completion-fignore): Doc fix.
246
247 * bookmark.el (bookmark-bmenu-toggle-filenames): Doc fixes.
248 * comint.el (comint-prompt-read-only):
249 * custom.el (defcustom):
250 * hi-lock.el (hi-lock-mode):
251 * ibuffer.el (ibuffer-formats):
252 * ielm.el (ielm-prompt-read-only):
253 * novice.el (disable-command):
254 * saveplace.el (toggle-save-place):
255 * speedbar.el (speedbar-supported-extension-expressions):
256 * startup.el (auto-save-list-file-prefix, init-file-user)
257 (after-init-hook, inhibit-startup-echo-area-message):
258 * strokes.el (strokes-help):
259 * time-stamp.el (time-stamp):
260 * calendar/calendar.el (calendar, diary-file):
261 * calendar/diary-lib.el (diary-mail-entries, diary)
262 (diary-list-entries-hook):
263 * calendar/holidays.el (holidays, calendar-holidays):
264 * calendar/lunar.el (lunar-phases):
265 * calendar/solar.el (sunrise-sunset):
266 * emulation/edt.el (edt-load-keys):
267 * emulation/viper.el (viper-mode):
268 * eshell/em-alias.el (eshell-command-aliases-list):
269 * eshell/esh-util.el (eshell-convert-numeric-arguments):
270 * international/ogonek.el (ogonek-information):
271 * net/tramp-cmds.el (tramp-bug):
272 * net/quickurl.el (quickurl-reread-hook-postfix):
273 * play/decipher.el (decipher-font-lock-keywords):
274 * progmodes/cc-styles.el (c-set-style):
275 * progmodes/idlw-shell.el (idlwave-shell-prompt-pattern):
276 * progmodes/inf-lisp.el (inferior-lisp-prompt):
277 * progmodes/octave-mod.el (octave-mode):
278 * progmodes/sql.el (sql-mode, sql-interactive-mode, sql-password):
279 * progmodes/verilog-mode.el (verilog-read-defines):
280 * textmodes/two-column.el (2C-mode): Likewise.
281
2822012-09-16 Katsumi Yamaoka <yamaoka@jpl.org>
283
284 * mail/mailabbrev.el (mail-abbrev-expand-hook): Work for a mail aliasee
285 that holds many addresses.
286
12012-09-16 Chong Yidong <cyd@gnu.org> 2872012-09-16 Chong Yidong <cyd@gnu.org>
2 288
289 * align.el (align-areas): Call the indication function with
290 positions instead of markers for arguments (Bug#12343).
291
3 * files.el (parse-colon-path): Use split-string (Bug#12351). 292 * files.el (parse-colon-path): Use split-string (Bug#12351).
4 293
5 * window.el (special-display-popup-frame): Doc fix (Bug#8853). 294 * window.el (special-display-popup-frame): Doc fix (Bug#8853).
6 (display-buffer-function): Mark as obsolete. 295 (display-buffer-function): Mark as obsolete.
7 296
8 * progmodes/compile.el (compilation-parse-errors): Accept list 297 * progmodes/compile.el (compilation-parse-errors): Accept list
9 values similar to font-lock-keywords (Bug#12136). Suggested by 298 values similar to font-lock-keywords (Bug#12136).
10 Oleksandr Manzyuk. 299 Suggested by Oleksandr Manzyuk.
11 (compilation-error-regexp-alist): Doc fix. 300 (compilation-error-regexp-alist): Doc fix.
12 301
132012-09-15 Glenn Morris <rgm@gnu.org> 3022012-09-15 Glenn Morris <rgm@gnu.org>
@@ -1610,7 +1899,7 @@
1610 :local as the address. 1899 :local as the address.
1611 (list-processes): Doc fix. 1900 (list-processes): Doc fix.
1612 1901
16132012-08-04 Michal Nazarewicz <mina86@mina86.com> (tiny change) 19022012-08-04 Michal Nazarewicz <mina86@mina86.com>
1614 1903
1615 * lisp/mpc.el: Support password in host argument. 1904 * lisp/mpc.el: Support password in host argument.
1616 (mpc--proc-connect): Parse and use new password element. 1905 (mpc--proc-connect): Parse and use new password element.
diff --git a/lisp/align.el b/lisp/align.el
index 4c82d7bea81..0af5e56c668 100644
--- a/lisp/align.el
+++ b/lisp/align.el
@@ -74,7 +74,7 @@
74;; align-?-modes variables (for example, `align-dq-string-modes'), use 74;; align-?-modes variables (for example, `align-dq-string-modes'), use
75;; `add-to-list', or some similar function which checks first to see 75;; `add-to-list', or some similar function which checks first to see
76;; if the value is already there. Since the user may customize that 76;; if the value is already there. Since the user may customize that
77;; mode list, and then write your mode name into their .emacs file, 77;; mode list, and then write your mode name into their init file,
78;; causing the symbol already to be present the next time they load 78;; causing the symbol already to be present the next time they load
79;; your package. 79;; your package.
80 80
@@ -1201,7 +1201,10 @@ have been aligned. No changes will be made to the buffer."
1201 (gocol col) cur) 1201 (gocol col) cur)
1202 (when area 1202 (when area
1203 (if func 1203 (if func
1204 (funcall func (car area) (cdr area) change) 1204 (funcall func
1205 (marker-position (car area))
1206 (marker-position (cdr area))
1207 change)
1205 (if (not (and justify 1208 (if (not (and justify
1206 (consp (cdr area)))) 1209 (consp (cdr area))))
1207 (goto-char (cdr area)) 1210 (goto-char (cdr area))
diff --git a/lisp/autoinsert.el b/lisp/autoinsert.el
index fbf8c466585..21c35811ac3 100644
--- a/lisp/autoinsert.el
+++ b/lisp/autoinsert.el
@@ -36,7 +36,7 @@
36;; setq auto-insert-directory to an appropriate slash-terminated value 36;; setq auto-insert-directory to an appropriate slash-terminated value
37;; 37;;
38;; You can also customize the variable `auto-insert-mode' to load the 38;; You can also customize the variable `auto-insert-mode' to load the
39;; package. Alternatively, add the following to your .emacs file: 39;; package. Alternatively, add the following to your init file:
40;; (auto-insert-mode 1) 40;; (auto-insert-mode 1)
41;; 41;;
42;; Author: Charlie Martin 42;; Author: Charlie Martin
diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index 75a8d9f59dc..31bbc13acf9 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -144,10 +144,7 @@ You can toggle whether files are shown with \\<bookmark-bmenu-mode-map>\\[bookma
144 144
145(defcustom bookmark-bmenu-toggle-filenames t 145(defcustom bookmark-bmenu-toggle-filenames t
146 "Non-nil means show filenames when listing bookmarks. 146 "Non-nil means show filenames when listing bookmarks.
147This may result in truncated bookmark names. To disable this, put the 147A non-nil value may result in truncated bookmark names."
148following in your `.emacs' file:
149
150\(setq bookmark-bmenu-toggle-filenames nil)"
151 :type 'boolean 148 :type 'boolean
152 :group 'bookmark) 149 :group 'bookmark)
153 150
diff --git a/lisp/calc/calc-aent.el b/lisp/calc/calc-aent.el
index 4b91a8c2002..4cca7fb7e7f 100644
--- a/lisp/calc/calc-aent.el
+++ b/lisp/calc/calc-aent.el
@@ -286,8 +286,7 @@ The value t means abort and give an error message.")
286 286
287;;;###autoload 287;;;###autoload
288(defun calc-alg-entry (&optional initial prompt) 288(defun calc-alg-entry (&optional initial prompt)
289 (let* ((sel-mode nil) 289 (let* ((calc-dollar-values (mapcar #'calc-get-stack-element
290 (calc-dollar-values (mapcar 'calc-get-stack-element
291 (nthcdr calc-stack-top calc-stack))) 290 (nthcdr calc-stack-top calc-stack)))
292 (calc-dollar-used 0) 291 (calc-dollar-used 0)
293 (calc-plain-entry t) 292 (calc-plain-entry t)
diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el
index 2fd5ad6fd9c..c7d93530fd7 100644
--- a/lisp/calc/calc-ext.el
+++ b/lisp/calc/calc-ext.el
@@ -3483,7 +3483,7 @@ If X is not an error form, return 1."
3483 (substring str i)))) 3483 (substring str i))))
3484 str)) 3484 str))
3485 3485
3486;;; Users can redefine this in their .emacs files. 3486;;; Users can redefine this in their init files.
3487(defvar calc-keypad-user-menu nil 3487(defvar calc-keypad-user-menu nil
3488 "If non-nil, this describes an additional menu for calc-keypad. 3488 "If non-nil, this describes an additional menu for calc-keypad.
3489It should contain a list of three rows. 3489It should contain a list of three rows.
diff --git a/lisp/calc/calc-forms.el b/lisp/calc/calc-forms.el
index dfc5dfc6588..bd748158d66 100644
--- a/lisp/calc/calc-forms.el
+++ b/lisp/calc/calc-forms.el
@@ -494,7 +494,7 @@
494 (car res)))))))) 494 (car res))))))))
495 495
496 496
497;;; It is safe to redefine these in your .emacs file to use a different 497;;; It is safe to redefine these in your init file to use a different
498;;; language. 498;;; language.
499 499
500(defvar math-long-weekday-names '( "Sunday" "Monday" "Tuesday" "Wednesday" 500(defvar math-long-weekday-names '( "Sunday" "Monday" "Tuesday" "Wednesday"
diff --git a/lisp/calc/calc-map.el b/lisp/calc/calc-map.el
index 2519e960e0e..9276e1a7832 100644
--- a/lisp/calc/calc-map.el
+++ b/lisp/calc/calc-map.el
@@ -32,8 +32,7 @@
32(defun calc-apply (&optional oper) 32(defun calc-apply (&optional oper)
33 (interactive) 33 (interactive)
34 (calc-wrapper 34 (calc-wrapper
35 (let* ((sel-mode nil) 35 (let* ((calc-dollar-values (mapcar #'calc-get-stack-element
36 (calc-dollar-values (mapcar 'calc-get-stack-element
37 (nthcdr calc-stack-top calc-stack))) 36 (nthcdr calc-stack-top calc-stack)))
38 (calc-dollar-used 0) 37 (calc-dollar-used 0)
39 (oper (or oper (calc-get-operator "Apply" 38 (oper (or oper (calc-get-operator "Apply"
@@ -53,11 +52,10 @@
53(defun calc-reduce (&optional oper accum) 52(defun calc-reduce (&optional oper accum)
54 (interactive) 53 (interactive)
55 (calc-wrapper 54 (calc-wrapper
56 (let* ((sel-mode nil) 55 (let* ((nest (calc-is-hyperbolic))
57 (nest (calc-is-hyperbolic))
58 (rev (calc-is-inverse)) 56 (rev (calc-is-inverse))
59 (nargs (if (and nest (not rev)) 2 1)) 57 (nargs (if (and nest (not rev)) 2 1))
60 (calc-dollar-values (mapcar 'calc-get-stack-element 58 (calc-dollar-values (mapcar #'calc-get-stack-element
61 (nthcdr calc-stack-top calc-stack))) 59 (nthcdr calc-stack-top calc-stack)))
62 (calc-dollar-used 0) 60 (calc-dollar-used 0)
63 (calc-mapping-dir (and (not accum) (not nest) "")) 61 (calc-mapping-dir (and (not accum) (not nest) ""))
@@ -99,8 +97,7 @@
99(defun calc-map (&optional oper) 97(defun calc-map (&optional oper)
100 (interactive) 98 (interactive)
101 (calc-wrapper 99 (calc-wrapper
102 (let* ((sel-mode nil) 100 (let* ((calc-dollar-values (mapcar #'calc-get-stack-element
103 (calc-dollar-values (mapcar 'calc-get-stack-element
104 (nthcdr calc-stack-top calc-stack))) 101 (nthcdr calc-stack-top calc-stack)))
105 (calc-dollar-used 0) 102 (calc-dollar-used 0)
106 (calc-mapping-dir "") 103 (calc-mapping-dir "")
@@ -120,8 +117,7 @@
120(defun calc-map-equation (&optional oper) 117(defun calc-map-equation (&optional oper)
121 (interactive) 118 (interactive)
122 (calc-wrapper 119 (calc-wrapper
123 (let* ((sel-mode nil) 120 (let* ((calc-dollar-values (mapcar #'calc-get-stack-element
124 (calc-dollar-values (mapcar 'calc-get-stack-element
125 (nthcdr calc-stack-top calc-stack))) 121 (nthcdr calc-stack-top calc-stack)))
126 (calc-dollar-used 0) 122 (calc-dollar-used 0)
127 (oper (or oper (calc-get-operator "Map-equation"))) 123 (oper (or oper (calc-get-operator "Map-equation")))
@@ -152,8 +148,7 @@
152(defun calc-outer-product (&optional oper) 148(defun calc-outer-product (&optional oper)
153 (interactive) 149 (interactive)
154 (calc-wrapper 150 (calc-wrapper
155 (let* ((sel-mode nil) 151 (let* ((calc-dollar-values (mapcar #'calc-get-stack-element
156 (calc-dollar-values (mapcar 'calc-get-stack-element
157 (nthcdr calc-stack-top calc-stack))) 152 (nthcdr calc-stack-top calc-stack)))
158 (calc-dollar-used 0) 153 (calc-dollar-used 0)
159 (oper (or oper (calc-get-operator "Outer" 2)))) 154 (oper (or oper (calc-get-operator "Outer" 2))))
@@ -170,8 +165,7 @@
170(defun calc-inner-product (&optional mul-oper add-oper) 165(defun calc-inner-product (&optional mul-oper add-oper)
171 (interactive) 166 (interactive)
172 (calc-wrapper 167 (calc-wrapper
173 (let* ((sel-mode nil) 168 (let* ((calc-dollar-values (mapcar #'calc-get-stack-element
174 (calc-dollar-values (mapcar 'calc-get-stack-element
175 (nthcdr calc-stack-top calc-stack))) 169 (nthcdr calc-stack-top calc-stack)))
176 (calc-dollar-used 0) 170 (calc-dollar-used 0)
177 (mul-oper (or mul-oper (calc-get-operator "Inner (Mult)" 2))) 171 (mul-oper (or mul-oper (calc-get-operator "Inner (Mult)" 2)))
diff --git a/lisp/calc/calc-store.el b/lisp/calc/calc-store.el
index 80d355ed5fa..64df10a40ca 100644
--- a/lisp/calc/calc-store.el
+++ b/lisp/calc/calc-store.el
@@ -235,8 +235,7 @@
235(defun calc-store-map (&optional oper var) 235(defun calc-store-map (&optional oper var)
236 (interactive) 236 (interactive)
237 (calc-wrapper 237 (calc-wrapper
238 (let* ((sel-mode nil) 238 (let* ((calc-dollar-values (mapcar #'calc-get-stack-element
239 (calc-dollar-values (mapcar 'calc-get-stack-element
240 (nthcdr calc-stack-top calc-stack))) 239 (nthcdr calc-stack-top calc-stack)))
241 (calc-dollar-used 0) 240 (calc-dollar-used 0)
242 (oper (or oper (calc-get-operator "Store Mapping"))) 241 (oper (or oper (calc-get-operator "Store Mapping")))
diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el
index 17f0998d30b..25f591a3945 100644
--- a/lisp/calc/calc.el
+++ b/lisp/calc/calc.el
@@ -912,35 +912,6 @@ Used by `calc-user-invocation'.")
912(defvar calc-embedded-mode-hook nil 912(defvar calc-embedded-mode-hook nil
913 "Hook run when starting embedded mode.") 913 "Hook run when starting embedded mode.")
914 914
915;; Set up the autoloading linkage.
916(let ((name (and (fboundp 'calc-dispatch)
917 (autoloadp (symbol-function 'calc-dispatch))
918 (nth 1 (symbol-function 'calc-dispatch))))
919 (p load-path))
920
921 ;; If Calc files exist on the load-path, we're all set.
922 (while (and p (not (file-exists-p
923 (expand-file-name "calc-misc.elc" (car p)))))
924 (setq p (cdr p)))
925 (or p
926
927 ;; If Calc is autoloaded using a path name, look there for Calc files.
928 ;; This works for both relative ("calc/calc.elc") and absolute paths.
929 (and name (file-name-directory name)
930 (let ((p2 load-path)
931 (name2 (concat (file-name-directory name)
932 "calc-misc.elc")))
933 (while (and p2 (not (file-exists-p
934 (expand-file-name name2 (car p2)))))
935 (setq p2 (cdr p2)))
936 (when p2
937 (setq load-path (nconc load-path
938 (list
939 (directory-file-name
940 (file-name-directory
941 (expand-file-name
942 name (car p2))))))))))))
943
944;; The following modes use specially-formatted data. 915;; The following modes use specially-formatted data.
945(put 'calc-mode 'mode-class 'special) 916(put 'calc-mode 'mode-class 'special)
946(put 'calc-trail-mode 'mode-class 'special) 917(put 'calc-trail-mode 'mode-class 'special)
@@ -1353,12 +1324,12 @@ Notations: 3.14e6 3.14 * 10^6
1353\\{calc-mode-map} 1324\\{calc-mode-map}
1354" 1325"
1355 (interactive) 1326 (interactive)
1356 (mapc (function 1327 (mapc (function ;FIXME: Why (set-default v (symbol-value v)) ?!?!?
1357 (lambda (v) (set-default v (symbol-value v)))) calc-local-var-list) 1328 (lambda (v) (set-default v (symbol-value v)))) calc-local-var-list)
1358 (kill-all-local-variables) 1329 (kill-all-local-variables)
1359 (use-local-map (if (eq calc-algebraic-mode 'total) 1330 (use-local-map (if (eq calc-algebraic-mode 'total)
1360 (progn (require 'calc-ext) calc-alg-map) calc-mode-map)) 1331 (progn (require 'calc-ext) calc-alg-map) calc-mode-map))
1361 (mapc (function (lambda (v) (make-local-variable v))) calc-local-var-list) 1332 (mapc #'make-local-variable calc-local-var-list)
1362 (make-local-variable 'overlay-arrow-position) 1333 (make-local-variable 'overlay-arrow-position)
1363 (make-local-variable 'overlay-arrow-string) 1334 (make-local-variable 'overlay-arrow-string)
1364 (add-hook 'change-major-mode-hook 'font-lock-defontify nil t) 1335 (add-hook 'change-major-mode-hook 'font-lock-defontify nil t)
@@ -1395,7 +1366,7 @@ Notations: 3.14e6 3.14 * 10^6
1395 (if calc-buffer-list (setq calc-stack (copy-sequence calc-stack))) 1366 (if calc-buffer-list (setq calc-stack (copy-sequence calc-stack)))
1396 (add-to-list 'calc-buffer-list (current-buffer) t)) 1367 (add-to-list 'calc-buffer-list (current-buffer) t))
1397 1368
1398(defvar calc-check-defines 'calc-check-defines) ; suitable for run-hooks 1369(defvar calc-check-defines 'calc-check-defines) ; Suitable for run-hooks.
1399(defun calc-check-defines () 1370(defun calc-check-defines ()
1400 (if (symbol-plist 'calc-define) 1371 (if (symbol-plist 'calc-define)
1401 (let ((plist (copy-sequence (symbol-plist 'calc-define)))) 1372 (let ((plist (copy-sequence (symbol-plist 'calc-define))))
@@ -1943,8 +1914,7 @@ See calc-keypad for details."
1943 (delete-region (point) (point-max)))) 1914 (delete-region (point) (point-max))))
1944 (calc-set-command-flag 'renum-stack)))))) 1915 (calc-set-command-flag 'renum-stack))))))
1945 1916
1946(defvar sel-mode) 1917(defun calc-get-stack-element (x &optional sel-mode)
1947(defun calc-get-stack-element (x)
1948 (cond ((eq sel-mode 'entry) 1918 (cond ((eq sel-mode 'entry)
1949 x) 1919 x)
1950 ((eq sel-mode 'sel) 1920 ((eq sel-mode 'sel)
@@ -1961,9 +1931,9 @@ See calc-keypad for details."
1961(defun calc-top (&optional n sel-mode) 1931(defun calc-top (&optional n sel-mode)
1962 (or n (setq n 1)) 1932 (or n (setq n 1))
1963 (calc-check-stack n) 1933 (calc-check-stack n)
1964 (calc-get-stack-element (nth (+ n calc-stack-top -1) calc-stack))) 1934 (calc-get-stack-element (nth (+ n calc-stack-top -1) calc-stack) sel-mode))
1965 1935
1966(defun calc-top-n (&optional n sel-mode) ; in case precision has changed 1936(defun calc-top-n (&optional n sel-mode) ; In case precision has changed.
1967 (math-check-complete (calc-normalize (calc-top n sel-mode)))) 1937 (math-check-complete (calc-normalize (calc-top n sel-mode))))
1968 1938
1969(defun calc-top-list (&optional n m sel-mode) 1939(defun calc-top-list (&optional n m sel-mode)
@@ -1974,7 +1944,8 @@ See calc-keypad for details."
1974 (let ((top (copy-sequence (nthcdr (+ m calc-stack-top -1) 1944 (let ((top (copy-sequence (nthcdr (+ m calc-stack-top -1)
1975 calc-stack)))) 1945 calc-stack))))
1976 (setcdr (nthcdr (1- n) top) nil) 1946 (setcdr (nthcdr (1- n) top) nil)
1977 (nreverse (mapcar 'calc-get-stack-element top))))) 1947 (nreverse
1948 (mapcar (lambda (x) (calc-get-stack-element x sel-mode)) top)))))
1978 1949
1979(defun calc-top-list-n (&optional n m sel-mode) 1950(defun calc-top-list-n (&optional n m sel-mode)
1980 (mapcar 'math-check-complete 1951 (mapcar 'math-check-complete
diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el
index d5514d14a32..93ef440541e 100644
--- a/lisp/calendar/calendar.el
+++ b/lisp/calendar/calendar.el
@@ -593,7 +593,7 @@ You can customize `diary-date-forms' to your preferred format.
593Three default styles are provided: `diary-american-date-forms', 593Three default styles are provided: `diary-american-date-forms',
594`diary-european-date-forms', and `diary-iso-date-forms'. 594`diary-european-date-forms', and `diary-iso-date-forms'.
595You can choose between these by setting `calendar-date-style' in your 595You can choose between these by setting `calendar-date-style' in your
596.emacs file, or by using `calendar-set-date-style' when in the calendar. 596init file, or by using `calendar-set-date-style' when in the calendar.
597 597
598A diary entry can be preceded by the character `diary-nonmarking-symbol' 598A diary entry can be preceded by the character `diary-nonmarking-symbol'
599\(ordinarily `&') to make that entry nonmarking--that is, it will not be 599\(ordinarily `&') to make that entry nonmarking--that is, it will not be
@@ -921,6 +921,64 @@ styles."
921 calendar-american-date-display-form) 921 calendar-american-date-display-form)
922 :group 'calendar) 922 :group 'calendar)
923 923
924(defcustom calendar-american-month-header
925 '(propertize (format "%s %d" (calendar-month-name month) year)
926 'font-lock-face 'font-lock-function-name-face)
927 "Default format for calendar month headings with the American date style.
928Normally you should not customize this, but `calender-month-header'."
929 :group 'calendar
930 :risky t
931 :type 'sexp
932 :version "24.3")
933
934(defcustom calendar-european-month-header
935 '(propertize (format "%s %d" (calendar-month-name month) year)
936 'font-lock-face 'font-lock-function-name-face)
937 "Default format for calendar month headings with the European date style.
938Normally you should not customize this, but `calender-month-header'."
939 :group 'calendar
940 :risky t
941 :type 'sexp
942 :version "24.3")
943
944(defcustom calendar-iso-month-header
945 '(propertize (format "%d %s" year (calendar-month-name month))
946 'font-lock-face 'font-lock-function-name-face)
947 "Default format for calendar month headings with the ISO date style.
948Normally you should not customize this, but `calender-month-header'."
949 :group 'calendar
950 :risky t
951 :type 'sexp
952 :version "24.3")
953
954(defcustom calendar-month-header
955 (cond ((eq calendar-date-style 'iso)
956 calendar-iso-month-header)
957 ((eq calendar-date-style 'european)
958 calendar-european-month-header)
959 (t calendar-american-month-header))
960 "Expression to evaluate to return the calendar month headings.
961When this expression is evaluated, the variables MONTH and YEAR are
962integers appropriate to the relevant month. The result is padded
963to the width of `calendar-month-digit-width'.
964
965For examples of three common styles, see `calendar-american-month-header',
966`calendar-european-month-header', and `calendar-iso-month-header'.
967
968Changing this variable without using customize has no effect on
969pre-existing calendar windows."
970 :group 'calendar
971 :initialize 'custom-initialize-default
972 :risky t
973 :set (lambda (sym val)
974 (set sym val)
975 (calendar-redraw))
976 :set-after '(calendar-date-style calendar-american-month-header
977 calendar-european-month-header
978 calendar-iso-month-header)
979 :type 'sexp
980 :version "24.3")
981
924(defun calendar-set-date-style (style) 982(defun calendar-set-date-style (style)
925 "Set the style of calendar and diary dates to STYLE (a symbol). 983 "Set the style of calendar and diary dates to STYLE (a symbol).
926The valid styles are described in the documentation of `calendar-date-style'." 984The valid styles are described in the documentation of `calendar-date-style'."
@@ -934,8 +992,11 @@ The valid styles are described in the documentation of `calendar-date-style'."
934 calendar-date-display-form 992 calendar-date-display-form
935 (symbol-value (intern-soft 993 (symbol-value (intern-soft
936 (format "calendar-%s-date-display-form" style))) 994 (format "calendar-%s-date-display-form" style)))
995 calendar-month-header
996 (symbol-value (intern-soft (format "calendar-%s-month-header" style)))
937 diary-date-forms 997 diary-date-forms
938 (symbol-value (intern-soft (format "diary-%s-date-forms" style)))) 998 (symbol-value (intern-soft (format "diary-%s-date-forms" style))))
999 (calendar-redraw)
939 (calendar-update-mode-line)) 1000 (calendar-update-mode-line))
940 1001
941(defun european-calendar () 1002(defun european-calendar ()
@@ -1276,7 +1337,7 @@ Runs the following hooks:
1276 generating a calendar, if today's date is visible or not, respectively 1337 generating a calendar, if today's date is visible or not, respectively
1277`calendar-initial-window-hook' - after first creating a calendar 1338`calendar-initial-window-hook' - after first creating a calendar
1278 1339
1279This function is suitable for execution in a .emacs file." 1340This function is suitable for execution in an init file."
1280 (interactive "P") 1341 (interactive "P")
1281 ;; Avoid loading cal-x unless it will be used. 1342 ;; Avoid loading cal-x unless it will be used.
1282 (if (and (memq calendar-setup '(one-frame two-frames calendar-only)) 1343 (if (and (memq calendar-setup '(one-frame two-frames calendar-only))
@@ -1463,9 +1524,8 @@ line."
1463 (goto-char (point-min)) 1524 (goto-char (point-min))
1464 (calendar-move-to-column indent) 1525 (calendar-move-to-column indent)
1465 (insert 1526 (insert
1466 (calendar-string-spread 1527 (calendar-string-spread (list calendar-month-header)
1467 (list (format "%s %d" (calendar-month-name month) year)) 1528 ?\s calendar-month-digit-width))
1468 ?\s calendar-month-digit-width))
1469 (calendar-ensure-newline) 1529 (calendar-ensure-newline)
1470 (calendar-insert-at-column indent calendar-intermonth-header trunc) 1530 (calendar-insert-at-column indent calendar-intermonth-header trunc)
1471 ;; Use the first two characters of each day to head the columns. 1531 ;; Use the first two characters of each day to head the columns.
@@ -2222,9 +2282,12 @@ Negative years are interpreted as years BC; -1 being 1 BC, and so on."
2222 (- mon2 mon1))) 2282 (- mon2 mon1)))
2223 2283
2224(defvar calendar-font-lock-keywords 2284(defvar calendar-font-lock-keywords
2285 ;; Month and year. Not really needed now that calendar-month-header
2286 ;; contains propertize, and not correct for non-american forms
2287 ;; of that variable.
2225 `((,(concat (regexp-opt (mapcar 'identity calendar-month-name-array) t) 2288 `((,(concat (regexp-opt (mapcar 'identity calendar-month-name-array) t)
2226 " -?[0-9]+") 2289 " -?[0-9]+")
2227 . font-lock-function-name-face) ; month and year 2290 . font-lock-function-name-face)
2228 (,(regexp-opt 2291 (,(regexp-opt
2229 (list (substring (aref calendar-day-name-array 6) 2292 (list (substring (aref calendar-day-name-array 6)
2230 0 calendar-day-header-width) 2293 0 calendar-day-header-width)
diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el
index 8fa5b0ddb07..4bce8ec0927 100644
--- a/lisp/calendar/diary-lib.el
+++ b/lisp/calendar/diary-lib.el
@@ -200,19 +200,21 @@ holidays), or hard copy output."
200 'diary-list-entries-hook "23.1") 200 'diary-list-entries-hook "23.1")
201 201
202(defcustom diary-list-entries-hook nil 202(defcustom diary-list-entries-hook nil
203 "List of functions called after diary file is culled for relevant entries. 203 "Hook run after diary file is culled for relevant entries.
204You might wish to add `diary-include-other-diary-files', in which case 204
205you will probably also want to add `diary-mark-included-diary-files' to 205If you add `diary-include-other-diary-files' to this hook, you
206`diary-mark-entries-hook'. For example, you could use 206will probably also want to add `diary-mark-included-diary-files'
207to `diary-mark-entries-hook'. For example, to cause the fancy
208diary buffer to be displayed with diary entries from various
209included files, each day's entries sorted into lexicographic
210order, add the following to your init file:
207 211
208 (setq diary-display-function 'diary-fancy-display) 212 (setq diary-display-function 'diary-fancy-display)
209 (add-hook 'diary-list-entries-hook 'diary-include-other-diary-files) 213 (add-hook 'diary-list-entries-hook 'diary-include-other-diary-files)
210 (add-hook 'diary-list-entries-hook 'diary-sort-entries t) 214 (add-hook 'diary-list-entries-hook 'diary-sort-entries t)
211 215
212in your `.emacs' file to cause the fancy diary buffer to be displayed with 216Note how the sort function is placed last, so that it can sort
213diary entries from various included files, each day's entries sorted into 217the entries included from other files.
214lexicographic order. Note how the sort function is placed last,
215so that it can sort the entries included from other files.
216 218
217This hook runs after `diary-nongregorian-listing-hook'. These two hooks 219This hook runs after `diary-nongregorian-listing-hook'. These two hooks
218differ only if you are using included diary files. In that case, 220differ only if you are using included diary files. In that case,
@@ -532,7 +534,7 @@ If so, return the expanded file name, otherwise signal an error."
532 "Generate the diary window for ARG days starting with the current date. 534 "Generate the diary window for ARG days starting with the current date.
533If no argument is provided, the number of days of diary entries is governed 535If no argument is provided, the number of days of diary entries is governed
534by the variable `diary-number-of-entries'. A value of ARG less than 1 536by the variable `diary-number-of-entries'. A value of ARG less than 1
535does nothing. This function is suitable for execution in a `.emacs' file." 537does nothing. This function is suitable for execution in an init file."
536 (interactive "P") 538 (interactive "P")
537 (diary-check-diary-file) 539 (diary-check-diary-file)
538 (diary-list-entries (calendar-current-date) 540 (diary-list-entries (calendar-current-date)
@@ -1230,8 +1232,8 @@ Mail is sent to the address specified by `diary-mail-addr'.
1230 1232
1231Here is an example of a script to call `diary-mail-entries', 1233Here is an example of a script to call `diary-mail-entries',
1232suitable for regular scheduling using cron (or at). Note that 1234suitable for regular scheduling using cron (or at). Note that
1233since `emacs -script' does not load your `.emacs' file, you 1235since `emacs -script' does not load your init file, you should
1234should ensure that all relevant variables are set. 1236ensure that all relevant variables are set.
1235 1237
1236#!/usr/bin/emacs -script 1238#!/usr/bin/emacs -script
1237;; diary-rem.el - run the Emacs diary-reminder 1239;; diary-rem.el - run the Emacs diary-reminder
diff --git a/lisp/calendar/holidays.el b/lisp/calendar/holidays.el
index 9643a1e2905..b94815f98ea 100644
--- a/lisp/calendar/holidays.el
+++ b/lisp/calendar/holidays.el
@@ -343,12 +343,12 @@ See the documentation for `calendar-holidays' for details."
343 "List of notable days for the command \\[holidays]. 343 "List of notable days for the command \\[holidays].
344 344
345Additional holidays are easy to add to the list, just put them in the 345Additional holidays are easy to add to the list, just put them in the
346list `holiday-other-holidays' in your .emacs file. Similarly, by setting 346list `holiday-other-holidays' in your init file. Similarly, by setting
347any of `holiday-general-holidays', `holiday-local-holidays', 347any of `holiday-general-holidays', `holiday-local-holidays',
348`holiday-christian-holidays', `holiday-hebrew-holidays', 348`holiday-christian-holidays', `holiday-hebrew-holidays',
349`holiday-islamic-holidays', `holiday-bahai-holidays', 349`holiday-islamic-holidays', `holiday-bahai-holidays',
350`holiday-oriental-holidays', or `holiday-solar-holidays' to nil in your 350`holiday-oriental-holidays', or `holiday-solar-holidays' to nil in your
351.emacs file, you can eliminate unwanted categories of holidays. 351init file, you can eliminate unwanted categories of holidays.
352 352
353The aforementioned variables control the holiday choices offered 353The aforementioned variables control the holiday choices offered
354by the function `holiday-list' when it is called interactively. 354by the function `holiday-list' when it is called interactively.
@@ -523,7 +523,7 @@ use instead of point."
523(defun holidays (&optional arg) 523(defun holidays (&optional arg)
524 "Display the holidays for last month, this month, and next month. 524 "Display the holidays for last month, this month, and next month.
525If called with an optional prefix argument ARG, prompts for month and year. 525If called with an optional prefix argument ARG, prompts for month and year.
526This function is suitable for execution in a .emacs file." 526This function is suitable for execution in a init file."
527 (interactive "P") 527 (interactive "P")
528 (save-excursion 528 (save-excursion
529 (let* ((completion-ignore-case t) 529 (let* ((completion-ignore-case t)
diff --git a/lisp/calendar/lunar.el b/lisp/calendar/lunar.el
index 8f09d20f50e..2761df0bdb1 100644
--- a/lisp/calendar/lunar.el
+++ b/lisp/calendar/lunar.el
@@ -236,7 +236,7 @@ use instead of point."
236(defun lunar-phases (&optional arg) 236(defun lunar-phases (&optional arg)
237 "Display the quarters of the moon for last month, this month, and next month. 237 "Display the quarters of the moon for last month, this month, and next month.
238If called with an optional prefix argument ARG, prompts for month and year. 238If called with an optional prefix argument ARG, prompts for month and year.
239This function is suitable for execution in a .emacs file." 239This function is suitable for execution in an init file."
240 (interactive "P") 240 (interactive "P")
241 (save-excursion 241 (save-excursion
242 (let* ((date (if arg (calendar-read-date t) 242 (let* ((date (if arg (calendar-read-date t)
diff --git a/lisp/calendar/solar.el b/lisp/calendar/solar.el
index a8d7d44af3b..3ccdf135fb6 100644
--- a/lisp/calendar/solar.el
+++ b/lisp/calendar/solar.el
@@ -797,7 +797,7 @@ If called with an optional prefix argument ARG, prompt for date.
797If called with an optional double prefix argument, prompt for 797If called with an optional double prefix argument, prompt for
798longitude, latitude, time zone, and date, and always use standard time. 798longitude, latitude, time zone, and date, and always use standard time.
799 799
800This function is suitable for execution in a .emacs file." 800This function is suitable for execution in an init file."
801 (interactive "p") 801 (interactive "p")
802 (or arg (setq arg 1)) 802 (or arg (setq arg 1))
803 (if (and (< arg 16) 803 (if (and (< arg 16)
diff --git a/lisp/calendar/timeclock.el b/lisp/calendar/timeclock.el
index 2ebb8c7c3ae..3151ce145de 100644
--- a/lisp/calendar/timeclock.el
+++ b/lisp/calendar/timeclock.el
@@ -49,7 +49,7 @@
49;; If you want Emacs to display the amount of time "left" to your 49;; If you want Emacs to display the amount of time "left" to your
50;; workday in the mode-line, you can either set the value of 50;; workday in the mode-line, you can either set the value of
51;; `timeclock-mode-line-display' to t using M-x customize, or you can 51;; `timeclock-mode-line-display' to t using M-x customize, or you can
52;; add this code to your .emacs file: 52;; add this code to your init file:
53;; 53;;
54;; (require 'timeclock) 54;; (require 'timeclock)
55;; (timeclock-mode-line-display) 55;; (timeclock-mode-line-display)
@@ -60,7 +60,7 @@
60;; You may also want Emacs to ask you before exiting, if you are 60;; You may also want Emacs to ask you before exiting, if you are
61;; currently working on a project. This can be done either by setting 61;; currently working on a project. This can be done either by setting
62;; `timeclock-ask-before-exiting' to t using M-x customize (this is 62;; `timeclock-ask-before-exiting' to t using M-x customize (this is
63;; the default), or by adding the following to your .emacs file: 63;; the default), or by adding the following to your init file:
64;; 64;;
65;; (add-hook 'kill-emacs-query-functions 'timeclock-query-out) 65;; (add-hook 'kill-emacs-query-functions 'timeclock-query-out)
66 66
diff --git a/lisp/comint.el b/lisp/comint.el
index 5b0eb3027e6..994d81a375a 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -181,7 +181,7 @@ override the read-only-ness of comint prompts is to call
181`comint-kill-whole-line' or `comint-kill-region' with no 181`comint-kill-whole-line' or `comint-kill-region' with no
182narrowing in effect. This way you will be certain that none of 182narrowing in effect. This way you will be certain that none of
183the remaining prompts will be accidentally messed up. You may 183the remaining prompts will be accidentally messed up. You may
184wish to put something like the following in your `.emacs' file: 184wish to put something like the following in your init file:
185 185
186\(add-hook 'comint-mode-hook 186\(add-hook 'comint-mode-hook
187 (lambda () 187 (lambda ()
@@ -3161,8 +3161,8 @@ See `completion-table-with-quoting' and `comint-unquote-function'.")
3161 (complete-with-action action table string pred)))) 3161 (complete-with-action action table string pred))))
3162 (unless (zerop (length filesuffix)) 3162 (unless (zerop (length filesuffix))
3163 (list :exit-function 3163 (list :exit-function
3164 (lambda (_s finished) 3164 (lambda (_s status)
3165 (when (memq finished '(sole finished)) 3165 (when (eq status 'finished)
3166 (if (looking-at (regexp-quote filesuffix)) 3166 (if (looking-at (regexp-quote filesuffix))
3167 (goto-char (match-end 0)) 3167 (goto-char (match-end 0))
3168 (insert filesuffix))))))))) 3168 (insert filesuffix)))))))))
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 86a19131569..2e6f2b14625 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -526,7 +526,10 @@ WIDGET is the widget to apply the filter entries of MENU on."
526 :type 'boolean) 526 :type 'boolean)
527 527
528(defcustom custom-unlispify-remove-prefixes nil 528(defcustom custom-unlispify-remove-prefixes nil
529 "Non-nil means remove group prefixes from option names in buffer." 529 "Non-nil means remove group prefixes from option names in buffer.
530Discarding prefixes often leads to confusing names for options
531and faces in Customize buffers, so do not set this to a non-nil
532value unless you are sure you know what it does."
530 :group 'custom-menu 533 :group 'custom-menu
531 :group 'custom-buffer 534 :group 'custom-buffer
532 :type 'boolean) 535 :type 'boolean)
diff --git a/lisp/custom.el b/lisp/custom.el
index 1f0729cfd97..dfc8e631152 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -237,7 +237,7 @@ The following keywords are meaningful:
237 is `default-value'. 237 is `default-value'.
238:require 238:require
239 VALUE should be a feature symbol. If you save a value 239 VALUE should be a feature symbol. If you save a value
240 for this option, then when your `.emacs' file loads the value, 240 for this option, then when your init file loads the value,
241 it does (require VALUE) first. 241 it does (require VALUE) first.
242:set-after VARIABLES 242:set-after VARIABLES
243 Specifies that SYMBOL should be set after the list of variables 243 Specifies that SYMBOL should be set after the list of variables
@@ -350,68 +350,62 @@ FACE does not need to be quoted.
350 350
351Third argument DOC is the face documentation. 351Third argument DOC is the face documentation.
352 352
353If FACE has been set with `custom-set-faces', set the face attributes 353If FACE has been set with `custom-set-faces', set the face
354as specified by that function, otherwise set the face attributes 354attributes as specified by that function, otherwise set the face
355according to SPEC. 355attributes according to SPEC.
356
357The remaining arguments should have the form
358
359 [KEYWORD VALUE]...
360 356
357The remaining arguments should have the form [KEYWORD VALUE]...
361For a list of valid keywords, see the common keywords listed in 358For a list of valid keywords, see the common keywords listed in
362`defcustom'. 359`defcustom'.
363 360
364SPEC should be an alist of the form ((DISPLAY ATTS)...). 361SPEC should be an alist of the form
365 362
366In the first element, DISPLAY can be `default'. The ATTS in that 363 ((DISPLAY . ATTS)...)
367element then act as defaults for all the following elements. 364
368 365where DISPLAY is a form specifying conditions to match certain
369Aside from that, DISPLAY specifies conditions to match some or 366terminals and ATTS is a property list (ATTR VALUE ATTR VALUE...)
370all frames. For each frame, the first element of SPEC where the 367specifying face attributes and values for frames on those
371DISPLAY conditions are satisfied is the one that applies to that 368terminals. On each terminal, the first element with a matching
372frame. The ATTRs in this element take effect, and the following 369DISPLAY specification takes effect, and the remaining elements in
373elements are ignored, on that frame. 370SPEC are disregarded.
374 371
375In the last element, DISPLAY can be t. That element applies to a 372As a special exception, in the first element of SPEC, DISPLAY can
376frame if none of the previous elements (except the `default' if 373be the special value `default'. Then the ATTS in that element
377any) did. 374act as defaults for all the following elements.
378 375
379ATTS is a list of face attributes followed by their values: 376For backward compatibility, elements of SPEC can be written
380 (ATTR VALUE ATTR VALUE...) 377as (DISPLAY ATTS) instead of (DISPLAY . ATTS).
381 378
382The possible attributes are `:family', `:width', `:height', `:weight', 379Each DISPLAY can have the following values:
383`:slant', `:underline', `:overline', `:strike-through', `:box', 380 - `default' (only in the first element).
384`:foreground', `:background', `:stipple', `:inverse-video', and `:inherit'. 381 - The symbol t, which matches all terminals.
385 382 - An alist of conditions. Each alist element must have the form
386DISPLAY can be `default' (only in the first element), the symbol 383 (REQ ITEM...). A matching terminal must satisfy each
387t (only in the last element) to match all frames, or an alist of 384 specified condition by matching one of its ITEMs. Each REQ
388conditions of the form \(REQ ITEM...). For such an alist to 385 must be one of the following:
389match a frame, each of the conditions must be satisfied, meaning 386 - `type' (the terminal type).
390that the REQ property of the frame must match one of the 387 Each ITEM must be one of the values returned by
391corresponding ITEMs. These are the defined REQ values: 388 `window-system'. Under X, additional allowed values are
392 389 `motif', `lucid', `gtk' and `x-toolkit'.
393`type' (the value of `window-system') 390 - `class' (the terminal's color support).
394 Under X, in addition to the values `window-system' can take, 391 Each ITEM should be one of `color', `grayscale', or `mono'.
395 `motif', `lucid', `gtk' and `x-toolkit' are allowed, and match when 392 - `background' (what color is used for the background text)
396 the Motif toolkit, Lucid toolkit, GTK toolkit or any X toolkit is in use. 393 Each ITEM should be one of `light' or `dark'.
397 394 - `min-colors' (the minimum number of supported colors)
398`class' (the frame's color support) 395 Each ITEM should be an integer, which is compared with the
399 Should be one of `color', `grayscale', or `mono'. 396 result of `display-color-cells'.
400 397 - `supports' (match terminals supporting certain attributes).
401`background' (what color is used for the background text) 398 Each ITEM should be a list of face attributes. See
402 Should be one of `light' or `dark'. 399 `display-supports-face-attributes-p' for more information on
403 400 exactly how testing is done.
404`min-colors' (the minimum number of colors the frame should support) 401
405 Should be an integer, it is compared with the result of 402In the ATTS property list, possible attributes are `:family',
406 `display-color-cells'. 403`:width', `:height', `:weight', `:slant', `:underline',
407 404`:overline', `:strike-through', `:box', `:foreground',
408`supports' (only match frames that support the specified face attributes) 405`:background', `:stipple', `:inverse-video', and `:inherit'.
409 Should be a list of face attributes. See the documentation for 406
410 the function `display-supports-face-attributes-p' for more 407See Info node `(elisp) Faces' in the Emacs Lisp manual for more
411 information on exactly how testing is done. 408information."
412
413See Info node `(elisp) Customization' in the Emacs Lisp manual
414for more information."
415 (declare (doc-string 3)) 409 (declare (doc-string 3))
416 ;; It is better not to use backquote in this file, 410 ;; It is better not to use backquote in this file,
417 ;; because that makes a bootstrapping problem 411 ;; because that makes a bootstrapping problem
diff --git a/lisp/desktop.el b/lisp/desktop.el
index a873a6b63bf..75deb58b4d8 100644
--- a/lisp/desktop.el
+++ b/lisp/desktop.el
@@ -34,7 +34,7 @@
34;; - some local variables 34;; - some local variables
35 35
36;; To use this, use customize to turn on desktop-save-mode or add the 36;; To use this, use customize to turn on desktop-save-mode or add the
37;; following line somewhere in your .emacs file: 37;; following line somewhere in your init file:
38;; 38;;
39;; (desktop-save-mode 1) 39;; (desktop-save-mode 1)
40;; 40;;
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index e5ca463e8d4..afa0e32b3af 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -54,30 +54,52 @@ into this list; they also should call `dired-log' to log the errors.")
54;;;###autoload 54;;;###autoload
55(defun dired-diff (file &optional switches) 55(defun dired-diff (file &optional switches)
56 "Compare file at point with file FILE using `diff'. 56 "Compare file at point with file FILE using `diff'.
57If called interactively, prompt for FILE; if the file at point 57If called interactively, prompt for FILE. If the file at point
58has a backup file, use that as the default. 58has a backup file, use that as the default. If the mark is active
59in Transient Mark mode, use the file at the mark as the default.
60\(That's the mark set by \\[set-mark-command], not by Dired's
61\\[dired-mark] command.)
59 62
60FILE is the first file given to `diff'. 63FILE is the first file given to `diff'. The file at point
61With prefix arg, prompt for second argument SWITCHES, 64is the second file given to `diff'.
62which is the string of command switches for `diff'." 65
66With prefix arg, prompt for second argument SWITCHES, which is
67the string of command switches for the third argument of `diff'."
63 (interactive 68 (interactive
64 (let* ((current (dired-get-filename t)) 69 (let* ((current (dired-get-filename t))
65 (oldf (file-newest-backup current)) 70 ;; Get the latest existing backup file.
66 (dir (if oldf (file-name-directory oldf)))) 71 (oldf (diff-latest-backup-file current))
67 (list (read-file-name 72 ;; Get the file at the mark.
68 (format "Diff %s with%s: " 73 (file-at-mark (if (and transient-mark-mode mark-active)
69 (file-name-nondirectory current) 74 (save-excursion (goto-char (mark t))
70 (if oldf 75 (dired-get-filename t t))))
71 (concat " (default " 76 (default-file (or file-at-mark
72 (file-name-nondirectory oldf) 77 (and oldf (file-name-nondirectory oldf))))
73 ")") 78 ;; Use it as default if it's not the same as the current file,
74 "")) 79 ;; and the target dir is current or there is a default file.
75 dir oldf t) 80 (default (if (and (not (equal default-file current))
76 (if current-prefix-arg 81 (or (equal (dired-dwim-target-directory)
77 (read-string "Options for diff: " 82 (dired-current-directory))
78 (if (stringp diff-switches) 83 default-file))
79 diff-switches 84 default-file))
80 (mapconcat 'identity diff-switches " "))))))) 85 (target-dir (if default
86 (dired-current-directory)
87 (dired-dwim-target-directory)))
88 (defaults (dired-dwim-target-defaults (list current) target-dir)))
89 (list
90 (minibuffer-with-setup-hook
91 (lambda ()
92 (set (make-local-variable 'minibuffer-default-add-function) nil)
93 (setq minibuffer-default defaults))
94 (read-file-name
95 (format "Diff %s with%s: " current
96 (if default (format " (default %s)" default) ""))
97 target-dir default t))
98 (if current-prefix-arg
99 (read-string "Options for diff: "
100 (if (stringp diff-switches)
101 diff-switches
102 (mapconcat 'identity diff-switches " ")))))))
81 (let ((current (dired-get-filename t))) 103 (let ((current (dired-get-filename t)))
82 (when (or (equal (expand-file-name file) 104 (when (or (equal (expand-file-name file)
83 (expand-file-name current)) 105 (expand-file-name current))
@@ -223,10 +245,17 @@ List has a form of (file-name full-file-name (attribute-list))."
223 ;; OP-SYMBOL is the type of operation (for use in `dired-mark-pop-up'). 245 ;; OP-SYMBOL is the type of operation (for use in `dired-mark-pop-up').
224 ;; ARG describes which files to use, as in `dired-get-marked-files'. 246 ;; ARG describes which files to use, as in `dired-get-marked-files'.
225 (let* ((files (dired-get-marked-files t arg)) 247 (let* ((files (dired-get-marked-files t arg))
226 (default (and (eq op-symbol 'touch) 248 ;; The source of default file attributes is the file at point.
227 (stringp (car files)) 249 (default-file (dired-get-filename t t))
228 (format-time-string "%Y%m%d%H%M.%S" 250 (default (when default-file
229 (nth 5 (file-attributes (car files)))))) 251 (cond ((eq op-symbol 'touch)
252 (format-time-string
253 "%Y%m%d%H%M.%S"
254 (nth 5 (file-attributes default-file))))
255 ((eq op-symbol 'chown)
256 (nth 2 (file-attributes default-file 'string)))
257 ((eq op-symbol 'chgrp)
258 (nth 3 (file-attributes default-file 'string))))))
230 (prompt (concat "Change " attribute-name " of %s to" 259 (prompt (concat "Change " attribute-name " of %s to"
231 (if (eq op-symbol 'touch) 260 (if (eq op-symbol 'touch)
232 " (default now): " 261 " (default now): "
@@ -263,11 +292,15 @@ List has a form of (file-name full-file-name (attribute-list))."
263;;;###autoload 292;;;###autoload
264(defun dired-do-chmod (&optional arg) 293(defun dired-do-chmod (&optional arg)
265 "Change the mode of the marked (or next ARG) files. 294 "Change the mode of the marked (or next ARG) files.
266Symbolic modes like `g+w' are allowed." 295Symbolic modes like `g+w' are allowed.
296Type M-n to pull the file attributes of the file at point
297into the minibuffer."
267 (interactive "P") 298 (interactive "P")
268 (let* ((files (dired-get-marked-files t arg)) 299 (let* ((files (dired-get-marked-files t arg))
269 (modestr (and (stringp (car files)) 300 ;; The source of default file attributes is the file at point.
270 (nth 8 (file-attributes (car files))))) 301 (default-file (dired-get-filename t t))
302 (modestr (when default-file
303 (nth 8 (file-attributes default-file))))
271 (default 304 (default
272 (and (stringp modestr) 305 (and (stringp modestr)
273 (string-match "^.\\(...\\)\\(...\\)\\(...\\)$" modestr) 306 (string-match "^.\\(...\\)\\(...\\)\\(...\\)$" modestr)
@@ -300,7 +333,9 @@ Symbolic modes like `g+w' are allowed."
300 333
301;;;###autoload 334;;;###autoload
302(defun dired-do-chgrp (&optional arg) 335(defun dired-do-chgrp (&optional arg)
303 "Change the group of the marked (or next ARG) files." 336 "Change the group of the marked (or next ARG) files.
337Type M-n to pull the file attributes of the file at point
338into the minibuffer."
304 (interactive "P") 339 (interactive "P")
305 (if (memq system-type '(ms-dos windows-nt)) 340 (if (memq system-type '(ms-dos windows-nt))
306 (error "chgrp not supported on this system")) 341 (error "chgrp not supported on this system"))
@@ -308,7 +343,9 @@ Symbolic modes like `g+w' are allowed."
308 343
309;;;###autoload 344;;;###autoload
310(defun dired-do-chown (&optional arg) 345(defun dired-do-chown (&optional arg)
311 "Change the owner of the marked (or next ARG) files." 346 "Change the owner of the marked (or next ARG) files.
347Type M-n to pull the file attributes of the file at point
348into the minibuffer."
312 (interactive "P") 349 (interactive "P")
313 (if (memq system-type '(ms-dos windows-nt)) 350 (if (memq system-type '(ms-dos windows-nt))
314 (error "chown not supported on this system")) 351 (error "chown not supported on this system"))
@@ -317,7 +354,9 @@ Symbolic modes like `g+w' are allowed."
317;;;###autoload 354;;;###autoload
318(defun dired-do-touch (&optional arg) 355(defun dired-do-touch (&optional arg)
319 "Change the timestamp of the marked (or next ARG) files. 356 "Change the timestamp of the marked (or next ARG) files.
320This calls touch." 357This calls touch.
358Type M-n to pull the file attributes of the file at point
359into the minibuffer."
321 (interactive "P") 360 (interactive "P")
322 (dired-do-chxxx "Timestamp" dired-touch-program 'touch arg)) 361 (dired-do-chxxx "Timestamp" dired-touch-program 'touch arg))
323 362
diff --git a/lisp/dired.el b/lisp/dired.el
index 54921a4ea66..a5169fc301c 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -3097,21 +3097,37 @@ argument or confirmation)."
3097(defun dired-mark (arg) 3097(defun dired-mark (arg)
3098 "Mark the current (or next ARG) files. 3098 "Mark the current (or next ARG) files.
3099If on a subdir headerline, mark all its files except `.' and `..'. 3099If on a subdir headerline, mark all its files except `.' and `..'.
3100If the region is active in Transient Mark mode, mark all files
3101in the active region.
3100 3102
3101Use \\[dired-unmark-all-files] to remove all marks 3103Use \\[dired-unmark-all-files] to remove all marks
3102and \\[dired-unmark] on a subdir to remove the marks in 3104and \\[dired-unmark] on a subdir to remove the marks in
3103this subdir." 3105this subdir."
3104 (interactive "P") 3106 (interactive "P")
3105 (if (dired-get-subdir) 3107 (cond
3106 (save-excursion (dired-mark-subdir-files)) 3108 ;; Mark files in the active region.
3109 ((and transient-mark-mode mark-active)
3110 (save-excursion
3111 (let ((beg (region-beginning))
3112 (end (region-end)))
3113 (dired-mark-files-in-region
3114 (progn (goto-char beg) (line-beginning-position))
3115 (progn (goto-char end) (line-beginning-position))))))
3116 ;; Mark subdir files from the subdir headerline.
3117 ((dired-get-subdir)
3118 (save-excursion (dired-mark-subdir-files)))
3119 ;; Mark the current (or next ARG) files.
3120 (t
3107 (let ((inhibit-read-only t)) 3121 (let ((inhibit-read-only t))
3108 (dired-repeat-over-lines 3122 (dired-repeat-over-lines
3109 (prefix-numeric-value arg) 3123 (prefix-numeric-value arg)
3110 (function (lambda () (delete-char 1) (insert dired-marker-char))))))) 3124 (function (lambda () (delete-char 1) (insert dired-marker-char))))))))
3111 3125
3112(defun dired-unmark (arg) 3126(defun dired-unmark (arg)
3113 "Unmark the current (or next ARG) files. 3127 "Unmark the current (or next ARG) files.
3114If looking at a subdir, unmark all its files except `.' and `..'." 3128If looking at a subdir, unmark all its files except `.' and `..'.
3129If the region is active in Transient Mark mode, unmark all files
3130in the active region."
3115 (interactive "P") 3131 (interactive "P")
3116 (let ((dired-marker-char ?\040)) 3132 (let ((dired-marker-char ?\040))
3117 (dired-mark arg))) 3133 (dired-mark arg)))
@@ -3119,8 +3135,9 @@ If looking at a subdir, unmark all its files except `.' and `..'."
3119(defun dired-flag-file-deletion (arg) 3135(defun dired-flag-file-deletion (arg)
3120 "In Dired, flag the current line's file for deletion. 3136 "In Dired, flag the current line's file for deletion.
3121With prefix arg, repeat over several lines. 3137With prefix arg, repeat over several lines.
3122 3138If on a subdir headerline, flag all its files except `.' and `..'.
3123If on a subdir headerline, mark all its files except `.' and `..'." 3139If the region is active in Transient Mark mode, flag all files
3140in the active region."
3124 (interactive "P") 3141 (interactive "P")
3125 (let ((dired-marker-char dired-del-marker)) 3142 (let ((dired-marker-char dired-del-marker))
3126 (dired-mark arg))) 3143 (dired-mark arg)))
@@ -3128,7 +3145,9 @@ If on a subdir headerline, mark all its files except `.' and `..'."
3128(defun dired-unmark-backward (arg) 3145(defun dired-unmark-backward (arg)
3129 "In Dired, move up lines and remove marks or deletion flags there. 3146 "In Dired, move up lines and remove marks or deletion flags there.
3130Optional prefix ARG says how many lines to unmark/unflag; default 3147Optional prefix ARG says how many lines to unmark/unflag; default
3131is one line." 3148is one line.
3149If the region is active in Transient Mark mode, unmark all files
3150in the active region."
3132 (interactive "p") 3151 (interactive "p")
3133 (dired-unmark (- arg))) 3152 (dired-unmark (- arg)))
3134 3153
@@ -3159,8 +3178,8 @@ As always, hidden subdirs are not affected."
3159(defvar dired-regexp-history nil 3178(defvar dired-regexp-history nil
3160 "History list of regular expressions used in Dired commands.") 3179 "History list of regular expressions used in Dired commands.")
3161 3180
3162(defun dired-read-regexp (prompt) 3181(defun dired-read-regexp (prompt &optional default history)
3163 (read-from-minibuffer prompt nil nil nil 'dired-regexp-history)) 3182 (read-regexp prompt default (or history 'dired-regexp-history)))
3164 3183
3165(defun dired-mark-files-regexp (regexp &optional marker-char) 3184(defun dired-mark-files-regexp (regexp &optional marker-char)
3166 "Mark all files matching REGEXP for use in later commands. 3185 "Mark all files matching REGEXP for use in later commands.
@@ -3744,17 +3763,22 @@ Ask means pop up a menu for the user to select one of copy, move or link."
3744;;;;;; dired-run-shell-command dired-do-shell-command dired-do-async-shell-command 3763;;;;;; dired-run-shell-command dired-do-shell-command dired-do-async-shell-command
3745;;;;;; dired-clean-directory dired-do-print dired-do-touch dired-do-chown 3764;;;;;; dired-clean-directory dired-do-print dired-do-touch dired-do-chown
3746;;;;;; dired-do-chgrp dired-do-chmod dired-compare-directories dired-backup-diff 3765;;;;;; dired-do-chgrp dired-do-chmod dired-compare-directories dired-backup-diff
3747;;;;;; dired-diff) "dired-aux" "dired-aux.el" "3c768e470d5d053d0049e0286ce38da7") 3766;;;;;; dired-diff) "dired-aux" "dired-aux.el" "244227ae609852d3dc10ab3fc40ba9ab")
3748;;; Generated autoloads from dired-aux.el 3767;;; Generated autoloads from dired-aux.el
3749 3768
3750(autoload 'dired-diff "dired-aux" "\ 3769(autoload 'dired-diff "dired-aux" "\
3751Compare file at point with file FILE using `diff'. 3770Compare file at point with file FILE using `diff'.
3752If called interactively, prompt for FILE; if the file at point 3771If called interactively, prompt for FILE. If the file at point
3753has a backup file, use that as the default. 3772has a backup file, use that as the default. If the mark is active
3773in Transient Mark mode, use the file at the mark as the default.
3774\(That's the mark set by \\[set-mark-command], not by Dired's
3775\\[dired-mark] command.)
3776
3777FILE is the first file given to `diff'. The file at point
3778is the second file given to `diff'.
3754 3779
3755FILE is the first file given to `diff'. 3780With prefix arg, prompt for second argument SWITCHES, which is
3756With prefix arg, prompt for second argument SWITCHES, 3781the string of command switches for the third argument of `diff'.
3757which is the string of command switches for `diff'.
3758 3782
3759\(fn FILE &optional SWITCHES)" t nil) 3783\(fn FILE &optional SWITCHES)" t nil)
3760 3784
@@ -3798,22 +3822,30 @@ Examples of PREDICATE:
3798(autoload 'dired-do-chmod "dired-aux" "\ 3822(autoload 'dired-do-chmod "dired-aux" "\
3799Change the mode of the marked (or next ARG) files. 3823Change the mode of the marked (or next ARG) files.
3800Symbolic modes like `g+w' are allowed. 3824Symbolic modes like `g+w' are allowed.
3825Type M-n to pull the file attributes of the file at point
3826into the minibuffer.
3801 3827
3802\(fn &optional ARG)" t nil) 3828\(fn &optional ARG)" t nil)
3803 3829
3804(autoload 'dired-do-chgrp "dired-aux" "\ 3830(autoload 'dired-do-chgrp "dired-aux" "\
3805Change the group of the marked (or next ARG) files. 3831Change the group of the marked (or next ARG) files.
3832Type M-n to pull the file attributes of the file at point
3833into the minibuffer.
3806 3834
3807\(fn &optional ARG)" t nil) 3835\(fn &optional ARG)" t nil)
3808 3836
3809(autoload 'dired-do-chown "dired-aux" "\ 3837(autoload 'dired-do-chown "dired-aux" "\
3810Change the owner of the marked (or next ARG) files. 3838Change the owner of the marked (or next ARG) files.
3839Type M-n to pull the file attributes of the file at point
3840into the minibuffer.
3811 3841
3812\(fn &optional ARG)" t nil) 3842\(fn &optional ARG)" t nil)
3813 3843
3814(autoload 'dired-do-touch "dired-aux" "\ 3844(autoload 'dired-do-touch "dired-aux" "\
3815Change the timestamp of the marked (or next ARG) files. 3845Change the timestamp of the marked (or next ARG) files.
3816This calls touch. 3846This calls touch.
3847Type M-n to pull the file attributes of the file at point
3848into the minibuffer.
3817 3849
3818\(fn &optional ARG)" t nil) 3850\(fn &optional ARG)" t nil)
3819 3851
diff --git a/lisp/doc-view.el b/lisp/doc-view.el
index 72b36feb1d8..158d447a1d4 100644
--- a/lisp/doc-view.el
+++ b/lisp/doc-view.el
@@ -3,8 +3,8 @@
3 3
4;; Copyright (C) 2007-2012 Free Software Foundation, Inc. 4;; Copyright (C) 2007-2012 Free Software Foundation, Inc.
5;; 5;;
6;; Author: Tassilo Horn <tassilo@member.fsf.org> 6;; Author: Tassilo Horn <tsdh@gnu.org>
7;; Maintainer: Tassilo Horn <tassilo@member.fsf.org> 7;; Maintainer: Tassilo Horn <tsdh@gnu.org>
8;; Keywords: files, pdf, ps, dvi 8;; Keywords: files, pdf, ps, dvi
9 9
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
@@ -57,16 +57,21 @@
57;; pages won't be displayed before conversion of the document finished 57;; pages won't be displayed before conversion of the document finished
58;; completely. 58;; completely.
59;; 59;;
60;; DocView lets you select a slice of the displayed pages. This slice will be 60;; DocView lets you select a slice of the displayed pages. This slice
61;; remembered and applied to all pages of the current document. This enables 61;; will be remembered and applied to all pages of the current
62;; you to cut away the margins of a document to save some space. To select a 62;; document. This enables you to cut away the margins of a document
63;; slice you can use `doc-view-set-slice' (bound to `s s') which will query you 63;; to save some space. To select a slice you can use
64;; for the coordinates of the slice's top-left corner and its width and height. 64;; `doc-view-set-slice' (bound to `s s') which will query you for the
65;; A much more convenient way to do the same is offered by the command 65;; coordinates of the slice's top-left corner and its width and
66;; `doc-view-set-slice-using-mouse' (bound to `s m'). After invocation you 66;; height. A much more convenient way to do the same is offered by
67;; only have to press mouse-1 at the top-left corner and drag it to the 67;; the command `doc-view-set-slice-using-mouse' (bound to `s m').
68;; bottom-right corner of the desired slice. To reset the slice use 68;; After invocation you only have to press mouse-1 at the top-left
69;; `doc-view-reset-slice' (bound to `s r'). 69;; corner and drag it to the bottom-right corner of the desired slice.
70;; Even more accurate and convenient is to use
71;; `doc-view-set-slice-from-bounding-box' (bound to `s b') which uses
72;; the BoundingBox information of the current page to set an optimal
73;; slice. To reset the slice use `doc-view-reset-slice' (bound to `s
74;; r').
70;; 75;;
71;; You can also search within the document. The command `doc-view-search' 76;; You can also search within the document. The command `doc-view-search'
72;; (bound to `C-s') queries for a search regexp and initializes a list of all 77;; (bound to `C-s') queries for a search regexp and initializes a list of all
@@ -103,7 +108,6 @@
103;; - share more code with image-mode. 108;; - share more code with image-mode.
104;; - better menu. 109;; - better menu.
105;; - Bind slicing to a drag event. 110;; - Bind slicing to a drag event.
106;; - doc-view-fit-doc-to-window and doc-view-fit-window-to-doc?
107;; - zoom the region around the cursor (like xdvi). 111;; - zoom the region around the cursor (like xdvi).
108;; - get rid of the silly arrow in the fringe. 112;; - get rid of the silly arrow in the fringe.
109;; - improve anti-aliasing (pdf-utils gets it better). 113;; - improve anti-aliasing (pdf-utils gets it better).
@@ -340,6 +344,7 @@ Can be `dvi', `pdf', or `ps'.")
340 ;; Slicing the image 344 ;; Slicing the image
341 (define-key map (kbd "s s") 'doc-view-set-slice) 345 (define-key map (kbd "s s") 'doc-view-set-slice)
342 (define-key map (kbd "s m") 'doc-view-set-slice-using-mouse) 346 (define-key map (kbd "s m") 'doc-view-set-slice-using-mouse)
347 (define-key map (kbd "s b") 'doc-view-set-slice-from-bounding-box)
343 (define-key map (kbd "s r") 'doc-view-reset-slice) 348 (define-key map (kbd "s r") 'doc-view-reset-slice)
344 ;; Searching 349 ;; Searching
345 (define-key map (kbd "C-s") 'doc-view-search) 350 (define-key map (kbd "C-s") 'doc-view-search)
@@ -381,6 +386,7 @@ Can be `dvi', `pdf', or `ps'.")
381 ) 386 )
382 "---" 387 "---"
383 ["Set Slice" doc-view-set-slice-using-mouse] 388 ["Set Slice" doc-view-set-slice-using-mouse]
389 ["Set Slice (BoundingBox)" doc-view-set-slice-from-bounding-box]
384 ["Set Slice (manual)" doc-view-set-slice] 390 ["Set Slice (manual)" doc-view-set-slice]
385 ["Reset Slice" doc-view-reset-slice] 391 ["Reset Slice" doc-view-reset-slice]
386 "---" 392 "---"
@@ -991,8 +997,9 @@ You can use this function to tell doc-view not to display the
991margins of the document. It prompts for the top-left corner (X 997margins of the document. It prompts for the top-left corner (X
992and Y) of the slice to display and its WIDTH and HEIGHT. 998and Y) of the slice to display and its WIDTH and HEIGHT.
993 999
994See `doc-view-set-slice-using-mouse' for a more convenient way to 1000See `doc-view-set-slice-using-mouse' and
995do that. To reset the slice use `doc-view-reset-slice'." 1001`doc-view-set-slice-from-bounding-box' for more convenient ways
1002to do that. To reset the slice use `doc-view-reset-slice'."
996 (interactive 1003 (interactive
997 (let* ((size (image-size (doc-view-current-image) t)) 1004 (let* ((size (image-size (doc-view-current-image) t))
998 (a (read-number (format "Top-left X (0..%d): " (car size)))) 1005 (a (read-number (format "Top-left X (0..%d): " (car size))))
@@ -1023,6 +1030,79 @@ dragging it to its bottom-right corner. See also
1023 (setq done t)))) 1030 (setq done t))))
1024 (doc-view-set-slice x y w h))) 1031 (doc-view-set-slice x y w h)))
1025 1032
1033(defun doc-view-get-bounding-box ()
1034 "Get the BoundingBox information of the current page."
1035 (let* ((page (doc-view-current-page))
1036 (o (shell-command-to-string
1037 (concat doc-view-ghostscript-program
1038 " -dSAFER -dBATCH -dNOPAUSE -q -sDEVICE=bbox "
1039 (format "-dFirstPage=%s -dLastPage=%s %s"
1040 page page
1041 doc-view-buffer-file-name)))))
1042 (save-match-data
1043 (when (string-match (concat "%%BoundingBox: "
1044 "\\([[:digit:]]+\\) \\([[:digit:]]+\\) "
1045 "\\([[:digit:]]+\\) \\([[:digit:]]+\\)") o)
1046 (mapcar #'string-to-number
1047 (list (match-string 1 o)
1048 (match-string 2 o)
1049 (match-string 3 o)
1050 (match-string 4 o)))))))
1051
1052(defvar doc-view-paper-sizes
1053 '((a4 595 842)
1054 (a4-landscape 842 595)
1055 (letter 612 792)
1056 (letter-landscape 792 612)
1057 (legal 612 1008)
1058 (legal-landscape 1008 612)
1059 (a3 842 1191)
1060 (a3-landscape 1191 842)
1061 (tabloid 792 1224)
1062 (ledger 1224 792))
1063 "An alist from paper size names to dimensions.")
1064
1065(defun doc-view-guess-paper-size (iw ih)
1066 "Guess the paper size according to the aspect ratio."
1067 (cl-labels ((div (x y)
1068 (round (/ (* 100.0 x) y))))
1069 (let ((ar (div iw ih))
1070 (al (mapcar (lambda (l)
1071 (list (div (nth 1 l) (nth 2 l)) (car l)))
1072 doc-view-paper-sizes)))
1073 (cadr (assoc ar al)))))
1074
1075(defun doc-view-scale-bounding-box (ps iw ih bb)
1076 (list (/ (* (nth 0 bb) iw) (nth 1 (assoc ps doc-view-paper-sizes)))
1077 (/ (* (nth 1 bb) ih) (nth 2 (assoc ps doc-view-paper-sizes)))
1078 (/ (* (nth 2 bb) iw) (nth 1 (assoc ps doc-view-paper-sizes)))
1079 (/ (* (nth 3 bb) ih) (nth 2 (assoc ps doc-view-paper-sizes)))))
1080
1081(defun doc-view-set-slice-from-bounding-box (&optional force-paper-size)
1082 "Set the slice from the document's BoundingBox information.
1083The result is that the margins are almost completely cropped,
1084much more accurate than could be done manually using
1085`doc-view-set-slice-using-mouse'."
1086 (interactive "P")
1087 (let ((bb (doc-view-get-bounding-box)))
1088 (if (not bb)
1089 (message "BoundingBox couldn't be determined")
1090 (let* ((is (image-size (doc-view-current-image) t))
1091 (iw (car is))
1092 (ih (cdr is))
1093 (ps (or (and (null force-paper-size) (doc-view-guess-paper-size iw ih))
1094 (intern (completing-read "Paper size: "
1095 (mapcar #'car doc-view-paper-sizes)
1096 nil t))))
1097 (bb (doc-view-scale-bounding-box ps iw ih bb))
1098 (x1 (nth 0 bb))
1099 (y1 (nth 1 bb))
1100 (x2 (nth 2 bb))
1101 (y2 (nth 3 bb)))
1102 ;; We keep a 2 pixel margin.
1103 (doc-view-set-slice (- x1 2) (- ih y2 2)
1104 (+ (- x2 x1) 4) (+ (- y2 y1) 4))))))
1105
1026(defun doc-view-reset-slice () 1106(defun doc-view-reset-slice ()
1027 "Reset the current slice. 1107 "Reset the current slice.
1028After calling this function whole pages will be visible again." 1108After calling this function whole pages will be visible again."
@@ -1089,13 +1169,16 @@ Predicate for sorting `doc-view-current-files'."
1089If FORCE is non-nil, start viewing even if the document does not 1169If FORCE is non-nil, start viewing even if the document does not
1090have the page we want to view." 1170have the page we want to view."
1091 (with-current-buffer buffer 1171 (with-current-buffer buffer
1092 (let ((prev-pages doc-view-current-files)) 1172 (let ((prev-pages doc-view-current-files)
1173 (windows (get-buffer-window-list buffer nil t)))
1093 (setq doc-view-current-files 1174 (setq doc-view-current-files
1094 (sort (directory-files (doc-view-current-cache-dir) t 1175 (sort (directory-files (doc-view-current-cache-dir) t
1095 "page-[0-9]+\\.png" t) 1176 "page-[0-9]+\\.png" t)
1096 'doc-view-sort)) 1177 'doc-view-sort))
1097 (dolist (win (or (get-buffer-window-list buffer nil t) 1178 (unless windows
1098 (list (selected-window)))) 1179 (switch-to-buffer buffer)
1180 (setq windows (get-buffer-window-list buffer nil t)))
1181 (dolist (win windows)
1099 (let* ((page (doc-view-current-page win)) 1182 (let* ((page (doc-view-current-page win))
1100 (pagefile (expand-file-name (format "page-%d.png" page) 1183 (pagefile (expand-file-name (format "page-%d.png" page)
1101 (doc-view-current-cache-dir)))) 1184 (doc-view-current-cache-dir))))
@@ -1103,8 +1186,8 @@ have the page we want to view."
1103 (and (not (member pagefile prev-pages)) 1186 (and (not (member pagefile prev-pages))
1104 (member pagefile doc-view-current-files))) 1187 (member pagefile doc-view-current-files)))
1105 (with-selected-window win 1188 (with-selected-window win
1106 (cl-assert (eq (current-buffer) buffer)) 1189 (cl-assert (eq (current-buffer) buffer) t)
1107 (doc-view-goto-page page)))))))) 1190 (doc-view-goto-page page))))))))
1108 1191
1109(defun doc-view-buffer-message () 1192(defun doc-view-buffer-message ()
1110 ;; Only show this message initially, not when refreshing the buffer (in which 1193 ;; Only show this message initially, not when refreshing the buffer (in which
diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el
index d1382f42b19..93e890a20c9 100644
--- a/lisp/emacs-lisp/byte-run.el
+++ b/lisp/emacs-lisp/byte-run.el
@@ -312,7 +312,7 @@ This uses `defvaralias' and `make-obsolete-variable' (which see).
312See the Info node `(elisp)Variable Aliases' for more details. 312See the Info node `(elisp)Variable Aliases' for more details.
313 313
314If CURRENT-NAME is a defcustom (more generally, any variable 314If CURRENT-NAME is a defcustom (more generally, any variable
315where OBSOLETE-NAME may be set, e.g. in a .emacs file, before the 315where OBSOLETE-NAME may be set, e.g. in an init file, before the
316alias is defined), then the define-obsolete-variable-alias 316alias is defined), then the define-obsolete-variable-alias
317statement should be evaluated before the defcustom, if user 317statement should be evaluated before the defcustom, if user
318customizations are to be respected. The simplest way to achieve 318customizations are to be respected. The simplest way to achieve
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index c42ae21aae5..7a229750178 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -1115,18 +1115,12 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'."
1115 "Warn that SYMBOL (a variable or function) is obsolete." 1115 "Warn that SYMBOL (a variable or function) is obsolete."
1116 (when (byte-compile-warning-enabled-p 'obsolete) 1116 (when (byte-compile-warning-enabled-p 'obsolete)
1117 (let* ((funcp (get symbol 'byte-obsolete-info)) 1117 (let* ((funcp (get symbol 'byte-obsolete-info))
1118 (obsolete (or funcp (get symbol 'byte-obsolete-variable))) 1118 (msg (macroexp--obsolete-warning
1119 (instead (car obsolete)) 1119 symbol
1120 (asof (nth 2 obsolete))) 1120 (or funcp (get symbol 'byte-obsolete-variable))
1121 (if funcp "function" "variable"))))
1121 (unless (and funcp (memq symbol byte-compile-not-obsolete-funcs)) 1122 (unless (and funcp (memq symbol byte-compile-not-obsolete-funcs))
1122 (byte-compile-warn "`%s' is an obsolete %s%s%s" symbol 1123 (byte-compile-warn "%s" msg)))))
1123 (if funcp "function" "variable")
1124 (if asof (concat " (as of " asof ")") "")
1125 (cond ((stringp instead)
1126 (concat "; " instead))
1127 (instead
1128 (format "; use `%s' instead." instead))
1129 (t ".")))))))
1130 1124
1131(defun byte-compile-report-error (error-info) 1125(defun byte-compile-report-error (error-info)
1132 "Report Lisp error in compilation. ERROR-INFO is the error data." 1126 "Report Lisp error in compilation. ERROR-INFO is the error data."
diff --git a/lisp/emacs-lisp/cl-lib.el b/lisp/emacs-lisp/cl-lib.el
index 532c81c502c..5749ff91b40 100644
--- a/lisp/emacs-lisp/cl-lib.el
+++ b/lisp/emacs-lisp/cl-lib.el
@@ -121,7 +121,7 @@ a future Emacs interpreter will be able to use it.")
121 121
122;;; Generalized variables. 122;;; Generalized variables.
123;; These macros are defined here so that they 123;; These macros are defined here so that they
124;; can safely be used in .emacs files. 124;; can safely be used in init files.
125 125
126(defmacro cl-incf (place &optional x) 126(defmacro cl-incf (place &optional x)
127 "Increment PLACE by X (1 by default). 127 "Increment PLACE by X (1 by default).
diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el
index 774b4d3d600..6fd52d67b90 100644
--- a/lisp/emacs-lisp/debug.el
+++ b/lisp/emacs-lisp/debug.el
@@ -75,9 +75,9 @@ window previously showing the debugger buffer.
75The value used here is passed to `quit-restore-window'." 75The value used here is passed to `quit-restore-window'."
76 :type '(choice 76 :type '(choice
77 (const :tag "Keep alive" nil) 77 (const :tag "Keep alive" nil)
78 (const :tag "Append" 'append) 78 (const :tag "Append" append)
79 (const :tag "Bury" 'bury) 79 (const :tag "Bury" bury)
80 (const :tag "Kill" 'kill)) 80 (const :tag "Kill" kill))
81 :group 'debugger 81 :group 'debugger
82 :version "24.2") 82 :version "24.2")
83 83
@@ -166,6 +166,7 @@ first will be printed into the backtrace buffer."
166 (with-current-buffer (get-buffer "*Backtrace*") 166 (with-current-buffer (get-buffer "*Backtrace*")
167 (list major-mode (buffer-string))))) 167 (list major-mode (buffer-string)))))
168 (debugger-buffer (get-buffer-create "*Backtrace*")) 168 (debugger-buffer (get-buffer-create "*Backtrace*"))
169 (debugger-old-buffer (current-buffer))
169 (debugger-window nil) 170 (debugger-window nil)
170 (debugger-step-after-exit nil) 171 (debugger-step-after-exit nil)
171 (debugger-will-be-back nil) 172 (debugger-will-be-back nil)
@@ -265,7 +266,8 @@ first will be printed into the backtrace buffer."
265 ;; Make sure we unbind buffer-read-only in the right buffer. 266 ;; Make sure we unbind buffer-read-only in the right buffer.
266 (save-excursion 267 (save-excursion
267 (recursive-edit)))) 268 (recursive-edit))))
268 (when (and (window-live-p debugger-window) 269 (when (and (not debugger-will-be-back)
270 (window-live-p debugger-window)
269 (eq (window-buffer debugger-window) debugger-buffer)) 271 (eq (window-buffer debugger-window) debugger-buffer))
270 ;; Record height of debugger window. 272 ;; Record height of debugger window.
271 (setq debugger-previous-window-height 273 (setq debugger-previous-window-height
diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el
index 394225d697e..cab693fecac 100644
--- a/lisp/emacs-lisp/macroexp.el
+++ b/lisp/emacs-lisp/macroexp.el
@@ -100,17 +100,42 @@ each clause."
100 (error (message "Compiler-macro error for %S: %S" (car form) err) 100 (error (message "Compiler-macro error for %S: %S" (car form) err)
101 form))) 101 form)))
102 102
103(defun macroexp--eval-if-compile (&rest _forms) 103(defun macroexp--funcall-if-compiled (_form)
104 "Pseudo function used internally by macroexp to delay warnings. 104 "Pseudo function used internally by macroexp to delay warnings.
105The purpose is to delay warnings to bytecomp.el, so they can use things 105The purpose is to delay warnings to bytecomp.el, so they can use things
106like `byte-compile-log-warning' to get better file-and-line-number data 106like `byte-compile-log-warning' to get better file-and-line-number data
107and also to avoid outputting the warning during normal execution." 107and also to avoid outputting the warning during normal execution."
108 nil) 108 nil)
109(put 'macroexp--eval-if-compile 'byte-compile 109(put 'macroexp--funcall-if-compiled 'byte-compile
110 (lambda (form) 110 (lambda (form)
111 (mapc (lambda (x) (funcall (eval x))) (cdr form)) 111 (funcall (eval (cadr form)))
112 (byte-compile-constant nil))) 112 (byte-compile-constant nil)))
113 113
114(defun macroexp--warn-and-return (msg form)
115 (let ((when-compiled (lambda () (byte-compile-log-warning msg t))))
116 (cond
117 ((null msg) form)
118 ;; FIXME: ¡¡Major Ugly Hack!! To determine whether the output of this
119 ;; macro-expansion will be processed by the byte-compiler, we check
120 ;; circumstantial evidence.
121 ((member '(declare-function . byte-compile-macroexpand-declare-function)
122 macroexpand-all-environment)
123 `(progn
124 (macroexp--funcall-if-compiled ',when-compiled)
125 ,form))
126 (t
127 (message "%s" msg)
128 form))))
129
130(defun macroexp--obsolete-warning (fun obsolescence-data type)
131 (let ((instead (car obsolescence-data))
132 (asof (nth 2 obsolescence-data)))
133 (format "`%s' is an obsolete %s%s%s" fun type
134 (if asof (concat " (as of " asof ")") "")
135 (cond ((stringp instead) (concat "; " instead))
136 (instead (format "; use `%s' instead." instead))
137 (t ".")))))
138
114(defun macroexp--expand-all (form) 139(defun macroexp--expand-all (form)
115 "Expand all macros in FORM. 140 "Expand all macros in FORM.
116This is an internal version of `macroexpand-all'. 141This is an internal version of `macroexpand-all'.
@@ -130,9 +155,11 @@ Assumes the caller has bound `macroexpand-all-environment'."
130 (car-safe form) 155 (car-safe form)
131 (symbolp (car form)) 156 (symbolp (car form))
132 (get (car form) 'byte-obsolete-info)) 157 (get (car form) 'byte-obsolete-info))
133 `(progn (macroexp--eval-if-compile 158 (let* ((fun (car form))
134 (lambda () (byte-compile-warn-obsolete ',(car form)))) 159 (obsolete (get fun 'byte-obsolete-info)))
135 ,new-form) 160 (macroexp--warn-and-return
161 (macroexp--obsolete-warning fun obsolete "macro")
162 new-form))
136 new-form))) 163 new-form)))
137 (pcase form 164 (pcase form
138 (`(cond . ,clauses) 165 (`(cond . ,clauses)
@@ -175,26 +202,16 @@ Assumes the caller has bound `macroexpand-all-environment'."
175 ;; First arg is a function: 202 ;; First arg is a function:
176 (`(,(and fun (or `funcall `apply `mapcar `mapatoms `mapconcat `mapc)) 203 (`(,(and fun (or `funcall `apply `mapcar `mapatoms `mapconcat `mapc))
177 ',(and f `(lambda . ,_)) . ,args) 204 ',(and f `(lambda . ,_)) . ,args)
178 (byte-compile-log-warning 205 (macroexp--warn-and-return
179 (format "%s quoted with ' rather than with #'" 206 (format "%s quoted with ' rather than with #'"
180 (list 'lambda (nth 1 f) '...)) 207 (list 'lambda (nth 1 f) '...))
181 t) 208 (macroexp--expand-all `(,fun ,f . ,args))))
182 ;; We don't use `macroexp--cons' since there's clearly a change.
183 (cons fun
184 (cons (macroexp--expand-all (list 'function f))
185 (macroexp--all-forms args))))
186 ;; Second arg is a function: 209 ;; Second arg is a function:
187 (`(,(and fun (or `sort)) ,arg1 ',(and f `(lambda . ,_)) . ,args) 210 (`(,(and fun (or `sort)) ,arg1 ',(and f `(lambda . ,_)) . ,args)
188 (byte-compile-log-warning 211 (macroexp--warn-and-return
189 (format "%s quoted with ' rather than with #'" 212 (format "%s quoted with ' rather than with #'"
190 (list 'lambda (nth 1 f) '...)) 213 (list 'lambda (nth 1 f) '...))
191 t) 214 (macroexp--expand-all `(,fun ,arg1 ,f . ,args))))
192 ;; We don't use `macroexp--cons' since there's clearly a change.
193 (cons fun
194 (cons (macroexp--expand-all arg1)
195 (cons (macroexp--expand-all
196 (list 'function f))
197 (macroexp--all-forms args)))))
198 (`(,func . ,_) 215 (`(,func . ,_)
199 ;; Macro expand compiler macros. This cannot be delayed to 216 ;; Macro expand compiler macros. This cannot be delayed to
200 ;; byte-optimize-form because the output of the compiler-macro can 217 ;; byte-optimize-form because the output of the compiler-macro can
diff --git a/lisp/emacs-lisp/shadow.el b/lisp/emacs-lisp/shadow.el
index 286c4937b5b..bceec296ad8 100644
--- a/lisp/emacs-lisp/shadow.el
+++ b/lisp/emacs-lisp/shadow.el
@@ -158,8 +158,14 @@ See the documentation for `list-load-path-shadows' for further information."
158 (eq 0 (call-process "cmp" nil nil nil "-s" f1 f2)))))))) 158 (eq 0 (call-process "cmp" nil nil nil "-s" f1 f2))))))))
159 159
160(defvar load-path-shadows-font-lock-keywords 160(defvar load-path-shadows-font-lock-keywords
161 ;; The idea is that shadows of files supplied with Emacs are more
162 ;; serious than various versions of external packages shadowing each
163 ;; other.
161 `((,(format "hides \\(%s.*\\)" 164 `((,(format "hides \\(%s.*\\)"
162 (file-name-directory (locate-library "simple.el"))) 165 (file-name-directory
166 (or (locate-library "simple")
167 (file-name-as-directory
168 (expand-file-name "../lisp" data-directory)))))
163 . (1 font-lock-warning-face))) 169 . (1 font-lock-warning-face)))
164 "Keywords to highlight in `load-path-shadows-mode'.") 170 "Keywords to highlight in `load-path-shadows-mode'.")
165 171
diff --git a/lisp/emulation/edt-mapper.el b/lisp/emulation/edt-mapper.el
index 7fc24773b9e..87b6bcf0aa9 100644
--- a/lisp/emulation/edt-mapper.el
+++ b/lisp/emulation/edt-mapper.el
@@ -61,7 +61,7 @@
61 61
62;; emacs -q -l edt-mapper.el 62;; emacs -q -l edt-mapper.el
63 63
64;; The "-q" option prevents loading of your .emacs file (commands 64;; The "-q" option prevents loading of your init file (commands
65;; therein might confuse this program). 65;; therein might confuse this program).
66 66
67;; An instruction screen showing the typical LK-201 terminal 67;; An instruction screen showing the typical LK-201 terminal
@@ -74,7 +74,7 @@
74;; and loaded automatically when the EDT emulation is started. If 74;; and loaded automatically when the EDT emulation is started. If
75;; you specify a different file name, you will need to set the 75;; you specify a different file name, you will need to set the
76;; variable "edt-keys-file" before starting the EDT emulation. 76;; variable "edt-keys-file" before starting the EDT emulation.
77;; Here's how you might go about doing that in your .emacs file. 77;; Here's how you might go about doing that in your init file:
78 78
79;; (setq edt-keys-file (expand-file-name "~/.my-emacs-keys")) 79;; (setq edt-keys-file (expand-file-name "~/.my-emacs-keys"))
80 80
diff --git a/lisp/emulation/edt.el b/lisp/emulation/edt.el
index dbd13a01a8b..3810dcccbb3 100644
--- a/lisp/emulation/edt.el
+++ b/lisp/emulation/edt.el
@@ -48,7 +48,7 @@
48 48
49;; You can have the EDT Emulation start up automatically, each time 49;; You can have the EDT Emulation start up automatically, each time
50;; you initiate a GNU Emacs session, by adding the following line to 50;; you initiate a GNU Emacs session, by adding the following line to
51;; your .emacs file: 51;; your init file:
52;; 52;;
53;; (add-hook term-setup-hook 'edt-emulation-on) 53;; (add-hook term-setup-hook 'edt-emulation-on)
54 54
@@ -75,7 +75,7 @@
75;; default, this feature is enabled, with the top margin set to 75;; default, this feature is enabled, with the top margin set to
76;; 10% of the window and the bottom margin set to 15% of the 76;; 10% of the window and the bottom margin set to 15% of the
77;; window. To change these settings, you can invoke the function 77;; window. To change these settings, you can invoke the function
78;; edt-set-scroll-margins in your .emacs file. For example, the 78;; edt-set-scroll-margins in your init file. For example, the
79;; following line 79;; following line
80;; 80;;
81;; (edt-set-scroll-margins "20%" "25%") 81;; (edt-set-scroll-margins "20%" "25%")
@@ -363,7 +363,7 @@ This means that an edt-user.el file was found in the user's `load-path'.")
363;;; 363;;;
364;;; (setq edt-keep-current-page-delimiter t) 364;;; (setq edt-keep-current-page-delimiter t)
365;;; 365;;;
366;;; in your .emacs file. 366;;; in your init file.
367 367
368(defun edt-page-forward (num) 368(defun edt-page-forward (num)
369 "Move forward to just after next page delimiter. 369 "Move forward to just after next page delimiter.
@@ -1961,14 +1961,14 @@ created."
1961 Ack!! You're running the Enhanced EDT Emulation without loading an 1961 Ack!! You're running the Enhanced EDT Emulation without loading an
1962 EDT key mapping file. To create an EDT key mapping file, run the 1962 EDT key mapping file. To create an EDT key mapping file, run the
1963 edt-mapper program. It is safest to run it from an Emacs loaded 1963 edt-mapper program. It is safest to run it from an Emacs loaded
1964 without any of your own customizations found in your .emacs file, etc. 1964 without any of your own customizations found in your init file, etc.
1965 The reason for this is that some user customizations confuse edt-mapper. 1965 The reason for this is that some user customizations confuse edt-mapper.
1966 You can do this by quitting Emacs and then invoking Emacs again as 1966 You can do this by quitting Emacs and then invoking Emacs again as
1967 follows: 1967 follows:
1968 1968
1969 emacs -q -l edt-mapper 1969 emacs -q -l edt-mapper
1970 1970
1971 [NOTE: If you do nothing out of the ordinary in your .emacs file, and 1971 [NOTE: If you do nothing out of the ordinary in your init file, and
1972 the search for edt-mapper is successful, you can try running it now.] 1972 the search for edt-mapper is successful, you can try running it now.]
1973 1973
1974 The library edt-mapper includes these same directions on how to 1974 The library edt-mapper includes these same directions on how to
diff --git a/lisp/emulation/tpu-edt.el b/lisp/emulation/tpu-edt.el
index b8d07e8b744..d375725af56 100644
--- a/lisp/emulation/tpu-edt.el
+++ b/lisp/emulation/tpu-edt.el
@@ -163,8 +163,8 @@
163;; and type `tpu-edt' followed by a carriage return. 163;; and type `tpu-edt' followed by a carriage return.
164 164
165;; If you like TPU-edt and want to use it all the time, you can start 165;; If you like TPU-edt and want to use it all the time, you can start
166;; TPU-edt using the Emacs initialization file, .emacs. Simply create 166;; TPU-edt using the Emacs initialization file, .emacs. Simply add
167;; a .emacs file in your home directory containing the line: 167;; the following line to your init file:
168 168
169;; (tpu-edt) 169;; (tpu-edt)
170 170
@@ -2440,7 +2440,7 @@ If FILE is nil, try to load a default file. The default file names are
2440 2440
2441 2441
2442;;;### (autoloads (tpu-set-cursor-bound tpu-set-cursor-free tpu-set-scroll-margins 2442;;;### (autoloads (tpu-set-cursor-bound tpu-set-cursor-free tpu-set-scroll-margins
2443;;;;;; tpu-cursor-free-mode) "tpu-extras" "tpu-extras.el" "76f06905db4c5bfb3b86491a51512a0e") 2443;;;;;; tpu-cursor-free-mode) "tpu-extras" "tpu-extras.el" "bf5e7322f9a2c324a3bb306415813374")
2444;;; Generated autoloads from tpu-extras.el 2444;;; Generated autoloads from tpu-extras.el
2445 2445
2446(autoload 'tpu-cursor-free-mode "tpu-extras" "\ 2446(autoload 'tpu-cursor-free-mode "tpu-extras" "\
diff --git a/lisp/emulation/tpu-extras.el b/lisp/emulation/tpu-extras.el
index 521b189e3bc..4cf9eee037b 100644
--- a/lisp/emulation/tpu-extras.el
+++ b/lisp/emulation/tpu-extras.el
@@ -26,7 +26,7 @@
26 26
27;; Use the functions defined here to customize TPU-edt to your tastes by 27;; Use the functions defined here to customize TPU-edt to your tastes by
28;; setting scroll margins and/or turning on free cursor mode. Here's an 28;; setting scroll margins and/or turning on free cursor mode. Here's an
29;; example for your .emacs file. 29;; example for your init file.
30 30
31;; (tpu-set-cursor-free) ; Set cursor free. 31;; (tpu-set-cursor-free) ; Set cursor free.
32;; (tpu-set-scroll-margins "10%" "15%") ; Set scroll margins. 32;; (tpu-set-scroll-margins "10%" "15%") ; Set scroll margins.
diff --git a/lisp/emulation/tpu-mapper.el b/lisp/emulation/tpu-mapper.el
index ef4e9b305fc..9cced60816c 100644
--- a/lisp/emulation/tpu-mapper.el
+++ b/lisp/emulation/tpu-mapper.el
@@ -81,7 +81,7 @@ Finally, you will be prompted for the name of the file to store the key
81definitions. If you chose the default, TPU-edt will find it and load it 81definitions. If you chose the default, TPU-edt will find it and load it
82automatically. If you specify a different file name, you will need to 82automatically. If you specify a different file name, you will need to
83set the variable ``tpu-xkeys-file'' before starting TPU-edt. Here's how 83set the variable ``tpu-xkeys-file'' before starting TPU-edt. Here's how
84you might go about doing that in your .emacs file. 84you might go about doing that in your init file.
85 85
86 (setq tpu-xkeys-file (expand-file-name \"~/.my-emacs-x-keys\")) 86 (setq tpu-xkeys-file (expand-file-name \"~/.my-emacs-x-keys\"))
87 (tpu-edt) 87 (tpu-edt)
diff --git a/lisp/emulation/vi.el b/lisp/emulation/vi.el
index 9bf108c8c38..a59dd610c21 100644
--- a/lisp/emulation/vi.el
+++ b/lisp/emulation/vi.el
@@ -28,7 +28,7 @@
28;; (if (not (or (eq major-mode 'Info-mode) 28;; (if (not (or (eq major-mode 'Info-mode)
29;; (eq major-mode 'vi-mode))) 29;; (eq major-mode 'vi-mode)))
30;; (vi-mode)))))) 30;; (vi-mode))))))
31;; 3) In your .emacs file you can define the command "vi-mode" to be "autoload" 31;; 3) In your init file you can define the command "vi-mode" to be "autoload"
32;; or you can execute the "load" command to load "vi" directly. 32;; or you can execute the "load" command to load "vi" directly.
33;; 4) Read the comments for command "vi-mode" before you start using it. 33;; 4) Read the comments for command "vi-mode" before you start using it.
34 34
diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el
index 81fbfb0394c..8de253d19b0 100644
--- a/lisp/emulation/viper.el
+++ b/lisp/emulation/viper.el
@@ -351,7 +351,7 @@ user decide when to invoke Viper in a major mode."
351If t, viperize Emacs. If nil -- don't. If `ask', ask the user. 351If t, viperize Emacs. If nil -- don't. If `ask', ask the user.
352This variable is used primarily when Viper is being loaded. 352This variable is used primarily when Viper is being loaded.
353 353
354Must be set in `~/.emacs' before Viper is loaded. 354Must be set in your init file before Viper is loaded.
355DO NOT set this variable interactively, unless you are using the customization 355DO NOT set this variable interactively, unless you are using the customization
356widget." 356widget."
357 :type '(choice (const nil) (const t) (const ask)) 357 :type '(choice (const nil) (const t) (const ask))
@@ -1173,7 +1173,7 @@ If you wish to Viperize AND make this your way of life, please put
1173 (setq viper-mode t) 1173 (setq viper-mode t)
1174 (require 'viper) 1174 (require 'viper)
1175 1175
1176in your .emacs file (preferably, close to the top). 1176in your init file (preferably, close to the top).
1177These two lines must come in the order given. 1177These two lines must come in the order given.
1178 1178
1179** Viper users: 1179** Viper users:
diff --git a/lisp/epa-mail.el b/lisp/epa-mail.el
index be5b849651c..a16fa5abdd4 100644
--- a/lisp/epa-mail.el
+++ b/lisp/epa-mail.el
@@ -170,24 +170,26 @@ Don't use this command in Lisp programs!"
170If no one is selected, symmetric encryption will be performed. " 170If no one is selected, symmetric encryption will be performed. "
171 recipients) 171 recipients)
172 (if recipients 172 (if recipients
173 (mapcar 173 (apply
174 (lambda (recipient) 174 'nconc
175 (setq recipient-key 175 (mapcar
176 (epa-mail--find-usable-key 176 (lambda (recipient)
177 (epg-list-keys 177 (setq recipient-key
178 (epg-make-context epa-protocol) 178 (epa-mail--find-usable-key
179 (if (string-match "@" recipient) 179 (epg-list-keys
180 (concat "<" recipient ">") 180 (epg-make-context epa-protocol)
181 recipient)) 181 (if (string-match "@" recipient)
182 'encrypt)) 182 (concat "<" recipient ">")
183 (unless (or recipient-key 183 recipient))
184 (y-or-n-p 184 'encrypt))
185 (format 185 (unless (or recipient-key
186 "No public key for %s; skip it? " 186 (y-or-n-p
187 recipient))) 187 (format
188 (error "No public key for %s" recipient)) 188 "No public key for %s; skip it? "
189 recipient-key) 189 recipient)))
190 recipients))) 190 (error "No public key for %s" recipient))
191 (if recipient-key (list recipient-key)))
192 recipients))))
191 (setq sign (if verbose (y-or-n-p "Sign? "))) 193 (setq sign (if verbose (y-or-n-p "Sign? ")))
192 (if sign 194 (if sign
193 (epa-select-keys context 195 (epa-select-keys context
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog
index 37e755e7655..674a6c97eec 100644
--- a/lisp/erc/ChangeLog
+++ b/lisp/erc/ChangeLog
@@ -1,3 +1,9 @@
12012-09-17 Chong Yidong <cyd@gnu.org>
2
3 * erc-page.el (erc-page-function):
4
5 * erc-stamp.el (erc-stamp): Doc fix.
6
12012-08-21 Josh Feinstein <jlf@foxtail.org> 72012-08-21 Josh Feinstein <jlf@foxtail.org>
2 8
3 * erc-join.el (erc-autojoin-timing): Fix defcustom type. 9 * erc-join.el (erc-autojoin-timing): Fix defcustom type.
diff --git a/lisp/erc/erc-button.el b/lisp/erc/erc-button.el
index c8a7fec32bd..a0593dcb743 100644
--- a/lisp/erc/erc-button.el
+++ b/lisp/erc/erc-button.el
@@ -25,7 +25,7 @@
25 25
26;; Heavily borrowed from gnus-art.el. Thanks to the original authors. 26;; Heavily borrowed from gnus-art.el. Thanks to the original authors.
27;; This buttonizes nicks and other stuff to make it all clickable. 27;; This buttonizes nicks and other stuff to make it all clickable.
28;; To enable, add to your ~/.emacs: 28;; To enable, add to your init file:
29;; (require 'erc-button) 29;; (require 'erc-button)
30;; (erc-button-mode 1) 30;; (erc-button-mode 1)
31;; 31;;
diff --git a/lisp/erc/erc-capab.el b/lisp/erc/erc-capab.el
index 4f6361ee923..c7103d6dc61 100644
--- a/lisp/erc/erc-capab.el
+++ b/lisp/erc/erc-capab.el
@@ -48,7 +48,7 @@
48 48
49;;; Usage: 49;;; Usage:
50 50
51;; Put the following in your ~/.emacs file. 51;; Put the following in your init file.
52 52
53;; (require 'erc-capab) 53;; (require 'erc-capab)
54;; (erc-capab-identify-mode 1) 54;; (erc-capab-identify-mode 1)
diff --git a/lisp/erc/erc-match.el b/lisp/erc/erc-match.el
index cac042c0298..de7f2137197 100644
--- a/lisp/erc/erc-match.el
+++ b/lisp/erc/erc-match.el
@@ -29,7 +29,7 @@
29;; customizable variables. 29;; customizable variables.
30 30
31;; Usage: 31;; Usage:
32;; Put (erc-match-mode 1) into your ~/.emacs file. 32;; Put (erc-match-mode 1) into your init file.
33 33
34;;; Code: 34;;; Code:
35 35
diff --git a/lisp/erc/erc-netsplit.el b/lisp/erc/erc-netsplit.el
index 44fbc9563d6..355b345492c 100644
--- a/lisp/erc/erc-netsplit.el
+++ b/lisp/erc/erc-netsplit.el
@@ -23,7 +23,7 @@
23;;; Commentary: 23;;; Commentary:
24 24
25;; This module hides quit/join messages if a netsplit occurs. 25;; This module hides quit/join messages if a netsplit occurs.
26;; To enable, add the following to your ~/.emacs: 26;; To enable, add the following to your init file:
27;; (require 'erc-netsplit) 27;; (require 'erc-netsplit)
28;; (erc-netsplit-mode 1) 28;; (erc-netsplit-mode 1)
29 29
diff --git a/lisp/erc/erc-page.el b/lisp/erc/erc-page.el
index e6b670c91ba..51ddc33e1c0 100644
--- a/lisp/erc/erc-page.el
+++ b/lisp/erc/erc-page.el
@@ -45,7 +45,7 @@ If nil, this prints the page message in the minibuffer and calls
45`beep'. If non-nil, it must be a function that takes two arguments: 45`beep'. If non-nil, it must be a function that takes two arguments:
46SENDER and MSG, both strings. 46SENDER and MSG, both strings.
47 47
48Example for your ~/.emacs file: 48Example for your init file:
49 49
50\(setq erc-page-function 50\(setq erc-page-function
51 (lambda (sender msg) 51 (lambda (sender msg)
diff --git a/lisp/erc/erc-replace.el b/lisp/erc/erc-replace.el
index 04c5885bc3e..6c5804c62a4 100644
--- a/lisp/erc/erc-replace.el
+++ b/lisp/erc/erc-replace.el
@@ -25,7 +25,7 @@
25 25
26;; This module allows you to systematically replace text in incoming 26;; This module allows you to systematically replace text in incoming
27;; messages. Load erc-replace, and customize `erc-replace-alist'. 27;; messages. Load erc-replace, and customize `erc-replace-alist'.
28;; Then add to your ~/.emacs: 28;; Then add to your init file:
29 29
30;; (require 'erc-replace) 30;; (require 'erc-replace)
31;; (erc-replace-mode 1) 31;; (erc-replace-mode 1)
diff --git a/lisp/erc/erc-stamp.el b/lisp/erc/erc-stamp.el
index 5831233affe..4ce2f18e041 100644
--- a/lisp/erc/erc-stamp.el
+++ b/lisp/erc/erc-stamp.el
@@ -43,7 +43,7 @@ group provides settings related to the format and display
43of timestamp information in `erc-mode' buffer. 43of timestamp information in `erc-mode' buffer.
44 44
45For timestamping to be activated, you just need to load `erc-stamp' 45For timestamping to be activated, you just need to load `erc-stamp'
46in your .emacs file or interactively using `load-library'." 46in your init file or interactively using `load-library'."
47 :group 'erc) 47 :group 'erc)
48 48
49(defcustom erc-timestamp-format "[%H:%M]" 49(defcustom erc-timestamp-format "[%H:%M]"
diff --git a/lisp/erc/erc-track.el b/lisp/erc/erc-track.el
index 9c56c724224..88a3285730d 100644
--- a/lisp/erc/erc-track.el
+++ b/lisp/erc/erc-track.el
@@ -24,7 +24,7 @@
24;;; Commentary: 24;;; Commentary:
25 25
26;; Highlights keywords and pals (friends), and hides or highlights fools 26;; Highlights keywords and pals (friends), and hides or highlights fools
27;; (using a dark color). Add to your ~/.emacs: 27;; (using a dark color). Add to your init file:
28 28
29;; (require 'erc-track) 29;; (require 'erc-track)
30;; (erc-track-mode 1) 30;; (erc-track-mode 1)
diff --git a/lisp/eshell/em-alias.el b/lisp/eshell/em-alias.el
index 4b62fec95e6..940056b6438 100644
--- a/lisp/eshell/em-alias.el
+++ b/lisp/eshell/em-alias.el
@@ -133,10 +133,10 @@ Each element of this alias is a list of the form:
133Where NAME is the textual name of the alias, and DEFINITION is the 133Where NAME is the textual name of the alias, and DEFINITION is the
134command string to replace that command with. 134command string to replace that command with.
135 135
136Note: this list should not be modified in your '.emacs' file. Rather, 136Note: this list should not be modified in your init file.
137any desired alias definitions should be declared using the `alias' 137Rather, any desired alias definitions should be declared using
138command, which will automatically write them to the file named by 138the `alias' command, which will automatically write them to the
139`eshell-aliases-file'.") 139file named by `eshell-aliases-file'.")
140 140
141(put 'eshell-command-aliases-list 'risky-local-variable t) 141(put 'eshell-command-aliases-list 'risky-local-variable t)
142 142
diff --git a/lisp/eshell/esh-util.el b/lisp/eshell/esh-util.el
index 8218e91ddc7..fa0336232f9 100644
--- a/lisp/eshell/esh-util.el
+++ b/lisp/eshell/esh-util.el
@@ -84,7 +84,7 @@ Numeric form is tested using the regular expression
84NOTE: If you find that numeric conversions are interfering with the 84NOTE: If you find that numeric conversions are interfering with the
85specification of filenames (for example, in calling `find-file', or 85specification of filenames (for example, in calling `find-file', or
86some other Lisp function that deals with files, not numbers), add the 86some other Lisp function that deals with files, not numbers), add the
87following in your .emacs file: 87following in your init file:
88 88
89 (put 'find-file 'eshell-no-numeric-conversions t) 89 (put 'find-file 'eshell-no-numeric-conversions t)
90 90
diff --git a/lisp/ffap.el b/lisp/ffap.el
index ebe8b6dee94..f3e8d4c194e 100644
--- a/lisp/ffap.el
+++ b/lisp/ffap.el
@@ -34,7 +34,7 @@
34;; README's, MANIFEST's, and so on. Submit bugs or suggestions with 34;; README's, MANIFEST's, and so on. Submit bugs or suggestions with
35;; M-x ffap-bug. 35;; M-x ffap-bug.
36;; 36;;
37;; For the default installation, add this line to your .emacs file: 37;; For the default installation, add this line to your init file:
38;; 38;;
39;; (ffap-bindings) ; do default key bindings 39;; (ffap-bindings) ; do default key bindings
40;; 40;;
@@ -206,7 +206,7 @@ Sensible values are nil, \"news\", or \"mailto\"."
206;; those features interesting but not clear winners (a matter of 206;; those features interesting but not clear winners (a matter of
207;; personal taste) I try to leave options to enable them. Read 207;; personal taste) I try to leave options to enable them. Read
208;; through this section for features that you like, put an appropriate 208;; through this section for features that you like, put an appropriate
209;; enabler in your .emacs file. 209;; enabler in your init file.
210 210
211(defcustom ffap-dired-wildcards "[*?][^/]*\\'" 211(defcustom ffap-dired-wildcards "[*?][^/]*\\'"
212 "A regexp matching filename wildcard characters, or nil. 212 "A regexp matching filename wildcard characters, or nil.
diff --git a/lisp/filesets.el b/lisp/filesets.el
index 6c24a4f43d6..a91d8cf0fcb 100644
--- a/lisp/filesets.el
+++ b/lisp/filesets.el
@@ -35,7 +35,7 @@
35;; inclusion group (i.e. a base file including other files). 35;; inclusion group (i.e. a base file including other files).
36 36
37;; Usage: 37;; Usage:
38;; 1. Put (require 'filesets) and (filesets-init) in your .emacs file. 38;; 1. Put (require 'filesets) and (filesets-init) in your init file.
39;; 2. Type ;; M-x filesets-edit or choose "Edit Filesets" from the menu. 39;; 2. Type ;; M-x filesets-edit or choose "Edit Filesets" from the menu.
40;; 3. Save your customizations. 40;; 3. Save your customizations.
41 41
diff --git a/lisp/flow-ctrl.el b/lisp/flow-ctrl.el
index 747a4ca018c..b301886de5b 100644
--- a/lisp/flow-ctrl.el
+++ b/lisp/flow-ctrl.el
@@ -31,7 +31,7 @@
31;; 31;;
32;; To invoke these adjustments, a user need only invoke the function 32;; To invoke these adjustments, a user need only invoke the function
33;; enable-flow-control-on with a list of terminal types in his/her own 33;; enable-flow-control-on with a list of terminal types in his/her own
34;; .emacs file. As arguments, give it the names of one or more terminal 34;; init file. As arguments, give it the names of one or more terminal
35;; types in use by that user which require flow control adjustments. 35;; types in use by that user which require flow control adjustments.
36;; Here's an example: 36;; Here's an example:
37;; 37;;
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index 77c21d26535..6404af7703a 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -37,7 +37,7 @@
37;; When this minor mode is on, the faces of the current line are updated with 37;; When this minor mode is on, the faces of the current line are updated with
38;; every insertion or deletion. 38;; every insertion or deletion.
39;; 39;;
40;; To turn Font Lock mode on automatically, add this to your ~/.emacs file: 40;; To turn Font Lock mode on automatically, add this to your init file:
41;; 41;;
42;; (add-hook 'emacs-lisp-mode-hook 'turn-on-font-lock) 42;; (add-hook 'emacs-lisp-mode-hook 'turn-on-font-lock)
43;; 43;;
diff --git a/lisp/frame.el b/lisp/frame.el
index c182a964820..0bef358ecfb 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -301,7 +301,7 @@ there (in decreasing order of priority)."
301 ;; existing frame. We need to explicitly include 301 ;; existing frame. We need to explicitly include
302 ;; default-frame-alist in the parameters of the screen we 302 ;; default-frame-alist in the parameters of the screen we
303 ;; create here, so that its new value, gleaned from the user's 303 ;; create here, so that its new value, gleaned from the user's
304 ;; .emacs file, will be applied to the existing screen. 304 ;; init file, will be applied to the existing screen.
305 (if (not (eq (cdr (or (assq 'minibuffer initial-frame-alist) 305 (if (not (eq (cdr (or (assq 'minibuffer initial-frame-alist)
306 (assq 'minibuffer window-system-frame-alist) 306 (assq 'minibuffer window-system-frame-alist)
307 (assq 'minibuffer default-frame-alist) 307 (assq 'minibuffer default-frame-alist)
diff --git a/lisp/generic-x.el b/lisp/generic-x.el
index cc7963b1711..a97c5649c95 100644
--- a/lisp/generic-x.el
+++ b/lisp/generic-x.el
@@ -28,7 +28,7 @@
28;; 28;;
29;; INSTALLATION: 29;; INSTALLATION:
30;; 30;;
31;; Add this line to your .emacs file: 31;; Add this line to your init file:
32;; 32;;
33;; (require 'generic-x) 33;; (require 'generic-x)
34;; 34;;
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 69f0025b524..45f23a6d99c 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,14 @@
12012-09-17 Richard Stallman <rms@gnu.org>
2
3 * message.el (message-in-body-p): Don't set mark or modify buffer.
4
5 * mml.el (mml-attach-file): Doc fix.
6 (mml-attach-external, mml-attach-buffer, mml-attach-file):
7 Set mail-encode-mml when in Mail mode.
8 Simplify code to set HEAD and move back to HEAD.
9 (mml-insert-multipart, mml-insert-part):
10 Set mail-encode-mml when in Mail mode.
11
12012-09-13 Katsumi Yamaoka <yamaoka@jpl.org> 122012-09-13 Katsumi Yamaoka <yamaoka@jpl.org>
2 13
3 * gnus-util.el (gnus-timer--function): New function. 14 * gnus-util.el (gnus-timer--function): New function.
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 42911ce0648..5360f008432 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -3160,8 +3160,12 @@ M-RET `message-newline-and-reformat' (break the line and reformat)."
3160 3160
3161(defun message-in-body-p () 3161(defun message-in-body-p ()
3162 "Return t if point is in the message body." 3162 "Return t if point is in the message body."
3163 (let ((body (save-excursion (message-goto-body)))) 3163 (>= (point)
3164 (>= (point) body))) 3164 (save-excursion
3165 (goto-char (point-min))
3166 (or (search-forward (concat "\n" mail-header-separator "\n") nil t)
3167 (search-forward-regexp "[^:]+:\\([^\n]\\|\n[ \t]\\)+\n\n" nil t))
3168 (point))))
3165 3169
3166(defun message-goto-eoh () 3170(defun message-goto-eoh ()
3167 "Move point to the end of the headers." 3171 "Move point to the end of the headers."
diff --git a/lisp/gnus/mml.el b/lisp/gnus/mml.el
index cc1aedf1b97..a72962aae0d 100644
--- a/lisp/gnus/mml.el
+++ b/lisp/gnus/mml.el
@@ -1305,7 +1305,8 @@ to specify options."
1305(defun mml-attach-file (file &optional type description disposition) 1305(defun mml-attach-file (file &optional type description disposition)
1306 "Attach a file to the outgoing MIME message. 1306 "Attach a file to the outgoing MIME message.
1307The file is not inserted or encoded until you send the message with 1307The file is not inserted or encoded until you send the message with
1308`\\[message-send-and-exit]' or `\\[message-send]'. 1308`\\[message-send-and-exit]' or `\\[message-send]' in Message mode,
1309or `\\[mail-send-and-exit]' or `\\[mail-send]' in Mail mode.
1309 1310
1310FILE is the name of the file to attach. TYPE is its 1311FILE is the name of the file to attach. TYPE is its
1311content-type, a string of the form \"type/subtype\". DESCRIPTION 1312content-type, a string of the form \"type/subtype\". DESCRIPTION
@@ -1319,11 +1320,9 @@ body) or \"attachment\" (separate from the body)."
1319 (description (mml-minibuffer-read-description)) 1320 (description (mml-minibuffer-read-description))
1320 (disposition (mml-minibuffer-read-disposition type nil file))) 1321 (disposition (mml-minibuffer-read-disposition type nil file)))
1321 (list file type description disposition))) 1322 (list file type description disposition)))
1322 ;; Don't move point if this command is invoked inside the message header. 1323 ;; If in the message header, attach at the end and leave point unchanged.
1323 (let ((head (unless (message-in-body-p) 1324 (let ((head (unless (message-in-body-p) (point))))
1324 (prog1 1325 (if head (goto-char (point-max)))
1325 (point)
1326 (goto-char (point-max))))))
1327 (mml-insert-empty-tag 'part 1326 (mml-insert-empty-tag 'part
1328 'type type 1327 'type type
1329 ;; icicles redefines read-file-name and returns a 1328 ;; icicles redefines read-file-name and returns a
@@ -1331,12 +1330,15 @@ body) or \"attachment\" (separate from the body)."
1331 'filename (mm-substring-no-properties file) 1330 'filename (mm-substring-no-properties file)
1332 'disposition (or disposition "attachment") 1331 'disposition (or disposition "attachment")
1333 'description description) 1332 'description description)
1333 ;; When using Mail mode, make sure it does the mime encoding
1334 ;; when you send the message.
1335 (or (eq mail-user-agent 'message-user-agent)
1336 (setq mail-encode-mml t))
1334 (when head 1337 (when head
1335 (unless (prog1 1338 (unless (pos-visible-in-window-p)
1336 (pos-visible-in-window-p)
1337 (goto-char head))
1338 (message "The file \"%s\" has been attached at the end of the message" 1339 (message "The file \"%s\" has been attached at the end of the message"
1339 (file-name-nondirectory file)))))) 1340 (file-name-nondirectory file)))
1341 (goto-char head))))
1340 1342
1341(defun mml-dnd-attach-file (uri action) 1343(defun mml-dnd-attach-file (uri action)
1342 "Attach a drag and drop file. 1344 "Attach a drag and drop file.
@@ -1372,21 +1374,22 @@ BUFFER is the name of the buffer to attach. See
1372 (description (mml-minibuffer-read-description)) 1374 (description (mml-minibuffer-read-description))
1373 (disposition (mml-minibuffer-read-disposition type nil))) 1375 (disposition (mml-minibuffer-read-disposition type nil)))
1374 (list buffer type description disposition))) 1376 (list buffer type description disposition)))
1375 ;; Don't move point if this command is invoked inside the message header. 1377 ;; If in the message header, attach at the end and leave point unchanged.
1376 (let ((head (unless (message-in-body-p) 1378 (let ((head (unless (message-in-body-p) (point))))
1377 (prog1 1379 (if head (goto-char (point-max)))
1378 (point)
1379 (goto-char (point-max))))))
1380 (mml-insert-empty-tag 'part 'type type 'buffer buffer 1380 (mml-insert-empty-tag 'part 'type type 'buffer buffer
1381 'disposition disposition 1381 'disposition disposition
1382 'description description) 1382 'description description)
1383 ;; When using Mail mode, make sure it does the mime encoding
1384 ;; when you send the message.
1385 (or (eq mail-user-agent 'message-user-agent)
1386 (setq mail-encode-mml t))
1383 (when head 1387 (when head
1384 (unless (prog1 1388 (unless (pos-visible-in-window-p)
1385 (pos-visible-in-window-p)
1386 (goto-char head))
1387 (message 1389 (message
1388 "The buffer \"%s\" has been attached at the end of the message" 1390 "The buffer \"%s\" has been attached at the end of the message"
1389 buffer))))) 1391 buffer))
1392 (goto-char head))))
1390 1393
1391(defun mml-attach-external (file &optional type description) 1394(defun mml-attach-external (file &optional type description)
1392 "Attach an external file into the buffer. 1395 "Attach an external file into the buffer.
@@ -1397,19 +1400,20 @@ TYPE is the MIME type to use."
1397 (type (mml-minibuffer-read-type file)) 1400 (type (mml-minibuffer-read-type file))
1398 (description (mml-minibuffer-read-description))) 1401 (description (mml-minibuffer-read-description)))
1399 (list file type description))) 1402 (list file type description)))
1400 ;; Don't move point if this command is invoked inside the message header. 1403 ;; If in the message header, attach at the end and leave point unchanged.
1401 (let ((head (unless (message-in-body-p) 1404 (let ((head (unless (message-in-body-p) (point))))
1402 (prog1 1405 (if head (goto-char (point-max)))
1403 (point)
1404 (goto-char (point-max))))))
1405 (mml-insert-empty-tag 'external 'type type 'name file 1406 (mml-insert-empty-tag 'external 'type type 'name file
1406 'disposition "attachment" 'description description) 1407 'disposition "attachment" 'description description)
1408 ;; When using Mail mode, make sure it does the mime encoding
1409 ;; when you send the message.
1410 (or (eq mail-user-agent 'message-user-agent)
1411 (setq mail-encode-mml t))
1407 (when head 1412 (when head
1408 (unless (prog1 1413 (unless (pos-visible-in-window-p)
1409 (pos-visible-in-window-p)
1410 (goto-char head))
1411 (message "The file \"%s\" has been attached at the end of the message" 1414 (message "The file \"%s\" has been attached at the end of the message"
1412 (file-name-nondirectory file)))))) 1415 (file-name-nondirectory file)))
1416 (goto-char head))))
1413 1417
1414(defun mml-insert-multipart (&optional type) 1418(defun mml-insert-multipart (&optional type)
1415 (interactive (if (message-in-body-p) 1419 (interactive (if (message-in-body-p)
@@ -1422,12 +1426,20 @@ TYPE is the MIME type to use."
1422 (or type 1426 (or type
1423 (setq type "mixed")) 1427 (setq type "mixed"))
1424 (mml-insert-empty-tag "multipart" 'type type) 1428 (mml-insert-empty-tag "multipart" 'type type)
1429 ;; When using Mail mode, make sure it does the mime encoding
1430 ;; when you send the message.
1431 (or (eq mail-user-agent 'message-user-agent)
1432 (setq mail-encode-mml t))
1425 (forward-line -1)) 1433 (forward-line -1))
1426 1434
1427(defun mml-insert-part (&optional type) 1435(defun mml-insert-part (&optional type)
1428 (interactive (if (message-in-body-p) 1436 (interactive (if (message-in-body-p)
1429 (list (mml-minibuffer-read-type "")) 1437 (list (mml-minibuffer-read-type ""))
1430 (error "Use this command in the message body"))) 1438 (error "Use this command in the message body")))
1439 ;; When using Mail mode, make sure it does the mime encoding
1440 ;; when you send the message.
1441 (or (eq mail-user-agent 'message-user-agent)
1442 (setq mail-encode-mml t))
1431 (mml-insert-tag 'part 'type type 'disposition "inline")) 1443 (mml-insert-tag 'part 'type type 'disposition "inline"))
1432 1444
1433(declare-function message-subscribed-p "message" ()) 1445(declare-function message-subscribed-p "message" ())
diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el
index 644024a4b86..f92e2ab0af2 100644
--- a/lisp/hi-lock.el
+++ b/lisp/hi-lock.el
@@ -52,14 +52,14 @@
52;; 52;;
53;; Setup: 53;; Setup:
54;; 54;;
55;; Put the following code in your .emacs file. This turns on 55;; Put the following code in your init file. This turns on
56;; hi-lock mode and adds a "Regexp Highlighting" entry 56;; hi-lock mode and adds a "Regexp Highlighting" entry
57;; to the edit menu. 57;; to the edit menu.
58;; 58;;
59;; (global-hi-lock-mode 1) 59;; (global-hi-lock-mode 1)
60;; 60;;
61;; To enable the use of patterns found in files (presumably placed 61;; To enable the use of patterns found in files (presumably placed
62;; there by hi-lock) include the following in your .emacs file: 62;; there by hi-lock) include the following in your init file:
63;; 63;;
64;; (setq hi-lock-file-patterns-policy 'ask) 64;; (setq hi-lock-file-patterns-policy 'ask)
65;; 65;;
@@ -356,7 +356,7 @@ Hi-lock: end is found. A mode is excluded if it's in the list
356 "Possible archaic use of (hi-lock-mode). 356 "Possible archaic use of (hi-lock-mode).
357Use (global-hi-lock-mode 1) in .emacs to enable hi-lock for all buffers, 357Use (global-hi-lock-mode 1) in .emacs to enable hi-lock for all buffers,
358use (hi-lock-mode 1) for individual buffers. For compatibility with Emacs 358use (hi-lock-mode 1) for individual buffers. For compatibility with Emacs
359versions before 22 use the following in your .emacs file: 359versions before 22 use the following in your init file:
360 360
361 (if (functionp 'global-hi-lock-mode) 361 (if (functionp 'global-hi-lock-mode)
362 (global-hi-lock-mode 1) 362 (global-hi-lock-mode 1)
diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el
index c6e799252a2..77461469044 100644
--- a/lisp/ibuffer.el
+++ b/lisp/ibuffer.el
@@ -123,13 +123,13 @@ own!):
123 no upper limit on its size. The size will also be aligned to the 123 no upper limit on its size. The size will also be aligned to the
124 right. 124 right.
125 125
126Thus, if you wanted to use these two formats, add 126Thus, if you wanted to use these two formats, the appropriate
127value for this variable would be
127 128
128 (setq ibuffer-formats '((mark \" \" name) 129 '((mark \" \" name)
129 (mark modified read-only 130 (mark modified read-only
130 (name 16 16 :left) (size 6 -1 :right)))) 131 (name 16 16 :left)
131 132 (size 6 -1 :right)))
132to your ~/.emacs file.
133 133
134Using \\[ibuffer-switch-format], you can rotate the display between 134Using \\[ibuffer-switch-format], you can rotate the display between
135the specified formats in the list." 135the specified formats in the list."
diff --git a/lisp/ido.el b/lisp/ido.el
index 2100def1992..d48e7ba858b 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -493,6 +493,18 @@ as first char even if `ido-enable-prefix' is nil."
493 :type 'boolean 493 :type 'boolean
494 :group 'ido) 494 :group 'ido)
495 495
496;; See http://debbugs.gnu.org/2042 for more info.
497(defcustom ido-buffer-disable-smart-matches t
498 "Non-nil means not to re-order matches for buffer switching.
499By default, ido aranges matches in the following order:
500
501 full-matches > suffix matches > prefix matches > remaining matches
502
503which can get in the way for buffer switching."
504 :version "24.3"
505 :type 'boolean
506 :group 'ido)
507
496(defcustom ido-confirm-unique-completion nil 508(defcustom ido-confirm-unique-completion nil
497 "Non-nil means that even a unique completion must be confirmed. 509 "Non-nil means that even a unique completion must be confirmed.
498This means that \\[ido-complete] must always be followed by \\[ido-exit-minibuffer] 510This means that \\[ido-complete] must always be followed by \\[ido-exit-minibuffer]
@@ -3688,10 +3700,17 @@ This is to make them appear as if they were \"virtual buffers\"."
3688 (rex0 (if ido-enable-regexp text (regexp-quote text))) 3700 (rex0 (if ido-enable-regexp text (regexp-quote text)))
3689 (rexq (concat rex0 (if slash ".*/" ""))) 3701 (rexq (concat rex0 (if slash ".*/" "")))
3690 (re (if ido-enable-prefix (concat "\\`" rexq) rexq)) 3702 (re (if ido-enable-prefix (concat "\\`" rexq) rexq))
3691 (full-re (and do-full (not ido-enable-regexp) (not (string-match "\$\\'" rex0)) 3703 (full-re (and do-full
3704 (and (eq ido-cur-item 'buffer)
3705 (not ido-buffer-disable-smart-matches))
3706 (not ido-enable-regexp)
3707 (not (string-match "\$\\'" rex0))
3692 (concat "\\`" rex0 (if slash "/" "") "\\'"))) 3708 (concat "\\`" rex0 (if slash "/" "") "\\'")))
3693 (suffix-re (and do-full slash 3709 (suffix-re (and do-full slash
3694 (not ido-enable-regexp) (not (string-match "\$\\'" rex0)) 3710 (and (eq ido-cur-item 'buffer)
3711 (not ido-buffer-disable-smart-matches))
3712 (not ido-enable-regexp)
3713 (not (string-match "\$\\'" rex0))
3695 (concat rex0 "/\\'"))) 3714 (concat rex0 "/\\'")))
3696 (prefix-re (and full-re (not ido-enable-prefix) 3715 (prefix-re (and full-re (not ido-enable-prefix)
3697 (concat "\\`" rexq))) 3716 (concat "\\`" rexq)))
diff --git a/lisp/ielm.el b/lisp/ielm.el
index c93f235d81f..ba05bbcfc0f 100644
--- a/lisp/ielm.el
+++ b/lisp/ielm.el
@@ -59,7 +59,7 @@ override the read-only-ness of IELM prompts is to call
59`comint-kill-whole-line' or `comint-kill-region' with no 59`comint-kill-whole-line' or `comint-kill-region' with no
60narrowing in effect. This way you will be certain that none of 60narrowing in effect. This way you will be certain that none of
61the remaining prompts will be accidentally messed up. You may 61the remaining prompts will be accidentally messed up. You may
62wish to put something like the following in your `.emacs' file: 62wish to put something like the following in your init file:
63 63
64\(add-hook 'ielm-mode-hook 64\(add-hook 'ielm-mode-hook
65 (lambda () 65 (lambda ()
diff --git a/lisp/international/ogonek.el b/lisp/international/ogonek.el
index 39a88001112..3c34e5d9a2a 100644
--- a/lisp/international/ogonek.el
+++ b/lisp/international/ogonek.el
@@ -224,13 +224,14 @@ The functions come in the following groups.
224 ogonek-prefix-to-encoding iso8859-2 224 ogonek-prefix-to-encoding iso8859-2
225 225
226 The above default values can be changed by placing appropriate settings 226 The above default values can be changed by placing appropriate settings
227 in the '~/.emacs' file: 227 in your init file:
228 228
229 (setq ogonek-prefix-char ?/) 229 (setq ogonek-prefix-char ?/)
230 (setq ogonek-prefix-to-encoding \"iso8859-2\") 230 (setq ogonek-prefix-to-encoding \"iso8859-2\")
231 231
232 Instead of loading the whole library `ogonek' it may be better to 232 Instead of loading the whole library `ogonek' it may be better
233 autoload the needed functions, for example by placing in `~/.emacs': 233 to autoload the needed functions, for example by adding the
234 following lines to your init file:
234 235
235 (autoload 'ogonek-how \"ogonek\") 236 (autoload 'ogonek-how \"ogonek\")
236 (autoload 'ogonek-recode-region \"ogonek\") 237 (autoload 'ogonek-recode-region \"ogonek\")
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 04f5a7acc2c..37993767013 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -1649,9 +1649,9 @@ characters in that string."
1649 (isearch-done nil t) 1649 (isearch-done nil t)
1650 (isearch-clean-overlays) 1650 (isearch-clean-overlays)
1651 (let ((default (car occur-collect-regexp-history))) 1651 (let ((default (car occur-collect-regexp-history)))
1652 (read-string 1652 (read-regexp
1653 (format "Regexp to collect (default %s): " default) 1653 (format "Regexp to collect (default %s): " default)
1654 nil 'occur-collect-regexp-history default))) 1654 default 'occur-collect-regexp-history)))
1655 ;; Otherwise normal occur takes numerical prefix argument. 1655 ;; Otherwise normal occur takes numerical prefix argument.
1656 (when current-prefix-arg 1656 (when current-prefix-arg
1657 (prefix-numeric-value current-prefix-arg)))))) 1657 (prefix-numeric-value current-prefix-arg))))))
diff --git a/lisp/locate.el b/lisp/locate.el
index 29d7c75cbb2..d172ce3d6c4 100644
--- a/lisp/locate.el
+++ b/lisp/locate.el
@@ -34,7 +34,7 @@
34;; 34;;
35;; SHELLPROGRAM Name-to-find 35;; SHELLPROGRAM Name-to-find
36;; 36;;
37;; set the variable `locate-command' in your .emacs file. 37;; set the variable `locate-command' in your init file.
38;; 38;;
39;; To use a more complicated expression, create a function which 39;; To use a more complicated expression, create a function which
40;; takes a string (the name to find) as input and returns a list. 40;; takes a string (the name to find) as input and returns a list.
diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el
index 6ee3c7898c5..ca9bc6b8676 100644
--- a/lisp/mail/emacsbug.el
+++ b/lisp/mail/emacsbug.el
@@ -308,9 +308,14 @@ usually do not have translators for other languages.\n\n")))
308 (insert "\n")) 308 (insert "\n"))
309 (insert "\n") 309 (insert "\n")
310 (insert "Load-path shadows:\n") 310 (insert "Load-path shadows:\n")
311 (message "Checking for load-path shadows...") 311 (let* ((msg "Checking for load-path shadows...")
312 (let ((shadows (list-load-path-shadows t))) 312 (result "done")
313 (message "Checking for load-path shadows...done") 313 (shadows (progn (message "%s" msg)
314 (condition-case nil (list-load-path-shadows t)
315 (error
316 (setq result "error")
317 "Error during checking")))))
318 (message "%s%s" msg result)
314 (insert (if (zerop (length shadows)) 319 (insert (if (zerop (length shadows))
315 "None found.\n" 320 "None found.\n"
316 shadows))) 321 shadows)))
diff --git a/lisp/mail/feedmail.el b/lisp/mail/feedmail.el
index 520271940f2..4305094611a 100644
--- a/lisp/mail/feedmail.el
+++ b/lisp/mail/feedmail.el
@@ -139,9 +139,8 @@
139;; feedmail-send-it. Hers's the best way to use the stuff in this 139;; feedmail-send-it. Hers's the best way to use the stuff in this
140;; file: 140;; file:
141;; 141;;
142;; Save this file as feedmail.el somewhere on your elisp 142;; Save this file as feedmail.el somewhere on your elisp loadpath;
143;; loadpath; byte-compile it. Put the following lines somewhere in 143;; byte-compile it. Put the following lines in your init file:
144;; your ~/.emacs stuff:
145;; 144;;
146;; (setq send-mail-function 'feedmail-send-it) 145;; (setq send-mail-function 'feedmail-send-it)
147;; (autoload 'feedmail-send-it "feedmail") 146;; (autoload 'feedmail-send-it "feedmail")
diff --git a/lisp/mail/mail-hist.el b/lisp/mail/mail-hist.el
index dd489e3c6a9..40d67b4e904 100644
--- a/lisp/mail/mail-hist.el
+++ b/lisp/mail/mail-hist.el
@@ -28,7 +28,7 @@
28;; time. 28;; time.
29;; 29;;
30;; To use this package, put it in a directory in your load-path, and 30;; To use this package, put it in a directory in your load-path, and
31;; put this in your .emacs file: 31;; put this in your init file:
32;; 32;;
33;; (load "mail-hist" nil t) 33;; (load "mail-hist" nil t)
34;; 34;;
diff --git a/lisp/mail/mailabbrev.el b/lisp/mail/mailabbrev.el
index 290c57c1c55..2e4ffec1383 100644
--- a/lisp/mail/mailabbrev.el
+++ b/lisp/mail/mailabbrev.el
@@ -391,35 +391,24 @@ double-quotes."
391(defun mail-abbrev-expand-hook () 391(defun mail-abbrev-expand-hook ()
392 "For use as the fourth arg to `define-abbrev'. 392 "For use as the fourth arg to `define-abbrev'.
393After expanding a mail-abbrev, if Auto Fill mode is on and we're past the 393After expanding a mail-abbrev, if Auto Fill mode is on and we're past the
394fill-column, break the line at the previous comma, and indent the next line." 394fill-column, break the line at the previous comma, and indent the next line
395 ;; Disable abbrev mode to avoid recursion in indent-relative expanding 395with a space."
396 ;; part of the abbrev expansion as an abbrev itself. 396 (when auto-fill-function
397 (let ((abbrev-mode nil)) 397 (let (p)
398 (save-excursion 398 (save-excursion
399 (let ((p (point)) 399 (while (>= (current-column) fill-column)
400 bol comma fp) 400 (while (and (search-backward "," (point-at-bol) 'move)
401 (beginning-of-line) 401 (>= (current-column) (1- fill-column))
402 (setq bol (point)) 402 (setq p (point))))
403 (goto-char p) 403 (when (or (not (bolp))
404 (while (and auto-fill-function 404 (and p (goto-char p)))
405 (>= (current-column) fill-column) 405 (setq p nil)
406 (search-backward "," bol t)) 406 (forward-char 1)
407 (setq comma (point)) 407 (insert "\n")
408 (forward-char 1) ; Now we are just past the comma. 408 (when (looking-at "[\t ]+")
409 (insert "\n") 409 (delete-region (point) (match-end 0)))
410 (delete-horizontal-space) 410 (insert " ")
411 (setq p (point)) 411 (end-of-line)))))))
412 (indent-relative)
413 (setq fp (buffer-substring p (point)))
414 ;; Go to the end of the new line.
415 (end-of-line)
416 (if (> (current-column) fill-column)
417 ;; It's still too long; do normal auto-fill.
418 (let ((fill-prefix (or fp "\t")))
419 (do-auto-fill)))
420 ;; Resume the search.
421 (goto-char comma)
422 )))))
423 412
424;;; Syntax tables and abbrev-expansion 413;;; Syntax tables and abbrev-expansion
425 414
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index d88862b2d47..828cd6e72e7 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -4068,6 +4068,13 @@ The variable `rmail-retry-ignored-headers' is a regular expression
4068specifying headers which should not be copied into the new message." 4068specifying headers which should not be copied into the new message."
4069 (interactive) 4069 (interactive)
4070 (require 'mail-utils) 4070 (require 'mail-utils)
4071 (if rmail-enable-mime
4072 (with-current-buffer rmail-buffer
4073 (if (rmail-mime-message-p)
4074 (let ((rmail-mime-mbox-buffer rmail-view-buffer)
4075 (rmail-mime-view-buffer rmail-buffer))
4076 (rmail-mime-toggle-raw 'raw)))))
4077
4071 (let ((rmail-this-buffer (current-buffer)) 4078 (let ((rmail-this-buffer (current-buffer))
4072 (msgnum rmail-current-message) 4079 (msgnum rmail-current-message)
4073 bounce-start bounce-end bounce-indent resending 4080 bounce-start bounce-end bounce-indent resending
@@ -4543,7 +4550,7 @@ encoded string (and the same mask) will decode the string."
4543;;; Start of automatically extracted autoloads. 4550;;; Start of automatically extracted autoloads.
4544 4551
4545;;;### (autoloads (rmail-edit-current-message) "rmailedit" "rmailedit.el" 4552;;;### (autoloads (rmail-edit-current-message) "rmailedit" "rmailedit.el"
4546;;;;;; "7d558f958574f6003fa474ce2f3c80a8") 4553;;;;;; "78b8b7d5c679935c118d595d473d7c5e")
4547;;; Generated autoloads from rmailedit.el 4554;;; Generated autoloads from rmailedit.el
4548 4555
4549(autoload 'rmail-edit-current-message "rmailedit" "\ 4556(autoload 'rmail-edit-current-message "rmailedit" "\
@@ -4598,7 +4605,7 @@ With prefix argument N moves forward N messages with these labels.
4598 4605
4599;;;*** 4606;;;***
4600 4607
4601;;;### (autoloads (rmail-mime) "rmailmm" "rmailmm.el" "cd7656f82944d0b92b0d093a5f3a4c36") 4608;;;### (autoloads (rmail-mime) "rmailmm" "rmailmm.el" "0c18b83f914803d1216e1a9df7ea5275")
4602;;; Generated autoloads from rmailmm.el 4609;;; Generated autoloads from rmailmm.el
4603 4610
4604(autoload 'rmail-mime "rmailmm" "\ 4611(autoload 'rmail-mime "rmailmm" "\
diff --git a/lisp/mail/rmailedit.el b/lisp/mail/rmailedit.el
index 0b837a43d94..e4e066bd642 100644
--- a/lisp/mail/rmailedit.el
+++ b/lisp/mail/rmailedit.el
@@ -111,6 +111,8 @@ This function runs the hooks `text-mode-hook' and `rmail-edit-mode-hook'.
111 ;; Even if the message is in `raw' state, boundaries etc 111 ;; Even if the message is in `raw' state, boundaries etc
112 ;; are still missing. All we can do is insert the real 112 ;; are still missing. All we can do is insert the real
113 ;; raw message. (Bug#9840) 113 ;; raw message. (Bug#9840)
114 ;; FIXME? Since the 2012-09-17 changes to rmail-mime,
115 ;; can we just use that function now?
114 (when (and entity 116 (when (and entity
115 (not (equal "text/plain" 117 (not (equal "text/plain"
116 (car (rmail-mime-entity-type entity))))) 118 (car (rmail-mime-entity-type entity)))))
diff --git a/lisp/mail/rmailmm.el b/lisp/mail/rmailmm.el
index 67b2e62275f..2cc57963ef7 100644
--- a/lisp/mail/rmailmm.el
+++ b/lisp/mail/rmailmm.el
@@ -389,13 +389,13 @@ Use `raw' for raw mode, and any other non-nil value for decoded mode."
389 ;; Enter the raw mode. 389 ;; Enter the raw mode.
390 (rmail-mime-raw-mode entity) 390 (rmail-mime-raw-mode entity)
391 ;; Enter the shown mode. 391 ;; Enter the shown mode.
392 (rmail-mime-shown-mode entity)) 392 (rmail-mime-shown-mode entity)
393 (let ((inhibit-read-only t) 393 (let ((inhibit-read-only t)
394 (modified (buffer-modified-p))) 394 (modified (buffer-modified-p)))
395 (save-excursion 395 (save-excursion
396 (goto-char (aref segment 1)) 396 (goto-char (aref segment 1))
397 (rmail-mime-insert entity) 397 (rmail-mime-insert entity)
398 (restore-buffer-modified-p modified))))) 398 (restore-buffer-modified-p modified))))))
399 399
400(defun rmail-mime-toggle-hidden () 400(defun rmail-mime-toggle-hidden ()
401 "Hide or show the body of the MIME-entity at point." 401 "Hide or show the body of the MIME-entity at point."
@@ -1212,7 +1212,7 @@ available."
1212 (if (rmail-mime-display-header current) 1212 (if (rmail-mime-display-header current)
1213 (delete-char (- (aref segment 2) (aref segment 1)))) 1213 (delete-char (- (aref segment 2) (aref segment 1))))
1214 (insert-buffer-substring rmail-mime-mbox-buffer 1214 (insert-buffer-substring rmail-mime-mbox-buffer
1215 (aref header 0) (aref header 1))) 1215 (aref header 0) (aref header 1)))
1216 ;; tagline 1216 ;; tagline
1217 (if (rmail-mime-display-tagline current) 1217 (if (rmail-mime-display-tagline current)
1218 (delete-char (- (aref segment 3) (aref segment 2)))) 1218 (delete-char (- (aref segment 3) (aref segment 2))))
@@ -1261,14 +1261,17 @@ The arguments ARG and STATE have no effect in this case."
1261 (interactive (list current-prefix-arg nil)) 1261 (interactive (list current-prefix-arg nil))
1262 (if rmail-enable-mime 1262 (if rmail-enable-mime
1263 (with-current-buffer rmail-buffer 1263 (with-current-buffer rmail-buffer
1264 (if (rmail-mime-message-p) 1264 (if (or (rmail-mime-message-p)
1265 (let ((rmail-mime-mbox-buffer rmail-view-buffer) 1265 (get-text-property (point-min) 'rmail-mime-hidden))
1266 (rmail-mime-view-buffer rmail-buffer) 1266 (let* ((hidden (get-text-property (point-min) 'rmail-mime-hidden))
1267 (entity (get-text-property 1267 (desired-hidden (if state (eq state 'raw) (not hidden))))
1268 (progn 1268 (unless (eq hidden desired-hidden)
1269 (or arg (goto-char (point-min))) 1269 (if (not desired-hidden)
1270 (point)) 'rmail-mime-entity))) 1270 (rmail-show-message rmail-current-message)
1271 (if (or (not arg) entity) (rmail-mime-toggle-raw state))) 1271 (let ((rmail-enable-mime nil)
1272 (inhibit-read-only t))
1273 (rmail-show-message rmail-current-message)
1274 (add-text-properties (point-min) (point-max) '(rmail-mime-hidden t))))))
1272 (message "Not a MIME message, just toggling headers") 1275 (message "Not a MIME message, just toggling headers")
1273 (rmail-toggle-header))) 1276 (rmail-toggle-header)))
1274 (let* ((data (rmail-apply-in-message rmail-current-message 'buffer-string)) 1277 (let* ((data (rmail-apply-in-message rmail-current-message 'buffer-string))
diff --git a/lisp/mail/uce.el b/lisp/mail/uce.el
index fdfe17a1a07..3d7495ffd1a 100644
--- a/lisp/mail/uce.el
+++ b/lisp/mail/uce.el
@@ -63,7 +63,7 @@
63;; Usage: 63;; Usage:
64 64
65;; Place uce.el in your load-path (and optionally byte-compile it). 65;; Place uce.el in your load-path (and optionally byte-compile it).
66;; Add the following line to your ~/.emacs: 66;; Add the following line to your init file:
67;; (autoload 'uce-reply-to-uce "uce" "Reply to UCEs" t nil) 67;; (autoload 'uce-reply-to-uce "uce" "Reply to UCEs" t nil)
68;; If you want to use it with Gnus rather than Rmail: 68;; If you want to use it with Gnus rather than Rmail:
69;; (setq uce-mail-reader 'gnus) 69;; (setq uce-mail-reader 'gnus)
diff --git a/lisp/mouse-copy.el b/lisp/mouse-copy.el
index 8d043b4495f..a8e32bec1ae 100644
--- a/lisp/mouse-copy.el
+++ b/lisp/mouse-copy.el
@@ -35,7 +35,7 @@
35;; If you like mouse-copy, you should also check out mouse-drag 35;; If you like mouse-copy, you should also check out mouse-drag
36;; for ``one-click scrolling''. 36;; for ``one-click scrolling''.
37;; 37;;
38;; To use mouse-copy, place the following in your .emacs file: 38;; To use mouse-copy, place the following in your init file:
39;; (require 'mouse-copy) 39;; (require 'mouse-copy)
40;; (global-set-key [M-down-mouse-1] 'mouse-drag-secondary-pasting) 40;; (global-set-key [M-down-mouse-1] 'mouse-drag-secondary-pasting)
41;; (global-set-key [M-S-down-mouse-1] 'mouse-drag-secondary-moving) 41;; (global-set-key [M-S-down-mouse-1] 'mouse-drag-secondary-moving)
diff --git a/lisp/mouse-drag.el b/lisp/mouse-drag.el
index 7fb10505355..acdad9a42cf 100644
--- a/lisp/mouse-drag.el
+++ b/lisp/mouse-drag.el
@@ -46,7 +46,7 @@
46;; If you like mouse-drag, you should also check out mouse-copy 46;; If you like mouse-drag, you should also check out mouse-copy
47;; for ``one-click text copy and move''. 47;; for ``one-click text copy and move''.
48;; 48;;
49;; To use mouse-drag, place the following in your .emacs file: 49;; To use mouse-drag, place the following in your init file:
50;; -either- 50;; -either-
51;; (global-set-key [down-mouse-2] 'mouse-drag-throw) 51;; (global-set-key [down-mouse-2] 'mouse-drag-throw)
52;; -or- 52;; -or-
diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el
index 1501fa41baa..265a855b842 100644
--- a/lisp/net/ange-ftp.el
+++ b/lisp/net/ange-ftp.el
@@ -79,7 +79,7 @@
79;; that this change will take effect for the current GNU Emacs session only. 79;; that this change will take effect for the current GNU Emacs session only.
80;; See below for a discussion of non-UNIX hosts. If a large number of 80;; See below for a discussion of non-UNIX hosts. If a large number of
81;; machines with similar hostnames have this problem then it is easier to set 81;; machines with similar hostnames have this problem then it is easier to set
82;; the value of ange-ftp-dumb-unix-host-regexp in your .emacs file. ange-ftp 82;; the value of ange-ftp-dumb-unix-host-regexp in your init file. ange-ftp
83;; is unable to automatically recognize dumb unix hosts. 83;; is unable to automatically recognize dumb unix hosts.
84 84
85;; File name completion: 85;; File name completion:
@@ -275,10 +275,10 @@
275 275
276;; VMS support: 276;; VMS support:
277;; 277;;
278;; Ange-ftp has full support for VMS hosts. It 278;; Ange-ftp has full support for VMS hosts. It should be able to
279;; should be able to automatically recognize any VMS machine. However, if it 279;; automatically recognize any VMS machine. However, if it fails to do
280;; fails to do this, you can use the command ange-ftp-add-vms-host. As well, 280;; this, you can use the command ange-ftp-add-vms-host. Also, you can
281;; you can set the variable ange-ftp-vms-host-regexp in your .emacs file. We 281;; set the variable ange-ftp-vms-host-regexp in your init file. We
282;; would be grateful if you would report any failures to automatically 282;; would be grateful if you would report any failures to automatically
283;; recognize a VMS host as a bug. 283;; recognize a VMS host as a bug.
284;; 284;;
@@ -332,7 +332,7 @@
332;; the Michigan terminal system. It should be able to automatically 332;; the Michigan terminal system. It should be able to automatically
333;; recognize any MTS machine. However, if it fails to do this, you can use 333;; recognize any MTS machine. However, if it fails to do this, you can use
334;; the command ange-ftp-add-mts-host. As well, you can set the variable 334;; the command ange-ftp-add-mts-host. As well, you can set the variable
335;; ange-ftp-mts-host-regexp in your .emacs file. We would be grateful if you 335;; ange-ftp-mts-host-regexp in your init file. We would be grateful if you
336;; would report any failures to automatically recognize a MTS host as a bug. 336;; would report any failures to automatically recognize a MTS host as a bug.
337;; 337;;
338;; Filename syntax: 338;; Filename syntax:
@@ -358,7 +358,7 @@
358;; CMS. It should be able to automatically recognize any CMS machine. 358;; CMS. It should be able to automatically recognize any CMS machine.
359;; However, if it fails to do this, you can use the command 359;; However, if it fails to do this, you can use the command
360;; ange-ftp-add-cms-host. As well, you can set the variable 360;; ange-ftp-add-cms-host. As well, you can set the variable
361;; ange-ftp-cms-host-regexp in your .emacs file. We would be grateful if you 361;; ange-ftp-cms-host-regexp in your init file. We would be grateful if you
362;; would report any failures to automatically recognize a CMS host as a bug. 362;; would report any failures to automatically recognize a CMS host as a bug.
363;; 363;;
364;; Filename syntax: 364;; Filename syntax:
diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el
index d1d33bfe566..c1c83d2245e 100644
--- a/lisp/net/browse-url.el
+++ b/lisp/net/browse-url.el
@@ -122,8 +122,7 @@
122;; the buffer, use: 122;; the buffer, use:
123;; M-x browse-url 123;; M-x browse-url
124 124
125;; To display a URL by shift-clicking on it, put this in your ~/.emacs 125;; To display a URL by shift-clicking on it, put this in your init file:
126;; file:
127;; (global-set-key [S-mouse-2] 'browse-url-at-mouse) 126;; (global-set-key [S-mouse-2] 'browse-url-at-mouse)
128;; (Note that using Shift-mouse-1 is not desirable because 127;; (Note that using Shift-mouse-1 is not desirable because
129;; that event has a standard meaning in Emacs.) 128;; that event has a standard meaning in Emacs.)
diff --git a/lisp/net/goto-addr.el b/lisp/net/goto-addr.el
index 6a9d80f9672..f9e31788527 100644
--- a/lisp/net/goto-addr.el
+++ b/lisp/net/goto-addr.el
@@ -33,7 +33,7 @@
33;; INSTALLATION 33;; INSTALLATION
34;; 34;;
35;; To use goto-address in a particular mode (for example, while 35;; To use goto-address in a particular mode (for example, while
36;; reading mail in mh-e), add something like this in your .emacs file: 36;; reading mail in mh-e), add this to your init file:
37;; 37;;
38;; (add-hook 'mh-show-mode-hook 'goto-address) 38;; (add-hook 'mh-show-mode-hook 'goto-address)
39;; 39;;
diff --git a/lisp/net/newsticker.el b/lisp/net/newsticker.el
index 5d673faf0db..91eca84ce53 100644
--- a/lisp/net/newsticker.el
+++ b/lisp/net/newsticker.el
@@ -87,7 +87,7 @@
87;; If you are using Newsticker as part of GNU Emacs there is no need to 87;; If you are using Newsticker as part of GNU Emacs there is no need to
88;; perform any installation steps in order to use Newsticker. Otherwise 88;; perform any installation steps in order to use Newsticker. Otherwise
89;; place Newsticker in a directory where Emacs can find it. Add the 89;; place Newsticker in a directory where Emacs can find it. Add the
90;; following line to your Emacs startup file (`~/.emacs'). 90;; following line to your init file:
91;; (add-to-list 'load-path "/path/to/newsticker/") 91;; (add-to-list 'load-path "/path/to/newsticker/")
92;; (autoload 'newsticker-start "newsticker" "Emacs Newsticker" t) 92;; (autoload 'newsticker-start "newsticker" "Emacs Newsticker" t)
93;; (autoload 'newsticker-show-news "newsticker" "Emacs Newsticker" t) 93;; (autoload 'newsticker-show-news "newsticker" "Emacs Newsticker" t)
diff --git a/lisp/net/quickurl.el b/lisp/net/quickurl.el
index f3b0e372de4..f7d41fcd97a 100644
--- a/lisp/net/quickurl.el
+++ b/lisp/net/quickurl.el
@@ -164,7 +164,7 @@ To make use of this do something like:
164 164
165 (setq quickurl-postfix quickurl-reread-hook-postfix) 165 (setq quickurl-postfix quickurl-reread-hook-postfix)
166 166
167in your ~/.emacs (after loading/requiring quickurl).") 167in your init file (after loading/requiring quickurl).")
168 168
169;; Non-customize variables. 169;; Non-customize variables.
170 170
diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el
index 06aae1f6af2..abca6b3ea01 100644
--- a/lisp/net/tramp-cmds.el
+++ b/lisp/net/tramp-cmds.el
@@ -204,7 +204,7 @@ useful thing to do is to put
204 204
205 (setq tramp-verbose 9) 205 (setq tramp-verbose 9)
206 206
207in the ~/.emacs file and to repeat the bug. Then, include the 207in your init file and to repeat the bug. Then, include the
208contents of the *tramp/foo* buffer and the *debug tramp/foo* 208contents of the *tramp/foo* buffer and the *debug tramp/foo*
209buffer in your bug report. 209buffer in your bug report.
210 210
diff --git a/lisp/net/webjump.el b/lisp/net/webjump.el
index 232e5ca581a..d5de2f410c5 100644
--- a/lisp/net/webjump.el
+++ b/lisp/net/webjump.el
@@ -38,7 +38,7 @@
38;; example sites. You'll probably want to override it with your own favorite 38;; example sites. You'll probably want to override it with your own favorite
39;; sites. The documentation for the variable describes the syntax. 39;; sites. The documentation for the variable describes the syntax.
40 40
41;; You may wish to add something like the following to your `.emacs' file: 41;; You may wish to add something like the following to your init file:
42;; 42;;
43;; (require 'webjump) 43;; (require 'webjump)
44;; (global-set-key "\C-cj" 'webjump) 44;; (global-set-key "\C-cj" 'webjump)
diff --git a/lisp/novice.el b/lisp/novice.el
index bcc94c86c9d..c621ac4b692 100644
--- a/lisp/novice.el
+++ b/lisp/novice.el
@@ -159,8 +159,8 @@ to future sessions."
159(defun disable-command (command) 159(defun disable-command (command)
160 "Require special confirmation to execute COMMAND from now on. 160 "Require special confirmation to execute COMMAND from now on.
161COMMAND must be a symbol. 161COMMAND must be a symbol.
162This command alters the user's .emacs file so that this will apply 162This command alters your init file so that this choice applies to
163to future sessions." 163future sessions."
164 (interactive "CDisable command: ") 164 (interactive "CDisable command: ")
165 (en/disable-command command t)) 165 (en/disable-command command t))
166 166
diff --git a/lisp/pcmpl-gnu.el b/lisp/pcmpl-gnu.el
index da72c81c44a..be389e9c25a 100644
--- a/lisp/pcmpl-gnu.el
+++ b/lisp/pcmpl-gnu.el
@@ -128,8 +128,9 @@
128 (pcomplete-uniqify-list rules)))) 128 (pcomplete-uniqify-list rules))))
129 129
130(defcustom pcmpl-gnu-tarfile-regexp 130(defcustom pcmpl-gnu-tarfile-regexp
131 "\\.t\\(ar\\(\\.\\(gz\\|bz2\\|Z\\)\\)?\\|gz\\|a[zZ]\\|z2\\)\\'" 131 "\\.t\\(ar\\(\\.\\(gz\\|bz2\\|Z\\|xz\\)\\)?\\|gz\\|a[zZ]\\|z2\\)\\'"
132 "A regexp which matches any tar archive." 132 "A regexp which matches any tar archive."
133 :version "24.3" ; added xz
133 :type 'regexp 134 :type 'regexp
134 :group 'pcmpl-gnu) 135 :group 'pcmpl-gnu)
135 136
diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el
index d357da685e5..3f120961486 100644
--- a/lisp/pcomplete.el
+++ b/lisp/pcomplete.el
@@ -28,7 +28,7 @@
28;; argument position. 28;; argument position.
29;; 29;;
30;; To use pcomplete with shell-mode, for example, you will need the 30;; To use pcomplete with shell-mode, for example, you will need the
31;; following in your .emacs file: 31;; following in your init file:
32;; 32;;
33;; (add-hook 'shell-mode-hook 'pcomplete-shell-setup) 33;; (add-hook 'shell-mode-hook 'pcomplete-shell-setup)
34;; 34;;
@@ -451,9 +451,12 @@ Same as `pcomplete' but using the standard completion UI."
451 (list beg (point) table 451 (list beg (point) table
452 :predicate pred 452 :predicate pred
453 :exit-function 453 :exit-function
454 ;; If completion is finished, add a terminating space.
455 ;; We used to also do this if STATUS is `sole', but
456 ;; that does not work right when completion cycling.
454 (unless (zerop (length pcomplete-termination-string)) 457 (unless (zerop (length pcomplete-termination-string))
455 (lambda (_s finished) 458 (lambda (_s status)
456 (when (memq finished '(sole finished)) 459 (when (eq status 'finished)
457 (if (looking-at 460 (if (looking-at
458 (regexp-quote pcomplete-termination-string)) 461 (regexp-quote pcomplete-termination-string))
459 (goto-char (match-end 0)) 462 (goto-char (match-end 0))
diff --git a/lisp/play/bubbles.el b/lisp/play/bubbles.el
index 1f04099a6ae..3b6035473fd 100644
--- a/lisp/play/bubbles.el
+++ b/lisp/play/bubbles.el
@@ -33,7 +33,7 @@
33;; Installation 33;; Installation
34;; ------------ 34;; ------------
35 35
36;; Add the following lines to your Emacs startup file (`~/.emacs'). 36;; Add the following lines to your init file:
37;; (add-to-list 'load-path "/path/to/bubbles/") 37;; (add-to-list 'load-path "/path/to/bubbles/")
38;; (autoload 'bubbles "bubbles" "Play Bubbles" t) 38;; (autoload 'bubbles "bubbles" "Play Bubbles" t)
39 39
diff --git a/lisp/play/decipher.el b/lisp/play/decipher.el
index 8d9506a1614..ade0d15006a 100644
--- a/lisp/play/decipher.el
+++ b/lisp/play/decipher.el
@@ -138,19 +138,7 @@ the tail of the list."
138 ("^)\\([A-Z ]+\\)\\([a-z ]+\\)" 138 ("^)\\([A-Z ]+\\)\\([a-z ]+\\)"
139 (1 font-lock-keyword-face) 139 (1 font-lock-keyword-face)
140 (2 font-lock-string-face))) 140 (2 font-lock-string-face)))
141 "Expressions to fontify in Decipher mode. 141 "Font Lock keywords for Decipher mode.")
142
143Ciphertext uses `font-lock-keyword-face', plaintext uses
144`font-lock-string-face', comments use `font-lock-comment-face', and
145checkpoints use `font-lock-constant-face'. You can customize the
146display by changing these variables. For best results, I recommend
147that all faces use the same background color.
148
149For example, to display ciphertext in the `bold' face, use
150 (add-hook 'decipher-mode-hook
151 (lambda () (set (make-local-variable 'font-lock-keyword-face)
152 'bold)))
153in your `.emacs' file.")
154 142
155(defvar decipher-mode-map 143(defvar decipher-mode-map
156 (let ((map (make-keymap))) 144 (let ((map (make-keymap)))
diff --git a/lisp/play/handwrite.el b/lisp/play/handwrite.el
index d2e307c0145..85c128b08e2 100644
--- a/lisp/play/handwrite.el
+++ b/lisp/play/handwrite.el
@@ -45,7 +45,7 @@
45;; Installation 45;; Installation
46;; 46;;
47;; type at your prompt "emacs -l handwrite.el" or put this file on your 47;; type at your prompt "emacs -l handwrite.el" or put this file on your
48;; Emacs-Lisp load path, add the following into your ~/.emacs startup file 48;; Emacs-Lisp load path, add the following into your init file:
49;; 49;;
50;; (require 'handwrite) 50;; (require 'handwrite)
51;; 51;;
diff --git a/lisp/printing.el b/lisp/printing.el
index 0152ed63dbb..02b2fb0139c 100644
--- a/lisp/printing.el
+++ b/lisp/printing.el
@@ -139,10 +139,9 @@ Please send all bug fixes and enhancements to
139;; 139;;
140;; One way to set variables is by calling `pr-customize', customize all 140;; One way to set variables is by calling `pr-customize', customize all
141;; variables and save the customization by future sessions (see Options 141;; variables and save the customization by future sessions (see Options
142;; section). Other way is by coding your settings on Emacs init file (that is, 142;; section). Other way is by adding code to your init file; see below
143;; ~/.emacs file), see below for a first setting template that it should be 143;; for a first setting template that it should be inserted on your
144;; inserted on your ~/.emacs file (or c:/_emacs, if you're using Windows 9x/NT 144;; init file:
145;; or MS-DOS):
146;; 145;;
147;; * Example of setting for Windows system: 146;; * Example of setting for Windows system:
148;; 147;;
@@ -297,8 +296,7 @@ Please send all bug fixes and enhancements to
297;; Using `printing' 296;; Using `printing'
298;; ---------------- 297;; ----------------
299;; 298;;
300;; To use `printing' insert in your ~/.emacs file (or c:/_emacs, if you're 299;; To use `printing' insert in your init file:
301;; using Windows 9x/NT or MS-DOS):
302;; 300;;
303;; (require 'printing) 301;; (require 'printing)
304;; ;; ...some user settings... 302;; ;; ...some user settings...
diff --git a/lisp/progmodes/antlr-mode.el b/lisp/progmodes/antlr-mode.el
index 4062646c967..5a054af9883 100644
--- a/lisp/progmodes/antlr-mode.el
+++ b/lisp/progmodes/antlr-mode.el
@@ -69,7 +69,7 @@
69;; This file requires Emacs-20.3, XEmacs-20.4 or higher and package cc-mode. 69;; This file requires Emacs-20.3, XEmacs-20.4 or higher and package cc-mode.
70 70
71;; If antlr-mode is not part of your distribution, put this file into your 71;; If antlr-mode is not part of your distribution, put this file into your
72;; load-path and the following into your ~/.emacs: 72;; load-path and the following into your init file:
73;; (autoload 'antlr-mode "antlr-mode" nil t) 73;; (autoload 'antlr-mode "antlr-mode" nil t)
74;; (setq auto-mode-alist (cons '("\\.g\\'" . antlr-mode) auto-mode-alist)) 74;; (setq auto-mode-alist (cons '("\\.g\\'" . antlr-mode) auto-mode-alist))
75;; (add-hook 'speedbar-load-hook ; would be too late in antlr-mode.el 75;; (add-hook 'speedbar-load-hook ; would be too late in antlr-mode.el
diff --git a/lisp/progmodes/cc-styles.el b/lisp/progmodes/cc-styles.el
index cf628e44de0..20aa2bc2775 100644
--- a/lisp/progmodes/cc-styles.el
+++ b/lisp/progmodes/cc-styles.el
@@ -352,8 +352,8 @@ might get set too.
352If DONT-OVERRIDE is neither nil nor t, style variables whose default values 352If DONT-OVERRIDE is neither nil nor t, style variables whose default values
353have been set (more precisely, whose default values are not the symbol 353have been set (more precisely, whose default values are not the symbol
354`set-from-style') will not be changed. This avoids overriding global settings 354`set-from-style') will not be changed. This avoids overriding global settings
355done in ~/.emacs. It is useful to call c-set-style from a mode hook in this 355done in your init file. It is useful to call c-set-style from a mode hook
356way. 356in this way.
357 357
358If DONT-OVERRIDE is t, style variables that already have values (i.e., whose 358If DONT-OVERRIDE is t, style variables that already have values (i.e., whose
359values are not the symbol `set-from-style') will not be overridden. CC Mode 359values are not the symbol `set-from-style') will not be overridden. CC Mode
diff --git a/lisp/progmodes/cmacexp.el b/lisp/progmodes/cmacexp.el
index 943b5c6a067..525b1c9671e 100644
--- a/lisp/progmodes/cmacexp.el
+++ b/lisp/progmodes/cmacexp.el
@@ -49,7 +49,7 @@
49 49
50;; INSTALLATION ====================================================== 50;; INSTALLATION ======================================================
51 51
52;; Put the following in your ~/.emacs file. 52;; Put the following in your init file.
53 53
54;; If you want the *Macroexpansion* window to be not higher than 54;; If you want the *Macroexpansion* window to be not higher than
55;; necessary: 55;; necessary:
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index f5dedf0cd59..95b8758ba80 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -1556,20 +1556,20 @@ Returns the compilation buffer created."
1556 (get-buffer-create 1556 (get-buffer-create
1557 (compilation-buffer-name name-of-mode mode name-function))) 1557 (compilation-buffer-name name-of-mode mode name-function)))
1558 (let ((comp-proc (get-buffer-process (current-buffer)))) 1558 (let ((comp-proc (get-buffer-process (current-buffer))))
1559 (if comp-proc 1559 (if comp-proc
1560 (if (or (not (eq (process-status comp-proc) 'run)) 1560 (if (or (not (eq (process-status comp-proc) 'run))
1561 compilation-always-kill 1561 (eq (process-query-on-exit-flag comp-proc) nil)
1562 (yes-or-no-p 1562 (yes-or-no-p
1563 (format "A %s process is running; kill it? " 1563 (format "A %s process is running; kill it? "
1564 name-of-mode))) 1564 name-of-mode)))
1565 (condition-case () 1565 (condition-case ()
1566 (progn 1566 (progn
1567 (interrupt-process comp-proc) 1567 (interrupt-process comp-proc)
1568 (sit-for 1) 1568 (sit-for 1)
1569 (delete-process comp-proc)) 1569 (delete-process comp-proc))
1570 (error nil)) 1570 (error nil))
1571 (error "Cannot have two processes in `%s' at once" 1571 (error "Cannot have two processes in `%s' at once"
1572 (buffer-name))))) 1572 (buffer-name)))))
1573 ;; first transfer directory from where M-x compile was called 1573 ;; first transfer directory from where M-x compile was called
1574 (setq default-directory thisdir) 1574 (setq default-directory thisdir)
1575 ;; Make compilation buffer read-only. The filter can still write it. 1575 ;; Make compilation buffer read-only. The filter can still write it.
@@ -1624,7 +1624,7 @@ Returns the compilation buffer created."
1624 (let ((process-environment 1624 (let ((process-environment
1625 (append 1625 (append
1626 compilation-environment 1626 compilation-environment
1627 (if (if (boundp 'system-uses-terminfo) ; `if' for compiler warning 1627 (if (if (boundp 'system-uses-terminfo);`If' for compiler warning.
1628 system-uses-terminfo) 1628 system-uses-terminfo)
1629 (list "TERM=dumb" "TERMCAP=" 1629 (list "TERM=dumb" "TERMCAP="
1630 (format "COLUMNS=%d" (window-width))) 1630 (format "COLUMNS=%d" (window-width)))
@@ -1674,13 +1674,20 @@ Returns the compilation buffer created."
1674 nil `("-c" ,command)))) 1674 nil `("-c" ,command))))
1675 (start-file-process-shell-command (downcase mode-name) 1675 (start-file-process-shell-command (downcase mode-name)
1676 outbuf command)))) 1676 outbuf command))))
1677 ;; Make the buffer's mode line show process state. 1677 ;; Make the buffer's mode line show process state.
1678 (setq mode-line-process 1678 (setq mode-line-process
1679 '(:propertize ":%s" face compilation-mode-line-run)) 1679 '(:propertize ":%s" face compilation-mode-line-run))
1680 (set-process-sentinel proc 'compilation-sentinel) 1680
1681 (unless (eq mode t) 1681 ;; Set the process as killable without query by default.
1682 ;; Keep the comint filter, since it's needed for proper handling 1682 ;; This allows us to start a new compilation without
1683 ;; of the prompts. 1683 ;; getting prompted.
1684 (when compilation-always-kill
1685 (set-process-query-on-exit-flag proc nil))
1686
1687 (set-process-sentinel proc 'compilation-sentinel)
1688 (unless (eq mode t)
1689 ;; Keep the comint filter, since it's needed for proper
1690 ;; handling of the prompts.
1684 (set-process-filter proc 'compilation-filter)) 1691 (set-process-filter proc 'compilation-filter))
1685 ;; Use (point-max) here so that output comes in 1692 ;; Use (point-max) here so that output comes in
1686 ;; after the initial text, 1693 ;; after the initial text,
diff --git a/lisp/progmodes/ebnf2ps.el b/lisp/progmodes/ebnf2ps.el
index cdbaf4708a7..0f18cffc3de 100644
--- a/lisp/progmodes/ebnf2ps.el
+++ b/lisp/progmodes/ebnf2ps.el
@@ -43,7 +43,7 @@ Please send all bug fixes and enhancements to
43;; 43;;
44;; This package translates an EBNF to a syntactic chart on PostScript. 44;; This package translates an EBNF to a syntactic chart on PostScript.
45;; 45;;
46;; To use ebnf2ps, insert in your ~/.emacs: 46;; To use ebnf2ps, insert in your init file:
47;; 47;;
48;; (require 'ebnf2ps) 48;; (require 'ebnf2ps)
49;; 49;;
@@ -772,7 +772,7 @@ Please send all bug fixes and enhancements to
772;; 772;;
773;; To set the above options you may: 773;; To set the above options you may:
774;; 774;;
775;; a) insert the code in your ~/.emacs, like: 775;; a) insert the code in your init file, like:
776;; 776;;
777;; (setq ebnf-terminal-shape 'bevel) 777;; (setq ebnf-terminal-shape 'bevel)
778;; 778;;
diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el
index cc1251f6a75..f42952685d0 100644
--- a/lisp/progmodes/f90.el
+++ b/lisp/progmodes/f90.el
@@ -102,10 +102,9 @@
102;; (abbrev-mode 1) ; turn on abbreviation mode 102;; (abbrev-mode 1) ; turn on abbreviation mode
103;; (f90-add-imenu-menu) ; extra menu with functions etc. 103;; (f90-add-imenu-menu) ; extra menu with functions etc.
104;; (if f90-auto-keyword-case ; change case of all keywords on startup 104;; (if f90-auto-keyword-case ; change case of all keywords on startup
105;; (f90-change-keywords f90-auto-keyword-case)) 105;; (f90-change-keywords f90-auto-keyword-case))))
106;; ))
107;; 106;;
108;; in your .emacs file. You can also customize the lists 107;; in your init file. You can also customize the lists
109;; f90-font-lock-keywords, etc. 108;; f90-font-lock-keywords, etc.
110;; 109;;
111;; The auto-fill and abbreviation minor modes are accessible from the F90 menu, 110;; The auto-fill and abbreviation minor modes are accessible from the F90 menu,
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index a6ae42f86b1..c056b0f4e26 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -817,11 +817,11 @@ substitution string. Note dynamic scoping of variables.")
817(defun grep-read-regexp () 817(defun grep-read-regexp ()
818 "Read regexp arg for interactive grep." 818 "Read regexp arg for interactive grep."
819 (let ((default (grep-tag-default))) 819 (let ((default (grep-tag-default)))
820 (read-string 820 (read-regexp
821 (concat "Search for" 821 (concat "Search for"
822 (if (and default (> (length default) 0)) 822 (if (and default (> (length default) 0))
823 (format " (default \"%s\"): " default) ": ")) 823 (format " (default \"%s\"): " default) ": "))
824 nil 'grep-regexp-history default))) 824 default 'grep-regexp-history)))
825 825
826(defun grep-read-files (regexp) 826(defun grep-read-files (regexp)
827 "Read files arg for interactive grep." 827 "Read files arg for interactive grep."
diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el
index 233b9a5212e..2a77ad013c7 100644
--- a/lisp/progmodes/hideshow.el
+++ b/lisp/progmodes/hideshow.el
@@ -52,7 +52,7 @@
52;; 52;;
53;; First make sure hideshow.el is in a directory in your `load-path'. 53;; First make sure hideshow.el is in a directory in your `load-path'.
54;; You can optionally byte-compile it using `M-x byte-compile-file'. 54;; You can optionally byte-compile it using `M-x byte-compile-file'.
55;; Then, add the following to your ~/.emacs: 55;; Then, add the following to your init file:
56;; 56;;
57;; (load-library "hideshow") 57;; (load-library "hideshow")
58;; (add-hook 'X-mode-hook ; other modes similarly 58;; (add-hook 'X-mode-hook ; other modes similarly
diff --git a/lisp/progmodes/idlw-complete-structtag.el b/lisp/progmodes/idlw-complete-structtag.el
index 246ba8f29cd..24613d14634 100644
--- a/lisp/progmodes/idlw-complete-structtag.el
+++ b/lisp/progmodes/idlw-complete-structtag.el
@@ -53,8 +53,8 @@
53;; 53;;
54;; INSTALLATION 54;; INSTALLATION
55;; ============ 55;; ============
56;; Put this file on the emacs load path and load it with the following 56;; Put this file on the emacs load path and load it with the following
57;; line in your .emacs file: 57;; line in your init file:
58;; 58;;
59;; (add-hook 'idlwave-load-hook 59;; (add-hook 'idlwave-load-hook
60;; (lambda () (require 'idlw-complete-structtag))) 60;; (lambda () (require 'idlw-complete-structtag)))
diff --git a/lisp/progmodes/idlw-shell.el b/lisp/progmodes/idlw-shell.el
index 4f9109284ae..0abd4daf61b 100644
--- a/lisp/progmodes/idlw-shell.el
+++ b/lisp/progmodes/idlw-shell.el
@@ -48,7 +48,7 @@
48;; 48;;
49;; Follow the instructions in the INSTALL file of the distribution. 49;; Follow the instructions in the INSTALL file of the distribution.
50;; In short, put this file on your load path and add the following 50;; In short, put this file on your load path and add the following
51;; lines to your .emacs file: 51;; lines to your init file:
52;; 52;;
53;; (autoload 'idlwave-shell "idlw-shell" "IDLWAVE Shell" t) 53;; (autoload 'idlwave-shell "idlw-shell" "IDLWAVE Shell" t)
54;; 54;;
@@ -111,9 +111,7 @@ For example, \"^\r?IDL> \" or \"^\r?WAVE> \".
111The \"^\r?\" is needed, to indicate the beginning of the line, with 111The \"^\r?\" is needed, to indicate the beginning of the line, with
112optional return character (which IDL seems to output randomly). 112optional return character (which IDL seems to output randomly).
113This variable is used to initialize `comint-prompt-regexp' in the 113This variable is used to initialize `comint-prompt-regexp' in the
114process buffer. 114process buffer."
115
116This is a fine thing to set in your `.emacs' file."
117 :group 'idlwave-shell-general-setup 115 :group 'idlwave-shell-general-setup
118 :type 'regexp) 116 :type 'regexp)
119 117
@@ -2172,7 +2170,7 @@ args of an executive .run, .rnew or .compile."
2172 ;; CWD might have changed, resync, to set default directory 2170 ;; CWD might have changed, resync, to set default directory
2173 (idlwave-shell-resync-dirs) 2171 (idlwave-shell-resync-dirs)
2174 (let ((comint-file-name-chars idlwave-shell-file-name-chars)) 2172 (let ((comint-file-name-chars idlwave-shell-file-name-chars))
2175 (comint-filename-completion))) 2173 (comint-dynamic-complete-filename)))
2176 2174
2177(defun idlwave-shell-executive-command () 2175(defun idlwave-shell-executive-command ()
2178 "Return the name of the current executive command, if any." 2176 "Return the name of the current executive command, if any."
diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el
index a35ffd3e45d..9b634328fa7 100644
--- a/lisp/progmodes/idlwave.el
+++ b/lisp/progmodes/idlwave.el
@@ -51,7 +51,7 @@
51;; 51;;
52;; Follow the instructions in the INSTALL file of the distribution. 52;; Follow the instructions in the INSTALL file of the distribution.
53;; In short, put this file on your load path and add the following 53;; In short, put this file on your load path and add the following
54;; lines to your .emacs file: 54;; lines to your init file:
55;; 55;;
56;; (autoload 'idlwave-mode "idlwave" "IDLWAVE Mode" t) 56;; (autoload 'idlwave-mode "idlwave" "IDLWAVE Mode" t)
57;; (autoload 'idlwave-shell "idlw-shell" "IDLWAVE Shell" t) 57;; (autoload 'idlwave-shell "idlw-shell" "IDLWAVE Shell" t)
@@ -746,7 +746,7 @@ or even '?'. '.' is not a good choice because it can make structure
746field names act like abbrevs in certain circumstances. 746field names act like abbrevs in certain circumstances.
747 747
748Changes to this in `idlwave-mode-hook' will have no effect. Instead a user 748Changes to this in `idlwave-mode-hook' will have no effect. Instead a user
749must set it directly using `setq' in the .emacs file before idlwave.el 749must set it directly using `setq' in the init file before idlwave.el
750is loaded." 750is loaded."
751 :group 'idlwave-abbrev-and-indent-action 751 :group 'idlwave-abbrev-and-indent-action
752 :type 'string) 752 :type 'string)
diff --git a/lisp/progmodes/inf-lisp.el b/lisp/progmodes/inf-lisp.el
index cd6c8869d9f..401970b2ce8 100644
--- a/lisp/progmodes/inf-lisp.el
+++ b/lisp/progmodes/inf-lisp.el
@@ -168,9 +168,7 @@ This variable is only used if the variable
168More precise choices: 168More precise choices:
169Lucid Common Lisp: \"^\\\\(>\\\\|\\\\(->\\\\)+\\\\) *\" 169Lucid Common Lisp: \"^\\\\(>\\\\|\\\\(->\\\\)+\\\\) *\"
170franz: \"^\\\\(->\\\\|<[0-9]*>:\\\\) *\" 170franz: \"^\\\\(->\\\\|<[0-9]*>:\\\\) *\"
171kcl: \"^>+ *\" 171kcl: \"^>+ *\""
172
173This is a fine thing to set in your .emacs file or through Custom."
174 :type 'regexp 172 :type 'regexp
175 :group 'inferior-lisp) 173 :group 'inferior-lisp)
176 174
diff --git a/lisp/progmodes/mixal-mode.el b/lisp/progmodes/mixal-mode.el
index 54d857dd4b1..a59176a5aa6 100644
--- a/lisp/progmodes/mixal-mode.el
+++ b/lisp/progmodes/mixal-mode.el
@@ -32,7 +32,7 @@
32;; GNU MDK from `https://savannah.gnu.org/projects/mdk/' and 32;; GNU MDK from `https://savannah.gnu.org/projects/mdk/' and
33;; `ftp://ftp.gnu.org/pub/gnu/mdk'. 33;; `ftp://ftp.gnu.org/pub/gnu/mdk'.
34;; 34;;
35;; To use this mode, place the following in your .emacs file: 35;; To use this mode, place the following in your init file:
36;; `(load-file "/PATH-TO-FILE/mixal-mode.el")'. 36;; `(load-file "/PATH-TO-FILE/mixal-mode.el")'.
37;; When you load a file with the extension .mixal the mode will be started 37;; When you load a file with the extension .mixal the mode will be started
38;; automatic. If you want to start the mode manual, use `M-x mixal-mode'. 38;; automatic. If you want to start the mode manual, use `M-x mixal-mode'.
diff --git a/lisp/progmodes/octave-mod.el b/lisp/progmodes/octave-mod.el
index 79b3fcee720..ab5a19f8a2f 100644
--- a/lisp/progmodes/octave-mod.el
+++ b/lisp/progmodes/octave-mod.el
@@ -585,12 +585,12 @@ Variables you can use to customize Octave mode
585Turning on Octave mode runs the hook `octave-mode-hook'. 585Turning on Octave mode runs the hook `octave-mode-hook'.
586 586
587To begin using this mode for all `.m' files that you edit, add the 587To begin using this mode for all `.m' files that you edit, add the
588following lines to your `.emacs' file: 588following lines to your init file:
589 589
590 (add-to-list 'auto-mode-alist '(\"\\\\.m\\\\'\" . octave-mode)) 590 (add-to-list 'auto-mode-alist '(\"\\\\.m\\\\'\" . octave-mode))
591 591
592To automatically turn on the abbrev and auto-fill features, 592To automatically turn on the abbrev and auto-fill features,
593add the following lines to your `.emacs' file as well: 593add the following lines to your init file as well:
594 594
595 (add-hook 'octave-mode-hook 595 (add-hook 'octave-mode-hook
596 (lambda () 596 (lambda ()
diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el
index e13b67e596d..3dd9a48bb33 100644
--- a/lisp/progmodes/perl-mode.el
+++ b/lisp/progmodes/perl-mode.el
@@ -28,14 +28,14 @@
28;;; Commentary: 28;;; Commentary:
29 29
30;; To enter perl-mode automatically, add (autoload 'perl-mode "perl-mode") 30;; To enter perl-mode automatically, add (autoload 'perl-mode "perl-mode")
31;; to your .emacs file and change the first line of your perl script to: 31;; to your init file and change the first line of your perl script to:
32;; #!/usr/bin/perl -- # -*-Perl-*- 32;; #!/usr/bin/perl -- # -*-Perl-*-
33;; With arguments to perl: 33;; With arguments to perl:
34;; #!/usr/bin/perl -P- # -*-Perl-*- 34;; #!/usr/bin/perl -P- # -*-Perl-*-
35;; To handle files included with do 'filename.pl';, add something like 35;; To handle files included with do 'filename.pl';, add something like
36;; (setq auto-mode-alist (append (list (cons "\\.pl\\'" 'perl-mode)) 36;; (setq auto-mode-alist (append (list (cons "\\.pl\\'" 'perl-mode))
37;; auto-mode-alist)) 37;; auto-mode-alist))
38;; to your .emacs file; otherwise the .pl suffix defaults to prolog-mode. 38;; to your init file; otherwise the .pl suffix defaults to prolog-mode.
39 39
40;; This code is based on the 18.53 version c-mode.el, with extensive 40;; This code is based on the 18.53 version c-mode.el, with extensive
41;; rewriting. Most of the features of c-mode survived intact. 41;; rewriting. Most of the features of c-mode survived intact.
diff --git a/lisp/progmodes/prolog.el b/lisp/progmodes/prolog.el
index 16d85cb2d79..33d43cb3d5a 100644
--- a/lisp/progmodes/prolog.el
+++ b/lisp/progmodes/prolog.el
@@ -60,9 +60,7 @@
60 60
61;;; Installation: 61;;; Installation:
62;; 62;;
63;; Insert the following lines in your init file--typically ~/.emacs 63;; Insert the following lines in your init file:
64;; (GNU Emacs and XEmacs <21.4), or ~/.xemacs/init.el (XEmacs
65;; 21.4)--to use this mode when editing Prolog files under Emacs:
66;; 64;;
67;; (setq load-path (cons "/usr/lib/xemacs/site-lisp" load-path)) 65;; (setq load-path (cons "/usr/lib/xemacs/site-lisp" load-path))
68;; (autoload 'run-prolog "prolog" "Start a Prolog sub-process." t) 66;; (autoload 'run-prolog "prolog" "Start a Prolog sub-process." t)
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index 77ec8084ea2..0f02e81cbad 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -1112,8 +1112,9 @@ See `add-log-current-defun-function'."
1112 (goto-char end) 1112 (goto-char end)
1113 (when (eq (char-before) ?\}) 1113 (when (eq (char-before) ?\})
1114 (delete-char -1) 1114 (delete-char -1)
1115 (skip-chars-backward " \t") 1115 (when (save-excursion
1116 (when (not (bolp)) 1116 (skip-chars-backward " \t")
1117 (not (bolp)))
1117 (insert "\n")) 1118 (insert "\n"))
1118 (insert "end") 1119 (insert "end")
1119 (setq end-marker (point-marker)) 1120 (setq end-marker (point-marker))
@@ -1137,16 +1138,35 @@ See `add-log-current-defun-function'."
1137 t))) 1138 t)))
1138 1139
1139(defun ruby-do-end-to-brace (orig end) 1140(defun ruby-do-end-to-brace (orig end)
1140 (goto-char (- end 3)) 1141 (let (beg-marker end-marker beg-pos end-pos)
1141 (when (looking-at ruby-block-end-re) 1142 (goto-char (- end 3))
1142 (delete-char 3) 1143 (when (looking-at ruby-block-end-re)
1143 (insert "}") 1144 (delete-char 3)
1144 (goto-char orig) 1145 (setq end-marker (point-marker))
1145 (delete-char 2) 1146 (insert "}")
1146 (insert "{") 1147 (goto-char orig)
1147 (if (looking-at "\\s +|") 1148 (delete-char 2)
1148 (delete-char (- (match-end 0) (match-beginning 0) 1))) 1149 (insert "{")
1149 t)) 1150 (setq beg-marker (point-marker))
1151 (when (looking-at "\\s +|")
1152 (delete-char (- (match-end 0) (match-beginning 0) 1))
1153 (forward-char)
1154 (re-search-forward "|" (line-end-position) t))
1155 (save-excursion
1156 (skip-chars-forward " \t\n\r")
1157 (setq beg-pos (point))
1158 (goto-char end-marker)
1159 (skip-chars-backward " \t\n\r")
1160 (setq end-pos (point)))
1161 (when (or
1162 (< end-pos beg-pos)
1163 (and (= (line-number-at-pos beg-pos) (line-number-at-pos end-pos))
1164 (< (+ (current-column) (- end-pos beg-pos) 2) fill-column)))
1165 (just-one-space -1)
1166 (goto-char end-marker)
1167 (just-one-space -1))
1168 (goto-char beg-marker)
1169 t)))
1150 1170
1151(defun ruby-toggle-block () 1171(defun ruby-toggle-block ()
1152 "Toggle block type from do-end to braces or back. 1172 "Toggle block type from do-end to braces or back.
diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el
index f3ecbe3fc3d..3d5abc4df62 100644
--- a/lisp/progmodes/sql.el
+++ b/lisp/progmodes/sql.el
@@ -268,9 +268,8 @@
268 268
269(defcustom sql-password "" 269(defcustom sql-password ""
270 "Default password. 270 "Default password.
271 271If you customize this, the value will be stored in your init
272Storing your password in a textfile such as ~/.emacs could be dangerous. 272file. Since that is a plaintext file, this could be dangerous."
273Customizing your password will store it in your ~/.emacs file."
274 :type 'string 273 :type 'string
275 :group 'SQL 274 :group 'SQL
276 :risky t) 275 :risky t)
@@ -1285,8 +1284,8 @@ Based on `comint-mode-map'.")
1285 ["List all objects" sql-list-all (sql-get-product-feature sql-product :list-all)] 1284 ["List all objects" sql-list-all (sql-get-product-feature sql-product :list-all)]
1286 ["List table details" sql-list-table (sql-get-product-feature sql-product :list-table)])) 1285 ["List table details" sql-list-table (sql-get-product-feature sql-product :list-table)]))
1287 1286
1288;; Abbreviations -- if you want more of them, define them in your 1287;; Abbreviations -- if you want more of them, define them in your init
1289;; ~/.emacs file. Abbrevs have to be enabled in your ~/.emacs, too. 1288;; file. Abbrevs have to be enabled in your init file, too.
1290 1289
1291(defvar sql-mode-abbrev-table nil 1290(defvar sql-mode-abbrev-table nil
1292 "Abbrev table used in `sql-mode' and `sql-interactive-mode'.") 1291 "Abbrev table used in `sql-mode' and `sql-interactive-mode'.")
@@ -3715,8 +3714,8 @@ For information on how to create multiple SQLi buffers, see
3715`sql-interactive-mode'. 3714`sql-interactive-mode'.
3716 3715
3717Note that SQL doesn't have an escape character unless you specify 3716Note that SQL doesn't have an escape character unless you specify
3718one. If you specify backslash as escape character in SQL, 3717one. If you specify backslash as escape character in SQL, you
3719you must tell Emacs. Here's how to do that in your `~/.emacs' file: 3718must tell Emacs. Here's how to do that in your init file:
3720 3719
3721\(add-hook 'sql-mode-hook 3720\(add-hook 'sql-mode-hook
3722 (lambda () 3721 (lambda ()
@@ -3806,7 +3805,7 @@ cause the window to scroll to the end of the buffer.
3806If you want to make SQL buffers limited in length, add the function 3805If you want to make SQL buffers limited in length, add the function
3807`comint-truncate-buffer' to `comint-output-filter-functions'. 3806`comint-truncate-buffer' to `comint-output-filter-functions'.
3808 3807
3809Here is an example for your .emacs file. It keeps the SQLi buffer a 3808Here is an example for your init file. It keeps the SQLi buffer a
3810certain length. 3809certain length.
3811 3810
3812\(add-hook 'sql-interactive-mode-hook 3811\(add-hook 'sql-interactive-mode-hook
diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el
index c072754e66d..835d548c19f 100644
--- a/lisp/progmodes/verilog-mode.el
+++ b/lisp/progmodes/verilog-mode.el
@@ -8790,7 +8790,7 @@ Note these are only read when the file is first visited, you must use
8790\\[find-alternate-file] RET to have these take effect after editing them! 8790\\[find-alternate-file] RET to have these take effect after editing them!
8791 8791
8792If you want to disable the \"Process `eval' or hook local variables\" 8792If you want to disable the \"Process `eval' or hook local variables\"
8793warning message, you need to add to your .emacs file: 8793warning message, you need to add to your init file:
8794 8794
8795 (setq enable-local-eval t)" 8795 (setq enable-local-eval t)"
8796 (let ((origbuf (current-buffer))) 8796 (let ((origbuf (current-buffer)))
@@ -11756,7 +11756,7 @@ An example:
11756 11756
11757 // For this example we declare the function in the 11757 // For this example we declare the function in the
11758 // module's file itself. Often you'd define it instead 11758 // module's file itself. Often you'd define it instead
11759 // in a site-start.el or .emacs file. 11759 // in a site-start.el or init file.
11760 /* 11760 /*
11761 Local Variables: 11761 Local Variables:
11762 eval: 11762 eval:
diff --git a/lisp/ps-print.el b/lisp/ps-print.el
index addf2975c5f..930e750ab27 100644
--- a/lisp/ps-print.el
+++ b/lisp/ps-print.el
@@ -1042,7 +1042,7 @@ Please send all bug fixes and enhancements to
1042;; variables `ps-bold-faces', `ps-italic-faces' and `ps-underlined-faces'. 1042;; variables `ps-bold-faces', `ps-italic-faces' and `ps-underlined-faces'.
1043;; These variables contain lists of faces that ps-print should consider bold, 1043;; These variables contain lists of faces that ps-print should consider bold,
1044;; italic or underline; to set them, put code like the following into your 1044;; italic or underline; to set them, put code like the following into your
1045;; .emacs file: 1045;; init file:
1046;; 1046;;
1047;; (setq ps-bold-faces '(my-blue-face)) 1047;; (setq ps-bold-faces '(my-blue-face))
1048;; (setq ps-italic-faces '(my-red-face)) 1048;; (setq ps-italic-faces '(my-red-face))
diff --git a/lisp/replace.el b/lisp/replace.el
index 001f7d1a78d..f192574a7e2 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -128,20 +128,21 @@ wants to replace FROM with TO."
128 (if query-replace-interactive 128 (if query-replace-interactive
129 (car (if regexp-flag regexp-search-ring search-ring)) 129 (car (if regexp-flag regexp-search-ring search-ring))
130 (let* ((history-add-new-input nil) 130 (let* ((history-add-new-input nil)
131 (prompt
132 (if query-replace-defaults
133 (format "%s (default %s -> %s): " prompt
134 (query-replace-descr (car query-replace-defaults))
135 (query-replace-descr (cdr query-replace-defaults)))
136 (format "%s: " prompt)))
131 (from 137 (from
132 ;; The save-excursion here is in case the user marks and copies 138 ;; The save-excursion here is in case the user marks and copies
133 ;; a region in order to specify the minibuffer input. 139 ;; a region in order to specify the minibuffer input.
134 ;; That should not clobber the region for the query-replace itself. 140 ;; That should not clobber the region for the query-replace itself.
135 (save-excursion 141 (save-excursion
136 (read-from-minibuffer 142 (if regexp-flag
137 (if query-replace-defaults 143 (read-regexp prompt nil query-replace-from-history-variable)
138 (format "%s (default %s -> %s): " prompt 144 (read-from-minibuffer
139 (query-replace-descr (car query-replace-defaults)) 145 prompt nil nil nil query-replace-from-history-variable nil t)))))
140 (query-replace-descr (cdr query-replace-defaults)))
141 (format "%s: " prompt))
142 nil nil nil
143 query-replace-from-history-variable
144 nil t))))
145 (if (and (zerop (length from)) query-replace-defaults) 146 (if (and (zerop (length from)) query-replace-defaults)
146 (cons (car query-replace-defaults) 147 (cons (car query-replace-defaults)
147 (query-replace-compile-replacement 148 (query-replace-compile-replacement
@@ -574,38 +575,47 @@ of `history-length', which see.")
574(defvar occur-collect-regexp-history '("\\1") 575(defvar occur-collect-regexp-history '("\\1")
575 "History of regexp for occur's collect operation") 576 "History of regexp for occur's collect operation")
576 577
577(defun read-regexp (prompt &optional default-value) 578(defun read-regexp (prompt &optional defaults history)
578 "Read regexp as a string using the regexp history and some useful defaults. 579 "Read and return a regular expression as a string.
579Prompt for a regular expression with PROMPT (without a colon and 580When PROMPT doesn't end with a colon and space, it adds a final \": \".
580space) in the minibuffer. The optional argument DEFAULT-VALUE 581If DEFAULTS is non-nil, it displays the first default in the prompt.
581provides the value to display in the minibuffer prompt that is 582
582returned if the user just types RET. 583Non-nil optional arg DEFAULTS is a string or a list of strings that
583Values available via M-n are the string at point, the last isearch 584are prepended to a list of standard default values, which include the
584regexp, the last isearch string, and the last replacement regexp." 585string at point, the last isearch regexp, the last isearch string, and
585 (let* ((defaults 586the last replacement regexp.
586 (list (regexp-quote 587
587 (or (funcall (or find-tag-default-function 588Non-nil HISTORY is a symbol to use for the history list.
588 (get major-mode 'find-tag-default-function) 589If HISTORY is nil, `regexp-history' is used."
589 'find-tag-default)) 590 (let* ((default (if (consp defaults) (car defaults) defaults))
590 "")) 591 (defaults
591 (car regexp-search-ring) 592 (append
592 (regexp-quote (or (car search-ring) "")) 593 (if (listp defaults) defaults (list defaults))
593 (car (symbol-value 594 (list (regexp-quote
594 query-replace-from-history-variable)))) 595 (or (funcall (or find-tag-default-function
596 (get major-mode 'find-tag-default-function)
597 'find-tag-default))
598 ""))
599 (car regexp-search-ring)
600 (regexp-quote (or (car search-ring) ""))
601 (car (symbol-value
602 query-replace-from-history-variable)))))
595 (defaults (delete-dups (delq nil (delete "" defaults)))) 603 (defaults (delete-dups (delq nil (delete "" defaults))))
596 ;; Don't add automatically the car of defaults for empty input 604 ;; Do not automatically add default to the history for empty input.
597 (history-add-new-input nil) 605 (history-add-new-input nil)
598 (input 606 (input (read-from-minibuffer
599 (read-from-minibuffer 607 (cond ((string-match-p ":[ \t]*\\'" prompt)
600 (if default-value 608 prompt)
601 (format "%s (default %s): " prompt 609 (default
602 (query-replace-descr default-value)) 610 (format "%s (default %s): " prompt
603 (format "%s: " prompt)) 611 (query-replace-descr default)))
604 nil nil nil 'regexp-history defaults t))) 612 (t
613 (format "%s: " prompt)))
614 nil nil nil (or history 'regexp-history) defaults t)))
605 (if (equal input "") 615 (if (equal input "")
606 (or default-value input) 616 (or default input)
607 (prog1 input 617 (prog1 input
608 (add-to-history 'regexp-history input))))) 618 (add-to-history (or history 'regexp-history) input)))))
609 619
610 620
611(defalias 'delete-non-matching-lines 'keep-lines) 621(defalias 'delete-non-matching-lines 'keep-lines)
@@ -1130,9 +1140,9 @@ which means to discard all text properties."
1130 "\\&" 1140 "\\&"
1131 ;; Get the regexp for collection pattern. 1141 ;; Get the regexp for collection pattern.
1132 (let ((default (car occur-collect-regexp-history))) 1142 (let ((default (car occur-collect-regexp-history)))
1133 (read-string 1143 (read-regexp
1134 (format "Regexp to collect (default %s): " default) 1144 (format "Regexp to collect (default %s): " default)
1135 nil 'occur-collect-regexp-history default))) 1145 default 'occur-collect-regexp-history)))
1136 ;; Otherwise normal occur takes numerical prefix argument. 1146 ;; Otherwise normal occur takes numerical prefix argument.
1137 (when current-prefix-arg 1147 (when current-prefix-arg
1138 (prefix-numeric-value current-prefix-arg)))))) 1148 (prefix-numeric-value current-prefix-arg))))))
@@ -1219,14 +1229,10 @@ See also `multi-occur'."
1219 (cons 1229 (cons
1220 (let* ((default (car regexp-history)) 1230 (let* ((default (car regexp-history))
1221 (input 1231 (input
1222 (read-from-minibuffer 1232 (read-regexp
1223 (if current-prefix-arg 1233 (if current-prefix-arg
1224 "List lines in buffers whose names match regexp: " 1234 "List lines in buffers whose names match regexp: "
1225 "List lines in buffers whose filenames match regexp: ") 1235 "List lines in buffers whose filenames match regexp: "))))
1226 nil
1227 nil
1228 nil
1229 'regexp-history)))
1230 (if (equal input "") 1236 (if (equal input "")
1231 default 1237 default
1232 input)) 1238 input))
diff --git a/lisp/saveplace.el b/lisp/saveplace.el
index 43dad63a140..0c082169462 100644
--- a/lisp/saveplace.el
+++ b/lisp/saveplace.el
@@ -56,13 +56,12 @@ This means when you visit a file, point goes to the last place
56where it was when you previously visited the same file. 56where it was when you previously visited the same file.
57This variable is automatically buffer-local. 57This variable is automatically buffer-local.
58 58
59If you wish your place in any file to always be automatically saved, 59If you wish your place in any file to always be automatically
60simply put this in your `~/.emacs' file: 60saved, set this to t using the Customize facility, or put the
61following code in your init file:
61 62
62\(setq-default save-place t) 63\(setq-default save-place t)
63\(require 'saveplace) 64\(require 'saveplace)"
64
65or else use the Custom facility to set this option."
66 :type 'boolean 65 :type 'boolean
67 :require 'saveplace 66 :require 'saveplace
68 :group 'save-place) 67 :group 'save-place)
@@ -148,7 +147,8 @@ even in a later Emacs session.
148If called with a prefix arg, the mode is enabled if and only if 147If called with a prefix arg, the mode is enabled if and only if
149the argument is positive. 148the argument is positive.
150 149
151To save places automatically in all files, put this in your `.emacs' file: 150To save places automatically in all files, put this in your init
151file:
152 152
153\(setq-default save-place t\)" 153\(setq-default save-place t\)"
154 (interactive "P") 154 (interactive "P")
diff --git a/lisp/shell.el b/lisp/shell.el
index b98efceefbf..77a42389785 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -46,7 +46,7 @@
46 46
47;; YOUR .EMACS FILE 47;; YOUR .EMACS FILE
48;;============================================================================= 48;;=============================================================================
49;; Some suggestions for your .emacs file. 49;; Some suggestions for your init file.
50;; 50;;
51;; ;; Define M-# to run some strange command: 51;; ;; Define M-# to run some strange command:
52;; (eval-after-load "shell" 52;; (eval-after-load "shell"
@@ -136,9 +136,7 @@ how Shell mode treats paragraphs.
136 136
137The pattern should probably not match more than one line. If it does, 137The pattern should probably not match more than one line. If it does,
138Shell mode may become confused trying to distinguish prompt from input 138Shell mode may become confused trying to distinguish prompt from input
139on lines which don't start with a prompt. 139on lines which don't start with a prompt."
140
141This is a fine thing to set in your `.emacs' file."
142 :type 'regexp 140 :type 'regexp
143 :group 'shell) 141 :group 'shell)
144 142
@@ -146,9 +144,7 @@ This is a fine thing to set in your `.emacs' file."
146 "List of suffixes to be disregarded during file/command completion. 144 "List of suffixes to be disregarded during file/command completion.
147This variable is used to initialize `comint-completion-fignore' in the shell 145This variable is used to initialize `comint-completion-fignore' in the shell
148buffer. The default is nil, for compatibility with most shells. 146buffer. The default is nil, for compatibility with most shells.
149Some people like (\"~\" \"#\" \"%\"). 147Some people like (\"~\" \"#\" \"%\")."
150
151This is a fine thing to set in your `.emacs' file."
152 :type '(repeat (string :tag "Suffix")) 148 :type '(repeat (string :tag "Suffix"))
153 :group 'shell) 149 :group 'shell)
154 150
@@ -158,31 +154,29 @@ This variable is used to initialize `comint-delimiter-argument-list' in the
158shell buffer. The value may depend on the operating system or shell." 154shell buffer. The value may depend on the operating system or shell."
159 :type '(choice (const nil) 155 :type '(choice (const nil)
160 (repeat :tag "List of characters" character)) 156 (repeat :tag "List of characters" character))
161 ;; Reverted.
162;; :version "24.1" ; changed to nil (bug#8027)
163 :group 'shell) 157 :group 'shell)
164 158
165(defvar shell-file-name-chars 159(defcustom shell-file-name-chars
166 (if (memq system-type '(ms-dos windows-nt cygwin)) 160 (if (memq system-type '(ms-dos windows-nt cygwin))
167 "~/A-Za-z0-9_^$!#%&{}@`'.,:()-" 161 "~/A-Za-z0-9_^$!#%&{}@`'.,:()-"
168 "[]~/A-Za-z0-9+@:_.$#%,={}-") 162 "[]~/A-Za-z0-9+@:_.$#%,={}-")
169 "String of characters valid in a file name. 163 "String of characters valid in a file name.
170This variable is used to initialize `comint-file-name-chars' in the 164This variable is used to initialize `comint-file-name-chars' in the
171shell buffer. The value may depend on the operating system or shell. 165shell buffer. The value may depend on the operating system or shell."
172 166 :type 'string
173This is a fine thing to set in your `.emacs' file.") 167 :group 'shell)
174 168
175(defvar shell-file-name-quote-list 169(defcustom shell-file-name-quote-list
176 (if (memq system-type '(ms-dos windows-nt)) 170 (if (memq system-type '(ms-dos windows-nt))
177 nil 171 nil
178 (append shell-delimiter-argument-list '(?\s ?$ ?\* ?\! ?\" ?\' ?\` ?\# ?\\))) 172 (append shell-delimiter-argument-list '(?\s ?$ ?\* ?\! ?\" ?\' ?\` ?\# ?\\)))
179 "List of characters to quote when in a file name. 173 "List of characters to quote when in a file name.
180This variable is used to initialize `comint-file-name-quote-list' in the 174This variable is used to initialize `comint-file-name-quote-list' in the
181shell buffer. The value may depend on the operating system or shell. 175shell buffer. The value may depend on the operating system or shell."
182 176 :type '(repeat character)
183This is a fine thing to set in your `.emacs' file.") 177 :group 'shell)
184 178
185(defvar shell-dynamic-complete-functions 179(defcustom shell-dynamic-complete-functions
186 '(comint-c-a-p-replace-by-expanded-history 180 '(comint-c-a-p-replace-by-expanded-history
187 shell-environment-variable-completion 181 shell-environment-variable-completion
188 shell-command-completion 182 shell-command-completion
@@ -192,9 +186,9 @@ This is a fine thing to set in your `.emacs' file.")
192 comint-filename-completion) 186 comint-filename-completion)
193 "List of functions called to perform completion. 187 "List of functions called to perform completion.
194This variable is used to initialize `comint-dynamic-complete-functions' in the 188This variable is used to initialize `comint-dynamic-complete-functions' in the
195shell buffer. 189shell buffer."
196 190 :type '(repeat function)
197This is a fine thing to set in your `.emacs' file.") 191 :group 'shell)
198 192
199(defcustom shell-command-regexp "[^;&|\n]+" 193(defcustom shell-command-regexp "[^;&|\n]+"
200 "Regexp to match a single command within a pipeline. 194 "Regexp to match a single command within a pipeline.
diff --git a/lisp/speedbar.el b/lisp/speedbar.el
index 90cdea63e85..25a6fbfd998 100644
--- a/lisp/speedbar.el
+++ b/lisp/speedbar.el
@@ -706,7 +706,7 @@ will be stripped by a simplified optimizer when compiled into a
706singular expression. This variable will be turned into 706singular expression. This variable will be turned into
707`speedbar-file-regexp' for use with speedbar. You should use the 707`speedbar-file-regexp' for use with speedbar. You should use the
708function `speedbar-add-supported-extension' to add a new extension at 708function `speedbar-add-supported-extension' to add a new extension at
709runtime, or use the configuration dialog to set it in your .emacs file. 709runtime, or use the configuration dialog to set it in your init file.
710If you add an extension to this list, and it does not appear, you may 710If you add an extension to this list, and it does not appear, you may
711need to also modify `completion-ignored-extension' which will also help 711need to also modify `completion-ignored-extension' which will also help
712file completion." 712file completion."
diff --git a/lisp/startup.el b/lisp/startup.el
index 348e653dd28..243c9621752 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -71,12 +71,13 @@ once you are familiar with the contents of the startup screen."
71 "Non-nil inhibits the initial startup echo area message. 71 "Non-nil inhibits the initial startup echo area message.
72Setting this variable takes effect 72Setting this variable takes effect
73only if you do it with the customization buffer 73only if you do it with the customization buffer
74or if your `.emacs' file contains a line of this form: 74or if your init file contains a line of this form:
75 (setq inhibit-startup-echo-area-message \"YOUR-USER-NAME\") 75 (setq inhibit-startup-echo-area-message \"YOUR-USER-NAME\")
76If your `.emacs' file is byte-compiled, use the following form instead: 76If your init file is byte-compiled, use the following form
77instead:
77 (eval '(setq inhibit-startup-echo-area-message \"YOUR-USER-NAME\")) 78 (eval '(setq inhibit-startup-echo-area-message \"YOUR-USER-NAME\"))
78Thus, someone else using a copy of your `.emacs' file will see 79Thus, someone else using a copy of your init file will see the
79the startup message unless he personally acts to inhibit it." 80startup message unless he personally acts to inhibit it."
80 :type '(choice (const :tag "Don't inhibit") 81 :type '(choice (const :tag "Don't inhibit")
81 (string :tag "Enter your user name, to inhibit")) 82 (string :tag "Enter your user name, to inhibit"))
82 :group 'initialization) 83 :group 'initialization)
@@ -215,8 +216,8 @@ and VALUE is the value which is given to that frame parameter
215 ("-fn" 1 x-handle-switch font) 216 ("-fn" 1 x-handle-switch font)
216 ("-font" 1 x-handle-switch font) 217 ("-font" 1 x-handle-switch font)
217 ("-ib" 1 x-handle-numeric-switch internal-border-width) 218 ("-ib" 1 x-handle-numeric-switch internal-border-width)
218 ;;("-g" . x-handle-geometry) 219 ("-g" 1 x-handle-geometry)
219 ;;("-geometry" . x-handle-geometry) 220 ("-geometry" 1 x-handle-geometry)
220 ("-fg" 1 x-handle-switch foreground-color) 221 ("-fg" 1 x-handle-switch foreground-color)
221 ("-foreground" 1 x-handle-switch foreground-color) 222 ("-foreground" 1 x-handle-switch foreground-color)
222 ("-bg" 1 x-handle-switch background-color) 223 ("-bg" 1 x-handle-switch background-color)
@@ -261,10 +262,14 @@ and VALUE is the value which is given to that frame parameter
261 "Normal hook run after handling urgent options but before loading init files.") 262 "Normal hook run after handling urgent options but before loading init files.")
262 263
263(defvar after-init-hook nil 264(defvar after-init-hook nil
264 "Normal hook run after loading the init files, `~/.emacs' and `default.el'. 265 "Normal hook run after initializing the Emacs session.
265There is no `condition-case' around the running of these functions; 266It is run after Emacs loads the init file, `default' library, the
266therefore, if you set `debug-on-error' non-nil in `.emacs', 267abbrevs file, and additional Lisp packages (if any), and setting
267an error in one of these functions will invoke the debugger.") 268the value of `after-init-time'.
269
270There is no `condition-case' around the running of this hook;
271therefore, if `debug-on-error' is non-nil, an error in one of
272these functions will invoke the debugger.")
268 273
269(defvar emacs-startup-hook nil 274(defvar emacs-startup-hook nil
270 "Normal hook run after loading init files and handling the command line.") 275 "Normal hook run after loading init files and handling the command line.")
@@ -296,7 +301,7 @@ the user's init file.")
296 :group 'initialization) 301 :group 'initialization)
297 302
298(defvar init-file-user nil 303(defvar init-file-user nil
299 "Identity of user whose `.emacs' file is or was read. 304 "Identity of user whose init file is or was read.
300The value is nil if `-q' or `--no-init-file' was specified, 305The value is nil if `-q' or `--no-init-file' was specified,
301meaning do not load any init file. 306meaning do not load any init file.
302 307
@@ -306,7 +311,7 @@ or it may be a string containing a user's name meaning
306use that person's init file. 311use that person's init file.
307 312
308In either of the latter cases, `(concat \"~\" init-file-user \"/\")' 313In either of the latter cases, `(concat \"~\" init-file-user \"/\")'
309evaluates to the name of the directory where the `.emacs' file was 314evaluates to the name of the directory where the init file was
310looked for. 315looked for.
311 316
312Setting `init-file-user' does not prevent Emacs from loading 317Setting `init-file-user' does not prevent Emacs from loading
@@ -365,7 +370,7 @@ init file is read, in case it sets `mail-host-address'."
365 (t 370 (t
366 (concat user-emacs-directory "auto-save-list/.saves-"))) 371 (concat user-emacs-directory "auto-save-list/.saves-")))
367 "Prefix for generating `auto-save-list-file-name'. 372 "Prefix for generating `auto-save-list-file-name'.
368This is used after reading your `.emacs' file to initialize 373This is used after reading your init file to initialize
369`auto-save-list-file-name', by appending Emacs's pid and the system name, 374`auto-save-list-file-name', by appending Emacs's pid and the system name,
370if you have not already set `auto-save-list-file-name' yourself. 375if you have not already set `auto-save-list-file-name' yourself.
371Directories in the prefix will be created if necessary. 376Directories in the prefix will be created if necessary.
diff --git a/lisp/strokes.el b/lisp/strokes.el
index dfd0e95f61a..62a8528f25d 100644
--- a/lisp/strokes.el
+++ b/lisp/strokes.el
@@ -933,14 +933,7 @@ and then safely save them for later use, send letters to friends
933extracting the strokes for editing use once again, so the editing 933extracting the strokes for editing use once again, so the editing
934cycle can continue. 934cycle can continue.
935 935
936Strokes are easy to program and fun to use. To start strokes going, 936To toggle strokes-mode, invoke the command
937you'll want to put the following line in your .emacs file as mentioned
938in the commentary to strokes.el.
939
940This will load strokes when and only when you start Emacs on a window
941system, with a mouse or other pointer device defined.
942
943To toggle strokes-mode, you just do
944 937
945> M-x strokes-mode 938> M-x strokes-mode
946 939
diff --git a/lisp/subr.el b/lisp/subr.el
index e9b85ff1f38..13516419b6f 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -280,7 +280,9 @@ Treated as a declaration when used at the right place in a
280 280
281(defmacro ignore-errors (&rest body) 281(defmacro ignore-errors (&rest body)
282 "Execute BODY; if an error occurs, return nil. 282 "Execute BODY; if an error occurs, return nil.
283Otherwise, return result of last form in BODY." 283Otherwise, return result of last form in BODY.
284See also `with-demoted-errors' that does something similar
285without silencing all errors."
284 (declare (debug t) (indent 0)) 286 (declare (debug t) (indent 0))
285 `(condition-case nil (progn ,@body) (error nil))) 287 `(condition-case nil (progn ,@body) (error nil)))
286 288
diff --git a/lisp/term/iris-ansi.el b/lisp/term/iris-ansi.el
index 9a9a31f4253..aea2e8c1092 100644
--- a/lisp/term/iris-ansi.el
+++ b/lisp/term/iris-ansi.el
@@ -322,7 +322,7 @@
322 "Terminal initialization function for iris-ansi." 322 "Terminal initialization function for iris-ansi."
323 ;; Use inheritance to let the main keymap override these defaults. 323 ;; Use inheritance to let the main keymap override these defaults.
324 ;; This way we don't override terminfo-derived settings or settings 324 ;; This way we don't override terminfo-derived settings or settings
325 ;; made in the .emacs file. 325 ;; made in the init file.
326 (let ((m (copy-keymap iris-function-map))) 326 (let ((m (copy-keymap iris-function-map)))
327 (set-keymap-parent m (keymap-parent input-decode-map)) 327 (set-keymap-parent m (keymap-parent input-decode-map))
328 (set-keymap-parent input-decode-map m))) 328 (set-keymap-parent input-decode-map m)))
diff --git a/lisp/term/lk201.el b/lisp/term/lk201.el
index 76a3a31cedc..6b9e1301003 100644
--- a/lisp/term/lk201.el
+++ b/lisp/term/lk201.el
@@ -75,7 +75,7 @@
75(defun terminal-init-lk201 () 75(defun terminal-init-lk201 ()
76 ;; Use inheritance to let the main keymap override these defaults. 76 ;; Use inheritance to let the main keymap override these defaults.
77 ;; This way we don't override terminfo-derived settings or settings 77 ;; This way we don't override terminfo-derived settings or settings
78 ;; made in the .emacs file. 78 ;; made in the init file.
79 (let ((m (copy-keymap lk201-function-map))) 79 (let ((m (copy-keymap lk201-function-map)))
80 (set-keymap-parent m (keymap-parent input-decode-map)) 80 (set-keymap-parent m (keymap-parent input-decode-map))
81 (set-keymap-parent input-decode-map m))) 81 (set-keymap-parent input-decode-map m)))
diff --git a/lisp/term/rxvt.el b/lisp/term/rxvt.el
index 481d6b498cf..98141563006 100644
--- a/lisp/term/rxvt.el
+++ b/lisp/term/rxvt.el
@@ -166,7 +166,7 @@
166 166
167 ;; Use inheritance to let the main keymap override those defaults. 167 ;; Use inheritance to let the main keymap override those defaults.
168 ;; This way we don't override terminfo-derived settings or settings 168 ;; This way we don't override terminfo-derived settings or settings
169 ;; made in the .emacs file. 169 ;; made in the init file.
170 (let ((m (copy-keymap rxvt-function-map))) 170 (let ((m (copy-keymap rxvt-function-map)))
171 (set-keymap-parent m (keymap-parent input-decode-map)) 171 (set-keymap-parent m (keymap-parent input-decode-map))
172 (set-keymap-parent input-decode-map m)) 172 (set-keymap-parent input-decode-map m))
diff --git a/lisp/term/tvi970.el b/lisp/term/tvi970.el
index b02d39c1e0f..f1b6eea8875 100644
--- a/lisp/term/tvi970.el
+++ b/lisp/term/tvi970.el
@@ -93,7 +93,7 @@
93 "Terminal initialization function for tvi970." 93 "Terminal initialization function for tvi970."
94 ;; Use inheritance to let the main keymap override these defaults. 94 ;; Use inheritance to let the main keymap override these defaults.
95 ;; This way we don't override terminfo-derived settings or settings 95 ;; This way we don't override terminfo-derived settings or settings
96 ;; made in the .emacs file. 96 ;; made in the init file.
97 (let ((m (copy-keymap tvi970-terminal-map))) 97 (let ((m (copy-keymap tvi970-terminal-map)))
98 (set-keymap-parent m (keymap-parent input-decode-map)) 98 (set-keymap-parent m (keymap-parent input-decode-map))
99 (set-keymap-parent input-decode-map m)) 99 (set-keymap-parent input-decode-map m))
diff --git a/lisp/term/wyse50.el b/lisp/term/wyse50.el
index d037962af19..ce148b62dba 100644
--- a/lisp/term/wyse50.el
+++ b/lisp/term/wyse50.el
@@ -109,7 +109,7 @@
109 "Terminal initialization function for wyse50." 109 "Terminal initialization function for wyse50."
110 ;; Use inheritance to let the main keymap override these defaults. 110 ;; Use inheritance to let the main keymap override these defaults.
111 ;; This way we don't override terminfo-derived settings or settings 111 ;; This way we don't override terminfo-derived settings or settings
112 ;; made in the .emacs file. 112 ;; made in the init file.
113 (let ((m (copy-keymap wyse50-terminal-map))) 113 (let ((m (copy-keymap wyse50-terminal-map)))
114 (set-keymap-parent m (keymap-parent input-decode-map)) 114 (set-keymap-parent m (keymap-parent input-decode-map))
115 (set-keymap-parent input-decode-map m)) 115 (set-keymap-parent input-decode-map m))
diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el
index 28fb9da0b9d..e4871658b98 100644
--- a/lisp/term/xterm.el
+++ b/lisp/term/xterm.el
@@ -480,7 +480,7 @@ The relevant features are:
480 480
481 ;; Use inheritance to let the main keymap override those defaults. 481 ;; Use inheritance to let the main keymap override those defaults.
482 ;; This way we don't override terminfo-derived settings or settings 482 ;; This way we don't override terminfo-derived settings or settings
483 ;; made in the .emacs file. 483 ;; made in the init file.
484 (set-keymap-parent map (keymap-parent input-decode-map)) 484 (set-keymap-parent map (keymap-parent input-decode-map))
485 (set-keymap-parent input-decode-map map))) 485 (set-keymap-parent input-decode-map map)))
486 486
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index a9320d945ef..42f0418b690 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -290,9 +290,9 @@ If this variable is nil, all regions are treated as small."
290;;* Mode specific options enable users to disable flyspell on */ 290;;* Mode specific options enable users to disable flyspell on */
291;;* certain word depending of the emacs mode. For instance, when */ 291;;* certain word depending of the emacs mode. For instance, when */
292;;* using flyspell with mail-mode add the following expression */ 292;;* using flyspell with mail-mode add the following expression */
293;;* in your .emacs file: */ 293;;* in your init file: */
294;;* (add-hook 'mail-mode */ 294;;* (add-hook 'mail-mode */
295;;* (lambda () (setq flyspell-generic-check-word-predicate */ 295;;* (lambda () (setq flyspell-generic-check-word-predicate */
296;;* 'mail-mode-flyspell-verify))) */ 296;;* 'mail-mode-flyspell-verify))) */
297;;*---------------------------------------------------------------------*/ 297;;*---------------------------------------------------------------------*/
298(defvar flyspell-generic-check-word-predicate nil 298(defvar flyspell-generic-check-word-predicate nil
@@ -488,7 +488,7 @@ invoking `ispell-change-dictionary'.
488Consider using the `ispell-parser' to check your text. For instance 488Consider using the `ispell-parser' to check your text. For instance
489consider adding: 489consider adding:
490\(add-hook 'tex-mode-hook (function (lambda () (setq ispell-parser 'tex)))) 490\(add-hook 'tex-mode-hook (function (lambda () (setq ispell-parser 'tex))))
491in your .emacs file. 491in your init file.
492 492
493\\[flyspell-region] checks all words inside a region. 493\\[flyspell-region] checks all words inside a region.
494\\[flyspell-buffer] checks the whole buffer." 494\\[flyspell-buffer] checks the whole buffer."
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 0c7966f22d3..51a4800de52 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -1127,7 +1127,8 @@ aspell is used along with Emacs).")
1127 1127
1128 ;; If Emacs flavor supports [:alpha:] use it for global dicts. If 1128 ;; If Emacs flavor supports [:alpha:] use it for global dicts. If
1129 ;; spellchecker also supports UTF-8 via command-line option use it 1129 ;; spellchecker also supports UTF-8 via command-line option use it
1130 ;; in communication. This does not affect definitions in ~/.emacs. 1130 ;; in communication. This does not affect definitions in your
1131 ;; init file.
1131 (if ispell-emacs-alpha-regexp 1132 (if ispell-emacs-alpha-regexp
1132 (let (tmp-dicts-alist) 1133 (let (tmp-dicts-alist)
1133 (dolist (adict ispell-dictionary-alist) 1134 (dolist (adict ispell-dictionary-alist)
@@ -3680,7 +3681,7 @@ use the `x' command. (Any subsequent regions will be checked.)
3680The `X' command aborts sending the message so that you can edit the buffer. 3681The `X' command aborts sending the message so that you can edit the buffer.
3681 3682
3682To spell-check whenever a message is sent, include the appropriate lines 3683To spell-check whenever a message is sent, include the appropriate lines
3683in your .emacs file: 3684in your init file:
3684 (add-hook 'message-send-hook 'ispell-message) ;; GNUS 5 3685 (add-hook 'message-send-hook 'ispell-message) ;; GNUS 5
3685 (add-hook 'news-inews-hook 'ispell-message) ;; GNUS 4 3686 (add-hook 'news-inews-hook 'ispell-message) ;; GNUS 4
3686 (add-hook 'mail-send-hook 'ispell-message) 3687 (add-hook 'mail-send-hook 'ispell-message)
diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el
index d8afb3e5544..8584c496a97 100644
--- a/lisp/textmodes/reftex.el
+++ b/lisp/textmodes/reftex.el
@@ -47,7 +47,7 @@
47;; To turn RefTeX Mode on and off in a buffer, use `M-x reftex-mode'. 47;; To turn RefTeX Mode on and off in a buffer, use `M-x reftex-mode'.
48;; 48;;
49;; To turn on RefTeX Mode for all LaTeX files, add the following lines 49;; To turn on RefTeX Mode for all LaTeX files, add the following lines
50;; to your .emacs file: 50;; to your init file:
51;; 51;;
52;; (add-hook 'LaTeX-mode-hook 'turn-on-reftex) ; AUCTeX LaTeX mode 52;; (add-hook 'LaTeX-mode-hook 'turn-on-reftex) ; AUCTeX LaTeX mode
53;; (add-hook 'latex-mode-hook 'turn-on-reftex) ; Emacs latex mode 53;; (add-hook 'latex-mode-hook 'turn-on-reftex) ; Emacs latex mode
@@ -99,7 +99,7 @@
99;; 99;;
100;; To turn RefTeX Mode on and off in a particular buffer, use `M-x 100;; To turn RefTeX Mode on and off in a particular buffer, use `M-x
101;; reftex-mode'. To turn on RefTeX Mode for all LaTeX files, add the 101;; reftex-mode'. To turn on RefTeX Mode for all LaTeX files, add the
102;; following lines to your `.emacs' file: 102;; following lines to your init file:
103;; 103;;
104;; (add-hook 'LaTeX-mode-hook 'turn-on-reftex) ; with AUCTeX LaTeX mode 104;; (add-hook 'LaTeX-mode-hook 'turn-on-reftex) ; with AUCTeX LaTeX mode
105;; (add-hook 'latex-mode-hook 'turn-on-reftex) ; with Emacs latex mode 105;; (add-hook 'latex-mode-hook 'turn-on-reftex) ; with Emacs latex mode
diff --git a/lisp/textmodes/rst.el b/lisp/textmodes/rst.el
index 767f8f360bb..56b0ee47e4a 100644
--- a/lisp/textmodes/rst.el
+++ b/lisp/textmodes/rst.el
@@ -81,7 +81,7 @@
81 81
82;;; INSTALLATION 82;;; INSTALLATION
83 83
84;; Add the following lines to your `.emacs' file: 84;; Add the following lines to your init file:
85;; 85;;
86;; (require 'rst) 86;; (require 'rst)
87;; 87;;
@@ -103,11 +103,54 @@
103 103
104;;; Code: 104;;; Code:
105 105
106;; FIXME: Check through major mode conventions again.
107
106;; FIXME: Add proper ";;;###autoload" comments. 108;; FIXME: Add proper ";;;###autoload" comments.
107 109
108;; FIXME: When 24.1 is common place remove use of `lexical-let' and put "-*- 110;; FIXME: When 24.1 is common place remove use of `lexical-let' and put "-*-
109;; lexical-binding: t -*-" in the first line. 111;; lexical-binding: t -*-" in the first line.
110 112
113;; FIXME: Use `testcover'.
114
115;; FIXME: The adornment classification often called `ado' should be a
116;; `defstruct'.
117
118;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
119;; Support for `testcover'
120
121(when (boundp 'testcover-1value-functions)
122 ;; Below `lambda' is used in a loop with varying parameters and is thus not
123 ;; 1valued.
124 (setq testcover-1value-functions
125 (delq 'lambda testcover-1value-functions))
126 (add-to-list 'testcover-compose-functions 'lambda))
127
128(defun rst-testcover-defcustom ()
129 "Remove all customized variables from `testcover-module-constants'.
130This seems to be a bug in `testcover': `defcustom' variables are
131considered constants. Revert it with this function after each `defcustom'."
132 (when (boundp 'testcover-module-constants)
133 (setq testcover-module-constants
134 (delq nil
135 (mapcar
136 (lambda (sym)
137 (if (not (plist-member (symbol-plist sym) 'standard-value))
138 sym))
139 testcover-module-constants)))))
140
141(defun rst-testcover-add-compose (fun)
142 "Add FUN to `testcover-compose-functions'."
143 (when (boundp 'testcover-compose-functions)
144 (add-to-list 'testcover-compose-functions fun)))
145
146(defun rst-testcover-add-1value (fun)
147 "Add FUN to `testcover-1value-functions'."
148 (when (boundp 'testcover-1value-functions)
149 (add-to-list 'testcover-1value-functions fun)))
150
151;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
152;; Common Lisp stuff
153
111;; Only use of macros is allowed - may be replaced by `cl-lib' some time. 154;; Only use of macros is allowed - may be replaced by `cl-lib' some time.
112(eval-when-compile 155(eval-when-compile
113 (require 'cl)) 156 (require 'cl))
@@ -160,6 +203,7 @@ Comparison done with `equal'."
160;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 203;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
161;; Versions 204;; Versions
162 205
206;; testcover: ok.
163(defun rst-extract-version (delim-re head-re re tail-re var &optional default) 207(defun rst-extract-version (delim-re head-re re tail-re var &optional default)
164 "Extract the version from a variable according to the given regexes. 208 "Extract the version from a variable according to the given regexes.
165Return the version after regex DELIM-RE and HEAD-RE matching RE 209Return the version after regex DELIM-RE and HEAD-RE matching RE
@@ -173,7 +217,7 @@ and before TAIL-RE and DELIM-RE in VAR or DEFAULT for no match."
173;; Use CVSHeader to really get information from CVS and not other version 217;; Use CVSHeader to really get information from CVS and not other version
174;; control systems. 218;; control systems.
175(defconst rst-cvs-header 219(defconst rst-cvs-header
176 "$CVSHeader: sm/rst_el/rst.el,v 1.301 2012-07-30 19:29:46 stefan Exp $") 220 "$CVSHeader: sm/rst_el/rst.el,v 1.324 2012-09-20 18:52:46 stefan Exp $")
177(defconst rst-cvs-rev 221(defconst rst-cvs-rev
178 (rst-extract-version "\\$" "CVSHeader: \\S + " "[0-9]+\\(?:\\.[0-9]+\\)+" 222 (rst-extract-version "\\$" "CVSHeader: \\S + " "[0-9]+\\(?:\\.[0-9]+\\)+"
179 " .*" rst-cvs-header "0.0") 223 " .*" rst-cvs-header "0.0")
@@ -483,6 +527,8 @@ argument list for `rst-re'.")
483(defvar rst-re-alist) ; Forward declare to use it in `rst-re'. 527(defvar rst-re-alist) ; Forward declare to use it in `rst-re'.
484 528
485;; FIXME: Use `sregex` or `rx` instead of re-inventing the wheel. 529;; FIXME: Use `sregex` or `rx` instead of re-inventing the wheel.
530(rst-testcover-add-compose 'rst-re)
531;; testcover: ok.
486(defun rst-re (&rest args) 532(defun rst-re (&rest args)
487 "Interpret ARGS as regular expressions and return a regex string. 533 "Interpret ARGS as regular expressions and return a regex string.
488Each element of ARGS may be one of the following: 534Each element of ARGS may be one of the following:
@@ -556,6 +602,7 @@ After interpretation of ARGS the results are concatenated as for
556;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 602;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
557;; Mode definition 603;; Mode definition
558 604
605;; testcover: ok.
559(defun rst-define-key (keymap key def &rest deprecated) 606(defun rst-define-key (keymap key def &rest deprecated)
560 "Bind like `define-key' but add deprecated key definitions. 607 "Bind like `define-key' but add deprecated key definitions.
561KEYMAP, KEY, and DEF are as in `define-key'. DEPRECATED key 608KEYMAP, KEY, and DEF are as in `define-key'. DEPRECATED key
@@ -734,6 +781,7 @@ This inherits from Text mode.")
734The hook for `text-mode' is run before this one." 781The hook for `text-mode' is run before this one."
735 :group 'rst 782 :group 'rst
736 :type '(hook)) 783 :type '(hook))
784(rst-testcover-defcustom)
737 785
738;; Pull in variable definitions silencing byte-compiler. 786;; Pull in variable definitions silencing byte-compiler.
739(require 'newcomment) 787(require 'newcomment)
@@ -799,6 +847,12 @@ highlighting.
799 (set (make-local-variable 'uncomment-region-function) 847 (set (make-local-variable 'uncomment-region-function)
800 'rst-uncomment-region) 848 'rst-uncomment-region)
801 849
850 ;; Imenu and which function.
851 ;; FIXME: Check documentation of `which-function' for alternative ways to
852 ;; determine the current function name.
853 (set (make-local-variable 'imenu-create-index-function)
854 'rst-imenu-create-index)
855
802 ;; Font lock. 856 ;; Font lock.
803 (set (make-local-variable 'font-lock-defaults) 857 (set (make-local-variable 'font-lock-defaults)
804 '(rst-font-lock-keywords 858 '(rst-font-lock-keywords
@@ -949,6 +1003,7 @@ file."
949 (const :tag "Underline only" simple)) 1003 (const :tag "Underline only" simple))
950 (integer :tag "Indentation for overline and underline type" 1004 (integer :tag "Indentation for overline and underline type"
951 :value 0)))) 1005 :value 0))))
1006(rst-testcover-defcustom)
952 1007
953(defcustom rst-default-indent 1 1008(defcustom rst-default-indent 1
954 "Number of characters to indent the section title. 1009 "Number of characters to indent the section title.
@@ -958,7 +1013,7 @@ from a simple adornment style to a over-and-under adornment
958style." 1013style."
959 :group 'rst-adjust 1014 :group 'rst-adjust
960 :type '(integer)) 1015 :type '(integer))
961 1016(rst-testcover-defcustom)
962 1017
963(defun rst-compare-adornments (ado1 ado2) 1018(defun rst-compare-adornments (ado1 ado2)
964 "Compare adornments. 1019 "Compare adornments.
@@ -979,7 +1034,8 @@ not found."
979 (setq cur (cdr cur))) 1034 (setq cur (cdr cur)))
980 cur)) 1035 cur))
981 1036
982 1037;; testcover: FIXME: Test with `rst-preferred-adornments' == nil. Add test
1038;; `rst-adjust-no-preference'.
983(defun rst-suggest-new-adornment (allados &optional prev) 1039(defun rst-suggest-new-adornment (allados &optional prev)
984 "Suggest a new, different adornment from all that have been seen. 1040 "Suggest a new, different adornment from all that have been seen.
985 1041
@@ -1032,7 +1088,7 @@ requested adornment."
1032 len) 1088 len)
1033 1089
1034 ;; Fixup whitespace at the beginning and end of the line. 1090 ;; Fixup whitespace at the beginning and end of the line.
1035 (if (or (null indent) (eq style 'simple)) 1091 (if (or (null indent) (eq style 'simple)) ;; testcover: ok.
1036 (setq indent 0)) 1092 (setq indent 0))
1037 (beginning-of-line) 1093 (beginning-of-line)
1038 (delete-horizontal-space) 1094 (delete-horizontal-space)
@@ -1046,7 +1102,8 @@ requested adornment."
1046 1102
1047 ;; Remove previous line if it is an adornment. 1103 ;; Remove previous line if it is an adornment.
1048 (save-excursion 1104 (save-excursion
1049 (forward-line -1) 1105 (forward-line -1) ;; testcover: FIXME: Doesn't work when in first line
1106 ;; of buffer.
1050 (if (and (looking-at (rst-re 'ado-beg-2-1)) 1107 (if (and (looking-at (rst-re 'ado-beg-2-1))
1051 ;; Avoid removing the underline of a title right above us. 1108 ;; Avoid removing the underline of a title right above us.
1052 (save-excursion (forward-line -1) 1109 (save-excursion (forward-line -1)
@@ -1055,7 +1112,8 @@ requested adornment."
1055 1112
1056 ;; Remove following line if it is an adornment. 1113 ;; Remove following line if it is an adornment.
1057 (save-excursion 1114 (save-excursion
1058 (forward-line +1) 1115 (forward-line +1) ;; testcover: FIXME: Doesn't work when in last line
1116 ;; of buffer.
1059 (if (looking-at (rst-re 'ado-beg-2-1)) 1117 (if (looking-at (rst-re 'ado-beg-2-1))
1060 (rst-delete-entire-line)) 1118 (rst-delete-entire-line))
1061 ;; Add a newline if we're at the end of the buffer, for the subsequence 1119 ;; Add a newline if we're at the end of the buffer, for the subsequence
@@ -1071,13 +1129,14 @@ requested adornment."
1071 (insert (make-string len char)))) 1129 (insert (make-string len char))))
1072 1130
1073 ;; Insert underline. 1131 ;; Insert underline.
1074 (forward-line +1) 1132 (1value ;; Line has been inserted above.
1133 (forward-line +1))
1075 (open-line 1) 1134 (open-line 1)
1076 (insert (make-string len char)) 1135 (insert (make-string len char))
1077 1136
1078 (forward-line +1) 1137 (1value ;; Line has been inserted above.
1079 (goto-char marker) 1138 (forward-line +1))
1080 )) 1139 (goto-char marker)))
1081 1140
1082(defun rst-classify-adornment (adornment end) 1141(defun rst-classify-adornment (adornment end)
1083 "Classify adornment for section titles and transitions. 1142 "Classify adornment for section titles and transitions.
@@ -1104,11 +1163,14 @@ Return nil if no syntactically valid adornment is found."
1104 (ado-re (rst-re ado-ch 'adorep3-hlp)) 1163 (ado-re (rst-re ado-ch 'adorep3-hlp))
1105 (end-pnt (point)) 1164 (end-pnt (point))
1106 (beg-pnt (progn 1165 (beg-pnt (progn
1107 (forward-line 0) 1166 (1value ;; No lines may be left to move.
1167 (forward-line 0))
1108 (point))) 1168 (point)))
1109 (nxt-emp ; Next line nonexistent or empty 1169 (nxt-emp ; Next line nonexistent or empty
1110 (save-excursion 1170 (save-excursion
1111 (or (not (zerop (forward-line 1))) 1171 (or (not (zerop (forward-line 1)))
1172 ;; testcover: FIXME: Add test classifying at the end of
1173 ;; buffer.
1112 (looking-at (rst-re 'lin-end))))) 1174 (looking-at (rst-re 'lin-end)))))
1113 (prv-emp ; Previous line nonexistent or empty 1175 (prv-emp ; Previous line nonexistent or empty
1114 (save-excursion 1176 (save-excursion
@@ -1117,7 +1179,9 @@ Return nil if no syntactically valid adornment is found."
1117 (ttl-blw ; Title found below starting here. 1179 (ttl-blw ; Title found below starting here.
1118 (save-excursion 1180 (save-excursion
1119 (and 1181 (and
1120 (zerop (forward-line 1)) 1182 (zerop (forward-line 1)) ;; testcover: FIXME: Add test
1183 ;; classifying at the end of
1184 ;; buffer.
1121 (looking-at (rst-re 'ttl-beg)) 1185 (looking-at (rst-re 'ttl-beg))
1122 (point)))) 1186 (point))))
1123 (ttl-abv ; Title found above starting here. 1187 (ttl-abv ; Title found above starting here.
@@ -1129,7 +1193,9 @@ Return nil if no syntactically valid adornment is found."
1129 (und-fnd ; Matching underline found starting here. 1193 (und-fnd ; Matching underline found starting here.
1130 (save-excursion 1194 (save-excursion
1131 (and ttl-blw 1195 (and ttl-blw
1132 (zerop (forward-line 2)) 1196 (zerop (forward-line 2)) ;; testcover: FIXME: Add test
1197 ;; classifying at the end of
1198 ;; buffer.
1133 (looking-at (rst-re ado-re 'lin-end)) 1199 (looking-at (rst-re ado-re 'lin-end))
1134 (point)))) 1200 (point))))
1135 (ovr-fnd ; Matching overline found starting here. 1201 (ovr-fnd ; Matching overline found starting here.
@@ -1174,8 +1240,8 @@ Return nil if no syntactically valid adornment is found."
1174 (setq key nil))) 1240 (setq key nil)))
1175 (if key 1241 (if key
1176 (list key 1242 (list key
1177 (or beg-ovr beg-txt beg-und) 1243 (or beg-ovr beg-txt)
1178 (or end-und end-txt end-ovr) 1244 (or end-und end-txt)
1179 beg-ovr end-ovr beg-txt end-txt beg-und end-und))))))) 1245 beg-ovr end-ovr beg-txt end-txt beg-und end-und)))))))
1180 1246
1181(defun rst-find-title-line () 1247(defun rst-find-title-line ()
@@ -1193,7 +1259,8 @@ in the first element. If there is no adornment around the title
1193CHARACTER is also nil and match groups for overline and underline 1259CHARACTER is also nil and match groups for overline and underline
1194are nil." 1260are nil."
1195 (save-excursion 1261 (save-excursion
1196 (forward-line 0) 1262 (1value ;; No lines may be left to move.
1263 (forward-line 0))
1197 (let ((orig-pnt (point)) 1264 (let ((orig-pnt (point))
1198 (orig-end (line-end-position))) 1265 (orig-end (line-end-position)))
1199 (cond 1266 (cond
@@ -1253,6 +1320,7 @@ t when no section adornments were found. Value depends on
1253`rst-all-sections'.") 1320`rst-all-sections'.")
1254(make-variable-buffer-local 'rst-section-hierarchy) 1321(make-variable-buffer-local 'rst-section-hierarchy)
1255 1322
1323(rst-testcover-add-1value 'rst-reset-section-caches)
1256(defun rst-reset-section-caches () 1324(defun rst-reset-section-caches ()
1257 "Reset all section cache variables. 1325 "Reset all section cache variables.
1258Should be called by interactive functions which deal with sections." 1326Should be called by interactive functions which deal with sections."
@@ -1354,9 +1422,7 @@ Return a list of the previous and next adornments."
1354 (if (and cur (caar cur)) 1422 (if (and cur (caar cur))
1355 (setq next (if (= curline (caar cur)) (cdr cur) cur))) 1423 (setq next (if (= curline (caar cur)) (cdr cur) cur)))
1356 1424
1357 (mapcar 'cdar (list prev next)) 1425 (mapcar 'cdar (list prev next))))
1358 ))
1359
1360 1426
1361(defun rst-adornment-complete-p (ado) 1427(defun rst-adornment-complete-p (ado)
1362 "Return true if the adornment ADO around point is complete." 1428 "Return true if the adornment ADO around point is complete."
@@ -1369,8 +1435,7 @@ Return a list of the previous and next adornments."
1369 (let* ((char (car ado)) 1435 (let* ((char (car ado))
1370 (style (cadr ado)) 1436 (style (cadr ado))
1371 (indent (caddr ado)) 1437 (indent (caddr ado))
1372 (endcol (save-excursion (end-of-line) (current-column))) 1438 (endcol (save-excursion (end-of-line) (current-column))))
1373 )
1374 (if char 1439 (if char
1375 (let ((exps (rst-re "^" char (format "\\{%d\\}" (+ endcol indent)) "$"))) 1440 (let ((exps (rst-re "^" char (format "\\{%d\\}" (+ endcol indent)) "$")))
1376 (and 1441 (and
@@ -1380,9 +1445,7 @@ Return a list of the previous and next adornments."
1380 (or (not (eq style 'over-and-under)) 1445 (or (not (eq style 'over-and-under))
1381 (save-excursion (forward-line -1) 1446 (save-excursion (forward-line -1)
1382 (beginning-of-line) 1447 (beginning-of-line)
1383 (looking-at exps)))) 1448 (looking-at exps))))))))
1384 ))
1385 ))
1386 1449
1387 1450
1388(defun rst-get-next-adornment 1451(defun rst-get-next-adornment
@@ -1414,8 +1477,7 @@ REVERSE-DIRECTION is used to reverse the cycling order."
1414 cur)) 1477 cur))
1415 1478
1416 ;; If not found, take the first of all adornments. 1479 ;; If not found, take the first of all adornments.
1417 suggestion 1480 suggestion)))
1418 )))
1419 1481
1420 1482
1421;; FIXME: A line "``/`` full" is not accepted as a section title. 1483;; FIXME: A line "``/`` full" is not accepted as a section title.
@@ -1456,7 +1518,7 @@ b. a negative numerical argument, which generally inverts the
1456 (reverse-direction (and pfxarg (< (prefix-numeric-value pfxarg) 0))) 1518 (reverse-direction (and pfxarg (< (prefix-numeric-value pfxarg) 0)))
1457 (toggle-style (and pfxarg (not reverse-direction)))) 1519 (toggle-style (and pfxarg (not reverse-direction))))
1458 1520
1459 (if (rst-portable-mark-active-p) 1521 (if (use-region-p)
1460 ;; Adjust adornments within region. 1522 ;; Adjust adornments within region.
1461 (rst-promote-region (and pfxarg t)) 1523 (rst-promote-region (and pfxarg t))
1462 ;; Adjust adornment around point. 1524 ;; Adjust adornment around point.
@@ -1466,15 +1528,14 @@ b. a negative numerical argument, which generally inverts the
1466 (run-hooks 'rst-adjust-hook) 1528 (run-hooks 'rst-adjust-hook)
1467 1529
1468 ;; Make sure to reset the cursor position properly after we're done. 1530 ;; Make sure to reset the cursor position properly after we're done.
1469 (goto-char origpt) 1531 (goto-char origpt)))
1470
1471 ))
1472 1532
1473(defcustom rst-adjust-hook nil 1533(defcustom rst-adjust-hook nil
1474 "Hooks to be run after running `rst-adjust'." 1534 "Hooks to be run after running `rst-adjust'."
1475 :group 'rst-adjust 1535 :group 'rst-adjust
1476 :type '(hook) 1536 :type '(hook)
1477 :package-version '(rst . "1.1.0")) 1537 :package-version '(rst . "1.1.0"))
1538(rst-testcover-defcustom)
1478 1539
1479(defcustom rst-new-adornment-down nil 1540(defcustom rst-new-adornment-down nil
1480 "Controls level of new adornment for section headers." 1541 "Controls level of new adornment for section headers."
@@ -1483,6 +1544,7 @@ b. a negative numerical argument, which generally inverts the
1483 (const :tag "Same level as previous one" nil) 1544 (const :tag "Same level as previous one" nil)
1484 (const :tag "One level down relative to the previous one" t)) 1545 (const :tag "One level down relative to the previous one" t))
1485 :package-version '(rst . "1.1.0")) 1546 :package-version '(rst . "1.1.0"))
1547(rst-testcover-defcustom)
1486 1548
1487(defun rst-adjust-adornment (pfxarg) 1549(defun rst-adjust-adornment (pfxarg)
1488 "Call `rst-adjust-adornment-work' interactively. 1550 "Call `rst-adjust-adornment-work' interactively.
@@ -1741,8 +1803,7 @@ hierarchy is similar to that used by `rst-adjust-adornment-work'."
1741 (region-begin-line (line-number-at-pos (region-beginning))) 1803 (region-begin-line (line-number-at-pos (region-beginning)))
1742 (region-end-line (line-number-at-pos (region-end))) 1804 (region-end-line (line-number-at-pos (region-end)))
1743 1805
1744 marker-list 1806 marker-list)
1745 )
1746 1807
1747 ;; Skip the markers that come before the region beginning. 1808 ;; Skip the markers that come before the region beginning.
1748 (while (and cur (< (caar cur) region-begin-line)) 1809 (while (and cur (< (caar cur) region-begin-line))
@@ -1771,8 +1832,7 @@ hierarchy is similar to that used by `rst-adjust-adornment-work'."
1771 1832
1772 ;; Clear marker to avoid slowing down the editing after we're done. 1833 ;; Clear marker to avoid slowing down the editing after we're done.
1773 (set-marker (car p) nil)) 1834 (set-marker (car p) nil))
1774 (setq deactivate-mark nil) 1835 (setq deactivate-mark nil))))
1775 )))
1776 1836
1777 1837
1778 1838
@@ -1792,9 +1852,7 @@ in ADORNMENTS."
1792 (apply 'rst-update-section x) 1852 (apply 'rst-update-section x)
1793 (goto-char (point-max)) 1853 (goto-char (point-max))
1794 (insert "\n") 1854 (insert "\n")
1795 (incf level) 1855 (incf level))))))
1796 ))
1797 )))
1798 1856
1799(defun rst-straighten-adornments () 1857(defun rst-straighten-adornments ()
1800 "Redo all the adornments in the current buffer. 1858 "Redo all the adornments in the current buffer.
@@ -1822,10 +1880,7 @@ in order to adapt it to our preferred style."
1822 (apply 'rst-update-section (nth (car lm) rst-preferred-adornments)) 1880 (apply 'rst-update-section (nth (car lm) rst-preferred-adornments))
1823 1881
1824 ;; Reset the marker to avoid slowing down editing until it gets GC'ed. 1882 ;; Reset the marker to avoid slowing down editing until it gets GC'ed.
1825 (set-marker (cdr lm) nil) 1883 (set-marker (cdr lm) nil)))))
1826 )
1827 )))
1828
1829 1884
1830 1885
1831;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1886;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -1906,7 +1961,7 @@ and the column of the point."
1906 (looking-at pfx-re)))))) ; ...pfx at same level. 1961 (looking-at pfx-re)))))) ; ...pfx at same level.
1907 (push (cons (point) (current-column)) 1962 (push (cons (point) (current-column))
1908 pfx)) 1963 pfx))
1909 (forward-line 1)) ) 1964 (forward-line 1)))
1910 (nreverse pfx))) 1965 (nreverse pfx)))
1911 1966
1912(defun rst-insert-list-pos (newitem) 1967(defun rst-insert-list-pos (newitem)
@@ -2005,6 +2060,7 @@ starting item, for example 'e' for 'A)' style. The position is also arranged by
2005 :tag (char-to-string char) char)) 2060 :tag (char-to-string char) char))
2006 rst-bullets))) 2061 rst-bullets)))
2007 :package-version '(rst . "1.1.0")) 2062 :package-version '(rst . "1.1.0"))
2063(rst-testcover-defcustom)
2008 2064
2009(defun rst-insert-list-continue (curitem prefer-roman) 2065(defun rst-insert-list-continue (curitem prefer-roman)
2010 "Insert a list item with list start CURITEM including its indentation level. 2066 "Insert a list item with list start CURITEM including its indentation level.
@@ -2123,130 +2179,112 @@ adjust. If bullets are found on levels beyond the
2123;; Table of contents 2179;; Table of contents
2124;; ================= 2180;; =================
2125 2181
2126(defun rst-get-stripped-line () 2182;; FIXME: Return value should be a `defstruct'.
2127 "Return the line at cursor, stripped from whitespace."
2128 (re-search-forward (rst-re "\\S .*\\S ") (line-end-position))
2129 (buffer-substring-no-properties (match-beginning 0)
2130 (match-end 0)) )
2131
2132(defun rst-section-tree () 2183(defun rst-section-tree ()
2133 "Get the hierarchical tree of section titles. 2184 "Return the hierarchical tree of section titles.
2134 2185A tree entry looks like ((TITLE MARKER) CHILD...). TITLE is the
2135Returns a hierarchical tree of the sections titles in the 2186stripped text of the section title. MARKER is a marker for the
2136document. This can be used to generate a table of contents for 2187beginning of the title text. For the top node or a missing
2137the document. The top node will always be a nil node, with the 2188section level node TITLE is nil and MARKER points to the title
2138top level titles as children (there may potentially be more than 2189text of the first child. Each CHILD is another tree entry. The
2139one). 2190CHILD list may be empty."
2140
2141Each section title consists in a cons of the stripped title
2142string and a marker to the section in the original text document.
2143
2144If there are missing section levels, the section titles are
2145inserted automatically, and the title string is set to nil, and
2146the marker set to the first non-nil child of itself.
2147Conceptually, the nil nodes--i.e.\ those which have no title--are
2148to be considered as being the same line as their first non-nil
2149child. This has advantages later in processing the graph."
2150
2151 (let ((hier (rst-get-hierarchy)) 2191 (let ((hier (rst-get-hierarchy))
2152 (levels (make-hash-table :test 'equal :size 10)) 2192 (ch-sty2level (make-hash-table :test 'equal :size 10))
2153 lines) 2193 lev-ttl-mrk-l)
2154 2194
2155 (let ((lev 0)) 2195 (let ((lev 0))
2156 (dolist (ado hier) 2196 (dolist (ado hier)
2157 ;; Compare just the character and indent in the hash table. 2197 ;; Compare just the character and indent in the hash table.
2158 (puthash (cons (car ado) (cadr ado)) lev levels) 2198 (puthash (cons (car ado) (cadr ado)) lev ch-sty2level)
2159 (incf lev))) 2199 (incf lev)))
2160 2200
2161 ;; Create a list of lines that contains (text, level, marker) for each 2201 ;; Create a list that contains (LEVEL TITLE MARKER) for each adornment.
2162 ;; adornment.
2163 (save-excursion 2202 (save-excursion
2164 (setq lines 2203 (setq lev-ttl-mrk-l
2165 (mapcar (lambda (ado) 2204 (mapcar (lambda (ado)
2166 (goto-char (point-min)) 2205 (goto-char (point-min))
2167 (forward-line (1- (car ado))) 2206 (1value ;; This should really succeed.
2168 (list (gethash (cons (cadr ado) (caddr ado)) levels) 2207 (forward-line (1- (car ado))))
2169 (rst-get-stripped-line) 2208 (list (gethash (cons (cadr ado) (caddr ado)) ch-sty2level)
2170 (progn 2209 ;; Get title.
2171 (beginning-of-line 1) 2210 (save-excursion
2172 (point-marker)))) 2211 (if (re-search-forward
2212 (rst-re "\\S .*\\S ") (line-end-position) t)
2213 (buffer-substring-no-properties
2214 (match-beginning 0) (match-end 0))
2215 ""))
2216 (point-marker)))
2173 (rst-find-all-adornments)))) 2217 (rst-find-all-adornments))))
2174 (let ((lcontnr (cons nil lines))) 2218 (cdr (rst-section-tree-rec lev-ttl-mrk-l -1))))
2175 (rst-section-tree-rec lcontnr -1)))) 2219
2176 2220;; FIXME: Return value should be a `defstruct'.
2177 2221(defun rst-section-tree-rec (remaining lev)
2178(defun rst-section-tree-rec (ados lev) 2222 "Process the first entry of REMAINING expected to be on level LEV.
2179 "Recursive guts of the section tree construction. 2223REMAINING is the remaining list of adornments consisting
2180ADOS is a cons cell whose cdr is the remaining list of 2224of (LEVEL TITLE MARKER) entries.
2181adornments, and we change it as we consume them. LEV is 2225
2182the current level of that node. This function returns a 2226Return (UNPROCESSED (TITLE MARKER) CHILD...) for the first entry
2183pair of the subtree that was built. This treats the ADOS 2227of REMAINING where TITLE is nil if the expected level is not
2184list destructively." 2228matched. UNPROCESSED is the list of still unprocessed entries.
2185 2229Each CHILD is a child of this entry in the same format but
2186 (let ((nado (cadr ados)) 2230without UNPROCESSED."
2187 node 2231 (let ((cur (car remaining))
2188 children) 2232 (unprocessed remaining)
2189 2233 ttl-mrk children)
2190 ;; If the next adornment matches our level. 2234 ;; If the current adornment matches expected level.
2191 (when (and nado (= (car nado) lev)) 2235 (when (and cur (= (car cur) lev))
2192 ;; Pop the next adornment and create the current node with it. 2236 ;; Consume the current entry and create the current node with it.
2193 (setcdr ados (cddr ados)) 2237 (setq unprocessed (cdr remaining))
2194 (setq node (cdr nado)) ) 2238 (setq ttl-mrk (cdr cur)))
2195 ;; Else we let the node title/marker be unset. 2239
2196 2240 ;; Build the child nodes as long as they have deeper level.
2197 ;; Build the child nodes. 2241 (while (and unprocessed (> (caar unprocessed) lev))
2198 (while (and (cdr ados) (> (caadr ados) lev)) 2242 (let ((rem-children (rst-section-tree-rec unprocessed (1+ lev))))
2199 (setq children 2243 (setq children (cons (cdr rem-children) children))
2200 (cons (rst-section-tree-rec ados (1+ lev)) 2244 (setq unprocessed (car rem-children))))
2201 children)))
2202 (setq children (reverse children)) 2245 (setq children (reverse children))
2203 2246
2204 ;; If node is still unset, we use the marker of the first child. 2247 (cons unprocessed
2205 (when (eq node nil) 2248 (cons (or ttl-mrk
2206 (setq node (cons nil (cdaar children)))) 2249 ;; Node on this level missing - use nil as text and the
2207 2250 ;; marker of the first child.
2208 ;; Return this node with its children. 2251 (cons nil (cdaar children)))
2209 (cons node children) 2252 children))))
2210 )) 2253
2211 2254(defun rst-section-tree-point (tree &optional point)
2212 2255 "Return section containing POINT by returning the closest node in TREE.
2213(defun rst-section-tree-point (node &optional point) 2256TREE is a section tree as returned by `rst-section-tree'
2214 "Find tree node at point. 2257consisting of (NODE CHILD...) entries. POINT defaults to the
2215Given a computed and valid section tree in NODE and a point 2258current point. A NODE must have the structure (IGNORED MARKER
2216POINT (default being the current point in the current buffer), 2259...).
2217find and return the node within the section tree where the cursor 2260
2218lives. 2261Return (PATH NODE CHILD...). NODE is the node where POINT is in
2219 2262if any. PATH is a list of nodes from the top of the tree down to
2220Return values: a pair of (parent path, container subtree). 2263and including NODE. List of CHILD are the children of NODE if
2221The parent path is simply a list of the nodes above the 2264any."
2222container subtree node that we're returning." 2265 (setq point (or point (point)))
2223 2266 (let ((cur (car tree))
2224 (let (path outtree) 2267 (children (cdr tree)))
2225 2268 ;; Point behind current node?
2226 (let* ((curpoint (or point (point)))) 2269 (if (and (cadr cur) (>= point (cadr cur)))
2227 2270 ;; Iterate all the children, looking for one that might contain the
2228 ;; Check if we are before the current node. 2271 ;; current section.
2229 (if (and (cadar node) (>= curpoint (cadar node))) 2272 (let (found)
2230 2273 (while (and children (>= point (cadaar children)))
2231 ;; Iterate all the children, looking for one that might contain the 2274 (setq found children
2232 ;; current section. 2275 children (cdr children)))
2233 (let ((curnode (cdr node)) 2276 (if found
2234 last) 2277 ;; Found section containing point in children.
2235 2278 (let ((sub (rst-section-tree-point (car found) point)))
2236 (while (and curnode (>= curpoint (cadaar curnode))) 2279 ;; Extend path with current node and return NODE CHILD... from
2237 (setq last curnode 2280 ;; sub.
2238 curnode (cdr curnode))) 2281 (cons (cons cur (car sub)) (cdr sub)))
2239 2282 ;; Point in this section: Start a new path with current node and
2240 (if last 2283 ;; return current NODE CHILD...
2241 (let ((sub (rst-section-tree-point (car last) curpoint))) 2284 (cons (list cur) tree)))
2242 (setq path (car sub) 2285 ;; Current node behind point: start a new path with current node and
2243 outtree (cdr sub))) 2286 ;; no NODE CHILD...
2244 (setq outtree node)) 2287 (list (list cur)))))
2245
2246 )))
2247 (cons (cons (car node) path) outtree)
2248 ))
2249
2250 2288
2251(defgroup rst-toc nil 2289(defgroup rst-toc nil
2252 "Settings for reStructuredText table of contents." 2290 "Settings for reStructuredText table of contents."
@@ -2257,6 +2295,7 @@ container subtree node that we're returning."
2257 "Indentation for table-of-contents display. 2295 "Indentation for table-of-contents display.
2258Also used for formatting insertion, when numbering is disabled." 2296Also used for formatting insertion, when numbering is disabled."
2259 :group 'rst-toc) 2297 :group 'rst-toc)
2298(rst-testcover-defcustom)
2260 2299
2261(defcustom rst-toc-insert-style 'fixed 2300(defcustom rst-toc-insert-style 'fixed
2262 "Insertion style for table-of-contents. 2301 "Insertion style for table-of-contents.
@@ -2267,10 +2306,12 @@ indentation style:
2267- aligned: numbering, titles aligned under each other 2306- aligned: numbering, titles aligned under each other
2268- listed: numbering, with dashes like list items (EXPERIMENTAL)" 2307- listed: numbering, with dashes like list items (EXPERIMENTAL)"
2269 :group 'rst-toc) 2308 :group 'rst-toc)
2309(rst-testcover-defcustom)
2270 2310
2271(defcustom rst-toc-insert-number-separator " " 2311(defcustom rst-toc-insert-number-separator " "
2272 "Separator that goes between the TOC number and the title." 2312 "Separator that goes between the TOC number and the title."
2273 :group 'rst-toc) 2313 :group 'rst-toc)
2314(rst-testcover-defcustom)
2274 2315
2275;; This is used to avoid having to change the user's mode. 2316;; This is used to avoid having to change the user's mode.
2276(defvar rst-toc-insert-click-keymap 2317(defvar rst-toc-insert-click-keymap
@@ -2282,7 +2323,7 @@ indentation style:
2282(defcustom rst-toc-insert-max-level nil 2323(defcustom rst-toc-insert-max-level nil
2283 "If non-nil, maximum depth of the inserted TOC." 2324 "If non-nil, maximum depth of the inserted TOC."
2284 :group 'rst-toc) 2325 :group 'rst-toc)
2285 2326(rst-testcover-defcustom)
2286 2327
2287(defun rst-toc-insert (&optional pfxarg) 2328(defun rst-toc-insert (&optional pfxarg)
2288 "Insert a simple text rendering of the table of contents. 2329 "Insert a simple text rendering of the table of contents.
@@ -2316,8 +2357,7 @@ The TOC is inserted indented at the current column."
2316 (delete-region init-point (+ init-point (length initial-indent))) 2357 (delete-region init-point (+ init-point (length initial-indent)))
2317 2358
2318 ;; Delete the last newline added. 2359 ;; Delete the last newline added.
2319 (delete-char -1) 2360 (delete-char -1))))
2320 )))
2321 2361
2322(defun rst-toc-insert-node (node level indent pfx) 2362(defun rst-toc-insert-node (node level indent pfx)
2323 "Insert tree node NODE in table-of-contents. 2363 "Insert tree node NODE in table-of-contents.
@@ -2343,9 +2383,7 @@ level to align."
2343 ;; is generated automatically. 2383 ;; is generated automatically.
2344 (put-text-property b (point) 'mouse-face 'highlight) 2384 (put-text-property b (point) 'mouse-face 'highlight)
2345 (put-text-property b (point) 'rst-toc-target (cadar node)) 2385 (put-text-property b (point) 'rst-toc-target (cadar node))
2346 (put-text-property b (point) 'keymap rst-toc-insert-click-keymap) 2386 (put-text-property b (point) 'keymap rst-toc-insert-click-keymap))
2347
2348 )
2349 (insert "\n") 2387 (insert "\n")
2350 2388
2351 ;; Prepare indent for children. 2389 ;; Prepare indent for children.
@@ -2362,9 +2400,7 @@ level to align."
2362 2400
2363 ((eq rst-toc-insert-style 'listed) 2401 ((eq rst-toc-insert-style 'listed)
2364 (concat (substring indent 0 -3) 2402 (concat (substring indent 0 -3)
2365 (concat (make-string (+ (length pfx) 2) ? ) " - "))) 2403 (concat (make-string (+ (length pfx) 2) ? ) " - "))))))
2366 ))
2367 )
2368 2404
2369 (if (or (eq rst-toc-insert-max-level nil) 2405 (if (or (eq rst-toc-insert-max-level nil)
2370 (< level rst-toc-insert-max-level)) 2406 (< level rst-toc-insert-max-level))
@@ -2382,8 +2418,7 @@ level to align."
2382 (if (cdr node) 2418 (if (cdr node)
2383 (setq fmt (format "%%-%dd" 2419 (setq fmt (format "%%-%dd"
2384 (1+ (floor (log10 (length 2420 (1+ (floor (log10 (length
2385 (cdr node)))))))) 2421 (cdr node))))))))))
2386 ))
2387 2422
2388 (dolist (child (cdr node)) 2423 (dolist (child (cdr node))
2389 (rst-toc-insert-node child 2424 (rst-toc-insert-node child
@@ -2391,9 +2426,7 @@ level to align."
2391 indent 2426 indent
2392 (if do-child-numbering 2427 (if do-child-numbering
2393 (concat pfx (format fmt count)) pfx)) 2428 (concat pfx (format fmt count)) pfx))
2394 (incf count))) 2429 (incf count))))))
2395
2396 )))
2397 2430
2398 2431
2399(defun rst-toc-update () 2432(defun rst-toc-update ()
@@ -2468,8 +2501,7 @@ file-write hook to always make it up-to-date automatically."
2468 ;; Add link on lines. 2501 ;; Add link on lines.
2469 (put-text-property b (point) 'rst-toc-target (cadar node)) 2502 (put-text-property b (point) 'rst-toc-target (cadar node))
2470 2503
2471 (insert "\n") 2504 (insert "\n")))
2472 ))
2473 2505
2474 (dolist (child (cdr node)) 2506 (dolist (child (cdr node))
2475 (rst-toc-node child (1+ level)))) 2507 (rst-toc-node child (1+ level))))
@@ -2517,8 +2549,7 @@ brings the cursor in that section."
2517 line 2549 line
2518 2550
2519 ;; Create a temporary buffer. 2551 ;; Create a temporary buffer.
2520 (buf (get-buffer-create rst-toc-buffer-name)) 2552 (buf (get-buffer-create rst-toc-buffer-name)))
2521 )
2522 2553
2523 (with-current-buffer buf 2554 (with-current-buffer buf
2524 (let ((inhibit-read-only t)) 2555 (let ((inhibit-read-only t))
@@ -2531,8 +2562,7 @@ brings the cursor in that section."
2531 2562
2532 ;; Count the lines to our found node. 2563 ;; Count the lines to our found node.
2533 (let ((linefound (rst-toc-count-lines sectree our-node))) 2564 (let ((linefound (rst-toc-count-lines sectree our-node)))
2534 (setq line (if (cdr linefound) (car linefound) 0))) 2565 (setq line (if (cdr linefound) (car linefound) 0)))))
2535 ))
2536 (display-buffer buf) 2566 (display-buffer buf)
2537 (pop-to-buffer buf) 2567 (pop-to-buffer buf)
2538 2568
@@ -2541,8 +2571,7 @@ brings the cursor in that section."
2541 2571
2542 ;; Move the cursor near the right section in the TOC. 2572 ;; Move the cursor near the right section in the TOC.
2543 (goto-char (point-min)) 2573 (goto-char (point-min))
2544 (forward-line (1- line)) 2574 (forward-line (1- line))))
2545 ))
2546 2575
2547 2576
2548(defun rst-toc-mode-find-section () 2577(defun rst-toc-mode-find-section ()
@@ -2644,8 +2673,7 @@ backwards in the file (default is to use 1)."
2644 (curline (line-number-at-pos)) 2673 (curline (line-number-at-pos))
2645 2674
2646 (cur allados) 2675 (cur allados)
2647 (idx 0) 2676 (idx 0))
2648 )
2649 2677
2650 ;; Find the index of the "next" adornment w.r.t. to the current line. 2678 ;; Find the index of the "next" adornment w.r.t. to the current line.
2651 (while (and cur (< (caar cur) curline)) 2679 (while (and cur (< (caar cur) curline))
@@ -2666,8 +2694,7 @@ backwards in the file (default is to use 1)."
2666 (progn 2694 (progn
2667 (goto-char (point-min)) 2695 (goto-char (point-min))
2668 (forward-line (1- (car cur)))) 2696 (forward-line (1- (car cur))))
2669 (if (> offset 0) (goto-char (point-max)) (goto-char (point-min)))) 2697 (if (> offset 0) (goto-char (point-max)) (goto-char (point-min))))))
2670 ))
2671 2698
2672(defun rst-backward-section () 2699(defun rst-backward-section ()
2673 "Like `rst-forward-section', except move back one title." 2700 "Like `rst-forward-section', except move back one title."
@@ -2686,7 +2713,7 @@ for negative COUNT."
2686 (error "Cannot mark zero sections")) 2713 (error "Cannot mark zero sections"))
2687 (cond ((and allow-extend 2714 (cond ((and allow-extend
2688 (or (and (eq last-command this-command) (mark t)) 2715 (or (and (eq last-command this-command) (mark t))
2689 (rst-portable-mark-active-p))) 2716 (use-region-p)))
2690 (set-mark 2717 (set-mark
2691 (save-excursion 2718 (save-excursion
2692 (goto-char (mark)) 2719 (goto-char (mark))
@@ -2742,17 +2769,14 @@ of each paragraph only."
2742 (valid (and (= curcol leftcol) 2769 (valid (and (= curcol leftcol)
2743 (not (looking-at (rst-re 'lin-end)))) 2770 (not (looking-at (rst-re 'lin-end))))
2744 (and (= curcol leftcol) 2771 (and (= curcol leftcol)
2745 (not (looking-at (rst-re 'lin-end))))) 2772 (not (looking-at (rst-re 'lin-end))))))
2746 )
2747 ((>= (point) endm)) 2773 ((>= (point) endm))
2748 2774
2749 (if (if ,first-only 2775 (if (if ,first-only
2750 (and valid (not previous)) 2776 (and valid (not previous))
2751 valid) 2777 valid)
2752 ,body-consequent 2778 ,body-consequent
2753 ,body-alternative) 2779 ,body-alternative)))))
2754
2755 ))))
2756 2780
2757;; FIXME: This needs to be refactored. Probably this is simply a function 2781;; FIXME: This needs to be refactored. Probably this is simply a function
2758;; applying BODY rather than a macro. 2782;; applying BODY rather than a macro.
@@ -2785,13 +2809,10 @@ first of a paragraph."
2785 (,isleftmost (and (not ,isempty) 2809 (,isleftmost (and (not ,isempty)
2786 (= (current-column) ,leftmost)) 2810 (= (current-column) ,leftmost))
2787 (and (not ,isempty) 2811 (and (not ,isempty)
2788 (= (current-column) ,leftmost))) 2812 (= (current-column) ,leftmost))))
2789 )
2790 ((>= (point) endm)) 2813 ((>= (point) endm))
2791 2814
2792 (progn ,@body) 2815 (progn ,@body))))))
2793
2794 )))))
2795 2816
2796;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2817;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2797;; Indentation 2818;; Indentation
@@ -2817,26 +2838,31 @@ here."
2817 "Indentation when there is no more indentation point given." 2838 "Indentation when there is no more indentation point given."
2818 :group 'rst-indent 2839 :group 'rst-indent
2819 :type '(integer)) 2840 :type '(integer))
2841(rst-testcover-defcustom)
2820 2842
2821(defcustom rst-indent-field 3 2843(defcustom rst-indent-field 3
2822 "Indentation for first line after a field or 0 to always indent for content." 2844 "Indentation for first line after a field or 0 to always indent for content."
2823 :group 'rst-indent 2845 :group 'rst-indent
2824 :type '(integer)) 2846 :type '(integer))
2847(rst-testcover-defcustom)
2825 2848
2826(defcustom rst-indent-literal-normal 3 2849(defcustom rst-indent-literal-normal 3
2827 "Default indentation for literal block after a markup on an own line." 2850 "Default indentation for literal block after a markup on an own line."
2828 :group 'rst-indent 2851 :group 'rst-indent
2829 :type '(integer)) 2852 :type '(integer))
2853(rst-testcover-defcustom)
2830 2854
2831(defcustom rst-indent-literal-minimized 2 2855(defcustom rst-indent-literal-minimized 2
2832 "Default indentation for literal block after a minimized markup." 2856 "Default indentation for literal block after a minimized markup."
2833 :group 'rst-indent 2857 :group 'rst-indent
2834 :type '(integer)) 2858 :type '(integer))
2859(rst-testcover-defcustom)
2835 2860
2836(defcustom rst-indent-comment 3 2861(defcustom rst-indent-comment 3
2837 "Default indentation for first line of a comment." 2862 "Default indentation for first line of a comment."
2838 :group 'rst-indent 2863 :group 'rst-indent
2839 :type '(integer)) 2864 :type '(integer))
2865(rst-testcover-defcustom)
2840 2866
2841;; FIXME: Must consider other tabs: 2867;; FIXME: Must consider other tabs:
2842;; * Line blocks 2868;; * Line blocks
@@ -3116,8 +3142,7 @@ do all lines instead of just paragraphs."
3116 (let ((ins-string (format "%d. " (incf count)))) 3142 (let ((ins-string (format "%d. " (incf count))))
3117 (setq last-insert-len (length ins-string)) 3143 (setq last-insert-len (length ins-string))
3118 (insert ins-string)) 3144 (insert ins-string))
3119 (insert (make-string last-insert-len ?\ )) 3145 (insert (make-string last-insert-len ?\ )))))
3120 )))
3121 3146
3122(defun rst-bullet-list-region (beg end all) 3147(defun rst-bullet-list-region (beg end all)
3123 "Add bullets to all the leftmost paragraphs in the given region. 3148 "Add bullets to all the leftmost paragraphs in the given region.
@@ -3127,8 +3152,7 @@ do all lines instead of just paragraphs."
3127 (rst-iterate-leftmost-paragraphs 3152 (rst-iterate-leftmost-paragraphs
3128 beg end (not all) 3153 beg end (not all)
3129 (insert (car rst-preferred-bullets) " ") 3154 (insert (car rst-preferred-bullets) " ")
3130 (insert " ") 3155 (insert " ")))
3131 ))
3132 3156
3133;; FIXME: Does not deal with a varying number of digits appropriately. 3157;; FIXME: Does not deal with a varying number of digits appropriately.
3134;; FIXME: Does not deal with multiple levels independently. 3158;; FIXME: Does not deal with multiple levels independently.
@@ -3143,18 +3167,13 @@ Renumber as necessary. Region is from BEG to END."
3143 (cons (copy-marker (car x)) 3167 (cons (copy-marker (car x))
3144 (cdr x))) 3168 (cdr x)))
3145 (rst-find-pfx-in-region beg end (rst-re 'itmany-sta-1)))) 3169 (rst-find-pfx-in-region beg end (rst-re 'itmany-sta-1))))
3146 (count 1) 3170 (count 1))
3147 )
3148 (save-excursion 3171 (save-excursion
3149 (dolist (x items) 3172 (dolist (x items)
3150 (goto-char (car x)) 3173 (goto-char (car x))
3151 (looking-at (rst-re 'itmany-beg-1)) 3174 (looking-at (rst-re 'itmany-beg-1))
3152 (replace-match (format "%d." count) nil nil nil 1) 3175 (replace-match (format "%d." count) nil nil nil 1)
3153 (incf count) 3176 (incf count)))))
3154 ))
3155 ))
3156
3157
3158 3177
3159;;------------------------------------------------------------------------------ 3178;;------------------------------------------------------------------------------
3160 3179
@@ -3202,6 +3221,7 @@ Region is from RBEG to REND. With PFXARG set the empty lines too."
3202 :version "24.1" 3221 :version "24.1"
3203 :group 'rst-faces 3222 :group 'rst-faces
3204 :type '(face)) 3223 :type '(face))
3224(rst-testcover-defcustom)
3205(make-obsolete-variable 'rst-block-face 3225(make-obsolete-variable 'rst-block-face
3206 "customize the face `rst-block' instead." 3226 "customize the face `rst-block' instead."
3207 "24.1") 3227 "24.1")
@@ -3216,6 +3236,7 @@ Region is from RBEG to REND. With PFXARG set the empty lines too."
3216 :version "24.1" 3236 :version "24.1"
3217 :group 'rst-faces 3237 :group 'rst-faces
3218 :type '(face)) 3238 :type '(face))
3239(rst-testcover-defcustom)
3219(make-obsolete-variable 'rst-external-face 3240(make-obsolete-variable 'rst-external-face
3220 "customize the face `rst-external' instead." 3241 "customize the face `rst-external' instead."
3221 "24.1") 3242 "24.1")
@@ -3230,6 +3251,7 @@ Region is from RBEG to REND. With PFXARG set the empty lines too."
3230 :version "24.1" 3251 :version "24.1"
3231 :group 'rst-faces 3252 :group 'rst-faces
3232 :type '(face)) 3253 :type '(face))
3254(rst-testcover-defcustom)
3233(make-obsolete-variable 'rst-definition-face 3255(make-obsolete-variable 'rst-definition-face
3234 "customize the face `rst-definition' instead." 3256 "customize the face `rst-definition' instead."
3235 "24.1") 3257 "24.1")
@@ -3246,6 +3268,7 @@ Region is from RBEG to REND. With PFXARG set the empty lines too."
3246 "Directives and roles." 3268 "Directives and roles."
3247 :group 'rst-faces 3269 :group 'rst-faces
3248 :type '(face)) 3270 :type '(face))
3271(rst-testcover-defcustom)
3249(make-obsolete-variable 'rst-directive-face 3272(make-obsolete-variable 'rst-directive-face
3250 "customize the face `rst-directive' instead." 3273 "customize the face `rst-directive' instead."
3251 "24.1") 3274 "24.1")
@@ -3260,6 +3283,7 @@ Region is from RBEG to REND. With PFXARG set the empty lines too."
3260 :version "24.1" 3283 :version "24.1"
3261 :group 'rst-faces 3284 :group 'rst-faces
3262 :type '(face)) 3285 :type '(face))
3286(rst-testcover-defcustom)
3263(make-obsolete-variable 'rst-comment-face 3287(make-obsolete-variable 'rst-comment-face
3264 "customize the face `rst-comment' instead." 3288 "customize the face `rst-comment' instead."
3265 "24.1") 3289 "24.1")
@@ -3274,6 +3298,7 @@ Region is from RBEG to REND. With PFXARG set the empty lines too."
3274 :version "24.1" 3298 :version "24.1"
3275 :group 'rst-faces 3299 :group 'rst-faces
3276 :type '(face)) 3300 :type '(face))
3301(rst-testcover-defcustom)
3277(make-obsolete-variable 'rst-emphasis1-face 3302(make-obsolete-variable 'rst-emphasis1-face
3278 "customize the face `rst-emphasis1' instead." 3303 "customize the face `rst-emphasis1' instead."
3279 "24.1") 3304 "24.1")
@@ -3287,6 +3312,7 @@ Region is from RBEG to REND. With PFXARG set the empty lines too."
3287 "Double emphasis." 3312 "Double emphasis."
3288 :group 'rst-faces 3313 :group 'rst-faces
3289 :type '(face)) 3314 :type '(face))
3315(rst-testcover-defcustom)
3290(make-obsolete-variable 'rst-emphasis2-face 3316(make-obsolete-variable 'rst-emphasis2-face
3291 "customize the face `rst-emphasis2' instead." 3317 "customize the face `rst-emphasis2' instead."
3292 "24.1") 3318 "24.1")
@@ -3301,6 +3327,7 @@ Region is from RBEG to REND. With PFXARG set the empty lines too."
3301 :version "24.1" 3327 :version "24.1"
3302 :group 'rst-faces 3328 :group 'rst-faces
3303 :type '(face)) 3329 :type '(face))
3330(rst-testcover-defcustom)
3304(make-obsolete-variable 'rst-literal-face 3331(make-obsolete-variable 'rst-literal-face
3305 "customize the face `rst-literal' instead." 3332 "customize the face `rst-literal' instead."
3306 "24.1") 3333 "24.1")
@@ -3315,6 +3342,7 @@ Region is from RBEG to REND. With PFXARG set the empty lines too."
3315 :version "24.1" 3342 :version "24.1"
3316 :group 'rst-faces 3343 :group 'rst-faces
3317 :type '(face)) 3344 :type '(face))
3345(rst-testcover-defcustom)
3318(make-obsolete-variable 'rst-reference-face 3346(make-obsolete-variable 'rst-reference-face
3319 "customize the face `rst-reference' instead." 3347 "customize the face `rst-reference' instead."
3320 "24.1") 3348 "24.1")
@@ -3368,6 +3396,7 @@ Recompute the faces. VAL is the value to set."
3368 :group 'rst-faces-defaults 3396 :group 'rst-faces-defaults
3369 :type '(integer) 3397 :type '(integer)
3370 :set 'rst-set-level-default) 3398 :set 'rst-set-level-default)
3399(rst-testcover-defcustom)
3371;; FIXME: It should be possible to give "#RRGGBB" type of color values. 3400;; FIXME: It should be possible to give "#RRGGBB" type of color values.
3372;; Together with a `rst-level-face-end-light' this could be used for 3401;; Together with a `rst-level-face-end-light' this could be used for
3373;; computing steps. 3402;; computing steps.
@@ -3378,6 +3407,7 @@ Recompute the faces. VAL is the value to set."
3378 :group 'rst-faces-defaults 3407 :group 'rst-faces-defaults
3379 :type '(string) 3408 :type '(string)
3380 :set 'rst-set-level-default) 3409 :set 'rst-set-level-default)
3410(rst-testcover-defcustom)
3381;; FIXME LEVEL-FACE: This needs to be done differently: The faces must specify 3411;; FIXME LEVEL-FACE: This needs to be done differently: The faces must specify
3382;; how they behave for dark and light background using the 3412;; how they behave for dark and light background using the
3383;; relevant options explained in `defface'. 3413;; relevant options explained in `defface'.
@@ -3391,12 +3421,14 @@ The default depends on whether the value of `frame-background-mode' is
3391 :group 'rst-faces-defaults 3421 :group 'rst-faces-defaults
3392 :type '(integer) 3422 :type '(integer)
3393 :set 'rst-set-level-default) 3423 :set 'rst-set-level-default)
3424(rst-testcover-defcustom)
3394(defcustom rst-level-face-format-light "%2d" 3425(defcustom rst-level-face-format-light "%2d"
3395 "The format for the lightness factor appended to the base name of the color. 3426 "The format for the lightness factor appended to the base name of the color.
3396This value is expanded by `format' with an integer." 3427This value is expanded by `format' with an integer."
3397 :group 'rst-faces-defaults 3428 :group 'rst-faces-defaults
3398 :type '(string) 3429 :type '(string)
3399 :set 'rst-set-level-default) 3430 :set 'rst-set-level-default)
3431(rst-testcover-defcustom)
3400;; FIXME LEVEL-FACE: This needs to be done differently: The faces must specify 3432;; FIXME LEVEL-FACE: This needs to be done differently: The faces must specify
3401;; how they behave for dark and light background using the 3433;; how they behave for dark and light background using the
3402;; relevant options explained in `defface'. 3434;; relevant options explained in `defface'.
@@ -3420,6 +3452,7 @@ This color is used as background for section title text on level
3420 :group 'rst-faces-defaults 3452 :group 'rst-faces-defaults
3421 :type '(integer) 3453 :type '(integer)
3422 :set 'rst-set-level-default) 3454 :set 'rst-set-level-default)
3455(rst-testcover-defcustom)
3423 3456
3424(defcustom rst-adornment-faces-alist 3457(defcustom rst-adornment-faces-alist
3425 ;; FIXME LEVEL-FACE: Must be redone if `rst-level-face-max' is changed 3458 ;; FIXME LEVEL-FACE: Must be redone if `rst-level-face-max' is changed
@@ -3447,6 +3480,7 @@ group."
3447 (const :tag "section title adornment" nil)) 3480 (const :tag "section title adornment" nil))
3448 :value-type (face)) 3481 :value-type (face))
3449 :set-after '(rst-level-face-max)) 3482 :set-after '(rst-level-face-max))
3483(rst-testcover-defcustom)
3450 3484
3451(defun rst-define-level-faces () 3485(defun rst-define-level-faces ()
3452 "Define the faces for the section title text faces from the values." 3486 "Define the faces for the section title text faces from the values."
@@ -3663,8 +3697,7 @@ variable of the `rst-faces-defaults' group is customized. Use
3663 ;; Indentation is not required for doctest blocks. 3697 ;; Indentation is not required for doctest blocks.
3664 (,(rst-re 'lin-beg '(:grp (:alt ">>>" ell-tag)) '(:grp ".+")) 3698 (,(rst-re 'lin-beg '(:grp (:alt ">>>" ell-tag)) '(:grp ".+"))
3665 (1 rst-block-face) 3699 (1 rst-block-face)
3666 (2 rst-literal-face)) 3700 (2 rst-literal-face)))
3667 )
3668 "Keywords to highlight in rst mode.") 3701 "Keywords to highlight in rst mode.")
3669 3702
3670(defvar font-lock-beg) 3703(defvar font-lock-beg)
@@ -3974,6 +4007,7 @@ string)) to be used for converting the document."
3974 (string :tag "Options")))) 4007 (string :tag "Options"))))
3975 :group 'rst 4008 :group 'rst
3976 :package-version "1.2.0") 4009 :package-version "1.2.0")
4010(rst-testcover-defcustom)
3977 4011
3978;; FIXME: Must be `defcustom`. 4012;; FIXME: Must be `defcustom`.
3979(defvar rst-compile-primary-toolset 'html 4013(defvar rst-compile-primary-toolset 'html
@@ -3999,11 +4033,8 @@ string)) to be used for converting the document."
3999 (setq prevdir dir) 4033 (setq prevdir dir)
4000 (setq dir (expand-file-name (file-name-directory 4034 (setq dir (expand-file-name (file-name-directory
4001 (directory-file-name 4035 (directory-file-name
4002 (file-name-directory dir))))) 4036 (file-name-directory dir))))))
4003 ) 4037 (or (and dir (concat dir file-name)) nil))))
4004 (or (and dir (concat dir file-name)) nil)
4005 )))
4006
4007 4038
4008(require 'compile) 4039(require 'compile)
4009 4040
@@ -4041,8 +4072,7 @@ select the alternative tool-set."
4041 ;; Invoke the compile command. 4072 ;; Invoke the compile command.
4042 (if (or compilation-read-command use-alt) 4073 (if (or compilation-read-command use-alt)
4043 (call-interactively 'compile) 4074 (call-interactively 'compile)
4044 (compile compile-command)) 4075 (compile compile-command))))
4045 ))
4046 4076
4047(defun rst-compile-alt-toolset () 4077(defun rst-compile-alt-toolset ()
4048 "Compile command with the alternative tool-set." 4078 "Compile command with the alternative tool-set."
@@ -4097,6 +4127,79 @@ buffer, if the region is not selected."
4097 )) 4127 ))
4098 4128
4099 4129
4130;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
4131;; Imenu support.
4132
4133;; FIXME: Integrate this properly. Consider a key binding.
4134
4135;; Based on code from Masatake YAMATO <yamato@redhat.com>.
4136
4137(defun rst-imenu-find-adornments-for-position (adornments pos)
4138 "Find adornments cell in ADORNMENTS for position POS."
4139 (let ((a nil))
4140 (while adornments
4141 (if (and (car adornments)
4142 (eq (car (car adornments)) pos))
4143 (setq a adornments
4144 adornments nil)
4145 (setq adornments (cdr adornments))))
4146 a))
4147
4148(defun rst-imenu-convert-cell (elt adornments)
4149 "Convert a cell ELT in a tree returned from `rst-section-tree' to imenu index.
4150ADORNMENTS is used as hint information for conversion."
4151 (let* ((kar (car elt))
4152 (kdr (cdr elt))
4153 (title (car kar)))
4154 (if kar
4155 (let* ((p (marker-position (cadr kar)))
4156 (adornments
4157 (rst-imenu-find-adornments-for-position adornments p))
4158 (a (car adornments))
4159 (adornments (cdr adornments))
4160 ;; FIXME: Overline adornment characters need to be in front so
4161 ;; they become visible even for long title lines. May be
4162 ;; an additional level number is also useful.
4163 (title (format "%s%s%s"
4164 (make-string (1+ (nth 3 a)) (nth 1 a))
4165 title
4166 (if (eq (nth 2 a) 'simple)
4167 ""
4168 (char-to-string (nth 1 a))))))
4169 (cons title
4170 (if (null kdr)
4171 p
4172 (cons
4173 ;; A bit ugly but this make which-func happy.
4174 (cons title p)
4175 (mapcar (lambda (elt0)
4176 (rst-imenu-convert-cell elt0 adornments))
4177 kdr)))))
4178 nil)))
4179
4180;; FIXME: Document title and subtitle need to be handled properly. They should
4181;; get an own "Document" top level entry.
4182(defun rst-imenu-create-index ()
4183 "Create index for imenu.
4184Return as described for `imenu--index-alist'."
4185 (rst-reset-section-caches)
4186 (let ((tree (rst-section-tree))
4187 ;; Translate line notation to point notation.
4188 (adornments (save-excursion
4189 (mapcar (lambda (ln-ado)
4190 (cons (progn
4191 (goto-char (point-min))
4192 (forward-line (1- (car ln-ado)))
4193 ;; FIXME: Need to consider
4194 ;; `imenu-use-markers' here?
4195 (point))
4196 (cdr ln-ado)))
4197 (rst-find-all-adornments)))))
4198 (delete nil (mapcar (lambda (elt)
4199 (rst-imenu-convert-cell elt adornments))
4200 tree))))
4201
4202
4100;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 4203;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
4101;; Generic text functions that are more convenient than the defaults. 4204;; Generic text functions that are more convenient than the defaults.
4102 4205
@@ -4166,8 +4269,7 @@ column is used (fill-column vs. end of previous/next line)."
4166 (cond ((equal last-command 'rst-repeat-last-character) 4269 (cond ((equal last-command 'rst-repeat-last-character)
4167 (if (= curcol fill-column) prevcol fill-column)) 4270 (if (= curcol fill-column) prevcol fill-column))
4168 (t (save-excursion 4271 (t (save-excursion
4169 (if (zerop prevcol) fill-column prevcol))) 4272 (if (zerop prevcol) fill-column prevcol))))))
4170 )) )
4171 (end-of-line) 4273 (end-of-line)
4172 (if (> (current-column) rightmost-column) 4274 (if (> (current-column) rightmost-column)
4173 ;; Shave characters off the end. 4275 ;; Shave characters off the end.
@@ -4176,17 +4278,7 @@ column is used (fill-column vs. end of previous/next line)."
4176 (point)) 4278 (point))
4177 ;; Fill with last characters. 4279 ;; Fill with last characters.
4178 (insert-char (preceding-char) 4280 (insert-char (preceding-char)
4179 (- rightmost-column (current-column)))) 4281 (- rightmost-column (current-column))))))
4180 ))
4181
4182
4183(defun rst-portable-mark-active-p ()
4184 "Return non-nil if the mark is active.
4185This is a portable function."
4186 (cond
4187 ((fboundp 'region-active-p) (region-active-p))
4188 ((boundp 'transient-mark-mode) (and transient-mark-mode mark-active))
4189 (t mark-active)))
4190 4282
4191 4283
4192 4284
diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el
index 5bcd87ede68..67d7f8c01f9 100644
--- a/lisp/textmodes/sgml-mode.el
+++ b/lisp/textmodes/sgml-mode.el
@@ -451,7 +451,7 @@ the next N words. In Transient Mark mode, when the mark is active,
451N defaults to -1, which means to wrap it around the current region. 451N defaults to -1, which means to wrap it around the current region.
452 452
453If you like upcased tags, put (setq sgml-transformation-function 'upcase) 453If you like upcased tags, put (setq sgml-transformation-function 'upcase)
454in your `.emacs' file. 454in your init file.
455 455
456Use \\[sgml-validate] to validate your document with an SGML parser. 456Use \\[sgml-validate] to validate your document with an SGML parser.
457 457
diff --git a/lisp/textmodes/table.el b/lisp/textmodes/table.el
index 2664a89855f..459e884d45d 100644
--- a/lisp/textmodes/table.el
+++ b/lisp/textmodes/table.el
@@ -126,7 +126,7 @@
126;; again. 126;; again.
127;; 127;;
128;; To use the package regularly place this file in the site library 128;; To use the package regularly place this file in the site library
129;; directory and add the next expression in your .emacs file. Make 129;; directory and add the next expression in your init file. Make
130;; sure that directory is included in the `load-path'. 130;; sure that directory is included in the `load-path'.
131;; 131;;
132;; (require 'table) 132;; (require 'table)
@@ -342,10 +342,10 @@
342;; (function (lambda () 342;; (function (lambda ()
343;; (local-set-key [<key sequence>] '<function>)))) 343;; (local-set-key [<key sequence>] '<function>))))
344;; 344;;
345;; Above code is well known ~/.emacs idiom for customizing a mode 345;; Adding the above to your init file is a common way to customize a
346;; specific keymap however it does not work for this package. This is 346;; mode specific keymap. However it does not work for this package.
347;; because there is no table mode in effect. This package does not 347;; This is because there is no table mode in effect. This package
348;; use a local map therefore you must modify `table-cell-map' 348;; does not use a local map therefore you must modify `table-cell-map'
349;; explicitly. The correct way of achieving above task is: 349;; explicitly. The correct way of achieving above task is:
350;; 350;;
351;; (add-hook 'table-cell-map-hook 351;; (add-hook 'table-cell-map-hook
diff --git a/lisp/textmodes/two-column.el b/lisp/textmodes/two-column.el
index 8a4fe4f87fd..b21e72639fd 100644
--- a/lisp/textmodes/two-column.el
+++ b/lisp/textmodes/two-column.el
@@ -276,8 +276,9 @@ You have the following commands at your disposal:
276\\[2C-merge] Merge both buffers 276\\[2C-merge] Merge both buffers
277\\[2C-dissociate] Dissociate the two buffers 277\\[2C-dissociate] Dissociate the two buffers
278 278
279These keybindings can be customized in your ~/.emacs by `2C-mode-map', 279These keybindings can be customized in your init file by
280`2C-minor-mode-map' and by binding `2C-command' to some prefix. 280`2C-mode-map', `2C-minor-mode-map' and by binding `2C-command' to
281some prefix.
281 282
282The appearance of the screen can be customized by the variables 283The appearance of the screen can be customized by the variables
283`2C-window-width', `2C-beyond-fill-column', `2C-mode-line-format' and 284`2C-window-width', `2C-beyond-fill-column', `2C-mode-line-format' and
diff --git a/lisp/time-stamp.el b/lisp/time-stamp.el
index 13963121e2b..c2ac1035dfe 100644
--- a/lisp/time-stamp.el
+++ b/lisp/time-stamp.el
@@ -29,7 +29,7 @@
29;; static char *ts = "sdmain.c Time-stamp: <2001-08-13 10:20:51 gildea>"; 29;; static char *ts = "sdmain.c Time-stamp: <2001-08-13 10:20:51 gildea>";
30;; See the top of `time-stamp.el' for another example. 30;; See the top of `time-stamp.el' for another example.
31 31
32;; To use time-stamping, add this line to your .emacs file: 32;; To use time-stamping, add this line to your init file:
33;; (add-hook 'before-save-hook 'time-stamp) 33;; (add-hook 'before-save-hook 'time-stamp)
34;; Now any time-stamp templates in your files will be updated automatically. 34;; Now any time-stamp templates in your files will be updated automatically.
35 35
@@ -254,7 +254,7 @@ time-stamped file itself.")
254(defun time-stamp () 254(defun time-stamp ()
255 "Update the time stamp string(s) in the buffer. 255 "Update the time stamp string(s) in the buffer.
256A template in a file can be automatically updated with a new time stamp 256A template in a file can be automatically updated with a new time stamp
257every time you save the file. Add this line to your .emacs file: 257every time you save the file. Add this line to your init file:
258 (add-hook 'before-save-hook 'time-stamp) 258 (add-hook 'before-save-hook 'time-stamp)
259or customize `before-save-hook' through Custom. 259or customize `before-save-hook' through Custom.
260Normally the template must appear in the first 8 lines of a file and 260Normally the template must appear in the first 8 lines of a file and
diff --git a/lisp/url/url-methods.el b/lisp/url/url-methods.el
index bd7d8e33922..26fe72014f7 100644
--- a/lisp/url/url-methods.el
+++ b/lisp/url/url-methods.el
@@ -79,7 +79,7 @@
79 79
80 ;; Store any proxying information - this will not overwrite an old 80 ;; Store any proxying information - this will not overwrite an old
81 ;; entry, so that people can still set this information in their 81 ;; entry, so that people can still set this information in their
82 ;; .emacs file 82 ;; init file
83 (cond 83 (cond
84 (cur-proxy nil) ; Keep their old settings 84 (cur-proxy nil) ; Keep their old settings
85 ((null env-proxy) nil) ; No proxy setup 85 ((null env-proxy) nil) ; No proxy setup
diff --git a/lisp/vc/diff.el b/lisp/vc/diff.el
index b70b6cd919c..b1c334ddcfc 100644
--- a/lisp/vc/diff.el
+++ b/lisp/vc/diff.el
@@ -197,7 +197,8 @@ With prefix arg, prompt for diff switches."
197 ori file)) 197 ori file))
198 (diff bak ori switches))) 198 (diff bak ori switches)))
199 199
200(defun diff-latest-backup-file (fn) ; actually belongs into files.el 200;;;###autoload
201(defun diff-latest-backup-file (fn)
201 "Return the latest existing backup of FILE, or nil." 202 "Return the latest existing backup of FILE, or nil."
202 (let ((handler (find-file-name-handler fn 'diff-latest-backup-file))) 203 (let ((handler (find-file-name-handler fn 'diff-latest-backup-file)))
203 (if handler 204 (if handler
diff --git a/lisp/vc/pcvs-defs.el b/lisp/vc/pcvs-defs.el
index 0f71b7b82e7..fc65d62c67d 100644
--- a/lisp/vc/pcvs-defs.el
+++ b/lisp/vc/pcvs-defs.el
@@ -57,11 +57,7 @@ versions, such as the one in SunOS-4.")
57;;;; END OF THINGS TO CHECK WHEN INSTALLING 57;;;; END OF THINGS TO CHECK WHEN INSTALLING
58;;;; -------------------------------------------------------- 58;;;; --------------------------------------------------------
59 59
60;;;;
61;;;; User configuration variables: 60;;;; User configuration variables:
62;;;;
63;;;; NOTE: these should be set in your ~/.emacs (or site-lisp/default.el) file.
64;;;;
65 61
66(defgroup pcl-cvs nil 62(defgroup pcl-cvs nil
67 "Special support for the CVS versioning system." 63 "Special support for the CVS versioning system."
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index b48ea1afd95..ea9ce949ccb 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -31,7 +31,7 @@
31 31
32;; To install: put this file on the load-path and add Git to the list 32;; To install: put this file on the load-path and add Git to the list
33;; of supported backends in `vc-handled-backends'; the following line, 33;; of supported backends in `vc-handled-backends'; the following line,
34;; placed in your ~/.emacs, will accomplish this: 34;; placed in your init file, will accomplish this:
35;; 35;;
36;; (add-to-list 'vc-handled-backends 'Git) 36;; (add-to-list 'vc-handled-backends 'Git)
37 37
diff --git a/lisp/windmove.el b/lisp/windmove.el
index 3a1afec38ee..1181e409dff 100644
--- a/lisp/windmove.el
+++ b/lisp/windmove.el
@@ -94,7 +94,7 @@
94 94
95;; Installation: 95;; Installation:
96;; 96;;
97;; Put the following line in your `.emacs' file: 97;; Put the following line in your init file:
98;; 98;;
99;; (windmove-default-keybindings) ; shifted arrow keys 99;; (windmove-default-keybindings) ; shifted arrow keys
100;; 100;;
diff --git a/make-dist b/make-dist
index 28d2ec15214..7a17fa02372 100755
--- a/make-dist
+++ b/make-dist
@@ -287,10 +287,10 @@ for subdir in site-lisp \
287 `find etc lisp admin -type d` \ 287 `find etc lisp admin -type d` \
288 doc doc/emacs doc/misc doc/man doc/lispref doc/lispintro \ 288 doc doc/emacs doc/misc doc/man doc/lispref doc/lispintro \
289 info m4 msdos \ 289 info m4 msdos \
290 nextstep nextstep/Cocoa nextstep/Cocoa/Emacs.base \ 290 nextstep nextstep/templates \
291 nextstep/Cocoa nextstep/Cocoa/Emacs.base \
291 nextstep/Cocoa/Emacs.base/Contents \ 292 nextstep/Cocoa/Emacs.base/Contents \
292 nextstep/Cocoa/Emacs.base/Contents/Resources \ 293 nextstep/Cocoa/Emacs.base/Contents/Resources \
293 nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj \
294 nextstep/GNUstep \ 294 nextstep/GNUstep \
295 nextstep/GNUstep/Emacs.base \ 295 nextstep/GNUstep/Emacs.base \
296 nextstep/GNUstep/Emacs.base/Resources 296 nextstep/GNUstep/Emacs.base/Resources
@@ -404,23 +404,23 @@ echo "Making links to \`msdos'"
404 404
405echo "Making links to \`nextstep'" 405echo "Making links to \`nextstep'"
406(cd nextstep 406(cd nextstep
407 ln ChangeLog README INSTALL ../${tempdir}/nextstep) 407 ln ChangeLog README INSTALL Makefile.in ../${tempdir}/nextstep)
408
409echo "Making links to \`nextstep/templates'"
410(cd nextstep/templates
411 ln Emacs.desktop.in Info-gnustep.plist.in Info.plist.in InfoPlist.strings.in ../../${tempdir}/nextstep/templates)
408 412
409echo "Making links to \`nextstep/Cocoa/Emacs.base/Contents'" 413echo "Making links to \`nextstep/Cocoa/Emacs.base/Contents'"
410(cd nextstep/Cocoa/Emacs.base/Contents 414(cd nextstep/Cocoa/Emacs.base/Contents
411 ln Info.plist PkgInfo ../../../../${tempdir}/nextstep/Cocoa/Emacs.base/Contents) 415 ln PkgInfo ../../../../${tempdir}/nextstep/Cocoa/Emacs.base/Contents)
412 416
413echo "Making links to \`nextstep/Cocoa/Emacs.base/Contents/Resources'" 417echo "Making links to \`nextstep/Cocoa/Emacs.base/Contents/Resources'"
414(cd nextstep/Cocoa/Emacs.base/Contents/Resources 418(cd nextstep/Cocoa/Emacs.base/Contents/Resources
415 ln Credits.html *.icns ../../../../../${tempdir}/nextstep/Cocoa/Emacs.base/Contents/Resources) 419 ln Credits.html *.icns ../../../../../${tempdir}/nextstep/Cocoa/Emacs.base/Contents/Resources)
416 420
417echo "Making links to \`nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj'"
418(cd nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj
419 ln InfoPlist.strings ../../../../../../${tempdir}/nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj)
420
421echo "Making links to \`nextstep/GNUstep/Emacs.base/Resources'" 421echo "Making links to \`nextstep/GNUstep/Emacs.base/Resources'"
422(cd nextstep/GNUstep/Emacs.base/Resources 422(cd nextstep/GNUstep/Emacs.base/Resources
423 ln Emacs.desktop Info-gnustep.plist README emacs.tiff ../../../../${tempdir}/nextstep/GNUstep/Emacs.base/Resources ) 423 ln README emacs.tiff ../../../../${tempdir}/nextstep/GNUstep/Emacs.base/Resources )
424 424
425echo "Making links to \`oldXMenu'" 425echo "Making links to \`oldXMenu'"
426(cd oldXMenu 426(cd oldXMenu
diff --git a/nextstep/ChangeLog b/nextstep/ChangeLog
index 6451f7a7322..53f42c97716 100644
--- a/nextstep/ChangeLog
+++ b/nextstep/ChangeLog
@@ -1,3 +1,22 @@
12012-09-17 Glenn Morris <rgm@gnu.org>
2
3 * templates/Info-gnustep.plist.in, templates/InfoPlist.strings.in:
4 * templates/Info.plist.in: Let configure set copyright.
5
62012-09-16 Glenn Morris <rgm@gnu.org>
7
8 * Makefile.in: New file.
9 * templates: New directory.
10 * templates/Emacs.desktop.in, templates/Info-gnustep.plist.in:
11 * templates/Info.plist.in, templates/InfoPlist.strings.in:
12 Move here from various Cocoa/, GNUstep/ locations.
13 Let configure set the version number.
14 * Cocoa/Emacs.base/Contents/Info.plist:
15 * Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings:
16 * GNUstep/Emacs.base/Resources/Info-gnustep.plist:
17 * GNUstep/Emacs.base/Resources/Emacs.desktop: Move to templates/.
18 * Cocoa/Emacs.base/Contents/Resources/English.lproj: Remove directory.
19
12012-04-07 Glenn Morris <rgm@gnu.org> 202012-04-07 Glenn Morris <rgm@gnu.org>
2 21
3 * Cocoa/Emacs.base/Contents/Info.plist: 22 * Cocoa/Emacs.base/Contents/Info.plist:
diff --git a/nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings b/nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings
deleted file mode 100644
index 7655c0ca8ec..00000000000
--- a/nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings
+++ /dev/null
@@ -1,6 +0,0 @@
1/* Localized versions of Info.plist keys */
2
3CFBundleName = "Emacs";
4CFBundleShortVersionString = "Version 24.2.50";
5CFBundleGetInfoString = "Emacs version 24.2.50, NS Windowing";
6NSHumanReadableCopyright = "Copyright (C) 2012 Free Software Foundation, Inc.";
diff --git a/nextstep/Makefile.in b/nextstep/Makefile.in
new file mode 100644
index 00000000000..27ec5d1556b
--- /dev/null
+++ b/nextstep/Makefile.in
@@ -0,0 +1,67 @@
1### nextstep/Makefile for GNU Emacs
2
3## Copyright (C) 2012 Free Software Foundation, Inc.
4
5## This file is part of GNU Emacs.
6
7## GNU Emacs is free software: you can redistribute it and/or modify
8## it under the terms of the GNU General Public License as published by
9## the Free Software Foundation, either version 3 of the License, or
10## (at your option) any later version.
11##
12## GNU Emacs is distributed in the hope that it will be useful,
13## but WITHOUT ANY WARRANTY; without even the implied warranty of
14## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15## GNU General Public License for more details.
16##
17## You should have received a copy of the GNU General Public License
18## along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
19
20### Commentary:
21
22### Code:
23SHELL = /bin/sh
24
25srcdir = @srcdir@
26EXEEXT = @EXEEXT@
27
28@SET_MAKE@
29MKDIR_P = @MKDIR_P@
30
31ns_appdir = @ns_appdir@
32ns_appbindir = @ns_appbindir@
33ns_appsrc = @ns_appsrc@
34
35${ns_appdir}: ${srcdir}/${ns_appsrc} ${ns_appsrc}
36 rm -rf ${ns_appdir}
37 ${MKDIR_P} ${ns_appdir}
38 ( cd ${srcdir}/${ns_appsrc} ; tar cfh - . ) | \
39 ( cd ${ns_appdir} ; umask 022; tar xf - )
40 [ `cd ${srcdir} && /bin/pwd` = `/bin/pwd` ] || \
41 ( cd ${ns_appsrc} ; tar cfh - . ) | \
42 ( cd ${ns_appdir} ; umask 022; tar xf - )
43
44${ns_appbindir}/Emacs: ${ns_appdir} ../src/emacs${EXEEXT}
45 ${MKDIR_P} ${ns_appbindir}
46 cp -f ../src/emacs${EXEEXT} ${ns_appbindir}/Emacs
47
48.PHONY: all
49
50all: ${ns_appdir} ${ns_appbindir}/Emacs
51
52
53.PHONY: clean distclean maintainer-clean
54
55clean:
56 rm -rf ${ns_appdir}
57
58distclean: clean
59 rm -f Makefile
60 rm -f GNUstep/Emacs.base/Resources/Info-gnustep.plist \
61 GNUstep/Emacs.base/Resources/Emacs.desktop \
62 Cocoa/Emacs.base/Contents/Info.plist \
63 Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings
64
65maintainer-clean: distclean
66
67### Makefile.in ends here
diff --git a/nextstep/GNUstep/Emacs.base/Resources/Emacs.desktop b/nextstep/templates/Emacs.desktop.in
index a36eafaadb0..170f195f270 100644
--- a/nextstep/GNUstep/Emacs.base/Resources/Emacs.desktop
+++ b/nextstep/templates/Emacs.desktop.in
@@ -1,7 +1,7 @@
1[Desktop Entry] 1[Desktop Entry]
2Encoding=UTF-8 2Encoding=UTF-8
3Type=Application 3Type=Application
4Version=24.2.50 4Version=@version@
5Categories=GNUstep 5Categories=GNUstep
6Name=Emacs 6Name=Emacs
7Comment=GNU Emacs for NeXT/Open/GNUstep and OS X 7Comment=GNU Emacs for NeXT/Open/GNUstep and OS X
diff --git a/nextstep/GNUstep/Emacs.base/Resources/Info-gnustep.plist b/nextstep/templates/Info-gnustep.plist.in
index 6cde01b0d05..4ac97e5cde6 100644
--- a/nextstep/GNUstep/Emacs.base/Resources/Info-gnustep.plist
+++ b/nextstep/templates/Info-gnustep.plist.in
@@ -2,7 +2,7 @@
2 ApplicationDescription = "GNU Emacs for GNUstep / OS X"; 2 ApplicationDescription = "GNU Emacs for GNUstep / OS X";
3 ApplicationIcon = emacs.tiff; 3 ApplicationIcon = emacs.tiff;
4 ApplicationName = Emacs; 4 ApplicationName = Emacs;
5 ApplicationRelease = "24.2.50"; 5 ApplicationRelease = "@version@";
6 Authors = ( 6 Authors = (
7 "Adrian Robert (GNUstep)", 7 "Adrian Robert (GNUstep)",
8 "Christophe de Dinechin (MacOS X)", 8 "Christophe de Dinechin (MacOS X)",
@@ -11,9 +11,9 @@
11 "Carl Edman (NeXTstep)", 11 "Carl Edman (NeXTstep)",
12 "..see etc/NEXTSTEP" 12 "..see etc/NEXTSTEP"
13 ); 13 );
14 Copyright = "Copyright (C) 2012 Free Software Foundation, Inc."; 14 Copyright = "@copyright@";
15 CopyrightDescription = "Released under the GNU General Public License Version 3 or later"; 15 CopyrightDescription = "Released under the GNU General Public License Version 3 or later";
16 FullVersionID = "Emacs 24.2.50, NS Windowing"; 16 FullVersionID = "Emacs @version@, NS Windowing";
17 NSExecutable = Emacs; 17 NSExecutable = Emacs;
18 NSIcon = emacs.tiff; 18 NSIcon = emacs.tiff;
19 NSPrincipalClass = NSApplication; 19 NSPrincipalClass = NSApplication;
diff --git a/nextstep/Cocoa/Emacs.base/Contents/Info.plist b/nextstep/templates/Info.plist.in
index f5490f613fd..25c73916e58 100644
--- a/nextstep/Cocoa/Emacs.base/Contents/Info.plist
+++ b/nextstep/templates/Info.plist.in
@@ -553,7 +553,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
553 <key>CFBundleExecutable</key> 553 <key>CFBundleExecutable</key>
554 <string>Emacs</string> 554 <string>Emacs</string>
555 <key>CFBundleGetInfoString</key> 555 <key>CFBundleGetInfoString</key>
556 <string>Emacs 24.2.50 Copyright (C) 2012 Free Software Foundation, Inc.</string> 556 <string>Emacs @version@ @copyright@</string>
557 <key>CFBundleIconFile</key> 557 <key>CFBundleIconFile</key>
558 <string>Emacs.icns</string> 558 <string>Emacs.icns</string>
559 <key>CFBundleIdentifier</key> 559 <key>CFBundleIdentifier</key>
@@ -566,7 +566,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
566 <string>APPL</string> 566 <string>APPL</string>
567 <!-- This should be the emacs version number. --> 567 <!-- This should be the emacs version number. -->
568 <key>CFBundleShortVersionString</key> 568 <key>CFBundleShortVersionString</key>
569 <string>24.2.50</string> 569 <string>@version@</string>
570 <key>CFBundleSignature</key> 570 <key>CFBundleSignature</key>
571 <string>EMAx</string> 571 <string>EMAx</string>
572 <!-- This SHOULD be a build number. --> 572 <!-- This SHOULD be a build number. -->
diff --git a/nextstep/templates/InfoPlist.strings.in b/nextstep/templates/InfoPlist.strings.in
new file mode 100644
index 00000000000..f38d8925017
--- /dev/null
+++ b/nextstep/templates/InfoPlist.strings.in
@@ -0,0 +1,6 @@
1/* Localized versions of Info.plist keys */
2
3CFBundleName = "Emacs";
4CFBundleShortVersionString = "Version @version@";
5CFBundleGetInfoString = "Emacs version @version@, NS Windowing";
6NSHumanReadableCopyright = "@copyright@";
diff --git a/nt/ChangeLog b/nt/ChangeLog
index 197ce0cf850..311a10f66c5 100644
--- a/nt/ChangeLog
+++ b/nt/ChangeLog
@@ -1,3 +1,17 @@
12012-09-18 Eli Zaretskii <eliz@gnu.org>
2
3 * configure.bat: Include stddef.h before gif_lib.h, to have size_t
4 defined, as needed by giflib-5.0.0. (Bug#12464)
5
62012-09-17 Juanma Barranquero <lekktu@gmail.com>
7
8 * config.nt: Sync with autogen/config.in.
9 (BROKEN_SA_RESTART, SYNC_INPUT): Remove.
10
112012-09-17 Glenn Morris <rgm@gnu.org>
12
13 * config.nt (COPYRIGHT): New.
14
12012-09-15 Paul Eggert <eggert@cs.ucla.edu> 152012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2 16
3 Port _setjmp fix to POSIXish hosts as well as Microsoft. 17 Port _setjmp fix to POSIXish hosts as well as Microsoft.
diff --git a/nt/config.nt b/nt/config.nt
index 82b7da430ab..23b33731a36 100644
--- a/nt/config.nt
+++ b/nt/config.nt
@@ -63,9 +63,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
63/* Define on FreeBSD to work around an issue when reading from a PTY. */ 63/* Define on FreeBSD to work around an issue when reading from a PTY. */
64#undef BROKEN_PTY_READ_AFTER_EAGAIN 64#undef BROKEN_PTY_READ_AFTER_EAGAIN
65 65
66/* Define if SA_RESTART should only be used in batch mode. */
67#undef BROKEN_SA_RESTART
68
69/* Define if the system is compatible with BSD 4.2. */ 66/* Define if the system is compatible with BSD 4.2. */
70#undef BSD4_2 67#undef BSD4_2
71 68
@@ -86,6 +83,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
86 his/her Emacs. */ 83 his/her Emacs. */
87#undef CLASH_DETECTION 84#undef CLASH_DETECTION
88 85
86/* Short copyright string for this version of Emacs. */
87#define COPYRIGHT "Copyright (C) 2012 Free Software Foundation, Inc."
88
89/* Define to one of '_getb67', 'GETB67', 'getb67' for Cray-2 and Cray-YMP 89/* Define to one of '_getb67', 'GETB67', 'getb67' for Cray-2 and Cray-YMP
90 systems. This function is required for 'alloca.c' support on those systems. 90 systems. This function is required for 'alloca.c' support on those systems.
91 */ 91 */
@@ -1305,9 +1305,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
1305/* Define to 1 on System V Release 4. */ 1305/* Define to 1 on System V Release 4. */
1306#undef SVR4 1306#undef SVR4
1307 1307
1308/* Process async input synchronously. */
1309#undef SYNC_INPUT
1310
1311/* Define to use system malloc. */ 1308/* Define to use system malloc. */
1312#undef SYSTEM_MALLOC 1309#undef SYSTEM_MALLOC
1313 1310
diff --git a/nt/configure.bat b/nt/configure.bat
index 5890b12d02e..7fedff411bc 100755
--- a/nt/configure.bat
+++ b/nt/configure.bat
@@ -627,7 +627,10 @@ rm -f junk.c junk.obj
627if (%gifsupport%) == (N) goto gifDone 627if (%gifsupport%) == (N) goto gifDone
628 628
629echo Checking for libgif... 629echo Checking for libgif...
630echo #include "gif_lib.h" >junk.c 630rem giflib-5.0.0 needs size_t defined before gif_lib.h is included
631rem redirection characters need to be protected from the shell
632echo #include ^<stddef.h^> >junk.c
633echo #include "gif_lib.h" >>junk.c
631echo main (){} >>junk.c 634echo main (){} >>junk.c
632rem -o option is ignored with cl, but allows result to be consistent. 635rem -o option is ignored with cl, but allows result to be consistent.
633echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log 636echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log
diff --git a/src/ChangeLog b/src/ChangeLog
index 8a05f19985f..0d441761ce5 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -3,6 +3,171 @@
3 * composite.c (composition_reseat_it): Handle the case that a 3 * composite.c (composition_reseat_it): Handle the case that a
4 grapheme cluster is not covered by a single font (Bug#12352). 4 grapheme cluster is not covered by a single font (Bug#12352).
5 5
62012-09-21 Chong Yidong <cyd@gnu.org>
7
8 * image.c (define_image_type): Avoid adding duplicate types to
9 image_types (Bug#12463). Suggested by Jörg Walter.
10
112012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12
13 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
14 (print_load_command_name): Add case LC_DATA_IN_CODE.
15 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
16
172012-09-21 Glenn Morris <rgm@gnu.org>
18
19 * eval.c (Frun_hook_with_args_until_success)
20 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
21
222012-09-21 Andreas Schwab <schwab@linux-m68k.org>
23
24 * fileio.c (Ffile_selinux_context): Only call freecon when
25 lgetfilecon succeeded.
26 (Fset_file_selinux_context): Likewise. (Bug#12444)
27
282012-09-21 Eli Zaretskii <eliz@gnu.org>
29
30 * xdisp.c (try_window_reusing_current_matrix): Under bidi
31 reordering, locate the cursor by calling set_cursor_from_row; if
32 that fails, clear the desired glyph matrix before returning a
33 failure indication to the caller. Fixes leaving garbled display
34 when fast scrolling with a down-key. (Bug#12403)
35 (compute_stop_pos_backwards): Fix a typo that caused crashes while
36 scrolling through multibyte text.
37
382012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
39
40 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
41 calling mark_vectorlike since that's the one that marks the window.
42 (mark_discard_killed_buffers): Mark the final cdr.
43 * window.h (struct window): Move prev/next_buffers to the
44 non-standard fields.
45 * window.c (make_window): Initialize prev/next_buffers manually.
46
472012-09-20 Paul Eggert <eggert@cs.ucla.edu>
48
49 Omit unused arg EXPECTED from socket hooks.
50 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
51 * nsterm.m (ns_term_init):
52 * termhooks.h (struct terminal.read_socket_hook):
53 * w32inevt.c (w32_console_read_socket):
54 * w32term.c (w32_read_socket):
55 * xterm.c (XTread_socket):
56 Omit unused arg EXPECTED. All callers changed.
57 (store_user_signal_events): Return void, not int, since callers no
58 longer care about the return value. All uses changed.
59
602012-09-20 Juanma Barranquero <lekktu@gmail.com>
61
62 * w32gui.h (XParseGeometry): Do not declare.
63
642012-09-19 Paul Eggert <eggert@cs.ucla.edu>
65
66 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
67 Ignore 'expected'. See Eli Zaretskii in
68 <http://bugs.gnu.org/12471#8> (last line).
69
70 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
71 (XParseGeometry): Now static. Substitute extremal values for
72 values that are out of range.
73
742012-09-19 Jan Djärv <jan.h.d@swipnet.se>
75
76 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
77
78 * nsfns.m (XParseGeometry): Remove.
79 (Fx_create_frame): Call x_set_offset to correctly interpret
80 top_pos in geometry.
81
82 * frame.c (read_integer, XParseGeometry): Moved from w32xfns.c.
83 (Fx_parse_geometry): If there is a space in string, call
84 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
85
862012-09-17 Eli Zaretskii <eliz@gnu.org>
87
88 * search.c (scan_buffer): Use character positions in calls to
89 region_cache_forward and region_cache_backward, not byte
90 positions. (Bug#12196)
91
92 * w32term.c (w32_read_socket): Set pending_signals to 1, like
93 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
94
95 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
96 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
97 emacs_blocked_malloc, now deleted.
98
992012-09-17 Paul Eggert <eggert@cs.ucla.edu>
100
101 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
102 The workaround was for improving performance on Solaris 2.4, but
103 is getting in the way now. Emacs will still work if someone is
104 still running Solaris 2.4 in a museum somewhere; Sun dropped
105 support for Solaris 2.4 in 2003.
106 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
107 * process.c (create_process) [HAVE_WORKING_VFORK]:
108 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
109 since Emacs no longer uses vfork on that platform.
110
1112012-09-17 Glenn Morris <rgm@gnu.org>
112
113 * emacs.c: Use COPYRIGHT.
114
1152012-09-16 Paul Eggert <eggert@cs.ucla.edu>
116
117 Remove configure's --without-sync-input option (Bug#12450).
118 When auditing signal-handling in preparation for cleaning it up,
119 I found that SYNC_INPUT has race conditions and would be a real
120 pain to fix. Since it's an undocumented and deprecated
121 configure-time option, now seems like a good time to remove it.
122 Also see <http://bugs.gnu.org/11080#16>.
123 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
124 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
125 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
126 (malloc_hysteresis):
127 (check_depth) [XMALLOC_OVERRUN_CHECK]:
128 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
129 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
130 (dont_register_blocks, bytes_used_when_reconsidered)
131 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
132 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
133 [!SYSTEM_MALLOC && !SYNC_INPUT]:
134 Remove. All uses removed.
135 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
136 implementation, one that depends on whether the new macro
137 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
138 is defined.
139 * atimer.c (run_timers, handle_alarm_signal):
140 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
141 (handle_async_input, process_pending_signals)
142 (handle_input_available_signal, init_keyboard):
143 * nsterm.m (ns_read_socket):
144 * process.c (wait_reading_process_output):
145 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
146 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
147 (emacs_write):
148 * xterm.c (XTread_socket):
149 Assume SYNC_INPUT.
150 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
151 * eval.c (handling_signal): Remove. All uses removed.
152 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
153 All uses replaced with the SYNC_INPUT version.
154 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
155 Remove decls.
156 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
157 Now static.
158
159 * font.c (Ffont_shape_gstring): Remove unused local.
160
1612012-09-16 Glenn Morris <rgm@gnu.org>
162
163 * Makefile.in (clean): No longer run nextstep's clean.
164
165 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
166 (ns_frag): Remove.
167 (ns-app): Move here from ns.mk, and simplify.
168 (clean): Simplify nextstep entry.
169 * ns.mk: Remove file.
170
62012-09-17 Kenichi Handa <handa@gnu.org> 1712012-09-17 Kenichi Handa <handa@gnu.org>
7 172
8 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may 173 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
diff --git a/src/Makefile.in b/src/Makefile.in
index fe4cff5d8cc..37da170edbd 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -255,9 +255,6 @@ MSDOS_OBJ =
255## w16select.o termcap.o if MSDOS && HAVE_X_WINDOWS. 255## w16select.o termcap.o if MSDOS && HAVE_X_WINDOWS.
256MSDOS_X_OBJ = 256MSDOS_X_OBJ =
257 257
258ns_appdir=@ns_appdir@
259ns_appbindir=@ns_appbindir@
260ns_appsrc=@ns_appsrc@
261NS_OBJ=@NS_OBJ@ 258NS_OBJ=@NS_OBJ@
262## nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o if HAVE_NS. 259## nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o if HAVE_NS.
263NS_OBJC_OBJ=@NS_OBJC_OBJ@ 260NS_OBJC_OBJ=@NS_OBJC_OBJ@
@@ -501,8 +498,9 @@ $(OLDXMENU): $(OLDXMENU_TARGET)
501doc.o: buildobj.h 498doc.o: buildobj.h
502 499
503 500
504## If HAVE_NS, some ns-specific rules (for OTHER_FILES) are inserted here. 501ns-app: emacs$(EXEEXT)
505@ns_frag@ 502 cd ../nextstep && $(MAKE) $(MFLAGS) all
503
506 504
507.PHONY: mostlyclean clean bootstrap-clean distclean maintainer-clean 505.PHONY: mostlyclean clean bootstrap-clean distclean maintainer-clean
508.PHONY: versionclean extraclean frc 506.PHONY: versionclean extraclean frc
@@ -516,7 +514,6 @@ mostlyclean:
516clean: mostlyclean 514clean: mostlyclean
517 rm -f emacs-*.*.*$(EXEEXT) emacs$(EXEEXT) 515 rm -f emacs-*.*.*$(EXEEXT) emacs$(EXEEXT)
518 -rm -rf $(DEPDIR) 516 -rm -rf $(DEPDIR)
519 test "X$(ns_appdir)" = "X" || rm -rf $(ns_appdir)
520 517
521## bootstrap-clean is used to clean up just before a bootstrap. 518## bootstrap-clean is used to clean up just before a bootstrap.
522## It should remove all files generated during a compilation/bootstrap, 519## It should remove all files generated during a compilation/bootstrap,
diff --git a/src/alloc.c b/src/alloc.c
index 0bfbb0c88b1..02ba2f5f9e3 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -85,68 +85,8 @@ extern void *sbrk ();
85 85
86#define MMAP_MAX_AREAS 100000000 86#define MMAP_MAX_AREAS 100000000
87 87
88#else /* not DOUG_LEA_MALLOC */
89
90/* The following come from gmalloc.c. */
91
92extern size_t _bytes_used;
93extern size_t __malloc_extra_blocks;
94extern void *_malloc_internal (size_t);
95extern void _free_internal (void *);
96
97#endif /* not DOUG_LEA_MALLOC */ 88#endif /* not DOUG_LEA_MALLOC */
98 89
99#if ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT
100#ifdef HAVE_PTHREAD
101
102# include "syssignal.h"
103
104/* When GTK uses the file chooser dialog, different backends can be loaded
105 dynamically. One such a backend is the Gnome VFS backend that gets loaded
106 if you run Gnome. That backend creates several threads and also allocates
107 memory with malloc.
108
109 Also, gconf and gsettings may create several threads.
110
111 If Emacs sets malloc hooks (! SYSTEM_MALLOC) and the emacs_blocked_*
112 functions below are called from malloc, there is a chance that one
113 of these threads preempts the Emacs main thread and the hook variables
114 end up in an inconsistent state. So we have a mutex to prevent that (note
115 that the backend handles concurrent access to malloc within its own threads
116 but Emacs code running in the main thread is not included in that control).
117
118 When UNBLOCK_INPUT is called, reinvoke_input_signal may be called. If this
119 happens in one of the backend threads we will have two threads that tries
120 to run Emacs code at once, and the code is not prepared for that.
121 To prevent that, we only call BLOCK/UNBLOCK from the main thread. */
122
123static pthread_mutex_t alloc_mutex;
124
125#define BLOCK_INPUT_ALLOC \
126 do \
127 { \
128 if (pthread_equal (pthread_self (), main_thread)) \
129 BLOCK_INPUT; \
130 pthread_mutex_lock (&alloc_mutex); \
131 } \
132 while (0)
133#define UNBLOCK_INPUT_ALLOC \
134 do \
135 { \
136 pthread_mutex_unlock (&alloc_mutex); \
137 if (pthread_equal (pthread_self (), main_thread)) \
138 UNBLOCK_INPUT; \
139 } \
140 while (0)
141
142#else /* ! defined HAVE_PTHREAD */
143
144#define BLOCK_INPUT_ALLOC BLOCK_INPUT
145#define UNBLOCK_INPUT_ALLOC UNBLOCK_INPUT
146
147#endif /* ! defined HAVE_PTHREAD */
148#endif /* ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT */
149
150/* Mark, unmark, query mark bit of a Lisp string. S must be a pointer 90/* Mark, unmark, query mark bit of a Lisp string. S must be a pointer
151 to a struct Lisp_String. */ 91 to a struct Lisp_String. */
152 92
@@ -205,10 +145,6 @@ static char *spare_memory[7];
205 145
206#define SPARE_MEMORY (1 << 14) 146#define SPARE_MEMORY (1 << 14)
207 147
208/* Number of extra blocks malloc should get when it needs more core. */
209
210static int malloc_hysteresis;
211
212/* Initialize it to a nonzero value to force it into data space 148/* Initialize it to a nonzero value to force it into data space
213 (rather than bss space). That way unexec will remap it into text 149 (rather than bss space). That way unexec will remap it into text
214 space (pure), on some systems. We have not implemented the 150 space (pure), on some systems. We have not implemented the
@@ -413,12 +349,12 @@ static void mark_memory (void *, void *);
413static void mem_init (void); 349static void mem_init (void);
414static struct mem_node *mem_insert (void *, void *, enum mem_type); 350static struct mem_node *mem_insert (void *, void *, enum mem_type);
415static void mem_insert_fixup (struct mem_node *); 351static void mem_insert_fixup (struct mem_node *);
416#endif
417static void mem_rotate_left (struct mem_node *); 352static void mem_rotate_left (struct mem_node *);
418static void mem_rotate_right (struct mem_node *); 353static void mem_rotate_right (struct mem_node *);
419static void mem_delete (struct mem_node *); 354static void mem_delete (struct mem_node *);
420static void mem_delete_fixup (struct mem_node *); 355static void mem_delete_fixup (struct mem_node *);
421static inline struct mem_node *mem_find (void *); 356static inline struct mem_node *mem_find (void *);
357#endif
422 358
423 359
424#if GC_MARK_STACK == GC_MARK_STACK_CHECK_GCPROS 360#if GC_MARK_STACK == GC_MARK_STACK_CHECK_GCPROS
@@ -587,39 +523,17 @@ xmalloc_get_size (unsigned char *ptr)
587} 523}
588 524
589 525
590/* The call depth in overrun_check functions. For example, this might happen:
591 xmalloc()
592 overrun_check_malloc()
593 -> malloc -> (via hook)_-> emacs_blocked_malloc
594 -> overrun_check_malloc
595 call malloc (hooks are NULL, so real malloc is called).
596 malloc returns 10000.
597 add overhead, return 10016.
598 <- (back in overrun_check_malloc)
599 add overhead again, return 10032
600 xmalloc returns 10032.
601
602 (time passes).
603
604 xfree(10032)
605 overrun_check_free(10032)
606 decrease overhead
607 free(10016) <- crash, because 10000 is the original pointer. */
608
609static ptrdiff_t check_depth;
610
611/* Like malloc, but wraps allocated block with header and trailer. */ 526/* Like malloc, but wraps allocated block with header and trailer. */
612 527
613static void * 528static void *
614overrun_check_malloc (size_t size) 529overrun_check_malloc (size_t size)
615{ 530{
616 register unsigned char *val; 531 register unsigned char *val;
617 int overhead = ++check_depth == 1 ? XMALLOC_OVERRUN_CHECK_OVERHEAD : 0; 532 if (SIZE_MAX - XMALLOC_OVERRUN_CHECK_OVERHEAD < size)
618 if (SIZE_MAX - overhead < size)
619 emacs_abort (); 533 emacs_abort ();
620 534
621 val = malloc (size + overhead); 535 val = malloc (size + XMALLOC_OVERRUN_CHECK_OVERHEAD);
622 if (val && check_depth == 1) 536 if (val)
623 { 537 {
624 memcpy (val, xmalloc_overrun_check_header, XMALLOC_OVERRUN_CHECK_SIZE); 538 memcpy (val, xmalloc_overrun_check_header, XMALLOC_OVERRUN_CHECK_SIZE);
625 val += XMALLOC_OVERRUN_CHECK_SIZE + XMALLOC_OVERRUN_SIZE_SIZE; 539 val += XMALLOC_OVERRUN_CHECK_SIZE + XMALLOC_OVERRUN_SIZE_SIZE;
@@ -627,7 +541,6 @@ overrun_check_malloc (size_t size)
627 memcpy (val + size, xmalloc_overrun_check_trailer, 541 memcpy (val + size, xmalloc_overrun_check_trailer,
628 XMALLOC_OVERRUN_CHECK_SIZE); 542 XMALLOC_OVERRUN_CHECK_SIZE);
629 } 543 }
630 --check_depth;
631 return val; 544 return val;
632} 545}
633 546
@@ -639,12 +552,10 @@ static void *
639overrun_check_realloc (void *block, size_t size) 552overrun_check_realloc (void *block, size_t size)
640{ 553{
641 register unsigned char *val = (unsigned char *) block; 554 register unsigned char *val = (unsigned char *) block;
642 int overhead = ++check_depth == 1 ? XMALLOC_OVERRUN_CHECK_OVERHEAD : 0; 555 if (SIZE_MAX - XMALLOC_OVERRUN_CHECK_OVERHEAD < size)
643 if (SIZE_MAX - overhead < size)
644 emacs_abort (); 556 emacs_abort ();
645 557
646 if (val 558 if (val
647 && check_depth == 1
648 && memcmp (xmalloc_overrun_check_header, 559 && memcmp (xmalloc_overrun_check_header,
649 val - XMALLOC_OVERRUN_CHECK_SIZE - XMALLOC_OVERRUN_SIZE_SIZE, 560 val - XMALLOC_OVERRUN_CHECK_SIZE - XMALLOC_OVERRUN_SIZE_SIZE,
650 XMALLOC_OVERRUN_CHECK_SIZE) == 0) 561 XMALLOC_OVERRUN_CHECK_SIZE) == 0)
@@ -658,9 +569,9 @@ overrun_check_realloc (void *block, size_t size)
658 memset (val, 0, XMALLOC_OVERRUN_CHECK_SIZE + XMALLOC_OVERRUN_SIZE_SIZE); 569 memset (val, 0, XMALLOC_OVERRUN_CHECK_SIZE + XMALLOC_OVERRUN_SIZE_SIZE);
659 } 570 }
660 571
661 val = realloc (val, size + overhead); 572 val = realloc (val, size + XMALLOC_OVERRUN_CHECK_OVERHEAD);
662 573
663 if (val && check_depth == 1) 574 if (val)
664 { 575 {
665 memcpy (val, xmalloc_overrun_check_header, XMALLOC_OVERRUN_CHECK_SIZE); 576 memcpy (val, xmalloc_overrun_check_header, XMALLOC_OVERRUN_CHECK_SIZE);
666 val += XMALLOC_OVERRUN_CHECK_SIZE + XMALLOC_OVERRUN_SIZE_SIZE; 577 val += XMALLOC_OVERRUN_CHECK_SIZE + XMALLOC_OVERRUN_SIZE_SIZE;
@@ -668,7 +579,6 @@ overrun_check_realloc (void *block, size_t size)
668 memcpy (val + size, xmalloc_overrun_check_trailer, 579 memcpy (val + size, xmalloc_overrun_check_trailer,
669 XMALLOC_OVERRUN_CHECK_SIZE); 580 XMALLOC_OVERRUN_CHECK_SIZE);
670 } 581 }
671 --check_depth;
672 return val; 582 return val;
673} 583}
674 584
@@ -679,9 +589,7 @@ overrun_check_free (void *block)
679{ 589{
680 unsigned char *val = (unsigned char *) block; 590 unsigned char *val = (unsigned char *) block;
681 591
682 ++check_depth;
683 if (val 592 if (val
684 && check_depth == 1
685 && memcmp (xmalloc_overrun_check_header, 593 && memcmp (xmalloc_overrun_check_header,
686 val - XMALLOC_OVERRUN_CHECK_SIZE - XMALLOC_OVERRUN_SIZE_SIZE, 594 val - XMALLOC_OVERRUN_CHECK_SIZE - XMALLOC_OVERRUN_SIZE_SIZE,
687 XMALLOC_OVERRUN_CHECK_SIZE) == 0) 595 XMALLOC_OVERRUN_CHECK_SIZE) == 0)
@@ -701,7 +609,6 @@ overrun_check_free (void *block)
701 } 609 }
702 610
703 free (val); 611 free (val);
704 --check_depth;
705} 612}
706 613
707#undef malloc 614#undef malloc
@@ -712,14 +619,33 @@ overrun_check_free (void *block)
712#define free overrun_check_free 619#define free overrun_check_free
713#endif 620#endif
714 621
715#ifdef SYNC_INPUT 622/* If compiled with XMALLOC_BLOCK_INPUT_CHECK, define a symbol
716/* When using SYNC_INPUT, we don't call malloc from a signal handler, so 623 BLOCK_INPUT_IN_MEMORY_ALLOCATORS that is visible to the debugger.
717 there's no need to block input around malloc. */ 624 If that variable is set, block input while in one of Emacs's memory
718#define MALLOC_BLOCK_INPUT ((void)0) 625 allocation functions. There should be no need for this debugging
719#define MALLOC_UNBLOCK_INPUT ((void)0) 626 option, since signal handlers do not allocate memory, but Emacs
627 formerly allocated memory in signal handlers and this compile-time
628 option remains as a way to help debug the issue should it rear its
629 ugly head again. */
630#ifdef XMALLOC_BLOCK_INPUT_CHECK
631bool block_input_in_memory_allocators EXTERNALLY_VISIBLE;
632static void
633malloc_block_input (void)
634{
635 if (block_input_in_memory_allocators)
636 BLOCK_INPUT;
637}
638static void
639malloc_unblock_input (void)
640{
641 if (block_input_in_memory_allocators)
642 UNBLOCK_INPUT;
643}
644# define MALLOC_BLOCK_INPUT malloc_block_input ()
645# define MALLOC_UNBLOCK_INPUT malloc_unblock_input ()
720#else 646#else
721#define MALLOC_BLOCK_INPUT BLOCK_INPUT 647# define MALLOC_BLOCK_INPUT ((void) 0)
722#define MALLOC_UNBLOCK_INPUT UNBLOCK_INPUT 648# define MALLOC_UNBLOCK_INPUT ((void) 0)
723#endif 649#endif
724 650
725/* Like malloc but check for no memory and block interrupt input.. */ 651/* Like malloc but check for no memory and block interrupt input.. */
@@ -788,8 +714,7 @@ xfree (void *block)
788 free (block); 714 free (block);
789 MALLOC_UNBLOCK_INPUT; 715 MALLOC_UNBLOCK_INPUT;
790 /* We don't call refill_memory_reserve here 716 /* We don't call refill_memory_reserve here
791 because that duplicates doing so in emacs_blocked_free 717 because in practice the call in r_alloc_free seems to suffice. */
792 and the criterion should go there. */
793} 718}
794 719
795 720
@@ -1216,256 +1141,6 @@ lisp_align_free (void *block)
1216} 1141}
1217 1142
1218 1143
1219#ifndef SYSTEM_MALLOC
1220
1221/* Arranging to disable input signals while we're in malloc.
1222
1223 This only works with GNU malloc. To help out systems which can't
1224 use GNU malloc, all the calls to malloc, realloc, and free
1225 elsewhere in the code should be inside a BLOCK_INPUT/UNBLOCK_INPUT
1226 pair; unfortunately, we have no idea what C library functions
1227 might call malloc, so we can't really protect them unless you're
1228 using GNU malloc. Fortunately, most of the major operating systems
1229 can use GNU malloc. */
1230
1231#ifndef SYNC_INPUT
1232/* When using SYNC_INPUT, we don't call malloc from a signal handler, so
1233 there's no need to block input around malloc. */
1234
1235#ifndef DOUG_LEA_MALLOC
1236extern void * (*__malloc_hook) (size_t, const void *);
1237extern void * (*__realloc_hook) (void *, size_t, const void *);
1238extern void (*__free_hook) (void *, const void *);
1239/* Else declared in malloc.h, perhaps with an extra arg. */
1240#endif /* DOUG_LEA_MALLOC */
1241static void * (*old_malloc_hook) (size_t, const void *);
1242static void * (*old_realloc_hook) (void *, size_t, const void*);
1243static void (*old_free_hook) (void*, const void*);
1244
1245#ifdef DOUG_LEA_MALLOC
1246# define BYTES_USED (mallinfo ().uordblks)
1247#else
1248# define BYTES_USED _bytes_used
1249#endif
1250
1251#ifdef GC_MALLOC_CHECK
1252static bool dont_register_blocks;
1253#endif
1254
1255static size_t bytes_used_when_reconsidered;
1256
1257/* Value of _bytes_used, when spare_memory was freed. */
1258
1259static size_t bytes_used_when_full;
1260
1261/* This function is used as the hook for free to call. */
1262
1263static void
1264emacs_blocked_free (void *ptr, const void *ptr2)
1265{
1266 BLOCK_INPUT_ALLOC;
1267
1268#ifdef GC_MALLOC_CHECK
1269 if (ptr)
1270 {
1271 struct mem_node *m;
1272
1273 m = mem_find (ptr);
1274 if (m == MEM_NIL || m->start != ptr)
1275 {
1276 fprintf (stderr,
1277 "Freeing `%p' which wasn't allocated with malloc\n", ptr);
1278 emacs_abort ();
1279 }
1280 else
1281 {
1282 /* fprintf (stderr, "free %p...%p (%p)\n", m->start, m->end, ptr); */
1283 mem_delete (m);
1284 }
1285 }
1286#endif /* GC_MALLOC_CHECK */
1287
1288 __free_hook = old_free_hook;
1289 free (ptr);
1290
1291 /* If we released our reserve (due to running out of memory),
1292 and we have a fair amount free once again,
1293 try to set aside another reserve in case we run out once more. */
1294 if (! NILP (Vmemory_full)
1295 /* Verify there is enough space that even with the malloc
1296 hysteresis this call won't run out again.
1297 The code here is correct as long as SPARE_MEMORY
1298 is substantially larger than the block size malloc uses. */
1299 && (bytes_used_when_full
1300 > ((bytes_used_when_reconsidered = BYTES_USED)
1301 + max (malloc_hysteresis, 4) * SPARE_MEMORY)))
1302 refill_memory_reserve ();
1303
1304 __free_hook = emacs_blocked_free;
1305 UNBLOCK_INPUT_ALLOC;
1306}
1307
1308
1309/* This function is the malloc hook that Emacs uses. */
1310
1311static void *
1312emacs_blocked_malloc (size_t size, const void *ptr)
1313{
1314 void *value;
1315
1316 BLOCK_INPUT_ALLOC;
1317 __malloc_hook = old_malloc_hook;
1318#ifdef DOUG_LEA_MALLOC
1319 /* Segfaults on my system. --lorentey */
1320 /* mallopt (M_TOP_PAD, malloc_hysteresis * 4096); */
1321#else
1322 __malloc_extra_blocks = malloc_hysteresis;
1323#endif
1324
1325 value = malloc (size);
1326
1327#ifdef GC_MALLOC_CHECK
1328 {
1329 struct mem_node *m = mem_find (value);
1330 if (m != MEM_NIL)
1331 {
1332 fprintf (stderr, "Malloc returned %p which is already in use\n",
1333 value);
1334 fprintf (stderr, "Region in use is %p...%p, %td bytes, type %d\n",
1335 m->start, m->end, (char *) m->end - (char *) m->start,
1336 m->type);
1337 emacs_abort ();
1338 }
1339
1340 if (!dont_register_blocks)
1341 {
1342 mem_insert (value, (char *) value + max (1, size), allocated_mem_type);
1343 allocated_mem_type = MEM_TYPE_NON_LISP;
1344 }
1345 }
1346#endif /* GC_MALLOC_CHECK */
1347
1348 __malloc_hook = emacs_blocked_malloc;
1349 UNBLOCK_INPUT_ALLOC;
1350
1351 /* fprintf (stderr, "%p malloc\n", value); */
1352 return value;
1353}
1354
1355
1356/* This function is the realloc hook that Emacs uses. */
1357
1358static void *
1359emacs_blocked_realloc (void *ptr, size_t size, const void *ptr2)
1360{
1361 void *value;
1362
1363 BLOCK_INPUT_ALLOC;
1364 __realloc_hook = old_realloc_hook;
1365
1366#ifdef GC_MALLOC_CHECK
1367 if (ptr)
1368 {
1369 struct mem_node *m = mem_find (ptr);
1370 if (m == MEM_NIL || m->start != ptr)
1371 {
1372 fprintf (stderr,
1373 "Realloc of %p which wasn't allocated with malloc\n",
1374 ptr);
1375 emacs_abort ();
1376 }
1377
1378 mem_delete (m);
1379 }
1380
1381 /* fprintf (stderr, "%p -> realloc\n", ptr); */
1382
1383 /* Prevent malloc from registering blocks. */
1384 dont_register_blocks = 1;
1385#endif /* GC_MALLOC_CHECK */
1386
1387 value = realloc (ptr, size);
1388
1389#ifdef GC_MALLOC_CHECK
1390 dont_register_blocks = 0;
1391
1392 {
1393 struct mem_node *m = mem_find (value);
1394 if (m != MEM_NIL)
1395 {
1396 fprintf (stderr, "Realloc returns memory that is already in use\n");
1397 emacs_abort ();
1398 }
1399
1400 /* Can't handle zero size regions in the red-black tree. */
1401 mem_insert (value, (char *) value + max (size, 1), MEM_TYPE_NON_LISP);
1402 }
1403
1404 /* fprintf (stderr, "%p <- realloc\n", value); */
1405#endif /* GC_MALLOC_CHECK */
1406
1407 __realloc_hook = emacs_blocked_realloc;
1408 UNBLOCK_INPUT_ALLOC;
1409
1410 return value;
1411}
1412
1413
1414#ifdef HAVE_PTHREAD
1415/* Called from Fdump_emacs so that when the dumped Emacs starts, it has a
1416 normal malloc. Some thread implementations need this as they call
1417 malloc before main. The pthread_self call in BLOCK_INPUT_ALLOC then
1418 calls malloc because it is the first call, and we have an endless loop. */
1419
1420void
1421reset_malloc_hooks (void)
1422{
1423 __free_hook = old_free_hook;
1424 __malloc_hook = old_malloc_hook;
1425 __realloc_hook = old_realloc_hook;
1426}
1427#endif /* HAVE_PTHREAD */
1428
1429
1430/* Called from main to set up malloc to use our hooks. */
1431
1432void
1433uninterrupt_malloc (void)
1434{
1435#ifdef HAVE_PTHREAD
1436#ifdef DOUG_LEA_MALLOC
1437 pthread_mutexattr_t attr;
1438
1439 /* GLIBC has a faster way to do this, but let's keep it portable.
1440 This is according to the Single UNIX Specification. */
1441 pthread_mutexattr_init (&attr);
1442 pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE);
1443 pthread_mutex_init (&alloc_mutex, &attr);
1444#else /* !DOUG_LEA_MALLOC */
1445 /* Some systems such as Solaris 2.6 don't have a recursive mutex,
1446 and the bundled gmalloc.c doesn't require it. */
1447 pthread_mutex_init (&alloc_mutex, NULL);
1448#endif /* !DOUG_LEA_MALLOC */
1449#endif /* HAVE_PTHREAD */
1450
1451 if (__free_hook != emacs_blocked_free)
1452 old_free_hook = __free_hook;
1453 __free_hook = emacs_blocked_free;
1454
1455 if (__malloc_hook != emacs_blocked_malloc)
1456 old_malloc_hook = __malloc_hook;
1457 __malloc_hook = emacs_blocked_malloc;
1458
1459 if (__realloc_hook != emacs_blocked_realloc)
1460 old_realloc_hook = __realloc_hook;
1461 __realloc_hook = emacs_blocked_realloc;
1462}
1463
1464#endif /* not SYNC_INPUT */
1465#endif /* not SYSTEM_MALLOC */
1466
1467
1468
1469/*********************************************************************** 1144/***********************************************************************
1470 Interval Allocation 1145 Interval Allocation
1471 ***********************************************************************/ 1146 ***********************************************************************/
@@ -1511,8 +1186,6 @@ make_interval (void)
1511{ 1186{
1512 INTERVAL val; 1187 INTERVAL val;
1513 1188
1514 /* eassert (!handling_signal); */
1515
1516 MALLOC_BLOCK_INPUT; 1189 MALLOC_BLOCK_INPUT;
1517 1190
1518 if (interval_free_list) 1191 if (interval_free_list)
@@ -1896,8 +1569,6 @@ allocate_string (void)
1896{ 1569{
1897 struct Lisp_String *s; 1570 struct Lisp_String *s;
1898 1571
1899 /* eassert (!handling_signal); */
1900
1901 MALLOC_BLOCK_INPUT; 1572 MALLOC_BLOCK_INPUT;
1902 1573
1903 /* If the free-list is empty, allocate a new string_block, and 1574 /* If the free-list is empty, allocate a new string_block, and
@@ -2589,8 +2260,6 @@ make_float (double float_value)
2589{ 2260{
2590 register Lisp_Object val; 2261 register Lisp_Object val;
2591 2262
2592 /* eassert (!handling_signal); */
2593
2594 MALLOC_BLOCK_INPUT; 2263 MALLOC_BLOCK_INPUT;
2595 2264
2596 if (float_free_list) 2265 if (float_free_list)
@@ -2698,8 +2367,6 @@ DEFUN ("cons", Fcons, Scons, 2, 2, 0,
2698{ 2367{
2699 register Lisp_Object val; 2368 register Lisp_Object val;
2700 2369
2701 /* eassert (!handling_signal); */
2702
2703 MALLOC_BLOCK_INPUT; 2370 MALLOC_BLOCK_INPUT;
2704 2371
2705 if (cons_free_list) 2372 if (cons_free_list)
@@ -3205,9 +2872,6 @@ allocate_vectorlike (ptrdiff_t len)
3205 2872
3206 MALLOC_BLOCK_INPUT; 2873 MALLOC_BLOCK_INPUT;
3207 2874
3208 /* This gets triggered by code which I haven't bothered to fix. --Stef */
3209 /* eassert (!handling_signal); */
3210
3211 if (len == 0) 2875 if (len == 0)
3212 p = XVECTOR (zero_vector); 2876 p = XVECTOR (zero_vector);
3213 else 2877 else
@@ -3492,8 +3156,6 @@ Its value and function definition are void, and its property list is nil. */)
3492 3156
3493 CHECK_STRING (name); 3157 CHECK_STRING (name);
3494 3158
3495 /* eassert (!handling_signal); */
3496
3497 MALLOC_BLOCK_INPUT; 3159 MALLOC_BLOCK_INPUT;
3498 3160
3499 if (symbol_free_list) 3161 if (symbol_free_list)
@@ -3578,8 +3240,6 @@ allocate_misc (enum Lisp_Misc_Type type)
3578{ 3240{
3579 Lisp_Object val; 3241 Lisp_Object val;
3580 3242
3581 /* eassert (!handling_signal); */
3582
3583 MALLOC_BLOCK_INPUT; 3243 MALLOC_BLOCK_INPUT;
3584 3244
3585 if (marker_free_list) 3245 if (marker_free_list)
@@ -3799,12 +3459,6 @@ memory_full (size_t nbytes)
3799 lisp_free (spare_memory[i]); 3459 lisp_free (spare_memory[i]);
3800 spare_memory[i] = 0; 3460 spare_memory[i] = 0;
3801 } 3461 }
3802
3803 /* Record the space now used. When it decreases substantially,
3804 we can refill the memory reserve. */
3805#if !defined SYSTEM_MALLOC && !defined SYNC_INPUT
3806 bytes_used_when_full = BYTES_USED;
3807#endif
3808 } 3462 }
3809 3463
3810 /* This used to call error, but if we've run out of memory, we could 3464 /* This used to call error, but if we've run out of memory, we could
@@ -3942,7 +3596,7 @@ mem_insert (void *start, void *end, enum mem_type type)
3942 3596
3943 /* Create a new node. */ 3597 /* Create a new node. */
3944#ifdef GC_MALLOC_CHECK 3598#ifdef GC_MALLOC_CHECK
3945 x = _malloc_internal (sizeof *x); 3599 x = malloc (sizeof *x);
3946 if (x == NULL) 3600 if (x == NULL)
3947 emacs_abort (); 3601 emacs_abort ();
3948#else 3602#else
@@ -4166,7 +3820,7 @@ mem_delete (struct mem_node *z)
4166 mem_delete_fixup (x); 3820 mem_delete_fixup (x);
4167 3821
4168#ifdef GC_MALLOC_CHECK 3822#ifdef GC_MALLOC_CHECK
4169 _free_internal (y); 3823 free (y);
4170#else 3824#else
4171 xfree (y); 3825 xfree (y);
4172#endif 3826#endif
@@ -5867,7 +5521,7 @@ mark_buffer (struct buffer *buffer)
5867} 5521}
5868 5522
5869/* Remove killed buffers or items whose car is a killed buffer from 5523/* Remove killed buffers or items whose car is a killed buffer from
5870 LIST, and mark other items. Return changed LIST, which is marked. */ 5524 LIST, and mark other items. Return changed LIST, which is marked. */
5871 5525
5872static Lisp_Object 5526static Lisp_Object
5873mark_discard_killed_buffers (Lisp_Object list) 5527mark_discard_killed_buffers (Lisp_Object list)
@@ -5889,6 +5543,7 @@ mark_discard_killed_buffers (Lisp_Object list)
5889 prev = &XCDR_AS_LVALUE (tail); 5543 prev = &XCDR_AS_LVALUE (tail);
5890 } 5544 }
5891 } 5545 }
5546 mark_object (tail);
5892 return list; 5547 return list;
5893} 5548}
5894 5549
@@ -6037,18 +5692,8 @@ mark_object (Lisp_Object arg)
6037 struct window *w = (struct window *) ptr; 5692 struct window *w = (struct window *) ptr;
6038 bool leaf = NILP (w->hchild) && NILP (w->vchild); 5693 bool leaf = NILP (w->hchild) && NILP (w->vchild);
6039 5694
6040 /* For live windows, Lisp code filters out killed buffers
6041 from both buffer lists. For dead windows, we do it here
6042 in attempt to help GC to reclaim killed buffers faster. */
6043 if (leaf && NILP (w->buffer))
6044 {
6045 wset_prev_buffers
6046 (w, mark_discard_killed_buffers (w->prev_buffers));
6047 wset_next_buffers
6048 (w, mark_discard_killed_buffers (w->next_buffers));
6049 }
6050
6051 mark_vectorlike (ptr); 5695 mark_vectorlike (ptr);
5696
6052 /* Mark glyphs for leaf windows. Marking window 5697 /* Mark glyphs for leaf windows. Marking window
6053 matrices is sufficient because frame matrices 5698 matrices is sufficient because frame matrices
6054 use the same glyph memory. */ 5699 use the same glyph memory. */
@@ -6057,6 +5702,15 @@ mark_object (Lisp_Object arg)
6057 mark_glyph_matrix (w->current_matrix); 5702 mark_glyph_matrix (w->current_matrix);
6058 mark_glyph_matrix (w->desired_matrix); 5703 mark_glyph_matrix (w->desired_matrix);
6059 } 5704 }
5705
5706 /* Filter out killed buffers from both buffer lists
5707 in attempt to help GC to reclaim killed buffers faster.
5708 We can do it elsewhere for live windows, but this is the
5709 best place to do it for dead windows. */
5710 wset_prev_buffers
5711 (w, mark_discard_killed_buffers (w->prev_buffers));
5712 wset_next_buffers
5713 (w, mark_discard_killed_buffers (w->next_buffers));
6060 } 5714 }
6061 break; 5715 break;
6062 5716
@@ -6767,12 +6421,6 @@ init_alloc_once (void)
6767 init_strings (); 6421 init_strings ();
6768 init_vectors (); 6422 init_vectors ();
6769 6423
6770#ifdef REL_ALLOC
6771 malloc_hysteresis = 32;
6772#else
6773 malloc_hysteresis = 0;
6774#endif
6775
6776 refill_memory_reserve (); 6424 refill_memory_reserve ();
6777 gc_cons_threshold = GC_DEFAULT_THRESHOLD; 6425 gc_cons_threshold = GC_DEFAULT_THRESHOLD;
6778} 6426}
diff --git a/src/atimer.c b/src/atimer.c
index 80b813fe4fe..5dbd807872a 100644
--- a/src/atimer.c
+++ b/src/atimer.c
@@ -369,7 +369,6 @@ run_timers (void)
369 if (! atimers) 369 if (! atimers)
370 pending_atimers = 0; 370 pending_atimers = 0;
371 371
372#ifdef SYNC_INPUT
373 if (pending_atimers) 372 if (pending_atimers)
374 pending_signals = 1; 373 pending_signals = 1;
375 else 374 else
@@ -377,10 +376,6 @@ run_timers (void)
377 pending_signals = interrupt_input_pending; 376 pending_signals = interrupt_input_pending;
378 set_alarm (); 377 set_alarm ();
379 } 378 }
380#else
381 if (! pending_atimers)
382 set_alarm ();
383#endif
384} 379}
385 380
386 381
@@ -391,11 +386,7 @@ static void
391handle_alarm_signal (int sig) 386handle_alarm_signal (int sig)
392{ 387{
393 pending_atimers = 1; 388 pending_atimers = 1;
394#ifdef SYNC_INPUT
395 pending_signals = 1; 389 pending_signals = 1;
396#else
397 run_timers ();
398#endif
399} 390}
400 391
401static void 392static void
diff --git a/src/bytecode.c b/src/bytecode.c
index b151078f60f..5f4fdcc5eff 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -458,7 +458,8 @@ unmark_byte_stack (void)
458 Fsignal (Qquit, Qnil); \ 458 Fsignal (Qquit, Qnil); \
459 AFTER_POTENTIAL_GC (); \ 459 AFTER_POTENTIAL_GC (); \
460 } \ 460 } \
461 ELSE_PENDING_SIGNALS \ 461 else if (pending_signals) \
462 process_pending_signals (); \
462 } while (0) 463 } while (0)
463 464
464 465
diff --git a/src/callproc.c b/src/callproc.c
index 9171337ee76..2604d295f3e 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -496,11 +496,6 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
496 register char **save_environ = environ; 496 register char **save_environ = environ;
497 register int fd1 = fd[1]; 497 register int fd1 = fd[1];
498 int fd_error = fd1; 498 int fd_error = fd1;
499#ifdef HAVE_WORKING_VFORK
500 sigset_t procmask;
501 sigset_t blocked;
502 struct sigaction sigpipe_action;
503#endif
504 499
505 if (fd_output >= 0) 500 if (fd_output >= 0)
506 fd1 = fd_output; 501 fd1 = fd_output;
@@ -587,17 +582,6 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
587 0, current_dir); 582 0, current_dir);
588#else /* not WINDOWSNT */ 583#else /* not WINDOWSNT */
589 584
590#ifdef HAVE_WORKING_VFORK
591 /* On many hosts (e.g. Solaris 2.4), if a vforked child calls `signal',
592 this sets the parent's signal handlers as well as the child's.
593 So delay all interrupts whose handlers the child might munge,
594 and record the current handlers so they can be restored later. */
595 sigemptyset (&blocked);
596 sigaddset (&blocked, SIGPIPE);
597 sigaction (SIGPIPE, 0, &sigpipe_action);
598 pthread_sigmask (SIG_BLOCK, &blocked, &procmask);
599#endif
600
601 BLOCK_INPUT; 585 BLOCK_INPUT;
602 586
603 /* vfork, and prevent local vars from being clobbered by the vfork. */ 587 /* vfork, and prevent local vars from being clobbered by the vfork. */
@@ -645,9 +629,6 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
645 /* GConf causes us to ignore SIGPIPE, make sure it is restored 629 /* GConf causes us to ignore SIGPIPE, make sure it is restored
646 in the child. */ 630 in the child. */
647 signal (SIGPIPE, SIG_DFL); 631 signal (SIGPIPE, SIG_DFL);
648#ifdef HAVE_WORKING_VFORK
649 pthread_sigmask (SIG_SETMASK, &procmask, 0);
650#endif
651 632
652 child_setup (filefd, fd1, fd_error, (char **) new_argv, 633 child_setup (filefd, fd1, fd_error, (char **) new_argv,
653 0, current_dir); 634 0, current_dir);
@@ -655,12 +636,6 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
655 636
656 UNBLOCK_INPUT; 637 UNBLOCK_INPUT;
657 638
658#ifdef HAVE_WORKING_VFORK
659 /* Restore the signal state. */
660 sigaction (SIGPIPE, &sigpipe_action, 0);
661 pthread_sigmask (SIG_SETMASK, &procmask, 0);
662#endif
663
664#endif /* not WINDOWSNT */ 639#endif /* not WINDOWSNT */
665 640
666 /* The MSDOS case did this already. */ 641 /* The MSDOS case did this already. */
diff --git a/src/conf_post.h b/src/conf_post.h
index 94934ffeadf..0c4d029bc5d 100644
--- a/src/conf_post.h
+++ b/src/conf_post.h
@@ -90,7 +90,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
90char *_getpty(); 90char *_getpty();
91#endif 91#endif
92 92
93#undef SA_RESTART /* not the same as defining BROKEN_SA_RESTART */
94#endif /* IRIX6_5 */ 93#endif /* IRIX6_5 */
95 94
96#ifdef MSDOS 95#ifdef MSDOS
diff --git a/src/dispnew.c b/src/dispnew.c
index 5827316a7b7..fc966581adb 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -5971,7 +5971,7 @@ sit_for (Lisp_Object timeout, bool reading, int do_display)
5971 5971
5972 5972
5973#ifdef USABLE_SIGIO 5973#ifdef USABLE_SIGIO
5974 gobble_input (0); 5974 gobble_input ();
5975#endif 5975#endif
5976 5976
5977 wait_reading_process_output (sec, nsec, reading ? -1 : 1, do_display, 5977 wait_reading_process_output (sec, nsec, reading ? -1 : 1, do_display,
diff --git a/src/emacs.c b/src/emacs.c
index 1416bf76c43..d4b52ab64ea 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -88,7 +88,7 @@ extern void moncontrol (int mode);
88#endif 88#endif
89 89
90static const char emacs_version[] = VERSION; 90static const char emacs_version[] = VERSION;
91static const char emacs_copyright[] = "Copyright (C) 2012 Free Software Foundation, Inc."; 91static const char emacs_copyright[] = COPYRIGHT;
92 92
93/* Empty lisp strings. To avoid having to build any others. */ 93/* Empty lisp strings. To avoid having to build any others. */
94Lisp_Object empty_unibyte_string, empty_multibyte_string; 94Lisp_Object empty_unibyte_string, empty_multibyte_string;
@@ -848,14 +848,10 @@ main (int argc, char **argv)
848 /* Arrange to get warning messages as memory fills up. */ 848 /* Arrange to get warning messages as memory fills up. */
849 memory_warnings (0, malloc_warning); 849 memory_warnings (0, malloc_warning);
850 850
851 /* Call malloc at least once, to run the initial __malloc_hook. 851 /* Call malloc at least once, to run malloc_initialize_hook.
852 Also call realloc and free for consistency. */ 852 Also call realloc and free for consistency. */
853 free (realloc (malloc (4), 4)); 853 free (realloc (malloc (4), 4));
854 854
855# ifndef SYNC_INPUT
856 /* Arrange to disable interrupt input inside malloc etc. */
857 uninterrupt_malloc ();
858# endif /* not SYNC_INPUT */
859#endif /* not SYSTEM_MALLOC */ 855#endif /* not SYSTEM_MALLOC */
860 856
861#if defined (MSDOS) || defined (WINDOWSNT) 857#if defined (MSDOS) || defined (WINDOWSNT)
@@ -2143,12 +2139,6 @@ You must run Emacs in batch mode in order to dump it. */)
2143 memory_warnings (my_edata, malloc_warning); 2139 memory_warnings (my_edata, malloc_warning);
2144 } 2140 }
2145#endif /* not WINDOWSNT */ 2141#endif /* not WINDOWSNT */
2146#if defined (HAVE_PTHREAD) && !defined SYNC_INPUT
2147 /* Pthread may call malloc before main, and then we will get an endless
2148 loop, because pthread_self (see alloc.c) calls malloc the first time
2149 it is called on some systems. */
2150 reset_malloc_hooks ();
2151#endif
2152#endif /* not SYSTEM_MALLOC */ 2142#endif /* not SYSTEM_MALLOC */
2153#ifdef DOUG_LEA_MALLOC 2143#ifdef DOUG_LEA_MALLOC
2154 malloc_state_ptr = malloc_get_state (); 2144 malloc_state_ptr = malloc_get_state ();
diff --git a/src/eval.c b/src/eval.c
index 6cca13a8fda..e47478bb1f1 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -117,12 +117,6 @@ static EMACS_INT when_entered_debugger;
117 117
118Lisp_Object Vsignaling_function; 118Lisp_Object Vsignaling_function;
119 119
120/* Set to non-zero while processing X events. Checked in Feval to
121 make sure the Lisp interpreter isn't called from a signal handler,
122 which is unsafe because the interpreter isn't reentrant. */
123
124int handling_signal;
125
126/* If non-nil, Lisp code must not be run since some part of Emacs is 120/* If non-nil, Lisp code must not be run since some part of Emacs is
127 in an inconsistent state. Currently, x-create-frame uses this to 121 in an inconsistent state. Currently, x-create-frame uses this to
128 avoid triggering window-configuration-change-hook while the new 122 avoid triggering window-configuration-change-hook while the new
@@ -1106,7 +1100,6 @@ unwind_to_catch (struct catchtag *catch, Lisp_Object value)
1106 /* Restore certain special C variables. */ 1100 /* Restore certain special C variables. */
1107 set_poll_suppress_count (catch->poll_suppress_count); 1101 set_poll_suppress_count (catch->poll_suppress_count);
1108 UNBLOCK_INPUT_TO (catch->interrupt_input_blocked); 1102 UNBLOCK_INPUT_TO (catch->interrupt_input_blocked);
1109 handling_signal = 0;
1110 immediate_quit = 0; 1103 immediate_quit = 0;
1111 1104
1112 do 1105 do
@@ -1486,7 +1479,7 @@ See also the function `condition-case'. */)
1486 struct handler *h; 1479 struct handler *h;
1487 struct backtrace *bp; 1480 struct backtrace *bp;
1488 1481
1489 immediate_quit = handling_signal = 0; 1482 immediate_quit = 0;
1490 abort_on_gc = 0; 1483 abort_on_gc = 0;
1491 if (gc_in_progress || waiting_for_input) 1484 if (gc_in_progress || waiting_for_input)
1492 emacs_abort (); 1485 emacs_abort ();
@@ -2039,9 +2032,6 @@ eval_sub (Lisp_Object form)
2039 struct backtrace backtrace; 2032 struct backtrace backtrace;
2040 struct gcpro gcpro1, gcpro2, gcpro3; 2033 struct gcpro gcpro1, gcpro2, gcpro3;
2041 2034
2042 if (handling_signal)
2043 emacs_abort ();
2044
2045 if (SYMBOLP (form)) 2035 if (SYMBOLP (form))
2046 { 2036 {
2047 /* Look up its binding in the lexical environment. 2037 /* Look up its binding in the lexical environment.
@@ -2409,6 +2399,7 @@ If it is a list of functions, those functions are called, in order,
2409with the given arguments ARGS, until one of them 2399with the given arguments ARGS, until one of them
2410returns a non-nil value. Then we return that value. 2400returns a non-nil value. Then we return that value.
2411However, if they all return nil, we return nil. 2401However, if they all return nil, we return nil.
2402If the value of HOOK is nil, this function returns nil.
2412 2403
2413Do not use `make-local-variable' to make a hook variable buffer-local. 2404Do not use `make-local-variable' to make a hook variable buffer-local.
2414Instead, use `add-hook' and specify t for the LOCAL argument. 2405Instead, use `add-hook' and specify t for the LOCAL argument.
@@ -2430,10 +2421,12 @@ DEFUN ("run-hook-with-args-until-failure", Frun_hook_with_args_until_failure,
2430HOOK should be a symbol, a hook variable. If HOOK has a non-nil 2421HOOK should be a symbol, a hook variable. If HOOK has a non-nil
2431value, that value may be a function or a list of functions to be 2422value, that value may be a function or a list of functions to be
2432called to run the hook. If the value is a function, it is called with 2423called to run the hook. If the value is a function, it is called with
2433the given arguments and its return value is returned. 2424the given arguments. Then we return nil if the function returns nil,
2425and t if it returns non-nil.
2434If it is a list of functions, those functions are called, in order, 2426If it is a list of functions, those functions are called, in order,
2435with the given arguments ARGS, until one of them returns nil. 2427with the given arguments ARGS, until one of them returns nil.
2436Then we return nil. However, if they all return non-nil, we return non-nil. 2428Then we return nil. However, if they all return non-nil, we return t.
2429If the value of HOOK is nil, this function returns t.
2437 2430
2438Do not use `make-local-variable' to make a hook variable buffer-local. 2431Do not use `make-local-variable' to make a hook variable buffer-local.
2439Instead, use `add-hook' and specify t for the LOCAL argument. 2432Instead, use `add-hook' and specify t for the LOCAL argument.
@@ -3104,8 +3097,6 @@ specbind (Lisp_Object symbol, Lisp_Object value)
3104{ 3097{
3105 struct Lisp_Symbol *sym; 3098 struct Lisp_Symbol *sym;
3106 3099
3107 eassert (!handling_signal);
3108
3109 CHECK_SYMBOL (symbol); 3100 CHECK_SYMBOL (symbol);
3110 sym = XSYMBOL (symbol); 3101 sym = XSYMBOL (symbol);
3111 if (specpdl_ptr == specpdl + specpdl_size) 3102 if (specpdl_ptr == specpdl + specpdl_size)
@@ -3199,8 +3190,6 @@ specbind (Lisp_Object symbol, Lisp_Object value)
3199void 3190void
3200record_unwind_protect (Lisp_Object (*function) (Lisp_Object), Lisp_Object arg) 3191record_unwind_protect (Lisp_Object (*function) (Lisp_Object), Lisp_Object arg)
3201{ 3192{
3202 eassert (!handling_signal);
3203
3204 if (specpdl_ptr == specpdl + specpdl_size) 3193 if (specpdl_ptr == specpdl + specpdl_size)
3205 grow_specpdl (); 3194 grow_specpdl ();
3206 specpdl_ptr->func = function; 3195 specpdl_ptr->func = function;
diff --git a/src/fileio.c b/src/fileio.c
index ca71af7ed95..6c4e34d7312 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -2833,9 +2833,8 @@ or if SELinux is disabled, or if Emacs lacks SELinux support. */)
2833 if (context_range_get (context)) 2833 if (context_range_get (context))
2834 values[3] = build_string (context_range_get (context)); 2834 values[3] = build_string (context_range_get (context));
2835 context_free (context); 2835 context_free (context);
2836 freecon (con);
2836 } 2837 }
2837 if (con)
2838 freecon (con);
2839 } 2838 }
2840#endif 2839#endif
2841 2840
@@ -2914,12 +2913,10 @@ compiled with SELinux support. */)
2914 report_file_error ("Doing lsetfilecon", Fcons (absname, Qnil)); 2913 report_file_error ("Doing lsetfilecon", Fcons (absname, Qnil));
2915 2914
2916 context_free (parsed_con); 2915 context_free (parsed_con);
2916 freecon (con);
2917 } 2917 }
2918 else 2918 else
2919 report_file_error ("Doing lgetfilecon", Fcons (absname, Qnil)); 2919 report_file_error ("Doing lgetfilecon", Fcons (absname, Qnil));
2920
2921 if (con)
2922 freecon (con);
2923 } 2920 }
2924#endif 2921#endif
2925 2922
diff --git a/src/font.c b/src/font.c
index fc970254a62..1f22fee88ee 100644
--- a/src/font.c
+++ b/src/font.c
@@ -4303,7 +4303,7 @@ GSTRING. */)
4303{ 4303{
4304 struct font *font; 4304 struct font *font;
4305 Lisp_Object font_object, n, glyph; 4305 Lisp_Object font_object, n, glyph;
4306 ptrdiff_t i, j, from, to; 4306 ptrdiff_t i, from, to;
4307 4307
4308 if (! composition_gstring_p (gstring)) 4308 if (! composition_gstring_p (gstring))
4309 signal_error ("Invalid glyph-string: ", gstring); 4309 signal_error ("Invalid glyph-string: ", gstring);
diff --git a/src/frame.c b/src/frame.c
index 6930dac3ce8..f3d16171516 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -3897,6 +3897,95 @@ x_default_parameter (struct frame *f, Lisp_Object alist, Lisp_Object prop,
3897} 3897}
3898 3898
3899 3899
3900#if !defined (HAVE_X_WINDOWS) && defined (NoValue)
3901
3902/*
3903 * XParseGeometry parses strings of the form
3904 * "=<width>x<height>{+-}<xoffset>{+-}<yoffset>", where
3905 * width, height, xoffset, and yoffset are unsigned integers.
3906 * Example: "=80x24+300-49"
3907 * The equal sign is optional.
3908 * It returns a bitmask that indicates which of the four values
3909 * were actually found in the string. For each value found,
3910 * the corresponding argument is updated; for each value
3911 * not found, the corresponding argument is left unchanged.
3912 */
3913
3914static int
3915XParseGeometry (char *string,
3916 int *x, int *y,
3917 unsigned int *width, unsigned int *height)
3918{
3919 int mask = NoValue;
3920 char *strind;
3921 unsigned long int tempWidth, tempHeight;
3922 long int tempX, tempY;
3923 char *nextCharacter;
3924
3925 if (string == NULL || *string == '\0')
3926 return mask;
3927 if (*string == '=')
3928 string++; /* ignore possible '=' at beg of geometry spec */
3929
3930 strind = string;
3931 if (*strind != '+' && *strind != '-' && *strind != 'x')
3932 {
3933 tempWidth = strtoul (strind, &nextCharacter, 10);
3934 if (strind == nextCharacter)
3935 return 0;
3936 strind = nextCharacter;
3937 mask |= WidthValue;
3938 }
3939
3940 if (*strind == 'x' || *strind == 'X')
3941 {
3942 strind++;
3943 tempHeight = strtoul (strind, &nextCharacter, 10);
3944 if (strind == nextCharacter)
3945 return 0;
3946 strind = nextCharacter;
3947 mask |= HeightValue;
3948 }
3949
3950 if (*strind == '+' || *strind == '-')
3951 {
3952 if (*strind == '-')
3953 mask |= XNegative;
3954 tempX = strtol (strind, &nextCharacter, 10);
3955 if (strind == nextCharacter)
3956 return 0;
3957 strind = nextCharacter;
3958 mask |= XValue;
3959 if (*strind == '+' || *strind == '-')
3960 {
3961 if (*strind == '-')
3962 mask |= YNegative;
3963 tempY = strtol (strind, &nextCharacter, 10);
3964 if (strind == nextCharacter)
3965 return 0;
3966 strind = nextCharacter;
3967 mask |= YValue;
3968 }
3969 }
3970
3971 /* If strind isn't at the end of the string then it's an invalid
3972 geometry specification. */
3973
3974 if (*strind != '\0')
3975 return 0;
3976
3977 if (mask & XValue)
3978 *x = clip_to_bounds (INT_MIN, tempX, INT_MAX);
3979 if (mask & YValue)
3980 *y = clip_to_bounds (INT_MIN, tempY, INT_MAX);
3981 if (mask & WidthValue)
3982 *width = min (tempWidth, UINT_MAX);
3983 if (mask & HeightValue)
3984 *height = min (tempHeight, UINT_MAX);
3985 return mask;
3986}
3987
3988#endif /* !defined (HAVE_X_WINDOWS) && defined (NoValue) */
3900 3989
3901 3990
3902/* NS used to define x-parse-geometry in ns-win.el, but that confused 3991/* NS used to define x-parse-geometry in ns-win.el, but that confused
@@ -3917,15 +4006,16 @@ or a list (- N) meaning -N pixels relative to bottom/right corner.
3917On Nextstep, this just calls `ns-parse-geometry'. */) 4006On Nextstep, this just calls `ns-parse-geometry'. */)
3918 (Lisp_Object string) 4007 (Lisp_Object string)
3919{ 4008{
3920#ifdef HAVE_NS
3921 return call1 (Qns_parse_geometry, string);
3922#else
3923 int geometry, x, y; 4009 int geometry, x, y;
3924 unsigned int width, height; 4010 unsigned int width, height;
3925 Lisp_Object result; 4011 Lisp_Object result;
3926 4012
3927 CHECK_STRING (string); 4013 CHECK_STRING (string);
3928 4014
4015#ifdef HAVE_NS
4016 if (strchr (SSDATA (string), ' ') != NULL)
4017 return call1 (Qns_parse_geometry, string);
4018#endif
3929 geometry = XParseGeometry (SSDATA (string), 4019 geometry = XParseGeometry (SSDATA (string),
3930 &x, &y, &width, &height); 4020 &x, &y, &width, &height);
3931 result = Qnil; 4021 result = Qnil;
@@ -3961,7 +4051,6 @@ On Nextstep, this just calls `ns-parse-geometry'. */)
3961 result = Fcons (Fcons (Qheight, make_number (height)), result); 4051 result = Fcons (Fcons (Qheight, make_number (height)), result);
3962 4052
3963 return result; 4053 return result;
3964#endif /* HAVE_NS */
3965} 4054}
3966 4055
3967 4056
diff --git a/src/image.c b/src/image.c
index 8fc1c8637eb..8d690df8abb 100644
--- a/src/image.c
+++ b/src/image.c
@@ -590,9 +590,15 @@ define_image_type (struct image_type *type, int loaded)
590 success = Qnil; 590 success = Qnil;
591 else 591 else
592 { 592 {
593 struct image_type *p;
594 Lisp_Object target_type = *(type->type);
595 for (p = image_types; p; p = p->next)
596 if (EQ (*(p->type), target_type))
597 return Qt;
598
593 /* Make a copy of TYPE to avoid a bus error in a dumped Emacs. 599 /* Make a copy of TYPE to avoid a bus error in a dumped Emacs.
594 The initialized data segment is read-only. */ 600 The initialized data segment is read-only. */
595 struct image_type *p = xmalloc (sizeof *p); 601 p = xmalloc (sizeof *p);
596 *p = *type; 602 *p = *type;
597 p->next = image_types; 603 p->next = image_types;
598 image_types = p; 604 image_types = p;
diff --git a/src/intervals.c b/src/intervals.c
index 5a47cacb2dd..584ee1e923d 100644
--- a/src/intervals.c
+++ b/src/intervals.c
@@ -673,8 +673,7 @@ find_interval (register INTERVAL tree, register ptrdiff_t position)
673 673
674 eassert (relative_position <= TOTAL_LENGTH (tree)); 674 eassert (relative_position <= TOTAL_LENGTH (tree));
675 675
676 if (!handling_signal) 676 tree = balance_possible_root_interval (tree);
677 tree = balance_possible_root_interval (tree);
678 677
679 while (1) 678 while (1)
680 { 679 {
diff --git a/src/keyboard.c b/src/keyboard.c
index d164083fb86..098d3530ef8 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -84,9 +84,7 @@ int interrupt_input_pending;
84 pending_atimers separately, to reduce code size. So, any code that 84 pending_atimers separately, to reduce code size. So, any code that
85 changes interrupt_input_pending or pending_atimers should update 85 changes interrupt_input_pending or pending_atimers should update
86 this too. */ 86 this too. */
87#ifdef SYNC_INPUT
88int pending_signals; 87int pending_signals;
89#endif
90 88
91#define KBD_BUFFER_SIZE 4096 89#define KBD_BUFFER_SIZE 4096
92 90
@@ -415,7 +413,7 @@ static EMACS_TIME timer_last_idleness_start_time;
415/* Function for init_keyboard to call with no args (if nonzero). */ 413/* Function for init_keyboard to call with no args (if nonzero). */
416static void (*keyboard_init_hook) (void); 414static void (*keyboard_init_hook) (void);
417 415
418static int read_avail_input (int); 416static int read_avail_input (void);
419static void get_input_pending (int *, int); 417static void get_input_pending (int *, int);
420static int readable_events (int); 418static int readable_events (int);
421static Lisp_Object read_char_x_menu_prompt (ptrdiff_t, Lisp_Object *, 419static Lisp_Object read_char_x_menu_prompt (ptrdiff_t, Lisp_Object *,
@@ -450,7 +448,7 @@ static void timer_stop_idle (void);
450static void timer_resume_idle (void); 448static void timer_resume_idle (void);
451static void deliver_user_signal (int); 449static void deliver_user_signal (int);
452static char *find_user_signal_name (int); 450static char *find_user_signal_name (int);
453static int store_user_signal_events (void); 451static void store_user_signal_events (void);
454 452
455/* These setters are used only in this file, so they can be private. */ 453/* These setters are used only in this file, so they can be private. */
456static inline void 454static inline void
@@ -2010,17 +2008,9 @@ static struct atimer *poll_timer;
2010void 2008void
2011poll_for_input_1 (void) 2009poll_for_input_1 (void)
2012{ 2010{
2013/* Tell ns_read_socket() it is being called asynchronously so it can avoid
2014 doing anything dangerous. */
2015#ifdef HAVE_NS
2016 ++handling_signal;
2017#endif
2018 if (interrupt_input_blocked == 0 2011 if (interrupt_input_blocked == 0
2019 && !waiting_for_input) 2012 && !waiting_for_input)
2020 read_avail_input (0); 2013 read_avail_input ();
2021#ifdef HAVE_NS
2022 --handling_signal;
2023#endif
2024} 2014}
2025 2015
2026/* Timer callback function for poll_timer. TIMER is equal to 2016/* Timer callback function for poll_timer. TIMER is equal to
@@ -2031,12 +2021,8 @@ poll_for_input (struct atimer *timer)
2031{ 2021{
2032 if (poll_suppress_count == 0) 2022 if (poll_suppress_count == 0)
2033 { 2023 {
2034#ifdef SYNC_INPUT
2035 interrupt_input_pending = 1; 2024 interrupt_input_pending = 1;
2036 pending_signals = 1; 2025 pending_signals = 1;
2037#else
2038 poll_for_input_1 ();
2039#endif
2040 } 2026 }
2041} 2027}
2042 2028
@@ -3857,7 +3843,7 @@ kbd_buffer_get_event (KBOARD **kbp,
3857 interrupt handlers have not read it, read it now. */ 3843 interrupt handlers have not read it, read it now. */
3858 3844
3859#ifdef USABLE_SIGIO 3845#ifdef USABLE_SIGIO
3860 gobble_input (0); 3846 gobble_input ();
3861#endif 3847#endif
3862 if (kbd_fetch_ptr != kbd_store_ptr) 3848 if (kbd_fetch_ptr != kbd_store_ptr)
3863 break; 3849 break;
@@ -3883,8 +3869,7 @@ kbd_buffer_get_event (KBOARD **kbp,
3883 wait_reading_process_output (0, 0, -1, 1, Qnil, NULL, 0); 3869 wait_reading_process_output (0, 0, -1, 1, Qnil, NULL, 0);
3884 3870
3885 if (!interrupt_input && kbd_fetch_ptr == kbd_store_ptr) 3871 if (!interrupt_input && kbd_fetch_ptr == kbd_store_ptr)
3886 /* Pass 1 for EXPECT since we just waited to have input. */ 3872 read_avail_input ();
3887 read_avail_input (1);
3888 } 3873 }
3889 3874
3890 if (CONSP (Vunread_command_events)) 3875 if (CONSP (Vunread_command_events))
@@ -6748,14 +6733,14 @@ get_input_pending (int *addr, int flags)
6748 return; 6733 return;
6749 6734
6750 /* Try to read some input and see how much we get. */ 6735 /* Try to read some input and see how much we get. */
6751 gobble_input (0); 6736 gobble_input ();
6752 *addr = (!NILP (Vquit_flag) || readable_events (flags)); 6737 *addr = (!NILP (Vquit_flag) || readable_events (flags));
6753} 6738}
6754 6739
6755/* Interface to read_avail_input, blocking SIGIO or SIGALRM if necessary. */ 6740/* Interface to read_avail_input, blocking SIGIO or SIGALRM if necessary. */
6756 6741
6757void 6742void
6758gobble_input (int expected) 6743gobble_input (void)
6759{ 6744{
6760#ifdef USABLE_SIGIO 6745#ifdef USABLE_SIGIO
6761 if (interrupt_input) 6746 if (interrupt_input)
@@ -6764,7 +6749,7 @@ gobble_input (int expected)
6764 sigemptyset (&blocked); 6749 sigemptyset (&blocked);
6765 sigaddset (&blocked, SIGIO); 6750 sigaddset (&blocked, SIGIO);
6766 pthread_sigmask (SIG_BLOCK, &blocked, &procmask); 6751 pthread_sigmask (SIG_BLOCK, &blocked, &procmask);
6767 read_avail_input (expected); 6752 read_avail_input ();
6768 pthread_sigmask (SIG_SETMASK, &procmask, 0); 6753 pthread_sigmask (SIG_SETMASK, &procmask, 0);
6769 } 6754 }
6770 else 6755 else
@@ -6778,13 +6763,13 @@ gobble_input (int expected)
6778 sigemptyset (&blocked); 6763 sigemptyset (&blocked);
6779 sigaddset (&blocked, SIGALRM); 6764 sigaddset (&blocked, SIGALRM);
6780 pthread_sigmask (SIG_BLOCK, &blocked, &procmask); 6765 pthread_sigmask (SIG_BLOCK, &blocked, &procmask);
6781 read_avail_input (expected); 6766 read_avail_input ();
6782 pthread_sigmask (SIG_SETMASK, &procmask, 0); 6767 pthread_sigmask (SIG_SETMASK, &procmask, 0);
6783 } 6768 }
6784 else 6769 else
6785#endif 6770#endif
6786#endif 6771#endif
6787 read_avail_input (expected); 6772 read_avail_input ();
6788} 6773}
6789 6774
6790/* Put a BUFFER_SWITCH_EVENT in the buffer 6775/* Put a BUFFER_SWITCH_EVENT in the buffer
@@ -6840,15 +6825,14 @@ record_asynch_buffer_change (void)
6840 this is a bad time to try to read input. */ 6825 this is a bad time to try to read input. */
6841 6826
6842static int 6827static int
6843read_avail_input (int expected) 6828read_avail_input (void)
6844{ 6829{
6845 int nread = 0; 6830 int nread = 0;
6846 int err = 0; 6831 int err = 0;
6847 struct terminal *t; 6832 struct terminal *t;
6848 6833
6849 /* Store pending user signal events, if any. */ 6834 /* Store pending user signal events, if any. */
6850 if (store_user_signal_events ()) 6835 store_user_signal_events ();
6851 expected = 0;
6852 6836
6853 /* Loop through the available terminals, and call their input hooks. */ 6837 /* Loop through the available terminals, and call their input hooks. */
6854 t = terminal_list; 6838 t = terminal_list;
@@ -6865,11 +6849,8 @@ read_avail_input (int expected)
6865 hold_quit.kind = NO_EVENT; 6849 hold_quit.kind = NO_EVENT;
6866 6850
6867 /* No need for FIONREAD or fcntl; just say don't wait. */ 6851 /* No need for FIONREAD or fcntl; just say don't wait. */
6868 while (nr = (*t->read_socket_hook) (t, expected, &hold_quit), nr > 0) 6852 while (0 < (nr = (*t->read_socket_hook) (t, &hold_quit)))
6869 { 6853 nread += nr;
6870 nread += nr;
6871 expected = 0;
6872 }
6873 6854
6874 if (nr == -1) /* Not OK to read input now. */ 6855 if (nr == -1) /* Not OK to read input now. */
6875 { 6856 {
@@ -6964,7 +6945,6 @@ decode_keyboard_code (struct tty_display_info *tty,
6964 6945
6965int 6946int
6966tty_read_avail_input (struct terminal *terminal, 6947tty_read_avail_input (struct terminal *terminal,
6967 int expected,
6968 struct input_event *hold_quit) 6948 struct input_event *hold_quit)
6969{ 6949{
6970 /* Using KBD_BUFFER_SIZE - 1 here avoids reading more than 6950 /* Using KBD_BUFFER_SIZE - 1 here avoids reading more than
@@ -7176,36 +7156,23 @@ tty_read_avail_input (struct terminal *terminal,
7176 return nread; 7156 return nread;
7177} 7157}
7178 7158
7179#if defined SYNC_INPUT || defined USABLE_SIGIO
7180static void 7159static void
7181handle_async_input (void) 7160handle_async_input (void)
7182{ 7161{
7183 interrupt_input_pending = 0; 7162 interrupt_input_pending = 0;
7184#ifdef SYNC_INPUT
7185 pending_signals = pending_atimers; 7163 pending_signals = pending_atimers;
7186#endif 7164
7187/* Tell ns_read_socket() it is being called asynchronously so it can avoid
7188 doing anything dangerous. */
7189#ifdef HAVE_NS
7190 ++handling_signal;
7191#endif
7192 while (1) 7165 while (1)
7193 { 7166 {
7194 int nread; 7167 int nread = read_avail_input ();
7195 nread = read_avail_input (1);
7196 /* -1 means it's not ok to read the input now. 7168 /* -1 means it's not ok to read the input now.
7197 UNBLOCK_INPUT will read it later; now, avoid infinite loop. 7169 UNBLOCK_INPUT will read it later; now, avoid infinite loop.
7198 0 means there was no keyboard input available. */ 7170 0 means there was no keyboard input available. */
7199 if (nread <= 0) 7171 if (nread <= 0)
7200 break; 7172 break;
7201 } 7173 }
7202#ifdef HAVE_NS
7203 --handling_signal;
7204#endif
7205} 7174}
7206#endif /* SYNC_INPUT || USABLE_SIGIO */
7207 7175
7208#ifdef SYNC_INPUT
7209void 7176void
7210process_pending_signals (void) 7177process_pending_signals (void)
7211{ 7178{
@@ -7213,24 +7180,17 @@ process_pending_signals (void)
7213 handle_async_input (); 7180 handle_async_input ();
7214 do_pending_atimers (); 7181 do_pending_atimers ();
7215} 7182}
7216#endif
7217 7183
7218#ifdef USABLE_SIGIO 7184#ifdef USABLE_SIGIO
7219 7185
7220static void 7186static void
7221handle_input_available_signal (int sig) 7187handle_input_available_signal (int sig)
7222{ 7188{
7223#ifdef SYNC_INPUT
7224 interrupt_input_pending = 1; 7189 interrupt_input_pending = 1;
7225 pending_signals = 1; 7190 pending_signals = 1;
7226#endif
7227 7191
7228 if (input_available_clear_time) 7192 if (input_available_clear_time)
7229 *input_available_clear_time = make_emacs_time (0, 0); 7193 *input_available_clear_time = make_emacs_time (0, 0);
7230
7231#ifndef SYNC_INPUT
7232 handle_async_input ();
7233#endif
7234} 7194}
7235 7195
7236static void 7196static void
@@ -7356,25 +7316,25 @@ find_user_signal_name (int sig)
7356 return NULL; 7316 return NULL;
7357} 7317}
7358 7318
7359static int 7319static void
7360store_user_signal_events (void) 7320store_user_signal_events (void)
7361{ 7321{
7362 struct user_signal_info *p; 7322 struct user_signal_info *p;
7363 struct input_event buf; 7323 struct input_event buf;
7364 int nstored = 0; 7324 bool buf_initialized = 0;
7365 7325
7366 for (p = user_signals; p; p = p->next) 7326 for (p = user_signals; p; p = p->next)
7367 if (p->npending > 0) 7327 if (p->npending > 0)
7368 { 7328 {
7369 sigset_t blocked, procmask; 7329 sigset_t blocked, procmask;
7370 7330
7371 if (nstored == 0) 7331 if (! buf_initialized)
7372 { 7332 {
7373 memset (&buf, 0, sizeof buf); 7333 memset (&buf, 0, sizeof buf);
7374 buf.kind = USER_SIGNAL_EVENT; 7334 buf.kind = USER_SIGNAL_EVENT;
7375 buf.frame_or_window = selected_frame; 7335 buf.frame_or_window = selected_frame;
7336 buf_initialized = 1;
7376 } 7337 }
7377 nstored += p->npending;
7378 7338
7379 sigemptyset (&blocked); 7339 sigemptyset (&blocked);
7380 sigaddset (&blocked, p->sig); 7340 sigaddset (&blocked, p->sig);
@@ -7390,8 +7350,6 @@ store_user_signal_events (void)
7390 7350
7391 pthread_sigmask (SIG_SETMASK, &procmask, 0); 7351 pthread_sigmask (SIG_SETMASK, &procmask, 0);
7392 } 7352 }
7393
7394 return nstored;
7395} 7353}
7396 7354
7397 7355
@@ -11365,9 +11323,7 @@ init_keyboard (void)
11365 input_pending = 0; 11323 input_pending = 0;
11366 interrupt_input_blocked = 0; 11324 interrupt_input_blocked = 0;
11367 interrupt_input_pending = 0; 11325 interrupt_input_pending = 0;
11368#ifdef SYNC_INPUT
11369 pending_signals = 0; 11326 pending_signals = 0;
11370#endif
11371 11327
11372 /* This means that command_loop_1 won't try to select anything the first 11328 /* This means that command_loop_1 won't try to select anything the first
11373 time through. */ 11329 time through. */
diff --git a/src/keyboard.h b/src/keyboard.h
index 91484b3649b..3601f68be9f 100644
--- a/src/keyboard.h
+++ b/src/keyboard.h
@@ -523,7 +523,7 @@ extern void input_poll_signal (int);
523extern void start_polling (void); 523extern void start_polling (void);
524extern void stop_polling (void); 524extern void stop_polling (void);
525extern void set_poll_suppress_count (int); 525extern void set_poll_suppress_count (int);
526extern void gobble_input (int); 526extern void gobble_input (void);
527extern int input_polling_used (void); 527extern int input_polling_used (void);
528extern void clear_input_pending (void); 528extern void clear_input_pending (void);
529extern int requeued_events_pending_p (void); 529extern int requeued_events_pending_p (void);
@@ -547,8 +547,7 @@ extern Lisp_Object menu_item_eval_property (Lisp_Object);
547extern int kbd_buffer_events_waiting (int); 547extern int kbd_buffer_events_waiting (int);
548extern void add_user_signal (int, const char *); 548extern void add_user_signal (int, const char *);
549 549
550extern int tty_read_avail_input (struct terminal *, int, 550extern int tty_read_avail_input (struct terminal *, struct input_event *);
551 struct input_event *);
552extern EMACS_TIME timer_check (void); 551extern EMACS_TIME timer_check (void);
553extern void mark_kboards (void); 552extern void mark_kboards (void);
554 553
diff --git a/src/lisp.h b/src/lisp.h
index 447c6bd296b..3a473a60b48 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -2107,22 +2107,16 @@ extern char *stack_bottom;
2107 If quit-flag is set to `kill-emacs' the SIGINT handler has received 2107 If quit-flag is set to `kill-emacs' the SIGINT handler has received
2108 a request to exit Emacs when it is safe to do. */ 2108 a request to exit Emacs when it is safe to do. */
2109 2109
2110#ifdef SYNC_INPUT
2111extern void process_pending_signals (void); 2110extern void process_pending_signals (void);
2112extern int pending_signals; 2111extern int pending_signals;
2113#define ELSE_PENDING_SIGNALS \
2114 else if (pending_signals) \
2115 process_pending_signals ();
2116#else /* not SYNC_INPUT */
2117#define ELSE_PENDING_SIGNALS
2118#endif /* not SYNC_INPUT */
2119 2112
2120extern void process_quit_flag (void); 2113extern void process_quit_flag (void);
2121#define QUIT \ 2114#define QUIT \
2122 do { \ 2115 do { \
2123 if (!NILP (Vquit_flag) && NILP (Vinhibit_quit)) \ 2116 if (!NILP (Vquit_flag) && NILP (Vinhibit_quit)) \
2124 process_quit_flag (); \ 2117 process_quit_flag (); \
2125 ELSE_PENDING_SIGNALS \ 2118 else if (pending_signals) \
2119 process_pending_signals (); \
2126 } while (0) 2120 } while (0)
2127 2121
2128 2122
@@ -2846,8 +2840,6 @@ extern void memory_warnings (void *, void (*warnfun) (const char *));
2846/* Defined in alloc.c. */ 2840/* Defined in alloc.c. */
2847extern void check_pure_size (void); 2841extern void check_pure_size (void);
2848extern void allocate_string_data (struct Lisp_String *, EMACS_INT, EMACS_INT); 2842extern void allocate_string_data (struct Lisp_String *, EMACS_INT, EMACS_INT);
2849extern void reset_malloc_hooks (void);
2850extern void uninterrupt_malloc (void);
2851extern void malloc_warning (const char *); 2843extern void malloc_warning (const char *);
2852extern _Noreturn void memory_full (size_t); 2844extern _Noreturn void memory_full (size_t);
2853extern _Noreturn void buffer_memory_full (ptrdiff_t); 2845extern _Noreturn void buffer_memory_full (ptrdiff_t);
@@ -3043,7 +3035,6 @@ extern Lisp_Object Qand_rest;
3043extern Lisp_Object Vautoload_queue; 3035extern Lisp_Object Vautoload_queue;
3044extern Lisp_Object Vsignaling_function; 3036extern Lisp_Object Vsignaling_function;
3045extern Lisp_Object inhibit_lisp_code; 3037extern Lisp_Object inhibit_lisp_code;
3046extern int handling_signal;
3047#if BYTE_MARK_STACK 3038#if BYTE_MARK_STACK
3048extern struct catchtag *catchlist; 3039extern struct catchtag *catchlist;
3049extern struct handler *handlerlist; 3040extern struct handler *handlerlist;
diff --git a/src/ns.mk b/src/ns.mk
deleted file mode 100644
index 77fbf5845d9..00000000000
--- a/src/ns.mk
+++ /dev/null
@@ -1,39 +0,0 @@
1### autodeps.mk --- src/Makefile fragment for GNU Emacs
2
3## Copyright (C) 2008-2012 Free Software Foundation, Inc.
4
5## This file is part of GNU Emacs.
6
7## GNU Emacs is free software: you can redistribute it and/or modify
8## it under the terms of the GNU General Public License as published by
9## the Free Software Foundation, either version 3 of the License, or
10## (at your option) any later version.
11##
12## GNU Emacs is distributed in the hope that it will be useful,
13## but WITHOUT ANY WARRANTY; without even the implied warranty of
14## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15## GNU General Public License for more details.
16##
17## You should have received a copy of the GNU General Public License
18## along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
19
20### Commentary:
21
22## This is inserted in src/Makefile if HAVE_NS.
23
24## The only reason this is in a separate file is because $ns_appdir,
25## which appears as a target, is empty on non-NS builds. Some makes
26## do not like empty targets, even if they are never used.
27
28${ns_appdir}: ${ns_appsrc}
29 rm -fr ${ns_appdir}
30 ${MKDIR_P} ${ns_appdir}
31 ( cd ${ns_appsrc} ; tar cfh - . ) | ( cd ${ns_appdir} ; umask 022; tar xf - )
32
33${ns_appbindir}/Emacs: emacs${EXEEXT}
34 ${MKDIR_P} ${ns_appbindir}
35 cp -f emacs${EXEEXT} ${ns_appbindir}/Emacs
36
37ns-app: ${ns_appdir} ${ns_appbindir}/Emacs
38
39### ns.mk ends here
diff --git a/src/nsfns.m b/src/nsfns.m
index 072005d2d3d..e2c8c3722c0 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -870,16 +870,6 @@ x_set_icon_type (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
870} 870}
871 871
872 872
873/* Xism; we stub out (we do implement this in ns-win.el) */
874int
875XParseGeometry (char *string, int *x, int *y,
876 unsigned int *width, unsigned int *height)
877{
878 message1 ("Warning: XParseGeometry not supported under NS.\n");
879 return 0;
880}
881
882
883/* TODO: move to nsterm? */ 873/* TODO: move to nsterm? */
884int 874int
885ns_lisp_to_cursor_type (Lisp_Object arg) 875ns_lisp_to_cursor_type (Lisp_Object arg)
@@ -1399,6 +1389,9 @@ This function is an internal primitive--use `make-frame' instead. */)
1399 1389
1400 UNGCPRO; 1390 UNGCPRO;
1401 1391
1392 if (window_prompting & USPosition)
1393 x_set_offset (f, f->left_pos, f->top_pos, 1);
1394
1402 /* Make sure windows on this frame appear in calls to next-window 1395 /* Make sure windows on this frame appear in calls to next-window
1403 and similar functions. */ 1396 and similar functions. */
1404 Vwindow_list = Qnil; 1397 Vwindow_list = Qnil;
diff --git a/src/nsmenu.m b/src/nsmenu.m
index 3057f4f6a20..907d3eac622 100644
--- a/src/nsmenu.m
+++ b/src/nsmenu.m
@@ -588,10 +588,7 @@ extern NSString *NSMenuDidBeginTrackingNotification;
588 From 10.6 on, we could also use -[NSMenu propertiesToUpdate]: In the 588 From 10.6 on, we could also use -[NSMenu propertiesToUpdate]: In the
589 key press case, NSMenuPropertyItemImage (e.g.) won't be set. 589 key press case, NSMenuPropertyItemImage (e.g.) won't be set.
590 */ 590 */
591 if (trackingMenu == 0 591 if (trackingMenu == 0)
592 /* Also, don't try this if from an event picked up asynchronously,
593 as lots of lisp evaluation happens in ns_update_menubar. */
594 || handling_signal != 0)
595 return; 592 return;
596/*fprintf (stderr, "Updating menu '%s'\n", [[self title] UTF8String]); NSLog (@"%@\n", event); */ 593/*fprintf (stderr, "Updating menu '%s'\n", [[self title] UTF8String]); NSLog (@"%@\n", event); */
597 ns_update_menubar (frame, 1, self); 594 ns_update_menubar (frame, 1, self);
diff --git a/src/nsterm.m b/src/nsterm.m
index 41520ce74d1..aa869e3ff44 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -3336,8 +3336,7 @@ ns_send_appdefined (int value)
3336} 3336}
3337 3337
3338static int 3338static int
3339ns_read_socket (struct terminal *terminal, int expected, 3339ns_read_socket (struct terminal *terminal, struct input_event *hold_quit)
3340 struct input_event *hold_quit)
3341/* -------------------------------------------------------------------------- 3340/* --------------------------------------------------------------------------
3342 External (hook): Post an event to ourself and keep reading events until 3341 External (hook): Post an event to ourself and keep reading events until
3343 we read it back again. In effect process all events which were waiting. 3342 we read it back again. In effect process all events which were waiting.
@@ -3355,16 +3354,12 @@ ns_read_socket (struct terminal *terminal, int expected,
3355 if (interrupt_input_blocked) 3354 if (interrupt_input_blocked)
3356 { 3355 {
3357 interrupt_input_pending = 1; 3356 interrupt_input_pending = 1;
3358#ifdef SYNC_INPUT
3359 pending_signals = 1; 3357 pending_signals = 1;
3360#endif
3361 return -1; 3358 return -1;
3362 } 3359 }
3363 3360
3364 interrupt_input_pending = 0; 3361 interrupt_input_pending = 0;
3365#ifdef SYNC_INPUT
3366 pending_signals = pending_atimers; 3362 pending_signals = pending_atimers;
3367#endif
3368 3363
3369 BLOCK_INPUT; 3364 BLOCK_INPUT;
3370 n_emacs_events_pending = 0; 3365 n_emacs_events_pending = 0;
@@ -3726,7 +3721,7 @@ ns_judge_scroll_bars (struct frame *f)
3726 removed = YES; 3721 removed = YES;
3727 } 3722 }
3728 3723
3729 if (removed) 3724 if (removed)
3730 [eview updateFrameSize: NO]; 3725 [eview updateFrameSize: NO];
3731} 3726}
3732 3727
@@ -3988,7 +3983,6 @@ ns_term_init (Lisp_Object display_name)
3988 /* count object allocs (About, click icon); on OS X use ObjectAlloc tool */ 3983 /* count object allocs (About, click icon); on OS X use ObjectAlloc tool */
3989 /*GSDebugAllocationActive (YES); */ 3984 /*GSDebugAllocationActive (YES); */
3990 BLOCK_INPUT; 3985 BLOCK_INPUT;
3991 handling_signal = 0;
3992 3986
3993 baud_rate = 38400; 3987 baud_rate = 38400;
3994 Fset_input_interrupt_mode (Qnil); 3988 Fset_input_interrupt_mode (Qnil);
@@ -4209,7 +4203,7 @@ ns_term_init (Lisp_Object display_name)
4209 NSColorPboardType, 4203 NSColorPboardType,
4210 NSFontPboardType, nil] retain]; 4204 NSFontPboardType, nil] retain];
4211 4205
4212 4206
4213 [NSApp run]; 4207 [NSApp run];
4214 ns_do_open_file = YES; 4208 ns_do_open_file = YES;
4215 return dpyinfo; 4209 return dpyinfo;
@@ -6239,7 +6233,7 @@ not_in_argv (NSString *arg)
6239 NSRect r = [super constrainFrameRect:frameRect toScreen:screen]; 6233 NSRect r = [super constrainFrameRect:frameRect toScreen:screen];
6240 return r; 6234 return r;
6241 } 6235 }
6242 6236
6243 if (f->output_data.ns->dont_constrain 6237 if (f->output_data.ns->dont_constrain
6244 || ns_menu_bar_should_be_hidden ()) 6238 || ns_menu_bar_should_be_hidden ())
6245 return frameRect; 6239 return frameRect;
diff --git a/src/process.c b/src/process.c
index 6dbff6f4b16..c654369627d 100644
--- a/src/process.c
+++ b/src/process.c
@@ -1609,14 +1609,10 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
1609#if !defined (WINDOWSNT) && defined (FD_CLOEXEC) 1609#if !defined (WINDOWSNT) && defined (FD_CLOEXEC)
1610 int wait_child_setup[2]; 1610 int wait_child_setup[2];
1611#endif 1611#endif
1612#ifdef SIGCHLD
1612 sigset_t blocked, procmask; 1613 sigset_t blocked, procmask;
1613 struct sigaction sigint_action;
1614 struct sigaction sigquit_action;
1615 struct sigaction sigpipe_action;
1616#ifdef AIX
1617 struct sigaction sighup_action;
1618#endif 1614#endif
1619 /* Use volatile to protect variables from being clobbered by longjmp. */ 1615 /* Use volatile to protect variables from being clobbered by vfork. */
1620 volatile int forkin, forkout; 1616 volatile int forkin, forkout;
1621 volatile int pty_flag = 0; 1617 volatile int pty_flag = 0;
1622 1618
@@ -1708,25 +1704,13 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
1708 XPROCESS (process)->pty_flag = pty_flag; 1704 XPROCESS (process)->pty_flag = pty_flag;
1709 pset_status (XPROCESS (process), Qrun); 1705 pset_status (XPROCESS (process), Qrun);
1710 1706
1707#ifdef SIGCHLD
1711 /* Delay interrupts until we have a chance to store 1708 /* Delay interrupts until we have a chance to store
1712 the new fork's pid in its process structure */ 1709 the new fork's pid in its process structure */
1713 sigemptyset (&blocked); 1710 sigemptyset (&blocked);
1714#ifdef SIGCHLD
1715 sigaddset (&blocked, SIGCHLD); 1711 sigaddset (&blocked, SIGCHLD);
1716#endif
1717#ifdef HAVE_WORKING_VFORK
1718 /* On many hosts (e.g. Solaris 2.4), if a vforked child calls `signal',
1719 this sets the parent's signal handlers as well as the child's.
1720 So delay all interrupts whose handlers the child might munge,
1721 and record the current handlers so they can be restored later. */
1722 sigaddset (&blocked, SIGINT ); sigaction (SIGINT , 0, &sigint_action );
1723 sigaddset (&blocked, SIGQUIT); sigaction (SIGQUIT, 0, &sigquit_action);
1724 sigaddset (&blocked, SIGPIPE); sigaction (SIGPIPE, 0, &sigpipe_action);
1725#ifdef AIX
1726 sigaddset (&blocked, SIGHUP ); sigaction (SIGHUP , 0, &sighup_action );
1727#endif
1728#endif /* HAVE_WORKING_VFORK */
1729 pthread_sigmask (SIG_BLOCK, &blocked, &procmask); 1712 pthread_sigmask (SIG_BLOCK, &blocked, &procmask);
1713#endif
1730 1714
1731 FD_SET (inchannel, &input_wait_mask); 1715 FD_SET (inchannel, &input_wait_mask);
1732 FD_SET (inchannel, &non_keyboard_wait_mask); 1716 FD_SET (inchannel, &non_keyboard_wait_mask);
@@ -1879,8 +1863,10 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
1879 in the child. */ 1863 in the child. */
1880 signal (SIGPIPE, SIG_DFL); 1864 signal (SIGPIPE, SIG_DFL);
1881 1865
1866#ifdef SIGCHLD
1882 /* Stop blocking signals in the child. */ 1867 /* Stop blocking signals in the child. */
1883 pthread_sigmask (SIG_SETMASK, &procmask, 0); 1868 pthread_sigmask (SIG_SETMASK, &procmask, 0);
1869#endif
1884 1870
1885 if (pty_flag) 1871 if (pty_flag)
1886 child_setup_tty (xforkout); 1872 child_setup_tty (xforkout);
@@ -1959,19 +1945,10 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
1959#endif 1945#endif
1960 } 1946 }
1961 1947
1962 /* Restore the signal state whether vfork succeeded or not. 1948#ifdef SIGCHLD
1963 (We will signal an error, below, if it failed.) */
1964#ifdef HAVE_WORKING_VFORK
1965 /* Restore the parent's signal handlers. */
1966 sigaction (SIGINT, &sigint_action, 0);
1967 sigaction (SIGQUIT, &sigquit_action, 0);
1968 sigaction (SIGPIPE, &sigpipe_action, 0);
1969#ifdef AIX
1970 sigaction (SIGHUP, &sighup_action, 0);
1971#endif
1972#endif /* HAVE_WORKING_VFORK */
1973 /* Stop blocking signals in the parent. */ 1949 /* Stop blocking signals in the parent. */
1974 pthread_sigmask (SIG_SETMASK, &procmask, 0); 1950 pthread_sigmask (SIG_SETMASK, &procmask, 0);
1951#endif
1975 1952
1976 /* Now generate the error if vfork failed. */ 1953 /* Now generate the error if vfork failed. */
1977 if (pid < 0) 1954 if (pid < 0)
@@ -4395,10 +4372,8 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
4395 Otherwise, do pending quit if requested. */ 4372 Otherwise, do pending quit if requested. */
4396 if (read_kbd >= 0) 4373 if (read_kbd >= 0)
4397 QUIT; 4374 QUIT;
4398#ifdef SYNC_INPUT
4399 else 4375 else
4400 process_pending_signals (); 4376 process_pending_signals ();
4401#endif
4402 4377
4403 /* Exit now if the cell we're waiting for became non-nil. */ 4378 /* Exit now if the cell we're waiting for became non-nil. */
4404 if (! NILP (wait_for_cell) && ! NILP (XCAR (wait_for_cell))) 4379 if (! NILP (wait_for_cell) && ! NILP (XCAR (wait_for_cell)))
diff --git a/src/ralloc.c b/src/ralloc.c
index b0134ea730a..9a4b1ada229 100644
--- a/src/ralloc.c
+++ b/src/ralloc.c
@@ -1204,9 +1204,15 @@ r_alloc_init (void)
1204 UNBLOCK_INPUT; 1204 UNBLOCK_INPUT;
1205#else 1205#else
1206#ifndef SYSTEM_MALLOC 1206#ifndef SYSTEM_MALLOC
1207 /* Give GNU malloc's morecore some hysteresis 1207 /* Give GNU malloc's morecore some hysteresis so that we move all
1208 so that we move all the relocatable blocks much less often. */ 1208 the relocatable blocks much less often. The number used to be
1209 __malloc_extra_blocks = 64; 1209 64, but alloc.c would override that with 32 in code that was
1210 removed when SYNC_INPUT became the only input handling mode.
1211 That code was conditioned on !DOUG_LEA_MALLOC, so the call to
1212 mallopt above is left unchanged. (Actually, I think there's no
1213 system nowadays that uses DOUG_LEA_MALLOC and also uses
1214 REL_ALLOC.) */
1215 __malloc_extra_blocks = 32;
1210#endif 1216#endif
1211#endif 1217#endif
1212 1218
diff --git a/src/regex.c b/src/regex.c
index 92264ccae23..17562043df1 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -1831,9 +1831,9 @@ typedef struct
1831/* The next available element. */ 1831/* The next available element. */
1832#define COMPILE_STACK_TOP (compile_stack.stack[compile_stack.avail]) 1832#define COMPILE_STACK_TOP (compile_stack.stack[compile_stack.avail])
1833 1833
1834/* Explicit quit checking is only used on NTemacs and whenever we 1834/* Explicit quit checking is needed for Emacs, which uses polling to
1835 use polling to process input events. */ 1835 process input events. */
1836#if defined emacs && (defined WINDOWSNT || defined SYNC_INPUT) && defined QUIT 1836#ifdef emacs
1837extern int immediate_quit; 1837extern int immediate_quit;
1838# define IMMEDIATE_QUIT_CHECK \ 1838# define IMMEDIATE_QUIT_CHECK \
1839 do { \ 1839 do { \
diff --git a/src/search.c b/src/search.c
index 99fd7971e4c..1735ade5d8a 100644
--- a/src/search.c
+++ b/src/search.c
@@ -674,7 +674,7 @@ scan_buffer (register int target, ptrdiff_t start, ptrdiff_t end,
674 obstacle --- the last character the dumb search loop should 674 obstacle --- the last character the dumb search loop should
675 examine. */ 675 examine. */
676 ptrdiff_t ceiling_byte = CHAR_TO_BYTE (end) - 1; 676 ptrdiff_t ceiling_byte = CHAR_TO_BYTE (end) - 1;
677 ptrdiff_t start_byte = CHAR_TO_BYTE (start); 677 ptrdiff_t start_byte;
678 ptrdiff_t tem; 678 ptrdiff_t tem;
679 679
680 /* If we're looking for a newline, consult the newline cache 680 /* If we're looking for a newline, consult the newline cache
@@ -684,18 +684,22 @@ scan_buffer (register int target, ptrdiff_t start, ptrdiff_t end,
684 ptrdiff_t next_change; 684 ptrdiff_t next_change;
685 immediate_quit = 0; 685 immediate_quit = 0;
686 while (region_cache_forward 686 while (region_cache_forward
687 (current_buffer, newline_cache, start_byte, &next_change)) 687 (current_buffer, newline_cache, start, &next_change))
688 start_byte = next_change; 688 start = next_change;
689 immediate_quit = allow_quit; 689 immediate_quit = allow_quit;
690 690
691 start_byte = CHAR_TO_BYTE (start);
692
691 /* START should never be after END. */ 693 /* START should never be after END. */
692 if (start_byte > ceiling_byte) 694 if (start_byte > ceiling_byte)
693 start_byte = ceiling_byte; 695 start_byte = ceiling_byte;
694 696
695 /* Now the text after start is an unknown region, and 697 /* Now the text after start is an unknown region, and
696 next_change is the position of the next known region. */ 698 next_change is the position of the next known region. */
697 ceiling_byte = min (next_change - 1, ceiling_byte); 699 ceiling_byte = min (CHAR_TO_BYTE (next_change) - 1, ceiling_byte);
698 } 700 }
701 else
702 start_byte = CHAR_TO_BYTE (start);
699 703
700 /* The dumb loop can only scan text stored in contiguous 704 /* The dumb loop can only scan text stored in contiguous
701 bytes. BUFFER_CEILING_OF returns the last character 705 bytes. BUFFER_CEILING_OF returns the last character
@@ -747,7 +751,7 @@ scan_buffer (register int target, ptrdiff_t start, ptrdiff_t end,
747 { 751 {
748 /* The last character to check before the next obstacle. */ 752 /* The last character to check before the next obstacle. */
749 ptrdiff_t ceiling_byte = CHAR_TO_BYTE (end); 753 ptrdiff_t ceiling_byte = CHAR_TO_BYTE (end);
750 ptrdiff_t start_byte = CHAR_TO_BYTE (start); 754 ptrdiff_t start_byte;
751 ptrdiff_t tem; 755 ptrdiff_t tem;
752 756
753 /* Consult the newline cache, if appropriate. */ 757 /* Consult the newline cache, if appropriate. */
@@ -756,18 +760,22 @@ scan_buffer (register int target, ptrdiff_t start, ptrdiff_t end,
756 ptrdiff_t next_change; 760 ptrdiff_t next_change;
757 immediate_quit = 0; 761 immediate_quit = 0;
758 while (region_cache_backward 762 while (region_cache_backward
759 (current_buffer, newline_cache, start_byte, &next_change)) 763 (current_buffer, newline_cache, start, &next_change))
760 start_byte = next_change; 764 start = next_change;
761 immediate_quit = allow_quit; 765 immediate_quit = allow_quit;
762 766
767 start_byte = CHAR_TO_BYTE (start);
768
763 /* Start should never be at or before end. */ 769 /* Start should never be at or before end. */
764 if (start_byte <= ceiling_byte) 770 if (start_byte <= ceiling_byte)
765 start_byte = ceiling_byte + 1; 771 start_byte = ceiling_byte + 1;
766 772
767 /* Now the text before start is an unknown region, and 773 /* Now the text before start is an unknown region, and
768 next_change is the position of the next known region. */ 774 next_change is the position of the next known region. */
769 ceiling_byte = max (next_change, ceiling_byte); 775 ceiling_byte = max (CHAR_TO_BYTE (next_change), ceiling_byte);
770 } 776 }
777 else
778 start_byte = CHAR_TO_BYTE (start);
771 779
772 /* Stop scanning before the gap. */ 780 /* Stop scanning before the gap. */
773 tem = BUFFER_FLOOR_OF (start_byte - 1); 781 tem = BUFFER_FLOOR_OF (start_byte - 1);
diff --git a/src/sysdep.c b/src/sysdep.c
index 9065b38d6fc..dbfd9efc7d4 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -1447,27 +1447,21 @@ emacs_sigaction_init (struct sigaction *action, signal_handler_t handler)
1447 action->sa_handler = handler; 1447 action->sa_handler = handler;
1448 action->sa_flags = 0; 1448 action->sa_flags = 0;
1449#if defined (SA_RESTART) 1449#if defined (SA_RESTART)
1450 /* Emacs mostly works better with restartable system services. If this 1450 /* SA_RESTART causes interruptible functions with timeouts (e.g.,
1451 flag exists, we probably want to turn it on here. 1451 'select') to reset their timeout on some platforms (e.g.,
1452 However, on some systems (only hpux11 at present) this resets the 1452 HP-UX 11), which is not what we want. Also, when Emacs is
1453 timeout of `select' which means that `select' never finishes if 1453 interactive, we don't want SA_RESTART because we need to poll
1454 it keeps getting signals.
1455 We define BROKEN_SA_RESTART on those systems. */
1456 /* It's not clear why the comment above says "mostly works better". --Stef
1457 When SYNC_INPUT is set, we don't want SA_RESTART because we need to poll
1458 for pending input so we need long-running syscalls to be interrupted 1454 for pending input so we need long-running syscalls to be interrupted
1459 after a signal that sets the interrupt_input_pending flag. */ 1455 after a signal that sets the interrupt_input_pending flag. */
1460 /* Non-interactive keyboard input goes through stdio, where we always 1456 /* Non-interactive keyboard input goes through stdio, where we always
1461 want restartable system calls. */ 1457 want restartable system calls. */
1462# if defined (BROKEN_SA_RESTART) || defined (SYNC_INPUT)
1463 if (noninteractive) 1458 if (noninteractive)
1464# endif
1465 action->sa_flags = SA_RESTART; 1459 action->sa_flags = SA_RESTART;
1466#endif 1460#endif
1467} 1461}
1468 1462
1469#ifdef FORWARD_SIGNAL_TO_MAIN_THREAD 1463#ifdef FORWARD_SIGNAL_TO_MAIN_THREAD
1470pthread_t main_thread; 1464static pthread_t main_thread;
1471#endif 1465#endif
1472 1466
1473/* If we are on the main thread, handle the signal SIG with HANDLER. 1467/* If we are on the main thread, handle the signal SIG with HANDLER.
@@ -1914,11 +1908,9 @@ emacs_write (int fildes, const char *buf, ptrdiff_t nbyte)
1914 { 1908 {
1915 if (errno == EINTR) 1909 if (errno == EINTR)
1916 { 1910 {
1917#ifdef SYNC_INPUT
1918 /* I originally used `QUIT' but that might causes files to 1911 /* I originally used `QUIT' but that might causes files to
1919 be truncated if you hit C-g in the middle of it. --Stef */ 1912 be truncated if you hit C-g in the middle of it. --Stef */
1920 process_pending_signals (); 1913 process_pending_signals ();
1921#endif
1922 continue; 1914 continue;
1923 } 1915 }
1924 else 1916 else
diff --git a/src/syssignal.h b/src/syssignal.h
index 5e733dd812d..e309e6725b7 100644
--- a/src/syssignal.h
+++ b/src/syssignal.h
@@ -64,8 +64,4 @@ extern void emacs_sigaction_init (struct sigaction *, signal_handler_t);
64char *strsignal (int); 64char *strsignal (int);
65#endif 65#endif
66 66
67#ifdef FORWARD_SIGNAL_TO_MAIN_THREAD
68extern pthread_t main_thread;
69#endif
70
71void handle_on_main_thread (int, signal_handler_t); 67void handle_on_main_thread (int, signal_handler_t);
diff --git a/src/termhooks.h b/src/termhooks.h
index 46962a1217d..53e401de409 100644
--- a/src/termhooks.h
+++ b/src/termhooks.h
@@ -592,23 +592,14 @@ struct terminal
592 592
593 TERMINAL indicates which terminal device to read from. Input 593 TERMINAL indicates which terminal device to read from. Input
594 events should be read into BUF, the size of which is given in 594 events should be read into BUF, the size of which is given in
595 SIZE. EXPECTED is non-zero if the caller suspects that new input 595 SIZE.
596 is available.
597 596
598 A positive return value indicates that that many input events 597 A positive return value indicates that that many input events
599 where read into BUF. 598 were read into BUF.
600 Zero means no events were immediately available. 599 Zero means no events were immediately available.
601 A value of -1 means a transient read error, while -2 indicates 600 A value of -1 means a transient read error, while -2 indicates
602 that the device was closed (hangup), and it should be deleted. 601 that the device was closed (hangup), and it should be deleted. */
603
604 XXX Please note that a non-zero value of EXPECTED only means that
605 there is available input on at least one of the currently opened
606 terminal devices -- but not necessarily on this device.
607 Therefore, in most cases EXPECTED should be simply ignored.
608
609 XXX This documentation needs to be updated. */
610 int (*read_socket_hook) (struct terminal *terminal, 602 int (*read_socket_hook) (struct terminal *terminal,
611 int expected,
612 struct input_event *hold_quit); 603 struct input_event *hold_quit);
613 604
614 /* Called when a frame's display becomes entirely up to date. */ 605 /* Called when a frame's display becomes entirely up to date. */
diff --git a/src/unexmacosx.c b/src/unexmacosx.c
index 05a16466dfb..d38b91e955a 100644
--- a/src/unexmacosx.c
+++ b/src/unexmacosx.c
@@ -117,6 +117,13 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
117 117
118#include <assert.h> 118#include <assert.h>
119 119
120/* LC_DATA_IN_CODE is not defined in mach-o/loader.h on OS X 10.7.
121 But it is used if we build with "Command Line Tools for Xcode 4.5
122 (OS X Lion) - Septemper 2012". */
123#ifndef LC_DATA_IN_CODE
124#define LC_DATA_IN_CODE 0x29 /* table of non-instructions in __text */
125#endif
126
120#ifdef _LP64 127#ifdef _LP64
121#define mach_header mach_header_64 128#define mach_header mach_header_64
122#define segment_command segment_command_64 129#define segment_command segment_command_64
@@ -612,6 +619,11 @@ print_load_command_name (int lc)
612 printf ("LC_MAIN "); 619 printf ("LC_MAIN ");
613 break; 620 break;
614#endif 621#endif
622#ifdef LC_DATA_IN_CODE
623 case LC_DATA_IN_CODE:
624 printf ("LC_DATA_IN_CODE ");
625 break;
626#endif
615#ifdef LC_SOURCE_VERSION 627#ifdef LC_SOURCE_VERSION
616 case LC_SOURCE_VERSION: 628 case LC_SOURCE_VERSION:
617 printf ("LC_SOURCE_VERSION"); 629 printf ("LC_SOURCE_VERSION");
@@ -1178,9 +1190,9 @@ copy_dyld_info (struct load_command *lc, long delta)
1178#endif 1190#endif
1179 1191
1180#ifdef LC_FUNCTION_STARTS 1192#ifdef LC_FUNCTION_STARTS
1181/* Copy a LC_FUNCTION_STARTS/LC_DYLIB_CODE_SIGN_DRS load command from 1193/* Copy a LC_FUNCTION_STARTS/LC_DATA_IN_CODE/LC_DYLIB_CODE_SIGN_DRS
1182 the input file to the output file, adjusting the data offset 1194 load command from the input file to the output file, adjusting the
1183 field. */ 1195 data offset field. */
1184static void 1196static void
1185copy_linkedit_data (struct load_command *lc, long delta) 1197copy_linkedit_data (struct load_command *lc, long delta)
1186{ 1198{
@@ -1274,6 +1286,9 @@ dump_it (void)
1274#endif 1286#endif
1275#ifdef LC_FUNCTION_STARTS 1287#ifdef LC_FUNCTION_STARTS
1276 case LC_FUNCTION_STARTS: 1288 case LC_FUNCTION_STARTS:
1289#ifdef LC_DATA_IN_CODE
1290 case LC_DATA_IN_CODE:
1291#endif
1277#ifdef LC_DYLIB_CODE_SIGN_DRS 1292#ifdef LC_DYLIB_CODE_SIGN_DRS
1278 case LC_DYLIB_CODE_SIGN_DRS: 1293 case LC_DYLIB_CODE_SIGN_DRS:
1279#endif 1294#endif
diff --git a/src/w32gui.h b/src/w32gui.h
index 1ea185bfaa1..0da8de97f23 100644
--- a/src/w32gui.h
+++ b/src/w32gui.h
@@ -118,9 +118,6 @@ extern int nCmdShow;
118#define PBaseSize (1L << 8) /* program specified base for incrementing */ 118#define PBaseSize (1L << 8) /* program specified base for incrementing */
119#define PWinGravity (1L << 9) /* program specified window gravity */ 119#define PWinGravity (1L << 9) /* program specified window gravity */
120 120
121extern int XParseGeometry (char *, int *, int *, unsigned *, unsigned *);
122
123
124typedef struct { 121typedef struct {
125 int x, y; 122 int x, y;
126 unsigned width, height; 123 unsigned width, height;
diff --git a/src/w32inevt.c b/src/w32inevt.c
index ee07db5335b..a96d8d70483 100644
--- a/src/w32inevt.c
+++ b/src/w32inevt.c
@@ -744,10 +744,9 @@ maybe_generate_resize_event (void)
744 744
745int 745int
746w32_console_read_socket (struct terminal *terminal, 746w32_console_read_socket (struct terminal *terminal,
747 int expected,
748 struct input_event *hold_quit) 747 struct input_event *hold_quit)
749{ 748{
750 int nev, ret = 0, add; 749 int nev, add;
751 int isdead; 750 int isdead;
752 751
753 if (interrupt_input_blocked) 752 if (interrupt_input_blocked)
@@ -767,8 +766,7 @@ w32_console_read_socket (struct terminal *terminal,
767 /* If nev == -1, there was some kind of error 766 /* If nev == -1, there was some kind of error
768 If nev == 0 then waitp must be zero and no events were available 767 If nev == 0 then waitp must be zero and no events were available
769 so return. */ 768 so return. */
770 UNBLOCK_INPUT; 769 break;
771 return nev;
772 } 770 }
773 771
774 while (nev > 0) 772 while (nev > 0)
@@ -812,9 +810,6 @@ w32_console_read_socket (struct terminal *terminal,
812 queue_ptr++; 810 queue_ptr++;
813 nev--; 811 nev--;
814 } 812 }
815
816 if (ret > 0 || expected == 0)
817 break;
818 } 813 }
819 814
820 /* We don't get told about changes in the window size (only the buffer 815 /* We don't get told about changes in the window size (only the buffer
@@ -824,5 +819,5 @@ w32_console_read_socket (struct terminal *terminal,
824 maybe_generate_resize_event (); 819 maybe_generate_resize_event ();
825 820
826 UNBLOCK_INPUT; 821 UNBLOCK_INPUT;
827 return ret; 822 return nev;
828} 823}
diff --git a/src/w32inevt.h b/src/w32inevt.h
index c874e58ef39..319688b877b 100644
--- a/src/w32inevt.h
+++ b/src/w32inevt.h
@@ -21,7 +21,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
21 21
22extern int w32_console_unicode_input; 22extern int w32_console_unicode_input;
23 23
24extern int w32_console_read_socket (struct terminal *term, int numchars, 24extern int w32_console_read_socket (struct terminal *term,
25 struct input_event *hold_quit); 25 struct input_event *hold_quit);
26extern void w32_console_mouse_position (FRAME_PTR *f, int insist, 26extern void w32_console_mouse_position (FRAME_PTR *f, int insist,
27 Lisp_Object *bar_window, 27 Lisp_Object *bar_window,
diff --git a/src/w32term.c b/src/w32term.c
index 69a16e1852b..b8227c52fed 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -4137,8 +4137,6 @@ static char dbcs_lead = 0;
4137 We return the number of characters stored into the buffer, 4137 We return the number of characters stored into the buffer,
4138 thus pretending to be `read'. 4138 thus pretending to be `read'.
4139 4139
4140 EXPECTED is nonzero if the caller knows input is available.
4141
4142 Some of these messages are reposted back to the message queue since the 4140 Some of these messages are reposted back to the message queue since the
4143 system calls the windows proc directly in a context where we cannot return 4141 system calls the windows proc directly in a context where we cannot return
4144 the data nor can we guarantee the state we are in. So if we dispatch them 4142 the data nor can we guarantee the state we are in. So if we dispatch them
@@ -4149,7 +4147,7 @@ static char dbcs_lead = 0;
4149*/ 4147*/
4150 4148
4151static int 4149static int
4152w32_read_socket (struct terminal *terminal, int expected, 4150w32_read_socket (struct terminal *terminal,
4153 struct input_event *hold_quit) 4151 struct input_event *hold_quit)
4154{ 4152{
4155 int count = 0; 4153 int count = 0;
@@ -4162,6 +4160,7 @@ w32_read_socket (struct terminal *terminal, int expected,
4162 if (interrupt_input_blocked) 4160 if (interrupt_input_blocked)
4163 { 4161 {
4164 interrupt_input_pending = 1; 4162 interrupt_input_pending = 1;
4163 pending_signals = 1;
4165 return -1; 4164 return -1;
4166 } 4165 }
4167 4166
diff --git a/src/w32xfns.c b/src/w32xfns.c
index 33f40fc7c01..018dd14cb80 100644
--- a/src/w32xfns.c
+++ b/src/w32xfns.c
@@ -303,138 +303,6 @@ drain_message_queue (void)
303 } 303 }
304} 304}
305 305
306
307/*
308 * XParseGeometry parses strings of the form
309 * "=<width>x<height>{+-}<xoffset>{+-}<yoffset>", where
310 * width, height, xoffset, and yoffset are unsigned integers.
311 * Example: "=80x24+300-49"
312 * The equal sign is optional.
313 * It returns a bitmask that indicates which of the four values
314 * were actually found in the string. For each value found,
315 * the corresponding argument is updated; for each value
316 * not found, the corresponding argument is left unchanged.
317 */
318
319static int
320read_integer (register char *string, char **NextString)
321{
322 register int Result = 0;
323 int Sign = 1;
324
325 if (*string == '+')
326 string++;
327 else if (*string == '-')
328 {
329 string++;
330 Sign = -1;
331 }
332 for (; (*string >= '0') && (*string <= '9'); string++)
333 {
334 Result = (Result * 10) + (*string - '0');
335 }
336 *NextString = string;
337 if (Sign >= 0)
338 return (Result);
339 else
340 return (-Result);
341}
342
343int
344XParseGeometry (char *string,
345 int *x, int *y,
346 unsigned int *width, unsigned int *height)
347{
348 int mask = NoValue;
349 register char *strind;
350 unsigned int tempWidth, tempHeight;
351 int tempX, tempY;
352 char *nextCharacter;
353
354 if ((string == NULL) || (*string == '\0')) return (mask);
355 if (*string == '=')
356 string++; /* ignore possible '=' at beg of geometry spec */
357
358 strind = (char *)string;
359 if (*strind != '+' && *strind != '-' && *strind != 'x')
360 {
361 tempWidth = read_integer (strind, &nextCharacter);
362 if (strind == nextCharacter)
363 return (0);
364 strind = nextCharacter;
365 mask |= WidthValue;
366 }
367
368 if (*strind == 'x' || *strind == 'X')
369 {
370 strind++;
371 tempHeight = read_integer (strind, &nextCharacter);
372 if (strind == nextCharacter)
373 return (0);
374 strind = nextCharacter;
375 mask |= HeightValue;
376 }
377
378 if ((*strind == '+') || (*strind == '-'))
379 {
380 if (*strind == '-')
381 {
382 strind++;
383 tempX = -read_integer (strind, &nextCharacter);
384 if (strind == nextCharacter)
385 return (0);
386 strind = nextCharacter;
387 mask |= XNegative;
388
389 }
390 else
391 {
392 strind++;
393 tempX = read_integer (strind, &nextCharacter);
394 if (strind == nextCharacter)
395 return (0);
396 strind = nextCharacter;
397 }
398 mask |= XValue;
399 if ((*strind == '+') || (*strind == '-'))
400 {
401 if (*strind == '-')
402 {
403 strind++;
404 tempY = -read_integer (strind, &nextCharacter);
405 if (strind == nextCharacter)
406 return (0);
407 strind = nextCharacter;
408 mask |= YNegative;
409 }
410 else
411 {
412 strind++;
413 tempY = read_integer (strind, &nextCharacter);
414 if (strind == nextCharacter)
415 return (0);
416 strind = nextCharacter;
417 }
418 mask |= YValue;
419 }
420 }
421
422 /* If strind isn't at the end of the string then it's an invalid
423 geometry specification. */
424
425 if (*strind != '\0') return (0);
426
427 if (mask & XValue)
428 *x = tempX;
429 if (mask & YValue)
430 *y = tempY;
431 if (mask & WidthValue)
432 *width = tempWidth;
433 if (mask & HeightValue)
434 *height = tempHeight;
435 return (mask);
436}
437
438/* x_sync is a no-op on W32. */ 306/* x_sync is a no-op on W32. */
439void 307void
440x_sync (struct frame *f) 308x_sync (struct frame *f)
diff --git a/src/window.c b/src/window.c
index fbccab8b358..a6f1104587e 100644
--- a/src/window.c
+++ b/src/window.c
@@ -3462,7 +3462,11 @@ make_window (void)
3462 wset_vertical_scroll_bar_type (w, Qt); 3462 wset_vertical_scroll_bar_type (w, Qt);
3463 wset_window_end_pos (w, make_number (0)); 3463 wset_window_end_pos (w, make_number (0));
3464 wset_window_end_vpos (w, make_number (0)); 3464 wset_window_end_vpos (w, make_number (0));
3465 3465 /* These Lisp fields are marked specially so they're not set to nil by
3466 allocate_window. */
3467 wset_prev_buffers (w, Qnil);
3468 wset_next_buffers (w, Qnil);
3469
3466 /* Initialize non-Lisp data. Note that allocate_window zeroes out all 3470 /* Initialize non-Lisp data. Note that allocate_window zeroes out all
3467 non-Lisp data, so do it only for slots which should not be zero. */ 3471 non-Lisp data, so do it only for slots which should not be zero. */
3468 w->nrows_scale_factor = w->ncols_scale_factor = 1; 3472 w->nrows_scale_factor = w->ncols_scale_factor = 1;
diff --git a/src/window.h b/src/window.h
index 62ae43a999d..115b361194c 100644
--- a/src/window.h
+++ b/src/window.h
@@ -220,13 +220,6 @@ struct window
220 /* t means this window's child windows are not (re-)combined. */ 220 /* t means this window's child windows are not (re-)combined. */
221 Lisp_Object combination_limit; 221 Lisp_Object combination_limit;
222 222
223 /* Alist of <buffer, window-start, window-point> triples listing
224 buffers previously shown in this window. */
225 Lisp_Object prev_buffers;
226
227 /* List of buffers re-shown in this window. */
228 Lisp_Object next_buffers;
229
230 /* An alist with parameters. */ 223 /* An alist with parameters. */
231 Lisp_Object window_parameters; 224 Lisp_Object window_parameters;
232 225
@@ -238,6 +231,14 @@ struct window
238 struct glyph_matrix *current_matrix; 231 struct glyph_matrix *current_matrix;
239 struct glyph_matrix *desired_matrix; 232 struct glyph_matrix *desired_matrix;
240 233
234 /* The two Lisp_Object fields below are marked in a special way,
235 which is why they're placed after `current_matrix'. */
236 /* Alist of <buffer, window-start, window-point> triples listing
237 buffers previously shown in this window. */
238 Lisp_Object prev_buffers;
239 /* List of buffers re-shown in this window. */
240 Lisp_Object next_buffers;
241
241 /* Number saying how recently window was selected. */ 242 /* Number saying how recently window was selected. */
242 int use_time; 243 int use_time;
243 244
diff --git a/src/xdisp.c b/src/xdisp.c
index 8e0975cf65a..f00719be37a 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -7755,7 +7755,7 @@ compute_stop_pos_backwards (struct it *it)
7755 { 7755 {
7756 it->end_charpos = min (charpos + 1, ZV); 7756 it->end_charpos = min (charpos + 1, ZV);
7757 charpos = max (charpos - SCAN_BACK_LIMIT, BEGV); 7757 charpos = max (charpos - SCAN_BACK_LIMIT, BEGV);
7758 SET_TEXT_POS (pos, charpos, BYTE_TO_CHAR (charpos)); 7758 SET_TEXT_POS (pos, charpos, CHAR_TO_BYTE (charpos));
7759 reseat_1 (it, pos, 0); 7759 reseat_1 (it, pos, 0);
7760 compute_stop_pos (it); 7760 compute_stop_pos (it);
7761 /* We must advance forward, right? */ 7761 /* We must advance forward, right? */
@@ -9290,12 +9290,6 @@ add_to_log (const char *format, Lisp_Object arg1, Lisp_Object arg2)
9290 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; 9290 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
9291 USE_SAFE_ALLOCA; 9291 USE_SAFE_ALLOCA;
9292 9292
9293 /* Do nothing if called asynchronously. Inserting text into
9294 a buffer may call after-change-functions and alike and
9295 that would means running Lisp asynchronously. */
9296 if (handling_signal)
9297 return;
9298
9299 fmt = msg = Qnil; 9293 fmt = msg = Qnil;
9300 GCPRO4 (fmt, msg, arg1, arg2); 9294 GCPRO4 (fmt, msg, arg1, arg2);
9301 9295
@@ -16750,28 +16744,33 @@ try_window_reusing_current_matrix (struct window *w)
16750 } 16744 }
16751 if (row < bottom_row) 16745 if (row < bottom_row)
16752 { 16746 {
16753 struct glyph *glyph = row->glyphs[TEXT_AREA] + w->cursor.hpos; 16747 /* Can't simply scan the row for point with
16754 struct glyph *end = row->glyphs[TEXT_AREA] + row->used[TEXT_AREA]; 16748 bidi-reordered glyph rows. Let set_cursor_from_row
16755 16749 figure out where to put the cursor, and if it fails,
16756 /* Can't use this optimization with bidi-reordered glyph 16750 give up. */
16757 rows, unless cursor is already at point. */
16758 if (!NILP (BVAR (XBUFFER (w->buffer), bidi_display_reordering))) 16751 if (!NILP (BVAR (XBUFFER (w->buffer), bidi_display_reordering)))
16759 { 16752 {
16760 if (!(w->cursor.hpos >= 0 16753 if (!set_cursor_from_row (w, row, w->current_matrix,
16761 && w->cursor.hpos < row->used[TEXT_AREA] 16754 0, 0, 0, 0))
16762 && BUFFERP (glyph->object) 16755 {
16763 && glyph->charpos == PT)) 16756 clear_glyph_matrix (w->desired_matrix);
16764 return 0; 16757 return 0;
16758 }
16765 } 16759 }
16766 else 16760 else
16767 for (; glyph < end 16761 {
16768 && (!BUFFERP (glyph->object) 16762 struct glyph *glyph = row->glyphs[TEXT_AREA] + w->cursor.hpos;
16769 || glyph->charpos < PT); 16763 struct glyph *end = row->glyphs[TEXT_AREA] + row->used[TEXT_AREA];
16770 glyph++) 16764
16771 { 16765 for (; glyph < end
16772 w->cursor.hpos++; 16766 && (!BUFFERP (glyph->object)
16773 w->cursor.x += glyph->pixel_width; 16767 || glyph->charpos < PT);
16774 } 16768 glyph++)
16769 {
16770 w->cursor.hpos++;
16771 w->cursor.x += glyph->pixel_width;
16772 }
16773 }
16775 } 16774 }
16776 } 16775 }
16777 16776
diff --git a/src/xterm.c b/src/xterm.c
index 900a1d78b80..8c955d0e576 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -7109,19 +7109,15 @@ x_dispatch_event (XEvent *event, Display *display)
7109 7109
7110 7110
7111/* Read events coming from the X server. 7111/* Read events coming from the X server.
7112 This routine is called by the SIGIO handler only if SYNC_INPUT is 7112 Return as soon as there are no more events to be read.
7113 not defined.
7114 We return as soon as there are no more events to be read.
7115 7113
7116 We return the number of characters stored into the buffer, 7114 Return the number of characters stored into the buffer,
7117 thus pretending to be `read' (except the characters we store 7115 thus pretending to be `read' (except the characters we store
7118 in the keyboard buffer can be multibyte, so are not necessarily 7116 in the keyboard buffer can be multibyte, so are not necessarily
7119 C chars). 7117 C chars). */
7120
7121 EXPECTED is nonzero if the caller knows input is available. */
7122 7118
7123static int 7119static int
7124XTread_socket (struct terminal *terminal, int expected, struct input_event *hold_quit) 7120XTread_socket (struct terminal *terminal, struct input_event *hold_quit)
7125{ 7121{
7126 int count = 0; 7122 int count = 0;
7127 int event_found = 0; 7123 int event_found = 0;
@@ -7129,25 +7125,17 @@ XTread_socket (struct terminal *terminal, int expected, struct input_event *hold
7129 if (interrupt_input_blocked) 7125 if (interrupt_input_blocked)
7130 { 7126 {
7131 interrupt_input_pending = 1; 7127 interrupt_input_pending = 1;
7132#ifdef SYNC_INPUT
7133 pending_signals = 1; 7128 pending_signals = 1;
7134#endif
7135 return -1; 7129 return -1;
7136 } 7130 }
7137 7131
7138 interrupt_input_pending = 0; 7132 interrupt_input_pending = 0;
7139#ifdef SYNC_INPUT
7140 pending_signals = pending_atimers; 7133 pending_signals = pending_atimers;
7141#endif
7142 BLOCK_INPUT; 7134 BLOCK_INPUT;
7143 7135
7144 /* So people can tell when we have read the available input. */ 7136 /* So people can tell when we have read the available input. */
7145 input_signal_count++; 7137 input_signal_count++;
7146 7138
7147#ifndef SYNC_INPUT
7148 ++handling_signal;
7149#endif
7150
7151 /* For debugging, this gives a way to fake an I/O error. */ 7139 /* For debugging, this gives a way to fake an I/O error. */
7152 if (terminal->display_info.x == XTread_socket_fake_io_error) 7140 if (terminal->display_info.x == XTread_socket_fake_io_error)
7153 { 7141 {
@@ -7236,9 +7224,6 @@ XTread_socket (struct terminal *terminal, int expected, struct input_event *hold
7236 pending_autoraise_frame = 0; 7224 pending_autoraise_frame = 0;
7237 } 7225 }
7238 7226
7239#ifndef SYNC_INPUT
7240 --handling_signal;
7241#endif
7242 UNBLOCK_INPUT; 7227 UNBLOCK_INPUT;
7243 7228
7244 return count; 7229 return count;
@@ -7788,7 +7773,6 @@ x_connection_closed (Display *dpy, const char *error_message)
7788 7773
7789 error_msg = alloca (strlen (error_message) + 1); 7774 error_msg = alloca (strlen (error_message) + 1);
7790 strcpy (error_msg, error_message); 7775 strcpy (error_msg, error_message);
7791 handling_signal = 0;
7792 7776
7793 /* Inhibit redisplay while frames are being deleted. */ 7777 /* Inhibit redisplay while frames are being deleted. */
7794 specbind (Qinhibit_redisplay, Qt); 7778 specbind (Qinhibit_redisplay, Qt);
diff --git a/test/automated/ruby-mode-tests.el b/test/automated/ruby-mode-tests.el
index e711b52fb9c..ba3040577b1 100644
--- a/test/automated/ruby-mode-tests.el
+++ b/test/automated/ruby-mode-tests.el
@@ -219,12 +219,16 @@ VALUES-PLIST is a list with alternating index and value elements."
219 (should (string= "foo do |b|\nend" (buffer-string))))) 219 (should (string= "foo do |b|\nend" (buffer-string)))))
220 220
221(ert-deftest ruby-toggle-block-to-brace () 221(ert-deftest ruby-toggle-block-to-brace ()
222 (with-temp-buffer 222 (let ((pairs '((16 . "foo {|b| b + 2 }")
223 (insert "foo do |b|\nend") 223 (15 . "foo {|b|\n b + 2\n}"))))
224 (ruby-mode) 224 (dolist (pair pairs)
225 (beginning-of-line) 225 (with-temp-buffer
226 (ruby-toggle-block) 226 (let ((fill-column (car pair)))
227 (should (string= "foo {|b|\n}" (buffer-string))))) 227 (insert "foo do |b|\n b + 2\nend")
228 (ruby-mode)
229 (beginning-of-line)
230 (ruby-toggle-block)
231 (should (string= (cdr pair) (buffer-string))))))))
228 232
229(ert-deftest ruby-toggle-block-to-multiline () 233(ert-deftest ruby-toggle-block-to-multiline ()
230 (with-temp-buffer 234 (with-temp-buffer